dealposbooks 1.9.3 → 1.9.5
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/3rdpartylicenses.txt +422 -422
- package/assets/scss/components/_navbar.scss +2 -2
- package/assets/scss/layouts/_sidebar.scss +1 -2
- package/assets/scss/style.scss +40 -3
- package/assets/scss/variables/_variables.scss +0 -1
- package/{chunk-ZB6TB7JI.js → chunk-2JCKXI2B.js} +3 -3
- package/{chunk-OAD4GTH6.js → chunk-3DN7TZCI.js} +1 -1
- package/chunk-3HN62WAN.js +1 -0
- package/{chunk-4CUA33JH.js → chunk-4B5RFKWI.js} +1 -1
- package/chunk-4FGQ5T64.js +2 -0
- package/{chunk-7U2I35GP.js → chunk-4GL5YTWS.js} +1 -1
- package/chunk-4LFQJHJZ.js +1 -0
- package/{chunk-H4V6YZX2.js → chunk-4S33ZRKF.js} +1 -1
- package/chunk-4WYSO23S.js +1 -0
- package/{chunk-O2GA6PH7.js → chunk-5ROVFZR4.js} +1 -1
- package/chunk-5RUWTN5X.js +1 -0
- package/chunk-6JZPAN4G.js +1 -0
- package/chunk-6NDJPEK4.js +185 -0
- package/chunk-6OAGE44Z.js +7 -0
- package/chunk-7GHU4UQ7.js +430 -0
- package/chunk-7UBLUR5O.js +1 -0
- package/{chunk-V3B32QFK.js → chunk-7WXXPCRV.js} +1 -1
- package/chunk-7XDZM4MJ.js +1 -0
- package/chunk-AF77PUJO.js +1 -0
- package/chunk-ALX7UOMP.js +193 -0
- package/{chunk-JG5HGOEX.js → chunk-ANG5YF2J.js} +1 -1
- package/{chunk-WM3NKRKN.js → chunk-ANMMOPX7.js} +1 -1
- package/chunk-ARESU6CY.js +1 -0
- package/{chunk-LFDCJISD.js → chunk-ASK2IVMC.js} +1 -1
- package/chunk-AZM2EGTF.js +1 -0
- package/chunk-B7JILYJO.js +1 -0
- package/chunk-BYD3JK4R.js +2 -0
- package/chunk-CVMIZKGH.js +1 -0
- package/chunk-CVMP55UZ.js +188 -0
- package/chunk-CZMTQ4XK.js +1 -0
- package/chunk-DAV2SMOY.js +222 -0
- package/chunk-DC5OTEZ6.js +1 -0
- package/chunk-DCKLQNGL.js +1 -0
- package/chunk-F2FW6UDP.js +1 -0
- package/chunk-FBUI4SQJ.js +1 -0
- package/chunk-FFODCTQC.js +1 -0
- package/chunk-FIQFBEQK.js +1 -0
- package/chunk-FYQCFDW7.js +1 -0
- package/chunk-G2APSUOI.js +1 -0
- package/chunk-HAZ5H5ZV.js +1 -0
- package/{chunk-5AITWOQZ.js → chunk-HI7JDHS3.js} +1 -1
- package/chunk-HJPAXVNY.js +527 -0
- package/{chunk-33XUIS57.js → chunk-I3HFXOYS.js} +1 -1
- package/{chunk-PJKHUCJX.js → chunk-I7YFUZI7.js} +1 -1
- package/chunk-IIB2DZLA.js +1 -0
- package/chunk-IL7RZKFX.js +1 -0
- package/{chunk-OCIKQOWD.js → chunk-IPKPBYSN.js} +12 -12
- package/chunk-IPUUBC74.js +246 -0
- package/{chunk-TDDTBHQE.js → chunk-IZ2XPL4O.js} +1 -1
- package/{chunk-X4EHZEMZ.js → chunk-J2SK4PGN.js} +1 -1
- package/chunk-JGSRMMYX.js +1 -0
- package/chunk-JHCHHBCW.js +67 -0
- package/{chunk-ZPTNYW2S.js → chunk-JP3F2QND.js} +1 -1
- package/{chunk-ACQX2T2H.js → chunk-JQZRKOKE.js} +1 -1
- package/chunk-LYDUVWPM.js +397 -0
- package/chunk-MFMEPXFQ.js +1 -0
- package/{chunk-5QVQY32E.js → chunk-MP7S52YU.js} +1 -1
- package/chunk-NXCQN45H.js +1 -0
- package/{chunk-RANHETC3.js → chunk-O2G255P4.js} +2 -2
- package/{chunk-Q5BXN24W.js → chunk-ONPJXDDI.js} +2 -2
- package/chunk-OSFKXKXD.js +947 -0
- package/chunk-OVIHA23Z.js +201 -0
- package/chunk-P36L53XK.js +1 -0
- package/chunk-P5ZPLAYA.js +79 -0
- package/{chunk-SGXU6X3O.js → chunk-PGECEXRR.js} +1 -1
- package/chunk-PQTUFQME.js +129 -0
- package/{chunk-3ENMEUVK.js → chunk-PSDZXCOR.js} +1 -1
- package/chunk-Q7ITPAXT.js +1 -0
- package/chunk-RIOZSND3.js +1 -0
- package/chunk-RVTAI3J3.js +98 -0
- package/{chunk-3XLREP6U.js → chunk-RZRT24L6.js} +1 -1
- package/chunk-SJ5TWHWM.js +1 -0
- package/chunk-TCF45ELT.js +959 -0
- package/chunk-TYHNOILY.js +1 -0
- package/chunk-VEUXDYYI.js +1 -0
- package/chunk-VG23QNZF.js +231 -0
- package/{chunk-ZUALJ33O.js → chunk-VUPF5YJY.js} +1 -1
- package/chunk-VXSF6SQF.js +1 -0
- package/chunk-WSVAXPZZ.js +82 -0
- package/chunk-X3PB5IV5.js +1 -0
- package/chunk-XLUCH64S.js +449 -0
- package/chunk-YDBJGTTB.js +1 -0
- package/{chunk-7KQDKLO4.js → chunk-YLHU3GDJ.js} +2 -2
- package/chunk-YVEUYFCE.js +7 -0
- package/chunk-ZWHB7NI7.js +1 -0
- package/index.html +2 -2
- package/main-EJEYMG7N.js +1 -0
- package/package.json +1 -1
- package/{styles-7FHABE27.css → styles-AU7PIISM.css} +1 -1
- package/chunk-2US5D2LY.js +0 -1
- package/chunk-353U23ZQ.js +0 -1
- package/chunk-3B65XZ6E.js +0 -1
- package/chunk-3CEJ67I5.js +0 -1
- package/chunk-3E2EKFPH.js +0 -1
- package/chunk-3H5KBX4R.js +0 -1
- package/chunk-4NSHHAXV.js +0 -1
- package/chunk-6DPW74DP.js +0 -1
- package/chunk-6NCHCAKY.js +0 -300
- package/chunk-7G6KXHQB.js +0 -1
- package/chunk-7U2775BI.js +0 -1
- package/chunk-A47VRZZB.js +0 -1
- package/chunk-AG7353CN.js +0 -1
- package/chunk-AI6YS6T2.js +0 -1
- package/chunk-ANMXAMBL.js +0 -1
- package/chunk-ARSLNNKY.js +0 -7
- package/chunk-AT7II4DO.js +0 -7
- package/chunk-BCXNVGDH.js +0 -193
- package/chunk-BJNN42CI.js +0 -1
- package/chunk-CSQ4MHL2.js +0 -246
- package/chunk-DG6ETDOW.js +0 -1
- package/chunk-DIX7J6JH.js +0 -2
- package/chunk-DMVAXVYQ.js +0 -1
- package/chunk-DNSQSWOS.js +0 -2
- package/chunk-F3PEWQT7.js +0 -1
- package/chunk-FTVGAWDW.js +0 -1
- package/chunk-FUCSF42O.js +0 -2
- package/chunk-FXUC6M2U.js +0 -1
- package/chunk-GCGWIESO.js +0 -1
- package/chunk-GY53MWXH.js +0 -1660
- package/chunk-IHJLTHHQ.js +0 -1
- package/chunk-J6H3BBKP.js +0 -627
- package/chunk-LNRTAR2V.js +0 -1
- package/chunk-LWKS2JEV.js +0 -1
- package/chunk-N2XLL6HJ.js +0 -33
- package/chunk-NM37SDQJ.js +0 -1
- package/chunk-NN6GSTBJ.js +0 -1
- package/chunk-PRRU3DEZ.js +0 -503
- package/chunk-PZBZVQUY.js +0 -67
- package/chunk-Q2IWISMY.js +0 -1
- package/chunk-QIXIZZPY.js +0 -1
- package/chunk-RQEEJGOE.js +0 -1
- package/chunk-TNWHAKS6.js +0 -2
- package/chunk-TPGKCMVN.js +0 -1
- package/chunk-TYETQJ2X.js +0 -2
- package/chunk-U5LD55IP.js +0 -1
- package/chunk-U6SRN7P3.js +0 -1
- package/chunk-VBCJCAMN.js +0 -1
- package/chunk-W76GKZZU.js +0 -1
- package/chunk-WAJWW3TC.js +0 -960
- package/chunk-X5SV4H5B.js +0 -1
- package/chunk-YWYF6P7O.js +0 -1
- package/chunk-YYUWLV5N.js +0 -1
- package/main-L6WVDQUB.js +0 -1
package/chunk-N2XLL6HJ.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{a as Uu}from"./chunk-V3B32QFK.js";import{a as xt}from"./chunk-AI6YS6T2.js";import{a as et}from"./chunk-G4XX7EU2.js";import{a as Nr,b as Ji}from"./chunk-WM3NKRKN.js";import{a as ju,b as Vu,d as Hu,e as $u}from"./chunk-J6H3BBKP.js";import{a as Ho,b as $o}from"./chunk-3XLREP6U.js";import{a as Ga,b as Wu}from"./chunk-TDDTBHQE.js";import"./chunk-ZUALJ33O.js";import{b as qu,c as Xa}from"./chunk-PJKHUCJX.js";import{a as Vo}from"./chunk-3ENMEUVK.js";import"./chunk-5QVQY32E.js";import{a as Wo}from"./chunk-LFDCJISD.js";import{c as Ro,d as Oo}from"./chunk-PZBZVQUY.js";import{a as Na}from"./chunk-QIXIZZPY.js";import{a as yl,b as bl}from"./chunk-ZPTNYW2S.js";import{b as Rr,c as Or,f as Lo,g as Uo,h as Wi,j as Nu,k as Lu,l as qi}from"./chunk-GY53MWXH.js";import{f as Mr,g as zr}from"./chunk-6NCHCAKY.js";import"./chunk-5AITWOQZ.js";import"./chunk-ACQX2T2H.js";import{a as Ja,b as jo}from"./chunk-PRRU3DEZ.js";import{a as at}from"./chunk-W76GKZZU.js";import{c as Br,d as Ar}from"./chunk-JG5HGOEX.js";import{a as zu,b as $i}from"./chunk-7U2I35GP.js";import{a as Su,b as Du,c as Au,d as Ru,e as zo,f as No,g as ci}from"./chunk-ZB6TB7JI.js";import{a as Cu,b as Ou,c as Mu}from"./chunk-7KQDKLO4.js";import{a as Mo,b as Eu,c as Pu,d as ku,e as Fu,f as Tu,g as Bu}from"./chunk-H4V6YZX2.js";import{B as Iu,C as ui,D as Hi,d as ja,f as bu,i as gl,m as Ao,q as Wa,s as qa,t as ji,u as Vi}from"./chunk-WAJWW3TC.js";import{b as Ir,c as At,e as Er,f as Pr,g as Ui,i as ee,k as yu,m as kr,n as Fo,o as To,p as Fr,v as La,w as Ua,z as Tr}from"./chunk-U6SRN7P3.js";import{a as xu}from"./chunk-TPGKCMVN.js";import{C as Va,P as wu,a as cl,b as Bo,ca as fl,d as vn,f as hl,ga as Ha,k as ml,la as $a,m as vu,ma as _u}from"./chunk-BCXNVGDH.js";import{a as Dr}from"./chunk-U5LD55IP.js";import{c as gu,d as ll,f as za,h as pl,i as dl,k as ul}from"./chunk-F2X3VGZZ.js";import{c as Mi,h as fu,n as Sr,p as zi,q as Ni,x as Li}from"./chunk-TYETQJ2X.js";import{a as du,j as ko,k as uu,m as di,n as cu,o as hu,p as mu,r as Ma,s as Oi,t as Wt,w as bn}from"./chunk-353U23ZQ.js";import{$b as Re,Aa as qd,Ac as Bt,Bb as le,Bc as su,Cc as lu,D as Ta,Da as Ba,Ea as Jd,Ga as Ze,Hb as Qd,I as wr,Jc as ut,Kb as Zd,Kc as wt,Lb as T,Lc as Oa,Mb as eu,Mc as _e,Nb as tu,Ob as Ot,Pb as al,Qb as Qr,Rb as Bi,Tb as Ai,Ub as Ri,V as jd,Vb as y,Wb as f,X as Yr,Xb as Z,Yb as Kt,Yc as Mt,Z as We,Zb as Qt,Zc as ir,_b as Ra,_c as pu,ba as tr,c as nl,ca as Vd,cb as xr,d as Fi,ec as De,fc as W,g as bi,ga as _r,gb as I,ha as he,ic as sl,kc as vi,lb as Gd,lc as wi,mb as Kr,mc as _i,n as vr,oa as Hd,ob as Xd,pa as ge,pc as iu,qa as ye,qc as D,r as Ti,rc as Oe,s as pi,sc as Ne,ta as $d,u as Ud,uc as ru,va as Wd,vb as mt,vc as ou,wb as Yd,wc as nu,xb as Kd,xc as au,yc as Cr,za as Po,zb as Aa,zc as qe}from"./chunk-ARSLNNKY.js";import{a as _,b as U,c as Ea,d as rt,e as je,f as G,g as Eo,h as Pa,i as ka,j as Fa}from"./chunk-YQFG5XE2.js";var tc=rt((cx,ec)=>{ec.exports=function(){var t={},e=t._fns={};t.emit=function(a,s,l,u,g,m,P){var E=r(a);E.length&&o(a,E,[s,l,u,g,m,P])},t.on=function(a,s){e[a]||(e[a]=[]),e[a].push(s)},t.once=function(a,s){function l(){s.apply(this,arguments),t.off(a,l)}this.on(a,l)},t.off=function(a,s){var l=[];if(a&&s){var u=this._fns[a],g=0,m=u?u.length:0;for(g;g<m;g++)u[g]!==s&&l.push(u[g])}l.length?this._fns[a]=l:delete this._fns[a]};function r(n){var a=e[n]?e[n]:[],s=n.indexOf(":"),l=s===-1?[n]:[n.substring(0,s),n.substring(s+1)],u=Object.keys(e),g=0,m=u.length;for(g;g<m;g++){var P=u[g];if(P==="*"&&(a=a.concat(e[P])),l.length===2&&l[0]===P){a=a.concat(e[P]);break}}return a}function o(n,a,s){var l=0,u=a.length;for(l;l<u&&a[l];l++)a[l].event=n,a[l].apply(a[l],s)}return t}});var ts=rt((mx,rc)=>{function Jg(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}rc.exports=Jg});var nc=rt((fx,oc)=>{var Gg=typeof global=="object"&&global&&global.Object===Object&&global;oc.exports=Gg});var Dl=rt((gx,ac)=>{var Xg=nc(),Yg=typeof self=="object"&&self&&self.Object===Object&&self,Kg=Xg||Yg||Function("return this")();ac.exports=Kg});var lc=rt((yx,sc)=>{var Qg=Dl(),Zg=function(){return Qg.Date.now()};sc.exports=Zg});var dc=rt((bx,pc)=>{var e0=/\s/;function t0(i){for(var t=i.length;t--&&e0.test(i.charAt(t)););return t}pc.exports=t0});var cc=rt((vx,uc)=>{var i0=dc(),r0=/^\s+/;function o0(i){return i&&i.slice(0,i0(i)+1).replace(r0,"")}uc.exports=o0});var Il=rt((wx,hc)=>{var n0=Dl(),a0=n0.Symbol;hc.exports=a0});var yc=rt((_x,gc)=>{var mc=Il(),fc=Object.prototype,s0=fc.hasOwnProperty,l0=fc.toString,Cn=mc?mc.toStringTag:void 0;function p0(i){var t=s0.call(i,Cn),e=i[Cn];try{i[Cn]=void 0;var r=!0}catch{}var o=l0.call(i);return r&&(t?i[Cn]=e:delete i[Cn]),o}gc.exports=p0});var vc=rt((xx,bc)=>{var d0=Object.prototype,u0=d0.toString;function c0(i){return u0.call(i)}bc.exports=c0});var Cc=rt((Cx,xc)=>{var wc=Il(),h0=yc(),m0=vc(),f0="[object Null]",g0="[object Undefined]",_c=wc?wc.toStringTag:void 0;function y0(i){return i==null?i===void 0?g0:f0:_c&&_c in Object(i)?h0(i):m0(i)}xc.exports=y0});var Dc=rt((Sx,Sc)=>{function b0(i){return i!=null&&typeof i=="object"}Sc.exports=b0});var Ec=rt((Dx,Ic)=>{var v0=Cc(),w0=Dc(),_0="[object Symbol]";function x0(i){return typeof i=="symbol"||w0(i)&&v0(i)==_0}Ic.exports=x0});var Tc=rt((Ix,Fc)=>{var C0=cc(),Pc=ts(),S0=Ec(),kc=NaN,D0=/^[-+]0x[0-9a-f]+$/i,I0=/^0b[01]+$/i,E0=/^0o[0-7]+$/i,P0=parseInt;function k0(i){if(typeof i=="number")return i;if(S0(i))return kc;if(Pc(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=Pc(t)?t+"":t}if(typeof i!="string")return i===0?i:+i;i=C0(i);var e=I0.test(i);return e||E0.test(i)?P0(i.slice(2),e?2:8):D0.test(i)?kc:+i}Fc.exports=k0});var Pl=rt((Ex,Ac)=>{var F0=ts(),El=lc(),Bc=Tc(),T0="Expected a function",B0=Math.max,A0=Math.min;function R0(i,t,e){var r,o,n,a,s,l,u=0,g=!1,m=!1,P=!0;if(typeof i!="function")throw new TypeError(T0);t=Bc(t)||0,F0(e)&&(g=!!e.leading,m="maxWait"in e,n=m?B0(Bc(e.maxWait)||0,t):n,P="trailing"in e?!!e.trailing:P);function E(w){var x=r,k=o;return r=o=void 0,u=w,a=i.apply(k,x),a}function O(w){return u=w,s=setTimeout(oe,t),g?E(w):a}function te(w){var x=w-l,k=w-u,j=t-x;return m?A0(j,n-k):j}function ae(w){var x=w-l,k=w-u;return l===void 0||x>=t||x<0||m&&k>=n}function oe(){var w=El();if(ae(w))return pe(w);s=setTimeout(oe,te(w))}function pe(w){return s=void 0,P&&r?E(w):(r=o=void 0,a)}function de(){s!==void 0&&clearTimeout(s),u=0,r=l=o=s=void 0}function be(){return s===void 0?a:pe(El())}function me(){var w=El(),x=ae(w);if(r=arguments,o=this,l=w,x){if(s===void 0)return O(l);if(m)return clearTimeout(s),s=setTimeout(oe,t),E(l)}return s===void 0&&(s=setTimeout(oe,t)),a}return me.cancel=de,me.flush=be,me}Ac.exports=R0});var Oc=rt((Px,Rc)=>{var O0=Pl(),M0=ts(),z0="Expected a function";function N0(i,t,e){var r=!0,o=!0;if(typeof i!="function")throw new TypeError(z0);return M0(e)&&(r="leading"in e?!!e.leading:r,o="trailing"in e?!!e.trailing:o),O0(i,t,{leading:r,maxWait:t,trailing:o})}Rc.exports=N0});var Dn=rt(($x,Vc)=>{"use strict";Vc.exports=function(t){if(typeof t!="number"||Number.isNaN(t))throw new TypeError(`Expected a number, got ${typeof t}`);let e=t<0,r=Math.abs(t);if(e&&(r=-r),r===0)return"0 B";let o=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(r)/Math.log(1024)),o.length-1),a=Number(r/1024**n),s=o[n];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${s}`}});var Wc=rt((Wx,$c)=>{"use strict";function Hc(i,t){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=t,this.parts=i.split(t)}Hc.prototype.match=function(i){var t=!0,e=this.parts,r,o=e.length,n;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)t=!1;else{for(n=(i||"").split(this.separator),r=0;t&&r<o;r++)e[r]!=="*"&&(r<n.length?t=e[r]===n[r]:t=!1);t=t&&n}else if(typeof i.splice=="function")for(t=[],r=i.length;r--;)this.match(i[r])&&(t[t.length]=i[r]);else if(typeof i=="object"){t={};for(var a in i)this.match(a)&&(t[a]=i[a])}return t};$c.exports=function(i,t,e){var r=new Hc(i,e||/[\/\.]/);return typeof t<"u"?r.match(t):r}});var Jc=rt((qx,qc)=>{var $0=Wc(),W0=/[\/\+\.]/;qc.exports=function(i,t){function e(r){var o=$0(r,i,W0);return o&&o.length>=2}return t?e(t.split(";")[0]):e}});var Nt=rt((j2,fs)=>{(function(){"use strict";var i={}.hasOwnProperty;function t(){for(var o="",n=0;n<arguments.length;n++){var a=arguments[n];a&&(o=r(o,e(a)))}return o}function e(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return t.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var n="";for(var a in o)i.call(o,a)&&o[a]&&(n=r(n,a));return n}function r(o,n){return n?o?o+" "+n:o+n:o}typeof fs<"u"&&fs.exports?(t.default=t,fs.exports=t):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return t}):window.classNames=t})()});var Tm=rt((lS,Ap)=>{"use strict";var Nb=Object.prototype.hasOwnProperty,Ut="~";function aa(){}Object.create&&(aa.prototype=Object.create(null),new aa().__proto__||(Ut=!1));function Lb(i,t,e){this.fn=i,this.context=t,this.once=e||!1}function Fm(i,t,e,r,o){if(typeof e!="function")throw new TypeError("The listener must be a function");var n=new Lb(e,r||i,o),a=Ut?Ut+t:t;return i._events[a]?i._events[a].fn?i._events[a]=[i._events[a],n]:i._events[a].push(n):(i._events[a]=n,i._eventsCount++),i}function As(i,t){--i._eventsCount===0?i._events=new aa:delete i._events[t]}function Rt(){this._events=new aa,this._eventsCount=0}Rt.prototype.eventNames=function(){var t=[],e,r;if(this._eventsCount===0)return t;for(r in e=this._events)Nb.call(e,r)&&t.push(Ut?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};Rt.prototype.listeners=function(t){var e=Ut?Ut+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,n=r.length,a=new Array(n);o<n;o++)a[o]=r[o].fn;return a};Rt.prototype.listenerCount=function(t){var e=Ut?Ut+t:t,r=this._events[e];return r?r.fn?1:r.length:0};Rt.prototype.emit=function(t,e,r,o,n,a){var s=Ut?Ut+t:t;if(!this._events[s])return!1;var l=this._events[s],u=arguments.length,g,m;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),u){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,o),!0;case 5:return l.fn.call(l.context,e,r,o,n),!0;case 6:return l.fn.call(l.context,e,r,o,n,a),!0}for(m=1,g=new Array(u-1);m<u;m++)g[m-1]=arguments[m];l.fn.apply(l.context,g)}else{var P=l.length,E;for(m=0;m<P;m++)switch(l[m].once&&this.removeListener(t,l[m].fn,void 0,!0),u){case 1:l[m].fn.call(l[m].context);break;case 2:l[m].fn.call(l[m].context,e);break;case 3:l[m].fn.call(l[m].context,e,r);break;case 4:l[m].fn.call(l[m].context,e,r,o);break;default:if(!g)for(E=1,g=new Array(u-1);E<u;E++)g[E-1]=arguments[E];l[m].fn.apply(l[m].context,g)}}return!0};Rt.prototype.on=function(t,e,r){return Fm(this,t,e,r,!1)};Rt.prototype.once=function(t,e,r){return Fm(this,t,e,r,!0)};Rt.prototype.removeListener=function(t,e,r,o){var n=Ut?Ut+t:t;if(!this._events[n])return this;if(!e)return As(this,n),this;var a=this._events[n];if(a.fn)a.fn===e&&(!o||a.once)&&(!r||a.context===r)&&As(this,n);else{for(var s=0,l=[],u=a.length;s<u;s++)(a[s].fn!==e||o&&!a[s].once||r&&a[s].context!==r)&&l.push(a[s]);l.length?this._events[n]=l.length===1?l[0]:l:As(this,n)}return this};Rt.prototype.removeAllListeners=function(t){var e;return t?(e=Ut?Ut+t:t,this._events[e]&&As(this,e)):(this._events=new aa,this._eventsCount=0),this};Rt.prototype.off=Rt.prototype.removeListener;Rt.prototype.addListener=Rt.prototype.on;Rt.prefixed=Ut;Rt.EventEmitter=Rt;typeof Ap<"u"&&(Ap.exports=Rt)});var wf=rt((md,fd)=>{(function(i,t){typeof md=="object"&&typeof fd<"u"?fd.exports=t():typeof define=="function"&&define.amd?define(t):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=t())})(md,function(){"use strict";function i(L,F){var M=Object.keys(L);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(L);F&&(z=z.filter(function(H){return Object.getOwnPropertyDescriptor(L,H).enumerable})),M.push.apply(M,z)}return M}function t(L){for(var F=1;F<arguments.length;F++){var M=arguments[F]!=null?arguments[F]:{};F%2?i(Object(M),!0).forEach(function(z){n(L,z,M[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(L,Object.getOwnPropertyDescriptors(M)):i(Object(M)).forEach(function(z){Object.defineProperty(L,z,Object.getOwnPropertyDescriptor(M,z))})}return L}function e(L,F){if(!(L instanceof F))throw new TypeError("Cannot call a class as a function")}function r(L,F){for(var M=0;M<F.length;M++){var z=F[M];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(L,l(z.key),z)}}function o(L,F,M){return F&&r(L.prototype,F),M&&r(L,M),Object.defineProperty(L,"prototype",{writable:!1}),L}function n(L,F,M){return F=l(F),F in L?Object.defineProperty(L,F,{value:M,enumerable:!0,configurable:!0,writable:!0}):L[F]=M,L}function a(){return a=Object.assign?Object.assign.bind():function(L){for(var F=1;F<arguments.length;F++){var M=arguments[F];for(var z in M)Object.prototype.hasOwnProperty.call(M,z)&&(L[z]=M[z])}return L},a.apply(this,arguments)}function s(L,F){if(typeof L!="object"||L===null)return L;var M=L[Symbol.toPrimitive];if(M!==void 0){var z=M.call(L,F||"default");if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(L)}function l(L){var F=s(L,"string");return typeof F=="symbol"?F:String(F)}var u={exports:{}};(function(L){typeof window>"u"||function(F){var M=F.HTMLCanvasElement&&F.HTMLCanvasElement.prototype,z=F.Blob&&function(){try{return!!new Blob}catch{return!1}}(),H=z&&F.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),q=F.BlobBuilder||F.WebKitBlobBuilder||F.MozBlobBuilder||F.MSBlobBuilder,ve=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,Q=(z||q)&&F.atob&&F.ArrayBuffer&&F.Uint8Array&&function(re){var se,we,fe,ce,Ae,K,ke,Te,kt;if(se=re.match(ve),!se)throw new Error("invalid data URI");for(we=se[2]?se[1]:"text/plain"+(se[3]||";charset=US-ASCII"),fe=!!se[4],ce=re.slice(se[0].length),fe?Ae=atob(ce):Ae=decodeURIComponent(ce),K=new ArrayBuffer(Ae.length),ke=new Uint8Array(K),Te=0;Te<Ae.length;Te+=1)ke[Te]=Ae.charCodeAt(Te);return z?new Blob([H?ke:K],{type:we}):(kt=new q,kt.append(K),kt.getBlob(we))};F.HTMLCanvasElement&&!M.toBlob&&(M.mozGetAsFile?M.toBlob=function(re,se,we){var fe=this;setTimeout(function(){we&&M.toDataURL&&Q?re(Q(fe.toDataURL(se,we))):re(fe.mozGetAsFile("blob",se))})}:M.toDataURL&&Q&&(M.msToBlob?M.toBlob=function(re,se,we){var fe=this;setTimeout(function(){(se&&se!=="image/png"||we)&&M.toDataURL&&Q?re(Q(fe.toDataURL(se,we))):re(fe.msToBlob(se))})}:M.toBlob=function(re,se,we){var fe=this;setTimeout(function(){re(Q(fe.toDataURL(se,we)))})})),L.exports?L.exports=Q:F.dataURLtoBlob=Q}(window)})(u);var g=u.exports,m=function(F){return typeof Blob>"u"?!1:F instanceof Blob||Object.prototype.toString.call(F)==="[object Blob]"},P={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},E=typeof window<"u"&&typeof window.document<"u",O=E?window:{},te=function(F){return F>0&&F<1/0},ae=Array.prototype.slice;function oe(L){return Array.from?Array.from(L):ae.call(L)}var pe=/^image\/.+$/;function de(L){return pe.test(L)}function be(L){var F=de(L)?L.substr(6):"";return F==="jpeg"&&(F="jpg"),".".concat(F)}var me=String.fromCharCode;function w(L,F,M){var z="",H;for(M+=F,H=F;H<M;H+=1)z+=me(L.getUint8(H));return z}var x=O.btoa;function k(L,F){for(var M=[],z=8192,H=new Uint8Array(L);H.length>0;)M.push(me.apply(null,oe(H.subarray(0,z)))),H=H.subarray(z);return"data:".concat(F,";base64,").concat(x(M.join("")))}function j(L){var F=new DataView(L),M;try{var z,H,q;if(F.getUint8(0)===255&&F.getUint8(1)===216)for(var ve=F.byteLength,Q=2;Q+1<ve;){if(F.getUint8(Q)===255&&F.getUint8(Q+1)===225){H=Q;break}Q+=1}if(H){var re=H+4,se=H+10;if(w(F,re,4)==="Exif"){var we=F.getUint16(se);if(z=we===18761,(z||we===19789)&&F.getUint16(se+2,z)===42){var fe=F.getUint32(se+4,z);fe>=8&&(q=se+fe)}}}if(q){var ce=F.getUint16(q,z),Ae,K;for(K=0;K<ce;K+=1)if(Ae=q+K*12+2,F.getUint16(Ae,z)===274){Ae+=8,M=F.getUint16(Ae,z),F.setUint16(Ae,1,z);break}}}catch{M=1}return M}function X(L){var F=0,M=1,z=1;switch(L){case 2:M=-1;break;case 3:F=-180;break;case 4:z=-1;break;case 5:F=90,z=-1;break;case 6:F=90;break;case 7:F=90,M=-1;break;case 8:F=-90;break}return{rotate:F,scaleX:M,scaleY:z}}var ie=/\.\d*(?:0|9){12}\d*$/;function Ie(L){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return ie.test(L)?Math.round(L*F)/F:L}function Je(L){var F=L.aspectRatio,M=L.height,z=L.width,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",q=te(z),ve=te(M);if(q&&ve){var Q=M*F;(H==="contain"||H==="none")&&Q>z||H==="cover"&&Q<z?M=z/F:z=M*F}else q?M=z/F:ve&&(z=M*F);return{width:z,height:M}}function tt(L){for(var F=oe(new Uint8Array(L)),M=F.length,z=[],H=0;H+3<M;){var q=F[H],ve=F[H+1];if(q===255&&ve===218)break;if(q===255&&ve===216)H+=2;else{var Q=F[H+2]*256+F[H+3],re=H+Q+2,se=F.slice(H,re);z.push(se),H=re}}return z.reduce(function(we,fe){return fe[0]===255&&fe[1]===225?we.concat(fe):we},[])}function Se(L,F){var M=oe(new Uint8Array(L));if(M[2]!==255||M[3]!==224)return L;var z=M[4]*256+M[5],H=[255,216].concat(F,M.slice(4+z));return new Uint8Array(H)}var Ue=O.ArrayBuffer,ue=O.FileReader,Ee=O.URL||O.webkitURL,Ce=/\.\w+$/,Pe=O.Compressor,ne=function(){function L(F,M){e(this,L),this.file=F,this.exif=[],this.image=new Image,this.options=t(t({},P),M),this.aborted=!1,this.result=null,this.init()}return o(L,[{key:"init",value:function(){var M=this,z=this.file,H=this.options;if(!m(z)){this.fail(new Error("The first argument must be a File or Blob object."));return}var q=z.type;if(!de(q)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!Ee||!ue){this.fail(new Error("The current browser does not support image compression."));return}Ue||(H.checkOrientation=!1,H.retainExif=!1);var ve=q==="image/jpeg",Q=ve&&H.checkOrientation,re=ve&&H.retainExif;if(Ee&&!Q&&!re)this.load({url:Ee.createObjectURL(z)});else{var se=new ue;this.reader=se,se.onload=function(we){var fe=we.target,ce=fe.result,Ae={},K=1;Q&&(K=j(ce),K>1&&a(Ae,X(K))),re&&(M.exif=tt(ce)),Q||re?!Ee||K>1?Ae.url=k(ce,q):Ae.url=Ee.createObjectURL(z):Ae.url=ce,M.load(Ae)},se.onabort=function(){M.fail(new Error("Aborted to read the image with FileReader."))},se.onerror=function(){M.fail(new Error("Failed to read the image with FileReader."))},se.onloadend=function(){M.reader=null},Q||re?se.readAsArrayBuffer(z):se.readAsDataURL(z)}}},{key:"load",value:function(M){var z=this,H=this.file,q=this.image;q.onload=function(){z.draw(t(t({},M),{},{naturalWidth:q.naturalWidth,naturalHeight:q.naturalHeight}))},q.onabort=function(){z.fail(new Error("Aborted to load the image."))},q.onerror=function(){z.fail(new Error("Failed to load the image."))},O.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(O.navigator.userAgent)&&(q.crossOrigin="anonymous"),q.alt=H.name,q.src=M.url}},{key:"draw",value:function(M){var z=this,H=M.naturalWidth,q=M.naturalHeight,ve=M.rotate,Q=ve===void 0?0:ve,re=M.scaleX,se=re===void 0?1:re,we=M.scaleY,fe=we===void 0?1:we,ce=this.file,Ae=this.image,K=this.options,ke=document.createElement("canvas"),Te=ke.getContext("2d"),kt=Math.abs(Q)%180===90,St=(K.resize==="contain"||K.resize==="cover")&&te(K.width)&&te(K.height),Ht=Math.max(K.maxWidth,0)||1/0,Ke=Math.max(K.maxHeight,0)||1/0,yt=Math.max(K.minWidth,0)||0,Qe=Math.max(K.minHeight,0)||0,ot=H/q,Ge=K.width,pt=K.height;if(kt){var mr=[Ke,Ht];Ht=mr[0],Ke=mr[1];var ni=[Qe,yt];yt=ni[0],Qe=ni[1];var Ft=[pt,Ge];Ge=Ft[0],pt=Ft[1]}St&&(ot=Ge/pt);var Ii=Je({aspectRatio:ot,width:Ht,height:Ke},"contain");Ht=Ii.width,Ke=Ii.height;var $r=Je({aspectRatio:ot,width:yt,height:Qe},"cover");if(yt=$r.width,Qe=$r.height,St){var Be=Je({aspectRatio:ot,width:Ge,height:pt},K.resize);Ge=Be.width,pt=Be.height}else{var mn=Je({aspectRatio:ot,width:Ge,height:pt}),xo=mn.width;Ge=xo===void 0?H:xo;var Ei=mn.height;pt=Ei===void 0?q:Ei}Ge=Math.floor(Ie(Math.min(Math.max(Ge,yt),Ht))),pt=Math.floor(Ie(Math.min(Math.max(pt,Qe),Ke)));var el=-Ge/2,fr=-pt/2,Tt=Ge,tl=pt,Co=[];if(St){var nt=0,Xe=0,fn=H,Pi=q,Ca=Je({aspectRatio:ot,width:H,height:q},{contain:"cover",cover:"contain"}[K.resize]);fn=Ca.width,Pi=Ca.height,nt=(H-fn)/2,Xe=(q-Pi)/2,Co.push(nt,Xe,fn,Pi)}if(Co.push(el,fr,Tt,tl),kt){var gi=[pt,Ge];Ge=gi[0],pt=gi[1]}ke.width=Ge,ke.height=pt,de(K.mimeType)||(K.mimeType=ce.type);var Sa="transparent";ce.size>K.convertSize&&K.convertTypes.indexOf(K.mimeType)>=0&&(K.mimeType="image/jpeg");var dt=K.mimeType==="image/jpeg";if(dt&&(Sa="#fff"),Te.fillStyle=Sa,Te.fillRect(0,0,Ge,pt),K.beforeDraw&&K.beforeDraw.call(this,Te,ke),!this.aborted&&(Te.save(),Te.translate(Ge/2,pt/2),Te.rotate(Q*Math.PI/180),Te.scale(se,fe),Te.drawImage.apply(Te,[Ae].concat(Co)),Te.restore(),K.drew&&K.drew.call(this,Te,ke),!this.aborted)){var Xt=function(qr){if(!z.aborted){var So=function(gr){return z.done({naturalWidth:H,naturalHeight:q,result:gr})};if(qr&&dt&&K.retainExif&&z.exif&&z.exif.length>0){var Do=function(gr){return So(g(k(Se(gr,z.exif),K.mimeType)))};if(qr.arrayBuffer)qr.arrayBuffer().then(Do).catch(function(){z.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var ai=new ue;z.reader=ai,ai.onload=function(gn){var gr=gn.target;Do(gr.result)},ai.onabort=function(){z.fail(new Error("Aborted to read the compressed image with FileReader."))},ai.onerror=function(){z.fail(new Error("Failed to read the compressed image with FileReader."))},ai.onloadend=function(){z.reader=null},ai.readAsArrayBuffer(qr)}}else So(qr)}};ke.toBlob?ke.toBlob(Xt,K.mimeType,K.quality):Xt(g(ke.toDataURL(K.mimeType,K.quality)))}}},{key:"done",value:function(M){var z=M.naturalWidth,H=M.naturalHeight,q=M.result,ve=this.file,Q=this.image,re=this.options;if(Ee&&Q.src.indexOf("blob:")===0&&Ee.revokeObjectURL(Q.src),q)if(re.strict&&!re.retainExif&&q.size>ve.size&&re.mimeType===ve.type&&!(re.width>z||re.height>H||re.minWidth>z||re.minHeight>H||re.maxWidth<z||re.maxHeight<H))q=ve;else{var se=new Date;q.lastModified=se.getTime(),q.lastModifiedDate=se,q.name=ve.name,q.name&&q.type!==ve.type&&(q.name=q.name.replace(Ce,be(q.type)))}else q=ve;this.result=q,re.success&&re.success.call(this,q)}},{key:"fail",value:function(M){var z=this.options;if(z.error)z.error.call(this,M);else throw M}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=Pe,L}},{key:"setDefaults",value:function(M){a(P,M)}}]),L}();return ne})});var Sf=rt((yd,bd)=>{(function(i,t){typeof yd=="object"&&typeof bd<"u"?bd.exports=t():typeof define=="function"&&define.amd?define(t):(i=typeof globalThis<"u"?globalThis:i||self,i.Cropper=t())})(yd,function(){"use strict";function i(b,d){var h=Object.keys(b);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(b);d&&(c=c.filter(function(S){return Object.getOwnPropertyDescriptor(b,S).enumerable})),h.push.apply(h,c)}return h}function t(b){for(var d=1;d<arguments.length;d++){var h=arguments[d]!=null?arguments[d]:{};d%2?i(Object(h),!0).forEach(function(c){l(b,c,h[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(c){Object.defineProperty(b,c,Object.getOwnPropertyDescriptor(h,c))})}return b}function e(b,d){if(typeof b!="object"||!b)return b;var h=b[Symbol.toPrimitive];if(h!==void 0){var c=h.call(b,d||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(b)}function r(b){var d=e(b,"string");return typeof d=="symbol"?d:d+""}function o(b){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},o(b)}function n(b,d){if(!(b instanceof d))throw new TypeError("Cannot call a class as a function")}function a(b,d){for(var h=0;h<d.length;h++){var c=d[h];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(b,r(c.key),c)}}function s(b,d,h){return d&&a(b.prototype,d),h&&a(b,h),Object.defineProperty(b,"prototype",{writable:!1}),b}function l(b,d,h){return d=r(d),d in b?Object.defineProperty(b,d,{value:h,enumerable:!0,configurable:!0,writable:!0}):b[d]=h,b}function u(b){return g(b)||m(b)||P(b)||O()}function g(b){if(Array.isArray(b))return E(b)}function m(b){if(typeof Symbol<"u"&&b[Symbol.iterator]!=null||b["@@iterator"]!=null)return Array.from(b)}function P(b,d){if(b){if(typeof b=="string")return E(b,d);var h=Object.prototype.toString.call(b).slice(8,-1);if(h==="Object"&&b.constructor&&(h=b.constructor.name),h==="Map"||h==="Set")return Array.from(b);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return E(b,d)}}function E(b,d){(d==null||d>b.length)&&(d=b.length);for(var h=0,c=new Array(d);h<d;h++)c[h]=b[h];return c}function O(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var te=typeof window<"u"&&typeof window.document<"u",ae=te?window:{},oe=te&&ae.document.documentElement?"ontouchstart"in ae.document.documentElement:!1,pe=te?"PointerEvent"in ae:!1,de="cropper",be="all",me="crop",w="move",x="zoom",k="e",j="w",X="s",ie="n",Ie="ne",Je="nw",tt="se",Se="sw",Ue="".concat(de,"-crop"),ue="".concat(de,"-disabled"),Ee="".concat(de,"-hidden"),Ce="".concat(de,"-hide"),Pe="".concat(de,"-invisible"),ne="".concat(de,"-modal"),L="".concat(de,"-move"),F="".concat(de,"Action"),M="".concat(de,"Preview"),z="crop",H="move",q="none",ve="crop",Q="cropend",re="cropmove",se="cropstart",we="dblclick",fe=oe?"touchstart":"mousedown",ce=oe?"touchmove":"mousemove",Ae=oe?"touchend touchcancel":"mouseup",K=pe?"pointerdown":fe,ke=pe?"pointermove":ce,Te=pe?"pointerup pointercancel":Ae,kt="ready",St="resize",Ht="wheel",Ke="zoom",yt="image/jpeg",Qe=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,ot=/^data:/,Ge=/^data:image\/jpeg;base64,/,pt=/^img|canvas$/i,mr=200,ni=100,Ft={viewMode:0,dragMode:z,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:mr,minContainerHeight:ni,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Ii='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',$r=Number.isNaN||ae.isNaN;function Be(b){return typeof b=="number"&&!$r(b)}var mn=function(d){return d>0&&d<1/0};function xo(b){return typeof b>"u"}function Ei(b){return o(b)==="object"&&b!==null}var el=Object.prototype.hasOwnProperty;function fr(b){if(!Ei(b))return!1;try{var d=b.constructor,h=d.prototype;return d&&h&&el.call(h,"isPrototypeOf")}catch{return!1}}function Tt(b){return typeof b=="function"}var tl=Array.prototype.slice;function Co(b){return Array.from?Array.from(b):tl.call(b)}function nt(b,d){return b&&Tt(d)&&(Array.isArray(b)||Be(b.length)?Co(b).forEach(function(h,c){d.call(b,h,c,b)}):Ei(b)&&Object.keys(b).forEach(function(h){d.call(b,b[h],h,b)})),b}var Xe=Object.assign||function(d){for(var h=arguments.length,c=new Array(h>1?h-1:0),S=1;S<h;S++)c[S-1]=arguments[S];return Ei(d)&&c.length>0&&c.forEach(function(v){Ei(v)&&Object.keys(v).forEach(function(C){d[C]=v[C]})}),d},fn=/\.\d*(?:0|9){12}\d*$/;function Pi(b){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return fn.test(b)?Math.round(b*d)/d:b}var Ca=/^width|height|left|top|marginLeft|marginTop$/;function gi(b,d){var h=b.style;nt(d,function(c,S){Ca.test(S)&&Be(c)&&(c="".concat(c,"px")),h[S]=c})}function Sa(b,d){return b.classList?b.classList.contains(d):b.className.indexOf(d)>-1}function dt(b,d){if(d){if(Be(b.length)){nt(b,function(c){dt(c,d)});return}if(b.classList){b.classList.add(d);return}var h=b.className.trim();h?h.indexOf(d)<0&&(b.className="".concat(h," ").concat(d)):b.className=d}}function Xt(b,d){if(d){if(Be(b.length)){nt(b,function(h){Xt(h,d)});return}if(b.classList){b.classList.remove(d);return}b.className.indexOf(d)>=0&&(b.className=b.className.replace(d,""))}}function Wr(b,d,h){if(d){if(Be(b.length)){nt(b,function(c){Wr(c,d,h)});return}h?dt(b,d):Xt(b,d)}}var qr=/([a-z\d])([A-Z])/g;function So(b){return b.replace(qr,"$1-$2").toLowerCase()}function Do(b,d){return Ei(b[d])?b[d]:b.dataset?b.dataset[d]:b.getAttribute("data-".concat(So(d)))}function ai(b,d,h){Ei(h)?b[d]=h:b.dataset?b.dataset[d]=h:b.setAttribute("data-".concat(So(d)),h)}function gn(b,d){if(Ei(b[d]))try{delete b[d]}catch{b[d]=void 0}else if(b.dataset)try{delete b.dataset[d]}catch{b.dataset[d]=void 0}else b.removeAttribute("data-".concat(So(d)))}var gr=/\s\s*/,Fd=function(){var b=!1;if(te){var d=!1,h=function(){},c=Object.defineProperty({},"once",{get:function(){return b=!0,d},set:function(v){d=v}});ae.addEventListener("test",h,c),ae.removeEventListener("test",h,c)}return b}();function yi(b,d,h){var c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},S=h;d.trim().split(gr).forEach(function(v){if(!Fd){var C=b.listeners;C&&C[v]&&C[v][h]&&(S=C[v][h],delete C[v][h],Object.keys(C[v]).length===0&&delete C[v],Object.keys(C).length===0&&delete b.listeners)}b.removeEventListener(v,S,c)})}function si(b,d,h){var c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},S=h;d.trim().split(gr).forEach(function(v){if(c.once&&!Fd){var C=b.listeners,B=C===void 0?{}:C;S=function(){delete B[v][h],b.removeEventListener(v,S,c);for(var N=arguments.length,A=new Array(N),R=0;R<N;R++)A[R]=arguments[R];h.apply(b,A)},B[v]||(B[v]={}),B[v][h]&&b.removeEventListener(v,B[v][h],c),B[v][h]=S,b.listeners=B}b.addEventListener(v,S,c)})}function Io(b,d,h){var c;return Tt(Event)&&Tt(CustomEvent)?c=new CustomEvent(d,{detail:h,bubbles:!0,cancelable:!0}):(c=document.createEvent("CustomEvent"),c.initCustomEvent(d,!0,!0,h)),b.dispatchEvent(c)}function Td(b){var d=b.getBoundingClientRect();return{left:d.left+(window.pageXOffset-document.documentElement.clientLeft),top:d.top+(window.pageYOffset-document.documentElement.clientTop)}}var il=ae.location,Yf=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Bd(b){var d=b.match(Yf);return d!==null&&(d[1]!==il.protocol||d[2]!==il.hostname||d[3]!==il.port)}function Ad(b){var d="timestamp=".concat(new Date().getTime());return b+(b.indexOf("?")===-1?"?":"&")+d}function yn(b){var d=b.rotate,h=b.scaleX,c=b.scaleY,S=b.translateX,v=b.translateY,C=[];Be(S)&&S!==0&&C.push("translateX(".concat(S,"px)")),Be(v)&&v!==0&&C.push("translateY(".concat(v,"px)")),Be(d)&&d!==0&&C.push("rotate(".concat(d,"deg)")),Be(h)&&h!==1&&C.push("scaleX(".concat(h,")")),Be(c)&&c!==1&&C.push("scaleY(".concat(c,")"));var B=C.length?C.join(" "):"none";return{WebkitTransform:B,msTransform:B,transform:B}}function Kf(b){var d=t({},b),h=0;return nt(b,function(c,S){delete d[S],nt(d,function(v){var C=Math.abs(c.startX-v.startX),B=Math.abs(c.startY-v.startY),$=Math.abs(c.endX-v.endX),N=Math.abs(c.endY-v.endY),A=Math.sqrt(C*C+B*B),R=Math.sqrt($*$+N*N),V=(R-A)/A;Math.abs(V)>Math.abs(h)&&(h=V)})}),h}function Da(b,d){var h=b.pageX,c=b.pageY,S={endX:h,endY:c};return d?S:t({startX:h,startY:c},S)}function Qf(b){var d=0,h=0,c=0;return nt(b,function(S){var v=S.startX,C=S.startY;d+=v,h+=C,c+=1}),d/=c,h/=c,{pageX:d,pageY:h}}function yr(b){var d=b.aspectRatio,h=b.height,c=b.width,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",v=mn(c),C=mn(h);if(v&&C){var B=h*d;S==="contain"&&B>c||S==="cover"&&B<c?h=c/d:c=h*d}else v?h=c/d:C&&(c=h*d);return{width:c,height:h}}function Zf(b){var d=b.width,h=b.height,c=b.degree;if(c=Math.abs(c)%180,c===90)return{width:h,height:d};var S=c%90*Math.PI/180,v=Math.sin(S),C=Math.cos(S),B=d*C+h*v,$=d*v+h*C;return c>90?{width:$,height:B}:{width:B,height:$}}function eg(b,d,h,c){var S=d.aspectRatio,v=d.naturalWidth,C=d.naturalHeight,B=d.rotate,$=B===void 0?0:B,N=d.scaleX,A=N===void 0?1:N,R=d.scaleY,V=R===void 0?1:R,ze=h.aspectRatio,Me=h.naturalWidth,it=h.naturalHeight,Ve=c.fillColor,bt=Ve===void 0?"transparent":Ve,_t=c.imageSmoothingEnabled,ht=_t===void 0?!0:_t,Zi=c.imageSmoothingQuality,Yt=Zi===void 0?"low":Zi,J=c.maxWidth,He=J===void 0?1/0:J,vt=c.maxHeight,li=vt===void 0?1/0:vt,er=c.minWidth,Jr=er===void 0?0:er,Gr=c.minHeight,br=Gr===void 0?0:Gr,ki=document.createElement("canvas"),$t=ki.getContext("2d"),Xr=yr({aspectRatio:ze,width:He,height:li}),Ia=yr({aspectRatio:ze,width:Jr,height:br},"cover"),rl=Math.min(Xr.width,Math.max(Ia.width,Me)),ol=Math.min(Xr.height,Math.max(Ia.height,it)),Md=yr({aspectRatio:S,width:He,height:li}),zd=yr({aspectRatio:S,width:Jr,height:br},"cover"),Nd=Math.min(Md.width,Math.max(zd.width,v)),Ld=Math.min(Md.height,Math.max(zd.height,C)),mg=[-Nd/2,-Ld/2,Nd,Ld];return ki.width=Pi(rl),ki.height=Pi(ol),$t.fillStyle=bt,$t.fillRect(0,0,rl,ol),$t.save(),$t.translate(rl/2,ol/2),$t.rotate($*Math.PI/180),$t.scale(A,V),$t.imageSmoothingEnabled=ht,$t.imageSmoothingQuality=Yt,$t.drawImage.apply($t,[b].concat(u(mg.map(function(fg){return Math.floor(Pi(fg))})))),$t.restore(),ki}var Rd=String.fromCharCode;function tg(b,d,h){var c="";h+=d;for(var S=d;S<h;S+=1)c+=Rd(b.getUint8(S));return c}var ig=/^data:.*,/;function rg(b){var d=b.replace(ig,""),h=atob(d),c=new ArrayBuffer(h.length),S=new Uint8Array(c);return nt(S,function(v,C){S[C]=h.charCodeAt(C)}),c}function og(b,d){for(var h=[],c=8192,S=new Uint8Array(b);S.length>0;)h.push(Rd.apply(null,Co(S.subarray(0,c)))),S=S.subarray(c);return"data:".concat(d,";base64,").concat(btoa(h.join("")))}function ng(b){var d=new DataView(b),h;try{var c,S,v;if(d.getUint8(0)===255&&d.getUint8(1)===216)for(var C=d.byteLength,B=2;B+1<C;){if(d.getUint8(B)===255&&d.getUint8(B+1)===225){S=B;break}B+=1}if(S){var $=S+4,N=S+10;if(tg(d,$,4)==="Exif"){var A=d.getUint16(N);if(c=A===18761,(c||A===19789)&&d.getUint16(N+2,c)===42){var R=d.getUint32(N+4,c);R>=8&&(v=N+R)}}}if(v){var V=d.getUint16(v,c),ze,Me;for(Me=0;Me<V;Me+=1)if(ze=v+Me*12+2,d.getUint16(ze,c)===274){ze+=8,h=d.getUint16(ze,c),d.setUint16(ze,1,c);break}}}catch{h=1}return h}function ag(b){var d=0,h=1,c=1;switch(b){case 2:h=-1;break;case 3:d=-180;break;case 4:c=-1;break;case 5:d=90,c=-1;break;case 6:d=90;break;case 7:d=90,h=-1;break;case 8:d=-90;break}return{rotate:d,scaleX:h,scaleY:c}}var sg={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var d=this.element,h=this.options,c=this.container,S=this.cropper,v=Number(h.minContainerWidth),C=Number(h.minContainerHeight);dt(S,Ee),Xt(d,Ee);var B={width:Math.max(c.offsetWidth,v>=0?v:mr),height:Math.max(c.offsetHeight,C>=0?C:ni)};this.containerData=B,gi(S,{width:B.width,height:B.height}),dt(d,Ee),Xt(S,Ee)},initCanvas:function(){var d=this.containerData,h=this.imageData,c=this.options.viewMode,S=Math.abs(h.rotate)%180===90,v=S?h.naturalHeight:h.naturalWidth,C=S?h.naturalWidth:h.naturalHeight,B=v/C,$=d.width,N=d.height;d.height*B>d.width?c===3?$=d.height*B:N=d.width/B:c===3?N=d.width/B:$=d.height*B;var A={aspectRatio:B,naturalWidth:v,naturalHeight:C,width:$,height:N};this.canvasData=A,this.limited=c===1||c===2,this.limitCanvas(!0,!0),A.width=Math.min(Math.max(A.width,A.minWidth),A.maxWidth),A.height=Math.min(Math.max(A.height,A.minHeight),A.maxHeight),A.left=(d.width-A.width)/2,A.top=(d.height-A.height)/2,A.oldLeft=A.left,A.oldTop=A.top,this.initialCanvasData=Xe({},A)},limitCanvas:function(d,h){var c=this.options,S=this.containerData,v=this.canvasData,C=this.cropBoxData,B=c.viewMode,$=v.aspectRatio,N=this.cropped&&C;if(d){var A=Number(c.minCanvasWidth)||0,R=Number(c.minCanvasHeight)||0;B>1?(A=Math.max(A,S.width),R=Math.max(R,S.height),B===3&&(R*$>A?A=R*$:R=A/$)):B>0&&(A?A=Math.max(A,N?C.width:0):R?R=Math.max(R,N?C.height:0):N&&(A=C.width,R=C.height,R*$>A?A=R*$:R=A/$));var V=yr({aspectRatio:$,width:A,height:R});A=V.width,R=V.height,v.minWidth=A,v.minHeight=R,v.maxWidth=1/0,v.maxHeight=1/0}if(h)if(B>(N?0:1)){var ze=S.width-v.width,Me=S.height-v.height;v.minLeft=Math.min(0,ze),v.minTop=Math.min(0,Me),v.maxLeft=Math.max(0,ze),v.maxTop=Math.max(0,Me),N&&this.limited&&(v.minLeft=Math.min(C.left,C.left+(C.width-v.width)),v.minTop=Math.min(C.top,C.top+(C.height-v.height)),v.maxLeft=C.left,v.maxTop=C.top,B===2&&(v.width>=S.width&&(v.minLeft=Math.min(0,ze),v.maxLeft=Math.max(0,ze)),v.height>=S.height&&(v.minTop=Math.min(0,Me),v.maxTop=Math.max(0,Me))))}else v.minLeft=-v.width,v.minTop=-v.height,v.maxLeft=S.width,v.maxTop=S.height},renderCanvas:function(d,h){var c=this.canvasData,S=this.imageData;if(h){var v=Zf({width:S.naturalWidth*Math.abs(S.scaleX||1),height:S.naturalHeight*Math.abs(S.scaleY||1),degree:S.rotate||0}),C=v.width,B=v.height,$=c.width*(C/c.naturalWidth),N=c.height*(B/c.naturalHeight);c.left-=($-c.width)/2,c.top-=(N-c.height)/2,c.width=$,c.height=N,c.aspectRatio=C/B,c.naturalWidth=C,c.naturalHeight=B,this.limitCanvas(!0,!1)}(c.width>c.maxWidth||c.width<c.minWidth)&&(c.left=c.oldLeft),(c.height>c.maxHeight||c.height<c.minHeight)&&(c.top=c.oldTop),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),this.limitCanvas(!1,!0),c.left=Math.min(Math.max(c.left,c.minLeft),c.maxLeft),c.top=Math.min(Math.max(c.top,c.minTop),c.maxTop),c.oldLeft=c.left,c.oldTop=c.top,gi(this.canvas,Xe({width:c.width,height:c.height},yn({translateX:c.left,translateY:c.top}))),this.renderImage(d),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(d){var h=this.canvasData,c=this.imageData,S=c.naturalWidth*(h.width/h.naturalWidth),v=c.naturalHeight*(h.height/h.naturalHeight);Xe(c,{width:S,height:v,left:(h.width-S)/2,top:(h.height-v)/2}),gi(this.image,Xe({width:c.width,height:c.height},yn(Xe({translateX:c.left,translateY:c.top},c)))),d&&this.output()},initCropBox:function(){var d=this.options,h=this.canvasData,c=d.aspectRatio||d.initialAspectRatio,S=Number(d.autoCropArea)||.8,v={width:h.width,height:h.height};c&&(h.height*c>h.width?v.height=v.width/c:v.width=v.height*c),this.cropBoxData=v,this.limitCropBox(!0,!0),v.width=Math.min(Math.max(v.width,v.minWidth),v.maxWidth),v.height=Math.min(Math.max(v.height,v.minHeight),v.maxHeight),v.width=Math.max(v.minWidth,v.width*S),v.height=Math.max(v.minHeight,v.height*S),v.left=h.left+(h.width-v.width)/2,v.top=h.top+(h.height-v.height)/2,v.oldLeft=v.left,v.oldTop=v.top,this.initialCropBoxData=Xe({},v)},limitCropBox:function(d,h){var c=this.options,S=this.containerData,v=this.canvasData,C=this.cropBoxData,B=this.limited,$=c.aspectRatio;if(d){var N=Number(c.minCropBoxWidth)||0,A=Number(c.minCropBoxHeight)||0,R=B?Math.min(S.width,v.width,v.width+v.left,S.width-v.left):S.width,V=B?Math.min(S.height,v.height,v.height+v.top,S.height-v.top):S.height;N=Math.min(N,S.width),A=Math.min(A,S.height),$&&(N&&A?A*$>N?A=N/$:N=A*$:N?A=N/$:A&&(N=A*$),V*$>R?V=R/$:R=V*$),C.minWidth=Math.min(N,R),C.minHeight=Math.min(A,V),C.maxWidth=R,C.maxHeight=V}h&&(B?(C.minLeft=Math.max(0,v.left),C.minTop=Math.max(0,v.top),C.maxLeft=Math.min(S.width,v.left+v.width)-C.width,C.maxTop=Math.min(S.height,v.top+v.height)-C.height):(C.minLeft=0,C.minTop=0,C.maxLeft=S.width-C.width,C.maxTop=S.height-C.height))},renderCropBox:function(){var d=this.options,h=this.containerData,c=this.cropBoxData;(c.width>c.maxWidth||c.width<c.minWidth)&&(c.left=c.oldLeft),(c.height>c.maxHeight||c.height<c.minHeight)&&(c.top=c.oldTop),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),this.limitCropBox(!1,!0),c.left=Math.min(Math.max(c.left,c.minLeft),c.maxLeft),c.top=Math.min(Math.max(c.top,c.minTop),c.maxTop),c.oldLeft=c.left,c.oldTop=c.top,d.movable&&d.cropBoxMovable&&ai(this.face,F,c.width>=h.width&&c.height>=h.height?w:be),gi(this.cropBox,Xe({width:c.width,height:c.height},yn({translateX:c.left,translateY:c.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Io(this.element,ve,this.getData())}},lg={initPreview:function(){var d=this.element,h=this.crossOrigin,c=this.options.preview,S=h?this.crossOriginUrl:this.url,v=d.alt||"The image to preview",C=document.createElement("img");if(h&&(C.crossOrigin=h),C.src=S,C.alt=v,this.viewBox.appendChild(C),this.viewBoxImage=C,!!c){var B=c;typeof c=="string"?B=d.ownerDocument.querySelectorAll(c):c.querySelector&&(B=[c]),this.previews=B,nt(B,function($){var N=document.createElement("img");ai($,M,{width:$.offsetWidth,height:$.offsetHeight,html:$.innerHTML}),h&&(N.crossOrigin=h),N.src=S,N.alt=v,N.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',$.innerHTML="",$.appendChild(N)})}},resetPreview:function(){nt(this.previews,function(d){var h=Do(d,M);gi(d,{width:h.width,height:h.height}),d.innerHTML=h.html,gn(d,M)})},preview:function(){var d=this.imageData,h=this.canvasData,c=this.cropBoxData,S=c.width,v=c.height,C=d.width,B=d.height,$=c.left-h.left-d.left,N=c.top-h.top-d.top;!this.cropped||this.disabled||(gi(this.viewBoxImage,Xe({width:C,height:B},yn(Xe({translateX:-$,translateY:-N},d)))),nt(this.previews,function(A){var R=Do(A,M),V=R.width,ze=R.height,Me=V,it=ze,Ve=1;S&&(Ve=V/S,it=v*Ve),v&&it>ze&&(Ve=ze/v,Me=S*Ve,it=ze),gi(A,{width:Me,height:it}),gi(A.getElementsByTagName("img")[0],Xe({width:C*Ve,height:B*Ve},yn(Xe({translateX:-$*Ve,translateY:-N*Ve},d))))}))}},pg={bind:function(){var d=this.element,h=this.options,c=this.cropper;Tt(h.cropstart)&&si(d,se,h.cropstart),Tt(h.cropmove)&&si(d,re,h.cropmove),Tt(h.cropend)&&si(d,Q,h.cropend),Tt(h.crop)&&si(d,ve,h.crop),Tt(h.zoom)&&si(d,Ke,h.zoom),si(c,K,this.onCropStart=this.cropStart.bind(this)),h.zoomable&&h.zoomOnWheel&&si(c,Ht,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),h.toggleDragModeOnDblclick&&si(c,we,this.onDblclick=this.dblclick.bind(this)),si(d.ownerDocument,ke,this.onCropMove=this.cropMove.bind(this)),si(d.ownerDocument,Te,this.onCropEnd=this.cropEnd.bind(this)),h.responsive&&si(window,St,this.onResize=this.resize.bind(this))},unbind:function(){var d=this.element,h=this.options,c=this.cropper;Tt(h.cropstart)&&yi(d,se,h.cropstart),Tt(h.cropmove)&&yi(d,re,h.cropmove),Tt(h.cropend)&&yi(d,Q,h.cropend),Tt(h.crop)&&yi(d,ve,h.crop),Tt(h.zoom)&&yi(d,Ke,h.zoom),yi(c,K,this.onCropStart),h.zoomable&&h.zoomOnWheel&&yi(c,Ht,this.onWheel,{passive:!1,capture:!0}),h.toggleDragModeOnDblclick&&yi(c,we,this.onDblclick),yi(d.ownerDocument,ke,this.onCropMove),yi(d.ownerDocument,Te,this.onCropEnd),h.responsive&&yi(window,St,this.onResize)}},dg={resize:function(){if(!this.disabled){var d=this.options,h=this.container,c=this.containerData,S=h.offsetWidth/c.width,v=h.offsetHeight/c.height,C=Math.abs(S-1)>Math.abs(v-1)?S:v;if(C!==1){var B,$;d.restore&&(B=this.getCanvasData(),$=this.getCropBoxData()),this.render(),d.restore&&(this.setCanvasData(nt(B,function(N,A){B[A]=N*C})),this.setCropBoxData(nt($,function(N,A){$[A]=N*C})))}}},dblclick:function(){this.disabled||this.options.dragMode===q||this.setDragMode(Sa(this.dragBox,Ue)?H:z)},wheel:function(d){var h=this,c=Number(this.options.wheelZoomRatio)||.1,S=1;this.disabled||(d.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){h.wheeling=!1},50),d.deltaY?S=d.deltaY>0?1:-1:d.wheelDelta?S=-d.wheelDelta/120:d.detail&&(S=d.detail>0?1:-1),this.zoom(-S*c,d)))},cropStart:function(d){var h=d.buttons,c=d.button;if(!(this.disabled||(d.type==="mousedown"||d.type==="pointerdown"&&d.pointerType==="mouse")&&(Be(h)&&h!==1||Be(c)&&c!==0||d.ctrlKey))){var S=this.options,v=this.pointers,C;d.changedTouches?nt(d.changedTouches,function(B){v[B.identifier]=Da(B)}):v[d.pointerId||0]=Da(d),Object.keys(v).length>1&&S.zoomable&&S.zoomOnTouch?C=x:C=Do(d.target,F),Qe.test(C)&&Io(this.element,se,{originalEvent:d,action:C})!==!1&&(d.preventDefault(),this.action=C,this.cropping=!1,C===me&&(this.cropping=!0,dt(this.dragBox,ne)))}},cropMove:function(d){var h=this.action;if(!(this.disabled||!h)){var c=this.pointers;d.preventDefault(),Io(this.element,re,{originalEvent:d,action:h})!==!1&&(d.changedTouches?nt(d.changedTouches,function(S){Xe(c[S.identifier]||{},Da(S,!0))}):Xe(c[d.pointerId||0]||{},Da(d,!0)),this.change(d))}},cropEnd:function(d){if(!this.disabled){var h=this.action,c=this.pointers;d.changedTouches?nt(d.changedTouches,function(S){delete c[S.identifier]}):delete c[d.pointerId||0],h&&(d.preventDefault(),Object.keys(c).length||(this.action=""),this.cropping&&(this.cropping=!1,Wr(this.dragBox,ne,this.cropped&&this.options.modal)),Io(this.element,Q,{originalEvent:d,action:h}))}}},ug={change:function(d){var h=this.options,c=this.canvasData,S=this.containerData,v=this.cropBoxData,C=this.pointers,B=this.action,$=h.aspectRatio,N=v.left,A=v.top,R=v.width,V=v.height,ze=N+R,Me=A+V,it=0,Ve=0,bt=S.width,_t=S.height,ht=!0,Zi;!$&&d.shiftKey&&($=R&&V?R/V:1),this.limited&&(it=v.minLeft,Ve=v.minTop,bt=it+Math.min(S.width,c.width,c.left+c.width),_t=Ve+Math.min(S.height,c.height,c.top+c.height));var Yt=C[Object.keys(C)[0]],J={x:Yt.endX-Yt.startX,y:Yt.endY-Yt.startY},He=function(li){switch(li){case k:ze+J.x>bt&&(J.x=bt-ze);break;case j:N+J.x<it&&(J.x=it-N);break;case ie:A+J.y<Ve&&(J.y=Ve-A);break;case X:Me+J.y>_t&&(J.y=_t-Me);break}};switch(B){case be:N+=J.x,A+=J.y;break;case k:if(J.x>=0&&(ze>=bt||$&&(A<=Ve||Me>=_t))){ht=!1;break}He(k),R+=J.x,R<0&&(B=j,R=-R,N-=R),$&&(V=R/$,A+=(v.height-V)/2);break;case ie:if(J.y<=0&&(A<=Ve||$&&(N<=it||ze>=bt))){ht=!1;break}He(ie),V-=J.y,A+=J.y,V<0&&(B=X,V=-V,A-=V),$&&(R=V*$,N+=(v.width-R)/2);break;case j:if(J.x<=0&&(N<=it||$&&(A<=Ve||Me>=_t))){ht=!1;break}He(j),R-=J.x,N+=J.x,R<0&&(B=k,R=-R,N-=R),$&&(V=R/$,A+=(v.height-V)/2);break;case X:if(J.y>=0&&(Me>=_t||$&&(N<=it||ze>=bt))){ht=!1;break}He(X),V+=J.y,V<0&&(B=ie,V=-V,A-=V),$&&(R=V*$,N+=(v.width-R)/2);break;case Ie:if($){if(J.y<=0&&(A<=Ve||ze>=bt)){ht=!1;break}He(ie),V-=J.y,A+=J.y,R=V*$}else He(ie),He(k),J.x>=0?ze<bt?R+=J.x:J.y<=0&&A<=Ve&&(ht=!1):R+=J.x,J.y<=0?A>Ve&&(V-=J.y,A+=J.y):(V-=J.y,A+=J.y);R<0&&V<0?(B=Se,V=-V,R=-R,A-=V,N-=R):R<0?(B=Je,R=-R,N-=R):V<0&&(B=tt,V=-V,A-=V);break;case Je:if($){if(J.y<=0&&(A<=Ve||N<=it)){ht=!1;break}He(ie),V-=J.y,A+=J.y,R=V*$,N+=v.width-R}else He(ie),He(j),J.x<=0?N>it?(R-=J.x,N+=J.x):J.y<=0&&A<=Ve&&(ht=!1):(R-=J.x,N+=J.x),J.y<=0?A>Ve&&(V-=J.y,A+=J.y):(V-=J.y,A+=J.y);R<0&&V<0?(B=tt,V=-V,R=-R,A-=V,N-=R):R<0?(B=Ie,R=-R,N-=R):V<0&&(B=Se,V=-V,A-=V);break;case Se:if($){if(J.x<=0&&(N<=it||Me>=_t)){ht=!1;break}He(j),R-=J.x,N+=J.x,V=R/$}else He(X),He(j),J.x<=0?N>it?(R-=J.x,N+=J.x):J.y>=0&&Me>=_t&&(ht=!1):(R-=J.x,N+=J.x),J.y>=0?Me<_t&&(V+=J.y):V+=J.y;R<0&&V<0?(B=Ie,V=-V,R=-R,A-=V,N-=R):R<0?(B=tt,R=-R,N-=R):V<0&&(B=Je,V=-V,A-=V);break;case tt:if($){if(J.x>=0&&(ze>=bt||Me>=_t)){ht=!1;break}He(k),R+=J.x,V=R/$}else He(X),He(k),J.x>=0?ze<bt?R+=J.x:J.y>=0&&Me>=_t&&(ht=!1):R+=J.x,J.y>=0?Me<_t&&(V+=J.y):V+=J.y;R<0&&V<0?(B=Je,V=-V,R=-R,A-=V,N-=R):R<0?(B=Se,R=-R,N-=R):V<0&&(B=Ie,V=-V,A-=V);break;case w:this.move(J.x,J.y),ht=!1;break;case x:this.zoom(Kf(C),d),ht=!1;break;case me:if(!J.x||!J.y){ht=!1;break}Zi=Td(this.cropper),N=Yt.startX-Zi.left,A=Yt.startY-Zi.top,R=v.minWidth,V=v.minHeight,J.x>0?B=J.y>0?tt:Ie:J.x<0&&(N-=R,B=J.y>0?Se:Je),J.y<0&&(A-=V),this.cropped||(Xt(this.cropBox,Ee),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}ht&&(v.width=R,v.height=V,v.left=N,v.top=A,this.action=B,this.renderCropBox()),nt(C,function(vt){vt.startX=vt.endX,vt.startY=vt.endY})}},cg={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&dt(this.dragBox,ne),Xt(this.cropBox,Ee),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Xe({},this.initialImageData),this.canvasData=Xe({},this.initialCanvasData),this.cropBoxData=Xe({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Xe(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Xt(this.dragBox,ne),dt(this.cropBox,Ee)),this},replace:function(d){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&d&&(this.isImg&&(this.element.src=d),h?(this.url=d,this.image.src=d,this.ready&&(this.viewBoxImage.src=d,nt(this.previews,function(c){c.getElementsByTagName("img")[0].src=d}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(d))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Xt(this.cropper,ue)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,dt(this.cropper,ue)),this},destroy:function(){var d=this.element;return d[de]?(d[de]=void 0,this.isImg&&this.replaced&&(d.src=this.originalUrl),this.uncreate(),this):this},move:function(d){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,c=this.canvasData,S=c.left,v=c.top;return this.moveTo(xo(d)?d:S+Number(d),xo(h)?h:v+Number(h))},moveTo:function(d){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,c=this.canvasData,S=!1;return d=Number(d),h=Number(h),this.ready&&!this.disabled&&this.options.movable&&(Be(d)&&(c.left=d,S=!0),Be(h)&&(c.top=h,S=!0),S&&this.renderCanvas(!0)),this},zoom:function(d,h){var c=this.canvasData;return d=Number(d),d<0?d=1/(1-d):d=1+d,this.zoomTo(c.width*d/c.naturalWidth,null,h)},zoomTo:function(d,h,c){var S=this.options,v=this.canvasData,C=v.width,B=v.height,$=v.naturalWidth,N=v.naturalHeight;if(d=Number(d),d>=0&&this.ready&&!this.disabled&&S.zoomable){var A=$*d,R=N*d;if(Io(this.element,Ke,{ratio:d,oldRatio:C/$,originalEvent:c})===!1)return this;if(c){var V=this.pointers,ze=Td(this.cropper),Me=V&&Object.keys(V).length?Qf(V):{pageX:c.pageX,pageY:c.pageY};v.left-=(A-C)*((Me.pageX-ze.left-v.left)/C),v.top-=(R-B)*((Me.pageY-ze.top-v.top)/B)}else fr(h)&&Be(h.x)&&Be(h.y)?(v.left-=(A-C)*((h.x-v.left)/C),v.top-=(R-B)*((h.y-v.top)/B)):(v.left-=(A-C)/2,v.top-=(R-B)/2);v.width=A,v.height=R,this.renderCanvas(!0)}return this},rotate:function(d){return this.rotateTo((this.imageData.rotate||0)+Number(d))},rotateTo:function(d){return d=Number(d),Be(d)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=d%360,this.renderCanvas(!0,!0)),this},scaleX:function(d){var h=this.imageData.scaleY;return this.scale(d,Be(h)?h:1)},scaleY:function(d){var h=this.imageData.scaleX;return this.scale(Be(h)?h:1,d)},scale:function(d){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,c=this.imageData,S=!1;return d=Number(d),h=Number(h),this.ready&&!this.disabled&&this.options.scalable&&(Be(d)&&(c.scaleX=d,S=!0),Be(h)&&(c.scaleY=h,S=!0),S&&this.renderCanvas(!0,!0)),this},getData:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,h=this.options,c=this.imageData,S=this.canvasData,v=this.cropBoxData,C;if(this.ready&&this.cropped){C={x:v.left-S.left,y:v.top-S.top,width:v.width,height:v.height};var B=c.width/c.naturalWidth;if(nt(C,function(A,R){C[R]=A/B}),d){var $=Math.round(C.y+C.height),N=Math.round(C.x+C.width);C.x=Math.round(C.x),C.y=Math.round(C.y),C.width=N-C.x,C.height=$-C.y}}else C={x:0,y:0,width:0,height:0};return h.rotatable&&(C.rotate=c.rotate||0),h.scalable&&(C.scaleX=c.scaleX||1,C.scaleY=c.scaleY||1),C},setData:function(d){var h=this.options,c=this.imageData,S=this.canvasData,v={};if(this.ready&&!this.disabled&&fr(d)){var C=!1;h.rotatable&&Be(d.rotate)&&d.rotate!==c.rotate&&(c.rotate=d.rotate,C=!0),h.scalable&&(Be(d.scaleX)&&d.scaleX!==c.scaleX&&(c.scaleX=d.scaleX,C=!0),Be(d.scaleY)&&d.scaleY!==c.scaleY&&(c.scaleY=d.scaleY,C=!0)),C&&this.renderCanvas(!0,!0);var B=c.width/c.naturalWidth;Be(d.x)&&(v.left=d.x*B+S.left),Be(d.y)&&(v.top=d.y*B+S.top),Be(d.width)&&(v.width=d.width*B),Be(d.height)&&(v.height=d.height*B),this.setCropBoxData(v)}return this},getContainerData:function(){return this.ready?Xe({},this.containerData):{}},getImageData:function(){return this.sized?Xe({},this.imageData):{}},getCanvasData:function(){var d=this.canvasData,h={};return this.ready&&nt(["left","top","width","height","naturalWidth","naturalHeight"],function(c){h[c]=d[c]}),h},setCanvasData:function(d){var h=this.canvasData,c=h.aspectRatio;return this.ready&&!this.disabled&&fr(d)&&(Be(d.left)&&(h.left=d.left),Be(d.top)&&(h.top=d.top),Be(d.width)?(h.width=d.width,h.height=d.width/c):Be(d.height)&&(h.height=d.height,h.width=d.height*c),this.renderCanvas(!0)),this},getCropBoxData:function(){var d=this.cropBoxData,h;return this.ready&&this.cropped&&(h={left:d.left,top:d.top,width:d.width,height:d.height}),h||{}},setCropBoxData:function(d){var h=this.cropBoxData,c=this.options.aspectRatio,S,v;return this.ready&&this.cropped&&!this.disabled&&fr(d)&&(Be(d.left)&&(h.left=d.left),Be(d.top)&&(h.top=d.top),Be(d.width)&&d.width!==h.width&&(S=!0,h.width=d.width),Be(d.height)&&d.height!==h.height&&(v=!0,h.height=d.height),c&&(S?h.height=h.width/c:v&&(h.width=h.height*c)),this.renderCropBox()),this},getCroppedCanvas:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var h=this.canvasData,c=eg(this.image,this.imageData,h,d);if(!this.cropped)return c;var S=this.getData(d.rounded),v=S.x,C=S.y,B=S.width,$=S.height,N=c.width/Math.floor(h.naturalWidth);N!==1&&(v*=N,C*=N,B*=N,$*=N);var A=B/$,R=yr({aspectRatio:A,width:d.maxWidth||1/0,height:d.maxHeight||1/0}),V=yr({aspectRatio:A,width:d.minWidth||0,height:d.minHeight||0},"cover"),ze=yr({aspectRatio:A,width:d.width||(N!==1?c.width:B),height:d.height||(N!==1?c.height:$)}),Me=ze.width,it=ze.height;Me=Math.min(R.width,Math.max(V.width,Me)),it=Math.min(R.height,Math.max(V.height,it));var Ve=document.createElement("canvas"),bt=Ve.getContext("2d");Ve.width=Pi(Me),Ve.height=Pi(it),bt.fillStyle=d.fillColor||"transparent",bt.fillRect(0,0,Me,it);var _t=d.imageSmoothingEnabled,ht=_t===void 0?!0:_t,Zi=d.imageSmoothingQuality;bt.imageSmoothingEnabled=ht,Zi&&(bt.imageSmoothingQuality=Zi);var Yt=c.width,J=c.height,He=v,vt=C,li,er,Jr,Gr,br,ki;He<=-B||He>Yt?(He=0,li=0,Jr=0,br=0):He<=0?(Jr=-He,He=0,li=Math.min(Yt,B+He),br=li):He<=Yt&&(Jr=0,li=Math.min(B,Yt-He),br=li),li<=0||vt<=-$||vt>J?(vt=0,er=0,Gr=0,ki=0):vt<=0?(Gr=-vt,vt=0,er=Math.min(J,$+vt),ki=er):vt<=J&&(Gr=0,er=Math.min($,J-vt),ki=er);var $t=[He,vt,li,er];if(br>0&&ki>0){var Xr=Me/B;$t.push(Jr*Xr,Gr*Xr,br*Xr,ki*Xr)}return bt.drawImage.apply(bt,[c].concat(u($t.map(function(Ia){return Math.floor(Pi(Ia))})))),Ve},setAspectRatio:function(d){var h=this.options;return!this.disabled&&!xo(d)&&(h.aspectRatio=Math.max(0,d)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(d){var h=this.options,c=this.dragBox,S=this.face;if(this.ready&&!this.disabled){var v=d===z,C=h.movable&&d===H;d=v||C?d:q,h.dragMode=d,ai(c,F,d),Wr(c,Ue,v),Wr(c,L,C),h.cropBoxMovable||(ai(S,F,d),Wr(S,Ue,v),Wr(S,L,C))}return this}},hg=ae.Cropper,Od=function(){function b(d){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n(this,b),!d||!pt.test(d.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=d,this.options=Xe({},Ft,fr(h)&&h),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return s(b,[{key:"init",value:function(){var h=this.element,c=h.tagName.toLowerCase(),S;if(!h[de]){if(h[de]=this,c==="img"){if(this.isImg=!0,S=h.getAttribute("src")||"",this.originalUrl=S,!S)return;S=h.src}else c==="canvas"&&window.HTMLCanvasElement&&(S=h.toDataURL());this.load(S)}}},{key:"load",value:function(h){var c=this;if(h){this.url=h,this.imageData={};var S=this.element,v=this.options;if(!v.rotatable&&!v.scalable&&(v.checkOrientation=!1),!v.checkOrientation||!window.ArrayBuffer){this.clone();return}if(ot.test(h)){Ge.test(h)?this.read(rg(h)):this.clone();return}var C=new XMLHttpRequest,B=this.clone.bind(this);this.reloading=!0,this.xhr=C,C.onabort=B,C.onerror=B,C.ontimeout=B,C.onprogress=function(){C.getResponseHeader("content-type")!==yt&&C.abort()},C.onload=function(){c.read(C.response)},C.onloadend=function(){c.reloading=!1,c.xhr=null},v.checkCrossOrigin&&Bd(h)&&S.crossOrigin&&(h=Ad(h)),C.open("GET",h,!0),C.responseType="arraybuffer",C.withCredentials=S.crossOrigin==="use-credentials",C.send()}}},{key:"read",value:function(h){var c=this.options,S=this.imageData,v=ng(h),C=0,B=1,$=1;if(v>1){this.url=og(h,yt);var N=ag(v);C=N.rotate,B=N.scaleX,$=N.scaleY}c.rotatable&&(S.rotate=C),c.scalable&&(S.scaleX=B,S.scaleY=$),this.clone()}},{key:"clone",value:function(){var h=this.element,c=this.url,S=h.crossOrigin,v=c;this.options.checkCrossOrigin&&Bd(c)&&(S||(S="anonymous"),v=Ad(c)),this.crossOrigin=S,this.crossOriginUrl=v;var C=document.createElement("img");S&&(C.crossOrigin=S),C.src=v||c,C.alt=h.alt||"The image to crop",this.image=C,C.onload=this.start.bind(this),C.onerror=this.stop.bind(this),dt(C,Ce),h.parentNode.insertBefore(C,h.nextSibling)}},{key:"start",value:function(){var h=this,c=this.image;c.onload=null,c.onerror=null,this.sizing=!0;var S=ae.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ae.navigator.userAgent),v=function(N,A){Xe(h.imageData,{naturalWidth:N,naturalHeight:A,aspectRatio:N/A}),h.initialImageData=Xe({},h.imageData),h.sizing=!1,h.sized=!0,h.build()};if(c.naturalWidth&&!S){v(c.naturalWidth,c.naturalHeight);return}var C=document.createElement("img"),B=document.body||document.documentElement;this.sizingImage=C,C.onload=function(){v(C.width,C.height),S||B.removeChild(C)},C.src=c.src,S||(C.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",B.appendChild(C))}},{key:"stop",value:function(){var h=this.image;h.onload=null,h.onerror=null,h.parentNode.removeChild(h),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var h=this.element,c=this.options,S=this.image,v=h.parentNode,C=document.createElement("div");C.innerHTML=Ii;var B=C.querySelector(".".concat(de,"-container")),$=B.querySelector(".".concat(de,"-canvas")),N=B.querySelector(".".concat(de,"-drag-box")),A=B.querySelector(".".concat(de,"-crop-box")),R=A.querySelector(".".concat(de,"-face"));this.container=v,this.cropper=B,this.canvas=$,this.dragBox=N,this.cropBox=A,this.viewBox=B.querySelector(".".concat(de,"-view-box")),this.face=R,$.appendChild(S),dt(h,Ee),v.insertBefore(B,h.nextSibling),Xt(S,Ce),this.initPreview(),this.bind(),c.initialAspectRatio=Math.max(0,c.initialAspectRatio)||NaN,c.aspectRatio=Math.max(0,c.aspectRatio)||NaN,c.viewMode=Math.max(0,Math.min(3,Math.round(c.viewMode)))||0,dt(A,Ee),c.guides||dt(A.getElementsByClassName("".concat(de,"-dashed")),Ee),c.center||dt(A.getElementsByClassName("".concat(de,"-center")),Ee),c.background&&dt(B,"".concat(de,"-bg")),c.highlight||dt(R,Pe),c.cropBoxMovable&&(dt(R,L),ai(R,F,be)),c.cropBoxResizable||(dt(A.getElementsByClassName("".concat(de,"-line")),Ee),dt(A.getElementsByClassName("".concat(de,"-point")),Ee)),this.render(),this.ready=!0,this.setDragMode(c.dragMode),c.autoCrop&&this.crop(),this.setData(c.data),Tt(c.ready)&&si(h,kt,c.ready,{once:!0}),Io(h,kt)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var h=this.cropper.parentNode;h&&h.removeChild(this.cropper),Xt(this.element,Ee)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=hg,b}},{key:"setDefaults",value:function(h){Xe(Ft,fr(h)&&h)}}])}();return Xe(Od.prototype,sg,lg,pg,dg,ug,cg),Od})});var Xs=rt((vd,wd)=>{((i,t)=>{typeof define=="function"&&define.amd?define([],t):typeof wd=="object"&&typeof vd<"u"?wd.exports=t():i.Papa=t()})(vd,function i(){var t=typeof self<"u"?self:typeof window<"u"?window:t!==void 0?t:{},e,r=!t.document&&!!t.postMessage,o=t.IS_PAPA_WORKER||!1,n={},a=0,s={};function l(w){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(x){var k=de(x);k.chunkSize=parseInt(k.chunkSize),x.step||x.chunk||(k.chunkSize=null),this._handle=new E(k),(this._handle.streamer=this)._config=k}.call(this,w),this.parseChunk=function(x,k){var j=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<j){let ie=this._config.newline;ie||(X=this._config.quoteChar||'"',ie=this._handle.guessLineEndings(x,X)),x=[...x.split(ie).slice(j)].join(ie)}this.isFirstChunk&&me(this._config.beforeFirstChunk)&&(X=this._config.beforeFirstChunk(x))!==void 0&&(x=X),this.isFirstChunk=!1,this._halted=!1;var j=this._partialLine+x,X=(this._partialLine="",this._handle.parse(j,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(x=X.meta.cursor,j=(this._finished||(this._partialLine=j.substring(x-this._baseIndex),this._baseIndex=x),X&&X.data&&(this._rowCount+=X.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)t.postMessage({results:X,workerId:s.WORKER_ID,finished:j});else if(me(this._config.chunk)&&!k){if(this._config.chunk(X,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=X=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(X.data),this._completeResults.errors=this._completeResults.errors.concat(X.errors),this._completeResults.meta=X.meta),this._completed||!j||!me(this._config.complete)||X&&X.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),j||X&&X.meta.paused||this._nextChunk(),X}this._halted=!0},this._sendError=function(x){me(this._config.error)?this._config.error(x):o&&this._config.error&&t.postMessage({workerId:s.WORKER_ID,error:x,finished:!1})}}function u(w){var x;(w=w||{}).chunkSize||(w.chunkSize=s.RemoteChunkSize),l.call(this,w),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(k){this._input=k,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(x=new XMLHttpRequest,this._config.withCredentials&&(x.withCredentials=this._config.withCredentials),r||(x.onload=be(this._chunkLoaded,this),x.onerror=be(this._chunkError,this)),x.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var k,j=this._config.downloadRequestHeaders;for(k in j)x.setRequestHeader(k,j[k])}var X;this._config.chunkSize&&(X=this._start+this._config.chunkSize-1,x.setRequestHeader("Range","bytes="+this._start+"-"+X));try{x.send(this._config.downloadRequestBody)}catch(ie){this._chunkError(ie.message)}r&&x.status===0&&this._chunkError()}},this._chunkLoaded=function(){x.readyState===4&&(x.status<200||400<=x.status?this._chunkError():(this._start+=this._config.chunkSize||x.responseText.length,this._finished=!this._config.chunkSize||this._start>=(k=>(k=k.getResponseHeader("Content-Range"))!==null?parseInt(k.substring(k.lastIndexOf("/")+1)):-1)(x),this.parseChunk(x.responseText)))},this._chunkError=function(k){k=x.statusText||k,this._sendError(new Error(k))}}function g(w){(w=w||{}).chunkSize||(w.chunkSize=s.LocalChunkSize),l.call(this,w);var x,k,j=typeof FileReader<"u";this.stream=function(X){this._input=X,k=X.slice||X.webkitSlice||X.mozSlice,j?((x=new FileReader).onload=be(this._chunkLoaded,this),x.onerror=be(this._chunkError,this)):x=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var X=this._input,ie=(this._config.chunkSize&&(ie=Math.min(this._start+this._config.chunkSize,this._input.size),X=k.call(X,this._start,ie)),x.readAsText(X,this._config.encoding));j||this._chunkLoaded({target:{result:ie}})},this._chunkLoaded=function(X){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(X.target.result)},this._chunkError=function(){this._sendError(x.error)}}function m(w){var x;l.call(this,w=w||{}),this.stream=function(k){return x=k,this._nextChunk()},this._nextChunk=function(){var k,j;if(!this._finished)return k=this._config.chunkSize,x=k?(j=x.substring(0,k),x.substring(k)):(j=x,""),this._finished=!x,this.parseChunk(j)}}function P(w){l.call(this,w=w||{});var x=[],k=!0,j=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(X){this._input=X,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){j&&x.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),x.length?this.parseChunk(x.shift()):k=!0},this._streamData=be(function(X){try{x.push(typeof X=="string"?X:X.toString(this._config.encoding)),k&&(k=!1,this._checkIsFinished(),this.parseChunk(x.shift()))}catch(ie){this._streamError(ie)}},this),this._streamError=be(function(X){this._streamCleanUp(),this._sendError(X)},this),this._streamEnd=be(function(){this._streamCleanUp(),j=!0,this._streamData("")},this),this._streamCleanUp=be(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function E(w){var x,k,j,X,ie=Math.pow(2,53),Ie=-ie,Je=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,tt=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,Se=this,Ue=0,ue=0,Ee=!1,Ce=!1,Pe=[],ne={data:[],errors:[],meta:{}};function L(H){return w.skipEmptyLines==="greedy"?H.join("").trim()==="":H.length===1&&H[0].length===0}function F(){if(ne&&j&&(z("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),j=!1),w.skipEmptyLines&&(ne.data=ne.data.filter(function(re){return!L(re)})),M()){let re=function(se,we){me(w.transformHeader)&&(se=w.transformHeader(se,we)),Pe.push(se)};var Q=re;if(ne)if(Array.isArray(ne.data[0])){for(var H=0;M()&&H<ne.data.length;H++)ne.data[H].forEach(re);ne.data.splice(0,1)}else ne.data.forEach(re)}function q(re,se){for(var we=w.header?{}:[],fe=0;fe<re.length;fe++){var ce=fe,Ae=re[fe],Ae=((K,ke)=>(Te=>(w.dynamicTypingFunction&&w.dynamicTyping[Te]===void 0&&(w.dynamicTyping[Te]=w.dynamicTypingFunction(Te)),(w.dynamicTyping[Te]||w.dynamicTyping)===!0))(K)?ke==="true"||ke==="TRUE"||ke!=="false"&&ke!=="FALSE"&&((Te=>{if(Je.test(Te)&&(Te=parseFloat(Te),Ie<Te&&Te<ie))return 1})(ke)?parseFloat(ke):tt.test(ke)?new Date(ke):ke===""?null:ke):ke)(ce=w.header?fe>=Pe.length?"__parsed_extra":Pe[fe]:ce,Ae=w.transform?w.transform(Ae,ce):Ae);ce==="__parsed_extra"?(we[ce]=we[ce]||[],we[ce].push(Ae)):we[ce]=Ae}return w.header&&(fe>Pe.length?z("FieldMismatch","TooManyFields","Too many fields: expected "+Pe.length+" fields but parsed "+fe,ue+se):fe<Pe.length&&z("FieldMismatch","TooFewFields","Too few fields: expected "+Pe.length+" fields but parsed "+fe,ue+se)),we}var ve;ne&&(w.header||w.dynamicTyping||w.transform)&&(ve=1,!ne.data.length||Array.isArray(ne.data[0])?(ne.data=ne.data.map(q),ve=ne.data.length):ne.data=q(ne.data,0),w.header&&ne.meta&&(ne.meta.fields=Pe),ue+=ve)}function M(){return w.header&&Pe.length===0}function z(H,q,ve,Q){H={type:H,code:q,message:ve},Q!==void 0&&(H.row=Q),ne.errors.push(H)}me(w.step)&&(X=w.step,w.step=function(H){ne=H,M()?F():(F(),ne.data.length!==0&&(Ue+=H.data.length,w.preview&&Ue>w.preview?k.abort():(ne.data=ne.data[0],X(ne,Se))))}),this.parse=function(H,q,ve){var Q=w.quoteChar||'"',Q=(w.newline||(w.newline=this.guessLineEndings(H,Q)),j=!1,w.delimiter?me(w.delimiter)&&(w.delimiter=w.delimiter(H),ne.meta.delimiter=w.delimiter):((Q=((re,se,we,fe,ce)=>{var Ae,K,ke,Te;ce=ce||[","," ","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var kt=0;kt<ce.length;kt++){for(var St,Ht=ce[kt],Ke=0,yt=0,Qe=0,ot=(ke=void 0,new te({comments:fe,delimiter:Ht,newline:se,preview:10}).parse(re)),Ge=0;Ge<ot.data.length;Ge++)we&&L(ot.data[Ge])?Qe++:(St=ot.data[Ge].length,yt+=St,ke===void 0?ke=St:0<St&&(Ke+=Math.abs(St-ke),ke=St));0<ot.data.length&&(yt/=ot.data.length-Qe),(K===void 0||Ke<=K)&&(Te===void 0||Te<yt)&&1.99<yt&&(K=Ke,Ae=Ht,Te=yt)}return{successful:!!(w.delimiter=Ae),bestDelimiter:Ae}})(H,w.newline,w.skipEmptyLines,w.comments,w.delimitersToGuess)).successful?w.delimiter=Q.bestDelimiter:(j=!0,w.delimiter=s.DefaultDelimiter),ne.meta.delimiter=w.delimiter),de(w));return w.preview&&w.header&&Q.preview++,x=H,k=new te(Q),ne=k.parse(x,q,ve),F(),Ee?{meta:{paused:!0}}:ne||{meta:{paused:!1}}},this.paused=function(){return Ee},this.pause=function(){Ee=!0,k.abort(),x=me(w.chunk)?"":x.substring(k.getCharIndex())},this.resume=function(){Se.streamer._halted?(Ee=!1,Se.streamer.parseChunk(x,!0)):setTimeout(Se.resume,3)},this.aborted=function(){return Ce},this.abort=function(){Ce=!0,k.abort(),ne.meta.aborted=!0,me(w.complete)&&w.complete(ne),x=""},this.guessLineEndings=function(re,Q){re=re.substring(0,1048576);var Q=new RegExp(O(Q)+"([^]*?)"+O(Q),"gm"),ve=(re=re.replace(Q,"")).split("\r"),Q=re.split(`
|
|
3
|
-
`),re=1<Q.length&&Q[0].length<ve[0].length;if(ve.length===1||re)return`
|
|
4
|
-
`;for(var se=0,we=0;we<ve.length;we++)ve[we][0]===`
|
|
5
|
-
`&&se++;return se>=ve.length/2?`\r
|
|
6
|
-
`:"\r"}}function O(w){return w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function te(w){var x=(w=w||{}).delimiter,k=w.newline,j=w.comments,X=w.step,ie=w.preview,Ie=w.fastMode,Je=null,tt=!1,Se=w.quoteChar==null?'"':w.quoteChar,Ue=Se;if(w.escapeChar!==void 0&&(Ue=w.escapeChar),(typeof x!="string"||-1<s.BAD_DELIMITERS.indexOf(x))&&(x=","),j===x)throw new Error("Comment character same as delimiter");j===!0?j="#":(typeof j!="string"||-1<s.BAD_DELIMITERS.indexOf(j))&&(j=!1),k!==`
|
|
7
|
-
`&&k!=="\r"&&k!==`\r
|
|
8
|
-
`&&(k=`
|
|
9
|
-
`);var ue=0,Ee=!1;this.parse=function(Ce,Pe,ne){if(typeof Ce!="string")throw new Error("Input must be a string");var L=Ce.length,F=x.length,M=k.length,z=j.length,H=me(X),q=[],ve=[],Q=[],re=ue=0;if(!Ce)return Ke();if(Ie||Ie!==!1&&Ce.indexOf(Se)===-1){for(var se=Ce.split(k),we=0;we<se.length;we++){if(Q=se[we],ue+=Q.length,we!==se.length-1)ue+=k.length;else if(ne)return Ke();if(!j||Q.substring(0,z)!==j){if(H){if(q=[],Te(Q.split(x)),yt(),Ee)return Ke()}else Te(Q.split(x));if(ie&&ie<=we)return q=q.slice(0,ie),Ke(!0)}}return Ke()}for(var fe=Ce.indexOf(x,ue),ce=Ce.indexOf(k,ue),Ae=new RegExp(O(Ue)+O(Se),"g"),K=Ce.indexOf(Se,ue);;)if(Ce[ue]===Se)for(K=ue,ue++;;){if((K=Ce.indexOf(Se,K+1))===-1)return ne||ve.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:q.length,index:ue}),St();if(K===L-1)return St(Ce.substring(ue,K).replace(Ae,Se));if(Se===Ue&&Ce[K+1]===Ue)K++;else if(Se===Ue||K===0||Ce[K-1]!==Ue){fe!==-1&&fe<K+1&&(fe=Ce.indexOf(x,K+1));var ke=kt((ce=ce!==-1&&ce<K+1?Ce.indexOf(k,K+1):ce)===-1?fe:Math.min(fe,ce));if(Ce.substr(K+1+ke,F)===x){Q.push(Ce.substring(ue,K).replace(Ae,Se)),Ce[ue=K+1+ke+F]!==Se&&(K=Ce.indexOf(Se,ue)),fe=Ce.indexOf(x,ue),ce=Ce.indexOf(k,ue);break}if(ke=kt(ce),Ce.substring(K+1+ke,K+1+ke+M)===k){if(Q.push(Ce.substring(ue,K).replace(Ae,Se)),Ht(K+1+ke+M),fe=Ce.indexOf(x,ue),K=Ce.indexOf(Se,ue),H&&(yt(),Ee))return Ke();if(ie&&q.length>=ie)return Ke(!0);break}ve.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:q.length,index:ue}),K++}}else if(j&&Q.length===0&&Ce.substring(ue,ue+z)===j){if(ce===-1)return Ke();ue=ce+M,ce=Ce.indexOf(k,ue),fe=Ce.indexOf(x,ue)}else if(fe!==-1&&(fe<ce||ce===-1))Q.push(Ce.substring(ue,fe)),ue=fe+F,fe=Ce.indexOf(x,ue);else{if(ce===-1)break;if(Q.push(Ce.substring(ue,ce)),Ht(ce+M),H&&(yt(),Ee))return Ke();if(ie&&q.length>=ie)return Ke(!0)}return St();function Te(Qe){q.push(Qe),re=ue}function kt(Qe){var ot=0;return ot=Qe!==-1&&(Qe=Ce.substring(K+1,Qe))&&Qe.trim()===""?Qe.length:ot}function St(Qe){return ne||(Qe===void 0&&(Qe=Ce.substring(ue)),Q.push(Qe),ue=L,Te(Q),H&&yt()),Ke()}function Ht(Qe){ue=Qe,Te(Q),Q=[],ce=Ce.indexOf(k,ue)}function Ke(Qe){if(w.header&&!Pe&&q.length&&!tt){var ot=q[0],Ge=Object.create(null),pt=new Set(ot);let mr=!1;for(let ni=0;ni<ot.length;ni++){let Ft=ot[ni];if(Ge[Ft=me(w.transformHeader)?w.transformHeader(Ft,ni):Ft]){let Ii,$r=Ge[Ft];for(;Ii=Ft+"_"+$r,$r++,pt.has(Ii););pt.add(Ii),ot[ni]=Ii,Ge[Ft]++,mr=!0,(Je=Je===null?{}:Je)[Ii]=Ft}else Ge[Ft]=1,ot[ni]=Ft;pt.add(Ft)}mr&&console.warn("Duplicate headers found and renamed."),tt=!0}return{data:q,errors:ve,meta:{delimiter:x,linebreak:k,aborted:Ee,truncated:!!Qe,cursor:re+(Pe||0),renamedHeaders:Je}}}function yt(){X(Ke()),q=[],ve=[]}},this.abort=function(){Ee=!0},this.getCharIndex=function(){return ue}}function ae(w){var x=w.data,k=n[x.workerId],j=!1;if(x.error)k.userError(x.error,x.file);else if(x.results&&x.results.data){var X={abort:function(){j=!0,oe(x.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:pe,resume:pe};if(me(k.userStep)){for(var ie=0;ie<x.results.data.length&&(k.userStep({data:x.results.data[ie],errors:x.results.errors,meta:x.results.meta},X),!j);ie++);delete x.results}else me(k.userChunk)&&(k.userChunk(x.results,X,x.file),delete x.results)}x.finished&&!j&&oe(x.workerId,x.results)}function oe(w,x){var k=n[w];me(k.userComplete)&&k.userComplete(x),k.terminate(),delete n[w]}function pe(){throw new Error("Not implemented.")}function de(w){if(typeof w!="object"||w===null)return w;var x,k=Array.isArray(w)?[]:{};for(x in w)k[x]=de(w[x]);return k}function be(w,x){return function(){w.apply(x,arguments)}}function me(w){return typeof w=="function"}return s.parse=function(w,x){var k=(x=x||{}).dynamicTyping||!1;if(me(k)&&(x.dynamicTypingFunction=k,k={}),x.dynamicTyping=k,x.transform=!!me(x.transform)&&x.transform,!x.worker||!s.WORKERS_SUPPORTED)return k=null,s.NODE_STREAM_INPUT,typeof w=="string"?(w=(j=>j.charCodeAt(0)!==65279?j:j.slice(1))(w),k=new(x.download?u:m)(x)):w.readable===!0&&me(w.read)&&me(w.on)?k=new P(x):(t.File&&w instanceof File||w instanceof Object)&&(k=new g(x)),k.stream(w);(k=(()=>{var j;return!!s.WORKERS_SUPPORTED&&(j=(()=>{var X=t.URL||t.webkitURL||null,ie=i.toString();return s.BLOB_URL||(s.BLOB_URL=X.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",ie,")();"],{type:"text/javascript"})))})(),(j=new t.Worker(j)).onmessage=ae,j.id=a++,n[j.id]=j)})()).userStep=x.step,k.userChunk=x.chunk,k.userComplete=x.complete,k.userError=x.error,x.step=me(x.step),x.chunk=me(x.chunk),x.complete=me(x.complete),x.error=me(x.error),delete x.worker,k.postMessage({input:w,config:x,workerId:k.id})},s.unparse=function(w,x){var k=!1,j=!0,X=",",ie=`\r
|
|
10
|
-
`,Ie='"',Je=Ie+Ie,tt=!1,Se=null,Ue=!1,ue=((()=>{if(typeof x=="object"){if(typeof x.delimiter!="string"||s.BAD_DELIMITERS.filter(function(Pe){return x.delimiter.indexOf(Pe)!==-1}).length||(X=x.delimiter),typeof x.quotes!="boolean"&&typeof x.quotes!="function"&&!Array.isArray(x.quotes)||(k=x.quotes),typeof x.skipEmptyLines!="boolean"&&typeof x.skipEmptyLines!="string"||(tt=x.skipEmptyLines),typeof x.newline=="string"&&(ie=x.newline),typeof x.quoteChar=="string"&&(Ie=x.quoteChar),typeof x.header=="boolean"&&(j=x.header),Array.isArray(x.columns)){if(x.columns.length===0)throw new Error("Option columns is empty");Se=x.columns}x.escapeChar!==void 0&&(Je=x.escapeChar+Ie),x.escapeFormulae instanceof RegExp?Ue=x.escapeFormulae:typeof x.escapeFormulae=="boolean"&&x.escapeFormulae&&(Ue=/^[=+\-@\t\r].*$/)}})(),new RegExp(O(Ie),"g"));if(typeof w=="string"&&(w=JSON.parse(w)),Array.isArray(w)){if(!w.length||Array.isArray(w[0]))return Ee(null,w,tt);if(typeof w[0]=="object")return Ee(Se||Object.keys(w[0]),w,tt)}else if(typeof w=="object")return typeof w.data=="string"&&(w.data=JSON.parse(w.data)),Array.isArray(w.data)&&(w.fields||(w.fields=w.meta&&w.meta.fields||Se),w.fields||(w.fields=Array.isArray(w.data[0])?w.fields:typeof w.data[0]=="object"?Object.keys(w.data[0]):[]),Array.isArray(w.data[0])||typeof w.data[0]=="object"||(w.data=[w.data])),Ee(w.fields||[],w.data||[],tt);throw new Error("Unable to serialize unrecognized input");function Ee(Pe,ne,L){var F="",M=(typeof Pe=="string"&&(Pe=JSON.parse(Pe)),typeof ne=="string"&&(ne=JSON.parse(ne)),Array.isArray(Pe)&&0<Pe.length),z=!Array.isArray(ne[0]);if(M&&j){for(var H=0;H<Pe.length;H++)0<H&&(F+=X),F+=Ce(Pe[H],H);0<ne.length&&(F+=ie)}for(var q=0;q<ne.length;q++){var ve=(M?Pe:ne[q]).length,Q=!1,re=M?Object.keys(ne[q]).length===0:ne[q].length===0;if(L&&!M&&(Q=L==="greedy"?ne[q].join("").trim()==="":ne[q].length===1&&ne[q][0].length===0),L==="greedy"&&M){for(var se=[],we=0;we<ve;we++){var fe=z?Pe[we]:we;se.push(ne[q][fe])}Q=se.join("").trim()===""}if(!Q){for(var ce=0;ce<ve;ce++){0<ce&&!re&&(F+=X);var Ae=M&&z?Pe[ce]:ce;F+=Ce(ne[q][Ae],ce)}q<ne.length-1&&(!L||0<ve&&!re)&&(F+=ie)}}return F}function Ce(Pe,ne){var L,F;return Pe==null?"":Pe.constructor===Date?JSON.stringify(Pe).slice(1,25):(F=!1,Ue&&typeof Pe=="string"&&Ue.test(Pe)&&(Pe="'"+Pe,F=!0),L=Pe.toString().replace(ue,Je),(F=F||k===!0||typeof k=="function"&&k(Pe,ne)||Array.isArray(k)&&k[ne]||((M,z)=>{for(var H=0;H<z.length;H++)if(-1<M.indexOf(z[H]))return!0;return!1})(L,s.BAD_DELIMITERS)||-1<L.indexOf(X)||L.charAt(0)===" "||L.charAt(L.length-1)===" ")?Ie+L+Ie:L)}},s.RECORD_SEP="",s.UNIT_SEP="",s.BYTE_ORDER_MARK="\uFEFF",s.BAD_DELIMITERS=["\r",`
|
|
11
|
-
`,'"',s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!r&&!!t.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=",",s.Parser=te,s.ParserHandle=E,s.NetworkStreamer=u,s.FileStreamer=g,s.StringStreamer=m,s.ReadableStreamStreamer=P,t.jQuery&&((e=t.jQuery).fn.parse=function(w){var x=w.config||{},k=[];return this.each(function(ie){if(!(e(this).prop("tagName").toUpperCase()==="INPUT"&&e(this).attr("type").toLowerCase()==="file"&&t.FileReader)||!this.files||this.files.length===0)return!0;for(var Ie=0;Ie<this.files.length;Ie++)k.push({file:this.files[Ie],inputElem:this,instanceConfig:e.extend({},x)})}),j(),this;function j(){if(k.length===0)me(w.complete)&&w.complete();else{var ie,Ie,Je,tt,Se=k[0];if(me(w.before)){var Ue=w.before(Se.file,Se.inputElem);if(typeof Ue=="object"){if(Ue.action==="abort")return ie="AbortError",Ie=Se.file,Je=Se.inputElem,tt=Ue.reason,void(me(w.error)&&w.error({name:ie},Ie,Je,tt));if(Ue.action==="skip")return void X();typeof Ue.config=="object"&&(Se.instanceConfig=e.extend(Se.instanceConfig,Ue.config))}else if(Ue==="skip")return void X()}var ue=Se.instanceConfig.complete;Se.instanceConfig.complete=function(Ee){me(ue)&&ue(Ee,Se.file,Se.inputElem),X()},s.parse(Se.file,Se.instanceConfig)}}function X(){k.splice(0,1),j()}}),o&&(t.onmessage=function(w){w=w.data,s.WORKER_ID===void 0&&w&&(s.WORKER_ID=w.workerId),typeof w.input=="string"?t.postMessage({workerId:s.WORKER_ID,results:s.parse(w.input,w.config),finished:!0}):(t.File&&w.input instanceof File||w.input instanceof Object)&&(w=s.parse(w.input,w.config))&&t.postMessage({workerId:s.WORKER_ID,results:w,finished:!0})}),(u.prototype=Object.create(l.prototype)).constructor=u,(g.prototype=Object.create(l.prototype)).constructor=g,(m.prototype=Object.create(m.prototype)).constructor=m,(P.prototype=Object.create(l.prototype)).constructor=P,s})});var gg={filter:{transID:"",bulkID:"",rowCount:20,pageNumber:1,orderByDesc:!1,sortByDate:!1,auditEditor:!1,listOutletID:[],searchAudit:!1,number:"",from:new Date().toISOString(),to:""},data:[],count:0,metadata:{filter:{transID:"",bulkID:"",rowCount:20,pageNumber:1,orderByDesc:!1,sortByDate:!1,auditEditor:!1,listOutletID:[],searchAudit:!1,number:"",from:"",to:""},options:{outlets:[],sortBy:[],orderBy:[]},roles:{hasAccountingClosingEditor:!1,hasAccountingCreate:!1,hasAccountingEditor:!1,hasAccountingDelete:!1}}},vl=Eu(Tu(gg),Bu("JournalEntryStore"),Pu(i=>({first:Mt(()=>(i.filter().pageNumber-1)*i.filter().rowCount+1),end:Mt(()=>Math.min(i.filter().pageNumber*i.filter().rowCount,i.count())),selectedItems:Mt(()=>i.data().filter(t=>t.checked))})),Fu(i=>{let t=he(xt),e={updateCount(r){Mo(i,o=>U(_({},o),{count:r}))},updateFilter(r){Mo(i,o=>U(_({},o),{filter:_(_({},o.filter),r),metadata:U(_({},o.metadata),{paginator:!1})}))},loadJournalEntryLoader:yl(nl(Yr(()=>t.getJournalEntryLoader().pipe(bl({next:r=>{console.log("response",r),Mo(i,o=>U(_({},o),{filter:U(_({},r.filter),{pageNumber:1}),metadata:r})),e.loadJournalEntryData(i.filter),console.log("store",i)},error(r){console.log("error",r)}}))))),loadJournalEntryData:yl(nl(Ta(r=>!!r),Yr(r=>t.getJournalEntryData(r).pipe(pi(o=>U(_({},o),{data:o.data.map(n=>U(_({},n),{checked:!1}))})),Ud(o=>t.getJournalEntryCount(r).pipe(pi(n=>({journalEntry:o,count:n})))),bl({next({journalEntry:o,count:n}){Mo(i,a=>U(_({},a),{data:o.data,count:n.count}))},error(o){console.log("error",o)}}),at("getJournalEntryData"))))),updateData:r=>{Mo(i,o=>U(_({},o),{data:r}))}};return e}),ku({onInit(i){i.loadJournalEntryLoader()}}));var yg=["dt"],bg=["filterRef"],vg=["class","page"],wg=()=>({height:"calc(100vh - 70px)"}),_g=i=>[i],xg=i=>({id:i});function Cg(i,t){if(i&1){let e=Re();y(0,"p-button",18),De("onClick",function(){ge(e);let o=W(2);return ye(o.onDeleteJournalEntry())}),f()}}function Sg(i,t){if(i&1){let e=Re();y(0,"div",10),le(1,Cg,1,0,"p-button",11),y(2,"a",12),Z(3,"i",13),y(4,"span",14),D(5,"Import"),f()(),y(6,"p-button",15),De("onClick",function(){ge(e);let o=W();return ye(o.onExportJournalEntry())}),f(),y(7,"a",16),Z(8,"i",17),y(9,"span"),D(10,"Add"),f()()()}if(i&2){let e=W();I(),T("ngIf",e.JournalEntryStore.selectedItems().length>0)}}function Dg(i,t){i&1&&(y(0,"tr")(1,"th",20),Z(2,"p-tableHeaderCheckbox"),f(),y(3,"th"),D(4,"Outlet"),f(),y(5,"th"),D(6,"Number"),f(),y(7,"th"),D(8,"Date/Name"),f(),y(9,"th"),D(10,"Description"),f(),y(11,"th"),D(12,"Account"),f(),y(13,"th",21),D(14,"Debit"),f(),y(15,"th",21),D(16,"Credit"),f()())}function Ig(i,t){if(i&1&&(y(0,"div")(1,"a",27)(2,"span",28),D(3),f(),D(4),f()()),i&2){let e=t.$implicit;I(),T("queryParams",Bt(4,xg,e.accountID)),I(),T("pTooltip",e.accountName+" ("+e.accountCode+")"),I(),Oe(e.accountName),I(),Ne(" (",e.accountCode,")")}}function Eg(i,t){if(i&1&&(y(0,"span"),D(1),ut(2,"number"),f()),i&2){let e=W().$implicit;I(),Oe(wt(2,1,e.debitAmount))}}function Pg(i,t){i&1&&(y(0,"span",29),D(1,'""'),f())}function kg(i,t){if(i&1&&le(0,Eg,3,3,"span")(1,Pg,2,0,"span",29),i&2){let e=t.$implicit;Qr(e.debitAmount>0?0:1)}}function Fg(i,t){if(i&1&&(y(0,"span"),D(1),ut(2,"number"),f()),i&2){let e=W().$implicit;I(),Oe(wt(2,1,e.creditAmount))}}function Tg(i,t){i&1&&(y(0,"span",29),D(1,'""'),f())}function Bg(i,t){if(i&1&&le(0,Fg,3,3,"span")(1,Tg,2,0,"span",29),i&2){let e=t.$implicit;Qr(e.creditAmount>0?0:1)}}function Ag(i,t){if(i&1&&(y(0,"tr")(1,"td"),Z(2,"p-tableCheckbox",22),f(),y(3,"td"),D(4),f(),y(5,"td")(6,"a",23),D(7),f()(),y(8,"td"),D(9),ut(10,"date"),f(),y(11,"td")(12,"a",24),D(13),f()(),y(14,"td")(15,"div",25),Ai(16,Ig,5,6,"div",null,Bi),f()(),y(18,"td")(19,"div",26),Ai(20,kg,2,1,null,null,Bi),f()(),y(22,"td")(23,"div",26),Ai(24,Bg,2,1,null,null,Bi),f()()()),i&2){let e=t.$implicit,r=W(2);I(2),T("value",e),I(2),Oe(e.outletName),I(2),T("routerLink",Bt(10,_g,e.id)),I(),Oe(e.number),I(2),Oe(Oa(10,7,e.date,"dd MMM y")),I(3),T("href",r.authService.getTenantExternalURL()+r.getReferenceUrl(e),xr),I(),Oe(e.note),I(3),Ri(e.items),I(4),Ri(e.items),I(4),Ri(e.items)}}function Rg(i,t){if(i&1&&D(0),i&2){let e=W(2);ru(" Showing ",e.JournalEntryStore.first()," to ",e.JournalEntryStore.end()," of ",e.JournalEntryStore.count()," entries ")}}function Og(i,t){i&1&&(y(0,"tr")(1,"td",30)(2,"span"),D(3," No journal entries found. "),f()()())}function Mg(i,t){if(i&1){let e=Re();y(0,"p-panel")(1,"p-table",19,3),De("onPage",function(o){ge(e);let n=W();return ye(n.onPageChange(o))})("onRowSelect",function(o){ge(e);let n=W();return ye(n.onRowSelect(o))})("onRowUnselect",function(o){ge(e);let n=W();return ye(n.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){ge(e);let n=W();return ye(n.onHeaderCheckboxToggle(o))}),le(3,Dg,17,0,"ng-template",null,4,_e)(5,Ag,26,12,"ng-template",null,5,_e)(7,Rg,1,3,"ng-template",null,6,_e)(9,Og,4,0,"ng-template",null,7,_e),f()()}if(i&2){let e=W();Ot(qe(10,wg)),I(),T("resizableColumns",!0)("value",e.JournalEntryStore.data())("paginator",!0)("totalRecords",e.JournalEntryStore.count())("lazy",!0)("rows",e.JournalEntryStore.filter().rowCount)("scrollable",!0)("scrollHeight","calc(100vh - 142px)")}}function zg(i,t){if(i&1&&(y(0,"div",40)(1,"div"),D(2),f()()),i&2){let e=t.$implicit;I(2),Oe(e.name)}}function Ng(i,t){if(i&1&&(y(0,"div",39)(1,"div",41),Z(2,"p-radiobutton",42),y(3,"label",43),D(4),f()()()),i&2){let e=t.$implicit;I(2),T("value",e.key)("inputId",e.value),I(),T("for",e.value),I(),Oe(e.value)}}function Lg(i,t){if(i&1&&(y(0,"div",39)(1,"div",41),Z(2,"p-radiobutton",44),y(3,"label",43),D(4),f()()()),i&2){let e=t.$implicit;I(2),T("value",e.key)("inputId",e.value),I(),T("for",e.value),I(),Oe(e.value)}}function Ug(i,t){if(i&1&&(y(0,"form",32)(1,"div",25)(2,"label",33),D(3,"Outlet"),f(),y(4,"p-multiselect",34),le(5,zg,3,1,"ng-template",null,8,_e),f()(),y(7,"div",25)(8,"label",33),D(9,"From"),f(),Z(10,"p-datepicker",35),f(),y(11,"div",25)(12,"label",33),D(13,"To"),f(),Z(14,"p-datepicker",36),f(),y(15,"div",25)(16,"label",33),D(17,"Page Size"),f(),Z(18,"input",37),f(),y(19,"div",25)(20,"label",33),D(21,"Order By Date"),f(),y(22,"div",38),Ai(23,Ng,5,4,"div",39,Bi),f()(),y(25,"div",25)(26,"label",33),D(27,"Order By"),f(),y(28,"div",38),Ai(29,Lg,5,4,"div",39,Bi),f()()()),i&2){let e,r=W(2);T("formGroup",r.filterForm),I(4),T("virtualScroll",!0)("virtualScrollItemSize",50)("options",r.JournalEntryStore==null||(e=r.JournalEntryStore.metadata())==null||e.options==null?null:e.options.outlets)("showClear",!0),I(6),T("iconDisplay","input")("showIcon",!0),I(4),T("iconDisplay","input")("showIcon",!0),I(9),Ri(r.JournalEntryStore.metadata().options.sortBy),I(6),Ri(r.JournalEntryStore.metadata().options.orderBy)}}function jg(i,t){if(i&1&&le(0,Ug,31,9,"form",31),i&2){let e=W();T("ngIf",e.JournalEntryStore.metadata()&&e.filterForm)}}var Gu=(()=>{class i{constructor(){this.JournalEntryStore=he(vl),this.authService=he(Na),this.modalService=he(ja),this.journalEntryService=he(xt),this.fb=he(Ua),this.dayjs=he(Wu),this.isDialogFilterVisible=Ze(!1),ir(()=>{this.JournalEntryStore.filter()&&this.generateFilterForm()})}ngOnInit(){console.log("Journal Entry Page")}onSearch(e){this.JournalEntryStore.updateFilter(U(_({},this.JournalEntryStore.filter()),{number:e}))}onFilterOKEvent(){let e=this.filterForm.getRawValue();this.JournalEntryStore.updateFilter(U(_({},this.JournalEntryStore.filter()),{from:e.from?this.dayjs.from(e.from).format():null,to:e.to?this.dayjs.from(e.to).format():null,pageNumber:1,rowCount:+e.rowCount,orderByDesc:e.orderByDesc,sortByDate:e.sortByDate,listOutletID:e.listOutletID})),this.isDialogFilterVisible.update(r=>!r)}generateFilterForm(){let e=this.JournalEntryStore.filter();this.filterForm=this.fb.group({from:[e.from?this.dayjs.from(e.from).toDate():null],to:[e.to?this.dayjs.from(e.to).toDate():null],rowCount:[e.rowCount],sortByDate:[e.sortByDate],orderByDesc:[e.orderByDesc],listOutletID:[e.listOutletID]})}onFilterChange(e){console.log("Filter Change",e),this.modalService.open(this.templateRef)}onRowSelect(e){this.updateRowSelection(e.data,!0)}onRowUnselect(e){Array.isArray(e.data)?this.JournalEntryStore.updateData(this.JournalEntryStore.data().map((r,o)=>r.id===e.data[o].id?U(_({},r),{checked:!1}):r)):e.data&&typeof e.data=="object"&&"id"in e.data&&this.JournalEntryStore.updateData(this.JournalEntryStore.data().map(r=>r.id===e.data.id?U(_({},r),{checked:!1}):r))}updateRowSelection(e,r){this.JournalEntryStore.updateData(this.JournalEntryStore.data().map(o=>o.id===e.id?U(_({},o),{checked:r}):o))}onHeaderCheckboxToggle(e){let r=this.JournalEntryStore.data().map(o=>U(_({},o),{checked:e.checked}));this.JournalEntryStore.updateData(r)}onPageChange(e){let r=e.first/e.rows;this.JournalEntryStore.updateFilter(U(_({},this.JournalEntryStore.filter()),{pageNumber:r+1}))}next(){this.JournalEntryStore.updateFilter(U(_({},this.JournalEntryStore.filter()),{pageNumber:this.JournalEntryStore.filter().pageNumber+1}))}prev(){this.JournalEntryStore.filter().pageNumber<=1||this.JournalEntryStore.updateFilter(U(_({},this.JournalEntryStore.filter()),{pageNumber:this.JournalEntryStore.filter().pageNumber-1}))}getJournalEntryCount(){this.journalEntryService.getJournalEntryCount(this.JournalEntryStore.filter()).pipe(We(e=>this.JournalEntryStore.updateCount(e.count))).subscribe()}onDeleteJournalEntry(){if(!confirm("Are you sure you want to delete the selected journal entries?"))return;let o=this.JournalEntryStore.selectedItems().map(n=>n.id);this.journalEntryService.deleteJournalEntry(o).pipe(We(()=>{this.JournalEntryStore.loadJournalEntryData(this.JournalEntryStore.filter())})).subscribe()}onExportJournalEntry(){let e=U(_({},this.JournalEntryStore.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.journalEntryService.getJournalEntryData(e,{responseType:"blob"}).pipe(at("Export Journal Entry"),We(r=>{let o=r.type,n=[r],a=document.createElement("a");a.href=window.URL.createObjectURL(new Blob(n,{type:o}));let s=`journal-entries.${o.split("/")[1]}`;a.setAttribute("download",s),document.body.appendChild(a),a.click(),document.body.removeChild(a)})).subscribe()}getReferenceUrl(e){let r;switch(e.referenceTypeID){case 1:r=`/menu/Orders/Orders/Customer_Invoice/Info?ID=${e.id}`;break;case 5:r=`/menu/Logistics/Archive/Outbound_Logistics/Info?ID=${e.id}`;break;default:console.warn("Unknown reference type ID:",e.referenceTypeID)}return r}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=mt({type:i,selectors:[["app-journal-entry",8,"page"]],viewQuery:function(r,o){if(r&1&&(vi(yg,5),vi(bg,7)),r&2){let n;wi(n=_i())&&(o.table=n.first),wi(n=_i())&&(o.templateRef=n.first)}},features:[Cr([vl])],attrs:vg,decls:7,vars:3,consts:[["actionButton",""],["content",""],["filters",""],["dt",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Manual Journal",3,"search","isDialogFilterVisibleChange","filterConfirmed","isSearchableInput","isFilterable","isDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","import",1,"p-button","p-button-outlined","p-button-secondary"],[1,"fa-solid","fa-upload"],[1,"fw-semibold","fs-3"],["severity","secondary","label","Export","icon","fa-solid fa-download","variant","outlined",3,"onClick"],["type","button","routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["columnResizeMode","expand","dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","resizableColumns","value","paginator","totalRecords","lazy","rows","scrollable","scrollHeight"],[2,"width","40px"],[1,"text-end",2,"width","120px"],[3,"value"],[1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],[1,"d-flex","flex-column"],[1,"d-flex","flex-column","align-items-end"],["routerLink","/report/general-ledger",1,"link","link-primary",3,"queryParams"],["tooltipPosition","top",1,"text-truncate",2,"max-width","130px",3,"pTooltip"],[2,"color","transparent"],["colspan","8"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],["for","outlet"],["display","chip","formControlName","listOutletID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["type","text","pInputText","","formControlName","rowCount"],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex"],[1,"flex","items-center","gap-2"],[1,"d-flex","align-items-baseline","gap-2"],["name","sortByDate","formControlName","sortByDate",3,"value","inputId"],[1,"",3,"for"],["name","orderByDesc","formControlName","orderByDesc",3,"value","inputId"]],template:function(r,o){if(r&1){let n=Re();y(0,"app-main-panel",9),De("search",function(s){return ge(n),ye(o.onSearch(s))}),au("isDialogFilterVisibleChange",function(s){return ge(n),nu(o.isDialogFilterVisible,s)||(o.isDialogFilterVisible=s),ye(s)}),De("filterConfirmed",function(){return ge(n),ye(o.onFilterOKEvent())}),le(1,Sg,11,1,"ng-template",null,0,_e)(3,Mg,11,11,"ng-template",null,1,_e)(5,jg,1,1,"ng-template",null,2,_e),f()}r&2&&(T("isSearchableInput",!0)("isFilterable",!0),ou("isDialogFilterVisible",o.isDialogFilterVisible))},dependencies:[ci,Wt,di,Oi,Ma,Uu,bu,Li,Ni,qi,Wi,Nu,Lu,Hi,ui,$i,Vu,ju,Or,Rr,Mu,Ou,Tr,yu,Ir,Er,Pr,kr,Fr,Vi,ji,Uo,Lo,Ar,Br,Ji],encapsulation:2,changeDetection:0})}}return i})();var _d=je(Ga());var Cl=je(Ga()),Xu=i=>(0,Cl.default)(i).isSame((0,Cl.default)("0001-01-01T00:00:00"));var Sl={accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec",DateEditor:"ActDE"}};var Za=(()=>{class i{constructor(){this._roles=[],this.authService=he(Na),this.assignRolesFromJWT()}parseJWT(e){let o=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(o).split("").map(function(a){return"%"+("00"+a.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(n)}assignRolesFromJWT(){let e=localStorage.getItem("AUTH_TOKEN");if(!e){this.authService.logout();return}try{let r=this.parseJWT(e);if(this.authService.isTokenExpired()){this.authService.logout();return}this._roles=r["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]||[]}catch(r){this._roles=[],console.error("Failed to parse JWT:",r),this.authService.logout()}}isUserHasRole(e){return this._roles.includes(e)}setBulkRole(e){let r={};for(let o in Sl[e])r[o]=this.isUserHasRole(Sl[e][o]);return r}get accounting(){return this._accounting||(this._accounting=this.setBulkRole("accounting")),this._accounting}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275prov=tr({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Yu=(()=>{class i{constructor(){this.subject$=new bi}onFileLoad(e){let o=e.target.result,n=!1,a=[],s=[],l=0;for(let u of o.split(/[\r\n]+/))if(n){let g={};for(let m=0;m<l;m++)g[s[m]]=u.split(",")[m];a.push(g)}else{for(let g=0;g<u.split(",").length;g++)l=u.split(",").length,s.push(u.split(",")[g].replace(/ /g,""));n=!0}return a.splice(-1),a}convertFile(e){let r=e,o=new FileReader;return o.onload=n=>{let a=this.onFileLoad(n);this.subject$.next(a)},o.readAsText(r,"UTF-8"),this.subject$.asObservable()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275prov=tr({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ku=(()=>{class i{constructor(e,r,o){this.http=e,this.toastr=r,this.router=o}PostToUrlEncode(e,r,o=1e5){let n=new Mi;return n=n.set("Content-Type","application/x-www-form-urlencoded"),new Fi(a=>{this.http.post(e,r,{headers:n}).pipe(Ti(o)).subscribe(s=>{a.next(s),a.complete()})})}GetText(e=1e5){let r=localStorage.getItem("Token"),n={responseType:"text",headers:new Mi({Authorization:"Bearer "+r})};return new Fi(a=>{this.http.get("/API/Token/GetZendeskJWT",n).pipe(Ti(e)).subscribe(s=>{a.next(s),a.complete()})})}POSText(e,r,o=1e5){let n=localStorage.getItem("Token"),s={responseType:"text",headers:new Mi({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+n})};return new Fi(l=>{this.http.post(e,r,s).pipe(Ti(o)).subscribe(u=>{l.next(u),l.complete()})})}get(e){let r=localStorage.getItem("Token"),o=new Mi({"Content-Type":"application/json","Cache-Control":"no-cache"});r&&(o=o.append("Authorization","Bearer "+r));let n={headers:o};return this.http.get(e,n).pipe(wr(a=>{if(!this.unauthorizedErrorHandling(a)){let l=this.errorMessageHandling(a);this.toastr.error(l.Message!=""?l.Message:"An unknown error has occured!",l.header),this.paymentErrorHandling(a)}return vr(()=>a)}))}getNews(e){return this.http.get(e)}paymentErrorHandling(e){e.status==402&&this.router.navigate(["/menu/Profile/Main/My_Subscription"])}post(e,r,o=1e5){return new Fi(n=>{let a=localStorage.getItem("Token"),s=new Mi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s};Date.prototype.toJSON=function(){return this.getFullYear()+"-"+u(this.getMonth()+1)+"-"+u(this.getDate())+"T"+u(this.getHours())+":"+u(this.getMinutes())+":"+u(this.getSeconds())+".000"};function u(g){return g<10?"0"+g:g}this.http.post(e,r,l).pipe(Ti(o)).subscribe({next:g=>{n.next(g),n.complete()},error:g=>{if(g.status==200)n.next(g.error.text),n.complete();else{if(!this.unauthorizedErrorHandling(g)){let P=this.errorMessageHandling(g);this.toastr.error(P.Message!=""?P.Message:"An unknown error has occured!",P.header,{enableHtml:!0})}n.error(g)}}})})}postFile(e,r,o=1e5){return new Fi(n=>{let a=localStorage.getItem("Token"),s=new Mi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a)),this.http.post(e,r,{headers:s,observe:"response",responseType:"blob"}).pipe(Ti(o)).subscribe({next:l=>{n.next({title:l.headers.get("Content-Disposition"),file:l.body}),n.complete()},error:l=>{if(l.headers.get("Content-Type")==="application/json; charset=utf-8"){let u=new FileReader;u.addEventListener("loadend",g=>{let m=JSON.parse(g.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(l)){let E=this.errorMessageHandling(l);this.toastr.error(m??"An unknown error has occured!",E.header,{enableHtml:!0})}}),u.readAsText(l.error)}n.error(l)}})})}put(e,r,o=1e5){return new Fi(n=>{let a=localStorage.getItem("Token"),s=new Mi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s};this.http.put(e,r,l).pipe(Ti(o)).subscribe({next:u=>{n.next(u),n.complete()},error:u=>{if(u.status==200)n.next(u.error.text),n.complete();else{if(!this.unauthorizedErrorHandling(u)){let m=this.errorMessageHandling(u);this.toastr.error(m.Message!=""?m.Message:"An unknown error has occured!",m.header)}n.error(u)}}})})}delete(e,r,o=1e5){return new Fi(n=>{let a=localStorage.getItem("Token"),s=new Mi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s,body:r};this.http.delete(e,l).pipe(Ti(o)).subscribe({next:u=>{n.next(u),n.complete()},error:u=>{if(u.status==200)n.next(u.error.text),n.complete();else{if(!this.unauthorizedErrorHandling(u)){let m=this.errorMessageHandling(u);this.toastr.error(m.Message!=""?m.Message:"An unknown error has occured!",m.header)}n.error(u)}}})})}unauthorizedErrorHandling(e){let r=!1;return(e.status==401||e.status==403)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",r=!0),r}errorMessageHandling(e){let r="API Error",o="Exception Message";return e.error?(r="API Error - "+e.status,e.status==451&&(r="Error"),e.error&&(o=e.error.Message)):e.Message&&(r="API Error - "+e.name,o=e.Message),{header:r,Message:o}}postFormDataWithoutBearer(e,r){return new Fi(o=>{this.http.post(e,r).pipe(Ti(1e5)).subscribe({next:n=>{o.next(n),o.complete()},error:n=>{n.status==200&&(o.next(n.error.text),o.complete()),o.error(n)}})})}postFormData(e,r,o=!0){return new Fi(n=>{let a=localStorage.getItem("Token"),l={headers:new Mi({Authorization:"Bearer "+a})};this.http.post(e,r,l).pipe(Ti(1e5)).subscribe({next:u=>{n.next(u),n.complete()},error:u=>{if(u.status==200)n.next(u.error.text),n.complete();else{if(!this.unauthorizedErrorHandling(u)&&o){let m=this.errorMessageHandling(u);this.toastr.error(m.Message!=""?m.Message:"An unknown error has occured!",m.header)}n.error(u)}}})})}static{this.\u0275fac=function(r){return new(r||i)(_r(fu),_r(Dr),_r(zi))}}static{this.\u0275prov=tr({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function es(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var Vg=0;function Zu(i){return"__private_"+Vg+++"_"+i}function Hg(i,t,e){let r=[];return i.forEach(o=>typeof o!="string"?r.push(o):t[Symbol.split](o).forEach((n,a,s)=>{n!==""&&r.push(n),a<s.length-1&&r.push(e)})),r}function Qu(i,t){let e=/\$/g,r="$$$$",o=[i];if(t==null)return o;for(let n of Object.keys(t))if(n!=="_"){let a=t[n];typeof a=="string"&&(a=e[Symbol.replace](a,r)),o=Hg(o,new RegExp(`%\\{${n}\\}`,"g"),a)}return o}var $g=i=>{throw new Error(`missing string: ${i}`)},_n=Zu("onMissingKey"),xn=Zu("apply"),Jo=class{constructor(t,e){let{onMissingKey:r=$g}=e===void 0?{}:e;Object.defineProperty(this,xn,{value:Wg}),Object.defineProperty(this,_n,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(o){return o===1?0:1}},Array.isArray(t)?t.forEach(es(this,xn)[xn],this):es(this,xn)[xn](t),es(this,_n)[_n]=r}translate(t,e){return this.translateArray(t,e).join("")}translateArray(t,e){let r=this.locale.strings[t];if(r==null&&(es(this,_n)[_n](t),r=t),typeof r=="object"){if(e&&typeof e.smart_count<"u"){let n=this.locale.pluralize(e.smart_count);return Qu(r[n],e)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return Qu(r,e)}};function Wg(i){if(!(i!=null&&i.strings))return;let t=this.locale;Object.assign(this.locale,{strings:_(_({},t.strings),i.strings),pluralize:i.pluralize||t.pluralize})}var Kc=je(tc(),1);var qg="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var ic=(i=21)=>{let t="",e=i|0;for(;e--;)t+=qg[Math.random()*64|0];return t};var Qc=je(Oc(),1);function is(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var L0=0;function Mc(i){return"__private_"+L0+++"_"+i}var U0={version:"4.2.0"},Zr=Mc("callbacks"),kl=Mc("publish"),rs=class{constructor(){Object.defineProperty(this,kl,{value:j0}),this.state={},Object.defineProperty(this,Zr,{writable:!0,value:new Set})}getState(){return this.state}setState(t){let e=_({},this.state),r=_(_({},this.state),t);this.state=r,is(this,kl)[kl](e,r,t)}subscribe(t){return is(this,Zr)[Zr].add(t),()=>{is(this,Zr)[Zr].delete(t)}}};function j0(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];is(this,Zr)[Zr].forEach(r=>{r(...t)})}rs.VERSION=U0.version;var zc=rs;function Gi(i){let t=i.lastIndexOf(".");return t===-1||t===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,t),extension:i.slice(t+1)}}var Fl={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Sn(i){var t;if(i.type)return i.type;let e=i.name?(t=Gi(i.name).extension)==null?void 0:t.toLowerCase():null;return e&&e in Fl?Fl[e]:"application/octet-stream"}function V0(i){return i.charCodeAt(0).toString(32)}function Nc(i){let t="";return i.replace(/[^A-Z0-9]/gi,e=>(t+=`-${V0(e)}`,"/"))+t}function Lc(i,t){let e=t||"uppy";return typeof i.name=="string"&&(e+=`-${Nc(i.name.toLowerCase())}`),i.type!==void 0&&(e+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(e+=`-${Nc(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(e+=`-${i.data.size}`),i.data.lastModified!==void 0&&(e+=`-${i.data.lastModified}`),e}function H0(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function os(i,t){if(H0(i))return i.id;let e=Sn(i);return Lc(U(_({},i),{type:e}),t)}function Tl(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let t=/Edge\/(\d+\.\d+)/.exec(i);if(!t)return!0;let r=t[1].split(".",2),o=parseInt(r[0],10),n=parseInt(r[1],10);return o<15||o===15&&n<15063||o>18||o===18&&n>=18218}function Bl(i,t){return t.name?t.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Al(i){return i<10?`0${i}`:i.toString()}function Go(){let i=new Date,t=Al(i.getHours()),e=Al(i.getMinutes()),r=Al(i.getSeconds());return`${t}:${e}:${r}`}var Uc={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.error(`[Uppy] [${Go()}]`,...t)}},jc={debug:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.debug(`[Uppy] [${Go()}]`,...t)},warn:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.warn(`[Uppy] [${Go()}]`,...t)},error:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.error(`[Uppy] [${Go()}]`,...t)}};var In=je(Dn(),1),Gc=je(Jc(),1),Xc={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},qt=class extends Error{constructor(t,e){var r;super(t),this.isRestriction=!0,this.isUserFacing=(r=e?.isUserFacing)!=null?r:!0,e!=null&&e.file&&(this.file=e.file)}},ns=class{constructor(t,e){this.getI18n=e,this.getOpts=()=>{var r;let o=t();if(((r=o.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(o.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return o}}validateAggregateRestrictions(t,e){let{maxTotalFileSize:r,maxNumberOfFiles:o}=this.getOpts().restrictions;if(o&&t.filter(a=>!a.isGhost).length+e.length>o)throw new qt(`${this.getI18n()("youCanOnlyUploadX",{smart_count:o})}`);if(r){let n=[...t,...e].reduce((a,s)=>{var l;return a+((l=s.size)!=null?l:0)},0);if(n>r)throw new qt(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,In.default)(r),size:(0,In.default)(n)}))}}validateSingleFile(t){let{maxFileSize:e,minFileSize:r,allowedFileTypes:o}=this.getOpts().restrictions;if(o&&!o.some(s=>s.includes("/")?t.type?(0,Gc.default)(t.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&t.extension?t.extension.toLowerCase()===s.slice(1).toLowerCase():!1)){let s=o.join(", ");throw new qt(this.getI18n()("youCanOnlyUploadFileTypes",{types:s}),{file:t})}if(e&&t.size!=null&&t.size>e){var n;throw new qt(this.getI18n()("exceedsSize",{size:(0,In.default)(e),file:(n=t.name)!=null?n:this.getI18n()("unnamed")}),{file:t})}if(r&&t.size!=null&&t.size<r)throw new qt(this.getI18n()("inferiorSize",{size:(0,In.default)(r)}),{file:t})}validate(t,e){e.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(t,e)}validateMinNumberOfFiles(t){let{minNumberOfFiles:e}=this.getOpts().restrictions;if(e&&Object.keys(t).length<e)throw new qt(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:e}))}getMissingRequiredMetaFields(t){var e;let r=new qt(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(e=t.name)!=null?e:this.getI18n()("unnamed")})),{requiredMetaFields:o}=this.getOpts().restrictions,n=[];for(let a of o)(!Object.hasOwn(t.meta,a)||t.meta[a]==="")&&n.push(a);return{missingFields:n,error:r}}};var Yc={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function Y(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var q0=0;function Ye(i){return"__private_"+q0+++"_"+i}var J0={version:"4.4.6"},as={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},Dt=Ye("plugins"),It=Ye("restricter"),En=Ye("storeUnsubscribe"),rr=Ye("emitter"),eo=Ye("preProcessors"),to=Ye("uploaders"),ar=Ye("postProcessors"),Zt=Ye("informAndEmit"),On=Ye("checkRequiredMetaFieldsOnFile"),Rl=Ye("checkRequiredMetaFields"),Pn=Ye("assertNewUploadAllowed"),zl=Ye("transformFile"),kn=Ye("startIfAutoProceed"),Fn=Ye("checkAndUpdateFileState"),Rn=Ye("getFilesToRetry"),Tn=Ye("doRetryAll"),Nl=Ye("handleUploadProgress"),Bn=Ye("updateTotalProgress"),sr=Ye("updateTotalProgressThrottled"),Ll=Ye("calculateTotalProgress"),Ol=Ye("addListeners"),xi=Ye("updateOnlineStatus"),An=Ye("requestClientById"),or=Ye("createUpload"),Ml=Ye("getUpload"),io=Ye("removeUpload"),nr=Ye("runUpload"),ss=class i{constructor(t){Object.defineProperty(this,nr,{value:py}),Object.defineProperty(this,io,{value:ly}),Object.defineProperty(this,Ml,{value:sy}),Object.defineProperty(this,or,{value:ay}),Object.defineProperty(this,Ol,{value:ny}),Object.defineProperty(this,Ll,{value:oy}),Object.defineProperty(this,Bn,{value:ry}),Object.defineProperty(this,Tn,{value:iy}),Object.defineProperty(this,Rn,{value:ty}),Object.defineProperty(this,Fn,{value:ey}),Object.defineProperty(this,kn,{value:Z0}),Object.defineProperty(this,zl,{value:Q0}),Object.defineProperty(this,Pn,{value:K0}),Object.defineProperty(this,Rl,{value:Y0}),Object.defineProperty(this,On,{value:X0}),Object.defineProperty(this,Zt,{value:G0}),Object.defineProperty(this,Dt,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,It,{writable:!0,value:void 0}),Object.defineProperty(this,En,{writable:!0,value:void 0}),Object.defineProperty(this,rr,{writable:!0,value:(0,Kc.default)()}),Object.defineProperty(this,eo,{writable:!0,value:new Set}),Object.defineProperty(this,to,{writable:!0,value:new Set}),Object.defineProperty(this,ar,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,Nl,{writable:!0,value:(o,n)=>{let a=o?this.getFile(o.id):void 0;if(o==null||!a){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}if(a.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${o.id}`);return}let s={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};a.progress.uploadStarted!=null?this.setFileState(o.id,{progress:U(_(_({},a.progress),s),{bytesUploaded:n.bytesUploaded})}):this.setFileState(o.id,{progress:_(_({},a.progress),s)}),Y(this,sr)[sr]()}}),Object.defineProperty(this,sr,{writable:!0,value:(0,Qc.default)(()=>Y(this,Bn)[Bn](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,xi,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,An,{writable:!0,value:new Map}),this.defaultLocale=Yc;let e={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Xc,meta:{},onBeforeFileAdded:(o,n)=>!Object.hasOwn(n,o.id),onBeforeUpload:o=>o,store:new zc,logger:Uc,infoTimeout:5e3},r=_(_({},e),t);this.opts=U(_({},r),{restrictions:_(_({},e.restrictions),t&&t.restrictions)}),t&&t.logger&&t.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):t&&t.debug&&(this.opts.logger=jc),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState(U(_({},as),{plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Tl(),individualCancellation:!0,resumableUploads:!1},meta:_({},this.opts.meta),info:[]})),Y(this,It)[It]=new ns(()=>this.opts,()=>this.i18n),Y(this,En)[En]=this.store.subscribe((o,n,a)=>{this.emit("state-update",o,n,a),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),Y(this,Ol)[Ol]()}emit(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];Y(this,rr)[rr].emit(t,...r)}on(t,e){return Y(this,rr)[rr].on(t,e),this}once(t,e){return Y(this,rr)[rr].once(t,e),this}off(t,e){return Y(this,rr)[rr].off(t,e),this}updateAll(t){this.iteratePlugins(e=>{e.update(t)})}setState(t){this.store.setState(t)}getState(){return this.store.getState()}patchFilesState(t){let e=this.getState().files;this.setState({files:_(_({},e),Object.fromEntries(Object.entries(t).map(r=>{let[o,n]=r;return[o,_(_({},e[o]),n)]})))})}setFileState(t,e){if(!this.getState().files[t])throw new Error(`Can\u2019t set state for ${t} (the file could have been removed)`);this.patchFilesState({[t]:e})}i18nInit(){let t=r=>this.log(`Missing i18n string: ${r}`,"error"),e=new Jo([this.defaultLocale,this.opts.locale],{onMissingKey:t});this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(t){this.opts=U(_(_({},this.opts),t),{restrictions:_(_({},this.opts.restrictions),t?.restrictions)}),t.meta&&this.setMeta(t.meta),this.i18nInit(),t.locale&&this.iteratePlugins(e=>{e.setOptions(t)}),this.setState(void 0)}resetProgress(){let t={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},e=_({},this.getState().files),r=Object.create(null);Object.keys(e).forEach(o=>{r[o]=U(_({},e[o]),{progress:_(_({},e[o].progress),t),tus:void 0,transloadit:void 0})}),this.setState(_({files:r},as))}clear(){let{capabilities:t,currentUploads:e}=this.getState();if(Object.keys(e).length>0&&!t.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState(U(_({},as),{files:{}}))}addPreProcessor(t){Y(this,eo)[eo].add(t)}removePreProcessor(t){return Y(this,eo)[eo].delete(t)}addPostProcessor(t){Y(this,ar)[ar].add(t)}removePostProcessor(t){return Y(this,ar)[ar].delete(t)}addUploader(t){Y(this,to)[to].add(t)}removeUploader(t){return Y(this,to)[to].delete(t)}setMeta(t){let e=_(_({},this.getState().meta),t),r=_({},this.getState().files);Object.keys(r).forEach(o=>{r[o]=U(_({},r[o]),{meta:_(_({},r[o].meta),t)})}),this.log("Adding metadata:"),this.log(t),this.setState({meta:e,files:r})}setFileMeta(t,e){let r=_({},this.getState().files);if(!r[t]){this.log(`Was trying to set metadata for a file that has been removed: ${t}`);return}let o=_(_({},r[t].meta),e);r[t]=U(_({},r[t]),{meta:o}),this.setState({files:r})}getFile(t){return this.getState().files[t]}getFiles(){let{files:t}=this.getState();return Object.values(t)}getFilesByIds(t){return t.map(e=>this.getFile(e))}getObjectOfFilesPerState(){let{files:t,totalProgress:e,error:r}=this.getState(),o=Object.values(t),n=[],a=[],s=[],l=[],u=[],g=[],m=[],P=[],E=[];for(let O of o){let{progress:te}=O;!te.uploadComplete&&te.uploadStarted&&(n.push(O),O.isPaused||P.push(O)),te.uploadStarted||a.push(O),(te.uploadStarted||te.preprocess||te.postprocess)&&s.push(O),te.uploadStarted&&l.push(O),O.isPaused&&u.push(O),te.uploadComplete&&g.push(O),O.error&&m.push(O),(te.preprocess||te.postprocess)&&E.push(O)}return{newFiles:a,startedFiles:s,uploadStartedFiles:l,pausedFiles:u,completeFiles:g,erroredFiles:m,inProgressFiles:n,inProgressNotPausedFiles:P,processingFiles:E,isUploadStarted:l.length>0,isAllComplete:e===100&&g.length===o.length&&E.length===0,isAllErrored:!!r&&m.length===o.length,isAllPaused:n.length!==0&&u.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:o.some(O=>O.isGhost)}}validateRestrictions(t,e){e===void 0&&(e=this.getFiles());try{Y(this,It)[It].validate(e,[t])}catch(r){return r}return null}validateSingleFile(t){try{Y(this,It)[It].validateSingleFile(t)}catch(e){return e.message}return null}validateAggregateRestrictions(t){let e=this.getFiles();try{Y(this,It)[It].validateAggregateRestrictions(e,t)}catch(r){return r.message}return null}checkIfFileAlreadyExists(t){let{files:e}=this.getState();return!!(e[t]&&!e[t].isGhost)}addFile(t){Y(this,Pn)[Pn](t);let{nextFilesState:e,validFilesToAdd:r,errors:o}=Y(this,Fn)[Fn]([t]),n=o.filter(s=>s.isRestriction);if(Y(this,Zt)[Zt](n),o.length>0)throw o[0];this.setState({files:e});let[a]=r;return this.emit("file-added",a),this.emit("files-added",r),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),Y(this,kn)[kn](),a.id}addFiles(t){Y(this,Pn)[Pn]();let{nextFilesState:e,validFilesToAdd:r,errors:o}=Y(this,Fn)[Fn](t),n=o.filter(s=>s.isRestriction);Y(this,Zt)[Zt](n);let a=o.filter(s=>!s.isRestriction);if(a.length>0){let s=`Multiple errors occurred while adding files:
|
|
12
|
-
`;if(a.forEach(l=>{s+=`
|
|
13
|
-
* ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:s},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,s);{let l=new Error(s);throw l.errors=a,l}}this.setState({files:e}),r.forEach(s=>{this.emit("file-added",s)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(s=>{this.log(`Added file: ${s.name}
|
|
14
|
-
id: ${s.id}
|
|
15
|
-
type: ${s.type}`)}),r.length>0&&Y(this,kn)[kn]()}removeFiles(t){let{files:e,currentUploads:r}=this.getState(),o=_({},e),n=_({},r),a=Object.create(null);t.forEach(g=>{e[g]&&(a[g]=e[g],delete o[g])});function s(g){return a[g]===void 0}Object.keys(n).forEach(g=>{let m=r[g].fileIDs.filter(s);if(m.length===0){delete n[g];return}let{capabilities:P}=this.getState();if(m.length!==r[g].fileIDs.length&&!P.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");n[g]=U(_({},r[g]),{fileIDs:m})});let l={currentUploads:n,files:o};Object.keys(o).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),Y(this,sr)[sr]();let u=Object.keys(a);u.forEach(g=>{this.emit("file-removed",a[g])}),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)}removeFile(t){this.removeFiles([t])}pauseResume(t){if(!this.getState().capabilities.resumableUploads||this.getFile(t).progress.uploadComplete)return;let e=this.getFile(t),o=!(e.isPaused||!1);return this.setFileState(t,{isPaused:o}),this.emit("upload-pause",e,o),o}pauseAll(){let t=_({},this.getState().files);Object.keys(t).filter(r=>!t[r].progress.uploadComplete&&t[r].progress.uploadStarted).forEach(r=>{let o=U(_({},t[r]),{isPaused:!0});t[r]=o}),this.setState({files:t}),this.emit("pause-all")}resumeAll(){let t=_({},this.getState().files);Object.keys(t).filter(r=>!t[r].progress.uploadComplete&&t[r].progress.uploadStarted).forEach(r=>{let o=U(_({},t[r]),{isPaused:!1,error:null});t[r]=o}),this.setState({files:t}),this.emit("resume-all")}retryAll(){return G(this,null,function*(){let t=yield Y(this,Tn)[Tn]();return this.emit("complete",t),t})}cancelAll(){this.emit("cancel-all");let{files:t}=this.getState(),e=Object.keys(t);e.length&&this.removeFiles(e),this.setState(as)}retryUpload(t){this.setFileState(t,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(t));let e=Y(this,or)[or]([t],{forceAllowNewUpload:!0});return Y(this,nr)[nr](e)}logout(){this.iteratePlugins(t=>{var e;(e=t.provider)==null||e.logout==null||e.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return Y(this,Bn)[Bn]()}updateOnlineStatus(){var t;((t=window.navigator.onLine)!=null?t:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(t){if(typeof t!="function"){let l=`Expected a plugin class, but got ${t===null?"null":typeof t}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];let n=new t(this,...r),a=n.id;if(!a)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");let s=this.getPlugin(a);if(s){let l=`Already found a plugin named '${s.id}'. Tried to use: '${a}'.
|
|
16
|
-
Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return t.VERSION&&this.log(`Using ${a} v${t.VERSION}`),n.type in Y(this,Dt)[Dt]?Y(this,Dt)[Dt][n.type].push(n):Y(this,Dt)[Dt][n.type]=[n],n.install(),this.emit("plugin-added",n),this}getPlugin(t){for(let e of Object.values(Y(this,Dt)[Dt])){let r=e.find(o=>o.id===t);if(r!=null)return r}}[Symbol.for("uppy test: getPlugins")](t){return Y(this,Dt)[Dt][t]}iteratePlugins(t){Object.values(Y(this,Dt)[Dt]).flat(1).forEach(t)}removePlugin(t){this.log(`Removing plugin ${t.id}`),this.emit("plugin-remove",t),t.uninstall&&t.uninstall();let e=Y(this,Dt)[Dt][t.type],r=e.findIndex(a=>a.id===t.id);r!==-1&&e.splice(r,1);let o=this.getState(),n={plugins:U(_({},o.plugins),{[t.id]:void 0})};this.setState(n)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),Y(this,En)[En](),this.iteratePlugins(t=>{this.removePlugin(t)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",Y(this,xi)[xi]),window.removeEventListener("offline",Y(this,xi)[xi]))}hideInfo(){let{info:t}=this.getState();this.setState({info:t.slice(1)}),this.emit("info-hidden")}info(t,e,r){e===void 0&&(e="info"),r===void 0&&(r=3e3);let o=typeof t=="object";this.setState({info:[...this.getState().info,{type:e,message:o?t.message:t,details:o?t.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(t,e){let{logger:r}=this.opts;switch(e){case"error":r.error(t);break;case"warning":r.warn(t);break;default:r.debug(t);break}}registerRequestClient(t,e){Y(this,An)[An].set(t,e)}getRequestClientForFile(t){if(!t.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${t.id}`);let e=Y(this,An)[An].get(t.remote.requestClientId);if(e==null)throw new Error(`requestClientId "${t.remote.requestClientId}" not registered for file "${t.id}"`);return e}restore(t){return this.log(`Core: attempting to restore upload "${t}"`),this.getState().currentUploads[t]?Y(this,nr)[nr](t):(Y(this,io)[io](t),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return Y(this,or)[or](...arguments)}addResultData(t,e){if(!Y(this,Ml)[Ml](t)){this.log(`Not setting result for an upload that has been removed: ${t}`);return}let{currentUploads:r}=this.getState(),o=U(_({},r[t]),{result:_(_({},r[t].result),e)});this.setState({currentUploads:U(_({},r),{[t]:o})})}upload(){return G(this,null,function*(){var t;(t=Y(this,Dt)[Dt].uploader)!=null&&t.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(Y(this,Rn)[Rn]().length>0){let n=yield Y(this,Tn)[Tn]();if(!(this.getFiles().filter(s=>s.progress.uploadStarted==null).length>0))return this.emit("complete",n),n;({files:e}=this.getState())}let o=this.opts.onBeforeUpload(e);return o===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(o&&typeof o=="object"&&(e=o,this.setState({files:e})),Promise.resolve().then(()=>Y(this,It)[It].validateMinNumberOfFiles(e)).catch(n=>{throw Y(this,Zt)[Zt]([n]),n}).then(()=>{if(!Y(this,Rl)[Rl](e))throw new qt(this.i18n("missingRequiredMetaField"))}).catch(n=>{throw n}).then(()=>G(this,null,function*(){let{currentUploads:n}=this.getState(),a=Object.values(n).flatMap(g=>g.fileIDs),s=[];Object.keys(e).forEach(g=>{let m=this.getFile(g);!m.progress.uploadStarted&&a.indexOf(g)===-1&&s.push(m.id)});let l=Y(this,or)[or](s),u=yield Y(this,nr)[nr](l);return this.emit("complete",u),u})).catch(n=>{throw this.emit("error",n),this.log(n,"error"),n}))})}};function G0(i){for(let n of i)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"warning");let t=i.filter(n=>n.isUserFacing),e=4,r=t.slice(0,e),o=t.slice(e);r.forEach(n=>{let{message:a,details:s=""}=n;this.info({message:a,details:s},"error",this.opts.infoTimeout)}),o.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:o.length})})}function X0(i){let{missingFields:t,error:e}=Y(this,It)[It].getMissingRequiredMetaFields(i);return t.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:t}),this.log(e.message),this.emit("restriction-failed",i,e),!1):(t.length===0&&i.missingRequiredMetaFields&&this.setFileState(i.id,{missingRequiredMetaFields:[]}),!0)}function Y0(i){let t=!0;for(let e of Object.values(i))Y(this,On)[On](e)||(t=!1);return t}function K0(i){let{allowNewUpload:t}=this.getState();if(t===!1){let e=new qt(this.i18n("noMoreFilesAllowed"),{file:i});throw Y(this,Zt)[Zt]([e]),e}}function Q0(i){let t=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,e=Sn(t),r=Bl(e,t),o=Gi(r).extension,n=os(t,this.getID()),a=t.meta||{};a.name=r,a.type=e;let s=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:n,name:r,extension:o||"",meta:_(_({},this.getState().meta),a),type:e,data:t.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:s,uploadComplete:!1,uploadStarted:null},size:s,isGhost:!1,isRemote:t.isRemote||!1,remote:t.remote,preview:t.preview}}function Z0(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function ey(i){let{files:t}=this.getState(),e=_({},t),r=[],o=[];for(let s of i)try{var n;let l=Y(this,zl)[zl](s),u=(n=t[l.id])==null?void 0:n.isGhost;if(u){let m=t[l.id];l=U(_({},m),{isGhost:!1,data:s.data}),this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`)}let g=this.opts.onBeforeFileAdded(l,e);if(!g&&this.checkIfFileAlreadyExists(l.id)){var a;throw new qt(this.i18n("noDuplicates",{fileName:(a=l.name)!=null?a:this.i18n("unnamed")}),{file:s})}if(g===!1&&!u)throw new qt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:s});typeof g=="object"&&g!==null&&(l=g),Y(this,It)[It].validateSingleFile(l),e[l.id]=l,r.push(l)}catch(l){o.push(l)}try{Y(this,It)[It].validateAggregateRestrictions(Object.values(t),r)}catch(s){return o.push(s),{nextFilesState:t,validFilesToAdd:[],errors:o}}return{nextFilesState:e,validFilesToAdd:r,errors:o}}function ty(){let{files:i}=this.getState();return Object.keys(i).filter(t=>i[t].error)}function iy(){return G(this,null,function*(){let i=Y(this,Rn)[Rn](),t=_({},this.getState().files);if(i.forEach(r=>{t[r]=U(_({},t[r]),{isPaused:!1,error:null})}),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(i)),i.length===0)return{successful:[],failed:[]};let e=Y(this,or)[or](i,{forceAllowNewUpload:!0});return Y(this,nr)[nr](e)})}function ry(){let i=Y(this,Ll)[Ll](),t=null;i!=null&&(t=Math.round(i*100),t>100?t=100:t<0&&(t=0)),this.emit("progress",t??0),this.setState({totalProgress:t??0})}function oy(){let t=this.getFiles().filter(s=>s.progress.uploadStarted||s.progress.preprocess||s.progress.postprocess);if(t.length===0)return 0;if(t.every(s=>s.progress.uploadComplete))return 1;let e=s=>s.progress.bytesTotal!=null&&s.progress.bytesTotal!==0,r=t.filter(e),o=t.filter(s=>!e(s));if(r.every(s=>s.progress.uploadComplete)&&o.length>0&&!o.every(s=>s.progress.uploadComplete))return null;let n=r.reduce((s,l)=>{var u;return s+((u=l.progress.bytesTotal)!=null?u:0)},0),a=r.reduce((s,l)=>s+(l.progress.bytesUploaded||0),0);return n===0?0:a/n}function ny(){let i=(r,o,n)=>{let a=r.message||"Unknown error";r.details&&(a+=` ${r.details}`),this.setState({error:a}),o!=null&&o.id in this.getState().files&&this.setFileState(o.id,{error:a,response:n})};this.on("error",i),this.on("upload-error",(r,o,n)=>{if(i(o,r,n),typeof o=="object"&&o.message){var a;this.log(o.message,"error");let s=new Error(this.i18n("failedToUpload",{file:(a=r?.name)!=null?a:""}));s.isUserFacing=!0,s.details=o.message,o.details&&(s.details+=` ${o.details}`),Y(this,Zt)[Zt]([s])}else Y(this,Zt)[Zt]([o])});let t=null;this.on("upload-stalled",(r,o)=>{let{message:n}=r,a=o.map(s=>s.meta.name).join(", ");t||(this.info({message:n,details:a},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${n} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let e=r=>{let o=r.filter(a=>{let s=a!=null&&this.getFile(a.id);return s||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),s}),n=Object.fromEntries(o.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(n)};this.on("upload-start",e),this.on("upload-progress",Y(this,Nl)[Nl]),this.on("upload-success",(r,o)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let n=this.getFile(r.id).progress;this.setFileState(r.id,{progress:U(_({},n),{postprocess:Y(this,ar)[ar].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal}),response:o,uploadURL:o.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:o.bytesUploaded||n.bytesTotal}),Y(this,sr)[sr]()}),this.on("preprocess-progress",(r,o)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:U(_({},this.getFile(r.id).progress),{preprocess:o})})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let o=_({},this.getState().files);o[r.id]=U(_({},o[r.id]),{progress:_({},o[r.id].progress)}),delete o[r.id].progress.preprocess,this.setState({files:o})}),this.on("postprocess-progress",(r,o)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:U(_({},this.getState().files[r.id].progress),{postprocess:o})})}),this.on("postprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let o=_({},this.getState().files);o[r.id]=U(_({},o[r.id]),{progress:_({},o[r.id].progress)}),delete o[r.id].progress.postprocess,this.setState({files:o})}),this.on("restored",()=>{Y(this,sr)[sr]()}),this.on("dashboard:file-edit-complete",r=>{r&&Y(this,On)[On](r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",Y(this,xi)[xi]),window.addEventListener("offline",Y(this,xi)[xi]),setTimeout(Y(this,xi)[xi],3e3))}function ay(i,t){t===void 0&&(t={});let{forceAllowNewUpload:e=!1}=t,{allowNewUpload:r,currentUploads:o}=this.getState();if(!r&&!e)throw new Error("Cannot create a new upload: already uploading.");let n=ic();return this.emit("upload",n,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:U(_({},o),{[n]:{fileIDs:i,step:0,result:{}}})}),n}function sy(i){let{currentUploads:t}=this.getState();return t[i]}function ly(i){let t=_({},this.getState().currentUploads);delete t[i],this.setState({currentUploads:t})}function py(i){return G(this,null,function*(){let t=()=>{let{currentUploads:n}=this.getState();return n[i]},e=t(),r=[...Y(this,eo)[eo],...Y(this,to)[to],...Y(this,ar)[ar]];try{for(let n=e.step||0;n<r.length&&e;n++){let a=r[n];this.setState({currentUploads:U(_({},this.getState().currentUploads),{[i]:U(_({},e),{step:n})})});let{fileIDs:s}=e;yield a(s,i),e=t()}}catch(n){throw Y(this,io)[io](i),n}if(e){e.fileIDs.forEach(l=>{let u=this.getFile(l);u&&u.progress.postprocess&&this.emit("postprocess-complete",u)});let n=e.fileIDs.map(l=>this.getFile(l)),a=n.filter(l=>!l.error),s=n.filter(l=>l.error);this.addResultData(i,{successful:a,failed:s,uploadID:i}),e=t()}let o;return e&&(o=e.result,Y(this,io)[io](i)),o==null&&(this.log(`Not setting result for an upload that has been removed: ${i}`),o={successful:[],failed:[],uploadID:i}),o})}ss.VERSION=J0.version;var Xo=ss;var Nn,Fe,rh,dy,ro,Zc,oh,nh,ah,Vl,Ul,jl,uy,zn={},sh=[],cy=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ln=Array.isArray;function Xi(i,t){for(var e in t)i[e]=t[e];return i}function Hl(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function p(i,t,e){var r,o,n,a={};for(n in t)n=="key"?r=t[n]:n=="ref"?o=t[n]:a[n]=t[n];if(arguments.length>2&&(a.children=arguments.length>3?Nn.call(arguments,2):e),typeof i=="function"&&i.defaultProps!=null)for(n in i.defaultProps)a[n]===void 0&&(a[n]=i.defaultProps[n]);return Mn(i,a,r,o,null)}function Mn(i,t,e,r,o){var n={type:i,props:t,key:e,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++rh,__i:-1,__u:0};return o==null&&Fe.vnode!=null&&Fe.vnode(n),n}function ds(){return{current:null}}function Et(i){return i.children}function st(i,t){this.props=i,this.context=t}function Yo(i,t){if(t==null)return i.__?Yo(i.__,i.__i+1):null;for(var e;t<i.__k.length;t++)if((e=i.__k[t])!=null&&e.__e!=null)return e.__e;return typeof i.type=="function"?Yo(i):null}function lh(i){var t,e;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,t=0;t<i.__k.length;t++)if((e=i.__k[t])!=null&&e.__e!=null){i.__e=i.__c.base=e.__e;break}return lh(i)}}function eh(i){(!i.__d&&(i.__d=!0)&&ro.push(i)&&!ps.__r++||Zc!=Fe.debounceRendering)&&((Zc=Fe.debounceRendering)||oh)(ps)}function ps(){for(var i,t,e,r,o,n,a,s=1;ro.length;)ro.length>s&&ro.sort(nh),i=ro.shift(),s=ro.length,i.__d&&(e=void 0,o=(r=(t=i).__v).__e,n=[],a=[],t.__P&&((e=Xi({},r)).__v=r.__v+1,Fe.vnode&&Fe.vnode(e),$l(t.__P,e,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,n,o??Yo(r),!!(32&r.__u),a),e.__v=r.__v,e.__.__k[e.__i]=e,uh(n,e,a),e.__e!=o&&lh(e)));ps.__r=0}function ph(i,t,e,r,o,n,a,s,l,u,g){var m,P,E,O,te,ae,oe=r&&r.__k||sh,pe=t.length;for(l=hy(e,t,oe,l,pe),m=0;m<pe;m++)(E=e.__k[m])!=null&&(P=E.__i==-1?zn:oe[E.__i]||zn,E.__i=m,ae=$l(i,E,P,o,n,a,s,l,u,g),O=E.__e,E.ref&&P.ref!=E.ref&&(P.ref&&Wl(P.ref,null,E),g.push(E.ref,E.__c||O,E)),te==null&&O!=null&&(te=O),4&E.__u||P.__k===E.__k?l=dh(E,l,i):typeof E.type=="function"&&ae!==void 0?l=ae:O&&(l=O.nextSibling),E.__u&=-7);return e.__e=te,l}function hy(i,t,e,r,o){var n,a,s,l,u,g=e.length,m=g,P=0;for(i.__k=new Array(o),n=0;n<o;n++)(a=t[n])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=n+P,(a=i.__k[n]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Mn(null,a,null,null,null):Ln(a)?Mn(Et,{children:a},null,null,null):a.constructor==null&&a.__b>0?Mn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=i,a.__b=i.__b+1,s=null,(u=a.__i=my(a,e,l,m))!=-1&&(m--,(s=e[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(o>g?P--:o<g&&P++),typeof a.type!="function"&&(a.__u|=4)):u!=l&&(u==l-1?P--:u==l+1?P++:(u>l?P--:P++,a.__u|=4))):i.__k[n]=null;if(m)for(n=0;n<g;n++)(s=e[n])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Yo(s)),hh(s,s));return r}function dh(i,t,e){var r,o;if(typeof i.type=="function"){for(r=i.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=i,t=dh(r[o],t,e));return t}i.__e!=t&&(t&&i.type&&!e.contains(t)&&(t=Yo(i)),e.insertBefore(i.__e,t||null),t=i.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Jt(i,t){return t=t||[],i==null||typeof i=="boolean"||(Ln(i)?i.some(function(e){Jt(e,t)}):t.push(i)),t}function my(i,t,e,r){var o,n,a=i.key,s=i.type,l=t[e];if(l===null&&i.key==null||l&&a==l.key&&s==l.type&&(2&l.__u)==0)return e;if(r>(l!=null&&(2&l.__u)==0?1:0))for(o=e-1,n=e+1;o>=0||n<t.length;){if(o>=0){if((l=t[o])&&(2&l.__u)==0&&a==l.key&&s==l.type)return o;o--}if(n<t.length){if((l=t[n])&&(2&l.__u)==0&&a==l.key&&s==l.type)return n;n++}}return-1}function th(i,t,e){t[0]=="-"?i.setProperty(t,e??""):i[t]=e==null?"":typeof e!="number"||cy.test(t)?e:e+"px"}function ls(i,t,e,r,o){var n,a;e:if(t=="style")if(typeof e=="string")i.style.cssText=e;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(t in r)e&&t in e||th(i.style,t,"");if(e)for(t in e)r&&e[t]==r[t]||th(i.style,t,e[t])}else if(t[0]=="o"&&t[1]=="n")n=t!=(t=t.replace(ah,"$1")),a=t.toLowerCase(),t=a in i||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),i.l||(i.l={}),i.l[t+n]=e,e?r?e.u=r.u:(e.u=Vl,i.addEventListener(t,n?jl:Ul,n)):i.removeEventListener(t,n?jl:Ul,n);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in i)try{i[t]=e??"";break e}catch{}typeof e=="function"||(e==null||e===!1&&t[4]!="-"?i.removeAttribute(t):i.setAttribute(t,t=="popover"&&e==1?"":e))}}function ih(i){return function(t){if(this.l){var e=this.l[t.type+i];if(t.t==null)t.t=Vl++;else if(t.t<e.u)return;return e(Fe.event?Fe.event(t):t)}}}function $l(i,t,e,r,o,n,a,s,l,u){var g,m,P,E,O,te,ae,oe,pe,de,be,me,w,x,k,j,X,ie=t.type;if(t.constructor!=null)return null;128&e.__u&&(l=!!(32&e.__u),n=[s=t.__e=e.__e]),(g=Fe.__b)&&g(t);e:if(typeof ie=="function")try{if(oe=t.props,pe="prototype"in ie&&ie.prototype.render,de=(g=ie.contextType)&&r[g.__c],be=g?de?de.props.value:g.__:r,e.__c?ae=(m=t.__c=e.__c).__=m.__E:(pe?t.__c=m=new ie(oe,be):(t.__c=m=new st(oe,be),m.constructor=ie,m.render=gy),de&&de.sub(m),m.props=oe,m.state||(m.state={}),m.context=be,m.__n=r,P=m.__d=!0,m.__h=[],m._sb=[]),pe&&m.__s==null&&(m.__s=m.state),pe&&ie.getDerivedStateFromProps!=null&&(m.__s==m.state&&(m.__s=Xi({},m.__s)),Xi(m.__s,ie.getDerivedStateFromProps(oe,m.__s))),E=m.props,O=m.state,m.__v=t,P)pe&&ie.getDerivedStateFromProps==null&&m.componentWillMount!=null&&m.componentWillMount(),pe&&m.componentDidMount!=null&&m.__h.push(m.componentDidMount);else{if(pe&&ie.getDerivedStateFromProps==null&&oe!==E&&m.componentWillReceiveProps!=null&&m.componentWillReceiveProps(oe,be),!m.__e&&m.shouldComponentUpdate!=null&&m.shouldComponentUpdate(oe,m.__s,be)===!1||t.__v==e.__v){for(t.__v!=e.__v&&(m.props=oe,m.state=m.__s,m.__d=!1),t.__e=e.__e,t.__k=e.__k,t.__k.some(function(Ie){Ie&&(Ie.__=t)}),me=0;me<m._sb.length;me++)m.__h.push(m._sb[me]);m._sb=[],m.__h.length&&a.push(m);break e}m.componentWillUpdate!=null&&m.componentWillUpdate(oe,m.__s,be),pe&&m.componentDidUpdate!=null&&m.__h.push(function(){m.componentDidUpdate(E,O,te)})}if(m.context=be,m.props=oe,m.__P=i,m.__e=!1,w=Fe.__r,x=0,pe){for(m.state=m.__s,m.__d=!1,w&&w(t),g=m.render(m.props,m.state,m.context),k=0;k<m._sb.length;k++)m.__h.push(m._sb[k]);m._sb=[]}else do m.__d=!1,w&&w(t),g=m.render(m.props,m.state,m.context),m.state=m.__s;while(m.__d&&++x<25);m.state=m.__s,m.getChildContext!=null&&(r=Xi(Xi({},r),m.getChildContext())),pe&&!P&&m.getSnapshotBeforeUpdate!=null&&(te=m.getSnapshotBeforeUpdate(E,O)),j=g,g!=null&&g.type===Et&&g.key==null&&(j=ch(g.props.children)),s=ph(i,Ln(j)?j:[j],t,e,r,o,n,a,s,l,u),m.base=t.__e,t.__u&=-161,m.__h.length&&a.push(m),ae&&(m.__E=m.__=null)}catch(Ie){if(t.__v=null,l||n!=null)if(Ie.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;n[n.indexOf(s)]=null,t.__e=s}else for(X=n.length;X--;)Hl(n[X]);else t.__e=e.__e,t.__k=e.__k;Fe.__e(Ie,t,e)}else n==null&&t.__v==e.__v?(t.__k=e.__k,t.__e=e.__e):s=t.__e=fy(e.__e,t,e,r,o,n,a,l,u);return(g=Fe.diffed)&&g(t),128&t.__u?void 0:s}function uh(i,t,e){for(var r=0;r<e.length;r++)Wl(e[r],e[++r],e[++r]);Fe.__c&&Fe.__c(t,i),i.some(function(o){try{i=o.__h,o.__h=[],i.some(function(n){n.call(o)})}catch(n){Fe.__e(n,o.__v)}})}function ch(i){return typeof i!="object"||i==null||i.__b&&i.__b>0?i:Ln(i)?i.map(ch):Xi({},i)}function fy(i,t,e,r,o,n,a,s,l){var u,g,m,P,E,O,te,ae=e.props,oe=t.props,pe=t.type;if(pe=="svg"?o="http://www.w3.org/2000/svg":pe=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),n!=null){for(u=0;u<n.length;u++)if((E=n[u])&&"setAttribute"in E==!!pe&&(pe?E.localName==pe:E.nodeType==3)){i=E,n[u]=null;break}}if(i==null){if(pe==null)return document.createTextNode(oe);i=document.createElementNS(o,pe,oe.is&&oe),s&&(Fe.__m&&Fe.__m(t,n),s=!1),n=null}if(pe==null)ae===oe||s&&i.data==oe||(i.data=oe);else{if(n=n&&Nn.call(i.childNodes),ae=e.props||zn,!s&&n!=null)for(ae={},u=0;u<i.attributes.length;u++)ae[(E=i.attributes[u]).name]=E.value;for(u in ae)if(E=ae[u],u!="children"){if(u=="dangerouslySetInnerHTML")m=E;else if(!(u in oe)){if(u=="value"&&"defaultValue"in oe||u=="checked"&&"defaultChecked"in oe)continue;ls(i,u,null,E,o)}}for(u in oe)E=oe[u],u=="children"?P=E:u=="dangerouslySetInnerHTML"?g=E:u=="value"?O=E:u=="checked"?te=E:s&&typeof E!="function"||ae[u]===E||ls(i,u,E,ae[u],o);if(g)s||m&&(g.__html==m.__html||g.__html==i.innerHTML)||(i.innerHTML=g.__html),t.__k=[];else if(m&&(i.innerHTML=""),ph(t.type=="template"?i.content:i,Ln(P)?P:[P],t,e,r,pe=="foreignObject"?"http://www.w3.org/1999/xhtml":o,n,a,n?n[0]:e.__k&&Yo(e,0),s,l),n!=null)for(u=n.length;u--;)Hl(n[u]);s||(u="value",pe=="progress"&&O==null?i.removeAttribute("value"):O!=null&&(O!==i[u]||pe=="progress"&&!O||pe=="option"&&O!=ae[u])&&ls(i,u,O,ae[u],o),u="checked",te!=null&&te!=i[u]&&ls(i,u,te,ae[u],o))}return i}function Wl(i,t,e){try{if(typeof i=="function"){var r=typeof i.__u=="function";r&&i.__u(),r&&t==null||(i.__u=i(t))}else i.current=t}catch(o){Fe.__e(o,e)}}function hh(i,t,e){var r,o;if(Fe.unmount&&Fe.unmount(i),(r=i.ref)&&(r.current&&r.current!=i.__e||Wl(r,null,t)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){Fe.__e(n,t)}r.base=r.__P=null}if(r=i.__k)for(o=0;o<r.length;o++)r[o]&&hh(r[o],t,e||typeof i.type!="function");e||Hl(i.__e),i.__c=i.__=i.__e=void 0}function gy(i,t,e){return this.constructor(i,e)}function mh(i,t,e){var r,o,n,a;t==document&&(t=document.documentElement),Fe.__&&Fe.__(i,t),o=(r=typeof e=="function")?null:e&&e.__k||t.__k,n=[],a=[],$l(t,i=(!r&&e||t).__k=p(Et,null,[i]),o||zn,zn,t.namespaceURI,!r&&e?[e]:o?null:t.firstChild?Nn.call(t.childNodes):null,n,!r&&e?e:o?o.__e:t.firstChild,r,a),uh(n,i,a)}function Un(i,t,e){var r,o,n,a,s=Xi({},i.props);for(n in i.type&&i.type.defaultProps&&(a=i.type.defaultProps),t)n=="key"?r=t[n]:n=="ref"?o=t[n]:s[n]=t[n]===void 0&&a!=null?a[n]:t[n];return arguments.length>2&&(s.children=arguments.length>3?Nn.call(arguments,2):e),Mn(i.type,s,r||i.key,o||i.ref,null)}Nn=sh.slice,Fe={__e:function(i,t,e,r){for(var o,n,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((n=o.constructor)&&n.getDerivedStateFromError!=null&&(o.setState(n.getDerivedStateFromError(i)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(i,r||{}),a=o.__d),a)return o.__E=o}catch(s){i=s}throw i}},rh=0,dy=function(i){return i!=null&&i.constructor==null},st.prototype.setState=function(i,t){var e;e=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Xi({},this.state),typeof i=="function"&&(i=i(Xi({},e),this.props)),i&&Xi(e,i),i!=null&&this.__v&&(t&&this._sb.push(t),eh(this))},st.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),eh(this))},st.prototype.render=Et,ro=[],oh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,nh=function(i,t){return i.__v.__b-t.__v.__b},ps.__r=0,ah=/(PointerCapture)$|Capture$/i,Vl=0,Ul=ih(!1),jl=ih(!0),uy=0;var jn,ct,ql,fh,Vn=0,Ch=[],ft=Fe,gh=ft.__b,yh=ft.__r,bh=ft.diffed,vh=ft.__c,wh=ft.unmount,_h=ft.__;function Gl(i,t){ft.__h&&ft.__h(ct,i,Vn||t),Vn=0;var e=ct.__H||(ct.__H={__:[],__h:[]});return i>=e.__.length&&e.__.push({}),e.__[i]}function mi(i){return Vn=1,Sh(Ih,i)}function Sh(i,t,e){var r=Gl(jn++,2);if(r.t=i,!r.__c&&(r.__=[e?e(t):Ih(void 0,t),function(s){var l=r.__N?r.__N[0]:r.__[0],u=r.t(l,s);l!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=ct,!ct.__f)){var o=function(s,l,u){if(!r.__c.__H)return!0;var g=r.__c.__H.__.filter(function(P){return!!P.__c});if(g.every(function(P){return!P.__N}))return!n||n.call(this,s,l,u);var m=r.__c.props!==s;return g.forEach(function(P){if(P.__N){var E=P.__[0];P.__=P.__N,P.__N=void 0,E!==P.__[0]&&(m=!0)}}),n&&n.call(this,s,l,u)||m};ct.__f=!0;var n=ct.shouldComponentUpdate,a=ct.componentWillUpdate;ct.componentWillUpdate=function(s,l,u){if(this.__e){var g=n;n=void 0,o(s,l,u),n=g}a&&a.call(this,s,l,u)},ct.shouldComponentUpdate=o}return r.__N||r.__}function Ci(i,t){var e=Gl(jn++,3);!ft.__s&&Dh(e.__H,t)&&(e.__=i,e.u=t,ct.__H.__h.push(e))}function Lr(i){return Vn=5,Ur(function(){return{current:i}},[])}function Ur(i,t){var e=Gl(jn++,7);return Dh(e.__H,t)&&(e.__=i(),e.__H=t,e.__h=i),e.__}function jr(i,t){return Vn=8,Ur(function(){return i},t)}function yy(){for(var i;i=Ch.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(us),i.__H.__h.forEach(Jl),i.__H.__h=[]}catch(t){i.__H.__h=[],ft.__e(t,i.__v)}}ft.__b=function(i){ct=null,gh&&gh(i)},ft.__=function(i,t){i&&t.__k&&t.__k.__m&&(i.__m=t.__k.__m),_h&&_h(i,t)},ft.__r=function(i){yh&&yh(i),jn=0;var t=(ct=i.__c).__H;t&&(ql===ct?(t.__h=[],ct.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(us),t.__h.forEach(Jl),t.__h=[],jn=0)),ql=ct},ft.diffed=function(i){bh&&bh(i);var t=i.__c;t&&t.__H&&(t.__H.__h.length&&(Ch.push(t)!==1&&fh===ft.requestAnimationFrame||((fh=ft.requestAnimationFrame)||by)(yy)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),ql=ct=null},ft.__c=function(i,t){t.some(function(e){try{e.__h.forEach(us),e.__h=e.__h.filter(function(r){return!r.__||Jl(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],ft.__e(r,e.__v)}}),vh&&vh(i,t)},ft.unmount=function(i){wh&&wh(i);var t,e=i.__c;e&&e.__H&&(e.__H.__.forEach(function(r){try{us(r)}catch(o){t=o}}),e.__H=void 0,t&&ft.__e(t,e.__v))};var xh=typeof requestAnimationFrame=="function";function by(i){var t,e=function(){clearTimeout(r),xh&&cancelAnimationFrame(t),setTimeout(i)},r=setTimeout(e,35);xh&&(t=requestAnimationFrame(e))}function us(i){var t=ct,e=i.__c;typeof e=="function"&&(i.__c=void 0,e()),ct=t}function Jl(i){var t=ct;i.__c=i.__(),ct=t}function Dh(i,t){return!i||i.length!==t.length||t.some(function(e,r){return e!==i[r]})}function Ih(i,t){return typeof t=="function"?t(i):t}function wy(i,t){for(var e in t)i[e]=t[e];return i}function Eh(i,t){for(var e in i)if(e!=="__source"&&!(e in t))return!0;for(var r in t)if(r!=="__source"&&i[r]!==t[r])return!0;return!1}function Ph(i,t){this.props=i,this.context=t}(Ph.prototype=new st).isPureReactComponent=!0,Ph.prototype.shouldComponentUpdate=function(i,t){return Eh(this.props,i)||Eh(this.state,t)};var kh=Fe.__b;Fe.__b=function(i){i.type&&i.type.__f&&i.ref&&(i.props.ref=i.ref,i.ref=null),kh&&kh(i)};var v2=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var _y=Fe.__e;Fe.__e=function(i,t,e,r){if(i.then){for(var o,n=t;n=n.__;)if((o=n.__c)&&o.__c)return t.__e==null&&(t.__e=e.__e,t.__k=e.__k),o.__c(i,t)}_y(i,t,e,r)};var Fh=Fe.unmount;function Mh(i,t,e){return i&&(i.__c&&i.__c.__H&&(i.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),i.__c.__H=null),(i=wy({},i)).__c!=null&&(i.__c.__P===e&&(i.__c.__P=t),i.__c.__e=!0,i.__c=null),i.__k=i.__k&&i.__k.map(function(r){return Mh(r,t,e)})),i}function zh(i,t,e){return i&&e&&(i.__v=null,i.__k=i.__k&&i.__k.map(function(r){return zh(r,t,e)}),i.__c&&i.__c.__P===t&&(i.__e&&e.appendChild(i.__e),i.__c.__e=!0,i.__c.__P=e)),i}function Xl(){this.__u=0,this.o=null,this.__b=null}function Nh(i){var t=i.__.__c;return t&&t.__a&&t.__a(i)}function cs(){this.i=null,this.l=null}Fe.unmount=function(i){var t=i.__c;t&&t.__R&&t.__R(),t&&32&i.__u&&(i.type=null),Fh&&Fh(i)},(Xl.prototype=new st).__c=function(i,t){var e=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(e);var o=Nh(r.__v),n=!1,a=function(){n||(n=!0,e.__R=null,o?o(s):s())};e.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=zh(l,l.__c.__P,l.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),i.then(a,a)},Xl.prototype.componentWillUnmount=function(){this.o=[]},Xl.prototype.render=function(i,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Mh(this.__b,e,r.__O=r.__P)}this.__b=null}var o=t.__a&&p(Et,null,i.fallback);return o&&(o.__u&=-33),[p(Et,null,t.__a?null:i.children),o]};var Th=function(i,t,e){if(++e[1]===e[0]&&i.l.delete(t),i.props.revealOrder&&(i.props.revealOrder[0]!=="t"||!i.l.size))for(e=i.i;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;i.i=e=e[2]}};(cs.prototype=new st).__a=function(i){var t=this,e=Nh(t.__v),r=t.l.get(i);return r[0]++,function(o){var n=function(){t.props.revealOrder?(r.push(o),Th(t,i,r)):o()};e?e(n):n()}},cs.prototype.render=function(i){this.i=null,this.l=new Map;var t=Jt(i.children);i.revealOrder&&i.revealOrder[0]==="b"&&t.reverse();for(var e=t.length;e--;)this.l.set(t[e],this.i=[1,0,this.i]);return i.children},cs.prototype.componentDidUpdate=cs.prototype.componentDidMount=function(){var i=this;this.l.forEach(function(t,e){Th(i,e,t)})};var xy=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Cy=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Sy=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Dy=/[A-Z0-9]/g,Iy=typeof document<"u",Ey=function(i){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(i)};function Yl(i,t,e){return t.__k==null&&(t.textContent=""),mh(i,t),typeof e=="function"&&e(),i?i.__c:null}st.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(i){Object.defineProperty(st.prototype,i,{configurable:!0,get:function(){return this["UNSAFE_"+i]},set:function(t){Object.defineProperty(this,i,{configurable:!0,writable:!0,value:t})}})});var Bh=Fe.event;function Py(){}function ky(){return this.cancelBubble}function Fy(){return this.defaultPrevented}Fe.event=function(i){return Bh&&(i=Bh(i)),i.persist=Py,i.isPropagationStopped=ky,i.isDefaultPrevented=Fy,i.nativeEvent=i};var Lh,Ty={enumerable:!1,configurable:!0,get:function(){return this.class}},Ah=Fe.vnode;Fe.vnode=function(i){typeof i.type=="string"&&function(t){var e=t.props,r=t.type,o={},n=r.indexOf("-")===-1;for(var a in e){var s=e[a];if(!(a==="value"&&"defaultValue"in e&&s==null||Iy&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in e&&e.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||Ey(e.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":Sy.test(a)&&(a=l):l=a="oninput":n&&Cy.test(a)?a=a.replace(Dy,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&o[a=l]&&(a="oninputCapture"),o[a]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Jt(e.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=Jt(e.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value})),e.class&&!e.className?(o.class=e.class,Object.defineProperty(o,"className",Ty)):(e.className&&!e.class||e.class&&e.className)&&(o.class=o.className=e.className),t.props=o}(i),i.$$typeof=xy,Ah&&Ah(i)};var Rh=Fe.__r;Fe.__r=function(i){Rh&&Rh(i),Lh=i.__c};var Oh=Fe.diffed;Fe.diffed=function(i){Oh&&Oh(i);var t=i.props,e=i.__e;e!=null&&i.type==="textarea"&&"value"in t&&t.value!==e.value&&(e.value=t.value==null?"":t.value),Lh=null};function Hn(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function By(i,t){return t===void 0&&(t=document),typeof i=="string"?t.querySelector(i):Hn(i)?i:null}var Uh=By;function Ay(i){for(var t;i&&!i.dir;)i=i.parentNode;return(t=i)==null?void 0:t.dir}var hs=Ay;var oo=class{constructor(t,e){this.uppy=t,this.opts=e??{}}getPluginState(){let{plugins:t}=this.uppy.getState();return t?.[this.id]||{}}setPluginState(t){let{plugins:e}=this.uppy.getState();this.uppy.setState({plugins:U(_({},e),{[this.id]:_(_({},e[this.id]),t)})})}setOptions(t){this.opts=_(_({},this.opts),t),this.setPluginState(void 0),this.i18nInit()}i18nInit(){let t=new Jo([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState(void 0)}addTarget(t){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(t){}afterUpdate(){}};function jh(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var Ry=0;function Oy(i){return"__private_"+Ry+++"_"+i}function My(i){let t=null,e;return function(){for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return e=o,t||(t=Promise.resolve().then(()=>(t=null,i(...e)))),t}}var $n=Oy("updateUI"),Kl=class i extends oo{constructor(){super(...arguments),Object.defineProperty(this,$n,{writable:!0,value:void 0})}getTargetPlugin(t){let e;if(typeof t?.addTarget=="function")e=t,e instanceof i||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:e,UIPlugin:i}}));else if(typeof t=="function"){let r=t;this.uppy.iteratePlugins(o=>{o instanceof r&&(e=o)})}return e}mount(t,e){let r=e.id,o=Uh(t);if(o){this.isTargetDOMEl=!0;let s=document.createElement("div");return s.classList.add("uppy-Root"),jh(this,$n)[$n]=My(l=>{this.uppy.getPlugin(this.id)&&(Yl(this.render(l,s),s),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${t}'`),this.opts.replaceTargetContent&&(o.innerHTML=""),Yl(this.render(this.uppy.getState(),s),s),this.el=s,o.appendChild(s),s.dir=this.opts.direction||hs(s)||"ltr",this.onMount(),this.el}let n=this.getTargetPlugin(t);if(n)return this.uppy.log(`Installing ${r} to ${n.id}`),this.parent=n,this.el=n.addTarget(e),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let a=`Invalid target option given to ${r}.`;throw typeof t=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(a)}render(t,e){throw new Error("Extend the render method to add your plugin to a DOM element")}update(t){if(this.el!=null){var e,r;(e=(r=jh(this,$n))[$n])==null||e.call(r,t)}}unmount(){if(this.isTargetDOMEl){var t;(t=this.el)==null||t.remove()}this.onUnmount()}onMount(){}onUnmount(){}},zt=Kl;function ms(i,t,e,r){return e===0||i===t?i:r===0?t:i+(t-i)*2**(-r/e)}var ei={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var op=je(Nt(),1);function Wn(i){let t=[],e="indeterminate",r;for(let{progress:n}of Object.values(i)){let{preprocess:a,postprocess:s}=n;r==null&&(a||s)&&({mode:e,message:r}=a||s),a?.mode==="determinate"&&t.push(a.value),s?.mode==="determinate"&&t.push(s.value)}let o=t.reduce((n,a)=>n+a/t.length,0);return{mode:e,message:r,value:o}}var tp=je(Nt(),1),ep=je(Dn(),1);function Ql(i){let t=Math.floor(i/3600)%24,e=Math.floor(i/60)%60,r=Math.floor(i%60);return{hours:t,minutes:e,seconds:r}}function Zl(i){let t=Ql(i),e=t.hours===0?"":`${t.hours}h`,r=t.minutes===0?"":`${t.hours===0?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`,o=t.hours!==0?"":`${t.minutes===0?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`;return`${e}${r}${o}`}var zy="\xB7",Vh=()=>` ${zy} `;function Hh(i){let{newFiles:t,isUploadStarted:e,recoveredState:r,i18n:o,uploadState:n,isSomeGhost:a,startUpload:s}=i,l=(0,tp.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===ei.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),u=t&&e&&!r?o("uploadXNewFiles",{smart_count:t}):o("uploadXFiles",{smart_count:t});return p("button",{type:"button",className:l,"aria-label":o("uploadXFiles",{smart_count:t}),onClick:s,disabled:a,"data-uppy-super-focusable":!0},u)}function $h(i){let{i18n:t,uppy:e}=i;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>e.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},p("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),t("retry"))}function Wh(i){let{i18n:t,uppy:e}=i;return p("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>e.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},p("g",{fill:"none",fillRule:"evenodd"},p("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),p("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function qh(i){let{isAllPaused:t,i18n:e,isAllComplete:r,resumableUploads:o,uppy:n}=i,a=e(t?"resume":"pause");function s(){if(!r){if(!o){n.cancelAll();return}if(t){n.resumeAll();return}n.pauseAll()}}return p("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:s,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},p("g",{fill:"none",fillRule:"evenodd"},p("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),p("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function Jh(i){let{i18n:t,doneButtonHandler:e}=i;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:e,"data-uppy-super-focusable":!0},t("done"))}function Gh(){return p("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},p("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function Xh(i){let{progress:t}=i,{value:e,mode:r,message:o}=t;return p("div",{className:"uppy-StatusBar-content"},p(Gh,null),r==="determinate"?`${Math.round(e*100)}% \xB7 `:"",o)}function Ny(i){let{numUploads:t,complete:e,totalUploadedSize:r,totalSize:o,totalETA:n,i18n:a}=i,s=t>1,l=(0,ep.default)(r);return p("div",{className:"uppy-StatusBar-statusSecondary"},s&&a("filesUploadedOfTotal",{complete:e,smart_count:t}),p("span",{className:"uppy-StatusBar-additionalInfo"},s&&Vh(),o!=null?a("dataUploadedOfTotal",{complete:l,total:(0,ep.default)(o)}):a("dataUploadedOfUnknown",{complete:l}),Vh(),n!=null&&a("xTimeLeft",{time:Zl(n)})))}function Yh(i){let{i18n:t,complete:e,numUploads:r}=i;return p("div",{className:"uppy-StatusBar-statusSecondary"},t("filesUploadedOfTotal",{complete:e,smart_count:r}))}function Ly(i){let{i18n:t,newFiles:e,startUpload:r}=i,o=(0,tp.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return p("div",{className:"uppy-StatusBar-statusSecondary"},p("div",{className:"uppy-StatusBar-statusSecondaryHint"},t("xMoreFilesAdded",{smart_count:e})),p("button",{type:"button",className:o,"aria-label":t("uploadXFiles",{smart_count:e}),onClick:r},t("upload")))}function Kh(i){let{i18n:t,supportsUploadProgress:e,totalProgress:r,showProgressDetails:o,isUploadStarted:n,isAllComplete:a,isAllPaused:s,newFiles:l,numUploads:u,complete:g,totalUploadedSize:m,totalSize:P,totalETA:E,startUpload:O}=i,te=l&&n;if(!n||a)return null;let ae=t(s?"paused":"uploading");function oe(){return!s&&!te&&o?e?p(Ny,{numUploads:u,complete:g,totalUploadedSize:m,totalSize:P,totalETA:E,i18n:t}):p(Yh,{i18n:t,complete:g,numUploads:u}):null}return p("div",{className:"uppy-StatusBar-content","aria-label":ae,title:ae},s?null:p(Gh,null),p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},e&&r!==0?`${ae}: ${r}%`:ae),oe(),te?p(Ly,{i18n:t,newFiles:l,startUpload:O}):null))}function Qh(i){let{i18n:t}=i;return p("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},p("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))}function Zh(i){let{error:t,i18n:e,complete:r,numUploads:o}=i;function n(){let a=`${e("uploadFailed")}
|
|
17
|
-
|
|
18
|
-
${t}`;alert(a)}return p("div",{className:"uppy-StatusBar-content",title:e("uploadFailed")},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},p("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},e("uploadFailed"),p("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":e("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:n,type:"button"},"?")),p(Yh,{i18n:e,complete:r,numUploads:o})))}var{STATE_ERROR:em,STATE_WAITING:Uy,STATE_PREPROCESSING:ip,STATE_UPLOADING:gs,STATE_POSTPROCESSING:rp,STATE_COMPLETE:ys}=ei;function np(i){let{newFiles:t,allowNewUpload:e,isUploadInProgress:r,isAllPaused:o,resumableUploads:n,error:a,hideUploadButton:s=void 0,hidePauseResumeButton:l=!1,hideCancelButton:u=!1,hideRetryButton:g=!1,recoveredState:m,uploadState:P,totalProgress:E,files:O,supportsUploadProgress:te,hideAfterFinish:ae=!1,isSomeGhost:oe,doneButtonHandler:pe=void 0,isUploadStarted:de,i18n:be,startUpload:me,uppy:w,isAllComplete:x,showProgressDetails:k=void 0,numUploads:j,complete:X,totalSize:ie,totalETA:Ie,totalUploadedSize:Je}=i;function tt(){switch(P){case rp:case ip:{let Q=Wn(O);return Q.mode==="determinate"?Q.value*100:E}case em:return null;case gs:return te?E:null;default:return E}}function Se(){switch(P){case rp:case ip:{let{mode:Q}=Wn(O);return Q==="indeterminate"}case gs:return!te;default:return!1}}let Ue=tt(),ue=Ue??100,Ee=!a&&t&&(!r&&!o||m)&&e&&!s,Ce=!u&&P!==Uy&&P!==ys,Pe=n&&!l&&P===gs,ne=a&&!x&&!g,L=pe&&P===ys,F=(0,op.default)("uppy-StatusBar-progress",{"is-indeterminate":Se()}),M=(0,op.default)("uppy-StatusBar",`is-${P}`,{"has-ghosts":oe}),z=(()=>{switch(P){case ip:case rp:return p(Xh,{progress:Wn(O)});case ys:return p(Qh,{i18n:be});case em:return p(Zh,{error:a,i18n:be,numUploads:j,complete:X});case gs:return p(Kh,{i18n:be,supportsUploadProgress:te,totalProgress:E,showProgressDetails:k,isUploadStarted:de,isAllComplete:x,isAllPaused:o,newFiles:t,numUploads:j,complete:X,totalUploadedSize:Je,totalSize:ie,totalETA:Ie,startUpload:me});default:return null}})();return!(Ee||ne||Pe||Ce||L)&&!z||P===ys&&ae?null:p("div",{className:M},p("div",{className:F,style:{width:`${ue}%`},role:"progressbar","aria-label":`${ue}%`,"aria-valuetext":`${ue}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Ue}),z,p("div",{className:"uppy-StatusBar-actions"},Ee?p(Hh,{newFiles:t,isUploadStarted:de,recoveredState:m,i18n:be,isSomeGhost:oe,startUpload:me,uploadState:P}):null,ne?p($h,{i18n:be,uppy:w}):null,Pe?p(qh,{isAllPaused:o,i18n:be,isAllComplete:x,resumableUploads:n,uppy:w}):null,Ce?p(Wh,{i18n:be,uppy:w}):null,L?p(Jh,{i18n:be,doneButtonHandler:pe}):null))}var tm={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function lt(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var jy=0;function Ko(i){return"__private_"+jy+++"_"+i}var Vy={version:"4.1.3"},Hy=2e3,$y=2e3;function Wy(i,t,e,r){if(i)return ei.STATE_ERROR;if(t)return ei.STATE_COMPLETE;if(e)return ei.STATE_WAITING;let o=ei.STATE_WAITING,n=Object.keys(r);for(let a=0;a<n.length;a++){let{progress:s}=r[n[a]];if(s.uploadStarted&&!s.uploadComplete)return ei.STATE_UPLOADING;s.preprocess&&(o=ei.STATE_PREPROCESSING),s.postprocess&&o!==ei.STATE_PREPROCESSING&&(o=ei.STATE_POSTPROCESSING)}return o}var qy={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},fi=Ko("lastUpdateTime"),Si=Ko("previousUploadedBytes"),lr=Ko("previousSpeed"),ti=Ko("previousETA"),ap=Ko("computeSmoothETA"),qn=Ko("onUploadStart"),no=class extends zt{constructor(t,e){super(t,_(_({},qy),e)),Object.defineProperty(this,ap,{value:Jy}),Object.defineProperty(this,fi,{writable:!0,value:void 0}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,lr,{writable:!0,value:void 0}),Object.defineProperty(this,ti,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,qn,{writable:!0,value:()=>{let{recoveredState:r}=this.uppy.getState();if(lt(this,lr)[lr]=null,lt(this,ti)[ti]=null,r){lt(this,Si)[Si]=Object.values(r.files).reduce((o,n)=>{let{progress:a}=n;return o+a.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}lt(this,fi)[fi]=performance.now(),lt(this,Si)[Si]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=tm,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(t){let{capabilities:e,files:r,allowNewUpload:o,totalProgress:n,error:a,recoveredState:s}=t,{newFiles:l,startedFiles:u,completeFiles:g,isUploadStarted:m,isAllComplete:P,isAllPaused:E,isUploadInProgress:O,isSomeGhost:te}=this.uppy.getObjectOfFilesPerState(),ae=s?Object.values(r):l,oe=!!e.resumableUploads,pe=e.uploadProgress!==!1,de=null,be=0;u.every(w=>w.progress.bytesTotal!=null&&w.progress.bytesTotal!==0)?(de=0,u.forEach(w=>{de+=w.progress.bytesTotal||0,be+=w.progress.bytesUploaded||0})):u.forEach(w=>{be+=w.progress.bytesUploaded||0});let me=lt(this,ap)[ap]({uploaded:be,total:de});return np({error:a,uploadState:Wy(a,P,s,t.files||{}),allowNewUpload:o,totalProgress:n,totalSize:de,totalUploadedSize:be,isAllComplete:!1,isAllPaused:E,isUploadStarted:m,isUploadInProgress:O,isSomeGhost:te,recoveredState:s,complete:g.length,newFiles:ae.length,numUploads:u.length,totalETA:me,files:r,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:oe,supportsUploadProgress:pe,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let t=this.el;hs(t)||(t.dir="ltr")}install(){let{target:t}=this.opts;t&&this.mount(t,this),this.uppy.on("upload",lt(this,qn)[qn]),lt(this,fi)[fi]=performance.now(),lt(this,Si)[Si]=this.uppy.getFiles().reduce((e,r)=>e+r.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",lt(this,qn)[qn])}};function Jy(i){var t,e;if(i.total==null||i.total===0)return null;let r=i.total-i.uploaded;if(r<=0)return null;(e=(t=lt(this,fi))[fi])!=null||(t[fi]=performance.now());let o=performance.now()-lt(this,fi)[fi];if(o===0){var n;return Math.round(((n=lt(this,ti)[ti])!=null?n:0)/100)/10}let a=i.uploaded-lt(this,Si)[Si];if(lt(this,Si)[Si]=i.uploaded,a<=0){var s;return Math.round(((s=lt(this,ti)[ti])!=null?s:0)/100)/10}let l=a/o,u=lt(this,lr)[lr]==null?l:ms(l,lt(this,lr)[lr],Hy,o);lt(this,lr)[lr]=u;let g=r/u,m=Math.max(lt(this,ti)[ti]-o,0),P=lt(this,ti)[ti]==null?g:ms(g,m,$y,o);return lt(this,ti)[ti]=P,lt(this,fi)[fi]=performance.now(),Math.round(P/100)/10}no.VERSION=Vy.version;var Gy={version:"4.2.1"},Xy={fixed:!1,hideAfterFinish:!0},Qo=class extends zt{constructor(t,e){super(t,_(_({},Xy),e)),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(t){let{totalProgress:e}=t,r=(e===0||e===100)&&this.opts.hideAfterFinish;return p("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":r},p("div",{className:"uppy-ProgressBar-inner",style:{width:`${e}%`}}),p("div",{className:"uppy-ProgressBar-percentage"},e))}install(){let{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount()}};Qo.VERSION=Gy.version;var Yi=Array.from;function Jn(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}function bs(i,t,e,r){let{onSuccess:o}=r;i.readEntries(n=>{let a=[...t,...n];n.length?queueMicrotask(()=>{bs(i,a,e,{onSuccess:o})}):o(a)},n=>{e(n),o(t)})}function im(i,t){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((r,o)=>i.file(r,o))},values(){return Pa(this,null,function*(){let r=i.createReader(),o=yield new Eo(new Promise(n=>{bs(r,[],t,{onSuccess:a=>n(a.map(s=>im(s,t)))})}));yield*ka(o)})},isSameEntry:void 0}}function rm(i,t,e){try{return e===void 0&&(e=void 0),function(){return Pa(this,null,function*(){let r=()=>`${t}/${i.name}`;if(i.kind==="file"){let l=yield new Eo(i.getFile());l!=null?(l.relativePath=t?r():null,yield l):e!=null&&(yield e)}else if(i.kind==="directory")try{for(var o=Fa(i.values()),n,a,s;n=!(a=yield new Eo(o.next())).done;n=!1){let l=a.value;yield*ka(rm(l,t?r():i.name))}}catch{s=[a]}finally{try{n&&(a=o.return)&&(yield new Eo(a.call(o)))}finally{if(s)throw s[0]}}else e!=null&&(yield e)})}()}catch(r){return Promise.reject(r)}}function sp(i,t){return Pa(this,null,function*(){let e=yield new Eo(Promise.all(Array.from(i.items,r=>G(null,null,function*(){let o;return o??(o=im(typeof r.getAsEntry=="function"?r.getAsEntry():r.webkitGetAsEntry(),t)),{fileSystemHandle:o,lastResortFile:r.getAsFile()}}))));for(let{lastResortFile:r,fileSystemHandle:o}of e)if(o!=null)try{yield*ka(rm(o,"",r))}catch(n){r!=null?yield r:t(n)}else r!=null&&(yield r)})}function lp(i){let t=Yi(i.files);return Promise.resolve(t)}function Gn(i,t){return G(this,null,function*(){var e;let r=(e=t?.logDropError)!=null?e:Function.prototype;try{let l=[];try{for(var o=Fa(sp(i,r)),n,a,s;n=!(a=yield o.next()).done;n=!1){let u=a.value;l.push(u)}}catch{s=[a]}finally{try{n&&(a=o.return)&&(yield a.call(o))}finally{if(s)throw s[0]}}return l}catch{return lp(i)}})}var om={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var Yy={version:"4.1.3"},Ky={inputName:"files[]",width:"100%",height:"100%"},Zo=class i extends zt{constructor(t,e){super(t,_(_({},Ky),e)),this.isDragDropSupported=Jn(),this.addFiles=r=>{let o=r.map(n=>({source:this.id,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}}));try{this.uppy.addFiles(o)}catch(n){this.uppy.log(n)}},this.onInputChange=r=>{let o=Yi(r.currentTarget.files||[]);o.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(o)),r.currentTarget.value=""},this.handleDragOver=r=>{var o,n;r.preventDefault(),r.stopPropagation();let{types:a}=r.dataTransfer,s=a.some(u=>u==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!s||!l){r.dataTransfer.dropEffect="none";return}r.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(o=(n=this.opts).onDragOver)==null||o.call(n,r)},this.handleDragLeave=r=>{var o,n;r.preventDefault(),r.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(o=(n=this.opts).onDragLeave)==null||o.call(n,r)},this.handleDrop=r=>G(this,null,function*(){var o,n;r.preventDefault(),r.stopPropagation(),this.setPluginState({isDraggingOver:!1});let a=l=>{this.uppy.log(l,"error")},s=yield Gn(r.dataTransfer,{logDropError:a});s.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(s)),(o=(n=this.opts).onDrop)==null||o.call(n,r)}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=om,this.i18nInit()}renderHiddenFileInput(){var t;let{restrictions:e}=this.uppy.opts;return p("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:r=>{this.fileInputRef=r},name:this.opts.inputName,multiple:e.maxNumberOfFiles!==1,accept:(t=e.allowedFileTypes)==null?void 0:t.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},p("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return p("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:p("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return p("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){let t=`uppy-u-reset
|
|
19
|
-
uppy-DragDrop-container
|
|
20
|
-
${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
|
|
21
|
-
${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
|
|
22
|
-
`,e={width:this.opts.width,height:this.opts.height};return p("button",{type:"button",className:t,style:e,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:t}=this.opts;this.setPluginState({isDraggingOver:!1}),t&&this.mount(t,this)}uninstall(){this.unmount()}};Zo.VERSION=Yy.version;var nm=300,vs=class extends st{constructor(){super(...arguments),this.ref=ds()}componentWillEnter(t){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(t,nm)}componentWillLeave(t){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(t,nm)}render(){let{children:t}=this.props;return p("div",{className:"uppy-Informer-animated",ref:this.ref},t)}};function Qy(i,t){return Object.assign(i,t)}function Zy(i,t){var e;return(e=i?.key)!=null?e:t}function eb(i,t){let e=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return e[t]||(e[t]=r=>{i.refs[t]=r})}function Xn(i){let t={};for(let e=0;e<i.length;e++)if(i[e]!=null){let r=Zy(i[e],e.toString(36));t[r]=i[e]}return t}function tb(i,t){i=i||{},t=t||{};let e=a=>t.hasOwnProperty(a)?t[a]:i[a],r={},o=[];for(let a in i)t.hasOwnProperty(a)?o.length&&(r[a]=o,o=[]):o.push(a);let n={};for(let a in t){if(r.hasOwnProperty(a))for(let s=0;s<r[a].length;s++){let l=r[a][s];n[r[a][s]]=e(l)}n[a]=e(a)}for(let a=0;a<o.length;a++)n[o[a]]=e(o[a]);return n}var ib=i=>i,rb=(()=>{class i extends st{constructor(e,r){super(e,r),this.refs={},this.state={children:Xn(Jt(Jt(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 e=this.state.children;for(let r in e)e[r]&&this.performAppear(r)}componentWillReceiveProps(e){let r=Xn(Jt(e.children)||[]),o=this.state.children;this.setState(a=>({children:tb(a.children,r)}));let n;for(n in r)if(r.hasOwnProperty(n)){let a=o&&o.hasOwnProperty(n);r[n]&&a&&this.currentlyTransitioningKeys[n]?(this.keysToEnter.push(n),this.keysToAbortLeave.push(n)):r[n]&&!a&&!this.currentlyTransitioningKeys[n]&&this.keysToEnter.push(n)}for(n in o)if(o.hasOwnProperty(n)){let a=r&&r.hasOwnProperty(n);o[n]&&!a&&!this.currentlyTransitioningKeys[n]&&this.keysToLeave.push(n)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:r}=this;this.keysToLeave=[],r.forEach(this.performLeave)}_finishAbort(e){let r=this.keysToAbortLeave.indexOf(e);r!==-1&&this.keysToAbortLeave.splice(r,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let r=this.refs[e];r!=null&&r.componentWillAppear?r.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let r=this.refs[e];r!=null&&r.componentDidAppear&&r.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let o=Xn(Jt(this.props.children)||[]);(!o||!o.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let r=this.refs[e];r!=null&&r.componentWillEnter?r.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let r=this.refs[e];r!=null&&r.componentDidEnter&&r.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let o=Xn(Jt(this.props.children)||[]);(!o||!o.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;let o=this.refs[e];o!=null&&o.componentWillLeave?o.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;let o=this.refs[e];o!=null&&o.componentDidLeave&&o.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let n=Xn(Jt(this.props.children)||[]);if(n&&n.hasOwnProperty(e))this.performEnter(e);else{let a=Qy({},this.state.children);delete a[e],this.setState({children:a})}}render(e,r){let ae=e,{childFactory:o,transitionLeave:n,transitionName:a,transitionAppear:s,transitionEnter:l,transitionLeaveTimeout:u,transitionEnterTimeout:g,transitionAppearTimeout:m,component:P}=ae,E=Ea(ae,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:O}=r,te=Object.entries(O).map(oe=>{let[pe,de]=oe;if(!de)return;let be=eb(this,pe);return Un(o(de),{ref:be,key:pe})}).filter(Boolean);return p(P,E,te)}}return i.defaultProps={component:"span",childFactory:ib},i})(),am=rb;var ob={version:"4.2.1"},ao=class extends zt{constructor(t,e){super(t,e),this.render=r=>p("div",{className:"uppy uppy-Informer"},p(am,null,r.info.map(o=>p(vs,{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}
|
|
23
|
-
|
|
24
|
-
${o.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:t}=this.opts;t&&this.mount(t,this)}};ao.VERSION=ob.version;var nb=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function ab(i,t,e){var r,o;let n=nb.exec(i),a=(r=(o=t.mimeType)!=null?o:n?.[1])!=null?r:"plain/text",s;if(n?.[2]!=null){let l=atob(decodeURIComponent(n[3])),u=new Uint8Array(l.length);for(let g=0;g<l.length;g++)u[g]=l.charCodeAt(g);s=[u]}else n?.[3]!=null&&(s=[decodeURIComponent(n[3])]);return e?new File(s,t.name||"",{type:a}):new Blob(s,{type:a})}var sm=ab;function ws(i){return i.startsWith("blob:")}function _s(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function $e(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var gm=typeof self<"u"?self:global,Zn=typeof navigator<"u",sb=Zn&&typeof HTMLImageElement>"u",lm=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),ym=gm.Buffer,bm=!!ym,lb=i=>i!==void 0;function vm(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(lb).length===0)}function Ct(i){let t=new Error(i);throw delete t.stack,t}function pm(i){let t=function(e){let r=0;return e.ifd0.enabled&&(r+=1024),e.exif.enabled&&(r+=2048),e.makerNote&&(r+=2048),e.userComment&&(r+=1024),e.gps.enabled&&(r+=512),e.interop.enabled&&(r+=100),e.ifd1.enabled&&(r+=1024),r+2048}(i);return i.jfif.enabled&&(t+=50),i.xmp.enabled&&(t+=2e4),i.iptc.enabled&&(t+=14e3),i.icc.enabled&&(t+=6e3),t}var pp=i=>String.fromCharCode.apply(null,i),dm=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,lo=class i{static from(t,e){return t instanceof this&&t.le===e?t:new i(t,void 0,void 0,e)}constructor(t,e=0,r,o){if(typeof o=="boolean"&&(this.le=o),Array.isArray(t)&&(t=new Uint8Array(t)),t===0)this.byteOffset=0,this.byteLength=0;else if(t instanceof ArrayBuffer){r===void 0&&(r=t.byteLength-e);let n=new DataView(t,e,r);this._swapDataView(n)}else if(t instanceof Uint8Array||t instanceof DataView||t instanceof i){r===void 0&&(r=t.byteLength-e),(e+=t.byteOffset)+r>t.byteOffset+t.byteLength&&Ct("Creating view outside of available memory in ArrayBuffer");let n=new DataView(t.buffer,e,r);this._swapDataView(n)}else if(typeof t=="number"){let n=new DataView(new ArrayBuffer(t));this._swapDataView(n)}else Ct("Invalid input argument for BufferView: "+t)}_swapArrayBuffer(t){this._swapDataView(new DataView(t))}_swapBuffer(t){this._swapDataView(new DataView(t.buffer,t.byteOffset,t.byteLength))}_swapDataView(t){this.dataView=t,this.buffer=t.buffer,this.byteOffset=t.byteOffset,this.byteLength=t.byteLength}_lengthToEnd(t){return this.byteLength-t}set(t,e,r=i){return t instanceof DataView||t instanceof i?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Uint8Array||Ct("BufferView.set(): Invalid data argument."),this.toUint8().set(t,e),new r(this,e,t.byteLength)}subarray(t,e){return e=e||this._lengthToEnd(t),new i(this,t,e)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(t,e){return new Uint8Array(this.buffer,this.byteOffset+t,e)}getString(t=0,e=this.byteLength){return o=this.getUint8Array(t,e),dm?dm.decode(o):bm?Buffer.from(o).toString("utf8"):decodeURIComponent(escape(pp(o)));var o}getLatin1String(t=0,e=this.byteLength){let r=this.getUint8Array(t,e);return pp(r)}getUnicodeString(t=0,e=this.byteLength){let r=[];for(let o=0;o<e&&t+o<this.byteLength;o+=2)r.push(this.getUint16(t+o));return pp(r)}getInt8(t){return this.dataView.getInt8(t)}getUint8(t){return this.dataView.getUint8(t)}getInt16(t,e=this.le){return this.dataView.getInt16(t,e)}getInt32(t,e=this.le){return this.dataView.getInt32(t,e)}getUint16(t,e=this.le){return this.dataView.getUint16(t,e)}getUint32(t,e=this.le){return this.dataView.getUint32(t,e)}getFloat32(t,e=this.le){return this.dataView.getFloat32(t,e)}getFloat64(t,e=this.le){return this.dataView.getFloat64(t,e)}getFloat(t,e=this.le){return this.dataView.getFloat32(t,e)}getDouble(t,e=this.le){return this.dataView.getFloat64(t,e)}getUintBytes(t,e,r){switch(e){case 1:return this.getUint8(t,r);case 2:return this.getUint16(t,r);case 4:return this.getUint32(t,r);case 8:return this.getUint64&&this.getUint64(t,r)}}getUint(t,e,r){switch(e){case 8:return this.getUint8(t,r);case 16:return this.getUint16(t,r);case 32:return this.getUint32(t,r);case 64:return this.getUint64&&this.getUint64(t,r)}}toString(t){return this.dataView.toString(t,this.constructor.name)}ensureChunk(){}};function up(i,t){Ct(`${i} '${t}' was not loaded, try using full build of exifr.`)}var ea=class extends Map{constructor(t){super(),this.kind=t}get(t,e){return this.has(t)||up(this.kind,t),e&&(t in e||function(r,o){Ct(`Unknown ${r} '${o}'.`)}(this.kind,t),e[t].enabled||up(this.kind,t)),super.get(t)}keyList(){return Array.from(this.keys())}},Is=new ea("file parser"),ii=new ea("segment parser"),ra=new ea("file reader"),pb=gm.fetch;function um(i,t){return(e=i).startsWith("data:")||e.length>1e4?hp(i,t,"base64"):lm&&i.includes("://")?cp(i,t,"url",xs):lm?hp(i,t,"fs"):Zn?cp(i,t,"url",xs):void Ct("Invalid input argument");var e}function cp(i,t,e,r){return G(this,null,function*(){return ra.has(e)?hp(i,t,e):r?function(o,n){return G(this,null,function*(){let a=yield n(o);return new lo(a)})}(i,r):void Ct(`Parser ${e} is not loaded`)})}function hp(i,t,e){return G(this,null,function*(){let r=new(ra.get(e))(i,t);return yield r.read(),r})}var xs=i=>pb(i).then(t=>t.arrayBuffer()),ta=i=>new Promise((t,e)=>{let r=new FileReader;r.onloadend=()=>t(r.result||new ArrayBuffer),r.onerror=e,r.readAsArrayBuffer(i)}),mp=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 wm(i,t,e){let r=new mp;for(let[o,n]of e)r.set(o,n);if(Array.isArray(t))for(let o of t)i.set(o,r);else i.set(t,r);return r}function _m(i,t,e){let r,o=i.get(t);for(r of e)o.set(r[0],r[1])}var oa=new Map,vp=new Map,wp=new Map,en=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Es=["jfif","xmp","icc","iptc","ihdr"],ia=["tiff",...Es],gt=["ifd0","ifd1","exif","gps","interop"],tn=[...ia,...gt],rn=["makerNote","userComment"],Ps=["translateKeys","translateValues","reviveValues","multiSegment"],on=[...Ps,"sanitize","mergeOutput","silentErrors"],Cs=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},so=class extends Cs{get needed(){return this.enabled||this.deps.size>0}constructor(t,e,r,o){if(super(),$e(this,"enabled",!1),$e(this,"skip",new Set),$e(this,"pick",new Set),$e(this,"deps",new Set),$e(this,"translateKeys",!1),$e(this,"translateValues",!1),$e(this,"reviveValues",!1),this.key=t,this.enabled=e,this.parse=this.enabled,this.applyInheritables(o),this.canBeFiltered=gt.includes(t),this.canBeFiltered&&(this.dict=oa.get(t)),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:n,skip:a}=r;n&&n.length>0&&this.translateTagSet(n,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:Ct(`Invalid options argument: ${r}`)}applyInheritables(t){let e,r;for(e of Ps)r=t[e],r!==void 0&&(this[e]=r)}translateTagSet(t,e){if(this.dict){let r,o,{tagKeys:n,tagValues:a}=this.dict;for(r of t)typeof r=="string"?(o=a.indexOf(r),o===-1&&(o=n.indexOf(Number(r))),o!==-1&&e.add(Number(n[o]))):e.add(r)}else for(let r of t)e.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ss(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ss(this.pick,this.deps)}},Lt={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},cm=new Map,po=class extends Cs{static useCached(t){let e=cm.get(t);return e!==void 0||(e=new this(t),cm.set(t,e)),e}constructor(t){super(),t===!0?this.setupFromTrue():t===void 0?this.setupFromUndefined():Array.isArray(t)?this.setupFromArray(t):typeof t=="object"?this.setupFromObject(t):Ct(`Invalid options argument ${t}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Zn?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let t;for(t of en)this[t]=Lt[t];for(t of on)this[t]=Lt[t];for(t of rn)this[t]=Lt[t];for(t of tn)this[t]=new so(t,Lt[t],void 0,this)}setupFromTrue(){let t;for(t of en)this[t]=Lt[t];for(t of on)this[t]=Lt[t];for(t of rn)this[t]=!0;for(t of tn)this[t]=new so(t,!0,void 0,this)}setupFromArray(t){let e;for(e of en)this[e]=Lt[e];for(e of on)this[e]=Lt[e];for(e of rn)this[e]=Lt[e];for(e of tn)this[e]=new so(e,!1,void 0,this);this.setupGlobalFilters(t,void 0,gt)}setupFromObject(t){let e;for(e of(gt.ifd0=gt.ifd0||gt.image,gt.ifd1=gt.ifd1||gt.thumbnail,Object.assign(this,t),en))this[e]=dp(t[e],Lt[e]);for(e of on)this[e]=dp(t[e],Lt[e]);for(e of rn)this[e]=dp(t[e],Lt[e]);for(e of ia)this[e]=new so(e,Lt[e],t[e],this);for(e of gt)this[e]=new so(e,Lt[e],t[e],this.tiff);this.setupGlobalFilters(t.pick,t.skip,gt,tn),t.tiff===!0?this.batchEnableWithBool(gt,!0):t.tiff===!1?this.batchEnableWithUserValue(gt,t):Array.isArray(t.tiff)?this.setupGlobalFilters(t.tiff,void 0,gt):typeof t.tiff=="object"&&this.setupGlobalFilters(t.tiff.pick,t.tiff.skip,gt)}batchEnableWithBool(t,e){for(let r of t)this[r].enabled=e}batchEnableWithUserValue(t,e){for(let r of t){let o=e[r];this[r].enabled=o!==!1&&o!==void 0}}setupGlobalFilters(t,e,r,o=r){if(t&&t.length){for(let a of o)this[a].enabled=!1;let n=hm(t,r);for(let[a,s]of n)Ss(this[a].pick,s),this[a].enabled=!0}else if(e&&e.length){let n=hm(e,r);for(let[a,s]of n)Ss(this[a].skip,s)}}filterNestedSegmentTags(){let{ifd0:t,exif:e,xmp:r,iptc:o,icc:n}=this;this.makerNote?e.deps.add(37500):e.skip.add(37500),this.userComment?e.deps.add(37510):e.skip.add(37510),r.enabled||t.skip.add(700),o.enabled||t.skip.add(33723),n.enabled||t.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:t,exif:e,gps:r,interop:o}=this;o.needed&&(e.deps.add(40965),t.deps.add(40965)),e.needed&&t.deps.add(34665),r.needed&&t.deps.add(34853),this.tiff.enabled=gt.some(n=>this[n].enabled===!0)||this.makerNote||this.userComment;for(let n of gt)this[n].finalizeFilters()}get onlyTiff(){return!Es.map(t=>this[t].enabled).some(t=>t===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let t of ia)this[t].enabled&&!ii.has(t)&&up("segment parser",t)}};function hm(i,t){let e,r,o,n,a=[];for(o of t){for(n of(e=oa.get(o),r=[],e))(i.includes(n[0])||i.includes(n[1]))&&r.push(n[0]);r.length&&a.push([o,r])}return a}function dp(i,t){return i!==void 0?i:t!==void 0?t:void 0}function Ss(i,t){for(let e of t)i.add(e)}$e(po,"default",Lt);var nn=class{constructor(t){$e(this,"parsers",{}),$e(this,"output",{}),$e(this,"errors",[]),$e(this,"pushToErrors",e=>this.errors.push(e)),this.options=po.useCached(t)}read(t){return G(this,null,function*(){this.file=yield function(e,r){return typeof e=="string"?um(e,r):Zn&&!sb&&e instanceof HTMLImageElement?um(e.src,r):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new lo(e):Zn&&e instanceof Blob?cp(e,r,"blob",ta):void Ct("Invalid input argument")}(t,this.options)})}setup(){if(this.fileParser)return;let{file:t}=this,e=t.getUint16(0);for(let[r,o]of Is)if(o.canHandle(t,e))return this.fileParser=new o(this.options,this.file,this.parsers),t[r]=!0;this.file.close&&this.file.close(),Ct("Unknown file format")}parse(){return G(this,null,function*(){let{output:t,errors:e}=this;return this.setup(),this.options.silentErrors?(yield this.executeParsers().catch(this.pushToErrors),e.push(...this.fileParser.errors)):yield this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&e.length>0&&(t.errors=e),vm(r=t)?void 0:r;var r})}executeParsers(){return G(this,null,function*(){let{output:t}=this;yield this.fileParser.parse();let e=Object.values(this.parsers).map(r=>G(this,null,function*(){let o=yield r.parse();r.assignToOutput(t,o)}));this.options.silentErrors&&(e=e.map(r=>r.catch(this.pushToErrors))),yield Promise.all(e)})}extractThumbnail(){return G(this,null,function*(){this.setup();let{options:t,file:e}=this,r=ii.get("tiff",t);var o;if(e.tiff?o={start:0,type:"tiff"}:e.jpeg&&(o=yield this.fileParser.getOrFindSegment("tiff")),o===void 0)return;let n=yield this.fileParser.ensureSegmentChunk(o),a=this.parsers.tiff=new r(n,t,e),s=yield a.extractThumbnail();return e.close&&e.close(),s})}};function xm(i,t){return G(this,null,function*(){let e=new nn(t);return yield e.read(i),e.parse()})}var db=Object.freeze({__proto__:null,parse:xm,Exifr:nn,fileParsers:Is,segmentParsers:ii,fileReaders:ra,tagKeys:oa,tagValues:vp,tagRevivers:wp,createDictionary:wm,extendDictionary:_m,fetchUrlAsArrayBuffer:xs,readBlobAsArrayBuffer:ta,chunkedProps:en,otherSegments:Es,segments:ia,tiffBlocks:gt,segmentsAndBlocks:tn,tiffExtractables:rn,inheritables:Ps,allFormatters:on,Options:po}),Vr=class{static findPosition(t,e){let r=t.getUint16(e+2)+2,o=typeof this.headerLength=="function"?this.headerLength(t,e,r):this.headerLength,n=e+o,a=r-o;return{offset:e,length:r,headerLength:o,start:n,size:a,end:n+a}}static parse(t,e={}){return new this(t,new po({[this.type]:e}),t).parse()}normalizeInput(t){return t instanceof lo?t:new lo(t)}constructor(t,e={},r){$e(this,"errors",[]),$e(this,"raw",new Map),$e(this,"handleError",o=>{if(!this.options.silentErrors)throw o;this.errors.push(o.message)}),this.chunk=this.normalizeInput(t),this.file=r,this.type=this.constructor.type,this.globalOptions=this.options=e,this.localOptions=e[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(t,e){let r=wp.get(e),o=vp.get(e),n=oa.get(e),a=this.options[e],s=a.reviveValues&&!!r,l=a.translateValues&&!!o,u=a.translateKeys&&!!n,g={};for(let[m,P]of t)s&&r.has(m)?P=r.get(m)(P):l&&o.has(m)&&(P=this.translateValue(P,o.get(m))),u&&n.has(m)&&(m=n.get(m)||m),g[m]=P;return g}translateValue(t,e){return e[t]||e.DEFAULT||t}assignToOutput(t,e){this.assignObjectToOutput(t,this.constructor.type,e)}assignObjectToOutput(t,e,r){if(this.globalOptions.mergeOutput)return Object.assign(t,r);t[e]?Object.assign(t[e],r):t[e]=r}};$e(Vr,"headerLength",4),$e(Vr,"type",void 0),$e(Vr,"multiSegment",!1),$e(Vr,"canHandle",()=>!1);function ub(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function cb(i){return i>=224&&i<=239}function hb(i,t,e){for(let[r,o]of ii)if(o.canHandle(i,t,e))return r}var Ds=class extends class{constructor(t,e,r){$e(this,"errors",[]),$e(this,"ensureSegmentChunk",o=>G(this,null,function*(){let n=o.start,a=o.size||65536;if(this.file.chunked)if(this.file.available(n,a))o.chunk=this.file.subarray(n,a);else try{o.chunk=yield this.file.readChunk(n,a)}catch(s){Ct(`Couldn't read segment: ${JSON.stringify(o)}. ${s.message}`)}else this.file.byteLength>n+a?o.chunk=this.file.subarray(n,a):o.size===void 0?o.chunk=this.file.subarray(n):Ct("Segment unreachable: "+JSON.stringify(o));return o.chunk})),this.extendOptions&&this.extendOptions(t),this.options=t,this.file=e,this.parsers=r}injectSegment(t,e){this.options[t].enabled&&this.createParser(t,e)}createParser(t,e){let r=new(ii.get(t))(e,this.options,this.file);return this.parsers[t]=r}createParsers(t){for(let e of t){let{type:r,chunk:o}=e,n=this.options[r];if(n&&n.enabled){let a=this.parsers[r];a&&a.append||a||this.createParser(r,o)}}}readSegments(t){return G(this,null,function*(){let e=t.map(this.ensureSegmentChunk);yield Promise.all(e)})}}{constructor(...t){super(...t),$e(this,"appSegments",[]),$e(this,"jpegSegments",[]),$e(this,"unknownSegments",[])}static canHandle(t,e){return e===65496}parse(){return G(this,null,function*(){yield this.findAppSegments(),yield this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)})}setupSegmentFinderArgs(t){t===!0?(this.findAll=!0,this.wanted=new Set(ii.keyList())):(t=t===void 0?ii.keyList().filter(e=>this.options[e].enabled):t.filter(e=>this.options[e].enabled&&ii.has(e)),this.findAll=!1,this.remaining=new Set(t),this.wanted=new Set(t)),this.unfinishedMultiSegment=!1}findAppSegments(t=0,e){return G(this,null,function*(){this.setupSegmentFinderArgs(e);let{file:r,findAll:o,wanted:n,remaining:a}=this;if(!o&&this.file.chunked&&(o=Array.from(n).some(s=>{let l=ii.get(s),u=this.options[s];return l.multiSegment&&u.multiSegment}),o&&(yield this.file.readWhole())),t=this.findAppSegmentsInRange(t,r.byteLength),!this.options.onlyTiff&&r.chunked){let s=!1;for(;a.size>0&&!s&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,u=this.appSegments.some(g=>!this.file.available(g.offset||g.start,g.length||g.size));if(s=t>l&&!u?!(yield r.readNextChunk(t)):!(yield r.readNextChunk(l)),(t=this.findAppSegmentsInRange(t,r.byteLength))===void 0)return}}})}findAppSegmentsInRange(t,e){e-=2;let r,o,n,a,s,l,{file:u,findAll:g,wanted:m,remaining:P,options:E}=this;for(;t<e;t++)if(u.getUint8(t)===255){if(r=u.getUint8(t+1),cb(r)){if(o=u.getUint16(t+2),n=hb(u,t,o),n&&m.has(n)&&(a=ii.get(n),s=a.findPosition(u,t),l=E[n],s.type=n,this.appSegments.push(s),!g&&(a.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||P.delete(n)):P.delete(n),P.size===0)))break;E.recordUnknownSegments&&(s=Vr.findPosition(u,t),s.marker=r,this.unknownSegments.push(s)),t+=o+1}else if(ub(r)){if(o=u.getUint16(t+2),r===218&&E.stopAfterSos!==!1)return;E.recordJpegSegments&&this.jpegSegments.push({offset:t,length:o,marker:r}),t+=o+1}}return t}mergeMultiSegments(){if(!this.appSegments.some(e=>e.multiSegment))return;let t=function(e,r){let o,n,a,s=new Map;for(let l=0;l<e.length;l++)o=e[l],n=o[r],s.has(n)?a=s.get(n):s.set(n,a=[]),a.push(o);return Array.from(s)}(this.appSegments,"type");this.mergedAppSegments=t.map(([e,r])=>{let o=ii.get(e,this.options);return o.handleMultiSegments?{type:e,chunk:o.handleMultiSegments(r)}:r[0]})}getSegment(t){return this.appSegments.find(e=>e.type===t)}getOrFindSegment(t){return G(this,null,function*(){let e=this.getSegment(t);return e===void 0&&(yield this.findAppSegments(0,[t]),e=this.getSegment(t)),e})}};$e(Ds,"type","jpeg"),Is.set("jpeg",Ds);var mb=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],fp=class extends Vr{parseHeader(){var t=this.chunk.getUint16();t===18761?this.le=!0:t===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(t,e,r=new Map){let{pick:o,skip:n}=this.options[e];o=new Set(o);let a=o.size>0,s=n.size===0,l=this.chunk.getUint16(t);t+=2;for(let u=0;u<l;u++){let g=this.chunk.getUint16(t);if(a){if(o.has(g)&&(r.set(g,this.parseTag(t,g,e)),o.delete(g),o.size===0))break}else!s&&n.has(g)||r.set(g,this.parseTag(t,g,e));t+=12}return r}parseTag(t,e,r){let{chunk:o}=this,n=o.getUint16(t+2),a=o.getUint32(t+4),s=mb[n];if(s*a<=4?t+=8:t=o.getUint32(t+8),(n<1||n>13)&&Ct(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${e.toString(16)}, type: ${n}, offset ${t}`),t>o.byteLength&&Ct(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${e.toString(16)}, type: ${n}, offset ${t} is outside of chunk size ${o.byteLength}`),n===1)return o.getUint8Array(t,a);if(n===2)return(l=function(u){for(;u.endsWith("\0");)u=u.slice(0,-1);return u}(l=o.getString(t,a)).trim())===""?void 0:l;var l;if(n===7)return o.getUint8Array(t,a);if(a===1)return this.parseTagValue(n,t);{let u=new(function(m){switch(m){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}}(n))(a),g=s;for(let m=0;m<a;m++)u[m]=this.parseTagValue(n,t),t+=g;return u}}parseTagValue(t,e){let{chunk:r}=this;switch(t){case 1:return r.getUint8(e);case 3:return r.getUint16(e);case 4:return r.getUint32(e);case 5:return r.getUint32(e)/r.getUint32(e+4);case 6:return r.getInt8(e);case 8:return r.getInt16(e);case 9:return r.getInt32(e);case 10:return r.getInt32(e)/r.getInt32(e+4);case 11:return r.getFloat(e);case 12:return r.getDouble(e);case 13:return r.getUint32(e);default:Ct(`Invalid tiff type ${t}`)}}},Qn=class extends fp{static canHandle(t,e){return t.getUint8(e+1)===225&&t.getUint32(e+4)===1165519206&&t.getUint16(e+8)===0}parse(){return G(this,null,function*(){this.parseHeader();let{options:t}=this;return t.ifd0.enabled&&(yield this.parseIfd0Block()),t.exif.enabled&&(yield this.safeParse("parseExifBlock")),t.gps.enabled&&(yield this.safeParse("parseGpsBlock")),t.interop.enabled&&(yield this.safeParse("parseInteropBlock")),t.ifd1.enabled&&(yield this.safeParse("parseThumbnailBlock")),this.createOutput()})}safeParse(t){let e=this[t]();return e.catch!==void 0&&(e=e.catch(this.handleError)),e}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let t=this.chunk.getUint16(this.ifd0Offset),e=this.ifd0Offset+2+12*t;this.ifd1Offset=this.chunk.getUint32(e)}}parseBlock(t,e){let r=new Map;return this[e]=r,this.parseTags(t,e,r),r}parseIfd0Block(){return G(this,null,function*(){if(this.ifd0)return;let{file:t}=this;this.findIfd0Offset(),this.ifd0Offset<8&&Ct("Malformed EXIF data"),!t.chunked&&this.ifd0Offset>t.byteLength&&Ct(`IFD0 offset points to outside of file.
|
|
25
|
-
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${t.byteLength}`),t.tiff&&(yield t.ensureChunk(this.ifd0Offset,pm(this.options)));let e=this.parseBlock(this.ifd0Offset,"ifd0");return e.size!==0?(this.exifOffset=e.get(34665),this.interopOffset=e.get(40965),this.gpsOffset=e.get(34853),this.xmp=e.get(700),this.iptc=e.get(33723),this.icc=e.get(34675),this.options.sanitize&&(e.delete(34665),e.delete(40965),e.delete(34853),e.delete(700),e.delete(33723),e.delete(34675)),e):void 0})}parseExifBlock(){return G(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,pm(this.options)));let t=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=t.get(40965)),this.makerNote=t.get(37500),this.userComment=t.get(37510),this.options.sanitize&&(t.delete(40965),t.delete(37500),t.delete(37510)),this.unpack(t,41728),this.unpack(t,41729),t})}unpack(t,e){let r=t.get(e);r&&r.length===1&&t.set(e,r[0])}parseGpsBlock(){return G(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let t=this.parseBlock(this.gpsOffset,"gps");return t&&t.has(2)&&t.has(4)&&(t.set("latitude",mm(...t.get(2),t.get(1))),t.set("longitude",mm(...t.get(4),t.get(3)))),t})}parseInteropBlock(){return G(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(t=!1){return G(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||t))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return G(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let t=this.ifd1.get(513),e=this.ifd1.get(514);return this.chunk.getUint8Array(t,e)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let t,e,r,o={};for(e of gt)if(t=this[e],!vm(t))if(r=this.canTranslate?this.translateBlock(t,e):Object.fromEntries(t),this.options.mergeOutput){if(e==="ifd1")continue;Object.assign(o,r)}else o[e]=r;return this.makerNote&&(o.makerNote=this.makerNote),this.userComment&&(o.userComment=this.userComment),o}assignToOutput(t,e){if(this.globalOptions.mergeOutput)Object.assign(t,e);else for(let[r,o]of Object.entries(e))this.assignObjectToOutput(t,r,o)}};function mm(i,t,e,r){var o=i+t/60+e/3600;return r!=="S"&&r!=="W"||(o*=-1),o}$e(Qn,"type","tiff"),$e(Qn,"headerLength",10),ii.set("tiff",Qn);var iC=Object.freeze({__proto__:null,default:db,Exifr:nn,fileParsers:Is,segmentParsers:ii,fileReaders:ra,tagKeys:oa,tagValues:vp,tagRevivers:wp,createDictionary:wm,extendDictionary:_m,fetchUrlAsArrayBuffer:xs,readBlobAsArrayBuffer:ta,chunkedProps:en,otherSegments:Es,segments:ia,tiffBlocks:gt,segmentsAndBlocks:tn,tiffExtractables:rn,inheritables:Ps,allFormatters:on,Options:po,parse:xm}),_p={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},rC=Object.assign({},_p,{firstChunkSize:4e4,gps:[1,2,3,4]});var oC=Object.assign({},_p,{tiff:!1,ifd1:!0,mergeOutput:!1});var fb=Object.assign({},_p,{firstChunkSize:4e4,ifd0:[274]});function gb(i){return G(this,null,function*(){let t=new nn(fb);yield t.read(i);let e=yield t.parse();if(e&&e.ifd0)return e.ifd0[274]})}var yb=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}}),Yn=!0,Kn=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let t=i.match(/OS (\d+)_(\d+)/);if(t){let[,e,r]=t;Yn=Number(e)+.1*Number(r)<13.4,Kn=!1}}else if(i.includes("OS X 10")){let[,t]=i.match(/OS X 10[_.](\d+)/);Yn=Kn=Number(t)<15}if(i.includes("Chrome/")){let[,t]=i.match(/Chrome\/(\d+)/);Yn=Kn=Number(t)<81}else if(i.includes("Firefox/")){let[,t]=i.match(/Firefox\/(\d+)/);Yn=Kn=Number(t)<77}}function Cm(i){return G(this,null,function*(){let t=yield gb(i);return Object.assign({canvas:Yn,css:Kn},yb[t])})}var gp=class extends lo{constructor(...t){super(...t),$e(this,"ranges",new yp),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(t,e,r){if(t===0&&this.byteLength===0&&r){let o=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(o)}else{let o=t+e;if(o>this.byteLength){let{dataView:n}=this._extend(o);this._swapDataView(n)}}}_extend(t){let e;e=bm?ym.allocUnsafe(t):new Uint8Array(t);let r=new DataView(e.buffer,e.byteOffset,e.byteLength);return e.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:e,dataView:r}}subarray(t,e,r=!1){return e=e||this._lengthToEnd(t),r&&this._tryExtend(t,e),this.ranges.add(t,e),super.subarray(t,e)}set(t,e,r=!1){r&&this._tryExtend(e,t.byteLength,t);let o=super.set(t,e);return this.ranges.add(e,o.byteLength),o}ensureChunk(t,e){return G(this,null,function*(){this.chunked&&(this.ranges.available(t,e)||(yield this.readChunk(t,e)))})}available(t,e){return this.ranges.available(t,e)}},yp=class{constructor(){$e(this,"list",[])}get length(){return this.list.length}add(t,e,r=0){let o=t+e,n=this.list.filter(a=>fm(t,a.offset,o)||fm(t,a.end,o));if(n.length>0){t=Math.min(t,...n.map(s=>s.offset)),o=Math.max(o,...n.map(s=>s.end)),e=o-t;let a=n.shift();a.offset=t,a.length=e,a.end=o,this.list=this.list.filter(s=>!n.includes(s))}else this.list.push({offset:t,length:e,end:o})}available(t,e){let r=t+e;return this.list.some(o=>o.offset<=t&&r<=o.end)}};function fm(i,t,e){return i<=t&&t<=e}var bp=class extends gp{constructor(t,e){super(0),$e(this,"chunksRead",0),this.input=t,this.options=e}readWhole(){return G(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return G(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return G(this,arguments,function*(t=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let e=this.options.chunkSize,r=yield this.readChunk(t,e);return!!r&&r.byteLength===e})}readChunk(t,e){return G(this,null,function*(){if(this.chunksRead++,(e=this.safeWrapAddress(t,e))!==0)return this._readChunk(t,e)})}safeWrapAddress(t,e){return this.size!==void 0&&t+e>this.size?Math.max(0,this.size-t):e}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(){}};ra.set("blob",class extends bp{readWhole(){return G(this,null,function*(){this.chunked=!1;let i=yield ta(this.input);this._swapArrayBuffer(i)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(i,t){return G(this,null,function*(){let e=t?i+t:void 0,r=this.input.slice(i,e),o=yield ta(r);return this.set(o,i,!0)})}});var Sm={strings:{generatingThumbnails:"Generating thumbnails..."}};var bb={version:"4.1.1"};function vb(i,t,e){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,t,e)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>sm(i.toDataURL(t,e),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function wb(i,t){let e=i.width,r=i.height;(t.deg===90||t.deg===270)&&(e=i.height,r=i.width);let o=document.createElement("canvas");o.width=e,o.height=r;let n=o.getContext("2d");return n.translate(e/2,r/2),t.canvas&&(n.rotate(t.rad),n.scale(t.scaleX,t.scaleY)),n.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),o}function _b(i){let t=i.width/i.height,e=5e6,r=4096,o=Math.floor(Math.sqrt(e*t)),n=Math.floor(e/Math.sqrt(e*t));if(o>r&&(o=r,n=Math.round(o/t)),n>r&&(n=r,o=Math.round(t*n)),i.width>o){let a=document.createElement("canvas");return a.width=o,a.height=n,a.getContext("2d").drawImage(i,0,0,o,n),a}return i}var xb={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},an=class extends zt{constructor(t,e){if(super(t,_(_({},xb),e)),this.onFileAdded=r=>{!r.preview&&r.data&&_s(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&&ws(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(o=>o.isRestored).forEach(o=>{(!o.preview||ws(o.preview))&&this.addToQueue(o.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=r=>{r.forEach(n=>{let a=this.uppy.getFile(n);this.uppy.emit("preprocess-progress",a,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let o=()=>{r.forEach(n=>{let a=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",a)})};return new Promise(n=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{o(),n()}):(o(),n())})},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=Sm,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(t,e,r){let o=URL.createObjectURL(t.data),n=new Promise((s,l)=>{let u=new Image;u.src=o,u.addEventListener("load",()=>{URL.revokeObjectURL(o),s(u)}),u.addEventListener("error",g=>{URL.revokeObjectURL(o),l(g.error||new Error("Could not create thumbnail"))})}),a=Cm(t.data).catch(()=>1);return Promise.all([n,a]).then(s=>{let[l,u]=s,g=this.getProportionalDimensions(l,e,r,u.deg),m=wb(l,u),P=this.resizeImage(m,g.width,g.height);return vb(P,this.thumbnailType,80)}).then(s=>URL.createObjectURL(s))}getProportionalDimensions(t,e,r,o){let n=t.width/t.height;return(o===90||o===270)&&(n=t.height/t.width),e!=null?{width:e,height:Math.round(e/n)}:r!=null?{width:Math.round(r*n),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(t,e,r){let o=_b(t),n=Math.ceil(Math.log2(o.width/e));n<1&&(n=1);let a=e*2**(n-1),s=r*2**(n-1),l=2;for(;n--;){let u=document.createElement("canvas");u.width=a,u.height=s,u.getContext("2d").drawImage(o,0,0,a,s),o=u,a=Math.round(a/l),s=Math.round(s/l)}return o}setPreviewURL(t,e){this.uppy.setFileState(t,{preview:e})}addToQueue(t){this.queue.push(t),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let t=this.uppy.getFile(this.queue.shift());return t?this.requestThumbnail(t).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(t){return _s(t.type)&&!t.isRemote?this.createThumbnail(t,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(e=>{this.setPreviewURL(t.id,e),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${t.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(t.id),e)}).catch(e=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${t.id}:`,"warning"),this.uppy.log(e,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(t.id),e)}):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)}};an.VERSION=bb.version;function Cb(i){if(typeof i=="string"){let t=document.querySelectorAll(i);return t.length===0?null:Array.from(t)}return typeof i=="object"&&Hn(i)?[i]:null}var xp=Cb;var $m=je(Nt(),1);function na(i){return U(_({},i),{type:i.mimeType,extension:i.name?Gi(i.name).extension:null})}function Sb(){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 Db(i){let{pluginName:t,i18n:e,onAuth:r}=i,o=t==="Google Drive",n=jr(a=>{a.preventDefault(),r()},[r]);return p("form",{onSubmit:n},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(Sb,null),e("signInWithGoogle")):p("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},e("authenticateWith",{pluginName:t})))}var Ib=i=>{let{pluginName:t,i18n:e,onAuth:r}=i;return p(Db,{pluginName:t,i18n:e,onAuth:r})};function ks(i){let{loading:t,pluginName:e,pluginIcon:r,i18n:o,handleAuth:n,renderForm:a=Ib}=i;return p("div",{className:"uppy-Provider-auth"},p("div",{className:"uppy-Provider-authIcon"},r()),p("div",{className:"uppy-Provider-authTitle"},o("authenticateWithTitle",{pluginName:e})),a({pluginName:e,i18n:o,loading:t,onAuth:n}))}var Dm=je(Nt(),1);function Cp(i){let{i18n:t,logout:e,username:r}=i;return p(Et,null,r&&p("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),p("button",{type:"button",onClick:e,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},t("logOut")))}function Sp(i){let{openFolder:t,title:e,breadcrumbsIcon:r,breadcrumbs:o,i18n:n}=i;return p("div",{className:"uppy-Provider-breadcrumbs"},p("div",{className:"uppy-Provider-breadcrumbsIcon"},r),o.map((a,s)=>{var l;return p(Et,null,p("button",{key:a.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>t(a.id)},a.type==="root"?e:(l=a.data.name)!=null?l:n("unnamed")),o.length===s+1?"":" / ")}))}function Dp(i){return p("div",{className:"uppy-ProviderBrowser-header"},p("div",{className:(0,Dm.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&p(Sp,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),p(Cp,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Ip(){return Ip=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)({}).hasOwnProperty.call(e,r)&&(i[r]=e[r])}return i},Ip.apply(null,arguments)}var Eb={position:"relative",width:"100%",minHeight:"100%"},Pb={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Ep=class extends st{constructor(t){super(t),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:t}=this.state;t!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(t){let te=t,{data:e,rowHeight:r,renderRow:o,overscanCount:n=10}=te,a=Ea(te,["data","rowHeight","renderRow","overscanCount"]),{offset:s,height:l}=this.state,u=Math.floor(s/r),g=Math.floor(l/r);n&&(u=Math.max(0,u-u%n),g+=n);let m=u+g+4,P=e.slice(u,m),E=U(_({},Eb),{height:e.length*r}),O=U(_({},Pb),{top:u*r});return p("div",Ip({onScroll:this.handleScroll},a),p("div",{role:"presentation",style:E},p("div",{role:"presentation",style:O},P.map(o))))}},Fs=Ep;var Im=je(Nt(),1);function kb(){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 Fb(){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 Tb(){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 sn(i){let{itemIconString:t,alt:e=void 0}=i;if(t===null)return null;switch(t){case"file":return p(kb,null);case"folder":return p(Fb,null);case"video":return p(Tb,null);default:return p("img",{src:t,alt:e,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function Bb(i){var t,e;let{file:r,toggleCheckbox:o,className:n,isDisabled:a,restrictionError:s,showTitles:l,children:u=null,i18n:g}=i;return p("li",{className:n,title:a&&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:a,"data-uppy-super-focusable":!0}),p("label",{htmlFor:r.id,"aria-label":(t=r.data.name)!=null?t:g("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p(sn,{itemIconString:r.data.thumbnail||r.data.icon}),l&&((e=r.data.name)!=null?e:g("unnamed")),u))}var Pp=Bb;function kp(i){var t,e,r;let{file:o,openFolder:n,className:a,isDisabled:s,restrictionError:l,toggleCheckbox:u,showTitles:g,i18n:m}=i;return p("li",{className:a,title:o.status!=="checked"&&l?l:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:u,name:"listitem",id:o.id,checked:o.status==="checked","aria-label":o.data.isFolder?m("allFilesFromFolderNamed",{name:(t=o.data.name)!=null?t:m("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:()=>n(o.id),"aria-label":m("openFolderNamed",{name:(e=o.data.name)!=null?e:m("unnamed")})},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(sn,{itemIconString:o.data.icon})),g&&o.data.name?p("span",null,o.data.name):m("unnamed")):p("label",{htmlFor:o.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(sn,{itemIconString:o.data.icon})),g&&((r=o.data.name)!=null?r:m("unnamed"))))}function Fp(i){let{viewType:t,toggleCheckbox:e,showTitles:r,i18n:o,openFolder:n,file:a,utmSource:s}=i,l=a.type==="folder"?null:a.restrictionError,u=!!l&&a.status!=="checked",g={file:a,openFolder:n,toggleCheckbox:e,utmSource:s,i18n:o,viewType:t,showTitles:r,className:(0,Im.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":u},{"uppy-ProviderBrowserItem--noPreview":a.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":a.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":a.status==="partial"}),isDisabled:u,restrictionError:l};switch(t){case"grid":return p(Pp,g);case"list":return p(kp,g);case"unsplash":return p(Pp,g,p("a",{href:`${a.data.author.url}?utm_source=${s}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},a.data.author.name));default:throw new Error(`There is no such type ${t}`)}}function Ab(i){let{displayedPartialTree:t,viewType:e,toggleCheckbox:r,handleScroll:o,showTitles:n,i18n:a,isLoading:s,openFolder:l,noResultsLabel:u,virtualList:g,utmSource:m}=i,[P,E]=mi(!1);if(Ci(()=>{let te=oe=>{oe.key==="Shift"&&E(!1)},ae=oe=>{oe.key==="Shift"&&E(!0)};return document.addEventListener("keyup",te),document.addEventListener("keydown",ae),()=>{document.removeEventListener("keyup",te),document.removeEventListener("keydown",ae)}},[]),s)return p("div",{className:"uppy-Provider-loading"},typeof s=="string"?s:a("loading"));if(t.length===0)return p("div",{className:"uppy-Provider-empty"},u);let O=te=>p(Fp,{viewType:e,toggleCheckbox:ae=>{var oe;ae.stopPropagation(),ae.preventDefault(),(oe=document.getSelection())==null||oe.removeAllRanges(),r(te,P)},showTitles:n,i18n:a,openFolder:l,file:te,utmSource:m});return g?p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list"},p(Fs,{data:t,renderRow:O,rowHeight:31}))):p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list",onScroll:o,role:"listbox",tabIndex:-1},t.map(O)))}var Ts=Ab;var Rb=(i,t,e,r,o)=>{let n=t.filter(E=>E.isFolder===!0),a=t.filter(E=>E.isFolder===!1),s=e.type==="folder"&&e.status==="checked",l=n.map(E=>({type:"folder",id:E.requestPath,cached:!1,nextPagePath:null,status:s?"checked":"unchecked",parentId:e.id,data:E})),u=a.map(E=>{let O=o(E);return{type:"file",id:E.requestPath,restrictionError:O,status:s&&!O?"checked":"unchecked",parentId:e.id,data:E}}),g=U(_({},e),{cached:!0,nextPagePath:r});return[...i.map(E=>E.id===g.id?g:E),...l,...u]},Em=Rb;var Ob=(i,t,e,r,o)=>{let n=i.find(O=>O.id===t),a=e.filter(O=>O.isFolder===!0),s=e.filter(O=>O.isFolder===!1),l=U(_({},n),{nextPagePath:r}),u=i.map(O=>O.id===l.id?l:O),g=l.type==="folder"&&l.status==="checked",m=a.map(O=>({type:"folder",id:O.requestPath,cached:!1,nextPagePath:null,status:g?"checked":"unchecked",parentId:l.id,data:O})),P=s.map(O=>{let te=o(O);return{type:"file",id:O.requestPath,restrictionError:te,status:g&&!te?"checked":"unchecked",parentId:l.id,data:O}});return[...u,...m,...P]},Pm=Ob;var Mb=i=>i.map(t=>_({},t)),Bs=Mb;var Tp=(i,t,e)=>{i.filter(o=>o.type!=="root"&&o.parentId===t).forEach(o=>{o.status=e&&!(o.type==="file"&&o.restrictionError)?"checked":"unchecked",Tp(i,o.id,e)})},Bp=(i,t)=>{let e=i.find(a=>a.id===t);if(e.type==="root")return;let r=i.filter(a=>a.type!=="root"&&a.parentId===e.id&&!(a.type==="file"&&a.restrictionError)),o=r.every(a=>a.status==="checked"),n=r.every(a=>a.status==="unchecked");o?e.status="checked":n?e.status="unchecked":e.status="partial",Bp(i,e.parentId)},zb=(i,t)=>{let e=Bs(i);if(t.length>=2){let r=e.filter(o=>o.type!=="root"&&t.includes(o.id));r.forEach(o=>{o.type==="file"?o.status=o.restrictionError?"unchecked":"checked":o.status="checked"}),r.forEach(o=>{Tp(e,o.id,!0)}),Bp(e,r[0].parentId)}else{let r=e.find(o=>o.id===t[0]);r.status=r.status==="checked"?"unchecked":"checked",Tp(e,r.id,r.status==="checked"),Bp(e,r.parentId)}return e},km=zb;var Rp=je(Tm(),1);var sa=class extends Error{constructor(t){super(t),this.name="TimeoutError"}},Op=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},Bm=i=>globalThis.DOMException===void 0?new Op(i):new DOMException(i),Am=i=>{let t=i.reason===void 0?Bm("This operation was aborted."):i.reason;return t instanceof Error?t:Bm(t)};function Mp(i,t){let{milliseconds:e,fallback:r,message:o,customTimers:n={setTimeout,clearTimeout}}=t,a,s,u=new Promise((g,m)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(t.signal){let{signal:E}=t;E.aborted&&m(Am(E)),s=()=>{m(Am(E))},E.addEventListener("abort",s,{once:!0})}if(e===Number.POSITIVE_INFINITY){i.then(g,m);return}let P=new sa;a=n.setTimeout.call(void 0,()=>{if(r){try{g(r())}catch(E){m(E)}return}typeof i.cancel=="function"&&i.cancel(),o===!1?g():o instanceof Error?m(o):(P.message=o??`Promise timed out after ${e} milliseconds`,m(P))},e),G(null,null,function*(){try{g(yield i)}catch(E){m(E)}})}).finally(()=>{u.clear(),s&&t.signal&&t.signal.removeEventListener("abort",s)});return u.clear=()=>{n.clearTimeout.call(void 0,a),a=void 0},u}function zp(i,t,e){let r=0,o=i.length;for(;o>0;){let n=Math.trunc(o/2),a=r+n;e(i[a],t)<=0?(r=++a,o-=n+1):o=n}return r}var Rs=class{#e=[];enqueue(t,e){e=_({priority:0},e);let r={priority:e.priority,id:e.id,run:t};if(this.size===0||this.#e[this.size-1].priority>=e.priority){this.#e.push(r);return}let o=zp(this.#e,r,(n,a)=>a.priority-n.priority);this.#e.splice(o,0,r)}setPriority(t,e){let r=this.#e.findIndex(n=>n.id===t);if(r===-1)throw new ReferenceError(`No promise function with the id "${t}" exists in the queue.`);let[o]=this.#e.splice(r,1);this.enqueue(o.run,{priority:e,id:t})}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(e=>e.priority===t.priority).map(e=>e.run)}get size(){return this.#e.length}};var Os=class extends Rp.default{#e;#a;#n=0;#h;#s;#m=0;#i;#l;#t;#f;#r=0;#p;#o;#g;#v=1n;timeout;constructor(t){if(super(),t=_({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Rs},t),!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#a=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#h=t.intervalCap,this.#s=t.interval,this.#t=new t.queueClass,this.#f=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#g=t.throwOnTimeout===!0,this.#o=t.autoStart===!1}get#w(){return this.#a||this.#n<this.#h}get#_(){return this.#r<this.#p}#x(){this.#r--,this.#d(),this.emit("next")}#C(){this.#b(),this.#y(),this.#l=void 0}get#S(){let t=Date.now();if(this.#i===void 0){let e=this.#m-t;if(e<0)this.#n=this.#e?this.#r:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#C()},e)),!0}return!1}#d(){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 t=!this.#S;if(this.#w&&this.#_){let e=this.#t.dequeue();return e?(this.emit("active"),e(),t&&this.#y(),!0):!1}}return!1}#y(){this.#a||this.#i!==void 0||(this.#i=setInterval(()=>{this.#b()},this.#s),this.#m=Date.now()+this.#s)}#b(){this.#n===0&&this.#r===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#n=this.#e?this.#r:0,this.#u()}#u(){for(;this.#d(););}get concurrency(){return this.#p}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#p=t,this.#u()}#D(t){return G(this,null,function*(){return new Promise((e,r)=>{t.addEventListener("abort",()=>{r(t.reason)},{once:!0})})})}setPriority(t,e){this.#t.setPriority(t,e)}add(r){return G(this,arguments,function*(t,e={}){return e.id??=(this.#v++).toString(),e=_({timeout:this.timeout,throwOnTimeout:this.#g},e),new Promise((o,n)=>{this.#t.enqueue(()=>G(this,null,function*(){this.#r++,this.#n++;try{e.signal?.throwIfAborted();let a=t({signal:e.signal});e.timeout&&(a=Mp(Promise.resolve(a),{milliseconds:e.timeout})),e.signal&&(a=Promise.race([a,this.#D(e.signal)]));let s=yield a;o(s),this.emit("completed",s)}catch(a){if(a instanceof sa&&!e.throwOnTimeout){o();return}n(a),this.emit("error",a)}finally{this.#x()}}),e),this.emit("add"),this.#d()})})}addAll(t,e){return G(this,null,function*(){return Promise.all(t.map(r=>G(this,null,function*(){return this.add(r,e)})))})}start(){return this.#o?(this.#o=!1,this.#u(),this):this}pause(){this.#o=!0}clear(){this.#t=new this.#f}onEmpty(){return G(this,null,function*(){this.#t.size!==0&&(yield this.#c("empty"))})}onSizeLessThan(t){return G(this,null,function*(){this.#t.size<t||(yield this.#c("next",()=>this.#t.size<t))})}onIdle(){return G(this,null,function*(){this.#r===0&&this.#t.size===0||(yield this.#c("idle"))})}#c(t,e){return G(this,null,function*(){return new Promise(r=>{let o=()=>{e&&!e()||(this.off(t,o),r())};this.on(t,o)})})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#r}get isPaused(){return this.#o}};var Rm=(i,t,e,r,o)=>G(null,null,function*(){let n=[],a=e.cached?e.nextPagePath:e.id;for(;a;){let m=yield r(a);n=n.concat(m.items),a=m.nextPagePath}let s=n.filter(m=>m.isFolder===!0),l=n.filter(m=>m.isFolder===!1),u=s.map(m=>({type:"folder",id:m.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:e.id,data:m})),g=l.map(m=>{let P=o(m);return{type:"file",id:m.requestPath,restrictionError:P,status:P?"unchecked":"checked",parentId:e.id,data:m}});e.cached=!0,e.nextPagePath=null,t.push(...g,...u),u.forEach(m=>G(null,null,function*(){i.add(()=>Rm(i,t,m,r,o))}))}),Ub=(i,t,e,r)=>G(null,null,function*(){let o=new Os({concurrency:6}),n=Bs(i);return n.filter(s=>s.type==="folder"&&s.status==="checked"&&(s.cached===!1||s.nextPagePath)).forEach(s=>{o.add(()=>Rm(o,n,s,t,e))}),o.on("completed",()=>{let s=n.filter(l=>l.type==="file"&&l.status==="checked").length;r(s)}),yield o.onIdle(),n}),Om=Ub;var uo={afterOpenFolder:Em,afterScrollFolder:Pm,afterToggleCheckbox:km,afterFill:Om};var jb=i=>{let{scrollHeight:t,scrollTop:e,offsetHeight:r}=i.target;return t-(e+r)<50},Ms=jb;var Vb=i=>t=>{if(!t.isAuthError){if(t.name==="AbortError"){i.log("Aborting request","warning");return}i.log(t,"error"),t.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(t.message)},"warning",5e3)}},pr=Vb;var Hb=(i,t,e,r)=>{let o=t.findIndex(n=>n.id===r);if(o!==-1&&e){let n=t.findIndex(s=>s.id===i);return t.slice(Math.min(o,n),Math.max(o,n)+1).map(s=>s.id)}return[i]},zs=Hb;var $b="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Mm=(i=21)=>{let t="",e=i|0;for(;e--;)t+=$b[Math.random()*64|0];return t};function Wb(i){let{searchString:t,setSearchString:e,submitSearchString:r,wrapperClassName:o,inputClassName:n,inputLabel:a,clearSearchLabel:s="",showButton:l=!1,buttonLabel:u="",buttonCSSClassName:g=""}=i,m=O=>{e(O.target.value)},P=jr(O=>{O.preventDefault(),r()},[r]),[E]=mi(()=>{let O=document.createElement("form");return O.setAttribute("tabindex","-1"),O.id=Mm(),O});return Ci(()=>(document.body.appendChild(E),E.addEventListener("submit",P),()=>{E.removeEventListener("submit",P),document.body.removeChild(E)}),[E,P]),p("section",{className:o},p("input",{className:`uppy-u-reset ${n}`,type:"search","aria-label":a,placeholder:a,value:t,onInput:m,form:E.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&&t&&p("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":s,title:s,onClick:()=>e("")},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 ${g}`,type:"submit",form:E.id},u))}var ln=Wb;var Nm=je(Nt(),1);var qb=i=>i.filter(e=>e.type==="file"&&e.status==="checked"?!0:e.type==="folder"&&e.status==="checked"?!i.some(o=>o.type!=="root"&&o.parentId===e.id):!1).length,zm=qb;function la(i){let{cancelSelection:t,donePicking:e,i18n:r,partialTree:o,validateAggregateRestrictions:n}=i,a=Ur(()=>n(o),[o,n]),s=Ur(()=>zm(o),[o]);return s===0?null:p("div",{className:"uppy-ProviderBrowser-footer"},p("div",{className:"uppy-ProviderBrowser-footer-buttons"},p("button",{className:(0,Nm.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":a}),disabled:!!a,onClick:e,type:"button"},r("selectX",{smart_count:s})),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:t,type:"button"},r("cancel"))),a&&p("div",{className:"uppy-ProviderBrowser-footer-error"},a))}var Jb=(i,t,e)=>{var r,o;return{id:i.id,source:t.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:t.opts.companionUrl,url:`${e.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:e.name,provider:e.provider,requestClientId:e.provider}}},Lm=Jb;var Gb=(i,t,e)=>{let r=i.map(a=>Lm(a,t,e)),o=[],n=[];r.forEach(a=>{t.uppy.checkIfFileAlreadyExists(os(a,t.uppy.getID()))?n.push(a):o.push(a)}),o.length>0&&t.uppy.info(t.uppy.i18n("addedNumFiles",{numFiles:o.length})),n.length>0&&t.uppy.info(`Not adding ${n.length} files because they already exist`),t.uppy.addFiles(o)},Ns=Gb;var Um=(i,t,e)=>{let r=t===null?"null":t;if(e[r])return e[r];let o=i.find(a=>a.id===t);if(o.type==="root")return[];let n=[...Um(i,o.parentId,e),o];return e[r]=n,n},Xb=i=>{let t=Object.create(null);return i.filter(o=>o.type==="file"&&o.status==="checked").map(o=>{let n=Um(i,o.id,t),a=n.findIndex(g=>g.type==="folder"&&g.status==="checked"),s=n.slice(a),l=`/${n.map(g=>g.data.name).join("/")}`,u=s.length===1?void 0:s.map(g=>g.data.name).join("/");return U(_({},o.data),{absDirPath:l,relDirPath:u})})},Ls=Xb;var Yb=(i,t)=>{let e=i.find(o=>o.id===t),r=[];for(;r=[e,...r],e.type!=="root";){let o=e.parentId;e=i.find(n=>n.id===o)}return r},jm=Yb;function Hr(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var Kb=0;function Hm(i){return"__private_"+Kb+++"_"+i}var Qb={version:"4.4.4"};function da(){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 Vm=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),co=Hm("abortController"),Di=Hm("withAbort"),pa=class{constructor(t,e){Object.defineProperty(this,Di,{value:Zb}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,co,{writable:!0,value:void 0}),this.validateSingleFile=o=>{let n=na(o);return this.plugin.uppy.validateSingleFile(n)},this.getDisplayedPartialTree=()=>{let{partialTree:o,currentFolderId:n,searchString:a}=this.plugin.getPluginState(),s=o.filter(u=>u.type!=="root"&&u.parentId===n);return a===""?s:s.filter(u=>{var g;return((g=u.data.name)!=null?g:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(a.toLowerCase())!==-1})},this.validateAggregateRestrictions=o=>{let a=o.filter(s=>s.type==="file"&&s.status==="checked").map(s=>s.data);return this.plugin.uppy.validateAggregateRestrictions(a)},this.plugin=t,this.provider=e.provider;let r={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=_(_({},r),e),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(Vm(this.plugin.rootFolderId))}tearDown(){}setLoading(t){this.plugin.setPluginState({loading:t})}cancelSelection(){let{partialTree:t}=this.plugin.getPluginState(),e=t.map(r=>r.type==="root"?r:U(_({},r),{status:"unchecked"}));this.plugin.setPluginState({partialTree:e})}openFolder(t){return G(this,null,function*(){this.lastCheckbox=null;let{partialTree:e}=this.plugin.getPluginState(),r=e.find(o=>o.id===t);if(r.cached){this.plugin.setPluginState({currentFolderId:t,searchString:""});return}this.setLoading(!0),yield Hr(this,Di)[Di](o=>G(this,null,function*(){let n=t,a=[];do{let{username:l,nextPagePath:u,items:g}=yield this.provider.list(n,{signal:o});this.plugin.setPluginState({username:l}),n=u,a=a.concat(g),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:a.length}))}while(this.opts.loadAllFiles&&n);let s=uo.afterOpenFolder(e,a,r,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:s,currentFolderId:t,searchString:""})})).catch(pr(this.plugin.uppy)),this.setLoading(!1)})}logout(){return G(this,null,function*(){yield Hr(this,Di)[Di](t=>G(this,null,function*(){let e=yield this.provider.logout({signal:t});if(e.ok){if(!e.revoked){let r=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:e.manual_revoke_url});this.plugin.uppy.info(r,"info",7e3)}this.plugin.setPluginState(U(_({},Vm(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(pr(this.plugin.uppy))})}handleAuth(t){return G(this,null,function*(){yield Hr(this,Di)[Di](e=>G(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:t,signal:e}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(pr(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(t){return G(this,null,function*(){let{partialTree:e,currentFolderId:r}=this.plugin.getPluginState(),o=e.find(n=>n.id===r);Ms(t)&&!this.isHandlingScroll&&o.nextPagePath&&(this.isHandlingScroll=!0,yield Hr(this,Di)[Di](n=>G(this,null,function*(){let{nextPagePath:a,items:s}=yield this.provider.list(o.nextPagePath,{signal:n}),l=uo.afterScrollFolder(e,r,s,a,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(pr(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return G(this,null,function*(){let{partialTree:t}=this.plugin.getPluginState();this.setLoading(!0),yield Hr(this,Di)[Di](e=>G(this,null,function*(){let r=yield uo.afterFill(t,a=>this.provider.list(a,{signal:e}),this.validateSingleFile,a=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:a}))});if(this.validateAggregateRestrictions(r)){this.plugin.setPluginState({partialTree:r});return}let n=Ls(r);Ns(n,this.plugin,this.provider),this.resetPluginState()})).catch(pr(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(t,e){let{partialTree:r}=this.plugin.getPluginState(),o=zs(t.id,this.getDisplayedPartialTree(),e,this.lastCheckbox),n=uo.afterToggleCheckbox(r,o);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=t.id}render(t,e){e===void 0&&(e={});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 n=_(_({},this.opts),e),{authenticated:a,loading:s}=this.plugin.getPluginState(),l=this.plugin.icon||da;if(a===!1)return p(ks,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:n.renderAuthForm,loading:s});let{partialTree:u,currentFolderId:g,username:m,searchString:P}=this.plugin.getPluginState(),E=jm(u,g);return p("div",{className:(0,$m.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n.viewType}`)},p(Dp,{showBreadcrumbs:n.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:E,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:m,i18n:o}),n.showFilter&&p(ln,{searchString:P,setSearchString:O=>{this.plugin.setPluginState({searchString:O})},submitSearchString:()=>{},inputLabel:o("filter"),clearSearchLabel:o("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(Ts,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:n.virtualList,noResultsLabel:o("noFilesFound"),handleScroll:this.handleScroll,viewType:n.viewType,showTitles:n.showTitles,i18n:this.plugin.uppy.i18n,isLoading:s,utmSource:"Companion"}),p(la,{partialTree:u,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:o,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function Zb(i){return G(this,null,function*(){var t;(t=Hr(this,co)[co])==null||t.abort();let e=new AbortController;Hr(this,co)[co]=e;let r=()=>{e.abort()};try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),yield i(e.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),Hr(this,co)[co]=void 0}})}pa.VERSION=Qb.version;var Wm=je(Nt(),1);var e1={version:"4.4.4"},t1={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},i1={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},pn=class{constructor(t,e){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=r=>{let o=na(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 n=r.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(n)},this.plugin=t,this.provider=e.provider,this.opts=_(_({},i1),e),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(t){this.plugin.setPluginState({loading:t})}resetPluginState(){this.plugin.setPluginState(t1)}cancelSelection(){let{partialTree:t}=this.plugin.getPluginState(),e=t.map(r=>r.type==="root"?r:U(_({},r),{status:"unchecked"}));this.plugin.setPluginState({partialTree:e})}search(){return G(this,null,function*(){let{searchString:t}=this.plugin.getPluginState();if(t!==""){this.setLoading(!0);try{let e=yield this.provider.search(t),r=[{type:"root",id:null,cached:!1,nextPagePath:e.nextPageQuery},...e.items.map(o=>({type:"file",id:o.requestPath,status:"unchecked",parentId:null,data:o}))];this.plugin.setPluginState({partialTree:r,isInputMode:!1})}catch(e){pr(this.plugin.uppy)(e)}this.setLoading(!1)}})}handleScroll(t){return G(this,null,function*(){let{partialTree:e,searchString:r}=this.plugin.getPluginState(),o=e.find(n=>n.type==="root");if(Ms(t)&&!this.isHandlingScroll&&o.nextPagePath){this.isHandlingScroll=!0;try{let n=yield this.provider.search(r,o.nextPagePath),a=U(_({},o),{nextPagePath:n.nextPageQuery}),s=e.filter(u=>u.type!=="root"),l=[a,...s,...n.items.map(u=>({type:"file",id:u.requestPath,status:"unchecked",parentId:null,data:u}))];this.plugin.setPluginState({partialTree:l})}catch(n){pr(this.plugin.uppy)(n)}this.isHandlingScroll=!1}})}donePicking(){return G(this,null,function*(){let{partialTree:t}=this.plugin.getPluginState(),e=Ls(t);Ns(e,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(t,e){let{partialTree:r}=this.plugin.getPluginState(),o=zs(t.id,this.getDisplayedPartialTree(),e,this.lastCheckbox),n=uo.afterToggleCheckbox(r,o);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=t.id}render(t,e){e===void 0&&(e={});let{isInputMode:r,searchString:o,loading:n,partialTree:a}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy,l=_(_({},this.opts),e);return r?p(ln,{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,Wm.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&p(ln,{searchString:o,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("search"),clearSearchLabel:s("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(Ts,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>G(this,null,function*(){}),noResultsLabel:s("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:n,i18n:s,virtualList:!1,utmSource:this.opts.utmSource}),p(la,{partialTree:a,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};pn.VERSION=e1.version;var r1="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Us=(i=21)=>{let t="",e=i|0;for(;e--;)t+=r1[Math.random()*64|0];return t};var qm=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function o1(i,t){return!!(i===t||qm(i)&&qm(t))}function n1(i,t){if(i.length!==t.length)return!1;for(var e=0;e<i.length;e++)if(!o1(i[e],t[e]))return!1;return!0}function Np(i,t){t===void 0&&(t=n1);var e=null;function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];if(e&&e.lastThis===this&&t(o,e.lastArgs))return e.lastResult;var a=i.apply(this,o);return e={lastResult:a,lastArgs:o,lastThis:this},a}return r.clear=function(){e=null},r}var js=['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 ua(i,t){if(t){let e=i.querySelector(`[data-uppy-paneltype="${t}"]`);if(e)return e}return i}function Jm(i,t){let e=t[0];e&&(e.focus(),i.preventDefault())}function a1(i,t){let e=t[t.length-1];e&&(e.focus(),i.preventDefault())}function s1(i){return i.contains(document.activeElement)}function Lp(i,t,e){let r=ua(e,t),o=Yi(r.querySelectorAll(js)),n=o.indexOf(document.activeElement);s1(r)?i.shiftKey&&n===0?a1(i,o):!i.shiftKey&&n===o.length-1&&Jm(i,o):Jm(i,o)}function Gm(i,t,e){t===null||Lp(i,t,e)}var Xm=je(Pl(),1);function Up(){let i=!1;return(0,Xm.default)((e,r)=>{let o=ua(e,r),n=o.contains(document.activeElement);if(n&&i)return;let a=o.querySelector("[data-uppy-super-focusable]");if(!(n&&!a))if(a)a.focus({preventScroll:!0}),i=!0;else{let s=o.querySelector(js);s?.focus({preventScroll:!0}),i=!1}},260)}var mf=je(Nt(),1);var Zm=je(Nt(),1);function Ym(i,t){if(i===t)return!0;if(!i||!t)return!1;let e=Object.keys(i),r=Object.keys(t),o=e.length;if(r.length!==o)return!1;for(let n=0;n<o;n++){let a=e[n];if(i[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0}function p1(){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 d1(){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 u1(){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 c1(){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 h1(){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 m1(){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 f1(){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 ho(i){let t={color:"#838999",icon:m1()};if(!i)return t;let e=i.split("/")[0],r=i.split("/")[1];return e==="text"?{color:"#5a5e69",icon:f1()}:e==="image"?{color:"#686de0",icon:p1()}:e==="audio"?{color:"#068dbb",icon:d1()}:e==="video"?{color:"#19af67",icon:u1()}:e==="application"&&r==="pdf"?{color:"#e25149",icon:c1()}:e==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:h1()}:t}function ca(i){let{file:t}=i;if(t.preview)return p("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});let{color:e,icon:r}=ho(t.type);return p("div",{className:"uppy-Dashboard-Item-previewIconWrap"},p("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:e}},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 g1=(i,t)=>(typeof t=="function"?t():t).filter(o=>o.id===i)[0].name;function ha(i){let{file:t,toggleFileCard:e,i18n:r,metaFields:o}=i,{missingRequiredMetaFields:n}=t;if(!(n!=null&&n.length))return null;let a=n.map(s=>g1(s,o)).join(", ");return p("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:n.length,fields:a})," ",p("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>e(!0,t.id)},r("editFile")))}function jp(i){let{file:t,i18n:e,toggleFileCard:r,metaFields:o,showLinkToFileUploadResult:n}=i,s=t.preview?"rgba(255, 255, 255, 0.5)":ho(t.type).color;return p("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:s}},n&&t.uploadURL&&p("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name},p("span",{hidden:!0},t.meta.name)),p(ca,{file:t}),p(ha,{file:t,i18n:e,toggleFileCard:r,metaFields:o}))}function y1(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 Km(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 Vp(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":Km(i),title:Km(i),onClick:()=>y1(i)},i.children))}function Vs(i){let{children:t}=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"},t)}function Hp(i){let{progress:t}=i,e=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":e,"stroke-dashoffset":e-e/100*t}))}function $p(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(Vs,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(Vp,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(Vp,i,p(Vs,null,p(Hp,{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(Vp,i,p(Vs,null,p(Hp,{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(Vs,null,p(Hp,{progress:i.file.progress.percentage}))))}var Qm=je(Dn(),1);var Wp="...";function Hs(i,t){if(t===0)return"";if(i.length<=t)return i;if(t<=Wp.length+1)return`${i.slice(0,t-1)}\u2026`;let e=t-Wp.length,r=Math.ceil(e/2),o=Math.floor(e/2);return i.slice(0,r)+Wp+i.slice(-o)}var b1=i=>{let{author:t,name:e}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:t?20:30}return p("div",{className:"uppy-Dashboard-Item-name",title:e},Hs(e,r()))},v1=i=>{var t;let{author:e}=i.file.meta,r=(t=i.file.remote)==null?void 0:t.providerName,o="\xB7";return e?p("div",{className:"uppy-Dashboard-Item-author"},p("a",{href:`${e.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Hs(e.name,13)),r?p(Fragment,null,` ${o} `,r,` ${o} `):null):null},w1=i=>i.file.size&&p("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Qm.default)(i.file.size)),_1=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"))),x1=i=>{let{file:t,onClick:e}=i;return t.error?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:e,type:"button"},"?"):null};function qp(i){let{file:t,i18n:e,toggleFileCard:r,metaFields:o,toggleAddFilesPanel:n,isSingleFile:a,containerHeight:s,containerWidth:l}=i;return p("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source},p("div",{className:"uppy-Dashboard-Item-fileName"},b1({file:t,isSingleFile:a,containerHeight:s,containerWidth:l}),p(x1,{file:t,onClick:()=>alert(t.error)})),p("div",{className:"uppy-Dashboard-Item-status"},v1({file:t}),w1({file:t}),_1({file:t,toggleAddFilesPanel:n,i18n:e})),p(ha,{file:t,i18n:e,toggleFileCard:r,metaFields:o}))}function Jp(i,t){return t===void 0&&(t="Copy the URL below"),new Promise(e=>{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(t,i),e()};try{return document.execCommand("copy")?(document.body.removeChild(r),e()):o()}catch{return document.body.removeChild(r),o()}})}function C1(i){let{file:t,uploadInProgressOrComplete:e,metaFields:r,canEditFile:o,i18n:n,onClick:a}=i;return!e&&r&&r.length>0||!e&&o(t)?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":n("editFileWithFilename",{file:t.meta.name}),title:n("editFileWithFilename",{file:t.meta.name}),onClick:()=>a()},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 S1(i){let{i18n:t,onClick:e,file:r}=i;return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile",{file:r.meta.name}),title:t("removeFile",{file:r.meta.name}),onClick:()=>e()},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 D1(i){let{file:t,uppy:e,i18n:r}=i,o=n=>{Jp(t.uploadURL,r("copyLinkToClipboardFallback")).then(()=>{e.log("Link copied to clipboard."),e.info(r("copyLinkToClipboardSuccess"),"info",3e3)}).catch(e.log).then(()=>n.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:n=>o(n)},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 Gp(i){let{uppy:t,file:e,uploadInProgressOrComplete:r,canEditFile:o,metaFields:n,showLinkToFileUploadResult:a,showRemoveButton:s,i18n:l,toggleFileCard:u,openFileEditor:g}=i;return p("div",{className:"uppy-Dashboard-Item-actionWrapper"},p(C1,{i18n:l,file:e,uploadInProgressOrComplete:r,canEditFile:o,metaFields:n,onClick:()=>{n&&n.length>0?u(!0,e.id):g(e)}}),a&&e.uploadURL?p(D1,{file:e,uppy:t,i18n:l}):null,s?p(S1,{i18n:l,file:e,onClick:()=>t.removeFile(e.id)}):null)}var $s=class extends st{componentDidMount(){let{file:t}=this.props;t.preview||this.props.handleRequestThumbnail(t)}shouldComponentUpdate(t){return!Ym(this.props,t)}componentDidUpdate(){let{file:t}=this.props;t.preview||this.props.handleRequestThumbnail(t)}componentWillUnmount(){let{file:t}=this.props;t.preview||this.props.handleCancelThumbnail(t)}render(){let{file:t}=this.props,e=t.progress.preprocess||t.progress.postprocess,r=!!t.progress.uploadComplete&&!e&&!t.error,o=!!t.progress.uploadStarted||!!e,n=t.progress.uploadStarted&&!t.progress.uploadComplete||e,a=t.error||!1,{isGhost:s}=t,l=(this.props.individualCancellation||!n)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);let u=(0,Zm.default)({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":e,"is-complete":r,"is-error":!!a,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return p("div",{className:u,id:`uppy_${t.id}`,role:this.props.role},p("div",{className:"uppy-Dashboard-Item-preview"},p(jp,{file:t,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),p($p,{uppy:this.props.uppy,file:t,error:a,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(qp,{file:t,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(Gp,{file:t,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 I1(i,t){let e=[],r=[];return i.forEach(o=>{r.length<t?r.push(o):(e.push(r),r=[o])}),r.length&&e.push(r),e}function Xp(i){let{id:t,i18n:e,uppy:r,files:o,resumableUploads:n,hideRetryButton:a,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:u,showRemoveButtonAfterComplete:g,metaFields:m,isSingleFile:P,toggleFileCard:E,handleRequestThumbnail:O,handleCancelThumbnail:te,recoveredState:ae,individualCancellation:oe,itemsPerRow:pe,openFileEditor:de,canEditFile:be,toggleAddFilesPanel:me,containerWidth:w,containerHeight:x}=i,k=pe===1?71:200,j=Ur(()=>{let ie=(Je,tt)=>Number(o[tt].isGhost)-Number(o[Je].isGhost),Ie=Object.keys(o);return ae&&Ie.sort(ie),I1(Ie,pe)},[o,pe,ae]),X=ie=>p("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:ie[0]},ie.map(Ie=>p($s,{key:Ie,uppy:r,id:t,i18n:e,resumableUploads:n,individualCancellation:oe,hideRetryButton:a,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:u,showRemoveButtonAfterComplete:g,metaFields:m,recoveredState:ae,isSingleFile:P,containerWidth:w,containerHeight:x,toggleFileCard:E,handleRequestThumbnail:O,handleCancelThumbnail:te,role:"listitem",openFileEditor:de,canEditFile:be,toggleAddFilesPanel:me,file:o[Ie]})));return P?p("div",{class:"uppy-Dashboard-files"},X(j[0])):p(Fs,{class:"uppy-Dashboard-files",role:"list",data:j,renderRow:X,rowHeight:k})}var Yp=class extends st{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var t;(t=this.fileInput)==null||t.click()},this.triggerFolderInputClick=()=>{var t;(t=this.folderInput)==null||t.click()},this.triggerVideoCameraInputClick=()=>{var t;(t=this.mobileVideoFileInput)==null||t.click()},this.triggerPhotoCameraInputClick=()=>{var t;(t=this.mobilePhotoFileInput)==null||t.click()},this.onFileInputChange=t=>{this.props.handleInputChange(t),t.currentTarget.value=""},this.renderHiddenInput=(t,e)=>{var r;return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:t,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(r=this.props.allowedFileTypes)==null?void 0:r.join(", "),ref:e})},this.renderHiddenCameraInput=(t,e,r)=>{let n={photo:"image/*",video:"video/*"}[t];return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${t}`,onChange:this.onFileInputChange,capture:e,accept:n,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=(t,e)=>{let r=this.props.acquirers.length;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:e,"data-uppy-super-focusable":r===0},t)},this.renderDropPasteBrowseTagline=t=>{let e=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),o=this.props.fileManagerSelectionType,n=o.charAt(0).toUpperCase()+o.slice(1);return p("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):t>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:e,browseFolders:r,browse:e}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:e,browseFolders:r,browse:e}))},this.renderAcquirer=t=>{var e;return p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":t.id},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":t.id,"aria-controls":`uppy-DashboardContent-panel--${t.id}`,"aria-selected":((e=this.props.activePickerPanel)==null?void 0:e.id)===t.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(t.id)},p("div",{className:"uppy-DashboardTab-inner"},t.icon()),p("div",{className:"uppy-DashboardTab-name"},t.name)))},this.renderAcquirers=t=>{let e=[...t],r=e.splice(t.length-2,t.length);return p(Et,null,e.map(o=>this.renderAcquirer(o)),p("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map(o=>this.renderAcquirer(o))))},this.renderSourcesList=(t,e)=>{let{showNativePhotoCameraButton:r,showNativeVideoCameraButton:o}=this.props,n=[],a="myDevice";e||n.push({key:a,elements:this.renderMyDeviceAcquirer()}),r&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),o&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...t.map(g=>({key:g.id,elements:this.renderAcquirer(g)}))),n.length===1&&n[0].key===a&&(n=[]);let l=[...n],u=l.splice(n.length-2,n.length);return p(Et,null,this.renderDropPasteBrowseTagline(n.length),p("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(g=>{let{key:m,elements:P}=g;return p(Et,{key:m},P)}),p("span",{role:"presentation",style:{"white-space":"nowrap"}},u.map(g=>{let{key:m,elements:P}=g;return p(Et,{key:m},P)}))))}}[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:t}=this.props,e=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=t("poweredBy",{uppy:e});return p("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},r)}render(){let{showNativePhotoCameraButton:t,showNativeVideoCameraButton:e,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}),t&&this.renderHiddenCameraInput("photo",r,o=>{this.mobilePhotoFileInput=o}),e&&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()))}},Ws=Yp;var ef=je(Nt(),1);var E1=i=>p("div",{className:(0,ef.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(Ws,i)),tf=E1;var rf=je(Nt(),1);function P1(i){let{tagName:t}=i.target;if(t==="INPUT"||t==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ki=P1;function k1(i){let{activePickerPanel:t,className:e,hideAllPanels:r,i18n:o,state:n,uppy:a}=i,s=Lr(null);return p("div",{className:(0,rf.default)("uppy-DashboardContent-panel",e),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${t.id}`,onDragOver:Ki,onDragLeave:Ki,onDrop:Ki,onPaste:Ki},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},o("importFrom",{name:t.name})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},o("cancel"))),p("div",{ref:s,className:"uppy-DashboardContent-panelBody"},a.getPlugin(t.id).render(n,s.current)))}var of=k1;var nf=je(Nt(),1);function F1(i){let t=i.files[i.fileCardFor],e=()=>{i.uppy.emit("file-editor:cancel",t),i.closeFileEditor()};return p("div",{className:(0,nf.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"},t.meta?t.meta.name:t.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e},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 af=F1;var Qi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function T1(i,t,e,r){if(r===void 0&&(r={}),i)return Qi.STATE_ERROR;if(t)return Qi.STATE_COMPLETE;if(e)return Qi.STATE_PAUSED;let o=Qi.STATE_WAITING,n=Object.keys(r);for(let a=0;a<n.length;a++){let{progress:s}=r[n[a]];if(s.uploadStarted&&!s.uploadComplete)return Qi.STATE_UPLOADING;s.preprocess&&o!==Qi.STATE_UPLOADING&&(o=Qi.STATE_PREPROCESSING),s.postprocess&&o!==Qi.STATE_UPLOADING&&o!==Qi.STATE_PREPROCESSING&&(o=Qi.STATE_POSTPROCESSING)}return o}function B1(i){let{files:t,i18n:e,isAllComplete:r,isAllErrored:o,isAllPaused:n,inProgressNotPausedFiles:a,newFiles:s,processingFiles:l}=i;switch(T1(o,r,n,t)){case"uploading":return e("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return e("processingXFiles",{smart_count:l.length});case"paused":return e("uploadPaused");case"waiting":return e("xFilesSelected",{smart_count:s.length});case"complete":return e("uploadComplete");case"error":return e("error");default:}}function A1(i){let{i18n:t,isAllComplete:e,hideCancelButton:r,maxNumberOfFiles:o,toggleAddFilesPanel:n,uppy:a}=i,{allowNewUpload:s}=i;return s&&o&&(s=i.totalFileCount<i.maxNumberOfFiles),p("div",{className:"uppy-DashboardContent-bar"},!e&&!r?p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll()},t("cancel")):p("div",null),p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},p(B1,i)),s?p("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>n(!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"},t("addMore"))):p("div",null))}var sf=A1;var lf=je(Nt(),1);function Kp(i){let{computedMetaFields:t,requiredMetaFields:e,updateMeta:r,form:o,formState:n}=i,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map(s=>{let l=`uppy-Dashboard-FileCard-input-${s.id}`,u=e.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:n[s.id],onChange:g=>r(g,s.id),fieldCSSClasses:a,required:u,form:o.id},p):p("input",{className:a.text,id:l,form:o.id,type:s.type||"text",required:u,value:n[s.id],placeholder:s.placeholder,onInput:g=>r(g.target.value,s.id),"data-uppy-super-focusable":!0}))})}function Qp(i){var t;let{files:e,fileCardFor:r,toggleFileCard:o,saveFileCard:n,metaFields:a,requiredMetaFields:s,openFileEditor:l,i18n:u,i18nArray:g,className:m,canEditFile:P}=i,E=()=>typeof a=="function"?a(e[r]):a,O=e[r],te=(t=E())!=null?t:[],ae=P(O),oe={};te.forEach(k=>{var j;oe[k.id]=(j=O.meta[k.id])!=null?j:""});let[pe,de]=mi(oe),be=jr(k=>{k.preventDefault(),n(pe,r)},[n,pe,r]),me=(k,j)=>{de(U(_({},pe),{[j]:k}))},w=()=>{o(!1)},[x]=mi(()=>{let k=document.createElement("form");return k.setAttribute("tabindex","-1"),k.id=Us(),k});return Ci(()=>(document.body.appendChild(x),x.addEventListener("submit",be),()=>{x.removeEventListener("submit",be),document.body.removeChild(x)}),[x,be]),p("div",{className:(0,lf.default)("uppy-Dashboard-FileCard",m),"data-uppy-panelType":"FileCard",onDragOver:Ki,onDragLeave:Ki,onDrop:Ki,onPaste:Ki},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},g("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},O.meta?O.meta.name:O.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",form:x.id,title:u("finishEditingFile"),onClick:w},u("cancel"))),p("div",{className:"uppy-Dashboard-FileCard-inner"},p("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:ho(O.type).color}},p(ca,{file:O}),ae&&p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:k=>{be(k),l(O)}},u("editImage"))),p("div",{className:"uppy-Dashboard-FileCard-info"},p(Kp,{computedMetaFields:te,requiredMetaFields:s,updateMeta:me,form:x,formState:pe})),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:x.id},u("saveChanges")),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:w,form:x.id},u("cancel")))))}var df=je(Nt(),1),dn="uppy-transition-slideDownUp",pf=250;function R1(i){let{children:t}=i,[e,r]=mi(null),[o,n]=mi(""),a=Lr(),s=Lr(),l=Lr(),u=()=>{n(`${dn}-enter`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{n(`${dn}-enter ${dn}-enter-active`),a.current=setTimeout(()=>{n("")},pf)})},g=()=>{n(`${dn}-leave`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{n(`${dn}-leave ${dn}-leave-active`),s.current=setTimeout(()=>{r(null),n("")},pf)})};return Ci(()=>{let m=Jt(t)[0];e!==m&&(m&&!e?u():e&&!m&&!s.current&&g(),r(m))},[t,e]),Ci(()=>()=>{clearTimeout(a.current),clearTimeout(s.current),cancelAnimationFrame(l.current)},[]),e?Un(e,{className:(0,df.default)(o,e.props.className)}):null}var ma=R1;function un(){return un=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)({}).hasOwnProperty.call(e,r)&&(i[r]=e[r])}return i},un.apply(null,arguments)}var uf=900,cf=700,Zp=576,hf=330;function ed(i){let t=i.totalFileCount===0,e=i.totalFileCount===1,r=i.containerWidth>Zp,o=i.containerHeight>hf,n=(0,mf.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>Zp,"uppy-size--lg":i.containerWidth>cf,"uppy-size--xl":i.containerWidth>uf,"uppy-size--height-md":i.containerHeight>hf,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&e&&o}),a=1;i.containerWidth>uf?a=5:i.containerWidth>cf?a=4:i.containerWidth>Zp&&(a=3);let s=i.showSelectedFiles&&!t,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,u=i.files?Object.keys(i.files).filter(P=>i.files[P].isGhost).length:0,g=()=>u>0?i.i18n("recoveredXFiles",{smart_count:u}):i.i18n("recoveredAllFiles");return p("div",{className:n,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Jn(),"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(sf,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"},g())),s?p(Xp,{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:e,itemsPerRow:a,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):p(Ws,{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(ma,null,i.showAddFilesPanel?p(tf,un({key:"AddFiles"},i,{isSizeMD:r})):null),p(ma,null,i.fileCardFor?p(Qp,un({key:"FileCard"},i)):null),p(ma,null,i.activePickerPanel?p(of,un({key:"Picker"},i)):null),p(ma,null,i.showFileEditor?p(af,un({key:"Editor"},i)):null),p("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(P=>i.uppy.getPlugin(P.id).render(i.state))))))}var ff={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 Le(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var O1=0;function Pt(i){return"__private_"+O1+++"_"+i}var M1={version:"4.3.4"},td=Np.default||Np,gf=9,z1=27;function yf(){let i={};return i.promise=new Promise((t,e)=>{i.resolve=t,i.reject=e}),i}var N1={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:da,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},mo=Pt("disabledNodes"),dr=Pt("generateLargeThumbnailIfSingleFile"),fa=Pt("openFileEditorWhenFilesAdded"),fo=Pt("attachRenderFunctionToTarget"),id=Pt("isTargetSupported"),rd=Pt("getAcquirers"),od=Pt("getProgressIndicators"),ur=Pt("getEditors"),nd=Pt("addSpecifiedPluginsFromOptions"),ad=Pt("autoDiscoverPlugins"),go=Pt("addSupportedPluginIfNoTarget"),ga=Pt("getStatusBarOpts"),ya=Pt("getThumbnailGeneratorOpts"),sd=Pt("getInformerOpts"),ba=Pt("getStatusBarId"),va=Pt("getThumbnailGeneratorId"),ld=Pt("getInformerId"),yo=class extends zt{constructor(t,e){var r,o,n;let a=(r=e?.autoOpen)!=null?r:null;super(t,U(_(_({},N1),e),{autoOpen:a})),Object.defineProperty(this,ld,{value:$1}),Object.defineProperty(this,va,{value:H1}),Object.defineProperty(this,ba,{value:V1}),Object.defineProperty(this,sd,{value:j1}),Object.defineProperty(this,ya,{value:U1}),Object.defineProperty(this,ga,{value:L1}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${Us()}`,this.superFocus=Up(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=s=>{let u=this.getPluginState().targets.filter(g=>g.id!==s.id);this.setPluginState({targets:u})},this.addTarget=s=>{let l=s.id||s.constructor.name,u=s.title||l,g=s.type;if(g!=="acquirer"&&g!=="progressindicator"&&g!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let m={id:l,name:u,type:g},E=this.getPluginState().targets.slice();return E.push(m),this.setPluginState({targets:E}),this.el},this.hideAllPanels=()=>{var s;let l=this.getPluginState(),u={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===u.activePickerPanel&&l.showAddFilesPanel===u.showAddFilesPanel&&l.showFileEditor===u.showFileEditor&&l.activeOverlayType===u.activeOverlayType||(this.setPluginState(u),this.uppy.emit("dashboard:close-panel",(s=l.activePickerPanel)==null?void 0:s.id))},this.showPanel=s=>{let{targets:l}=this.getPluginState(),u=l.find(g=>g.type==="acquirer"&&g.id===s);this.setPluginState({activePickerPanel:u,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",s)},this.canEditFile=s=>{let{targets:l}=this.getPluginState();return Le(this,ur)[ur](l).some(g=>this.uppy.getPlugin(g.id).canEditFile(s))},this.openFileEditor=s=>{let{targets:l}=this.getPluginState(),u=Le(this,ur)[ur](l);this.setPluginState({showFileEditor:!0,fileCardFor:s.id||null,activeOverlayType:"FileEditor"}),u.forEach(g=>{this.uppy.getPlugin(g.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();Le(this,ur)[ur](s).forEach(u=>{this.uppy.getPlugin(u.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:s,resolve:l}=yf();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 u=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",u,!1),l()};this.el.addEventListener("animationend",u,!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 u=(l=s?.manualClose)!=null?l:!0,{isHidden:g,isClosing:m}=this.getPluginState();if(g||m)return;let{promise:P,resolve:E}=yf();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let te=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",te,!1),E()};this.el.addEventListener("animationend",te,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),E();if(document.removeEventListener("keydown",this.handleKeyDownInModal),u&&this.opts.browserBackButtonClose){var O;(O=history.state)!=null&&O[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),P},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:U(_({},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 u=this.uppy.getFile(l);s?this.uppy.emit("dashboard:file-edit-start",u):this.uppy.emit("dashboard:file-edit-complete",u),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(u=>({source:this.id,name:u.name,type:u.type,data:u,meta:{relativePath:u.relativePath||u.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(u){this.uppy.log(u)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(s=>{let l=s[0],{width:u,height:g}=l.contentRect;this.setPluginState({containerWidth:u,containerHeight:g,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 u=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],g=(l=Le(this,mo)[mo])!=null?l:Yi(this.el.querySelectorAll(u)).filter(m=>!m.classList.contains("uppy-Dashboard-close"));for(let m of g)m.tagName==="A"?m.setAttribute("aria-disabled",s):m.disabled=s;s?Le(this,mo)[mo]=g:Le(this,mo)[mo]=null,this.dashboardIsDisabled=s},this.updateBrowserHistory=()=>{var s;(s=history.state)!=null&&s[this.modalName]||history.pushState(U(_({},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===z1&&this.requestCloseModal(),s.keyCode===gf&&Lp(s,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=s=>{this.uppy.iteratePlugins(u=>{u.type==="acquirer"&&(u.handleRootPaste==null||u.handleRootPaste(s))});let l=Yi(s.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=s=>{s.preventDefault();let l=Yi(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 P=!0;return this.uppy.iteratePlugins(E=>{E.canHandleRootDrop!=null&&E.canHandleRootDrop(s)&&(P=!0)}),P},u=()=>{let{types:P}=s.dataTransfer;return P.some(E=>E==="Files")},g=l(),m=u();if(!g&&!m||this.opts.disabled||this.opts.disableLocalFiles&&(m||!g)||!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=>G(this,null,function*(){s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(m=>{m.type==="acquirer"&&(m.handleRootDrop==null||m.handleRootDrop(s))});let l=!1,u=m=>{this.uppy.log(m,"error"),l||(this.uppy.info(m.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let g=yield Gn(s.dataTransfer,{logDropError:u});g.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(g)),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===gf&&Gm(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,dr,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let s=600,l=this.uppy.getFiles();if(l.length===1){let u=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);u?.setOptions({thumbnailWidth:s});let g=U(_({},l[0]),{preview:void 0});u?.requestThumbnail(g).then(()=>{u?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,fa,{writable:!0,value:s=>{let l=s[0],{metaFields:u}=this.getPluginState(),g=u&&u.length>0,m=this.canEditFile(l);g&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):m&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let s=xp(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",Le(this,go)[go]),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",Le(this,dr)[dr]),this.uppy.on("file-removed",Le(this,dr)[dr]),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",Le(this,fa)[fa])},this.removeEvents=()=>{let s=xp(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",Le(this,go)[go]),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",Le(this,dr)[dr]),this.uppy.off("file-removed",Le(this,dr)[dr]),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",Le(this,fa)[fa])},this.superFocusOnEachUpdate=()=>{let s=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,u=this.uppy.getState().info.length===0,g=!this.opts.inline;u&&(g||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,fo,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return U(_({},s),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,id,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,rd,{writable:!0,value:td(s=>s.filter(l=>l.type==="acquirer"&&Le(this,id)[id](l)).map(Le(this,fo)[fo]))}),Object.defineProperty(this,od,{writable:!0,value:td(s=>s.filter(l=>l.type==="progressindicator").map(Le(this,fo)[fo]))}),Object.defineProperty(this,ur,{writable:!0,value:td(s=>s.filter(l=>l.type==="editor").map(Le(this,fo)[fo]))}),this.render=s=>{let l=this.getPluginState(),{files:u,capabilities:g,allowNewUpload:m}=s,{newFiles:P,uploadStartedFiles:E,completeFiles:O,erroredFiles:te,inProgressFiles:ae,inProgressNotPausedFiles:oe,processingFiles:pe,isUploadStarted:de,isAllComplete:be,isAllPaused:me}=this.uppy.getObjectOfFilesPerState(),w=Le(this,rd)[rd](l.targets),x=Le(this,od)[od](l.targets),k=Le(this,ur)[ur](l.targets),j;return this.opts.theme==="auto"?j=g.darkMode?"dark":"light":j=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}".`)),ed({state:s,isHidden:l.isHidden,files:u,newFiles:P,uploadStartedFiles:E,completeFiles:O,erroredFiles:te,inProgressFiles:ae,inProgressNotPausedFiles:oe,processingFiles:pe,isUploadStarted:de,isAllComplete:be,isAllPaused:me,totalFileCount:Object.keys(u).length,totalProgress:s.totalProgress,allowNewUpload:m,acquirers:w,theme:j,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:x,editors:k,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:g.resumableUploads||!1,individualCancellation:g.individualCancellation,isMobileDevice:g.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,nd,{writable:!0,value:()=>{let{plugins:s}=this.opts;s.forEach(l=>{let u=this.uppy.getPlugin(l);u?u.mount(this,u):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,ad,{writable:!0,value:()=>{this.uppy.iteratePlugins(Le(this,go)[go])}}),Object.defineProperty(this,go,{writable:!0,value:s=>{var l;let u=["acquirer","editor"];s&&!((l=s.opts)!=null&&l.target)&&u.includes(s.type)&&(this.getPluginState().targets.some(m=>s.id===m.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:u,allowMultipleUploadBatches:g}=this.uppy.opts;(u||g)&&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:m}=this.opts;m&&this.mount(m,this),this.opts.disableStatusBar||this.uppy.use(no,_({id:Le(this,ba)[ba](),target:this},Le(this,ga)[ga]())),this.opts.disableInformer||this.uppy.use(ao,_({id:Le(this,ld)[ld](),target:this},Le(this,sd)[sd]())),this.opts.disableThumbnailGenerator||this.uppy.use(an,_({id:Le(this,va)[va]()},Le(this,ya)[ya]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let P=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${P?"on":"off"}`),this.setDarkModeCapability(P),this.opts.theme==="auto"){var E;(E=this.darkModeMediaQuery)==null||E.addListener(this.handleSystemDarkModeChange)}Le(this,nd)[nd](),Le(this,ad)[ad](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let u=this.uppy.getPlugin(`${this.id}:Informer`);u&&this.uppy.removePlugin(u)}if(!this.opts.disableStatusBar){let u=this.uppy.getPlugin(`${this.id}:StatusBar`);u&&this.uppy.removePlugin(u)}if(!this.opts.disableThumbnailGenerator){let u=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);u&&this.uppy.removePlugin(u)}let{plugins:s}=this.opts;if(s.forEach(u=>{let g=this.uppy.getPlugin(u);g&&g.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=ff,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(n=(o=this.opts).onRequestCloseModal)!=null||(o.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(t){var e,r;super.setOptions(t),(e=this.uppy.getPlugin(Le(this,ba)[ba]()))==null||e.setOptions(Le(this,ga)[ga]()),(r=this.uppy.getPlugin(Le(this,va)[va]()))==null||r.setOptions(Le(this,ya)[ya]())}};function L1(){let{hideUploadButton:i,hideRetryButton:t,hidePauseResumeButton:e,hideCancelButton:r,showProgressDetails:o,hideProgressAfterFinish:n,locale:a,doneButtonHandler:s}=this.opts;return{hideUploadButton:i,hideRetryButton:t,hidePauseResumeButton:e,hideCancelButton:r,showProgressDetails:o,hideAfterFinish:n,locale:a,doneButtonHandler:s}}function U1(){let{thumbnailWidth:i,thumbnailHeight:t,thumbnailType:e,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:i,thumbnailHeight:t,thumbnailType:e,waitForThumbnailsBeforeUpload:r,lazy:!r}}function j1(){return{}}function V1(){return`${this.id}:StatusBar`}function H1(){return`${this.id}:ThumbnailGenerator`}function $1(){return`${this.id}:Informer`}yo.VERSION=M1.version;var pd=class{onMount(t,e){this.options=_(_({},t),this.props),this.uppy.use(e,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(t,e){t.uppy&&this.uppy!==t.uppy.previousValue&&t.uppy.previousValue!==void 0&&(this.uninstall(t.uppy.previousValue),this.uppy.use(e,this.options)),this.options=_(_({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),t.props&&this.props!==t.props.previousValue&&t.props.previousValue!==void 0&&this.plugin.setOptions(_({},this.options))}uninstall(t=this.uppy){t.removePlugin(this.plugin)}};var bf=(()=>{class i extends pd{constructor(){super(),this.el=he(Jd),this.uppy=new Xo,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},yo)}ngOnChanges(e){this.handleChanges(e,yo)}ngOnDestroy(){this.uninstall()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=mt({type:i,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[Aa,Hd],decls:0,vars:0,template:function(r,o){},encapsulation:2,changeDetection:0})}}return i})();function xe(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var W1=0;function Gt(i){return"__private_"+W1+++"_"+i}function q1(i){return new Error("Cancelled",{cause:i})}function vf(i){if(i!=null){var t;let e=()=>this.abort(i.reason);i.addEventListener("abort",e,{once:!0});let r=()=>{i.removeEventListener("abort",e)};(t=this.then)==null||t.call(this,r,r)}return this}var oi=Gt("activeRequests"),Vt=Gt("queuedHandlers"),ri=Gt("paused"),bo=Gt("pauseTimer"),jt=Gt("downLimit"),vo=Gt("upperLimit"),cr=Gt("rateLimitingTimer"),wa=Gt("call"),hr=Gt("queueNext"),cd=Gt("next"),dd=Gt("queue"),hd=Gt("dequeue"),ud=Gt("resume"),wo=Gt("increaseLimit"),qs=class{constructor(t){Object.defineProperty(this,hd,{value:K1}),Object.defineProperty(this,dd,{value:Y1}),Object.defineProperty(this,cd,{value:X1}),Object.defineProperty(this,hr,{value:G1}),Object.defineProperty(this,wa,{value:J1}),Object.defineProperty(this,oi,{writable:!0,value:0}),Object.defineProperty(this,Vt,{writable:!0,value:[]}),Object.defineProperty(this,ri,{writable:!0,value:!1}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,jt,{writable:!0,value:1}),Object.defineProperty(this,vo,{writable:!0,value:void 0}),Object.defineProperty(this,cr,{writable:!0,value:void 0}),Object.defineProperty(this,ud,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,wo,{writable:!0,value:()=>{if(xe(this,ri)[ri]){xe(this,cr)[cr]=setTimeout(xe(this,wo)[wo],0);return}xe(this,jt)[jt]=this.limit,this.limit=Math.ceil((xe(this,vo)[vo]+xe(this,jt)[jt])/2);for(let e=xe(this,jt)[jt];e<=this.limit;e++)xe(this,hr)[hr]();xe(this,vo)[vo]-xe(this,jt)[jt]>3?xe(this,cr)[cr]=setTimeout(xe(this,wo)[wo],2e3):xe(this,jt)[jt]=Math.floor(xe(this,jt)[jt]/2)}}),typeof t!="number"||t===0?this.limit=1/0:this.limit=t}run(t,e){return!xe(this,ri)[ri]&&xe(this,oi)[oi]<this.limit?xe(this,wa)[wa](t):xe(this,dd)[dd](t,e)}wrapSyncFunction(t,e){var r=this;return function(){for(var o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];let s=r.run(()=>(t(...n),queueMicrotask(()=>s.done()),()=>{}),e);return{abortOn:vf,abort(){s.abort()}}}}wrapPromiseFunction(t,e){var r=this;return function(){for(var o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];let s,l=new Promise((u,g)=>{s=r.run(()=>{let m,P;try{P=Promise.resolve(t(...n))}catch(E){P=Promise.reject(E)}return P.then(E=>{m?g(m):(s.done(),u(E))},E=>{m?g(m):(s.done(),g(E))}),E=>{m=q1(E)}},e)});return l.abort=u=>{s.abort(u)},l.abortOn=vf,l}}resume(){xe(this,ri)[ri]=!1,clearTimeout(xe(this,bo)[bo]);for(let t=0;t<this.limit;t++)xe(this,hr)[hr]()}pause(t){t===void 0&&(t=null),xe(this,ri)[ri]=!0,clearTimeout(xe(this,bo)[bo]),t!=null&&(xe(this,bo)[bo]=setTimeout(xe(this,ud)[ud],t))}rateLimit(t){clearTimeout(xe(this,cr)[cr]),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(xe(this,vo)[vo]=this.limit-1,this.limit=xe(this,jt)[jt],xe(this,cr)[cr]=setTimeout(xe(this,wo)[wo],t))}get isPaused(){return xe(this,ri)[ri]}};function J1(i){xe(this,oi)[oi]+=1;let t=!1,e;try{e=i()}catch(r){throw xe(this,oi)[oi]-=1,r}return{abort:r=>{t||(t=!0,xe(this,oi)[oi]-=1,e?.(r),xe(this,hr)[hr]())},done:()=>{t||(t=!0,xe(this,oi)[oi]-=1,xe(this,hr)[hr]())}}}function G1(){queueMicrotask(()=>xe(this,cd)[cd]())}function X1(){if(xe(this,ri)[ri]||xe(this,oi)[oi]>=this.limit||xe(this,Vt)[Vt].length===0)return;let i=xe(this,Vt)[Vt].shift();if(i==null)throw new Error("Invariant violation: next is null");let t=xe(this,wa)[wa](i.fn);i.abort=t.abort,i.done=t.done}function Y1(i,t){let e={fn:i,priority:t?.priority||0,abort:()=>{xe(this,hd)[hd](e)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=xe(this,Vt)[Vt].findIndex(o=>e.priority>o.priority);return r===-1?xe(this,Vt)[Vt].push(e):xe(this,Vt)[Vt].splice(r,0,e),e}function K1(i){let t=xe(this,Vt)[Vt].indexOf(i);t!==-1&&xe(this,Vt)[Vt].splice(t,1)}var sE=Symbol("__queue");var gd=je(Dn(),1),Cf=je(wf(),1);var _f={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function xf(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var Q1=0;function Z1(i){return"__private_"+Q1+++"_"+i}var ev={quality:.6,limit:10},_a=Z1("RateLimitedQueue"),Js=class extends oo{constructor(t,e){super(t,_(_({},ev),e)),Object.defineProperty(this,_a,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=_f,xf(this,_a)[_a]=new qs(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(t){return new Promise((e,r)=>{new Cf.default(t,U(_({},this.opts),{success:e,error:r}))})}prepareUpload(t){return G(this,null,function*(){let e=0,r=[],o=xf(this,_a)[_a].wrapPromiseFunction(a=>G(this,null,function*(){try{let s=yield this.compress(a.data),l=a.data.size-s.size;this.uppy.log(`[Image Compressor] Image ${a.id} compressed by ${(0,gd.default)(l)}`),e+=l;let{name:u,type:g,size:m}=s,P=Gi(u),O=`${Gi(a.meta.name).name}.${P.extension}`;this.uppy.setFileState(a.id,U(_(_(_(_({},u&&{name:u}),P.extension&&{extension:P.extension}),g&&{type:g}),m&&{size:m}),{data:s,meta:U(_({},a.meta),{type:g,name:O})})),r.push(a)}catch(s){this.uppy.log(`[Image Compressor] Failed to compress ${a.id}:`,"warning"),this.uppy.log(s,"warning")}})),n=t.map(a=>{var s;let l=this.uppy.getFile(a);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(n),this.uppy.emit("compressor:complete",r),e>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,gd.default)(e)}),"info");for(let a of t){let s=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",s)}})}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};var kf=je(Sf(),1);function tv(i,t){let e=i.width/t.width,r=i.height/t.height,o=Math.min(e,r),n=t.width*o,a=t.height*o,s=(i.width-n)/2,l=(i.height-a)/2;return{width:n,height:a,left:s,top:l}}var Df=tv;function iv(i){return i*(Math.PI/180)}function rv(i,t,e){let r=Math.abs(iv(e));return Math.max((Math.sin(r)*i+Math.cos(r)*t)/t,(Math.sin(r)*t+Math.cos(r)*i)/i)}var If=rv;function ov(i,t,e){return t.left<i.left?{left:i.left,width:e.width}:t.top<i.top?{top:i.top,height:e.height}:t.left+t.width>i.left+i.width?{left:i.left+i.width-e.width,width:e.width}:t.top+t.height>i.top+i.height?{top:i.top+i.height-e.height,height:e.height}:null}var Ef=ov;function nv(i,t,e){return t.left<i.left?{left:i.left,width:e.left+e.width-i.left}:t.top<i.top?{top:i.top,height:e.top+e.height-i.top}:t.left+t.width>i.left+i.width?{left:e.left,width:i.left+i.width-e.left}:t.top+t.height>i.top+i.height?{top:e.top,height:i.top+i.height-e.top}:null}var Pf=nv;var Gs=class extends st{constructor(t){super(t),this.onRotate90Deg=()=>{let{angle90Deg:e}=this.state,r=e-90;this.setState({angle90Deg:r,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(r);let o=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),a=Df(n,o);this.cropper.setCanvasData(a),this.cropper.setCropBoxData(a)},this.onRotateGranular=e=>{let r=Number(e.target.value);this.setState({angleGranular:r});let{angle90Deg:o}=this.state,n=o+r;this.cropper.rotateTo(n);let a=this.cropper.getImageData(),s=If(a.naturalWidth,a.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:t,storeCropperInstance:e}=this.props;this.cropper=new kf.default(this.imgElement,t.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),e(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(t){let e=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:o}=this.state;if(t.detail.action==="all"){let n=Ef(e,r,o);n&&this.cropper.setCropBoxData(n)}else{let n=Pf(e,r,o);n&&this.cropper.setCropBoxData(n)}}renderGranularRotate(){let{i18n:t}=this.props,{angleGranular:e}=this.state;return p("label",{role:"tooltip","aria-label":`${e}\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:e,min:"-45",max:"45","aria-label":t("rotate")}))}renderRevert(){let{i18n:t,opts:e}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(e.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:t}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("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:t}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("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:t}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("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:t}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("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:t}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("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:t}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("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:t}=this.props;return p("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":t("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:t,opts:e}=this.props,{actions:r}=e,o=URL.createObjectURL(t.data);return p("div",{className:"uppy-ImageCropper"},p("div",{className:"uppy-ImageCropper-container"},p("img",{className:"uppy-ImageCropper-image",alt:t.name,src:o,ref:n=>{this.imgElement=n}})),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 Ff={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 av={version:"3.3.3"},Tf={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},Bf={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},sv={quality:.8,actions:Bf,cropperOptions:Tf},_o=class extends zt{constructor(t,e){super(t,U(_(_({},sv),e),{actions:_(_({},Bf),e?.actions),cropperOptions:_(_({},Tf),e?.cropperOptions)})),this.save=()=>{let r=a=>{var s;let{currentImage:l}=this.getPluginState();this.uppy.setFileState(l.id,{data:new File([a],(s=l.name)!=null?s:this.i18n("unnamed"),{type:a.type}),size:a.size,preview:void 0});let u=this.uppy.getFile(l.id);this.uppy.emit("thumbnail:request",u),this.setPluginState({currentImage:u}),this.uppy.emit("file-editor:complete",u)},{currentImage:o}=this.getPluginState(),n=this.cropper.getCroppedCanvas({});n.width%2!==0&&this.cropper.setData({width:n.width-1}),n.height%2!==0&&this.cropper.setData({height:n.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=Ff,this.i18nInit()}canEditFile(t){if(!t.type||t.isRemote)return!1;let e=t.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(e)}install(){this.setPluginState({currentImage:null});let{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){let{currentImage:t}=this.getPluginState();if(t){let e=this.uppy.getFile(t.id);this.uppy.emit("file-editor:cancel",e)}this.unmount()}render(){let{currentImage:t}=this.getPluginState();return t===null||t.isRemote?null:p(Gs,{currentImage:t,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};_o.VERSION=av.version;var Af=je(Xs(),1);function lv(i,t){if(i&1&&(y(0,"small",5),D(1),f()),i&2){let e=W();I(),Oe(e.subtitle)}}function pv(i,t){if(i&1&&(y(0,"a",6),Z(1,"i",7),D(2," Download Template "),f()),i&2){let e=W();tu("top-58",e.subtitle),T("href",e.sampleUrl,xr)}}function dv(i,t){if(i&1&&(Kt(0),D(1),Qt()),i&2){let e=W(2);I(),Ne("- ",e.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function uv(i,t){if(i&1&&(y(0,"div",4)(1,"h4",8),D(2,"CSV File Content Summary"),f(),Z(3,"hr"),y(4,"p",9),D(5),le(6,dv,2,1,"ng-container",10),f()()),i&2){let e=W();I(5),Ne("",e.rowSummary().rowCount," rows found "),I(),T("ngIf",e.rowSummary().rowEmpty>0)}}var cn=(()=>{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=Ba(!1),this.showSubtitle=!0,this.uppyCoreConfiguration=Ba(),this.dashboardPropsConfiguration=Ba(),this.fileUploaded=new Po,this.fileUploadComplete=new Po,this.fileRemoved=new Po,this.onParser=new Po,this.multipleFilesUploaded=new Po,this.http=he(Ku),this.csvParser=he(Yu),this.rowSummary=Ze({rowCount:0,rowEmpty:0}),this.file=Ze(null),this.multipleFiles=Ze([]),this.uppy=new Xo({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6},onBeforeFileAdded:(e,r)=>U(_({},e),{name:e.name?.replace(/ /g,"_")})}).use(Js,{mimeType:"image/jpeg",convertSize:1/0,convertTypes:["image/png"]}).use(_o),this.dashboardProps={hideUploadButton:!0,height:350},ir(()=>this.uppy.setOptions(_({},this.uppyCoreConfiguration()))),ir(()=>this.dashboardProps=_(_({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(e,r)=>{let o=r[0]?.data;this.showSample=!1,this.showSubtitle=!1,this.emitFileUpload(o),this.file.set(r[0].data),Af.default.parse(o,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:n=>{let a=n.split(/\r?\n/).slice(1);return a[a.length-1]===""&&a.pop(),this.rowSummary.update(s=>U(_({},s),{rowCount:a.length})),a.forEach(s=>{s.split(",").every(u=>u==="")&&this.rowSummary.update(u=>U(_({},u),{rowEmpty:u.rowEmpty+1}))}),n},error(n,a){console.log("ERROR",n,a)},complete:(n,a)=>{this.onParser.emit(n.data)}})}),this.uppy.on("complete",e=>{let r=e.successful?.map(n=>({file:n.data,id:n.id}))??[],o=e.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",e=>{this.showSample=!0,this.showSubtitle=!0,this.file.set(null);let o=this.multipleFiles().filter(n=>n.id!=e.id);this.multipleFiles.set(o),this.fileRemoved.emit(e.id),this.rowSummary.set({rowCount:0,rowEmpty:0})}),this.onFileEdited()}onFileEdited(){this.clear()==!1&&(this.uppy.on("file-editor:start",e=>{}),this.uppy.on("file-editor:complete",e=>{this.handlingEditedImage(e)}),this.uppy.on("file-editor:cancel",e=>{}))}handlingEditedImage(e){this.multipleFiles.update(r=>r.map(o=>o.id===e.id?U(_({},o),{file:e.data}):o)),this.file.set(this.multipleFiles()[0].file),this.emitFileUploadComplete(this.file()),this.emitMultipleFilesUploaded(this.multipleFiles())}onResetUppy(){this.clear()&&this.uppy.clear()}formatFileSize(e,r=2){if(e===0)return"0 bytes";let o=Math.floor(Math.log(e)/Math.log(i.kilobyte));return`${(e/Math.pow(i.kilobyte,o)).toFixed(r)} ${i.sizes[o]}`}ngOnDestroy(){this.file.set(null),this.multipleFiles.set([])}emitFileUpload(e){let r=new File([e],e.name.replace(/ /g,"_"),{type:e.type});this.fileUploaded.emit(r)}emitFileUploadComplete(e){let r=new File([e],e.name.replace(/ /g,"_"),{type:e.type});this.fileUploadComplete.emit(r)}emitMultipleFilesUploaded(e){let r=e.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=mt({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&&(y(0,"div",0),Z(1,"uppy-dashboard",1),le(2,lv,2,1,"small",2)(3,pv,3,3,"a",3)(4,uv,7,2,"div",4),f()),r&2){let n;I(),T("uppy",o.uppy)("props",o.dashboardProps),I(),T("ngIf",o.subtitle&&o.showSubtitle),I(),T("ngIf",o.sampleUrl&&o.showSample),I(),Qr(o.file()&&((n=o.file())==null?null:n.type)==="text/csv"?4:-1)}},dependencies:[bf,Wt,di],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})();var cv=["class","page"],hv=()=>({width:"25rem"}),mv=()=>({width:"100%"}),fv=()=>({height:"calc(100vh - 140px)"}),gv=()=>({"max-width":"100%","min-width":"50%"}),yv=()=>({});function bv(i,t){if(i&1){let e=Re();y(0,"div",22)(1,"a",23),D(2,"Cancel"),f(),y(3,"p-button",24),De("onClick",function(){ge(e);let o=W();return ye(o.onSubmitJournalEntry())}),f()()}}function vv(i,t){if(i&1&&(y(0,"span",47),D(1),f()),i&2){let e=t.$implicit;I(),Ne(" ",e.name," ")}}function wv(i,t){if(i&1&&(y(0,"div",22)(1,"div",48)(2,"span",49),D(3),f()(),y(4,"div")(5,"span"),D(6,"-"),f()(),y(7,"span",50),D(8),f()()),i&2){let e=t.$implicit;I(3),Ne("(",e.code,")"),I(5),Oe(e.name)}}function _v(i,t){i&1&&(y(0,"tr")(1,"th",51),D(2,"Account"),f(),y(3,"th",51),D(4,"Note"),f(),y(5,"th",52),D(6," Amount "),f(),Z(7,"th",53),f())}function xv(i,t){if(i&1&&(y(0,"div",22)(1,"div",48)(2,"span",49),D(3),f()(),y(4,"div")(5,"span"),D(6,"-"),f()(),y(7,"div",48)(8,"span",60),D(9),f()()()),i&2){let e=t.$implicit;I(3),Ne("(",e.code,")"),I(6),Oe(e.name)}}function Cv(i,t){if(i&1&&(y(0,"div",22)(1,"div",48)(2,"span",49),D(3),f()(),y(4,"div")(5,"span"),D(6,"-"),f()(),y(7,"div",48)(8,"span",60),D(9),f()()()),i&2){let e=t.$implicit;I(3),Ne("(",e.code,")"),I(6),Oe(e.name)}}function Sv(i,t){if(i&1){let e=Re();y(0,"div",61)(1,"p-button",62),De("onClick",function(){ge(e);let o=W(3);return ye(o.addIitemVisible.set(!o.addIitemVisible()))}),f()()}}function Dv(i,t){if(i&1){let e=Re();y(0,"tr",54)(1,"td")(2,"p-select",55),le(3,xv,10,2,"ng-template",null,6,_e)(5,Cv,10,2,"ng-template",null,2,_e)(7,Sv,2,0,"ng-template",null,5,_e),f()(),y(9,"td"),Z(10,"textarea",56),f(),y(11,"td"),Z(12,"input",57),f(),y(13,"td")(14,"div",58)(15,"p-button",59),De("onClick",function(){let o=ge(e).rowIndex,n=W(2);return ye(n.removeItem(o))}),f()()()()}if(i&2){let e=t.rowIndex,r=W(2);T("formGroupName",e),I(2),Ot(qe(8,gv)),T("filter",!0)("options",r.journalRecordExpense().options.accounts),I(8),T("autoResize",!0),I(2),T("autoNumeric",qe(9,yv)),I(3),T("text",!0)}}function Iv(i,t){if(i&1){let e=Re();y(0,"tr")(1,"td")(2,"div",63)(3,"p-button",64),De("onClick",function(){ge(e);let o=W(2);return ye(o.addItem())}),f(),y(4,"span"),D(5,"Total :"),f()()(),y(6,"td",65),D(7),ut(8,"async"),ut(9,"number"),f(),Z(10,"td",66),f()}if(i&2){let e=W(2);I(7),Ne(" ",wt(9,3,wt(8,1,e.totalDebitAmount$))," ")}}function Ev(i,t){if(i&1){let e=Re();y(0,"p-panel",25)(1,"p-scrollpanel")(2,"div",26)(3,"div",27)(4,"div",28)(5,"div",29)(6,"div",26)(7,"div",30)(8,"label",31),D(9,"Date"),f()(),Z(10,"p-datepicker",32),f()(),y(11,"div",29)(12,"div",26)(13,"div",30)(14,"label",31),D(15,"Outlet"),f()(),y(16,"p-select",33),le(17,vv,2,1,"ng-template",null,2,_e),f()()(),y(19,"div",29)(20,"div",26)(21,"div",30)(22,"label",31),D(23,"Number"),f()(),Z(24,"input",34),f()(),y(25,"div",35)(26,"div",26)(27,"div",30)(28,"label",31),D(29,"Account"),f()(),y(30,"p-select",36),le(31,wv,9,2,"ng-template",null,2,_e),f()()(),y(33,"div",37)(34,"div",26)(35,"div",30)(36,"label",38),D(37,"Supplier"),f()(),y(38,"p-autocomplete",39),ut(39,"async"),De("completeMethod",function(o){ge(e);let n=W();return ye(n.search(o))}),f()()()()(),y(40,"div",10)(41,"div",28)(42,"div",29)(43,"div",26)(44,"div",40)(45,"label",41),D(46,"Upload"),f()(),y(47,"div",42)(48,"POS-uppy",43),De("fileUploaded",function(o){ge(e);let n=W();return ye(n.onUpload(o))}),f()()()(),y(49,"div",29)(50,"div",26)(51,"div",40)(52,"label",38),D(53,"Note"),f()(),y(54,"div",44),Z(55,"textarea",45),f()()()()()(),Z(56,"hr"),y(57,"p-table",46),le(58,_v,8,0,"ng-template",null,3,_e)(60,Dv,16,10,"ng-template",null,4,_e)(62,Iv,11,5,"ng-template",null,5,_e),f()()()}if(i&2){let e=W();T("formGroup",e.form),I(),Ot(qe(14,fv)),I(15),T("options",e.journalRecordExpense().options.entities)("filter",!0),I(14),T("filter",!0)("options",e.journalRecordExpense().options.paymentAccounts),I(8),T("suggestions",wt(39,12,e.supplierSuggestions$)),I(10),T("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.uppyDashboard),I(7),T("autoResize",!0),I(2),T("value",e.form.controls.items.controls)}}var zf=(()=>{class i{constructor(){this.role=he(Za),this.fb=he(Ua),this.journalRecordExpense=Ze(null),this.activatedRoute=he(Sr),this.journalService=he(xt),this.toasr=he(Dr),this.file=Ze(null),this.router=he(zi),this.addIitemVisible=Ze(!1),this.uppyCore={restrictions:{allowedFileTypes:["image/*","application/pdf"]}},this.uppyDashboard={inline:!0,width:350,height:200}}ngOnInit(){this.initForm(),this.loadJournalForm(),this.initFormAddItemCOA(),this.totalDebitAmount$=this.form.controls.items.valueChanges.pipe(pi(e=>e.reduce((r,o)=>r+o.debitAmount,0)),at("response"))}loadCategories(){this.categories$||(this.categories$=this.journalService.fetchCategoryOptions().pipe(jd(1)))}initFormAddItemCOA(){this.formAddItemCOA=this.fb.group({ID:this.fb.control(et.toString()),Name:this.fb.control(""),Code:this.fb.control(""),Note:this.fb.control(""),CategoryID:this.fb.control(""),OutletID:this.fb.control(et.toString()),Balance:this.fb.control(0)})}onaddItemCOA(){if(this.formAddItemCOA.invalid){this.formAddItemCOA.markAllAsTouched();return}let e=Object.entries(this.formAddItemCOA.getRawValue()).reduce((r,[o,n])=>(o==="CategoryID"?r[o]=n.key||n:r[o]=n,r),{});this.journalService.submitChartAccount(e).pipe(Yr(()=>this.journalService.getJournalRecordExpenseLoader().pipe(We(r=>{this.patchForm(r.form),this.journalRecordExpense.set(r),this.addIitemVisible.update(o=>!o)})))).subscribe()}loadJournalForm(){this.activatedRoute.data.pipe(pi(e=>e.form),We(e=>{this.patchForm(e.form),this.journalRecordExpense.set(e)})).subscribe()}initForm(){this.form=this.fb.group({order:this.buildOrderGroup(this.fb),items:this.fb.array([]),additionalAccountID:this.fb.control(""),file:this.fb.control("")})}buildOrderGroup(e){return e.group({id:e.control(""),number:e.control(""),date:e.control({value:new Date,disabled:!this.role.accounting.DateEditor}),note:e.control(""),entryTypeID:e.control(0),referenceID:e.control(""),referenceTypeID:e.control(0),referenceText:e.control(""),contactID:e.control(""),detailReferenceID:e.control(""),creatorID:e.control(""),created:e.control(""),modifierID:e.control(""),modified:e.control(""),outletID:e.control(""),statusID:e.control(""),contactName:e.control("")})}buildItemGroup(e){return e.group({id:e.control(et.toString()),journalID:e.control(et.toString()),accountID:e.control(""),debitAmount:e.control(0),creditAmount:e.control(0),index:e.control(0),note:e.control("")})}patchForm(e){if(!e)return;this.form.controls.order.patchValue({id:e.order.id,number:e.order.number,date:Xu(e.order.date)?(0,_d.default)().toDate():(0,_d.default)(e.order.date).toDate(),note:e.order.note,entryTypeID:e.order.entryTypeID,referenceID:e.order.referenceID,referenceTypeID:e.order.referenceTypeID,referenceText:e.order.referenceText,contactID:e.order.contactID,detailReferenceID:e.order.detailReferenceID,creatorID:e.order.creatorID,created:e.order.created,modifierID:e.order.modifierID,modified:e.order.modified,outletID:e.order.outletID,statusID:e.order.statusID,contactName:e.order.contactName});let r=this.form.controls.items;r.clear(),e.items.forEach(o=>{let n=this.buildItemGroup(this.fb);n.patchValue(o),r.push(n)}),this.form.patchValue({items:void 0,order:void 0,additionalAccountID:null,file:e.file??""})}openDialogAddItemCOA(){this.addIitemVisible.update(e=>!e)}addItem(){let e=this.form.controls.items,r=this.buildItemGroup(this.fb);e.push(r)}removeItem(e){this.form.controls.items.removeAt(e)}search(e){let r=e.query;this.supplierSuggestions$=this.journalService.getJournalEntrySupplierSuggestions(r).pipe(at("response"))}onUpload(e){e instanceof File&&this.file.set(e)}onSubmitJournalEntry(){if(console.log(this.form.value),this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let e=this.getCleanedFormValue();console.log("cleanedFormValue",e);let r=this.buildFormData(e);this.journalService.submitJournalEntry(r).pipe(at("response"),We(()=>{this.router.navigate(["/journal/journal-entry"])}),wr(o=>vr(()=>o)),at("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let e=this.form.getRawValue(),r=Object.entries(e).reduce((o,[n,a])=>(n==="items"?o[n]=a.map(s=>U(_({},s),{debitAmount:+s.debitAmount,creditAmount:+s.creditAmount})):n==="order"?o[n]=U(_({},a),{contactID:a.contactID||et}):n==="file"?o[n]=a.length>0?a:null:o[n]=a,o),{});return JSON.parse(JSON.stringify(r,(o,n)=>n==="null"?null:n))}buildFormData(e){let r=new FormData;return r.append("Data",JSON.stringify(e)),r.append("File",this.file()),r}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=mt({type:i,selectors:[["app-journal-record-expense",8,"page"]],attrs:cv,decls:27,vars:14,consts:[["actionButton",""],["content",""],["item",""],["header",""],["body",""],["footer",""],["selectedItem",""],["pageTitle","Record Expense",3,"hasMainWrapperPadding"],["header","Add New Account",3,"modal","visible","closable"],[1,"row","row-gap-3",3,"formGroup"],[1,"col"],[1,"d-flex","flex-column"],["for","username",1,"font-semibold","w-24"],["formControlName","Name","pInputText","","id","username","autocomplete","off",1,"flex-auto"],["for","email",1,"font-semibold","w-24"],["formControlName","Code","pInputText","","id","email","autocomplete","off",1,"flex-auto"],[1,"col-12"],["for","password",1,"font-semibold","w-24"],["formControlName","CategoryID","containerStyleClass","w-100","appendTo","body","placeholder","Select Item",3,"onFocus","options"],[1,"d-flex","justify-content-end","gap-2"],["label","Cancel","severity","secondary",3,"click"],["label","Save",3,"click"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[3,"formGroup"],[1,"row"],[1,"col-6"],[1,"row","row-gap-4"],["formGroupName","order",1,"col-12","col-lg-12"],[1,"col-3","d-flex","align-items-center"],["for","outlet",1,"m-0","fs-3","fw-normal"],["showClear","","size","small","styleClass","w-100","formControlName","date",1,"col-6","p-0"],["showClear","","size","small","inputId","outlet","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an outlet","filterBy","name",1,"col-6","placeholder-spacing",3,"options","filter"],["pSize","small","formControlName","number","type","text","pInputText","",1,"col-6"],[1,"col-12","col-lg-12"],["showClear","","size","small","filterBy","code,name","inputId","outlet","formControlName","additionalAccountID","optionLabel","name","optionValue","id","placeholder","Choose account to pay",1,"col-6","placeholder-spacing",3,"filter","options"],["formGroupName","order",1,"col-12"],["for","",1,"m-0","fs-3","fw-normal"],["showClear","","size","small","styleClass","w-100","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",1,"col-6","p-0",3,"completeMethod","suggestions"],[1,"col-3","d-flex"],["for","fileUpload",1,"m-0","fs-3","fw-normal"],[1,"col-9","pl-0"],[3,"fileUploaded","uppyCoreConfiguration","dashboardPropsConfiguration"],[1,"col","pl-0"],["pSize","small","rows","4","pTextarea","","formControlName","note","placeholder","Add a note",1,"w-100",3,"autoResize"],["formArrayName","items",3,"value"],[1,"d-inline-block","text-truncate",2,"max-width","300px"],[1,""],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block",2,"max-width","200px"],[2,"width","30%","min-width","120px"],[1,"text-end",2,"width","15%","min-width","80px"],[2,"width","5%","min-width","30px"],[3,"formGroupName"],["size","small","filterBy","code,name","appendTo","body","formControlName","accountID","optionLabel","name","optionValue","id","styleClass","w-100","placeholder","Select an account","showClear","",3,"filter","options"],["rows","1","pSize","small","pTextarea","","formControlName","note",1,"w-100",3,"autoResize"],["type","text","pSize","small","pInputText","","formControlName","debitAmount",1,"text-end","w-100",3,"autoNumeric"],[1,"d-flex","justify-content-center","align-items-center"],["size","small","icon","fa-solid fa-xmark","aria-label","Save","severity","danger",3,"onClick","text"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"p-3"],["label","Add New","fluid","","text","","size","small","icon","pi pi-plus",3,"onClick"],[1,"d-flex","justify-content-between","align-items-center"],["label","Add","icon","fa-solid fa-plus",3,"onClick"],[1,"text-end","footer-total"],["colspan","2"]],template:function(r,o){if(r&1){let n=Re();y(0,"app-main-panel",7),le(1,bv,4,0,"ng-template",null,0,_e)(3,Ev,64,15,"ng-template",null,1,_e),f(),y(5,"p-dialog",8)(6,"div",9)(7,"div",10)(8,"div",11)(9,"label",12),D(10,"Name"),f(),Z(11,"input",13),f()(),y(12,"div",10)(13,"div",11)(14,"label",14),D(15,"Code"),f(),Z(16,"input",15),f()(),y(17,"div",16)(18,"div",11)(19,"label",17),D(20,"Category"),f(),y(21,"p-treeselect",18),ut(22,"async"),De("onFocus",function(){return ge(n),ye(o.loadCategories())}),f()()(),y(23,"div",10)(24,"div",19)(25,"p-button",20),De("click",function(){return ge(n),ye(o.addIitemVisible.set(!o.addIitemVisible()))}),f(),y(26,"p-button",21),De("click",function(){return ge(n),ye(o.onaddItemCOA())}),f()()()()()}r&2&&(T("hasMainWrapperPadding",!0),I(5),Ot(qe(12,hv)),T("modal",!0)("visible",o.addIitemVisible())("closable",!1),I(),T("formGroup",o.formAddItemCOA),I(15),Ot(qe(13,mv)),T("options",wt(22,10,o.categories$)))},dependencies:[ci,Wt,mu,Oi,Li,Ni,Ar,Br,zr,Mr,Or,Rr,Vi,ji,$i,qi,Wi,Tr,Ir,Er,Pr,kr,Fr,Fo,To,Vo,Ji,Nr,$o,Ho,jo,Hi,ui,No,zo,$u,Hu,Oo,Ro,cn],styles:["[_nghost-%COMP%]{display:block}.footer-total[_ngcontent-%COMP%]{margin-right:10px;padding-right:30px}.placeholder-spacing[_ngcontent-%COMP%] .p-select-label{padding-left:0!important}"],changeDetection:0})}}return i})();var Pv=["filterRef"],kv=["class","page"];function Fv(i,t){i&1&&(y(0,"div",10)(1,"div",5)(2,"h5",11),D(3,"Card title"),f(),y(4,"h6",12),D(5,"Card subtitle"),f(),y(6,"p",13),D(7," Some quick example text to build on the card title and make up the bulk of the card's content. "),f(),y(8,"a",14),D(9,"Card link"),f(),y(10,"a",14),D(11,"Another link"),f()()())}var Nf=(()=>{class i{constructor(){this.modalService=he(ja)}onFilterChange(e){console.log("Filter Change",e),this.modalService.open(this.templateRef)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=mt({type:i,selectors:[["app-journal-deposit",8,"page"]],viewQuery:function(r,o){if(r&1&&vi(Pv,7),r&2){let n;wi(n=_i())&&(o.templateRef=n.first)}},attrs:kv,decls:44,vars:0,consts:[["filterRef",""],[3,"eventFilterChange"],["ngProjectAs","content",5,["content"]],[1,"container","my-4"],[1,"card"],[1,"card-body"],[1,"table"],["scope","col"],["scope","row"],["colspan","2"],[1,"card",2,"width","18rem"],[1,"card-title"],[1,"card-subtitle","mb-2","text-body-secondary"],[1,"card-text"],["href","#",1,"card-link"]],template:function(r,o){if(r&1){let n=Re();y(0,"app-main-panel",1),De("eventFilterChange",function(s){return ge(n),ye(o.onFilterChange(s))}),Kt(1,2),y(2,"div",3)(3,"div",4)(4,"div",5)(5,"table",6)(6,"thead")(7,"tr")(8,"th",7),D(9,"#"),f(),y(10,"th",7),D(11,"First"),f(),y(12,"th",7),D(13,"Last"),f(),y(14,"th",7),D(15,"Handle"),f()()(),y(16,"tbody")(17,"tr")(18,"th",8),D(19,"1"),f(),y(20,"td"),D(21,"Mark"),f(),y(22,"td"),D(23,"Otto"),f(),y(24,"td"),D(25,"mdo"),f()(),y(26,"tr")(27,"th",8),D(28,"2"),f(),y(29,"td"),D(30,"Jacob"),f(),y(31,"td"),D(32,"Thornton"),f(),y(33,"td"),D(34,"fat"),f()(),y(35,"tr")(36,"th",8),D(37,"3"),f(),y(38,"td",9),D(39,"Larry the Bird"),f(),y(40,"td"),D(41,"twitter"),f()()()()()()(),Qt(),f(),le(42,Fv,12,0,"ng-template",null,0,_e)}},dependencies:[ci],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return i})();var Dd=je(Ga());var Tv=["mask"],Bv=["content"],Av=["footer"],Rv=["titlebar"],Ov=(i,t,e)=>({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex","justify-content":i,"align-items":t,"pointer-events":e}),Mv=i=>({"p-dialog p-component":!0,"p-dialog-maximized":i}),zv=()=>({display:"flex","flex-direction":"column","pointer-events":"auto"}),Nv=(i,t)=>({transform:i,transition:t}),Lv=i=>({value:"visible",params:i});function Uv(i,t){if(i&1){let e=Re();y(0,"div",14),De("mousedown",function(o){ge(e);let n=W(2);return ye(n.initResize(o))}),f()}i&2&&T("ngClass","p-resizable-handle")}function jv(i,t){i&1&&Ra(0)}function Vv(i,t){i&1&&Z(0,"WindowMaximizeIcon")}function Hv(i,t){i&1&&Z(0,"WindowMinimizeIcon")}function $v(i,t){if(i&1&&(Kt(0),le(1,Vv,1,0,"WindowMaximizeIcon",11)(2,Hv,1,0,"WindowMinimizeIcon",11),Qt()),i&2){let e=W(5);I(),T("ngIf",!e.maximized&&!e.maximizeIconTemplate),I(),T("ngIf",e.maximized&&!e.minimizeIconTemplate)}}function Wv(i,t){}function qv(i,t){i&1&&le(0,Wv,0,0,"ng-template")}function Jv(i,t){if(i&1&&(Kt(0),le(1,qv,1,0,null,21),Qt()),i&2){let e=W(5);I(),T("ngTemplateOutlet",e.maximizeIconTemplate)}}function Gv(i,t){}function Xv(i,t){i&1&&le(0,Gv,0,0,"ng-template")}function Yv(i,t){if(i&1&&(Kt(0),le(1,Xv,1,0,null,21),Qt()),i&2){let e=W(5);I(),T("ngTemplateOutlet",e.minimizeIconTemplate)}}function Kv(i,t){if(i&1){let e=Re();y(0,"p-button",20),De("onClick",function(){ge(e);let o=W(4);return ye(o.maximize())})("keydown.enter",function(){ge(e);let o=W(4);return ye(o.maximize())}),le(1,$v,3,2,"ng-container",11)(2,Jv,2,1,"ng-container",11)(3,Yv,2,1,"ng-container",11),f()}if(i&2){let e=W(4);T("styleClass","p-dialog-maximize-button")("tabindex",e.maximizable?"0":"-1"),I(),T("ngIf",!e.maximizeIcon),I(),T("ngIf",!e.maximized),I(),T("ngIf",e.maximized)}}function Qv(i,t){i&1&&(Kt(0),Z(1,"TimesIcon"),Qt())}function Zv(i,t){}function ew(i,t){i&1&&le(0,Zv,0,0,"ng-template")}function tw(i,t){if(i&1&&(y(0,"span"),le(1,ew,1,0,null,21),f()),i&2){let e=W(5);I(),T("ngTemplateOutlet",e.closeIconTemplate)}}function iw(i,t){if(i&1){let e=Re();y(0,"p-button",22),De("onClick",function(){ge(e);let o=W(4);return ye(o.hide())})("keydown.enter",function(){ge(e);let o=W(4);return ye(o.hide())}),le(1,Qv,2,0,"ng-container",11)(2,tw,2,1,"span",11),f()}if(i&2){let e=W(4);T("styleClass","p-dialog-close-button")("ariaLabel",e.ddconfig.closeAriaLabel||e.defaultCloseAriaLabel),I(),T("ngIf",!e.closeIconTemplate),I(),T("ngIf",e.closeIconTemplate)}}function rw(i,t){if(i&1&&(Kt(0),y(1,"span",16),D(2),f(),y(3,"div",17),le(4,Kv,4,5,"p-button",18)(5,iw,3,4,"p-button",19),f(),Qt()),i&2){let e=W(3);I(),T("ngClass","p-dialog-title")("id",e.ariaLabelledBy),I(),Oe(e.ddconfig.header),I(),T("ngClass","p-dialog-header-actions"),I(),T("ngIf",e.ddconfig.maximizable),I(),T("ngIf",e.closable)}}function ow(i,t){if(i&1){let e=Re();y(0,"div",15,3),De("mousedown",function(o){ge(e);let n=W(2);return ye(n.initDrag(o))}),le(2,jv,1,0,"ng-container",12)(3,rw,6,6,"ng-container",11),f()}if(i&2){let e=W(2);T("ngClass","p-dialog-header"),I(2),T("ngComponentOutlet",e.headerTemplate),I(),T("ngIf",!e.headerTemplate)}}function nw(i,t){}function aw(i,t){i&1&&le(0,nw,0,0,"ng-template",23)}function sw(i,t){i&1&&Ra(0)}function lw(i,t){if(i&1&&(Kt(0),D(1),Qt()),i&2){let e=W(3);I(),Ne(" ",e.ddconfig.footer," ")}}function pw(i,t){i&1&&Ra(0)}function dw(i,t){if(i&1&&(y(0,"div",17,4),le(2,lw,2,1,"ng-container",11)(3,pw,1,0,"ng-container",12),f()),i&2){let e=W(2);T("ngClass","p-dialog-footer"),I(2),T("ngIf",!e.footerTemplate),I(),T("ngComponentOutlet",e.footerTemplate)}}function uw(i,t){if(i&1){let e=Re();y(0,"div",7,1),De("@animation.start",function(o){ge(e);let n=W();return ye(n.onAnimationStart(o))})("@animation.done",function(o){ge(e);let n=W();return ye(n.onAnimationEnd(o))}),le(2,Uv,1,1,"div",8)(3,ow,4,3,"div",9),y(4,"div",10,2),le(6,aw,1,0,null,11)(7,sw,1,0,"ng-container",12),f(),le(8,dw,4,3,"div",13),f()}if(i&2){let e=W();Ot(e.ddconfig.style),al(e.ddconfig.styleClass),eu("width",e.ddconfig.width)("height",e.ddconfig.height),T("ngClass",Bt(22,Mv,e.maximizable&&e.maximized))("ngStyle",qe(24,zv))("@animation",Bt(28,Lv,su(25,Nv,e.transformOptions,e.ddconfig.transitionOptions||"150ms cubic-bezier(0, 0, 0.2, 1)")))("pFocusTrapDisabled",e.ddconfig.focusTrap===!1),Zd("aria-labelledby",e.ariaLabelledBy)("aria-modal",!0)("id",e.dialogId),I(2),T("ngIf",e.ddconfig.resizable),I(),T("ngIf",e.ddconfig.showHeader!==!1),I(),T("ngClass","p-dialog-content")("ngStyle",e.ddconfig.contentStyle),I(2),T("ngIf",!e.contentTemplate),I(),T("ngComponentOutlet",e.contentTemplate),I(),T("ngIf",e.ddconfig.footer||e.footerTemplate)}}var Lf=(()=>{class i{viewContainerRef;constructor(e){this.viewContainerRef=e}static \u0275fac=function(r){return new(r||i)(Kr(Xd))};static \u0275dir=Kd({type:i,selectors:[["","pDynamicDialogContent",""]]})}return i})(),Uf=(()=>{class i extends Ru{name="dialog";static \u0275fac=(()=>{let e;return function(o){return(e||(e=$d(i)))(o||i)}})();static \u0275prov=tr({token:i,factory:i.\u0275fac})}return i})();var Ys=class{data;inputValues;header;ariaLabelledBy;footer;width;height;closeOnEscape=!1;focusOnShow=!0;focusTrap=!0;baseZIndex;autoZIndex=!1;dismissableMask=!1;rtl=!1;style;contentStyle;styleClass;transitionOptions;closable=!1;showHeader=!1;modal=!1;maskStyleClass;resizable=!1;draggable=!1;keepInViewport=!1;minX;minY;maximizable=!1;maximizeIcon;minimizeIcon;position;closeAriaLabel;appendTo;duplicate=!1;breakpoints;templates},xa=class{constructor(){}close(t){this._onClose.next(t),setTimeout(()=>{this._onClose.complete()},1e3)}destroy(){this._onDestroy.next(null)}dragStart(t){this._onDragStart.next(t)}dragEnd(t){this._onDragEnd.next(t)}resizeInit(t){this._onResizeInit.next(t)}resizeEnd(t){this._onResizeEnd.next(t)}maximize(t){this._onMaximize.next(t)}_onClose=new bi;onClose=this._onClose.asObservable();_onDestroy=new bi;onDestroy=this._onDestroy.asObservable();_onDragStart=new bi;onDragStart=this._onDragStart.asObservable();_onDragEnd=new bi;onDragEnd=this._onDragEnd.asObservable();_onResizeInit=new bi;onResizeInit=this._onResizeInit.asObservable();_onResizeEnd=new bi;onResizeEnd=this._onResizeEnd.asObservable();_onMaximize=new bi;onMaximize=this._onMaximize.asObservable();onChildComponentLoaded=new bi},cw=dl([za({transform:"{{transform}}",opacity:0}),ll("{{transition}}",za({transform:"none",opacity:1}))]),hw=dl([ll("{{transition}}",za({transform:"{{transform}}",opacity:0}))]),jf=(()=>{class i extends xu{renderer;ddconfig;dialogRef;zone;parentDialog;visible=!0;componentRef;mask;resizing;dragging;maximized;_style={};originalStyle;lastPageX;lastPageY;ariaLabelledBy;id=fl("pn_id_");styleElement;insertionPoint;maskViewChild;contentViewChild;footerViewChild;headerViewChild;childComponentType;inputValues;container;wrapper;documentKeydownListener;documentEscapeListener;maskClickListener;transformOptions="scale(0.7)";documentResizeListener;documentResizeEndListener;documentDragListener;documentDragEndListener;_componentStyle=he(Uf);get minX(){return this.ddconfig.minX?this.ddconfig.minX:0}get minY(){return this.ddconfig.minY?this.ddconfig.minY:0}get keepInViewport(){return this.ddconfig.keepInViewport}get maximizable(){return this.ddconfig.maximizable}get maximizeIcon(){return this.ddconfig.maximizeIcon}get minimizeIcon(){return this.ddconfig.minimizeIcon}get closable(){return this.ddconfig.closable}get style(){return this._style}get position(){return this.ddconfig.position}get defaultCloseAriaLabel(){return this.config.getTranslation(_u.ARIA).close}set style(e){e&&(this._style=_({},e),this.originalStyle=e)}get parent(){let e=Array.from(this.document.getElementsByClassName("p-dialog"));if(e.length>1)return e.pop()}get parentContent(){let e=Array.from(this.document.getElementsByClassName("p-dialog"));if(e.length>0){let r=e[e.length-1].querySelector(".p-dialog-content");if(r)return Array.isArray(r)?r[0]:r}}get header(){return this.ddconfig.header}get data(){return this.ddconfig.data}get breakpoints(){return this.ddconfig.breakpoints}get footerTemplate(){return this.ddconfig?.templates?.footer}get headerTemplate(){return this.ddconfig?.templates?.header}get contentTemplate(){return this.ddconfig?.templates?.content}get minimizeIconTemplate(){return this.ddconfig?.templates?.minimizeicon}get maximizeIconTemplate(){return this.ddconfig?.templates?.maximizeicon}get closeIconTemplate(){return this.ddconfig?.templates?.closeicon}get maskClass(){let r=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find(o=>o===this.position);return{"p-dialog-mask":!0,"p-overlay-mask p-overlay-mask-enter":this.ddconfig.modal||this.ddconfig.dismissableMask,[`p-dialog-${r}`]:r}}get dialogId(){return this.attrSelector}zIndexForLayering;constructor(e,r,o,n,a){super(),this.renderer=e,this.ddconfig=r,this.dialogRef=o,this.zone=n,this.parentDialog=a}ngOnInit(){super.ngOnInit(),this.breakpoints&&this.createStyle()}createStyle(){if(bn(this.platformId)&&!this.styleElement){this.styleElement=this.renderer.createElement("style"),this.styleElement.type="text/css",this.renderer.appendChild(this.document.head,this.styleElement);let e="";for(let r in this.breakpoints)e+=`
|
|
26
|
-
@media screen and (max-width: ${r}) {
|
|
27
|
-
.p-dialog[id=${this.dialogId}]:not(.p-dialog-maximized) {
|
|
28
|
-
width: ${this.breakpoints[r]} !important;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
`;this.renderer.setProperty(this.styleElement,"innerHTML",e),wu(this.styleElement,"nonce",this.config?.csp()?.nonce)}}destroyStyle(){this.styleElement&&(this.renderer.removeChild(this.document.head,this.styleElement),this.styleElement=null)}ngAfterViewInit(){super.ngAfterViewInit(),this.loadChildComponent(this.childComponentType),this.ariaLabelledBy=this.getAriaLabelledBy(),this.cd.detectChanges()}getAriaLabelledBy(){let{header:e,showHeader:r}=this.ddconfig;return e===null||r===!1?null:fl("pn_id_")+"_header"}loadChildComponent(e){let r=this.insertionPoint?.viewContainerRef;r?.clear(),this.componentRef=r?.createComponent(e),this.inputValues&&Object.entries(this.inputValues).forEach(([o,n])=>{this.componentRef.setInput(o,n)}),this.dialogRef.onChildComponentLoaded.next(this.componentRef.instance)}moveOnTop(){this.ddconfig.autoZIndex!==!1?(Ao.set("modal",this.container,(this.ddconfig.baseZIndex||0)+this.config.zIndex.modal),this.wrapper.style.zIndex=String(parseInt(this.container.style.zIndex,10)-1)):this.zIndexForLayering=Ao.generateZIndex("modal",(this.ddconfig.baseZIndex||0)+this.config.zIndex.modal)}onAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.wrapper=this.container.parentElement,this.moveOnTop(),this.parent&&this.unbindGlobalListeners(),this.bindGlobalListeners(),this.container?.setAttribute(this.id,""),this.ddconfig.modal!==!1&&this.enableModality(),this.ddconfig.focusOnShow!==!1&&this.focus();break;case"void":this.wrapper&&this.ddconfig.modal!==!1&&Bo(this.wrapper,"p-overlay-mask-leave");break}}onAnimationEnd(e){e.toState==="void"&&(this.parentContent&&this.focus(this.parentContent),this.onContainerDestroy(),this.dialogRef.destroy())}onContainerDestroy(){this.unbindGlobalListeners(),this.container&&this.ddconfig.autoZIndex!==!1&&Ao.clear(this.container),this.zIndexForLayering&&Ao.revertZIndex(this.zIndexForLayering),this.ddconfig.modal!==!1&&this.disableModality(),this.container=null}close(){this.visible=!1,this.cd.markForCheck()}hide(){this.dialogRef&&this.dialogRef.close()}enableModality(){this.ddconfig.dismissableMask&&(this.maskClickListener=this.renderer.listen(this.wrapper,"mousedown",e=>{this.wrapper&&this.wrapper.isSameNode(e.target)&&this.hide()})),this.ddconfig.modal!==!1&&Bo(this.document.body,"p-overflow-hidden")}disableModality(){this.wrapper&&(this.ddconfig.dismissableMask&&this.unbindMaskClickListener(),this.ddconfig.modal!==!1&&vn(this.document.body,"p-overflow-hidden"),this.cd.destroyed||this.cd.detectChanges())}focus(e=this.contentViewChild.nativeElement){let r=gl.getFocusableElement(e,"[autofocus]");if(r){this.zone.runOutsideAngular(()=>{setTimeout(()=>r.focus(),5)});return}let o=gl.getFocusableElement(e);o?this.zone.runOutsideAngular(()=>{setTimeout(()=>o.focus(),5)}):this.footerViewChild?this.focus(this.footerViewChild.nativeElement):!o&&this.headerViewChild&&this.focus(this.headerViewChild.nativeElement)}maximize(){this.maximized=!this.maximized,this.maximized?Bo(this.document.body,"p-overflow-hidden"):vn(this.document.body,"p-overflow-hidden"),this.dialogRef.maximize({maximized:this.maximized})}initResize(e){this.ddconfig.resizable&&(this.documentResizeListener||this.bindDocumentResizeListeners(),this.resizing=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,Bo(this.document.body,"p-unselectable-text"),this.dialogRef.resizeInit(e))}onResize(e){if(this.resizing){let r=e.pageX-this.lastPageX,o=e.pageY-this.lastPageY,n=ml(this.container),a=Va(this.container),s=Va(this.contentViewChild.nativeElement),l=n+r,u=a+o,g=this.container.style.minWidth,m=this.container.style.minHeight,P=this.container.getBoundingClientRect(),E=hl();(!parseInt(this.container.style.top)||!parseInt(this.container.style.left))&&(l+=r,u+=o),(!g||l>parseInt(g))&&P.left+l<E.width&&(this._style.width=l+"px",this.container.style.width=this._style.width),(!m||u>parseInt(m))&&P.top+u<E.height&&(this.contentViewChild.nativeElement.style.height=s+u-a+"px",this._style.height&&(this._style.height=u+"px",this.container.style.height=this._style.height)),this.lastPageX=e.pageX,this.lastPageY=e.pageY}}resizeEnd(e){this.resizing&&(this.resizing=!1,vn(this.document.body,"p-unselectable-text"),this.dialogRef.resizeEnd(e))}initDrag(e){cl(e.target,"p-dialog-header-icon")||cl(e.target.parentElement,"p-dialog-header-icon")||this.ddconfig.draggable&&(this.dragging=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,this.container.style.margin="0",Bo(this.document.body,"p-unselectable-text"),this.dialogRef.dragStart(e))}onDrag(e){if(this.dragging){let r=ml(this.container),o=Va(this.container),n=e.pageX-this.lastPageX,a=e.pageY-this.lastPageY,s=this.container.getBoundingClientRect(),l=s.left+n,u=s.top+a,g=hl();this.container.style.position="fixed",this.keepInViewport?(l>=this.minX&&l+r<g.width&&(this._style.left=l+"px",this.lastPageX=e.pageX,this.container.style.left=l+"px"),u>=this.minY&&u+o<g.height&&(this._style.top=u+"px",this.lastPageY=e.pageY,this.container.style.top=u+"px")):(this.lastPageX=e.pageX,this.container.style.left=l+"px",this.lastPageY=e.pageY,this.container.style.top=u+"px")}}endDrag(e){this.dragging&&(this.dragging=!1,vn(this.document.body,"p-unselectable-text"),this.dialogRef.dragEnd(e),this.cd.detectChanges())}resetPosition(){this.container.style.position="",this.container.style.left="",this.container.style.top="",this.container.style.margin=""}bindDocumentDragListener(){bn(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentDragListener=this.renderer.listen(this.document,"mousemove",this.onDrag.bind(this))})}bindDocumentDragEndListener(){bn(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentDragEndListener=this.renderer.listen(this.document,"mouseup",this.endDrag.bind(this))})}unbindDocumentDragEndListener(){this.documentDragEndListener&&(this.documentDragEndListener(),this.documentDragListener=null)}unbindDocumentDragListener(){this.documentDragListener&&(this.documentDragListener(),this.documentDragListener=null)}bindDocumentResizeListeners(){bn(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentResizeListener=this.renderer.listen(this.document,"mousemove",this.onResize.bind(this)),this.documentResizeEndListener=this.renderer.listen(this.document,"mouseup",this.resizeEnd.bind(this))})}unbindDocumentResizeListeners(){this.documentResizeListener&&this.documentResizeEndListener&&(this.documentResizeListener(),this.documentResizeEndListener(),this.documentResizeListener=null,this.documentResizeEndListener=null)}bindGlobalListeners(){this.ddconfig.closeOnEscape!==!1&&this.bindDocumentEscapeListener(),this.ddconfig.resizable&&this.bindDocumentResizeListeners(),this.ddconfig.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener())}unbindGlobalListeners(){this.unbindDocumentEscapeListener(),this.unbindDocumentResizeListeners(),this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener()}bindDocumentEscapeListener(){let e=this.maskViewChild?this.maskViewChild.nativeElement.ownerDocument:"document";this.documentEscapeListener=this.renderer.listen(e,"keydown",r=>{if(r.which==27){let o=Ao.getCurrent();(parseInt(this.container.style.zIndex)==o||this.zIndexForLayering==o)&&this.hide()}})}unbindDocumentEscapeListener(){this.documentEscapeListener&&(this.documentEscapeListener(),this.documentEscapeListener=null)}unbindMaskClickListener(){this.maskClickListener&&(this.maskClickListener(),this.maskClickListener=null)}ngOnDestroy(){this.onContainerDestroy(),this.componentRef&&this.componentRef.destroy(),this.destroyStyle(),super.ngOnDestroy()}static \u0275fac=function(r){return new(r||i)(Kr(Gd),Kr(Ys),Kr(xa),Kr(qd),Kr(i,12))};static \u0275cmp=mt({type:i,selectors:[["p-dynamicDialog"],["p-dynamicdialog"],["p-dynamic-dialog"]],viewQuery:function(r,o){if(r&1&&(vi(Lf,5),vi(Tv,5),vi(Bv,5),vi(Av,5),vi(Rv,5)),r&2){let n;wi(n=_i())&&(o.insertionPoint=n.first),wi(n=_i())&&(o.maskViewChild=n.first),wi(n=_i())&&(o.contentViewChild=n.first),wi(n=_i())&&(o.footerViewChild=n.first),wi(n=_i())&&(o.headerViewChild=n.first)}},features:[Cr([Uf]),Aa],decls:3,vars:9,consts:[["mask",""],["container",""],["content",""],["titlebar",""],["footer",""],[3,"ngStyle","ngClass"],["role","dialog","pFocusTrap","",3,"ngClass","ngStyle","style","class","pFocusTrapDisabled","width","height",4,"ngIf"],["role","dialog","pFocusTrap","",3,"ngClass","ngStyle","pFocusTrapDisabled"],["style","z-index: 90;",3,"ngClass","mousedown",4,"ngIf"],[3,"ngClass","mousedown",4,"ngIf"],[3,"ngClass","ngStyle"],[4,"ngIf"],[4,"ngComponentOutlet"],[3,"ngClass",4,"ngIf"],[2,"z-index","90",3,"mousedown","ngClass"],[3,"mousedown","ngClass"],[3,"ngClass","id"],[3,"ngClass"],["rounded","","text","",3,"styleClass","tabindex","onClick","keydown.enter",4,"ngIf"],["rounded","","text","","severity","secondary",3,"styleClass","ariaLabel","onClick","keydown.enter",4,"ngIf"],["rounded","","text","",3,"onClick","keydown.enter","styleClass","tabindex"],[4,"ngTemplateOutlet"],["rounded","","text","","severity","secondary",3,"onClick","keydown.enter","styleClass","ariaLabel"],["pDynamicDialogContent",""]],template:function(r,o){r&1&&(y(0,"div",5,0),le(2,uw,9,30,"div",6),f()),r&2&&(al(o.ddconfig.maskStyleClass),T("ngStyle",lu(5,Ov,o.position==="left"||o.position==="topleft"||o.position==="bottomleft"?"flex-start":o.position==="right"||o.position==="topright"||o.position==="bottomright"?"flex-end":"center",o.position==="top"||o.position==="topleft"||o.position==="topright"?"flex-start":o.position==="bottom"||o.position==="bottomleft"||o.position==="bottomright"?"flex-end":"center",o.ddconfig.modal?"auto":"none"))("ngClass",o.maskClass),I(2),T("ngIf",o.visible))},dependencies:[Wt,ko,uu,di,hu,cu,$a,Lf,Su,Du,Cu,ui,Au],encapsulation:2,data:{animation:[gu("animation",[pl("void => visible",[ul(cw)]),pl("visible => void",[ul(hw)])])]}})}return i})(),Ks=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Yd({type:i});static \u0275inj=Vd({imports:[jf,$a,$a]})}return i})(),Sd=class{_parentInjector;_additionalTokens;constructor(t,e){this._parentInjector=t,this._additionalTokens=e}get(t,e,r){let o=this._additionalTokens.get(t);return o||this._parentInjector.get(t,e)}},hn=(()=>{class i{appRef;injector;document;dialogComponentRefMap=new Map;constructor(e,r,o){this.appRef=e,this.injector=r,this.document=o}open(e,r){if(!this.duplicationPermission(e,r))return null;let o=this.appendDialogComponentToBody(r,e);return this.dialogComponentRefMap.get(o).instance.childComponentType=e,this.dialogComponentRefMap.get(o).instance.inputValues=r.inputValues,o}getInstance(e){return this.dialogComponentRefMap.get(e).instance}appendDialogComponentToBody(e,r){let o=new WeakMap;o.set(Ys,e);let n=new xa;o.set(xa,n);let a=n.onClose.subscribe(()=>{this.dialogComponentRefMap.get(n).instance.close()}),s=n.onDestroy.subscribe(()=>{this.removeDialogComponentFromBody(n),s.unsubscribe(),a.unsubscribe()}),l=pu(jf,{environmentInjector:this.appRef.injector,elementInjector:new Sd(this.injector,o)});this.appRef.attachView(l.hostView);let u=l.hostView.rootNodes[0];return!e.appendTo||e.appendTo==="body"?this.document.body.appendChild(u):vu(e.appendTo,u),this.dialogComponentRefMap.set(n,l),n}removeDialogComponentFromBody(e){if(!e||!this.dialogComponentRefMap.has(e))return;let r=this.dialogComponentRefMap.get(e);this.appRef.detachView(r.hostView),r.destroy(),r.changeDetectorRef.detectChanges(),this.dialogComponentRefMap.delete(e)}duplicationPermission(e,r){if(r.duplicate)return!0;let o=!0;for(let[n,a]of this.dialogComponentRefMap)if(a.instance.childComponentType===e){o=!1;break}return o}static \u0275fac=function(r){return new(r||i)(_r(Qd),_r(Wd),_r(du))};static \u0275prov=tr({token:i,factory:i.\u0275fac})}return i})();var Qs=()=>[],Zs=(()=>{class i{static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=mt({type:i,selectors:[["app-dialog-create-customer-supplier"]],decls:66,vars:8,consts:[[1,"row","row-gap-3"],[1,"col-12"],[1,"form-group","d-flex","flex-column"],["for",""],["appendTo","body","optionLabel","name","placeholder","Select a City",1,"w-full","md:w-56",3,"options"],[1,"col-12","col-lg-4"],["pInputText","","autocomplete","off",1,"w-100"],["rows","1","cols","30","pTextarea",""],[1,"col-12","col-lg-6"]],template:function(r,o){r&1&&(y(0,"div",0)(1,"div",1)(2,"div",2)(3,"label",3),D(4,"Customer / Supplier"),f(),Z(5,"p-select",4),f()(),y(6,"div",5)(7,"div",2)(8,"label",3),D(9,"Title"),f(),Z(10,"input",6),f()(),y(11,"div",5)(12,"div",2)(13,"label",3),D(14,"First Name"),f(),Z(15,"input",6),f()(),y(16,"div",5)(17,"div",2)(18,"label",3),D(19,"Last Name"),f(),Z(20,"input",6),f()(),y(21,"div",5)(22,"div",2)(23,"label",3),D(24,"Mobile"),f(),Z(25,"input",6),f()(),y(26,"div",5)(27,"div",2)(28,"label",3),D(29,"Email"),f(),Z(30,"input",6),f()(),y(31,"div",5)(32,"div",2)(33,"label",3),D(34,"Identification"),f(),Z(35,"input",6),f()(),y(36,"div",1)(37,"div",2)(38,"label",3),D(39,"Birthday"),f(),Z(40,"input",6),f()(),y(41,"div",1)(42,"div",2)(43,"label",3),D(44,"Title"),f(),Z(45,"textarea",7),f()(),y(46,"div",8)(47,"div",2)(48,"label",3),D(49,"City"),f(),Z(50,"p-select",4),f()(),y(51,"div",8)(52,"div",2)(53,"label",3),D(54,"Nationality"),f(),Z(55,"p-select",4),f()(),y(56,"div",8)(57,"div",2)(58,"label",3),D(59,"Gender"),f(),Z(60,"p-select",4),f()(),y(61,"div",8)(62,"div",2)(63,"label",3),D(64,"Member Code"),f(),Z(65,"textarea",7),f()()()),r&2&&(I(5),T("options",qe(4,Qs)),I(45),T("options",qe(5,Qs)),I(5),T("options",qe(6,Qs)),I(5),T("options",qe(7,Qs)))},dependencies:[Ji,Nr,Vi,ji,qu,zr,Mr],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return i})();var $f=je(Xs());var fw=["class","page"],gw=()=>({width:"25rem"}),yw=()=>[".."],bw=()=>({height:"calc(100vh - 140px)"}),vw=i=>({"ng-invalid ng-dirty":i}),Vf=()=>({}),Hf=i=>({"text-danger":i});function ww(i,t){if(i&1){let e=Re();y(0,"div",10)(1,"a",11),D(2,"Cancel"),f(),y(3,"p-button",12),De("onClick",function(){ge(e);let o=W();return ye(o.onSubmitJournalEntry())}),f()()}i&2&&(I(),T("routerLink",qe(1,yw)))}function _w(i,t){if(i&1&&(y(0,"div",41)(1,"div",42),D(2),f()()),i&2){let e=t.$implicit;I(2),Ne(" ",e.name," ")}}function xw(i,t){if(i&1&&(y(0,"div",26),Z(1,"p-radiobutton",43),y(2,"label",44),D(3),f()()),i&2){let e=t.$implicit;I(),sl("inputId","contactType-",e.key,""),T("value",e.key),I(),sl("for","contactType-",e.key,""),I(),Ne(" ",e.value," ")}}function Cw(i,t){if(i&1){let e=Re();y(0,"div",33)(1,"div",45),Z(2,"i",46),y(3,"div",47)(4,"a",48),D(5),f()(),y(6,"button",49),De("click",function(){ge(e);let o=W(3);return ye(o.onRemoveFileAttachment())}),f()()()}if(i&2){let e,r=W(3);I(4),T("href",r.form.controls.order==null||(e=r.form.controls.order.get("fileAttachment"))==null?null:e.value,xr)("title",r.getFileAttachmentName()),I(),Ne(" ",r.getFileAttachmentName()," ")}}function Sw(i,t){if(i&1){let e=Re();y(0,"div",34)(1,"POS-uppy",50),De("fileUploaded",function(o){ge(e);let n=W(3);return ye(n.onUpload(o))}),f()()}if(i&2){let e=W(3);I(),T("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.uppyDashboard)}}function Dw(i,t){i&1&&(y(0,"tr")(1,"th",51),D(2,"Account"),f(),y(3,"th",52),D(4,"Note"),f(),y(5,"th",53),D(6," Debit "),f(),y(7,"th",53),D(8," Credit "),f(),Z(9,"th",54),f())}function Iw(i,t){if(i&1&&(y(0,"div",62)(1,"div",63)(2,"span",64),D(3),f()(),y(4,"div",30)(5,"span",65),D(6),f()()()),i&2){let e=t.$implicit;I(3),Ne("(",e.code,")"),I(3),Oe(e.name)}}function Ew(i,t){if(i&1){let e=Re();y(0,"tr",55)(1,"td")(2,"p-select",56),le(3,Iw,7,2,"ng-template",null,3,_e),f()(),y(5,"td"),Z(6,"textarea",57),f(),y(7,"td"),Z(8,"input",58),f(),y(9,"td"),Z(10,"input",59),f(),y(11,"td")(12,"div",60)(13,"p-button",61),De("onClick",function(){let o=ge(e).rowIndex,n=W(3);return ye(n.removeItems(o))}),f()()()()}if(i&2){let e,r=t.rowIndex,o=W(3);T("formGroupName",r),I(2),T("filter",!0)("options",o.journalEntryForm().options.accounts)("virtualScrollItemSize",50)("showClear",(o.form.controls==null||o.form.controls.items==null||o.form.controls.items.controls[r]==null||(e=o.form.controls.items.controls[r].get("accountID"))==null?null:e.value)!==o.guidEmpty),I(6),T("autoNumeric",qe(8,Vf)),I(2),T("autoNumeric",qe(9,Vf)),I(3),T("text",!0)}}function Pw(i,t){if(i&1&&(y(0,"span",71),D(1),ut(2,"number"),f()),i&2){let e=W(4);I(),Ne(" The total debit and credit amounts must be equal (Difference: ",wt(2,1,e.subTotalCredit()-e.subTotalDebit()),") ")}}function kw(i,t){if(i&1){let e=Re();y(0,"tr")(1,"td")(2,"div",66)(3,"div",10)(4,"p-button",67),De("onClick",function(){ge(e);let o=W(3);return ye(o.addItems())}),f()(),y(5,"span",68),D(6,"Total"),f()()(),y(7,"td",69),D(8),ut(9,"number"),f(),y(10,"td",69),D(11),ut(12,"number"),f(),y(13,"td"),le(14,Pw,3,3,"span",70),f(),Z(15,"td"),f()}if(i&2){let e=W(3);I(7),T("ngClass",Bt(9,Hf,e.subTotalCredit()!==e.subTotalDebit())),I(),Ne(" ",wt(9,5,e.subTotalDebit())," "),I(2),T("ngClass",Bt(11,Hf,e.subTotalCredit()!==e.subTotalDebit())),I(),Ne(" ",wt(12,7,e.subTotalCredit())," "),I(3),T("ngIf",e.subTotalCredit()!==e.subTotalDebit())}}function Fw(i,t){if(i&1){let e=Re();y(0,"div",14)(1,"p-panel")(2,"p-scroll-panel")(3,"div",15)(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",19)(8,"div",20)(9,"label",21),D(10,"Date"),f()(),Z(11,"p-datepicker",22),f()(),y(12,"div",18)(13,"div",19)(14,"div",20)(15,"label",21),D(16,"Outlet"),f()(),y(17,"p-select",23),le(18,_w,3,1,"ng-template",null,3,_e),f()()(),y(20,"div",18)(21,"div",19)(22,"div",20)(23,"label",21),D(24,"Number"),f()(),Z(25,"input",24),f()(),y(26,"div",18)(27,"div",19)(28,"div",20)(29,"label",21),D(30,"Contact"),f()(),y(31,"div",25),Ai(32,xw,4,6,"div",26,Bi),f()()(),y(34,"div",27)(35,"div",19)(36,"div",20)(37,"label",28),D(38),f()(),y(39,"p-autocomplete",29),De("completeMethod",function(o){ge(e);let n=W(2);return ye(n.searchCustomer(o))}),f()()()()(),y(40,"div",30)(41,"div",17)(42,"div",18)(43,"div",19)(44,"div",31)(45,"label",32),D(46,"Upload"),f()(),le(47,Cw,7,3,"div",33)(48,Sw,2,2,"div",34),f()(),y(49,"div",27)(50,"div",19)(51,"div",35)(52,"label",36),D(53,"Note"),f()(),y(54,"div",37),Z(55,"textarea",38),f()()()()()(),Z(56,"hr"),y(57,"div",39)(58,"div",30)(59,"p-table",40),le(60,Dw,10,0,"ng-template",null,4,_e)(62,Ew,14,10,"ng-template",null,5,_e)(64,kw,16,13,"ng-template",null,2,_e),f()()()()()()}if(i&2){let e,r=W(2);T("formGroup",r.form),I(2),Ot(qe(12,bw)),I(9),T("showIcon",!0),I(6),T("options",r.outlets()),I(15),Ri(r.contactType()),I(6),Oe(+r.form.controls.order.controls.contactType.value==0?"Customer":"Supplier"),I(),T("suggestions",r.customerSuggestions())("placeholder",+r.form.controls.order.controls.contactType.value==0?"Search Customer":"Search Supplier"),I(8),Qr(!(r.form.controls.order==null||(e=r.form.controls.order.get("fileAttachment"))==null)&&e.value?47:48),I(8),T("ngClass",Bt(13,vw,r.form.controls.order.controls.note.invalid&&(r.form.controls.order.controls.note.dirty||r.form.controls.order.controls.note.touched))),I(4),T("scrollable",!0)("value",r.form.controls.items.controls)}}function Tw(i,t){if(i&1&&le(0,Fw,66,15,"div",13),i&2){let e=W();T("ngIf",e.journalEntryForm())}}function Bw(i,t){if(i&1){let e=Re();y(0,"p-button",72),De("click",function(){ge(e);let o=W();return ye(o.uploadDialogVisible.set(!1))}),f(),y(1,"p-button",73),De("click",function(){ge(e);let o=W();return ye(o.uploadDialogVisible.set(!1))}),f()}i&2&&T("text",!0)}function Aw(){return i=>{let t=i.get("debitAmount")?.value,e=i.get("creditAmount")?.value;return t&&e?{bothFilled:!0}:null}}var Id=(()=>{class i{constructor(){this.role=he(Za),this.fileAttachment=Ze(new File([],"")),this.activatedRoute=he(Sr),this.router=he(zi),this.journalEntryService=he(xt),this.journalEntryForm=Ze(null),this.customerSuggestions=Ze([]),this.itemsForm=Ze([]),this.subTotalDebit=Mt(()=>this.itemsForm().reduce((e,r)=>e+ +r.debitAmount,0)),this.subTotalCredit=Mt(()=>this.itemsForm().reduce((e,r)=>e+ +r.creditAmount,0)),this.contactType=Ze([{key:0,value:"Customer"},{key:1,value:"Supplier"}]),this.dialogService=he(hn),this.uploadDialogVisible=Ze(!1),this.guidEmpty=et,this.uppyCore={restrictions:{allowedFileTypes:["image/*","application/pdf"]}},this.uppyDashboard={inline:!0,width:350,height:200},this.outlets=Mt(()=>this.journalEntryForm()?.options?.outlets||[]),this.toasr=he(Dr),this.initializeFormEffect()}toggleDialog(){this.dialogService.open(Zs,{header:"Create Customer/Supplier",width:"40vw",footer:"submit",closable:!0,dismissableMask:!0,modal:!0,showHeader:!0})}ngOnInit(){this.initializeForm(),this.loadJournalEntryForm()}onToggleUploadDialog(){this.uploadDialogVisible.update(e=>!e)}onUploadDialog(e){$f.default.parse(e.currentFiles[0],{complete:r=>{console.log("Parsed result:",r)},error:r=>{console.error("Parsing error:",r)}})}initializeForm(){this.form=new Ui({order:new Ui({id:new ee("",[At.required]),number:new ee("",[At.required]),date:new ee({value:new Date,disabled:!this.role.accounting.DateEditor},[At.required]),note:new ee(""),entryTypeID:new ee(1,[At.required]),referenceID:new ee(""),referenceTypeID:new ee(0,[At.required]),referenceText:new ee(""),contactID:new ee(""),detailReferenceID:new ee(""),creatorID:new ee("",[At.required]),created:new ee("",[At.required]),modifierID:new ee(""),modified:new ee(""),outletID:new ee(null),statusID:new ee(0),contactName:new ee(""),contactType:new ee(0),fileAttachment:new ee(null)}),items:new La([]),additionalAccountID:new ee(""),file:new ee(null),customerName:new ee("")})}initializeFormEffect(){ir(()=>{let e=this.journalEntryForm();e&&(this.form.patchValue({order:U(_({},e.form.order),{entryTypeID:Number(e.form.order.entryTypeID===0&&1),referenceID:String(e.form.order.referenceID||et),contactID:String(e.form.customerName||""),detailReferenceID:String(e.form.order.detailReferenceID||et),contactName:String(e.form.order.contactName),date:Dd.default.isDayjs(e.form.order.date)?e.form.order.date.toDate():(0,Dd.default)().toDate(),modifierID:String(e.form.order.modifierID||et),statusID:e.form.order.statusID,modified:String(e.form.order.modified),outletID:String(e.form.order.outletID||et),fileAttachment:e.form.order.fileAttachment}),additionalAccountID:e.form.additionalAccountID,customerName:e.form.customerName}),this.updateFormItems(e.form.items),this.form.controls.items.touched||this.itemsForm.set(this.form.controls.items.value),this.form.controls.items.valueChanges.subscribe(r=>{this.itemsForm.set(r)}))})}updateFormItems(e){let r=this.form.controls.items;r.clear(),e.forEach(o=>{r.push(new Ui({id:new ee(o.id),journalID:new ee(o.journalID),accountID:new ee(o.accountID),debitAmount:new ee(o.debitAmount),creditAmount:new ee(o.creditAmount),index:new ee(o.index),note:new ee(o.note)},{validators:Aw()}))}),r.controls.forEach(o=>{o.get("debitAmount")?.valueChanges.pipe(We(n=>{n>0&&o.get("creditAmount")?.setValue(0,{emitEvent:!1})})).subscribe(),o.get("creditAmount")?.valueChanges.pipe(We(n=>{n>0&&o.get("debitAmount")?.setValue(0,{emitEvent:!1})})).subscribe()})}loadJournalEntryForm(){this.activatedRoute.data.pipe(pi(e=>e.form),We(e=>this.journalEntryForm.set(e))).subscribe()}searchCustomer(e){switch(+this.form.controls.order.value.contactType){case 0:this.journalEntryService.getJournalEntryCustomerSuggestions(e.query).pipe(We(r=>this.customerSuggestions.set(r))).subscribe();break;case 1:this.journalEntryService.getJournalEntrySupplierSuggestions(e.query).pipe(We(r=>this.customerSuggestions.set(r))).subscribe();break;default:console.error("Invalid contact type");break}}addItems(){this.form.controls.items.push(new Ui({id:new ee(et.toString()),journalID:new ee(et.toString()),accountID:new ee(et.toString()),debitAmount:new ee(0),creditAmount:new ee(0),index:new ee(this.form.controls.items.length??0),note:new ee("")}))}onSubmitJournalEntry(){if(this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let e=this.getCleanedFormValue(),r=this.buildFormData(e);this.journalEntryService.submitJournalEntry(r).pipe(at("response"),We(()=>{this.form.controls.order.controls.date.disable(),this.router.navigate(["/journal/journal-entry"])}),wr(o=>vr(()=>o)),at("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let e=this.form.getRawValue(),r=Object.entries(e).reduce((o,[n,a])=>(n==="items"?o[n]=a.map(s=>U(_({},s),{debitAmount:+s.debitAmount,creditAmount:+s.creditAmount})):n==="order"?o[n]=U(_({},a),{contactID:a.contactID||et}):o[n]=a,o),{});return JSON.parse(JSON.stringify(r,(o,n)=>n==="null"?null:n))}buildFormData(e){let r=new FormData;return r.append("Data",JSON.stringify(e)),r.append("File",this.fileAttachment()),r}onUpload(e){e instanceof Event||e instanceof File&&this.fileAttachment.set(e)}removeItems(e){this.form.controls.items.removeAt(e)}getFileAttachmentName(){return this.journalEntryService.getImageFileName(this.form.controls?.order?.controls?.fileAttachment?.value)||"No file attached"}onRemoveFileAttachment(){this.form.controls.order.controls.fileAttachment.setValue(null),this.toasr.info("File attachment removed successfully","Info")}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=mt({type:i,selectors:[["app-journal-entry-form",8,"page"]],features:[Cr([hn,Ha])],attrs:fw,decls:10,vars:6,consts:[["actionButton",""],["content",""],["footer",""],["item",""],["header",""],["body",""],["pageTitle",`Manual Journal Form
|
|
32
|
-
`,3,"hasMainWrapperPadding"],["header","Upload",3,"modal","visible"],["mode","basic","chooseLabel","Choose","chooseIcon","pi pi-upload",3,"onSelect"],["position","bottom-right"],[1,"d-flex","gap-2"],[1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["class","d-flex flex-column row-gap-4",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-4",3,"formGroup"],[1,"row","gap-4"],[1,"col-6"],[1,"row","row-gap-4"],["formGroupName","order",1,"col-12","col-lg-12"],[1,"row"],[1,"col-3","d-flex","align-items-center"],["for","outlet",1,"m-0","fs-3","fw-normal"],["styleClass","w-100","dataType","string","size","small","formControlName","date",1,"col-6","p-0",3,"showIcon"],["filter","","filterBy","name","size","small","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",1,"col-6","p-0",3,"options"],["pSize","small","type","text","pInputText","","formControlName","number","placeholder","Enter Number",1,"col-6"],[1,"col-6","d-flex","gap-2","p-0"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","order",1,"col-12"],["for","",1,"m-0","fs-3","fw-normal"],["size","small","styleClass","w-100","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",1,"col-6","p-0",3,"completeMethod","suggestions","placeholder"],[1,"col"],[1,"col-3","d-flex"],["for","uploadFile",1,"m-0","fs-3","fw-normal"],[1,"col-9","p-0"],[1,"col-9","pl-0","position-relative"],[1,"col-3"],["for","",1,"mb-0","fs-3","fw-normal"],[1,"col-9","pl-0"],["rows","4","cols","30","pSize","small","pTextarea","","formControlName","note","placeholder","Enter Note",1,"w-100",3,"ngClass"],["formArrayName","items",1,"row","mb-5"],["scrollHeight","400px",3,"scrollable","value"],[1,"flex","items-center","gap-2",2,"height","38x"],[1,"d-inline-block","text-truncate",2,"max-width","300px"],["formControlName","contactType","name","contactType",3,"value","inputId"],[1,"mb-0","d-flex","align-items-center","radiobutton-label",3,"for"],[1,"d-flex","align-items-center","p-2","gap-2","border","rounded","ps-3"],[1,"fa-solid","fa-file"],[1,"flex-grow-1"],["target","_blank",1,"text-truncate","d-block",2,"max-width","300px",3,"href","title"],["pButton","","icon","fa-solid fa-xmark","aria-label","Remove file",1,"p-button-rounded","p-button-text","p-button-sm","flex-shrink-0",3,"click"],[3,"fileUploaded","uppyCoreConfiguration","dashboardPropsConfiguration"],[2,"width","30%","min-width","120px"],[2,"min-width","150px"],[1,"text-end",2,"width","15%","min-width","80px"],[2,"width","5%","min-width","30px"],[3,"formGroupName"],["appendTo","body","size","small","filterBy","code,name","formControlName","accountID","virtualScroll","","optionLabel","name","optionValue","id","placeholder","Select an account","styleClass","w-100",3,"filter","options","virtualScrollItemSize","showClear"],["rows","1","cols","30","pTextarea","","formControlName","note","pSize","small",1,"w-100"],["pSize","small","formControlName","debitAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],["pSize","small","formControlName","creditAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],[1,"d-flex","justify-content-center"],["size","small","icon","fa-solid fa-xmark","aria-label","Save","severity","danger",3,"onClick","text"],[1,"row","w-100"],[1,"col-4"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle",2,"max-width","150px"],[1,"d-flex","justify-content-between","align-items-center"],["icon","fa-light fa-plus","size","small","label","Add",3,"onClick"],[2,"vertical-align","middle"],[1,"text-end","footer-total",3,"ngClass"],["class","text-danger",4,"ngIf"],[1,"text-danger"],["label","Cancel","severity","secondary",3,"click","text"],["label","OK(F2)","severity","primary",3,"click"]],template:function(r,o){if(r&1){let n=Re();y(0,"app-main-panel",6),le(1,ww,4,2,"ng-template",null,0,_e)(3,Tw,1,1,"ng-template",null,1,_e),f(),y(5,"p-dialog",7)(6,"p-fileupload",8),De("onSelect",function(s){return ge(n),ye(o.onUploadDialog(s))}),f(),le(7,Bw,2,1,"ng-template",null,2,_e),f(),Z(9,"p-toast",9)}r&2&&(T("hasMainWrapperPadding",!0),I(5),Ot(qe(5,gw)),T("modal",!0)("visible",o.uploadDialogVisible()))},dependencies:[Tr,Ir,Er,Pr,kr,Fr,Fo,To,ci,Wt,ko,di,Oi,zr,Mr,Or,Rr,Vi,ji,$o,Ho,Uo,Lo,qi,Wi,Hi,Iu,ui,$i,Wa,qa,Ji,Nr,Ks,jo,Ja,No,zo,Vo,Xa,Oo,Ro,Ar,Br,Li,Ni,cn],styles:[".footer-total[_ngcontent-%COMP%]{margin-right:10px;padding-right:26px}"]})}}return i})();var Ed=i=>{let t=he(xt),e=he(Wo);return e.show(),console.log("journalEntryResolver",i),t.getJournalEntryForm(i.paramMap.get("id")??"").pipe(at("response"),We(()=>e.hide()))};var Rw=()=>["edit"],Ow=()=>["/report/general-ledger"],Mw=i=>({id:i});function zw(i,t){if(i&1){let e=Re();y(0,"a",7),Z(1,"i",8),D(2," Edit "),f(),y(3,"p-button",9),De("onClick",function(){ge(e);let o=W();return ye(o.onDeleteJournal())}),f()}i&2&&T("routerLink",qe(1,Rw))}function Nw(i,t){if(i&1&&(Kt(0),y(1,"a",19),D(2,"File Attachment"),f(),Qt()),i&2){let e=W(3);I(),T("href",e.journalEntryInfo().order.fileAttachment,xr)}}function Lw(i,t){i&1&&(y(0,"span",20),D(1,"No file attached"),f())}function Uw(i,t){if(i&1&&(y(0,"div",13),Z(1,"hr"),y(2,"div",15),D(3,"File Attachment"),f(),y(4,"div",14),le(5,Nw,3,1,"ng-container",18)(6,Lw,2,0,"ng-template",null,5,_e),f()()),i&2){let e=iu(7),r=W(2);I(5),T("ngIf",r.journalEntryInfo().order.fileAttachment)("ngIfElse",e)}}function jw(i,t){i&1&&(y(0,"tr")(1,"th",21),D(2,"Code"),f(),y(3,"th"),D(4,"Account"),f(),y(5,"th",22),D(6,"Debit"),f(),y(7,"th",22),D(8,"Credit"),f()())}function Vw(i,t){if(i&1&&(y(0,"div",26),D(1),f()),i&2){let e=W().$implicit;I(),Ne(" ",e.note," ")}}function Hw(i,t){if(i&1&&(y(0,"tr")(1,"td")(2,"a",23),D(3),f()(),y(4,"td"),D(5),le(6,Vw,2,1,"div",24),f(),y(7,"td",25),D(8),ut(9,"number"),f(),y(10,"td",25),D(11),ut(12,"number"),f()()),i&2){let e=t.$implicit;I(2),T("routerLink",qe(11,Ow))("queryParams",Bt(12,Mw,e.accountID)),I(),Oe(e.accountCode),I(2),Ne(" ",e.accountName," "),I(),T("ngIf",e.note),I(2),Oe(wt(9,7,e.debitAmount)),I(3),Oe(wt(12,9,e.creditAmount))}}function $w(i,t){if(i&1&&(y(0,"tr")(1,"td",27),D(2,"Total"),f(),y(3,"td",25),D(4),ut(5,"number"),f(),y(6,"td",25),D(7),ut(8,"number"),f()()),i&2){let e=W(2);I(4),Oe(wt(5,2,e.totalDebitAmount())),I(3),Oe(wt(8,4,e.totalCreditAmount()))}}function Ww(i,t){if(i&1&&(y(0,"div",10)(1,"div",11)(2,"p-card",12)(3,"div",13)(4,"div",14)(5,"div",13)(6,"div",15),D(7,"Date"),f(),y(8,"div",14),D(9),ut(10,"date"),f()(),Z(11,"hr"),y(12,"div",13)(13,"div",15),D(14,"Number"),f(),y(15,"div",14),D(16),f()(),Z(17,"hr"),y(18,"div",13)(19,"div",15),D(20,"Outlet"),f(),y(21,"div",14),D(22),f()(),le(23,Uw,8,2,"div",16),f(),y(24,"div",14)(25,"div",13)(26,"div",15),D(27,"Contact"),f(),y(28,"div",14),D(29),f()(),Z(30,"hr"),y(31,"div",13)(32,"div",15),D(33,"Note"),f(),y(34,"div",14),D(35),f()(),Z(36,"hr"),f()()()(),y(37,"div",14)(38,"p-card")(39,"p-table",17),le(40,jw,9,0,"ng-template",null,2,_e)(42,Hw,13,14,"ng-template",null,3,_e)(44,$w,9,6,"ng-template",null,4,_e),f()()()()),i&2){let e,r,o,n,a,s,l,u=W();I(9),Ne(" ",Oa(10,7,(e=u.journalEntryInfo())==null||e.order==null?null:e.order.date,"dd MMM yy")," "),I(7),Oe((r=u.journalEntryInfo())==null||r.order==null?null:r.order.number),I(6),Ne(" ",(o=u.journalEntryInfo())==null||o.order==null?null:o.order.outletName," "),I(),T("ngIf",(n=u.journalEntryInfo())==null||n.order==null?null:n.order.fileAttachment),I(6),Ne(" ",(a=u.journalEntryInfo())==null||a.order==null?null:a.order.contactName," "),I(6),Oe((s=u.journalEntryInfo())==null||s.order==null?null:s.order.note),I(4),T("value",(l=u.journalEntryInfo())==null?null:l.items)}}var Wf=(()=>{class i{constructor(){this.journalEntryService=he(xt),this.route=he(Sr),this.router=he(zi),this.journalEntryInfo=Ze(null),this.totalDebitAmount=Mt(()=>this.journalEntryInfo()?.items?.reduce((r,o)=>r+o.debitAmount,0)||0),this.totalCreditAmount=Mt(()=>this.journalEntryInfo()?.items?.reduce((r,o)=>r+o.creditAmount,0)||0)}ngOnInit(){this.route.paramMap.pipe(Ta(e=>e.has("id")),pi(e=>e.get("id")),Yr(e=>this.journalEntryService.getJournalEntryInfo(e)),We(e=>this.journalEntryInfo.set(e)),at("response")).subscribe()}onDeleteJournal(){if(!confirm("Are you sure you want to delete this journal entry?"))return;let e=this.route.snapshot.paramMap.get("id");e&&this.journalEntryService.deleteJournalEntry([e]).pipe(We(()=>{this.router.navigate(["/journal/journal-entry"])})).subscribe()}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=mt({type:i,selectors:[["app-journal-entry-info"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["footer",""],["noFile",""],[3,"pageTitle","hasMainWrapperPadding"],[1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],[1,"row","row-gap-4"],[1,"col-12"],["header","Details"],[1,"row"],[1,"col"],[1,"col-2"],["class","row",4,"ngIf"],[3,"value"],[4,"ngIf","ngIfElse"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-muted"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"link","link-primary",3,"routerLink","queryParams"],["class","text-warning",4,"ngIf"],[1,"text-end"],[1,"text-warning"],["colspan","2",1,"text-end"]],template:function(r,o){if(r&1&&(y(0,"app-main-panel",6),le(1,zw,4,2,"ng-template",null,0,_e)(3,Ww,46,10,"ng-template",null,1,_e),f()),r&2){let n;T("pageTitle","Journal #"+((n=o.journalEntryInfo())==null||n.order==null?null:n.order.number))("hasMainWrapperPadding",!0)}},dependencies:[ci,Wt,di,Oi,Ma,$i,zu,qi,Wi,Li,Ni,Hi,ui],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return i})();var qf=i=>{let t=he(xt),e=he(Wo);return e.show(),console.log("journalEntryResolver",i),t.getJournalRecordExpenseLoader().pipe(at("response"),We(()=>e.hide()))};var kd=je(Ga());var Jf=je(Xs());var qw=()=>({width:"25rem"}),Jw=()=>[".."],Gw=()=>({height:"calc(100vh - 140px)"}),Pd=i=>({"ng-invalid ng-dirty":i}),Xw=()=>({});function Yw(i,t){if(i&1){let e=Re();y(0,"div",10)(1,"a",11),D(2,"Cancel"),f(),y(3,"p-button",12),De("onClick",function(){ge(e);let o=W();return ye(o.onSubmitJournalEntry())}),f()()}i&2&&(I(),T("routerLink",qe(1,Jw)))}function Kw(i,t){if(i&1&&(y(0,"div",39)(1,"div",40),D(2),f()()),i&2){let e=t.$implicit;I(2),Ne(" ",e.name," ")}}function Qw(i,t){if(i&1&&(y(0,"div",25),Z(1,"p-radiobutton",41),y(2,"label",42),D(3),f()()),i&2){let e=t.$implicit;I(),T("value",e.key),I(2),Oe(e.value)}}function Zw(i,t){if(i&1&&(y(0,"div",10)(1,"div",43)(2,"span",44),D(3),f()(),y(4,"div")(5,"span"),D(6,"-"),f()(),y(7,"span",45),D(8),f()()),i&2){let e=t.$implicit;I(3),Ne("(",e.code,")"),I(5),Oe(e.name)}}function e_(i,t){if(i&1&&(y(0,"div",10)(1,"div",43)(2,"span",44),D(3),f()(),y(4,"div")(5,"span"),D(6,"-"),f()(),y(7,"div",43)(8,"span",46),D(9),f()()()),i&2){let e=t.$implicit;I(3),Ne("(",e.code,")"),I(6),Oe(e.name)}}function t_(i,t){i&1&&(y(0,"tr")(1,"th",47),D(2,"Account"),f(),y(3,"th",47),D(4,"Note"),f(),y(5,"th",48),D(6," Amount "),f(),Z(7,"th",49),f())}function i_(i,t){if(i&1&&(y(0,"div",10)(1,"div",43)(2,"span",44),D(3),f()(),y(4,"div")(5,"span"),D(6,"-"),f()(),y(7,"div",43)(8,"span",56),D(9),f()()()),i&2){let e=t.$implicit;I(3),Ne("(",e.code,")"),I(6),Oe(e.name)}}function r_(i,t){if(i&1&&(y(0,"div",10)(1,"div",43)(2,"span",44),D(3),f()(),y(4,"div")(5,"span"),D(6,"-"),f()(),y(7,"div",43)(8,"span",56),D(9),f()()()),i&2){let e=t.$implicit;I(3),Ne("(",e.code,")"),I(6),Oe(e.name)}}function o_(i,t){if(i&1){let e=Re();y(0,"tr",50)(1,"td")(2,"p-select",51),le(3,i_,10,2,"ng-template",null,4,_e)(5,r_,10,2,"ng-template",null,3,_e),f()(),y(7,"td"),Z(8,"textarea",52),f(),y(9,"td"),Z(10,"input",53),f(),y(11,"td")(12,"div",54)(13,"p-button",55),De("onClick",function(){let o=ge(e).rowIndex,n=W(3);return ye(n.removeItems(o))}),f()()()()}if(i&2){let e,r=t.rowIndex,o=W(3);T("formGroupName",r),I(2),T("options",o.JournalExpenseRecord().options.accounts)("showClear",(o.form.controls==null||o.form.controls.items==null||o.form.controls.items.controls[r]==null||(e=o.form.controls.items.controls[r].get("accountID"))==null?null:e.value)!==o.guidEmpty),I(8),T("autoNumeric",qe(5,Xw)),I(3),T("text",!0)}}function n_(i,t){if(i&1){let e=Re();y(0,"tr")(1,"td")(2,"div",57)(3,"div",10)(4,"p-button",58),De("onClick",function(){ge(e);let o=W(3);return ye(o.addItems())}),f()(),y(5,"span",59),D(6,"Total"),f()()(),y(7,"td",60),D(8),ut(9,"number"),f(),Z(10,"td",61),f()}if(i&2){let e=W(3);I(8),Ne(" ",wt(9,1,e.subTotalDebit())," ")}}function a_(i,t){if(i&1){let e=Re();y(0,"div",14)(1,"p-panel")(2,"p-scroll-panel")(3,"div",15)(4,"div",16)(5,"div",17)(6,"div",18)(7,"div",15)(8,"div",19)(9,"label",20),D(10,"Date"),f()(),Z(11,"p-datepicker",21),f()(),y(12,"div",18)(13,"div",15)(14,"div",19)(15,"label",20),D(16,"Outlet"),f()(),y(17,"p-select",22),le(18,Kw,3,1,"ng-template",null,3,_e),f()()(),y(20,"div",18)(21,"div",15)(22,"div",19)(23,"label",20),D(24,"Number"),f()(),Z(25,"input",23),f()(),y(26,"div",18)(27,"div",15)(28,"div",19)(29,"label",20),D(30,"Contact"),f()(),y(31,"div",24),Ai(32,Qw,4,2,"div",25,Bi),f()()(),y(34,"div",26)(35,"div",15)(36,"div",19)(37,"label",27),D(38),f()(),y(39,"p-autocomplete",28),De("completeMethod",function(o){ge(e);let n=W(2);return ye(n.searchCustomer(o))}),f()()(),y(40,"div",29)(41,"div",15)(42,"div",19)(43,"label",27),D(44,"Payments"),f()(),y(45,"p-select",30),le(46,Zw,9,2,"ng-template",null,4,_e)(48,e_,10,2,"ng-template",null,3,_e),f()()()()(),y(50,"div",31)(51,"div",17)(52,"div",29)(53,"div",15)(54,"div",32)(55,"label",27),D(56,"Upload"),f()(),y(57,"div",33)(58,"POS-uppy",34),De("fileUploaded",function(o){ge(e);let n=W(2);return ye(n.onUpload(o))}),f()()()(),y(59,"div",18)(60,"div",15)(61,"div",32)(62,"label",27),D(63,"Note"),f()(),y(64,"div",33),Z(65,"textarea",35),f()()()()()(),Z(66,"hr"),y(67,"div",36)(68,"div",37)(69,"p-table",38),le(70,t_,8,0,"ng-template",null,5,_e)(72,o_,14,6,"ng-template",null,6,_e)(74,n_,11,3,"ng-template",null,2,_e),f()()()()()()}if(i&2){let e=W(2);T("formGroup",e.form),I(2),Ot(qe(17,Gw)),I(9),T("showIcon",!0)("ngClass",Bt(18,Pd,e.form.controls.order.controls.date.invalid&&(e.form.controls.order.controls.date.dirty||e.form.controls.order.controls.date.touched))),I(6),T("options",e.outlets()),I(8),T("ngClass",Bt(20,Pd,e.form.controls.order.controls.number.invalid&&(e.form.controls.order.controls.number.dirty||e.form.controls.order.controls.number.touched))),I(7),Ri(e.contactType()),I(6),Oe(+e.form.controls.order.controls.contactType.value==0?"Customer":"Supplier"),I(),T("suggestions",e.customerSuggestions())("placeholder",+e.form.controls.order.controls.contactType.value==0?"Search Customer":"Search Supplier"),I(6),T("options",e.JournalExpenseRecord().options.paymentAccounts),I(13),T("uppyCoreConfiguration",e.uppyCore)("dashboardPropsConfiguration",e.uppyDashboard),I(7),T("autoResize",!0)("ngClass",Bt(22,Pd,e.form.controls.order.controls.note.invalid&&(e.form.controls.order.controls.note.dirty||e.form.controls.order.controls.note.touched))),I(4),T("scrollable",!0)("value",e.form.controls.items.controls)}}function s_(i,t){if(i&1&&le(0,a_,76,24,"div",13),i&2){let e=W();T("ngIf",e.JournalExpenseRecord())}}function l_(i,t){if(i&1){let e=Re();y(0,"p-button",62),De("click",function(){ge(e);let o=W();return ye(o.uploadDialogVisible.set(!1))}),f(),y(1,"p-button",63),De("click",function(){ge(e);let o=W();return ye(o.uploadDialogVisible.set(!1))}),f()}i&2&&T("text",!0)}var Gf=(()=>{class i{constructor(){this.fileAttachment=Ze(new File([],"")),this.activatedRoute=he(Sr),this.virtualScrollOptions={scrollHeight:"240px",itemSize:40,autoSize:!0},this.journalEntryService=he(xt),this.JournalExpenseRecord=Ze(null),this.customerSuggestions=Ze([]),this.itemsForm=Ze([]),this.subTotalDebit=Mt(()=>this.itemsForm().reduce((e,r)=>e+ +r.debitAmount,0)),this.subTotalCredit=Mt(()=>this.itemsForm().reduce((e,r)=>e+ +r.creditAmount,0)),this.contactType=Ze([{key:0,value:"Customer"},{key:1,value:"Supplier"}]),this.dialogService=he(hn),this.uploadDialogVisible=Ze(!1),this.router=he(zi),this.guidEmpty=et.toString(),this.uppyCore={restrictions:{allowedFileTypes:["image/*","application/pdf"]}},this.uppyDashboard={inline:!0,width:350,height:200},this.outlets=Mt(()=>this.JournalExpenseRecord()?.options?.entities||[]),this.toasr=he(Dr),this.initializeFormEffect()}toggleDialog(){this.dialogService.open(Zs,{header:"Create Customer/Supplier",width:"40vw",footer:"submit",closable:!0,dismissableMask:!0,modal:!0,showHeader:!0})}ngOnInit(){this.initializeForm(),this.loadJournalExpenseRecord()}onToggleUploadDialog(){this.uploadDialogVisible.update(e=>!e)}onUploadDialog(e){console.log(e),Jf.default.parse(e.currentFiles[0],{complete:r=>{console.log("Parsed result:",r)},error:r=>{console.error("Parsing error:",r)}})}initializeForm(){this.form=new Ui({order:new Ui({id:new ee("",[At.required]),number:new ee("",[At.required]),date:new ee({value:new Date,disabled:!0},[At.required]),note:new ee(""),entryTypeID:new ee(1,[At.required]),referenceID:new ee(""),referenceTypeID:new ee(0,[At.required]),referenceText:new ee(""),contactID:new ee(""),detailReferenceID:new ee(""),creatorID:new ee("",[At.required]),created:new ee("",[At.required]),modifierID:new ee(""),modified:new ee(""),outletID:new ee(""),statusID:new ee(0),contactName:new ee(""),contactType:new ee(0),fileAttachment:new ee(null)}),items:new La([]),additionalAccountID:new ee(""),file:new ee(null),customerName:new ee("")})}initializeFormEffect(){ir(()=>{let e=this.JournalExpenseRecord();e&&(this.form.patchValue({order:U(_({},e.form.order),{entryTypeID:Number(e.form.order.entryTypeID===0&&1),referenceID:String(e.form.order.referenceID||et),contactID:String(e.form.order.contactID||""),detailReferenceID:String(e.form.order.detailReferenceID||et),contactName:String(e.form.order.contactName),date:kd.default.isDayjs(e.form.order.date)?e.form.order.date.toDate():(0,kd.default)().toDate(),modifierID:String(e.form.order.modifierID||et),statusID:+e.form.order.statusID,modified:String(e.form.order.modified),outletID:String(e.form.order.outletID||et),fileAttachment:e.form.order.fileAttachment}),additionalAccountID:e.form.additionalAccountID}),this.updateFormItems(e.form.items),this.form.controls.items.touched||this.itemsForm.set(this.form.controls.items.value),this.form.controls.items.valueChanges.subscribe(r=>{this.itemsForm.set(r)}))})}updateFormItems(e){let r=this.form.controls.items;r.clear(),e.forEach(o=>{r.push(new Ui({id:new ee(o.id),journalID:new ee(o.journalID),accountID:new ee(o.accountID),debitAmount:new ee(o.debitAmount),creditAmount:new ee(o.creditAmount),index:new ee(o.index),note:new ee(o.note)}))})}loadJournalExpenseRecord(){this.activatedRoute.data.pipe(pi(e=>e.form),We(e=>this.JournalExpenseRecord.set(e))).subscribe()}searchCustomer(e){switch(+this.form.controls.order.value.contactType){case 0:this.journalEntryService.getJournalEntryCustomerSuggestions(e.query).pipe(We(r=>this.customerSuggestions.set(r))).subscribe();break;case 1:this.journalEntryService.getJournalEntrySupplierSuggestions(e.query).pipe(We(r=>this.customerSuggestions.set(r))).subscribe();break;default:console.error("Invalid contact type");break}}addItems(){this.form.controls.items.push(new Ui({id:new ee(et.toString()),journalID:new ee(et.toString()),accountID:new ee(et.toString()),debitAmount:new ee(0),creditAmount:new ee(0),index:new ee(this.form.controls.items.length??0),note:new ee("")}))}onSubmitJournalEntry(){if(console.log(this.form.value),this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let e=this.getCleanedFormValue();console.log("cleanedFormValue",e);let r=this.buildFormData(e);this.journalEntryService.submitJournalEntry(r).pipe(at("response"),We(()=>{this.form.controls.order.controls.date.disable(),this.router.navigate(["/journal/journal-entry"])}),wr(o=>vr(()=>o)),at("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let e=this.form.getRawValue(),r=Object.entries(e).reduce((o,[n,a])=>(n==="items"?o[n]=a.map(s=>U(_({},s),{debitAmount:+s.debitAmount,creditAmount:+s.creditAmount})):n==="order"?o[n]=U(_({},a),{contactID:a.contactID||et}):o[n]=a,o),{});return JSON.parse(JSON.stringify(r,(o,n)=>n==="null"?null:n))}buildFormData(e){let r=new FormData;return r.append("Data",JSON.stringify(e)),r.append("File",this.fileAttachment()),r}onUpload(e){console.log(e),e instanceof File&&this.fileAttachment.set(e)}removeItems(e){this.form.controls.items.removeAt(e)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=mt({type:i,selectors:[["app-journal-receive-money"]],features:[Cr([hn,Ha])],decls:10,vars:6,consts:[["actionButton",""],["content",""],["footer",""],["item",""],["selectedItem",""],["header",""],["body",""],["pageTitle",`Receive Money
|
|
33
|
-
`,3,"hasMainWrapperPadding"],["header","Upload",3,"modal","visible"],["mode","basic","chooseLabel","Choose","chooseIcon","pi pi-upload",3,"onSelect"],[1,"d-flex","gap-2"],[1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["class","d-flex flex-column row-gap-4",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-4",3,"formGroup"],[1,"row"],[1,"col-6"],[1,"row","row-gap-4"],["formGroupName","order",1,"col-12","col-lg-12"],[1,"col-3","d-flex","align-items-center"],["for","outlet",1,"m-0","fs-3","fw-normal"],["styleClass","w-100","dataType","string","dateFormat","mm-dd-yy","size","small","formControlName","date",1,"col-6","p-0",3,"showIcon","ngClass"],["showClear","","filter","","filterBy","code,name","size","small","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",1,"col-6","placeholder-spacing",3,"options"],["pSize","small","type","text","pInputText","","formControlName","number","placeholder","Enter Number",1,"col-6",3,"ngClass"],[1,"col-6","d-flex","gap-3","p-0"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","order",1,"col-12"],["for","",1,"m-0","fs-3","fw-normal"],["size","small","styleClass","w-100 ","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",1,"col-6","p-0",3,"completeMethod","suggestions","placeholder"],[1,"col-12","col-lg-12"],["filter","","filterBy","code,name","size","small","formControlName","additionalAccountID","optionLabel","name","optionValue","id","placeholder","Select Payment",1,"col-6","placeholder-spacing",3,"options"],[1,"col"],[1,"col-3","d-flex"],[1,"col-9","pl-0"],[3,"fileUploaded","uppyCoreConfiguration","dashboardPropsConfiguration"],["rows","4","cols","30","pTextarea","","formControlName","note","placeholder","Enter Note",1,"w-100",3,"autoResize","ngClass"],["formArrayName","items",1,"row"],[1,"col","mb-5"],[3,"scrollable","value"],[1,"flex","items-center","gap-2",2,"height","38x"],[1,"d-inline-block","text-truncate",2,"max-width","300px"],["formControlName","contactType","name","contactType","inputId","ingredient1",3,"value"],["for","ingredient1",1,"mb-0","d-flex","align-items-center","radiobutton-label"],[1,""],[1,"h-full","align-middle"],[1,"d-inline-block","text-truncate",2,"max-width","150px"],[1,"d-inline-block","text-truncate",2,"max-width","200px"],[2,"width","30%","min-width","120px"],[1,"text-end",2,"width","15%","min-width","80px"],[2,"width","5%","min-width","30px"],[3,"formGroupName"],["appendTo","body","size","small","formControlName","accountID","filter","","filterBy","code,name","optionLabel","name","optionValue","id","placeholder","Select an account","styleClass","w-100",3,"options","showClear"],["pSize","small","rows","1","cols","30","pTextarea","","formControlName","note",1,"w-100"],["pSize","small","formControlName","debitAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],[1,"d-flex","justify-content-center","align-items-center"],["size","small","icon","fa-solid fa-xmark","aria-label","Save","severity","danger",3,"onClick","text"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"d-flex","justify-content-between","align-items-center"],["icon","fa-light fa-plus","size","small","label","Add",3,"onClick"],[2,"vertical-align","middle"],[1,"text-end","footer-total"],["colspan","2"],["label","Cancel","severity","secondary",3,"click","text"],["label","OK(F2)","severity","primary",3,"click"]],template:function(r,o){if(r&1){let n=Re();y(0,"app-main-panel",7),le(1,Yw,4,2,"ng-template",null,0,_e)(3,s_,1,1,"ng-template",null,1,_e),f(),y(5,"p-dialog",8)(6,"p-fileupload",9),De("onSelect",function(s){return ge(n),ye(o.onUploadDialog(s))}),f(),le(7,l_,2,1,"ng-template",null,2,_e),f(),Z(9,"p-toast")}r&2&&(T("hasMainWrapperPadding",!0),I(5),Ot(qe(5,qw)),T("modal",!0)("visible",o.uploadDialogVisible()))},dependencies:[Tr,Ir,Er,Pr,kr,Fr,Fo,To,ci,Wt,ko,di,Oi,zr,Mr,Li,Ni,Or,Rr,Vi,ji,$o,Ho,Uo,Lo,qi,Wi,Hi,ui,$i,Wa,qa,Ji,Nr,Ks,jo,Ja,No,zo,Vo,Xa,Ar,Br,Oo,Ro,cn],styles:[".footer-total[_ngcontent-%COMP%]{margin-right:10px;padding-right:26px}.radiobutton-label[_ngcontent-%COMP%]{font-weight:300}.placeholder-spacing[_ngcontent-%COMP%] .p-select-label{padding-left:0!important}"],changeDetection:0})}}return i})();var Xf=()=>{let i=he(xt),t=he(Wo);return t.show(),i.getJournalReceiveMoney().pipe(at("response"),We(()=>t.hide()))};var CT=[{path:"",redirectTo:"journal-entry",pathMatch:"full"},{path:"journal-entry",children:[{path:"",component:Gu},{path:"add",component:Id,resolve:{form:Ed}},{path:"import",loadComponent:()=>import("./chunk-DMVAXVYQ.js").then(i=>i.JournalEntryImportComponent)},{path:":id",component:Wf},{path:":id/edit",component:Id,resolve:{form:Ed}}]},{path:"record-expense",component:zf,resolve:{form:qf}},{path:"receive-money",component:Gf,resolve:{form:Xf}},{path:"journal-deposit",component:Nf}];export{CT as JOURNAL_ROUTES};
|