dealposbarcode 1.7.7 → 1.7.9

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.
@@ -0,0 +1,107 @@
1
+ import{A as Wp,B as Ms,C as $p,D as qp,E as El,F as Gp,G as Xp,a as Cp,b as Ds,d as Is,e as Mr,f as _l,g as Ap,h as Bp,i as Ii,j as Np,k as Ar,l as wl,m as xl,n as We,o as zp,p as Os,q as ke,r as Fs,s as Lp,t as Hp,u as Sl,v as Rs,w as jp,x as Pl,y as Vp,z as Up}from"./chunk-R6SFZQFG.js";import{a as As,b as _i,c as oi}from"./chunk-JICIBBA5.js";import{B as nt,C as Dt,D as ys,E as vs,F as bs,G as Yi,H as ht,I as rt,J as $n,K as _s,L as ws,M as xs,N as Cs,O as Ss,P as Ps,R as Pp,S as Ep,T as Dp,U as kp,V as Tp,W as Es,X as Ip,Z as Op,_ as Ts,a as vi,b as wp,ba as bi,d as xp,ga as Cl,l as ms,n as Un,q as vl,r as Je,s as pt,t as Sp,u as Wn,v as tt,w as lt,y as it,z as gs}from"./chunk-PY67MF7G.js";import{$b as ls,Aa as Ir,Ac as Ae,Ad as Fp,Bb as Or,Bd as ks,C as Le,Ca as pe,Cd as Rp,D as sp,Da as z,Db as hp,Ec as Ue,Ed as Rr,Fb as ns,Fc as ni,Fd as Mp,Gb as rs,Gc as Ti,H as mi,Ha as fe,Hc as gl,Hd as bl,I as Kt,Ia as Nt,Ic as me,J as es,Ja as ln,Jb as q,Ka as ts,Kb as pl,Mb as Fr,N as ap,O as rl,Oa as up,P as sn,Pb as le,Pc as mp,Qb as fp,Ra as gi,Rb as os,S as an,Sa as se,Sb as Lt,Sc as cn,Ta as ae,Tb as P,U as Qt,Uc as Gi,Vb as jn,Wa as Xe,Wb as ss,Xa as Ye,Xc as gp,Y as ol,Yc as yl,Z as Tr,Za as zt,Zb as Ce,_a as Pt,_b as as,a as v,aa as lp,ab as ul,ac as Zt,b as D,bb as Et,bc as Jt,c as Ln,ca as sl,cc as f,cd as mt,d as j,dc as m,e as De,ea as cp,ec as ue,fa as al,fc as hl,g as B,gc as fl,h as Hn,hb as pp,hd as hs,i as Qo,ic as Ie,j as Zo,jd as Xi,k as Jo,l as $i,lc as W,ld as Vn,mc as O,md as yp,n as St,nc as cs,oa as ll,oc as ds,od as vp,pd as bp,q as et,qa as cl,qc as us,qd as fs,ra as qi,rc as yi,rd as _p,sa as dl,sc as ei,sd as ri,ta as xe,tc as ti,ub as is,uc as ml,vc as x,wa as dp,wc as I,xa as Ve,xc as ii,ya as Bt,yb as y,yc as ps,zb as He,zc as _e}from"./chunk-UZEILQYY.js";var Ht=j(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});function Ly(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Hy=function i(e,t){Ly(this,i),this.data=e,this.text=t.text||e,this.options=t};Dl.default=Hy});var Qp=j(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.CODE39=void 0;var jy=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}}(),Vy=Ht(),Uy=Wy(Vy);function Wy(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 qy(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 Gy(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 Xy=function(i){Gy(e,i);function e(t,n){return $y(this,e),t=t.toUpperCase(),n.mod43&&(t+=Qy(Zy(t))),qy(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return jy(e,[{key:"encode",value:function(){for(var n=kl("*"),r=0;r<this.data.length;r++)n+=kl(this.data[r])+"0";return n+=kl("*"),{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(Uy.default),Yp=["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","-","."," ","$","/","+","%","*"],Yy=[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 kl(i){return Ky(Kp(i))}function Ky(i){return Yy[i].toString(2)}function Qy(i){return Yp[i]}function Kp(i){return Yp.indexOf(i)}function Zy(i){for(var e=0,t=0;t<i.length;t++)e+=Kp(i[t]);return e=e%43,e}Bs.CODE39=Xy});var qn=j($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});var Br;function Tl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Zp=$e.SET_A=0,Jp=$e.SET_B=1,eh=$e.SET_C=2,Ck=$e.SHIFT=98,Jy=$e.START_A=103,ev=$e.START_B=104,tv=$e.START_C=105,Sk=$e.MODULO=103,Pk=$e.STOP=106,Ek=$e.FNC1=207,Dk=$e.SET_BY_CODE=(Br={},Tl(Br,Jy,Zp),Tl(Br,ev,Jp),Tl(Br,tv,eh),Br),kk=$e.SWAP={101:Zp,100:Jp,99:eh},Tk=$e.A_START_CHAR="\xD0",Ik=$e.B_START_CHAR="\xD1",Ok=$e.C_START_CHAR="\xD2",Fk=$e.A_CHARS="[\0-_\xC8-\xCF]",Rk=$e.B_CHARS="[ -\x7F\xC8-\xCF]",Mk=$e.C_CHARS="(\xCF*[0-9]{2}\xCF*)",Ak=$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 Nr=j(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});var iv=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}}(),nv=Ht(),rv=ov(nv),jt=qn();function ov(i){return i&&i.__esModule?i:{default:i}}function sv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function av(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 lv(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 cv=function(i){lv(e,i);function e(t,n){sv(this,e);var r=av(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 iv(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}(rv.default);Il.default=cv});var oh=j(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});var Ki=qn(),th=function(e){return e.match(new RegExp("^"+Ki.A_CHARS+"*"))[0].length},ih=function(e){return e.match(new RegExp("^"+Ki.B_CHARS+"*"))[0].length},nh=function(e){return e.match(new RegExp("^"+Ki.C_CHARS+"*"))[0]};function Ol(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"+rh(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)+Ol(i.substring(r.length),!e)}function rh(i){var e=nh(i),t=e.length;if(t===i.length)return i;i=i.substring(t);var n=th(i)>=ih(i);return e+String.fromCharCode(n?206:205)+Ol(i,n)}Fl.default=function(i){var e=void 0,t=nh(i).length;if(t>=2)e=Ki.C_START_CHAR+rh(i);else{var n=th(i)>ih(i);e=(n?Ki.A_START_CHAR:Ki.B_START_CHAR)+Ol(i,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(r,o){return"\xCB"+o})}});var ah=j(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var dv=Nr(),uv=sh(dv),pv=oh(),hv=sh(pv);function sh(i){return i&&i.__esModule?i:{default:i}}function fv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Rl(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 mv(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 gv=function(i){mv(e,i);function e(t,n){if(fv(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var r=Rl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,hv.default)(t),n));else var r=Rl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return Rl(r)}return e}(uv.default);Ml.default=gv});var ch=j(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});var yv=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}}(),vv=Nr(),bv=_v(vv),lh=qn();function _v(i){return i&&i.__esModule?i:{default:i}}function wv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function xv(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 Sv=function(i){Cv(e,i);function e(t,n){return wv(this,e),xv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,lh.A_START_CHAR+t,n))}return yv(e,[{key:"valid",value:function(){return new RegExp("^"+lh.A_CHARS+"+$").test(this.data)}}]),e}(bv.default);Al.default=Sv});var uh=j(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});var Pv=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}}(),Ev=Nr(),Dv=kv(Ev),dh=qn();function kv(i){return i&&i.__esModule?i:{default:i}}function Tv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Iv(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 Ov(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 Fv=function(i){Ov(e,i);function e(t,n){return Tv(this,e),Iv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,dh.B_START_CHAR+t,n))}return Pv(e,[{key:"valid",value:function(){return new RegExp("^"+dh.B_CHARS+"+$").test(this.data)}}]),e}(Dv.default);Bl.default=Fv});var hh=j(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});var Rv=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}}(),Mv=Nr(),Av=Bv(Mv),ph=qn();function Bv(i){return i&&i.__esModule?i:{default:i}}function Nv(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 Lv(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 Hv=function(i){Lv(e,i);function e(t,n){return Nv(this,e),zv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,ph.C_START_CHAR+t,n))}return Rv(e,[{key:"valid",value:function(){return new RegExp("^"+ph.C_CHARS+"+$").test(this.data)}}]),e}(Av.default);Nl.default=Hv});var fh=j(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.CODE128C=wi.CODE128B=wi.CODE128A=wi.CODE128=void 0;var jv=ah(),Vv=Ns(jv),Uv=ch(),Wv=Ns(Uv),$v=uh(),qv=Ns($v),Gv=hh(),Xv=Ns(Gv);function Ns(i){return i&&i.__esModule?i:{default:i}}wi.CODE128=Vv.default;wi.CODE128A=Wv.default;wi.CODE128B=qv.default;wi.CODE128C=Xv.default});var Gn=j(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var Wk=Qi.SIDE_BIN="101",$k=Qi.MIDDLE_BIN="01010",qk=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"]},Gk=Qi.EAN2_STRUCTURE=["LL","LG","GL","GG"],Xk=Qi.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],Yk=Qi.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]});var Xn=j(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});var Yv=Gn(),Kv=function(e,t,n){var r=e.split("").map(function(s,a){return Yv.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("")};zl.default=Kv});var Hl=j(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var Qv=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}}(),Yn=Gn(),Zv=Xn(),mh=gh(Zv),Jv=Ht(),eb=gh(Jv);function gh(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 nb(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 rb=function(i){nb(e,i);function e(t,n){tb(this,e);var r=ib(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 Qv(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,mh.default)(n,r)}},{key:"rightText",value:function(n,r){return this.text.substr(n,r)}},{key:"rightEncode",value:function(n,r){return(0,mh.default)(n,r)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},r={height:this.guardHeight};return[{data:Yn.SIDE_BIN,options:r},{data:this.leftEncode(),text:this.leftText(),options:n},{data:Yn.MIDDLE_BIN,options:r},{data:this.rightEncode(),text:this.rightText(),options:n},{data:Yn.SIDE_BIN,options:r}]}},{key:"encodeFlat",value:function(){var n=[Yn.SIDE_BIN,this.leftEncode(),Yn.MIDDLE_BIN,this.rightEncode(),Yn.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),e}(eb.default);Ll.default=rb});var vh=j(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});var ob=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}}(),zr=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)}},sb=Gn(),ab=Hl(),lb=cb(ab);function cb(i){return i&&i.__esModule?i:{default:i}}function db(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function ub(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 pb(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 yh=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},hb=function(i){pb(e,i);function e(t,n){db(this,e),t.search(/^[0-9]{12}$/)!==-1&&(t+=yh(t));var r=ub(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.lastChar=n.lastChar,r}return ob(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===yh(this.data)}},{key:"leftText",value:function(){return zr(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=sb.EAN13_STRUCTURE[this.data[0]];return zr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,r)}},{key:"rightText",value:function(){return zr(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 zr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRRRR")}},{key:"encodeGuarded",value:function(){var n=zr(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}(lb.default);jl.default=hb});var _h=j(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var fb=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=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)}},mb=Hl(),gb=yb(mb);function yb(i){return i&&i.__esModule?i:{default:i}}function vb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function bb(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 bh=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},wb=function(i){_b(e,i);function e(t,n){return vb(this,e),t.search(/^[0-9]{7}$/)!==-1&&(t+=bh(t)),bb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return fb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===bh(this.data)}},{key:"leftText",value:function(){return zs(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 zs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,"LLLL")}},{key:"rightText",value:function(){return zs(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 zs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRR")}}]),e}(gb.default);Vl.default=wb});var xh=j(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});var xb=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}}(),Cb=Gn(),Sb=Xn(),Pb=wh(Sb),Eb=Ht(),Db=wh(Eb);function wh(i){return i&&i.__esModule?i:{default:i}}function kb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Tb(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 Ib(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(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},Fb=function(i){Ib(e,i);function e(t,n){return kb(this,e),Tb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return xb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var n=Cb.EAN5_STRUCTURE[Ob(this.data)];return{data:"1011"+(0,Pb.default)(this.data,n,"01"),text:this.text}}}]),e}(Db.default);Ul.default=Fb});var Sh=j(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var Rb=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}}(),Mb=Gn(),Ab=Xn(),Bb=Ch(Ab),Nb=Ht(),zb=Ch(Nb);function Ch(i){return i&&i.__esModule?i:{default:i}}function Lb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Hb(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 jb(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 Vb=function(i){jb(e,i);function e(t,n){return Lb(this,e),Hb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Rb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var n=Mb.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Bb.default)(this.data,n,"01"),text:this.text}}}]),e}(zb.default);Wl.default=Vb});var ql=j(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});var Ub=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.checksum=$l;var Wb=Xn(),Kn=Ph(Wb),$b=Ht(),qb=Ph($b);function Ph(i){return i&&i.__esModule?i:{default:i}}function Gb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Xb(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 Yb(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 Kb=function(i){Yb(e,i);function e(t,n){Gb(this,e),t.search(/^[0-9]{11}$/)!==-1&&(t+=$l(t));var r=Xb(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 Ub(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==$l(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,Kn.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,Kn.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,Kn.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,Kn.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,Kn.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,Kn.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}(qb.default);function $l(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}Ls.default=Kb});var kh=j(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var Qb=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}}(),Zb=Xn(),Jb=Dh(Zb),e1=Ht(),t1=Dh(e1),i1=ql();function Dh(i){return i&&i.__esModule?i:{default:i}}function n1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Gl(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 r1(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 o1=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],s1=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],a1=function(i){r1(e,i);function e(t,n){n1(this,e);var r=Gl(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=Eh(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=Eh(r.middleDigits,t[0]),r.upcA[r.upcA.length-1]===t[t.length-1])r.isValid=!0;else return Gl(r);else return Gl(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 Qb(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=s1[parseInt(r)][parseInt(n)];return(0,Jb.default)(this.middleDigits,o)}}]),e}(t1.default);function Eh(i,e){for(var t=parseInt(i[i.length-1]),n=o1[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,i1.checksum)(r)}Xl.default=a1});var Th=j(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.UPCE=kt.UPC=kt.EAN2=kt.EAN5=kt.EAN8=kt.EAN13=void 0;var l1=vh(),c1=Qn(l1),d1=_h(),u1=Qn(d1),p1=xh(),h1=Qn(p1),f1=Sh(),m1=Qn(f1),g1=ql(),y1=Qn(g1),v1=kh(),b1=Qn(v1);function Qn(i){return i&&i.__esModule?i:{default:i}}kt.EAN13=c1.default;kt.EAN8=u1.default;kt.EAN5=h1.default;kt.EAN2=m1.default;kt.UPC=y1.default;kt.UPCE=b1.default});var Ih=j(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});var sT=Lr.START_BIN="1010",aT=Lr.END_BIN="11101",lT=Lr.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]});var Kl=j(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});var _1=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=Ih(),w1=Ht(),x1=C1(w1);function C1(i){return i&&i.__esModule?i:{default:i}}function S1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function P1(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 E1(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 D1=function(i){E1(e,i);function e(){return S1(this,e),P1(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _1(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}(x1.default);Yl.default=D1});var Fh=j(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});var k1=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}}(),T1=Kl(),I1=O1(T1);function O1(i){return i&&i.__esModule?i:{default:i}}function F1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function R1(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 M1(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 Oh=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},A1=function(i){M1(e,i);function e(t,n){return F1(this,e),t.search(/^[0-9]{13}$/)!==-1&&(t+=Oh(t)),R1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return k1(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===Oh(this.data)}}]),e}(I1.default);Ql.default=A1});var Mh=j(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ITF14=Zn.ITF=void 0;var B1=Kl(),N1=Rh(B1),z1=Fh(),L1=Rh(z1);function Rh(i){return i&&i.__esModule?i:{default:i}}Zn.ITF=N1.default;Zn.ITF14=L1.default});var Jn=j(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});var H1=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}}(),j1=Ht(),V1=U1(j1);function U1(i){return i&&i.__esModule?i:{default:i}}function W1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function $1(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 q1(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 G1=function(i){q1(e,i);function e(t,n){return W1(this,e),$1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return H1(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=X1(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}(V1.default);function X1(i,e){for(var t=0;t<e;t++)i="0"+i;return i}Zl.default=G1});var Hr=j(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.mod10=Y1;js.mod11=K1;function Y1(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 K1(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 Ah=j(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var Q1=Jn(),Z1=e_(Q1),J1=Hr();function e_(i){return i&&i.__esModule?i:{default:i}}function t_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function i_(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 n_(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 r_=function(i){n_(e,i);function e(t,n){return t_(this,e),i_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,J1.mod10)(t),n))}return e}(Z1.default);Jl.default=r_});var Bh=j(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var o_=Jn(),s_=l_(o_),a_=Hr();function l_(i){return i&&i.__esModule?i:{default:i}}function c_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function d_(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 u_(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 p_=function(i){u_(e,i);function e(t,n){return c_(this,e),d_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,a_.mod11)(t),n))}return e}(s_.default);ec.default=p_});var zh=j(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});var h_=Jn(),f_=m_(h_),Nh=Hr();function m_(i){return i&&i.__esModule?i:{default:i}}function g_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function y_(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 v_(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 b_=function(i){v_(e,i);function e(t,n){return g_(this,e),t+=(0,Nh.mod10)(t),t+=(0,Nh.mod10)(t),y_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e}(f_.default);tc.default=b_});var Hh=j(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});var __=Jn(),w_=x_(__),Lh=Hr();function x_(i){return i&&i.__esModule?i:{default:i}}function C_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function S_(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 E_=function(i){P_(e,i);function e(t,n){return C_(this,e),t+=(0,Lh.mod11)(t),t+=(0,Lh.mod10)(t),S_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e}(w_.default);ic.default=E_});var jh=j(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.MSI1110=si.MSI1010=si.MSI11=si.MSI10=si.MSI=void 0;var D_=Jn(),k_=jr(D_),T_=Ah(),I_=jr(T_),O_=Bh(),F_=jr(O_),R_=zh(),M_=jr(R_),A_=Hh(),B_=jr(A_);function jr(i){return i&&i.__esModule?i:{default:i}}si.MSI=k_.default;si.MSI10=I_.default;si.MSI11=F_.default;si.MSI1010=M_.default;si.MSI1110=B_.default});var Vh=j(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.pharmacode=void 0;var N_=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_=Ht(),L_=H_(z_);function H_(i){return i&&i.__esModule?i:{default:i}}function j_(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 U_(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 W_=function(i){U_(e,i);function e(t,n){j_(this,e);var r=V_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.number=parseInt(t,10),r}return N_(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}(L_.default);Vs.pharmacode=W_});var Uh=j(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.codabar=void 0;var $_=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}}(),q_=Ht(),G_=X_(q_);function X_(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 K_(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 Q_(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 Z_=function(i){Q_(e,i);function e(t,n){Y_(this,e),t.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(t="A"+t+"A");var r=K_(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 $_(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}(G_.default);Us.codabar=Z_});var Wh=j(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.GenericBarcode=void 0;var J_=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}}(),ew=Ht(),tw=iw(ew);function iw(i){return i&&i.__esModule?i:{default:i}}function nw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function rw(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 ow(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 sw=function(i){ow(e,i);function e(t,n){return nw(this,e),rw(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return J_(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(tw.default);Ws.GenericBarcode=sw});var qh=j(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});var aw=Qp(),$s=fh(),er=Th(),$h=Mh(),Vr=jh(),lw=Vh(),cw=Uh(),dw=Wh();nc.default={CODE39:aw.CODE39,CODE128:$s.CODE128,CODE128A:$s.CODE128A,CODE128B:$s.CODE128B,CODE128C:$s.CODE128C,EAN13:er.EAN13,EAN8:er.EAN8,EAN5:er.EAN5,EAN2:er.EAN2,UPC:er.UPC,UPCE:er.UPCE,ITF14:$h.ITF14,ITF:$h.ITF,MSI:Vr.MSI,MSI10:Vr.MSI10,MSI11:Vr.MSI11,MSI1010:Vr.MSI1010,MSI1110:Vr.MSI1110,pharmacode:lw.pharmacode,codabar:cw.codabar,GenericBarcode:dw.GenericBarcode}});var Ur=j(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var uw=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};rc.default=function(i,e){return uw({},i,e)}});var Gh=j(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.default=pw;function pw(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 Xh=j(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.default=hw;function hw(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 lc=j(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.default=fw;function fw(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 dc=j(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});var mw={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(){}};cc.default=mw});var Qh=j(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var gw=lc(),yw=Kh(gw),vw=dc(),Yh=Kh(vw);function Kh(i){return i&&i.__esModule?i:{default:i}}function bw(i){var e={};for(var t in Yh.default)Yh.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,yw.default)(e),e}uc.default=bw});var pc=j(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.getTotalWidthOfEncodings=ai.calculateEncodingAttributes=ai.getBarcodePadding=ai.getEncodingHeight=ai.getMaximumHeightOfEncodings=void 0;var _w=Ur(),ww=xw(_w);function xw(i){return i&&i.__esModule?i:{default:i}}function Zh(i,e){return e.height+(e.displayValue&&i.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function Jh(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 Cw(i,e,t){for(var n=0;n<i.length;n++){var r=i[n],o=(0,ww.default)(e,r.options),s;o.displayValue?s=Ew(r.text,o,t):s=0;var a=r.data.length*o.width;r.width=Math.ceil(Math.max(s,a)),r.height=Zh(r,o),r.barcodePadding=Jh(s,a,o)}}function Sw(i){for(var e=0,t=0;t<i.length;t++)e+=i[t].width;return e}function Pw(i){for(var e=0,t=0;t<i.length;t++)i[t].height>e&&(e=i[t].height);return e}function Ew(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=Pw;ai.getEncodingHeight=Zh;ai.getBarcodePadding=Jh;ai.calculateEncodingAttributes=Cw;ai.getTotalWidthOfEncodings=Sw});var ef=j(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});var Dw=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}}(),kw=Ur(),Tw=Iw(kw),hc=pc();function Iw(i){return i&&i.__esModule?i:{default:i}}function Ow(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Fw=function(){function i(e,t,n){Ow(this,i),this.canvas=e,this.encodings=t,this.options=n}return Dw(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,Tw.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,hc.calculateEncodingAttributes)(this.encodings,this.options,t);var n=(0,hc.getTotalWidthOfEncodings)(this.encodings),r=(0,hc.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}();fc.default=Fw});var tf=j(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});var Rw=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}}(),Mw=Ur(),Aw=Bw(Mw),mc=pc();function Bw(i){return i&&i.__esModule?i:{default:i}}function Nw(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){Nw(this,i),this.svg=e,this.encodings=t,this.options=n,this.document=n.xmlDocument||document}return Rw(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,Aw.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,mc.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,mc.getTotalWidthOfEncodings)(this.encodings),n=(0,mc.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}();gc.default=zw});var nf=j(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});var Lw=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 Hw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var jw=function(){function i(e,t,n){Hw(this,i),this.object=e,this.encodings=t,this.options=n}return Lw(i,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),i}();yc.default=jw});var rf=j(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});var Vw=ef(),Uw=vc(Vw),Ww=tf(),$w=vc(Ww),qw=nf(),Gw=vc(qw);function vc(i){return i&&i.__esModule?i:{default:i}}bc.default={CanvasRenderer:Uw.default,SVGRenderer:$w.default,ObjectRenderer:Gw.default}});var Cc=j(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});function _c(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function wc(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 xc(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 Xw=function(i){xc(e,i);function e(t,n){_c(this,e);var r=wc(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),Yw=function(i){xc(e,i);function e(){_c(this,e);var t=wc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="InvalidElementException",t.message="Not supported type to render on",t}return e}(Error),Kw=function(i){xc(e,i);function e(){_c(this,e);var t=wc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="NoElementException",t.message="No element to render on.",t}return e}(Error);Wr.InvalidInputException=Xw;Wr.InvalidElementException=Yw;Wr.NoElementException=Kw});var sf=j(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});var Qw=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},Zw=Qh(),Sc=of(Zw),Jw=rf(),$r=of(Jw),ex=Cc();function of(i){return i&&i.__esModule?i:{default:i}}function Pc(i){if(typeof i=="string")return tx(i);if(Array.isArray(i)){for(var e=[],t=0;t<i.length;t++)e.push(Pc(i[t]));return e}else{if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLImageElement)return ix(i);if(i&&i.nodeName&&i.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&i instanceof SVGElement)return{element:i,options:(0,Sc.default)(i),renderer:$r.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement)return{element:i,options:(0,Sc.default)(i),renderer:$r.default.CanvasRenderer};if(i&&i.getContext)return{element:i,renderer:$r.default.CanvasRenderer};if(i&&(typeof i>"u"?"undefined":Qw(i))==="object"&&!i.nodeName)return{element:i,renderer:$r.default.ObjectRenderer};throw new ex.InvalidElementException}}function tx(i){var e=document.querySelectorAll(i);if(e.length!==0){for(var t=[],n=0;n<e.length;n++)t.push(Pc(e[n]));return t}}function ix(i){var e=document.createElement("canvas");return{element:e,options:(0,Sc.default)(i),renderer:$r.default.CanvasRenderer,afterRender:function(){i.setAttribute("src",e.toDataURL())}}}Ec.default=Pc});var af=j(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});var nx=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 rx(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var ox=function(){function i(e){rx(this,i),this.api=e}return nx(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}();Dc.default=ox});var Ic=j((zT,ff)=>{"use strict";var sx=qh(),dn=Zi(sx),ax=Ur(),qr=Zi(ax),lx=Gh(),cf=Zi(lx),cx=Xh(),lf=Zi(cx),dx=sf(),ux=Zi(dx),px=lc(),hx=Zi(px),fx=af(),mx=Zi(fx),df=Cc(),gx=dc(),uf=Zi(gx);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,ux.default)(e),r._encodings=[],r._options=uf.default,r._errorHandler=new mx.default(r),typeof t<"u"&&(n=n||{},n.format||(n.format=hf()),r.options(n)[n.format](t,n).render()),r};Gs.getModule=function(i){return dn.default[i]};for(kc in dn.default)dn.default.hasOwnProperty(kc)&&yx(dn.default,kc);var kc;function yx(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,qr.default)(r._options,n);o=(0,hx.default)(o);var s=i[e],a=pf(t,s,o);return r._encodings.push(a),r})}}function pf(i,e,t){i=""+i;var n=new e(i,t);if(!n.valid())throw new df.InvalidInputException(n.constructor.name,i);var r=n.encode();r=(0,cf.default)(r);for(var o=0;o<r.length;o++)r[o].options=(0,qr.default)(t,r[o].options);return r}function hf(){return dn.default.CODE128?"CODE128":Object.keys(dn.default)[0]}Oi.prototype.options=function(i){return this._options=(0,qr.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,qr.default)(this._options,i.options);t.format=="auto"&&(t.format=hf()),this._errorHandler.wrapBarcodeCall(function(){var n=t.value,r=dn.default[t.format.toUpperCase()],o=pf(n,r,t);Tc(i,o,t)})}}};Oi.prototype.render=function(){if(!this._renderProperties)throw new df.NoElementException;if(Array.isArray(this._renderProperties))for(var i=0;i<this._renderProperties.length;i++)Tc(this._renderProperties[i],this._encodings,this._options);else Tc(this._renderProperties,this._encodings,this._options);return this};Oi.prototype._defaults=uf.default;function Tc(i,e,t){e=(0,cf.default)(e);for(var n=0;n<e.length;n++)e[n].options=(0,qr.default)(t,e[n].options),(0,lf.default)(e[n].options);(0,lf.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)});ff.exports=Gs});var cm=j((b3,lm)=>{lm.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 sa=j((w3,dm)=>{function tS(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}dm.exports=tS});var pm=j((x3,um)=>{var iS=typeof global=="object"&&global&&global.Object===Object&&global;um.exports=iS});var Qc=j((C3,hm)=>{var nS=pm(),rS=typeof self=="object"&&self&&self.Object===Object&&self,oS=nS||rS||Function("return this")();hm.exports=oS});var mm=j((S3,fm)=>{var sS=Qc(),aS=function(){return sS.Date.now()};fm.exports=aS});var ym=j((P3,gm)=>{var lS=/\s/;function cS(i){for(var e=i.length;e--&&lS.test(i.charAt(e)););return e}gm.exports=cS});var bm=j((E3,vm)=>{var dS=ym(),uS=/^\s+/;function pS(i){return i&&i.slice(0,dS(i)+1).replace(uS,"")}vm.exports=pS});var Zc=j((D3,_m)=>{var hS=Qc(),fS=hS.Symbol;_m.exports=fS});var Sm=j((k3,Cm)=>{var wm=Zc(),xm=Object.prototype,mS=xm.hasOwnProperty,gS=xm.toString,eo=wm?wm.toStringTag:void 0;function yS(i){var e=mS.call(i,eo),t=i[eo];try{i[eo]=void 0;var n=!0}catch{}var r=gS.call(i);return n&&(e?i[eo]=t:delete i[eo]),r}Cm.exports=yS});var Em=j((T3,Pm)=>{var vS=Object.prototype,bS=vS.toString;function _S(i){return bS.call(i)}Pm.exports=_S});var Im=j((I3,Tm)=>{var Dm=Zc(),wS=Sm(),xS=Em(),CS="[object Null]",SS="[object Undefined]",km=Dm?Dm.toStringTag:void 0;function PS(i){return i==null?i===void 0?SS:CS:km&&km in Object(i)?wS(i):xS(i)}Tm.exports=PS});var Fm=j((O3,Om)=>{function ES(i){return i!=null&&typeof i=="object"}Om.exports=ES});var Mm=j((F3,Rm)=>{var DS=Im(),kS=Fm(),TS="[object Symbol]";function IS(i){return typeof i=="symbol"||kS(i)&&DS(i)==TS}Rm.exports=IS});var zm=j((R3,Nm)=>{var OS=bm(),Am=sa(),FS=Mm(),Bm=NaN,RS=/^[-+]0x[0-9a-f]+$/i,MS=/^0b[01]+$/i,AS=/^0o[0-7]+$/i,BS=parseInt;function NS(i){if(typeof i=="number")return i;if(FS(i))return Bm;if(Am(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Am(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=OS(i);var t=MS.test(i);return t||AS.test(i)?BS(i.slice(2),t?2:8):RS.test(i)?Bm:+i}Nm.exports=NS});var ed=j((M3,Hm)=>{var zS=sa(),Jc=mm(),Lm=zm(),LS="Expected a function",HS=Math.max,jS=Math.min;function VS(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(LS);e=Lm(e)||0,zS(t)&&(d=!!t.leading,u="maxWait"in t,o=u?HS(Lm(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 E(b){var w=b-l,S=b-c,A=e-w;return u?jS(A,o-S):A}function N(b){var w=b-l,S=b-c;return l===void 0||w>=e||w<0||u&&S>=o}function M(){var b=Jc();if(N(b))return U(b);a=setTimeout(M,E(b))}function U(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:U(Jc())}function ee(){var b=Jc(),w=N(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}Hm.exports=VS});var Vm=j((A3,jm)=>{var US=ed(),WS=sa(),$S="Expected a function";function qS(i,e,t){var n=!0,r=!0;if(typeof i!="function")throw new TypeError($S);return WS(t)&&(n="leading"in t?!!t.leading:n,r="trailing"in t?!!t.trailing:r),US(i,e,{leading:n,maxWait:e,trailing:r})}jm.exports=qS});var io=j((Q3,Ym)=>{"use strict";Ym.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 Zm=j((Z3,Qm)=>{"use strict";function Km(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}Km.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};Qm.exports=function(i,e,t){var n=new Km(i,t||/[\/\.]/);return typeof e<"u"?n.match(e):n}});var eg=j((J3,Jm)=>{var ZS=Zm(),JS=/[\/\+\.]/;Jm.exports=function(i,e){function t(n){var r=ZS(n,i,JS);return r&&r.length>=2}return e?t(e.split(";")[0]):t}});var yt=j((MF,ba)=>{(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 ba<"u"&&ba.exports?(e.default=e,ba.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var w0=j((LM,ou)=>{"use strict";var k2=Object.prototype.hasOwnProperty,bt="~";function Ro(){}Object.create&&(Ro.prototype=Object.create(null),new Ro().__proto__||(bt=!1));function T2(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function _0(i,e,t,n,r){if(typeof t!="function")throw new TypeError("The listener must be a function");var o=new T2(t,n||i,r),s=bt?bt+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 za(i,e){--i._eventsCount===0?i._events=new Ro:delete i._events[e]}function ft(){this._events=new Ro,this._eventsCount=0}ft.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)k2.call(t,n)&&e.push(bt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};ft.prototype.listeners=function(e){var t=bt?bt+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};ft.prototype.listenerCount=function(e){var t=bt?bt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};ft.prototype.emit=function(e,t,n,r,o,s){var a=bt?bt+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};ft.prototype.on=function(e,t,n){return _0(this,e,t,n,!1)};ft.prototype.once=function(e,t,n){return _0(this,e,t,n,!0)};ft.prototype.removeListener=function(e,t,n,r){var o=bt?bt+e:e;if(!this._events[o])return this;if(!t)return za(this,o),this;var s=this._events[o];if(s.fn)s.fn===t&&(!r||s.once)&&(!n||s.context===n)&&za(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:za(this,o)}return this};ft.prototype.removeAllListeners=function(e){var t;return e?(t=bt?bt+e:e,this._events[t]&&za(this,t)):(this._events=new Ro,this._eventsCount=0),this};ft.prototype.off=ft.prototype.removeListener;ft.prototype.addListener=ft.prototype.on;ft.prefixed=bt;ft.EventEmitter=ft;typeof ou<"u"&&(ou.exports=ft)});var dy=j((Hu,ju)=>{(function(i,e){typeof Hu=="object"&&typeof ju<"u"?ju.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=e())})(Hu,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,ve,be,xt;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),ve=new Uint8Array(J),be=0;be<Z.length;be+=1)ve[be]=Z.charCodeAt(be);return T?new Blob([R?ve:J],{type:ne}):(xt=new V,xt.append(J),xt.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:{},E=function(C){return C>0&&C<1/0},N=Array.prototype.slice;function M(F){return Array.from?Array.from(F):N.call(F)}var U=/^image\/.+$/;function de(F){return U.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 ye(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=E(T),ie=E(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,Rt=/\.\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||!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,ve=document.createElement("canvas"),be=ve.getContext("2d"),xt=Math.abs(G)%180===90,Mt=(J.resize==="contain"||J.resize==="cover")&&E(J.width)&&E(J.height),je=Math.max(J.maxWidth,0)||1/0,Ct=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(xt){var ki=[Ct,je];je=ki[0],Ct=ki[1];var At=[st,Te];Te=At[0],st=At[1];var Wi=[Ze,Re];Re=Wi[0],Ze=Wi[1]}Mt&&(at=Re/Ze);var Er=Ne({aspectRatio:at,width:je,height:Ct},"contain");je=Er.width,Ct=Er.height;var qu=Ne({aspectRatio:at,width:Te,height:st},"cover");if(Te=qu.width,st=qu.height,Mt){var Gu=Ne({aspectRatio:at,width:Re,height:Ze},J.resize);Re=Gu.width,Ze=Gu.height}else{var Xu=Ne({aspectRatio:at,width:Re,height:Ze}),Yu=Xu.width;Re=Yu===void 0?R:Yu;var Ku=Xu.height;Ze=Ku===void 0?V:Ku}Re=Math.floor(ye(Math.min(Math.max(Re,Te),je))),Ze=Math.floor(ye(Math.min(Math.max(Ze,st),Ct)));var Ay=-Re/2,By=-Ze/2,Ny=Re,zy=Ze,el=[];if(Mt){var Qu=0,Zu=0,tl=R,il=V,Ju=Ne({aspectRatio:at,width:R,height:V},{contain:"cover",cover:"contain"}[J.resize]);tl=Ju.width,il=Ju.height,Qu=(R-tl)/2,Zu=(V-il)/2,el.push(Qu,Zu,tl,il)}if(el.push(Ay,By,Ny,zy),xt){var ep=[Ze,Re];Re=ep[0],Ze=ep[1]}ve.width=Re,ve.height=Ze,de(J.mimeType)||(J.mimeType=ge.type);var tp="transparent";ge.size>J.convertSize&&J.convertTypes.indexOf(J.mimeType)>=0&&(J.mimeType="image/jpeg");var ip=J.mimeType==="image/jpeg";if(ip&&(tp="#fff"),be.fillStyle=tp,be.fillRect(0,0,Re,Ze),J.beforeDraw&&J.beforeDraw.call(this,be,ve),!this.aborted&&(be.save(),be.translate(Re/2,Ze/2),be.rotate(G*Math.PI/180),be.scale(Y,re),be.drawImage.apply(be,[Z].concat(el)),be.restore(),J.drew&&J.drew.call(this,be,ve),!this.aborted)){var np=function(Dr){if(!T.aborted){var rp=function(kr){return T.done({naturalWidth:R,naturalHeight:V,result:kr})};if(Dr&&ip&&J.retainExif&&T.exif&&T.exif.length>0){var op=function(kr){return rp(d(S(Se(kr,T.exif),J.mimeType)))};if(Dr.arrayBuffer)Dr.arrayBuffer().then(op).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(nl){var kr=nl.target;op(kr.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(Dr)}}else rp(Dr)}};ve.toBlob?ve.toBlob(np,J.mimeType,J.quality):np(d(ve.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(Rt,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 fy=j((Uu,Wu)=>{((i,e)=>{typeof define=="function"&&define.amd?define([],e):typeof Wu=="object"&&typeof Uu<"u"?Wu.exports=e():i.Papa=e()})(Uu,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 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(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),ye=-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,Rt=!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,ve)=>(be=>(b.dynamicTypingFunction&&b.dynamicTyping[be]===void 0&&(b.dynamicTyping[be]=b.dynamicTypingFunction(be)),(b.dynamicTyping[be]||b.dynamicTyping)===!0))(J)?ve==="true"||ve==="TRUE"||ve!=="false"&&ve!=="FALSE"&&((be=>{if(Ne.test(be)&&(be=parseFloat(be),ye<be&&be<K))return 1})(ve)?parseFloat(ve):Pe.test(ve)?new Date(ve):ve===""?null:ve):ve)(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,ve,be;ge=ge||[","," ","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var xt=0;xt<ge.length;xt++){for(var Mt,je=ge[xt],Ct=0,Te=0,st=0,at=(ve=void 0,new E({comments:re,delimiter:je,newline:Y,preview:10}).parse($)),Re=0;Re<at.data.length;Re++)ne&&F(at.data[Re])?st++:(Mt=at.data[Re].length,Te+=Mt,ve===void 0?ve=Mt:0<Mt&&(Ct+=Math.abs(Mt-ve),ve=Mt));0<at.data.length&&(Te/=at.data.length-st),(J===void 0||Ct<=J)&&(be===void 0||be<Te)&&1.99<Te&&(J=Ct,Z=je,be=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 E(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 Rt},this.abort=function(){Rt=!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
+ `),$=1<G.length&&G[0].length<ie[0].length;if(ie.length===1||$)return`
3
+ `;for(var Y=0,ne=0;ne<ie.length;ne++)ie[ne][0]===`
4
+ `&&Y++;return Y>=ie.length/2?`\r
5
+ `:"\r"}}function _(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(b){var w=(b=b||{}).delimiter,S=b.newline,A=b.comments,L=b.step,K=b.preview,ye=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
+ `&&S!=="\r"&&S!==`\r
7
+ `&&(S=`
8
+ `);var Q=0,ze=!1;this.parse=function(te,Rt,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(ye||ye!==!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=[],ve(ie.split(w)),Ct(),ze)return je()}else ve(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}),xt();if(Z===X-1)return xt(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=be((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=be(re),te.substring(Z+1+J,Z+1+J+C)===S){if(ie.push(te.substring(Q,Z).replace(ge,Pe)),Mt(Z+1+J+C),ne=te.indexOf(w,Q),Z=te.indexOf(Pe,Q),T&&(Ct(),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)),Mt(re+C),T&&(Ct(),ze))return je();if(K&&R.length>=K)return je(!0)}return xt();function ve(Te){R.push(Te),G=Q}function be(Te){var st=0;return st=Te!==-1&&(Te=te.substring(Z+1,Te))&&Te.trim()===""?Te.length:st}function xt(Te){return he||(Te===void 0&&(Te=te.substring(Q)),ie.push(Te),Q=X,ve(ie),T&&Ct()),je()}function Mt(Te){Q=Te,ve(ie),ie=[],re=te.indexOf(S,Q)}function je(Te){if(b.header&&!Rt&&R.length){var st=R[0],at={},Re=new Set(st);let Ze=!1;for(let ki=0;ki<st.length;ki++){let At=st[ki];if(at[At=ee(b.transformHeader)?b.transformHeader(At,ki):At]){let Wi,Er=at[At];for(;Wi=At+"_"+Er,Er++,Re.has(Wi););Re.add(Wi),st[ki]=Wi,at[At]++,Ze=!0,(Ne=Ne===null?{}:Ne)[Wi]=At}else at[At]=1,st[ki]=At;Re.add(At)}Ze&&console.warn("Duplicate headers found and renamed.")}return{data:R,errors:V,meta:{delimiter:w,linebreak:S,aborted:ze,truncated:!!Te,cursor:G+(Rt||0),renamedHeaders:Ne}}}function Ct(){L(je()),R=[],V=[]}},this.abort=function(){ze=!0},this.getCharIndex=function(){return Q}}function N(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:U,resume:U};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 U(){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 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=N,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
+ `,ye='"',Ne=ye+ye,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"&&(ye=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+ye),w.escapeFormulae instanceof RegExp?Q=w.escapeFormulae:typeof w.escapeFormulae=="boolean"&&w.escapeFormulae&&(Q=/^[=+\-@\t\r].*$/)}})(),new RegExp(_(ye),"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+=Rt(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+=Rt(X[V][Z],ge)}V<X.length-1&&(!F||0<ie&&!$)&&(C+=K)}}return C}function Rt(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)===" ")?ye+F+ye: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=E,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 ye=0;ye<this.files.length;ye++)S.push({file:this.files[ye],inputElem:this,instanceConfig:t.extend({},w)})}),A(),this;function A(){if(S.length===0)ee(b.complete)&&b.complete();else{var K,ye,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",ye=Se.file,Ne=Se.inputElem,Pe=Q.reason,void(ee(b.error)&&b.error({name:K},ye,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,(u.prototype=Object.create(u.prototype)).constructor=u,(g.prototype=Object.create(l.prototype)).constructor=g,a})});var Iy=j((Ja,$u)=>{(function(e,t){typeof Ja=="object"&&typeof $u=="object"?$u.exports=t():typeof define=="function"&&define.amd?define([],t):typeof Ja=="object"?Ja.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(E){return typeof E}:o=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},o(h)}function s(h,_){var E="font-family:"+_.font+" !important; font-size: "+_.font_size+" !important; width:100%;";return'<div style="'+E+'">'+h+"</div>"}function a(h){return h.charAt(0).toUpperCase()+h.slice(1)}function l(h,_){for(var E=document.defaultView||window,N="",M=E.getComputedStyle(h,""),U=0;U<M.length;U++)(_.targetStyles.indexOf("*")!==-1||_.targetStyle.indexOf(M[U])!==-1||c(_.targetStyles,M[U]))&&M.getPropertyValue(M[U])&&(N+=M[U]+":"+M.getPropertyValue(M[U])+";");return N+="max-width: "+_.maxWidth+"px !important; font-size: "+_.font_size+" !important;",N}function c(h,_){for(var E=0;E<h.length;E++)if(o(_)==="object"&&_.indexOf(h[E])!==-1)return!0;return!1}function d(h,_){var E=document.createElement("div");if(g(_.header))E.innerHTML=_.header;else{var N=document.createElement("h1"),M=document.createTextNode(_.header);N.appendChild(M),N.setAttribute("style",_.headerStyle),E.appendChild(N)}h.insertBefore(E,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 E=function N(){window.removeEventListener(_,N),h.onPrintDialogClose();var M=document.getElementById(h.frameId);M&&M.remove()};window.addEventListener(_,E)}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 E in h)E==="printable"||E==="fallbackPrintable"||(h[E]=typeof _[E]<"u"?_[E]:h[E]);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 N=document.getElementById(h.frameId);N&&N.parentNode.removeChild(N);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 U=window.open(h.fallbackPrintable,"_blank");U.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],E=c[h].field.split(".");if(E.length>1)for(var N=0;N<E.length;N++)_=_[E[N]];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 E=h.getElementsByTagName("img");E.length>0?a(Array.from(E)).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 vx=De(Ic(),1);var tr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({})}}return i})();function mf(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 bx(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 Oc=class{constructor(e){this.element=e,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,`
11
+ `)}set value(e){this.element.innerHTML=e.replace(/\n$/,`
12
+
13
+ `)}get selectionStart(){return mf(this.element)[0]}get selectionEnd(){return mf(this.element)[1]}setSelectionRange(e,t){bx(this.element,[e??0,t??0])}select(){this.setSelectionRange(0,this.value.length)}};function _x(i){let e=new Oc(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 bf=i=>i.isContentEditable?_x(i):i.querySelector("input,textarea")||i,ir={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"},Fc=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 wx(i,...e){return e.every(({value:t})=>t===i.value)}function xx(i,...e){return e.every(({value:t,selection:n})=>t===i.value&&n[0]===i.selection[0]&&n[1]===i.selection[1])}function Cx({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 Qs(i){return typeof i=="string"}function gf(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(!Qs(s)||s===t&&!a)return r;r+=s}return r}function _f(i,e){return Array.isArray(e)?i.length===e.length&&Array.from(i).every((t,n)=>{let r=e[n]||"";return Qs(r)?t===r:t.match(r)}):e.test(i)}function Sx(i,e,t){let n=null,r=null,o=Array.from(i.value).reduce((a,l,c)=>{let d=gf(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),Qs(g)?u+g:l.match(g)?u+l:u},""),s=gf(e,o,"",t);return{value:_f(o+s,e)?o+s:o,selection:[n??o.length,r??o.length]}}function Px({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 Xs(i,e,t=null){if(_f(i.value,e))return i;let{value:n,selection:r}=Array.isArray(e)?Sx(i,e,t):Px(i,e);return{selection:r,value:Array.isArray(e)?n.slice(0,e.length):n}}function yf(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),Qs(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 Yr=class{constructor(e,t){this.initialElementState=e,this.maskOptions=t,this.value="",this.selection=[0,0];let{value:n,selection:r}=Xs(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=yf(a,s),[c,d]=Cx(l,n,o.overwriteMode).selection,u=l.value.slice(0,c)+n,g=u.length,h=Xs({value:u+l.value.slice(d),selection:[g,g]},s,a);if(r.slice(0,e)===Xs({value:u,selection:[g,g]},s,a).value||xx(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=yf(o,r),[a,l]=s.selection,c=s.value.slice(0,a)+s.value.slice(l),d=Xs({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}},Rc=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},Gr={Y:89,Z:90};function Xr(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 Ex(i){return Xr(i,ci.CTRL,Gr.Y)||Xr(i,ci.CTRL|ci.SHIFT,Gr.Z)||Xr(i,ci.META|ci.SHIFT,Gr.Z)}function Dx(i){return Xr(i,ci.CTRL,Gr.Z)||Xr(i,ci.META,Gr.Z)}function nr(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 kx({value:i,selection:e},t){let[n,r]=e;if(n!==r)return[n,r];let o=t?i.slice(n).indexOf(`
14
+ `)+1||i.length:i.slice(0,r).lastIndexOf(`
15
+ `)+1;return[t?n:o,t?o:r]}function Tx({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 Ix=/\s+$/g,Ox=/^\s+/g,vf=/\s/;function Fx({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(Ox)||[""],d=l.trimStart().search(vf);return[n,d!==-1?n+c.length+d:i.length]}let o=i.slice(0,r),[s]=o.match(Ix)||[""],a=o.trimEnd().split("").reverse().findIndex(l=>vf.exec(l));return[a!==-1?r-s.length-a:0,r]}function Ys(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({},ir),e),n=Ys(t.preprocessors),r=Ys(t.postprocessors),o=typeof i=="string"?{value:i,selection:[0,0]}:i,{elementState:s}=n({elementState:o,data:""},"validation"),a=new Yr(s,t),{value:l,selection:c}=r(a,o);return typeof i=="string"?l:{value:l,selection:c}}var Ks=class extends Fc{constructor(e,t){super(),this.element=e,this.maskitoOptions=t,this.isTextArea=this.element.nodeName==="TEXTAREA",this.eventListener=new Rc(this.element),this.options=Object.assign(Object.assign({},ir),this.maskitoOptions),this.upcomingElementState=null,this.preprocessor=Ys(this.options.preprocessors),this.postprocessor=Ys(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(Ex(n))return n.preventDefault(),this.redo();if(Dx(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:Tx(this.elementState,a)});case"deleteHardLineBackward":case"deleteHardLineForward":case"deleteSoftLineBackward":case"deleteSoftLineForward":return this.handleDelete({event:n,isForward:a,selection:kx(this.elementState,a),force:!0});case"deleteWordBackward":case"deleteWordForward":return this.handleDelete({event:n,isForward:a,selection:Fx(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 Yr(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(wx(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 Yr(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 rr(i,e,t){let n=Math.min(Number(t),Math.max(Number(e),Number(i)));return i instanceof Date?new Date(n):n}var Rx=[".",",","\u0431","\u044E"];var Ac="\xA0",Mx="\u200B",Pf="\u2013",Ef="\u2014",Zs="-",Mc="\u2212",Df="\u30FC";var VT=new RegExp(`[${Ac}APM]+$`,"g"),UT=new RegExp(`${Ac}[AP]M$`,"g"),Ax=[":","."];function or(i){return i}function Bx(){}var kf=/[\\^$.*+?()[\]{}|]/g,Nx=new RegExp(kf.source);function gt(i){return i&&Nx.test(i)?i.replaceAll(kf,String.raw`\$&`):i}function di(i,{prefix:e,postfix:t}){var n,r;let o=new RegExp(`^${gt(e)}`),s=new RegExp(`${gt(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 zx(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 wf(i){return i.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function Lx(){return({elementState:i,data:e})=>{let{value:t,selection:n}=i;return{elementState:{selection:n,value:wf(t)},data:wf(e)}}}var WT=new RegExp(`[${Ax.map(gt).join("")}]$`);function Hx(i){let e=new RegExp(`${gt(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=zx(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)}}:or}function jx(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}}:or}function sr(i,e,t){return(n,r)=>{let o=()=>e(n,r);return n.addEventListener(i,o,t),()=>n.removeEventListener(i,o,t)}}function Vx(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 Tf(i){return Vx(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(rr(r,s,a),rr(o,s,a))})}function Ux({prefix:i,postfix:e}){return({elementState:t,data:n})=>{let{cleanValue:r}=di(n,{prefix:i,postfix:e});return{elementState:t,data:r}}}function If({decimalSeparator:i,isNegativeAllowed:e,precision:t,thousandSeparator:n,prefix:r,postfix:o,decimalPseudoSeparators:s=[],pseudoMinuses:a=[],minusSign:l}){let c=xf(r),d=String.raw`\d`,u=e?`[${l}${a.map(N=>`\\${N}`).join("")}]?`:"",g=n?`[${d}${gt(n).replaceAll(/\s/g,String.raw`\s`)}]*`:`[${d}]*`,h=Number.isFinite(t)?t:"",_=t>0?`([${gt(i)}${s.map(gt).join("")}]${d}{0,${h}})?`:"",E=xf(o);return new RegExp(`^${c}${u}${g}${_}${E}$`)}function xf(i){return i?`${i.split("").map(e=>`${gt(e)}?`).join("")}`:""}function Bc(i,e="."){let t=!!new RegExp(`^\\D*[${Mc}\\${Zs}${Pf}${Ef}${Df}]`).exec(i),n=gt(e),r=i.replaceAll(new RegExp(`${n}(?!\\d)`,"g"),"").replaceAll(new RegExp(`[^\\d${n}]`,"g"),"").replace(e,e&&".");return r?+`${t?Zs:""}${r}`:NaN}function Wx(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 Of(i,{decimalSeparator:e,minusSign:t}){let[n="",r=""]=e?i.split(e):[i],o=gt(t),[,s="",a=""]=new RegExp(`^(?:[^\\d${o}])?(${o})?(.*)`).exec(n)||[];return{minus:s,integerPart:a,decimalPart:r}}function $x({decimalSeparator:i,thousandSeparator:e,decimalPseudoSeparators:t=Rx}){return t.filter(n=>n!==e&&n!==i)}function qx({decimalSeparator:i,precision:e,decimalZeroPadding:t,prefix:n,postfix:r}){return e<=0||!t?or:({value:o,selection:s})=>{let{cleanValue:a,extractedPrefix:l,extractedPostfix:c}=di(o,{prefix:n,postfix:r});if(Number.isNaN(Bc(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 Gx({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}=Of(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 Xx({decimalSeparator:i,decimalPseudoSeparators:e,pseudoMinuses:t,prefix:n,postfix:r,minusSign:o}){let s=!0,a=If({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:E,extractedPostfix:N}=di(d,{prefix:n,postfix:r}),M=un({selection:[Math.max(g-_.length,0),rr(h-_.length,0,E.length)],value:E},{mask:a}),[U,de]=M.selection;return{elementState:{selection:[U+_.length,de+_.length],value:_+M.value+N},data:c}}}function Yx({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n}){let r=s=>{let a=gt(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),[_="",E=""]=i?d.split(i):[d],N=r(_);if(_===N)return{value:s,selection:a};let M=l-o(s,l),U=c-o(s,c);return{value:u+N+(h?i:"")+E+g,selection:[Math.max(M,0),Math.max(U,0)]}}}function Kx({min:i,max:e,decimalSeparator:t,minusSign:n}){return({value:r,selection:o})=>{let s=Bc(r,t),a=s>0?Math.min(s,e):Math.max(s,i);if(s&&a!==s){let l=`${a}`.replace(".",t).replace(Zs,n);return{value:l,selection:[l.length,l.length]}}return{value:r,selection:o}}}function Qx({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 Zx({decimalSeparator:i,precision:e,prefix:t,postfix:n}){let r=new RegExp(`^\\D*${gt(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=rr(u-d.length,0,c.length),_=rr(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 E=/\d+/.exec(c.slice(0,h));return{elementState:o,data:E?s:`0${s}`}}}function Cf({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 Jx({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(gt(i),"gi"),"")}}:or}function eC({thousandSeparator:i,decimalSeparator:e,prefix:t,postfix:n,minusSign:r}){if(!i)return or;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:E,integerPart:N,decimalPart:M}=Of(g,{decimalSeparator:e,minusSign:r}),U=e&&g.includes(e),de=g.length-(E+N+(U?e+M:"")).length;de>0&&l&&l<=de&&(d-=de),de>0&&c&&c<=de&&(u-=de);let oe=Array.from(N).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&&u--,ee):A?(w<l&&d++,w<c&&u++,b+i+ee):b+ee},"");return{value:_+E+oe+(U?e:"")+M+h,selection:[d,u]}}}function tC({precision:i,decimalSeparator:e,prefix:t,postfix:n}){if(i>0||!e)return or;let r=new RegExp(`${gt(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 Sf=[0,0];function iC({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n}){let r=Yx({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n});return sr("blur",o=>{let s=r({value:o.value,selection:Sf},{value:"",selection:Sf}).value;nr(o,s)},{capture:!0})}function nC({min:i,max:e,decimalSeparator:t}){return sr("blur",(n,r)=>{let o=Bc(n.value,t),s=rr(o,i,e);!Number.isNaN(o)&&o!==s&&nr(n,un(Wx(s),r))},{capture:!0})}function rC({decimalSeparator:i,prefix:e,postfix:t}){return i?sr("blur",n=>{let{cleanValue:r,extractedPostfix:o,extractedPrefix:s}=di(n.value,{prefix:e,postfix:t}),a=s+r.replace(new RegExp(`^(\\D+)?${gt(i)}`),`$10${i}`)+o;nr(n,a)},{capture:!0}):Bx}function ar({max:i=Number.MAX_SAFE_INTEGER,min:e=Number.MIN_SAFE_INTEGER,precision:t=0,thousandSeparator:n=Ac,decimalSeparator:r=".",decimalPseudoSeparators:o,decimalZeroPadding:s=!1,prefix:a="",postfix:l="",minusSign:c=Mc}={}){let d=[Zs,Pf,Ef,Df,Mc].filter(_=>_!==n&&_!==r&&_!==c),u=$x({decimalSeparator:r,thousandSeparator:n,decimalPseudoSeparators:o}),g=a.endsWith(r)&&t>0?`${a}${Mx}`:a,h=Xx({decimalSeparator:r,decimalPseudoSeparators:u,pseudoMinuses:d,prefix:g,postfix:l,minusSign:c});return r=t<=0&&r===n?"":r,Object.assign(Object.assign({},ir),{mask:If({decimalSeparator:r,precision:t,thousandSeparator:n,prefix:g,postfix:l,isNegativeAllowed:e<0,minusSign:c}),preprocessors:[Lx(),h,Ux({prefix:g,postfix:l}),Cf({validCharacter:c,pseudoCharacters:d,prefix:g,postfix:l}),Cf({validCharacter:r,pseudoCharacters:u,prefix:g,postfix:l}),Zx({decimalSeparator:r,precision:t,prefix:g,postfix:l}),Qx({decimalSeparator:r,decimalZeroPadding:s,thousandSeparator:n}),tC({precision:t,decimalSeparator:r,prefix:g,postfix:l}),Jx({decimalSeparator:r,prefix:g,postfix:l})],postprocessors:[Kx({decimalSeparator:r,min:e,max:i,minusSign:c}),jx(g),Hx(l),eC({decimalSeparator:r,thousandSeparator:n,prefix:g,postfix:l,minusSign:c}),qx({decimalSeparator:r,decimalZeroPadding:s,precision:t,prefix:g,postfix:l}),Gx({prefix:g,postfix:l,decimalSeparator:r,minusSign:c})],plugins:[iC({decimalSeparator:r,thousandSeparator:n,prefix:g,postfix:l}),rC({decimalSeparator:r,prefix:g,postfix:l}),nC({min:e,max:i,decimalSeparator:r})],overwriteMode:s?({value:_,selection:[E]})=>E<=_.indexOf(r)?"shift":"replace":"shift"})}var Ji=(()=>{class i{constructor(){this.elementRef=z(Et).nativeElement,this.ngZone=z(Pt),this.maskedElement=null,this.options=null,this.elementPredicate=bf;let t=z(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 Ks(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})(),Ff=(()=>{class i{transform(t,n){return un(String(t??""),n??ir)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=ts({name:"maskito",type:i,pure:!0,standalone:!0})}}return i})();var sC=20,Mf=(()=>{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=sC){return this._platform.isBrowser?new St(n=>{this._globalSubscription||this._addGlobalListener();let r=t>0?this._scrolled.pipe(ol(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(Qt(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=zp(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(Pt),pe(Ii),pe(mt,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var aC=20,Kr=(()=>{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=aC){return t>0?this._change.pipe(ol(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(Pt),pe(mt,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Js=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({})}}return i})(),Nc=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({imports:[Mr,Js,Mr,Js]})}}return i})();var Bf=Np(),zc=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"),Bf&&(n.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Bf&&(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 Lc=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(Qt(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}},ea=class{enable(){}disable(){}attach(){}};function Hc(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 Nf(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 jc=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();Hc(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}},cC=(()=>{class i{constructor(t,n,r,o){this._scrollDispatcher=t,this._viewportRuler=n,this._ngZone=r,this.noop=()=>new ea,this.close=s=>new Lc(this._scrollDispatcher,this._ngZone,this._viewportRuler,s),this.block=()=>new zc(this._viewportRuler,this._document),this.reposition=s=>new jc(this._scrollDispatcher,this._viewportRuler,this._ngZone,s),this._document=o}static{this.\u0275fac=function(n){return new(n||i)(pe(Mf),pe(Kr),pe(Pt),pe(mt))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Qr=class{constructor(e){if(this.scrollStrategy=new ea,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 Vc=class{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}};var Uf=(()=>{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(mt))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),dC=(()=>{class i extends Uf{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(mt),pe(Pt,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),uC=(()=>{class i extends Uf{constructor(t,n,r){super(t),this._platform=n,this._ngZone=r,this._cursorStyleIsSet=!1,this._pointerDownListener=o=>{this._pointerDownEventTarget=Ar(o)},this._clickListener=o=>{let s=Ar(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(zf(d.overlayElement,s)||zf(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(mt),pe(Ii),pe(Pt,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function zf(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 Wf=(()=>{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||wl()){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),wl()?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(mt),pe(Ii))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Uc=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=gp(()=>fp(()=>{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=os(()=>{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=xl(t||[]).filter(o=>!!o);r.length&&(n?e.classList.add(...r):e.classList.remove(...r))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{let e=this._renders.pipe(dl(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)}},Lf="cdk-overlay-connected-position-bounding-box",pC=/([A-Za-z%]+)$/,Wc=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(Lf),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(Lf),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=jf(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),E=this._subtractOverflows(o.height,g,h),N=_*E;return{visibleArea:N,isCompletelyWithinViewport:o.width*o.height===N,fitsInViewportVertically:E===o.height,fitsInViewportHorizontally:_==o.width}}_canFitWithFlexibleDimensions(e,t,n){if(this._hasFlexibleDimensions){let r=n.bottom-t.y,o=n.right-t.x,s=Hf(this._overlayRef.getConfig().minHeight),a=Hf(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=jf(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||!hC(this._lastScrollVisibility,n)){let r=new Vc(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:Nf(e,n),isOriginOutsideView:Hc(e,n),isOverlayClipped:Nf(t,n),isOverlayOutsideView:Hc(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&&xl(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 Et)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 Hf(i){if(typeof i!="number"&&i!=null){let[e,t]=i.split(pC);return!t||t==="px"?parseFloat(e):null}return i||null}function jf(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 hC(i,e){return i===e?!0:i.isOriginClipped===e.isOriginClipped&&i.isOriginOutsideView===e.isOriginOutsideView&&i.isOverlayClipped===e.isOverlayClipped&&i.isOverlayOutsideView===e.isOverlayOutsideView}var Vf="cdk-global-overlay-wrapper",$c=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(Vf),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="",_="",E="";l?E="flex-start":d==="center"?(E="center",g?_=u:h=u):g?d==="left"||d==="end"?(E="flex-end",h=u):(d==="right"||d==="start")&&(E="flex-start",_=u):d==="left"||d==="start"?(E="flex-start",h=u):(d==="right"||d==="end")&&(E="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=E,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(Vf),n.justifyContent=n.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}},fC=(()=>{class i{constructor(t,n,r,o){this._viewportRuler=t,this._document=n,this._platform=r,this._overlayContainer=o}global(){return new $c}flexibleConnectedTo(t){return new Wc(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}static{this.\u0275fac=function(n){return new(n||i)(pe(Kr),pe(mt),pe(Ii),pe(Wf))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),mC=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 Qr(t);return s.direction=s.direction||this._directionality.value,new Uc(o,n,r,s,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,this._animationsModuleType==="NoopAnimations",this._injector.get(up))}position(){return this._positionBuilder}_createPaneElement(t){let n=this._document.createElement("div");return n.id=`cdk-overlay-${mC++}`,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(mp)),new Ap(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}static{this.\u0275fac=function(n){return new(n||i)(pe(cC),pe(Wf),pe(hp),pe(fC),pe(dC),pe(Xe),pe(Pt),pe(mt),pe(Is),pe(hs),pe(uC),pe(pp,8))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var gC=new Ir("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let i=z(en);return()=>i.scrollStrategies.reposition()}});function yC(i){return()=>i.scrollStrategies.reposition()}var vC={provide:gC,deps:[en],useFactory:yC},$f=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({providers:[en,vC],imports:[Mr,Bp,Nc,Nc]})}}return i})();var CC=["panel"],SC=["*"];function PC(i,e){if(i&1){let t=Ie();f(0,"div",1,0),W("@panelAnimation.done",function(r){se(t);let o=O();return ae(o._animationDone.next(r))}),ds(2),m()}if(i&2){let t=e.id,n=O();ss(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"),P("id",n.id)("@panelAnimation",n.isOpen?"visible":"hidden"),Lt("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(t))}}var EC=Fp("panelAnimation",[Mp("void, hidden",Rr({opacity:0,transform:"scaleY(0.8)"})),bl(":enter, hidden => visible",[Rp([ks("0.03s linear",Rr({opacity:1})),ks("0.12s cubic-bezier(0, 0, 0.2, 1)",Rr({transform:"scaleY(1)"}))])]),bl(":leave, visible => hidden",[ks("0.075s linear",Rr({opacity:0}))])]),DC=0,Gc=class{constructor(e,t){this.source=e,this.option=t}},Xf=new Ir("mat-autocomplete-default-options",{providedIn:"root",factory:kC});function kC(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var Yf=(()=>{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 zt,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new zt,this.opened=new zt,this.closed=new zt,this.optionActivated=new zt,this.id=`mat-autocomplete-${DC++}`,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 jp(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 Gc(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(Et),He(Xf),He(Ii))}}static{this.\u0275cmp=fe({type:i,selectors:[["mat-autocomplete"]],contentQueries:function(n,r,o){if(n&1&&(us(o,Ms,5),us(o,Up,5)),n&2){let s;ei(s=ti())&&(r.options=s),ei(s=ti())&&(r.optionGroups=s)}},viewQuery:function(n,r){if(n&1&&(yi(Or,7),yi(CC,5)),n&2){let o;ei(o=ti())&&(r.template=o.first),ei(o=ti())&&(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:[ps([{provide:Vp,useExisting:i}]),Fr,_e],ngContentSelectors:SC,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&&(cs(),le(0,PC,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:[EC]},changeDetection:0})}}return i})();var TC={provide:Sp,useExisting:dp(()=>Xc),multi:!0};var Kf=new Ir("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let i=z(en);return()=>i.scrollStrategies.reposition()}});function IC(i){return()=>i.scrollStrategies.reposition()}var OC={provide:Kf,deps:[en],useFactory:IC},Xc=(()=>{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=z(Lp),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=z(Xe),this._aboveClass="mat-mdc-autocomplete-panel-above",this._overlayAttached=!1,this.optionSelections=ap(()=>{let h=this.autocomplete?this.autocomplete.options:null;return h?h.changes.pipe(cl(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(Qt(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Qt(()=>this._overlayAttached)):Le()).pipe(Kt(t=>t instanceof Wp?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(Qt(t=>{let n=Ar(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 St(r=>{os(()=>{r.next()},{injector:this._injector})}),n=this.autocomplete.options.changes.pipe(xe(()=>this._positionStrategy.reapplyLastPosition()),cp(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})),sl(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(sl(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;Sl(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 _l(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(Hp.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 Qr({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=$p(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=qp(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),Sl(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(Et),He(en),He(rs),He(Pt),He(cn),He(Kf),He(Is,8),He(Gp,9),He(mt,8),He(Kr),He(Xf,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&&W("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:[ps([TC]),Fr,gi]})}}return i})(),Qf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({providers:[OC],imports:[$f,El,Pl,ri,Js,El,Pl]})}}return i})();function hn(i="emit"){return e=>e.pipe(xe(t=>console.log(`${i}`,t)))}var Yc={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 Zf=(()=>{class i{constructor(){this._roles=[],this.parseJWTRoles()}parseJWTRoles(){let t=localStorage.getItem("Token");if(t){var n=Cl(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 Yc[t])n[r]=this.isUserHasRole(Yc[t][r]);return n}get isSystemUser(){let t=localStorage.getItem("Token");return Cl(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 Jf=(i,e)=>e.PromotionID;function RC(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;P("value",t),y(3),I(t.Value),y(2),I(t.Code)}}function MC(i,e){if(i&1&&Zt(0,RC,6,3,"mat-option",19,as),i&2){let t=O();Jt(t)}}function AC(i,e){i&1&&(f(0,"mat-option",18),x(1,"No items found"),m()),i&2&&P("disabled",!0)}function BC(i,e){i&1&&le(0,MC,2,0)(1,AC,2,1,"mat-option",18),i&2&&Ce(e.length>0?0:1)}function NC(i,e){if(i&1){let t=Ie();f(0,"div",23)(1,"img",24),W("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(),P("src",t.ImgUrl,is)("alt",t.Value),y(2),P("result",t.Value)("term",n),y(),I(t.Value),y(2),I(t.Code)}}function zC(i,e){if(i&1&&(f(0,"ng-option",28),x(1),m()),i&2){let t=e.$implicit;P("value",t.PromotionID),y(),I(t.Name)}}function LC(i,e){if(i&1&&(f(0,"ng-select",27),Zt(1,zC,2,2,"ng-option",28,Jf),m()),i&2){let t=O(2);y(),Jt(t)}}function HC(i,e){if(i&1&&(f(0,"ng-option",28),x(1),m()),i&2){let t=e.$implicit;P("value",t),y(),I(t.Name)}}function jC(i,e){if(i&1&&(f(0,"ng-select",27),Zt(1,HC,2,2,"ng-option",28,Jf),m()),i&2){let t=O(2);y(),Jt(t)}}function VC(i,e){if(i&1&&(f(0,"div",12)(1,"label",9),x(2,"Promotion Price"),m(),le(3,LC,3,0,"ng-select",27)(4,jC,3,0,"ng-select",27),m()),i&2){let t=O(2);y(3),Ce(t.isEditProduct()?3:4)}}function UC(i,e){i&1&&le(0,VC,5,1,"div",12),i&2&&Ce(e.length?0:-1)}function WC(i,e){if(i&1){let t=Ie();f(0,"button",29),W("click",function(){se(t);let r=O();return ae(r.resetForm())}),x(1," Cancel "),m()}}var ia=(()=>{class i{constructor(){this.promotionPrice$=Le([]),this.variant$=Le({}),this.UUidSelected="",this.httpService=z(bi),this.fb=z(Yi),this.router=z(Un),this.storeService=z(ke),this.location=z(hs),this.maskitoOptions=ar({precision:2,thousandSeparator:","}),this.route=z(ms),this.variant={},this.roleService=z(Zf),this.domain="",this.isEditProduct=q(!1)}displayFn(t){return t?t.Value:""}initForm(){this.form=this.fb.group({name:new nt("",[lt.required]),quantity:new nt("",[lt.required]),promotionPrice:new nt("",[]),price:new nt("",[lt.required])})}ngAfterViewInit(){this.domain=`https://${localStorage.getItem("Domain")}`}ngOnInit(){this.initForm(),this.form.get("promotionPrice").valueChanges.pipe(Qt(()=>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.VariantID===this.route.snapshot.queryParamMap.get("id"));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=>Object.prototype.hasOwnProperty.call(s,"VariantID")?s.VariantID:s.ID===n);if(o!==-1){let s={EntityID:"00000000-0000-0000-0000-000000000000",ID:Object.prototype.hasOwnProperty.call(r[o],"VariantID")?r[o].VariantID:r[o].ID},a={VariantID:Object.prototype.hasOwnProperty.call(r[o],"VariantID")?r[o].VariantID:r[o].ID};return rl([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(Kt(([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=>Object.prototype.hasOwnProperty.call(l,"VariantID")?l.VariantID:l.ID);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(lp(200),al(),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 rl([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(Kt(([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()?es([this.promotionPrice$,this.variant$]).pipe(Kt(([l,c])=>({promotions:l,variant:c})),Kt(({promotions:l,variant:c})=>{let d=[...this.storeService.productItems()],u=d.findIndex(h=>Object.prototype.hasOwnProperty.call(h,"VariantID")?h.VariantID:h.ID===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,checked:!1})}else d[u]=D(v({},d[u]),{Quantity:+s,Promotions:r,UnitPrice:+a,checked:!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(Kt(l=>D(v({},l),{Quantity:+n,Promotions:r,UnitPrice:+a})),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:[_e],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(),ue(10,"input",10),f(11,"mat-autocomplete",11,0),W("optionSelected",function(a){return se(o),ae(r.onOptionSelected(a))}),le(13,BC,2,1),Ue(14,"async"),m(),le(15,NC,7,6,"ng-template",null,1,me),m(),f(17,"div",12)(18,"label",9),x(19,"Quantity"),m(),ue(20,"input",13),m(),f(21,"div",12)(22,"label",9),x(23,"Price"),m(),ue(24,"input",14),m(),le(25,UC,1,1),Ue(26,"async"),f(27,"div",15),le(28,WC,2,0,"button",16),f(29,"button",17),W("click",function(){return se(o),ae(r.onSubmit())}),x(30," Submit "),m()()()()()()}if(n&2){let o,s,a=ml(12);y(3),ii("",r.UUidSelected?"Update":"Add"," Product"),y(3),P("formGroup",r.form),y(4),P("matAutocomplete",a),y(),P("displayWith",r.displayFn),y(2),Ce((o=ni(14,10,r.variantSuggestion$))?13:-1,o),y(7),P("maskito",r.maskitoOptions),y(4),P("maskito",r.maskitoOptions),y(),Ce((s=ni(26,12,r.promotionPrice$))?25:-1,s),y(3),Ce(r.hasEdit?28:-1),y(),P("disabled",r.form.invalid)}},dependencies:[Cp,oi,_i,As,rt,ys,tt,it,gs,vs,bs,Op,vp,Ji,Os,Qf,Yf,Ms,Xc],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 em=(()=>{class i{constructor(){this.transactionType=q([{title:"Supplier Bill",type:0},{title:"Transfer Order",type:1}]),this.storeService=z(ke),this.fb=z(Yi),this.activeModal=z(Es)}get outlets(){return this.storeService.paperConfig().Outlets}initForm(){this.form=this.fb.group({type:new nt("",[lt.required]),outlet:new nt("",[lt.required]),number:new nt("",[lt.required])})}ngOnInit(){this.initForm()}onOK(){this.activeModal.close({role:"ok",data:this.form.value})}onClose(){this.activeModal.dismiss({role:"close",data:null})}onPaste(t){t.preventDefault();let n=t.clipboardData;if(n){let r=n.getData("text").trim(),o=t.target;o.value=r,this.form.patchValue({number:o.value})}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-dialog-load-transaction"]],standalone:!0,features:[_e],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",3,"paste"]],template:function(n,r){n&1&&(f(0,"app-base-modal",0),W("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(),ue(5,"ng-select",4),m(),f(6,"div",2)(7,"label",3),x(8,"Choose Outlet"),m(),ue(9,"ng-select",5),m(),f(10,"div",2)(11,"label",3),x(12,"Invoice Number"),m(),f(13,"input",6),W("paste",function(s){return r.onPaste(s)}),m()()()()),n&2&&(P("hasValid",r.form.valid),y(),P("formGroup",r.form),y(4),P("items",r.transactionType()),y(4),P("items",r.outlets))},dependencies:[Ds,oi,_i,ht,ys,tt,it,gs,rt,vs,bs],changeDetection:0})}}return i})();var $C=(()=>{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(mt))},i.\u0275prov=Ve({token:i,factory:i.\u0275fac}),i})(),qC=(()=>{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})(),GC=(()=>{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 XC(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 na={},tm=typeof document<"u"?document.createElement("div").style:void 0,Kc=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 ra(i){let e=XC(i);return na[e]||(Kc!==void 0&&tm[Kc.css+i]!==void 0?na[e]=Kc.css+i:tm[i]!==void 0&&(na[e]=i)),na[e]}var t3=typeof window<"u"?ra("transform"):void 0,i3=typeof window<"u"?ra("backfaceVisibility"):void 0,n3=typeof window<"u"?!!ra("transform"):void 0,r3=typeof window<"u"?!!ra("perspective"):void 0,im=typeof window<"u"?window.navigator.userAgent:"Chrome",o3=/Safari\//.test(im)&&!/Chrome\//.test(im);var nm=(()=>{class i{static forRoot(t){return{ngModule:i,providers:[{provide:"configuration",useValue:t}]}}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=Nt({type:i}),i.\u0275inj=Bt({providers:[$C,qC,GC],imports:[[ri]]}),i})();typeof document<"u"&&!document.elementsFromPoint&&(document.elementsFromPoint=YC);function YC(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 rm=(()=>{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 om=(()=>{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 St(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 St(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 St(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(Tr(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 sp(()=>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 St(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 St(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 St(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 St(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 St(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 St(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(xp),pe(Ts),pe(Un))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function oa(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var KC=0;function am(i){return"__private_"+KC+++"_"+i}function QC(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 sm(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=QC(r,new RegExp(`%\\{${o}\\}`,"g"),s)}return r}var ZC=i=>{throw new Error(`missing string: ${i}`)},Zr=am("onMissingKey"),Jr=am("apply"),lr=class{constructor(e,t){let{onMissingKey:n=ZC}=t===void 0?{}:t;Object.defineProperty(this,Jr,{value:JC}),Object.defineProperty(this,Zr,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(e)?e.forEach(oa(this,Jr)[Jr],this):oa(this,Jr)[Jr](e),oa(this,Zr)[Zr]=n}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let n=this.locale.strings[e];if(n==null&&(oa(this,Zr)[Zr](e),n=e),typeof n=="object"){if(t&&typeof t.smart_count<"u"){let o=this.locale.pluralize(t.smart_count);return sm(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 sm(n,t)}};function JC(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 rg=De(cm(),1);var eS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var nn=(i=21)=>{let e="",t=i|0;for(;t--;)e+=eS[Math.random()*64|0];return e};var og=De(Vm(),1);function aa(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var GS=0;function Um(i){return"__private_"+GS+++"_"+i}var XS={version:"4.2.0"},fn=Um("callbacks"),td=Um("publish"),la=class{constructor(){Object.defineProperty(this,td,{value:YS}),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,aa(this,td)[td](t,n,e)}subscribe(e){return aa(this,fn)[fn].add(e),()=>{aa(this,fn)[fn].delete(e)}}};function YS(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];aa(this,fn)[fn].forEach(n=>{n(...e)})}la.VERSION=XS.version;var Wm=la;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 id={__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 to(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 id?id[t]:"application/octet-stream"}function KS(i){return i.charCodeAt(0).toString(32)}function $m(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${KS(t)}`,"/"))+e}function qm(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${$m(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${$m(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function QS(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function ca(i,e){if(QS(i))return i.id;let t=to(i);return qm(D(v({},i),{type:t}),e)}function nd(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 rd(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function od(i){return i<10?`0${i}`:i.toString()}function cr(){let i=new Date,e=od(i.getHours()),t=od(i.getMinutes()),n=od(i.getSeconds());return`${e}:${t}:${n}`}var Gm={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] [${cr()}]`,...e)}},Xm={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${cr()}]`,...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] [${cr()}]`,...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] [${cr()}]`,...e)}};var no=De(io(),1),tg=De(eg(),1),ig={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},Tt=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)}},da=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 Tt(`${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 Tt(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,no.default)(n),size:(0,no.default)(o)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:n,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(a=>a.includes("/")?e.type?(0,tg.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=r.join(", ");throw new Tt(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t){var o;throw new Tt(this.getI18n()("exceedsSize",{size:(0,no.default)(t),file:(o=e.name)!=null?o:this.getI18n()("unnamed")}),{file:e})}if(n&&e.size!=null&&e.size<n)throw new Tt(this.getI18n()("inferiorSize",{size:(0,no.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 Tt(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let n=new Tt(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 ng={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 eP=0;function Me(i){return"__private_"+eP+++"_"+i}var tP={version:"4.4.1"},ua={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},ct=Me("plugins"),dt=Me("restricter"),ro=Me("storeUnsubscribe"),Fi=Me("emitter"),mn=Me("preProcessors"),gn=Me("uploaders"),Ai=Me("postProcessors"),Vt=Me("informAndEmit"),uo=Me("checkRequiredMetaFieldsOnFile"),sd=Me("checkRequiredMetaFields"),oo=Me("assertNewUploadAllowed"),cd=Me("transformFile"),so=Me("startIfAutoProceed"),ao=Me("checkAndUpdateFileState"),dd=Me("handleUploadProgress"),lo=Me("updateTotalProgress"),Bi=Me("updateTotalProgressThrottled"),ud=Me("calculateTotalProgress"),ad=Me("addListeners"),ui=Me("updateOnlineStatus"),co=Me("requestClientById"),Ri=Me("createUpload"),ld=Me("getUpload"),yn=Me("removeUpload"),Mi=Me("runUpload"),pa=class i{constructor(e){Object.defineProperty(this,Mi,{value:mP}),Object.defineProperty(this,yn,{value:fP}),Object.defineProperty(this,ld,{value:hP}),Object.defineProperty(this,Ri,{value:pP}),Object.defineProperty(this,ad,{value:uP}),Object.defineProperty(this,ud,{value:dP}),Object.defineProperty(this,lo,{value:cP}),Object.defineProperty(this,ao,{value:lP}),Object.defineProperty(this,so,{value:aP}),Object.defineProperty(this,cd,{value:sP}),Object.defineProperty(this,oo,{value:oP}),Object.defineProperty(this,sd,{value:rP}),Object.defineProperty(this,uo,{value:nP}),Object.defineProperty(this,Vt,{value:iP}),Object.defineProperty(this,ct,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,Fi,{writable:!0,value:(0,rg.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,dd,{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,og.default)(()=>H(this,lo)[lo](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,ui,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,co,{writable:!0,value:new Map}),this.defaultLocale=ng;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:ig,meta:{},onBeforeFileAdded:(r,o)=>!Object.hasOwn(o,r.id),onBeforeUpload:r=>r,store:new Wm,logger:Gm,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=Xm),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState(D(v({},ua),{plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:nd(),individualCancellation:!0,resumableUploads:!1},meta:v({},this.opts.meta),info:[]})),H(this,dt)[dt]=new da(()=>this.opts,()=>this.i18n),H(this,ro)[ro]=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,ad)[ad]()}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 lr([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},ua))}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({},ua),{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:E}=_;!E.uploadComplete&&E.uploadStarted&&(o.push(_),_.isPaused||g.push(_)),E.uploadStarted||s.push(_),(E.uploadStarted||E.preprocess||E.postprocess)&&a.push(_),E.uploadStarted&&l.push(_),_.isPaused&&c.push(_),E.uploadComplete&&d.push(_),_.error&&u.push(_),(E.preprocess||E.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,dt)[dt].validate(t,[e])}catch(n){return n}return null}validateSingleFile(e){try{H(this,dt)[dt].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{H(this,dt)[dt].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,oo)[oo](e);let{nextFilesState:t,validFilesToAdd:n,errors:r}=H(this,ao)[ao]([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,so)[so](),s.id}addFiles(e){H(this,oo)[oo]();let{nextFilesState:t,validFilesToAdd:n,errors:r}=H(this,ao)[ao](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:
17
+ `;if(s.forEach(l=>{a+=`
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
+ id: ${a.id}
20
+ type: ${a.type}`)}),n.length>0&&H(this,so)[so]()}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(ua)}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,lo)[lo]()}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,ct)[ct]?H(this,ct)[ct][o.type].push(o):H(this,ct)[ct][o.type]=[o],o.install(),this.emit("plugin-added",o),this}getPlugin(e){for(let t of Object.values(H(this,ct)[ct])){let n=t.find(r=>r.id===e);if(n!=null)return n}}[Symbol.for("uppy test: getPlugins")](e){return H(this,ct)[ct][e]}iteratePlugins(e){Object.values(H(this,ct)[ct]).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,ct)[ct][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,ro)[ro](),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,co)[co].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,co)[co].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,ld)[ld](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,ct)[ct].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,dt)[dt].validateMinNumberOfFiles(t)).catch(r=>{throw H(this,Vt)[Vt]([r]),r}).then(()=>{if(!H(this,sd)[sd](t))throw new Tt(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 iP(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 nP(i){let{missingFields:e,error:t}=H(this,dt)[dt].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 rP(i){let e=!0;for(let t of Object.values(i))H(this,uo)[uo](t)||(e=!1);return e}function oP(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new Tt(this.i18n("noMoreFilesAllowed"),{file:i});throw H(this,Vt)[Vt]([t]),t}}function sP(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=to(e),n=rd(t,e),r=xi(n).extension,o=ca(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 aP(){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 lP(i){let{files:e}=this.getState(),t=v({},e),n=[],r=[];for(let a of i)try{var o;let l=H(this,cd)[cd](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 Tt(this.i18n("noDuplicates",{fileName:(s=l.name)!=null?s:this.i18n("unnamed")}),{file:a})}if(d===!1&&!c)throw new Tt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof d=="object"&&d!==null&&(l=d),H(this,dt)[dt].validateSingleFile(l),t[l.id]=l,n.push(l)}catch(l){r.push(l)}try{H(this,dt)[dt].validateAggregateRestrictions(Object.values(e),n)}catch(a){return r.push(a),{nextFilesState:e,validFilesToAdd:[],errors:r}}return{nextFilesState:t,validFilesToAdd:n,errors:r}}function cP(){var i,e;let t=H(this,ud)[ud](),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 dP(){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 uP(){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,dd)[dd]),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,uo)[uo](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 pP(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 hP(i){let{currentUploads:e}=this.getState();return e[i]}function fP(i){let e=v({},this.getState().currentUploads);delete e[i],this.setState({currentUploads:e})}function mP(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})}pa.VERSION=tP.version;var dr=pa;var fo,Fe,dg,gP,vn,sg,ug,pd,pg,md,hd,fd,yP,ho={},hg=[],vP=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ma=Array.isArray;function Ni(i,e){for(var t in e)i[t]=e[t];return i}function gd(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?fo.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 po(i,s,n,r,null)}function po(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??++dg,__i:-1,__u:0};return r==null&&Fe.vnode!=null&&Fe.vnode(o),o}function fg(){return{current:null}}function Ut(i){return i.children}function It(i,e){this.props=i,this.context=e}function ur(i,e){if(e==null)return i.__?ur(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"?ur(i):null}function mg(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 mg(i)}}function ag(i){(!i.__d&&(i.__d=!0)&&vn.push(i)&&!fa.__r++||sg!==Fe.debounceRendering)&&((sg=Fe.debounceRendering)||ug)(fa)}function fa(){var i,e,t,n,r,o,s,a;for(vn.sort(pd);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),yd(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,s,o??ur(r),!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,vg(s,n,a),n.__e!=o&&mg(n)),vn.length>e&&vn.sort(pd));fa.__r=0}function gg(i,e,t,n,r,o,s,a,l,c,d){var u,g,h,_,E,N,M=n&&n.__k||hg,U=e.length;for(l=bP(t,e,M,l,U),u=0;u<U;u++)(h=t.__k[u])!=null&&(g=h.__i===-1?ho:M[h.__i]||ho,h.__i=u,N=yd(i,h,g,r,o,s,a,l,c,d),_=h.__e,h.ref&&g.ref!=h.ref&&(g.ref&&vd(g.ref,null,h),d.push(h.ref,h.__c||_,h)),E==null&&_!=null&&(E=_),4&h.__u||g.__k===h.__k?l=yg(h,l,i):typeof h.type=="function"&&N!==void 0?l=N:_&&(l=_.nextSibling),h.__u&=-7);return t.__e=E,l}function bP(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?po(null,s,null,null,null):ma(s)?po(Ut,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?po(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=_P(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=ur(a)),bg(a,a));return n}function yg(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=yg(n[r],e,t));return e}i.__e!=e&&(e&&i.type&&!t.contains(e)&&(e=ur(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"||(ma(i)?i.some(function(t){Ci(t,e)}):e.push(i)),e}function _P(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 lg(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||vP.test(e)?t:t+"px"}function ha(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||lg(i.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||lg(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(pg,"$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=md,i.addEventListener(e,o?fd:hd,o)):i.removeEventListener(e,o?fd:hd,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 cg(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=md++;else if(e.t<t.u)return;return t(Fe.event?Fe.event(e):e)}}}function yd(i,e,t,n,r,o,s,a,l,c){var d,u,g,h,_,E,N,M,U,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,U="prototype"in K&&K.prototype.render,de=(d=K.contextType)&&n[d.__c],oe=d?de?de.props.value:d.__:n,t.__c?N=(u=e.__c=t.__c).__=u.__E:(U?e.__c=u=new K(M,oe):(e.__c=u=new It(M,oe),u.constructor=K,u.render=xP),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=[]),U&&u.__s==null&&(u.__s=u.state),U&&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)U&&K.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),U&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(U&&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(ye){ye&&(ye.__=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),U&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,_,E)})}if(u.context=oe,u.props=M,u.__P=i,u.__e=!1,b=Fe.__r,w=0,U){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())),U&&!g&&u.getSnapshotBeforeUpdate!=null&&(E=u.getSnapshotBeforeUpdate(h,_)),a=gg(i,ma(A=d!=null&&d.type===Ut&&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),N&&(u.__E=u.__=null)}catch(ye){if(e.__v=null,l||o!=null)if(ye.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--;)gd(o[L]);else e.__e=t.__e,e.__k=t.__k;Fe.__e(ye,e,t)}else o==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):a=e.__e=wP(t.__e,e,t,n,r,o,s,l,c);return(d=Fe.diffed)&&d(e),128&e.__u?void 0:a}function vg(i,e,t){for(var n=0;n<t.length;n++)vd(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 wP(i,e,t,n,r,o,s,a,l){var c,d,u,g,h,_,E,N=t.props,M=e.props,U=e.type;if(U=="svg"?r="http://www.w3.org/2000/svg":U=="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==!!U&&(U?h.localName==U:h.nodeType==3)){i=h,o[c]=null;break}}if(i==null){if(U==null)return document.createTextNode(M);i=document.createElementNS(r,U,M.is&&M),a&&(Fe.__m&&Fe.__m(e,o),a=!1),o=null}if(U===null)N===M||a&&i.data===M||(i.data=M);else{if(o=o&&fo.call(i.childNodes),N=t.props||ho,!a&&o!=null)for(N={},c=0;c<i.attributes.length;c++)N[(h=i.attributes[c]).name]=h.value;for(c in N)if(h=N[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;ha(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"?E=h:a&&typeof h!="function"||N[c]===h||ha(i,c,h,N[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=""),gg(i,ma(g)?g:[g],e,t,n,U=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:t.__k&&ur(t,0),a,l),o!=null)for(c=o.length;c--;)gd(o[c]);a||(c="value",U=="progress"&&_==null?i.removeAttribute("value"):_!==void 0&&(_!==i[c]||U=="progress"&&!_||U=="option"&&_!==N[c])&&ha(i,c,_,N[c],r),c="checked",E!==void 0&&E!==i[c]&&ha(i,c,E,N[c],r))}return i}function vd(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 bg(i,e,t){var n,r;if(Fe.unmount&&Fe.unmount(i),(n=i.ref)&&(n.current&&n.current!==i.__e||vd(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]&&bg(n[r],e,t||typeof i.type!="function");t||gd(i.__e),i.__c=i.__=i.__e=void 0}function xP(i,e,t){return this.constructor(i,t)}function bd(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=[],yd(e,i=(!n&&t||e).__k=p(Ut,null,[i]),r||ho,ho,e.namespaceURI,!n&&t?[t]:r?null:e.firstChild?fo.call(e.childNodes):null,o,!n&&t?t:r?r.__e:e.firstChild,n,s),vg(o,i,s)}function ga(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?fo.call(arguments,2):t),po(i.type,a,n||i.key,r||i.ref,null)}fo=hg.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}},dg=0,gP=function(i){return i!=null&&i.constructor==null},It.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),ag(this))},It.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),ag(this))},It.prototype.render=Ut,vn=[],ug=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pd=function(i,e){return i.__v.__b-e.__v.__b},fa.__r=0,pg=/(PointerCapture)$|Capture$/i,md=0,hd=cg(!1),fd=cg(!0),yP=0;function mo(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function CP(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):mo(i)?i:null}var _g=CP;function SP(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}var ya=SP;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 lr([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 wg(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var PP=0;function EP(i){return"__private_"+PP+++"_"+i}function DP(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 go=EP("updateUI"),_d=class i extends bn{constructor(){super(...arguments),Object.defineProperty(this,go,{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=_g(e);if(r){this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),wg(this,go)[go]=DP(l=>{this.uppy.getPlugin(this.id)&&(bd(this.render(l,a),a),this.afterUpdate())}),this.uppy.log(`Installing ${n} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),bd(this.render(this.uppy.getState(),a),a),this.el=a,r.appendChild(a),a.dir=this.opts.direction||ya(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=wg(this,go))[go])==null||t.call(n,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},Wt=_d;function va(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 Dd=De(yt(),1);function yo(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 Sd=De(yt(),1),Cd=De(io(),1);function wd(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 xd(i){let e=wd(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 kP="\xB7",xg=()=>` ${kP} `;function Cg(i){let{newFiles:e,isUploadStarted:t,recoveredState:n,i18n:r,uploadState:o,isSomeGhost:s,startUpload:a}=i,l=(0,Sd.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 p("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:e}),onClick:a,disabled:s,"data-uppy-super-focusable":!0},c)}function Sg(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 Pg(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 Eg(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 Dg(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 kg(){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 Tg(i){let{progress:e}=i,{value:t,mode:n,message:r}=e;return p("div",{className:"uppy-StatusBar-content"},p(kg,null),n==="determinate"?`${Math.round(t*100)}% \xB7 `:"",r)}function TP(i){let{numUploads:e,complete:t,totalUploadedSize:n,totalSize:r,totalETA:o,i18n:s}=i,a=e>1,l=(0,Cd.default)(n);return p("div",{className:"uppy-StatusBar-statusSecondary"},a&&s("filesUploadedOfTotal",{complete:t,smart_count:e}),p("span",{className:"uppy-StatusBar-additionalInfo"},a&&xg(),r!=null?s("dataUploadedOfTotal",{complete:l,total:(0,Cd.default)(r)}):s("dataUploadedOfUnknown",{complete:l}),xg(),o!=null&&s("xTimeLeft",{time:xd(o)})))}function Ig(i){let{i18n:e,complete:t,numUploads:n}=i;return p("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:n}))}function IP(i){let{i18n:e,newFiles:t,startUpload:n}=i,r=(0,Sd.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 Og(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,E=l&&o;if(!o||s)return null;let N=e(a?"paused":"uploading");function M(){return!a&&!E&&r?t?p(TP,{numUploads:c,complete:d,totalUploadedSize:u,totalSize:g,totalETA:h,i18n:e}):p(Ig,{i18n:e,complete:d,numUploads:c}):null}return p("div",{className:"uppy-StatusBar-content","aria-label":N,title:N},a?null:p(kg,null),p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},t&&n!==0?`${N}: ${n}%`:N),M(),E?p(IP,{i18n:e,newFiles:l,startUpload:_}):null))}function Fg(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 Rg(i){let{error:e,i18n:t,complete:n,numUploads:r}=i;function o(){let s=`${t("uploadFailed")}
22
+
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(Ig,{i18n:t,complete:n,numUploads:r})))}var{STATE_ERROR:Mg,STATE_WAITING:OP,STATE_PREPROCESSING:Pd,STATE_UPLOADING:_a,STATE_POSTPROCESSING:Ed,STATE_COMPLETE:wa}=$t;function kd(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:E,hideAfterFinish:N=!1,isSomeGhost:M,doneButtonHandler:U=void 0,isUploadStarted:de,i18n:oe,startUpload:ee,uppy:b,isAllComplete:w,showProgressDetails:S=void 0,numUploads:A,complete:L,totalSize:K,totalETA:ye,totalUploadedSize:Ne}=i;function Pe(){switch(g){case Ed:case Pd:{let G=yo(_);return G.mode==="determinate"?G.value*100:h}case Mg:return null;case _a:return E?h:null;default:return h}}function Se(){switch(g){case Ed:case Pd:{let{mode:G}=yo(_);return G==="indeterminate"}case _a:return!E;default:return!1}}let Q=Pe(),ze=Q??100,te=!s&&e&&(!n&&!r||u)&&t&&!a,Rt=!c&&g!==OP&&g!==wa,he=o&&!l&&g===_a,X=s&&!w&&!d,F=U&&g===wa,C=(0,Dd.default)("uppy-StatusBar-progress",{"is-indeterminate":Se()}),k=(0,Dd.default)("uppy-StatusBar",`is-${g}`,{"has-ghosts":M}),T=(()=>{switch(g){case Pd:case Ed:return p(Tg,{progress:yo(_)});case wa:return p(Fg,{i18n:oe});case Mg:return p(Rg,{error:s,i18n:oe,numUploads:A,complete:L});case _a:return p(Og,{i18n:oe,supportsUploadProgress:E,totalProgress:h,showProgressDetails:S,isUploadStarted:de,isAllComplete:w,isAllPaused:r,newFiles:e,numUploads:A,complete:L,totalUploadedSize:Ne,totalSize:K,totalETA:ye,startUpload:ee});default:return null}})();return p("div",{className:k,"aria-hidden":!(te||X||he||Rt||F)&&!T||g===wa&&N},p("div",{className:C,style:{width:`${ze}%`},role:"progressbar","aria-label":`${ze}%`,"aria-valuetext":`${ze}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Q}),T,p("div",{className:"uppy-StatusBar-actions"},te?p(Cg,{newFiles:e,isUploadStarted:de,recoveredState:u,i18n:oe,isSomeGhost:M,startUpload:ee,uploadState:g}):null,X?p(Sg,{i18n:oe,uppy:b}):null,he?p(Eg,{isAllPaused:r,i18n:oe,isAllComplete:w,resumableUploads:o,uppy:b}):null,Rt?p(Pg,{i18n:oe,uppy:b}):null,F?p(Dg,{i18n:oe,doneButtonHandler:U}):null))}var Ag={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 FP=0;function pr(i){return"__private_"+FP+++"_"+i}var RP={version:"4.1.1"},MP=2e3,AP=2e3;function BP(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 NP={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},li=pr("lastUpdateTime"),pi=pr("previousUploadedBytes"),zi=pr("previousSpeed"),qt=pr("previousETA"),Td=pr("computeSmoothETA"),vo=pr("onUploadStart"),_n=class extends Wt{constructor(e,t){super(e,v(v({},NP),t)),Object.defineProperty(this,Td,{value:zP}),Object.defineProperty(this,li,{writable:!0,value:void 0}),Object.defineProperty(this,pi,{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,vo,{writable:!0,value:()=>{let{recoveredState:n}=this.uppy.getState();if(Be(this,zi)[zi]=null,Be(this,qt)[qt]=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=Ag,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:E}=this.uppy.getObjectOfFilesPerState(),N=a?Object.values(n):l,M=!!t.resumableUploads,U=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,Td)[Td]({uploaded:oe,total:de});return kd({error:s,uploadState:BP(s,g,a,e.files||{}),allowNewUpload:r,totalProgress:o,totalSize:de,totalUploadedSize:oe,isAllComplete:!1,isAllPaused:h,isUploadStarted:u,isUploadInProgress:_,isSomeGhost:E,recoveredState:a,complete:d.length,newFiles:N.length,numUploads:c.length,totalETA:ee,files:n,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:M,supportsUploadProgress:U,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;ya(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Be(this,vo)[vo]),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,vo)[vo])}};function zP(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,qt)[qt])!=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,qt)[qt])!=null?a:0)/100)/10}let l=s/r,c=Be(this,zi)[zi]==null?l:va(l,Be(this,zi)[zi],MP,r);Be(this,zi)[zi]=c;let d=n/c,u=Math.max(Be(this,qt)[qt]-r,0),g=Be(this,qt)[qt]==null?d:va(d,u,AP,r);return Be(this,qt)[qt]=g,Be(this,li)[li]=performance.now(),Math.round(g/100)/10}_n.VERSION=RP.version;var Bg=300,xa=class extends It{constructor(){super(...arguments),this.ref=fg()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Bg)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Bg)}render(){let{children:e}=this.props;return p("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function LP(i,e){return Object.assign(i,e)}function HP(i,e){var t;return(t=i?.key)!=null?t:e}function jP(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=n=>{i.refs[e]=n})}function bo(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let n=HP(i[t],t.toString(36));e[n]=i[t]}return e}function VP(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 UP=i=>i,WP=(()=>{class i extends It{constructor(t,n){super(t,n),this.refs={},this.state={children:bo(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=bo(Ci(t.children)||[]),r=this.state.children;this.setState(s=>({children:VP(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=bo(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=bo(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=bo(Ci(this.props.children)||[]);if(o&&o.hasOwnProperty(t))this.performEnter(t);else{let s=LP({},this.state.children);delete s[t],this.setState({children:s})}}render(t,n){let N=t,{childFactory:r,transitionLeave:o,transitionName:s,transitionAppear:a,transitionEnter:l,transitionLeaveTimeout:c,transitionEnterTimeout:d,transitionAppearTimeout:u,component:g}=N,h=Ln(N,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:_}=n,E=Object.entries(_).map(M=>{let[U,de]=M;if(!de)return;let oe=jP(this,U);return ga(r(de),{ref:oe,key:U})}).filter(Boolean);return p(g,h,E)}}return i.defaultProps={component:"span",childFactory:UP},i})(),Ng=WP;var $P={version:"4.2.1"},wn=class extends Wt{constructor(e,t){super(e,t),this.render=n=>p("div",{className:"uppy uppy-Informer"},p(Ng,null,n.info.map(r=>p(xa,{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
+
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=$P.version;var qP=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function GP(i,e,t){var n,r;let o=qP.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 zg=GP;function Ca(i){return i.startsWith("blob:")}function Sa(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 Gg=typeof self<"u"?self:global,Co=typeof navigator<"u",XP=Co&&typeof HTMLImageElement>"u",Lg=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Xg=Gg.Buffer,Yg=!!Xg,YP=i=>i!==void 0;function Kg(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(YP).length===0)}function ot(i){let e=new Error(i);throw delete e.stack,e}function Hg(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 Id=i=>String.fromCharCode.apply(null,i),jg=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),jg?jg.decode(r):Yg?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(Id(r)));var r}getLatin1String(e=0,t=this.byteLength){let n=this.getUint8Array(e,t);return Id(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 Id(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 Fd(i,e){ot(`${i} '${e}' was not loaded, try using full build of exifr.`)}var So=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||Fd(this.kind,e),t&&(e in t||function(n,r){ot(`Unknown ${n} '${r}'.`)}(this.kind,e),t[e].enabled||Fd(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},Ta=new So("file parser"),Gt=new So("segment parser"),Do=new So("file reader"),KP=Gg.fetch;function Vg(i,e){return(t=i).startsWith("data:")||t.length>1e4?Md(i,e,"base64"):Lg&&i.includes("://")?Rd(i,e,"url",Pa):Lg?Md(i,e,"fs"):Co?Rd(i,e,"url",Pa):void ot("Invalid input argument");var t}function Rd(i,e,t,n){return B(this,null,function*(){return Do.has(t)?Md(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 Md(i,e,t){return B(this,null,function*(){let n=new(Do.get(t))(i,e);return yield n.read(),n})}var Pa=i=>KP(i).then(e=>e.arrayBuffer()),Po=i=>new Promise((e,t)=>{let n=new FileReader;n.onloadend=()=>e(n.result||new ArrayBuffer),n.onerror=t,n.readAsArrayBuffer(i)}),Ad=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 Qg(i,e,t){let n=new Ad;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 Zg(i,e,t){let n,r=i.get(e);for(n of t)r.set(n[0],n[1])}var ko=new Map,Hd=new Map,jd=new Map,hr=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Ia=["jfif","xmp","icc","iptc","ihdr"],Eo=["tiff",...Ia],Ke=["ifd0","ifd1","exif","gps","interop"],fr=[...Eo,...Ke],mr=["makerNote","userComment"],Oa=["translateKeys","translateValues","reviveValues","multiSegment"],gr=[...Oa,"sanitize","mergeOutput","silentErrors"],Ea=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},xn=class extends Ea{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=Ke.includes(e),this.canBeFiltered&&(this.dict=ko.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 Oa)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,Da(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Da(this.pick,this.deps)}},vt={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},Ug=new Map,Sn=class extends Ea{static useCached(e){let t=Ug.get(e);return t!==void 0||(t=new this(e),Ug.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=Co?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of hr)this[e]=vt[e];for(e of gr)this[e]=vt[e];for(e of mr)this[e]=vt[e];for(e of fr)this[e]=new xn(e,vt[e],void 0,this)}setupFromTrue(){let e;for(e of hr)this[e]=vt[e];for(e of gr)this[e]=vt[e];for(e of mr)this[e]=!0;for(e of fr)this[e]=new xn(e,!0,void 0,this)}setupFromArray(e){let t;for(t of hr)this[t]=vt[t];for(t of gr)this[t]=vt[t];for(t of mr)this[t]=vt[t];for(t of fr)this[t]=new xn(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ke)}setupFromObject(e){let t;for(t of(Ke.ifd0=Ke.ifd0||Ke.image,Ke.ifd1=Ke.ifd1||Ke.thumbnail,Object.assign(this,e),hr))this[t]=Od(e[t],vt[t]);for(t of gr)this[t]=Od(e[t],vt[t]);for(t of mr)this[t]=Od(e[t],vt[t]);for(t of Eo)this[t]=new xn(t,vt[t],e[t],this);for(t of Ke)this[t]=new xn(t,vt[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ke,fr),e.tiff===!0?this.batchEnableWithBool(Ke,!0):e.tiff===!1?this.batchEnableWithUserValue(Ke,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ke):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ke)}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=Wg(e,n);for(let[s,a]of o)Da(this[s].pick,a),this[s].enabled=!0}else if(t&&t.length){let o=Wg(t,n);for(let[s,a]of o)Da(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=Ke.some(o=>this[o].enabled===!0)||this.makerNote||this.userComment;for(let o of Ke)this[o].finalizeFilters()}get onlyTiff(){return!Ia.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Eo)this[e].enabled&&!Gt.has(e)&&Fd("segment parser",e)}};function Wg(i,e){let t,n,r,o,s=[];for(r of e){for(o of(t=ko.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 Od(i,e){return i!==void 0?i:e!==void 0?e:void 0}function Da(i,e){for(let t of e)i.add(t)}Ee(Sn,"default",vt);var yr=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"?Vg(t,n):Co&&!XP&&t instanceof HTMLImageElement?Vg(t.src,n):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Cn(t):Co&&t instanceof Blob?Rd(t,n,"blob",Po):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 Ta)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),Kg(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 Jg(i,e){return B(this,null,function*(){let t=new yr(e);return yield t.read(i),t.parse()})}var QP=Object.freeze({__proto__:null,parse:Jg,Exifr:yr,fileParsers:Ta,segmentParsers:Gt,fileReaders:Do,tagKeys:ko,tagValues:Hd,tagRevivers:jd,createDictionary:Qg,extendDictionary:Zg,fetchUrlAsArrayBuffer:Pa,readBlobAsArrayBuffer:Po,chunkedProps:hr,otherSegments:Ia,segments:Eo,tiffBlocks:Ke,segmentsAndBlocks:fr,tiffExtractables:mr,inheritables:Oa,allFormatters:gr,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=jd.get(t),r=Hd.get(t),o=ko.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 ZP(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function JP(i){return i>=224&&i<=239}function e2(i,e,t){for(let[n,r]of Gt)if(r.canHandle(i,e,t))return n}var ka=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:u,remaining:g,options:h}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(n=c.getUint8(e+1),JP(n)){if(r=c.getUint16(e+2),o=e2(c,e,r),o&&u.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(ZP(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(ka,"type","jpeg"),Ta.set("jpeg",ka);var t2=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Bd=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=t2[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}`)}}},xo=class extends Bd{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,Hg(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,Hg(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",$g(...e.get(2),e.get(1))),e.set("longitude",$g(...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 Ke)if(e=this[t],!Kg(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 $g(i,e,t,n){var r=i+e/60+t/3600;return n!=="S"&&n!=="W"||(r*=-1),r}Ee(xo,"type","tiff"),Ee(xo,"headerLength",10),Gt.set("tiff",xo);var _R=Object.freeze({__proto__:null,default:QP,Exifr:yr,fileParsers:Ta,segmentParsers:Gt,fileReaders:Do,tagKeys:ko,tagValues:Hd,tagRevivers:jd,createDictionary:Qg,extendDictionary:Zg,fetchUrlAsArrayBuffer:Pa,readBlobAsArrayBuffer:Po,chunkedProps:hr,otherSegments:Ia,segments:Eo,tiffBlocks:Ke,segmentsAndBlocks:fr,tiffExtractables:mr,inheritables:Oa,allFormatters:gr,Options:Sn,parse:Jg}),Vd={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},wR=Object.assign({},Vd,{firstChunkSize:4e4,gps:[1,2,3,4]});var xR=Object.assign({},Vd,{tiff:!1,ifd1:!0,mergeOutput:!1});var i2=Object.assign({},Vd,{firstChunkSize:4e4,ifd0:[274]});function n2(i){return B(this,null,function*(){let e=new yr(i2);yield e.read(i);let t=yield e.parse();if(t&&t.ifd0)return t.ifd0[274]})}var r2=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}}),_o=!0,wo=!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;_o=Number(t)+.1*Number(n)<13.4,wo=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);_o=wo=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);_o=wo=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);_o=wo=Number(e)<77}}function e0(i){return B(this,null,function*(){let e=yield n2(i);return Object.assign({canvas:_o,css:wo},r2[e])})}var Nd=class extends Cn{constructor(...e){super(...e),Ee(this,"ranges",new zd),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=Yg?Xg.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)}},zd=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=>qg(e,s.offset,r)||qg(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 qg(i,e,t){return i<=e&&e<=t}var Ld=class extends Nd{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(){}};Do.set("blob",class extends Ld{readWhole(){return B(this,null,function*(){this.chunked=!1;let i=yield Po(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 Po(n);return this.set(r,i,!0)})}});var t0={strings:{generatingThumbnails:"Generating thumbnails..."}};var o2={version:"4.1.1"};function s2(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(()=>zg(i.toDataURL(e,t),{})).then(n=>{if(n===null)throw new Error("could not extract blob, probably an old browser");return n})}function a2(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 l2(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 c2={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},vr=class extends Wt{constructor(e,t){if(super(e,v(v({},c2),t)),this.onFileAdded=n=>{!n.preview&&n.data&&Sa(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&&Ca(n.preview)&&URL.revokeObjectURL(n.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(r=>r.isRestored).forEach(r=>{(!r.preview||Ca(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=t0,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=e0(e.data).catch(()=>1);return Promise.all([o,s]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,t,n,c.deg),u=a2(l,c),g=this.resizeImage(u,d.width,d.height);return s2(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=l2(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 Sa(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)}};vr.VERSION=o2.version;function d2(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&mo(i)?[i]:null}var Ud=d2;var Si=Array.from;function Fa(i,e,t,n){let{onSuccess:r}=n;i.readEntries(o=>{let s=[...e,...o];o.length?queueMicrotask(()=>{Fa(i,s,t,{onSuccess:r})}):r(s)},o=>{t(o),r(e)})}function i0(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 Qo(this,null,function*(){let n=i.createReader(),r=yield new Hn(new Promise(o=>{Fa(n,[],e,{onSuccess:s=>o(s.map(a=>i0(a,e)))})}));yield*Zo(r)})},isSameEntry:void 0}}function n0(i,e,t){try{return t===void 0&&(t=void 0),function(){return Qo(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=Jo(i.values()),o,s,a;o=!(s=yield new Hn(r.next())).done;o=!1){let l=s.value;yield*Zo(n0(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 Wd(i,e){return Qo(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=i0(s(),e)),{fileSystemHandle:o,lastResortFile:n.getAsFile()}}))));for(let{lastResortFile:n,fileSystemHandle:r}of t)if(r!=null)try{yield*Zo(n0(r,"",n))}catch(o){n!=null?yield n:e(o)}else n!=null&&(yield n)})}function $d(i){let e=Si(i.files);return Promise.resolve(e)}function To(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=Jo(Wd(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 $d(i)}})}var R0=De(yt(),1);function Io(i){return D(v({},i),{type:i.mimeType,extension:i.name?xi(i.name).extension:null})}var Oo,qe,qd,r0,Fo=0,p0=[],Qe=Fe,o0=Qe.__b,s0=Qe.__r,a0=Qe.diffed,l0=Qe.__c,c0=Qe.unmount,d0=Qe.__;function Xd(i,e){Qe.__h&&Qe.__h(qe,i,Fo||e),Fo=0;var t=qe.__H||(qe.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function hi(i){return Fo=1,u2(f0,i)}function u2(i,e,t){var n=Xd(Oo++,2);if(n.t=i,!n.__c&&(n.__=[t?t(e):f0(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=Xd(Oo++,3);!Qe.__s&&h0(t.__H,e)&&(t.__=i,t.i=e,qe.__H.__h.push(t))}function Pn(i){return Fo=5,En(function(){return{current:i}},[])}function En(i,e){var t=Xd(Oo++,7);return h0(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Dn(i,e){return Fo=8,En(function(){return i},e)}function p2(){for(var i;i=p0.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Ra),i.__H.__h.forEach(Gd),i.__H.__h=[]}catch(e){i.__H.__h=[],Qe.__e(e,i.__v)}}Qe.__b=function(i){qe=null,o0&&o0(i)},Qe.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),d0&&d0(i,e)},Qe.__r=function(i){s0&&s0(i),Oo=0;var e=(qe=i.__c).__H;e&&(qd===qe?(e.__h=[],qe.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0})):(e.__h.forEach(Ra),e.__h.forEach(Gd),e.__h=[],Oo=0)),qd=qe},Qe.diffed=function(i){a0&&a0(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(p0.push(e)!==1&&r0===Qe.requestAnimationFrame||((r0=Qe.requestAnimationFrame)||h2)(p2)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.i=void 0})),qd=qe=null},Qe.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Ra),t.__h=t.__h.filter(function(n){return!n.__||Gd(n)})}catch(n){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Qe.__e(n,t.__v)}}),l0&&l0(i,e)},Qe.unmount=function(i){c0&&c0(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{Ra(n)}catch(r){e=r}}),t.__H=void 0,e&&Qe.__e(e,t.__v))};var u0=typeof requestAnimationFrame=="function";function h2(i){var e,t=function(){clearTimeout(n),u0&&cancelAnimationFrame(e),setTimeout(i)},n=setTimeout(t,100);u0&&(e=requestAnimationFrame(t))}function Ra(i){var e=qe,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),qe=e}function Gd(i){var e=qe;i.__c=i.__(),qe=e}function h0(i,e){return!i||i.length!==e.length||e.some(function(t,n){return t!==i[n]})}function f0(i,e){return typeof e=="function"?e(i):e}function f2(){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 m2(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(f2,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 g2=i=>{let{pluginName:e,i18n:t,onAuth:n}=i;return p(m2,{pluginName:e,i18n:t,onAuth:n})};function Ma(i){let{loading:e,pluginName:t,pluginIcon:n,i18n:r,handleAuth:o,renderForm:s=g2}=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 m0=De(yt(),1);function Yd(i){let{i18n:e,logout:t,username:n}=i;return p(Ut,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 Kd(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(Ut,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 Qd(i){return p("div",{className:"uppy-ProviderBrowser-header"},p("div",{className:(0,m0.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&p(Kd,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),p(Yd,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Zd(){return Zd=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},Zd.apply(null,arguments)}var y2={position:"relative",width:"100%",minHeight:"100%"},v2={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Jd=class extends It{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 E=e,{data:t,rowHeight:n,renderRow:r,overscanCount:o=10}=E,s=Ln(E,["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({},y2),{height:t.length*n}),_=D(v({},v2),{top:c*n});return p("div",Zd({onScroll:this.handleScroll},s),p("div",{role:"presentation",style:h},p("div",{role:"presentation",style:_},g.map(r))))}},Aa=Jd;var g0=De(yt(),1);function b2(){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 _2(){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 w2(){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 br(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return p(b2,null);case"folder":return p(_2,null);case"video":return p(w2,null);default:return p("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function x2(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(br,{itemIconString:n.data.thumbnail||n.data.icon}),l&&((t=n.data.name)!=null?t:d("unnamed")),c))}var eu=x2;function tu(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(br,{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(br,{itemIconString:r.data.icon})),d&&((n=r.data.name)!=null?n:u("unnamed"))))}function iu(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,g0.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(eu,d);case"list":return p(tu,d);case"unsplash":return p(eu,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 C2(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 E=M=>{M.key==="Shift"&&h(!1)},N=M=>{M.key==="Shift"&&h(!0)};return document.addEventListener("keyup",E),document.addEventListener("keydown",N),()=>{document.removeEventListener("keyup",E),document.removeEventListener("keydown",N)}},[]),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 _=E=>p(iu,{viewType:t,toggleCheckbox:N=>{var M;N.stopPropagation(),N.preventDefault(),(M=document.getSelection())==null||M.removeAllRanges(),n(E,g)},showTitles:o,i18n:s,openFolder:l,file:E,utmSource:u});return d?p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list"},p(Aa,{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 Ba=C2;var S2=(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]},y0=S2;var P2=(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 E=r(_);return{type:"file",id:_.requestPath,restrictionError:E,status:d&&!E?"checked":"unchecked",parentId:l.id,data:_}});return[...c,...u,...g]},v0=P2;var E2=i=>i.map(e=>v({},e)),Na=E2;var nu=(i,e,t)=>{i.filter(r=>r.type!=="root"&&r.parentId===e).forEach(r=>{r.status=t&&!(r.type==="file"&&r.restrictionError)?"checked":"unchecked",nu(i,r.id,t)})},ru=(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",ru(i,t.parentId)},D2=(i,e)=>{let t=Na(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=>{nu(t,r.id,!0)}),ru(t,n[0].parentId)}else{let n=t.find(r=>r.id===e[0]);n.status=n.status==="checked"?"unchecked":"checked",nu(t,n.id,n.status==="checked"),ru(t,n.parentId)}return t},b0=D2;var su=De(w0(),1);var Mo=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},au=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},x0=i=>globalThis.DOMException===void 0?new au(i):new DOMException(i),C0=i=>{let e=i.reason===void 0?x0("This operation was aborted."):i.reason;return e instanceof Error?e:x0(e)};function lu(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(C0(h)),a=()=>{u(C0(h))},h.addEventListener("abort",a,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(d,u);return}let g=new Mo;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 cu(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 La=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=cu(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 Ha=class extends su.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:La},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=lu(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 Mo&&!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 S0=(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(()=>S0(i,e,u,n,r))}))}),I2=(i,e,t,n)=>B(void 0,null,function*(){let r=new Ha({concurrency:6}),o=Na(i);return o.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{r.add(()=>S0(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}),P0=I2;var kn={afterOpenFolder:y0,afterScrollFolder:v0,afterToggleCheckbox:b0,afterFill:P0};var O2=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:n}=i.target;return e-(t+n)<50},ja=O2;var F2=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=F2;var R2=(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]},Va=R2;function M2(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 _r=M2;var D0=De(yt(),1);var A2=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,E0=A2;function Ao(i){let{cancelSelection:e,donePicking:t,i18n:n,partialTree:r,validateAggregateRestrictions:o}=i,s=En(()=>o(r),[r,o]),a=En(()=>E0(r),[r]);return a===0?null:p("div",{className:"uppy-ProviderBrowser-footer"},p("div",{className:"uppy-ProviderBrowser-footer-buttons"},p("button",{className:(0,D0.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 B2=(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}}},k0=B2;var N2=(i,e,t)=>{let n=i.map(s=>k0(s,e,t)),r=[],o=[];n.forEach(s=>{e.uppy.checkIfFileAlreadyExists(ca(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)},Ua=N2;var T0=(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=[...T0(i,r.parentId,t),r];return t[n]=o,o},z2=i=>{let e=Object.create(null);return i.filter(r=>r.type==="file"&&r.status==="checked").map(r=>{let o=T0(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})})},Wa=z2;var L2=(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},I0=L2;function on(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var H2=0;function F0(i){return"__private_"+H2+++"_"+i}var j2={version:"4.4.1"};function No(){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 O0=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),Tn=F0("abortController"),fi=F0("withAbort"),Bo=class{constructor(e,t){Object.defineProperty(this,fi,{value:V2}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,Tn,{writable:!0,value:void 0}),this.validateSingleFile=r=>{let o=Io(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(O0(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(Li(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({},O0(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(Li(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(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);ja(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(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,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=Wa(n);Ua(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=Va(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||No;if(s===!1)return p(Ma,{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=I0(c,d);return p("div",{className:(0,R0.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`)},p(Qd,{showBreadcrumbs:o.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:h,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:u,i18n:r}),o.showFilter&&p(_r,{searchString:g,setSearchString:_=>{this.plugin.setPluginState({searchString:_})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(Ba,{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(Ao,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function V2(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}})}Bo.VERSION=j2.version;var M0=De(yt(),1);var U2={version:"4.4.1"},W2={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},$2={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},wr=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=n=>{let r=Io(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({},$2),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(W2)}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(ja(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=Wa(e);Ua(t,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(e,t){let{partialTree:n}=this.plugin.getPluginState(),r=Va(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(_r,{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,M0.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&p(_r,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(Ba,{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(Ao,{partialTree:s,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};wr.VERSION=U2.version;var A0=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function q2(i,e){return!!(i===e||A0(i)&&A0(e))}function G2(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!q2(i[t],e[t]))return!1;return!0}function du(i,e){e===void 0&&(e=G2);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 $a=['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 zo(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function B0(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function X2(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function Y2(i){return i.contains(document.activeElement)}function uu(i,e,t){let n=zo(t,e),r=Si(n.querySelectorAll($a)),o=r.indexOf(document.activeElement);Y2(n)?i.shiftKey&&o===0?X2(i,r):!i.shiftKey&&o===r.length-1&&B0(i,r):B0(i,r)}function N0(i,e,t){e===null||uu(i,e,t)}var z0=De(ed(),1);function pu(){let i=!1;return(0,z0.default)((t,n)=>{let r=zo(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($a);a?.focus({preventScroll:!0}),i=!1}},260)}var iy=De(yt(),1);function Lo(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var V0=De(yt(),1);function L0(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 Q2(){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 Z2(){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 J2(){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 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.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 tE(){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 iE(){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 nE(){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:iE()};if(!i)return e;let t=i.split("/")[0],n=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:nE()}:t==="image"?{color:"#686de0",icon:Q2()}:t==="audio"?{color:"#068dbb",icon:Z2()}:t==="video"?{color:"#19af67",icon:J2()}:t==="application"&&n==="pdf"?{color:"#e25149",icon:eE()}: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:tE()}:e}function Ho(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 rE=(i,e)=>(typeof e=="function"?e():e).filter(r=>r.id===i)[0].name;function jo(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=>rE(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 hu(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(Ho,{file:e}),p(jo,{file:e,i18n:t,toggleFileCard:n,metaFields:r}))}function oE(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 H0(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 fu(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":H0(i),title:H0(i),onClick:()=>oE(i)},i.children))}function qa(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 mu(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 gu(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(qa,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(fu,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(fu,i,p(qa,null,p(mu,{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(fu,i,p(qa,null,p(mu,{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(qa,null,p(mu,{progress:i.file.progress.percentage}))))}var j0=De(io(),1);var yu="...";function Ga(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=yu.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-yu.length,n=Math.ceil(t/2),r=Math.floor(t/2);return i.slice(0,n)+yu+i.slice(-r)}var sE=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},Ga(t,n()))},aE=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"},Ga(t.name,13)),n?p(Fragment,null,` ${r} `,n,` ${r} `):null):null},lE=i=>i.file.size&&p("div",{className:"uppy-Dashboard-Item-statusSize"},(0,j0.default)(i.file.size)),cE=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"))),dE=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 vu(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"},sE({file:e,isSingleFile:s,containerHeight:a,containerWidth:l}),p(dE,{file:e,onClick:()=>alert(e.error)})),p("div",{className:"uppy-Dashboard-Item-status"},aE({file:e}),lE({file:e}),cE({file:e,toggleAddFilesPanel:o,i18n:t})),p(jo,{file:e,i18n:t,toggleFileCard:n,metaFields:r}))}function bu(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 uE(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 pE(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 hE(i){let{file:e,uppy:t,i18n:n}=i,r=o=>{bu(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 _u(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(uE,{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(hE,{file:t,uppy:e,i18n:l}):null,a?p(pE,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var Xa=class extends It{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!L0(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,V0.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(hu,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),p(gu,{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(vu,{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(_u,{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 fE(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 wu(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:E,recoveredState:N,individualCancellation:M,itemsPerRow:U,openFileEditor:de,canEditFile:oe,toggleAddFilesPanel:ee,containerWidth:b,containerHeight:w}=i,S=U===1?71:200,A=En(()=>{let K=(Ne,Pe)=>Number(r[Pe].isGhost)-Number(r[Ne].isGhost),ye=Object.keys(r);return N&&ye.sort(K),fE(ye,U)},[r,U,N]),L=K=>p("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:K[0]},K.map(ye=>p(Xa,{key:ye,uppy:n,id:e,i18n:t,resumableUploads:o,individualCancellation:M,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:u,recoveredState:N,isSingleFile:g,containerWidth:b,containerHeight:w,toggleFileCard:h,handleRequestThumbnail:_,handleCancelThumbnail:E,role:"listitem",openFileEditor:de,canEditFile:oe,toggleAddFilesPanel:ee,file:r[ye]})));return g?p("div",{class:"uppy-Dashboard-files"},L(A[0])):p(Aa,{class:"uppy-Dashboard-files",role:"list",data:A,renderRow:L,rowHeight:S})}var xu=class extends It{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(Ut,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(Ut,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(Ut,{key:u},g)}),p("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:u,elements:g}=d;return p(Ut,{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()))}},Ya=xu;var U0=De(yt(),1);var mE=i=>p("div",{className:(0,U0.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(Ya,i)),W0=mE;var $0=De(yt(),1);function gE(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ei=gE;function yE(i){let{activePickerPanel:e,className:t,hideAllPanels:n,i18n:r,state:o,uppy:s}=i,a=Pn(null);return p("div",{className:(0,$0.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 q0=yE;var G0=De(yt(),1);function vE(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return p("div",{className:(0,G0.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 X0=vE;var Di={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function bE(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 _E(i){let{files:e,i18n:t,isAllComplete:n,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:s,newFiles:a,processingFiles:l}=i;switch(bE(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 wE(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(_E,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 Y0=wE;var K0=De(yt(),1);function Cu(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 Su(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],E=(e=h())!=null?e:[],N=g(_),M={};E.forEach(S=>{var A;M[S.id]=(A=_.meta[S.id])!=null?A:""});let[U,de]=hi(M),oe=Dn(S=>{S.preventDefault(),o(U,n)},[o,U,n]),ee=(S,A)=>{de(D(v({},U),{[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,K0.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(Ho,{file:_}),N&&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(Cu,{computedMetaFields:E,requiredMetaFields:a,updateMeta:ee,form:w,formState:U})),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 Z0=De(yt(),1),xr="uppy-transition-slideDownUp",Q0=250;function xE(i){let{children:e}=i,[t,n]=hi(null),[r,o]=hi(""),s=Pn(),a=Pn(),l=Pn(),c=()=>{o(`${xr}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{o(`${xr}-enter ${xr}-enter-active`),s.current=setTimeout(()=>{o("")},Q0)})},d=()=>{o(`${xr}-leave`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{o(`${xr}-leave ${xr}-leave-active`),a.current=setTimeout(()=>{n(null),o("")},Q0)})};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?ga(t,{className:(0,Z0.default)(r,t.props.className)}):null}var Vo=xE;function Cr(){return Cr=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},Cr.apply(null,arguments)}var J0=900,ey=700,Pu=576,ty=330;function Eu(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,n=i.containerWidth>Pu,r=i.containerHeight>ty,o=(0,iy.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>Pu,"uppy-size--lg":i.containerWidth>ey,"uppy-size--xl":i.containerWidth>J0,"uppy-size--height-md":i.containerHeight>ty,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&r}),s=1;i.containerWidth>J0?s=5:i.containerWidth>ey?s=4:i.containerWidth>Pu&&(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&&Lo(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},p("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),p("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:p("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},p("span",{"aria-hidden":"true"},"\xD7")),p("div",{className:"uppy-Dashboard-innerWrap"},p("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),a&&p(Y0,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(wu,{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(Ya,{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(Vo,null,i.showAddFilesPanel?p(W0,Cr({key:"AddFiles"},i,{isSizeMD:n})):null),p(Vo,null,i.fileCardFor?p(Su,Cr({key:"FileCard"},i)):null),p(Vo,null,i.activePickerPanel?p(q0,Cr({key:"Picker"},i)):null),p(Vo,null,i.showFileEditor?p(X0,Cr({key:"Editor"},i)):null),p("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(g=>i.uppy.getPlugin(g.id).render(i.state))))))}var ny={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 CE=0;function ut(i){return"__private_"+CE+++"_"+i}var SE={version:"4.3.1"},Du=du.default||du,ry=9,PE=27;function oy(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var EE={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:No,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=ut("disabledNodes"),Hi=ut("generateLargeThumbnailIfSingleFile"),Uo=ut("openFileEditorWhenFilesAdded"),Fn=ut("attachRenderFunctionToTarget"),ku=ut("isTargetSupported"),Tu=ut("getAcquirers"),Iu=ut("getProgressIndicators"),ji=ut("getEditors"),Ou=ut("addSpecifiedPluginsFromOptions"),Fu=ut("autoDiscoverPlugins"),Rn=ut("addSupportedPluginIfNoTarget"),Wo=ut("getStatusBarOpts"),$o=ut("getThumbnailGeneratorOpts"),Ru=ut("getInformerOpts"),qo=ut("getStatusBarId"),Go=ut("getThumbnailGeneratorId"),Mu=ut("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({},EE),t),{autoOpen:s})),Object.defineProperty(this,Mu,{value:FE}),Object.defineProperty(this,Go,{value:OE}),Object.defineProperty(this,qo,{value:IE}),Object.defineProperty(this,Ru,{value:TE}),Object.defineProperty(this,$o,{value:kE}),Object.defineProperty(this,Wo,{value:DE}),Object.defineProperty(this,On,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${nn()}`,this.superFocus=pu(),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}=oy();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}=oy();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let E=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",E,!1),h()};this.el.addEventListener("animationend",E,!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===PE&&this.requestCloseModal(),a.keyCode===ry&&uu(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 To(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===ry&&N0(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,Uo,{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=Ud(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,Uo)[Uo])},this.removeEvents=()=>{let a=Ud(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,Uo)[Uo])},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,ku,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,Tu,{writable:!0,value:Du(a=>a.filter(l=>l.type==="acquirer"&&we(this,ku)[ku](l)).map(we(this,Fn)[Fn]))}),Object.defineProperty(this,Iu,{writable:!0,value:Du(a=>a.filter(l=>l.type==="progressindicator").map(we(this,Fn)[Fn]))}),Object.defineProperty(this,ji,{writable:!0,value:Du(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:E,inProgressFiles:N,inProgressNotPausedFiles:M,processingFiles:U,isUploadStarted:de,isAllComplete:oe,isAllPaused:ee}=this.uppy.getObjectOfFilesPerState(),b=we(this,Tu)[Tu](l.targets),w=we(this,Iu)[Iu](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}".`)),Eu({state:a,isHidden:l.isHidden,files:c,newFiles:g,uploadStartedFiles:h,completeFiles:_,erroredFiles:E,inProgressFiles:N,inProgressNotPausedFiles:M,processingFiles:U,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,Ou,{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,Fu,{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,qo)[qo](),target:this},we(this,Wo)[Wo]())),this.opts.disableInformer||this.uppy.use(wn,v({id:we(this,Mu)[Mu](),target:this},we(this,Ru)[Ru]())),this.opts.disableThumbnailGenerator||this.uppy.use(vr,v({id:we(this,Go)[Go]()},we(this,$o)[$o]())),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,Ou)[Ou](),we(this,Fu)[Fu](),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=ny,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,Wo)[Wo]()),(n=this.uppy.getPlugin(we(this,Go)[Go]()))==null||n.setOptions(we(this,$o)[$o]())}};function DE(){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 kE(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:n}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:n,lazy:!n}}function TE(){return{}}function IE(){return`${this.id}:StatusBar`}function OE(){return`${this.id}:ThumbnailGenerator`}function FE(){return`${this.id}:Informer`}Mn.VERSION=SE.version;var RE={version:"4.2.1"},ME={fixed:!1,hideAfterFinish:!0},Sr=class extends Wt{constructor(e,t){super(e,v(v({},ME),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()}};Sr.VERSION=RE.version;var sy={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var AE={version:"4.1.1"},BE={inputName:"files[]",width:"100%",height:"100%"},Pr=class i extends Wt{constructor(e,t){super(e,v(v({},BE),t)),this.isDragDropSupported=Lo(),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 To(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=sy,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
+ uppy-DragDrop-container
28
+ ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
29
+ ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
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()}};Pr.VERSION=AE.version;var Au=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)}},ay=(()=>{class i extends Au{constructor(t){super(),this.el=t,this.uppy=new dr,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(Et))}}static{this.\u0275cmp=fe({type:i,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[pl,gi],decls:0,vars:0,template:function(n,r){},encapsulation:2,changeDetection:0})}}return i})();var ly=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({})}}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 zE=0;function Ot(i){return"__private_"+zE+++"_"+i}function LE(i){return new Error("Cancelled",{cause:i})}function cy(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=Ot("activeRequests"),wt=Ot("queuedHandlers"),Xt=Ot("paused"),An=Ot("pauseTimer"),_t=Ot("downLimit"),Bn=Ot("upperLimit"),Vi=Ot("rateLimitingTimer"),Xo=Ot("call"),Ui=Ot("queueNext"),zu=Ot("next"),Bu=Ot("queue"),Lu=Ot("dequeue"),Nu=Ot("resume"),Nn=Ot("increaseLimit"),Ka=class{constructor(e){Object.defineProperty(this,Lu,{value:WE}),Object.defineProperty(this,Bu,{value:UE}),Object.defineProperty(this,zu,{value:VE}),Object.defineProperty(this,Ui,{value:jE}),Object.defineProperty(this,Xo,{value:HE}),Object.defineProperty(this,Yt,{writable:!0,value:0}),Object.defineProperty(this,wt,{writable:!0,value:[]}),Object.defineProperty(this,Xt,{writable:!0,value:!1}),Object.defineProperty(this,An,{writable:!0,value:void 0}),Object.defineProperty(this,_t,{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,Nu,{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,_t)[_t]=this.limit,this.limit=Math.ceil((ce(this,Bn)[Bn]+ce(this,_t)[_t])/2);for(let t=ce(this,_t)[_t];t<=this.limit;t++)ce(this,Ui)[Ui]();ce(this,Bn)[Bn]-ce(this,_t)[_t]>3?ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],2e3):ce(this,_t)[_t]=Math.floor(ce(this,_t)[_t]/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,Xo)[Xo](e):ce(this,Bu)[Bu](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:cy,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=LE(h)}},t)});return l.abort=c=>{a.abort(c)},l.abortOn=cy,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,Nu)[Nu],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,_t)[_t],ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],e))}get isPaused(){return ce(this,Xt)[Xt]}};function HE(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 jE(){queueMicrotask(()=>ce(this,zu)[zu]())}function VE(){if(ce(this,Xt)[Xt]||ce(this,Yt)[Yt]>=this.limit||ce(this,wt)[wt].length===0)return;let i=ce(this,wt)[wt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=ce(this,Xo)[Xo](i.fn);i.abort=e.abort,i.done=e.done}function UE(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{ce(this,Lu)[Lu](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=ce(this,wt)[wt].findIndex(r=>t.priority>r.priority);return n===-1?ce(this,wt)[wt].push(t):ce(this,wt)[wt].splice(n,0,t),t}function WE(i){let e=ce(this,wt)[wt].indexOf(i);e!==-1&&ce(this,wt)[wt].splice(e,1)}var Y4=Symbol("__queue");var Vu=De(io(),1),hy=De(dy(),1);var uy={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function py(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var $E=0;function qE(i){return"__private_"+$E+++"_"+i}var GE={quality:.6,limit:10},Yo=qE("RateLimitedQueue"),Qa=class extends bn{constructor(e,t){super(e,v(v({},GE),t)),Object.defineProperty(this,Yo,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=uy,py(this,Yo)[Yo]=new Ka(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 hy.default(e,D(v({},this.opts),{success:t,error:n}))})}prepareUpload(e){return B(this,null,function*(){let t=0,n=[],r=py(this,Yo)[Yo].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,Vu.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,Vu.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 my=De(fy(),1);function XE(i,e){if(i&1&&(f(0,"small",5),x(1),m()),i&2){let t=O();y(),I(t.subtitle)}}function YE(i,e){if(i&1&&(f(0,"a",6),ue(1,"i",7),x(2," Download Template "),m()),i&2){let t=O();jn("top-58",t.subtitle),P("href",t.sampleUrl,is)}}function KE(i,e){if(i&1&&(hl(0),x(1),fl()),i&2){let t=O(2);y(),ii("- ",t.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function QE(i,e){if(i&1&&(f(0,"div",4)(1,"h4",8),x(2,"CSV File Content Summary"),m(),ue(3,"hr"),f(4,"p",9),x(5),le(6,KE,2,1,"ng-container",10),m()()),i&2){let t=O();y(5),ii("",t.rowSummary().rowCount," rows found "),y(),P("ngIf",t.rowSummary().rowEmpty>0)}}var gy=(()=>{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=ul(),this.dashboardPropsConfiguration=ul(),this.fileUploaded=new zt,this.fileUploadComplete=new zt,this.fileRemoved=new zt,this.onParser=new zt,this.multipleFilesUploaded=new zt,this.http=z(om),this.csvParser=z(rm),this.rowSummary=q({rowCount:0,rowEmpty:0}),this.file=q(null),this.multipleFiles=q([]),this.uppy=new dr({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6}}).use(Qa,{mimeType:"image/jpeg",convertSize:1/0,convertTypes:["image/png"]}),this.dashboardProps={hideUploadButton:!0,height:350},yl(()=>this.uppy.setOptions(v({},this.uppyCoreConfiguration()))),yl(()=>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),my.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:[_e],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),ue(1,"uppy-dashboard",1),le(2,XE,2,1,"small",2)(3,YE,3,3,"a",3)(4,QE,7,2,"div",4),m()),n&2){let o;y(),P("uppy",r.uppy)("props",r.dashboardProps),y(),P("ngIf",r.subtitle&&r.showSubtitle),y(),P("ngIf",r.sampleUrl&&r.showSample),y(),Ce(r.file()&&((o=r.file())==null?null:o.type)==="text/csv"?4:-1)}},dependencies:[ly,ay,ri,Vn],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 yy=(()=>{class i{constructor(){this.file=null,this.sample_URL="https://res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",this.fb=z(Yi),this.httpService=z(bi),this.destroyRef=z(Ye),this.activeModal=z(Es)}ngOnInit(){this.form=this.fb.group({file:new nt("",[lt.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:[_e],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),W("onOK",function(){return r.onOK()}),f(1,"POS-uppy",1),W("fileUploaded",function(s){return r.onSelectFile(s)}),m()()),n&2&&(P("hasValid",r.form.valid),y(),P("sampleUrl",r.sample_URL))},dependencies:[Ds,rt,gy],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 vy=()=>{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 ZE=(i,e)=>e.VariantID;function JE(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 eD(i,e){if(i&1&&(f(0,"div",37)(1,"span",44),x(2),Ue(3,"maskito"),m(),le(4,JE,3,4,"span",45),m()),i&2){let t,n=O().$implicit,r=O();y(2),I(Ti(3,2,(t=n.UnitPrice)!==null&&t!==void 0?t:n.Promotions.UnitPrice,r.options)),y(2),P("ngIf",n.Promotions)}}function tD(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 iD(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 nD(i,e){if(i&1&&le(0,tD,4,4,"div",37)(1,iD,4,4,"div",37),i&2){let t=O().$implicit;Ce(t.Print&&t.Print.length>0?0:1)}}function rD(i,e){i&1&&ue(0,"i",40)}function oD(i,e){i&1&&ue(0,"i",41)}function sD(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"),le(9,eD,5,5,"div",37)(10,nD,2,1),m(),f(11,"td")(12,"div",38)(13,"button",39),W("click",function(){let r=se(t).$implicit,o=O();return ae(o.onToggleSelected(r))}),le(14,rD,1,0,"i",40)(15,oD,1,0,"i",41),m(),f(16,"button",42),W("click",function(){let r=se(t).$implicit,o=O();return ae(o.onRemoveItem(r))}),ue(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),P("disabled",t.isSelected&&n.productEdit)}}var by=(()=>{class i{constructor(){this.productItems=[],this.storeService=z(ke),this.Object=Object,this.options=ar({precision:2,thousandSeparator:","}),this.modalService=z(Ip),this.httpService=z(bi),this.router=z(Un),this.route=z(ms)}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(ia,{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),vl.production||localStorage.setItem("productItems",JSON.stringify(s))}})}onOpenModalEdit(t){return B(this,null,function*(){let n=this.modalService.open(ia,{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),vl.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=>Object.prototype.hasOwnProperty.call(o,"VariantID")?o.VariantID===t.VariantID:o.ID===t.ID);r!==-1?n[r].checked=!0:n.forEach(o=>o.checked=!1),this.router.navigate(["/pages"],{queryParams:{id:n[r].checked?Object.prototype.hasOwnProperty.call(n[r],"VariantID")?t.VariantID:t.ID:null}})}onOpenDialogImportProduct(){return B(this,null,function*(){let n=yield this.modalService.open(yy,{scrollable:!0,centered:!0}).result,r=[...this.storeService.productItems()];n.forEach(o=>{r.push(D(v({},o),{Uuid:vy(),ID:o.VariantID,Promotions:o.Print[0].IsDiscounted?D(v({},o.Print[0]),{UnitPrice:o.Print[0].UnitPriceDiscounted}):{},UnitPrice:o.Print[0].UnitPrice}))}),this.storeService.onChangeProductItems(r),console.log("result",n)})}onOpenDialogLoadTransaction(){return B(this,null,function*(){let n=yield this.modalService.open(em,{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(Kt(l=>l.map(c=>D(v({},c),{checked:!1}))),xe(l=>{let c=[...this.storeService.productItems()];l.forEach(d=>{let u=c.findIndex(g=>g.VariantID===d.VariantID);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.VariantID!==t.VariantID);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(Xp,5),n&2){let o;ei(o=ti())&&(r.verticalSidebar=o.first)}},standalone:!0,features:[_e],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),W("click",function(){return r.onOpenDialogImportProduct()}),ue(14,"i",13),f(15,"span",14),x(16,"Upload"),m()(),ue(17,"button",15),f(18,"div",16)(19,"button",17),W("click",function(){return r.onOpenDialogLoadTransaction()}),ue(20,"i",18),f(21,"span",14),x(22,"Load Transaction"),m()(),f(23,"button",17),W("click",function(){return r.onClear()}),ue(24,"i",19),f(25,"span",14),x(26,"Clear"),m()()()()(),f(27,"button",20),W("click",function(){return r.onNext()}),f(28,"span",14),x(29,"Next"),m(),ue(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(),ue(50,"th",32),m()(),f(51,"tbody"),Zt(52,sD,18,8,"tr",null,ZE),m()()()()()()(),f(54,"div",34)(55,"div",35)(56,"div",36),ue(57,"modal-choose-product"),m()()()()()()),n&2&&(y(),Lt("data-navbarbg",r.storeService.options().navbarbg),y(),P("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),P("ngbCollapse",!r.storeService.options().isCollapsed),Lt("data-navbarbg",r.storeService.options().navbarbg),y(24),P("disabled",r.storeService.productItems().length<=0),y(25),Jt(r.storeService.productItems()))},dependencies:[ri,Xi,Vn,fs,Tp,Ep,Pp,Dp,kp,$n,Ff,nm,ia],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 Ko="px",_y=ar({postfix:Ko,min:0,thousandSeparator:""}),{plugins:aD}=_y,lD=Ln(_y,["plugins"]),Ft=D(v({},lD),{plugins:[...aD,Tf(i=>[0,i.length-Ko.length]),sr("focus",i=>{i.setSelectionRange(0,i.value.length-Ko.length)}),sr("blur",i=>{i.value===Ko&&nr(i,`0${Ko}`)})]});function cD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.barcodeHeight)}}function dD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}function uD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.barcode)}}function pD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.code)}}function hD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.price)}}function fD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.name)}}function mD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.moveProductName)}}function gD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.releaseDate)}}function yD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.discountVisible)}}function vD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookPrice)}}function bD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookFontSize)}}var wy=(()=>{class i{constructor(){this.options=Ft,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=z(ke),this.injector=z(Xe),this.destroyRef=z(Ye)}ngOnInit(){pt(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:[_e],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),W("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),W("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),W("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),W("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),W("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),W("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),W("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),W("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),W("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"pricebookPrice"))}),m()()(),f(89,"td")(90,"span",15),x(91),m()()()()(),le(92,cD,2,1,"ng-template",null,0,me)(94,dD,2,1,"ng-template",null,1,me)(96,uD,2,1,"ng-template",null,2,me)(98,pD,2,1,"ng-template",null,3,me)(100,hD,2,1,"ng-template",null,4,me)(102,fD,2,1,"ng-template",null,5,me)(104,mD,2,1,"ng-template",null,6,me)(106,gD,2,1,"ng-template",null,7,me)(108,yD,2,1,"ng-template",null,8,me)(110,vD,2,1,"ng-template",null,9,me)(112,bD,2,1,"ng-template",null,10,me)}n&2&&(y(8),P("checked",r.barcode())("ngModel",r.barcode()),y(3),I(r.tooltip.barcode),y(7),P("checked",r.code())("ngModel",r.code()),y(3),I(r.tooltip.code),y(7),P("ngModel",r.price()),y(3),I(r.tooltip.price),y(7),P("ngModel",r.name()),y(3),I(r.tooltip.name),y(7),P("ngModel",r.moveProductName()),y(3),I(r.tooltip.moveProductName),y(7),P("ngModel",r.releaseDate()),y(3),I(r.tooltip.releaseDate),y(7),P("ngModel",r.discountVisible()),y(3),I(r.tooltip.discountVisible),y(7),P("ngModel",r.UOMVisible()),y(3),I(r.tooltip.UOMVisible),y(7),P("ngModel",r.pricebookPrice()),y(3),I(r.tooltip.pricebookPrice))},dependencies:[ht,Wn,it,Dt,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 _D(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.priceWithTax)}}function wD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.selectedTax)}}function xD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.currency)}}function CD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}function SD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.outletPrice)}}var xy=(()=>{class i{constructor(){this.options=Ft,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=z(ke),this.destroyRef=z(Ye),this.injector=z(Xe),this.outlets=q([])}get taxs(){return this.storeService.taxs()}ngOnInit(){pt(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?n.some(s=>s.OutletPrice?.some(a=>a.Outlet===o.Name)):[]);this.outlets.set(r),pt(this.storeService.productItems,{injector:this.injector}).pipe(xe(o=>{let s=o.some(a=>a.Promotions);this.outletPrice.set(s?"":this.outletPrice())})).subscribe(),pt(this.outletPrice,{injector:this.injector}).pipe(Qt(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:[_e],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),W("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),W("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),W("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),W("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"outletPrice"))}),m()(),f(36,"td")(37,"span",9),x(38),m()()()()(),le(39,_D,2,1,"ng-template",null,0,me)(41,wD,2,1,"ng-template",null,1,me)(43,xD,2,1,"ng-template",null,2,me)(45,CD,2,1,"ng-template",null,3,me)(47,SD,2,1,"ng-template",null,4,me)}n&2&&(y(8),P("checked",r.hasPriceTax())("ngModel",r.hasPriceTax()),y(3),I(r.tooltip.priceWithTax),y(6),P("ngModel",r.selectedTax())("items",r.taxs),y(3),I(r.tooltip.selectedTax),y(6),P("ngModel",r.currency()),y(3),I(r.tooltip.currency),y(6),P("ngModel",r.outletPrice())("items",r.outlets()),y(3),I(r.tooltip.outletPrice))},dependencies:[ht,tt,Wn,it,Dt,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 PD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.maxCharacter)}}function ED(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.namePrefix)}}function DD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.storeName)}}function kD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.orientation)}}function TD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.useDescriptionAsCode)}}function ID(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.removeDefault)}}var Cy=(()=>{class i{constructor(){this.storeService=z(ke),this.fb=z(Yi),this.destroyRef=z(Ye),this.injector=z(Xe),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=Ft}ngOnInit(){this.initForm(),pt(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,[lt.required]),namePrefix:new nt(null,[lt.required]),storeName:new nt(null,[lt.required]),orientation:new nt(null,[lt.required]),useDescriptionAsCode:new nt(null,[lt.required]),removeDefault:new nt("0",[lt.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:[_e],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),W("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),W("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),W("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),W("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),W("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),W("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"removeDefault"))}),m()()(),f(55,"td")(56,"span",9),x(57),m()()()()(),le(58,PD,2,1,"ng-template",null,0,me)(60,ED,2,1,"ng-template",null,1,me)(62,DD,2,1,"ng-template",null,2,me)(64,kD,2,1,"ng-template",null,3,me)(66,TD,2,1,"ng-template",null,4,me)(68,ID,2,1,"ng-template",null,5,me)}n&2&&(y(7),P("ngModel",r.maxCharacter()),y(3),I(r.tooltip.maxCharacter),y(6),P("ngModel",r.namePrefix()),y(3),I(r.tooltip.namePrefix),y(6),P("ngModel",r.storeName()),y(3),I(r.tooltip.storeName),y(6),P("ngModel",r.orientation())("items",r.storeService.paperConfiguration().OrientationChoice),y(3),I(r.tooltip.orientation),y(7),P("checked",r.useDescriptionAsCode())("ngModel",r.useDescriptionAsCode()),y(3),I(r.tooltip.useDescriptionAsCode),y(7),P("checked",r.removeDefault())("ngModel",r.removeDefault()),y(3),I(r.tooltip.removeDefault))},dependencies:[rt,tt,Wn,it,oi,_i,ht,Dt],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 Sy=(()=>{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=ts({name:"taxs",type:i,pure:!0,standalone:!0})}}return i})();var Py=De(Ic());var OD=["barcode"],FD=(i,e)=>e.VariantID,RD=i=>({"h-100":i}),Ge=i=>({"font-size.px":i});function MD(i,e){if(i&1&&(f(0,"div",3),ue(1,"canvas",12,0),m()),i&2){let t=O(2);y(),P("ngStyle",t.barcodeStyle)}}function AD(i,e){if(i&1&&(f(0,"span",5),x(1),m()),i&2){let t=O().$implicit,n=O();P("ngStyle",Ae(2,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.Code)}}function BD(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O(3);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().ProductNamePrefix)}}function ND(i,e){if(i&1&&(f(0,"div",6),le(1,BD,2,4,"span",13),f(2,"span",14),x(3),Ue(4,"slice"),m()()),i&2){let t=O().$implicit,n=O();y(),P("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),y(),P("ngStyle",Ae(7,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(gl(4,3,t.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function zD(i,e){if(i&1&&(f(0,"span",25),x(1),m()),i&2){let t=O(3);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function LD(i,e){if(i&1&&(f(0,"span"),x(1),m()),i&2){let t=O(2).$implicit;y(),ii("/",t.UOMName||"pcs","")}}function HD(i,e){if(i&1&&(f(0,"span",26),x(1),m()),i&2){let t=O(3);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function jD(i,e){if(i&1&&(f(0,"div",7)(1,"div",15)(2,"div",16),x(3),m(),f(4,"div",17),le(5,zD,2,4,"span",18),f(6,"span",19),x(7),Ue(8,"number"),m(),le(9,LD,2,1,"span",20),m()(),f(10,"div",15)(11,"div",21),x(12),m(),f(13,"div",22),le(14,HD,2,4,"span",23),f(15,"span",24),x(16),Ue(17,"number"),m()()()()),i&2){let t=O().$implicit,n=O();y(2),P("ngStyle",Ae(15,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),ii(" ",n.storeService.paperConfiguration().BasicPriceLabel," "),y(2),P("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),P("ngStyle",Ae(17,Ge,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ni(8,11,t.UnitPrice)),y(2),P("ngIf",n.storeService.paperConfiguration().UOMNameVisible),y(2),P("ngStyle",Ae(19,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),ii(" ",n.storeService.paperConfiguration().PromotionPriceLabel," "),y(2),P("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),P("ngStyle",Ae(21,Ge,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ni(17,13,n.promotionDiscount(t.Promotions)))}}function VD(i,e){if(i&1&&(f(0,"span",28),x(1),m()),i&2){let t=O(3);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function UD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O(2).$implicit,n=O();P("ngStyle",Ae(2,Ge,n.storeService.paperConfiguration().PriceFontSize)),y(),ii("/",t.UOMName||"pcs","")}}function WD(i,e){if(i&1&&(f(0,"div",8),le(1,VD,2,4,"span",27),f(2,"span",28),x(3),Ue(4,"taxs"),Ue(5,"number"),m(),le(6,UD,2,4,"span",29),m()),i&2){let t=O().$implicit,n=O();y(),P("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),P("ngStyle",Ae(9,Ge,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ni(5,7,Ti(4,4,t.UnitPrice,n.taxRate))),y(3),P("ngIf",n.storeService.paperConfiguration().UOMNameVisible)}}function $D(i,e){if(i&1&&(f(0,"span",28),x(1),m()),i&2){let t=O(5);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function qD(i,e){if(i&1&&(f(0,"div",10),le(1,$D,2,4,"span",27),f(2,"span",28),x(3),Ue(4,"taxs"),Ue(5,"number"),m()()),i&2){let t=O().$implicit,n=O(3);y(),P("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),P("ngStyle",Ae(8,Ge,n.storeService.paperConfiguration().PriceFontSize)),y(),I(ni(5,6,Ti(4,3,t.Price,n.taxRate)))}}function GD(i,e){if(i&1&&le(0,qD,6,10,"div",10),i&2){let t=e.$implicit,n=O(3);Ce(t.Outlet===n.storeService.outlet$().Name?0:-1)}}function XD(i,e){if(i&1&&Zt(0,GD,1,1,null,null,as),i&2){let t=O().$implicit;Jt(t.OutletPrice)}}function YD(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O(3);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().ProductNamePrefix)}}function KD(i,e){if(i&1&&(f(0,"div",9),le(1,YD,2,4,"span",13),f(2,"span",14),x(3),Ue(4,"slice"),m()()),i&2){let t=O().$implicit,n=O();y(),P("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),y(),P("ngStyle",Ae(7,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(gl(4,3,t.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function QD(i,e){if(i&1&&(f(0,"div",31)(1,"span",14),x(2),m()()),i&2){let t=O(3);y(),P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().StoreName)}}function ZD(i,e){if(i&1&&(f(0,"div",32)(1,"span",14),x(2),m()()),i&2){let t=O(3);y(),P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().StoreName)}}function JD(i,e){if(i&1&&le(0,QD,3,4,"div",31)(1,ZD,3,4,"div",32),i&2){let t=O(2);Ce(t.storeService.paperConfiguration().Orientation===0?0:1)}}function ek(i,e){if(i&1&&(f(0,"div",10)(1,"span",14),x(2),Ue(3,"date"),m()()),i&2){let t=O().$implicit,n=O();y(),P("ngStyle",Ae(5,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(Ti(3,2,t.ReleasedDate,"dd MMM yyyy"))}}function tk(i,e){if(i&1&&(f(0,"div",10)(1,"span",14),x(2),m()()),i&2){let t=O().$implicit,n=O();y(),P("ngStyle",Ae(2,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),ii("",t.PriceDiscount,"% Off")}}function ik(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 nk(i,e){if(i&1&&(f(0,"div",11),Zt(1,ik,11,5,null,null,ls),m()),i&2){let t=O().$implicit,n=O();P("ngStyle",Ae(1,Ge,n.storeService.paperConfiguration().PricebookFontSize)),y(),Jt(t.Pricebook)}}function rk(i,e){if(i&1&&(f(0,"div",2),le(1,MD,3,1,"div",3),f(2,"div",4),le(3,AD,2,4,"span",5)(4,ND,5,9,"div",6)(5,jD,18,23,"div",7)(6,WD,7,11,"div",8)(7,XD,2,0)(8,KD,5,9,"div",9)(9,JD,2,1)(10,ek,4,7,"div",10)(11,tk,3,4,"div",10)(12,nk,3,3,"div",11),m()()),i&2){let t=e.$implicit,n=O();P("ngStyle",n.stickerStyles),y(),Ce(n.storeService.paperConfiguration().BarcodeVisible?1:-1),y(),P("ngClass",Ae(13,RD,!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 Za=(()=>{class i{constructor(){this.items=[],this.previewType="single",this.storeService=z(ke),this.Object=Object,this.cdr=z(cn),this.renderer=z(ns),this.elementsInitialized=!1,this.injector=z(Xe)}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,Py.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(OD,5,Et),n&2){let o;ei(o=ti())&&(r.barcodeRef=o)}},inputs:{items:"items",previewType:"previewType"},standalone:!0,features:[_e],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"],[1,"d-flex","align-items-baseline",2,"line-height","1"],[2,"line-height","0","width","100%","text-align","center"],[2,"line-height","1"],[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","align-items-baseline"],["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"],[3,"ngStyle",4,"ngIf"],[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),Zt(1,rk,13,15,"div",2,FD),m()),n&2&&(P("ngStyle",r.barcodeContainerStyles),y(),Jt(r.items))},dependencies:[yp,Sy,Vn,bp,ri,Xi,_p,fs],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 Ey=(()=>{class i{constructor(){this.storeService=z(ke)}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-customize-label"]],standalone:!0,features:[_e],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),W("click",function(){return se(o),ae(r.storeService.onPrevStep())}),ue(12,"i",12),f(13,"span",13),x(14,"Back"),m()(),f(15,"button",11),W("click",function(){return se(o),ae(r.storeService.onNextStep())}),f(16,"span",13),x(17,"Next"),m(),ue(18,"i",14),m()()()()()()(),f(19,"div",15)(20,"div",16)(21,"div",17)(22,"div",18),ue(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),ue(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),ue(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),ue(57,"app-advanced"),m()()()()()()()()()}n&2&&(y(),Lt("data-navbarbg",r.storeService.options().navbarbg),y(),P("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),P("ngbCollapse",!r.storeService.options().isCollapsed),Lt("data-navbarbg",r.storeService.options().navbarbg),y(20),P("items",r.storeService.expandProductItem()),y(7),P("closeOthers",!0),y(),P("collapsed",!1),y(9),P("collapsed",!0),y(9),P("collapsed",!0))},dependencies:[_s,xs,ws,Ps,Cs,Ss,tr,$n,Xi,wy,xy,Cy,Za],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:100vh}"],changeDetection:0})}}return i})();function ok(i,e){if(i&1&&(f(0,"ng-option",3),x(1),m()),i&2){let t=e.$implicit;P("value",t.Name),y(),I(t.Name)}}var Dy=(()=>{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=Ft,this.storeService=z(ke),this.destroyRef=z(Ye),this.injector=z(Xe),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(){pt(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:[_e],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),W("ngModelChange",function(s){return r.onChangePaperSource(s)}),Zt(8,ok,2,2,"ng-option",3,ls),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),W("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),W("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),W("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),W("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),W("ngModelChange",function(s){return r.onInputHandler(s,"fontSize")}),m()(),f(55,"td")(56,"span",4),x(57),m()()()()()),n&2&&(y(7),P("ngModel",r.storeService.paperSource()),y(),Jt(r.storeService.paperConfig().PaperFormats),y(4),I(r.tooltip.paperWidth),y(6),P("maskito",r.options)("ngModel",r.paperWidth()),y(3),I(r.tooltip.paperWidth),y(6),P("maskito",r.options)("ngModel",r.stickerWidth()),y(3),I(r.tooltip.stickerWidth),y(6),P("maskito",r.options)("ngModel",r.stickerHeight()),y(3),I(r.tooltip.stickerHeight),y(6),P("maskito",r.options)("ngModel",r.barcodeHeight()),y(3),I(r.tooltip.barcodeHeight),y(6),P("maskito",r.options)("ngModel",r.fontSize()),y(3),I(r.tooltip.fontSize))},dependencies:[ht,tt,it,Dt,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 sk(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.leftIndent)}}function ak(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.topIndent)}}function lk(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.rowSpacing)}}function ck(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.columnSpacing)}}var ky=(()=>{class i{constructor(){this.options=Ft,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=z(ke),this.destroyRef=z(Ye),this.injector=z(Xe)}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(){pt(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:[_e],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),W("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),W("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),W("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),W("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"columnSpacing"))}),m()(),f(35,"td")(36,"span",7),x(37),m()()()()(),le(38,sk,2,1,"ng-template",null,0,me)(40,ak,2,1,"ng-template",null,1,me)(42,lk,2,1,"ng-template",null,2,me)(44,ck,2,1,"ng-template",null,3,me)}n&2&&(y(7),P("maskito",r.options)("ngModel",r.leftIndent()),y(3),I(r.tooltip.leftIndent),y(6),P("maskito",r.options)("ngModel",r.topIndent()),y(3),I(r.tooltip.topIndent),y(6),P("maskito",r.options)("ngModel",r.rowSpacing()),y(3),I(r.tooltip.rowSpacing),y(6),P("maskito",r.options)("ngModel",r.columnSpacing()),y(3),I(r.tooltip.columnSpacing))},dependencies:[ht,tt,it,Dt,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 dk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.basicPriceLabel)}}function uk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.promotionPriceLabel)}}var Ty=(()=>{class i{constructor(){this.tooltip={basicPriceLabel:"Custom label normal price",promotionPriceLabel:"Custom label promotion price"},this.storeService=z(ke),this.destroyRef=z(Ye),this.injector=z(Xe),this.basicPriceLabel=q(""),this.promotionPriceLabel=q(""),this.options=Ft}ngOnInit(){pt(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:[_e],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),W("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),W("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"promotionPriceLabel"))}),m()(),f(17,"td")(18,"span",5),x(19),m()()()()(),le(20,dk,2,1,"ng-template",null,0,me)(22,uk,2,1,"ng-template",null,1,me)}n&2&&(y(7),P("ngModel",r.basicPriceLabel()),y(3),I(r.tooltip.basicPriceLabel),y(6),P("ngModel",r.promotionPriceLabel()),y(3),I(r.tooltip.promotionPriceLabel))},dependencies:[ht,tt,it,Dt,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 Fy=De(Iy());function pk(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),W("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),P("maskito",t.options)("ngModel",t.pricebookFontSize()),y(3),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.pricebookFontSize)}}function fk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}var Oy=(()=>{class i{constructor(){this.options=Ft,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=z(ke),this.injector=z(Xe),this.destroyRef=z(Ye)}ngOnInit(){pt(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:[_e],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"),le(2,pk,9,3,"tr"),f(3,"tr")(4,"td")(5,"label",3),x(6,"Font Size"),m()(),f(7,"td")(8,"input",4),W("ngModelChange",function(a){return se(o),ae(r.onInputHandler(a,"fontSize"))}),m()(),f(9,"td")(10,"span",5),x(11),m()()()()(),le(12,hk,2,1,"ng-template",null,0,me)(14,fk,2,1,"ng-template",null,1,me)}n&2&&(y(2),Ce(r.storeService.paperConfiguration().PricebookVisible?2:-1),y(6),P("maskito",r.options)("ngModel",r.fontSize()),y(3),I(r.tooltip.fontSize))},dependencies:[Ji,ri,ht,tt,it,Dt],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 mk(i,e){i&1&&(f(0,"button",14)(1,"span",13),x(2,"Next"),m(),ue(3,"i",33),m())}function gk(i,e){if(i&1){let t=Ie();f(0,"button",34),W("click",function(){se(t);let r=O();return ae(r.printBarcode())}),f(1,"span",13),x(2,"Print"),m()()}}var Ry=(()=>{class i{constructor(){this.storeService=z(ke),this.httpService=z(bi),this.toastr=z(Ts),this.destroyRef=z(Ye)}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,Fy.default)({printable:"barcode-container",type:"html",css:"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css",style:`
31
+ body {
32
+ font-family: Arial, Helvetica, sans-serif;
33
+ font-size: ${this.storeService.paperConfiguration().ProductNameFontSize}px;
34
+ margin: 0;
35
+ padding: 0;
36
+
37
+ }
38
+ .barcode-container {
39
+
40
+ display: grid;
41
+ grid-template-columns: repeat(${t}, ${this.storeService.paperConfiguration().StickerWidth}px);
42
+ grid-auto-rows: ${this.storeService.paperConfiguration().StickerHeight}px;
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;
46
+ }
47
+ .sticker {
48
+ border: none !important;
49
+ height: ${this.storeService.paperConfiguration().StickerHeight}px;
50
+ // margin-top: ${this.storeService.paperConfiguration().MarginTop}px;
51
+ overflow: hidden;
52
+ }
53
+ .sticker-body {
54
+ display: flex;
55
+ flex-direction: column;
56
+ justify-content: center;
57
+
58
+ }
59
+ .sticker-body div {
60
+ width: 100%;
61
+ text-align: center;
62
+ }
63
+ .sticker-body div {
64
+ line-height: 1;
65
+ width: 100%;
66
+ display: inline-flex;
67
+ justify-content: center;
68
+ }
69
+
70
+ .sticker-header canvas {
71
+ height: ${this.storeService.paperConfiguration().BarcodeHeight}px;
72
+ width: 100%;
73
+ }
74
+
75
+
76
+
77
+ #store-name-vertical {
78
+ top: 50%;
79
+ right: 5%;
80
+ transform: translate(50%, -50%) rotate(-90deg);
81
+ }
82
+
83
+ .sticker-body .price {
84
+
85
+ font-size: ${this.storeService.paperConfiguration().PriceFontSize}px !important;
86
+ }
87
+
88
+ .sticker-body .promotion__normalprice_label {
89
+ font-size: ${this.storeService.paperConfiguration().ProductNameFontSize}px !important;
90
+
91
+ }
92
+
93
+ .sticker-body .promotion__price_label {
94
+
95
+ font-size: ${this.storeService.paperConfiguration().ProductNameFontSize}px !important;
96
+ }
97
+
98
+ .sticker-body .promotion__normalprice {
99
+ text-decoration-color: red !important;
100
+ color: #000 !important;
101
+ }
102
+
103
+ .sticker-body .promotion__price {
104
+ color: #000 !important;
105
+ }
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 wp&&s.status===200&&this.toastr.success(s.body,"success")}),ll(1)).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-print-preview"]],standalone:!0,features:[_e],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),W("click",function(){return se(o),ae(r.storeService.onPrevStep())}),ue(12,"i",12),f(13,"span",13),x(14,"Back"),m()(),le(15,mk,4,0,"button",14)(16,gk,3,0,"button",15),m()()()()()(),f(17,"div",16)(18,"div",17)(19,"div",18)(20,"div",19)(21,"div",20),ue(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),ue(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),ue(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),ue(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),ue(65,"app-pp-label"),m()()()()()()()()()}n&2&&(y(),Lt("data-navbarbg",r.storeService.options().navbarbg),y(),P("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),P("ngbCollapse",!r.storeService.options().isCollapsed),Lt("data-navbarbg",r.storeService.options().navbarbg),y(12),Ce(r.storeService.stepper$().state<2?15:16),y(7),P("items",r.storeService.expandProductItems()),y(7),P("closeOthers",!0),y(),P("collapsed",!1),y(9),P("collapsed",!0),y(9),P("collapsed",!0),y(9),P("collapsed",!0))},dependencies:[_s,xs,ws,Ps,Cs,Ss,tr,Xi,$n,Dy,ky,Ty,Za,Oy],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 yk(i,e){i&1&&ue(0,"choose-product")}function vk(i,e){i&1&&ue(0,"app-customize-label")}function bk(i,e){i&1&&ue(0,"app-print-preview")}var My=(()=>{class i{constructor(){this.storeService=z(ke),this.httpService=z(bi),this.destroyRef=z(Ye),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;es([this.httpService.post("api/Config/PaperConfig",{SubDomain:n},void 0).pipe(Tr(r=>Le({error:r}))),this.httpService.get("/API/V3/Tax",void 0,`https://${n}`).pipe(Tr(r=>Le({error:r})))]).pipe(Je(this.destroyRef),hn("response"),Kt(([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:[_e],decls:3,vars:1,template:function(n,r){if(n&1&&le(0,yk,1,0,"choose-product")(1,vk,1,0,"app-customize-label")(2,bk,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:[tr,by,Ey,Ry]})}}return i})();var s6=[{path:"",children:[{path:"",component:My}]}];export{s6 as dashboardRoutes};