function Os(){this.Init()}m("AdfSessionTimeoutHelper",Os);m("AdfSessionTimeoutHelper",Os);r.v(Os);Os.bA={NONE:0,Psb:1,rca:2};m("AdfSessionTimeoutHelper.TimeoutWindowStates",Os.bA);Os.prototype.Fsa=function(){return this.TN};r.a("AdfSessionTimeoutHelper.prototype.getTimeoutWindowState",{Fsa:Os.prototype.Fsa});Os.prototype.Init=function(){Os.h.Init.call(this);this.TN=Os.bA.NONE;this.Fza="AFTimeOutGlassPane"};r.a("AdfSessionTimeoutHelper.prototype.Init",{Init:Os.prototype.Init});
Os.prototype.CT=function(a,b,d){uC(a);vC(this,a,b);this.Xk=a;this.Zk=b;this.m6=d;a=q.b;null==(a.tl()?a.Vu("oracle.adfinternal.view.rich.sessionKeysCleaned"):null)&&(this.su=A.c.ta(this,this.Lab,null,6E4),a.tl()&&a.Ns("oracle.adfinternal.view.rich.sessionKeysCleaned","scheduled"))};r.a("AdfSessionTimeoutHelper.prototype.__initializeSessionTimeoutTimer",{CT:Os.prototype.CT});
Os.prototype.iL=function(){var a=v.l;this.su&&(A.c.ic(this.su),a.ee(v.INFO)&&a.info("Cancelled session timeout warning dialog timer with id ",this.su),this.su=null);this.jj&&(A.c.ic(this.jj),a.ee(v.INFO)&&a.info("Cancelled final session timeout dialog timer with id ",this.jj),this.jj=null)};r.a("AdfSessionTimeoutHelper.prototype.__cancelSessionTimeoutTimer",{iL:Os.prototype.iL});Os.prototype.Pha=function(){uC(this.Xk);wC(this,this.Xk,this.Zk)};
r.a("AdfSessionTimeoutHelper.prototype.__startSessionTimeoutTimer",{Pha:Os.prototype.Pha});Os.prototype.SFa=function(){this.Xk=0;var a=Uj.$();if(a.fq()){var b="oracle.adfinternal.view.rich.sessionKey_"+A.c.zy();a.PZ(b)}vC(this,this.Xk,this.Zk)};r.a("AdfSessionTimeoutHelper.prototype.__alertTimeout",{SFa:Os.prototype.SFa});
Os.prototype.Dha=function(a){if("click"==a.type||"keypress"==a.type){var b=Uj.$();if(b.fq()){a=new Date;uC(this.Xk);vC(this,this.Xk,this.Zk);var d="oracle.adfinternal.view.rich.userActivityKey_"+A.c.zy();b.laa(d,a.getTime());b=v.l;b.ee(v.INFO)&&b.info("Last user activity on client for ",d," at ",a)}}};r.a("AdfSessionTimeoutHelper.prototype.__recordUserActivity",{Dha:Os.prototype.Dha});k=Os.prototype;
k.Lab=function(){var a=Uj.$();if(a.fq()){var b=(new Date).getTime(),d=a.Vra();v.l.info("Cleaning expired session info from web local storage");for(var e=0;e<d.length;e++)if(0==d[e].indexOf("oracle.adfinternal.view.rich.sessionKey_")){var f=a.aP(d[e]);36E4<b-f&&(a.PZ(d[e]),a.PZ("oracle.adfinternal.view.rich.userActivityKey_"+d[e].split("_")[1]))}a=q.b;a.tl()?a.Ns("oracle.adfinternal.view.rich.sessionKeysCleaned","complete"):v.l.info("Could not mark that we cleaned web local storage because session storage is not enabled")}};
function wC(a,b,d){var e=(new Date).getTime(),f=v.l,g=b-d;a.TN=Os.bA.NONE;0<g&&12E4<=d?(a.su=A.c.ta(a,a.Smb,null,g),f.ee(v.INFO)&&f.info("Scheduled session timeout warning dialog timer with id ",a.su," to be shown at : ",new Date(e+g))):(a.jj=A.c.ta(a,a.Nmb,null,b),f.ee(v.INFO)&&f.info("Scheduled final session timeout dialog timer with id ",a.jj," to be shown at : ",new Date(e+b)))}function vC(a,b,d){a.iL();wC(a,b,d)}
function uC(a){var b=Uj.$();if(b.fq()){a=(new Date).getTime()+a;var d="oracle.adfinternal.view.rich.sessionKey_"+A.c.zy(),e=b.aP(d);if(null==e||e<a)b.laa(d,a),b=v.l,b.ee(v.INFO)&&b.info("Web local storage for key ",d," reset to : ",new Date(a))}}
function xC(a){var b=Uj.$();if(b.fq()){var d="oracle.adfinternal.view.rich.userActivityKey_"+A.c.zy();if(b=b.aP(d))if(b=(new Date).getTime()-b,b<a)return d=v.l,d.ee(v.INFO)&&d.info("User activity on client ",b/1E3," seconds ago. Duration checked for activity ",a/1E3," seconds"),!0}return!1}function yC(){var a=Uj.$();if(a.fq()){var b="oracle.adfinternal.view.rich.sessionKey_"+A.c.zy();if(a=a.aP(b))return a-(new Date).getTime()}return null}
k.Smb=function(){var a=yC();if(a&&(a<this.Zk-2E3||a>this.Zk+2E3))return vC(this,a,this.Zk),-1;if(xC(this.Xk-this.Zk))return zC(this),-1;this.su=null;a=A.c;this.jj&&(a.ic(this.jj),this.jj=null);var b=A.c.H(),d;d=6E4<=this.Zk?b.Z("af_document.PRE_SESSION_TIMEOUT_MSG",Math.floor(this.Zk/6E4)):b.Z("af_document.PRE_SESSION_TIMEOUT_MSG_SECOND",this.Zk/1E3);b=b.Z("af_document.PRE_SESSION_TIMEOUT_CONFIRM_TITLE");null==b&&(b="Expiration Warning");var e=this.D(this.Egb);this.TN=Os.bA.rca;AC(this);this.fOa=
(new Date).getTime();a.VFa(b,d,e,this.Zk,!0);return-1};k.Egb=function(a){BC(this);this.TN=Os.bA.NONE;a.ll()==Za.Zm?zC(this):a.ll()==Za.Mo&&(a=yC(),a||(a=this.Zk-((new Date).getTime()-this.fOa),this.fOa=null),vC(this,a,this.Zk))};
k.Nmb=function(){var a=yC();if(a&&0<a&&0<a)return vC(this,a,this.Zk),-1;if(xC(this.Xk))return zC(this),-1;this.jj=null;a=A.c;this.su&&(a.ic(this.su),this.su=null);var b=a.H(),d=b.Z("af_document.POST_SESSION_TIMEOUT_MSG");this.m6&&(d+=" "+b.Z("af_document.POST_SESSION_TIMEOUT_MSG_CONTINUE"));b=b.Z("af_document.POST_SESSION_TIMEOUT_ALERT_TITLE");null==b&&(b="Window Expired");Pe.$().mO();var e=q.b.getElementById(a.fj);C.setVisible(e,!1);e=this.D(this.bgb);AC(this);this.TN=Os.bA.rca;a.RFa(b,d,e);return-1};
k.bgb=function(){BC(this);this.jj=null;var a=A.c;this.TN=Os.bA.NONE;if(this.m6)a.Y().location.replace(this.m6);else{var b=a.H().Z("af_document.POST_SESSION_TIMEOUT_MSG"),d=q.b,e=a.R().createElement("div");C.setVisible(e,!1);d.bc(e,b);d.getElementById(a.fj).parentNode.appendChild(e);C.setVisible(e,!0);a.Y().setTimeout(a.D(a.gJ),1)}};
function zC(a){var b=A.c.R().location.href,b=-1==b.indexOf("?")?b+"?":b+"\x26",b=b+("_afrTS\x3d"+(new Date).getTime()),d=new Gf;d.tI(!1);d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(b,null);d.Jp();delete d;v.l.info("Extended session lifetime");uC(a.Xk);vC(a,a.Xk,a.Zk)}function AC(a){var b=A.c.R().getElementsByTagName("body")[0];C.w(b,a.Fza)}function BC(a){var b=A.c.R().getElementsByTagName("body")[0];C.O(b,a.Fza)};