function Ge(a,b,d,e,f){this.Init(a,b,d,e,f)}v("AdfMatchMediaBehavior",Ge);z.l(Ge,Da);Ge.Q7="adfinternal.matchMedia.unmatchedPropertyKey";Ge.LU="adfinternal.matchMedia.mediaQueryListeners";Ge.wxa=function(a){var b=F.c.Ge(Ge.LU)[a.media];b&&0<b.length&&b.forEach(function(b){try{b.ak.call(b.gs,a)}catch(e){D.i.fv(e,"Failed while calling mediaQuery change handler")}})};
Ge.prototype.Init=function(a,b,d,e,f){Ge.f.Init.call(this);B.s(a);B.s(b);B.s(d);this.vf=a;this.txa=b;this.Oxa=a=window.matchMedia(d);this.Jba=a.media;this.wQ=e;this.bZa="true"===f};z.a("AdfMatchMediaBehavior.prototype.Init",{Init:Ge.prototype.Init});
Ge.prototype.za=function(a){this.ab=a;a=this.ab.e()+":"+this.vf;var b=page.Ge(Ge.Q7);this.wQ!=n&&(b==n&&(b=[]),b[a]==n&&(b[a]=this.wQ),b[a]!=n&&this.bZa&&(b[a]=this.wQ),page.Pf(Ge.Q7,b));(a=page.Ge(Ge.LU))||(a={});var b=this.Oxa,d=a[this.Jba];!d||d&&0==d.length?(b.addListener(Ge.wxa),d=[{gs:this,ak:this.Nva,x4a:b}],a[this.Jba]=d,page.Pf(Ge.LU,a)):d.push({gs:this,ak:this.Nva,x4a:b})};z.a("AdfMatchMediaBehavior.prototype.initialize",{za:Ge.prototype.za});
Ge.prototype.Nva=function(a){var b=this.ab.e()+":"+this.vf;this.wQ=page.Ge(Ge.Q7)[b];a.matches?this.ab.setProperty(this.vf,this.txa):this.ab.r(this.vf)==this.txa&&this.ab.setProperty(this.vf,this.wQ)};Ge.prototype.ud=function(){var a=page.Ge(Ge.LU)[this.Jba];if(a&&0<a.length){for(var b=0;b<a.length&&a[b].gs!=this;b++);1==a.length&&this.Oxa.removeListener(Ge.wxa);a.splice(b,1)}};z.a("AdfMatchMediaBehavior.prototype.destroy",{ud:Ge.prototype.ud});