dealposbooks 5.43.1 → 5.43.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunk-27LUAKKN.js +202 -0
- package/{chunk-L33MZZPK.js → chunk-2GWWFPGD.js} +1 -1
- package/{chunk-BM3MNYWW.js → chunk-2TVPTI2Q.js} +1 -1
- package/{chunk-6KDFPHJV.js → chunk-4UA6AQPD.js} +1 -1
- package/{chunk-2VQQEXJA.js → chunk-4WLR74CG.js} +1 -1
- package/{chunk-AWCGYJP7.js → chunk-57VDOVZI.js} +1 -1
- package/{chunk-RMOBSREQ.js → chunk-5XLCXMFV.js} +1 -1
- package/{chunk-NJ7D3QYH.js → chunk-66D3RLFJ.js} +2 -2
- package/{chunk-X4KTMWVO.js → chunk-6O5EWYT7.js} +1 -1
- package/{chunk-4FPYSVLT.js → chunk-6XT4TD5A.js} +1 -1
- package/{chunk-WLKS6LBU.js → chunk-7COI2POD.js} +1 -1
- package/chunk-AF357XP4.js +1 -0
- package/{chunk-HGVXVOFY.js → chunk-APDA5HMG.js} +1 -1
- package/{chunk-XZG6FHL4.js → chunk-BG6RQTAG.js} +1 -1
- package/{chunk-CX3TZ3F3.js → chunk-BUYRVZ5Z.js} +1 -1
- package/{chunk-R3GHYD6Y.js → chunk-CLIYA4C4.js} +1 -1
- package/{chunk-FOUSV5W2.js → chunk-CPGOKCZQ.js} +1 -1
- package/{chunk-VRD577YD.js → chunk-CPZSG7AO.js} +1 -1
- package/{chunk-S7IT3NE6.js → chunk-CYAFCLUJ.js} +1 -1
- package/{chunk-E2HTGITF.js → chunk-D6UE6XRQ.js} +1 -1
- package/{chunk-JYJZS4U4.js → chunk-DYS6SACW.js} +1 -1
- package/{chunk-NXAQCWYX.js → chunk-GCDC5CWV.js} +1 -1
- package/{chunk-WUQXNEUF.js → chunk-GD364P36.js} +1 -1
- package/{chunk-33OH23NL.js → chunk-H4EEYI62.js} +12 -12
- package/{chunk-RVN2ENY5.js → chunk-H5YVN5LB.js} +1 -1
- package/{chunk-4L2F2JYT.js → chunk-HIQAEXSA.js} +1 -1
- package/{chunk-O6PHQDZH.js → chunk-IS577OHV.js} +1 -1
- package/{chunk-HEX727RH.js → chunk-IYO6P6XI.js} +1 -1
- package/{chunk-QNCIH2ZA.js → chunk-J3XQBHI4.js} +1 -1
- package/{chunk-EOT2WEXN.js → chunk-JUCJGYST.js} +1 -1
- package/{chunk-WJVRZNOB.js → chunk-KZEJS5ET.js} +1 -1
- package/chunk-LUSQ5Y7D.js +7 -0
- package/{chunk-4QA6PJYM.js → chunk-MTMVT6EY.js} +1 -1
- package/{chunk-HR4JVZ4V.js → chunk-N7S3OBLK.js} +1 -1
- package/{chunk-35ITGGSZ.js → chunk-NM5QWTEY.js} +1 -1
- package/chunk-O2OXYS3Y.js +2 -0
- package/chunk-O3WC5V6A.js +1 -0
- package/{chunk-BJ4RON42.js → chunk-PPKCZMH4.js} +1 -1
- package/{chunk-BAHH4HL3.js → chunk-R2KIGE2S.js} +1 -1
- package/{chunk-ZQE76MZZ.js → chunk-R64762K6.js} +1 -1
- package/chunk-RVT7VP6Y.js +1 -0
- package/{chunk-RK2BTJAS.js → chunk-S6ZUNHSB.js} +1 -1
- package/chunk-SD3GXGTX.js +1 -0
- package/{chunk-U3TFXUW7.js → chunk-SHD37WDP.js} +1 -1
- package/{chunk-WPQGYVNT.js → chunk-SVHOGUGR.js} +1 -1
- package/{chunk-WJA77OH2.js → chunk-T6Z367EC.js} +1 -1
- package/{chunk-7YNVXRQ3.js → chunk-T72GVH4I.js} +1 -1
- package/{chunk-KLKIEREL.js → chunk-VPQDUC77.js} +1 -1
- package/{chunk-GDGNBGCE.js → chunk-VZKLQEOM.js} +1 -1
- package/chunk-W2PMWMFZ.js +129 -0
- package/chunk-WAJGPSIF.js +160 -0
- package/{chunk-GJWSARZM.js → chunk-WT5SITHN.js} +1 -1
- package/{chunk-ZB7BW4AF.js → chunk-XI4MQ5XJ.js} +1 -1
- package/{chunk-77OBQMSS.js → chunk-Y3EWLLFL.js} +2 -2
- package/{chunk-RD2UE5ML.js → chunk-YB6ZYDFS.js} +1 -1
- package/{chunk-VCIDPN4K.js → chunk-YLS62TOQ.js} +1 -1
- package/{chunk-7DONF5P4.js → chunk-ZGFFW4KO.js} +1 -1
- package/{chunk-GB5M23CX.js → chunk-ZGIFCTBC.js} +1 -1
- package/index.html +2 -2
- package/{main-VEXPCE7F.js → main-WKNPX6KZ.js} +1 -1
- package/package.json +1 -1
- package/chunk-7B6EWIM4.js +0 -1
- package/chunk-AYUFYFUB.js +0 -7
- package/chunk-CQ2SMQNS.js +0 -1
- package/chunk-GTDIXMKH.js +0 -2
- package/chunk-KAWGMTDN.js +0 -1
- package/chunk-KUDR6C6Y.js +0 -202
- package/chunk-ORLKNWW4.js +0 -1
- package/chunk-QC3F6W4P.js +0 -160
- package/chunk-UJDPTU63.js +0 -129
|
@@ -524,4 +524,4 @@ Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSI
|
|
|
524
524
|
`,t={width:this.opts.width,height:this.opts.height};return p("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),p("div",{className:"uppy-DragDrop-inner"},i.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};Yr.VERSION=W0.version;var $d=300,Ja=class extends Ge{constructor(){super(...arguments),this.ref=Va()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,$d)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,$d)}render(){let{children:e}=this.props;return p("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function G0(i,e){return Object.assign(i,e)}function X0(i,e){var t;return(t=i?.key)!=null?t:e}function Y0(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=r=>{i.refs[e]=r})}function jo(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let r=X0(i[t],t.toString(36));e[r]=i[t]}return e}function K0(i,e){i=i||{},e=e||{};let t=n=>e.hasOwnProperty(n)?e[n]:i[n],r={},o=[];for(let n in i)e.hasOwnProperty(n)?o.length&&(r[n]=o,o=[]):o.push(n);let a={};for(let n in e){if(r.hasOwnProperty(n))for(let s=0;s<r[n].length;s++){let l=r[n][s];a[r[n][s]]=t(l)}a[n]=t(n)}for(let n=0;n<o.length;n++)a[o[n]]=t(o[n]);return a}var Q0=i=>i,Z0=(()=>{class i extends Ge{constructor(t,r){super(t,r),this.refs={},this.state={children:jo(At(At(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let t=this.state.children;for(let r in t)t[r]&&this.performAppear(r)}componentWillReceiveProps(t){let r=jo(At(t.children)||[]),o=this.state.children;this.setState(n=>({children:K0(n.children,r)}));let a;for(a in r)if(r.hasOwnProperty(a)){let n=o&&o.hasOwnProperty(a);r[a]&&n&&this.currentlyTransitioningKeys[a]?(this.keysToEnter.push(a),this.keysToAbortLeave.push(a)):r[a]&&!n&&!this.currentlyTransitioningKeys[a]&&this.keysToEnter.push(a)}for(a in o)if(o.hasOwnProperty(a)){let n=r&&r.hasOwnProperty(a);o[a]&&!n&&!this.currentlyTransitioningKeys[a]&&this.keysToLeave.push(a)}}componentDidUpdate(){let{keysToEnter:t}=this;this.keysToEnter=[],t.forEach(this.performEnter);let{keysToLeave:r}=this;this.keysToLeave=[],r.forEach(this.performLeave)}_finishAbort(t){let r=this.keysToAbortLeave.indexOf(t);r!==-1&&this.keysToAbortLeave.splice(r,1)}performAppear(t){this.currentlyTransitioningKeys[t]=!0;let r=this.refs[t];r!=null&&r.componentWillAppear?r.componentWillAppear(this._handleDoneAppearing.bind(this,t)):this._handleDoneAppearing(t)}_handleDoneAppearing(t){let r=this.refs[t];r!=null&&r.componentDidAppear&&r.componentDidAppear(),delete this.currentlyTransitioningKeys[t],this._finishAbort(t);let o=jo(At(this.props.children)||[]);(!o||!o.hasOwnProperty(t))&&this.performLeave(t)}performEnter(t){this.currentlyTransitioningKeys[t]=!0;let r=this.refs[t];r!=null&&r.componentWillEnter?r.componentWillEnter(this._handleDoneEntering.bind(this,t)):this._handleDoneEntering(t)}_handleDoneEntering(t){let r=this.refs[t];r!=null&&r.componentDidEnter&&r.componentDidEnter(),delete this.currentlyTransitioningKeys[t],this._finishAbort(t);let o=jo(At(this.props.children)||[]);(!o||!o.hasOwnProperty(t))&&this.performLeave(t)}performLeave(t){if(this.keysToAbortLeave.indexOf(t)!==-1)return;this.currentlyTransitioningKeys[t]=!0;let o=this.refs[t];o!=null&&o.componentWillLeave?o.componentWillLeave(this._handleDoneLeaving.bind(this,t)):this._handleDoneLeaving(t)}_handleDoneLeaving(t){if(this.keysToAbortLeave.indexOf(t)!==-1)return;let o=this.refs[t];o!=null&&o.componentDidLeave&&o.componentDidLeave(),delete this.currentlyTransitioningKeys[t];let a=jo(At(this.props.children)||[]);if(a&&a.hasOwnProperty(t))this.performEnter(t);else{let n=G0({},this.state.children);delete n[t],this.setState({children:n})}}render(t,r){let te=t,{childFactory:o,transitionLeave:a,transitionName:n,transitionAppear:s,transitionEnter:l,transitionLeaveTimeout:d,transitionEnterTimeout:m,transitionAppearTimeout:f,component:S}=te,C=va(te,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:B}=r,Y=Object.entries(B).map(Z=>{let[re,oe]=Z;if(!oe)return;let ue=Y0(this,re);return Ao(o(oe),{ref:ue,key:re})}).filter(Boolean);return p(S,C,Y)}}return i.defaultProps={component:"span",childFactory:Q0},i})(),jd=Z0;var J0={version:"4.2.1"},hr=class extends xt{constructor(e,t){super(e,t),this.render=r=>p("div",{className:"uppy uppy-Informer"},p(jd,null,r.info.map(o=>p(Ja,{key:o.message},p("p",{role:"alert"},o.message," ",o.details&&p("span",{"aria-label":o.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${o.message}
|
|
525
525
|
|
|
526
526
|
${o.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};hr.VERSION=J0.version;var ey=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function ty(i,e,t){var r,o;let a=ey.exec(i),n=(r=(o=e.mimeType)!=null?o:a?.[1])!=null?r:"plain/text",s;if(a?.[2]!=null){let l=atob(decodeURIComponent(a[3])),d=new Uint8Array(l.length);for(let m=0;m<l.length;m++)d[m]=l.charCodeAt(m);s=[d]}else a?.[3]!=null&&(s=[decodeURIComponent(a[3])]);return t?new File(s,e.name||"",{type:n}):new Blob(s,{type:n})}var Hd=ty;function en(i){return i.startsWith("blob:")}function tn(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function Ee(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Zd=typeof self<"u"?self:global,qo=typeof navigator<"u",iy=qo&&typeof HTMLImageElement>"u",Vd=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Jd=Zd.Buffer,ec=!!Jd,ry=i=>i!==void 0;function tc(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(ry).length===0)}function ct(i){let e=new Error(i);throw delete e.stack,e}function Wd(i){let e=function(t){let r=0;return t.ifd0.enabled&&(r+=1024),t.exif.enabled&&(r+=2048),t.makerNote&&(r+=2048),t.userComment&&(r+=1024),t.gps.enabled&&(r+=512),t.interop.enabled&&(r+=100),t.ifd1.enabled&&(r+=1024),r+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}var Bs=i=>String.fromCharCode.apply(null,i),qd=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,mr=class i{static from(e,t){return e instanceof this&&e.le===t?e:new i(e,void 0,void 0,t)}constructor(e,t=0,r,o){if(typeof o=="boolean"&&(this.le=o),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){r===void 0&&(r=e.byteLength-t);let a=new DataView(e,t,r);this._swapDataView(a)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof i){r===void 0&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength&&ct("Creating view outside of available memory in ArrayBuffer");let a=new DataView(e.buffer,t,r);this._swapDataView(a)}else if(typeof e=="number"){let a=new DataView(new ArrayBuffer(e));this._swapDataView(a)}else ct("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,r=i){return e instanceof DataView||e instanceof i?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||ct("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new r(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new i(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return o=this.getUint8Array(e,t),qd?qd.decode(o):ec?Buffer.from(o).toString("utf8"):decodeURIComponent(escape(Bs(o)));var o}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return Bs(r)}getUnicodeString(e=0,t=this.byteLength){let r=[];for(let o=0;o<t&&e+o<this.byteLength;o+=2)r.push(this.getUint16(e+o));return Bs(r)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}getUint(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function As(i,e){ct(`${i} '${e}' was not loaded, try using full build of exifr.`)}var Go=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||As(this.kind,e),t&&(e in t||function(r,o){ct(`Unknown ${r} '${o}'.`)}(this.kind,e),t[e].enabled||As(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},sn=new Go("file parser"),jt=new Go("segment parser"),Ko=new Go("file reader"),oy=Zd.fetch;function Gd(i,e){return(t=i).startsWith("data:")||t.length>1e4?Ms(i,e,"base64"):Vd&&i.includes("://")?Os(i,e,"url",rn):Vd?Ms(i,e,"fs"):qo?Os(i,e,"url",rn):void ct("Invalid input argument");var t}function Os(i,e,t,r){return j(this,null,function*(){return Ko.has(t)?Ms(i,e,t):r?function(o,a){return j(this,null,function*(){let n=yield a(o);return new mr(n)})}(i,r):void ct(`Parser ${t} is not loaded`)})}function Ms(i,e,t){return j(this,null,function*(){let r=new(Ko.get(t))(i,e);return yield r.read(),r})}var rn=i=>oy(i).then(e=>e.arrayBuffer()),Xo=i=>new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)}),zs=class extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}};function ic(i,e,t){let r=new zs;for(let[o,a]of t)r.set(o,a);if(Array.isArray(e))for(let o of e)i.set(o,r);else i.set(e,r);return r}function rc(i,e,t){let r,o=i.get(e);for(r of t)o.set(r[0],r[1])}var Qo=new Map,$s=new Map,js=new Map,Kr=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],ln=["jfif","xmp","icc","iptc","ihdr"],Yo=["tiff",...ln],at=["ifd0","ifd1","exif","gps","interop"],Qr=[...Yo,...at],Zr=["makerNote","userComment"],pn=["translateKeys","translateValues","reviveValues","multiSegment"],Jr=[...pn,"sanitize","mergeOutput","silentErrors"],on=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},fr=class extends on{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,o){if(super(),Ee(this,"enabled",!1),Ee(this,"skip",new Set),Ee(this,"pick",new Set),Ee(this,"deps",new Set),Ee(this,"translateKeys",!1),Ee(this,"translateValues",!1),Ee(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(o),this.canBeFiltered=at.includes(e),this.canBeFiltered&&(this.dict=Qo.get(e)),r!==void 0)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if(typeof r=="object"){if(this.enabled=!0,this.parse=r.parse!==!1,this.canBeFiltered){let{pick:a,skip:n}=r;a&&a.length>0&&this.translateTagSet(a,this.pick),n&&n.length>0&&this.translateTagSet(n,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:ct(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of pn)r=e[t],r!==void 0&&(this[t]=r)}translateTagSet(e,t){if(this.dict){let r,o,{tagKeys:a,tagValues:n}=this.dict;for(r of e)typeof r=="string"?(o=n.indexOf(r),o===-1&&(o=a.indexOf(Number(r))),o!==-1&&t.add(Number(a[o]))):t.add(r)}else for(let r of e)t.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,an(this.pick,this.deps)):this.enabled&&this.pick.size>0&&an(this.pick,this.deps)}},St={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},Xd=new Map,gr=class extends on{static useCached(e){let t=Xd.get(e);return t!==void 0||(t=new this(e),Xd.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):ct(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=qo?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Kr)this[e]=St[e];for(e of Jr)this[e]=St[e];for(e of Zr)this[e]=St[e];for(e of Qr)this[e]=new fr(e,St[e],void 0,this)}setupFromTrue(){let e;for(e of Kr)this[e]=St[e];for(e of Jr)this[e]=St[e];for(e of Zr)this[e]=!0;for(e of Qr)this[e]=new fr(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Kr)this[t]=St[t];for(t of Jr)this[t]=St[t];for(t of Zr)this[t]=St[t];for(t of Qr)this[t]=new fr(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,at)}setupFromObject(e){let t;for(t of(at.ifd0=at.ifd0||at.image,at.ifd1=at.ifd1||at.thumbnail,Object.assign(this,e),Kr))this[t]=Es(e[t],St[t]);for(t of Jr)this[t]=Es(e[t],St[t]);for(t of Zr)this[t]=Es(e[t],St[t]);for(t of Yo)this[t]=new fr(t,St[t],e[t],this);for(t of at)this[t]=new fr(t,St[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,at,Qr),e.tiff===!0?this.batchEnableWithBool(at,!0):e.tiff===!1?this.batchEnableWithUserValue(at,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,at):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,at)}batchEnableWithBool(e,t){for(let r of e)this[r].enabled=t}batchEnableWithUserValue(e,t){for(let r of e){let o=t[r];this[r].enabled=o!==!1&&o!==void 0}}setupGlobalFilters(e,t,r,o=r){if(e&&e.length){for(let n of o)this[n].enabled=!1;let a=Yd(e,r);for(let[n,s]of a)an(this[n].pick,s),this[n].enabled=!0}else if(t&&t.length){let a=Yd(t,r);for(let[n,s]of a)an(this[n].skip,s)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:r,iptc:o,icc:a}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),o.enabled||e.skip.add(33723),a.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:r,interop:o}=this;o.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),r.needed&&e.deps.add(34853),this.tiff.enabled=at.some(a=>this[a].enabled===!0)||this.makerNote||this.userComment;for(let a of at)this[a].finalizeFilters()}get onlyTiff(){return!ln.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Yo)this[e].enabled&&!jt.has(e)&&As("segment parser",e)}};function Yd(i,e){let t,r,o,a,n=[];for(o of e){for(a of(t=Qo.get(o),r=[],t))(i.includes(a[0])||i.includes(a[1]))&&r.push(a[0]);r.length&&n.push([o,r])}return n}function Es(i,e){return i!==void 0?i:e!==void 0?e:void 0}function an(i,e){for(let t of e)i.add(t)}Ee(gr,"default",St);var eo=class{constructor(e){Ee(this,"parsers",{}),Ee(this,"output",{}),Ee(this,"errors",[]),Ee(this,"pushToErrors",t=>this.errors.push(t)),this.options=gr.useCached(e)}read(e){return j(this,null,function*(){this.file=yield function(t,r){return typeof t=="string"?Gd(t,r):qo&&!iy&&t instanceof HTMLImageElement?Gd(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new mr(t):qo&&t instanceof Blob?Os(t,r,"blob",Xo):void ct("Invalid input argument")}(e,this.options)})}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,o]of sn)if(o.canHandle(e,t))return this.fileParser=new o(this.options,this.file,this.parsers),e[r]=!0;this.file.close&&this.file.close(),ct("Unknown file format")}parse(){return j(this,null,function*(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(yield this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):yield this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),tc(r=e)?void 0:r;var r})}executeParsers(){return j(this,null,function*(){let{output:e}=this;yield this.fileParser.parse();let t=Object.values(this.parsers).map(r=>j(this,null,function*(){let o=yield r.parse();r.assignToOutput(e,o)}));this.options.silentErrors&&(t=t.map(r=>r.catch(this.pushToErrors))),yield Promise.all(t)})}extractThumbnail(){return j(this,null,function*(){this.setup();let{options:e,file:t}=this,r=jt.get("tiff",e);var o;if(t.tiff?o={start:0,type:"tiff"}:t.jpeg&&(o=yield this.fileParser.getOrFindSegment("tiff")),o===void 0)return;let a=yield this.fileParser.ensureSegmentChunk(o),n=this.parsers.tiff=new r(a,e,t),s=yield n.extractThumbnail();return t.close&&t.close(),s})}};function oc(i,e){return j(this,null,function*(){let t=new eo(e);return yield t.read(i),t.parse()})}var ay=Object.freeze({__proto__:null,parse:oc,Exifr:eo,fileParsers:sn,segmentParsers:jt,fileReaders:Ko,tagKeys:Qo,tagValues:$s,tagRevivers:js,createDictionary:ic,extendDictionary:rc,fetchUrlAsArrayBuffer:rn,readBlobAsArrayBuffer:Xo,chunkedProps:Kr,otherSegments:ln,segments:Yo,tiffBlocks:at,segmentsAndBlocks:Qr,tiffExtractables:Zr,inheritables:pn,allFormatters:Jr,Options:gr}),Yi=class{static findPosition(e,t){let r=e.getUint16(t+2)+2,o=typeof this.headerLength=="function"?this.headerLength(e,t,r):this.headerLength,a=t+o,n=r-o;return{offset:t,length:r,headerLength:o,start:a,size:n,end:a+n}}static parse(e,t={}){return new this(e,new gr({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof mr?e:new mr(e)}constructor(e,t={},r){Ee(this,"errors",[]),Ee(this,"raw",new Map),Ee(this,"handleError",o=>{if(!this.options.silentErrors)throw o;this.errors.push(o.message)}),this.chunk=this.normalizeInput(e),this.file=r,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let r=js.get(t),o=$s.get(t),a=Qo.get(t),n=this.options[t],s=n.reviveValues&&!!r,l=n.translateValues&&!!o,d=n.translateKeys&&!!a,m={};for(let[f,S]of e)s&&r.has(f)?S=r.get(f)(S):l&&o.has(f)&&(S=this.translateValue(S,o.get(f))),d&&a.has(f)&&(f=a.get(f)||f),m[f]=S;return m}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,r){if(this.globalOptions.mergeOutput)return Object.assign(e,r);e[t]?Object.assign(e[t],r):e[t]=r}};Ee(Yi,"headerLength",4),Ee(Yi,"type",void 0),Ee(Yi,"multiSegment",!1),Ee(Yi,"canHandle",()=>!1);function ny(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function sy(i){return i>=224&&i<=239}function ly(i,e,t){for(let[r,o]of jt)if(o.canHandle(i,e,t))return r}var nn=class extends class{constructor(e,t,r){Ee(this,"errors",[]),Ee(this,"ensureSegmentChunk",o=>j(this,null,function*(){let a=o.start,n=o.size||65536;if(this.file.chunked)if(this.file.available(a,n))o.chunk=this.file.subarray(a,n);else try{o.chunk=yield this.file.readChunk(a,n)}catch(s){ct(`Couldn't read segment: ${JSON.stringify(o)}. ${s.message}`)}else this.file.byteLength>a+n?o.chunk=this.file.subarray(a,n):o.size===void 0?o.chunk=this.file.subarray(a):ct("Segment unreachable: "+JSON.stringify(o));return o.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let r=new(jt.get(e))(t,this.options,this.file);return this.parsers[e]=r}createParsers(e){for(let t of e){let{type:r,chunk:o}=t,a=this.options[r];if(a&&a.enabled){let n=this.parsers[r];n&&n.append||n||this.createParser(r,o)}}}readSegments(e){return j(this,null,function*(){let t=e.map(this.ensureSegmentChunk);yield Promise.all(t)})}}{constructor(...e){super(...e),Ee(this,"appSegments",[]),Ee(this,"jpegSegments",[]),Ee(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}parse(){return j(this,null,function*(){yield this.findAppSegments(),yield this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)})}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(jt.keyList())):(e=e===void 0?jt.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&jt.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}findAppSegments(e=0,t){return j(this,null,function*(){this.setupSegmentFinderArgs(t);let{file:r,findAll:o,wanted:a,remaining:n}=this;if(!o&&this.file.chunked&&(o=Array.from(a).some(s=>{let l=jt.get(s),d=this.options[s];return l.multiSegment&&d.multiSegment}),o&&(yield this.file.readWhole())),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let s=!1;for(;n.size>0&&!s&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,d=this.appSegments.some(m=>!this.file.available(m.offset||m.start,m.length||m.size));if(s=e>l&&!d?!(yield r.readNextChunk(e)):!(yield r.readNextChunk(l)),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}})}findAppSegmentsInRange(e,t){t-=2;let r,o,a,n,s,l,{file:d,findAll:m,wanted:f,remaining:S,options:C}=this;for(;e<t;e++)if(d.getUint8(e)===255){if(r=d.getUint8(e+1),sy(r)){if(o=d.getUint16(e+2),a=ly(d,e,o),a&&f.has(a)&&(n=jt.get(a),s=n.findPosition(d,e),l=C[a],s.type=a,this.appSegments.push(s),!m&&(n.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||S.delete(a)):S.delete(a),S.size===0)))break;C.recordUnknownSegments&&(s=Yi.findPosition(d,e),s.marker=r,this.unknownSegments.push(s)),e+=o+1}else if(ny(r)){if(o=d.getUint16(e+2),r===218&&C.stopAfterSos!==!1)return;C.recordJpegSegments&&this.jpegSegments.push({offset:e,length:o,marker:r}),e+=o+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,r){let o,a,n,s=new Map;for(let l=0;l<t.length;l++)o=t[l],a=o[r],s.has(a)?n=s.get(a):s.set(a,n=[]),n.push(o);return Array.from(s)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,r])=>{let o=jt.get(t,this.options);return o.handleMultiSegments?{type:t,chunk:o.handleMultiSegments(r)}:r[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}getOrFindSegment(e){return j(this,null,function*(){let t=this.getSegment(e);return t===void 0&&(yield this.findAppSegments(0,[e]),t=this.getSegment(e)),t})}};Ee(nn,"type","jpeg"),sn.set("jpeg",nn);var py=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Rs=class extends Yi{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,r=new Map){let{pick:o,skip:a}=this.options[t];o=new Set(o);let n=o.size>0,s=a.size===0,l=this.chunk.getUint16(e);e+=2;for(let d=0;d<l;d++){let m=this.chunk.getUint16(e);if(n){if(o.has(m)&&(r.set(m,this.parseTag(e,m,t)),o.delete(m),o.size===0))break}else!s&&a.has(m)||r.set(m,this.parseTag(e,m,t));e+=12}return r}parseTag(e,t,r){let{chunk:o}=this,a=o.getUint16(e+2),n=o.getUint32(e+4),s=py[a];if(s*n<=4?e+=8:e=o.getUint32(e+8),(a<1||a>13)&&ct(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${a}, offset ${e}`),e>o.byteLength&&ct(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${a}, offset ${e} is outside of chunk size ${o.byteLength}`),a===1)return o.getUint8Array(e,n);if(a===2)return(l=function(d){for(;d.endsWith("\0");)d=d.slice(0,-1);return d}(l=o.getString(e,n)).trim())===""?void 0:l;var l;if(a===7)return o.getUint8Array(e,n);if(n===1)return this.parseTagValue(a,e);{let d=new(function(f){switch(f){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}(a))(n),m=s;for(let f=0;f<n;f++)d[f]=this.parseTagValue(a,e),e+=m;return d}}parseTagValue(e,t){let{chunk:r}=this;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:ct(`Invalid tiff type ${e}`)}}},Wo=class extends Rs{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}parse(){return j(this,null,function*(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&(yield this.parseIfd0Block()),e.exif.enabled&&(yield this.safeParse("parseExifBlock")),e.gps.enabled&&(yield this.safeParse("parseGpsBlock")),e.interop.enabled&&(yield this.safeParse("parseInteropBlock")),e.ifd1.enabled&&(yield this.safeParse("parseThumbnailBlock")),this.createOutput()})}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let r=new Map;return this[t]=r,this.parseTags(e,t,r),r}parseIfd0Block(){return j(this,null,function*(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&ct("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&ct(`IFD0 offset points to outside of file.
|
|
527
|
-
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&(yield e.ensureChunk(this.ifd0Offset,Wd(this.options)));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0})}parseExifBlock(){return j(this,null,function*(){if(this.exif||(this.ifd0||(yield this.parseIfd0Block()),this.exifOffset===void 0))return;this.file.tiff&&(yield this.file.ensureChunk(this.exifOffset,Wd(this.options)));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e})}unpack(e,t){let r=e.get(t);r&&r.length===1&&e.set(t,r[0])}parseGpsBlock(){return j(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Kd(...e.get(2),e.get(1))),e.set("longitude",Kd(...e.get(4),e.get(3)))),e})}parseInteropBlock(){return j(this,null,function*(){if(!this.interop&&(this.ifd0||(yield this.parseIfd0Block()),this.interopOffset!==void 0||this.exif||(yield this.parseExifBlock()),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")})}parseThumbnailBlock(e=!1){return j(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return j(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,r,o={};for(t of at)if(e=this[t],!tc(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(o,r)}else o[t]=r;return this.makerNote&&(o.makerNote=this.makerNote),this.userComment&&(o.userComment=this.userComment),o}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,o]of Object.entries(t))this.assignObjectToOutput(e,r,o)}};function Kd(i,e,t,r){var o=i+e/60+t/3600;return r!=="S"&&r!=="W"||(o*=-1),o}Ee(Wo,"type","tiff"),Ee(Wo,"headerLength",10),jt.set("tiff",Wo);var hx=Object.freeze({__proto__:null,default:ay,Exifr:eo,fileParsers:sn,segmentParsers:jt,fileReaders:Ko,tagKeys:Qo,tagValues:$s,tagRevivers:js,createDictionary:ic,extendDictionary:rc,fetchUrlAsArrayBuffer:rn,readBlobAsArrayBuffer:Xo,chunkedProps:Kr,otherSegments:ln,segments:Yo,tiffBlocks:at,segmentsAndBlocks:Qr,tiffExtractables:Zr,inheritables:pn,allFormatters:Jr,Options:gr,parse:oc}),Hs={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},fx=Object.assign({},Hs,{firstChunkSize:4e4,gps:[1,2,3,4]});var mx=Object.assign({},Hs,{tiff:!1,ifd1:!0,mergeOutput:!1});var uy=Object.assign({},Hs,{firstChunkSize:4e4,ifd0:[274]});function dy(i){return j(this,null,function*(){let e=new eo(uy);yield e.read(i);let t=yield e.parse();if(t&&t.ifd0)return t.ifd0[274]})}var cy=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}}),Ho=!0,Vo=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,r]=e;Ho=Number(t)+.1*Number(r)<13.4,Vo=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Ho=Vo=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Ho=Vo=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Ho=Vo=Number(e)<77}}function ac(i){return j(this,null,function*(){let e=yield dy(i);return Object.assign({canvas:Ho,css:Vo},cy[e])})}var Us=class extends mr{constructor(...e){super(...e),Ee(this,"ranges",new Ns),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let o=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(o)}else{let o=e+t;if(o>this.byteLength){let{dataView:a}=this._extend(o);this._swapDataView(a)}}}_extend(e){let t;t=ec?Jd.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let o=super.set(e,t);return this.ranges.add(t,o.byteLength),o}ensureChunk(e,t){return j(this,null,function*(){this.chunked&&(this.ranges.available(e,t)||(yield this.readChunk(e,t)))})}available(e,t){return this.ranges.available(e,t)}},Ns=class{constructor(){Ee(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let o=e+t,a=this.list.filter(n=>Qd(e,n.offset,o)||Qd(e,n.end,o));if(a.length>0){e=Math.min(e,...a.map(s=>s.offset)),o=Math.max(o,...a.map(s=>s.end)),t=o-e;let n=a.shift();n.offset=e,n.length=t,n.end=o,this.list=this.list.filter(s=>!a.includes(s))}else this.list.push({offset:e,length:t,end:o})}available(e,t){let r=e+t;return this.list.some(o=>o.offset<=e&&r<=o.end)}};function Qd(i,e,t){return i<=e&&e<=t}var Ls=class extends Us{constructor(e,t){super(0),Ee(this,"chunksRead",0),this.input=e,this.options=t}readWhole(){return j(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return j(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return j(this,arguments,function*(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,r=yield this.readChunk(e,t);return!!r&&r.byteLength===t})}readChunk(e,t){return j(this,null,function*(){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)})}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};Ko.set("blob",class extends Ls{readWhole(){return j(this,null,function*(){this.chunked=!1;let i=yield Xo(this.input);this._swapArrayBuffer(i)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(i,e){return j(this,null,function*(){let t=e?i+e:void 0,r=this.input.slice(i,t),o=yield Xo(r);return this.set(o,i,!0)})}});var nc={strings:{generatingThumbnails:"Generating thumbnails..."}};var hy={version:"4.1.1"};function fy(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(r){if(r.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(r=>{i.toBlob(r,e,t)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>Hd(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function my(i,e){let t=i.width,r=i.height;(e.deg===90||e.deg===270)&&(t=i.height,r=i.width);let o=document.createElement("canvas");o.width=t,o.height=r;let a=o.getContext("2d");return a.translate(t/2,r/2),e.canvas&&(a.rotate(e.rad),a.scale(e.scaleX,e.scaleY)),a.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),o}function gy(i){let e=i.width/i.height,t=5e6,r=4096,o=Math.floor(Math.sqrt(t*e)),a=Math.floor(t/Math.sqrt(t*e));if(o>r&&(o=r,a=Math.round(o/e)),a>r&&(a=r,o=Math.round(e*a)),i.width>o){let n=document.createElement("canvas");return n.width=o,n.height=a,n.getContext("2d").drawImage(i,0,0,o,a),n}return i}var yy={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},to=class extends xt{constructor(e,t){if(super(e,x(x({},yy),t)),this.onFileAdded=r=>{!r.preview&&r.data&&tn(r.type)&&!r.isRemote&&this.addToQueue(r.id)},this.onCancelRequest=r=>{let o=this.queue.indexOf(r.id);o!==-1&&this.queue.splice(o,1)},this.onFileRemoved=r=>{let o=this.queue.indexOf(r.id);o!==-1&&this.queue.splice(o,1),r.preview&&en(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(o=>o.isRestored).forEach(o=>{(!o.preview||en(o.preview))&&this.addToQueue(o.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=r=>{r.forEach(a=>{let n=this.uppy.getFile(a);this.uppy.emit("preprocess-progress",n,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let o=()=>{r.forEach(a=>{let n=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",n)})};return new Promise(a=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{o(),a()}):(o(),a())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=nc,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,r){let o=URL.createObjectURL(e.data),a=new Promise((s,l)=>{let d=new Image;d.src=o,d.addEventListener("load",()=>{URL.revokeObjectURL(o),s(d)}),d.addEventListener("error",m=>{URL.revokeObjectURL(o),l(m.error||new Error("Could not create thumbnail"))})}),n=ac(e.data).catch(()=>1);return Promise.all([a,n]).then(s=>{let[l,d]=s,m=this.getProportionalDimensions(l,t,r,d.deg),f=my(l,d),S=this.resizeImage(f,m.width,m.height);return fy(S,this.thumbnailType,80)}).then(s=>URL.createObjectURL(s))}getProportionalDimensions(e,t,r,o){let a=e.width/e.height;return(o===90||o===270)&&(a=e.height/e.width),t!=null?{width:t,height:Math.round(t/a)}:r!=null?{width:Math.round(r*a),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/a)}}resizeImage(e,t,r){let o=gy(e),a=Math.ceil(Math.log2(o.width/t));a<1&&(a=1);let n=t*2**(a-1),s=r*2**(a-1),l=2;for(;a--;){let d=document.createElement("canvas");d.width=n,d.height=s,d.getContext("2d").drawImage(o,0,0,n,s),o=d,n=Math.round(n/l),s=Math.round(s/l)}return o}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return tn(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};to.VERSION=hy.version;function by(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&zo(i)?[i]:null}var Vs=by;var Fc=$e(Ct(),1);function Zo(i){return J(x({},i),{type:i.mimeType,extension:i.name?yi(i.name).extension:null})}function vy(){return p("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},p("g",{fill:"none","fill-rule":"evenodd"},p("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),p("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),p("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),p("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),p("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),p("path",{d:"M4 4h18v18H4z"})))}function wy(i){let{pluginName:e,i18n:t,onAuth:r}=i,o=e==="Google Drive",a=Xi(n=>{n.preventDefault(),r()},[r]);return p("form",{onSubmit:a},o?p("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},p(vy,null),t("signInWithGoogle")):p("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var _y=i=>{let{pluginName:e,i18n:t,onAuth:r}=i;return p(wy,{pluginName:e,i18n:t,onAuth:r})};function un(i){let{loading:e,pluginName:t,pluginIcon:r,i18n:o,handleAuth:a,renderForm:n=_y}=i;return p("div",{className:"uppy-Provider-auth"},p("div",{className:"uppy-Provider-authIcon"},r()),p("div",{className:"uppy-Provider-authTitle"},o("authenticateWithTitle",{pluginName:t})),n({pluginName:t,i18n:o,loading:e,onAuth:a}))}var sc=$e(Ct(),1);function Ws(i){let{i18n:e,logout:t,username:r}=i;return p(gt,null,r&&p("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),p("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function qs(i){let{openFolder:e,title:t,breadcrumbsIcon:r,breadcrumbs:o,i18n:a}=i;return p("div",{className:"uppy-Provider-breadcrumbs"},p("div",{className:"uppy-Provider-breadcrumbsIcon"},r),o.map((n,s)=>{var l;return p(gt,null,p("button",{key:n.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(n.id)},n.type==="root"?t:(l=n.data.name)!=null?l:a("unnamed")),o.length===s+1?"":" / ")}))}function Gs(i){return p("div",{className:"uppy-ProviderBrowser-header"},p("div",{className:(0,sc.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&p(qs,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),p(Ws,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Xs(){return Xs=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Xs.apply(null,arguments)}var xy={position:"relative",width:"100%",minHeight:"100%"},Cy={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Ys=class extends Ge{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let Y=e,{data:t,rowHeight:r,renderRow:o,overscanCount:a=10}=Y,n=va(Y,["data","rowHeight","renderRow","overscanCount"]),{offset:s,height:l}=this.state,d=Math.floor(s/r),m=Math.floor(l/r);a&&(d=Math.max(0,d-d%a),m+=a);let f=d+m+4,S=t.slice(d,f),C=J(x({},xy),{height:t.length*r}),B=J(x({},Cy),{top:d*r});return p("div",Xs({onScroll:this.handleScroll},n),p("div",{role:"presentation",style:C},p("div",{role:"presentation",style:B},S.map(o))))}},dn=Ys;var lc=$e(Ct(),1);function Sy(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},p("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function Py(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},p("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function Fy(){return p("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},p("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),p("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function io(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return p(Sy,null);case"folder":return p(Py,null);case"video":return p(Fy,null);default:return p("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function ky(i){var e,t;let{file:r,toggleCheckbox:o,className:a,isDisabled:n,restrictionError:s,showTitles:l,children:d=null,i18n:m}=i;return p("li",{className:a,title:n&&s?s:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:o,name:"listitem",id:r.id,checked:r.status==="checked",disabled:n,"data-uppy-super-focusable":!0}),p("label",{htmlFor:r.id,"aria-label":(e=r.data.name)!=null?e:m("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p(io,{itemIconString:r.data.thumbnail||r.data.icon}),l&&((t=r.data.name)!=null?t:m("unnamed")),d))}var Ks=ky;function Qs(i){var e,t,r;let{file:o,openFolder:a,className:n,isDisabled:s,restrictionError:l,toggleCheckbox:d,showTitles:m,i18n:f}=i;return p("li",{className:n,title:o.status!=="checked"&&l?l:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:d,name:"listitem",id:o.id,checked:o.status==="checked","aria-label":o.data.isFolder?f("allFilesFromFolderNamed",{name:(e=o.data.name)!=null?e:f("unnamed")}):null,disabled:s,"data-uppy-super-focusable":!0}),o.data.isFolder?p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>a(o.id),"aria-label":f("openFolderNamed",{name:(t=o.data.name)!=null?t:f("unnamed")})},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(io,{itemIconString:o.data.icon})),m&&o.data.name?p("span",null,o.data.name):f("unnamed")):p("label",{htmlFor:o.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(io,{itemIconString:o.data.icon})),m&&((r=o.data.name)!=null?r:f("unnamed"))))}function Zs(i){let{viewType:e,toggleCheckbox:t,showTitles:r,i18n:o,openFolder:a,file:n,utmSource:s}=i,l=n.type==="folder"?null:n.restrictionError,d=!!l&&n.status!=="checked",m={file:n,openFolder:a,toggleCheckbox:t,utmSource:s,i18n:o,viewType:e,showTitles:r,className:(0,lc.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":d},{"uppy-ProviderBrowserItem--noPreview":n.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":n.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":n.status==="partial"}),isDisabled:d,restrictionError:l};switch(e){case"grid":return p(Ks,m);case"list":return p(Qs,m);case"unsplash":return p(Ks,m,p("a",{href:`${n.data.author.url}?utm_source=${s}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},n.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function Iy(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:r,handleScroll:o,showTitles:a,i18n:n,isLoading:s,openFolder:l,noResultsLabel:d,virtualList:m,utmSource:f}=i,[S,C]=Qt(!1);if(oi(()=>{let Y=Z=>{Z.key==="Shift"&&C(!1)},te=Z=>{Z.key==="Shift"&&C(!0)};return document.addEventListener("keyup",Y),document.addEventListener("keydown",te),()=>{document.removeEventListener("keyup",Y),document.removeEventListener("keydown",te)}},[]),s)return p("div",{className:"uppy-Provider-loading"},typeof s=="string"?s:n("loading"));if(e.length===0)return p("div",{className:"uppy-Provider-empty"},d);let B=Y=>p(Zs,{viewType:t,toggleCheckbox:te=>{var Z;te.stopPropagation(),te.preventDefault(),(Z=document.getSelection())==null||Z.removeAllRanges(),r(Y,S)},showTitles:a,i18n:n,openFolder:l,file:Y,utmSource:f});return m?p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list"},p(dn,{data:e,renderRow:B,rowHeight:31}))):p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list",onScroll:o,role:"listbox",tabIndex:-1},e.map(B)))}var cn=Iy;var Ty=(i,e,t,r,o)=>{let a=e.filter(C=>C.isFolder===!0),n=e.filter(C=>C.isFolder===!1),s=t.type==="folder"&&t.status==="checked",l=a.map(C=>({type:"folder",id:C.requestPath,cached:!1,nextPagePath:null,status:s?"checked":"unchecked",parentId:t.id,data:C})),d=n.map(C=>{let B=o(C);return{type:"file",id:C.requestPath,restrictionError:B,status:s&&!B?"checked":"unchecked",parentId:t.id,data:C}}),m=J(x({},t),{cached:!0,nextPagePath:r});return[...i.map(C=>C.id===m.id?m:C),...l,...d]},pc=Ty;var Dy=(i,e,t,r,o)=>{let a=i.find(B=>B.id===e),n=t.filter(B=>B.isFolder===!0),s=t.filter(B=>B.isFolder===!1),l=J(x({},a),{nextPagePath:r}),d=i.map(B=>B.id===l.id?l:B),m=l.type==="folder"&&l.status==="checked",f=n.map(B=>({type:"folder",id:B.requestPath,cached:!1,nextPagePath:null,status:m?"checked":"unchecked",parentId:l.id,data:B})),S=s.map(B=>{let Y=o(B);return{type:"file",id:B.requestPath,restrictionError:Y,status:m&&!Y?"checked":"unchecked",parentId:l.id,data:B}});return[...d,...f,...S]},uc=Dy;var By=i=>i.map(e=>x({},e)),hn=By;var Js=(i,e,t)=>{i.filter(o=>o.type!=="root"&&o.parentId===e).forEach(o=>{o.status=t&&!(o.type==="file"&&o.restrictionError)?"checked":"unchecked",Js(i,o.id,t)})},el=(i,e)=>{let t=i.find(n=>n.id===e);if(t.type==="root")return;let r=i.filter(n=>n.type!=="root"&&n.parentId===t.id&&!(n.type==="file"&&n.restrictionError)),o=r.every(n=>n.status==="checked"),a=r.every(n=>n.status==="unchecked");o?t.status="checked":a?t.status="unchecked":t.status="partial",el(i,t.parentId)},Ey=(i,e)=>{let t=hn(i);if(e.length>=2){let r=t.filter(o=>o.type!=="root"&&e.includes(o.id));r.forEach(o=>{o.type==="file"?o.status=o.restrictionError?"unchecked":"checked":o.status="checked"}),r.forEach(o=>{Js(t,o.id,!0)}),el(t,r[0].parentId)}else{let r=t.find(o=>o.id===e[0]);r.status=r.status==="checked"?"unchecked":"checked",Js(t,r.id,r.status==="checked"),el(t,r.parentId)}return t},dc=Ey;var il=$e(hc(),1);var ea=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},rl=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},fc=i=>globalThis.DOMException===void 0?new rl(i):new DOMException(i),mc=i=>{let e=i.reason===void 0?fc("This operation was aborted."):i.reason;return e instanceof Error?e:fc(e)};function ol(i,e){let{milliseconds:t,fallback:r,message:o,customTimers:a={setTimeout,clearTimeout}}=e,n,s,d=new Promise((m,f)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:C}=e;C.aborted&&f(mc(C)),s=()=>{f(mc(C))},C.addEventListener("abort",s,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(m,f);return}let S=new ea;n=a.setTimeout.call(void 0,()=>{if(r){try{m(r())}catch(C){f(C)}return}typeof i.cancel=="function"&&i.cancel(),o===!1?m():o instanceof Error?f(o):(S.message=o??`Promise timed out after ${t} milliseconds`,f(S))},t),j(null,null,function*(){try{m(yield i)}catch(C){f(C)}})}).finally(()=>{d.clear(),s&&e.signal&&e.signal.removeEventListener("abort",s)});return d.clear=()=>{a.clearTimeout.call(void 0,n),n=void 0},d}function al(i,e,t){let r=0,o=i.length;for(;o>0;){let a=Math.trunc(o/2),n=r+a;t(i[n],e)<=0?(r=++n,o-=a+1):o=a}return r}var mn=class{#e=[];enqueue(e,t){t=x({priority:0},t);let r={priority:t.priority,id:t.id,run:e};if(this.size===0||this.#e[this.size-1].priority>=t.priority){this.#e.push(r);return}let o=al(this.#e,r,(a,n)=>n.priority-a.priority);this.#e.splice(o,0,r)}setPriority(e,t){let r=this.#e.findIndex(a=>a.id===e);if(r===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[o]=this.#e.splice(r,1);this.enqueue(o.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var gn=class extends il.default{#e;#n;#a=0;#h;#s;#f=0;#i;#l;#t;#m;#r=0;#p;#o;#g;#v=1n;timeout;constructor(e){if(super(),e=x({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:mn},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#n=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#h=e.intervalCap,this.#s=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#o=e.autoStart===!1}get#w(){return this.#n||this.#a<this.#h}get#_(){return this.#r<this.#p}#x(){this.#r--,this.#u(),this.emit("next")}#C(){this.#b(),this.#y(),this.#l=void 0}get#S(){let e=Date.now();if(this.#i===void 0){let t=this.#f-e;if(t<0)this.#a=this.#e?this.#r:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#C()},t)),!0}return!1}#u(){if(this.#t.size===0)return this.#i&&clearInterval(this.#i),this.#i=void 0,this.emit("empty"),this.#r===0&&this.emit("idle"),!1;if(!this.#o){let e=!this.#S;if(this.#w&&this.#_){let t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#n||this.#i!==void 0||(this.#i=setInterval(()=>{this.#b()},this.#s),this.#f=Date.now()+this.#s)}#b(){this.#a===0&&this.#r===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#a=this.#e?this.#r:0,this.#d()}#d(){for(;this.#u(););}get concurrency(){return this.#p}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#p=e,this.#d()}#P(e){return j(this,null,function*(){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(e.reason)},{once:!0})})})}setPriority(e,t){this.#t.setPriority(e,t)}add(r){return j(this,arguments,function*(e,t={}){return t.id??=(this.#v++).toString(),t=x({timeout:this.timeout,throwOnTimeout:this.#g},t),new Promise((o,a)=>{this.#t.enqueue(()=>j(this,null,function*(){this.#r++,this.#a++;try{t.signal?.throwIfAborted();let n=e({signal:t.signal});t.timeout&&(n=ol(Promise.resolve(n),{milliseconds:t.timeout})),t.signal&&(n=Promise.race([n,this.#P(t.signal)]));let s=yield n;o(s),this.emit("completed",s)}catch(n){if(n instanceof ea&&!t.throwOnTimeout){o();return}a(n),this.emit("error",n)}finally{this.#x()}}),t),this.emit("add"),this.#u()})})}addAll(e,t){return j(this,null,function*(){return Promise.all(e.map(r=>j(this,null,function*(){return this.add(r,t)})))})}start(){return this.#o?(this.#o=!1,this.#d(),this):this}pause(){this.#o=!0}clear(){this.#t=new this.#m}onEmpty(){return j(this,null,function*(){this.#t.size!==0&&(yield this.#c("empty"))})}onSizeLessThan(e){return j(this,null,function*(){this.#t.size<e||(yield this.#c("next",()=>this.#t.size<e))})}onIdle(){return j(this,null,function*(){this.#r===0&&this.#t.size===0||(yield this.#c("idle"))})}#c(e,t){return j(this,null,function*(){return new Promise(r=>{let o=()=>{t&&!t()||(this.off(e,o),r())};this.on(e,o)})})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#r}get isPaused(){return this.#o}};var gc=(i,e,t,r,o)=>j(null,null,function*(){let a=[],n=t.cached?t.nextPagePath:t.id;for(;n;){let f=yield r(n);a=a.concat(f.items),n=f.nextPagePath}let s=a.filter(f=>f.isFolder===!0),l=a.filter(f=>f.isFolder===!1),d=s.map(f=>({type:"folder",id:f.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:f})),m=l.map(f=>{let S=o(f);return{type:"file",id:f.requestPath,restrictionError:S,status:S?"unchecked":"checked",parentId:t.id,data:f}});t.cached=!0,t.nextPagePath=null,e.push(...m,...d),d.forEach(f=>j(null,null,function*(){i.add(()=>gc(i,e,f,r,o))}))}),My=(i,e,t,r)=>j(null,null,function*(){let o=new gn({concurrency:6}),a=hn(i);return a.filter(s=>s.type==="folder"&&s.status==="checked"&&(s.cached===!1||s.nextPagePath)).forEach(s=>{o.add(()=>gc(o,a,s,e,t))}),o.on("completed",()=>{let s=a.filter(l=>l.type==="file"&&l.status==="checked").length;r(s)}),yield o.onIdle(),a}),yc=My;var yr={afterOpenFolder:pc,afterScrollFolder:uc,afterToggleCheckbox:dc,afterFill:yc};var zy=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:r}=i.target;return e-(t+r)<50},yn=zy;var Ry=i=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){i.log("Aborting request","warning");return}i.log(e,"error"),e.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(e.message)},"warning",5e3)}},Ei=Ry;var Uy=(i,e,t,r)=>{let o=e.findIndex(a=>a.id===r);if(o!==-1&&t){let a=e.findIndex(s=>s.id===i);return e.slice(Math.min(o,a),Math.max(o,a)+1).map(s=>s.id)}return[i]},bn=Uy;var Ny="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var bc=(i=21)=>{let e="",t=i|0;for(;t--;)e+=Ny[Math.random()*64|0];return e};function Ly(i){let{searchString:e,setSearchString:t,submitSearchString:r,wrapperClassName:o,inputClassName:a,inputLabel:n,clearSearchLabel:s="",showButton:l=!1,buttonLabel:d="",buttonCSSClassName:m=""}=i,f=B=>{t(B.target.value)},S=Xi(B=>{B.preventDefault(),r()},[r]),[C]=Qt(()=>{let B=document.createElement("form");return B.setAttribute("tabindex","-1"),B.id=bc(),B});return oi(()=>(document.body.appendChild(C),C.addEventListener("submit",S),()=>{C.removeEventListener("submit",S),document.body.removeChild(C)}),[C,S]),p("section",{className:o},p("input",{className:`uppy-u-reset ${a}`,type:"search","aria-label":n,placeholder:n,value:e,onInput:f,form:C.id,"data-uppy-super-focusable":!0}),!l&&p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},p("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&e&&p("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":s,title:s,onClick:()=>t("")},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},p("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),l&&p("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${m}`,type:"submit",form:C.id},d))}var ro=Ly;var wc=$e(Ct(),1);var $y=i=>i.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!i.some(o=>o.type!=="root"&&o.parentId===t.id):!1).length,vc=$y;function ta(i){let{cancelSelection:e,donePicking:t,i18n:r,partialTree:o,validateAggregateRestrictions:a}=i,n=Gi(()=>a(o),[o,a]),s=Gi(()=>vc(o),[o]);return s===0?null:p("div",{className:"uppy-ProviderBrowser-footer"},p("div",{className:"uppy-ProviderBrowser-footer-buttons"},p("button",{className:(0,wc.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":n}),disabled:!!n,onClick:t,type:"button"},r("selectX",{smart_count:s})),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},r("cancel"))),n&&p("div",{className:"uppy-ProviderBrowser-footer-error"},n))}var jy=(i,e,t)=>{var r,o;return{id:i.id,source:e.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(r=i.author)==null?void 0:r.name,authorUrl:(o=i.author)==null?void 0:o.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},_c=jy;var Hy=(i,e,t)=>{let r=i.map(n=>_c(n,e,t)),o=[],a=[];r.forEach(n=>{e.uppy.checkIfFileAlreadyExists(Ua(n,e.uppy.getID()))?a.push(n):o.push(n)}),o.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:o.length})),a.length>0&&e.uppy.info(`Not adding ${a.length} files because they already exist`),e.uppy.addFiles(o)},vn=Hy;var xc=(i,e,t)=>{let r=e===null?"null":e;if(t[r])return t[r];let o=i.find(n=>n.id===e);if(o.type==="root")return[];let a=[...xc(i,o.parentId,t),o];return t[r]=a,a},Vy=i=>{let e=Object.create(null);return i.filter(o=>o.type==="file"&&o.status==="checked").map(o=>{let a=xc(i,o.id,e),n=a.findIndex(m=>m.type==="folder"&&m.status==="checked"),s=a.slice(n),l=`/${a.map(m=>m.data.name).join("/")}`,d=s.length===1?void 0:s.map(m=>m.data.name).join("/");return J(x({},o.data),{absDirPath:l,relDirPath:d})})},wn=Vy;var Wy=(i,e)=>{let t=i.find(o=>o.id===e),r=[];for(;r=[t,...r],t.type!=="root";){let o=t.parentId;t=i.find(a=>a.id===o)}return r},Cc=Wy;function Ki(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var qy=0;function Pc(i){return"__private_"+qy+++"_"+i}var Gy={version:"4.4.4"};function ra(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},p("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var Sc=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),br=Pc("abortController"),ni=Pc("withAbort"),ia=class{constructor(e,t){Object.defineProperty(this,ni,{value:Xy}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,br,{writable:!0,value:void 0}),this.validateSingleFile=o=>{let a=Zo(o);return this.plugin.uppy.validateSingleFile(a)},this.getDisplayedPartialTree=()=>{let{partialTree:o,currentFolderId:a,searchString:n}=this.plugin.getPluginState(),s=o.filter(d=>d.type!=="root"&&d.parentId===a);return n===""?s:s.filter(d=>{var m;return((m=d.data.name)!=null?m:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(n.toLowerCase())!==-1})},this.validateAggregateRestrictions=o=>{let n=o.filter(s=>s.type==="file"&&s.status==="checked").map(s=>s.data);return this.plugin.uppy.validateAggregateRestrictions(n)},this.plugin=e,this.provider=t.provider;let r={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=x(x({},r),t),this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(Sc(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:J(x({},r),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}openFolder(e){return j(this,null,function*(){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),r=t.find(o=>o.id===e);if(r.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),yield Ki(this,ni)[ni](o=>j(this,null,function*(){let a=e,n=[];do{let{username:l,nextPagePath:d,items:m}=yield this.provider.list(a,{signal:o});this.plugin.setPluginState({username:l}),a=d,n=n.concat(m),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:n.length}))}while(this.opts.loadAllFiles&&a);let s=yr.afterOpenFolder(t,n,r,a,this.validateSingleFile);this.plugin.setPluginState({partialTree:s,currentFolderId:e,searchString:""})})).catch(Ei(this.plugin.uppy)),this.setLoading(!1)})}logout(){return j(this,null,function*(){yield Ki(this,ni)[ni](e=>j(this,null,function*(){let t=yield this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let r=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(r,"info",7e3)}this.plugin.setPluginState(J(x({},Sc(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(Ei(this.plugin.uppy))})}handleAuth(e){return j(this,null,function*(){yield Ki(this,ni)[ni](t=>j(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(Ei(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(e){return j(this,null,function*(){let{partialTree:t,currentFolderId:r}=this.plugin.getPluginState(),o=t.find(a=>a.id===r);yn(e)&&!this.isHandlingScroll&&o.nextPagePath&&(this.isHandlingScroll=!0,yield Ki(this,ni)[ni](a=>j(this,null,function*(){let{nextPagePath:n,items:s}=yield this.provider.list(o.nextPagePath,{signal:a}),l=yr.afterScrollFolder(t,r,s,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(Ei(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return j(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),yield Ki(this,ni)[ni](t=>j(this,null,function*(){let r=yield yr.afterFill(e,n=>this.provider.list(n,{signal:t}),this.validateSingleFile,n=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:n}))});if(this.validateAggregateRestrictions(r)){this.plugin.setPluginState({partialTree:r});return}let a=wn(r);vn(a,this.plugin,this.provider),this.resetPluginState()})).catch(Ei(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),o=bn(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),a=yr.afterToggleCheckbox(r,o);this.plugin.setPluginState({partialTree:a}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:r}=this.plugin.getPluginState(),{i18n:o}=this.plugin.uppy;r||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let a=x(x({},this.opts),t),{authenticated:n,loading:s}=this.plugin.getPluginState(),l=this.plugin.icon||ra;if(n===!1)return p(un,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:a.renderAuthForm,loading:s});let{partialTree:d,currentFolderId:m,username:f,searchString:S}=this.plugin.getPluginState(),C=Cc(d,m);return p("div",{className:(0,Fc.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${a.viewType}`)},p(Gs,{showBreadcrumbs:a.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:C,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:f,i18n:o}),a.showFilter&&p(ro,{searchString:S,setSearchString:B=>{this.plugin.setPluginState({searchString:B})},submitSearchString:()=>{},inputLabel:o("filter"),clearSearchLabel:o("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(cn,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:a.virtualList,noResultsLabel:o("noFilesFound"),handleScroll:this.handleScroll,viewType:a.viewType,showTitles:a.showTitles,i18n:this.plugin.uppy.i18n,isLoading:s,utmSource:"Companion"}),p(ta,{partialTree:d,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:o,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function Xy(i){return j(this,null,function*(){var e;(e=Ki(this,br)[br])==null||e.abort();let t=new AbortController;Ki(this,br)[br]=t;let r=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),yield i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),Ki(this,br)[br]=void 0}})}ia.VERSION=Gy.version;var kc=$e(Ct(),1);var Yy={version:"4.4.4"},Ky={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},Qy={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},oo=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=r=>{let o=Zo(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r}=this.plugin.getPluginState();return r.filter(o=>o.type!=="root")},this.setSearchString=r=>{this.plugin.setPluginState({searchString:r}),r===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=r=>{let a=r.filter(n=>n.type==="file"&&n.status==="checked").map(n=>n.data);return this.plugin.uppy.validateAggregateRestrictions(a)},this.plugin=e,this.provider=t.provider,this.opts=x(x({},Qy),t),this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(Ky)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:J(x({},r),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}search(){return j(this,null,function*(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=yield this.provider.search(e),r=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(o=>({type:"file",id:o.requestPath,status:"unchecked",parentId:null,data:o}))];this.plugin.setPluginState({partialTree:r,isInputMode:!1})}catch(t){Ei(this.plugin.uppy)(t)}this.setLoading(!1)}})}handleScroll(e){return j(this,null,function*(){let{partialTree:t,searchString:r}=this.plugin.getPluginState(),o=t.find(a=>a.type==="root");if(yn(e)&&!this.isHandlingScroll&&o.nextPagePath){this.isHandlingScroll=!0;try{let a=yield this.provider.search(r,o.nextPagePath),n=J(x({},o),{nextPagePath:a.nextPageQuery}),s=t.filter(d=>d.type!=="root"),l=[n,...s,...a.items.map(d=>({type:"file",id:d.requestPath,status:"unchecked",parentId:null,data:d}))];this.plugin.setPluginState({partialTree:l})}catch(a){Ei(this.plugin.uppy)(a)}this.isHandlingScroll=!1}})}donePicking(){return j(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState(),t=wn(e);vn(t,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),o=bn(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),a=yr.afterToggleCheckbox(r,o);this.plugin.setPluginState({partialTree:a}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:r,searchString:o,loading:a,partialTree:n}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy,l=x(x({},this.opts),t);return r?p(ro,{searchString:o,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("enterTextToSearch"),buttonLabel:s("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):p("div",{className:(0,kc.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&p(ro,{searchString:o,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("search"),clearSearchLabel:s("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(cn,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>j(this,null,function*(){}),noResultsLabel:s("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:a,i18n:s,virtualList:!1,utmSource:this.opts.utmSource}),p(ta,{partialTree:n,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};oo.VERSION=Yy.version;var Zy="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var _n=(i=21)=>{let e="",t=i|0;for(;t--;)e+=Zy[Math.random()*64|0];return e};var Ic=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Jy(i,e){return!!(i===e||Ic(i)&&Ic(e))}function eb(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!Jy(i[t],e[t]))return!1;return!0}function nl(i,e){e===void 0&&(e=eb);var t=null;function r(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];if(t&&t.lastThis===this&&e(o,t.lastArgs))return t.lastResult;var n=i.apply(this,o);return t={lastResult:n,lastArgs:o,lastThis:this},n}return r.clear=function(){t=null},r}var xn=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function oa(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function Tc(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function tb(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function ib(i){return i.contains(document.activeElement)}function sl(i,e,t){let r=oa(t,e),o=vi(r.querySelectorAll(xn)),a=o.indexOf(document.activeElement);ib(r)?i.shiftKey&&a===0?tb(i,o):!i.shiftKey&&a===o.length-1&&Tc(i,o):Tc(i,o)}function Dc(i,e,t){e===null||sl(i,e,t)}var Bc=$e(Kn(),1);function ll(){let i=!1;return(0,Bc.default)((t,r)=>{let o=oa(t,r),a=o.contains(document.activeElement);if(a&&i)return;let n=o.querySelector("[data-uppy-super-focusable]");if(!(a&&!n))if(n)n.focus({preventScroll:!0}),i=!0;else{let s=o.querySelector(xn);s?.focus({preventScroll:!0}),i=!1}},260)}var Yc=$e(Ct(),1);var Mc=$e(Ct(),1);function Ec(i,e){if(i===e)return!0;if(!i||!e)return!1;let t=Object.keys(i),r=Object.keys(e),o=t.length;if(r.length!==o)return!1;for(let a=0;a<o;a++){let n=t[a];if(i[n]!==e[n]||!Object.prototype.hasOwnProperty.call(e,n))return!1}return!0}function ob(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},p("g",{fill:"#686DE0",fillRule:"evenodd"},p("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),p("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),p("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function ab(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function nb(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function sb(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function lb(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function pb(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("g",{fill:"#A7AFB7",fillRule:"nonzero"},p("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),p("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function ub(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function vr(i){let e={color:"#838999",icon:pb()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:ub()}:t==="image"?{color:"#686de0",icon:ob()}:t==="audio"?{color:"#068dbb",icon:ab()}:t==="video"?{color:"#19af67",icon:nb()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:sb()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:lb()}:e}function aa(i){let{file:e}=i;if(e.preview)return p("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:r}=vr(e.type);return p("div",{className:"uppy-Dashboard-Item-previewIconWrap"},p("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},r),p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},p("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var db=(i,e)=>(typeof e=="function"?e():e).filter(o=>o.id===i)[0].name;function na(i){let{file:e,toggleFileCard:t,i18n:r,metaFields:o}=i,{missingRequiredMetaFields:a}=e;if(!(a!=null&&a.length))return null;let n=a.map(s=>db(s,o)).join(", ");return p("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:a.length,fields:n})," ",p("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},r("editFile")))}function pl(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:o,showLinkToFileUploadResult:a}=i,s=e.preview?"rgba(255, 255, 255, 0.5)":vr(e.type).color;return p("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:s}},a&&e.uploadURL&&p("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},p("span",{hidden:!0},e.meta.name)),p(aa,{file:e}),p(na,{file:e,i18n:t,toggleFileCard:r,metaFields:o}))}function cb(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function Ac(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function ul(i){return p("div",{className:"uppy-Dashboard-Item-progress"},p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":Ac(i),title:Ac(i),onClick:()=>cb(i)},i.children))}function Cn(i){let{children:e}=i;return p("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function dl(i){let{progress:e}=i,t=2*Math.PI*15;return p("g",null,p("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),p("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e}))}function cl(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?p("div",{className:"uppy-Dashboard-Item-progress"},p("div",{className:"uppy-Dashboard-Item-progressIndicator"},p(Cn,null,p("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),p("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):i.recoveredState?null:i.error&&!i.hideRetryButton?p(ul,i,p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},p("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),p("path",{d:"M7.9 3H10v2H7.9z"}),p("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),p("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?p(ul,i,p(Cn,null,p(dl,{progress:i.file.progress.percentage}),i.file.isPaused?p("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):p("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},p("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),p("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?p(ul,i,p(Cn,null,p(dl,{progress:i.file.progress.percentage}),p("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):p("div",{className:"uppy-Dashboard-Item-progress"},p("div",{className:"uppy-Dashboard-Item-progressIndicator"},p(Cn,null,p(dl,{progress:i.file.progress.percentage}))))}var Oc=$e(bo(),1);var hl="...";function Sn(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=hl.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-hl.length,r=Math.ceil(t/2),o=Math.floor(t/2);return i.slice(0,r)+hl+i.slice(-o)}var hb=i=>{let{author:e,name:t}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return p("div",{className:"uppy-Dashboard-Item-name",title:t},Sn(t,r()))},fb=i=>{var e;let{author:t}=i.file.meta,r=(e=i.file.remote)==null?void 0:e.providerName,o="\xB7";return t?p("div",{className:"uppy-Dashboard-Item-author"},p("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Sn(t.name,13)),r?p(Fragment,null,` ${o} `,r,` ${o} `):null):null},mb=i=>i.file.size&&p("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Oc.default)(i.file.size)),gb=i=>i.file.isGhost&&p("span",null," \u2022 ",p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),yb=i=>{let{file:e,onClick:t}=i;return e.error?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function fl(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:o,toggleAddFilesPanel:a,isSingleFile:n,containerHeight:s,containerWidth:l}=i;return p("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},p("div",{className:"uppy-Dashboard-Item-fileName"},hb({file:e,isSingleFile:n,containerHeight:s,containerWidth:l}),p(yb,{file:e,onClick:()=>alert(e.error)})),p("div",{className:"uppy-Dashboard-Item-status"},fb({file:e}),mb({file:e}),gb({file:e,toggleAddFilesPanel:a,i18n:t})),p(na,{file:e,i18n:t,toggleFileCard:r,metaFields:o}))}function ml(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=i,document.body.appendChild(r),r.select();let o=()=>{document.body.removeChild(r),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(r),t()):o()}catch{return document.body.removeChild(r),o()}})}function bb(i){let{file:e,uploadInProgressOrComplete:t,metaFields:r,canEditFile:o,i18n:a,onClick:n}=i;return!t&&r&&r.length>0||!t&&o(e)?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":a("editFileWithFilename",{file:e.meta.name}),title:a("editFileWithFilename",{file:e.meta.name}),onClick:()=>n()},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},p("g",{fillRule:"evenodd"},p("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),p("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),p("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function vb(i){let{i18n:e,onClick:t,file:r}=i;return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:r.meta.name}),title:e("removeFile",{file:r.meta.name}),onClick:()=>t()},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},p("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),p("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function wb(i){let{file:e,uppy:t,i18n:r}=i,o=a=>{ml(e.uploadURL,r("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(r("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>a.target.focus({preventScroll:!0}))};return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":r("copyLink"),title:r("copyLink"),onClick:a=>o(a)},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},p("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function gl(i){let{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:o,metaFields:a,showLinkToFileUploadResult:n,showRemoveButton:s,i18n:l,toggleFileCard:d,openFileEditor:m}=i;return p("div",{className:"uppy-Dashboard-Item-actionWrapper"},p(bb,{i18n:l,file:t,uploadInProgressOrComplete:r,canEditFile:o,metaFields:a,onClick:()=>{a&&a.length>0?d(!0,t.id):m(t)}}),n&&t.uploadURL?p(wb,{file:t,uppy:e,i18n:l}):null,s?p(vb,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var Pn=class extends Ge{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Ec(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,r=!!e.progress.uploadComplete&&!t&&!e.error,o=!!e.progress.uploadStarted||!!t,a=e.progress.uploadStarted&&!e.progress.uploadComplete||t,n=e.error||!1,{isGhost:s}=e,l=(this.props.individualCancellation||!a)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);let d=(0,Mc.default)({"uppy-Dashboard-Item":!0,"is-inprogress":a&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!n,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return p("div",{className:d,id:`uppy_${e.id}`,role:this.props.role},p("div",{className:"uppy-Dashboard-Item-preview"},p(pl,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),p(cl,{uppy:this.props.uppy,file:e,error:n,isUploaded:r,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),p("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},p(fl,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),p(gl,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:o,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function _b(i,e){let t=[],r=[];return i.forEach(o=>{r.length<e?r.push(o):(t.push(r),r=[o])}),r.length&&t.push(r),t}function yl(i){let{id:e,i18n:t,uppy:r,files:o,resumableUploads:a,hideRetryButton:n,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:m,metaFields:f,isSingleFile:S,toggleFileCard:C,handleRequestThumbnail:B,handleCancelThumbnail:Y,recoveredState:te,individualCancellation:Z,itemsPerRow:re,openFileEditor:oe,canEditFile:ue,toggleAddFilesPanel:le,containerWidth:b,containerHeight:v}=i,P=re===1?71:200,M=Gi(()=>{let K=(Oe,je)=>Number(o[je].isGhost)-Number(o[Oe].isGhost),ge=Object.keys(o);return te&&ge.sort(K),_b(ge,re)},[o,re,te]),H=K=>p("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:K[0]},K.map(ge=>p(Pn,{key:ge,uppy:r,id:e,i18n:t,resumableUploads:a,individualCancellation:Z,hideRetryButton:n,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:m,metaFields:f,recoveredState:te,isSingleFile:S,containerWidth:b,containerHeight:v,toggleFileCard:C,handleRequestThumbnail:B,handleCancelThumbnail:Y,role:"listitem",openFileEditor:oe,canEditFile:ue,toggleAddFilesPanel:le,file:o[ge]})));return S?p("div",{class:"uppy-Dashboard-files"},H(M[0])):p(dn,{class:"uppy-Dashboard-files",role:"list",data:M,renderRow:H,rowHeight:P})}var bl=class extends Ge{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var r;return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(r=this.props.allowedFileTypes)==null?void 0:r.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,r)=>{let a={photo:"image/*",video:"video/*"}[e];return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:a,ref:r})},this.renderMyDeviceAcquirer=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let r=this.props.acquirers.length;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":r===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),o=this.props.fileManagerSelectionType,a=o.charAt(0).toUpperCase()+o.slice(1);return p("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${a}`,{browseFiles:t,browseFolders:r,browse:t}):this.props.i18nArray(`dropPaste${a}`,{browseFiles:t,browseFolders:r,browse:t}))},this.renderAcquirer=e=>{var t;return p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},p("div",{className:"uppy-DashboardTab-inner"},e.icon()),p("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],r=t.splice(e.length-2,e.length);return p(gt,null,t.map(o=>this.renderAcquirer(o)),p("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map(o=>this.renderAcquirer(o))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:r,showNativeVideoCameraButton:o}=this.props,a=[],n="myDevice";t||a.push({key:n,elements:this.renderMyDeviceAcquirer()}),r&&a.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),o&&a.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),a.push(...e.map(m=>({key:m.id,elements:this.renderAcquirer(m)}))),a.length===1&&a[0].key===n&&(a=[]);let l=[...a],d=l.splice(a.length-2,a.length);return p(gt,null,this.renderDropPasteBrowseTagline(a.length),p("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(m=>{let{key:f,elements:S}=m;return p(gt,{key:f},S)}),p("span",{role:"presentation",style:{"white-space":"nowrap"}},d.map(m=>{let{key:f,elements:S}=m;return p(gt,{key:f},S)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=p("span",null,p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},p("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),p("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),r=e("poweredBy",{uppy:t});return p("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},r)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:r}=this.props;return p("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,o=>{this.fileInput=o}),this.renderHiddenInput(!0,o=>{this.folderInput=o}),e&&this.renderHiddenCameraInput("photo",r,o=>{this.mobilePhotoFileInput=o}),t&&this.renderHiddenCameraInput("video",r,o=>{this.mobileVideoFileInput=o}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),p("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&p("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},Fn=bl;var zc=$e(Ct(),1);var xb=i=>p("div",{className:(0,zc.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),p(Fn,i)),Rc=xb;var Uc=$e(Ct(),1);function Cb(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var wi=Cb;function Sb(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:o,state:a,uppy:n}=i,s=qi(null);return p("div",{className:(0,Uc.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:wi,onDragLeave:wi,onDrop:wi,onPaste:wi},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},o("importFrom",{name:e.name})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},o("cancel"))),p("div",{ref:s,className:"uppy-DashboardContent-panelBody"},n.getPlugin(e.id).render(a,s.current)))}var Nc=Sb;var Lc=$e(Ct(),1);function Pb(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return p("div",{className:(0,Lc.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),p("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),p("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(r=>i.uppy.getPlugin(r.id).render(i.state))))}var $c=Pb;var _i={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function Fb(i,e,t,r){if(r===void 0&&(r={}),i)return _i.STATE_ERROR;if(e)return _i.STATE_COMPLETE;if(t)return _i.STATE_PAUSED;let o=_i.STATE_WAITING,a=Object.keys(r);for(let n=0;n<a.length;n++){let{progress:s}=r[a[n]];if(s.uploadStarted&&!s.uploadComplete)return _i.STATE_UPLOADING;s.preprocess&&o!==_i.STATE_UPLOADING&&(o=_i.STATE_PREPROCESSING),s.postprocess&&o!==_i.STATE_UPLOADING&&o!==_i.STATE_PREPROCESSING&&(o=_i.STATE_POSTPROCESSING)}return o}function kb(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:o,isAllPaused:a,inProgressNotPausedFiles:n,newFiles:s,processingFiles:l}=i;switch(Fb(o,r,a,e)){case"uploading":return t("uploadingXFiles",{smart_count:n.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:s.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function Ib(i){let{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:o,toggleAddFilesPanel:a,uppy:n}=i,{allowNewUpload:s}=i;return s&&o&&(s=i.totalFileCount<i.maxNumberOfFiles),p("div",{className:"uppy-DashboardContent-bar"},!t&&!r?p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>n.cancelAll()},e("cancel")):p("div",null),p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},p(kb,i)),s?p("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>a(!0)},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},p("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),p("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):p("div",null))}var jc=Ib;var Hc=$e(Ct(),1);function vl(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:r,form:o,formState:a}=i,n={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(s=>{let l=`uppy-Dashboard-FileCard-input-${s.id}`,d=t.includes(s.id);return p("fieldset",{key:s.id,className:"uppy-Dashboard-FileCard-fieldset"},p("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},s.name),s.render!==void 0?s.render({value:a[s.id],onChange:m=>r(m,s.id),fieldCSSClasses:n,required:d,form:o.id},p):p("input",{className:n.text,id:l,form:o.id,type:s.type||"text",required:d,value:a[s.id],placeholder:s.placeholder,onInput:m=>r(m.target.value,s.id),"data-uppy-super-focusable":!0}))})}function wl(i){var e;let{files:t,fileCardFor:r,toggleFileCard:o,saveFileCard:a,metaFields:n,requiredMetaFields:s,openFileEditor:l,i18n:d,i18nArray:m,className:f,canEditFile:S}=i,C=()=>typeof n=="function"?n(t[r]):n,B=t[r],Y=(e=C())!=null?e:[],te=S(B),Z={};Y.forEach(P=>{var M;Z[P.id]=(M=B.meta[P.id])!=null?M:""});let[re,oe]=Qt(Z),ue=Xi(P=>{P.preventDefault(),a(re,r)},[a,re,r]),le=(P,M)=>{oe(J(x({},re),{[M]:P}))},b=()=>{o(!1)},[v]=Qt(()=>{let P=document.createElement("form");return P.setAttribute("tabindex","-1"),P.id=_n(),P});return oi(()=>(document.body.appendChild(v),v.addEventListener("submit",ue),()=>{v.removeEventListener("submit",ue),document.body.removeChild(v)}),[v,ue]),p("div",{className:(0,Hc.default)("uppy-Dashboard-FileCard",f),"data-uppy-panelType":"FileCard",onDragOver:wi,onDragLeave:wi,onDrop:wi,onPaste:wi},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},m("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},B.meta?B.meta.name:B.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",form:v.id,title:d("finishEditingFile"),onClick:b},d("cancel"))),p("div",{className:"uppy-Dashboard-FileCard-inner"},p("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:vr(B.type).color}},p(aa,{file:B}),te&&p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:P=>{ue(P),l(B)}},d("editImage"))),p("div",{className:"uppy-Dashboard-FileCard-info"},p(vl,{computedMetaFields:Y,requiredMetaFields:s,updateMeta:le,form:v,formState:re})),p("div",{className:"uppy-Dashboard-FileCard-actions"},p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:v.id},d("saveChanges")),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:b,form:v.id},d("cancel")))))}var Wc=$e(Ct(),1),ao="uppy-transition-slideDownUp",Vc=250;function Tb(i){let{children:e}=i,[t,r]=Qt(null),[o,a]=Qt(""),n=qi(),s=qi(),l=qi(),d=()=>{a(`${ao}-enter`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{a(`${ao}-enter ${ao}-enter-active`),n.current=setTimeout(()=>{a("")},Vc)})},m=()=>{a(`${ao}-leave`),cancelAnimationFrame(l.current),clearTimeout(n.current),n.current=void 0,l.current=requestAnimationFrame(()=>{a(`${ao}-leave ${ao}-leave-active`),s.current=setTimeout(()=>{r(null),a("")},Vc)})};return oi(()=>{let f=At(e)[0];t!==f&&(f&&!t?d():t&&!f&&!s.current&&m(),r(f))},[e,t]),oi(()=>()=>{clearTimeout(n.current),clearTimeout(s.current),cancelAnimationFrame(l.current)},[]),t?Ao(t,{className:(0,Wc.default)(o,t.props.className)}):null}var sa=Tb;function no(){return no=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},no.apply(null,arguments)}var qc=900,Gc=700,_l=576,Xc=330;function xl(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>_l,o=i.containerHeight>Xc,a=(0,Yc.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>_l,"uppy-size--lg":i.containerWidth>Gc,"uppy-size--xl":i.containerWidth>qc,"uppy-size--height-md":i.containerHeight>Xc,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&o}),n=1;i.containerWidth>qc?n=5:i.containerWidth>Gc?n=4:i.containerWidth>_l&&(n=3);let s=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,d=i.files?Object.keys(i.files).filter(S=>i.files[S].isGhost).length:0,m=()=>d>0?i.i18n("recoveredXFiles",{smart_count:d}):i.i18n("recoveredAllFiles");return p("div",{className:a,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Lo(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},p("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),p("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:p("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},p("span",{"aria-hidden":"true"},"\xD7")),p("div",{className:"uppy-Dashboard-innerWrap"},p("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),s&&p(jc,i),l&&p("div",{className:"uppy-Dashboard-serviceMsg"},p("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},p("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},p("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),p("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),p("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),p("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),p("div",{className:"uppy-Dashboard-serviceMsg-text"},m())),s?p(yl,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:n,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):p(Fn,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),p(sa,null,i.showAddFilesPanel?p(Rc,no({key:"AddFiles"},i,{isSizeMD:r})):null),p(sa,null,i.fileCardFor?p(wl,no({key:"FileCard"},i)):null),p(sa,null,i.activePickerPanel?p(Nc,no({key:"Picker"},i)):null),p(sa,null,i.showFileEditor?p($c,no({key:"Editor"},i)):null),p("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(S=>i.uppy.getPlugin(S.id).render(i.state))))))}var Kc={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function Ie(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Db=0;function yt(i){return"__private_"+Db+++"_"+i}var Bb={version:"4.3.4"},Cl=nl.default||nl,Qc=9,Eb=27;function Zc(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var Ab={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:ra,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550},wr=yt("disabledNodes"),Ai=yt("generateLargeThumbnailIfSingleFile"),la=yt("openFileEditorWhenFilesAdded"),_r=yt("attachRenderFunctionToTarget"),Sl=yt("isTargetSupported"),Pl=yt("getAcquirers"),Fl=yt("getProgressIndicators"),Oi=yt("getEditors"),kl=yt("addSpecifiedPluginsFromOptions"),Il=yt("autoDiscoverPlugins"),xr=yt("addSupportedPluginIfNoTarget"),pa=yt("getStatusBarOpts"),ua=yt("getThumbnailGeneratorOpts"),Tl=yt("getInformerOpts"),da=yt("getStatusBarId"),ca=yt("getThumbnailGeneratorId"),Dl=yt("getInformerId"),Cr=class extends xt{constructor(e,t){var r,o,a;let n=(r=t?.autoOpen)!=null?r:null;super(e,J(x(x({},Ab),t),{autoOpen:n})),Object.defineProperty(this,Dl,{value:Nb}),Object.defineProperty(this,ca,{value:Ub}),Object.defineProperty(this,da,{value:Rb}),Object.defineProperty(this,Tl,{value:zb}),Object.defineProperty(this,ua,{value:Mb}),Object.defineProperty(this,pa,{value:Ob}),Object.defineProperty(this,wr,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${_n()}`,this.superFocus=ll(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=s=>{let d=this.getPluginState().targets.filter(m=>m.id!==s.id);this.setPluginState({targets:d})},this.addTarget=s=>{let l=s.id||s.constructor.name,d=s.title||l,m=s.type;if(m!=="acquirer"&&m!=="progressindicator"&&m!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let f={id:l,name:d,type:m},C=this.getPluginState().targets.slice();return C.push(f),this.setPluginState({targets:C}),this.el},this.hideAllPanels=()=>{var s;let l=this.getPluginState(),d={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===d.activePickerPanel&&l.showAddFilesPanel===d.showAddFilesPanel&&l.showFileEditor===d.showFileEditor&&l.activeOverlayType===d.activeOverlayType||(this.setPluginState(d),this.uppy.emit("dashboard:close-panel",(s=l.activePickerPanel)==null?void 0:s.id))},this.showPanel=s=>{let{targets:l}=this.getPluginState(),d=l.find(m=>m.type==="acquirer"&&m.id===s);this.setPluginState({activePickerPanel:d,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",s)},this.canEditFile=s=>{let{targets:l}=this.getPluginState();return Ie(this,Oi)[Oi](l).some(m=>this.uppy.getPlugin(m.id).canEditFile(s))},this.openFileEditor=s=>{let{targets:l}=this.getPluginState(),d=Ie(this,Oi)[Oi](l);this.setPluginState({showFileEditor:!0,fileCardFor:s.id||null,activeOverlayType:"FileEditor"}),d.forEach(m=>{this.uppy.getPlugin(m.id).selectFile(s)})},this.closeFileEditor=()=>{let{metaFields:s}=this.getPluginState();s&&s.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:s}=this.getPluginState();Ie(this,Oi)[Oi](s).forEach(d=>{this.uppy.getPlugin(d.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:s,resolve:l}=Zc();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let d=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",d,!1),l()};this.el.addEventListener("animationend",d,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),s},this.closeModal=s=>{var l;let d=(l=s?.manualClose)!=null?l:!0,{isHidden:m,isClosing:f}=this.getPluginState();if(m||f)return;let{promise:S,resolve:C}=Zc();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let Y=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",Y,!1),C()};this.el.addEventListener("animationend",Y,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),C();if(document.removeEventListener("keydown",this.handleKeyDownInModal),d&&this.opts.browserBackButtonClose){var B;(B=history.state)!=null&&B[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),S},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=s=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:J(x({},l),{darkMode:s})})},this.handleSystemDarkModeChange=s=>{let l=s.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(s,l)=>{let d=this.uppy.getFile(l);s?this.uppy.emit("dashboard:file-edit-start",d):this.uppy.emit("dashboard:file-edit-complete",d),this.setPluginState({fileCardFor:s?l:null,activeOverlayType:s?"FileCard":null})},this.toggleAddFilesPanel=s=>{this.setPluginState({showAddFilesPanel:s,activeOverlayType:s?"AddFiles":null})},this.addFiles=s=>{let l=s.map(d=>({source:this.id,name:d.name,type:d.type,data:d,meta:{relativePath:d.relativePath||d.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(d){this.uppy.log(d)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(s=>{let l=s[0],{width:d,height:m}=l.contentRect;this.setPluginState({containerWidth:d,containerHeight:m,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let s=this.getPluginState(),l=!this.opts.inline&&s.isHidden;!s.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=s=>{this.el.contains(s.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=s=>{var l;let d=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],m=(l=Ie(this,wr)[wr])!=null?l:vi(this.el.querySelectorAll(d)).filter(f=>!f.classList.contains("uppy-Dashboard-close"));for(let f of m)f.tagName==="A"?f.setAttribute("aria-disabled",s):f.disabled=s;s?Ie(this,wr)[wr]=m:Ie(this,wr)[wr]=null,this.dashboardIsDisabled=s},this.updateBrowserHistory=()=>{var s;(s=history.state)!=null&&s[this.modalName]||history.pushState(J(x({},history.state),{[this.modalName]:!0}),""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=s=>{var l;this.isModalOpen()&&(!s.state||!s.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=s.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=s=>{s.keyCode===Eb&&this.requestCloseModal(),s.keyCode===Qc&&sl(s,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=s=>{this.uppy.iteratePlugins(d=>{d.type==="acquirer"&&(d.handleRootPaste==null||d.handleRootPaste(s))});let l=vi(s.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=s=>{s.preventDefault();let l=vi(s.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=s=>{s.preventDefault(),s.stopPropagation();let l=()=>{let S=!0;return this.uppy.iteratePlugins(C=>{C.canHandleRootDrop!=null&&C.canHandleRootDrop(s)&&(S=!0)}),S},d=()=>{let{types:S}=s.dataTransfer;return S.some(C=>C==="Files")},m=l(),f=d();if(!m&&!f||this.opts.disabled||this.opts.disableLocalFiles&&(f||!m)||!this.uppy.getState().allowNewUpload){s.dataTransfer.dropEffect="none";return}s.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(s)},this.handleDragLeave=s=>{s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(s)},this.handleDrop=s=>j(this,null,function*(){s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(f=>{f.type==="acquirer"&&(f.handleRootDrop==null||f.handleRootDrop(s))});let l=!1,d=f=>{this.uppy.log(f,"error"),l||(this.uppy.info(f.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let m=yield $o(s.dataTransfer,{logDropError:d});m.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(m)),this.opts.onDrop(s)}),this.handleRequestThumbnail=s=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",s)},this.handleCancelThumbnail=s=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",s)},this.handleKeyDownInInline=s=>{s.keyCode===Qc&&Dc(s,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=s=>{this.el.contains(document.activeElement)&&this.handlePaste(s)},this.handleComplete=s=>{let{failed:l}=s;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Ai,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let s=600,l=this.uppy.getFiles();if(l.length===1){let d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d?.setOptions({thumbnailWidth:s});let m=J(x({},l[0]),{preview:void 0});d?.requestThumbnail(m).then(()=>{d?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,la,{writable:!0,value:s=>{let l=s[0],{metaFields:d}=this.getPluginState(),m=d&&d.length>0,f=this.canEditFile(l);m&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):f&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let s=Vs(this.opts.trigger);s?s.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",Ie(this,xr)[xr]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",Ie(this,Ai)[Ai]),this.uppy.on("file-removed",Ie(this,Ai)[Ai]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",Ie(this,la)[la])},this.removeEvents=()=>{let s=Vs(this.opts.trigger);!this.opts.inline&&s&&s.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",Ie(this,xr)[xr]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",Ie(this,Ai)[Ai]),this.uppy.off("file-removed",Ie(this,Ai)[Ai]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",Ie(this,la)[la])},this.superFocusOnEachUpdate=()=>{let s=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,d=this.uppy.getState().info.length===0,m=!this.opts.inline;d&&(m||s||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(s,l)=>{this.uppy.setFileMeta(l,s),this.toggleFileCard(!1,l)},Object.defineProperty(this,_r,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return J(x({},s),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,Sl,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,Pl,{writable:!0,value:Cl(s=>s.filter(l=>l.type==="acquirer"&&Ie(this,Sl)[Sl](l)).map(Ie(this,_r)[_r]))}),Object.defineProperty(this,Fl,{writable:!0,value:Cl(s=>s.filter(l=>l.type==="progressindicator").map(Ie(this,_r)[_r]))}),Object.defineProperty(this,Oi,{writable:!0,value:Cl(s=>s.filter(l=>l.type==="editor").map(Ie(this,_r)[_r]))}),this.render=s=>{let l=this.getPluginState(),{files:d,capabilities:m,allowNewUpload:f}=s,{newFiles:S,uploadStartedFiles:C,completeFiles:B,erroredFiles:Y,inProgressFiles:te,inProgressNotPausedFiles:Z,processingFiles:re,isUploadStarted:oe,isAllComplete:ue,isAllPaused:le}=this.uppy.getObjectOfFilesPerState(),b=Ie(this,Pl)[Pl](l.targets),v=Ie(this,Fl)[Fl](l.targets),P=Ie(this,Oi)[Oi](l.targets),M;return this.opts.theme==="auto"?M=m.darkMode?"dark":"light":M=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),xl({state:s,isHidden:l.isHidden,files:d,newFiles:S,uploadStartedFiles:C,completeFiles:B,erroredFiles:Y,inProgressFiles:te,inProgressNotPausedFiles:Z,processingFiles:re,isUploadStarted:oe,isAllComplete:ue,isAllPaused:le,totalFileCount:Object.keys(d).length,totalProgress:s.totalProgress,allowNewUpload:f,acquirers:b,theme:M,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:v,editors:P,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:s.recoveredState,metaFields:l.metaFields,resumableUploads:m.resumableUploads||!1,individualCancellation:m.individualCancellation,isMobileDevice:m.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,kl,{writable:!0,value:()=>{let{plugins:s}=this.opts;s.forEach(l=>{let d=this.uppy.getPlugin(l);d?d.mount(this,d):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,Il,{writable:!0,value:()=>{this.uppy.iteratePlugins(Ie(this,xr)[xr])}}),Object.defineProperty(this,xr,{writable:!0,value:s=>{var l;let d=["acquirer","editor"];s&&!((l=s.opts)!=null&&l.target)&&d.includes(s.type)&&(this.getPluginState().targets.some(f=>s.id===f.id)||s.mount(this,s))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:s,closeAfterFinish:l}=this.opts;if(s&&l)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:d,allowMultipleUploadBatches:m}=this.uppy.opts;(d||m)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:f}=this.opts;f&&this.mount(f,this),this.opts.disableStatusBar||this.uppy.use(cr,x({id:Ie(this,da)[da](),target:this},Ie(this,pa)[pa]())),this.opts.disableInformer||this.uppy.use(hr,x({id:Ie(this,Dl)[Dl](),target:this},Ie(this,Tl)[Tl]())),this.opts.disableThumbnailGenerator||this.uppy.use(to,x({id:Ie(this,ca)[ca]()},Ie(this,ua)[ua]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let S=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${S?"on":"off"}`),this.setDarkModeCapability(S),this.opts.theme==="auto"){var C;(C=this.darkModeMediaQuery)==null||C.addListener(this.handleSystemDarkModeChange)}Ie(this,kl)[kl](),Ie(this,Il)[Il](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let d=this.uppy.getPlugin(`${this.id}:Informer`);d&&this.uppy.removePlugin(d)}if(!this.opts.disableStatusBar){let d=this.uppy.getPlugin(`${this.id}:StatusBar`);d&&this.uppy.removePlugin(d)}if(!this.opts.disableThumbnailGenerator){let d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d&&this.uppy.removePlugin(d)}let{plugins:s}=this.opts;if(s.forEach(d=>{let m=this.uppy.getPlugin(d);m&&m.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=Kc,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(a=(o=this.opts).onRequestCloseModal)!=null||(o.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,r;super.setOptions(e),(t=this.uppy.getPlugin(Ie(this,da)[da]()))==null||t.setOptions(Ie(this,pa)[pa]()),(r=this.uppy.getPlugin(Ie(this,ca)[ca]()))==null||r.setOptions(Ie(this,ua)[ua]())}};function Ob(){let{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:o,hideProgressAfterFinish:a,locale:n,doneButtonHandler:s}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:o,hideAfterFinish:a,locale:n,doneButtonHandler:s}}function Mb(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r,lazy:!r}}function zb(){return{}}function Rb(){return`${this.id}:StatusBar`}function Ub(){return`${this.id}:ThumbnailGenerator`}function Nb(){return`${this.id}:Informer`}Cr.VERSION=Bb.version;var Bl=class{onMount(e,t){this.options=x(x({},e),this.props),this.uppy.use(t,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(e,t){e.uppy&&this.uppy!==e.uppy.previousValue&&e.uppy.previousValue!==void 0&&(this.uninstall(e.uppy.previousValue),this.uppy.use(t,this.options)),this.options=x(x({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),e.props&&this.props!==e.props.previousValue&&e.props.previousValue!==void 0&&this.plugin.setOptions(x({},this.options))}uninstall(e=this.uppy){e.removePlugin(this.plugin)}};var Jc=(()=>{class i extends Bl{constructor(){super(),this.el=Dt(rp),this.uppy=new Wr,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},Cr)}ngOnChanges(t){this.handleChanges(t,Cr)}ngOnDestroy(){this.uninstall()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=Yt({type:i,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[fi,ep],decls:0,vars:0,template:function(r,o){},encapsulation:2,changeDetection:0})}}return i})();function he(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Lb=0;function Ot(i){return"__private_"+Lb+++"_"+i}function $b(i){return new Error("Cancelled",{cause:i})}function eh(i){if(i!=null){var e;let t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});let r=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,r,r)}return this}var Vt=Ot("activeRequests"),kt=Ot("queuedHandlers"),Ht=Ot("paused"),Sr=Ot("pauseTimer"),Ft=Ot("downLimit"),Pr=Ot("upperLimit"),Mi=Ot("rateLimitingTimer"),ha=Ot("call"),zi=Ot("queueNext"),Ol=Ot("next"),El=Ot("queue"),Ml=Ot("dequeue"),Al=Ot("resume"),Fr=Ot("increaseLimit"),kn=class{constructor(e){Object.defineProperty(this,Ml,{value:qb}),Object.defineProperty(this,El,{value:Wb}),Object.defineProperty(this,Ol,{value:Vb}),Object.defineProperty(this,zi,{value:Hb}),Object.defineProperty(this,ha,{value:jb}),Object.defineProperty(this,Vt,{writable:!0,value:0}),Object.defineProperty(this,kt,{writable:!0,value:[]}),Object.defineProperty(this,Ht,{writable:!0,value:!1}),Object.defineProperty(this,Sr,{writable:!0,value:void 0}),Object.defineProperty(this,Ft,{writable:!0,value:1}),Object.defineProperty(this,Pr,{writable:!0,value:void 0}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Al,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,Fr,{writable:!0,value:()=>{if(he(this,Ht)[Ht]){he(this,Mi)[Mi]=setTimeout(he(this,Fr)[Fr],0);return}he(this,Ft)[Ft]=this.limit,this.limit=Math.ceil((he(this,Pr)[Pr]+he(this,Ft)[Ft])/2);for(let t=he(this,Ft)[Ft];t<=this.limit;t++)he(this,zi)[zi]();he(this,Pr)[Pr]-he(this,Ft)[Ft]>3?he(this,Mi)[Mi]=setTimeout(he(this,Fr)[Fr],2e3):he(this,Ft)[Ft]=Math.floor(he(this,Ft)[Ft]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!he(this,Ht)[Ht]&&he(this,Vt)[Vt]<this.limit?he(this,ha)[ha](e):he(this,El)[El](e,t)}wrapSyncFunction(e,t){var r=this;return function(){for(var o=arguments.length,a=new Array(o),n=0;n<o;n++)a[n]=arguments[n];let s=r.run(()=>(e(...a),queueMicrotask(()=>s.done()),()=>{}),t);return{abortOn:eh,abort(){s.abort()}}}}wrapPromiseFunction(e,t){var r=this;return function(){for(var o=arguments.length,a=new Array(o),n=0;n<o;n++)a[n]=arguments[n];let s,l=new Promise((d,m)=>{s=r.run(()=>{let f,S;try{S=Promise.resolve(e(...a))}catch(C){S=Promise.reject(C)}return S.then(C=>{f?m(f):(s.done(),d(C))},C=>{f?m(f):(s.done(),m(C))}),C=>{f=$b(C)}},t)});return l.abort=d=>{s.abort(d)},l.abortOn=eh,l}}resume(){he(this,Ht)[Ht]=!1,clearTimeout(he(this,Sr)[Sr]);for(let e=0;e<this.limit;e++)he(this,zi)[zi]()}pause(e){e===void 0&&(e=null),he(this,Ht)[Ht]=!0,clearTimeout(he(this,Sr)[Sr]),e!=null&&(he(this,Sr)[Sr]=setTimeout(he(this,Al)[Al],e))}rateLimit(e){clearTimeout(he(this,Mi)[Mi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(he(this,Pr)[Pr]=this.limit-1,this.limit=he(this,Ft)[Ft],he(this,Mi)[Mi]=setTimeout(he(this,Fr)[Fr],e))}get isPaused(){return he(this,Ht)[Ht]}};function jb(i){he(this,Vt)[Vt]+=1;let e=!1,t;try{t=i()}catch(r){throw he(this,Vt)[Vt]-=1,r}return{abort:r=>{e||(e=!0,he(this,Vt)[Vt]-=1,t?.(r),he(this,zi)[zi]())},done:()=>{e||(e=!0,he(this,Vt)[Vt]-=1,he(this,zi)[zi]())}}}function Hb(){queueMicrotask(()=>he(this,Ol)[Ol]())}function Vb(){if(he(this,Ht)[Ht]||he(this,Vt)[Vt]>=this.limit||he(this,kt)[kt].length===0)return;let i=he(this,kt)[kt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=he(this,ha)[ha](i.fn);i.abort=e.abort,i.done=e.done}function Wb(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{he(this,Ml)[Ml](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=he(this,kt)[kt].findIndex(o=>t.priority>o.priority);return r===-1?he(this,kt)[kt].push(t):he(this,kt)[kt].splice(r,0,t),t}function qb(i){let e=he(this,kt)[kt].indexOf(i);e!==-1&&he(this,kt)[kt].splice(e,1)}var bS=Symbol("__queue");var Ul=$e(bo(),1),oh=$e(th(),1);var ih={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function rh(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Gb=0;function Xb(i){return"__private_"+Gb+++"_"+i}var Yb={quality:.6,limit:10},fa=Xb("RateLimitedQueue"),In=class extends dr{constructor(e,t){super(e,x(x({},Yb),t)),Object.defineProperty(this,fa,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=ih,rh(this,fa)[fa]=new kn(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(e){return new Promise((t,r)=>{new oh.default(e,J(x({},this.opts),{success:t,error:r}))})}prepareUpload(e){return j(this,null,function*(){let t=0,r=[],o=rh(this,fa)[fa].wrapPromiseFunction(n=>j(this,null,function*(){try{let s=yield this.compress(n.data),l=n.data.size-s.size;this.uppy.log(`[Image Compressor] Image ${n.id} compressed by ${(0,Ul.default)(l)}`),t+=l;let{name:d,type:m,size:f}=s,S=yi(d),B=`${yi(n.meta.name).name}.${S.extension}`;this.uppy.setFileState(n.id,J(x(x(x(x({},d&&{name:d}),S.extension&&{extension:S.extension}),m&&{type:m}),f&&{size:f}),{data:s,meta:J(x({},n.meta),{type:m,name:B})})),r.push(n)}catch(s){this.uppy.log(`[Image Compressor] Failed to compress ${n.id}:`,"warning"),this.uppy.log(s,"warning")}})),a=e.map(n=>{var s;let l=this.uppy.getFile(n);return this.uppy.emit("preprocess-progress",l,{mode:"indeterminate",message:this.i18n("compressingImages")}),l.isRemote||(l.data.type||(l.data=l.data.slice(0,l.data.size,l.type)),!((s=l.type)!=null&&s.startsWith("image/")))?Promise.resolve():o(l)});yield Promise.all(a),this.uppy.emit("compressor:complete",r),t>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,Ul.default)(t)}),"info");for(let n of e){let s=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",s)}})}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};var uh=$e(ah(),1);function Kb(i,e){let t=i.width/e.width,r=i.height/e.height,o=Math.min(t,r),a=e.width*o,n=e.height*o,s=(i.width-a)/2,l=(i.height-n)/2;return{width:a,height:n,left:s,top:l}}var nh=Kb;function Qb(i){return i*(Math.PI/180)}function Zb(i,e,t){let r=Math.abs(Qb(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}var sh=Zb;function Jb(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}var lh=Jb;function e1(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}var ph=e1;var Tn=class extends Ge{constructor(e){super(e),this.onRotate90Deg=()=>{let{angle90Deg:t}=this.state,r=t-90;this.setState({angle90Deg:r,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(r);let o=this.cropper.getCanvasData(),a=this.cropper.getContainerData(),n=nh(a,o);this.cropper.setCanvasData(n),this.cropper.setCropBoxData(n)},this.onRotateGranular=t=>{let r=Number(t.target.value);this.setState({angleGranular:r});let{angle90Deg:o}=this.state,a=o+r;this.cropper.rotateTo(a);let n=this.cropper.getImageData(),s=sh(n.naturalWidth,n.naturalHeight,r),l=this.cropper.getImageData().scaleX<0?-s:s;this.cropper.scale(l,s)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){let{opts:e,storeCropperInstance:t}=this.props;this.cropper=new uh.default(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){let t=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:o}=this.state;if(e.detail.action==="all"){let a=lh(t,r,o);a&&this.cropper.setCropBoxData(a)}else{let a=ph(t,r,o);a&&this.cropper.setCropBoxData(a)}}renderGranularRotate(){let{i18n:e}=this.props,{angleGranular:t}=this.state;return p("label",{role:"tooltip","aria-label":`${t}\xBA`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},p("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){let{i18n:e,opts:t}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),p("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))}renderCropWidescreen(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),p("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),p("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){let{currentImage:e,opts:t}=this.props,{actions:r}=t,o=URL.createObjectURL(e.data);return p("div",{className:"uppy-ImageCropper"},p("div",{className:"uppy-ImageCropper-container"},p("img",{className:"uppy-ImageCropper-image",alt:e.name,src:o,ref:a=>{this.imgElement=a}})),p("div",{className:"uppy-ImageCropper-controls"},r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}};var dh={strings:{revert:"Reset",rotate:"Rotate 90\xB0",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};var t1={version:"3.3.3"},ch={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},hh={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},i1={quality:.8,actions:hh,cropperOptions:ch},kr=class extends xt{constructor(e,t){super(e,J(x(x({},i1),t),{actions:x(x({},hh),t?.actions),cropperOptions:x(x({},ch),t?.cropperOptions)})),this.save=()=>{let r=n=>{var s;let{currentImage:l}=this.getPluginState();this.uppy.setFileState(l.id,{data:new File([n],(s=l.name)!=null?s:this.i18n("unnamed"),{type:n.type}),size:n.size,preview:void 0});let d=this.uppy.getFile(l.id);this.uppy.emit("thumbnail:request",d),this.setPluginState({currentImage:d}),this.uppy.emit("file-editor:complete",d)},{currentImage:o}=this.getPluginState(),a=this.cropper.getCroppedCanvas({});a.width%2!==0&&this.cropper.setData({width:a.width-1}),a.height%2!==0&&this.cropper.setData({height:a.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(r,o.type,this.opts.quality)},this.storeCropperInstance=r=>{this.cropper=r},this.selectFile=r=>{this.uppy.emit("file-editor:start",r),this.setPluginState({currentImage:r})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=dh,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;let t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){let{currentImage:e}=this.getPluginState();if(e){let t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){let{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:p(Tn,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};kr.VERSION=t1.version;var fh=$e(Bp(),1);function r1(i,e){if(i&1&&(ve(0,"small",5),Bt(1),Ce()),i&2){let t=X();V(),rr(t.subtitle)}}function o1(i,e){if(i&1&&(ve(0,"a",6),Ae(1,"i",7),Bt(2," Download Template "),Ce()),i&2){let t=X();ap("top-58",t.subtitle),N("href",t.sampleUrl,Fa)}}function a1(i,e){if(i&1&&(Si(0),Bt(1),Pi()),i&2){let t=X(2);V(),co("- ",t.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function n1(i,e){if(i&1&&(ve(0,"div",4)(1,"h4",8),Bt(2,"CSV File Content Summary"),Ce(),Ae(3,"hr"),ve(4,"p",9),Bt(5),se(6,a1,2,1,"ng-container",10),Ce()()),i&2){let t=X();V(5),co("",t.rowSummary().rowCount," rows found "),V(),N("ngIf",t.rowSummary().rowEmpty>0)}}var cP=(()=>{class i{static{this.sizes=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]}static{this.kilobyte=1024}constructor(){this.folder="test",this.thumbnailSize="small",this.sampleUrl="",this.subtitle="",this.showSample=!0,this.clear=Pa(!1),this.showSubtitle=!0,this.uppyCoreConfiguration=Pa(),this.dashboardPropsConfiguration=Pa(),this.fileUploaded=new rt,this.fileUploadComplete=new rt,this.fileRemoved=new rt,this.onParser=new rt,this.multipleFilesUploaded=new rt,this.http=Dt(Ap),this.csvParser=Dt(Ep),this.rowSummary=Or({rowCount:0,rowEmpty:0}),this.file=Or(null),this.multipleFiles=Or([]),this.uppy=new Wr({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6},onBeforeFileAdded:(t,r)=>J(x({},t),{name:t.name?.replace(/ /g,"_")})}).use(In,{mimeType:"image/jpeg",convertSize:1/0,convertTypes:["image/png"]}).use(kr),this.dashboardProps={hideUploadButton:!0,height:350},Un(()=>this.uppy.setOptions(x({},this.uppyCoreConfiguration()))),Un(()=>this.dashboardProps=x(x({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(t,r)=>{let o=r[0]?.data;this.showSample=!1,this.showSubtitle=!1,this.emitFileUpload(o),this.file.set(r[0].data),fh.default.parse(o,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:a=>{let n=a.split(/\r?\n/).slice(1);return n[n.length-1]===""&&n.pop(),this.rowSummary.update(s=>J(x({},s),{rowCount:n.length})),n.forEach(s=>{s.split(",").every(d=>d==="")&&this.rowSummary.update(d=>J(x({},d),{rowEmpty:d.rowEmpty+1}))}),a},error(a,n){console.log("ERROR",a,n)},complete:(a,n)=>{this.onParser.emit(a.data)}})}),this.uppy.on("complete",t=>{let r=t.successful?.map(a=>({file:a.data,id:a.id}))??[],o=t.successful[0]?.data;this.showSample=!1,this.showSubtitle=!1,this.emitFileUploadComplete(o),this.emitMultipleFilesUploaded(r),this.onResetUppy(),this.file.set(o),this.multipleFiles.set(r)}),this.uppy.on("file-removed",t=>{this.showSample=!0,this.showSubtitle=!0,this.file.set(null);let o=this.multipleFiles().filter(a=>a.id!=t.id);this.multipleFiles.set(o),this.fileRemoved.emit(t.id),this.rowSummary.set({rowCount:0,rowEmpty:0})}),this.onFileEdited()}onFileEdited(){this.clear()==!1&&(this.uppy.on("file-editor:start",t=>{}),this.uppy.on("file-editor:complete",t=>{this.handlingEditedImage(t)}),this.uppy.on("file-editor:cancel",t=>{}))}handlingEditedImage(t){this.multipleFiles.update(r=>r.map(o=>o.id===t.id?J(x({},o),{file:t.data}):o)),this.file.set(this.multipleFiles()[0].file),this.emitFileUploadComplete(this.file()),this.emitMultipleFilesUploaded(this.multipleFiles())}onResetUppy(){this.clear()&&this.uppy.clear()}formatFileSize(t,r=2){if(t===0)return"0 bytes";let o=Math.floor(Math.log(t)/Math.log(i.kilobyte));return`${(t/Math.pow(i.kilobyte,o)).toFixed(r)} ${i.sizes[o]}`}ngOnDestroy(){this.file.set(null),this.multipleFiles.set([])}emitFileUpload(t){let r=new File([t],t.name.replace(/ /g,"_"),{type:t.type});this.fileUploaded.emit(r)}emitFileUploadComplete(t){let r=new File([t],t.name.replace(/ /g,"_"),{type:t.type});this.fileUploadComplete.emit(r)}emitMultipleFilesUploaded(t){let r=t.map(o=>({file:new File([o.file],o.file.name.replace(/ /g,"_"),{type:o.file.type}),id:o.id}));this.multipleFilesUploaded.emit(r)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=Yt({type:i,selectors:[["POS-uppy"]],inputs:{folder:"folder",thumbnailSize:"thumbnailSize",sampleUrl:"sampleUrl",subtitle:"subtitle",showSample:"showSample",clear:[1,"clear"],uppyCoreConfiguration:[1,"uppyCoreConfiguration"],dashboardPropsConfiguration:[1,"dashboardPropsConfiguration"]},outputs:{fileUploaded:"fileUploaded",fileUploadComplete:"fileUploadComplete",fileRemoved:"fileRemoved",onParser:"onParser",multipleFilesUploaded:"multipleFilesUploaded"},decls:5,vars:5,consts:[[1,"position-relative"],[3,"uppy","props"],["class","subtitle position-absolute",4,"ngIf"],["class","sample position-absolute","role","button",3,"top-58","href",4,"ngIf"],["role","alert",1,"alert","alert-warning","d-flex","flex-column","gap-2",2,"margin","1rem 0 0 0"],[1,"subtitle","position-absolute"],["role","button",1,"sample","position-absolute",3,"href"],[1,"fa-solid","fa-download","ms-3"],[1,"alert-heading"],[1,"fs-6","m-0"],[4,"ngIf"]],template:function(r,o){if(r&1&&(ve(0,"div",0),Ae(1,"uppy-dashboard",1),se(2,r1,2,1,"small",2)(3,o1,3,3,"a",3)(4,n1,7,2,"div",4),Ce()),r&2){let a;V(),N("uppy",o.uppy)("props",o.dashboardProps),V(),N("ngIf",o.subtitle&&o.showSubtitle),V(),N("ngIf",o.sampleUrl&&o.showSample),V(),dt(o.file()&&((a=o.file())==null?null:a.type)==="text/csv"?4:-1)}},dependencies:[Jc,Hi,ji],styles:[".uppy-Dashboard-AddFiles-info{display:none!important} .uppy-Dashboard-AddFiles-list{flex:none;flex-direction:row;flex-wrap:wrap;justify-content:center;max-width:600px;margin-top:15px;padding-top:0;overflow-y:visible}.sample[_ngcontent-%COMP%], .subtitle[_ngcontent-%COMP%]{top:56%;width:100%;text-align:center}.top-58[_ngcontent-%COMP%]{top:61%}"]})}}return i})();export{zm as a,uv as b,Bp as c,cP as d};
|
|
527
|
+
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&(yield e.ensureChunk(this.ifd0Offset,Wd(this.options)));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0})}parseExifBlock(){return j(this,null,function*(){if(this.exif||(this.ifd0||(yield this.parseIfd0Block()),this.exifOffset===void 0))return;this.file.tiff&&(yield this.file.ensureChunk(this.exifOffset,Wd(this.options)));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e})}unpack(e,t){let r=e.get(t);r&&r.length===1&&e.set(t,r[0])}parseGpsBlock(){return j(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Kd(...e.get(2),e.get(1))),e.set("longitude",Kd(...e.get(4),e.get(3)))),e})}parseInteropBlock(){return j(this,null,function*(){if(!this.interop&&(this.ifd0||(yield this.parseIfd0Block()),this.interopOffset!==void 0||this.exif||(yield this.parseExifBlock()),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")})}parseThumbnailBlock(e=!1){return j(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return j(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,r,o={};for(t of at)if(e=this[t],!tc(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(o,r)}else o[t]=r;return this.makerNote&&(o.makerNote=this.makerNote),this.userComment&&(o.userComment=this.userComment),o}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,o]of Object.entries(t))this.assignObjectToOutput(e,r,o)}};function Kd(i,e,t,r){var o=i+e/60+t/3600;return r!=="S"&&r!=="W"||(o*=-1),o}Ee(Wo,"type","tiff"),Ee(Wo,"headerLength",10),jt.set("tiff",Wo);var hx=Object.freeze({__proto__:null,default:ay,Exifr:eo,fileParsers:sn,segmentParsers:jt,fileReaders:Ko,tagKeys:Qo,tagValues:$s,tagRevivers:js,createDictionary:ic,extendDictionary:rc,fetchUrlAsArrayBuffer:rn,readBlobAsArrayBuffer:Xo,chunkedProps:Kr,otherSegments:ln,segments:Yo,tiffBlocks:at,segmentsAndBlocks:Qr,tiffExtractables:Zr,inheritables:pn,allFormatters:Jr,Options:gr,parse:oc}),Hs={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},fx=Object.assign({},Hs,{firstChunkSize:4e4,gps:[1,2,3,4]});var mx=Object.assign({},Hs,{tiff:!1,ifd1:!0,mergeOutput:!1});var uy=Object.assign({},Hs,{firstChunkSize:4e4,ifd0:[274]});function dy(i){return j(this,null,function*(){let e=new eo(uy);yield e.read(i);let t=yield e.parse();if(t&&t.ifd0)return t.ifd0[274]})}var cy=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}}),Ho=!0,Vo=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,r]=e;Ho=Number(t)+.1*Number(r)<13.4,Vo=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Ho=Vo=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Ho=Vo=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Ho=Vo=Number(e)<77}}function ac(i){return j(this,null,function*(){let e=yield dy(i);return Object.assign({canvas:Ho,css:Vo},cy[e])})}var Us=class extends mr{constructor(...e){super(...e),Ee(this,"ranges",new Ns),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let o=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(o)}else{let o=e+t;if(o>this.byteLength){let{dataView:a}=this._extend(o);this._swapDataView(a)}}}_extend(e){let t;t=ec?Jd.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let o=super.set(e,t);return this.ranges.add(t,o.byteLength),o}ensureChunk(e,t){return j(this,null,function*(){this.chunked&&(this.ranges.available(e,t)||(yield this.readChunk(e,t)))})}available(e,t){return this.ranges.available(e,t)}},Ns=class{constructor(){Ee(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let o=e+t,a=this.list.filter(n=>Qd(e,n.offset,o)||Qd(e,n.end,o));if(a.length>0){e=Math.min(e,...a.map(s=>s.offset)),o=Math.max(o,...a.map(s=>s.end)),t=o-e;let n=a.shift();n.offset=e,n.length=t,n.end=o,this.list=this.list.filter(s=>!a.includes(s))}else this.list.push({offset:e,length:t,end:o})}available(e,t){let r=e+t;return this.list.some(o=>o.offset<=e&&r<=o.end)}};function Qd(i,e,t){return i<=e&&e<=t}var Ls=class extends Us{constructor(e,t){super(0),Ee(this,"chunksRead",0),this.input=e,this.options=t}readWhole(){return j(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return j(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return j(this,arguments,function*(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,r=yield this.readChunk(e,t);return!!r&&r.byteLength===t})}readChunk(e,t){return j(this,null,function*(){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)})}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};Ko.set("blob",class extends Ls{readWhole(){return j(this,null,function*(){this.chunked=!1;let i=yield Xo(this.input);this._swapArrayBuffer(i)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(i,e){return j(this,null,function*(){let t=e?i+e:void 0,r=this.input.slice(i,t),o=yield Xo(r);return this.set(o,i,!0)})}});var nc={strings:{generatingThumbnails:"Generating thumbnails..."}};var hy={version:"4.1.1"};function fy(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(r){if(r.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(r=>{i.toBlob(r,e,t)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>Hd(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function my(i,e){let t=i.width,r=i.height;(e.deg===90||e.deg===270)&&(t=i.height,r=i.width);let o=document.createElement("canvas");o.width=t,o.height=r;let a=o.getContext("2d");return a.translate(t/2,r/2),e.canvas&&(a.rotate(e.rad),a.scale(e.scaleX,e.scaleY)),a.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),o}function gy(i){let e=i.width/i.height,t=5e6,r=4096,o=Math.floor(Math.sqrt(t*e)),a=Math.floor(t/Math.sqrt(t*e));if(o>r&&(o=r,a=Math.round(o/e)),a>r&&(a=r,o=Math.round(e*a)),i.width>o){let n=document.createElement("canvas");return n.width=o,n.height=a,n.getContext("2d").drawImage(i,0,0,o,a),n}return i}var yy={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},to=class extends xt{constructor(e,t){if(super(e,x(x({},yy),t)),this.onFileAdded=r=>{!r.preview&&r.data&&tn(r.type)&&!r.isRemote&&this.addToQueue(r.id)},this.onCancelRequest=r=>{let o=this.queue.indexOf(r.id);o!==-1&&this.queue.splice(o,1)},this.onFileRemoved=r=>{let o=this.queue.indexOf(r.id);o!==-1&&this.queue.splice(o,1),r.preview&&en(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(o=>o.isRestored).forEach(o=>{(!o.preview||en(o.preview))&&this.addToQueue(o.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=r=>{r.forEach(a=>{let n=this.uppy.getFile(a);this.uppy.emit("preprocess-progress",n,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let o=()=>{r.forEach(a=>{let n=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",n)})};return new Promise(a=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{o(),a()}):(o(),a())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=nc,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,r){let o=URL.createObjectURL(e.data),a=new Promise((s,l)=>{let d=new Image;d.src=o,d.addEventListener("load",()=>{URL.revokeObjectURL(o),s(d)}),d.addEventListener("error",m=>{URL.revokeObjectURL(o),l(m.error||new Error("Could not create thumbnail"))})}),n=ac(e.data).catch(()=>1);return Promise.all([a,n]).then(s=>{let[l,d]=s,m=this.getProportionalDimensions(l,t,r,d.deg),f=my(l,d),S=this.resizeImage(f,m.width,m.height);return fy(S,this.thumbnailType,80)}).then(s=>URL.createObjectURL(s))}getProportionalDimensions(e,t,r,o){let a=e.width/e.height;return(o===90||o===270)&&(a=e.height/e.width),t!=null?{width:t,height:Math.round(t/a)}:r!=null?{width:Math.round(r*a),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/a)}}resizeImage(e,t,r){let o=gy(e),a=Math.ceil(Math.log2(o.width/t));a<1&&(a=1);let n=t*2**(a-1),s=r*2**(a-1),l=2;for(;a--;){let d=document.createElement("canvas");d.width=n,d.height=s,d.getContext("2d").drawImage(o,0,0,n,s),o=d,n=Math.round(n/l),s=Math.round(s/l)}return o}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return tn(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};to.VERSION=hy.version;function by(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&zo(i)?[i]:null}var Vs=by;var Fc=$e(Ct(),1);function Zo(i){return J(x({},i),{type:i.mimeType,extension:i.name?yi(i.name).extension:null})}function vy(){return p("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},p("g",{fill:"none","fill-rule":"evenodd"},p("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),p("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),p("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),p("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),p("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),p("path",{d:"M4 4h18v18H4z"})))}function wy(i){let{pluginName:e,i18n:t,onAuth:r}=i,o=e==="Google Drive",a=Xi(n=>{n.preventDefault(),r()},[r]);return p("form",{onSubmit:a},o?p("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},p(vy,null),t("signInWithGoogle")):p("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var _y=i=>{let{pluginName:e,i18n:t,onAuth:r}=i;return p(wy,{pluginName:e,i18n:t,onAuth:r})};function un(i){let{loading:e,pluginName:t,pluginIcon:r,i18n:o,handleAuth:a,renderForm:n=_y}=i;return p("div",{className:"uppy-Provider-auth"},p("div",{className:"uppy-Provider-authIcon"},r()),p("div",{className:"uppy-Provider-authTitle"},o("authenticateWithTitle",{pluginName:t})),n({pluginName:t,i18n:o,loading:e,onAuth:a}))}var sc=$e(Ct(),1);function Ws(i){let{i18n:e,logout:t,username:r}=i;return p(gt,null,r&&p("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),p("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function qs(i){let{openFolder:e,title:t,breadcrumbsIcon:r,breadcrumbs:o,i18n:a}=i;return p("div",{className:"uppy-Provider-breadcrumbs"},p("div",{className:"uppy-Provider-breadcrumbsIcon"},r),o.map((n,s)=>{var l;return p(gt,null,p("button",{key:n.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(n.id)},n.type==="root"?t:(l=n.data.name)!=null?l:a("unnamed")),o.length===s+1?"":" / ")}))}function Gs(i){return p("div",{className:"uppy-ProviderBrowser-header"},p("div",{className:(0,sc.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&p(qs,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),p(Ws,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Xs(){return Xs=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Xs.apply(null,arguments)}var xy={position:"relative",width:"100%",minHeight:"100%"},Cy={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Ys=class extends Ge{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let Y=e,{data:t,rowHeight:r,renderRow:o,overscanCount:a=10}=Y,n=va(Y,["data","rowHeight","renderRow","overscanCount"]),{offset:s,height:l}=this.state,d=Math.floor(s/r),m=Math.floor(l/r);a&&(d=Math.max(0,d-d%a),m+=a);let f=d+m+4,S=t.slice(d,f),C=J(x({},xy),{height:t.length*r}),B=J(x({},Cy),{top:d*r});return p("div",Xs({onScroll:this.handleScroll},n),p("div",{role:"presentation",style:C},p("div",{role:"presentation",style:B},S.map(o))))}},dn=Ys;var lc=$e(Ct(),1);function Sy(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},p("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function Py(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},p("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function Fy(){return p("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},p("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),p("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function io(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return p(Sy,null);case"folder":return p(Py,null);case"video":return p(Fy,null);default:return p("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function ky(i){var e,t;let{file:r,toggleCheckbox:o,className:a,isDisabled:n,restrictionError:s,showTitles:l,children:d=null,i18n:m}=i;return p("li",{className:a,title:n&&s?s:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:o,name:"listitem",id:r.id,checked:r.status==="checked",disabled:n,"data-uppy-super-focusable":!0}),p("label",{htmlFor:r.id,"aria-label":(e=r.data.name)!=null?e:m("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p(io,{itemIconString:r.data.thumbnail||r.data.icon}),l&&((t=r.data.name)!=null?t:m("unnamed")),d))}var Ks=ky;function Qs(i){var e,t,r;let{file:o,openFolder:a,className:n,isDisabled:s,restrictionError:l,toggleCheckbox:d,showTitles:m,i18n:f}=i;return p("li",{className:n,title:o.status!=="checked"&&l?l:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:d,name:"listitem",id:o.id,checked:o.status==="checked","aria-label":o.data.isFolder?f("allFilesFromFolderNamed",{name:(e=o.data.name)!=null?e:f("unnamed")}):null,disabled:s,"data-uppy-super-focusable":!0}),o.data.isFolder?p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>a(o.id),"aria-label":f("openFolderNamed",{name:(t=o.data.name)!=null?t:f("unnamed")})},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(io,{itemIconString:o.data.icon})),m&&o.data.name?p("span",null,o.data.name):f("unnamed")):p("label",{htmlFor:o.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(io,{itemIconString:o.data.icon})),m&&((r=o.data.name)!=null?r:f("unnamed"))))}function Zs(i){let{viewType:e,toggleCheckbox:t,showTitles:r,i18n:o,openFolder:a,file:n,utmSource:s}=i,l=n.type==="folder"?null:n.restrictionError,d=!!l&&n.status!=="checked",m={file:n,openFolder:a,toggleCheckbox:t,utmSource:s,i18n:o,viewType:e,showTitles:r,className:(0,lc.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":d},{"uppy-ProviderBrowserItem--noPreview":n.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":n.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":n.status==="partial"}),isDisabled:d,restrictionError:l};switch(e){case"grid":return p(Ks,m);case"list":return p(Qs,m);case"unsplash":return p(Ks,m,p("a",{href:`${n.data.author.url}?utm_source=${s}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},n.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function Iy(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:r,handleScroll:o,showTitles:a,i18n:n,isLoading:s,openFolder:l,noResultsLabel:d,virtualList:m,utmSource:f}=i,[S,C]=Qt(!1);if(oi(()=>{let Y=Z=>{Z.key==="Shift"&&C(!1)},te=Z=>{Z.key==="Shift"&&C(!0)};return document.addEventListener("keyup",Y),document.addEventListener("keydown",te),()=>{document.removeEventListener("keyup",Y),document.removeEventListener("keydown",te)}},[]),s)return p("div",{className:"uppy-Provider-loading"},typeof s=="string"?s:n("loading"));if(e.length===0)return p("div",{className:"uppy-Provider-empty"},d);let B=Y=>p(Zs,{viewType:t,toggleCheckbox:te=>{var Z;te.stopPropagation(),te.preventDefault(),(Z=document.getSelection())==null||Z.removeAllRanges(),r(Y,S)},showTitles:a,i18n:n,openFolder:l,file:Y,utmSource:f});return m?p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list"},p(dn,{data:e,renderRow:B,rowHeight:31}))):p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list",onScroll:o,role:"listbox",tabIndex:-1},e.map(B)))}var cn=Iy;var Ty=(i,e,t,r,o)=>{let a=e.filter(C=>C.isFolder===!0),n=e.filter(C=>C.isFolder===!1),s=t.type==="folder"&&t.status==="checked",l=a.map(C=>({type:"folder",id:C.requestPath,cached:!1,nextPagePath:null,status:s?"checked":"unchecked",parentId:t.id,data:C})),d=n.map(C=>{let B=o(C);return{type:"file",id:C.requestPath,restrictionError:B,status:s&&!B?"checked":"unchecked",parentId:t.id,data:C}}),m=J(x({},t),{cached:!0,nextPagePath:r});return[...i.map(C=>C.id===m.id?m:C),...l,...d]},pc=Ty;var Dy=(i,e,t,r,o)=>{let a=i.find(B=>B.id===e),n=t.filter(B=>B.isFolder===!0),s=t.filter(B=>B.isFolder===!1),l=J(x({},a),{nextPagePath:r}),d=i.map(B=>B.id===l.id?l:B),m=l.type==="folder"&&l.status==="checked",f=n.map(B=>({type:"folder",id:B.requestPath,cached:!1,nextPagePath:null,status:m?"checked":"unchecked",parentId:l.id,data:B})),S=s.map(B=>{let Y=o(B);return{type:"file",id:B.requestPath,restrictionError:Y,status:m&&!Y?"checked":"unchecked",parentId:l.id,data:B}});return[...d,...f,...S]},uc=Dy;var By=i=>i.map(e=>x({},e)),hn=By;var Js=(i,e,t)=>{i.filter(o=>o.type!=="root"&&o.parentId===e).forEach(o=>{o.status=t&&!(o.type==="file"&&o.restrictionError)?"checked":"unchecked",Js(i,o.id,t)})},el=(i,e)=>{let t=i.find(n=>n.id===e);if(t.type==="root")return;let r=i.filter(n=>n.type!=="root"&&n.parentId===t.id&&!(n.type==="file"&&n.restrictionError)),o=r.every(n=>n.status==="checked"),a=r.every(n=>n.status==="unchecked");o?t.status="checked":a?t.status="unchecked":t.status="partial",el(i,t.parentId)},Ey=(i,e)=>{let t=hn(i);if(e.length>=2){let r=t.filter(o=>o.type!=="root"&&e.includes(o.id));r.forEach(o=>{o.type==="file"?o.status=o.restrictionError?"unchecked":"checked":o.status="checked"}),r.forEach(o=>{Js(t,o.id,!0)}),el(t,r[0].parentId)}else{let r=t.find(o=>o.id===e[0]);r.status=r.status==="checked"?"unchecked":"checked",Js(t,r.id,r.status==="checked"),el(t,r.parentId)}return t},dc=Ey;var il=$e(hc(),1);var ea=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},rl=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},fc=i=>globalThis.DOMException===void 0?new rl(i):new DOMException(i),mc=i=>{let e=i.reason===void 0?fc("This operation was aborted."):i.reason;return e instanceof Error?e:fc(e)};function ol(i,e){let{milliseconds:t,fallback:r,message:o,customTimers:a={setTimeout,clearTimeout}}=e,n,s,d=new Promise((m,f)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:C}=e;C.aborted&&f(mc(C)),s=()=>{f(mc(C))},C.addEventListener("abort",s,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(m,f);return}let S=new ea;n=a.setTimeout.call(void 0,()=>{if(r){try{m(r())}catch(C){f(C)}return}typeof i.cancel=="function"&&i.cancel(),o===!1?m():o instanceof Error?f(o):(S.message=o??`Promise timed out after ${t} milliseconds`,f(S))},t),j(null,null,function*(){try{m(yield i)}catch(C){f(C)}})}).finally(()=>{d.clear(),s&&e.signal&&e.signal.removeEventListener("abort",s)});return d.clear=()=>{a.clearTimeout.call(void 0,n),n=void 0},d}function al(i,e,t){let r=0,o=i.length;for(;o>0;){let a=Math.trunc(o/2),n=r+a;t(i[n],e)<=0?(r=++n,o-=a+1):o=a}return r}var mn=class{#e=[];enqueue(e,t){t=x({priority:0},t);let r={priority:t.priority,id:t.id,run:e};if(this.size===0||this.#e[this.size-1].priority>=t.priority){this.#e.push(r);return}let o=al(this.#e,r,(a,n)=>n.priority-a.priority);this.#e.splice(o,0,r)}setPriority(e,t){let r=this.#e.findIndex(a=>a.id===e);if(r===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[o]=this.#e.splice(r,1);this.enqueue(o.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var gn=class extends il.default{#e;#n;#a=0;#h;#s;#f=0;#i;#l;#t;#m;#r=0;#p;#o;#g;#v=1n;timeout;constructor(e){if(super(),e=x({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:mn},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#n=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#h=e.intervalCap,this.#s=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#o=e.autoStart===!1}get#w(){return this.#n||this.#a<this.#h}get#_(){return this.#r<this.#p}#x(){this.#r--,this.#u(),this.emit("next")}#C(){this.#b(),this.#y(),this.#l=void 0}get#S(){let e=Date.now();if(this.#i===void 0){let t=this.#f-e;if(t<0)this.#a=this.#e?this.#r:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#C()},t)),!0}return!1}#u(){if(this.#t.size===0)return this.#i&&clearInterval(this.#i),this.#i=void 0,this.emit("empty"),this.#r===0&&this.emit("idle"),!1;if(!this.#o){let e=!this.#S;if(this.#w&&this.#_){let t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#n||this.#i!==void 0||(this.#i=setInterval(()=>{this.#b()},this.#s),this.#f=Date.now()+this.#s)}#b(){this.#a===0&&this.#r===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#a=this.#e?this.#r:0,this.#d()}#d(){for(;this.#u(););}get concurrency(){return this.#p}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#p=e,this.#d()}#P(e){return j(this,null,function*(){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(e.reason)},{once:!0})})})}setPriority(e,t){this.#t.setPriority(e,t)}add(r){return j(this,arguments,function*(e,t={}){return t.id??=(this.#v++).toString(),t=x({timeout:this.timeout,throwOnTimeout:this.#g},t),new Promise((o,a)=>{this.#t.enqueue(()=>j(this,null,function*(){this.#r++,this.#a++;try{t.signal?.throwIfAborted();let n=e({signal:t.signal});t.timeout&&(n=ol(Promise.resolve(n),{milliseconds:t.timeout})),t.signal&&(n=Promise.race([n,this.#P(t.signal)]));let s=yield n;o(s),this.emit("completed",s)}catch(n){if(n instanceof ea&&!t.throwOnTimeout){o();return}a(n),this.emit("error",n)}finally{this.#x()}}),t),this.emit("add"),this.#u()})})}addAll(e,t){return j(this,null,function*(){return Promise.all(e.map(r=>j(this,null,function*(){return this.add(r,t)})))})}start(){return this.#o?(this.#o=!1,this.#d(),this):this}pause(){this.#o=!0}clear(){this.#t=new this.#m}onEmpty(){return j(this,null,function*(){this.#t.size!==0&&(yield this.#c("empty"))})}onSizeLessThan(e){return j(this,null,function*(){this.#t.size<e||(yield this.#c("next",()=>this.#t.size<e))})}onIdle(){return j(this,null,function*(){this.#r===0&&this.#t.size===0||(yield this.#c("idle"))})}#c(e,t){return j(this,null,function*(){return new Promise(r=>{let o=()=>{t&&!t()||(this.off(e,o),r())};this.on(e,o)})})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#r}get isPaused(){return this.#o}};var gc=(i,e,t,r,o)=>j(null,null,function*(){let a=[],n=t.cached?t.nextPagePath:t.id;for(;n;){let f=yield r(n);a=a.concat(f.items),n=f.nextPagePath}let s=a.filter(f=>f.isFolder===!0),l=a.filter(f=>f.isFolder===!1),d=s.map(f=>({type:"folder",id:f.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:f})),m=l.map(f=>{let S=o(f);return{type:"file",id:f.requestPath,restrictionError:S,status:S?"unchecked":"checked",parentId:t.id,data:f}});t.cached=!0,t.nextPagePath=null,e.push(...m,...d),d.forEach(f=>j(null,null,function*(){i.add(()=>gc(i,e,f,r,o))}))}),My=(i,e,t,r)=>j(null,null,function*(){let o=new gn({concurrency:6}),a=hn(i);return a.filter(s=>s.type==="folder"&&s.status==="checked"&&(s.cached===!1||s.nextPagePath)).forEach(s=>{o.add(()=>gc(o,a,s,e,t))}),o.on("completed",()=>{let s=a.filter(l=>l.type==="file"&&l.status==="checked").length;r(s)}),yield o.onIdle(),a}),yc=My;var yr={afterOpenFolder:pc,afterScrollFolder:uc,afterToggleCheckbox:dc,afterFill:yc};var zy=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:r}=i.target;return e-(t+r)<50},yn=zy;var Ry=i=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){i.log("Aborting request","warning");return}i.log(e,"error"),e.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(e.message)},"warning",5e3)}},Ei=Ry;var Uy=(i,e,t,r)=>{let o=e.findIndex(a=>a.id===r);if(o!==-1&&t){let a=e.findIndex(s=>s.id===i);return e.slice(Math.min(o,a),Math.max(o,a)+1).map(s=>s.id)}return[i]},bn=Uy;var Ny="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var bc=(i=21)=>{let e="",t=i|0;for(;t--;)e+=Ny[Math.random()*64|0];return e};function Ly(i){let{searchString:e,setSearchString:t,submitSearchString:r,wrapperClassName:o,inputClassName:a,inputLabel:n,clearSearchLabel:s="",showButton:l=!1,buttonLabel:d="",buttonCSSClassName:m=""}=i,f=B=>{t(B.target.value)},S=Xi(B=>{B.preventDefault(),r()},[r]),[C]=Qt(()=>{let B=document.createElement("form");return B.setAttribute("tabindex","-1"),B.id=bc(),B});return oi(()=>(document.body.appendChild(C),C.addEventListener("submit",S),()=>{C.removeEventListener("submit",S),document.body.removeChild(C)}),[C,S]),p("section",{className:o},p("input",{className:`uppy-u-reset ${a}`,type:"search","aria-label":n,placeholder:n,value:e,onInput:f,form:C.id,"data-uppy-super-focusable":!0}),!l&&p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},p("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&e&&p("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":s,title:s,onClick:()=>t("")},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},p("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),l&&p("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${m}`,type:"submit",form:C.id},d))}var ro=Ly;var wc=$e(Ct(),1);var $y=i=>i.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!i.some(o=>o.type!=="root"&&o.parentId===t.id):!1).length,vc=$y;function ta(i){let{cancelSelection:e,donePicking:t,i18n:r,partialTree:o,validateAggregateRestrictions:a}=i,n=Gi(()=>a(o),[o,a]),s=Gi(()=>vc(o),[o]);return s===0?null:p("div",{className:"uppy-ProviderBrowser-footer"},p("div",{className:"uppy-ProviderBrowser-footer-buttons"},p("button",{className:(0,wc.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":n}),disabled:!!n,onClick:t,type:"button"},r("selectX",{smart_count:s})),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},r("cancel"))),n&&p("div",{className:"uppy-ProviderBrowser-footer-error"},n))}var jy=(i,e,t)=>{var r,o;return{id:i.id,source:e.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(r=i.author)==null?void 0:r.name,authorUrl:(o=i.author)==null?void 0:o.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},_c=jy;var Hy=(i,e,t)=>{let r=i.map(n=>_c(n,e,t)),o=[],a=[];r.forEach(n=>{e.uppy.checkIfFileAlreadyExists(Ua(n,e.uppy.getID()))?a.push(n):o.push(n)}),o.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:o.length})),a.length>0&&e.uppy.info(`Not adding ${a.length} files because they already exist`),e.uppy.addFiles(o)},vn=Hy;var xc=(i,e,t)=>{let r=e===null?"null":e;if(t[r])return t[r];let o=i.find(n=>n.id===e);if(o.type==="root")return[];let a=[...xc(i,o.parentId,t),o];return t[r]=a,a},Vy=i=>{let e=Object.create(null);return i.filter(o=>o.type==="file"&&o.status==="checked").map(o=>{let a=xc(i,o.id,e),n=a.findIndex(m=>m.type==="folder"&&m.status==="checked"),s=a.slice(n),l=`/${a.map(m=>m.data.name).join("/")}`,d=s.length===1?void 0:s.map(m=>m.data.name).join("/");return J(x({},o.data),{absDirPath:l,relDirPath:d})})},wn=Vy;var Wy=(i,e)=>{let t=i.find(o=>o.id===e),r=[];for(;r=[t,...r],t.type!=="root";){let o=t.parentId;t=i.find(a=>a.id===o)}return r},Cc=Wy;function Ki(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var qy=0;function Pc(i){return"__private_"+qy+++"_"+i}var Gy={version:"4.4.4"};function ra(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},p("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var Sc=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),br=Pc("abortController"),ni=Pc("withAbort"),ia=class{constructor(e,t){Object.defineProperty(this,ni,{value:Xy}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,br,{writable:!0,value:void 0}),this.validateSingleFile=o=>{let a=Zo(o);return this.plugin.uppy.validateSingleFile(a)},this.getDisplayedPartialTree=()=>{let{partialTree:o,currentFolderId:a,searchString:n}=this.plugin.getPluginState(),s=o.filter(d=>d.type!=="root"&&d.parentId===a);return n===""?s:s.filter(d=>{var m;return((m=d.data.name)!=null?m:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(n.toLowerCase())!==-1})},this.validateAggregateRestrictions=o=>{let n=o.filter(s=>s.type==="file"&&s.status==="checked").map(s=>s.data);return this.plugin.uppy.validateAggregateRestrictions(n)},this.plugin=e,this.provider=t.provider;let r={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=x(x({},r),t),this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(Sc(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:J(x({},r),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}openFolder(e){return j(this,null,function*(){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),r=t.find(o=>o.id===e);if(r.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),yield Ki(this,ni)[ni](o=>j(this,null,function*(){let a=e,n=[];do{let{username:l,nextPagePath:d,items:m}=yield this.provider.list(a,{signal:o});this.plugin.setPluginState({username:l}),a=d,n=n.concat(m),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:n.length}))}while(this.opts.loadAllFiles&&a);let s=yr.afterOpenFolder(t,n,r,a,this.validateSingleFile);this.plugin.setPluginState({partialTree:s,currentFolderId:e,searchString:""})})).catch(Ei(this.plugin.uppy)),this.setLoading(!1)})}logout(){return j(this,null,function*(){yield Ki(this,ni)[ni](e=>j(this,null,function*(){let t=yield this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let r=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(r,"info",7e3)}this.plugin.setPluginState(J(x({},Sc(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(Ei(this.plugin.uppy))})}handleAuth(e){return j(this,null,function*(){yield Ki(this,ni)[ni](t=>j(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(Ei(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(e){return j(this,null,function*(){let{partialTree:t,currentFolderId:r}=this.plugin.getPluginState(),o=t.find(a=>a.id===r);yn(e)&&!this.isHandlingScroll&&o.nextPagePath&&(this.isHandlingScroll=!0,yield Ki(this,ni)[ni](a=>j(this,null,function*(){let{nextPagePath:n,items:s}=yield this.provider.list(o.nextPagePath,{signal:a}),l=yr.afterScrollFolder(t,r,s,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(Ei(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return j(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),yield Ki(this,ni)[ni](t=>j(this,null,function*(){let r=yield yr.afterFill(e,n=>this.provider.list(n,{signal:t}),this.validateSingleFile,n=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:n}))});if(this.validateAggregateRestrictions(r)){this.plugin.setPluginState({partialTree:r});return}let a=wn(r);vn(a,this.plugin,this.provider),this.resetPluginState()})).catch(Ei(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),o=bn(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),a=yr.afterToggleCheckbox(r,o);this.plugin.setPluginState({partialTree:a}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:r}=this.plugin.getPluginState(),{i18n:o}=this.plugin.uppy;r||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let a=x(x({},this.opts),t),{authenticated:n,loading:s}=this.plugin.getPluginState(),l=this.plugin.icon||ra;if(n===!1)return p(un,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:a.renderAuthForm,loading:s});let{partialTree:d,currentFolderId:m,username:f,searchString:S}=this.plugin.getPluginState(),C=Cc(d,m);return p("div",{className:(0,Fc.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${a.viewType}`)},p(Gs,{showBreadcrumbs:a.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:C,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:f,i18n:o}),a.showFilter&&p(ro,{searchString:S,setSearchString:B=>{this.plugin.setPluginState({searchString:B})},submitSearchString:()=>{},inputLabel:o("filter"),clearSearchLabel:o("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(cn,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:a.virtualList,noResultsLabel:o("noFilesFound"),handleScroll:this.handleScroll,viewType:a.viewType,showTitles:a.showTitles,i18n:this.plugin.uppy.i18n,isLoading:s,utmSource:"Companion"}),p(ta,{partialTree:d,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:o,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function Xy(i){return j(this,null,function*(){var e;(e=Ki(this,br)[br])==null||e.abort();let t=new AbortController;Ki(this,br)[br]=t;let r=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),yield i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),Ki(this,br)[br]=void 0}})}ia.VERSION=Gy.version;var kc=$e(Ct(),1);var Yy={version:"4.4.4"},Ky={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},Qy={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},oo=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=r=>{let o=Zo(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r}=this.plugin.getPluginState();return r.filter(o=>o.type!=="root")},this.setSearchString=r=>{this.plugin.setPluginState({searchString:r}),r===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=r=>{let a=r.filter(n=>n.type==="file"&&n.status==="checked").map(n=>n.data);return this.plugin.uppy.validateAggregateRestrictions(a)},this.plugin=e,this.provider=t.provider,this.opts=x(x({},Qy),t),this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(Ky)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:J(x({},r),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}search(){return j(this,null,function*(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=yield this.provider.search(e),r=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(o=>({type:"file",id:o.requestPath,status:"unchecked",parentId:null,data:o}))];this.plugin.setPluginState({partialTree:r,isInputMode:!1})}catch(t){Ei(this.plugin.uppy)(t)}this.setLoading(!1)}})}handleScroll(e){return j(this,null,function*(){let{partialTree:t,searchString:r}=this.plugin.getPluginState(),o=t.find(a=>a.type==="root");if(yn(e)&&!this.isHandlingScroll&&o.nextPagePath){this.isHandlingScroll=!0;try{let a=yield this.provider.search(r,o.nextPagePath),n=J(x({},o),{nextPagePath:a.nextPageQuery}),s=t.filter(d=>d.type!=="root"),l=[n,...s,...a.items.map(d=>({type:"file",id:d.requestPath,status:"unchecked",parentId:null,data:d}))];this.plugin.setPluginState({partialTree:l})}catch(a){Ei(this.plugin.uppy)(a)}this.isHandlingScroll=!1}})}donePicking(){return j(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState(),t=wn(e);vn(t,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),o=bn(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),a=yr.afterToggleCheckbox(r,o);this.plugin.setPluginState({partialTree:a}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:r,searchString:o,loading:a,partialTree:n}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy,l=x(x({},this.opts),t);return r?p(ro,{searchString:o,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("enterTextToSearch"),buttonLabel:s("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):p("div",{className:(0,kc.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&p(ro,{searchString:o,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("search"),clearSearchLabel:s("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(cn,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>j(this,null,function*(){}),noResultsLabel:s("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:a,i18n:s,virtualList:!1,utmSource:this.opts.utmSource}),p(ta,{partialTree:n,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};oo.VERSION=Yy.version;var Zy="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var _n=(i=21)=>{let e="",t=i|0;for(;t--;)e+=Zy[Math.random()*64|0];return e};var Ic=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Jy(i,e){return!!(i===e||Ic(i)&&Ic(e))}function eb(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!Jy(i[t],e[t]))return!1;return!0}function nl(i,e){e===void 0&&(e=eb);var t=null;function r(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];if(t&&t.lastThis===this&&e(o,t.lastArgs))return t.lastResult;var n=i.apply(this,o);return t={lastResult:n,lastArgs:o,lastThis:this},n}return r.clear=function(){t=null},r}var xn=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function oa(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function Tc(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function tb(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function ib(i){return i.contains(document.activeElement)}function sl(i,e,t){let r=oa(t,e),o=vi(r.querySelectorAll(xn)),a=o.indexOf(document.activeElement);ib(r)?i.shiftKey&&a===0?tb(i,o):!i.shiftKey&&a===o.length-1&&Tc(i,o):Tc(i,o)}function Dc(i,e,t){e===null||sl(i,e,t)}var Bc=$e(Kn(),1);function ll(){let i=!1;return(0,Bc.default)((t,r)=>{let o=oa(t,r),a=o.contains(document.activeElement);if(a&&i)return;let n=o.querySelector("[data-uppy-super-focusable]");if(!(a&&!n))if(n)n.focus({preventScroll:!0}),i=!0;else{let s=o.querySelector(xn);s?.focus({preventScroll:!0}),i=!1}},260)}var Yc=$e(Ct(),1);var Mc=$e(Ct(),1);function Ec(i,e){if(i===e)return!0;if(!i||!e)return!1;let t=Object.keys(i),r=Object.keys(e),o=t.length;if(r.length!==o)return!1;for(let a=0;a<o;a++){let n=t[a];if(i[n]!==e[n]||!Object.prototype.hasOwnProperty.call(e,n))return!1}return!0}function ob(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},p("g",{fill:"#686DE0",fillRule:"evenodd"},p("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),p("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),p("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function ab(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function nb(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function sb(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function lb(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function pb(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("g",{fill:"#A7AFB7",fillRule:"nonzero"},p("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),p("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function ub(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function vr(i){let e={color:"#838999",icon:pb()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:ub()}:t==="image"?{color:"#686de0",icon:ob()}:t==="audio"?{color:"#068dbb",icon:ab()}:t==="video"?{color:"#19af67",icon:nb()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:sb()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:lb()}:e}function aa(i){let{file:e}=i;if(e.preview)return p("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:r}=vr(e.type);return p("div",{className:"uppy-Dashboard-Item-previewIconWrap"},p("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},r),p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},p("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var db=(i,e)=>(typeof e=="function"?e():e).filter(o=>o.id===i)[0].name;function na(i){let{file:e,toggleFileCard:t,i18n:r,metaFields:o}=i,{missingRequiredMetaFields:a}=e;if(!(a!=null&&a.length))return null;let n=a.map(s=>db(s,o)).join(", ");return p("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:a.length,fields:n})," ",p("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},r("editFile")))}function pl(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:o,showLinkToFileUploadResult:a}=i,s=e.preview?"rgba(255, 255, 255, 0.5)":vr(e.type).color;return p("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:s}},a&&e.uploadURL&&p("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},p("span",{hidden:!0},e.meta.name)),p(aa,{file:e}),p(na,{file:e,i18n:t,toggleFileCard:r,metaFields:o}))}function cb(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function Ac(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function ul(i){return p("div",{className:"uppy-Dashboard-Item-progress"},p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":Ac(i),title:Ac(i),onClick:()=>cb(i)},i.children))}function Cn(i){let{children:e}=i;return p("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function dl(i){let{progress:e}=i,t=2*Math.PI*15;return p("g",null,p("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),p("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e}))}function cl(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?p("div",{className:"uppy-Dashboard-Item-progress"},p("div",{className:"uppy-Dashboard-Item-progressIndicator"},p(Cn,null,p("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),p("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):i.recoveredState?null:i.error&&!i.hideRetryButton?p(ul,i,p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},p("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),p("path",{d:"M7.9 3H10v2H7.9z"}),p("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),p("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?p(ul,i,p(Cn,null,p(dl,{progress:i.file.progress.percentage}),i.file.isPaused?p("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):p("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},p("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),p("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?p(ul,i,p(Cn,null,p(dl,{progress:i.file.progress.percentage}),p("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):p("div",{className:"uppy-Dashboard-Item-progress"},p("div",{className:"uppy-Dashboard-Item-progressIndicator"},p(Cn,null,p(dl,{progress:i.file.progress.percentage}))))}var Oc=$e(bo(),1);var hl="...";function Sn(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=hl.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-hl.length,r=Math.ceil(t/2),o=Math.floor(t/2);return i.slice(0,r)+hl+i.slice(-o)}var hb=i=>{let{author:e,name:t}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return p("div",{className:"uppy-Dashboard-Item-name",title:t},Sn(t,r()))},fb=i=>{var e;let{author:t}=i.file.meta,r=(e=i.file.remote)==null?void 0:e.providerName,o="\xB7";return t?p("div",{className:"uppy-Dashboard-Item-author"},p("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Sn(t.name,13)),r?p(Fragment,null,` ${o} `,r,` ${o} `):null):null},mb=i=>i.file.size&&p("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Oc.default)(i.file.size)),gb=i=>i.file.isGhost&&p("span",null," \u2022 ",p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),yb=i=>{let{file:e,onClick:t}=i;return e.error?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function fl(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:o,toggleAddFilesPanel:a,isSingleFile:n,containerHeight:s,containerWidth:l}=i;return p("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},p("div",{className:"uppy-Dashboard-Item-fileName"},hb({file:e,isSingleFile:n,containerHeight:s,containerWidth:l}),p(yb,{file:e,onClick:()=>alert(e.error)})),p("div",{className:"uppy-Dashboard-Item-status"},fb({file:e}),mb({file:e}),gb({file:e,toggleAddFilesPanel:a,i18n:t})),p(na,{file:e,i18n:t,toggleFileCard:r,metaFields:o}))}function ml(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=i,document.body.appendChild(r),r.select();let o=()=>{document.body.removeChild(r),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(r),t()):o()}catch{return document.body.removeChild(r),o()}})}function bb(i){let{file:e,uploadInProgressOrComplete:t,metaFields:r,canEditFile:o,i18n:a,onClick:n}=i;return!t&&r&&r.length>0||!t&&o(e)?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":a("editFileWithFilename",{file:e.meta.name}),title:a("editFileWithFilename",{file:e.meta.name}),onClick:()=>n()},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},p("g",{fillRule:"evenodd"},p("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),p("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),p("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function vb(i){let{i18n:e,onClick:t,file:r}=i;return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:r.meta.name}),title:e("removeFile",{file:r.meta.name}),onClick:()=>t()},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},p("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),p("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function wb(i){let{file:e,uppy:t,i18n:r}=i,o=a=>{ml(e.uploadURL,r("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(r("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>a.target.focus({preventScroll:!0}))};return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":r("copyLink"),title:r("copyLink"),onClick:a=>o(a)},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},p("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function gl(i){let{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:o,metaFields:a,showLinkToFileUploadResult:n,showRemoveButton:s,i18n:l,toggleFileCard:d,openFileEditor:m}=i;return p("div",{className:"uppy-Dashboard-Item-actionWrapper"},p(bb,{i18n:l,file:t,uploadInProgressOrComplete:r,canEditFile:o,metaFields:a,onClick:()=>{a&&a.length>0?d(!0,t.id):m(t)}}),n&&t.uploadURL?p(wb,{file:t,uppy:e,i18n:l}):null,s?p(vb,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var Pn=class extends Ge{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Ec(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,r=!!e.progress.uploadComplete&&!t&&!e.error,o=!!e.progress.uploadStarted||!!t,a=e.progress.uploadStarted&&!e.progress.uploadComplete||t,n=e.error||!1,{isGhost:s}=e,l=(this.props.individualCancellation||!a)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);let d=(0,Mc.default)({"uppy-Dashboard-Item":!0,"is-inprogress":a&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!n,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return p("div",{className:d,id:`uppy_${e.id}`,role:this.props.role},p("div",{className:"uppy-Dashboard-Item-preview"},p(pl,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),p(cl,{uppy:this.props.uppy,file:e,error:n,isUploaded:r,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),p("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},p(fl,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),p(gl,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:o,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function _b(i,e){let t=[],r=[];return i.forEach(o=>{r.length<e?r.push(o):(t.push(r),r=[o])}),r.length&&t.push(r),t}function yl(i){let{id:e,i18n:t,uppy:r,files:o,resumableUploads:a,hideRetryButton:n,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:m,metaFields:f,isSingleFile:S,toggleFileCard:C,handleRequestThumbnail:B,handleCancelThumbnail:Y,recoveredState:te,individualCancellation:Z,itemsPerRow:re,openFileEditor:oe,canEditFile:ue,toggleAddFilesPanel:le,containerWidth:b,containerHeight:v}=i,P=re===1?71:200,M=Gi(()=>{let K=(Oe,je)=>Number(o[je].isGhost)-Number(o[Oe].isGhost),ge=Object.keys(o);return te&&ge.sort(K),_b(ge,re)},[o,re,te]),H=K=>p("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:K[0]},K.map(ge=>p(Pn,{key:ge,uppy:r,id:e,i18n:t,resumableUploads:a,individualCancellation:Z,hideRetryButton:n,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:m,metaFields:f,recoveredState:te,isSingleFile:S,containerWidth:b,containerHeight:v,toggleFileCard:C,handleRequestThumbnail:B,handleCancelThumbnail:Y,role:"listitem",openFileEditor:oe,canEditFile:ue,toggleAddFilesPanel:le,file:o[ge]})));return S?p("div",{class:"uppy-Dashboard-files"},H(M[0])):p(dn,{class:"uppy-Dashboard-files",role:"list",data:M,renderRow:H,rowHeight:P})}var bl=class extends Ge{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var r;return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(r=this.props.allowedFileTypes)==null?void 0:r.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,r)=>{let a={photo:"image/*",video:"video/*"}[e];return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:a,ref:r})},this.renderMyDeviceAcquirer=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let r=this.props.acquirers.length;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":r===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),o=this.props.fileManagerSelectionType,a=o.charAt(0).toUpperCase()+o.slice(1);return p("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${a}`,{browseFiles:t,browseFolders:r,browse:t}):this.props.i18nArray(`dropPaste${a}`,{browseFiles:t,browseFolders:r,browse:t}))},this.renderAcquirer=e=>{var t;return p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},p("div",{className:"uppy-DashboardTab-inner"},e.icon()),p("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],r=t.splice(e.length-2,e.length);return p(gt,null,t.map(o=>this.renderAcquirer(o)),p("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map(o=>this.renderAcquirer(o))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:r,showNativeVideoCameraButton:o}=this.props,a=[],n="myDevice";t||a.push({key:n,elements:this.renderMyDeviceAcquirer()}),r&&a.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),o&&a.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),a.push(...e.map(m=>({key:m.id,elements:this.renderAcquirer(m)}))),a.length===1&&a[0].key===n&&(a=[]);let l=[...a],d=l.splice(a.length-2,a.length);return p(gt,null,this.renderDropPasteBrowseTagline(a.length),p("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(m=>{let{key:f,elements:S}=m;return p(gt,{key:f},S)}),p("span",{role:"presentation",style:{"white-space":"nowrap"}},d.map(m=>{let{key:f,elements:S}=m;return p(gt,{key:f},S)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=p("span",null,p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},p("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),p("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),r=e("poweredBy",{uppy:t});return p("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},r)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:r}=this.props;return p("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,o=>{this.fileInput=o}),this.renderHiddenInput(!0,o=>{this.folderInput=o}),e&&this.renderHiddenCameraInput("photo",r,o=>{this.mobilePhotoFileInput=o}),t&&this.renderHiddenCameraInput("video",r,o=>{this.mobileVideoFileInput=o}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),p("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&p("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},Fn=bl;var zc=$e(Ct(),1);var xb=i=>p("div",{className:(0,zc.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),p(Fn,i)),Rc=xb;var Uc=$e(Ct(),1);function Cb(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var wi=Cb;function Sb(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:o,state:a,uppy:n}=i,s=qi(null);return p("div",{className:(0,Uc.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:wi,onDragLeave:wi,onDrop:wi,onPaste:wi},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},o("importFrom",{name:e.name})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},o("cancel"))),p("div",{ref:s,className:"uppy-DashboardContent-panelBody"},n.getPlugin(e.id).render(a,s.current)))}var Nc=Sb;var Lc=$e(Ct(),1);function Pb(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return p("div",{className:(0,Lc.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),p("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),p("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(r=>i.uppy.getPlugin(r.id).render(i.state))))}var $c=Pb;var _i={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function Fb(i,e,t,r){if(r===void 0&&(r={}),i)return _i.STATE_ERROR;if(e)return _i.STATE_COMPLETE;if(t)return _i.STATE_PAUSED;let o=_i.STATE_WAITING,a=Object.keys(r);for(let n=0;n<a.length;n++){let{progress:s}=r[a[n]];if(s.uploadStarted&&!s.uploadComplete)return _i.STATE_UPLOADING;s.preprocess&&o!==_i.STATE_UPLOADING&&(o=_i.STATE_PREPROCESSING),s.postprocess&&o!==_i.STATE_UPLOADING&&o!==_i.STATE_PREPROCESSING&&(o=_i.STATE_POSTPROCESSING)}return o}function kb(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:o,isAllPaused:a,inProgressNotPausedFiles:n,newFiles:s,processingFiles:l}=i;switch(Fb(o,r,a,e)){case"uploading":return t("uploadingXFiles",{smart_count:n.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:s.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function Ib(i){let{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:o,toggleAddFilesPanel:a,uppy:n}=i,{allowNewUpload:s}=i;return s&&o&&(s=i.totalFileCount<i.maxNumberOfFiles),p("div",{className:"uppy-DashboardContent-bar"},!t&&!r?p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>n.cancelAll()},e("cancel")):p("div",null),p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},p(kb,i)),s?p("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>a(!0)},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},p("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),p("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):p("div",null))}var jc=Ib;var Hc=$e(Ct(),1);function vl(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:r,form:o,formState:a}=i,n={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(s=>{let l=`uppy-Dashboard-FileCard-input-${s.id}`,d=t.includes(s.id);return p("fieldset",{key:s.id,className:"uppy-Dashboard-FileCard-fieldset"},p("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},s.name),s.render!==void 0?s.render({value:a[s.id],onChange:m=>r(m,s.id),fieldCSSClasses:n,required:d,form:o.id},p):p("input",{className:n.text,id:l,form:o.id,type:s.type||"text",required:d,value:a[s.id],placeholder:s.placeholder,onInput:m=>r(m.target.value,s.id),"data-uppy-super-focusable":!0}))})}function wl(i){var e;let{files:t,fileCardFor:r,toggleFileCard:o,saveFileCard:a,metaFields:n,requiredMetaFields:s,openFileEditor:l,i18n:d,i18nArray:m,className:f,canEditFile:S}=i,C=()=>typeof n=="function"?n(t[r]):n,B=t[r],Y=(e=C())!=null?e:[],te=S(B),Z={};Y.forEach(P=>{var M;Z[P.id]=(M=B.meta[P.id])!=null?M:""});let[re,oe]=Qt(Z),ue=Xi(P=>{P.preventDefault(),a(re,r)},[a,re,r]),le=(P,M)=>{oe(J(x({},re),{[M]:P}))},b=()=>{o(!1)},[v]=Qt(()=>{let P=document.createElement("form");return P.setAttribute("tabindex","-1"),P.id=_n(),P});return oi(()=>(document.body.appendChild(v),v.addEventListener("submit",ue),()=>{v.removeEventListener("submit",ue),document.body.removeChild(v)}),[v,ue]),p("div",{className:(0,Hc.default)("uppy-Dashboard-FileCard",f),"data-uppy-panelType":"FileCard",onDragOver:wi,onDragLeave:wi,onDrop:wi,onPaste:wi},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},m("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},B.meta?B.meta.name:B.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",form:v.id,title:d("finishEditingFile"),onClick:b},d("cancel"))),p("div",{className:"uppy-Dashboard-FileCard-inner"},p("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:vr(B.type).color}},p(aa,{file:B}),te&&p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:P=>{ue(P),l(B)}},d("editImage"))),p("div",{className:"uppy-Dashboard-FileCard-info"},p(vl,{computedMetaFields:Y,requiredMetaFields:s,updateMeta:le,form:v,formState:re})),p("div",{className:"uppy-Dashboard-FileCard-actions"},p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:v.id},d("saveChanges")),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:b,form:v.id},d("cancel")))))}var Wc=$e(Ct(),1),ao="uppy-transition-slideDownUp",Vc=250;function Tb(i){let{children:e}=i,[t,r]=Qt(null),[o,a]=Qt(""),n=qi(),s=qi(),l=qi(),d=()=>{a(`${ao}-enter`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{a(`${ao}-enter ${ao}-enter-active`),n.current=setTimeout(()=>{a("")},Vc)})},m=()=>{a(`${ao}-leave`),cancelAnimationFrame(l.current),clearTimeout(n.current),n.current=void 0,l.current=requestAnimationFrame(()=>{a(`${ao}-leave ${ao}-leave-active`),s.current=setTimeout(()=>{r(null),a("")},Vc)})};return oi(()=>{let f=At(e)[0];t!==f&&(f&&!t?d():t&&!f&&!s.current&&m(),r(f))},[e,t]),oi(()=>()=>{clearTimeout(n.current),clearTimeout(s.current),cancelAnimationFrame(l.current)},[]),t?Ao(t,{className:(0,Wc.default)(o,t.props.className)}):null}var sa=Tb;function no(){return no=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},no.apply(null,arguments)}var qc=900,Gc=700,_l=576,Xc=330;function xl(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>_l,o=i.containerHeight>Xc,a=(0,Yc.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>_l,"uppy-size--lg":i.containerWidth>Gc,"uppy-size--xl":i.containerWidth>qc,"uppy-size--height-md":i.containerHeight>Xc,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&o}),n=1;i.containerWidth>qc?n=5:i.containerWidth>Gc?n=4:i.containerWidth>_l&&(n=3);let s=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,d=i.files?Object.keys(i.files).filter(S=>i.files[S].isGhost).length:0,m=()=>d>0?i.i18n("recoveredXFiles",{smart_count:d}):i.i18n("recoveredAllFiles");return p("div",{className:a,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Lo(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},p("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),p("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:p("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},p("span",{"aria-hidden":"true"},"\xD7")),p("div",{className:"uppy-Dashboard-innerWrap"},p("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),s&&p(jc,i),l&&p("div",{className:"uppy-Dashboard-serviceMsg"},p("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},p("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},p("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),p("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),p("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),p("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),p("div",{className:"uppy-Dashboard-serviceMsg-text"},m())),s?p(yl,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:n,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):p(Fn,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),p(sa,null,i.showAddFilesPanel?p(Rc,no({key:"AddFiles"},i,{isSizeMD:r})):null),p(sa,null,i.fileCardFor?p(wl,no({key:"FileCard"},i)):null),p(sa,null,i.activePickerPanel?p(Nc,no({key:"Picker"},i)):null),p(sa,null,i.showFileEditor?p($c,no({key:"Editor"},i)):null),p("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(S=>i.uppy.getPlugin(S.id).render(i.state))))))}var Kc={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function Ie(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Db=0;function yt(i){return"__private_"+Db+++"_"+i}var Bb={version:"4.3.4"},Cl=nl.default||nl,Qc=9,Eb=27;function Zc(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var Ab={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:ra,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550},wr=yt("disabledNodes"),Ai=yt("generateLargeThumbnailIfSingleFile"),la=yt("openFileEditorWhenFilesAdded"),_r=yt("attachRenderFunctionToTarget"),Sl=yt("isTargetSupported"),Pl=yt("getAcquirers"),Fl=yt("getProgressIndicators"),Oi=yt("getEditors"),kl=yt("addSpecifiedPluginsFromOptions"),Il=yt("autoDiscoverPlugins"),xr=yt("addSupportedPluginIfNoTarget"),pa=yt("getStatusBarOpts"),ua=yt("getThumbnailGeneratorOpts"),Tl=yt("getInformerOpts"),da=yt("getStatusBarId"),ca=yt("getThumbnailGeneratorId"),Dl=yt("getInformerId"),Cr=class extends xt{constructor(e,t){var r,o,a;let n=(r=t?.autoOpen)!=null?r:null;super(e,J(x(x({},Ab),t),{autoOpen:n})),Object.defineProperty(this,Dl,{value:Nb}),Object.defineProperty(this,ca,{value:Ub}),Object.defineProperty(this,da,{value:Rb}),Object.defineProperty(this,Tl,{value:zb}),Object.defineProperty(this,ua,{value:Mb}),Object.defineProperty(this,pa,{value:Ob}),Object.defineProperty(this,wr,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${_n()}`,this.superFocus=ll(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=s=>{let d=this.getPluginState().targets.filter(m=>m.id!==s.id);this.setPluginState({targets:d})},this.addTarget=s=>{let l=s.id||s.constructor.name,d=s.title||l,m=s.type;if(m!=="acquirer"&&m!=="progressindicator"&&m!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let f={id:l,name:d,type:m},C=this.getPluginState().targets.slice();return C.push(f),this.setPluginState({targets:C}),this.el},this.hideAllPanels=()=>{var s;let l=this.getPluginState(),d={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===d.activePickerPanel&&l.showAddFilesPanel===d.showAddFilesPanel&&l.showFileEditor===d.showFileEditor&&l.activeOverlayType===d.activeOverlayType||(this.setPluginState(d),this.uppy.emit("dashboard:close-panel",(s=l.activePickerPanel)==null?void 0:s.id))},this.showPanel=s=>{let{targets:l}=this.getPluginState(),d=l.find(m=>m.type==="acquirer"&&m.id===s);this.setPluginState({activePickerPanel:d,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",s)},this.canEditFile=s=>{let{targets:l}=this.getPluginState();return Ie(this,Oi)[Oi](l).some(m=>this.uppy.getPlugin(m.id).canEditFile(s))},this.openFileEditor=s=>{let{targets:l}=this.getPluginState(),d=Ie(this,Oi)[Oi](l);this.setPluginState({showFileEditor:!0,fileCardFor:s.id||null,activeOverlayType:"FileEditor"}),d.forEach(m=>{this.uppy.getPlugin(m.id).selectFile(s)})},this.closeFileEditor=()=>{let{metaFields:s}=this.getPluginState();s&&s.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:s}=this.getPluginState();Ie(this,Oi)[Oi](s).forEach(d=>{this.uppy.getPlugin(d.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:s,resolve:l}=Zc();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let d=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",d,!1),l()};this.el.addEventListener("animationend",d,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),s},this.closeModal=s=>{var l;let d=(l=s?.manualClose)!=null?l:!0,{isHidden:m,isClosing:f}=this.getPluginState();if(m||f)return;let{promise:S,resolve:C}=Zc();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let Y=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",Y,!1),C()};this.el.addEventListener("animationend",Y,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),C();if(document.removeEventListener("keydown",this.handleKeyDownInModal),d&&this.opts.browserBackButtonClose){var B;(B=history.state)!=null&&B[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),S},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=s=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:J(x({},l),{darkMode:s})})},this.handleSystemDarkModeChange=s=>{let l=s.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(s,l)=>{let d=this.uppy.getFile(l);s?this.uppy.emit("dashboard:file-edit-start",d):this.uppy.emit("dashboard:file-edit-complete",d),this.setPluginState({fileCardFor:s?l:null,activeOverlayType:s?"FileCard":null})},this.toggleAddFilesPanel=s=>{this.setPluginState({showAddFilesPanel:s,activeOverlayType:s?"AddFiles":null})},this.addFiles=s=>{let l=s.map(d=>({source:this.id,name:d.name,type:d.type,data:d,meta:{relativePath:d.relativePath||d.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(d){this.uppy.log(d)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(s=>{let l=s[0],{width:d,height:m}=l.contentRect;this.setPluginState({containerWidth:d,containerHeight:m,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let s=this.getPluginState(),l=!this.opts.inline&&s.isHidden;!s.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=s=>{this.el.contains(s.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=s=>{var l;let d=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],m=(l=Ie(this,wr)[wr])!=null?l:vi(this.el.querySelectorAll(d)).filter(f=>!f.classList.contains("uppy-Dashboard-close"));for(let f of m)f.tagName==="A"?f.setAttribute("aria-disabled",s):f.disabled=s;s?Ie(this,wr)[wr]=m:Ie(this,wr)[wr]=null,this.dashboardIsDisabled=s},this.updateBrowserHistory=()=>{var s;(s=history.state)!=null&&s[this.modalName]||history.pushState(J(x({},history.state),{[this.modalName]:!0}),""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=s=>{var l;this.isModalOpen()&&(!s.state||!s.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=s.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=s=>{s.keyCode===Eb&&this.requestCloseModal(),s.keyCode===Qc&&sl(s,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=s=>{this.uppy.iteratePlugins(d=>{d.type==="acquirer"&&(d.handleRootPaste==null||d.handleRootPaste(s))});let l=vi(s.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=s=>{s.preventDefault();let l=vi(s.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=s=>{s.preventDefault(),s.stopPropagation();let l=()=>{let S=!0;return this.uppy.iteratePlugins(C=>{C.canHandleRootDrop!=null&&C.canHandleRootDrop(s)&&(S=!0)}),S},d=()=>{let{types:S}=s.dataTransfer;return S.some(C=>C==="Files")},m=l(),f=d();if(!m&&!f||this.opts.disabled||this.opts.disableLocalFiles&&(f||!m)||!this.uppy.getState().allowNewUpload){s.dataTransfer.dropEffect="none";return}s.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(s)},this.handleDragLeave=s=>{s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(s)},this.handleDrop=s=>j(this,null,function*(){s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(f=>{f.type==="acquirer"&&(f.handleRootDrop==null||f.handleRootDrop(s))});let l=!1,d=f=>{this.uppy.log(f,"error"),l||(this.uppy.info(f.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let m=yield $o(s.dataTransfer,{logDropError:d});m.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(m)),this.opts.onDrop(s)}),this.handleRequestThumbnail=s=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",s)},this.handleCancelThumbnail=s=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",s)},this.handleKeyDownInInline=s=>{s.keyCode===Qc&&Dc(s,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=s=>{this.el.contains(document.activeElement)&&this.handlePaste(s)},this.handleComplete=s=>{let{failed:l}=s;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Ai,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let s=600,l=this.uppy.getFiles();if(l.length===1){let d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d?.setOptions({thumbnailWidth:s});let m=J(x({},l[0]),{preview:void 0});d?.requestThumbnail(m).then(()=>{d?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,la,{writable:!0,value:s=>{let l=s[0],{metaFields:d}=this.getPluginState(),m=d&&d.length>0,f=this.canEditFile(l);m&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):f&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let s=Vs(this.opts.trigger);s?s.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",Ie(this,xr)[xr]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",Ie(this,Ai)[Ai]),this.uppy.on("file-removed",Ie(this,Ai)[Ai]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",Ie(this,la)[la])},this.removeEvents=()=>{let s=Vs(this.opts.trigger);!this.opts.inline&&s&&s.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",Ie(this,xr)[xr]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",Ie(this,Ai)[Ai]),this.uppy.off("file-removed",Ie(this,Ai)[Ai]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",Ie(this,la)[la])},this.superFocusOnEachUpdate=()=>{let s=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,d=this.uppy.getState().info.length===0,m=!this.opts.inline;d&&(m||s||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(s,l)=>{this.uppy.setFileMeta(l,s),this.toggleFileCard(!1,l)},Object.defineProperty(this,_r,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return J(x({},s),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,Sl,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,Pl,{writable:!0,value:Cl(s=>s.filter(l=>l.type==="acquirer"&&Ie(this,Sl)[Sl](l)).map(Ie(this,_r)[_r]))}),Object.defineProperty(this,Fl,{writable:!0,value:Cl(s=>s.filter(l=>l.type==="progressindicator").map(Ie(this,_r)[_r]))}),Object.defineProperty(this,Oi,{writable:!0,value:Cl(s=>s.filter(l=>l.type==="editor").map(Ie(this,_r)[_r]))}),this.render=s=>{let l=this.getPluginState(),{files:d,capabilities:m,allowNewUpload:f}=s,{newFiles:S,uploadStartedFiles:C,completeFiles:B,erroredFiles:Y,inProgressFiles:te,inProgressNotPausedFiles:Z,processingFiles:re,isUploadStarted:oe,isAllComplete:ue,isAllPaused:le}=this.uppy.getObjectOfFilesPerState(),b=Ie(this,Pl)[Pl](l.targets),v=Ie(this,Fl)[Fl](l.targets),P=Ie(this,Oi)[Oi](l.targets),M;return this.opts.theme==="auto"?M=m.darkMode?"dark":"light":M=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),xl({state:s,isHidden:l.isHidden,files:d,newFiles:S,uploadStartedFiles:C,completeFiles:B,erroredFiles:Y,inProgressFiles:te,inProgressNotPausedFiles:Z,processingFiles:re,isUploadStarted:oe,isAllComplete:ue,isAllPaused:le,totalFileCount:Object.keys(d).length,totalProgress:s.totalProgress,allowNewUpload:f,acquirers:b,theme:M,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:v,editors:P,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:s.recoveredState,metaFields:l.metaFields,resumableUploads:m.resumableUploads||!1,individualCancellation:m.individualCancellation,isMobileDevice:m.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,kl,{writable:!0,value:()=>{let{plugins:s}=this.opts;s.forEach(l=>{let d=this.uppy.getPlugin(l);d?d.mount(this,d):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,Il,{writable:!0,value:()=>{this.uppy.iteratePlugins(Ie(this,xr)[xr])}}),Object.defineProperty(this,xr,{writable:!0,value:s=>{var l;let d=["acquirer","editor"];s&&!((l=s.opts)!=null&&l.target)&&d.includes(s.type)&&(this.getPluginState().targets.some(f=>s.id===f.id)||s.mount(this,s))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:s,closeAfterFinish:l}=this.opts;if(s&&l)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:d,allowMultipleUploadBatches:m}=this.uppy.opts;(d||m)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:f}=this.opts;f&&this.mount(f,this),this.opts.disableStatusBar||this.uppy.use(cr,x({id:Ie(this,da)[da](),target:this},Ie(this,pa)[pa]())),this.opts.disableInformer||this.uppy.use(hr,x({id:Ie(this,Dl)[Dl](),target:this},Ie(this,Tl)[Tl]())),this.opts.disableThumbnailGenerator||this.uppy.use(to,x({id:Ie(this,ca)[ca]()},Ie(this,ua)[ua]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let S=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${S?"on":"off"}`),this.setDarkModeCapability(S),this.opts.theme==="auto"){var C;(C=this.darkModeMediaQuery)==null||C.addListener(this.handleSystemDarkModeChange)}Ie(this,kl)[kl](),Ie(this,Il)[Il](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let d=this.uppy.getPlugin(`${this.id}:Informer`);d&&this.uppy.removePlugin(d)}if(!this.opts.disableStatusBar){let d=this.uppy.getPlugin(`${this.id}:StatusBar`);d&&this.uppy.removePlugin(d)}if(!this.opts.disableThumbnailGenerator){let d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d&&this.uppy.removePlugin(d)}let{plugins:s}=this.opts;if(s.forEach(d=>{let m=this.uppy.getPlugin(d);m&&m.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=Kc,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(a=(o=this.opts).onRequestCloseModal)!=null||(o.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,r;super.setOptions(e),(t=this.uppy.getPlugin(Ie(this,da)[da]()))==null||t.setOptions(Ie(this,pa)[pa]()),(r=this.uppy.getPlugin(Ie(this,ca)[ca]()))==null||r.setOptions(Ie(this,ua)[ua]())}};function Ob(){let{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:o,hideProgressAfterFinish:a,locale:n,doneButtonHandler:s}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:o,hideAfterFinish:a,locale:n,doneButtonHandler:s}}function Mb(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r,lazy:!r}}function zb(){return{}}function Rb(){return`${this.id}:StatusBar`}function Ub(){return`${this.id}:ThumbnailGenerator`}function Nb(){return`${this.id}:Informer`}Cr.VERSION=Bb.version;var Bl=class{onMount(e,t){this.options=x(x({},e),this.props),this.uppy.use(t,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(e,t){e.uppy&&this.uppy!==e.uppy.previousValue&&e.uppy.previousValue!==void 0&&(this.uninstall(e.uppy.previousValue),this.uppy.use(t,this.options)),this.options=x(x({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),e.props&&this.props!==e.props.previousValue&&e.props.previousValue!==void 0&&this.plugin.setOptions(x({},this.options))}uninstall(e=this.uppy){e.removePlugin(this.plugin)}};var Jc=(()=>{class i extends Bl{constructor(){super(),this.el=Dt(rp),this.uppy=new Wr,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},Cr)}ngOnChanges(t){this.handleChanges(t,Cr)}ngOnDestroy(){this.uninstall()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=Yt({type:i,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[fi,ep],decls:0,vars:0,template:function(r,o){},encapsulation:2,changeDetection:0})}}return i})();function he(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Lb=0;function Ot(i){return"__private_"+Lb+++"_"+i}function $b(i){return new Error("Cancelled",{cause:i})}function eh(i){if(i!=null){var e;let t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});let r=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,r,r)}return this}var Vt=Ot("activeRequests"),kt=Ot("queuedHandlers"),Ht=Ot("paused"),Sr=Ot("pauseTimer"),Ft=Ot("downLimit"),Pr=Ot("upperLimit"),Mi=Ot("rateLimitingTimer"),ha=Ot("call"),zi=Ot("queueNext"),Ol=Ot("next"),El=Ot("queue"),Ml=Ot("dequeue"),Al=Ot("resume"),Fr=Ot("increaseLimit"),kn=class{constructor(e){Object.defineProperty(this,Ml,{value:qb}),Object.defineProperty(this,El,{value:Wb}),Object.defineProperty(this,Ol,{value:Vb}),Object.defineProperty(this,zi,{value:Hb}),Object.defineProperty(this,ha,{value:jb}),Object.defineProperty(this,Vt,{writable:!0,value:0}),Object.defineProperty(this,kt,{writable:!0,value:[]}),Object.defineProperty(this,Ht,{writable:!0,value:!1}),Object.defineProperty(this,Sr,{writable:!0,value:void 0}),Object.defineProperty(this,Ft,{writable:!0,value:1}),Object.defineProperty(this,Pr,{writable:!0,value:void 0}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Al,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,Fr,{writable:!0,value:()=>{if(he(this,Ht)[Ht]){he(this,Mi)[Mi]=setTimeout(he(this,Fr)[Fr],0);return}he(this,Ft)[Ft]=this.limit,this.limit=Math.ceil((he(this,Pr)[Pr]+he(this,Ft)[Ft])/2);for(let t=he(this,Ft)[Ft];t<=this.limit;t++)he(this,zi)[zi]();he(this,Pr)[Pr]-he(this,Ft)[Ft]>3?he(this,Mi)[Mi]=setTimeout(he(this,Fr)[Fr],2e3):he(this,Ft)[Ft]=Math.floor(he(this,Ft)[Ft]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!he(this,Ht)[Ht]&&he(this,Vt)[Vt]<this.limit?he(this,ha)[ha](e):he(this,El)[El](e,t)}wrapSyncFunction(e,t){var r=this;return function(){for(var o=arguments.length,a=new Array(o),n=0;n<o;n++)a[n]=arguments[n];let s=r.run(()=>(e(...a),queueMicrotask(()=>s.done()),()=>{}),t);return{abortOn:eh,abort(){s.abort()}}}}wrapPromiseFunction(e,t){var r=this;return function(){for(var o=arguments.length,a=new Array(o),n=0;n<o;n++)a[n]=arguments[n];let s,l=new Promise((d,m)=>{s=r.run(()=>{let f,S;try{S=Promise.resolve(e(...a))}catch(C){S=Promise.reject(C)}return S.then(C=>{f?m(f):(s.done(),d(C))},C=>{f?m(f):(s.done(),m(C))}),C=>{f=$b(C)}},t)});return l.abort=d=>{s.abort(d)},l.abortOn=eh,l}}resume(){he(this,Ht)[Ht]=!1,clearTimeout(he(this,Sr)[Sr]);for(let e=0;e<this.limit;e++)he(this,zi)[zi]()}pause(e){e===void 0&&(e=null),he(this,Ht)[Ht]=!0,clearTimeout(he(this,Sr)[Sr]),e!=null&&(he(this,Sr)[Sr]=setTimeout(he(this,Al)[Al],e))}rateLimit(e){clearTimeout(he(this,Mi)[Mi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(he(this,Pr)[Pr]=this.limit-1,this.limit=he(this,Ft)[Ft],he(this,Mi)[Mi]=setTimeout(he(this,Fr)[Fr],e))}get isPaused(){return he(this,Ht)[Ht]}};function jb(i){he(this,Vt)[Vt]+=1;let e=!1,t;try{t=i()}catch(r){throw he(this,Vt)[Vt]-=1,r}return{abort:r=>{e||(e=!0,he(this,Vt)[Vt]-=1,t?.(r),he(this,zi)[zi]())},done:()=>{e||(e=!0,he(this,Vt)[Vt]-=1,he(this,zi)[zi]())}}}function Hb(){queueMicrotask(()=>he(this,Ol)[Ol]())}function Vb(){if(he(this,Ht)[Ht]||he(this,Vt)[Vt]>=this.limit||he(this,kt)[kt].length===0)return;let i=he(this,kt)[kt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=he(this,ha)[ha](i.fn);i.abort=e.abort,i.done=e.done}function Wb(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{he(this,Ml)[Ml](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=he(this,kt)[kt].findIndex(o=>t.priority>o.priority);return r===-1?he(this,kt)[kt].push(t):he(this,kt)[kt].splice(r,0,t),t}function qb(i){let e=he(this,kt)[kt].indexOf(i);e!==-1&&he(this,kt)[kt].splice(e,1)}var bS=Symbol("__queue");var Ul=$e(bo(),1),oh=$e(th(),1);var ih={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function rh(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Gb=0;function Xb(i){return"__private_"+Gb+++"_"+i}var Yb={quality:.6,limit:10},fa=Xb("RateLimitedQueue"),In=class extends dr{constructor(e,t){super(e,x(x({},Yb),t)),Object.defineProperty(this,fa,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=ih,rh(this,fa)[fa]=new kn(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(e){return new Promise((t,r)=>{new oh.default(e,J(x({},this.opts),{success:t,error:r}))})}prepareUpload(e){return j(this,null,function*(){let t=0,r=[],o=rh(this,fa)[fa].wrapPromiseFunction(n=>j(this,null,function*(){try{let s=yield this.compress(n.data),l=n.data.size-s.size;this.uppy.log(`[Image Compressor] Image ${n.id} compressed by ${(0,Ul.default)(l)}`),t+=l;let{name:d,type:m,size:f}=s,S=yi(d),B=`${yi(n.meta.name).name}.${S.extension}`;this.uppy.setFileState(n.id,J(x(x(x(x({},d&&{name:d}),S.extension&&{extension:S.extension}),m&&{type:m}),f&&{size:f}),{data:s,meta:J(x({},n.meta),{type:m,name:B})})),r.push(n)}catch(s){this.uppy.log(`[Image Compressor] Failed to compress ${n.id}:`,"warning"),this.uppy.log(s,"warning")}})),a=e.map(n=>{var s;let l=this.uppy.getFile(n);return this.uppy.emit("preprocess-progress",l,{mode:"indeterminate",message:this.i18n("compressingImages")}),l.isRemote||(l.data.type||(l.data=l.data.slice(0,l.data.size,l.type)),!((s=l.type)!=null&&s.startsWith("image/")))?Promise.resolve():o(l)});yield Promise.all(a),this.uppy.emit("compressor:complete",r),t>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,Ul.default)(t)}),"info");for(let n of e){let s=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",s)}})}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};var uh=$e(ah(),1);function Kb(i,e){let t=i.width/e.width,r=i.height/e.height,o=Math.min(t,r),a=e.width*o,n=e.height*o,s=(i.width-a)/2,l=(i.height-n)/2;return{width:a,height:n,left:s,top:l}}var nh=Kb;function Qb(i){return i*(Math.PI/180)}function Zb(i,e,t){let r=Math.abs(Qb(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}var sh=Zb;function Jb(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}var lh=Jb;function e1(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}var ph=e1;var Tn=class extends Ge{constructor(e){super(e),this.onRotate90Deg=()=>{let{angle90Deg:t}=this.state,r=t-90;this.setState({angle90Deg:r,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(r);let o=this.cropper.getCanvasData(),a=this.cropper.getContainerData(),n=nh(a,o);this.cropper.setCanvasData(n),this.cropper.setCropBoxData(n)},this.onRotateGranular=t=>{let r=Number(t.target.value);this.setState({angleGranular:r});let{angle90Deg:o}=this.state,a=o+r;this.cropper.rotateTo(a);let n=this.cropper.getImageData(),s=sh(n.naturalWidth,n.naturalHeight,r),l=this.cropper.getImageData().scaleX<0?-s:s;this.cropper.scale(l,s)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){let{opts:e,storeCropperInstance:t}=this.props;this.cropper=new uh.default(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){let t=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:o}=this.state;if(e.detail.action==="all"){let a=lh(t,r,o);a&&this.cropper.setCropBoxData(a)}else{let a=ph(t,r,o);a&&this.cropper.setCropBoxData(a)}}renderGranularRotate(){let{i18n:e}=this.props,{angleGranular:t}=this.state;return p("label",{role:"tooltip","aria-label":`${t}\xBA`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},p("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){let{i18n:e,opts:t}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),p("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M0 0h24v24H0z",fill:"none"}),p("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))}renderCropWidescreen(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),p("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){let{i18n:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},p("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},p("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),p("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){let{currentImage:e,opts:t}=this.props,{actions:r}=t,o=URL.createObjectURL(e.data);return p("div",{className:"uppy-ImageCropper"},p("div",{className:"uppy-ImageCropper-container"},p("img",{className:"uppy-ImageCropper-image",alt:e.name,src:o,ref:a=>{this.imgElement=a}})),p("div",{className:"uppy-ImageCropper-controls"},r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}};var dh={strings:{revert:"Reset",rotate:"Rotate 90\xB0",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};var t1={version:"3.3.3"},ch={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},hh={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},i1={quality:.8,actions:hh,cropperOptions:ch},kr=class extends xt{constructor(e,t){super(e,J(x(x({},i1),t),{actions:x(x({},hh),t?.actions),cropperOptions:x(x({},ch),t?.cropperOptions)})),this.save=()=>{let r=n=>{var s;let{currentImage:l}=this.getPluginState();this.uppy.setFileState(l.id,{data:new File([n],(s=l.name)!=null?s:this.i18n("unnamed"),{type:n.type}),size:n.size,preview:void 0});let d=this.uppy.getFile(l.id);this.uppy.emit("thumbnail:request",d),this.setPluginState({currentImage:d}),this.uppy.emit("file-editor:complete",d)},{currentImage:o}=this.getPluginState(),a=this.cropper.getCroppedCanvas({});a.width%2!==0&&this.cropper.setData({width:a.width-1}),a.height%2!==0&&this.cropper.setData({height:a.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(r,o.type,this.opts.quality)},this.storeCropperInstance=r=>{this.cropper=r},this.selectFile=r=>{this.uppy.emit("file-editor:start",r),this.setPluginState({currentImage:r})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=dh,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;let t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){let{currentImage:e}=this.getPluginState();if(e){let t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){let{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:p(Tn,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};kr.VERSION=t1.version;var fh=$e(Bp(),1);function r1(i,e){if(i&1&&(ve(0,"small",5),Bt(1),Ce()),i&2){let t=X();V(),rr(t.subtitle)}}function o1(i,e){if(i&1&&(ve(0,"a",6),Ae(1,"i",7),Bt(2," Download Template "),Ce()),i&2){let t=X();ap("top-58",t.subtitle),N("href",t.sampleUrl,Fa)}}function a1(i,e){if(i&1&&(Si(0),Bt(1),Pi()),i&2){let t=X(2);V(),co("- ",t.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function n1(i,e){if(i&1&&(ve(0,"div",4)(1,"h4",8),Bt(2,"CSV File Content Summary"),Ce(),Ae(3,"hr"),ve(4,"p",9),Bt(5),se(6,a1,2,1,"ng-container",10),Ce()()),i&2){let t=X();V(5),co("",t.rowSummary().rowCount," rows found "),V(),N("ngIf",t.rowSummary().rowEmpty>0)}}var cP=(()=>{class i{static{this.sizes=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]}static{this.kilobyte=1024}constructor(){this.folder="test",this.thumbnailSize="small",this.sampleUrl="",this.subtitle="",this.showSample=!0,this.clear=Pa(!1),this.showSubtitle=!0,this.uppyCoreConfiguration=Pa(),this.dashboardPropsConfiguration=Pa(),this.fileUploaded=new rt,this.fileUploadComplete=new rt,this.fileRemoved=new rt,this.onParser=new rt,this.multipleFilesUploaded=new rt,this.http=Dt(Ap),this.csvParser=Dt(Ep),this.rowSummary=Or({rowCount:0,rowEmpty:0}),this.file=Or(null),this.multipleFiles=Or([]),this.uppy=new Wr({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6},onBeforeFileAdded:(t,r)=>J(x({},t),{name:t.name?.replace(/ /g,"_")})}).use(In,{mimeType:"image/jpeg",convertSize:1/0,convertTypes:["image/png"]}).use(kr),this.dashboardProps={hideUploadButton:!0,height:350},Un(()=>this.uppy.setOptions(x({},this.uppyCoreConfiguration()))),Un(()=>this.dashboardProps=x(x({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(t,r)=>{let o=r[0]?.data;this.showSample=!1,this.showSubtitle=!1,this.emitFileUpload(o),this.file.set(r[0].data),fh.default.parse(o,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:a=>{let n=a.split(/\r?\n/).slice(1);return n[n.length-1]===""&&n.pop(),this.rowSummary.update(s=>J(x({},s),{rowCount:n.length})),n.forEach(s=>{s.split(",").every(d=>d==="")&&this.rowSummary.update(d=>J(x({},d),{rowEmpty:d.rowEmpty+1}))}),a},error(a,n){console.log("ERROR",a,n)},complete:(a,n)=>{this.onParser.emit(a.data)}})}),this.uppy.on("complete",t=>{let r=t.successful?.map(a=>({file:a.data,id:a.id}))??[],o=t.successful[0]?.data;this.showSample=!1,this.showSubtitle=!1,this.emitFileUploadComplete(o),this.emitMultipleFilesUploaded(r),this.onResetUppy(),this.file.set(o),this.multipleFiles.set(r)}),this.uppy.on("file-removed",t=>{this.showSample=!0,this.showSubtitle=!0,this.file.set(null);let o=this.multipleFiles().filter(a=>a.id!=t.id);this.multipleFiles.set(o),this.fileRemoved.emit(t.id),this.rowSummary.set({rowCount:0,rowEmpty:0})}),this.onFileEdited()}onFileEdited(){this.clear()==!1&&(this.uppy.on("file-editor:start",t=>{}),this.uppy.on("file-editor:complete",t=>{this.handlingEditedImage(t)}),this.uppy.on("file-editor:cancel",t=>{}))}handlingEditedImage(t){this.multipleFiles.update(r=>r.map(o=>o.id===t.id?J(x({},o),{file:t.data}):o)),this.file.set(this.multipleFiles()[0].file),this.emitFileUploadComplete(this.file()),this.emitMultipleFilesUploaded(this.multipleFiles())}onResetUppy(){this.clear()&&this.uppy.clear()}formatFileSize(t,r=2){if(t===0)return"0 bytes";let o=Math.floor(Math.log(t)/Math.log(i.kilobyte));return`${(t/Math.pow(i.kilobyte,o)).toFixed(r)} ${i.sizes[o]}`}ngOnDestroy(){this.file.set(null),this.multipleFiles.set([])}emitFileUpload(t){let r=new File([t],t.name.replace(/ /g,"_"),{type:t.type});this.fileUploaded.emit(r)}emitFileUploadComplete(t){let r=new File([t],t.name.replace(/ /g,"_"),{type:t.type});this.fileUploadComplete.emit(r)}emitMultipleFilesUploaded(t){let r=t.map(o=>({file:new File([o.file],o.file.name.replace(/ /g,"_"),{type:o.file.type}),id:o.id}));this.multipleFilesUploaded.emit(r)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=Yt({type:i,selectors:[["POS-uppy"]],inputs:{folder:"folder",thumbnailSize:"thumbnailSize",sampleUrl:"sampleUrl",subtitle:"subtitle",showSample:"showSample",clear:[1,"clear"],uppyCoreConfiguration:[1,"uppyCoreConfiguration"],dashboardPropsConfiguration:[1,"dashboardPropsConfiguration"]},outputs:{fileUploaded:"fileUploaded",fileUploadComplete:"fileUploadComplete",fileRemoved:"fileRemoved",onParser:"onParser",multipleFilesUploaded:"multipleFilesUploaded"},decls:5,vars:5,consts:[[1,"position-relative"],[3,"uppy","props"],["class","subtitle position-absolute",4,"ngIf"],["class","sample position-absolute","role","button",3,"top-58","href",4,"ngIf"],["role","alert",1,"alert","alert-warning","d-flex","flex-column","gap-2",2,"margin","1rem 0 0 0"],[1,"subtitle","position-absolute"],["role","button",1,"sample","position-absolute",3,"href"],[1,"fa-solid","fa-download","ms-3"],[1,"alert-heading"],[1,"fs-6","m-0"],[4,"ngIf"]],template:function(r,o){if(r&1&&(ve(0,"div",0),Ae(1,"uppy-dashboard",1),se(2,r1,2,1,"small",2)(3,o1,3,3,"a",3)(4,n1,7,2,"div",4),Ce()),r&2){let a;V(),N("uppy",o.uppy)("props",o.dashboardProps),V(),N("ngIf",o.subtitle&&o.showSubtitle),V(),N("ngIf",o.sampleUrl&&o.showSample),V(),dt(o.file()&&((a=o.file())==null?null:a.type)==="text/csv"?4:-1)}},dependencies:[Jc,Hi,ji],styles:[".uppy-Dashboard-AddFiles-info{display:none!important} .uppy-Dashboard-AddFiles-list{flex:none;flex-direction:row;flex-wrap:wrap;justify-content:center;max-width:600px;margin-top:15px;padding-top:0;overflow-y:visible}.sample[_ngcontent-%COMP%], .subtitle[_ngcontent-%COMP%]{top:56%;width:100%;text-align:center}.top-58[_ngcontent-%COMP%]{top:61%}"]})}}return i})();export{uv as a,Bp as b,cP as c};
|