No Results
"+e+"
":'/** # Semantic UI * Version: 0.1 * http://github.com/quirkyinc/semantic * * * Copyright 2013 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * * Released: 05/16/2013 */ (function(e,t,n,o){e.fn.accordion=function(t){var n=e.extend(!0,{},e.fn.accordion.settings,t),i=arguments||!1;return e(this).each(function(){var t,a=e(this),s=a.find(n.selector.title),r=(a.find(n.selector.icon),a.find(n.selector.content)),l=a.data("module"),c=n.className;return t={initialize:function(){s.on("click",t.change),a.data("module",t)},change:function(){var o=e(this),i=(o.next(r),o.hasClass(c.active));i?n.collapsible&&e.proxy(t.close,o)():e.proxy(t.open,o)()},open:function(){var t=e(this),o=t.next(r),i=s.filter("."+c.active),a=i.next(s);n.exclusive&&i.size()>0&&(i.removeClass("active"),a.stop().slideUp(n.speed,n.easing,function(){e(this).removeClass("active").removeAttr("style")})),t.addClass(c.active),o.hide().addClass(c.active).stop().slideDown(n.speed,n.easing,function(){e(this).removeAttr("style")})},close:function(){var t=e(this),o=t.next(r);t.removeClass(c.active),o.removeClass(c.active).show().stop().slideUp(n.speed,n.easing,function(){e(this).removeAttr("style")})},debug:function(e){n.debug&&console.info(n.moduleName+": "+e)},error:function(e){console.warn(n.moduleName+": "+e)},invoke:function(i,a,s){var r;return s=s||Array.prototype.slice.call(arguments,2),"string"==typeof i&&l!==o&&(i=i.split("."),e.each(i,function(o,i){return e.isPlainObject(l[i])?(l=l[i],!0):e.isFunction(l[i])?(r=l[i],!0):(t.error(n.errors.method),!1)})),e.isFunction(r)?r.apply(a,s):r}},l!==o&&i?("invoke"==i[0]&&(i=Array.prototype.slice.call(i,1)),t.invoke(i[0],this,Array.prototype.slice.call(i,1))):(t.initialize(),o)}),this},e.fn.accordion.settings={moduleName:"Accordion",debug:!1,exclusive:!0,collapsible:!0,errors:{method:"The method you called is not defined"},className:{active:"active",hover:"hover"},selector:{title:".title",icon:".icon",content:".content"},speed:500,easing:"easeInOutQuint"}})(jQuery,window,document),function(e,t,n,o){e.animationSettings=function(t,n,i,a){return t=n===o?t:"object"==typeof n?e.extend({},t,n):"function"==typeof i?e.extend({},t,{duration:n,complete:i}):"object"==typeof i?e.extend(!0,{},t,{duration:n},i):e.extend({},t,{duration:n,easing:i,complete:a})},e.fn.popIn=function(t,n,o){var i=e.animationSettings(e.fn.popIn.settings,t,n,o),a=e(this),s=a.size(),r=0,l=function(){0==a.filter(":animated").size(),r++,e(this).css("transform","").removeClass(i.className.init),e.proxy(i.eachComplete,this)(),r==s&&e.proxy(i.complete,a)()},c=function(t){e(this).delay(i.delay*t).animate({opacity:i.endOpacity,transform:"scale("+i.endScale+")"},i.duration,i.easing,l)};return i.isLegacyBrowser?a.show():a.addClass(i.className.init).show().css({opacity:i.startOpacity,transform:"scale("+i.startScale+")"}).each(c),e(this)},e.fn.popOut=function(t,n,o){var i=e.animationSettings(e.fn.popIn.settings,t,n,o),a={complete:function(){e(this).hide(),e.proxy(i.complete,this)()},startOpacity:i.endOpacity,endOpacity:0,startScale:i.endScale,endScale:i.startScale},s=e.extend(!0,{},i,a);e(this).popIn(s)},e.fn.popIn.settings={isLegacyBrowser:!1,className:{init:"init"},duration:450,easing:"easeOutExpo",delay:100,startOpacity:0,endOpacity:1,startScale:.7,endScale:1,eachComplete:function(){},complete:function(){}},e.fn.kenBurns=function(t,n,i){var a=e.animationSettings(e.fn.kenBurns.settings,t,n,i),s={randomPosition:function(e,t,n){var n=n!==o?n:t,i=Math.random()*(e+n-(e-t))+(e-t);return parseInt(i,10)},animate:function(){var t={},n={};t=a.useStartPosition?{x:parseInt(e(this).css("background-position-x"),10),y:parseInt(e(this).css("background-position-y"),10)}:{x:s.randomPosition(50,a.xRange),y:s.randomPosition(50,a.yRange)},n.x=t.x>50?s.randomPosition(t.x,a.xMaxTravelDistance,-a.xMinTravelDistance):s.randomPosition(t.x,-a.xMinTravelDistance,a.xMaxTravelDistance),n.y=t.y>50?s.randomPosition(t.y,a.yMaxTravelDistance,-a.yMinTravelDistance):s.randomPosition(t.y,-a.yMinTravelDistance,a.yMaxTravelDistance),e(this).css({backgroundPosition:t.x+"%",backgroundPositionY:t.y+"%"}).stop().animate({backgroundPosition:n.x+"%",backgroundPositionY:n.y+"%"},a.duration,a.easing,a.complete)}};return a.isLegacyBrowser||e(this).each(s.animate),e(this)},e.fn.kenBurns.settings={isLegacyBrowser:!1,duration:1e4,easing:"linear",useStartPosition:!1,xRange:40,yRange:20,xMinTravelDistance:30,xMaxTravelDistance:60,yMinTravelDistance:20,yMaxTravelDistance:40,scale:.1,complete:function(){}}}(jQuery,window,document),function(e,t,n,o){e.api=e.fn.api=function(n){var i,a=e.extend(!0,{},e.api.settings,n),s="function"!=typeof this?this:e("
"),r=a.stateContext?e(a.stateContext):e(s),l="object"==typeof this?e(s):r,c=l.data(a.metadata.action)||a.action||!1,u=a.className,d=a.metadata,f=a.errors;return i={initialize:function(){var s,f,p,m,g,h,v,b=!1,y=(new Date).getTime(),x={},w={},C=a.errors;return a.serializeForm&&e(this).toJSON()!==o&&(x=l.closest("form").toJSON(),e.extend(!0,a.data,x),i.debug("Adding form data to API Request",x)),s=e.proxy(a.beforeSend,l)(a),s===o||s?(c&&(i.debug("Initializing API Request for: ",c),a.api[c]!==o?m=a.api[c]:i.error(C.missingAction)),a.url&&(m=a.url,i.debug("Using specified url: ",m)),m||(i.error(C.missingURL),i.reset()),g=m.match(a.regExpTemplate),g&&(i.debug("Looking for URL variables",g),e.each(g,function(t,s){var r=s.substr(2,s.length-3),c=e.isPlainObject(n.urlData)&&n.urlData[r]!==o?n.urlData[r]:l.data(r)!==o?l.data(r):a.urlData[r];i.verbose("Looking for variable",r,l,l.data(r),a.urlData[r]),c===!1?(i.debug("Removing variable from URL",g),m=m.replace("/"+s,"")):c!==o&&c?m=m.replace(s,c):(i.error(C.missingParameter+r),b=!0)})),b?(i.reset(),o):(p=e.Deferred().always(function(){a.stateContext&&r.removeClass(u.loading),e.proxy(a.complete,l)()}).done(function(t){i.debug("API request successful"),"json"==a.dataType?t.success===!0?e.proxy(a.success,r)(t,a,l):(i.debug("JSON success flag is not set."),t.error!==o?e.proxy(a.failure,r)(t.error,a,l):e.isArray(t.errors)?e.proxy(a.failure,r)(t.errors[0],a,l):t.message!==o?e.proxy(a.failure,r)(t.message,a,l):e.proxy(a.failure,r)(C.error,a,l)):e.proxy(a.success,r)(t,a,l)}).fail(function(t,n,s){var l,c=a.errors[n]!==o?a.errors[n]:s;if(t!==o)if(t.readyState!==o&&4==t.readyState){if(200!=t.status&&s!==o&&""!==s)i.error(C.statusMessage+s);else if("error"==n&&"json"==a.dataType)try{l=e.parseJSON(t.responseText),l&&l.error!==o&&(c=l.error)}catch(d){i.error(C.JSONParse)}r.removeClass(u.loading).addClass(u.error),a.errorLength>0&&setTimeout(function(){r.removeClass(u.error)},a.errorLength),i.debug("API Request error:",c),e.proxy(a.failure,r)(c,a,this)}else i.debug("Request Aborted (Most likely caused by page change)")}),e.extend(!0,w,a,{type:a.method||a.type,data:h,url:m,beforeSend:a.beforeXHR}),a.stateContext&&r.addClass(u.loading),a.progress&&(i.verbose("Adding progress events"),e.extend(!0,w,{xhr:function(){var n=new t.XMLHttpRequest;return n.upload.addEventListener("progress",function(t){var n;t.lengthComputable&&(n=Math.round(1e4*(t.loaded/t.total))/100+"%",e.proxy(a.progress,r)(n,t))},!1),n.addEventListener("progress",function(t){var n;t.lengthComputable&&(n=Math.round(1e4*(t.loaded/t.total))/100+"%",e.proxy(a.progress,r)(n,t))},!1),n}})),i.verbose("Creating AJAX request with settings: ",w),v=e.ajax(w).always(function(){f=a.loadingLength-((new Date).getTime()-y),a.loadingDelay=0>f?0:f}).done(function(e){var t=this;setTimeout(function(){p.resolveWith(t,[e])},a.loadingDelay)}).fail(function(e,t,n){var o=this;"abort"!=t?setTimeout(function(){p.rejectWith(o,[e,t,n])},a.loadingDelay):r.removeClass(u.error).removeClass(u.loading)}),a.stateContext&&l.data(d.promise,p).data(d.xhr,v),o)):(i.error(C.beforeSend),i.reset(),o)},reset:function(){l.data(d.promise,!1).data(d.xhr,!1),r.removeClass(u.error).removeClass(u.loading),i.error(f.exitConditions)},setting:function(e,t){return t===o?a[e]:(a[e]=t,o)},verbose:function(){a.verbose&&i.debug.apply(this,arguments)},debug:function(){var e=[],t=a.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),a.debug&&(e.push(t),o.apply(console,e.concat(n)))},error:function(){var e=[],t=a.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.warn||console.log||function(){};o=Function.prototype.bind.call(o,console),a.debug&&(e.push(t),e.concat(n),o.apply(console,e.concat(n)))}},i.initialize(),this},e.fn.apiButton=function(t){return e(this).each(function(){var n,o=e(this),i=e(this).selector||"",a=e.isFunction(t)?e.extend(!0,{},e.api.settings,e.fn.apiButton.settings,{stateContext:this,success:t}):e.extend(!0,{},e.api.settings,e.fn.apiButton.settings,{stateContext:this},t);n={initialize:function(){a.context&&""!==i?e(a.context).on(i,"click."+a.namespace,n.click):o.on("click."+a.namespace,n.click)},click:function(){a.filter&&0!==e(this).filter(a.filter).size()||e.proxy(e.api,this)(a)}},n.initialize()}),this},e.api.settings={moduleName:"API Module",namespace:"api",verbose:!0,debug:!0,api:{},beforeSend:function(e){return e},beforeXHR:function(){},success:function(){},complete:function(){},failure:function(){},progress:!1,errors:{missingAction:"API action used but no url was defined",missingURL:"URL not specified for the API action",missingParameter:"Missing an essential URL parameter: ",timeout:"Your request timed out",error:"There was an error with your request",parseError:"There was an error parsing your request",JSONParse:"JSON could not be parsed during error handling",statusMessage:"Server gave an error: ",beforeSend:"The before send function has aborted the request",exitConditions:"API Request Aborted. Exit conditions met"},className:{loading:"loading",error:"error"},metadata:{action:"action",promise:"promise",xhr:"xhr"},regExpTemplate:/\{\$([A-z]+)\}/g,action:!1,url:!1,urlData:!1,serializeForm:!1,stateContext:!1,method:"get",data:{},dataType:"json",cache:!0,loadingLength:200,errorLength:2e3},e.fn.apiButton.settings={filter:".disabled, .loading",context:!1,stateContext:!1}}(jQuery,window,document),function(e,t,n,o){e.fn.colorize=function(t){var n=e.extend(!0,{},e.fn.colorize.settings,t),i=arguments||!1;return e(this).each(function(t){var a,s,r,l,c,u,d,f,p=e(this),m=e("")[0],g=e("")[0],h=e("")[0],v=new Image,b=n.colors,y=(n.paths,n.namespace),x=n.errors,w=p.data("module-"+y);return f={checkPreconditions:function(){return f.debug("Checking pre-conditions"),!e.isPlainObject(b)||e.isEmptyObject(b)?(f.error(x.undefinedColors),!1):!0},async:function(e){n.async?setTimeout(e,0):e()},getMetadata:function(){f.debug("Grabbing metadata"),l=p.data("image")||n.image||o,c=p.data("name")||n.name||t,u=n.width||p.width(),d=n.height||p.height(),(0===u||0===d)&&f.error(x.undefinedSize)},initialize:function(){f.debug("Initializing with colors",b),f.checkPreconditions()&&f.async(function(){f.getMetadata(),f.canvas.create(),f.draw.image(function(){f.draw.colors(),f.canvas.merge()}),p.data("module-"+y,f)})},redraw:function(){f.debug("Redrawing image"),f.async(function(){f.canvas.clear(),f.draw.colors(),f.canvas.merge()})},change:{color:function(e,t){return f.debug("Changing color",e),b[e]===o?(f.error(x.missingColor),!1):(b[e]=t,f.redraw(),o)}},canvas:{create:function(){f.debug("Creating canvases"),m.width=u,m.height=d,g.width=u,g.height=d,h.width=u,h.height=d,a=m.getContext("2d"),s=g.getContext("2d"),r=h.getContext("2d"),p.append(m),a=p.children("canvas")[0].getContext("2d")},clear:function(){f.debug("Clearing canvas"),r.fillStyle="#FFFFFF",r.fillRect(0,0,u,d)},merge:function(){return e.isFunction(a.blendOnto)?(a.putImageData(s.getImageData(0,0,u,d),0,0),r.blendOnto(a,"multiply"),o):(f.error(x.missingPlugin),o)}},draw:{image:function(e){f.debug("Drawing image"),e=e||function(){},l?(v.src=l,v.onload=function(){s.drawImage(v,0,0),e()}):(f.error(x.noImage),e())},colors:function(){f.debug("Drawing color overlays",b),e.each(b,function(e,t){n.onDraw(r,c,e,t)})}},debug:function(e,t){n.debug&&(t!==o?console.info(n.moduleName+": "+e,t):console.info(n.moduleName+": "+e))},error:function(e){console.warn(n.moduleName+": "+e)},invoke:function(t,i,a){var s;return a=a||Array.prototype.slice.call(arguments,2),"string"==typeof t&&w!==o&&(t=t.split("."),e.each(t,function(t,o){return e.isPlainObject(w[o])?(w=w[o],!0):e.isFunction(w[o])?(s=w[o],!0):(f.error(n.errors.method),!1)})),e.isFunction(s)?s.apply(i,a):!1}},w!==o&&i?("invoke"==i[0]&&(i=Array.prototype.slice.call(i,1)),f.invoke(i[0],this,Array.prototype.slice.call(i,1))):(f.initialize(),o)}),this},e.fn.colorize.settings={moduleName:"Image Colorizer",debug:!0,namespace:"colorize",onDraw:function(){},async:!0,colors:{},metadata:{image:"image",name:"name"},errors:{noImage:"No tracing image specified",undefinedColors:"No default colors specified.",missingColor:"Attempted to change color that does not exist",missingPlugin:"Blend onto plug-in must be included",undefinedHeight:"The width or height of image canvas could not be automatically determined. Please specify a height."}}}(jQuery,window,document),function(e){e.fn.defaultText=function(t){var n="string"==typeof t?e.extend({},e.fn.defaultText.settings,{defaultValue:t}):e.extend(!0,{},e.fn.defaultText.settings,t);return"string"==typeof t&&(t={defaultValue:t}),e.extend(n,t),e(this).each(function(){var t=e(this),o={checkDefault:function(){t.val().toLowerCase()!=n.defaultValue.toLowerCase()&&t.addClass(n.filledClass)},placeholder:{add:function(){0===t.filter(n.disabledClassList).size()&&(t.val()==n.replaceValue?n.alwaysReplace?t.removeClass(n.filledClass).val(t.attr("last")).removeAttr("last"):t.removeClass(n.filledClass).val(n.defaultValue):t.addClass(n.filledClass))},remove:function(){0===t.filter(n.disabledClassList).size()&&(n.alwaysReplace?t.attr("last",t.val()).val(n.replaceValue):t.val().toLowerCase()==n.defaultValue.toLowerCase()&&t.val(n.replaceValue))}}};"auto"==n.defaultValue&&(n.defaultValue=e(this).val()),t.on("focus",o.placeholder.remove).on("blur",o.placeholder.add),o.checkDefault()}),this},e.fn.defaultText.settings={defaultValue:"auto",replaceValue:"",alwaysReplace:!1,disabledClassList:".readonly, .disabled",filledClass:"filled"}}(jQuery,window,document),function(e,t,n,o){e.fn.validateForm=function(t,n){var i,a=e(this),s=e.extend(!0,{},e.fn.validateForm.settings,n),r=arguments[0],l=[].slice.call(arguments,1);return a.each(function(){var n,a=e(this),c=e(this).find(s.selector.group),u=(e(this).find(s.selector.field),e(this).find(s.selector.prompt),[]),d=(a.selector||"",a.data("module-"+s.namespace)),f="string"==typeof r,p=s.namespace,m=s.metadata,g=s.className,h=s.errors;n={initialize:function(){n.verbose("Initializing form validation"),t===o&&e.isEmptyObject(t)?n.error(h.noFields,a):(e.fn.defaultText!==o&&e.each(t,function(e,t){n.field.add.defaultText(t)}),a.on("submit."+p,n.validate.form))},destroy:function(){a.off(p)},field:{find:function(t){var n=a.find(s.selector.field);return n.filter("#"+t).size()>0?n.filter("#"+t):n.filter('[name="'+t+'"]').size()>0?n.filter('[name="'+t+'"]'):n.filter("[data-"+m.validate+'="'+t+'"]').size()>0?n.filter("[data-"+m.validate+'="'+t+'"]'):e("")},add:{defaultText:function(e){var t=n.field.find(e.identifier);e.defaultText!==o&&t.defaultText(e.defaultText)},error:function(t,o){var i=n.field.find(t.identifier),a=i.closest(c),r=c.find(r),l=0!==r.size();a.addClass(g.error),s.inlineError&&(l||(r=e("").addClass(g.prompt).insertBefore(i)),r.html(o[0]).fadeIn(s.animateSpeed))}},remove:{error:function(e){var t=n.field.find(e.identifier),o=t.closest(c),i=c.find(i);o.removeClass(g.error),s.inlineError&&i.hide()}}},validate:{form:function(o){var i=!0;return u=[],e.each(t,function(e,t){n.validate.field(t)||(i=!1)}),i?e.proxy(s.onSuccess,this)(o):e.proxy(s.onFailure,this)(u)},field:function(t){var i=n.field.find(t.identifier),a=!0,r=[];return t.rules!==o&&e.each(t.rules,function(e,o){n.validate.rule(t,o)||(n.debug("Field is invalid",t.identifier,o.type),r.push(o.prompt),a=!1)}),a?(n.field.remove.error(t,r),s.onValid(i),!0):(u=u.concat(r),n.field.add.error(t,r),e.proxy(s.onInvalid,i)(r),!1)},rule:function(t,i){var r,l,c=n.field.find(t.identifier),u=i.type,d=t.defaultText!==o?t.defaultText:!1,f=c.val()==d?"":c.val(),p=/\[(.*?)\]/i,m=p.exec(u),g=!0;return m!==o&&null!=m?(r=m[1],l=u.replace(m[0],""),g=e.proxy(s.rules[l],a)(f,r)):g="checked"==u?c.filter(":checked").size()>0:s.rules[u](f),g}},setting:function(e,t){return t===o?s[e]:(s[e]=t,o)},verbose:function(){s.verbose&&n.debug.apply(this,arguments)},debug:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),s.debug&&(e.push(t),o.apply(console,e.concat(n)))},error:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.warn||console.log||function(){};o=Function.prototype.bind.call(o,console),s.debug&&(e.push(t),e.concat(n),o.apply(console,e.concat(n)))},invoke:function(t,i,a){var s,r;return a=a||[].slice.call(arguments,2),"string"==typeof t&&d!==o&&(t=t.split("."),s=t.length-1,e.each(t,function(t,i){return e.isPlainObject(d[i])&&t!=s?(d=d[i],!0):d[i]!==o?(r=d[i],!0):(n.error(h.method),!1)})),e.isFunction(r)?r.apply(i,a):r}},f?i=n.invoke(r,this,l):n.initialize()}),i!==o?i:this},e.fn.validateForm.settings={moduleName:"Validate Form Module",debug:!0,verbose:!1,namespace:"validate",animateSpeed:150,inlineError:!1,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{validate:"validate"},errors:{method:"The method you called is not defined.",noFields:"No validation object specified."},selector:{group:".field",prompt:".prompt",field:"input, textarea, select"},className:{error:"error",prompt:"prompt"},rules:{empty:function(e){return!(e===o||""===e)},email:function(e){var t=RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");return t.test(e)},length:function(e,t){return e!==o?e.length>=t:!1},not:function(e,t){return e!=t},maxLength:function(e,t){return e!==o?t>=e.length:!1},match:function(t,n){var i,a=e(this);return a.find("#"+n).size()>0?i=a.find("#"+n).val():a.find("[name="+n+"]").size()>0?i=a.find("[name="+n+"]").val():a.find('[data-validate="'+n+'"]').size()>0&&(i=a.find('[data-validate="'+n+'"]').val()),i!==o?""+t==""+i:!1},url:function(e){var t=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)}}}}(jQuery,window,document),function(e,t,n,o){e.fn.state=function(t){var n,i=e(this),a=i.selector||"",s=arguments[0],r=[].slice.call(arguments,1),l=(new Date).getTime(),c=[];return i.each(function(){var u,d=e(this),f=e.extend(!0,{},e.fn.state.settings,t),p=this,m=d.data("module-"+f.namespace),g="string"==typeof s,h=f.namespace,v=f.metadata,b=f.className,y=f.states,x=f.text;u={initialize:function(){u.verbose("Initializing module",p),f.automatic&&u.add.defaults(),f.context&&""!==a?(u.allows("hover")&&e(p,f.context).on(a,"mouseenter."+h,u.hover.enable).on(a,"mouseleave."+h,u.hover.disable),u.allows("pressed")&&e(p,f.context).on(a,"mousedown."+h,u.pressed.enable).on(a,"mouseup."+h,u.pressed.disable),u.allows("focus")&&e(p,f.context).on(a,"focus."+h,u.focus.enable).on(a,"blur."+h,u.focus.disable),e(f.context).on(a,"mouseenter."+h,u.text.change).on(a,"mouseleave."+h,u.text.reset).on(a,"click."+h,u.toggle)):(u.allows("hover")&&d.on("mouseenter."+h,u.hover.enable).on("mouseleave."+h,u.hover.disable),u.allows("pressed")&&d.on("mousedown."+h,u.pressed.enable).on("mouseup."+h,u.pressed.disable),u.allows("focus")&&d.on("focus."+h,u.focus.enable).on("blur."+h,u.focus.disable),d.on("mouseenter."+h,u.text.change).on("mouseleave."+h,u.text.reset).on("click."+h,u.toggle)),d.data("module-"+h,u)},destroy:function(){u.verbose("Destroying previous module",p),d.off("."+h)},refresh:function(){u.verbose("Refreshing selector cache",p),d=e(p)},add:{defaults:function(){var n=t&&e.isPlainObject(t.states)?t.states:{};e.each(f.defaults,function(t,i){u.is[t]!==o&&u.is[t]()&&(u.verbose("Adding default states",t,p),e.extend(f.states,i,n))})}},is:{active:function(){return d.hasClass(b.active)},loading:function(){return d.hasClass(b.loading)},inactive:function(){return!d.hasClass(b.active)},enabled:function(){return!d.is(f.filter.active)},disabled:function(){return d.is(f.filter.active)},textEnabled:function(){return!d.is(f.filter.text)},button:function(){return d.is(".button:not(a, .submit)")},input:function(){return d.is("input")}},allows:function(e){return y[e]||!1},enable:function(e){u.allows(e)&&d.addClass(b[e])},disable:function(e){u.allows(e)&&d.removeClass(b[e])},textFor:function(e){return x[e]||!1},focus:{enable:function(){d.addClass(b.focus)},disable:function(){d.removeClass(b.focus)}},hover:{enable:function(){d.addClass(b.hover)},disable:function(){d.removeClass(b.hover)}},pressed:{enable:function(){d.addClass(b.pressed).one("mouseleave",u.pressed.disable)},disable:function(){d.removeClass(b.pressed)}},toggle:function(){var e=d.data(v.promise);u.allows("active")&&u.is.enabled()&&(u.refresh(),e!==o?u.listenTo(e):u.change())},listenTo:function(t){u.debug("API request detected, waiting for state signal",t),t?(x.loading&&u.text.update(x.loading),e.when(t).then(function(){"resolved"==t.state()?(u.debug("API request succeeded"),f.activateTest=function(){return!0},f.deactivateTest=function(){return!0}):(u.debug("API request failed"),f.activateTest=function(){return!1},f.deactivateTest=function(){return!1}),u.change()})):(f.activateTest=function(){return!1},f.deactivateTest=function(){return!1})},change:function(){u.debug("Determining state change direction"),u.is.inactive()?u.activate():u.deactivate(),f.sync&&u.sync(),f.onChange()},activate:function(){e.proxy(f.activateTest,p)()&&(u.debug("Setting state to active"),d.addClass(b.active),u.text.update(x.active))},deactivate:function(){e.proxy(f.deactivateTest,p)()&&(u.debug("Setting state to inactive"),d.removeClass(b.active),u.text.update(x.inactive))},sync:function(){u.verbose("Syncing other buttons to current state"),u.is.active()?i.not(d).state("activate"):i.not(d).state("deactivate")},text:{get:function(){return f.selector.text?d.find(f.selector.text).text():d.html()},flash:function(e,t){var n=u.text.get();e=e||f.text.flash,t=t||f.flashDuration,u.text.update(e),setTimeout(function(){u.text.update(n)},t)},change:function(){u.verbose("Checking if text should be changed"),u.is.textEnabled()&&(u.is.active()?x.hover?(u.verbose("Changing text to hover text",x.hover),u.text.update(x.hover)):x.disable&&(u.verbose("Changing text to disable text",x.disable),u.text.update(x.disable)):x.hover?(u.verbose("Changing text to hover text",x.disable),u.text.update(x.hover)):x.enable&&(u.verbose("Changing text to enable text",x.disable),u.text.update(x.enable)))},reset:function(){var e=x.active||d.data(v.storedText),t=x.inactive||d.data(v.storedText);u.is.textEnabled()&&(u.is.active()&&e?(u.verbose("Resetting active text",e),u.text.update(e)):t&&(u.verbose("Resetting inactive text",e),u.text.update(t)))},update:function(e){var t=u.text.get();e&&e!==t&&(u.debug("Updating text",e),f.selector.text?d.data(v.storedText,e).find(f.selector.text).text(e):d.data(v.storedText,e).html(e))}},setting:function(e,t){return t===o?f[e]:(f[e]=t,o)},performance:{log:function(e){var t,n;f.performance&&(t=(new Date).getTime(),n=t-l,l=t,c.push({Name:e,"Execution Time":n}),clearTimeout(u.performance.timer),u.performance.timer=setTimeout(u.performance.display,100))},display:function(){var t=f.moduleName+" Performance ("+a+")";f.moduleName+": "+a+"("+i.size()+" elements)",console.group!==o&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+":"+t["Execution Time"])}),console.groupEnd(),c=[])}},verbose:function(){f.verbose&&f.debug&&(u.performance.log(arguments[0]),u.verbose=Function.prototype.bind.call(console.info,console,f.moduleName+":"))},debug:function(){f.debug&&(u.performance.log(arguments[0]),u.verbose=Function.prototype.bind.call(console.info,console,f.moduleName+":"))},error:function(){console.log!==o&&(u.error=Function.prototype.bind.call(console.log,console,f.moduleName+":"))},invoke:function(t,n,i){var a,s;return i=i||[].slice.call(arguments,2),"string"==typeof t&&m!==o&&(t=t.split("."),a=t.length-1,e.each(t,function(t,n){return e.isPlainObject(m[n])&&t!=a?(m=m[n],!0):m[n]!==o?(s=m[n],!0):(u.error(f.errors.method),!1)})),e.isFunction(s)?s.apply(n,i):s}},g?n=u.invoke(s,this,r):(m!==o&&u.destroy(),u.initialize())}),n!==o?n:this},e.fn.state.settings={moduleName:"State Module",debug:!0,verbose:!1,namespace:"state",performance:!0,onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:3e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,errors:{method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{focus:"focus",hover:"hover",pressed:"down",active:"active",loading:"loading"},selector:{text:!1},defaults:{input:{hover:!0,focus:!0,pressed:!0,loading:!1,active:!1},button:{hover:!0,focus:!1,pressed:!0,active:!1,loading:!0}},states:{hover:!0,focus:!0,pressed:!0,loading:!1,active:!1},text:{flash:!1,hover:!1,active:!1,inactive:!1,enable:!1,disable:!1}}}(jQuery,window,document),function(e,t,n,o){e.fn.chat=function(t,n,i){var a=e.extend(!0,{},e.fn.chat.settings,i),s=arguments||!1;return e(this).each(function(){var i,r,l,c,u,d,f=e(this),p=f.find(a.selector.expandButton),m=f.find(a.selector.userListButton),g=f.find(a.selector.userList),h=(f.find(a.selector.room),f.find(a.selector.userCount)),v=f.find(a.selector.log),b=(f.find(a.selector.message),f.find(a.selector.messageInput)),y=f.find(a.selector.messageButton),x=f.data("module"),w=a.className,C=a.namespace,k="",T={};return d={channel:!1,width:{log:v.width(),userList:g.outerWidth()},initialize:function(){return Pusher===o&&d.error(a.errors.pusher),t===o||n===o?(d.error(a.errors.key),!1):a.endpoint.message||a.endpoint.authentication?(u=new Pusher(t),Pusher.channel_auth_endpoint=a.endpoint.authentication,d.channel=u.subscribe(n),d.channel.bind("pusher:subscription_succeeded",d.user.list.create),d.channel.bind("pusher:subscription_error",d.error),d.channel.bind("pusher:member_added",d.user.joined),d.channel.bind("pusher:member_removed",d.user.left),d.channel.bind("update_messages",d.message.receive),e.each(a.customEvents,function(e,t){d.channel.bind(e,t)}),e.fn.hoverClass!==o&&e.fn.downClass!==o&&(p.hoverClass().downClass(),m.hoverClass().downClass(),y.hoverClass().downClass()),m.on("click."+C,d.event.toggleUserList),p.on("click."+C,d.event.toggleExpand),b.on("keydown."+C,d.event.input.keydown).on("keyup."+C,d.event.input.keyup),y.on("mouseenter."+C,d.event.hover).on("mouseleave."+C,d.event.hover).on("click."+C,d.event.submit),v.animate({scrollTop:v.prop("scrollHeight")},400),f.data("module",d).addClass(w.loading),o):(d.error(a.errors.endpoint),!1)},refresh:function(){m.removeClass(w.active),d.width={log:v.width(),userList:g.outerWidth()},m.hasClass(w.active)&&d.user.list.hide(),f.data("module",d)},user:{updateCount:function(){a.userCount&&(T=f.data("users"),l=0,e.each(T,function(){l++}),h.html(a.templates.userCount(l)))},joined:function(t){T=f.data("users"),"anonymous"!=t.id&&T[t.id]===o&&(T[t.id]=t.info,a.randomColor&&t.info.color===o&&(t.info.color=a.templates.color(t.id)),k=a.templates.userList(t.info),t.info.isAdmin?e(k).prependTo(g).preview({type:"user",placement:"left"}):e(k).appendTo(g).preview({type:"user",placement:"left"}),e.fn.preview!==o&&g.children().last().preview({type:"user",placement:"left"}),a.partingMessages&&(v.append(a.templates.joined(t.info)),d.message.scroll.test()),d.user.updateCount())},left:function(e){T=f.data("users"),e!==o&&"anonymous"!==e.id&&(delete T[e.id],f.data("users",T),g.find("[data-id="+e.id+"]").remove(),a.partingMessages&&(v.append(a.templates.left(e.info)),d.message.scroll.test()),d.user.updateCount())},list:{create:function(t){T={},t.each(function(e){"anonymous"!==e.id&&"undefined"!==e.id&&(a.randomColor&&e.info.color===o&&(e.info.color=a.templates.color(e.id)),k=e.info.isAdmin?a.templates.userList(e.info)+k:k+a.templates.userList(e.info),T[e.id]=e.info)}),f.data("users",T).data("user",T[t.me.id]).removeClass(w.loading),g.html(k),e.fn.preview!==o&&g.children().preview({type:"user",placement:"left"}),d.user.updateCount(),e.proxy(a.onJoin,g.children())()},show:function(){v.animate({width:d.width.log-d.width.userList},{duration:a.speed,easing:a.easing,complete:d.message.scroll.move})},hide:function(){v.stop().animate({width:d.width.log},{duration:a.speed,easing:a.easing,complete:d.message.scroll.move})}}},message:{scroll:{test:function(){c=v.prop("scrollHeight")-v.height(),Math.abs(v.scrollTop()-c)