var OmniFaces=OmniFaces||{}; OmniFaces.Util=function(e,h){function k(a,c,b,g,f){g=g.replace(/^\s+|\s+$/g,"").split(/\s+/);for(var d=0;df||f>=d.length)){var a=d[f],c=h.createElement("script"),b=h.head||h.documentElement;c.async=!0;c.src=a.url;c.setAttribute("crossorigin","anonymous");c.onerror=function(){a.error()};c.onload=c.onreadystatechange=function(b,d){if(d||!c.readyState||/loaded|complete/.test(c.readyState)){c.onload=c.onreadystatechange=null;if(d)c.onerror();else a.success();c=null;k(f+1)}};a.begin();b.insertBefore(c,null)}}var d=[];return{add:function(f,a,c,b){d.push({url:f, begin:e.resolveFunction(a),success:e.resolveFunction(c),error:e.resolveFunction(b)});1==d.length&&e.addOnloadListener(function(){k(0)})}}}(OmniFaces.Util,document); OmniFaces.Unload=function(e,h,k,d){function f(){for(var a=0;aa){a=c.name;var b;e.mojarra&&(b=d.form.enctype,d.form.enctype="application/x-www-form-urlencoded");d.type="text";d.type="file";jsf.ajax.request(d.id,k,{"omnifaces.event":"validationFailed",fileName:a});b&&(d.form.enctype=b);return!1}}return!0}}}(window,document); OmniFaces.Form=function(e,h){e.addOnloadListener(function(){if(h.jsf){var e=jsf.getViewState;jsf.getViewState=function(d){var f=e(d);if("true"!=d.attributes["data-partialsubmit"])return f;var a=jsf.ajax.request.arguments?jsf.ajax.request.arguments[2].execute:null;if(!a||-1!=a.indexOf("@form")||-1!=a.indexOf("@all"))return f;var c=[];-1==a.indexOf("@none")&&(c=a.replace("@this",jsf.ajax.request.arguments[0].id).split(" ").map(encodeURIComponent),c.push(encodeURIComponent(d.id)));c.push("javax.faces.ViewState"); c.push("javax.faces.ClientWindow");var b=[];f.replace(/([^=&]+)=([^&]*)/g,function(a,d,e){-1