/*
* # Fomantic UI - 2.8.4
* https://github.com/fomantic/Fomantic-UI
* http://fomantic-ui.com/
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
!function(M,e,E){"use strict";M.isFunction=M.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),M.fn.toast=function(w){var k,e=M(this),x=e.selector||"",T=(new Date).getTime(),I=[],P=w,O="string"==typeof P,A=[].slice.call(arguments,1);return e.each(function(){var o,s,a,i,c,l,r,u=M.isPlainObject(w)?M.extend(!0,{},M.fn.toast.settings,w):M.extend({},M.fn.toast.settings),d=u.className,e=u.selector,p=u.error,n=u.namespace,f=u.fields,t="."+n,m=n+"-module",g=M(this),h=u.context?M(u.context):M("body"),v=g.hasClass("toast")||g.hasClass("message")||g.hasClass("card"),b=this,C=v?g.data(m):E,y={initialize:function(){y.verbose("Initializing element"),y.has.container()||y.create.container(),(v||""!==u.message||""!==u.title||""!==y.get.iconClass()||u.showImage||y.has.configActions())&&("string"==typeof u.showProgress&&-1!==[d.top,d.bottom].indexOf(u.showProgress)||(u.showProgress=!1),y.create.toast(),u.closeOnClick&&(u.closeIcon||0",{class:u.position+" "+d.container}))},toast:function(){var e,n,t;o=M("
",{class:d.box}),v?(s=u.cloneModule?g.clone().removeAttr("id"):g,r=s.find("> i"+y.helpers.toClass(d.close)),u.closeIcon=0"),e=M("",{class:d.content}),""!==(n=y.get.iconClass())&&s.append(M("",{class:n+" "+d.icon})),u.showImage&&s.append(M("
",{class:d.image+" "+u.classImage,src:u.showImage})),""!==u.title&&e.append(M("",{class:d.title,text:u.title})),e.append(M("",{html:y.helpers.escape(u.message,u.preserveHTML)})),s.addClass(u.class+" "+d.toast).append(e),s.css("opacity",u.opacity),u.closeIcon&&((r=M("",{class:d.close+" "+("string"==typeof u.closeIcon?u.closeIcon:"")})).hasClass(d.left)?s.prepend(r):s.append(r))),s.hasClass(d.compact)&&(u.compact=!0),s.hasClass("card")&&(u.compact=!1),a=s.find(".actions"),y.has.configActions()&&(0===a.length&&(a=M("",{class:d.actions+" "+(u.classActions||"")}).appendTo(s)),s.hasClass("card")&&!a.hasClass(d.attached)&&(a.addClass(d.extraContent),a.hasClass(d.vertical)&&(a.removeClass(d.vertical),y.error(p.verticalCard))),u.actions.forEach(function(e){var n=e[f.icon]?'':"",t=y.helpers.escape(e[f.text]||"",u.preserveHTML),o=y.helpers.deQuote(e[f.class]||""),s=e[f.click]&&M.isFunction(e[f.click])?e[f.click]:function(){};a.append(M("",{html:n+t,class:d.button+" "+o,click:function(){!1!==s.call(b,g)&&y.close()}}))})),a&&a.hasClass(d.vertical)&&s.addClass(d.vertical),0",{class:d.vertical+" "+d.attached+" "+(u.compact?d.compact:"")})),a.hasClass(d.left)?s.addClass(d.left).parent().addClass(d.left).prepend(a):s.parent().append(a)):a.hasClass(d.top)?(o.prepend(a),s.addClass(d.bottom)):(o.append(a),s.addClass(d.top))),g!==s&&(b=(g=s)[0]),0",{class:d.progress+" "+(u.classProgress||u.class),"data-percent":""}),u.classProgress||(s.hasClass("toast")&&!s.hasClass(d.inverted)?i.addClass(d.inverted):i.removeClass(d.inverted)),c=M("",{class:"bar "+(u.progressUp?"up ":"down ")+t}),i.addClass(u.showProgress).append(c),i.hasClass(d.top)?o.prepend(i):o.append(i),c.css("animation-duration",u.displayTime/1e3+"s")),(l=M("",{class:"wait "+t})).css("animation-duration",u.displayTime/1e3+"s"),l.appendTo(s)),u.compact&&(o.addClass(d.compact),s.addClass(d.compact),i&&i.addClass(d.compact)),u.newestOnTop?o.prependTo(y.get.container()):o.appendTo(y.get.container())}},bind:{events:function(){y.debug("Binding events to toast"),(u.closeOnClick||u.closeIcon)&&(u.closeIcon?r:s).on("click"+t,y.event.click),l&&l.on("animationend"+t,y.close),o.on("click"+t,e.approve,y.event.approve).on("click"+t,e.deny,y.event.deny)}},unbind:{events:function(){y.debug("Unbinding events to toast"),(u.closeOnClick||u.closeIcon)&&(u.closeIcon?r:s).off("click"+t),l&&l.off("animationend"+t),o.off("click"+t)}},animate:{show:function(e){e=M.isFunction(e)?e:function(){},u.transition&&y.can.useElement("transition")&&g.transition("is supported")&&(y.set.visible(),o.transition({animation:u.transition.showMethod+" in",queue:!1,debug:u.debug,verbose:u.verbose,duration:u.transition.showDuration,onComplete:function(){e.call(o,b),u.onVisible.call(o,b)}}))},close:function(e){e=M.isFunction(e)?e:function(){},y.debug("Closing toast"),!1!==u.onHide.call(o,b)?u.transition&&M.fn.transition!==E&&g.transition("is supported")?o.transition({animation:u.transition.hideMethod+" out",queue:!1,duration:u.transition.hideDuration,debug:u.debug,verbose:u.verbose,interval:50,onBeforeHide:function(e){e=M.isFunction(e)?e:function(){},""!==u.transition.closeEasing?o&&(o.css("opacity",0),o.wrap("").parent().slideUp(500,u.transition.closeEasing,function(){o&&(o.parent().remove(),e.call(o))})):e.call(o)},onComplete:function(){e.call(o,b),u.onHidden.call(o,b),y.destroy()}}):y.error(p.noTransition):y.debug("onHide callback returned false, cancelling toast animation")},pause:function(){l.css("animationPlayState","paused"),c&&c.css("animationPlayState","paused")},continue:function(){l.css("animationPlayState","running"),c&&c.css("animationPlayState","running")}},has:{container:function(){return y.verbose("Determining if there is already a container"),0":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(e){return t[e]}):e}},can:{useElement:function(e){return M.fn[e]!==E||(y.error(p.noElement.replace("{element}",e)),!1)}},setting:function(e,n){if(y.debug("Changing setting",e,n),M.isPlainObject(e))M.extend(!0,u,e);else{if(n===E)return u[e];M.isPlainObject(u[e])?M.extend(!0,u[e],n):u[e]=n}},internal:function(e,n){if(M.isPlainObject(e))M.extend(!0,y,e);else{if(n===E)return y[e];y[e]=n}},debug:function(){!u.silent&&u.debug&&(u.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,u.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),y.verbose.apply(console,arguments)))},error:function(){u.silent||(y.error=Function.prototype.bind.call(console.error,console,u.name+":"),y.error.apply(console,arguments))},performance:{log:function(e){var n,t;u.performance&&(t=(n=(new Date).getTime())-(T||n),T=n,I.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:b,"Execution Time":t})),clearTimeout(y.performance.timer),y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var e=u.name+":",t=0;T=!1,clearTimeout(y.performance.timer),M.each(I,function(e,n){t+=n["Execution Time"]}),e+=" "+t+"ms",x&&(e+=" '"+x+"'"),(console.group!==E||console.table!==E)&&0