// History
!function(t,i){"function"==typeof define&&define.amd?define("pnotify.history",["jquery","pnotify"],i):"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("jquery"),require("./pnotify")):i(t.jQuery,t.PNotify)}("undefined"!=typeof window?window:this,function(t,i){var e,o;return t(function(){t("body").on("pnotify.history-all",function(){t.each(i.notices,function(){this.modules.history.inHistory&&(this.elem.is(":visible")?this.options.hide&&this.queueRemove():this.open&&this.open())})}).on("pnotify.history-last",function(){var t,e="top"===i.prototype.options.stack.push,o=e?0:-1;do{if(t=-1===o?i.notices.slice(o):i.notices.slice(o,o+1),!t[0])return!1;o=e?o+1:o-1}while(!t[0].modules.history.inHistory||t[0].elem.is(":visible"));t[0].open&&t[0].open()})}),i.prototype.options.history={history:!0,menu:!1,fixed:!0,maxonscreen:1/0,labels:{redisplay:"Redisplay",all:"All",last:"Last"}},i.prototype.modules.history={init:function(i,n){if(i.options.destroy=!1,this.inHistory=n.history,n.menu&&void 0===e){e=t("<div />",{class:"ui-pnotify-history-container "+i.styles.hi_menu,mouseleave:function(){e.css("top","-"+o+"px")}}).append(t("<div />",{class:"ui-pnotify-history-header",text:n.labels.redisplay})).append(t("<button />",{class:"ui-pnotify-history-all "+i.styles.hi_btn,text:n.labels.all,mouseenter:function(){t(this).addClass(i.styles.hi_btnhov)},mouseleave:function(){t(this).removeClass(i.styles.hi_btnhov)},click:function(){return t(this).trigger("pnotify.history-all"),!1}})).append(t("<button />",{class:"ui-pnotify-history-last "+i.styles.hi_btn,text:n.labels.last,mouseenter:function(){t(this).addClass(i.styles.hi_btnhov)},mouseleave:function(){t(this).removeClass(i.styles.hi_btnhov)},click:function(){return t(this).trigger("pnotify.history-last"),!1}})).appendTo("body");var s=t("<span />",{class:"ui-pnotify-history-pulldown "+i.styles.hi_hnd,mouseenter:function(){e.css("top","0")}}).appendTo(e);o=s.offset().top+2,e.css("top","-"+o+"px"),n.fixed&&e.addClass("ui-pnotify-history-fixed")}},update:function(t,i){this.inHistory=i.history,i.fixed&&e?e.addClass("ui-pnotify-history-fixed"):e&&e.removeClass("ui-pnotify-history-fixed")},beforeOpen:function(e,o){if(i.notices&&i.notices.length>o.maxonscreen){var n;n="top"!==e.options.stack.push?i.notices.slice(0,i.notices.length-o.maxonscreen):i.notices.slice(o.maxonscreen,i.notices.length),t.each(n,function(){this.remove&&this.remove()})}}},t.extend(i.styling.brighttheme,{hi_menu:"ui-pnotify-history-brighttheme",hi_btn:"",hi_btnhov:"",hi_hnd:""}),t.extend(i.styling.bootstrap3,{hi_menu:"well",hi_btn:"btn btn-default",hi_btnhov:"",hi_hnd:"glyphicon glyphicon-chevron-down"}),t.extend(i.styling.fontawesome,{hi_menu:"well",hi_btn:"btn btn-default",hi_btnhov:"",hi_hnd:"fa fa-chevron-down"}),i});
//# sourceMappingURL=pnotify.history.js.map