O){if(s.y1?m.getGridIndex():m.getColIndex();e.dispatch("MOVE_ITEM",{query:r,index:p});let f=a.getIndex();if(f===void 0||f!==p){if(a.setIndex(p),f===void 0)return;e.dispatch("DID_REORDER_ITEMS",{items:e.query("GET_ACTIVE_ITEMS"),origin:o,target:p})}},sc=fe({DID_ADD_ITEM:ac,DID_REMOVE_ITEM:rc,DID_DRAG_ITEM:oc}),cc=({root:e,props:t,actions:i,shouldOptimize:a})=>{sc({root:e,props:t,actions:i});let{dragCoordinates:n}=t,r=e.rect.element.width,l=e.childViews.filter(b=>b.rect.element.height),o=e.query("GET_ACTIVE_ITEMS").map(b=>l.find(_=>_.id===b.id)).filter(b=>b),s=n?ji(e,o,n):null,u=e.ref.addIndex||null;e.ref.addIndex=null;let c=0,d=0,h=0;if(o.length===0)return;let m=o[0].rect.element,p=m.marginTop+m.marginBottom,f=m.marginLeft+m.marginRight,g=m.width+f,I=m.height+p,E=qi(r,g);if(E===1){let b=0,_=0;o.forEach((y,T)=>{if(s){let S=T-s;S===-2?_=-p*.25:S===-1?_=-p*.75:S===0?_=p*.75:S===1?_=p*.25:_=0}a&&(y.translateX=null,y.translateY=null),y.markedForRemoval||Ka(y,0,b+_);let R=(y.rect.element.height+p)*(y.markedForRemoval?y.opacity:1);b+=R})}else{let b=0,_=0;o.forEach((y,T)=>{T===s&&(c=1),T===u&&(h+=1),y.markedForRemoval&&y.opacity<.5&&(d-=1);let v=T+h+c+d,R=v%E,S=Math.floor(v/E),P=R*g,O=S*I,x=Math.sign(P-b),z=Math.sign(O-_);b=P,_=O,!y.markedForRemoval&&(a&&(y.translateX=null,y.translateY=null),Ka(y,P,O,x,z))})}},dc=(e,t)=>t.filter(i=>i.data&&i.data.id?e.id===i.data.id:!0),uc=re({create:ic,write:cc,tag:"ul",name:"list",didWriteView:({root:e})=>{e.childViews.filter(t=>t.markedForRemoval&&t.opacity===0&&t.resting).forEach(t=>{t._destroy(),e.removeChildView(t)})},filterFrameActionsForChild:dc,mixins:{apis:["dragCoordinates"]}}),hc=({root:e,props:t})=>{e.ref.list=e.appendChildView(e.createChildView(uc)),t.dragCoordinates=null,t.overflowing=!1},mc=({root:e,props:t,action:i})=>{e.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(t.dragCoordinates={left:i.position.scopeLeft-e.ref.list.rect.element.left,top:i.position.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},pc=({props:e})=>{e.dragCoordinates=null},fc=fe({DID_DRAG:mc,DID_END_DRAG:pc}),gc=({root:e,props:t,actions:i})=>{if(fc({root:e,props:t,actions:i}),e.ref.list.dragCoordinates=t.dragCoordinates,t.overflowing&&!t.overflow&&(t.overflowing=!1,e.element.dataset.state="",e.height=null),t.overflow){let a=Math.round(t.overflow);a!==e.height&&(t.overflowing=!0,e.element.dataset.state="overflow",e.height=a)}},Ec=re({create:hc,write:gc,name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),xe=(e,t,i,a="")=>{i?ne(e,t,a):e.removeAttribute(t)},Tc=e=>{if(!(!e||e.value==="")){try{e.value=""}catch{}if(e.value){let t=Be("form"),i=e.parentNode,a=e.nextSibling;t.appendChild(e),t.reset(),a?i.insertBefore(e,a):i.appendChild(e)}}},bc=({root:e,props:t})=>{e.element.id=`filepond--browser-${t.id}`,ne(e.element,"name",e.query("GET_NAME")),ne(e.element,"aria-controls",`filepond--assistant-${t.id}`),ne(e.element,"aria-labelledby",`filepond--drop-label-${t.id}`),Fn({root:e,action:{value:e.query("GET_ACCEPTED_FILE_TYPES")}}),Cn({root:e,action:{value:e.query("GET_ALLOW_MULTIPLE")}}),zn({root:e,action:{value:e.query("GET_ALLOW_DIRECTORIES_ONLY")}}),Fi({root:e}),Nn({root:e,action:{value:e.query("GET_REQUIRED")}}),Bn({root:e,action:{value:e.query("GET_CAPTURE_METHOD")}}),e.ref.handleChange=i=>{if(!e.element.value)return;let a=Array.from(e.element.files).map(n=>(n._relativePath=n.webkitRelativePath,n));setTimeout(()=>{t.onload(a),Tc(e.element)},250)},e.element.addEventListener("change",e.ref.handleChange)},Fn=({root:e,action:t})=>{e.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&xe(e.element,"accept",!!t.value,t.value?t.value.join(","):"")},Cn=({root:e,action:t})=>{xe(e.element,"multiple",t.value)},zn=({root:e,action:t})=>{xe(e.element,"webkitdirectory",t.value)},Fi=({root:e})=>{let t=e.query("GET_DISABLED"),i=e.query("GET_ALLOW_BROWSE"),a=t||!i;xe(e.element,"disabled",a)},Nn=({root:e,action:t})=>{t.value?e.query("GET_TOTAL_ITEMS")===0&&xe(e.element,"required",!0):xe(e.element,"required",!1)},Bn=({root:e,action:t})=>{xe(e.element,"capture",!!t.value,t.value===!0?"":t.value)},Ja=({root:e})=>{let{element:t}=e;e.query("GET_TOTAL_ITEMS")>0?(xe(t,"required",!1),xe(t,"name",!1)):(xe(t,"name",!0,e.query("GET_NAME")),e.query("GET_CHECK_VALIDITY")&&t.setCustomValidity(""),e.query("GET_REQUIRED")&&xe(t,"required",!0))},Ic=({root:e})=>{e.query("GET_CHECK_VALIDITY")&&e.element.setCustomValidity(e.query("GET_LABEL_INVALID_FIELD"))},_c=re({tag:"input",name:"browser",ignoreRect:!0,ignoreRectUpdate:!0,attributes:{type:"file"},create:bc,destroy:({root:e})=>{e.element.removeEventListener("change",e.ref.handleChange)},write:fe({DID_LOAD_ITEM:Ja,DID_REMOVE_ITEM:Ja,DID_THROW_ITEM_INVALID:Ic,DID_SET_DISABLED:Fi,DID_SET_ALLOW_BROWSE:Fi,DID_SET_ALLOW_DIRECTORIES_ONLY:zn,DID_SET_ALLOW_MULTIPLE:Cn,DID_SET_ACCEPTED_FILE_TYPES:Fn,DID_SET_CAPTURE_METHOD:Bn,DID_SET_REQUIRED:Nn})}),en={ENTER:13,SPACE:32},Rc=({root:e,props:t})=>{let i=Be("label");ne(i,"for",`filepond--browser-${t.id}`),ne(i,"id",`filepond--drop-label-${t.id}`),ne(i,"aria-hidden","true"),e.ref.handleKeyDown=a=>{(a.keyCode===en.ENTER||a.keyCode===en.SPACE)&&(a.preventDefault(),e.ref.label.click())},e.ref.handleClick=a=>{a.target===i||i.contains(a.target)||e.ref.label.click()},i.addEventListener("keydown",e.ref.handleKeyDown),e.element.addEventListener("click",e.ref.handleClick),Vn(i,t.caption),e.appendChild(i),e.ref.label=i},Vn=(e,t)=>{e.innerHTML=t;let i=e.querySelector(".filepond--label-action");return i&&ne(i,"tabindex","0"),t},yc=re({name:"drop-label",ignoreRect:!0,create:Rc,destroy:({root:e})=>{e.ref.label.addEventListener("keydown",e.ref.handleKeyDown),e.element.removeEventListener("click",e.ref.handleClick)},write:fe({DID_SET_LABEL_IDLE:({root:e,action:t})=>{Vn(e.ref.label,t.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),Sc=re({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}}}}),wc=({root:e})=>{let t=e.rect.element.width*.5,i=e.rect.element.height*.5;e.ref.blob=e.appendChildView(e.createChildView(Sc,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:t,translateY:i}))},vc=({root:e,action:t})=>{if(!e.ref.blob){wc({root:e});return}e.ref.blob.translateX=t.position.scopeLeft,e.ref.blob.translateY=t.position.scopeTop,e.ref.blob.scaleX=1,e.ref.blob.scaleY=1,e.ref.blob.opacity=1},Lc=({root:e})=>{e.ref.blob&&(e.ref.blob.opacity=0)},Ac=({root:e})=>{e.ref.blob&&(e.ref.blob.scaleX=2.5,e.ref.blob.scaleY=2.5,e.ref.blob.opacity=0)},Mc=({root:e,props:t,actions:i})=>{xc({root:e,props:t,actions:i});let{blob:a}=e.ref;i.length===0&&a&&a.opacity===0&&(e.removeChildView(a),e.ref.blob=null)},xc=fe({DID_DRAG:vc,DID_DROP:Ac,DID_END_DRAG:Lc}),Oc=re({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:Mc}),Gn=(e,t)=>{try{let i=new DataTransfer;t.forEach(a=>{a instanceof File?i.items.add(a):i.items.add(new File([a],a.name,{type:a.type}))}),e.files=i.files}catch{return!1}return!0},Pc=({root:e})=>e.ref.fields={},ci=(e,t)=>e.ref.fields[t],Xi=e=>{e.query("GET_ACTIVE_ITEMS").forEach(t=>{e.ref.fields[t.id]&&e.element.appendChild(e.ref.fields[t.id])})},tn=({root:e})=>Xi(e),Dc=({root:e,action:t})=>{let n=!(e.query("GET_ITEM",t.id).origin===se.LOCAL)&&e.query("SHOULD_UPDATE_FILE_INPUT"),r=Be("input");r.type=n?"file":"hidden",r.name=e.query("GET_NAME"),r.disabled=e.query("GET_DISABLED"),e.ref.fields[t.id]=r,Xi(e)},Fc=({root:e,action:t})=>{let i=ci(e,t.id);if(!i||(t.serverFileReference!==null&&(i.value=t.serverFileReference),!e.query("SHOULD_UPDATE_FILE_INPUT")))return;let a=e.query("GET_ITEM",t.id);Gn(i,[a.file])},Cc=({root:e,action:t})=>{e.query("SHOULD_UPDATE_FILE_INPUT")&&setTimeout(()=>{let i=ci(e,t.id);i&&Gn(i,[t.file])},0)},zc=({root:e})=>{e.element.disabled=e.query("GET_DISABLED")},Nc=({root:e,action:t})=>{let i=ci(e,t.id);i&&(i.parentNode&&i.parentNode.removeChild(i),delete e.ref.fields[t.id])},Bc=({root:e,action:t})=>{let i=ci(e,t.id);i&&(t.value===null?i.removeAttribute("value"):i.type!="file"&&(i.value=t.value),Xi(e))},Vc=fe({DID_SET_DISABLED:zc,DID_ADD_ITEM:Dc,DID_LOAD_ITEM:Fc,DID_REMOVE_ITEM:Nc,DID_DEFINE_VALUE:Bc,DID_PREPARE_OUTPUT:Cc,DID_REORDER_ITEMS:tn,DID_SORT_ITEMS:tn}),Gc=re({tag:"fieldset",name:"data",create:Pc,write:Vc,ignoreRect:!0}),Uc=e=>"getRootNode"in e?e.getRootNode():document,kc=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],Hc=["css","csv","html","txt"],Wc={zip:"zip|compressed",epub:"application/epub+zip"},Un=(e="")=>(e=e.toLowerCase(),kc.includes(e)?"image/"+(e==="jpg"?"jpeg":e==="svg"?"svg+xml":e):Hc.includes(e)?"text/"+e:Wc[e]||""),Qi=e=>new Promise((t,i)=>{let a=Kc(e);if(a.length&&!Yc(e))return t(a);$c(e).then(t)}),Yc=e=>e.files?e.files.length>0:!1,$c=e=>new Promise((t,i)=>{let a=(e.items?Array.from(e.items):[]).filter(n=>qc(n)).map(n=>jc(n));if(!a.length){t(e.files?Array.from(e.files):[]);return}Promise.all(a).then(n=>{let r=[];n.forEach(l=>{r.push.apply(r,l)}),t(r.filter(l=>l).map(l=>(l._relativePath||(l._relativePath=l.webkitRelativePath),l)))}).catch(console.error)}),qc=e=>{if(kn(e)){let t=Zi(e);if(t)return t.isFile||t.isDirectory}return e.kind==="file"},jc=e=>new Promise((t,i)=>{if(Zc(e)){Xc(Zi(e)).then(t).catch(i);return}t([e.getAsFile()])}),Xc=e=>new Promise((t,i)=>{let a=[],n=0,r=0,l=()=>{r===0&&n===0&&t(a)},o=s=>{n++;let u=s.createReader(),c=()=>{u.readEntries(d=>{if(d.length===0){n--,l();return}d.forEach(h=>{h.isDirectory?o(h):(r++,h.file(m=>{let p=Qc(m);h.fullPath&&(p._relativePath=h.fullPath),a.push(p),r--,l()}))}),c()},i)};c()};o(e)}),Qc=e=>{if(e.type.length)return e;let t=e.lastModifiedDate,i=e.name,a=Un(si(e.name));return a.length&&(e=e.slice(0,e.size,a),e.name=i,e.lastModifiedDate=t),e},Zc=e=>kn(e)&&(Zi(e)||{}).isDirectory,kn=e=>"webkitGetAsEntry"in e,Zi=e=>e.webkitGetAsEntry(),Kc=e=>{let t=[];try{if(t=ed(e),t.length)return t;t=Jc(e)}catch{}return t},Jc=e=>{let t=e.getData("url");return typeof t=="string"&&t.length?[t]:[]},ed=e=>{let t=e.getData("text/html");if(typeof t=="string"&&t.length){let i=t.match(/src\s*=\s*"(.+?)"/);if(i)return[i[1]]}return[]},ii=[],Ke=e=>({pageLeft:e.pageX,pageTop:e.pageY,scopeLeft:e.offsetX||e.layerX,scopeTop:e.offsetY||e.layerY}),td=(e,t,i)=>{let a=id(t),n={element:e,filterElement:i,state:null,ondrop:()=>{},onenter:()=>{},ondrag:()=>{},onexit:()=>{},onload:()=>{},allowdrop:()=>{}};return n.destroy=a.addListener(n),n},id=e=>{let t=ii.find(a=>a.element===e);if(t)return t;let i=ad(e);return ii.push(i),i},ad=e=>{let t=[],i={dragenter:rd,dragover:ld,dragleave:sd,drop:od},a={};te(i,(r,l)=>{a[r]=l(e,t),e.addEventListener(r,a[r],!1)});let n={element:e,addListener:r=>(t.push(r),()=>{t.splice(t.indexOf(r),1),t.length===0&&(ii.splice(ii.indexOf(n),1),te(i,l=>{e.removeEventListener(l,a[l],!1)}))})};return n},nd=(e,t)=>("elementFromPoint"in e||(e=document),e.elementFromPoint(t.x,t.y)),Ki=(e,t)=>{let i=Uc(t),a=nd(i,{x:e.pageX-window.pageXOffset,y:e.pageY-window.pageYOffset});return a===t||t.contains(a)},Hn=null,Zt=(e,t)=>{try{e.dropEffect=t}catch{}},rd=(e,t)=>i=>{i.preventDefault(),Hn=i.target,t.forEach(a=>{let{element:n,onenter:r}=a;Ki(i,n)&&(a.state="enter",r(Ke(i)))})},ld=(e,t)=>i=>{i.preventDefault();let a=i.dataTransfer;Qi(a).then(n=>{let r=!1;t.some(l=>{let{filterElement:o,element:s,onenter:u,onexit:c,ondrag:d,allowdrop:h}=l;Zt(a,"copy");let m=h(n);if(!m){Zt(a,"none");return}if(Ki(i,s)){if(r=!0,l.state===null){l.state="enter",u(Ke(i));return}if(l.state="over",o&&!m){Zt(a,"none");return}d(Ke(i))}else o&&!r&&Zt(a,"none"),l.state&&(l.state=null,c(Ke(i)))})})},od=(e,t)=>i=>{i.preventDefault();let a=i.dataTransfer;Qi(a).then(n=>{t.forEach(r=>{let{filterElement:l,element:o,ondrop:s,onexit:u,allowdrop:c}=r;if(r.state=null,!(l&&!Ki(i,o))){if(!c(n))return u(Ke(i));s(Ke(i),n)}})})},sd=(e,t)=>i=>{Hn===i.target&&t.forEach(a=>{let{onexit:n}=a;a.state=null,n(Ke(i))})},cd=(e,t,i)=>{e.classList.add("filepond--hopper");let{catchesDropsOnPage:a,requiresDropOnElement:n,filterItems:r=c=>c}=i,l=td(e,a?document.documentElement:e,n),o="",s="";l.allowdrop=c=>t(r(c)),l.ondrop=(c,d)=>{let h=r(d);if(!t(h)){u.ondragend(c);return}s="drag-drop",u.onload(h,c)},l.ondrag=c=>{u.ondrag(c)},l.onenter=c=>{s="drag-over",u.ondragstart(c)},l.onexit=c=>{s="drag-exit",u.ondragend(c)};let u={updateHopperState:()=>{o!==s&&(e.dataset.hopperState=s,o=s)},onload:()=>{},ondragstart:()=>{},ondrag:()=>{},ondragend:()=>{},destroy:()=>{l.destroy()}};return u},Ci=!1,ct=[],Wn=e=>{let t=document.activeElement;if(t&&/textarea|input/i.test(t.nodeName)){let i=!1,a=t;for(;a!==document.body;){if(a.classList.contains("filepond--root")){i=!0;break}a=a.parentNode}if(!i)return}Qi(e.clipboardData).then(i=>{i.length&&ct.forEach(a=>a(i))})},dd=e=>{ct.includes(e)||(ct.push(e),!Ci&&(Ci=!0,document.addEventListener("paste",Wn)))},ud=e=>{Hi(ct,ct.indexOf(e)),ct.length===0&&(document.removeEventListener("paste",Wn),Ci=!1)},hd=()=>{let e=i=>{t.onload(i)},t={destroy:()=>{ud(e)},onload:()=>{}};return dd(e),t},md=({root:e,props:t})=>{e.element.id=`filepond--assistant-${t.id}`,ne(e.element,"role","status"),ne(e.element,"aria-live","polite"),ne(e.element,"aria-relevant","additions")},an=null,nn=null,Li=[],di=(e,t)=>{e.element.textContent=t},pd=e=>{e.element.textContent=""},Yn=(e,t,i)=>{let a=e.query("GET_TOTAL_ITEMS");di(e,`${i} ${t}, ${a} ${a===1?e.query("GET_LABEL_FILE_COUNT_SINGULAR"):e.query("GET_LABEL_FILE_COUNT_PLURAL")}`),clearTimeout(nn),nn=setTimeout(()=>{pd(e)},1500)},$n=e=>e.element.parentNode.contains(document.activeElement),fd=({root:e,action:t})=>{if(!$n(e))return;e.element.textContent="";let i=e.query("GET_ITEM",t.id);Li.push(i.filename),clearTimeout(an),an=setTimeout(()=>{Yn(e,Li.join(", "),e.query("GET_LABEL_FILE_ADDED")),Li.length=0},750)},gd=({root:e,action:t})=>{if(!$n(e))return;let i=t.item;Yn(e,i.filename,e.query("GET_LABEL_FILE_REMOVED"))},Ed=({root:e,action:t})=>{let a=e.query("GET_ITEM",t.id).filename,n=e.query("GET_LABEL_FILE_PROCESSING_COMPLETE");di(e,`${a} ${n}`)},rn=({root:e,action:t})=>{let a=e.query("GET_ITEM",t.id).filename,n=e.query("GET_LABEL_FILE_PROCESSING_ABORTED");di(e,`${a} ${n}`)},Kt=({root:e,action:t})=>{let a=e.query("GET_ITEM",t.id).filename;di(e,`${t.status.main} ${a} ${t.status.sub}`)},Td=re({create:md,ignoreRect:!0,ignoreRectUpdate:!0,write:fe({DID_LOAD_ITEM:fd,DID_REMOVE_ITEM:gd,DID_COMPLETE_ITEM_PROCESSING:Ed,DID_ABORT_ITEM_PROCESSING:rn,DID_REVERT_ITEM_PROCESSING:rn,DID_THROW_ITEM_REMOVE_ERROR:Kt,DID_THROW_ITEM_LOAD_ERROR:Kt,DID_THROW_ITEM_INVALID:Kt,DID_THROW_ITEM_PROCESSING_ERROR:Kt}),tag:"span",name:"assistant"}),qn=(e,t="-")=>e.replace(new RegExp(`${t}.`,"g"),i=>i.charAt(1).toUpperCase()),jn=(e,t=16,i=!0)=>{let a=Date.now(),n=null;return(...r)=>{clearTimeout(n);let l=Date.now()-a,o=()=>{a=Date.now(),e(...r)};le.preventDefault(),Id=({root:e,props:t})=>{let i=e.query("GET_ID");i&&(e.element.id=i);let a=e.query("GET_CLASS_NAME");a&&a.split(" ").filter(s=>s.length).forEach(s=>{e.element.classList.add(s)}),e.ref.label=e.appendChildView(e.createChildView(yc,{...t,translateY:null,caption:e.query("GET_LABEL_IDLE")})),e.ref.list=e.appendChildView(e.createChildView(Ec,{translateY:null})),e.ref.panel=e.appendChildView(e.createChildView(Dn,{name:"panel-root"})),e.ref.assistant=e.appendChildView(e.createChildView(Td,{...t})),e.ref.data=e.appendChildView(e.createChildView(Gc,{...t})),e.ref.measure=Be("div"),e.ref.measure.style.height="100%",e.element.appendChild(e.ref.measure),e.ref.bounds=null,e.query("GET_STYLES").filter(s=>!Ne(s.value)).map(({name:s,value:u})=>{e.element.dataset[s]=u}),e.ref.widthPrevious=null,e.ref.widthUpdated=jn(()=>{e.ref.updateHistory=[],e.dispatch("DID_RESIZE_ROOT")},250),e.ref.previousAspectRatio=null,e.ref.updateHistory=[];let n=window.matchMedia("(pointer: fine) and (hover: hover)").matches,r="PointerEvent"in window;e.query("GET_ALLOW_REORDER")&&r&&!n&&(e.element.addEventListener("touchmove",ai,{passive:!1}),e.element.addEventListener("gesturestart",ai));let l=e.query("GET_CREDITS");if(l.length===2){let s=document.createElement("a");s.className="filepond--credits",s.setAttribute("aria-hidden","true"),s.href=l[0],s.tabindex=-1,s.target="_blank",s.rel="noopener noreferrer",s.textContent=l[1],e.element.appendChild(s),e.ref.credits=s}},_d=({root:e,props:t,actions:i})=>{if(vd({root:e,props:t,actions:i}),i.filter(T=>/^DID_SET_STYLE_/.test(T.type)).filter(T=>!Ne(T.data.value)).map(({type:T,data:v})=>{let R=qn(T.substring(8).toLowerCase(),"_");e.element.dataset[R]=v.value,e.invalidateLayout()}),e.rect.element.hidden)return;e.rect.element.width!==e.ref.widthPrevious&&(e.ref.widthPrevious=e.rect.element.width,e.ref.widthUpdated());let a=e.ref.bounds;a||(a=e.ref.bounds=Sd(e),e.element.removeChild(e.ref.measure),e.ref.measure=null);let{hopper:n,label:r,list:l,panel:o}=e.ref;n&&n.updateHopperState();let s=e.query("GET_PANEL_ASPECT_RATIO"),u=e.query("GET_ALLOW_MULTIPLE"),c=e.query("GET_TOTAL_ITEMS"),d=u?e.query("GET_MAX_FILES")||bd:1,h=c===d,m=i.find(T=>T.type==="DID_ADD_ITEM");if(h&&m){let T=m.data.interactionMethod;r.opacity=0,u?r.translateY=-40:T===Se.API?r.translateX=40:T===Se.BROWSE?r.translateY=40:r.translateY=30}else h||(r.opacity=1,r.translateX=0,r.translateY=0);let p=Rd(e),f=yd(e),g=r.rect.element.height,I=!u||h?0:g,E=h?l.rect.element.marginTop:0,b=c===0?0:l.rect.element.marginBottom,_=I+E+f.visual+b,y=I+E+f.bounds+b;if(l.translateY=Math.max(0,I-l.rect.element.marginTop)-p.top,s){let T=e.rect.element.width,v=T*s;s!==e.ref.previousAspectRatio&&(e.ref.previousAspectRatio=s,e.ref.updateHistory=[]);let R=e.ref.updateHistory;R.push(T);let S=2;if(R.length>S*2){let O=R.length,x=O-10,z=0;for(let L=O;L>=x;L--)if(R[L]===R[L-2]&&z++,z>=S)return}o.scalable=!1,o.height=v;let P=v-I-(b-p.bottom)-(h?E:0);f.visual>P?l.overflow=P:l.overflow=null,e.height=v}else if(a.fixedHeight){o.scalable=!1;let T=a.fixedHeight-I-(b-p.bottom)-(h?E:0);f.visual>T?l.overflow=T:l.overflow=null}else if(a.cappedHeight){let T=_>=a.cappedHeight,v=Math.min(a.cappedHeight,_);o.scalable=!0,o.height=T?v:v-p.top-p.bottom;let R=v-I-(b-p.bottom)-(h?E:0);_>a.cappedHeight&&f.visual>R?l.overflow=R:l.overflow=null,e.height=Math.min(a.cappedHeight,y-p.top-p.bottom)}else{let T=c>0?p.top+p.bottom:0;o.scalable=!0,o.height=Math.max(g,_-T),e.height=Math.max(g,y-T)}e.ref.credits&&o.heightCurrent&&(e.ref.credits.style.transform=`translateY(${o.heightCurrent}px)`)},Rd=e=>{let t=e.ref.list.childViews[0].childViews[0];return t?{top:t.rect.element.marginTop,bottom:t.rect.element.marginBottom}:{top:0,bottom:0}},yd=e=>{let t=0,i=0,a=e.ref.list,n=a.childViews[0],r=n.childViews.filter(E=>E.rect.element.height),l=e.query("GET_ACTIVE_ITEMS").map(E=>r.find(b=>b.id===E.id)).filter(E=>E);if(l.length===0)return{visual:t,bounds:i};let o=n.rect.element.width,s=ji(n,l,a.dragCoordinates),u=l[0].rect.element,c=u.marginTop+u.marginBottom,d=u.marginLeft+u.marginRight,h=u.width+d,m=u.height+c,p=typeof s<"u"&&s>=0?1:0,f=l.find(E=>E.markedForRemoval&&E.opacity<.45)?-1:0,g=l.length+p+f,I=qi(o,h);return I===1?l.forEach(E=>{let b=E.rect.element.height+c;i+=b,t+=b*E.opacity}):(i=Math.ceil(g/I)*m,t=i),{visual:t,bounds:i}},Sd=e=>{let t=e.ref.measureHeight||null;return{cappedHeight:parseInt(e.style.maxHeight,10)||null,fixedHeight:t===0?null:t}},Ji=(e,t)=>{let i=e.query("GET_ALLOW_REPLACE"),a=e.query("GET_ALLOW_MULTIPLE"),n=e.query("GET_TOTAL_ITEMS"),r=e.query("GET_MAX_FILES"),l=t.length;return!a&&l>1?(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:ie("warning",0,"Max files")}),!0):(r=a?r:1,!a&&i?!1:mt(r)&&n+l>r?(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:ie("warning",0,"Max files")}),!0):!1)},wd=(e,t,i)=>{let a=e.childViews[0];return ji(a,t,{left:i.scopeLeft-a.rect.element.left,top:i.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},ln=e=>{let t=e.query("GET_ALLOW_DROP"),i=e.query("GET_DISABLED"),a=t&&!i;if(a&&!e.ref.hopper){let n=cd(e.element,r=>{let l=e.query("GET_BEFORE_DROP_FILE")||(()=>!0);return e.query("GET_DROP_VALIDATION")?r.every(s=>Je("ALLOW_HOPPER_ITEM",s,{query:e.query}).every(u=>u===!0)&&l(s)):!0},{filterItems:r=>{let l=e.query("GET_IGNORED_FILES");return r.filter(o=>Ze(o)?!l.includes(o.name.toLowerCase()):!0)},catchesDropsOnPage:e.query("GET_DROP_ON_PAGE"),requiresDropOnElement:e.query("GET_DROP_ON_ELEMENT")});n.onload=(r,l)=>{let s=e.ref.list.childViews[0].childViews.filter(c=>c.rect.element.height),u=e.query("GET_ACTIVE_ITEMS").map(c=>s.find(d=>d.id===c.id)).filter(c=>c);Ae("ADD_ITEMS",r,{dispatch:e.dispatch}).then(c=>{if(Ji(e,c))return!1;e.dispatch("ADD_ITEMS",{items:c,index:wd(e.ref.list,u,l),interactionMethod:Se.DROP})}),e.dispatch("DID_DROP",{position:l}),e.dispatch("DID_END_DRAG",{position:l})},n.ondragstart=r=>{e.dispatch("DID_START_DRAG",{position:r})},n.ondrag=jn(r=>{e.dispatch("DID_DRAG",{position:r})}),n.ondragend=r=>{e.dispatch("DID_END_DRAG",{position:r})},e.ref.hopper=n,e.ref.drip=e.appendChildView(e.createChildView(Oc))}else!a&&e.ref.hopper&&(e.ref.hopper.destroy(),e.ref.hopper=null,e.removeChildView(e.ref.drip))},on=(e,t)=>{let i=e.query("GET_ALLOW_BROWSE"),a=e.query("GET_DISABLED"),n=i&&!a;n&&!e.ref.browser?e.ref.browser=e.appendChildView(e.createChildView(_c,{...t,onload:r=>{Ae("ADD_ITEMS",r,{dispatch:e.dispatch}).then(l=>{if(Ji(e,l))return!1;e.dispatch("ADD_ITEMS",{items:l,index:-1,interactionMethod:Se.BROWSE})})}}),0):!n&&e.ref.browser&&(e.removeChildView(e.ref.browser),e.ref.browser=null)},sn=e=>{let t=e.query("GET_ALLOW_PASTE"),i=e.query("GET_DISABLED"),a=t&&!i;a&&!e.ref.paster?(e.ref.paster=hd(),e.ref.paster.onload=n=>{Ae("ADD_ITEMS",n,{dispatch:e.dispatch}).then(r=>{if(Ji(e,r))return!1;e.dispatch("ADD_ITEMS",{items:r,index:-1,interactionMethod:Se.PASTE})})}):!a&&e.ref.paster&&(e.ref.paster.destroy(),e.ref.paster=null)},vd=fe({DID_SET_ALLOW_BROWSE:({root:e,props:t})=>{on(e,t)},DID_SET_ALLOW_DROP:({root:e})=>{ln(e)},DID_SET_ALLOW_PASTE:({root:e})=>{sn(e)},DID_SET_DISABLED:({root:e,props:t})=>{ln(e),sn(e),on(e,t),e.query("GET_DISABLED")?e.element.dataset.disabled="disabled":e.element.removeAttribute("data-disabled")}}),Ld=re({name:"root",read:({root:e})=>{e.ref.measure&&(e.ref.measureHeight=e.ref.measure.offsetHeight)},create:Id,write:_d,destroy:({root:e})=>{e.ref.paster&&e.ref.paster.destroy(),e.ref.hopper&&e.ref.hopper.destroy(),e.element.removeEventListener("touchmove",ai),e.element.removeEventListener("gesturestart",ai)},mixins:{styles:["height"]}}),Ad=(e={})=>{let t=null,i=ti(),a=Wl(xo(i),[jo,Do(i)],[bs,Po(i)]);a.dispatch("SET_OPTIONS",{options:e});let n=()=>{document.hidden||a.dispatch("KICK")};document.addEventListener("visibilitychange",n);let r=null,l=!1,o=!1,s=null,u=null,c=()=>{l||(l=!0),clearTimeout(r),r=setTimeout(()=>{l=!1,s=null,u=null,o&&(o=!1,a.dispatch("DID_STOP_RESIZE"))},500)};window.addEventListener("resize",c);let d=Ld(a,{id:ki()}),h=!1,m=!1,p={_read:()=>{l&&(u=window.innerWidth,s||(s=u),!o&&u!==s&&(a.dispatch("DID_START_RESIZE"),o=!0)),m&&h&&(h=d.element.offsetParent===null),!h&&(d._read(),m=d.rect.element.hidden)},_write:w=>{let A=a.processActionQueue().filter(C=>!/^SET_/.test(C.type));h&&!A.length||(E(A),h=d._write(w,A,o),zo(a.query("GET_ITEMS")),h&&a.processDispatchQueue())}},f=w=>A=>{let C={type:w};if(!A)return C;if(A.hasOwnProperty("error")&&(C.error=A.error?{...A.error}:null),A.status&&(C.status={...A.status}),A.file&&(C.output=A.file),A.source)C.file=A.source;else if(A.item||A.id){let D=A.item?A.item:a.query("GET_ITEM",A.id);C.file=D?ge(D):null}return A.items&&(C.items=A.items.map(ge)),/progress/.test(w)&&(C.progress=A.progress),A.hasOwnProperty("origin")&&A.hasOwnProperty("target")&&(C.origin=A.origin,C.target=A.target),C},g={DID_DESTROY:f("destroy"),DID_INIT:f("init"),DID_THROW_MAX_FILES:f("warning"),DID_INIT_ITEM:f("initfile"),DID_START_ITEM_LOAD:f("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:f("addfileprogress"),DID_LOAD_ITEM:f("addfile"),DID_THROW_ITEM_INVALID:[f("error"),f("addfile")],DID_THROW_ITEM_LOAD_ERROR:[f("error"),f("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[f("error"),f("removefile")],DID_PREPARE_OUTPUT:f("preparefile"),DID_START_ITEM_PROCESSING:f("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:f("processfileprogress"),DID_ABORT_ITEM_PROCESSING:f("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:f("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:f("processfiles"),DID_REVERT_ITEM_PROCESSING:f("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[f("error"),f("processfile")],DID_REMOVE_ITEM:f("removefile"),DID_UPDATE_ITEMS:f("updatefiles"),DID_ACTIVATE_ITEM:f("activatefile"),DID_REORDER_ITEMS:f("reorderfiles")},I=w=>{let A={pond:F,...w};delete A.type,d.element.dispatchEvent(new CustomEvent(`FilePond:${w.type}`,{detail:A,bubbles:!0,cancelable:!0,composed:!0}));let C=[];w.hasOwnProperty("error")&&C.push(w.error),w.hasOwnProperty("file")&&C.push(w.file);let D=["type","error","file"];Object.keys(w).filter(B=>!D.includes(B)).forEach(B=>C.push(w[B])),F.fire(w.type,...C);let V=a.query(`GET_ON${w.type.toUpperCase()}`);V&&V(...C)},E=w=>{w.length&&w.filter(A=>g[A.type]).forEach(A=>{let C=g[A.type];(Array.isArray(C)?C:[C]).forEach(D=>{A.type==="DID_INIT_ITEM"?I(D(A.data)):setTimeout(()=>{I(D(A.data))},0)})})},b=w=>a.dispatch("SET_OPTIONS",{options:w}),_=w=>a.query("GET_ACTIVE_ITEM",w),y=w=>new Promise((A,C)=>{a.dispatch("REQUEST_ITEM_PREPARE",{query:w,success:D=>{A(D)},failure:D=>{C(D)}})}),T=(w,A={})=>new Promise((C,D)=>{S([{source:w,options:A}],{index:A.index}).then(V=>C(V&&V[0])).catch(D)}),v=w=>w.file&&w.id,R=(w,A)=>(typeof w=="object"&&!v(w)&&!A&&(A=w,w=void 0),a.dispatch("REMOVE_ITEM",{...A,query:w}),a.query("GET_ACTIVE_ITEM",w)===null),S=(...w)=>new Promise((A,C)=>{let D=[],V={};if(ni(w[0]))D.push.apply(D,w[0]),Object.assign(V,w[1]||{});else{let B=w[w.length-1];typeof B=="object"&&!(B instanceof Blob)&&Object.assign(V,w.pop()),D.push(...w)}a.dispatch("ADD_ITEMS",{items:D,index:V.index,interactionMethod:Se.API,success:A,failure:C})}),P=()=>a.query("GET_ACTIVE_ITEMS"),O=w=>new Promise((A,C)=>{a.dispatch("REQUEST_ITEM_PROCESSING",{query:w,success:D=>{A(D)},failure:D=>{C(D)}})}),x=(...w)=>{let A=Array.isArray(w[0])?w[0]:w,C=A.length?A:P();return Promise.all(C.map(y))},z=(...w)=>{let A=Array.isArray(w[0])?w[0]:w;if(!A.length){let C=P().filter(D=>!(D.status===k.IDLE&&D.origin===se.LOCAL)&&D.status!==k.PROCESSING&&D.status!==k.PROCESSING_COMPLETE&&D.status!==k.PROCESSING_REVERT_ERROR);return Promise.all(C.map(O))}return Promise.all(A.map(O))},L=(...w)=>{let A=Array.isArray(w[0])?w[0]:w,C;typeof A[A.length-1]=="object"?C=A.pop():Array.isArray(w[0])&&(C=w[1]);let D=P();return A.length?A.map(B=>$e(B)?D[B]?D[B].id:null:B).filter(B=>B).map(B=>R(B,C)):Promise.all(D.map(B=>R(B,C)))},F={...oi(),...p,...Oo(a,i),setOptions:b,addFile:T,addFiles:S,getFile:_,processFile:O,prepareFile:y,removeFile:R,moveFile:(w,A)=>a.dispatch("MOVE_ITEM",{query:w,index:A}),getFiles:P,processFiles:z,removeFiles:L,prepareFiles:x,sort:w=>a.dispatch("SORT",{compare:w}),browse:()=>{var w=d.element.querySelector("input[type=file]");w&&w.click()},destroy:()=>{F.fire("destroy",d.element),a.dispatch("ABORT_ALL"),d._destroy(),window.removeEventListener("resize",c),document.removeEventListener("visibilitychange",n),a.dispatch("DID_DESTROY")},insertBefore:w=>xa(d.element,w),insertAfter:w=>Oa(d.element,w),appendTo:w=>w.appendChild(d.element),replaceElement:w=>{xa(d.element,w),w.parentNode.removeChild(w),t=w},restoreElement:()=>{t&&(Oa(t,d.element),d.element.parentNode.removeChild(d.element),t=null)},isAttachedTo:w=>d.element===w||t===w,element:{get:()=>d.element},status:{get:()=>a.query("GET_STATUS")}};return a.dispatch("DID_INIT"),Ue(F)},Xn=(e={})=>{let t={};return te(ti(),(a,n)=>{t[a]=n[0]}),Ad({...t,...e})},Md=e=>e.charAt(0).toLowerCase()+e.slice(1),xd=e=>qn(e.replace(/^data-/,"")),Qn=(e,t)=>{te(t,(i,a)=>{te(e,(n,r)=>{let l=new RegExp(i);if(!l.test(n)||(delete e[n],a===!1))return;if(pe(a)){e[a]=r;return}let s=a.group;ce(a)&&!e[s]&&(e[s]={}),e[s][Md(n.replace(l,""))]=r}),a.mapping&&Qn(e[a.group],a.mapping)})},Od=(e,t={})=>{let i=[];te(e.attributes,n=>{i.push(e.attributes[n])});let a=i.filter(n=>n.name).reduce((n,r)=>{let l=ne(e,r.name);return n[xd(r.name)]=l===r.name?!0:l,n},{});return Qn(a,t),a},Pd=(e,t={})=>{let i={"^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};Je("SET_ATTRIBUTE_TO_OPTION_MAP",i);let a={...t},n=Od(e.nodeName==="FIELDSET"?e.querySelector("input[type=file]"):e,i);Object.keys(n).forEach(l=>{ce(n[l])?(ce(a[l])||(a[l]={}),Object.assign(a[l],n[l])):a[l]=n[l]}),a.files=(t.files||[]).concat(Array.from(e.querySelectorAll("input:not([type=file])")).map(l=>({source:l.value,options:{type:l.dataset.type}})));let r=Xn(a);return e.files&&Array.from(e.files).forEach(l=>{r.addFile(l)}),r.replaceElement(e),r},Dd=(...e)=>Hl(e[0])?Pd(...e):Xn(...e),Fd=["fire","_read","_write"],cn=e=>{let t={};return En(e,t,Fd),t},Cd=(e,t)=>e.replace(/(?:{([a-zA-Z]+)})/g,(i,a)=>t[a]),zd=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i);return{transfer:(n,r)=>{},post:(n,r,l)=>{let o=ki();a.onmessage=s=>{s.data.id===o&&r(s.data.message)},a.postMessage({id:o,message:n},l)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},Nd=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Zn=(e,t)=>{let i=e.slice(0,e.size,e.type);return i.lastModifiedDate=e.lastModifiedDate,i.name=t,i},Bd=e=>Zn(e,e.name),dn=[],Vd=e=>{if(dn.includes(e))return;dn.push(e);let t=e({addFilter:Bo,utils:{Type:M,forin:te,isString:pe,isFile:Ze,toNaturalFileSize:xn,replaceInString:Cd,getExtensionFromFilename:si,getFilenameWithoutExtension:Ln,guesstimateMimeType:Un,getFileFromBlob:ht,getFilenameFromURL:Ot,createRoute:fe,createWorker:zd,createView:re,createItemAPI:ge,loadImage:Nd,copyFile:Bd,renameFile:Zn,createBlob:Sn,applyFilterChain:Ae,text:ae,getNumericAspectRatioFromString:In},views:{fileActionButton:Mn}});Vo(t.options)},Gd=()=>Object.prototype.toString.call(window.operamini)==="[object OperaMini]",Ud=()=>"Promise"in window,kd=()=>"slice"in Blob.prototype,Hd=()=>"URL"in window&&"createObjectURL"in window.URL,Wd=()=>"visibilityState"in document,Yd=()=>"performance"in window,$d=()=>"supports"in(window.CSS||{}),qd=()=>/MSIE|Trident/.test(window.navigator.userAgent),zi=(()=>{let e=un()&&!Gd()&&Wd()&&Ud()&&kd()&&Hd()&&Yd()&&($d()||qd());return()=>e})(),Ge={apps:[]},jd="filepond",et=()=>{},Kn={},pt={},Pt={},Ni={},dt=et,ut=et,Bi=et,Vi=et,_e=et,Gi=et,xt=et;if(zi()){go(()=>{Ge.apps.forEach(i=>i._read())},i=>{Ge.apps.forEach(a=>a._write(i))});let e=()=>{document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:zi,create:dt,destroy:ut,parse:Bi,find:Vi,registerPlugin:_e,setOptions:xt}})),document.removeEventListener("DOMContentLoaded",e)};document.readyState!=="loading"?setTimeout(()=>e(),0):document.addEventListener("DOMContentLoaded",e);let t=()=>te(ti(),(i,a)=>{Ni[i]=a[1]});Kn={..._n},Pt={...se},pt={...k},Ni={},t(),dt=(...i)=>{let a=Dd(...i);return a.on("destroy",ut),Ge.apps.push(a),cn(a)},ut=i=>{let a=Ge.apps.findIndex(n=>n.isAttachedTo(i));return a>=0?(Ge.apps.splice(a,1)[0].restoreElement(),!0):!1},Bi=i=>Array.from(i.querySelectorAll(`.${jd}`)).filter(r=>!Ge.apps.find(l=>l.isAttachedTo(r))).map(r=>dt(r)),Vi=i=>{let a=Ge.apps.find(n=>n.isAttachedTo(i));return a?cn(a):null},_e=(...i)=>{i.forEach(Vd),t()},Gi=()=>{let i={};return te(ti(),(a,n)=>{i[a]=n[0]}),i},xt=i=>(ce(i)&&(Ge.apps.forEach(a=>{a.setOptions(i)}),Go(i)),Gi())}function Jn(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function fr(e){for(var t=1;te.length)&&(t=e.length);for(var i=0,a=new Array(t);i
',hu=Number.isNaN||De.isNaN;function Y(e){return typeof e=="number"&&!hu(e)}var hr=function(t){return t>0&&t<1/0};function ta(e){return typeof e>"u"}function at(e){return aa(e)==="object"&&e!==null}var mu=Object.prototype.hasOwnProperty;function gt(e){if(!at(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&mu.call(i,"isPrototypeOf")}catch{return!1}}function Ee(e){return typeof e=="function"}var pu=Array.prototype.slice;function wr(e){return Array.from?Array.from(e):pu.call(e)}function le(e,t){return e&&Ee(t)&&(Array.isArray(e)||Y(e.length)?wr(e).forEach(function(i,a){t.call(e,i,a,e)}):at(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var K=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n0&&a.forEach(function(r){at(r)&&Object.keys(r).forEach(function(l){t[l]=r[l]})}),t},fu=/\.\d*(?:0|9){12}\d*$/;function Tt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return fu.test(e)?Math.round(e*t)/t:e}var gu=/^width|height|left|top|marginLeft|marginTop$/;function He(e,t){var i=e.style;le(t,function(a,n){gu.test(n)&&Y(a)&&(a="".concat(a,"px")),i[n]=a})}function Eu(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function de(e,t){if(t){if(Y(e.length)){le(e,function(a){de(a,t)});return}if(e.classList){e.classList.add(t);return}var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function Pe(e,t){if(t){if(Y(e.length)){le(e,function(i){Pe(i,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,""))}}function Et(e,t,i){if(t){if(Y(e.length)){le(e,function(a){Et(a,t,i)});return}i?de(e,t):Pe(e,t)}}var Tu=/([a-z\d])([A-Z])/g;function Ea(e){return e.replace(Tu,"$1-$2").toLowerCase()}function ha(e,t){return at(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Ea(t)))}function Vt(e,t,i){at(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(Ea(t)),i)}function bu(e,t){if(at(e[t]))try{delete e[t]}catch{e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch{e.dataset[t]=void 0}else e.removeAttribute("data-".concat(Ea(t)))}var vr=/\s\s*/,Lr=function(){var e=!1;if(pi){var t=!1,i=function(){},a=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(r){t=r}});De.addEventListener("test",i,a),De.removeEventListener("test",i,a)}return e}();function Oe(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(vr).forEach(function(r){if(!Lr){var l=e.listeners;l&&l[r]&&l[r][i]&&(n=l[r][i],delete l[r][i],Object.keys(l[r]).length===0&&delete l[r],Object.keys(l).length===0&&delete e.listeners)}e.removeEventListener(r,n,a)})}function we(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(vr).forEach(function(r){if(a.once&&!Lr){var l=e.listeners,o=l===void 0?{}:l;n=function(){delete o[r][i],e.removeEventListener(r,n,a);for(var u=arguments.length,c=new Array(u),d=0;dMath.abs(i)&&(i=h)})}),i}function hi(e,t){var i=e.pageX,a=e.pageY,n={endX:i,endY:a};return t?n:fr({startX:i,startY:a},n)}function Ru(e){var t=0,i=0,a=0;return le(e,function(n){var r=n.startX,l=n.startY;t+=r,i+=l,a+=1}),t/=a,i/=a,{pageX:t,pageY:i}}function We(e){var t=e.aspectRatio,i=e.height,a=e.width,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=hr(a),l=hr(i);if(r&&l){var o=i*t;n==="contain"&&o>a||n==="cover"&&o90?{width:s,height:o}:{width:o,height:s}}function Su(e,t,i,a){var n=t.aspectRatio,r=t.naturalWidth,l=t.naturalHeight,o=t.rotate,s=o===void 0?0:o,u=t.scaleX,c=u===void 0?1:u,d=t.scaleY,h=d===void 0?1:d,m=i.aspectRatio,p=i.naturalWidth,f=i.naturalHeight,g=a.fillColor,I=g===void 0?"transparent":g,E=a.imageSmoothingEnabled,b=E===void 0?!0:E,_=a.imageSmoothingQuality,y=_===void 0?"low":_,T=a.maxWidth,v=T===void 0?1/0:T,R=a.maxHeight,S=R===void 0?1/0:R,P=a.minWidth,O=P===void 0?0:P,x=a.minHeight,z=x===void 0?0:x,L=document.createElement("canvas"),F=L.getContext("2d"),w=We({aspectRatio:m,width:v,height:S}),A=We({aspectRatio:m,width:O,height:z},"cover"),C=Math.min(w.width,Math.max(A.width,p)),D=Math.min(w.height,Math.max(A.height,f)),V=We({aspectRatio:n,width:v,height:S}),B=We({aspectRatio:n,width:O,height:z},"cover"),j=Math.min(V.width,Math.max(B.width,r)),q=Math.min(V.height,Math.max(B.height,l)),X=[-j/2,-q/2,j,q];return L.width=Tt(C),L.height=Tt(D),F.fillStyle=I,F.fillRect(0,0,C,D),F.save(),F.translate(C/2,D/2),F.rotate(s*Math.PI/180),F.scale(c,h),F.imageSmoothingEnabled=b,F.imageSmoothingQuality=y,F.drawImage.apply(F,[e].concat(Er(X.map(function(ue){return Math.floor(Tt(ue))})))),F.restore(),L}var Mr=String.fromCharCode;function wu(e,t,i){var a="";i+=t;for(var n=t;n0;)i.push(Mr.apply(null,wr(n.subarray(0,a)))),n=n.subarray(a);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}function Mu(e){var t=new DataView(e),i;try{var a,n,r;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var l=t.byteLength,o=2;o+1=8&&(r=u+d)}}}if(r){var h=t.getUint16(r,a),m,p;for(p=0;p=0?r:yr),height:Math.max(a.offsetHeight,l>=0?l:Sr)};this.containerData=o,He(n,{width:o.width,height:o.height}),de(t,Te),Pe(n,Te)},initCanvas:function(){var t=this.containerData,i=this.imageData,a=this.options.viewMode,n=Math.abs(i.rotate)%180===90,r=n?i.naturalHeight:i.naturalWidth,l=n?i.naturalWidth:i.naturalHeight,o=r/l,s=t.width,u=t.height;t.height*o>t.width?a===3?s=t.height*o:u=t.width/o:a===3?u=t.width/o:s=t.height*o;var c={aspectRatio:o,naturalWidth:r,naturalHeight:l,width:s,height:u};this.canvasData=c,this.limited=a===1||a===2,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=K({},c)},limitCanvas:function(t,i){var a=this.options,n=this.containerData,r=this.canvasData,l=this.cropBoxData,o=a.viewMode,s=r.aspectRatio,u=this.cropped&&l;if(t){var c=Number(a.minCanvasWidth)||0,d=Number(a.minCanvasHeight)||0;o>1?(c=Math.max(c,n.width),d=Math.max(d,n.height),o===3&&(d*s>c?c=d*s:d=c/s)):o>0&&(c?c=Math.max(c,u?l.width:0):d?d=Math.max(d,u?l.height:0):u&&(c=l.width,d=l.height,d*s>c?c=d*s:d=c/s));var h=We({aspectRatio:s,width:c,height:d});c=h.width,d=h.height,r.minWidth=c,r.minHeight=d,r.maxWidth=1/0,r.maxHeight=1/0}if(i)if(o>(u?0:1)){var m=n.width-r.width,p=n.height-r.height;r.minLeft=Math.min(0,m),r.minTop=Math.min(0,p),r.maxLeft=Math.max(0,m),r.maxTop=Math.max(0,p),u&&this.limited&&(r.minLeft=Math.min(l.left,l.left+(l.width-r.width)),r.minTop=Math.min(l.top,l.top+(l.height-r.height)),r.maxLeft=l.left,r.maxTop=l.top,o===2&&(r.width>=n.width&&(r.minLeft=Math.min(0,m),r.maxLeft=Math.max(0,m)),r.height>=n.height&&(r.minTop=Math.min(0,p),r.maxTop=Math.max(0,p))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=n.width,r.maxTop=n.height},renderCanvas:function(t,i){var a=this.canvasData,n=this.imageData;if(i){var r=yu({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),l=r.width,o=r.height,s=a.width*(l/a.naturalWidth),u=a.height*(o/a.naturalHeight);a.left-=(s-a.width)/2,a.top-=(u-a.height)/2,a.width=s,a.height=u,a.aspectRatio=l/o,a.naturalWidth=l,a.naturalHeight=o,this.limitCanvas(!0,!1)}(a.width>a.maxWidth||a.widtha.maxHeight||a.heighti.width?r.height=r.width/a:r.width=r.height*a),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*n),r.height=Math.max(r.minHeight,r.height*n),r.left=i.left+(i.width-r.width)/2,r.top=i.top+(i.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=K({},r)},limitCropBox:function(t,i){var a=this.options,n=this.containerData,r=this.canvasData,l=this.cropBoxData,o=this.limited,s=a.aspectRatio;if(t){var u=Number(a.minCropBoxWidth)||0,c=Number(a.minCropBoxHeight)||0,d=o?Math.min(n.width,r.width,r.width+r.left,n.width-r.left):n.width,h=o?Math.min(n.height,r.height,r.height+r.top,n.height-r.top):n.height;u=Math.min(u,n.width),c=Math.min(c,n.height),s&&(u&&c?c*s>u?c=u/s:u=c*s:u?c=u/s:c&&(u=c*s),h*s>d?h=d/s:d=h*s),l.minWidth=Math.min(u,d),l.minHeight=Math.min(c,h),l.maxWidth=d,l.maxHeight=h}i&&(o?(l.minLeft=Math.max(0,r.left),l.minTop=Math.max(0,r.top),l.maxLeft=Math.min(n.width,r.left+r.width)-l.width,l.maxTop=Math.min(n.height,r.top+r.height)-l.height):(l.minLeft=0,l.minTop=0,l.maxLeft=n.width-l.width,l.maxTop=n.height-l.height))},renderCropBox:function(){var t=this.options,i=this.containerData,a=this.cropBoxData;(a.width>a.maxWidth||a.widtha.maxHeight||a.height=i.width&&a.height>=i.height?br:fa),He(this.cropBox,K({width:a.width,height:a.height},Nt({translateX:a.left,translateY:a.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),bt(this.element,oa,this.getData())}},Pu={initPreview:function(){var t=this.element,i=this.crossOrigin,a=this.options.preview,n=i?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",l=document.createElement("img");if(i&&(l.crossOrigin=i),l.src=n,l.alt=r,this.viewBox.appendChild(l),this.viewBoxImage=l,!!a){var o=a;typeof a=="string"?o=t.ownerDocument.querySelectorAll(a):a.querySelector&&(o=[a]),this.previews=o,le(o,function(s){var u=document.createElement("img");Vt(s,ui,{width:s.offsetWidth,height:s.offsetHeight,html:s.innerHTML}),i&&(u.crossOrigin=i),u.src=n,u.alt=r,u.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',s.innerHTML="",s.appendChild(u)})}},resetPreview:function(){le(this.previews,function(t){var i=ha(t,ui);He(t,{width:i.width,height:i.height}),t.innerHTML=i.html,bu(t,ui)})},preview:function(){var t=this.imageData,i=this.canvasData,a=this.cropBoxData,n=a.width,r=a.height,l=t.width,o=t.height,s=a.left-i.left-t.left,u=a.top-i.top-t.top;!this.cropped||this.disabled||(He(this.viewBoxImage,K({width:l,height:o},Nt(K({translateX:-s,translateY:-u},t)))),le(this.previews,function(c){var d=ha(c,ui),h=d.width,m=d.height,p=h,f=m,g=1;n&&(g=h/n,f=r*g),r&&f>m&&(g=m/r,p=n*g,f=m),He(c,{width:p,height:f}),He(c.getElementsByTagName("img")[0],K({width:l*g,height:o*g},Nt(K({translateX:-s*g,translateY:-u*g},t))))}))}},Du={bind:function(){var t=this.element,i=this.options,a=this.cropper;Ee(i.cropstart)&&we(t,da,i.cropstart),Ee(i.cropmove)&&we(t,ca,i.cropmove),Ee(i.cropend)&&we(t,sa,i.cropend),Ee(i.crop)&&we(t,oa,i.crop),Ee(i.zoom)&&we(t,ua,i.zoom),we(a,nr,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&we(a,cr,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&we(a,ar,this.onDblclick=this.dblclick.bind(this)),we(t.ownerDocument,rr,this.onCropMove=this.cropMove.bind(this)),we(t.ownerDocument,lr,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&we(window,sr,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,a=this.cropper;Ee(i.cropstart)&&Oe(t,da,i.cropstart),Ee(i.cropmove)&&Oe(t,ca,i.cropmove),Ee(i.cropend)&&Oe(t,sa,i.cropend),Ee(i.crop)&&Oe(t,oa,i.crop),Ee(i.zoom)&&Oe(t,ua,i.zoom),Oe(a,nr,this.onCropStart),i.zoomable&&i.zoomOnWheel&&Oe(a,cr,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&Oe(a,ar,this.onDblclick),Oe(t.ownerDocument,rr,this.onCropMove),Oe(t.ownerDocument,lr,this.onCropEnd),i.responsive&&Oe(window,sr,this.onResize)}},Fu={resize:function(){if(!this.disabled){var t=this.options,i=this.container,a=this.containerData,n=i.offsetWidth/a.width,r=i.offsetHeight/a.height,l=Math.abs(n-1)>Math.abs(r-1)?n:r;if(l!==1){var o,s;t.restore&&(o=this.getCanvasData(),s=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(le(o,function(u,c){o[c]=u*l})),this.setCropBoxData(le(s,function(u,c){s[c]=u*l})))}}},dblclick:function(){this.disabled||this.options.dragMode===Rr||this.setDragMode(Eu(this.dragBox,ra)?_r:ga)},wheel:function(t){var i=this,a=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*a,t)))},cropStart:function(t){var i=t.buttons,a=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(Y(i)&&i!==1||Y(a)&&a!==0||t.ctrlKey))){var n=this.options,r=this.pointers,l;t.changedTouches?le(t.changedTouches,function(o){r[o.identifier]=hi(o)}):r[t.pointerId||0]=hi(t),Object.keys(r).length>1&&n.zoomable&&n.zoomOnTouch?l=Ir:l=ha(t.target,Bt),ou.test(l)&&bt(this.element,da,{originalEvent:t,action:l})!==!1&&(t.preventDefault(),this.action=l,this.cropping=!1,l===Tr&&(this.cropping=!0,de(this.dragBox,mi)))}},cropMove:function(t){var i=this.action;if(!(this.disabled||!i)){var a=this.pointers;t.preventDefault(),bt(this.element,ca,{originalEvent:t,action:i})!==!1&&(t.changedTouches?le(t.changedTouches,function(n){K(a[n.identifier]||{},hi(n,!0))}):K(a[t.pointerId||0]||{},hi(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,a=this.pointers;t.changedTouches?le(t.changedTouches,function(n){delete a[n.identifier]}):delete a[t.pointerId||0],i&&(t.preventDefault(),Object.keys(a).length||(this.action=""),this.cropping&&(this.cropping=!1,Et(this.dragBox,mi,this.cropped&&this.options.modal)),bt(this.element,sa,{originalEvent:t,action:i}))}}},Cu={change:function(t){var i=this.options,a=this.canvasData,n=this.containerData,r=this.cropBoxData,l=this.pointers,o=this.action,s=i.aspectRatio,u=r.left,c=r.top,d=r.width,h=r.height,m=u+d,p=c+h,f=0,g=0,I=n.width,E=n.height,b=!0,_;!s&&t.shiftKey&&(s=d&&h?d/h:1),this.limited&&(f=r.minLeft,g=r.minTop,I=f+Math.min(n.width,a.width,a.left+a.width),E=g+Math.min(n.height,a.height,a.top+a.height));var y=l[Object.keys(l)[0]],T={x:y.endX-y.startX,y:y.endY-y.startY},v=function(S){switch(S){case tt:m+T.x>I&&(T.x=I-m);break;case it:u+T.xE&&(T.y=E-p);break}};switch(o){case fa:u+=T.x,c+=T.y;break;case tt:if(T.x>=0&&(m>=I||s&&(c<=g||p>=E))){b=!1;break}v(tt),d+=T.x,d<0&&(o=it,d=-d,u-=d),s&&(h=d/s,c+=(r.height-h)/2);break;case ke:if(T.y<=0&&(c<=g||s&&(u<=f||m>=I))){b=!1;break}v(ke),h-=T.y,c+=T.y,h<0&&(o=ft,h=-h,c-=h),s&&(d=h*s,u+=(r.width-d)/2);break;case it:if(T.x<=0&&(u<=f||s&&(c<=g||p>=E))){b=!1;break}v(it),d-=T.x,u+=T.x,d<0&&(o=tt,d=-d,u-=d),s&&(h=d/s,c+=(r.height-h)/2);break;case ft:if(T.y>=0&&(p>=E||s&&(u<=f||m>=I))){b=!1;break}v(ft),h+=T.y,h<0&&(o=ke,h=-h,c-=h),s&&(d=h*s,u+=(r.width-d)/2);break;case Dt:if(s){if(T.y<=0&&(c<=g||m>=I)){b=!1;break}v(ke),h-=T.y,c+=T.y,d=h*s}else v(ke),v(tt),T.x>=0?mg&&(h-=T.y,c+=T.y):(h-=T.y,c+=T.y);d<0&&h<0?(o=zt,h=-h,d=-d,c-=h,u-=d):d<0?(o=Ft,d=-d,u-=d):h<0&&(o=Ct,h=-h,c-=h);break;case Ft:if(s){if(T.y<=0&&(c<=g||u<=f)){b=!1;break}v(ke),h-=T.y,c+=T.y,d=h*s,u+=r.width-d}else v(ke),v(it),T.x<=0?u>f?(d-=T.x,u+=T.x):T.y<=0&&c<=g&&(b=!1):(d-=T.x,u+=T.x),T.y<=0?c>g&&(h-=T.y,c+=T.y):(h-=T.y,c+=T.y);d<0&&h<0?(o=Ct,h=-h,d=-d,c-=h,u-=d):d<0?(o=Dt,d=-d,u-=d):h<0&&(o=zt,h=-h,c-=h);break;case zt:if(s){if(T.x<=0&&(u<=f||p>=E)){b=!1;break}v(it),d-=T.x,u+=T.x,h=d/s}else v(ft),v(it),T.x<=0?u>f?(d-=T.x,u+=T.x):T.y>=0&&p>=E&&(b=!1):(d-=T.x,u+=T.x),T.y>=0?p=0&&(m>=I||p>=E)){b=!1;break}v(tt),d+=T.x,h=d/s}else v(ft),v(tt),T.x>=0?m=0&&p>=E&&(b=!1):d+=T.x,T.y>=0?p0?o=T.y>0?Ct:Dt:T.x<0&&(u-=d,o=T.y>0?zt:Ft),T.y<0&&(c-=h),this.cropped||(Pe(this.cropBox,Te),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}b&&(r.width=d,r.height=h,r.left=u,r.top=c,this.action=o,this.renderCropBox()),le(l,function(R){R.startX=R.endX,R.startY=R.endY})}},zu={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&de(this.dragBox,mi),Pe(this.cropBox,Te),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=K({},this.initialImageData),this.canvasData=K({},this.initialCanvasData),this.cropBoxData=K({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(K(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Pe(this.dragBox,mi),de(this.cropBox,Te)),this},replace:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,le(this.previews,function(a){a.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Pe(this.cropper,tr)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,de(this.cropper,tr)),this},destroy:function(){var t=this.element;return t[Z]?(t[Z]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,n=a.left,r=a.top;return this.moveTo(ta(t)?t:n+Number(t),ta(i)?i:r+Number(i))},moveTo:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(Y(t)&&(a.left=t,n=!0),Y(i)&&(a.top=i,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,i){var a=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(a.width*t/a.naturalWidth,null,i)},zoomTo:function(t,i,a){var n=this.options,r=this.canvasData,l=r.width,o=r.height,s=r.naturalWidth,u=r.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&n.zoomable){var c=s*t,d=u*t;if(bt(this.element,ua,{ratio:t,oldRatio:l/s,originalEvent:a})===!1)return this;if(a){var h=this.pointers,m=Ar(this.cropper),p=h&&Object.keys(h).length?Ru(h):{pageX:a.pageX,pageY:a.pageY};r.left-=(c-l)*((p.pageX-m.left-r.left)/l),r.top-=(d-o)*((p.pageY-m.top-r.top)/o)}else gt(i)&&Y(i.x)&&Y(i.y)?(r.left-=(c-l)*((i.x-r.left)/l),r.top-=(d-o)*((i.y-r.top)/o)):(r.left-=(c-l)/2,r.top-=(d-o)/2);r.width=c,r.height=d,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),Y(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,Y(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(Y(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.imageData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(Y(t)&&(a.scaleX=t,n=!0),Y(i)&&(a.scaleY=i,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.options,a=this.imageData,n=this.canvasData,r=this.cropBoxData,l;if(this.ready&&this.cropped){l={x:r.left-n.left,y:r.top-n.top,width:r.width,height:r.height};var o=a.width/a.naturalWidth;if(le(l,function(c,d){l[d]=c/o}),t){var s=Math.round(l.y+l.height),u=Math.round(l.x+l.width);l.x=Math.round(l.x),l.y=Math.round(l.y),l.width=u-l.x,l.height=s-l.y}}else l={x:0,y:0,width:0,height:0};return i.rotatable&&(l.rotate=a.rotate||0),i.scalable&&(l.scaleX=a.scaleX||1,l.scaleY=a.scaleY||1),l},setData:function(t){var i=this.options,a=this.imageData,n=this.canvasData,r={};if(this.ready&&!this.disabled&>(t)){var l=!1;i.rotatable&&Y(t.rotate)&&t.rotate!==a.rotate&&(a.rotate=t.rotate,l=!0),i.scalable&&(Y(t.scaleX)&&t.scaleX!==a.scaleX&&(a.scaleX=t.scaleX,l=!0),Y(t.scaleY)&&t.scaleY!==a.scaleY&&(a.scaleY=t.scaleY,l=!0)),l&&this.renderCanvas(!0,!0);var o=a.width/a.naturalWidth;Y(t.x)&&(r.left=t.x*o+n.left),Y(t.y)&&(r.top=t.y*o+n.top),Y(t.width)&&(r.width=t.width*o),Y(t.height)&&(r.height=t.height*o),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?K({},this.containerData):{}},getImageData:function(){return this.sized?K({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&le(["left","top","width","height","naturalWidth","naturalHeight"],function(a){i[a]=t[a]}),i},setCanvasData:function(t){var i=this.canvasData,a=i.aspectRatio;return this.ready&&!this.disabled&>(t)&&(Y(t.left)&&(i.left=t.left),Y(t.top)&&(i.top=t.top),Y(t.width)?(i.width=t.width,i.height=t.width/a):Y(t.height)&&(i.height=t.height,i.width=t.height*a),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,i;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var i=this.cropBoxData,a=this.options.aspectRatio,n,r;return this.ready&&this.cropped&&!this.disabled&>(t)&&(Y(t.left)&&(i.left=t.left),Y(t.top)&&(i.top=t.top),Y(t.width)&&t.width!==i.width&&(n=!0,i.width=t.width),Y(t.height)&&t.height!==i.height&&(r=!0,i.height=t.height),a&&(n?i.height=i.width/a:r&&(i.width=i.height*a)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,a=Su(this.image,this.imageData,i,t);if(!this.cropped)return a;var n=this.getData(t.rounded),r=n.x,l=n.y,o=n.width,s=n.height,u=a.width/Math.floor(i.naturalWidth);u!==1&&(r*=u,l*=u,o*=u,s*=u);var c=o/s,d=We({aspectRatio:c,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),h=We({aspectRatio:c,width:t.minWidth||0,height:t.minHeight||0},"cover"),m=We({aspectRatio:c,width:t.width||(u!==1?a.width:o),height:t.height||(u!==1?a.height:s)}),p=m.width,f=m.height;p=Math.min(d.width,Math.max(h.width,p)),f=Math.min(d.height,Math.max(h.height,f));var g=document.createElement("canvas"),I=g.getContext("2d");g.width=Tt(p),g.height=Tt(f),I.fillStyle=t.fillColor||"transparent",I.fillRect(0,0,p,f);var E=t.imageSmoothingEnabled,b=E===void 0?!0:E,_=t.imageSmoothingQuality;I.imageSmoothingEnabled=b,_&&(I.imageSmoothingQuality=_);var y=a.width,T=a.height,v=r,R=l,S,P,O,x,z,L;v<=-o||v>y?(v=0,S=0,O=0,z=0):v<=0?(O=-v,v=0,S=Math.min(y,o+v),z=S):v<=y&&(O=0,S=Math.min(o,y-v),z=S),S<=0||R<=-s||R>T?(R=0,P=0,x=0,L=0):R<=0?(x=-R,R=0,P=Math.min(T,s+R),L=P):R<=T&&(x=0,P=Math.min(s,T-R),L=P);var F=[v,R,S,P];if(z>0&&L>0){var w=p/o;F.push(O*w,x*w,z*w,L*w)}return I.drawImage.apply(I,[a].concat(Er(F.map(function(A){return Math.floor(Tt(A))})))),g},setAspectRatio:function(t){var i=this.options;return!this.disabled&&!ta(t)&&(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,a=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var r=t===ga,l=i.movable&&t===_r;t=r||l?t:Rr,i.dragMode=t,Vt(a,Bt,t),Et(a,ra,r),Et(a,la,l),i.cropBoxMovable||(Vt(n,Bt,t),Et(n,ra,r),Et(n,la,l))}return this}},Nu=De.Cropper,Ta=function(){function e(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Qd(this,e),!t||!du.test(t.tagName))throw new Error("The first argument is required and must be an or