var OmniFaces=OmniFaces||{EVENT:"omnifaces.event",VIEW_STATE_PARAM:"javax.faces.ViewState",CLIENT_WINDOW_PARAM:"javax.faces.ClientWindow"}; OmniFaces.Util=function(d,g){function k(a,f,b,h,d){h=h.replace(/^\s+|\s+$/g,"").split(/\s+/);for(var c=0;ce||e>=k.length)){var b=k[e];d.loadScript(b.url,b.crossorigin,b.integrity,b.begin,b.success,b.error,function(){g(e+1)})}}var k=[];return{add:function(e,b,a,f,c,h){k.push({url:e,crossorigin:b,integrity:a,begin:f,success:c,error:h});1==k.length&&d.addOnloadListener(function(){g(0)})}}}(OmniFaces.Util); OmniFaces.Unload=function(d,g,k){var e,b,a={init:function(f){if(k.XMLHttpRequest){if(null==e){var c=d.getFacesForm();if(!c)return;d.addEventListener(k,"onbeforeunload"in k&&!k.onbeforeunload?"beforeunload":"onpagehide"in k?"pagehide":"unload",function(){if(b)a.reenable();else try{var d=c.action,f=OmniFaces.EVENT+"\x3dunload\x26id\x3d"+e+"\x26"+OmniFaces.VIEW_STATE_PARAM+"\x3d"+encodeURIComponent(c[OmniFaces.VIEW_STATE_PARAM].value);if(g.sendBeacon)g.sendBeacon(d,new Blob([f],{type:"application/x-www-form-urlencoded"})); else{var k=new XMLHttpRequest;k.open("POST",d,!1);k.setRequestHeader("X-Requested-With","XMLHttpRequest");k.setRequestHeader("Content-Type","application/x-www-form-urlencoded");k.send(f)}}catch(q){}});d.addSubmitListener(function(){a.disable()})}e=f;b=!1}},disable:function(){b=!0},reenable:function(){b=!1}};return a}(OmniFaces.Util,navigator,window); OmniFaces.Push=function(d,g){function k(a,b,d,f,e,k,g){var c,h,l=this;l.open=function(){c&&1==c.readyState||(c=new WebSocket(a),c.onopen=function(){null==h&&d(b);h=0},c.onmessage=function(a){var c=JSON.parse(a.data);f(c,b,a);if((a=g[c])&&a.length)for(c=0;ca){a=f.name;var c;d.mojarra&&(c=e.form.enctype,e.form.enctype="application/x-www-form-urlencoded");e.type="text";e.type="file";a={fileName:a};a[OmniFaces.EVENT]="validationFailed";jsf.ajax.request(e.id,k,a);c&&(e.form.enctype=c);return!1}}return!0}}}(window,document); OmniFaces.Form=function(d,g){d.addOnloadListener(function(){if(g.jsf){var d=jsf.getViewState;jsf.getViewState=function(e){var b=d(e);if("true"!=e.attributes["data-partialsubmit"])return b;var a=jsf.ajax.request.arguments,f=a?a[2].execute:null;if(!f||-1!=f.indexOf("@form")||-1!=f.indexOf("@all"))return b;var c=[];-1==f.indexOf("@none")&&(c=f.replace("@this",a[0].id).split(" ").map(encodeURIComponent),c.push(encodeURIComponent(e.id)));c.push(OmniFaces.VIEW_STATE_PARAM);c.push(OmniFaces.CLIENT_WINDOW_PARAM); var h=[];b.replace(/([^=&]+)=([^&]*)/g,function(a,b,d){-1