!function(a,b,c,d){a.fn.modal=function(e){var f,g=a(this),h=a(b),i=a(c),j=a.isPlainObject(e)?a.extend(!0,{},a.fn.modal.settings,e):a.fn.modal.settings,k=j.selector,l=j.className,m=j.namespace,n=j.error,o="."+m,p="module-"+m,q=g.selector||"",r=(new Date).getTime(),s=[],t=arguments[0],u="string"==typeof t,v=[].slice.call(arguments,1);return g.each(function(){var e,w,x,y=a(this),z=a(j.context),A=g.not(y),B=y.find(k.close),C=this,D=y.data(p);x={initialize:function(){x.verbose("Initializing dimmer",z),w=z.dimmer("add content",y).dimmer("get dimmer"),x.verbose("Attaching close events",B),B.on("click"+o,x.event.close),h.on("resize",function(){x.event.debounce(x.refresh,50)}),x.instantiate()},instantiate:function(){x.verbose("Storing instance of modal"),D=x,y.data(p,D)},destroy:function(){x.verbose("Destroying previous modal"),y.off(o)},refresh:function(){x.remove.scrolling(),x.cacheSizes(),x.set.type(),x.set.position()},attachEvents:function(b,c){var d=a(b);c=a.isFunction(x[c])?x[c]:x.show,d.size()>0?(x.debug("Attaching modal events to element",b,c),d.off(o).on("click"+o,c)):x.error(n.notFound)},event:{close:function(){x.verbose("Close button pressed"),z.dimmer("hide")},debounce:function(a,b){clearTimeout(x.timer),x.timer=setTimeout(a,b)},keyboard:function(a){var b=a.which,c=27;b==c&&(x.debug("Escape key pressed hiding modal"),z.dimmer("hide"),a.preventDefault())},resize:function(){z.dimmer("is active")&&x.refresh()}},toggle:function(){x.is.active()?x.hide():x.show()},show:function(){x.showDimmer(),x.cacheSizes(),x.set.position(),x.hideAll(),j.transition&&a.fn.transition!==d?y.transition(j.transition+" in",j.duration,function(){x.set.active(),x.save.focus(),x.set.type()}):y.fadeIn(j.duration,j.easing,function(){x.set.active(),x.save.focus(),x.set.type()}),x.debug("Triggering dimmer"),a.proxy(j.onShow,C)()},showDimmer:function(){x.debug("Showing modal"),x.set.dimmerSettings(),z.dimmer("show")},hideDimmer:function(){z.dimmer("hide")},hide:function(){x.debug("Hiding modal"),i.off("keyup."+m),j.transition&&a.fn.transition!==d?y.transition(j.transition+" out",j.duration,function(){x.remove.active(),x.restore.focus()}):y.fadeOut(j.duration,j.easing,function(){x.remove.active(),x.restore.focus()}),a.proxy(j.onHide,C)()},hideAll:function(){A.filter(":visible").modal("hide")},add:{keyboardShortcuts:function(){x.verbose("Adding keyboard shortcuts"),i.on("keyup"+o,x.event.keyboard)}},save:{focus:function(){e=a(c.activeElement).blur()}},restore:{focus:function(){e.focus()}},remove:{active:function(){y.removeClass(l.active)},keyboardShortcuts:function(){x.verbose("Removing keyboard shortcuts"),i.off("keyup"+o)},scrolling:function(){w.removeClass(l.scrolling),y.removeClass(l.scrolling)}},cacheSizes:function(){x.cache={height:y.outerHeight()+j.offset,contextHeight:"body"==j.context?a(b).height():z.height()},x.debug("Caching modal and container sizes",x.cache)},can:{fit:function(){return x.cache.height0&&(console.groupCollapsed(b),console.table?console.table(s):a.each(s,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(b,c,e){var g,h,i;return c=c||v,e=C||e,"string"==typeof b&&D!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(D[e])&&c!=g)D=D[e];else{if(!a.isPlainObject(D[f])||c==g)return D[e]!==d?(h=D[e],!1):D[f]!==d?(h=D[f],!1):(x.error(n.method),!1);D=D[f]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):"string"==typeof f?f=[f,i]:i!==d&&(f=i),h}},u?(D===d&&x.initialize(),x.invoke(t)):(D!==d&&x.destroy(),x.initialize())}),f!==d?f:this},a.fn.modal.settings={name:"Modal",namespace:"modal",verbose:!0,debug:!0,performance:!0,closable:!0,context:"body",duration:600,easing:"easeOutExpo",offset:0,transition:"scale",onShow:function(){},onHide:function(){},selector:{close:".close, .actions .button"},error:{method:"The method you called is not defined."},className:{active:"active",scrolling:"scrolling"}}}(jQuery,window,document);