function Ln(a,b,d){this.Init(a,b,d)}v("AdfFileUploadUtils",Ln);z.l(Ln,Pc);
Ln.da=function(){this.zna="dc";this.Ana="df";this.TPa="f";this.cM="maximumFiles";this.xLa="_afrChunkSize";this.NIa="_afrCookies";this.QGa="_afrAuthorization";this.BF="none";this.kV="inline";this.A7="visible";this.lV="hidden";this.Lq="display";this.eA="visibility";this.lU="overflowY";this.I6="org.apache.myfaces.trinidad.UploadedFiles";this.eMa="X-Trinidad-chunkNum";this.cMa="X-Trinidad-chunkCount";this.dMa="X-Trinidad-chunkFilename";this.bMa="multipart/form-data";this.y6a="application/x-www-form-urlencoded; charset\x3dUTF-8";
this.yw="_afrInputFileFrame";this.fMa="org.apache.myfaces.trinidad.UploadedFiles.FileProperty"};v("AdfFileUploadUtils.InitClass",Ln.da);
Ln.prototype.Init=function(a,b,d){Ln.f.Init.call(this);this.on="undefined"!=typeof File?l:p;w.b.slice()===k?this.$F=p:this.$F=l;this.Oj="undefined"!=typeof FormData?l:p;this.Ir=!("draggable"in d)||!this.Oj||!this.$F?p:l;this.uxa=b.r(Ln.xLa);this.fP=b.r(Ln.cM);this.j8a=b.r(Ln.NIa);this.b8a=b.r(Ln.QGa);this.mb=a;this.xj=b.e();this.Td=[];this.gh=[];this.cI=[];this.uB=n;this.qya=[];this.EN=[]};z.a("AdfFileUploadUtils.prototype.Init",{Init:Ln.prototype.Init});
Ln.prototype.addEventListener=function(a,b,d){a==Pc.Lg?(this.XA||(this.XA=[]),this.XA.push({ak:b,gs:d})):a==Pc.Os?(this.VA||(this.VA=[]),this.VA.push({ak:b,gs:d})):a==Pc.Kg&&(this.WA||(this.WA=[]),this.WA.push({ak:b,gs:d}))};z.a("AdfFileUploadUtils.prototype.addEventListener",{addEventListener:Ln.prototype.addEventListener});
Ln.prototype.kp=function(a){var b=w.b;if(this.Oj&&this.on&&a instanceof File){var d=Ln.qO(a.name);uB(this,d,a.size,a)}else if(a.nodeType!=n&&"INPUT"==a.nodeName){d=p;if(this.Oj&&this.on){for(var e=a.files,f=0;f<e.length;f++)d=Ln.qO(e[f].name),uB(this,d,e[f].size,e[f]);b=b.getAttribute(a,"id");b!=n&&(b==this.Al||b==this.x$)&&1<e.length?Mn(this,a):this.EN[Ln.qO(e[0].name)]=a;d=l}d||(d=Ln.qO(a.value),b=n,this.on&&(b=a.files[0].size),uB(this,d,b,a),this.Al!=n?(this.Q9++,vB(this,a)):this.EN[Ln.qO(a.value)]=
a)}};z.a("AdfFileUploadUtils.prototype.addFileToQueue",{kp:Ln.prototype.kp});Ln.prototype.xea=function(a){this.uB=a.Vj();this.Td.push(a);wB(this)};z.a("AdfFileUploadUtils.prototype.addFileUploadQueueItem",{xea:Ln.prototype.xea});Ln.prototype.yea=function(a){this.uB=a.Vj();this.gh.push(a);wB(this)};z.a("AdfFileUploadUtils.prototype.addFileUploadResultItem",{yea:Ln.prototype.yea});Ln.prototype.qC=function(a){this.SH=l;this.Vx(a);this.cI=[]};z.a("AdfFileUploadUtils.prototype.cancelAllUploads",{qC:Ln.prototype.qC});
Ln.prototype.Vx=function(a){this.jN=l;var b=this.SH;this.on?this.$ta.R_()!=n&&this.$ta.R_().abort():w.b.G()==w.aa?F.c.R().document.execCommand("Stop"):F.c.R().stop();if(a){a=n;if(this.yN!=n){var d;for(d=0;d<this.Td.length;d++)if(this.Td[d].Vj()==this.yN){a=this.Td[d];break}}b?xB(this,Pc.Lg,new Fb(yB(this),Pc.Lg,Pc.lq,Pc.pT,a,100,Pc.jj)):xB(this,Pc.Lg,new Fb(yB(this),Pc.Lg,Pc.lq,Pc.po,a,100,Pc.jj));zB(this,l)}};z.a("AdfFileUploadUtils.prototype.cancelCurrentUpload",{Vx:Ln.prototype.Vx});
Ln.prototype.Zx=function(a){this.Qca(a)};z.a("AdfFileUploadUtils.prototype.deleteFileFromQueue",{Zx:Ln.prototype.Zx});Ln.prototype.zC=function(a){var b=this.xj,d=[];d[Ln.I6]="multipleDelete";d.itemName=b;d.fileName=a;this.yN=AB(this,a).Vj();this.aua=Pc.zq;BB(this,n,n,d,n)};z.a("AdfFileUploadUtils.prototype.deleteUploadedFile",{zC:Ln.prototype.zC});Ln.prototype.Ku=function(){wB(this);return this.kea};z.a("AdfFileUploadUtils.prototype.getFileUploadQueue",{Ku:Ln.prototype.Ku});
Ln.prototype.zp=function(){wB(this);return this.lea};z.a("AdfFileUploadUtils.prototype.getFileUploadResults",{zp:Ln.prototype.zp});Ln.prototype.od=r("kG");z.a("AdfFileUploadUtils.prototype.isBusy",{od:Ln.prototype.od});Ln.prototype.load=function(a){var b=w.b,d=this.mb,e=yB(this);if(this.dC=a)this.Al=this.dC.X3a,this.UN=this.dC.U2a,this.x$=this.dC.G9a;CB(this);this.NN||(this.NN=function(a){d.tE(e,a)});this.Al&&(this.Oj?(a=b.getElementById(this.Al),b.S(a,"change",this.NN)):DB(this,this.Al))};
z.a("AdfFileUploadUtils.prototype.load",{load:Ln.prototype.load});Ln.prototype.hja=ca();z.a("AdfFileUploadUtils.prototype.unload",{hja:Ln.prototype.hja});Ln.prototype.removeEventListener=function(a,b,d){var e=n;a==Pc.Lg?e=this.XA:a==Pc.Os?e=this.VA:a==Pc.Kg&&(e=this.WA);if(e)for(a=e.length-1;0<=a;a--)e[a].ak===b&&e[a].gs===d&&e.splice(a,1)};z.a("AdfFileUploadUtils.prototype.removeEventListener",{removeEventListener:Ln.prototype.removeEventListener});
Ln.prototype.AD=function(a){this.kG?this.cI.push(a):this.gp(a)};z.a("AdfFileUploadUtils.prototype.uploadFileFromQueue",{AD:Ln.prototype.AD});Ln.prototype.oD=function(a,b,d){for(var e=0;e<this.Td.length;e++)if(a==this.Td[e].hf()){this.Td[e].setProperty(b,d);break}};z.a("AdfFileUploadUtils.prototype.setFileProperty",{oD:Ln.prototype.oD});Ln.prototype.eK=function(){this.kG||this.gp()};z.a("AdfFileUploadUtils.prototype.uploadAllFilesFromQueue",{eK:Ln.prototype.eK});
function uB(a,b,d,e){var f=a.mb,g=yB(a),h;a:{var m=a.mb,q=yB(a);h=F.c.u();for(var s=n,s=0;s<a.Td.length;s++)if(a.Td[s].hf()==b){m=h.V("af_inputFile.MSG_UPLOAD_DUPLICATE_FILENAME_ERROR");h=h.V("af_inputFile.MSG_UPLOAD_DUPLICATE_FILENAME_ERROR_DETAIL");s=new Ea(Ea.Ef,m,h);xB(a,Pc.Kg,new Fb(yB(a),Pc.Kg,Pc.Nv,Pc.Sz,n,0,Pc.CK,s));h=p;break a}for(s=0;s<a.gh.length;s++)if(a.gh[s].hf()==b){m=h.V("af_inputFile.MSG_UPLOAD_DUPLICATE_FILENAME_ERROR");h=h.V("af_inputFile.MSG_UPLOAD_DUPLICATE_FILENAME_ERROR_DETAIL");
s=new Ea(Ea.Ef,m,h);xB(a,Pc.Kg,new Fb(yB(a),Pc.Kg,Pc.Nv,Pc.Sz,n,0,Pc.CK,s));h=p;break a}Jn(m,q,b);h=l}if(h&&g.getValid()){if(d!=n&&(h=EB(a,d),!h||!g.getValid()))return;h=k;h==n?(a.uB==n?a.uB=0:a.uB++,h=a.uB):a.uB=k;d=new Pc.j3(h,b,d,e);a.Td.push(d);wB(a);xB(a,Pc.Kg,new Fb(yB(a),Pc.Kg,Pc.Nv,Pc.Sz,d,100,Pc.jj));"auto"==f.nQ&&(a.kG||Hn(f,g,b))}}u=Ln.prototype;
u.LV=function(a){this.FG(a.Vj())||(this.gh.push(a),wB(this),xB(this,Pc.Lg,new Fb(yB(this),Pc.Lg,Pc.lq,Pc.kt,a,100,Pc.jj)),a.Nx&&xB(this,Pc.Os,new Fb(yB(this),Pc.Os,Pc.lq,Pc.kt,a,100,Pc.jj)))};
function vB(a,b){var d=w.b,e=a.xj;yB(a);var f=d.getAttribute(b,"id"),g=M.g(e,Ln.Ana)+a.Q9,g=Ln.uva(g),h=Ln.P$();d.sa(b,"change",a.NN);for(var h=h.createElement(b.nodeName),m=0;m<b.attributes.length;m++){var q=b.attributes[m];"value"!=q.name&&d.hasAttribute(b,q)&&d.setAttribute(h,q.name,q.value)}m=M.g(e,Ln.zna)+a.Q9;d.setAttribute(b,"id",m);d.setAttribute(h,"id",f);d.setAttribute(h,"name",e);g.appendChild(h);w.b.G()==w.aa&&(h.contentEditable="false");d.S(h,"change",a.NN);d.wa(b);d.wa(h);b.style.visibility=
"hidden";b.style.position="absolute";return h}function FB(a){a.Gua==n&&(a.Gua=F.c.yf(p,p,l));return a.Gua}function yB(a){var b=a.mb.d();return b!=n?b:F.c.j(a.xj)}function AB(a,b){for(var d=0;d<a.Td.length;d++)if(a.Td[d].hf()==b)return a.Td[d];for(d=0;d<a.gh.length;d++)if(a.gh[d].hf()==b)return a.gh[d];return n}function Sn(a){return a.Td.length+a.gh.length}u.FG=function(a){for(var b=0;b<this.gh.length;b++)if(this.gh[b].Vj()==a)return this.gh[b];return n};
u.zO=function(){var a=w.b,b=this.xj;if(this.Al)if(b=M.g(b,this.Al),b=a.getElementById(b),this.Oj&&this.on){a=b.files;for(b=0;b<a.length;b++)this.kp(a[b])}else b=a.getElementById(this.Al),this.kp(b)};
function DB(a,b){var d=w.b,e=d.getElementById(Ln.yw);if(!e){var f=d.getElementById(b),e=F.c.w().createElement("iframe");d.setAttribute(e,"name",Ln.yw);d.setAttribute(e,"id",Ln.yw);d.setAttribute(e,"scrolling","No");d.setAttribute(e,"frameborder",0);d.setAttribute(e,"hspace",0);d.setAttribute(e,"vspace",0);var g=e.style;g.width=f.offsetWidth+"px";g.height=f.offsetHeight+"px";g.position="relative";f.parentNode.appendChild(e);d.wa(e);a.xXa=setInterval(function(){var b=Ln.P$();if("complete"==b.readyState){var e=
b.getElementsByTagName("body");e!=n&&(e[0].style.margin="0px",e[0].style.padding="0px",e[0].style.border="none",e[0].style.position="relative",a.Q9=0,d.S(b,"keypress",function(b){var e=d.vi(component,b,n);a.zb(e);d.va(b)}),f=vB(a,f),clearInterval(a.xXa),xB(a,Pc.Kg,new Fb(yB(a),Pc.Kg,Pc.Aka,Pc.Ela,n,100,Pc.jj)))}},500)}}
function CB(a){var b=w.b,d=a.mb,e=yB(a);a.dC&&(a.Al=a.dC.X3a,a.UN=a.dC.U2a);if(a.Ir&&a.UN){a.rua||(a.rua=function(a){d.L3(e,a)});var f=b.getElementById(a.UN);b.S(f,"drop",a.rua);f.style.display="inline"}else!a.Ir&&a.UN&&(w.b.getElementById(a.UN).style.display="none",a.x$&&(a.Al=a.x$,a.Tua||(a.Tua=b.getElementById(a.Al),a.Tua.style.display="inline",DB(a,a.Al))))}
function xB(a,b,d){if(b==Pc.Lg){if(a.XA)for(b=0;b<a.XA.length;b++){var e=a.XA[b].ak,f=a.XA[b].gs;f!=n?e.call(f,d):e.call(a,d)}}else if(b==Pc.Os){if(a.VA){if(d.Yj()!=n&&100==Number(d.Yj())){if(a.qya[d.Rk().Vj()])return;a.qya[d.Rk().Vj()]=l}for(b=0;b<a.VA.length;b++)e=a.VA[b].ak,f=a.VA[b].gs,f!=n?e.call(f,d):e.call(a,d)}}else if(b==Pc.Kg&&a.WA)for(b=0;b<a.WA.length;b++)e=a.WA[b].ak,f=a.WA[b].gs,f!=n?e.call(f,d):e.call(a,d)}
function wB(a){var b=a.Td;a.kea==n?a.kea=new function(){this.length=b.length;this.item=function(a){return b[a]}}:a.kea.length=b.length;var d=a.gh;a.lea==n?a.lea=new function(){this.length=d.length;this.item=function(a){return d[a]}}:a.lea.length=d.length}
u.Qca=function(a){for(var b=0;b<this.Td.length;b++)if(a==this.Td[b].hf()){var d=this.Td[b];this.Td.splice(b,1);wB(this);xB(this,Pc.Kg,new Fb(yB(this),Pc.Kg,Pc.Nv,Pc.zq,d,100,Pc.jj));break}for(b=0;b<this.gh.length;b++)if(a==this.gh[b].hf()){this.gh.splice(b,1);wB(this);break}};function GB(a){var b=a.IAa;if(b){for(;b.firstChild;)b.removeChild(b.firstChild);b.parentNode.removeChild(b);a.IAa=n}}
function HB(a){for(var b=a.zp(),d=p,e=b.length,f=0;f<e;f++)if(!b.item(f).Nx){d=l;break}a.mb.ZM&&(0<e&&!d)&&Hf.v(yB(a))}function Mn(a,b){var d=w.b;d.setAttribute(b,"value","");for(var e=F.c.w().createElement(b.nodeName),f=0;f<b.attributes.length;f++){var g=b.attributes[f];"value"!=g.name&&d.hasAttribute(b,g)&&d.setAttribute(e,g.name,g.value)}e.onchange=b.onchange;a.Al&&d.S(e,"change",a.NN);if(f=b.parentNode)f.removeChild(b),f.appendChild(e);d.gc(b);d.wa(e)}
function zB(a,b){a.jN=p;a.kG=p;a.SH=p;b&&(a.Bj=n)}
function BB(a,b,d,e,f){var g=yB(a),h=a.xj,m=U.W(g),q=F.c,s=R.TU.start(),y=ya.qb({},q.jW),g={};g.aBa=y;g.Pra=s;g.QDa=n;g.BBa=m.id;s=q.w().forms[0];m=FB(a);q=Eq(q,s);s=s[R.xt];s!=n&&(e[R.xt]=s.value);s=n;s={Qn:function(b){if(b.Ld()==Se.xm){var d=b.Ep();b=a.yN;var e=a.aua;a.Oj||GB(a);if(200==d)if(e==Pc.kt)b=p,a.Bj?a.cxa&&(b=l,a.Bj=n):b=l,zB(a,p),b?(b=a.Td.shift(),b.sEa(l),a.LV(b),a.mea?0<a.cI.length?a.gp(a.cI.shift()):HB(a):a.gp()):a.gp();else{if(e==Pc.zq){zB(a,l);for(d=0;d<a.gh.length;d++)if(a.gh[d].Vj()==
b){b=a.gh[d];a.gh.splice(d,1);wB(a);xB(a,Pc.Lg,new Fb(yB(a),Pc.Lg,Pc.lq,Pc.zq,b,100,Pc.jj));break}}}else a.jN&&!a.SH?(zB(a,l),b!=n&&(b=a.Td.shift(),xB(a,Pc.Lg,new Fb(yB(a),Pc.Lg,Pc.lq,Pc.po,b,100,Pc.jj)),a.mea?0<a.cI.length&&a.gp(a.cI.shift()):a.gp())):(zB(a,l),e==Pc.kt&&(b=a.Td[0],b.sEa(p),a.LV(b),a.SH?xB(a,Pc.Lg,new Fb(yB(a),Pc.Lg,Pc.lq,Pc.pT,b,100,Pc.jj)):a.gp()))}}};if(a.on&&a.Oj){var h=new FormData,A;for(A in e)"clientId"!=A&&e.hasOwnProperty(A)&&h.append(A,e[A]);h.append(e.clientId,b);s=m.Wp(g,
q,d,h,n,[s],f)}else{f=n;if(b)for(;b.parentNode!=n;){f=b.parentNode;if(f.nodeType!=n&&"FORM"==f.nodeName)break;b=b.parentNode}else b=M.g(h,Ln.TPa),f=Ln.uva(b);for(A in e)if("clientId"==A){delete e[A];break}a.IAa=f;s=m.Wp(g,q,d,f,e,[s],n)}a.$ta=s}
u.gp=function(a){var b=w.b,d=this.xj;this.jN=p;if(0<this.Td.length){this.kG=l;this.aua=Pc.kt;var e={},f={};e.clientId=d;e[Ln.I6]="multipleAdd";var g=p,h=n;if(a){this.mea=l;for(var m=0;m<this.Td.length;m++)if(this.Td[m].hf()==a){h=this.Td[m];break}}else this.mea=p,h=this.Td[0];e[Ln.fMa+":"+d+":"+h.hf()]=Ln.WYa(h.jJ());a=h.getData();if(this.Oj&&this.on&&(xB(this,Pc.Lg,new Fb(yB(this),Pc.Lg,Pc.lq,Pc.kt,h,0,Pc.f3)),a.size>this.uxa&&this.$F)){var g=l,m=this.uxa,q=Math.ceil(a.size/m);e[Ln.I6]="multipleAddChunk";
e.itemName=d;d=n;this.Bj==n&&(this.Bj=0);this.Bj<q&&(this.Bj==q-1?(d=b.slice(a,this.Bj*m,this.Bj*m+((this.Bj+1)*m-a.size)),this.cxa=l):(d=b.slice(a,this.Bj*m,(this.Bj+1)*m),this.cxa=p),f[Ln.eMa]=this.Bj,f[Ln.cMa]=q,f[Ln.dMa]=a.name,BB(this,d,f,e,["progress",Ln.EAa(this,h.hf(),this.Bj,q)]),this.Bj++)}g||(this.Bj=n,BB(this,a,n,e,["progress",Ln.EAa(this,h.hf())]));this.yN=h.Vj();this.EN[h.hf()]!=n&&(Mn(this,this.EN[h.hf()]),this.EN[h.hf()]=n)}else this.kG=p,HB(this),this.Oj||GB(this)};
function EB(a,b){var d=F.c.u(),e=yB(a);if(b){for(var f=parseInt(b),g=0;g<a.Td.length;g++)f+=parseInt(a.Td[g].Yfa());if(!Ln.oja(e,b,f,function(b){xB(a,Pc.Kg,new Fb(e,Pc.Kg,Pc.Nv,Pc.Sz,n,0,Pc.CK,b))}))return p}return Sn(a)>a.fP-1&&0<a.fP?(f=d.V("af_inputFile.MSG_UPLOAD_MAXIMUM_FILES_ERROR"),d=d.V("af_inputFile.MSG_UPLOAD_MAXIMUM_FILES_ERROR_DETAIL"),facesMessage=new Ea(Ea.Ef,f,d),xB(a,Pc.Kg,new Fb(yB(a),Pc.Kg,Pc.Nv,Pc.Sz,n,0,Pc.CK,facesMessage)),p):l}
Ln.ova=function(a){for(var b=w.b,d=F.c.w(),e=0;e<d.styleSheets.length;e++){var f=d.styleSheets[e];if(b.G()==w.aa)for(var f=f.rules,g=0;g<f.length;g++){var h=f.item(g);if(h.selectorText.substr(1,a.length)==a)return"."+a+" { "+h.style.cssText+"; } "}else{f=f.cssRules;for(g=0;g<f.length;g++)if(h=f[g],h.cssText.substr(1,a.length)==a)return h.cssText}}};Ln.qO=function(a){return-1<a.indexOf("/")?a.substring(a.lastIndexOf("/")+1,a.length):a.substring(a.lastIndexOf("\\")+1,a.length)};
Ln.P$=function(){var a=w.b.getElementById(Ln.yw);if(!a)return n;a=a.contentWindow||a.contentDocument;a.document&&(a=a.document);return a};
Ln.uva=function(a){var b=Ln.bMa,d=w.b,e=F.c,f=Ln.P$();f||(f=e.w());for(var g=n,h=f.getElementsByTagName("form"),m=0;m<h.length;m++)d.getAttribute(h[m],"id")==a&&(g=h[m]);g||(g=f.createElement("form"),f.getElementsByTagName("body")[0].appendChild(g),d.setAttribute(g,"id",a),g.encoding=b,a=e.w().forms[0].action,g.action=a,g.target=Ln.yw,g.style.position="absolute",g.style.top="0px",g.style.left="0px");return g};
Ln.Dva=function(a){var b=n;try{b=a.getParent()}catch(d){}if(b==n)return n;for(;b!=n;){if(b instanceof AdfRichPopup)return b;try{b=b.getParent()}catch(e){return p}if(b==n)return p}};Ln.RO=function(a){a=Ln.Dva(a);return a==n?n:a==p?p:l};Ln.WYa=function(a){var b=w.b;this.sxa==n&&(this.sxa=Ue.getDefault());var d=[],e;for(e in a)a.hasOwnProperty(e)&&(d.push(e),d.push(a[e]));a=b.Bu();e=a.createElement("TEMP");b.G()==w.aa?a.documentElement=e:a.appendChild(e);d=this.sxa.Jy(e,d,n);return b.Pu(d)};
Ln.EAa=function(a,b,d,e){return function(f){if(f.lengthComputable){f=f.loaded/f.total;f*=100;e&&(f=f/e+100*d/e);f=Math.round(f);var g=AB(a,b);xB(a,Pc.Os,new Fb(yB(a),Pc.Os,Pc.lq,Pc.kt,g,f,Pc.Bka))}}};
Ln.oja=function(a,b,d,e){var f;f=F.c.u();var g=a.r(L.zLa),h=a.r(L.yLa),m=n,q=n;b+""==d+""&&(m="af_inputFile.MSG_SELECTED_FILE_TOO_LARGE_ERROR",q="af_inputFile.MSG_SELECTED_FILE_TOO_LARGE_ERROR_DETAIL");if(b>g&&0<g){if(!m||L.ox(a))m="af_inputFile.MSG_UPLOAD_MAXIMUM_FILE_SIZE_ERROR",q="af_inputFile.MSG_UPLOAD_MAXIMUM_FILE_SIZE_ERROR_DETAIL";b=f.V(m);f=f.V(q);f=new Ea(Ea.Ef,b,f);e(f);a.setProperty("valid",p);return p}if(d>h){if(!m||L.ox(a))m="af_inputFile.MSG_UPLOAD_MAXIMUM_DISKSPACE_ERROR",q="af_inputFile.MSG_UPLOAD_MAXIMUM_DISKSPACE_ERROR_DETAIL";
b=f.V(m);f=f.V(q);f=new Ea(Ea.Ef,b,f);e(f);a.setProperty("valid",p);return p}return l};v("AdfFileUploadUtils.validateMaxFileSizeMaxDiskSpace",Ln.oja);