define(["core","jquery"],function(a,b){return a.create_module("timeOutLightBox",function(e){var d,c=e.getContainer(); return{el:{continueButton:false,newSearchLink:false},options:{isTimeoutTryAgain:false,lightBoxNewSearchURL:false,lightBoxTryAgainURL:false},events:{"click continueButton":"handleContinueButton"},lightbox:false,init:function(){d=this; d.updateOptions();e.listen({"show-timeOutLightBox":d.view.showLightBox,"hide-timeOutLightBox":d.view.hideLightBox}); e.library({name:"lightBox"},e);d.initLibraryFunctions();},initLibraryFunctions:function(){e.library({name:"lightBox"},e); d.lightbox=d.library.lightBox.init(c);},bindElements:function(){d.el.continueButton=b(".continueBtn",c); d.el.newSearchLink=b(".jsNewSearch",c);e.bindElementEvents(d);},updateOptions:function(){d.options.isTimeoutTryAgain=e.getNestedProperty("settings.timeoutTryAgain.isTimeoutTryAgain"); d.options.lightBoxNewSearchURL=e.getNestedProperty("settings.timeoutTryAgain.lightBoxNewSearchURL"); d.options.lightBoxTryAgainURL=e.getNestedProperty("settings.timeoutTryAgain.lightBoxTryAgainURL"); },handleContinueButton:function(){window.onbeforeunload=null;window.location.href=d.options.lightBoxTryAgainURL; },view:{showLightBox:function(){d.lightbox.open();d.bindElements();d.view.updateNewSearchLink(); },hideLightBox:function(){e.addClass(c,"hide");},updateNewSearchLink:function(){var f=d.options.lightBoxNewSearchURL; d.el.newSearchLink.attr("href",f);return f;}},destroy:function(){d=null;}};});});