dealposbarcode 1.7.4 → 1.7.6

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.
@@ -1,78 +1,74 @@
1
- import{A as As,B as Gp,C as Xp,D as kl,E as Yp,F as Kp,a as vs,c as Os,d as zr,e as xl,f as Np,g as zp,h as Ii,i as Lp,j as Lr,k as Cl,l as Sl,m as We,n as Hp,o as Fs,p as ke,q as Rs,r as jp,s as Vp,t as El,u as Ms,v as Up,w as Dl,x as Wp,y as $p,z as qp}from"./chunk-RGY57L3A.js";import{a as Bs,b as _i,c as ri}from"./chunk-4POMLYZ7.js";import{$ as Bp,B as nt,C as kt,D as xs,E as Cs,F as Ss,G as Yi,H as ht,I as rt,J as Je,K as ft,L as Gn,M as Ps,N as Es,O as Ds,P as ks,Q as Ts,R as Is,T as Ip,U as Op,V as Fp,W as Rp,X as Mp,Y as Xn,Z as Ap,a as vi,aa as bi,b as Sp,c as Pp,fa as Pl,k as ys,m as $n,p as _l,q as _s,t as Tp,u as qn,v as tt,w as ct,y as it,z as ws}from"./chunk-HL7GBNBU.js";import{$b as Br,Aa as Rr,Ac as Ae,Ad as Ep,Bb as Mr,Bd as bs,C as Le,Ca as pe,Cd as Dp,D as lp,Da as N,Db as gp,Ec as Ue,Ed as Nr,Fb as ls,Fc as ii,Fd as kp,Gb as cs,Gc as Ti,H as fi,Ha as fe,Hc as vl,Hd as wl,I as mi,Ia as zt,Ic as me,J as os,Ja as ln,Jb as q,Ka as ss,Kb as fl,Mb as Ar,N as cp,O as sl,Oa as hp,P as sn,Pb as ue,Pc as vp,Qb as yp,Ra as gi,Rb as ds,S as an,Sa as se,Sb as Lt,Sc as cn,Ta as ae,Tb as E,U as Kt,Uc as Gi,Vb as jn,Wa as Ge,Wb as us,Xa as Xe,Xc as bp,Y as al,Yc as bl,Z as Fr,Za as lt,Zb as Ce,_a as Et,_b as ps,a as v,aa as dp,ab as hl,ac as Qt,b as D,bb as Dt,bc as Zt,c as Ln,ca as ll,cc as f,cd as gt,d as j,dc as m,e as De,ea as up,ec as le,fa as cl,fc as ml,g as B,gc as gl,h as Hn,hb as fp,hd as ms,i as is,ic as Ie,j as ns,jd as Xi,k as rs,l as $i,lc as U,ld as Wn,mc as O,md as _p,n as Pt,nc as Vn,oa as dl,oc as Un,od as wp,pd as xp,q as et,qa as ul,qc as hs,qd as gs,ra as qi,rc as yi,rd as Cp,sa as pl,sc as Jt,sd as ni,ta as xe,tc as ei,ub as as,uc as yl,vc as x,wa as pp,wb as mp,wc as I,xa as Ve,xc as ti,ya as Nt,yb as y,yc as fs,zb as He,zc as ye}from"./chunk-UZEILQYY.js";var Ht=j(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});function Hy(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var jy=function i(e,t){Hy(this,i),this.data=e,this.text=t.text||e,this.options=t};Tl.default=jy});var Jp=j(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.CODE39=void 0;var Vy=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Uy=Ht(),Wy=$y(Uy);function $y(i){return i&&i.__esModule?i:{default:i}}function qy(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Gy(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Xy(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Yy=function(i){Xy(e,i);function e(t,n){return qy(this,e),t=t.toUpperCase(),n.mod43&&(t+=Zy(Jy(t))),Gy(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Vy(e,[{key:"encode",value:function(){for(var n=Il("*"),r=0;r<this.data.length;r++)n+=Il(this.data[r])+"0";return n+=Il("*"),{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(Wy.default),Qp=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],Ky=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function Il(i){return Qy(Zp(i))}function Qy(i){return Ky[i].toString(2)}function Zy(i){return Qp[i]}function Zp(i){return Qp.indexOf(i)}function Jy(i){for(var e=0,t=0;t<i.length;t++)e+=Zp(i[t]);return e=e%43,e}Ns.CODE39=Yy});var Yn=j($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});var Hr;function Ol(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var eh=$e.SET_A=0,th=$e.SET_B=1,ih=$e.SET_C=2,xk=$e.SHIFT=98,ev=$e.START_A=103,tv=$e.START_B=104,iv=$e.START_C=105,Ck=$e.MODULO=103,Sk=$e.STOP=106,Pk=$e.FNC1=207,Ek=$e.SET_BY_CODE=(Hr={},Ol(Hr,ev,eh),Ol(Hr,tv,th),Ol(Hr,iv,ih),Hr),Dk=$e.SWAP={101:eh,100:th,99:ih},kk=$e.A_START_CHAR="\xD0",Tk=$e.B_START_CHAR="\xD1",Ik=$e.C_START_CHAR="\xD2",Ok=$e.A_CHARS="[\0-_\xC8-\xCF]",Fk=$e.B_CHARS="[ -\x7F\xC8-\xCF]",Rk=$e.C_CHARS="(\xCF*[0-9]{2}\xCF*)",Mk=$e.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]});var jr=j(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});var nv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),rv=Ht(),ov=sv(rv),jt=Yn();function sv(i){return i&&i.__esModule?i:{default:i}}function av(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function lv(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function cv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var dv=function(i){cv(e,i);function e(t,n){av(this,e);var r=lv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.substring(1),n));return r.bytes=t.split("").map(function(o){return o.charCodeAt(0)}),r}return nv(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,r=n.shift()-105,o=jt.SET_BY_CODE[r];if(o===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&n.unshift(jt.FNC1);var s=e.next(n,1,o);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(r)+s.result+e.getBar((s.checksum+r)%jt.MODULO)+e.getBar(jt.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return typeof n=="string"&&(n=n.toLowerCase()==="true"),n}}],[{key:"getBar",value:function(n){return jt.BARS[n]?jt.BARS[n].toString():""}},{key:"correctIndex",value:function(n,r){if(r===jt.SET_A){var o=n.shift();return o<32?o+64:o-32}else return r===jt.SET_B?n.shift()-32:(n.shift()-48)*10+n.shift()-48}},{key:"next",value:function(n,r,o){if(!n.length)return{result:"",checksum:0};var s=void 0,a=void 0;if(n[0]>=200){a=n.shift()-105;var l=jt.SWAP[a];l!==void 0?s=e.next(n,r+1,l):((o===jt.SET_A||o===jt.SET_B)&&a===jt.SHIFT&&(n[0]=o===jt.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),s=e.next(n,r+1,o))}else a=e.correctIndex(n,o),s=e.next(n,r+1,o);var c=e.getBar(a),d=a*r;return{result:c+s.result,checksum:d+s.checksum}}}]),e}(ov.default);Fl.default=dv});var ah=j(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var Ki=Yn(),nh=function(e){return e.match(new RegExp("^"+Ki.A_CHARS+"*"))[0].length},rh=function(e){return e.match(new RegExp("^"+Ki.B_CHARS+"*"))[0].length},oh=function(e){return e.match(new RegExp("^"+Ki.C_CHARS+"*"))[0]};function Rl(i,e){var t=e?Ki.A_CHARS:Ki.B_CHARS,n=i.match(new RegExp("^("+t+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(n)return n[1]+"\xCC"+sh(i.substring(n[1].length));var r=i.match(new RegExp("^"+t+"+"))[0];return r.length===i.length?i:r+String.fromCharCode(e?205:206)+Rl(i.substring(r.length),!e)}function sh(i){var e=oh(i),t=e.length;if(t===i.length)return i;i=i.substring(t);var n=nh(i)>=rh(i);return e+String.fromCharCode(n?206:205)+Rl(i,n)}Ml.default=function(i){var e=void 0,t=oh(i).length;if(t>=2)e=Ki.C_START_CHAR+sh(i);else{var n=nh(i)>rh(i);e=(n?Ki.A_START_CHAR:Ki.B_START_CHAR)+Rl(i,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(r,o){return"\xCB"+o})}});var ch=j(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});var uv=jr(),pv=lh(uv),hv=ah(),fv=lh(hv);function lh(i){return i&&i.__esModule?i:{default:i}}function mv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Al(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function gv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var yv=function(i){gv(e,i);function e(t,n){if(mv(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var r=Al(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,fv.default)(t),n));else var r=Al(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return Al(r)}return e}(pv.default);Bl.default=yv});var uh=j(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});var vv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),bv=jr(),_v=wv(bv),dh=Yn();function wv(i){return i&&i.__esModule?i:{default:i}}function xv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Cv(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Sv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Pv=function(i){Sv(e,i);function e(t,n){return xv(this,e),Cv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,dh.A_START_CHAR+t,n))}return vv(e,[{key:"valid",value:function(){return new RegExp("^"+dh.A_CHARS+"+$").test(this.data)}}]),e}(_v.default);Nl.default=Pv});var hh=j(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});var Ev=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Dv=jr(),kv=Tv(Dv),ph=Yn();function Tv(i){return i&&i.__esModule?i:{default:i}}function Iv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Ov(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Fv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Rv=function(i){Fv(e,i);function e(t,n){return Iv(this,e),Ov(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,ph.B_START_CHAR+t,n))}return Ev(e,[{key:"valid",value:function(){return new RegExp("^"+ph.B_CHARS+"+$").test(this.data)}}]),e}(kv.default);zl.default=Rv});var mh=j(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var Mv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Av=jr(),Bv=Nv(Av),fh=Yn();function Nv(i){return i&&i.__esModule?i:{default:i}}function zv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Lv(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Hv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var jv=function(i){Hv(e,i);function e(t,n){return zv(this,e),Lv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,fh.C_START_CHAR+t,n))}return Mv(e,[{key:"valid",value:function(){return new RegExp("^"+fh.C_CHARS+"+$").test(this.data)}}]),e}(Bv.default);Ll.default=jv});var gh=j(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.CODE128C=wi.CODE128B=wi.CODE128A=wi.CODE128=void 0;var Vv=ch(),Uv=zs(Vv),Wv=uh(),$v=zs(Wv),qv=hh(),Gv=zs(qv),Xv=mh(),Yv=zs(Xv);function zs(i){return i&&i.__esModule?i:{default:i}}wi.CODE128=Uv.default;wi.CODE128A=$v.default;wi.CODE128B=Gv.default;wi.CODE128C=Yv.default});var Kn=j(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var Uk=Qi.SIDE_BIN="101",Wk=Qi.MIDDLE_BIN="01010",$k=Qi.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},qk=Qi.EAN2_STRUCTURE=["LL","LG","GL","GG"],Gk=Qi.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],Xk=Qi.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]});var Qn=j(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var Kv=Kn(),Qv=function(e,t,n){var r=e.split("").map(function(s,a){return Kv.BINARIES[t[a]]}).map(function(s,a){return s?s[e[a]]:""});if(n){var o=e.length-1;r=r.map(function(s,a){return a<o?s+n:s})}return r.join("")};Hl.default=Qv});var Vl=j(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});var Zv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Zn=Kn(),Jv=Qn(),yh=vh(Jv),eb=Ht(),tb=vh(eb);function vh(i){return i&&i.__esModule?i:{default:i}}function ib(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function nb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function rb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var ob=function(i){rb(e,i);function e(t,n){ib(this,e);var r=nb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.fontSize=!n.flat&&n.fontSize>n.width*10?n.width*10:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return Zv(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(n,r){return this.text.substr(n,r)}},{key:"leftEncode",value:function(n,r){return(0,yh.default)(n,r)}},{key:"rightText",value:function(n,r){return this.text.substr(n,r)}},{key:"rightEncode",value:function(n,r){return(0,yh.default)(n,r)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},r={height:this.guardHeight};return[{data:Zn.SIDE_BIN,options:r},{data:this.leftEncode(),text:this.leftText(),options:n},{data:Zn.MIDDLE_BIN,options:r},{data:this.rightEncode(),text:this.rightText(),options:n},{data:Zn.SIDE_BIN,options:r}]}},{key:"encodeFlat",value:function(){var n=[Zn.SIDE_BIN,this.leftEncode(),Zn.MIDDLE_BIN,this.rightEncode(),Zn.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),e}(tb.default);jl.default=ob});var _h=j(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});var sb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Vr=function i(e,t,n){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:i(o,t,n)}else{if("value"in r)return r.value;var s=r.get;return s===void 0?void 0:s.call(n)}},ab=Kn(),lb=Vl(),cb=db(lb);function db(i){return i&&i.__esModule?i:{default:i}}function ub(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function pb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function hb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var bh=function(e){var t=e.substr(0,12).split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r*3:n+r},0);return(10-t%10)%10},fb=function(i){hb(e,i);function e(t,n){ub(this,e),t.search(/^[0-9]{12}$/)!==-1&&(t+=bh(t));var r=pb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.lastChar=n.lastChar,r}return sb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===bh(this.data)}},{key:"leftText",value:function(){return Vr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var n=this.data.substr(1,6),r=ab.EAN13_STRUCTURE[this.data[0]];return Vr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,r)}},{key:"rightText",value:function(){return Vr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var n=this.data.substr(7,6);return Vr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRRRR")}},{key:"encodeGuarded",value:function(){var n=Vr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(n.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(n.push({data:"00"}),n.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),n}}]),e}(cb.default);Ul.default=fb});var xh=j(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var mb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Ls=function i(e,t,n){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:i(o,t,n)}else{if("value"in r)return r.value;var s=r.get;return s===void 0?void 0:s.call(n)}},gb=Vl(),yb=vb(gb);function vb(i){return i&&i.__esModule?i:{default:i}}function bb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _b(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function wb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var wh=function(e){var t=e.substr(0,7).split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r:n+r*3},0);return(10-t%10)%10},xb=function(i){wb(e,i);function e(t,n){return bb(this,e),t.search(/^[0-9]{7}$/)!==-1&&(t+=wh(t)),_b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return mb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===wh(this.data)}},{key:"leftText",value:function(){return Ls(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var n=this.data.substr(0,4);return Ls(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,"LLLL")}},{key:"rightText",value:function(){return Ls(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var n=this.data.substr(4,4);return Ls(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRR")}}]),e}(yb.default);Wl.default=xb});var Sh=j($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});var Cb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Sb=Kn(),Pb=Qn(),Eb=Ch(Pb),Db=Ht(),kb=Ch(Db);function Ch(i){return i&&i.__esModule?i:{default:i}}function Tb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Ib(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Ob(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Fb=function(e){var t=e.split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r*9:n+r*3},0);return t%10},Rb=function(i){Ob(e,i);function e(t,n){return Tb(this,e),Ib(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Cb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var n=Sb.EAN5_STRUCTURE[Fb(this.data)];return{data:"1011"+(0,Eb.default)(this.data,n,"01"),text:this.text}}}]),e}(kb.default);$l.default=Rb});var Eh=j(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});var Mb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Ab=Kn(),Bb=Qn(),Nb=Ph(Bb),zb=Ht(),Lb=Ph(zb);function Ph(i){return i&&i.__esModule?i:{default:i}}function Hb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function jb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Vb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Ub=function(i){Vb(e,i);function e(t,n){return Hb(this,e),jb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Mb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var n=Ab.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Nb.default)(this.data,n,"01"),text:this.text}}}]),e}(Lb.default);ql.default=Ub});var Xl=j(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});var Wb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();Hs.checksum=Gl;var $b=Qn(),Jn=Dh($b),qb=Ht(),Gb=Dh(qb);function Dh(i){return i&&i.__esModule?i:{default:i}}function Xb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Yb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Kb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Qb=function(i){Kb(e,i);function e(t,n){Xb(this,e),t.search(/^[0-9]{11}$/)!==-1&&(t+=Gl(t));var r=Yb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.displayValue=n.displayValue,n.fontSize>n.width*10?r.fontSize=n.width*10:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return Wb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==Gl(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=(0,Jn.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,Jn.default)(this.data.substr(6,6),"RRRRRR"),n+="101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101"+(0,Jn.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,Jn.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),n.push({data:"01010",options:{height:this.guardHeight}}),n.push({data:(0,Jn.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,Jn.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),n}}]),e}(Gb.default);function Gl(i){var e=0,t;for(t=1;t<11;t+=2)e+=parseInt(i[t]);for(t=0;t<11;t+=2)e+=parseInt(i[t])*3;return(10-e%10)%10}Hs.default=Qb});var Ih=j(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});var Zb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Jb=Qn(),e1=Th(Jb),t1=Ht(),i1=Th(t1),n1=Xl();function Th(i){return i&&i.__esModule?i:{default:i}}function r1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Yl(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function o1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var s1=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],a1=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],l1=function(i){o1(e,i);function e(t,n){r1(this,e);var r=Yl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if(r.isValid=!1,t.search(/^[0-9]{6}$/)!==-1)r.middleDigits=t,r.upcA=kh(t,"0"),r.text=n.text||""+r.upcA[0]+t+r.upcA[r.upcA.length-1],r.isValid=!0;else if(t.search(/^[01][0-9]{7}$/)!==-1)if(r.middleDigits=t.substring(1,t.length-1),r.upcA=kh(r.middleDigits,t[0]),r.upcA[r.upcA.length-1]===t[t.length-1])r.isValid=!0;else return Yl(r);else return Yl(r);return r.displayValue=n.displayValue,n.fontSize>n.width*10?r.fontSize=n.width*10:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return Zb(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=this.encodeMiddleDigits(),n+="010101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101",options:{height:this.guardHeight}}),n.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),n.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),n}},{key:"encodeMiddleDigits",value:function(){var n=this.upcA[0],r=this.upcA[this.upcA.length-1],o=a1[parseInt(r)][parseInt(n)];return(0,e1.default)(this.middleDigits,o)}}]),e}(i1.default);function kh(i,e){for(var t=parseInt(i[i.length-1]),n=s1[t],r="",o=0,s=0;s<n.length;s++){var a=n[s];a==="X"?r+=i[o++]:r+=a}return r=""+e+r,""+r+(0,n1.checksum)(r)}Kl.default=l1});var Oh=j(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.UPCE=Tt.UPC=Tt.EAN2=Tt.EAN5=Tt.EAN8=Tt.EAN13=void 0;var c1=_h(),d1=er(c1),u1=xh(),p1=er(u1),h1=Sh(),f1=er(h1),m1=Eh(),g1=er(m1),y1=Xl(),v1=er(y1),b1=Ih(),_1=er(b1);function er(i){return i&&i.__esModule?i:{default:i}}Tt.EAN13=d1.default;Tt.EAN8=p1.default;Tt.EAN5=f1.default;Tt.EAN2=g1.default;Tt.UPC=v1.default;Tt.UPCE=_1.default});var Fh=j(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});var oT=Ur.START_BIN="1010",sT=Ur.END_BIN="11101",aT=Ur.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]});var Zl=j(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});var w1=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),js=Fh(),x1=Ht(),C1=S1(x1);function S1(i){return i&&i.__esModule?i:{default:i}}function P1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function E1(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function D1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var k1=function(i){D1(e,i);function e(){return P1(this,e),E1(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return w1(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var n=this,r=this.data.match(/.{2}/g).map(function(o){return n.encodePair(o)}).join("");return{data:js.START_BIN+r+js.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var r=js.BINARIES[n[1]];return js.BINARIES[n[0]].split("").map(function(o,s){return(o==="1"?"111":"1")+(r[s]==="1"?"000":"0")}).join("")}}]),e}(C1.default);Ql.default=k1});var Mh=j(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var T1=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),I1=Zl(),O1=F1(I1);function F1(i){return i&&i.__esModule?i:{default:i}}function R1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function M1(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function A1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Rh=function(e){var t=e.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,r,o){return n+r*(3-o%2*2)},0);return Math.ceil(t/10)*10-t},B1=function(i){A1(e,i);function e(t,n){return R1(this,e),t.search(/^[0-9]{13}$/)!==-1&&(t+=Rh(t)),M1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return T1(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===Rh(this.data)}}]),e}(O1.default);Jl.default=B1});var Bh=j(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.ITF14=tr.ITF=void 0;var N1=Zl(),z1=Ah(N1),L1=Mh(),H1=Ah(L1);function Ah(i){return i&&i.__esModule?i:{default:i}}tr.ITF=z1.default;tr.ITF14=H1.default});var ir=j(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var j1=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),V1=Ht(),U1=W1(V1);function W1(i){return i&&i.__esModule?i:{default:i}}function $1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function q1(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function G1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var X1=function(i){G1(e,i);function e(t,n){return $1(this,e),q1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return j1(e,[{key:"encode",value:function(){for(var n="110",r=0;r<this.data.length;r++){var o=parseInt(this.data[r]),s=o.toString(2);s=Y1(s,4-s.length);for(var a=0;a<s.length;a++)n+=s[a]=="0"?"100":"110"}return n+="1001",{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(U1.default);function Y1(i,e){for(var t=0;t<e;t++)i="0"+i;return i}ec.default=X1});var Wr=j(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.mod10=K1;Vs.mod11=Q1;function K1(i){for(var e=0,t=0;t<i.length;t++){var n=parseInt(i[t]);(t+i.length)%2===0?e+=n:e+=n*2%10+Math.floor(n*2/10)}return(10-e%10)%10}function Q1(i){for(var e=0,t=[2,3,4,5,6,7],n=0;n<i.length;n++){var r=parseInt(i[i.length-1-n]);e+=t[n%t.length]*r}return(11-e%11)%11}});var Nh=j(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});var Z1=ir(),J1=t_(Z1),e_=Wr();function t_(i){return i&&i.__esModule?i:{default:i}}function i_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function n_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function r_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var o_=function(i){r_(e,i);function e(t,n){return i_(this,e),n_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,e_.mod10)(t),n))}return e}(J1.default);tc.default=o_});var zh=j(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});var s_=ir(),a_=c_(s_),l_=Wr();function c_(i){return i&&i.__esModule?i:{default:i}}function d_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function u_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function p_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var h_=function(i){p_(e,i);function e(t,n){return d_(this,e),u_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,l_.mod11)(t),n))}return e}(a_.default);ic.default=h_});var Hh=j(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});var f_=ir(),m_=g_(f_),Lh=Wr();function g_(i){return i&&i.__esModule?i:{default:i}}function y_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function v_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function b_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var __=function(i){b_(e,i);function e(t,n){return y_(this,e),t+=(0,Lh.mod10)(t),t+=(0,Lh.mod10)(t),v_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e}(m_.default);nc.default=__});var Vh=j(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var w_=ir(),x_=C_(w_),jh=Wr();function C_(i){return i&&i.__esModule?i:{default:i}}function S_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function P_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function E_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var D_=function(i){E_(e,i);function e(t,n){return S_(this,e),t+=(0,jh.mod11)(t),t+=(0,jh.mod10)(t),P_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e}(x_.default);rc.default=D_});var Uh=j(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.MSI1110=oi.MSI1010=oi.MSI11=oi.MSI10=oi.MSI=void 0;var k_=ir(),T_=$r(k_),I_=Nh(),O_=$r(I_),F_=zh(),R_=$r(F_),M_=Hh(),A_=$r(M_),B_=Vh(),N_=$r(B_);function $r(i){return i&&i.__esModule?i:{default:i}}oi.MSI=T_.default;oi.MSI10=O_.default;oi.MSI11=R_.default;oi.MSI1010=A_.default;oi.MSI1110=N_.default});var Wh=j(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.pharmacode=void 0;var z_=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),L_=Ht(),H_=j_(L_);function j_(i){return i&&i.__esModule?i:{default:i}}function V_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function U_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function W_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var $_=function(i){W_(e,i);function e(t,n){V_(this,e);var r=U_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.number=parseInt(t,10),r}return z_(e,[{key:"encode",value:function(){for(var n=this.number,r="";!isNaN(n)&&n!=0;)n%2===0?(r="11100"+r,n=(n-2)/2):(r="100"+r,n=(n-1)/2);return r=r.slice(0,-2),{data:r,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(H_.default);Us.pharmacode=$_});var $h=j(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.codabar=void 0;var q_=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),G_=Ht(),X_=Y_(G_);function Y_(i){return i&&i.__esModule?i:{default:i}}function K_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Q_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Z_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var J_=function(i){Z_(e,i);function e(t,n){K_(this,e),t.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(t="A"+t+"A");var r=Q_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return q_(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var n=[],r=this.getEncodings(),o=0;o<this.data.length;o++)n.push(r[this.data.charAt(o)]),o!==this.data.length-1&&n.push("0");return{text:this.text,data:n.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}(X_.default);Ws.codabar=J_});var qh=j($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.GenericBarcode=void 0;var ew=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),tw=Ht(),iw=nw(tw);function nw(i){return i&&i.__esModule?i:{default:i}}function rw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function ow(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function sw(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var aw=function(i){sw(e,i);function e(t,n){return rw(this,e),ow(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return ew(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(iw.default);$s.GenericBarcode=aw});var Xh=j(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var lw=Jp(),qs=gh(),nr=Oh(),Gh=Bh(),qr=Uh(),cw=Wh(),dw=$h(),uw=qh();oc.default={CODE39:lw.CODE39,CODE128:qs.CODE128,CODE128A:qs.CODE128A,CODE128B:qs.CODE128B,CODE128C:qs.CODE128C,EAN13:nr.EAN13,EAN8:nr.EAN8,EAN5:nr.EAN5,EAN2:nr.EAN2,UPC:nr.UPC,UPCE:nr.UPCE,ITF14:Gh.ITF14,ITF:Gh.ITF,MSI:qr.MSI,MSI10:qr.MSI10,MSI11:qr.MSI11,MSI1010:qr.MSI1010,MSI1110:qr.MSI1110,pharmacode:cw.pharmacode,codabar:dw.codabar,GenericBarcode:uw.GenericBarcode}});var Gr=j(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});var pw=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i};sc.default=function(i,e){return pw({},i,e)}});var Yh=j(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.default=hw;function hw(i){var e=[];function t(n){if(Array.isArray(n))for(var r=0;r<n.length;r++)t(n[r]);else n.text=n.text||"",n.data=n.data||"",e.push(n)}return t(i),e}});var Kh=j(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.default=fw;function fw(i){return i.marginTop=i.marginTop||i.margin,i.marginBottom=i.marginBottom||i.margin,i.marginRight=i.marginRight||i.margin,i.marginLeft=i.marginLeft||i.margin,i}});var dc=j(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.default=mw;function mw(i){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in e)e.hasOwnProperty(t)&&(t=e[t],typeof i[t]=="string"&&(i[t]=parseInt(i[t],10)));return typeof i.displayValue=="string"&&(i.displayValue=i.displayValue!="false"),i}});var pc=j(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var gw={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};uc.default=gw});var Jh=j(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});var yw=dc(),vw=Zh(yw),bw=pc(),Qh=Zh(bw);function Zh(i){return i&&i.__esModule?i:{default:i}}function _w(i){var e={};for(var t in Qh.default)Qh.default.hasOwnProperty(t)&&(i.hasAttribute("jsbarcode-"+t.toLowerCase())&&(e[t]=i.getAttribute("jsbarcode-"+t.toLowerCase())),i.hasAttribute("data-"+t.toLowerCase())&&(e[t]=i.getAttribute("data-"+t.toLowerCase())));return e.value=i.getAttribute("jsbarcode-value")||i.getAttribute("data-value"),e=(0,vw.default)(e),e}hc.default=_w});var fc=j(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.getTotalWidthOfEncodings=si.calculateEncodingAttributes=si.getBarcodePadding=si.getEncodingHeight=si.getMaximumHeightOfEncodings=void 0;var ww=Gr(),xw=Cw(ww);function Cw(i){return i&&i.__esModule?i:{default:i}}function ef(i,e){return e.height+(e.displayValue&&i.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function tf(i,e,t){if(t.displayValue&&e<i){if(t.textAlign=="center")return Math.floor((i-e)/2);if(t.textAlign=="left")return 0;if(t.textAlign=="right")return Math.floor(i-e)}return 0}function Sw(i,e,t){for(var n=0;n<i.length;n++){var r=i[n],o=(0,xw.default)(e,r.options),s;o.displayValue?s=Dw(r.text,o,t):s=0;var a=r.data.length*o.width;r.width=Math.ceil(Math.max(s,a)),r.height=ef(r,o),r.barcodePadding=tf(s,a,o)}}function Pw(i){for(var e=0,t=0;t<i.length;t++)e+=i[t].width;return e}function Ew(i){for(var e=0,t=0;t<i.length;t++)i[t].height>e&&(e=i[t].height);return e}function Dw(i,e,t){var n;if(t)n=t;else if(typeof document<"u")n=document.createElement("canvas").getContext("2d");else return 0;n.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var r=n.measureText(i);if(!r)return 0;var o=r.width;return o}si.getMaximumHeightOfEncodings=Ew;si.getEncodingHeight=ef;si.getBarcodePadding=tf;si.calculateEncodingAttributes=Sw;si.getTotalWidthOfEncodings=Pw});var nf=j(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});var kw=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Tw=Gr(),Iw=Ow(Tw),mc=fc();function Ow(i){return i&&i.__esModule?i:{default:i}}function Fw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Rw=function(){function i(e,t,n){Fw(this,i),this.canvas=e,this.encodings=t,this.options=n}return kw(i,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var n=(0,Iw.default)(this.options,this.encodings[t].options);this.drawCanvasBarcode(n,this.encodings[t]),this.drawCanvasText(n,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),(0,mc.calculateEncodingAttributes)(this.encodings,this.options,t);var n=(0,mc.getTotalWidthOfEncodings)(this.encodings),r=(0,mc.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=n+this.options.marginLeft+this.options.marginRight,this.canvas.height=r,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(t,n){var r=this.canvas.getContext("2d"),o=n.data,s;t.textPosition=="top"?s=t.marginTop+t.fontSize+t.textMargin:s=t.marginTop,r.fillStyle=t.lineColor;for(var a=0;a<o.length;a++){var l=a*t.width+n.barcodePadding;o[a]==="1"?r.fillRect(l,s,t.width,t.height):o[a]&&r.fillRect(l,s,t.width,t.height*o[a])}}},{key:"drawCanvasText",value:function(t,n){var r=this.canvas.getContext("2d"),o=t.fontOptions+" "+t.fontSize+"px "+t.font;if(t.displayValue){var s,a;t.textPosition=="top"?a=t.marginTop+t.fontSize-t.textMargin:a=t.height+t.textMargin+t.marginTop+t.fontSize,r.font=o,t.textAlign=="left"||n.barcodePadding>0?(s=0,r.textAlign="left"):t.textAlign=="right"?(s=n.width-1,r.textAlign="right"):(s=n.width/2,r.textAlign="center"),r.fillText(n.text,s,a)}}},{key:"moveCanvasDrawing",value:function(t){var n=this.canvas.getContext("2d");n.translate(t.width,0)}},{key:"restoreCanvas",value:function(){var t=this.canvas.getContext("2d");t.restore()}}]),i}();gc.default=Rw});var rf=j(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});var Mw=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Aw=Gr(),Bw=Nw(Aw),yc=fc();function Nw(i){return i&&i.__esModule?i:{default:i}}function zw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Gs="http://www.w3.org/2000/svg",Lw=function(){function i(e,t,n){zw(this,i),this.svg=e,this.encodings=t,this.options=n,this.document=n.xmlDocument||document}return Mw(i,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var r=this.encodings[n],o=(0,Bw.default)(this.options,r.options),s=this.createGroup(t,o.marginTop,this.svg);this.setGroupOptions(s,o),this.drawSvgBarcode(s,o,r),this.drawSVGText(s,o,r),t+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,yc.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,yc.getTotalWidthOfEncodings)(this.encodings),n=(0,yc.getMaximumHeightOfEncodings)(this.encodings),r=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(r,n),this.options.background&&this.drawRect(0,0,r,n,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(t,n,r){var o=r.data,s;n.textPosition=="top"?s=n.fontSize+n.textMargin:s=0;for(var a=0,l=0,c=0;c<o.length;c++)l=c*n.width+r.barcodePadding,o[c]==="1"?a++:a>0&&(this.drawRect(l-n.width*a,s,n.width*a,n.height,t),a=0);a>0&&this.drawRect(l-n.width*(a-1),s,n.width*a,n.height,t)}},{key:"drawSVGText",value:function(t,n,r){var o=this.document.createElementNS(Gs,"text");if(n.displayValue){var s,a;o.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),n.textPosition=="top"?a=n.fontSize-n.textMargin:a=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||r.barcodePadding>0?(s=0,o.setAttribute("text-anchor","start")):n.textAlign=="right"?(s=r.width-1,o.setAttribute("text-anchor","end")):(s=r.width/2,o.setAttribute("text-anchor","middle")),o.setAttribute("x",s),o.setAttribute("y",a),o.appendChild(this.document.createTextNode(r.text)),t.appendChild(o)}}},{key:"setSvgAttributes",value:function(t,n){var r=this.svg;r.setAttribute("width",t+"px"),r.setAttribute("height",n+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+t+" "+n),r.setAttribute("xmlns",Gs),r.setAttribute("version","1.1"),r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,n,r){var o=this.document.createElementNS(Gs,"g");return o.setAttribute("transform","translate("+t+", "+n+")"),r.appendChild(o),o}},{key:"setGroupOptions",value:function(t,n){t.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(t,n,r,o,s){var a=this.document.createElementNS(Gs,"rect");return a.setAttribute("x",t),a.setAttribute("y",n),a.setAttribute("width",r),a.setAttribute("height",o),s.appendChild(a),a}}]),i}();vc.default=Lw});var of=j(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});var Hw=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();function jw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Vw=function(){function i(e,t,n){jw(this,i),this.object=e,this.encodings=t,this.options=n}return Hw(i,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),i}();bc.default=Vw});var sf=j(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});var Uw=nf(),Ww=_c(Uw),$w=rf(),qw=_c($w),Gw=of(),Xw=_c(Gw);function _c(i){return i&&i.__esModule?i:{default:i}}wc.default={CanvasRenderer:Ww.default,SVGRenderer:qw.default,ObjectRenderer:Xw.default}});var Pc=j(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});function xc(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Cc(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Sc(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Yw=function(i){Sc(e,i);function e(t,n){xc(this,e);var r=Cc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidInputException",r.symbology=t,r.input=n,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return e}(Error),Kw=function(i){Sc(e,i);function e(){xc(this,e);var t=Cc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="InvalidElementException",t.message="Not supported type to render on",t}return e}(Error),Qw=function(i){Sc(e,i);function e(){xc(this,e);var t=Cc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="NoElementException",t.message="No element to render on.",t}return e}(Error);Xr.InvalidInputException=Yw;Xr.InvalidElementException=Kw;Xr.NoElementException=Qw});var lf=j(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});var Zw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Jw=Jh(),Ec=af(Jw),ex=sf(),Yr=af(ex),tx=Pc();function af(i){return i&&i.__esModule?i:{default:i}}function Dc(i){if(typeof i=="string")return ix(i);if(Array.isArray(i)){for(var e=[],t=0;t<i.length;t++)e.push(Dc(i[t]));return e}else{if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLImageElement)return nx(i);if(i&&i.nodeName&&i.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&i instanceof SVGElement)return{element:i,options:(0,Ec.default)(i),renderer:Yr.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement)return{element:i,options:(0,Ec.default)(i),renderer:Yr.default.CanvasRenderer};if(i&&i.getContext)return{element:i,renderer:Yr.default.CanvasRenderer};if(i&&(typeof i>"u"?"undefined":Zw(i))==="object"&&!i.nodeName)return{element:i,renderer:Yr.default.ObjectRenderer};throw new tx.InvalidElementException}}function ix(i){var e=document.querySelectorAll(i);if(e.length!==0){for(var t=[],n=0;n<e.length;n++)t.push(Dc(e[n]));return t}}function nx(i){var e=document.createElement("canvas");return{element:e,options:(0,Ec.default)(i),renderer:Yr.default.CanvasRenderer,afterRender:function(){i.setAttribute("src",e.toDataURL())}}}kc.default=Dc});var cf=j(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});var rx=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();function ox(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var sx=function(){function i(e){ox(this,i),this.api=e}return rx(i,[{key:"handleCatch",value:function(t){if(t.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw t.message;else throw t;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(t){try{var n=t.apply(void 0,arguments);return this.api._options.valid(!0),n}catch(r){return this.handleCatch(r),this.api}}}]),i}();Tc.default=sx});var Fc=j((NT,gf)=>{"use strict";var ax=Xh(),dn=Zi(ax),lx=Gr(),Kr=Zi(lx),cx=Yh(),uf=Zi(cx),dx=Kh(),df=Zi(dx),ux=lf(),px=Zi(ux),hx=dc(),fx=Zi(hx),mx=cf(),gx=Zi(mx),pf=Pc(),yx=pc(),hf=Zi(yx);function Zi(i){return i&&i.__esModule?i:{default:i}}var Oi=function(){},Xs=function(e,t,n){var r=new Oi;if(typeof e>"u")throw Error("No element to render on was provided.");return r._renderProperties=(0,px.default)(e),r._encodings=[],r._options=hf.default,r._errorHandler=new gx.default(r),typeof t<"u"&&(n=n||{},n.format||(n.format=mf()),r.options(n)[n.format](t,n).render()),r};Xs.getModule=function(i){return dn.default[i]};for(Ic in dn.default)dn.default.hasOwnProperty(Ic)&&vx(dn.default,Ic);var Ic;function vx(i,e){Oi.prototype[e]=Oi.prototype[e.toUpperCase()]=Oi.prototype[e.toLowerCase()]=function(t,n){var r=this;return r._errorHandler.wrapBarcodeCall(function(){n.text=typeof n.text>"u"?void 0:""+n.text;var o=(0,Kr.default)(r._options,n);o=(0,fx.default)(o);var s=i[e],a=ff(t,s,o);return r._encodings.push(a),r})}}function ff(i,e,t){i=""+i;var n=new e(i,t);if(!n.valid())throw new pf.InvalidInputException(n.constructor.name,i);var r=n.encode();r=(0,uf.default)(r);for(var o=0;o<r.length;o++)r[o].options=(0,Kr.default)(t,r[o].options);return r}function mf(){return dn.default.CODE128?"CODE128":Object.keys(dn.default)[0]}Oi.prototype.options=function(i){return this._options=(0,Kr.default)(this._options,i),this};Oi.prototype.blank=function(i){var e=new Array(i+1).join("0");return this._encodings.push({data:e}),this};Oi.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var i;for(var e in this._renderProperties){i=this._renderProperties[e];var t=(0,Kr.default)(this._options,i.options);t.format=="auto"&&(t.format=mf()),this._errorHandler.wrapBarcodeCall(function(){var n=t.value,r=dn.default[t.format.toUpperCase()],o=ff(n,r,t);Oc(i,o,t)})}}};Oi.prototype.render=function(){if(!this._renderProperties)throw new pf.NoElementException;if(Array.isArray(this._renderProperties))for(var i=0;i<this._renderProperties.length;i++)Oc(this._renderProperties[i],this._encodings,this._options);else Oc(this._renderProperties,this._encodings,this._options);return this};Oi.prototype._defaults=hf.default;function Oc(i,e,t){e=(0,uf.default)(e);for(var n=0;n<e.length;n++)e[n].options=(0,Kr.default)(t,e[n].options),(0,df.default)(e[n].options);(0,df.default)(t);var r=i.renderer,o=new r(i.element,e,t);o.render(),i.afterRender&&i.afterRender()}typeof window<"u"&&(window.JsBarcode=Xs);typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(i,e){var t=[];return jQuery(this).each(function(){t.push(this)}),Xs(t,i,e)});gf.exports=Xs});var um=j((k3,dm)=>{dm.exports=function(){var e={},t=e._fns={};e.emit=function(s,a,l,c,d,p,g){var h=n(s);h.length&&r(s,h,[a,l,c,d,p,g])},e.on=function(s,a){t[s]||(t[s]=[]),t[s].push(a)},e.once=function(s,a){function l(){a.apply(this,arguments),e.off(s,l)}this.on(s,l)},e.off=function(s,a){var l=[];if(s&&a){var c=this._fns[s],d=0,p=c?c.length:0;for(d;d<p;d++)c[d]!==a&&l.push(c[d])}l.length?this._fns[s]=l:delete this._fns[s]};function n(o){var s=t[o]?t[o]:[],a=o.indexOf(":"),l=a===-1?[o]:[o.substring(0,a),o.substring(a+1)],c=Object.keys(t),d=0,p=c.length;for(d;d<p;d++){var g=c[d];if(g==="*"&&(s=s.concat(t[g])),l.length===2&&l[0]===g){s=s.concat(t[g]);break}}return s}function r(o,s,a){var l=0,c=s.length;for(l;l<c&&s[l];l++)s[l].event=o,s[l].apply(s[l],a)}return e}});var la=j((I3,pm)=>{function nS(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}pm.exports=nS});var fm=j((O3,hm)=>{var rS=typeof global=="object"&&global&&global.Object===Object&&global;hm.exports=rS});var Jc=j((F3,mm)=>{var oS=fm(),sS=typeof self=="object"&&self&&self.Object===Object&&self,aS=oS||sS||Function("return this")();mm.exports=aS});var ym=j((R3,gm)=>{var lS=Jc(),cS=function(){return lS.Date.now()};gm.exports=cS});var bm=j((M3,vm)=>{var dS=/\s/;function uS(i){for(var e=i.length;e--&&dS.test(i.charAt(e)););return e}vm.exports=uS});var wm=j((A3,_m)=>{var pS=bm(),hS=/^\s+/;function fS(i){return i&&i.slice(0,pS(i)+1).replace(hS,"")}_m.exports=fS});var ed=j((B3,xm)=>{var mS=Jc(),gS=mS.Symbol;xm.exports=gS});var Em=j((N3,Pm)=>{var Cm=ed(),Sm=Object.prototype,yS=Sm.hasOwnProperty,vS=Sm.toString,oo=Cm?Cm.toStringTag:void 0;function bS(i){var e=yS.call(i,oo),t=i[oo];try{i[oo]=void 0;var n=!0}catch{}var r=vS.call(i);return n&&(e?i[oo]=t:delete i[oo]),r}Pm.exports=bS});var km=j((z3,Dm)=>{var _S=Object.prototype,wS=_S.toString;function xS(i){return wS.call(i)}Dm.exports=xS});var Fm=j((L3,Om)=>{var Tm=ed(),CS=Em(),SS=km(),PS="[object Null]",ES="[object Undefined]",Im=Tm?Tm.toStringTag:void 0;function DS(i){return i==null?i===void 0?ES:PS:Im&&Im in Object(i)?CS(i):SS(i)}Om.exports=DS});var Mm=j((H3,Rm)=>{function kS(i){return i!=null&&typeof i=="object"}Rm.exports=kS});var Bm=j((j3,Am)=>{var TS=Fm(),IS=Mm(),OS="[object Symbol]";function FS(i){return typeof i=="symbol"||IS(i)&&TS(i)==OS}Am.exports=FS});var Hm=j((V3,Lm)=>{var RS=wm(),Nm=la(),MS=Bm(),zm=NaN,AS=/^[-+]0x[0-9a-f]+$/i,BS=/^0b[01]+$/i,NS=/^0o[0-7]+$/i,zS=parseInt;function LS(i){if(typeof i=="number")return i;if(MS(i))return zm;if(Nm(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Nm(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=RS(i);var t=BS.test(i);return t||NS.test(i)?zS(i.slice(2),t?2:8):AS.test(i)?zm:+i}Lm.exports=LS});var id=j((U3,Vm)=>{var HS=la(),td=ym(),jm=Hm(),jS="Expected a function",VS=Math.max,US=Math.min;function WS(i,e,t){var n,r,o,s,a,l,c=0,d=!1,p=!1,g=!0;if(typeof i!="function")throw new TypeError(jS);e=jm(e)||0,HS(t)&&(d=!!t.leading,p="maxWait"in t,o=p?VS(jm(t.maxWait)||0,e):o,g="trailing"in t?!!t.trailing:g);function h(b){var w=n,S=r;return n=r=void 0,c=b,s=i.apply(S,w),s}function _(b){return c=b,a=setTimeout(M,e),d?h(b):s}function P(b){var w=b-l,S=b-c,A=e-w;return p?US(A,o-S):A}function z(b){var w=b-l,S=b-c;return l===void 0||w>=e||w<0||p&&S>=o}function M(){var b=td();if(z(b))return W(b);a=setTimeout(M,P(b))}function W(b){return a=void 0,g&&n?h(b):(n=r=void 0,s)}function de(){a!==void 0&&clearTimeout(a),c=0,n=l=r=a=void 0}function oe(){return a===void 0?s:W(td())}function ee(){var b=td(),w=z(b);if(n=arguments,r=this,l=b,w){if(a===void 0)return _(l);if(p)return clearTimeout(a),a=setTimeout(M,e),h(l)}return a===void 0&&(a=setTimeout(M,e)),s}return ee.cancel=de,ee.flush=oe,ee}Vm.exports=WS});var Wm=j((W3,Um)=>{var $S=id(),qS=la(),GS="Expected a function";function XS(i,e,t){var n=!0,r=!0;if(typeof i!="function")throw new TypeError(GS);return qS(t)&&(n="leading"in t?!!t.leading:n,r="trailing"in t?!!t.trailing:r),$S(i,e,{leading:n,maxWait:e,trailing:r})}Um.exports=XS});var ao=j((sF,Qm)=>{"use strict";Qm.exports=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let t=e<0,n=Math.abs(e);if(t&&(n=-n),n===0)return"0 B";let r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.min(Math.floor(Math.log(n)/Math.log(1024)),r.length-1),s=Number(n/1024**o),a=r[o];return`${s>=10||s%1===0?Math.round(s):s.toFixed(1)} ${a}`}});var eg=j((aF,Jm)=>{"use strict";function Zm(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}Zm.prototype.match=function(i){var e=!0,t=this.parts,n,r=t.length,o;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)e=!1;else{for(o=(i||"").split(this.separator),n=0;e&&n<r;n++)t[n]!=="*"&&(n<o.length?e=t[n]===o[n]:e=!1);e=e&&o}else if(typeof i.splice=="function")for(e=[],n=i.length;n--;)this.match(i[n])&&(e[e.length]=i[n]);else if(typeof i=="object"){e={};for(var s in i)this.match(s)&&(e[s]=i[s])}return e};Jm.exports=function(i,e,t){var n=new Zm(i,t||/[\/\.]/);return typeof e<"u"?n.match(e):n}});var ig=j((lF,tg)=>{var eP=eg(),tP=/[\/\+\.]/;tg.exports=function(i,e){function t(n){var r=eP(n,i,tP);return r&&r.length>=2}return e?t(e.split(";")[0]):t}});var vt=j((UF,wa)=>{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var r="",o=0;o<arguments.length;o++){var s=arguments[o];s&&(r=n(r,t(s)))}return r}function t(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return e.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var o="";for(var s in r)i.call(r,s)&&r[s]&&(o=n(o,s));return o}function n(r,o){return o?r?r+" "+o:r+o:r}typeof wa<"u"&&wa.exports?(e.default=e,wa.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var C0=j((XM,au)=>{"use strict";var I2=Object.prototype.hasOwnProperty,_t="~";function zo(){}Object.create&&(zo.prototype=Object.create(null),new zo().__proto__||(_t=!1));function O2(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function x0(i,e,t,n,r){if(typeof t!="function")throw new TypeError("The listener must be a function");var o=new O2(t,n||i,r),s=_t?_t+e:e;return i._events[s]?i._events[s].fn?i._events[s]=[i._events[s],o]:i._events[s].push(o):(i._events[s]=o,i._eventsCount++),i}function Ha(i,e){--i._eventsCount===0?i._events=new zo:delete i._events[e]}function mt(){this._events=new zo,this._eventsCount=0}mt.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)I2.call(t,n)&&e.push(_t?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};mt.prototype.listeners=function(e){var t=_t?_t+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,s=new Array(o);r<o;r++)s[r]=n[r].fn;return s};mt.prototype.listenerCount=function(e){var t=_t?_t+e:e,n=this._events[t];return n?n.fn?1:n.length:0};mt.prototype.emit=function(e,t,n,r,o,s){var a=_t?_t+e:e;if(!this._events[a])return!1;var l=this._events[a],c=arguments.length,d,p;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,r),!0;case 5:return l.fn.call(l.context,t,n,r,o),!0;case 6:return l.fn.call(l.context,t,n,r,o,s),!0}for(p=1,d=new Array(c-1);p<c;p++)d[p-1]=arguments[p];l.fn.apply(l.context,d)}else{var g=l.length,h;for(p=0;p<g;p++)switch(l[p].once&&this.removeListener(e,l[p].fn,void 0,!0),c){case 1:l[p].fn.call(l[p].context);break;case 2:l[p].fn.call(l[p].context,t);break;case 3:l[p].fn.call(l[p].context,t,n);break;case 4:l[p].fn.call(l[p].context,t,n,r);break;default:if(!d)for(h=1,d=new Array(c-1);h<c;h++)d[h-1]=arguments[h];l[p].fn.apply(l[p].context,d)}}return!0};mt.prototype.on=function(e,t,n){return x0(this,e,t,n,!1)};mt.prototype.once=function(e,t,n){return x0(this,e,t,n,!0)};mt.prototype.removeListener=function(e,t,n,r){var o=_t?_t+e:e;if(!this._events[o])return this;if(!t)return Ha(this,o),this;var s=this._events[o];if(s.fn)s.fn===t&&(!r||s.once)&&(!n||s.context===n)&&Ha(this,o);else{for(var a=0,l=[],c=s.length;a<c;a++)(s[a].fn!==t||r&&!s[a].once||n&&s[a].context!==n)&&l.push(s[a]);l.length?this._events[o]=l.length===1?l[0]:l:Ha(this,o)}return this};mt.prototype.removeAllListeners=function(e){var t;return e?(t=_t?_t+e:e,this._events[t]&&Ha(this,t)):(this._events=new zo,this._eventsCount=0),this};mt.prototype.off=mt.prototype.removeListener;mt.prototype.addListener=mt.prototype.on;mt.prefixed=_t;mt.EventEmitter=mt;typeof au<"u"&&(au.exports=mt)});var py=j((Vu,Uu)=>{(function(i,e){typeof Vu=="object"&&typeof Uu<"u"?Uu.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=e())})(Vu,function(){"use strict";function i(F,C){var k=Object.keys(F);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(F);C&&(T=T.filter(function(R){return Object.getOwnPropertyDescriptor(F,R).enumerable})),k.push.apply(k,T)}return k}function e(F){for(var C=1;C<arguments.length;C++){var k=arguments[C]!=null?arguments[C]:{};C%2?i(Object(k),!0).forEach(function(T){o(F,T,k[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(F,Object.getOwnPropertyDescriptors(k)):i(Object(k)).forEach(function(T){Object.defineProperty(F,T,Object.getOwnPropertyDescriptor(k,T))})}return F}function t(F,C){if(!(F instanceof C))throw new TypeError("Cannot call a class as a function")}function n(F,C){for(var k=0;k<C.length;k++){var T=C[k];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(F,l(T.key),T)}}function r(F,C,k){return C&&n(F.prototype,C),k&&n(F,k),Object.defineProperty(F,"prototype",{writable:!1}),F}function o(F,C,k){return C=l(C),C in F?Object.defineProperty(F,C,{value:k,enumerable:!0,configurable:!0,writable:!0}):F[C]=k,F}function s(){return s=Object.assign?Object.assign.bind():function(F){for(var C=1;C<arguments.length;C++){var k=arguments[C];for(var T in k)Object.prototype.hasOwnProperty.call(k,T)&&(F[T]=k[T])}return F},s.apply(this,arguments)}function a(F,C){if(typeof F!="object"||F===null)return F;var k=F[Symbol.toPrimitive];if(k!==void 0){var T=k.call(F,C||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(F)}function l(F){var C=a(F,"string");return typeof C=="symbol"?C:String(C)}var c={exports:{}};(function(F){typeof window>"u"||function(C){var k=C.HTMLCanvasElement&&C.HTMLCanvasElement.prototype,T=C.Blob&&function(){try{return!!new Blob}catch{return!1}}(),R=T&&C.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),V=C.BlobBuilder||C.WebKitBlobBuilder||C.MozBlobBuilder||C.MSBlobBuilder,ie=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,G=(T||V)&&C.atob&&C.ArrayBuffer&&C.Uint8Array&&function($){var Y,ne,re,ge,Z,J,be,_e,Ct;if(Y=$.match(ie),!Y)throw new Error("invalid data URI");for(ne=Y[2]?Y[1]:"text/plain"+(Y[3]||";charset=US-ASCII"),re=!!Y[4],ge=$.slice(Y[0].length),re?Z=atob(ge):Z=decodeURIComponent(ge),J=new ArrayBuffer(Z.length),be=new Uint8Array(J),_e=0;_e<Z.length;_e+=1)be[_e]=Z.charCodeAt(_e);return T?new Blob([R?be:J],{type:ne}):(Ct=new V,Ct.append(J),Ct.getBlob(ne))};C.HTMLCanvasElement&&!k.toBlob&&(k.mozGetAsFile?k.toBlob=function($,Y,ne){var re=this;setTimeout(function(){ne&&k.toDataURL&&G?$(G(re.toDataURL(Y,ne))):$(re.mozGetAsFile("blob",Y))})}:k.toDataURL&&G&&(k.msToBlob?k.toBlob=function($,Y,ne){var re=this;setTimeout(function(){(Y&&Y!=="image/png"||ne)&&k.toDataURL&&G?$(G(re.toDataURL(Y,ne))):$(re.msToBlob(Y))})}:k.toBlob=function($,Y,ne){var re=this;setTimeout(function(){$(G(re.toDataURL(Y,ne)))})})),F.exports?F.exports=G:C.dataURLtoBlob=G}(window)})(c);var d=c.exports,p=function(C){return typeof Blob>"u"?!1:C instanceof Blob||Object.prototype.toString.call(C)==="[object Blob]"},g={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},h=typeof window<"u"&&typeof window.document<"u",_=h?window:{},P=function(C){return C>0&&C<1/0},z=Array.prototype.slice;function M(F){return Array.from?Array.from(F):z.call(F)}var W=/^image\/.+$/;function de(F){return W.test(F)}function oe(F){var C=de(F)?F.substr(6):"";return C==="jpeg"&&(C="jpg"),".".concat(C)}var ee=String.fromCharCode;function b(F,C,k){var T="",R;for(k+=C,R=C;R<k;R+=1)T+=ee(F.getUint8(R));return T}var w=_.btoa;function S(F,C){for(var k=[],T=8192,R=new Uint8Array(F);R.length>0;)k.push(ee.apply(null,M(R.subarray(0,T)))),R=R.subarray(T);return"data:".concat(C,";base64,").concat(w(k.join("")))}function A(F){var C=new DataView(F),k;try{var T,R,V;if(C.getUint8(0)===255&&C.getUint8(1)===216)for(var ie=C.byteLength,G=2;G+1<ie;){if(C.getUint8(G)===255&&C.getUint8(G+1)===225){R=G;break}G+=1}if(R){var $=R+4,Y=R+10;if(b(C,$,4)==="Exif"){var ne=C.getUint16(Y);if(T=ne===18761,(T||ne===19789)&&C.getUint16(Y+2,T)===42){var re=C.getUint32(Y+4,T);re>=8&&(V=Y+re)}}}if(V){var ge=C.getUint16(V,T),Z,J;for(J=0;J<ge;J+=1)if(Z=V+J*12+2,C.getUint16(Z,T)===274){Z+=8,k=C.getUint16(Z,T),C.setUint16(Z,1,T);break}}}catch{k=1}return k}function L(F){var C=0,k=1,T=1;switch(F){case 2:k=-1;break;case 3:C=-180;break;case 4:T=-1;break;case 5:C=90,T=-1;break;case 6:C=90;break;case 7:C=90,k=-1;break;case 8:C=-90;break}return{rotate:C,scaleX:k,scaleY:T}}var K=/\.\d*(?:0|9){12}\d*$/;function ve(F){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return K.test(F)?Math.round(F*C)/C:F}function Ne(F){var C=F.aspectRatio,k=F.height,T=F.width,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",V=P(T),ie=P(k);if(V&&ie){var G=k*C;(R==="contain"||R==="none")&&G>T||R==="cover"&&G<T?k=T/C:T=k*C}else V?k=T/C:ie&&(T=k*C);return{width:T,height:k}}function Pe(F){for(var C=M(new Uint8Array(F)),k=C.length,T=[],R=0;R+3<k;){var V=C[R],ie=C[R+1];if(V===255&&ie===218)break;if(V===255&&ie===216)R+=2;else{var G=C[R+2]*256+C[R+3],$=R+G+2,Y=C.slice(R,$);T.push(Y),R=$}}return T.reduce(function(ne,re){return re[0]===255&&re[1]===225?ne.concat(re):ne},[])}function Se(F,C){var k=M(new Uint8Array(F));if(k[2]!==255||k[3]!==224)return F;var T=k[4]*256+k[5],R=[255,216].concat(C,k.slice(4+T));return new Uint8Array(R)}var Q=_.ArrayBuffer,ze=_.FileReader,te=_.URL||_.webkitURL,Mt=/\.\w+$/,he=_.Compressor,X=function(){function F(C,k){t(this,F),this.file=C,this.exif=[],this.image=new Image,this.options=e(e({},g),k),this.aborted=!1,this.result=null,this.init()}return r(F,[{key:"init",value:function(){var k=this,T=this.file,R=this.options;if(!p(T)){this.fail(new Error("The first argument must be a File or Blob object."));return}var V=T.type;if(!de(V)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!te||!ze){this.fail(new Error("The current browser does not support image compression."));return}Q||(R.checkOrientation=!1,R.retainExif=!1);var ie=V==="image/jpeg",G=ie&&R.checkOrientation,$=ie&&R.retainExif;if(te&&!G&&!$)this.load({url:te.createObjectURL(T)});else{var Y=new ze;this.reader=Y,Y.onload=function(ne){var re=ne.target,ge=re.result,Z={},J=1;G&&(J=A(ge),J>1&&s(Z,L(J))),$&&(k.exif=Pe(ge)),G||$?!te||J>1?Z.url=S(ge,V):Z.url=te.createObjectURL(T):Z.url=ge,k.load(Z)},Y.onabort=function(){k.fail(new Error("Aborted to read the image with FileReader."))},Y.onerror=function(){k.fail(new Error("Failed to read the image with FileReader."))},Y.onloadend=function(){k.reader=null},G||$?Y.readAsArrayBuffer(T):Y.readAsDataURL(T)}}},{key:"load",value:function(k){var T=this,R=this.file,V=this.image;V.onload=function(){T.draw(e(e({},k),{},{naturalWidth:V.naturalWidth,naturalHeight:V.naturalHeight}))},V.onabort=function(){T.fail(new Error("Aborted to load the image."))},V.onerror=function(){T.fail(new Error("Failed to load the image."))},_.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(_.navigator.userAgent)&&(V.crossOrigin="anonymous"),V.alt=R.name,V.src=k.url}},{key:"draw",value:function(k){var T=this,R=k.naturalWidth,V=k.naturalHeight,ie=k.rotate,G=ie===void 0?0:ie,$=k.scaleX,Y=$===void 0?1:$,ne=k.scaleY,re=ne===void 0?1:ne,ge=this.file,Z=this.image,J=this.options,be=document.createElement("canvas"),_e=be.getContext("2d"),Ct=Math.abs(G)%180===90,At=(J.resize==="contain"||J.resize==="cover")&&P(J.width)&&P(J.height),je=Math.max(J.maxWidth,0)||1/0,St=Math.max(J.maxHeight,0)||1/0,Te=Math.max(J.minWidth,0)||0,st=Math.max(J.minHeight,0)||0,at=R/V,Re=J.width,Ze=J.height;if(Ct){var ki=[St,je];je=ki[0],St=ki[1];var Bt=[st,Te];Te=Bt[0],st=Bt[1];var Wi=[Ze,Re];Re=Wi[0],Ze=Wi[1]}At&&(at=Re/Ze);var Tr=Ne({aspectRatio:at,width:je,height:St},"contain");je=Tr.width,St=Tr.height;var Xu=Ne({aspectRatio:at,width:Te,height:st},"cover");if(Te=Xu.width,st=Xu.height,At){var Yu=Ne({aspectRatio:at,width:Re,height:Ze},J.resize);Re=Yu.width,Ze=Yu.height}else{var Ku=Ne({aspectRatio:at,width:Re,height:Ze}),Qu=Ku.width;Re=Qu===void 0?R:Qu;var Zu=Ku.height;Ze=Zu===void 0?V:Zu}Re=Math.floor(ve(Math.min(Math.max(Re,Te),je))),Ze=Math.floor(ve(Math.min(Math.max(Ze,st),St)));var By=-Re/2,Ny=-Ze/2,zy=Re,Ly=Ze,il=[];if(At){var Ju=0,ep=0,nl=R,rl=V,tp=Ne({aspectRatio:at,width:R,height:V},{contain:"cover",cover:"contain"}[J.resize]);nl=tp.width,rl=tp.height,Ju=(R-nl)/2,ep=(V-rl)/2,il.push(Ju,ep,nl,rl)}if(il.push(By,Ny,zy,Ly),Ct){var ip=[Ze,Re];Re=ip[0],Ze=ip[1]}be.width=Re,be.height=Ze,de(J.mimeType)||(J.mimeType=ge.type);var np="transparent";ge.size>J.convertSize&&J.convertTypes.indexOf(J.mimeType)>=0&&(J.mimeType="image/jpeg");var rp=J.mimeType==="image/jpeg";if(rp&&(np="#fff"),_e.fillStyle=np,_e.fillRect(0,0,Re,Ze),J.beforeDraw&&J.beforeDraw.call(this,_e,be),!this.aborted&&(_e.save(),_e.translate(Re/2,Ze/2),_e.rotate(G*Math.PI/180),_e.scale(Y,re),_e.drawImage.apply(_e,[Z].concat(il)),_e.restore(),J.drew&&J.drew.call(this,_e,be),!this.aborted)){var op=function(Ir){if(!T.aborted){var sp=function(Or){return T.done({naturalWidth:R,naturalHeight:V,result:Or})};if(Ir&&rp&&J.retainExif&&T.exif&&T.exif.length>0){var ap=function(Or){return sp(d(S(Se(Or,T.exif),J.mimeType)))};if(Ir.arrayBuffer)Ir.arrayBuffer().then(ap).catch(function(){T.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var zn=new ze;T.reader=zn,zn.onload=function(ol){var Or=ol.target;ap(Or.result)},zn.onabort=function(){T.fail(new Error("Aborted to read the compressed image with FileReader."))},zn.onerror=function(){T.fail(new Error("Failed to read the compressed image with FileReader."))},zn.onloadend=function(){T.reader=null},zn.readAsArrayBuffer(Ir)}}else sp(Ir)}};be.toBlob?be.toBlob(op,J.mimeType,J.quality):op(d(be.toDataURL(J.mimeType,J.quality)))}}},{key:"done",value:function(k){var T=k.naturalWidth,R=k.naturalHeight,V=k.result,ie=this.file,G=this.image,$=this.options;if(te&&G.src.indexOf("blob:")===0&&te.revokeObjectURL(G.src),V)if($.strict&&!$.retainExif&&V.size>ie.size&&$.mimeType===ie.type&&!($.width>T||$.height>R||$.minWidth>T||$.minHeight>R||$.maxWidth<T||$.maxHeight<R))V=ie;else{var Y=new Date;V.lastModified=Y.getTime(),V.lastModifiedDate=Y,V.name=ie.name,V.name&&V.type!==ie.type&&(V.name=V.name.replace(Mt,oe(V.type)))}else V=ie;this.result=V,$.success&&$.success.call(this,V)}},{key:"fail",value:function(k){var T=this.options;if(T.error)T.error.call(this,k);else throw k}},{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=he,F}},{key:"setDefaults",value:function(k){s(g,k)}}]),F}();return X})});var gy=j(($u,qu)=>{((i,e)=>{typeof define=="function"&&define.amd?define([],e):typeof qu=="object"&&typeof $u<"u"?qu.exports=e():i.Papa=e()})($u,function i(){var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},t,n=!e.document&&!!e.postMessage,r=e.IS_PAPA_WORKER||!1,o={},s=0,a={};function l(b){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(w){var S=de(w);S.chunkSize=parseInt(S.chunkSize),w.step||w.chunk||(S.chunkSize=null),this._handle=new h(S),(this._handle.streamer=this)._config=S}.call(this,b),this.parseChunk=function(w,S){var A=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<A){let K=this._config.newline;K||(L=this._config.quoteChar||'"',K=this._handle.guessLineEndings(w,L)),w=[...w.split(K).slice(A)].join(K)}this.isFirstChunk&&ee(this._config.beforeFirstChunk)&&(L=this._config.beforeFirstChunk(w))!==void 0&&(w=L),this.isFirstChunk=!1,this._halted=!1;var A=this._partialLine+w,L=(this._partialLine="",this._handle.parse(A,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=L.meta.cursor,A=(this._finished||(this._partialLine=A.substring(w-this._baseIndex),this._baseIndex=w),L&&L.data&&(this._rowCount+=L.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),r)e.postMessage({results:L,workerId:a.WORKER_ID,finished:A});else if(ee(this._config.chunk)&&!S){if(this._config.chunk(L,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=L=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(L.data),this._completeResults.errors=this._completeResults.errors.concat(L.errors),this._completeResults.meta=L.meta),this._completed||!A||!ee(this._config.complete)||L&&L.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),A||L&&L.meta.paused||this._nextChunk(),L}this._halted=!0},this._sendError=function(w){ee(this._config.error)?this._config.error(w):r&&this._config.error&&e.postMessage({workerId:a.WORKER_ID,error:w,finished:!1})}}function c(b){var w;(b=b||{}).chunkSize||(b.chunkSize=a.RemoteChunkSize),l.call(this,b),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(S){this._input=S,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(w=new XMLHttpRequest,this._config.withCredentials&&(w.withCredentials=this._config.withCredentials),n||(w.onload=oe(this._chunkLoaded,this),w.onerror=oe(this._chunkError,this)),w.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var S,A=this._config.downloadRequestHeaders;for(S in A)w.setRequestHeader(S,A[S])}var L;this._config.chunkSize&&(L=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+L));try{w.send(this._config.downloadRequestBody)}catch(K){this._chunkError(K.message)}n&&w.status===0&&this._chunkError()}},this._chunkLoaded=function(){w.readyState===4&&(w.status<200||400<=w.status?this._chunkError():(this._start+=this._config.chunkSize||w.responseText.length,this._finished=!this._config.chunkSize||this._start>=(S=>(S=S.getResponseHeader("Content-Range"))!==null?parseInt(S.substring(S.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(S){S=w.statusText||S,this._sendError(new Error(S))}}function d(b){(b=b||{}).chunkSize||(b.chunkSize=a.LocalChunkSize),l.call(this,b);var w,S,A=typeof FileReader<"u";this.stream=function(L){this._input=L,S=L.slice||L.webkitSlice||L.mozSlice,A?((w=new FileReader).onload=oe(this._chunkLoaded,this),w.onerror=oe(this._chunkError,this)):w=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var L=this._input,K=(this._config.chunkSize&&(K=Math.min(this._start+this._config.chunkSize,this._input.size),L=S.call(L,this._start,K)),w.readAsText(L,this._config.encoding));A||this._chunkLoaded({target:{result:K}})},this._chunkLoaded=function(L){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(L.target.result)},this._chunkError=function(){this._sendError(w.error)}}function p(b){var w;l.call(this,b=b||{}),this.stream=function(S){return w=S,this._nextChunk()},this._nextChunk=function(){var S,A;if(!this._finished)return S=this._config.chunkSize,w=S?(A=w.substring(0,S),w.substring(S)):(A=w,""),this._finished=!w,this.parseChunk(A)}}function g(b){l.call(this,b=b||{});var w=[],S=!0,A=!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(L){this._input=L,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){A&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):S=!0},this._streamData=oe(function(L){try{w.push(typeof L=="string"?L:L.toString(this._config.encoding)),S&&(S=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(K){this._streamError(K)}},this),this._streamError=oe(function(L){this._streamCleanUp(),this._sendError(L)},this),this._streamEnd=oe(function(){this._streamCleanUp(),A=!0,this._streamData("")},this),this._streamCleanUp=oe(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function h(b){var w,S,A,L,K=Math.pow(2,53),ve=-K,Ne=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Pe=/^((\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,Q=0,ze=0,te=!1,Mt=!1,he=[],X={data:[],errors:[],meta:{}};function F(R){return b.skipEmptyLines==="greedy"?R.join("").trim()==="":R.length===1&&R[0].length===0}function C(){if(X&&A&&(T("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),A=!1),b.skipEmptyLines&&(X.data=X.data.filter(function($){return!F($)})),k()){let $=function(Y,ne){ee(b.transformHeader)&&(Y=b.transformHeader(Y,ne)),he.push(Y)};var G=$;if(X)if(Array.isArray(X.data[0])){for(var R=0;k()&&R<X.data.length;R++)X.data[R].forEach($);X.data.splice(0,1)}else X.data.forEach($)}function V($,Y){for(var ne=b.header?{}:[],re=0;re<$.length;re++){var ge=re,Z=$[re],Z=((J,be)=>(_e=>(b.dynamicTypingFunction&&b.dynamicTyping[_e]===void 0&&(b.dynamicTyping[_e]=b.dynamicTypingFunction(_e)),(b.dynamicTyping[_e]||b.dynamicTyping)===!0))(J)?be==="true"||be==="TRUE"||be!=="false"&&be!=="FALSE"&&((_e=>{if(Ne.test(_e)&&(_e=parseFloat(_e),ve<_e&&_e<K))return 1})(be)?parseFloat(be):Pe.test(be)?new Date(be):be===""?null:be):be)(ge=b.header?re>=he.length?"__parsed_extra":he[re]:ge,Z=b.transform?b.transform(Z,ge):Z);ge==="__parsed_extra"?(ne[ge]=ne[ge]||[],ne[ge].push(Z)):ne[ge]=Z}return b.header&&(re>he.length?T("FieldMismatch","TooManyFields","Too many fields: expected "+he.length+" fields but parsed "+re,ze+Y):re<he.length&&T("FieldMismatch","TooFewFields","Too few fields: expected "+he.length+" fields but parsed "+re,ze+Y)),ne}var ie;X&&(b.header||b.dynamicTyping||b.transform)&&(ie=1,!X.data.length||Array.isArray(X.data[0])?(X.data=X.data.map(V),ie=X.data.length):X.data=V(X.data,0),b.header&&X.meta&&(X.meta.fields=he),ze+=ie)}function k(){return b.header&&he.length===0}function T(R,V,ie,G){R={type:R,code:V,message:ie},G!==void 0&&(R.row=G),X.errors.push(R)}ee(b.step)&&(L=b.step,b.step=function(R){X=R,k()?C():(C(),X.data.length!==0&&(Q+=R.data.length,b.preview&&Q>b.preview?S.abort():(X.data=X.data[0],L(X,Se))))}),this.parse=function(R,V,ie){var G=b.quoteChar||'"',G=(b.newline||(b.newline=this.guessLineEndings(R,G)),A=!1,b.delimiter?ee(b.delimiter)&&(b.delimiter=b.delimiter(R),X.meta.delimiter=b.delimiter):((G=(($,Y,ne,re,ge)=>{var Z,J,be,_e;ge=ge||[","," ","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var Ct=0;Ct<ge.length;Ct++){for(var At,je=ge[Ct],St=0,Te=0,st=0,at=(be=void 0,new P({comments:re,delimiter:je,newline:Y,preview:10}).parse($)),Re=0;Re<at.data.length;Re++)ne&&F(at.data[Re])?st++:(At=at.data[Re].length,Te+=At,be===void 0?be=At:0<At&&(St+=Math.abs(At-be),be=At));0<at.data.length&&(Te/=at.data.length-st),(J===void 0||St<=J)&&(_e===void 0||_e<Te)&&1.99<Te&&(J=St,Z=je,_e=Te)}return{successful:!!(b.delimiter=Z),bestDelimiter:Z}})(R,b.newline,b.skipEmptyLines,b.comments,b.delimitersToGuess)).successful?b.delimiter=G.bestDelimiter:(A=!0,b.delimiter=a.DefaultDelimiter),X.meta.delimiter=b.delimiter),de(b));return b.preview&&b.header&&G.preview++,w=R,S=new P(G),X=S.parse(w,V,ie),C(),te?{meta:{paused:!0}}:X||{meta:{paused:!1}}},this.paused=function(){return te},this.pause=function(){te=!0,S.abort(),w=ee(b.chunk)?"":w.substring(S.getCharIndex())},this.resume=function(){Se.streamer._halted?(te=!1,Se.streamer.parseChunk(w,!0)):setTimeout(Se.resume,3)},this.aborted=function(){return Mt},this.abort=function(){Mt=!0,S.abort(),X.meta.aborted=!0,ee(b.complete)&&b.complete(X),w=""},this.guessLineEndings=function($,G){$=$.substring(0,1048576);var G=new RegExp(_(G)+"([^]*?)"+_(G),"gm"),ie=($=$.replace(G,"")).split("\r"),G=$.split(`
1
+ import{A as Ms,B as Gp,C as Xp,D as kl,E as Yp,F as Kp,a as ys,c as Is,d as Nr,e as xl,f as Np,g as Lp,h as Ii,i as zp,j as Lr,k as Cl,l as Sl,m as We,n as Hp,o as Os,p as ke,q as Fs,r as jp,s as Vp,t as El,u as Rs,v as Up,w as Dl,x as Wp,y as $p,z as qp}from"./chunk-TB5NWUY2.js";import{a as As,b as _i,c as oi}from"./chunk-SXBAH6HQ.js";import{$ as Bp,B as nt,C as kt,D as ws,E as xs,F as Cs,G as Yi,H as ht,I as rt,J as Je,K as ft,L as Gn,M as Ss,N as Ps,O as Es,P as Ds,Q as ks,R as Ts,T as Ip,U as Op,V as Fp,W as Rp,X as Mp,Y as Xn,Z as Ap,a as vi,aa as bi,b as Sp,c as Pp,fa as Pl,k as gs,m as $n,p as _l,q as bs,t as Tp,u as qn,v as tt,w as ct,y as it,z as _s}from"./chunk-KDDSRF5J.js";import{$b as us,Aa as Rr,Ac as Ae,Ad as Ep,Bb as Mr,Bd as vs,C as ze,Ca as pe,Cd as Dp,D as lp,Da as N,Db as gp,Ec as Ue,Ed as Br,Fb as ss,Fc as ni,Fd as kp,Gb as as,Gc as Ti,H as mi,Ha as fe,Hc as vl,Hd as wl,I as Qt,Ia as Lt,Ic as me,J as ns,Ja as ln,Jb as q,Ka as rs,Kb as fl,Mb as Ar,N as cp,O as sl,Oa as hp,P as sn,Pb as ue,Pc as vp,Qb as yp,Ra as gi,Rb as ls,S as an,Sa as se,Sb as zt,Sc as cn,Ta as ae,Tb as E,U as Zt,Uc as Gi,Vb as jn,Wa as Ge,Wb as cs,Xa as Xe,Xc as bp,Y as al,Yc as bl,Z as Fr,Za as lt,Zb as Ce,_a as Et,_b as ds,a as v,aa as dp,ab as hl,ac as Jt,b as D,bb as Dt,bc as ei,c as zn,ca as ll,cc as f,cd as gt,d as j,dc as m,e as De,ea as up,ec as le,fa as cl,fc as ml,g as B,gc as gl,h as Hn,hb as fp,hd as fs,i as es,ic as Ie,j as ts,jd as Xi,k as is,l as $i,lc as U,ld as Wn,mc as O,md as _p,n as Pt,nc as Vn,oa as dl,oc as Un,od as wp,pd as xp,q as et,qa as ul,qc as ps,qd as ms,ra as qi,rc as yi,rd as Cp,sa as pl,sc as ti,sd as ri,ta as xe,tc as ii,ub as os,uc as yl,vc as x,wa as pp,wb as mp,wc as I,xa as Ve,xc as Ht,ya as Nt,yb as y,yc as hs,zb as He,zc as ye}from"./chunk-UZEILQYY.js";var jt=j(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});function Hy(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var jy=function i(e,t){Hy(this,i),this.data=e,this.text=t.text||e,this.options=t};Tl.default=jy});var Jp=j(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.CODE39=void 0;var Vy=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Uy=jt(),Wy=$y(Uy);function $y(i){return i&&i.__esModule?i:{default:i}}function qy(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Gy(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Xy(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Yy=function(i){Xy(e,i);function e(t,n){return qy(this,e),t=t.toUpperCase(),n.mod43&&(t+=Zy(Jy(t))),Gy(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Vy(e,[{key:"encode",value:function(){for(var n=Il("*"),r=0;r<this.data.length;r++)n+=Il(this.data[r])+"0";return n+=Il("*"),{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(Wy.default),Qp=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],Ky=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function Il(i){return Qy(Zp(i))}function Qy(i){return Ky[i].toString(2)}function Zy(i){return Qp[i]}function Zp(i){return Qp.indexOf(i)}function Jy(i){for(var e=0,t=0;t<i.length;t++)e+=Zp(i[t]);return e=e%43,e}Bs.CODE39=Yy});var Yn=j($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});var zr;function Ol(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var eh=$e.SET_A=0,th=$e.SET_B=1,ih=$e.SET_C=2,Sk=$e.SHIFT=98,ev=$e.START_A=103,tv=$e.START_B=104,iv=$e.START_C=105,Pk=$e.MODULO=103,Ek=$e.STOP=106,Dk=$e.FNC1=207,kk=$e.SET_BY_CODE=(zr={},Ol(zr,ev,eh),Ol(zr,tv,th),Ol(zr,iv,ih),zr),Tk=$e.SWAP={101:eh,100:th,99:ih},Ik=$e.A_START_CHAR="\xD0",Ok=$e.B_START_CHAR="\xD1",Fk=$e.C_START_CHAR="\xD2",Rk=$e.A_CHARS="[\0-_\xC8-\xCF]",Mk=$e.B_CHARS="[ -\x7F\xC8-\xCF]",Ak=$e.C_CHARS="(\xCF*[0-9]{2}\xCF*)",Bk=$e.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]});var Hr=j(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});var nv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),rv=jt(),ov=sv(rv),Vt=Yn();function sv(i){return i&&i.__esModule?i:{default:i}}function av(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function lv(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function cv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var dv=function(i){cv(e,i);function e(t,n){av(this,e);var r=lv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.substring(1),n));return r.bytes=t.split("").map(function(o){return o.charCodeAt(0)}),r}return nv(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,r=n.shift()-105,o=Vt.SET_BY_CODE[r];if(o===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&n.unshift(Vt.FNC1);var s=e.next(n,1,o);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(r)+s.result+e.getBar((s.checksum+r)%Vt.MODULO)+e.getBar(Vt.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return typeof n=="string"&&(n=n.toLowerCase()==="true"),n}}],[{key:"getBar",value:function(n){return Vt.BARS[n]?Vt.BARS[n].toString():""}},{key:"correctIndex",value:function(n,r){if(r===Vt.SET_A){var o=n.shift();return o<32?o+64:o-32}else return r===Vt.SET_B?n.shift()-32:(n.shift()-48)*10+n.shift()-48}},{key:"next",value:function(n,r,o){if(!n.length)return{result:"",checksum:0};var s=void 0,a=void 0;if(n[0]>=200){a=n.shift()-105;var l=Vt.SWAP[a];l!==void 0?s=e.next(n,r+1,l):((o===Vt.SET_A||o===Vt.SET_B)&&a===Vt.SHIFT&&(n[0]=o===Vt.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),s=e.next(n,r+1,o))}else a=e.correctIndex(n,o),s=e.next(n,r+1,o);var c=e.getBar(a),d=a*r;return{result:c+s.result,checksum:d+s.checksum}}}]),e}(ov.default);Fl.default=dv});var ah=j(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var Ki=Yn(),nh=function(e){return e.match(new RegExp("^"+Ki.A_CHARS+"*"))[0].length},rh=function(e){return e.match(new RegExp("^"+Ki.B_CHARS+"*"))[0].length},oh=function(e){return e.match(new RegExp("^"+Ki.C_CHARS+"*"))[0]};function Rl(i,e){var t=e?Ki.A_CHARS:Ki.B_CHARS,n=i.match(new RegExp("^("+t+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(n)return n[1]+"\xCC"+sh(i.substring(n[1].length));var r=i.match(new RegExp("^"+t+"+"))[0];return r.length===i.length?i:r+String.fromCharCode(e?205:206)+Rl(i.substring(r.length),!e)}function sh(i){var e=oh(i),t=e.length;if(t===i.length)return i;i=i.substring(t);var n=nh(i)>=rh(i);return e+String.fromCharCode(n?206:205)+Rl(i,n)}Ml.default=function(i){var e=void 0,t=oh(i).length;if(t>=2)e=Ki.C_START_CHAR+sh(i);else{var n=nh(i)>rh(i);e=(n?Ki.A_START_CHAR:Ki.B_START_CHAR)+Rl(i,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(r,o){return"\xCB"+o})}});var ch=j(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});var uv=Hr(),pv=lh(uv),hv=ah(),fv=lh(hv);function lh(i){return i&&i.__esModule?i:{default:i}}function mv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Al(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function gv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var yv=function(i){gv(e,i);function e(t,n){if(mv(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var r=Al(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,fv.default)(t),n));else var r=Al(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return Al(r)}return e}(pv.default);Bl.default=yv});var uh=j(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});var vv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),bv=Hr(),_v=wv(bv),dh=Yn();function wv(i){return i&&i.__esModule?i:{default:i}}function xv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Cv(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Sv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Pv=function(i){Sv(e,i);function e(t,n){return xv(this,e),Cv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,dh.A_START_CHAR+t,n))}return vv(e,[{key:"valid",value:function(){return new RegExp("^"+dh.A_CHARS+"+$").test(this.data)}}]),e}(_v.default);Nl.default=Pv});var hh=j(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var Ev=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Dv=Hr(),kv=Tv(Dv),ph=Yn();function Tv(i){return i&&i.__esModule?i:{default:i}}function Iv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Ov(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Fv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Rv=function(i){Fv(e,i);function e(t,n){return Iv(this,e),Ov(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,ph.B_START_CHAR+t,n))}return Ev(e,[{key:"valid",value:function(){return new RegExp("^"+ph.B_CHARS+"+$").test(this.data)}}]),e}(kv.default);Ll.default=Rv});var mh=j(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});var Mv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Av=Hr(),Bv=Nv(Av),fh=Yn();function Nv(i){return i&&i.__esModule?i:{default:i}}function Lv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function zv(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Hv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var jv=function(i){Hv(e,i);function e(t,n){return Lv(this,e),zv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,fh.C_START_CHAR+t,n))}return Mv(e,[{key:"valid",value:function(){return new RegExp("^"+fh.C_CHARS+"+$").test(this.data)}}]),e}(Bv.default);zl.default=jv});var gh=j(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.CODE128C=wi.CODE128B=wi.CODE128A=wi.CODE128=void 0;var Vv=ch(),Uv=Ns(Vv),Wv=uh(),$v=Ns(Wv),qv=hh(),Gv=Ns(qv),Xv=mh(),Yv=Ns(Xv);function Ns(i){return i&&i.__esModule?i:{default:i}}wi.CODE128=Uv.default;wi.CODE128A=$v.default;wi.CODE128B=Gv.default;wi.CODE128C=Yv.default});var Kn=j(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var $k=Qi.SIDE_BIN="101",qk=Qi.MIDDLE_BIN="01010",Gk=Qi.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},Xk=Qi.EAN2_STRUCTURE=["LL","LG","GL","GG"],Yk=Qi.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],Kk=Qi.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]});var Qn=j(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var Kv=Kn(),Qv=function(e,t,n){var r=e.split("").map(function(s,a){return Kv.BINARIES[t[a]]}).map(function(s,a){return s?s[e[a]]:""});if(n){var o=e.length-1;r=r.map(function(s,a){return a<o?s+n:s})}return r.join("")};Hl.default=Qv});var Vl=j(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});var Zv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Zn=Kn(),Jv=Qn(),yh=vh(Jv),eb=jt(),tb=vh(eb);function vh(i){return i&&i.__esModule?i:{default:i}}function ib(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function nb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function rb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var ob=function(i){rb(e,i);function e(t,n){ib(this,e);var r=nb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.fontSize=!n.flat&&n.fontSize>n.width*10?n.width*10:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return Zv(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(n,r){return this.text.substr(n,r)}},{key:"leftEncode",value:function(n,r){return(0,yh.default)(n,r)}},{key:"rightText",value:function(n,r){return this.text.substr(n,r)}},{key:"rightEncode",value:function(n,r){return(0,yh.default)(n,r)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},r={height:this.guardHeight};return[{data:Zn.SIDE_BIN,options:r},{data:this.leftEncode(),text:this.leftText(),options:n},{data:Zn.MIDDLE_BIN,options:r},{data:this.rightEncode(),text:this.rightText(),options:n},{data:Zn.SIDE_BIN,options:r}]}},{key:"encodeFlat",value:function(){var n=[Zn.SIDE_BIN,this.leftEncode(),Zn.MIDDLE_BIN,this.rightEncode(),Zn.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),e}(tb.default);jl.default=ob});var _h=j(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});var sb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),jr=function i(e,t,n){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:i(o,t,n)}else{if("value"in r)return r.value;var s=r.get;return s===void 0?void 0:s.call(n)}},ab=Kn(),lb=Vl(),cb=db(lb);function db(i){return i&&i.__esModule?i:{default:i}}function ub(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function pb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function hb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var bh=function(e){var t=e.substr(0,12).split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r*3:n+r},0);return(10-t%10)%10},fb=function(i){hb(e,i);function e(t,n){ub(this,e),t.search(/^[0-9]{12}$/)!==-1&&(t+=bh(t));var r=pb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.lastChar=n.lastChar,r}return sb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===bh(this.data)}},{key:"leftText",value:function(){return jr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var n=this.data.substr(1,6),r=ab.EAN13_STRUCTURE[this.data[0]];return jr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,r)}},{key:"rightText",value:function(){return jr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var n=this.data.substr(7,6);return jr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRRRR")}},{key:"encodeGuarded",value:function(){var n=jr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(n.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(n.push({data:"00"}),n.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),n}}]),e}(cb.default);Ul.default=fb});var xh=j(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var mb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Ls=function i(e,t,n){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:i(o,t,n)}else{if("value"in r)return r.value;var s=r.get;return s===void 0?void 0:s.call(n)}},gb=Vl(),yb=vb(gb);function vb(i){return i&&i.__esModule?i:{default:i}}function bb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _b(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function wb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var wh=function(e){var t=e.substr(0,7).split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r:n+r*3},0);return(10-t%10)%10},xb=function(i){wb(e,i);function e(t,n){return bb(this,e),t.search(/^[0-9]{7}$/)!==-1&&(t+=wh(t)),_b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return mb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===wh(this.data)}},{key:"leftText",value:function(){return Ls(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var n=this.data.substr(0,4);return Ls(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,"LLLL")}},{key:"rightText",value:function(){return Ls(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var n=this.data.substr(4,4);return Ls(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRR")}}]),e}(yb.default);Wl.default=xb});var Sh=j($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});var Cb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Sb=Kn(),Pb=Qn(),Eb=Ch(Pb),Db=jt(),kb=Ch(Db);function Ch(i){return i&&i.__esModule?i:{default:i}}function Tb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Ib(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Ob(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Fb=function(e){var t=e.split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r*9:n+r*3},0);return t%10},Rb=function(i){Ob(e,i);function e(t,n){return Tb(this,e),Ib(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Cb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var n=Sb.EAN5_STRUCTURE[Fb(this.data)];return{data:"1011"+(0,Eb.default)(this.data,n,"01"),text:this.text}}}]),e}(kb.default);$l.default=Rb});var Eh=j(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});var Mb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Ab=Kn(),Bb=Qn(),Nb=Ph(Bb),Lb=jt(),zb=Ph(Lb);function Ph(i){return i&&i.__esModule?i:{default:i}}function Hb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function jb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Vb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Ub=function(i){Vb(e,i);function e(t,n){return Hb(this,e),jb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Mb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var n=Ab.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Nb.default)(this.data,n,"01"),text:this.text}}}]),e}(zb.default);ql.default=Ub});var Xl=j(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});var Wb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();zs.checksum=Gl;var $b=Qn(),Jn=Dh($b),qb=jt(),Gb=Dh(qb);function Dh(i){return i&&i.__esModule?i:{default:i}}function Xb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Yb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Kb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Qb=function(i){Kb(e,i);function e(t,n){Xb(this,e),t.search(/^[0-9]{11}$/)!==-1&&(t+=Gl(t));var r=Yb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.displayValue=n.displayValue,n.fontSize>n.width*10?r.fontSize=n.width*10:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return Wb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==Gl(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=(0,Jn.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,Jn.default)(this.data.substr(6,6),"RRRRRR"),n+="101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101"+(0,Jn.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,Jn.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),n.push({data:"01010",options:{height:this.guardHeight}}),n.push({data:(0,Jn.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,Jn.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),n}}]),e}(Gb.default);function Gl(i){var e=0,t;for(t=1;t<11;t+=2)e+=parseInt(i[t]);for(t=0;t<11;t+=2)e+=parseInt(i[t])*3;return(10-e%10)%10}zs.default=Qb});var Ih=j(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});var Zb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Jb=Qn(),e1=Th(Jb),t1=jt(),i1=Th(t1),n1=Xl();function Th(i){return i&&i.__esModule?i:{default:i}}function r1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Yl(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function o1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var s1=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],a1=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],l1=function(i){o1(e,i);function e(t,n){r1(this,e);var r=Yl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if(r.isValid=!1,t.search(/^[0-9]{6}$/)!==-1)r.middleDigits=t,r.upcA=kh(t,"0"),r.text=n.text||""+r.upcA[0]+t+r.upcA[r.upcA.length-1],r.isValid=!0;else if(t.search(/^[01][0-9]{7}$/)!==-1)if(r.middleDigits=t.substring(1,t.length-1),r.upcA=kh(r.middleDigits,t[0]),r.upcA[r.upcA.length-1]===t[t.length-1])r.isValid=!0;else return Yl(r);else return Yl(r);return r.displayValue=n.displayValue,n.fontSize>n.width*10?r.fontSize=n.width*10:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return Zb(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=this.encodeMiddleDigits(),n+="010101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101",options:{height:this.guardHeight}}),n.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),n.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),n}},{key:"encodeMiddleDigits",value:function(){var n=this.upcA[0],r=this.upcA[this.upcA.length-1],o=a1[parseInt(r)][parseInt(n)];return(0,e1.default)(this.middleDigits,o)}}]),e}(i1.default);function kh(i,e){for(var t=parseInt(i[i.length-1]),n=s1[t],r="",o=0,s=0;s<n.length;s++){var a=n[s];a==="X"?r+=i[o++]:r+=a}return r=""+e+r,""+r+(0,n1.checksum)(r)}Kl.default=l1});var Oh=j(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.UPCE=Tt.UPC=Tt.EAN2=Tt.EAN5=Tt.EAN8=Tt.EAN13=void 0;var c1=_h(),d1=er(c1),u1=xh(),p1=er(u1),h1=Sh(),f1=er(h1),m1=Eh(),g1=er(m1),y1=Xl(),v1=er(y1),b1=Ih(),_1=er(b1);function er(i){return i&&i.__esModule?i:{default:i}}Tt.EAN13=d1.default;Tt.EAN8=p1.default;Tt.EAN5=f1.default;Tt.EAN2=g1.default;Tt.UPC=v1.default;Tt.UPCE=_1.default});var Fh=j(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});var aT=Vr.START_BIN="1010",lT=Vr.END_BIN="11101",cT=Vr.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]});var Zl=j(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});var w1=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Hs=Fh(),x1=jt(),C1=S1(x1);function S1(i){return i&&i.__esModule?i:{default:i}}function P1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function E1(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function D1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var k1=function(i){D1(e,i);function e(){return P1(this,e),E1(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return w1(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var n=this,r=this.data.match(/.{2}/g).map(function(o){return n.encodePair(o)}).join("");return{data:Hs.START_BIN+r+Hs.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var r=Hs.BINARIES[n[1]];return Hs.BINARIES[n[0]].split("").map(function(o,s){return(o==="1"?"111":"1")+(r[s]==="1"?"000":"0")}).join("")}}]),e}(C1.default);Ql.default=k1});var Mh=j(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var T1=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),I1=Zl(),O1=F1(I1);function F1(i){return i&&i.__esModule?i:{default:i}}function R1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function M1(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function A1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Rh=function(e){var t=e.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,r,o){return n+r*(3-o%2*2)},0);return Math.ceil(t/10)*10-t},B1=function(i){A1(e,i);function e(t,n){return R1(this,e),t.search(/^[0-9]{13}$/)!==-1&&(t+=Rh(t)),M1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return T1(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===Rh(this.data)}}]),e}(O1.default);Jl.default=B1});var Bh=j(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.ITF14=tr.ITF=void 0;var N1=Zl(),L1=Ah(N1),z1=Mh(),H1=Ah(z1);function Ah(i){return i&&i.__esModule?i:{default:i}}tr.ITF=L1.default;tr.ITF14=H1.default});var ir=j(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var j1=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),V1=jt(),U1=W1(V1);function W1(i){return i&&i.__esModule?i:{default:i}}function $1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function q1(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function G1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var X1=function(i){G1(e,i);function e(t,n){return $1(this,e),q1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return j1(e,[{key:"encode",value:function(){for(var n="110",r=0;r<this.data.length;r++){var o=parseInt(this.data[r]),s=o.toString(2);s=Y1(s,4-s.length);for(var a=0;a<s.length;a++)n+=s[a]=="0"?"100":"110"}return n+="1001",{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(U1.default);function Y1(i,e){for(var t=0;t<e;t++)i="0"+i;return i}ec.default=X1});var Ur=j(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.mod10=K1;js.mod11=Q1;function K1(i){for(var e=0,t=0;t<i.length;t++){var n=parseInt(i[t]);(t+i.length)%2===0?e+=n:e+=n*2%10+Math.floor(n*2/10)}return(10-e%10)%10}function Q1(i){for(var e=0,t=[2,3,4,5,6,7],n=0;n<i.length;n++){var r=parseInt(i[i.length-1-n]);e+=t[n%t.length]*r}return(11-e%11)%11}});var Nh=j(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});var Z1=ir(),J1=t_(Z1),e_=Ur();function t_(i){return i&&i.__esModule?i:{default:i}}function i_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function n_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function r_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var o_=function(i){r_(e,i);function e(t,n){return i_(this,e),n_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,e_.mod10)(t),n))}return e}(J1.default);tc.default=o_});var Lh=j(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});var s_=ir(),a_=c_(s_),l_=Ur();function c_(i){return i&&i.__esModule?i:{default:i}}function d_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function u_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function p_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var h_=function(i){p_(e,i);function e(t,n){return d_(this,e),u_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,l_.mod11)(t),n))}return e}(a_.default);ic.default=h_});var Hh=j(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});var f_=ir(),m_=g_(f_),zh=Ur();function g_(i){return i&&i.__esModule?i:{default:i}}function y_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function v_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function b_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var __=function(i){b_(e,i);function e(t,n){return y_(this,e),t+=(0,zh.mod10)(t),t+=(0,zh.mod10)(t),v_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e}(m_.default);nc.default=__});var Vh=j(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var w_=ir(),x_=C_(w_),jh=Ur();function C_(i){return i&&i.__esModule?i:{default:i}}function S_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function P_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function E_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var D_=function(i){E_(e,i);function e(t,n){return S_(this,e),t+=(0,jh.mod11)(t),t+=(0,jh.mod10)(t),P_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e}(x_.default);rc.default=D_});var Uh=j(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.MSI1110=si.MSI1010=si.MSI11=si.MSI10=si.MSI=void 0;var k_=ir(),T_=Wr(k_),I_=Nh(),O_=Wr(I_),F_=Lh(),R_=Wr(F_),M_=Hh(),A_=Wr(M_),B_=Vh(),N_=Wr(B_);function Wr(i){return i&&i.__esModule?i:{default:i}}si.MSI=T_.default;si.MSI10=O_.default;si.MSI11=R_.default;si.MSI1010=A_.default;si.MSI1110=N_.default});var Wh=j(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.pharmacode=void 0;var L_=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),z_=jt(),H_=j_(z_);function j_(i){return i&&i.__esModule?i:{default:i}}function V_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function U_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function W_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var $_=function(i){W_(e,i);function e(t,n){V_(this,e);var r=U_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.number=parseInt(t,10),r}return L_(e,[{key:"encode",value:function(){for(var n=this.number,r="";!isNaN(n)&&n!=0;)n%2===0?(r="11100"+r,n=(n-2)/2):(r="100"+r,n=(n-1)/2);return r=r.slice(0,-2),{data:r,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(H_.default);Vs.pharmacode=$_});var $h=j(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.codabar=void 0;var q_=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),G_=jt(),X_=Y_(G_);function Y_(i){return i&&i.__esModule?i:{default:i}}function K_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Q_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Z_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var J_=function(i){Z_(e,i);function e(t,n){K_(this,e),t.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(t="A"+t+"A");var r=Q_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return q_(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var n=[],r=this.getEncodings(),o=0;o<this.data.length;o++)n.push(r[this.data.charAt(o)]),o!==this.data.length-1&&n.push("0");return{text:this.text,data:n.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}(X_.default);Us.codabar=J_});var qh=j(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.GenericBarcode=void 0;var ew=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),tw=jt(),iw=nw(tw);function nw(i){return i&&i.__esModule?i:{default:i}}function rw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function ow(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function sw(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var aw=function(i){sw(e,i);function e(t,n){return rw(this,e),ow(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return ew(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(iw.default);Ws.GenericBarcode=aw});var Xh=j(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var lw=Jp(),$s=gh(),nr=Oh(),Gh=Bh(),$r=Uh(),cw=Wh(),dw=$h(),uw=qh();oc.default={CODE39:lw.CODE39,CODE128:$s.CODE128,CODE128A:$s.CODE128A,CODE128B:$s.CODE128B,CODE128C:$s.CODE128C,EAN13:nr.EAN13,EAN8:nr.EAN8,EAN5:nr.EAN5,EAN2:nr.EAN2,UPC:nr.UPC,UPCE:nr.UPCE,ITF14:Gh.ITF14,ITF:Gh.ITF,MSI:$r.MSI,MSI10:$r.MSI10,MSI11:$r.MSI11,MSI1010:$r.MSI1010,MSI1110:$r.MSI1110,pharmacode:cw.pharmacode,codabar:dw.codabar,GenericBarcode:uw.GenericBarcode}});var qr=j(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});var pw=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i};sc.default=function(i,e){return pw({},i,e)}});var Yh=j(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.default=hw;function hw(i){var e=[];function t(n){if(Array.isArray(n))for(var r=0;r<n.length;r++)t(n[r]);else n.text=n.text||"",n.data=n.data||"",e.push(n)}return t(i),e}});var Kh=j(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.default=fw;function fw(i){return i.marginTop=i.marginTop||i.margin,i.marginBottom=i.marginBottom||i.margin,i.marginRight=i.marginRight||i.margin,i.marginLeft=i.marginLeft||i.margin,i}});var dc=j(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.default=mw;function mw(i){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in e)e.hasOwnProperty(t)&&(t=e[t],typeof i[t]=="string"&&(i[t]=parseInt(i[t],10)));return typeof i.displayValue=="string"&&(i.displayValue=i.displayValue!="false"),i}});var pc=j(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var gw={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};uc.default=gw});var Jh=j(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});var yw=dc(),vw=Zh(yw),bw=pc(),Qh=Zh(bw);function Zh(i){return i&&i.__esModule?i:{default:i}}function _w(i){var e={};for(var t in Qh.default)Qh.default.hasOwnProperty(t)&&(i.hasAttribute("jsbarcode-"+t.toLowerCase())&&(e[t]=i.getAttribute("jsbarcode-"+t.toLowerCase())),i.hasAttribute("data-"+t.toLowerCase())&&(e[t]=i.getAttribute("data-"+t.toLowerCase())));return e.value=i.getAttribute("jsbarcode-value")||i.getAttribute("data-value"),e=(0,vw.default)(e),e}hc.default=_w});var fc=j(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.getTotalWidthOfEncodings=ai.calculateEncodingAttributes=ai.getBarcodePadding=ai.getEncodingHeight=ai.getMaximumHeightOfEncodings=void 0;var ww=qr(),xw=Cw(ww);function Cw(i){return i&&i.__esModule?i:{default:i}}function ef(i,e){return e.height+(e.displayValue&&i.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function tf(i,e,t){if(t.displayValue&&e<i){if(t.textAlign=="center")return Math.floor((i-e)/2);if(t.textAlign=="left")return 0;if(t.textAlign=="right")return Math.floor(i-e)}return 0}function Sw(i,e,t){for(var n=0;n<i.length;n++){var r=i[n],o=(0,xw.default)(e,r.options),s;o.displayValue?s=Dw(r.text,o,t):s=0;var a=r.data.length*o.width;r.width=Math.ceil(Math.max(s,a)),r.height=ef(r,o),r.barcodePadding=tf(s,a,o)}}function Pw(i){for(var e=0,t=0;t<i.length;t++)e+=i[t].width;return e}function Ew(i){for(var e=0,t=0;t<i.length;t++)i[t].height>e&&(e=i[t].height);return e}function Dw(i,e,t){var n;if(t)n=t;else if(typeof document<"u")n=document.createElement("canvas").getContext("2d");else return 0;n.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var r=n.measureText(i);if(!r)return 0;var o=r.width;return o}ai.getMaximumHeightOfEncodings=Ew;ai.getEncodingHeight=ef;ai.getBarcodePadding=tf;ai.calculateEncodingAttributes=Sw;ai.getTotalWidthOfEncodings=Pw});var nf=j(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});var kw=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Tw=qr(),Iw=Ow(Tw),mc=fc();function Ow(i){return i&&i.__esModule?i:{default:i}}function Fw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Rw=function(){function i(e,t,n){Fw(this,i),this.canvas=e,this.encodings=t,this.options=n}return kw(i,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var n=(0,Iw.default)(this.options,this.encodings[t].options);this.drawCanvasBarcode(n,this.encodings[t]),this.drawCanvasText(n,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),(0,mc.calculateEncodingAttributes)(this.encodings,this.options,t);var n=(0,mc.getTotalWidthOfEncodings)(this.encodings),r=(0,mc.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=n+this.options.marginLeft+this.options.marginRight,this.canvas.height=r,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(t,n){var r=this.canvas.getContext("2d"),o=n.data,s;t.textPosition=="top"?s=t.marginTop+t.fontSize+t.textMargin:s=t.marginTop,r.fillStyle=t.lineColor;for(var a=0;a<o.length;a++){var l=a*t.width+n.barcodePadding;o[a]==="1"?r.fillRect(l,s,t.width,t.height):o[a]&&r.fillRect(l,s,t.width,t.height*o[a])}}},{key:"drawCanvasText",value:function(t,n){var r=this.canvas.getContext("2d"),o=t.fontOptions+" "+t.fontSize+"px "+t.font;if(t.displayValue){var s,a;t.textPosition=="top"?a=t.marginTop+t.fontSize-t.textMargin:a=t.height+t.textMargin+t.marginTop+t.fontSize,r.font=o,t.textAlign=="left"||n.barcodePadding>0?(s=0,r.textAlign="left"):t.textAlign=="right"?(s=n.width-1,r.textAlign="right"):(s=n.width/2,r.textAlign="center"),r.fillText(n.text,s,a)}}},{key:"moveCanvasDrawing",value:function(t){var n=this.canvas.getContext("2d");n.translate(t.width,0)}},{key:"restoreCanvas",value:function(){var t=this.canvas.getContext("2d");t.restore()}}]),i}();gc.default=Rw});var rf=j(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});var Mw=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Aw=qr(),Bw=Nw(Aw),yc=fc();function Nw(i){return i&&i.__esModule?i:{default:i}}function Lw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var qs="http://www.w3.org/2000/svg",zw=function(){function i(e,t,n){Lw(this,i),this.svg=e,this.encodings=t,this.options=n,this.document=n.xmlDocument||document}return Mw(i,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var r=this.encodings[n],o=(0,Bw.default)(this.options,r.options),s=this.createGroup(t,o.marginTop,this.svg);this.setGroupOptions(s,o),this.drawSvgBarcode(s,o,r),this.drawSVGText(s,o,r),t+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,yc.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,yc.getTotalWidthOfEncodings)(this.encodings),n=(0,yc.getMaximumHeightOfEncodings)(this.encodings),r=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(r,n),this.options.background&&this.drawRect(0,0,r,n,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(t,n,r){var o=r.data,s;n.textPosition=="top"?s=n.fontSize+n.textMargin:s=0;for(var a=0,l=0,c=0;c<o.length;c++)l=c*n.width+r.barcodePadding,o[c]==="1"?a++:a>0&&(this.drawRect(l-n.width*a,s,n.width*a,n.height,t),a=0);a>0&&this.drawRect(l-n.width*(a-1),s,n.width*a,n.height,t)}},{key:"drawSVGText",value:function(t,n,r){var o=this.document.createElementNS(qs,"text");if(n.displayValue){var s,a;o.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),n.textPosition=="top"?a=n.fontSize-n.textMargin:a=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||r.barcodePadding>0?(s=0,o.setAttribute("text-anchor","start")):n.textAlign=="right"?(s=r.width-1,o.setAttribute("text-anchor","end")):(s=r.width/2,o.setAttribute("text-anchor","middle")),o.setAttribute("x",s),o.setAttribute("y",a),o.appendChild(this.document.createTextNode(r.text)),t.appendChild(o)}}},{key:"setSvgAttributes",value:function(t,n){var r=this.svg;r.setAttribute("width",t+"px"),r.setAttribute("height",n+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+t+" "+n),r.setAttribute("xmlns",qs),r.setAttribute("version","1.1"),r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,n,r){var o=this.document.createElementNS(qs,"g");return o.setAttribute("transform","translate("+t+", "+n+")"),r.appendChild(o),o}},{key:"setGroupOptions",value:function(t,n){t.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(t,n,r,o,s){var a=this.document.createElementNS(qs,"rect");return a.setAttribute("x",t),a.setAttribute("y",n),a.setAttribute("width",r),a.setAttribute("height",o),s.appendChild(a),a}}]),i}();vc.default=zw});var of=j(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});var Hw=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();function jw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Vw=function(){function i(e,t,n){jw(this,i),this.object=e,this.encodings=t,this.options=n}return Hw(i,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),i}();bc.default=Vw});var sf=j(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});var Uw=nf(),Ww=_c(Uw),$w=rf(),qw=_c($w),Gw=of(),Xw=_c(Gw);function _c(i){return i&&i.__esModule?i:{default:i}}wc.default={CanvasRenderer:Ww.default,SVGRenderer:qw.default,ObjectRenderer:Xw.default}});var Pc=j(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});function xc(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Cc(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Sc(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Yw=function(i){Sc(e,i);function e(t,n){xc(this,e);var r=Cc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidInputException",r.symbology=t,r.input=n,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return e}(Error),Kw=function(i){Sc(e,i);function e(){xc(this,e);var t=Cc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="InvalidElementException",t.message="Not supported type to render on",t}return e}(Error),Qw=function(i){Sc(e,i);function e(){xc(this,e);var t=Cc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="NoElementException",t.message="No element to render on.",t}return e}(Error);Gr.InvalidInputException=Yw;Gr.InvalidElementException=Kw;Gr.NoElementException=Qw});var lf=j(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});var Zw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Jw=Jh(),Ec=af(Jw),ex=sf(),Xr=af(ex),tx=Pc();function af(i){return i&&i.__esModule?i:{default:i}}function Dc(i){if(typeof i=="string")return ix(i);if(Array.isArray(i)){for(var e=[],t=0;t<i.length;t++)e.push(Dc(i[t]));return e}else{if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLImageElement)return nx(i);if(i&&i.nodeName&&i.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&i instanceof SVGElement)return{element:i,options:(0,Ec.default)(i),renderer:Xr.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement)return{element:i,options:(0,Ec.default)(i),renderer:Xr.default.CanvasRenderer};if(i&&i.getContext)return{element:i,renderer:Xr.default.CanvasRenderer};if(i&&(typeof i>"u"?"undefined":Zw(i))==="object"&&!i.nodeName)return{element:i,renderer:Xr.default.ObjectRenderer};throw new tx.InvalidElementException}}function ix(i){var e=document.querySelectorAll(i);if(e.length!==0){for(var t=[],n=0;n<e.length;n++)t.push(Dc(e[n]));return t}}function nx(i){var e=document.createElement("canvas");return{element:e,options:(0,Ec.default)(i),renderer:Xr.default.CanvasRenderer,afterRender:function(){i.setAttribute("src",e.toDataURL())}}}kc.default=Dc});var cf=j(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});var rx=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();function ox(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var sx=function(){function i(e){ox(this,i),this.api=e}return rx(i,[{key:"handleCatch",value:function(t){if(t.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw t.message;else throw t;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(t){try{var n=t.apply(void 0,arguments);return this.api._options.valid(!0),n}catch(r){return this.handleCatch(r),this.api}}}]),i}();Tc.default=sx});var Fc=j((zT,gf)=>{"use strict";var ax=Xh(),dn=Zi(ax),lx=qr(),Yr=Zi(lx),cx=Yh(),uf=Zi(cx),dx=Kh(),df=Zi(dx),ux=lf(),px=Zi(ux),hx=dc(),fx=Zi(hx),mx=cf(),gx=Zi(mx),pf=Pc(),yx=pc(),hf=Zi(yx);function Zi(i){return i&&i.__esModule?i:{default:i}}var Oi=function(){},Gs=function(e,t,n){var r=new Oi;if(typeof e>"u")throw Error("No element to render on was provided.");return r._renderProperties=(0,px.default)(e),r._encodings=[],r._options=hf.default,r._errorHandler=new gx.default(r),typeof t<"u"&&(n=n||{},n.format||(n.format=mf()),r.options(n)[n.format](t,n).render()),r};Gs.getModule=function(i){return dn.default[i]};for(Ic in dn.default)dn.default.hasOwnProperty(Ic)&&vx(dn.default,Ic);var Ic;function vx(i,e){Oi.prototype[e]=Oi.prototype[e.toUpperCase()]=Oi.prototype[e.toLowerCase()]=function(t,n){var r=this;return r._errorHandler.wrapBarcodeCall(function(){n.text=typeof n.text>"u"?void 0:""+n.text;var o=(0,Yr.default)(r._options,n);o=(0,fx.default)(o);var s=i[e],a=ff(t,s,o);return r._encodings.push(a),r})}}function ff(i,e,t){i=""+i;var n=new e(i,t);if(!n.valid())throw new pf.InvalidInputException(n.constructor.name,i);var r=n.encode();r=(0,uf.default)(r);for(var o=0;o<r.length;o++)r[o].options=(0,Yr.default)(t,r[o].options);return r}function mf(){return dn.default.CODE128?"CODE128":Object.keys(dn.default)[0]}Oi.prototype.options=function(i){return this._options=(0,Yr.default)(this._options,i),this};Oi.prototype.blank=function(i){var e=new Array(i+1).join("0");return this._encodings.push({data:e}),this};Oi.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var i;for(var e in this._renderProperties){i=this._renderProperties[e];var t=(0,Yr.default)(this._options,i.options);t.format=="auto"&&(t.format=mf()),this._errorHandler.wrapBarcodeCall(function(){var n=t.value,r=dn.default[t.format.toUpperCase()],o=ff(n,r,t);Oc(i,o,t)})}}};Oi.prototype.render=function(){if(!this._renderProperties)throw new pf.NoElementException;if(Array.isArray(this._renderProperties))for(var i=0;i<this._renderProperties.length;i++)Oc(this._renderProperties[i],this._encodings,this._options);else Oc(this._renderProperties,this._encodings,this._options);return this};Oi.prototype._defaults=hf.default;function Oc(i,e,t){e=(0,uf.default)(e);for(var n=0;n<e.length;n++)e[n].options=(0,Yr.default)(t,e[n].options),(0,df.default)(e[n].options);(0,df.default)(t);var r=i.renderer,o=new r(i.element,e,t);o.render(),i.afterRender&&i.afterRender()}typeof window<"u"&&(window.JsBarcode=Gs);typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(i,e){var t=[];return jQuery(this).each(function(){t.push(this)}),Gs(t,i,e)});gf.exports=Gs});var um=j((I3,dm)=>{dm.exports=function(){var e={},t=e._fns={};e.emit=function(s,a,l,c,d,u,g){var h=n(s);h.length&&r(s,h,[a,l,c,d,u,g])},e.on=function(s,a){t[s]||(t[s]=[]),t[s].push(a)},e.once=function(s,a){function l(){a.apply(this,arguments),e.off(s,l)}this.on(s,l)},e.off=function(s,a){var l=[];if(s&&a){var c=this._fns[s],d=0,u=c?c.length:0;for(d;d<u;d++)c[d]!==a&&l.push(c[d])}l.length?this._fns[s]=l:delete this._fns[s]};function n(o){var s=t[o]?t[o]:[],a=o.indexOf(":"),l=a===-1?[o]:[o.substring(0,a),o.substring(a+1)],c=Object.keys(t),d=0,u=c.length;for(d;d<u;d++){var g=c[d];if(g==="*"&&(s=s.concat(t[g])),l.length===2&&l[0]===g){s=s.concat(t[g]);break}}return s}function r(o,s,a){var l=0,c=s.length;for(l;l<c&&s[l];l++)s[l].event=o,s[l].apply(s[l],a)}return e}});var la=j((F3,pm)=>{function nS(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}pm.exports=nS});var fm=j((R3,hm)=>{var rS=typeof global=="object"&&global&&global.Object===Object&&global;hm.exports=rS});var Jc=j((M3,mm)=>{var oS=fm(),sS=typeof self=="object"&&self&&self.Object===Object&&self,aS=oS||sS||Function("return this")();mm.exports=aS});var ym=j((A3,gm)=>{var lS=Jc(),cS=function(){return lS.Date.now()};gm.exports=cS});var bm=j((B3,vm)=>{var dS=/\s/;function uS(i){for(var e=i.length;e--&&dS.test(i.charAt(e)););return e}vm.exports=uS});var wm=j((N3,_m)=>{var pS=bm(),hS=/^\s+/;function fS(i){return i&&i.slice(0,pS(i)+1).replace(hS,"")}_m.exports=fS});var ed=j((L3,xm)=>{var mS=Jc(),gS=mS.Symbol;xm.exports=gS});var Em=j((z3,Pm)=>{var Cm=ed(),Sm=Object.prototype,yS=Sm.hasOwnProperty,vS=Sm.toString,no=Cm?Cm.toStringTag:void 0;function bS(i){var e=yS.call(i,no),t=i[no];try{i[no]=void 0;var n=!0}catch{}var r=vS.call(i);return n&&(e?i[no]=t:delete i[no]),r}Pm.exports=bS});var km=j((H3,Dm)=>{var _S=Object.prototype,wS=_S.toString;function xS(i){return wS.call(i)}Dm.exports=xS});var Fm=j((j3,Om)=>{var Tm=ed(),CS=Em(),SS=km(),PS="[object Null]",ES="[object Undefined]",Im=Tm?Tm.toStringTag:void 0;function DS(i){return i==null?i===void 0?ES:PS:Im&&Im in Object(i)?CS(i):SS(i)}Om.exports=DS});var Mm=j((V3,Rm)=>{function kS(i){return i!=null&&typeof i=="object"}Rm.exports=kS});var Bm=j((U3,Am)=>{var TS=Fm(),IS=Mm(),OS="[object Symbol]";function FS(i){return typeof i=="symbol"||IS(i)&&TS(i)==OS}Am.exports=FS});var Hm=j((W3,zm)=>{var RS=wm(),Nm=la(),MS=Bm(),Lm=NaN,AS=/^[-+]0x[0-9a-f]+$/i,BS=/^0b[01]+$/i,NS=/^0o[0-7]+$/i,LS=parseInt;function zS(i){if(typeof i=="number")return i;if(MS(i))return Lm;if(Nm(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Nm(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=RS(i);var t=BS.test(i);return t||NS.test(i)?LS(i.slice(2),t?2:8):AS.test(i)?Lm:+i}zm.exports=zS});var id=j(($3,Vm)=>{var HS=la(),td=ym(),jm=Hm(),jS="Expected a function",VS=Math.max,US=Math.min;function WS(i,e,t){var n,r,o,s,a,l,c=0,d=!1,u=!1,g=!0;if(typeof i!="function")throw new TypeError(jS);e=jm(e)||0,HS(t)&&(d=!!t.leading,u="maxWait"in t,o=u?VS(jm(t.maxWait)||0,e):o,g="trailing"in t?!!t.trailing:g);function h(b){var w=n,S=r;return n=r=void 0,c=b,s=i.apply(S,w),s}function _(b){return c=b,a=setTimeout(M,e),d?h(b):s}function P(b){var w=b-l,S=b-c,A=e-w;return u?US(A,o-S):A}function L(b){var w=b-l,S=b-c;return l===void 0||w>=e||w<0||u&&S>=o}function M(){var b=td();if(L(b))return W(b);a=setTimeout(M,P(b))}function W(b){return a=void 0,g&&n?h(b):(n=r=void 0,s)}function de(){a!==void 0&&clearTimeout(a),c=0,n=l=r=a=void 0}function oe(){return a===void 0?s:W(td())}function ee(){var b=td(),w=L(b);if(n=arguments,r=this,l=b,w){if(a===void 0)return _(l);if(u)return clearTimeout(a),a=setTimeout(M,e),h(l)}return a===void 0&&(a=setTimeout(M,e)),s}return ee.cancel=de,ee.flush=oe,ee}Vm.exports=WS});var Wm=j((q3,Um)=>{var $S=id(),qS=la(),GS="Expected a function";function XS(i,e,t){var n=!0,r=!0;if(typeof i!="function")throw new TypeError(GS);return qS(t)&&(n="leading"in t?!!t.leading:n,r="trailing"in t?!!t.trailing:r),$S(i,e,{leading:n,maxWait:e,trailing:r})}Um.exports=XS});var oo=j((lF,Qm)=>{"use strict";Qm.exports=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let t=e<0,n=Math.abs(e);if(t&&(n=-n),n===0)return"0 B";let r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.min(Math.floor(Math.log(n)/Math.log(1024)),r.length-1),s=Number(n/1024**o),a=r[o];return`${s>=10||s%1===0?Math.round(s):s.toFixed(1)} ${a}`}});var eg=j((cF,Jm)=>{"use strict";function Zm(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}Zm.prototype.match=function(i){var e=!0,t=this.parts,n,r=t.length,o;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)e=!1;else{for(o=(i||"").split(this.separator),n=0;e&&n<r;n++)t[n]!=="*"&&(n<o.length?e=t[n]===o[n]:e=!1);e=e&&o}else if(typeof i.splice=="function")for(e=[],n=i.length;n--;)this.match(i[n])&&(e[e.length]=i[n]);else if(typeof i=="object"){e={};for(var s in i)this.match(s)&&(e[s]=i[s])}return e};Jm.exports=function(i,e,t){var n=new Zm(i,t||/[\/\.]/);return typeof e<"u"?n.match(e):n}});var ig=j((dF,tg)=>{var eP=eg(),tP=/[\/\+\.]/;tg.exports=function(i,e){function t(n){var r=eP(n,i,tP);return r&&r.length>=2}return e?t(e.split(";")[0]):t}});var vt=j(($F,wa)=>{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var r="",o=0;o<arguments.length;o++){var s=arguments[o];s&&(r=n(r,t(s)))}return r}function t(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return e.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var o="";for(var s in r)i.call(r,s)&&r[s]&&(o=n(o,s));return o}function n(r,o){return o?r?r+" "+o:r+o:r}typeof wa<"u"&&wa.exports?(e.default=e,wa.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var C0=j((KM,au)=>{"use strict";var I2=Object.prototype.hasOwnProperty,_t="~";function Bo(){}Object.create&&(Bo.prototype=Object.create(null),new Bo().__proto__||(_t=!1));function O2(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function x0(i,e,t,n,r){if(typeof t!="function")throw new TypeError("The listener must be a function");var o=new O2(t,n||i,r),s=_t?_t+e:e;return i._events[s]?i._events[s].fn?i._events[s]=[i._events[s],o]:i._events[s].push(o):(i._events[s]=o,i._eventsCount++),i}function Ha(i,e){--i._eventsCount===0?i._events=new Bo:delete i._events[e]}function mt(){this._events=new Bo,this._eventsCount=0}mt.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)I2.call(t,n)&&e.push(_t?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};mt.prototype.listeners=function(e){var t=_t?_t+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,s=new Array(o);r<o;r++)s[r]=n[r].fn;return s};mt.prototype.listenerCount=function(e){var t=_t?_t+e:e,n=this._events[t];return n?n.fn?1:n.length:0};mt.prototype.emit=function(e,t,n,r,o,s){var a=_t?_t+e:e;if(!this._events[a])return!1;var l=this._events[a],c=arguments.length,d,u;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,r),!0;case 5:return l.fn.call(l.context,t,n,r,o),!0;case 6:return l.fn.call(l.context,t,n,r,o,s),!0}for(u=1,d=new Array(c-1);u<c;u++)d[u-1]=arguments[u];l.fn.apply(l.context,d)}else{var g=l.length,h;for(u=0;u<g;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,n);break;case 4:l[u].fn.call(l[u].context,t,n,r);break;default:if(!d)for(h=1,d=new Array(c-1);h<c;h++)d[h-1]=arguments[h];l[u].fn.apply(l[u].context,d)}}return!0};mt.prototype.on=function(e,t,n){return x0(this,e,t,n,!1)};mt.prototype.once=function(e,t,n){return x0(this,e,t,n,!0)};mt.prototype.removeListener=function(e,t,n,r){var o=_t?_t+e:e;if(!this._events[o])return this;if(!t)return Ha(this,o),this;var s=this._events[o];if(s.fn)s.fn===t&&(!r||s.once)&&(!n||s.context===n)&&Ha(this,o);else{for(var a=0,l=[],c=s.length;a<c;a++)(s[a].fn!==t||r&&!s[a].once||n&&s[a].context!==n)&&l.push(s[a]);l.length?this._events[o]=l.length===1?l[0]:l:Ha(this,o)}return this};mt.prototype.removeAllListeners=function(e){var t;return e?(t=_t?_t+e:e,this._events[t]&&Ha(this,t)):(this._events=new Bo,this._eventsCount=0),this};mt.prototype.off=mt.prototype.removeListener;mt.prototype.addListener=mt.prototype.on;mt.prefixed=_t;mt.EventEmitter=mt;typeof au<"u"&&(au.exports=mt)});var py=j((Vu,Uu)=>{(function(i,e){typeof Vu=="object"&&typeof Uu<"u"?Uu.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=e())})(Vu,function(){"use strict";function i(F,C){var k=Object.keys(F);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(F);C&&(T=T.filter(function(R){return Object.getOwnPropertyDescriptor(F,R).enumerable})),k.push.apply(k,T)}return k}function e(F){for(var C=1;C<arguments.length;C++){var k=arguments[C]!=null?arguments[C]:{};C%2?i(Object(k),!0).forEach(function(T){o(F,T,k[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(F,Object.getOwnPropertyDescriptors(k)):i(Object(k)).forEach(function(T){Object.defineProperty(F,T,Object.getOwnPropertyDescriptor(k,T))})}return F}function t(F,C){if(!(F instanceof C))throw new TypeError("Cannot call a class as a function")}function n(F,C){for(var k=0;k<C.length;k++){var T=C[k];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(F,l(T.key),T)}}function r(F,C,k){return C&&n(F.prototype,C),k&&n(F,k),Object.defineProperty(F,"prototype",{writable:!1}),F}function o(F,C,k){return C=l(C),C in F?Object.defineProperty(F,C,{value:k,enumerable:!0,configurable:!0,writable:!0}):F[C]=k,F}function s(){return s=Object.assign?Object.assign.bind():function(F){for(var C=1;C<arguments.length;C++){var k=arguments[C];for(var T in k)Object.prototype.hasOwnProperty.call(k,T)&&(F[T]=k[T])}return F},s.apply(this,arguments)}function a(F,C){if(typeof F!="object"||F===null)return F;var k=F[Symbol.toPrimitive];if(k!==void 0){var T=k.call(F,C||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(F)}function l(F){var C=a(F,"string");return typeof C=="symbol"?C:String(C)}var c={exports:{}};(function(F){typeof window>"u"||function(C){var k=C.HTMLCanvasElement&&C.HTMLCanvasElement.prototype,T=C.Blob&&function(){try{return!!new Blob}catch{return!1}}(),R=T&&C.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),V=C.BlobBuilder||C.WebKitBlobBuilder||C.MozBlobBuilder||C.MSBlobBuilder,ie=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,G=(T||V)&&C.atob&&C.ArrayBuffer&&C.Uint8Array&&function($){var Y,ne,re,ge,Z,J,be,_e,Ct;if(Y=$.match(ie),!Y)throw new Error("invalid data URI");for(ne=Y[2]?Y[1]:"text/plain"+(Y[3]||";charset=US-ASCII"),re=!!Y[4],ge=$.slice(Y[0].length),re?Z=atob(ge):Z=decodeURIComponent(ge),J=new ArrayBuffer(Z.length),be=new Uint8Array(J),_e=0;_e<Z.length;_e+=1)be[_e]=Z.charCodeAt(_e);return T?new Blob([R?be:J],{type:ne}):(Ct=new V,Ct.append(J),Ct.getBlob(ne))};C.HTMLCanvasElement&&!k.toBlob&&(k.mozGetAsFile?k.toBlob=function($,Y,ne){var re=this;setTimeout(function(){ne&&k.toDataURL&&G?$(G(re.toDataURL(Y,ne))):$(re.mozGetAsFile("blob",Y))})}:k.toDataURL&&G&&(k.msToBlob?k.toBlob=function($,Y,ne){var re=this;setTimeout(function(){(Y&&Y!=="image/png"||ne)&&k.toDataURL&&G?$(G(re.toDataURL(Y,ne))):$(re.msToBlob(Y))})}:k.toBlob=function($,Y,ne){var re=this;setTimeout(function(){$(G(re.toDataURL(Y,ne)))})})),F.exports?F.exports=G:C.dataURLtoBlob=G}(window)})(c);var d=c.exports,u=function(C){return typeof Blob>"u"?!1:C instanceof Blob||Object.prototype.toString.call(C)==="[object Blob]"},g={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},h=typeof window<"u"&&typeof window.document<"u",_=h?window:{},P=function(C){return C>0&&C<1/0},L=Array.prototype.slice;function M(F){return Array.from?Array.from(F):L.call(F)}var W=/^image\/.+$/;function de(F){return W.test(F)}function oe(F){var C=de(F)?F.substr(6):"";return C==="jpeg"&&(C="jpg"),".".concat(C)}var ee=String.fromCharCode;function b(F,C,k){var T="",R;for(k+=C,R=C;R<k;R+=1)T+=ee(F.getUint8(R));return T}var w=_.btoa;function S(F,C){for(var k=[],T=8192,R=new Uint8Array(F);R.length>0;)k.push(ee.apply(null,M(R.subarray(0,T)))),R=R.subarray(T);return"data:".concat(C,";base64,").concat(w(k.join("")))}function A(F){var C=new DataView(F),k;try{var T,R,V;if(C.getUint8(0)===255&&C.getUint8(1)===216)for(var ie=C.byteLength,G=2;G+1<ie;){if(C.getUint8(G)===255&&C.getUint8(G+1)===225){R=G;break}G+=1}if(R){var $=R+4,Y=R+10;if(b(C,$,4)==="Exif"){var ne=C.getUint16(Y);if(T=ne===18761,(T||ne===19789)&&C.getUint16(Y+2,T)===42){var re=C.getUint32(Y+4,T);re>=8&&(V=Y+re)}}}if(V){var ge=C.getUint16(V,T),Z,J;for(J=0;J<ge;J+=1)if(Z=V+J*12+2,C.getUint16(Z,T)===274){Z+=8,k=C.getUint16(Z,T),C.setUint16(Z,1,T);break}}}catch{k=1}return k}function z(F){var C=0,k=1,T=1;switch(F){case 2:k=-1;break;case 3:C=-180;break;case 4:T=-1;break;case 5:C=90,T=-1;break;case 6:C=90;break;case 7:C=90,k=-1;break;case 8:C=-90;break}return{rotate:C,scaleX:k,scaleY:T}}var K=/\.\d*(?:0|9){12}\d*$/;function ve(F){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return K.test(F)?Math.round(F*C)/C:F}function Ne(F){var C=F.aspectRatio,k=F.height,T=F.width,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",V=P(T),ie=P(k);if(V&&ie){var G=k*C;(R==="contain"||R==="none")&&G>T||R==="cover"&&G<T?k=T/C:T=k*C}else V?k=T/C:ie&&(T=k*C);return{width:T,height:k}}function Pe(F){for(var C=M(new Uint8Array(F)),k=C.length,T=[],R=0;R+3<k;){var V=C[R],ie=C[R+1];if(V===255&&ie===218)break;if(V===255&&ie===216)R+=2;else{var G=C[R+2]*256+C[R+3],$=R+G+2,Y=C.slice(R,$);T.push(Y),R=$}}return T.reduce(function(ne,re){return re[0]===255&&re[1]===225?ne.concat(re):ne},[])}function Se(F,C){var k=M(new Uint8Array(F));if(k[2]!==255||k[3]!==224)return F;var T=k[4]*256+k[5],R=[255,216].concat(C,k.slice(4+T));return new Uint8Array(R)}var Q=_.ArrayBuffer,Le=_.FileReader,te=_.URL||_.webkitURL,Mt=/\.\w+$/,he=_.Compressor,X=function(){function F(C,k){t(this,F),this.file=C,this.exif=[],this.image=new Image,this.options=e(e({},g),k),this.aborted=!1,this.result=null,this.init()}return r(F,[{key:"init",value:function(){var k=this,T=this.file,R=this.options;if(!u(T)){this.fail(new Error("The first argument must be a File or Blob object."));return}var V=T.type;if(!de(V)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!te||!Le){this.fail(new Error("The current browser does not support image compression."));return}Q||(R.checkOrientation=!1,R.retainExif=!1);var ie=V==="image/jpeg",G=ie&&R.checkOrientation,$=ie&&R.retainExif;if(te&&!G&&!$)this.load({url:te.createObjectURL(T)});else{var Y=new Le;this.reader=Y,Y.onload=function(ne){var re=ne.target,ge=re.result,Z={},J=1;G&&(J=A(ge),J>1&&s(Z,z(J))),$&&(k.exif=Pe(ge)),G||$?!te||J>1?Z.url=S(ge,V):Z.url=te.createObjectURL(T):Z.url=ge,k.load(Z)},Y.onabort=function(){k.fail(new Error("Aborted to read the image with FileReader."))},Y.onerror=function(){k.fail(new Error("Failed to read the image with FileReader."))},Y.onloadend=function(){k.reader=null},G||$?Y.readAsArrayBuffer(T):Y.readAsDataURL(T)}}},{key:"load",value:function(k){var T=this,R=this.file,V=this.image;V.onload=function(){T.draw(e(e({},k),{},{naturalWidth:V.naturalWidth,naturalHeight:V.naturalHeight}))},V.onabort=function(){T.fail(new Error("Aborted to load the image."))},V.onerror=function(){T.fail(new Error("Failed to load the image."))},_.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(_.navigator.userAgent)&&(V.crossOrigin="anonymous"),V.alt=R.name,V.src=k.url}},{key:"draw",value:function(k){var T=this,R=k.naturalWidth,V=k.naturalHeight,ie=k.rotate,G=ie===void 0?0:ie,$=k.scaleX,Y=$===void 0?1:$,ne=k.scaleY,re=ne===void 0?1:ne,ge=this.file,Z=this.image,J=this.options,be=document.createElement("canvas"),_e=be.getContext("2d"),Ct=Math.abs(G)%180===90,At=(J.resize==="contain"||J.resize==="cover")&&P(J.width)&&P(J.height),je=Math.max(J.maxWidth,0)||1/0,St=Math.max(J.maxHeight,0)||1/0,Te=Math.max(J.minWidth,0)||0,st=Math.max(J.minHeight,0)||0,at=R/V,Re=J.width,Ze=J.height;if(Ct){var ki=[St,je];je=ki[0],St=ki[1];var Bt=[st,Te];Te=Bt[0],st=Bt[1];var Wi=[Ze,Re];Re=Wi[0],Ze=Wi[1]}At&&(at=Re/Ze);var Tr=Ne({aspectRatio:at,width:je,height:St},"contain");je=Tr.width,St=Tr.height;var Xu=Ne({aspectRatio:at,width:Te,height:st},"cover");if(Te=Xu.width,st=Xu.height,At){var Yu=Ne({aspectRatio:at,width:Re,height:Ze},J.resize);Re=Yu.width,Ze=Yu.height}else{var Ku=Ne({aspectRatio:at,width:Re,height:Ze}),Qu=Ku.width;Re=Qu===void 0?R:Qu;var Zu=Ku.height;Ze=Zu===void 0?V:Zu}Re=Math.floor(ve(Math.min(Math.max(Re,Te),je))),Ze=Math.floor(ve(Math.min(Math.max(Ze,st),St)));var By=-Re/2,Ny=-Ze/2,Ly=Re,zy=Ze,il=[];if(At){var Ju=0,ep=0,nl=R,rl=V,tp=Ne({aspectRatio:at,width:R,height:V},{contain:"cover",cover:"contain"}[J.resize]);nl=tp.width,rl=tp.height,Ju=(R-nl)/2,ep=(V-rl)/2,il.push(Ju,ep,nl,rl)}if(il.push(By,Ny,Ly,zy),Ct){var ip=[Ze,Re];Re=ip[0],Ze=ip[1]}be.width=Re,be.height=Ze,de(J.mimeType)||(J.mimeType=ge.type);var np="transparent";ge.size>J.convertSize&&J.convertTypes.indexOf(J.mimeType)>=0&&(J.mimeType="image/jpeg");var rp=J.mimeType==="image/jpeg";if(rp&&(np="#fff"),_e.fillStyle=np,_e.fillRect(0,0,Re,Ze),J.beforeDraw&&J.beforeDraw.call(this,_e,be),!this.aborted&&(_e.save(),_e.translate(Re/2,Ze/2),_e.rotate(G*Math.PI/180),_e.scale(Y,re),_e.drawImage.apply(_e,[Z].concat(il)),_e.restore(),J.drew&&J.drew.call(this,_e,be),!this.aborted)){var op=function(Ir){if(!T.aborted){var sp=function(Or){return T.done({naturalWidth:R,naturalHeight:V,result:Or})};if(Ir&&rp&&J.retainExif&&T.exif&&T.exif.length>0){var ap=function(Or){return sp(d(S(Se(Or,T.exif),J.mimeType)))};if(Ir.arrayBuffer)Ir.arrayBuffer().then(ap).catch(function(){T.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var Ln=new Le;T.reader=Ln,Ln.onload=function(ol){var Or=ol.target;ap(Or.result)},Ln.onabort=function(){T.fail(new Error("Aborted to read the compressed image with FileReader."))},Ln.onerror=function(){T.fail(new Error("Failed to read the compressed image with FileReader."))},Ln.onloadend=function(){T.reader=null},Ln.readAsArrayBuffer(Ir)}}else sp(Ir)}};be.toBlob?be.toBlob(op,J.mimeType,J.quality):op(d(be.toDataURL(J.mimeType,J.quality)))}}},{key:"done",value:function(k){var T=k.naturalWidth,R=k.naturalHeight,V=k.result,ie=this.file,G=this.image,$=this.options;if(te&&G.src.indexOf("blob:")===0&&te.revokeObjectURL(G.src),V)if($.strict&&!$.retainExif&&V.size>ie.size&&$.mimeType===ie.type&&!($.width>T||$.height>R||$.minWidth>T||$.minHeight>R||$.maxWidth<T||$.maxHeight<R))V=ie;else{var Y=new Date;V.lastModified=Y.getTime(),V.lastModifiedDate=Y,V.name=ie.name,V.name&&V.type!==ie.type&&(V.name=V.name.replace(Mt,oe(V.type)))}else V=ie;this.result=V,$.success&&$.success.call(this,V)}},{key:"fail",value:function(k){var T=this.options;if(T.error)T.error.call(this,k);else throw k}},{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=he,F}},{key:"setDefaults",value:function(k){s(g,k)}}]),F}();return X})});var gy=j(($u,qu)=>{((i,e)=>{typeof define=="function"&&define.amd?define([],e):typeof qu=="object"&&typeof $u<"u"?qu.exports=e():i.Papa=e()})($u,function i(){var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},t,n=!e.document&&!!e.postMessage,r=e.IS_PAPA_WORKER||!1,o={},s=0,a={};function l(b){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(w){var S=de(w);S.chunkSize=parseInt(S.chunkSize),w.step||w.chunk||(S.chunkSize=null),this._handle=new h(S),(this._handle.streamer=this)._config=S}.call(this,b),this.parseChunk=function(w,S){var A=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<A){let K=this._config.newline;K||(z=this._config.quoteChar||'"',K=this._handle.guessLineEndings(w,z)),w=[...w.split(K).slice(A)].join(K)}this.isFirstChunk&&ee(this._config.beforeFirstChunk)&&(z=this._config.beforeFirstChunk(w))!==void 0&&(w=z),this.isFirstChunk=!1,this._halted=!1;var A=this._partialLine+w,z=(this._partialLine="",this._handle.parse(A,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=z.meta.cursor,A=(this._finished||(this._partialLine=A.substring(w-this._baseIndex),this._baseIndex=w),z&&z.data&&(this._rowCount+=z.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),r)e.postMessage({results:z,workerId:a.WORKER_ID,finished:A});else if(ee(this._config.chunk)&&!S){if(this._config.chunk(z,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=z=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(z.data),this._completeResults.errors=this._completeResults.errors.concat(z.errors),this._completeResults.meta=z.meta),this._completed||!A||!ee(this._config.complete)||z&&z.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),A||z&&z.meta.paused||this._nextChunk(),z}this._halted=!0},this._sendError=function(w){ee(this._config.error)?this._config.error(w):r&&this._config.error&&e.postMessage({workerId:a.WORKER_ID,error:w,finished:!1})}}function c(b){var w;(b=b||{}).chunkSize||(b.chunkSize=a.RemoteChunkSize),l.call(this,b),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(S){this._input=S,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(w=new XMLHttpRequest,this._config.withCredentials&&(w.withCredentials=this._config.withCredentials),n||(w.onload=oe(this._chunkLoaded,this),w.onerror=oe(this._chunkError,this)),w.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var S,A=this._config.downloadRequestHeaders;for(S in A)w.setRequestHeader(S,A[S])}var z;this._config.chunkSize&&(z=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+z));try{w.send(this._config.downloadRequestBody)}catch(K){this._chunkError(K.message)}n&&w.status===0&&this._chunkError()}},this._chunkLoaded=function(){w.readyState===4&&(w.status<200||400<=w.status?this._chunkError():(this._start+=this._config.chunkSize||w.responseText.length,this._finished=!this._config.chunkSize||this._start>=(S=>(S=S.getResponseHeader("Content-Range"))!==null?parseInt(S.substring(S.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(S){S=w.statusText||S,this._sendError(new Error(S))}}function d(b){(b=b||{}).chunkSize||(b.chunkSize=a.LocalChunkSize),l.call(this,b);var w,S,A=typeof FileReader<"u";this.stream=function(z){this._input=z,S=z.slice||z.webkitSlice||z.mozSlice,A?((w=new FileReader).onload=oe(this._chunkLoaded,this),w.onerror=oe(this._chunkError,this)):w=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var z=this._input,K=(this._config.chunkSize&&(K=Math.min(this._start+this._config.chunkSize,this._input.size),z=S.call(z,this._start,K)),w.readAsText(z,this._config.encoding));A||this._chunkLoaded({target:{result:K}})},this._chunkLoaded=function(z){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(z.target.result)},this._chunkError=function(){this._sendError(w.error)}}function u(b){var w;l.call(this,b=b||{}),this.stream=function(S){return w=S,this._nextChunk()},this._nextChunk=function(){var S,A;if(!this._finished)return S=this._config.chunkSize,w=S?(A=w.substring(0,S),w.substring(S)):(A=w,""),this._finished=!w,this.parseChunk(A)}}function g(b){l.call(this,b=b||{});var w=[],S=!0,A=!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(z){this._input=z,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){A&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):S=!0},this._streamData=oe(function(z){try{w.push(typeof z=="string"?z:z.toString(this._config.encoding)),S&&(S=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(K){this._streamError(K)}},this),this._streamError=oe(function(z){this._streamCleanUp(),this._sendError(z)},this),this._streamEnd=oe(function(){this._streamCleanUp(),A=!0,this._streamData("")},this),this._streamCleanUp=oe(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function h(b){var w,S,A,z,K=Math.pow(2,53),ve=-K,Ne=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Pe=/^((\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,Q=0,Le=0,te=!1,Mt=!1,he=[],X={data:[],errors:[],meta:{}};function F(R){return b.skipEmptyLines==="greedy"?R.join("").trim()==="":R.length===1&&R[0].length===0}function C(){if(X&&A&&(T("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),A=!1),b.skipEmptyLines&&(X.data=X.data.filter(function($){return!F($)})),k()){let $=function(Y,ne){ee(b.transformHeader)&&(Y=b.transformHeader(Y,ne)),he.push(Y)};var G=$;if(X)if(Array.isArray(X.data[0])){for(var R=0;k()&&R<X.data.length;R++)X.data[R].forEach($);X.data.splice(0,1)}else X.data.forEach($)}function V($,Y){for(var ne=b.header?{}:[],re=0;re<$.length;re++){var ge=re,Z=$[re],Z=((J,be)=>(_e=>(b.dynamicTypingFunction&&b.dynamicTyping[_e]===void 0&&(b.dynamicTyping[_e]=b.dynamicTypingFunction(_e)),(b.dynamicTyping[_e]||b.dynamicTyping)===!0))(J)?be==="true"||be==="TRUE"||be!=="false"&&be!=="FALSE"&&((_e=>{if(Ne.test(_e)&&(_e=parseFloat(_e),ve<_e&&_e<K))return 1})(be)?parseFloat(be):Pe.test(be)?new Date(be):be===""?null:be):be)(ge=b.header?re>=he.length?"__parsed_extra":he[re]:ge,Z=b.transform?b.transform(Z,ge):Z);ge==="__parsed_extra"?(ne[ge]=ne[ge]||[],ne[ge].push(Z)):ne[ge]=Z}return b.header&&(re>he.length?T("FieldMismatch","TooManyFields","Too many fields: expected "+he.length+" fields but parsed "+re,Le+Y):re<he.length&&T("FieldMismatch","TooFewFields","Too few fields: expected "+he.length+" fields but parsed "+re,Le+Y)),ne}var ie;X&&(b.header||b.dynamicTyping||b.transform)&&(ie=1,!X.data.length||Array.isArray(X.data[0])?(X.data=X.data.map(V),ie=X.data.length):X.data=V(X.data,0),b.header&&X.meta&&(X.meta.fields=he),Le+=ie)}function k(){return b.header&&he.length===0}function T(R,V,ie,G){R={type:R,code:V,message:ie},G!==void 0&&(R.row=G),X.errors.push(R)}ee(b.step)&&(z=b.step,b.step=function(R){X=R,k()?C():(C(),X.data.length!==0&&(Q+=R.data.length,b.preview&&Q>b.preview?S.abort():(X.data=X.data[0],z(X,Se))))}),this.parse=function(R,V,ie){var G=b.quoteChar||'"',G=(b.newline||(b.newline=this.guessLineEndings(R,G)),A=!1,b.delimiter?ee(b.delimiter)&&(b.delimiter=b.delimiter(R),X.meta.delimiter=b.delimiter):((G=(($,Y,ne,re,ge)=>{var Z,J,be,_e;ge=ge||[","," ","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var Ct=0;Ct<ge.length;Ct++){for(var At,je=ge[Ct],St=0,Te=0,st=0,at=(be=void 0,new P({comments:re,delimiter:je,newline:Y,preview:10}).parse($)),Re=0;Re<at.data.length;Re++)ne&&F(at.data[Re])?st++:(At=at.data[Re].length,Te+=At,be===void 0?be=At:0<At&&(St+=Math.abs(At-be),be=At));0<at.data.length&&(Te/=at.data.length-st),(J===void 0||St<=J)&&(_e===void 0||_e<Te)&&1.99<Te&&(J=St,Z=je,_e=Te)}return{successful:!!(b.delimiter=Z),bestDelimiter:Z}})(R,b.newline,b.skipEmptyLines,b.comments,b.delimitersToGuess)).successful?b.delimiter=G.bestDelimiter:(A=!0,b.delimiter=a.DefaultDelimiter),X.meta.delimiter=b.delimiter),de(b));return b.preview&&b.header&&G.preview++,w=R,S=new P(G),X=S.parse(w,V,ie),C(),te?{meta:{paused:!0}}:X||{meta:{paused:!1}}},this.paused=function(){return te},this.pause=function(){te=!0,S.abort(),w=ee(b.chunk)?"":w.substring(S.getCharIndex())},this.resume=function(){Se.streamer._halted?(te=!1,Se.streamer.parseChunk(w,!0)):setTimeout(Se.resume,3)},this.aborted=function(){return Mt},this.abort=function(){Mt=!0,S.abort(),X.meta.aborted=!0,ee(b.complete)&&b.complete(X),w=""},this.guessLineEndings=function($,G){$=$.substring(0,1048576);var G=new RegExp(_(G)+"([^]*?)"+_(G),"gm"),ie=($=$.replace(G,"")).split("\r"),G=$.split(`
2
2
  `),$=1<G.length&&G[0].length<ie[0].length;if(ie.length===1||$)return`
3
3
  `;for(var Y=0,ne=0;ne<ie.length;ne++)ie[ne][0]===`
4
4
  `&&Y++;return Y>=ie.length/2?`\r
5
- `:"\r"}}function _(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P(b){var w=(b=b||{}).delimiter,S=b.newline,A=b.comments,L=b.step,K=b.preview,ve=b.fastMode,Ne=null,Pe=b.quoteChar==null?'"':b.quoteChar,Se=Pe;if(b.escapeChar!==void 0&&(Se=b.escapeChar),(typeof w!="string"||-1<a.BAD_DELIMITERS.indexOf(w))&&(w=","),A===w)throw new Error("Comment character same as delimiter");A===!0?A="#":(typeof A!="string"||-1<a.BAD_DELIMITERS.indexOf(A))&&(A=!1),S!==`
5
+ `:"\r"}}function _(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P(b){var w=(b=b||{}).delimiter,S=b.newline,A=b.comments,z=b.step,K=b.preview,ve=b.fastMode,Ne=null,Pe=b.quoteChar==null?'"':b.quoteChar,Se=Pe;if(b.escapeChar!==void 0&&(Se=b.escapeChar),(typeof w!="string"||-1<a.BAD_DELIMITERS.indexOf(w))&&(w=","),A===w)throw new Error("Comment character same as delimiter");A===!0?A="#":(typeof A!="string"||-1<a.BAD_DELIMITERS.indexOf(A))&&(A=!1),S!==`
6
6
  `&&S!=="\r"&&S!==`\r
7
7
  `&&(S=`
8
- `);var Q=0,ze=!1;this.parse=function(te,Mt,he){if(typeof te!="string")throw new Error("Input must be a string");var X=te.length,F=w.length,C=S.length,k=A.length,T=ee(L),R=[],V=[],ie=[],G=Q=0;if(!te)return je();if(ve||ve!==!1&&te.indexOf(Pe)===-1){for(var $=te.split(S),Y=0;Y<$.length;Y++){if(ie=$[Y],Q+=ie.length,Y!==$.length-1)Q+=S.length;else if(he)return je();if(!A||ie.substring(0,k)!==A){if(T){if(R=[],be(ie.split(w)),St(),ze)return je()}else be(ie.split(w));if(K&&K<=Y)return R=R.slice(0,K),je(!0)}}return je()}for(var ne=te.indexOf(w,Q),re=te.indexOf(S,Q),ge=new RegExp(_(Se)+_(Pe),"g"),Z=te.indexOf(Pe,Q);;)if(te[Q]===Pe)for(Z=Q,Q++;;){if((Z=te.indexOf(Pe,Z+1))===-1)return he||V.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:R.length,index:Q}),Ct();if(Z===X-1)return Ct(te.substring(Q,Z).replace(ge,Pe));if(Pe===Se&&te[Z+1]===Se)Z++;else if(Pe===Se||Z===0||te[Z-1]!==Se){ne!==-1&&ne<Z+1&&(ne=te.indexOf(w,Z+1));var J=_e((re=re!==-1&&re<Z+1?te.indexOf(S,Z+1):re)===-1?ne:Math.min(ne,re));if(te.substr(Z+1+J,F)===w){ie.push(te.substring(Q,Z).replace(ge,Pe)),te[Q=Z+1+J+F]!==Pe&&(Z=te.indexOf(Pe,Q)),ne=te.indexOf(w,Q),re=te.indexOf(S,Q);break}if(J=_e(re),te.substring(Z+1+J,Z+1+J+C)===S){if(ie.push(te.substring(Q,Z).replace(ge,Pe)),At(Z+1+J+C),ne=te.indexOf(w,Q),Z=te.indexOf(Pe,Q),T&&(St(),ze))return je();if(K&&R.length>=K)return je(!0);break}V.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:R.length,index:Q}),Z++}}else if(A&&ie.length===0&&te.substring(Q,Q+k)===A){if(re===-1)return je();Q=re+C,re=te.indexOf(S,Q),ne=te.indexOf(w,Q)}else if(ne!==-1&&(ne<re||re===-1))ie.push(te.substring(Q,ne)),Q=ne+F,ne=te.indexOf(w,Q);else{if(re===-1)break;if(ie.push(te.substring(Q,re)),At(re+C),T&&(St(),ze))return je();if(K&&R.length>=K)return je(!0)}return Ct();function be(Te){R.push(Te),G=Q}function _e(Te){var st=0;return st=Te!==-1&&(Te=te.substring(Z+1,Te))&&Te.trim()===""?Te.length:st}function Ct(Te){return he||(Te===void 0&&(Te=te.substring(Q)),ie.push(Te),Q=X,be(ie),T&&St()),je()}function At(Te){Q=Te,be(ie),ie=[],re=te.indexOf(S,Q)}function je(Te){if(b.header&&!Mt&&R.length){var st=R[0],at={},Re=new Set(st);let Ze=!1;for(let ki=0;ki<st.length;ki++){let Bt=st[ki];if(at[Bt=ee(b.transformHeader)?b.transformHeader(Bt,ki):Bt]){let Wi,Tr=at[Bt];for(;Wi=Bt+"_"+Tr,Tr++,Re.has(Wi););Re.add(Wi),st[ki]=Wi,at[Bt]++,Ze=!0,(Ne=Ne===null?{}:Ne)[Wi]=Bt}else at[Bt]=1,st[ki]=Bt;Re.add(Bt)}Ze&&console.warn("Duplicate headers found and renamed.")}return{data:R,errors:V,meta:{delimiter:w,linebreak:S,aborted:ze,truncated:!!Te,cursor:G+(Mt||0),renamedHeaders:Ne}}}function St(){L(je()),R=[],V=[]}},this.abort=function(){ze=!0},this.getCharIndex=function(){return Q}}function z(b){var w=b.data,S=o[w.workerId],A=!1;if(w.error)S.userError(w.error,w.file);else if(w.results&&w.results.data){var L={abort:function(){A=!0,M(w.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:W,resume:W};if(ee(S.userStep)){for(var K=0;K<w.results.data.length&&(S.userStep({data:w.results.data[K],errors:w.results.errors,meta:w.results.meta},L),!A);K++);delete w.results}else ee(S.userChunk)&&(S.userChunk(w.results,L,w.file),delete w.results)}w.finished&&!A&&M(w.workerId,w.results)}function M(b,w){var S=o[b];ee(S.userComplete)&&S.userComplete(w),S.terminate(),delete o[b]}function W(){throw new Error("Not implemented.")}function de(b){if(typeof b!="object"||b===null)return b;var w,S=Array.isArray(b)?[]:{};for(w in b)S[w]=de(b[w]);return S}function oe(b,w){return function(){b.apply(w,arguments)}}function ee(b){return typeof b=="function"}return a.parse=function(b,w){var S=(w=w||{}).dynamicTyping||!1;if(ee(S)&&(w.dynamicTypingFunction=S,S={}),w.dynamicTyping=S,w.transform=!!ee(w.transform)&&w.transform,!w.worker||!a.WORKERS_SUPPORTED)return S=null,a.NODE_STREAM_INPUT,typeof b=="string"?(b=(A=>A.charCodeAt(0)!==65279?A:A.slice(1))(b),S=new(w.download?c:p)(w)):b.readable===!0&&ee(b.read)&&ee(b.on)?S=new g(w):(e.File&&b instanceof File||b instanceof Object)&&(S=new d(w)),S.stream(b);(S=(()=>{var A;return!!a.WORKERS_SUPPORTED&&(A=(()=>{var L=e.URL||e.webkitURL||null,K=i.toString();return a.BLOB_URL||(a.BLOB_URL=L.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; ","(",K,")();"],{type:"text/javascript"})))})(),(A=new e.Worker(A)).onmessage=z,A.id=s++,o[A.id]=A)})()).userStep=w.step,S.userChunk=w.chunk,S.userComplete=w.complete,S.userError=w.error,w.step=ee(w.step),w.chunk=ee(w.chunk),w.complete=ee(w.complete),w.error=ee(w.error),delete w.worker,S.postMessage({input:b,config:w,workerId:S.id})},a.unparse=function(b,w){var S=!1,A=!0,L=",",K=`\r
9
- `,ve='"',Ne=ve+ve,Pe=!1,Se=null,Q=!1,ze=((()=>{if(typeof w=="object"){if(typeof w.delimiter!="string"||a.BAD_DELIMITERS.filter(function(he){return w.delimiter.indexOf(he)!==-1}).length||(L=w.delimiter),typeof w.quotes!="boolean"&&typeof w.quotes!="function"&&!Array.isArray(w.quotes)||(S=w.quotes),typeof w.skipEmptyLines!="boolean"&&typeof w.skipEmptyLines!="string"||(Pe=w.skipEmptyLines),typeof w.newline=="string"&&(K=w.newline),typeof w.quoteChar=="string"&&(ve=w.quoteChar),typeof w.header=="boolean"&&(A=w.header),Array.isArray(w.columns)){if(w.columns.length===0)throw new Error("Option columns is empty");Se=w.columns}w.escapeChar!==void 0&&(Ne=w.escapeChar+ve),w.escapeFormulae instanceof RegExp?Q=w.escapeFormulae:typeof w.escapeFormulae=="boolean"&&w.escapeFormulae&&(Q=/^[=+\-@\t\r].*$/)}})(),new RegExp(_(ve),"g"));if(typeof b=="string"&&(b=JSON.parse(b)),Array.isArray(b)){if(!b.length||Array.isArray(b[0]))return te(null,b,Pe);if(typeof b[0]=="object")return te(Se||Object.keys(b[0]),b,Pe)}else if(typeof b=="object")return typeof b.data=="string"&&(b.data=JSON.parse(b.data)),Array.isArray(b.data)&&(b.fields||(b.fields=b.meta&&b.meta.fields||Se),b.fields||(b.fields=Array.isArray(b.data[0])?b.fields:typeof b.data[0]=="object"?Object.keys(b.data[0]):[]),Array.isArray(b.data[0])||typeof b.data[0]=="object"||(b.data=[b.data])),te(b.fields||[],b.data||[],Pe);throw new Error("Unable to serialize unrecognized input");function te(he,X,F){var C="",k=(typeof he=="string"&&(he=JSON.parse(he)),typeof X=="string"&&(X=JSON.parse(X)),Array.isArray(he)&&0<he.length),T=!Array.isArray(X[0]);if(k&&A){for(var R=0;R<he.length;R++)0<R&&(C+=L),C+=Mt(he[R],R);0<X.length&&(C+=K)}for(var V=0;V<X.length;V++){var ie=(k?he:X[V]).length,G=!1,$=k?Object.keys(X[V]).length===0:X[V].length===0;if(F&&!k&&(G=F==="greedy"?X[V].join("").trim()==="":X[V].length===1&&X[V][0].length===0),F==="greedy"&&k){for(var Y=[],ne=0;ne<ie;ne++){var re=T?he[ne]:ne;Y.push(X[V][re])}G=Y.join("").trim()===""}if(!G){for(var ge=0;ge<ie;ge++){0<ge&&!$&&(C+=L);var Z=k&&T?he[ge]:ge;C+=Mt(X[V][Z],ge)}V<X.length-1&&(!F||0<ie&&!$)&&(C+=K)}}return C}function Mt(he,X){var F,C;return he==null?"":he.constructor===Date?JSON.stringify(he).slice(1,25):(C=!1,Q&&typeof he=="string"&&Q.test(he)&&(he="'"+he,C=!0),F=he.toString().replace(ze,Ne),(C=C||S===!0||typeof S=="function"&&S(he,X)||Array.isArray(S)&&S[X]||((k,T)=>{for(var R=0;R<T.length;R++)if(-1<k.indexOf(T[R]))return!0;return!1})(F,a.BAD_DELIMITERS)||-1<F.indexOf(L)||F.charAt(0)===" "||F.charAt(F.length-1)===" ")?ve+F+ve:F)}},a.RECORD_SEP="",a.UNIT_SEP="",a.BYTE_ORDER_MARK="\uFEFF",a.BAD_DELIMITERS=["\r",`
10
- `,'"',a.BYTE_ORDER_MARK],a.WORKERS_SUPPORTED=!n&&!!e.Worker,a.NODE_STREAM_INPUT=1,a.LocalChunkSize=10485760,a.RemoteChunkSize=5242880,a.DefaultDelimiter=",",a.Parser=P,a.ParserHandle=h,a.NetworkStreamer=c,a.FileStreamer=d,a.StringStreamer=p,a.ReadableStreamStreamer=g,e.jQuery&&((t=e.jQuery).fn.parse=function(b){var w=b.config||{},S=[];return this.each(function(K){if(!(t(this).prop("tagName").toUpperCase()==="INPUT"&&t(this).attr("type").toLowerCase()==="file"&&e.FileReader)||!this.files||this.files.length===0)return!0;for(var ve=0;ve<this.files.length;ve++)S.push({file:this.files[ve],inputElem:this,instanceConfig:t.extend({},w)})}),A(),this;function A(){if(S.length===0)ee(b.complete)&&b.complete();else{var K,ve,Ne,Pe,Se=S[0];if(ee(b.before)){var Q=b.before(Se.file,Se.inputElem);if(typeof Q=="object"){if(Q.action==="abort")return K="AbortError",ve=Se.file,Ne=Se.inputElem,Pe=Q.reason,void(ee(b.error)&&b.error({name:K},ve,Ne,Pe));if(Q.action==="skip")return void L();typeof Q.config=="object"&&(Se.instanceConfig=t.extend(Se.instanceConfig,Q.config))}else if(Q==="skip")return void L()}var ze=Se.instanceConfig.complete;Se.instanceConfig.complete=function(te){ee(ze)&&ze(te,Se.file,Se.inputElem),L()},a.parse(Se.file,Se.instanceConfig)}}function L(){S.splice(0,1),A()}}),r&&(e.onmessage=function(b){b=b.data,a.WORKER_ID===void 0&&b&&(a.WORKER_ID=b.workerId),typeof b.input=="string"?e.postMessage({workerId:a.WORKER_ID,results:a.parse(b.input,b.config),finished:!0}):(e.File&&b.input instanceof File||b.input instanceof Object)&&(b=a.parse(b.input,b.config))&&e.postMessage({workerId:a.WORKER_ID,results:b,finished:!0})}),(c.prototype=Object.create(l.prototype)).constructor=c,(d.prototype=Object.create(l.prototype)).constructor=d,(p.prototype=Object.create(p.prototype)).constructor=p,(g.prototype=Object.create(l.prototype)).constructor=g,a})});var Oy=j((tl,Gu)=>{(function(e,t){typeof tl=="object"&&typeof Gu=="object"?Gu.exports=t():typeof define=="function"&&define.amd?define([],t):typeof tl=="object"?tl.printJS=t():e.printJS=t()})(window,function(){return function(i){var e={};function t(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return i[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=i,t.c=e,t.d=function(n,r,o){t.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:o})},t.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,r){if(r&1&&(n=t(n)),r&8||r&4&&typeof n=="object"&&n&&n.__esModule)return n;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),r&2&&typeof n!="string")for(var s in n)t.d(o,s,function(a){return n[a]}.bind(null,s));return o},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},t.p="",t(t.s=0)}({"./src/index.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/sass/index.scss"),r=t.n(n),o=t("./src/js/init.js"),s=o.default.init;typeof window<"u"&&(window.printJS=s),e.default=s},"./src/js/browser.js":function(i,e,t){"use strict";t.r(e);var n={isFirefox:function(){return typeof InstallTrigger<"u"},isIE:function(){return navigator.userAgent.indexOf("MSIE")!==-1||!!document.documentMode},isEdge:function(){return!n.isIE()&&!!window.StyleMedia},isChrome:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;return!!o.chrome},isSafari:function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||navigator.userAgent.toLowerCase().indexOf("safari")!==-1},isIOSChrome:function(){return navigator.userAgent.toLowerCase().indexOf("crios")!==-1}};e.default=n},"./src/js/functions.js":function(i,e,t){"use strict";t.r(e),t.d(e,"addWrapper",function(){return s}),t.d(e,"capitalizePrint",function(){return a}),t.d(e,"collectStyles",function(){return l}),t.d(e,"addHeader",function(){return d}),t.d(e,"cleanUp",function(){return p}),t.d(e,"isRawHTML",function(){return g});var n=t("./src/js/modal.js"),r=t("./src/js/browser.js");function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(P){return typeof P}:o=function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},o(h)}function s(h,_){var P="font-family:"+_.font+" !important; font-size: "+_.font_size+" !important; width:100%;";return'<div style="'+P+'">'+h+"</div>"}function a(h){return h.charAt(0).toUpperCase()+h.slice(1)}function l(h,_){for(var P=document.defaultView||window,z="",M=P.getComputedStyle(h,""),W=0;W<M.length;W++)(_.targetStyles.indexOf("*")!==-1||_.targetStyle.indexOf(M[W])!==-1||c(_.targetStyles,M[W]))&&M.getPropertyValue(M[W])&&(z+=M[W]+":"+M.getPropertyValue(M[W])+";");return z+="max-width: "+_.maxWidth+"px !important; font-size: "+_.font_size+" !important;",z}function c(h,_){for(var P=0;P<h.length;P++)if(o(_)==="object"&&_.indexOf(h[P])!==-1)return!0;return!1}function d(h,_){var P=document.createElement("div");if(g(_.header))P.innerHTML=_.header;else{var z=document.createElement("h1"),M=document.createTextNode(_.header);z.appendChild(M),z.setAttribute("style",_.headerStyle),P.appendChild(z)}h.insertBefore(P,h.childNodes[0])}function p(h){h.showModal&&n.default.close(),h.onLoadingEnd&&h.onLoadingEnd(),(h.showModal||h.onLoadingStart)&&window.URL.revokeObjectURL(h.printable);var _="mouseover";(r.default.isChrome()||r.default.isFirefox())&&(_="focus");var P=function z(){window.removeEventListener(_,z),h.onPrintDialogClose();var M=document.getElementById(h.frameId);M&&M.remove()};window.addEventListener(_,P)}function g(h){var _=new RegExp("<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>");return _.test(h)}},"./src/js/html.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/functions.js"),r=t("./src/js/print.js");function o(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(d){return typeof d}:o=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},o(l)}e.default={print:function(c,d){var p=a(c.printable)?c.printable:document.getElementById(c.printable);if(!p){window.console.error("Invalid HTML element id: "+c.printable);return}c.printableElement=s(p,c),c.header&&Object(n.addHeader)(c.printableElement,c),r.default.send(c,d)}};function s(l,c){for(var d=l.cloneNode(),p=Array.prototype.slice.call(l.childNodes),g=0;g<p.length;g++)if(c.ignoreElements.indexOf(p[g].id)===-1){var h=s(p[g],c);d.appendChild(h)}switch(c.scanStyles&&l.nodeType===1&&d.setAttribute("style",Object(n.collectStyles)(l,c)),l.tagName){case"SELECT":d.value=l.value;break;case"CANVAS":d.getContext("2d").drawImage(l,0,0);break}return d}function a(l){return o(l)==="object"&&l&&(l instanceof HTMLElement||l.nodeType===1)}},"./src/js/image.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/functions.js"),r=t("./src/js/print.js"),o=t("./src/js/browser.js");e.default={print:function(a,l){a.printable.constructor!==Array&&(a.printable=[a.printable]),a.printableElement=document.createElement("div"),a.printable.forEach(function(c){var d=document.createElement("img");if(d.setAttribute("style",a.imageStyle),d.src=c,o.default.isFirefox()){var p=d.src;d.src=p}var g=document.createElement("div");g.appendChild(d),a.printableElement.appendChild(g)}),a.header&&Object(n.addHeader)(a.printableElement,a),r.default.send(a,l)}}},"./src/js/init.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/browser.js"),r=t("./src/js/modal.js"),o=t("./src/js/pdf.js"),s=t("./src/js/html.js"),a=t("./src/js/raw-html.js"),l=t("./src/js/image.js"),c=t("./src/js/json.js");function d(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(_){return typeof _}:d=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},d(g)}var p=["pdf","html","image","json","raw-html"];e.default={init:function(){var h={printable:null,fallbackPrintable:null,type:"pdf",header:null,headerStyle:"font-weight: 300;",maxWidth:800,properties:null,gridHeaderStyle:"font-weight: bold; padding: 5px; border: 1px solid #dddddd;",gridStyle:"border: 1px solid lightgray; margin-bottom: -1px;",showModal:!1,onError:function(oe){throw oe},onLoadingStart:null,onLoadingEnd:null,onPrintDialogClose:function(){},onIncompatibleBrowser:function(){},modalMessage:"Retrieving Document...",frameId:"printJS",printableElement:null,documentTitle:"Document",targetStyle:["clear","display","width","min-width","height","min-height","max-height"],targetStyles:["border","box","break","text-decoration"],ignoreElements:[],repeatTableHeader:!0,css:null,style:null,scanStyles:!0,base64:!1,onPdfOpen:null,font:"TimesNewRoman",font_size:"12pt",honorMarginPadding:!0,honorColor:!1,imageStyle:"max-width: 100%;"},_=arguments[0];if(_===void 0)throw new Error("printJS expects at least 1 attribute.");switch(d(_)){case"string":h.printable=encodeURI(_),h.fallbackPrintable=h.printable,h.type=arguments[1]||h.type;break;case"object":h.printable=_.printable,h.fallbackPrintable=typeof _.fallbackPrintable<"u"?_.fallbackPrintable:h.printable,h.fallbackPrintable=h.base64?"data:application/pdf;base64,".concat(h.fallbackPrintable):h.fallbackPrintable;for(var P in h)P==="printable"||P==="fallbackPrintable"||(h[P]=typeof _[P]<"u"?_[P]:h[P]);break;default:throw new Error('Unexpected argument type! Expected "string" or "object", got '+d(_))}if(!h.printable)throw new Error("Missing printable information.");if(!h.type||typeof h.type!="string"||p.indexOf(h.type.toLowerCase())===-1)throw new Error("Invalid print type. Available types are: pdf, html, image and json.");h.showModal&&r.default.show(h),h.onLoadingStart&&h.onLoadingStart();var z=document.getElementById(h.frameId);z&&z.parentNode.removeChild(z);var M=document.createElement("iframe");switch(n.default.isFirefox()?M.setAttribute("style","width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0"):M.setAttribute("style","visibility: hidden; height: 0; width: 0; position: absolute; border: 0"),M.setAttribute("id",h.frameId),h.type!=="pdf"&&(M.srcdoc="<html><head><title>"+h.documentTitle+"</title>",h.css&&(Array.isArray(h.css)||(h.css=[h.css]),h.css.forEach(function(de){M.srcdoc+='<link rel="stylesheet" href="'+de+'">'})),M.srcdoc+="</head><body></body></html>"),h.type){case"pdf":if(n.default.isIE())try{console.info("Print.js doesn't support PDF printing in Internet Explorer.");var W=window.open(h.fallbackPrintable,"_blank");W.focus(),h.onIncompatibleBrowser()}catch(de){h.onError(de)}finally{h.showModal&&r.default.close(),h.onLoadingEnd&&h.onLoadingEnd()}else o.default.print(h,M);break;case"image":l.default.print(h,M);break;case"html":s.default.print(h,M);break;case"raw-html":a.default.print(h,M);break;case"json":c.default.print(h,M);break}}}},"./src/js/json.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/functions.js"),r=t("./src/js/print.js");function o(a){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(c){return typeof c}:o=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(a)}e.default={print:function(l,c){if(o(l.printable)!=="object")throw new Error("Invalid javascript data object (JSON).");if(typeof l.repeatTableHeader!="boolean")throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!l.properties||!Array.isArray(l.properties))throw new Error("Invalid properties array for your JSON data.");l.properties=l.properties.map(function(d){return{field:o(d)==="object"?d.field:d,displayName:o(d)==="object"?d.displayName:d,columnSize:o(d)==="object"&&d.columnSize?d.columnSize+";":100/l.properties.length+"%;"}}),l.printableElement=document.createElement("div"),l.header&&Object(n.addHeader)(l.printableElement,l),l.printableElement.innerHTML+=s(l),r.default.send(l,c)}};function s(a){var l=a.printable,c=a.properties,d='<table style="border-collapse: collapse; width: 100%;">';a.repeatTableHeader&&(d+="<thead>"),d+="<tr>";for(var p=0;p<c.length;p++)d+='<th style="width:'+c[p].columnSize+";"+a.gridHeaderStyle+'">'+Object(n.capitalizePrint)(c[p].displayName)+"</th>";d+="</tr>",a.repeatTableHeader&&(d+="</thead>"),d+="<tbody>";for(var g=0;g<l.length;g++){d+="<tr>";for(var h=0;h<c.length;h++){var _=l[g],P=c[h].field.split(".");if(P.length>1)for(var z=0;z<P.length;z++)_=_[P[z]];else _=_[c[h].field];d+='<td style="width:'+c[h].columnSize+a.gridStyle+'">'+_+"</td>"}d+="</tr>"}return d+="</tbody></table>",d}},"./src/js/modal.js":function(i,e,t){"use strict";t.r(e);var n={show:function(o){var s="font-family:sans-serif; display:table; text-align:center; font-weight:300; font-size:30px; left:0; top:0;position:fixed; z-index: 9990;color: #0460B5; width: 100%; height: 100%; background-color:rgba(255,255,255,.9);transition: opacity .3s ease;",a=document.createElement("div");a.setAttribute("style",s),a.setAttribute("id","printJS-Modal");var l=document.createElement("div");l.setAttribute("style","display:table-cell; vertical-align:middle; padding-bottom:100px;");var c=document.createElement("div");c.setAttribute("class","printClose"),c.setAttribute("id","printClose"),l.appendChild(c);var d=document.createElement("span");d.setAttribute("class","printSpinner"),l.appendChild(d);var p=document.createTextNode(o.modalMessage);l.appendChild(p),a.appendChild(l),document.getElementsByTagName("body")[0].appendChild(a),document.getElementById("printClose").addEventListener("click",function(){n.close()})},close:function(){var o=document.getElementById("printJS-Modal");o&&o.parentNode.removeChild(o)}};e.default=n},"./src/js/pdf.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/print.js"),r=t("./src/js/functions.js");e.default={print:function(a,l){if(a.base64){var c=Uint8Array.from(atob(a.printable),function(p){return p.charCodeAt(0)});o(a,l,c);return}a.printable=/^(blob|http|\/\/)/i.test(a.printable)?a.printable:window.location.origin+(a.printable.charAt(0)!=="/"?"/"+a.printable:a.printable);var d=new window.XMLHttpRequest;d.responseType="arraybuffer",d.addEventListener("error",function(){Object(r.cleanUp)(a),a.onError(d.statusText,d)}),d.addEventListener("load",function(){if([200,201].indexOf(d.status)===-1){Object(r.cleanUp)(a),a.onError(d.statusText,d);return}o(a,l,d.response)}),d.open("GET",a.printable,!0),d.send()}};function o(s,a,l){var c=new window.Blob([l],{type:"application/pdf"});c=window.URL.createObjectURL(c),a.setAttribute("src",c),n.default.send(s,a)}},"./src/js/print.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/browser.js"),r=t("./src/js/functions.js"),o={send:function(d,p){document.getElementsByTagName("body")[0].appendChild(p);var g=document.getElementById(d.frameId);g.onload=function(){if(d.type==="pdf"){n.default.isFirefox()?setTimeout(function(){return s(g,d)},1e3):s(g,d);return}var h=g.contentWindow||g.contentDocument;if(h.document&&(h=h.document),h.body.appendChild(d.printableElement),d.type!=="pdf"&&d.style){var _=document.createElement("style");_.innerHTML=d.style,h.head.appendChild(_)}var P=h.getElementsByTagName("img");P.length>0?a(Array.from(P)).then(function(){return s(g,d)}):s(g,d)}}};function s(c,d){try{if(c.focus(),n.default.isEdge()||n.default.isIE())try{c.contentWindow.document.execCommand("print",!1,null)}catch{c.contentWindow.print()}else c.contentWindow.print()}catch(p){d.onError(p)}finally{n.default.isFirefox()&&(c.style.visibility="hidden",c.style.left="-1px"),Object(r.cleanUp)(d)}}function a(c){var d=c.map(function(p){if(p.src&&p.src!==window.location.href)return l(p)});return Promise.all(d)}function l(c){return new Promise(function(d){var p=function g(){!c||typeof c.naturalWidth>"u"||c.naturalWidth===0||!c.complete?setTimeout(g,500):d()};p()})}e.default=o},"./src/js/raw-html.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/print.js");e.default={print:function(o,s){o.printableElement=document.createElement("div"),o.printableElement.setAttribute("style","width:100%"),o.printableElement.innerHTML=o.printable,n.default.send(o,s)}}},"./src/sass/index.scss":function(i,e,t){},0:function(i,e,t){i.exports=t("./src/index.js")}}).default})});var bx=De(Fc(),1);var rr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=zt({type:i})}static{this.\u0275inj=Nt({})}}return i})();var _x=["*"],Ys=(()=>{class i{constructor(){this.title="",this.hasValid=!1,this.onClose=new lt,this.onCancel=new lt,this.onOK=new lt,this.activeModal=N(Xn)}ngOnInit(){}onCancelHandler(){this.activeModal.close(),this.onCancel.emit()}onCloseHandler(){this.activeModal.close(),this.onClose.emit()}onOKHandler(){this.onOK.emit()}handleKeyboardEvent(t){t.key==="F2"&&this.onOKHandler()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-base-modal"]],hostBindings:function(n,r){n&1&&U("keydown",function(s){return r.handleKeyboardEvent(s)},!1,mp)},inputs:{title:"title",hasValid:"hasValid"},outputs:{onClose:"onClose",onCancel:"onCancel",onOK:"onOK"},standalone:!0,features:[ye],ngContentSelectors:_x,decls:12,vars:1,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title","font-robotoslab",2,"font-size","16px"],["aria-label","Close","type","button",1,"btn","btn-light-blue","text-primary","px-2","py-1",3,"click"],[1,"fas","fa-times"],[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-light-blue","btn-lg","text-primary","fw-semibold","fs-4",3,"click"]],template:function(n,r){n&1&&(Vn(),f(0,"div",0)(1,"h4",1),x(2),m(),f(3,"button",2),U("click",function(){return r.onCloseHandler()}),le(4,"i",3),m()(),f(5,"div",4),Un(6),m(),f(7,"div",5)(8,"button",6),U("click",function(){return r.onCancelHandler()}),x(9," Cancel "),m(),f(10,"button",6),U("click",function(){return r.onOKHandler()}),x(11," OK(F2) "),m()()),n&2&&(y(2),ti(" ",r.title," "))},dependencies:[vs],styles:[".modal-header[_ngcontent-%COMP%]{background:#89b03e;display:flex;justify-content:space-between}.modal-title[_ngcontent-%COMP%]{color:#fff}.modal-body[_ngcontent-%COMP%]{max-height:60vh}"]})}}return i})();function yf(i){let{anchorOffset:e=0,focusOffset:t=0}=i.ownerDocument.getSelection()||{},n=Math.min(e,t),r=Math.max(e,t);return[n,r]}function wx(i,[e,t]){var n,r,o,s;let a=i.ownerDocument,l=a.createRange();l.setStart(i.firstChild||i,Math.min(e,(r=(n=i.textContent)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0)),l.setEnd(i.lastChild||i,Math.min(t,(s=(o=i.textContent)===null||o===void 0?void 0:o.length)!==null&&s!==void 0?s:0));let c=a.getSelection();c&&(c.removeAllRanges(),c.addRange(l))}var Rc=class{constructor(e){this.element=e,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,`
8
+ `);var Q=0,Le=!1;this.parse=function(te,Mt,he){if(typeof te!="string")throw new Error("Input must be a string");var X=te.length,F=w.length,C=S.length,k=A.length,T=ee(z),R=[],V=[],ie=[],G=Q=0;if(!te)return je();if(ve||ve!==!1&&te.indexOf(Pe)===-1){for(var $=te.split(S),Y=0;Y<$.length;Y++){if(ie=$[Y],Q+=ie.length,Y!==$.length-1)Q+=S.length;else if(he)return je();if(!A||ie.substring(0,k)!==A){if(T){if(R=[],be(ie.split(w)),St(),Le)return je()}else be(ie.split(w));if(K&&K<=Y)return R=R.slice(0,K),je(!0)}}return je()}for(var ne=te.indexOf(w,Q),re=te.indexOf(S,Q),ge=new RegExp(_(Se)+_(Pe),"g"),Z=te.indexOf(Pe,Q);;)if(te[Q]===Pe)for(Z=Q,Q++;;){if((Z=te.indexOf(Pe,Z+1))===-1)return he||V.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:R.length,index:Q}),Ct();if(Z===X-1)return Ct(te.substring(Q,Z).replace(ge,Pe));if(Pe===Se&&te[Z+1]===Se)Z++;else if(Pe===Se||Z===0||te[Z-1]!==Se){ne!==-1&&ne<Z+1&&(ne=te.indexOf(w,Z+1));var J=_e((re=re!==-1&&re<Z+1?te.indexOf(S,Z+1):re)===-1?ne:Math.min(ne,re));if(te.substr(Z+1+J,F)===w){ie.push(te.substring(Q,Z).replace(ge,Pe)),te[Q=Z+1+J+F]!==Pe&&(Z=te.indexOf(Pe,Q)),ne=te.indexOf(w,Q),re=te.indexOf(S,Q);break}if(J=_e(re),te.substring(Z+1+J,Z+1+J+C)===S){if(ie.push(te.substring(Q,Z).replace(ge,Pe)),At(Z+1+J+C),ne=te.indexOf(w,Q),Z=te.indexOf(Pe,Q),T&&(St(),Le))return je();if(K&&R.length>=K)return je(!0);break}V.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:R.length,index:Q}),Z++}}else if(A&&ie.length===0&&te.substring(Q,Q+k)===A){if(re===-1)return je();Q=re+C,re=te.indexOf(S,Q),ne=te.indexOf(w,Q)}else if(ne!==-1&&(ne<re||re===-1))ie.push(te.substring(Q,ne)),Q=ne+F,ne=te.indexOf(w,Q);else{if(re===-1)break;if(ie.push(te.substring(Q,re)),At(re+C),T&&(St(),Le))return je();if(K&&R.length>=K)return je(!0)}return Ct();function be(Te){R.push(Te),G=Q}function _e(Te){var st=0;return st=Te!==-1&&(Te=te.substring(Z+1,Te))&&Te.trim()===""?Te.length:st}function Ct(Te){return he||(Te===void 0&&(Te=te.substring(Q)),ie.push(Te),Q=X,be(ie),T&&St()),je()}function At(Te){Q=Te,be(ie),ie=[],re=te.indexOf(S,Q)}function je(Te){if(b.header&&!Mt&&R.length){var st=R[0],at={},Re=new Set(st);let Ze=!1;for(let ki=0;ki<st.length;ki++){let Bt=st[ki];if(at[Bt=ee(b.transformHeader)?b.transformHeader(Bt,ki):Bt]){let Wi,Tr=at[Bt];for(;Wi=Bt+"_"+Tr,Tr++,Re.has(Wi););Re.add(Wi),st[ki]=Wi,at[Bt]++,Ze=!0,(Ne=Ne===null?{}:Ne)[Wi]=Bt}else at[Bt]=1,st[ki]=Bt;Re.add(Bt)}Ze&&console.warn("Duplicate headers found and renamed.")}return{data:R,errors:V,meta:{delimiter:w,linebreak:S,aborted:Le,truncated:!!Te,cursor:G+(Mt||0),renamedHeaders:Ne}}}function St(){z(je()),R=[],V=[]}},this.abort=function(){Le=!0},this.getCharIndex=function(){return Q}}function L(b){var w=b.data,S=o[w.workerId],A=!1;if(w.error)S.userError(w.error,w.file);else if(w.results&&w.results.data){var z={abort:function(){A=!0,M(w.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:W,resume:W};if(ee(S.userStep)){for(var K=0;K<w.results.data.length&&(S.userStep({data:w.results.data[K],errors:w.results.errors,meta:w.results.meta},z),!A);K++);delete w.results}else ee(S.userChunk)&&(S.userChunk(w.results,z,w.file),delete w.results)}w.finished&&!A&&M(w.workerId,w.results)}function M(b,w){var S=o[b];ee(S.userComplete)&&S.userComplete(w),S.terminate(),delete o[b]}function W(){throw new Error("Not implemented.")}function de(b){if(typeof b!="object"||b===null)return b;var w,S=Array.isArray(b)?[]:{};for(w in b)S[w]=de(b[w]);return S}function oe(b,w){return function(){b.apply(w,arguments)}}function ee(b){return typeof b=="function"}return a.parse=function(b,w){var S=(w=w||{}).dynamicTyping||!1;if(ee(S)&&(w.dynamicTypingFunction=S,S={}),w.dynamicTyping=S,w.transform=!!ee(w.transform)&&w.transform,!w.worker||!a.WORKERS_SUPPORTED)return S=null,a.NODE_STREAM_INPUT,typeof b=="string"?(b=(A=>A.charCodeAt(0)!==65279?A:A.slice(1))(b),S=new(w.download?c:u)(w)):b.readable===!0&&ee(b.read)&&ee(b.on)?S=new g(w):(e.File&&b instanceof File||b instanceof Object)&&(S=new d(w)),S.stream(b);(S=(()=>{var A;return!!a.WORKERS_SUPPORTED&&(A=(()=>{var z=e.URL||e.webkitURL||null,K=i.toString();return a.BLOB_URL||(a.BLOB_URL=z.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; ","(",K,")();"],{type:"text/javascript"})))})(),(A=new e.Worker(A)).onmessage=L,A.id=s++,o[A.id]=A)})()).userStep=w.step,S.userChunk=w.chunk,S.userComplete=w.complete,S.userError=w.error,w.step=ee(w.step),w.chunk=ee(w.chunk),w.complete=ee(w.complete),w.error=ee(w.error),delete w.worker,S.postMessage({input:b,config:w,workerId:S.id})},a.unparse=function(b,w){var S=!1,A=!0,z=",",K=`\r
9
+ `,ve='"',Ne=ve+ve,Pe=!1,Se=null,Q=!1,Le=((()=>{if(typeof w=="object"){if(typeof w.delimiter!="string"||a.BAD_DELIMITERS.filter(function(he){return w.delimiter.indexOf(he)!==-1}).length||(z=w.delimiter),typeof w.quotes!="boolean"&&typeof w.quotes!="function"&&!Array.isArray(w.quotes)||(S=w.quotes),typeof w.skipEmptyLines!="boolean"&&typeof w.skipEmptyLines!="string"||(Pe=w.skipEmptyLines),typeof w.newline=="string"&&(K=w.newline),typeof w.quoteChar=="string"&&(ve=w.quoteChar),typeof w.header=="boolean"&&(A=w.header),Array.isArray(w.columns)){if(w.columns.length===0)throw new Error("Option columns is empty");Se=w.columns}w.escapeChar!==void 0&&(Ne=w.escapeChar+ve),w.escapeFormulae instanceof RegExp?Q=w.escapeFormulae:typeof w.escapeFormulae=="boolean"&&w.escapeFormulae&&(Q=/^[=+\-@\t\r].*$/)}})(),new RegExp(_(ve),"g"));if(typeof b=="string"&&(b=JSON.parse(b)),Array.isArray(b)){if(!b.length||Array.isArray(b[0]))return te(null,b,Pe);if(typeof b[0]=="object")return te(Se||Object.keys(b[0]),b,Pe)}else if(typeof b=="object")return typeof b.data=="string"&&(b.data=JSON.parse(b.data)),Array.isArray(b.data)&&(b.fields||(b.fields=b.meta&&b.meta.fields||Se),b.fields||(b.fields=Array.isArray(b.data[0])?b.fields:typeof b.data[0]=="object"?Object.keys(b.data[0]):[]),Array.isArray(b.data[0])||typeof b.data[0]=="object"||(b.data=[b.data])),te(b.fields||[],b.data||[],Pe);throw new Error("Unable to serialize unrecognized input");function te(he,X,F){var C="",k=(typeof he=="string"&&(he=JSON.parse(he)),typeof X=="string"&&(X=JSON.parse(X)),Array.isArray(he)&&0<he.length),T=!Array.isArray(X[0]);if(k&&A){for(var R=0;R<he.length;R++)0<R&&(C+=z),C+=Mt(he[R],R);0<X.length&&(C+=K)}for(var V=0;V<X.length;V++){var ie=(k?he:X[V]).length,G=!1,$=k?Object.keys(X[V]).length===0:X[V].length===0;if(F&&!k&&(G=F==="greedy"?X[V].join("").trim()==="":X[V].length===1&&X[V][0].length===0),F==="greedy"&&k){for(var Y=[],ne=0;ne<ie;ne++){var re=T?he[ne]:ne;Y.push(X[V][re])}G=Y.join("").trim()===""}if(!G){for(var ge=0;ge<ie;ge++){0<ge&&!$&&(C+=z);var Z=k&&T?he[ge]:ge;C+=Mt(X[V][Z],ge)}V<X.length-1&&(!F||0<ie&&!$)&&(C+=K)}}return C}function Mt(he,X){var F,C;return he==null?"":he.constructor===Date?JSON.stringify(he).slice(1,25):(C=!1,Q&&typeof he=="string"&&Q.test(he)&&(he="'"+he,C=!0),F=he.toString().replace(Le,Ne),(C=C||S===!0||typeof S=="function"&&S(he,X)||Array.isArray(S)&&S[X]||((k,T)=>{for(var R=0;R<T.length;R++)if(-1<k.indexOf(T[R]))return!0;return!1})(F,a.BAD_DELIMITERS)||-1<F.indexOf(z)||F.charAt(0)===" "||F.charAt(F.length-1)===" ")?ve+F+ve:F)}},a.RECORD_SEP="",a.UNIT_SEP="",a.BYTE_ORDER_MARK="\uFEFF",a.BAD_DELIMITERS=["\r",`
10
+ `,'"',a.BYTE_ORDER_MARK],a.WORKERS_SUPPORTED=!n&&!!e.Worker,a.NODE_STREAM_INPUT=1,a.LocalChunkSize=10485760,a.RemoteChunkSize=5242880,a.DefaultDelimiter=",",a.Parser=P,a.ParserHandle=h,a.NetworkStreamer=c,a.FileStreamer=d,a.StringStreamer=u,a.ReadableStreamStreamer=g,e.jQuery&&((t=e.jQuery).fn.parse=function(b){var w=b.config||{},S=[];return this.each(function(K){if(!(t(this).prop("tagName").toUpperCase()==="INPUT"&&t(this).attr("type").toLowerCase()==="file"&&e.FileReader)||!this.files||this.files.length===0)return!0;for(var ve=0;ve<this.files.length;ve++)S.push({file:this.files[ve],inputElem:this,instanceConfig:t.extend({},w)})}),A(),this;function A(){if(S.length===0)ee(b.complete)&&b.complete();else{var K,ve,Ne,Pe,Se=S[0];if(ee(b.before)){var Q=b.before(Se.file,Se.inputElem);if(typeof Q=="object"){if(Q.action==="abort")return K="AbortError",ve=Se.file,Ne=Se.inputElem,Pe=Q.reason,void(ee(b.error)&&b.error({name:K},ve,Ne,Pe));if(Q.action==="skip")return void z();typeof Q.config=="object"&&(Se.instanceConfig=t.extend(Se.instanceConfig,Q.config))}else if(Q==="skip")return void z()}var Le=Se.instanceConfig.complete;Se.instanceConfig.complete=function(te){ee(Le)&&Le(te,Se.file,Se.inputElem),z()},a.parse(Se.file,Se.instanceConfig)}}function z(){S.splice(0,1),A()}}),r&&(e.onmessage=function(b){b=b.data,a.WORKER_ID===void 0&&b&&(a.WORKER_ID=b.workerId),typeof b.input=="string"?e.postMessage({workerId:a.WORKER_ID,results:a.parse(b.input,b.config),finished:!0}):(e.File&&b.input instanceof File||b.input instanceof Object)&&(b=a.parse(b.input,b.config))&&e.postMessage({workerId:a.WORKER_ID,results:b,finished:!0})}),(c.prototype=Object.create(l.prototype)).constructor=c,(d.prototype=Object.create(l.prototype)).constructor=d,(u.prototype=Object.create(u.prototype)).constructor=u,(g.prototype=Object.create(l.prototype)).constructor=g,a})});var Oy=j((tl,Gu)=>{(function(e,t){typeof tl=="object"&&typeof Gu=="object"?Gu.exports=t():typeof define=="function"&&define.amd?define([],t):typeof tl=="object"?tl.printJS=t():e.printJS=t()})(window,function(){return function(i){var e={};function t(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return i[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=i,t.c=e,t.d=function(n,r,o){t.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:o})},t.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,r){if(r&1&&(n=t(n)),r&8||r&4&&typeof n=="object"&&n&&n.__esModule)return n;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),r&2&&typeof n!="string")for(var s in n)t.d(o,s,function(a){return n[a]}.bind(null,s));return o},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},t.p="",t(t.s=0)}({"./src/index.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/sass/index.scss"),r=t.n(n),o=t("./src/js/init.js"),s=o.default.init;typeof window<"u"&&(window.printJS=s),e.default=s},"./src/js/browser.js":function(i,e,t){"use strict";t.r(e);var n={isFirefox:function(){return typeof InstallTrigger<"u"},isIE:function(){return navigator.userAgent.indexOf("MSIE")!==-1||!!document.documentMode},isEdge:function(){return!n.isIE()&&!!window.StyleMedia},isChrome:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;return!!o.chrome},isSafari:function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||navigator.userAgent.toLowerCase().indexOf("safari")!==-1},isIOSChrome:function(){return navigator.userAgent.toLowerCase().indexOf("crios")!==-1}};e.default=n},"./src/js/functions.js":function(i,e,t){"use strict";t.r(e),t.d(e,"addWrapper",function(){return s}),t.d(e,"capitalizePrint",function(){return a}),t.d(e,"collectStyles",function(){return l}),t.d(e,"addHeader",function(){return d}),t.d(e,"cleanUp",function(){return u}),t.d(e,"isRawHTML",function(){return g});var n=t("./src/js/modal.js"),r=t("./src/js/browser.js");function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(P){return typeof P}:o=function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},o(h)}function s(h,_){var P="font-family:"+_.font+" !important; font-size: "+_.font_size+" !important; width:100%;";return'<div style="'+P+'">'+h+"</div>"}function a(h){return h.charAt(0).toUpperCase()+h.slice(1)}function l(h,_){for(var P=document.defaultView||window,L="",M=P.getComputedStyle(h,""),W=0;W<M.length;W++)(_.targetStyles.indexOf("*")!==-1||_.targetStyle.indexOf(M[W])!==-1||c(_.targetStyles,M[W]))&&M.getPropertyValue(M[W])&&(L+=M[W]+":"+M.getPropertyValue(M[W])+";");return L+="max-width: "+_.maxWidth+"px !important; font-size: "+_.font_size+" !important;",L}function c(h,_){for(var P=0;P<h.length;P++)if(o(_)==="object"&&_.indexOf(h[P])!==-1)return!0;return!1}function d(h,_){var P=document.createElement("div");if(g(_.header))P.innerHTML=_.header;else{var L=document.createElement("h1"),M=document.createTextNode(_.header);L.appendChild(M),L.setAttribute("style",_.headerStyle),P.appendChild(L)}h.insertBefore(P,h.childNodes[0])}function u(h){h.showModal&&n.default.close(),h.onLoadingEnd&&h.onLoadingEnd(),(h.showModal||h.onLoadingStart)&&window.URL.revokeObjectURL(h.printable);var _="mouseover";(r.default.isChrome()||r.default.isFirefox())&&(_="focus");var P=function L(){window.removeEventListener(_,L),h.onPrintDialogClose();var M=document.getElementById(h.frameId);M&&M.remove()};window.addEventListener(_,P)}function g(h){var _=new RegExp("<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>");return _.test(h)}},"./src/js/html.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/functions.js"),r=t("./src/js/print.js");function o(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(d){return typeof d}:o=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},o(l)}e.default={print:function(c,d){var u=a(c.printable)?c.printable:document.getElementById(c.printable);if(!u){window.console.error("Invalid HTML element id: "+c.printable);return}c.printableElement=s(u,c),c.header&&Object(n.addHeader)(c.printableElement,c),r.default.send(c,d)}};function s(l,c){for(var d=l.cloneNode(),u=Array.prototype.slice.call(l.childNodes),g=0;g<u.length;g++)if(c.ignoreElements.indexOf(u[g].id)===-1){var h=s(u[g],c);d.appendChild(h)}switch(c.scanStyles&&l.nodeType===1&&d.setAttribute("style",Object(n.collectStyles)(l,c)),l.tagName){case"SELECT":d.value=l.value;break;case"CANVAS":d.getContext("2d").drawImage(l,0,0);break}return d}function a(l){return o(l)==="object"&&l&&(l instanceof HTMLElement||l.nodeType===1)}},"./src/js/image.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/functions.js"),r=t("./src/js/print.js"),o=t("./src/js/browser.js");e.default={print:function(a,l){a.printable.constructor!==Array&&(a.printable=[a.printable]),a.printableElement=document.createElement("div"),a.printable.forEach(function(c){var d=document.createElement("img");if(d.setAttribute("style",a.imageStyle),d.src=c,o.default.isFirefox()){var u=d.src;d.src=u}var g=document.createElement("div");g.appendChild(d),a.printableElement.appendChild(g)}),a.header&&Object(n.addHeader)(a.printableElement,a),r.default.send(a,l)}}},"./src/js/init.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/browser.js"),r=t("./src/js/modal.js"),o=t("./src/js/pdf.js"),s=t("./src/js/html.js"),a=t("./src/js/raw-html.js"),l=t("./src/js/image.js"),c=t("./src/js/json.js");function d(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(_){return typeof _}:d=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},d(g)}var u=["pdf","html","image","json","raw-html"];e.default={init:function(){var h={printable:null,fallbackPrintable:null,type:"pdf",header:null,headerStyle:"font-weight: 300;",maxWidth:800,properties:null,gridHeaderStyle:"font-weight: bold; padding: 5px; border: 1px solid #dddddd;",gridStyle:"border: 1px solid lightgray; margin-bottom: -1px;",showModal:!1,onError:function(oe){throw oe},onLoadingStart:null,onLoadingEnd:null,onPrintDialogClose:function(){},onIncompatibleBrowser:function(){},modalMessage:"Retrieving Document...",frameId:"printJS",printableElement:null,documentTitle:"Document",targetStyle:["clear","display","width","min-width","height","min-height","max-height"],targetStyles:["border","box","break","text-decoration"],ignoreElements:[],repeatTableHeader:!0,css:null,style:null,scanStyles:!0,base64:!1,onPdfOpen:null,font:"TimesNewRoman",font_size:"12pt",honorMarginPadding:!0,honorColor:!1,imageStyle:"max-width: 100%;"},_=arguments[0];if(_===void 0)throw new Error("printJS expects at least 1 attribute.");switch(d(_)){case"string":h.printable=encodeURI(_),h.fallbackPrintable=h.printable,h.type=arguments[1]||h.type;break;case"object":h.printable=_.printable,h.fallbackPrintable=typeof _.fallbackPrintable<"u"?_.fallbackPrintable:h.printable,h.fallbackPrintable=h.base64?"data:application/pdf;base64,".concat(h.fallbackPrintable):h.fallbackPrintable;for(var P in h)P==="printable"||P==="fallbackPrintable"||(h[P]=typeof _[P]<"u"?_[P]:h[P]);break;default:throw new Error('Unexpected argument type! Expected "string" or "object", got '+d(_))}if(!h.printable)throw new Error("Missing printable information.");if(!h.type||typeof h.type!="string"||u.indexOf(h.type.toLowerCase())===-1)throw new Error("Invalid print type. Available types are: pdf, html, image and json.");h.showModal&&r.default.show(h),h.onLoadingStart&&h.onLoadingStart();var L=document.getElementById(h.frameId);L&&L.parentNode.removeChild(L);var M=document.createElement("iframe");switch(n.default.isFirefox()?M.setAttribute("style","width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0"):M.setAttribute("style","visibility: hidden; height: 0; width: 0; position: absolute; border: 0"),M.setAttribute("id",h.frameId),h.type!=="pdf"&&(M.srcdoc="<html><head><title>"+h.documentTitle+"</title>",h.css&&(Array.isArray(h.css)||(h.css=[h.css]),h.css.forEach(function(de){M.srcdoc+='<link rel="stylesheet" href="'+de+'">'})),M.srcdoc+="</head><body></body></html>"),h.type){case"pdf":if(n.default.isIE())try{console.info("Print.js doesn't support PDF printing in Internet Explorer.");var W=window.open(h.fallbackPrintable,"_blank");W.focus(),h.onIncompatibleBrowser()}catch(de){h.onError(de)}finally{h.showModal&&r.default.close(),h.onLoadingEnd&&h.onLoadingEnd()}else o.default.print(h,M);break;case"image":l.default.print(h,M);break;case"html":s.default.print(h,M);break;case"raw-html":a.default.print(h,M);break;case"json":c.default.print(h,M);break}}}},"./src/js/json.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/functions.js"),r=t("./src/js/print.js");function o(a){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(c){return typeof c}:o=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(a)}e.default={print:function(l,c){if(o(l.printable)!=="object")throw new Error("Invalid javascript data object (JSON).");if(typeof l.repeatTableHeader!="boolean")throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!l.properties||!Array.isArray(l.properties))throw new Error("Invalid properties array for your JSON data.");l.properties=l.properties.map(function(d){return{field:o(d)==="object"?d.field:d,displayName:o(d)==="object"?d.displayName:d,columnSize:o(d)==="object"&&d.columnSize?d.columnSize+";":100/l.properties.length+"%;"}}),l.printableElement=document.createElement("div"),l.header&&Object(n.addHeader)(l.printableElement,l),l.printableElement.innerHTML+=s(l),r.default.send(l,c)}};function s(a){var l=a.printable,c=a.properties,d='<table style="border-collapse: collapse; width: 100%;">';a.repeatTableHeader&&(d+="<thead>"),d+="<tr>";for(var u=0;u<c.length;u++)d+='<th style="width:'+c[u].columnSize+";"+a.gridHeaderStyle+'">'+Object(n.capitalizePrint)(c[u].displayName)+"</th>";d+="</tr>",a.repeatTableHeader&&(d+="</thead>"),d+="<tbody>";for(var g=0;g<l.length;g++){d+="<tr>";for(var h=0;h<c.length;h++){var _=l[g],P=c[h].field.split(".");if(P.length>1)for(var L=0;L<P.length;L++)_=_[P[L]];else _=_[c[h].field];d+='<td style="width:'+c[h].columnSize+a.gridStyle+'">'+_+"</td>"}d+="</tr>"}return d+="</tbody></table>",d}},"./src/js/modal.js":function(i,e,t){"use strict";t.r(e);var n={show:function(o){var s="font-family:sans-serif; display:table; text-align:center; font-weight:300; font-size:30px; left:0; top:0;position:fixed; z-index: 9990;color: #0460B5; width: 100%; height: 100%; background-color:rgba(255,255,255,.9);transition: opacity .3s ease;",a=document.createElement("div");a.setAttribute("style",s),a.setAttribute("id","printJS-Modal");var l=document.createElement("div");l.setAttribute("style","display:table-cell; vertical-align:middle; padding-bottom:100px;");var c=document.createElement("div");c.setAttribute("class","printClose"),c.setAttribute("id","printClose"),l.appendChild(c);var d=document.createElement("span");d.setAttribute("class","printSpinner"),l.appendChild(d);var u=document.createTextNode(o.modalMessage);l.appendChild(u),a.appendChild(l),document.getElementsByTagName("body")[0].appendChild(a),document.getElementById("printClose").addEventListener("click",function(){n.close()})},close:function(){var o=document.getElementById("printJS-Modal");o&&o.parentNode.removeChild(o)}};e.default=n},"./src/js/pdf.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/print.js"),r=t("./src/js/functions.js");e.default={print:function(a,l){if(a.base64){var c=Uint8Array.from(atob(a.printable),function(u){return u.charCodeAt(0)});o(a,l,c);return}a.printable=/^(blob|http|\/\/)/i.test(a.printable)?a.printable:window.location.origin+(a.printable.charAt(0)!=="/"?"/"+a.printable:a.printable);var d=new window.XMLHttpRequest;d.responseType="arraybuffer",d.addEventListener("error",function(){Object(r.cleanUp)(a),a.onError(d.statusText,d)}),d.addEventListener("load",function(){if([200,201].indexOf(d.status)===-1){Object(r.cleanUp)(a),a.onError(d.statusText,d);return}o(a,l,d.response)}),d.open("GET",a.printable,!0),d.send()}};function o(s,a,l){var c=new window.Blob([l],{type:"application/pdf"});c=window.URL.createObjectURL(c),a.setAttribute("src",c),n.default.send(s,a)}},"./src/js/print.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/browser.js"),r=t("./src/js/functions.js"),o={send:function(d,u){document.getElementsByTagName("body")[0].appendChild(u);var g=document.getElementById(d.frameId);g.onload=function(){if(d.type==="pdf"){n.default.isFirefox()?setTimeout(function(){return s(g,d)},1e3):s(g,d);return}var h=g.contentWindow||g.contentDocument;if(h.document&&(h=h.document),h.body.appendChild(d.printableElement),d.type!=="pdf"&&d.style){var _=document.createElement("style");_.innerHTML=d.style,h.head.appendChild(_)}var P=h.getElementsByTagName("img");P.length>0?a(Array.from(P)).then(function(){return s(g,d)}):s(g,d)}}};function s(c,d){try{if(c.focus(),n.default.isEdge()||n.default.isIE())try{c.contentWindow.document.execCommand("print",!1,null)}catch{c.contentWindow.print()}else c.contentWindow.print()}catch(u){d.onError(u)}finally{n.default.isFirefox()&&(c.style.visibility="hidden",c.style.left="-1px"),Object(r.cleanUp)(d)}}function a(c){var d=c.map(function(u){if(u.src&&u.src!==window.location.href)return l(u)});return Promise.all(d)}function l(c){return new Promise(function(d){var u=function g(){!c||typeof c.naturalWidth>"u"||c.naturalWidth===0||!c.complete?setTimeout(g,500):d()};u()})}e.default=o},"./src/js/raw-html.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/print.js");e.default={print:function(o,s){o.printableElement=document.createElement("div"),o.printableElement.setAttribute("style","width:100%"),o.printableElement.innerHTML=o.printable,n.default.send(o,s)}}},"./src/sass/index.scss":function(i,e,t){},0:function(i,e,t){i.exports=t("./src/index.js")}}).default})});var bx=De(Fc(),1);var rr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Lt({type:i})}static{this.\u0275inj=Nt({})}}return i})();var _x=["*"],Xs=(()=>{class i{constructor(){this.title="",this.hasValid=!1,this.onClose=new lt,this.onCancel=new lt,this.onOK=new lt,this.activeModal=N(Xn)}ngOnInit(){}onCancelHandler(){this.activeModal.close(),this.onCancel.emit()}onCloseHandler(){this.activeModal.close(),this.onClose.emit()}onOKHandler(){this.onOK.emit()}handleKeyboardEvent(t){t.key==="F2"&&this.onOKHandler()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-base-modal"]],hostBindings:function(n,r){n&1&&U("keydown",function(s){return r.handleKeyboardEvent(s)},!1,mp)},inputs:{title:"title",hasValid:"hasValid"},outputs:{onClose:"onClose",onCancel:"onCancel",onOK:"onOK"},standalone:!0,features:[ye],ngContentSelectors:_x,decls:12,vars:1,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title","font-robotoslab",2,"font-size","16px"],["aria-label","Close","type","button",1,"btn","btn-light-blue","text-primary","px-2","py-1",3,"click"],[1,"fas","fa-times"],[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-light-blue","btn-lg","text-primary","fw-semibold","fs-4",3,"click"]],template:function(n,r){n&1&&(Vn(),f(0,"div",0)(1,"h4",1),x(2),m(),f(3,"button",2),U("click",function(){return r.onCloseHandler()}),le(4,"i",3),m()(),f(5,"div",4),Un(6),m(),f(7,"div",5)(8,"button",6),U("click",function(){return r.onCancelHandler()}),x(9," Cancel "),m(),f(10,"button",6),U("click",function(){return r.onOKHandler()}),x(11," OK(F2) "),m()()),n&2&&(y(2),Ht(" ",r.title," "))},dependencies:[ys],styles:[".modal-header[_ngcontent-%COMP%]{background:#89b03e;display:flex;justify-content:space-between}.modal-title[_ngcontent-%COMP%]{color:#fff}.modal-body[_ngcontent-%COMP%]{max-height:60vh}"]})}}return i})();function yf(i){let{anchorOffset:e=0,focusOffset:t=0}=i.ownerDocument.getSelection()||{},n=Math.min(e,t),r=Math.max(e,t);return[n,r]}function wx(i,[e,t]){var n,r,o,s;let a=i.ownerDocument,l=a.createRange();l.setStart(i.firstChild||i,Math.min(e,(r=(n=i.textContent)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0)),l.setEnd(i.lastChild||i,Math.min(t,(s=(o=i.textContent)===null||o===void 0?void 0:o.length)!==null&&s!==void 0?s:0));let c=a.getSelection();c&&(c.removeAllRanges(),c.addRange(l))}var Rc=class{constructor(e){this.element=e,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,`
11
11
  `)}set value(e){this.element.innerHTML=e.replace(/\n$/,`
12
12
 
13
- `)}get selectionStart(){return yf(this.element)[0]}get selectionEnd(){return yf(this.element)[1]}setSelectionRange(e,t){wx(this.element,[e??0,t??0])}select(){this.setSelectionRange(0,this.value.length)}};function xx(i){let e=new Rc(i);return new Proxy(i,{get(t,n){if(n in e)return e[n];let r=t[n];return typeof r=="function"?r.bind(t):r},set(t,n,r,o){return Reflect.set(n in e?e:t,n,r,o)}})}var wf=i=>i.isContentEditable?xx(i):i.querySelector("input,textarea")||i,or={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"},Mc=class{constructor(){this.now=null,this.past=[],this.future=[]}undo(){let e=this.past.pop();e&&this.now&&(this.future.push(this.now),this.updateElement(e,"historyUndo"))}redo(){let e=this.future.pop();e&&this.now&&(this.past.push(this.now),this.updateElement(e,"historyRedo"))}updateHistory(e){if(!this.now){this.now=e;return}let t=this.now.value!==e.value,n=this.now.selection.some((r,o)=>r!==e.selection[o]);!t&&!n||(t&&(this.past.push(this.now),this.future=[]),this.now=e)}updateElement(e,t){this.now=e,this.updateElementState(e,{inputType:t,data:null})}};function Cx(i,...e){return e.every(({value:t})=>t===i.value)}function Sx(i,...e){return e.every(({value:t,selection:n})=>t===i.value&&n[0]===i.selection[0]&&n[1]===i.selection[1])}function Px({value:i,selection:e},t,n){let[r,o]=e,s=typeof n=="function"?n({value:i,selection:e}):n;return{value:i,selection:s==="replace"?[r,Math.max(r+t.length,o)]:[r,o]}}function Js(i){return typeof i=="string"}function vf(i,e,t,n){let r="";for(let o=e.length;o<i.length;o++){let s=i[o]||"",a=n?.value[o]===s;if(!Js(s)||s===t&&!a)return r;r+=s}return r}function xf(i,e){return Array.isArray(e)?i.length===e.length&&Array.from(i).every((t,n)=>{let r=e[n]||"";return Js(r)?t===r:t.match(r)}):e.test(i)}function Ex(i,e,t){let n=null,r=null,o=Array.from(i.value).reduce((a,l,c)=>{let d=vf(e,a,l,t),p=a+d,g=e[p.length]||"";return n===null&&c>=i.selection[0]&&(n=p.length),r===null&&c>=i.selection[1]&&(r=p.length),Js(g)?p+g:l.match(g)?p+l:p},""),s=vf(e,o,"",t);return{value:xf(o+s,e)?o+s:o,selection:[n??o.length,r??o.length]}}function Dx({value:i,selection:e},t){let[n,r]=e,o=n,s=r,a=Array.from(i).reduce((l,c,d)=>{let p=l+c;return n===d&&(o=l.length),r===d&&(s=l.length),p.match(t)?p:l},"");return{value:a,selection:[Math.min(o,a.length),Math.min(s,a.length)]}}function Ks(i,e,t=null){if(xf(i.value,e))return i;let{value:n,selection:r}=Array.isArray(e)?Ex(i,e,t):Dx(i,e);return{selection:r,value:Array.isArray(e)?n.slice(0,e.length):n}}function bf(i,e){if(!Array.isArray(e))return i;let[t,n]=i.selection,r=[],o=Array.from(i.value).reduce((s,a,l)=>{let c=e[l]||"";return l===t&&r.push(s.length),l===n&&r.push(s.length),Js(c)&&c===a?s:s+a},"");return r.length<2&&r.push(...new Array(2-r.length).fill(o.length)),{value:o,selection:[r[0],r[1]]}}var Jr=class{constructor(e,t){this.initialElementState=e,this.maskOptions=t,this.value="",this.selection=[0,0];let{value:n,selection:r}=Ks(this.initialElementState,this.getMaskExpression(this.initialElementState));this.value=n,this.selection=r}addCharacters([e,t],n){let{value:r,maskOptions:o}=this,s=this.getMaskExpression({value:r.slice(0,e)+n+r.slice(t),selection:[e+n.length,e+n.length]}),a={value:r,selection:[e,t]},l=bf(a,s),[c,d]=Px(l,n,o.overwriteMode).selection,p=l.value.slice(0,c)+n,g=p.length,h=Ks({value:p+l.value.slice(d),selection:[g,g]},s,a);if(r.slice(0,e)===Ks({value:p,selection:[g,g]},s,a).value||Sx(this,h))throw new Error("Invalid mask value");this.value=h.value,this.selection=h.selection}deleteCharacters([e,t]){if(e===t||!t)return;let{value:n}=this,r=this.getMaskExpression({value:n.slice(0,e)+n.slice(t),selection:[e,e]}),o={value:n,selection:[e,t]},s=bf(o,r),[a,l]=s.selection,c=s.value.slice(0,a)+s.value.slice(l),d=Ks({value:c,selection:[a,a]},r,o);this.value=d.value,this.selection=d.selection}getMaskExpression(e){let{mask:t}=this.maskOptions;return typeof t=="function"?t(e):t}},Ac=class{constructor(e){this.element=e,this.listeners=[]}listen(e,t,n){let r=t;this.element.addEventListener(e,r,n),this.listeners.push(()=>this.element.removeEventListener(e,r,n))}destroy(){this.listeners.forEach(e=>e())}},li={CTRL:1,ALT:2,SHIFT:4,META:8},Qr={Y:89,Z:90};function Zr(i,e,t){return i.ctrlKey===!!(e&li.CTRL)&&i.altKey===!!(e&li.ALT)&&i.shiftKey===!!(e&li.SHIFT)&&i.metaKey===!!(e&li.META)&&i.keyCode===t}function kx(i){return Zr(i,li.CTRL,Qr.Y)||Zr(i,li.CTRL|li.SHIFT,Qr.Z)||Zr(i,li.META|li.SHIFT,Qr.Z)}function Tx(i){return Zr(i,li.CTRL,Qr.Z)||Zr(i,li.META,Qr.Z)}function sr(i,e){var t;let n=i.value;if(typeof e=="string")i.value=e;else{let[r,o]=e.selection;i.value=e.value,i.matches(":focus")&&((t=i.setSelectionRange)===null||t===void 0||t.call(i,r,o))}i.value!==n&&i.dispatchEvent(new Event("input",{bubbles:!0}))}function Ix({value:i,selection:e},t){let[n,r]=e;if(n!==r)return[n,r];let o=t?i.slice(n).indexOf(`
13
+ `)}get selectionStart(){return yf(this.element)[0]}get selectionEnd(){return yf(this.element)[1]}setSelectionRange(e,t){wx(this.element,[e??0,t??0])}select(){this.setSelectionRange(0,this.value.length)}};function xx(i){let e=new Rc(i);return new Proxy(i,{get(t,n){if(n in e)return e[n];let r=t[n];return typeof r=="function"?r.bind(t):r},set(t,n,r,o){return Reflect.set(n in e?e:t,n,r,o)}})}var wf=i=>i.isContentEditable?xx(i):i.querySelector("input,textarea")||i,or={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"},Mc=class{constructor(){this.now=null,this.past=[],this.future=[]}undo(){let e=this.past.pop();e&&this.now&&(this.future.push(this.now),this.updateElement(e,"historyUndo"))}redo(){let e=this.future.pop();e&&this.now&&(this.past.push(this.now),this.updateElement(e,"historyRedo"))}updateHistory(e){if(!this.now){this.now=e;return}let t=this.now.value!==e.value,n=this.now.selection.some((r,o)=>r!==e.selection[o]);!t&&!n||(t&&(this.past.push(this.now),this.future=[]),this.now=e)}updateElement(e,t){this.now=e,this.updateElementState(e,{inputType:t,data:null})}};function Cx(i,...e){return e.every(({value:t})=>t===i.value)}function Sx(i,...e){return e.every(({value:t,selection:n})=>t===i.value&&n[0]===i.selection[0]&&n[1]===i.selection[1])}function Px({value:i,selection:e},t,n){let[r,o]=e,s=typeof n=="function"?n({value:i,selection:e}):n;return{value:i,selection:s==="replace"?[r,Math.max(r+t.length,o)]:[r,o]}}function Zs(i){return typeof i=="string"}function vf(i,e,t,n){let r="";for(let o=e.length;o<i.length;o++){let s=i[o]||"",a=n?.value[o]===s;if(!Zs(s)||s===t&&!a)return r;r+=s}return r}function xf(i,e){return Array.isArray(e)?i.length===e.length&&Array.from(i).every((t,n)=>{let r=e[n]||"";return Zs(r)?t===r:t.match(r)}):e.test(i)}function Ex(i,e,t){let n=null,r=null,o=Array.from(i.value).reduce((a,l,c)=>{let d=vf(e,a,l,t),u=a+d,g=e[u.length]||"";return n===null&&c>=i.selection[0]&&(n=u.length),r===null&&c>=i.selection[1]&&(r=u.length),Zs(g)?u+g:l.match(g)?u+l:u},""),s=vf(e,o,"",t);return{value:xf(o+s,e)?o+s:o,selection:[n??o.length,r??o.length]}}function Dx({value:i,selection:e},t){let[n,r]=e,o=n,s=r,a=Array.from(i).reduce((l,c,d)=>{let u=l+c;return n===d&&(o=l.length),r===d&&(s=l.length),u.match(t)?u:l},"");return{value:a,selection:[Math.min(o,a.length),Math.min(s,a.length)]}}function Ys(i,e,t=null){if(xf(i.value,e))return i;let{value:n,selection:r}=Array.isArray(e)?Ex(i,e,t):Dx(i,e);return{selection:r,value:Array.isArray(e)?n.slice(0,e.length):n}}function bf(i,e){if(!Array.isArray(e))return i;let[t,n]=i.selection,r=[],o=Array.from(i.value).reduce((s,a,l)=>{let c=e[l]||"";return l===t&&r.push(s.length),l===n&&r.push(s.length),Zs(c)&&c===a?s:s+a},"");return r.length<2&&r.push(...new Array(2-r.length).fill(o.length)),{value:o,selection:[r[0],r[1]]}}var Zr=class{constructor(e,t){this.initialElementState=e,this.maskOptions=t,this.value="",this.selection=[0,0];let{value:n,selection:r}=Ys(this.initialElementState,this.getMaskExpression(this.initialElementState));this.value=n,this.selection=r}addCharacters([e,t],n){let{value:r,maskOptions:o}=this,s=this.getMaskExpression({value:r.slice(0,e)+n+r.slice(t),selection:[e+n.length,e+n.length]}),a={value:r,selection:[e,t]},l=bf(a,s),[c,d]=Px(l,n,o.overwriteMode).selection,u=l.value.slice(0,c)+n,g=u.length,h=Ys({value:u+l.value.slice(d),selection:[g,g]},s,a);if(r.slice(0,e)===Ys({value:u,selection:[g,g]},s,a).value||Sx(this,h))throw new Error("Invalid mask value");this.value=h.value,this.selection=h.selection}deleteCharacters([e,t]){if(e===t||!t)return;let{value:n}=this,r=this.getMaskExpression({value:n.slice(0,e)+n.slice(t),selection:[e,e]}),o={value:n,selection:[e,t]},s=bf(o,r),[a,l]=s.selection,c=s.value.slice(0,a)+s.value.slice(l),d=Ys({value:c,selection:[a,a]},r,o);this.value=d.value,this.selection=d.selection}getMaskExpression(e){let{mask:t}=this.maskOptions;return typeof t=="function"?t(e):t}},Ac=class{constructor(e){this.element=e,this.listeners=[]}listen(e,t,n){let r=t;this.element.addEventListener(e,r,n),this.listeners.push(()=>this.element.removeEventListener(e,r,n))}destroy(){this.listeners.forEach(e=>e())}},ci={CTRL:1,ALT:2,SHIFT:4,META:8},Kr={Y:89,Z:90};function Qr(i,e,t){return i.ctrlKey===!!(e&ci.CTRL)&&i.altKey===!!(e&ci.ALT)&&i.shiftKey===!!(e&ci.SHIFT)&&i.metaKey===!!(e&ci.META)&&i.keyCode===t}function kx(i){return Qr(i,ci.CTRL,Kr.Y)||Qr(i,ci.CTRL|ci.SHIFT,Kr.Z)||Qr(i,ci.META|ci.SHIFT,Kr.Z)}function Tx(i){return Qr(i,ci.CTRL,Kr.Z)||Qr(i,ci.META,Kr.Z)}function sr(i,e){var t;let n=i.value;if(typeof e=="string")i.value=e;else{let[r,o]=e.selection;i.value=e.value,i.matches(":focus")&&((t=i.setSelectionRange)===null||t===void 0||t.call(i,r,o))}i.value!==n&&i.dispatchEvent(new Event("input",{bubbles:!0}))}function Ix({value:i,selection:e},t){let[n,r]=e;if(n!==r)return[n,r];let o=t?i.slice(n).indexOf(`
14
14
  `)+1||i.length:i.slice(0,r).lastIndexOf(`
15
- `)+1;return[t?n:o,t?o:r]}function Ox({value:i,selection:e},t){let[n,r]=e;return n!==r?[n,r]:(t?[n,r+1]:[n-1,r]).map(s=>Math.min(Math.max(s,0),i.length))}var Fx=/\s+$/g,Rx=/^\s+/g,_f=/\s/;function Mx({value:i,selection:e},t){let[n,r]=e;if(n!==r)return[n,r];if(t){let l=i.slice(n),[c]=l.match(Rx)||[""],d=l.trimStart().search(_f);return[n,d!==-1?n+c.length+d:i.length]}let o=i.slice(0,r),[s]=o.match(Fx)||[""],a=o.trimEnd().split("").reverse().findIndex(l=>_f.exec(l));return[a!==-1?r-s.length-a:0,r]}function Qs(i=[]){return(e,...t)=>i.reduce((n,r)=>Object.assign(Object.assign({},n),r(n,...t)),e)}function un(i,e){let t=Object.assign(Object.assign({},or),e),n=Qs(t.preprocessors),r=Qs(t.postprocessors),o=typeof i=="string"?{value:i,selection:[0,0]}:i,{elementState:s}=n({elementState:o,data:""},"validation"),a=new Jr(s,t),{value:l,selection:c}=r(a,o);return typeof i=="string"?l:{value:l,selection:c}}var Zs=class extends Mc{constructor(e,t){super(),this.element=e,this.maskitoOptions=t,this.isTextArea=this.element.nodeName==="TEXTAREA",this.eventListener=new Ac(this.element),this.options=Object.assign(Object.assign({},or),this.maskitoOptions),this.upcomingElementState=null,this.preprocessor=Qs(this.options.preprocessors),this.postprocessor=Qs(this.options.postprocessors),this.teardowns=this.options.plugins.map(n=>n(this.element,this.options)),this.updateHistory(this.elementState),this.eventListener.listen("keydown",n=>{if(kx(n))return n.preventDefault(),this.redo();if(Tx(n))return n.preventDefault(),this.undo()}),this.eventListener.listen("beforeinput",n=>{var r,o,s;let a=n.inputType.includes("Forward");switch(this.updateHistory(this.elementState),n.inputType){case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.handleDelete({event:n,isForward:a,selection:Ox(this.elementState,a)});case"deleteHardLineBackward":case"deleteHardLineForward":case"deleteSoftLineBackward":case"deleteSoftLineForward":return this.handleDelete({event:n,isForward:a,selection:Ix(this.elementState,a),force:!0});case"deleteWordBackward":case"deleteWordForward":return this.handleDelete({event:n,isForward:a,selection:Mx(this.elementState,a),force:!0});case"historyRedo":return n.preventDefault(),this.redo();case"historyUndo":return n.preventDefault(),this.undo();case"insertCompositionText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(n);case"insertReplacementText":return;case"insertFromDrop":case"insertFromPaste":case"insertText":default:return this.handleInsert(n,(s=(r=n.data)!==null&&r!==void 0?r:(o=n.dataTransfer)===null||o===void 0?void 0:o.getData("text/plain"))!==null&&s!==void 0?s:"")}}),this.eventListener.listen("input",()=>{this.upcomingElementState&&(this.updateElementState(this.upcomingElementState),this.upcomingElementState=null)},{capture:!0}),this.eventListener.listen("input",({inputType:n})=>{n!=="insertCompositionText"&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}destroy(){this.eventListener.destroy(),this.teardowns.forEach(e=>e?.())}updateElementState({value:e,selection:t},n){let r=this.elementState.value;this.updateValue(e),this.updateSelectionRange(t),n&&r!==e&&this.dispatchInputEvent(n)}get elementState(){let{value:e,selectionStart:t,selectionEnd:n}=this.element;return{value:e,selection:[t??0,n??0]}}get maxLength(){let{maxLength:e}=this.element;return e===-1?1/0:e}updateSelectionRange([e,t]){var n;let{element:r}=this;r.matches(":focus")&&(r.selectionStart!==e||r.selectionEnd!==t)&&((n=r.setSelectionRange)===null||n===void 0||n.call(r,e,t))}updateValue(e){this.element.value=e}ensureValueFitsMask(){this.updateElementState(un(this.elementState,this.options),{inputType:"insertText",data:null})}dispatchInputEvent(e={inputType:"insertText",data:null}){globalThis.InputEvent&&this.element.dispatchEvent(new InputEvent("input",Object.assign(Object.assign({},e),{bubbles:!0,cancelable:!1})))}handleDelete({event:e,selection:t,isForward:n,force:r=!1}){let o={value:this.elementState.value,selection:t},[s,a]=o.selection,{elementState:l}=this.preprocessor({elementState:o,data:""},n?"deleteForward":"deleteBackward"),c=new Jr(l,this.options),[d,p]=l.selection;c.deleteCharacters([d,p]);let g=this.postprocessor(c,o);if(!(o.value.slice(0,s)+o.value.slice(a)===g.value&&!r&&!this.element.isContentEditable)){if(Cx(o,l,c,g))return e.preventDefault(),this.updateSelectionRange(n?[p,p]:[d,d]);this.upcomingElementState=g}}handleInsert(e,t){let{options:n,maxLength:r,element:o,elementState:s}=this,{elementState:a,data:l=t}=this.preprocessor({data:t,elementState:s},"insert"),c=new Jr(a,n);try{c.addCharacters(a.selection,l)}catch{return e.preventDefault()}let[d,p]=a.selection,g=s.value.slice(0,d)+t+s.value.slice(p),h=this.postprocessor(c,s);if(h.value.length>r)return e.preventDefault();(g!==h.value||o.isContentEditable)&&(this.upcomingElementState=h,n.overwriteMode==="replace"&&g.length>r&&this.dispatchInputEvent({inputType:"insertText",data:t}))}handleEnter(e){(this.isTextArea||this.element.isContentEditable)&&this.handleInsert(e,`
16
- `)}};function ar(i,e,t){let n=Math.min(Number(t),Math.max(Number(e),Number(i)));return i instanceof Date?new Date(n):n}var Ax=[".",",","\u0431","\u044E"];var Nc="\xA0",Bx="\u200B",Df="\u2013",kf="\u2014",ea="-",Bc="\u2212",Tf="\u30FC";var YT=new RegExp(`[${Nc}APM]+$`,"g"),KT=new RegExp(`${Nc}[AP]M$`,"g"),Nx=[":","."];function lr(i){return i}function zx(){}var If=/[\\^$.*+?()[\]{}|]/g,Lx=new RegExp(If.source);function yt(i){return i&&Lx.test(i)?i.replaceAll(If,String.raw`\$&`):i}function ci(i,{prefix:e,postfix:t}){var n,r;let o=new RegExp(`^${yt(e)}`),s=new RegExp(`${yt(t)}$`),[a=""]=(n=i.match(o))!==null&&n!==void 0?n:[],[l=""]=(r=i.match(s))!==null&&r!==void 0?r:[];return{extractedPrefix:a,extractedPostfix:l,cleanValue:a||l?i.slice(a.length,l.length?-l.length:1/0):i}}function Hx(i,e){let t="";for(let n=0;n<i.length;n++){if(i[n]!==e[n])return t;t+=i[n]}return t}function Cf(i){return i.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function jx(){return({elementState:i,data:e})=>{let{value:t,selection:n}=i;return{elementState:{selection:n,value:Cf(t)},data:Cf(e)}}}var QT=new RegExp(`[${Nx.map(yt).join("")}]$`);function Vx(i){let e=new RegExp(`${yt(i)}$`);return i?({value:t,selection:n},r)=>{if(!t&&!r.value.endsWith(i))return{value:t,selection:n};if(!t.endsWith(i)&&!r.value.endsWith(i))return{selection:n,value:t+i};let o=r.value.replace(e,""),s=r.selection[1]>o.length,a=Hx(o,t);return{selection:n,value:Array.from(i).reverse().reduce((l,c,d)=>{let p=l.length-1-d,g=a[p]===c&&s;return l[p]!==c||g?l.slice(0,p+1)+c+l.slice(p+1):l},t)}}:lr}function Ux(i){return i?({value:e,selection:t},n)=>{if(e.startsWith(i)||!e&&!n.value.startsWith(i))return{value:e,selection:t};let[r,o]=t,s=Array.from(i).reduce((l,c,d)=>l[d]===c?l:l.slice(0,d)+c+l.slice(d),e),a=s.length-e.length;return{selection:[r+a,o+a],value:s}}:lr}function cr(i,e,t){return(n,r)=>{let o=()=>e(n,r);return n.addEventListener(i,o,t),()=>n.removeEventListener(i,o,t)}}function Wx(i){return(e,t)=>{let n=e.ownerDocument,r=0,o=()=>r++,s=()=>{r=Math.max(--r,0)},a=()=>{if(e.matches(":focus")){if(r)return n.addEventListener("mouseup",a,{once:!0,passive:!0});i(e,t)}};return n.addEventListener("selectionchange",a,{passive:!0}),e.addEventListener("mousedown",o,{passive:!0}),n.addEventListener("mouseup",s,{passive:!0}),()=>{n.removeEventListener("selectionchange",a),n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",s)}}}function Of(i){return Wx(e=>{var t,n;let r=(t=e.selectionStart)!==null&&t!==void 0?t:0,o=(n=e.selectionEnd)!==null&&n!==void 0?n:0,[s,a]=i(e.value,[r,o]);(s>r||a<o)&&e.setSelectionRange(ar(r,s,a),ar(o,s,a))})}function $x({prefix:i,postfix:e}){return({elementState:t,data:n})=>{let{cleanValue:r}=ci(n,{prefix:i,postfix:e});return{elementState:t,data:r}}}function Ff({decimalSeparator:i,isNegativeAllowed:e,precision:t,thousandSeparator:n,prefix:r,postfix:o,decimalPseudoSeparators:s=[],pseudoMinuses:a=[],minusSign:l}){let c=Sf(r),d=String.raw`\d`,p=e?`[${l}${a.map(z=>`\\${z}`).join("")}]?`:"",g=n?`[${d}${yt(n).replaceAll(/\s/g,String.raw`\s`)}]*`:`[${d}]*`,h=Number.isFinite(t)?t:"",_=t>0?`([${yt(i)}${s.map(yt).join("")}]${d}{0,${h}})?`:"",P=Sf(o);return new RegExp(`^${c}${p}${g}${_}${P}$`)}function Sf(i){return i?`${i.split("").map(e=>`${yt(e)}?`).join("")}`:""}function zc(i,e="."){let t=!!new RegExp(`^\\D*[${Bc}\\${ea}${Df}${kf}${Tf}]`).exec(i),n=yt(e),r=i.replaceAll(new RegExp(`${n}(?!\\d)`,"g"),"").replaceAll(new RegExp(`[^\\d${n}]`,"g"),"").replace(e,e&&".");return r?+`${t?ea:""}${r}`:NaN}function qx(i){var e;let t=String(i),[n="",r]=t.split("e-"),o=t;if(r){let[,s]=n.split("."),a=Number(r)+((e=s?.length)!==null&&e!==void 0?e:0);o=i.toFixed(a)}return o}function Rf(i,{decimalSeparator:e,minusSign:t}){let[n="",r=""]=e?i.split(e):[i],o=yt(t),[,s="",a=""]=new RegExp(`^(?:[^\\d${o}])?(${o})?(.*)`).exec(n)||[];return{minus:s,integerPart:a,decimalPart:r}}function Gx({decimalSeparator:i,thousandSeparator:e,decimalPseudoSeparators:t=Ax}){return t.filter(n=>n!==e&&n!==i)}function Xx({decimalSeparator:i,precision:e,decimalZeroPadding:t,prefix:n,postfix:r}){return e<=0||!t?lr:({value:o,selection:s})=>{let{cleanValue:a,extractedPrefix:l,extractedPostfix:c}=ci(o,{prefix:n,postfix:r});if(Number.isNaN(zc(a,i)))return{value:o,selection:s};let[d,p=""]=a.split(i);return{value:l+d+i+p.padEnd(e,"0")+c,selection:s}}}function Yx({prefix:i,postfix:e,decimalSeparator:t,minusSign:n}){return({value:r,selection:o})=>{let[s]=o,{cleanValue:a,extractedPrefix:l,extractedPostfix:c}=ci(r,{prefix:i,postfix:e}),{minus:d,integerPart:p,decimalPart:g}=Rf(a,{decimalSeparator:t,minusSign:n}),h=!p&&!g&&!!t&&a.includes(t);return!p&&!Number(g)&&s===(d+l).length||h?{selection:o,value:l+d+c}:{value:r,selection:o}}}function Kx({decimalSeparator:i,decimalPseudoSeparators:e,pseudoMinuses:t,prefix:n,postfix:r,minusSign:o}){let s=!0,a=Ff({decimalSeparator:i,decimalPseudoSeparators:e,pseudoMinuses:t,prefix:"",postfix:"",thousandSeparator:"",precision:1/0,isNegativeAllowed:!0,minusSign:o});return({elementState:l,data:c})=>{if(!s)return{elementState:l,data:c};s=!1;let{value:d,selection:p}=l,[g,h]=p,{extractedPrefix:_,cleanValue:P,extractedPostfix:z}=ci(d,{prefix:n,postfix:r}),M=un({selection:[Math.max(g-_.length,0),ar(h-_.length,0,P.length)],value:P},{mask:a}),[W,de]=M.selection;return{elementState:{selection:[W+_.length,de+_.length],value:_+M.value+z},data:c}}}function Qx({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n}){let r=s=>{let a=yt(e);return s.replace(new RegExp(`^(\\D+)?[0${a}]+(?=0)`),"$1").replace(new RegExp(`^(\\D+)?[0${a}]+(?=[1-9])`),"$1")},o=(s,a)=>{let l=s.slice(0,a),c=s.slice(a).startsWith("0");return l.length-r(l).length+(c?1:0)};return({value:s,selection:a})=>{let[l,c]=a,{cleanValue:d,extractedPrefix:p,extractedPostfix:g}=ci(s,{prefix:t,postfix:n}),h=!!i&&d.includes(i),[_="",P=""]=i?d.split(i):[d],z=r(_);if(_===z)return{value:s,selection:a};let M=l-o(s,l),W=c-o(s,c);return{value:p+z+(h?i:"")+P+g,selection:[Math.max(M,0),Math.max(W,0)]}}}function Zx({min:i,max:e,decimalSeparator:t,minusSign:n}){return({value:r,selection:o})=>{let s=zc(r,t),a=s>0?Math.min(s,e):Math.max(s,i);if(s&&a!==s){let l=`${a}`.replace(".",t).replace(ea,n);return{value:l,selection:[l.length,l.length]}}return{value:r,selection:o}}}function Jx({decimalSeparator:i,thousandSeparator:e,decimalZeroPadding:t}){return({elementState:n,data:r},o)=>{let{value:s,selection:a}=n,[l,c]=a,d=s.slice(l,c),p=t?[i,e]:[e],g=t&&l>s.indexOf(i)&&!!d.match(/^0+$/gi);return o!=="deleteBackward"&&o!=="deleteForward"||!p.includes(d)&&!g?{elementState:n,data:r}:{elementState:{value:s,selection:o==="deleteForward"?[c,c]:[l,l]},data:r}}}function eC({decimalSeparator:i,precision:e,prefix:t,postfix:n}){let r=new RegExp(`^\\D*${yt(i)}`);return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPrefix:d}=ci(a,{prefix:t,postfix:n}),[p,g]=l,h=ar(p-d.length,0,c.length),_=ar(g-d.length,0,c.length);if(e<=0||c.slice(0,h).includes(i)||c.slice(_).includes(i)||!s.match(r))return{elementState:o,data:s};let P=/\d+/.exec(c.slice(0,h));return{elementState:o,data:P?s:`0${s}`}}}function Pf({validCharacter:i,pseudoCharacters:e,prefix:t,postfix:n}){let r=new RegExp(`[${e.join("")}]`,"gi");return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPostfix:d,extractedPrefix:p}=ci(a,{prefix:t,postfix:n});return{elementState:{selection:l,value:p+c.replace(r,i)+d},data:s.replace(r,i)}}}function tC({decimalSeparator:i,prefix:e,postfix:t}){return i?({elementState:n,data:r})=>{let{value:o,selection:s}=n,[a,l]=s,{cleanValue:c}=ci(o,{prefix:e,postfix:t});return{elementState:n,data:!c.includes(i)||o.slice(a,l+1).includes(i)?r:r.replaceAll(new RegExp(yt(i),"gi"),"")}}:lr}function iC({thousandSeparator:i,decimalSeparator:e,prefix:t,postfix:n,minusSign:r}){if(!i)return lr;let o=(...s)=>s.every(a=>/\s/.test(a));return({value:s,selection:a})=>{let[l,c]=a,[d,p]=a,{cleanValue:g,extractedPostfix:h,extractedPrefix:_}=ci(s,{prefix:t,postfix:n}),{minus:P,integerPart:z,decimalPart:M}=Rf(g,{decimalSeparator:e,minusSign:r}),W=e&&g.includes(e),de=g.length-(P+z+(W?e+M:"")).length;de>0&&l&&l<=de&&(d-=de),de>0&&c&&c<=de&&(p-=de);let oe=Array.from(z).reduceRight((ee,b,w)=>{let A=!(!w&&b===i)&&!!ee.length&&(ee.length+1)%4===0,L=b===i||o(b,i);return A&&L?i+ee:!A&&L?(w&&w<=l&&d--,w&&w<=c&&p--,ee):A?(w<l&&d++,w<c&&p++,b+i+ee):b+ee},"");return{value:_+P+oe+(W?e:"")+M+h,selection:[d,p]}}}function nC({precision:i,decimalSeparator:e,prefix:t,postfix:n}){if(i>0||!e)return lr;let r=new RegExp(`${yt(e)}.*$`,"g");return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPrefix:d,extractedPostfix:p}=ci(a,{prefix:t,postfix:n}),[g,h]=l,_=d+c.replace(r,"")+p;return{elementState:{selection:[Math.min(g,_.length),Math.min(h,_.length)],value:_},data:s.replace(r,"")}}}var Ef=[0,0];function rC({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n}){let r=Qx({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n});return cr("blur",o=>{let s=r({value:o.value,selection:Ef},{value:"",selection:Ef}).value;sr(o,s)},{capture:!0})}function oC({min:i,max:e,decimalSeparator:t}){return cr("blur",(n,r)=>{let o=zc(n.value,t),s=ar(o,i,e);!Number.isNaN(o)&&o!==s&&sr(n,un(qx(s),r))},{capture:!0})}function sC({decimalSeparator:i,prefix:e,postfix:t}){return i?cr("blur",n=>{let{cleanValue:r,extractedPostfix:o,extractedPrefix:s}=ci(n.value,{prefix:e,postfix:t}),a=s+r.replace(new RegExp(`^(\\D+)?${yt(i)}`),`$10${i}`)+o;sr(n,a)},{capture:!0}):zx}function dr({max:i=Number.MAX_SAFE_INTEGER,min:e=Number.MIN_SAFE_INTEGER,precision:t=0,thousandSeparator:n=Nc,decimalSeparator:r=".",decimalPseudoSeparators:o,decimalZeroPadding:s=!1,prefix:a="",postfix:l="",minusSign:c=Bc}={}){let d=[ea,Df,kf,Tf,Bc].filter(_=>_!==n&&_!==r&&_!==c),p=Gx({decimalSeparator:r,thousandSeparator:n,decimalPseudoSeparators:o}),g=a.endsWith(r)&&t>0?`${a}${Bx}`:a,h=Kx({decimalSeparator:r,decimalPseudoSeparators:p,pseudoMinuses:d,prefix:g,postfix:l,minusSign:c});return r=t<=0&&r===n?"":r,Object.assign(Object.assign({},or),{mask:Ff({decimalSeparator:r,precision:t,thousandSeparator:n,prefix:g,postfix:l,isNegativeAllowed:e<0,minusSign:c}),preprocessors:[jx(),h,$x({prefix:g,postfix:l}),Pf({validCharacter:c,pseudoCharacters:d,prefix:g,postfix:l}),Pf({validCharacter:r,pseudoCharacters:p,prefix:g,postfix:l}),eC({decimalSeparator:r,precision:t,prefix:g,postfix:l}),Jx({decimalSeparator:r,decimalZeroPadding:s,thousandSeparator:n}),nC({precision:t,decimalSeparator:r,prefix:g,postfix:l}),tC({decimalSeparator:r,prefix:g,postfix:l})],postprocessors:[Zx({decimalSeparator:r,min:e,max:i,minusSign:c}),Ux(g),Vx(l),iC({decimalSeparator:r,thousandSeparator:n,prefix:g,postfix:l,minusSign:c}),Xx({decimalSeparator:r,decimalZeroPadding:s,precision:t,prefix:g,postfix:l}),Yx({prefix:g,postfix:l,decimalSeparator:r,minusSign:c})],plugins:[rC({decimalSeparator:r,thousandSeparator:n,prefix:g,postfix:l}),sC({decimalSeparator:r,prefix:g,postfix:l}),oC({min:e,max:i,decimalSeparator:r})],overwriteMode:s?({value:_,selection:[P]})=>P<=_.indexOf(r)?"shift":"replace":"shift"})}var Ji=(()=>{class i{constructor(){this.elementRef=N(Dt).nativeElement,this.ngZone=N(Et),this.maskedElement=null,this.options=null,this.elementPredicate=wf;let t=N(tt,{self:!0,optional:!0});if(t){let n=t.writeValue.bind(t);t.writeValue=r=>{n(this.options?un(String(r??""),this.options):r)}}}ngOnChanges(){return B(this,null,function*(){let{elementPredicate:t,options:n,maskedElement:r,elementRef:o,ngZone:s}=this;if(r?.destroy(),!n)return;let a=yield t(o);this.elementPredicate!==t||this.options!==n||s.runOutsideAngular(()=>{this.maskedElement=new Zs(a,n)})})}ngOnDestroy(){this.maskedElement?.destroy()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275dir=ln({type:i,selectors:[["","maskito",""]],inputs:{options:[0,"maskito","options"],elementPredicate:[0,"maskitoElement","elementPredicate"]},standalone:!0,features:[gi]})}}return i})(),Mf=(()=>{class i{transform(t,n){return un(String(t??""),n??or)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=ss({name:"maskito",type:i,pure:!0,standalone:!0})}}return i})();var lC=20,Bf=(()=>{class i{constructor(t,n,r){this._ngZone=t,this._platform=n,this._scrolled=new et,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){let n=this.scrollContainers.get(t);n&&(n.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=lC){return this._platform.isBrowser?new Pt(n=>{this._globalSubscription||this._addGlobalListener();let r=t>0?this._scrolled.pipe(al(t)).subscribe(n):this._scrolled.subscribe(n);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):Le()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,n)=>this.deregister(n)),this._scrolled.complete()}ancestorScrolled(t,n){let r=this.getAncestorScrollContainers(t);return this.scrolled(n).pipe(Kt(o=>!o||r.indexOf(o)>-1))}getAncestorScrollContainers(t){let n=[];return this.scrollContainers.forEach((r,o)=>{this._scrollableContainsElement(o,t)&&n.push(o)}),n}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,n){let r=Hp(n),o=t.getElementRef().nativeElement;do if(r==o)return!0;while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>{let t=this._getWindow();return sn(t.document,"scroll").subscribe(()=>this._scrolled.next())})}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}static{this.\u0275fac=function(n){return new(n||i)(pe(Et),pe(Ii),pe(gt,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var cC=20,eo=(()=>{class i{constructor(t,n,r){this._platform=t,this._change=new et,this._changeListener=o=>{this._change.next(o)},this._document=r,n.runOutsideAngular(()=>{if(t.isBrowser){let o=this._getWindow();o.addEventListener("resize",this._changeListener),o.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){let t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){let t=this.getViewportScrollPosition(),{width:n,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+n,height:r,width:n}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let t=this._document,n=this._getWindow(),r=t.documentElement,o=r.getBoundingClientRect(),s=-o.top||t.body.scrollTop||n.scrollY||r.scrollTop||0,a=-o.left||t.body.scrollLeft||n.scrollX||r.scrollLeft||0;return{top:s,left:a}}change(t=cC){return t>0?this._change.pipe(al(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}static{this.\u0275fac=function(n){return new(n||i)(pe(Ii),pe(Et),pe(gt,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var ta=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=zt({type:i})}static{this.\u0275inj=Nt({})}}return i})(),Lc=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=zt({type:i})}static{this.\u0275inj=Nt({imports:[zr,ta,zr,ta]})}}return i})();var zf=Lp(),Hc=class{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){let e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=We(-this._previousScrollPosition.left),e.style.top=We(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let e=this._document.documentElement,t=this._document.body,n=e.style,r=t.style,o=n.scrollBehavior||"",s=r.scrollBehavior||"";this._isEnabled=!1,n.left=this._previousHTMLStyles.left,n.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),zf&&(n.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),zf&&(n.scrollBehavior=o,r.scrollBehavior=s)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let t=this._document.body,n=this._viewportRuler.getViewportSize();return t.scrollHeight>n.height||t.scrollWidth>n.width}};var jc=class{constructor(e,t,n,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=n,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef,this._overlayRef=e}enable(){if(this._scrollSubscription)return;let e=this._scrollDispatcher.scrolled(0).pipe(Kt(t=>!t||!this._overlayRef.overlayElement.contains(t.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{let t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},ia=class{enable(){}disable(){}attach(){}};function Vc(i,e){return e.some(t=>{let n=i.bottom<t.top,r=i.top>t.bottom,o=i.right<t.left,s=i.left>t.right;return n||r||o||s})}function Lf(i,e){return e.some(t=>{let n=i.top<t.top,r=i.bottom>t.bottom,o=i.left<t.left,s=i.right>t.right;return n||r||o||s})}var Uc=class{constructor(e,t,n,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=n,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef,this._overlayRef=e}enable(){if(!this._scrollSubscription){let e=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(e).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:n,height:r}=this._viewportRuler.getViewportSize();Vc(t,[{width:n,height:r,bottom:r,right:n,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},uC=(()=>{class i{constructor(t,n,r,o){this._scrollDispatcher=t,this._viewportRuler=n,this._ngZone=r,this.noop=()=>new ia,this.close=s=>new jc(this._scrollDispatcher,this._ngZone,this._viewportRuler,s),this.block=()=>new Hc(this._viewportRuler,this._document),this.reposition=s=>new Uc(this._scrollDispatcher,this._viewportRuler,this._ngZone,s),this._document=o}static{this.\u0275fac=function(n){return new(n||i)(pe(Bf),pe(eo),pe(Et),pe(gt))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),to=class{constructor(e){if(this.scrollStrategy=new ia,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){let t=Object.keys(e);for(let n of t)e[n]!==void 0&&(this[n]=e[n])}}};var Wc=class{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}};var $f=(()=>{class i{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){let n=this._attachedOverlays.indexOf(t);n>-1&&this._attachedOverlays.splice(n,1),this._attachedOverlays.length===0&&this.detach()}static{this.\u0275fac=function(n){return new(n||i)(pe(gt))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),pC=(()=>{class i extends $f{constructor(t,n){super(t),this._ngZone=n,this._keydownListener=r=>{let o=this._attachedOverlays;for(let s=o.length-1;s>-1;s--)if(o[s]._keydownEvents.observers.length>0){let a=o[s]._keydownEvents;this._ngZone?this._ngZone.run(()=>a.next(r)):a.next(r);break}}}add(t){super.add(t),this._isAttached||(this._ngZone?this._ngZone.runOutsideAngular(()=>this._document.body.addEventListener("keydown",this._keydownListener)):this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}static{this.\u0275fac=function(n){return new(n||i)(pe(gt),pe(Et,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),hC=(()=>{class i extends $f{constructor(t,n,r){super(t),this._platform=n,this._ngZone=r,this._cursorStyleIsSet=!1,this._pointerDownListener=o=>{this._pointerDownEventTarget=Lr(o)},this._clickListener=o=>{let s=Lr(o),a=o.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:s;this._pointerDownEventTarget=null;let l=this._attachedOverlays.slice();for(let c=l.length-1;c>-1;c--){let d=l[c];if(d._outsidePointerEvents.observers.length<1||!d.hasAttached())continue;if(Hf(d.overlayElement,s)||Hf(d.overlayElement,a))break;let p=d._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>p.next(o)):p.next(o)}}}add(t){if(super.add(t),!this._isAttached){let n=this._document.body;this._ngZone?this._ngZone.runOutsideAngular(()=>this._addEventListeners(n)):this._addEventListeners(n),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){let t=this._document.body;t.removeEventListener("pointerdown",this._pointerDownListener,!0),t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(t){t.addEventListener("pointerdown",this._pointerDownListener,!0),t.addEventListener("click",this._clickListener,!0),t.addEventListener("auxclick",this._clickListener,!0),t.addEventListener("contextmenu",this._clickListener,!0)}static{this.\u0275fac=function(n){return new(n||i)(pe(gt),pe(Ii),pe(Et,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function Hf(i,e){let t=typeof ShadowRoot<"u"&&ShadowRoot,n=e;for(;n;){if(n===i)return!0;n=t&&n instanceof ShadowRoot?n.host:n.parentNode}return!1}var qf=(()=>{class i{constructor(t,n){this._platform=n,this._document=t}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t="cdk-overlay-container";if(this._platform.isBrowser||Cl()){let r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let o=0;o<r.length;o++)r[o].remove()}let n=this._document.createElement("div");n.classList.add(t),Cl()?n.setAttribute("platform","test"):this._platform.isBrowser||n.setAttribute("platform","server"),this._document.body.appendChild(n),this._containerElement=n}static{this.\u0275fac=function(n){return new(n||i)(pe(gt),pe(Ii))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),$c=class{constructor(e,t,n,r,o,s,a,l,c,d=!1,p){this._portalOutlet=e,this._host=t,this._pane=n,this._config=r,this._ngZone=o,this._keyboardDispatcher=s,this._document=a,this._location=l,this._outsideClickDispatcher=c,this._animationsDisabled=d,this._injector=p,this._backdropElement=null,this._backdropClick=new et,this._attachments=new et,this._detachments=new et,this._locationChanges=$i.EMPTY,this._backdropClickHandler=g=>this._backdropClick.next(g),this._backdropTransitionendHandler=g=>{this._disposeBackdrop(g.target)},this._keydownEvents=new et,this._outsidePointerEvents=new et,this._renders=new et,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy,this._afterRenderRef=bp(()=>yp(()=>{this._renders.next()},{injector:this._injector}))}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let t=this._portalOutlet.attach(e);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=ds(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof t?.onDestroy=="function"&&t.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){let e=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._disposeBackdrop(this._backdropElement),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=null,e&&this._detachments.next(),this._detachments.complete(),this._afterRenderRef.destroy(),this._renders.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=v(v({},this._config),e),this._updateElementSize()}setDirection(e){this._config=D(v({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){let e=this._config.direction;return e?typeof e=="string"?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let e=this._pane.style;e.width=We(this._config.width),e.height=We(this._config.height),e.minWidth=We(this._config.minWidth),e.minHeight=We(this._config.minHeight),e.maxWidth=We(this._config.maxWidth),e.maxHeight=We(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){let e="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._animationsDisabled&&this._backdropElement.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(e){if(this._animationsDisabled){this._disposeBackdrop(e);return}e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",this._backdropTransitionendHandler)}),e.style.pointerEvents="none",this._backdropTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(()=>{this._disposeBackdrop(e)},500))}}_toggleClasses(e,t,n){let r=Sl(t||[]).filter(o=>!!o);r.length&&(n?e.classList.add(...r):e.classList.remove(...r))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{let e=this._renders.pipe(pl(an(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),e.unsubscribe())})})}_disposeScrollStrategy(){let e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}_disposeBackdrop(e){e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",this._backdropTransitionendHandler),e.remove(),this._backdropElement===e&&(this._backdropElement=null)),this._backdropTimeout&&(clearTimeout(this._backdropTimeout),this._backdropTimeout=void 0)}},jf="cdk-overlay-connected-position-bounding-box",fC=/([A-Za-z%]+)$/,qc=class{get positions(){return this._preferredPositions}constructor(e,t,n,r,o){this._viewportRuler=t,this._document=n,this._platform=r,this._overlayContainer=o,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new et,this._resizeSubscription=$i.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}attach(e){this._overlayRef&&this._overlayRef,this._validatePositions(),e.hostElement.classList.add(jf),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._originRect,t=this._overlayRect,n=this._viewportRect,r=this._containerRect,o=[],s;for(let a of this._preferredPositions){let l=this._getOriginPoint(e,r,a),c=this._getOverlayPoint(l,t,a),d=this._getOverlayFit(c,t,n,a);if(d.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(a,l);return}if(this._canFitWithFlexibleDimensions(d,c,n)){o.push({position:a,origin:l,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(l,a)});continue}(!s||s.overlayFit.visibleArea<d.visibleArea)&&(s={overlayFit:d,overlayPoint:c,originPoint:l,position:a,overlayRect:t})}if(o.length){let a=null,l=-1;for(let c of o){let d=c.boundingBoxRect.width*c.boundingBoxRect.height*(c.position.weight||1);d>l&&(l=d,a=c)}this._isPushed=!1,this._applyPosition(a.position,a.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(s.position,s.originPoint);return}this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&pn(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(jf),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let e=this._lastPosition;if(e){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._getOriginPoint(this._originRect,this._containerRect,e);this._applyPosition(e,t)}else this.apply()}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,e.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t,n){let r;if(n.originX=="center")r=e.left+e.width/2;else{let s=this._isRtl()?e.right:e.left,a=this._isRtl()?e.left:e.right;r=n.originX=="start"?s:a}t.left<0&&(r-=t.left);let o;return n.originY=="center"?o=e.top+e.height/2:o=n.originY=="top"?e.top:e.bottom,t.top<0&&(o-=t.top),{x:r,y:o}}_getOverlayPoint(e,t,n){let r;n.overlayX=="center"?r=-t.width/2:n.overlayX==="start"?r=this._isRtl()?-t.width:0:r=this._isRtl()?0:-t.width;let o;return n.overlayY=="center"?o=-t.height/2:o=n.overlayY=="top"?0:-t.height,{x:e.x+r,y:e.y+o}}_getOverlayFit(e,t,n,r){let o=Uf(t),{x:s,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(s+=l),c&&(a+=c);let d=0-s,p=s+o.width-n.width,g=0-a,h=a+o.height-n.height,_=this._subtractOverflows(o.width,d,p),P=this._subtractOverflows(o.height,g,h),z=_*P;return{visibleArea:z,isCompletelyWithinViewport:o.width*o.height===z,fitsInViewportVertically:P===o.height,fitsInViewportHorizontally:_==o.width}}_canFitWithFlexibleDimensions(e,t,n){if(this._hasFlexibleDimensions){let r=n.bottom-t.y,o=n.right-t.x,s=Vf(this._overlayRef.getConfig().minHeight),a=Vf(this._overlayRef.getConfig().minWidth),l=e.fitsInViewportVertically||s!=null&&s<=r,c=e.fitsInViewportHorizontally||a!=null&&a<=o;return l&&c}return!1}_pushOverlayOnScreen(e,t,n){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};let r=Uf(t),o=this._viewportRect,s=Math.max(e.x+r.width-o.width,0),a=Math.max(e.y+r.height-o.height,0),l=Math.max(o.top-n.top-e.y,0),c=Math.max(o.left-n.left-e.x,0),d=0,p=0;return r.width<=o.width?d=c||-s:d=e.x<this._viewportMargin?o.left-n.left-e.x:0,r.height<=o.height?p=l||-a:p=e.y<this._viewportMargin?o.top-n.top-e.y:0,this._previousPushAmount={x:d,y:p},{x:e.x+d,y:e.y+p}}_applyPosition(e,t){if(this._setTransformOrigin(e),this._setOverlayElementStyles(t,e),this._setBoundingBoxStyles(t,e),e.panelClass&&this._addPanelClasses(e.panelClass),this._positionChanges.observers.length){let n=this._getScrollVisibility();if(e!==this._lastPosition||!this._lastScrollVisibility||!mC(this._lastScrollVisibility,n)){let r=new Wc(e,n);this._positionChanges.next(r)}this._lastScrollVisibility=n}this._lastPosition=e,this._isInitialRender=!1}_setTransformOrigin(e){if(!this._transformOriginSelector)return;let t=this._boundingBox.querySelectorAll(this._transformOriginSelector),n,r=e.overlayY;e.overlayX==="center"?n="center":this._isRtl()?n=e.overlayX==="start"?"right":"left":n=e.overlayX==="start"?"left":"right";for(let o=0;o<t.length;o++)t[o].style.transformOrigin=`${n} ${r}`}_calculateBoundingBoxRect(e,t){let n=this._viewportRect,r=this._isRtl(),o,s,a;if(t.overlayY==="top")s=e.y,o=n.height-s+this._viewportMargin;else if(t.overlayY==="bottom")a=n.height-e.y+this._viewportMargin*2,o=n.height-a+this._viewportMargin;else{let h=Math.min(n.bottom-e.y+n.top,e.y),_=this._lastBoundingBoxSize.height;o=h*2,s=e.y-h,o>_&&!this._isInitialRender&&!this._growAfterOpen&&(s=e.y-_/2)}let l=t.overlayX==="start"&&!r||t.overlayX==="end"&&r,c=t.overlayX==="end"&&!r||t.overlayX==="start"&&r,d,p,g;if(c)g=n.width-e.x+this._viewportMargin*2,d=e.x-this._viewportMargin;else if(l)p=e.x,d=n.right-e.x;else{let h=Math.min(n.right-e.x+n.left,e.x),_=this._lastBoundingBoxSize.width;d=h*2,p=e.x-h,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(p=e.x-_/2)}return{top:s,left:p,bottom:a,right:g,width:d,height:o}}_setBoundingBoxStyles(e,t){let n=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));let r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{let o=this._overlayRef.getConfig().maxHeight,s=this._overlayRef.getConfig().maxWidth;r.height=We(n.height),r.top=We(n.top),r.bottom=We(n.bottom),r.width=We(n.width),r.left=We(n.left),r.right=We(n.right),t.overlayX==="center"?r.alignItems="center":r.alignItems=t.overlayX==="end"?"flex-end":"flex-start",t.overlayY==="center"?r.justifyContent="center":r.justifyContent=t.overlayY==="bottom"?"flex-end":"flex-start",o&&(r.maxHeight=We(o)),s&&(r.maxWidth=We(s))}this._lastBoundingBoxSize=n,pn(this._boundingBox.style,r)}_resetBoundingBoxStyles(){pn(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){pn(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){let n={},r=this._hasExactPosition(),o=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(r){let d=this._viewportRuler.getViewportScrollPosition();pn(n,this._getExactOverlayY(t,e,d)),pn(n,this._getExactOverlayX(t,e,d))}else n.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),n.transform=a.trim(),s.maxHeight&&(r?n.maxHeight=We(s.maxHeight):o&&(n.maxHeight="")),s.maxWidth&&(r?n.maxWidth=We(s.maxWidth):o&&(n.maxWidth="")),pn(this._pane.style,n)}_getExactOverlayY(e,t,n){let r={top:"",bottom:""},o=this._getOverlayPoint(t,this._overlayRect,e);if(this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n)),e.overlayY==="bottom"){let s=this._document.documentElement.clientHeight;r.bottom=`${s-(o.y+this._overlayRect.height)}px`}else r.top=We(o.y);return r}_getExactOverlayX(e,t,n){let r={left:"",right:""},o=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n));let s;if(this._isRtl()?s=e.overlayX==="end"?"left":"right":s=e.overlayX==="end"?"right":"left",s==="right"){let a=this._document.documentElement.clientWidth;r.right=`${a-(o.x+this._overlayRect.width)}px`}else r.left=We(o.x);return r}_getScrollVisibility(){let e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),n=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Lf(e,n),isOriginOutsideView:Vc(e,n),isOverlayClipped:Lf(t,n),isOverlayOutsideView:Vc(t,n)}}_subtractOverflows(e,...t){return t.reduce((n,r)=>n-Math.max(r,0),e)}_getNarrowedViewportRect(){let e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+e-this._viewportMargin,bottom:n.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return t==="x"?e.offsetX==null?this._offsetX:e.offsetX:e.offsetY==null?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&Sl(e).forEach(t=>{t!==""&&this._appliedPanelClasses.indexOf(t)===-1&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){let e=this._origin;if(e instanceof Dt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();let t=e.width||0,n=e.height||0;return{top:e.y,bottom:e.y+n,left:e.x,right:e.x+t,height:n,width:t}}};function pn(i,e){for(let t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}function Vf(i){if(typeof i!="number"&&i!=null){let[e,t]=i.split(fC);return!t||t==="px"?parseFloat(e):null}return i||null}function Uf(i){return{top:Math.floor(i.top),right:Math.floor(i.right),bottom:Math.floor(i.bottom),left:Math.floor(i.left),width:Math.floor(i.width),height:Math.floor(i.height)}}function mC(i,e){return i===e?!0:i.isOriginClipped===e.isOriginClipped&&i.isOriginOutsideView===e.isOriginOutsideView&&i.isOverlayClipped===e.isOverlayClipped&&i.isOverlayOutsideView===e.isOverlayOutsideView}var Wf="cdk-global-overlay-wrapper",Gc=class{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._alignItems="",this._xPosition="",this._xOffset="",this._width="",this._height="",this._isDisposed=!1}attach(e){let t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(Wf),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._xOffset=e,this._xPosition="left",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._xOffset=e,this._xPosition="right",this}start(e=""){return this._xOffset=e,this._xPosition="start",this}end(e=""){return this._xOffset=e,this._xPosition="end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._xPosition="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:r,height:o,maxWidth:s,maxHeight:a}=n,l=(r==="100%"||r==="100vw")&&(!s||s==="100%"||s==="100vw"),c=(o==="100%"||o==="100vh")&&(!a||a==="100%"||a==="100vh"),d=this._xPosition,p=this._xOffset,g=this._overlayRef.getConfig().direction==="rtl",h="",_="",P="";l?P="flex-start":d==="center"?(P="center",g?_=p:h=p):g?d==="left"||d==="end"?(P="flex-end",h=p):(d==="right"||d==="start")&&(P="flex-start",_=p):d==="left"||d==="start"?(P="flex-start",h=p):(d==="right"||d==="end")&&(P="flex-end",_=p),e.position=this._cssPosition,e.marginLeft=l?"0":h,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=l?"0":_,t.justifyContent=P,t.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,n=t.style;t.classList.remove(Wf),n.justifyContent=n.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}},gC=(()=>{class i{constructor(t,n,r,o){this._viewportRuler=t,this._document=n,this._platform=r,this._overlayContainer=o}global(){return new Gc}flexibleConnectedTo(t){return new qc(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}static{this.\u0275fac=function(n){return new(n||i)(pe(eo),pe(gt),pe(Ii),pe(qf))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),yC=0,en=(()=>{class i{constructor(t,n,r,o,s,a,l,c,d,p,g,h){this.scrollStrategies=t,this._overlayContainer=n,this._componentFactoryResolver=r,this._positionBuilder=o,this._keyboardDispatcher=s,this._injector=a,this._ngZone=l,this._document=c,this._directionality=d,this._location=p,this._outsideClickDispatcher=g,this._animationsModuleType=h}create(t){let n=this._createHostElement(),r=this._createPaneElement(n),o=this._createPortalOutlet(r),s=new to(t);return s.direction=s.direction||this._directionality.value,new $c(o,n,r,s,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,this._animationsModuleType==="NoopAnimations",this._injector.get(hp))}position(){return this._positionBuilder}_createPaneElement(t){let n=this._document.createElement("div");return n.id=`cdk-overlay-${yC++}`,n.classList.add("cdk-overlay-pane"),t.appendChild(n),n}_createHostElement(){let t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(vp)),new Np(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}static{this.\u0275fac=function(n){return new(n||i)(pe(uC),pe(qf),pe(gp),pe(gC),pe(pC),pe(Ge),pe(Et),pe(gt),pe(Os),pe(ms),pe(hC),pe(fp,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var vC=new Rr("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let i=N(en);return()=>i.scrollStrategies.reposition()}});function bC(i){return()=>i.scrollStrategies.reposition()}var _C={provide:vC,deps:[en],useFactory:bC},Gf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=zt({type:i})}static{this.\u0275inj=Nt({providers:[en,_C],imports:[zr,zp,Lc,Lc]})}}return i})();var PC=["panel"],EC=["*"];function DC(i,e){if(i&1){let t=Ie();f(0,"div",1,0),U("@panelAnimation.done",function(r){se(t);let o=O();return ae(o._animationDone.next(r))}),Un(2),m()}if(i&2){let t=e.id,n=O();us(n._classList),jn("mat-mdc-autocomplete-visible",n.showPanel)("mat-mdc-autocomplete-hidden",!n.showPanel)("mat-primary",n._color==="primary")("mat-accent",n._color==="accent")("mat-warn",n._color==="warn"),E("id",n.id)("@panelAnimation",n.isOpen?"visible":"hidden"),Lt("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(t))}}var kC=Ep("panelAnimation",[kp("void, hidden",Nr({opacity:0,transform:"scaleY(0.8)"})),wl(":enter, hidden => visible",[Dp([bs("0.03s linear",Nr({opacity:1})),bs("0.12s cubic-bezier(0, 0, 0.2, 1)",Nr({transform:"scaleY(1)"}))])]),wl(":leave, visible => hidden",[bs("0.075s linear",Nr({opacity:0}))])]),TC=0,Yc=class{constructor(e,t){this.source=e,this.option=t}},Kf=new Rr("mat-autocomplete-default-options",{providedIn:"root",factory:IC});function IC(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var Qf=(()=>{class i{get isOpen(){return this._isOpen&&this.showPanel}_setColor(t){this._color=t,this._changeDetectorRef.markForCheck()}set classList(t){this._classList=t,this._elementRef.nativeElement.className=""}get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._syncParentProperties()}_syncParentProperties(){if(this.options)for(let t of this.options)t._changeDetectorRef.markForCheck()}constructor(t,n,r,o){this._changeDetectorRef=t,this._elementRef=n,this._defaults=r,this._activeOptionChanges=$i.EMPTY,this._animationDone=new lt,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new lt,this.opened=new lt,this.closed=new lt,this.optionActivated=new lt,this.id=`mat-autocomplete-${TC++}`,this.inertGroups=o?.SAFARI||!1,this.autoActiveFirstOption=!!r.autoActiveFirstOption,this.autoSelectActiveOption=!!r.autoSelectActiveOption,this.requireSelection=!!r.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new Up(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe(),this._animationDone.complete()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){let n=new Yc(this,t);this.optionSelected.emit(n)}_getPanelAriaLabelledby(t){if(this.ariaLabel)return null;let n=t?t+" ":"";return this.ariaLabelledby?n+this.ariaLabelledby:t}_skipPredicate(){return!1}static{this.\u0275fac=function(n){return new(n||i)(He(cn),He(Dt),He(Kf),He(Ii))}}static{this.\u0275cmp=fe({type:i,selectors:[["mat-autocomplete"]],contentQueries:function(n,r,o){if(n&1&&(hs(o,As,5),hs(o,$p,5)),n&2){let s;Jt(s=ei())&&(r.options=s),Jt(s=ei())&&(r.optionGroups=s)}},viewQuery:function(n,r){if(n&1&&(yi(Mr,7),yi(PC,5)),n&2){let o;Jt(o=ei())&&(r.template=o.first),Jt(o=ei())&&(r.panel=o.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",Gi],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",Gi],requireSelection:[2,"requireSelection","requireSelection",Gi],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",Gi],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",Gi]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],standalone:!0,features:[fs([{provide:Wp,useExisting:i}]),Ar,ye],ngContentSelectors:EC,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(n,r){n&1&&(Vn(),ue(0,DC,3,16,"ng-template"))},styles:["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape, var(--mat-app-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color, var(--mat-app-surface-container))}.cdk-high-contrast-active div.mat-mdc-autocomplete-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}"],encapsulation:2,data:{animation:[kC]},changeDetection:0})}}return i})();var OC={provide:Tp,useExisting:pp(()=>Kc),multi:!0};var Zf=new Rr("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let i=N(en);return()=>i.scrollStrategies.reposition()}});function FC(i){return()=>i.scrollStrategies.reposition()}var RC={provide:Zf,deps:[en],useFactory:FC},Kc=(()=>{class i{constructor(t,n,r,o,s,a,l,c,d,p,g){this._element=t,this._overlay=n,this._viewContainerRef=r,this._zone=o,this._changeDetectorRef=s,this._dir=l,this._formField=c,this._document=d,this._viewportRuler=p,this._defaults=g,this._componentDestroyed=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=$i.EMPTY,this._breakpointObserver=N(jp),this._handsetLandscapeSubscription=$i.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new et,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._initialized=new et,this._injector=N(Ge),this._aboveClass="mat-mdc-autocomplete-panel-above",this._overlayAttached=!1,this.optionSelections=cp(()=>{let h=this.autocomplete?this.autocomplete.options:null;return h?h.changes.pipe(ul(h),qi(()=>an(...h.map(_=>_.onSelectionChange)))):this._initialized.pipe(qi(()=>this.optionSelections))}),this._handlePanelKeydown=h=>{(h.keyCode===27&&!Rs(h)||h.keyCode===38&&Rs(h,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),h.stopPropagation(),h.preventDefault())},this._trackedModal=null,this._scrollStrategy=a}ngAfterViewInit(){this._initialized.next(),this._initialized.complete();let t=this._getWindow();typeof t<"u"&&this._zone.runOutsideAngular(()=>t.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){let t=this._getWindow();typeof t<"u"&&t.removeEventListener("blur",this._windowBlurHandler),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&Ms(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return an(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Kt(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Kt(()=>this._overlayAttached)):Le()).pipe(mi(t=>t instanceof qp?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return an(sn(this._document,"click"),sn(this._document,"auxclick"),sn(this._document,"touchend")).pipe(Kt(t=>{let n=Lr(t),r=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,o=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&n!==this._element.nativeElement&&this._document.activeElement!==this._element.nativeElement&&(!r||!r.contains(n))&&(!o||!o.contains(n))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(n)}))}writeValue(t){Promise.resolve(null).then(()=>this._assignOptionValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){let n=t.keyCode,r=Rs(t);if(n===27&&!r&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&n===13&&this.panelOpen&&!r)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let o=this.autocomplete._keyManager.activeItem,s=n===38||n===40;n===9||s&&!r&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):s&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(s||this.autocomplete._keyManager.activeItem!==o)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(t){let n=t.target,r=n.value;if(n.type==="number"&&(r=r==""?null:parseFloat(r)),this._previousValue!==r){if(this._previousValue=r,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(r),!r)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let o=this.autocomplete.options?.find(s=>s.selected);if(o){let s=this._getDisplayValue(o.value);r!==s&&o.deselect(!1)}}if(this._canOpen()&&this._document.activeElement===t.target){let o=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(o)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_floatLabel(t=!1){this._formField&&this._formField.floatLabel==="auto"&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let t=new Pt(r=>{ds(()=>{r.next()},{injector:this._injector})}),n=this.autocomplete.options.changes.pipe(xe(()=>this._positionStrategy.reapplyLastPosition()),up(0));return an(t,n).pipe(qi(()=>this._zone.run(()=>{let r=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),r!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),ll(1)).subscribe(r=>this._setValueAndClose(r))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(t){let n=this.autocomplete;return n&&n.displayWith?n.displayWith(t):t}_assignOptionValue(t){let n=this._getDisplayValue(t);t==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(n??"")}_updateNativeInputValue(t){this._formField?this._formField._control.value=t:this._element.nativeElement.value=t,this._previousValue=t}_setValueAndClose(t){let n=this.autocomplete,r=t?t.source:this._pendingAutoselectedOption;r?(this._clearPreviousSelectedOption(r),this._assignOptionValue(r.value),this._onChange(r.value),n._emitSelectEvent(r),this._element.nativeElement.focus()):n.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),n._animationDone?n._animationDone.pipe(ll(1)).subscribe(()=>this._onChange(null)):this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(t,n){this.autocomplete?.options?.forEach(r=>{r!==t&&r.selected&&r.deselect(n)})}_openPanelInternal(t=this._element.nativeElement.value){if(this._attachOverlay(t),this._floatLabel(),this._trackedModal){let n=this.autocomplete.id;El(this._trackedModal,"aria-owns",n)}}_attachOverlay(t){this.autocomplete;let n=this._overlayRef;n?(this._positionStrategy.setOrigin(this._getConnectedElement()),n.updateSize({width:this._getPanelWidth()})):(this._portal=new xl(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),n=this._overlay.create(this._getOverlayConfig()),this._overlayRef=n,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&n&&n.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(Vp.HandsetLandscape).subscribe(o=>{o.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),n&&!n.hasAttached()&&(n.attach(this._portal),this._valueOnAttach=t,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let r=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&r!==this.panelOpen&&this._emitOpened()}_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let t=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=t.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=t.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new to({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){let n=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],r=this._aboveClass,o=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:r},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:r}],s;this.position==="above"?s=o:this.position==="below"?s=n:s=[...n,...o],t.withPositions(s)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let t=this.autocomplete;if(t.autoActiveFirstOption){let n=-1;for(let r=0;r<t.options.length;r++)if(!t.options.get(r).disabled){n=r;break}t._keyManager.setActiveItem(n)}else t._keyManager.setActiveItem(-1)}_canOpen(){let t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this.autocompleteDisabled}_getWindow(){return this._document?.defaultView||window}_scrollToOption(t){let n=this.autocomplete,r=Gp(t,n.options,n.optionGroups);if(t===0&&r===1)n._setScrollTop(0);else if(n.panel){let o=n.options.toArray()[t];if(o){let s=o._getHostElement(),a=Xp(s.offsetTop,s.offsetHeight,n._getScrollTop(),n.panel.nativeElement.offsetHeight);n._setScrollTop(a)}}}_applyModalPanelOwnership(){let t=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!t)return;let n=this.autocomplete.id;this._trackedModal&&Ms(this._trackedModal,"aria-owns",n),El(t,"aria-owns",n),this._trackedModal=t}_clearFromModal(){if(this._trackedModal){let t=this.autocomplete.id;Ms(this._trackedModal,"aria-owns",t),this._trackedModal=null}}static{this.\u0275fac=function(n){return new(n||i)(He(Dt),He(en),He(cs),He(Et),He(cn),He(Zf),He(Os,8),He(Yp,9),He(gt,8),He(eo),He(Kf,8))}}static{this.\u0275dir=ln({type:i,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(n,r){n&1&&U("focusin",function(){return r._handleFocus()})("blur",function(){return r._onTouched()})("input",function(s){return r._handleInput(s)})("keydown",function(s){return r._handleKeydown(s)})("click",function(){return r._handleClick()}),n&2&&Lt("autocomplete",r.autocompleteAttribute)("role",r.autocompleteDisabled?null:"combobox")("aria-autocomplete",r.autocompleteDisabled?null:"list")("aria-activedescendant",r.panelOpen&&r.activeOption?r.activeOption.id:null)("aria-expanded",r.autocompleteDisabled?null:r.panelOpen.toString())("aria-controls",r.autocompleteDisabled||!r.panelOpen||r.autocomplete==null?null:r.autocomplete.id)("aria-haspopup",r.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",Gi]},exportAs:["matAutocompleteTrigger"],standalone:!0,features:[fs([OC]),Ar,gi]})}}return i})(),Jf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=zt({type:i})}static{this.\u0275inj=Nt({providers:[RC],imports:[Gf,kl,Dl,ni,ta,kl,Dl]})}}return i})();function hn(i="emit"){return e=>e.pipe(xe(t=>console.log(`${i}`,t)))}var io=()=>{let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16;return t=(i+t)%16|0,i=Math.floor(i/16),(e==="x"?t:t&3|8).toString(16)})};var Qc={dashboard:{View:"DashV"},estimate:{Create:"EstC",Edit:"EstE",Delete:"EstD"},report:{View:"Rep",Advanced:"RepA",Profit:"RepF"},shift:{View:"Shift",Create:"ShiftC",Edit:"ShiftE",Void:"ShiftVo"},contact:{View:"Con",Create:"ConC",Edit:"ConE",Delete:"ConD",LoyaltyPointEditor:"LoyPE",ContactDetail:"ContD",ContactImageEditor:"ContE",ContactSensitiveField:"ConSF",Supplier:"Supp"},sell:{Create:"Sell",PricebookSelector:"PricebS",Edit:"SellE",Delete:"SellD",Number:"NumE",SalesPerson:"SalesmanE",Return:"Return",Discount:"Disc",UnitPriceEditor:"UnitPE",Commission:"Comms",Tax:"Tax",CustomerInputLock:"CustL",Payment:"PayR",PriceVisible:"PriceV",PriceMinimum:"PriceM",Email:"Email",DeleteItem:"DelItm",Shipping:"Ship",PaymentCodeLock:"PayCL",EraseVoidOrd:"EraseVO",RestoreVoidOrd:"RestVO",RetrieveR:"RetrieveR",BundlingPrice:"BundlP",ClearCartRestriction:"ClearCartRestriction",CreditSalesLock:"CredSL",CouponInputLock:"CouponInputLock",Park:"Park"},orders:{View:"Ord",SupplierBill:"OrdB",VoidInvoice:"OrdVo",Print:"OrdRpr",NoteEditor:"OrdNe",Invoice:"OrdIr",Erase:"EraseVO"},product:{View:"Prod",Delete:"ProdD",ImageEditor:"ImgE",Create:"ProdC",Edit:"ProdE",Cost:"Cost",BarcodePrinting:"BarP",DeleteAllOutletPrice:"DeleteAllOutletPrice",Expense:"Expense",CommissionView:"CommV",ProductSensitiveField:"ProdSF",Price:"PriceV"},payment:{View:"Pay",Delete:"PayD",Create:"PayC",Edit:"PayE"},adjustment:{View:"Adj",Delete:"AdjD",Create:"AdjC",Edit:"AdjE",Approval:"AdjApp",InventoryProductCount:"InvPC"},buy:{Delete:"BuyD",Create:"Buy",Edit:"BuyE",ShippingRestriction:"BuySh",Approval:"PurA",Report:"BuyR"},logistics:{View:"Del",Create:"DelC",Edit:"DelE",Delete:"DelD",TransferOrderEditor:"DelRE",Outbound:"FulF",TransferOrderApproval:"DelA",TransferOrderReceiver:"DelR"},debt:{View:"Debt",Delete:"DebtD",Create:"DebtC",Edit:"DebtE"},prepaidPackage:{View:"Tre",Create:"TreC",Edit:"TreE",Delete:"TreD",TreatmentIncentive:"TreI",SharePackageEditor:"SharPacE",TreatmentNote:"TreN",Doctor:"Doct"},inventory:{View:"Inv",Edit:"InvE"},promotion:{View:"Prom",Create:"PromC",Edit:"PromE",Delete:"PromD",Coupon:"Cou",Pricebook:"Pri"},accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec"},users:{View:"Use",Create:"UseC",Edit:"UseE",Delete:"UseD",Groups:"Gro",LoginTimeRestriction:"LogTR",UserIPRestriction:"UseIR",GroupsRestriction:"UseG",LogRestriction:"LogResct"},outlets:{View:"Out",Create:"OutC",Edit:"OutE",Delete:"OutD"},setup:{View:"Stp",Create:"StpC",Edit:"StpE",Delete:"StpD",Webhook:"StpWh",Developer:"StpDev"},service:{View:"Serv"},myProfile:{View:"Prof",Notification:"Notf",Subscription:"Subs",Activity:"Actv"},customerDisplay:{View:"Disp"},orderDisplay:{View:"KitD"},global:{Export:"Export",Number:"NumE",Date:"DateE"},apps:{Marketplace:"Mrp",Jurnal:"Jurnal",Tools:"Tools"},fulfillment:{View:"Ful",Edit:"FulE",Create:"FulC",Delete:"FulD",Ship:"FulS"},manufacture:{View:"Man",Create:"ManC",Edit:"ManE",Delete:"ManD"},developer:{Api:"API",View:"Dev",Edit:"DevE"}};var em=(()=>{class i{constructor(){this._roles=[],this.parseJWTRoles()}parseJWTRoles(){let t=localStorage.getItem("Token");if(t){var n=Pl(t);this._roles=n["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"],console.log(this._roles)}}isInRole(t,n){let r={};return n.forEach((o,s)=>r[t[s]]=typeof o=="string"?this._roles.includes(o):o(this._roles)),r}isUserHasRole(t){return this._roles.includes(t)}get product(){return this._product||(this._product=this.setBulkRole("product")),this._product}get contact(){return this._contact||(this._contact=this.setBulkRole("contact")),this._contact}get promotion(){return this._promotion||(this._promotion=this.setBulkRole("promotion")),this._promotion}get accounting(){return this._accounting||(this._accounting=this.setBulkRole("accounting")),this._accounting}get users(){return this._users||(this._users=this.setBulkRole("users")),this._users}get outlets(){return this._outlets||(this._outlets=this.setBulkRole("outlets")),this._outlets}get setup(){return this._setup||(this._setup=this.setBulkRole("setup")),this._setup}get service(){return this._service||(this._service=this.setBulkRole("service")),this._service}get profile(){return this._profile||(this._profile=this.setBulkRole("myProfile")),this._profile}get customerDisplay(){return this._customerDisplay||(this._customerDisplay=this.setBulkRole("customerDisplay")),this._customerDisplay}get orderDisplay(){return this._orderDisplay||(this._orderDisplay=this.setBulkRole("orderDisplay")),this._orderDisplay}get global(){return this._global||(this._global=this.setBulkRole("global")),this._global}get apps(){return this._apps||(this._apps=this.setBulkRole("apps")),this._apps}get fulfillment(){return this._fulfillment||(this._fulfillment=this.setBulkRole("fulfillment")),this._fulfillment}get manufacture(){return this._manufacture||(this._manufacture=this.setBulkRole("manufacture")),this._manufacture}get inventory(){return this._inventory||(this._inventory=this.setBulkRole("inventory")),this._inventory}get sell(){return this._sell||(this._sell=this.setBulkRole("sell")),this._sell}get report(){return this._report||(this._report=this.setBulkRole("report")),this._report}get buy(){return this._buy||(this._buy=this.setBulkRole("buy")),this._buy}get adjustment(){return this._adjustment||(this._adjustment=this.setBulkRole("adjustment")),this._adjustment}get debt(){return this._debt||(this._debt=this.setBulkRole("debt")),this._debt}get payment(){return this._payment||(this._payment=this.setBulkRole("payment")),this._payment}get prepaidPackage(){return this._prepaidPackage||(this._prepaidPackage=this.setBulkRole("prepaidPackage")),this._prepaidPackage}get order(){return this._order||(this._order=this.setBulkRole("orders")),this._order}get logistic(){return this._logistic||(this._logistic=this.setBulkRole("logistics")),this._logistic}get estimate(){return this._estimate||(this._estimate=this.setBulkRole("estimate")),this._estimate}get shift(){return this._shift||(this._shift=this.setBulkRole("shift")),this._shift}get developer(){return this._developer||(this._developer=this.setBulkRole("developer")),this._developer}get dashboard(){return this._dashboard||(this._dashboard=this.setBulkRole("dashboard")),this._dashboard}setBulkRole(t){let n={};for(let r in Qc[t])n[r]=this.isUserHasRole(Qc[t][r]);return n}get isSystemUser(){let t=localStorage.getItem("Token");return Pl(t).Type=="System"}resetRoles(){this._roles=[],this._accounting=null,this._adjustment=null,this._apps=null,this._buy=null,this._contact=null,this._customerDisplay=null,this._debt=null,this._fulfillment=null,this._estimate=null,this._global=null,this._inventory=null,this._logistic=null,this._manufacture=null,this._order=null,this._orderDisplay=null,this._outlets=null,this._payment=null,this._product=null,this._prepaidPackage=null,this._profile=null,this._promotion=null,this._report=null,this._sell=null,this._service=null,this._setup=null,this._shift=null,this._users=null,this._developer=null,this._dashboard=null}toJSON(){return{product:this.product,contact:this.contact,promotion:this.promotion,accounting:this.accounting,users:this.users,outlets:this.outlets,setup:this.setup,service:this.service,profile:this.profile,customerDisplay:this.customerDisplay,orderDisplay:this.orderDisplay,global:this.global,apps:this.apps,fulfillment:this.fulfillment,manufacture:this.manufacture,inventory:this.inventory,sell:this.sell,report:this.report,buy:this.buy,adjustment:this.adjustment,debt:this.debt,payment:this.payment,prepaidPackage:this.prepaidPackage,order:this.order,logistic:this.logistic,estimate:this.estimate,shift:this.shift,developer:this.developer,dashboard:this.dashboard}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var tm=(i,e)=>e.PromotionID;function AC(i,e){if(i&1&&(f(0,"mat-option",19)(1,"div",20)(2,"span",21),x(3),m(),f(4,"span",22),x(5),m()()()),i&2){let t=e.$implicit;E("value",t),y(3),I(t.Value),y(2),I(t.Code)}}function BC(i,e){if(i&1&&Qt(0,AC,6,3,"mat-option",19,ps),i&2){let t=O();Zt(t)}}function NC(i,e){i&1&&(f(0,"mat-option",18),x(1,"No items found"),m()),i&2&&E("disabled",!0)}function zC(i,e){i&1&&ue(0,BC,2,0)(1,NC,2,1,"mat-option",18),i&2&&Ce(e.length>0?0:1)}function LC(i,e){if(i&1){let t=Ie();f(0,"div",23)(1,"img",24),U("error",function(r){se(t);let o=O();return ae(o.onErrorImage(r))}),m(),f(2,"div",25)(3,"ngb-highlight",26),x(4),m(),f(5,"span"),x(6),m()()()}if(i&2){let t=e.result,n=e.term;y(),E("src",t.ImgUrl,as)("alt",t.Value),y(2),E("result",t.Value)("term",n),y(),I(t.Value),y(2),I(t.Code)}}function HC(i,e){if(i&1&&(f(0,"ng-option",28),x(1),m()),i&2){let t=e.$implicit;E("value",t.PromotionID),y(),I(t.Name)}}function jC(i,e){if(i&1&&(f(0,"ng-select",27),Qt(1,HC,2,2,"ng-option",28,tm),m()),i&2){let t=O(2);y(),Zt(t)}}function VC(i,e){if(i&1&&(f(0,"ng-option",28),x(1),m()),i&2){let t=e.$implicit;E("value",t),y(),I(t.Name)}}function UC(i,e){if(i&1&&(f(0,"ng-select",27),Qt(1,VC,2,2,"ng-option",28,tm),m()),i&2){let t=O(2);y(),Zt(t)}}function WC(i,e){if(i&1&&(f(0,"div",12)(1,"label",9),x(2,"Promotion Price"),m(),ue(3,jC,3,0,"ng-select",27)(4,UC,3,0,"ng-select",27),m()),i&2){let t=O(2);y(3),Ce(t.isEditProduct()?3:4)}}function $C(i,e){i&1&&ue(0,WC,5,1,"div",12),i&2&&Ce(e.length?0:-1)}function qC(i,e){if(i&1){let t=Ie();f(0,"button",29),U("click",function(){se(t);let r=O();return ae(r.resetForm())}),x(1," Cancel "),m()}}var ra=(()=>{class i{constructor(){this.promotionPrice$=Le([]),this.variant$=Le({}),this.UUidSelected="",this.httpService=N(bi),this.fb=N(Yi),this.router=N($n),this.storeService=N(ke),this.location=N(ms),this.maskitoOptions=dr({precision:2,thousandSeparator:","}),this.route=N(ys),this.variant={},this.roleService=N(em),this.domain="",this.isEditProduct=q(!1)}displayFn(t){return t?t.Value:""}initForm(){this.form=this.fb.group({name:new nt("",[ct.required]),quantity:new nt("",[ct.required]),promotionPrice:new nt("",[]),price:new nt("",[ct.required])})}ngAfterViewInit(){this.domain=`https://${localStorage.getItem("Domain")}`}ngOnInit(){this.initForm(),this.form.get("promotionPrice").valueChanges.pipe(Kt(()=>Object.keys(this.variant).length>0),hn("prommotionPrice"),xe(t=>{if(t)this.form.patchValue({price:+this.variant.UnitPrice}),this.form.get("price").disable();else{console.warn("Invalid UnitPrice, not patching price");let n=[...this.storeService.productItems()],r=n.findIndex(o=>o.Uuid.toLowerCase()===this.route.snapshot.queryParamMap.get("id")?.toLowerCase());r!==-1&&this.form.patchValue({price:+this.variant.UnitPrice!=+n[r].UnitPrice?+n[r].UnitPrice:+this.variant.UnitPrice}),this.form.get("price").enable()}})).subscribe(),this.route.queryParamMap.pipe(xe(t=>{this.isEditProduct.set(t.has("id")),console.log("edit",this.isEditProduct()),this.UUidSelected=t.get("id")||""})).subscribe(),this.route.queryParamMap.pipe(qi(t=>{if(t.has("id")){let n=t.get("id"),r=[...this.storeService.productItems()],o=r.findIndex(s=>s.Uuid.toLowerCase()===n.toLowerCase());if(o!==-1){let s={EntityID:"00000000-0000-0000-0000-000000000000",ID:r[o].ID},a={VariantID:r[o].ID};return sl([this.httpService.post("/API/V3/Variant/ID",s,void 0,this.domain),this.roleService.promotion.View?this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",a,void 0,this.domain):Le(null)]).pipe(mi(([l,c])=>({variant:l,promotion:c,KEY:n})))}return Le(null)}else return this.form.reset(),this.form.enable(),this.promotionPrice$=Le([]),Le(null)}),hn("edit"),xe(t=>{if(t===null)return;this.form.get("name").disable();let{variant:n,promotion:r,KEY:o}=t;this.promotionPrice$=Le(r),this.variant$=Le(n),this.variant=n;let s=[...this.storeService.productItems()],a=s.findIndex(l=>l.Uuid.toLowerCase()===o.toLowerCase());if(a!==-1){let l=r.findIndex(c=>c.PromotionID.toLowerCase()===s[a].Promotions?.PromotionID?.toLowerCase());if(l!==-1){let c=+r[l]?.UnitPrice;isNaN(c)&&(c=+n.UnitPrice),this.form.patchValue({price:+n.UnitPrice!=+s[a].UnitPrice?+s[a].UnitPrice:+n.UnitPrice,promotionPrice:r[l].PromotionID,quantity:+s[a].Quantity,name:{Value:n.Name}}),this.form.get("price").disable()}else this.form.patchValue({price:+n.UnitPrice!=+s[a].UnitPrice?+s[a].UnitPrice:+n.UnitPrice,promotionPrice:null,quantity:+s[a].Quantity,name:{Value:n.Name}})}})).subscribe(),this.variantSuggestion$=this.form.get("name").valueChanges.pipe(dp(200),cl(),qi(t=>{if(t&&t.length>2){let n={count:100,prefix:t},r=`https://${localStorage.getItem("Domain")}`;return this.httpService.post("/API/AC/GetVariantSuggestionByCodeNName",n,void 0,r)}else return Le([])}))}onOptionSelected(t){if(Object.hasOwn(t.option.value,"Key")){let n=t.option.value.Key,r={EntityID:"00000000-0000-0000-0000-000000000000",ID:n},o={VariantID:n};return sl([this.httpService.post("/API/V3/Variant/ID",r,void 0,this.domain),this.roleService.promotion.View?this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",o,void 0,this.domain):Le(null)]).pipe(mi(([s,a])=>({variant:s,promotion:a})),xe(({variant:s,promotion:a})=>{this.form.patchValue({price:s.UnitPrice,promotionPrice:null,quantity:1}),this.promotionPrice$=Le(a),this.variant$=Le(s),this.variant=s})).subscribe()}else throw new Error("Key not found")}onSubmit(){let{name:t,quantity:n,promotionPrice:r,price:o}=this.form.getRawValue(),s=n.toString().replace(/,/g,""),a=o.toString().replace(/,/g,"");return this.isEditProduct()?os([this.promotionPrice$,this.variant$]).pipe(mi(([l,c])=>({promotions:l,variant:c})),mi(({promotions:l,variant:c})=>{let d=[...this.storeService.productItems()],p=d.findIndex(h=>h.Uuid.toLowerCase()===this.UUidSelected.toLowerCase());if(p!==-1){let h=l.findIndex(_=>_.PromotionID.toLowerCase()===r?.toLowerCase());if(h!==-1){let _=+l[h]?.UnitPrice;isNaN(_)&&(_=+c.UnitPrice),d[p]=D(v({},d[p]),{Quantity:+s,Promotions:l[h],UnitPrice:+a,isSelected:!1})}else d[p]=D(v({},d[p]),{Quantity:+s,Promotions:r,UnitPrice:+a,isSelected:!1})}let g=[...d];this.storeService.onChangeProductItems(g),this.form.get("price").enable(),this.form.reset(),this.router.navigate(["/pages"]),this.promotionPrice$=Le([]),this.variant={}})).subscribe():this.variant$.pipe(mi(l=>D(v({},l),{Quantity:+n,Promotions:r,UnitPrice:+a,Uuid:io()})),xe(l=>{let c=[...this.storeService.productItems()];c.push(l);let d=[...c];this.storeService.onChangeProductItems(d),this.form.get("price").enable(),this.form.reset(),this.promotionPrice$=Le([])})).subscribe()}onErrorImage(t){console.log(t);let n=t.target;t.type==="error"&&(n.src="assets/images/image-404.svg")}get hasEdit(){return this.route.snapshot.queryParamMap.has("id")}resetForm(){this.form.reset(),this.router.navigate([],{relativeTo:this.route,queryParams:{id:null},queryParamsHandling:"merge"})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["modal-choose-product"]],standalone:!0,features:[ye],decls:31,vars:14,consts:[["auto","matAutocomplete"],["rt",""],[1,"card","mb-3","w-100","p-0"],[1,"card-header","px-0"],[1,"text-dark","fw-medium","font-robotoslab",2,"margin","0.6rem 0","font-size","16px"],[1,"card-body","px-0","py-0","pt-4"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"form-group","d-flex","flex-column","position-relative"],[1,"text-dark","fs-2","fw-semibold","font-robotoslab"],["type","text","formControlName","name",1,"form-control","form-control-lg","fs-3",3,"matAutocomplete"],["autoActiveFirstOption","",3,"optionSelected","displayWith"],[1,"form-group"],["type","text","formControlName","quantity",1,"form-control","form-control-lg","fs-3",3,"maskito"],["type","text","formControlName","price",1,"form-control","form-control-lg","fs-3",3,"maskito"],[1,"d-flex","gap-4"],["type","button",1,"flex","flex-grow-1","btn","btn-outline-secondary"],["type","button",1,"flex","flex-grow-1","btn","btn-success",3,"click","disabled"],[1,"fs-2",3,"disabled"],[1,"fs-2",3,"value"],[1,"d-flex","flex-column"],[1,"fs-2"],[1,"opacity-75",2,"font-size","11px"],[1,"d-flex","w-100","overflow-x-hidden","gap-2"],[1,"me-1",2,"width","42px","height","42px",3,"error","src","alt"],[1,"flex-grow-1","d-flex","flex-column","flex-wrap"],[3,"result","term"],["formControlName","promotionPrice","placeholder","Select Promotion Price",1,"custom","fs-3"],[1,"fs-3",3,"value"],["type","button",1,"flex","flex-grow-1","btn","btn-outline-secondary",3,"click"]],template:function(n,r){if(n&1){let o=Ie();f(0,"div",2)(1,"div",3)(2,"span",4),x(3),m()(),f(4,"div",5)(5,"div",6)(6,"form",7)(7,"div",8)(8,"label",9),x(9,"Name"),m(),le(10,"input",10),f(11,"mat-autocomplete",11,0),U("optionSelected",function(a){return se(o),ae(r.onOptionSelected(a))}),ue(13,zC,2,1),Ue(14,"async"),m(),ue(15,LC,7,6,"ng-template",null,1,me),m(),f(17,"div",12)(18,"label",9),x(19,"Quantity"),m(),le(20,"input",13),m(),f(21,"div",12)(22,"label",9),x(23,"Price"),m(),le(24,"input",14),m(),ue(25,$C,1,1),Ue(26,"async"),f(27,"div",15),ue(28,qC,2,0,"button",16),f(29,"button",17),U("click",function(){return se(o),ae(r.onSubmit())}),x(30," Submit "),m()()()()()()}if(n&2){let o,s,a=yl(12);y(3),ti("",r.UUidSelected?"Update":"Add"," Product"),y(3),E("formGroup",r.form),y(4),E("matAutocomplete",a),y(),E("displayWith",r.displayFn),y(2),Ce((o=ii(14,10,r.variantSuggestion$))?13:-1,o),y(7),E("maskito",r.maskitoOptions),y(4),E("maskito",r.maskitoOptions),y(),Ce((s=ii(26,12,r.promotionPrice$))?25:-1,s),y(3),Ce(r.hasEdit?28:-1),y(),E("disabled",r.form.invalid)}},dependencies:[vs,ri,_i,Bs,rt,xs,tt,it,ws,Cs,Ss,Bp,wp,Ji,Fs,Jf,Qf,As,Kc],styles:[".mat-mdc-autocomplete-panel{background-color:#fff!important} .mat-mdc-autocomplete-panel>.mat-mdc-option.mdc-list-item--disabled{min-height:34px}"]})}}return i})();var im=(()=>{class i{constructor(){this.transactionType=q([{title:"Supplier Bill",type:0},{title:"Transfer Order",type:1}]),this.storeService=N(ke),this.fb=N(Yi),this.activeModal=N(Xn)}get outlets(){return this.storeService.paperConfig().Outlets}initForm(){this.form=this.fb.group({type:new nt("",[ct.required]),outlet:new nt("",[ct.required]),number:new nt("",[ct.required])})}ngOnInit(){this.initForm()}onOK(){this.activeModal.close({role:"ok",data:this.form.value})}onClose(){this.activeModal.dismiss({role:"close",data:null})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-dialog-load-transaction"]],standalone:!0,features:[ye],decls:14,vars:4,consts:[["title","Choose your transaction",3,"onOK","onClose","hasValid"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],[1,"form-group"],[1,"text-dark","fs-2","fw-semibold","font-robotoslab"],["formControlName","type","bindLabel","title","bindValue","type","placeholder","Choose Type",1,"custom","fs-2",3,"items"],["formControlName","outlet","bindLabel","Name","bindValue","Name","placeholder","Choose Outlet",1,"custom","fs-2",3,"items"],["formControlName","number","type","text",1,"form-control","fs-2",2,"height","32px"]],template:function(n,r){n&1&&(f(0,"app-base-modal",0),U("onOK",function(){return r.onOK()})("onClose",function(){return r.onClose()}),f(1,"form",1)(2,"div",2)(3,"label",3),x(4,"Choose Type"),m(),le(5,"ng-select",4),m(),f(6,"div",2)(7,"label",3),x(8,"Choose Outlet"),m(),le(9,"ng-select",5),m(),f(10,"div",2)(11,"label",3),x(12,"Invoice Number"),m(),le(13,"input",6),m()()()),n&2&&(E("hasValid",r.form.valid),y(),E("formGroup",r.form),y(4),E("items",r.transactionType()),y(4),E("items",r.outlets))},dependencies:[Ys,ri,_i,ht,xs,tt,it,ws,rt,Cs,Ss],changeDetection:0})}}return i})();var GC=(()=>{class i{constructor(t){this.document=t,this.width=this.getWidth()}getWidth(){let t=this.document.createElement("div");t.style.visibility="hidden",t.style.width="100px",t.style.msOverflowStyle="scrollbar",this.document.body.appendChild(t);let n=t.offsetWidth;t.style.overflow="scroll";let r=this.document.createElement("div");r.style.width="100%",t.appendChild(r);let o=r.offsetWidth;return t.parentNode.removeChild(t),n-o}}return i.\u0275fac=function(t){return new(t||i)(pe(gt))},i.\u0275prov=Ve({token:i,factory:i.\u0275fac}),i})(),XC=(()=>{class i{getDimensions(t){return t.getBoundingClientRect()}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=Ve({token:i,factory:i.\u0275fac}),i})(),YC=(()=>{class i{constructor(){this.columnInputChanges=new et}get columnInputChanges$(){return this.columnInputChanges.asObservable()}onInputChange(){this.columnInputChanges.next()}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=Ve({token:i,factory:i.\u0275fac}),i})();function KC(i){return i=i.replace(/[^a-zA-Z0-9 ]/g," "),i=i.replace(/([a-z](?=[A-Z]))/g,"$1 "),i=i.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,"").trim().toLowerCase(),i=i.replace(/([ 0-9]+)([a-zA-Z])/g,function(e,t,n){return t.trim()+n.toUpperCase()}),i}var oa={},nm=typeof document<"u"?document.createElement("div").style:void 0,Zc=function(){let i=typeof window<"u"?window.getComputedStyle(document.documentElement,""):void 0,e=typeof i<"u"?Array.prototype.slice.call(i).join("").match(/-(moz|webkit|ms)-/):null,t=e!==null?e[1]:void 0,n=typeof t<"u"?"WebKit|Moz|MS|O".match(new RegExp("("+t+")","i"))[1]:void 0;return n?{dom:n,lowercase:t,css:`-${t}-`,js:t[0].toUpperCase()+t.substr(1)}:void 0}();function sa(i){let e=KC(i);return oa[e]||(Zc!==void 0&&nm[Zc.css+i]!==void 0?oa[e]=Zc.css+i:nm[i]!==void 0&&(oa[e]=i)),oa[e]}var d3=typeof window<"u"?sa("transform"):void 0,u3=typeof window<"u"?sa("backfaceVisibility"):void 0,p3=typeof window<"u"?!!sa("transform"):void 0,h3=typeof window<"u"?!!sa("perspective"):void 0,rm=typeof window<"u"?window.navigator.userAgent:"Chrome",f3=/Safari\//.test(rm)&&!/Chrome\//.test(rm);var om=(()=>{class i{static forRoot(t){return{ngModule:i,providers:[{provide:"configuration",useValue:t}]}}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=zt({type:i}),i.\u0275inj=Nt({providers:[GC,XC,YC],imports:[[ni]]}),i})();typeof document<"u"&&!document.elementsFromPoint&&(document.elementsFromPoint=QC);function QC(i,e){let t=[],n=[],r,o,s;for(;(r=document.elementFromPoint(i,e))&&t.indexOf(r)===-1&&r!=null;)t.push(r),n.push({value:r.style.getPropertyValue("pointer-events"),priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(o=n.length;s=n[--o];)t[o].style.setProperty("pointer-events",s.value?s.value:"",s.priority);return t}var sm=(()=>{class i{constructor(){this.subject$=new et}onFileLoad(t){let r=t.target.result,o=!1,s=[],a=[],l=0;for(let c of r.split(/[\r\n]+/))if(o){let d={};for(let p=0;p<l;p++)d[a[p]]=c.split(",")[p];s.push(d)}else{for(let d=0;d<c.split(",").length;d++)l=c.split(",").length,a.push(c.split(",")[d].replace(/ /g,""));o=!0}return s.splice(-1),s}convertFile(t){let n=t,r=new FileReader;return r.onload=o=>{let s=this.onFileLoad(o);this.subject$.next(s)},r.readAsText(n,"UTF-8"),this.subject$.asObservable()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var am=(()=>{class i{constructor(t,n,r){this.http=t,this.toastr=n,this.router=r}PostToUrlEncode(t,n,r=1e5){let o=new vi;return o=o.set("Content-Type","application/x-www-form-urlencoded"),new Pt(s=>{this.http.post(t,n,{headers:o}).pipe(fi(r)).subscribe(a=>{s.next(a),s.complete()})})}GetText(t=1e5){let n=localStorage.getItem("Token"),o={responseType:"text",headers:new vi({Authorization:"Bearer "+n})};return new Pt(s=>{this.http.get("/API/Token/GetZendeskJWT",o).pipe(fi(t)).subscribe(a=>{s.next(a),s.complete()})})}POSText(t,n,r=1e5){let o=localStorage.getItem("Token"),a={responseType:"text",headers:new vi({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+o})};return new Pt(l=>{this.http.post(t,n,a).pipe(fi(r)).subscribe(c=>{l.next(c),l.complete()})})}get(t){let n=localStorage.getItem("Token"),r=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});n&&(r=r.append("Authorization","Bearer "+n));let o={headers:r};return this.http.get(t,o).pipe(Fr(s=>{if(!this.unauthorizedErrorHandling(s)){let l=this.errorMessageHandling(s);this.toastr.error(l.Message!=""?l.Message:"An unknown error has occured!",l.header),this.paymentErrorHandling(s)}return lp(()=>s)}))}getNews(t){return this.http.get(t)}paymentErrorHandling(t){t.status==402&&this.router.navigate(["/menu/Profile/Main/My_Subscription"])}post(t,n,r=1e5){return new Pt(o=>{let s=localStorage.getItem("Token"),a=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});s&&(a=a.append("Authorization","Bearer "+s));let l={headers:a};Date.prototype.toJSON=function(){return this.getFullYear()+"-"+c(this.getMonth()+1)+"-"+c(this.getDate())+"T"+c(this.getHours())+":"+c(this.getMinutes())+":"+c(this.getSeconds())+".000"};function c(d){return d<10?"0"+d:d}this.http.post(t,n,l).pipe(fi(r)).subscribe({next:d=>{o.next(d),o.complete()},error:d=>{if(d.status==200)o.next(d.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(d)){let g=this.errorMessageHandling(d);this.toastr.error(g.Message!=""?g.Message:"An unknown error has occured!",g.header,{enableHtml:!0})}o.error(d)}}})})}postFile(t,n,r=1e5){return new Pt(o=>{let s=localStorage.getItem("Token"),a=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});s&&(a=a.append("Authorization","Bearer "+s)),this.http.post(t,n,{headers:a,observe:"response",responseType:"blob"}).pipe(fi(r)).subscribe({next:l=>{o.next({title:l.headers.get("Content-Disposition"),file:l.body}),o.complete()},error:l=>{if(l.headers.get("Content-Type")==="application/json; charset=utf-8"){let c=new FileReader;c.addEventListener("loadend",d=>{let p=JSON.parse(d.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(l)){let h=this.errorMessageHandling(l);this.toastr.error(p??"An unknown error has occured!",h.header,{enableHtml:!0})}}),c.readAsText(l.error)}o.error(l)}})})}put(t,n,r=1e5){return new Pt(o=>{let s=localStorage.getItem("Token"),a=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});s&&(a=a.append("Authorization","Bearer "+s));let l={headers:a};this.http.put(t,n,l).pipe(fi(r)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)){let p=this.errorMessageHandling(c);this.toastr.error(p.Message!=""?p.Message:"An unknown error has occured!",p.header)}o.error(c)}}})})}delete(t,n,r=1e5){return new Pt(o=>{let s=localStorage.getItem("Token"),a=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});s&&(a=a.append("Authorization","Bearer "+s));let l={headers:a,body:n};this.http.delete(t,l).pipe(fi(r)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)){let p=this.errorMessageHandling(c);this.toastr.error(p.Message!=""?p.Message:"An unknown error has occured!",p.header)}o.error(c)}}})})}unauthorizedErrorHandling(t){let n=!1;return(t.status==401||t.status==403)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",n=!0),n}errorMessageHandling(t){let n="API Error",r="Exception Message";return t.error?(n="API Error - "+t.status,t.status==451&&(n="Error"),t.error&&(r=t.error.Message)):t.Message&&(n="API Error - "+t.name,r=t.Message),{header:n,Message:r}}postFormDataWithoutBearer(t,n){return new Pt(r=>{this.http.post(t,n).pipe(fi(1e5)).subscribe({next:o=>{r.next(o),r.complete()},error:o=>{o.status==200&&(r.next(o.error.text),r.complete()),r.error(o)}})})}postFormData(t,n,r=!0){return new Pt(o=>{let s=localStorage.getItem("Token"),l={headers:new vi({Authorization:"Bearer "+s})};this.http.post(t,n,l).pipe(fi(1e5)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)&&r){let p=this.errorMessageHandling(c);this.toastr.error(p.Message!=""?p.Message:"An unknown error has occured!",p.header)}o.error(c)}}})})}static{this.\u0275fac=function(n){return new(n||i)(pe(Pp),pe(_s),pe($n))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function aa(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var ZC=0;function cm(i){return"__private_"+ZC+++"_"+i}function JC(i,e,t){let n=[];return i.forEach(r=>typeof r!="string"?n.push(r):e[Symbol.split](r).forEach((o,s,a)=>{o!==""&&n.push(o),s<a.length-1&&n.push(t)})),n}function lm(i,e){let t=/\$/g,n="$$$$",r=[i];if(e==null)return r;for(let o of Object.keys(e))if(o!=="_"){let s=e[o];typeof s=="string"&&(s=t[Symbol.replace](s,n)),r=JC(r,new RegExp(`%\\{${o}\\}`,"g"),s)}return r}var eS=i=>{throw new Error(`missing string: ${i}`)},no=cm("onMissingKey"),ro=cm("apply"),ur=class{constructor(e,t){let{onMissingKey:n=eS}=t===void 0?{}:t;Object.defineProperty(this,ro,{value:tS}),Object.defineProperty(this,no,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(e)?e.forEach(aa(this,ro)[ro],this):aa(this,ro)[ro](e),aa(this,no)[no]=n}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let n=this.locale.strings[e];if(n==null&&(aa(this,no)[no](e),n=e),typeof n=="object"){if(t&&typeof t.smart_count<"u"){let o=this.locale.pluralize(t.smart_count);return lm(n[o],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof n!="string")throw new Error("string was not a string");return lm(n,t)}};function tS(i){if(!(i!=null&&i.strings))return;let e=this.locale;Object.assign(this.locale,{strings:v(v({},e.strings),i.strings),pluralize:i.pluralize||e.pluralize})}var sg=De(um(),1);var iS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var nn=(i=21)=>{let e="",t=i|0;for(;t--;)e+=iS[Math.random()*64|0];return e};var ag=De(Wm(),1);function ca(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var YS=0;function $m(i){return"__private_"+YS+++"_"+i}var KS={version:"4.2.0"},fn=$m("callbacks"),nd=$m("publish"),da=class{constructor(){Object.defineProperty(this,nd,{value:QS}),this.state={},Object.defineProperty(this,fn,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t=v({},this.state),n=v(v({},this.state),e);this.state=n,ca(this,nd)[nd](t,n,e)}subscribe(e){return ca(this,fn)[fn].add(e),()=>{ca(this,fn)[fn].delete(e)}}};function QS(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];ca(this,fn)[fn].forEach(n=>{n(...e)})}da.VERSION=KS.version;var qm=da;function xi(i){let e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}var rd={__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",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 so(i){var e;if(i.type)return i.type;let t=i.name?(e=xi(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in rd?rd[t]:"application/octet-stream"}function ZS(i){return i.charCodeAt(0).toString(32)}function Gm(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${ZS(t)}`,"/"))+e}function Xm(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${Gm(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${Gm(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function JS(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function ua(i,e){if(JS(i))return i.id;let t=so(i);return Xm(D(v({},i),{type:t}),e)}function od(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;let n=e[1].split(".",2),r=parseInt(n[0],10),o=parseInt(n[1],10);return r<15||r===15&&o<15063||r>18||r===18&&o>=18218}function sd(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function ad(i){return i<10?`0${i}`:i.toString()}function pr(){let i=new Date,e=ad(i.getHours()),t=ad(i.getMinutes()),n=ad(i.getSeconds());return`${e}:${t}:${n}`}var Ym={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${pr()}]`,...e)}},Km={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${pr()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${pr()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${pr()}]`,...e)}};var lo=De(ao(),1),ng=De(ig(),1),rg={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},It=class extends Error{constructor(e,t){var n;super(e),this.isRestriction=!0,this.isUserFacing=(n=t?.isUserFacing)!=null?n:!0,t!=null&&t.file&&(this.file=t.file)}},pa=class{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var n;let r=e();if(((n=r.restrictions)==null?void 0:n.allowedFileTypes)!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:n,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&e.filter(s=>!s.isGhost).length+t.length>r)throw new It(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(n){let o=[...e,...t].reduce((s,a)=>{var l;return s+((l=a.size)!=null?l:0)},0);if(o>n)throw new It(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,lo.default)(n),size:(0,lo.default)(o)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:n,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(a=>a.includes("/")?e.type?(0,ng.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=r.join(", ");throw new It(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t){var o;throw new It(this.getI18n()("exceedsSize",{size:(0,lo.default)(t),file:(o=e.name)!=null?o:this.getI18n()("unnamed")}),{file:e})}if(n&&e.size!=null&&e.size<n)throw new It(this.getI18n()("inferiorSize",{size:(0,lo.default)(n)}),{file:e})}validate(e,t){t.forEach(n=>{this.validateSingleFile(n)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new It(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let n=new It(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:r}=this.getOpts().restrictions,o=[];for(let s of r)(!Object.hasOwn(e.meta,s)||e.meta[s]==="")&&o.push(s);return{missingFields:o,error:n}}};var og={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 H(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var iP=0;function Me(i){return"__private_"+iP+++"_"+i}var nP={version:"4.4.1"},ha={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},dt=Me("plugins"),ut=Me("restricter"),co=Me("storeUnsubscribe"),Fi=Me("emitter"),mn=Me("preProcessors"),gn=Me("uploaders"),Ai=Me("postProcessors"),Vt=Me("informAndEmit"),go=Me("checkRequiredMetaFieldsOnFile"),ld=Me("checkRequiredMetaFields"),uo=Me("assertNewUploadAllowed"),ud=Me("transformFile"),po=Me("startIfAutoProceed"),ho=Me("checkAndUpdateFileState"),pd=Me("handleUploadProgress"),fo=Me("updateTotalProgress"),Bi=Me("updateTotalProgressThrottled"),hd=Me("calculateTotalProgress"),cd=Me("addListeners"),di=Me("updateOnlineStatus"),mo=Me("requestClientById"),Ri=Me("createUpload"),dd=Me("getUpload"),yn=Me("removeUpload"),Mi=Me("runUpload"),fa=class i{constructor(e){Object.defineProperty(this,Mi,{value:yP}),Object.defineProperty(this,yn,{value:gP}),Object.defineProperty(this,dd,{value:mP}),Object.defineProperty(this,Ri,{value:fP}),Object.defineProperty(this,cd,{value:hP}),Object.defineProperty(this,hd,{value:pP}),Object.defineProperty(this,fo,{value:uP}),Object.defineProperty(this,ho,{value:dP}),Object.defineProperty(this,po,{value:cP}),Object.defineProperty(this,ud,{value:lP}),Object.defineProperty(this,uo,{value:aP}),Object.defineProperty(this,ld,{value:sP}),Object.defineProperty(this,go,{value:oP}),Object.defineProperty(this,Vt,{value:rP}),Object.defineProperty(this,dt,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,Fi,{writable:!0,value:(0,sg.default)()}),Object.defineProperty(this,mn,{writable:!0,value:new Set}),Object.defineProperty(this,gn,{writable:!0,value:new Set}),Object.defineProperty(this,Ai,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,pd,{writable:!0,value:(r,o)=>{let s=r?this.getFile(r.id):void 0;if(r==null||!s){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}if(s.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${r.id}`);return}let a={bytesTotal:o.bytesTotal,percentage:o.bytesTotal!=null&&Number.isFinite(o.bytesTotal)&&o.bytesTotal>0?Math.round(o.bytesUploaded/o.bytesTotal*100):void 0};s.progress.uploadStarted!=null?this.setFileState(r.id,{progress:D(v(v({},s.progress),a),{bytesUploaded:o.bytesUploaded})}):this.setFileState(r.id,{progress:v(v({},s.progress),a)}),H(this,Bi)[Bi]()}}),Object.defineProperty(this,Bi,{writable:!0,value:(0,ag.default)(()=>H(this,fo)[fo](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,di,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,mo,{writable:!0,value:new Map}),this.defaultLocale=og;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:rg,meta:{},onBeforeFileAdded:(r,o)=>!Object.hasOwn(o,r.id),onBeforeUpload:r=>r,store:new qm,logger:Ym,infoTimeout:5e3},n=v(v({},t),e);this.opts=D(v({},n),{restrictions:v(v({},t.restrictions),e&&e.restrictions)}),e&&e.logger&&e.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"):e&&e.debug&&(this.opts.logger=Km),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState(D(v({},ha),{plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:od(),individualCancellation:!0,resumableUploads:!1},meta:v({},this.opts.meta),info:[]})),H(this,ut)[ut]=new pa(()=>this.opts,()=>this.i18n),H(this,co)[co]=this.store.subscribe((r,o,s)=>{this.emit("state-update",r,o,s),this.updateAll(o)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),H(this,cd)[cd]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];H(this,Fi)[Fi].emit(e,...n)}on(e,t){return H(this,Fi)[Fi].on(e,t),this}once(e,t){return H(this,Fi)[Fi].once(e,t),this}off(e,t){return H(this,Fi)[Fi].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:v(v({},t),Object.fromEntries(Object.entries(e).map(n=>{let[r,o]=n;return[r,v(v({},t[r]),o)]})))})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=n=>this.log(`Missing i18n string: ${n}`,"error"),t=new ur([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts=D(v(v({},this.opts),e),{restrictions:v(v({},this.opts.restrictions),e?.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t=v({},this.getState().files),n=Object.create(null);Object.keys(t).forEach(r=>{n[r]=D(v({},t[r]),{progress:v(v({},t[r].progress),e),tus:void 0,transloadit:void 0})}),this.setState(v({files:n},ha))}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState(D(v({},ha),{files:{}}))}addPreProcessor(e){H(this,mn)[mn].add(e)}removePreProcessor(e){return H(this,mn)[mn].delete(e)}addPostProcessor(e){H(this,Ai)[Ai].add(e)}removePostProcessor(e){return H(this,Ai)[Ai].delete(e)}addUploader(e){H(this,gn)[gn].add(e)}removeUploader(e){return H(this,gn)[gn].delete(e)}setMeta(e){let t=v(v({},this.getState().meta),e),n=v({},this.getState().files);Object.keys(n).forEach(r=>{n[r]=D(v({},n[r]),{meta:v(v({},n[r].meta),e)})}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){let n=v({},this.getState().files);if(!n[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let r=v(v({},n[e].meta),t);n[e]=D(v({},n[e]),{meta:r}),this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=[],s=[],a=[],l=[],c=[],d=[],p=[],g=[],h=[];for(let _ of r){let{progress:P}=_;!P.uploadComplete&&P.uploadStarted&&(o.push(_),_.isPaused||g.push(_)),P.uploadStarted||s.push(_),(P.uploadStarted||P.preprocess||P.postprocess)&&a.push(_),P.uploadStarted&&l.push(_),_.isPaused&&c.push(_),P.uploadComplete&&d.push(_),_.error&&p.push(_),(P.preprocess||P.postprocess)&&h.push(_)}return{newFiles:s,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:p,inProgressFiles:o,inProgressNotPausedFiles:g,processingFiles:h,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===r.length&&h.length===0,isAllErrored:!!n&&p.length===r.length,isAllPaused:o.length!==0&&c.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(_=>_.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{H(this,ut)[ut].validate(t,[e])}catch(n){return n}return null}validateSingleFile(e){try{H(this,ut)[ut].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{H(this,ut)[ut].validateAggregateRestrictions(t,e)}catch(n){return n.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){H(this,uo)[uo](e);let{nextFilesState:t,validFilesToAdd:n,errors:r}=H(this,ho)[ho]([e]),o=r.filter(a=>a.isRestriction);if(H(this,Vt)[Vt](o),r.length>0)throw r[0];this.setState({files:t});let[s]=n;return this.emit("file-added",s),this.emit("files-added",n),this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`),H(this,po)[po](),s.id}addFiles(e){H(this,uo)[uo]();let{nextFilesState:t,validFilesToAdd:n,errors:r}=H(this,ho)[ho](e),o=r.filter(a=>a.isRestriction);H(this,Vt)[Vt](o);let s=r.filter(a=>!a.isRestriction);if(s.length>0){let a=`Multiple errors occurred while adding files:
15
+ `)+1;return[t?n:o,t?o:r]}function Ox({value:i,selection:e},t){let[n,r]=e;return n!==r?[n,r]:(t?[n,r+1]:[n-1,r]).map(s=>Math.min(Math.max(s,0),i.length))}var Fx=/\s+$/g,Rx=/^\s+/g,_f=/\s/;function Mx({value:i,selection:e},t){let[n,r]=e;if(n!==r)return[n,r];if(t){let l=i.slice(n),[c]=l.match(Rx)||[""],d=l.trimStart().search(_f);return[n,d!==-1?n+c.length+d:i.length]}let o=i.slice(0,r),[s]=o.match(Fx)||[""],a=o.trimEnd().split("").reverse().findIndex(l=>_f.exec(l));return[a!==-1?r-s.length-a:0,r]}function Ks(i=[]){return(e,...t)=>i.reduce((n,r)=>Object.assign(Object.assign({},n),r(n,...t)),e)}function un(i,e){let t=Object.assign(Object.assign({},or),e),n=Ks(t.preprocessors),r=Ks(t.postprocessors),o=typeof i=="string"?{value:i,selection:[0,0]}:i,{elementState:s}=n({elementState:o,data:""},"validation"),a=new Zr(s,t),{value:l,selection:c}=r(a,o);return typeof i=="string"?l:{value:l,selection:c}}var Qs=class extends Mc{constructor(e,t){super(),this.element=e,this.maskitoOptions=t,this.isTextArea=this.element.nodeName==="TEXTAREA",this.eventListener=new Ac(this.element),this.options=Object.assign(Object.assign({},or),this.maskitoOptions),this.upcomingElementState=null,this.preprocessor=Ks(this.options.preprocessors),this.postprocessor=Ks(this.options.postprocessors),this.teardowns=this.options.plugins.map(n=>n(this.element,this.options)),this.updateHistory(this.elementState),this.eventListener.listen("keydown",n=>{if(kx(n))return n.preventDefault(),this.redo();if(Tx(n))return n.preventDefault(),this.undo()}),this.eventListener.listen("beforeinput",n=>{var r,o,s;let a=n.inputType.includes("Forward");switch(this.updateHistory(this.elementState),n.inputType){case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.handleDelete({event:n,isForward:a,selection:Ox(this.elementState,a)});case"deleteHardLineBackward":case"deleteHardLineForward":case"deleteSoftLineBackward":case"deleteSoftLineForward":return this.handleDelete({event:n,isForward:a,selection:Ix(this.elementState,a),force:!0});case"deleteWordBackward":case"deleteWordForward":return this.handleDelete({event:n,isForward:a,selection:Mx(this.elementState,a),force:!0});case"historyRedo":return n.preventDefault(),this.redo();case"historyUndo":return n.preventDefault(),this.undo();case"insertCompositionText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(n);case"insertReplacementText":return;case"insertFromDrop":case"insertFromPaste":case"insertText":default:return this.handleInsert(n,(s=(r=n.data)!==null&&r!==void 0?r:(o=n.dataTransfer)===null||o===void 0?void 0:o.getData("text/plain"))!==null&&s!==void 0?s:"")}}),this.eventListener.listen("input",()=>{this.upcomingElementState&&(this.updateElementState(this.upcomingElementState),this.upcomingElementState=null)},{capture:!0}),this.eventListener.listen("input",({inputType:n})=>{n!=="insertCompositionText"&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}destroy(){this.eventListener.destroy(),this.teardowns.forEach(e=>e?.())}updateElementState({value:e,selection:t},n){let r=this.elementState.value;this.updateValue(e),this.updateSelectionRange(t),n&&r!==e&&this.dispatchInputEvent(n)}get elementState(){let{value:e,selectionStart:t,selectionEnd:n}=this.element;return{value:e,selection:[t??0,n??0]}}get maxLength(){let{maxLength:e}=this.element;return e===-1?1/0:e}updateSelectionRange([e,t]){var n;let{element:r}=this;r.matches(":focus")&&(r.selectionStart!==e||r.selectionEnd!==t)&&((n=r.setSelectionRange)===null||n===void 0||n.call(r,e,t))}updateValue(e){this.element.value=e}ensureValueFitsMask(){this.updateElementState(un(this.elementState,this.options),{inputType:"insertText",data:null})}dispatchInputEvent(e={inputType:"insertText",data:null}){globalThis.InputEvent&&this.element.dispatchEvent(new InputEvent("input",Object.assign(Object.assign({},e),{bubbles:!0,cancelable:!1})))}handleDelete({event:e,selection:t,isForward:n,force:r=!1}){let o={value:this.elementState.value,selection:t},[s,a]=o.selection,{elementState:l}=this.preprocessor({elementState:o,data:""},n?"deleteForward":"deleteBackward"),c=new Zr(l,this.options),[d,u]=l.selection;c.deleteCharacters([d,u]);let g=this.postprocessor(c,o);if(!(o.value.slice(0,s)+o.value.slice(a)===g.value&&!r&&!this.element.isContentEditable)){if(Cx(o,l,c,g))return e.preventDefault(),this.updateSelectionRange(n?[u,u]:[d,d]);this.upcomingElementState=g}}handleInsert(e,t){let{options:n,maxLength:r,element:o,elementState:s}=this,{elementState:a,data:l=t}=this.preprocessor({data:t,elementState:s},"insert"),c=new Zr(a,n);try{c.addCharacters(a.selection,l)}catch{return e.preventDefault()}let[d,u]=a.selection,g=s.value.slice(0,d)+t+s.value.slice(u),h=this.postprocessor(c,s);if(h.value.length>r)return e.preventDefault();(g!==h.value||o.isContentEditable)&&(this.upcomingElementState=h,n.overwriteMode==="replace"&&g.length>r&&this.dispatchInputEvent({inputType:"insertText",data:t}))}handleEnter(e){(this.isTextArea||this.element.isContentEditable)&&this.handleInsert(e,`
16
+ `)}};function ar(i,e,t){let n=Math.min(Number(t),Math.max(Number(e),Number(i)));return i instanceof Date?new Date(n):n}var Ax=[".",",","\u0431","\u044E"];var Nc="\xA0",Bx="\u200B",Df="\u2013",kf="\u2014",Js="-",Bc="\u2212",Tf="\u30FC";var QT=new RegExp(`[${Nc}APM]+$`,"g"),ZT=new RegExp(`${Nc}[AP]M$`,"g"),Nx=[":","."];function lr(i){return i}function Lx(){}var If=/[\\^$.*+?()[\]{}|]/g,zx=new RegExp(If.source);function yt(i){return i&&zx.test(i)?i.replaceAll(If,String.raw`\$&`):i}function di(i,{prefix:e,postfix:t}){var n,r;let o=new RegExp(`^${yt(e)}`),s=new RegExp(`${yt(t)}$`),[a=""]=(n=i.match(o))!==null&&n!==void 0?n:[],[l=""]=(r=i.match(s))!==null&&r!==void 0?r:[];return{extractedPrefix:a,extractedPostfix:l,cleanValue:a||l?i.slice(a.length,l.length?-l.length:1/0):i}}function Hx(i,e){let t="";for(let n=0;n<i.length;n++){if(i[n]!==e[n])return t;t+=i[n]}return t}function Cf(i){return i.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function jx(){return({elementState:i,data:e})=>{let{value:t,selection:n}=i;return{elementState:{selection:n,value:Cf(t)},data:Cf(e)}}}var JT=new RegExp(`[${Nx.map(yt).join("")}]$`);function Vx(i){let e=new RegExp(`${yt(i)}$`);return i?({value:t,selection:n},r)=>{if(!t&&!r.value.endsWith(i))return{value:t,selection:n};if(!t.endsWith(i)&&!r.value.endsWith(i))return{selection:n,value:t+i};let o=r.value.replace(e,""),s=r.selection[1]>o.length,a=Hx(o,t);return{selection:n,value:Array.from(i).reverse().reduce((l,c,d)=>{let u=l.length-1-d,g=a[u]===c&&s;return l[u]!==c||g?l.slice(0,u+1)+c+l.slice(u+1):l},t)}}:lr}function Ux(i){return i?({value:e,selection:t},n)=>{if(e.startsWith(i)||!e&&!n.value.startsWith(i))return{value:e,selection:t};let[r,o]=t,s=Array.from(i).reduce((l,c,d)=>l[d]===c?l:l.slice(0,d)+c+l.slice(d),e),a=s.length-e.length;return{selection:[r+a,o+a],value:s}}:lr}function cr(i,e,t){return(n,r)=>{let o=()=>e(n,r);return n.addEventListener(i,o,t),()=>n.removeEventListener(i,o,t)}}function Wx(i){return(e,t)=>{let n=e.ownerDocument,r=0,o=()=>r++,s=()=>{r=Math.max(--r,0)},a=()=>{if(e.matches(":focus")){if(r)return n.addEventListener("mouseup",a,{once:!0,passive:!0});i(e,t)}};return n.addEventListener("selectionchange",a,{passive:!0}),e.addEventListener("mousedown",o,{passive:!0}),n.addEventListener("mouseup",s,{passive:!0}),()=>{n.removeEventListener("selectionchange",a),n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",s)}}}function Of(i){return Wx(e=>{var t,n;let r=(t=e.selectionStart)!==null&&t!==void 0?t:0,o=(n=e.selectionEnd)!==null&&n!==void 0?n:0,[s,a]=i(e.value,[r,o]);(s>r||a<o)&&e.setSelectionRange(ar(r,s,a),ar(o,s,a))})}function $x({prefix:i,postfix:e}){return({elementState:t,data:n})=>{let{cleanValue:r}=di(n,{prefix:i,postfix:e});return{elementState:t,data:r}}}function Ff({decimalSeparator:i,isNegativeAllowed:e,precision:t,thousandSeparator:n,prefix:r,postfix:o,decimalPseudoSeparators:s=[],pseudoMinuses:a=[],minusSign:l}){let c=Sf(r),d=String.raw`\d`,u=e?`[${l}${a.map(L=>`\\${L}`).join("")}]?`:"",g=n?`[${d}${yt(n).replaceAll(/\s/g,String.raw`\s`)}]*`:`[${d}]*`,h=Number.isFinite(t)?t:"",_=t>0?`([${yt(i)}${s.map(yt).join("")}]${d}{0,${h}})?`:"",P=Sf(o);return new RegExp(`^${c}${u}${g}${_}${P}$`)}function Sf(i){return i?`${i.split("").map(e=>`${yt(e)}?`).join("")}`:""}function Lc(i,e="."){let t=!!new RegExp(`^\\D*[${Bc}\\${Js}${Df}${kf}${Tf}]`).exec(i),n=yt(e),r=i.replaceAll(new RegExp(`${n}(?!\\d)`,"g"),"").replaceAll(new RegExp(`[^\\d${n}]`,"g"),"").replace(e,e&&".");return r?+`${t?Js:""}${r}`:NaN}function qx(i){var e;let t=String(i),[n="",r]=t.split("e-"),o=t;if(r){let[,s]=n.split("."),a=Number(r)+((e=s?.length)!==null&&e!==void 0?e:0);o=i.toFixed(a)}return o}function Rf(i,{decimalSeparator:e,minusSign:t}){let[n="",r=""]=e?i.split(e):[i],o=yt(t),[,s="",a=""]=new RegExp(`^(?:[^\\d${o}])?(${o})?(.*)`).exec(n)||[];return{minus:s,integerPart:a,decimalPart:r}}function Gx({decimalSeparator:i,thousandSeparator:e,decimalPseudoSeparators:t=Ax}){return t.filter(n=>n!==e&&n!==i)}function Xx({decimalSeparator:i,precision:e,decimalZeroPadding:t,prefix:n,postfix:r}){return e<=0||!t?lr:({value:o,selection:s})=>{let{cleanValue:a,extractedPrefix:l,extractedPostfix:c}=di(o,{prefix:n,postfix:r});if(Number.isNaN(Lc(a,i)))return{value:o,selection:s};let[d,u=""]=a.split(i);return{value:l+d+i+u.padEnd(e,"0")+c,selection:s}}}function Yx({prefix:i,postfix:e,decimalSeparator:t,minusSign:n}){return({value:r,selection:o})=>{let[s]=o,{cleanValue:a,extractedPrefix:l,extractedPostfix:c}=di(r,{prefix:i,postfix:e}),{minus:d,integerPart:u,decimalPart:g}=Rf(a,{decimalSeparator:t,minusSign:n}),h=!u&&!g&&!!t&&a.includes(t);return!u&&!Number(g)&&s===(d+l).length||h?{selection:o,value:l+d+c}:{value:r,selection:o}}}function Kx({decimalSeparator:i,decimalPseudoSeparators:e,pseudoMinuses:t,prefix:n,postfix:r,minusSign:o}){let s=!0,a=Ff({decimalSeparator:i,decimalPseudoSeparators:e,pseudoMinuses:t,prefix:"",postfix:"",thousandSeparator:"",precision:1/0,isNegativeAllowed:!0,minusSign:o});return({elementState:l,data:c})=>{if(!s)return{elementState:l,data:c};s=!1;let{value:d,selection:u}=l,[g,h]=u,{extractedPrefix:_,cleanValue:P,extractedPostfix:L}=di(d,{prefix:n,postfix:r}),M=un({selection:[Math.max(g-_.length,0),ar(h-_.length,0,P.length)],value:P},{mask:a}),[W,de]=M.selection;return{elementState:{selection:[W+_.length,de+_.length],value:_+M.value+L},data:c}}}function Qx({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n}){let r=s=>{let a=yt(e);return s.replace(new RegExp(`^(\\D+)?[0${a}]+(?=0)`),"$1").replace(new RegExp(`^(\\D+)?[0${a}]+(?=[1-9])`),"$1")},o=(s,a)=>{let l=s.slice(0,a),c=s.slice(a).startsWith("0");return l.length-r(l).length+(c?1:0)};return({value:s,selection:a})=>{let[l,c]=a,{cleanValue:d,extractedPrefix:u,extractedPostfix:g}=di(s,{prefix:t,postfix:n}),h=!!i&&d.includes(i),[_="",P=""]=i?d.split(i):[d],L=r(_);if(_===L)return{value:s,selection:a};let M=l-o(s,l),W=c-o(s,c);return{value:u+L+(h?i:"")+P+g,selection:[Math.max(M,0),Math.max(W,0)]}}}function Zx({min:i,max:e,decimalSeparator:t,minusSign:n}){return({value:r,selection:o})=>{let s=Lc(r,t),a=s>0?Math.min(s,e):Math.max(s,i);if(s&&a!==s){let l=`${a}`.replace(".",t).replace(Js,n);return{value:l,selection:[l.length,l.length]}}return{value:r,selection:o}}}function Jx({decimalSeparator:i,thousandSeparator:e,decimalZeroPadding:t}){return({elementState:n,data:r},o)=>{let{value:s,selection:a}=n,[l,c]=a,d=s.slice(l,c),u=t?[i,e]:[e],g=t&&l>s.indexOf(i)&&!!d.match(/^0+$/gi);return o!=="deleteBackward"&&o!=="deleteForward"||!u.includes(d)&&!g?{elementState:n,data:r}:{elementState:{value:s,selection:o==="deleteForward"?[c,c]:[l,l]},data:r}}}function eC({decimalSeparator:i,precision:e,prefix:t,postfix:n}){let r=new RegExp(`^\\D*${yt(i)}`);return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPrefix:d}=di(a,{prefix:t,postfix:n}),[u,g]=l,h=ar(u-d.length,0,c.length),_=ar(g-d.length,0,c.length);if(e<=0||c.slice(0,h).includes(i)||c.slice(_).includes(i)||!s.match(r))return{elementState:o,data:s};let P=/\d+/.exec(c.slice(0,h));return{elementState:o,data:P?s:`0${s}`}}}function Pf({validCharacter:i,pseudoCharacters:e,prefix:t,postfix:n}){let r=new RegExp(`[${e.join("")}]`,"gi");return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPostfix:d,extractedPrefix:u}=di(a,{prefix:t,postfix:n});return{elementState:{selection:l,value:u+c.replace(r,i)+d},data:s.replace(r,i)}}}function tC({decimalSeparator:i,prefix:e,postfix:t}){return i?({elementState:n,data:r})=>{let{value:o,selection:s}=n,[a,l]=s,{cleanValue:c}=di(o,{prefix:e,postfix:t});return{elementState:n,data:!c.includes(i)||o.slice(a,l+1).includes(i)?r:r.replaceAll(new RegExp(yt(i),"gi"),"")}}:lr}function iC({thousandSeparator:i,decimalSeparator:e,prefix:t,postfix:n,minusSign:r}){if(!i)return lr;let o=(...s)=>s.every(a=>/\s/.test(a));return({value:s,selection:a})=>{let[l,c]=a,[d,u]=a,{cleanValue:g,extractedPostfix:h,extractedPrefix:_}=di(s,{prefix:t,postfix:n}),{minus:P,integerPart:L,decimalPart:M}=Rf(g,{decimalSeparator:e,minusSign:r}),W=e&&g.includes(e),de=g.length-(P+L+(W?e+M:"")).length;de>0&&l&&l<=de&&(d-=de),de>0&&c&&c<=de&&(u-=de);let oe=Array.from(L).reduceRight((ee,b,w)=>{let A=!(!w&&b===i)&&!!ee.length&&(ee.length+1)%4===0,z=b===i||o(b,i);return A&&z?i+ee:!A&&z?(w&&w<=l&&d--,w&&w<=c&&u--,ee):A?(w<l&&d++,w<c&&u++,b+i+ee):b+ee},"");return{value:_+P+oe+(W?e:"")+M+h,selection:[d,u]}}}function nC({precision:i,decimalSeparator:e,prefix:t,postfix:n}){if(i>0||!e)return lr;let r=new RegExp(`${yt(e)}.*$`,"g");return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPrefix:d,extractedPostfix:u}=di(a,{prefix:t,postfix:n}),[g,h]=l,_=d+c.replace(r,"")+u;return{elementState:{selection:[Math.min(g,_.length),Math.min(h,_.length)],value:_},data:s.replace(r,"")}}}var Ef=[0,0];function rC({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n}){let r=Qx({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n});return cr("blur",o=>{let s=r({value:o.value,selection:Ef},{value:"",selection:Ef}).value;sr(o,s)},{capture:!0})}function oC({min:i,max:e,decimalSeparator:t}){return cr("blur",(n,r)=>{let o=Lc(n.value,t),s=ar(o,i,e);!Number.isNaN(o)&&o!==s&&sr(n,un(qx(s),r))},{capture:!0})}function sC({decimalSeparator:i,prefix:e,postfix:t}){return i?cr("blur",n=>{let{cleanValue:r,extractedPostfix:o,extractedPrefix:s}=di(n.value,{prefix:e,postfix:t}),a=s+r.replace(new RegExp(`^(\\D+)?${yt(i)}`),`$10${i}`)+o;sr(n,a)},{capture:!0}):Lx}function dr({max:i=Number.MAX_SAFE_INTEGER,min:e=Number.MIN_SAFE_INTEGER,precision:t=0,thousandSeparator:n=Nc,decimalSeparator:r=".",decimalPseudoSeparators:o,decimalZeroPadding:s=!1,prefix:a="",postfix:l="",minusSign:c=Bc}={}){let d=[Js,Df,kf,Tf,Bc].filter(_=>_!==n&&_!==r&&_!==c),u=Gx({decimalSeparator:r,thousandSeparator:n,decimalPseudoSeparators:o}),g=a.endsWith(r)&&t>0?`${a}${Bx}`:a,h=Kx({decimalSeparator:r,decimalPseudoSeparators:u,pseudoMinuses:d,prefix:g,postfix:l,minusSign:c});return r=t<=0&&r===n?"":r,Object.assign(Object.assign({},or),{mask:Ff({decimalSeparator:r,precision:t,thousandSeparator:n,prefix:g,postfix:l,isNegativeAllowed:e<0,minusSign:c}),preprocessors:[jx(),h,$x({prefix:g,postfix:l}),Pf({validCharacter:c,pseudoCharacters:d,prefix:g,postfix:l}),Pf({validCharacter:r,pseudoCharacters:u,prefix:g,postfix:l}),eC({decimalSeparator:r,precision:t,prefix:g,postfix:l}),Jx({decimalSeparator:r,decimalZeroPadding:s,thousandSeparator:n}),nC({precision:t,decimalSeparator:r,prefix:g,postfix:l}),tC({decimalSeparator:r,prefix:g,postfix:l})],postprocessors:[Zx({decimalSeparator:r,min:e,max:i,minusSign:c}),Ux(g),Vx(l),iC({decimalSeparator:r,thousandSeparator:n,prefix:g,postfix:l,minusSign:c}),Xx({decimalSeparator:r,decimalZeroPadding:s,precision:t,prefix:g,postfix:l}),Yx({prefix:g,postfix:l,decimalSeparator:r,minusSign:c})],plugins:[rC({decimalSeparator:r,thousandSeparator:n,prefix:g,postfix:l}),sC({decimalSeparator:r,prefix:g,postfix:l}),oC({min:e,max:i,decimalSeparator:r})],overwriteMode:s?({value:_,selection:[P]})=>P<=_.indexOf(r)?"shift":"replace":"shift"})}var Ji=(()=>{class i{constructor(){this.elementRef=N(Dt).nativeElement,this.ngZone=N(Et),this.maskedElement=null,this.options=null,this.elementPredicate=wf;let t=N(tt,{self:!0,optional:!0});if(t){let n=t.writeValue.bind(t);t.writeValue=r=>{n(this.options?un(String(r??""),this.options):r)}}}ngOnChanges(){return B(this,null,function*(){let{elementPredicate:t,options:n,maskedElement:r,elementRef:o,ngZone:s}=this;if(r?.destroy(),!n)return;let a=yield t(o);this.elementPredicate!==t||this.options!==n||s.runOutsideAngular(()=>{this.maskedElement=new Qs(a,n)})})}ngOnDestroy(){this.maskedElement?.destroy()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275dir=ln({type:i,selectors:[["","maskito",""]],inputs:{options:[0,"maskito","options"],elementPredicate:[0,"maskitoElement","elementPredicate"]},standalone:!0,features:[gi]})}}return i})(),Mf=(()=>{class i{transform(t,n){return un(String(t??""),n??or)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=rs({name:"maskito",type:i,pure:!0,standalone:!0})}}return i})();var lC=20,Bf=(()=>{class i{constructor(t,n,r){this._ngZone=t,this._platform=n,this._scrolled=new et,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){let n=this.scrollContainers.get(t);n&&(n.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=lC){return this._platform.isBrowser?new Pt(n=>{this._globalSubscription||this._addGlobalListener();let r=t>0?this._scrolled.pipe(al(t)).subscribe(n):this._scrolled.subscribe(n);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):ze()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,n)=>this.deregister(n)),this._scrolled.complete()}ancestorScrolled(t,n){let r=this.getAncestorScrollContainers(t);return this.scrolled(n).pipe(Zt(o=>!o||r.indexOf(o)>-1))}getAncestorScrollContainers(t){let n=[];return this.scrollContainers.forEach((r,o)=>{this._scrollableContainsElement(o,t)&&n.push(o)}),n}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,n){let r=Hp(n),o=t.getElementRef().nativeElement;do if(r==o)return!0;while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>{let t=this._getWindow();return sn(t.document,"scroll").subscribe(()=>this._scrolled.next())})}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}static{this.\u0275fac=function(n){return new(n||i)(pe(Et),pe(Ii),pe(gt,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var cC=20,Jr=(()=>{class i{constructor(t,n,r){this._platform=t,this._change=new et,this._changeListener=o=>{this._change.next(o)},this._document=r,n.runOutsideAngular(()=>{if(t.isBrowser){let o=this._getWindow();o.addEventListener("resize",this._changeListener),o.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){let t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){let t=this.getViewportScrollPosition(),{width:n,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+n,height:r,width:n}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let t=this._document,n=this._getWindow(),r=t.documentElement,o=r.getBoundingClientRect(),s=-o.top||t.body.scrollTop||n.scrollY||r.scrollTop||0,a=-o.left||t.body.scrollLeft||n.scrollX||r.scrollLeft||0;return{top:s,left:a}}change(t=cC){return t>0?this._change.pipe(al(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}static{this.\u0275fac=function(n){return new(n||i)(pe(Ii),pe(Et),pe(gt,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var ea=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Lt({type:i})}static{this.\u0275inj=Nt({})}}return i})(),zc=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Lt({type:i})}static{this.\u0275inj=Nt({imports:[Nr,ea,Nr,ea]})}}return i})();var Lf=zp(),Hc=class{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){let e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=We(-this._previousScrollPosition.left),e.style.top=We(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let e=this._document.documentElement,t=this._document.body,n=e.style,r=t.style,o=n.scrollBehavior||"",s=r.scrollBehavior||"";this._isEnabled=!1,n.left=this._previousHTMLStyles.left,n.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),Lf&&(n.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Lf&&(n.scrollBehavior=o,r.scrollBehavior=s)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let t=this._document.body,n=this._viewportRuler.getViewportSize();return t.scrollHeight>n.height||t.scrollWidth>n.width}};var jc=class{constructor(e,t,n,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=n,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef,this._overlayRef=e}enable(){if(this._scrollSubscription)return;let e=this._scrollDispatcher.scrolled(0).pipe(Zt(t=>!t||!this._overlayRef.overlayElement.contains(t.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{let t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},ta=class{enable(){}disable(){}attach(){}};function Vc(i,e){return e.some(t=>{let n=i.bottom<t.top,r=i.top>t.bottom,o=i.right<t.left,s=i.left>t.right;return n||r||o||s})}function zf(i,e){return e.some(t=>{let n=i.top<t.top,r=i.bottom>t.bottom,o=i.left<t.left,s=i.right>t.right;return n||r||o||s})}var Uc=class{constructor(e,t,n,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=n,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef,this._overlayRef=e}enable(){if(!this._scrollSubscription){let e=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(e).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:n,height:r}=this._viewportRuler.getViewportSize();Vc(t,[{width:n,height:r,bottom:r,right:n,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},uC=(()=>{class i{constructor(t,n,r,o){this._scrollDispatcher=t,this._viewportRuler=n,this._ngZone=r,this.noop=()=>new ta,this.close=s=>new jc(this._scrollDispatcher,this._ngZone,this._viewportRuler,s),this.block=()=>new Hc(this._viewportRuler,this._document),this.reposition=s=>new Uc(this._scrollDispatcher,this._viewportRuler,this._ngZone,s),this._document=o}static{this.\u0275fac=function(n){return new(n||i)(pe(Bf),pe(Jr),pe(Et),pe(gt))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),eo=class{constructor(e){if(this.scrollStrategy=new ta,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){let t=Object.keys(e);for(let n of t)e[n]!==void 0&&(this[n]=e[n])}}};var Wc=class{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}};var $f=(()=>{class i{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){let n=this._attachedOverlays.indexOf(t);n>-1&&this._attachedOverlays.splice(n,1),this._attachedOverlays.length===0&&this.detach()}static{this.\u0275fac=function(n){return new(n||i)(pe(gt))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),pC=(()=>{class i extends $f{constructor(t,n){super(t),this._ngZone=n,this._keydownListener=r=>{let o=this._attachedOverlays;for(let s=o.length-1;s>-1;s--)if(o[s]._keydownEvents.observers.length>0){let a=o[s]._keydownEvents;this._ngZone?this._ngZone.run(()=>a.next(r)):a.next(r);break}}}add(t){super.add(t),this._isAttached||(this._ngZone?this._ngZone.runOutsideAngular(()=>this._document.body.addEventListener("keydown",this._keydownListener)):this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}static{this.\u0275fac=function(n){return new(n||i)(pe(gt),pe(Et,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),hC=(()=>{class i extends $f{constructor(t,n,r){super(t),this._platform=n,this._ngZone=r,this._cursorStyleIsSet=!1,this._pointerDownListener=o=>{this._pointerDownEventTarget=Lr(o)},this._clickListener=o=>{let s=Lr(o),a=o.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:s;this._pointerDownEventTarget=null;let l=this._attachedOverlays.slice();for(let c=l.length-1;c>-1;c--){let d=l[c];if(d._outsidePointerEvents.observers.length<1||!d.hasAttached())continue;if(Hf(d.overlayElement,s)||Hf(d.overlayElement,a))break;let u=d._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>u.next(o)):u.next(o)}}}add(t){if(super.add(t),!this._isAttached){let n=this._document.body;this._ngZone?this._ngZone.runOutsideAngular(()=>this._addEventListeners(n)):this._addEventListeners(n),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){let t=this._document.body;t.removeEventListener("pointerdown",this._pointerDownListener,!0),t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(t){t.addEventListener("pointerdown",this._pointerDownListener,!0),t.addEventListener("click",this._clickListener,!0),t.addEventListener("auxclick",this._clickListener,!0),t.addEventListener("contextmenu",this._clickListener,!0)}static{this.\u0275fac=function(n){return new(n||i)(pe(gt),pe(Ii),pe(Et,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function Hf(i,e){let t=typeof ShadowRoot<"u"&&ShadowRoot,n=e;for(;n;){if(n===i)return!0;n=t&&n instanceof ShadowRoot?n.host:n.parentNode}return!1}var qf=(()=>{class i{constructor(t,n){this._platform=n,this._document=t}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t="cdk-overlay-container";if(this._platform.isBrowser||Cl()){let r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let o=0;o<r.length;o++)r[o].remove()}let n=this._document.createElement("div");n.classList.add(t),Cl()?n.setAttribute("platform","test"):this._platform.isBrowser||n.setAttribute("platform","server"),this._document.body.appendChild(n),this._containerElement=n}static{this.\u0275fac=function(n){return new(n||i)(pe(gt),pe(Ii))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),$c=class{constructor(e,t,n,r,o,s,a,l,c,d=!1,u){this._portalOutlet=e,this._host=t,this._pane=n,this._config=r,this._ngZone=o,this._keyboardDispatcher=s,this._document=a,this._location=l,this._outsideClickDispatcher=c,this._animationsDisabled=d,this._injector=u,this._backdropElement=null,this._backdropClick=new et,this._attachments=new et,this._detachments=new et,this._locationChanges=$i.EMPTY,this._backdropClickHandler=g=>this._backdropClick.next(g),this._backdropTransitionendHandler=g=>{this._disposeBackdrop(g.target)},this._keydownEvents=new et,this._outsidePointerEvents=new et,this._renders=new et,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy,this._afterRenderRef=bp(()=>yp(()=>{this._renders.next()},{injector:this._injector}))}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let t=this._portalOutlet.attach(e);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=ls(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof t?.onDestroy=="function"&&t.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){let e=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._disposeBackdrop(this._backdropElement),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=null,e&&this._detachments.next(),this._detachments.complete(),this._afterRenderRef.destroy(),this._renders.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=v(v({},this._config),e),this._updateElementSize()}setDirection(e){this._config=D(v({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){let e=this._config.direction;return e?typeof e=="string"?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let e=this._pane.style;e.width=We(this._config.width),e.height=We(this._config.height),e.minWidth=We(this._config.minWidth),e.minHeight=We(this._config.minHeight),e.maxWidth=We(this._config.maxWidth),e.maxHeight=We(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){let e="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._animationsDisabled&&this._backdropElement.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(e){if(this._animationsDisabled){this._disposeBackdrop(e);return}e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",this._backdropTransitionendHandler)}),e.style.pointerEvents="none",this._backdropTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(()=>{this._disposeBackdrop(e)},500))}}_toggleClasses(e,t,n){let r=Sl(t||[]).filter(o=>!!o);r.length&&(n?e.classList.add(...r):e.classList.remove(...r))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{let e=this._renders.pipe(pl(an(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),e.unsubscribe())})})}_disposeScrollStrategy(){let e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}_disposeBackdrop(e){e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",this._backdropTransitionendHandler),e.remove(),this._backdropElement===e&&(this._backdropElement=null)),this._backdropTimeout&&(clearTimeout(this._backdropTimeout),this._backdropTimeout=void 0)}},jf="cdk-overlay-connected-position-bounding-box",fC=/([A-Za-z%]+)$/,qc=class{get positions(){return this._preferredPositions}constructor(e,t,n,r,o){this._viewportRuler=t,this._document=n,this._platform=r,this._overlayContainer=o,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new et,this._resizeSubscription=$i.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}attach(e){this._overlayRef&&this._overlayRef,this._validatePositions(),e.hostElement.classList.add(jf),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._originRect,t=this._overlayRect,n=this._viewportRect,r=this._containerRect,o=[],s;for(let a of this._preferredPositions){let l=this._getOriginPoint(e,r,a),c=this._getOverlayPoint(l,t,a),d=this._getOverlayFit(c,t,n,a);if(d.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(a,l);return}if(this._canFitWithFlexibleDimensions(d,c,n)){o.push({position:a,origin:l,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(l,a)});continue}(!s||s.overlayFit.visibleArea<d.visibleArea)&&(s={overlayFit:d,overlayPoint:c,originPoint:l,position:a,overlayRect:t})}if(o.length){let a=null,l=-1;for(let c of o){let d=c.boundingBoxRect.width*c.boundingBoxRect.height*(c.position.weight||1);d>l&&(l=d,a=c)}this._isPushed=!1,this._applyPosition(a.position,a.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(s.position,s.originPoint);return}this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&pn(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(jf),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let e=this._lastPosition;if(e){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._getOriginPoint(this._originRect,this._containerRect,e);this._applyPosition(e,t)}else this.apply()}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,e.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t,n){let r;if(n.originX=="center")r=e.left+e.width/2;else{let s=this._isRtl()?e.right:e.left,a=this._isRtl()?e.left:e.right;r=n.originX=="start"?s:a}t.left<0&&(r-=t.left);let o;return n.originY=="center"?o=e.top+e.height/2:o=n.originY=="top"?e.top:e.bottom,t.top<0&&(o-=t.top),{x:r,y:o}}_getOverlayPoint(e,t,n){let r;n.overlayX=="center"?r=-t.width/2:n.overlayX==="start"?r=this._isRtl()?-t.width:0:r=this._isRtl()?0:-t.width;let o;return n.overlayY=="center"?o=-t.height/2:o=n.overlayY=="top"?0:-t.height,{x:e.x+r,y:e.y+o}}_getOverlayFit(e,t,n,r){let o=Uf(t),{x:s,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(s+=l),c&&(a+=c);let d=0-s,u=s+o.width-n.width,g=0-a,h=a+o.height-n.height,_=this._subtractOverflows(o.width,d,u),P=this._subtractOverflows(o.height,g,h),L=_*P;return{visibleArea:L,isCompletelyWithinViewport:o.width*o.height===L,fitsInViewportVertically:P===o.height,fitsInViewportHorizontally:_==o.width}}_canFitWithFlexibleDimensions(e,t,n){if(this._hasFlexibleDimensions){let r=n.bottom-t.y,o=n.right-t.x,s=Vf(this._overlayRef.getConfig().minHeight),a=Vf(this._overlayRef.getConfig().minWidth),l=e.fitsInViewportVertically||s!=null&&s<=r,c=e.fitsInViewportHorizontally||a!=null&&a<=o;return l&&c}return!1}_pushOverlayOnScreen(e,t,n){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};let r=Uf(t),o=this._viewportRect,s=Math.max(e.x+r.width-o.width,0),a=Math.max(e.y+r.height-o.height,0),l=Math.max(o.top-n.top-e.y,0),c=Math.max(o.left-n.left-e.x,0),d=0,u=0;return r.width<=o.width?d=c||-s:d=e.x<this._viewportMargin?o.left-n.left-e.x:0,r.height<=o.height?u=l||-a:u=e.y<this._viewportMargin?o.top-n.top-e.y:0,this._previousPushAmount={x:d,y:u},{x:e.x+d,y:e.y+u}}_applyPosition(e,t){if(this._setTransformOrigin(e),this._setOverlayElementStyles(t,e),this._setBoundingBoxStyles(t,e),e.panelClass&&this._addPanelClasses(e.panelClass),this._positionChanges.observers.length){let n=this._getScrollVisibility();if(e!==this._lastPosition||!this._lastScrollVisibility||!mC(this._lastScrollVisibility,n)){let r=new Wc(e,n);this._positionChanges.next(r)}this._lastScrollVisibility=n}this._lastPosition=e,this._isInitialRender=!1}_setTransformOrigin(e){if(!this._transformOriginSelector)return;let t=this._boundingBox.querySelectorAll(this._transformOriginSelector),n,r=e.overlayY;e.overlayX==="center"?n="center":this._isRtl()?n=e.overlayX==="start"?"right":"left":n=e.overlayX==="start"?"left":"right";for(let o=0;o<t.length;o++)t[o].style.transformOrigin=`${n} ${r}`}_calculateBoundingBoxRect(e,t){let n=this._viewportRect,r=this._isRtl(),o,s,a;if(t.overlayY==="top")s=e.y,o=n.height-s+this._viewportMargin;else if(t.overlayY==="bottom")a=n.height-e.y+this._viewportMargin*2,o=n.height-a+this._viewportMargin;else{let h=Math.min(n.bottom-e.y+n.top,e.y),_=this._lastBoundingBoxSize.height;o=h*2,s=e.y-h,o>_&&!this._isInitialRender&&!this._growAfterOpen&&(s=e.y-_/2)}let l=t.overlayX==="start"&&!r||t.overlayX==="end"&&r,c=t.overlayX==="end"&&!r||t.overlayX==="start"&&r,d,u,g;if(c)g=n.width-e.x+this._viewportMargin*2,d=e.x-this._viewportMargin;else if(l)u=e.x,d=n.right-e.x;else{let h=Math.min(n.right-e.x+n.left,e.x),_=this._lastBoundingBoxSize.width;d=h*2,u=e.x-h,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(u=e.x-_/2)}return{top:s,left:u,bottom:a,right:g,width:d,height:o}}_setBoundingBoxStyles(e,t){let n=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));let r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{let o=this._overlayRef.getConfig().maxHeight,s=this._overlayRef.getConfig().maxWidth;r.height=We(n.height),r.top=We(n.top),r.bottom=We(n.bottom),r.width=We(n.width),r.left=We(n.left),r.right=We(n.right),t.overlayX==="center"?r.alignItems="center":r.alignItems=t.overlayX==="end"?"flex-end":"flex-start",t.overlayY==="center"?r.justifyContent="center":r.justifyContent=t.overlayY==="bottom"?"flex-end":"flex-start",o&&(r.maxHeight=We(o)),s&&(r.maxWidth=We(s))}this._lastBoundingBoxSize=n,pn(this._boundingBox.style,r)}_resetBoundingBoxStyles(){pn(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){pn(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){let n={},r=this._hasExactPosition(),o=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(r){let d=this._viewportRuler.getViewportScrollPosition();pn(n,this._getExactOverlayY(t,e,d)),pn(n,this._getExactOverlayX(t,e,d))}else n.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),n.transform=a.trim(),s.maxHeight&&(r?n.maxHeight=We(s.maxHeight):o&&(n.maxHeight="")),s.maxWidth&&(r?n.maxWidth=We(s.maxWidth):o&&(n.maxWidth="")),pn(this._pane.style,n)}_getExactOverlayY(e,t,n){let r={top:"",bottom:""},o=this._getOverlayPoint(t,this._overlayRect,e);if(this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n)),e.overlayY==="bottom"){let s=this._document.documentElement.clientHeight;r.bottom=`${s-(o.y+this._overlayRect.height)}px`}else r.top=We(o.y);return r}_getExactOverlayX(e,t,n){let r={left:"",right:""},o=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n));let s;if(this._isRtl()?s=e.overlayX==="end"?"left":"right":s=e.overlayX==="end"?"right":"left",s==="right"){let a=this._document.documentElement.clientWidth;r.right=`${a-(o.x+this._overlayRect.width)}px`}else r.left=We(o.x);return r}_getScrollVisibility(){let e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),n=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:zf(e,n),isOriginOutsideView:Vc(e,n),isOverlayClipped:zf(t,n),isOverlayOutsideView:Vc(t,n)}}_subtractOverflows(e,...t){return t.reduce((n,r)=>n-Math.max(r,0),e)}_getNarrowedViewportRect(){let e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+e-this._viewportMargin,bottom:n.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return t==="x"?e.offsetX==null?this._offsetX:e.offsetX:e.offsetY==null?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&Sl(e).forEach(t=>{t!==""&&this._appliedPanelClasses.indexOf(t)===-1&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){let e=this._origin;if(e instanceof Dt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();let t=e.width||0,n=e.height||0;return{top:e.y,bottom:e.y+n,left:e.x,right:e.x+t,height:n,width:t}}};function pn(i,e){for(let t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}function Vf(i){if(typeof i!="number"&&i!=null){let[e,t]=i.split(fC);return!t||t==="px"?parseFloat(e):null}return i||null}function Uf(i){return{top:Math.floor(i.top),right:Math.floor(i.right),bottom:Math.floor(i.bottom),left:Math.floor(i.left),width:Math.floor(i.width),height:Math.floor(i.height)}}function mC(i,e){return i===e?!0:i.isOriginClipped===e.isOriginClipped&&i.isOriginOutsideView===e.isOriginOutsideView&&i.isOverlayClipped===e.isOverlayClipped&&i.isOverlayOutsideView===e.isOverlayOutsideView}var Wf="cdk-global-overlay-wrapper",Gc=class{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._alignItems="",this._xPosition="",this._xOffset="",this._width="",this._height="",this._isDisposed=!1}attach(e){let t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(Wf),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._xOffset=e,this._xPosition="left",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._xOffset=e,this._xPosition="right",this}start(e=""){return this._xOffset=e,this._xPosition="start",this}end(e=""){return this._xOffset=e,this._xPosition="end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._xPosition="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:r,height:o,maxWidth:s,maxHeight:a}=n,l=(r==="100%"||r==="100vw")&&(!s||s==="100%"||s==="100vw"),c=(o==="100%"||o==="100vh")&&(!a||a==="100%"||a==="100vh"),d=this._xPosition,u=this._xOffset,g=this._overlayRef.getConfig().direction==="rtl",h="",_="",P="";l?P="flex-start":d==="center"?(P="center",g?_=u:h=u):g?d==="left"||d==="end"?(P="flex-end",h=u):(d==="right"||d==="start")&&(P="flex-start",_=u):d==="left"||d==="start"?(P="flex-start",h=u):(d==="right"||d==="end")&&(P="flex-end",_=u),e.position=this._cssPosition,e.marginLeft=l?"0":h,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=l?"0":_,t.justifyContent=P,t.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,n=t.style;t.classList.remove(Wf),n.justifyContent=n.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}},gC=(()=>{class i{constructor(t,n,r,o){this._viewportRuler=t,this._document=n,this._platform=r,this._overlayContainer=o}global(){return new Gc}flexibleConnectedTo(t){return new qc(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}static{this.\u0275fac=function(n){return new(n||i)(pe(Jr),pe(gt),pe(Ii),pe(qf))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),yC=0,en=(()=>{class i{constructor(t,n,r,o,s,a,l,c,d,u,g,h){this.scrollStrategies=t,this._overlayContainer=n,this._componentFactoryResolver=r,this._positionBuilder=o,this._keyboardDispatcher=s,this._injector=a,this._ngZone=l,this._document=c,this._directionality=d,this._location=u,this._outsideClickDispatcher=g,this._animationsModuleType=h}create(t){let n=this._createHostElement(),r=this._createPaneElement(n),o=this._createPortalOutlet(r),s=new eo(t);return s.direction=s.direction||this._directionality.value,new $c(o,n,r,s,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,this._animationsModuleType==="NoopAnimations",this._injector.get(hp))}position(){return this._positionBuilder}_createPaneElement(t){let n=this._document.createElement("div");return n.id=`cdk-overlay-${yC++}`,n.classList.add("cdk-overlay-pane"),t.appendChild(n),n}_createHostElement(){let t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(vp)),new Np(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}static{this.\u0275fac=function(n){return new(n||i)(pe(uC),pe(qf),pe(gp),pe(gC),pe(pC),pe(Ge),pe(Et),pe(gt),pe(Is),pe(fs),pe(hC),pe(fp,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var vC=new Rr("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let i=N(en);return()=>i.scrollStrategies.reposition()}});function bC(i){return()=>i.scrollStrategies.reposition()}var _C={provide:vC,deps:[en],useFactory:bC},Gf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Lt({type:i})}static{this.\u0275inj=Nt({providers:[en,_C],imports:[Nr,Lp,zc,zc]})}}return i})();var PC=["panel"],EC=["*"];function DC(i,e){if(i&1){let t=Ie();f(0,"div",1,0),U("@panelAnimation.done",function(r){se(t);let o=O();return ae(o._animationDone.next(r))}),Un(2),m()}if(i&2){let t=e.id,n=O();cs(n._classList),jn("mat-mdc-autocomplete-visible",n.showPanel)("mat-mdc-autocomplete-hidden",!n.showPanel)("mat-primary",n._color==="primary")("mat-accent",n._color==="accent")("mat-warn",n._color==="warn"),E("id",n.id)("@panelAnimation",n.isOpen?"visible":"hidden"),zt("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(t))}}var kC=Ep("panelAnimation",[kp("void, hidden",Br({opacity:0,transform:"scaleY(0.8)"})),wl(":enter, hidden => visible",[Dp([vs("0.03s linear",Br({opacity:1})),vs("0.12s cubic-bezier(0, 0, 0.2, 1)",Br({transform:"scaleY(1)"}))])]),wl(":leave, visible => hidden",[vs("0.075s linear",Br({opacity:0}))])]),TC=0,Yc=class{constructor(e,t){this.source=e,this.option=t}},Kf=new Rr("mat-autocomplete-default-options",{providedIn:"root",factory:IC});function IC(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var Qf=(()=>{class i{get isOpen(){return this._isOpen&&this.showPanel}_setColor(t){this._color=t,this._changeDetectorRef.markForCheck()}set classList(t){this._classList=t,this._elementRef.nativeElement.className=""}get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._syncParentProperties()}_syncParentProperties(){if(this.options)for(let t of this.options)t._changeDetectorRef.markForCheck()}constructor(t,n,r,o){this._changeDetectorRef=t,this._elementRef=n,this._defaults=r,this._activeOptionChanges=$i.EMPTY,this._animationDone=new lt,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new lt,this.opened=new lt,this.closed=new lt,this.optionActivated=new lt,this.id=`mat-autocomplete-${TC++}`,this.inertGroups=o?.SAFARI||!1,this.autoActiveFirstOption=!!r.autoActiveFirstOption,this.autoSelectActiveOption=!!r.autoSelectActiveOption,this.requireSelection=!!r.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new Up(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe(),this._animationDone.complete()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){let n=new Yc(this,t);this.optionSelected.emit(n)}_getPanelAriaLabelledby(t){if(this.ariaLabel)return null;let n=t?t+" ":"";return this.ariaLabelledby?n+this.ariaLabelledby:t}_skipPredicate(){return!1}static{this.\u0275fac=function(n){return new(n||i)(He(cn),He(Dt),He(Kf),He(Ii))}}static{this.\u0275cmp=fe({type:i,selectors:[["mat-autocomplete"]],contentQueries:function(n,r,o){if(n&1&&(ps(o,Ms,5),ps(o,$p,5)),n&2){let s;ti(s=ii())&&(r.options=s),ti(s=ii())&&(r.optionGroups=s)}},viewQuery:function(n,r){if(n&1&&(yi(Mr,7),yi(PC,5)),n&2){let o;ti(o=ii())&&(r.template=o.first),ti(o=ii())&&(r.panel=o.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",Gi],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",Gi],requireSelection:[2,"requireSelection","requireSelection",Gi],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",Gi],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",Gi]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],standalone:!0,features:[hs([{provide:Wp,useExisting:i}]),Ar,ye],ngContentSelectors:EC,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(n,r){n&1&&(Vn(),ue(0,DC,3,16,"ng-template"))},styles:["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape, var(--mat-app-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color, var(--mat-app-surface-container))}.cdk-high-contrast-active div.mat-mdc-autocomplete-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}"],encapsulation:2,data:{animation:[kC]},changeDetection:0})}}return i})();var OC={provide:Tp,useExisting:pp(()=>Kc),multi:!0};var Zf=new Rr("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let i=N(en);return()=>i.scrollStrategies.reposition()}});function FC(i){return()=>i.scrollStrategies.reposition()}var RC={provide:Zf,deps:[en],useFactory:FC},Kc=(()=>{class i{constructor(t,n,r,o,s,a,l,c,d,u,g){this._element=t,this._overlay=n,this._viewContainerRef=r,this._zone=o,this._changeDetectorRef=s,this._dir=l,this._formField=c,this._document=d,this._viewportRuler=u,this._defaults=g,this._componentDestroyed=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=$i.EMPTY,this._breakpointObserver=N(jp),this._handsetLandscapeSubscription=$i.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new et,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._initialized=new et,this._injector=N(Ge),this._aboveClass="mat-mdc-autocomplete-panel-above",this._overlayAttached=!1,this.optionSelections=cp(()=>{let h=this.autocomplete?this.autocomplete.options:null;return h?h.changes.pipe(ul(h),qi(()=>an(...h.map(_=>_.onSelectionChange)))):this._initialized.pipe(qi(()=>this.optionSelections))}),this._handlePanelKeydown=h=>{(h.keyCode===27&&!Fs(h)||h.keyCode===38&&Fs(h,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),h.stopPropagation(),h.preventDefault())},this._trackedModal=null,this._scrollStrategy=a}ngAfterViewInit(){this._initialized.next(),this._initialized.complete();let t=this._getWindow();typeof t<"u"&&this._zone.runOutsideAngular(()=>t.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){let t=this._getWindow();typeof t<"u"&&t.removeEventListener("blur",this._windowBlurHandler),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&Rs(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return an(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Zt(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Zt(()=>this._overlayAttached)):ze()).pipe(Qt(t=>t instanceof qp?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return an(sn(this._document,"click"),sn(this._document,"auxclick"),sn(this._document,"touchend")).pipe(Zt(t=>{let n=Lr(t),r=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,o=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&n!==this._element.nativeElement&&this._document.activeElement!==this._element.nativeElement&&(!r||!r.contains(n))&&(!o||!o.contains(n))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(n)}))}writeValue(t){Promise.resolve(null).then(()=>this._assignOptionValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){let n=t.keyCode,r=Fs(t);if(n===27&&!r&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&n===13&&this.panelOpen&&!r)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let o=this.autocomplete._keyManager.activeItem,s=n===38||n===40;n===9||s&&!r&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):s&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(s||this.autocomplete._keyManager.activeItem!==o)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(t){let n=t.target,r=n.value;if(n.type==="number"&&(r=r==""?null:parseFloat(r)),this._previousValue!==r){if(this._previousValue=r,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(r),!r)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let o=this.autocomplete.options?.find(s=>s.selected);if(o){let s=this._getDisplayValue(o.value);r!==s&&o.deselect(!1)}}if(this._canOpen()&&this._document.activeElement===t.target){let o=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(o)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_floatLabel(t=!1){this._formField&&this._formField.floatLabel==="auto"&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let t=new Pt(r=>{ls(()=>{r.next()},{injector:this._injector})}),n=this.autocomplete.options.changes.pipe(xe(()=>this._positionStrategy.reapplyLastPosition()),up(0));return an(t,n).pipe(qi(()=>this._zone.run(()=>{let r=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),r!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),ll(1)).subscribe(r=>this._setValueAndClose(r))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(t){let n=this.autocomplete;return n&&n.displayWith?n.displayWith(t):t}_assignOptionValue(t){let n=this._getDisplayValue(t);t==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(n??"")}_updateNativeInputValue(t){this._formField?this._formField._control.value=t:this._element.nativeElement.value=t,this._previousValue=t}_setValueAndClose(t){let n=this.autocomplete,r=t?t.source:this._pendingAutoselectedOption;r?(this._clearPreviousSelectedOption(r),this._assignOptionValue(r.value),this._onChange(r.value),n._emitSelectEvent(r),this._element.nativeElement.focus()):n.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),n._animationDone?n._animationDone.pipe(ll(1)).subscribe(()=>this._onChange(null)):this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(t,n){this.autocomplete?.options?.forEach(r=>{r!==t&&r.selected&&r.deselect(n)})}_openPanelInternal(t=this._element.nativeElement.value){if(this._attachOverlay(t),this._floatLabel(),this._trackedModal){let n=this.autocomplete.id;El(this._trackedModal,"aria-owns",n)}}_attachOverlay(t){this.autocomplete;let n=this._overlayRef;n?(this._positionStrategy.setOrigin(this._getConnectedElement()),n.updateSize({width:this._getPanelWidth()})):(this._portal=new xl(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),n=this._overlay.create(this._getOverlayConfig()),this._overlayRef=n,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&n&&n.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(Vp.HandsetLandscape).subscribe(o=>{o.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),n&&!n.hasAttached()&&(n.attach(this._portal),this._valueOnAttach=t,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let r=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&r!==this.panelOpen&&this._emitOpened()}_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let t=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=t.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=t.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new eo({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){let n=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],r=this._aboveClass,o=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:r},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:r}],s;this.position==="above"?s=o:this.position==="below"?s=n:s=[...n,...o],t.withPositions(s)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let t=this.autocomplete;if(t.autoActiveFirstOption){let n=-1;for(let r=0;r<t.options.length;r++)if(!t.options.get(r).disabled){n=r;break}t._keyManager.setActiveItem(n)}else t._keyManager.setActiveItem(-1)}_canOpen(){let t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this.autocompleteDisabled}_getWindow(){return this._document?.defaultView||window}_scrollToOption(t){let n=this.autocomplete,r=Gp(t,n.options,n.optionGroups);if(t===0&&r===1)n._setScrollTop(0);else if(n.panel){let o=n.options.toArray()[t];if(o){let s=o._getHostElement(),a=Xp(s.offsetTop,s.offsetHeight,n._getScrollTop(),n.panel.nativeElement.offsetHeight);n._setScrollTop(a)}}}_applyModalPanelOwnership(){let t=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!t)return;let n=this.autocomplete.id;this._trackedModal&&Rs(this._trackedModal,"aria-owns",n),El(t,"aria-owns",n),this._trackedModal=t}_clearFromModal(){if(this._trackedModal){let t=this.autocomplete.id;Rs(this._trackedModal,"aria-owns",t),this._trackedModal=null}}static{this.\u0275fac=function(n){return new(n||i)(He(Dt),He(en),He(as),He(Et),He(cn),He(Zf),He(Is,8),He(Yp,9),He(gt,8),He(Jr),He(Kf,8))}}static{this.\u0275dir=ln({type:i,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(n,r){n&1&&U("focusin",function(){return r._handleFocus()})("blur",function(){return r._onTouched()})("input",function(s){return r._handleInput(s)})("keydown",function(s){return r._handleKeydown(s)})("click",function(){return r._handleClick()}),n&2&&zt("autocomplete",r.autocompleteAttribute)("role",r.autocompleteDisabled?null:"combobox")("aria-autocomplete",r.autocompleteDisabled?null:"list")("aria-activedescendant",r.panelOpen&&r.activeOption?r.activeOption.id:null)("aria-expanded",r.autocompleteDisabled?null:r.panelOpen.toString())("aria-controls",r.autocompleteDisabled||!r.panelOpen||r.autocomplete==null?null:r.autocomplete.id)("aria-haspopup",r.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",Gi]},exportAs:["matAutocompleteTrigger"],standalone:!0,features:[hs([OC]),Ar,gi]})}}return i})(),Jf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Lt({type:i})}static{this.\u0275inj=Nt({providers:[RC],imports:[Gf,kl,Dl,ri,ea,kl,Dl]})}}return i})();function hn(i="emit"){return e=>e.pipe(xe(t=>console.log(`${i}`,t)))}var ia=()=>{let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16;return t=(i+t)%16|0,i=Math.floor(i/16),(e==="x"?t:t&3|8).toString(16)})};var Qc={dashboard:{View:"DashV"},estimate:{Create:"EstC",Edit:"EstE",Delete:"EstD"},report:{View:"Rep",Advanced:"RepA",Profit:"RepF"},shift:{View:"Shift",Create:"ShiftC",Edit:"ShiftE",Void:"ShiftVo"},contact:{View:"Con",Create:"ConC",Edit:"ConE",Delete:"ConD",LoyaltyPointEditor:"LoyPE",ContactDetail:"ContD",ContactImageEditor:"ContE",ContactSensitiveField:"ConSF",Supplier:"Supp"},sell:{Create:"Sell",PricebookSelector:"PricebS",Edit:"SellE",Delete:"SellD",Number:"NumE",SalesPerson:"SalesmanE",Return:"Return",Discount:"Disc",UnitPriceEditor:"UnitPE",Commission:"Comms",Tax:"Tax",CustomerInputLock:"CustL",Payment:"PayR",PriceVisible:"PriceV",PriceMinimum:"PriceM",Email:"Email",DeleteItem:"DelItm",Shipping:"Ship",PaymentCodeLock:"PayCL",EraseVoidOrd:"EraseVO",RestoreVoidOrd:"RestVO",RetrieveR:"RetrieveR",BundlingPrice:"BundlP",ClearCartRestriction:"ClearCartRestriction",CreditSalesLock:"CredSL",CouponInputLock:"CouponInputLock",Park:"Park"},orders:{View:"Ord",SupplierBill:"OrdB",VoidInvoice:"OrdVo",Print:"OrdRpr",NoteEditor:"OrdNe",Invoice:"OrdIr",Erase:"EraseVO"},product:{View:"Prod",Delete:"ProdD",ImageEditor:"ImgE",Create:"ProdC",Edit:"ProdE",Cost:"Cost",BarcodePrinting:"BarP",DeleteAllOutletPrice:"DeleteAllOutletPrice",Expense:"Expense",CommissionView:"CommV",ProductSensitiveField:"ProdSF",Price:"PriceV"},payment:{View:"Pay",Delete:"PayD",Create:"PayC",Edit:"PayE"},adjustment:{View:"Adj",Delete:"AdjD",Create:"AdjC",Edit:"AdjE",Approval:"AdjApp",InventoryProductCount:"InvPC"},buy:{Delete:"BuyD",Create:"Buy",Edit:"BuyE",ShippingRestriction:"BuySh",Approval:"PurA",Report:"BuyR"},logistics:{View:"Del",Create:"DelC",Edit:"DelE",Delete:"DelD",TransferOrderEditor:"DelRE",Outbound:"FulF",TransferOrderApproval:"DelA",TransferOrderReceiver:"DelR"},debt:{View:"Debt",Delete:"DebtD",Create:"DebtC",Edit:"DebtE"},prepaidPackage:{View:"Tre",Create:"TreC",Edit:"TreE",Delete:"TreD",TreatmentIncentive:"TreI",SharePackageEditor:"SharPacE",TreatmentNote:"TreN",Doctor:"Doct"},inventory:{View:"Inv",Edit:"InvE"},promotion:{View:"Prom",Create:"PromC",Edit:"PromE",Delete:"PromD",Coupon:"Cou",Pricebook:"Pri"},accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec"},users:{View:"Use",Create:"UseC",Edit:"UseE",Delete:"UseD",Groups:"Gro",LoginTimeRestriction:"LogTR",UserIPRestriction:"UseIR",GroupsRestriction:"UseG",LogRestriction:"LogResct"},outlets:{View:"Out",Create:"OutC",Edit:"OutE",Delete:"OutD"},setup:{View:"Stp",Create:"StpC",Edit:"StpE",Delete:"StpD",Webhook:"StpWh",Developer:"StpDev"},service:{View:"Serv"},myProfile:{View:"Prof",Notification:"Notf",Subscription:"Subs",Activity:"Actv"},customerDisplay:{View:"Disp"},orderDisplay:{View:"KitD"},global:{Export:"Export",Number:"NumE",Date:"DateE"},apps:{Marketplace:"Mrp",Jurnal:"Jurnal",Tools:"Tools"},fulfillment:{View:"Ful",Edit:"FulE",Create:"FulC",Delete:"FulD",Ship:"FulS"},manufacture:{View:"Man",Create:"ManC",Edit:"ManE",Delete:"ManD"},developer:{Api:"API",View:"Dev",Edit:"DevE"}};var em=(()=>{class i{constructor(){this._roles=[],this.parseJWTRoles()}parseJWTRoles(){let t=localStorage.getItem("Token");if(t){var n=Pl(t);this._roles=n["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"],console.log(this._roles)}}isInRole(t,n){let r={};return n.forEach((o,s)=>r[t[s]]=typeof o=="string"?this._roles.includes(o):o(this._roles)),r}isUserHasRole(t){return this._roles.includes(t)}get product(){return this._product||(this._product=this.setBulkRole("product")),this._product}get contact(){return this._contact||(this._contact=this.setBulkRole("contact")),this._contact}get promotion(){return this._promotion||(this._promotion=this.setBulkRole("promotion")),this._promotion}get accounting(){return this._accounting||(this._accounting=this.setBulkRole("accounting")),this._accounting}get users(){return this._users||(this._users=this.setBulkRole("users")),this._users}get outlets(){return this._outlets||(this._outlets=this.setBulkRole("outlets")),this._outlets}get setup(){return this._setup||(this._setup=this.setBulkRole("setup")),this._setup}get service(){return this._service||(this._service=this.setBulkRole("service")),this._service}get profile(){return this._profile||(this._profile=this.setBulkRole("myProfile")),this._profile}get customerDisplay(){return this._customerDisplay||(this._customerDisplay=this.setBulkRole("customerDisplay")),this._customerDisplay}get orderDisplay(){return this._orderDisplay||(this._orderDisplay=this.setBulkRole("orderDisplay")),this._orderDisplay}get global(){return this._global||(this._global=this.setBulkRole("global")),this._global}get apps(){return this._apps||(this._apps=this.setBulkRole("apps")),this._apps}get fulfillment(){return this._fulfillment||(this._fulfillment=this.setBulkRole("fulfillment")),this._fulfillment}get manufacture(){return this._manufacture||(this._manufacture=this.setBulkRole("manufacture")),this._manufacture}get inventory(){return this._inventory||(this._inventory=this.setBulkRole("inventory")),this._inventory}get sell(){return this._sell||(this._sell=this.setBulkRole("sell")),this._sell}get report(){return this._report||(this._report=this.setBulkRole("report")),this._report}get buy(){return this._buy||(this._buy=this.setBulkRole("buy")),this._buy}get adjustment(){return this._adjustment||(this._adjustment=this.setBulkRole("adjustment")),this._adjustment}get debt(){return this._debt||(this._debt=this.setBulkRole("debt")),this._debt}get payment(){return this._payment||(this._payment=this.setBulkRole("payment")),this._payment}get prepaidPackage(){return this._prepaidPackage||(this._prepaidPackage=this.setBulkRole("prepaidPackage")),this._prepaidPackage}get order(){return this._order||(this._order=this.setBulkRole("orders")),this._order}get logistic(){return this._logistic||(this._logistic=this.setBulkRole("logistics")),this._logistic}get estimate(){return this._estimate||(this._estimate=this.setBulkRole("estimate")),this._estimate}get shift(){return this._shift||(this._shift=this.setBulkRole("shift")),this._shift}get developer(){return this._developer||(this._developer=this.setBulkRole("developer")),this._developer}get dashboard(){return this._dashboard||(this._dashboard=this.setBulkRole("dashboard")),this._dashboard}setBulkRole(t){let n={};for(let r in Qc[t])n[r]=this.isUserHasRole(Qc[t][r]);return n}get isSystemUser(){let t=localStorage.getItem("Token");return Pl(t).Type=="System"}resetRoles(){this._roles=[],this._accounting=null,this._adjustment=null,this._apps=null,this._buy=null,this._contact=null,this._customerDisplay=null,this._debt=null,this._fulfillment=null,this._estimate=null,this._global=null,this._inventory=null,this._logistic=null,this._manufacture=null,this._order=null,this._orderDisplay=null,this._outlets=null,this._payment=null,this._product=null,this._prepaidPackage=null,this._profile=null,this._promotion=null,this._report=null,this._sell=null,this._service=null,this._setup=null,this._shift=null,this._users=null,this._developer=null,this._dashboard=null}toJSON(){return{product:this.product,contact:this.contact,promotion:this.promotion,accounting:this.accounting,users:this.users,outlets:this.outlets,setup:this.setup,service:this.service,profile:this.profile,customerDisplay:this.customerDisplay,orderDisplay:this.orderDisplay,global:this.global,apps:this.apps,fulfillment:this.fulfillment,manufacture:this.manufacture,inventory:this.inventory,sell:this.sell,report:this.report,buy:this.buy,adjustment:this.adjustment,debt:this.debt,payment:this.payment,prepaidPackage:this.prepaidPackage,order:this.order,logistic:this.logistic,estimate:this.estimate,shift:this.shift,developer:this.developer,dashboard:this.dashboard}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var tm=(i,e)=>e.PromotionID;function AC(i,e){if(i&1&&(f(0,"mat-option",19)(1,"div",20)(2,"span",21),x(3),m(),f(4,"span",22),x(5),m()()()),i&2){let t=e.$implicit;E("value",t),y(3),I(t.Value),y(2),I(t.Code)}}function BC(i,e){if(i&1&&Jt(0,AC,6,3,"mat-option",19,ds),i&2){let t=O();ei(t)}}function NC(i,e){i&1&&(f(0,"mat-option",18),x(1,"No items found"),m()),i&2&&E("disabled",!0)}function LC(i,e){i&1&&ue(0,BC,2,0)(1,NC,2,1,"mat-option",18),i&2&&Ce(e.length>0?0:1)}function zC(i,e){if(i&1){let t=Ie();f(0,"div",23)(1,"img",24),U("error",function(r){se(t);let o=O();return ae(o.onErrorImage(r))}),m(),f(2,"div",25)(3,"ngb-highlight",26),x(4),m(),f(5,"span"),x(6),m()()()}if(i&2){let t=e.result,n=e.term;y(),E("src",t.ImgUrl,os)("alt",t.Value),y(2),E("result",t.Value)("term",n),y(),I(t.Value),y(2),I(t.Code)}}function HC(i,e){if(i&1&&(f(0,"ng-option",28),x(1),m()),i&2){let t=e.$implicit;E("value",t.PromotionID),y(),I(t.Name)}}function jC(i,e){if(i&1&&(f(0,"ng-select",27),Jt(1,HC,2,2,"ng-option",28,tm),m()),i&2){let t=O(2);y(),ei(t)}}function VC(i,e){if(i&1&&(f(0,"ng-option",28),x(1),m()),i&2){let t=e.$implicit;E("value",t),y(),I(t.Name)}}function UC(i,e){if(i&1&&(f(0,"ng-select",27),Jt(1,VC,2,2,"ng-option",28,tm),m()),i&2){let t=O(2);y(),ei(t)}}function WC(i,e){if(i&1&&(f(0,"div",12)(1,"label",9),x(2,"Promotion Price"),m(),ue(3,jC,3,0,"ng-select",27)(4,UC,3,0,"ng-select",27),m()),i&2){let t=O(2);y(3),Ce(t.isEditProduct()?3:4)}}function $C(i,e){i&1&&ue(0,WC,5,1,"div",12),i&2&&Ce(e.length?0:-1)}function qC(i,e){if(i&1){let t=Ie();f(0,"button",29),U("click",function(){se(t);let r=O();return ae(r.resetForm())}),x(1," Cancel "),m()}}var ra=(()=>{class i{constructor(){this.promotionPrice$=ze([]),this.variant$=ze({}),this.UUidSelected="",this.httpService=N(bi),this.fb=N(Yi),this.router=N($n),this.storeService=N(ke),this.location=N(fs),this.maskitoOptions=dr({precision:2,thousandSeparator:","}),this.route=N(gs),this.variant={},this.roleService=N(em),this.domain="",this.isEditProduct=q(!1)}displayFn(t){return t?t.Value:""}initForm(){this.form=this.fb.group({name:new nt("",[ct.required]),quantity:new nt("",[ct.required]),promotionPrice:new nt("",[]),price:new nt("",[ct.required])})}ngAfterViewInit(){this.domain=`https://${localStorage.getItem("Domain")}`}ngOnInit(){this.initForm(),this.form.get("promotionPrice").valueChanges.pipe(Zt(()=>Object.keys(this.variant).length>0),hn("prommotionPrice"),xe(t=>{if(t)this.form.patchValue({price:+this.variant.UnitPrice}),this.form.get("price").disable();else{console.warn("Invalid UnitPrice, not patching price");let n=[...this.storeService.productItems()],r=n.findIndex(o=>o.Uuid.toLowerCase()===this.route.snapshot.queryParamMap.get("id")?.toLowerCase());r!==-1&&this.form.patchValue({price:+this.variant.UnitPrice!=+n[r].UnitPrice?+n[r].UnitPrice:+this.variant.UnitPrice}),this.form.get("price").enable()}})).subscribe(),this.route.queryParamMap.pipe(xe(t=>{this.isEditProduct.set(t.has("id")),console.log("edit",this.isEditProduct()),this.UUidSelected=t.get("id")||""})).subscribe(),this.route.queryParamMap.pipe(qi(t=>{if(t.has("id")){let n=t.get("id"),r=[...this.storeService.productItems()],o=r.findIndex(s=>s.Uuid.toLowerCase()===n.toLowerCase());if(o!==-1){let s={EntityID:"00000000-0000-0000-0000-000000000000",ID:r[o].ID},a={VariantID:r[o].ID};return sl([this.httpService.post("/API/V3/Variant/ID",s,void 0,this.domain),this.roleService.promotion.View?this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",a,void 0,this.domain):ze(null)]).pipe(Qt(([l,c])=>({variant:l,promotion:c,KEY:n})))}return ze(null)}else return this.form.reset(),this.form.enable(),this.promotionPrice$=ze([]),ze(null)}),hn("edit"),xe(t=>{if(t===null)return;this.form.get("name").disable();let{variant:n,promotion:r,KEY:o}=t;this.promotionPrice$=ze(r),this.variant$=ze(n),this.variant=n;let s=[...this.storeService.productItems()],a=s.findIndex(l=>l.Uuid.toLowerCase()===o.toLowerCase());if(a!==-1){let l=r.findIndex(c=>c.PromotionID.toLowerCase()===s[a].Promotions?.PromotionID?.toLowerCase());if(l!==-1){let c=+r[l]?.UnitPrice;isNaN(c)&&(c=+n.UnitPrice),this.form.patchValue({price:+n.UnitPrice!=+s[a].UnitPrice?+s[a].UnitPrice:+n.UnitPrice,promotionPrice:r[l].PromotionID,quantity:+s[a].Quantity,name:{Value:n.Name}}),this.form.get("price").disable()}else this.form.patchValue({price:+n.UnitPrice!=+s[a].UnitPrice?+s[a].UnitPrice:+n.UnitPrice,promotionPrice:null,quantity:+s[a].Quantity,name:{Value:n.Name}})}})).subscribe(),this.variantSuggestion$=this.form.get("name").valueChanges.pipe(dp(200),cl(),qi(t=>{if(t&&t.length>2){let n={count:100,prefix:t},r=`https://${localStorage.getItem("Domain")}`;return this.httpService.post("/API/AC/GetVariantSuggestionByCodeNName",n,void 0,r)}else return ze([])}))}onOptionSelected(t){if(Object.hasOwn(t.option.value,"Key")){let n=t.option.value.Key,r={EntityID:"00000000-0000-0000-0000-000000000000",ID:n},o={VariantID:n};return sl([this.httpService.post("/API/V3/Variant/ID",r,void 0,this.domain),this.roleService.promotion.View?this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",o,void 0,this.domain):ze(null)]).pipe(Qt(([s,a])=>({variant:s,promotion:a})),xe(({variant:s,promotion:a})=>{this.form.patchValue({price:s.UnitPrice,promotionPrice:null,quantity:1}),this.promotionPrice$=ze(a),this.variant$=ze(s),this.variant=s})).subscribe()}else throw new Error("Key not found")}onSubmit(){let{name:t,quantity:n,promotionPrice:r,price:o}=this.form.getRawValue(),s=n.toString().replace(/,/g,""),a=o.toString().replace(/,/g,"");return this.isEditProduct()?ns([this.promotionPrice$,this.variant$]).pipe(Qt(([l,c])=>({promotions:l,variant:c})),Qt(({promotions:l,variant:c})=>{let d=[...this.storeService.productItems()],u=d.findIndex(h=>h.Uuid.toLowerCase()===this.UUidSelected.toLowerCase());if(u!==-1){let h=l.findIndex(_=>_.PromotionID.toLowerCase()===r?.toLowerCase());if(h!==-1){let _=+l[h]?.UnitPrice;isNaN(_)&&(_=+c.UnitPrice),d[u]=D(v({},d[u]),{Quantity:+s,Promotions:l[h],UnitPrice:+a,isSelected:!1})}else d[u]=D(v({},d[u]),{Quantity:+s,Promotions:r,UnitPrice:+a,isSelected:!1})}let g=[...d];this.storeService.onChangeProductItems(g),this.form.get("price").enable(),this.form.reset(),this.router.navigate(["/pages"]),this.promotionPrice$=ze([]),this.variant={}})).subscribe():this.variant$.pipe(Qt(l=>D(v({},l),{Quantity:+n,Promotions:r,UnitPrice:+a,Uuid:ia()})),xe(l=>{let c=[...this.storeService.productItems()];c.push(l);let d=[...c];this.storeService.onChangeProductItems(d),this.form.get("price").enable(),this.form.reset(),this.promotionPrice$=ze([])})).subscribe()}onErrorImage(t){console.log(t);let n=t.target;t.type==="error"&&(n.src="assets/images/image-404.svg")}get hasEdit(){return this.route.snapshot.queryParamMap.has("id")}resetForm(){this.form.reset(),this.router.navigate([],{relativeTo:this.route,queryParams:{id:null},queryParamsHandling:"merge"})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["modal-choose-product"]],standalone:!0,features:[ye],decls:31,vars:14,consts:[["auto","matAutocomplete"],["rt",""],[1,"card","mb-3","w-100","p-0"],[1,"card-header","px-0"],[1,"text-dark","fw-medium","font-robotoslab",2,"margin","0.6rem 0","font-size","16px"],[1,"card-body","px-0","py-0","pt-4"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"form-group","d-flex","flex-column","position-relative"],[1,"text-dark","fs-2","fw-semibold","font-robotoslab"],["type","text","formControlName","name",1,"form-control","form-control-lg","fs-3",3,"matAutocomplete"],["autoActiveFirstOption","",3,"optionSelected","displayWith"],[1,"form-group"],["type","text","formControlName","quantity",1,"form-control","form-control-lg","fs-3",3,"maskito"],["type","text","formControlName","price",1,"form-control","form-control-lg","fs-3",3,"maskito"],[1,"d-flex","gap-4"],["type","button",1,"flex","flex-grow-1","btn","btn-outline-secondary"],["type","button",1,"flex","flex-grow-1","btn","btn-success",3,"click","disabled"],[1,"fs-2",3,"disabled"],[1,"fs-2",3,"value"],[1,"d-flex","flex-column"],[1,"fs-2"],[1,"opacity-75",2,"font-size","11px"],[1,"d-flex","w-100","overflow-x-hidden","gap-2"],[1,"me-1",2,"width","42px","height","42px",3,"error","src","alt"],[1,"flex-grow-1","d-flex","flex-column","flex-wrap"],[3,"result","term"],["formControlName","promotionPrice","placeholder","Select Promotion Price",1,"custom","fs-3"],[1,"fs-3",3,"value"],["type","button",1,"flex","flex-grow-1","btn","btn-outline-secondary",3,"click"]],template:function(n,r){if(n&1){let o=Ie();f(0,"div",2)(1,"div",3)(2,"span",4),x(3),m()(),f(4,"div",5)(5,"div",6)(6,"form",7)(7,"div",8)(8,"label",9),x(9,"Name"),m(),le(10,"input",10),f(11,"mat-autocomplete",11,0),U("optionSelected",function(a){return se(o),ae(r.onOptionSelected(a))}),ue(13,LC,2,1),Ue(14,"async"),m(),ue(15,zC,7,6,"ng-template",null,1,me),m(),f(17,"div",12)(18,"label",9),x(19,"Quantity"),m(),le(20,"input",13),m(),f(21,"div",12)(22,"label",9),x(23,"Price"),m(),le(24,"input",14),m(),ue(25,$C,1,1),Ue(26,"async"),f(27,"div",15),ue(28,qC,2,0,"button",16),f(29,"button",17),U("click",function(){return se(o),ae(r.onSubmit())}),x(30," Submit "),m()()()()()()}if(n&2){let o,s,a=yl(12);y(3),Ht("",r.UUidSelected?"Update":"Add"," Product"),y(3),E("formGroup",r.form),y(4),E("matAutocomplete",a),y(),E("displayWith",r.displayFn),y(2),Ce((o=ni(14,10,r.variantSuggestion$))?13:-1,o),y(7),E("maskito",r.maskitoOptions),y(4),E("maskito",r.maskitoOptions),y(),Ce((s=ni(26,12,r.promotionPrice$))?25:-1,s),y(3),Ce(r.hasEdit?28:-1),y(),E("disabled",r.form.invalid)}},dependencies:[ys,oi,_i,As,rt,ws,tt,it,_s,xs,Cs,Bp,wp,Ji,Os,Jf,Qf,Ms,Kc],styles:[".mat-mdc-autocomplete-panel{background-color:#fff!important} .mat-mdc-autocomplete-panel>.mat-mdc-option.mdc-list-item--disabled{min-height:34px}"]})}}return i})();var im=(()=>{class i{constructor(){this.transactionType=q([{title:"Supplier Bill",type:0},{title:"Transfer Order",type:1}]),this.storeService=N(ke),this.fb=N(Yi),this.activeModal=N(Xn)}get outlets(){return this.storeService.paperConfig().Outlets}initForm(){this.form=this.fb.group({type:new nt("",[ct.required]),outlet:new nt("",[ct.required]),number:new nt("",[ct.required])})}ngOnInit(){this.initForm()}onOK(){this.activeModal.close({role:"ok",data:this.form.value})}onClose(){this.activeModal.dismiss({role:"close",data:null})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-dialog-load-transaction"]],standalone:!0,features:[ye],decls:14,vars:4,consts:[["title","Choose your transaction",3,"onOK","onClose","hasValid"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],[1,"form-group"],[1,"text-dark","fs-2","fw-semibold","font-robotoslab"],["formControlName","type","bindLabel","title","bindValue","type","placeholder","Choose Type",1,"custom","fs-2",3,"items"],["formControlName","outlet","bindLabel","Name","bindValue","Name","placeholder","Choose Outlet",1,"custom","fs-2",3,"items"],["formControlName","number","type","text",1,"form-control","fs-2",2,"height","32px"]],template:function(n,r){n&1&&(f(0,"app-base-modal",0),U("onOK",function(){return r.onOK()})("onClose",function(){return r.onClose()}),f(1,"form",1)(2,"div",2)(3,"label",3),x(4,"Choose Type"),m(),le(5,"ng-select",4),m(),f(6,"div",2)(7,"label",3),x(8,"Choose Outlet"),m(),le(9,"ng-select",5),m(),f(10,"div",2)(11,"label",3),x(12,"Invoice Number"),m(),le(13,"input",6),m()()()),n&2&&(E("hasValid",r.form.valid),y(),E("formGroup",r.form),y(4),E("items",r.transactionType()),y(4),E("items",r.outlets))},dependencies:[Xs,oi,_i,ht,ws,tt,it,_s,rt,xs,Cs],changeDetection:0})}}return i})();var GC=(()=>{class i{constructor(t){this.document=t,this.width=this.getWidth()}getWidth(){let t=this.document.createElement("div");t.style.visibility="hidden",t.style.width="100px",t.style.msOverflowStyle="scrollbar",this.document.body.appendChild(t);let n=t.offsetWidth;t.style.overflow="scroll";let r=this.document.createElement("div");r.style.width="100%",t.appendChild(r);let o=r.offsetWidth;return t.parentNode.removeChild(t),n-o}}return i.\u0275fac=function(t){return new(t||i)(pe(gt))},i.\u0275prov=Ve({token:i,factory:i.\u0275fac}),i})(),XC=(()=>{class i{getDimensions(t){return t.getBoundingClientRect()}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=Ve({token:i,factory:i.\u0275fac}),i})(),YC=(()=>{class i{constructor(){this.columnInputChanges=new et}get columnInputChanges$(){return this.columnInputChanges.asObservable()}onInputChange(){this.columnInputChanges.next()}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=Ve({token:i,factory:i.\u0275fac}),i})();function KC(i){return i=i.replace(/[^a-zA-Z0-9 ]/g," "),i=i.replace(/([a-z](?=[A-Z]))/g,"$1 "),i=i.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,"").trim().toLowerCase(),i=i.replace(/([ 0-9]+)([a-zA-Z])/g,function(e,t,n){return t.trim()+n.toUpperCase()}),i}var oa={},nm=typeof document<"u"?document.createElement("div").style:void 0,Zc=function(){let i=typeof window<"u"?window.getComputedStyle(document.documentElement,""):void 0,e=typeof i<"u"?Array.prototype.slice.call(i).join("").match(/-(moz|webkit|ms)-/):null,t=e!==null?e[1]:void 0,n=typeof t<"u"?"WebKit|Moz|MS|O".match(new RegExp("("+t+")","i"))[1]:void 0;return n?{dom:n,lowercase:t,css:`-${t}-`,js:t[0].toUpperCase()+t.substr(1)}:void 0}();function sa(i){let e=KC(i);return oa[e]||(Zc!==void 0&&nm[Zc.css+i]!==void 0?oa[e]=Zc.css+i:nm[i]!==void 0&&(oa[e]=i)),oa[e]}var p3=typeof window<"u"?sa("transform"):void 0,h3=typeof window<"u"?sa("backfaceVisibility"):void 0,f3=typeof window<"u"?!!sa("transform"):void 0,m3=typeof window<"u"?!!sa("perspective"):void 0,rm=typeof window<"u"?window.navigator.userAgent:"Chrome",g3=/Safari\//.test(rm)&&!/Chrome\//.test(rm);var om=(()=>{class i{static forRoot(t){return{ngModule:i,providers:[{provide:"configuration",useValue:t}]}}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=Lt({type:i}),i.\u0275inj=Nt({providers:[GC,XC,YC],imports:[[ri]]}),i})();typeof document<"u"&&!document.elementsFromPoint&&(document.elementsFromPoint=QC);function QC(i,e){let t=[],n=[],r,o,s;for(;(r=document.elementFromPoint(i,e))&&t.indexOf(r)===-1&&r!=null;)t.push(r),n.push({value:r.style.getPropertyValue("pointer-events"),priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(o=n.length;s=n[--o];)t[o].style.setProperty("pointer-events",s.value?s.value:"",s.priority);return t}var sm=(()=>{class i{constructor(){this.subject$=new et}onFileLoad(t){let r=t.target.result,o=!1,s=[],a=[],l=0;for(let c of r.split(/[\r\n]+/))if(o){let d={};for(let u=0;u<l;u++)d[a[u]]=c.split(",")[u];s.push(d)}else{for(let d=0;d<c.split(",").length;d++)l=c.split(",").length,a.push(c.split(",")[d].replace(/ /g,""));o=!0}return s.splice(-1),s}convertFile(t){let n=t,r=new FileReader;return r.onload=o=>{let s=this.onFileLoad(o);this.subject$.next(s)},r.readAsText(n,"UTF-8"),this.subject$.asObservable()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var am=(()=>{class i{constructor(t,n,r){this.http=t,this.toastr=n,this.router=r}PostToUrlEncode(t,n,r=1e5){let o=new vi;return o=o.set("Content-Type","application/x-www-form-urlencoded"),new Pt(s=>{this.http.post(t,n,{headers:o}).pipe(mi(r)).subscribe(a=>{s.next(a),s.complete()})})}GetText(t=1e5){let n=localStorage.getItem("Token"),o={responseType:"text",headers:new vi({Authorization:"Bearer "+n})};return new Pt(s=>{this.http.get("/API/Token/GetZendeskJWT",o).pipe(mi(t)).subscribe(a=>{s.next(a),s.complete()})})}POSText(t,n,r=1e5){let o=localStorage.getItem("Token"),a={responseType:"text",headers:new vi({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+o})};return new Pt(l=>{this.http.post(t,n,a).pipe(mi(r)).subscribe(c=>{l.next(c),l.complete()})})}get(t){let n=localStorage.getItem("Token"),r=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});n&&(r=r.append("Authorization","Bearer "+n));let o={headers:r};return this.http.get(t,o).pipe(Fr(s=>{if(!this.unauthorizedErrorHandling(s)){let l=this.errorMessageHandling(s);this.toastr.error(l.Message!=""?l.Message:"An unknown error has occured!",l.header),this.paymentErrorHandling(s)}return lp(()=>s)}))}getNews(t){return this.http.get(t)}paymentErrorHandling(t){t.status==402&&this.router.navigate(["/menu/Profile/Main/My_Subscription"])}post(t,n,r=1e5){return new Pt(o=>{let s=localStorage.getItem("Token"),a=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});s&&(a=a.append("Authorization","Bearer "+s));let l={headers:a};Date.prototype.toJSON=function(){return this.getFullYear()+"-"+c(this.getMonth()+1)+"-"+c(this.getDate())+"T"+c(this.getHours())+":"+c(this.getMinutes())+":"+c(this.getSeconds())+".000"};function c(d){return d<10?"0"+d:d}this.http.post(t,n,l).pipe(mi(r)).subscribe({next:d=>{o.next(d),o.complete()},error:d=>{if(d.status==200)o.next(d.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(d)){let g=this.errorMessageHandling(d);this.toastr.error(g.Message!=""?g.Message:"An unknown error has occured!",g.header,{enableHtml:!0})}o.error(d)}}})})}postFile(t,n,r=1e5){return new Pt(o=>{let s=localStorage.getItem("Token"),a=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});s&&(a=a.append("Authorization","Bearer "+s)),this.http.post(t,n,{headers:a,observe:"response",responseType:"blob"}).pipe(mi(r)).subscribe({next:l=>{o.next({title:l.headers.get("Content-Disposition"),file:l.body}),o.complete()},error:l=>{if(l.headers.get("Content-Type")==="application/json; charset=utf-8"){let c=new FileReader;c.addEventListener("loadend",d=>{let u=JSON.parse(d.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(l)){let h=this.errorMessageHandling(l);this.toastr.error(u??"An unknown error has occured!",h.header,{enableHtml:!0})}}),c.readAsText(l.error)}o.error(l)}})})}put(t,n,r=1e5){return new Pt(o=>{let s=localStorage.getItem("Token"),a=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});s&&(a=a.append("Authorization","Bearer "+s));let l={headers:a};this.http.put(t,n,l).pipe(mi(r)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)){let u=this.errorMessageHandling(c);this.toastr.error(u.Message!=""?u.Message:"An unknown error has occured!",u.header)}o.error(c)}}})})}delete(t,n,r=1e5){return new Pt(o=>{let s=localStorage.getItem("Token"),a=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});s&&(a=a.append("Authorization","Bearer "+s));let l={headers:a,body:n};this.http.delete(t,l).pipe(mi(r)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)){let u=this.errorMessageHandling(c);this.toastr.error(u.Message!=""?u.Message:"An unknown error has occured!",u.header)}o.error(c)}}})})}unauthorizedErrorHandling(t){let n=!1;return(t.status==401||t.status==403)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",n=!0),n}errorMessageHandling(t){let n="API Error",r="Exception Message";return t.error?(n="API Error - "+t.status,t.status==451&&(n="Error"),t.error&&(r=t.error.Message)):t.Message&&(n="API Error - "+t.name,r=t.Message),{header:n,Message:r}}postFormDataWithoutBearer(t,n){return new Pt(r=>{this.http.post(t,n).pipe(mi(1e5)).subscribe({next:o=>{r.next(o),r.complete()},error:o=>{o.status==200&&(r.next(o.error.text),r.complete()),r.error(o)}})})}postFormData(t,n,r=!0){return new Pt(o=>{let s=localStorage.getItem("Token"),l={headers:new vi({Authorization:"Bearer "+s})};this.http.post(t,n,l).pipe(mi(1e5)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)&&r){let u=this.errorMessageHandling(c);this.toastr.error(u.Message!=""?u.Message:"An unknown error has occured!",u.header)}o.error(c)}}})})}static{this.\u0275fac=function(n){return new(n||i)(pe(Pp),pe(bs),pe($n))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function aa(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var ZC=0;function cm(i){return"__private_"+ZC+++"_"+i}function JC(i,e,t){let n=[];return i.forEach(r=>typeof r!="string"?n.push(r):e[Symbol.split](r).forEach((o,s,a)=>{o!==""&&n.push(o),s<a.length-1&&n.push(t)})),n}function lm(i,e){let t=/\$/g,n="$$$$",r=[i];if(e==null)return r;for(let o of Object.keys(e))if(o!=="_"){let s=e[o];typeof s=="string"&&(s=t[Symbol.replace](s,n)),r=JC(r,new RegExp(`%\\{${o}\\}`,"g"),s)}return r}var eS=i=>{throw new Error(`missing string: ${i}`)},to=cm("onMissingKey"),io=cm("apply"),ur=class{constructor(e,t){let{onMissingKey:n=eS}=t===void 0?{}:t;Object.defineProperty(this,io,{value:tS}),Object.defineProperty(this,to,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(e)?e.forEach(aa(this,io)[io],this):aa(this,io)[io](e),aa(this,to)[to]=n}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let n=this.locale.strings[e];if(n==null&&(aa(this,to)[to](e),n=e),typeof n=="object"){if(t&&typeof t.smart_count<"u"){let o=this.locale.pluralize(t.smart_count);return lm(n[o],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof n!="string")throw new Error("string was not a string");return lm(n,t)}};function tS(i){if(!(i!=null&&i.strings))return;let e=this.locale;Object.assign(this.locale,{strings:v(v({},e.strings),i.strings),pluralize:i.pluralize||e.pluralize})}var sg=De(um(),1);var iS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var nn=(i=21)=>{let e="",t=i|0;for(;t--;)e+=iS[Math.random()*64|0];return e};var ag=De(Wm(),1);function ca(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var YS=0;function $m(i){return"__private_"+YS+++"_"+i}var KS={version:"4.2.0"},fn=$m("callbacks"),nd=$m("publish"),da=class{constructor(){Object.defineProperty(this,nd,{value:QS}),this.state={},Object.defineProperty(this,fn,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t=v({},this.state),n=v(v({},this.state),e);this.state=n,ca(this,nd)[nd](t,n,e)}subscribe(e){return ca(this,fn)[fn].add(e),()=>{ca(this,fn)[fn].delete(e)}}};function QS(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];ca(this,fn)[fn].forEach(n=>{n(...e)})}da.VERSION=KS.version;var qm=da;function xi(i){let e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}var rd={__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",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 ro(i){var e;if(i.type)return i.type;let t=i.name?(e=xi(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in rd?rd[t]:"application/octet-stream"}function ZS(i){return i.charCodeAt(0).toString(32)}function Gm(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${ZS(t)}`,"/"))+e}function Xm(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${Gm(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${Gm(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function JS(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function ua(i,e){if(JS(i))return i.id;let t=ro(i);return Xm(D(v({},i),{type:t}),e)}function od(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;let n=e[1].split(".",2),r=parseInt(n[0],10),o=parseInt(n[1],10);return r<15||r===15&&o<15063||r>18||r===18&&o>=18218}function sd(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function ad(i){return i<10?`0${i}`:i.toString()}function pr(){let i=new Date,e=ad(i.getHours()),t=ad(i.getMinutes()),n=ad(i.getSeconds());return`${e}:${t}:${n}`}var Ym={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${pr()}]`,...e)}},Km={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${pr()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${pr()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${pr()}]`,...e)}};var so=De(oo(),1),ng=De(ig(),1),rg={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},It=class extends Error{constructor(e,t){var n;super(e),this.isRestriction=!0,this.isUserFacing=(n=t?.isUserFacing)!=null?n:!0,t!=null&&t.file&&(this.file=t.file)}},pa=class{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var n;let r=e();if(((n=r.restrictions)==null?void 0:n.allowedFileTypes)!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:n,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&e.filter(s=>!s.isGhost).length+t.length>r)throw new It(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(n){let o=[...e,...t].reduce((s,a)=>{var l;return s+((l=a.size)!=null?l:0)},0);if(o>n)throw new It(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,so.default)(n),size:(0,so.default)(o)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:n,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(a=>a.includes("/")?e.type?(0,ng.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=r.join(", ");throw new It(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t){var o;throw new It(this.getI18n()("exceedsSize",{size:(0,so.default)(t),file:(o=e.name)!=null?o:this.getI18n()("unnamed")}),{file:e})}if(n&&e.size!=null&&e.size<n)throw new It(this.getI18n()("inferiorSize",{size:(0,so.default)(n)}),{file:e})}validate(e,t){t.forEach(n=>{this.validateSingleFile(n)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new It(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let n=new It(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:r}=this.getOpts().restrictions,o=[];for(let s of r)(!Object.hasOwn(e.meta,s)||e.meta[s]==="")&&o.push(s);return{missingFields:o,error:n}}};var og={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 H(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var iP=0;function Me(i){return"__private_"+iP+++"_"+i}var nP={version:"4.4.1"},ha={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},dt=Me("plugins"),ut=Me("restricter"),ao=Me("storeUnsubscribe"),Fi=Me("emitter"),mn=Me("preProcessors"),gn=Me("uploaders"),Ai=Me("postProcessors"),Ut=Me("informAndEmit"),fo=Me("checkRequiredMetaFieldsOnFile"),ld=Me("checkRequiredMetaFields"),lo=Me("assertNewUploadAllowed"),ud=Me("transformFile"),co=Me("startIfAutoProceed"),uo=Me("checkAndUpdateFileState"),pd=Me("handleUploadProgress"),po=Me("updateTotalProgress"),Bi=Me("updateTotalProgressThrottled"),hd=Me("calculateTotalProgress"),cd=Me("addListeners"),ui=Me("updateOnlineStatus"),ho=Me("requestClientById"),Ri=Me("createUpload"),dd=Me("getUpload"),yn=Me("removeUpload"),Mi=Me("runUpload"),fa=class i{constructor(e){Object.defineProperty(this,Mi,{value:yP}),Object.defineProperty(this,yn,{value:gP}),Object.defineProperty(this,dd,{value:mP}),Object.defineProperty(this,Ri,{value:fP}),Object.defineProperty(this,cd,{value:hP}),Object.defineProperty(this,hd,{value:pP}),Object.defineProperty(this,po,{value:uP}),Object.defineProperty(this,uo,{value:dP}),Object.defineProperty(this,co,{value:cP}),Object.defineProperty(this,ud,{value:lP}),Object.defineProperty(this,lo,{value:aP}),Object.defineProperty(this,ld,{value:sP}),Object.defineProperty(this,fo,{value:oP}),Object.defineProperty(this,Ut,{value:rP}),Object.defineProperty(this,dt,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,Fi,{writable:!0,value:(0,sg.default)()}),Object.defineProperty(this,mn,{writable:!0,value:new Set}),Object.defineProperty(this,gn,{writable:!0,value:new Set}),Object.defineProperty(this,Ai,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,pd,{writable:!0,value:(r,o)=>{let s=r?this.getFile(r.id):void 0;if(r==null||!s){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}if(s.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${r.id}`);return}let a={bytesTotal:o.bytesTotal,percentage:o.bytesTotal!=null&&Number.isFinite(o.bytesTotal)&&o.bytesTotal>0?Math.round(o.bytesUploaded/o.bytesTotal*100):void 0};s.progress.uploadStarted!=null?this.setFileState(r.id,{progress:D(v(v({},s.progress),a),{bytesUploaded:o.bytesUploaded})}):this.setFileState(r.id,{progress:v(v({},s.progress),a)}),H(this,Bi)[Bi]()}}),Object.defineProperty(this,Bi,{writable:!0,value:(0,ag.default)(()=>H(this,po)[po](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,ui,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,ho,{writable:!0,value:new Map}),this.defaultLocale=og;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:rg,meta:{},onBeforeFileAdded:(r,o)=>!Object.hasOwn(o,r.id),onBeforeUpload:r=>r,store:new qm,logger:Ym,infoTimeout:5e3},n=v(v({},t),e);this.opts=D(v({},n),{restrictions:v(v({},t.restrictions),e&&e.restrictions)}),e&&e.logger&&e.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"):e&&e.debug&&(this.opts.logger=Km),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState(D(v({},ha),{plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:od(),individualCancellation:!0,resumableUploads:!1},meta:v({},this.opts.meta),info:[]})),H(this,ut)[ut]=new pa(()=>this.opts,()=>this.i18n),H(this,ao)[ao]=this.store.subscribe((r,o,s)=>{this.emit("state-update",r,o,s),this.updateAll(o)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),H(this,cd)[cd]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];H(this,Fi)[Fi].emit(e,...n)}on(e,t){return H(this,Fi)[Fi].on(e,t),this}once(e,t){return H(this,Fi)[Fi].once(e,t),this}off(e,t){return H(this,Fi)[Fi].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:v(v({},t),Object.fromEntries(Object.entries(e).map(n=>{let[r,o]=n;return[r,v(v({},t[r]),o)]})))})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=n=>this.log(`Missing i18n string: ${n}`,"error"),t=new ur([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts=D(v(v({},this.opts),e),{restrictions:v(v({},this.opts.restrictions),e?.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t=v({},this.getState().files),n=Object.create(null);Object.keys(t).forEach(r=>{n[r]=D(v({},t[r]),{progress:v(v({},t[r].progress),e),tus:void 0,transloadit:void 0})}),this.setState(v({files:n},ha))}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState(D(v({},ha),{files:{}}))}addPreProcessor(e){H(this,mn)[mn].add(e)}removePreProcessor(e){return H(this,mn)[mn].delete(e)}addPostProcessor(e){H(this,Ai)[Ai].add(e)}removePostProcessor(e){return H(this,Ai)[Ai].delete(e)}addUploader(e){H(this,gn)[gn].add(e)}removeUploader(e){return H(this,gn)[gn].delete(e)}setMeta(e){let t=v(v({},this.getState().meta),e),n=v({},this.getState().files);Object.keys(n).forEach(r=>{n[r]=D(v({},n[r]),{meta:v(v({},n[r].meta),e)})}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){let n=v({},this.getState().files);if(!n[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let r=v(v({},n[e].meta),t);n[e]=D(v({},n[e]),{meta:r}),this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=[],s=[],a=[],l=[],c=[],d=[],u=[],g=[],h=[];for(let _ of r){let{progress:P}=_;!P.uploadComplete&&P.uploadStarted&&(o.push(_),_.isPaused||g.push(_)),P.uploadStarted||s.push(_),(P.uploadStarted||P.preprocess||P.postprocess)&&a.push(_),P.uploadStarted&&l.push(_),_.isPaused&&c.push(_),P.uploadComplete&&d.push(_),_.error&&u.push(_),(P.preprocess||P.postprocess)&&h.push(_)}return{newFiles:s,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:u,inProgressFiles:o,inProgressNotPausedFiles:g,processingFiles:h,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===r.length&&h.length===0,isAllErrored:!!n&&u.length===r.length,isAllPaused:o.length!==0&&c.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(_=>_.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{H(this,ut)[ut].validate(t,[e])}catch(n){return n}return null}validateSingleFile(e){try{H(this,ut)[ut].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{H(this,ut)[ut].validateAggregateRestrictions(t,e)}catch(n){return n.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){H(this,lo)[lo](e);let{nextFilesState:t,validFilesToAdd:n,errors:r}=H(this,uo)[uo]([e]),o=r.filter(a=>a.isRestriction);if(H(this,Ut)[Ut](o),r.length>0)throw r[0];this.setState({files:t});let[s]=n;return this.emit("file-added",s),this.emit("files-added",n),this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`),H(this,co)[co](),s.id}addFiles(e){H(this,lo)[lo]();let{nextFilesState:t,validFilesToAdd:n,errors:r}=H(this,uo)[uo](e),o=r.filter(a=>a.isRestriction);H(this,Ut)[Ut](o);let s=r.filter(a=>!a.isRestriction);if(s.length>0){let a=`Multiple errors occurred while adding files:
17
17
  `;if(s.forEach(l=>{a+=`
18
18
  * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:s.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(s,a);{let l=new Error(a);throw l.errors=s,l}}this.setState({files:t}),n.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.values(n).forEach(a=>{this.log(`Added file: ${a.name}
19
19
  id: ${a.id}
20
- type: ${a.type}`)}),n.length>0&&H(this,po)[po]()}removeFiles(e){let{files:t,currentUploads:n}=this.getState(),r=v({},t),o=v({},n),s=Object.create(null);e.forEach(d=>{t[d]&&(s[d]=t[d],delete r[d])});function a(d){return s[d]===void 0}Object.keys(o).forEach(d=>{let p=n[d].fileIDs.filter(a);if(p.length===0){delete o[d];return}let{capabilities:g}=this.getState();if(p.length!==n[d].fileIDs.length&&!g.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");o[d]=D(v({},n[d]),{fileIDs:p})});let l={currentUploads:o,files:r};Object.keys(r).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),H(this,Bi)[Bi]();let c=Object.keys(s);c.forEach(d=>{this.emit("file-removed",s[d])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),r=!(t.isPaused||!1);return this.setFileState(e,{isPaused:r}),this.emit("upload-pause",t,r),r}pauseAll(){let e=v({},this.getState().files);Object.keys(e).filter(n=>!e[n].progress.uploadComplete&&e[n].progress.uploadStarted).forEach(n=>{let r=D(v({},e[n]),{isPaused:!0});e[n]=r}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e=v({},this.getState().files);Object.keys(e).filter(n=>!e[n].progress.uploadComplete&&e[n].progress.uploadStarted).forEach(n=>{let r=D(v({},e[n]),{isPaused:!1,error:null});e[n]=r}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e=v({},this.getState().files),t=Object.keys(e).filter(r=>e[r].error);if(t.forEach(r=>{let o=D(v({},e[r]),{isPaused:!1,error:null});e[r]=o}),this.setState({files:e,error:null}),this.emit("retry-all",Object.values(e)),t.length===0)return Promise.resolve({successful:[],failed:[]});let n=H(this,Ri)[Ri](t,{forceAllowNewUpload:!0});return H(this,Mi)[Mi](n)}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(ha)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=H(this,Ri)[Ri]([e],{forceAllowNewUpload:!0});return H(this,Mi)[Mi](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return H(this,fo)[fo]()}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!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(e){if(typeof e!="function"){let l=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let o=new e(this,...n),s=o.id;if(!s)throw new Error("Your plugin must have an id");if(!o.type)throw new Error("Your plugin must have a type");let a=this.getPlugin(s);if(a){let l=`Already found a plugin named '${a.id}'. Tried to use: '${s}'.
21
- Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),o.type in H(this,dt)[dt]?H(this,dt)[dt][o.type].push(o):H(this,dt)[dt][o.type]=[o],o.install(),this.emit("plugin-added",o),this}getPlugin(e){for(let t of Object.values(H(this,dt)[dt])){let n=t.find(r=>r.id===e);if(n!=null)return n}}[Symbol.for("uppy test: getPlugins")](e){return H(this,dt)[dt][e]}iteratePlugins(e){Object.values(H(this,dt)[dt]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=H(this,dt)[dt][e.type],n=t.findIndex(s=>s.id===e.id);n!==-1&&t.splice(n,1);let r=this.getState(),o={plugins:D(v({},r.plugins),{[e.id]:void 0})};this.setState(o)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),H(this,co)[co](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",H(this,di)[di]),window.removeEventListener("offline",H(this,di)[di]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){t===void 0&&(t="info"),n===void 0&&(n=3e3);let r=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(e,t){let{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e);break}}registerRequestClient(e,t){H(this,mo)[mo].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=H(this,mo)[mo].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?H(this,Mi)[Mi](e):(H(this,yn)[yn](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return H(this,Ri)[Ri](...arguments)}addResultData(e,t){if(!H(this,dd)[dd](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:n}=this.getState(),r=D(v({},n[e]),{result:v(v({},n[e].result),t)});this.setState({currentUploads:D(v({},n),{[e]:r})})}upload(){var e;(e=H(this,dt)[dt].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState(),n=this.opts.onBeforeUpload(t);return n===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&typeof n=="object"&&(t=n,this.setState({files:t})),Promise.resolve().then(()=>H(this,ut)[ut].validateMinNumberOfFiles(t)).catch(r=>{throw H(this,Vt)[Vt]([r]),r}).then(()=>{if(!H(this,ld)[ld](t))throw new It(this.i18n("missingRequiredMetaField"))}).catch(r=>{throw r}).then(()=>{let{currentUploads:r}=this.getState(),o=Object.values(r).flatMap(l=>l.fileIDs),s=[];Object.keys(t).forEach(l=>{let c=this.getFile(l);!c.progress.uploadStarted&&o.indexOf(l)===-1&&s.push(c.id)});let a=H(this,Ri)[Ri](s);return H(this,Mi)[Mi](a)}).catch(r=>{throw this.emit("error",r),this.log(r,"error"),r}))}};function rP(i){for(let o of i)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");let e=i.filter(o=>o.isUserFacing),t=4,n=e.slice(0,t),r=e.slice(t);n.forEach(o=>{let{message:s,details:a=""}=o;this.info({message:s,details:a},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}function oP(i){let{missingFields:e,error:t}=H(this,ut)[ut].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}function sP(i){let e=!0;for(let t of Object.values(i))H(this,go)[go](t)||(e=!1);return e}function aP(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new It(this.i18n("noMoreFilesAllowed"),{file:i});throw H(this,Vt)[Vt]([t]),t}}function lP(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=so(e),n=sd(t,e),r=xi(n).extension,o=ua(e,this.getID()),s=e.meta||{};s.name=n,s.type=t;let a=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:o,name:n,extension:r||"",meta:v(v({},this.getState().meta),s),type:t,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function cP(){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 dP(i){let{files:e}=this.getState(),t=v({},e),n=[],r=[];for(let a of i)try{var o;let l=H(this,ud)[ud](a),c=(o=e[l.id])==null?void 0:o.isGhost;if(c){let p=e[l.id];l=D(v({},p),{isGhost:!1,data:a.data}),this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`)}let d=this.opts.onBeforeFileAdded(l,t);if(!d&&this.checkIfFileAlreadyExists(l.id)){var s;throw new It(this.i18n("noDuplicates",{fileName:(s=l.name)!=null?s:this.i18n("unnamed")}),{file:a})}if(d===!1&&!c)throw new It("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof d=="object"&&d!==null&&(l=d),H(this,ut)[ut].validateSingleFile(l),t[l.id]=l,n.push(l)}catch(l){r.push(l)}try{H(this,ut)[ut].validateAggregateRestrictions(Object.values(e),n)}catch(a){return r.push(a),{nextFilesState:e,validFilesToAdd:[],errors:r}}return{nextFilesState:t,validFilesToAdd:n,errors:r}}function uP(){var i,e;let t=H(this,hd)[hd](),n=null;t!=null&&(n=Math.round(t*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",(i=n)!=null?i:0),this.setState({totalProgress:(e=n)!=null?e:0})}function pP(){let e=this.getFiles().filter(a=>a.progress.uploadStarted||a.progress.preprocess||a.progress.postprocess);if(e.length===0)return 0;if(e.every(a=>a.progress.uploadComplete))return 1;let t=a=>a.progress.bytesTotal!=null&&a.progress.bytesTotal!==0,n=e.filter(t),r=e.filter(a=>!t(a));if(n.every(a=>a.progress.uploadComplete)&&r.length>0&&!r.every(a=>a.progress.uploadComplete))return null;let o=n.reduce((a,l)=>{var c;return a+((c=l.progress.bytesTotal)!=null?c:0)},0),s=n.reduce((a,l)=>a+(l.progress.bytesUploaded||0),0);return o===0?0:s/o}function hP(){let i=(n,r,o)=>{let s=n.message||"Unknown error";n.details&&(s+=` ${n.details}`),this.setState({error:s}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:s,response:o})};this.on("error",i),this.on("upload-error",(n,r,o)=>{if(i(r,n,o),typeof r=="object"&&r.message){var s;this.log(r.message,"error");let a=new Error(this.i18n("failedToUpload",{file:(s=n?.name)!=null?s:""}));a.isUserFacing=!0,a.details=r.message,r.details&&(a.details+=` ${r.details}`),H(this,Vt)[Vt]([a])}else H(this,Vt)[Vt]([r])});let e=null;this.on("upload-stalled",(n,r)=>{let{message:o}=n,s=r.map(a=>a.meta.name).join(", ");e||(this.info({message:o,details:s},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${o} ${s}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let t=n=>{let r=n.filter(s=>{let a=s!=null&&this.getFile(s.id);return a||this.log(`Not setting progress for a file that has been removed: ${s?.id}`),a}),o=Object.fromEntries(r.map(s=>[s.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:s.size}}]));this.patchFilesState(o)};this.on("upload-start",t),this.on("upload-progress",H(this,pd)[pd]),this.on("upload-success",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let o=this.getFile(n.id).progress;this.setFileState(n.id,{progress:D(v({},o),{postprocess:H(this,Ai)[Ai].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:o.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),n.size==null&&this.setFileState(n.id,{size:r.bytesUploaded||o.bytesTotal}),H(this,Bi)[Bi]()}),this.on("preprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:D(v({},this.getFile(n.id).progress),{preprocess:r})})}),this.on("preprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let r=v({},this.getState().files);r[n.id]=D(v({},r[n.id]),{progress:v({},r[n.id].progress)}),delete r[n.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:D(v({},this.getState().files[n.id].progress),{postprocess:r})})}),this.on("postprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let r=v({},this.getState().files);r[n.id]=D(v({},r[n.id]),{progress:v({},r[n.id].progress)}),delete r[n.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{H(this,Bi)[Bi]()}),this.on("dashboard:file-edit-complete",n=>{n&&H(this,go)[go](n)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",H(this,di)[di]),window.addEventListener("offline",H(this,di)[di]),setTimeout(H(this,di)[di],3e3))}function fP(i,e){e===void 0&&(e={});let{forceAllowNewUpload:t=!1}=e,{allowNewUpload:n,currentUploads:r}=this.getState();if(!n&&!t)throw new Error("Cannot create a new upload: already uploading.");let o=nn();return this.emit("upload",o,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:D(v({},r),{[o]:{fileIDs:i,step:0,result:{}}})}),o}function mP(i){let{currentUploads:e}=this.getState();return e[i]}function gP(i){let e=v({},this.getState().currentUploads);delete e[i],this.setState({currentUploads:e})}function yP(i){return B(this,null,function*(){let e=()=>{let{currentUploads:o}=this.getState();return o[i]},t=e(),n=[...H(this,mn)[mn],...H(this,gn)[gn],...H(this,Ai)[Ai]];try{for(let o=t.step||0;o<n.length&&t;o++){let s=n[o];this.setState({currentUploads:D(v({},this.getState().currentUploads),{[i]:D(v({},t),{step:o})})});let{fileIDs:a}=t;yield s(a,i),t=e()}}catch(o){throw H(this,yn)[yn](i),o}if(t){t.fileIDs.forEach(l=>{let c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});let o=t.fileIDs.map(l=>this.getFile(l)),s=o.filter(l=>!l.error),a=o.filter(l=>l.error);this.addResultData(i,{successful:s,failed:a,uploadID:i}),t=e()}let r;return t&&(r=t.result,this.emit("complete",r),H(this,yn)[yn](i)),r==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),r})}fa.VERSION=nP.version;var hr=fa;var bo,Fe,pg,vP,vn,lg,hg,fd,fg,yd,md,gd,bP,vo={},mg=[],_P=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ya=Array.isArray;function Ni(i,e){for(var t in e)i[t]=e[t];return i}function vd(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function u(i,e,t){var n,r,o,s={};for(o in e)o=="key"?n=e[o]:o=="ref"?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?bo.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(o in i.defaultProps)s[o]===void 0&&(s[o]=i.defaultProps[o]);return yo(i,s,n,r,null)}function yo(i,e,t,n,r){var o={type:i,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++pg,__i:-1,__u:0};return r==null&&Fe.vnode!=null&&Fe.vnode(o),o}function gg(){return{current:null}}function Ut(i){return i.children}function Ot(i,e){this.props=i,this.context=e}function fr(i,e){if(e==null)return i.__?fr(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?fr(i):null}function yg(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return yg(i)}}function cg(i){(!i.__d&&(i.__d=!0)&&vn.push(i)&&!ga.__r++||lg!==Fe.debounceRendering)&&((lg=Fe.debounceRendering)||hg)(ga)}function ga(){var i,e,t,n,r,o,s,a;for(vn.sort(fd);i=vn.shift();)i.__d&&(e=vn.length,n=void 0,o=(r=(t=i).__v).__e,s=[],a=[],t.__P&&((n=Ni({},r)).__v=r.__v+1,Fe.vnode&&Fe.vnode(n),bd(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,s,o??fr(r),!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,_g(s,n,a),n.__e!=o&&yg(n)),vn.length>e&&vn.sort(fd));ga.__r=0}function vg(i,e,t,n,r,o,s,a,l,c,d){var p,g,h,_,P,z,M=n&&n.__k||mg,W=e.length;for(l=wP(t,e,M,l,W),p=0;p<W;p++)(h=t.__k[p])!=null&&(g=h.__i===-1?vo:M[h.__i]||vo,h.__i=p,z=bd(i,h,g,r,o,s,a,l,c,d),_=h.__e,h.ref&&g.ref!=h.ref&&(g.ref&&_d(g.ref,null,h),d.push(h.ref,h.__c||_,h)),P==null&&_!=null&&(P=_),4&h.__u||g.__k===h.__k?l=bg(h,l,i):typeof h.type=="function"&&z!==void 0?l=z:_&&(l=_.nextSibling),h.__u&=-7);return t.__e=P,l}function wP(i,e,t,n,r){var o,s,a,l,c,d=t.length,p=d,g=0;for(i.__k=new Array(r),o=0;o<r;o++)(s=e[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(l=o+g,(s=i.__k[o]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?yo(null,s,null,null,null):ya(s)?yo(Ut,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?yo(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=i,s.__b=i.__b+1,a=null,(c=s.__i=xP(s,t,l,p))!==-1&&(p--,(a=t[c])&&(a.__u|=2)),a==null||a.__v===null?(c==-1&&g--,typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?g--:c==l+1?g++:(c>l?g--:g++,s.__u|=4))):i.__k[o]=null;if(p)for(o=0;o<d;o++)(a=t[o])!=null&&!(2&a.__u)&&(a.__e==n&&(n=fr(a)),wg(a,a));return n}function bg(i,e,t){var n,r;if(typeof i.type=="function"){for(n=i.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=i,e=bg(n[r],e,t));return e}i.__e!=e&&(e&&i.type&&!t.contains(e)&&(e=fr(i)),t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Ci(i,e){return e=e||[],i==null||typeof i=="boolean"||(ya(i)?i.some(function(t){Ci(t,e)}):e.push(i)),e}function xP(i,e,t,n){var r,o,s=i.key,a=i.type,l=e[t];if(l===null||l&&s==l.key&&a===l.type&&!(2&l.__u))return t;if(n>(l!=null&&!(2&l.__u)?1:0))for(r=t-1,o=t+1;r>=0||o<e.length;){if(r>=0){if((l=e[r])&&!(2&l.__u)&&s==l.key&&a===l.type)return r;r--}if(o<e.length){if((l=e[o])&&!(2&l.__u)&&s==l.key&&a===l.type)return o;o++}}return-1}function dg(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||_P.test(e)?t:t+"px"}function ma(i,e,t,n,r){var o;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof n=="string"&&(i.style.cssText=n=""),n)for(e in n)t&&e in t||dg(i.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||dg(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(fg,"$1")),e=e.toLowerCase()in i||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+o]=t,t?n?t.u=n.u:(t.u=yd,i.addEventListener(e,o?gd:md,o)):i.removeEventListener(e,o?gd:md,o);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function ug(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=yd++;else if(e.t<t.u)return;return t(Fe.event?Fe.event(e):e)}}}function bd(i,e,t,n,r,o,s,a,l,c){var d,p,g,h,_,P,z,M,W,de,oe,ee,b,w,S,A,L,K=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),o=[a=e.__e=t.__e]),(d=Fe.__b)&&d(e);e:if(typeof K=="function")try{if(M=e.props,W="prototype"in K&&K.prototype.render,de=(d=K.contextType)&&n[d.__c],oe=d?de?de.props.value:d.__:n,t.__c?z=(p=e.__c=t.__c).__=p.__E:(W?e.__c=p=new K(M,oe):(e.__c=p=new Ot(M,oe),p.constructor=K,p.render=SP),de&&de.sub(p),p.props=M,p.state||(p.state={}),p.context=oe,p.__n=n,g=p.__d=!0,p.__h=[],p._sb=[]),W&&p.__s==null&&(p.__s=p.state),W&&K.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Ni({},p.__s)),Ni(p.__s,K.getDerivedStateFromProps(M,p.__s))),h=p.props,_=p.state,p.__v=e,g)W&&K.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),W&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(W&&K.getDerivedStateFromProps==null&&M!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(M,oe),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(M,p.__s,oe)===!1||e.__v==t.__v)){for(e.__v!=t.__v&&(p.props=M,p.state=p.__s,p.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(ve){ve&&(ve.__=e)}),ee=0;ee<p._sb.length;ee++)p.__h.push(p._sb[ee]);p._sb=[],p.__h.length&&s.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(M,p.__s,oe),W&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,_,P)})}if(p.context=oe,p.props=M,p.__P=i,p.__e=!1,b=Fe.__r,w=0,W){for(p.state=p.__s,p.__d=!1,b&&b(e),d=p.render(p.props,p.state,p.context),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[]}else do p.__d=!1,b&&b(e),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++w<25);p.state=p.__s,p.getChildContext!=null&&(n=Ni(Ni({},n),p.getChildContext())),W&&!g&&p.getSnapshotBeforeUpdate!=null&&(P=p.getSnapshotBeforeUpdate(h,_)),a=vg(i,ya(A=d!=null&&d.type===Ut&&d.key==null?d.props.children:d)?A:[A],e,t,n,r,o,s,a,l,c),p.base=e.__e,e.__u&=-161,p.__h.length&&s.push(p),z&&(p.__E=p.__=null)}catch(ve){if(e.__v=null,l||o!=null)if(ve.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else for(L=o.length;L--;)vd(o[L]);else e.__e=t.__e,e.__k=t.__k;Fe.__e(ve,e,t)}else o==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):a=e.__e=CP(t.__e,e,t,n,r,o,s,l,c);return(d=Fe.diffed)&&d(e),128&e.__u?void 0:a}function _g(i,e,t){for(var n=0;n<t.length;n++)_d(t[n],t[++n],t[++n]);Fe.__c&&Fe.__c(e,i),i.some(function(r){try{i=r.__h,r.__h=[],i.some(function(o){o.call(r)})}catch(o){Fe.__e(o,r.__v)}})}function CP(i,e,t,n,r,o,s,a,l){var c,d,p,g,h,_,P,z=t.props,M=e.props,W=e.type;if(W=="svg"?r="http://www.w3.org/2000/svg":W=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((h=o[c])&&"setAttribute"in h==!!W&&(W?h.localName==W:h.nodeType==3)){i=h,o[c]=null;break}}if(i==null){if(W==null)return document.createTextNode(M);i=document.createElementNS(r,W,M.is&&M),a&&(Fe.__m&&Fe.__m(e,o),a=!1),o=null}if(W===null)z===M||a&&i.data===M||(i.data=M);else{if(o=o&&bo.call(i.childNodes),z=t.props||vo,!a&&o!=null)for(z={},c=0;c<i.attributes.length;c++)z[(h=i.attributes[c]).name]=h.value;for(c in z)if(h=z[c],c!="children"){if(c=="dangerouslySetInnerHTML")p=h;else if(!(c in M)){if(c=="value"&&"defaultValue"in M||c=="checked"&&"defaultChecked"in M)continue;ma(i,c,null,h,r)}}for(c in M)h=M[c],c=="children"?g=h:c=="dangerouslySetInnerHTML"?d=h:c=="value"?_=h:c=="checked"?P=h:a&&typeof h!="function"||z[c]===h||ma(i,c,h,z[c],r);if(d)a||p&&(d.__html===p.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(p&&(i.innerHTML=""),vg(i,ya(g)?g:[g],e,t,n,W=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:t.__k&&fr(t,0),a,l),o!=null)for(c=o.length;c--;)vd(o[c]);a||(c="value",W=="progress"&&_==null?i.removeAttribute("value"):_!==void 0&&(_!==i[c]||W=="progress"&&!_||W=="option"&&_!==z[c])&&ma(i,c,_,z[c],r),c="checked",P!==void 0&&P!==i[c]&&ma(i,c,P,z[c],r))}return i}function _d(i,e,t){try{if(typeof i=="function"){var n=typeof i.__u=="function";n&&i.__u(),n&&e==null||(i.__u=i(e))}else i.current=e}catch(r){Fe.__e(r,t)}}function wg(i,e,t){var n,r;if(Fe.unmount&&Fe.unmount(i),(n=i.ref)&&(n.current&&n.current!==i.__e||_d(n,null,e)),(n=i.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){Fe.__e(o,e)}n.base=n.__P=null}if(n=i.__k)for(r=0;r<n.length;r++)n[r]&&wg(n[r],e,t||typeof i.type!="function");t||vd(i.__e),i.__c=i.__=i.__e=void 0}function SP(i,e,t){return this.constructor(i,t)}function wd(i,e,t){var n,r,o,s;e==document&&(e=document.documentElement),Fe.__&&Fe.__(i,e),r=(n=typeof t=="function")?null:t&&t.__k||e.__k,o=[],s=[],bd(e,i=(!n&&t||e).__k=u(Ut,null,[i]),r||vo,vo,e.namespaceURI,!n&&t?[t]:r?null:e.firstChild?bo.call(e.childNodes):null,o,!n&&t?t:r?r.__e:e.firstChild,n,s),_g(o,i,s)}function va(i,e,t){var n,r,o,s,a=Ni({},i.props);for(o in i.type&&i.type.defaultProps&&(s=i.type.defaultProps),e)o=="key"?n=e[o]:o=="ref"?r=e[o]:a[o]=e[o]===void 0&&s!==void 0?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?bo.call(arguments,2):t),yo(i.type,a,n||i.key,r||i.ref,null)}bo=mg.slice,Fe={__e:function(i,e,t,n){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(i)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(i,n||{}),s=r.__d),s)return r.__E=r}catch(a){i=a}throw i}},pg=0,vP=function(i){return i!=null&&i.constructor==null},Ot.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ni({},this.state),typeof i=="function"&&(i=i(Ni({},t),this.props)),i&&Ni(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),cg(this))},Ot.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),cg(this))},Ot.prototype.render=Ut,vn=[],hg=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fd=function(i,e){return i.__v.__b-e.__v.__b},ga.__r=0,fg=/(PointerCapture)$|Capture$/i,yd=0,md=ug(!1),gd=ug(!0),bP=0;function _o(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function PP(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):_o(i)?i:null}var xg=PP;function EP(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}var ba=EP;var bn=class{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:D(v({},t),{[this.id]:v(v({},t[this.id]),e)})})}setOptions(e){this.opts=v(v({},this.opts),e),this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new ur([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function Cg(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var DP=0;function kP(i){return"__private_"+DP+++"_"+i}function TP(i){let e=null,t;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=r,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var wo=kP("updateUI"),xd=class i extends bn{constructor(){super(...arguments),Object.defineProperty(this,wo,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t 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:t,UIPlugin:i}}));else if(typeof e=="function"){let n=e;this.uppy.iteratePlugins(r=>{r instanceof n&&(t=r)})}return t}mount(e,t){let n=t.id,r=xg(e);if(r){this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),Cg(this,wo)[wo]=TP(l=>{this.uppy.getPlugin(this.id)&&(wd(this.render(l,a),a),this.afterUpdate())}),this.uppy.log(`Installing ${n} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),wd(this.render(this.uppy.getState(),a),a),this.el=a,r.appendChild(a),a.dir=this.opts.direction||ba(a)||"ltr",this.onMount(),this.el}let o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${n} to ${o.id}`),this.parent=o,this.el=o.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let s=`Invalid target option given to ${n}.`;throw typeof e=="function"?s+=" 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.":s+="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(s)}render(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,n;(t=(n=Cg(this,wo))[wo])==null||t.call(n,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},Wt=xd;function _a(i,e,t,n){return t===0||i===e?i:n===0?e:i+(e-i)*2**(-n/t)}var $t={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var Td=De(vt(),1);function xo(i){let e=[],t="indeterminate",n;for(let{progress:o}of Object.values(i)){let{preprocess:s,postprocess:a}=o;n==null&&(s||a)&&({mode:t,message:n}=s||a),s?.mode==="determinate"&&e.push(s.value),a?.mode==="determinate"&&e.push(a.value)}let r=e.reduce((o,s)=>o+s/e.length,0);return{mode:t,message:n,value:r}}var Ed=De(vt(),1),Pd=De(ao(),1);function Cd(i){let e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,n=Math.floor(i%60);return{hours:e,minutes:t,seconds:n}}function Sd(i){let e=Cd(i),t=e.hours===0?"":`${e.hours}h`,n=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,r=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${n}${r}`}var IP="\xB7",Sg=()=>` ${IP} `;function Pg(i){let{newFiles:e,isUploadStarted:t,recoveredState:n,i18n:r,uploadState:o,isSomeGhost:s,startUpload:a}=i,l=(0,Ed.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===$t.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":s}),c=e&&t&&!n?r("uploadXNewFiles",{smart_count:e}):r("uploadXFiles",{smart_count:e});return u("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:e}),onClick:a,disabled:s,"data-uppy-super-focusable":!0},c)}function Eg(i){let{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},u("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"})),e("retry"))}function Dg(i){let{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("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 kg(i){let{isAllPaused:e,i18n:t,isAllComplete:n,resumableUploads:r,uppy:o}=i,s=t(e?"resume":"pause");function a(){if(!n){if(!r){o.cancelAll();return}if(e){o.resumeAll();return}o.pauseAll()}}return u("button",{title:s,"aria-label":s,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:a,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function Tg(i){let{i18n:e,doneButtonHandler:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function Ig(){return u("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},u("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 Og(i){let{progress:e}=i,{value:t,mode:n,message:r}=e;return u("div",{className:"uppy-StatusBar-content"},u(Ig,null),n==="determinate"?`${Math.round(t*100)}% \xB7 `:"",r)}function OP(i){let{numUploads:e,complete:t,totalUploadedSize:n,totalSize:r,totalETA:o,i18n:s}=i,a=e>1,l=(0,Pd.default)(n);return u("div",{className:"uppy-StatusBar-statusSecondary"},a&&s("filesUploadedOfTotal",{complete:t,smart_count:e}),u("span",{className:"uppy-StatusBar-additionalInfo"},a&&Sg(),r!=null?s("dataUploadedOfTotal",{complete:l,total:(0,Pd.default)(r)}):s("dataUploadedOfUnknown",{complete:l}),Sg(),o!=null&&s("xTimeLeft",{time:Sd(o)})))}function Fg(i){let{i18n:e,complete:t,numUploads:n}=i;return u("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:n}))}function FP(i){let{i18n:e,newFiles:t,startUpload:n}=i,r=(0,Ed.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return u("div",{className:"uppy-StatusBar-statusSecondary"},u("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),u("button",{type:"button",className:r,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:n},e("upload")))}function Rg(i){let{i18n:e,supportsUploadProgress:t,totalProgress:n,showProgressDetails:r,isUploadStarted:o,isAllComplete:s,isAllPaused:a,newFiles:l,numUploads:c,complete:d,totalUploadedSize:p,totalSize:g,totalETA:h,startUpload:_}=i,P=l&&o;if(!o||s)return null;let z=e(a?"paused":"uploading");function M(){return!a&&!P&&r?t?u(OP,{numUploads:c,complete:d,totalUploadedSize:p,totalSize:g,totalETA:h,i18n:e}):u(Fg,{i18n:e,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":z,title:z},a?null:u(Ig,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t&&n!==0?`${z}: ${n}%`:z),M(),P?u(FP,{i18n:e,newFiles:l,startUpload:_}):null))}function Mg(i){let{i18n:e}=i;return u("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},u("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function Ag(i){let{error:e,i18n:t,complete:n,numUploads:r}=i;function o(){let s=`${t("uploadFailed")}
20
+ type: ${a.type}`)}),n.length>0&&H(this,co)[co]()}removeFiles(e){let{files:t,currentUploads:n}=this.getState(),r=v({},t),o=v({},n),s=Object.create(null);e.forEach(d=>{t[d]&&(s[d]=t[d],delete r[d])});function a(d){return s[d]===void 0}Object.keys(o).forEach(d=>{let u=n[d].fileIDs.filter(a);if(u.length===0){delete o[d];return}let{capabilities:g}=this.getState();if(u.length!==n[d].fileIDs.length&&!g.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");o[d]=D(v({},n[d]),{fileIDs:u})});let l={currentUploads:o,files:r};Object.keys(r).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),H(this,Bi)[Bi]();let c=Object.keys(s);c.forEach(d=>{this.emit("file-removed",s[d])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),r=!(t.isPaused||!1);return this.setFileState(e,{isPaused:r}),this.emit("upload-pause",t,r),r}pauseAll(){let e=v({},this.getState().files);Object.keys(e).filter(n=>!e[n].progress.uploadComplete&&e[n].progress.uploadStarted).forEach(n=>{let r=D(v({},e[n]),{isPaused:!0});e[n]=r}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e=v({},this.getState().files);Object.keys(e).filter(n=>!e[n].progress.uploadComplete&&e[n].progress.uploadStarted).forEach(n=>{let r=D(v({},e[n]),{isPaused:!1,error:null});e[n]=r}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e=v({},this.getState().files),t=Object.keys(e).filter(r=>e[r].error);if(t.forEach(r=>{let o=D(v({},e[r]),{isPaused:!1,error:null});e[r]=o}),this.setState({files:e,error:null}),this.emit("retry-all",Object.values(e)),t.length===0)return Promise.resolve({successful:[],failed:[]});let n=H(this,Ri)[Ri](t,{forceAllowNewUpload:!0});return H(this,Mi)[Mi](n)}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(ha)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=H(this,Ri)[Ri]([e],{forceAllowNewUpload:!0});return H(this,Mi)[Mi](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return H(this,po)[po]()}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!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(e){if(typeof e!="function"){let l=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let o=new e(this,...n),s=o.id;if(!s)throw new Error("Your plugin must have an id");if(!o.type)throw new Error("Your plugin must have a type");let a=this.getPlugin(s);if(a){let l=`Already found a plugin named '${a.id}'. Tried to use: '${s}'.
21
+ Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),o.type in H(this,dt)[dt]?H(this,dt)[dt][o.type].push(o):H(this,dt)[dt][o.type]=[o],o.install(),this.emit("plugin-added",o),this}getPlugin(e){for(let t of Object.values(H(this,dt)[dt])){let n=t.find(r=>r.id===e);if(n!=null)return n}}[Symbol.for("uppy test: getPlugins")](e){return H(this,dt)[dt][e]}iteratePlugins(e){Object.values(H(this,dt)[dt]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=H(this,dt)[dt][e.type],n=t.findIndex(s=>s.id===e.id);n!==-1&&t.splice(n,1);let r=this.getState(),o={plugins:D(v({},r.plugins),{[e.id]:void 0})};this.setState(o)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),H(this,ao)[ao](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",H(this,ui)[ui]),window.removeEventListener("offline",H(this,ui)[ui]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){t===void 0&&(t="info"),n===void 0&&(n=3e3);let r=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(e,t){let{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e);break}}registerRequestClient(e,t){H(this,ho)[ho].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=H(this,ho)[ho].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?H(this,Mi)[Mi](e):(H(this,yn)[yn](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return H(this,Ri)[Ri](...arguments)}addResultData(e,t){if(!H(this,dd)[dd](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:n}=this.getState(),r=D(v({},n[e]),{result:v(v({},n[e].result),t)});this.setState({currentUploads:D(v({},n),{[e]:r})})}upload(){var e;(e=H(this,dt)[dt].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState(),n=this.opts.onBeforeUpload(t);return n===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&typeof n=="object"&&(t=n,this.setState({files:t})),Promise.resolve().then(()=>H(this,ut)[ut].validateMinNumberOfFiles(t)).catch(r=>{throw H(this,Ut)[Ut]([r]),r}).then(()=>{if(!H(this,ld)[ld](t))throw new It(this.i18n("missingRequiredMetaField"))}).catch(r=>{throw r}).then(()=>{let{currentUploads:r}=this.getState(),o=Object.values(r).flatMap(l=>l.fileIDs),s=[];Object.keys(t).forEach(l=>{let c=this.getFile(l);!c.progress.uploadStarted&&o.indexOf(l)===-1&&s.push(c.id)});let a=H(this,Ri)[Ri](s);return H(this,Mi)[Mi](a)}).catch(r=>{throw this.emit("error",r),this.log(r,"error"),r}))}};function rP(i){for(let o of i)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");let e=i.filter(o=>o.isUserFacing),t=4,n=e.slice(0,t),r=e.slice(t);n.forEach(o=>{let{message:s,details:a=""}=o;this.info({message:s,details:a},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}function oP(i){let{missingFields:e,error:t}=H(this,ut)[ut].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}function sP(i){let e=!0;for(let t of Object.values(i))H(this,fo)[fo](t)||(e=!1);return e}function aP(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new It(this.i18n("noMoreFilesAllowed"),{file:i});throw H(this,Ut)[Ut]([t]),t}}function lP(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=ro(e),n=sd(t,e),r=xi(n).extension,o=ua(e,this.getID()),s=e.meta||{};s.name=n,s.type=t;let a=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:o,name:n,extension:r||"",meta:v(v({},this.getState().meta),s),type:t,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function cP(){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 dP(i){let{files:e}=this.getState(),t=v({},e),n=[],r=[];for(let a of i)try{var o;let l=H(this,ud)[ud](a),c=(o=e[l.id])==null?void 0:o.isGhost;if(c){let u=e[l.id];l=D(v({},u),{isGhost:!1,data:a.data}),this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`)}let d=this.opts.onBeforeFileAdded(l,t);if(!d&&this.checkIfFileAlreadyExists(l.id)){var s;throw new It(this.i18n("noDuplicates",{fileName:(s=l.name)!=null?s:this.i18n("unnamed")}),{file:a})}if(d===!1&&!c)throw new It("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof d=="object"&&d!==null&&(l=d),H(this,ut)[ut].validateSingleFile(l),t[l.id]=l,n.push(l)}catch(l){r.push(l)}try{H(this,ut)[ut].validateAggregateRestrictions(Object.values(e),n)}catch(a){return r.push(a),{nextFilesState:e,validFilesToAdd:[],errors:r}}return{nextFilesState:t,validFilesToAdd:n,errors:r}}function uP(){var i,e;let t=H(this,hd)[hd](),n=null;t!=null&&(n=Math.round(t*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",(i=n)!=null?i:0),this.setState({totalProgress:(e=n)!=null?e:0})}function pP(){let e=this.getFiles().filter(a=>a.progress.uploadStarted||a.progress.preprocess||a.progress.postprocess);if(e.length===0)return 0;if(e.every(a=>a.progress.uploadComplete))return 1;let t=a=>a.progress.bytesTotal!=null&&a.progress.bytesTotal!==0,n=e.filter(t),r=e.filter(a=>!t(a));if(n.every(a=>a.progress.uploadComplete)&&r.length>0&&!r.every(a=>a.progress.uploadComplete))return null;let o=n.reduce((a,l)=>{var c;return a+((c=l.progress.bytesTotal)!=null?c:0)},0),s=n.reduce((a,l)=>a+(l.progress.bytesUploaded||0),0);return o===0?0:s/o}function hP(){let i=(n,r,o)=>{let s=n.message||"Unknown error";n.details&&(s+=` ${n.details}`),this.setState({error:s}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:s,response:o})};this.on("error",i),this.on("upload-error",(n,r,o)=>{if(i(r,n,o),typeof r=="object"&&r.message){var s;this.log(r.message,"error");let a=new Error(this.i18n("failedToUpload",{file:(s=n?.name)!=null?s:""}));a.isUserFacing=!0,a.details=r.message,r.details&&(a.details+=` ${r.details}`),H(this,Ut)[Ut]([a])}else H(this,Ut)[Ut]([r])});let e=null;this.on("upload-stalled",(n,r)=>{let{message:o}=n,s=r.map(a=>a.meta.name).join(", ");e||(this.info({message:o,details:s},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${o} ${s}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let t=n=>{let r=n.filter(s=>{let a=s!=null&&this.getFile(s.id);return a||this.log(`Not setting progress for a file that has been removed: ${s?.id}`),a}),o=Object.fromEntries(r.map(s=>[s.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:s.size}}]));this.patchFilesState(o)};this.on("upload-start",t),this.on("upload-progress",H(this,pd)[pd]),this.on("upload-success",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let o=this.getFile(n.id).progress;this.setFileState(n.id,{progress:D(v({},o),{postprocess:H(this,Ai)[Ai].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:o.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),n.size==null&&this.setFileState(n.id,{size:r.bytesUploaded||o.bytesTotal}),H(this,Bi)[Bi]()}),this.on("preprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:D(v({},this.getFile(n.id).progress),{preprocess:r})})}),this.on("preprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let r=v({},this.getState().files);r[n.id]=D(v({},r[n.id]),{progress:v({},r[n.id].progress)}),delete r[n.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:D(v({},this.getState().files[n.id].progress),{postprocess:r})})}),this.on("postprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let r=v({},this.getState().files);r[n.id]=D(v({},r[n.id]),{progress:v({},r[n.id].progress)}),delete r[n.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{H(this,Bi)[Bi]()}),this.on("dashboard:file-edit-complete",n=>{n&&H(this,fo)[fo](n)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",H(this,ui)[ui]),window.addEventListener("offline",H(this,ui)[ui]),setTimeout(H(this,ui)[ui],3e3))}function fP(i,e){e===void 0&&(e={});let{forceAllowNewUpload:t=!1}=e,{allowNewUpload:n,currentUploads:r}=this.getState();if(!n&&!t)throw new Error("Cannot create a new upload: already uploading.");let o=nn();return this.emit("upload",o,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:D(v({},r),{[o]:{fileIDs:i,step:0,result:{}}})}),o}function mP(i){let{currentUploads:e}=this.getState();return e[i]}function gP(i){let e=v({},this.getState().currentUploads);delete e[i],this.setState({currentUploads:e})}function yP(i){return B(this,null,function*(){let e=()=>{let{currentUploads:o}=this.getState();return o[i]},t=e(),n=[...H(this,mn)[mn],...H(this,gn)[gn],...H(this,Ai)[Ai]];try{for(let o=t.step||0;o<n.length&&t;o++){let s=n[o];this.setState({currentUploads:D(v({},this.getState().currentUploads),{[i]:D(v({},t),{step:o})})});let{fileIDs:a}=t;yield s(a,i),t=e()}}catch(o){throw H(this,yn)[yn](i),o}if(t){t.fileIDs.forEach(l=>{let c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});let o=t.fileIDs.map(l=>this.getFile(l)),s=o.filter(l=>!l.error),a=o.filter(l=>l.error);this.addResultData(i,{successful:s,failed:a,uploadID:i}),t=e()}let r;return t&&(r=t.result,this.emit("complete",r),H(this,yn)[yn](i)),r==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),r})}fa.VERSION=nP.version;var hr=fa;var yo,Fe,pg,vP,vn,lg,hg,fd,fg,yd,md,gd,bP,go={},mg=[],_P=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ya=Array.isArray;function Ni(i,e){for(var t in e)i[t]=e[t];return i}function vd(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function p(i,e,t){var n,r,o,s={};for(o in e)o=="key"?n=e[o]:o=="ref"?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?yo.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(o in i.defaultProps)s[o]===void 0&&(s[o]=i.defaultProps[o]);return mo(i,s,n,r,null)}function mo(i,e,t,n,r){var o={type:i,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++pg,__i:-1,__u:0};return r==null&&Fe.vnode!=null&&Fe.vnode(o),o}function gg(){return{current:null}}function Wt(i){return i.children}function Ot(i,e){this.props=i,this.context=e}function fr(i,e){if(e==null)return i.__?fr(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?fr(i):null}function yg(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return yg(i)}}function cg(i){(!i.__d&&(i.__d=!0)&&vn.push(i)&&!ga.__r++||lg!==Fe.debounceRendering)&&((lg=Fe.debounceRendering)||hg)(ga)}function ga(){var i,e,t,n,r,o,s,a;for(vn.sort(fd);i=vn.shift();)i.__d&&(e=vn.length,n=void 0,o=(r=(t=i).__v).__e,s=[],a=[],t.__P&&((n=Ni({},r)).__v=r.__v+1,Fe.vnode&&Fe.vnode(n),bd(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,s,o??fr(r),!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,_g(s,n,a),n.__e!=o&&yg(n)),vn.length>e&&vn.sort(fd));ga.__r=0}function vg(i,e,t,n,r,o,s,a,l,c,d){var u,g,h,_,P,L,M=n&&n.__k||mg,W=e.length;for(l=wP(t,e,M,l,W),u=0;u<W;u++)(h=t.__k[u])!=null&&(g=h.__i===-1?go:M[h.__i]||go,h.__i=u,L=bd(i,h,g,r,o,s,a,l,c,d),_=h.__e,h.ref&&g.ref!=h.ref&&(g.ref&&_d(g.ref,null,h),d.push(h.ref,h.__c||_,h)),P==null&&_!=null&&(P=_),4&h.__u||g.__k===h.__k?l=bg(h,l,i):typeof h.type=="function"&&L!==void 0?l=L:_&&(l=_.nextSibling),h.__u&=-7);return t.__e=P,l}function wP(i,e,t,n,r){var o,s,a,l,c,d=t.length,u=d,g=0;for(i.__k=new Array(r),o=0;o<r;o++)(s=e[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(l=o+g,(s=i.__k[o]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?mo(null,s,null,null,null):ya(s)?mo(Wt,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?mo(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=i,s.__b=i.__b+1,a=null,(c=s.__i=xP(s,t,l,u))!==-1&&(u--,(a=t[c])&&(a.__u|=2)),a==null||a.__v===null?(c==-1&&g--,typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?g--:c==l+1?g++:(c>l?g--:g++,s.__u|=4))):i.__k[o]=null;if(u)for(o=0;o<d;o++)(a=t[o])!=null&&!(2&a.__u)&&(a.__e==n&&(n=fr(a)),wg(a,a));return n}function bg(i,e,t){var n,r;if(typeof i.type=="function"){for(n=i.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=i,e=bg(n[r],e,t));return e}i.__e!=e&&(e&&i.type&&!t.contains(e)&&(e=fr(i)),t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Ci(i,e){return e=e||[],i==null||typeof i=="boolean"||(ya(i)?i.some(function(t){Ci(t,e)}):e.push(i)),e}function xP(i,e,t,n){var r,o,s=i.key,a=i.type,l=e[t];if(l===null||l&&s==l.key&&a===l.type&&!(2&l.__u))return t;if(n>(l!=null&&!(2&l.__u)?1:0))for(r=t-1,o=t+1;r>=0||o<e.length;){if(r>=0){if((l=e[r])&&!(2&l.__u)&&s==l.key&&a===l.type)return r;r--}if(o<e.length){if((l=e[o])&&!(2&l.__u)&&s==l.key&&a===l.type)return o;o++}}return-1}function dg(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||_P.test(e)?t:t+"px"}function ma(i,e,t,n,r){var o;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof n=="string"&&(i.style.cssText=n=""),n)for(e in n)t&&e in t||dg(i.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||dg(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(fg,"$1")),e=e.toLowerCase()in i||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+o]=t,t?n?t.u=n.u:(t.u=yd,i.addEventListener(e,o?gd:md,o)):i.removeEventListener(e,o?gd:md,o);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function ug(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=yd++;else if(e.t<t.u)return;return t(Fe.event?Fe.event(e):e)}}}function bd(i,e,t,n,r,o,s,a,l,c){var d,u,g,h,_,P,L,M,W,de,oe,ee,b,w,S,A,z,K=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),o=[a=e.__e=t.__e]),(d=Fe.__b)&&d(e);e:if(typeof K=="function")try{if(M=e.props,W="prototype"in K&&K.prototype.render,de=(d=K.contextType)&&n[d.__c],oe=d?de?de.props.value:d.__:n,t.__c?L=(u=e.__c=t.__c).__=u.__E:(W?e.__c=u=new K(M,oe):(e.__c=u=new Ot(M,oe),u.constructor=K,u.render=SP),de&&de.sub(u),u.props=M,u.state||(u.state={}),u.context=oe,u.__n=n,g=u.__d=!0,u.__h=[],u._sb=[]),W&&u.__s==null&&(u.__s=u.state),W&&K.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Ni({},u.__s)),Ni(u.__s,K.getDerivedStateFromProps(M,u.__s))),h=u.props,_=u.state,u.__v=e,g)W&&K.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),W&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(W&&K.getDerivedStateFromProps==null&&M!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(M,oe),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(M,u.__s,oe)===!1||e.__v==t.__v)){for(e.__v!=t.__v&&(u.props=M,u.state=u.__s,u.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(ve){ve&&(ve.__=e)}),ee=0;ee<u._sb.length;ee++)u.__h.push(u._sb[ee]);u._sb=[],u.__h.length&&s.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(M,u.__s,oe),W&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,_,P)})}if(u.context=oe,u.props=M,u.__P=i,u.__e=!1,b=Fe.__r,w=0,W){for(u.state=u.__s,u.__d=!1,b&&b(e),d=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do u.__d=!1,b&&b(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++w<25);u.state=u.__s,u.getChildContext!=null&&(n=Ni(Ni({},n),u.getChildContext())),W&&!g&&u.getSnapshotBeforeUpdate!=null&&(P=u.getSnapshotBeforeUpdate(h,_)),a=vg(i,ya(A=d!=null&&d.type===Wt&&d.key==null?d.props.children:d)?A:[A],e,t,n,r,o,s,a,l,c),u.base=e.__e,e.__u&=-161,u.__h.length&&s.push(u),L&&(u.__E=u.__=null)}catch(ve){if(e.__v=null,l||o!=null)if(ve.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else for(z=o.length;z--;)vd(o[z]);else e.__e=t.__e,e.__k=t.__k;Fe.__e(ve,e,t)}else o==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):a=e.__e=CP(t.__e,e,t,n,r,o,s,l,c);return(d=Fe.diffed)&&d(e),128&e.__u?void 0:a}function _g(i,e,t){for(var n=0;n<t.length;n++)_d(t[n],t[++n],t[++n]);Fe.__c&&Fe.__c(e,i),i.some(function(r){try{i=r.__h,r.__h=[],i.some(function(o){o.call(r)})}catch(o){Fe.__e(o,r.__v)}})}function CP(i,e,t,n,r,o,s,a,l){var c,d,u,g,h,_,P,L=t.props,M=e.props,W=e.type;if(W=="svg"?r="http://www.w3.org/2000/svg":W=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((h=o[c])&&"setAttribute"in h==!!W&&(W?h.localName==W:h.nodeType==3)){i=h,o[c]=null;break}}if(i==null){if(W==null)return document.createTextNode(M);i=document.createElementNS(r,W,M.is&&M),a&&(Fe.__m&&Fe.__m(e,o),a=!1),o=null}if(W===null)L===M||a&&i.data===M||(i.data=M);else{if(o=o&&yo.call(i.childNodes),L=t.props||go,!a&&o!=null)for(L={},c=0;c<i.attributes.length;c++)L[(h=i.attributes[c]).name]=h.value;for(c in L)if(h=L[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=h;else if(!(c in M)){if(c=="value"&&"defaultValue"in M||c=="checked"&&"defaultChecked"in M)continue;ma(i,c,null,h,r)}}for(c in M)h=M[c],c=="children"?g=h:c=="dangerouslySetInnerHTML"?d=h:c=="value"?_=h:c=="checked"?P=h:a&&typeof h!="function"||L[c]===h||ma(i,c,h,L[c],r);if(d)a||u&&(d.__html===u.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(u&&(i.innerHTML=""),vg(i,ya(g)?g:[g],e,t,n,W=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:t.__k&&fr(t,0),a,l),o!=null)for(c=o.length;c--;)vd(o[c]);a||(c="value",W=="progress"&&_==null?i.removeAttribute("value"):_!==void 0&&(_!==i[c]||W=="progress"&&!_||W=="option"&&_!==L[c])&&ma(i,c,_,L[c],r),c="checked",P!==void 0&&P!==i[c]&&ma(i,c,P,L[c],r))}return i}function _d(i,e,t){try{if(typeof i=="function"){var n=typeof i.__u=="function";n&&i.__u(),n&&e==null||(i.__u=i(e))}else i.current=e}catch(r){Fe.__e(r,t)}}function wg(i,e,t){var n,r;if(Fe.unmount&&Fe.unmount(i),(n=i.ref)&&(n.current&&n.current!==i.__e||_d(n,null,e)),(n=i.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){Fe.__e(o,e)}n.base=n.__P=null}if(n=i.__k)for(r=0;r<n.length;r++)n[r]&&wg(n[r],e,t||typeof i.type!="function");t||vd(i.__e),i.__c=i.__=i.__e=void 0}function SP(i,e,t){return this.constructor(i,t)}function wd(i,e,t){var n,r,o,s;e==document&&(e=document.documentElement),Fe.__&&Fe.__(i,e),r=(n=typeof t=="function")?null:t&&t.__k||e.__k,o=[],s=[],bd(e,i=(!n&&t||e).__k=p(Wt,null,[i]),r||go,go,e.namespaceURI,!n&&t?[t]:r?null:e.firstChild?yo.call(e.childNodes):null,o,!n&&t?t:r?r.__e:e.firstChild,n,s),_g(o,i,s)}function va(i,e,t){var n,r,o,s,a=Ni({},i.props);for(o in i.type&&i.type.defaultProps&&(s=i.type.defaultProps),e)o=="key"?n=e[o]:o=="ref"?r=e[o]:a[o]=e[o]===void 0&&s!==void 0?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?yo.call(arguments,2):t),mo(i.type,a,n||i.key,r||i.ref,null)}yo=mg.slice,Fe={__e:function(i,e,t,n){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(i)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(i,n||{}),s=r.__d),s)return r.__E=r}catch(a){i=a}throw i}},pg=0,vP=function(i){return i!=null&&i.constructor==null},Ot.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ni({},this.state),typeof i=="function"&&(i=i(Ni({},t),this.props)),i&&Ni(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),cg(this))},Ot.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),cg(this))},Ot.prototype.render=Wt,vn=[],hg=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fd=function(i,e){return i.__v.__b-e.__v.__b},ga.__r=0,fg=/(PointerCapture)$|Capture$/i,yd=0,md=ug(!1),gd=ug(!0),bP=0;function vo(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function PP(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):vo(i)?i:null}var xg=PP;function EP(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}var ba=EP;var bn=class{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:D(v({},t),{[this.id]:v(v({},t[this.id]),e)})})}setOptions(e){this.opts=v(v({},this.opts),e),this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new ur([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function Cg(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var DP=0;function kP(i){return"__private_"+DP+++"_"+i}function TP(i){let e=null,t;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=r,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var bo=kP("updateUI"),xd=class i extends bn{constructor(){super(...arguments),Object.defineProperty(this,bo,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t 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:t,UIPlugin:i}}));else if(typeof e=="function"){let n=e;this.uppy.iteratePlugins(r=>{r instanceof n&&(t=r)})}return t}mount(e,t){let n=t.id,r=xg(e);if(r){this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),Cg(this,bo)[bo]=TP(l=>{this.uppy.getPlugin(this.id)&&(wd(this.render(l,a),a),this.afterUpdate())}),this.uppy.log(`Installing ${n} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),wd(this.render(this.uppy.getState(),a),a),this.el=a,r.appendChild(a),a.dir=this.opts.direction||ba(a)||"ltr",this.onMount(),this.el}let o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${n} to ${o.id}`),this.parent=o,this.el=o.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let s=`Invalid target option given to ${n}.`;throw typeof e=="function"?s+=" 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.":s+="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(s)}render(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,n;(t=(n=Cg(this,bo))[bo])==null||t.call(n,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},$t=xd;function _a(i,e,t,n){return t===0||i===e?i:n===0?e:i+(e-i)*2**(-n/t)}var qt={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var Td=De(vt(),1);function _o(i){let e=[],t="indeterminate",n;for(let{progress:o}of Object.values(i)){let{preprocess:s,postprocess:a}=o;n==null&&(s||a)&&({mode:t,message:n}=s||a),s?.mode==="determinate"&&e.push(s.value),a?.mode==="determinate"&&e.push(a.value)}let r=e.reduce((o,s)=>o+s/e.length,0);return{mode:t,message:n,value:r}}var Ed=De(vt(),1),Pd=De(oo(),1);function Cd(i){let e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,n=Math.floor(i%60);return{hours:e,minutes:t,seconds:n}}function Sd(i){let e=Cd(i),t=e.hours===0?"":`${e.hours}h`,n=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,r=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${n}${r}`}var IP="\xB7",Sg=()=>` ${IP} `;function Pg(i){let{newFiles:e,isUploadStarted:t,recoveredState:n,i18n:r,uploadState:o,isSomeGhost:s,startUpload:a}=i,l=(0,Ed.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===qt.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":s}),c=e&&t&&!n?r("uploadXNewFiles",{smart_count:e}):r("uploadXFiles",{smart_count:e});return p("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:e}),onClick:a,disabled:s,"data-uppy-super-focusable":!0},c)}function Eg(i){let{i18n:e,uppy:t}=i;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.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"})),e("retry"))}function Dg(i){let{i18n:e,uppy:t}=i;return p("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.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 kg(i){let{isAllPaused:e,i18n:t,isAllComplete:n,resumableUploads:r,uppy:o}=i,s=t(e?"resume":"pause");function a(){if(!n){if(!r){o.cancelAll();return}if(e){o.resumeAll();return}o.pauseAll()}}return p("button",{title:s,"aria-label":s,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:a,"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:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function Tg(i){let{i18n:e,doneButtonHandler:t}=i;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function Ig(){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 Og(i){let{progress:e}=i,{value:t,mode:n,message:r}=e;return p("div",{className:"uppy-StatusBar-content"},p(Ig,null),n==="determinate"?`${Math.round(t*100)}% \xB7 `:"",r)}function OP(i){let{numUploads:e,complete:t,totalUploadedSize:n,totalSize:r,totalETA:o,i18n:s}=i,a=e>1,l=(0,Pd.default)(n);return p("div",{className:"uppy-StatusBar-statusSecondary"},a&&s("filesUploadedOfTotal",{complete:t,smart_count:e}),p("span",{className:"uppy-StatusBar-additionalInfo"},a&&Sg(),r!=null?s("dataUploadedOfTotal",{complete:l,total:(0,Pd.default)(r)}):s("dataUploadedOfUnknown",{complete:l}),Sg(),o!=null&&s("xTimeLeft",{time:Sd(o)})))}function Fg(i){let{i18n:e,complete:t,numUploads:n}=i;return p("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:n}))}function FP(i){let{i18n:e,newFiles:t,startUpload:n}=i,r=(0,Ed.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"},e("xMoreFilesAdded",{smart_count:t})),p("button",{type:"button",className:r,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:n},e("upload")))}function Rg(i){let{i18n:e,supportsUploadProgress:t,totalProgress:n,showProgressDetails:r,isUploadStarted:o,isAllComplete:s,isAllPaused:a,newFiles:l,numUploads:c,complete:d,totalUploadedSize:u,totalSize:g,totalETA:h,startUpload:_}=i,P=l&&o;if(!o||s)return null;let L=e(a?"paused":"uploading");function M(){return!a&&!P&&r?t?p(OP,{numUploads:c,complete:d,totalUploadedSize:u,totalSize:g,totalETA:h,i18n:e}):p(Fg,{i18n:e,complete:d,numUploads:c}):null}return p("div",{className:"uppy-StatusBar-content","aria-label":L,title:L},a?null:p(Ig,null),p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},t&&n!==0?`${L}: ${n}%`:L),M(),P?p(FP,{i18n:e,newFiles:l,startUpload:_}):null))}function Mg(i){let{i18n:e}=i;return p("div",{className:"uppy-StatusBar-content",role:"status",title:e("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"})),e("complete"))))}function Ag(i){let{error:e,i18n:t,complete:n,numUploads:r}=i;function o(){let s=`${t("uploadFailed")}
22
22
 
23
- ${e}`;alert(s)}return u("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},u("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"})),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:o,type:"button"},"?")),u(Fg,{i18n:t,complete:n,numUploads:r})))}var{STATE_ERROR:Bg,STATE_WAITING:RP,STATE_PREPROCESSING:Dd,STATE_UPLOADING:xa,STATE_POSTPROCESSING:kd,STATE_COMPLETE:Ca}=$t;function Id(i){let{newFiles:e,allowNewUpload:t,isUploadInProgress:n,isAllPaused:r,resumableUploads:o,error:s,hideUploadButton:a=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:p,uploadState:g,totalProgress:h,files:_,supportsUploadProgress:P,hideAfterFinish:z=!1,isSomeGhost:M,doneButtonHandler:W=void 0,isUploadStarted:de,i18n:oe,startUpload:ee,uppy:b,isAllComplete:w,showProgressDetails:S=void 0,numUploads:A,complete:L,totalSize:K,totalETA:ve,totalUploadedSize:Ne}=i;function Pe(){switch(g){case kd:case Dd:{let G=xo(_);return G.mode==="determinate"?G.value*100:h}case Bg:return null;case xa:return P?h:null;default:return h}}function Se(){switch(g){case kd:case Dd:{let{mode:G}=xo(_);return G==="indeterminate"}case xa:return!P;default:return!1}}let Q=Pe(),ze=Q??100,te=!s&&e&&(!n&&!r||p)&&t&&!a,Mt=!c&&g!==RP&&g!==Ca,he=o&&!l&&g===xa,X=s&&!w&&!d,F=W&&g===Ca,C=(0,Td.default)("uppy-StatusBar-progress",{"is-indeterminate":Se()}),k=(0,Td.default)("uppy-StatusBar",`is-${g}`,{"has-ghosts":M}),T=(()=>{switch(g){case Dd:case kd:return u(Og,{progress:xo(_)});case Ca:return u(Mg,{i18n:oe});case Bg:return u(Ag,{error:s,i18n:oe,numUploads:A,complete:L});case xa:return u(Rg,{i18n:oe,supportsUploadProgress:P,totalProgress:h,showProgressDetails:S,isUploadStarted:de,isAllComplete:w,isAllPaused:r,newFiles:e,numUploads:A,complete:L,totalUploadedSize:Ne,totalSize:K,totalETA:ve,startUpload:ee});default:return null}})();return u("div",{className:k,"aria-hidden":!(te||X||he||Mt||F)&&!T||g===Ca&&z},u("div",{className:C,style:{width:`${ze}%`},role:"progressbar","aria-label":`${ze}%`,"aria-valuetext":`${ze}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Q}),T,u("div",{className:"uppy-StatusBar-actions"},te?u(Pg,{newFiles:e,isUploadStarted:de,recoveredState:p,i18n:oe,isSomeGhost:M,startUpload:ee,uploadState:g}):null,X?u(Eg,{i18n:oe,uppy:b}):null,he?u(kg,{isAllPaused:r,i18n:oe,isAllComplete:w,resumableUploads:o,uppy:b}):null,Mt?u(Dg,{i18n:oe,uppy:b}):null,F?u(Tg,{i18n:oe,doneButtonHandler:W}):null))}var Ng={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 Be(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var MP=0;function mr(i){return"__private_"+MP+++"_"+i}var AP={version:"4.1.1"},BP=2e3,NP=2e3;function zP(i,e,t,n){if(i)return $t.STATE_ERROR;if(e)return $t.STATE_COMPLETE;if(t)return $t.STATE_WAITING;let r=$t.STATE_WAITING,o=Object.keys(n);for(let s=0;s<o.length;s++){let{progress:a}=n[o[s]];if(a.uploadStarted&&!a.uploadComplete)return $t.STATE_UPLOADING;a.preprocess&&(r=$t.STATE_PREPROCESSING),a.postprocess&&r!==$t.STATE_PREPROCESSING&&(r=$t.STATE_POSTPROCESSING)}return r}var LP={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},ai=mr("lastUpdateTime"),ui=mr("previousUploadedBytes"),zi=mr("previousSpeed"),qt=mr("previousETA"),Od=mr("computeSmoothETA"),Co=mr("onUploadStart"),_n=class extends Wt{constructor(e,t){super(e,v(v({},LP),t)),Object.defineProperty(this,Od,{value:HP}),Object.defineProperty(this,ai,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),Object.defineProperty(this,qt,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,Co,{writable:!0,value:()=>{let{recoveredState:n}=this.uppy.getState();if(Be(this,zi)[zi]=null,Be(this,qt)[qt]=null,n){Be(this,ui)[ui]=Object.values(n.files).reduce((r,o)=>{let{progress:s}=o;return r+s.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Be(this,ai)[ai]=performance.now(),Be(this,ui)[ui]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Ng,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:t,files:n,allowNewUpload:r,totalProgress:o,error:s,recoveredState:a}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:p,isAllComplete:g,isAllPaused:h,isUploadInProgress:_,isSomeGhost:P}=this.uppy.getObjectOfFilesPerState(),z=a?Object.values(n):l,M=!!t.resumableUploads,W=t.uploadProgress!==!1,de=null,oe=0;c.every(b=>b.progress.bytesTotal!=null&&b.progress.bytesTotal!==0)?(de=0,c.forEach(b=>{de+=b.progress.bytesTotal||0,oe+=b.progress.bytesUploaded||0})):c.forEach(b=>{oe+=b.progress.bytesUploaded||0});let ee=Be(this,Od)[Od]({uploaded:oe,total:de});return Id({error:s,uploadState:zP(s,g,a,e.files||{}),allowNewUpload:r,totalProgress:o,totalSize:de,totalUploadedSize:oe,isAllComplete:!1,isAllPaused:h,isUploadStarted:p,isUploadInProgress:_,isSomeGhost:P,recoveredState:a,complete:d.length,newFiles:z.length,numUploads:c.length,totalETA:ee,files:n,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:M,supportsUploadProgress:W,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 e=this.el;ba(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Be(this,Co)[Co]),Be(this,ai)[ai]=performance.now(),Be(this,ui)[ui]=this.uppy.getFiles().reduce((t,n)=>t+n.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Be(this,Co)[Co])}};function HP(i){var e,t;if(i.total==null||i.total===0)return null;let n=i.total-i.uploaded;if(n<=0)return null;(t=(e=Be(this,ai))[ai])!=null||(e[ai]=performance.now());let r=performance.now()-Be(this,ai)[ai];if(r===0){var o;return Math.round(((o=Be(this,qt)[qt])!=null?o:0)/100)/10}let s=i.uploaded-Be(this,ui)[ui];if(Be(this,ui)[ui]=i.uploaded,s<=0){var a;return Math.round(((a=Be(this,qt)[qt])!=null?a:0)/100)/10}let l=s/r,c=Be(this,zi)[zi]==null?l:_a(l,Be(this,zi)[zi],BP,r);Be(this,zi)[zi]=c;let d=n/c,p=Math.max(Be(this,qt)[qt]-r,0),g=Be(this,qt)[qt]==null?d:_a(d,p,NP,r);return Be(this,qt)[qt]=g,Be(this,ai)[ai]=performance.now(),Math.round(g/100)/10}_n.VERSION=AP.version;var zg=300,Sa=class extends Ot{constructor(){super(...arguments),this.ref=gg()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,zg)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,zg)}render(){let{children:e}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function jP(i,e){return Object.assign(i,e)}function VP(i,e){var t;return(t=i?.key)!=null?t:e}function UP(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=n=>{i.refs[e]=n})}function So(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let n=VP(i[t],t.toString(36));e[n]=i[t]}return e}function WP(i,e){i=i||{},e=e||{};let t=s=>e.hasOwnProperty(s)?e[s]:i[s],n={},r=[];for(let s in i)e.hasOwnProperty(s)?r.length&&(n[s]=r,r=[]):r.push(s);let o={};for(let s in e){if(n.hasOwnProperty(s))for(let a=0;a<n[s].length;a++){let l=n[s][a];o[n[s][a]]=t(l)}o[s]=t(s)}for(let s=0;s<r.length;s++)o[r[s]]=t(r[s]);return o}var $P=i=>i,qP=(()=>{class i extends Ot{constructor(t,n){super(t,n),this.refs={},this.state={children:So(Ci(Ci(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let t=this.state.children;for(let n in t)t[n]&&this.performAppear(n)}componentWillReceiveProps(t){let n=So(Ci(t.children)||[]),r=this.state.children;this.setState(s=>({children:WP(s.children,n)}));let o;for(o in n)if(n.hasOwnProperty(o)){let s=r&&r.hasOwnProperty(o);n[o]&&s&&this.currentlyTransitioningKeys[o]?(this.keysToEnter.push(o),this.keysToAbortLeave.push(o)):n[o]&&!s&&!this.currentlyTransitioningKeys[o]&&this.keysToEnter.push(o)}for(o in r)if(r.hasOwnProperty(o)){let s=n&&n.hasOwnProperty(o);r[o]&&!s&&!this.currentlyTransitioningKeys[o]&&this.keysToLeave.push(o)}}componentDidUpdate(){let{keysToEnter:t}=this;this.keysToEnter=[],t.forEach(this.performEnter);let{keysToLeave:n}=this;this.keysToLeave=[],n.forEach(this.performLeave)}_finishAbort(t){let n=this.keysToAbortLeave.indexOf(t);n!==-1&&this.keysToAbortLeave.splice(n,1)}performAppear(t){this.currentlyTransitioningKeys[t]=!0;let n=this.refs[t];n!=null&&n.componentWillAppear?n.componentWillAppear(this._handleDoneAppearing.bind(this,t)):this._handleDoneAppearing(t)}_handleDoneAppearing(t){let n=this.refs[t];n!=null&&n.componentDidAppear&&n.componentDidAppear(),delete this.currentlyTransitioningKeys[t],this._finishAbort(t);let r=So(Ci(this.props.children)||[]);(!r||!r.hasOwnProperty(t))&&this.performLeave(t)}performEnter(t){this.currentlyTransitioningKeys[t]=!0;let n=this.refs[t];n!=null&&n.componentWillEnter?n.componentWillEnter(this._handleDoneEntering.bind(this,t)):this._handleDoneEntering(t)}_handleDoneEntering(t){let n=this.refs[t];n!=null&&n.componentDidEnter&&n.componentDidEnter(),delete this.currentlyTransitioningKeys[t],this._finishAbort(t);let r=So(Ci(this.props.children)||[]);(!r||!r.hasOwnProperty(t))&&this.performLeave(t)}performLeave(t){if(this.keysToAbortLeave.indexOf(t)!==-1)return;this.currentlyTransitioningKeys[t]=!0;let r=this.refs[t];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,t)):this._handleDoneLeaving(t)}_handleDoneLeaving(t){if(this.keysToAbortLeave.indexOf(t)!==-1)return;let r=this.refs[t];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[t];let o=So(Ci(this.props.children)||[]);if(o&&o.hasOwnProperty(t))this.performEnter(t);else{let s=jP({},this.state.children);delete s[t],this.setState({children:s})}}render(t,n){let z=t,{childFactory:r,transitionLeave:o,transitionName:s,transitionAppear:a,transitionEnter:l,transitionLeaveTimeout:c,transitionEnterTimeout:d,transitionAppearTimeout:p,component:g}=z,h=Ln(z,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:_}=n,P=Object.entries(_).map(M=>{let[W,de]=M;if(!de)return;let oe=UP(this,W);return va(r(de),{ref:oe,key:W})}).filter(Boolean);return u(g,h,P)}}return i.defaultProps={component:"span",childFactory:$P},i})(),Lg=qP;var GP={version:"4.2.1"},wn=class extends Wt{constructor(e,t){super(e,t),this.render=n=>u("div",{className:"uppy uppy-Informer"},u(Lg,null,n.info.map(r=>u(Sa,{key:r.message},u("p",{role:"alert"},r.message," ",r.details&&u("span",{"aria-label":r.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${r.message}
23
+ ${e}`;alert(s)}return p("div",{className:"uppy-StatusBar-content",title:t("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"},t("uploadFailed"),p("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:o,type:"button"},"?")),p(Fg,{i18n:t,complete:n,numUploads:r})))}var{STATE_ERROR:Bg,STATE_WAITING:RP,STATE_PREPROCESSING:Dd,STATE_UPLOADING:xa,STATE_POSTPROCESSING:kd,STATE_COMPLETE:Ca}=qt;function Id(i){let{newFiles:e,allowNewUpload:t,isUploadInProgress:n,isAllPaused:r,resumableUploads:o,error:s,hideUploadButton:a=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:u,uploadState:g,totalProgress:h,files:_,supportsUploadProgress:P,hideAfterFinish:L=!1,isSomeGhost:M,doneButtonHandler:W=void 0,isUploadStarted:de,i18n:oe,startUpload:ee,uppy:b,isAllComplete:w,showProgressDetails:S=void 0,numUploads:A,complete:z,totalSize:K,totalETA:ve,totalUploadedSize:Ne}=i;function Pe(){switch(g){case kd:case Dd:{let G=_o(_);return G.mode==="determinate"?G.value*100:h}case Bg:return null;case xa:return P?h:null;default:return h}}function Se(){switch(g){case kd:case Dd:{let{mode:G}=_o(_);return G==="indeterminate"}case xa:return!P;default:return!1}}let Q=Pe(),Le=Q??100,te=!s&&e&&(!n&&!r||u)&&t&&!a,Mt=!c&&g!==RP&&g!==Ca,he=o&&!l&&g===xa,X=s&&!w&&!d,F=W&&g===Ca,C=(0,Td.default)("uppy-StatusBar-progress",{"is-indeterminate":Se()}),k=(0,Td.default)("uppy-StatusBar",`is-${g}`,{"has-ghosts":M}),T=(()=>{switch(g){case Dd:case kd:return p(Og,{progress:_o(_)});case Ca:return p(Mg,{i18n:oe});case Bg:return p(Ag,{error:s,i18n:oe,numUploads:A,complete:z});case xa:return p(Rg,{i18n:oe,supportsUploadProgress:P,totalProgress:h,showProgressDetails:S,isUploadStarted:de,isAllComplete:w,isAllPaused:r,newFiles:e,numUploads:A,complete:z,totalUploadedSize:Ne,totalSize:K,totalETA:ve,startUpload:ee});default:return null}})();return p("div",{className:k,"aria-hidden":!(te||X||he||Mt||F)&&!T||g===Ca&&L},p("div",{className:C,style:{width:`${Le}%`},role:"progressbar","aria-label":`${Le}%`,"aria-valuetext":`${Le}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Q}),T,p("div",{className:"uppy-StatusBar-actions"},te?p(Pg,{newFiles:e,isUploadStarted:de,recoveredState:u,i18n:oe,isSomeGhost:M,startUpload:ee,uploadState:g}):null,X?p(Eg,{i18n:oe,uppy:b}):null,he?p(kg,{isAllPaused:r,i18n:oe,isAllComplete:w,resumableUploads:o,uppy:b}):null,Mt?p(Dg,{i18n:oe,uppy:b}):null,F?p(Tg,{i18n:oe,doneButtonHandler:W}):null))}var Ng={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 Be(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var MP=0;function mr(i){return"__private_"+MP+++"_"+i}var AP={version:"4.1.1"},BP=2e3,NP=2e3;function LP(i,e,t,n){if(i)return qt.STATE_ERROR;if(e)return qt.STATE_COMPLETE;if(t)return qt.STATE_WAITING;let r=qt.STATE_WAITING,o=Object.keys(n);for(let s=0;s<o.length;s++){let{progress:a}=n[o[s]];if(a.uploadStarted&&!a.uploadComplete)return qt.STATE_UPLOADING;a.preprocess&&(r=qt.STATE_PREPROCESSING),a.postprocess&&r!==qt.STATE_PREPROCESSING&&(r=qt.STATE_POSTPROCESSING)}return r}var zP={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},li=mr("lastUpdateTime"),pi=mr("previousUploadedBytes"),Li=mr("previousSpeed"),Gt=mr("previousETA"),Od=mr("computeSmoothETA"),wo=mr("onUploadStart"),_n=class extends $t{constructor(e,t){super(e,v(v({},zP),t)),Object.defineProperty(this,Od,{value:HP}),Object.defineProperty(this,li,{writable:!0,value:void 0}),Object.defineProperty(this,pi,{writable:!0,value:void 0}),Object.defineProperty(this,Li,{writable:!0,value:void 0}),Object.defineProperty(this,Gt,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,wo,{writable:!0,value:()=>{let{recoveredState:n}=this.uppy.getState();if(Be(this,Li)[Li]=null,Be(this,Gt)[Gt]=null,n){Be(this,pi)[pi]=Object.values(n.files).reduce((r,o)=>{let{progress:s}=o;return r+s.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Be(this,li)[li]=performance.now(),Be(this,pi)[pi]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Ng,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:t,files:n,allowNewUpload:r,totalProgress:o,error:s,recoveredState:a}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:u,isAllComplete:g,isAllPaused:h,isUploadInProgress:_,isSomeGhost:P}=this.uppy.getObjectOfFilesPerState(),L=a?Object.values(n):l,M=!!t.resumableUploads,W=t.uploadProgress!==!1,de=null,oe=0;c.every(b=>b.progress.bytesTotal!=null&&b.progress.bytesTotal!==0)?(de=0,c.forEach(b=>{de+=b.progress.bytesTotal||0,oe+=b.progress.bytesUploaded||0})):c.forEach(b=>{oe+=b.progress.bytesUploaded||0});let ee=Be(this,Od)[Od]({uploaded:oe,total:de});return Id({error:s,uploadState:LP(s,g,a,e.files||{}),allowNewUpload:r,totalProgress:o,totalSize:de,totalUploadedSize:oe,isAllComplete:!1,isAllPaused:h,isUploadStarted:u,isUploadInProgress:_,isSomeGhost:P,recoveredState:a,complete:d.length,newFiles:L.length,numUploads:c.length,totalETA:ee,files:n,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:M,supportsUploadProgress:W,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 e=this.el;ba(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Be(this,wo)[wo]),Be(this,li)[li]=performance.now(),Be(this,pi)[pi]=this.uppy.getFiles().reduce((t,n)=>t+n.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Be(this,wo)[wo])}};function HP(i){var e,t;if(i.total==null||i.total===0)return null;let n=i.total-i.uploaded;if(n<=0)return null;(t=(e=Be(this,li))[li])!=null||(e[li]=performance.now());let r=performance.now()-Be(this,li)[li];if(r===0){var o;return Math.round(((o=Be(this,Gt)[Gt])!=null?o:0)/100)/10}let s=i.uploaded-Be(this,pi)[pi];if(Be(this,pi)[pi]=i.uploaded,s<=0){var a;return Math.round(((a=Be(this,Gt)[Gt])!=null?a:0)/100)/10}let l=s/r,c=Be(this,Li)[Li]==null?l:_a(l,Be(this,Li)[Li],BP,r);Be(this,Li)[Li]=c;let d=n/c,u=Math.max(Be(this,Gt)[Gt]-r,0),g=Be(this,Gt)[Gt]==null?d:_a(d,u,NP,r);return Be(this,Gt)[Gt]=g,Be(this,li)[li]=performance.now(),Math.round(g/100)/10}_n.VERSION=AP.version;var Lg=300,Sa=class extends Ot{constructor(){super(...arguments),this.ref=gg()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Lg)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Lg)}render(){let{children:e}=this.props;return p("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function jP(i,e){return Object.assign(i,e)}function VP(i,e){var t;return(t=i?.key)!=null?t:e}function UP(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=n=>{i.refs[e]=n})}function xo(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let n=VP(i[t],t.toString(36));e[n]=i[t]}return e}function WP(i,e){i=i||{},e=e||{};let t=s=>e.hasOwnProperty(s)?e[s]:i[s],n={},r=[];for(let s in i)e.hasOwnProperty(s)?r.length&&(n[s]=r,r=[]):r.push(s);let o={};for(let s in e){if(n.hasOwnProperty(s))for(let a=0;a<n[s].length;a++){let l=n[s][a];o[n[s][a]]=t(l)}o[s]=t(s)}for(let s=0;s<r.length;s++)o[r[s]]=t(r[s]);return o}var $P=i=>i,qP=(()=>{class i extends Ot{constructor(t,n){super(t,n),this.refs={},this.state={children:xo(Ci(Ci(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let t=this.state.children;for(let n in t)t[n]&&this.performAppear(n)}componentWillReceiveProps(t){let n=xo(Ci(t.children)||[]),r=this.state.children;this.setState(s=>({children:WP(s.children,n)}));let o;for(o in n)if(n.hasOwnProperty(o)){let s=r&&r.hasOwnProperty(o);n[o]&&s&&this.currentlyTransitioningKeys[o]?(this.keysToEnter.push(o),this.keysToAbortLeave.push(o)):n[o]&&!s&&!this.currentlyTransitioningKeys[o]&&this.keysToEnter.push(o)}for(o in r)if(r.hasOwnProperty(o)){let s=n&&n.hasOwnProperty(o);r[o]&&!s&&!this.currentlyTransitioningKeys[o]&&this.keysToLeave.push(o)}}componentDidUpdate(){let{keysToEnter:t}=this;this.keysToEnter=[],t.forEach(this.performEnter);let{keysToLeave:n}=this;this.keysToLeave=[],n.forEach(this.performLeave)}_finishAbort(t){let n=this.keysToAbortLeave.indexOf(t);n!==-1&&this.keysToAbortLeave.splice(n,1)}performAppear(t){this.currentlyTransitioningKeys[t]=!0;let n=this.refs[t];n!=null&&n.componentWillAppear?n.componentWillAppear(this._handleDoneAppearing.bind(this,t)):this._handleDoneAppearing(t)}_handleDoneAppearing(t){let n=this.refs[t];n!=null&&n.componentDidAppear&&n.componentDidAppear(),delete this.currentlyTransitioningKeys[t],this._finishAbort(t);let r=xo(Ci(this.props.children)||[]);(!r||!r.hasOwnProperty(t))&&this.performLeave(t)}performEnter(t){this.currentlyTransitioningKeys[t]=!0;let n=this.refs[t];n!=null&&n.componentWillEnter?n.componentWillEnter(this._handleDoneEntering.bind(this,t)):this._handleDoneEntering(t)}_handleDoneEntering(t){let n=this.refs[t];n!=null&&n.componentDidEnter&&n.componentDidEnter(),delete this.currentlyTransitioningKeys[t],this._finishAbort(t);let r=xo(Ci(this.props.children)||[]);(!r||!r.hasOwnProperty(t))&&this.performLeave(t)}performLeave(t){if(this.keysToAbortLeave.indexOf(t)!==-1)return;this.currentlyTransitioningKeys[t]=!0;let r=this.refs[t];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,t)):this._handleDoneLeaving(t)}_handleDoneLeaving(t){if(this.keysToAbortLeave.indexOf(t)!==-1)return;let r=this.refs[t];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[t];let o=xo(Ci(this.props.children)||[]);if(o&&o.hasOwnProperty(t))this.performEnter(t);else{let s=jP({},this.state.children);delete s[t],this.setState({children:s})}}render(t,n){let L=t,{childFactory:r,transitionLeave:o,transitionName:s,transitionAppear:a,transitionEnter:l,transitionLeaveTimeout:c,transitionEnterTimeout:d,transitionAppearTimeout:u,component:g}=L,h=zn(L,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:_}=n,P=Object.entries(_).map(M=>{let[W,de]=M;if(!de)return;let oe=UP(this,W);return va(r(de),{ref:oe,key:W})}).filter(Boolean);return p(g,h,P)}}return i.defaultProps={component:"span",childFactory:$P},i})(),zg=qP;var GP={version:"4.2.1"},wn=class extends $t{constructor(e,t){super(e,t),this.render=n=>p("div",{className:"uppy uppy-Informer"},p(zg,null,n.info.map(r=>p(Sa,{key:r.message},p("p",{role:"alert"},r.message," ",r.details&&p("span",{"aria-label":r.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${r.message}
24
24
 
25
- ${r.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};wn.VERSION=GP.version;var XP=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function YP(i,e,t){var n,r;let o=XP.exec(i),s=(n=(r=e.mimeType)!=null?r:o?.[1])!=null?n:"plain/text",a;if(o?.[2]!=null){let l=atob(decodeURIComponent(o[3])),c=new Uint8Array(l.length);for(let d=0;d<l.length;d++)c[d]=l.charCodeAt(d);a=[c]}else o?.[3]!=null&&(a=[decodeURIComponent(o[3])]);return t?new File(a,e.name||"",{type:s}):new Blob(a,{type:s})}var Hg=YP;function Pa(i){return i.startsWith("blob:")}function Ea(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function Ee(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Yg=typeof self<"u"?self:global,ko=typeof navigator<"u",KP=ko&&typeof HTMLImageElement>"u",jg=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Kg=Yg.Buffer,Qg=!!Kg,QP=i=>i!==void 0;function Zg(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(QP).length===0)}function ot(i){let e=new Error(i);throw delete e.stack,e}function Vg(i){let e=function(t){let n=0;return t.ifd0.enabled&&(n+=1024),t.exif.enabled&&(n+=2048),t.makerNote&&(n+=2048),t.userComment&&(n+=1024),t.gps.enabled&&(n+=512),t.interop.enabled&&(n+=100),t.ifd1.enabled&&(n+=1024),n+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}var Fd=i=>String.fromCharCode.apply(null,i),Ug=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,Cn=class i{static from(e,t){return e instanceof this&&e.le===t?e:new i(e,void 0,void 0,t)}constructor(e,t=0,n,r){if(typeof r=="boolean"&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){n===void 0&&(n=e.byteLength-t);let o=new DataView(e,t,n);this._swapDataView(o)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof i){n===void 0&&(n=e.byteLength-t),(t+=e.byteOffset)+n>e.byteOffset+e.byteLength&&ot("Creating view outside of available memory in ArrayBuffer");let o=new DataView(e.buffer,t,n);this._swapDataView(o)}else if(typeof e=="number"){let o=new DataView(new ArrayBuffer(e));this._swapDataView(o)}else ot("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,n=i){return e instanceof DataView||e instanceof i?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||ot("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new n(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new i(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return r=this.getUint8Array(e,t),Ug?Ug.decode(r):Qg?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(Fd(r)));var r}getLatin1String(e=0,t=this.byteLength){let n=this.getUint8Array(e,t);return Fd(n)}getUnicodeString(e=0,t=this.byteLength){let n=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)n.push(this.getUint16(e+r));return Fd(n)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,n){switch(t){case 1:return this.getUint8(e,n);case 2:return this.getUint16(e,n);case 4:return this.getUint32(e,n);case 8:return this.getUint64&&this.getUint64(e,n)}}getUint(e,t,n){switch(t){case 8:return this.getUint8(e,n);case 16:return this.getUint16(e,n);case 32:return this.getUint32(e,n);case 64:return this.getUint64&&this.getUint64(e,n)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function Md(i,e){ot(`${i} '${e}' was not loaded, try using full build of exifr.`)}var To=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||Md(this.kind,e),t&&(e in t||function(n,r){ot(`Unknown ${n} '${r}'.`)}(this.kind,e),t[e].enabled||Md(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},Oa=new To("file parser"),Gt=new To("segment parser"),Fo=new To("file reader"),ZP=Yg.fetch;function Wg(i,e){return(t=i).startsWith("data:")||t.length>1e4?Bd(i,e,"base64"):jg&&i.includes("://")?Ad(i,e,"url",Da):jg?Bd(i,e,"fs"):ko?Ad(i,e,"url",Da):void ot("Invalid input argument");var t}function Ad(i,e,t,n){return B(this,null,function*(){return Fo.has(t)?Bd(i,e,t):n?function(r,o){return B(this,null,function*(){let s=yield o(r);return new Cn(s)})}(i,n):void ot(`Parser ${t} is not loaded`)})}function Bd(i,e,t){return B(this,null,function*(){let n=new(Fo.get(t))(i,e);return yield n.read(),n})}var Da=i=>ZP(i).then(e=>e.arrayBuffer()),Io=i=>new Promise((e,t)=>{let n=new FileReader;n.onloadend=()=>e(n.result||new ArrayBuffer),n.onerror=t,n.readAsArrayBuffer(i)}),Nd=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 Jg(i,e,t){let n=new Nd;for(let[r,o]of t)n.set(r,o);if(Array.isArray(e))for(let r of e)i.set(r,n);else i.set(e,n);return n}function e0(i,e,t){let n,r=i.get(e);for(n of t)r.set(n[0],n[1])}var Ro=new Map,Vd=new Map,Ud=new Map,gr=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Fa=["jfif","xmp","icc","iptc","ihdr"],Oo=["tiff",...Fa],Ye=["ifd0","ifd1","exif","gps","interop"],yr=[...Oo,...Ye],vr=["makerNote","userComment"],Ra=["translateKeys","translateValues","reviveValues","multiSegment"],br=[...Ra,"sanitize","mergeOutput","silentErrors"],ka=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},xn=class extends ka{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,n,r){if(super(),Ee(this,"enabled",!1),Ee(this,"skip",new Set),Ee(this,"pick",new Set),Ee(this,"deps",new Set),Ee(this,"translateKeys",!1),Ee(this,"translateValues",!1),Ee(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=Ye.includes(e),this.canBeFiltered&&(this.dict=Ro.get(e)),n!==void 0)if(Array.isArray(n))this.parse=this.enabled=!0,this.canBeFiltered&&n.length>0&&this.translateTagSet(n,this.pick);else if(typeof n=="object"){if(this.enabled=!0,this.parse=n.parse!==!1,this.canBeFiltered){let{pick:o,skip:s}=n;o&&o.length>0&&this.translateTagSet(o,this.pick),s&&s.length>0&&this.translateTagSet(s,this.skip)}this.applyInheritables(n)}else n===!0||n===!1?this.parse=this.enabled=n:ot(`Invalid options argument: ${n}`)}applyInheritables(e){let t,n;for(t of Ra)n=e[t],n!==void 0&&(this[t]=n)}translateTagSet(e,t){if(this.dict){let n,r,{tagKeys:o,tagValues:s}=this.dict;for(n of e)typeof n=="string"?(r=s.indexOf(n),r===-1&&(r=o.indexOf(Number(n))),r!==-1&&t.add(Number(o[r]))):t.add(n)}else for(let n of e)t.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ta(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ta(this.pick,this.deps)}},bt={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},$g=new Map,Sn=class extends ka{static useCached(e){let t=$g.get(e);return t!==void 0||(t=new this(e),$g.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):ot(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=ko?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of gr)this[e]=bt[e];for(e of br)this[e]=bt[e];for(e of vr)this[e]=bt[e];for(e of yr)this[e]=new xn(e,bt[e],void 0,this)}setupFromTrue(){let e;for(e of gr)this[e]=bt[e];for(e of br)this[e]=bt[e];for(e of vr)this[e]=!0;for(e of yr)this[e]=new xn(e,!0,void 0,this)}setupFromArray(e){let t;for(t of gr)this[t]=bt[t];for(t of br)this[t]=bt[t];for(t of vr)this[t]=bt[t];for(t of yr)this[t]=new xn(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ye)}setupFromObject(e){let t;for(t of(Ye.ifd0=Ye.ifd0||Ye.image,Ye.ifd1=Ye.ifd1||Ye.thumbnail,Object.assign(this,e),gr))this[t]=Rd(e[t],bt[t]);for(t of br)this[t]=Rd(e[t],bt[t]);for(t of vr)this[t]=Rd(e[t],bt[t]);for(t of Oo)this[t]=new xn(t,bt[t],e[t],this);for(t of Ye)this[t]=new xn(t,bt[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ye,yr),e.tiff===!0?this.batchEnableWithBool(Ye,!0):e.tiff===!1?this.batchEnableWithUserValue(Ye,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ye):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ye)}batchEnableWithBool(e,t){for(let n of e)this[n].enabled=t}batchEnableWithUserValue(e,t){for(let n of e){let r=t[n];this[n].enabled=r!==!1&&r!==void 0}}setupGlobalFilters(e,t,n,r=n){if(e&&e.length){for(let s of r)this[s].enabled=!1;let o=qg(e,n);for(let[s,a]of o)Ta(this[s].pick,a),this[s].enabled=!0}else if(t&&t.length){let o=qg(t,n);for(let[s,a]of o)Ta(this[s].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:n,iptc:r,icc:o}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),n.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),o.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:n,interop:r}=this;r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),n.needed&&e.deps.add(34853),this.tiff.enabled=Ye.some(o=>this[o].enabled===!0)||this.makerNote||this.userComment;for(let o of Ye)this[o].finalizeFilters()}get onlyTiff(){return!Fa.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Oo)this[e].enabled&&!Gt.has(e)&&Md("segment parser",e)}};function qg(i,e){let t,n,r,o,s=[];for(r of e){for(o of(t=Ro.get(r),n=[],t))(i.includes(o[0])||i.includes(o[1]))&&n.push(o[0]);n.length&&s.push([r,n])}return s}function Rd(i,e){return i!==void 0?i:e!==void 0?e:void 0}function Ta(i,e){for(let t of e)i.add(t)}Ee(Sn,"default",bt);var _r=class{constructor(e){Ee(this,"parsers",{}),Ee(this,"output",{}),Ee(this,"errors",[]),Ee(this,"pushToErrors",t=>this.errors.push(t)),this.options=Sn.useCached(e)}read(e){return B(this,null,function*(){this.file=yield function(t,n){return typeof t=="string"?Wg(t,n):ko&&!KP&&t instanceof HTMLImageElement?Wg(t.src,n):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Cn(t):ko&&t instanceof Blob?Ad(t,n,"blob",Io):void ot("Invalid input argument")}(e,this.options)})}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[n,r]of Oa)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[n]=!0;this.file.close&&this.file.close(),ot("Unknown file format")}parse(){return B(this,null,function*(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(yield this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):yield this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),Zg(n=e)?void 0:n;var n})}executeParsers(){return B(this,null,function*(){let{output:e}=this;yield this.fileParser.parse();let t=Object.values(this.parsers).map(n=>B(this,null,function*(){let r=yield n.parse();n.assignToOutput(e,r)}));this.options.silentErrors&&(t=t.map(n=>n.catch(this.pushToErrors))),yield Promise.all(t)})}extractThumbnail(){return B(this,null,function*(){this.setup();let{options:e,file:t}=this,n=Gt.get("tiff",e);var r;if(t.tiff?r={start:0,type:"tiff"}:t.jpeg&&(r=yield this.fileParser.getOrFindSegment("tiff")),r===void 0)return;let o=yield this.fileParser.ensureSegmentChunk(r),s=this.parsers.tiff=new n(o,e,t),a=yield s.extractThumbnail();return t.close&&t.close(),a})}};function t0(i,e){return B(this,null,function*(){let t=new _r(e);return yield t.read(i),t.parse()})}var JP=Object.freeze({__proto__:null,parse:t0,Exifr:_r,fileParsers:Oa,segmentParsers:Gt,fileReaders:Fo,tagKeys:Ro,tagValues:Vd,tagRevivers:Ud,createDictionary:Jg,extendDictionary:e0,fetchUrlAsArrayBuffer:Da,readBlobAsArrayBuffer:Io,chunkedProps:gr,otherSegments:Fa,segments:Oo,tiffBlocks:Ye,segmentsAndBlocks:yr,tiffExtractables:vr,inheritables:Ra,allFormatters:br,Options:Sn}),rn=class{static findPosition(e,t){let n=e.getUint16(t+2)+2,r=typeof this.headerLength=="function"?this.headerLength(e,t,n):this.headerLength,o=t+r,s=n-r;return{offset:t,length:n,headerLength:r,start:o,size:s,end:o+s}}static parse(e,t={}){return new this(e,new Sn({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Cn?e:new Cn(e)}constructor(e,t={},n){Ee(this,"errors",[]),Ee(this,"raw",new Map),Ee(this,"handleError",r=>{if(!this.options.silentErrors)throw r;this.errors.push(r.message)}),this.chunk=this.normalizeInput(e),this.file=n,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let n=Ud.get(t),r=Vd.get(t),o=Ro.get(t),s=this.options[t],a=s.reviveValues&&!!n,l=s.translateValues&&!!r,c=s.translateKeys&&!!o,d={};for(let[p,g]of e)a&&n.has(p)?g=n.get(p)(g):l&&r.has(p)&&(g=this.translateValue(g,r.get(p))),c&&o.has(p)&&(p=o.get(p)||p),d[p]=g;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,n){if(this.globalOptions.mergeOutput)return Object.assign(e,n);e[t]?Object.assign(e[t],n):e[t]=n}};Ee(rn,"headerLength",4),Ee(rn,"type",void 0),Ee(rn,"multiSegment",!1),Ee(rn,"canHandle",()=>!1);function e2(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function t2(i){return i>=224&&i<=239}function i2(i,e,t){for(let[n,r]of Gt)if(r.canHandle(i,e,t))return n}var Ia=class extends class{constructor(e,t,n){Ee(this,"errors",[]),Ee(this,"ensureSegmentChunk",r=>B(this,null,function*(){let o=r.start,s=r.size||65536;if(this.file.chunked)if(this.file.available(o,s))r.chunk=this.file.subarray(o,s);else try{r.chunk=yield this.file.readChunk(o,s)}catch(a){ot(`Couldn't read segment: ${JSON.stringify(r)}. ${a.message}`)}else this.file.byteLength>o+s?r.chunk=this.file.subarray(o,s):r.size===void 0?r.chunk=this.file.subarray(o):ot("Segment unreachable: "+JSON.stringify(r));return r.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=n}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let n=new(Gt.get(e))(t,this.options,this.file);return this.parsers[e]=n}createParsers(e){for(let t of e){let{type:n,chunk:r}=t,o=this.options[n];if(o&&o.enabled){let s=this.parsers[n];s&&s.append||s||this.createParser(n,r)}}}readSegments(e){return B(this,null,function*(){let t=e.map(this.ensureSegmentChunk);yield Promise.all(t)})}}{constructor(...e){super(...e),Ee(this,"appSegments",[]),Ee(this,"jpegSegments",[]),Ee(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}parse(){return B(this,null,function*(){yield this.findAppSegments(),yield this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)})}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Gt.keyList())):(e=e===void 0?Gt.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&Gt.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}findAppSegments(e=0,t){return B(this,null,function*(){this.setupSegmentFinderArgs(t);let{file:n,findAll:r,wanted:o,remaining:s}=this;if(!r&&this.file.chunked&&(r=Array.from(o).some(a=>{let l=Gt.get(a),c=this.options[a];return l.multiSegment&&c.multiSegment}),r&&(yield this.file.readWhole())),e=this.findAppSegmentsInRange(e,n.byteLength),!this.options.onlyTiff&&n.chunked){let a=!1;for(;s.size>0&&!a&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=n,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(a=e>l&&!c?!(yield n.readNextChunk(e)):!(yield n.readNextChunk(l)),(e=this.findAppSegmentsInRange(e,n.byteLength))===void 0)return}}})}findAppSegmentsInRange(e,t){t-=2;let n,r,o,s,a,l,{file:c,findAll:d,wanted:p,remaining:g,options:h}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(n=c.getUint8(e+1),t2(n)){if(r=c.getUint16(e+2),o=i2(c,e,r),o&&p.has(o)&&(s=Gt.get(o),a=s.findPosition(c,e),l=h[o],a.type=o,this.appSegments.push(a),!d&&(s.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||g.delete(o)):g.delete(o),g.size===0)))break;h.recordUnknownSegments&&(a=rn.findPosition(c,e),a.marker=n,this.unknownSegments.push(a)),e+=r+1}else if(e2(n)){if(r=c.getUint16(e+2),n===218&&h.stopAfterSos!==!1)return;h.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:n}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,n){let r,o,s,a=new Map;for(let l=0;l<t.length;l++)r=t[l],o=r[n],a.has(o)?s=a.get(o):a.set(o,s=[]),s.push(r);return Array.from(a)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,n])=>{let r=Gt.get(t,this.options);return r.handleMultiSegments?{type:t,chunk:r.handleMultiSegments(n)}:n[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}getOrFindSegment(e){return B(this,null,function*(){let t=this.getSegment(e);return t===void 0&&(yield this.findAppSegments(0,[e]),t=this.getSegment(e)),t})}};Ee(Ia,"type","jpeg"),Oa.set("jpeg",Ia);var n2=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],zd=class extends rn{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,n=new Map){let{pick:r,skip:o}=this.options[t];r=new Set(r);let s=r.size>0,a=o.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(e);if(s){if(r.has(d)&&(n.set(d,this.parseTag(e,d,t)),r.delete(d),r.size===0))break}else!a&&o.has(d)||n.set(d,this.parseTag(e,d,t));e+=12}return n}parseTag(e,t,n){let{chunk:r}=this,o=r.getUint16(e+2),s=r.getUint32(e+4),a=n2[o];if(a*s<=4?e+=8:e=r.getUint32(e+8),(o<1||o>13)&&ot(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${o}, offset ${e}`),e>r.byteLength&&ot(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${o}, offset ${e} is outside of chunk size ${r.byteLength}`),o===1)return r.getUint8Array(e,s);if(o===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=r.getString(e,s)).trim())===""?void 0:l;var l;if(o===7)return r.getUint8Array(e,s);if(s===1)return this.parseTagValue(o,e);{let c=new(function(p){switch(p){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}}(o))(s),d=a;for(let p=0;p<s;p++)c[p]=this.parseTagValue(o,e),e+=d;return c}}parseTagValue(e,t){let{chunk:n}=this;switch(e){case 1:return n.getUint8(t);case 3:return n.getUint16(t);case 4:return n.getUint32(t);case 5:return n.getUint32(t)/n.getUint32(t+4);case 6:return n.getInt8(t);case 8:return n.getInt16(t);case 9:return n.getInt32(t);case 10:return n.getInt32(t)/n.getInt32(t+4);case 11:return n.getFloat(t);case 12:return n.getDouble(t);case 13:return n.getUint32(t);default:ot(`Invalid tiff type ${e}`)}}},Do=class extends zd{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}parse(){return B(this,null,function*(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&(yield this.parseIfd0Block()),e.exif.enabled&&(yield this.safeParse("parseExifBlock")),e.gps.enabled&&(yield this.safeParse("parseGpsBlock")),e.interop.enabled&&(yield this.safeParse("parseInteropBlock")),e.ifd1.enabled&&(yield this.safeParse("parseThumbnailBlock")),this.createOutput()})}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let n=new Map;return this[t]=n,this.parseTags(e,t,n),n}parseIfd0Block(){return B(this,null,function*(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&ot("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&ot(`IFD0 offset points to outside of file.
26
- this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&(yield e.ensureChunk(this.ifd0Offset,Vg(this.options)));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0})}parseExifBlock(){return B(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,Vg(this.options)));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e})}unpack(e,t){let n=e.get(t);n&&n.length===1&&e.set(t,n[0])}parseGpsBlock(){return B(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Gg(...e.get(2),e.get(1))),e.set("longitude",Gg(...e.get(4),e.get(3)))),e})}parseInteropBlock(){return B(this,null,function*(){if(!this.interop&&(this.ifd0||(yield this.parseIfd0Block()),this.interopOffset!==void 0||this.exif||(yield this.parseExifBlock()),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")})}parseThumbnailBlock(e=!1){return B(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return B(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,n,r={};for(t of Ye)if(e=this[t],!Zg(e))if(n=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(r,n)}else r[t]=n;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[n,r]of Object.entries(t))this.assignObjectToOutput(e,n,r)}};function Gg(i,e,t,n){var r=i+e/60+t/3600;return n!=="S"&&n!=="W"||(r*=-1),r}Ee(Do,"type","tiff"),Ee(Do,"headerLength",10),Gt.set("tiff",Do);var TR=Object.freeze({__proto__:null,default:JP,Exifr:_r,fileParsers:Oa,segmentParsers:Gt,fileReaders:Fo,tagKeys:Ro,tagValues:Vd,tagRevivers:Ud,createDictionary:Jg,extendDictionary:e0,fetchUrlAsArrayBuffer:Da,readBlobAsArrayBuffer:Io,chunkedProps:gr,otherSegments:Fa,segments:Oo,tiffBlocks:Ye,segmentsAndBlocks:yr,tiffExtractables:vr,inheritables:Ra,allFormatters:br,Options:Sn,parse:t0}),Wd={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},IR=Object.assign({},Wd,{firstChunkSize:4e4,gps:[1,2,3,4]});var OR=Object.assign({},Wd,{tiff:!1,ifd1:!0,mergeOutput:!1});var r2=Object.assign({},Wd,{firstChunkSize:4e4,ifd0:[274]});function o2(i){return B(this,null,function*(){let e=new _r(r2);yield e.read(i);let t=yield e.parse();if(t&&t.ifd0)return t.ifd0[274]})}var s2=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}}),Po=!0,Eo=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,n]=e;Po=Number(t)+.1*Number(n)<13.4,Eo=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Po=Eo=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Po=Eo=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Po=Eo=Number(e)<77}}function i0(i){return B(this,null,function*(){let e=yield o2(i);return Object.assign({canvas:Po,css:Eo},s2[e])})}var Ld=class extends Cn{constructor(...e){super(...e),Ee(this,"ranges",new Hd),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,n){if(e===0&&this.byteLength===0&&n){let r=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(r)}else{let r=e+t;if(r>this.byteLength){let{dataView:o}=this._extend(r);this._swapDataView(o)}}}_extend(e){let t;t=Qg?Kg.allocUnsafe(e):new Uint8Array(e);let n=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:n}}subarray(e,t,n=!1){return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,n=!1){n&&this._tryExtend(t,e.byteLength,e);let r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}ensureChunk(e,t){return B(this,null,function*(){this.chunked&&(this.ranges.available(e,t)||(yield this.readChunk(e,t)))})}available(e,t){return this.ranges.available(e,t)}},Hd=class{constructor(){Ee(this,"list",[])}get length(){return this.list.length}add(e,t,n=0){let r=e+t,o=this.list.filter(s=>Xg(e,s.offset,r)||Xg(e,s.end,r));if(o.length>0){e=Math.min(e,...o.map(a=>a.offset)),r=Math.max(r,...o.map(a=>a.end)),t=r-e;let s=o.shift();s.offset=e,s.length=t,s.end=r,this.list=this.list.filter(a=>!o.includes(a))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let n=e+t;return this.list.some(r=>r.offset<=e&&n<=r.end)}};function Xg(i,e,t){return i<=e&&e<=t}var jd=class extends Ld{constructor(e,t){super(0),Ee(this,"chunksRead",0),this.input=e,this.options=t}readWhole(){return B(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return B(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return B(this,arguments,function*(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,n=yield this.readChunk(e,t);return!!n&&n.byteLength===t})}readChunk(e,t){return B(this,null,function*(){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)})}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};Fo.set("blob",class extends jd{readWhole(){return B(this,null,function*(){this.chunked=!1;let i=yield Io(this.input);this._swapArrayBuffer(i)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(i,e){return B(this,null,function*(){let t=e?i+e:void 0,n=this.input.slice(i,t),r=yield Io(n);return this.set(r,i,!0)})}});var n0={strings:{generatingThumbnails:"Generating thumbnails..."}};var a2={version:"4.1.1"};function l2(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(n){if(n.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(n=>{i.toBlob(n,e,t)}).then(n=>{if(n===null)throw new Error("cannot read image, probably an svg with external resources");return n}):Promise.resolve().then(()=>Hg(i.toDataURL(e,t),{})).then(n=>{if(n===null)throw new Error("could not extract blob, probably an old browser");return n})}function c2(i,e){let t=i.width,n=i.height;(e.deg===90||e.deg===270)&&(t=i.height,n=i.width);let r=document.createElement("canvas");r.width=t,r.height=n;let o=r.getContext("2d");return o.translate(t/2,n/2),e.canvas&&(o.rotate(e.rad),o.scale(e.scaleX,e.scaleY)),o.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),r}function d2(i){let e=i.width/i.height,t=5e6,n=4096,r=Math.floor(Math.sqrt(t*e)),o=Math.floor(t/Math.sqrt(t*e));if(r>n&&(r=n,o=Math.round(r/e)),o>n&&(o=n,r=Math.round(e*o)),i.width>r){let s=document.createElement("canvas");return s.width=r,s.height=o,s.getContext("2d").drawImage(i,0,0,r,o),s}return i}var u2={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},wr=class extends Wt{constructor(e,t){if(super(e,v(v({},u2),t)),this.onFileAdded=n=>{!n.preview&&n.data&&Ea(n.type)&&!n.isRemote&&this.addToQueue(n.id)},this.onCancelRequest=n=>{let r=this.queue.indexOf(n.id);r!==-1&&this.queue.splice(r,1)},this.onFileRemoved=n=>{let r=this.queue.indexOf(n.id);r!==-1&&this.queue.splice(r,1),n.preview&&Pa(n.preview)&&URL.revokeObjectURL(n.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(r=>r.isRestored).forEach(r=>{(!r.preview||Pa(r.preview))&&this.addToQueue(r.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=n=>{n.forEach(o=>{let s=this.uppy.getFile(o);this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let r=()=>{n.forEach(o=>{let s=this.uppy.getFile(o);this.uppy.emit("preprocess-complete",s)})};return new Promise(o=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{r(),o()}):(r(),o())})},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=n0,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,n){let r=URL.createObjectURL(e.data),o=new Promise((a,l)=>{let c=new Image;c.src=r,c.addEventListener("load",()=>{URL.revokeObjectURL(r),a(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(r),l(d.error||new Error("Could not create thumbnail"))})}),s=i0(e.data).catch(()=>1);return Promise.all([o,s]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,t,n,c.deg),p=c2(l,c),g=this.resizeImage(p,d.width,d.height);return l2(g,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,t,n,r){let o=e.width/e.height;return(r===90||r===270)&&(o=e.height/e.width),t!=null?{width:t,height:Math.round(t/o)}:n!=null?{width:Math.round(n*o),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/o)}}resizeImage(e,t,n){let r=d2(e),o=Math.ceil(Math.log2(r.width/t));o<1&&(o=1);let s=t*2**(o-1),a=n*2**(o-1),l=2;for(;o--;){let c=document.createElement("canvas");c.width=s,c.height=a,c.getContext("2d").drawImage(r,0,0,s,a),r=c,s=Math.round(s/l),a=Math.round(a/l)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return Ea(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};wr.VERSION=a2.version;function p2(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&_o(i)?[i]:null}var $d=p2;var Si=Array.from;function Ma(i,e,t,n){let{onSuccess:r}=n;i.readEntries(o=>{let s=[...e,...o];o.length?queueMicrotask(()=>{Ma(i,s,t,{onSuccess:r})}):r(s)},o=>{t(o),r(e)})}function r0(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((n,r)=>i.file(n,r))},values(){return is(this,null,function*(){let n=i.createReader(),r=yield new Hn(new Promise(o=>{Ma(n,[],e,{onSuccess:s=>o(s.map(a=>r0(a,e)))})}));yield*ns(r)})},isSameEntry:void 0}}function o0(i,e,t){try{return t===void 0&&(t=void 0),function(){return is(this,null,function*(){let n=()=>`${e}/${i.name}`;if(i.kind==="file"){let l=yield new Hn(i.getFile());l!=null?(l.relativePath=e?n():null,yield l):t!=null&&(yield t)}else if(i.kind==="directory")try{for(var r=rs(i.values()),o,s,a;o=!(s=yield new Hn(r.next())).done;o=!1){let l=s.value;yield*ns(o0(l,e?n():i.name))}}catch{a=[s]}finally{try{o&&(s=r.return)&&(yield new Hn(s.call(r)))}finally{if(a)throw a[0]}}else t!=null&&(yield t)})}()}catch(n){return Promise.reject(n)}}function qd(i,e){return is(this,null,function*(){let t=yield new Hn(Promise.all(Array.from(i.items,n=>B(this,null,function*(){var r;let o,s=()=>typeof n.getAsEntry=="function"?n.getAsEntry():n.webkitGetAsEntry();return(r=o)!=null||(o=r0(s(),e)),{fileSystemHandle:o,lastResortFile:n.getAsFile()}}))));for(let{lastResortFile:n,fileSystemHandle:r}of t)if(r!=null)try{yield*ns(o0(r,"",n))}catch(o){n!=null?yield n:e(o)}else n!=null&&(yield n)})}function Gd(i){let e=Si(i.files);return Promise.resolve(e)}function Mo(i,e){return B(this,null,function*(){var t;let n=(t=e?.logDropError)!=null?t:Function.prototype;try{let l=[];try{for(var r=rs(qd(i,n)),o,s,a;o=!(s=yield r.next()).done;o=!1){let c=s.value;l.push(c)}}catch{a=[s]}finally{try{o&&(s=r.return)&&(yield s.call(r))}finally{if(a)throw a[0]}}return l}catch{return Gd(i)}})}var A0=De(vt(),1);function Ao(i){return D(v({},i),{type:i.mimeType,extension:i.name?xi(i.name).extension:null})}var Bo,qe,Xd,s0,No=0,f0=[],Ke=Fe,a0=Ke.__b,l0=Ke.__r,c0=Ke.diffed,d0=Ke.__c,u0=Ke.unmount,p0=Ke.__;function Kd(i,e){Ke.__h&&Ke.__h(qe,i,No||e),No=0;var t=qe.__H||(qe.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function pi(i){return No=1,h2(g0,i)}function h2(i,e,t){var n=Kd(Bo++,2);if(n.t=i,!n.__c&&(n.__=[t?t(e):g0(void 0,e),function(a){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,a);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=qe,!qe.u)){var r=function(a,l,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(g){return!!g.__c});if(d.every(function(g){return!g.__N}))return!o||o.call(this,a,l,c);var p=n.__c.props!==a;return d.forEach(function(g){if(g.__N){var h=g.__[0];g.__=g.__N,g.__N=void 0,h!==g.__[0]&&(p=!0)}}),o&&o.call(this,a,l,c)||p};qe.u=!0;var o=qe.shouldComponentUpdate,s=qe.componentWillUpdate;qe.componentWillUpdate=function(a,l,c){if(this.__e){var d=o;o=void 0,r(a,l,c),o=d}s&&s.call(this,a,l,c)},qe.shouldComponentUpdate=r}return n.__N||n.__}function Pi(i,e){var t=Kd(Bo++,3);!Ke.__s&&m0(t.__H,e)&&(t.__=i,t.i=e,qe.__H.__h.push(t))}function Pn(i){return No=5,En(function(){return{current:i}},[])}function En(i,e){var t=Kd(Bo++,7);return m0(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Dn(i,e){return No=8,En(function(){return i},e)}function f2(){for(var i;i=f0.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Aa),i.__H.__h.forEach(Yd),i.__H.__h=[]}catch(e){i.__H.__h=[],Ke.__e(e,i.__v)}}Ke.__b=function(i){qe=null,a0&&a0(i)},Ke.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),p0&&p0(i,e)},Ke.__r=function(i){l0&&l0(i),Bo=0;var e=(qe=i.__c).__H;e&&(Xd===qe?(e.__h=[],qe.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0})):(e.__h.forEach(Aa),e.__h.forEach(Yd),e.__h=[],Bo=0)),Xd=qe},Ke.diffed=function(i){c0&&c0(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(f0.push(e)!==1&&s0===Ke.requestAnimationFrame||((s0=Ke.requestAnimationFrame)||m2)(f2)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.i=void 0})),Xd=qe=null},Ke.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Aa),t.__h=t.__h.filter(function(n){return!n.__||Yd(n)})}catch(n){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Ke.__e(n,t.__v)}}),d0&&d0(i,e)},Ke.unmount=function(i){u0&&u0(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{Aa(n)}catch(r){e=r}}),t.__H=void 0,e&&Ke.__e(e,t.__v))};var h0=typeof requestAnimationFrame=="function";function m2(i){var e,t=function(){clearTimeout(n),h0&&cancelAnimationFrame(e),setTimeout(i)},n=setTimeout(t,100);h0&&(e=requestAnimationFrame(t))}function Aa(i){var e=qe,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),qe=e}function Yd(i){var e=qe;i.__c=i.__(),qe=e}function m0(i,e){return!i||i.length!==e.length||e.some(function(t,n){return t!==i[n]})}function g0(i,e){return typeof e=="function"?e(i):e}function g2(){return u("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},u("g",{fill:"none","fill-rule":"evenodd"},u("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),u("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"}),u("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"}),u("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"}),u("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"}),u("path",{d:"M4 4h18v18H4z"})))}function y2(i){let{pluginName:e,i18n:t,onAuth:n}=i,r=e==="Google Drive",o=Dn(s=>{s.preventDefault(),n()},[n]);return u("form",{onSubmit:o},r?u("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},u(g2,null),t("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var v2=i=>{let{pluginName:e,i18n:t,onAuth:n}=i;return u(y2,{pluginName:e,i18n:t,onAuth:n})};function Ba(i){let{loading:e,pluginName:t,pluginIcon:n,i18n:r,handleAuth:o,renderForm:s=v2}=i;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},n()),u("div",{className:"uppy-Provider-authTitle"},r("authenticateWithTitle",{pluginName:t})),s({pluginName:t,i18n:r,loading:e,onAuth:o}))}var y0=De(vt(),1);function Qd(i){let{i18n:e,logout:t,username:n}=i;return u(Ut,null,n&&u("span",{className:"uppy-ProviderBrowser-user",key:"username"},n),u("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function Zd(i){let{openFolder:e,title:t,breadcrumbsIcon:n,breadcrumbs:r,i18n:o}=i;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},n),r.map((s,a)=>{var l;return u(Ut,null,u("button",{key:s.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(s.id)},s.type==="root"?t:(l=s.data.name)!=null?l:o("unnamed")),r.length===a+1?"":" / ")}))}function Jd(i){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,y0.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&u(Zd,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),u(Qd,{logout:i.logout,username:i.username,i18n:i.i18n})))}function eu(){return eu=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},eu.apply(null,arguments)}var b2={position:"relative",width:"100%",minHeight:"100%"},_2={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},tu=class extends Ot{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let P=e,{data:t,rowHeight:n,renderRow:r,overscanCount:o=10}=P,s=Ln(P,["data","rowHeight","renderRow","overscanCount"]),{offset:a,height:l}=this.state,c=Math.floor(a/n),d=Math.floor(l/n);o&&(c=Math.max(0,c-c%o),d+=o);let p=c+d+4,g=t.slice(c,p),h=D(v({},b2),{height:t.length*n}),_=D(v({},_2),{top:c*n});return u("div",eu({onScroll:this.handleScroll},s),u("div",{role:"presentation",style:h},u("div",{role:"presentation",style:_},g.map(r))))}},Na=tu;var v0=De(vt(),1);function w2(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},u("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 x2(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},u("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 C2(){return u("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},u("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"}),u("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 xr(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return u(w2,null);case"folder":return u(x2,null);case"video":return u(C2,null);default:return u("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function S2(i){var e,t;let{file:n,toggleCheckbox:r,className:o,isDisabled:s,restrictionError:a,showTitles:l,children:c=null,i18n:d}=i;return u("li",{className:o,title:s&&a?a:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:r,name:"listitem",id:n.id,checked:n.status==="checked",disabled:s,"data-uppy-super-focusable":!0}),u("label",{htmlFor:n.id,"aria-label":(e=n.data.name)!=null?e:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u(xr,{itemIconString:n.data.thumbnail||n.data.icon}),l&&((t=n.data.name)!=null?t:d("unnamed")),c))}var iu=S2;function nu(i){var e,t,n;let{file:r,openFolder:o,className:s,isDisabled:a,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:p}=i;return u("li",{className:s,title:r.status!=="checked"&&l?l:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:c,name:"listitem",id:r.id,checked:r.status==="checked","aria-label":r.data.isFolder?p("allFilesFromFolderNamed",{name:(e=r.data.name)!=null?e:p("unnamed")}):null,disabled:a,"data-uppy-super-focusable":!0}),r.data.isFolder?u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>o(r.id),"aria-label":p("openFolderNamed",{name:(t=r.data.name)!=null?t:p("unnamed")})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(xr,{itemIconString:r.data.icon})),d&&r.data.name?u("span",null,r.data.name):p("unnamed")):u("label",{htmlFor:r.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(xr,{itemIconString:r.data.icon})),d&&((n=r.data.name)!=null?n:p("unnamed"))))}function ru(i){let{viewType:e,toggleCheckbox:t,showTitles:n,i18n:r,openFolder:o,file:s,utmSource:a}=i,l=s.type==="folder"?null:s.restrictionError,c=!!l&&s.status!=="checked",d={file:s,openFolder:o,toggleCheckbox:t,utmSource:a,i18n:r,viewType:e,showTitles:n,className:(0,v0.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":c},{"uppy-ProviderBrowserItem--noPreview":s.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":s.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":s.status==="partial"}),isDisabled:c,restrictionError:l};switch(e){case"grid":return u(iu,d);case"list":return u(nu,d);case"unsplash":return u(iu,d,u("a",{href:`${s.data.author.url}?utm_source=${a}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},s.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function P2(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:n,handleScroll:r,showTitles:o,i18n:s,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d,utmSource:p}=i,[g,h]=pi(!1);if(Pi(()=>{let P=M=>{M.key==="Shift"&&h(!1)},z=M=>{M.key==="Shift"&&h(!0)};return document.addEventListener("keyup",P),document.addEventListener("keydown",z),()=>{document.removeEventListener("keyup",P),document.removeEventListener("keydown",z)}},[]),a)return u("div",{className:"uppy-Provider-loading"},typeof a=="string"?a:s("loading"));if(e.length===0)return u("div",{className:"uppy-Provider-empty"},c);let _=P=>u(ru,{viewType:t,toggleCheckbox:z=>{var M;z.stopPropagation(),z.preventDefault(),(M=document.getSelection())==null||M.removeAllRanges(),n(P,g)},showTitles:o,i18n:s,openFolder:l,file:P,utmSource:p});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(Na,{data:e,renderRow:_,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:r,role:"listbox",tabIndex:-1},e.map(_)))}var za=P2;var E2=(i,e,t,n,r)=>{let o=e.filter(h=>h.isFolder===!0),s=e.filter(h=>h.isFolder===!1),a=t.type==="folder"&&t.status==="checked",l=o.map(h=>({type:"folder",id:h.requestPath,cached:!1,nextPagePath:null,status:a?"checked":"unchecked",parentId:t.id,data:h})),c=s.map(h=>{let _=r(h);return{type:"file",id:h.requestPath,restrictionError:_,status:a&&!_?"checked":"unchecked",parentId:t.id,data:h}}),d=D(v({},t),{cached:!0,nextPagePath:n});return[...i.map(h=>h.id===d.id?d:h),...l,...c]},b0=E2;var D2=(i,e,t,n,r)=>{let o=i.find(_=>_.id===e),s=t.filter(_=>_.isFolder===!0),a=t.filter(_=>_.isFolder===!1),l=D(v({},o),{nextPagePath:n}),c=i.map(_=>_.id===l.id?l:_),d=l.type==="folder"&&l.status==="checked",p=s.map(_=>({type:"folder",id:_.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:_})),g=a.map(_=>{let P=r(_);return{type:"file",id:_.requestPath,restrictionError:P,status:d&&!P?"checked":"unchecked",parentId:l.id,data:_}});return[...c,...p,...g]},_0=D2;var k2=i=>i.map(e=>v({},e)),La=k2;var ou=(i,e,t)=>{i.filter(r=>r.type!=="root"&&r.parentId===e).forEach(r=>{r.status=t&&!(r.type==="file"&&r.restrictionError)?"checked":"unchecked",ou(i,r.id,t)})},su=(i,e)=>{let t=i.find(s=>s.id===e);if(t.type==="root")return;let n=i.filter(s=>s.type!=="root"&&s.parentId===t.id&&!(s.type==="file"&&s.restrictionError)),r=n.every(s=>s.status==="checked"),o=n.every(s=>s.status==="unchecked");r?t.status="checked":o?t.status="unchecked":t.status="partial",su(i,t.parentId)},T2=(i,e)=>{let t=La(i);if(e.length>=2){let n=t.filter(r=>r.type!=="root"&&e.includes(r.id));n.forEach(r=>{r.type==="file"?r.status=r.restrictionError?"unchecked":"checked":r.status="checked"}),n.forEach(r=>{ou(t,r.id,!0)}),su(t,n[0].parentId)}else{let n=t.find(r=>r.id===e[0]);n.status=n.status==="checked"?"unchecked":"checked",ou(t,n.id,n.status==="checked"),su(t,n.parentId)}return t},w0=T2;var lu=De(C0(),1);var Lo=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},cu=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},S0=i=>globalThis.DOMException===void 0?new cu(i):new DOMException(i),P0=i=>{let e=i.reason===void 0?S0("This operation was aborted."):i.reason;return e instanceof Error?e:S0(e)};function du(i,e){let{milliseconds:t,fallback:n,message:r,customTimers:o={setTimeout,clearTimeout}}=e,s,a,c=new Promise((d,p)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:h}=e;h.aborted&&p(P0(h)),a=()=>{p(P0(h))},h.addEventListener("abort",a,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(d,p);return}let g=new Lo;s=o.setTimeout.call(void 0,()=>{if(n){try{d(n())}catch(h){p(h)}return}typeof i.cancel=="function"&&i.cancel(),r===!1?d():r instanceof Error?p(r):(g.message=r??`Promise timed out after ${t} milliseconds`,p(g))},t),B(this,null,function*(){try{d(yield i)}catch(h){p(h)}})}).finally(()=>{c.clear(),a&&e.signal&&e.signal.removeEventListener("abort",a)});return c.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},c}function uu(i,e,t){let n=0,r=i.length;for(;r>0;){let o=Math.trunc(r/2),s=n+o;t(i[s],e)<=0?(n=++s,r-=o+1):r=o}return n}var ja=class{#e=[];enqueue(e,t){t=v({priority:0},t);let n={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(n);return}let r=uu(this.#e,n,(o,s)=>s.priority-o.priority);this.#e.splice(r,0,n)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var Va=class extends lu.default{#e;#s;#o=0;#h;#a;#f=0;#i;#l;#t;#m;#n=0;#c;#r;#g;timeout;constructor(e){if(super(),e=v({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:ja},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#s=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#h=e.intervalCap,this.#a=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#r=e.autoStart===!1}get#b(){return this.#s||this.#o<this.#h}get#_(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#x(){this.#v(),this.#y(),this.#l=void 0}get#C(){let e=Date.now();if(this.#i===void 0){let t=this.#f-e;if(t<0)this.#o=this.#e?this.#n:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#x()},t)),!0}return!1}#d(){if(this.#t.size===0)return this.#i&&clearInterval(this.#i),this.#i=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#r){let e=!this.#C;if(this.#b&&this.#_){let t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#s||this.#i!==void 0||(this.#i=setInterval(()=>{this.#v()},this.#a),this.#f=Date.now()+this.#a)}#v(){this.#o===0&&this.#n===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#o=this.#e?this.#n:0,this.#u()}#u(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#c=e,this.#u()}#S(e){return B(this,null,function*(){return new Promise((t,n)=>{e.addEventListener("abort",()=>{n(e.reason)},{once:!0})})})}add(n){return B(this,arguments,function*(e,t={}){return t=v({timeout:this.timeout,throwOnTimeout:this.#g},t),new Promise((r,o)=>{this.#t.enqueue(()=>B(this,null,function*(){this.#n++,this.#o++;try{t.signal?.throwIfAborted();let s=e({signal:t.signal});t.timeout&&(s=du(Promise.resolve(s),{milliseconds:t.timeout})),t.signal&&(s=Promise.race([s,this.#S(t.signal)]));let a=yield s;r(a),this.emit("completed",a)}catch(s){if(s instanceof Lo&&!t.throwOnTimeout){r();return}o(s),this.emit("error",s)}finally{this.#w()}}),t),this.emit("add"),this.#d()})})}addAll(e,t){return B(this,null,function*(){return Promise.all(e.map(n=>B(this,null,function*(){return this.add(n,t)})))})}start(){return this.#r?(this.#r=!1,this.#u(),this):this}pause(){this.#r=!0}clear(){this.#t=new this.#m}onEmpty(){return B(this,null,function*(){this.#t.size!==0&&(yield this.#p("empty"))})}onSizeLessThan(e){return B(this,null,function*(){this.#t.size<e||(yield this.#p("next",()=>this.#t.size<e))})}onIdle(){return B(this,null,function*(){this.#n===0&&this.#t.size===0||(yield this.#p("idle"))})}#p(e,t){return B(this,null,function*(){return new Promise(n=>{let r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)})})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#n}get isPaused(){return this.#r}};var E0=(i,e,t,n,r)=>B(void 0,null,function*(){let o=[],s=t.cached?t.nextPagePath:t.id;for(;s;){let p=yield n(s);o=o.concat(p.items),s=p.nextPagePath}let a=o.filter(p=>p.isFolder===!0),l=o.filter(p=>p.isFolder===!1),c=a.map(p=>({type:"folder",id:p.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:p})),d=l.map(p=>{let g=r(p);return{type:"file",id:p.requestPath,restrictionError:g,status:g?"unchecked":"checked",parentId:t.id,data:p}});t.cached=!0,t.nextPagePath=null,e.push(...d,...c),c.forEach(p=>B(void 0,null,function*(){i.add(()=>E0(i,e,p,n,r))}))}),F2=(i,e,t,n)=>B(void 0,null,function*(){let r=new Va({concurrency:6}),o=La(i);return o.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{r.add(()=>E0(r,o,a,e,t))}),r.on("completed",()=>{let a=o.filter(l=>l.type==="file"&&l.status==="checked").length;n(a)}),yield r.onIdle(),o}),D0=F2;var kn={afterOpenFolder:b0,afterScrollFolder:_0,afterToggleCheckbox:w0,afterFill:D0};var R2=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:n}=i.target;return e-(t+n)<50},Ua=R2;var M2=i=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){i.log("Aborting request","warning");return}i.log(e,"error"),e.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(e.message)},"warning",5e3)}},Li=M2;var A2=(i,e,t,n)=>{let r=e.findIndex(o=>o.id===n);if(r!==-1&&t){let o=e.findIndex(a=>a.id===i);return e.slice(Math.min(r,o),Math.max(r,o)+1).map(a=>a.id)}return[i]},Wa=A2;function B2(i){let{searchString:e,setSearchString:t,submitSearchString:n,wrapperClassName:r,inputClassName:o,inputLabel:s,clearSearchLabel:a="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=i,p=_=>{t(_.target.value)},g=Dn(_=>{_.preventDefault(),n()},[n]),[h]=pi(()=>{let _=document.createElement("form");return _.setAttribute("tabindex","-1"),_.id=nn(),_});return Pi(()=>(document.body.appendChild(h),h.addEventListener("submit",g),()=>{h.removeEventListener("submit",g),document.body.removeChild(h)}),[h,g]),u("section",{className:r},u("input",{className:`uppy-u-reset ${o}`,type:"search","aria-label":s,placeholder:s,value:e,onInput:p,form:h.id,"data-uppy-super-focusable":!0}),!l&&u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},u("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&e&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t("")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},u("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&&u("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:h.id},c))}var Cr=B2;var T0=De(vt(),1);var N2=i=>i.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!i.some(r=>r.type!=="root"&&r.parentId===t.id):!1).length,k0=N2;function Ho(i){let{cancelSelection:e,donePicking:t,i18n:n,partialTree:r,validateAggregateRestrictions:o}=i,s=En(()=>o(r),[r,o]),a=En(()=>k0(r),[r]);return a===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,T0.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":s}),disabled:!!s,onClick:t,type:"button"},n("selectX",{smart_count:a})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},n("cancel"))),s&&u("div",{className:"uppy-ProviderBrowser-footer-error"},s))}var z2=(i,e,t)=>{var n,r;return{id:i.id,source:e.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(n=i.author)==null?void 0:n.name,authorUrl:(r=i.author)==null?void 0:r.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},I0=z2;var L2=(i,e,t)=>{let n=i.map(s=>I0(s,e,t)),r=[],o=[];n.forEach(s=>{e.uppy.checkIfFileAlreadyExists(ua(s,e.uppy.getID()))?o.push(s):r.push(s)}),r.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:r.length})),o.length>0&&e.uppy.info(`Not adding ${o.length} files because they already exist`),e.uppy.addFiles(r)},$a=L2;var O0=(i,e,t)=>{let n=e===null?"null":e;if(t[n])return t[n];let r=i.find(s=>s.id===e);if(r.type==="root")return[];let o=[...O0(i,r.parentId,t),r];return t[n]=o,o},H2=i=>{let e=Object.create(null);return i.filter(r=>r.type==="file"&&r.status==="checked").map(r=>{let o=O0(i,r.id,e),s=o.findIndex(d=>d.type==="folder"&&d.status==="checked"),a=o.slice(s),l=`/${o.map(d=>d.data.name).join("/")}`,c=a.length===1?void 0:a.map(d=>d.data.name).join("/");return D(v({},r.data),{absDirPath:l,relDirPath:c})})},qa=H2;var j2=(i,e)=>{let t=i.find(r=>r.id===e),n=[];for(;n=[t,...n],t.type!=="root";){let r=t.parentId;t=i.find(o=>o.id===r)}return n},F0=j2;function on(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var V2=0;function M0(i){return"__private_"+V2+++"_"+i}var U2={version:"4.4.1"};function Vo(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},u("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 R0=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),Tn=M0("abortController"),hi=M0("withAbort"),jo=class{constructor(e,t){Object.defineProperty(this,hi,{value:W2}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,Tn,{writable:!0,value:void 0}),this.validateSingleFile=r=>{let o=Ao(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r,currentFolderId:o,searchString:s}=this.plugin.getPluginState(),a=r.filter(c=>c.type!=="root"&&c.parentId===o);return s===""?a:a.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(s.toLowerCase())!==-1})},this.validateAggregateRestrictions=r=>{let s=r.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(s)},this.plugin=e,this.provider=t.provider;let n={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=v(v({},n),t),this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(R0(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(n=>n.type==="root"?n:D(v({},n),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}openFolder(e){return B(this,null,function*(){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),n=t.find(r=>r.id===e);if(n.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),yield on(this,hi)[hi](r=>B(this,null,function*(){let o=e,s=[];do{let{username:l,nextPagePath:c,items:d}=yield this.provider.list(o,{signal:r});this.plugin.setPluginState({username:l}),o=c,s=s.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:s.length}))}while(this.opts.loadAllFiles&&o);let a=kn.afterOpenFolder(t,s,n,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})})).catch(Li(this.plugin.uppy)),this.setLoading(!1)})}logout(){return B(this,null,function*(){yield on(this,hi)[hi](e=>B(this,null,function*(){let t=yield this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let n=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(n,"info",7e3)}this.plugin.setPluginState(D(v({},R0(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(Li(this.plugin.uppy))})}handleAuth(e){return B(this,null,function*(){yield on(this,hi)[hi](t=>B(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(Li(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(e){return B(this,null,function*(){let{partialTree:t,currentFolderId:n}=this.plugin.getPluginState(),r=t.find(o=>o.id===n);Ua(e)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,yield on(this,hi)[hi](o=>B(this,null,function*(){let{nextPagePath:s,items:a}=yield this.provider.list(r.nextPagePath,{signal:o}),l=kn.afterScrollFolder(t,n,a,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(Li(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return B(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),yield on(this,hi)[hi](t=>B(this,null,function*(){let n=yield kn.afterFill(e,s=>this.provider.list(s,{signal:t}),this.validateSingleFile,s=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:s}))});if(this.validateAggregateRestrictions(n)){this.plugin.setPluginState({partialTree:n});return}let o=qa(n);$a(o,this.plugin,this.provider),this.resetPluginState()})).catch(Li(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(e,t){let{partialTree:n}=this.plugin.getPluginState(),r=Wa(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),o=kn.afterToggleCheckbox(n,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:n}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;n||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let o=v(v({},this.opts),t),{authenticated:s,loading:a}=this.plugin.getPluginState(),l=this.plugin.icon||Vo;if(s===!1)return u(Ba,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:o.renderAuthForm,loading:a});let{partialTree:c,currentFolderId:d,username:p,searchString:g}=this.plugin.getPluginState(),h=F0(c,d);return u("div",{className:(0,A0.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`)},u(Jd,{showBreadcrumbs:o.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:h,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:p,i18n:r}),o.showFilter&&u(Cr,{searchString:g,setSearchString:_=>{this.plugin.setPluginState({searchString:_})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(za,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:o.virtualList,noResultsLabel:r("noFilesFound"),handleScroll:this.handleScroll,viewType:o.viewType,showTitles:o.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a,utmSource:"Companion"}),u(Ho,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function W2(i){return B(this,null,function*(){var e;(e=on(this,Tn)[Tn])==null||e.abort();let t=new AbortController;on(this,Tn)[Tn]=t;let n=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",n),this.plugin.uppy.on("cancel-all",n),yield i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",n),this.plugin.uppy.off("cancel-all",n),on(this,Tn)[Tn]=void 0}})}jo.VERSION=U2.version;var B0=De(vt(),1);var $2={version:"4.4.1"},q2={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},G2={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},Sr=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=n=>{let r=Ao(n);return this.plugin.uppy.validateSingleFile(r)},this.getDisplayedPartialTree=()=>{let{partialTree:n}=this.plugin.getPluginState();return n.filter(r=>r.type!=="root")},this.setSearchString=n=>{this.plugin.setPluginState({searchString:n}),n===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=n=>{let o=n.filter(s=>s.type==="file"&&s.status==="checked").map(s=>s.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=e,this.provider=t.provider,this.opts=v(v({},G2),t),this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(q2)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(n=>n.type==="root"?n:D(v({},n),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}search(){return B(this,null,function*(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=yield this.provider.search(e),n=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(r=>({type:"file",id:r.requestPath,status:"unchecked",parentId:null,data:r}))];this.plugin.setPluginState({partialTree:n,isInputMode:!1})}catch(t){Li(this.plugin.uppy)(t)}this.setLoading(!1)}})}handleScroll(e){return B(this,null,function*(){let{partialTree:t,searchString:n}=this.plugin.getPluginState(),r=t.find(o=>o.type==="root");if(Ua(e)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let o=yield this.provider.search(n,r.nextPagePath),s=D(v({},r),{nextPagePath:o.nextPageQuery}),a=t.filter(c=>c.type!=="root"),l=[s,...a,...o.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(o){Li(this.plugin.uppy)(o)}this.isHandlingScroll=!1}})}donePicking(){return B(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState(),t=qa(e);$a(t,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(e,t){let{partialTree:n}=this.plugin.getPluginState(),r=Wa(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),o=kn.afterToggleCheckbox(n,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:n,searchString:r,loading:o,partialTree:s}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,l=v(v({},this.opts),t);return n?u(Cr,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):u("div",{className:(0,B0.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(Cr,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(za,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>B(this,null,function*(){}),noResultsLabel:a("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:o,i18n:a,virtualList:!1,utmSource:this.opts.utmSource}),u(Ho,{partialTree:s,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};Sr.VERSION=$2.version;var N0=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function X2(i,e){return!!(i===e||N0(i)&&N0(e))}function Y2(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!X2(i[t],e[t]))return!1;return!0}function pu(i,e){e===void 0&&(e=Y2);var t=null;function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t&&t.lastThis===this&&e(r,t.lastArgs))return t.lastResult;var s=i.apply(this,r);return t={lastResult:s,lastArgs:r,lastThis:this},s}return n.clear=function(){t=null},n}var Ga=['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 Uo(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function z0(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function K2(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function Q2(i){return i.contains(document.activeElement)}function hu(i,e,t){let n=Uo(t,e),r=Si(n.querySelectorAll(Ga)),o=r.indexOf(document.activeElement);Q2(n)?i.shiftKey&&o===0?K2(i,r):!i.shiftKey&&o===r.length-1&&z0(i,r):z0(i,r)}function L0(i,e,t){e===null||hu(i,e,t)}var H0=De(id(),1);function fu(){let i=!1;return(0,H0.default)((t,n)=>{let r=Uo(t,n),o=r.contains(document.activeElement);if(o&&i)return;let s=r.querySelector("[data-uppy-super-focusable]");if(!(o&&!s))if(s)s.focus({preventScroll:!0}),i=!0;else{let a=r.querySelector(Ga);a?.focus({preventScroll:!0}),i=!1}},260)}var ry=De(vt(),1);function Wo(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var W0=De(vt(),1);function j0(i,e){if(i===e)return!0;if(!i||!e)return!1;let t=Object.keys(i),n=Object.keys(e),r=t.length;if(n.length!==r)return!1;for(let o=0;o<r;o++){let s=t[o];if(i[s]!==e[s]||!Object.prototype.hasOwnProperty.call(e,s))return!1}return!0}function J2(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#686DE0",fillRule:"evenodd"},u("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"}),u("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"}),u("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function eE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("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 tE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("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 iE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("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 nE(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("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 rE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#A7AFB7",fillRule:"nonzero"},u("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"}),u("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function oE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("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 In(i){let e={color:"#838999",icon:rE()};if(!i)return e;let t=i.split("/")[0],n=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:oE()}:t==="image"?{color:"#686de0",icon:J2()}:t==="audio"?{color:"#068dbb",icon:eE()}:t==="video"?{color:"#19af67",icon:tE()}:t==="application"&&n==="pdf"?{color:"#e25149",icon:iE()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(n)!==-1?{color:"#00C469",icon:nE()}:e}function $o(i){let{file:e}=i;if(e.preview)return u("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:n}=In(e.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},n),u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},u("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var sE=(i,e)=>(typeof e=="function"?e():e).filter(r=>r.id===i)[0].name;function qo(i){let{file:e,toggleFileCard:t,i18n:n,metaFields:r}=i,{missingRequiredMetaFields:o}=e;if(!(o!=null&&o.length))return null;let s=o.map(a=>sE(a,r)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},n("missingRequiredMetaFields",{smart_count:o.length,fields:s})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},n("editFile")))}function mu(i){let{file:e,i18n:t,toggleFileCard:n,metaFields:r,showLinkToFileUploadResult:o}=i,a=e.preview?"rgba(255, 255, 255, 0.5)":In(e.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a}},o&&e.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},u("span",{hidden:!0},e.meta.name)),u($o,{file:e}),u(qo,{file:e,i18n:t,toggleFileCard:n,metaFields:r}))}function aE(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 V0(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 gu(i){return u("div",{className:"uppy-Dashboard-Item-progress"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":V0(i),title:V0(i),onClick:()=>aE(i)},i.children))}function Xa(i){let{children:e}=i;return u("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function yu(i){let{progress:e}=i,t=2*Math.PI*15;return u("g",null,u("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),u("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e}))}function vu(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(Xa,null,u("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),u("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?u(gu,i,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},u("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),u("path",{d:"M7.9 3H10v2H7.9z"}),u("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),u("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?u(gu,i,u(Xa,null,u(yu,{progress:i.file.progress.percentage}),i.file.isPaused?u("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):u("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},u("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),u("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?u(gu,i,u(Xa,null,u(yu,{progress:i.file.progress.percentage}),u("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"}))):u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(Xa,null,u(yu,{progress:i.file.progress.percentage}))))}var U0=De(ao(),1);var bu="...";function Ya(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=bu.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-bu.length,n=Math.ceil(t/2),r=Math.floor(t/2);return i.slice(0,n)+bu+i.slice(-r)}var lE=i=>{let{author:e,name:t}=i.file.meta;function n(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:t},Ya(t,n()))},cE=i=>{var e;let{author:t}=i.file.meta,n=(e=i.file.remote)==null?void 0:e.providerName,r="\xB7";return t?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Ya(t.name,13)),n?u(Fragment,null,` ${r} `,n,` ${r} `):null):null},dE=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,U0.default)(i.file.size)),uE=i=>i.file.isGhost&&u("span",null," \u2022 ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),pE=i=>{let{file:e,onClick:t}=i;return e.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function _u(i){let{file:e,i18n:t,toggleFileCard:n,metaFields:r,toggleAddFilesPanel:o,isSingleFile:s,containerHeight:a,containerWidth:l}=i;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},u("div",{className:"uppy-Dashboard-Item-fileName"},lE({file:e,isSingleFile:s,containerHeight:a,containerWidth:l}),u(pE,{file:e,onClick:()=>alert(e.error)})),u("div",{className:"uppy-Dashboard-Item-status"},cE({file:e}),dE({file:e}),uE({file:e,toggleAddFilesPanel:o,i18n:t})),u(qo,{file:e,i18n:t,toggleFileCard:n,metaFields:r}))}function wu(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let n=document.createElement("textarea");n.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),n.value=i,document.body.appendChild(n),n.select();let r=()=>{document.body.removeChild(n),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(n),t()):r()}catch{return document.body.removeChild(n),r()}})}function hE(i){let{file:e,uploadInProgressOrComplete:t,metaFields:n,canEditFile:r,i18n:o,onClick:s}=i;return!t&&n&&n.length>0||!t&&r(e)?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFileWithFilename",{file:e.meta.name}),title:o("editFileWithFilename",{file:e.meta.name}),onClick:()=>s()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},u("g",{fillRule:"evenodd"},u("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"}),u("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),u("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function fE(i){let{i18n:e,onClick:t,file:n}=i;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:n.meta.name}),title:e("removeFile",{file:n.meta.name}),onClick:()=>t()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},u("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"}),u("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 mE(i){let{file:e,uppy:t,i18n:n}=i,r=o=>{wu(e.uploadURL,n("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>o.target.focus({preventScroll:!0}))};return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":n("copyLink"),title:n("copyLink"),onClick:o=>r(o)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},u("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 xu(i){let{uppy:e,file:t,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,showLinkToFileUploadResult:s,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(hE,{i18n:l,file:t,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,onClick:()=>{o&&o.length>0?c(!0,t.id):d(t)}}),s&&t.uploadURL?u(mE,{file:t,uppy:e,i18n:l}):null,a?u(fE,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var Ka=class extends Ot{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!j0(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,n=!!e.progress.uploadComplete&&!t&&!e.error,r=!!e.progress.uploadStarted||!!t,o=e.progress.uploadStarted&&!e.progress.uploadComplete||t,s=e.error||!1,{isGhost:a}=e,l=(this.props.individualCancellation||!o)&&!n;n&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,W0.default)({"uppy-Dashboard-Item":!0,"is-inprogress":o&&!this.props.recoveredState,"is-processing":t,"is-complete":n,"is-error":!!s,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return u("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u(mu,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(vu,{uppy:this.props.uppy,file:e,error:s,isUploaded:n,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})),u("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},u(_u,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),u(xu,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function gE(i,e){let t=[],n=[];return i.forEach(r=>{n.length<e?n.push(r):(t.push(n),n=[r])}),n.length&&t.push(n),t}function Cu(i){let{id:e,i18n:t,uppy:n,files:r,resumableUploads:o,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,isSingleFile:g,toggleFileCard:h,handleRequestThumbnail:_,handleCancelThumbnail:P,recoveredState:z,individualCancellation:M,itemsPerRow:W,openFileEditor:de,canEditFile:oe,toggleAddFilesPanel:ee,containerWidth:b,containerHeight:w}=i,S=W===1?71:200,A=En(()=>{let K=(Ne,Pe)=>Number(r[Pe].isGhost)-Number(r[Ne].isGhost),ve=Object.keys(r);return z&&ve.sort(K),gE(ve,W)},[r,W,z]),L=K=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:K[0]},K.map(ve=>u(Ka,{key:ve,uppy:n,id:e,i18n:t,resumableUploads:o,individualCancellation:M,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,recoveredState:z,isSingleFile:g,containerWidth:b,containerHeight:w,toggleFileCard:h,handleRequestThumbnail:_,handleCancelThumbnail:P,role:"listitem",openFileEditor:de,canEditFile:oe,toggleAddFilesPanel:ee,file:r[ve]})));return g?u("div",{class:"uppy-Dashboard-files"},L(A[0])):u(Na,{class:"uppy-Dashboard-files",role:"list",data:A,renderRow:L,rowHeight:S})}var Su=class extends Ot{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var n;return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(n=this.props.allowedFileTypes)==null?void 0:n.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,n)=>{let o={photo:"image/*",video:"video/*"}[e];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:o,ref:n})},this.renderMyDeviceAcquirer=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},u("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},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("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"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},u("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},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("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"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},u("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},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},u("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 "}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let n=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":n===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),n=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,o=r.charAt(0).toUpperCase()+r.slice(1);return u("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${o}`,{browseFiles:t,browseFolders:n,browse:t}):this.props.i18nArray(`dropPaste${o}`,{browseFiles:t,browseFolders:n,browse:t}))},this.renderAcquirer=e=>{var t;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},u("div",{className:"uppy-DashboardTab-inner"},e.icon()),u("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],n=t.splice(e.length-2,e.length);return u(Ut,null,t.map(r=>this.renderAcquirer(r)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},n.map(r=>this.renderAcquirer(r))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:n,showNativeVideoCameraButton:r}=this.props,o=[],s="myDevice";t||o.push({key:s,elements:this.renderMyDeviceAcquirer()}),n&&o.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&o.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),o.push(...e.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),o.length===1&&o[0].key===s&&(o=[]);let l=[...o],c=l.splice(o.length-2,o.length);return u(Ut,null,this.renderDropPasteBrowseTagline(o.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(d=>{let{key:p,elements:g}=d;return u(Ut,{key:p},g)}),u("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:p,elements:g}=d;return u(Ut,{key:p},g)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=u("span",null,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),u("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),n=e("poweredBy",{uppy:t});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},n)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:n}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,r=>{this.fileInput=r}),this.renderHiddenInput(!0,r=>{this.folderInput=r}),e&&this.renderHiddenCameraInput("photo",n,r=>{this.mobilePhotoFileInput=r}),t&&this.renderHiddenCameraInput("video",n,r=>{this.mobileVideoFileInput=r}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),u("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&u("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},Qa=Su;var $0=De(vt(),1);var yE=i=>u("div",{className:(0,$0.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),u(Qa,i)),q0=yE;var G0=De(vt(),1);function vE(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ei=vE;function bE(i){let{activePickerPanel:e,className:t,hideAllPanels:n,i18n:r,state:o,uppy:s}=i,a=Pn(null);return u("div",{className:(0,G0.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Ei,onDragLeave:Ei,onDrop:Ei,onPaste:Ei},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:e.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:n},r("cancel"))),u("div",{ref:a,className:"uppy-DashboardContent-panelBody"},s.getPlugin(e.id).render(o,a.current)))}var X0=bE;var Y0=De(vt(),1);function _E(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return u("div",{className:(0,Y0.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(n=>i.uppy.getPlugin(n.id).render(i.state))))}var K0=_E;var Di={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function wE(i,e,t,n){if(n===void 0&&(n={}),i)return Di.STATE_ERROR;if(e)return Di.STATE_COMPLETE;if(t)return Di.STATE_PAUSED;let r=Di.STATE_WAITING,o=Object.keys(n);for(let s=0;s<o.length;s++){let{progress:a}=n[o[s]];if(a.uploadStarted&&!a.uploadComplete)return Di.STATE_UPLOADING;a.preprocess&&r!==Di.STATE_UPLOADING&&(r=Di.STATE_PREPROCESSING),a.postprocess&&r!==Di.STATE_UPLOADING&&r!==Di.STATE_PREPROCESSING&&(r=Di.STATE_POSTPROCESSING)}return r}function xE(i){let{files:e,i18n:t,isAllComplete:n,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:s,newFiles:a,processingFiles:l}=i;switch(wE(r,n,o,e)){case"uploading":return t("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function CE(i){let{i18n:e,isAllComplete:t,hideCancelButton:n,maxNumberOfFiles:r,toggleAddFilesPanel:o,uppy:s}=i,{allowNewUpload:a}=i;return a&&r&&(a=i.totalFileCount<i.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!t&&!n?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>s.cancelAll()},e("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(xE,i)),a?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>o(!0)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},u("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"})),u("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):u("div",null))}var Q0=CE;var Z0=De(vt(),1);function Pu(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:n,form:r,formState:o}=i,s={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{let l=`uppy-Dashboard-FileCard-input-${a.id}`,c=t.includes(a.id);return u("fieldset",{key:a.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},a.name),a.render!==void 0?a.render({value:o[a.id],onChange:d=>n(d,a.id),fieldCSSClasses:s,required:c,form:r.id},u):u("input",{className:s.text,id:l,form:r.id,type:a.type||"text",required:c,value:o[a.id],placeholder:a.placeholder,onInput:d=>n(d.target.value,a.id),"data-uppy-super-focusable":!0}))})}function Eu(i){var e;let{files:t,fileCardFor:n,toggleFileCard:r,saveFileCard:o,metaFields:s,requiredMetaFields:a,openFileEditor:l,i18n:c,i18nArray:d,className:p,canEditFile:g}=i,h=()=>typeof s=="function"?s(t[n]):s,_=t[n],P=(e=h())!=null?e:[],z=g(_),M={};P.forEach(S=>{var A;M[S.id]=(A=_.meta[S.id])!=null?A:""});let[W,de]=pi(M),oe=Dn(S=>{S.preventDefault(),o(W,n)},[o,W,n]),ee=(S,A)=>{de(D(v({},W),{[A]:S}))},b=()=>{r(!1)},[w]=pi(()=>{let S=document.createElement("form");return S.setAttribute("tabindex","-1"),S.id=nn(),S});return Pi(()=>(document.body.appendChild(w),w.addEventListener("submit",oe),()=>{w.removeEventListener("submit",oe),document.body.removeChild(w)}),[w,oe]),u("div",{className:(0,Z0.default)("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:Ei,onDragLeave:Ei,onDrop:Ei,onPaste:Ei},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},_.meta?_.meta.name:_.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:w.id,title:c("finishEditingFile"),onClick:b},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:In(_.type).color}},u($o,{file:_}),z&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:S=>{oe(S),l(_)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(Pu,{computedMetaFields:P,requiredMetaFields:a,updateMeta:ee,form:w,formState:W})),u("div",{className:"uppy-Dashboard-FileCard-actions"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:w.id},c("saveChanges")),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:b,form:w.id},c("cancel")))))}var ey=De(vt(),1),Pr="uppy-transition-slideDownUp",J0=250;function SE(i){let{children:e}=i,[t,n]=pi(null),[r,o]=pi(""),s=Pn(),a=Pn(),l=Pn(),c=()=>{o(`${Pr}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{o(`${Pr}-enter ${Pr}-enter-active`),s.current=setTimeout(()=>{o("")},J0)})},d=()=>{o(`${Pr}-leave`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{o(`${Pr}-leave ${Pr}-leave-active`),a.current=setTimeout(()=>{n(null),o("")},J0)})};return Pi(()=>{let p=Ci(e)[0];t!==p&&(p&&!t?c():t&&!p&&!a.current&&d(),n(p))},[e,t]),Pi(()=>()=>{clearTimeout(s.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),t?va(t,{className:(0,ey.default)(r,t.props.className)}):null}var Go=SE;function Er(){return Er=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Er.apply(null,arguments)}var ty=900,iy=700,Du=576,ny=330;function ku(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,n=i.containerWidth>Du,r=i.containerHeight>ny,o=(0,ry.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>Du,"uppy-size--lg":i.containerWidth>iy,"uppy-size--xl":i.containerWidth>ty,"uppy-size--height-md":i.containerHeight>ny,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&r}),s=1;i.containerWidth>ty?s=5:i.containerWidth>iy?s=4:i.containerWidth>Du&&(s=3);let a=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(g=>i.files[g].isGhost).length:0,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return u("div",{className:o,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Wo(),"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},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),u("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:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},u("span",{"aria-hidden":"true"},"\xD7")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),a&&u(Q0,i),l&&u("div",{className:"uppy-Dashboard-serviceMsg"},u("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},u("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},u("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"}),u("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),u("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),u("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),a?u(Cu,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:s,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):u(Qa,{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}),u(Go,null,i.showAddFilesPanel?u(q0,Er({key:"AddFiles"},i,{isSizeMD:n})):null),u(Go,null,i.fileCardFor?u(Eu,Er({key:"FileCard"},i)):null),u(Go,null,i.activePickerPanel?u(X0,Er({key:"Picker"},i)):null),u(Go,null,i.showFileEditor?u(K0,Er({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(g=>i.uppy.getPlugin(g.id).render(i.state))))))}var oy={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 we(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var PE=0;function pt(i){return"__private_"+PE+++"_"+i}var EE={version:"4.3.1"},Tu=pu.default||pu,sy=9,DE=27;function ay(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var kE={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Vo,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},On=pt("disabledNodes"),Hi=pt("generateLargeThumbnailIfSingleFile"),Xo=pt("openFileEditorWhenFilesAdded"),Fn=pt("attachRenderFunctionToTarget"),Iu=pt("isTargetSupported"),Ou=pt("getAcquirers"),Fu=pt("getProgressIndicators"),ji=pt("getEditors"),Ru=pt("addSpecifiedPluginsFromOptions"),Mu=pt("autoDiscoverPlugins"),Rn=pt("addSupportedPluginIfNoTarget"),Yo=pt("getStatusBarOpts"),Ko=pt("getThumbnailGeneratorOpts"),Au=pt("getInformerOpts"),Qo=pt("getStatusBarId"),Zo=pt("getThumbnailGeneratorId"),Bu=pt("getInformerId"),Mn=class extends Wt{constructor(e,t){var n,r,o;let s=(n=t?.autoOpen)!=null?n:null;super(e,D(v(v({},kE),t),{autoOpen:s})),Object.defineProperty(this,Bu,{value:ME}),Object.defineProperty(this,Zo,{value:RE}),Object.defineProperty(this,Qo,{value:FE}),Object.defineProperty(this,Au,{value:OE}),Object.defineProperty(this,Ko,{value:IE}),Object.defineProperty(this,Yo,{value:TE}),Object.defineProperty(this,On,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${nn()}`,this.superFocus=fu(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=a=>{let c=this.getPluginState().targets.filter(d=>d.id!==a.id);this.setPluginState({targets:c})},this.addTarget=a=>{let l=a.id||a.constructor.name,c=a.title||l,d=a.type;if(d!=="acquirer"&&d!=="progressindicator"&&d!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let p={id:l,name:c,type:d},h=this.getPluginState().targets.slice();return h.push(p),this.setPluginState({targets:h}),this.el},this.hideAllPanels=()=>{var a;let l=this.getPluginState(),c={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===c.activePickerPanel&&l.showAddFilesPanel===c.showAddFilesPanel&&l.showFileEditor===c.showFileEditor&&l.activeOverlayType===c.activeOverlayType||(this.setPluginState(c),this.uppy.emit("dashboard:close-panel",(a=l.activePickerPanel)==null?void 0:a.id))},this.showPanel=a=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===a);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",a)},this.canEditFile=a=>{let{targets:l}=this.getPluginState();return we(this,ji)[ji](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),c=we(this,ji)[ji](l);this.setPluginState({showFileEditor:!0,fileCardFor:a.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(a)})},this.closeFileEditor=()=>{let{metaFields:a}=this.getPluginState();a&&a.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:a}=this.getPluginState();we(this,ji)[ji](a).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=ay();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 c=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",c,!1),l()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),a},this.closeModal=a=>{var l;let c=(l=a?.manualClose)!=null?l:!0,{isHidden:d,isClosing:p}=this.getPluginState();if(d||p)return;let{promise:g,resolve:h}=ay();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let P=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",P,!1),h()};this.el.addEventListener("animationend",P,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),h();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var _;(_=history.state)!=null&&_[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),g},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=a=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:D(v({},l),{darkMode:a})})},this.handleSystemDarkModeChange=a=>{let l=a.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(a,l)=>{let c=this.uppy.getFile(l);a?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:a?l:null,activeOverlayType:a?"FileCard":null})},this.toggleAddFilesPanel=a=>{this.setPluginState({showAddFilesPanel:a,activeOverlayType:a?"AddFiles":null})},this.addFiles=a=>{let l=a.map(c=>({source:this.id,name:c.name,type:c.type,data:c,meta:{relativePath:c.relativePath||c.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(c){this.uppy.log(c)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(a=>{let l=a[0],{width:c,height:d}=l.contentRect;this.setPluginState({containerWidth:c,containerHeight:d,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let a=this.getPluginState(),l=!this.opts.inline&&a.isHidden;!a.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=a=>{this.el.contains(a.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=a=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=we(this,On)[On])!=null?l:Si(this.el.querySelectorAll(c)).filter(p=>!p.classList.contains("uppy-Dashboard-close"));for(let p of d)p.tagName==="A"?p.setAttribute("aria-disabled",a):p.disabled=a;a?we(this,On)[On]=d:we(this,On)[On]=null,this.dashboardIsDisabled=a},this.updateBrowserHistory=()=>{var a;(a=history.state)!=null&&a[this.modalName]||history.pushState(D(v({},history.state),{[this.modalName]:!0}),""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=a=>{var l;this.isModalOpen()&&(!a.state||!a.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=a.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=a=>{a.keyCode===DE&&this.requestCloseModal(),a.keyCode===sy&&hu(a,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=a=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(a))});let l=Si(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=Si(a.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=a=>{a.preventDefault(),a.stopPropagation();let l=()=>{let g=!0;return this.uppy.iteratePlugins(h=>{h.canHandleRootDrop!=null&&h.canHandleRootDrop(a)&&(g=!0)}),g},c=()=>{let{types:g}=a.dataTransfer;return g.some(h=>h==="Files")},d=l(),p=c();if(!d&&!p||this.opts.disabled||this.opts.disableLocalFiles&&(p||!d)||!this.uppy.getState().allowNewUpload){a.dataTransfer.dropEffect="none";return}a.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(a)},this.handleDragLeave=a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(a)},this.handleDrop=a=>B(this,null,function*(){a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(p=>{p.type==="acquirer"&&(p.handleRootDrop==null||p.handleRootDrop(a))});let l=!1,c=p=>{this.uppy.log(p,"error"),l||(this.uppy.info(p.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let d=yield Mo(a.dataTransfer,{logDropError:c});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),this.opts.onDrop(a)}),this.handleRequestThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",a)},this.handleCancelThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",a)},this.handleKeyDownInInline=a=>{a.keyCode===sy&&L0(a,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=a=>{this.el.contains(document.activeElement)&&this.handlePaste(a)},this.handleComplete=a=>{let{failed:l}=a;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Hi,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let a=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:a});let d=D(v({},l[0]),{preview:void 0});c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,Xo,{writable:!0,value:a=>{let l=a[0],{metaFields:c}=this.getPluginState(),d=c&&c.length>0,p=this.canEditFile(l);d&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):p&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let a=$d(this.opts.trigger);a?a.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",we(this,Rn)[Rn]),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",we(this,Hi)[Hi]),this.uppy.on("file-removed",we(this,Hi)[Hi]),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",we(this,Xo)[Xo])},this.removeEvents=()=>{let a=$d(this.opts.trigger);!this.opts.inline&&a&&a.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",we(this,Rn)[Rn]),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",we(this,Hi)[Hi]),this.uppy.off("file-removed",we(this,Hi)[Hi]),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",we(this,Xo)[Xo])},this.superFocusOnEachUpdate=()=>{let a=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,c=this.uppy.getState().info.length===0,d=!this.opts.inline;c&&(d||a||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=(a,l)=>{this.uppy.setFileMeta(l,a),this.toggleFileCard(!1,l)},Object.defineProperty(this,Fn,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return D(v({},a),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,Iu,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,Ou,{writable:!0,value:Tu(a=>a.filter(l=>l.type==="acquirer"&&we(this,Iu)[Iu](l)).map(we(this,Fn)[Fn]))}),Object.defineProperty(this,Fu,{writable:!0,value:Tu(a=>a.filter(l=>l.type==="progressindicator").map(we(this,Fn)[Fn]))}),Object.defineProperty(this,ji,{writable:!0,value:Tu(a=>a.filter(l=>l.type==="editor").map(we(this,Fn)[Fn]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:p}=a,{newFiles:g,uploadStartedFiles:h,completeFiles:_,erroredFiles:P,inProgressFiles:z,inProgressNotPausedFiles:M,processingFiles:W,isUploadStarted:de,isAllComplete:oe,isAllPaused:ee}=this.uppy.getObjectOfFilesPerState(),b=we(this,Ou)[Ou](l.targets),w=we(this,Fu)[Fu](l.targets),S=we(this,ji)[ji](l.targets),A;return this.opts.theme==="auto"?A=d.darkMode?"dark":"light":A=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}".`)),ku({state:a,isHidden:l.isHidden,files:c,newFiles:g,uploadStartedFiles:h,completeFiles:_,erroredFiles:P,inProgressFiles:z,inProgressNotPausedFiles:M,processingFiles:W,isUploadStarted:de,isAllComplete:oe,isAllPaused:ee,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:p,acquirers:b,theme:A,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:w,editors:S,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:a.recoveredState,metaFields:l.metaFields,resumableUploads:d.resumableUploads||!1,individualCancellation:d.individualCancellation,isMobileDevice:d.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,Ru,{writable:!0,value:()=>{let{plugins:a}=this.opts;a.forEach(l=>{let c=this.uppy.getPlugin(l);c?c.mount(this,c):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,Mu,{writable:!0,value:()=>{this.uppy.iteratePlugins(we(this,Rn)[Rn])}}),Object.defineProperty(this,Rn,{writable:!0,value:a=>{var l;let c=["acquirer","editor"];a&&!((l=a.opts)!=null&&l.target)&&c.includes(a.type)&&(this.getPluginState().targets.some(p=>a.id===p.id)||a.mount(this,a))}}),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:a,closeAfterFinish:l}=this.opts;if(a&&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:c,allowMultipleUploadBatches:d}=this.uppy.opts;(c||d)&&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:p}=this.opts;p&&this.mount(p,this),this.opts.disableStatusBar||this.uppy.use(_n,v({id:we(this,Qo)[Qo](),target:this},we(this,Yo)[Yo]())),this.opts.disableInformer||this.uppy.use(wn,v({id:we(this,Bu)[Bu](),target:this},we(this,Au)[Au]())),this.opts.disableThumbnailGenerator||this.uppy.use(wr,v({id:we(this,Zo)[Zo]()},we(this,Ko)[Ko]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let g=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${g?"on":"off"}`),this.setDarkModeCapability(g),this.opts.theme==="auto"){var h;(h=this.darkModeMediaQuery)==null||h.addListener(this.handleSystemDarkModeChange)}we(this,Ru)[Ru](),we(this,Mu)[Mu](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let c=this.uppy.getPlugin(`${this.id}:Informer`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableStatusBar){let c=this.uppy.getPlugin(`${this.id}:StatusBar`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableThumbnailGenerator){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c&&this.uppy.removePlugin(c)}let{plugins:a}=this.opts;if(a.forEach(c=>{let d=this.uppy.getPlugin(c);d&&d.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=oy,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(o=(r=this.opts).onRequestCloseModal)!=null||(r.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,n;super.setOptions(e),(t=this.uppy.getPlugin(we(this,Qo)[Qo]()))==null||t.setOptions(we(this,Yo)[Yo]()),(n=this.uppy.getPlugin(we(this,Zo)[Zo]()))==null||n.setOptions(we(this,Ko)[Ko]())}};function TE(){let{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:n,showProgressDetails:r,hideProgressAfterFinish:o,locale:s,doneButtonHandler:a}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:n,showProgressDetails:r,hideAfterFinish:o,locale:s,doneButtonHandler:a}}function IE(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:n}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:n,lazy:!n}}function OE(){return{}}function FE(){return`${this.id}:StatusBar`}function RE(){return`${this.id}:ThumbnailGenerator`}function ME(){return`${this.id}:Informer`}Mn.VERSION=EE.version;var AE={version:"4.2.1"},BE={fixed:!1,hideAfterFinish:!0},Dr=class extends Wt{constructor(e,t){super(e,v(v({},BE),t)),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){let{totalProgress:t}=e,n=(t===0||t===100)&&this.opts.hideAfterFinish;return u("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},u("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),u("div",{className:"uppy-ProgressBar-percentage"},t))}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};Dr.VERSION=AE.version;var ly={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var NE={version:"4.1.1"},zE={inputName:"files[]",width:"100%",height:"100%"},kr=class i extends Wt{constructor(e,t){super(e,v(v({},zE),t)),this.isDragDropSupported=Wo(),this.addFiles=n=>{let r=n.map(o=>({source:this.id,name:o.name,type:o.type,data:o,meta:{relativePath:o.relativePath||null}}));try{this.uppy.addFiles(r)}catch(o){this.uppy.log(o)}},this.onInputChange=n=>{let r=Si(n.currentTarget.files||[]);r.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(r)),n.currentTarget.value=""},this.handleDragOver=n=>{var r,o;n.preventDefault(),n.stopPropagation();let{types:s}=n.dataTransfer,a=s.some(c=>c==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!a||!l){n.dataTransfer.dropEffect="none";return}n.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(r=(o=this.opts).onDragOver)==null||r.call(o,n)},this.handleDragLeave=n=>{var r,o;n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(r=(o=this.opts).onDragLeave)==null||r.call(o,n)},this.handleDrop=n=>B(this,null,function*(){var r,o;n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1});let s=l=>{this.uppy.log(l,"error")},a=yield Mo(n.dataTransfer,{logDropError:s});a.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(a)),(r=(o=this.opts).onDrop)==null||r.call(o,n)}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=ly,this.i18nInit()}renderHiddenFileInput(){var e;let{restrictions:t}=this.uppy.opts;return u("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:n=>{this.fileInputRef=n},name:this.opts.inputName,multiple:t.maxNumberOfFiles!==1,accept:(e=t.allowedFileTypes)==null?void 0:e.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},u("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return u("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:u("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return u("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){let e=`uppy-u-reset
25
+ ${r.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};wn.VERSION=GP.version;var XP=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function YP(i,e,t){var n,r;let o=XP.exec(i),s=(n=(r=e.mimeType)!=null?r:o?.[1])!=null?n:"plain/text",a;if(o?.[2]!=null){let l=atob(decodeURIComponent(o[3])),c=new Uint8Array(l.length);for(let d=0;d<l.length;d++)c[d]=l.charCodeAt(d);a=[c]}else o?.[3]!=null&&(a=[decodeURIComponent(o[3])]);return t?new File(a,e.name||"",{type:s}):new Blob(a,{type:s})}var Hg=YP;function Pa(i){return i.startsWith("blob:")}function Ea(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function Ee(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Yg=typeof self<"u"?self:global,Eo=typeof navigator<"u",KP=Eo&&typeof HTMLImageElement>"u",jg=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Kg=Yg.Buffer,Qg=!!Kg,QP=i=>i!==void 0;function Zg(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(QP).length===0)}function ot(i){let e=new Error(i);throw delete e.stack,e}function Vg(i){let e=function(t){let n=0;return t.ifd0.enabled&&(n+=1024),t.exif.enabled&&(n+=2048),t.makerNote&&(n+=2048),t.userComment&&(n+=1024),t.gps.enabled&&(n+=512),t.interop.enabled&&(n+=100),t.ifd1.enabled&&(n+=1024),n+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}var Fd=i=>String.fromCharCode.apply(null,i),Ug=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,Cn=class i{static from(e,t){return e instanceof this&&e.le===t?e:new i(e,void 0,void 0,t)}constructor(e,t=0,n,r){if(typeof r=="boolean"&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){n===void 0&&(n=e.byteLength-t);let o=new DataView(e,t,n);this._swapDataView(o)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof i){n===void 0&&(n=e.byteLength-t),(t+=e.byteOffset)+n>e.byteOffset+e.byteLength&&ot("Creating view outside of available memory in ArrayBuffer");let o=new DataView(e.buffer,t,n);this._swapDataView(o)}else if(typeof e=="number"){let o=new DataView(new ArrayBuffer(e));this._swapDataView(o)}else ot("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,n=i){return e instanceof DataView||e instanceof i?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||ot("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new n(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new i(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return r=this.getUint8Array(e,t),Ug?Ug.decode(r):Qg?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(Fd(r)));var r}getLatin1String(e=0,t=this.byteLength){let n=this.getUint8Array(e,t);return Fd(n)}getUnicodeString(e=0,t=this.byteLength){let n=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)n.push(this.getUint16(e+r));return Fd(n)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,n){switch(t){case 1:return this.getUint8(e,n);case 2:return this.getUint16(e,n);case 4:return this.getUint32(e,n);case 8:return this.getUint64&&this.getUint64(e,n)}}getUint(e,t,n){switch(t){case 8:return this.getUint8(e,n);case 16:return this.getUint16(e,n);case 32:return this.getUint32(e,n);case 64:return this.getUint64&&this.getUint64(e,n)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function Md(i,e){ot(`${i} '${e}' was not loaded, try using full build of exifr.`)}var Do=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||Md(this.kind,e),t&&(e in t||function(n,r){ot(`Unknown ${n} '${r}'.`)}(this.kind,e),t[e].enabled||Md(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},Oa=new Do("file parser"),Xt=new Do("segment parser"),Io=new Do("file reader"),ZP=Yg.fetch;function Wg(i,e){return(t=i).startsWith("data:")||t.length>1e4?Bd(i,e,"base64"):jg&&i.includes("://")?Ad(i,e,"url",Da):jg?Bd(i,e,"fs"):Eo?Ad(i,e,"url",Da):void ot("Invalid input argument");var t}function Ad(i,e,t,n){return B(this,null,function*(){return Io.has(t)?Bd(i,e,t):n?function(r,o){return B(this,null,function*(){let s=yield o(r);return new Cn(s)})}(i,n):void ot(`Parser ${t} is not loaded`)})}function Bd(i,e,t){return B(this,null,function*(){let n=new(Io.get(t))(i,e);return yield n.read(),n})}var Da=i=>ZP(i).then(e=>e.arrayBuffer()),ko=i=>new Promise((e,t)=>{let n=new FileReader;n.onloadend=()=>e(n.result||new ArrayBuffer),n.onerror=t,n.readAsArrayBuffer(i)}),Nd=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 Jg(i,e,t){let n=new Nd;for(let[r,o]of t)n.set(r,o);if(Array.isArray(e))for(let r of e)i.set(r,n);else i.set(e,n);return n}function e0(i,e,t){let n,r=i.get(e);for(n of t)r.set(n[0],n[1])}var Oo=new Map,Vd=new Map,Ud=new Map,gr=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Fa=["jfif","xmp","icc","iptc","ihdr"],To=["tiff",...Fa],Ye=["ifd0","ifd1","exif","gps","interop"],yr=[...To,...Ye],vr=["makerNote","userComment"],Ra=["translateKeys","translateValues","reviveValues","multiSegment"],br=[...Ra,"sanitize","mergeOutput","silentErrors"],ka=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},xn=class extends ka{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,n,r){if(super(),Ee(this,"enabled",!1),Ee(this,"skip",new Set),Ee(this,"pick",new Set),Ee(this,"deps",new Set),Ee(this,"translateKeys",!1),Ee(this,"translateValues",!1),Ee(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=Ye.includes(e),this.canBeFiltered&&(this.dict=Oo.get(e)),n!==void 0)if(Array.isArray(n))this.parse=this.enabled=!0,this.canBeFiltered&&n.length>0&&this.translateTagSet(n,this.pick);else if(typeof n=="object"){if(this.enabled=!0,this.parse=n.parse!==!1,this.canBeFiltered){let{pick:o,skip:s}=n;o&&o.length>0&&this.translateTagSet(o,this.pick),s&&s.length>0&&this.translateTagSet(s,this.skip)}this.applyInheritables(n)}else n===!0||n===!1?this.parse=this.enabled=n:ot(`Invalid options argument: ${n}`)}applyInheritables(e){let t,n;for(t of Ra)n=e[t],n!==void 0&&(this[t]=n)}translateTagSet(e,t){if(this.dict){let n,r,{tagKeys:o,tagValues:s}=this.dict;for(n of e)typeof n=="string"?(r=s.indexOf(n),r===-1&&(r=o.indexOf(Number(n))),r!==-1&&t.add(Number(o[r]))):t.add(n)}else for(let n of e)t.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ta(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ta(this.pick,this.deps)}},bt={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},$g=new Map,Sn=class extends ka{static useCached(e){let t=$g.get(e);return t!==void 0||(t=new this(e),$g.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):ot(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Eo?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of gr)this[e]=bt[e];for(e of br)this[e]=bt[e];for(e of vr)this[e]=bt[e];for(e of yr)this[e]=new xn(e,bt[e],void 0,this)}setupFromTrue(){let e;for(e of gr)this[e]=bt[e];for(e of br)this[e]=bt[e];for(e of vr)this[e]=!0;for(e of yr)this[e]=new xn(e,!0,void 0,this)}setupFromArray(e){let t;for(t of gr)this[t]=bt[t];for(t of br)this[t]=bt[t];for(t of vr)this[t]=bt[t];for(t of yr)this[t]=new xn(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ye)}setupFromObject(e){let t;for(t of(Ye.ifd0=Ye.ifd0||Ye.image,Ye.ifd1=Ye.ifd1||Ye.thumbnail,Object.assign(this,e),gr))this[t]=Rd(e[t],bt[t]);for(t of br)this[t]=Rd(e[t],bt[t]);for(t of vr)this[t]=Rd(e[t],bt[t]);for(t of To)this[t]=new xn(t,bt[t],e[t],this);for(t of Ye)this[t]=new xn(t,bt[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ye,yr),e.tiff===!0?this.batchEnableWithBool(Ye,!0):e.tiff===!1?this.batchEnableWithUserValue(Ye,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ye):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ye)}batchEnableWithBool(e,t){for(let n of e)this[n].enabled=t}batchEnableWithUserValue(e,t){for(let n of e){let r=t[n];this[n].enabled=r!==!1&&r!==void 0}}setupGlobalFilters(e,t,n,r=n){if(e&&e.length){for(let s of r)this[s].enabled=!1;let o=qg(e,n);for(let[s,a]of o)Ta(this[s].pick,a),this[s].enabled=!0}else if(t&&t.length){let o=qg(t,n);for(let[s,a]of o)Ta(this[s].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:n,iptc:r,icc:o}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),n.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),o.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:n,interop:r}=this;r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),n.needed&&e.deps.add(34853),this.tiff.enabled=Ye.some(o=>this[o].enabled===!0)||this.makerNote||this.userComment;for(let o of Ye)this[o].finalizeFilters()}get onlyTiff(){return!Fa.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of To)this[e].enabled&&!Xt.has(e)&&Md("segment parser",e)}};function qg(i,e){let t,n,r,o,s=[];for(r of e){for(o of(t=Oo.get(r),n=[],t))(i.includes(o[0])||i.includes(o[1]))&&n.push(o[0]);n.length&&s.push([r,n])}return s}function Rd(i,e){return i!==void 0?i:e!==void 0?e:void 0}function Ta(i,e){for(let t of e)i.add(t)}Ee(Sn,"default",bt);var _r=class{constructor(e){Ee(this,"parsers",{}),Ee(this,"output",{}),Ee(this,"errors",[]),Ee(this,"pushToErrors",t=>this.errors.push(t)),this.options=Sn.useCached(e)}read(e){return B(this,null,function*(){this.file=yield function(t,n){return typeof t=="string"?Wg(t,n):Eo&&!KP&&t instanceof HTMLImageElement?Wg(t.src,n):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Cn(t):Eo&&t instanceof Blob?Ad(t,n,"blob",ko):void ot("Invalid input argument")}(e,this.options)})}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[n,r]of Oa)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[n]=!0;this.file.close&&this.file.close(),ot("Unknown file format")}parse(){return B(this,null,function*(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(yield this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):yield this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),Zg(n=e)?void 0:n;var n})}executeParsers(){return B(this,null,function*(){let{output:e}=this;yield this.fileParser.parse();let t=Object.values(this.parsers).map(n=>B(this,null,function*(){let r=yield n.parse();n.assignToOutput(e,r)}));this.options.silentErrors&&(t=t.map(n=>n.catch(this.pushToErrors))),yield Promise.all(t)})}extractThumbnail(){return B(this,null,function*(){this.setup();let{options:e,file:t}=this,n=Xt.get("tiff",e);var r;if(t.tiff?r={start:0,type:"tiff"}:t.jpeg&&(r=yield this.fileParser.getOrFindSegment("tiff")),r===void 0)return;let o=yield this.fileParser.ensureSegmentChunk(r),s=this.parsers.tiff=new n(o,e,t),a=yield s.extractThumbnail();return t.close&&t.close(),a})}};function t0(i,e){return B(this,null,function*(){let t=new _r(e);return yield t.read(i),t.parse()})}var JP=Object.freeze({__proto__:null,parse:t0,Exifr:_r,fileParsers:Oa,segmentParsers:Xt,fileReaders:Io,tagKeys:Oo,tagValues:Vd,tagRevivers:Ud,createDictionary:Jg,extendDictionary:e0,fetchUrlAsArrayBuffer:Da,readBlobAsArrayBuffer:ko,chunkedProps:gr,otherSegments:Fa,segments:To,tiffBlocks:Ye,segmentsAndBlocks:yr,tiffExtractables:vr,inheritables:Ra,allFormatters:br,Options:Sn}),rn=class{static findPosition(e,t){let n=e.getUint16(t+2)+2,r=typeof this.headerLength=="function"?this.headerLength(e,t,n):this.headerLength,o=t+r,s=n-r;return{offset:t,length:n,headerLength:r,start:o,size:s,end:o+s}}static parse(e,t={}){return new this(e,new Sn({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Cn?e:new Cn(e)}constructor(e,t={},n){Ee(this,"errors",[]),Ee(this,"raw",new Map),Ee(this,"handleError",r=>{if(!this.options.silentErrors)throw r;this.errors.push(r.message)}),this.chunk=this.normalizeInput(e),this.file=n,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let n=Ud.get(t),r=Vd.get(t),o=Oo.get(t),s=this.options[t],a=s.reviveValues&&!!n,l=s.translateValues&&!!r,c=s.translateKeys&&!!o,d={};for(let[u,g]of e)a&&n.has(u)?g=n.get(u)(g):l&&r.has(u)&&(g=this.translateValue(g,r.get(u))),c&&o.has(u)&&(u=o.get(u)||u),d[u]=g;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,n){if(this.globalOptions.mergeOutput)return Object.assign(e,n);e[t]?Object.assign(e[t],n):e[t]=n}};Ee(rn,"headerLength",4),Ee(rn,"type",void 0),Ee(rn,"multiSegment",!1),Ee(rn,"canHandle",()=>!1);function e2(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function t2(i){return i>=224&&i<=239}function i2(i,e,t){for(let[n,r]of Xt)if(r.canHandle(i,e,t))return n}var Ia=class extends class{constructor(e,t,n){Ee(this,"errors",[]),Ee(this,"ensureSegmentChunk",r=>B(this,null,function*(){let o=r.start,s=r.size||65536;if(this.file.chunked)if(this.file.available(o,s))r.chunk=this.file.subarray(o,s);else try{r.chunk=yield this.file.readChunk(o,s)}catch(a){ot(`Couldn't read segment: ${JSON.stringify(r)}. ${a.message}`)}else this.file.byteLength>o+s?r.chunk=this.file.subarray(o,s):r.size===void 0?r.chunk=this.file.subarray(o):ot("Segment unreachable: "+JSON.stringify(r));return r.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=n}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let n=new(Xt.get(e))(t,this.options,this.file);return this.parsers[e]=n}createParsers(e){for(let t of e){let{type:n,chunk:r}=t,o=this.options[n];if(o&&o.enabled){let s=this.parsers[n];s&&s.append||s||this.createParser(n,r)}}}readSegments(e){return B(this,null,function*(){let t=e.map(this.ensureSegmentChunk);yield Promise.all(t)})}}{constructor(...e){super(...e),Ee(this,"appSegments",[]),Ee(this,"jpegSegments",[]),Ee(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}parse(){return B(this,null,function*(){yield this.findAppSegments(),yield this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)})}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Xt.keyList())):(e=e===void 0?Xt.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&Xt.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}findAppSegments(e=0,t){return B(this,null,function*(){this.setupSegmentFinderArgs(t);let{file:n,findAll:r,wanted:o,remaining:s}=this;if(!r&&this.file.chunked&&(r=Array.from(o).some(a=>{let l=Xt.get(a),c=this.options[a];return l.multiSegment&&c.multiSegment}),r&&(yield this.file.readWhole())),e=this.findAppSegmentsInRange(e,n.byteLength),!this.options.onlyTiff&&n.chunked){let a=!1;for(;s.size>0&&!a&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=n,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(a=e>l&&!c?!(yield n.readNextChunk(e)):!(yield n.readNextChunk(l)),(e=this.findAppSegmentsInRange(e,n.byteLength))===void 0)return}}})}findAppSegmentsInRange(e,t){t-=2;let n,r,o,s,a,l,{file:c,findAll:d,wanted:u,remaining:g,options:h}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(n=c.getUint8(e+1),t2(n)){if(r=c.getUint16(e+2),o=i2(c,e,r),o&&u.has(o)&&(s=Xt.get(o),a=s.findPosition(c,e),l=h[o],a.type=o,this.appSegments.push(a),!d&&(s.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||g.delete(o)):g.delete(o),g.size===0)))break;h.recordUnknownSegments&&(a=rn.findPosition(c,e),a.marker=n,this.unknownSegments.push(a)),e+=r+1}else if(e2(n)){if(r=c.getUint16(e+2),n===218&&h.stopAfterSos!==!1)return;h.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:n}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,n){let r,o,s,a=new Map;for(let l=0;l<t.length;l++)r=t[l],o=r[n],a.has(o)?s=a.get(o):a.set(o,s=[]),s.push(r);return Array.from(a)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,n])=>{let r=Xt.get(t,this.options);return r.handleMultiSegments?{type:t,chunk:r.handleMultiSegments(n)}:n[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}getOrFindSegment(e){return B(this,null,function*(){let t=this.getSegment(e);return t===void 0&&(yield this.findAppSegments(0,[e]),t=this.getSegment(e)),t})}};Ee(Ia,"type","jpeg"),Oa.set("jpeg",Ia);var n2=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Ld=class extends rn{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,n=new Map){let{pick:r,skip:o}=this.options[t];r=new Set(r);let s=r.size>0,a=o.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(e);if(s){if(r.has(d)&&(n.set(d,this.parseTag(e,d,t)),r.delete(d),r.size===0))break}else!a&&o.has(d)||n.set(d,this.parseTag(e,d,t));e+=12}return n}parseTag(e,t,n){let{chunk:r}=this,o=r.getUint16(e+2),s=r.getUint32(e+4),a=n2[o];if(a*s<=4?e+=8:e=r.getUint32(e+8),(o<1||o>13)&&ot(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${o}, offset ${e}`),e>r.byteLength&&ot(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${o}, offset ${e} is outside of chunk size ${r.byteLength}`),o===1)return r.getUint8Array(e,s);if(o===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=r.getString(e,s)).trim())===""?void 0:l;var l;if(o===7)return r.getUint8Array(e,s);if(s===1)return this.parseTagValue(o,e);{let c=new(function(u){switch(u){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}}(o))(s),d=a;for(let u=0;u<s;u++)c[u]=this.parseTagValue(o,e),e+=d;return c}}parseTagValue(e,t){let{chunk:n}=this;switch(e){case 1:return n.getUint8(t);case 3:return n.getUint16(t);case 4:return n.getUint32(t);case 5:return n.getUint32(t)/n.getUint32(t+4);case 6:return n.getInt8(t);case 8:return n.getInt16(t);case 9:return n.getInt32(t);case 10:return n.getInt32(t)/n.getInt32(t+4);case 11:return n.getFloat(t);case 12:return n.getDouble(t);case 13:return n.getUint32(t);default:ot(`Invalid tiff type ${e}`)}}},Po=class extends Ld{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}parse(){return B(this,null,function*(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&(yield this.parseIfd0Block()),e.exif.enabled&&(yield this.safeParse("parseExifBlock")),e.gps.enabled&&(yield this.safeParse("parseGpsBlock")),e.interop.enabled&&(yield this.safeParse("parseInteropBlock")),e.ifd1.enabled&&(yield this.safeParse("parseThumbnailBlock")),this.createOutput()})}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let n=new Map;return this[t]=n,this.parseTags(e,t,n),n}parseIfd0Block(){return B(this,null,function*(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&ot("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&ot(`IFD0 offset points to outside of file.
26
+ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&(yield e.ensureChunk(this.ifd0Offset,Vg(this.options)));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0})}parseExifBlock(){return B(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,Vg(this.options)));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e})}unpack(e,t){let n=e.get(t);n&&n.length===1&&e.set(t,n[0])}parseGpsBlock(){return B(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Gg(...e.get(2),e.get(1))),e.set("longitude",Gg(...e.get(4),e.get(3)))),e})}parseInteropBlock(){return B(this,null,function*(){if(!this.interop&&(this.ifd0||(yield this.parseIfd0Block()),this.interopOffset!==void 0||this.exif||(yield this.parseExifBlock()),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")})}parseThumbnailBlock(e=!1){return B(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return B(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,n,r={};for(t of Ye)if(e=this[t],!Zg(e))if(n=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(r,n)}else r[t]=n;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[n,r]of Object.entries(t))this.assignObjectToOutput(e,n,r)}};function Gg(i,e,t,n){var r=i+e/60+t/3600;return n!=="S"&&n!=="W"||(r*=-1),r}Ee(Po,"type","tiff"),Ee(Po,"headerLength",10),Xt.set("tiff",Po);var OR=Object.freeze({__proto__:null,default:JP,Exifr:_r,fileParsers:Oa,segmentParsers:Xt,fileReaders:Io,tagKeys:Oo,tagValues:Vd,tagRevivers:Ud,createDictionary:Jg,extendDictionary:e0,fetchUrlAsArrayBuffer:Da,readBlobAsArrayBuffer:ko,chunkedProps:gr,otherSegments:Fa,segments:To,tiffBlocks:Ye,segmentsAndBlocks:yr,tiffExtractables:vr,inheritables:Ra,allFormatters:br,Options:Sn,parse:t0}),Wd={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},FR=Object.assign({},Wd,{firstChunkSize:4e4,gps:[1,2,3,4]});var RR=Object.assign({},Wd,{tiff:!1,ifd1:!0,mergeOutput:!1});var r2=Object.assign({},Wd,{firstChunkSize:4e4,ifd0:[274]});function o2(i){return B(this,null,function*(){let e=new _r(r2);yield e.read(i);let t=yield e.parse();if(t&&t.ifd0)return t.ifd0[274]})}var s2=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}}),Co=!0,So=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,n]=e;Co=Number(t)+.1*Number(n)<13.4,So=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Co=So=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Co=So=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Co=So=Number(e)<77}}function i0(i){return B(this,null,function*(){let e=yield o2(i);return Object.assign({canvas:Co,css:So},s2[e])})}var zd=class extends Cn{constructor(...e){super(...e),Ee(this,"ranges",new Hd),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,n){if(e===0&&this.byteLength===0&&n){let r=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(r)}else{let r=e+t;if(r>this.byteLength){let{dataView:o}=this._extend(r);this._swapDataView(o)}}}_extend(e){let t;t=Qg?Kg.allocUnsafe(e):new Uint8Array(e);let n=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:n}}subarray(e,t,n=!1){return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,n=!1){n&&this._tryExtend(t,e.byteLength,e);let r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}ensureChunk(e,t){return B(this,null,function*(){this.chunked&&(this.ranges.available(e,t)||(yield this.readChunk(e,t)))})}available(e,t){return this.ranges.available(e,t)}},Hd=class{constructor(){Ee(this,"list",[])}get length(){return this.list.length}add(e,t,n=0){let r=e+t,o=this.list.filter(s=>Xg(e,s.offset,r)||Xg(e,s.end,r));if(o.length>0){e=Math.min(e,...o.map(a=>a.offset)),r=Math.max(r,...o.map(a=>a.end)),t=r-e;let s=o.shift();s.offset=e,s.length=t,s.end=r,this.list=this.list.filter(a=>!o.includes(a))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let n=e+t;return this.list.some(r=>r.offset<=e&&n<=r.end)}};function Xg(i,e,t){return i<=e&&e<=t}var jd=class extends zd{constructor(e,t){super(0),Ee(this,"chunksRead",0),this.input=e,this.options=t}readWhole(){return B(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return B(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return B(this,arguments,function*(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,n=yield this.readChunk(e,t);return!!n&&n.byteLength===t})}readChunk(e,t){return B(this,null,function*(){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)})}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};Io.set("blob",class extends jd{readWhole(){return B(this,null,function*(){this.chunked=!1;let i=yield ko(this.input);this._swapArrayBuffer(i)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(i,e){return B(this,null,function*(){let t=e?i+e:void 0,n=this.input.slice(i,t),r=yield ko(n);return this.set(r,i,!0)})}});var n0={strings:{generatingThumbnails:"Generating thumbnails..."}};var a2={version:"4.1.1"};function l2(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(n){if(n.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(n=>{i.toBlob(n,e,t)}).then(n=>{if(n===null)throw new Error("cannot read image, probably an svg with external resources");return n}):Promise.resolve().then(()=>Hg(i.toDataURL(e,t),{})).then(n=>{if(n===null)throw new Error("could not extract blob, probably an old browser");return n})}function c2(i,e){let t=i.width,n=i.height;(e.deg===90||e.deg===270)&&(t=i.height,n=i.width);let r=document.createElement("canvas");r.width=t,r.height=n;let o=r.getContext("2d");return o.translate(t/2,n/2),e.canvas&&(o.rotate(e.rad),o.scale(e.scaleX,e.scaleY)),o.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),r}function d2(i){let e=i.width/i.height,t=5e6,n=4096,r=Math.floor(Math.sqrt(t*e)),o=Math.floor(t/Math.sqrt(t*e));if(r>n&&(r=n,o=Math.round(r/e)),o>n&&(o=n,r=Math.round(e*o)),i.width>r){let s=document.createElement("canvas");return s.width=r,s.height=o,s.getContext("2d").drawImage(i,0,0,r,o),s}return i}var u2={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},wr=class extends $t{constructor(e,t){if(super(e,v(v({},u2),t)),this.onFileAdded=n=>{!n.preview&&n.data&&Ea(n.type)&&!n.isRemote&&this.addToQueue(n.id)},this.onCancelRequest=n=>{let r=this.queue.indexOf(n.id);r!==-1&&this.queue.splice(r,1)},this.onFileRemoved=n=>{let r=this.queue.indexOf(n.id);r!==-1&&this.queue.splice(r,1),n.preview&&Pa(n.preview)&&URL.revokeObjectURL(n.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(r=>r.isRestored).forEach(r=>{(!r.preview||Pa(r.preview))&&this.addToQueue(r.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=n=>{n.forEach(o=>{let s=this.uppy.getFile(o);this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let r=()=>{n.forEach(o=>{let s=this.uppy.getFile(o);this.uppy.emit("preprocess-complete",s)})};return new Promise(o=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{r(),o()}):(r(),o())})},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=n0,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,n){let r=URL.createObjectURL(e.data),o=new Promise((a,l)=>{let c=new Image;c.src=r,c.addEventListener("load",()=>{URL.revokeObjectURL(r),a(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(r),l(d.error||new Error("Could not create thumbnail"))})}),s=i0(e.data).catch(()=>1);return Promise.all([o,s]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,t,n,c.deg),u=c2(l,c),g=this.resizeImage(u,d.width,d.height);return l2(g,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,t,n,r){let o=e.width/e.height;return(r===90||r===270)&&(o=e.height/e.width),t!=null?{width:t,height:Math.round(t/o)}:n!=null?{width:Math.round(n*o),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/o)}}resizeImage(e,t,n){let r=d2(e),o=Math.ceil(Math.log2(r.width/t));o<1&&(o=1);let s=t*2**(o-1),a=n*2**(o-1),l=2;for(;o--;){let c=document.createElement("canvas");c.width=s,c.height=a,c.getContext("2d").drawImage(r,0,0,s,a),r=c,s=Math.round(s/l),a=Math.round(a/l)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return Ea(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};wr.VERSION=a2.version;function p2(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&vo(i)?[i]:null}var $d=p2;var Si=Array.from;function Ma(i,e,t,n){let{onSuccess:r}=n;i.readEntries(o=>{let s=[...e,...o];o.length?queueMicrotask(()=>{Ma(i,s,t,{onSuccess:r})}):r(s)},o=>{t(o),r(e)})}function r0(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((n,r)=>i.file(n,r))},values(){return es(this,null,function*(){let n=i.createReader(),r=yield new Hn(new Promise(o=>{Ma(n,[],e,{onSuccess:s=>o(s.map(a=>r0(a,e)))})}));yield*ts(r)})},isSameEntry:void 0}}function o0(i,e,t){try{return t===void 0&&(t=void 0),function(){return es(this,null,function*(){let n=()=>`${e}/${i.name}`;if(i.kind==="file"){let l=yield new Hn(i.getFile());l!=null?(l.relativePath=e?n():null,yield l):t!=null&&(yield t)}else if(i.kind==="directory")try{for(var r=is(i.values()),o,s,a;o=!(s=yield new Hn(r.next())).done;o=!1){let l=s.value;yield*ts(o0(l,e?n():i.name))}}catch{a=[s]}finally{try{o&&(s=r.return)&&(yield new Hn(s.call(r)))}finally{if(a)throw a[0]}}else t!=null&&(yield t)})}()}catch(n){return Promise.reject(n)}}function qd(i,e){return es(this,null,function*(){let t=yield new Hn(Promise.all(Array.from(i.items,n=>B(this,null,function*(){var r;let o,s=()=>typeof n.getAsEntry=="function"?n.getAsEntry():n.webkitGetAsEntry();return(r=o)!=null||(o=r0(s(),e)),{fileSystemHandle:o,lastResortFile:n.getAsFile()}}))));for(let{lastResortFile:n,fileSystemHandle:r}of t)if(r!=null)try{yield*ts(o0(r,"",n))}catch(o){n!=null?yield n:e(o)}else n!=null&&(yield n)})}function Gd(i){let e=Si(i.files);return Promise.resolve(e)}function Fo(i,e){return B(this,null,function*(){var t;let n=(t=e?.logDropError)!=null?t:Function.prototype;try{let l=[];try{for(var r=is(qd(i,n)),o,s,a;o=!(s=yield r.next()).done;o=!1){let c=s.value;l.push(c)}}catch{a=[s]}finally{try{o&&(s=r.return)&&(yield s.call(r))}finally{if(a)throw a[0]}}return l}catch{return Gd(i)}})}var A0=De(vt(),1);function Ro(i){return D(v({},i),{type:i.mimeType,extension:i.name?xi(i.name).extension:null})}var Mo,qe,Xd,s0,Ao=0,f0=[],Ke=Fe,a0=Ke.__b,l0=Ke.__r,c0=Ke.diffed,d0=Ke.__c,u0=Ke.unmount,p0=Ke.__;function Kd(i,e){Ke.__h&&Ke.__h(qe,i,Ao||e),Ao=0;var t=qe.__H||(qe.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function hi(i){return Ao=1,h2(g0,i)}function h2(i,e,t){var n=Kd(Mo++,2);if(n.t=i,!n.__c&&(n.__=[t?t(e):g0(void 0,e),function(a){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,a);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=qe,!qe.u)){var r=function(a,l,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(g){return!!g.__c});if(d.every(function(g){return!g.__N}))return!o||o.call(this,a,l,c);var u=n.__c.props!==a;return d.forEach(function(g){if(g.__N){var h=g.__[0];g.__=g.__N,g.__N=void 0,h!==g.__[0]&&(u=!0)}}),o&&o.call(this,a,l,c)||u};qe.u=!0;var o=qe.shouldComponentUpdate,s=qe.componentWillUpdate;qe.componentWillUpdate=function(a,l,c){if(this.__e){var d=o;o=void 0,r(a,l,c),o=d}s&&s.call(this,a,l,c)},qe.shouldComponentUpdate=r}return n.__N||n.__}function Pi(i,e){var t=Kd(Mo++,3);!Ke.__s&&m0(t.__H,e)&&(t.__=i,t.i=e,qe.__H.__h.push(t))}function Pn(i){return Ao=5,En(function(){return{current:i}},[])}function En(i,e){var t=Kd(Mo++,7);return m0(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Dn(i,e){return Ao=8,En(function(){return i},e)}function f2(){for(var i;i=f0.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Aa),i.__H.__h.forEach(Yd),i.__H.__h=[]}catch(e){i.__H.__h=[],Ke.__e(e,i.__v)}}Ke.__b=function(i){qe=null,a0&&a0(i)},Ke.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),p0&&p0(i,e)},Ke.__r=function(i){l0&&l0(i),Mo=0;var e=(qe=i.__c).__H;e&&(Xd===qe?(e.__h=[],qe.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0})):(e.__h.forEach(Aa),e.__h.forEach(Yd),e.__h=[],Mo=0)),Xd=qe},Ke.diffed=function(i){c0&&c0(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(f0.push(e)!==1&&s0===Ke.requestAnimationFrame||((s0=Ke.requestAnimationFrame)||m2)(f2)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.i=void 0})),Xd=qe=null},Ke.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Aa),t.__h=t.__h.filter(function(n){return!n.__||Yd(n)})}catch(n){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Ke.__e(n,t.__v)}}),d0&&d0(i,e)},Ke.unmount=function(i){u0&&u0(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{Aa(n)}catch(r){e=r}}),t.__H=void 0,e&&Ke.__e(e,t.__v))};var h0=typeof requestAnimationFrame=="function";function m2(i){var e,t=function(){clearTimeout(n),h0&&cancelAnimationFrame(e),setTimeout(i)},n=setTimeout(t,100);h0&&(e=requestAnimationFrame(t))}function Aa(i){var e=qe,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),qe=e}function Yd(i){var e=qe;i.__c=i.__(),qe=e}function m0(i,e){return!i||i.length!==e.length||e.some(function(t,n){return t!==i[n]})}function g0(i,e){return typeof e=="function"?e(i):e}function g2(){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 y2(i){let{pluginName:e,i18n:t,onAuth:n}=i,r=e==="Google Drive",o=Dn(s=>{s.preventDefault(),n()},[n]);return p("form",{onSubmit:o},r?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(g2,null),t("signInWithGoogle")):p("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var v2=i=>{let{pluginName:e,i18n:t,onAuth:n}=i;return p(y2,{pluginName:e,i18n:t,onAuth:n})};function Ba(i){let{loading:e,pluginName:t,pluginIcon:n,i18n:r,handleAuth:o,renderForm:s=v2}=i;return p("div",{className:"uppy-Provider-auth"},p("div",{className:"uppy-Provider-authIcon"},n()),p("div",{className:"uppy-Provider-authTitle"},r("authenticateWithTitle",{pluginName:t})),s({pluginName:t,i18n:r,loading:e,onAuth:o}))}var y0=De(vt(),1);function Qd(i){let{i18n:e,logout:t,username:n}=i;return p(Wt,null,n&&p("span",{className:"uppy-ProviderBrowser-user",key:"username"},n),p("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function Zd(i){let{openFolder:e,title:t,breadcrumbsIcon:n,breadcrumbs:r,i18n:o}=i;return p("div",{className:"uppy-Provider-breadcrumbs"},p("div",{className:"uppy-Provider-breadcrumbsIcon"},n),r.map((s,a)=>{var l;return p(Wt,null,p("button",{key:s.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(s.id)},s.type==="root"?t:(l=s.data.name)!=null?l:o("unnamed")),r.length===a+1?"":" / ")}))}function Jd(i){return p("div",{className:"uppy-ProviderBrowser-header"},p("div",{className:(0,y0.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&p(Zd,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),p(Qd,{logout:i.logout,username:i.username,i18n:i.i18n})))}function eu(){return eu=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},eu.apply(null,arguments)}var b2={position:"relative",width:"100%",minHeight:"100%"},_2={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},tu=class extends Ot{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let P=e,{data:t,rowHeight:n,renderRow:r,overscanCount:o=10}=P,s=zn(P,["data","rowHeight","renderRow","overscanCount"]),{offset:a,height:l}=this.state,c=Math.floor(a/n),d=Math.floor(l/n);o&&(c=Math.max(0,c-c%o),d+=o);let u=c+d+4,g=t.slice(c,u),h=D(v({},b2),{height:t.length*n}),_=D(v({},_2),{top:c*n});return p("div",eu({onScroll:this.handleScroll},s),p("div",{role:"presentation",style:h},p("div",{role:"presentation",style:_},g.map(r))))}},Na=tu;var v0=De(vt(),1);function w2(){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 x2(){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 C2(){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 xr(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return p(w2,null);case"folder":return p(x2,null);case"video":return p(C2,null);default:return p("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function S2(i){var e,t;let{file:n,toggleCheckbox:r,className:o,isDisabled:s,restrictionError:a,showTitles:l,children:c=null,i18n:d}=i;return p("li",{className:o,title:s&&a?a:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:r,name:"listitem",id:n.id,checked:n.status==="checked",disabled:s,"data-uppy-super-focusable":!0}),p("label",{htmlFor:n.id,"aria-label":(e=n.data.name)!=null?e:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p(xr,{itemIconString:n.data.thumbnail||n.data.icon}),l&&((t=n.data.name)!=null?t:d("unnamed")),c))}var iu=S2;function nu(i){var e,t,n;let{file:r,openFolder:o,className:s,isDisabled:a,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:u}=i;return p("li",{className:s,title:r.status!=="checked"&&l?l:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:c,name:"listitem",id:r.id,checked:r.status==="checked","aria-label":r.data.isFolder?u("allFilesFromFolderNamed",{name:(e=r.data.name)!=null?e:u("unnamed")}):null,disabled:a,"data-uppy-super-focusable":!0}),r.data.isFolder?p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>o(r.id),"aria-label":u("openFolderNamed",{name:(t=r.data.name)!=null?t:u("unnamed")})},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(xr,{itemIconString:r.data.icon})),d&&r.data.name?p("span",null,r.data.name):u("unnamed")):p("label",{htmlFor:r.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(xr,{itemIconString:r.data.icon})),d&&((n=r.data.name)!=null?n:u("unnamed"))))}function ru(i){let{viewType:e,toggleCheckbox:t,showTitles:n,i18n:r,openFolder:o,file:s,utmSource:a}=i,l=s.type==="folder"?null:s.restrictionError,c=!!l&&s.status!=="checked",d={file:s,openFolder:o,toggleCheckbox:t,utmSource:a,i18n:r,viewType:e,showTitles:n,className:(0,v0.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":c},{"uppy-ProviderBrowserItem--noPreview":s.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":s.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":s.status==="partial"}),isDisabled:c,restrictionError:l};switch(e){case"grid":return p(iu,d);case"list":return p(nu,d);case"unsplash":return p(iu,d,p("a",{href:`${s.data.author.url}?utm_source=${a}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},s.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function P2(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:n,handleScroll:r,showTitles:o,i18n:s,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d,utmSource:u}=i,[g,h]=hi(!1);if(Pi(()=>{let P=M=>{M.key==="Shift"&&h(!1)},L=M=>{M.key==="Shift"&&h(!0)};return document.addEventListener("keyup",P),document.addEventListener("keydown",L),()=>{document.removeEventListener("keyup",P),document.removeEventListener("keydown",L)}},[]),a)return p("div",{className:"uppy-Provider-loading"},typeof a=="string"?a:s("loading"));if(e.length===0)return p("div",{className:"uppy-Provider-empty"},c);let _=P=>p(ru,{viewType:t,toggleCheckbox:L=>{var M;L.stopPropagation(),L.preventDefault(),(M=document.getSelection())==null||M.removeAllRanges(),n(P,g)},showTitles:o,i18n:s,openFolder:l,file:P,utmSource:u});return d?p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list"},p(Na,{data:e,renderRow:_,rowHeight:31}))):p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list",onScroll:r,role:"listbox",tabIndex:-1},e.map(_)))}var La=P2;var E2=(i,e,t,n,r)=>{let o=e.filter(h=>h.isFolder===!0),s=e.filter(h=>h.isFolder===!1),a=t.type==="folder"&&t.status==="checked",l=o.map(h=>({type:"folder",id:h.requestPath,cached:!1,nextPagePath:null,status:a?"checked":"unchecked",parentId:t.id,data:h})),c=s.map(h=>{let _=r(h);return{type:"file",id:h.requestPath,restrictionError:_,status:a&&!_?"checked":"unchecked",parentId:t.id,data:h}}),d=D(v({},t),{cached:!0,nextPagePath:n});return[...i.map(h=>h.id===d.id?d:h),...l,...c]},b0=E2;var D2=(i,e,t,n,r)=>{let o=i.find(_=>_.id===e),s=t.filter(_=>_.isFolder===!0),a=t.filter(_=>_.isFolder===!1),l=D(v({},o),{nextPagePath:n}),c=i.map(_=>_.id===l.id?l:_),d=l.type==="folder"&&l.status==="checked",u=s.map(_=>({type:"folder",id:_.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:_})),g=a.map(_=>{let P=r(_);return{type:"file",id:_.requestPath,restrictionError:P,status:d&&!P?"checked":"unchecked",parentId:l.id,data:_}});return[...c,...u,...g]},_0=D2;var k2=i=>i.map(e=>v({},e)),za=k2;var ou=(i,e,t)=>{i.filter(r=>r.type!=="root"&&r.parentId===e).forEach(r=>{r.status=t&&!(r.type==="file"&&r.restrictionError)?"checked":"unchecked",ou(i,r.id,t)})},su=(i,e)=>{let t=i.find(s=>s.id===e);if(t.type==="root")return;let n=i.filter(s=>s.type!=="root"&&s.parentId===t.id&&!(s.type==="file"&&s.restrictionError)),r=n.every(s=>s.status==="checked"),o=n.every(s=>s.status==="unchecked");r?t.status="checked":o?t.status="unchecked":t.status="partial",su(i,t.parentId)},T2=(i,e)=>{let t=za(i);if(e.length>=2){let n=t.filter(r=>r.type!=="root"&&e.includes(r.id));n.forEach(r=>{r.type==="file"?r.status=r.restrictionError?"unchecked":"checked":r.status="checked"}),n.forEach(r=>{ou(t,r.id,!0)}),su(t,n[0].parentId)}else{let n=t.find(r=>r.id===e[0]);n.status=n.status==="checked"?"unchecked":"checked",ou(t,n.id,n.status==="checked"),su(t,n.parentId)}return t},w0=T2;var lu=De(C0(),1);var No=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},cu=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},S0=i=>globalThis.DOMException===void 0?new cu(i):new DOMException(i),P0=i=>{let e=i.reason===void 0?S0("This operation was aborted."):i.reason;return e instanceof Error?e:S0(e)};function du(i,e){let{milliseconds:t,fallback:n,message:r,customTimers:o={setTimeout,clearTimeout}}=e,s,a,c=new Promise((d,u)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:h}=e;h.aborted&&u(P0(h)),a=()=>{u(P0(h))},h.addEventListener("abort",a,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(d,u);return}let g=new No;s=o.setTimeout.call(void 0,()=>{if(n){try{d(n())}catch(h){u(h)}return}typeof i.cancel=="function"&&i.cancel(),r===!1?d():r instanceof Error?u(r):(g.message=r??`Promise timed out after ${t} milliseconds`,u(g))},t),B(this,null,function*(){try{d(yield i)}catch(h){u(h)}})}).finally(()=>{c.clear(),a&&e.signal&&e.signal.removeEventListener("abort",a)});return c.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},c}function uu(i,e,t){let n=0,r=i.length;for(;r>0;){let o=Math.trunc(r/2),s=n+o;t(i[s],e)<=0?(n=++s,r-=o+1):r=o}return n}var ja=class{#e=[];enqueue(e,t){t=v({priority:0},t);let n={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(n);return}let r=uu(this.#e,n,(o,s)=>s.priority-o.priority);this.#e.splice(r,0,n)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var Va=class extends lu.default{#e;#s;#o=0;#h;#a;#f=0;#i;#l;#t;#m;#n=0;#c;#r;#g;timeout;constructor(e){if(super(),e=v({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:ja},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#s=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#h=e.intervalCap,this.#a=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#r=e.autoStart===!1}get#b(){return this.#s||this.#o<this.#h}get#_(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#x(){this.#v(),this.#y(),this.#l=void 0}get#C(){let e=Date.now();if(this.#i===void 0){let t=this.#f-e;if(t<0)this.#o=this.#e?this.#n:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#x()},t)),!0}return!1}#d(){if(this.#t.size===0)return this.#i&&clearInterval(this.#i),this.#i=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#r){let e=!this.#C;if(this.#b&&this.#_){let t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#s||this.#i!==void 0||(this.#i=setInterval(()=>{this.#v()},this.#a),this.#f=Date.now()+this.#a)}#v(){this.#o===0&&this.#n===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#o=this.#e?this.#n:0,this.#u()}#u(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#c=e,this.#u()}#S(e){return B(this,null,function*(){return new Promise((t,n)=>{e.addEventListener("abort",()=>{n(e.reason)},{once:!0})})})}add(n){return B(this,arguments,function*(e,t={}){return t=v({timeout:this.timeout,throwOnTimeout:this.#g},t),new Promise((r,o)=>{this.#t.enqueue(()=>B(this,null,function*(){this.#n++,this.#o++;try{t.signal?.throwIfAborted();let s=e({signal:t.signal});t.timeout&&(s=du(Promise.resolve(s),{milliseconds:t.timeout})),t.signal&&(s=Promise.race([s,this.#S(t.signal)]));let a=yield s;r(a),this.emit("completed",a)}catch(s){if(s instanceof No&&!t.throwOnTimeout){r();return}o(s),this.emit("error",s)}finally{this.#w()}}),t),this.emit("add"),this.#d()})})}addAll(e,t){return B(this,null,function*(){return Promise.all(e.map(n=>B(this,null,function*(){return this.add(n,t)})))})}start(){return this.#r?(this.#r=!1,this.#u(),this):this}pause(){this.#r=!0}clear(){this.#t=new this.#m}onEmpty(){return B(this,null,function*(){this.#t.size!==0&&(yield this.#p("empty"))})}onSizeLessThan(e){return B(this,null,function*(){this.#t.size<e||(yield this.#p("next",()=>this.#t.size<e))})}onIdle(){return B(this,null,function*(){this.#n===0&&this.#t.size===0||(yield this.#p("idle"))})}#p(e,t){return B(this,null,function*(){return new Promise(n=>{let r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)})})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#n}get isPaused(){return this.#r}};var E0=(i,e,t,n,r)=>B(void 0,null,function*(){let o=[],s=t.cached?t.nextPagePath:t.id;for(;s;){let u=yield n(s);o=o.concat(u.items),s=u.nextPagePath}let a=o.filter(u=>u.isFolder===!0),l=o.filter(u=>u.isFolder===!1),c=a.map(u=>({type:"folder",id:u.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:u})),d=l.map(u=>{let g=r(u);return{type:"file",id:u.requestPath,restrictionError:g,status:g?"unchecked":"checked",parentId:t.id,data:u}});t.cached=!0,t.nextPagePath=null,e.push(...d,...c),c.forEach(u=>B(void 0,null,function*(){i.add(()=>E0(i,e,u,n,r))}))}),F2=(i,e,t,n)=>B(void 0,null,function*(){let r=new Va({concurrency:6}),o=za(i);return o.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{r.add(()=>E0(r,o,a,e,t))}),r.on("completed",()=>{let a=o.filter(l=>l.type==="file"&&l.status==="checked").length;n(a)}),yield r.onIdle(),o}),D0=F2;var kn={afterOpenFolder:b0,afterScrollFolder:_0,afterToggleCheckbox:w0,afterFill:D0};var R2=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:n}=i.target;return e-(t+n)<50},Ua=R2;var M2=i=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){i.log("Aborting request","warning");return}i.log(e,"error"),e.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(e.message)},"warning",5e3)}},zi=M2;var A2=(i,e,t,n)=>{let r=e.findIndex(o=>o.id===n);if(r!==-1&&t){let o=e.findIndex(a=>a.id===i);return e.slice(Math.min(r,o),Math.max(r,o)+1).map(a=>a.id)}return[i]},Wa=A2;function B2(i){let{searchString:e,setSearchString:t,submitSearchString:n,wrapperClassName:r,inputClassName:o,inputLabel:s,clearSearchLabel:a="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=i,u=_=>{t(_.target.value)},g=Dn(_=>{_.preventDefault(),n()},[n]),[h]=hi(()=>{let _=document.createElement("form");return _.setAttribute("tabindex","-1"),_.id=nn(),_});return Pi(()=>(document.body.appendChild(h),h.addEventListener("submit",g),()=>{h.removeEventListener("submit",g),document.body.removeChild(h)}),[h,g]),p("section",{className:r},p("input",{className:`uppy-u-reset ${o}`,type:"search","aria-label":s,placeholder:s,value:e,onInput:u,form:h.id,"data-uppy-super-focusable":!0}),!l&&p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},p("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&e&&p("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t("")},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},p("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),l&&p("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:h.id},c))}var Cr=B2;var T0=De(vt(),1);var N2=i=>i.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!i.some(r=>r.type!=="root"&&r.parentId===t.id):!1).length,k0=N2;function Lo(i){let{cancelSelection:e,donePicking:t,i18n:n,partialTree:r,validateAggregateRestrictions:o}=i,s=En(()=>o(r),[r,o]),a=En(()=>k0(r),[r]);return a===0?null:p("div",{className:"uppy-ProviderBrowser-footer"},p("div",{className:"uppy-ProviderBrowser-footer-buttons"},p("button",{className:(0,T0.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":s}),disabled:!!s,onClick:t,type:"button"},n("selectX",{smart_count:a})),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},n("cancel"))),s&&p("div",{className:"uppy-ProviderBrowser-footer-error"},s))}var L2=(i,e,t)=>{var n,r;return{id:i.id,source:e.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(n=i.author)==null?void 0:n.name,authorUrl:(r=i.author)==null?void 0:r.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},I0=L2;var z2=(i,e,t)=>{let n=i.map(s=>I0(s,e,t)),r=[],o=[];n.forEach(s=>{e.uppy.checkIfFileAlreadyExists(ua(s,e.uppy.getID()))?o.push(s):r.push(s)}),r.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:r.length})),o.length>0&&e.uppy.info(`Not adding ${o.length} files because they already exist`),e.uppy.addFiles(r)},$a=z2;var O0=(i,e,t)=>{let n=e===null?"null":e;if(t[n])return t[n];let r=i.find(s=>s.id===e);if(r.type==="root")return[];let o=[...O0(i,r.parentId,t),r];return t[n]=o,o},H2=i=>{let e=Object.create(null);return i.filter(r=>r.type==="file"&&r.status==="checked").map(r=>{let o=O0(i,r.id,e),s=o.findIndex(d=>d.type==="folder"&&d.status==="checked"),a=o.slice(s),l=`/${o.map(d=>d.data.name).join("/")}`,c=a.length===1?void 0:a.map(d=>d.data.name).join("/");return D(v({},r.data),{absDirPath:l,relDirPath:c})})},qa=H2;var j2=(i,e)=>{let t=i.find(r=>r.id===e),n=[];for(;n=[t,...n],t.type!=="root";){let r=t.parentId;t=i.find(o=>o.id===r)}return n},F0=j2;function on(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var V2=0;function M0(i){return"__private_"+V2+++"_"+i}var U2={version:"4.4.1"};function Ho(){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 R0=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),Tn=M0("abortController"),fi=M0("withAbort"),zo=class{constructor(e,t){Object.defineProperty(this,fi,{value:W2}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,Tn,{writable:!0,value:void 0}),this.validateSingleFile=r=>{let o=Ro(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r,currentFolderId:o,searchString:s}=this.plugin.getPluginState(),a=r.filter(c=>c.type!=="root"&&c.parentId===o);return s===""?a:a.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(s.toLowerCase())!==-1})},this.validateAggregateRestrictions=r=>{let s=r.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(s)},this.plugin=e,this.provider=t.provider;let n={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=v(v({},n),t),this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(R0(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(n=>n.type==="root"?n:D(v({},n),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}openFolder(e){return B(this,null,function*(){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),n=t.find(r=>r.id===e);if(n.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),yield on(this,fi)[fi](r=>B(this,null,function*(){let o=e,s=[];do{let{username:l,nextPagePath:c,items:d}=yield this.provider.list(o,{signal:r});this.plugin.setPluginState({username:l}),o=c,s=s.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:s.length}))}while(this.opts.loadAllFiles&&o);let a=kn.afterOpenFolder(t,s,n,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})})).catch(zi(this.plugin.uppy)),this.setLoading(!1)})}logout(){return B(this,null,function*(){yield on(this,fi)[fi](e=>B(this,null,function*(){let t=yield this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let n=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(n,"info",7e3)}this.plugin.setPluginState(D(v({},R0(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(zi(this.plugin.uppy))})}handleAuth(e){return B(this,null,function*(){yield on(this,fi)[fi](t=>B(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(zi(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(e){return B(this,null,function*(){let{partialTree:t,currentFolderId:n}=this.plugin.getPluginState(),r=t.find(o=>o.id===n);Ua(e)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,yield on(this,fi)[fi](o=>B(this,null,function*(){let{nextPagePath:s,items:a}=yield this.provider.list(r.nextPagePath,{signal:o}),l=kn.afterScrollFolder(t,n,a,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(zi(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return B(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),yield on(this,fi)[fi](t=>B(this,null,function*(){let n=yield kn.afterFill(e,s=>this.provider.list(s,{signal:t}),this.validateSingleFile,s=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:s}))});if(this.validateAggregateRestrictions(n)){this.plugin.setPluginState({partialTree:n});return}let o=qa(n);$a(o,this.plugin,this.provider),this.resetPluginState()})).catch(zi(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(e,t){let{partialTree:n}=this.plugin.getPluginState(),r=Wa(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),o=kn.afterToggleCheckbox(n,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:n}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;n||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let o=v(v({},this.opts),t),{authenticated:s,loading:a}=this.plugin.getPluginState(),l=this.plugin.icon||Ho;if(s===!1)return p(Ba,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:o.renderAuthForm,loading:a});let{partialTree:c,currentFolderId:d,username:u,searchString:g}=this.plugin.getPluginState(),h=F0(c,d);return p("div",{className:(0,A0.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`)},p(Jd,{showBreadcrumbs:o.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:h,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:u,i18n:r}),o.showFilter&&p(Cr,{searchString:g,setSearchString:_=>{this.plugin.setPluginState({searchString:_})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(La,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:o.virtualList,noResultsLabel:r("noFilesFound"),handleScroll:this.handleScroll,viewType:o.viewType,showTitles:o.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a,utmSource:"Companion"}),p(Lo,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function W2(i){return B(this,null,function*(){var e;(e=on(this,Tn)[Tn])==null||e.abort();let t=new AbortController;on(this,Tn)[Tn]=t;let n=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",n),this.plugin.uppy.on("cancel-all",n),yield i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",n),this.plugin.uppy.off("cancel-all",n),on(this,Tn)[Tn]=void 0}})}zo.VERSION=U2.version;var B0=De(vt(),1);var $2={version:"4.4.1"},q2={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},G2={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},Sr=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=n=>{let r=Ro(n);return this.plugin.uppy.validateSingleFile(r)},this.getDisplayedPartialTree=()=>{let{partialTree:n}=this.plugin.getPluginState();return n.filter(r=>r.type!=="root")},this.setSearchString=n=>{this.plugin.setPluginState({searchString:n}),n===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=n=>{let o=n.filter(s=>s.type==="file"&&s.status==="checked").map(s=>s.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=e,this.provider=t.provider,this.opts=v(v({},G2),t),this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(q2)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(n=>n.type==="root"?n:D(v({},n),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}search(){return B(this,null,function*(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=yield this.provider.search(e),n=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(r=>({type:"file",id:r.requestPath,status:"unchecked",parentId:null,data:r}))];this.plugin.setPluginState({partialTree:n,isInputMode:!1})}catch(t){zi(this.plugin.uppy)(t)}this.setLoading(!1)}})}handleScroll(e){return B(this,null,function*(){let{partialTree:t,searchString:n}=this.plugin.getPluginState(),r=t.find(o=>o.type==="root");if(Ua(e)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let o=yield this.provider.search(n,r.nextPagePath),s=D(v({},r),{nextPagePath:o.nextPageQuery}),a=t.filter(c=>c.type!=="root"),l=[s,...a,...o.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(o){zi(this.plugin.uppy)(o)}this.isHandlingScroll=!1}})}donePicking(){return B(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState(),t=qa(e);$a(t,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(e,t){let{partialTree:n}=this.plugin.getPluginState(),r=Wa(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),o=kn.afterToggleCheckbox(n,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:n,searchString:r,loading:o,partialTree:s}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,l=v(v({},this.opts),t);return n?p(Cr,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):p("div",{className:(0,B0.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&p(Cr,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(La,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>B(this,null,function*(){}),noResultsLabel:a("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:o,i18n:a,virtualList:!1,utmSource:this.opts.utmSource}),p(Lo,{partialTree:s,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};Sr.VERSION=$2.version;var N0=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function X2(i,e){return!!(i===e||N0(i)&&N0(e))}function Y2(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!X2(i[t],e[t]))return!1;return!0}function pu(i,e){e===void 0&&(e=Y2);var t=null;function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t&&t.lastThis===this&&e(r,t.lastArgs))return t.lastResult;var s=i.apply(this,r);return t={lastResult:s,lastArgs:r,lastThis:this},s}return n.clear=function(){t=null},n}var Ga=['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 jo(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function L0(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function K2(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function Q2(i){return i.contains(document.activeElement)}function hu(i,e,t){let n=jo(t,e),r=Si(n.querySelectorAll(Ga)),o=r.indexOf(document.activeElement);Q2(n)?i.shiftKey&&o===0?K2(i,r):!i.shiftKey&&o===r.length-1&&L0(i,r):L0(i,r)}function z0(i,e,t){e===null||hu(i,e,t)}var H0=De(id(),1);function fu(){let i=!1;return(0,H0.default)((t,n)=>{let r=jo(t,n),o=r.contains(document.activeElement);if(o&&i)return;let s=r.querySelector("[data-uppy-super-focusable]");if(!(o&&!s))if(s)s.focus({preventScroll:!0}),i=!0;else{let a=r.querySelector(Ga);a?.focus({preventScroll:!0}),i=!1}},260)}var ry=De(vt(),1);function Vo(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var W0=De(vt(),1);function j0(i,e){if(i===e)return!0;if(!i||!e)return!1;let t=Object.keys(i),n=Object.keys(e),r=t.length;if(n.length!==r)return!1;for(let o=0;o<r;o++){let s=t[o];if(i[s]!==e[s]||!Object.prototype.hasOwnProperty.call(e,s))return!1}return!0}function J2(){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 eE(){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 tE(){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 iE(){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 nE(){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 rE(){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 oE(){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 In(i){let e={color:"#838999",icon:rE()};if(!i)return e;let t=i.split("/")[0],n=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:oE()}:t==="image"?{color:"#686de0",icon:J2()}:t==="audio"?{color:"#068dbb",icon:eE()}:t==="video"?{color:"#19af67",icon:tE()}:t==="application"&&n==="pdf"?{color:"#e25149",icon:iE()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(n)!==-1?{color:"#00C469",icon:nE()}:e}function Uo(i){let{file:e}=i;if(e.preview)return p("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:n}=In(e.type);return p("div",{className:"uppy-Dashboard-Item-previewIconWrap"},p("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},n),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 sE=(i,e)=>(typeof e=="function"?e():e).filter(r=>r.id===i)[0].name;function Wo(i){let{file:e,toggleFileCard:t,i18n:n,metaFields:r}=i,{missingRequiredMetaFields:o}=e;if(!(o!=null&&o.length))return null;let s=o.map(a=>sE(a,r)).join(", ");return p("div",{className:"uppy-Dashboard-Item-errorMessage"},n("missingRequiredMetaFields",{smart_count:o.length,fields:s})," ",p("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},n("editFile")))}function mu(i){let{file:e,i18n:t,toggleFileCard:n,metaFields:r,showLinkToFileUploadResult:o}=i,a=e.preview?"rgba(255, 255, 255, 0.5)":In(e.type).color;return p("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a}},o&&e.uploadURL&&p("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},p("span",{hidden:!0},e.meta.name)),p(Uo,{file:e}),p(Wo,{file:e,i18n:t,toggleFileCard:n,metaFields:r}))}function aE(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 V0(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 gu(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":V0(i),title:V0(i),onClick:()=>aE(i)},i.children))}function Xa(i){let{children:e}=i;return p("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function yu(i){let{progress:e}=i,t=2*Math.PI*15;return p("g",null,p("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),p("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e}))}function vu(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(Xa,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(gu,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(gu,i,p(Xa,null,p(yu,{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(gu,i,p(Xa,null,p(yu,{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(Xa,null,p(yu,{progress:i.file.progress.percentage}))))}var U0=De(oo(),1);var bu="...";function Ya(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=bu.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-bu.length,n=Math.ceil(t/2),r=Math.floor(t/2);return i.slice(0,n)+bu+i.slice(-r)}var lE=i=>{let{author:e,name:t}=i.file.meta;function n(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return p("div",{className:"uppy-Dashboard-Item-name",title:t},Ya(t,n()))},cE=i=>{var e;let{author:t}=i.file.meta,n=(e=i.file.remote)==null?void 0:e.providerName,r="\xB7";return t?p("div",{className:"uppy-Dashboard-Item-author"},p("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Ya(t.name,13)),n?p(Fragment,null,` ${r} `,n,` ${r} `):null):null},dE=i=>i.file.size&&p("div",{className:"uppy-Dashboard-Item-statusSize"},(0,U0.default)(i.file.size)),uE=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"))),pE=i=>{let{file:e,onClick:t}=i;return e.error?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function _u(i){let{file:e,i18n:t,toggleFileCard:n,metaFields:r,toggleAddFilesPanel:o,isSingleFile:s,containerHeight:a,containerWidth:l}=i;return p("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},p("div",{className:"uppy-Dashboard-Item-fileName"},lE({file:e,isSingleFile:s,containerHeight:a,containerWidth:l}),p(pE,{file:e,onClick:()=>alert(e.error)})),p("div",{className:"uppy-Dashboard-Item-status"},cE({file:e}),dE({file:e}),uE({file:e,toggleAddFilesPanel:o,i18n:t})),p(Wo,{file:e,i18n:t,toggleFileCard:n,metaFields:r}))}function wu(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let n=document.createElement("textarea");n.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),n.value=i,document.body.appendChild(n),n.select();let r=()=>{document.body.removeChild(n),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(n),t()):r()}catch{return document.body.removeChild(n),r()}})}function hE(i){let{file:e,uploadInProgressOrComplete:t,metaFields:n,canEditFile:r,i18n:o,onClick:s}=i;return!t&&n&&n.length>0||!t&&r(e)?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFileWithFilename",{file:e.meta.name}),title:o("editFileWithFilename",{file:e.meta.name}),onClick:()=>s()},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 fE(i){let{i18n:e,onClick:t,file:n}=i;return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:n.meta.name}),title:e("removeFile",{file:n.meta.name}),onClick:()=>t()},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},p("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),p("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function mE(i){let{file:e,uppy:t,i18n:n}=i,r=o=>{wu(e.uploadURL,n("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>o.target.focus({preventScroll:!0}))};return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":n("copyLink"),title:n("copyLink"),onClick:o=>r(o)},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 xu(i){let{uppy:e,file:t,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,showLinkToFileUploadResult:s,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return p("div",{className:"uppy-Dashboard-Item-actionWrapper"},p(hE,{i18n:l,file:t,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,onClick:()=>{o&&o.length>0?c(!0,t.id):d(t)}}),s&&t.uploadURL?p(mE,{file:t,uppy:e,i18n:l}):null,a?p(fE,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var Ka=class extends Ot{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!j0(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,n=!!e.progress.uploadComplete&&!t&&!e.error,r=!!e.progress.uploadStarted||!!t,o=e.progress.uploadStarted&&!e.progress.uploadComplete||t,s=e.error||!1,{isGhost:a}=e,l=(this.props.individualCancellation||!o)&&!n;n&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,W0.default)({"uppy-Dashboard-Item":!0,"is-inprogress":o&&!this.props.recoveredState,"is-processing":t,"is-complete":n,"is-error":!!s,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return p("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},p("div",{className:"uppy-Dashboard-Item-preview"},p(mu,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),p(vu,{uppy:this.props.uppy,file:e,error:s,isUploaded:n,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(_u,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),p(xu,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function gE(i,e){let t=[],n=[];return i.forEach(r=>{n.length<e?n.push(r):(t.push(n),n=[r])}),n.length&&t.push(n),t}function Cu(i){let{id:e,i18n:t,uppy:n,files:r,resumableUploads:o,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:u,isSingleFile:g,toggleFileCard:h,handleRequestThumbnail:_,handleCancelThumbnail:P,recoveredState:L,individualCancellation:M,itemsPerRow:W,openFileEditor:de,canEditFile:oe,toggleAddFilesPanel:ee,containerWidth:b,containerHeight:w}=i,S=W===1?71:200,A=En(()=>{let K=(Ne,Pe)=>Number(r[Pe].isGhost)-Number(r[Ne].isGhost),ve=Object.keys(r);return L&&ve.sort(K),gE(ve,W)},[r,W,L]),z=K=>p("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:K[0]},K.map(ve=>p(Ka,{key:ve,uppy:n,id:e,i18n:t,resumableUploads:o,individualCancellation:M,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:u,recoveredState:L,isSingleFile:g,containerWidth:b,containerHeight:w,toggleFileCard:h,handleRequestThumbnail:_,handleCancelThumbnail:P,role:"listitem",openFileEditor:de,canEditFile:oe,toggleAddFilesPanel:ee,file:r[ve]})));return g?p("div",{class:"uppy-Dashboard-files"},z(A[0])):p(Na,{class:"uppy-Dashboard-files",role:"list",data:A,renderRow:z,rowHeight:S})}var Su=class extends Ot{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var n;return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(n=this.props.allowedFileTypes)==null?void 0:n.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,n)=>{let o={photo:"image/*",video:"video/*"}[e];return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:o,ref:n})},this.renderMyDeviceAcquirer=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let n=this.props.acquirers.length;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":n===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),n=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,o=r.charAt(0).toUpperCase()+r.slice(1);return p("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${o}`,{browseFiles:t,browseFolders:n,browse:t}):this.props.i18nArray(`dropPaste${o}`,{browseFiles:t,browseFolders:n,browse:t}))},this.renderAcquirer=e=>{var t;return p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},p("div",{className:"uppy-DashboardTab-inner"},e.icon()),p("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],n=t.splice(e.length-2,e.length);return p(Wt,null,t.map(r=>this.renderAcquirer(r)),p("span",{role:"presentation",style:{"white-space":"nowrap"}},n.map(r=>this.renderAcquirer(r))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:n,showNativeVideoCameraButton:r}=this.props,o=[],s="myDevice";t||o.push({key:s,elements:this.renderMyDeviceAcquirer()}),n&&o.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&o.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),o.push(...e.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),o.length===1&&o[0].key===s&&(o=[]);let l=[...o],c=l.splice(o.length-2,o.length);return p(Wt,null,this.renderDropPasteBrowseTagline(o.length),p("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(d=>{let{key:u,elements:g}=d;return p(Wt,{key:u},g)}),p("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:u,elements:g}=d;return p(Wt,{key:u},g)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=p("span",null,p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},p("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),p("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),n=e("poweredBy",{uppy:t});return p("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},n)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:n}=this.props;return p("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,r=>{this.fileInput=r}),this.renderHiddenInput(!0,r=>{this.folderInput=r}),e&&this.renderHiddenCameraInput("photo",n,r=>{this.mobilePhotoFileInput=r}),t&&this.renderHiddenCameraInput("video",n,r=>{this.mobileVideoFileInput=r}),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()))}},Qa=Su;var $0=De(vt(),1);var yE=i=>p("div",{className:(0,$0.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(Qa,i)),q0=yE;var G0=De(vt(),1);function vE(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ei=vE;function bE(i){let{activePickerPanel:e,className:t,hideAllPanels:n,i18n:r,state:o,uppy:s}=i,a=Pn(null);return p("div",{className:(0,G0.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Ei,onDragLeave:Ei,onDrop:Ei,onPaste:Ei},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:e.name})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:n},r("cancel"))),p("div",{ref:a,className:"uppy-DashboardContent-panelBody"},s.getPlugin(e.id).render(o,a.current)))}var X0=bE;var Y0=De(vt(),1);function _E(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return p("div",{className:(0,Y0.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),p("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),p("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(n=>i.uppy.getPlugin(n.id).render(i.state))))}var K0=_E;var Di={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function wE(i,e,t,n){if(n===void 0&&(n={}),i)return Di.STATE_ERROR;if(e)return Di.STATE_COMPLETE;if(t)return Di.STATE_PAUSED;let r=Di.STATE_WAITING,o=Object.keys(n);for(let s=0;s<o.length;s++){let{progress:a}=n[o[s]];if(a.uploadStarted&&!a.uploadComplete)return Di.STATE_UPLOADING;a.preprocess&&r!==Di.STATE_UPLOADING&&(r=Di.STATE_PREPROCESSING),a.postprocess&&r!==Di.STATE_UPLOADING&&r!==Di.STATE_PREPROCESSING&&(r=Di.STATE_POSTPROCESSING)}return r}function xE(i){let{files:e,i18n:t,isAllComplete:n,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:s,newFiles:a,processingFiles:l}=i;switch(wE(r,n,o,e)){case"uploading":return t("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function CE(i){let{i18n:e,isAllComplete:t,hideCancelButton:n,maxNumberOfFiles:r,toggleAddFilesPanel:o,uppy:s}=i,{allowNewUpload:a}=i;return a&&r&&(a=i.totalFileCount<i.maxNumberOfFiles),p("div",{className:"uppy-DashboardContent-bar"},!t&&!n?p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>s.cancelAll()},e("cancel")):p("div",null),p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},p(xE,i)),a?p("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>o(!0)},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},p("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),p("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):p("div",null))}var Q0=CE;var Z0=De(vt(),1);function Pu(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:n,form:r,formState:o}=i,s={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{let l=`uppy-Dashboard-FileCard-input-${a.id}`,c=t.includes(a.id);return p("fieldset",{key:a.id,className:"uppy-Dashboard-FileCard-fieldset"},p("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},a.name),a.render!==void 0?a.render({value:o[a.id],onChange:d=>n(d,a.id),fieldCSSClasses:s,required:c,form:r.id},p):p("input",{className:s.text,id:l,form:r.id,type:a.type||"text",required:c,value:o[a.id],placeholder:a.placeholder,onInput:d=>n(d.target.value,a.id),"data-uppy-super-focusable":!0}))})}function Eu(i){var e;let{files:t,fileCardFor:n,toggleFileCard:r,saveFileCard:o,metaFields:s,requiredMetaFields:a,openFileEditor:l,i18n:c,i18nArray:d,className:u,canEditFile:g}=i,h=()=>typeof s=="function"?s(t[n]):s,_=t[n],P=(e=h())!=null?e:[],L=g(_),M={};P.forEach(S=>{var A;M[S.id]=(A=_.meta[S.id])!=null?A:""});let[W,de]=hi(M),oe=Dn(S=>{S.preventDefault(),o(W,n)},[o,W,n]),ee=(S,A)=>{de(D(v({},W),{[A]:S}))},b=()=>{r(!1)},[w]=hi(()=>{let S=document.createElement("form");return S.setAttribute("tabindex","-1"),S.id=nn(),S});return Pi(()=>(document.body.appendChild(w),w.addEventListener("submit",oe),()=>{w.removeEventListener("submit",oe),document.body.removeChild(w)}),[w,oe]),p("div",{className:(0,Z0.default)("uppy-Dashboard-FileCard",u),"data-uppy-panelType":"FileCard",onDragOver:Ei,onDragLeave:Ei,onDrop:Ei,onPaste:Ei},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},_.meta?_.meta.name:_.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",form:w.id,title:c("finishEditingFile"),onClick:b},c("cancel"))),p("div",{className:"uppy-Dashboard-FileCard-inner"},p("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:In(_.type).color}},p(Uo,{file:_}),L&&p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:S=>{oe(S),l(_)}},c("editImage"))),p("div",{className:"uppy-Dashboard-FileCard-info"},p(Pu,{computedMetaFields:P,requiredMetaFields:a,updateMeta:ee,form:w,formState:W})),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:w.id},c("saveChanges")),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:b,form:w.id},c("cancel")))))}var ey=De(vt(),1),Pr="uppy-transition-slideDownUp",J0=250;function SE(i){let{children:e}=i,[t,n]=hi(null),[r,o]=hi(""),s=Pn(),a=Pn(),l=Pn(),c=()=>{o(`${Pr}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{o(`${Pr}-enter ${Pr}-enter-active`),s.current=setTimeout(()=>{o("")},J0)})},d=()=>{o(`${Pr}-leave`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{o(`${Pr}-leave ${Pr}-leave-active`),a.current=setTimeout(()=>{n(null),o("")},J0)})};return Pi(()=>{let u=Ci(e)[0];t!==u&&(u&&!t?c():t&&!u&&!a.current&&d(),n(u))},[e,t]),Pi(()=>()=>{clearTimeout(s.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),t?va(t,{className:(0,ey.default)(r,t.props.className)}):null}var $o=SE;function Er(){return Er=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Er.apply(null,arguments)}var ty=900,iy=700,Du=576,ny=330;function ku(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,n=i.containerWidth>Du,r=i.containerHeight>ny,o=(0,ry.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>Du,"uppy-size--lg":i.containerWidth>iy,"uppy-size--xl":i.containerWidth>ty,"uppy-size--height-md":i.containerHeight>ny,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&r}),s=1;i.containerWidth>ty?s=5:i.containerWidth>iy?s=4:i.containerWidth>Du&&(s=3);let a=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(g=>i.files[g].isGhost).length:0,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return p("div",{className:o,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Vo(),"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")),a&&p(Q0,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"},d())),a?p(Cu,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:s,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):p(Qa,{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($o,null,i.showAddFilesPanel?p(q0,Er({key:"AddFiles"},i,{isSizeMD:n})):null),p($o,null,i.fileCardFor?p(Eu,Er({key:"FileCard"},i)):null),p($o,null,i.activePickerPanel?p(X0,Er({key:"Picker"},i)):null),p($o,null,i.showFileEditor?p(K0,Er({key:"Editor"},i)):null),p("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(g=>i.uppy.getPlugin(g.id).render(i.state))))))}var oy={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 we(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var PE=0;function pt(i){return"__private_"+PE+++"_"+i}var EE={version:"4.3.1"},Tu=pu.default||pu,sy=9,DE=27;function ay(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var kE={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Ho,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},On=pt("disabledNodes"),Hi=pt("generateLargeThumbnailIfSingleFile"),qo=pt("openFileEditorWhenFilesAdded"),Fn=pt("attachRenderFunctionToTarget"),Iu=pt("isTargetSupported"),Ou=pt("getAcquirers"),Fu=pt("getProgressIndicators"),ji=pt("getEditors"),Ru=pt("addSpecifiedPluginsFromOptions"),Mu=pt("autoDiscoverPlugins"),Rn=pt("addSupportedPluginIfNoTarget"),Go=pt("getStatusBarOpts"),Xo=pt("getThumbnailGeneratorOpts"),Au=pt("getInformerOpts"),Yo=pt("getStatusBarId"),Ko=pt("getThumbnailGeneratorId"),Bu=pt("getInformerId"),Mn=class extends $t{constructor(e,t){var n,r,o;let s=(n=t?.autoOpen)!=null?n:null;super(e,D(v(v({},kE),t),{autoOpen:s})),Object.defineProperty(this,Bu,{value:ME}),Object.defineProperty(this,Ko,{value:RE}),Object.defineProperty(this,Yo,{value:FE}),Object.defineProperty(this,Au,{value:OE}),Object.defineProperty(this,Xo,{value:IE}),Object.defineProperty(this,Go,{value:TE}),Object.defineProperty(this,On,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${nn()}`,this.superFocus=fu(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=a=>{let c=this.getPluginState().targets.filter(d=>d.id!==a.id);this.setPluginState({targets:c})},this.addTarget=a=>{let l=a.id||a.constructor.name,c=a.title||l,d=a.type;if(d!=="acquirer"&&d!=="progressindicator"&&d!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let u={id:l,name:c,type:d},h=this.getPluginState().targets.slice();return h.push(u),this.setPluginState({targets:h}),this.el},this.hideAllPanels=()=>{var a;let l=this.getPluginState(),c={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===c.activePickerPanel&&l.showAddFilesPanel===c.showAddFilesPanel&&l.showFileEditor===c.showFileEditor&&l.activeOverlayType===c.activeOverlayType||(this.setPluginState(c),this.uppy.emit("dashboard:close-panel",(a=l.activePickerPanel)==null?void 0:a.id))},this.showPanel=a=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===a);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",a)},this.canEditFile=a=>{let{targets:l}=this.getPluginState();return we(this,ji)[ji](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),c=we(this,ji)[ji](l);this.setPluginState({showFileEditor:!0,fileCardFor:a.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(a)})},this.closeFileEditor=()=>{let{metaFields:a}=this.getPluginState();a&&a.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:a}=this.getPluginState();we(this,ji)[ji](a).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=ay();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 c=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",c,!1),l()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),a},this.closeModal=a=>{var l;let c=(l=a?.manualClose)!=null?l:!0,{isHidden:d,isClosing:u}=this.getPluginState();if(d||u)return;let{promise:g,resolve:h}=ay();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let P=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",P,!1),h()};this.el.addEventListener("animationend",P,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),h();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var _;(_=history.state)!=null&&_[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),g},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=a=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:D(v({},l),{darkMode:a})})},this.handleSystemDarkModeChange=a=>{let l=a.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(a,l)=>{let c=this.uppy.getFile(l);a?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:a?l:null,activeOverlayType:a?"FileCard":null})},this.toggleAddFilesPanel=a=>{this.setPluginState({showAddFilesPanel:a,activeOverlayType:a?"AddFiles":null})},this.addFiles=a=>{let l=a.map(c=>({source:this.id,name:c.name,type:c.type,data:c,meta:{relativePath:c.relativePath||c.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(c){this.uppy.log(c)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(a=>{let l=a[0],{width:c,height:d}=l.contentRect;this.setPluginState({containerWidth:c,containerHeight:d,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let a=this.getPluginState(),l=!this.opts.inline&&a.isHidden;!a.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=a=>{this.el.contains(a.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=a=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=we(this,On)[On])!=null?l:Si(this.el.querySelectorAll(c)).filter(u=>!u.classList.contains("uppy-Dashboard-close"));for(let u of d)u.tagName==="A"?u.setAttribute("aria-disabled",a):u.disabled=a;a?we(this,On)[On]=d:we(this,On)[On]=null,this.dashboardIsDisabled=a},this.updateBrowserHistory=()=>{var a;(a=history.state)!=null&&a[this.modalName]||history.pushState(D(v({},history.state),{[this.modalName]:!0}),""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=a=>{var l;this.isModalOpen()&&(!a.state||!a.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=a.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=a=>{a.keyCode===DE&&this.requestCloseModal(),a.keyCode===sy&&hu(a,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=a=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(a))});let l=Si(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=Si(a.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=a=>{a.preventDefault(),a.stopPropagation();let l=()=>{let g=!0;return this.uppy.iteratePlugins(h=>{h.canHandleRootDrop!=null&&h.canHandleRootDrop(a)&&(g=!0)}),g},c=()=>{let{types:g}=a.dataTransfer;return g.some(h=>h==="Files")},d=l(),u=c();if(!d&&!u||this.opts.disabled||this.opts.disableLocalFiles&&(u||!d)||!this.uppy.getState().allowNewUpload){a.dataTransfer.dropEffect="none";return}a.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(a)},this.handleDragLeave=a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(a)},this.handleDrop=a=>B(this,null,function*(){a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(u=>{u.type==="acquirer"&&(u.handleRootDrop==null||u.handleRootDrop(a))});let l=!1,c=u=>{this.uppy.log(u,"error"),l||(this.uppy.info(u.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let d=yield Fo(a.dataTransfer,{logDropError:c});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),this.opts.onDrop(a)}),this.handleRequestThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",a)},this.handleCancelThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",a)},this.handleKeyDownInInline=a=>{a.keyCode===sy&&z0(a,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=a=>{this.el.contains(document.activeElement)&&this.handlePaste(a)},this.handleComplete=a=>{let{failed:l}=a;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Hi,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let a=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:a});let d=D(v({},l[0]),{preview:void 0});c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,qo,{writable:!0,value:a=>{let l=a[0],{metaFields:c}=this.getPluginState(),d=c&&c.length>0,u=this.canEditFile(l);d&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):u&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let a=$d(this.opts.trigger);a?a.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",we(this,Rn)[Rn]),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",we(this,Hi)[Hi]),this.uppy.on("file-removed",we(this,Hi)[Hi]),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",we(this,qo)[qo])},this.removeEvents=()=>{let a=$d(this.opts.trigger);!this.opts.inline&&a&&a.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",we(this,Rn)[Rn]),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",we(this,Hi)[Hi]),this.uppy.off("file-removed",we(this,Hi)[Hi]),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",we(this,qo)[qo])},this.superFocusOnEachUpdate=()=>{let a=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,c=this.uppy.getState().info.length===0,d=!this.opts.inline;c&&(d||a||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=(a,l)=>{this.uppy.setFileMeta(l,a),this.toggleFileCard(!1,l)},Object.defineProperty(this,Fn,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return D(v({},a),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,Iu,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,Ou,{writable:!0,value:Tu(a=>a.filter(l=>l.type==="acquirer"&&we(this,Iu)[Iu](l)).map(we(this,Fn)[Fn]))}),Object.defineProperty(this,Fu,{writable:!0,value:Tu(a=>a.filter(l=>l.type==="progressindicator").map(we(this,Fn)[Fn]))}),Object.defineProperty(this,ji,{writable:!0,value:Tu(a=>a.filter(l=>l.type==="editor").map(we(this,Fn)[Fn]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:u}=a,{newFiles:g,uploadStartedFiles:h,completeFiles:_,erroredFiles:P,inProgressFiles:L,inProgressNotPausedFiles:M,processingFiles:W,isUploadStarted:de,isAllComplete:oe,isAllPaused:ee}=this.uppy.getObjectOfFilesPerState(),b=we(this,Ou)[Ou](l.targets),w=we(this,Fu)[Fu](l.targets),S=we(this,ji)[ji](l.targets),A;return this.opts.theme==="auto"?A=d.darkMode?"dark":"light":A=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}".`)),ku({state:a,isHidden:l.isHidden,files:c,newFiles:g,uploadStartedFiles:h,completeFiles:_,erroredFiles:P,inProgressFiles:L,inProgressNotPausedFiles:M,processingFiles:W,isUploadStarted:de,isAllComplete:oe,isAllPaused:ee,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:u,acquirers:b,theme:A,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:w,editors:S,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:a.recoveredState,metaFields:l.metaFields,resumableUploads:d.resumableUploads||!1,individualCancellation:d.individualCancellation,isMobileDevice:d.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,Ru,{writable:!0,value:()=>{let{plugins:a}=this.opts;a.forEach(l=>{let c=this.uppy.getPlugin(l);c?c.mount(this,c):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,Mu,{writable:!0,value:()=>{this.uppy.iteratePlugins(we(this,Rn)[Rn])}}),Object.defineProperty(this,Rn,{writable:!0,value:a=>{var l;let c=["acquirer","editor"];a&&!((l=a.opts)!=null&&l.target)&&c.includes(a.type)&&(this.getPluginState().targets.some(u=>a.id===u.id)||a.mount(this,a))}}),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:a,closeAfterFinish:l}=this.opts;if(a&&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:c,allowMultipleUploadBatches:d}=this.uppy.opts;(c||d)&&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:u}=this.opts;u&&this.mount(u,this),this.opts.disableStatusBar||this.uppy.use(_n,v({id:we(this,Yo)[Yo](),target:this},we(this,Go)[Go]())),this.opts.disableInformer||this.uppy.use(wn,v({id:we(this,Bu)[Bu](),target:this},we(this,Au)[Au]())),this.opts.disableThumbnailGenerator||this.uppy.use(wr,v({id:we(this,Ko)[Ko]()},we(this,Xo)[Xo]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let g=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${g?"on":"off"}`),this.setDarkModeCapability(g),this.opts.theme==="auto"){var h;(h=this.darkModeMediaQuery)==null||h.addListener(this.handleSystemDarkModeChange)}we(this,Ru)[Ru](),we(this,Mu)[Mu](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let c=this.uppy.getPlugin(`${this.id}:Informer`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableStatusBar){let c=this.uppy.getPlugin(`${this.id}:StatusBar`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableThumbnailGenerator){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c&&this.uppy.removePlugin(c)}let{plugins:a}=this.opts;if(a.forEach(c=>{let d=this.uppy.getPlugin(c);d&&d.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=oy,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(o=(r=this.opts).onRequestCloseModal)!=null||(r.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,n;super.setOptions(e),(t=this.uppy.getPlugin(we(this,Yo)[Yo]()))==null||t.setOptions(we(this,Go)[Go]()),(n=this.uppy.getPlugin(we(this,Ko)[Ko]()))==null||n.setOptions(we(this,Xo)[Xo]())}};function TE(){let{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:n,showProgressDetails:r,hideProgressAfterFinish:o,locale:s,doneButtonHandler:a}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:n,showProgressDetails:r,hideAfterFinish:o,locale:s,doneButtonHandler:a}}function IE(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:n}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:n,lazy:!n}}function OE(){return{}}function FE(){return`${this.id}:StatusBar`}function RE(){return`${this.id}:ThumbnailGenerator`}function ME(){return`${this.id}:Informer`}Mn.VERSION=EE.version;var AE={version:"4.2.1"},BE={fixed:!1,hideAfterFinish:!0},Dr=class extends $t{constructor(e,t){super(e,v(v({},BE),t)),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){let{totalProgress:t}=e,n=(t===0||t===100)&&this.opts.hideAfterFinish;return p("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},p("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),p("div",{className:"uppy-ProgressBar-percentage"},t))}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};Dr.VERSION=AE.version;var ly={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var NE={version:"4.1.1"},LE={inputName:"files[]",width:"100%",height:"100%"},kr=class i extends $t{constructor(e,t){super(e,v(v({},LE),t)),this.isDragDropSupported=Vo(),this.addFiles=n=>{let r=n.map(o=>({source:this.id,name:o.name,type:o.type,data:o,meta:{relativePath:o.relativePath||null}}));try{this.uppy.addFiles(r)}catch(o){this.uppy.log(o)}},this.onInputChange=n=>{let r=Si(n.currentTarget.files||[]);r.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(r)),n.currentTarget.value=""},this.handleDragOver=n=>{var r,o;n.preventDefault(),n.stopPropagation();let{types:s}=n.dataTransfer,a=s.some(c=>c==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!a||!l){n.dataTransfer.dropEffect="none";return}n.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(r=(o=this.opts).onDragOver)==null||r.call(o,n)},this.handleDragLeave=n=>{var r,o;n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(r=(o=this.opts).onDragLeave)==null||r.call(o,n)},this.handleDrop=n=>B(this,null,function*(){var r,o;n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1});let s=l=>{this.uppy.log(l,"error")},a=yield Fo(n.dataTransfer,{logDropError:s});a.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(a)),(r=(o=this.opts).onDrop)==null||r.call(o,n)}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=ly,this.i18nInit()}renderHiddenFileInput(){var e;let{restrictions:t}=this.uppy.opts;return p("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:n=>{this.fileInputRef=n},name:this.opts.inputName,multiple:t.maxNumberOfFiles!==1,accept:(e=t.allowedFileTypes)==null?void 0:e.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 e=`uppy-u-reset
27
27
  uppy-DragDrop-container
28
28
  ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
29
29
  ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
30
- `,t={width:this.opts.width,height:this.opts.height};return u("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),u("div",{className:"uppy-DragDrop-inner"},i.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};kr.VERSION=NE.version;var Nu=class{onMount(e,t){this.options=v(v({},e),this.props),this.uppy.use(t,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(e,t){e.uppy&&this.uppy!==e.uppy.previousValue&&e.uppy.previousValue!==void 0&&(this.uninstall(e.uppy.previousValue),this.uppy.use(t,this.options)),this.options=v(v({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),e.props&&this.props!==e.props.previousValue&&e.props.previousValue!==void 0&&this.plugin.setOptions(v({},this.options))}uninstall(e=this.uppy){e.removePlugin(this.plugin)}},cy=(()=>{class i extends Nu{constructor(t){super(),this.el=t,this.uppy=new hr,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},Mn)}ngOnChanges(t){this.handleChanges(t,Mn)}ngOnDestroy(){this.uninstall()}static{this.\u0275fac=function(n){return new(n||i)(He(Dt))}}static{this.\u0275cmp=fe({type:i,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[fl,gi],decls:0,vars:0,template:function(n,r){},encapsulation:2,changeDetection:0})}}return i})();var dy=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=zt({type:i})}static{this.\u0275inj=Nt({})}}return i})();function ce(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var HE=0;function Ft(i){return"__private_"+HE+++"_"+i}function jE(i){return new Error("Cancelled",{cause:i})}function uy(i){if(i!=null){var e;let t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});let n=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,n,n)}return this}var Yt=Ft("activeRequests"),xt=Ft("queuedHandlers"),Xt=Ft("paused"),An=Ft("pauseTimer"),wt=Ft("downLimit"),Bn=Ft("upperLimit"),Vi=Ft("rateLimitingTimer"),Jo=Ft("call"),Ui=Ft("queueNext"),Hu=Ft("next"),zu=Ft("queue"),ju=Ft("dequeue"),Lu=Ft("resume"),Nn=Ft("increaseLimit"),Za=class{constructor(e){Object.defineProperty(this,ju,{value:qE}),Object.defineProperty(this,zu,{value:$E}),Object.defineProperty(this,Hu,{value:WE}),Object.defineProperty(this,Ui,{value:UE}),Object.defineProperty(this,Jo,{value:VE}),Object.defineProperty(this,Yt,{writable:!0,value:0}),Object.defineProperty(this,xt,{writable:!0,value:[]}),Object.defineProperty(this,Xt,{writable:!0,value:!1}),Object.defineProperty(this,An,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:1}),Object.defineProperty(this,Bn,{writable:!0,value:void 0}),Object.defineProperty(this,Vi,{writable:!0,value:void 0}),Object.defineProperty(this,Lu,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,Nn,{writable:!0,value:()=>{if(ce(this,Xt)[Xt]){ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],0);return}ce(this,wt)[wt]=this.limit,this.limit=Math.ceil((ce(this,Bn)[Bn]+ce(this,wt)[wt])/2);for(let t=ce(this,wt)[wt];t<=this.limit;t++)ce(this,Ui)[Ui]();ce(this,Bn)[Bn]-ce(this,wt)[wt]>3?ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],2e3):ce(this,wt)[wt]=Math.floor(ce(this,wt)[wt]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!ce(this,Xt)[Xt]&&ce(this,Yt)[Yt]<this.limit?ce(this,Jo)[Jo](e):ce(this,zu)[zu](e,t)}wrapSyncFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];let a=n.run(()=>(e(...o),queueMicrotask(()=>a.done()),()=>{}),t);return{abortOn:uy,abort(){a.abort()}}}}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];let a,l=new Promise((c,d)=>{a=n.run(()=>{let p,g;try{g=Promise.resolve(e(...o))}catch(h){g=Promise.reject(h)}return g.then(h=>{p?d(p):(a.done(),c(h))},h=>{p?d(p):(a.done(),d(h))}),h=>{p=jE(h)}},t)});return l.abort=c=>{a.abort(c)},l.abortOn=uy,l}}resume(){ce(this,Xt)[Xt]=!1,clearTimeout(ce(this,An)[An]);for(let e=0;e<this.limit;e++)ce(this,Ui)[Ui]()}pause(e){e===void 0&&(e=null),ce(this,Xt)[Xt]=!0,clearTimeout(ce(this,An)[An]),e!=null&&(ce(this,An)[An]=setTimeout(ce(this,Lu)[Lu],e))}rateLimit(e){clearTimeout(ce(this,Vi)[Vi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(ce(this,Bn)[Bn]=this.limit-1,this.limit=ce(this,wt)[wt],ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],e))}get isPaused(){return ce(this,Xt)[Xt]}};function VE(i){ce(this,Yt)[Yt]+=1;let e=!1,t;try{t=i()}catch(n){throw ce(this,Yt)[Yt]-=1,n}return{abort:n=>{e||(e=!0,ce(this,Yt)[Yt]-=1,t?.(n),ce(this,Ui)[Ui]())},done:()=>{e||(e=!0,ce(this,Yt)[Yt]-=1,ce(this,Ui)[Ui]())}}}function UE(){queueMicrotask(()=>ce(this,Hu)[Hu]())}function WE(){if(ce(this,Xt)[Xt]||ce(this,Yt)[Yt]>=this.limit||ce(this,xt)[xt].length===0)return;let i=ce(this,xt)[xt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=ce(this,Jo)[Jo](i.fn);i.abort=e.abort,i.done=e.done}function $E(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{ce(this,ju)[ju](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=ce(this,xt)[xt].findIndex(r=>t.priority>r.priority);return n===-1?ce(this,xt)[xt].push(t):ce(this,xt)[xt].splice(n,0,t),t}function qE(i){let e=ce(this,xt)[xt].indexOf(i);e!==-1&&ce(this,xt)[xt].splice(e,1)}var r8=Symbol("__queue");var Wu=De(ao(),1),my=De(py(),1);var hy={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function fy(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var GE=0;function XE(i){return"__private_"+GE+++"_"+i}var YE={quality:.6,limit:10},es=XE("RateLimitedQueue"),Ja=class extends bn{constructor(e,t){super(e,v(v({},YE),t)),Object.defineProperty(this,es,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=hy,fy(this,es)[es]=new Za(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(e){return new Promise((t,n)=>{new my.default(e,D(v({},this.opts),{success:t,error:n}))})}prepareUpload(e){return B(this,null,function*(){let t=0,n=[],r=fy(this,es)[es].wrapPromiseFunction(s=>B(this,null,function*(){try{let a=yield this.compress(s.data),l=s.data.size-a.size;this.uppy.log(`[Image Compressor] Image ${s.id} compressed by ${(0,Wu.default)(l)}`),t+=l;let{name:c,type:d,size:p}=a,g=xi(c),_=`${xi(s.meta.name).name}.${g.extension}`;this.uppy.setFileState(s.id,D(v(v(v(v({},c&&{name:c}),g.extension&&{extension:g.extension}),d&&{type:d}),p&&{size:p}),{data:a,meta:D(v({},s.meta),{type:d,name:_})})),n.push(s)}catch(a){this.uppy.log(`[Image Compressor] Failed to compress ${s.id}:`,"warning"),this.uppy.log(a,"warning")}})),o=e.map(s=>{var a;let l=this.uppy.getFile(s);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)),!((a=l.type)!=null&&a.startsWith("image/")))?Promise.resolve():r(l)});yield Promise.all(o),this.uppy.emit("compressor:complete",n),t>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,Wu.default)(t)}),"info");for(let s of e){let a=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",a)}})}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};var yy=De(gy(),1);function KE(i,e){if(i&1&&(f(0,"small",5),x(1),m()),i&2){let t=O();y(),I(t.subtitle)}}function QE(i,e){if(i&1&&(f(0,"a",6),le(1,"i",7),x(2," Download Template "),m()),i&2){let t=O();jn("top-58",t.subtitle),E("href",t.sampleUrl,as)}}function ZE(i,e){if(i&1&&(ml(0),x(1),gl()),i&2){let t=O(2);y(),ti("- ",t.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function JE(i,e){if(i&1&&(f(0,"div",4)(1,"h4",8),x(2,"CSV File Content Summary"),m(),le(3,"hr"),f(4,"p",9),x(5),ue(6,ZE,2,1,"ng-container",10),m()()),i&2){let t=O();y(5),ti("",t.rowSummary().rowCount," rows found "),y(),E("ngIf",t.rowSummary().rowEmpty>0)}}var vy=(()=>{class i{static{this.sizes=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]}static{this.kilobyte=1024}constructor(){this.sampleUrl="",this.subtitle="",this.showSample=!0,this.showSubtitle=!0,this.uppyCoreConfiguration=hl(),this.dashboardPropsConfiguration=hl(),this.fileUploaded=new lt,this.fileUploadComplete=new lt,this.fileRemoved=new lt,this.onParser=new lt,this.multipleFilesUploaded=new lt,this.http=N(am),this.csvParser=N(sm),this.rowSummary=q({rowCount:0,rowEmpty:0}),this.file=q(null),this.multipleFiles=q([]),this.uppy=new hr({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6}}).use(Ja,{mimeType:"image/jpeg",convertSize:1/0,convertTypes:["image/png"]}),this.dashboardProps={hideUploadButton:!0,height:350},bl(()=>this.uppy.setOptions(v({},this.uppyCoreConfiguration()))),bl(()=>this.dashboardProps=v(v({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(t,n)=>{let r=n[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(t,n,r),this.fileUploaded.emit(r),this.file.set(n[0].data),yy.default.parse(r,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:o=>{let s=o.split(/\r?\n/).slice(1);return s[s.length-1]===""&&s.pop(),this.rowSummary.update(a=>D(v({},a),{rowCount:s.length})),s.forEach(a=>{a.split(",").every(c=>c==="")&&this.rowSummary.update(c=>D(v({},c),{rowEmpty:c.rowEmpty+1}))}),o},error(o,s){console.log("ERROR",o,s)},complete:(o,s)=>{this.onParser.emit(o.data)}})}),this.uppy.on("complete",t=>{let n=t.successful?.map(o=>({file:o.data,id:o.id}))??[],r=t.successful[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(r),this.fileUploadComplete.emit(r),this.multipleFilesUploaded.emit(n),this.file.set(r),this.multipleFiles.set(n)}),this.uppy.on("transloadit:upload",(t,n)=>{console.log(t,n)}),this.uppy.on("transloadit:result",(t,n)=>{console.log(t,n)}),this.uppy.on("file-removed",t=>{this.showSample=!0,this.showSubtitle=!0,this.file.set(null);let r=this.multipleFiles().filter(o=>o.id!=t.id);this.multipleFiles.set(r),this.fileRemoved.emit(t.id),this.rowSummary.set({rowCount:0,rowEmpty:0})})}formatFileSize(t,n=2){if(t===0)return"0 bytes";let r=Math.floor(Math.log(t)/Math.log(i.kilobyte));return`${(t/Math.pow(i.kilobyte,r)).toFixed(n)} ${i.sizes[r]}`}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["POS-uppy"]],inputs:{sampleUrl:"sampleUrl",subtitle:"subtitle",uppyCoreConfiguration:[1,"uppyCoreConfiguration"],dashboardPropsConfiguration:[1,"dashboardPropsConfiguration"]},outputs:{fileUploaded:"fileUploaded",fileUploadComplete:"fileUploadComplete",fileRemoved:"fileRemoved",onParser:"onParser",multipleFilesUploaded:"multipleFilesUploaded"},standalone:!0,features:[ye],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(n,r){if(n&1&&(f(0,"div",0),le(1,"uppy-dashboard",1),ue(2,KE,2,1,"small",2)(3,QE,3,3,"a",3)(4,JE,7,2,"div",4),m()),n&2){let o;y(),E("uppy",r.uppy)("props",r.dashboardProps),y(),E("ngIf",r.subtitle&&r.showSubtitle),y(),E("ngIf",r.sampleUrl&&r.showSample),y(),Ce(r.file()&&((o=r.file())==null?null:o.type)==="text/csv"?4:-1)}},dependencies:[dy,cy,ni,Wn],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 by=(()=>{class i{constructor(){this.file=null,this.sample_URL="https://res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",this.fb=N(Yi),this.httpService=N(bi),this.destroyRef=N(Xe),this.activeModal=N(Xn)}ngOnInit(){this.form=this.fb.group({file:new nt("",[ct.required])})}onSelectFile(t){t instanceof File&&(this.file=t)}onOK(){let t=`https://${localStorage.getItem("Domain")}`;if(this.file){let n=new FormData;n.append("file",this.file,this.file.name),n.append("OutletID",""),this.httpService.postFormData("API/catalog/product/UploadCSVforBarcode",n,void 0,t).pipe(Je(this.destroyRef)).subscribe({next:r=>{this.activeModal.close(r)}})}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-dialog-import-product"]],standalone:!0,features:[ye],decls:2,vars:2,consts:[["title","Upload New Product Barcode?",3,"onOK","hasValid"],[3,"fileUploaded","sampleUrl"]],template:function(n,r){n&1&&(f(0,"app-base-modal",0),U("onOK",function(){return r.onOK()}),f(1,"POS-uppy",1),U("fileUploaded",function(s){return r.onSelectFile(s)}),m()()),n&2&&(E("hasValid",r.form.valid),y(),E("sampleUrl",r.sample_URL))},dependencies:[Ys,rt,vy],styles:["pos-uppy div div h4{font-size:14px;margin:0} pos-uppy div div hr{margin:0!important} pos-uppy div div p.fs-6{font-size:1rem!important}"]})}}return i})();var eD=(i,e)=>e.Uuid;function tD(i,e){if(i&1&&(f(0,"span",46),x(1),Ue(2,"maskito"),m()),i&2){let t=O(2).$implicit,n=O();y(),I(Ti(2,1,n.promotionDiscount(t.Promotions),n.options))}}function iD(i,e){if(i&1&&(f(0,"div",37)(1,"span",44),x(2),Ue(3,"maskito"),m(),ue(4,tD,3,4,"span",45),m()),i&2){let t=O().$implicit,n=O();y(2),I(Ti(3,2,t.UnitPrice,n.options)),y(2),E("ngIf",t.Promotions)}}function nD(i,e){if(i&1&&(f(0,"div",37)(1,"span"),x(2),Ue(3,"maskito"),m()()),i&2){let t=O(2).$implicit,n=O();y(2),I(Ti(3,1,t.Print[0].UnitPrice,n.options))}}function rD(i,e){if(i&1&&(f(0,"div",37)(1,"span"),x(2),Ue(3,"maskito"),m()()),i&2){let t=O(2).$implicit,n=O();y(2),I(Ti(3,1,t.UnitPrice,n.options))}}function oD(i,e){if(i&1&&ue(0,nD,4,4,"div",37)(1,rD,4,4,"div",37),i&2){let t=O().$implicit;Ce(t.Print&&t.Print.length>0?0:1)}}function sD(i,e){i&1&&le(0,"i",40)}function aD(i,e){i&1&&le(0,"i",41)}function lD(i,e){if(i&1){let t=Ie();f(0,"tr")(1,"td"),x(2),m(),f(3,"td"),x(4),m(),f(5,"td"),x(6),Ue(7,"number"),m(),f(8,"td"),ue(9,iD,5,5,"div",37)(10,oD,2,1),m(),f(11,"td")(12,"div",38)(13,"button",39),U("click",function(){let r=se(t).$implicit,o=O();return ae(o.onToggleSelected(r))}),ue(14,sD,1,0,"i",40)(15,aD,1,0,"i",41),m(),f(16,"button",42),U("click",function(){let r=se(t).$implicit,o=O();return ae(o.onRemoveItem(r))}),le(17,"i",43),m()()()()}if(i&2){let t=e.$implicit,n=O();y(2),I(t.Name),y(2),I(t.Code),y(2),I(ii(7,6,t.Quantity)),y(3),Ce(t.Promotions?9:10),y(5),Ce(t.isSelected&&n.productEdit?14:15),y(2),E("disabled",t.isSelected&&n.productEdit)}}var _y=(()=>{class i{constructor(){this.productItems=[],this.storeService=N(ke),this.Object=Object,this.options=dr({precision:2,thousandSeparator:","}),this.modalService=N(Ap),this.httpService=N(bi),this.router=N($n),this.route=N(ys)}ngOnInit(){}onNext(){this.storeService.onNextStep(),this.storeService.productItems().length>0&&(this.storeService.stepperRef().selected.completed=!0,this.storeService.stepperRef().next())}onOpenModalChooseProduct(){return B(this,null,function*(){let n=yield this.modalService.open(ra,{centered:!0}).result;if(n){let r=[...this.storeService.productItems()],o=r.findIndex(a=>a.ID===n.ID);o!==-1?r[o].Quantity+=n.Quantity:r.push(n);let s=[...r];this.storeService.onChangeProductItems(s),_l.production||localStorage.setItem("productItems",JSON.stringify(s))}})}onOpenModalEdit(t){return B(this,null,function*(){let n=this.modalService.open(ra,{centered:!0,scrollable:!0});n.componentInstance.data=t;try{let r=yield n.result;if(r){let o=[...this.storeService.productItems()],s=o.findIndex(l=>l.ID===r.ID);s!==-1?o[s]=r:o.push(r);let a=[...o];this.storeService.onChangeProductItems(a),_l.production||localStorage.setItem("productItems",JSON.stringify(a))}}catch{}})}ngAfterViewInit(){this.productItems=this.storeService.productItems().map(t=>D(v({},t),{isSelected:!1}))}onToggleSelected(t){let n=[...this.storeService.productItems()],r=n.findIndex(o=>o.Uuid.toLowerCase()===t.Uuid.toLowerCase());r!==-1?n.every(s=>!s.isSelected)?n[r].isSelected=!n[r].isSelected||!1:n.forEach(s=>s.isSelected=!1):n.forEach(o=>o.isSelected=!1),this.router.navigate(["/pages"],{queryParams:{id:n[r].isSelected?t.Uuid:null}})}onOpenDialogImportProduct(){return B(this,null,function*(){let n=yield this.modalService.open(by,{scrollable:!0,centered:!0}).result,r=[...this.storeService.productItems()];n.forEach(o=>{r.push(D(v({},o),{Uuid:io(),ID:o.VariantID}))}),this.storeService.onChangeProductItems(r),console.log("result",n)})}onOpenDialogLoadTransaction(){return B(this,null,function*(){let n=yield this.modalService.open(im,{scrollable:!0,centered:!0}).result,o=`https://${localStorage.getItem("Domain")}`;if(console.log("result",n),n!==void 0)switch(n.role){case"ok":let s={Number:n.data.number,Outlet:n.data.outlet},a=n.data.type===0?"/API/V3/Barcode/byBillNumber":"/API/V3/Barcode/byOutletDeliveryNumber";this.httpService.post(a,s,void 0,o).pipe(xe(l=>{let c=[...this.storeService.productItems()];l.forEach(d=>{c.push(D(v({},d),{Uuid:io(),ID:d.VariantID}))}),this.storeService.onChangeProductItems(c)})).subscribe();break}})}onRemoveItem(t){let r=[...this.storeService.productItems()].filter(o=>o.Uuid.toLowerCase()!==t.Uuid.toLowerCase());this.storeService.onChangeProductItems(r)}onActivate(t){return B(this,null,function*(){t.type==="click"&&(yield this.onOpenModalEdit(t.row))})}promotionDiscount(t){try{return Object.keys(t).length?t.Discount&&t.Discount>0?t.UnitPrice-t.UnitPrice*t.Discount/100:t.UnitPrice:0}catch(n){throw new Error("error: ",n)}}onClear(){this.storeService.onChangeProductItems([])}get productEdit(){return this.route.snapshot.queryParamMap.has("id")}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["choose-product"]],viewQuery:function(n,r){if(n&1&&yi(Kp,5),n&2){let o;Jt(o=ei())&&(r.verticalSidebar=o.first)}},standalone:!0,features:[ye],decls:58,vars:5,consts:[[1,"d-flex","flex-column","gap-3","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],[1,"btn-group"],["ngbDropdown","","placement","bottom-end",1,"btn-group"],["type","button",1,"btn","btn-outline-secondary","text-dark","d-flex","gap-2","align-items-baseline",3,"click"],[1,"fa-solid","fa-upload","fs-3"],[1,"fs-3"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-toggle-split"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic1"],["ngbDropdownItem","",1,"dropdown-item","text-dark","d-flex","gap-2","align-items-baseline",3,"click"],[1,"fa-regular","fa-file-lines","fs-3"],[1,"fa-solid","fa-trash","fs-3"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click","disabled"],[1,"f","fas","fa-angle-right"],[1,"mx-3","flex-grow-1"],[1,"row"],[1,"col-8"],[1,"container",2,"padding-left","2px","padding-right","0px"],[1,"card","h-100"],[1,"card-body",2,"padding","0.8rem","height","calc(100vh - 100px)"],[1,"table-responsive",2,"max-height","100%","height","100%","overflow-y","auto"],[1,"table"],[2,"position","sticky","top","0","background-color","white","border","1px solid rgba(0, 0, 0, 0.12)","z-index","1"],["scope","col"],["scope","col",2,"width","10%"],["scope","col",1,"text-end",2,"width","10%"],[1,"col"],[1,"card"],[1,"card-body",2,"padding","0.8rem"],[1,"d-flex","flex-column","text-end"],[1,"w-100","d-flex","justify-content-end","align-items-center"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-check","fs-5","text-primary"],[1,"fa-solid","fa-pen-to-square","fs-5"],["type","button",1,"btn","btn-link",3,"click","disabled"],[1,"fas","fa-trash","me-1","text-danger","fs-5"],[1,"text-decoration-line-through","text-danger"],["class","text-dark",4,"ngIf"],[1,"text-dark"]],template:function(n,r){n&1&&(f(0,"div",0)(1,"header",1)(2,"nav",2)(3,"div",3)(4,"div",4)(5,"ul",5)(6,"li",6)(7,"h3",7),x(8,"Choose Product"),m()()(),f(9,"ul",8)(10,"div",9)(11,"div",10)(12,"div",11)(13,"button",12),U("click",function(){return r.onOpenDialogImportProduct()}),le(14,"i",13),f(15,"span",14),x(16,"Upload"),m()(),le(17,"button",15),f(18,"div",16)(19,"button",17),U("click",function(){return r.onOpenDialogLoadTransaction()}),le(20,"i",18),f(21,"span",14),x(22,"Load Transaction"),m()(),f(23,"button",17),U("click",function(){return r.onClear()}),le(24,"i",19),f(25,"span",14),x(26,"Clear"),m()()()()(),f(27,"button",20),U("click",function(){return r.onNext()}),f(28,"span",14),x(29,"Next"),m(),le(30,"i",21),m()()()()(),x(31,' " '),m()(),f(32,"div",22)(33,"div",23)(34,"div",24)(35,"div",25)(36,"div",26)(37,"div",27)(38,"div",28)(39,"table",29)(40,"thead",30)(41,"tr")(42,"th",31),x(43,"Name"),m(),f(44,"th",31),x(45,"Code"),m(),f(46,"th",32),x(47,"Qty"),m(),f(48,"th",33),x(49," Price "),m(),le(50,"th",32),m()(),f(51,"tbody"),Qt(52,lD,18,8,"tr",null,eD),m()()()()()()(),f(54,"div",34)(55,"div",35)(56,"div",36),le(57,"modal-choose-product"),m()()()()()()),n&2&&(y(),Lt("data-navbarbg",r.storeService.options().navbarbg),y(),E("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),E("ngbCollapse",!r.storeService.options().isCollapsed),Lt("data-navbarbg",r.storeService.options().navbarbg),y(24),E("disabled",r.storeService.productItems().length<=0),y(25),Zt(r.storeService.productItems()))},dependencies:[ni,Xi,Wn,gs,Mp,Op,Ip,Fp,Rp,Gn,Mf,om,ra],styles:[".dropdown-toggle:after{display:inline-block!important}[_nghost-%COMP%] .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell{background:#f6f6f6!important;font-weight:600;font-size:14px;color:#3b3b3b}[_nghost-%COMP%] .ngx-datatable .datatable-body{border:none}[_nghost-%COMP%] .ngx-datatable.material{border:none}[_ngcontent-%COMP%]:hover .ngx-datatable.material .datatable-header{border:1px solid rgba(0,0,0,.12)}[_nghost-%COMP%] .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell{display:flex;align-items:center;font-size:12px}[_nghost-%COMP%] .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell .datatable-body-cell-label{width:100%}[_nghost-%COMP%] .ngx-datatable.material .empty-row{font-size:12px}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{background:#f6f6f6!important;font-weight:600;font-size:14px;color:#3b3b3b}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.12)}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{font-weight:400;font-size:12px;vertical-align:middle}.dropdown-item[_ngcontent-%COMP%]:hover{background-color:#ddd;color:#333}.dropdown-menu.show[_ngcontent-%COMP%]{padding:.5rem 0}"],changeDetection:0})}}return i})();var ts="px",wy=dr({postfix:ts,min:0,thousandSeparator:""}),{plugins:cD}=wy,dD=Ln(wy,["plugins"]),Rt=D(v({},dD),{plugins:[...cD,Of(i=>[0,i.length-ts.length]),cr("focus",i=>{i.setSelectionRange(0,i.value.length-ts.length)}),cr("blur",i=>{i.value===ts&&sr(i,`0${ts}`)})]});function uD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.barcodeHeight)}}function pD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}function hD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.barcode)}}function fD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.code)}}function mD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.price)}}function gD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.name)}}function yD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.moveProductName)}}function vD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.releaseDate)}}function bD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.discountVisible)}}function _D(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookPrice)}}function wD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookFontSize)}}var xy=(()=>{class i{constructor(){this.options=Rt,this.barcodeHeight=q(0),this.fontSize=q(0),this.barcode=q(!1),this.code=q(!1),this.price=q(!1),this.name=q(!1),this.moveProductName=q(!1),this.releaseDate=q(!1),this.discountVisible=q(!1),this.pricebookPrice=q(!1),this.pricebookFontSize=q(0),this.tooltip={barcodeHeight:"The height of the generated barcode in pixels",fontSize:"Change all font size (except price)",barcode:"Whether barcode is visible",code:"Whether variant code is visible",price:"Whether variant price is visible",name:"Whether variant name is visible",moveProductName:"Whether move variant name below variant code or below variant price",releaseDate:"Whether release data is visible",discountVisible:"Whether variant's sell price discount is visible",pricebookPrice:"Whether pricebook price is visible",pricebookFontSize:"Change font size for pricebook price"},this.storeService=N(ke),this.injector=N(Ge),this.destroyRef=N(Xe)}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.barcodeHeight.set(t.BarcodeHeight),this.fontSize.set(t.ProductNameFontSize),this.barcode.set(t.BarcodeVisible),this.code.set(t.CodeVisible),this.price.set(t.PriceVisible),this.name.set(t.NameVisible),this.moveProductName.set(t.MoveProductNameOnTop),this.releaseDate.set(t.ShowReleasedDate),this.discountVisible.set(t.ShowPriceDiscount),this.pricebookPrice.set(t.PricebookVisible),this.pricebookFontSize.set(t.PricebookFontSize)})).subscribe()}onInputHandler(t,n){switch(console.log("value",t),n){case"barcodeHeight":this.barcodeHeight.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"barcode":this.barcode.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BarcodeVisible:this.barcode()}));break;case"code":this.code.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{CodeVisible:this.code()}));break;case"price":this.price.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceVisible:this.price()}));break;case"name":this.name.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{NameVisible:this.name()}));break;case"moveProductName":this.moveProductName.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{MoveProductNameOnTop:this.moveProductName()}));break;case"releaseDate":this.releaseDate.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ShowReleasedDate:this.releaseDate()}));break;case"discountVisible":this.discountVisible.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ShowPriceDiscount:this.discountVisible()}));break;case"pricebookPrice":this.pricebookPrice.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PricebookVisible:this.pricebookPrice()}));break;case"pricebookFontSize":this.pricebookFontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PricebookFontSize:this.pricebookFontSize()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-barcode-view"]],standalone:!0,features:[ye],decls:104,vars:18,consts:[["barcodeHeightTemplate",""],["fontSizeTemplate",""],["barcodeTemplate",""],["codeTemplate",""],["priceTemplate",""],["nameTemplate",""],["moveProductNameTemplate",""],["releaseDateTemplate",""],["discountVisibleTemplate",""],["pricebookPriceTemplate",""],["pricebookFontSizeTemplate",""],[1,"table","table-bordered"],["for","barcode",1,"fs-2"],[1,"form-check","form-switch"],["id","barcode","name","barcode","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","code",1,"fs-2"],["id","code","name","code","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],["for","price",1,"fs-2"],["id","price","name","price","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","name",1,"fs-2"],["id","name","name","name","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","moveProductName",1,"fs-2","d-inline-block","text-truncate"],["id","moveProductName","name","moveProductName","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","releaseDate",1,"fs-2"],["id","releaseDate","name","releaseDate","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","discountVisible",1,"fs-2"],["id","discountVisible","name","discountVisible","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","pricebookPrice",1,"fs-2"],["id","pricebookPrice","name","pricebookPrice","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",11)(1,"tbody")(2,"tr")(3,"td")(4,"label",12),x(5,"Barcode"),m()(),f(6,"td")(7,"div",13)(8,"input",14),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"barcode"))}),m()()(),f(9,"td")(10,"span",15),x(11),m()()(),f(12,"tr")(13,"td")(14,"label",16),x(15,"Code"),m()(),f(16,"td")(17,"div",13)(18,"input",17),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"code"))}),m()()(),f(19,"td")(20,"span",15),x(21),m()()(),f(22,"tr")(23,"th")(24,"label",18),x(25,"Price"),m()(),f(26,"td")(27,"div",13)(28,"input",19),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"price"))}),m()()(),f(29,"td")(30,"span",15),x(31),m()()(),f(32,"tr")(33,"td")(34,"label",20),x(35,"Name"),m()(),f(36,"td")(37,"div",13)(38,"input",21),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"name"))}),m()()(),f(39,"td")(40,"span",15),x(41),m()()(),f(42,"tr")(43,"td")(44,"label",22),x(45,"Move Product Name"),m()(),f(46,"td")(47,"div",13)(48,"input",23),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"moveProductName"))}),m()()(),f(49,"td")(50,"span",15),x(51),m()()(),f(52,"tr")(53,"td")(54,"label",24),x(55,"Release Date"),m()(),f(56,"td")(57,"div",13)(58,"input",25),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"releaseDate"))}),m()()(),f(59,"td")(60,"span",15),x(61),m()()(),f(62,"tr")(63,"td")(64,"label",26),x(65,"Discount Visible"),m()(),f(66,"td")(67,"div",13)(68,"input",27),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"discountVisible"))}),m()()(),f(69,"td")(70,"span",15),x(71),m()()(),f(72,"tr")(73,"td")(74,"label",28),x(75,"Pricebook Price"),m()(),f(76,"td")(77,"div",13)(78,"input",29),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"pricebookPrice"))}),m()()(),f(79,"td")(80,"span",15),x(81),m()()()()(),ue(82,uD,2,1,"ng-template",null,0,me)(84,pD,2,1,"ng-template",null,1,me)(86,hD,2,1,"ng-template",null,2,me)(88,fD,2,1,"ng-template",null,3,me)(90,mD,2,1,"ng-template",null,4,me)(92,gD,2,1,"ng-template",null,5,me)(94,yD,2,1,"ng-template",null,6,me)(96,vD,2,1,"ng-template",null,7,me)(98,bD,2,1,"ng-template",null,8,me)(100,_D,2,1,"ng-template",null,9,me)(102,wD,2,1,"ng-template",null,10,me)}n&2&&(y(8),E("checked",r.barcode())("ngModel",r.barcode()),y(3),I(r.tooltip.barcode),y(7),E("checked",r.code())("ngModel",r.code()),y(3),I(r.tooltip.code),y(7),E("ngModel",r.price()),y(3),I(r.tooltip.price),y(7),E("ngModel",r.name()),y(3),I(r.tooltip.name),y(7),E("ngModel",r.moveProductName()),y(3),I(r.tooltip.moveProductName),y(7),E("ngModel",r.releaseDate()),y(3),I(r.tooltip.releaseDate),y(7),E("ngModel",r.discountVisible()),y(3),I(r.tooltip.discountVisible),y(7),E("ngModel",r.pricebookPrice()),y(3),I(r.tooltip.pricebookPrice))},dependencies:[ht,qn,it,kt,rt,Fs],styles:[".col[_ngcontent-%COMP%]{padding:0!important}.fas[_ngcontent-%COMP%] .fa-info-circle[_ngcontent-%COMP%]{font-size:12px}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function xD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.priceWithTax)}}function CD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.selectedTax)}}function SD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.currency)}}function PD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}function ED(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.outletPrice)}}var Cy=(()=>{class i{constructor(){this.options=Rt,this.hasPriceTax=q(!1),this.selectedTax=q(""),this.taxType=q({}),this.currency=q(""),this.fontSize=q(0),this.outletPrice=q(""),this.tooltip={priceWithTax:"Tax is added to the product base price true",selectedTax:"Applied Tax ex: 100 + 10% = 110",currency:"The default currency",fontSize:"Change font size for price",outletPrice:"Price will be set according to the outlet price assigned when selected the outlet"},this.storeService=N(ke),this.destroyRef=N(Xe),this.injector=N(Ge),this.outlets=q([])}get taxs(){return this.storeService.taxs()}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(o=>{this.hasPriceTax.set(o.PriceWithTax),this.selectedTax.set(o.TaxType&&o.TaxType.ID),this.currency.set(o.CurrencySymbol),this.fontSize.set(o.PriceFontSize),this.outletPrice.set(o.OutletID)})).subscribe();let t=this.storeService.paperConfig().Outlets,n=this.storeService.productItems(),r=t.filter(o=>n.some(s=>s.OutletPrice.some(a=>a.Outlet===o.Name)));this.outlets.set(r),ft(this.storeService.productItems,{injector:this.injector}).pipe(xe(o=>{let s=o.some(a=>a.Promotions);this.outletPrice.set(s?"":this.outletPrice())})).subscribe(),ft(this.outletPrice,{injector:this.injector}).pipe(Kt(o=>!!o),xe(()=>{let o=[...this.storeService.productItems().map(s=>D(v({},s),{Promotions:null}))];this.storeService.onChangeProductItems(o)})).subscribe()}onInputHandler(t,n){switch(n){case"hasPriceTax":this.hasPriceTax.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceWithTax:this.hasPriceTax()}));break;case"selectedTax":let r=this.storeService.taxs().findIndex(o=>o.ID===t);r!==-1&&(this.selectedTax.set(t),this.taxType.set(this.storeService.taxs()[r])),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{TaxType:this.taxType()}));break;case"currency":this.currency.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{CurrencySymbol:this.currency()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break;case"outletPrice":if(this.outletPrice.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{OutletID:this.outletPrice()})),this.storeService.paperConfiguration().OutletID){let o=[...this.storeService.productItems().map(s=>D(v({},s),{Promotions:null}))];this.storeService.onChangeProductItems(o)}break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-price"]],standalone:!0,features:[ye],decls:49,vars:11,consts:[["priceWithTaxTemplate",""],["selectedTaxTemplate",""],["currencyTemplate",""],["fontSizeTemplate",""],["outletPriceTemplate",""],[1,"table","table-bordered"],["for","hasPriceTax",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["id","hasPriceTax","name","hasPriceTax","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","selectedTax",1,"fs-2","d-inline-block","text-truncate"],["id","selectedTax","name","selectedTax","bindLabel","Name","bindValue","ID","placeholder","Select Column",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],["for","currency",1,"fs-2","d-inline-block","text-truncate"],["id","currency","name","currency","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","outletPrice",1,"fs-2","d-inline-block","text-truncate"],["id","outletPrice","name","outletPrice","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",5)(1,"tbody")(2,"tr")(3,"td")(4,"label",6),x(5,"Price With Tax"),m()(),f(6,"td")(7,"div",7)(8,"input",8),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"hasPriceTax"))}),m()()(),f(9,"td")(10,"span",9),x(11),m()()(),f(12,"tr")(13,"td")(14,"label",10),x(15,"Selected Tax"),m()(),f(16,"td")(17,"ng-select",11),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"selectedTax"))}),m()(),f(18,"td")(19,"span",9),x(20),m()()(),f(21,"tr")(22,"td")(23,"label",12),x(24,"Currency"),m()(),f(25,"td")(26,"input",13),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"currency"))}),m()(),f(27,"td")(28,"span",9),x(29),m()()(),f(30,"tr")(31,"th")(32,"label",14),x(33,"Outlet Price"),m()(),f(34,"td")(35,"ng-select",15),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"outletPrice"))}),m()(),f(36,"td")(37,"span",9),x(38),m()()()()(),ue(39,xD,2,1,"ng-template",null,0,me)(41,CD,2,1,"ng-template",null,1,me)(43,SD,2,1,"ng-template",null,2,me)(45,PD,2,1,"ng-template",null,3,me)(47,ED,2,1,"ng-template",null,4,me)}n&2&&(y(8),E("checked",r.hasPriceTax())("ngModel",r.hasPriceTax()),y(3),I(r.tooltip.priceWithTax),y(6),E("ngModel",r.selectedTax())("items",r.taxs),y(3),I(r.tooltip.selectedTax),y(6),E("ngModel",r.currency()),y(3),I(r.tooltip.currency),y(6),E("ngModel",r.outletPrice())("items",r.outlets()),y(3),I(r.tooltip.outletPrice))},dependencies:[ht,tt,qn,it,kt,rt,ri,_i],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function DD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.maxCharacter)}}function kD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.namePrefix)}}function TD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.storeName)}}function ID(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.orientation)}}function OD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.useDescriptionAsCode)}}function FD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.removeDefault)}}var Sy=(()=>{class i{constructor(){this.storeService=N(ke),this.fb=N(Yi),this.destroyRef=N(Xe),this.injector=N(Ge),this.tooltip={maxCharacter:"The max character of the product name",namePrefix:"A word, letter, or number placed before product name",storeName:"The name of the store",orientation:"Horizontal or vertical position store name label",useDescriptionAsCode:"Copy product description into product code",removeDefault:"Remove 'Default' label from product name"},this.maxCharacter=q(0),this.namePrefix=q(""),this.storeName=q(""),this.orientation=q(0),this.useDescriptionAsCode=q(!1),this.removeDefault=q(!1),this.options=Rt}ngOnInit(){this.initForm(),ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.maxCharacter.set(t.ProductNameMaxLength),this.namePrefix.set(t.ProductNamePrefix),this.storeName.set(t.StoreName),this.orientation.set(t.Orientation),this.useDescriptionAsCode.set(t.DescriptionAsCode),this.removeDefault.set(!1)})).subscribe(),this.form.valueChanges.pipe(Je(this.destroyRef),xe(t=>{let n=D(v({},this.storeService.paperConfiguration()),{ProductNameMaxLength:t.maxCharacter,ProductNamePrefix:t.namePrefix,StoreName:t.storeName,Orientation:t.orientation,DescriptionAsCode:!!t.useDescriptionAsCode});this.storeService.onChangePaperConfiguration(n);let o=["ProductNameMaxLength","ProductNamePrefix","StoreName","Orientation","DescriptionAsCode"].reduce((s,a)=>(a in this.storeService.paperConfiguration()&&(s[a]=this.storeService.paperConfiguration()[a]),s),{});console.log("filtered advanced",o)})).subscribe()}onInputHandler(t,n){switch(n){case"maxCharacter":this.maxCharacter.set(+t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameMaxLength:this.maxCharacter()}));break;case"namePrefix":this.namePrefix.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNamePrefix:this.namePrefix()}));break;case"storeName":this.storeName.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{StoreName:this.storeName()}));break;case"orientation":this.orientation.set(+t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{Orientation:this.orientation()}));break;case"useDescriptionAsCode":this.useDescriptionAsCode.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{DescriptionAsCode:this.useDescriptionAsCode()}));break;case"removeDefault":this.removeDefault.set(!!t);break}}initForm(){this.form=this.fb.group({maxCharacter:new nt(this.storeService.paperConfiguration().ProductNameMaxLength,[ct.required]),namePrefix:new nt(null,[ct.required]),storeName:new nt(null,[ct.required]),orientation:new nt(null,[ct.required]),useDescriptionAsCode:new nt(null,[ct.required]),removeDefault:new nt("0",[ct.required])}),this.form.patchValue({maxCharacter:this.storeService.paperConfiguration().ProductNameMaxLength,namePrefix:this.storeService.paperConfiguration().ProductNamePrefix,storeName:this.storeService.paperConfiguration().StoreName,orientation:this.storeService.paperConfiguration().Orientation,useDescriptionAsCode:Number(this.storeService.paperConfiguration().DescriptionAsCode).toString()})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-advanced"]],standalone:!0,features:[ye],decls:70,vars:15,consts:[["maxCharacterTemplate",""],["namePrefixTemplate",""],["storeNameTemplate",""],["orientationTemplate",""],["useDescriptionAsCodeTemplate",""],["removeDefaultTemplate",""],[1,"table","table-bordered"],["for","MaxCharacter",1,"fs-2","d-inline-block","text-truncate"],["id","maxCharacter","name","maxCharacter","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],[1,"form-text","fst-italic","fw-medium","fs-2"],["for","namePrefix",1,"fs-2","d-inline-block","text-truncate"],["name","namePrefix","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","storeName",1,"fs-2","d-inline-block","text-truncate"],["id","storeName","name","storeName","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","orientation",1,"fs-2","d-inline-block","text-truncate"],["id","orientation","name","orientation","bindLabel","Value","bindValue","Key","placeholder","Select Column",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],["for","useDescriptionAsCode",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["id","useDescriptionAsCode","name","barcode","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],["for","removeDefault",1,"fs-2","d-inline-block","text-truncate"],["id","removeDefault","name","removeDefault","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",6)(1,"tbody")(2,"tr")(3,"td")(4,"label",7),x(5,"Max Character"),m()(),f(6,"td")(7,"input",8),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"maxCharacter"))}),m()(),f(8,"td")(9,"span",9),x(10),m()()(),f(11,"tr")(12,"td")(13,"label",10),x(14,"Name Prefix"),m()(),f(15,"td")(16,"input",11),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"namePrefix"))}),m()(),f(17,"td")(18,"span",9),x(19),m()()(),f(20,"tr")(21,"td")(22,"label",12),x(23,"Store Name"),m()(),f(24,"td")(25,"input",13),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"storeName"))}),m()(),f(26,"td")(27,"span",9),x(28),m()()(),f(29,"tr")(30,"th")(31,"label",14),x(32,"Orientation"),m()(),f(33,"td")(34,"ng-select",15),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"orientation"))}),m()(),f(35,"td")(36,"span",9),x(37),m()()(),f(38,"tr")(39,"td")(40,"label",16),x(41,"Use description as code"),m()(),f(42,"td")(43,"div",17)(44,"input",18),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"useDescriptionAsCode"))}),m()()(),f(45,"td")(46,"span",9),x(47),m()()(),f(48,"tr")(49,"td")(50,"label",19),x(51,'Remove "Default"'),m()(),f(52,"td")(53,"div",17)(54,"input",20),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"removeDefault"))}),m()()(),f(55,"td")(56,"span",9),x(57),m()()()()(),ue(58,DD,2,1,"ng-template",null,0,me)(60,kD,2,1,"ng-template",null,1,me)(62,TD,2,1,"ng-template",null,2,me)(64,ID,2,1,"ng-template",null,3,me)(66,OD,2,1,"ng-template",null,4,me)(68,FD,2,1,"ng-template",null,5,me)}n&2&&(y(7),E("ngModel",r.maxCharacter()),y(3),I(r.tooltip.maxCharacter),y(6),E("ngModel",r.namePrefix()),y(3),I(r.tooltip.namePrefix),y(6),E("ngModel",r.storeName()),y(3),I(r.tooltip.storeName),y(6),E("ngModel",r.orientation())("items",r.storeService.paperConfiguration().OrientationChoice),y(3),I(r.tooltip.orientation),y(7),E("checked",r.useDescriptionAsCode())("ngModel",r.useDescriptionAsCode()),y(3),I(r.tooltip.useDescriptionAsCode),y(7),E("checked",r.removeDefault())("ngModel",r.removeDefault()),y(3),I(r.tooltip.removeDefault))},dependencies:[rt,tt,qn,it,ri,_i,ht,kt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();var Py=(()=>{class i{transform(t,...n){let r=Number(t),o=Number(n[0]);return r*o/100+r}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=ss({name:"taxs",type:i,pure:!0,standalone:!0})}}return i})();var Ey=De(Fc());var RD=["barcode"],MD=i=>({"h-100":i}),Qe=i=>({"font-size.px":i});function AD(i,e){if(i&1&&(f(0,"div",3),le(1,"canvas",11,0),m()),i&2){let t=O(2);y(),E("ngStyle",t.barcodeStyle)}}function BD(i,e){if(i&1&&(f(0,"span",5),x(1),m()),i&2){let t=O().$implicit,n=O();E("ngStyle",Ae(2,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.Code)}}function ND(i,e){if(i&1&&(f(0,"span",13),x(1),m()),i&2){let t=O(3);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().ProductNamePrefix)}}function zD(i,e){if(i&1&&(f(0,"div",6),ue(1,ND,2,4,"span",12),f(2,"span",13),x(3),Ue(4,"slice"),m()()),i&2){let t=O().$implicit,n=O();y(),E("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),y(),E("ngStyle",Ae(7,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(vl(4,3,t.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function LD(i,e){if(i&1&&(f(0,"span",23),x(1),m()),i&2){let t=O(3);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function HD(i,e){if(i&1&&(f(0,"span",24),x(1),m()),i&2){let t=O(3);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function jD(i,e){if(i&1&&(f(0,"div",7)(1,"div",14)(2,"div",15),x(3),m(),f(4,"div",16),ue(5,LD,2,4,"span",17),f(6,"span",18),x(7),Ue(8,"number"),m()()(),f(9,"div",14)(10,"div",19),x(11),m(),f(12,"div",20),ue(13,HD,2,4,"span",21),f(14,"span",22),x(15),Ue(16,"number"),m()()()()),i&2){let t=O().$implicit,n=O();y(2),E("ngStyle",Ae(14,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),ti(" ",n.storeService.paperConfiguration().BasicPriceLabel," "),y(2),E("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),E("ngStyle",Ae(16,Qe,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ii(8,10,t.UnitPrice)),y(3),E("ngStyle",Ae(18,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),ti(" ",n.storeService.paperConfiguration().PromotionPriceLabel," "),y(2),E("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),E("ngStyle",Ae(20,Qe,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ii(16,12,n.promotionDiscount(t.Promotions)))}}function VD(i,e){if(i&1&&(f(0,"span",26),x(1),m()),i&2){let t=O(3);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function UD(i,e){if(i&1&&(f(0,"div",8),ue(1,VD,2,4,"span",25),f(2,"span",26),x(3),Ue(4,"taxs"),Ue(5,"number"),m()()),i&2){let t=O().$implicit,n=O();y(),E("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),E("ngStyle",Ae(8,Qe,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ii(5,6,Ti(4,3,t.UnitPrice,n.taxRate)))}}function WD(i,e){if(i&1&&(f(0,"span",26),x(1),m()),i&2){let t=O(5);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function $D(i,e){if(i&1&&(f(0,"div",8),ue(1,WD,2,4,"span",25),f(2,"span",26),x(3),Ue(4,"taxs"),Ue(5,"number"),m()()),i&2){let t=O().$implicit,n=O(3);y(),E("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),E("ngStyle",Ae(8,Qe,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ii(5,6,Ti(4,3,t.Price,n.taxRate)))}}function qD(i,e){if(i&1&&ue(0,$D,6,10,"div",8),i&2){let t=e.$implicit,n=O(3);Ce(t.Outlet===n.storeService.outlet$().Name?0:-1)}}function GD(i,e){if(i&1&&Qt(0,qD,1,1,null,null,ps),i&2){let t=O().$implicit;Zt(t.OutletPrice)}}function XD(i,e){if(i&1&&(f(0,"span",13),x(1),m()),i&2){let t=O(3);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().ProductNamePrefix)}}function YD(i,e){if(i&1&&(f(0,"div",9),ue(1,XD,2,4,"span",12),f(2,"span",13),x(3),Ue(4,"slice"),m()()),i&2){let t=O().$implicit,n=O();y(),E("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),y(),E("ngStyle",Ae(7,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(vl(4,3,t.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function KD(i,e){if(i&1&&(f(0,"div",27)(1,"span",13),x(2),m()()),i&2){let t=O(3);y(),E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().StoreName)}}function QD(i,e){if(i&1&&(f(0,"div",28)(1,"span",13),x(2),m()()),i&2){let t=O(3);y(),E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().StoreName)}}function ZD(i,e){if(i&1&&ue(0,KD,3,4,"div",27)(1,QD,3,4,"div",28),i&2){let t=O(2);Ce(t.storeService.paperConfiguration().Orientation===0?0:1)}}function JD(i,e){if(i&1&&(f(0,"div",8)(1,"span",13),x(2),Ue(3,"date"),m()()),i&2){let t=O().$implicit,n=O();y(),E("ngStyle",Ae(5,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(Ti(3,2,t.ReleasedDate,"dd MMM yyyy"))}}function ek(i,e){if(i&1&&(f(0,"div",8)(1,"span",13),x(2),m()()),i&2){let t=O().$implicit,n=O();y(),E("ngStyle",Ae(2,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),ti("",t.PriceDiscount,"% Off")}}function tk(i,e){if(i&1&&(f(0,"span"),x(1),m(),f(2,"span"),x(3,"-"),m(),f(4,"span"),x(5),m(),f(6,"span"),x(7,"-"),m(),f(8,"span"),x(9),Ue(10,"number"),m()),i&2){let t=e.$implicit;y(),I(t.Name),y(4),I(t.MinimumQuantity),y(4),I(ii(10,3,t.UnitPrice))}}function ik(i,e){if(i&1&&(f(0,"div",10),Qt(1,tk,11,5,null,null,Br),m()),i&2){let t=O().$implicit,n=O();E("ngStyle",Ae(1,Qe,n.storeService.paperConfiguration().PricebookFontSize)),y(),Zt(t.Pricebook)}}function nk(i,e){if(i&1&&(f(0,"div",2),ue(1,AD,3,1,"div",3),f(2,"div",4),ue(3,BD,2,4,"span",5)(4,zD,5,9,"div",6)(5,jD,17,22,"div",7)(6,UD,6,10,"div",8)(7,GD,2,0)(8,YD,5,9,"div",9)(9,ZD,2,1)(10,JD,4,7,"div",8)(11,ek,3,4,"div",8)(12,ik,3,3,"div",10),m()()),i&2){let t=e.$implicit,n=O();E("ngStyle",n.stickerStyles),y(),Ce(n.storeService.paperConfiguration().BarcodeVisible?1:-1),y(),E("ngClass",Ae(13,MD,!n.storeService.paperConfiguration().BarcodeVisible)),y(),Ce(n.storeService.paperConfiguration().CodeVisible?3:-1),y(),Ce(n.storeService.paperConfiguration().MoveProductNameOnTop&&n.storeService.paperConfiguration().NameVisible?4:-1),y(),Ce(t.Promotions&&n.storeService.paperConfiguration().PriceVisible?5:-1),y(),Ce(!t.Promotions&&!n.storeService.paperConfiguration().OutletID&&n.storeService.paperConfiguration().PriceVisible?6:-1),y(),Ce(n.storeService.paperConfiguration().OutletID&&n.storeService.paperConfiguration().PriceVisible?7:-1),y(),Ce(!n.storeService.paperConfiguration().MoveProductNameOnTop&&n.storeService.paperConfiguration().NameVisible?8:-1),y(),Ce(n.storeService.paperConfiguration().StoreName?9:-1),y(),Ce(n.storeService.paperConfiguration().ShowReleasedDate?10:-1),y(),Ce(n.storeService.paperConfiguration().ShowPriceDiscount?11:-1),y(),Ce(n.storeService.paperConfiguration().PricebookVisible?12:-1)}}var el=(()=>{class i{constructor(){this.items=[],this.previewType="single",this.storeService=N(ke),this.Object=Object,this.cdr=N(cn),this.renderer=N(ls),this.elementsInitialized=!1,this.injector=N(Ge)}get barcodeContainerStyles(){let t=/(?<=-\s)\d+/;return{display:"grid",gridTemplateColumns:`repeat(${this.storeService.paperConfiguration().Name.match(t)[0]}, ${this.items.length===1?"1fr":this.storeService.paperConfiguration().StickerWidth}px)`,gridAutoRows:`${this.storeService.paperConfiguration().StickerHeight}px`,columnGap:`${this.storeService.paperConfiguration().ColumnSpacing}px`,rowGap:`${this.storeService.paperConfiguration().RowSpacing}px`,padding:`${this.storeService.paperConfiguration().MarginTop}px ${this.storeService.paperConfiguration().MarginLeft}px`,maxHeight:"100%",height:`${this.previewType==="single"?"90px":"100%"}`,width:`${this.previewType==="single"?"250px":this.storeService.paperConfiguration().PaperWidth+"px"}`}}get stickerStyles(){let t=this.storeService.paperConfiguration().StickerWidth,n=this.storeService.paperConfiguration().StickerHeight,r=this.items.length===1&&this.previewType==="single"?"250px":`${typeof t=="number"?t+"px":t}`,o=`${this.previewType==="single"?"90px":n+"px"}`;return{width:r,height:o}}get barcodeStyle(){return{width:"100%",height:`${this.previewType==="single"?"25px":this.storeService.paperConfiguration().BarcodeHeight+"px"}`}}get taxRate(){if(this.storeService.paperConfiguration().TaxType){let n=this.storeService.taxs().findIndex(r=>r.ID===this.storeService.paperConfiguration().TaxType.ID);if(n!==-1)return this.storeService.taxs()[n].Rate}return 0}get stickerStoreName(){let t={order:"4",lineHeight:"15px"},n={position:"absolute",right:"0",top:"0",transform:"translate(0%, 20%) rotate(270deg)"};return this.storeService.paperConfiguration().Orientation===0?t:n}ngOnInit(){}ngAfterViewInit(){this.elementsInitialized=!0}ngAfterViewChecked(){this.generateBarcodes(),this.elementsInitialized&&(this.generateBarcodes(),this.elementsInitialized=!1)}generateBarcodes(){this.storeService.expandProductItems().forEach((t,n)=>{let r=this.barcodeRef.get(n)?.nativeElement;r&&(0,Ey.default)(r,t.Code,{format:"CODE128",lineColor:"#000",width:20,displayValue:!1})})}promotionDiscount(t){try{return Object.keys(t).length?t.Discount&&t.Discount>0?t.UnitPrice-t.UnitPrice*t.Discount/100:t.UnitPrice:0}catch(n){throw new Error("error: ",n)}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-barcode-preview"]],viewQuery:function(n,r){if(n&1&&yi(RD,5,Dt),n&2){let o;Jt(o=ei())&&(r.barcodeRef=o)}},inputs:{items:"items",previewType:"previewType"},standalone:!0,features:[ye],decls:3,vars:1,consts:[["barcode",""],["id","barcode-container",1,"barcode-container",3,"ngStyle"],[1,"sticker","position-relative","border","border-dark","d-flex","flex-column",3,"ngStyle"],[1,"sticker-header","d-flex","justify-content-center","px-1"],[1,"sticker-body","d-flex","flex-column","align-items-center","justify-content-center",3,"ngClass"],[1,"text-dark",2,"line-height","10px",3,"ngStyle"],[2,"line-height","10px","width","100%","text-align","center"],[1,"d-flex","flex-column",2,"line-height","10px"],[2,"line-height","10px"],[2,"line-height","0","width","100%","text-align","center"],[1,"d-flex","gap-1",2,"line-height","10px",3,"ngStyle"],["id","barcode",3,"ngStyle"],["class","text-dark",3,"ngStyle",4,"ngIf"],[1,"text-dark",3,"ngStyle"],[1,"d-flex","gap-2","align-items-center"],[1,"promotion__normalprice_label","text-dark","d-flex","justify-content-end",3,"ngStyle"],[1,"d-flex","gap-1"],["class","promotion__normalprice text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__normalprice","text-decoration-line-through","text-danger",3,"ngStyle"],[1,"promotion__price_label","text-dark","d-flex","justify-content-end",3,"ngStyle"],[1,"d-flex","gap-2"],["class","text-danger promotion__price text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__price","text-danger","text-dark",3,"ngStyle"],[1,"promotion__normalprice","text-dark",3,"ngStyle"],[1,"text-danger","promotion__price","text-dark",3,"ngStyle"],["class","price text-dark",3,"ngStyle",4,"ngIf"],[1,"price","text-dark",3,"ngStyle"],["id","store-name-horizontal",1,"",2,"line-height","10px"],["id","store-name-vertical",1,"position-absolute",2,"line-height","10px"]],template:function(n,r){n&1&&(f(0,"div",1),Qt(1,nk,13,15,"div",2,Br),m()),n&2&&(E("ngStyle",r.barcodeContainerStyles),y(),Zt(r.items))},dependencies:[_p,Py,Wn,xp,ni,Xi,Cp,gs],styles:["#barcode[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{height:100%}.storename[_ngcontent-%COMP%]{position:absolute;right:0;top:0;transform:translateY(20%) rotate(270deg)}#store-name-vertical[_ngcontent-%COMP%]{top:50%;right:0;transform:translateY(-50%) rotate(-90deg)}"],changeDetection:0})}}return i})();var Dy=(()=>{class i{constructor(){this.storeService=N(ke)}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-customize-label"]],standalone:!0,features:[ye],decls:58,vars:9,consts:[["scrollContainer",""],[1,"d-flex","flex-column","gap-3","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click"],[1,"f","fas","fa-angle-left"],[1,"fs-3"],[1,"f","fas","fa-angle-right"],[1,"row","mx-2","flex-grow-1","overflow-x-auto",2,"margin-bottom","1rem"],[1,"col-lg-6","col-md-6","d-flex","justify-content-center"],[1,"card","sticky-md-top",2,"height","fit-content"],[1,"card-body","d-flex","justify-content-center","align-items-center"],[3,"items"],[1,"col-lg-6","col-md-6"],[1,"card"],[1,"p-3"],[1,"card-title","mb-0","font-robotoslab",2,"font-size","16px"],[1,"card-body","border-top","p-1"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","",3,"collapsed"],["ngbAccordionHeader",""],["ngbAccordionButton",""],[1,"",2,"font-size","14px"],["ngbAccordionCollapse",""],["ngbAccordionBody","",1,"scroll-container"],[2,"font-size","14px"]],template:function(n,r){if(n&1){let o=Ie();f(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),x(8,"Customize Label"),m()()(),f(9,"ul",9)(10,"div",10)(11,"button",11),U("click",function(){return se(o),ae(r.storeService.onPrevStep())}),le(12,"i",12),f(13,"span",13),x(14,"Back"),m()(),f(15,"button",11),U("click",function(){return se(o),ae(r.storeService.onNextStep())}),f(16,"span",13),x(17,"Next"),m(),le(18,"i",14),m()()()()()()(),f(19,"div",15)(20,"div",16)(21,"div",17)(22,"div",18),le(23,"app-barcode-preview",19),m()()(),f(24,"div",20)(25,"div",21)(26,"div",22)(27,"h4",23),x(28," Sticker Content "),m()(),f(29,"div",24)(30,"div",25)(31,"div",26)(32,"h2",27)(33,"button",28)(34,"span",29),x(35,"Barcode View"),m()()(),f(36,"div",30)(37,"div",31,0),le(39,"app-barcode-view"),m()()(),f(40,"div",26)(41,"h2",27)(42,"button",28)(43,"span",32),x(44,"Price"),m()()(),f(45,"div",30)(46,"div",31,0),le(48,"app-price"),m()()(),f(49,"div",26)(50,"h2",27)(51,"button",28)(52,"span",32),x(53,"Advanced"),m()()(),f(54,"div",30)(55,"div",31,0),le(57,"app-advanced"),m()()()()()()()()()}n&2&&(y(),Lt("data-navbarbg",r.storeService.options().navbarbg),y(),E("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),E("ngbCollapse",!r.storeService.options().isCollapsed),Lt("data-navbarbg",r.storeService.options().navbarbg),y(20),E("items",r.storeService.expandProductItem()),y(7),E("closeOthers",!0),y(),E("collapsed",!1),y(9),E("collapsed",!0),y(9),E("collapsed",!0))},dependencies:[Ps,Ds,Es,Is,ks,Ts,rr,Gn,Xi,xy,Cy,Sy,el],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:100vh}"],changeDetection:0})}}return i})();function rk(i,e){if(i&1&&(f(0,"ng-option",3),x(1),m()),i&2){let t=e.$implicit;E("value",t.Name),y(),I(t.Name)}}var ky=(()=>{class i{onInputHandler(t,n){switch(n){case"paperWidth":this.paperWidth.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PaperWidth:this.paperWidth()}));break;case"stickerWidth":this.stickerWidth.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{StickerWidth:this.stickerWidth()}));break;case"stickerHeight":this.stickerHeight.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{StickerHeight:this.stickerHeight()}));break;case"barcodeHeight":this.barcodeHeight.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break}}constructor(){this.options=Rt,this.storeService=N(ke),this.destroyRef=N(Xe),this.injector=N(Ge),this.paperWidth=q(0),this.stickerWidth=q(0),this.stickerHeight=q(0),this.paperSource=q(""),this.barcodeHeight=q(0),this.fontSize=q(0),this.tooltip={paperWidth:"The width of the paper",stickerWidth:"The width of the sticker",stickerHeight:"The height of the sticker",barcodeHeight:"The height of the generated barcode in pixels",fontSize:"Change all font size (except price)"}}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(xe(t=>{this.paperWidth.set(t.PaperWidth),this.stickerWidth.set(t.StickerWidth),this.stickerHeight.set(t.StickerHeight),this.barcodeHeight.set(t.BarcodeHeight),this.fontSize.set(t.ProductNameFontSize)})).subscribe(),this.paperWidth.set(this.storeService.paperConfiguration().PaperWidth),this.stickerWidth.set(this.storeService.paperConfiguration().StickerWidth),this.stickerHeight.set(this.storeService.paperConfiguration().StickerHeight),this.paperSource.set(this.storeService.paperConfig().PaperFormats[0].Name),this.storeService.paperSource().length==0&&this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[0].Name)}onChangePaperSource(t){let n=this.storeService.paperConfig().PaperFormats.findIndex(r=>r.Name===t);n!==-1&&(this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[n].Name),this.storeService.onChangePaperConfiguration(this.storeService.paperConfig().PaperFormats[n]))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-pp-paper"]],standalone:!0,features:[ye],decls:58,vars:17,consts:[[1,"table","table-bordered"],["for","paperSource",1,"fs-2","d-inline-block","text-truncate"],["searchable","false","clearable","false","id","paperSource","name","paperSource","selecte","",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel"],[3,"value"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","paperWidth",1,"fs-2","d-inline-block","text-truncate"],["id","paperWidth","name","paperWidth","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","stickerWidth",1,"fs-2","d-inline-block","text-truncate"],["name","stickerWidth","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","stickerHeight",1,"fs-2","d-inline-block","text-truncate"],["id","stickerHeight","name","stickerHeight","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","barcode",1,"fs-2"],["id","barcodeHeight","name","barcodeHeight","type","text",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","fontSize",1,"fs-2","d-inline-block","text-truncate"],["id","fontSize","name","fontSize","type","text",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"]],template:function(n,r){n&1&&(f(0,"table",0)(1,"tbody")(2,"tr")(3,"td")(4,"label",1),x(5,"Paper Source"),m()(),f(6,"td")(7,"ng-select",2),U("ngModelChange",function(s){return r.onChangePaperSource(s)}),Qt(8,rk,2,2,"ng-option",3,Br),m()(),f(10,"td")(11,"span",4),x(12),m()()(),f(13,"tr")(14,"td")(15,"label",5),x(16,"Paper Width"),m()(),f(17,"td")(18,"input",6),U("ngModelChange",function(s){return r.onInputHandler(s,"paperWidth")}),m()(),f(19,"td")(20,"span",4),x(21),m()()(),f(22,"tr")(23,"td")(24,"label",7),x(25,"Sticker Width"),m()(),f(26,"td")(27,"input",8),U("ngModelChange",function(s){return r.onInputHandler(s,"stickerWidth")}),m()(),f(28,"td")(29,"span",4),x(30),m()()(),f(31,"tr")(32,"th")(33,"label",9),x(34,"Sticker Height"),m()(),f(35,"td")(36,"input",10),U("ngModelChange",function(s){return r.onInputHandler(s,"stickerHeight")}),m()(),f(37,"td")(38,"span",4),x(39),m()()(),f(40,"tr")(41,"td")(42,"label",11),x(43,"Barcode Height"),m()(),f(44,"td")(45,"input",12),U("ngModelChange",function(s){return r.onInputHandler(s,"barcodeHeight")}),m()(),f(46,"td")(47,"span",4),x(48),m()()(),f(49,"tr")(50,"td")(51,"label",13),x(52,"Font Size"),m()(),f(53,"td")(54,"input",14),U("ngModelChange",function(s){return r.onInputHandler(s,"fontSize")}),m()(),f(55,"td")(56,"span",4),x(57),m()()()()()),n&2&&(y(7),E("ngModel",r.storeService.paperSource()),y(),Zt(r.storeService.paperConfig().PaperFormats),y(4),I(r.tooltip.paperWidth),y(6),E("maskito",r.options)("ngModel",r.paperWidth()),y(3),I(r.tooltip.paperWidth),y(6),E("maskito",r.options)("ngModel",r.stickerWidth()),y(3),I(r.tooltip.stickerWidth),y(6),E("maskito",r.options)("ngModel",r.stickerHeight()),y(3),I(r.tooltip.stickerHeight),y(6),E("maskito",r.options)("ngModel",r.barcodeHeight()),y(3),I(r.tooltip.barcodeHeight),y(6),E("maskito",r.options)("ngModel",r.fontSize()),y(3),I(r.tooltip.fontSize))},dependencies:[ht,tt,it,kt,rt,ri,_i,Bs,Ji],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function ok(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.leftIndent)}}function sk(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.topIndent)}}function ak(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.rowSpacing)}}function lk(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.columnSpacing)}}var Ty=(()=>{class i{constructor(){this.options=Rt,this.tooltip={leftIndent:"The number of pixels appended before the first COLUMN",topIndent:"The number of pixels appended after the first ROW",rowSpacing:"The number of pixels between each ROW",columnSpacing:"The number of pixels between each COLUMN"},this.leftIndent=q(0),this.topIndent=q(0),this.rowSpacing=q(0),this.columnSpacing=q(0),this.storeService=N(ke),this.destroyRef=N(Xe),this.injector=N(Ge)}onInputHandler(t,n){switch(n){case"marginLeft":this.leftIndent.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{MarginLeft:this.leftIndent()}));break;case"marginTop":this.topIndent.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{MarginTop:this.topIndent()}));break;case"rowSpacing":this.rowSpacing.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{RowSpacing:this.rowSpacing()}));break;case"columnSpacing":this.columnSpacing.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ColumnSpacing:this.columnSpacing()}));break}}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.leftIndent.set(t.MarginLeft),this.topIndent.set(t.MarginTop),this.rowSpacing.set(t.RowSpacing),this.columnSpacing.set(t.ColumnSpacing)})).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-pp-spacing"]],standalone:!0,features:[ye],decls:46,vars:12,consts:[["leftIndentTemplate",""],["topIndentTemplate",""],["rowSpacingTemplate",""],["columnSpacingTemplate",""],[1,"table","table-bordered"],["for","leftIndent",1,"fs-2","d-inline-block","text-truncate"],["id","leftIndent","name","leftIndent","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","topIndent",1,"fs-2","d-inline-block","text-truncate"],["id","topIndent","name","topIndent","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","rowSpacing",1,"fs-2","d-inline-block","text-truncate"],["id","rowSpacing","name","rowSpacing","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","columnSpacing",1,"fs-2","d-inline-block","text-truncate"],["id","columnSpacing","name","columnSpacing","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",4)(1,"tbody")(2,"tr")(3,"td")(4,"label",5),x(5,"Left Indent"),m()(),f(6,"td")(7,"input",6),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"marginLeft"))}),m()(),f(8,"td")(9,"span",7),x(10),m()()(),f(11,"tr")(12,"td")(13,"label",8),x(14,"Top Indent"),m()(),f(15,"td")(16,"input",9),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"marginTop"))}),m()(),f(17,"td")(18,"span",7),x(19),m()()(),f(20,"tr")(21,"td")(22,"label",10),x(23,"Row Spacing"),m()(),f(24,"td")(25,"input",11),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"rowSpacing"))}),m()(),f(26,"td")(27,"span",7),x(28),m()()(),f(29,"tr")(30,"th")(31,"label",12),x(32,"Column Spacing"),m()(),f(33,"td")(34,"input",13),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"columnSpacing"))}),m()(),f(35,"td")(36,"span",7),x(37),m()()()()(),ue(38,ok,2,1,"ng-template",null,0,me)(40,sk,2,1,"ng-template",null,1,me)(42,ak,2,1,"ng-template",null,2,me)(44,lk,2,1,"ng-template",null,3,me)}n&2&&(y(7),E("maskito",r.options)("ngModel",r.leftIndent()),y(3),I(r.tooltip.leftIndent),y(6),E("maskito",r.options)("ngModel",r.topIndent()),y(3),I(r.tooltip.topIndent),y(6),E("maskito",r.options)("ngModel",r.rowSpacing()),y(3),I(r.tooltip.rowSpacing),y(6),E("maskito",r.options)("ngModel",r.columnSpacing()),y(3),I(r.tooltip.columnSpacing))},dependencies:[ht,tt,it,kt,rt,Ji,ri],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function ck(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.basicPriceLabel)}}function dk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.promotionPriceLabel)}}var Iy=(()=>{class i{constructor(){this.tooltip={basicPriceLabel:"Custom label normal price",promotionPriceLabel:"Custom label promotion price"},this.storeService=N(ke),this.destroyRef=N(Xe),this.injector=N(Ge),this.basicPriceLabel=q(""),this.promotionPriceLabel=q(""),this.options=Rt}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.basicPriceLabel.set(t.BasicPriceLabel),this.promotionPriceLabel.set(t.PromotionPriceLabel)})).subscribe()}onInputHandler(t,n){switch(n){case"basicPriceLabel":this.basicPriceLabel.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BasicPriceLabel:this.basicPriceLabel()}));break;case"promotionPriceLabel":this.promotionPriceLabel.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PromotionPriceLabel:this.promotionPriceLabel()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-pp-label"]],standalone:!0,features:[ye],decls:24,vars:4,consts:[["basicPriceLabelTemplate",""],["promotionPriceLabelTemplate",""],[1,"table","table-bordered"],["for","normalPrice",1,"fs-2","d-inline-block","text-truncate"],["id","normalPrice","name","basicPriceLabel","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","promotionPrice",1,"fs-2","d-inline-block","text-truncate"],["id","promotionPrice","name","promotionPriceLabel","type","text",1,"form-control","fs-1",3,"ngModelChange","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",2)(1,"tbody")(2,"tr")(3,"td")(4,"label",3),x(5,"Normal Price"),m()(),f(6,"td")(7,"input",4),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"basicPriceLabel"))}),m()(),f(8,"td")(9,"span",5),x(10),m()()(),f(11,"tr")(12,"td")(13,"label",6),x(14,"Promotion Price"),m()(),f(15,"td")(16,"input",7),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"promotionPriceLabel"))}),m()(),f(17,"td")(18,"span",5),x(19),m()()()()(),ue(20,ck,2,1,"ng-template",null,0,me)(22,dk,2,1,"ng-template",null,1,me)}n&2&&(y(7),E("ngModel",r.basicPriceLabel()),y(3),I(r.tooltip.basicPriceLabel),y(6),E("ngModel",r.promotionPriceLabel()),y(3),I(r.tooltip.promotionPriceLabel))},dependencies:[ht,tt,it,kt,rt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();var Ry=De(Oy());function uk(i,e){if(i&1){let t=Ie();f(0,"tr")(1,"td")(2,"label",6),x(3,"Pricebook Font Size"),m()(),f(4,"td")(5,"input",7),U("ngModelChange",function(r){se(t);let o=O();return ae(o.onInputHandler(r,"pricebookFontSize"))}),m()(),f(6,"td")(7,"span",5),x(8),m()()()}if(i&2){let t=O();y(5),E("maskito",t.options)("ngModel",t.pricebookFontSize()),y(3),I(t.tooltip.pricebookFontSize)}}function pk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookFontSize)}}function hk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}var Fy=(()=>{class i{constructor(){this.options=Rt,this.barcodeHeight=q(0),this.fontSize=q(0),this.barcode=q(!1),this.code=q(!1),this.price=q(!1),this.name=q(!1),this.moveProductName=q(!1),this.releaseDate=q(!1),this.discountVisible=q(!1),this.pricebookPrice=q(!1),this.pricebookFontSize=q(0),this.tooltip={fontSize:"Change font size for price",pricebookFontSize:"Change font size for pricebook price"},this.storeService=N(ke),this.injector=N(Ge),this.destroyRef=N(Xe)}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.pricebookFontSize.set(t.PricebookFontSize),this.fontSize.set(t.PriceFontSize)})).subscribe()}onInputHandler(t,n){switch(console.log("value",t),n){case"pricebookFontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-price-fontsize"]],standalone:!0,features:[ye],decls:16,vars:4,consts:[["pricebookFontSizeTemplate",""],["fontSizeTemplate",""],[1,"table","table-bordered"],["for","fontSize",1,"fs-2","d-inline-block","text-truncate"],["id","fontSize","name","fontSize","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","pricebookFontSize",1,"fs-2","d-inline-block","text-truncate"],["id","pricebookFontSize","name","pricebookFontSize","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",2)(1,"tbody"),ue(2,uk,9,3,"tr"),f(3,"tr")(4,"td")(5,"label",3),x(6,"Font Size"),m()(),f(7,"td")(8,"input",4),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"fontSize"))}),m()(),f(9,"td")(10,"span",5),x(11),m()()()()(),ue(12,pk,2,1,"ng-template",null,0,me)(14,hk,2,1,"ng-template",null,1,me)}n&2&&(y(2),Ce(r.storeService.paperConfiguration().PricebookVisible?2:-1),y(6),E("maskito",r.options)("ngModel",r.fontSize()),y(3),I(r.tooltip.fontSize))},dependencies:[Ji,ni,ht,tt,it,kt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"]})}}return i})();function fk(i,e){i&1&&(f(0,"button",14)(1,"span",13),x(2,"Next"),m(),le(3,"i",33),m())}function mk(i,e){if(i&1){let t=Ie();f(0,"button",34),U("click",function(){se(t);let r=O();return ae(r.printBarcode())}),f(1,"span",13),x(2,"Print"),m()()}}var My=(()=>{class i{constructor(){this.storeService=N(ke),this.httpService=N(bi),this.toastr=N(_s),this.destroyRef=N(Xe)}ngOnInit(){}printBarcode(){let t=/(?<=-\s)\d+/,n=this.storeService.paperConfiguration().Name.match(t)[0];(0,Ry.default)({printable:"barcode-container",type:"html",css:"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css",style:`
30
+ `,t={width:this.opts.width,height:this.opts.height};return p("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),p("div",{className:"uppy-DragDrop-inner"},i.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};kr.VERSION=NE.version;var Nu=class{onMount(e,t){this.options=v(v({},e),this.props),this.uppy.use(t,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(e,t){e.uppy&&this.uppy!==e.uppy.previousValue&&e.uppy.previousValue!==void 0&&(this.uninstall(e.uppy.previousValue),this.uppy.use(t,this.options)),this.options=v(v({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),e.props&&this.props!==e.props.previousValue&&e.props.previousValue!==void 0&&this.plugin.setOptions(v({},this.options))}uninstall(e=this.uppy){e.removePlugin(this.plugin)}},cy=(()=>{class i extends Nu{constructor(t){super(),this.el=t,this.uppy=new hr,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},Mn)}ngOnChanges(t){this.handleChanges(t,Mn)}ngOnDestroy(){this.uninstall()}static{this.\u0275fac=function(n){return new(n||i)(He(Dt))}}static{this.\u0275cmp=fe({type:i,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[fl,gi],decls:0,vars:0,template:function(n,r){},encapsulation:2,changeDetection:0})}}return i})();var dy=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Lt({type:i})}static{this.\u0275inj=Nt({})}}return i})();function ce(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var HE=0;function Ft(i){return"__private_"+HE+++"_"+i}function jE(i){return new Error("Cancelled",{cause:i})}function uy(i){if(i!=null){var e;let t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});let n=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,n,n)}return this}var Kt=Ft("activeRequests"),xt=Ft("queuedHandlers"),Yt=Ft("paused"),An=Ft("pauseTimer"),wt=Ft("downLimit"),Bn=Ft("upperLimit"),Vi=Ft("rateLimitingTimer"),Qo=Ft("call"),Ui=Ft("queueNext"),Hu=Ft("next"),Lu=Ft("queue"),ju=Ft("dequeue"),zu=Ft("resume"),Nn=Ft("increaseLimit"),Za=class{constructor(e){Object.defineProperty(this,ju,{value:qE}),Object.defineProperty(this,Lu,{value:$E}),Object.defineProperty(this,Hu,{value:WE}),Object.defineProperty(this,Ui,{value:UE}),Object.defineProperty(this,Qo,{value:VE}),Object.defineProperty(this,Kt,{writable:!0,value:0}),Object.defineProperty(this,xt,{writable:!0,value:[]}),Object.defineProperty(this,Yt,{writable:!0,value:!1}),Object.defineProperty(this,An,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:1}),Object.defineProperty(this,Bn,{writable:!0,value:void 0}),Object.defineProperty(this,Vi,{writable:!0,value:void 0}),Object.defineProperty(this,zu,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,Nn,{writable:!0,value:()=>{if(ce(this,Yt)[Yt]){ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],0);return}ce(this,wt)[wt]=this.limit,this.limit=Math.ceil((ce(this,Bn)[Bn]+ce(this,wt)[wt])/2);for(let t=ce(this,wt)[wt];t<=this.limit;t++)ce(this,Ui)[Ui]();ce(this,Bn)[Bn]-ce(this,wt)[wt]>3?ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],2e3):ce(this,wt)[wt]=Math.floor(ce(this,wt)[wt]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!ce(this,Yt)[Yt]&&ce(this,Kt)[Kt]<this.limit?ce(this,Qo)[Qo](e):ce(this,Lu)[Lu](e,t)}wrapSyncFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];let a=n.run(()=>(e(...o),queueMicrotask(()=>a.done()),()=>{}),t);return{abortOn:uy,abort(){a.abort()}}}}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];let a,l=new Promise((c,d)=>{a=n.run(()=>{let u,g;try{g=Promise.resolve(e(...o))}catch(h){g=Promise.reject(h)}return g.then(h=>{u?d(u):(a.done(),c(h))},h=>{u?d(u):(a.done(),d(h))}),h=>{u=jE(h)}},t)});return l.abort=c=>{a.abort(c)},l.abortOn=uy,l}}resume(){ce(this,Yt)[Yt]=!1,clearTimeout(ce(this,An)[An]);for(let e=0;e<this.limit;e++)ce(this,Ui)[Ui]()}pause(e){e===void 0&&(e=null),ce(this,Yt)[Yt]=!0,clearTimeout(ce(this,An)[An]),e!=null&&(ce(this,An)[An]=setTimeout(ce(this,zu)[zu],e))}rateLimit(e){clearTimeout(ce(this,Vi)[Vi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(ce(this,Bn)[Bn]=this.limit-1,this.limit=ce(this,wt)[wt],ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],e))}get isPaused(){return ce(this,Yt)[Yt]}};function VE(i){ce(this,Kt)[Kt]+=1;let e=!1,t;try{t=i()}catch(n){throw ce(this,Kt)[Kt]-=1,n}return{abort:n=>{e||(e=!0,ce(this,Kt)[Kt]-=1,t?.(n),ce(this,Ui)[Ui]())},done:()=>{e||(e=!0,ce(this,Kt)[Kt]-=1,ce(this,Ui)[Ui]())}}}function UE(){queueMicrotask(()=>ce(this,Hu)[Hu]())}function WE(){if(ce(this,Yt)[Yt]||ce(this,Kt)[Kt]>=this.limit||ce(this,xt)[xt].length===0)return;let i=ce(this,xt)[xt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=ce(this,Qo)[Qo](i.fn);i.abort=e.abort,i.done=e.done}function $E(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{ce(this,ju)[ju](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=ce(this,xt)[xt].findIndex(r=>t.priority>r.priority);return n===-1?ce(this,xt)[xt].push(t):ce(this,xt)[xt].splice(n,0,t),t}function qE(i){let e=ce(this,xt)[xt].indexOf(i);e!==-1&&ce(this,xt)[xt].splice(e,1)}var s8=Symbol("__queue");var Wu=De(oo(),1),my=De(py(),1);var hy={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function fy(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var GE=0;function XE(i){return"__private_"+GE+++"_"+i}var YE={quality:.6,limit:10},Zo=XE("RateLimitedQueue"),Ja=class extends bn{constructor(e,t){super(e,v(v({},YE),t)),Object.defineProperty(this,Zo,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=hy,fy(this,Zo)[Zo]=new Za(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(e){return new Promise((t,n)=>{new my.default(e,D(v({},this.opts),{success:t,error:n}))})}prepareUpload(e){return B(this,null,function*(){let t=0,n=[],r=fy(this,Zo)[Zo].wrapPromiseFunction(s=>B(this,null,function*(){try{let a=yield this.compress(s.data),l=s.data.size-a.size;this.uppy.log(`[Image Compressor] Image ${s.id} compressed by ${(0,Wu.default)(l)}`),t+=l;let{name:c,type:d,size:u}=a,g=xi(c),_=`${xi(s.meta.name).name}.${g.extension}`;this.uppy.setFileState(s.id,D(v(v(v(v({},c&&{name:c}),g.extension&&{extension:g.extension}),d&&{type:d}),u&&{size:u}),{data:a,meta:D(v({},s.meta),{type:d,name:_})})),n.push(s)}catch(a){this.uppy.log(`[Image Compressor] Failed to compress ${s.id}:`,"warning"),this.uppy.log(a,"warning")}})),o=e.map(s=>{var a;let l=this.uppy.getFile(s);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)),!((a=l.type)!=null&&a.startsWith("image/")))?Promise.resolve():r(l)});yield Promise.all(o),this.uppy.emit("compressor:complete",n),t>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,Wu.default)(t)}),"info");for(let s of e){let a=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",a)}})}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};var yy=De(gy(),1);function KE(i,e){if(i&1&&(f(0,"small",5),x(1),m()),i&2){let t=O();y(),I(t.subtitle)}}function QE(i,e){if(i&1&&(f(0,"a",6),le(1,"i",7),x(2," Download Template "),m()),i&2){let t=O();jn("top-58",t.subtitle),E("href",t.sampleUrl,os)}}function ZE(i,e){if(i&1&&(ml(0),x(1),gl()),i&2){let t=O(2);y(),Ht("- ",t.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function JE(i,e){if(i&1&&(f(0,"div",4)(1,"h4",8),x(2,"CSV File Content Summary"),m(),le(3,"hr"),f(4,"p",9),x(5),ue(6,ZE,2,1,"ng-container",10),m()()),i&2){let t=O();y(5),Ht("",t.rowSummary().rowCount," rows found "),y(),E("ngIf",t.rowSummary().rowEmpty>0)}}var vy=(()=>{class i{static{this.sizes=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]}static{this.kilobyte=1024}constructor(){this.sampleUrl="",this.subtitle="",this.showSample=!0,this.showSubtitle=!0,this.uppyCoreConfiguration=hl(),this.dashboardPropsConfiguration=hl(),this.fileUploaded=new lt,this.fileUploadComplete=new lt,this.fileRemoved=new lt,this.onParser=new lt,this.multipleFilesUploaded=new lt,this.http=N(am),this.csvParser=N(sm),this.rowSummary=q({rowCount:0,rowEmpty:0}),this.file=q(null),this.multipleFiles=q([]),this.uppy=new hr({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6}}).use(Ja,{mimeType:"image/jpeg",convertSize:1/0,convertTypes:["image/png"]}),this.dashboardProps={hideUploadButton:!0,height:350},bl(()=>this.uppy.setOptions(v({},this.uppyCoreConfiguration()))),bl(()=>this.dashboardProps=v(v({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(t,n)=>{let r=n[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(t,n,r),this.fileUploaded.emit(r),this.file.set(n[0].data),yy.default.parse(r,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:o=>{let s=o.split(/\r?\n/).slice(1);return s[s.length-1]===""&&s.pop(),this.rowSummary.update(a=>D(v({},a),{rowCount:s.length})),s.forEach(a=>{a.split(",").every(c=>c==="")&&this.rowSummary.update(c=>D(v({},c),{rowEmpty:c.rowEmpty+1}))}),o},error(o,s){console.log("ERROR",o,s)},complete:(o,s)=>{this.onParser.emit(o.data)}})}),this.uppy.on("complete",t=>{let n=t.successful?.map(o=>({file:o.data,id:o.id}))??[],r=t.successful[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(r),this.fileUploadComplete.emit(r),this.multipleFilesUploaded.emit(n),this.file.set(r),this.multipleFiles.set(n)}),this.uppy.on("transloadit:upload",(t,n)=>{console.log(t,n)}),this.uppy.on("transloadit:result",(t,n)=>{console.log(t,n)}),this.uppy.on("file-removed",t=>{this.showSample=!0,this.showSubtitle=!0,this.file.set(null);let r=this.multipleFiles().filter(o=>o.id!=t.id);this.multipleFiles.set(r),this.fileRemoved.emit(t.id),this.rowSummary.set({rowCount:0,rowEmpty:0})})}formatFileSize(t,n=2){if(t===0)return"0 bytes";let r=Math.floor(Math.log(t)/Math.log(i.kilobyte));return`${(t/Math.pow(i.kilobyte,r)).toFixed(n)} ${i.sizes[r]}`}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["POS-uppy"]],inputs:{sampleUrl:"sampleUrl",subtitle:"subtitle",uppyCoreConfiguration:[1,"uppyCoreConfiguration"],dashboardPropsConfiguration:[1,"dashboardPropsConfiguration"]},outputs:{fileUploaded:"fileUploaded",fileUploadComplete:"fileUploadComplete",fileRemoved:"fileRemoved",onParser:"onParser",multipleFilesUploaded:"multipleFilesUploaded"},standalone:!0,features:[ye],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(n,r){if(n&1&&(f(0,"div",0),le(1,"uppy-dashboard",1),ue(2,KE,2,1,"small",2)(3,QE,3,3,"a",3)(4,JE,7,2,"div",4),m()),n&2){let o;y(),E("uppy",r.uppy)("props",r.dashboardProps),y(),E("ngIf",r.subtitle&&r.showSubtitle),y(),E("ngIf",r.sampleUrl&&r.showSample),y(),Ce(r.file()&&((o=r.file())==null?null:o.type)==="text/csv"?4:-1)}},dependencies:[dy,cy,ri,Wn],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 by=(()=>{class i{constructor(){this.file=null,this.sample_URL="https://res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",this.fb=N(Yi),this.httpService=N(bi),this.destroyRef=N(Xe),this.activeModal=N(Xn)}ngOnInit(){this.form=this.fb.group({file:new nt("",[ct.required])})}onSelectFile(t){t instanceof File&&(this.file=t)}onOK(){let t=`https://${localStorage.getItem("Domain")}`;if(this.file){let n=new FormData;n.append("file",this.file,this.file.name),n.append("OutletID",""),this.httpService.postFormData("API/catalog/product/UploadCSVforBarcode",n,void 0,t).pipe(Je(this.destroyRef)).subscribe({next:r=>{this.activeModal.close(r)}})}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-dialog-import-product"]],standalone:!0,features:[ye],decls:2,vars:2,consts:[["title","Upload New Product Barcode?",3,"onOK","hasValid"],[3,"fileUploaded","sampleUrl"]],template:function(n,r){n&1&&(f(0,"app-base-modal",0),U("onOK",function(){return r.onOK()}),f(1,"POS-uppy",1),U("fileUploaded",function(s){return r.onSelectFile(s)}),m()()),n&2&&(E("hasValid",r.form.valid),y(),E("sampleUrl",r.sample_URL))},dependencies:[Xs,rt,vy],styles:["pos-uppy div div h4{font-size:14px;margin:0} pos-uppy div div hr{margin:0!important} pos-uppy div div p.fs-6{font-size:1rem!important}"]})}}return i})();var eD=(i,e)=>e.Uuid;function tD(i,e){if(i&1&&(f(0,"span",46),x(1),Ue(2,"maskito"),m()),i&2){let t=O(2).$implicit,n=O();y(),I(Ti(2,1,n.promotionDiscount(t.Promotions),n.options))}}function iD(i,e){if(i&1&&(f(0,"div",37)(1,"span",44),x(2),Ue(3,"maskito"),m(),ue(4,tD,3,4,"span",45),m()),i&2){let t=O().$implicit,n=O();y(2),I(Ti(3,2,t.UnitPrice,n.options)),y(2),E("ngIf",t.Promotions)}}function nD(i,e){if(i&1&&(f(0,"div",37)(1,"span"),x(2),Ue(3,"maskito"),m()()),i&2){let t=O(2).$implicit,n=O();y(2),I(Ti(3,1,t.Print[0].UnitPrice,n.options))}}function rD(i,e){if(i&1&&(f(0,"div",37)(1,"span"),x(2),Ue(3,"maskito"),m()()),i&2){let t=O(2).$implicit,n=O();y(2),I(Ti(3,1,t.UnitPrice,n.options))}}function oD(i,e){if(i&1&&ue(0,nD,4,4,"div",37)(1,rD,4,4,"div",37),i&2){let t=O().$implicit;Ce(t.Print&&t.Print.length>0?0:1)}}function sD(i,e){i&1&&le(0,"i",40)}function aD(i,e){i&1&&le(0,"i",41)}function lD(i,e){if(i&1){let t=Ie();f(0,"tr")(1,"td"),x(2),m(),f(3,"td"),x(4),m(),f(5,"td"),x(6),Ue(7,"number"),m(),f(8,"td"),ue(9,iD,5,5,"div",37)(10,oD,2,1),m(),f(11,"td")(12,"div",38)(13,"button",39),U("click",function(){let r=se(t).$implicit,o=O();return ae(o.onToggleSelected(r))}),ue(14,sD,1,0,"i",40)(15,aD,1,0,"i",41),m(),f(16,"button",42),U("click",function(){let r=se(t).$implicit,o=O();return ae(o.onRemoveItem(r))}),le(17,"i",43),m()()()()}if(i&2){let t=e.$implicit,n=O();y(2),I(t.Name),y(2),I(t.Code),y(2),I(ni(7,6,t.Quantity)),y(3),Ce(t.Promotions?9:10),y(5),Ce(t.isSelected&&n.productEdit?14:15),y(2),E("disabled",t.isSelected&&n.productEdit)}}var _y=(()=>{class i{constructor(){this.productItems=[],this.storeService=N(ke),this.Object=Object,this.options=dr({precision:2,thousandSeparator:","}),this.modalService=N(Ap),this.httpService=N(bi),this.router=N($n),this.route=N(gs)}ngOnInit(){}onNext(){this.storeService.onNextStep(),this.storeService.productItems().length>0&&(this.storeService.stepperRef().selected.completed=!0,this.storeService.stepperRef().next())}onOpenModalChooseProduct(){return B(this,null,function*(){let n=yield this.modalService.open(ra,{centered:!0}).result;if(n){let r=[...this.storeService.productItems()],o=r.findIndex(a=>a.ID===n.ID);o!==-1?r[o].Quantity+=n.Quantity:r.push(n);let s=[...r];this.storeService.onChangeProductItems(s),_l.production||localStorage.setItem("productItems",JSON.stringify(s))}})}onOpenModalEdit(t){return B(this,null,function*(){let n=this.modalService.open(ra,{centered:!0,scrollable:!0});n.componentInstance.data=t;try{let r=yield n.result;if(r){let o=[...this.storeService.productItems()],s=o.findIndex(l=>l.ID===r.ID);s!==-1?o[s]=r:o.push(r);let a=[...o];this.storeService.onChangeProductItems(a),_l.production||localStorage.setItem("productItems",JSON.stringify(a))}}catch{}})}ngAfterViewInit(){this.productItems=this.storeService.productItems().map(t=>D(v({},t),{isSelected:!1}))}onToggleSelected(t){let n=[...this.storeService.productItems()],r=n.findIndex(o=>o.Uuid.toLowerCase()===t.Uuid.toLowerCase());r!==-1?n.every(s=>!s.isSelected)?n[r].isSelected=!n[r].isSelected||!1:n.forEach(s=>s.isSelected=!1):n.forEach(o=>o.isSelected=!1),this.router.navigate(["/pages"],{queryParams:{id:n[r].isSelected?t.Uuid:null}})}onOpenDialogImportProduct(){return B(this,null,function*(){let n=yield this.modalService.open(by,{scrollable:!0,centered:!0}).result,r=[...this.storeService.productItems()];n.forEach(o=>{r.push(D(v({},o),{Uuid:ia(),ID:o.VariantID}))}),this.storeService.onChangeProductItems(r),console.log("result",n)})}onOpenDialogLoadTransaction(){return B(this,null,function*(){let n=yield this.modalService.open(im,{scrollable:!0,centered:!0}).result,o=`https://${localStorage.getItem("Domain")}`;if(console.log("result",n),n!==void 0)switch(n.role){case"ok":let s={Number:n.data.number,Outlet:n.data.outlet},a=n.data.type===0?"/API/V3/Bill/Number":"/API/V3/TransferOrder/Detail ";this.httpService.post(a,s,void 0,o).pipe(Qt(l=>D(v({},l),{Variants:l.Variants.map(c=>D(v({},c),{UnitPrice:c.Price}))})),xe(l=>{let c=[...this.storeService.productItems()];l.Variants.forEach(d=>{let u=c.findIndex(g=>g.ID===d.ID);u!==-1?c[u].Quantity+=d.Quantity:c.push(d)}),this.storeService.onChangeProductItems(c)})).subscribe();break}})}onRemoveItem(t){let r=[...this.storeService.productItems()].filter(o=>o.Uuid.toLowerCase()!==t.Uuid.toLowerCase());this.storeService.onChangeProductItems(r)}onActivate(t){return B(this,null,function*(){t.type==="click"&&(yield this.onOpenModalEdit(t.row))})}promotionDiscount(t){try{return Object.keys(t).length?t.Discount&&t.Discount>0?t.UnitPrice-t.UnitPrice*t.Discount/100:t.UnitPrice:0}catch(n){throw new Error("error: ",n)}}onClear(){this.storeService.onChangeProductItems([])}get productEdit(){return this.route.snapshot.queryParamMap.has("id")}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["choose-product"]],viewQuery:function(n,r){if(n&1&&yi(Kp,5),n&2){let o;ti(o=ii())&&(r.verticalSidebar=o.first)}},standalone:!0,features:[ye],decls:58,vars:5,consts:[[1,"d-flex","flex-column","gap-3","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],[1,"btn-group"],["ngbDropdown","","placement","bottom-end",1,"btn-group"],["type","button",1,"btn","btn-outline-secondary","text-dark","d-flex","gap-2","align-items-baseline",3,"click"],[1,"fa-solid","fa-upload","fs-3"],[1,"fs-3"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-toggle-split"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic1"],["ngbDropdownItem","",1,"dropdown-item","text-dark","d-flex","gap-2","align-items-baseline",3,"click"],[1,"fa-regular","fa-file-lines","fs-3"],[1,"fa-solid","fa-trash","fs-3"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click","disabled"],[1,"f","fas","fa-angle-right"],[1,"mx-3","flex-grow-1"],[1,"row"],[1,"col-8"],[1,"container",2,"padding-left","2px","padding-right","0px"],[1,"card","h-100"],[1,"card-body",2,"padding","0.8rem","height","calc(100vh - 100px)"],[1,"table-responsive",2,"max-height","100%","height","100%","overflow-y","auto"],[1,"table"],[2,"position","sticky","top","0","background-color","white","border","1px solid rgba(0, 0, 0, 0.12)","z-index","1"],["scope","col"],["scope","col",2,"width","10%"],["scope","col",1,"text-end",2,"width","10%"],[1,"col"],[1,"card"],[1,"card-body",2,"padding","0.8rem"],[1,"d-flex","flex-column","text-end"],[1,"w-100","d-flex","justify-content-end","align-items-center"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-check","fs-5","text-primary"],[1,"fa-solid","fa-pen-to-square","fs-5"],["type","button",1,"btn","btn-link",3,"click","disabled"],[1,"fas","fa-trash","me-1","text-danger","fs-5"],[1,"text-decoration-line-through","text-danger"],["class","text-dark",4,"ngIf"],[1,"text-dark"]],template:function(n,r){n&1&&(f(0,"div",0)(1,"header",1)(2,"nav",2)(3,"div",3)(4,"div",4)(5,"ul",5)(6,"li",6)(7,"h3",7),x(8,"Choose Product"),m()()(),f(9,"ul",8)(10,"div",9)(11,"div",10)(12,"div",11)(13,"button",12),U("click",function(){return r.onOpenDialogImportProduct()}),le(14,"i",13),f(15,"span",14),x(16,"Upload"),m()(),le(17,"button",15),f(18,"div",16)(19,"button",17),U("click",function(){return r.onOpenDialogLoadTransaction()}),le(20,"i",18),f(21,"span",14),x(22,"Load Transaction"),m()(),f(23,"button",17),U("click",function(){return r.onClear()}),le(24,"i",19),f(25,"span",14),x(26,"Clear"),m()()()()(),f(27,"button",20),U("click",function(){return r.onNext()}),f(28,"span",14),x(29,"Next"),m(),le(30,"i",21),m()()()()(),x(31,' " '),m()(),f(32,"div",22)(33,"div",23)(34,"div",24)(35,"div",25)(36,"div",26)(37,"div",27)(38,"div",28)(39,"table",29)(40,"thead",30)(41,"tr")(42,"th",31),x(43,"Name"),m(),f(44,"th",31),x(45,"Code"),m(),f(46,"th",32),x(47,"Qty"),m(),f(48,"th",33),x(49," Price "),m(),le(50,"th",32),m()(),f(51,"tbody"),Jt(52,lD,18,8,"tr",null,eD),m()()()()()()(),f(54,"div",34)(55,"div",35)(56,"div",36),le(57,"modal-choose-product"),m()()()()()()),n&2&&(y(),zt("data-navbarbg",r.storeService.options().navbarbg),y(),E("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),E("ngbCollapse",!r.storeService.options().isCollapsed),zt("data-navbarbg",r.storeService.options().navbarbg),y(24),E("disabled",r.storeService.productItems().length<=0),y(25),ei(r.storeService.productItems()))},dependencies:[ri,Xi,Wn,ms,Mp,Op,Ip,Fp,Rp,Gn,Mf,om,ra],styles:[".dropdown-toggle:after{display:inline-block!important}[_nghost-%COMP%] .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell{background:#f6f6f6!important;font-weight:600;font-size:14px;color:#3b3b3b}[_nghost-%COMP%] .ngx-datatable .datatable-body{border:none}[_nghost-%COMP%] .ngx-datatable.material{border:none}[_ngcontent-%COMP%]:hover .ngx-datatable.material .datatable-header{border:1px solid rgba(0,0,0,.12)}[_nghost-%COMP%] .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell{display:flex;align-items:center;font-size:12px}[_nghost-%COMP%] .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell .datatable-body-cell-label{width:100%}[_nghost-%COMP%] .ngx-datatable.material .empty-row{font-size:12px}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{background:#f6f6f6!important;font-weight:600;font-size:14px;color:#3b3b3b}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.12)}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{font-weight:400;font-size:12px;vertical-align:middle}.dropdown-item[_ngcontent-%COMP%]:hover{background-color:#ddd;color:#333}.dropdown-menu.show[_ngcontent-%COMP%]{padding:.5rem 0}"],changeDetection:0})}}return i})();var Jo="px",wy=dr({postfix:Jo,min:0,thousandSeparator:""}),{plugins:cD}=wy,dD=zn(wy,["plugins"]),Rt=D(v({},dD),{plugins:[...cD,Of(i=>[0,i.length-Jo.length]),cr("focus",i=>{i.setSelectionRange(0,i.value.length-Jo.length)}),cr("blur",i=>{i.value===Jo&&sr(i,`0${Jo}`)})]});function uD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.barcodeHeight)}}function pD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}function hD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.barcode)}}function fD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.code)}}function mD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.price)}}function gD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.name)}}function yD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.moveProductName)}}function vD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.releaseDate)}}function bD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.discountVisible)}}function _D(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookPrice)}}function wD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookFontSize)}}var xy=(()=>{class i{constructor(){this.options=Rt,this.barcodeHeight=q(0),this.fontSize=q(0),this.barcode=q(!1),this.code=q(!1),this.price=q(!1),this.name=q(!1),this.moveProductName=q(!1),this.releaseDate=q(!1),this.discountVisible=q(!1),this.pricebookPrice=q(!1),this.pricebookFontSize=q(0),this.UOMVisible=q(!1),this.tooltip={barcodeHeight:"The height of the generated barcode in pixels",fontSize:"Change all font size (except price)",barcode:"Whether barcode is visible",code:"Whether variant code is visible",price:"Whether variant price is visible",name:"Whether variant name is visible",moveProductName:"Whether move variant name below variant code or below variant price",releaseDate:"Whether release data is visible",discountVisible:"Whether variant's sell price discount is visible",pricebookPrice:"Whether pricebook price is visible",pricebookFontSize:"Change font size for pricebook price",UOMVisible:"Whether UOM is visible"},this.storeService=N(ke),this.injector=N(Ge),this.destroyRef=N(Xe)}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.barcodeHeight.set(t.BarcodeHeight),this.fontSize.set(t.ProductNameFontSize),this.barcode.set(t.BarcodeVisible),this.code.set(t.CodeVisible),this.price.set(t.PriceVisible),this.name.set(t.NameVisible),this.moveProductName.set(t.MoveProductNameOnTop),this.releaseDate.set(t.ShowReleasedDate),this.discountVisible.set(t.ShowPriceDiscount),this.pricebookPrice.set(t.PricebookVisible),this.pricebookFontSize.set(t.PricebookFontSize),this.UOMVisible.set(t.UOMNameVisible)})).subscribe()}onInputHandler(t,n){switch(console.log("value",t),n){case"barcodeHeight":this.barcodeHeight.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"barcode":this.barcode.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BarcodeVisible:this.barcode()}));break;case"code":this.code.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{CodeVisible:this.code()}));break;case"price":this.price.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceVisible:this.price()}));break;case"name":this.name.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{NameVisible:this.name()}));break;case"moveProductName":this.moveProductName.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{MoveProductNameOnTop:this.moveProductName()}));break;case"releaseDate":this.releaseDate.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ShowReleasedDate:this.releaseDate()}));break;case"discountVisible":this.discountVisible.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ShowPriceDiscount:this.discountVisible()}));break;case"pricebookPrice":this.pricebookPrice.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PricebookVisible:this.pricebookPrice()}));break;case"pricebookFontSize":this.pricebookFontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PricebookFontSize:this.pricebookFontSize()}));break;case"UOMVisible":this.UOMVisible.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{UOMNameVisible:this.UOMVisible()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-barcode-view"]],standalone:!0,features:[ye],decls:114,vars:20,consts:[["barcodeHeightTemplate",""],["fontSizeTemplate",""],["barcodeTemplate",""],["codeTemplate",""],["priceTemplate",""],["nameTemplate",""],["moveProductNameTemplate",""],["releaseDateTemplate",""],["discountVisibleTemplate",""],["pricebookPriceTemplate",""],["pricebookFontSizeTemplate",""],[1,"table","table-bordered"],["for","barcode",1,"fs-2"],[1,"form-check","form-switch"],["id","barcode","name","barcode","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","code",1,"fs-2"],["id","code","name","code","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],["for","price",1,"fs-2"],["id","price","name","price","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","name",1,"fs-2"],["id","name","name","name","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","moveProductName",1,"fs-2","d-inline-block","text-truncate"],["id","moveProductName","name","moveProductName","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","releaseDate",1,"fs-2"],["id","releaseDate","name","releaseDate","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","discountVisible",1,"fs-2"],["id","discountVisible","name","discountVisible","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","pricebookPrice",1,"fs-2"],["id","pricebookPrice","name","pricebookPrice","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",11)(1,"tbody")(2,"tr")(3,"td")(4,"label",12),x(5,"Barcode"),m()(),f(6,"td")(7,"div",13)(8,"input",14),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"barcode"))}),m()()(),f(9,"td")(10,"span",15),x(11),m()()(),f(12,"tr")(13,"td")(14,"label",16),x(15,"Code"),m()(),f(16,"td")(17,"div",13)(18,"input",17),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"code"))}),m()()(),f(19,"td")(20,"span",15),x(21),m()()(),f(22,"tr")(23,"th")(24,"label",18),x(25,"Price"),m()(),f(26,"td")(27,"div",13)(28,"input",19),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"price"))}),m()()(),f(29,"td")(30,"span",15),x(31),m()()(),f(32,"tr")(33,"td")(34,"label",20),x(35,"Name"),m()(),f(36,"td")(37,"div",13)(38,"input",21),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"name"))}),m()()(),f(39,"td")(40,"span",15),x(41),m()()(),f(42,"tr")(43,"td")(44,"label",22),x(45,"Move Product Name"),m()(),f(46,"td")(47,"div",13)(48,"input",23),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"moveProductName"))}),m()()(),f(49,"td")(50,"span",15),x(51),m()()(),f(52,"tr")(53,"td")(54,"label",24),x(55,"Release Date"),m()(),f(56,"td")(57,"div",13)(58,"input",25),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"releaseDate"))}),m()()(),f(59,"td")(60,"span",15),x(61),m()()(),f(62,"tr")(63,"td")(64,"label",26),x(65,"Discount Visible"),m()(),f(66,"td")(67,"div",13)(68,"input",27),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"discountVisible"))}),m()()(),f(69,"td")(70,"span",15),x(71),m()()(),f(72,"tr")(73,"td")(74,"label",26),x(75,"UOM Visible"),m()(),f(76,"td")(77,"div",13)(78,"input",27),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"UOMVisible"))}),m()()(),f(79,"td")(80,"span",15),x(81),m()()(),f(82,"tr")(83,"td")(84,"label",28),x(85,"Pricebook Price"),m()(),f(86,"td")(87,"div",13)(88,"input",29),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"pricebookPrice"))}),m()()(),f(89,"td")(90,"span",15),x(91),m()()()()(),ue(92,uD,2,1,"ng-template",null,0,me)(94,pD,2,1,"ng-template",null,1,me)(96,hD,2,1,"ng-template",null,2,me)(98,fD,2,1,"ng-template",null,3,me)(100,mD,2,1,"ng-template",null,4,me)(102,gD,2,1,"ng-template",null,5,me)(104,yD,2,1,"ng-template",null,6,me)(106,vD,2,1,"ng-template",null,7,me)(108,bD,2,1,"ng-template",null,8,me)(110,_D,2,1,"ng-template",null,9,me)(112,wD,2,1,"ng-template",null,10,me)}n&2&&(y(8),E("checked",r.barcode())("ngModel",r.barcode()),y(3),I(r.tooltip.barcode),y(7),E("checked",r.code())("ngModel",r.code()),y(3),I(r.tooltip.code),y(7),E("ngModel",r.price()),y(3),I(r.tooltip.price),y(7),E("ngModel",r.name()),y(3),I(r.tooltip.name),y(7),E("ngModel",r.moveProductName()),y(3),I(r.tooltip.moveProductName),y(7),E("ngModel",r.releaseDate()),y(3),I(r.tooltip.releaseDate),y(7),E("ngModel",r.discountVisible()),y(3),I(r.tooltip.discountVisible),y(7),E("ngModel",r.UOMVisible()),y(3),I(r.tooltip.UOMVisible),y(7),E("ngModel",r.pricebookPrice()),y(3),I(r.tooltip.pricebookPrice))},dependencies:[ht,qn,it,kt,rt,Os],styles:[".col[_ngcontent-%COMP%]{padding:0!important}.fas[_ngcontent-%COMP%] .fa-info-circle[_ngcontent-%COMP%]{font-size:12px}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function xD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.priceWithTax)}}function CD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.selectedTax)}}function SD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.currency)}}function PD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}function ED(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.outletPrice)}}var Cy=(()=>{class i{constructor(){this.options=Rt,this.hasPriceTax=q(!1),this.selectedTax=q(""),this.taxType=q({}),this.currency=q(""),this.fontSize=q(0),this.outletPrice=q(""),this.tooltip={priceWithTax:"Tax is added to the product base price true",selectedTax:"Applied Tax ex: 100 + 10% = 110",currency:"The default currency",fontSize:"Change font size for price",outletPrice:"Price will be set according to the outlet price assigned when selected the outlet"},this.storeService=N(ke),this.destroyRef=N(Xe),this.injector=N(Ge),this.outlets=q([])}get taxs(){return this.storeService.taxs()}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(o=>{this.hasPriceTax.set(o.PriceWithTax),this.selectedTax.set(o.TaxType&&o.TaxType.ID),this.currency.set(o.CurrencySymbol),this.fontSize.set(o.PriceFontSize),this.outletPrice.set(o.OutletID)})).subscribe();let t=this.storeService.paperConfig().Outlets,n=this.storeService.productItems(),r=t.filter(o=>n.some(s=>s.OutletPrice.some(a=>a.Outlet===o.Name)));this.outlets.set(r),ft(this.storeService.productItems,{injector:this.injector}).pipe(xe(o=>{let s=o.some(a=>a.Promotions);this.outletPrice.set(s?"":this.outletPrice())})).subscribe(),ft(this.outletPrice,{injector:this.injector}).pipe(Zt(o=>!!o),xe(()=>{let o=[...this.storeService.productItems().map(s=>D(v({},s),{Promotions:null}))];this.storeService.onChangeProductItems(o)})).subscribe()}onInputHandler(t,n){switch(n){case"hasPriceTax":this.hasPriceTax.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceWithTax:this.hasPriceTax()}));break;case"selectedTax":let r=this.storeService.taxs().findIndex(o=>o.ID===t);r!==-1&&(this.selectedTax.set(t),this.taxType.set(this.storeService.taxs()[r])),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{TaxType:this.taxType()}));break;case"currency":this.currency.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{CurrencySymbol:this.currency()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break;case"outletPrice":if(this.outletPrice.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{OutletID:this.outletPrice()})),this.storeService.paperConfiguration().OutletID){let o=[...this.storeService.productItems().map(s=>D(v({},s),{Promotions:null}))];this.storeService.onChangeProductItems(o)}break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-price"]],standalone:!0,features:[ye],decls:49,vars:11,consts:[["priceWithTaxTemplate",""],["selectedTaxTemplate",""],["currencyTemplate",""],["fontSizeTemplate",""],["outletPriceTemplate",""],[1,"table","table-bordered"],["for","hasPriceTax",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["id","hasPriceTax","name","hasPriceTax","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","selectedTax",1,"fs-2","d-inline-block","text-truncate"],["id","selectedTax","name","selectedTax","bindLabel","Name","bindValue","ID","placeholder","Select Column",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],["for","currency",1,"fs-2","d-inline-block","text-truncate"],["id","currency","name","currency","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","outletPrice",1,"fs-2","d-inline-block","text-truncate"],["id","outletPrice","name","outletPrice","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",5)(1,"tbody")(2,"tr")(3,"td")(4,"label",6),x(5,"Price With Tax"),m()(),f(6,"td")(7,"div",7)(8,"input",8),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"hasPriceTax"))}),m()()(),f(9,"td")(10,"span",9),x(11),m()()(),f(12,"tr")(13,"td")(14,"label",10),x(15,"Selected Tax"),m()(),f(16,"td")(17,"ng-select",11),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"selectedTax"))}),m()(),f(18,"td")(19,"span",9),x(20),m()()(),f(21,"tr")(22,"td")(23,"label",12),x(24,"Currency"),m()(),f(25,"td")(26,"input",13),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"currency"))}),m()(),f(27,"td")(28,"span",9),x(29),m()()(),f(30,"tr")(31,"th")(32,"label",14),x(33,"Outlet Price"),m()(),f(34,"td")(35,"ng-select",15),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"outletPrice"))}),m()(),f(36,"td")(37,"span",9),x(38),m()()()()(),ue(39,xD,2,1,"ng-template",null,0,me)(41,CD,2,1,"ng-template",null,1,me)(43,SD,2,1,"ng-template",null,2,me)(45,PD,2,1,"ng-template",null,3,me)(47,ED,2,1,"ng-template",null,4,me)}n&2&&(y(8),E("checked",r.hasPriceTax())("ngModel",r.hasPriceTax()),y(3),I(r.tooltip.priceWithTax),y(6),E("ngModel",r.selectedTax())("items",r.taxs),y(3),I(r.tooltip.selectedTax),y(6),E("ngModel",r.currency()),y(3),I(r.tooltip.currency),y(6),E("ngModel",r.outletPrice())("items",r.outlets()),y(3),I(r.tooltip.outletPrice))},dependencies:[ht,tt,qn,it,kt,rt,oi,_i],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function DD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.maxCharacter)}}function kD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.namePrefix)}}function TD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.storeName)}}function ID(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.orientation)}}function OD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.useDescriptionAsCode)}}function FD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.removeDefault)}}var Sy=(()=>{class i{constructor(){this.storeService=N(ke),this.fb=N(Yi),this.destroyRef=N(Xe),this.injector=N(Ge),this.tooltip={maxCharacter:"The max character of the product name",namePrefix:"A word, letter, or number placed before product name",storeName:"The name of the store",orientation:"Horizontal or vertical position store name label",useDescriptionAsCode:"Copy product description into product code",removeDefault:"Remove 'Default' label from product name"},this.maxCharacter=q(0),this.namePrefix=q(""),this.storeName=q(""),this.orientation=q(0),this.useDescriptionAsCode=q(!1),this.removeDefault=q(!1),this.options=Rt}ngOnInit(){this.initForm(),ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.maxCharacter.set(t.ProductNameMaxLength),this.namePrefix.set(t.ProductNamePrefix),this.storeName.set(t.StoreName),this.orientation.set(t.Orientation),this.useDescriptionAsCode.set(t.DescriptionAsCode),this.removeDefault.set(!1)})).subscribe(),this.form.valueChanges.pipe(Je(this.destroyRef),xe(t=>{let n=D(v({},this.storeService.paperConfiguration()),{ProductNameMaxLength:t.maxCharacter,ProductNamePrefix:t.namePrefix,StoreName:t.storeName,Orientation:t.orientation,DescriptionAsCode:!!t.useDescriptionAsCode});this.storeService.onChangePaperConfiguration(n);let o=["ProductNameMaxLength","ProductNamePrefix","StoreName","Orientation","DescriptionAsCode"].reduce((s,a)=>(a in this.storeService.paperConfiguration()&&(s[a]=this.storeService.paperConfiguration()[a]),s),{});console.log("filtered advanced",o)})).subscribe()}onInputHandler(t,n){switch(n){case"maxCharacter":this.maxCharacter.set(+t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameMaxLength:this.maxCharacter()}));break;case"namePrefix":this.namePrefix.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNamePrefix:this.namePrefix()}));break;case"storeName":this.storeName.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{StoreName:this.storeName()}));break;case"orientation":this.orientation.set(+t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{Orientation:this.orientation()}));break;case"useDescriptionAsCode":this.useDescriptionAsCode.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{DescriptionAsCode:this.useDescriptionAsCode()}));break;case"removeDefault":this.removeDefault.set(!!t);break}}initForm(){this.form=this.fb.group({maxCharacter:new nt(this.storeService.paperConfiguration().ProductNameMaxLength,[ct.required]),namePrefix:new nt(null,[ct.required]),storeName:new nt(null,[ct.required]),orientation:new nt(null,[ct.required]),useDescriptionAsCode:new nt(null,[ct.required]),removeDefault:new nt("0",[ct.required])}),this.form.patchValue({maxCharacter:this.storeService.paperConfiguration().ProductNameMaxLength,namePrefix:this.storeService.paperConfiguration().ProductNamePrefix,storeName:this.storeService.paperConfiguration().StoreName,orientation:this.storeService.paperConfiguration().Orientation,useDescriptionAsCode:Number(this.storeService.paperConfiguration().DescriptionAsCode).toString()})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-advanced"]],standalone:!0,features:[ye],decls:70,vars:15,consts:[["maxCharacterTemplate",""],["namePrefixTemplate",""],["storeNameTemplate",""],["orientationTemplate",""],["useDescriptionAsCodeTemplate",""],["removeDefaultTemplate",""],[1,"table","table-bordered"],["for","MaxCharacter",1,"fs-2","d-inline-block","text-truncate"],["id","maxCharacter","name","maxCharacter","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],[1,"form-text","fst-italic","fw-medium","fs-2"],["for","namePrefix",1,"fs-2","d-inline-block","text-truncate"],["name","namePrefix","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","storeName",1,"fs-2","d-inline-block","text-truncate"],["id","storeName","name","storeName","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","orientation",1,"fs-2","d-inline-block","text-truncate"],["id","orientation","name","orientation","bindLabel","Value","bindValue","Key","placeholder","Select Column",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],["for","useDescriptionAsCode",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["id","useDescriptionAsCode","name","barcode","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],["for","removeDefault",1,"fs-2","d-inline-block","text-truncate"],["id","removeDefault","name","removeDefault","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",6)(1,"tbody")(2,"tr")(3,"td")(4,"label",7),x(5,"Max Character"),m()(),f(6,"td")(7,"input",8),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"maxCharacter"))}),m()(),f(8,"td")(9,"span",9),x(10),m()()(),f(11,"tr")(12,"td")(13,"label",10),x(14,"Name Prefix"),m()(),f(15,"td")(16,"input",11),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"namePrefix"))}),m()(),f(17,"td")(18,"span",9),x(19),m()()(),f(20,"tr")(21,"td")(22,"label",12),x(23,"Store Name"),m()(),f(24,"td")(25,"input",13),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"storeName"))}),m()(),f(26,"td")(27,"span",9),x(28),m()()(),f(29,"tr")(30,"th")(31,"label",14),x(32,"Orientation"),m()(),f(33,"td")(34,"ng-select",15),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"orientation"))}),m()(),f(35,"td")(36,"span",9),x(37),m()()(),f(38,"tr")(39,"td")(40,"label",16),x(41,"Use description as code"),m()(),f(42,"td")(43,"div",17)(44,"input",18),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"useDescriptionAsCode"))}),m()()(),f(45,"td")(46,"span",9),x(47),m()()(),f(48,"tr")(49,"td")(50,"label",19),x(51,'Remove "Default"'),m()(),f(52,"td")(53,"div",17)(54,"input",20),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"removeDefault"))}),m()()(),f(55,"td")(56,"span",9),x(57),m()()()()(),ue(58,DD,2,1,"ng-template",null,0,me)(60,kD,2,1,"ng-template",null,1,me)(62,TD,2,1,"ng-template",null,2,me)(64,ID,2,1,"ng-template",null,3,me)(66,OD,2,1,"ng-template",null,4,me)(68,FD,2,1,"ng-template",null,5,me)}n&2&&(y(7),E("ngModel",r.maxCharacter()),y(3),I(r.tooltip.maxCharacter),y(6),E("ngModel",r.namePrefix()),y(3),I(r.tooltip.namePrefix),y(6),E("ngModel",r.storeName()),y(3),I(r.tooltip.storeName),y(6),E("ngModel",r.orientation())("items",r.storeService.paperConfiguration().OrientationChoice),y(3),I(r.tooltip.orientation),y(7),E("checked",r.useDescriptionAsCode())("ngModel",r.useDescriptionAsCode()),y(3),I(r.tooltip.useDescriptionAsCode),y(7),E("checked",r.removeDefault())("ngModel",r.removeDefault()),y(3),I(r.tooltip.removeDefault))},dependencies:[rt,tt,qn,it,oi,_i,ht,kt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();var Py=(()=>{class i{transform(t,...n){let r=Number(t),o=Number(n[0]);return r*o/100+r}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=rs({name:"taxs",type:i,pure:!0,standalone:!0})}}return i})();var Ey=De(Fc());var RD=["barcode"],MD=(i,e)=>e.Uuid,AD=i=>({"h-100":i}),Qe=i=>({"font-size.px":i});function BD(i,e){if(i&1&&(f(0,"div",3),le(1,"canvas",11,0),m()),i&2){let t=O(2);y(),E("ngStyle",t.barcodeStyle)}}function ND(i,e){if(i&1&&(f(0,"span",5),x(1),m()),i&2){let t=O().$implicit,n=O();E("ngStyle",Ae(2,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.Code)}}function LD(i,e){if(i&1&&(f(0,"span",13),x(1),m()),i&2){let t=O(3);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().ProductNamePrefix)}}function zD(i,e){if(i&1&&(f(0,"div",6),ue(1,LD,2,4,"span",12),f(2,"span",13),x(3),Ue(4,"slice"),m()()),i&2){let t=O().$implicit,n=O();y(),E("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),y(),E("ngStyle",Ae(7,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(vl(4,3,t.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function HD(i,e){if(i&1&&(f(0,"span",24),x(1),m()),i&2){let t=O(3);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function jD(i,e){if(i&1&&(f(0,"span"),x(1),m()),i&2){let t=O(2).$implicit;y(),Ht("/",t.UOMName||"pcs","")}}function VD(i,e){if(i&1&&(f(0,"span",25),x(1),m()),i&2){let t=O(3);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function UD(i,e){if(i&1&&(f(0,"div",7)(1,"div",14)(2,"div",15),x(3),m(),f(4,"div",16),ue(5,HD,2,4,"span",17),f(6,"span",18),x(7),Ue(8,"number"),m(),ue(9,jD,2,1,"span",19),m()(),f(10,"div",14)(11,"div",20),x(12),m(),f(13,"div",21),ue(14,VD,2,4,"span",22),f(15,"span",23),x(16),Ue(17,"number"),m()()()()),i&2){let t=O().$implicit,n=O();y(2),E("ngStyle",Ae(15,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),Ht(" ",n.storeService.paperConfiguration().BasicPriceLabel," "),y(2),E("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),E("ngStyle",Ae(17,Qe,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ni(8,11,t.UnitPrice)),y(2),E("ngIf",n.storeService.paperConfiguration().UOMNameVisible),y(2),E("ngStyle",Ae(19,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),Ht(" ",n.storeService.paperConfiguration().PromotionPriceLabel," "),y(2),E("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),E("ngStyle",Ae(21,Qe,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ni(17,13,n.promotionDiscount(t.Promotions)))}}function WD(i,e){if(i&1&&(f(0,"span",27),x(1),m()),i&2){let t=O(3);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function $D(i,e){if(i&1&&(f(0,"div",8),ue(1,WD,2,4,"span",26),f(2,"span",27),x(3),Ue(4,"taxs"),Ue(5,"number"),m()()),i&2){let t=O().$implicit,n=O();y(),E("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),E("ngStyle",Ae(8,Qe,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ni(5,6,Ti(4,3,t.UnitPrice,n.taxRate)))}}function qD(i,e){if(i&1&&(f(0,"span",27),x(1),m()),i&2){let t=O(5);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function GD(i,e){if(i&1&&(f(0,"div",8),ue(1,qD,2,4,"span",26),f(2,"span",27),x(3),Ue(4,"taxs"),Ue(5,"number"),m()()),i&2){let t=O().$implicit,n=O(3);y(),E("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),E("ngStyle",Ae(8,Qe,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ni(5,6,Ti(4,3,t.Price,n.taxRate)))}}function XD(i,e){if(i&1&&ue(0,GD,6,10,"div",8),i&2){let t=e.$implicit,n=O(3);Ce(t.Outlet===n.storeService.outlet$().Name?0:-1)}}function YD(i,e){if(i&1&&Jt(0,XD,1,1,null,null,ds),i&2){let t=O().$implicit;ei(t.OutletPrice)}}function KD(i,e){if(i&1&&(f(0,"span",13),x(1),m()),i&2){let t=O(3);E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().ProductNamePrefix)}}function QD(i,e){if(i&1&&(f(0,"div",9),ue(1,KD,2,4,"span",12),f(2,"span",13),x(3),Ue(4,"slice"),m()()),i&2){let t=O().$implicit,n=O();y(),E("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),y(),E("ngStyle",Ae(7,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(vl(4,3,t.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function ZD(i,e){if(i&1&&(f(0,"div",28)(1,"span",13),x(2),m()()),i&2){let t=O(3);y(),E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().StoreName)}}function JD(i,e){if(i&1&&(f(0,"div",29)(1,"span",13),x(2),m()()),i&2){let t=O(3);y(),E("ngStyle",Ae(2,Qe,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().StoreName)}}function ek(i,e){if(i&1&&ue(0,ZD,3,4,"div",28)(1,JD,3,4,"div",29),i&2){let t=O(2);Ce(t.storeService.paperConfiguration().Orientation===0?0:1)}}function tk(i,e){if(i&1&&(f(0,"div",8)(1,"span",13),x(2),Ue(3,"date"),m()()),i&2){let t=O().$implicit,n=O();y(),E("ngStyle",Ae(5,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(Ti(3,2,t.ReleasedDate,"dd MMM yyyy"))}}function ik(i,e){if(i&1&&(f(0,"div",8)(1,"span",13),x(2),m()()),i&2){let t=O().$implicit,n=O();y(),E("ngStyle",Ae(2,Qe,n.storeService.paperConfiguration().ProductNameFontSize)),y(),Ht("",t.PriceDiscount,"% Off")}}function nk(i,e){if(i&1&&(f(0,"span"),x(1),m(),f(2,"span"),x(3,"-"),m(),f(4,"span"),x(5),m(),f(6,"span"),x(7,"-"),m(),f(8,"span"),x(9),Ue(10,"number"),m()),i&2){let t=e.$implicit;y(),I(t.Name),y(4),I(t.MinimumQuantity),y(4),I(ni(10,3,t.UnitPrice))}}function rk(i,e){if(i&1&&(f(0,"div",10),Jt(1,nk,11,5,null,null,us),m()),i&2){let t=O().$implicit,n=O();E("ngStyle",Ae(1,Qe,n.storeService.paperConfiguration().PricebookFontSize)),y(),ei(t.Pricebook)}}function ok(i,e){if(i&1&&(f(0,"div",2),ue(1,BD,3,1,"div",3),f(2,"div",4),ue(3,ND,2,4,"span",5)(4,zD,5,9,"div",6)(5,UD,18,23,"div",7)(6,$D,6,10,"div",8)(7,YD,2,0)(8,QD,5,9,"div",9)(9,ek,2,1)(10,tk,4,7,"div",8)(11,ik,3,4,"div",8)(12,rk,3,3,"div",10),m()()),i&2){let t=e.$implicit,n=O();E("ngStyle",n.stickerStyles),y(),Ce(n.storeService.paperConfiguration().BarcodeVisible?1:-1),y(),E("ngClass",Ae(13,AD,!n.storeService.paperConfiguration().BarcodeVisible)),y(),Ce(n.storeService.paperConfiguration().CodeVisible?3:-1),y(),Ce(n.storeService.paperConfiguration().MoveProductNameOnTop&&n.storeService.paperConfiguration().NameVisible?4:-1),y(),Ce(t.Promotions&&n.storeService.paperConfiguration().PriceVisible?5:-1),y(),Ce(!t.Promotions&&!n.storeService.paperConfiguration().OutletID&&n.storeService.paperConfiguration().PriceVisible?6:-1),y(),Ce(n.storeService.paperConfiguration().OutletID&&n.storeService.paperConfiguration().PriceVisible?7:-1),y(),Ce(!n.storeService.paperConfiguration().MoveProductNameOnTop&&n.storeService.paperConfiguration().NameVisible?8:-1),y(),Ce(n.storeService.paperConfiguration().StoreName?9:-1),y(),Ce(n.storeService.paperConfiguration().ShowReleasedDate?10:-1),y(),Ce(n.storeService.paperConfiguration().ShowPriceDiscount?11:-1),y(),Ce(n.storeService.paperConfiguration().PricebookVisible?12:-1)}}var el=(()=>{class i{constructor(){this.items=[],this.previewType="single",this.storeService=N(ke),this.Object=Object,this.cdr=N(cn),this.renderer=N(ss),this.elementsInitialized=!1,this.injector=N(Ge)}get barcodeContainerStyles(){let t=0;switch(this.storeService.paperSource()){case"Continuous - 3 Column":t=3;break;case"Continuous - 2 Column":t=2;break;case"Continuous - 1 Column":t=1;break;case"Tom & Jerry 107":t=3;break;case"Tom & Jerry 108":t=5;break}let n={display:"grid",gridTemplateColumns:`repeat(${t}, ${this.items.length===1?"1fr":this.storeService.paperConfiguration().StickerWidth}px)`,gridAutoRows:`${this.storeService.paperConfiguration().StickerHeight}px`,columnGap:`${this.storeService.paperConfiguration().ColumnSpacing}px`,rowGap:`${this.storeService.paperConfiguration().RowSpacing}px`,margin:`${this.storeService.paperConfiguration().MarginTop}px ${this.storeService.paperConfiguration().MarginLeft}px`,maxHeight:"100%",height:`${this.previewType==="single"?"90px":"100%"}`,width:`${this.previewType==="single"?"250px":this.storeService.paperConfiguration().PaperWidth+"px"}`};return console.log("style",n),n}get stickerStyles(){let t=this.storeService.paperConfiguration().StickerWidth,n=this.storeService.paperConfiguration().StickerHeight,r=this.items.length===1&&this.previewType==="single"?"250px":`${typeof t=="number"?t+"px":t}`,o=`${this.previewType==="single"?"90px":n+"px"}`;return{width:r,height:o,overflow:"hidden"}}get barcodeStyle(){return{width:"100%",height:`${this.previewType==="single"?"25px":this.storeService.paperConfiguration().BarcodeHeight+"px"}`}}get taxRate(){if(this.storeService.paperConfiguration().TaxType){let n=this.storeService.taxs().findIndex(r=>r.ID===this.storeService.paperConfiguration().TaxType.ID);if(n!==-1)return this.storeService.taxs()[n].Rate}return 0}get stickerStoreName(){let t={order:"4",lineHeight:"15px"},n={position:"absolute",right:"0",top:"0",transform:"translate(0%, 20%) rotate(270deg)"};return this.storeService.paperConfiguration().Orientation===0?t:n}ngOnInit(){}ngAfterViewInit(){this.elementsInitialized=!0}ngAfterViewChecked(){this.generateBarcodes(),this.elementsInitialized&&(this.generateBarcodes(),this.elementsInitialized=!1)}generateBarcodes(){this.storeService.expandProductItems().forEach((t,n)=>{let r=this.barcodeRef.get(n)?.nativeElement;r&&(0,Ey.default)(r,t.Code,{format:"CODE128",lineColor:"#000",width:20,displayValue:!1})})}promotionDiscount(t){try{return Object.keys(t).length?t.Discount&&t.Discount>0?t.UnitPrice-t.UnitPrice*t.Discount/100:t.UnitPrice:0}catch(n){throw new Error("error: ",n)}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-barcode-preview"]],viewQuery:function(n,r){if(n&1&&yi(RD,5,Dt),n&2){let o;ti(o=ii())&&(r.barcodeRef=o)}},inputs:{items:"items",previewType:"previewType"},standalone:!0,features:[ye],decls:3,vars:1,consts:[["barcode",""],["id","barcode-container",1,"barcode-container",3,"ngStyle"],[1,"sticker","position-relative","border","border-dark","d-flex","flex-column",3,"ngStyle"],[1,"sticker-header","d-flex","justify-content-center","px-1"],[1,"sticker-body","d-flex","flex-column","align-items-center","justify-content-center",3,"ngClass"],[1,"text-dark",2,"line-height","1",3,"ngStyle"],[2,"line-height","0.3","width","100%","text-align","center"],[1,"d-flex","flex-column",2,"line-height","1"],[2,"line-height","1"],[2,"line-height","0","width","100%","text-align","center"],[1,"d-flex","gap-1",2,"line-height","1",3,"ngStyle"],["id","barcode",3,"ngStyle"],["class","text-dark",3,"ngStyle",4,"ngIf"],[1,"text-dark",3,"ngStyle"],[1,"d-flex","gap-2","align-items-center"],[1,"promotion__normalprice_label","text-dark","d-flex","justify-content-end",3,"ngStyle"],[1,"d-flex","gap-1"],["class","promotion__normalprice text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__normalprice","text-decoration-line-through","text-danger",3,"ngStyle"],[4,"ngIf"],[1,"promotion__price_label","text-dark","d-flex","justify-content-end",3,"ngStyle"],[1,"d-flex","gap-2"],["class","text-danger promotion__price text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__price","text-danger","text-dark",3,"ngStyle"],[1,"promotion__normalprice","text-dark",3,"ngStyle"],[1,"text-danger","promotion__price","text-dark",3,"ngStyle"],["class","price text-dark",3,"ngStyle",4,"ngIf"],[1,"price","text-dark",3,"ngStyle"],["id","store-name-horizontal",1,"",2,"line-height","1"],["id","store-name-vertical",1,"position-absolute",2,"line-height","1"]],template:function(n,r){n&1&&(f(0,"div",1),Jt(1,ok,13,15,"div",2,MD),m()),n&2&&(E("ngStyle",r.barcodeContainerStyles),y(),ei(r.items))},dependencies:[_p,Py,Wn,xp,ri,Xi,Cp,ms],styles:["#barcode[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{height:100%}.storename[_ngcontent-%COMP%]{position:absolute;right:0;top:0;transform:translateY(20%) rotate(270deg)}#store-name-vertical[_ngcontent-%COMP%]{top:50%;right:0;transform:translateY(-50%) rotate(-90deg)}.sticker-body[_ngcontent-%COMP%]{width:100%;display:inline-flex}.sticker-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{line-height:.9!important}"],changeDetection:0})}}return i})();var Dy=(()=>{class i{constructor(){this.storeService=N(ke)}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-customize-label"]],standalone:!0,features:[ye],decls:58,vars:9,consts:[["scrollContainer",""],[1,"d-flex","flex-column","gap-3","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click"],[1,"f","fas","fa-angle-left"],[1,"fs-3"],[1,"f","fas","fa-angle-right"],[1,"row","mx-2","flex-grow-1","overflow-x-auto",2,"margin-bottom","1rem"],[1,"col-lg-6","col-md-6","d-flex","justify-content-center"],[1,"card","sticky-md-top",2,"height","fit-content"],[1,"card-body","d-flex","justify-content-center","align-items-center"],[3,"items"],[1,"col-lg-6","col-md-6"],[1,"card"],[1,"p-3"],[1,"card-title","mb-0","font-robotoslab",2,"font-size","16px"],[1,"card-body","border-top","p-1"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","",3,"collapsed"],["ngbAccordionHeader",""],["ngbAccordionButton",""],[1,"",2,"font-size","14px"],["ngbAccordionCollapse",""],["ngbAccordionBody","",1,"scroll-container"],[2,"font-size","14px"]],template:function(n,r){if(n&1){let o=Ie();f(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),x(8,"Customize Label"),m()()(),f(9,"ul",9)(10,"div",10)(11,"button",11),U("click",function(){return se(o),ae(r.storeService.onPrevStep())}),le(12,"i",12),f(13,"span",13),x(14,"Back"),m()(),f(15,"button",11),U("click",function(){return se(o),ae(r.storeService.onNextStep())}),f(16,"span",13),x(17,"Next"),m(),le(18,"i",14),m()()()()()()(),f(19,"div",15)(20,"div",16)(21,"div",17)(22,"div",18),le(23,"app-barcode-preview",19),m()()(),f(24,"div",20)(25,"div",21)(26,"div",22)(27,"h4",23),x(28," Sticker Content "),m()(),f(29,"div",24)(30,"div",25)(31,"div",26)(32,"h2",27)(33,"button",28)(34,"span",29),x(35,"Barcode View"),m()()(),f(36,"div",30)(37,"div",31,0),le(39,"app-barcode-view"),m()()(),f(40,"div",26)(41,"h2",27)(42,"button",28)(43,"span",32),x(44,"Price"),m()()(),f(45,"div",30)(46,"div",31,0),le(48,"app-price"),m()()(),f(49,"div",26)(50,"h2",27)(51,"button",28)(52,"span",32),x(53,"Advanced"),m()()(),f(54,"div",30)(55,"div",31,0),le(57,"app-advanced"),m()()()()()()()()()}n&2&&(y(),zt("data-navbarbg",r.storeService.options().navbarbg),y(),E("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),E("ngbCollapse",!r.storeService.options().isCollapsed),zt("data-navbarbg",r.storeService.options().navbarbg),y(20),E("items",r.storeService.expandProductItem()),y(7),E("closeOthers",!0),y(),E("collapsed",!1),y(9),E("collapsed",!0),y(9),E("collapsed",!0))},dependencies:[Ss,Es,Ps,Ts,Ds,ks,rr,Gn,Xi,xy,Cy,Sy,el],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:100vh}"],changeDetection:0})}}return i})();function sk(i,e){if(i&1&&(f(0,"ng-option",3),x(1),m()),i&2){let t=e.$implicit;E("value",t.Name),y(),I(t.Name)}}var ky=(()=>{class i{onInputHandler(t,n){switch(n){case"paperWidth":this.paperWidth.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PaperWidth:this.paperWidth()}));break;case"stickerWidth":this.stickerWidth.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{StickerWidth:this.stickerWidth()}));break;case"stickerHeight":this.stickerHeight.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{StickerHeight:this.stickerHeight()}));break;case"barcodeHeight":this.barcodeHeight.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break}}constructor(){this.options=Rt,this.storeService=N(ke),this.destroyRef=N(Xe),this.injector=N(Ge),this.paperWidth=q(0),this.stickerWidth=q(0),this.stickerHeight=q(0),this.paperSource=q(""),this.barcodeHeight=q(0),this.fontSize=q(0),this.tooltip={paperWidth:"The width of the paper",stickerWidth:"The width of the sticker",stickerHeight:"The height of the sticker",barcodeHeight:"The height of the generated barcode in pixels",fontSize:"Change all font size (except price)"}}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(xe(t=>{this.paperWidth.set(t.PaperWidth),this.stickerWidth.set(t.StickerWidth),this.stickerHeight.set(t.StickerHeight),this.barcodeHeight.set(t.BarcodeHeight),this.fontSize.set(t.ProductNameFontSize)})).subscribe(),this.paperWidth.set(this.storeService.paperConfiguration().PaperWidth),this.stickerWidth.set(this.storeService.paperConfiguration().StickerWidth),this.stickerHeight.set(this.storeService.paperConfiguration().StickerHeight),this.paperSource.set(this.storeService.paperConfig().PaperFormats[0].Name),this.storeService.paperSource().length==0&&this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[0].Name)}onChangePaperSource(t){let n=this.storeService.paperConfig().PaperFormats.findIndex(r=>r.Name===t);n!==-1&&(this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[n].Name),this.storeService.onChangePaperConfiguration(this.storeService.paperConfig().PaperFormats[n]))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-pp-paper"]],standalone:!0,features:[ye],decls:58,vars:17,consts:[[1,"table","table-bordered"],["for","paperSource",1,"fs-2","d-inline-block","text-truncate"],["searchable","false","clearable","false","id","paperSource","name","paperSource","selecte","",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel"],[3,"value"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","paperWidth",1,"fs-2","d-inline-block","text-truncate"],["id","paperWidth","name","paperWidth","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","stickerWidth",1,"fs-2","d-inline-block","text-truncate"],["name","stickerWidth","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","stickerHeight",1,"fs-2","d-inline-block","text-truncate"],["id","stickerHeight","name","stickerHeight","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","barcode",1,"fs-2"],["id","barcodeHeight","name","barcodeHeight","type","text",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","fontSize",1,"fs-2","d-inline-block","text-truncate"],["id","fontSize","name","fontSize","type","text",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"]],template:function(n,r){n&1&&(f(0,"table",0)(1,"tbody")(2,"tr")(3,"td")(4,"label",1),x(5,"Paper Source"),m()(),f(6,"td")(7,"ng-select",2),U("ngModelChange",function(s){return r.onChangePaperSource(s)}),Jt(8,sk,2,2,"ng-option",3,us),m()(),f(10,"td")(11,"span",4),x(12),m()()(),f(13,"tr")(14,"td")(15,"label",5),x(16,"Paper Width"),m()(),f(17,"td")(18,"input",6),U("ngModelChange",function(s){return r.onInputHandler(s,"paperWidth")}),m()(),f(19,"td")(20,"span",4),x(21),m()()(),f(22,"tr")(23,"td")(24,"label",7),x(25,"Sticker Width"),m()(),f(26,"td")(27,"input",8),U("ngModelChange",function(s){return r.onInputHandler(s,"stickerWidth")}),m()(),f(28,"td")(29,"span",4),x(30),m()()(),f(31,"tr")(32,"th")(33,"label",9),x(34,"Sticker Height"),m()(),f(35,"td")(36,"input",10),U("ngModelChange",function(s){return r.onInputHandler(s,"stickerHeight")}),m()(),f(37,"td")(38,"span",4),x(39),m()()(),f(40,"tr")(41,"td")(42,"label",11),x(43,"Barcode Height"),m()(),f(44,"td")(45,"input",12),U("ngModelChange",function(s){return r.onInputHandler(s,"barcodeHeight")}),m()(),f(46,"td")(47,"span",4),x(48),m()()(),f(49,"tr")(50,"td")(51,"label",13),x(52,"Font Size"),m()(),f(53,"td")(54,"input",14),U("ngModelChange",function(s){return r.onInputHandler(s,"fontSize")}),m()(),f(55,"td")(56,"span",4),x(57),m()()()()()),n&2&&(y(7),E("ngModel",r.storeService.paperSource()),y(),ei(r.storeService.paperConfig().PaperFormats),y(4),I(r.tooltip.paperWidth),y(6),E("maskito",r.options)("ngModel",r.paperWidth()),y(3),I(r.tooltip.paperWidth),y(6),E("maskito",r.options)("ngModel",r.stickerWidth()),y(3),I(r.tooltip.stickerWidth),y(6),E("maskito",r.options)("ngModel",r.stickerHeight()),y(3),I(r.tooltip.stickerHeight),y(6),E("maskito",r.options)("ngModel",r.barcodeHeight()),y(3),I(r.tooltip.barcodeHeight),y(6),E("maskito",r.options)("ngModel",r.fontSize()),y(3),I(r.tooltip.fontSize))},dependencies:[ht,tt,it,kt,rt,oi,_i,As,Ji],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function ak(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.leftIndent)}}function lk(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.topIndent)}}function ck(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.rowSpacing)}}function dk(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.columnSpacing)}}var Ty=(()=>{class i{constructor(){this.options=Rt,this.tooltip={leftIndent:"The number of pixels appended before the first COLUMN",topIndent:"The number of pixels appended after the first ROW",rowSpacing:"The number of pixels between each ROW",columnSpacing:"The number of pixels between each COLUMN"},this.leftIndent=q(0),this.topIndent=q(0),this.rowSpacing=q(0),this.columnSpacing=q(0),this.storeService=N(ke),this.destroyRef=N(Xe),this.injector=N(Ge)}onInputHandler(t,n){switch(n){case"marginLeft":this.leftIndent.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{MarginLeft:this.leftIndent()}));break;case"marginTop":this.topIndent.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{MarginTop:this.topIndent()}));break;case"rowSpacing":this.rowSpacing.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{RowSpacing:this.rowSpacing()}));break;case"columnSpacing":this.columnSpacing.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ColumnSpacing:this.columnSpacing()}));break}}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.leftIndent.set(t.MarginLeft),this.topIndent.set(t.MarginTop),this.rowSpacing.set(t.RowSpacing),this.columnSpacing.set(t.ColumnSpacing)})).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-pp-spacing"]],standalone:!0,features:[ye],decls:46,vars:12,consts:[["leftIndentTemplate",""],["topIndentTemplate",""],["rowSpacingTemplate",""],["columnSpacingTemplate",""],[1,"table","table-bordered"],["for","leftIndent",1,"fs-2","d-inline-block","text-truncate"],["id","leftIndent","name","leftIndent","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","topIndent",1,"fs-2","d-inline-block","text-truncate"],["id","topIndent","name","topIndent","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","rowSpacing",1,"fs-2","d-inline-block","text-truncate"],["id","rowSpacing","name","rowSpacing","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","columnSpacing",1,"fs-2","d-inline-block","text-truncate"],["id","columnSpacing","name","columnSpacing","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",4)(1,"tbody")(2,"tr")(3,"td")(4,"label",5),x(5,"Left Indent"),m()(),f(6,"td")(7,"input",6),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"marginLeft"))}),m()(),f(8,"td")(9,"span",7),x(10),m()()(),f(11,"tr")(12,"td")(13,"label",8),x(14,"Top Indent"),m()(),f(15,"td")(16,"input",9),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"marginTop"))}),m()(),f(17,"td")(18,"span",7),x(19),m()()(),f(20,"tr")(21,"td")(22,"label",10),x(23,"Row Spacing"),m()(),f(24,"td")(25,"input",11),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"rowSpacing"))}),m()(),f(26,"td")(27,"span",7),x(28),m()()(),f(29,"tr")(30,"th")(31,"label",12),x(32,"Column Spacing"),m()(),f(33,"td")(34,"input",13),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"columnSpacing"))}),m()(),f(35,"td")(36,"span",7),x(37),m()()()()(),ue(38,ak,2,1,"ng-template",null,0,me)(40,lk,2,1,"ng-template",null,1,me)(42,ck,2,1,"ng-template",null,2,me)(44,dk,2,1,"ng-template",null,3,me)}n&2&&(y(7),E("maskito",r.options)("ngModel",r.leftIndent()),y(3),I(r.tooltip.leftIndent),y(6),E("maskito",r.options)("ngModel",r.topIndent()),y(3),I(r.tooltip.topIndent),y(6),E("maskito",r.options)("ngModel",r.rowSpacing()),y(3),I(r.tooltip.rowSpacing),y(6),E("maskito",r.options)("ngModel",r.columnSpacing()),y(3),I(r.tooltip.columnSpacing))},dependencies:[ht,tt,it,kt,rt,Ji,oi],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function uk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.basicPriceLabel)}}function pk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.promotionPriceLabel)}}var Iy=(()=>{class i{constructor(){this.tooltip={basicPriceLabel:"Custom label normal price",promotionPriceLabel:"Custom label promotion price"},this.storeService=N(ke),this.destroyRef=N(Xe),this.injector=N(Ge),this.basicPriceLabel=q(""),this.promotionPriceLabel=q(""),this.options=Rt}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.basicPriceLabel.set(t.BasicPriceLabel),this.promotionPriceLabel.set(t.PromotionPriceLabel)})).subscribe()}onInputHandler(t,n){switch(n){case"basicPriceLabel":this.basicPriceLabel.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BasicPriceLabel:this.basicPriceLabel()}));break;case"promotionPriceLabel":this.promotionPriceLabel.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PromotionPriceLabel:this.promotionPriceLabel()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-pp-label"]],standalone:!0,features:[ye],decls:24,vars:4,consts:[["basicPriceLabelTemplate",""],["promotionPriceLabelTemplate",""],[1,"table","table-bordered"],["for","normalPrice",1,"fs-2","d-inline-block","text-truncate"],["id","normalPrice","name","basicPriceLabel","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","promotionPrice",1,"fs-2","d-inline-block","text-truncate"],["id","promotionPrice","name","promotionPriceLabel","type","text",1,"form-control","fs-1",3,"ngModelChange","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",2)(1,"tbody")(2,"tr")(3,"td")(4,"label",3),x(5,"Normal Price"),m()(),f(6,"td")(7,"input",4),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"basicPriceLabel"))}),m()(),f(8,"td")(9,"span",5),x(10),m()()(),f(11,"tr")(12,"td")(13,"label",6),x(14,"Promotion Price"),m()(),f(15,"td")(16,"input",7),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"promotionPriceLabel"))}),m()(),f(17,"td")(18,"span",5),x(19),m()()()()(),ue(20,uk,2,1,"ng-template",null,0,me)(22,pk,2,1,"ng-template",null,1,me)}n&2&&(y(7),E("ngModel",r.basicPriceLabel()),y(3),I(r.tooltip.basicPriceLabel),y(6),E("ngModel",r.promotionPriceLabel()),y(3),I(r.tooltip.promotionPriceLabel))},dependencies:[ht,tt,it,kt,rt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();var Ry=De(Oy());function hk(i,e){if(i&1){let t=Ie();f(0,"tr")(1,"td")(2,"label",6),x(3,"Pricebook Font Size"),m()(),f(4,"td")(5,"input",7),U("ngModelChange",function(r){se(t);let o=O();return ae(o.onInputHandler(r,"pricebookFontSize"))}),m()(),f(6,"td")(7,"span",5),x(8),m()()()}if(i&2){let t=O();y(5),E("maskito",t.options)("ngModel",t.pricebookFontSize()),y(3),I(t.tooltip.pricebookFontSize)}}function fk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookFontSize)}}function mk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}var Fy=(()=>{class i{constructor(){this.options=Rt,this.barcodeHeight=q(0),this.fontSize=q(0),this.barcode=q(!1),this.code=q(!1),this.price=q(!1),this.name=q(!1),this.moveProductName=q(!1),this.releaseDate=q(!1),this.discountVisible=q(!1),this.pricebookPrice=q(!1),this.pricebookFontSize=q(0),this.tooltip={fontSize:"Change font size for price",pricebookFontSize:"Change font size for pricebook price"},this.storeService=N(ke),this.injector=N(Ge),this.destroyRef=N(Xe)}ngOnInit(){ft(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.pricebookFontSize.set(t.PricebookFontSize),this.fontSize.set(t.PriceFontSize)})).subscribe()}onInputHandler(t,n){switch(console.log("value",t),n){case"pricebookFontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-price-fontsize"]],standalone:!0,features:[ye],decls:16,vars:4,consts:[["pricebookFontSizeTemplate",""],["fontSizeTemplate",""],[1,"table","table-bordered"],["for","fontSize",1,"fs-2","d-inline-block","text-truncate"],["id","fontSize","name","fontSize","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","pricebookFontSize",1,"fs-2","d-inline-block","text-truncate"],["id","pricebookFontSize","name","pricebookFontSize","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",2)(1,"tbody"),ue(2,hk,9,3,"tr"),f(3,"tr")(4,"td")(5,"label",3),x(6,"Font Size"),m()(),f(7,"td")(8,"input",4),U("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"fontSize"))}),m()(),f(9,"td")(10,"span",5),x(11),m()()()()(),ue(12,fk,2,1,"ng-template",null,0,me)(14,mk,2,1,"ng-template",null,1,me)}n&2&&(y(2),Ce(r.storeService.paperConfiguration().PricebookVisible?2:-1),y(6),E("maskito",r.options)("ngModel",r.fontSize()),y(3),I(r.tooltip.fontSize))},dependencies:[Ji,ri,ht,tt,it,kt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"]})}}return i})();function gk(i,e){i&1&&(f(0,"button",14)(1,"span",13),x(2,"Next"),m(),le(3,"i",33),m())}function yk(i,e){if(i&1){let t=Ie();f(0,"button",34),U("click",function(){se(t);let r=O();return ae(r.printBarcode())}),f(1,"span",13),x(2,"Print"),m()()}}var My=(()=>{class i{constructor(){this.storeService=N(ke),this.httpService=N(bi),this.toastr=N(bs),this.destroyRef=N(Xe)}ngOnInit(){document.addEventListener("keydown",t=>{t instanceof KeyboardEvent&&t.key==="p"&&t.ctrlKey&&(t.preventDefault(),this.printBarcode())})}printBarcode(){let t=0;switch(this.storeService.paperSource()){case"Continuous - 3 Column":t=3;break;case"Continuous - 2 Column":t=2;break;case"Continuous - 1 Column":t=1;break;case"Tom & Jerry 107":t=3;break;case"Tom & Jerry 108":t=5;break}(0,Ry.default)({printable:"barcode-container",type:"html",css:"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css",style:`
31
31
  body {
32
32
  font-family: Arial, Helvetica, sans-serif;
33
33
  font-size: ${this.storeService.paperConfiguration().ProductNameFontSize}px;
34
+ margin: 0;
35
+ padding: 0;
36
+
34
37
  }
35
38
  .barcode-container {
39
+
36
40
  display: grid;
37
- grid-template-columns: repeat(${n}, ${this.storeService.paperConfiguration().StickerWidth}px);
41
+ grid-template-columns: repeat(${t}, ${this.storeService.paperConfiguration().StickerWidth}px);
38
42
  grid-auto-rows: ${this.storeService.paperConfiguration().StickerHeight}px;
39
- row-gap: 0;
40
- column-gap: ${this.storeService.paperConfiguration().ColumnSpacing}px;
41
-
43
+ gap: ${this.storeService.paperConfiguration().RowSpacing}px ${this.storeService.paperConfiguration().ColumnSpacing}px;
44
+ padding-left: ${this.storeService.paperConfiguration().MarginLeft}px;
45
+ padding-top: ${this.storeService.paperConfiguration().MarginTop}px;
42
46
  }
43
47
  .sticker {
44
48
  border: none !important;
45
49
  height: ${this.storeService.paperConfiguration().StickerHeight}px;
46
- margin-top: ${this.storeService.paperConfiguration().MarginTop}px;
47
-
50
+ // margin-top: ${this.storeService.paperConfiguration().MarginTop}px;
51
+ overflow: hidden;
48
52
  }
49
53
  .sticker-body {
50
54
  display: flex;
51
55
  flex-direction: column;
52
56
  justify-content: center;
53
-
54
-
55
-
56
-
57
+
57
58
  }
58
59
  .sticker-body div {
59
60
  width: 100%;
60
61
  text-align: center;
61
62
  }
62
- .sticker-body div, .sticker-body span {
63
- line-height: 10px;
64
-
65
- }
66
-
67
- .sticker-header {
68
- height: ${this.storeService.paperConfiguration().BarcodeHeight}px !important;
63
+ .sticker-body div {
64
+ line-height: 1;
69
65
  width: 100%;
70
-
66
+ display: inline-flex;
67
+ justify-content: center;
71
68
  }
72
69
 
73
-
74
70
  .sticker-header canvas {
75
- height: 100%;
71
+ height: ${this.storeService.paperConfiguration().BarcodeHeight}px;
76
72
  width: 100%;
77
73
  }
78
74
 
@@ -80,11 +76,12 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
80
76
 
81
77
  #store-name-vertical {
82
78
  top: 50%;
83
- right: 0;
79
+ right: 5%;
84
80
  transform: translate(50%, -50%) rotate(-90deg);
85
81
  }
86
82
 
87
- .sticker .price {
83
+ .sticker-body .price {
84
+
88
85
  font-size: ${this.storeService.paperConfiguration().PriceFontSize}px !important;
89
86
  }
90
87
 
@@ -106,5 +103,5 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
106
103
  .sticker-body .promotion__price {
107
104
  color: #000 !important;
108
105
  }
109
- `,font_size:"",targetStyle:["*"],onError:r=>{console.error("printjs",r)},onLoadingEnd:()=>{this.onSaveConfig()}})}ngAfterViewInit(){}onSaveConfig(){let t=this.storeService.paperConfig().PaperFormats,n=t.findIndex(s=>s.Name===this.storeService.paperConfiguration().Name);n!==-1&&(t[n]=this.storeService.paperConfiguration());let r={PaperFormats:[...t],SubDomain:localStorage.getItem("Domain")};console.log("Debug \u{1F41E} ==> Class: PrintPreviewComponent, Function: onSaveConfig, Line 189 payload(): ",`
110
- `,r);let o={responseType:"text",observe:"response"};this.httpService.post("api/Config/SaveConfig",r,o).pipe(Je(this.destroyRef),hn("response"),xe(s=>{s instanceof Sp&&s.status===200&&this.toastr.success(s.body,"success")}),dl(1)).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-print-preview"]],standalone:!0,features:[ye],decls:66,vars:11,consts:[["scrollContainer",""],[1,"d-flex","flex-column","gap-4","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click"],[1,"f","fas","fa-angle-left"],[1,"fs-3"],["type","button",1,"btn","btn-info","d-flex","gap-1","align-items-center"],["type","button",1,"btn","btn-success"],[1,"row","mx-2","flex-grow-1","overflow-x-auto",2,"margin-bottom","1rem"],[1,"col-lg-6","col-md-12"],[1,"card","h-100"],[1,"card-body","d-flex","justify-content-center",2,"height","0"],["id","barcode-container",1,"scroll-container",2,"border","1px dashed black"],["previewType","multiple",3,"items"],[1,"card"],[1,"p-3"],[1,"card-title","mb-0",2,"font-size","16px"],[1,"card-body","border-top","p-1"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","",3,"collapsed"],["ngbAccordionHeader",""],["ngbAccordionButton",""],[2,"font-size","14px"],["ngbAccordionCollapse",""],["ngbAccordionBody","",1,"scroll-container"],[1,"f","fas","fa-angle-right"],["type","button",1,"btn","btn-success",3,"click"]],template:function(n,r){if(n&1){let o=Ie();f(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),x(8,"Print Preview"),m()()(),f(9,"ul",9)(10,"div",10)(11,"button",11),U("click",function(){return se(o),ae(r.storeService.onPrevStep())}),le(12,"i",12),f(13,"span",13),x(14,"Back"),m()(),ue(15,fk,4,0,"button",14)(16,mk,3,0,"button",15),m()()()()()(),f(17,"div",16)(18,"div",17)(19,"div",18)(20,"div",19)(21,"div",20),le(22,"app-barcode-preview",21),m()()()(),f(23,"div",17)(24,"div",22)(25,"div",23)(26,"h4",24),x(27,"Label Spacing"),m()(),f(28,"div",25)(29,"div",26)(30,"div",27)(31,"h2",28)(32,"button",29)(33,"span",30),x(34,"Paper"),m()()(),f(35,"div",31)(36,"div",32,0),le(38,"app-pp-paper"),m()()(),f(39,"div",27)(40,"h2",28)(41,"button",29)(42,"span",30),x(43,"Price Font Size"),m()()(),f(44,"div",31)(45,"div",32,0),le(47,"app-price-fontsize"),m()()(),f(48,"div",27)(49,"h2",28)(50,"button",29)(51,"span",30),x(52,"Spacing"),m()()(),f(53,"div",31)(54,"div",32,0),le(56,"app-pp-spacing"),m()()(),f(57,"div",27)(58,"h2",28)(59,"button",29)(60,"span",30),x(61,"Label"),m()()(),f(62,"div",31)(63,"div",32,0),le(65,"app-pp-label"),m()()()()()()()()()}n&2&&(y(),Lt("data-navbarbg",r.storeService.options().navbarbg),y(),E("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),E("ngbCollapse",!r.storeService.options().isCollapsed),Lt("data-navbarbg",r.storeService.options().navbarbg),y(12),Ce(r.storeService.stepper$().state<2?15:16),y(7),E("items",r.storeService.expandProductItems()),y(7),E("closeOthers",!0),y(),E("collapsed",!1),y(9),E("collapsed",!0),y(9),E("collapsed",!0),y(9),E("collapsed",!0))},dependencies:[Ps,Ds,Es,Is,ks,Ts,rr,Xi,Gn,ky,Ty,Iy,el,Fy],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:100%;overflow-x:hidden}#barcode-container[_ngcontent-%COMP%] div[_ngcontent-%COMP%] .metadata[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0} .barcode{width:100%} .barcode img{width:inherit}"]})}}return i})();function gk(i,e){i&1&&le(0,"choose-product")}function yk(i,e){i&1&&le(0,"app-customize-label")}function vk(i,e){i&1&&le(0,"app-print-preview")}var Ay=(()=>{class i{constructor(){this.storeService=N(ke),this.httpService=N(bi),this.destroyRef=N(Xe),this.options=this.storeService.options()}ngOnInit(){this.storeService.onReset(),console.log(localStorage.getItem("Domain"))}checkProtocol(t){return!!t.match(/^(https?):\/\//)}ngAfterViewInit(){let t=localStorage.getItem("Domain"),n=this.checkProtocol(t)?new URL(t).hostname:t;os([this.httpService.post("api/Config/PaperConfig",{SubDomain:n},void 0).pipe(Fr(r=>Le({error:r}))),this.httpService.get("/API/V3/Tax",void 0,`https://${n}`).pipe(Fr(r=>Le({error:r})))]).pipe(Je(this.destroyRef),hn("response"),mi(([r,o])=>"error"in r||"error"in o?(console.warn("Error in one or more requests",{paperConfig:r,taxs:o}),{paperConfig:null,taxs:null}):{paperConfig:r,taxs:o}),xe(({paperConfig:r,taxs:o})=>{r&&(this.storeService.onChangePaperConfig(D(v({},r),{PaperFormats:r.PaperFormats.map(s=>D(v({},s),{OutletID:null}))})),r.PaperFormats.length>0&&this.storeService.onChangePaperConfiguration(r.PaperFormats[0])),o&&this.storeService.onChangeTaxs(o)})).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-dashboard"]],standalone:!0,features:[ye],decls:3,vars:1,template:function(n,r){if(n&1&&ue(0,gk,1,0,"choose-product")(1,yk,1,0,"app-customize-label")(2,vk,1,0,"app-print-preview"),n&2){let o;Ce((o=r.storeService.stepper$().state)===0?0:o===1?1:o===2?2:-1)}},dependencies:[rr,_y,Dy,My]})}}return i})();var f6=[{path:"",children:[{path:"",component:Ay}]}];export{f6 as dashboardRoutes};
106
+ `,font_size:"",targetStyle:["*"],onError:n=>{console.error("printjs",n)},onLoadingEnd:()=>{this.onSaveConfig()}})}ngAfterViewInit(){}onSaveConfig(){let t=this.storeService.paperConfig().PaperFormats,n=t.findIndex(s=>s.Name===this.storeService.paperConfiguration().Name);n!==-1&&(t[n]=this.storeService.paperConfiguration());let r={PaperFormats:[...t],SubDomain:localStorage.getItem("Domain")};console.log("Debug \u{1F41E} ==> Class: PrintPreviewComponent, Function: onSaveConfig, Line 189 payload(): ",`
107
+ `,r);let o={responseType:"text",observe:"response"};this.httpService.post("api/Config/SaveConfig",r,o).pipe(Je(this.destroyRef),hn("response"),xe(s=>{s instanceof Sp&&s.status===200&&this.toastr.success(s.body,"success")}),dl(1)).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-print-preview"]],standalone:!0,features:[ye],decls:66,vars:11,consts:[["scrollContainer",""],[1,"d-flex","flex-column","gap-4","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click"],[1,"f","fas","fa-angle-left"],[1,"fs-3"],["type","button",1,"btn","btn-info","d-flex","gap-1","align-items-center"],["type","button",1,"btn","btn-success"],[1,"row","mx-2","flex-grow-1","overflow-x-auto",2,"margin-bottom","1rem"],[1,"col-lg-6","col-md-12"],[1,"card","h-100"],[1,"card-body","d-flex","justify-content-center",2,"height","0"],["id","barcode-container",1,"scroll-container",2,"border","1px dashed black"],["previewType","multiple",3,"items"],[1,"card"],[1,"p-3"],[1,"card-title","mb-0",2,"font-size","16px"],[1,"card-body","border-top","p-1"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","",3,"collapsed"],["ngbAccordionHeader",""],["ngbAccordionButton",""],[2,"font-size","14px"],["ngbAccordionCollapse",""],["ngbAccordionBody","",1,"scroll-container"],[1,"f","fas","fa-angle-right"],["type","button",1,"btn","btn-success",3,"click"]],template:function(n,r){if(n&1){let o=Ie();f(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),x(8,"Print Preview"),m()()(),f(9,"ul",9)(10,"div",10)(11,"button",11),U("click",function(){return se(o),ae(r.storeService.onPrevStep())}),le(12,"i",12),f(13,"span",13),x(14,"Back"),m()(),ue(15,gk,4,0,"button",14)(16,yk,3,0,"button",15),m()()()()()(),f(17,"div",16)(18,"div",17)(19,"div",18)(20,"div",19)(21,"div",20),le(22,"app-barcode-preview",21),m()()()(),f(23,"div",17)(24,"div",22)(25,"div",23)(26,"h4",24),x(27,"Label Spacing"),m()(),f(28,"div",25)(29,"div",26)(30,"div",27)(31,"h2",28)(32,"button",29)(33,"span",30),x(34,"Paper"),m()()(),f(35,"div",31)(36,"div",32,0),le(38,"app-pp-paper"),m()()(),f(39,"div",27)(40,"h2",28)(41,"button",29)(42,"span",30),x(43,"Price Font Size"),m()()(),f(44,"div",31)(45,"div",32,0),le(47,"app-price-fontsize"),m()()(),f(48,"div",27)(49,"h2",28)(50,"button",29)(51,"span",30),x(52,"Spacing"),m()()(),f(53,"div",31)(54,"div",32,0),le(56,"app-pp-spacing"),m()()(),f(57,"div",27)(58,"h2",28)(59,"button",29)(60,"span",30),x(61,"Label"),m()()(),f(62,"div",31)(63,"div",32,0),le(65,"app-pp-label"),m()()()()()()()()()}n&2&&(y(),zt("data-navbarbg",r.storeService.options().navbarbg),y(),E("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),E("ngbCollapse",!r.storeService.options().isCollapsed),zt("data-navbarbg",r.storeService.options().navbarbg),y(12),Ce(r.storeService.stepper$().state<2?15:16),y(7),E("items",r.storeService.expandProductItems()),y(7),E("closeOthers",!0),y(),E("collapsed",!1),y(9),E("collapsed",!0),y(9),E("collapsed",!0),y(9),E("collapsed",!0))},dependencies:[Ss,Es,Ps,Ts,Ds,ks,rr,Xi,Gn,ky,Ty,Iy,el,Fy],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:100%;overflow-x:hidden}#barcode-container[_ngcontent-%COMP%] div[_ngcontent-%COMP%] .metadata[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0} .barcode{width:100%} .barcode img{width:inherit}"]})}}return i})();function vk(i,e){i&1&&le(0,"choose-product")}function bk(i,e){i&1&&le(0,"app-customize-label")}function _k(i,e){i&1&&le(0,"app-print-preview")}var Ay=(()=>{class i{constructor(){this.storeService=N(ke),this.httpService=N(bi),this.destroyRef=N(Xe),this.options=this.storeService.options()}ngOnInit(){this.storeService.onReset(),console.log(localStorage.getItem("Domain"))}checkProtocol(t){return!!t.match(/^(https?):\/\//)}ngAfterViewInit(){let t=localStorage.getItem("Domain"),n=this.checkProtocol(t)?new URL(t).hostname:t;ns([this.httpService.post("api/Config/PaperConfig",{SubDomain:n},void 0).pipe(Fr(r=>ze({error:r}))),this.httpService.get("/API/V3/Tax",void 0,`https://${n}`).pipe(Fr(r=>ze({error:r})))]).pipe(Je(this.destroyRef),hn("response"),Qt(([r,o])=>"error"in r||"error"in o?(console.warn("Error in one or more requests",{paperConfig:r,taxs:o}),{paperConfig:null,taxs:null}):{paperConfig:r,taxs:o}),xe(({paperConfig:r,taxs:o})=>{r&&(this.storeService.onChangePaperConfig(D(v({},r),{PaperFormats:r.PaperFormats.map(s=>D(v({},s),{OutletID:null}))})),r.PaperFormats.length>0&&this.storeService.onChangePaperConfiguration(r.PaperFormats[0])),o&&this.storeService.onChangeTaxs(o)})).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-dashboard"]],standalone:!0,features:[ye],decls:3,vars:1,template:function(n,r){if(n&1&&ue(0,vk,1,0,"choose-product")(1,bk,1,0,"app-customize-label")(2,_k,1,0,"app-print-preview"),n&2){let o;Ce((o=r.storeService.stepper$().state)===0?0:o===1?1:o===2?2:-1)}},dependencies:[rr,_y,Dy,My]})}}return i})();var g6=[{path:"",children:[{path:"",component:Ay}]}];export{g6 as dashboardRoutes};