0&&void 0!==arguments[0]?arguments[0]:{},i=r.duration,o=void 0===i?500:i,a=r.easing,s=void 0===a?g:a,l=r.delay,u=void 0===l?0:l,c=null,d=!0,f=!1,p=null,h=n({interpolate:function(n,r){d||null===p||(null===c&&(c=n),n-c=o||r?(e=1,t=f?0:1,h.onupdate(t*p),h.oncomplete(t*p),d=!0):(t=e/o,h.onupdate((e>=0?s(f?1-t:t):0)*p))))},target:{get:function(){return f?0:p},set:function(e){if(null===p)return p=e,h.onupdate(e),void h.oncomplete(e);e3&&void 0!==arguments[3]&&arguments[3];(t=Array.isArray(t)?t:[t]).forEach((function(t){e.forEach((function(e){var i=e,o=function(){return n[e]},a=function(t){return n[e]=t};"object"==typeof e&&(i=e.key,o=e.getter||o,a=e.setter||a),t[i]&&!r||(t[i]={get:o,set:a})}))}))},_=function(e){return null!=e},y={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},T={styles:function(e){var t=e.mixinConfig,n=e.viewProps,r=e.viewInternalAPI,i=e.viewExternalAPI,o=e.view,a=Object.assign({},n),s={};E(t,[r,i],n);var l=function(){return o.rect?f(o.rect,o.childViews,[n.translateX||0,n.translateY||0],[n.scaleX||0,n.scaleY||0]):null};return r.rect={get:l},i.rect={get:l},t.forEach((function(e){n[e]=void 0===a[e]?y[e]:a[e]})),{write:function(){if(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}(s,n))return function(e,t){var n=t.opacity,r=t.perspective,i=t.translateX,o=t.translateY,a=t.scaleX,s=t.scaleY,l=t.rotateX,u=t.rotateY,c=t.rotateZ,d=t.originX,f=t.originY,p=t.width,h=t.height,m="",g="";(_(d)||_(f))&&(g+="transform-origin: "+(d||0)+"px "+(f||0)+"px;"),_(r)&&(m+="perspective("+r+"px) "),(_(i)||_(o))&&(m+="translate3d("+(i||0)+"px, "+(o||0)+"px, 0) "),(_(a)||_(s))&&(m+="scale3d("+(_(a)?a:1)+", "+(_(s)?s:1)+", 1) "),_(c)&&(m+="rotateZ("+c+"rad) "),_(l)&&(m+="rotateX("+l+"rad) "),_(u)&&(m+="rotateY("+u+"rad) "),m.length&&(g+="transform:"+m+";"),_(n)&&(g+="opacity:"+n+";",0===n&&(g+="visibility:hidden;"),n<1&&(g+="pointer-events:none;")),_(h)&&(g+="height:"+h+"px;"),_(p)&&(g+="width:"+p+"px;");var v=e.elementCurrentStyle||"";g.length===v.length&&g===v||(e.style.cssText=g,e.elementCurrentStyle=g)}(o.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),i=[],o=(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){i.push({type:e,fn:t}),o(e,t)},n.off=function(e,t){i.splice(i.findIndex((function(n){return n.type===e&&n.fn===t})),1),a(e,t)},{write:function(){return!0},destroy:function(){i.forEach((function(e){a(e.type,e.fn)}))}}},animations:function(e){var n=e.mixinConfig,r=e.viewProps,i=e.viewInternalAPI,o=e.viewExternalAPI,a=Object.assign({},r),s=[];return t(n,(function(e,t){var n=function(e,t,n){var r=e[t]&&"object"==typeof e[t][n]?e[t][n]:e[t]||e,i="string"==typeof r?r:r.type,o="object"==typeof r?Object.assign({},r):{};return v[i]?v[i](o):null}(t);n&&(n.onupdate=function(t){r[e]=t},n.target=a[e],E([{key:e,setter:function(e){n.target!==e&&(n.target=e)},getter:function(){return r[e]}}],[i,o],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;E(t,r,n)}},I=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},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.tag,r=void 0===t?"div":t,i=e.name,o=void 0===i?null:i,u=e.attributes,c=void 0===u?{}:u,p=e.read,h=void 0===p?function(){}:p,m=e.write,g=void 0===m?function(){}:m,v=e.create,E=void 0===v?function(){}:v,_=e.destroy,y=void 0===_?function(){}:_,b=e.filterFrameActionsForChild,w=void 0===b?function(e,t){return t}:b,S=e.didCreateView,D=void 0===S?function(){}:S,R=e.didWriteView,C=void 0===R?function(){}:R,A=e.ignoreRect,O=void 0!==A&&A,x=e.ignoreRectUpdate,L=void 0!==x&&x,P=e.mixins,M=void 0===P?[]:P;return function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=a(r,"filepond--"+o,c),p=window.getComputedStyle(u,null),m=I(),v=null,_=!1,b=[],S=[],R={},A={},x=[g],P=[h],N=[y],G=function(){return u},F=function(){return b.concat()},k=function(){return v||(v=f(m,b,[0,0],[1,1]))},U={element:{get:G},style:{get:function(){return p}},childViews:{get:F}},V=Object.assign({},U,{rect:{get:k},ref:{get:function(){return R}},is:function(e){return o===e},appendChild:(t=u,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 b.push(e),e},unlinkView:function(e){b.splice(b.indexOf(e),1)},appendChildView:s(0,b),removeChildView:l(u,b),registerWriter:function(e){return x.push(e)},registerReader:function(e){return P.push(e)},registerDestroyer:function(e){return N.push(e)},invalidateLayout:function(){return u.layoutCalculated=!1},dispatch:e.dispatch,query:e.query}),B={element:{get:G},childViews:{get:F},rect:{get:k},resting:{get:function(){return _}},isRectIgnored:function(){return O},_read:function(){v=null,b.forEach((function(e){return e._read()})),!(L&&m.width&&m.height)&&I(m,u,p);var e={root:q,props:i,rect:m};P.forEach((function(t){return t(e)}))},_write:function(e,t,n){var r=0===t.length;return x.forEach((function(o){!1===o({props:i,root:q,actions:t,timestamp:e,shouldOptimize:n})&&(r=!1)})),S.forEach((function(t){!1===t.write(e)&&(r=!1)})),b.filter((function(e){return!!e.element.parentNode})).forEach((function(i){i._write(e,w(i,t),n)||(r=!1)})),b.forEach((function(i,o){i.element.parentNode||(q.appendChild(i.element,o),i._read(),i._write(e,w(i,t),n),r=!1)})),_=r,C({props:i,root:q,actions:t,timestamp:e}),r},_destroy:function(){S.forEach((function(e){return e.destroy()})),N.forEach((function(e){e({root:q,props:i})})),b.forEach((function(e){return e._destroy()}))}},j=Object.assign({},U,{rect:{get:function(){return m}}});Object.keys(M).sort((function(e,t){return"styles"===e?1:"styles"===t?-1:0})).forEach((function(e){var t=T[e]({mixinConfig:M[e],viewProps:i,viewState:A,viewInternalAPI:V,viewExternalAPI:B,view:n(j)});t&&S.push(t)}));var q=n(V);E({root:q,props:i});var H=d(u);return b.forEach((function(e,t){q.appendChild(e.element,H+t)})),D(q),n(B)}},w=function(e,t){return function(n){var r=n.root,i=n.props,o=n.actions,a=void 0===o?[]:o,s=n.timestamp,l=n.shouldOptimize;a.filter((function(t){return e[t.type]})).forEach((function(t){return e[t.type]({root:r,props:i,action:t.data,timestamp:s,shouldOptimize:l})})),t&&t({root:r,props:i,actions:a,timestamp:s,shouldOptimize:l})}},S=function(e,t){return t.parentNode.insertBefore(e,t)},D=function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},R=function(e){return Array.isArray(e)},C=function(e){return null==e},A=function(e){return e.trim()},O=function(e){return""+e},x=function(e){return"boolean"==typeof e},L=function(e){return x(e)?e:"true"===e},P=function(e){return"string"==typeof e},M=function(e){return m(e)?e:P(e)?O(e).replace(/[a-z]+/gi,""):0},N=function(e){return parseInt(M(e),10)},G=function(e){return parseFloat(M(e))},F=function(e){return m(e)&&isFinite(e)&&Math.floor(e)===e},k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(F(e))return e;var n=O(e).trim();return/MB$/i.test(n)?(n=n.replace(/MB$i/,"").trim(),N(n)*t*t):/KB/i.test(n)?(n=n.replace(/KB$i/,"").trim(),N(n)*t):N(n)},U=function(e){return"function"==typeof e},V={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},B=function(e){return"object"==typeof e&&null!==e},j=function(e){return R(e)?"array":function(e){return null===e}(e)?"null":F(e)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(e)?"bytes":function(e){return B(e)&&P(e.url)&&B(e.process)&&B(e.revert)&&B(e.restore)&&B(e.fetch)}(e)?"api":typeof e},q={array:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return C(e)?[]:R(e)?e:O(e).split(t).map(A).filter((function(e){return e.length}))},boolean:L,int:function(e){return"bytes"===j(e)?k(e):N(e)},number:G,float:G,bytes:k,string:function(e){return U(e)?e:O(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=P(n=e)?n:n.url||"",r.timeout=n.timeout?parseInt(n.timeout,10):0,r.headers=n.headers?n.headers:{},t(V,(function(e){r[e]=function(e,t,n,r,i){if(null===t)return null;if("function"==typeof t)return t;var o={url:"GET"===n||"PATCH"===n?"?"+e+"=":"",method:n,headers:i,withCredentials:!1,timeout:r,onload:null,ondata:null,onerror:null};if(P(t))return o.url=t,o;if(Object.assign(o,t),P(o.headers)){var a=o.headers.split(/:(.+)/);o.headers={header:a[0],value:a[1]}}return o.withCredentials=L(o.withCredentials),o}(e,n[e],V[e],r.timeout,r.headers)})),r.process=n.process||P(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}}},H=function(e,t,n){if(e===t)return e;var r,i=j(e);if(i!==n){var o=(r=e,q[n](r));if(i=j(o),null===o)throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+n+'"';e=o}return e},W=function(e){var r={};return t(e,(function(t){var n,i,o,a=e[t];r[t]=(n=a[0],i=a[1],o=n,{enumerable:!0,get:function(){return o},set:function(e){o=H(e,n,i)}})})),n(r)},Y=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)},z=function(e){return function(n,r,i){var o={};return t(e,(function(e){var t=Y(e,"_").toUpperCase();o["SET_"+t]=function(r){try{i.options[e]=r.value}catch(e){}n("DID_SET_"+t,{value:i.options[e]})}})),o}},X=function(e){return function(n){var r={};return t(e,(function(e){r["GET_"+Y(e,"_").toUpperCase()]=function(t){return n.options[e]}})),r}},$=function(){return Math.random().toString(36).substring(2,11)};function K(e){this.wrapped=e}function Q(e){var t,n;function r(t,n){try{var o=e[t](n),a=o.value,s=a instanceof K;Promise.resolve(s?a.wrapped:a).then((function(e){s?r("next",e):i(o.done?"return":"normal",e)}),(function(e){r("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null};n?n=n.next=s:(t=n=s,r(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function Z(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1?t-1:0),i=1;i1?t-1:0),i=1;iBrowse',ce.STRING],labelInvalidField:["Field contains invalid files",ce.STRING],labelFileWaitingForSize:["Waiting for size",ce.STRING],labelFileSizeNotAvailable:["Size not available",ce.STRING],labelFileCountSingular:["file in list",ce.STRING],labelFileCountPlural:["files in list",ce.STRING],labelFileLoading:["Loading",ce.STRING],labelFileAdded:["Added",ce.STRING],labelFileLoadError:["Error during load",ce.STRING],labelFileRemoved:["Removed",ce.STRING],labelFileRemoveError:["Error during remove",ce.STRING],labelFileProcessing:["Uploading",ce.STRING],labelFileProcessingComplete:["Upload complete",ce.STRING],labelFileProcessingAborted:["Upload cancelled",ce.STRING],labelFileProcessingError:["Error during upload",ce.STRING],labelFileProcessingRevertError:["Error during revert",ce.STRING],labelTapToCancel:["tap to cancel",ce.STRING],labelTapToRetry:["tap to retry",ce.STRING],labelTapToUndo:["tap to undo",ce.STRING],labelButtonRemoveItem:["Remove",ce.STRING],labelButtonAbortItemLoad:["Abort",ce.STRING],labelButtonRetryItemLoad:["Retry",ce.STRING],labelButtonAbortItemProcessing:["Cancel",ce.STRING],labelButtonUndoItemProcessing:["Undo",ce.STRING],labelButtonRetryItemProcessing:["Retry",ce.STRING],labelButtonProcessItem:["Upload",ce.STRING],iconRemove:['',ce.STRING],iconProcess:['',ce.STRING],iconRetry:['',ce.STRING],iconUndo:['',ce.STRING],iconDone:['',ce.STRING],oninit:[null,ce.FUNCTION],onwarning:[null,ce.FUNCTION],onerror:[null,ce.FUNCTION],onactivatefile:[null,ce.FUNCTION],oninitfile:[null,ce.FUNCTION],onaddfilestart:[null,ce.FUNCTION],onaddfileprogress:[null,ce.FUNCTION],onaddfile:[null,ce.FUNCTION],onprocessfilestart:[null,ce.FUNCTION],onprocessfileprogress:[null,ce.FUNCTION],onprocessfileabort:[null,ce.FUNCTION],onprocessfilerevert:[null,ce.FUNCTION],onprocessfile:[null,ce.FUNCTION],onprocessfiles:[null,ce.FUNCTION],onremovefile:[null,ce.FUNCTION],onpreparefile:[null,ce.FUNCTION],onupdatefiles:[null,ce.FUNCTION],onreorderfiles:[null,ce.FUNCTION],beforeDropFile:[null,ce.FUNCTION],beforeAddFile:[null,ce.FUNCTION],beforeRemoveFile:[null,ce.FUNCTION],beforePrepareFile:[null,ce.FUNCTION],stylePanelLayout:[null,ce.STRING],stylePanelAspectRatio:[null,ce.STRING],styleItemPanelAspectRatio:[null,ce.STRING],styleButtonRemoveItemPosition:["left",ce.STRING],styleButtonProcessItemPosition:["right",ce.STRING],styleLoadIndicatorPosition:["right",ce.STRING],styleProgressIndicatorPosition:["right",ce.STRING],styleButtonRemoveItemAlign:[!1,ce.BOOLEAN],files:[[],ce.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],ce.ARRAY]},ve=function(e,t){return C(t)?e[0]||null:F(t)?e[t]||null:("object"==typeof t&&(t=t.id),e.find((function(e){return e.id===t}))||null)},Ee=function(e){if(C(e))return e;if(/:/.test(e)){var t=e.split(":");return t[1]/t[0]}return parseFloat(e)},_e=function(e){return e.filter((function(e){return!e.archived}))},ye={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4},Te=null,Ie=[ae.LOAD_ERROR,ae.PROCESSING_ERROR,ae.PROCESSING_REVERT_ERROR],be=[ae.LOADING,ae.PROCESSING,ae.PROCESSING_QUEUED,ae.INIT],we=[ae.PROCESSING_COMPLETE],Se=function(e){return Ie.includes(e.status)},De=function(e){return be.includes(e.status)},Re=function(e){return we.includes(e.status)},Ce=function(e){return B(e.options.server)&&(B(e.options.server.process)||U(e.options.server.process))},Ae=function(e){return{GET_STATUS:function(){var t=_e(e.items),n=ye.EMPTY,r=ye.ERROR,i=ye.BUSY,o=ye.IDLE,a=ye.READY;return 0===t.length?n:t.some(Se)?r:t.some(De)?i:t.some(Re)?a:o},GET_ITEM:function(t){return ve(e.items,t)},GET_ACTIVE_ITEM:function(t){return ve(_e(e.items),t)},GET_ACTIVE_ITEMS:function(){return _e(e.items)},GET_ITEMS:function(){return e.items},GET_ITEM_NAME:function(t){var n=ve(e.items,t);return n?n.filename:null},GET_ITEM_SIZE:function(t){var n=ve(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:Ee(e.options.stylePanelAspectRatio)},GET_ITEM_PANEL_ASPECT_RATIO:function(){return e.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function(t){return _e(e.items).filter((function(e){return e.status===t}))},GET_TOTAL_ITEMS:function(){return _e(e.items).length},SHOULD_UPDATE_FILE_INPUT:function(){return e.options.storeAsFile&&function(){if(null===Te)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,Te=1===t.files.length}catch(e){Te=!1}return Te}()&&!Ce(e)},IS_ASYNC:function(){return Ce(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}}}},Oe=function(e,t,n){return Math.max(Math.min(n,e),t)},xe=function(e){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(e)},Le=function(e){return(""+e).split("/").pop().split("?").shift()},Pe=function(e){return e.split(".").pop()},Me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(t+e).slice(-t.length)},Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return e.getFullYear()+"-"+Me(e.getMonth()+1,"00")+"-"+Me(e.getDate(),"00")+"_"+Me(e.getHours(),"00")+"-"+Me(e.getMinutes(),"00")+"-"+Me(e.getSeconds(),"00")},Ge=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,i="string"==typeof n?e.slice(0,e.size,n):e.slice(0,e.size,e.type);return i.lastModifiedDate=new Date,e._relativePath&&(i._relativePath=e._relativePath),P(t)||(t=Ne()),t&&null===r&&Pe(t)?i.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:""}(i.type),i.name=t+(r?"."+r:"")),i},Fe=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})},ke=function(e){return(/^data:(.+);/.exec(e)||[])[1]||null},Ue=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},Ve=function(e){if(/content-length:/i.test(e)){var t=e.match(/[0-9]+/)[0];return t?parseInt(t,10):null}return null},Be=function(e){return/x-content-transfer-id:/i.test(e)&&(e.split(":")[1]||"").trim()||null},je=function(e){var t={source:null,name:null,size:null},n=e.split("\n"),r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value,u=Ue(l);if(u)t.name=u;else{var c=Ve(l);if(c)t.size=c;else{var d=Be(l);d&&(t.source=d)}}}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return t},qe=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=Ge(e,e.name||Le(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,i){i&&(t.size=i),t.duration=Date.now()-t.timestamp,e?(t.progress=n/i,r.fire("progress",t.progress)):t.progress=null}),(function(){r.fire("abort")}),(function(e){var n=je("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({},ne(),{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=t.source;r.fire("init",e),e instanceof File?r.fire("load",e):e instanceof Blob?r.fire("load",Ge(e,e.name)):xe(e)?r.fire("load",Ge(function(e){var t=ke(e);return function(e,t){for(var n=new ArrayBuffer(e.length),r=new Uint8Array(n),i=0;i=200&&a.status<300?r.onload(a):r.onerror(a)},a.onerror=function(){return r.onerror(a)},a.onabort=function(){i=!0,r.onabort()},a.ontimeout=function(){return r.ontimeout(a)},a.open(n.method,t,!0),F(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},Ye=function(e,t,n,r){return{type:e,code:t,body:n,headers:r}},ze=function(e){return function(t){e(Ye("error",0,"Timeout",t.getAllResponseHeaders()))}},Xe=function(e){return/\?/.test(e)},$e=function(){for(var e="",t=arguments.length,n=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if("function"==typeof t)return t;if(!t||!P(t.url))return null;var n=t.onload||function(e){return e},r=t.onerror||function(e){return null};return function(i,o,a,s,l,u){var c=We(i,$e(e,t.url),Object.assign({},t,{responseType:"blob"}));return c.onload=function(e){var r=e.getAllResponseHeaders(),a=je(r).name||Le(i);o(Ye("load",e.status,"HEAD"===t.method?null:Ge(n(e.response),a),r))},c.onerror=function(e){a(Ye("error",e.status,r(e.response)||e.statusText,e.getAllResponseHeaders()))},c.onheaders=function(e){u(Ye("headers",e.status,null,e.getAllResponseHeaders()))},c.ontimeout=ze(a),c.onprogress=s,c.onabort=l,c}},Qe=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,i=new Array(e),o=0;or.chunkSize,p=d&&(f||r.chunkForce);if(i instanceof Blob&&p)return function(e,t,n,r,i,o,a,s,l,u,c){for(var d=[],f=c.chunkTransferId,p=c.chunkServer,h=c.chunkSize,m=c.chunkRetryDelays,g={serverId:f,aborted:!1},v=t.ondata||function(e){return e},E=t.onload||function(e,t){return"HEAD"===t?e.getResponseHeader("Upload-Offset"):e.response},_=t.onerror||function(e){return null},y=Math.floor(r.size/h),T=0;T<=y;T++){var I=T*h,b=r.slice(I,I+h,"application/offset+octet-stream");d[T]={index:T,size:b.size,offset:I,data:b,file:r,progress:0,retries:Z(m),status:0,error:null,request:null,timeout:null}}var w,S,D,R,C=function(e){return 0===e.status||3===e.status},A=function(t){if(!g.aborted)if(t=t||d.find(C)){t.status=2,t.progress=null;var n=p.ondata||function(e){return e},i=p.onerror||function(e){return null},s=$e(e,p.url,g.serverId),u="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}),c=t.request=We(n(t.data),s,Object.assign({},p,{headers:u}));c.onload=function(){t.status=1,t.request=null,L()},c.onprogress=function(e,n,r){t.progress=e?n:null,x()},c.onerror=function(e){t.status=3,t.request=null,t.error=i(e.response)||e.statusText,O(t)||a(Ye("error",e.status,i(e.response)||e.statusText,e.getAllResponseHeaders()))},c.ontimeout=function(e){t.status=3,t.request=null,O(t)||ze(a)(e)},c.onabort=function(){t.status=0,t.request=null,l()}}else d.every((function(e){return 1===e.status}))&&o(g.serverId)},O=function(e){return 0!==e.retries.length&&(e.status=4,clearTimeout(e.timeout),e.timeout=setTimeout((function(){A(e)}),e.retries.shift()),!0)},x=function(){var e=d.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=d.reduce((function(e,t){return e+t.size}),0);s(!0,e,t)},L=function(){d.filter((function(e){return 2===e.status})).length>=1||A()};return g.serverId?(w=function(e){g.aborted||(d.filter((function(t){return t.offset0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if("function"==typeof t)return t;if(!t||!P(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(i,o,a){var s=We(i,e+t.url,t);return s.onload=function(e){o(Ye("load",e.status,n(e.response),e.getAllResponseHeaders()))},s.onerror=function(e){a(Ye("error",e.status,r(e.response)||e.statusText,e.getAllResponseHeaders()))},s.ontimeout=ze(a),s}},Je=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)},et=function(e){return e.substring(0,e.lastIndexOf("."))||e},tt=function(e){return!!(e instanceof File||e instanceof Blob&&e.name)},nt=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,i=$(),o={archived:!1,frozen:!1,released:!1,source:null,file:r,serverFileReference:t,transferId:null,processingAborted:!1,status:t?ae.PROCESSING_COMPLETE:ae.INIT,activeLoader:null,activeProcessor:null},a=null,s={},l=function(e){return o.status=e},u=function(e){if(!o.released&&!o.frozen){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{},r=n.query,i=n.success,o=void 0===i?function(){}:i,a=n.failure,s=void 0===a?function(){}:a,l=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,["query","success","failure"]),u=ve(e.items,r);u?t(u,o,s,l||{}):s({error:Ye("error",0,"Item not found"),file:null})}},dt=function(e,t,n){return{ABORT_ALL:function(){_e(n.items).forEach((function(e){e.freeze(),e.abortLoad(),e.abortProcessing()}))},DID_SET_FILES:function(t){var r=t.value,i=(void 0===r?[]:r).map((function(e){return{source:e.source?e.source:e,options:e.options}})),o=_e(n.items);o.forEach((function(t){i.find((function(e){return e.source===t.source||e.source===t.file}))||e("REMOVE_ITEM",{query:t,remove:!1})})),o=_e(n.items),i.forEach((function(t,n){o.find((function(e){return e.source===t.source||e.file===t.source}))||e("ADD_ITEM",Object.assign({},t,{interactionMethod:5,index:n}))}))},DID_UPDATE_ITEM_METADATA:function(r){var i=r.id,o=r.action,a=r.change;a.silent||(clearTimeout(n.itemUpdateTimeout),n.itemUpdateTimeout=setTimeout((function(){var r=rt(n.items,i);if(t("IS_ASYNC")){r.origin===se.LOCAL&&e("DID_LOAD_ITEM",{id:r.id,error:null,serverFileReference:r.source});var s,l=function(){setTimeout((function(){e("REQUEST_ITEM_PROCESSING",{query:i})}),32)};return r.status===ae.PROCESSING_COMPLETE?(s=n.options.instantUpload,void r.revert(Ze(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")).then(s?l:function(){}).catch((function(){}))):r.status===ae.PROCESSING?function(e){r.abortProcessing().then(e?l:function(){})}(n.options.instantUpload):void(n.options.instantUpload&&l())}fe("SHOULD_PREPARE_OUTPUT",!1,{item:r,query:t,action:o,change:a}).then((function(n){var o=t("GET_BEFORE_PREPARE_FILE");o&&(n=o(r,n)),n&&e("REQUEST_PREPARE_OUTPUT",{query:i,item:r,success:function(t){e("DID_PREPARE_OUTPUT",{id:i,file:t})}},!0)}))}),0))},MOVE_ITEM:function(e){var t=e.query,r=e.index,i=ve(n.items,t);if(i){var o=n.items.indexOf(i);o!==(r=Oe(r,0,n.items.length-1))&&n.items.splice(r,0,n.items.splice(o,1)[0])}},SORT:function(r){var i=r.compare;ut(n,i),e("DID_SORT_ITEMS",{items:t("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function(n){var r=n.items,i=n.index,o=n.interactionMethod,a=n.success,s=void 0===a?function(){}:a,l=n.failure,u=void 0===l?function(){}:l,c=i;if(-1===i||void 0===i){var d=t("GET_ITEM_INSERT_LOCATION"),f=t("GET_TOTAL_ITEMS");c="before"===d?0:f}var p=t("GET_IGNORED_FILES"),h=r.filter((function(e){return tt(e)?!p.includes(e.name.toLowerCase()):!C(e)})).map((function(t){return new Promise((function(n,r){e("ADD_ITEM",{interactionMethod:o,source:t.source||t,success:n,failure:r,index:c++,options:t.options||{}})}))}));Promise.all(h).then(s).catch(u)},ADD_ITEM:function(r){var i=r.source,o=r.index,a=void 0===o?-1:o,s=r.interactionMethod,l=r.success,u=void 0===l?function(){}:l,c=r.failure,d=void 0===c?function(){}:c,f=r.options,p=void 0===f?{}:f;if(C(i))d({error:Ye("error",0,"No source"),file:null});else if(!tt(i)||!n.options.ignoredFiles.includes(i.name.toLowerCase())){if(!function(e){var t=_e(e.items).length;if(!e.options.allowMultiple)return 0===t;var n=e.options.maxFiles;return null===n||t=400&&t.code<500)return e("DID_THROW_ITEM_INVALID",{id:y,error:t,status:{main:r,sub:t.code+" ("+t.body+")"}}),void d({error:t,file:oe(E)});e("DID_THROW_ITEM_LOAD_ERROR",{id:y,error:t,status:{main:r,sub:n.options.labelTapToRetry}})})),E.on("load-file-error",(function(t){e("DID_THROW_ITEM_INVALID",{id:y,error:t.status,status:t.status}),d({error:t.status,file:oe(E)})})),E.on("load-abort",(function(){e("REMOVE_ITEM",{query:y})})),E.on("load-skip",(function(){E.on("metadata-update",(function(t){tt(E.file)&&e("DID_UPDATE_ITEM_METADATA",{id:y,change:t})})),e("COMPLETE_LOAD_ITEM",{query:y,item:E,data:{source:i,success:u}})})),E.on("load",(function(){var r=function(r){r?(E.on("metadata-update",(function(t){e("DID_UPDATE_ITEM_METADATA",{id:y,change:t})})),fe("SHOULD_PREPARE_OUTPUT",!1,{item:E,query:t}).then((function(r){var o=t("GET_BEFORE_PREPARE_FILE");o&&(r=o(E,r));var a=function(){e("COMPLETE_LOAD_ITEM",{query:y,item:E,data:{source:i,success:u}}),st(e,n)};r?e("REQUEST_PREPARE_OUTPUT",{query:y,item:E,success:function(t){e("DID_PREPARE_OUTPUT",{id:y,file:t}),a()}},!0):a()}))):e("REMOVE_ITEM",{query:y})};fe("DID_LOAD_ITEM",E,{query:t,dispatch:e}).then((function(){lt(t("GET_BEFORE_ADD_FILE"),oe(E)).then(r)})).catch((function(t){if(!t||!t.error||!t.status)return r(!1);e("DID_THROW_ITEM_INVALID",{id:y,error:t.error,status:t.status})}))})),E.on("process-start",(function(){e("DID_START_ITEM_PROCESSING",{id:y})})),E.on("process-progress",(function(t){e("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:y,progress:t})})),E.on("process-error",(function(t){e("DID_THROW_ITEM_PROCESSING_ERROR",{id:y,error:t,status:{main:at(n.options.labelFileProcessingError)(t),sub:n.options.labelTapToRetry}})})),E.on("process-revert-error",(function(t){e("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:y,error:t,status:{main:at(n.options.labelFileProcessingRevertError)(t),sub:n.options.labelTapToRetry}})})),E.on("process-complete",(function(t){e("DID_COMPLETE_ITEM_PROCESSING",{id:y,error:null,serverFileReference:t}),e("DID_DEFINE_VALUE",{id:y,value:t})})),E.on("process-abort",(function(){e("DID_ABORT_ITEM_PROCESSING",{id:y})})),E.on("process-revert",(function(){e("DID_REVERT_ITEM_PROCESSING",{id:y}),e("DID_DEFINE_VALUE",{id:y,value:null})})),e("DID_ADD_ITEM",{id:y,index:a,interactionMethod:s}),st(e,n);var T=n.options.server||{},I=T.url,b=T.load,w=T.restore,S=T.fetch;E.load(i,qe(v===se.INPUT?P(i)&&function(e){return(e.indexOf(":")>-1||e.indexOf("//")>-1)&&ot(location.href)!==ot(e)}(i)&&S?Ke(I,S):it:Ke(I,v===se.LIMBO?w:b)),(function(e,n,r){fe("LOAD_FILE",e,{query:t}).then(n).catch(r)}))}},REQUEST_PREPARE_OUTPUT:function(e){var n=e.item,r=e.success,i=e.failure,o=void 0===i?function(){}:i,a={error:Ye("error",0,"Item not found"),file:null};if(n.archived)return o(a);fe("PREPARE_OUTPUT",n.file,{query:t,item:n}).then((function(e){fe("COMPLETE_PREPARE_OUTPUT",e,{query:t,item:n}).then((function(e){if(n.archived)return o(a);r(e)}))}))},COMPLETE_LOAD_ITEM:function(r){var i=r.item,o=r.data,a=o.success,s=o.source,l=t("GET_ITEM_INSERT_LOCATION");if(U(l)&&s&&ut(n,l),e("DID_LOAD_ITEM",{id:i.id,error:null,serverFileReference:i.origin===se.INPUT?null:s}),a(oe(i)),i.origin!==se.LOCAL)return i.origin===se.LIMBO?(e("DID_COMPLETE_ITEM_PROCESSING",{id:i.id,error:null,serverFileReference:s}),void e("DID_DEFINE_VALUE",{id:i.id,value:i.serverId||s})):void(t("IS_ASYNC")&&n.options.instantUpload&&e("REQUEST_ITEM_PROCESSING",{query:i.id}));e("DID_LOAD_LOCAL_ITEM",{id:i.id})},RETRY_ITEM_LOAD:ct(n,(function(e){e.retryLoad()})),REQUEST_ITEM_PREPARE:ct(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:ct(n,(function(r,i,o){if(r.status===ae.IDLE||r.status===ae.PROCESSING_ERROR)r.status!==ae.PROCESSING_QUEUED&&(r.requestProcessing(),e("DID_REQUEST_ITEM_PROCESSING",{id:r.id}),e("PROCESS_ITEM",{query:r,success:i,failure:o},!0));else{var a=function(){return e("REQUEST_ITEM_PROCESSING",{query:r,success:i,failure:o})},s=function(){return document.hidden?a():setTimeout(a,32)};r.status===ae.PROCESSING_COMPLETE||r.status===ae.PROCESSING_REVERT_ERROR?r.revert(Ze(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")).then(s).catch((function(){})):r.status===ae.PROCESSING&&r.abortProcessing().then(s)}})),PROCESS_ITEM:ct(n,(function(r,i,o){var a=t("GET_MAX_PARALLEL_UPLOADS");if(t("GET_ITEMS_BY_STATUS",ae.PROCESSING).length!==a){if(r.status!==ae.PROCESSING){var s=function t(){var r=n.processingQueue.shift();if(r){var i=r.id,o=r.success,a=r.failure,s=ve(n.items,i);s&&!s.archived?e("PROCESS_ITEM",{query:i,success:o,failure:a},!0):t()}};r.onOnce("process-complete",(function(){i(oe(r)),s();var o=n.options.server;if(n.options.instantUpload&&r.origin===se.LOCAL&&U(o.remove)){var a=function(){};r.origin=se.LIMBO,n.options.server.remove(r.source,a,a)}t("GET_ITEMS_BY_STATUS",ae.PROCESSING_COMPLETE).length===n.items.length&&e("DID_COMPLETE_ITEM_PROCESSING_ALL")})),r.onOnce("process-error",(function(e){o({error:e,file:oe(r)}),s()}));var l=n.options;r.process(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,i=function(){n.request&&(n.perceivedPerformanceUpdater.clear(),n.request.abort&&n.request.abort(),n.complete=!0)},o=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({},ne(),{process:function(t,i){var o=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>3&&void 0!==arguments[3]?arguments[3]:25,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,i=null,o=Date.now();return t>0&&function a(){var s=Date.now()-o,l=Je(n,r);s+l>t&&(l=s+l-t);var u=s/t;u>=1||document.hidden?e(1):(e(u),i=setTimeout(a,l))}(),{clear:function(){clearTimeout(i)}}}((function(e){n.perceivedProgress=e,n.perceivedDuration=Date.now()-n.timestamp,o(),n.response&&1===n.perceivedProgress&&!n.complete&&a()}),r?Je(750,1500):0),n.request=e(t,i,(function(e){n.response=B(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",B(e)?e:{type:"error",code:0,body:""+e})}),(function(e,t,r){n.duration=Date.now()-n.timestamp,n.progress=e?t/r:null,o()}),(function(){n.perceivedPerformanceUpdater.clear(),s.fire("abort",n.response?n.response.body:null)}),(function(e){s.fire("transfer",e)}))},abort:i,getProgress:o,getDuration:a,reset:function(){i(),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}(Qe(l.server.url,l.server.process,l.name,{chunkTransferId:r.transferId,chunkServer:l.server.patch,chunkUploads:l.chunkUploads,chunkForce:l.chunkForce,chunkSize:l.chunkSize,chunkRetryDelays:l.chunkRetryDelays}),{allowMinimumUploadDuration:t("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(function(n,i,o){fe("PREPARE_OUTPUT",n,{query:t,item:r}).then((function(t){e("DID_PREPARE_OUTPUT",{id:r.id,file:t}),i(t)})).catch(o)}))}}else n.processingQueue.push({id:r.id,success:i,failure:o})})),RETRY_ITEM_PROCESSING:ct(n,(function(t){e("REQUEST_ITEM_PROCESSING",{query:t})})),REQUEST_REMOVE_ITEM:ct(n,(function(n){lt(t("GET_BEFORE_REMOVE_FILE"),oe(n)).then((function(t){t&&e("REMOVE_ITEM",{query:n})}))})),RELEASE_ITEM:ct(n,(function(e){e.release()})),REMOVE_ITEM:ct(n,(function(r,i,o,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),i(oe(r))},l=n.options.server;r.origin===se.LOCAL&&l&&U(l.remove)&&!1!==a.remove?(e("DID_START_ITEM_REMOVE",{id:r.id}),l.remove(r.source,(function(){return s()}),(function(t){e("DID_THROW_ITEM_REMOVE_ERROR",{id:r.id,error:Ye("error",0,t,null),status:{main:at(n.options.labelFileRemoveError)(t),sub:n.options.labelTapToRetry}})}))):((a.revert&&r.origin!==se.LOCAL&&null!==r.serverId||n.options.chunkUploads&&r.file.size>n.options.chunkSize||n.options.chunkUploads&&n.options.chunkForce)&&r.revert(Ze(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")),s())})),ABORT_ITEM_LOAD:ct(n,(function(e){e.abortLoad()})),ABORT_ITEM_PROCESSING:ct(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:ct(n,(function(r){if(n.options.instantUpload){var i=function(t){t&&e("REVERT_ITEM_PROCESSING",{query:r})},o=t("GET_BEFORE_REMOVE_FILE");if(!o)return i(!0);var a=o(oe(r));return null==a?i(!0):"boolean"==typeof a?i(a):void("function"==typeof a.then&&a.then(i))}e("REVERT_ITEM_PROCESSING",{query:r})})),REVERT_ITEM_PROCESSING:ct(n,(function(r){r.revert(Ze(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")).then((function(){(n.options.instantUpload||function(e){return!tt(e.file)}(r))&&e("REMOVE_ITEM",{query:r.id})})).catch((function(){}))})),SET_OPTIONS:function(t){var n=t.options,r=Object.keys(n),i=ft.filter((function(e){return r.includes(e)}));[].concat(Z(i),Z(Object.keys(n).filter((function(e){return!i.includes(e)})))).forEach((function(t){e("SET_"+Y(t,"_").toUpperCase(),{value:n[t]})}))}}},ft=["server"],pt=function(e){return document.createElement(e)},ht=function(e,t){var n=e.childNodes[0];n?t!==n.nodeValue&&(n.nodeValue=t):(n=document.createTextNode(t),e.appendChild(n))},mt=function(e,t,n,r){var i=(r%360-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}},gt=b({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 i=parseInt(r(t.ref.path,"stroke-width"),10),o=.5*t.rect.element.width,a=0,s=0;n.spin?(a=0,s=.5):(a=0,s=n.progress);var l=function(e,t,n,r,i){var o=1;return i>r&&i-r<=.5&&(o=0),r>i&&r-i>=.5&&(o=0),function(e,t,n,r,i,o){var a=mt(e,t,n,i),s=mt(e,t,n,r);return["M",a.x,a.y,"A",n,n,0,o,0,s.x,s.y].join(" ")}(e,t,n,360*Math.min(.9999,r),360*Math.min(.9999,i),o)}(o,o,o-i,a,s);r(t.ref.path,"d",l),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}}}}),vt=b({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||"")+""+n.label+"",n.isDisabled=!1},write:function(e){var t=e.root,n=e.props,i=n.isDisabled,o=t.query("GET_DISABLED")||0===n.opacity;o&&!i?(n.isDisabled=!0,r(t.element,"disabled","disabled")):!o&&i&&(n.isDisabled=!1,t.element.removeAttribute("disabled"))}}),Et=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]:{},i=r.labelBytes,o=void 0===i?"bytes":i,a=r.labelKilobytes,s=void 0===a?"KB":a,l=r.labelMegabytes,u=void 0===l?"MB":l,c=r.labelGigabytes,d=void 0===c?"GB":c,f=n,p=n*n,h=n*n*n;return(e=Math.round(Math.abs(e)))0&&(t.height=t.ref.container.rect.element.height)),i&&(t.ref.panel.height=null),t.ref.panel.height=t.height})),Kt=b({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(qt,{id:n.id})),t.ref.panel=t.appendChildView(t.createChildView(Wt,{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,i=e.pageX,o=e.pageY;n.dragOrigin={x:t.translateX,y:t.translateY},n.dragCenter={x:e.offsetX,y:e.offsetY};var a,s,l,u=(a=t.query("GET_ACTIVE_ITEMS"),s=a.map((function(e){return e.id})),l=void 0,{setIndex:function(e){l=e},getIndex:function(){return l},getItemIndex:function(e){return s.indexOf(e.id)}});t.dispatch("DID_GRAB_ITEM",{id:n.id,dragState:u});var c=function(e){e.isPrimary&&(e.stopPropagation(),e.preventDefault(),n.dragOffset={x:e.pageX-i,y:e.pageY-o},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:u}))},d=function(e){e.isPrimary&&(n.dragOffset={x:e.pageX-i,y:e.pageY-o},p())},f=function(){p()},p=function(){document.removeEventListener("pointercancel",f),document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",d),t.dispatch("DID_DROP_ITEM",{id:n.id,dragState:u}),r&&setTimeout((function(){return t.element.addEventListener("click",t.ref.handleClick)}),0)};document.addEventListener("pointercancel",f),document.addEventListener("pointermove",c),document.addEventListener("pointerup",d)}})))},write:$t,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:Yt,translateY:Yt,opacity:{type:"tween",duration:150}}}}),Qt=function(e,t){return Math.max(1,Math.floor((e+1)/t))},Zt=function(e,t,n){if(n){var r=e.rect.element.width,i=t.length,o=null;if(0===i||n.topE){if(n.left<_)return m;o=m!==i-1?m:null}}return null!==o?o:i}},Jt={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)}},en=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=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&&tn(e,t,n,r,i),e.scaleX=1,e.scaleY=1,e.opacity=1))},tn=function(e,t,n,r,i){5===e.interactionMethod?(e.translateX=null,e.translateX=t,e.translateY=null,e.translateY=n):2===e.interactionMethod?(e.translateX=null,e.translateX=t-20*r,e.translateY=null,e.translateY=n-10*i,e.scaleX=.8,e.scaleY=.8):3===e.interactionMethod?(e.translateY=null,e.translateY=n-30):1===e.interactionMethod&&(e.translateX=null,e.translateX=t-30,e.translateY=null)},nn=function(e){return e.rect.element.height+.5*e.rect.element.marginBottom+.5*e.rect.element.marginTop},rn=w({DID_ADD_ITEM:function(e){var t=e.root,n=e.action,r=n.id,i=n.index,o=n.interactionMethod;t.ref.addIndex=i;var a=Date.now(),s=a,l=1;if(5!==o){l=0;var u=t.query("GET_ITEM_INSERT_INTERVAL"),c=a-t.ref.lastItemSpanwDate;s=cs&&(h=s);var m=Math.floor(s/h+1);Jt.setHeight=f*m,Jt.setWidth=p*h;var g={y:Math.floor(d/f),x:Math.floor(c/p),getGridIndex:function(){return d>Jt.getHeight||d<0||c>Jt.getWidth||c<0?l:this.y*h+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}))})),i=r.findIndex((function(e){return e===a})),o=nn(a),s=r.length,l=s,u=0,c=0,f=0,p=0;pp){if(d1?g.getGridIndex():g.getColIndex();t.dispatch("MOVE_ITEM",{query:a,index:v});var E=i.getIndex();if(void 0===E||E!==v){if(i.setIndex(v),void 0===E)return;t.dispatch("DID_REORDER_ITEMS",{items:t.query("GET_ACTIVE_ITEMS"),origin:l,target:v})}}}}),on=b({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,i=e.shouldOptimize;rn({root:t,props:n,actions:r});var o=n.dragCoordinates,a=t.rect.element.width,s=t.childViews.filter((function(e){return e.rect.element.height})),l=t.query("GET_ACTIVE_ITEMS").map((function(e){return s.find((function(t){return t.id===e.id}))})).filter((function(e){return e})),u=o?Zt(t,l,o):null,c=t.ref.addIndex||null;t.ref.addIndex=null;var d=0,f=0,p=0;if(0!==l.length){var h=l[0].rect.element,m=h.marginTop+h.marginBottom,g=h.marginLeft+h.marginRight,v=h.width+g,E=h.height+m,_=Qt(a,v);if(1===_){var y=0,T=0;l.forEach((function(e,t){if(u){var n=t-u;T=-2===n?.25*-m:-1===n?.75*-m:0===n?.75*m:1===n?.25*m:0}i&&(e.translateX=null,e.translateY=null),e.markedForRemoval||en(e,0,y+T);var r=(e.rect.element.height+m)*(e.markedForRemoval?e.opacity:1);y+=r}))}else{var I=0,b=0;l.forEach((function(e,t){t===u&&(d=1),t===c&&(p+=1),e.markedForRemoval&&e.opacity<.5&&(f-=1);var n=t+p+d+f,r=n%_,o=Math.floor(n/_),a=r*v,s=o*E,l=Math.sign(a-I),h=Math.sign(s-b);I=a,b=s,e.markedForRemoval||(i&&(e.translateX=null,e.translateY=null),en(e,a,s,l,h))}))}}},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"]}}),an=w({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}}),sn=b({create:function(e){var t=e.root,n=e.props;t.ref.list=t.appendChildView(t.createChildView(on)),n.dragCoordinates=null,n.overflowing=!1},write:function(e){var t=e.root,n=e.props,r=e.actions;if(an({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 i=Math.round(n.overflow);i!==t.height&&(n.overflowing=!0,t.element.dataset.state="overflow",t.height=i)}},name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),ln=function(e,t,n){n?r(e,t,arguments.length>3&&void 0!==arguments[3]?arguments[3]:""):e.removeAttribute(t)},un=function(e){var t=e.root,n=e.action;t.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&ln(t.element,"accept",!!n.value,n.value?n.value.join(","):"")},cn=function(e){var t=e.root,n=e.action;ln(t.element,"multiple",n.value)},dn=function(e){var t=e.root,n=e.action;ln(t.element,"webkitdirectory",n.value)},fn=function(e){var t=e.root,n=t.query("GET_DISABLED"),r=t.query("GET_ALLOW_BROWSE"),i=n||!r;ln(t.element,"disabled",i)},pn=function(e){var t=e.root;e.action.value?0===t.query("GET_TOTAL_ITEMS")&&ln(t.element,"required",!0):ln(t.element,"required",!1)},hn=function(e){var t=e.root,n=e.action;ln(t.element,"capture",!!n.value,!0===n.value?"":n.value)},mn=function(e){var t=e.root,n=t.element;t.query("GET_TOTAL_ITEMS")>0?(ln(n,"required",!1),ln(n,"name",!1)):(ln(n,"name",!0,t.query("GET_NAME")),t.query("GET_CHECK_VALIDITY")&&n.setCustomValidity(""),t.query("GET_REQUIRED")&&ln(n,"required",!0))},gn=b({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),un({root:t,action:{value:t.query("GET_ACCEPTED_FILE_TYPES")}}),cn({root:t,action:{value:t.query("GET_ALLOW_MULTIPLE")}}),dn({root:t,action:{value:t.query("GET_ALLOW_DIRECTORIES_ONLY")}}),fn({root:t}),pn({root:t,action:{value:t.query("GET_REQUIRED")}}),hn({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=pt("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:w({DID_LOAD_ITEM:mn,DID_REMOVE_ITEM:mn,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:fn,DID_SET_ALLOW_BROWSE:fn,DID_SET_ALLOW_DIRECTORIES_ONLY:dn,DID_SET_ALLOW_MULTIPLE:cn,DID_SET_ACCEPTED_FILE_TYPES:un,DID_SET_CAPTURE_METHOD:hn,DID_SET_REQUIRED:pn})}),vn=function(e,t){e.innerHTML=t;var n=e.querySelector(".filepond--label-action");return n&&r(n,"tabindex","0"),t},En=b({name:"drop-label",ignoreRect:!0,create:function(e){var t=e.root,n=e.props,i=pt("label");r(i,"for","filepond--browser-"+n.id),r(i,"id","filepond--drop-label-"+n.id),r(i,"aria-hidden","true"),t.ref.handleKeyDown=function(e){(13===e.keyCode||32===e.keyCode)&&(e.preventDefault(),t.ref.label.click())},t.ref.handleClick=function(e){e.target===i||i.contains(e.target)||t.ref.label.click()},i.addEventListener("keydown",t.ref.handleKeyDown),t.element.addEventListener("click",t.ref.handleClick),vn(i,n.caption),t.appendChild(i),t.ref.label=i},destroy:function(e){var t=e.root;t.ref.label.addEventListener("keydown",t.ref.handleKeyDown),t.element.removeEventListener("click",t.ref.handleClick)},write:w({DID_SET_LABEL_IDLE:function(e){var t=e.root,n=e.action;vn(t.ref.label,n.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),_n=b({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}}}}),yn=w({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(_n,{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)}}),Tn=b({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:function(e){var t=e.root,n=e.props,r=e.actions;yn({root:t,props:n,actions:r});var i=t.ref.blob;0===r.length&&i&&0===i.opacity&&(t.removeChildView(i),t.ref.blob=null)}}),In=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},bn=function(e,t){return e.ref.fields[t]},wn=function(e){e.query("GET_ACTIVE_ITEMS").forEach((function(t){e.ref.fields[t.id]&&e.element.appendChild(e.ref.fields[t.id])}))},Sn=function(e){var t=e.root;return wn(t)},Dn=w({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===se.LOCAL)&&t.query("SHOULD_UPDATE_FILE_INPUT"),i=pt("input");i.type=r?"file":"hidden",i.name=t.query("GET_NAME"),i.disabled=t.query("GET_DISABLED"),t.ref.fields[n.id]=i,wn(t)},DID_LOAD_ITEM:function(e){var t=e.root,n=e.action,r=bn(t,n.id);if(r&&(null!==n.serverFileReference&&(r.value=n.serverFileReference),t.query("SHOULD_UPDATE_FILE_INPUT"))){var i=t.query("GET_ITEM",n.id);In(r,[i.file])}},DID_REMOVE_ITEM:function(e){var t=e.root,n=e.action,r=bn(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=bn(t,n.id);r&&(null===n.value?r.removeAttribute("value"):"file"!=r.type&&(r.value=n.value),wn(t))},DID_PREPARE_OUTPUT:function(e){var t=e.root,n=e.action;t.query("SHOULD_UPDATE_FILE_INPUT")&&setTimeout((function(){var e=bn(t,n.id);e&&In(e,[n.file])}),0)},DID_REORDER_ITEMS:Sn,DID_SORT_ITEMS:Sn}),Rn=b({tag:"fieldset",name:"data",create:function(e){return e.root.ref.fields={}},write:Dn,ignoreRect:!0}),Cn=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],An=["css","csv","html","txt"],On={zip:"zip|compressed",epub:"application/epub+zip"},xn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=e.toLowerCase(),Cn.includes(e)?"image/"+("jpg"===e?"jpeg":"svg"===e?"svg+xml":e):An.includes(e)?"text/"+e:On[e]||""},Ln=function(e){return new Promise((function(t,n){var r=jn(e);if(r.length&&!Pn(e))return t(r);Mn(e).then(t)}))},Pn=function(e){return!!e.files&&e.files.length>0},Mn=function(e){return new Promise((function(t,n){var r=(e.items?Array.from(e.items):[]).filter((function(e){return Nn(e)})).map((function(e){return Gn(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):[])}))},Nn=function(e){if(Vn(e)){var t=Bn(e);if(t)return t.isFile||t.isDirectory}return"file"===e.kind},Gn=function(e){return new Promise((function(t,n){Un(e)?Fn(Bn(e)).then(t).catch(n):t([e.getAsFile()])}))},Fn=function(e){return new Promise((function(t,n){var r=[],i=0,o=0,a=function(){0===o&&0===i&&t(r)};!function e(t){i++;var s=t.createReader();!function t(){s.readEntries((function(n){if(0===n.length)return i--,void a();n.forEach((function(t){t.isDirectory?e(t):(o++,t.file((function(e){var n=kn(e);t.fullPath&&(n._relativePath=t.fullPath),r.push(n),o--,a()})))})),t()}),n)}()}(e)}))},kn=function(e){if(e.type.length)return e;var t=e.lastModifiedDate,n=e.name,r=xn(Pe(e.name));return r.length?((e=e.slice(0,e.size,r)).name=n,e.lastModifiedDate=t,e):e},Un=function(e){return Vn(e)&&(Bn(e)||{}).isDirectory},Vn=function(e){return"webkitGetAsEntry"in e},Bn=function(e){return e.webkitGetAsEntry()},jn=function(e){var t=[];try{if((t=Hn(e)).length)return t;t=qn(e)}catch(e){}return t},qn=function(e){var t=e.getData("url");return"string"==typeof t&&t.length?[t]:[]},Hn=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[]},Wn=[],Yn=function(e){return{pageLeft:e.pageX,pageTop:e.pageY,scopeLeft:e.offsetX||e.layerX,scopeTop:e.offsetY||e.layerY}},zn=function(e){var n=[],r={dragenter:Qn,dragover:Zn,dragleave:er,drop:Jn},i={};t(r,(function(t,r){i[t]=r(e,n),e.addEventListener(t,i[t],!1)}));var o={element:e,addListener:function(a){return n.push(a),function(){n.splice(n.indexOf(a),1),0===n.length&&(Wn.splice(Wn.indexOf(o),1),t(r,(function(t){e.removeEventListener(t,i[t],!1)})))}}};return o},Xn=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)},$n=null,Kn=function(e,t){try{e.dropEffect=t}catch(e){}},Qn=function(e,t){return function(e){e.preventDefault(),$n=e.target,t.forEach((function(t){var n=t.element,r=t.onenter;Xn(e,n)&&(t.state="enter",r(Yn(e)))}))}},Zn=function(e,t){return function(e){e.preventDefault();var n=e.dataTransfer;Ln(n).then((function(r){var i=!1;t.some((function(t){var o=t.filterElement,a=t.element,s=t.onenter,l=t.onexit,u=t.ondrag,c=t.allowdrop;Kn(n,"copy");var d=c(r);if(d)if(Xn(e,a)){if(i=!0,null===t.state)return t.state="enter",void s(Yn(e));if(t.state="over",o&&!d)return void Kn(n,"none");u(Yn(e))}else o&&!i&&Kn(n,"none"),t.state&&(t.state=null,l(Yn(e)));else Kn(n,"none")}))}))}},Jn=function(e,t){return function(e){e.preventDefault();var n=e.dataTransfer;Ln(n).then((function(n){t.forEach((function(t){var r=t.filterElement,i=t.element,o=t.ondrop,a=t.onexit,s=t.allowdrop;if(t.state=null,!r||Xn(e,i))return s(n)?void o(Yn(e),n):a(Yn(e))}))}))}},er=function(e,t){return function(e){$n===e.target&&t.forEach((function(t){var n=t.onexit;t.state=null,n(Yn(e))}))}},tr=function(e,t,n){e.classList.add("filepond--hopper");var r=n.catchesDropsOnPage,i=n.requiresDropOnElement,o=n.filterItems,a=void 0===o?function(e){return e}:o,s=function(e,t,n){var r=function(e){var t=Wn.find((function(t){return t.element===e}));if(t)return t;var n=zn(e);return Wn.push(n),n}(t),i={element:e,filterElement:n,state:null,ondrop:function(){},onenter:function(){},ondrag:function(){},onexit:function(){},onload:function(){},allowdrop:function(){}};return i.destroy=r.addListener(i),i}(e,r?document.documentElement:e,i),l="",u="";s.allowdrop=function(e){return t(a(e))},s.ondrop=function(e,n){var r=a(n);t(r)?(u="drag-drop",c.onload(r,e)):c.ondragend(e)},s.ondrag=function(e){c.ondrag(e)},s.onenter=function(e){u="drag-over",c.ondragstart(e)},s.onexit=function(e){u="drag-exit",c.ondragend(e)};var c={updateHopperState:function(){l!==u&&(e.dataset.hopperState=u,l=u)},onload:function(){},ondragstart:function(){},ondrag:function(){},ondragend:function(){},destroy:function(){s.destroy()}};return c},nr=!1,rr=[],ir=function(e){var t=document.activeElement;if(t&&/textarea|input/i.test(t.nodeName)){for(var n=!1,r=t;r!==document.body;){if(r.classList.contains("filepond--root")){n=!0;break}r=r.parentNode}if(!n)return}Ln(e.clipboardData).then((function(e){e.length&&rr.forEach((function(t){return t(e)}))}))},or=null,ar=null,sr=[],lr=function(e,t){e.element.textContent=t},ur=function(e,t,n){var r=e.query("GET_TOTAL_ITEMS");lr(e,n+" "+t+", "+r+" "+(1===r?e.query("GET_LABEL_FILE_COUNT_SINGULAR"):e.query("GET_LABEL_FILE_COUNT_PLURAL"))),clearTimeout(ar),ar=setTimeout((function(){!function(e){e.element.textContent=""}(e)}),1500)},cr=function(e){return e.element.parentNode.contains(document.activeElement)},dr=function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename,i=t.query("GET_LABEL_FILE_PROCESSING_ABORTED");lr(t,r+" "+i)},fr=function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename;lr(t,n.status.main+" "+r+" "+n.status.sub)},pr=b({create:function(e){var t=e.root,n=e.props;t.element.id="filepond--assistant-"+n.id,r(t.element,"role","status"),r(t.element,"aria-live","polite"),r(t.element,"aria-relevant","additions")},ignoreRect:!0,ignoreRectUpdate:!0,write:w({DID_LOAD_ITEM:function(e){var t=e.root,n=e.action;if(cr(t)){t.element.textContent="";var r=t.query("GET_ITEM",n.id);sr.push(r.filename),clearTimeout(or),or=setTimeout((function(){ur(t,sr.join(", "),t.query("GET_LABEL_FILE_ADDED")),sr.length=0}),750)}},DID_REMOVE_ITEM:function(e){var t=e.root,n=e.action;if(cr(t)){var r=n.item;ur(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,i=t.query("GET_LABEL_FILE_PROCESSING_COMPLETE");lr(t,r+" "+i)},DID_ABORT_ITEM_PROCESSING:dr,DID_REVERT_ITEM_PROCESSING:dr,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"}),hr=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()}))},mr=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(),i=null;return function(){for(var o=arguments.length,a=new Array(o),s=0;s1?(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:Ye("warning",0,"Max files")}),!0):!(!r&&n||!(F(o=r?o:1)&&i+a>o)||(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:Ye("warning",0,"Max files")}),0))},Er=function(e,t,n){var r=e.childViews[0];return Zt(r,t,{left:n.scopeLeft-r.rect.element.left,top:n.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},_r=function(e){var t=e.query("GET_ALLOW_DROP"),n=e.query("GET_DISABLED"),r=t&&!n;if(r&&!e.ref.hopper){var i=tr(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 pe("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!tt(e)||!n.includes(e.name.toLowerCase())}))},catchesDropsOnPage:e.query("GET_DROP_ON_PAGE"),requiresDropOnElement:e.query("GET_DROP_ON_ELEMENT")});i.onload=function(t,n){var r=e.ref.list.childViews[0].childViews.filter((function(e){return e.rect.element.height})),i=e.query("GET_ACTIVE_ITEMS").map((function(e){return r.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));fe("ADD_ITEMS",t,{dispatch:e.dispatch}).then((function(t){if(vr(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:Er(e.ref.list,i,n),interactionMethod:2})})),e.dispatch("DID_DROP",{position:n}),e.dispatch("DID_END_DRAG",{position:n})},i.ondragstart=function(t){e.dispatch("DID_START_DRAG",{position:t})},i.ondrag=mr((function(t){e.dispatch("DID_DRAG",{position:t})})),i.ondragend=function(t){e.dispatch("DID_END_DRAG",{position:t})},e.ref.hopper=i,e.ref.drip=e.appendChildView(e.createChildView(Tn))}else!r&&e.ref.hopper&&(e.ref.hopper.destroy(),e.ref.hopper=null,e.removeChildView(e.ref.drip))},yr=function(e,t){var n=e.query("GET_ALLOW_BROWSE"),r=e.query("GET_DISABLED"),i=n&&!r;i&&!e.ref.browser?e.ref.browser=e.appendChildView(e.createChildView(gn,Object.assign({},t,{onload:function(t){fe("ADD_ITEMS",t,{dispatch:e.dispatch}).then((function(t){if(vr(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:3})}))}})),0):!i&&e.ref.browser&&(e.removeChildView(e.ref.browser),e.ref.browser=null)},Tr=function(e){var t=e.query("GET_ALLOW_PASTE"),n=e.query("GET_DISABLED"),r=t&&!n;r&&!e.ref.paster?(e.ref.paster=function(){var e=function(e){t.onload(e)},t={destroy:function(){var t;t=e,te(rr,rr.indexOf(t)),0===rr.length&&(document.removeEventListener("paste",ir),nr=!1)},onload:function(){}};return function(e){rr.includes(e)||(rr.push(e),nr||(nr=!0,document.addEventListener("paste",ir)))}(e),t}(),e.ref.paster.onload=function(t){fe("ADD_ITEMS",t,{dispatch:e.dispatch}).then((function(t){if(vr(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:4})}))}):!r&&e.ref.paster&&(e.ref.paster.destroy(),e.ref.paster=null)},Ir=w({DID_SET_ALLOW_BROWSE:function(e){var t=e.root,n=e.props;yr(t,n)},DID_SET_ALLOW_DROP:function(e){var t=e.root;_r(t)},DID_SET_ALLOW_PASTE:function(e){var t=e.root;Tr(t)},DID_SET_DISABLED:function(e){var t=e.root,n=e.props;_r(t),Tr(t),yr(t,n),t.query("GET_DISABLED")?t.element.dataset.disabled="disabled":t.element.removeAttribute("data-disabled")}}),br=b({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 i=t.query("GET_CLASS_NAME");i&&i.split(" ").filter((function(e){return e.length})).forEach((function(e){t.element.classList.add(e)})),t.ref.label=t.appendChildView(t.createChildView(En,Object.assign({},n,{translateY:null,caption:t.query("GET_LABEL_IDLE")}))),t.ref.list=t.appendChildView(t.createChildView(sn,{translateY:null})),t.ref.panel=t.appendChildView(t.createChildView(Wt,{name:"panel-root"})),t.ref.assistant=t.appendChildView(t.createChildView(pr,Object.assign({},n))),t.ref.data=t.appendChildView(t.createChildView(Rn,Object.assign({},n))),t.ref.measure=pt("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!C(e.value)})).map((function(e){var n=e.name,r=e.value;t.element.dataset[n]=r})),t.ref.widthPrevious=null,t.ref.widthUpdated=mr((function(){t.ref.updateHistory=[],t.dispatch("DID_RESIZE_ROOT")}),250),t.ref.previousAspectRatio=null,t.ref.updateHistory=[];var o=window.matchMedia("(pointer: fine) and (hover: hover)").matches,a="PointerEvent"in window;t.query("GET_ALLOW_REORDER")&&a&&!o&&(t.element.addEventListener("touchmove",gr,{passive:!1}),t.element.addEventListener("gesturestart",gr));var s=t.query("GET_CREDITS");if(2===s.length){var l=document.createElement("a");l.className="filepond--credits",l.setAttribute("aria-hidden","true"),l.href=s[0],l.tabindex=-1,l.target="_blank",l.rel="noopener noreferrer",l.textContent=s[1],t.element.appendChild(l),t.ref.credits=l}},write:function(e){var t=e.root,n=e.props,r=e.actions;if(Ir({root:t,props:n,actions:r}),r.filter((function(e){return/^DID_SET_STYLE_/.test(e.type)})).filter((function(e){return!C(e.data.value)})).map((function(e){var n=e.type,r=e.data,i=hr(n.substring(8).toLowerCase(),"_");t.element.dataset[i]=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 i=t.ref.bounds;i||(i=t.ref.bounds=function(e){var t=e.ref.measureHeight||null;return{cappedHeight:parseInt(e.style.maxHeight,10)||null,fixedHeight:0===t?null:t}}(t),t.element.removeChild(t.ref.measure),t.ref.measure=null);var o=t.ref,a=o.hopper,s=o.label,l=o.list,u=o.panel;a&&a.updateHopperState();var c=t.query("GET_PANEL_ASPECT_RATIO"),d=t.query("GET_ALLOW_MULTIPLE"),f=t.query("GET_TOTAL_ITEMS"),p=f===(d?t.query("GET_MAX_FILES")||1e6:1),h=r.find((function(e){return"DID_ADD_ITEM"===e.type}));if(p&&h){var m=h.data.interactionMethod;s.opacity=0,d?s.translateY=-40:1===m?s.translateX=40:s.translateY=3===m?40:30}else p||(s.opacity=1,s.translateX=0,s.translateY=0);var g=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}}(t),v=function(e){var t=0,n=0,r=e.ref.list,i=r.childViews[0],o=i.childViews.filter((function(e){return e.rect.element.height})),a=e.query("GET_ACTIVE_ITEMS").map((function(e){return o.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));if(0===a.length)return{visual:t,bounds:n};var s=i.rect.element.width,l=Zt(i,a,r.dragCoordinates),u=a[0].rect.element,c=u.marginTop+u.marginBottom,d=u.marginLeft+u.marginRight,f=u.width+d,p=u.height+c,h=void 0!==l&&l>=0?1:0,m=a.find((function(e){return e.markedForRemoval&&e.opacity<.45}))?-1:0,g=a.length+h+m,v=Qt(s,f);return 1===v?a.forEach((function(e){var r=e.rect.element.height+c;n+=r,t+=r*e.opacity})):(n=Math.ceil(g/v)*p,t=n),{visual:t,bounds:n}}(t),E=s.rect.element.height,_=!d||p?0:E,y=p?l.rect.element.marginTop:0,T=0===f?0:l.rect.element.marginBottom,I=_+y+v.visual+T,b=_+y+v.bounds+T;if(l.translateY=Math.max(0,_-l.rect.element.marginTop)-g.top,c){var w=t.rect.element.width,S=w*c;c!==t.ref.previousAspectRatio&&(t.ref.previousAspectRatio=c,t.ref.updateHistory=[]);var D=t.ref.updateHistory;if(D.push(w),D.length>4)for(var R=D.length,A=R-10,O=0,x=R;x>=A;x--)if(D[x]===D[x-2]&&O++,O>=2)return;u.scalable=!1,u.height=S;var L=S-_-(T-g.bottom)-(p?y:0);v.visual>L?l.overflow=L:l.overflow=null,t.height=S}else if(i.fixedHeight){u.scalable=!1;var P=i.fixedHeight-_-(T-g.bottom)-(p?y:0);v.visual>P?l.overflow=P:l.overflow=null}else if(i.cappedHeight){var M=I>=i.cappedHeight,N=Math.min(i.cappedHeight,I);u.scalable=!0,u.height=M?N:N-g.top-g.bottom;var G=N-_-(T-g.bottom)-(p?y:0);I>i.cappedHeight&&v.visual>G?l.overflow=G:l.overflow=null,t.height=Math.min(i.cappedHeight,b-g.top-g.bottom)}else{var F=f>0?g.top+g.bottom:0;u.scalable=!0,u.height=Math.max(E,I-F),t.height=Math.max(E,b-F)}t.ref.credits&&u.heightCurrent&&(t.ref.credits.style.transform="translateY("+u.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",gr),t.element.removeEventListener("gesturestart",gr)},mixins:{styles:["height"]}}),wr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=null,i=me(),o=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),i=[],o=[],a=function(e,t,n){!n||document.hidden?(c[e]&&c[e](t),i.push({type:e,data:t})):o.push({type:e,data:t})},s=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){w([{source:e,options:t}],{index:t.index}).then((function(e){return n(e&&e[0])})).catch(r)}))},addFiles:w,getFile:function(e){return o.query("GET_ACTIVE_ITEM",e)},processFile:A,prepareFile:I,removeFile:b,moveFile:function(e,t){return o.dispatch("MOVE_ITEM",{query:e,index:t})},getFiles:C,processFiles:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n={};return t(me(),(function(e,t){n[e]=t[0]})),wr(Object.assign({},n,{},e))},Dr=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];t(e.attributes,(function(t){i.push(e.attributes[t])}));var o=i.filter((function(e){return e.name})).reduce((function(t,n){var i,o=r(e,n.name);return t[(i=n.name,hr(i.replace(/^data-/,"")))]=o===n.name||o,t}),{});return function e(n,r){t(r,(function(r,i){t(n,(function(e,t){var o=new RegExp(r);if(o.test(e)&&(delete n[e],!1!==i))if(P(i))n[i]=t;else{var a,s=i.group;B(i)&&!n[s]&&(n[s]={}),n[s][(a=e.replace(o,""),a.charAt(0).toLowerCase()+a.slice(1))]=t}})),i.mapping&&e(n[i.group],i.mapping)}))}(o,n),o},Rr=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};pe("SET_ATTRIBUTE_TO_OPTION_MAP",n);var r=Object.assign({},t),i=Dr("FIELDSET"===e.nodeName?e.querySelector("input[type=file]"):e,n);Object.keys(i).forEach((function(e){B(i[e])?(B(r[e])||(r[e]={}),Object.assign(r[e],i[e])):r[e]=i[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 o=Sr(r);return e.files&&Array.from(e.files).forEach((function(e){o.addFile(e)})),o.replaceElement(e),o}.apply(void 0,arguments):Sr.apply(void 0,arguments)},Cr=["fire","_read","_write"],Ar=function(e){var t={};return re(e,t,Cr),t},Or=function(e,t){return e.replace(/(?:{([a-zA-Z]+)})/g,(function(e,n){return t[n]}))},xr=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 i=$();r.onmessage=function(e){e.data.id===i&&t(e.data.message)},r.postMessage({id:i,message:e},n)},terminate:function(){r.terminate(),URL.revokeObjectURL(n)}}},Lr=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}))},Pr=function(e,t){var n=e.slice(0,e.size,e.type);return n.lastModifiedDate=e.lastModifiedDate,n.name=t,n},Mr=function(e){return Pr(e,e.name)},Nr=[],Gr=function(e){var n;Nr.includes(e)||(Nr.push(e),n=e({addFilter:he,utils:{Type:ce,forin:t,isString:P,isFile:tt,toNaturalFileSize:Et,replaceInString:Or,getExtensionFromFilename:Pe,getFilenameWithoutExtension:et,guesstimateMimeType:xn,getFileFromBlob:Ge,getFilenameFromURL:Le,createRoute:w,createWorker:xr,createView:b,createItemAPI:oe,loadImage:Lr,copyFile:Mr,renameFile:Pr,createBlob:Fe,applyFilterChain:fe,text:ht,getNumericAspectRatioFromString:Ee},views:{fileActionButton:vt}}).options,Object.assign(ge,n))},Fr=(Ot=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 Ot}),kr={apps:[]},Ur=function(){};if(e.Status={},e.FileStatus={},e.FileOrigin={},e.OptionTypes={},e.create=Ur,e.destroy=Ur,e.parse=Ur,e.find=Ur,e.registerPlugin=Ur,e.getOptions=Ur,e.setOptions=Ur,Fr()){!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 i=window[r],o=1e3/n,a=null,s=null,l=null,u=null,c=function(){document.hidden?(l=function(){return window.setTimeout((function(){return d(performance.now())}),o)},u=function(){return window.clearTimeout(s)}):(l=function(){return window.requestAnimationFrame(d)},u=function(){return window.cancelAnimationFrame(s)})};document.addEventListener("visibilitychange",(function(){u&&u(),c(),d(performance.now())}));var d=function e(t){s=l(e),a||(a=t);var n=t-a;n<=o||(a=t-n%o,i.readers.forEach((function(e){return e()})),i.writers.forEach((function(e){return e(t)})))};c(),d(performance.now())}((function(){kr.apps.forEach((function(e){return e._read()}))}),(function(e){kr.apps.forEach((function(t){return t._write(e)}))}));var Vr=function t(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:Fr,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 Vr()}),0):document.addEventListener("DOMContentLoaded",Vr);var Br=function(){return t(me(),(function(t,n){e.OptionTypes[t]=n[1]}))};e.Status=Object.assign({},ye),e.FileOrigin=Object.assign({},se),e.FileStatus=Object.assign({},ae),e.OptionTypes={},Br(),e.create=function(){var t=Rr.apply(void 0,arguments);return t.on("destroy",e.destroy),kr.apps.push(t),Ar(t)},e.destroy=function(e){var t=kr.apps.findIndex((function(t){return t.isAttachedTo(e)}));return t>=0&&(kr.apps.splice(t,1)[0].restoreElement(),!0)},e.parse=function(t){return Array.from(t.querySelectorAll(".filepond")).filter((function(e){return!kr.apps.find((function(t){return t.isAttachedTo(e)}))})).map((function(t){return e.create(t)}))},e.find=function(e){var t=kr.apps.find((function(t){return t.isAttachedTo(e)}));return t?Ar(t):null},e.registerPlugin=function(){for(var e=arguments.length,t=new Array(e),n=0;n1,o=c(o),r.delay>=0&&setTimeout((function(){d(!0)}),r.delay),(r.delay<0||r.combined)&&(s.e=function(e,t){var i,o=0;return function(a,s){function l(){o=+new Date,t.call(n,a)}var u=+new Date-o;i&&clearTimeout(i),u>e||!r.enableThrottle||s?l():i=setTimeout(l,e-u)}}(r.throttle,(function(e){"resize"===e.type&&(T=I=-1),d(e.all)})),s.a=function(e){e=c(e),o.push.apply(o,e)},s.g=function(){return o=i(o).filter((function(){return!i(this).data(r.loadedName)}))},s.f=function(e){for(var t=0;tt.top&&-it.left&&-i=0?T:T=i(e).width()}function m(){return I>=0?I:I=i(e).height()}function g(e){return e.tagName.toLowerCase()}function v(e,t){if(t){var n=e.split(",");e="";for(var r=0,i=n.length;ra?1:-1;var s=n[i].substr((""+o).length),l=r[i].substr((""+a).length);if(""===s&&""!==l)return 1;if(""!==s&&""===l)return-1;if(""!==s&&""!==l)return s>l?1:-1}return 0},e.latest=function(t,n){function r(e){throw new Error('failed to find latest module of "'+e+'"')}var i=/(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/;/(.*)~(.*)/.test(t)||r(t);for(var o=Object.keys(e.modules),a=[],s=[],l=0;l0){var d=a.sort(e.helper.semVerSort).pop().name;return!0===n?d:e(d)}d=s.sort((function(e,t){return e.name>t.name}))[0].name;return!0===n?d:e(d)},e.modules={},e.register=function(t,n){e.modules[t]={definition:n}},e.define=function(t,n){e.modules[t]={exports:n}},e.register("abpetkov~transitionize@0.0.3",(function(e,t){function n(e,t){if(!(this instanceof n))return new n(e,t);this.element=e,this.props=t||{},this.init()}t.exports=n,n.prototype.isSafari=function(){return/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)},n.prototype.init=function(){var e=[];for(var t in this.props)e.push(t+" "+this.props[t]);this.element.style.transition=e.join(", "),this.isSafari()&&(this.element.style.webkitTransition=e.join(", "))}})),e.register("ftlabs~fastclick@v0.6.11",(function(e,t){function n(e){"use strict";var t,r=this;if(this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=10,this.layer=e,!e||!e.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){return n.prototype.onClick.apply(r,arguments)},this.onMouse=function(){return n.prototype.onMouse.apply(r,arguments)},this.onTouchStart=function(){return n.prototype.onTouchStart.apply(r,arguments)},this.onTouchMove=function(){return n.prototype.onTouchMove.apply(r,arguments)},this.onTouchEnd=function(){return n.prototype.onTouchEnd.apply(r,arguments)},this.onTouchCancel=function(){return n.prototype.onTouchCancel.apply(r,arguments)},n.notNeeded(e)||(this.deviceIsAndroid&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,r){var i=Node.prototype.removeEventListener;"click"===t?i.call(e,t,n.hijacked||n,r):i.call(e,t,n,r)},e.addEventListener=function(t,n,r){var i=Node.prototype.addEventListener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),r):i.call(e,t,n,r)}),"function"==typeof e.onclick&&(t=e.onclick,e.addEventListener("click",(function(e){t(e)}),!1),e.onclick=null))}n.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0,n.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent),n.prototype.deviceIsIOS4=n.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),n.prototype.deviceIsIOSWithBadTarget=n.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),n.prototype.needsClick=function(e){"use strict";switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(this.deviceIsIOS&&"file"===e.type||e.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(e.className)},n.prototype.needsFocus=function(e){"use strict";switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!this.deviceIsAndroid;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},n.prototype.sendClick=function(e,t){"use strict";var n,r;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),r=t.changedTouches[0],(n=document.createEvent("MouseEvents")).initMouseEvent(this.determineEventType(e),!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,e.dispatchEvent(n)},n.prototype.determineEventType=function(e){"use strict";return this.deviceIsAndroid&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},n.prototype.focus=function(e){"use strict";var t;this.deviceIsIOS&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},n.prototype.updateScrollParent=function(e){"use strict";var t,n;if(!(t=e.fastClickScrollParent)||!t.contains(e)){n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},n.prototype.getTargetElementFromEventTarget=function(e){"use strict";return e.nodeType===Node.TEXT_NODE?e.parentNode:e},n.prototype.onTouchStart=function(e){"use strict";var t,n,r;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),n=e.targetTouches[0],this.deviceIsIOS){if((r=window.getSelection()).rangeCount&&!r.isCollapsed)return!0;if(!this.deviceIsIOS4){if(n.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=n.pageX,this.touchStartY=n.pageY,e.timeStamp-this.lastClickTime<200&&e.preventDefault(),!0},n.prototype.touchHasMoved=function(e){"use strict";var t=e.changedTouches[0],n=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>n||Math.abs(t.pageY-this.touchStartY)>n},n.prototype.onTouchMove=function(e){"use strict";return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(e.target)||this.touchHasMoved(e))&&(this.trackingClick=!1,this.targetElement=null),!0)},n.prototype.findControl=function(e){"use strict";return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},n.prototype.onTouchEnd=function(e){"use strict";var t,n,r,i,o,a=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTime<200)return this.cancelNextClick=!0,!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,this.deviceIsIOSWithBadTarget&&(o=e.changedTouches[0],(a=document.elementFromPoint(o.pageX-window.pageXOffset,o.pageY-window.pageYOffset)||a).fastClickScrollParent=this.targetElement.fastClickScrollParent),"label"===(r=a.tagName.toLowerCase())){if(t=this.findControl(a)){if(this.focus(a),this.deviceIsAndroid)return!1;a=t}}else if(this.needsFocus(a))return e.timeStamp-n>100||this.deviceIsIOS&&window.top!==window&&"input"===r?(this.targetElement=null,!1):(this.focus(a),this.deviceIsIOS4&&"select"===r||(this.targetElement=null,e.preventDefault()),!1);return!(!this.deviceIsIOS||this.deviceIsIOS4||!(i=a.fastClickScrollParent)||i.fastClickLastScrollTop===i.scrollTop)||(this.needsClick(a)||(e.preventDefault(),this.sendClick(a,e)),!1)},n.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1,this.targetElement=null},n.prototype.onMouse=function(e){"use strict";return!this.targetElement||(!!e.forwardedTouchEvent||(!e.cancelable||(!(!this.needsClick(this.targetElement)||this.cancelNextClick)||(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1))))},n.prototype.onClick=function(e){"use strict";var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===e.target.type&&0===e.detail||((t=this.onMouse(e))||(this.targetElement=null),t)},n.prototype.destroy=function(){"use strict";var e=this.layer;this.deviceIsAndroid&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1)},n.notNeeded=function(e){"use strict";var t,r;if(void 0===window.ontouchstart)return!0;if(r=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n.prototype.deviceIsAndroid)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(r>31&&window.innerWidth<=window.screen.width)return!0}}return"none"===e.style.msTouchAction},n.attach=function(e){"use strict";return new n(e)},"undefined"!=typeof define&&define.amd?define((function(){"use strict";return n})):void 0!==t&&t.exports?(t.exports=n.attach,t.exports.FastClick=n):window.FastClick=n})),e.register("component~indexof@0.0.3",(function(e,t){t.exports=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n").addClass(t.dropdownClassName).attr("id","textcomplete-dropdown-"+t._oid).css({display:"none",left:0,position:"absolute",zIndex:t.zIndex}).appendTo(n)}}),e.extend(t.prototype,{$el:null,$inputEl:null,completer:null,footer:null,header:null,id:null,maxCount:null,placement:"",shown:!1,data:[],className:"",destroy:function(){this.deactivate(),this.$el.off("."+this.id),this.$inputEl.off("."+this.id),this.clear(),this.$el.remove(),this.$el=this.$inputEl=this.completer=null,delete i[this.id]},render:function(t){var n=this._buildContents(t),r=e.map(t,(function(e){return e.value}));if(t.length){var i=t[0].strategy;i.id?this.$el.attr("data-strategy",i.id):this.$el.removeAttr("data-strategy"),this._renderHeader(r),this._renderFooter(r),n&&(this._renderContents(n),this._fitToBottom(),this._fitToRight(),this._activateIndexedItem()),this._setScroll()}else this.noResultsMessage?this._renderNoResultsMessage(r):this.shown&&this.deactivate()},setPosition:function(t){var r="absolute";return this.$inputEl.add(this.$inputEl.parents()).each((function(){return"absolute"!==e(this).css("position")&&("fixed"===e(this).css("position")?(t.top-=n.scrollTop(),t.left-=n.scrollLeft(),r="fixed",!1):void 0)})),this.$el.css(this._applyPlacement(t)),this.$el.css({position:r}),this},clear:function(){this.$el.html(""),this.data=[],this._index=0,this._$header=this._$footer=this._$noResultsMessage=null},activate:function(){return this.shown||(this.clear(),this.$el.show(),this.className&&this.$el.addClass(this.className),this.completer.fire("textComplete:show"),this.shown=!0),this},deactivate:function(){return this.shown&&(this.$el.hide(),this.className&&this.$el.removeClass(this.className),this.completer.fire("textComplete:hide"),this.shown=!1),this},isUp:function(e){return 38===e.keyCode||e.ctrlKey&&80===e.keyCode},isDown:function(e){return 40===e.keyCode||e.ctrlKey&&78===e.keyCode},isEnter:function(e){return!(e.ctrlKey||e.altKey||e.metaKey||e.shiftKey)&&(13===e.keyCode||9===e.keyCode||!0===this.option.completeOnSpace&&32===e.keyCode)},isPageup:function(e){return 33===e.keyCode},isPagedown:function(e){return 34===e.keyCode},isEscape:function(e){return 27===e.keyCode},_data:null,_index:null,_$header:null,_$noResultsMessage:null,_$footer:null,_bindEvents:function(){this.$el.on("mousedown."+this.id,".textcomplete-item",e.proxy(this._onClick,this)),this.$el.on("touchstart."+this.id,".textcomplete-item",e.proxy(this._onClick,this)),this.$el.on("mouseover."+this.id,".textcomplete-item",e.proxy(this._onMouseover,this)),this.$inputEl.on("keydown."+this.id,e.proxy(this._onKeydown,this))},_onClick:function(t){var n=e(t.target);t.preventDefault(),t.originalEvent.keepTextCompleteDropdown=this.id,n.hasClass("textcomplete-item")||(n=n.closest(".textcomplete-item"));var r=this.data[parseInt(n.data("index"),10)];this.completer.select(r.value,r.strategy,t);var i=this;setTimeout((function(){i.deactivate(),"touchstart"===t.type&&i.$inputEl.focus()}),0)},_onMouseover:function(t){var n=e(t.target);t.preventDefault(),n.hasClass("textcomplete-item")||(n=n.closest(".textcomplete-item")),this._index=parseInt(n.data("index"),10),this._activateIndexedItem()},_onKeydown:function(t){var n;if(this.shown)switch(e.isFunction(this.option.onKeydown)&&(n=this.option.onKeydown(t,o)),null==n&&(n=this._defaultKeydown(t)),n){case o.KEY_UP:t.preventDefault(),this._up();break;case o.KEY_DOWN:t.preventDefault(),this._down();break;case o.KEY_ENTER:t.preventDefault(),this._enter(t);break;case o.KEY_PAGEUP:t.preventDefault(),this._pageup();break;case o.KEY_PAGEDOWN:t.preventDefault(),this._pagedown();break;case o.KEY_ESCAPE:t.preventDefault(),this.deactivate()}},_defaultKeydown:function(e){return this.isUp(e)?o.KEY_UP:this.isDown(e)?o.KEY_DOWN:this.isEnter(e)?o.KEY_ENTER:this.isPageup(e)?o.KEY_PAGEUP:this.isPagedown(e)?o.KEY_PAGEDOWN:this.isEscape(e)?o.KEY_ESCAPE:void 0},_up:function(){0===this._index?this._index=this.data.length-1:this._index-=1,this._activateIndexedItem(),this._setScroll()},_down:function(){this._index===this.data.length-1?this._index=0:this._index+=1,this._activateIndexedItem(),this._setScroll()},_enter:function(e){var t=this.data[parseInt(this._getActiveElement().data("index"),10)];this.completer.select(t.value,t.strategy,e),this.deactivate()},_pageup:function(){var t=0,n=this._getActiveElement().position().top-this.$el.innerHeight();this.$el.children().each((function(r){return e(this).position().top+e(this).outerHeight()>n?(t=r,!1):void 0})),this._index=t,this._activateIndexedItem(),this._setScroll()},_pagedown:function(){var t=this.data.length-1,n=this._getActiveElement().position().top+this.$el.innerHeight();this.$el.children().each((function(r){return e(this).position().top>n?(t=r,!1):void 0})),this._index=t,this._activateIndexedItem(),this._setScroll()},_activateIndexedItem:function(){this.$el.find(".textcomplete-item.active").removeClass("active"),this._getActiveElement().addClass("active")},_getActiveElement:function(){return this.$el.children(".textcomplete-item:nth("+this._index+")")},_setScroll:function(){var e=this._getActiveElement(),t=e.position().top,n=e.outerHeight(),r=this.$el.innerHeight(),i=this.$el.scrollTop();0===this._index||this._index==this.data.length-1||0>t?this.$el.scrollTop(t+i):t+n>r&&this.$el.scrollTop(t+n+i-r)},_buildContents:function(e){var t,n,i,o="";for(n=0;n',o+=t.strategy.template(t.value,t.term),o+="");return o},_renderHeader:function(t){if(this.header){this._$header||(this._$header=e('').prependTo(this.$el));var n=e.isFunction(this.header)?this.header(t):this.header;this._$header.html(n)}},_renderFooter:function(t){if(this.footer){this._$footer||(this._$footer=e('').appendTo(this.$el));var n=e.isFunction(this.footer)?this.footer(t):this.footer;this._$footer.html(n)}},_renderNoResultsMessage:function(t){if(this.noResultsMessage){this._$noResultsMessage||(this._$noResultsMessage=e('').appendTo(this.$el));var n=e.isFunction(this.noResultsMessage)?this.noResultsMessage(t):this.noResultsMessage;this._$noResultsMessage.html(n)}},_renderContents:function(e){this._$footer?this._$footer.before(e):this.$el.append(e)},_fitToBottom:function(){var e=n.scrollTop()+n.height(),t=this.$el.height();this.$el.position().top+t>e&&(this.completer.$iframe||this.$el.offset({top:e-t}))},_fitToRight:function(){for(var e,t=this.option.rightEdgeOffset,r=this.$el.offset().left,i=this.$el.width(),o=n.width()-t;r+i>o&&(this.$el.offset({left:r-t}),!((e=this.$el.offset().left)>=r));)r=e},_applyPlacement:function(e){return-1!==this.placement.indexOf("top")?e={top:"auto",bottom:this.$el.parent().height()-e.top+e.lineHeight,left:e.left}:(e.bottom="auto",delete e.lineHeight),-1!==this.placement.indexOf("absleft")?e.left=0:-1!==this.placement.indexOf("absright")&&(e.right=0,e.left="auto"),e}}),e.fn.textcomplete.Dropdown=t,e.extend(e.fn.textcomplete,o)}(e),function(e){"use strict";function t(t){e.extend(this,t),this.cache&&(this.search=n(this.search))}var n=function(e){var t={};return function(n,r){t[n]?r(t[n]):e.call(this,n,(function(e){t[n]=(t[n]||[]).concat(e),r.apply(null,arguments)}))}};t.parse=function(n,r){return e.map(n,(function(e){var n=new t(e);return n.el=r.el,n.$el=r.$el,n}))},e.extend(t.prototype,{match:null,replace:null,search:null,id:null,cache:!1,context:function(){return!0},index:2,template:function(e){return e},idProperty:null}),e.fn.textcomplete.Strategy=t}(e),function(e){"use strict";function t(){}var n=Date.now||function(){return(new Date).getTime()},r=function(e,t){var r,i,o,a,s,l=function(){var u=n()-a;t>u?r=setTimeout(l,t-u):(r=null,s=e.apply(o,i),o=i=null)};return function(){return o=this,i=arguments,a=n(),r||(r=setTimeout(l,t)),s}};e.extend(t.prototype,{id:null,completer:null,el:null,$el:null,option:null,initialize:function(t,n,i){this.el=t,this.$el=e(t),this.id=n.id+this.constructor.name,this.completer=n,this.option=i,this.option.debounce&&(this._onKeyup=r(this._onKeyup,this.option.debounce)),this._bindEvents()},destroy:function(){this.$el.off("."+this.id),this.$el=this.el=this.completer=null},select:function(){throw new Error("Not implemented")},getCaretPosition:function(){var t=this._getCaretRelativePosition(),n=this.$el.offset(),r=this.option.appendTo;if(r){r instanceof e||(r=e(r));var i=r.offsetParent().offset();n.top-=i.top,n.left-=i.left}return t.top+=n.top,t.left+=n.left,t},focus:function(){this.$el.focus()},_bindEvents:function(){this.$el.on("keyup."+this.id,e.proxy(this._onKeyup,this))},_onKeyup:function(e){this._skipSearch(e)||this.completer.trigger(this.getTextFromHeadToCaret(),!0)},_skipSearch:function(e){switch(e.keyCode){case 9:case 13:case 16:case 17:case 18:case 33:case 34:case 40:case 38:case 27:return!0}if(e.ctrlKey)switch(e.keyCode){case 78:case 80:return!0}}}),e.fn.textcomplete.Adapter=t}(e),function(e){"use strict";function t(e,t,n){this.initialize(e,t,n)}e.extend(t.prototype,e.fn.textcomplete.Adapter.prototype,{select:function(t,n,r){var i,o=this.getTextFromHeadToCaret(),a=this.el.value.substring(this.el.selectionEnd),s=n.replace(t,r);void 0!==s&&(e.isArray(s)&&(a=s[1]+a,s=s[0]),i=e.isFunction(n.match)?n.match(o):n.match,o=o.replace(i,s),this.$el.val(o+a),this.el.selectionStart=this.el.selectionEnd=o.length)},getTextFromHeadToCaret:function(){return this.el.value.substring(0,this.el.selectionEnd)},_getCaretRelativePosition:function(){var t=e.fn.textcomplete.getCaretCoordinates(this.el,this.el.selectionStart);return{top:t.top+this._calculateLineHeight()-this.$el.scrollTop(),left:t.left-this.$el.scrollLeft(),lineHeight:this._calculateLineHeight()}},_calculateLineHeight:function(){var e=parseInt(this.$el.css("line-height"),10);if(isNaN(e)){var t=this.el.parentNode,n=document.createElement(this.el.nodeName),r=this.el.style;n.setAttribute("style","margin:0px;padding:0px;font-family:"+r.fontFamily+";font-size:"+r.fontSize),n.innerHTML="test",t.appendChild(n),e=n.clientHeight,t.removeChild(n)}return e}}),e.fn.textcomplete.Textarea=t}(e),function(e){"use strict";function t(t,r,i){this.initialize(t,r,i),e(""+n+"").css({position:"absolute",top:-9999,left:-9999}).insertBefore(t)}var n="吶";e.extend(t.prototype,e.fn.textcomplete.Textarea.prototype,{select:function(t,n,r){var i,o=this.getTextFromHeadToCaret(),a=this.el.value.substring(o.length),s=n.replace(t,r);if(void 0!==s){e.isArray(s)&&(a=s[1]+a,s=s[0]),i=e.isFunction(n.match)?n.match(o):n.match,o=o.replace(i,s),this.$el.val(o+a),this.el.focus();var l=this.el.createTextRange();l.collapse(!0),l.moveEnd("character",o.length),l.moveStart("character",o.length),l.select()}},getTextFromHeadToCaret:function(){this.el.focus();var e=document.selection.createRange();e.moveStart("character",-this.el.value.length);var t=e.text.split(n);return 1===t.length?t[0]:t[1]}}),e.fn.textcomplete.IETextarea=t}(e),function(e){"use strict";function t(e,t,n){this.initialize(e,t,n)}e.extend(t.prototype,e.fn.textcomplete.Adapter.prototype,{select:function(t,n,r){var i=this.getTextFromHeadToCaret(),o=this.el.ownerDocument.getSelection(),a=o.getRangeAt(0),s=a.cloneRange();s.selectNodeContents(a.startContainer);var l,u=s.toString().substring(a.startOffset),c=n.replace(t,r);if(void 0!==c){e.isArray(c)&&(u=c[1]+u,c=c[0]),l=e.isFunction(n.match)?n.match(i):n.match,i=i.replace(l,c).replace(/ $/," "),a.selectNodeContents(a.startContainer),a.deleteContents();var d=this.el.ownerDocument.createElement("div");d.innerHTML=i;var f=this.el.ownerDocument.createElement("div");f.innerHTML=u;for(var p,h,m=this.el.ownerDocument.createDocumentFragment();p=d.firstChild;)h=m.appendChild(p);for(;p=f.firstChild;)m.appendChild(p);a.insertNode(m),a.setStartAfter(h),a.collapse(!0),o.removeAllRanges(),o.addRange(a)}},_getCaretRelativePosition:function(){var t=this.el.ownerDocument.getSelection().getRangeAt(0).cloneRange(),n=t.endContainer.parentNode,r=this.el.ownerDocument.createElement("span");t.insertNode(r),t.selectNodeContents(r),t.deleteContents(),setTimeout((function(){n.normalize()}),0);var i=e(r),o=i.offset();if(o.left-=this.$el.offset().left,o.top+=i.height()-this.$el.offset().top,o.lineHeight=i.height(),this.completer.$iframe){var a=this.completer.$iframe.offset();o.top+=a.top,o.left+=a.left,o.top-=e(this.completer.$iframe[0].contentWindow.document).scrollTop()}return i.remove(),o},getTextFromHeadToCaret:function(){var e=this.el.ownerDocument.getSelection().getRangeAt(0),t=e.cloneRange();return t.selectNodeContents(e.startContainer),t.toString().substring(0,e.startOffset)}}),e.fn.textcomplete.ContentEditable=t}(e),function(e){"use strict";function t(e,t,n){this.initialize(e,t,n)}e.extend(t.prototype,e.fn.textcomplete.ContentEditable.prototype,{_bindEvents:function(){var t=this;this.option.ckeditor_instance.on("key",(function(e){var n=e.data;return t._onKeyup(n),(!t.completer.dropdown.shown||!t._skipSearch(n))&&void 0}),null,null,1),this.$el.on("keyup."+this.id,e.proxy(this._onKeyup,this))}}),e.fn.textcomplete.CKEditor=t}(e),function(e){var t=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n="undefined"!=typeof window,r=n&&null!=window.mozInnerScreenX;e.fn.textcomplete.getCaretCoordinates=function(e,i,o){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var a=o&&o.debug||!1;if(a){var s=document.querySelector("#input-textarea-caret-position-mirror-div");s&&s.parentNode.removeChild(s)}var l=document.createElement("div");l.id="input-textarea-caret-position-mirror-div",document.body.appendChild(l);var u=l.style,c=window.getComputedStyle?getComputedStyle(e):e.currentStyle;u.whiteSpace="pre-wrap","INPUT"!==e.nodeName&&(u.wordWrap="break-word"),u.position="absolute",a||(u.visibility="hidden"),t.forEach((function(e){u[e]=c[e]})),r?e.scrollHeight>parseInt(c.height)&&(u.overflowY="scroll"):u.overflow="hidden",l.textContent=e.value.substring(0,i),"INPUT"===e.nodeName&&(l.textContent=l.textContent.replace(/\s/g," "));var d=document.createElement("span");d.textContent=e.value.substring(i)||".",l.appendChild(d);var f={top:d.offsetTop+parseInt(c.borderTopWidth),left:d.offsetLeft+parseInt(c.borderLeftWidth)};return a?d.style.backgroundColor="#aaa":document.body.removeChild(l),f}}(e),e}));