text: /*! Ninja UI v1.0.0 ninjaui.com | ninjaui.com/#license */
  (function(a,b,c,d){function r(a,b){return a.keyCode===f[b]}function s(b,c){var d=a.map(c,function(a,b){return f[a]});return a.inArray(b.keyCode,d)>-1}function t(){return m++}"use strict";var e,f,g,h,i,j,k,l="http://www.w3.org/2000/svg",m,n=a.fn.jquery.split("."),o=parseFloat(n[1]),p=parseFloat(n[2]||"0"),q=a("<div>").appendTo("body");(o===4&&p<3||o<4)&&a.error("Ninja UI requires jQuery 1.4.3 or higher."),a("<link>",{rel:"stylesheet",href:"data:text/css;base64,LyohIE5pbmphIFVJIHZkZXZlbG9wbWVudCBuaW5qYXVpLmNvbSB8IG5pbmphdWkuY29tLyNsaWNlbnNlICovLm51aS1hdGMsLm51aS1tbnUsLm51aS1zbGQtdHJre3Bvc2l0aW9uOnJlbGF0aXZlfS5udWktYXRjIC5udWktaWNuW2FyaWEtbGFiZWw9c3Bpbl0sLm51aS1ibGssLm51aS1kbGcsLm51aS1kbGcgLm51aS1pY25bYXJpYS1sYWJlbD1YXSwubnVpLWxzdCwubnVpLXNsZC1idG4sLm51aS1zbGQtZ3J2e3Bvc2l0aW9uOmFic29sdXRlfS5udWktYXRjLC5udWktaWNuLC5udWktbW51LC5udWktc2xkLC5udWktdGFiLWhyentkaXNwbGF5OmlubGluZS1ibG9ja30ubnVpLWF0YyAubnVpLWljblthcmlhLWxhYmVsPXNwaW5de29wYWNpdHk6LjU7cmlnaHQ6MXB4O3RvcDoxcHh9Lm51aS1hdGMgaW5wdXR7cGFkZGluZy1yaWdodDoxN3B4fS5udWktYmxrLC5udWktZHJ3IC5udWktYnRuLC5udWktaXRte3dpZHRoOjEwMCV9Lm51aS1ibGssLm51aS1zbGQtYnRue2xlZnQ6MDt0b3A6MH0ubnVpLWJsa3tiYWNrZ3JvdW5kLWNvbG9yOnJnYmEoMjU1LDI1NSwyNTUsLjUpfS5udWktYnRuLC5udWktaXRtLm51aS1odnIsLm51aS1zbGQtYnRuLC5udWktc2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IGxpbmVhcjstbW96LWFuaW1hdGlvbjpzcGluIDEuNXMgaW5maW5pdGUgbGluZWFyOy1vLWFuaW1hdGlvbjpzcGluIDEuNXMgaW5maW5pdGUgbGluZWFyOy1tcy1hbmltYXRpb246c3BpbiAxLjVzIGluZmluaXRlIGxpbmVhcn1ALXdlYmtpdC1rZXlmcmFtZXMgc3BpbnswJXsgLXdlYmtpdC10cmFuc2Zvcm06cm90YXRlKDBkZWcpfTEwMCV7LXdlYmtpdC10cmFuc2Zvcm06cm90YXRlKDM2MGRlZyl9fUAtbW96LWtleWZyYW1lcyBzcGluezAleyAtbW96LXRyYW5zZm9ybTpyb3RhdGUoMGRlZyl9MTAwJXstbW96LXRyYW5zZm9ybTpyb3RhdGUoMzYwZGVnKX19QC1vLWtleWZyYW1lcyBzcGluezAleyAtby10cmFuc2Zvcm06cm90YXRlKDBkZWcpfTEwMCV7LW8tdHJhbnNmb3JtOnJvdGF0ZSgzNjBkZWcpfX1ALW1zLWtleWZyYW1lcyBzcGluezAleyAtbXMtdHJhbnNmb3JtOnJvdGF0ZSgwZGVnKX0xMDAley1tcy10cmFuc2Zvcm06cm90YXRlKDM2MGRlZyl9fQ=="}).prependTo("head"),q.html("<svg>"),j=(q.find("svg")[0]&&q.find("svg")[0].namespaceURI)===l,j?(i=!0,a.browser.safari&&(k=a.browser.version<535)):i=!!c.createElementNS&&!!c.createElementNS(l,"svg").createSVGRect,q.remove(),f={tab:9,enter:13,escape:27,arrowLeft:37,arrowUp:38,arrowRight:39,arrowDown:40},m=a.now(),g={attach:function(b){return this.each(function(){var c=a(this).ninja();a.isFunction(b)?c.bind("attach.ninja",b):c.trigger("attach.ninja")})},delist:function(b){return this.each(function(){var c=a(this).ninja();a.isFunction(b)?c.bind("delist.ninja",b):c.trigger("delist.ninja")})},deselect:function(b){return this.each(function(){var c=a(this).ninja();a.isFunction(b)?c.bind("deselect.ninja",b):c.is(".nui-slc")&&!c.is(".nui-dsb")&&c.trigger("deselect.ninja")})},detach:function(b){return this.each(function(){var c=a(this).ninja();a.isFunction(b)?c.bind("detach.ninja",b):(c.trigger("detach.ninja"),a.fn.detach.apply(c))})},disable:function(b){return this.each(function(){var c=a(this).ninja();a.isFunction(b)?c.bind("disable.ninja",b):c.fadeTo("fast",.5).addClass("nui-dsb").trigger("disable.ninja")})},enable:function(b){return this.each(function(){var c=a(this).ninja();a.isFunction(b)?c.bind("enable.ninja",b):c.fadeTo("fast",1).removeClass("nui-dsb").trigger("enable.ninja")})},list:function(d){return this.each(function(){d=a.extend({},e,d);var f=null,g=a(this).ninja(),h=g.find("button"),i=g.find("input"),j=a("<div>",{"class":"nui-lst"});g.is(".nui-atc")&&g.find(".nui-icn[aria-label=spin]").hide(),d.values.length&&(g.bind({"delist.ninja":function(){a(c).unbind("click.ninja keydown.ninja keyup.ninja"),j.detach(),f&&f.removeClass("nui-hvr")}}),g.append(j),a(c).bind({"keydown.ninja":function(a){s(a,["arrowDown","arrowUp","tab"])&&a.preventDefault()},"keyup.ninja":function(a){if(s(a,["arrowDown","arrowUp","enter","escape","tab"])){if(r(a,"enter"))f&&f.click();else if(r(a,"escape"))g.delist();else if(s(a,["arrowDown","tab"])&&!a.shiftKey)f?f.nextAll(".nui-itm").length?f.nextAll(".nui-itm:first").trigger("mouseenter.ninja"):j.find(".nui-itm:first").trigger("mouseenter.ninja"):j.find(".nui-itm:first").trigger("mouseenter.ninja");else if(r(a,"arrowUp")||a.shiftKey&&r(a,"tab"))f?f.prevAll(".nui-itm").length?f.prevAll(".nui-itm:first").trigger("mouseenter.ninja"):j.find(".nui-itm:last").trigger("mouseenter.ninja"):j.find(".nui-itm:last").trigger("mouseenter.ninja");return!1}},"click.ninja":function(a){g.delist()}}),d.query&&(d.values=a.map(d.values,function(a){return a.value=a.value||a.html||a,a.html&&(a.html=a.html.toString().replace(new RegExp(d.query,"gi"),"<b>"+d.query+"</b>")),a})),a.each(d.values,function(b,c){var d;c.rule?d=a("<div>",{"class":"nui-rul"}):(d=a("<button>",{"class":"nui-itm"}),d.bind({"mouseleave.ninja":function(){f.removeClass("nui-hvr")},"click.ninja":function(){h&&h.focus(),i&&i.val(c.value||c.html||c).focus(),a.isFunction(c.select)&&c.select()},"mouseenter.ninja":function(){h&&h.blur(),f&&f.trigger("mouseleave.ninja"),f=d.addClass("nui-hvr")}})),d.html(c.html||c).appendTo(j)}),j.offset().top+j.outerHeight()>a(b).scrollTop()+a(b).height()?j.css({bottom:0}):j.css({top:g.outerHeight()}),j.offset().left+j.outerWidth()>a(b).scrollLeft()+a(b).width()?j.css({right:0}):j.css({left:0}))})},placeholder:function(b){return this.each(function(){var c=a(this).ninja(),d;c.is("input[type=search], input[type=text]")&&("placeholder"in c?c.attr("placeholder",b):c.bind({"blur.ninja":function(){d=c.val();if(d===""||d===b)c.addClass("nui-plc"),d===""&&c.val(b)},"focus.ninja":function(){c.val()===b&&c.removeClass("nui-plc").val("")}}).trigger("blur.ninja"))})},select:function(b){return this.each(function(){var c=a(this).ninja();a.isFunction(b)?c.bind("select.ninja",b):c.is(".nui-dsb")||c.trigger("select.ninja")})},values:function(b){return this.each(function(){var c=a(this).ninja();a.isFunction(b)?c.bind("values.ninja",b):c.val()!==""&&c.trigger("values.ninja")})}},h={autocomplete:function(b){b=a.extend({},e,b);var c,d=a.ninja.icon({value:"spin"}).hide(),f=a("<input>",{type:"text"}).bind({"keyup.ninja":function(a){clearTimeout(c),!s(a,["arrowDown","arrowLeft","arrowRight","arrowUp","enter","escape","tab"])&&f.val()!==""&&(c=setTimeout(function(){d.show(),f.values()},1e3))}}),g=a("<span>",{"class":"nui-atc"}).bind({"select.ninja":function(b){b.html?f.val(a.trim(b.html.toString().replace(new RegExp("/</?[^>]+>/","gi"),""))):b.html=f.val()},"values.ninja":function(a){f.delist(),a.query=f.val()}});return g.append(f,d),b.placeholder&&f.ninja().placeholder(b.placeholder),g.ninja()},button:function(b){b=a.extend({},e,b);var c=a("<button>",{"class":"nui-btn",css:b.css,html:b.html});return c.bind({"click.ninja":function(a){c.is(".nui-dsb")||(c.is(".nui-slc")?c.trigger("deselect.ninja"):c.trigger("select.ninja")),a.stopImmediatePropagation()},"deselect.ninja":function(){c.removeClass("nui-slc")},"disable.ninja":function(){c.attr({disabled:"disabled"})},"enable.ninja":function(){c.attr({disabled:!1})},"select.ninja":function(){c.addClass("nui-slc")}}),b.select&&c.trigger("select.ninja"),b.disable&&c.ninja().disable(),c.ninja()},dialog:function(d){d=a.extend({},e,{$parent:a("body")},d);var f=a("<span>",{"class":"nui-dlg",css:d.css,html:d.html}),g=a.ninja.icon({value:"X"}).bind("click.ninja",function(){f.detach()}).appendTo(f),h=a("<div>",{"class":"nui-blk"}).bind("click.ninja",function(b){a.inArray(f[0],a(b.target).parents())===-1&&f.detach()});return f.bind({"attach.ninja":function(e){d.$parent.append(h,f),h.height(d.$parent.height()),f.css({left:a(b).width()/2-f.width()/2,top:a(b).height()/2-f.height()/2+a(b).scrollTop()}),a(c).bind({"keyup.ninja":function(a){r(a,"escape")&&f.detach()}})},"detach.ninja remove.ninja":function(){a(c).unbind("click.ninja keydown.ninja"),h.detach()}}),f.ninja()},drawer:function(b){b=a.extend({},e,b);var c=a("<div>",{"class":"nui-drw"}),d=a("<div>",{"class":"nui-try",html:b.html}).appendTo(c),f=a.ninja.icon({value:"arrow-down"}),g=a.ninja.icon({value:"arrow-right"}),h=a.ninja.button(a.extend({},b,{select:b.select,html:b.value})).bind({"deselect.ninja":function(){d.slideUp("fast",function(){f.remove(),g.prependTo(h)})},"select.ninja":function(){g.remove(),f.prependTo(h),d.slideDown("fast")}}).prependTo(c);return b.select?f.prependTo(h):(d.hide(),g.prependTo(h)),c.ninja()},icon:function(c){c=a.extend({},e,{value:"spin"},c);var d=t(),f="mask"+d,g,h=a("<circle>"),l=a("<defs>"),m=a("<g>",{"stroke-width":0}),n,o=a("<rect>"),p=a("<mask>",{id:f}).append(o.clone().attr({fill:"#fff",height:16,width:16})),q=a("<polygon>"),r=a("<svg>",{"aria-label":c.value,"class":"nui-icn",role:"img",version:"1.1",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"}).attr({height:16,width:16});return a.inArray(c.value,["-","+","camera","x"])>-1&&(g=!0,p.appendTo(l)),a.inArray(c.value,["arrow-down","arrow-right"])>-1?c.value==="arrow-down"?q.attr("points","4,4 12,4 8,12").appendTo(m):q.attr("points","4,4 12,8 4,12").appendTo(m):c.value==="camera"?(h.clone().attr({cx:8,cy:9,r:5}).appendTo(p),o.attr({height:11,mask:"url(#"+f+")",rx:2,ry:2,width:16,x:0,y:4}).appendTo(m),q.attr({mask:"url(#"+f+")",points:"4,8 4,4 6,1 10,1 12,4 12,8"}).appendTo(m),h.attr({cx:8,cy:9,r:3}).appendTo(m)):a.inArray(c.value,["X","x","-","+"])>-1?(c.value==="-"?o.clone().attr({height:2,width:8,x:4,y:7}).appendTo(p):(q.attr("points","7,4 9,4 9,7 12,7 12,9 9,9 9,12 7,12 7,9 4,9 4,7 7,7").appendTo(p),c.value!=="+"&&q.attr("transform","rotate(45 8 8)")),h.attr({cx:8,cy:8}).appendTo(m),c.value==="X"?(h.attr({r:7,"stroke-width":1}),q.clone().attr("fill","#fff").appendTo(m)):h.attr({mask:"url(#"+f+")",r:8})):c.value==="email"?(q.clone().attr({points:"0,2 8,10 16,2"}).appendTo(m),q.clone().attr({points:"16,4 12,8 16,12"}).appendTo(m),q.clone().attr({points:"0,14 5,9 8,12 11,9 16,14"}).appendTo(m),q.attr({points:"0,4 4,8 0,12"}).appendTo(m)):c.value==="go"?(h.attr({cx:8,cy:8}).appendTo(m),h.clone().attr({fill:"none","stroke-width":2,r:7}).appendTo(m),h.attr({r:5}).appendTo(m)):c.value==="home"?(q.attr("points","0,10 0,8 8,0 16,8 16,10 14,10 14,16 10,16 10,10 6,10 6,16 2,16 2,10").appendTo(m),o.attr({height:8,width:4,x:10,y:0}).appendTo(m)):c.value==="search"?(h.attr({cx:7,cy:7,fill:"none",r:5,"stroke-width":2}).appendTo(m),q.attr("points","9,11 11,9 16,14 14,16").appendTo(m)):c.value==="star"?q.attr({points:"0,6 6,6 8,0 10,6 16,6 11,10 13,16 8,12 3,16 5,10","stroke-width":1}).appendTo(m):c.value==="stop"?(q.clone().attr({fill:"none",points:"1,11 1,5 5,1 11,1 15,5 15,11 11,15 5,15","stroke-width":2}).appendTo(m),q.attr("points","3,10 3,6 6,3 10,3 13,6 13,10 10,13 6,13").appendTo(m)):c.value==="yield"?(q.clone().attr({fill:"none",points:"8,1 15,15 1,15","stroke-width":2}).appendTo(m),q.attr("points","8,5 12,13 4,13").appendTo(m)):c.value==="spin"&&(o.attr({height:4,width:2,x:7}).appendTo(m),o.clone().attr({style:"opacity:.1",transform:"rotate(30 8 8)"}).appendTo(m),o.clone().attr({style:"opacity:.2",transform:"rotate(60 8 8)"}).appendTo(m),o.clone().attr({style:"opacity:.3",transform:"rotate(90 8 8)"}).appendTo(m),o.clone().attr({style:"opacity:.4",transform:"rotate(120 8 8)"}).appendTo(m),o.clone().attr({style:"opacity:.5",transform:"rotate(150 8 8)"}).appendTo(m),o.clone().attr({style:"opacity:.6",transform:"rotate(180 8 8)"}).appendTo(m),o.clone().attr({style:"opacity:.7",transform:"rotate(210 8 8)"}).appendTo(m),o.clone().attr({style:"opacity:.8",transform:"rotate(240 8 8)"}).appendTo(m),o.clone().attr({style:"opacity:.9",transform:"rotate(270 8 8)"}).appendTo(m),o.clone().attr({style:"opacity:.95",transform:"rotate(300 8 8)"}).appendTo(m),o.clone().attr({style:"opacity:.975",transform:"rotate(330 8 8)"}).appendTo(m)),c.css&&m.css(c.css),r.append("<title>"+c.value+"</title>",l,m),j&&(!g||g&&!k)?(n=a(a("<div>").append(r).html()),c.value==="spin"&&n.bind({"spin.ninja":function(){var a=0;setInterval(function(){a+=30,a===360&&(a=0),n.find("g").attr("transform","rotate("+a+" 8 8)")},100)}}).trigger("spin.ninja"),n):i?(m.attr({fill:"#333",stroke:"#333"}),a("<img>",{"aria-label":c.value,"class":"nui-icn",src:"data:image/svg+xml;base64,"+b.btoa((new XMLSerializer).serializeToString(r[0]))})):a("<span>",{"aria-label":c.value,"class":"nui-icn"})},menu:function(b){b=a.extend({},e,b);var c=a.ninja.icon({value:"arrow-down"}),d=a("<span>",{"class":"nui-mnu"}),f=a.ninja.button(a.extend({},b,{html:b.html})).select(function(){d.list(b)}).deselect(function(){d.delist()}).append(c);return d.bind({"delist.ninja":function(){f.deselect()}}).append(f),d.ninja()},rating:function(b){b=a.extend({},e,{average:0,individual:0,values:5},b);var c,d=a("<span>",{"class":"nui-rtn"}).bind({"mouseleave.ninja":function(){d.find(".nui-str").each(function(c,d){var e=a(d);b.individual===0&&(c<b.average?e.addClass("nui-avg"):e.removeClass("nui-avg")),c<b.individual?e.addClass("nui-ind"):e.removeClass("nui-ind")})}});for(c=0;c<b.values;c++)a("<button>",{"class":"nui-str",html:a.ninja.icon({value:"star"})}).appendTo(d);return d.find(".nui-str").each(function(c,e){c++;var f=a(e);f.bind({"click.ninja select.ninja":function(){b.individual=c,d.trigger("mouseleave.ninja").trigger({type:"select",value:c})},"mouseenter.ninja":function(){d.find(".nui-str").each(function(b,d){var e=a(d).removeClass("nui-avg");b<c?e.addClass("nui-ind"):e.removeClass("nui-ind")})}})}),d.trigger("mouseleave.ninja"),d.ninja()},slider:function(b){b=a.extend({},e,{value:0,width:200},b),b.value<0?b.value=0:b.value>b.values.length-1&&(b.value=b.values.length-1);var d=!1,f=0,g,h=b.values.length-1,i=b.width/h,j=b.value*i,k=a("<span>",{"class":"nui-sld-value",html:b.values[b.value].html}),l=a("<button>",{"class":"nui-sld-btn",css:{left:j}}),m=b.width+18,n=a("<div>",{"class":"nui-sld-lvl",css:{width:j}}),o=a("<span>",{"class":"nui-sld"}).bind({"change.ninja select.ninja":function(a){var c;a.sliderX<0?c=0:a.sliderX>h?c=h:c=a.sliderX,a.value=b.values[c],k.html(a.value.html),j=c*i,l.css({left:j}),n.css({width:j})},"select.ninja":function(a){a.value.select&&a.value.select(a)}}).append(k),p=a("<div>",{"class":"nui-sld-trk",css:{width:m}}).appendTo(o),q=a("<div>",{"class":"nui-sld-grv"}).bind("click.ninja",function(a){l.trigger({type:"select.ninja",sliderX:Math.round((a.pageX-p.offset().left)/i)})});return p.append(q.append(n),l),b.html&&k.before(a("<span>",{"class":"nui-sld-ttl",html:b.html+": "})),l.bind({"keyup.ninja":function(a){if(s(a,["arrowLeft","arrowRight"])){var c,d=Math.round(l.position().left/i);return d>0&&r(a,"arrowLeft")?d--:d<h&&r(a,"arrowRight")&&d++,c=b.values[d],k.html(c.html),j=d*i,l.css({left:j}),n.css({width:j}),!1}},"mousedown.ninja touchstart.ninja":function(a){return a.preventDefault(),l.addClass("nui-slc"),!1},"mousedown.ninja":function(b){f=b.pageX-l.position().left,d=!0,a(c).bind({"mousemove.ninja":function(a){if(!d)return;o.trigger({type:"change.ninja",sliderX:Math.round((a.pageX-f)/i)})},"mouseup.ninja":function(b){l.removeClass("nui-slc"),d=!1,l.trigger({type:"select.ninja",sliderX:Math.round((b.pageX-f)/i)}),a(c).unbind("mousemove.ninja mouseup.ninja")}})},"touchstart.ninja":function(a){g=a.originalEvent.targetTouches[0]||a.originalEvent.changedTouches[0],f=g.pageX-l.position().left},"touchmove.ninja":function(a){a.preventDefault();if(!g)return;g=a.originalEvent.targetTouches[0]||a.originalEvent.changedTouches[0],o.trigger({type:"change.ninja",sliderX:Math.round((g.pageX-f)/i)})},"touchend.ninja":function(a){a.preventDefault(),l.removeClass("nui-slc").trigger({type:"select.ninja",sliderX:Math.round((g.pageX-f)/i)})}}),o.ninja()},tabs:function(b){b=a.extend({},e,{value:1},b);var c=a("<span>");return b.vertical?c.addClass("nui-tab-vrt"):c.addClass("nui-tab-hrz"),a.each(b.values,function(d,e){var f=a("<button>",{"class":"nui-tab",css:b.css,html:e.html||e}).bind({"click.ninja":function(){!f.is(".nui-dsb")&&!f.is(".nui-slc")&&f.trigger("select.ninja")},"disable.ninja":function(){f.attr({disabled:"disabled"})},"enable.ninja":function(){f.attr({disabled:!1})},"select.ninja":function(){c.children().not(f).removeClass("nui-slc"),f.addClass("nui-slc"),a.isFunction(e.select)&&e.select()}}).appendTo(c);d===b.value-1&&f.select()}),c.ninja()},version:function(){return"1.0.0"}},a.ninja=h,a.fn.ninja=function(){return this.extend(g)}})(jQuery,window,document)