(function(e,t){"use strict";function n(e){var t=array.prototype.slice.call(arguments,1);return e.prop?e.prop.apply(e,t):e.attr.apply(e,t)}function s(e,t,n){var s,a;for(s in n)n.hasownproperty(s)&&(a=s.replace(/ |$/g,t.eventnamespace),e.bind(a,n[s]))}function a(e,t,n){s(e,n,{focus:function(){t.addclass(n.focusclass)},blur:function(){t.removeclass(n.focusclass),t.removeclass(n.activeclass)},mouseenter:function(){t.addclass(n.hoverclass)},mouseleave:function(){t.removeclass(n.hoverclass),t.removeclass(n.activeclass)},"mousedown touchbegin":function(){e.is(":disabled")||t.addclass(n.activeclass)},"mouseup touchend":function(){t.removeclass(n.activeclass)}})}function i(e,t){e.removeclass(t.hoverclass+" "+t.focusclass+" "+t.activeclass)}function r(e,t,n){n?e.addclass(t):e.removeclass(t)}function l(e,t,n){var s="checked",a=t.is(":"+s);t.prop?t.prop(s,a):a?t.attr(s,s):t.removeattr(s),r(e,n.checkedclass,a)}function u(e,t,n){r(e,n.disabledclass,t.is(":disabled"))}function o(e,t,n){switch(n){case"after":return e.after(t),e.next();case"before":return e.before(t),e.prev();case"wrap":return e.wrap(t),e.parent()}return null}function c(t,s,a){var i,r,l;return a||(a={}),a=e.extend({bind:{},divclass:null,divwrap:"wrap",spanclass:null,spanhtml:null,spanwrap:"wrap"},a),i=e("
"),r=e(""),s.autohide&&t.is(":hidden")&&"none"===t.css("display")&&i.hide(),a.divclass&&i.addclass(a.divclass),s.wrapperclass&&i.addclass(s.wrapperclass),a.spanclass&&r.addclass(a.spanclass),l=n(t,"id"),s.useid&&l&&n(i,"id",s.idprefix+"-"+l),a.spanhtml&&r.html(a.spanhtml),i=o(t,i,a.divwrap),r=o(t,r,a.spanwrap),u(i,t,s),{div:i,span:r}}function d(t,n){var s;return n.wrapperclass?(s=e("").addclass(n.wrapperclass),s=o(t,s,"wrap")):null}function f(){var t,n,s,a;return a="rgb(120,2,153)",n=e(''),e("body").append(n),s=n.get(0),t=window.getcomputedstyle?window.getcomputedstyle(s,"").color:(s.currentstyle||s.style||{}).color,n.remove(),t.replace(/ /g,"")!==a}function p(t){return t?e("").text(t).html():""}function m(){return navigator.cpuclass&&!navigator.product}function v(){return window.xmlhttprequest!==void 0?!0:!1}function h(e){var t;return e[0].multiple?!0:(t=n(e,"size"),!t||1>=t?!1:!0)}function c(){return!1}function w(e,t){var n="none";s(e,t,{"selectstart dragstart mousedown":c}),e.css({mozuserselect:n,msuserselect:n,webkituserselect:n,userselect:n})}function b(e,t,n){var s=e.val();""===s?s=n.filedefaulthtml:(s=s.split(/[\/\\]+/),s=s[s.length-1]),t.text(s)}function y(e,t,n){var s,a;for(s=[],e.each(function(){var e;for(e in t)object.prototype.hasownproperty.call(t,e)&&(s.push({el:this,name:e,old:this.style[e]}),this.style[e]=t[e])}),n();s.length;)a=s.pop(),a.el.style[a.name]=a.old}function g(e,t){var n;n=e.parents(),n.push(e[0]),n=n.not(":visible"),y(n,{visibility:"hidden",display:"block",position:"absolute"},t)}function k(e,t){return function(){e.unwrap().unwrap().unbind(t.eventnamespace)}}var h=!0,x=!1,a=[{match:function(e){return e.is("a, button, :submit, :reset, input[type='button']")},apply:function(e,t){var r,l,o,d,f;return l=t.submitdefaulthtml,e.is(":reset")&&(l=t.resetdefaulthtml),d=e.is("a, button")?function(){return e.html()||l}:function(){return p(n(e,"value"))||l},o=c(e,t,{divclass:t.buttonclass,spanhtml:d()}),r=o.div,a(e,r,t),f=!1,s(r,t,{"click touchend":function(){var t,s,a,i;f||e.is(":disabled")||(f=!0,e[0].dispatchevent?(t=document.createevent("mouseevents"),t.initevent("click",!0,!0),s=e[0].dispatchevent(t),e.is("a")&&s&&(a=n(e,"target"),i=n(e,"href"),a&&"_self"!==a?window.open(i,a):document.location.href=i)):e.click(),f=!1)}}),w(r,t),{remove:function(){return r.after(e),r.remove(),e.unbind(t.eventnamespace),e},update:function(){i(r,t),u(r,e,t),e.detach(),o.span.html(d()).append(e)}}}},{match:function(e){return e.is(":checkbox")},apply:function(e,t){var n,r,o;return n=c(e,t,{divclass:t.checkboxclass}),r=n.div,o=n.span,a(e,r,t),s(e,t,{"click touchend":function(){l(o,e,t)}}),l(o,e,t),{remove:k(e,t),update:function(){i(r,t),o.removeclass(t.checkedclass),l(o,e,t),u(r,e,t)}}}},{match:function(e){return e.is(":file")},apply:function(t,r){function l(){b(t,p,r)}var d,f,p,v;return d=c(t,r,{divclass:r.fileclass,spanclass:r.filebuttonclass,spanhtml:r.filebuttonhtml,spanwrap:"after"}),f=d.div,v=d.span,p=e("").html(r.filedefaulthtml),p.addclass(r.filenameclass),p=o(t,p,"after"),n(t,"size")||n(t,"size",f.width()/10),a(t,f,r),l(),m()?s(t,r,{click:function(){t.trigger("change"),settimeout(l,0)}}):s(t,r,{change:l}),w(p,r),w(v,r),{remove:function(){return p.remove(),v.remove(),t.unwrap().unbind(r.eventnamespace)},update:function(){i(f,r),b(t,p,r),u(f,t,r)}}}},{match:function(e){if(e.is("input")){var t=(" "+n(e,"type")+" ").tolowercase(),s=" color date datetime datetime-local email month number password search tel text time url week ";return s.indexof(t)>=0}return!1},apply:function(e,t){var s,i;return s=n(e,"type"),e.addclass(t.inputclass),i=d(e,t),a(e,e,t),t.inputaddtypeasclass&&e.addclass(s),{remove:function(){e.removeclass(t.inputclass),t.inputaddtypeasclass&&e.removeclass(s),i&&e.unwrap()},update:c}}},{match:function(e){return e.is(":radio")},apply:function(t,r){var o,d,f;return o=c(t,r,{divclass:r.radioclass}),d=o.div,f=o.span,a(t,d,r),s(t,r,{"click touchend":function(){e.uniform.update(e(':radio[name="'+n(t,"name")+'"]'))}}),l(f,t,r),{remove:k(t,r),update:function(){i(d,r),l(f,t,r),u(d,t,r)}}}},{match:function(e){return e.is("select")&&!h(e)?!0:!1},apply:function(t,n){var r,l,o,d;return n.selectautowidth&&g(t,function(){d=t.width()}),r=c(t,n,{divclass:n.selectclass,spanhtml:(t.find(":selected:first")||t.find("option:first")).html(),spanwrap:"before"}),l=r.div,o=r.span,n.selectautowidth?g(t,function(){y(e([o[0],l[0]]),{display:"block"},function(){var e;e=o.outerwidth()-o.width(),l.width(d+e),o.width(d)})}):l.addclass("fixedwidth"),a(t,l,n),s(t,n,{change:function(){o.html(t.find(":selected").html()),l.removeclass(n.activeclass)},"click touchend":function(){var e=t.find(":selected").html();o.html()!==e&&t.trigger("change")},keyup:function(){o.html(t.find(":selected").html())}}),w(o,n),{remove:function(){return o.remove(),t.unwrap().unbind(n.eventnamespace),t},update:function(){n.selectautowidth?(e.uniform.restore(t),t.uniform(n)):(i(l,n),o.html(t.find(":selected").html()),u(l,t,n))}}}},{match:function(e){return e.is("select")&&h(e)?!0:!1},apply:function(e,t){var n;return e.addclass(t.selectmulticlass),n=d(e,t),a(e,e,t),{remove:function(){e.removeclass(t.selectmulticlass),n&&e.unwrap()},update:c}}},{match:function(e){return e.is("textarea")},apply:function(e,t){var n;return e.addclass(t.textareaclass),n=d(e,t),a(e,e,t),{remove:function(){e.removeclass(t.textareaclass),n&&e.unwrap()},update:c}}}];m()&&!v()&&(h=!1),e.uniform={defaults:{activeclass:"active",autohide:!0,buttonclass:"button",checkboxclass:"checker",checkedclass:"checked",disabledclass:"disabled",eventnamespace:".uniform",filebuttonclass:"action",filebuttonhtml:"choose file",fileclass:"uploader",filedefaulthtml:"no file selected",filenameclass:"filename",focusclass:"focus",hoverclass:"hover",idprefix:"uniform",inputaddtypeasclass:!0,inputclass:"uniform-input",radioclass:"radio",resetdefaulthtml:"reset",resetselector:!1,selectautowidth:!0,selectclass:"selector",selectmulticlass:"uniform-multiselect",submitdefaulthtml:"submit",textareaclass:"uniform",useid:!0,wrapperclass:null},elements:[]},e.fn.uniform=function(t){var n=this;return t=e.extend({},e.uniform.defaults,t),x||(x=!0,f()&&(h=!1)),h?(t.resetselector&&e(t.resetselector).mouseup(function(){window.settimeout(function(){e.uniform.update(n)},10)}),this.each(function(){var n,s,a,i=e(this);if(i.data("uniformed"))return e.uniform.update(i),void 0;for(n=0;a.length>n;n+=1)if(s=a[n],s.match(i,t))return a=s.apply(i,t),i.data("uniformed",a),e.uniform.elements.push(i.get(0)),void 0})):this},e.uniform.restore=e.fn.uniform.restore=function(n){n===t&&(n=e.uniform.elements),e(n).each(function(){var t,n,s=e(this);n=s.data("uniformed"),n&&(n.remove(),t=e.inarray(this,e.uniform.elements),t>=0&&e.uniform.elements.splice(t,1),s.removedata("uniformed"))})},e.uniform.update=e.fn.uniform.update=function(n){n===t&&(n=e.uniform.elements),e(n).each(function(){var t,n=e(this);t=n.data("uniformed"),t&&t.update(n,t.options)})}})(jquery);