attachwave 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/app/assets/config/attachwave_manifest.js +2 -0
- data/app/assets/config/manifest.js +9 -0
- data/app/assets/javascripts/attachwave/attachwave.js +124 -0
- data/app/assets/javascripts/attachwave/controllers/filepond_controller.js +39 -0
- data/app/assets/javascripts/attachwave/controllers/index.js +6 -0
- data/app/assets/javascripts/attachwave/filepond-plugin-file-validate-size.min.js +9 -0
- data/app/assets/javascripts/attachwave/filepond-plugin-file-validate-type.js +231 -0
- data/app/assets/javascripts/attachwave/filepond-plugin-file-validate-type.min.js +9 -0
- data/app/assets/javascripts/attachwave/filepond.esm.js +9767 -0
- data/app/assets/javascripts/attachwave/filepond.esm.min.js +9 -0
- data/app/assets/javascripts/attachwave/filepond.js +12782 -0
- data/app/assets/javascripts/attachwave/filepond.min.js +9 -0
- data/app/assets/javascripts/attachwave/jquery.fileuploader.min.js +7 -0
- data/app/assets/stylesheets/attachwave/filepond.css +1049 -0
- data/app/assets/stylesheets/attachwave/filepond.min.css +8 -0
- data/app/assets/stylesheets/attachwave/jquery.fileuploader.min.css +8 -0
- data/app/controllers/attachwave/attachments_controller.rb +117 -0
- data/app/models/attachwave/adjunto.rb +78 -0
- data/app/uploaders/attachwave/attachments_uploader.rb +36 -0
- data/app/views/attachwave/attachments/_form.html.erb +12 -0
- data/app/views/attachwave/attachments/_form_simple.html.erb +20 -0
- data/app/views/attachwave/attachments/_index.html.erb +21 -0
- data/app/views/attachwave/attachments/_row.html.erb +26 -0
- data/app/views/attachwave/attachments/destroy.js.erb +5 -0
- data/app/views/attachwave/attachments/index.html.erb +11 -0
- data/app/views/attachwave/attachments/new.html.erb +1 -0
- data/app/views/attachwave/attachments/show.html.erb +1 -0
- data/config/routes.rb +22 -0
- data/lib/attachwave/engine.rb +66 -0
- data/lib/attachwave.rb +3 -0
- metadata +127 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
/*!
|
2
|
+
* FilePond 4.32.9
|
3
|
+
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
4
|
+
* Please visit https://pqina.nl/filepond/ for details.
|
5
|
+
*/
|
6
|
+
|
7
|
+
/* eslint-disable */
|
8
|
+
|
9
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).FilePond={})}(this,function(e){"use strict";var t=function(e,t){for(var n in e)e.hasOwnProperty(n)&&t(n,e[n])},n=function(e){var n={};return t(e,function(t){!function(e,t,n){"function"!=typeof n?Object.defineProperty(e,t,Object.assign({},n)):e[t]=n}(n,t,e[t])}),n},r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null===n)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,n)},o=["svg","path"],i=function(e){return o.includes(e)},a=function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"==typeof n&&(o=n,n=null);var a=i(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n&&(i(e)?r(a,"class",n):a.className=n),t(o,function(e,t){r(a,e,t)}),a},s=function(e,t){return function(e,n){return void 0!==n?t.splice(n,0,e):t.push(e),e}},u=function(e,t){return function(n){return t.splice(t.indexOf(n),1),n.element.parentNode&&e.removeChild(n.element),n}},l="undefined"!=typeof window&&void 0!==window.document,c=function(){return l},f="children"in(c()?a("svg"):{})?function(e){return e.children.length}:function(e){return e.childNodes.length},d=function(e,t,n,r){var o=n[0]||e.left,i=n[1]||e.top,a=o+e.width,s=i+e.height*(r[1]||1),u={element:Object.assign({},e),inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:o,top:i,right:a,bottom:s}};return t.filter(function(e){return!e.isRectIgnored()}).map(function(e){return e.rect}).forEach(function(e){p(u.inner,Object.assign({},e.inner)),p(u.outer,Object.assign({},e.outer))}),E(u.inner),u.outer.bottom+=u.element.marginBottom,u.outer.right+=u.element.marginRight,E(u.outer),u},p=function(e,t){t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},E=function(e){e.width=e.right-e.left,e.height=e.bottom-e.top},_=function(e){return"number"==typeof e},T=function(e){return e<.5?2*e*e:(4-2*e)*e-1},I={spring:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiffness,r=void 0===t?.5:t,o=e.damping,i=void 0===o?.75:o,a=e.mass,s=void 0===a?10:a,u=null,l=null,c=0,f=!1,d=n({interpolate:function(e,t){if(!f){if(!_(u)||!_(l))return f=!0,void(c=0);(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001;return Math.abs(e-t)<r&&Math.abs(n)<r})(l+=c+=-(l-u)*r/s,u,c*=i)||t?(l=u,c=0,f=!0,d.onupdate(l),d.oncomplete(l)):d.onupdate(l)}},target:{set:function(e){if(_(e)&&!_(l)&&(l=e),null===u&&(u=e,l=e),l===(u=e)||void 0===u)return f=!0,c=0,d.onupdate(l),void d.oncomplete(l);f=!1},get:function(){return u}},resting:{get:function(){return f}},onupdate:function(e){},oncomplete:function(e){}});return d},tween:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r.duration,i=void 0===o?500:o,a=r.easing,s=void 0===a?T:a,u=r.delay,l=void 0===u?0:u,c=null,f=!0,d=!1,p=null,E=n({interpolate:function(n,r){f||null===p||(null===c&&(c=n),n-c<l||((e=n-c-l)>=i||r?(e=1,t=d?0:1,E.onupdate(t*p),E.oncomplete(t*p),f=!0):(t=e/i,E.onupdate((e>=0?s(d?1-t:t):0)*p))))},target:{get:function(){return d?0:p},set:function(e){if(null===p)return p=e,E.onupdate(e),void E.oncomplete(e);e<p?(p=1,d=!0):(d=!1,p=e),f=!1,c=null}},resting:{get:function(){return f}},onupdate:function(e){},oncomplete:function(e){}});return E}},v=function(e,t,n){var r=e[t]&&"object"==typeof e[t][n]?e[t][n]:e[t]||e,o="string"==typeof r?r:r.type,i="object"==typeof r?Object.assign({},r):{};return I[o]?I[o](i):null},m=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(t=Array.isArray(t)?t:[t]).forEach(function(t){e.forEach(function(e){var o=e,i=function(){return n[e]},a=function(t){return n[e]=t};"object"==typeof e&&(o=e.key,i=e.getter||i,a=e.setter||a),t[o]&&!r||(t[o]={get:i,set:a})})})},h=function(e){return null!=e},g={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},R=function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!0;for(var n in t)if(t[n]!==e[n])return!0;return!1},O=function(e,t){var n=t.opacity,r=t.perspective,o=t.translateX,i=t.translateY,a=t.scaleX,s=t.scaleY,u=t.rotateX,l=t.rotateY,c=t.rotateZ,f=t.originX,d=t.originY,p=t.width,E=t.height,_="",T="";(h(f)||h(d))&&(T+="transform-origin: "+(f||0)+"px "+(d||0)+"px;"),h(r)&&(_+="perspective("+r+"px) "),(h(o)||h(i))&&(_+="translate3d("+(o||0)+"px, "+(i||0)+"px, 0) "),(h(a)||h(s))&&(_+="scale3d("+(h(a)?a:1)+", "+(h(s)?s:1)+", 1) "),h(c)&&(_+="rotateZ("+c+"rad) "),h(u)&&(_+="rotateX("+u+"rad) "),h(l)&&(_+="rotateY("+l+"rad) "),_.length&&(T+="transform:"+_+";"),h(n)&&(T+="opacity:"+n+";",0===n&&(T+="visibility:hidden;"),n<1&&(T+="pointer-events:none;")),h(E)&&(T+="height:"+E+"px;"),h(p)&&(T+="width:"+p+"px;");var I=e.elementCurrentStyle||"";T.length===I.length&&T===I||(e.style.cssText=T,e.elementCurrentStyle=T)},y={styles:function(e){var t=e.mixinConfig,n=e.viewProps,r=e.viewInternalAPI,o=e.viewExternalAPI,i=e.view,a=Object.assign({},n),s={};m(t,[r,o],n);var u=function(){return i.rect?d(i.rect,i.childViews,[n.translateX||0,n.translateY||0],[n.scaleX||0,n.scaleY||0]):null};return r.rect={get:u},o.rect={get:u},t.forEach(function(e){n[e]=void 0===a[e]?g[e]:a[e]}),{write:function(){if(R(s,n))return O(i.element,n),Object.assign(s,Object.assign({},n)),!0},destroy:function(){}}},listeners:function(e){e.mixinConfig,e.viewProps,e.viewInternalAPI;var t,n=e.viewExternalAPI,r=(e.viewState,e.view),o=[],i=(t=r.element,function(e,n){t.addEventListener(e,n)}),a=function(e){return function(t,n){e.removeEventListener(t,n)}}(r.element);return n.on=function(e,t){o.push({type:e,fn:t}),i(e,t)},n.off=function(e,t){o.splice(o.findIndex(function(n){return n.type===e&&n.fn===t}),1),a(e,t)},{write:function(){return!0},destroy:function(){o.forEach(function(e){a(e.type,e.fn)})}}},animations:function(e){var n=e.mixinConfig,r=e.viewProps,o=e.viewInternalAPI,i=e.viewExternalAPI,a=Object.assign({},r),s=[];return t(n,function(e,t){var n=v(t);n&&(n.onupdate=function(t){r[e]=t},n.target=a[e],m([{key:e,setter:function(e){n.target!==e&&(n.target=e)},getter:function(){return r[e]}}],[o,i],r,!0),s.push(n))}),{write:function(e){var t=document.hidden,n=!0;return s.forEach(function(r){r.resting||(n=!1),r.interpolate(e,t)}),n},destroy:function(){}}},apis:function(e){var t=e.mixinConfig,n=e.viewProps,r=e.viewExternalAPI;m(t,r,n)}},D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.layoutCalculated||(e.paddingTop=parseInt(n.paddingTop,10)||0,e.marginTop=parseInt(n.marginTop,10)||0,e.marginRight=parseInt(n.marginRight,10)||0,e.marginBottom=parseInt(n.marginBottom,10)||0,e.marginLeft=parseInt(n.marginLeft,10)||0,t.layoutCalculated=!0),e.left=t.offsetLeft||0,e.top=t.offsetTop||0,e.width=t.offsetWidth||0,e.height=t.offsetHeight||0,e.right=e.left+e.width,e.bottom=e.top+e.height,e.scrollTop=t.scrollTop,e.hidden=null===t.offsetParent,e},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.tag,r=void 0===t?"div":t,o=e.name,i=void 0===o?null:o,l=e.attributes,c=void 0===l?{}:l,p=e.read,E=void 0===p?function(){}:p,_=e.write,T=void 0===_?function(){}:_,I=e.create,v=void 0===I?function(){}:I,m=e.destroy,h=void 0===m?function(){}:m,g=e.filterFrameActionsForChild,R=void 0===g?function(e,t){return t}:g,O=e.didCreateView,S=void 0===O?function(){}:O,A=e.didWriteView,L=void 0===A?function(){}:A,b=e.ignoreRect,P=void 0!==b&&b,M=e.ignoreRectUpdate,w=void 0!==M&&M,C=e.mixins,N=void 0===C?[]:C;return function(e){var t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=a(r,"filepond--"+i,c),p=window.getComputedStyle(l,null),_=D(),I=null,m=!1,g=[],O=[],A={},b={},M=[T],C=[E],G=[h],U=function(){return l},B=function(){return g.concat()},F=function(){return I||(I=d(_,g,[0,0],[1,1]))},q={element:{get:U},style:{get:function(){return p}},childViews:{get:B}},V=Object.assign({},q,{rect:{get:F},ref:{get:function(){return A}},is:function(e){return i===e},appendChild:(t=l,function(e,n){void 0!==n&&t.children[n]?t.insertBefore(e,t.children[n]):t.appendChild(e)}),createChildView:function(e){return function(t,n){return t(e,n)}}(e),linkView:function(e){return g.push(e),e},unlinkView:function(e){g.splice(g.indexOf(e),1)},appendChildView:s(0,g),removeChildView:u(l,g),registerWriter:function(e){return M.push(e)},registerReader:function(e){return C.push(e)},registerDestroyer:function(e){return G.push(e)},invalidateLayout:function(){return l.layoutCalculated=!1},dispatch:e.dispatch,query:e.query}),x={element:{get:U},childViews:{get:B},rect:{get:F},resting:{get:function(){return m}},isRectIgnored:function(){return P},_read:function(){I=null,g.forEach(function(e){return e._read()}),!(w&&_.width&&_.height)&&D(_,l,p);var e={root:k,props:o,rect:_};C.forEach(function(t){return t(e)})},_write:function(e,t,n){var r=0===t.length;return M.forEach(function(i){!1===i({props:o,root:k,actions:t,timestamp:e,shouldOptimize:n})&&(r=!1)}),O.forEach(function(t){!1===t.write(e)&&(r=!1)}),g.filter(function(e){return!!e.element.parentNode}).forEach(function(o){o._write(e,R(o,t),n)||(r=!1)}),g.forEach(function(o,i){o.element.parentNode||(k.appendChild(o.element,i),o._read(),o._write(e,R(o,t),n),r=!1)}),m=r,L({props:o,root:k,actions:t,timestamp:e}),r},_destroy:function(){O.forEach(function(e){return e.destroy()}),G.forEach(function(e){e({root:k,props:o})}),g.forEach(function(e){return e._destroy()})}},Y=Object.assign({},q,{rect:{get:function(){return _}}});Object.keys(N).sort(function(e,t){return"styles"===e?1:"styles"===t?-1:0}).forEach(function(e){var t=y[e]({mixinConfig:N[e],viewProps:o,viewState:b,viewInternalAPI:V,viewExternalAPI:x,view:n(Y)});t&&O.push(t)});var k=n(V);v({root:k,props:o});var j=f(l);return g.forEach(function(e,t){k.appendChild(e.element,j+t)}),S(k),n(x)}},A=function(e,t){return function(n){var r=n.root,o=n.props,i=n.actions,a=void 0===i?[]:i,s=n.timestamp,u=n.shouldOptimize;a.filter(function(t){return e[t.type]}).forEach(function(t){return e[t.type]({root:r,props:o,action:t.data,timestamp:s,shouldOptimize:u})}),t&&t({root:r,props:o,actions:a,timestamp:s,shouldOptimize:u})}},L=function(e,t){return t.parentNode.insertBefore(e,t)},b=function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},P=function(e){return Array.isArray(e)},M=function(e){return null==e},w=function(e){return e.trim()},C=function(e){return""+e},N=function(e){return"boolean"==typeof e},G=function(e){return N(e)?e:"true"===e},U=function(e){return"string"==typeof e},B=function(e){return _(e)?e:U(e)?C(e).replace(/[a-z]+/gi,""):0},F=function(e){return parseInt(B(e),10)},q=function(e){return parseFloat(B(e))},V=function(e){return _(e)&&isFinite(e)&&Math.floor(e)===e},x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(V(e))return e;var n=C(e).trim();return/MB$/i.test(n)?(n=n.replace(/MB$i/,"").trim(),F(n)*t*t):/KB/i.test(n)?(n=n.replace(/KB$i/,"").trim(),F(n)*t):F(n)},Y=function(e){return"function"==typeof e},k={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},j=function(e,t,n,r,o){if(null===t)return null;if("function"==typeof t)return t;var i={url:"GET"===n||"PATCH"===n?"?"+e+"=":"",method:n,headers:o,withCredentials:!1,timeout:r,onload:null,ondata:null,onerror:null};if(U(t))return i.url=t,i;if(Object.assign(i,t),U(i.headers)){var a=i.headers.split(/:(.+)/);i.headers={header:a[0],value:a[1]}}return i.withCredentials=G(i.withCredentials),i},H=function(e){return"object"==typeof e&&null!==e},X=function(e){return P(e)?"array":function(e){return null===e}(e)?"null":V(e)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(e)?"bytes":function(e){return H(e)&&U(e.url)&&H(e.process)&&H(e.revert)&&H(e.restore)&&H(e.fetch)}(e)?"api":typeof e},W={array:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return M(e)?[]:P(e)?e:C(e).split(t).map(w).filter(function(e){return e.length})},boolean:G,int:function(e){return"bytes"===X(e)?x(e):F(e)},number:q,float:q,bytes:x,string:function(e){return Y(e)?e:C(e)},function:function(e){return function(e){for(var t=self,n=e.split("."),r=null;r=n.shift();)if(!(t=t[r]))return null;return t}(e)},serverapi:function(e){return(r={}).url=U(n=e)?n:n.url||"",r.timeout=n.timeout?parseInt(n.timeout,10):0,r.headers=n.headers?n.headers:{},t(k,function(e){r[e]=j(e,n[e],k[e],r.timeout,r.headers)}),r.process=n.process||U(n)||n.url?r.process:null,r.remove=n.remove||null,delete r.headers,r;var n,r},object:function(e){try{return JSON.parse(e.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",'))}catch(e){return null}}},z=function(e,t,n){if(e===t)return e;var r,o=X(e);if(o!==n){var i=(r=e,W[n](r));if(o=X(i),null===i)throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+n+'"';e=i}return e},Q=function(e){var r={};return t(e,function(t){var n,o,i,a=e[t];r[t]=(n=a[0],o=a[1],i=n,{enumerable:!0,get:function(){return i},set:function(e){i=z(e,n,o)}})}),n(r)},Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.split(/(?=[A-Z])/).map(function(e){return e.toLowerCase()}).join(t)},K=function(e){return function(n,r,o){var i={};return t(e,function(e){var t=Z(e,"_").toUpperCase();i["SET_"+t]=function(r){try{o.options[e]=r.value}catch(e){}n("DID_SET_"+t,{value:o.options[e]})}}),i}},$=function(e){return function(n){var r={};return t(e,function(e){r["GET_"+Z(e,"_").toUpperCase()]=function(t){return n.options[e]}}),r}},J=1,ee=2,te=3,ne=4,re=5,oe=function(){return Math.random().toString(36).substring(2,11)};function ie(e){this.wrapped=e}function ae(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,s=a instanceof ie;Promise.resolve(s?a.wrapped:a).then(function(e){s?r("next",e):o(i.done?"return":"normal",e)},function(e){r("throw",e)})}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(i,a){var s={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}function se(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}"function"==typeof Symbol&&Symbol.asyncIterator&&(ae.prototype[Symbol.asyncIterator]=function(){return this}),ae.prototype.next=function(e){return this._invoke("next",e)},ae.prototype.throw=function(e){return this._invoke("throw",e)},ae.prototype.return=function(e){return this._invoke("return",e)};function ue(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||le(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function le(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}var ce,fe,de=function(e,t){return e.splice(t,1)},pe=function(){var e=[],t=function(t,n){de(e,e.findIndex(function(e){return e.event===t&&(e.cb===n||!n)}))},n=function(t,n,r){e.filter(function(e){return e.event===t}).map(function(e){return e.cb}).forEach(function(e){return function(e,t){t?e():document.hidden?Promise.resolve(1).then(e):setTimeout(e,0)}(function(){return e.apply(void 0,ue(n))},r)})};return{fireSync:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];n(e,r,!0)},fire:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];n(e,r,!1)},on:function(t,n){e.push({event:t,cb:n})},onOnce:function(n,r){e.push({event:n,cb:function(){t(n,r),r.apply(void 0,arguments)}})},off:t}},Ee=function(e,t,n){Object.getOwnPropertyNames(e).filter(function(e){return!n.includes(e)}).forEach(function(n){return Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})},_e=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"],Te=function(e){var t={};return Ee(e,t,_e),t},Ie={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8},ve={INPUT:1,LIMBO:2,LOCAL:3},me=function(e){return/[^0-9]+/.exec(e)},he=function(){return me(1.1.toLocaleString())[0]},ge={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"},Re=[],Oe=function(e,t,n){return new Promise(function(r,o){var i=Re.filter(function(t){return t.key===e}).map(function(e){return e.cb});if(0!==i.length){var a=i.shift();i.reduce(function(e,t){return e.then(function(e){return t(e,n)})},a(t,n)).then(function(e){return r(e)}).catch(function(e){return o(e)})}else r(t)})},ye=function(e,t,n){return Re.filter(function(t){return t.key===e}).map(function(e){return e.cb(t,n)})},De=function(e,t){return Re.push({key:e,cb:t})},Se=function(){return Object.assign({},Ae)},Ae={id:[null,ge.STRING],name:["filepond",ge.STRING],disabled:[!1,ge.BOOLEAN],className:[null,ge.STRING],required:[!1,ge.BOOLEAN],captureMethod:[null,ge.STRING],allowSyncAcceptAttribute:[!0,ge.BOOLEAN],allowDrop:[!0,ge.BOOLEAN],allowBrowse:[!0,ge.BOOLEAN],allowPaste:[!0,ge.BOOLEAN],allowMultiple:[!1,ge.BOOLEAN],allowReplace:[!0,ge.BOOLEAN],allowRevert:[!0,ge.BOOLEAN],allowRemove:[!0,ge.BOOLEAN],allowProcess:[!0,ge.BOOLEAN],allowReorder:[!1,ge.BOOLEAN],allowDirectoriesOnly:[!1,ge.BOOLEAN],storeAsFile:[!1,ge.BOOLEAN],forceRevert:[!1,ge.BOOLEAN],maxFiles:[null,ge.INT],checkValidity:[!1,ge.BOOLEAN],itemInsertLocationFreedom:[!0,ge.BOOLEAN],itemInsertLocation:["before",ge.STRING],itemInsertInterval:[75,ge.INT],dropOnPage:[!1,ge.BOOLEAN],dropOnElement:[!0,ge.BOOLEAN],dropValidation:[!1,ge.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],ge.ARRAY],instantUpload:[!0,ge.BOOLEAN],maxParallelUploads:[2,ge.INT],allowMinimumUploadDuration:[!0,ge.BOOLEAN],chunkUploads:[!1,ge.BOOLEAN],chunkForce:[!1,ge.BOOLEAN],chunkSize:[5e6,ge.INT],chunkRetryDelays:[[500,1e3,3e3],ge.ARRAY],server:[null,ge.SERVER_API],fileSizeBase:[1e3,ge.INT],labelFileSizeBytes:["bytes",ge.STRING],labelFileSizeKilobytes:["KB",ge.STRING],labelFileSizeMegabytes:["MB",ge.STRING],labelFileSizeGigabytes:["GB",ge.STRING],labelDecimalSeparator:[he(),ge.STRING],labelThousandsSeparator:[(ce=he(),fe=1e3.toLocaleString(),fe!==1e3.toString()?me(fe)[0]:"."===ce?",":"."),ge.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',ge.STRING],labelInvalidField:["Field contains invalid files",ge.STRING],labelFileWaitingForSize:["Waiting for size",ge.STRING],labelFileSizeNotAvailable:["Size not available",ge.STRING],labelFileCountSingular:["file in list",ge.STRING],labelFileCountPlural:["files in list",ge.STRING],labelFileLoading:["Loading",ge.STRING],labelFileAdded:["Added",ge.STRING],labelFileLoadError:["Error during load",ge.STRING],labelFileRemoved:["Removed",ge.STRING],labelFileRemoveError:["Error during remove",ge.STRING],labelFileProcessing:["Uploading",ge.STRING],labelFileProcessingComplete:["Upload complete",ge.STRING],labelFileProcessingAborted:["Upload cancelled",ge.STRING],labelFileProcessingError:["Error during upload",ge.STRING],labelFileProcessingRevertError:["Error during revert",ge.STRING],labelTapToCancel:["tap to cancel",ge.STRING],labelTapToRetry:["tap to retry",ge.STRING],labelTapToUndo:["tap to undo",ge.STRING],labelButtonRemoveItem:["Remove",ge.STRING],labelButtonAbortItemLoad:["Abort",ge.STRING],labelButtonRetryItemLoad:["Retry",ge.STRING],labelButtonAbortItemProcessing:["Cancel",ge.STRING],labelButtonUndoItemProcessing:["Undo",ge.STRING],labelButtonRetryItemProcessing:["Retry",ge.STRING],labelButtonProcessItem:["Upload",ge.STRING],iconRemove:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M11.586 13l-2.293 2.293a1 1 0 0 0 1.414 1.414L13 14.414l2.293 2.293a1 1 0 0 0 1.414-1.414L14.414 13l2.293-2.293a1 1 0 0 0-1.414-1.414L13 11.586l-2.293-2.293a1 1 0 0 0-1.414 1.414L11.586 13z" fill="currentColor" fill-rule="nonzero"/></svg>',ge.STRING],iconProcess:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M14 10.414v3.585a1 1 0 0 1-2 0v-3.585l-1.293 1.293a1 1 0 0 1-1.414-1.415l3-3a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.415L14 10.414zM9 18a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2H9z" fill="currentColor" fill-rule="evenodd"/></svg>',ge.STRING],iconRetry:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M10.81 9.185l-.038.02A4.997 4.997 0 0 0 8 13.683a5 5 0 0 0 5 5 5 5 0 0 0 5-5 1 1 0 0 1 2 0A7 7 0 1 1 9.722 7.496l-.842-.21a.999.999 0 1 1 .484-1.94l3.23.806c.535.133.86.675.73 1.21l-.804 3.233a.997.997 0 0 1-1.21.73.997.997 0 0 1-.73-1.21l.23-.928v-.002z" fill="currentColor" fill-rule="nonzero"/></svg>',ge.STRING],iconUndo:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M9.185 10.81l.02-.038A4.997 4.997 0 0 1 13.683 8a5 5 0 0 1 5 5 5 5 0 0 1-5 5 1 1 0 0 0 0 2A7 7 0 1 0 7.496 9.722l-.21-.842a.999.999 0 1 0-1.94.484l.806 3.23c.133.535.675.86 1.21.73l3.233-.803a.997.997 0 0 0 .73-1.21.997.997 0 0 0-1.21-.73l-.928.23-.002-.001z" fill="currentColor" fill-rule="nonzero"/></svg>',ge.STRING],iconDone:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M18.293 9.293a1 1 0 0 1 1.414 1.414l-7.002 7a1 1 0 0 1-1.414 0l-3.998-4a1 1 0 1 1 1.414-1.414L12 15.586l6.294-6.293z" fill="currentColor" fill-rule="nonzero"/></svg>',ge.STRING],oninit:[null,ge.FUNCTION],onwarning:[null,ge.FUNCTION],onerror:[null,ge.FUNCTION],onactivatefile:[null,ge.FUNCTION],oninitfile:[null,ge.FUNCTION],onaddfilestart:[null,ge.FUNCTION],onaddfileprogress:[null,ge.FUNCTION],onaddfile:[null,ge.FUNCTION],onprocessfilestart:[null,ge.FUNCTION],onprocessfileprogress:[null,ge.FUNCTION],onprocessfileabort:[null,ge.FUNCTION],onprocessfilerevert:[null,ge.FUNCTION],onprocessfile:[null,ge.FUNCTION],onprocessfiles:[null,ge.FUNCTION],onremovefile:[null,ge.FUNCTION],onpreparefile:[null,ge.FUNCTION],onupdatefiles:[null,ge.FUNCTION],onreorderfiles:[null,ge.FUNCTION],beforeDropFile:[null,ge.FUNCTION],beforeAddFile:[null,ge.FUNCTION],beforeRemoveFile:[null,ge.FUNCTION],beforePrepareFile:[null,ge.FUNCTION],stylePanelLayout:[null,ge.STRING],stylePanelAspectRatio:[null,ge.STRING],styleItemPanelAspectRatio:[null,ge.STRING],styleButtonRemoveItemPosition:["left",ge.STRING],styleButtonProcessItemPosition:["right",ge.STRING],styleLoadIndicatorPosition:["right",ge.STRING],styleProgressIndicatorPosition:["right",ge.STRING],styleButtonRemoveItemAlign:[!1,ge.BOOLEAN],files:[[],ge.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],ge.ARRAY]},Le=function(e,t){return M(t)?e[0]||null:V(t)?e[t]||null:("object"==typeof t&&(t=t.id),e.find(function(e){return e.id===t})||null)},be=function(e){if(M(e))return e;if(/:/.test(e)){var t=e.split(":");return t[1]/t[0]}return parseFloat(e)},Pe=function(e){return e.filter(function(e){return!e.archived})},Me={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4},we=null,Ce=[Ie.LOAD_ERROR,Ie.PROCESSING_ERROR,Ie.PROCESSING_REVERT_ERROR],Ne=[Ie.LOADING,Ie.PROCESSING,Ie.PROCESSING_QUEUED,Ie.INIT],Ge=[Ie.PROCESSING_COMPLETE],Ue=function(e){return Ce.includes(e.status)},Be=function(e){return Ne.includes(e.status)},Fe=function(e){return Ge.includes(e.status)},qe=function(e){return H(e.options.server)&&(H(e.options.server.process)||Y(e.options.server.process))},Ve=function(e){return{GET_STATUS:function(){var t=Pe(e.items),n=Me.EMPTY,r=Me.ERROR,o=Me.BUSY,i=Me.IDLE,a=Me.READY;return 0===t.length?n:t.some(Ue)?r:t.some(Be)?o:t.some(Fe)?a:i},GET_ITEM:function(t){return Le(e.items,t)},GET_ACTIVE_ITEM:function(t){return Le(Pe(e.items),t)},GET_ACTIVE_ITEMS:function(){return Pe(e.items)},GET_ITEMS:function(){return e.items},GET_ITEM_NAME:function(t){var n=Le(e.items,t);return n?n.filename:null},GET_ITEM_SIZE:function(t){var n=Le(e.items,t);return n?n.fileSize:null},GET_STYLES:function(){return Object.keys(e.options).filter(function(e){return/^style/.test(e)}).map(function(t){return{name:t,value:e.options[t]}})},GET_PANEL_ASPECT_RATIO:function(){return/circle/.test(e.options.stylePanelLayout)?1:be(e.options.stylePanelAspectRatio)},GET_ITEM_PANEL_ASPECT_RATIO:function(){return e.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function(t){return Pe(e.items).filter(function(e){return e.status===t})},GET_TOTAL_ITEMS:function(){return Pe(e.items).length},SHOULD_UPDATE_FILE_INPUT:function(){return e.options.storeAsFile&&function(){if(null===we)try{var e=new DataTransfer;e.items.add(new File(["hello world"],"This_Works.txt"));var t=document.createElement("input");t.setAttribute("type","file"),t.files=e.files,we=1===t.files.length}catch(e){we=!1}return we}()&&!qe(e)},IS_ASYNC:function(){return qe(e)},GET_FILE_SIZE_LABELS:function(e){return{labelBytes:e("GET_LABEL_FILE_SIZE_BYTES")||void 0,labelKilobytes:e("GET_LABEL_FILE_SIZE_KILOBYTES")||void 0,labelMegabytes:e("GET_LABEL_FILE_SIZE_MEGABYTES")||void 0,labelGigabytes:e("GET_LABEL_FILE_SIZE_GIGABYTES")||void 0}}}},xe=function(e,t,n){return Math.max(Math.min(n,e),t)},Ye=function(e){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(e)},ke=function(e){return(""+e).split("/").pop().split("?").shift()},je=function(e){return e.split(".").pop()},He=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(t+e).slice(-t.length)},Xe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return e.getFullYear()+"-"+He(e.getMonth()+1,"00")+"-"+He(e.getDate(),"00")+"_"+He(e.getHours(),"00")+"-"+He(e.getMinutes(),"00")+"-"+He(e.getSeconds(),"00")},We=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o="string"==typeof n?e.slice(0,e.size,n):e.slice(0,e.size,e.type);return o.lastModifiedDate=new Date,e._relativePath&&(o._relativePath=e._relativePath),U(t)||(t=Xe()),t&&null===r&&je(t)?o.name=t:(r=r||function(e){if("string"!=typeof e)return"";var t=e.split("/").pop();return/svg/.test(t)?"svg":/zip|compressed/.test(t)?"zip":/plain/.test(t)?"txt":/msword/.test(t)?"doc":/[a-z]+/.test(t)?"jpeg"===t?"jpg":t:""}(o.type),o.name=t+(r?"."+r:"")),o},ze=function(e,t){var n=window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(n){var r=new n;return r.append(e),r.getBlob(t)}return new Blob([e],{type:t})},Qe=function(e){return(/^data:(.+);/.exec(e)||[])[1]||null},Ze=function(e){var t=Qe(e);return function(e,t){for(var n=new ArrayBuffer(e.length),r=new Uint8Array(n),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return ze(n,t)}(function(e){return atob(function(e){return e.split(",")[1].replace(/\s/g,"")}(e))}(e),t)},Ke=function(e){if(!/^content-disposition:/i.test(e))return null;var t=e.split(/filename=|filename\*=.+''/).splice(1).map(function(e){return e.trim().replace(/^["']|[;"']{0,2}$/g,"")}).filter(function(e){return e.length});return t.length?decodeURI(t[t.length-1]):null},$e=function(e){if(/content-length:/i.test(e)){var t=e.match(/[0-9]+/)[0];return t?parseInt(t,10):null}return null},Je=function(e){return/x-content-transfer-id:/i.test(e)&&(e.split(":")[1]||"").trim()||null},et=function(e){var t={source:null,name:null,size:null},n=e.split("\n"),r=!0,o=!1,i=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value,l=Ke(u);if(l)t.name=l;else{var c=$e(u);if(c)t.size=c;else{var f=Je(u);f&&(t.source=f)}}}}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return t},tt=function(e){var t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},n=function(n){e?(t.timestamp=Date.now(),t.request=e(n,function(e){t.duration=Date.now()-t.timestamp,t.complete=!0,e instanceof Blob&&(e=We(e,e.name||ke(n))),r.fire("load",e instanceof Blob?e:e?e.body:null)},function(e){r.fire("error","string"==typeof e?{type:"error",code:0,body:e}:e)},function(e,n,o){o&&(t.size=o),t.duration=Date.now()-t.timestamp,e?(t.progress=n/o,r.fire("progress",t.progress)):t.progress=null},function(){r.fire("abort")},function(e){var n=et("string"==typeof e?e:e.headers);r.fire("meta",{size:t.size||n.size,filename:n.name,source:n.source})})):r.fire("error",{type:"error",body:"Can't load URL",code:400})},r=Object.assign({},pe(),{setSource:function(e){return t.source=e},getProgress:function(){return t.progress},abort:function(){t.request&&t.request.abort&&t.request.abort()},load:function(){var e,o,i=t.source;r.fire("init",i),i instanceof File?r.fire("load",i):i instanceof Blob?r.fire("load",We(i,i.name)):Ye(i)?r.fire("load",We(Ze(i),e,null,o)):n(i)}});return r},nt=function(e){return/GET|HEAD/.test(e)},rt=function(e,t,n){var r={onheaders:function(){},onprogress:function(){},onload:function(){},ontimeout:function(){},onerror:function(){},onabort:function(){},abort:function(){o=!0,a.abort()}},o=!1,i=!1;n=Object.assign({method:"POST",headers:{},withCredentials:!1},n),t=encodeURI(t),nt(n.method)&&e&&(t=""+t+encodeURIComponent("string"==typeof e?e:JSON.stringify(e)));var a=new XMLHttpRequest;return(nt(n.method)?a:a.upload).onprogress=function(e){o||r.onprogress(e.lengthComputable,e.loaded,e.total)},a.onreadystatechange=function(){a.readyState<2||4===a.readyState&&0===a.status||i||(i=!0,r.onheaders(a))},a.onload=function(){a.status>=200&&a.status<300?r.onload(a):r.onerror(a)},a.onerror=function(){return r.onerror(a)},a.onabort=function(){o=!0,r.onabort()},a.ontimeout=function(){return r.ontimeout(a)},a.open(n.method,t,!0),V(n.timeout)&&(a.timeout=n.timeout),Object.keys(n.headers).forEach(function(e){var t=unescape(encodeURIComponent(n.headers[e]));a.setRequestHeader(e,t)}),n.responseType&&(a.responseType=n.responseType),n.withCredentials&&(a.withCredentials=!0),a.send(e),r},ot=function(e,t,n,r){return{type:e,code:t,body:n,headers:r}},it=function(e){return function(t){e(ot("error",0,"Timeout",t.getAllResponseHeaders()))}},at=function(e){return/\?/.test(e)},st=function(){for(var e="",t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(t){e+=at(e)&&at(t)?t.replace(/\?/,"&"):t}),e},ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if("function"==typeof t)return t;if(!t||!U(t.url))return null;var n=t.onload||function(e){return e},r=t.onerror||function(e){return null};return function(o,i,a,s,u,l){var c=rt(o,st(e,t.url),Object.assign({},t,{responseType:"blob"}));return c.onload=function(e){var r=e.getAllResponseHeaders(),a=et(r).name||ke(o);i(ot("load",e.status,"HEAD"===t.method?null:We(n(e.response),a),r))},c.onerror=function(e){a(ot("error",e.status,r(e.response)||e.statusText,e.getAllResponseHeaders()))},c.onheaders=function(e){l(ot("headers",e.status,null,e.getAllResponseHeaders()))},c.ontimeout=it(a),c.onprogress=s,c.onabort=u,c}},lt=0,ct=1,ft=2,dt=3,pt=4,Et=function(e,t,n,r,o,i,a,s,u,l,c){for(var f=[],d=c.chunkTransferId,p=c.chunkServer,E=c.chunkSize,_=c.chunkRetryDelays,T={serverId:d,aborted:!1},I=t.ondata||function(e){return e},v=t.onload||function(e,t){return"HEAD"===t?e.getResponseHeader("Upload-Offset"):e.response},m=t.onerror||function(e){return null},h=Math.floor(r.size/E),g=0;g<=h;g++){var R=g*E,O=r.slice(R,R+E,"application/offset+octet-stream");f[g]={index:g,size:O.size,offset:R,data:O,file:r,progress:0,retries:ue(_),status:lt,error:null,request:null,timeout:null}}var y,D,S,A,L=function(e){return e.status===lt||e.status===dt},b=function(t){if(!T.aborted)if(t=t||f.find(L)){t.status=ft,t.progress=null;var n=p.ondata||function(e){return e},o=p.onerror||function(e){return null},s=p.onload||function(){},l=st(e,p.url,T.serverId),c="function"==typeof p.headers?p.headers(t):Object.assign({},p.headers,{"Content-Type":"application/offset+octet-stream","Upload-Offset":t.offset,"Upload-Length":r.size,"Upload-Name":r.name}),d=t.request=rt(n(t.data),l,Object.assign({},p,{headers:c}));d.onload=function(e){s(e,t.index,f.length),t.status=ct,t.request=null,w()},d.onprogress=function(e,n,r){t.progress=e?n:null,M()},d.onerror=function(e){t.status=dt,t.request=null,t.error=o(e.response)||e.statusText,P(t)||a(ot("error",e.status,o(e.response)||e.statusText,e.getAllResponseHeaders()))},d.ontimeout=function(e){t.status=dt,t.request=null,P(t)||it(a)(e)},d.onabort=function(){t.status=lt,t.request=null,u()}}else f.every(function(e){return e.status===ct})&&i(T.serverId)},P=function(e){return 0!==e.retries.length&&(e.status=pt,clearTimeout(e.timeout),e.timeout=setTimeout(function(){b(e)},e.retries.shift()),!0)},M=function(){var e=f.reduce(function(e,t){return null===e||null===t.progress?null:e+t.progress},0);if(null===e)return s(!1,0,0);var t=f.reduce(function(e,t){return e+t.size},0);s(!0,e,t)},w=function(){f.filter(function(e){return e.status===ft}).length>=1||b()};return T.serverId?(y=function(e){T.aborted||(f.filter(function(t){return t.offset<e}).forEach(function(e){e.status=ct,e.progress=e.size}),w())},D=st(e,p.url,T.serverId),S={headers:"function"==typeof t.headers?t.headers(T.serverId):Object.assign({},t.headers),method:"HEAD"},(A=rt(null,D,S)).onload=function(e){return y(v(e,S.method))},A.onerror=function(e){return a(ot("error",e.status,m(e.response)||e.statusText,e.getAllResponseHeaders()))},A.ontimeout=it(a)):function(i){var s=new FormData;H(o)&&s.append(n,JSON.stringify(o));var u="function"==typeof t.headers?t.headers(r,o):Object.assign({},t.headers,{"Upload-Length":r.size}),l=Object.assign({},t,{headers:u}),c=rt(I(s),st(e,t.url),l);c.onload=function(e){return i(v(e,l.method))},c.onerror=function(e){return a(ot("error",e.status,m(e.response)||e.statusText,e.getAllResponseHeaders()))},c.ontimeout=it(a)}(function(e){T.aborted||(l(e),T.serverId=e,w())}),{abort:function(){T.aborted=!0,f.forEach(function(e){clearTimeout(e.timeout),e.request&&e.request.abort()})}}},_t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return"function"==typeof t?function(){for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];return t.apply(void 0,[n].concat(o,[r]))}:t&&U(t.url)?function(e,t,n,r){return function(o,i,a,s,u,l,c){if(o){var f=r.chunkUploads,d=f&&o.size>r.chunkSize,p=f&&(d||r.chunkForce);if(o instanceof Blob&&p)return Et(e,t,n,o,i,a,s,u,l,c,r);var E=t.ondata||function(e){return e},_=t.onload||function(e){return e},T=t.onerror||function(e){return null},I="function"==typeof t.headers?t.headers(o,i)||{}:Object.assign({},t.headers),v=Object.assign({},t,{headers:I}),m=new FormData;H(i)&&m.append(n,JSON.stringify(i)),(o instanceof Blob?[{name:null,file:o}]:o).forEach(function(e){m.append(n,e.file,null===e.name?e.file.name:""+e.name+e.file.name)});var h=rt(E(m),st(e,t.url),v);return h.onload=function(e){a(ot("load",e.status,_(e.response),e.getAllResponseHeaders()))},h.onerror=function(e){s(ot("error",e.status,T(e.response)||e.statusText,e.getAllResponseHeaders()))},h.ontimeout=it(s),h.onprogress=u,h.onabort=l,h}}}(e,t,n,r):null},Tt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if("function"==typeof t)return t;if(!t||!U(t.url))return function(e,t){return t()};var n=t.onload||function(e){return e},r=t.onerror||function(e){return null};return function(o,i,a){var s=rt(o,e+t.url,t);return s.onload=function(e){i(ot("load",e.status,n(e.response),e.getAllResponseHeaders()))},s.onerror=function(e){a(ot("error",e.status,r(e.response)||e.statusText,e.getAllResponseHeaders()))},s.ontimeout=it(a),s}},It=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e+Math.random()*(t-e)},vt=function(e,t){var n={complete:!1,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null},r=t.allowMinimumUploadDuration,o=function(){n.request&&(n.perceivedPerformanceUpdater.clear(),n.request.abort&&n.request.abort(),n.complete=!0)},i=r?function(){return n.progress?Math.min(n.progress,n.perceivedProgress):null}:function(){return n.progress||null},a=r?function(){return Math.min(n.duration,n.perceivedDuration)}:function(){return n.duration},s=Object.assign({},pe(),{process:function(t,o){var i=function(){0!==n.duration&&null!==n.progress&&s.fire("progress",s.getProgress())},a=function(){n.complete=!0,s.fire("load-perceived",n.response.body)};s.fire("start"),n.timestamp=Date.now(),n.perceivedPerformanceUpdater=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]?arguments[3]:25),r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,o=null,i=Date.now();return t>0&&function a(){var s=Date.now()-i,u=It(n,r);s+u>t&&(u=s+u-t);var l=s/t;l>=1||document.hidden?e(1):(e(l),o=setTimeout(a,u))}(),{clear:function(){clearTimeout(o)}}}(function(e){n.perceivedProgress=e,n.perceivedDuration=Date.now()-n.timestamp,i(),n.response&&1===n.perceivedProgress&&!n.complete&&a()},r?It(750,1500):0),n.request=e(t,o,function(e){n.response=H(e)?e:{type:"load",code:200,body:""+e,headers:{}},n.duration=Date.now()-n.timestamp,n.progress=1,s.fire("load",n.response.body),(!r||r&&1===n.perceivedProgress)&&a()},function(e){n.perceivedPerformanceUpdater.clear(),s.fire("error",H(e)?e:{type:"error",code:0,body:""+e})},function(e,t,r){n.duration=Date.now()-n.timestamp,n.progress=e?t/r:null,i()},function(){n.perceivedPerformanceUpdater.clear(),s.fire("abort",n.response?n.response.body:null)},function(e){s.fire("transfer",e)})},abort:o,getProgress:i,getDuration:a,reset:function(){o(),n.complete=!1,n.perceivedProgress=0,n.progress=0,n.timestamp=null,n.perceivedDuration=0,n.duration=0,n.request=null,n.response=null}});return s},mt=function(e){return e.substring(0,e.lastIndexOf("."))||e},ht=function(e){return!!(e instanceof File||e instanceof Blob&&e.name)},gt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=oe(),i={archived:!1,frozen:!1,released:!1,source:null,file:r,serverFileReference:t,transferId:null,processingAborted:!1,status:t?Ie.PROCESSING_COMPLETE:Ie.INIT,activeLoader:null,activeProcessor:null},a=null,s={},u=function(e){return i.status=e},l=function(e){if(!i.released&&!i.frozen){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];f.fire.apply(f,[e].concat(n))}},c=function(e,t,n){var r=e.split("."),o=r[0],i=r.pop(),a=s;r.forEach(function(e){return a=a[e]}),JSON.stringify(a[i])!==JSON.stringify(t)&&(a[i]=t,l("metadata-update",{key:o,value:s[o],silent:n}))},f=Object.assign({id:{get:function(){return o}},origin:{get:function(){return e},set:function(t){return e=t}},serverId:{get:function(){return i.serverFileReference}},transferId:{get:function(){return i.transferId}},status:{get:function(){return i.status}},filename:{get:function(){return i.file.name}},filenameWithoutExtension:{get:function(){return mt(i.file.name)}},fileExtension:{get:function(){return je(i.file.name)}},fileType:{get:function(){return i.file.type}},fileSize:{get:function(){return i.file.size}},file:{get:function(){return i.file}},relativePath:{get:function(){return i.file._relativePath}},source:{get:function(){return i.source}},getMetadata:function(e){return function e(t){if(!H(t))return t;var n=P(t)?[]:{};for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];n[r]=o&&H(o)?e(o):o}return n}(e?s[e]:s)},setMetadata:function(e,t,n){if(H(e)){var r=e;return Object.keys(r).forEach(function(e){c(e,r[e],t)}),e}return c(e,t,n),t},extend:function(e,t){return d[e]=t},abortLoad:function(){i.activeLoader?i.activeLoader.abort():(u(Ie.INIT),l("load-abort"))},retryLoad:function(){i.activeLoader&&i.activeLoader.load()},requestProcessing:function(){i.processingAborted=!1,u(Ie.PROCESSING_QUEUED)},abortProcessing:function(){return new Promise(function(e){if(!i.activeProcessor)return i.processingAborted=!0,u(Ie.IDLE),l("process-abort"),void e();a=function(){e()},i.activeProcessor.abort()})},load:function(t,n,r){i.source=t,f.fireSync("init"),i.file?f.fireSync("load-skip"):(i.file=function(e){var t=[e.name,e.size,e.type];return e instanceof Blob||Ye(e)?t[0]=e.name||Xe():Ye(e)?(t[1]=e.length,t[2]=Qe(e)):U(e)&&(t[0]=ke(e),t[1]=0,t[2]="application/octet-stream"),{name:t[0],size:t[1],type:t[2]}}(t),n.on("init",function(){l("load-init")}),n.on("meta",function(t){i.file.size=t.size,i.file.filename=t.filename,t.source&&(e=ve.LIMBO,i.serverFileReference=t.source,i.status=Ie.PROCESSING_COMPLETE),l("load-meta")}),n.on("progress",function(e){u(Ie.LOADING),l("load-progress",e)}),n.on("error",function(e){u(Ie.LOAD_ERROR),l("load-request-error",e)}),n.on("abort",function(){u(Ie.INIT),l("load-abort")}),n.on("load",function(t){i.activeLoader=null;var n=function(t){i.file=ht(t)?t:i.file,e===ve.LIMBO&&i.serverFileReference?u(Ie.PROCESSING_COMPLETE):u(Ie.IDLE),l("load")};i.serverFileReference?n(t):r(t,n,function(e){i.file=t,l("load-meta"),u(Ie.LOAD_ERROR),l("load-file-error",e)})}),n.setSource(t),i.activeLoader=n,n.load())},process:function e(t,n){if(i.processingAborted)i.processingAborted=!1;else if(u(Ie.PROCESSING),a=null,i.file instanceof Blob){t.on("load",function(e){i.transferId=null,i.serverFileReference=e}),t.on("transfer",function(e){i.transferId=e}),t.on("load-perceived",function(e){i.activeProcessor=null,i.transferId=null,i.serverFileReference=e,u(Ie.PROCESSING_COMPLETE),l("process-complete",e)}),t.on("start",function(){l("process-start")}),t.on("error",function(e){i.activeProcessor=null,u(Ie.PROCESSING_ERROR),l("process-error",e)}),t.on("abort",function(e){i.activeProcessor=null,i.serverFileReference=e,u(Ie.IDLE),l("process-abort"),a&&a()}),t.on("progress",function(e){l("process-progress",e)});var r=console.error;n(i.file,function(e){i.archived||t.process(e,Object.assign({},s))},r),i.activeProcessor=t}else f.on("load",function(){e(t,n)})},revert:function(e,t){return new Promise(function(n,r){var o=null!==i.serverFileReference?i.serverFileReference:i.transferId;null!==o?(e(o,function(){i.serverFileReference=null,i.transferId=null,n()},function(e){t?(u(Ie.PROCESSING_REVERT_ERROR),l("process-revert-error"),r(e)):n()}),u(Ie.IDLE),l("process-revert")):n()})}},pe(),{freeze:function(){return i.frozen=!0},release:function(){return i.released=!0},released:{get:function(){return i.released}},archive:function(){return i.archived=!0},archived:{get:function(){return i.archived}},setFile:function(e){return i.file=e}}),d=n(f);return d},Rt=function(e,t){var n=function(e,t){return M(t)?0:U(t)?e.findIndex(function(e){return e.id===t}):-1}(e,t);if(!(n<0))return e[n]||null},Ot=function(e,t,n,r,o,i){var a=rt(null,e,{method:"GET",responseType:"blob"});return a.onload=function(n){var r=n.getAllResponseHeaders(),o=et(r).name||ke(e);t(ot("load",n.status,We(n.response,o),r))},a.onerror=function(e){n(ot("error",e.status,e.statusText,e.getAllResponseHeaders()))},a.onheaders=function(e){i(ot("headers",e.status,null,e.getAllResponseHeaders()))},a.ontimeout=it(n),a.onprogress=r,a.onabort=o,a},yt=function(e){return 0===e.indexOf("//")&&(e=location.protocol+e),e.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]},Dt=function(e){return function(){return Y(e)?e.apply(void 0,arguments):e}},St=function(e,t){clearTimeout(t.listUpdateTimeout),t.listUpdateTimeout=setTimeout(function(){e("DID_UPDATE_ITEMS",{items:Pe(t.items)})},0)},At=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Promise(function(t){if(!e)return t(!0);var r=e.apply(void 0,n);return null==r?t(!0):"boolean"==typeof r?t(r):void("function"==typeof r.then&&r.then(t))})},Lt=function(e,t){e.items.sort(function(e,n){return t(Te(e),Te(n))})},bt=function(e,t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.query,o=n.success,i=void 0===o?function(){}:o,a=n.failure,s=void 0===a?function(){}:a,u=se(n,["query","success","failure"]),l=Le(e.items,r);l?t(l,i,s,u||{}):s({error:ot("error",0,"Item not found"),file:null})}},Pt=function(e,t,n){return{ABORT_ALL:function(){Pe(n.items).forEach(function(e){e.freeze(),e.abortLoad(),e.abortProcessing()})},DID_SET_FILES:function(t){var r=t.value,o=(void 0===r?[]:r).map(function(e){return{source:e.source?e.source:e,options:e.options}}),i=Pe(n.items);i.forEach(function(t){o.find(function(e){return e.source===t.source||e.source===t.file})||e("REMOVE_ITEM",{query:t,remove:!1})}),i=Pe(n.items),o.forEach(function(t,n){i.find(function(e){return e.source===t.source||e.file===t.source})||e("ADD_ITEM",Object.assign({},t,{interactionMethod:re,index:n}))})},DID_UPDATE_ITEM_METADATA:function(r){var o=r.id,i=r.action,a=r.change;a.silent||(clearTimeout(n.itemUpdateTimeout),n.itemUpdateTimeout=setTimeout(function(){var r=Rt(n.items,o);if(t("IS_ASYNC")){r.origin===ve.LOCAL&&e("DID_LOAD_ITEM",{id:r.id,error:null,serverFileReference:r.source});var s,u=function(){setTimeout(function(){e("REQUEST_ITEM_PROCESSING",{query:o})},32)};return r.status===Ie.PROCESSING_COMPLETE?(s=n.options.instantUpload,void r.revert(Tt(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")).then(s?u:function(){}).catch(function(){})):r.status===Ie.PROCESSING?function(e){r.abortProcessing().then(e?u:function(){})}(n.options.instantUpload):void(n.options.instantUpload&&u())}Oe("SHOULD_PREPARE_OUTPUT",!1,{item:r,query:t,action:i,change:a}).then(function(n){var i=t("GET_BEFORE_PREPARE_FILE");i&&(n=i(r,n)),n&&e("REQUEST_PREPARE_OUTPUT",{query:o,item:r,success:function(t){e("DID_PREPARE_OUTPUT",{id:o,file:t})}},!0)})},0))},MOVE_ITEM:function(e){var t=e.query,r=e.index,o=Le(n.items,t);if(o){var i=n.items.indexOf(o);i!==(r=xe(r,0,n.items.length-1))&&n.items.splice(r,0,n.items.splice(i,1)[0])}},SORT:function(r){var o=r.compare;Lt(n,o),e("DID_SORT_ITEMS",{items:t("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function(n){var r=n.items,o=n.index,i=n.interactionMethod,a=n.success,s=void 0===a?function(){}:a,u=n.failure,l=void 0===u?function(){}:u,c=o;if(-1===o||void 0===o){var f=t("GET_ITEM_INSERT_LOCATION"),d=t("GET_TOTAL_ITEMS");c="before"===f?0:d}var p=t("GET_IGNORED_FILES"),E=r.filter(function(e){return ht(e)?!p.includes(e.name.toLowerCase()):!M(e)}).map(function(t){return new Promise(function(n,r){e("ADD_ITEM",{interactionMethod:i,source:t.source||t,success:n,failure:r,index:c++,options:t.options||{}})})});Promise.all(E).then(s).catch(l)},ADD_ITEM:function(r){var o=r.source,i=r.index,a=void 0===i?-1:i,s=r.interactionMethod,u=r.success,l=void 0===u?function(){}:u,c=r.failure,f=void 0===c?function(){}:c,d=r.options,p=void 0===d?{}:d;if(M(o))f({error:ot("error",0,"No source"),file:null});else if(!ht(o)||!n.options.ignoredFiles.includes(o.name.toLowerCase())){if(!function(e){var t=Pe(e.items).length;if(!e.options.allowMultiple)return 0===t;var n=e.options.maxFiles;return null===n||t<n}(n)){if(n.options.allowMultiple||!n.options.allowMultiple&&!n.options.allowReplace){var E=ot("warning",0,"Max files");return e("DID_THROW_MAX_FILES",{source:o,error:E}),void f({error:E,file:null})}var _=Pe(n.items)[0];if(_.status===Ie.PROCESSING_COMPLETE||_.status===Ie.PROCESSING_REVERT_ERROR){var T=t("GET_FORCE_REVERT");if(_.revert(Tt(n.options.server.url,n.options.server.revert),T).then(function(){T&&e("ADD_ITEM",{source:o,index:a,interactionMethod:s,success:l,failure:f,options:p})}).catch(function(){}),T)return}e("REMOVE_ITEM",{query:_.id})}var I="local"===p.type?ve.LOCAL:"limbo"===p.type?ve.LIMBO:ve.INPUT,v=gt(I,I===ve.INPUT?null:o,p.file);Object.keys(p.metadata||{}).forEach(function(e){v.setMetadata(e,p.metadata[e])}),ye("DID_CREATE_ITEM",v,{query:t,dispatch:e});var m=t("GET_ITEM_INSERT_LOCATION");n.options.itemInsertLocationFreedom||(a="before"===m?-1:n.items.length),function(e,t,n){M(t)||(void 0===n?e.push(t):function(e,t,n){e.splice(t,0,n)}(e,n=xe(n,0,e.length),t))}(n.items,v,a),Y(m)&&o&&Lt(n,m);var h=v.id;v.on("init",function(){e("DID_INIT_ITEM",{id:h})}),v.on("load-init",function(){e("DID_START_ITEM_LOAD",{id:h})}),v.on("load-meta",function(){e("DID_UPDATE_ITEM_META",{id:h})}),v.on("load-progress",function(t){e("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:h,progress:t})}),v.on("load-request-error",function(t){var r=Dt(n.options.labelFileLoadError)(t);if(t.code>=400&&t.code<500)return e("DID_THROW_ITEM_INVALID",{id:h,error:t,status:{main:r,sub:t.code+" ("+t.body+")"}}),void f({error:t,file:Te(v)});e("DID_THROW_ITEM_LOAD_ERROR",{id:h,error:t,status:{main:r,sub:n.options.labelTapToRetry}})}),v.on("load-file-error",function(t){e("DID_THROW_ITEM_INVALID",{id:h,error:t.status,status:t.status}),f({error:t.status,file:Te(v)})}),v.on("load-abort",function(){e("REMOVE_ITEM",{query:h})}),v.on("load-skip",function(){v.on("metadata-update",function(t){ht(v.file)&&e("DID_UPDATE_ITEM_METADATA",{id:h,change:t})}),e("COMPLETE_LOAD_ITEM",{query:h,item:v,data:{source:o,success:l}})}),v.on("load",function(){var r=function(r){r?(v.on("metadata-update",function(t){e("DID_UPDATE_ITEM_METADATA",{id:h,change:t})}),Oe("SHOULD_PREPARE_OUTPUT",!1,{item:v,query:t}).then(function(r){var i=t("GET_BEFORE_PREPARE_FILE");i&&(r=i(v,r));var a=function(){e("COMPLETE_LOAD_ITEM",{query:h,item:v,data:{source:o,success:l}}),St(e,n)};r?e("REQUEST_PREPARE_OUTPUT",{query:h,item:v,success:function(t){e("DID_PREPARE_OUTPUT",{id:h,file:t}),a()}},!0):a()})):e("REMOVE_ITEM",{query:h})};Oe("DID_LOAD_ITEM",v,{query:t,dispatch:e}).then(function(){At(t("GET_BEFORE_ADD_FILE"),Te(v)).then(r)}).catch(function(t){if(!t||!t.error||!t.status)return r(!1);e("DID_THROW_ITEM_INVALID",{id:h,error:t.error,status:t.status})})}),v.on("process-start",function(){e("DID_START_ITEM_PROCESSING",{id:h})}),v.on("process-progress",function(t){e("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:h,progress:t})}),v.on("process-error",function(t){e("DID_THROW_ITEM_PROCESSING_ERROR",{id:h,error:t,status:{main:Dt(n.options.labelFileProcessingError)(t),sub:n.options.labelTapToRetry}})}),v.on("process-revert-error",function(t){e("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:h,error:t,status:{main:Dt(n.options.labelFileProcessingRevertError)(t),sub:n.options.labelTapToRetry}})}),v.on("process-complete",function(t){e("DID_COMPLETE_ITEM_PROCESSING",{id:h,error:null,serverFileReference:t}),e("DID_DEFINE_VALUE",{id:h,value:t})}),v.on("process-abort",function(){e("DID_ABORT_ITEM_PROCESSING",{id:h})}),v.on("process-revert",function(){e("DID_REVERT_ITEM_PROCESSING",{id:h}),e("DID_DEFINE_VALUE",{id:h,value:null})}),e("DID_ADD_ITEM",{id:h,index:a,interactionMethod:s}),St(e,n);var g=n.options.server||{},R=g.url,O=g.load,y=g.restore,D=g.fetch;v.load(o,tt(I===ve.INPUT?U(o)&&function(e){return(e.indexOf(":")>-1||e.indexOf("//")>-1)&&yt(location.href)!==yt(e)}(o)&&D?ut(R,D):Ot:ut(R,I===ve.LIMBO?y:O)),function(e,n,r){Oe("LOAD_FILE",e,{query:t}).then(n).catch(r)})}},REQUEST_PREPARE_OUTPUT:function(e){var n=e.item,r=e.success,o=e.failure,i=void 0===o?function(){}:o,a={error:ot("error",0,"Item not found"),file:null};if(n.archived)return i(a);Oe("PREPARE_OUTPUT",n.file,{query:t,item:n}).then(function(e){Oe("COMPLETE_PREPARE_OUTPUT",e,{query:t,item:n}).then(function(e){if(n.archived)return i(a);r(e)})})},COMPLETE_LOAD_ITEM:function(r){var o=r.item,i=r.data,a=i.success,s=i.source,u=t("GET_ITEM_INSERT_LOCATION");if(Y(u)&&s&&Lt(n,u),e("DID_LOAD_ITEM",{id:o.id,error:null,serverFileReference:o.origin===ve.INPUT?null:s}),a(Te(o)),o.origin!==ve.LOCAL)return o.origin===ve.LIMBO?(e("DID_COMPLETE_ITEM_PROCESSING",{id:o.id,error:null,serverFileReference:s}),void e("DID_DEFINE_VALUE",{id:o.id,value:o.serverId||s})):void(t("IS_ASYNC")&&n.options.instantUpload&&e("REQUEST_ITEM_PROCESSING",{query:o.id}));e("DID_LOAD_LOCAL_ITEM",{id:o.id})},RETRY_ITEM_LOAD:bt(n,function(e){e.retryLoad()}),REQUEST_ITEM_PREPARE:bt(n,function(t,n,r){e("REQUEST_PREPARE_OUTPUT",{query:t.id,item:t,success:function(r){e("DID_PREPARE_OUTPUT",{id:t.id,file:r}),n({file:t,output:r})},failure:r},!0)}),REQUEST_ITEM_PROCESSING:bt(n,function(r,o,i){if(r.status===Ie.IDLE||r.status===Ie.PROCESSING_ERROR)r.status!==Ie.PROCESSING_QUEUED&&(r.requestProcessing(),e("DID_REQUEST_ITEM_PROCESSING",{id:r.id}),e("PROCESS_ITEM",{query:r,success:o,failure:i},!0));else{var a=function(){return e("REQUEST_ITEM_PROCESSING",{query:r,success:o,failure:i})},s=function(){return document.hidden?a():setTimeout(a,32)};r.status===Ie.PROCESSING_COMPLETE||r.status===Ie.PROCESSING_REVERT_ERROR?r.revert(Tt(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")).then(s).catch(function(){}):r.status===Ie.PROCESSING&&r.abortProcessing().then(s)}}),PROCESS_ITEM:bt(n,function(r,o,i){var a=t("GET_MAX_PARALLEL_UPLOADS");if(t("GET_ITEMS_BY_STATUS",Ie.PROCESSING).length!==a){if(r.status!==Ie.PROCESSING){var s=function t(){var r=n.processingQueue.shift();if(r){var o=r.id,i=r.success,a=r.failure,s=Le(n.items,o);s&&!s.archived?e("PROCESS_ITEM",{query:o,success:i,failure:a},!0):t()}};r.onOnce("process-complete",function(){o(Te(r)),s();var i=n.options.server;if(n.options.instantUpload&&r.origin===ve.LOCAL&&Y(i.remove)){var a=function(){};r.origin=ve.LIMBO,n.options.server.remove(r.source,a,a)}t("GET_ITEMS_BY_STATUS",Ie.PROCESSING_COMPLETE).length===n.items.length&&e("DID_COMPLETE_ITEM_PROCESSING_ALL")}),r.onOnce("process-error",function(e){i({error:e,file:Te(r)}),s()});var u=n.options;r.process(vt(_t(u.server.url,u.server.process,u.name,{chunkTransferId:r.transferId,chunkServer:u.server.patch,chunkUploads:u.chunkUploads,chunkForce:u.chunkForce,chunkSize:u.chunkSize,chunkRetryDelays:u.chunkRetryDelays}),{allowMinimumUploadDuration:t("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),function(n,o,i){Oe("PREPARE_OUTPUT",n,{query:t,item:r}).then(function(t){e("DID_PREPARE_OUTPUT",{id:r.id,file:t}),o(t)}).catch(i)})}}else n.processingQueue.push({id:r.id,success:o,failure:i})}),RETRY_ITEM_PROCESSING:bt(n,function(t){e("REQUEST_ITEM_PROCESSING",{query:t})}),REQUEST_REMOVE_ITEM:bt(n,function(n){At(t("GET_BEFORE_REMOVE_FILE"),Te(n)).then(function(t){t&&e("REMOVE_ITEM",{query:n})})}),RELEASE_ITEM:bt(n,function(e){e.release()}),REMOVE_ITEM:bt(n,function(r,o,i,a){var s=function(){var t=r.id;Rt(n.items,t).archive(),e("DID_REMOVE_ITEM",{error:null,id:t,item:r}),St(e,n),o(Te(r))},u=n.options.server;r.origin===ve.LOCAL&&u&&Y(u.remove)&&!1!==a.remove?(e("DID_START_ITEM_REMOVE",{id:r.id}),u.remove(r.source,function(){return s()},function(t){e("DID_THROW_ITEM_REMOVE_ERROR",{id:r.id,error:ot("error",0,t,null),status:{main:Dt(n.options.labelFileRemoveError)(t),sub:n.options.labelTapToRetry}})})):((a.revert&&r.origin!==ve.LOCAL&&null!==r.serverId||n.options.chunkUploads&&r.file.size>n.options.chunkSize||n.options.chunkUploads&&n.options.chunkForce)&&r.revert(Tt(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")),s())}),ABORT_ITEM_LOAD:bt(n,function(e){e.abortLoad()}),ABORT_ITEM_PROCESSING:bt(n,function(t){t.serverId?e("REVERT_ITEM_PROCESSING",{id:t.id}):t.abortProcessing().then(function(){n.options.instantUpload&&e("REMOVE_ITEM",{query:t.id})})}),REQUEST_REVERT_ITEM_PROCESSING:bt(n,function(r){if(n.options.instantUpload){var o=function(t){t&&e("REVERT_ITEM_PROCESSING",{query:r})},i=t("GET_BEFORE_REMOVE_FILE");if(!i)return o(!0);var a=i(Te(r));return null==a?o(!0):"boolean"==typeof a?o(a):void("function"==typeof a.then&&a.then(o))}e("REVERT_ITEM_PROCESSING",{query:r})}),REVERT_ITEM_PROCESSING:bt(n,function(r){r.revert(Tt(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")).then(function(){(n.options.instantUpload||function(e){return!ht(e.file)}(r))&&e("REMOVE_ITEM",{query:r.id})}).catch(function(){})}),SET_OPTIONS:function(t){var n=t.options,r=Object.keys(n),o=Mt.filter(function(e){return r.includes(e)});[].concat(ue(o),ue(Object.keys(n).filter(function(e){return!o.includes(e)}))).forEach(function(t){e("SET_"+Z(t,"_").toUpperCase(),{value:n[t]})})}}},Mt=["server"],wt=function(e){return e},Ct=function(e){return document.createElement(e)},Nt=function(e,t){var n=e.childNodes[0];n?t!==n.nodeValue&&(n.nodeValue=t):(n=document.createTextNode(t),e.appendChild(n))},Gt=function(e,t,n,r){var o=(r%360-90)*Math.PI/180;return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}},Ut=function(e,t,n,r,o){var i=1;return o>r&&o-r<=.5&&(i=0),r>o&&r-o>=.5&&(i=0),function(e,t,n,r,o,i){var a=Gt(e,t,n,o),s=Gt(e,t,n,r);return["M",a.x,a.y,"A",n,n,0,i,0,s.x,s.y].join(" ")}(e,t,n,360*Math.min(.9999,r),360*Math.min(.9999,o),i)},Bt=S({tag:"div",name:"progress-indicator",ignoreRectUpdate:!0,ignoreRect:!0,create:function(e){var t=e.root,n=e.props;n.spin=!1,n.progress=0,n.opacity=0;var r=a("svg");t.ref.path=a("path",{"stroke-width":2,"stroke-linecap":"round"}),r.appendChild(t.ref.path),t.ref.svg=r,t.appendChild(r)},write:function(e){var t=e.root,n=e.props;if(0!==n.opacity){n.align&&(t.element.dataset.align=n.align);var o=parseInt(r(t.ref.path,"stroke-width"),10),i=.5*t.rect.element.width,a=0,s=0;n.spin?(a=0,s=.5):(a=0,s=n.progress);var u=Ut(i,i,i-o,a,s);r(t.ref.path,"d",u),r(t.ref.path,"stroke-opacity",n.spin||n.progress>0?1:0)}},mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}}),Ft=S({tag:"button",attributes:{type:"button"},ignoreRect:!0,ignoreRectUpdate:!0,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:!0},create:function(e){var t=e.root,n=e.props;t.element.innerHTML=(n.icon||"")+"<span>"+n.label+"</span>",n.isDisabled=!1},write:function(e){var t=e.root,n=e.props,o=n.isDisabled,i=t.query("GET_DISABLED")||0===n.opacity;i&&!o?(n.isDisabled=!0,r(t.element,"disabled","disabled")):!i&&o&&(n.isDisabled=!1,t.element.removeAttribute("disabled"))}}),qt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.labelBytes,i=void 0===o?"bytes":o,a=r.labelKilobytes,s=void 0===a?"KB":a,u=r.labelMegabytes,l=void 0===u?"MB":u,c=r.labelGigabytes,f=void 0===c?"GB":c,d=n,p=n*n,E=n*n*n;return(e=Math.round(Math.abs(e)))<d?e+" "+i:e<p?Math.floor(e/d)+" "+s:e<E?Vt(e/p,1,t)+" "+l:Vt(e/E,2,t)+" "+f},Vt=function(e,t,n){return e.toFixed(t).split(".").filter(function(e){return"0"!==e}).join(n)},xt=function(e){var t=e.root,n=e.props;Nt(t.ref.fileSize,qt(t.query("GET_ITEM_SIZE",n.id),".",t.query("GET_FILE_SIZE_BASE"),t.query("GET_FILE_SIZE_LABELS",t.query))),Nt(t.ref.fileName,wt(t.query("GET_ITEM_NAME",n.id)))},Yt=function(e){var t=e.root,n=e.props;V(t.query("GET_ITEM_SIZE",n.id))?xt({root:t,props:n}):Nt(t.ref.fileSize,t.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))},kt=S({name:"file-info",ignoreRect:!0,ignoreRectUpdate:!0,write:A({DID_LOAD_ITEM:xt,DID_UPDATE_ITEM_META:xt,DID_THROW_ITEM_LOAD_ERROR:Yt,DID_THROW_ITEM_INVALID:Yt}),didCreateView:function(e){ye("CREATE_VIEW",Object.assign({},e,{view:e}))},create:function(e){var t=e.root,n=e.props,o=Ct("span");o.className="filepond--file-info-main",r(o,"aria-hidden","true"),t.appendChild(o),t.ref.fileName=o;var i=Ct("span");i.className="filepond--file-info-sub",t.appendChild(i),t.ref.fileSize=i,Nt(i,t.query("GET_LABEL_FILE_WAITING_FOR_SIZE")),Nt(o,wt(t.query("GET_ITEM_NAME",n.id)))},mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}}),jt=function(e){return Math.round(100*e)},Ht=function(e){var t=e.root,n=e.action,r=null===n.progress?t.query("GET_LABEL_FILE_LOADING"):t.query("GET_LABEL_FILE_LOADING")+" "+jt(n.progress)+"%";Nt(t.ref.main,r),Nt(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},Xt=function(e){var t=e.root;Nt(t.ref.main,""),Nt(t.ref.sub,"")},Wt=function(e){var t=e.root,n=e.action;Nt(t.ref.main,n.status.main),Nt(t.ref.sub,n.status.sub)},zt=S({name:"file-status",ignoreRect:!0,ignoreRectUpdate:!0,write:A({DID_LOAD_ITEM:Xt,DID_REVERT_ITEM_PROCESSING:Xt,DID_REQUEST_ITEM_PROCESSING:function(e){var t=e.root;Nt(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING")),Nt(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},DID_ABORT_ITEM_PROCESSING:function(e){var t=e.root;Nt(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING_ABORTED")),Nt(t.ref.sub,t.query("GET_LABEL_TAP_TO_RETRY"))},DID_COMPLETE_ITEM_PROCESSING:function(e){var t=e.root;Nt(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING_COMPLETE")),Nt(t.ref.sub,t.query("GET_LABEL_TAP_TO_UNDO"))},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(e){var t=e.root,n=e.action,r=null===n.progress?t.query("GET_LABEL_FILE_PROCESSING"):t.query("GET_LABEL_FILE_PROCESSING")+" "+jt(n.progress)+"%";Nt(t.ref.main,r),Nt(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},DID_UPDATE_ITEM_LOAD_PROGRESS:Ht,DID_THROW_ITEM_LOAD_ERROR:Wt,DID_THROW_ITEM_INVALID:Wt,DID_THROW_ITEM_PROCESSING_ERROR:Wt,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Wt,DID_THROW_ITEM_REMOVE_ERROR:Wt}),didCreateView:function(e){ye("CREATE_VIEW",Object.assign({},e,{view:e}))},create:function(e){var t=e.root,n=Ct("span");n.className="filepond--file-status-main",t.appendChild(n),t.ref.main=n;var r=Ct("span");r.className="filepond--file-status-sub",t.appendChild(r),t.ref.sub=r,Ht({root:t,action:{progress:null}})},mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}}),Qt={AbortItemLoad:{label:"GET_LABEL_BUTTON_ABORT_ITEM_LOAD",action:"ABORT_ITEM_LOAD",className:"filepond--action-abort-item-load",align:"LOAD_INDICATOR_POSITION"},RetryItemLoad:{label:"GET_LABEL_BUTTON_RETRY_ITEM_LOAD",action:"RETRY_ITEM_LOAD",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-load",align:"BUTTON_PROCESS_ITEM_POSITION"},RemoveItem:{label:"GET_LABEL_BUTTON_REMOVE_ITEM",action:"REQUEST_REMOVE_ITEM",icon:"GET_ICON_REMOVE",className:"filepond--action-remove-item",align:"BUTTON_REMOVE_ITEM_POSITION"},ProcessItem:{label:"GET_LABEL_BUTTON_PROCESS_ITEM",action:"REQUEST_ITEM_PROCESSING",icon:"GET_ICON_PROCESS",className:"filepond--action-process-item",align:"BUTTON_PROCESS_ITEM_POSITION"},AbortItemProcessing:{label:"GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING",action:"ABORT_ITEM_PROCESSING",className:"filepond--action-abort-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RetryItemProcessing:{label:"GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING",action:"RETRY_ITEM_PROCESSING",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RevertItemProcessing:{label:"GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING",action:"REQUEST_REVERT_ITEM_PROCESSING",icon:"GET_ICON_UNDO",className:"filepond--action-revert-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"}},Zt=[];t(Qt,function(e){Zt.push(e)});var Kt,$t=function(e){if("right"===nn(e))return 0;var t=e.ref.buttonRemoveItem.rect.element;return t.hidden?null:t.width+t.left},Jt=function(e){return e.ref.buttonAbortItemLoad.rect.element.width},en=function(e){return Math.floor(e.ref.buttonRemoveItem.rect.element.height/4)},tn=function(e){return Math.floor(e.ref.buttonRemoveItem.rect.element.left/2)},nn=function(e){return e.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")},rn={buttonAbortItemLoad:{opacity:0},buttonRetryItemLoad:{opacity:0},buttonRemoveItem:{opacity:0},buttonProcessItem:{opacity:0},buttonAbortItemProcessing:{opacity:0},buttonRetryItemProcessing:{opacity:0},buttonRevertItemProcessing:{opacity:0},loadProgressIndicator:{opacity:0,align:function(e){return e.query("GET_STYLE_LOAD_INDICATOR_POSITION")}},processProgressIndicator:{opacity:0,align:function(e){return e.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}},on={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:$t},status:{translateX:$t}},an={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}},sn={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:$t},status:{translateX:$t,opacity:1}},DID_START_ITEM_LOAD:{buttonAbortItemLoad:{opacity:1},loadProgressIndicator:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_LOAD_ERROR:{buttonRetryItemLoad:{opacity:1},buttonRemoveItem:{opacity:1},info:{translateX:$t},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:nn},info:{translateX:$t},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:nn},buttonRemoveItem:{opacity:1},info:{translateX:$t},status:{opacity:1,translateX:$t}},DID_LOAD_ITEM:on,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:$t},status:{translateX:$t}},DID_START_ITEM_PROCESSING:an,DID_REQUEST_ITEM_PROCESSING:an,DID_UPDATE_ITEM_PROCESS_PROGRESS:an,DID_COMPLETE_ITEM_PROCESSING:{buttonRevertItemProcessing:{opacity:1},info:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_PROCESSING_ERROR:{buttonRemoveItem:{opacity:1},buttonRetryItemProcessing:{opacity:1},status:{opacity:1},info:{translateX:$t}},DID_THROW_ITEM_PROCESSING_REVERT_ERROR:{buttonRevertItemProcessing:{opacity:1},status:{opacity:1},info:{opacity:1}},DID_ABORT_ITEM_PROCESSING:{buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:$t},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:on},un=S({create:function(e){var t=e.root;t.element.innerHTML=t.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:!0,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}}),ln=A({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function(e){var t=e.root,n=e.action;t.ref.buttonAbortItemProcessing.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function(e){var t=e.root,n=e.action;t.ref.buttonAbortItemLoad.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function(e){var t=e.root,n=e.action;t.ref.buttonAbortItemRemoval.label=n.value},DID_REQUEST_ITEM_PROCESSING:function(e){var t=e.root;t.ref.processProgressIndicator.spin=!0,t.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function(e){var t=e.root;t.ref.loadProgressIndicator.spin=!0,t.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function(e){var t=e.root;t.ref.processProgressIndicator.spin=!0,t.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function(e){var t=e.root,n=e.action;t.ref.loadProgressIndicator.spin=!1,t.ref.loadProgressIndicator.progress=n.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(e){var t=e.root,n=e.action;t.ref.processProgressIndicator.spin=!1,t.ref.processProgressIndicator.progress=n.progress}}),cn=S({create:function(e){var n,r=e.root,o=e.props,i=Object.keys(Qt).reduce(function(e,t){return e[t]=Object.assign({},Qt[t]),e},{}),a=o.id,s=r.query("GET_ALLOW_REVERT"),u=r.query("GET_ALLOW_REMOVE"),l=r.query("GET_ALLOW_PROCESS"),c=r.query("GET_INSTANT_UPLOAD"),f=r.query("IS_ASYNC"),d=r.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN");f?l&&!s?n=function(e){return!/RevertItemProcessing/.test(e)}:!l&&s?n=function(e){return!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(e)}:l||s||(n=function(e){return!/Process/.test(e)}):n=function(e){return!/Process/.test(e)};var p=n?Zt.filter(n):Zt.concat();if(c&&s&&(i.RevertItemProcessing.label="GET_LABEL_BUTTON_REMOVE_ITEM",i.RevertItemProcessing.icon="GET_ICON_REMOVE"),f&&!s){var E=sn.DID_COMPLETE_ITEM_PROCESSING;E.info.translateX=tn,E.info.translateY=en,E.status.translateY=en,E.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(f&&!l&&(["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach(function(e){sn[e].status.translateY=en}),sn.DID_THROW_ITEM_PROCESSING_ERROR.status.translateX=Jt),d&&s){i.RevertItemProcessing.align="BUTTON_REMOVE_ITEM_POSITION";var _=sn.DID_COMPLETE_ITEM_PROCESSING;_.info.translateX=$t,_.status.translateY=en,_.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}u||(i.RemoveItem.disabled=!0),t(i,function(e,t){var n=r.createChildView(Ft,{label:r.query(t.label),icon:r.query(t.icon),opacity:0});p.includes(e)&&r.appendChildView(n),t.disabled&&(n.element.setAttribute("disabled","disabled"),n.element.setAttribute("hidden","hidden")),n.element.dataset.align=r.query("GET_STYLE_"+t.align),n.element.classList.add(t.className),n.on("click",function(e){e.stopPropagation(),t.disabled||r.dispatch(t.action,{query:a})}),r.ref["button"+e]=n}),r.ref.processingCompleteIndicator=r.appendChildView(r.createChildView(un)),r.ref.processingCompleteIndicator.element.dataset.align=r.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION"),r.ref.info=r.appendChildView(r.createChildView(kt,{id:a})),r.ref.status=r.appendChildView(r.createChildView(zt,{id:a}));var T=r.appendChildView(r.createChildView(Bt,{opacity:0,align:r.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));T.element.classList.add("filepond--load-indicator"),r.ref.loadProgressIndicator=T;var I=r.appendChildView(r.createChildView(Bt,{opacity:0,align:r.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));I.element.classList.add("filepond--process-indicator"),r.ref.processProgressIndicator=I,r.ref.activeStyles=[]},write:function(e){var n=e.root,r=e.actions,o=e.props;ln({root:n,actions:r,props:o});var i=r.concat().filter(function(e){return/^DID_/.test(e.type)}).reverse().find(function(e){return sn[e.type]});if(i){n.ref.activeStyles=[];var a=sn[i.type];t(rn,function(e,r){var o=n.ref[e];t(r,function(t,r){var i=a[e]&&void 0!==a[e][t]?a[e][t]:r;n.ref.activeStyles.push({control:o,key:t,value:i})})})}n.ref.activeStyles.forEach(function(e){var t=e.control,r=e.key,o=e.value;t[r]="function"==typeof o?o(n):o})},didCreateView:function(e){ye("CREATE_VIEW",Object.assign({},e,{view:e}))},name:"file"}),fn=S({create:function(e){var t=e.root,n=e.props;t.ref.fileName=Ct("legend"),t.appendChild(t.ref.fileName),t.ref.file=t.appendChildView(t.createChildView(cn,{id:n.id})),t.ref.data=!1},ignoreRect:!0,write:A({DID_LOAD_ITEM:function(e){var t=e.root,n=e.props;Nt(t.ref.fileName,wt(t.query("GET_ITEM_NAME",n.id)))}}),didCreateView:function(e){ye("CREATE_VIEW",Object.assign({},e,{view:e}))},tag:"fieldset",name:"file-wrapper"}),dn={type:"spring",damping:.6,mass:7},pn=function(e,t,n){var r=S({name:"panel-"+t.name+" filepond--"+n,mixins:t.mixins,ignoreRectUpdate:!0}),o=e.createChildView(r,t.props);e.ref[t.name]=e.appendChildView(o)},En=S({name:"panel",read:function(e){var t=e.root;return e.props.heightCurrent=t.ref.bottom.translateY},write:function(e){var t=e.root,n=e.props;if(null!==t.ref.scalable&&n.scalable===t.ref.scalable||(t.ref.scalable=!N(n.scalable)||n.scalable,t.element.dataset.scalable=t.ref.scalable),n.height){var r=t.ref.top.rect.element,o=t.ref.bottom.rect.element,i=Math.max(r.height+o.height,n.height);t.ref.center.translateY=r.height,t.ref.center.scaleY=(i-r.height-o.height)/100,t.ref.bottom.translateY=i-o.height}},create:function(e){var t=e.root,n=e.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:dn},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:dn},styles:["translateY"]}}].forEach(function(e){pn(t,e,n.name)}),t.element.classList.add("filepond--"+n.name),t.ref.scalable=null},ignoreRect:!0,mixins:{apis:["height","heightCurrent","scalable"]}}),_n={type:"spring",stiffness:.75,damping:.45,mass:10},Tn={DID_START_ITEM_LOAD:"busy",DID_UPDATE_ITEM_LOAD_PROGRESS:"loading",DID_THROW_ITEM_INVALID:"load-invalid",DID_THROW_ITEM_LOAD_ERROR:"load-error",DID_LOAD_ITEM:"idle",DID_THROW_ITEM_REMOVE_ERROR:"remove-error",DID_START_ITEM_REMOVE:"busy",DID_START_ITEM_PROCESSING:"busy processing",DID_REQUEST_ITEM_PROCESSING:"busy processing",DID_UPDATE_ITEM_PROCESS_PROGRESS:"processing",DID_COMPLETE_ITEM_PROCESSING:"processing-complete",DID_THROW_ITEM_PROCESSING_ERROR:"processing-error",DID_THROW_ITEM_PROCESSING_REVERT_ERROR:"processing-revert-error",DID_ABORT_ITEM_PROCESSING:"cancelled",DID_REVERT_ITEM_PROCESSING:"idle"},In=A({DID_UPDATE_PANEL_HEIGHT:function(e){var t=e.root,n=e.action;t.height=n.height}}),vn=A({DID_GRAB_ITEM:function(e){var t=e.root;e.props.dragOrigin={x:t.translateX,y:t.translateY}},DID_DRAG_ITEM:function(e){e.root.element.dataset.dragState="drag"},DID_DROP_ITEM:function(e){var t=e.root,n=e.props;n.dragOffset=null,n.dragOrigin=null,t.element.dataset.dragState="drop"}},function(e){var t=e.root,n=e.actions,r=e.props,o=e.shouldOptimize;"drop"===t.element.dataset.dragState&&t.scaleX<=1&&(t.element.dataset.dragState="idle");var i=n.concat().filter(function(e){return/^DID_/.test(e.type)}).reverse().find(function(e){return Tn[e.type]});i&&i.type!==r.currentState&&(r.currentState=i.type,t.element.dataset.filepondItemState=Tn[r.currentState]||"");var a=t.query("GET_ITEM_PANEL_ASPECT_RATIO")||t.query("GET_PANEL_ASPECT_RATIO");a?o||(t.height=t.rect.element.width*a):(In({root:t,actions:n,props:r}),!t.height&&t.ref.container.rect.element.height>0&&(t.height=t.ref.container.rect.element.height)),o&&(t.ref.panel.height=null),t.ref.panel.height=t.height}),mn=S({create:function(e){var t=e.root,n=e.props;t.ref.handleClick=function(e){return t.dispatch("DID_ACTIVATE_ITEM",{id:n.id})},t.element.id="filepond--item-"+n.id,t.element.addEventListener("click",t.ref.handleClick),t.ref.container=t.appendChildView(t.createChildView(fn,{id:n.id})),t.ref.panel=t.appendChildView(t.createChildView(En,{name:"item-panel"})),t.ref.panel.height=null,n.markedForRemoval=!1,t.query("GET_ALLOW_REORDER")&&(t.element.dataset.dragState="idle",t.element.addEventListener("pointerdown",function(e){if(e.isPrimary){var r=!1,o=e.pageX,i=e.pageY;n.dragOrigin={x:t.translateX,y:t.translateY},n.dragCenter={x:e.offsetX,y:e.offsetY};var a,s,u,l=(a=t.query("GET_ACTIVE_ITEMS"),s=a.map(function(e){return e.id}),u=void 0,{setIndex:function(e){u=e},getIndex:function(){return u},getItemIndex:function(e){return s.indexOf(e.id)}});t.dispatch("DID_GRAB_ITEM",{id:n.id,dragState:l});var c=function(e){e.isPrimary&&(e.stopPropagation(),e.preventDefault(),n.dragOffset={x:e.pageX-o,y:e.pageY-i},n.dragOffset.x*n.dragOffset.x+n.dragOffset.y*n.dragOffset.y>16&&!r&&(r=!0,t.element.removeEventListener("click",t.ref.handleClick)),t.dispatch("DID_DRAG_ITEM",{id:n.id,dragState:l}))},f=function(e){e.isPrimary&&(n.dragOffset={x:e.pageX-o,y:e.pageY-i},p())},d=function(){p()},p=function(){document.removeEventListener("pointercancel",d),document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",f),t.dispatch("DID_DROP_ITEM",{id:n.id,dragState:l}),r&&setTimeout(function(){return t.element.addEventListener("click",t.ref.handleClick)},0)};document.addEventListener("pointercancel",d),document.addEventListener("pointermove",c),document.addEventListener("pointerup",f)}}))},write:vn,destroy:function(e){var t=e.root,n=e.props;t.element.removeEventListener("click",t.ref.handleClick),t.dispatch("RELEASE_ITEM",{query:n.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:"spring",scaleY:"spring",translateX:_n,translateY:_n,opacity:{type:"tween",duration:150}}}}),hn=function(e,t){return Math.max(1,Math.floor((e+1)/t))},gn=function(e,t,n){if(n){var r=e.rect.element.width,o=t.length,i=null;if(0===o||n.top<t[0].rect.element.top)return-1;var a=t[0].rect.element,s=a.marginLeft+a.marginRight,u=a.width+s,l=hn(r,u);if(1===l){for(var c=0;c<o;c++){var f=t[c],d=f.rect.outer.top+.5*f.rect.element.height;if(n.top<d)return c}return o}for(var p=a.marginTop+a.marginBottom,E=a.height+p,_=0;_<o;_++){var T=_%l*u,I=Math.floor(_/l)*E,v=I-a.marginTop,m=T+u,h=I+E+a.marginBottom;if(n.top<h&&n.top>v){if(n.left<m)return _;i=_!==o-1?_:null}}return null!==i?i:o}},Rn={height:0,width:0,get getHeight(){return this.height},set setHeight(e){0!==this.height&&0!==e||(this.height=e)},get getWidth(){return this.width},set setWidth(e){0!==this.width&&0!==e||(this.width=e)},setDimensions:function(e,t){0!==this.height&&0!==e||(this.height=e),0!==this.width&&0!==t||(this.width=t)}},On=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;e.dragOffset?(e.translateX=null,e.translateY=null,e.translateX=e.dragOrigin.x+e.dragOffset.x,e.translateY=e.dragOrigin.y+e.dragOffset.y,e.scaleX=1.025,e.scaleY=1.025):(e.translateX=t,e.translateY=n,Date.now()>e.spawnDate&&(0===e.opacity&&yn(e,t,n,r,o),e.scaleX=1,e.scaleY=1,e.opacity=1))},yn=function(e,t,n,r,o){e.interactionMethod===re?(e.translateX=null,e.translateX=t,e.translateY=null,e.translateY=n):e.interactionMethod===ee?(e.translateX=null,e.translateX=t-20*r,e.translateY=null,e.translateY=n-10*o,e.scaleX=.8,e.scaleY=.8):e.interactionMethod===te?(e.translateY=null,e.translateY=n-30):e.interactionMethod===J&&(e.translateX=null,e.translateX=t-30,e.translateY=null)},Dn=function(e){return e.rect.element.height+.5*e.rect.element.marginBottom+.5*e.rect.element.marginTop},Sn=A({DID_ADD_ITEM:function(e){var t=e.root,n=e.action,r=n.id,o=n.index,i=n.interactionMethod;t.ref.addIndex=o;var a=Date.now(),s=a,u=1;if(i!==re){u=0;var l=t.query("GET_ITEM_INSERT_INTERVAL"),c=a-t.ref.lastItemSpanwDate;s=c<l?a+(l-c):a}t.ref.lastItemSpanwDate=s,t.appendChildView(t.createChildView(mn,{spawnDate:s,id:r,opacity:u,interactionMethod:i}),o)},DID_REMOVE_ITEM:function(e){var t=e.root,n=e.action.id,r=t.childViews.find(function(e){return e.id===n});r&&(r.scaleX=.9,r.scaleY=.9,r.opacity=0,r.markedForRemoval=!0)},DID_DRAG_ITEM:function(e){var t=e.root,n=e.action,r=n.id,o=n.dragState,i=t.query("GET_ITEM",{id:r}),a=t.childViews.find(function(e){return e.id===r}),s=t.childViews.length,u=o.getItemIndex(i);if(a){var l,c=a.dragOrigin.x+a.dragOffset.x+a.dragCenter.x,f=a.dragOrigin.y+a.dragOffset.y+a.dragCenter.y,d=Dn(a),p=(l=a).rect.element.width+.5*l.rect.element.marginLeft+.5*l.rect.element.marginRight,E=Math.floor(t.rect.outer.width/p);E>s&&(E=s);var _=Math.floor(s/E+1);Rn.setHeight=d*_,Rn.setWidth=p*E;var T={y:Math.floor(f/d),x:Math.floor(c/p),getGridIndex:function(){return f>Rn.getHeight||f<0||c>Rn.getWidth||c<0?u:this.y*E+this.x},getColIndex:function(){for(var e=t.query("GET_ACTIVE_ITEMS"),n=t.childViews.filter(function(e){return e.rect.element.height}),r=e.map(function(e){return n.find(function(t){return t.id===e.id})}),o=r.findIndex(function(e){return e===a}),i=Dn(a),s=r.length,u=s,l=0,c=0,d=0,p=0;p<s;p++)if(l=Dn(r[p]),f<(c=(d=c)+l)){if(o>p){if(f<d+i){u=p;break}continue}u=p;break}return u}},I=E>1?T.getGridIndex():T.getColIndex();t.dispatch("MOVE_ITEM",{query:a,index:I});var v=o.getIndex();if(void 0===v||v!==I){if(o.setIndex(I),void 0===v)return;t.dispatch("DID_REORDER_ITEMS",{items:t.query("GET_ACTIVE_ITEMS"),origin:u,target:I})}}}}),An=S({create:function(e){var t=e.root;r(t.element,"role","list"),t.ref.lastItemSpanwDate=Date.now()},write:function(e){var t=e.root,n=e.props,r=e.actions,o=e.shouldOptimize;Sn({root:t,props:n,actions:r});var i=n.dragCoordinates,a=t.rect.element.width,s=t.childViews.filter(function(e){return e.rect.element.height}),u=t.query("GET_ACTIVE_ITEMS").map(function(e){return s.find(function(t){return t.id===e.id})}).filter(function(e){return e}),l=i?gn(t,u,i):null,c=t.ref.addIndex||null;t.ref.addIndex=null;var f=0,d=0,p=0;if(0!==u.length){var E=u[0].rect.element,_=E.marginTop+E.marginBottom,T=E.marginLeft+E.marginRight,I=E.width+T,v=E.height+_,m=hn(a,I);if(1===m){var h=0,g=0;u.forEach(function(e,t){if(l){var n=t-l;g=-2===n?.25*-_:-1===n?.75*-_:0===n?.75*_:1===n?.25*_:0}o&&(e.translateX=null,e.translateY=null),e.markedForRemoval||On(e,0,h+g);var r=(e.rect.element.height+_)*(e.markedForRemoval?e.opacity:1);h+=r})}else{var R=0,O=0;u.forEach(function(e,t){t===l&&(f=1),t===c&&(p+=1),e.markedForRemoval&&e.opacity<.5&&(d-=1);var n=t+p+f+d,r=n%m,i=Math.floor(n/m),a=r*I,s=i*v,u=Math.sign(a-R),E=Math.sign(s-O);R=a,O=s,e.markedForRemoval||(o&&(e.translateX=null,e.translateY=null),On(e,a,s,u,E))})}}},tag:"ul",name:"list",didWriteView:function(e){var t=e.root;t.childViews.filter(function(e){return e.markedForRemoval&&0===e.opacity&&e.resting}).forEach(function(e){e._destroy(),t.removeChildView(e)})},filterFrameActionsForChild:function(e,t){return t.filter(function(t){return!t.data||!t.data.id||e.id===t.data.id})},mixins:{apis:["dragCoordinates"]}}),Ln=A({DID_DRAG:function(e){var t=e.root,n=e.props,r=e.action;t.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(n.dragCoordinates={left:r.position.scopeLeft-t.ref.list.rect.element.left,top:r.position.scopeTop-(t.rect.outer.top+t.rect.element.marginTop+t.rect.element.scrollTop)})},DID_END_DRAG:function(e){e.props.dragCoordinates=null}}),bn=S({create:function(e){var t=e.root,n=e.props;t.ref.list=t.appendChildView(t.createChildView(An)),n.dragCoordinates=null,n.overflowing=!1},write:function(e){var t=e.root,n=e.props,r=e.actions;if(Ln({root:t,props:n,actions:r}),t.ref.list.dragCoordinates=n.dragCoordinates,n.overflowing&&!n.overflow&&(n.overflowing=!1,t.element.dataset.state="",t.height=null),n.overflow){var o=Math.round(n.overflow);o!==t.height&&(n.overflowing=!0,t.element.dataset.state="overflow",t.height=o)}},name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),Pn=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";n?r(e,t,o):e.removeAttribute(t)},Mn=function(e){var t=e.root,n=e.action;t.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&Pn(t.element,"accept",!!n.value,n.value?n.value.join(","):"")},wn=function(e){var t=e.root,n=e.action;Pn(t.element,"multiple",n.value)},Cn=function(e){var t=e.root,n=e.action;Pn(t.element,"webkitdirectory",n.value)},Nn=function(e){var t=e.root,n=t.query("GET_DISABLED"),r=t.query("GET_ALLOW_BROWSE"),o=n||!r;Pn(t.element,"disabled",o)},Gn=function(e){var t=e.root;e.action.value?0===t.query("GET_TOTAL_ITEMS")&&Pn(t.element,"required",!0):Pn(t.element,"required",!1)},Un=function(e){var t=e.root,n=e.action;Pn(t.element,"capture",!!n.value,!0===n.value?"":n.value)},Bn=function(e){var t=e.root,n=t.element;if(t.query("GET_TOTAL_ITEMS")>0){Pn(n,"required",!1),Pn(n,"name",!1);for(var r=t.query("GET_ACTIVE_ITEMS"),o=!1,i=0;i<r.length;i++)r[i].status===Ie.LOAD_ERROR&&(o=!0);t.element.setCustomValidity(o?t.query("GET_LABEL_INVALID_FIELD"):"")}else{Pn(n,"name",!0,t.query("GET_NAME")),t.query("GET_CHECK_VALIDITY")&&n.setCustomValidity(""),t.query("GET_REQUIRED")&&Pn(n,"required",!0)}},Fn=S({tag:"input",name:"browser",ignoreRect:!0,ignoreRectUpdate:!0,attributes:{type:"file"},create:function(e){var t=e.root,n=e.props;t.element.id="filepond--browser-"+n.id,r(t.element,"name",t.query("GET_NAME")),r(t.element,"aria-controls","filepond--assistant-"+n.id),r(t.element,"aria-labelledby","filepond--drop-label-"+n.id),Mn({root:t,action:{value:t.query("GET_ACCEPTED_FILE_TYPES")}}),wn({root:t,action:{value:t.query("GET_ALLOW_MULTIPLE")}}),Cn({root:t,action:{value:t.query("GET_ALLOW_DIRECTORIES_ONLY")}}),Nn({root:t}),Gn({root:t,action:{value:t.query("GET_REQUIRED")}}),Un({root:t,action:{value:t.query("GET_CAPTURE_METHOD")}}),t.ref.handleChange=function(e){if(t.element.value){var r=Array.from(t.element.files).map(function(e){return e._relativePath=e.webkitRelativePath,e});setTimeout(function(){n.onload(r),function(e){if(e&&""!==e.value){try{e.value=""}catch(e){}if(e.value){var t=Ct("form"),n=e.parentNode,r=e.nextSibling;t.appendChild(e),t.reset(),r?n.insertBefore(e,r):n.appendChild(e)}}}(t.element)},250)}},t.element.addEventListener("change",t.ref.handleChange)},destroy:function(e){var t=e.root;t.element.removeEventListener("change",t.ref.handleChange)},write:A({DID_LOAD_ITEM:Bn,DID_REMOVE_ITEM:Bn,DID_THROW_ITEM_INVALID:function(e){var t=e.root;t.query("GET_CHECK_VALIDITY")&&t.element.setCustomValidity(t.query("GET_LABEL_INVALID_FIELD"))},DID_SET_DISABLED:Nn,DID_SET_ALLOW_BROWSE:Nn,DID_SET_ALLOW_DIRECTORIES_ONLY:Cn,DID_SET_ALLOW_MULTIPLE:wn,DID_SET_ACCEPTED_FILE_TYPES:Mn,DID_SET_CAPTURE_METHOD:Un,DID_SET_REQUIRED:Gn})}),qn=13,Vn=32,xn=function(e,t){e.innerHTML=t;var n=e.querySelector(".filepond--label-action");return n&&r(n,"tabindex","0"),t},Yn=S({name:"drop-label",ignoreRect:!0,create:function(e){var t=e.root,n=e.props,o=Ct("label");r(o,"for","filepond--browser-"+n.id),r(o,"id","filepond--drop-label-"+n.id),t.ref.handleKeyDown=function(e){(e.keyCode===qn||e.keyCode===Vn)&&(e.preventDefault(),t.ref.label.click())},t.ref.handleClick=function(e){e.target===o||o.contains(e.target)||t.ref.label.click()},o.addEventListener("keydown",t.ref.handleKeyDown),t.element.addEventListener("click",t.ref.handleClick),xn(o,n.caption),t.appendChild(o),t.ref.label=o},destroy:function(e){var t=e.root;t.ref.label.addEventListener("keydown",t.ref.handleKeyDown),t.element.removeEventListener("click",t.ref.handleClick)},write:A({DID_SET_LABEL_IDLE:function(e){var t=e.root,n=e.action;xn(t.ref.label,n.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),kn=S({name:"drip-blob",ignoreRect:!0,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}}),jn=A({DID_DRAG:function(e){var t=e.root,n=e.action;t.ref.blob?(t.ref.blob.translateX=n.position.scopeLeft,t.ref.blob.translateY=n.position.scopeTop,t.ref.blob.scaleX=1,t.ref.blob.scaleY=1,t.ref.blob.opacity=1):function(e){var t=e.root,n=.5*t.rect.element.width,r=.5*t.rect.element.height;t.ref.blob=t.appendChildView(t.createChildView(kn,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:n,translateY:r}))}({root:t})},DID_DROP:function(e){var t=e.root;t.ref.blob&&(t.ref.blob.scaleX=2.5,t.ref.blob.scaleY=2.5,t.ref.blob.opacity=0)},DID_END_DRAG:function(e){var t=e.root;t.ref.blob&&(t.ref.blob.opacity=0)}}),Hn=S({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:function(e){var t=e.root,n=e.props,r=e.actions;jn({root:t,props:n,actions:r});var o=t.ref.blob;0===r.length&&o&&0===o.opacity&&(t.removeChildView(o),t.ref.blob=null)}}),Xn=function(e,t){try{var n=new DataTransfer;t.forEach(function(e){e instanceof File?n.items.add(e):n.items.add(new File([e],e.name,{type:e.type}))}),e.files=n.files}catch(e){return!1}return!0},Wn=function(e,t){return e.ref.fields[t]},zn=function(e){e.query("GET_ACTIVE_ITEMS").forEach(function(t){e.ref.fields[t.id]&&e.element.appendChild(e.ref.fields[t.id])})},Qn=function(e){var t=e.root;return zn(t)},Zn=A({DID_SET_DISABLED:function(e){var t=e.root;t.element.disabled=t.query("GET_DISABLED")},DID_ADD_ITEM:function(e){var t=e.root,n=e.action,r=!(t.query("GET_ITEM",n.id).origin===ve.LOCAL)&&t.query("SHOULD_UPDATE_FILE_INPUT"),o=Ct("input");o.type=r?"file":"hidden",o.name=t.query("GET_NAME"),t.ref.fields[n.id]=o,zn(t)},DID_LOAD_ITEM:function(e){var t=e.root,n=e.action,r=Wn(t,n.id);if(r&&(null!==n.serverFileReference&&(r.value=n.serverFileReference),t.query("SHOULD_UPDATE_FILE_INPUT"))){var o=t.query("GET_ITEM",n.id);Xn(r,[o.file])}},DID_REMOVE_ITEM:function(e){var t=e.root,n=e.action,r=Wn(t,n.id);r&&(r.parentNode&&r.parentNode.removeChild(r),delete t.ref.fields[n.id])},DID_DEFINE_VALUE:function(e){var t=e.root,n=e.action,r=Wn(t,n.id);r&&(null===n.value?r.removeAttribute("value"):"file"!=r.type&&(r.value=n.value),zn(t))},DID_PREPARE_OUTPUT:function(e){var t=e.root,n=e.action;t.query("SHOULD_UPDATE_FILE_INPUT")&&setTimeout(function(){var e=Wn(t,n.id);e&&Xn(e,[n.file])},0)},DID_REORDER_ITEMS:Qn,DID_SORT_ITEMS:Qn}),Kn=S({tag:"fieldset",name:"data",create:function(e){var t=e.root;t.ref.fields={};var n=document.createElement("legend");n.textContent="Files",t.element.appendChild(n)},write:Zn,ignoreRect:!0}),$n=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],Jn=["css","csv","html","txt"],er={zip:"zip|compressed",epub:"application/epub+zip"},tr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=e.toLowerCase(),$n.includes(e)?"image/"+("jpg"===e?"jpeg":"svg"===e?"svg+xml":e):Jn.includes(e)?"text/"+e:er[e]||""},nr=function(e){return new Promise(function(t,n){var r=dr(e);if(r.length&&!rr(e))return t(r);or(e).then(t)})},rr=function(e){return!!e.files&&e.files.length>0},or=function(e){return new Promise(function(t,n){var r=(e.items?Array.from(e.items):[]).filter(function(e){return ir(e)}).map(function(e){return ar(e)});r.length?Promise.all(r).then(function(e){var n=[];e.forEach(function(e){n.push.apply(n,e)}),t(n.filter(function(e){return e}).map(function(e){return e._relativePath||(e._relativePath=e.webkitRelativePath),e}))}).catch(console.error):t(e.files?Array.from(e.files):[])})},ir=function(e){if(cr(e)){var t=fr(e);if(t)return t.isFile||t.isDirectory}return"file"===e.kind},ar=function(e){return new Promise(function(t,n){lr(e)?sr(fr(e)).then(t).catch(n):t([e.getAsFile()])})},sr=function(e){return new Promise(function(t,n){var r=[],o=0,i=0,a=function(){0===i&&0===o&&t(r)};!function e(t){o++;var s=t.createReader();!function t(){s.readEntries(function(n){if(0===n.length)return o--,void a();n.forEach(function(t){t.isDirectory?e(t):(i++,t.file(function(e){var n=ur(e);t.fullPath&&(n._relativePath=t.fullPath),r.push(n),i--,a()}))}),t()},n)}()}(e)})},ur=function(e){if(e.type.length)return e;var t=e.lastModifiedDate,n=e.name,r=tr(je(e.name));return r.length?((e=e.slice(0,e.size,r)).name=n,e.lastModifiedDate=t,e):e},lr=function(e){return cr(e)&&(fr(e)||{}).isDirectory},cr=function(e){return"webkitGetAsEntry"in e},fr=function(e){return e.webkitGetAsEntry()},dr=function(e){var t=[];try{if((t=Er(e)).length)return t;t=pr(e)}catch(e){}return t},pr=function(e){var t=e.getData("url");return"string"==typeof t&&t.length?[t]:[]},Er=function(e){var t=e.getData("text/html");if("string"==typeof t&&t.length){var n=t.match(/src\s*=\s*"(.+?)"/);if(n)return[n[1]]}return[]},_r=[],Tr=function(e){return{pageLeft:e.pageX,pageTop:e.pageY,scopeLeft:e.offsetX||e.layerX,scopeTop:e.offsetY||e.layerY}},Ir=function(e){var t=_r.find(function(t){return t.element===e});if(t)return t;var n=vr(e);return _r.push(n),n},vr=function(e){var n=[],r={dragenter:Rr,dragover:Or,dragleave:Dr,drop:yr},o={};t(r,function(t,r){o[t]=r(e,n),e.addEventListener(t,o[t],!1)});var i={element:e,addListener:function(a){return n.push(a),function(){n.splice(n.indexOf(a),1),0===n.length&&(_r.splice(_r.indexOf(i),1),t(r,function(t){e.removeEventListener(t,o[t],!1)}))}}};return i},mr=function(e,t){var n,r=function(e,t){return"elementFromPoint"in e||(e=document),e.elementFromPoint(t.x,t.y)}("getRootNode"in(n=t)?n.getRootNode():document,{x:e.pageX-window.pageXOffset,y:e.pageY-window.pageYOffset});return r===t||t.contains(r)},hr=null,gr=function(e,t){try{e.dropEffect=t}catch(e){}},Rr=function(e,t){return function(e){e.preventDefault(),hr=e.target,t.forEach(function(t){var n=t.element,r=t.onenter;mr(e,n)&&(t.state="enter",r(Tr(e)))})}},Or=function(e,t){return function(e){e.preventDefault();var n=e.dataTransfer;nr(n).then(function(r){var o=!1;t.some(function(t){var i=t.filterElement,a=t.element,s=t.onenter,u=t.onexit,l=t.ondrag,c=t.allowdrop;gr(n,"copy");var f=c(r);if(f)if(mr(e,a)){if(o=!0,null===t.state)return t.state="enter",void s(Tr(e));if(t.state="over",i&&!f)return void gr(n,"none");l(Tr(e))}else i&&!o&&gr(n,"none"),t.state&&(t.state=null,u(Tr(e)));else gr(n,"none")})})}},yr=function(e,t){return function(e){e.preventDefault();var n=e.dataTransfer;nr(n).then(function(n){t.forEach(function(t){var r=t.filterElement,o=t.element,i=t.ondrop,a=t.onexit,s=t.allowdrop;if(t.state=null,!r||mr(e,o))return s(n)?void i(Tr(e),n):a(Tr(e))})})}},Dr=function(e,t){return function(e){hr===e.target&&t.forEach(function(t){var n=t.onexit;t.state=null,n(Tr(e))})}},Sr=function(e,t,n){e.classList.add("filepond--hopper");var r=n.catchesDropsOnPage,o=n.requiresDropOnElement,i=n.filterItems,a=void 0===i?function(e){return e}:i,s=function(e,t,n){var r=Ir(t),o={element:e,filterElement:n,state:null,ondrop:function(){},onenter:function(){},ondrag:function(){},onexit:function(){},onload:function(){},allowdrop:function(){}};return o.destroy=r.addListener(o),o}(e,r?document.documentElement:e,o),u="",l="";s.allowdrop=function(e){return t(a(e))},s.ondrop=function(e,n){var r=a(n);t(r)?(l="drag-drop",c.onload(r,e)):c.ondragend(e)},s.ondrag=function(e){c.ondrag(e)},s.onenter=function(e){l="drag-over",c.ondragstart(e)},s.onexit=function(e){l="drag-exit",c.ondragend(e)};var c={updateHopperState:function(){u!==l&&(e.dataset.hopperState=l,u=l)},onload:function(){},ondragstart:function(){},ondrag:function(){},ondragend:function(){},destroy:function(){s.destroy()}};return c},Ar=!1,Lr=[],br=function(e){var t=document.activeElement;if(t&&(/textarea|input/i.test(t.nodeName)||"true"===t.getAttribute("contenteditable")||""===t.getAttribute("contenteditable"))){for(var n=!1,r=t;r!==document.body;){if(r.classList.contains("filepond--root")){n=!0;break}r=r.parentNode}if(!n)return}nr(e.clipboardData).then(function(e){e.length&&Lr.forEach(function(t){return t(e)})})},Pr=function(){var e=function(e){t.onload(e)},t={destroy:function(){var t;t=e,de(Lr,Lr.indexOf(t)),0===Lr.length&&(document.removeEventListener("paste",br),Ar=!1)},onload:function(){}};return function(e){Lr.includes(e)||(Lr.push(e),Ar||(Ar=!0,document.addEventListener("paste",br)))}(e),t},Mr=null,wr=null,Cr=[],Nr=function(e,t){e.element.textContent=t},Gr=function(e,t,n){var r=e.query("GET_TOTAL_ITEMS");Nr(e,n+" "+t+", "+r+" "+(1===r?e.query("GET_LABEL_FILE_COUNT_SINGULAR"):e.query("GET_LABEL_FILE_COUNT_PLURAL"))),clearTimeout(wr),wr=setTimeout(function(){!function(e){e.element.textContent=""}(e)},1500)},Ur=function(e){return e.element.parentNode.contains(document.activeElement)},Br=function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename,o=t.query("GET_LABEL_FILE_PROCESSING_ABORTED");Nr(t,r+" "+o)},Fr=function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename;Nr(t,n.status.main+" "+r+" "+n.status.sub)},qr=S({create:function(e){var t=e.root,n=e.props;t.element.id="filepond--assistant-"+n.id,r(t.element,"role","alert"),r(t.element,"aria-live","polite"),r(t.element,"aria-relevant","additions")},ignoreRect:!0,ignoreRectUpdate:!0,write:A({DID_LOAD_ITEM:function(e){var t=e.root,n=e.action;if(Ur(t)){t.element.textContent="";var r=t.query("GET_ITEM",n.id);Cr.push(r.filename),clearTimeout(Mr),Mr=setTimeout(function(){Gr(t,Cr.join(", "),t.query("GET_LABEL_FILE_ADDED")),Cr.length=0},750)}},DID_REMOVE_ITEM:function(e){var t=e.root,n=e.action;if(Ur(t)){var r=n.item;Gr(t,r.filename,t.query("GET_LABEL_FILE_REMOVED"))}},DID_COMPLETE_ITEM_PROCESSING:function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename,o=t.query("GET_LABEL_FILE_PROCESSING_COMPLETE");Nr(t,r+" "+o)},DID_ABORT_ITEM_PROCESSING:Br,DID_REVERT_ITEM_PROCESSING:Br,DID_THROW_ITEM_REMOVE_ERROR:Fr,DID_THROW_ITEM_LOAD_ERROR:Fr,DID_THROW_ITEM_INVALID:Fr,DID_THROW_ITEM_PROCESSING_ERROR:Fr}),tag:"span",name:"assistant"}),Vr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.replace(new RegExp(t+".","g"),function(e){return e.charAt(1).toUpperCase()})},xr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Date.now(),o=null;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];clearTimeout(o);var u=Date.now()-r,l=function(){r=Date.now(),e.apply(void 0,a)};u<t?n||(o=setTimeout(l,t-u)):l()}},Yr=function(e){return e.preventDefault()},kr=function(e){var t=e.ref.list.childViews[0].childViews[0];return t?{top:t.rect.element.marginTop,bottom:t.rect.element.marginBottom}:{top:0,bottom:0}},jr=function(e){var t=0,n=0,r=e.ref.list,o=r.childViews[0],i=o.childViews.filter(function(e){return e.rect.element.height}),a=e.query("GET_ACTIVE_ITEMS").map(function(e){return i.find(function(t){return t.id===e.id})}).filter(function(e){return e});if(0===a.length)return{visual:t,bounds:n};var s=o.rect.element.width,u=gn(o,a,r.dragCoordinates),l=a[0].rect.element,c=l.marginTop+l.marginBottom,f=l.marginLeft+l.marginRight,d=l.width+f,p=l.height+c,E=void 0!==u&&u>=0?1:0,_=a.find(function(e){return e.markedForRemoval&&e.opacity<.45})?-1:0,T=a.length+E+_,I=hn(s,d);return 1===I?a.forEach(function(e){var r=e.rect.element.height+c;n+=r,t+=r*e.opacity}):(n=Math.ceil(T/I)*p,t=n),{visual:t,bounds:n}},Hr=function(e){var t=e.ref.measureHeight||null;return{cappedHeight:parseInt(e.style.maxHeight,10)||null,fixedHeight:0===t?null:t}},Xr=function(e,t){var n=e.query("GET_ALLOW_REPLACE"),r=e.query("GET_ALLOW_MULTIPLE"),o=e.query("GET_TOTAL_ITEMS"),i=e.query("GET_MAX_FILES"),a=t.length;return!r&&a>1?(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:ot("warning",0,"Max files")}),!0):!(!r&&n)&&(!!(V(i=r?i:1)&&o+a>i)&&(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:ot("warning",0,"Max files")}),!0))},Wr=function(e,t,n){var r=e.childViews[0];return gn(r,t,{left:n.scopeLeft-r.rect.element.left,top:n.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},zr=function(e){var t=e.query("GET_ALLOW_DROP"),n=e.query("GET_DISABLED"),r=t&&!n;if(r&&!e.ref.hopper){var o=Sr(e.element,function(t){var n=e.query("GET_BEFORE_DROP_FILE")||function(){return!0};return!e.query("GET_DROP_VALIDATION")||t.every(function(t){return ye("ALLOW_HOPPER_ITEM",t,{query:e.query}).every(function(e){return!0===e})&&n(t)})},{filterItems:function(t){var n=e.query("GET_IGNORED_FILES");return t.filter(function(e){return!ht(e)||!n.includes(e.name.toLowerCase())})},catchesDropsOnPage:e.query("GET_DROP_ON_PAGE"),requiresDropOnElement:e.query("GET_DROP_ON_ELEMENT")});o.onload=function(t,n){var r=e.ref.list.childViews[0].childViews.filter(function(e){return e.rect.element.height}),o=e.query("GET_ACTIVE_ITEMS").map(function(e){return r.find(function(t){return t.id===e.id})}).filter(function(e){return e});Oe("ADD_ITEMS",t,{dispatch:e.dispatch}).then(function(t){if(Xr(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:Wr(e.ref.list,o,n),interactionMethod:ee})}),e.dispatch("DID_DROP",{position:n}),e.dispatch("DID_END_DRAG",{position:n})},o.ondragstart=function(t){e.dispatch("DID_START_DRAG",{position:t})},o.ondrag=xr(function(t){e.dispatch("DID_DRAG",{position:t})}),o.ondragend=function(t){e.dispatch("DID_END_DRAG",{position:t})},e.ref.hopper=o,e.ref.drip=e.appendChildView(e.createChildView(Hn))}else!r&&e.ref.hopper&&(e.ref.hopper.destroy(),e.ref.hopper=null,e.removeChildView(e.ref.drip))},Qr=function(e,t){var n=e.query("GET_ALLOW_BROWSE"),r=e.query("GET_DISABLED"),o=n&&!r;o&&!e.ref.browser?e.ref.browser=e.appendChildView(e.createChildView(Fn,Object.assign({},t,{onload:function(t){Oe("ADD_ITEMS",t,{dispatch:e.dispatch}).then(function(t){if(Xr(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:te})})}})),0):!o&&e.ref.browser&&(e.removeChildView(e.ref.browser),e.ref.browser=null)},Zr=function(e){var t=e.query("GET_ALLOW_PASTE"),n=e.query("GET_DISABLED"),r=t&&!n;r&&!e.ref.paster?(e.ref.paster=Pr(),e.ref.paster.onload=function(t){Oe("ADD_ITEMS",t,{dispatch:e.dispatch}).then(function(t){if(Xr(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:ne})})}):!r&&e.ref.paster&&(e.ref.paster.destroy(),e.ref.paster=null)},Kr=A({DID_SET_ALLOW_BROWSE:function(e){var t=e.root,n=e.props;Qr(t,n)},DID_SET_ALLOW_DROP:function(e){var t=e.root;zr(t)},DID_SET_ALLOW_PASTE:function(e){var t=e.root;Zr(t)},DID_SET_DISABLED:function(e){var t=e.root,n=e.props;zr(t),Zr(t),Qr(t,n),t.query("GET_DISABLED")?t.element.dataset.disabled="disabled":t.element.removeAttribute("data-disabled")}}),$r=S({name:"root",read:function(e){var t=e.root;t.ref.measure&&(t.ref.measureHeight=t.ref.measure.offsetHeight)},create:function(e){var t=e.root,n=e.props,r=t.query("GET_ID");r&&(t.element.id=r);var o=t.query("GET_CLASS_NAME");o&&o.split(" ").filter(function(e){return e.length}).forEach(function(e){t.element.classList.add(e)}),t.ref.label=t.appendChildView(t.createChildView(Yn,Object.assign({},n,{translateY:null,caption:t.query("GET_LABEL_IDLE")}))),t.ref.list=t.appendChildView(t.createChildView(bn,{translateY:null})),t.ref.panel=t.appendChildView(t.createChildView(En,{name:"panel-root"})),t.ref.assistant=t.appendChildView(t.createChildView(qr,Object.assign({},n))),t.ref.data=t.appendChildView(t.createChildView(Kn,Object.assign({},n))),t.ref.measure=Ct("div"),t.ref.measure.style.height="100%",t.element.appendChild(t.ref.measure),t.ref.bounds=null,t.query("GET_STYLES").filter(function(e){return!M(e.value)}).map(function(e){var n=e.name,r=e.value;t.element.dataset[n]=r}),t.ref.widthPrevious=null,t.ref.widthUpdated=xr(function(){t.ref.updateHistory=[],t.dispatch("DID_RESIZE_ROOT")},250),t.ref.previousAspectRatio=null,t.ref.updateHistory=[];var i=window.matchMedia("(pointer: fine) and (hover: hover)").matches,a="PointerEvent"in window;t.query("GET_ALLOW_REORDER")&&a&&!i&&(t.element.addEventListener("touchmove",Yr,{passive:!1}),t.element.addEventListener("gesturestart",Yr));var s=t.query("GET_CREDITS");if(2===s.length){var u=document.createElement("a");u.className="filepond--credits",u.href=s[0],u.tabIndex=-1,u.target="_blank",u.rel="noopener noreferrer nofollow",u.textContent=s[1],t.element.appendChild(u),t.ref.credits=u}},write:function(e){var t=e.root,n=e.props,r=e.actions;if(Kr({root:t,props:n,actions:r}),r.filter(function(e){return/^DID_SET_STYLE_/.test(e.type)}).filter(function(e){return!M(e.data.value)}).map(function(e){var n=e.type,r=e.data,o=Vr(n.substring(8).toLowerCase(),"_");t.element.dataset[o]=r.value,t.invalidateLayout()}),!t.rect.element.hidden){t.rect.element.width!==t.ref.widthPrevious&&(t.ref.widthPrevious=t.rect.element.width,t.ref.widthUpdated());var o=t.ref.bounds;o||(o=t.ref.bounds=Hr(t),t.element.removeChild(t.ref.measure),t.ref.measure=null);var i=t.ref,a=i.hopper,s=i.label,u=i.list,l=i.panel;a&&a.updateHopperState();var c=t.query("GET_PANEL_ASPECT_RATIO"),f=t.query("GET_ALLOW_MULTIPLE"),d=t.query("GET_TOTAL_ITEMS"),p=d===(f?t.query("GET_MAX_FILES")||1e6:1),E=r.find(function(e){return"DID_ADD_ITEM"===e.type});if(p&&E){var _=E.data.interactionMethod;s.opacity=0,f?s.translateY=-40:_===J?s.translateX=40:s.translateY=_===te?40:30}else p||(s.opacity=1,s.translateX=0,s.translateY=0);var T=kr(t),I=jr(t),v=s.rect.element.height,m=!f||p?0:v,h=p?u.rect.element.marginTop:0,g=0===d?0:u.rect.element.marginBottom,R=m+h+I.visual+g,O=m+h+I.bounds+g;if(u.translateY=Math.max(0,m-u.rect.element.marginTop)-T.top,c){var y=t.rect.element.width,D=y*c;c!==t.ref.previousAspectRatio&&(t.ref.previousAspectRatio=c,t.ref.updateHistory=[]);var S=t.ref.updateHistory;if(S.push(y),S.length>4)for(var A=S.length,L=A-10,b=0,P=A;P>=L;P--)if(S[P]===S[P-2]&&b++,b>=2)return;l.scalable=!1,l.height=D;var w=D-m-(g-T.bottom)-(p?h:0);I.visual>w?u.overflow=w:u.overflow=null,t.height=D}else if(o.fixedHeight){l.scalable=!1;var C=o.fixedHeight-m-(g-T.bottom)-(p?h:0);I.visual>C?u.overflow=C:u.overflow=null}else if(o.cappedHeight){var N=R>=o.cappedHeight,G=Math.min(o.cappedHeight,R);l.scalable=!0,l.height=N?G:G-T.top-T.bottom;var U=G-m-(g-T.bottom)-(p?h:0);R>o.cappedHeight&&I.visual>U?u.overflow=U:u.overflow=null,t.height=Math.min(o.cappedHeight,O-T.top-T.bottom)}else{var B=d>0?T.top+T.bottom:0;l.scalable=!0,l.height=Math.max(v,R-B),t.height=Math.max(v,O-B)}t.ref.credits&&l.heightCurrent&&(t.ref.credits.style.transform="translateY("+l.heightCurrent+"px)")}},destroy:function(e){var t=e.root;t.ref.paster&&t.ref.paster.destroy(),t.ref.hopper&&t.ref.hopper.destroy(),t.element.removeEventListener("touchmove",Yr),t.element.removeEventListener("gesturestart",Yr)},mixins:{styles:["height"]}}),Jr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=null,o=Se(),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=Object.assign({},e),o=[],i=[],a=function(e,t,n){!n||document.hidden?(c[e]&&c[e](t),o.push({type:e,data:t})):i.push({type:e,data:t})},s=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return l[e]?(t=l)[e].apply(t,r):null},u={getState:function(){return Object.assign({},r)},processActionQueue:function(){var e=[].concat(o);return o.length=0,e},processDispatchQueue:function(){var e=[].concat(i);i.length=0,e.forEach(function(e){var t=e.type,n=e.data;a(t,n)})},dispatch:a,query:s},l={};t.forEach(function(e){l=Object.assign({},e(r),{},l)});var c={};return n.forEach(function(e){c=Object.assign({},e(a,s,r),{},c)}),u}({items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:Q(o)},[Ve,$(o)],[Pt,K(o)]);i.dispatch("SET_OPTIONS",{options:e});var a=function(){document.hidden||i.dispatch("KICK")};document.addEventListener("visibilitychange",a);var s=null,u=!1,l=!1,c=null,f=null,d=function(){u||(u=!0),clearTimeout(s),s=setTimeout(function(){u=!1,c=null,f=null,l&&(l=!1,i.dispatch("DID_STOP_RESIZE"))},500)};window.addEventListener("resize",d);var p=$r(i,{id:oe()}),E=!1,T=!1,I={_read:function(){u&&(f=window.innerWidth,c||(c=f),l||f===c||(i.dispatch("DID_START_RESIZE"),l=!0)),T&&E&&(E=null===p.element.offsetParent),E||(p._read(),T=p.rect.element.hidden)},_write:function(e){var t,n=i.processActionQueue().filter(function(e){return!/^SET_/.test(e.type)});E&&!n.length||(g(n),E=p._write(e,n,l),(t=i.query("GET_ITEMS")).forEach(function(e,n){e.released&&de(t,n)}),E&&i.processDispatchQueue())}},v=function(e){return function(t){var n={type:e};if(!t)return n;if(t.hasOwnProperty("error")&&(n.error=t.error?Object.assign({},t.error):null),t.status&&(n.status=Object.assign({},t.status)),t.file&&(n.output=t.file),t.source)n.file=t.source;else if(t.item||t.id){var r=t.item?t.item:i.query("GET_ITEM",t.id);n.file=r?Te(r):null}return t.items&&(n.items=t.items.map(Te)),/progress/.test(e)&&(n.progress=t.progress),t.hasOwnProperty("origin")&&t.hasOwnProperty("target")&&(n.origin=t.origin,n.target=t.target),n}},m={DID_DESTROY:v("destroy"),DID_INIT:v("init"),DID_THROW_MAX_FILES:v("warning"),DID_INIT_ITEM:v("initfile"),DID_START_ITEM_LOAD:v("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:v("addfileprogress"),DID_LOAD_ITEM:v("addfile"),DID_THROW_ITEM_INVALID:[v("error"),v("addfile")],DID_THROW_ITEM_LOAD_ERROR:[v("error"),v("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[v("error"),v("removefile")],DID_PREPARE_OUTPUT:v("preparefile"),DID_START_ITEM_PROCESSING:v("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:v("processfileprogress"),DID_ABORT_ITEM_PROCESSING:v("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:v("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:v("processfiles"),DID_REVERT_ITEM_PROCESSING:v("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[v("error"),v("processfile")],DID_REMOVE_ITEM:v("removefile"),DID_UPDATE_ITEMS:v("updatefiles"),DID_ACTIVATE_ITEM:v("activatefile"),DID_REORDER_ITEMS:v("reorderfiles")},h=function(e){var t=Object.assign({pond:A},e);delete t.type,p.element.dispatchEvent(new CustomEvent("FilePond:"+e.type,{detail:t,bubbles:!0,cancelable:!0,composed:!0}));var n=[];e.hasOwnProperty("error")&&n.push(e.error),e.hasOwnProperty("file")&&n.push(e.file);var r=["type","error","file"];Object.keys(e).filter(function(e){return!r.includes(e)}).forEach(function(t){return n.push(e[t])}),A.fire.apply(A,[e.type].concat(n));var o=i.query("GET_ON"+e.type.toUpperCase());o&&o.apply(void 0,n)},g=function(e){e.length&&e.filter(function(e){return m[e.type]}).forEach(function(e){var t=m[e.type];(Array.isArray(t)?t:[t]).forEach(function(t){"DID_INIT_ITEM"===e.type?h(t(e.data)):setTimeout(function(){h(t(e.data))},0)})})},R=function(e){return new Promise(function(t,n){i.dispatch("REQUEST_ITEM_PREPARE",{query:e,success:function(e){t(e)},failure:function(e){n(e)}})})},O=function(e,t){var n;return"object"!=typeof e||(n=e).file&&n.id||t||(t=e,e=void 0),i.dispatch("REMOVE_ITEM",Object.assign({},t,{query:e})),null===i.query("GET_ACTIVE_ITEM",e)},y=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Promise(function(e,n){var r=[],o={};if(P(t[0]))r.push.apply(r,t[0]),Object.assign(o,t[1]||{});else{var a=t[t.length-1];"object"!=typeof a||a instanceof Blob||Object.assign(o,t.pop()),r.push.apply(r,t)}i.dispatch("ADD_ITEMS",{items:r,index:o.index,interactionMethod:J,success:e,failure:n})})},D=function(){return i.query("GET_ACTIVE_ITEMS")},S=function(e){return new Promise(function(t,n){i.dispatch("REQUEST_ITEM_PROCESSING",{query:e,success:function(e){t(e)},failure:function(e){n(e)}})})},A=Object.assign({},pe(),{},I,{},function(e,n){var r={};return t(n,function(t){r[t]={get:function(){return e.getState().options[t]},set:function(n){e.dispatch("SET_"+Z(t,"_").toUpperCase(),{value:n})}}}),r}(i,o),{setOptions:function(e){return i.dispatch("SET_OPTIONS",{options:e})},addFile:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(n,r){y([{source:e,options:t}],{index:t.index}).then(function(e){return n(e&&e[0])}).catch(r)})},addFiles:y,getFile:function(e){return i.query("GET_ACTIVE_ITEM",e)},processFile:S,prepareFile:R,removeFile:O,moveFile:function(e,t){return i.dispatch("MOVE_ITEM",{query:e,index:t})},getFiles:D,processFiles:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array.isArray(t[0])?t[0]:t;if(!r.length){var o=D().filter(function(e){return!(e.status===Ie.IDLE&&e.origin===ve.LOCAL)&&e.status!==Ie.PROCESSING&&e.status!==Ie.PROCESSING_COMPLETE&&e.status!==Ie.PROCESSING_REVERT_ERROR});return Promise.all(o.map(S))}return Promise.all(r.map(S))},removeFiles:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=Array.isArray(t[0])?t[0]:t;"object"==typeof o[o.length-1]?r=o.pop():Array.isArray(t[0])&&(r=t[1]);var i=D();return o.length?o.map(function(e){return _(e)?i[e]?i[e].id:null:e}).filter(function(e){return e}).map(function(e){return O(e,r)}):Promise.all(i.map(function(e){return O(e,r)}))},prepareFiles:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array.isArray(t[0])?t[0]:t,o=r.length?r:D();return Promise.all(o.map(R))},sort:function(e){return i.dispatch("SORT",{compare:e})},browse:function(){var e=p.element.querySelector("input[type=file]");e&&e.click()},destroy:function(){A.fire("destroy",p.element),i.dispatch("ABORT_ALL"),p._destroy(),window.removeEventListener("resize",d),document.removeEventListener("visibilitychange",a),i.dispatch("DID_DESTROY")},insertBefore:function(e){return L(p.element,e)},insertAfter:function(e){return b(p.element,e)},appendTo:function(e){return e.appendChild(p.element)},replaceElement:function(e){L(p.element,e),e.parentNode.removeChild(e),r=e},restoreElement:function(){r&&(b(r,p.element),p.element.parentNode.removeChild(p.element),r=null)},isAttachedTo:function(e){return p.element===e||r===e},element:{get:function(){return p.element}},status:{get:function(){return i.query("GET_STATUS")}}});return i.dispatch("DID_INIT"),n(A)},eo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={};return t(Se(),function(e,t){n[e]=t[0]}),Jr(Object.assign({},n,{},e))},to=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=[];t(e.attributes,function(t){o.push(e.attributes[t])});var i=o.filter(function(e){return e.name}).reduce(function(t,n){var o,i=r(e,n.name);return t[(o=n.name,Vr(o.replace(/^data-/,"")))]=i===n.name||i,t},{});return function e(n,r){t(r,function(r,o){t(n,function(e,t){var i=new RegExp(r);if(i.test(e)&&(delete n[e],!1!==o))if(U(o))n[o]=t;else{var a,s=o.group;H(o)&&!n[s]&&(n[s]={}),n[s][(a=e.replace(i,""),a.charAt(0).toLowerCase()+a.slice(1))]=t}}),o.mapping&&e(n[o.group],o.mapping)})}(i,n),i},no=function(){return(arguments.length<=0?void 0:arguments[0])instanceof HTMLElement?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^webkitdirectory$":"allowDirectoriesOnly","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":!1,"^files$":!1};ye("SET_ATTRIBUTE_TO_OPTION_MAP",n);var r=Object.assign({},t),o=to("FIELDSET"===e.nodeName?e.querySelector("input[type=file]"):e,n);Object.keys(o).forEach(function(e){H(o[e])?(H(r[e])||(r[e]={}),Object.assign(r[e],o[e])):r[e]=o[e]}),r.files=(t.files||[]).concat(Array.from(e.querySelectorAll("input:not([type=file])")).map(function(e){return{source:e.value,options:{type:e.dataset.type}}}));var i=eo(r);return e.files&&Array.from(e.files).forEach(function(e){i.addFile(e)}),i.replaceElement(e),i}.apply(void 0,arguments):eo.apply(void 0,arguments)},ro=["fire","_read","_write"],oo=function(e){var t={};return Ee(e,t,ro),t},io=function(e,t){return e.replace(/(?:{([a-zA-Z]+)})/g,function(e,n){return t[n]})},ao=function(e){var t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),n=URL.createObjectURL(t),r=new Worker(n);return{transfer:function(e,t){},post:function(e,t,n){var o=oe();r.onmessage=function(e){e.data.id===o&&t(e.data.message)},r.postMessage({id:o,message:e},n)},terminate:function(){r.terminate(),URL.revokeObjectURL(n)}}},so=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e})},uo=function(e,t){var n=e.slice(0,e.size,e.type);return n.lastModifiedDate=e.lastModifiedDate,n.name=t,n},lo=function(e){return uo(e,e.name)},co=[],fo=function(e){if(!co.includes(e)){co.push(e);var n,r=e({addFilter:De,utils:{Type:ge,forin:t,isString:U,isFile:ht,toNaturalFileSize:qt,replaceInString:io,getExtensionFromFilename:je,getFilenameWithoutExtension:mt,guesstimateMimeType:tr,getFileFromBlob:We,getFilenameFromURL:ke,createRoute:A,createWorker:ao,createView:S,createItemAPI:Te,loadImage:so,copyFile:lo,renameFile:uo,createBlob:ze,applyFilterChain:Oe,text:Nt,getNumericAspectRatioFromString:be},views:{fileActionButton:Ft}});n=r.options,Object.assign(Ae,n)}},po=(Kt=c()&&!("[object OperaMini]"===Object.prototype.toString.call(window.operamini))&&"visibilityState"in document&&"Promise"in window&&"slice"in Blob.prototype&&"URL"in window&&"createObjectURL"in window.URL&&"performance"in window&&("supports"in(window.CSS||{})||/MSIE|Trident/.test(window.navigator.userAgent)),function(){return Kt}),Eo={apps:[]},_o=function(){};if(e.Status={},e.FileStatus={},e.FileOrigin={},e.OptionTypes={},e.create=_o,e.destroy=_o,e.parse=_o,e.find=_o,e.registerPlugin=_o,e.getOptions=_o,e.setOptions=_o,po()){!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,r="__framePainter";if(window[r])return window[r].readers.push(e),void window[r].writers.push(t);window[r]={readers:[e],writers:[t]};var o=window[r],i=1e3/n,a=null,s=null,u=null,l=null,c=function(){document.hidden?(u=function(){return window.setTimeout(function(){return f(performance.now())},i)},l=function(){return window.clearTimeout(s)}):(u=function(){return window.requestAnimationFrame(f)},l=function(){return window.cancelAnimationFrame(s)})};document.addEventListener("visibilitychange",function(){l&&l(),c(),f(performance.now())});var f=function e(t){s=u(e),a||(a=t);var n=t-a;n<=i||(a=t-n%i,o.readers.forEach(function(e){return e()}),o.writers.forEach(function(e){return e(t)}))};c(),f(performance.now())}(function(){Eo.apps.forEach(function(e){return e._read()})},function(e){Eo.apps.forEach(function(t){return t._write(e)})});var To=function t(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:po,create:e.create,destroy:e.destroy,parse:e.parse,find:e.find,registerPlugin:e.registerPlugin,setOptions:e.setOptions}})),document.removeEventListener("DOMContentLoaded",t)};"loading"!==document.readyState?setTimeout(function(){return To()},0):document.addEventListener("DOMContentLoaded",To);var Io=function(){return t(Se(),function(t,n){e.OptionTypes[t]=n[1]})};e.Status=Object.assign({},Me),e.FileOrigin=Object.assign({},ve),e.FileStatus=Object.assign({},Ie),e.OptionTypes={},Io(),e.create=function(){var t=no.apply(void 0,arguments);return t.on("destroy",e.destroy),Eo.apps.push(t),oo(t)},e.destroy=function(e){var t=Eo.apps.findIndex(function(t){return t.isAttachedTo(e)});return t>=0&&(Eo.apps.splice(t,1)[0].restoreElement(),!0)},e.parse=function(t){return Array.from(t.querySelectorAll(".filepond")).filter(function(e){return!Eo.apps.find(function(t){return t.isAttachedTo(e)})}).map(function(t){return e.create(t)})},e.find=function(e){var t=Eo.apps.find(function(t){return t.isAttachedTo(e)});return t?oo(t):null},e.registerPlugin=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach(fo),Io()},e.getOptions=function(){var e={};return t(Se(),function(t,n){e[t]=n[0]}),e},e.setOptions=function(n){return H(n)&&(Eo.apps.forEach(function(e){e.setOptions(n)}),function(e){t(e,function(e,t){Ae[e]&&(Ae[e][0]=z(t,Ae[e][0],Ae[e][1]))})}(n)),e.getOptions()}}e.supported=po,Object.defineProperty(e,"__esModule",{value:!0})});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* fileuploader
|
3
|
+
* Copyright (c) 2023 Innostudio.de
|
4
|
+
* Website: https://innostudio.de/fileuploader/
|
5
|
+
* Version: 2.2 (03-Sep-2023)
|
6
|
+
* License: https://innostudio.de/fileuploader/documentation/#license
|
7
|
+
*/!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function($){"use strict";$.fn.fileuploader=function(q){return this.each(function(t,r){var s=$(r),p=null,o=null,l=null,sl=[],n=$.extend(!0,{},$.fn.fileuploader.defaults,q),f={init:function(){return s.closest(".fileuploader").length||s.wrap('<div class="fileuploader"></div>'),p=s.closest(".fileuploader"),f.set("language"),f.set("attrOpts"),f.isSupported()?(!n.beforeRender||!$.isFunction(n.beforeRender)||!1!==n.beforeRender(p,s))&&(f.redesign(),n.files&&f.files.append(n.files),f.rendered=!0,n.afterRender&&$.isFunction(n.afterRender)&&n.afterRender(l,p,o,s),f.disabled||f.bindUnbindEvents(!0),s.closest("form").on("reset",f.reset),void(f._itFl.length||f.reset())):(n.onSupportError&&$.isFunction(n.onSupportError)&&n.onSupportError(p,s),!1)},bindUnbindEvents:function(e){e&&f.bindUnbindEvents(!1),s[e?"on":"off"]("focus blur change",f.onEvent),n.changeInput&&o!==s&&o[e?"on":"off"]("click",f.clickHandler),n.dragDrop&&n.dragDrop.container.length&&(n.dragDrop.container[e?"on":"off"]("drag dragstart dragend dragover dragenter dragleave drop",function(e){e.preventDefault()}),n.dragDrop.container[e?"on":"off"]("drop",f.dragDrop.onDrop),n.dragDrop.container[e?"on":"off"]("dragover",f.dragDrop.onDragEnter),n.dragDrop.container[e?"on":"off"]("dragleave",f.dragDrop.onDragLeave)),f.isUploadMode()&&n.clipboardPaste&&$(window)[e?"on":"off"]("paste",f.clipboard.paste),n.sorter&&n.thumbnails&&n.thumbnails._selectors.sorter&&f.sorter[e?"init":"destroy"]()},redesign:function(){if(o=s,n.theme&&p.addClass("fileuploader-theme-"+n.theme),n.changeInput){switch((typeof n.changeInput).toLowerCase()){case"boolean":o=$('<div class="fileuploader-input"><div class="fileuploader-input-caption"><span>'+f._assets.textParse(n.captions.feedback)+'</span></div><button type="button" class="fileuploader-input-button"><span>'+f._assets.textParse(n.captions.button)+"</span></button></div>");break;case"string":" "!=n.changeInput&&(o=$(f._assets.textParse(n.changeInput,n)));break;case"object":o=$(n.changeInput);break;case"function":o=$(n.changeInput(s,p,n,f._assets.textParse))}s.after(o),s.css({position:"absolute","z-index":"-9999",height:"0",width:"0",padding:"0",margin:"0","line-height":"0",outline:"0",border:"0",opacity:"0"})}n.thumbnails&&f.thumbnails.create(),n.dragDrop&&(n.dragDrop="object"!=typeof n.dragDrop?{container:null}:n.dragDrop,n.dragDrop.container=n.dragDrop.container?$(n.dragDrop.container):o)},clickHandler:function(e){e.preventDefault(),f.clipboard._timer?f.clipboard.clean():s.click()},onEvent:function(e){switch(e.type){case"focus":p&&p.addClass("fileuploader-focused");break;case"blur":p&&p.removeClass("fileuploader-focused");break;case"change":f.onChange.call(this)}n.listeners&&$.isFunction(n.listeners[e.type])&&n.listeners[e.type].call(s,p)},set:function(e,t){switch(e){case"attrOpts":for(var i=["limit","maxSize","fileMaxSize","extensions","changeInput","theme","addMore","listInput","files"],r=0;r<i.length;r++){var a="data-fileuploader-"+i[r];if(f._assets.hasAttr(a))switch(i[r]){case"changeInput":case"addMore":case"listInput":n[i[r]]=-1<["true","false"].indexOf(s.attr(a))?"true"==s.attr(a):s.attr(a);break;case"extensions":n[i[r]]=s.attr(a).replace(/ /g,"").split(",");break;case"files":n[i[r]]=JSON.parse(s.attr(a));break;default:n[i[r]]=s.attr(a)}s.removeAttr(a)}null==s.attr("disabled")&&null==s.attr("readonly")&&0!==n.limit||(f.disabled=!0),(!n.limit||n.limit&&2<=n.limit)&&(s.attr("multiple","multiple"),n.inputNameBrackets&&"[]"!=s.attr("name").slice(-2)&&s.attr("name",s.attr("name")+"[]")),!0===n.listInput&&(n.listInput=$('<input type="hidden" name="fileuploader-list-'+s.attr("name").replace("[]","").split("[").pop().replace("]","")+'">').insertBefore(s)),"string"==typeof n.listInput&&0==$(n.listInput).length&&(n.listInput=$('<input type="hidden" name="'+n.listInput+'">').insertBefore(s)),f.set("disabled",f.disabled),!n.fileMaxSize&&n.maxSize&&(n.fileMaxSize=n.maxSize);break;case"language":var l=$.fn.fileuploader.languages;"string"==typeof n.captions&&(n.captions in l?n.captions=l[n.captions]:n.captions=$.extend(!0,{},$.fn.fileuploader.defaults.captions));break;case"disabled":f.disabled=t,p[f.disabled?"addClass":"removeClass"]("fileuploader-disabled"),s[f.disabled?"attr":"removeAttr"]("disabled","disabled"),f.rendered&&f.bindUnbindEvents(!t);break;case"feedback":t=t||f._assets.textParse(0<f._itFl.length?n.captions.feedback2:n.captions.feedback,{length:f._itFl.length}),$(!o.is(":file"))&&o.find(".fileuploader-input-caption span").html(t);break;case"input":var d=f._assets.copyAllAttributes($('<input type="file">'),s,!0);f.bindUnbindEvents(!1),s.after(s=d).remove(),f.bindUnbindEvents(!0);break;case"prevInput":0<sl.length&&(f.bindUnbindEvents(!1),sl[t].remove(),sl.splice(t,1),s=sl[sl.length-1],f.bindUnbindEvents(!0));break;case"nextInput":d=f._assets.copyAllAttributes($('<input type="file">'),s);f.bindUnbindEvents(!1),0<sl.length&&0==sl[sl.length-1].get(0).files.length?s=sl[sl.length-1]:(-1==sl.indexOf(s)&&sl.push(s),sl.push(d),s.after(s=d)),f.bindUnbindEvents(!0);break;case"listInput":n.listInput&&n.listInput.val(f.files.list(!0,null,!1,t))}},onChange:function(e,t){var i=s.get(0).files;if(t){if(!t.length)return f.set("input",""),f.files.clear(),!1;i=t}if(f.clipboard._timer&&f.clipboard.clean(),!f.isDefaultMode()||(f.reset(),0!=i.length)){if(n.beforeSelect&&$.isFunction(n.beforeSelect)&&0==n.beforeSelect(i,l,p,o,s))return!1;for(var r=0,a=0;a<i.length;a++){var d=i[a],u=f._itFl[f.files.add(d,"choosed")],d=f.files.check(u,i,0==a);if(!0===d)n.thumbnails&&f.thumbnails.item(u),f.isUploadMode()&&f.upload.prepare(u),n.onSelect&&$.isFunction(n.onSelect)&&n.onSelect(u,l,p,o,s),r++;else if(f.files.remove(u,!0),d[2]||(f.isDefaultMode()&&(f.set("input",""),f.reset(),d[3]=!0),d[1]&&f._assets.dialogs.alert(d[1],u,l,p,o,s)),d[3])break}f.isUploadMode()&&0<r&&f.set("input",""),f.set("feedback",null),f.isAddMoreMode()&&0<r&&f.set("nextInput"),f.set("listInput",null),n.afterSelect&&$.isFunction(n.afterSelect)&&n.afterSelect(l,p,o,s)}},thumbnails:{create:function(){null!=n.thumbnails.beforeShow&&$.isFunction(n.thumbnails.beforeShow)&&n.thumbnails.beforeShow(p,o,s);var e=$(f._assets.textParse(n.thumbnails.box)).appendTo(n.thumbnails.boxAppendTo||p);l=e.is(n.thumbnails._selectors.list)?e:e.find(n.thumbnails._selectors.list),n.thumbnails._selectors.popup_open&&l.on("click",n.thumbnails._selectors.popup_open,function(e){e.preventDefault();e=$(this).closest(n.thumbnails._selectors.item),e=f.files.find(e);e&&e.popup&&e.html.hasClass("file-has-popup")&&f.thumbnails.popup(e)}),f.isUploadMode()&&n.thumbnails._selectors.start&&l.on("click",n.thumbnails._selectors.start,function(e){if(e.preventDefault(),f.locked)return!1;e=$(this).closest(n.thumbnails._selectors.item),e=f.files.find(e);e&&f.upload.send(e,!0)}),f.isUploadMode()&&n.thumbnails._selectors.retry&&l.on("click",n.thumbnails._selectors.retry,function(e){if(e.preventDefault(),f.locked)return!1;e=$(this).closest(n.thumbnails._selectors.item),e=f.files.find(e);e&&f.upload.retry(e)}),n.thumbnails._selectors.rotate&&l.on("click",n.thumbnails._selectors.rotate,function(e){if(e.preventDefault(),f.locked)return!1;e=$(this).closest(n.thumbnails._selectors.item),e=f.files.find(e);e&&e.editor&&(e.editor.rotate(),e.editor.save())}),n.thumbnails._selectors.remove&&l.on("click",n.thumbnails._selectors.remove,function(e){if(e.preventDefault(),f.locked)return!1;var e=$(this).closest(n.thumbnails._selectors.item),t=f.files.find(e),e=function(e){f.files.remove(t)};t&&(t.upload&&"successful"!=t.upload.status?f.upload.cancel(t):n.thumbnails.removeConfirmation&&!t.choosed?f._assets.dialogs.confirm(f._assets.textParse(n.captions.removeConfirmation,t),e):e())})},clear:function(){l&&l.html("")},item:function(t,e){t.icon=f.thumbnails.generateFileIcon(t.format,t.extension),t.image='<div class="fileuploader-item-image"></div>',t.progressBar=f.isUploadMode()?'<div class="fileuploader-progressbar"><div class="bar"></div></div>':"",t.html=$(f._assets.textParse(t.appended&&n.thumbnails.item2?n.thumbnails.item2:n.thumbnails.item,t)),t.progressBar=t.html.find(".fileuploader-progressbar"),t.html.addClass("file-type-"+(t.format||"no")+" file-ext-"+(t.extension||"no")),e?e.replaceWith(t.html):t.html[n.thumbnails.itemPrepend?"prependTo":"appendTo"](l),n.thumbnails.popup&&!1!==t.data.popup&&(t.html.addClass("file-has-popup"),t.popup={open:function(){f.thumbnails.popup(t)}}),f.thumbnails.renderThumbnail(t),t.renderThumbnail=function(e){e&&t.popup&&t.popup.close&&(t.popup.close(),t.popup={open:t.popup.open}),f.thumbnails.renderThumbnail(t,!0,e)},null!=n.thumbnails.onItemShow&&$.isFunction(n.thumbnails.onItemShow)&&n.thumbnails.onItemShow(t,l,p,o,s)},generateFileIcon:function(e,t){var o='<div style="${style}" class="fileuploader-item-icon${class}"><i>'+(t||"")+"</i></div>",t=f._assets.textToColor(t);return t&&(f._assets.isBrightColor(t)&&(o=o.replace("${class}"," is-bright-color")),o=o.replace("${style}","background-color: "+t)),o.replace("${style}","").replace("${class}","")},renderThumbnail:function(d,e,t){function u(e){e=$(e),h.removeClass("fileuploader-no-thumbnail fileuploader-loading").html(e),d.html.hasClass("file-will-popup")&&d.html.removeClass("file-will-popup").addClass("file-has-popup"),e.is("img")&&e.attr("draggable","false").on("load error",function(e){"error"==e.type&&m()}),null!=n.thumbnails.onImageLoaded&&$.isFunction(n.thumbnails.onImageLoaded)&&n.thumbnails.onImageLoaded(d,l,p,o,s)}function c(){var e=0;if(d&&-1<f._pfrL.indexOf(d))for(f._pfrL.splice(f._pfrL.indexOf(d),1);e<f._pfrL.length;){if(-1<f._itFl.indexOf(f._pfrL[e])){setTimeout(function(){f.thumbnails.renderThumbnail(f._pfrL[e],!0)},"image"==d.format&&1.8<d.size/1e6?200:0);break}f._pfrL.splice(e,1),e++}}var h=d.html.find(".fileuploader-item-image"),i=d.data&&(d.data.readerSkip||!1===d.data.thumbnail),m=function(){h.addClass("fileuploader-no-thumbnail"),h.removeClass("fileuploader-loading").html(d.icon),d.html.hasClass("file-will-popup")&&d.html.removeClass("file-will-popup").addClass("file-has-popup"),null!=n.thumbnails.onImageLoaded&&$.isFunction(n.thumbnails.onImageLoaded)&&n.thumbnails.onImageLoaded(d,l,p,o,s)};if(h.length){if(d.image=h.html("").addClass("fileuploader-loading"),(-1<["image","video","audio","astext"].indexOf(d.format)||d.data.thumbnail)&&f.isFileReaderSupported()&&!i&&(d.appended||n.thumbnails.startImageRenderer||e)){if(d.html.hasClass("file-has-popup")&&d.html.removeClass("file-has-popup").addClass("file-will-popup"),n.thumbnails.synchronImages&&(-1!=f._pfrL.indexOf(d)||e||f._pfrL.push(d),1<f._pfrL.length&&!e))return;var r=function(e,t){function o(){var e;n.thumbnails.canvasImage?(e=document.createElement("canvas"),f.editor.resize(this,e,n.thumbnails.canvasImage.width||h.width(),n.thumbnails.canvasImage.height||h.height(),!1,!0),f._assets.isBlankCanvas(e)?m():u(e)):u(this),c()}function i(){l=null,m(),c()}var r=e&&e.nodeName&&"img"==e.nodeName.toLowerCase(),a=r?e.src:e,l=null;return e?t&&"image"==d.format&&d.reader.node?o.call(d.reader.node):r?o.call(e):((l=new Image).onload=o,l.onerror=i,d.data&&d.data.readerCrossOrigin&&l.setAttribute("crossOrigin",d.data.readerCrossOrigin),void(l.src=a)):i()};return"string"==typeof t||"object"==typeof t?r(t):f.files.read(d,function(){r(d.reader.frame||(d.reader.node&&"img"==d.reader.node.nodeName.toLowerCase()?d.reader.src:null),!0)},null,t,!0)}m()}else c()},popup:function(d,r){var a,u,e;!f.locked&&n.thumbnails.popup&&n.thumbnails._selectors.popup&&(a=$(n.thumbnails.popup.container),u=a.find(".fileuploader-popup"),e=function(){function t(e){27==(e=e.which||e.keyCode)&&d.popup&&d.popup.close&&d.popup.close(),37!=e&&39!=e||!n.thumbnails.popup.arrows||d.popup.move(37==e?"prev":"next")}var e=d.popup.html||$(f._assets.textParse(n.thumbnails.popup.template,d)),i=d.popup.html!==e;u.removeClass("loading"),u.children(n.thumbnails._selectors.popup).length&&($.each(f._itFl,function(e,t){t!=d&&t.popup&&t.popup.close&&t.popup.close(r)}),u.find(n.thumbnails._selectors.popup).remove()),e.show().appendTo(u),d.popup.html=e,d.popup.isOpened=!0,d.popup.move=function(e){var t=f._itFl.indexOf(d),o=null,i=!1;if("prev"==(e=n.thumbnails.itemPrepend?"prev"==e?"next":"prev":e))for(var r=t;0<=r;r--){if((a=f._itFl[r])!=d&&a.popup&&a.html.hasClass("file-has-popup")){o=a;break}0!=r||o||i||!n.thumbnails.popup.loop||(r=f._itFl.length,i=!0)}else for(var a,r=t;r<f._itFl.length;r++){if((a=f._itFl[r])!=d&&a.popup&&a.html.hasClass("file-has-popup")){o=a;break}r+1!=f._itFl.length||o||i||!n.thumbnails.popup.loop||(r=-1,i=!0)}o&&f.thumbnails.popup(o,!0)},d.popup.close=function(e){d.popup.node&&d.popup.node.pause&&d.popup.node.pause(),$(window).off("keyup",t),a.css({overflow:"",width:""}),d.popup.editor&&d.popup.editor.cropper&&d.popup.editor.cropper.hide(),d.popup.zoomer&&d.popup.zoomer.hide(),d.popup.isOpened=!1,d.popup.html&&n.thumbnails.popup.onHide&&$.isFunction(n.thumbnails.popup.onHide)?n.thumbnails.popup.onHide(d,l,p,o,s):d.popup.html&&d.popup.html.remove(),e||u.fadeOut(400,function(){u.remove()}),delete d.popup.close},d.popup.node?(i&&e.html(e.html().replace(/\$\{reader\.node\}/,'<div class="reader-node"></div>')).find(".reader-node").html(d.popup.node),d.popup.node.controls=!0,d.popup.node.currentTime=0,d.popup.node.play&&d.popup.node.play()):i&&e.find(".fileuploader-popup-node").html('<div class="reader-node"><div class="fileuploader-popup-file-icon file-type-'+d.format+" file-ext-"+d.extension+'">'+d.icon+"</div></div>"),$(window).on("keyup",t),a.css({overflow:"hidden",width:a.innerWidth()}),d.popup.html.find('[data-action="prev"], [data-action="next"]').removeAttr("style"),d.popup.html[1!=f._itFl.length&&n.thumbnails.popup.arrows?"addClass":"removeClass"]("fileuploader-popup-has-arrows"),n.thumbnails.popup.loop||(0==f._itFl.indexOf(d)&&d.popup.html.find('[data-action="prev"]').hide(),f._itFl.indexOf(d)==f._itFl.length-1&&d.popup.html.find('[data-action="next"]').hide()),i&&d.popup.zoomer&&(d.popup.zoomer=null),f.editor.zoomer(d),d.editor&&(d.popup.editor||(d.popup.editor={}),f.editor.rotate(d,d.editor.rotation||0,!0),d.popup.editor&&d.popup.editor.cropper&&(d.popup.editor.cropper.hide(!0),setTimeout(function(){f.editor.crop(d,d.editor.crop?$.extend({},d.editor.crop):d.popup.editor.cropper.setDefaultData())},100))),d.popup.html.on("click",'[data-action="prev"]',function(e){d.popup.move("prev")}).on("click",'[data-action="next"]',function(e){d.popup.move("next")}).on("click",'[data-action="crop"]',function(e){d.editor&&d.editor.cropper()}).on("click",'[data-action="rotate-cw"]',function(e){d.editor&&d.editor.rotate()}).on("click",'[data-action="zoom-in"]',function(e){d.popup.zoomer&&d.popup.zoomer.zoomIn()}).on("click",'[data-action="zoom-out"]',function(e){d.popup.zoomer&&d.popup.zoomer.zoomOut()}),n.thumbnails.popup.onShow&&$.isFunction(n.thumbnails.popup.onShow)&&n.thumbnails.popup.onShow(d,l,p,o,s)},0==u.length&&(u=$('<div class="fileuploader-popup"></div>').appendTo(a)),u.fadeIn(400).addClass("loading").find(n.thumbnails._selectors.popup).fadeOut(150),(-1<["image","video","audio","astext"].indexOf(d.format)||-1<["application/pdf"].indexOf(d.type))&&!d.popup.html?f.files.read(d,function(){d.reader.node&&(d.popup.node=d.reader.node),"image"==d.format&&d.reader.node?(d.popup.node=d.reader.node.cloneNode(),d.popup.node.complete?e():(d.popup.node.src="",d.popup.node.onload=d.popup.node.onerror=e,d.popup.node.src=d.reader.node.src)):e()}):e())}},editor:{rotate:function(e,t,o){var i,a;if(!(e.popup&&e.popup.html&&$("html").find(e.popup.html).length)){var n=e.editor.rotation||0,r=t||n+90;return 360<=r&&(r=0),e.popup.editor&&(e.popup.editor.rotation=r),e.editor.rotation=r}e.popup.node&&(e.popup.editor.isAnimating||(e.popup.editor.isAnimating=!0,i=e.popup.html.find(".fileuploader-popup-node").find(".reader-node"),a=i.find("> img"),r={rotation:n=e.popup.editor.rotation||0,scale:e.popup.editor.scale||1},e.popup.editor.cropper&&e.popup.editor.cropper.$template.hide(),e.popup.editor.rotation=o?t:n+90,e.popup.editor.scale=(i.height()/a[-1<[90,270].indexOf(e.popup.editor.rotation)?"width":"height"]()).toFixed(3),a.height()*e.popup.editor.scale>i.width()&&-1<[90,270].indexOf(e.popup.editor.rotation)&&(e.popup.editor.scale=i.height()/a.width()),1<e.popup.editor.scale&&(e.popup.editor.scale=1),$(r).stop().animate({rotation:e.popup.editor.rotation,scale:e.popup.editor.scale},{duration:o?2:300,easing:"swing",step:function(e,t){var o=a.css("-webkit-transform")||a.css("-moz-transform")||a.css("transform")||"none",i=0,n=1,r=t.prop;"none"!==o&&(o=(t=o.split("(")[1].split(")")[0].split(","))[0],t=t[1],i="rotation"==r?e:Math.round(Math.atan2(t,o)*(180/Math.PI)),n="scale"==r?e:Math.round(10*Math.sqrt(o*o+t*t))/10),a.css({"-webkit-transform":"rotate("+i+"deg) scale("+n+")","-moz-transform":"rotate("+i+"deg) scale("+n+")",transform:"rotate("+i+"deg) scale("+n+")"})},always:function(){delete e.popup.editor.isAnimating,e.popup.editor.cropper&&!o&&(e.popup.editor.cropper.setDefaultData(),e.popup.editor.cropper.init("rotation"))}}),360<=e.popup.editor.rotation&&(e.popup.editor.rotation=0),e.popup.editor.rotation!=e.editor.rotation&&(e.popup.editor.hasChanges=!0)))},crop:function(m,e){var t,l,o;if(!(m.popup&&m.popup.html&&$("html").find(m.popup.html).length))return m.editor.crop=e||m.editor.crop;m.popup.node&&(m.popup.editor.cropper?(e&&(m.popup.editor.cropper.crop=e),m.popup.editor.cropper.init(e)):(t=m.popup.html.find(".fileuploader-popup-node .reader-node > img"),o=(l=$('<div class="fileuploader-cropper"><div class="fileuploader-cropper-area"><div class="point point-a"></div><div class="point point-b"></div><div class="point point-c"></div><div class="point point-d"></div><div class="point point-e"></div><div class="point point-f"></div><div class="point point-g"></div><div class="point point-h"></div><div class="area-move"></div><div class="area-image"></div><div class="area-info"></div></div></div>')).find(".fileuploader-cropper-area"),m.popup.editor.cropper={$imageEl:t,$template:l,$editor:o,isCropping:!1,crop:e||null,init:function(t){var o=m.popup.editor.cropper,e=o.$imageEl.position(),i=o.$imageEl[0].getBoundingClientRect().width,r=o.$imageEl[0].getBoundingClientRect().height,a=m.popup.editor.rotation&&-1<[90,270].indexOf(m.popup.editor.rotation)?m.popup.editor.scale:1;if(o.hide(),o.crop||o.setDefaultData(),0==i||0==r)return o.hide(!0);o.isCropping||(o.$imageEl.clone().appendTo(o.$template.find(".area-image")),o.$imageEl.parent().append(l)),o.$template.hide().css({left:e.left,top:e.top,width:i,height:r}).fadeIn(150),o.$editor.hide(),clearTimeout(o._editorAnimationTimeout),o._editorAnimationTimeout=setTimeout(function(){var e;delete o._editorAnimationTimeout,o.$editor.fadeIn(250),m.editor.crop&&$.isPlainObject(t)&&(o.resize(),o.crop.left=o.crop.left*o.crop.cfWidth*a,o.crop.width=o.crop.width*o.crop.cfWidth*a,o.crop.top=o.crop.top*o.crop.cfHeight*a,o.crop.height=o.crop.height*o.crop.cfHeight*a),n.editor.cropper&&(n.editor.cropper.maxWidth||n.editor.cropper.maxHeight)&&(n.editor.cropper.maxWidth&&(o.crop.width=Math.min(n.editor.cropper.maxWidth*o.crop.cfWidth,o.crop.width)),n.editor.cropper.maxHeight&&(o.crop.height=Math.min(n.editor.cropper.maxHeight*o.crop.cfHeight,o.crop.height)),m.editor.crop&&"rotation"!=t||"resize"==t||(o.crop.left=(o.$template.width()-o.crop.width)/2,o.crop.top=(o.$template.height()-o.crop.height)/2)),m.editor.crop&&"rotation"!=t||!n.editor.cropper||!n.editor.cropper.ratio||"resize"==t||(e=n.editor.cropper.ratio,(e=f._assets.ratioToPx(o.crop.width,o.crop.height,e))&&(o.crop.width=Math.min(o.crop.width,e[0]),o.crop.left=(o.$template.width()-o.crop.width)/2,o.crop.height=Math.min(o.crop.height,e[1]),o.crop.top=(o.$template.height()-o.crop.height)/2)),o.drawPlaceHolder(o.crop)},400),n.editor.cropper&&n.editor.cropper.showGrid&&o.$editor.addClass("has-grid"),o.$imageEl.attr("draggable","false"),o.$template.on("mousedown touchstart",o.mousedown),$(window).on("resize",o.resize),o.isCropping=!0,m.popup.editor.hasChanges=!0},setDefaultData:function(){var e=m.popup.editor.cropper,t=e.$imageEl,o=(t.get(0).getBoundingClientRect(),t.width()),i=t.height(),n=m.popup.editor.rotation&&-1<[90,270].indexOf(m.popup.editor.rotation),t=m.popup.editor.scale||1;return e.crop={left:0,top:0,width:n?i*t:o,height:n?o*t:i,cfWidth:o/m.reader.width,cfHeight:i/m.reader.height},null},hide:function(e){var t=m.popup.editor.cropper;e&&(t.$template.hide(),t.$editor.hide()),t.$imageEl.attr("draggable",""),t.$template.off("mousedown touchstart",t.mousedown),$(window).off("resize",t.resize)},resize:function(e){var o=m.popup.editor.cropper,i=o.$imageEl;0<i.width()&&(e?(o.$template.hide(),clearTimeout(o._resizeTimeout),o._resizeTimeout=setTimeout(function(){delete o._resizeTimeout;var e=i.width()/m.reader.width,t=i.height()/m.reader.height;o.crop.left=o.crop.left/o.crop.cfWidth*e,o.crop.width=o.crop.width/o.crop.cfWidth*e,o.crop.top=o.crop.top/o.crop.cfHeight*t,o.crop.height=o.crop.height/o.crop.cfHeight*t,o.crop.cfWidth=e,o.crop.cfHeight=t,o.init("resize")},500)):(o.crop.cfWidth=i.width()/m.reader.width,o.crop.cfHeight=i.height()/m.reader.height))},drawPlaceHolder:function(e){var t=m.popup.editor.cropper,o=m.popup.editor.rotation||0,i=m.popup.editor.scale||1,n=[0,0];e&&(e=$.extend({},e),o&&(n=[180==o||270==o?-100:0,90==o||180==o?-100:0]),t.$editor.css(e),t.setAreaInfo(),t.$editor.find(".area-image img").removeAttr("style").css({width:t.$imageEl.width(),height:t.$imageEl.height(),left:-1*t.$editor.position().left,top:-1*t.$editor.position().top,"-webkit-transform":"rotate("+o+"deg) scale("+i+") translateX("+n[0]+"%) translateY("+n[1]+"%)","-moz-transform":"rotate("+o+"deg) scale("+i+") translateX("+n[0]+"%) translateY("+n[1]+"%)",transform:"rotate("+o+"deg) scale("+i+") translateX("+n[0]+"%) translateY("+n[1]+"%)"}))},setAreaInfo:function(e){var t=m.popup.editor.cropper,o=m.popup.editor.scale||1;t.$editor.find(".area-info").html((t.isResizing||"size"==e?["W: "+Math.round(t.crop.width/t.crop.cfWidth/o)+"px"," ","H: "+Math.round(t.crop.height/t.crop.cfHeight/o)+"px"]:["X: "+Math.round(t.crop.left/t.crop.cfWidth/o)+"px"," ","Y: "+Math.round(t.crop.top/t.crop.cfHeight/o)+"px"]).join(""))},mousedown:function(e){function t(){r.pointData={el:i,x:a.x,y:a.y,xEditor:a.x-r.crop.left,yEditor:a.y-r.crop.top,left:r.crop.left,top:r.crop.top,width:r.crop.width,height:r.crop.height},(r.isMoving||r.isResizing)&&(r.setAreaInfo("size"),r.$editor.addClass("moving show-info"),$("body").css({"-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"}),$(document).on("mousemove touchmove",r.mousemove))}var o=e.originalEvent.touches&&e.originalEvent.touches[0]?"touchstart":"mousedown",i=$(e.target),r=m.popup.editor.cropper,a={x:("mousedown"==o?e:e.originalEvent.touches[0]).pageX-r.$template.offset().left,y:("mousedown"==o?e:e.originalEvent.touches[0]).pageY-r.$template.offset().top};if(3==e.which)return!0;m.popup.zoomer&&m.popup.zoomer.hasSpacePressed||(r.isMoving=i.is(".area-move"),r.isResizing=i.is(".point"),"mousedown"==o&&t(),"touchstart"==o&&1==e.originalEvent.touches.length&&((r.isMoving||r.isResizing)&&e.preventDefault(),r.isTouchLongPress=!0,setTimeout(function(){r.isTouchLongPress&&(delete r.isTouchLongPress,t())},n.thumbnails.touchDelay||0)),$(document).on("mouseup touchend",r.mouseup))},mousemove:function(e){var t,o,i,r,a,l,s,p,d,u=e.originalEvent.touches&&e.originalEvent.touches[0]?"touchstart":"mousedown",c=($(e.target),m.popup.editor.cropper),h={x:("mousedown"==u?e:e.originalEvent.touches[0]).pageX-c.$template.offset().left,y:("mousedown"==u?e:e.originalEvent.touches[0]).pageY-c.$template.offset().top};if(e.originalEvent.touches&&1!=e.originalEvent.touches.length)return c.mouseup(e);c.isMoving&&(a=h.x-c.pointData.xEditor,l=h.y-c.pointData.yEditor,a+c.crop.width>c.$template.width()&&(a=c.$template.width()-c.crop.width),a<0&&(a=0),l+c.crop.height>c.$template.height()&&(l=c.$template.height()-c.crop.height),l<0&&(l=0),c.crop.left=a,c.crop.top=l),c.isResizing&&(t=c.pointData.el.attr("class").substr("point point-".length),o=c.crop.left+c.crop.width,i=c.crop.top+c.crop.height,r=(n.editor.cropper&&n.editor.cropper.minWidth||0)*c.crop.cfWidth,u=(n.editor.cropper&&n.editor.cropper.minHeight||0)*c.crop.cfHeight,e=(n.editor.cropper&&n.editor.cropper.maxWidth)*c.crop.cfWidth,a=(n.editor.cropper&&n.editor.cropper.maxHeight)*c.crop.cfHeight,l=n.editor.cropper?n.editor.cropper.ratio:null,r>c.$template.width()&&(r=c.$template.width()),u>c.$template.height()&&(u=c.$template.height()),e>c.$template.width()&&(e=c.$template.width()),a>c.$template.height()&&(a=c.$template.height()),"a"!=t&&"b"!=t&&"c"!=t||s||(c.crop.top=h.y,c.crop.top<0&&(c.crop.top=0),c.crop.height=i-c.crop.top,c.crop.top>c.crop.top+c.crop.height&&(c.crop.top=i,c.crop.height=0),c.crop.height<u&&(c.crop.top=i-u,c.crop.height=u),c.crop.height>a&&(c.crop.top=i-a,c.crop.height=a),(s=l?f._assets.ratioToPx(c.crop.width,c.crop.height,l):null)&&(c.crop.width=s[0],"a"!=t&&"b"!=t||(c.crop.left=Math.max(0,c.pointData.left+(c.pointData.width-c.crop.width)/("b"==t?2:1))),c.crop.left+c.crop.width>c.$template.width()&&(p=c.$template.width()-c.crop.left,c.crop.width=p,c.crop.height=p/s[2]*s[3],c.crop.top=i-c.crop.height))),"e"!=t&&"f"!=t&&"g"!=t||s||(c.crop.height=h.y-c.crop.top,c.crop.height+c.crop.top>c.$template.height()&&(c.crop.height=c.$template.height()-c.crop.top),c.crop.height<u&&(c.crop.height=u),c.crop.height>a&&(c.crop.height=a),(s=l?f._assets.ratioToPx(c.crop.width,c.crop.height,l):null)&&(c.crop.width=s[0],"f"!=t&&"g"!=t||(c.crop.left=Math.max(0,c.pointData.left+(c.pointData.width-c.crop.width)/("f"==t?2:1))),c.crop.left+c.crop.width>c.$template.width()&&(p=c.$template.width()-c.crop.left,c.crop.width=p,c.crop.height=p/s[2]*s[3]))),"c"!=t&&"d"!=t&&"e"!=t||s||(c.crop.width=h.x-c.crop.left,c.crop.width+c.crop.left>c.$template.width()&&(c.crop.width=c.$template.width()-c.crop.left),c.crop.width<r&&(c.crop.width=r),c.crop.width>e&&(c.crop.width=e),(s=l?f._assets.ratioToPx(c.crop.width,c.crop.height,l):null)&&(c.crop.height=s[1],"c"!=t&&"d"!=t||(c.crop.top=Math.max(0,c.pointData.top+(c.pointData.height-c.crop.height)/("d"==t?2:1))),c.crop.top+c.crop.height>c.$template.height()&&(d=c.$template.height()-c.crop.top,c.crop.height=d,c.crop.width=d/s[3]*s[2]))),"a"!=t&&"g"!=t&&"h"!=t||s||(c.crop.left=h.x,c.crop.left>c.$template.width()&&(c.crop.left=c.$template.width()),c.crop.left<0&&(c.crop.left=0),c.crop.width=o-c.crop.left,c.crop.left>c.crop.left+c.crop.width&&(c.crop.left=o,c.crop.width=0),c.crop.width<r&&(c.crop.left=o-r,c.crop.width=r),c.crop.width>e&&(c.crop.left=o-e,c.crop.width=e),(s=l?f._assets.ratioToPx(c.crop.width,c.crop.height,l):null)&&(c.crop.height=s[1],"a"!=t&&"h"!=t||(c.crop.top=Math.max(0,c.pointData.top+(c.pointData.height-c.crop.height)/("h"==t?2:1))),c.crop.top+c.crop.height>c.$template.height()&&(d=c.$template.height()-c.crop.top,c.crop.height=d,c.crop.width=d/s[3]*s[2],c.crop.left=o-c.crop.width)))),c.drawPlaceHolder(c.crop)},mouseup:function(e){var t=m.popup.editor.cropper;0!=t.$editor.width()&&0!=t.$editor.height()||t.init(t.setDefaultData()),delete t.isTouchLongPress,delete t.isMoving,delete t.isResizing,t.$editor.removeClass("moving show-info"),$("body").css({"-webkit-user-select":"","-moz-user-select":"","-ms-user-select":"","user-select":""}),$(document).off("mousemove touchmove",t.mousemove),$(document).off("mouseup touchend",t.mouseup)}},m.popup.editor.cropper.init()))},resize:function(e,t,o,i,n,r){var a=t.getContext("2d"),o=!o&&i?i*e.width/e.height:o,i=!i&&o?o*e.height/e.width:i,l=e.width/e.height,s=1<=l?o:i*l,l=l<1?i:o/l;r&&s<o&&(l*=o/s,s=o),r&&l<i&&(s*=i/l,l=i);var p=Math.min(Math.ceil(Math.log(e.width/s)/Math.log(2)),12);if(t.width=s,t.height=l,e.width<t.width||e.height<t.height||p<2){r||(t.width=Math.min(e.width,t.width),t.height=Math.min(e.height,t.height));i=e.width<t.width?(t.width-e.width)/2:0,r=e.height<t.height?(t.height-e.height)/2:0;n||(a.fillStyle="#fff",a.fillRect(0,0,t.width,t.height)),a.drawImage(e,i,r,Math.min(e.width,t.width),Math.min(e.height,t.height))}else{var d=document.createElement("canvas"),u=d.getContext("2d"),c=2;for(d.width=e.width/c,d.height=e.height/c,u.fillStyle="#fff",u.fillRect(0,0,d.width,d.height),u.imageSmoothingEnabled=!1,u.imageSmoothingQuality="high",u.drawImage(e,0,0,d.width,d.height);2<p;){var f=c+2,h=e.width/c,m=e.height/c;h>d.width&&(h=d.width),m>d.height&&(m=d.height),u.imageSmoothingEnabled=!0,u.drawImage(d,0,0,h,m,0,0,e.width/f,e.height/f),c=f,p--}h=e.width/c,m=e.height/c;h>d.width&&(h=d.width),m>d.height&&(m=d.height),a.drawImage(d,0,0,h,m,0,0,s,l),d=u=null}a=null},zoomer:function(s){var e,p,d,l;s.popup&&s.popup.html&&$("html").find(s.popup.html).length&&(s.popup.zoomer||(e=s.popup.html,p=e.find(".fileuploader-popup-node"),d=p.find(".reader-node"),l=d.find("> img").attr("draggable","false").attr("ondragstart","return false;"),s.popup.zoomer={html:e.find(".fileuploader-popup-zoomer"),isActive:"image"==s.format&&s.popup.node&&n.thumbnails.popup.zoomer,scale:100,zoom:100,init:function(){var e=this;if(!e.isActive||f._assets.isIE()||f._assets.isMobile())return e.html.hide()&&p.addClass("has-node-centered");e.hide(),e.resize(),$(window).on("resize",e.resize),$(window).on("keyup keydown",e.keyPress),e.html.find("input").on("input change",e.range),d.on("mousedown touchstart",e.mousedown),p.on("mousewheel DOMMouseScroll",e.scroll)},hide:function(){var e=this;$(window).off("resize",e.resize),$(window).off("keyup keydown",e.keyPress),e.html.find("input").off("input change",e.range),d.off("mousedown",e.mousedown),p.off("mousewheel DOMMouseScroll",e.scroll)},center:function(e){var t=this,o=0,i=0,i=e?(o=t.left,i=t.top,o-=(p.width()/2-t.left)*(d.width()/e[0]-1),i-=(p.height()/2-t.top)*(d.height()/e[1]-1),d.width()<=p.width()&&(o=Math.round((p.width()-d.width())/2)),d.height()<=p.height()&&(i=Math.round((p.height()-d.height())/2)),d.width()>p.width()&&(0<o?o=0:o+d.width()<p.width()&&(o=p.width()-d.width())),d.height()>p.height()&&(0<i?i=0:i+d.height()<p.height()&&(i=p.height()-d.height())),Math.min(i,0)):(o=Math.round((p.width()-d.width())/2),Math.round((p.height()-l.height())/2));d.css({left:(t.left=o)+"px",top:(t.top=i)+"px",width:d.width(),height:d.height()})},resize:function(){var e=s.popup.zoomer;p.removeClass("is-zoomed"),d.removeAttr("style"),e.scale=e.getImageScale(),e.updateView()},range:function(e){var t=s.popup.zoomer,o=$(this),i=parseFloat(o.val());if(100<=t.scale)return e.preventDefault(),void o.val(t.scale);i<t.scale&&(e.preventDefault(),i=t.scale,o.val(i)),t.updateView(i,!0)},scroll:function(e){var t=s.popup.zoomer,o=-100;e.originalEvent&&(e.originalEvent.wheelDelta&&(o=e.originalEvent.wheelDelta/-40),e.originalEvent.deltaY&&(o=e.originalEvent.deltaY),e.originalEvent.detail&&(o=e.originalEvent.detail)),t[o<0?"zoomIn":"zoomOut"](3)},keyPress:function(e){var t=s.popup.zoomer,o=e.type;32==(e.keyCode||e.which)&&(t.hasSpacePressed="keydown"==o,t.hasSpacePressed&&t.isZoomed()?d.addClass("is-amoving"):d.removeClass("is-amoving"))},mousedown:function(e){function t(){o.pointData={x:a.x,y:a.y,xTarget:a.x-o.left,yTarget:a.y-o.top},$("body").css({"-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"}),d.addClass("is-moving"),$(document).on("mousemove",o.mousemove)}var o=s.popup.zoomer,i=$(e.target),r=e.originalEvent.touches&&e.originalEvent.touches[0]?"touchstart":"mousedown",a={x:("mousedown"==r?e:e.originalEvent.touches[0]).pageX,y:("mousedown"==r?e:e.originalEvent.touches[0]).pageY};1==e.which&&100!=o.scale&&o.zoom!=o.scale&&(o.hasSpacePressed||i[0]==l[0]||i.is(".fileuploader-cropper"))&&("mousedown"==r&&t(),"touchstart"==r&&(o.isTouchLongPress=!0,setTimeout(function(){o.isTouchLongPress&&(delete o.isTouchLongPress,t())},n.thumbnails.touchDelay||0)),$(document).on("mouseup touchend",o.mouseup))},mousemove:function(e){var t=s.popup.zoomer,o=e.originalEvent.touches&&e.originalEvent.touches[0]?"touchstart":"mousedown",i=("mousedown"==o?e:e.originalEvent.touches[0]).pageX,e=("mousedown"==o?e:e.originalEvent.touches[0]).pageY,i=i-t.pointData.xTarget,e=e-t.pointData.yTarget;0<e&&(e=0),e<p.height()-d.height()&&(e=p.height()-d.height()),d.height()<p.height()&&(e=p.height()/2-d.height()/2),d.width()>p.width()?(0<i&&(i=0),i<p.width()-d.width()&&(i=p.width()-d.width())):i=p.width()/2-d.width()/2,d.css({left:(t.left=i)+"px",top:(t.top=e)+"px"})},mouseup:function(e){var t=s.popup.zoomer;delete t.pointData,$("body").css({"-webkit-user-select":"","-moz-user-select":"","-ms-user-select":"","user-select":""}),d.removeClass("is-moving"),$(document).off("mousemove",t.mousemove),$(document).off("mouseup",t.mouseup)},zoomIn:function(e){var t=s.popup.zoomer,e=e||20;100<=t.zoom||(t.zoom=Math.min(100,t.zoom+e),t.updateView(t.zoom))},zoomOut:function(e){var t=s.popup.zoomer,e=e||20;t.zoom<=t.scale||(t.zoom=Math.max(t.scale,t.zoom-e),t.updateView(t.zoom))},updateView:function(e,t){var o=this,i=o.getImageSize().width/100*e,n=o.getImageSize().height/100*e,r=d.width(),a=d.height(),l=e&&e!=o.scale;if(!o.isActive)return o.center();l?(p.addClass("is-zoomed"),d.addClass("is-movable").css({width:i+"px",height:n+"px",maxWidth:"none",maxHeight:"none"})):(p.removeClass("is-zoomed"),d.removeClass("is-movable is-amoving").removeAttr("style")),o.zoom=e||o.scale,o.center(l?[r,a,o.left,o.top]:null),o.html.find("span").html(o.zoom+"%"),t||o.html.find("input").val(o.zoom),e&&s.popup.editor&&s.popup.editor.cropper&&s.popup.editor.cropper.resize(!0)},isZoomed:function(){return this.zoom>this.scale},getImageSize:function(){return{width:l.prop("naturalWidth"),height:l.prop("naturalHeight")}},getImageScale:function(){return Math.round(100/(l.prop("naturalWidth")/l.width()))}}),s.popup.zoomer.init())},save:function(v,b,w,x,y){function e(){if(v.reader.node){var e,t,i,r=document.createElement("canvas"),a=r.getContext("2d"),d=[0,180],u=w||v.type||"image/jpeg",c=n.editor.quality||90,h=function(e,t){var i=e;b&&(i?i=f._assets.dataURItoBlob(i,u):console.error("Error: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.")),!y&&i&&f.thumbnails.renderThumbnail(v,!0,t||e),x&&x(i,v,l,p,o,s),null!=n.editor.onSave&&"function"==typeof n.editor.onSave&&n.editor.onSave(i,v,l,p,o,s),f.set("listInput",null)};try{r.width=v.reader.width,r.height=v.reader.height,a.drawImage(this,0,0,v.reader.width,v.reader.height),void 0!==v.editor.rotation&&(v.editor.rotation=v.editor.rotation||0,r.width=-1<d.indexOf(v.editor.rotation)?v.reader.width:v.reader.height,r.height=-1<d.indexOf(v.editor.rotation)?v.reader.height:v.reader.width,i=v.editor.rotation*Math.PI/180,e=.5*r.width,t=.5*r.height,a.clearRect(0,0,r.width,r.height),a.translate(e,t),a.rotate(i),a.translate(.5*-v.reader.width,.5*-v.reader.height),a.drawImage(this,0,0),a.setTransform(1,0,0,1,0,0)),v.editor.crop&&(i=a.getImageData(v.editor.crop.left,v.editor.crop.top,v.editor.crop.width,v.editor.crop.height),r.width=v.editor.crop.width,r.height=v.editor.crop.height,a.putImageData(i,0,0));var m,g=r.toDataURL(u,c/100);n.editor.maxWidth||n.editor.maxHeight?((m=new Image).src=g,m.onload=function(){var e=document.createElement("canvas");f.editor.resize(m,e,n.editor.maxWidth,n.editor.maxHeight,!0,!1),g=e.toDataURL(u,c/100),r=a=e=null,h(g,m)}):(r=a=null,h(g))}catch(e){v.popup.editor=null,r=a=null,h(null)}}}var t=v.popup&&v.popup.html&&$("html").find(v.popup.html).length,i=new Image;if(t){if(!v.popup.editor.hasChanges)return;t=v.popup.editor.scale||1;v.editor.rotation=v.popup.editor.rotation||0,v.popup.editor.cropper&&(v.editor.crop=v.popup.editor.cropper.crop,v.editor.crop.width=v.editor.crop.width/v.popup.editor.cropper.crop.cfWidth/t,v.editor.crop.left=v.editor.crop.left/v.popup.editor.cropper.crop.cfWidth/t,v.editor.crop.height=v.editor.crop.height/v.popup.editor.cropper.crop.cfHeight/t,v.editor.crop.top=v.editor.crop.top/v.popup.editor.cropper.crop.cfHeight/t)}f._assets.isMobile()?(i.onload=e,i.src=v.reader.src):v.popup.node?e.call(v.popup.node):v.reader.node?e.call(v.reader.node):v.reader.read(v,function(){e.call(v.reader.node)})}},sorter:{init:function(){p.on("mousedown touchstart",n.thumbnails._selectors.sorter,f.sorter.mousedown)},destroy:function(){p.off("mousedown touchstart",n.thumbnails._selectors.sorter,f.sorter.mousedown)},findItemAtPos:function(o){var e=f.sorter.sort,e=e.items.not(e.item.html),i=null;return e.each(function(e,t){t=$(t);if(o.x>t.offset().left&&o.x<t.offset().left+t.outerWidth()&&o.y>t.offset().top&&o.y<t.offset().top+t.outerHeight())return i=t,!1}),i},mousedown:function(e){function t(){f.sorter.sort={el:i,item:a,items:l.find(n.thumbnails._selectors.item),x:s.x,y:s.y,xItem:s.x-r.offset().left,yItem:s.y-r.offset().top,left:r.position().left,top:r.position().top,width:r.outerWidth(),height:r.outerHeight(),placeholder:n.sorter.placeholder?$(n.sorter.placeholder):$(a.html.get(0).cloneNode()).addClass("fileuploader-sorter-placeholder")},$("body").css({"-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"}),$(document).on("mousemove touchmove",f.sorter.mousemove)}var o=e.originalEvent.touches&&e.originalEvent.touches[0]?"touchstart":"mousedown",i=$(e.target),r=i.closest(n.thumbnails._selectors.item),a=f.files.find(r),s={x:("mousedown"!=o&&r.length?e.originalEvent.touches[0]:e).pageX,y:("mousedown"!=o&&r.length?e.originalEvent.touches[0]:e).pageY};return f.sorter.sort&&f.sorter.mouseup(),3==e.which||(!a||(!(!n.sorter.selectorExclude||!i.is(n.sorter.selectorExclude)&&!i.closest(n.sorter.selectorExclude).length)||(e.preventDefault(),"mousedown"==o&&t(),"touchstart"==o&&(f.sorter.isTouchLongPress=!0,setTimeout(function(){f.sorter.isTouchLongPress&&(delete f.sorter.isTouchLongPress,t())},n.thumbnails.touchDelay||0)),void $(document).on("mouseup touchend",f.sorter.mouseup))))},mousemove:function(e){var t=e.originalEvent.touches&&e.originalEvent.touches[0]?"touchstart":"mousedown",o=f.sorter.sort,i=o.item,r=l.find(n.thumbnails._selectors.item),a=$(n.sorter.scrollContainer||window),s=$(document).scrollLeft(),p=$(document).scrollTop(),d=a.scrollLeft(),u=a.scrollTop(),c={x:("mousedown"==t?e:e.originalEvent.touches[0]).clientX,y:("mousedown"==t?e:e.originalEvent.touches[0]).clientY},h=c.x-o.xItem,m=c.y-o.yItem,t=c.x-(a.prop("offsetLeft")||0),e=c.y-(a.prop("offsetTop")||0);h+o.xItem>a.width()&&(h=a.width()-o.xItem),h+o.xItem<0&&(h=0-o.xItem),m+o.yItem>a.height()&&(m=a.height()-o.yItem),m+o.yItem<0&&(m=0-o.yItem),e<=0&&a.scrollTop(u-10),e>a.height()&&a.scrollTop(u+10),t<0&&a.scrollLeft(d-10),t>a.width()&&a.scrollLeft(d+10),i.html.addClass("sorting").css({position:"fixed",left:h,top:m,width:f.sorter.sort.width,height:f.sorter.sort.height}),l.find(o.placeholder).length||i.html.after(o.placeholder),o.placeholder.css({width:f.sorter.sort.width,height:f.sorter.sort.height});s=f.sorter.findItemAtPos({x:h+o.xItem+s,y:m+o.yItem+p});if(s){m=o.placeholder.offset().left!=s.offset().left,p=o.placeholder.offset().top!=s.offset().top;if(f.sorter.sort.lastHover&&f.sorter.sort.lastHover.el==s[0]){if(p&&"before"==f.sorter.sort.lastHover.direction&&c.y<f.sorter.sort.lastHover.y)return;if(p&&"after"==f.sorter.sort.lastHover.direction&&c.y>f.sorter.sort.lastHover.y)return;if(m&&"before"==f.sorter.sort.lastHover.direction&&c.x<f.sorter.sort.lastHover.x)return;if(m&&"after"==f.sorter.sort.lastHover.direction&&c.x>f.sorter.sort.lastHover.x)return}m=r.index(i.html),m=r.index(s)<m?"before":"after";s[m](o.placeholder),s[m](i.html),f.sorter.sort.lastHover={el:s[0],x:c.x,y:c.y,direction:m}}},mouseup:function(){var e=f.sorter.sort,t=e.item;$("body").css({"-webkit-user-select":"","-moz-user-select":"","-ms-user-select":"","user-select":""}),t.html.removeClass("sorting").css({position:"",left:"",top:"",width:"",height:""}),$(document).off("mousemove touchmove",f.sorter.mousemove),$(document).off("mouseup touchend",f.sorter.mouseup),e.placeholder.remove(),delete f.sorter.sort,f.sorter.save()},save:function(e){var i,r=0,a=[],d=[],t=e?f._itFl:n.thumbnails.itemPrepend?l.children().get().reverse():l.children();$.each(t,function(e,t){t=t.file?t:f.files.find($(t));t&&(t.upload&&!t.uploaded||(f.rendered&&t.index!=r&&(f._itSl&&f._itSl.indexOf(t.id),1)&&(i=!0),t.index=r,a.push(t),d.push(t.id),r++))}),f._itSl&&f._itSl.length!=d.length&&(i=!0),f._itSl=d,i&&a.length==f._itFl.length&&(f._itFl=a),e||f.set("listInput","ignoreSorter"),i&&null!=n.sorter.onSort&&"function"==typeof n.sorter.onSort&&n.sorter.onSort(a,l,p,o,s)}},upload:{prepare:function(t,e){t.upload={url:n.upload.url,data:$.extend({},n.upload.data),formData:new FormData,type:n.upload.type||"POST",enctype:n.upload.enctype||"multipart/form-data",cache:!1,contentType:!1,processData:!1,chunk:t.upload?t.upload.chunk:null,status:null,send:function(e){f.upload.send(t,e)},cancel:function(e){f.upload.cancel(t,e)}},t.upload.formData.append(s.attr("name"),t.file,t.name||!1),(n.upload.start||e)&&f.upload.send(t,e)},send:function(a,e){if(a.upload){var t,d=function(e){a.html&&a.html.removeClass("upload-pending upload-loading upload-cancelled upload-failed upload-successful").addClass("upload-"+(e||a.upload.status))},r=function(){var e=0;if(0<f._pfuL.length)for(-1<f._pfuL.indexOf(a)&&f._pfuL.splice(f._pfuL.indexOf(a),1);e<f._pfuL.length;){if(-1<f._itFl.indexOf(f._pfuL[e])&&f._pfuL[e].upload&&!f._pfuL[e].upload.$ajax){f.upload.send(f._pfuL[e],!0);break}f._pfuL.splice(e,1),e++}};if(n.upload.synchron&&!a.upload.chunk)if(a.upload.status="pending",a.html&&d(),e)-1<f._pfuL.indexOf(a)&&f._pfuL.splice(f._pfuL.indexOf(a),1);else if(-1==f._pfuL.indexOf(a)&&f._pfuL.push(a),1<f._pfuL.length)return;if(n.upload.chunk&&a.file.slice&&(t=f._assets.toBytes(n.upload.chunk),1<(e=Math.ceil(a.size/t,t))&&!a.upload.chunk&&(a.upload.chunk={name:a.name,size:a.file.size,type:a.file.type,chunkSize:t,temp_name:a.name,loaded:0,total:e,i:-1}),a.upload.chunk&&(a.upload.chunk.i++,delete a.upload.chunk.isFirst,delete a.upload.chunk.isLast,0==a.upload.chunk.i&&(a.upload.chunk.isFirst=!0),a.upload.chunk.i==a.upload.chunk.total-1&&(a.upload.chunk.isLast=!0),a.upload.chunk.i<=a.upload.chunk.total-1?(e=a.upload.chunk.i*a.upload.chunk.chunkSize,e=a.file.slice(e,e+a.upload.chunk.chunkSize),a.upload.formData=new FormData,a.upload.formData.append(s.attr("name"),e),a.upload.data._chunkedd=JSON.stringify(a.upload.chunk)):delete a.upload.chunk)),n.upload.beforeSend&&$.isFunction(n.upload.beforeSend)&&!1===n.upload.beforeSend(a,l,p,o,s))return delete a.upload.chunk,d(),void r();if(p.addClass("fileuploader-is-uploading"),a.upload.$ajax&&a.upload.$ajax.abort(),delete a.upload.$ajax,delete a.upload.send,a.upload.status="loading",a.html&&(n.thumbnails._selectors.start&&a.html.find(n.thumbnails._selectors.start).remove(),d()),a.upload.data)for(var i in a.upload.data)a.upload.data.hasOwnProperty(i)&&a.upload.formData.append(i,a.upload.data[i]);a.upload.data=a.upload.formData,a.upload.xhrStartedAt=a.upload.chunk&&a.upload.chunk.xhrStartedAt?a.upload.chunk.xhrStartedAt:new Date,a.upload.xhr=function(){var e=$.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",function(e){a.upload.$ajax&&(a.upload.$ajax.total=a.upload.chunk?a.upload.chunk.size:e.total),f.upload.progressHandling(e,a,a.upload.xhrStartedAt)},!1),e},a.upload.complete=function(e,t){if(a.upload.chunk&&!a.upload.chunk.isLast&&"success"==t)return f.upload.prepare(a,!0);r(),delete a.upload.xhrStartedAt;var i=!0;$.each(f._itFl,function(e,t){t.upload&&t.upload.$ajax&&(i=!1)}),i&&(p.removeClass("fileuploader-is-uploading"),null!=n.upload.onComplete&&"function"==typeof n.upload.onComplete&&n.upload.onComplete(l,p,o,s,e,t))},a.upload.success=function(e,t,i){if(!a.upload.chunk||a.upload.chunk.isLast)delete a.upload.chunk,f.upload.progressHandling(null,a,a.upload.xhrStartedAt,!0),a.uploaded=!0,delete a.upload,a.upload={status:"successful",resend:function(){f.upload.retry(a)}},a.html&&d(),null!=n.upload.onSuccess&&$.isFunction(n.upload.onSuccess)&&n.upload.onSuccess(e,a,l,p,o,s,t,i),f.set("listInput",null);else try{var r=JSON.parse(e);a.upload.chunk.temp_name=r.fileuploader.temp_name}catch(e){}},a.upload.error=function(e,t,i){a.upload.chunk&&(a.upload.chunk.i=Math.max(-1,a.upload.chunk.i-1)),a.uploaded=!1,a.upload.status="cancelled"==a.upload.status?a.upload.status:"failed",a.upload.retry=function(){f.upload.retry(a)},delete a.upload.$ajax,a.html&&d(),null!=n.upload.onError&&$.isFunction(n.upload.onError)&&n.upload.onError(a,l,p,o,s,e,t,i)},a.upload.$ajax=$.ajax(a.upload)}},cancel:function(e,t){e&&e.upload&&(e.upload.status="cancelled",delete e.upload.chunk,e.upload.$ajax&&e.upload.$ajax.abort(),delete e.upload.$ajax,t||f.files.remove(e))},retry:function(e){e&&e.upload&&(e.html&&n.thumbnails._selectors.retry&&e.html.find(n.thumbnails._selectors.retry).remove(),f.upload.prepare(e,!0))},progressHandling:function(e,t,i,r){var a,d,u,c,h,m,g;!e&&r&&t.upload.$ajax&&(e={total:t.upload.$ajax.total||t.size,loaded:t.upload.$ajax.total||t.size,lengthComputable:!0}),e.lengthComputable&&(m=new Date,a=e.loaded+(t.upload.chunk?t.upload.chunk.loaded:0),d=t.upload.chunk?t.upload.chunk.size:e.total,u=Math.round(100*a/d),g=t.upload.chunk&&t.upload.chunk.xhrStartedAt?t.upload.chunk.xhrStartedAt:i,h=(c=(m.getTime()-g.getTime())/1e3)?a/c:0,m=Math.max(0,d-a),g=Math.max(0,c?m/h:0),g={loaded:a,loadedInFormat:f._assets.bytesToText(a),total:d,totalInFormat:f._assets.bytesToText(d),percentage:u,secondsElapsed:c,secondsElapsedInFormat:f._assets.secondsToText(c,!0),bytesPerSecond:h,bytesPerSecondInFormat:f._assets.bytesToText(h)+"/s",remainingBytes:m,remainingBytesInFormat:f._assets.bytesToText(m),secondsRemaining:g,secondsRemainingInFormat:f._assets.secondsToText(g,!0)},t.upload.chunk&&(t.upload.chunk.isFirst&&(t.upload.chunk.xhrStartedAt=i),e.loaded!=e.total||t.upload.chunk.isLast||(t.upload.chunk.loaded+=Math.max(e.total,t.upload.chunk.total/t.upload.chunk.chunkSize))),99<g.percentage&&!r&&(g.percentage=99),n.upload.onProgress&&$.isFunction(n.upload.onProgress)&&n.upload.onProgress(g,t,l,p,o,s))}},dragDrop:{onDragEnter:function(e){clearTimeout(f.dragDrop._timer),n.dragDrop.container.addClass("fileuploader-dragging"),f.set("feedback",f._assets.textParse(n.captions.drop)),null!=n.dragDrop.onDragEnter&&$.isFunction(n.dragDrop.onDragEnter)&&n.dragDrop.onDragEnter(e,l,p,o,s)},onDragLeave:function(e){clearTimeout(f.dragDrop._timer),f.dragDrop._timer=setTimeout(function(e){return!!f.dragDrop._dragLeaveCheck(e)&&(n.dragDrop.container.removeClass("fileuploader-dragging"),f.set("feedback",null),void(null!=n.dragDrop.onDragLeave&&$.isFunction(n.dragDrop.onDragLeave)&&n.dragDrop.onDragLeave(e,l,p,o,s)))},100,e)},onDrop:function(e){clearTimeout(f.dragDrop._timer),n.dragDrop.container.removeClass("fileuploader-dragging"),f.set("feedback",null),e&&e.originalEvent&&e.originalEvent.dataTransfer&&e.originalEvent.dataTransfer.files&&e.originalEvent.dataTransfer.files.length&&(f.isUploadMode()?f.onChange(e,e.originalEvent.dataTransfer.files):s.prop("files",e.originalEvent.dataTransfer.files).trigger("change")),null!=n.dragDrop.onDrop&&$.isFunction(n.dragDrop.onDrop)&&n.dragDrop.onDrop(e,l,p,o,s)},_dragLeaveCheck:function(e){e=$(e.currentTarget);return!(!e.is(n.dragDrop.container)&&n.dragDrop.container.find(e).length)}},clipboard:{paste:function(e){if(f._assets.isIntoView(o)&&e.originalEvent.clipboardData&&e.originalEvent.clipboardData.items&&e.originalEvent.clipboardData.items.length){var t=e.originalEvent.clipboardData.items;f.clipboard.clean();for(var i,r,a=0;a<t.length;a++)-1===t[a].type.indexOf("image")&&-1===t[a].type.indexOf("text/uri-list")||(i=t[a].getAsFile(),r=1<n.clipboardPaste?n.clipboardPaste:2e3,i&&(i._name=f._assets.generateFileName(-1!=i.type.indexOf("/")?i.type.split("/")[1].toString().toLowerCase():"png","Clipboard "),f.set("feedback",f._assets.textParse(n.captions.paste,{ms:r/1e3})),f.clipboard._timer=setTimeout(function(){f.set("feedback",null),f.onChange(e,[i])},r-2)))}},clean:function(){f.clipboard._timer&&(clearTimeout(f.clipboard._timer),delete f.clipboard._timer,f.set("feedback",null))}},files:{add:function(e,t){var o,r,i=e._name||e.name,a=e.size,l=f._assets.bytesToText(a),p=e.type,d=p?p.split("/",1).toString().toLowerCase():"",u=-1!=i.indexOf(".")?i.split(".").pop().toLowerCase():"",c=i.substr(0,i.length-(-1!=i.indexOf(".")?u.length+1:u.length)),h=e.data||{};return(h={name:i,title:c,size:a,size2:l,type:p,format:d,extension:u,data:h,file:e.file||e,reader:{read:function(e,t,o){return f.files.read(r,e,t,o)}},id:"updated"==t?e.id:Date.now(),input:"choosed"==t?s:null,html:null,choosed:"choosed"==t,appended:"appended"==t||"updated"==t,uploaded:"uploaded"==t}).data.listProps||(h.data.listProps={}),!h.data.url&&h.appended&&(h.data.url=h.file),"updated"!=t?(f._itFl.push(h),o=f._itFl.length-1,r=f._itFl[o]):(o=f._itFl.indexOf(e),f._itFl[o]=r=h),r.remove=function(){f.files.remove(r)},n.editor&&"image"==d&&(r.editor={rotate:!1!==n.editor.rotation?function(e){f.editor.rotate(r,e)}:null,cropper:!1!==n.editor.cropper?function(e){f.editor.crop(r,e)}:null,save:function(e,t,o,i){f.editor.save(r,t,o,e,i)}}),e.local&&(r.local=e.local),o},read:function(d,e,t,i,r){if(f.isFileReaderSupported()&&!d.data.readerSkip){var a=new FileReader,u=window.URL||window.webkitURL,c=r&&d.data.thumbnail,h="string"!=typeof d.file,m=function(){var e=d.reader._callbacks||[];d.reader._timer&&(clearTimeout(d.reader._timer),delete d.reader._timer),delete d.reader._callbacks,delete d.reader._FileReader;for(var t=0;t<e.length;t++)$.isFunction(e[t])&&e[t](d,l,p,o,s);n.onFileRead&&$.isFunction(n.onFileRead)&&n.onFileRead(d,l,p,o,s)};if((d.reader.src||d.reader._FileReader)&&!i||(d.reader={_FileReader:a,_callbacks:[],read:d.reader.read}),d.reader.src&&!i)return e&&$.isFunction(e)?e(d,l,p,o,s):null;if(e&&d.reader._callbacks&&(d.reader._callbacks.push(e),1<d.reader._callbacks.length))return;if("astext"==d.format)a.onload=function(e){var t=document.createElement("div");d.reader.node=t,d.reader.src=e.target.result,d.reader.length=e.target.result.length,t.innerHTML=d.reader.src.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),m()},a.onerror=function(){m(),d.reader={read:d.reader.read}},h?a.readAsText(d.file):$.ajax({url:d.file,success:function(e){a.onload({target:{result:e}})},error:function(){a.onerror()}});else if("image"==d.format||c){if(a.onload=function(e){function o(){d.data&&d.data.readerCrossOrigin&&l.setAttribute("crossOrigin",d.data.readerCrossOrigin),l.src=e.target.result+(!d.data.readerForce&&!i||h||c||-1!=e.target.result.indexOf("data:image")?"":(-1==e.target.result.indexOf("?")?"?":"&")+"d="+Date.now()),l.onload=function(){if(d.reader.exifOrientation){var e=document.createElement("canvas"),t=e.getContext("2d"),o=l,i=Math.abs(d.reader.exifOrientation),n=d.reader.exifOrientation<0?d.reader.exifOrientation:0,r=[0,180];1==i&&(i=0),e.width=o.naturalWidth,e.height=o.naturalHeight,t.drawImage(o,0,0),e.width=-1<r.indexOf(i)?o.naturalWidth:o.naturalHeight,e.height=-1<r.indexOf(i)?o.naturalHeight:o.naturalWidth;var a=i*Math.PI/180,r=.5*e.width,i=.5*e.height;return t.clearRect(0,0,e.width,e.height),t.translate(r,i),t.rotate(a),t.translate(.5*-o.naturalWidth,.5*-o.naturalHeight),n&&(-1<[-1,-180].indexOf(n)?(t.translate(e.width,0),t.scale(-1,1)):-1<[-90,-270].indexOf(n)&&(t.translate(0,e.width),t.scale(1,-1))),t.drawImage(o,0,0),t.setTransform(1,0,0,1,0,0),l.src=e.toDataURL(d.type,1),void delete d.reader.exifOrientation}d.reader.node=l,d.reader.src=l.src,d.reader.width=l.width,d.reader.height=l.height,d.reader.ratio=f._assets.pxToRatio(d.reader.width,d.reader.height),v&&u.revokeObjectURL(v),m(),c&&(d.reader={read:d.reader.read})},l.onerror=function(){m(),d.reader={read:d.reader.read}}}var l=new Image;n.thumbnails.exif&&d.choosed?f._assets.getExifOrientation(d.file,function(e){var t;e&&("Chrome"==(t=f._assets.getDevice.init()).browser.name&&81<=t.browser.version?delete d.reader.exifOrientation:d.reader.exifOrientation=e),o()}):o()},a.onerror=function(){m(),d.reader={read:d.reader.read}},!c&&d.size>f._assets.toBytes(n.reader.maxSize))return a.onerror();h?n.thumbnails.useObjectUrl&&n.thumbnails.canvasImage&&u?a.onload({target:{result:v=u.createObjectURL(d.file)}}):a.readAsDataURL(d.file):a.onload({target:{result:c?d.data.thumbnail:d.file}})}else if("video"==d.format||"audio"==d.format){var g,v,b=(g=document.createElement(d.format)).canPlayType(d.type);if(a.onerror=function(){d.reader.node=null,m(),d.reader={read:d.reader.read}},u&&""!==b){if(r&&!n.thumbnails.videoThumbnail)return d.reader.node=g,m(),void(d.reader={read:d.reader.read});v=h?u.createObjectURL(d.file):d.file,g.onloadedmetadata=function(){d.reader.node=g,d.reader.src=g.src,d.reader.duration=g.duration,d.reader.duration2=f._assets.secondsToText(g.duration),"video"==d.format&&(d.reader.width=g.videoWidth,d.reader.height=g.videoHeight,d.reader.ratio=f._assets.pxToRatio(d.reader.width,d.reader.height))},g.onerror=function(){m(),d.reader={read:d.reader.read}},g.onloadeddata=function(){"video"==d.format?setTimeout(function(){var e=document.createElement("canvas"),t=e.getContext("2d");e.width=g.videoWidth,e.height=g.videoHeight,t.drawImage(g,0,0,e.width,e.height),d.reader.frame=f._assets.isBlankCanvas(e)?null:e.toDataURL(),e=t=null,m()},300):m()},setTimeout(function(){d.data&&d.data.readerCrossOrigin&&g.setAttribute("crossOrigin",d.data.readerCrossOrigin),g.src=v+"#t=1"},100)}else a.onerror()}else"application/pdf"==d.type&&n.thumbnails.pdf&&!t?(g=document.createElement("iframe"),v=h?u.createObjectURL(d.file):d.file,(n.thumbnails.pdf.viewer||f._assets.hasPlugin("pdf"))&&(g.src=(n.thumbnails.pdf.viewer||"")+v,d.reader.node=g,d.reader.src=v),m()):(a.onload=function(e){d.reader.src=e.target.result,d.reader.length=e.target.result.length,m()},a.onerror=function(e){m(),d.reader={read:d.reader.read}},h?a[t||"readAsBinaryString"](d.file):m());d.reader._timer=setTimeout(a.onerror,r?n.reader.thumbnailTimeout:n.reader.timeout)}else e&&e(d,l,p,o,s);return null},list:function(r,a,e,t){var d=[];return!n.sorter||e||t&&"ignoreSorter"==t||f.sorter.save(!0),$.each(f._itFl,function(e,t){var o=t;if(o.upload&&!o.uploaded)return!0;if((a||r)&&(o=(o.choosed&&!o.uploaded?"0:/":"")+(a&&null!==f.files.getItemAttr(t,a)?f.files.getItemAttr(o,a):o.local||o["string"==typeof o.file?"file":"name"])),r&&(o={file:o},t.editor&&(t.editor.crop||t.editor.rotation)&&(o.editor={},t.editor.rotation&&(o.editor.rotation=t.editor.rotation),t.editor.crop&&(o.editor.crop=t.editor.crop)),void 0!==t.index&&(o.index=t.index),t.data&&t.data.listProps))for(var i in t.data.listProps)o[i]=t.data.listProps[i];d.push(o)}),d=n.onListInput&&$.isFunction(n.onListInput)?n.onListInput(d,f._itFl,n.listInput,l,p,o,s):d,r?JSON.stringify(d):d},check:function(i,r,e){var a=["warning",null,!1,!1];if(null!=n.limit&&e&&r.length+f._itFl.length-1>n.limit)return a[1]=f._assets.textParse(n.captions.errors.filesLimit),a[3]=!0,a;if(null!=n.maxSize&&e){var d=0;if($.each(f._itFl,function(e,t){d+=t.size}),d-=i.size,$.each(r,function(e,t){d+=t.size}),d>f._assets.toBytes(n.maxSize))return a[1]=f._assets.textParse(n.captions.errors.filesSizeAll),a[3]=!0,a}if(null!=n.onFilesCheck&&$.isFunction(n.onFilesCheck)&&e&&!1===n.onFilesCheck(r,n,l,p,o,s))return a[3]=!0,a;if(null!=n.extensions&&-1==$.inArray(i.extension,n.extensions)&&!n.extensions.filter(function(e){return i.type.length&&(-1<e.indexOf(i.type)||-1<e.indexOf(i.format+"/*"))}).length)return a[1]=f._assets.textParse(n.captions.errors.filesType,i),a;if(null!=n.disallowedExtensions&&(-1<$.inArray(i.extension,n.disallowedExtensions)||n.disallowedExtensions.filter(function(e){return!i.type.length||-1<e.indexOf(i.type)||-1<e.indexOf(i.format+"/*")}).length))return a[1]=f._assets.textParse(n.captions.errors.filesType,i),a;if(null!=n.fileMaxSize&&i.size>f._assets.toBytes(n.fileMaxSize))return a[1]=f._assets.textParse(n.captions.errors.fileSize,i),a;if(0==i.size&&""==i.type)return a[1]=f._assets.textParse(n.captions.errors.remoteFile,i),a;if((4096==i.size||64==i.size)&&""==i.type)return a[1]=f._assets.textParse(n.captions.errors.folderUpload,i),a;if(!n.skipFileNameCheck){d=!1;if($.each(f._itFl,function(e,t){if(t!=i&&1==t.choosed&&t.file&&t.name==i.name)return d=!0,t.file.size!=i.size||t.file.type!=i.type||i.file.lastModified&&t.file.lastModified&&t.file.lastModified!=i.file.lastModified||!(1<r.length)?(a[1]=f._assets.textParse(n.captions.errors.fileName,i),a[2]=!1):a[2]=!0,!1}),d)return a}return!0},append:function(e){if((e=$.isArray(e)?e:[e]).length){for(var t,i=0;i<e.length;i++)f._assets.keyCompare(e[i],["name","file","size","type"])&&(t=f._itFl[f.files.add(e[i],"appended")],n.thumbnails&&f.thumbnails.item(t));return f.set("feedback",null),f.set("listInput",null),n.afterSelect&&$.isFunction(n.afterSelect)&&n.afterSelect(l,p,o,s),1!=e.length||t}},update:function(e,t){var o;-1==f._itFl.indexOf(e)||e.upload&&e.upload.$ajax||(o=e,t=f.files.add($.extend(e,t),"updated"),(e=f._itFl[t]).popup&&e.popup.close&&e.popup.close(),n.thumbnails&&o.html&&f.thumbnails.item(e,o.html),f.set("listInput",null))},find:function(o){var i=null;return $.each(f._itFl,function(e,t){if(t.html&&t.html.is(o))return i=t,!1}),i},remove:function(i,r){var a;!r&&n.onRemove&&$.isFunction(n.onRemove)&&!1===n.onRemove(i,l,p,o,s)||(i.html&&(n.thumbnails.onItemRemove&&$.isFunction(n.thumbnails.onItemRemove)&&!r?n.thumbnails.onItemRemove(i.html,l,p,o,s):i.html.remove()),i.upload&&i.upload.$ajax&&i.upload.cancel&&i.upload.cancel(!0),i.popup&&i.popup.close&&(i.popup.node=null,i.popup.close()),i.reader.src&&(i.reader.node=null,URL.revokeObjectURL(i.reader.src)),i.input&&(a=!0,$.each(f._itFl,function(e,t){if(i!=t&&(i.input==t.input||r&&1<i.input.get(0).files.length))return a=!1}),a&&(f.isAddMoreMode()&&1<sl.length?(f.set("nextInput"),sl.splice(sl.indexOf(i.input),1),i.input.remove()):f.set("input",""))),-1<f._pfrL.indexOf(i)&&f._pfrL.splice(f._pfrL.indexOf(i),1),-1<f._pfuL.indexOf(i)&&f._pfuL.splice(f._pfuL.indexOf(i),1),-1<f._itFl.indexOf(i)&&f._itFl.splice(f._itFl.indexOf(i),1),i=null,0==f._itFl.length&&f.reset(),f.set("feedback",null),f.set("listInput",null))},getItemAttr:function(e,t){var o=null;return e&&(void 0!==e[t]?o=e[t]:e.data&&void 0!==e.data[t]&&(o=e.data[t])),o},clear:function(e){for(var t=0;t<f._itFl.length;){var i=f._itFl[t];e||!i.appended?(i.html&&i.html&&f._itFl[t].html.remove(),i.upload&&i.upload.$ajax&&f.upload.cancel(i),f._itFl.splice(t,1)):t++}f.set("feedback",null),f.set("listInput",null),0==f._itFl.length&&n.onEmpty&&$.isFunction(n.onEmpty)&&n.onEmpty(l,p,o,s)}},reset:function(e){e&&(f.clipboard._timer&&f.clipboard.clean(),$.each(sl,function(e,t){t.is(s)||t.remove()}),sl=[],f.set("input","")),f._itRl=[],f._pfuL=[],f._pfrL=[],f.files.clear(e)},destroy:function(){f.reset(!0),f.bindUnbindEvents(!1),s.closest("form").off("reset",f.reset),s.removeAttr("style"),p.before(s),delete s.get(0).FileUploader,p.remove(),p=o=l=null},_assets:{toBytes:function(e){return 1048576*parseInt(e)},bytesToText:function(e){if(0==e)return"0 Byte";var t=Math.floor(Math.log(e)/Math.log(1024)),o=e/Math.pow(1024,t),i=!1;return 1e3<o&&t<8&&(t+=1,o=e/Math.pow(1024,t),i=!0),o.toPrecision(i?2:3)+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][t]},escape:function(e){return(""+e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},secondsToText:function(e,t){e=parseInt(Math.round(e),10);var o=Math.floor(e/3600),i=Math.floor((e-3600*o)/60),n="";return(0<o||!t)&&(n+=(o<10?"0":"")+o+(t?"h ":":")),(0<i||!t)&&(n+=(i<10&&!t?"0":"")+i+(t?"m ":":")),n+=((e=e-3600*o-60*i)<10&&!t?"0":"")+e+(t?"s":"")},pxToRatio:function(e,t){var o=function(e,t){return 0==t?e:o(t,e%t)},i=o(e,t);return[e/i,t/i]},ratioToPx:function(e,t,o){return(o=(o+"").split(":")).length<2?null:[t/o[1]*o[0],e/o[0]*o[1],o[0],o[1]]},hasAttr:function(e,t){e=(t=t||s).attr(e);return!(!e||void 0===e)},copyAllAttributes:function(e,t){return $.each(t.get(0).attributes,function(){"required"!=this.name&&"type"!=this.name&&"id"!=this.name&&e.attr(this.name,this.value)}),t.get(0).FileUploader&&(e.get(0).FileUploader=t.get(0).FileUploader),e},isIntoView:function(e){var t=$(window).scrollTop(),o=t+window.innerHeight,i=e.offset().top,e=i+e.outerHeight();return t<i&&e<o},isBlankCanvas:function(e){var t=document.createElement("canvas"),o=!1;t.width=e.width,t.height=e.height;try{o=e.toDataURL()==t.toDataURL()}catch(e){}return t=null,o},generateFileName:function(e,t){function o(e){return e<10&&(e="0"+e),e}var i=new Date,e=e?"."+e:"";return(t=t||"")+i.getFullYear()+"-"+o(i.getMonth()+1)+"-"+o(i.getDate())+" "+o(i.getHours())+"-"+o(i.getMinutes())+"-"+o(i.getSeconds())+e},arrayBufferToBase64:function(e){for(var t="",o=new Uint8Array(e),i=0;i<o.byteLength;i++)t+=String.fromCharCode(o[i]);return window.btoa(t)},dataURItoBlob:function(e,t){for(var o=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],e=new ArrayBuffer(o.length),n=new Uint8Array(e),r=0;r<o.length;r++)n[r]=o.charCodeAt(r);e=new DataView(e);return new Blob([e.buffer],{type:t||i})},getExifOrientation:function(e,p){var t=new FileReader,d={1:0,2:-1,3:180,4:-180,5:-90,6:90,7:-270,8:270};t.onload=function(e){var t=new DataView(e.target.result),o=1;if(t.byteLength&&65496==t.getUint16(0,!1))for(var i=t.byteLength,n=2;n<i&&!(t.getUint16(n+2,!1)<=8);){var r=t.getUint16(n,!1);if(n+=2,65505==r){if(1165519206!=t.getUint32(n+=2,!1))break;var a,l=18761==t.getUint16(n+=6,!1);n+=t.getUint32(n+4,l),a=t.getUint16(n,l),n+=2;for(var s=0;s<a;s++)if(274==t.getUint16(n+12*s,l)){o=t.getUint16(n+12*s+8,l),i=0;break}}else{if(65280!=(65280&r))break;n+=t.getUint16(n,!1)}}p&&p(d[o]||0)},t.onerror=function(){p&&p("")},t.readAsArrayBuffer(e)},textParse:function(text,opts,noOptions){switch(opts=noOptions?opts||{}:$.extend({},{limit:n.limit,maxSize:n.maxSize,fileMaxSize:n.fileMaxSize,extensions:n.extensions?n.extensions.join(", "):null,captions:n.captions},opts),typeof text){case"string":for(var key in opts)-1<["name","file","type","size"].indexOf(key)&&(opts[key]=f._assets.escape(opts[key]));text=text.replace(/\$\{(.*?)\}/g,function(match,a){var a=a.replace(/ /g,""),r=void 0!==opts[a]&&null!=opts[a]?opts[a]:"";if(-1<["reader.node"].indexOf(a))return match;if(-1<a.indexOf(".")||-1<a.indexOf("[]")){var x=a.substr(0,-1<a.indexOf(".")?a.indexOf("."):-1<a.indexOf("[")?a.indexOf("["):a.length),y=a.substring(x.length);if(opts[x])try{r=eval('opts["'+x+'"]'+y)}catch(e){r=""}}return r=$.isFunction(r)?f._assets.textParse(r):r,r||""});break;case"function":text=f._assets.textParse(text(opts,l,p,o,s,f._assets.textParse),opts,noOptions)}return opts=null,text},textToColor:function(e){if(!e||0==e.length)return!1;for(var t=0,o=0;t<e.length;o=e.charCodeAt(t++)+((o<<5)-o));for(var t=0,i="#";t<3;i+=("00"+(o>>2*t++&255).toString(16)).slice(-2));return i},isBrightColor:function(e){var t,o;return 194<((o=(o=t=e)&&o.constructor==Array&&3==o.length?o:(t=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(o))?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:(t=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(o))?[2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3])]:(t=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(o))?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:(t=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(o))?[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]:"undefined"!=typeof colors?colors[$.trim(o).toLowerCase()]:null)?.2126*o[0]+.7152*o[1]+.0722*o[2]:null)},keyCompare:function(e,t){for(var o=0;o<t.length;o++)if(!$.isPlainObject(e)||!e.hasOwnProperty(t[o]))throw new Error('Could not find valid *strict* attribute "'+t[o]+'" in '+JSON.stringify(e,null,4));return!0},dialogs:{alert:n.dialogs.alert,confirm:n.dialogs.confirm},hasPlugin:function(e){if(navigator.plugins&&navigator.plugins.length)for(var t in navigator.plugins)if(navigator.plugins[t].name&&-1<navigator.plugins[t].name.toLowerCase().indexOf(e))return!0;return!1},isIE:function(){return-1<navigator.userAgent.indexOf("MSIE ")||-1<navigator.userAgent.indexOf("Trident/")||-1<navigator.userAgent.indexOf("Edge")},isMobile:function(){return void 0!==window.orientation||-1!==navigator.userAgent.indexOf("IEMobile")},getDevice:{options:[],header:[navigator.platform,navigator.userAgent,navigator.appVersion,navigator.vendor,window.opera],dataos:[{name:"Windows Phone",value:"Windows Phone",version:"OS"},{name:"Windows",value:"Win",version:"NT"},{name:"iPhone",value:"iPhone",version:"OS"},{name:"iPad",value:"iPad",version:"OS"},{name:"Kindle",value:"Silk",version:"Silk"},{name:"Android",value:"Android",version:"Android"},{name:"PlayBook",value:"PlayBook",version:"OS"},{name:"BlackBerry",value:"BlackBerry",version:"/"},{name:"Macintosh",value:"Mac",version:"OS X"},{name:"Linux",value:"Linux",version:"rv"},{name:"Palm",value:"Palm",version:"PalmOS"}],databrowser:[{name:"Chrome",value:"Chrome",version:"Chrome"},{name:"Firefox",value:"Firefox",version:"Firefox"},{name:"Safari",value:"Safari",version:"Version"},{name:"Internet Explorer",value:"MSIE",version:"MSIE"},{name:"Opera",value:"Opera",version:"Opera"},{name:"BlackBerry",value:"CLDC",version:"CLDC"},{name:"Mozilla",value:"Mozilla",version:"Mozilla"}],init:function(){var e=this.header.join(" ");return{os:this.matchItem(e,this.dataos),browser:this.matchItem(e,this.databrowser)}},matchItem:function(e,t){for(var o,i,n,r=0,a=0,r=0;r<t.length;r+=1)if(new RegExp(t[r].value,"i").test(e)){if(o=new RegExp(t[r].version+"[- /:;]([\\d._]+)","i"),n="",(i=e.match(o))&&i[1]&&(i=i[1]),i)for(i=i.split(/[._]+/),a=0;a<i.length;a+=1)n+=0===a?i[a]+".":i[a];else n="0";return{name:t[r].name,version:parseFloat(n)}}return{name:"unknown",version:0}}}},isSupported:function(){return s&&s.get(0).files},isFileReaderSupported:function(){return window.File&&window.FileList&&window.FileReader},isDefaultMode:function(){return!(n.upload||n.addMore&&1!=n.limit)},isAddMoreMode:function(){return!n.upload&&n.addMore&&1!=n.limit},isUploadMode:function(){return n.upload},_itFl:[],_pfuL:[],_pfrL:[],disabled:!1,locked:!1,rendered:!1};return n.enableApi&&(s.get(0).FileUploader={open:function(){s.trigger("click")},getOptions:function(){return n},getParentEl:function(){return p},getInputEl:function(){return s},getNewInputEl:function(){return o},getListEl:function(){return l},getListInputEl:function(){return n.listInput},getFiles:function(){return f._itFl},getChoosedFiles:function(){return f._itFl.filter(function(e){return e.choosed})},getAppendedFiles:function(){return f._itFl.filter(function(e){return e.appended})},getUploadedFiles:function(){return f._itFl.filter(function(e){return e.uploaded})},getFileList:function(e,t){return f.files.list(e,t,!0)},updateFileList:function(){return f.set("listInput",null),!0},setOption:function(e,t){return n[e]=t,!0},findFile:function(e){return f.files.find(e)},add:function(e,t,o){return!!f.isUploadMode()&&((t=e instanceof Blob?e:(e=/data:[a-z]+\/[a-z]+\;base64\,/.test(e)?e:"data:"+t+";base64,"+btoa(e),f._assets.dataURItoBlob(e,t)))._name=o||f._assets.generateFileName(-1!=t.type.indexOf("/")?t.type.split("/")[1].toString().toLowerCase():"File "),f.onChange(null,[t]),!0)},append:function(e){return f.files.append(e)},update:function(e,t){return f.files.update(e,t)},remove:function(e){return e=e.jquery?f.files.find(e):e,-1<f._itFl.indexOf(e)&&(f.files.remove(e),!0)},uploadStart:function(){var e=this.getChoosedFiles()||[];if(f.isUploadMode()&&0<e.length&&!e[0].uploaded)for(var t=0;t<e.length;t++)f.upload.send(e[t])},reset:function(){return f.reset(!0),!0},disable:function(e){return f.set("disabled",!0),e&&(f.locked=!0),!0},enable:function(){return f.set("disabled",!1),!(f.locked=!1)},destroy:function(){return f.destroy(),!0},isEmpty:function(){return 0==f._itFl.length},isDisabled:function(){return f.disabled},isRendered:function(){return f.rendered},assets:f._assets,getPluginMode:function(){return f.isDefaultMode()?"default":f.isAddMoreMode()?"addMore":f.isUploadMode()?"upload":void 0}}),f.init(),this})},$.fileuploader={getInstance:function(e){e=e.prop?e:$(e);return e.length?e.get(0).FileUploader:null}},$.fn.fileuploader.languages={cz:{button:function(e){return"Procházet "+(1==e.limit?"soubor":"soubory")},feedback:function(e){return"Vyberte "+(1==e.limit?"soubor":"soubory")+", který chcete nahrát"},feedback2:function(e){return e.length+" "+(1<e.length?"vybráno souborů":"vybrán soubor")},confirm:"Potvrdit",cancel:"Zrušeni",name:"Jméno",type:"Format",size:"Velikost",dimensions:"Rozměry",duration:"Trvání",crop:"Oříznout",rotate:"Otočit",sort:"Roztřídit",open:"Otevřít",download:"Stáhnout",remove:"Odstranit",drop:"Pro nahrání přetahněte soubor sem",paste:'<div class="fileuploader-pending-loader"></div> Vkládání souboru, klikněte zde pro zrušeni',removeConfirmation:"Jste si jisti, že chcete odstranit tento soubor?",errors:{filesLimit:function(e){return"Pouze ${limit} "+(1==e.limit?"soubor může být nahrán":"soubory mohou byt nahrané")+"."},filesType:"Pouze ${extensions} soubory mohou byt nahrané.",fileSize:"${name} příliš velký! Prosím, vyberte soubor do velikosti ${fileMaxSize} MB.",filesSizeAll:"Vybraný soubor je příliš velký! Prosím, vyberte soubor do velikosti ${maxSize} MB.",fileName:"Soubor s tímto názvem ${name} byl už vybran.",remoteFile:"Vzdálené soubory nejsou povoleny.",folderUpload:"Složky nejsou povolené."}},de:{button:function(e){return(1==e.limit?"Datei":"Dateien")+" durchsuchen"},feedback:function(e){return(1==e.limit?"Datei":"Dateien")+" zum Hochladen auswählen"},feedback2:function(e){return e.length+" "+(1==e.length?"Datei":"Dateien")+" ausgewählt"},confirm:"Speichern",cancel:"Schließen",name:"Name",type:"Typ",size:"Größe",dimensions:"Format",duration:"Länge",crop:"Crop",rotate:"Rotieren",sort:"Sortieren",open:"Öffnen",download:"Herunterladen",remove:"Löschen",drop:"Die Dateien hierher ziehen, um sie hochzuladen",paste:'<div class="fileuploader-pending-loader"></div> Eine Datei wird eingefügt. Klicken Sie hier zum abzubrechen',removeConfirmation:"Möchten Sie diese Datei wirklich löschen?",errors:{filesLimit:function(e){return"Nur ${limit} "+(1==e.limit?"Datei darf":"Dateien dürfen")+" hochgeladen werden."},filesType:"Nur ${extensions} Dateien dürfen hochgeladen werden.",fileSize:"${name} ist zu groß! Bitte wählen Sie eine Datei bis zu ${fileMaxSize} MB.",filesSizeAll:"Die ausgewählten Dateien sind zu groß! Bitte wählen Sie Dateien bis zu ${maxSize} MB.",fileName:"Eine Datei mit demselben Namen ${name} ist bereits ausgewählt.",remoteFile:"Remote-Dateien sind nicht zulässig.",folderUpload:"Ordner sind nicht erlaubt."}},dk:{button:function(e){return"Gennemse "+(1==e.limit?"fil":"filer")},feedback:function(e){return"Vælg "+(1==e.limit?"fil":"filer")+" til upload"},feedback2:function(e){return e.length+" "+(1==e.length?"fil":"filer")+" er valgt"},confirm:"Bekræft",cancel:"Fortrydl",name:"Navn",type:"Type",size:"Størrelse",dimensions:"Dimensioner",duration:"Varighed’",crop:"Tilpas",rotate:"Rotér",sort:"Sorter",open:"Åben",download:"Hent",remove:"Slet",drop:"Drop filer her til upload",paste:"Overfør fil, klik her for at afbryde",removeConfirmation:"Er du sikker på, du ønsker at slette denne fil?",errors:{filesLimit:function(e){return"Du kan kun uploade ${limit} "+(1==e.limit?"fil":"filer")+" ad gangen."},filesType:"Det er kun tilladt at uploade ${extensions} filer.",fileSize:"${name} er for stor! Vælg venligst en fil på højst ${fileMaxSize} MB.",filesSizeAll:"De valgte filer er for store! Vælg venligst filer op til ${maxSize} MB ialt.",fileName:"Du har allerede valgt en fil med navnet ${name}.",remoteFile:"Fremmede filer er ikke tilladt.",folderUpload:"Mapper er ikke tilladt."}},en:{button:function(e){return"Browse "+(1==e.limit?"file":"files")},feedback:function(e){return"Choose "+(1==e.limit?"file":"files")+" to upload"},feedback2:function(e){return e.length+" "+(1<e.length?" files were":" file was")+" chosen"},confirm:"Confirm",cancel:"Cancel",name:"Name",type:"Type",size:"Size",dimensions:"Dimensions",duration:"Duration",crop:"Crop",rotate:"Rotate",sort:"Sort",open:"Open",download:"Download",remove:"Delete",drop:"Drop the files here to upload",paste:'<div class="fileuploader-pending-loader"></div> Pasting a file, click here to cancel',removeConfirmation:"Are you sure you want to delete this file?",errors:{filesLimit:function(e){return"Only ${limit} "+(1==e.limit?"file":"files")+" can be uploaded."},filesType:"Only ${extensions} files are allowed to be uploaded.",fileSize:"${name} is too large! Please choose a file up to ${fileMaxSize} MB.",filesSizeAll:"The chosen files are too large! Please select files up to ${maxSize} MB.",fileName:"A file with the same name ${name} is already selected.",remoteFile:"Remote files are not allowed.",folderUpload:"Folders are not allowed."}},es:{button:function(e){return"Examinar "+(1==e.limit?"archivo":"archivos")},feedback:function(e){return"Selecciona "+(e.limit,"archivos")+" para subir"},feedback2:function(e){return e.length+" "+(1<e.length?"archivos seleccionados":"archivo seleccionado")},confirm:"Guardar",cancel:"Anular",name:"Nombre",type:"Tipo",size:"Tamaño",dimensions:"Dimensiones",duration:"Duracion",crop:"Corta",rotate:"Rotar",sort:"Ordenar",open:"Abierto",download:"Descargar",remove:"Eliminar",drop:"Suelta los archivos aquí para subirlos",paste:'<div class="fileuploader-pending-loader"></div> Pegar un archivo, haga clic aquí para cancelar',removeConfirmation:"¿Estás seguro de que deseas eliminar este archivo?",errors:{filesLimit:function(e){return"Solo se pueden seleccionar ${limit} "+(1==e.limit?"archivo":"archivos")+"."},filesType:"Solo se pueden seleccionar archivos ${extensions}.",fileSize:"${name} es demasiado grande! Por favor, seleccione un archivo hasta ${fileMaxSize} MB.",filesSizeAll:"¡Los archivos seleccionados son demasiado grandes! Por favor seleccione archivos de hasta ${maxSize} MB.",fileName:"Un archivo con el mismo nombre ${name} ya está seleccionado.",remoteFile:"Los archivos remotos no están permitidos.",folderUpload:"No se permiten carpetas."}},fr:{button:function(e){return"Parcourir "+(1==e.limit?"le fichier":"les fichiers")},feedback:function(e){return"Choisir "+(1==e.limit?"le fichier ":"les fichiers")+" à télécharger"},feedback2:function(e){return e.length+" "+(1<e.length?"fichiers ont été choisis":"fichier a été choisi")},confirm:"Confirmer",cancel:"Annuler",name:"Nom",type:"Type",size:"Taille",dimensions:"Dimensions",duration:"Durée",crop:"Recadrer",rotate:"Pivoter",sort:"Trier",download:"Télécharger",remove:"Supprimer",drop:"Déposez les fichiers ici pour les télécharger",paste:'<div class="fileuploader-pending-loader"></div> Collant un fichier, cliquez ici pour annuler.',removeConfirmation:"Êtes-vous sûr de vouloir supprimer ce fichier ?",errors:{filesLimit:"Seuls les fichiers ${limit} peuvent être téléchargés.",filesType:"Seuls les fichiers ${extensions} peuvent être téléchargés.",fileSize:"${name} est trop lourd, la limite est de ${fileMaxSize} MB.",filesSizeAll:"Les fichiers que vous avez choisis sont trop lourd, la limite totale est de ${maxSize} MB.",fileName:"Le fichier portant le nom ${name} est déjà sélectionné.",folderUpload:"Vous n'êtes pas autorisé à télécharger des dossiers."}},it:{button:function(e){return"Sfoglia"+(1==e.limit?"il file":"i file")},feedback:function(e){return"Seleziona "+(1==e.limit?"file":"i file")+" per caricare"},feedback2:function(e){return e.length+" "+(1<e.length?"i file sono scelti":"il file è scelto")},confirm:"Conferma",cancel:"Cancella",name:"Nome",type:"Tipo file",size:"Dimensione file",dimensions:"Dimensioni",duration:"Durata",crop:"Taglia",rotate:"Ruota",sort:"Ordina",open:"Apri",download:"Scarica",remove:"Elimina",drop:"Posiziona il file qui per caricare",paste:'<div class="fileuploader-pending-loader"></div> Incolla file, clicca qui per cancellare',removeConfirmation:"Sei sicuro di voler eliminare il file?",errors:{filesLimit:"Solo ${limit} file possono essere caricati.",filesType:"Solo ${extensions} file possono essere caricati.",fileSize:"${name} è troppo grande! Scegli un file fino a ${fileMaxSize} MB.",filesSizeAll:"I file selezioni sono troppo grandi! Scegli un file fino a ${maxSize} MB.",fileName:"Un file con lo stesso nome ${name} è già selezionato.",remoteFile:"I file remoti non sono consentiti.",folderUpload:"Le cartelle non sono consentite."}},lv:{button:function(e){return"Izvēlieties "+(1==e.limit?"fails":"faili")},feedback:function(e){return"Izvēliejaties "+(1==e.limit?"fails":"faili")+" lejupielādēt"},feedback2:function(e){return e.length+" "+(1<e.length?"failus izvelēts":"fails izvēlēts")},confirm:"Saglabāt",cancel:"Atcelt",name:"Vārds",type:"Formāts",size:"Izmērs",dimensions:"Izmēri",duration:"Ilgums",crop:"Nogriezt",rotate:"Pagriezt",sort:"Kārtot",open:"Atvērt",download:"Lejupielādēt",remove:"Dzēst",drop:"Lai augšupielādētu, velciet failus šeit",paste:'<div class="fileuploader-pending-loader"></div> Ievietojiet failu, noklikšķiniet šeit, lai atceltu',removeConfirmation:"Vai tiešām vēlaties izdzēst šo failu?",errors:{filesLimit:function(e){return"Tikai ${limit} "+(1==e.limit?"failu var augšupielādēt":"failus var augšupielādēt")+"."},filesType:"Tikai ${extensions} failus var augšupielādēt.",fileSize:"${name} ir par lielu! Lūdzu, atlasiet failu līdz ${fileMaxSize} MB.",filesSizeAll:"Atlasītie faili ir pārāk lieli! Lūdzu, atlasiet failus līdz ${maxSize} MB.",fileName:"Fails ar tādu pašu nosaukumu ${name} jau ir atlasīts.",remoteFile:"Attālie faili nav atļauti.",folderUpload:"Mapes nav atļautas."}},nl:{button:function(e){return(1==e.limit?"Bestand":"Bestanden")+" kiezen"},feedback:function(e){return"Kies "+(1==e.limit?"een bestand":"bestanden")+" om te uploaden"},feedback2:function(e){return e.length+" "+(1<e.length?"bestanden":"bestand")+" gekozen"},confirm:"Opslaan",cancel:"Annuleren",name:"Naam",type:"Type",size:"Grootte",dimensions:"Afmetingen",duration:"Duur",crop:"Uitsnijden",rotate:"Draaien",sort:"Sorteren",open:"Open",download:" Downloaden",remove:"Verwijderen",drop:"Laat de bestanden hier vallen om te uploaden",paste:'<div class="fileuploader-pending-loader"></div> Een bestand wordt geplakt, klik hier om te annuleren',removeConfirmation:"Weet u zeker dat u dit bestand wilt verwijderen?",errors:{filesLimit:function(e){return"Er "+(1==e.limit?"mag":"mogen")+" slechts ${limit} "+(1==e.limit?"bestand":"bestanden")+" worden geüpload."},filesType:"Alleen ${extensions} mogen worden geüpload.",fileSize:"${name} is te groot! Kies een bestand tot ${fileMaxSize} MB.",filesSizeAll:"De gekozen bestanden zijn te groot! Kies bestanden tot ${maxSize} MB.",fileName:"Een bestand met dezelfde naam ${name} is al gekozen.",remoteFile:"Externe bestanden zijn niet toegestaan.",folderUpload:"Mappen zijn niet toegestaan."}},pl:{button:function(e){return"Wybierz "+(1==e.limit?"plik":"pliki")},feedback:function(e){return"Wybierz "+(1==e.limit?"plik":"pliki")+" do przesłania"},feedback2:function(e){return e.length+" "+(1<e.length?"pliki zostały wybrane":"plik został wybrany")},confirm:"Potwierdź",cancel:"Anuluj",name:"Nazwa",type:"Typ",size:"Rozmiar",dimensions:"Wymiary",duration:"Czas trwania",crop:"Przytnij",rotate:"Obróć",sort:"Sortuj",open:"Otwórz",download:"Pobierz",remove:"Usuń",drop:"Upuść pliki tutaj do przesłania",paste:'<div class="fileuploader-pending-loader"></div> Wklejając plik, kliknij tutaj, aby anulować',removeConfirmation:"Czy jesteś pewien, że chcesz usunąć ten plik?",errors:{filesLimit:function(e){return"Tylko ${limit} "+(1==e.limit?"plik":"pliki")+" można wybrać."},filesType:"Tylko pliki ${extensions} mogą zostać pobrane.",fileSize:"Plik ${name} jest za duży! Proszę wybrać plik do ${fileMaxSize} MB.",filesSizeAll:"Wybrane pliki są za duże! Proszę wybrać pliki do ${maxSize} MB.",fileName:", Plik o tej samej nazwie ${name} już został wybrany.",remoteFile:"Zdalne pliki nie są dozwolone.",folderUpload:"Foldery nie są dozwolone."}},pt:{button:function(e){return"Escolher "+(1==e.limit?"arquivo":"arquivos")},feedback:function(e){return"Escolha "+(1==e.limit?"arquivo":"arquivos")+" a carregar"},feedback2:function(e){return e.length+" "+(1<e.length?"arquivos foram escolhidos":"arquivo foi escolhido")},confirm:"Confirmar",cancel:"Cancelar",name:"Nome",type:"Tipo",size:"Tamanho",dimensions:"Dimensões",duration:"Duração",crop:"Recorte",rotate:"Girar",sort:"Ordenar",open:"Abrir",download:"Baixar",remove:"Excluir",drop:"Solte os arquivos aqui para fazer o upload",paste:'<div class="fileuploader-pending-loader"></div> Colando um arquivo, clique aqui para cancelar',removeConfirmation:"Tem certeza de que deseja excluir este arquivo?",errors:{filesLimit:function(e){return"Apenas ${limit} "+(1==e.limit?"arquivo a ser carregado":"arquivos a serem carregados")+"."},filesType:"Somente arquivos ${extensions} podem ser carregados.",fileSize:"${name} é muito grande! Selecione um arquivo de até ${fileMaxSize} MB.",filesSizeAll:"Os arquivos selecionados são muito grandes! Selecione arquivos de até ${maxSize} MB.",fileName:"Um arquivo com o mesmo nome ${name} já está selecionado.",remoteFile:"Arquivos remotos não são permitidos.",folderUpload:"Pastas não são permitidas."}},ro:{button:function(e){return"Atașează "+(1==e.limit?"fișier":"fișiere")},feedback:function(e){return"Selectează "+(1==e.limit?"fișier":"fișiere")+" pentru încărcare"},feedback2:function(e){return e.length+" "+(1<e.length?" fișiere":" fișier")+" selectate"},confirm:"Confirmă",cancel:"Anulează",name:"Nume",type:"Tip",size:"Mărimea",dimensions:"Dimensiunea",duration:"Durata",crop:"Crop",rotate:"Rotire",sort:"Sortare",open:"Deschide",download:"Download",remove:"Șterge",drop:"Aruncați fișierele aici pentru a le încărca",paste:'<div class="fileuploader-pending-loader"></div> Se atașează fișier, faceți click aici pentru anulare',removeConfirmation:"Sigur doriți să ștergeți acest fișier?",errors:{filesLimit:function(e){return"Doar ${limit} "+(1==e.limit?"fișier poate fi selectat":"fișiere pot fi selectat")+"."},filesType:"Doar fișierele ${extensions} pot fi încărcate.",fileSize:"${name} este prea mare! Vă rugăm să selectați un fișier până la ${fileMaxSize} MB.",filesSizeAll:"Fișierele selectate sunt prea mari! Vă rugăm să selectați fișiere până la ${maxSize} MB.",fileName:"Fișierul cu același numele ${nume} a fost deja selectat.",remoteFile:"Fișierele remote nu sunt permise.",folderUpload:"Folderele nu sunt permise."}},ru:{button:function(e){return"Выбрать "+(1==e.limit?"файл":"файлы")},feedback:function(e){return"Выберите "+(1==e.limit?"файл":"файлы")+" для загрузки"},feedback2:function(e){return e.length+" "+(1<e.length?"файлов выбрано":"файл выбран")},confirm:"Сохранить",cancel:"Отмена",name:"Имя",type:"Формат",size:"Размер",dimensions:"Размеры",duration:"Длительность",crop:"Обрезать",rotate:"Повернуть",sort:"Сортировть",open:"Открыть",download:"Скачать",remove:"Удалить",drop:"Перетащите файлы сюда для загрузки",paste:'<div class="fileuploader-pending-loader"></div> Вставка файла, нажмите здесь, чтобы отменить',removeConfirmation:"Вы уверены, что хотите удалить этот файл?",errors:{filesLimit:function(e){return"Только ${limit} "+(1==e.limit?"файл может быть загружен":"файлов могут быть загружены")+"."},filesType:"Только ${extensions} файлы могут быть загружены.",fileSize:"${name} слишком большой! Пожалуйста, выберите файл до ${fileMaxSize} МБ.",filesSizeAll:"Выбранные файлы слишком большие! Пожалуйста, выберите файлы до ${maxSize} МБ.",fileName:"Файл с таким именем ${name} уже выбран.",remoteFile:"Удаленные файлы не допускаются.",folderUpload:"Папки не допускаются."}},tr:{button:function(e){return(1==e.limit?"Dosya":"Dosyaları")+" seç"},feedback:function(e){return"Yüklemek istediğiniz "+(1==e.limit?"dosyayı":"dosyaları")+" seçin."},feedback2:function(e){return e.length+" "+(1<e.length?"dosyalar":"dosya")+" seçildi."},confirm:"Onayla",cancel:"İptal",name:"İsim",type:"Tip",size:"Boyut",dimensions:"Boyutlar",duration:"Süre",crop:"Kırp",rotate:"Döndür",sort:"Sırala",open:"Aç",download:"İndir",remove:"Sil",drop:"Yüklemek için dosyaları buraya bırakın",paste:'<div class="fileuploader-pending-loader"></div> Bir dosyayı yapıştırmak veya iptal etmek için buraya tıklayın',removeConfirmation:"Bu dosyayı silmek istediğinizden emin misiniz?",errors:{filesLimit:function(e){return"Sadece ${limit} "+(1==e.limit?"dosya":"dosyalar")+" yüklenmesine izin verilir."},filesType:"Sadece ${extensions} dosyaların yüklenmesine izin verilir.",fileSize:"${name} çok büyük! Lütfen ${fileMaxSize} MB'a kadar bir dosya seçin.",filesSizeAll:"Seçilen dosyalar çok büyük! Lütfen ${maxSize} MB'a kadar dosyaları seçin",fileName:"Aynı ada sahip bir dosya ${name} zaten seçilmiştir.",remoteFile:"Uzak dosyalara izin verilmez.",folderUpload:"Klasörlere izin verilmez."}}},$.fn.fileuploader.defaults={limit:null,maxSize:null,fileMaxSize:null,extensions:null,disallowedExtensions:null,changeInput:!0,inputNameBrackets:!0,theme:"default",thumbnails:{box:'<div class="fileuploader-items"><ul class="fileuploader-items-list"></ul></div>',boxAppendTo:null,item:'<li class="fileuploader-item"><div class="columns"><div class="column-thumbnail">${image}<span class="fileuploader-action-popup"></span></div><div class="column-title"><div title="${name}">${name}</div><span>${size2}</span></div><div class="column-actions"><button type="button" class="fileuploader-action fileuploader-action-remove" title="${captions.remove}"><i class="fileuploader-icon-remove"></i></a></div></div><div class="progress-bar2">${progressBar}<span></span></div></li>',item2:'<li class="fileuploader-item"><div class="columns"><div class="column-thumbnail">${image}<span class="fileuploader-action-popup"></span></div><div class="column-title"><a href="${file}" target="_blank"><div title="${name}">${name}</div><span>${size2}</span></a></div><div class="column-actions"><a href="${data.url}" class="fileuploader-action fileuploader-action-download" title="${captions.download}" download><i class="fileuploader-icon-download"></i></a><button type="button" class="fileuploader-action fileuploader-action-remove" title="${captions.remove}"><i class="fileuploader-icon-remove"></i></a></div></div></li>',popup:{container:"body",loop:!0,arrows:!0,zoomer:!0,template:function(e){return'<div class="fileuploader-popup-preview"><button type="button" class="fileuploader-popup-move" data-action="prev"><i class="fileuploader-icon-arrow-left"></i></button><div class="fileuploader-popup-node node-${format}">${reader.node}</div><div class="fileuploader-popup-content"><div class="fileuploader-popup-footer"><ul class="fileuploader-popup-tools">'+("image"==e.format&&e.reader.node&&e.editor?(e.editor.cropper?'<li><button type="button" data-action="crop"><i class="fileuploader-icon-crop"></i> ${captions.crop}</button></li>':"")+(e.editor.rotate?'<li><button type="button" data-action="rotate-cw"><i class="fileuploader-icon-rotate"></i> ${captions.rotate}</button></li>':""):"")+("image"==e.format?'<li class="fileuploader-popup-zoomer"><button type="button" data-action="zoom-out">−</button><input type="range" min="0" max="100"><button type="button" data-action="zoom-in">+</button><span></span> </li>':"")+(e.data.url?'<li><a href="'+e.data.url+'" data-action="open" target="_blank"><i class="fileuploader-icon-external"></i> ${captions.open}</a></li>':"")+'<li><button type="button" data-action="remove"><i class="fileuploader-icon-trash"></i> ${captions.remove}</button></li></ul></div><div class="fileuploader-popup-header"><ul class="fileuploader-popup-meta"><li><span>${captions.name}:</span><h5>${name}</h5></li><li><span>${captions.type}:</span><h5>${extension.toUpperCase()}</h5></li><li><span>${captions.size}:</span><h5>${size2}</h5></li>'+(e.reader&&e.reader.width?"<li><span>${captions.dimensions}:</span><h5>${reader.width}x${reader.height}px</h5></li>":"")+(e.reader&&e.reader.duration?"<li><span>${captions.duration}:</span><h5>${reader.duration2}</h5></li>":"")+'</ul><div class="fileuploader-popup-info"></div><ul class="fileuploader-popup-buttons"><li><button type="button" class="fileuploader-popup-button" data-action="cancel">${captions.cancel}</a></li>'+(e.editor?'<li><button type="button" class="fileuploader-popup-button button-success" data-action="save">${captions.confirm}</button></li>':"")+'</ul></div></div><button type="button" class="fileuploader-popup-move" data-action="next"><i class="fileuploader-icon-arrow-right"></i></button></div>'},onShow:function(t){t.popup.html.on("click",'[data-action="remove"]',function(e){t.popup.close(),t.remove()}).on("click",'[data-action="cancel"]',function(e){t.popup.close()}).on("click",'[data-action="save"]',function(e){t.editor&&t.editor.save(),t.popup.close&&t.popup.close()})},onHide:null},itemPrepend:!1,removeConfirmation:!0,startImageRenderer:!0,synchronImages:!0,useObjectUrl:!1,canvasImage:!0,videoThumbnail:!0,pdf:!0,exif:!1,touchDelay:0,_selectors:{list:".fileuploader-items-list",item:".fileuploader-item",start:".fileuploader-action-start",retry:".fileuploader-action-retry",remove:".fileuploader-action-remove",sorter:".fileuploader-action-sort",rotate:".fileuploader-action-rotate",popup:".fileuploader-popup-preview",popup_open:".fileuploader-action-popup"},beforeShow:null,onItemShow:null,onItemRemove:function(e){e.children().animate({opacity:0},200,function(){setTimeout(function(){e.slideUp(200,function(){e.remove()})},100)})},onImageLoaded:null},editor:!1,sorter:!1,reader:{thumbnailTimeout:5e3,timeout:12e3,maxSize:20},files:null,upload:null,dragDrop:!0,addMore:!1,skipFileNameCheck:!1,clipboardPaste:!0,listInput:!0,enableApi:!1,listeners:null,onSupportError:null,beforeRender:null,afterRender:null,beforeSelect:null,onFilesCheck:null,onFileRead:null,onSelect:null,afterSelect:null,onListInput:null,onRemove:null,onEmpty:null,dialogs:{alert:function(e){return alert(e)},confirm:function(e,t){confirm(e)&&t()}},captions:$.fn.fileuploader.languages.en}});
|