function dd(){this.Init()}v("AdfHtml5NavigationHistoryAgent",dd);z.l(dd,ed);dd.da=function(){this.Qpa="popstate";this.woa="hashchange"};v("AdfHtml5NavigationHistoryAgent.InitClass",dd.da);dd.prototype.Bb=function(){this.GYa&&(w.b.sa(this.Nc(),dd.Qpa,dd.tk),w.b.sa(this.Nc(),dd.woa,dd.tk))};z.a("AdfHtml5NavigationHistoryAgent.prototype.dispose",{Bb:dd.prototype.Bb});dd.prototype.Eq=function(a,b,d,e,f){a=fd(this,n,n,d,f);b=this.Nc().history;f?b.replaceState(b.state,n,a):b.pushState(n,n,a)};
z.a("AdfHtml5NavigationHistoryAgent.prototype.SetQueryStringImpl",{Eq:dd.prototype.Eq});dd.prototype.Zd=function(a){this.eI=-1;if(this.bv()){var b=this.Nc().location.href,d=this.v3();this.eI=d==n||""===d?b.lastIndexOf("/"):b.indexOf(d)+d.length;B.assert(0<=this.eI)}dd.f.Zd.call(this,a);a=w.b;a.S(this.Nc(),dd.Qpa,dd.tk);a.S(this.Nc(),dd.woa,dd.tk);this.GYa=l};z.a("AdfHtml5NavigationHistoryAgent.prototype.StartTrackingUriImpl",{Zd:dd.prototype.Zd});
dd.prototype.iq=function(a,b){var d=this.Hi();b="?"==b?n:b;if(d.id!=a||d.Qp!=b)d=fd(this,d.id,a,b,p),this.Nc().history.pushState(n,n,d)};z.a("AdfHtml5NavigationHistoryAgent.prototype.AddHistoryEntry",{iq:dd.prototype.iq});
dd.prototype.Hi=function(){var a=dd.f.Hi.call(this),b=this.Nc();if(a.fD===k){var d=n;try{d=b.history.state}catch(e){}d!=n&&(a.fD=d.vRa)}a.id=a.Qp=k;if(this.bv()){b=b.location.href;d=b.indexOf("#");0<=d&&(b=b.substring(0,d));var d=b.indexOf("?"),f="";0<=d?(f=b.substring(d),1<f.length&&(a.Qp=f),b=b.substring(this.eI,d)):b=b.substring(this.eI);d=b.indexOf(";");a.id=0<=d?b.substring(0,d):b}return a};z.a("AdfHtml5NavigationHistoryAgent.prototype.GetViewInfoFromBrowserURI",{Hi:dd.prototype.Hi});
dd.prototype.bF=function(a,b,d,e){if(this.bv()){var f=this.Hi();b=fd(this,f.id,b,d,p)}else b=this.Nc().location.href;gd(this,b,a,e)};z.a("AdfHtml5NavigationHistoryAgent.prototype.UpdateInitialValues",{bF:dd.prototype.bF});dd.prototype.Rz=function(a,b){var d="#";b!=n&&(d+=encodeURIComponent(b));var e=this.Nc(),f=e.history.state;e.location.replace(d);!a.e2&&a.fD!=n&&this.nt(a.fD,k,k,b,l);f!=n&&e.history.replaceState(f,n)};z.a("AdfHtml5NavigationHistoryAgent.prototype.NavigateToSavedAnchorImpl",{Rz:dd.prototype.Rz});
dd.prototype.QE=function(a,b,d,e){b=this.Nc().location.href;gd(this,b,a,e)};z.a("AdfHtml5NavigationHistoryAgent.prototype.RestoreValuesAfterAnchorNavigation",{QE:dd.prototype.QE});dd.prototype.$z=t(p);z.a("AdfHtml5NavigationHistoryAgent.prototype.UsesHashForTrackingNavigation",{$z:dd.prototype.$z});
function gd(a,b,d,e){var f=b.indexOf("#");0<=f&&(b=b.substring(0,f));f=n;d!=n&&(f={},f.vRa=d);var g=a.Nc().history;g.replaceState(f,n,b);d!=n&&g.state==n?a.nt(d,k,k,e,l):e!=n&&g.replaceState(f,n,b+"#"+encodeURIComponent(e))}function fd(a,b,d,e,f){var g=a.Nc().location.href,h="",m=g.indexOf("#");0<=m&&(h=g.substring(m),g=g.substring(0,m));m=g.indexOf("?");0<=m&&(g=g.substring(0,m));d!=n&&b!==d&&(g=g.substring(0,a.eI)+d+g.substring(a.eI+b.length));e!=n&&"?"!=e&&(g+=e);f&&(g+=h);return g}dd.tk=function(){ed.O().so()};