forked from juijs/jui-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjui.min.js
8 lines (8 loc) · 242 KB
/
jui.min.js
1
2
3
4
5
6
7
8
!function(a,b,c){var d={jquery:a},e={},f=b.navigator,g={template:{evaluate:/<\!([\s\S]+?)\!>/g,interpolate:/<\!=([\s\S]+?)\!>/g,escape:/<\!-([\s\S]+?)\!>/g},logUrl:"tool/debug.html"},h=function(a,b){function c(b,c){var d=a[b];a[b]=a[c],a[c]=d}function d(b,d,f){var g=d,h=a[b];c(b,f);for(var i=d;f>i;i++)(e(a[i],h)||!e(h,a[i])&&i%2==1)&&(c(i,g),g++);return c(f,g),g}var e=null,a=b?a.slice(0):a;this.setCompare=function(a){e=a},this.run=function(b,c){var e=null;return"number"!=typeof b&&(b=0),"number"!=typeof c&&(c=a.length-1),c>b&&(e=b+Math.ceil(.5*(c-b)),newPivot=d(e,b,c),this.run(b,newPivot-1),this.run(newPivot+1,c)),a}},i=function(){this.isIndexDepth=function(a){return"string"==typeof a&&-1!=a.indexOf(".")?!0:!1},this.getIndexList=function(a){var b=[],c=""+a;if(1==c.length)b[0]=parseInt(a);else for(var d=c.split("."),e=0;e<d.length;e++)b[e]=parseInt(d[e]);return b},this.changeIndex=function(a,b,c){for(var d=this.getIndexList(c).length,e=this.getIndexList(a),f=this.getIndexList(b),g=0;d>g;g++)e.shift();return f.concat(e).join(".")},this.getNextIndex=function(a){var b=this.getIndexList(a),c=b.pop()+1;return b.push(c),b.join(".")},this.getParentIndex=function(a){if(!this.isIndexDepth(a))return null;var b=this.getIndexList(a);return 2==b.length?""+b[0]:b.length>2?(b.pop(),b.join(".")):void 0}},j={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var b,c,d,e,f,g,h,i="",k=0;for(a=j._utf8_encode(a);k<a.length;)b=a.charCodeAt(k++),c=a.charCodeAt(k++),d=a.charCodeAt(k++),e=b>>2,f=(3&b)<<4|c>>4,g=(15&c)<<2|d>>6,h=63&d,isNaN(c)?g=h=64:isNaN(d)&&(h=64),i=i+j._keyStr.charAt(e)+j._keyStr.charAt(f)+j._keyStr.charAt(g)+j._keyStr.charAt(h);return i},decode:function(a){var b,c,d,e,f,g,h,i="",k=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k<a.length;)e=j._keyStr.indexOf(a.charAt(k++)),f=j._keyStr.indexOf(a.charAt(k++)),g=j._keyStr.indexOf(a.charAt(k++)),h=j._keyStr.indexOf(a.charAt(k++)),b=e<<2|f>>4,c=(15&f)<<4|g>>2,d=(3&g)<<6|h,i+=String.fromCharCode(b),64!=g&&(i+=String.fromCharCode(c)),64!=h&&(i+=String.fromCharCode(d));return i=j._utf8_decode(i)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b=String.fromCharCode(239)+String.fromCharCode(187)+String.fromCharCode(191),c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):d>191&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&c2),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&c2)<<6|63&c3),c+=3);return b}},k=function(a,b,c){var d={},e={},f=Array.prototype,h=f.slice,i=f.forEach,j={"\\":"\\","'":"'",r:"\r",n:"\n",t:" ",u2028:"\u2028",u2029:"\u2029"};for(var k in j)j[j[k]]=k;var l=/\\|'|\r|\n|\t|\u2028|\u2029/g,m=/\\(\\|'|r|n|t|u2028|u2029)/g,n=/.^/,o=function(a){return a.replace(m,function(a,b){return j[b]})},p=d.each=d.forEach=function(a,b,c){if(null!=a)if(i&&a.forEach===i)a.forEach(b,c);else if(a.length===+a.length){for(var f=0,g=a.length;g>f;f++)if(f in a&&b.call(c,a[f],f,a)===e)return}else for(var h in a)if(d.has(a,h)&&b.call(c,a[h],h,a)===e)return};return d.has=function(a,b){return hasOwnProperty.call(a,b)},d.defaults=function(a){return p(h.call(arguments,1),function(b){for(var c in b)null==a[c]&&(a[c]=b[c])}),a},d.template=function(a,b,c){c=d.defaults(c||{},g.template);var e="__p+='"+a.replace(l,function(a){return"\\"+j[a]}).replace(c.escape||n,function(a,b){return"'+\n_.escape("+o(b)+")+\n'"}).replace(c.interpolate||n,function(a,b){return"'+\n("+o(b)+")+\n'"}).replace(c.evaluate||n,function(a,b){return"';\n"+o(b)+"\n;__p+='"})+"';\n";c.variable||(e="with(obj||{}){\n"+e+"}\n"),e="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+e+"return __p;\n";var f=new Function(c.variable||"obj","_",e);if(b)return f(b,d);var h=function(a){return f.call(this,a,d)};return h.source="function("+(c.variable||"obj")+"){\n"+e+"}",h},d.template(a,b,c)},l=d["util.base"]={browser:{webkit:"undefined"!=typeof b.webkitURL?!0:!1,mozilla:"undefined"!=typeof b.mozInnerScreenX?!0:!1,msie:-1!=f.userAgent.indexOf("Trident")?!0:!1},isTouch:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(f.userAgent),scrollWidth:function(){var b=a(".jui").size()>0&&this.browser.webkit?!0:!1,c=a('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div></div>');a("body").append(c);var d=a("div",c).innerWidth();c.css("overflow-y","auto");var e=a("div",c).innerWidth();return a(c).remove(),b?10:d-e},inherit:function(a,b){this.typeCheck("function",a)&&this.typeCheck("function",b)&&(a.parent=b,a.prototype=new b,a.prototype.constructor=a,a.prototype.parent=a.prototype,a.prototype.super=function(a,b){return this.constructor.prototype[a].apply(this,b)})},extend:function(a,b,c){function d(a){return l.typeCheck("object",a)}if(this.typeCheck("object",a)||(a={}),!this.typeCheck("object",b))return a;for(var e in b)c===!0?d(a[e])?this.extend(a[e],b[e],c):this.typeCheck("undefined",a[e])&&(a[e]=b[e]):d(a[e])?this.extend(a[e],b[e],c):a[e]=b[e];return a},pxToInt:function(a){return"string"==typeof a&&-1!=a.indexOf("px")?parseInt(a.split("px").join("")):a},clone:function(b){var c=a.isArray(b)?[]:{};for(var d in b)c[d]=this.typeCheck("object",b[d])?this.clone(b[d]):b[d];return c},deepClone:function(a,b){var c=null;if(b=b||{},this.typeCheck("array",a)){c=new Array(a.length);for(var d=0,e=a.length;e>d;d++)c[d]=this.deepClone(a[d],b)}else if(this.typeCheck("date",a))c=a;else if(this.typeCheck("object",a)){c={};for(var f in a)c[f]=b[f]?a[f]:this.deepClone(a[f],b)}else c=a;return c},sort:function(a){return new h(a)},runtime:function(a,b){var c=(new Date).getTime();b();var d=(new Date).getTime();console.log(a+" : "+(d-c)+"ms")},template:function(a,b){return b?k(a,b):k(a)},resize:function(c,d){var e=function(){var a=0;return function(){clearTimeout(a),a=setTimeout(c,d)}}();a(b).resize(function(){e()})},index:function(){return new i},chunk:function(a,b){for(var c=[],d=0,e=a.length;e>d;)c.push(a.slice(d,d+=b));return c},typeCheck:function(a,b){function c(a,b){return"string"!=typeof a?!1:"string"==a?"string"==typeof b:"integer"==a?"number"==typeof b&&b%1==0:"float"==a?"number"==typeof b&&b%1!=0:"number"==a?"number"==typeof b:"boolean"==a?"boolean"==typeof b:"undefined"==a?"undefined"==typeof b:"null"==a?null===b:"array"==a?b instanceof Array:"date"==a?b instanceof Date:"function"==a?"function"==typeof b:"object"==a?!("object"!=typeof b||null===b||b instanceof Array||b instanceof Date||b instanceof RegExp):!1}if("object"==typeof a&&a.length){for(var d=a,e=0;e<d.length;e++)if(c(d[e],b))return!0;return!1}return c(a,b)},typeCheckObj:function(a,b){if("object"==typeof a){var c=this;for(var d in a){var e=a[d];"function"==typeof e&&!function(d,e){a[d]=function(){for(var a=arguments,f=b[d],g=0;g<a.length;g++)if(!c.typeCheck(f[g],a[g]))throw new Error("JUI_CRITICAL_ERR: the "+g+"th parameter is not a "+f[g]+" ("+name+")");return e.apply(this,a)}}(d,e)}}},dataToCsv:function(a,b,c){for(var d="",e=c?c:b.length,f=-1;e>f;f++){for(var g=[],h=0;h<a.length;h++)a[h]&&g.push(-1==f?a[h]:b[f][a[h]]);d+=g.join(",")+"\n"}return d},dataToCsv2:function(b){for(var c="",d=a.extend({fields:null,rows:null,names:null,count:this.typeCheck("integer",b.count)?b.count:b.rows.length},b),e=-1;e<d.count;e++){for(var f=[],g=0;g<d.fields.length;g++)d.fields[g]&&f.push(-1==e?d.names&&d.names[g]?d.names[g]:d.fields[g]:d.rows[e][d.fields[g]]);c+=f.join(",")+"\n"}return c},fileToCsv:function(a,b){var c=new FileReader;c.onload=function(a){"function"==typeof b&&b(a.target.result)},c.readAsText(a)},csvToBase64:function(a){return"data:application/octet-stream;base64,"+j.encode(a)},csvToData:function(b,c,d){for(var e=[],f=c.split("\n"),g=1;g<f.length;g++)if(""!=f[g]){for(var h=f[g].split(","),i={},j=0;j<b.length;j++)i[b[j]]=h[j],-1!=a.inArray(b[j],d)&&(i[b[j]]=parseFloat(h[j]));e.push(i)}return e},getCsvFields:function(a,b){for(var c=this.typeCheck("array",b)?b:a,d=0;d<c.length;d++)isNaN(c[d])||(c[d]=a[c[d]]);return c},svgToBase64:function(a){return"data:image/svg+xml;base64,"+j.encode(a)},dateFormat:function(a,b,c){function d(a,b){var c=a+"";for(b=b||2;c.length<b;)c="0"+c;return c}var e=["\x00","January","February","March","April","May","June","July","August","September","October","November","December"],f=["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g=["","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["","Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=c?a.getUTCFullYear():a.getFullYear();b=b.replace(/(^|[^\\])yyyy+/g,"$1"+i),b=b.replace(/(^|[^\\])yy/g,"$1"+i.toString().substr(2,2)),b=b.replace(/(^|[^\\])y/g,"$1"+i);var j=(c?a.getUTCMonth():a.getMonth())+1;b=b.replace(/(^|[^\\])MMMM+/g,"$1"+e[0]),b=b.replace(/(^|[^\\])MMM/g,"$1"+f[0]),b=b.replace(/(^|[^\\])MM/g,"$1"+d(j)),b=b.replace(/(^|[^\\])M/g,"$1"+j);var k=c?a.getUTCDate():a.getDate();b=b.replace(/(^|[^\\])dddd+/g,"$1"+g[0]),b=b.replace(/(^|[^\\])ddd/g,"$1"+h[0]),b=b.replace(/(^|[^\\])dd/g,"$1"+d(k)),b=b.replace(/(^|[^\\])d/g,"$1"+k);var l=c?a.getUTCHours():a.getHours();b=b.replace(/(^|[^\\])HH+/g,"$1"+d(l)),b=b.replace(/(^|[^\\])H/g,"$1"+l);var m=l>12?l-12:0==l?12:l;b=b.replace(/(^|[^\\])hh+/g,"$1"+d(m)),b=b.replace(/(^|[^\\])h/g,"$1"+m);var n=c?a.getUTCMinutes():a.getMinutes();b=b.replace(/(^|[^\\])mm+/g,"$1"+d(n)),b=b.replace(/(^|[^\\])m/g,"$1"+n);var o=c?a.getUTCSeconds():a.getSeconds();b=b.replace(/(^|[^\\])ss+/g,"$1"+d(o)),b=b.replace(/(^|[^\\])s/g,"$1"+o);var p=c?a.getUTCMilliseconds():a.getMilliseconds();b=b.replace(/(^|[^\\])fff+/g,"$1"+d(p,3)),p=Math.round(p/10),b=b.replace(/(^|[^\\])ff/g,"$1"+d(p)),p=Math.round(p/10),b=b.replace(/(^|[^\\])f/g,"$1"+p);var q=12>l?"AM":"PM";b=b.replace(/(^|[^\\])TT+/g,"$1"+q),b=b.replace(/(^|[^\\])T/g,"$1"+q.charAt(0));var r=q.toLowerCase();b=b.replace(/(^|[^\\])tt+/g,"$1"+r),b=b.replace(/(^|[^\\])t/g,"$1"+r.charAt(0));var s=-a.getTimezoneOffset(),t=c||!s?"Z":s>0?"+":"-";if(!c){s=Math.abs(s);var u=Math.floor(s/60),v=s%60;t+=d(u)+":"+d(v)}b=b.replace(/(^|[^\\])K/g,"$1"+t);var w=(c?a.getUTCDay():a.getDay())+1;return b=b.replace(new RegExp(g[0],"g"),g[w]),b=b.replace(new RegExp(h[0],"g"),h[w]),b=b.replace(new RegExp(e[0],"g"),e[j]),b=b.replace(new RegExp(f[0],"g"),f[j]),b=b.replace(/\\(.)/g,"$1")},createId:function(a){return[a||"id",+new Date,Math.round(100*Math.random())%100].join("-")},btoa:j.encode,atob:j.decode,loop:function(a,b){var c=0,d=a,e=Math.ceil(a/5);return function(a){for(var f=c,g=1*e,h=2*e,i=3*e,j=4*e,k=g,l=h,m=i,n=j,o=d;k>f&&d>f;)a.call(b,f,1),f++,l>g&&d>g&&(a.call(b,g,2),g++),m>h&&d>h&&(a.call(b,h,3),h++),n>i&&d>i&&(a.call(b,i,4),i++),o>j&&d>j&&(a.call(b,j,5),j++)}},loopArray:function(a,b){var c=a.length,d=0,e=c,f=Math.ceil(c/5);return function(c){for(var g=d,h=1*f,i=2*f,j=3*f,k=4*f,l=h,m=i,n=j,o=k,p=e;l>g&&e>g;)c.call(b,a[g],g,1),g++,m>h&&e>h&&(c.call(b,a[h],h,2),h++),n>i&&e>i&&(c.call(b,a[i],i,3),i++),o>j&&e>j&&(c.call(b,a[j],j,4),j++),p>k&&e>k&&(c.call(b,a[k],k,5),k++)}},makeIndex:function(a,b){var c={},d=this.loopArray(a);return d(function(a,d){var e=a[b];"undefined"==typeof c[e]&&(c[e]=[]),c[e].push(d)}),c}},m=function(a){for(var b=[],c=0;c<a.length;c++){var e=d[a[c]];if(l.typeCheck(["function","object"],e))b.push(e);else{var f=n(a[c]);if(null==f)throw new Error("JUI_CRITICAL_ERR: '"+a[c]+"' is not loaded");b.push(f)}}return b},n=function(a){var b=null,a=a+".";for(var c in d)if(-1!=c.indexOf(a)&&l.typeCheck(["function","object"],d[c])){var e=c.split(a).join("");-1==e.indexOf(".")&&(null==b&&(b={}),b[e]=d[c])}return b};b.jui=c.jui={ready:function(){var b=[],c=2==arguments.length?arguments[1]:arguments[0],d=2==arguments.length?arguments[0]:null;if(!l.typeCheck(["array","null"],d)||!l.typeCheck("function",c))throw new Error("JUI_CRITICAL_ERR: Invalid parameter type of the function");a(function(){b=d?m(d):[n("ui"),n("uix"),l],c.apply(null,b)})},defineUI:function(a,b,c,f){if(!(l.typeCheck("string",a)&&l.typeCheck("array",b)&&l.typeCheck("function",c)&&l.typeCheck(["string","undefined"],f)))throw new Error("JUI_CRITICAL_ERR: Invalid parameter type of the function");if(l.typeCheck("function",d[a]))throw new Error("JUI_CRITICAL_ERR: '"+a+"' is already exist");if(l.typeCheck("undefined",f)&&(f="core"),!l.typeCheck("function",d[f]))throw new Error("JUI_CRITICAL_ERR: Parents are the only function");if(e[f]!==!0)throw new Error("JUI_CRITICAL_ERR: UI function can not be inherited");var g=m(b),h=c.apply(null,g);l.inherit(h,d[f]),d[a]=d.core.init({type:a,"class":h})},define:function(a,b,c,f){if(!(l.typeCheck("string",a)&&l.typeCheck("array",b)&&l.typeCheck("function",c)&&l.typeCheck(["string","undefined"],f)))throw new Error("JUI_CRITICAL_ERR: Invalid parameter type of the function");if(l.typeCheck("function",d[a]))throw new Error("JUI_CRITICAL_ERR: '"+a+"' is already exist");var g=m(b),h=c.apply(null,g);if(l.typeCheck("function",d[f])){if(e[f]!==!0)throw new Error("JUI_CRITICAL_ERR: UI function can not be inherited");l.inherit(h,d[f])}d[a]=h,e[a]=!0},defineOptions:function(b,c,d){function e(a,b){if(l.typeCheck("function",a)){if(l.typeCheck("function",a.setup)){var c=a.setup();for(var d in c)l.typeCheck("undefined",b[d])&&(b[d]=c[d])}e(a.parent,b)}return b}for(var f=e(b,{}),g=Object.keys(f),h=Object.keys(c),i=0;i<h.length;i++){var j=h[i];if(-1==a.inArray(j,g)&&-1==a.inArray(j,d))throw new Error("JUI_CRITICAL_ERR: '"+j+"' is not an option")}return l.extend(c,f,!0),c},include:function(a){if(!l.typeCheck("string",a))throw new Error("JUI_CRITICAL_ERR: Invalid parameter type of the function");var b=d[a];if(l.typeCheck(["function","object"],b))return b;var c=n(a);if(null==c)throw new Error("JUI_CRITICAL_ERR: '"+a+"' is not loaded");return c},includeAll:function(){var a=[];for(var b in d)a.push(d[b]);return a},log:function(a){var c=b.open(a||g.logUrl,"JUIM","width=1024, height=768, toolbar=no, menubar=no, resizable=yes");return jui.debugAll(function(a,b){c.log(a,b)}),c},setup:function(a){return l.typeCheck("object",a)&&(g=l.extend(g,a)),g}}}(jQuery||$,window,"undefined"!=typeof global?global:window),jui.define("core",["jquery","util.base"],function(a,b){var c=new function(){var d=[],e=[];this.add=function(a){d.push(a)},this.emit=function(a,b,c){for(var e=[],f=0;f<d.length;f++){var g=d[f];(a==g.selector||a==g.type)&&e.push(g)}for(var f=0;f<e.length;f++)for(var g=e[f],h=0;h<g.length;h++)g[h].emit(b,c)},this.get=function(a){if(b.typeCheck("integer",a))return d[a];if(b.typeCheck("string",a)){for(var c=0;c<d.length;c++){var e=d[c];if(a==e.selector)return 1==e.length?e[0]:e}for(var f=[],c=0;c<d.length;c++){var e=d[c];a==e.type&&f.push(e)}return f}},this.getAll=function(){return d},this.remove=function(a){return b.typeCheck("integer",a)?d.splice(a,1)[0]:void 0},this.shift=function(){return d.shift()},this.pop=function(){return d.pop()},this.size=function(){return d.length},this.debug=function(b,c,d,e){if(b.__proto__){var f=["emit","on","addEvent","addValid","callBefore","callAfter","callDelay","setTpl","setVo","setOption"];for(var g in b){var h=b[g];"function"==typeof h&&-1==a.inArray(g,f)&&!function(a,d,f,g){b.__proto__[a]=function(){var b=Date.now(),h=d.apply(this,arguments),i=Date.now();return"function"==typeof e?e({type:jui.get(c).type,name:a,c_index:f,u_index:g,time:i-b},arguments):(console.log(isNaN(f)||isNaN(g)?"NAME("+a+"), TIME("+(i-b)+"ms), ARGUMENTS...":"TYPE("+jui.get(c).type+"), NAME("+a+"), INDEX("+f+":"+g+"), TIME("+(i-b)+"ms), ARGUMENTS..."),console.log(arguments),console.log("")),h}}(g,h,c,d)}}},this.debugAll=function(a){for(var b=0;b<d.length;b++)for(var c=d[b],e=0;e<c.length;e++)this.debug(c[e],b,e,a)},this.addClass=function(a){e.push(a)},this.getClass=function(a){if(b.typeCheck("integer",a))return e[a];if(b.typeCheck("string",a))for(var c=0;c<e.length;c++)if(a==e[c].type)return e[c];return null},this.getClassAll=function(){return e},this.create=function(a,d,e){var f=c.getClass(a);if(b.typeCheck("null",f))throw new Error("JUI_CRITICAL_ERR: '"+a+"' does not exist");return f["class"](d,e)}},d=function(){function c(b){for(var c=["webkit","moz","MS","o",""],d=0;d<c.length;d++){var e=b.type;c[d]||(e=e.toLowerCase()),a(b.target).on(c[d]+e,b.callback)}g.push(b)}function d(b){b.callback&&!b.children?a(b.target).on(b.type,b.callback):a(b.target).on(b.type,b.children,b.callback),g.push(b)}function e(b){b.callback&&!b.children?a(b.target).on(f(b.type),b.callback):a(b.target).on(f(b.type),b.children,b.callback),g.push(b)}function f(a){return{click:"touchstart",dblclick:"touchend",mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"}[a]}var g=[];this.add=function(f){var g={target:f[0],type:f[1]};b.typeCheck("function",f[2])?g=a.extend(g,{callback:f[2]}):b.typeCheck("string",f[2])&&(g=a.extend(g,{children:f[2],callback:f[3]}));for(var h=b.typeCheck("array",g.type)?g.type:[g.type],i=0;i<h.length;i++)g.type=h[i],-1!=g.type.toLowerCase().indexOf("animation")?c(g):("body"!=g.target&&g.target!=window&&a(g.target).off(g.type),b.isTouch?e(g):d(g))},this.trigger=function(c,d){a(c).trigger(b.isTouch?f(d):d)},this.get=function(a){return g[a]},this.getAll=function(){return g},this.size=function(){return g.length}},e=function(a,b,c,d){this.type=a,this.selector=b,this.options=c,this.destroy=function(){for(var a=0;a<d.length;a++)d[a].destroy()};for(var e=0;e<d.length;e++)this.push(d[e])};e.prototype=Object.create(Array.prototype);var f=function(){var c=null;this.find=function(b){return a(this.root).find(b)},this.emit=function(a,b){if("string"==typeof a){for(var c,d=0;d<this.event.length;d++){var e=this.event[d];if(e.type==a.toLowerCase()){var f="object"==typeof b&&b.length?b:[b];c=e.callback.apply(this,f)}}return c}},this.on=function(a,b){"string"==typeof a&&"function"==typeof b&&this.event.push({type:a.toLowerCase(),callback:b,unique:!1})},this.off=function(a){for(var b=[],c=0;c<this.event.length;c++){var d=this.event[c];("function"==typeof a&&d.callback!=a||"string"==typeof a&&d.type!=a.toLowerCase())&&b.push(d)}this.event=b},this.addEvent=function(){this.listen.add(arguments)},this.addTrigger=function(a,b){this.listen.trigger(a,b)},this.addValid=function(a,c){if(this.__proto__){var d=this.__proto__[a];this.__proto__[a]=function(){for(var e=arguments,f=0;f<e.length;f++)if(!b.typeCheck(c[f],e[f]))throw new Error("JUI_CRITICAL_ERR: the "+f+"th parameter is not a "+c[f]+" ("+a+")");return d.apply(this,e)}}},this.callBefore=function(a,b){if(this.__proto__){var c=this.__proto__[a];this.__proto__[a]=function(){var a=arguments;return"function"!=typeof b?c.apply(this,a):b.apply(this,a)!==!1?c.apply(this,a):void 0}}},this.callAfter=function(a,b){if(this.__proto__){var c=this.__proto__[a];this.__proto__[a]=function(){var a=arguments,d=c.apply(this,a);return"function"==typeof b&&d!==!1&&b.apply(this,a),d}}},this.callDelay=function(a,b){function c(a,c){var e=d.apply(a,c);"function"==typeof b.after&&e!==!1&&b.after.apply(a,c)}if(this.__proto__){var d=this.__proto__[a],e=isNaN(b.delay)?0:b.delay;this.__proto__[a]=function(){var a=this,d=arguments;"function"==typeof b.before&&b.before.apply(a,d),e>0?setTimeout(function(){c(a,d)},e):c(a,d)}}},this.setTpl=function(a,c){this.tpl[a]=b.template(c)},this.setVo=function(){this.options.vo&&(null!=c&&c.reload(),c=a(this.selector).jbinder(),this.bind=c)},this.setOption=function(a,b){if("object"==typeof a)for(var c in a)this.options[c]=a[c];else this.options[a]=b},this.destroy=function(){if(this.__proto__){for(var b=0;b<this.listen.size();b++){var c=this.listen.get(b);a(c.target).off(c.type)}for(var d in this.__proto__)delete this.__proto__[d]}}};return f.build=function(f){return function(g,h){var i=a(g),j=[];return i.each(function(c){var e=new f["class"],k=jui.defineOptions(f["class"],h||{});e.init.prototype=e,e.init.prototype.selector=i.selector,e.init.prototype.root=this,e.init.prototype.options=k,e.init.prototype.tpl={},e.init.prototype.event=new Array,e.init.prototype.listen=new d,e.init.prototype.timestamp=(new Date).getTime(),e.init.prototype.index=c,e.init.prototype.module=f,a("script").each(function(){if(g==a(this).data("jui")||g==a(this).data("vo")||g instanceof HTMLElement){var b=a(this).data("tpl");if(""==b)throw new Error("JUI_CRITICAL_ERR: 'data-tpl' property is required");k.tpl[b]=a(this).html()}});for(var l in k.tpl){var m=k.tpl[l];b.typeCheck("string",m)&&""!=m&&(e.init.prototype.tpl[l]=b.template(m))}var n=new e.init;for(var o in k.event)n.on(o,k.event[o]);j[c]=n,this.jui=n}),c.add(new e(f.type,g,h,j)),0==j.length?null:1==j.length?j[0]:j}},f.init=function(a){var b=null;return"object"==typeof a&&(b=f.build(a),c.addClass({type:a.type,"class":b})),b},f.setup=function(){return{tpl:{},event:{},vo:null}},window.jui="object"==typeof jui?a.extend(jui,c):c,f}),jui.define("util.math",[],function(){var a={rotate:function(a,b,c){return{x:a*Math.cos(c)-b*Math.sin(c),y:a*Math.sin(c)+b*Math.cos(c)}},radian:function(a){return a*Math.PI/180},degree:function(a){return 180*a/Math.PI},angle:function(a,b,c,d){var e=c-a,f=d-b;return Math.atan2(f,e)},interpolateNumber:function(a,b){var c=b-a;return function(b){return a+c*b}},interpolateRound:function(a,b){var c=b-a;return function(b){return Math.round(a+c*b)}},nice:function(a,b,c,d){function e(a,b){var c=Math.floor(Math.log(a)/Math.LN10),d=a/Math.pow(10,c);return niceFraction=b?1.5>d?1:3>d?2:7>d?5:10:1>=d?1:2>=d?2:5>=d?5:10,niceFraction*Math.pow(10,c)}function f(){m=d?e(g-h,!1):g-h,l=d?e(m/k,!0):m/k,i=d?Math.floor(h/l)*l:h,j=d?Math.floor(g/l)*l:g}if(d=d||!1,a>b)var g=a,h=b;else var h=a,g=b;var i,j,k=c,l=0,m=[];return f(),{min:i,max:j,range:m,spacing:l}}};return a}),jui.define("util.time",["util.base"],function(a){var b={years:1,months:2,days:3,hours:4,minutes:5,seconds:6,milliseconds:7,weeks:8,add:function(a){if(arguments.length<=2)return a;if(arguments.length>2){for(var b=new Date(+a),c=1;c<arguments.length;c+=2){var d=arguments[c],e=arguments[c+1];this.years==d?b.setFullYear(b.getFullYear()+e):this.months==d?b.setMonth(b.getMonth()+e):this.days==d?b.setDate(b.getDate()+e):this.hours==d?b.setHours(b.getHours()+e):this.minutes==d?b.setMinutes(b.getMinutes()+e):this.seconds==d?b.setSeconds(b.getSeconds()+e):this.milliseconds==d?b.setMilliseconds(b.getMilliseconds()+e):this.weeks==d&&b.setDate(b.getDate()+7*e)}return b}},format:function(b,c,d){return a.dateFormat(b,c,d)}};return b}),jui.define("util.scale",["util.math","util.time"],function(a,b){var c={circle:function(){function a(){}var b=[],c=[],d=0;return a.domain=function(a){if("undefined"==typeof a)return b;for(var c=0;c<a.length;c++)b[c]=a[c];return this},a.range=function(a){if("undefined"==typeof a)return c;for(var b=0;b<a.length;b++)c[b]=a[b];return this},a.rangePoints=function(e,f){f=f||0;for(var g=b.length,h=(e[1]-e[0]-f)/g,i=[],j=0;j<b.length;j++)i[j]=0==j?e[0]+f/2+h/2:i[j-1]+h;return c=i,d=h,a},a.rangeBands=function(e,f,g){f=f||0,g=g||0;for(var h=b.length,i=h-1,j=(e[1]-e[0])/i,k=[],l=0;l<b.length;l++)k[l]=0==l?e[0]:j+k[l-1];return d=j,c=k,a},a.rangeBand=function(){return d},a},ordinal:function(){function a(a){var d=""+a;if("undefined"!=typeof e[d])return e[d];for(var f=-1,g=0;g<b.length;g++)if("string"==typeof a&&b[g]===a){f=g;break}return f>-1?(e[d]=c[f],c[f]):"undefined"!=typeof c[a]?(b[a]=a,e[d]=c[a],c[a]):null}var b=[],c=[],d=0,e={};return a.domain=function(a){if("undefined"==typeof a)return b;for(var c=0;c<a.length;c++)b[c]=a[c];return this},a.range=function(a){if("undefined"==typeof a)return c;for(var b=0;b<a.length;b++)c[b]=a[b];return this},a.rangePoints=function(e,f){f=f||0;for(var g=b.length,h=(e[1]-e[0]-f)/g,i=[],j=0;j<b.length;j++)i[j]=0==j?e[0]+f/2+h/2:i[j-1]+h;return c=i,d=h,a},a.rangeBands=function(e,f,g){f=f||0,g=g||0;for(var h=b.length,i=h-1,j=(e[1]-e[0])/i,k=[],l=0;l<b.length;l++)k[l]=0==l?e[0]:j+k[l-1];return d=j,c=k,a},a.rangeBand=function(){return d},a.invert=function(a){return Math.ceil(a/d)},a},time:function(){var a,d=[],e=c.linear(),f=e.domain;return e.domain=function(a){if(!arguments.length)return f.call(e);for(var b=0;b<a.length;b++)d[b]=+a[b];return f.call(e,d)},e.min=function(){return Math.min(d[0],d[d.length-1])},e.max=function(){return Math.max(d[0],d[d.length-1])},e.rate=function(a,b){return e(e.max()*(a/b))},e.ticks=function(c,f){for(var g=d[0],h=d[1],i=[];h>g;)i.push(new Date(+g)),g=b.add(g,c,f);i.push(new Date(+g));var j=e(i[0]),k=e(i[1]);return a=k-j,i},e.realTicks=function(c,f){var g=d[0],h=d[1],i=[],j=new Date(+g),k=null;for(c==b.years?k=new Date(j.getFullYear(),0,1):c==b.months?k=new Date(j.getFullYear(),j.getMonth(),1):c==b.days||c==b.weeks?k=new Date(j.getFullYear(),j.getMonth(),j.getDate()):c==b.hours?k=new Date(j.getFullYear(),j.getMonth(),j.getDate(),j.getHours(),0,0,0):c==b.minutes?k=new Date(j.getFullYear(),j.getMonth(),j.getDate(),j.getHours(),j.getMinutes(),0,0):c==b.seconds?k=new Date(j.getFullYear(),j.getMonth(),j.getDate(),j.getHours(),j.getMinutes(),j.getSeconds(),0):c==b.milliseconds&&(k=new Date(j.getFullYear(),j.getMonth(),j.getDate(),j.getHours(),j.getMinutes(),j.getSeconds(),j.getMilliseconds())),k=b.add(k,c,f);+h>+k;)i.push(new Date(+k)),k=b.add(k,c,f);var l=e(i[1]),m=e(i[2]);return a=m-l,i},e.rangeBand=function(){return a},e.invert=function(a){var b=c.linear().domain(e.range()).range(e.domain());return new Date(b(a))},e},linear:function(){function b(a){if(a>l)return g?b(l):e[0]+Math.abs(a-d[1])*o/p;if(k>a)return g?b(k):e[0]-Math.abs(a-d[0])*o/p;var c=(a-d[0])/o;return q(c)}var d=[0,1],e=[0,1],f=!1,g=!1,h={},i=null,j=null,k=null,l=null,m=null,n=null,o=null,p=null,q=null;return b.cache=function(){return h},b.min=function(){return Math.min.apply(Math,d)},b.max=function(){return Math.max.apply(Math,d)},b.rangeMin=function(){return Math.min.apply(Math,e)},b.rangeMax=function(){return Math.max.apply(Math,e)},b.rate=function(a,c){return b(b.max()*(a/c))},b.clamp=function(a){g=a||!1},b.domain=function(a){if(!arguments.length)return d;for(var c=0;c<a.length;c++)d[c]=a[c];return k=b.min(),l=b.max(),o=d[1]-d[0],this},b.range=function(c){if(!arguments.length)return e;for(var d=0;d<c.length;d++)e[d]=c[d];return i=a.interpolateRound(e[0],e[1]),j=a.interpolateNumber(e[0],e[1]),m=b.rangeMin(),n=b.rangeMax(),p=Math.abs(n-m),q=f?i:j,this},b.rangeRound=function(a){return f=!0,b.range(a)},b.invert=function(a){var b=c.linear().domain(e).range(d);return b(a)},b.ticks=function(b,c,e){if(e=e||1e4,0==d[0]&&0==d[1])return[];for(var f=a.nice(d[0],d[1],b||10,c||!1),g=[],h=f.min*e,i=f.max*e;i>=h;)g.push(h/e),h+=f.spacing*e;return g[g.length-1]*e!=i&&h>i&&g.push(i/e),d[0]>d[1]&&g.reverse(),g},b}};return c}),jui.define("util.color",[],function(){var a={regex:/(linear|radial)\((.*)\)(.*)/i,trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},lighten:function(a,b){a=a.replace(/[^0-9a-f]/gi,""),b=b||0;var c,d,e=[];for(d=0;6>d;d+=2)c=parseInt(a.substr(d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e.push(("00"+c).substr(c.length));return"#"+e.join("")},darken:function(a,b){return this.lighten(a,-b)},parse:function(a){return this.parseGradient(a)},parseGradient:function(a){var b=a.match(this.regex);if(!b)return a;var c=this.trim(b[1]),d=this.parseAttr(c,this.trim(b[2])),e=this.parseStop(this.trim(b[3])),f={type:c+"Gradient",attr:d,children:e};return f},parseStop:function(a){for(var b=a.split(","),c=[],d=0,e=b.length;e>d;d++){var a=b[d],f=a.split(" ");0!=f.length&&(1==f.length?c.push({type:"stop",attr:{"stop-color":f[0]}}):2==f.length?c.push({type:"stop",attr:{offset:f[0],"stop-color":f[1]}}):3==f.length&&c.push({type:"stop",attr:{offset:f[0],"stop-color":f[1],"stop-opacity":f[2]}}))}for(var g=-1,h=-1,d=0,e=c.length;e>d;d++){var a=c[d];if(0==d?a.offset||(a.offset=0):d==e-1&&(a.offset||(a.offset=1)),-1==g&&"undefined"==typeof a.offset)g=d;else if(-1==h&&"undefined"==typeof a.offset){h=d;for(var i=h-g,j=c[h].offset.indexOf("%")>-1?parseFloat(c[h].offset)/100:c[h].offset,k=c[g].offset.indexOf("%")>-1?parseFloat(c[g].offset)/100:c[g].offset,l=j-k,m=l/i,n=k+m,o=g+1;h>o;o++)c[o].offset=n,n+=m;g=h,h=-1}}return c},parseAttr:function(a,b){if("linear"!=a){for(var c=b.split(","),d=0,e=c.length;e>d;d++)-1==c[d].indexOf("%")&&(c[d]=parseFloat(c[d]));return{cx:c[0],cy:c[1],r:c[2],fx:c[3],fy:c[4]}}switch(b){case"":case"left":return{x1:0,y1:0,x2:1,y2:0,direction:b||"left"};case"right":return{x1:1,y1:0,x2:0,y2:0,direction:b};case"top":return{x1:0,y1:0,x2:0,y2:1,direction:b};case"bottom":return{x1:0,y1:1,x2:0,y2:0,direction:b};case"top left":return{x1:0,y1:0,x2:1,y2:1,direction:b};case"top right":return{x1:1,y1:0,x2:0,y2:1,direction:b};case"bottom left":return{x1:0,y1:1,x2:1,y2:0,direction:b};case"bottom right":return{x1:1,y1:1,x2:0,y2:0,direction:b};default:for(var c=b.split(","),d=0,e=c.length;e>d;d++)-1==c[d].indexOf("%")&&(c[d]=parseFloat(c[d]));return{x1:c[0],y1:c[1],x2:c[2],y2:c[3]}}}};return a}),jui.define("util.svg.element",[],function(){var a=function(){this.create=function(a,b){this.element=document.createElementNS("http://www.w3.org/2000/svg",a),this.childrens=[],this.parent=null,this.styles={},this.attributes={},this.attr(b)},this.each=function(a){if("function"==typeof a){for(var b=0,c=this.childrens.length;c>b;b++){var d=this.childrens[b];a.apply(d,[b,d])}return this.childrens}},this.get=function(a){return this.childrens[a]?this.childrens[a]:null},this.index=function(a){for(var b=0;b<this.childrens.length;b++)if(a==this.childrens[b])return b;return-1},this.append=function(b){return b instanceof a&&(b.parent&&b.remove(),this.childrens.push(b),b.parent=this),this},this.prepend=function(a){return this.insert(0,a)},this.insert=function(a,b){return b.parent&&b.remove(),this.childrens.splice(a,0,b),b.parent=this,this},this.remove=function(){for(var a=0,b=[],c=this.parent.childrens,d=0;d<c.length;d++){if(c[d]==this){a=d;break}b.push(c[d])}return this.parent.childrens=b,this},this.attr=function(a){if("undefined"!=typeof a&&a){if("string"==typeof a)return this.attributes[a]||this.element.getAttribute(a);for(var b in a)this.attributes[b]=a[b],-1!=b.indexOf("xlink:")?this.element.setAttributeNS("http://www.w3.org/1999/xlink",b,a[b]):this.element.setAttribute(b,a[b]);return this}},this.css=function(a){var b=[];for(var c in a)this.styles[c]=a[c];for(var c in a)b.push(c+":"+a[c]);return this.attr({style:b.join(";")}),this},this.html=function(a){return this.element.innerHTML=a,this},this.text=function(a){return this.element.appendChild(document.createTextNode(a)),this},this.on=function(a,b){return this.element.addEventListener(a,function(a){"function"==typeof b&&b.call(this,a)},!1),this},this.hover=function(a,b){return this.element.addEventListener("mouseover",function(b){"function"==typeof a&&a.call(this,b)},!1),this.element.addEventListener("mouseout",function(a){"function"==typeof b&&b.call(this,a)},!1),this},this.size=function(){var a={width:0,height:0},b=this.element.getBoundingClientRect();if(!b||0==b.width&&0==b.height){for(var c=["height","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"],d=["width","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],e=window.getComputedStyle(this.element),f=0;f<c.length;f++)a.height+=parseFloat(e[c[f]]);for(var f=0;f<d.length;f++)a.width+=parseFloat(e[d[f]]);a.width=a.width||this.element.getAttribute("width"),a.height=a.height||this.element.getAttribute("height")}else a.width=b.width,a.height=b.height;return isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a},this.is=function(a){return this instanceof jui.include(a)}};return a}),jui.define("util.svg.element.transform",["util.base"],function(a){var b=function(){function b(a){var b=[];for(var c in d)d[c]&&b.push(d[c]);a.attr({transform:b.join(" ")})}function c(a){for(var b=[],c=0;c<a.length;c++)b.push(a[c]);return b.join(",")}var d={};this.translate=function(){return d.translate="translate("+c(arguments)+")",b(this),this
},this.rotate=function(a,c,e){if(1==arguments.length)var f=a;else if(3==arguments.length)var f=a+" "+c+","+e;return d.rotate="rotate("+f+")",b(this),this},this.scale=function(){return d.scale="scale("+c(arguments)+")",b(this),this},this.skew=function(){return d.skew="skew("+c(arguments)+")",b(this),this},this.matrix=function(){return d.matrix="matrix("+c(arguments)+")",b(this),this},this.data=function(b){var c=this.attr("transform"),d={translate:/[^translate()]+/g,rotate:/[^rotate()]+/g,scale:/[^scale()]+/g,skew:/[^skew()]+/g,matrix:/[^matrix()]+/g};return a.typeCheck("string",c)?c.match(d[b])[0]:null}};return b},"util.svg.element"),jui.define("util.svg.element.path",["util.base"],function(a){var b=function(){var b=[];this.moveTo=function(a,c,d){return b.push((d||"m")+a+","+c),this},this.MoveTo=function(a,b){return this.moveTo(a,b,"M")},this.lineTo=function(a,c,d){return b.push((d||"l")+a+","+c),this},this.LineTo=function(a,b){return this.lineTo(a,b,"L")},this.hLineTo=function(a,c){return b.push((c||"h")+a),this},this.HLineTo=function(a){return this.hLineTo(a,"H")},this.vLineTo=function(a,c){return b.push((c||"v")+a),this},this.VLineTo=function(a){return this.vLineTo(a,"V")},this.curveTo=function(a,c,d,e,f,g,h){return b.push((h||"c")+a+","+c+" "+d+","+e+" "+f+","+g),this},this.CurveTo=function(a,b,c,d,e,f){return this.curveTo(a,b,c,d,e,f,"C")},this.sCurveTo=function(a,c,d,e,f){return b.push((f||"s")+a+","+c+" "+d+","+e),this},this.SCurveTo=function(a,b,c,d){return this.sCurveTo(a,b,c,d,"S")},this.qCurveTo=function(a,c,d,e,f){return b.push((f||"q")+a+","+c+" "+d+","+e),this},this.QCurveTo=function(a,b,c,d){return this.qCurveTo(a,b,c,d,"Q")},this.tCurveTo=function(a,c,d,e,f){return b.push((f||"t")+a+","+c+" "+d+","+e),this},this.TCurveTo=function(a,b,c,d){return this.tCurveTo(a,b,c,d,"T")},this.arc=function(a,c,d,e,f,g,h,i){return e=e?1:0,f=f?1:0,b.push((i||"a")+a+","+c+" "+d+" "+e+","+f+" "+g+","+h),this},this.Arc=function(a,b,c,d,e,f,g){return this.arc(a,b,c,d,e,f,g,"A")},this.closePath=function(a){return b.push(a||"z"),this},this.ClosePath=function(){return this.closePath("Z")},this.join=function(){b.length>0&&(this.attr({d:b.join(" ")}),b=[])},this.length=function(){var c=a.createId(),d=b.join(" "),e=document.createElement("svg"),f=document.createElementNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"id",c),f.setAttributeNS(null,"d",d),e.appendChild(f),document.body.appendChild(e);var g=document.getElementById(c).getTotalLength();return document.body.removeChild(e),g}};return b},"util.svg.element.transform"),jui.define("util.svg.element.path.symbol",["util.base"],function(){var a=function(){var a="";this.template=function(a,b){var c=a,d=half_r=a/2,e=b/2,f="a"+half_r+","+half_r+" 0 1,1 "+c+",0",g="a"+half_r+","+half_r+" 0 1,1 "+-c+",0",h={triangle:["m0,"+-e,"l"+d+","+b,"l"+-a+",0","l"+d+","+-b].join(" "),rect:["m"+-d+","+-e,"l"+a+",0","l0,"+b,"l"+-a+",0","l0,"+-b].join(" "),cross:["m"+-d+","+-e,"l"+a+","+b,"m0,"+-b,"l"+-a+","+b].join(" "),circle:["m"+-c+",0",f,g].join(" ")};return h.rectangle=h.rect,h},this.join=function(){a.length>0&&(this.attr({d:a}),a="")},this.add=function(b,c,d){a+=" M"+b+","+c+d},this.triangle=function(a,b,c,d){return this.MoveTo(a,b).moveTo(0,-d/2).lineTo(c/2,d).lineTo(-c,0).lineTo(c/2,-d)},this.rect=this.rectangle=function(a,b,c,d){return this.MoveTo(a,b).moveTo(-c/2,-d/2).lineTo(c,0).lineTo(0,d).lineTo(-c,0).lineTo(0,-d)},this.cross=function(a,b,c,d){return this.MoveTo(a,b).moveTo(-c/2,-d/2).lineTo(c,d).moveTo(0,-d).lineTo(-c,d)},this.circle=function(a,b,c){return this.MoveTo(a,b).moveTo(-c,0).arc(c/2,c/2,0,1,1,c,0).arc(c/2,c/2,0,1,1,-c,0)}};return a},"util.svg.element.path"),jui.define("util.svg.element.path.rect",["util.math"],function(a){var b=function(){this.round=function(a,b,c,d,e,f){c=c?c:0,d=d?d:0,e=e?e:0,f=f?f:0,this.MoveTo(0,c).Arc(c,c,0,0,1,c,0).HLineTo(a-d).Arc(d,d,0,0,1,a,d).VLineTo(b-e).Arc(e,e,0,0,1,a-e,b).HLineTo(f).Arc(f,f,0,0,1,0,b-f).ClosePath().join()},this.rect3d=function(b,c,d,e){var f=a.radian(d),g=0,h=0,i=b,j=c,k=Math.cos(f)*e+g,l=Math.sin(f)*e+h,m=b+k,n=c+l,o=svg.group({width:m,height:n},function(){this.MoveTo(k,g).LineTo(m,h).LineTo(i,l).LineTo(g,l),this.MoveTo(g,l).LineTo(g,n).LineTo(i,n).LineTo(i,l).ClosePath(),this.MoveTo(i,n).LineTo(m,j).LineTo(m,h).LineTo(i,l).ClosePath()});return o}};return b},"util.svg.element.path"),jui.define("util.svg.element.poly",[],function(){var a=function(){var a=[];this.point=function(b,c){return a.push(b+","+c),this},this.join=function(){if(a.length>0){var b=a[0];a.push(b),this.attr({points:a.join(" ")}),a=[]}}};return a},"util.svg.element.transform"),jui.define("util.svg",["util.base","util.math","util.svg.element","util.svg.element.transform","util.svg.element.path","util.svg.element.path.symbol","util.svg.element.path.rect","util.svg.element.poly"],function(a,b,c,d,e,f,g,h){var i=function(b,i){function j(){n.root=o=new c,p=new d,q=new d,o.create("svg",i),p.create("g"),q.create("g"),p.translate(.5,.5),q.translate(.5,.5),b.appendChild(o.element),o.append(p),o.append(q)}function k(b,c,d,e){return b.create(c,d),0==s?p.append(b):r[s].append(b),a.typeCheck("function",e)&&(s++,r[s]=b,e.call(b),s--),b}function l(a,b,c,d){if(a.parent==p)throw new Error("JUI_CRITICAL_ERR: Parents are required elements of the '"+b+"'");return k(a,b,c,d)}function m(a){for(var b=a.childrens.length,c=0;b>c;c++){var d=a.childrens[c];d&&(d.childrens.length>0&&m(d),(d instanceof e||d instanceof h)&&d.join(),d.parent==a&&a.element.appendChild(d.element))}}var n=this,o=null,p=null,q=null,r={},s=0,t=!1;this.size=function(){if(2!=arguments.length)return o.size();var a=arguments[0],b=arguments[1];o.attr({width:a,height:b})},this.clear=function(a){p.each(function(){this.element.parentNode&&p.element.removeChild(this.element)}),a===!0&&q.each(function(){this.element.parentNode&&q.element.removeChild(this.element)})},this.reset=function(a){this.clear(a),p.childrens=[],a===!0&&(q.childrens=[])},this.render=function(a){this.clear(),m(t===!1||a===!0?o:p),t=!0},this.download=function(b){a.typeCheck("string",b)&&(b=b.split(".")[0]);var c=document.createElement("a");c.download=b?b+".svg":"svg.svg",c.href=this.toDataURL(),document.body.appendChild(c),c.click(),c.parentNode.removeChild(c)},this.downloadImage=function(b,c){c=c||"image/png";var d=new Image,e=this.size(),f=this.toDataURL().replace('width="100%"','width="'+e.width+'"').replace('height="100%"','height="'+e.height+'"');d.onload=function(){var e=document.createElement("canvas");e.width=d.width,e.height=d.height;var f=e.getContext("2d");f.drawImage(d,0,0);var g=e.toDataURL(c);a.typeCheck("string",b)&&(b=b.split(".")[0]);var h=document.createElement("a");h.download=b?b+".png":"svg.png",h.href=g,document.body.appendChild(h),h.click(),h.parentNode.removeChild(h)},d.src=f},this.exportCanvas=function(a){var b=new Image,c=this.size(),d=this.toDataURL().replace('width="100%"','width="'+c.width+'"').replace('height="100%"','height="'+c.height+'"');b.onload=function(){a.width=b.width,a.height=b.height;var c=a.getContext("2d");c.drawImage(b,0,0)},b.src=d},this.toXml=function(){var a=b.innerHTML;return a=a.replace('xmlns="http://www.w3.org/2000/svg"',""),['<?xml version="1.0" encoding="utf-8"?>',a.replace("<svg ",'<svg xmlns="http://www.w3.org/2000/svg" ')].join("\n")},this.toDataURL=function(){var b=this.toXml();return(a.browser.mozilla||a.browser.msie)&&(b=encodeURIComponent(b)),a.browser.msie?"data:image/svg+xml,"+b:"data:image/svg+xml;utf8,"+b},this.autoRender=function(a,b){s>0||(b?p.append(a):q.append(a))},this.getTextRect=function(a){if(""==a)return{width:0,height:0};var b=document.createElementNS("http://www.w3.org/2000/svg","text");b.setAttributeNS(null,"x",-200),b.setAttributeNS(null,"y",-200),b.appendChild(document.createTextNode(a)),o.element.appendChild(b);var c=b.getBoundingClientRect();return o.element.removeChild(b),{width:c.width,height:c.height}},this.custom=function(a,b,d){return k(new c,a,b,d)},this.defs=function(a){return k(new c,"defs",null,a)},this.symbol=function(a,b){return k(new c,"symbol",a,b)},this.g=this.group=function(a,b){return k(new d,"g",a,b)},this.marker=function(a,b){return k(new c,"marker",a,b)},this.a=function(a,b){return k(new d,"a",a,b)},this.switch=function(a,b){return k(new c,"switch",a,b)},this.use=function(a){return k(new c,"use",a)},this.rect=function(a,b){return k(new d,"rect",a,b)},this.line=function(a,b){return k(new d,"line",a,b)},this.circle=function(a,b){return k(new d,"circle",a,b)},this.text=function(b,c){return 2==arguments.length?a.typeCheck("function",c)?k(new d,"text",b,c):k(new d,"text",b).text(c):k(new d,"text",b)},this.textPath=function(b,d){return a.typeCheck("string",d)?k(new c,"textPath",b).text(d):k(new c,"textPath",b)},this.tref=function(b,d){return a.typeCheck("string",d)?k(new c,"tref",b).text(d):k(new c,"tref",b)},this.tspan=function(b,d){return a.typeCheck("string",d)?k(new c,"tspan",b).text(d):k(new c,"tspan",b)},this.ellipse=function(a,b){return k(new d,"ellipse",a,b)},this.image=function(a,b){return k(new d,"image",a,b)},this.path=function(a,b){return k(new e,"path",a,b)},this.pathSymbol=function(a,b){return k(new f,"path",a,b)},this.pathRect=function(a,b){return k(new g,"path",a,b)},this.polyline=function(a,b){return k(new h,"polyline",a,b)},this.polygon=function(a,b){return k(new h,"polygon",a,b)},this.pattern=function(a,b){return k(new c,"pattern",a,b)},this.mask=function(a,b){return k(new c,"mask",a,b)},this.clipPath=function(a,b){return k(new c,"clipPath",a,b)},this.linearGradient=function(a,b){return k(new c,"linearGradient",a,b)},this.radialGradient=function(a,b){return k(new c,"radialGradient",a,b)},this.filter=function(a,b){return k(new c,"filter",a,b)},this.stop=function(a){return l(new c,"stop",a)},this.animate=function(a){return l(new c,"animate",a)},this.animateColor=function(a){return l(new c,"animateColor",a)},this.animateMotion=function(a){return l(new c,"animateMotion",a)},this.animateTransform=function(a){return l(new c,"animateTransform",a)},this.mpath=function(a){return l(new c,"mpath",a)},this.set=function(a){return l(new c,"set",a)},this.feBlend=function(a){return l(new c,"feBlend",a)},this.feColorMatrix=function(a){return l(new c,"feColorMatrix",a)},this.feComponentTransfer=function(a){return l(new c,"feComponentTransfer",a)},this.feComposite=function(a){return l(new c,"feComposite",a)},this.feConvolveMatrix=function(a){return l(new c,"feConvolveMatrix",a)},this.feDiffuseLighting=function(a){return l(new c,"feDiffuseLighting",a)},this.feDisplacementMap=function(a){return l(new c,"feDisplacementMap",a)},this.feFlood=function(a){return l(new c,"feFlood",a)},this.feGaussianBlur=function(a){return l(new c,"feGaussianBlur",a)},this.feImage=function(a){return l(new c,"feImage",a)},this.feMerge=function(a,b){return l(new c,"feMerge",a,b)},this.feMergeNode=function(a){return l(new c,"feMergeNode",a)},this.feMorphology=function(a){return l(new c,"feMorphology",a)},this.feOffset=function(a){return l(new c,"feOffset",a)},this.feSpecularLighting=function(a){return l(new c,"feSpecularLighting",a)},this.feTile=function(a){return l(new c,"feTile",a)},this.feTurbulence=function(a){return l(new c,"feTurbulence",a)},j()};return i.createElement=function(a){var b=new c;if(b.create(a.type,a.attr),a.children instanceof Array){var d=0;for(a.children.length;d<a.children.length;d++)b.append(i.createElement(a.children[d]))}return b},i}),jui.defineUI("ui.button",["jquery","util.base"],function(a,b){var c=function(b,c,d){this.data={index:0,value:"",elem:null},this.ui=b,this.element=c,this.options=a.extend({index:0,value:""},d),this._setting=function(b,c,d){function e(b,c){var d=a(c).attr("value"),e=a(c).text();g.data={index:b,value:d,text:e},a(c).addClass(h)}function f(b){a(b).removeClass(h)}var g=this,h="active",i=this.options.index,j=this.options.value;a(g.element).children(".btn").each(function(g){"event"==b?c.currentTarget==this?e(g,this):f(this):"init"==b&&("value"==d?j==a(this).attr("value")?e(g,this):f(this):i==g?e(g,this):f(this))})},this.init=function(){var b=this;this.ui.addEvent(a(b.element).children(".btn"),"click",function(a){b._setting("event",a),b.ui.emit("click",[b.data,a]),b.ui.emit("change",[b.data,a]),a.preventDefault()}),""!=this.options.value?this._setting("init",this.options.value,"value"):this._setting("init",this.options.index,"index")}},d=function(){this.data=[],this.options=a.extend({index:[],value:[]},this.options),this._setting=function(b,c,d){function e(b,c){var d=a(c).attr("value"),e=a(c).text();h.data[b]={index:b,value:d,text:e},a(c).addClass(i)}function f(b,c){h.data[b]=null,a(c).removeClass(i)}function g(a,b){for(var c=0;c<a.length;c++)if(a[c]==b)return!0;return!1}var h=this,i="active",j=this.options.index,k=this.options.value;a(h.element).children(".btn").each(function(h){"init"==b?"value"==d?g(k,a(this).attr("value"))?e(h,this):f(h,this):g(j,h)?e(h,this):f(h,this):c.currentTarget==this&&(a(this).hasClass("active")?f(h,this):e(h,this))})}},e=function(){var a={};this.init=function(){var b=this,e=this.options;"radio"==e.type?(a[e.type]=new c(b,this.root,b.options),a[e.type].init()):"check"==e.type&&(d.prototype=new c(b,this.root,b.options),a[e.type]=new d,a[e.type].init())},this.setIndex=function(b){var c=a[this.options.type];c.options.index=b,c._setting("init",null,"index"),this.emit("change",[c.data])},this.setValue=function(b){var c=a[this.options.type];c.options.value=b,c._setting("init",null,"value"),this.emit("change",[c.data])},this.getData=function(){return a[this.options.type].data},this.getValue=function(){var a=this.getData();if(b.typeCheck("array",a)){for(var c=[],d=0;d<a.length;d++)c[d]=null!=a[d]?a[d].value:a[d];return c}return a.value},this.reload=function(){a[this.options.type]._setting("init")}};return e.setup=function(){return{type:"radio",index:0,value:""}},e}),jui.defineUI("ui.combo",["jquery","util.base"],function(a,b){var c=function(){for(var a=jui.get("ui.combo"),b=0;b<a.length;b++)for(var c=a[b],d=0;d<c.length;d++)"open"==c[d].type&&c[d].fold()};a(function(){a("body").on("click",function(){c()})});var d=function(){function d(b,c){var d=i.root,f=i.text,g=i.drop,h=g.children("li");h.each(function(g){var h=e(this),i=a(h).attr("value"),k=a(h).text();i||(i=k,a(h).attr("value",i)),("index"==b&&c==g||"value"==b&&c==i)&&(j={index:g,value:i,text:k},d.attr("value",i),f.html(k),d.select&&d.select[0]&&(d.select[0].selectedIndex=g))}),0==h.size()&&(j=null)}function e(b){return a(b).children("a").size()>0?a(b).children("a")[0]:b}function f(a){a.options.keydown&&(k=a.options.index,g(a),a.addEvent(window,"keydown",function(b){if("fold"!=a.type){var c=i.drop.children("li");return 38==b.which?(1>k?k=c.size()-1:k--,g(a,function(){k--,g(a)}),!1):40==b.which?(k<c.size()-1?k++:k=0,g(a,function(){k++,g(a)}),!1):void(13==b.which&&c.eq(k).trigger("click"))}}))}function g(a,b){var c=i.drop.children("li"),d=c.eq(k);c.removeClass("active"),""!=d.val()||""!=d.html()?(d.addClass("active"),a.options.height>0&&i.drop.scrollTop(k*d.outerHeight())):"function"==typeof b&&b()}function h(c){if(b.isTouch){var d=i.root;if(d.select&&d.select[0]){var e=d.select;e.empty()}else{var e=a("<select></select>").css({position:"absolute",opacity:.01});d.find("ul").after(e),c.addEvent(e,"change",function(b){var d=a(b.currentTarget).find("option:selected").data("elem");c.addTrigger(d,"touchstart")}),d.select=e}d.find("ul > li").each(function(b,c){var d=a(c).data("value"),f=a(c).text();e.append(a("<option></option>").val(d).text(f).data("elem",c))})}}var i=null,j=null,k=-1;this.init=function(){var d=this,g=this.options,h=a(this.root),k=h.children(".btn").not(".btn-toggle"),l=h.children(".btn-toggle"),m=h.children(".btn"),n=h.children("ul");n.insertAfter(k),g.width>0&&(k.outerWidth(g.width-l.outerWidth()+1),k.css({overflow:"hidden","white-space":"nowrap"})),g.height>0&&n.css({maxHeight:g.height,overflow:"auto"}),this.addEvent(m,"click",function(a){if(b.isTouch)h.select.focus();else{if("open"==d.type)return;c(),d.open(a)}return!1}),this.addEvent(n,"click","li:not(.divider)",function(b){c();var f=e(this),g=a(f).attr("value"),i=a(f).text();j={value:g,text:i,element:f},k.html(i),h.attr("value",g),d.emit("click",[j,b]),d.emit("change",[j,b]),b.preventDefault()}),i={root:h,text:k,drop:n,toggle:l},this.type="fold",this.reload(),f(this)},this.setIndex=function(a){d("index",a),this.emit("change",[j])},this.setValue=function(a){d("value",a),this.emit("change",[j])},this.getData=function(){return j},this.getValue=function(){return null!=j?j.value:null},this.getText=function(){return null!=j?j.text:null},this.open=function(a){if(i.toggle.addClass("active"),i.drop.outerWidth(i.root.outerWidth()-1),"top"==this.options.position){var b=i.drop.outerHeight();i.drop.animate({top:"-"+b,height:"toggle"},100)}else i.drop.slideDown(100);this.emit("open",a),this.type="open"},this.fold=function(){i.drop.hide(),i.toggle.removeClass("active"),"top"==this.options.position&&i.drop.css("top",0),this.emit("fold"),this.type="fold"},this.reload=function(){""!=this.options.value?d("value",this.options.value):d("index",this.options.index),h(this),this.emit("reload",j)}};return d.setup=function(){return{index:0,value:"",width:0,height:100,keydown:!1,position:"bottom"}},d}),jui.defineUI("ui.datepicker",["jquery","util.base"],function(a,b){function c(a){return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a}var e=function(){function e(a){a.addEvent(s.children(".prev"),"click",function(b){a.prev(b)}),a.addEvent(s.children(".next"),"click",function(b){a.next(b)})}function f(a,b){var d=a.options;if("daily"==d.type){var e=10>o?"0"+o:o,f=10>b?"0"+b:b;q=new Date(n+"/"+e+"/"+f)}else if("monthly"==d.type){var e=10>b?"0"+b:b;q=new Date(n+"/"+e+"/01")}else"yearly"==d.type&&(q=new Date(b+"/01/01"));q=c(q)}function g(a){var b=a.options,d=null;if("daily"==b.type){var e=10>o?"0"+o:o;d=new Date(n+"/"+e+"/01")}else"monthly"==b.type?d=new Date(n+"/01/01"):"yearly"==b.type&&(d=new Date);return c(d)}function h(b,c){function d(a){return"daily"==e.type?(a+1)%7==0:(a+1)%3==0}var e=b.options,g="",h=[];r={};for(var i=0;i<c.objs.length;i++)h.push(c.nums[i]),d(i)&&(g+=b.tpl.dates({dates:h}),h=[]);var j=a(g);return j.find("td").each(function(d){a(this).addClass(c.objs[d].type),b.addEvent(this,"click",function(e){"none"!=c.objs[d].type&&(t.find("td").removeClass("active"),a(this).addClass("active"),f(b,c.objs[d].no),b.emit("select",[b.getFormat(),e]))}),"none"!=c.objs[d].type&&(r[c.objs[d].no]=this)}),j}function i(a,b){if(2==b)return a%100==0||a%4!=0&&a%400!=0?28:29;var c=[31,0,31,30,31,30,31,31,30,31,30,31];return c[b-1]}function j(a,b){for(var c=[],d=[],e=1,f=new Date,g=new Date(a+"-"+(10>b?"0"+b:b)).getDay(),h=i(a,b),j=1==b?a-1:a,k=1==b?12:b-1,l=i(j,k),m=0;g>m;m++)d[m]=l-g+(m+1),c[m]={type:"none",no:d[m]};for(var m=g;42>m;m++)if(h>=e){var n="";f.getMonth()+1==b&&f.getDate()==e&&(n="now"),null!=q&&q.getFullYear()==a&&q.getMonth()+1==b&&q.getDate()==e&&(n="active"),d[m]=e,c[m]={type:n,no:d[m]},e++}else d[m]=e-h,c[m]={type:"none",no:d[m]},e++;return{objs:c,nums:d}}function k(a){for(var b=[],c=[],d=new Date,e=1;12>=e;e++){var f="";d.getFullYear()==a&&d.getMonth()+1==e&&(f="now"),null!=q&&q.getFullYear()==a&&q.getMonth()+1==e&&(f="active"),c.push(e),b.push({type:f,no:e})}return{objs:b,nums:c}}function l(a){for(var b=[],c=[],d=a-4,e=new Date,f=d;d+12>f;f++){var g="";e.getFullYear()==f&&(g="now"),null!=q&&q.getFullYear()==f&&(g="active"),c.push(f),b.push({type:g,no:f})}return{objs:b,nums:c}}var n=null,o=null,p=null,q=null,r={},s=null,t=null;this.init=function(){s=a(this.root).children(".head"),t=a(this.root).children(".body"),e(this),this.select(this.options.date)},this.page=function(a,c){if(0!=arguments.length){var d=this.options;"daily"==d.type?(n=a,o=c,t.find("tr:not(:first-child)").remove(),t.append(h(this,j(n,o)))):"monthly"==d.type?(n=a,t.find("tr").remove(),t.append(h(this,k(n)))):"yearly"==d.type&&(n=a,t.find("tr").remove(),t.append(h(this,l(n)))),s.children(".title").html(b.dateFormat(g(this),d.titleFormat))}},this.prev=function(a){var b=this.options;if("daily"==b.type){var c=1==o?n-1:n,d=1==o?12:o-1;this.page(c,d)}else"monthly"==b.type?this.page(n-1):"yearly"==b.type&&this.page(n-12);this.emit("prev",[a])},this.next=function(a){var b=this.options;if("daily"==b.type){var c=12==o?n+1:n,d=12==o?1:o+1;this.page(c,d)}else"monthly"==b.type?this.page(n+1):"yearly"==b.type&&this.page(n+12);this.emit("next",[a])},this.select=function(){var a=this.options,c=arguments;if(0==c.length)y=n,m=o,d=p;else if(3==c.length)y=c[0],m=c[1],d=c[2];else if(1==c.length){var e=b.typeCheck("date",c[0])?c[0]:new Date(c[0]);y=e.getFullYear(),m=e.getMonth()+1,d=e.getDate()}"daily"==a.type?(this.page(y,m),this.addTrigger(r[d],"click")):"monthly"==a.type?(this.page(y),this.addTrigger(r[m],"click")):"yearly"==a.type&&(this.page(y),this.addTrigger(r[y],"click"))},this.addTime=function(a){q=new Date(this.getTime()+a),this.select(this.getTime())},this.getDate=function(){return q},this.getTime=function(){return q.getTime()},this.getFormat=function(a){return b.dateFormat(q,"string"==typeof a?a:this.options.format)}};return e.setup=function(){var a=c(new Date);return{type:"daily",titleFormat:"yyyy.MM",format:"yyyy-MM-dd",date:a,animate:!1}},e}),jui.defineUI("ui.dropdown",["jquery"],function(a){var b=function(){var a=c();null!=a&&a.hide()},c=function(){for(var a=jui.get("ui.dropdown"),b=0;b<a.length;b++)for(var c=a[b],d=0;d<c.length;d++)if("show"==c[d].type)return c[d];return null};a(function(){a("body").on("click",function(a){var c=a.target.tagName;"LI"!=c&&"INPUT"!=c&&"A"!=c&&"BUTTON"!=c&&"I"!=c&&b()}),a(window).on("keydown",function(a){var b=c();null!=b&&b.wheel(a.which,function(){a.preventDefault()})})});var d=function(){function c(c){function d(a){var b=0;return f.each(function(c){a==this&&(b=c)}),b}var f=a(e.menu).find("li");f.off("click").off("hover"),c.addEvent(f,"click",function(e){if(!a(this).hasClass("divider")){var f=d(this),g=a(this).text(),h=a(this).attr("value");c.emit("change",[{index:f,value:h,text:g},e]),c.options.close&&b(),"A"==e.target.tagName&&e.preventDefault()}}),c.addEvent(f,"hover",function(){f.removeClass("active")})}function d(a,b){var c=e.menu.find("li"),d=c.eq(f);c.removeClass("active"),""!=d.val()||""!=d.html()?(d.addClass("active"),a.options.height>0&&e.menu.scrollTop(f*d.outerHeight())):"function"==typeof b&&b()}var e=null,f=-1;this.init=function(){var b=this.options,d=a(this.root),f=d.find("ul"),g=d.find(".anchor");f=0==f.size()?d:f,e={root:d,menu:f,anchor:g},e.root.outerWidth(e.menu.outerWidth()),b.width>0&&f.outerWidth(b.width),b.height>0&&f.css({maxHeight:b.height,overflow:"auto"}),b.left>0&&d.css("left",b.left),b.top>0&&d.css("top",b.top),f.css({display:"block"}),d.css({position:"absolute",display:"none"}),b.nodes.length>0?this.update(b.nodes):c(this),this.type="hide"},this.update=function(b){if(this.tpl.node){a(e.menu).empty();for(var d=0;d<b.length;d++)a(e.menu).append(this.tpl.node(b[d]));c(this)}},this.hide=function(){e.root.hide(),this.emit("hide"),this.type="hide"},this.show=function(a,c){b(),e.root.show(),e.anchor.size()>0&&e.root.css("margin-top","10px"),2==arguments.length&&this.move(a,c),this.emit("show"),this.type="show"},this.move=function(a,b){e.root.css("left",a),e.root.css("top",b)},this.wheel=function(a,b){if(this.options.keydown){var c=this,g=e.menu.find("li");(38==a||-1==a)&&(1>f?f=g.size()-1:f--,d(this,function(){f--,d(c)}),b&&b()),(40==a||1==a)&&(f<g.size()-1?f++:f=0,d(c,function(){f++,d(c)}),b&&b()),13!=a&&0!=a&&a||(c.addTrigger(g.eq(f),"click"),f=-1,b&&b())}},this.reload=function(){this.init(),this.emit("reload")}};return d.setup=function(){return{close:!0,keydown:!1,left:0,top:0,width:0,height:0,nodes:[]}},d}),jui.defineUI("ui.modal",["jquery","util.base"],function(a,b){var c=0;b.resize(function(){if(c!=a(window).width()){for(var b=jui.get("ui.modal"),d=0;d<b.length;d++)for(var e=b[d],f=0;f<e.length;f++)"show"==e[f].type&&e[f].resize();c=a(window).width()}},300);var d=function(){function b(b){g={position:a(b.root).css("position"),left:a(b.root).css("left"),top:a(b.root).css("top"),"z-index":a(b.root).css("z-index"),display:a(b.root).css("display")},h={position:a(b.options.target).css("position")}}function c(b){var c=b.options.target,d="body"==c?window:c,e="body"==c?"fixed":"absolute",f="body"==c?null:"relative",g=a(c).scrollLeft(),h=a(d).width()/2-a(b.root).width()/2+a(c).scrollLeft(),i=a(d).height()/2-a(b.root).height()/2,j=g>0?a(c).outerWidth()+g:"100%",k=a(c).outerHeight();if(null!=f){var l=a(d)[0].scrollHeight;k=l>k?l:k,i+=a(d).scrollTop()}else{var l=a(window).outerHeight();k=k>l?k:l}return{x:h,y:i,pos:e,tPos:f,w:j,h:k}}function d(b,c,d){null==e&&(e=a("<div id='MODAL_"+b.timestamp+"'></div>").css({position:"absolute",width:c,height:d,left:0,top:0,opacity:b.options.opacity,"background-color":b.options.color,"z-index":i+b.options.index-1}),a(b.options.target).append(e),"body"!=b.options.target&&a(b.root).insertAfter(e),b.addEvent(e,"click",function(){return b.options.autoHide&&b.hide(),!1}))}var e=null,f=null,g=null,h=null,i=5e3;this.init=function(){b(this),this.options.clone||a(this.root).hide(),this.type="hide"},this.hide=function(){var b=this.options;b.clone&&(f.remove(),f=null),a(b.target).css("position",h.position),a(this.root).css(g),e&&(e.remove(),e=null),this.type="hide"},this.show=function(){var b=this.options,e=c(this);b.clone&&(f=a(this.root).clone(),f.insertAfter(a(this.root))),this.resize(),a(b.target).css("position",e.tPos),a(this.root).show(),d(this,e.w,e.h),this.type="show"},this.resize=function(){var b=c(this);a(this.root).css({position:b.pos,left:b.x,top:b.y,"z-index":i+this.options.index}),null!=e&&e.height(b.h)}};return d.setup=function(){return{color:"black",opacity:.4,target:"body",index:0,clone:!1,autoHide:!0}},d}),jui.defineUI("ui.notify",["jquery"],function(a){var b=12,c=function(){var c=null,d=null;this.init=function(){var e=this.options,f="object"==typeof e.padding?b:e.padding,g={top:{top:f,bottom:null,left:f,right:f},"top-right":{top:f,bottom:null,left:null,right:f},"top-left":{top:f,bottom:null,left:f,right:null},bottom:{top:null,bottom:f,left:f,right:f},"bottom-right":{top:null,bottom:f,left:null,right:f},"bottom-left":{top:null,bottom:f,left:f,right:f}};return d=g[e.position],"object"==typeof e.padding&&(d=a.extend(d,e.padding)),"body"!=this.selector&&a(this.selector).css("position","relative"),c=a("<div></div>").css(a.extend({position:"absolute","z-index":3e3},d)),a(this.root).append(c),this},this.add=function(e,f){function g(){null!=m&&(m.animate({opacity:0},j.hideDuration,j.hideEasing),m.slideUp(j.hideEasing,function(){i.emit("hide",[e]),m.remove(),m=null}))}function h(){return-1!=j.position.indexOf("top-")?!0:!1}var i=this,j=this.options,k=isNaN(f)?j.timeout:f,l=a(this.root).scrollTop(),m=a(this.tpl.item(e)).css({"margin-bottom":j.distance});("top"==j.position||"bottom"==j.position)&&m.outerWidth(c.width()-3*("object"==typeof j.padding&&j.padding.right?j.padding.right:b)),h()?(c.css("top",l+d.top),c.prepend(m)):(c.css("bottom",-(l-d.bottom)),c.append(m));var n=m.css("opacity");m.css({opacity:0}).animate({opacity:n},j.showDuration,j.showEasing,function(){i.emit("show",[e])}),this.addEvent(m,"click",function(a){return i.emit("select",[e,a]),g(),!1}),k>0&&setTimeout(g,k)},this.reset=function(){c.empty()}};return c.setup=function(){return{position:"top-right",padding:b,distance:5,timeout:3e3,showDuration:500,hideDuration:500,showEasing:"swing",hideEasing:"linear"}},c}),jui.defineUI("ui.paging",["jquery"],function(a){var b=function(){function b(b){b.addEvent(a(b.root).find(".prev"),"click",function(){return b.prev(),!1}),b.addEvent(a(b.root).find(".next"),"click",function(){return b.next(),!1})}function c(b){b.addEvent(h.find(".page"),"click",function(c){var d=parseInt(a(c.currentTarget).text());return b.page(d),!1})}function d(b,c){var d=h.find(".page");d.each(function(){a(this).text()==c?a(this).addClass("active"):a(this).removeClass("active")})}function e(a,e){var i=[],j=g<a.options.screenCount?g:a.options.screenCount,k=e-Math.ceil(j/2)+1,k=1>k?1:k;if(f=e>g?g:e,f=1>e?1:e,k+j+1>g){for(var l=g-j+1;g+1>l;l++)i.push(l);f>g&&(f=g)}else for(var l=k;k+j>l;l++)i.push(l);h.html(a.tpl.pages({pages:i,lastPage:g})),b(a),c(a),d(a,f)}var f=1,g=1,h=null;this.init=function(){{var b=this;this.options}return h=a(b.root).find(".list"),h=0==h.size()?a(b.root):h,this.reload(),this},this.reload=function(a){var a=a?a:this.options.count;f=1,g=Math.ceil(a/this.options.pageCount),e(this,f),this.emit("reload")},this.page=function(a){return a?(e(this,a),void this.emit("page",[f])):f},this.next=function(){this.page(f+1)},this.prev=function(){this.page(f-1)},this.first=function(){this.page(1)},this.last=function(){this.page(g)}};return b.setup=function(){return{count:0,pageCount:10,screenCount:5}},b}),jui.defineUI("ui.tooltip",["jquery"],function(a){var b=function(){function b(b,d){f=a(b.tpl.item({timestamp:b.timestamp,position:b.options.position,color:b.options.color,message:d})),b.options.width&&f.css("max-width",b.options.width),b.options.align&&f.css("text-align",b.options.align),a("body").append(f),c(b)}function c(b){var c=a(b.root).offset(),d=a(b.root).outerWidth(),e=a(b.root).outerHeight(),h=f.outerWidth(),i=f.outerHeight(),j=0,k=0,l=b.options.position;"left"==l?(j=c.left-h,k=c.top-(i-e)/2):"right"==l?(j=c.left+d,k=c.top-(i-e)/2):"bottom"==l?(j=c.left-h/2+d/2,k=c.top+e):(j=c.left-h/2+d/2,k=c.top-i),g={x:1>j?1:j,y:1>k?1:k}}function d(a,b){clearTimeout(i),null!=f&&(f.remove(),f=null,g={}),null!=i&&(a.emit("hide",[b]),i=null)}function e(a,c){f&&d(a,c);var e=a.options.title?a.options.title:h;""!=e&&(b(a,e),f.css({left:g.x,top:g.y}))}var f=null,g={},h="",i=null;this.init=function(){var b=this,c=this.options;h=a(this.root).attr("title"),a(this.root).removeAttr("title"),a(this.root).off(c.showType).off(c.hideType),this.addEvent(this.root,c.showType,function(a){return null==i?i=setTimeout(function(){e(b,a),null!=f&&b.emit("show",[f.get(0),a])},c.delay):c.showType==c.hideType&&d(b,a),!1}),c.showType!=c.hideType&&this.addEvent(this.root,c.hideType,function(a){return d(b,a),!1})},this.update=function(a){h=a}};return b.setup=function(){return{color:"black",position:"top",width:150,align:"left",delay:0,showType:"mouseover",hideType:"mouseout",title:"",tpl:{item:"<div class='tooltip tooltip-<!= position !> tooltip-<!= color !>'><div class='anchor'></div><div class='message'><!= message !></div></div>"}}},b}),jui.defineUI("ui.layout",["jquery","util.base"],function(a){var b=function(){function b(b,c,d,e){b.mousedown(function(f){b.data("mousedown",!0);var g=b.clone();b.data("shadow",g),b.after(g),d.call(this,f),g.css("opacity",.3),a(document).on("mousemove",c),a(document).on("mouseup",function h(d){a(document).off("mousemove",c),a(document).off("mouseup",h),e.call(this,d),b.data("mousedown",!1),g.remove(),a("body :not(.resize)").css({"user-select":""})}),a("body :not(.resize)").css({"user-select":"none"})})}function c(a){var c,d;c=e[a],d=c.resizer,d.css({cursor:h[a]}),d.data("event")||("top"==a?b(d,function(a){if(d.data("mousedown")){var b=a.clientY-d.data("current"),c=f.top.min,e=f.top.max;b>=c&&e>b&&d.css({top:b+"px"})}},function(a){var b=d.position().top;d.data("current",a.clientY-b)},function(){var a=d.position().top,b=(d.height(),a),c=a+d.height()+"px",f=e.top.height();e.top.height(b);var g=f-b,h=e.center.height()+g;e.center.css({top:c}).height(h),e.left.css({top:c}).height(h),e.left.resizer.css({top:c}).height(h),e.right.css({top:c}).height(h),e.right.resizer.css({top:c}).height(h)}):"bottom"==a?b(d,function(a){if(d.data("mousedown")){var b=a.clientY-d.data("current"),e=f.bottom.min,g=f.bottom.max,h=c.position().top-(b+f.barSize),i=h+c.height();i>=e&&g>=i&&d.css({top:b+"px"})}},function(a){var b=d.position().top;d.data("current",a.clientY-b)},function(){var a=d.position().top+d.height(),b=(e.root.height(),parseFloat(e.bottom.position().top)-a);e.bottom.css({top:a+"px"}),e.bottom.height(e.bottom.height()+b);var c=e.center.height()-b;
e.center.height(c),e.left.height(c),e.left.resizer.height(c),e.right.height(c),e.right.resizer.height(c)}):"left"==a?b(d,function(a){if(d.data("mousedown")){var b=a.clientX-d.data("current"),c=f.left.min,e=f.left.max;b>=c&&e>b&&d.css({left:b+"px"})}},function(a){var b=d.position().left;d.data("left",b).data("current",a.clientX-b)},function(){if(d.data("mousedown")){var a=d.position().left,b=d.data("left"),c=b-a;e.left.css({width:a+"px"}),e.center.css({left:a+f.barSize+"px"}),e.center.width(e.center.width()+c)}}):"right"==a&&b(d,function(a){if(d.data("mousedown")){var b=a.clientX-d.data("current"),g=f.right.min,h=f.right.max,i=e.left.width()+e.left.resizer.width(),j=e.center.width(),k=c.width()-(b-(i+j));k>=g&&h>k&&d.css({left:b+"px"})}},function(a){var b=d.position().left;d.data("left",b).data("current",a.clientX-b)},function(){if(d.data("mousedown")){var a=d.position().left,b=d.data("left"),c=b-a;e.right.css({left:a+d.width()+"px",width:e.right.width()+c+"px"}),e.center.width(e.center.width()-c)}}),d.data("event",!0))}function d(b){for(var d=0,h=g.length;h>d;d++){var i=e[g[d]];i&&(e.root.append(i),"center"!=g[d]&&f[g[d]].resize&&(i.resizer||(i.resizer=a("<div class='resize "+g[d]+"' />")),e.root.append(i.resizer),c(g[d])))}b.resize()}var e=null,f={},g=["top","left","right","bottom","center"],h={top:"n-resize",bottom:"n-resize",right:"e-resize",left:"e-resize"};this.init=function(){var b,c,g,h,i,j,k=this,l=this.options;return b=a(this.root).css("position","relative"),null!=l.width&&b.outerWidth(l.width),null!=l.height&&b.outerHeight(l.height),c=l.top.el?a(l.top.el):b.find("> .top"),0==c.length&&(c=null),g=l.left.el?a(l.left.el):b.find("> .left"),0==g.length&&(g=null),h=l.right.el?a(l.right.el):b.find("> .right"),0==h.length&&(h=null),i=l.bottom.el?a(l.bottom.el):b.find("> .bottom"),0==i.length&&(i=null),j=l.center.el?a(l.center.el):b.find("> .center"),0==j.length&&(j=null),e={root:b,top:c,left:g,right:h,bottom:i,center:j},f=l,d(this),a(window).on("resize",function(){k.resize()}),this},this.resize=function(){var a=null,b=null,c=0,d=0,f=0;a=e.top,b=this.options.top,a&&(a.css({position:"absolute",top:"0px",left:"0px",width:"100%",height:b.size||b.min}),c=a.height(),b.resize?(a.resizer.css({position:"absolute",top:c,left:"0px",width:"100%",background:this.options.barColor,height:this.options.barSize}),c+=this.options.barSize):a.resizer&&a.resizer.remove()),a=e.bottom,b=this.options.bottom;var g=e.root.height();if(a){a.css({position:"absolute",left:"0px",width:"100%",height:b.size||b.min});var h=c-a.height()+c;b.resize?(a.resizer.css({position:"absolute",top:h,left:"0px",width:"100%",background:this.options.barColor,height:this.options.barSize}),h+=this.options.barSize):a.resizer&&a.resizer.remove(),a.css("top",h+"px")}a=e.left,b=this.options.left;var i=g;e.top&&(i-=e.top.height(),e.top.resizer&&(i-=e.top.resizer.height())),e.bottom&&(i-=e.bottom.height(),e.bottom.resizer&&(i-=e.bottom.resizer.height())),a&&(a.css({position:"absolute",top:c,left:"0px",height:i,width:b.size||b.min,"max-width":"100%",overflow:"auto"}),d=a.width(),b.resize?(a.resizer.css({position:"absolute",top:c,height:a.height(),left:d,background:this.options.barColor,width:this.options.barSize}),d+=this.options.barSize):a.resizer&&a.resizer.remove()),a=e.right,b=this.options.right;var j=e.root.width(),k=j;e.left&&(k-=e.left.width(),e.left.resizer&&(k-=e.left.resizer.width())),a&&(a.css({position:"absolute",top:c,height:i,width:b.size||b.min,"max-width":"100%"}),b.resize?(a.resizer.css({position:"absolute",top:c,height:a.height(),background:this.options.barColor,width:this.options.barSize}),f+=this.options.barSize):a.resizer&&a.resizer.remove(),k-=e.right.width(),e.right.resizer&&(k-=e.right.resizer.width()),a.resizer.css({left:d+k+"px"}),a.css({left:d+k+a.resizer.width()+"px"})),a=e.center,b=this.options.center,a&&a.css({position:"absolute",top:c,height:i,left:d,width:k,overflow:"auto"})}};return b.setup=function(){return{barColor:"#d6d6d6",barSize:3,width:null,height:null,top:{el:null,size:null,min:50,max:200,resize:!0},left:{el:null,size:null,min:50,max:200,resize:!0},right:{el:null,size:null,min:50,max:200,resize:!0},bottom:{el:null,size:null,min:50,max:200,resize:!0},center:{el:null}}},b}),jui.defineUI("ui.accordion",["jquery","util.base"],function(a,b){var c=function(){function c(b){f.each(function(c){b==c?(a(this).addClass("active"),g.insertAfter(this).show()):a(this).removeClass("active")})}function d(b){f.each(function(d){b.addEvent(this,"click",function(e){a(this).hasClass("active")&&b.options.autoFold?(a(this).removeClass("active"),g.hide(),b.emit("fold",[d,e])):(c(d),b.emit("open",[d,e]))})})}var e=0,f=null,g=null;this.init=function(){var e=this.options;f=a(this.root).find(".title"),g=a(this.root).find(".content"),b.typeCheck("integer",e.index)?c(e.index):g.hide(),d(this)},this.activeIndex=function(){return e}};return c.setup=function(){return{index:null,autoFold:!1}},c}),jui.defineUI("uix.autocomplete",["jquery","util.base","ui.dropdown"],function(a,b,c){var d=function(){function b(b,d){if(0==d.length)return void(f&&f.hide());f&&a(f.root).remove();var e=a(b.root).offset(),h=a(b.tpl.words({words:d}));a("body").append(h),f=c(h,{keydown:!0,width:a(b.root).outerWidth(),left:e.left,top:e.top+a(b.root).outerHeight(),event:{change:function(c,d){a(g).val(c.text),b.emit("change",[c.text,d])}}}),f.show()}function d(a){var b=[];if(""!=a)for(var c=0;c<h.length;c++){var d=h[c],e=h[c].toLowerCase(),f=a.toLowerCase();-1!=e.indexOf(f)&&b.push(d)}return b}function e(c){c.addEvent(g,"keyup",function(e){return 38!=e.which&&40!=e.which&&13!=e.which?(i=d(a(this).val()),b(c,i),!1):void 0})}var f=null,g=null,h=[],i=[];this.init=function(){var b=this.options;g=null==b.target?this.root:a(this.root).find(b.target),e(this),this.update(b.words)},this.update=function(a){h=a},this.list=function(){return i}};return d.setup=function(){return{target:null,words:[]}},d}),jui.defineUI("uix.tab",["jquery","util.base","ui.dropdown"],function(a,b,c){var d=function(){function b(b){var c=a(b.root).children("li");c.removeClass("active")}function d(b,c){var d=a(c).offset();a(c).parent().addClass("menu-keep"),k.show(d.left,d.top+a(b.root).height())}function e(b){var c=a(b.root).children("li"),d=c.eq(m);d.removeClass("menu-keep")}function f(c,d){b(c);var e=a(c.root).children("li"),f=e.eq(d).addClass("active");l.appendTo(f),g(c.options.target,f[0])}function g(b,c){var d=a(c).find("[href*=#]").attr("href");a(b).children("*").each(function(){var b=this;"#"+b.id==d?a(b).show():a(b).hide()})}function h(b){a(b.root).children("li").each(function(c){a(this).hasClass("menu")&&(m=c),b.addEvent(this,["click","contextmenu"],function(e){var h=a.trim(a(this).text()),i=a(this).val();if(c!=m){if(c!=n){var j=[{index:c,text:h,value:i},e];"click"==e.type?(""!=b.options.target&&g(b.options.target,this),n=c,b.emit("change",j),b.emit("click",j),f(b,c)):"contextmenu"==e.type&&b.emit("rclick",j)}}else b.emit("menu",[{index:c,text:h},e]),"show"!=k.type&&d(b,this);return!1})}),j(b),i(b)}function i(b){if(b.options.drag){var c=a(b.root).children("li"),d=null,e=null,f=null,g=null;c.each(function(h){b.addEvent(this,"mousedown",function(c){return d=a(this),e=d.clone().css("opacity","0.5"),f=h,b.emit("dragstart",[f,c]),!1}),b.addEvent(this,"mousemove",function(){null!=f&&(g=h,f>g?0==g?e.insertBefore(c.eq(0)):e.insertAfter(c.eq(g-1)):g==c.size()-1?e.insertAfter(c.eq(g)):e.insertBefore(c.eq(g+1)),d.hide())})}),b.addEvent(b.root,"mouseup",function(a){null!=d&&d.show(),null!=e&&e.remove(),null!=f&&null!=g&&(b.move(f,g),b.emit("dragend",[g,a])),f=null,g=null})}}function j(b){var c=a(b.root).children("li"),d=c.filter(".active"),e=c.eq(n),g=1==e.size()?e:d;0==g.size()&&(g=c.eq(0)),l.appendTo(g),f(b,c.index(g))}var k=null,l=null,m=-1,n=0;this.init=function(){var b=this,d=this.options;if(n=d.index,l=a("<div class='anchor'></div>"),d.nodes.length>0?this.update(d.nodes):h(this),this.tpl.menu){var f=a(this.tpl.menu());f.insertAfter(a(b.root)),k=c(f,{event:{change:function(a,c){e(b),b.emit("changemenu",[a,c])},hide:function(){e(b)}}})}return this},this.update=function(b){if(this.tpl.node){a(this.root).empty();for(var c=0;c<b.length;c++)a(this.root).append(this.tpl.node(b[c]));h(this)}},this.insert=function(b,c){if(this.tpl.node){var d=this.tpl.node(c),e=a(this.root).children("li");b==e.size()?a(d).insertAfter(e.eq(b-1)):a(d).insertBefore(e.eq(b)),h(this)}},this.append=function(b){if(this.tpl.node){var c=this.tpl.node(b);-1!=m?(a(c).insertBefore(a(this.root).find(".menu")),m++):a(this.root).append(c),h(this)}},this.prepend=function(b){this.tpl.node&&(a(this.root).prepend(this.tpl.node(b)),h(this))},this.remove=function(b){a(this.root).children("li").eq(b).remove(),h(this)},this.move=function(b,c){if(b!=c){var d=a(this.root).children("li"),e=d.eq(b);b>c?0==c?e.insertBefore(d.eq(0)):e.insertAfter(d.eq(c-1)):c==d.size()-1?e.insertAfter(d.eq(c)):e.insertBefore(d.eq(c+1)),n=c,h(this)}},this.show=function(b){if(b!=m&&b!=n){n=b;var c=a(this.root).children("li").eq(b);this.emit("change",[{index:b,text:a.trim(c.text()),value:c.val()}]),f(this,b)}},this.activeIndex=function(){return n}};return d.setup=function(){return{target:"",index:0,drag:!1,nodes:[]}},d}),jui.define("uix.table.column",["jquery"],function(a){var b=function(b){this.element=null,this.order="asc",this.name=null,this.data=[],this.list=[],this.index=b,this.type="show",this.width=null,this.hide=function(){this.type="hide",a(this.element).hide()},this.show=function(){this.type="show",a(this.element).show()}};return b}),jui.define("uix.table.row",["jquery"],function(a){var b=function(b,c,d){function e(a){k.rownum=isNaN(a)?k.rownum:a,k.index=k.parent?k.parent.index+"."+k.rownum:""+k.rownum,k.parent&&"string"==typeof k.index&&(k.depth=k.index.split(".").length-1),k.isLeaf()||f(k)}function f(a){for(var b=a.childrens,c=0;c<b.length;c++)b[c].reload(c),b[c].isLeaf()||f(b[c])}function g(){k.list=[],a(k.element).find("td").each(function(a){k.list[a]=this,l[a]&&(this.style.display="none")})}function h(){if(!c)return k.element;var b=a(c(a.extend({row:{index:k.index,data:k.data,depth:k.depth}},k.data))).get(0);return b}function i(b){a(b.element).remove();for(var c=0;c<b.childrens.length;c++){var d=b.childrens[c];d.isLeaf()?a(d.element).remove():i(d)}}function j(){for(var a=0;a<k.childrens.length;a++)k.childrens[a].reload(a)}var k=this,l={};this.data=b,this.rownum=null,this.index=null,this.element=null,this.list=[],this.parent=d?d:null,this.childrens=[],this.depth=0,this.type="fold",this.reload=function(b,c,d){if(c||e(b),null!=this.element){var f=h(),i=a(this.element).attr("class");a(f).addClass(i).insertAfter(this.element),a(this.element).remove(),this.element=f}else this.element=h();null!=d&&this.hideCells(d),g()},this.destroy=function(){null!=this.parent?this.parent.removeChild(this.index):(i(this),a(this.element).remove())},this.isLeaf=function(){return 0==this.childrens.length?!0:!1},this.fold=function(){this.type="fold";for(var b=0;b<this.childrens.length;b++){var c=this.childrens[b];a(c.element).hide(),c.isLeaf()||c.fold()}},this.open=function(){this.type="open";for(var b=0;b<this.childrens.length;b++){var c=this.childrens[b];a(c.element).show(),c.isLeaf()||c.open()}},this.appendChild=function(b){var c=this.isLeaf()?this.element:this.lastChildLeaf().element;a(b.element).insertAfter(c),this.childrens.push(b)},this.insertChild=function(b,c){var d=this.element;if(b>0){var e=this.childrens[b-1];d=e.isLeaf()&&this.childrens.length!=b+1?e.element:e.lastChildLeaf().element}a(c.element).insertAfter(d);var f=this.childrens.splice(0,b);f.push(c),this.childrens=f.concat(this.childrens),j()},this.removeChild=function(a){for(var b=0;b<this.childrens.length;b++){var c=this.childrens[b];c.index==a&&(this.childrens.splice(b,1),i(c))}j()},this.lastChild=function(){return this.isLeaf()?null:this.childrens[this.childrens.length-1]},this.lastChildLeaf=function(a){var b=a?a:this.lastChild();return b.isLeaf()?b:this.lastChildLeaf(b.lastChild())},this.showCell=function(b){l[b]=!1,a(this.list[b]).show()},this.hideCell=function(b){l[b]=!0,a(this.list[b]).hide()},this.hideCells=function(a){for(var b=0;b<a.length;b++)"hide"==a[b].type&&this.hideCell(b)}};return b}),jui.define("uix.table.base",["jquery","util.base","uix.table.column","uix.table.row"],function(a,b,c,d){var e=function(e,f){function g(){r(),h()}function h(){var b=[];t.thead.find("tr:last > th").each(function(){b.push(this)});for(var d=0;d<b.length;d++){var e=new c(d);v[d]?(e.element=v[d].element,e.order=v[d].order,e.name=v[d].name,e.data=v[d].data,e.list=v[d].list,e.type=v[d].type,e.width=v[d].width):(e.element=b[d],(a(e.element).attr("width")||a(e.element).attr("style")&&-1!=a(e.element).attr("style").indexOf("width"))&&(e.width=a(e.element).outerWidth()),f&&f[d]&&(e.name=f[d]));for(var g=0;g<w.length;g++)e.list.push(w[g].list[d]),e.data.push(w[g].data[e.name]);v[d]=e}}function i(a,b){if("reload"==a||"append"==a)for(var c=0;c<v.length;c++)v[c].list[b.index]=b.list[c],v[c].data[b.index]=b.data[v[c].name];else if("remove"==a)for(var c=0;c<v.length;c++)v[c].list.splice(b.index,1),v[c].data.splice(b.index,1);else h()}function j(a,b,c){var e=new d(a,u.row,c);return e.reload(b,!1,v),e}function k(a,b){var c=b.childrens;if(c.length>0)for(var d=0;d<c.length;d++)a.push(c[d]),c[d].childrens.length>0&&k(a,c[d])}function l(a,b){if(!b)return null;var c=a.shift();return void 0==c?b:l(a,b.childrens[c])}function m(){var a=arguments[0],b=arguments[1];"function"==typeof a?(b=a,a=0):a=isNaN(a)?0:a;for(var c=a;c<w.length;c++)w[c].reload(c),i("reload",w[c]),"function"==typeof b&&b(c)}function n(b,c){var d=j(c,b),e=d;if(w.length!=b||0==b&&1==w.length)a(d.element).insertBefore(w[b].element);else{var f=w[b-1];a(d.element).insertAfter(0==f.childrens.length?f.element:f.lastChildLeaf().element)}return e=w.splice(0,b),e.push(d),w=e.concat(w),m(b),d}function o(a,b){var c=z.getIndexList(a),d=s.getRowParent(a),e=c[c.length-1];return row=j(b,e,d),d.insertChild(e,row),row}function p(a){var b=j(a,w.length);return w.push(b),t.tbody.append(b.element),i("append",b),b}function q(a,b){var c=s.getRow(a),d=j(b,c.childrens.length,c);return c.appendChild(d),d}function r(){return"function"!=typeof u.none?!1:(y?w.length>0&&(t.tbody.find("tr:first").remove(),y=!1):0==w.length&&(t.tbody.html(u.none()),y=!0),!0)}var s=this,t=e.$obj,u=e.$tpl,v=[],w=[],x={},y=!1,z=b.index();this.appendRow=function(){var a=arguments[0],b=arguments[1],c=null;return c=b?q(a,b):p(a),r(),c},this.insertRow=function(a,b){var c=null;return c=z.isIndexDepth(a)?o(a,b):0==w.length&&0==parseInt(a)?this.appendRow(b):n(a,b),r(),c},this.updateRow=function(a,b){var c=this.getRow(a);for(var d in b)c.data[d]=b[d];return c.reload(null,!0),i("reload",c),c},this.moveRow=function(a,c){if(a!=c){var d=this.getRowAll(a),e=d[0],f=b.clone(e.data);if(d.length>1)for(var g=0;g<d.length;g++){var a=z.changeIndex(d[g].index,c,d[0].index);this.insertRow(a,d[g].data)}else this.insertRow(c,f);this.removeRow(e.index)}},this.removeRow=function(a){var b=this.getRow(a);z.isIndexDepth(a)?b.destroy():(b.destroy(),i("remove",w[a]),w.splice(a,1),m(a)),r()},this.openRow=function(a){this.getRow(a).open(),x[a]=!1;for(var b in x)if(x[b]!==!1){var c=this.getRow(x[b]);null!=c&&c.fold()}},this.openRowAll=function(){for(var a=this.getRowAll(),b=0;b<a.length;b++)a[b].isLeaf()||(a[b].open(),x[a[b].index]=!1)},this.foldRow=function(a){this.getRow(a).fold(),x[a]=a},this.foldRowAll=function(){for(var a=this.getRowAll(),b=0;b<a.length;b++)a[b].isLeaf()||(a[b].fold(),x[a[b].index]=a[b].index)},this.removeRows=function(){w=[],r()||t.tbody.html(""),i()},this.sortRows=function(a,c){function d(b){var c=b.data[a];return"string"==typeof c?c.toLowerCase():isNaN(c)||null==c?"":c}var e=b.sort(w);e.setCompare(c?function(a,b){return d(a)>d(b)?!0:!1}:function(a,b){return d(a)<d(b)?!0:!1}),e.run(),t.tbody.html(""),m(function(a){t.tbody.append(w[a].element)})},this.appendColumn=function(b,c){var d=v.length,e=a(u[b]({rows:c})),f=e.filter("thead").find("tr");f.each(function(b){var c=t.thead.find("tr").eq(b);a(this).find("th").each(function(){c.append(this),f.size()-1==b&&v.push({element:this,list:[]})})});for(var g=0;g<w.length;g++)e.filter("tbody").find("tr").eq(g).find("td").each(function(b){a(w[g].element).append(this),v[d+b].list.push(this),w[g].list.push(this),a.extend(w[g].data,c[g])})},this.removeColumn=function(b){for(var c=0;c<v[b].list.length;c++)a(v[b].element).remove(),a(v[b].list[c]).remove();for(var d=0;d<w.length;d++)w[d].list.splice(b,1);v.splice(b,1)},this.hideColumn=function(a){if("hide"!=v[a].type){for(var b=this.getRowAll(),c=0;c<b.length;c++)b[c].hideCell(a);v[a].hide()}},this.showColumn=function(a){if("show"!=v[a].type){for(var b=this.getRowAll(),c=0;c<b.length;c++)b[c].showCell(a);v[a].show()}},this.getColumnCount=function(){return v.length},this.getRowCount=function(){return w.length},this.getColumn=function(a){return null==a?v:v[a]},this.getRow=function(a){if(null==a)return w;if(z.isIndexDepth(a)){var b=z.getIndexList(a);return l(b,w[b.shift()])}return w[a]?w[a]:null},this.getRowAll=function(a){for(var b=[],c=null==a?w:[this.getRow(a)],d=0;d<c.length;d++)c[d]&&(b.push(c[d]),c[d].childrens.length>0&&k(b,c[d]));return b},this.getRowParent=function(a){return z.isIndexDepth(a)?this.getRow(z.getParentIndex(a)):null},this.setColumn=function(a,b){v[a]=b},this.setRow=function(a,b){w[a]=b},this.printInfo=function(){console.log(v),console.log(w)},g()};return e}),jui.defineUI("uix.table",["jquery","util.base","ui.dropdown","uix.table.base"],function(a,b,c,d){b.resize(function(){for(var a=jui.get("table"),b=0;b<a.length;b++)for(var c=a[b].list,d=0;d<c.length;d++)c[d].resize()},1e3);var e=function(){function e(a){return"<tr class='expand' style='display: none;'><td id='EXPAND_"+a.timestamp+"'></td></tr>"}function f(a,b){for(var c=[],d=0;d<b.length;d++)if("string"==typeof b[d]){var e=a.getColumn(b[d]);c.push(e.index)}else c.push(b[d]);return c}function g(b){var c=b.options.colshow,d=b.uit.getColumnCount();if(c===!0){b.options.colshow=c=[];for(var e=0;d>e;e++)c.push(e)}else c=f(b,c);for(var e=0;d>e;e++)-1==a.inArray(e,c)?b.uit.hideColumn(e):b.uit.showColumn(e)}function h(b){for(var d=null,e=b.listColumn(),f=[],g=0;g<e.length;g++)f.push(a(e[g].element).text());d=a(b.tpl.menu({columns:f})),a("body").append(d),s=c(d,{close:!1}),a(s.root).find("input[type=checkbox]").each(function(c){this.checked="show"==e[c].type?!0:!1,b.addEvent(this,"click",function(d){var e=a(s.root).find("input[type=checkbox]:checked").size();this.checked?b.showColumn(c,d):e>0?b.hideColumn(c,d):this.checked=!0,b.hideExpand(),b.scroll()})})}function i(c){for(var d=r.table.outerWidth(),e=c.uit.getColumnCount(),f=!1,g=e-1;g>=0;g--){var h=c.getColumn(g),i=a(h.element).outerWidth();"none"==a(h.element).css("display")||f||(i-=b.scrollWidth(),f=!0),a(h.list[0]).outerWidth(i)}r.tbody.outerWidth(d)}function j(b){a(b.root).hasClass("table-scroll")||b.scroll(),r.tbody.off("scroll").scroll(function(a){return r.tbody.scrollTop()+b.options.scrollHeight==r.tbody.get(0).scrollHeight?(b.emit("scroll",a),!1):void 0})}function k(a,b){a.uit.getRowCount()<1||(b&&(a.options.expand&&r.tbody.prepend(e(a)),a.scroll()),a.options.scroll&&j(a),a.setVo())}function l(a,b){for(var b=b?b:a.uit.getRow(),c=0;c<b.length;c++)!function(b){b.childrens.length>0?(m(a,b),l(a,b.childrens)):m(a,b)}(b[c])}function m(b,c){if(b.addEvent(c.element,"click",function(a){if(b.emit("select",[c,a]),b.emit("click",[c,a]),b.options.expand){if(b.options.expandEvent===!1)return;t===c.index?b.hideExpand(a):(null!=t&&b.hideExpand(a),b.showExpand(c.index,void 0,a))}}),b.addEvent(c.element,"dblclick",function(a){b.emit("dblclick",[c,a])}),b.addEvent(c.element,"contextmenu",function(a){return b.emit("rowmenu",[c,a]),!1}),b.options.fields&&b.options.editCell){if(b.options.editEvent===!1)return;a(c.element).find("td").each(function(a){var d=this;!function(a){b.addEvent(d,"dblclick",function(d){"TD"==d.target.tagName&&n(b,d.currentTarget,c,a),b.emit("editstart",[c,d])})}(a)})}if(b.options.fields&&b.options.editRow){if(b.options.editEvent===!1)return;b.addEvent(c.element,"dblclick",function(a){("TD"==a.target.tagName||"TR"==a.target.tagName)&&b.showEditRow(c.index,a)})}}function n(b,c,d,e,g,h){function i(){if("function"==typeof h)h();else{var a={};a[j.name]=m.val();var c=b.emit("editend",[a]);c!==!1&&(b.update(d.index,a),m.remove())}}var j=b.getColumn(e),k=j.name?j.data[d.index]:a(c).html(),l=h?b.options.editRow:b.options.editCell,m=a("<input type='text' class='edit' />").val(k).css("width","100%");a(c).html(m),(!j.name||l!==!0&&-1==a.inArray(e,f(b,l)))&&m.attr("disabled",!0),g&&g.target==c&&m.focus(),b.addEvent(m,"keypress",function(a){13==a.which&&i(a)}),b.addEvent(r.tbody.find("tr"),"click",function(a){("TD"==a.target.tagName||"TR"==a.target.tagName)&&i(a)})}function o(a){for(var b=a.options,c=a.uit.getColumnCount(),d=0;c>d;d++){var e=a.getColumn(d);!function(c,d){b.fields&&b.sort&&b.sortEvent===!0||a.addEvent(d.element,"click",function(b){a.emit("colclick",[d,b])}),a.addEvent(d.element,"dblclick",function(b){a.emit("coldblclick",[d,b])}),a.addEvent(d.element,"contextmenu",function(b){return a.emit("colmenu",[d,b]),!1})}(d,e)}}function p(b){for(var c=b.options.sort,d=c===!0?b.uit.getColumnCount():c.length,e=0;d>e;e++){var f=c===!0?e:c[e],g=b.getColumn(f);null!=g.element&&(!function(c,d){b.addEvent(d.element,"click",function(e){a(e.target).hasClass("resize")||(b.sort(c,void 0,e),b.emit("colclick",[d,e]))})}(f,g),a(g.element).css("cursor","pointer"))}}function q(c){function d(b){for(var d=b+1;d<c.uit.getColumnCount();d++){var e=c.getColumn(d).element;if(!a(e).is(":hidden"))return c.getColumn(d)}}function e(c,d){var e=30;if(!(e>j+d||e>k-d)&&(a(h.element).outerWidth(j+d),a(i.element).outerWidth(k-d),c.options.scroll)){var f=a(i.element).outerWidth()-(h.index==c.uit.getColumnCount()-2?b.scrollWidth():0);a(h.list[0]).outerWidth(a(h.element).outerWidth()),a(i.list[0]).outerWidth(f)}}var f=0,g=r.table.offset(),h=null,i=null,j=0,k=0,l=null;r.thead.find(".resize").remove();for(var m=0;m<c.uit.getColumnCount()-1;m++){var n=a(c.getColumn(m).element),o=a("<div class='resize'></div>"),p=n.offset();o.css({position:"absolute",width:"8px",height:n.outerHeight(),left:n.outerWidth()+(p.left-g.left)-1+"px",top:p.top-g.top+"px",cursor:"w-resize","z-index":"1"}),n.append(o),function(b){c.addEvent(o,"mousedown",function(e){return 0==f&&(f=e.pageX),h=c.getColumn(b),i=d(b),j=a(h.element).outerWidth(),k=a(i.element).outerWidth(),l=this,v=!0,!1})}(m)}c.addEvent("body","mousemove",function(a){f>0&&e(c,a.pageX-f)}),c.addEvent("body","mouseup",function(b){if(f>0){f=0,v=!1;var d=a(h.element).offset().left-g.left;return a(l).css("left",a(h.element).outerWidth()+d-1),c.emit("colresize",[h,b]),!1}})}var r=null,s=null,t=null,u={},v=!1;this.init=function(){var b=this.options;if(b.data=null!=b.rows?b.rows:b.data,r={table:a(this.root).css({position:"relative"}),thead:a(this.root).find("thead"),tbody:a(this.root).find("tbody")},this.uit=new d({$obj:r,$tpl:this.tpl},b.fields),b.fields&&b.colshow&&g(this),b.fields&&this.tpl.menu&&h(this),b.resize&&q(this),b.fields&&b.sort&&b.sortEvent===!0&&p(this),b.data.length>0?this.update(b.data):this.setVo(),b.width>0&&r.table.outerWidth(b.width),!b.fields&&(b.sort||b.colshow||b.editCell||b.editRow))throw new Error("JUI_CRITICAL_ERR: 'fields' option is required");o(this)},this.update=function(){var a=1==arguments.length?arguments[0]:arguments[1],b=2==arguments.length?arguments[0]:null;if(null!=b){var c=this.uit.updateRow(b,a);m(this,c),0==parseInt(b)&&this.scroll()}else this.uit.removeRows(),this.scroll(),this.append(a),this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortOrder,null)},this.updateTree=function(a){var c=b.index();this.uit.removeRows();for(var d=0;d<a.length;d++){var e=c.getParentIndex(a[d].index);null==e?this.uit.appendRow(a[d].data):this.uit.appendRow(e,a[d].data)}k(this,!0),l(this)},this.append=function(){var a=this.count()>0?!1:!0,b=1==arguments.length?arguments[0]:arguments[1],c=2==arguments.length?arguments[0]:null;b=void 0==b.length?[b]:b;for(var d=0;d<b.length;d++){var e=null;e=null!=c?this.uit.appendRow(c,b[d]):this.uit.appendRow(b[d]),a||m(this,e)}k(this,a),a&&l(this)},this.insert=function(a,b){for(var c=this.count()>0?!1:!0,b=void 0==b.length?[b]:b,d=0;d<b.length;d++)this.uit.insertRow(a,b[d]);k(this,c),l(this)},this.select=function(b){var c=this.get(b);return this.hideExpand(),this.hideEditRow(),this.uncheckAll(),a(c.element).parent().find(".selected").removeClass("selected"),a(c.element).addClass("selected"),t=b,c},this.unselect=function(){if(null!=t){var b=this.get(t);return a(b.element).removeClass("selected"),t=null,b}},this.check=function(b){var c=this.get(b);this.hideExpand(),this.hideEditRow(),this.unselect(),u[b]=c,a(c.element).addClass("checked")},this.uncheck=function(b){var c=this.get(b);u[b]=null,a(c.element).removeClass("checked")},this.uncheckAll=function(){u={},r.tbody.find(".checked").removeClass("checked")},this.remove=function(a){return null==a?null:(this.uit.removeRow(a),l(this),void this.scroll())},this.reset=function(){this.uit.removeRows(),this.scroll()},this.move=function(a,b){this.uit.moveRow(a,b),l(this),(0==parseInt(a)||0==parseInt(b))&&this.scroll()},this.sort=function(a,b,c){if(this.options.fields&&this.options.sort&&!v){var d=this.getColumn(a);"string"==typeof d.name&&(d.order=b?b:"asc"==d.order?"desc":"asc",this.uit.setColumn(a,d),this.uit.sortRows(d.name,"desc"==d.order?!0:!1),this.emit("sort",[d,c]),k(this,!0),l(this))}},this.scroll=function(a){if(this.options.scroll){var b=this,c=a&&a>0?a:this.options.scrollHeight,c=c>0?c:200;this.options.scrollHeight=c,r.tbody.css("maxHeight",c+"px"),setTimeout(function(){r.tbody.outerHeight()<c?(r.table.css({"table-layout":""}),r.tbody.css({display:"",overflow:""})):(r.table.css({"table-layout":"fixed"}),r.tbody.css({display:"block",overflow:"auto"})),i(b)},10)}},this.open=function(a){null!=a&&(this.uit.openRow(a),this.emit("open",[this.get(a)]))},this.fold=function(a){null!=a&&(this.uit.foldRow(a),this.emit("fold",[this.get(a)]))},this.openAll=function(){this.uit.openRowAll(),this.emit("openall")},this.foldAll=function(){this.uit.foldRowAll(),this.emit("foldall")},this.resize=function(){this.scroll(),this.options.resize&&q(this)},this.resizeColumns=function(){for(var b=this.listColumn(),c=0;c<b.length;c++)null==b[c].width&&a(b[c].element).outerWidth("auto")},this.size=function(){return this.uit.getRowCount()},this.count=function(){return this.uit.getRowCount()},this.list=function(){return this.uit.getRow()},this.listData=function(){for(var a=this.list(),b=[],c=0;c<a.length;c++)b.push(a[c].data);return b},this.listAll=function(){return this.uit.getRowAll()},this.listChecked=function(){var a=[];for(var b in u)null!=u[b]&&a.push(u[b]);return a},this.listColumn=function(){return this.uit.getColumn()},this.get=function(a){return null==a?null:this.uit.getRow(a)},this.getAll=function(a){return null==a?null:this.uit.getRowAll(a)},this.getColumn=function(b){return null==b?null:this.uit.getColumn("string"==typeof b?a.inArray(b,this.options.fields):b)},this.showColumn=function(a,b){if(this.options.fields){var c=this.getColumn(a);this.uit.showColumn(c.index),this.scroll(),this.resizeColumns(),this.options.resize&&q(this),this.emit("colshow",[c,b])}},this.hideColumn=function(a,b){if(this.options.fields){var c=this.getColumn(a);this.uit.hideColumn(c.index),this.scroll(),this.resizeColumns(),this.options.resize&&q(this),this.emit("colhide",[c,b])}},this.initColumns=function(a){"object"==typeof a&&(this.options.colshow=a,g(this),this.scroll(),this.resizeColumns(),this.options.resize&&q(this))},this.showColumnMenu=function(b){if(this.options.fields&&s){var c=this.listColumn(),d=r.thead.offset(),e=d.left+r.table.outerWidth()-a(s.root).outerWidth();b=isNaN(b)||b>e+d.left?e:b,b=0>b?0:b,a(s.root).find("input[type=checkbox]").each(function(a){this.checked="show"==c[a].type?!0:!1}),s.move(b,d.top+r.thead.outerHeight()),s.show()}},this.hideColumnMenu=function(){this.options.fields&&s&&s.hide()},this.toggleColumnMenu=function(a){this.options.fields&&s&&("show"==s.type?this.hideColumnMenu():this.showColumnMenu(a))},this.showExpand=function(b,c,d){if(this.options.expand){this.unselect(),this.hideEditRow();var e="#EXPAND_"+this.timestamp,f=this.get(b),c="object"!=typeof c?a.extend({row:f},f.data):c,g=a(e).parent().show();r.tbody.find("tr").removeClass("open"),g.insertAfter(a(f.element).addClass("open")),a(e).attr("colspan",r.thead.find("tr:last > th:visible").size()).html(this.tpl.expand(c)),this.scroll(),this.setVo(),t=b,this.emit("expand",[f,d])}},this.hideExpand=function(b){if(this.options.expand&&null!=t){var c=this.get(t);a("#EXPAND_"+this.timestamp).parent().hide(),r.tbody.find("tr").removeClass("open"),this.scroll(),t=null,this.emit("expandend",[c,b])}},this.getExpand=function(){return this.options.expand?null==t?null:this.get(t):void 0},this.showEditRow=function(b,c){if(this.options.editRow){this.unselect(),this.hideExpand();var d=this,e=this.get(b),f=a(e.element).find("td");f.each(function(b){n(d,this,e,b,c,function(){var b={},g=e.data;f.each(function(c){var e=d.getColumn(c);if(null!=e.name){var f=a(this).find(".edit").val();b[e.name]=isNaN(f)||null==f?f:parseFloat(f)}}),e.data=b;var h=d.emit("editend",[e,c]);h!==!1?d.update(e.index,b):e.data=g})}),t=b,d.emit("editstart",[e,c])}},this.hideEditRow=function(){if(this.options.editRow&&null!=t){var a=this.get(t);t=null,this.emit("editend",[a.data]),this.update(a.index,a.data)}},this.getEditRow=function(){return this.options.editRow?null==t?null:this.get(t):void 0},this.setCsv=function(){var a=this.options;if(a.fields||a.csv){var c=1==arguments.length?arguments[0]:arguments[1],d=2==arguments.length?arguments[0]:null,e=b.getCsvFields(a.fields,a.csv),f=a.csvNumber?b.getCsvFields(a.fields,a.csvNumber):null,g=b.csvToData(e,c,f);if(null==d)this.update(g);else{this.reset();for(var h=0;h<g.length;h++){var i=g[h][d];i&&this.insert(i,g[h])}}}},this.setCsvFile=function(){if(this.options.fields||this.options.csv){var a=this,c=1==arguments.length?arguments[0]:arguments[1],d=2==arguments.length?arguments[0]:null;b.fileToCsv(c,function(b){null==d?a.setCsv(b):a.setCsv(d,b)})}},this.getCsv=function(a){if(this.options.fields||this.options.csv){for(var c=b.getCsvFields(this.options.fields,this.options.csv),d=[],e=a?this.listAll():this.list(),f=0;f<e.length;f++)d.push(e[f].data);return b.dataToCsv2({fields:c,rows:d,names:this.options.csvNames})}},this.getCsvBase64=function(a){return this.options.fields||this.options.csv?b.csvToBase64(this.getCsv(a)):void 0},this.downloadCsv=function(a,c){b.typeCheck("string",a)&&(a=a.split(".")[0]);var d=document.createElement("a");d.download=a?a+".csv":"table.csv",d.href=this.getCsvBase64(c),document.body.appendChild(d),d.click(),d.parentNode.removeChild(d)},this.activeIndex=function(){return t}};return e.setup=function(){return{fields:null,csv:null,csvNames:null,csvNumber:null,data:[],rows:null,colshow:!1,scroll:!1,scrollHeight:200,width:0,expand:!1,expandEvent:!0,editCell:!1,editRow:!1,editEvent:!0,resize:!1,sort:!1,sortIndex:null,sortOrder:"asc",sortEvent:!0,animate:!1}},e}),jui.define("uix.tree.node",["jquery"],function(a){var b=function(b,c){function d(a){i.nodenum=isNaN(a)?i.nodenum:a,i.parent&&(i.index=null==i.parent.index?""+i.nodenum:i.parent.index+"."+i.nodenum),i.parent&&"string"==typeof i.index&&(i.depth=i.index.split(".").length),i.childrens.length>0&&e(i)}function e(a){for(var b=a.childrens,c=0;c<b.length;c++)b[c].reload(c),b[c].childrens.length>0&&e(b[c])}function f(){if(!c)return i.element;try{var b=a(c(a.extend({node:{index:i.index,data:i.data,depth:i.depth}},i.data))).get(0)}catch(d){console.log(d)}return b}function g(b){a(b.element).remove();for(var c=0;c<b.childrens.length;c++){var d=b.childrens[c];d.childrens.length>0?g(d):a(d.element).remove()}}function h(a){for(var b=0;b<a.childrens.length;b++){var c=a.childrens[b];c.reload(b),c.childrens.length>0&&h(c)}}var i=this;
this.data=b,this.element=null,this.index=null,this.nodenum=null,this.parent=null,this.childrens=[],this.depth=0,this.type="open",this.reload=function(b,c){if(d(b),null!=this.element){var e=f();c?a(e).insertAfter(this.element):a(this.parent.element).children("ul").append(e),a(this.element).remove(),this.element=e}else this.element=f()},this.reloadChildrens=function(){h(this)},this.destroy=function(){null!=this.parent?this.parent.removeChild(this.index):(g(this),a(this.element).remove())},this.isLeaf=function(){return 0==this.childrens.length?!0:!1},this.fold=function(){a(this.element).children("ul").hide(),this.type="fold"},this.open=function(){a(this.element).children("ul").show(),this.type="open"},this.appendChild=function(b){a(this.element).children("ul").append(b.element),this.childrens.push(b)},this.insertChild=function(b,c){0==b?0==this.childrens.length?a(this.element).children("ul").append(c.element):a(c.element).insertBefore(this.childrens[0].element):a(c.element).insertAfter(this.childrens[b-1].element);var d=this.childrens.splice(0,b);d.push(c),this.childrens=d.concat(this.childrens),h(this)},this.removeChild=function(a){for(var b=0;b<this.childrens.length;b++){var c=this.childrens[b];c.index==a&&(this.childrens.splice(b,1),g(c))}h(this)},this.lastChild=function(){return this.childrens.length>0?this.childrens[this.childrens.length-1]:null},this.lastChildLeaf=function(a){var b=a?a:this.lastChild();return b.isLeaf()?b:this.lastChildLeaf(b.lastChild())}};return b}),jui.define("uix.tree.base",["jquery","util.base","uix.tree.node"],function(a,b,c){var d=function(a){function d(a,b,d){var e=new c(a,n.node);return e.parent=d?d:null,e.reload(b),e}function e(a,b){var c=b.childrens;if(c.length>0)for(var d=0;d<c.length;d++)a.push(c[d]),c[d].childrens.length>0&&e(a,c[d])}function f(a,b){if(!b)return null;var c=a.shift();return void 0==c?b:f(a,b.childrens[c])}function g(a,b){var c=o.getIndexList(a),e=k.getNodeParent(a),f=c[c.length-1];return node=d(b,f,e),e.insertChild(f,node),node}function h(a){if(null==l)l=d(a),m.tree.append(l.element);else{var b=d(a,l.childrens.length,l);l.appendChild(b)}return b}function i(a,b){var c=k.getNode(a),e=d(b,c.childrens.length,c);return c.appendChild(e),e}function j(a,b){for(var c=[];;){var d=b.parent;if(!d)break;c.push(d),b=d}for(var e=0;e<c.length;e++)if(a==c[e])return!0;return!1}var k=this,l=null,m=a.$obj,n=a.$tpl,o=b.index();this.appendNode=function(){var a=arguments[0],b=arguments[1];return b?i(a,b):h(a)},this.insertNode=function(a,b){return 0==l.childrens.length&&0==parseInt(a)?this.appendNode(b):g(a,b)},this.updateNode=function(a,b){var c=this.getNode(a);for(var d in b)c.data[d]=b[d];return c.reload(c.nodenum,!0),c.reloadChildrens(),c},this.removeNode=function(a){this.getNode(a).destroy()},this.removeNodes=function(){var a=l.childrens;if(a.length>0){var b=a.pop();b.parent=null,b.destroy(),this.removeNodes()}},this.openNode=function(a){null==a?this.getRoot().open():this.getNode(a).open()},this.foldNode=function(a){null==a?this.getRoot().fold():this.getNode(a).fold()},this.openNodeAll=function(a){for(var b=this.getNodeAll(a),c=0;c<b.length;c++)b[c].open();null==a&&this.getRoot().open()},this.foldNodeAll=function(a){for(var b=this.getNodeAll(a),c=0;c<b.length;c++)b[c].fold();null==a&&this.getRoot().fold()},this.moveNode=function(a,b){if(a!=b){var c=this.getNode(a),d=this.getNodeParent(b),e=o.getIndexList(b);if(tNo=e[e.length-1],!j(c,d)){c.parent.childrens.splice(c.nodenum,1),c.parent.reloadChildrens(),c.parent=d;var f=d.childrens.splice(0,tNo);f.push(c),d.childrens=f.concat(d.childrens),d.reloadChildrens()}}},this.getNode=function(a){if(null==a)return l.childrens;var b=l.childrens;if(o.isIndexDepth(a)){var c=o.getIndexList(a);return f(c,b[c.shift()])}return b[a]?b[a]:null},this.getNodeAll=function(a){for(var b=[],c=null==a?l.childrens:[this.getNode(a)],d=0;d<c.length;d++)c[d]&&(b.push(c[d]),c[d].childrens.length>0&&e(b,c[d]));return b},this.getNodeParent=function(a){var b=o.getIndexList(a);return 1==b.length?l:2==b.length?this.getNode(b[0]):b.length>2?(b.pop(),this.getNode(b.join("."))):void 0},this.getRoot=function(){return l}};return d}),jui.defineUI("uix.tree",["util.base","uix.tree.base"],function(a,b){var c=function(){function c(a,b){for(var c=0;c<b.length;c++){var d=b[c];$(d.element).removeClass("open fold leaf last"),d.parent&&d.isLeaf()?$(d.element).addClass("leaf"):"open"==d.type?($(d.element).addClass("open"),d.open()):($(d.element).addClass("fold"),d.fold()),d.parent?d.parent.lastChild()==d&&$(d.element).addClass("last"):$(d.element).addClass("root"),$(d.element).children("i:first-child").remove(),$(d.element).prepend($("<i></i>"))}}function d(a,b,c){if(null==b)if(a.options.rootHide){for(var d=a.uit.getRoot().childrens,e=0;e<d.length;e++)c(d[e].index);j(a,!1)}else c(b),j(a,!0);else c(b),j(a,!1)}function e(a,b){for(var c=0;c<b.length;c++)!function(b){var c=$(b.element);a.addEvent(c.children("i:first-child"),"click",function(c){"open"==b.type?a.fold(b.index,c):a.open(b.index,c),c.stopPropagation()}),a.addEvent(c.children("a,span,div")[0],"click",function(c){a.emit("select",[b,c]),c.stopPropagation()})}(b[c])}function f(a,b){if(a.options.drag){var c=a.uit.getRoot();$("body").off("mousemove").off("mouseup");for(var d=0;d<b.length;d++)!function(b){$(b.element).off("mousedown").off("mouseup"),a.addEvent(b.element,"mousedown",function(c){return"I"!=c.target.tagName?(null==k.start&&(k.start=b.index,a.emit("dragstart",[b.index,c])),!1):void 0}),a.addEvent(b.element,"mouseup",function(c){if("I"!=c.target.tagName){if(a.options.dragChild!==!1&&k.start&&k.start!=b.index){var d=b.lastChild(),e=d?m.getNextIndex(d.index):b.index+".0";a.move(k.start,e),a.emit("dragend",[e,c])}return k.start=null,k.end=null,!1}}),a.addEvent(c.element,"mouseup",function(b){if("I"!=b.target.tagName){if(a.options.dragChild!==!1&&k.start){var d=""+c.childrens.length;a.move(k.start,d),a.emit("dragend",[d,b])}return k.start=null,k.end=null,!1}})}(b[d]);a.addEvent("body","mouseup",function(b){return k.start&&k.end&&(a.move(k.start,k.end),a.emit("dragend",[k.end,b])),k.start=null,k.end=null,!1})}}function g(a){if(a.options.drag){$(a.root).find(".drag").remove();for(var b=a.listAll(),c=0;c<b.length;c++){var d=b[c],e=$(d.element).position();e.top>0&&i(a,d,e)}}}function h(a){if(a.options.drag)for(var b=a.listAll(),c=0;c<b.length;c++){var d=b[c],e=$(d.element).position();e.top>0&&d.parent&&d.parent.lastChild()==d&&(e.top=e.top+$(d.element).outerHeight(),i(a,d,e,!0))}}function i(a,b,c,d){if(a.options.drag){var e=d?m.getNextIndex(b.index):b.index,f=$("<div class='drag'></div>").attr("data-index",e).css(c).outerWidth($(b.element).outerWidth());$(a.root).append(f),a.addEvent(f,"mouseover",function(){k.start&&(k.end=e,f.addClass("on"))}),a.addEvent(f,"mouseout",function(){k.start&&f.removeClass("on")})}}function j(a,b){var d=a.listAll();c(a,d),e(a,d),f(a,d),g(a),h(a),b&&(c(a,[a.uit.getRoot()]),e(a,[a.uit.getRoot()]))}var k={start:null,end:null},l=null,m=a.index();this.init=function(){var a=this.options;if(this.uit=new b({$obj:{tree:$(this.root)},$tpl:this.tpl}),!a.root)throw new Error("JUI_CRITICAL_ERROR: root data is required");if(this.uit.appendNode(a.root),j(this,!0),a.rootHide){var c=this.uit.getRoot();$(c.element).css("padding-left","0px"),$(c.element).children("*:not(ul)").hide()}a.rootFold&&this.fold()},this.update=function(b){var c=1==arguments.length?arguments[0]:arguments[1],b=2==arguments.length?arguments[0]:null;if(null!=b)this.uit.updateNode(b,c);else{var d=a.index();this.uit.removeNodes();for(var e=0;e<c.length;e++){var f=d.getParentIndex(c[e].index);null==f?this.uit.appendNode(c[e].data):this.uit.appendNode(f,c[e].data)}}j(this)},this.append=function(){var a=1==arguments.length?arguments[0]:arguments[1],b=2==arguments.length?arguments[0]:null;a=void 0==a.length?[a]:a;for(var c=0;c<a.length;c++)null!=b?this.uit.appendNode(b,a[c]):this.uit.appendNode(a[c]);j(this)},this.insert=function(a,b){for(var c=void 0==b.length?[b]:b,d=0;d<c.length;d++)this.uit.insertNode(a,c[d]);j(this)},this.select=function(a){var b=null==a?this.uit.getRoot():this.get(a);return $(this.root).find("li").removeClass("active"),$(b.element).addClass("active"),l=a,b},this.unselect=function(){if(null!=l){var a=this.get(l);return $(a.element).removeClass("active"),l=null,a}},this.remove=function(a){this.uit.removeNode(a),j(this)},this.reset=function(){this.uit.removeNodes(),j(this)},this.move=function(a,b){this.uit.moveNode(a,b),j(this)},this.open=function(a,b){if(null!=a||!this.options.rootHide){var c=null==a;this.uit.openNode(a),j(this,c),this.emit("open",[c?this.uit.getRoot():this.get(a),b])}},this.fold=function(a,b){if(null!=a||!this.options.rootHide){var c=null==a;this.uit.foldNode(a),j(this,c),this.emit("fold",[c?this.uit.getRoot():this.get(a),b])}},this.openAll=function(a){var b=this,c=null==a;d(this,a,function(a){b.uit.openNodeAll(a)}),this.emit("openall",[c?this.uit.getRoot():this.get(a)])},this.foldAll=function(a){var b=this,c=null==a;d(this,a,function(a){b.uit.foldNodeAll(a)}),this.emit("foldall",[c?this.uit.getRoot():this.get(a)])},this.list=function(){return this.uit.getNode()},this.listAll=function(){return this.uit.getNodeAll()},this.listParents=function(a){function b(a){null!=a.index&&(d.push(a),null!=a.parent&&b(a.parent))}var c=this.get(a),d=[];return c.parent&&b(c.parent),d.reverse()},this.get=function(a){return null==a?null:this.uit.getNode(a)},this.getAll=function(a){return null==a?null:this.uit.getNodeAll(a)},this.activeIndex=function(){return l}};return c.setup=function(){return{root:null,rootHide:!1,rootFold:!1,drag:!1,dragChild:!0}},c}),jui.defineUI("uix.window",["jquery","util.base","ui.modal"],function(a,b,c){var d=function(){function b(){var a=h.$foot.length<1?5:h.$foot.outerHeight();h.$body.outerHeight(h.$root.outerHeight()-h.$head.outerHeight()-a)}var d=2e3,e=null,f={},g={},h={},i=null;this.init=function(){var j=this,k=this.options,l=a(this.root),m=a(this.root).children(".head"),n=a(this.root).children(".body"),o=a(this.root).children(".foot");if(k.modal&&(k.move=!1,k.resize=!1),h={$root:l,$head:m,$body:n,$foot:o},l.css(a.extend({position:"absolute"},k)).appendTo(a("body")),k.move&&this.addEvent(m,"mousedown",function(a){e=l,f.check=!0,f.disX=a.pageX-e.offset().left,f.disY=a.pageY-e.offset().top}),k.resize&&(l.append("<i class='icon-resize resize'></i>"),this.addEvent(l.children(".resize"),"mousedown",function(){return e=l,g.check=!0,g.disX=e.width()+e.offset().left,g.disWidth=e.width(),g.disY=e.height()+e.offset().top,g.disHeight=e.height(),!1})),k.modal||j.addEvent(l,"mousedown",function(a){l.css("z-index",++d),a.stopPropagation()}),this.addEvent(m.find(".close"),"click",function(){return j.hide(),!1}),this.addEvent("body","mousemove",function(c){if(f.check){var d=c.pageX-f.disX,h=c.pageY-f.disY;a(e).css({left:d+"px",top:h+"px"})}if(g.check){var i=c.pageX-g.disX,j=c.pageY-g.disY;e.width(g.disWidth+i),e.height(g.disHeight+j),b()}}),this.addEvent("body","mouseup",function(a){f.check&&j.emit("move",a),g.check&&j.emit("resize",a),f.check=!1,g.check=!1}),this.type="hide",l.hide(),k.modal){var p=k.modalIndex>0?{index:k.modalIndex}:{};i=c(j.root,a.extend({autoHide:!1},p))}},this.hide=function(){i?i.hide():h.$root.hide(),this.emit("hide"),this.type="hide"},this.show=function(a,c){i?i.show():h.$root.show(),(a||c)&&this.move(a,c),this.emit("show"),this.type="show",b()},this.move=function(a,b){h.$root.css("left",a),h.$root.css("top",b)},this.update=function(a){h.$body.empty().html(a)},this.setTitle=function(a){h.$head.find(".title").empty().html(a)},this.setSize=function(a,c){h.$root.width(a),h.$root.height(c),b()},this.resize=function(){b()},this.resizeModal=function(){i&&i.resize()}};return d.setup=function(){return{width:400,height:300,left:"auto",top:"auto",right:"auto",bottom:"auto",modal:!1,move:!0,resize:!0,modalIndex:0,animate:!1}},d}),jui.defineUI("uix.xtable",["jquery","util.base","ui.modal","uix.table"],function(a,b,c,d){var e=null;b.resize(function(){for(var a=jui.get("uix.xtable"),b=0;b<a.length;b++)for(var c=a[b],d=0;d<c.length;d++)c[d].resize()},1e3);var f=function(){function f(b){function c(b,c){var d={};for(var e in b.options)-1==a.inArray(e,c)&&(d[e]=b.options[e]);return d}function e(b,c,d){var e=b.options;if(a(b.root).css({position:"relative"}),a(c.root).css({position:"absolute",top:"0","border-bottom-width":"0",margin:"0"}),a(d.root).css({margin:"0"}),e.width>0&&a(b.root).outerWidth(e.width),e.scrollWidth>0){var f=a(b.root).outerWidth();a(b.root).css({"max-width":b.options.scrollWidth,"overflow-x":"auto","overflow-y":"hidden"}),a(c.root).outerWidth(f),a(d.root).parent().outerWidth(f)}}function f(b,c){var d=a(c.root).clone(),e=c.listColumn();a(c.root).wrap("page"!=b.options.buffer?"<div class='body' style='max-height: "+b.options.scrollHeight+"px'></div>":"<div class='body'></div>"),a(c.root).find("thead > tr").outerHeight(0).not(":last-child").remove();for(var f=0;f<e.length;f++){var g=a(e[f].element);g.html("").outerHeight(0).attr("style",g.attr("style")+"border-top-width: 0px !important;border-bottom-width: 0px !important;padding-top: 0px !important;padding-bottom: 0px !important")}d.children("tbody").remove(),a(b.root).append(d.addClass("head")),a(b.root).css("padding-top",d.height())}var g=["buffer","bufferCount","csvCount","sortLoading","sortCache","sortIndex","sortOrder","event","rows","scrollWidth","width"];k=d(a(b.root).children("table"),c(b,g.concat("resize"))),f(b,k),j=d(a(b.root).children("table.head"),c(b,g)),e(b,j,k)}function g(b){j.on("colresize",function(c,d){for(var e=j.listColumn(),f=k.listColumn(),g=!1,h=e.length-1;h>=0;h--){var i=a(e[h].element).outerWidth();"page"==b.options.buffer||"show"!=e[h].type||g?(a(e[h].element).outerWidth(i),a(f[h].element).outerWidth(i)):(a(f[h].element).outerWidth("auto"),g=!0)}b.emit("colresize",[c,d])}),j.on("colshow",function(a,c){k.uit.showColumn(a.index),b.resize(),b.emit("colshow",[a,c])}),j.on("colhide",function(a,c){k.uit.hideColumn(a.index),b.resize(),b.emit("colhide",[a,c])}),j.on("colclick",function(a,c){b.emit("colclick",[a,c])}),j.on("coldblclick",function(a,c){b.emit("coldblclick",[a,c])}),j.on("colmenu",function(a,c){b.emit("colmenu",[a,c])}),j.on("sort",function(a,c){b.sort(a.index,a.order,c),b.emit("sort",[a,c]),b.options.sortCache&&b.setOption({sortIndex:a.index,sortOrder:a.order})}),k.on("select",function(a,c){b.emit("select",[a,c])}),k.on("rowmenu",function(a,c){b.emit("rowmenu",[a,c])}),k.on("expand",function(a,c){b.emit("expand",[a,c])}),k.on("expandend",function(a,c){b.emit("expandend",[a,c])})}function h(b){var c=a(b.root).children(".body");c.off("scroll").scroll(function(a){return this.scrollTop+b.options.scrollHeight>=c.get(0).scrollHeight?(b.next(),b.emit("scroll",a),!1):void 0})}function i(b){function c(b){var c=30;f.column+b<c||(a(e.head.element).outerWidth(f.column+b),a(e.body.element).outerWidth(f.column+b),b>0&&(a(k.root).parent().outerWidth(f.body+b),a(j.root).outerWidth(f.body+b)))}function d(){for(var b=0;b<j.uit.getColumnCount()-1;b++){var c=a(j.getColumn(b).element);c.find(".resize").css("left",c.outerWidth()+c.position().left+"px")}}var e={},f={},g=0;a(b.root).find("thead .resize").remove();for(var h=0;h<j.uit.getColumnCount()-1;h++){var i=a(j.getColumn(h).element),l=a("<div class='resize'></div>"),m=i.position();l.css({position:"absolute",width:"8px",height:i.outerHeight(),left:i.outerWidth()+(m.left-1)+"px",top:m.top+"px",cursor:"w-resize","z-index":"1"}),i.append(l),function(c){b.addEvent(l,"mousedown",function(b){return 0==g&&(g=b.pageX),e={head:j.getColumn(c),body:k.getColumn(c)},f={column:a(e.head.element).outerWidth(),body:a(k.root).outerWidth()},q=!0,!1})}(h)}b.addEvent("body","mousemove",function(a){g>0&&c(a.pageX-g)}),b.addEvent("body","mouseup",function(a){return g>0?(g=0,q=!1,d(),j.emit("colresize",[e.head,a]),!1):void 0}),j.on("colshow",d),j.on("colhide",d)}var j=null,k=null,l=[],m=null,n=null,o=1,p=!1,q=!1;this.init=function(){var b=this.options;if(b.data=null!=b.rows?b.rows:b.data,"TABLE"==this.root.tagName){var d=a(this.root).wrap("<div class='xtable'></div>");this.root=d.parent().get(0)}if(f(this),g(this),"page"!=b.buffer){var e=a(this.root).children(".body");e.css({"overflow-y":"scroll","overflow-x":"hidden"}),e.children("table").css({"border-bottom-width":"0"})}if("scroll"==b.buffer&&h(this),b.data&&this.update(b.data),b.tpl.loading){var k=a(b.tpl.loading);a(this.root).append(k),n=c(k,{target:this.selector,opacity:.1,autoHide:!1}),b.sortLoading=b.sortLoading===!0?500:b.sortLoading}b.resize&&(j.resizeColumns(),j.resize()),!b.resize&&b.scrollWidth>0&&i(this)},this.select=function(a){return k.select(a)},this.update=function(a){l=a,this.clear(),this.next(),this.emit("update"),j.emit("colresize"),this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortOrder,void 0,!0)},this.next=function(){var a=(o-1)*this.options.bufferCount,b=a+this.options.bufferCount;if(b=b>l.length?l.length:b,b<=l.length){for(var c=[],d=a;b>d;d++)c.push(l[d]);k.append(c),this.emit("next",[o]),c.length>0&&o++}},this.page=function(a){return"scroll"==this.options.buffer?!1:this.getPage()==a?!1:(e=o>a?"prev":"next",this.clear(),o=1>a?1:a,void this.next())},this.sort=function(a,c,d,e){function f(){var a=b.sort(l);a.setCompare("desc"==i.order?function(a,b){return g(a)>g(b)?!0:!1}:function(a,b){return g(a)<g(b)?!0:!1}),a.run(),h.emit("sortend",[i,d]),h.clear(),h.next(),h.hideLoading()}function g(a){var b=a[i.name];return"string"==typeof b?b.toLowerCase():isNaN(b)||null==b?"":b}if(this.options.fields&&this.options.sort&&!q){var h=this,i=j.getColumn(a);"string"==typeof i.name&&(i.order=c?c:"asc"==i.order?"desc":"asc",j.uit.setColumn(a,i),this.options.sortLoading&&!e?(h.showLoading(),setTimeout(function(){f()},this.options.sortLoading)):f())}},this.filter=function(a){if("function"==typeof a){null==m?m=l:l=m;for(var b=l.slice(),c=[],d=0,e=b.length;e>d;d++)a(b[d])===!0&&c.push(b[d]);this.update(c),this.emit("filter",[c])}},this.rollback=function(){null!=m&&(this.update(m),m=null)},this.clear=function(){o=1,k.uit.removeRows(),k.scroll()},this.reset=function(){this.clear(),l=[]},this.resize=function(){j.resizeColumns(),j.resize(),j.emit("colresize")},this.height=function(b){"scroll"==this.options.buffer&&(this.options.scrollHeight=b,a(this.root).find(".body").css("max-height",b+"px"),h(this))},this.size=function(){return l.length},this.count=function(){return l.length},this.list=function(){return k.list()},this.listColumn=function(){return j.listColumn()},this.listData=function(){return l},this.get=function(a){return null==a?null:k.get(a)},this.getColumn=function(a){return j.getColumn(a)},this.getData=function(a){return l[a]},this.showColumn=function(a){j.showColumn(a)},this.hideColumn=function(a){j.hideColumn(a)},this.initColumns=function(a){j.initColumns(a),k.initColumns(a),j.emit("colresize")},this.showColumnMenu=function(a){j.showColumnMenu(a)},this.hideColumnMenu=function(){j.hideColumnMenu()},this.toggleColumnMenu=function(a){j.toggleColumnMenu(a)},this.showExpand=function(a,b){k.showExpand(a,b)},this.hideExpand=function(a){a?k.hideExpand(a):k.hideExpand()},this.getExpand=function(){return k.getExpand()},this.showLoading=function(a){if(n&&!p&&(n.show(),p=!0,a>0)){var b=this;setTimeout(function(){b.hideLoading()},a)}},this.hideLoading=function(){n&&p&&(n.hide(),p=!1)},this.setCsv=function(a){var c=this.options;if(c.fields||c.csv){var d=b.getCsvFields(c.fields,c.csv),e=c.csvNumber?b.getCsvFields(c.fields,c.csvNumber):null;this.update(b.csvToData(d,a,e))}},this.setCsvFile=function(a){if(this.options.fields||this.options.csv){var c=this;b.fileToCsv(a,function(a){c.setCsv(a)})}},this.getCsv=function(){if(this.options.fields||this.options.csv){var a=b.getCsvFields(this.options.fields,this.options.csv),c=l.length>this.options.csvCount?this.options.csvCount:l.length;return b.dataToCsv2({fields:a,rows:l,count:c,names:this.options.csvNames})}},this.getCsvBase64=function(){return this.options.fields||this.options.csv?b.csvToBase64(this.getCsv()):void 0},this.downloadCsv=function(a){b.typeCheck("string",a)&&(a=a.split(".")[0]);var c=document.createElement("a");c.download=a?a+".csv":"table.csv",c.href=this.getCsvBase64(),document.body.appendChild(c),c.click(),c.parentNode.removeChild(c)},this.rowFunc=function(a,b,c){if(this.options.fields){var d="function"==typeof c?!0:!1,e=0,f=d?0:l.length,g=j.getColumn(b);if(g.name)for(var h=0;h<l.length;h++){var i=l[h][g.name];isNaN(i)||(d?c(l[h])&&(e+=i,f++):e+=i)}return"sum"==a?e:"avg"==a?e/f:null}},this.getPage=function(){return o-1},this.activeIndex=function(){return k.activeIndex()}};return f.setup=function(){return{fields:null,csv:null,csvNames:null,csvNumber:null,csvCount:1e4,data:[],rows:null,colshow:!1,expand:!1,expandEvent:!0,resize:!1,scrollHeight:200,scrollWidth:0,width:0,buffer:"scroll",bufferCount:100,sort:!1,sortLoading:!1,sortCache:!1,sortIndex:null,sortOrder:"asc",sortEvent:!0,animate:!1}},f}),jui.define("chart.draw",["jquery","util.base"],function(a,b){var c=function(){this.render=function(){if(!b.typeCheck("function",this.draw)||!b.typeCheck("function",this.drawAfter))throw new Error("JUI_CRITICAL_ERR: 'draw & drawAfter' method must be implemented");b.typeCheck("function",this.drawBefore)&&this.drawBefore();var a=this.draw();if(b.typeCheck("function",this.drawAnimate)){var c=this.grid||this.brush||this.widget;c.animate!==!1&&this.drawAnimate(a)}if(!b.typeCheck("object",a))throw new Error("JUI_CRITICAL_ERR: 'draw' method should return the object");return this.drawAfter(a),a},this.format=function(){var a=this.grid||this.brush||this.widget,b=a.format||this.chart.format;return b.apply(this.chart,arguments)},this.balloonPoints=function(a,b,c,d){var e=[];return"top"==a?(e.push([0,0].join(",")),e.push([b,0].join(",")),e.push([b,c].join(",")),e.push([b/2+d/2,c].join(",")),e.push([b/2,c+d].join(",")),e.push([b/2-d/2,c].join(",")),e.push([0,c].join(",")),e.push([0,0].join(","))):"bottom"==a?(e.push([0,d].join(",")),e.push([b/2-d/2,d].join(",")),e.push([b/2,0].join(",")),e.push([b/2+d/2,d].join(",")),e.push([b,d].join(",")),e.push([b,d+c].join(",")),e.push([0,d+c].join(",")),e.push([0,d].join(","))):"left"==a?(e.push([0,0].join(",")),e.push([b,0].join(",")),e.push([b,c/2-d/2].join(",")),e.push([b+d,c/2].join(",")),e.push([b,c/2+d/2].join(",")),e.push([b,c].join(",")),e.push([0,c].join(",")),e.push([0,0].join(","))):"right"==a&&(e.push([0,0].join(",")),e.push([b,0].join(",")),e.push([b,c].join(",")),e.push([0,c].join(",")),e.push([0,c/2+d/2].join(",")),e.push([0-d,c/2].join(",")),e.push([0,c/2-d/2].join(",")),e.push([0,0].join(","))),e.join(" ")}};return c.setup=function(){return{type:null,animate:!1}},c}),jui.define("chart.axis",["jquery","util.base","util.math"],function(a,b){var c=function(a,c,d){function e(b,c){return b.x=f(b.x,a.area("width")),b.y=f(b.y,a.area("height")),b.width=f(b.width,a.area("width")),b.height=f(b.height,a.area("height")),b.x2=b.x+b.width,b.y2=b.y+b.height,b.x+=c.left||0,b.y+=c.top||0,b.x2-=c.right||0,b.y2-=c.bottom||0,b.width=b.x2-b.x,b.height=b.y2-b.y,b}function f(a,c){return b.typeCheck("string",a)&&a.indexOf("%")>-1?c*(parseFloat(a.replace("%",""))/100):a}function g(c,d){if(("x"==d||"y"==d)&&!b.typeCheck("object",c[d]))return null;c[d]=c[d]||{},"x"==d?c[d].orient="top"==c[d].orient?"top":"bottom":"y"==d?c[d].orient="right"==c[d].orient?"right":"left":"c"==d&&(c[d].type=c[d].type||"panel",c[d].orient="custom"),b.typeCheck("integer",c[d].extend)&&b.extend(c[d],a.options.axis[c[d].extend][d],!0),c[d].type=c[d].type||"block";var e=jui.include("chart.grid."+c[d].type);jui.defineOptions(e,c[d]);var f=new e(a,c,c[d]);f.chart=a,f.axis=c,f.grid=c[d];var g=f.render();return"left"==c[d].orient?g.root.translate(a.area("x")+k.area("x")-c[d].dist,a.area("y")):"right"==c[d].orient?g.root.translate(a.area("x")+k.area("x2")+c[d].dist,a.area("y")):"bottom"==c[d].orient?g.root.translate(a.area("x"),a.area("y")+k.area("y2")+c[d].dist):"top"==c[d].orient?g.root.translate(a.area("x"),a.area("y")+k.area("y")-c[d].dist):g.root&&g.root.translate(a.area("x")+k.area("x"),a.area("y")+k.area("y")),g.scale.type=c[d].type,g.scale.root=g.root,g.scale}function h(a){var b=k.origin,c=k.buffer,d=Math.ceil(b.length/c);k.page=1>a?1:a>d?d:a,k.start=(k.page-1)*c,k.end=k.start+c,k.end>b.length&&(k.start=b.length-c,k.end=b.length),k.end<=b.length&&(k.start=k.start<0?0:k.start,k.data=b.slice(k.start,k.end),b.length>0&&k.page++)}function i(){b.extend(k,{data:d.data,origin:d.origin,buffer:d.buffer,shift:d.shift,page:d.page}),k.origin=k.data,h(1),k.reload(d)}function j(){n&&(n.remove(),n=null),m=b.createId("clip-id-"),n=a.svg.clipPath({id:m},function(){a.svg.rect({x:l.x,y:l.y,width:l.width,height:l.height})}),a.appendDefs(n)}var k=this,l={},m="",n=null;this.getValue=function(a,c,e){var f=a[d.keymap[c]];return b.typeCheck("undefined",f)?(f=a[c],b.typeCheck("undefined",f)?e:f):f},this.reload=function(c){var d=a.area();b.extend(this,{x:c.x,y:c.y,c:c.c}),l=e(b.extend(c.area,{x:0,y:0,width:d.width,height:d.height},!0),c.padding||{}),this.x=g(this,"x"),this.y=g(this,"y"),this.c=g(this,"c"),j()},this.area=function(a){return b.typeCheck("undefined",l[a])?l:l[a]},this.get=function(a){var b={area:l,clipId:m};return b[a]||d[a]},this.updateGrid=function(d,e){b.extend(c[d],e),a.isRender()&&a.render()},this.update=function(a){this.origin=a,this.page=1,this.start=0,this.end=0,this.screen(1)},this.screen=function(b){h(b),this.end<=this.origin.length&&a.isRender()&&a.render()},this.next=function(){var b=this.origin,c=this.buffer,d=this.shift;this.start+=d;var e=this.start+c>b.length;this.end=e?b.length:this.start+c,this.start=e?b.length-c:this.start,this.start=this.start<0?0:this.start,this.data=b.slice(this.start,this.end),a.isRender()&&a.render()},this.prev=function(){var b=this.origin,c=this.buffer,d=this.shift;this.start-=d;var e=this.start<0;this.end=e?c:this.start+c,this.start=e?0:this.start,this.data=b.slice(this.start,this.end),a.isRender()&&a.render()},this.zoom=function(b,c){if(b!=c){var d=this.origin;this.end=c>d.length?d.length:c,this.start=0>b?0:b,this.data=d.slice(this.start,this.end),a.isRender()&&a.render()}},i()};return c.setup=function(){return{x:null,y:null,c:null,data:[],origin:[],keymap:{},area:{},padding:{},buffer:1e4,shift:1,page:1,angle:0,depth:0}},c}),jui.defineUI("chart.builder",["jquery","util.base","util.svg","util.color","chart.axis"],function(a,b,c,d,e){var f=0;b.resize(function(){if(f!=a(window).width()){for(var b=jui.get("chart.builder"),c=0;c<b.length;c++)for(var d=b[c],e=0;e<d.length;e++)d[e].isFullSize()&&d[e].setSize(),d[e].isRender()||d[e].render(!0);f=a(window).width()}},300);var g=function(){function f(a){var b=a.svg.size(),c={width:b.width-(s.left+s.right),height:b.height-(s.top+s.bottom),x:s.left,y:s.top};c.width<0&&(c.width=0),c.height<0&&(c.height=0),c.x2=c.x+c.width,c.y2=c.y+c.height,u=c}function g(a){t=b.deepClone(C.series),x=b.deepClone(C.brush),y=b.deepClone(C.widget),z=a.svg.defs(),A={}}function h(a){for(var c=b.deepClone(C.axis,{data:!0,origin:!0}),d=0;d<c.length;d++)jui.defineOptions(e,c[d]),w[d]?w[d].reload(c[d]):w[d]=new e(a,C.axis[d],c[d])}function i(a){var c=x;if(null!=c)for(var d=0;d<c.length;d++){var e=jui.include("chart.brush."+c[d].type);jui.defineOptions(e,c[d]);var f=w[c[d].axis];if(c[d].target)b.typeCheck("string",c[d].target)&&(c[d].target=[c[d].target]);else{var g=[];if(f)for(var h in f.data[0])g.push(h);c[d].target=g}c[d].index=d;var i=new e(a,f,c[d]);i.chart=a,i.axis=f,i.brush=c[d],i.render()}}function j(a,c){var d=y;if(null!=d)for(var e=0;e<d.length;e++){var f=jui.include("chart.widget."+d[e].type);jui.defineOptions(f,d[e]),d[e].index=e;var g=x[b.typeCheck("array",d[e].brush)?d[e].brush[0]:d[e].brush],h=new f(a,w[g.axis],d[e]);if(h.chart=a,h.axis=w[g.axis],h.widget=d[e],B&&!h.isRender()&&c!==!0)return;var i=h.render();h.isRender()||a.svg.autoRender(i,!1)}}function k(b){function c(c){var d=a(b.root).offset(),e=c.pageX-d.left,f=c.pageY-d.top;return c.bgX=(e+F)/E,c.bgY=(f+G)/E,c.chartX=(e-b.padding("left")+F)/E,c.chartY=(f-b.padding("top")+G)/E,c.chartX<0||c.chartX>b.area("width")||c.chartY<0||c.chartY>b.area("height")?void 0:!0}var d=b.svg.root,e=!1;d.on("click",function(a){c(a)?b.emit("chart.click",[a]):b.emit("bg.click",[a])}),d.on("dblclick",function(a){c(a)?b.emit("chart.dblclick",[a]):b.emit("bg.dblclick",[a])}),d.on("contextmenu",function(a){c(a)?b.emit("chart.rclick",[a]):b.emit("bg.rclick",[a]),a.preventDefault()}),d.on("mousemove",function(a){c(a)?e?b.emit("chart.mousemove",[a]):(b.emit("chart.mouseover",[a]),e=!0):(e&&(b.emit("chart.mouseout",[a]),e=!1),b.emit("bg.mousemove",[a]))}),d.on("mousedown",function(a){c(a)?b.emit("chart.mousedown",[a]):b.emit("bg.mousedown",[a])}),d.on("mouseup",function(a){c(a)?b.emit("chart.mouseup",[a]):b.emit("bg.mouseup",[a])}),d.on("mouseover",function(a){c(a)||b.emit("bg.mouseover",[a])}),d.on("mouseout",function(a){c(a)||b.emit("bg.mouseout",[a])}),b.addEvent(b.root,"selectstart",function(a){return a.preventDefault(),!1})}function l(a,b){for(var c=0;c<D.render.length;c++)a.off(D.render[c]);if(D.render=[],b===!0){for(var c=0;c<D.renderAll.length;c++)a.off(D.renderAll[c]);D.renderAll=[]}}function m(a,d){if(!b.typeCheck("undefined",d)&&A[d])return"url(#"+A[d]+")";var e=null,f=b.createId("gradient");return a.attr.id=f,e=c.createElement(a),z.append(e),b.typeCheck("undefined",d)||(A[d]=f),"url(#"+f+")"}function n(a){if(b.typeCheck("string",a)){if(a=a.replace("url(#","").replace(")",""),A[a])return"url(#"+a+")";if(-1==a.indexOf("pattern-"))return!1;var d=a.split("-"),e=d.pop(),f=jui.include("chart."+d.join("."));if(!f)return!1;var g=f[e];return"function"==typeof g&&(g=g.call(g)),g.attr&&!g.attr.id&&(g.attr.id=a),g=c.createElement(g),z.append(g),A[a]=a,"url(#"+a+")"}if(a.attr.id=a.attr.id||b.createId("pattern-"),A[a.attr.id])return"url(#"+a.attr.id+")";var g=c.createElement(a);return z.append(g),A[a.attr.id]=a.attr.id,"url(#"+a.attr.id+")"}function o(a){if(b.typeCheck("undefined",a))return"none";if(b.typeCheck("object",a))return"pattern"==a.type?n(a):m(a);if("string"==typeof a){var c=n(a);if(c)return c}var e=d.parse(a);return e==a?a:m(e,a)}function p(a){var c={};b.typeCheck("string",a)?(b.extend(c,jui.include("chart.theme."+a)),b.extend(c,C.style)):b.typeCheck("object",a)&&(b.extend(v,C.style),b.extend(v,a),b.extend(c,v)),v=c}function q(a){C=b.deepClone(a.options,{data:!0,bind:!0});var c=C.padding;s=b.typeCheck("integer",c)?{left:c,right:c,bottom:c,top:c}:c,b.typeCheck("object",C.bind)&&a.bindUI(0,C.bind),b.typeCheck("array",C.axis)||(C.axis=[C.axis]),b.typeCheck("array",C.brush)||(C.brush=[C.brush]),b.typeCheck("array",C.widget)||(C.widget=[C.widget])}function r(){var a=C.icon;if(b.typeCheck("string",a.path)){var c=["url("+a.path+".eot) format('embedded-opentype')","url("+a.path+".woff) format('woff')","url("+a.path+".ttf) format('truetype')","url("+a.path+".svg) format('svg')"],d="font-family: "+a.type+"; font-weight: normal; font-style: normal; src: "+c.join(",");!function(a){var b=function(){var a=document.createElement("style");return a.appendChild(document.createTextNode("")),document.head.appendChild(a),a.sheet}();b.insertRule(a,0)}("@font-face {"+d+"}")}}var s,t,u,v,w=[],x=[],y=[],z=null,A={},B=!1,C=null,D={render:[],renderAll:[]},E=1,F=0,G=0;this.init=function(){q(this),p(C.theme),this.svg=new c(this.root,{width:C.width,height:C.height,"buffered-rendering":"dynamic"}),this.render(),k(this),r()},this.get=function(a,b){var c={axis:w,brush:x,widget:y,series:t,padding:s,area:u};return c[a][b]?c[a][b]:c[a]||c},this.axis=function(a){return b.typeCheck("undefined",w[a])?w:w[a]},this.area=function(a){return b.typeCheck("undefined",u[a])?u:u[a]},this.padding=function(a){return b.typeCheck("undefined",s[a])?s:s[a]},this.color=function(a,c){function d(b){var c=v.colors,d=b||a;return d>c.length-1?c[c.length-1]:c[d]}var e;if(b.typeCheck("array",c.colors)?(e=c.colors[a],b.typeCheck("integer",e)&&(e=d(e))):e=d(),b.typeCheck("array",c.target)){var f=t[c.target[a]];f&&f.color&&(e=f.color,b.typeCheck("integer",e)&&(e=d(e)))
}return A[e]?"url(#"+A[e]+")":o(e)},this.icon=function(a){return jui.include("chart.icon."+C.icon.type)[a]},this.text=function(a,c){if(b.typeCheck("string",c)){var d=/{([^{}]+)}/g,e=c.match(d);if(null!=e)for(var f=0;f<e.length;f++){var g=e[f].substring(1,e[f].length-1);c=c.replace(e[f],this.icon(g))}}else b.typeCheck("undefined",c)&&(c="");return this.svg.text(a,c)},this.theme=function(a,b,c){if(0==arguments.length)return v;if(1==arguments.length)return a.indexOf("Color")>-1&&null!=v[a]?o(v[a]):v[a];if(3==arguments.length){var d=a?b:c;return d.indexOf("Color")>-1&&null!=v[d]?o(v[d]):v[d]}},this.format=function(){if(0!=arguments.length){var a=C.format;return b.typeCheck("function",a)?a.apply(this,arguments):arguments[0]}},this.bindUI=function(a,b){function c(){d.axis(a).update(b.listData())}var d=this;"uix.table"==b.module.type?(b.callAfter("update",c),b.callAfter("sort",c),b.callAfter("append",c),b.callAfter("insert",c),b.callAfter("remove",c)):"uix.xtable"==b.module.type&&(b.callAfter("update",c),b.callAfter("sort",c))},this.on=function(a,c,d){b.typeCheck("string",a)&&b.typeCheck("function",c)&&(this.event.push({type:a.toLowerCase(),callback:c}),("render"==d||"renderAll"==d)&&D[d].push(c))},this.scale=function(a){return!a||0>a?E:(E=a,this.svg.root.each(function(a,b){b.scale(E)}),E)},this.view=function(a,c){var d=this.area(),e={x:F,y:G};return Math.abs(a)>d.width||!b.typeCheck("number",a)?e:Math.abs(c)>d.height||!b.typeCheck("number",c)?e:(F=a,G=c,this.svg.root.attr({viewBox:F+" "+G+" "+d.width+" "+d.height}),{x:F,y:G})},this.render=function(a){this.svg.reset(a),l(this,a),f(this),g(this),h(this),i(this),j(this,a),this.svg.root.css({"font-family":this.theme("fontFamily")+","+C.icon.type,"font-size":this.theme("fontSize"),fill:this.theme("fontColor"),background:this.theme("backgroundColor")}),this.svg.render(a),this.emit("render",[B]),B=!0},this.appendDefs=function(a){z.append(a)},this.addBrush=function(a){C.brush.push(a),this.isRender()&&this.render()},this.removeBrush=function(a){C.brush.splice(a,1),this.isRender()&&this.render()},this.updateBrush=function(a,c){b.extend(C.brush[a],c),this.isRender()&&this.render()},this.addWidget=function(a){C.widget.push(a),this.isRender()&&this.render()},this.removeWidget=function(a){C.widget.splice(a,1),this.isRender()&&this.render()},this.updateWidget=function(a,c){b.extend(C.widget[a],c),this.isRender()&&this.render()},this.setTheme=function(a){p(a),this.isRender()&&this.render(!0)},this.setSize=function(a,b){2==arguments.length&&(C.width=a,C.height=b),this.svg.size(C.width,C.height),this.isRender()&&this.render(!0)},this.isFullSize=function(){return"100%"==C.width||"100%"==C.height?!0:!0},this.isRender=function(){return B?C.render:!0}};return g.setup=function(){return{width:"100%",height:"100%",padding:{top:50,bottom:50,left:50,right:50},theme:"jennifer",style:{},series:{},brush:[],widget:[],axis:[],bind:null,format:null,render:!0,icon:{type:"jennifer",path:null}}},g}),jui.define("chart.theme.jennifer",[],function(){var a=["#7977C2","#7BBAE7","#FFC000","#FF7800","#87BB66","#1DA8A0","#929292","#555D69","#0298D5","#FA5559","#F5A397","#06D9B6","#C6A9D9","#6E6AFC","#E3E766","#C57BC3","#DF328B","#96D7EB","#839CB5","#9228E4"];return{backgroundColor:"white",fontSize:"11px",fontColor:"#333333",fontFamily:"arial,Tahoma,verdana",colors:a,gridFontColor:"#333333",gridActiveFontColor:"#ff7800",gridBorderColor:"#ebebeb",gridBorderWidth:1,gridBorderDashArray:"none",gridAxisBorderColor:"#ebebeb",gridAxisBorderWidth:1,gridActiveBorderColor:"#ff7800",gridActiveBorderWidth:1,tooltipPointRadius:5,tooltipPointBorderWidth:1,tooltipPointFontWeight:"bold",barBorderColor:"none",barBorderWidth:0,barBorderOpacity:0,barBorderRadius:3,barPointBorderColor:"white",barDisableBackgroundOpacity:.4,gaugeBackgroundColor:"#ececec",gaugeArrowColor:"#666666",gaugeFontColor:"#666666",gaugeFontSize:"20px",gaugeFontWeight:"bold",gaugeTitleFontSize:"12px",gaugeTitleFontWeight:"normal",gaugeTitleFontColor:"#333",bargaugeBackgroundColor:"#ececec",bargaugeFontSize:"11px",bargaugeFontColor:"#333333",pieBorderColor:"#ececec",pieBorderWidth:1,pieOuterFontSize:"11px",pieOuterLineColor:"#a9a9a9",pieOuterLineSize:8,donutBorderColor:"white",donutBorderWidth:1,areaBackgroundOpacity:.5,areaSplitBackgroundColor:"#929292",bubbleBackgroundOpacity:.5,bubbleBorderWidth:1,candlestickBorderColor:"black",candlestickBackgroundColor:"white",candlestickInvertBorderColor:"red",candlestickInvertBackgroundColor:"red",ohlcBorderColor:"black",ohlcInvertBorderColor:"red",ohlcBorderRadius:5,lineBorderWidth:2,lineDisableBorderOpacity:.3,linePointBorderColor:"white",lineSplitBorderColor:null,lineSplitBorderOpacity:.5,pathBackgroundOpacity:.5,pathBorderWidth:1,scatterBorderColor:"white",scatterBorderWidth:1,scatterHoverColor:"white",waterfallBackgroundColor:"#87BB66",waterfallInvertBackgroundColor:"#FF7800",waterfallEdgeBackgroundColor:"#7BBAE7",waterfallLineColor:"#a9a9a9",waterfallLineDashArray:"0.9",focusBorderColor:"#FF7800",focusBorderWidth:1,focusBackgroundColor:"#FF7800",focusBackgroundOpacity:.1,pinFontColor:"#FF7800",pinFontSize:"10px",pinBorderColor:"#FF7800",pinBorderWidth:.7,topologyNodeRadius:12.5,topologyNodeFontSize:"14px",topologyNodeFontColor:"white",topologyNodeTitleFontSize:"11px",topologyNodeTitleFontColor:"#333",topologyEdgeColor:"#b2b2b2",topologyActiveEdgeColor:"#905ed1",topologyEdgeFontSize:"10px",topologyEdgeFontColor:"#666",topologyEdgePointRadius:3,topologyTooltipBackgroundColor:"white",topologyTooltipBorderColor:"#ccc",topologyTooltipFontSize:"11px",topologyTooltipFontColor:"#333",titleFontColor:"#333",titleFontSize:"13px",titleFontWeight:"normal",legendFontColor:"#333",legendFontSize:"12px",tooltipFontColor:"#333",tooltipFontSize:"12px",tooltipBackgroundColor:"white",tooltipBorderColor:"#aaaaaa",tooltipBackgroundOpacity:.7,scrollBackgroundColor:"#dcdcdc",scrollThumbBackgroundColor:"#b2b2b2",scrollThumbBorderColor:"#9f9fa4",zoomBackgroundColor:"red",zoomFocusColor:"gray",crossBorderColor:"#a9a9a9",crossBorderWidth:1,crossBorderOpacity:.8,crossBalloonFontSize:"11px",crossBalloonFontColor:"white",crossBalloonBackgroundColor:"black",crossBalloonBackgroundOpacity:.5}}),jui.define("chart.theme.gradient",[],function(){var a=["linear(top) #9694e0,0.9 #7977C2","linear(top) #a1d6fc,0.9 #7BBAE7","linear(top) #ffd556,0.9 #ffc000","linear(top) #ff9d46,0.9 #ff7800","linear(top) #9cd37a,0.9 #87bb66","linear(top) #3bb9b2,0.9 #1da8a0","linear(top) #b3b3b3,0.9 #929292","linear(top) #67717f,0.9 #555d69","linear(top) #16b5f6,0.9 #0298d5","linear(top) #ff686c,0.9 #fa5559","linear(top) #fbbbb1,0.9 #f5a397","linear(top) #3aedcf,0.9 #06d9b6","linear(top) #d8c2e7,0.9 #c6a9d9","linear(top) #8a87ff,0.9 #6e6afc","linear(top) #eef18c,0.9 #e3e768","linear(top) #ee52a2,0.9 #df328b","linear(top) #b6e5f4,0.9 #96d7eb","linear(top) #93aec8,0.9 #839cb5","linear(top) #b76fef,0.9 #9228e4"];return{backgroundColor:"white",fontSize:"11px",fontColor:"#666",fontFamily:"arial,Tahoma,verdana",colors:a,gridFontColor:"#666",gridActiveFontColor:"#ff7800",gridBorderColor:"#efefef",gridBorderWidth:1,gridBorderDashArray:"none",gridAxisBorderColor:"#efefef",gridAxisBorderWidth:1,gridActiveBorderColor:"#ff7800",gridActiveBorderWidth:1,tooltipPointRadius:5,tooltipPointBorderWidth:1,tooltipPointFontWeight:"bold",barBorderColor:"none",barBorderWidth:0,barBorderOpacity:0,barBorderRadius:3,barActiveBackgroundColor:"linear(top) #3aedcf,0.9 #06d9b6",barPointBorderColor:"white",barDisableBackgroundOpacity:.4,gaugeBackgroundColor:"#ececec",gaugeArrowColor:"#666666",gaugeFontColor:"#666666",gaugeFontSize:"20px",gaugeFontWeight:"bold",gaugeTitleFontSize:"12px",gaugeTitleFontWeight:"normal",gaugeTitleFontColor:"#333",bargaugeBackgroundColor:"#ececec",bargaugeFontSize:"11px",bargaugeFontColor:"#333333",pieBorderColor:"white",pieBorderWidth:1,pieOuterFontSize:"11px",pieOuterLineColor:"#a9a9a9",pieOuterLineSize:8,donutBorderColor:"white",donutBorderWidth:1,areaBackgroundOpacity:.4,areaSplitBackgroundColor:"linear(top) #b3b3b3,0.9 #929292",bubbleBackgroundOpacity:.5,bubbleBorderWidth:1,candlestickBorderColor:"black",candlestickBackgroundColor:"linear(top) white",candlestickInvertBorderColor:"red",candlestickInvertBackgroundColor:"linear(top) red",ohlcBorderColor:"#14be9d",ohlcInvertBorderColor:"#ff4848",ohlcBorderRadius:5,lineBorderWidth:2,lineDisableBorderOpacity:.3,linePointBorderColor:"white",lineSplitBorderColor:null,lineSplitBorderOpacity:.5,pathBackgroundOpacity:.5,pathBorderWidth:1,scatterBorderColor:"white",scatterBorderWidth:2,scatterHoverColor:"white",waterfallBackgroundColor:"linear(top) #9cd37a,0.9 #87bb66",waterfallInvertBackgroundColor:"linear(top) #ff9d46,0.9 #ff7800",waterfallEdgeBackgroundColor:"linear(top) #a1d6fc,0.9 #7BBAE7",waterfallLineColor:"#a9a9a9",waterfallLineDashArray:"0.9",focusBorderColor:"#FF7800",focusBorderWidth:1,focusBackgroundColor:"#FF7800",focusBackgroundOpacity:.1,pinFontColor:"#FF7800",pinFontSize:"10px",pinBorderColor:"#FF7800",pinBorderWidth:.7,topologyNodeRadius:12.5,topologyNodeFontSize:"14px",topologyNodeFontColor:"white",topologyNodeTitleFontSize:"11px",topologyNodeTitleFontColor:"#333",topologyEdgeColor:"#b2b2b2",topologyActiveEdgeColor:"#905ed1",topologyEdgeFontSize:"10px",topologyEdgeFontColor:"#666",topologyEdgePointRadius:3,topologyTooltipBackgroundColor:"white",topologyTooltipBorderColor:"#ccc",topologyTooltipFontSize:"11px",topologyTooltipFontColor:"#333",titleFontColor:"#333",titleFontSize:"13px",titleFontWeight:"normal",legendFontColor:"#666",legendFontSize:"12px",tooltipFontColor:"#fff",tooltipFontSize:"12px",tooltipBackgroundColor:"black",tooltipBorderColor:"none",tooltipBackgroundOpacity:1,scrollBackgroundColor:"#dcdcdc",scrollThumbBackgroundColor:"#b2b2b2",scrollThumbBorderColor:"#9f9fa4",zoomBackgroundColor:"red",zoomFocusColor:"gray",crossBorderColor:"#a9a9a9",crossBorderWidth:1,crossBorderOpacity:.8,crossBalloonFontSize:"11px",crossBalloonFontColor:"white",crossBalloonBackgroundColor:"black",crossBalloonBackgroundOpacity:.8}}),jui.define("chart.theme.dark",[],function(){var a=["#12f2e8","#26f67c","#e9f819","#b78bf9","#f94590","#8bccf9","#9228e4","#06d9b6","#fc6d65","#f199ff","#c8f21d","#16a6e5","#00ba60","#91f2a1","#fc9765","#f21d4f"];return{backgroundColor:"#222222",fontSize:"12px",fontColor:"#c5c5c5",fontFamily:"arial,Tahoma,verdana",colors:a,gridFontColor:"#868686",gridActiveFontColor:"#ff762d",gridBorderColor:"#464646",gridBorderWidth:1,gridBorderDashArray:"none",gridAxisBorderColor:"#464646",gridAxisBorderWidth:1,gridActiveBorderColor:"#ff7800",gridActiveBorderWidth:1,tooltipPointRadius:5,tooltipPointBorderWidth:1,tooltipPointFontWeight:"bold",barBorderColor:"none",barBorderWidth:0,barBorderOpacity:0,barBorderRadius:3,barActiveBackgroundColor:"#fc6d65",barPointBorderColor:"white",barDisableBackgroundOpacity:.4,gaugeBackgroundColor:"#3e3e3e",gaugeArrowColor:"#a6a6a6",gaugeFontColor:"#c5c5c5",gaugeFontSize:"20px",gaugeFontWeight:"bold",gaugeTitleFontSize:"12px",gaugeTitleFontWeight:"normal",gaugeTitleFontColor:"#c5c5c5",bargaugeBackgroundColor:"#3e3e3e",bargaugeFontSize:"11px",bargaugeFontColor:"#c5c5c5",pieBorderColor:"#232323",pieBorderWidth:1,pieOuterFontSize:"11px",pieOuterLineColor:"#a9a9a9",pieOuterLineSize:8,donutBorderColor:"#232323",donutBorderWidth:1,areaBackgroundOpacity:.5,areaSplitBackgroundColor:"#ebebeb",bubbleBackgroundOpacity:.5,bubbleBorderWidth:1,candlestickBorderColor:"#14be9d",candlestickBackgroundColor:"#14be9d",candlestickInvertBorderColor:"#ff4848",candlestickInvertBackgroundColor:"#ff4848",ohlcBorderColor:"#14be9d",ohlcInvertBorderColor:"#ff4848",ohlcBorderRadius:5,lineBorderWidth:2,lineDisableBorderOpacity:.3,linePointBorderColor:"white",lineSplitBorderColor:null,lineSplitBorderOpacity:.5,pathBackgroundOpacity:.2,pathBorderWidth:1,scatterBorderColor:"none",scatterBorderWidth:1,scatterHoverColor:"#222222",waterfallBackgroundColor:"#26f67c",waterfallInvertBackgroundColor:"#f94590",waterfallEdgeBackgroundColor:"#8bccf9",waterfallLineColor:"#a9a9a9",waterfallLineDashArray:"0.9",focusBorderColor:"#FF7800",focusBorderWidth:1,focusBackgroundColor:"#FF7800",focusBackgroundOpacity:.1,pinFontColor:"#FF7800",pinFontSize:"10px",pinBorderColor:"#FF7800",pinBorderWidth:.7,topologyNodeRadius:12.5,topologyNodeFontSize:"14px",topologyNodeFontColor:"#c5c5c5",topologyNodeTitleFontSize:"11px",topologyNodeTitleFontColor:"#c5c5c5",topologyEdgeColor:"#b2b2b2",topologyActiveEdgeColor:"#905ed1",topologyEdgeFontSize:"10px",topologyEdgeFontColor:"#c5c5c5",topologyEdgePointRadius:3,topologyTooltipBackgroundColor:"#222222",topologyTooltipBorderColor:"#ccc",topologyTooltipFontSize:"11px",topologyTooltipFontColor:"#c5c5c5",titleFontColor:"#ffffff",titleFontSize:"14px",titleFontWeight:"normal",legendFontColor:"#ffffff",legendFontSize:"11px",tooltipFontColor:"#333333",tooltipFontSize:"12px",tooltipBackgroundColor:"white",tooltipBorderColor:"white",tooltipBackgroundOpacity:1,scrollBackgroundColor:"#3e3e3e",scrollThumbBackgroundColor:"#666666",scrollThumbBorderColor:"#686868",zoomBackgroundColor:"red",zoomFocusColor:"gray",crossBorderColor:"#a9a9a9",crossBorderWidth:1,crossBorderOpacity:.8,crossBalloonFontSize:"11px",crossBalloonFontColor:"#333",crossBalloonBackgroundColor:"white",crossBalloonBackgroundOpacity:1}}),jui.define("chart.theme.pastel",[],function(){var a=["#73e9d2","#fef92c","#ff9248","#b7eef6","#08c4e0","#ffb9ce","#ffd4ba","#14be9d","#ebebeb","#666666","#cdbfe3","#bee982","#c22269"];return{backgroundColor:"white",fontSize:"11px",fontColor:"#333333",fontFamily:"Caslon540BT-Regular,Times,New Roman,serif",colors:a,gridFontColor:"#333333",gridActiveFontColor:"#ff7800",gridBorderColor:"#bfbfbf",gridBorderWidth:1,gridBorderDashArray:"1, 3",gridAxisBorderColor:"#bfbfbf",gridAxisBorderWidth:1,gridActiveBorderColor:"#ff7800",gridActiveBorderWidth:1,tooltipPointRadius:5,tooltipPointBorderWidth:1,tooltipPointFontWeight:"bold",barBorderColor:"none",barBorderWidth:0,barBorderOpacity:0,barBorderRadius:3,barActiveBackgroundColor:"#ffb9ce",barPointBorderColor:"#ebebeb",barDisableBackgroundOpacity:.4,gaugeBackgroundColor:"#f5f5f5",gaugeArrowColor:"gray",gaugeFontColor:"#666666",gaugeFontSize:"20px",gaugeFontWeight:"bold",gaugeTitleFontSize:"12px",gaugeTitleFontWeight:"normal",gaugeTitleFontColor:"#333",bargaugeBackgroundColor:"#f5f5f5",bargaugeFontSize:"11px",bargaugeFontColor:"#333333",pieBorderColor:"white",pieBorderWidth:1,pieOuterFontSize:"11px",pieOuterLineColor:"#a9a9a9",pieOuterLineSize:8,donutBorderColor:"white",donutBorderWidth:3,areaBackgroundOpacity:.4,areaSplitBackgroundColor:"#ebebeb",bubbleBackgroundOpacity:.5,bubbleBorderWidth:1,candlestickBorderColor:"#14be9d",candlestickBackgroundColor:"#14be9d",candlestickInvertBorderColor:"#ff4848",candlestickInvertBackgroundColor:"#ff4848",ohlcBorderColor:"#14be9d",ohlcInvertBorderColor:"#ff4848",ohlcBorderRadius:5,lineBorderWidth:2,lineDisableBorderOpacity:.3,linePointBorderColor:"white",lineSplitBorderColor:null,lineSplitBorderOpacity:.5,pathBackgroundOpacity:.5,pathBorderWidth:1,scatterBorderColor:"white",scatterBorderWidth:1,scatterHoverColor:"white",waterfallBackgroundColor:"#73e9d2",waterfallInvertBackgroundColor:"#ffb9ce",waterfallEdgeBackgroundColor:"#08c4e0",waterfallLineColor:"#a9a9a9",waterfallLineDashArray:"0.9",focusBorderColor:"#FF7800",focusBorderWidth:1,focusBackgroundColor:"#FF7800",focusBackgroundOpacity:.1,pinFontColor:"#FF7800",pinFontSize:"10px",pinBorderColor:"#FF7800",pinBorderWidth:.7,topologyNodeRadius:12.5,topologyNodeFontSize:"14px",topologyNodeFontColor:"white",topologyNodeTitleFontSize:"11px",topologyNodeTitleFontColor:"#333",topologyEdgeColor:"#b2b2b2",topologyActiveEdgeColor:"#905ed1",topologyEdgeFontSize:"10px",topologyEdgeFontColor:"#666",topologyEdgePointRadius:3,topologyTooltipBackgroundColor:"white",topologyTooltipBorderColor:"#ccc",topologyTooltipFontSize:"11px",topologyTooltipFontColor:"#333",titleFontColor:"#333",titleFontSize:"18px",titleFontWeight:"normal",legendFontColor:"#333",legendFontSize:"11px",tooltipFontColor:"#fff",tooltipFontSize:"12px",tooltipBackgroundColor:"black",tooltipBorderColor:"black",tooltipBackgroundOpacity:.7,scrollBackgroundColor:"#f5f5f5",scrollThumbBackgroundColor:"#b2b2b2",scrollThumbBorderColor:"#9f9fa4",zoomBackgroundColor:"red",zoomFocusColor:"gray",crossBorderColor:"#a9a9a9",crossBorderWidth:1,crossBorderOpacity:.8,crossBalloonFontSize:"11px",crossBalloonFontColor:"white",crossBalloonBackgroundColor:"black",crossBalloonBackgroundOpacity:.7}}),jui.define("chart.theme.pattern",[],function(){var a=["pattern-jennifer-01","pattern-jennifer-02","pattern-jennifer-03","pattern-jennifer-04","pattern-jennifer-05","pattern-jennifer-06","pattern-jennifer-07","pattern-jennifer-08","pattern-jennifer-09","pattern-jennifer-10","pattern-jennifer-11","pattern-jennifer-12"];return{backgroundColor:"white",fontSize:"11px",fontColor:"#333333",fontFamily:"arial,Tahoma,verdana",colors:a,gridFontColor:"#333333",gridActiveFontColor:"#ff7800",gridBorderColor:"#ebebeb",gridBorderWidth:1,gridBorderDashArray:"none",gridAxisBorderColor:"#ebebeb",gridAxisBorderWidth:1,gridActiveBorderColor:"#ff7800",gridActiveBorderWidth:1,tooltipPointRadius:5,tooltipPointBorderWidth:1,tooltipPointFontWeight:"bold",barBorderColor:"black",barBorderWidth:1,barBorderOpacity:1,barBorderRadius:5,barActiveBackgroundColor:"#06d9b6",barPointBorderColor:"white",barDisableBackgroundOpacity:.4,gaugeBackgroundColor:"#ececec",gaugeArrowColor:"#666666",gaugeFontColor:"#666666",gaugeFontSize:"20px",gaugeFontWeight:"bold",gaugeTitleFontSize:"12px",gaugeTitleFontWeight:"normal",gaugeTitleFontColor:"#333",pieBorderColor:"white",bargaugeBackgroundColor:"#ececec",bargaugeFontSize:"11px",bargaugeFontColor:"#333333",pieBorderWidth:1,pieOuterFontSize:"11px",pieOuterLineColor:"#a9a9a9",pieOuterLineSize:8,donutBorderColor:"white",donutBorderWidth:1,areaBackgroundOpacity:.5,areaSplitBackgroundColor:"#929292",bubbleBackgroundOpacity:.5,bubbleBorderWidth:1,candlestickBorderColor:"black",candlestickBackgroundColor:"white",candlestickInvertBorderColor:"red",candlestickInvertBackgroundColor:"red",ohlcBorderColor:"black",ohlcInvertBorderColor:"red",ohlcBorderRadius:5,lineBorderWidth:2,lineDisableBorderOpacity:.3,linePointBorderColor:"white",lineSplitBorderColor:null,lineSplitBorderOpacity:.5,pathBackgroundOpacity:.5,pathBorderWidth:1,scatterBorderColor:"white",scatterBorderWidth:1,scatterHoverColor:"white",waterfallBackgroundColor:"#87BB66",waterfallInvertBackgroundColor:"#FF7800",waterfallEdgeBackgroundColor:"#7BBAE7",waterfallLineColor:"#a9a9a9",waterfallLineDashArray:"0.9",focusBorderColor:"#FF7800",focusBorderWidth:1,focusBackgroundColor:"#FF7800",focusBackgroundOpacity:.1,pinFontColor:"#FF7800",pinFontSize:"10px",pinBorderColor:"#FF7800",pinBorderWidth:.7,topologyNodeRadius:12.5,topologyNodeFontSize:"14px",topologyNodeFontColor:"white",topologyNodeTitleFontSize:"11px",topologyNodeTitleFontColor:"#333",topologyEdgeColor:"#b2b2b2",topologyActiveEdgeColor:"#905ed1",topologyEdgeFontSize:"10px",topologyEdgeFontColor:"#666",topologyEdgePointRadius:3,topologyTooltipBackgroundColor:"white",topologyTooltipBorderColor:"#ccc",topologyTooltipFontSize:"11px",topologyTooltipFontColor:"#333",titleFontColor:"#333",titleFontSize:"13px",titleFontWeight:"normal",legendFontColor:"#333",legendFontSize:"12px",tooltipFontColor:"#333",tooltipFontSize:"12px",tooltipBackgroundColor:"white",tooltipBorderColor:"#aaaaaa",tooltipBackgroundOpacity:.7,scrollBackgroundColor:"#dcdcdc",scrollThumbBackgroundColor:"#b2b2b2",scrollThumbBorderColor:"#9f9fa4",zoomBackgroundColor:"red",zoomFocusColor:"gray",crossBorderColor:"#a9a9a9",crossBorderWidth:1,crossBorderOpacity:.8,crossBalloonFontSize:"11px",crossBalloonFontColor:"white",crossBalloonBackgroundColor:"black",crossBalloonBackgroundOpacity:.5}}),jui.define("chart.pattern.white",["util.svg"],function(){function a(a,b){b=parseInt(b||1);var c={type:"pattern",attr:{id:"pattern-white-circle"+a,x:10,y:10,width:10,height:10,patternUnits:"userSpaceOnUse"},children:[{type:"rect",attr:{width:10,height:10,fill:"#ffffff"}},{type:"circle",attr:{cx:b,cy:b,r:b,fill:"#000000"}}]};return c}return{circle:{type:"pattern",attr:{id:"pattern-white-circle",width:15,height:15,patternUnits:"userSpaceOnUse"},children:[{type:"rect",attr:{width:50,height:50,fill:"#282828"}},{type:"circle",attr:{cx:3,cy:4.3,r:1.8,fill:"#393939"}},{type:"circle",attr:{cx:3,cy:3,r:1.8,fill:"black"}},{type:"circle",attr:{cx:10.5,cy:12.5,r:1.8,fill:"#393939"}},{type:"circle",attr:{cx:10.5,cy:11.3,r:1.8,fill:"black"}}]},rect:{type:"pattern",attr:{id:"pattern-white-rect",width:20,height:20,patternUnits:"userSpaceOnUse"},children:[{type:"rect",attr:{width:20,height:20,fill:"#00a9f1"}},{type:"rect",attr:{width:20,height:10,fill:"#26baf4"}}]},circle1:function(){return a.call(this,1,1)},circle2:function(){return a.call(this,2,1.5)},circle3:function(){return a.call(this,3,2)},circle4:function(){return a.call(this,4,2.5)},circle5:function(){return a.call(this,5,3)},circle6:function(){return a.call(this,6,3.5)},circle7:function(){return a.call(this,7,4)},circle8:function(){return a.call(this,8,4.5)},rect1:{type:"pattern",attr:{id:"pattern-white-rect1",width:70,height:70,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3MCIgaGVpZ2h0PSI3MCI+CjxyZWN0IHdpZHRoPSI3MCIgaGVpZ2h0PSI3MCIgZmlsbD0iI2JiZDgxNyI+PC9yZWN0Pgo8ZyB0cmFuc2Zvcm09InJvdGF0ZSg0NSkiPgo8cmVjdCB3aWR0aD0iOTkiIGhlaWdodD0iMjUiIGZpbGw9IiNhOWNlMDAiPjwvcmVjdD4KPHJlY3QgeT0iLTUwIiB3aWR0aD0iOTkiIGhlaWdodD0iMjUiIGZpbGw9IiNhOWNlMDAiPjwvcmVjdD4KPC9nPgo8L3N2Zz4=",width:70,height:70}}]},rect2:{type:"pattern",attr:{id:"pattern-white-rect2",width:56,height:100,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},children:[{type:"image",attr:{"xlink:href":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NiIgaGVpZ2h0PSIxMDAiPgo8cmVjdCB3aWR0aD0iNTYiIGhlaWdodD0iMTAwIiBmaWxsPSIjZjhkMjAzIj48L3JlY3Q+CjxwYXRoIGQ9Ik0yOCA2NkwwIDUwTDAgMTZMMjggMEw1NiAxNkw1NiA1MEwyOCA2NkwyOCAxMDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZjYyOSIgc3Ryb2tlLXdpZHRoPSIyIj48L3BhdGg+CjxwYXRoIGQ9Ik0yOCAwTDI4IDM0TDAgNTBMMCA4NEwyOCAxMDBMNTYgODRMNTYgNTBMMjggMzQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZTUwMyIgc3Ryb2tlLXdpZHRoPSIyIj48L3BhdGg+Cjwvc3ZnPg==",width:56,height:100}}]},rect3:{type:"pattern",attr:{id:"pattern-white-rect3",width:10,height:10,patternUnits:"userSpaceOnUse",patternTransform:"scale(2)"},children:[{type:"rect",attr:{width:10,height:10,fill:"#ffffff",stroke:"#000000","stroke-width":.5}}]},rect4:{type:"pattern",attr:{id:"pattern-white-rect4",width:10,height:10,patternUnits:"userSpaceOnUse",patternTransform:"skewX(45)"},children:[{type:"rect",attr:{width:10,height:10,fill:"#ffffff",stroke:"#000000","stroke-width":.5}}]}}}),jui.define("chart.pattern.jennifer",[],function(){return{10:{type:"pattern",attr:{id:"pattern-jennifer-10",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABZJREFUCNdjEBRg6GhgcHFgUFLAxQYAaTkFzlvDQuIAAAAASUVORK5CYII=",width:12,height:12}}]},11:{type:"pattern",attr:{id:"pattern-jennifer-11",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABJJREFUCNdjMDZgOHOAAQxwsQF00wXOMquS/QAAAABJRU5ErkJggg==",width:12,height:12}}]},12:{type:"pattern",attr:{id:"pattern-jennifer-12",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABBJREFUCNdj+P8BioAABxsAU88RaA20zg0AAAAASUVORK5CYII=",width:12,height:12}}]},"01":{type:"pattern",attr:{id:"pattern-jennifer-01",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABVJREFUCNdjKC9g+P+B4e4FIImLDQBPxxNXosybYgAAAABJRU5ErkJggg==",width:12,height:12}}]},"02":{type:"pattern",attr:{id:"pattern-jennifer-02",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABNJREFUCNdj6GhgAAIlBSCBiw0AUpID3xszyekAAAAASUVORK5CYII=",width:12,height:12}}]},"03":{type:"pattern",attr:{id:"pattern-jennifer-03",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAAA9JREFUCNdj+P+BAQzwMACirge9PFNsFQAAAABJRU5ErkJggg==",width:12,height:12}}]},"04":{type:"pattern",attr:{id:"pattern-jennifer-04",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAgMAAAArG7R0AAAACVBMVEUAAAAaGRkWFhUIIaslAAAAAXRSTlMAQObYZgAAACFJREFUCNdj6HBpYQABjw4wDeS7QPgtENrFxQNCe3SAKAC36AapdMh8ewAAAABJRU5ErkJggg==",width:12,height:12}}]},"05":{type:"pattern",attr:{id:"pattern-jennifer-05",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAALCwvdFFZtAAAAAXRSTlMAQObYZgAAAA1JREFUCNdjWLWAIAIAFt8Ped1+QPcAAAAASUVORK5CYII=",width:12,height:12}}]},"06":{type:"pattern",attr:{id:"pattern-jennifer-06",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAALCwvdFFZtAAAAAXRSTlMAQObYZgAAAA9JREFUCNdj+P+BAQjwkgDijAubMqjSSAAAAABJRU5ErkJggg==",width:12,height:12}}]},"07":{type:"pattern",attr:{id:"pattern-jennifer-07",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAgMAAAArG7R0AAAACVBMVEUAAAAAAAAMDAwvehODAAAAAXRSTlMAQObYZgAAAA5JREFUCNdjmDJlCikYAPO/FNGPw+TMAAAAAElFTkSuQmCC",width:12,height:12}}]},"08":{type:"pattern",attr:{id:"pattern-jennifer-08",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABZJREFUCNdjKC9gePeA4e4Fht0bcLEBM1MRaPwhp7AAAAAASUVORK5CYII=",width:12,height:12}}]},"09":{type:"pattern",attr:{id:"pattern-jennifer-09",width:12,height:12,patternUnits:"userSpaceOnUse"},children:[{type:"image",attr:{"xlink:href":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABZJREFUCNdjePeAobyAYfcGhrsXcLEBOSARaPIjMTsAAAAASUVORK5CYII=",width:12,height:12}}]}}}),jui.define("chart.icon.jennifer",[],function(){return{menu:"","report-build":"","jennifer-server":"",user:"",rule:"",profile:"",monitoring:"",device:"",caution2:"",tool:"","report-link":"",was:"",ws:"",server:"",db:"",minus:"",label:"",checkmark:"",stoppage:"","align-right":"",caution:"","return":"",loading:"",plus:"",pause:"",play:"",resize:"",right:"",left:"",bold:"",chart:"",document:"",link:"",more:"",arrow3:"",arrow1:"",arrow2:"",textcolor:"",text:"",refresh:"","chevron-right":"","chevron-left":"","align-center":"","align-left":"",preview:"",close:"",exit:"",image:"",dashboardlist:"","add-dir":"","add-dir2":"",calendar:"",check:"",download:"",edit:"",gear:"",help:"",hide:"",home:"",html:"",italic:"","new-window":"",orderedlist:"",printer:"",realtime:"",refresh2:"",save:"",search:"",stop:"",table:"",trashcan:"",underline:"",unorderedlist:"",upload:""}}),jui.define("chart.grid.core",["jquery","util.base","util.math"],function(a,b,c){var d=function(){this.drawAfter=function(a){a.root.attr({"class":"grid grid-"+this.grid.type})},this.wrapper=function(a){return a},this.axisLine=function(b){return this.chart.svg.line(a.extend({x1:0,y1:0,x2:0,y2:0,stroke:this.color("gridAxisBorderColor"),"stroke-width":this.chart.theme("gridAxisBorderWidth"),"stroke-opacity":1},b))},this.line=function(b){return this.chart.svg.line(a.extend({x1:0,y1:0,x2:0,y2:0,stroke:this.color("gridBorderColor"),"stroke-width":this.chart.theme("gridBorderWidth"),"stroke-dasharray":this.chart.theme("gridBorderDashArray"),"stroke-opacity":1},b))},this.color=function(a){return 3==arguments.length?this.grid.color?this.chart.color(0,{colors:[this.grid.color]}):this.chart.theme.apply(this.chart,arguments):this.grid.color?this.chart.color(0,{colors:[this.grid.color]}):this.chart.theme(a)},this.data=function(a,b){return this.axis.data&&this.axis.data[a]?this.axis.data[a][b]||this.axis.data[a]:this.axis.data||[]},this.drawGrid=function(){var a=this.chart.svg.group(),c=this[this.grid.orient];return b.typeCheck("function",c)&&c.call(this,a),this.scale=this.wrapper(this.scale,this.grid.key),this.grid.hide&&a.attr({display:"none"}),{root:a,scale:this.scale}},this.getTextRotate=function(a){var c=this.grid.textRotate;if(null==c)return a;b.typeCheck("function",c)&&(c=c.apply(this.chart,[a]));var d=a.attr("x"),e=a.attr("y");return a.rotate(c,d,e),a},this.getGridSize=function(){var a=this.grid.orient,b=this.axis.area(),d=b.width,e=b.height,f="left"==a||"right"==a?b.y:b.x,g="left"==a||"right"==a?e:d,h=this.axis.get("depth"),i=this.axis.get("angle"),j=f,k=g,l=j+k,m={start:j,size:k,end:l};if(h>0||i>0){var n=c.radian(360-i),o=Math.cos(n)*h,p=Math.sin(n)*h;"left"==a?(m.start=m.start-p,m.size=m.size-p):"bottom"==a&&(m.end=m.end-o,m.size=m.size-o)}return m}};return d.setup=function(){return{extend:null,dist:0,orient:null,hide:!1,color:null,title:null,line:!1,baseline:!0,format:null,textRotate:null}},d},"chart.draw"),jui.define("chart.grid.block",["util.scale","util.base"],function(a,b){var c=function(){this.top=function(a){var b=this.axis.area("height");this.grid.line||a.append(this.axisLine({x1:this.start,x2:this.end}));for(var c=0;c<this.points.length;c++){var d=this.format(this.domain[c],c);if(d||0===d){var e=this.chart.svg.group({transform:"translate("+this.points[c]+", 0)"});e.append(this.line(this.chart,{x1:-this.half_band,y1:0,x2:-this.half_band,y2:this.grid.line?b:this.bar})),e.append(this.getTextRotate(this.chart.text({x:0,y:-20,"text-anchor":"middle"},d))),a.append(e)}}if(!this.grid.full){var e=this.chart.svg.group({transform:"translate("+this.end+", 0)"});e.append(this.line({y2:this.grid.line?b:this.bar})),a.append(e)}},this.bottom=function(a){var b=this.axis.area("height");this.grid.line||a.append(this.axisLine({x1:this.start,x2:this.end}));for(var c=0,d=this.points.length;d>c;c++){var e=this.format(this.domain[c],c);if(e||0===e){var f=this.chart.svg.group({transform:"translate("+this.points[c]+", 0)"});f.append(this.line({x1:-this.half_band,y1:0,x2:-this.half_band,y2:this.grid.line?-b:this.bar})),f.append(this.getTextRotate(this.chart.text({x:0,y:20,"text-anchor":"middle"},e))),a.append(f)}}if(!this.grid.full){var f=this.chart.svg.group({transform:"translate("+this.end+", 0)"});f.append(this.line({y2:this.grid.line?-b:this.bar})),a.append(f)}},this.left=function(a){var b=this.axis.area("width");this.grid.line||a.append(this.axisLine({y1:this.start,y2:this.end}));for(var c=0;c<this.points.length;c++){var d=this.format(this.domain[c],c);if(d||0===d){var e=this.chart.svg.group({transform:"translate(0, "+(this.points[c]-this.half_band)+")"});e.append(this.line({x2:this.grid.line?b:-this.bar})),e.append(this.getTextRotate(this.chart.text({x:-this.bar-4,y:this.half_band,"text-anchor":"end"},d))),a.append(e)}}if(!this.grid.full){var e=this.chart.svg.group({transform:"translate(0, "+this.end+")"});e.append(this.line({x2:this.grid.line?this.axis.area("width"):-this.bar})),a.append(e)}},this.right=function(a){this.grid.line||a.append(this.axisLine({y1:this.start,y2:this.end}));
for(var b=0,c=this.points.length;c>b;b++){var d=this.format(this.domain[b],b);if(d||0===d){var e=this.chart.svg.group({transform:"translate(0, "+(this.points[b]-this.half_band)+")"});e.append(this.line({x2:this.grid.line?-this.axis.area("width"):this.bar})),e.append(this.getTextRotate(this.chart.text({x:this.bar+4,y:this.half_band,"text-anchor":"start"},d))),a.append(e)}}if(!this.grid.full){var e=this.chart.svg.group({transform:"translate(0, "+this.end+")"});e.append(this.line({x2:this.grid.line?-this.axis.area("width"):this.bar})),a.append(e)}},this.initDomain=function(){var a=[];if(b.typeCheck("string",this.grid.domain)){var c=this.grid.domain,d=this.data();if(this.grid.reverse)var e=d.length-1,f=0,g=-1;else var e=0,f=d.length-1,g=1;for(var h=e;this.grid.reverse?h>=f:f>=h;h+=g)a.push(d[h][c])}else a=b.typeCheck("function",this.grid.domain)?this.grid.domain.call(this.chart):this.grid.domain;return this.grid.reverse&&a.reverse(),a},this.drawBefore=function(){var b=this.initDomain(),c=this.getGridSize();this.scale=a.ordinal().domain(b);var d=[c.start,c.end];this.grid.full?this.scale.rangeBands(d):this.scale.rangePoints(d),this.start=c.start,this.size=c.size,this.end=c.end,this.points=this.scale.range(),this.domain=this.scale.domain(),this.band=this.scale.rangeBand(),this.half_band=this.grid.full?0:this.band/2,this.bar=6,this.reverse=this.grid.reverse},this.draw=function(){return this.drawGrid("block")}};return c.setup=function(){return{domain:null,reverse:!1,max:10,full:!1}},c},"chart.grid.core"),jui.define("chart.grid.date",["util.time","util.scale","util.base"],function(a,b,c){var d=function(){this.top=function(a){this.grid.line||a.append(this.axisLine({x1:this.start,x2:this.end}));for(var b=this.ticks,c=this.values,d=this.bar,e=0,f=b.length;f>e;e++){var g=this.format(b[e],e);if(g||0===g){var h=this.chart.svg.group({transform:"translate("+c[e]+", 0)"});h.append(this.line({y2:this.grid.line?this.axis.area("height"):-d})),h.append(this.getTextRotate(this.chart.text({x:0,y:-d-4,"text-anchor":"middle",fill:this.chart.theme("gridFontColor")},g))),a.append(h)}}},this.bottom=function(a){this.grid.line||a.append(this.axisLine({x1:this.start,x2:this.end}));for(var b=this.ticks,c=this.values,d=this.bar,e=0,f=b.length;f>e;e++){var g=this.format(b[e],e);if(g||0===g){var h=this.chart.svg.group({transform:"translate("+c[e]+", 0)"});h.append(this.line({y2:this.grid.line?-this.axis.area("height"):d})),h.append(this.getTextRotate(this.chart.text({x:0,y:3*d,"text-anchor":"middle",fill:this.chart.theme("gridFontColor")},g))),a.append(h)}}},this.left=function(a){this.grid.line||a.append(this.axisLine({y1:this.start,y2:this.end}));for(var b=this.ticks,c=this.values,d=this.bar,e=0,f=b.length;f>e;e++){var g=this.format(b[e],e);if(g||0===g){var h=this.chart.svg.group({transform:"translate(0,"+c[e]+")"});h.append(this.line({x2:this.grid.line?this.axis.area("width"):-d})),h.append(this.getTextRotate(this.chart.text({x:-d-2,y:d-2,"text-anchor":"end",fill:this.chart.theme("gridFontColor")},g))),a.append(h)}}},this.right=function(a){this.grid.line||a.append(this.axisLine({y1:this.start,y2:this.end}));for(var b=this.ticks,c=this.values,d=this.bar,e=0,f=b.length;f>e;e++){var g=this.format(b[e],e);if(g||0===g){var h=this.chart.svg.group({transform:"translate(0,"+c[e]+")"});h.append(this.line({x2:this.grid.line?-this.axis.area("width"):d})),h.append(this.getTextRotate(this.chart.text({x:d+4,y:-d,"text-anchor":"start",fill:this.chart.theme("gridFontColor")},g))),a.append(h)}}},this.wrapper=function(a,b){function c(a){return d("number"==typeof a?e.axis.data[a][b]:+a)}var d=a,e=this;return b?$.extend(c,d):d},this.initDomain=function(){var a=[],b=[],d=this.grid.min||void 0,e=this.grid.max||void 0,f=this.data(),g=[];if(c.typeCheck("string",this.grid.domain)){if(f.length>0){var h=this.grid.domain;g.push(+f[0][h]),g.push(+f[f.length-1][h])}}else if(c.typeCheck("function",this.grid.domain))for(var i=f.length;i--;){var j=this.grid.domain.call(this.chart,f[i]);c.typeCheck("array",j)?(g[i]=Math.max.apply(Math,j),g.push(Math.min.apply(Math,j))):g[i]=j}else g=this.grid.domain;return c.typeCheck("undefined",d)&&g.length>0&&(d=Math.min.apply(Math,g)),c.typeCheck("undefined",e)&&g.length>0&&(e=Math.max.apply(Math,g)),this.grid.max=e,this.grid.min=d,a=[this.grid.min,this.grid.max],b=this.grid.step,this.grid.reverse&&a.reverse(),c.typeCheck("function",b)&&(this.grid.step=b.call(this.chart,a)),a},this.drawBefore=function(){var c=this.initDomain(),d=this.getGridSize(),e=[d.start,d.end];this.scale=b.time().domain(c).range(e),this.ticks=this.grid.realtime?this.scale.realTicks(this.grid.step[0],this.grid.step[1]):this.scale.ticks(this.grid.step[0],this.grid.step[1]),0==this.axis.data.length&&(this.ticks=[]),"string"==typeof this.grid.format&&!function(b,c){b.format=function(b){return a.format(b,c)}}(this.grid,this.grid.format),this.start=d.start,this.size=d.size,this.end=d.end,this.bar=6,this.values=[];for(var f=0,g=this.ticks.length;g>f;f++)this.values[f]=this.scale(this.ticks[f])},this.draw=function(){return this.drawGrid("date")}};return d.setup=function(){return{domain:null,step:[],min:null,max:null,reverse:!1,key:null,realtime:!1}},d},"chart.grid.core"),jui.define("chart.grid.dateblock",["util.time","util.scale","util.base"],function(a,b,c){var d=function(){this.wrapper=function(a){var b=a,c=this;return b.rangeBand=function(){return c.grid.unit},b},this.initDomain=function(){var a=this.grid.min||void 0,b=this.grid.max||void 0,d=this.data(),e=[];if(c.typeCheck("string",this.grid.domain)){var f=this.grid.domain;e.push(+d[0][f]),e.push(+d[d.length-1][f])}else if(c.typeCheck("function",this.grid.domain))for(var g=d.length;g--;){var h=this.grid.domain.call(this.chart,d[g]);c.typeCheck("array",h)?(e[g]=+Math.max.apply(Math,h),e.push(+Math.min.apply(Math,h))):e[g]=+h}else e=this.grid.domain;c.typeCheck("undefined",a)&&(a=Math.min.apply(Math,e)),c.typeCheck("undefined",b)&&(b=Math.max.apply(Math,e)),this.grid.max=b,this.grid.min=a;var i=[this.grid.min,this.grid.max];return c.typeCheck("function",this.grid.step)&&(this.grid.step=step.call(this.chart,i)),this.grid.reverse&&i.reverse(),i},this.drawBefore=function(){var c=this,d=this.initDomain(),e=this.getGridSize(),f=[e.start,e.end],g=b.time().domain(d).rangeRound(f),h=this.axis.data.length,i=this.grid.unit=Math.abs(f[0]-f[1])/(this.grid.full?h-1:h),j=i/2;this.ticks=this.grid.realtime?g.realTicks(this.grid.step[0],this.grid.step[1]):g.ticks(this.grid.step[0],this.grid.step[1]),"string"==typeof this.grid.format&&!function(b,c){b.format=function(b){return a.format(b,c)}}(this.grid,this.grid.format),this.start=e.start,this.size=e.size,this.end=e.end,this.bar=6,this.values=[];for(var k=0,h=this.ticks.length;h>k;k++)this.values[k]=g(this.ticks[k]);this.scale=$.extend(function(a){return a*i+(c.grid.full?0:j)},g)},this.draw=function(){return this.drawGrid("dateblock")}};return d.setup=function(){return{full:!0}},d},"chart.grid.date"),jui.define("chart.grid.radar",["util.math","util.base"],function(a,b){var c=function(){function c(a,b,c,d,e){var g=Math.abs(e),h=b,i=c;a.append(f.chart.svg.circle({cx:h,cy:i,r:g,"fill-opacity":0,stroke:f.color("gridAxisBorderColor"),"stroke-width":f.chart.theme("gridBorderWidth")}))}function d(b,c,d,e,g,h,i){var j=f.chart.svg.group(),k=[];k.push([c+e,d+g]);for(var l=e,m=g,n=0;h>n;n++){var o=a.rotate(l,m,i);l=o.x,m=o.y,k.push([c+o.x,d+o.y])}for(var p=f.chart.svg.path({fill:"none",stroke:f.color("gridAxisBorderColor"),"stroke-width":f.chart.theme("gridBorderWidth")}),n=0;n<k.length;n++){var q=k[n];0==n?p.MoveTo(q[0],q[1]):p.LineTo(q[0],q[1])}p.LineTo(k[0][0],k[0][1]),j.append(p),b.append(j)}function e(b){var c=f.grid.max,d=f.chart.padding("left"),e=f.chart.padding("top");return function(g,h){var i=h/c,j=Math.abs(b.y1)-Math.abs(b.y2),k=j*i,l=2*Math.PI/f.domain.length,m=b.x1,n=b.y1,o=-k,p=0,q=a.rotate(p,o,l*g),r={x:d+m+q.x,y:e+n+q.y};return r}}var f=this,g=[];this.initDomain=function(){var a=[];if(b.typeCheck("string",this.grid.domain)){var c=this.grid.domain,d=this.data();if(this.grid.reverse)var e=d.length-1,f=0,g=-1;else var e=0,f=d.length-1,g=1;for(var h=e;this.grid.reverse?h>=f:f>=h;h+=g)a.push(d[h][c])}else a=b.typeCheck("function",this.grid.domain)?this.grid.domain(this.chart,this.grid):this.grid.domain;return this.grid.reverse&&a.reverse(),a},this.drawBefore=function(){this.domain=this.initDomain()},this.draw=function(){var b=this.axis.area("width"),f=this.axis.area("height"),h=b;h>f&&(h=f);var i=h/2,j=this.axis.area("x")+b/2,k=this.axis.area("y")+f/2,l=-i,m=0,n=this.domain.length,o=this.grid.step,p=2*Math.PI/n,q=Math.abs(l)/o,r=this.chart.svg.group(),s=this.chart.svg.group();r.append(s),g=[];for(var t=0;n>t;t++){var u=j+m,v=k+l;s.append(this.chart.svg.line({x1:j,y1:k,x2:u,y2:v,stroke:this.color("gridAxisBorderColor"),"stroke-width":this.chart.theme("gridBorderWidth")})),g[t]={x1:j,y1:k,x2:u,y2:v};var w=v,x=u,y="middle";v>k?w=v+20:k>v&&(w=v-10),u>j?(y="start",x+=10):j>u&&(y="end",x-=10),this.grid.hideText||s.append(this.chart.text({x:x,y:w,"text-anchor":y,fill:this.chart.theme("gridFontColor")},this.domain[t]));var z=a.rotate(m,l,p);m=z.x,l=z.y}if(!this.grid.line)return{root:s,scale:e(g[0])};l=-i;for(var A=0,B=this.grid.max/this.grid.step,t=0;o>t;t++)0==t&&this.grid.extra?l+=q:("circle"==this.grid.shape?c(s,j,k,0,l,n):d(s,j,k,0,l,n,p),this.grid.hideText||s.append(this.chart.text({x:j,y:k+(l+q-5),fill:this.chart.theme("gridFontColor")},this.grid.max-A+"")),l+=q,A+=B);return this.grid.hide&&s.attr({display:"none"}),{root:s,scale:e(g[0])}}};return c.setup=function(){return{domain:null,reverse:!1,max:100,step:10,line:!0,hideText:!1,extra:!1,shape:"radial"}},c},"chart.grid.core"),jui.define("chart.grid.range",["util.scale","util.base"],function(a,b){var c=function(){this.top=function(a){this.grid.line||a.append(this.axisLine({x2:this.size}));for(var b=this.scale.min(),c=this.ticks,d=this.values,e=this.bar,f=0,g=c.length;g>f;f++){var h=this.format(c[f],f);if(h||0===h){var i=0==c[f]&&c[f]!=b,j=this.chart.svg.group({transform:"translate("+d[f]+", 0)"});j.append(this.line({y2:this.grid.line?this.axis.area("height"):-e,stroke:this.color(i,"gridActiveBorderColor","gridAxisBorderColor"),"stroke-width":this.chart.theme(i,"gridActiveBorderWidth","gridBorderWidth")})),j.append(this.getTextRotate(this.chart.text({x:0,y:-e-4,"text-anchor":"middle",fill:this.chart.theme(i,"gridActiveFontColor","gridFontColor")},h))),a.append(j)}}},this.bottom=function(a){this.grid.line||a.append(this.axisLine({x1:this.start,x2:this.end}));for(var b=this.scale.min(),c=this.ticks,d=this.values,e=this.bar,f=0;f<c.length;f++){var g=this.format(c[f],f);if(g||0===g){var h=0==c[f]&&c[f]!=b,i=this.chart.svg.group({transform:"translate("+d[f]+", 0)"});i.append(this.line({y2:this.grid.line?-this.axis.area("height"):e,stroke:this.color(h,"gridActiveBorderColor","gridAxisBorderColor"),"stroke-width":this.chart.theme(h,"gridActiveBorderWidth","gridBorderWidth")})),i.append(this.getTextRotate(this.chart.text({x:0,y:3*e,"text-anchor":"middle",fill:this.chart.theme(h,"gridActiveFontColor","gridFontColor")},g))),a.append(i)}}},this.left=function(a){this.grid.line||a.append(this.axisLine({y1:this.start,y2:this.end}));for(var b=this.scale.min(),c=this.ticks,d=this.values,e=this.bar,f=this.color("gridActiveBorderColor"),g=this.color("gridBorderColor"),h=0;h<c.length;h++){var i=this.format(c[h],h);if(i||0===i){var j=0==c[h]&&c[h]!=b,k=this.chart.svg.group({transform:"translate(0, "+d[h]+")"});k.append(this.line({x2:this.grid.line?this.axis.area("width"):-e,stroke:j?f:g,"stroke-width":this.chart.theme(j,"gridActiveBorderWidth","gridBorderWidth")})),this.grid.hideText||k.append(this.getTextRotate(this.chart.text({x:-e-4,y:e,"text-anchor":"end",fill:this.chart.theme(j,"gridActiveFontColor","gridFontColor")},i))),a.append(k)}}},this.right=function(a){this.grid.line||a.append(this.axisLine({y1:this.start,y2:this.end}));for(var b=this.scale.min(),c=this.ticks,d=this.values,e=this.bar,f=0;f<c.length;f++){var g=this.format(c[f],f);if(g||0===g){var h=0==c[f]&&c[f]!=b,i=this.chart.svg.group({transform:"translate(0, "+d[f]+")"});i.append(this.line({x2:this.grid.line?-this.axis.area("width"):e,stroke:this.color(h,"gridActiveBorderColor","gridAxisBorderColor"),"stroke-width":this.chart.theme(h,"gridActiveBorderWidth","gridBorderWidth")})),i.append(this.getTextRotate(this.chart.text({x:e+4,y:e,"text-anchor":"start",fill:this.chart.theme(h,"gridActiveFontColor","gridFontColor")},g))),a.append(i)}}},this.wrapper=function(a,b){function c(a){return d(e.axis.data[a][b])}var d=a,e=this;return b?$.extend(c,d):d},this.initDomain=function(){var a=[],c=this.grid.min||void 0,d=this.grid.max||void 0,e=this.data(),f=[],g=!1;if(b.typeCheck("string",this.grid.domain)){var h=this.grid.domain;f=new Array(e.length);for(var i=e.length;i--;){var j=e[i][h];b.typeCheck("array",j)?(f[i]=Math.max(j),f.push(Math.min(j))):(f[i]=j,f.push(0))}}else if(b.typeCheck("function",this.grid.domain)){f=new Array(e.length);for(var k=!1,i=e.length;i--;){var j=this.grid.domain.call(this.chart,e[i]);b.typeCheck("array",j)?(f[i]=Math.max.apply(Math,j),f.push(Math.min.apply(Math,j))):(f[i]=j,k||(f.push(0),k=!0))}}else f=this.grid.domain,g=!0;var l=Math.min.apply(Math,f),m=Math.max.apply(Math,f);g?(c=l,d=m):(("undefined"==typeof c||c>l)&&(c=l),("undefined"==typeof d||m>d)&&(d=m)),this.grid.max=d,this.grid.min=c;var n;if(n=b.typeCheck("function",this.grid.unit)?this.grid.unit.call(this.chart,this.grid):b.typeCheck("number",this.grid.unit)?this.grid.unit:Math.ceil((d-c)/this.grid.step),0==n)a=[0,0];else{for(var o=0;d>o;)o+=n;for(var p=o;p>c;)p-=n;a=[p,o],this.grid.step=Math.abs(p-o)/n}return this.grid.reverse&&a.reverse(),a},this.drawBefore=function(){var b=this.initDomain(),c=this.getGridSize();if(this.scale=a.linear().domain(b),"left"==this.grid.orient||"right"==this.grid.orient)var d=[c.end,c.start];else var d=[c.start,c.end];this.scale.range(d),this.scale.clamp(this.grid.clamp),this.start=c.start,this.size=c.size,this.end=c.end,this.step=this.grid.step,this.nice=this.grid.nice,this.ticks=this.scale.ticks(this.step,this.nice),this.bar=6,this.values=[];for(var e=0,f=this.ticks.length;f>e;e++)this.values[e]=this.scale(this.ticks[e])},this.draw=function(){return this.drawGrid("range")}};return c.setup=function(){return{domain:null,step:10,min:0,max:0,unit:null,clamp:!0,reverse:!1,key:null,hideText:!1,nice:!1}},c},"chart.grid.core"),jui.define("chart.grid.rule",["util.scale","util.base"],function(a,b){var c=function(){this.top=function(a){var b=this.axis.area("height"),c=b/2;a.append(this.axisLine({y1:this.center?c:0,y2:this.center?c:0,x1:this.start,x2:this.end}));for(var d=this.ticks,e=this.values,f=this.bar,g=0;g<d.length;g++){var h=this.format(d[g],g);if(h||0===h){var i=0==d[g],j=this.chart.svg.group().translate(e[g],this.center?c:0);j.append(this.line({y1:this.center?-f:0,y2:f,stroke:this.color("gridAxisBorderColor"),"stroke-width":this.chart.theme("gridBorderWidth")})),(!i||i&&!this.hideZero)&&j.append(this.getTextRotate(this.chart.text({x:0,y:f+f+4,"text-anchor":"middle",fill:this.chart.theme("gridFontColor")},h))),a.append(j)}}},this.bottom=function(a){var b=this.axis.area("height"),c=b/2;a.append(this.axisLine({y1:this.center?-c:0,y2:this.center?-c:0,x1:this.start,x2:this.end}));for(var d=this.ticks,e=this.values,f=this.bar,g=0;g<d.length;g++){var h=this.format(d[g],g);if(h||0===h){var i=0==d[g],j=this.chart.svg.group().translate(e[g],this.center?-c:0);j.append(this.line({y1:this.center?-f:0,y2:this.center?f:-f,stroke:this.color("gridAxisBorderColor"),"stroke-width":this.chart.theme("gridBorderWidth")})),(!i||i&&!this.hideZero)&&j.append(this.getTextRotate(this.chart.text({x:0,y:2*-f,"text-anchor":"middle",fill:this.chart.theme(i,"gridActiveFontColor","gridFontColor")},h))),a.append(j)}}},this.left=function(a){var b=this.axis.area("width"),c=(this.axis.area("height"),b/2);a.append(this.axisLine({x1:this.center?c:0,x2:this.center?c:0,y1:this.start,y2:this.end}));for(var d=this.ticks,e=this.values,f=this.bar,g=0;g<d.length;g++){var h=this.format(d[g],g);if(h||0===h){var i=0==d[g],j=this.chart.svg.group().translate(this.center?c:0,e[g]);j.append(this.line({x1:this.center?-f:0,x2:f,stroke:this.color("gridAxisBorderColor"),"stroke-width":this.chart.theme("gridBorderWidth")})),(!i||i&&!this.hideZero)&&j.append(this.getTextRotate(this.chart.text({x:f/2+4,y:f-2,fill:this.chart.theme("gridFontColor")},h))),a.append(j)}}},this.right=function(a){var b=this.axis.area("width"),c=b/2;a.append(this.axisLine({x1:this.center?-c:0,x2:this.center?-c:0,y1:this.start,y2:this.end}));for(var d=this.ticks,e=this.values,f=this.bar,g=0;g<d.length;g++){var h=this.format(d[g],g);if(h||0===h){var i=0==d[g],j=this.chart.svg.group().translate(this.center?-c:0,e[g]);j.append(this.line({x1:this.center?-f:0,x2:this.center?f:-f,stroke:this.color("gridAxisBorderColor"),"stroke-width":this.chart.theme("gridBorderWidth")})),(!i||i&&!this.hideZero)&&j.append(this.getTextRotate(this.chart.text({x:-f-4,y:f-2,"text-anchor":"end",fill:this.chart.theme("gridFontColor")},h))),a.append(j)}}},this.wrapper=function(a,b){function c(a){return d(e.axis.data[a][b])}var d=a,e=this;return b?$.extend(c,d):d},this.initDomain=function(){var a=[],c=this.grid.min||void 0,d=this.grid.max||void 0,e=this.data(),f=[];if(b.typeCheck("string",this.grid.domain)){var g=this.grid.domain;f=new Array(e.length);for(var h=0,i=e.length;i>h;h++){var j=e[h][g];b.typeCheck("array",j)?(f[h]=Math.max(j),f.push(Math.min(j))):f[h]=j}}else if(b.typeCheck("function",this.grid.domain)){f=new Array(e.length);for(var h=0,i=e.length;i>h;h++){var j=this.grid.domain.call(this.chart,e[h]);b.typeCheck("array",j)?(f[h]=Math.max.apply(Math,j),f.push(Math.min.apply(Math,j))):f[h]=j}}else f=grid.domain;var k=Math.min.apply(Math,f),l=Math.max.apply(Math,f);"undefined"==typeof c&&(c=k),"undefined"==typeof d&&(d=l),this.grid.max=d,this.grid.min=c;var m;if(m=b.typeCheck("function",this.grid.unit)?this.grid.unit.call(this.chart,this.grid):b.typeCheck("number",this.grid.unit)?this.grid.unit:Math.ceil((d-c)/this.grid.step),0==m)a=[0,0];else{for(var n=0;d>n;)n+=m;for(var o=n;o>c;)o-=m;a=[o,n]}return this.grid.reverse&&a.reverse(),a},this.drawBefore=function(){var b=this.initDomain(),c=this.getGridSize();if(this.scale=a.linear().domain(b),"left"==this.grid.orient||"right"==this.grid.orient)var d=[c.end,c.start];else var d=[c.start,c.end];this.scale.range(d),this.start=c.start,this.size=c.size,this.end=c.end,this.step=this.grid.step,this.nice=this.grid.nice,this.ticks=this.scale.ticks(this.step,this.nice),this.bar=6,this.hideZero=this.grid.hideZero,this.center=this.grid.center,this.values=[];for(var e=0,f=this.ticks.length;f>e;e++)this.values[e]=this.scale(this.ticks[e])},this.draw=function(){return this.drawGrid(chart,orient,"rule",grid)}};return c.setup=function(){return{domain:null,step:10,min:0,max:0,unit:null,clamp:!0,reverse:!1,key:null,hideText:!1,hideZero:!1,nice:!1,center:!1}},c},"chart.grid.core"),jui.define("chart.grid.panel",[],function(){var a=function(){this.custom=function(a){var b=this.scale(0);b.x-=this.axis.area("x"),b.y-=this.axis.area("y");var c=this.chart.svg.rect($.extend(b,{fill:"tranparent",stroke:"white"}));a.append(c)},this.drawBefore=function(){this.scale=function(a){return function(){return{x:a.area("x"),y:a.area("y"),width:a.area("width"),height:a.area("height")}}}(this.axis)},this.draw=function(){return this.grid.hide=!0,this.drawGrid("panel")}};return a},"chart.grid.core"),jui.define("chart.grid.table",[],function(){var a=function(){var a,b;this.custom=function(){for(var c=0;a>c;c++)for(var d=0;b>d;d++){var e=c*b+d,f=this.scale(e);f.x-=this.axis.area("x"),f.y-=this.axis.area("y");{this.chart.svg.rect($.extend(f,{fill:"tranparent",stroke:"black"}))}}},this.drawBefore=function(){var a=this.grid.rows,b=this.grid.columns;padding=this.grid.padding;var c=(this.axis.area("width")-(b-1)*padding)/b,d=(this.axis.area("height")-(a-1)*padding)/a;this.scale=function(a,b,c,d,e){return function(b){var f=Math.floor(b/c),g=b%c,h=g*e,i=f*d,j=padding*g,k=padding*f;return{x:a.area("x")+h+j,y:a.area("y")+i+k,width:e,height:d}}}(this.axis,a,b,d,c)},this.draw=function(){return this.grid.hide=!0,this.drawGrid("table")}};return a.setup=function(){return{rows:1,columns:1,padding:10}},a},"chart.grid.core"),jui.define("chart.grid.overlap",[],function(){var a=function(){var a,b,c,d,e;this.custom=function(){for(var a=0,b=this.axis.data.length;b>a;a++){var c=this.scale(a);c.x-=this.axis.area("x"),c.y-=this.axis.area("y"),this.chart.svg.rect($.extend(c,{fill:"transparent",stroke:"transparent"}))}},this.drawBefore=function(){a=this.grid.count||this.axis.data.length||1,b=this.axis.area("width")/2/a,c=this.axis.area("height")/2/a,d=this.axis.area("width"),e=this.axis.area("height"),this.scale=function(a){return function(f){var g=f*b,h=f*c;return{x:a.area("x")+g,y:a.area("y")+h,width:2*Math.abs(d/2-g),height:2*Math.abs(e/2-h)}}}(this.axis)},this.draw=function(){return this.grid.hide=!0,this.drawGrid("overlap")}};return a.setup=function(){return{count:null}},a},"chart.grid.core"),jui.define("chart.grid.topologytable",["util.base"],function(a){var b=function(){function b(a){for(var b=null,c=h.axis.data,d=0,e=c.length;e>d;d++)if(h.axis.getValue(c[d],"key")==a){b=d;break}return b}function c(){function a(){var c=Math.floor(Math.random()*b);if(i[c]){var d=0;for(var e in i)d++;if(b>d)return a(b);i={}}else i[c]=!0;return c}for(var b=Math.floor(e.height/f),c=Math.floor(e.width/f),d=Math.floor(c/g),j=0,k=-1,l=g,m=0;g>m;m++){var n=0,o=0,p=0;m%2==0?(n=j*f,o=a(b)*f,j+=d,k+=1,p=k):(n=(c-j)*f+f,o=a(b)*f,l-=1,p=l),h.axis.cacheXY[p]={x:n+f,y:o+f/2}}}function d(){for(var a=0;g>a;a++){var b=Math.floor(Math.random()*(e.width-f)),c=Math.floor(Math.random()*(e.height-f));h.axis.cacheXY[a]={x:b,y:c}}}var e,f,g,h=this,i={};this.drawBefore=function(){e=this.chart.area(),f=this.grid.space,g=this.axis.data.length,this.axis.cacheXY||(this.axis.cacheXY=[],"random"==this.grid.sort?d():c()),this.scale=function(){return function(c){var c=a.typeCheck("string",c)?b(c):c,d={setX:function(a){h.axis.cacheXY[c].x=a},setY:function(a){h.axis.cacheXY[c].y=a},moveLast:function(){var a=h.axis.cacheXY.splice(c,1);h.axis.cacheXY.push(a[0]);var b=h.axis.data.splice(c,1);h.axis.data.push(b[0])}};return a.extend(d,h.axis.cacheXY[c])}}(this.axis)},this.draw=function(){return this.grid.hide=!0,this.drawGrid()}};return b.setup=function(){return{sort:null,space:50}},b},"chart.grid.core"),jui.define("chart.grid.grid3d",["util.base","util.math"],function(a,b){var c=function(){var a=this,c=0,d=0,e=0;this.drawBefore=function(){c=this.axis.get("depth"),d=this.axis.get("angle"),e=c/this.grid.step,this.scale=function(){var c=b.radian(360-d);return function(b,f,g){var g=g?g:0,h=e*g;return g>0?{x:a.axis.x(b)+Math.cos(c)*h,y:a.axis.y(f)+Math.sin(c)*h,depth:e,angle:d}:{x:a.axis.x(b),y:a.axis.y(f),depth:e,angle:d}}}(this.axis)},this.draw=function(){var e=b.radian(360-d),f=Math.sin(e)*c,g=Math.cos(e)*c;return this.axis.y.root.each(function(b,c){if(0==b)a.axis.y.root.append(a.line({x1:g,y1:0,x2:g,y2:f+c.attributes.y2}));else{var d=a.axis.x.root.get(0).attributes;c.append(a.line({x1:0,y1:0,x2:g,y2:f})),c.append(a.line({x1:g,y1:f,x2:g+d.x2,y2:f}))}}),this.axis.x.root.each(function(b,d){var f=0==b?d.attributes:d.get(0).attributes,g=f.y1+Math.sin(e)*c,h=f.x1+Math.cos(e)*c;if(0==b)a.axis.x.root.append(a.line({x1:h,y1:g,x2:h+f.x2,y2:g}));else if(b>1){var i=a.axis.y.root.get(0).attributes;d.append(a.line({x1:f.x1,y1:f.y1,x2:h,y2:g})),d.append(a.line({x1:h,y1:-i.y1,x2:h,y2:-i.y2}))}}),this.drawGrid()}};return c.setup=function(){return{step:1}},c},"chart.grid.core"),jui.define("chart.brush.core",["jquery","util.base"],function(a,b){var c=function(){function c(a,b){for(var c={},d={},e=0;e<b.length;e++)c[b[e]]||(d[b[e]]=[]);for(var e=0,f=a.length;f>e;e++){var g=a[e];for(var h in d)d[h].push(g[h])}for(var i in d)c[i]={min:Math.min.apply(Math,d[i]),max:Math.max.apply(Math,d[i])};return c}this.drawAfter=function(a){this.brush.clip!==!1&&a.attr({"clip-path":"url(#"+this.axis.get("clipId")+")"}),a.attr({"class":"brush brush-"+this.brush.type}),a.translate(this.chart.area("x"),this.chart.area("y"))},this.drawTooltip=function(a,b,c){function d(){return f.chart.svg.group({visibility:"hidden"},function(){f.chart.text({"text-anchor":"middle","font-weight":f.chart.theme("tooltipPointFontWeight"),opacity:c}),f.chart.svg.circle({r:f.chart.theme("tooltipPointRadius"),fill:a,stroke:b,opacity:c,"stroke-width":f.chart.theme("tooltipPointBorderWidth")})})}function e(a,b,c,d){var e=g.get(0);e.element.textContent=d,e.attr("left"==a?{x:-7,y:4,"text-anchor":"end"}:"right"==a?{x:7,y:4,"text-anchor":"start"}:"bottom"==a?{y:16}:{y:-7}),g.attr({visibility:0!=d?"visible":"hidden"}),g.translate(b,c)}var f=this,g=null;return g=d(),{tooltip:g,control:e,style:function(a,b,c){g.get(0).attr({opacity:c}),g.get(1).attr({fill:a,stroke:b,opacity:c})}}},this.curvePoints=function(a){var b=[],c=[],d=a.length-1,e=[],f=[],g=[],h=[];for(e[0]=0,f[0]=2,g[0]=1,h[0]=a[0]+2*a[1],i=1;d-1>i;i++)e[i]=1,f[i]=4,g[i]=1,h[i]=4*a[i]+2*a[i+1];e[d-1]=2,f[d-1]=7,g[d-1]=0,h[d-1]=8*a[d-1]+a[d];for(var i=1;d>i;i++){var j=e[i]/f[i-1];f[i]=f[i]-j*g[i-1],h[i]=h[i]-j*h[i-1]}b[d-1]=h[d-1]/f[d-1];for(var i=d-2;i>=0;--i)b[i]=(h[i]-g[i]*b[i+1])/f[i];for(var i=0;d-1>i;i++)c[i]=2*a[i+1]-b[i+1];return c[d-1]=.5*(a[d]+b[d-1]),{p1:b,p2:c}},this.getScaleValue=function(a,b,c,d,e){function f(){var d=c-b,e=a-b,f=e/d;return f}var g=e-d,h=g*f();return h+d},this.eachData=function(a){if(b.typeCheck("function",a))for(var c=this.listData(),d=0,e=c.length;e>d;d++)a.call(this,d,c[d])},this.listData=function(){return this.axis.data},this.getData=function(a){return this.listData()[a]},this.getValue=function(a,b,c){return this.axis.getValue(a,b,c)},this.getXY=function(a){var d=[],e={},f=this.listData().length,g=f,h=this.brush.target,i=h.length;a!==!1&&(e=c(this.axis.data,h));for(var j=0;i>j;j++)d[j]={x:new Array(f),y:new Array(f),value:new Array(f),min:[],max:[],length:f};var k=this.axis.data,l=this.axis.x,m=this.axis.y,n=b.loop(g);return n(function(b){for(var c=k[b],f=l(b),g=0;i>g;g++){var j=h[g],n=c[j],o=m(n);d[g].x[b]=f,d[g].y[b]=o,d[g].value[b]=n,a!==!1&&(d[g].min[b]=n==e[j].min,d[g].max[b]=n==e[j].max)}}),d},this.getStackXY=function(a){var b=this.getXY(a);return this.eachData(function(a,c){for(var d=0,e=0;e<this.brush.target.length;e++){var f=this.brush.target[e],g=c[f];e>0&&(d+=c[this.brush.target[e-1]]),b[e].y[a]=this.axis.y(g+d)}}),b},this.addEvent=function(b,c,d){function e(b){var c=a(f.root).offset(),d=b.pageX-c.left,e=b.pageY-c.top;b.bgX=d,b.bgY=e,b.chartX=d-f.padding("left"),b.chartY=e-f.padding("top")}var f=this.chart,g={brush:this.brush,dataIndex:c,dataKey:null!=d?this.brush.target[d]:null,data:null!=c?this.getData(c):null};b.on("click",function(a){e(a),f.emit("click",[g,a])}),b.on("dblclick",function(a){e(a),f.emit("dblclick",[g,a])}),b.on("contextmenu",function(a){e(a),f.emit("rclick",[g,a]),a.preventDefault()}),b.on("mouseover",function(a){e(a),f.emit("mouseover",[g,a])}),b.on("mouseout",function(a){e(a),f.emit("mouseout",[g,a])}),b.on("mousemove",function(a){e(a),f.emit("mousemove",[g,a])}),b.on("mousedown",function(a){e(a),f.emit("mousedown",[g,a])}),b.on("mouseup",function(a){e(a),f.emit("mouseup",[g,a])})},this.color=function(a){return"string"==typeof a?this.chart.color(0,{colors:[a]}):this.chart.color(a,this.brush)},this.on=function(a,b){return this.chart.on(a,b,"render")}};return c.setup=function(){return{target:null,colors:null,axis:0,index:null,clip:!0}},c},"chart.draw"),jui.define("chart.brush.bar",["util.base"],function(a){var b=function(b,c,d){var e,f,g,h,i;this.getBarStyle=function(){return{borderColor:this.chart.theme("barBorderColor"),borderWidth:this.chart.theme("barBorderWidth"),borderOpacity:this.chart.theme("barBorderOpacity"),borderRadius:this.chart.theme("barBorderRadius"),disableOpacity:this.chart.theme("barDisableBackgroundOpacity"),circleColor:this.chart.theme("barPointBorderColor")}},this.getBarElement=function(b,c,d){var e=this.getBarStyle(),f=this.color(c),g=this.getData(b)[this.brush.target[c]],h=this.chart.svg.pathRect({width:d.width,height:d.height,fill:f,stroke:e.borderColor,"stroke-width":e.borderWidth,"stroke-opacity":e.borderOpacity});return 0!=g&&this.addEvent(h,b,c),null==this.barList&&(this.barList=[]),this.barList.push(a.extend({element:h,color:f},d)),h},this.setActiveEffect=function(a){for(var b=this.getBarStyle(),c=this.barList,d=0;d<c.length;d++){var e=c[d]==a?1:b.disableOpacity;c[d].element.attr({opacity:e}),c[d].minmax&&c[d].minmax.style(c[d].color,b.circleColor,e)}},this.drawBefore=function(){e=b.svg.group(),f=c.x(0),g=c.y.rangeBand(),h=g-2*d.outerPadding,i=(h-(d.target.length-1)*d.innerPadding)/d.target.length,i=0>i?0:i},this.drawETC=function(b){if(a.typeCheck("array",this.barList)){var c=this,d=this.getBarStyle();this.active=this.drawTooltip(),b.append(this.active.tooltip);for(var e=0;e<this.barList.length;e++){var f=this.barList[e];("max"==this.brush.display&&f.max||"min"==this.brush.display&&f.min)&&(f.minmax=this.drawTooltip(f.color,d.circleColor,1),f.minmax.control(f.position,f.tooltipX,f.tooltipY,this.format(f.value)),b.append(f.minmax.tooltip)),0!=f.value&&null!=this.brush.activeEvent&&!function(a){c.active.style(a.color,d.circleColor,1),a.element.on(c.brush.activeEvent,function(){c.active.style(a.color,d.circleColor,1),c.active.control(a.position,a.tooltipX,a.tooltipY,c.format(a.value)),c.setActiveEffect(a)}),a.element.attr({cursor:"pointer"})}(f)}var f=this.barList[this.brush.active];null!=f&&(this.active.style(f.color,d.circleColor,1),this.active.control(f.position,f.tooltipX,f.tooltipY,this.format(f.value)),this.setActiveEffect(f))}},this.draw=function(){var a=this.getXY(),b=this.getBarStyle();return this.eachData(function(g,j){for(var k=c.y(g)-h/2,l=0;l<d.target.length;l++){var m=j[d.target[l]],n=c.x(0==m?d.minValue:m),o=k+i/2,p=n>=f?"right":"left",q=Math.abs(f-n),r=q<b.borderRadius||i<b.borderRadius?0:b.borderRadius,s=this.getBarElement(g,l,{width:q,height:i,value:m,tooltipX:n,tooltipY:o,position:p,max:a[l].max[g],min:a[l].min[g]});n>=f?(s.round(q,i,0,r,r,0),s.translate(f,k)):(s.round(q,i,r,0,0,r),s.translate(f-q,k)),e.append(s),k+=i+d.innerPadding}}),this.drawETC(e),e},this.drawAnimate=function(a){var b=this.chart.svg,c=this.brush.animate;a.append(b.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.4s",repeatCount:"1",fill:"freeze"})),a.each(function(a,d){if(d.is("util.svg.element.path")){var e=d.data("translate").split(","),f=parseInt(e[0]),g=parseInt(e[1]),h=parseInt(d.attr("width")),i="right"==c?f+h:f-h;d.append(b.animateTransform({attributeName:"transform",type:"translate",from:i+" "+g,to:f+" "+g,begin:"0s",dur:"0.7s",repeatCount:"1",fill:"freeze"}))}})}};return b.setup=function(){return{minValue:0,outerPadding:2,innerPadding:1,active:null,activeEvent:null,display:null}},b},"chart.brush.core"),jui.define("chart.brush.column",[],function(){var a=function(a,b,c){var d,e,f,g,h;this.drawBefore=function(){d=a.svg.group(),e=b.y(0),f=b.x.rangeBand(),h=f-2*c.outerPadding,g=(f-2*c.outerPadding-(c.target.length-1)*c.innerPadding)/c.target.length,g=0>g?0:g},this.draw=function(){var a=this.getXY(),f=this.getBarStyle();return this.eachData(function(i,j){for(var k=b.x(i)-h/2,l=0;l<c.target.length;l++){var m=j[c.target[l]],n=k+g/2,o=b.y(0==m?c.minValue:m),p=e>=o?"top":"bottom",q=Math.abs(e-o),r=g<f.borderRadius||q<f.borderRadius?0:f.borderRadius,s=this.getBarElement(i,l,{width:g,height:q,value:m,tooltipX:n,tooltipY:o,position:p,max:a[l].max[i],min:a[l].min[i]});e>=o?(s.round(g,q,r,r,0,0),s.translate(k,o)):(s.round(g,q,0,0,r,r),s.translate(k,e)),d.append(s),k+=g+c.innerPadding}}),this.drawETC(d),d},this.drawAnimate=function(a){var b=this.chart.svg,c=this.brush.animate;a.append(b.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.4s",repeatCount:"1",fill:"freeze"})),a.each(function(a,d){if(d.is("util.svg.element.path")){var e=d.data("translate").split(","),f=parseInt(e[0]),g=parseInt(e[1]),h=parseInt(d.attr("height")),i="top"==c?g-h:g+h;
d.append(b.animateTransform({attributeName:"transform",type:"translate",from:f+" "+i,to:f+" "+g,begin:"0s",dur:"0.7s",repeatCount:"1",fill:"freeze"}))}})}};return a},"chart.brush.bar"),jui.define("chart.brush.column3d",[],function(){var a=function(a,b,c){var d;this.drawBefore=function(){d=a.svg.group()},this.draw=function(){return this.eachData(function(a,e){for(var f=0;f<c.target.length;f++){var g=b.c(a,e[c.target[f]],f);d.append(this.chart.svg.circle({r:3,fill:this.color(f),cx:g.x+1.5,cy:g.y+1.5}))}}),d}};return a},"chart.brush.core"),jui.define("chart.brush.stackbar",[],function(){var a=function(a,b,c){var d,e,f;this.addBarElement=function(a){null==this.barList&&(this.barList=[]),this.barList.push(a)},this.getBarElement=function(a,b){var c=this.getBarStyle(),d=this.color(b),e=this.getData(a)[this.brush.target[b]],f=this.chart.svg.rect({fill:d,stroke:c.borderColor,"stroke-width":c.borderWidth,"stroke-opacity":c.borderOpacity});return 0!=e&&this.addEvent(f,a,b),f},this.setActiveEffect=function(a){for(var b=this.getBarStyle(),c=this.barList,d=0;d<c.length;d++){var e=a==c[d]?1:b.disableOpacity;c[d].attr({opacity:e})}},this.setActiveEffectOption=function(){var a=this.brush.active;this.barList&&this.barList[a]&&this.setActiveEffect(this.barList[a])},this.setActiveEvent=function(a){var b=this;a.on(b.brush.activeEvent,function(){b.setActiveEffect(a)})},this.setActiveEventOption=function(a){null!=this.brush.activeEvent&&(this.setActiveEvent(a),a.attr({cursor:"pointer"}))},this.drawBefore=function(){d=a.svg.group(),e=b.y.rangeBand(),f=e-2*c.outerPadding},this.draw=function(){return this.eachData(function(e,g){for(var h=a.svg.group(),i=b.y(e)-f/2,j=b.x(0),k=0,l=0;l<c.target.length;l++){var m=g[c.target[l]]+k,n=b.x(m),o=this.getBarElement(e,l);o.attr({x:n>j?j:n,y:i,width:Math.abs(j-n),height:f}),h.append(o),j=n,k=m}this.setActiveEventOption(h),this.addBarElement(h),d.append(h)}),this.setActiveEffectOption(),d}};return a.setup=function(){return{outerPadding:15}},a},"chart.brush.bar"),jui.define("chart.brush.stackcolumn",[],function(){var a=function(a,b,c){var d,e,f,g;this.drawBefore=function(){d=a.svg.group(),e=b.y(0),f=b.x.rangeBand(),g=f-2*c.outerPadding},this.draw=function(){return this.eachData(function(e,f){for(var h=a.svg.group(),i=b.x(e)-g/2,j=b.y(0),k=0,l=0;l<c.target.length;l++){var m=f[c.target[l]]+k,n=b.y(m),o=this.getBarElement(e,l);o.attr({x:i,y:j>n?n:j,width:g,height:Math.abs(j-n)}),h.append(o),j=n,k=m}this.setActiveEventOption(h),this.addBarElement(h),d.append(h)}),this.setActiveEffectOption(),d}};return a},"chart.brush.stackbar"),jui.define("chart.brush.fullstackbar",[],function(){var a=function(a,b,c){var d,e,f,g;this.drawBefore=function(){d=a.svg.group(),e=b.x(0),f=b.y.rangeBand(),g=f-2*c.outerPadding},this.drawText=function(a,b,c){var d=this.chart.text({x:b,y:c,"text-anchor":"middle"},a+"%");return d},this.draw=function(){return this.eachData(function(e,f){for(var h=a.svg.group(),i=b.y(e)-g/2,j=0,k=[],l=0;l<c.target.length;l++){var m=f[c.target[l]];j+=m,k.push(m)}for(var n=0,o=b.x.max(),l=k.length-1;l>=0;l--){var m=b.x.rate(k[l],j),p=this.getBarElement(e,l);if(p.attr({x:n,y:i,width:m,height:g}),h.append(p),c.showText){var q=Math.round(k[l]/j*o),r=n+m/2,s=i+g/2+5;h.append(this.drawText(q,r,s))}this.setActiveEventOption(h),n+=m}this.addBarElement(h),d.append(h)}),this.setActiveEffectOption(),d}};return a.setup=function(){return{outerPadding:15,showText:!1}},a},"chart.brush.stackbar"),jui.define("chart.brush.fullstackcolumn",[],function(){var a=function(a,b,c){var d,e,f,g;this.drawBefore=function(){d=a.svg.group(),e=b.y(0),f=b.x.rangeBand(),g=f-2*c.outerPadding},this.draw=function(){var e=a.area("height");return this.eachData(function(f,h){for(var i=a.svg.group(),j=b.x(f)-g/2,k=0,l=[],m=0;m<c.target.length;m++){var n=h[c.target[m]];k+=n,l.push(n)}for(var o=0,p=b.y.max(),m=l.length-1;m>=0;m--){var n=e-b.y.rate(l[m],k),q=this.getBarElement(f,m);if(q.attr({x:j,y:o,width:g,height:n}),i.append(q),c.showText){var r=Math.round(l[m]/k*p),s=j+g/2,t=o+n/2+8;i.append(this.drawText(r,s,t))}this.setActiveEventOption(i),o+=n}this.addBarElement(i),d.append(i)}),this.setActiveEffectOption(),d}};return a},"chart.brush.fullstackbar"),jui.define("chart.brush.bubble",[],function(){var a=function(a,b,c){function d(a,c,d,f){var g=e.getScaleValue(d.value,b.y.min(),b.y.max(),c.min,c.max),h=a.svg.group();return h.append(a.svg.circle({r:g,fill:e.color(f),"fill-opacity":a.theme("bubbleBackgroundOpacity"),stroke:e.color(f),"stroke-width":a.theme("bubbleBorderWidth")})).translate(d.x,d.y),h}var e=this;this.drawBubble=function(a,b,c){for(var e=a.svg.group(),f=0;f<c.length;f++)for(var g=0;g<c[f].x.length;g++){var h=d(a,b,{x:c[f].x[g],y:c[f].y[g],value:c[f].value[g]},f);this.addEvent(h,g,f),e.append(h)}return e},this.draw=function(){return this.drawBubble(a,c,this.getXY())},this.drawAnimate=function(b){b.each(function(b,c){var d=c.childrens[0];d.append(a.svg.animateTransform({attributeType:"xml",attributeName:"transform",type:"scale",from:"0",to:"1",dur:"0.7s",fill:"freeze",repeatCount:"1"})),d.append(a.svg.animate({attributeType:"xml",attributeName:"fill-opacity",from:"0",to:a.theme("bubbleBackgroundOpacity"),dur:"1.4s",repeatCount:"1",fill:"freeze"}))})}};return a.setup=function(){return{min:5,max:30}},a},"chart.brush.core"),jui.define("chart.brush.candlestick",[],function(){var a=function(){var a,b=0,c=0,d=0;this.drawBefore=function(){a=this.chart.svg.group(),b=this.axis.x.rangeBand(),c=.7*b,d=c/2},this.draw=function(){return this.eachData(function(b,e){var f=this.axis.x(b),g=null,h=null,i=this.getValue(e,"high",0),j=this.getValue(e,"low",0),k=this.getValue(e,"open",0),l=this.getValue(e,"close",0);if(k>l){var m=this.axis.y(k);h=this.chart.svg.line({x1:f,y1:this.axis.y(i),x2:f,y2:this.axis.y(j),stroke:this.chart.theme("candlestickInvertBorderColor"),"stroke-width":1}),g=this.chart.svg.rect({x:f-d,y:m,width:c,height:Math.abs(this.axis.y(l)-m),fill:this.chart.theme("candlestickInvertBackgroundColor"),stroke:this.chart.theme("candlestickInvertBorderColor"),"stroke-width":1})}else{var m=this.axis.y(l);h=this.chart.svg.line({x1:f,y1:this.axis.y(i),x2:f,y2:this.axis.y(j),stroke:this.chart.theme("candlestickBorderColor"),"stroke-width":1}),g=this.chart.svg.rect({x:f-d,y:m,width:c,height:Math.abs(this.axis.y(k)-m),fill:this.chart.theme("candlestickBackgroundColor"),stroke:this.chart.theme("candlestickBorderColor"),"stroke-width":1})}this.addEvent(g,b,null),a.append(h),a.append(g)}),a}};return a},"chart.brush.core"),jui.define("chart.brush.ohlc",[],function(){var a=function(a,b){var c;this.drawBefore=function(){c=a.svg.group()},this.draw=function(){return this.eachData(function(d,e){var f=b.x(d),g=this.getValue(e,"high",0),h=this.getValue(e,"low",0),i=this.getValue(e,"open",0),j=this.getValue(e,"close",0),k=a.theme(i>j?"ohlcInvertBorderColor":"ohlcBorderColor"),l=a.svg.line({x1:f,y1:b.y(g),x2:f,y2:b.y(h),stroke:k,"stroke-width":1}),j=a.svg.line({x1:f,y1:b.y(j),x2:f+a.theme("ohlcBorderRadius"),y2:b.y(j),stroke:k,"stroke-width":1}),i=a.svg.line({x1:f,y1:b.y(i),x2:f-a.theme("ohlcBorderRadius"),y2:b.y(i),stroke:k,"stroke-width":1});this.addEvent(l,d,null),c.append(l),c.append(j),c.append(i)}),c}};return a},"chart.brush.candlestick"),jui.define("chart.brush.equalizer",[],function(){var a=function(a,b,c){var d,e,f,g,h;this.drawBefore=function(){d=a.svg.group(),e=b.y(0),f=b.x.rangeBand(),h=(f-2*c.outerPadding)/2,g=(f-2*c.outerPadding-(c.target.length-1)*c.innerPadding)/c.target.length},this.draw=function(){return this.eachData(function(f,i){for(var j=b.x(f)-h,k=0;k<c.target.length;k++){var l=a.svg.group(),m=b.y(i[c.target[k]]),n=1.5,o=e,p=0;if(e>=m)for(;o>m;){var q=o-c.unit<m?Math.abs(o-m):c.unit,r=a.svg.rect({x:j,y:o-q,width:g,height:q,fill:this.color(Math.floor(p/c.gap))});o-=q+n,p++,l.append(r)}else for(;m>o;){var q=o+c.unit>m?Math.abs(o-m):c.unit,r=a.svg.rect({x:j,y:o,width:g,height:q,fill:this.color(Math.floor(p/c.gap))});o+=q+n,p++,l.append(r)}this.addEvent(l,f,k),d.append(l),j+=g+c.innerPadding}}),d}};return a.setup=function(){return{innerPadding:10,outerPadding:15,unit:5,gap:5}},a},"chart.brush.core"),jui.define("chart.brush.line",[],function(){var a=function(){var a,b,c,d;this.setActiveEffect=function(a){for(var d=this.lineList,e=0;e<d.length;e++){var f=a==d[e].element?1:c,g=d[e].element.attr("stroke");null!=d[e].tooltip&&d[e].tooltip.style(g,b,f),d[e].element.attr({opacity:f})}},this.addLineElement=function(a){this.lineList||(this.lineList=[]),this.lineList.push(a)},this.createLine=function(a,b){var c=a.x,e=a.y,f=this.chart.svg.path({stroke:this.color(b),"stroke-width":d,fill:"transparent",cursor:null!=this.brush.activeEvent?"pointer":"normal"});if(a.length>0)if(f.MoveTo(c[0],e[0]),"curve"==this.brush.symbol)for(var g=this.curvePoints(c),h=this.curvePoints(e),i=0;i<c.length-1;i++)f.CurveTo(g.p1[i],h.p1[i],g.p2[i],h.p2[i],c[i+1],e[i+1]);else for(var i=0;i<c.length-1;i++){if("step"==this.brush.symbol){var j=c[i]+(c[i+1]-c[i])/2;f.LineTo(j,e[i]),f.LineTo(j,e[i+1])}f.LineTo(c[i+1],e[i+1])}return f},this.createTooltip=function(a,c,d){for(var e=this.brush.display,f=0;f<c.x.length;f++)if("max"==e&&c.max[f]||"min"==e&&c.min[f]){var g="max"==e&&c.max[f]?"top":"bottom",h=this.drawTooltip(this.color(d),b,1);h.control(g,c.x[f],c.y[f],this.format(c.value[f])),a.append(h.tooltip),this.lineList[d].tooltip=h}},this.drawLine=function(b){for(var c=this,d=0;d<b.length;d++){var e=this.createLine(b[d],d);this.addEvent(e,null,d),a.append(e),this.addLineElement({element:e,tooltip:null}),null!=this.brush.display&&this.createTooltip(a,b[d],d),null!=this.brush.activeEvent&&!function(a){a.on(c.brush.activeEvent,function(){c.setActiveEffect(a)})}(e)}for(var d=0;d<b.length;d++)this.brush.active==this.brush.target[d]&&this.setActiveEffect(this.lineList[d].element);return a},this.drawBefore=function(){a=this.chart.svg.group(),b=this.chart.theme("linePointBorderColor"),c=this.chart.theme("lineDisableBorderOpacity"),d=this.chart.theme("lineBorderWidth")},this.draw=function(){return this.drawLine(this.getXY())},this.drawAnimate=function(a){var b=this.chart.svg;a.each(function(a,c){if(c.is("util.svg.element.path")){var d=c.length();c.attr({"stroke-dasharray":d}),c.append(b.animate({attributeName:"stroke-dashoffset",from:d,to:"0",begin:"0s",dur:"1s",repeatCount:"1"}))}})}};return a.setup=function(){return{symbol:"normal",active:null,activeEvent:null,display:null}},a},"chart.brush.core"),jui.define("chart.brush.path",[],function(){var a=function(a,b,c){this.draw=function(){for(var b=this.chart.svg.group(),d=0,e=this.brush.target.length;e>d;d++){var f=this.color(d),g=a.svg.path({fill:f,"fill-opacity":a.theme("pathBackgroundOpacity"),stroke:f,"stroke-width":a.theme("pathBorderWidth")});b.append(g),this.eachData(function(b,e){var f=this.axis.c(b,e[c.target[d]]),h=f.x-a.area("x"),i=f.y-a.area("y");0==b?g.MoveTo(h,i):g.LineTo(h,i)}),g.ClosePath()}return b}};return a},"chart.brush.core"),jui.define("chart.brush.pie",["util.base","util.math","util.color"],function(a,b,c){var d=function(){var a,d=this,e=3;this.drawPie=function(a,c,d,e,f,g){var h=this.chart.svg.group();if(360==f){var i=this.chart.svg.circle({cx:a,cy:c,r:d,fill:g,stroke:this.chart.theme("pieBorderColor")||g,"stroke-width":this.chart.theme("pieBorderWidth")});return h.append(i),h}var j=this.chart.svg.path({fill:g,stroke:this.chart.theme("pieBorderColor")||g,"stroke-width":this.chart.theme("pieBorderWidth")}),k=b.rotate(0,-d,b.radian(e)),l=k.x,m=k.y;return j.MoveTo(l,m),k=b.rotate(l,m,b.radian(f)),h.translate(a,c),j.Arc(d,d,0,f>180?1:0,1,k.x,k.y).LineTo(0,0).ClosePath(),h.append(j),h},this.drawPie3d=function(a,c,d,e,f,g){var h=this.chart.svg.group(),i=this.chart.svg.path({fill:g,stroke:this.chart.theme("pieBorderColor")||g,"stroke-width":this.chart.theme("pieBorderWidth")}),j=b.rotate(0,-d,b.radian(e)),k=j.x,l=j.y;i.MoveTo(k,l),j=b.rotate(k,l,b.radian(f)),h.translate(a,c),i.Arc(d,d,0,f>180?1:0,1,j.x,j.y);var m=j.y+10,n=j.x+5,o=k+5,p=l+10;return i.LineTo(n,m),i.Arc(d,d,0,f>180?1:0,0,o,p),i.ClosePath(),h.append(i),h},this.drawUnit=function(a,b,e){var f=this.axis.c(a),g=f.width,h=f.height,i=f.x,j=f.y,k=g;k>h&&(k=h);for(var l=g/2+i,m=h/2+j,n=k/2,o=this.brush.target,p=360,q=0,r=0,s=0;s<o.length;s++)r+=b[o[s]];for(var s=0;s<o.length;s++){var t=b[o[s]],u=p*(t/r);if(this.brush["3d"]){var v=this.drawPie3d(l,m,n,q,u,c.darken(this.color(s),.5));e.append(v)}q+=u}q=0;for(var s=0;s<o.length;s++){var t=b[o[s]],u=p*(t/r),w=this.drawPie(l,m,n,q,u,this.color(s));if(this.brush.showText){var x=this.getFormatText(o[s],t,r),y=this.drawText(l,m,q+u/2-90,n,x);this.addEvent(y,a,s),e.append(y)}d.addEvent(w,a,s),e.append(w),q+=u}},this.getFormatText=function(a,b){var c=this.chart.get("series",a),d=c.text?c.text:a;return"function"==typeof this.brush.format?this.format(d,b):b?d+": "+this.format(b):d},this.drawText=function(a,c,d,f,g,h){var i=this.chart,j=i.theme("pieOuterLineSize"),h=h||1.2,k=f*h,l=a+Math.cos(b.radian(d))*f,m=c+Math.sin(b.radian(d))*f,n=a+Math.cos(b.radian(d))*k,o=c+Math.sin(b.radian(d))*k,p=d+90>180?!0:!1,q=p?n-j:n+j;return i.svg.group({},function(){var a=i.svg.path({fill:"transparent",stroke:i.theme("pieOuterLineColor"),"stroke-width":.7});a.MoveTo(l,m).LineTo(n,o).LineTo(q,o),i.text({"font-size":i.theme("pieOuterFontSize"),"text-anchor":p?"end":"start",y:e},g).translate(q+(p?-3:3),o)})},this.drawBefore=function(){a=this.chart.svg.group()},this.draw=function(){return this.eachData(function(b,c){this.drawUnit(b,c,a)}),a}};return d.setup=function(){return{clip:!1,showText:!1,format:null,"3d":!1}},d},"chart.brush.core"),jui.define("chart.brush.donut",["util.base","util.math","util.color"],function(a,b,c){var d=function(){this.drawDonut=function(a,c,d,e,f,g,h,i){i=i||!1,h["stroke-width"]=e-d;var j=this.chart.svg.group(),k=this.chart.svg.path(h),l=Math.abs(e-d),m=b.rotate(0,-e,b.radian(f)),n=m.x,o=m.y;if(k.MoveTo(n,o),m=b.rotate(n,o,b.radian(g)),j.translate(a,c),k.Arc(e,e,0,g>180?1:0,1,m.x,m.y),j.append(k),i){var p=b.rotate(0,-d-l/2,b.radian(f)),q=p.x,r=p.y,s=b.rotate(q,r,b.radian(g)),t=this.chart.svg.circle({cx:s.x,cy:s.y,r:l/2,fill:h.fill});j.append(t);var u=this.chart.svg.circle({cx:s.x,cy:s.y,r:3,fill:"white"});j.append(u)}return j},this.drawDonut3d=function(a,c,d,e,f,g,h,i){i=i||!1;var j=this.chart.svg.group(),k=this.chart.svg.path(h),l=Math.abs(e-d);e+=l/2,d=e-l;var m=b.rotate(0,-e,b.radian(f)),n=m.x,o=m.y,p=b.rotate(0,-d,b.radian(f)),q=p.x,r=p.y;k.MoveTo(n,o),m=b.rotate(n,o,b.radian(g)),p=b.rotate(q,r,b.radian(g)),j.translate(a,c),k.Arc(e,e,0,g>180?1:0,1,m.x,m.y);var s=m.y+10,t=m.x+5,u=p.y+10,v=p.x+5,w=n+5,x=o+10,y=q+5,z=r+10;k.LineTo(t,s),k.Arc(e,e,0,g>180?1:0,0,w,x),k.ClosePath(),j.append(k);var A=this.chart.svg.path(h);return A.MoveTo(q,r),A.Arc(d,d,0,g>180?1:0,1,p.x,p.y),A.LineTo(v,u),A.Arc(d,d,0,g>180?1:0,0,y,z),A.ClosePath(),j.append(A),j},this.drawDonut3dBlock=function(a,c,d,e,f,g,h,i){i=i||!1;var j=this.chart.svg.group(),k=this.chart.svg.path(h),l=Math.abs(e-d);e+=l/2,d=e-l;var m=b.rotate(0,-e,b.radian(f)),n=m.x,o=m.y,p=b.rotate(0,-d,b.radian(f)),q=p.x,r=p.y;k.MoveTo(n,o),m=b.rotate(n,o,b.radian(g)),p=b.rotate(q,r,b.radian(g)),j.translate(a,c);var s=m.y+10,t=m.x+5,u=p.y+10,v=p.x+5,w=this.chart.svg.path(h);return w.MoveTo(m.x,m.y).LineTo(t,s).LineTo(v,u).LineTo(p.x,p.y).ClosePath(),j.append(w),j},this.drawUnit=function(a,b,d){var e=this.axis.c(a),f=e.width,g=e.height,h=e.x,i=e.y,j=f;j>g&&(j=g);for(var k=f/2+h,l=g/2+i,m=j/2-this.brush.size/2,n=m-this.brush.size,o=this.brush.target,p=360,q=0,r=0,s=0;s<o.length;s++)r+=b[o[s]];if(this.brush["3d"]){for(var s=0;s<o.length;s++){var t=b[o[s]],u=p*(t/r),v=this.drawDonut3dBlock(k,l,n,m,q,u,{fill:c.darken(this.color(s),.5)},s==o.length-1);d.append(v),q+=u}q=0;for(var s=0;s<o.length;s++){var t=b[o[s]],u=p*(t/r),v=this.drawDonut3d(k,l,n,m,q,u,{fill:c.darken(this.color(s),.5)},s==o.length-1);d.append(v),q+=u}}q=0;for(var s=0;s<o.length;s++){var t=b[o[s]],u=p*(t/r),w=this.drawDonut(k,l,n,m,q,u,{stroke:this.color(s),fill:"transparent"});if(this.brush.showText){var x=this.getFormatText(o[s],t),y=this.drawText(k,l,q+u/2-90,m,x,1.25);this.addEvent(y,a,s),d.append(y)}this.addEvent(w,a,s),d.append(w),q+=u}}};return d.setup=function(){return{size:50}},d},"chart.brush.pie"),jui.define("chart.brush.clock",["util.math"],function(a){var b=function(){var b,c,d;this.drawInnerCircle=function(a,b,c){return this.chart.svg.circle({cx:b,cy:c,r:10})},this.drawInnerCircle2=function(a,b,c){return this.chart.svg.circle({cx:b,cy:c,r:5,fill:"white"})},this.drawOuterCircle=function(a,b,c){return this.chart.svg.circle({cx:b,cy:c,r:a-10,fill:"transparent",stroke:"black","stroke-width":5})},this.drawSecond=function(b,c,d,e,f,g,h){var i=6,j=i/1e3,k=a.radian(i*g+j*h),l=a.rotate(0,-(b-20),k);return this.chart.svg.line({x1:c,y1:d,x2:c+l.x,y2:d+l.y,stroke:"black"})},this.drawMinute=function(b,c,d,e,f,g,h){var i=(this.chart.svg.group().translate(c,d),6),j=i/60,k=j/1e3,l=a.radian(i*f+j*g+k*h),m=a.rotate(0,-(b-40),l);return this.chart.svg.line({x1:c,y1:d,x2:c+m.x,y2:d+m.y,stroke:"black","stroke-width":5})},this.drawHour=function(b,c,d,e,f,g,h){var i=30,j=i/60,k=j/60,l=k/1e3,m=a.radian(i*e+j*f+k*g+l*h),n=a.rotate(0,-(b-50),m);return this.chart.svg.line({x1:c,y1:d,x2:c+n.x,y2:d+n.y,stroke:"black","stroke-width":7})},this.drawLine=function(b,c,d){for(var e=this.chart.svg.group().translate(c,d),f=30,g=f/5,h=1;12>=h;h++){var i=a.radian(f*h),j=a.rotate(0,-(b-10),i),k=a.rotate(0,-(b-20),i),l=a.rotate(0,-(b-30),i),m=this.chart.svg.line({x1:j.x,y1:j.y,x2:k.x,y2:k.y,stroke:"black","stroke-width":2});e.append(m);for(var n=a.radian(f*(h-1)),o=1;4>=o;o++){var i=n+a.radian(g*o),j=a.rotate(0,-(b-10),i),k=a.rotate(0,-(b-15),i),m=this.chart.svg.line({x1:j.x,y1:j.y,x2:k.x,y2:k.y,stroke:"black","stroke-width":2});e.append(m)}e.append(this.chart.text({x:l.x,y:l.y+6,"text-anchor":"middle",stroke:"black"},h))}return e},this.drawUnit=function(a,e,f){var g=this.axis.c(a),h=g.width,i=g.height,j=g.x,k=g.y;b=Math.min(h,i)/2,c=h/2+j,d=i/2+k;var l=new Date,m=this.getValue(e,"hour",l.getHours()),n=this.getValue(e,"minute",l.getMinutes()),o=this.getValue(e,"second",l.getSeconds()),p=l.getMilliseconds();return f.append(this.drawOuterCircle(b,c,d)),f.append(this.drawInnerCircle(b,c,d)),f.append(this.drawLine(b,c,d)),f.append(this.drawSecond(b,c,d,m,n,o,p)),f.append(this.drawMinute(b,c,d,m,n,o,p)),f.append(this.drawHour(b,c,d,m,n,o,p)),f.append(this.drawInnerCircle2(b,c,d)),f},this.draw=function(){var a=this.chart.svg.group();return this.eachData(function(b,c){this.drawUnit(b,c,a)}),a}};return b},"chart.brush.core"),jui.define("chart.brush.scatter",[],function(){var a=function(){this.createScatter=function(a,b){var c=this,d=null,e=this.chart.get("series",this.brush.target[b]),f=e.symbol?e.symbol:this.brush.symbol,g=h=this.brush.size,i=this.color(b),j=this.chart.theme("scatterBorderColor"),k=this.chart.theme("scatterBorderWidth");return d="triangle"==f||"cross"==f?this.chart.svg.group({width:g,height:h},function(){if("triangle"==f){var a=c.chart.svg.polygon();a.point(0,h).point(g,h).point(g/2,0)}else c.chart.svg.line({stroke:i,"stroke-width":2*k,x1:0,y1:0,x2:g,y2:h}),c.chart.svg.line({stroke:i,"stroke-width":2*k,x1:0,y1:g,x2:h,y2:0})}).translate(a.x-g/2,a.y-h/2):"rectangle"==f?this.chart.svg.rect({width:g,height:h,x:a.x-g/2,y:a.y-h/2}):this.chart.svg.ellipse({rx:g/2,ry:h/2,cx:a.x,cy:a.y}),"cross"!=f&&d.attr({fill:i,stroke:j,"stroke-width":k}).hover(function(){d.attr({fill:c.chart.theme("scatterHoverColor"),stroke:i,"stroke-width":2*k})},function(){d.attr({fill:i,stroke:j,"stroke-width":k})}),d},this.drawScatter=function(a){for(var b=this.chart.svg.group(),c=0;c<a.length;c++)for(var d=0;d<a[c].length;d++){var e=this.createScatter({x:a[c].x[d],y:a[c].y[d],max:a[c].max[d],min:a[c].min[d],value:a[c].value[d]},c);this.addEvent(e,d,c),b.append(e)}return b},this.draw=function(){return this.drawScatter(this.getXY())},this.drawAnimate=function(){var a=this.chart.area();return this.chart.svg.animateTransform({attributeName:"transform",type:"translate",from:a.x+" "+a.height,to:a.x+" "+a.y,begin:"0s",dur:"0.4s",repeatCount:"1"})}};return a.setup=function(){return{symbol:"circle",size:7,clip:!1}},a},"chart.brush.core"),jui.define("chart.brush.scatterpath",["util.base"],function(a){var b=function(){this.drawScatter=function(b){for(var c=height=this.brush.size,d=this.color(0),e=this.brush.strokeWidth,f={fill:"none",stroke:d,"stroke-width":e,"stroke-opacity":1,"stroke-linecap":"butt","stroke-linejoin":"round"},g=this.chart.svg.group(),h=this.chart.svg.pathSymbol(),i=h.template(c,height),j=5,k=[],l=1;j>=l;l++)k[l]=this.chart.svg.pathSymbol(f);for(var m=a.loop(b[0].x.length),l=0;l<b.length;l++){var n=this.chart.get("series",this.brush.target[l]),o=n&&n.symbol?n.symbol:this.brush.symbol;m(function(a,c){k[c].add(0|b[l].x[a],0|b[l].y[a],i[o])})}for(var l=1;j>=l;l++)g.append(k[l]);return h.remove(),g},this.draw=function(){return this.drawScatter(this.getXY(!1))}};return b.setup=function(){return{symbol:"circle",size:7,strokeWidth:1}},b},"chart.brush.core"),jui.define("chart.brush.bargauge",[],function(){var a=function(a,b,c){this.draw=function(){var d=a.svg.group(),e=b.c(0),f=e.width,g=e.x,h=e.y;return this.eachData(function(b,e){var i=a.svg.group(),j=this.getValue(e,"value",0),k=this.getValue(e,"title",""),l=this.getValue(e,"max",100),m=this.getValue(e,"min",0),n=f/(l-m)*j,o=h+c.size/2+c.cut-1;i.append(a.svg.rect({x:g+c.cut,y:h,width:f,height:c.size,fill:a.theme("bargaugeBackgroundColor")})),i.append(a.svg.rect({x:g,y:h,width:n,height:c.size,fill:a.color(b,c)})),i.append(a.text({x:g+c.cut,y:o,"text-anchor":"start","font-size":a.theme("bargaugeFontSize"),fill:a.theme("bargaugeFontColor")},k)),i.append(a.text({x:f-c.cut,y:o,"text-anchor":"end","font-size":a.theme("bargaugeFontSize"),fill:a.theme("bargaugeFontColor")},this.format(j,b))),this.addEvent(i,b,null),d.append(i),h+=c.size+c.cut}),d}};return a.setup=function(){return{cut:5,size:20,format:null}},a},"chart.brush.core"),jui.define("chart.brush.circlegauge",[],function(){var a=function(a,b){var c,d,e,f,g;this.drawUnit=function(h,i){var j=b.c(h),k=this.getValue(i,"value",0),l=this.getValue(i,"max",100),m=this.getValue(i,"min",0),n=(k-m)/(l-m),o=j.width,p=j.height,q=j.x,r=j.y;d=Math.min(o,p)/2,e=o/2+q,f=p/2+r,g=d,c.append(a.svg.circle({cx:e,cy:f,r:g,fill:a.theme("gaugeBackgroundColor"),stroke:this.color(0),"stroke-width":2})),c.append(a.svg.circle({cx:e,cy:f,r:g*n,fill:this.color(0)})),this.addEvent(c,null,null)},this.draw=function(){return c=a.svg.group(),this.eachData(function(a,b){this.drawUnit(a,b)}),c}};return a.setup=function(){return{clip:!1}},a},"chart.brush.core"),jui.define("chart.brush.fillgauge",["jquery","util.base"],function(a,b){var c=function(c,d,e){function f(a){var b=(e.value-e.min)/(e.max-e.min);if("vertical"==a)var d=c.area("height")*b,f=c.area("width"),g=0,h=c.area("height")-d;else var d=c.area("height"),f=c.area("width")*b,g=0,h=0;m.attr({x:g,y:h,width:f,height:d})}function g(a,b){a.append(c.svg.path({x:0,y:0,fill:c.theme("gaugeBackgroundColor"),d:b})),a.append(c.svg.path({x:0,y:0,fill:n.color(0),d:b,"clip-path":"url(#"+l+")"}))}var h,i,j,k,l,m,n=this;this.drawBefore=function(){var a=a||{},d=a.c(),e=d.width,f=d.height,g=d.x,n=d.y,o=e;o>f&&(o=f),h=o/2,i=e/2+g,j=f/2+n,k=h,l=b.createId("fill-gauge");var p=c.svg.clipPath({id:l});m=c.svg.rect({x:0,y:0,width:0,height:0}),p.append(m),c.defs.append(p)},this.draw=function(){var b=c.svg.group({opacity:.8});return f(e.direction),""!=e.svg||""!=e.path?""!=e.svg?a.ajax({url:e.svg,async:!1,success:function(c){var d=a(c).find("path").attr("d");g(b,d)}}):g(b,e.path):"circle"==e.shape?(b.append(c.svg.circle({cx:i,cy:j,r:k,fill:c.theme("gaugeBackgroundColor")})),b.append(c.svg.circle({cx:i,cy:j,r:k,fill:c.color(0,e),"clip-path":"url(#"+l+")"}))):"rectangle"==e.shape&&(b.append(c.svg.rect({x:0,y:0,width:c.area("width"),height:c.area("height"),fill:c.theme("gaugeBackgroundColor")})),b.append(c.svg.rect({x:0,y:0,width:c.area("width"),height:c.area("height"),fill:this.color(0),"clip-path":"url(#"+l+")"}))),b}};return c.setup=function(){return{min:0,max:100,value:0,shape:"circle",direction:"vertical",svg:"",path:""}},c},"chart.brush.core"),jui.define("chart.brush.area",[],function(){var a=function(){this.drawArea=function(a){for(var b=this.chart.svg.group(),c=this.axis.y(this.axis.y.min()),d=0;d<a.length;d++){var e=this.createLine(a[d],d),f=a[d].x;a[d].length>0&&(e.LineTo(f[f.length-1],c),e.LineTo(f[0],c),e.ClosePath()),e.attr({fill:this.color(d),"fill-opacity":this.chart.theme("areaBackgroundOpacity"),"stroke-width":0}),this.addEvent(e,null,d),b.prepend(e)}return b},this.draw=function(){return this.drawArea(this.getXY())},this.drawAnimate=function(a){a.append(this.chart.svg.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.5s",repeatCount:"1",fill:"freeze"}))}};return a},"chart.brush.line"),jui.define("chart.brush.stackline",[],function(){var a=function(){this.draw=function(){return this.drawLine(this.getStackXY())}};return a},"chart.brush.line"),jui.define("chart.brush.stackarea",[],function(){var a=function(){this.draw=function(){return this.drawArea(this.getStackXY())}};return a},"chart.brush.area"),jui.define("chart.brush.stackscatter",[],function(){var a=function(){this.draw=function(){return this.drawScatter(this.getStackXY())}};return a},"chart.brush.scatter"),jui.define("chart.brush.gauge",["util.math"],function(a){var b=function(){function b(b,c,g,i,j,k){var l=h.chart.svg.group({"class":"gauge text"}).translate(d,e);l.append(h.chart.svg.text({x:0,y:h.brush.arrow?70:10,"text-anchor":"middle","font-size":"3em","font-weight":1e3,fill:h.color(0)},j+"")),""!=k&&l.append(h.chart.text({x:0,y:100,"text-anchor":"middle","font-size":"1.5em","font-weight":500,fill:h.chart.theme("gaugeFontColor")},k));var m=0,n=-f,o=a.rotate(m,n,a.radian(b));m=o.x,n=o.y,l.append(h.chart.text({x:o.x+30,y:o.y+20,"text-anchor":"middle",fill:h.chart.theme("gaugeFontColor")},g+""));var o=a.rotate(m,n,a.radian(c));return l.append(h.chart.text({x:o.x-20,y:o.y+20,"text-anchor":"middle",fill:h.chart.theme("gaugeFontColor")},i+"")),l}var c,d,e,f,g,h=this;this.drawBefore=function(){},this.drawUnit=function(a,h,i){var j=this.axis.c(a),k=this.getValue(h,"value",0),l=this.getValue(h,"max",100),m=this.getValue(h,"min",0),n=this.getValue(h,"unit"),o=this.brush.startAngle,p=this.brush.endAngle;p>=360&&(p=359.99999);var q=(k-m)/(l-m),r=p*q;r>p&&(r=p);var s=j.width,t=j.height,u=j.x,v=j.y;return c=Math.min(s,t)/2,d=s/2+u,e=t/2+v,f=c-this.brush.size/2,g=f-this.brush.size,i.append(this.drawDonut(d,e,g,f,o+r,p-r,{fill:"transparent",stroke:this.chart.theme("gaugeBackgroundColor")})),i.append(this.drawDonut(d,e,g,f,o,r,{fill:"transparent",stroke:this.color(0)})),i.append(b(o,p,m,l,k,n)),i},this.draw=function(){var a=this.chart.svg.group();return this.eachData(function(b,c){this.drawUnit(b,c,a)}),a}};return b.setup=function(){return{size:30,startAngle:0,endAngle:360}},b},"chart.brush.donut"),jui.define("chart.brush.fullgauge",["util.math"],function(){var a=function(){function a(a,b){var c=j.chart.svg.group().translate(e,f);return c.append(j.chart.text({"text-anchor":"middle","font-size":j.chart.theme("gaugeFontSize"),"font-weight":j.chart.theme("gaugeFontWeight"),fill:j.color(0),y:k},j.format(a,b)).scale(i)),c}function b(a,b,c){var d=j.chart.svg.group().translate(e+b,f+c),g=0==b?"middle":0>b?"end":"start";return d.append(j.chart.text({"text-anchor":g,"font-size":j.chart.theme("gaugeTitleFontSize"),"font-weight":j.chart.theme("gaugeTitleFontWeight"),fill:j.chart.theme("gaugeTitleFontColor"),y:k},a).scale(i)),d}var c,d,e,f,g,h,i,j=this,k=5;this.drawUnit=function(j,k){var l=this.axis.c(j),m=this.getValue(k,"value",0),n=this.getValue(k,"title"),o=this.getValue(k,"max",100),p=this.getValue(k,"min",0),q=this.brush.startAngle,r=this.brush.endAngle;r>=360&&(r=359.99999);var s=(m-p)/(o-p),t=r*s;t>r&&(t=r);var u=l.width,v=l.height,w=l.x,x=l.y;return d=Math.min(u,v)/2,e=u/2+w,f=v/2+x,g=d-this.brush.size,h=g-this.brush.size,i=this.getScaleValue(d,40,400,1,1.5),c.append(this.drawDonut(e,f,h,g,q+t,r-t,{stroke:this.chart.theme("gaugeBackgroundColor"),fill:"transparent"})),c.append(this.drawDonut(e,f,h,g,q,t,{stroke:this.color(0),fill:"transparent"})),this.brush.showText&&c.append(a(m,j)),""!=n&&c.append(b(n,this.brush.titleX,this.brush.titleY)),c},this.draw=function(){return c=this.chart.svg.group(),this.eachData(function(a,b){this.drawUnit(a,b)}),c}};return a.setup=function(){return{size:60,startAngle:0,endAngle:360,showText:!0,titleX:0,titleY:0,format:null}},a},"chart.brush.donut"),jui.define("chart.brush.stackgauge",["util.math"],function(){var a=function(a,b,c){var d,e,f,g;this.drawBefore=function(){b.c||(b.c=function(){return{x:0,y:0,width:a.area("width"),height:a.area("height")}});var c=b.c(),h=c.width,i=c.height,j=c.x,k=c.y,l=h;l>i&&(l=i),d=l/2,e=h/2+j,f=i/2+k,g=d},this.draw=function(){var b=a.svg.group();return this.eachData(function(d,h){var i=(h[c.target]-c.min)/(c.max-c.min),j=c.endAngle*i,k=g-c.size+c.cut;c.endAngle>=360&&(c.endAngle=359.99999);var l=this.drawDonut(e,f,k,g,c.startAngle+j,c.endAngle-j,{fill:a.theme("gaugeBackgroundColor")});b.append(l),l=this.drawDonut(e,f,k,g,c.startAngle,j,{fill:this.color(d)},!0),b.append(l),b.append(a.text({x:e+2,y:f+Math.abs(g)-5,fill:this.color(d),"font-size":"12px","font-weight":"bold"},h[c.title]||"")),g-=c.size}),b}};return a.setup=function(){return{min:0,max:100,cut:5,size:24,startAngle:-180,endAngle:360,title:"title"}},a},"chart.brush.donut"),jui.define("chart.brush.waterfall",[],function(){var a=function(a,b,c){var d,e,f,g,h,i,j;this.drawBefore=function(){d=a.svg.group(),j=c.outerPadding,e=this.listData().length,f=b.y(0),g=b.x.rangeBand(),i=g-2*j,h=(g-2*j-(c.target.length-1))/c.target.length},this.draw=function(){var g=c.target[0],k=a.theme("waterfallLineColor");return this.eachData(function(l,m){var n=b.x(l)-i/2,o=b.y(m[g]),p=null,q=null;if(0==l||l==e-1&&c.end){var r=a.theme("waterfallEdgeBackgroundColor");p=a.svg.rect(f>=o?{x:n,y:o,width:h,height:Math.abs(f-o),fill:r}:{x:n,y:f,width:h,height:Math.abs(f-o),fill:r})}else{var s=this.getData(l-1)[g],t=m[g],u=b.y(s),v=b.y(t),w=u-v;p=a.svg.rect(w>0?{x:n,y:u-w,width:h,height:Math.abs(w),fill:a.theme("waterfallBackgroundColor")}:{x:n,y:u,width:h,height:Math.abs(w),fill:a.theme("waterfallInvertBackgroundColor")}),c.line&&(q=a.svg.line({x1:n-2*j,y1:v+w,x2:n,y2:v+w,stroke:k,"stroke-width":1,"stroke-dasharray":a.theme("waterfallLineDashArray")}),d.append(q))}this.addEvent(p,l,0),d.append(p),n+=h}),d}};return a.setup=function(){return{line:!0,end:!1,outerPadding:5}},a},"chart.brush.core"),jui.define("chart.brush.splitline",["util.base"],function(a){var b=function(){this.createLine=function(b,c){var d,e,f={stroke:this.color(c),"stroke-width":this.chart.theme("lineBorderWidth"),fill:"transparent"},g=this.brush.split,h=this.brush.symbol,i=b.x,j=b.y,k=this.chart.svg.group(),l=this.chart.svg.path(f).MoveTo(i[0],j[0]);"curve"==h&&(d=this.curvePoints(i),e=this.curvePoints(j));for(var m=0;m<i.length-1;m++){if(0==k.childrens.length&&(a.typeCheck("integer",g)&&m==g||a.typeCheck("date",g)&&this.axis.x.invert(i[m]).getTime()>=g.getTime())){var n=this.chart.theme("lineSplitBorderColor"),o=this.chart.theme("lineSplitBorderOpacity");k.append(l),f.stroke=null!=n?n:f.stroke,f["stroke-opacity"]=o,l=this.chart.svg.path(f).MoveTo(i[m],j[m])}if("step"==h){var p=i[m]+(i[m+1]-i[m])/2;l.LineTo(p,j[m]),l.LineTo(p,j[m+1])}"curve"!=h?l.LineTo(i[m+1],j[m+1]):l.CurveTo(d.p1[m],e.p1[m],d.p2[m],e.p2[m],i[m+1],j[m+1])}return k.append(l),k},this.drawLine=function(a){for(var b=this.chart.svg.group(),c=0;c<a.length;c++){var d=this.createLine(a[c],c);this.addEvent(d,null,c),b.append(d)}return b},this.draw=function(){return this.drawLine(this.getXY())}};return b.setup=function(){return{symbol:"normal",split:null}},b},"chart.brush.core"),jui.define("chart.brush.splitarea",["util.base"],function(a){var b=function(){this.drawArea=function(b){for(var c=this.chart.svg.group(),d=this.chart.area("height"),e=this.brush.split,f=this.chart.theme("areaSplitBackgroundColor"),g=0;g<b.length;g++){var h={fill:this.color(g),"fill-opacity":this.chart.theme("areaBackgroundOpacity"),"stroke-width":0},i=this.createLine(b[g],g),j=b[g].x;
if(a.typeCheck("date",e))for(var k=0;k<j.length-1;k++)if(this.axis.x.invert(j[k]).getTime()>=e.getTime()){e=k;break}i.each(function(a,b){0==a?(e=null!=e?e:j.length-1,b.LineTo(j[e],d),b.LineTo(j[0],d),b.attr(h)):(h.fill=f,b.LineTo(j[j.length-1],d),b.LineTo(j[e],d),b.attr(h)),b.ClosePath()}),this.addEvent(i,null,g),c.prepend(i)}return c},this.draw=function(){return this.drawArea(this.getXY())}};return b},"chart.brush.splitline"),jui.define("chart.brush.rangecolumn",[],function(){var a=function(a,b,c){var d,e,f,g,h,i,j,k,l;this.drawBefore=function(){d=a.svg.group(),h=c.outerPadding,i=c.innerPadding,e=b.x.rangeBand(),g=e-2*h,f=(e-2*h-(c.target.length-1)*i)/c.target.length,j=a.theme("columnBorderColor"),k=a.theme("columnBorderWidth"),l=a.theme("columnBorderOpacity")},this.draw=function(){return this.eachData(function(e,h){for(var m=b.x(e)-g/2,n=0;n<c.target.length;n++){var o=h[c.target[n]],p=b.y(o[1]),q=b.y(o[0]),r=a.svg.rect({x:m,y:p,width:f,height:Math.abs(q-p),fill:this.color(n),stroke:j,"stroke-width":k,"stroke-opacity":l});this.addEvent(r,e,n),d.append(r),m+=f+i}}),d}};return a.setup=function(){return{outerPadding:2,innerPadding:1}},a},"chart.brush.core"),jui.define("chart.brush.rangebar",[],function(){var a=function(a,b,c){var d,e,f,g,h,i,j,k,l;this.drawBefore=function(){d=a.svg.group(),h=c.outerPadding,i=c.innerPadding,e=b.y.rangeBand(),f=e-2*h,g=(f-(c.target.length-1)*i)/c.target.length,j=a.theme("barBorderColor"),k=a.theme("barBorderWidth"),l=a.theme("barBorderOpacity")},this.draw=function(){return this.eachData(function(e,h){for(var m=a.svg.group(),n=b.y(e)-f/2,o=0;o<c.target.length;o++){var p=h[c.target[o]],q=b.x(p[1]),r=b.x(p[0]),s=a.svg.rect({x:r,y:n,height:g,width:Math.abs(r-q),fill:this.color(o),stroke:j,"stroke-width":k,"stroke-opacity":l});this.addEvent(s,e,o),m.append(s),n+=g+i}d.append(m)}),d}};return a.setup=function(){return{outerPadding:2,innerPadding:1}},a},"chart.brush.core"),jui.define("chart.brush.topologynode.edge",[],function(){var a=function(a,b,c,d){var e=!1,f=null;this.key=function(){return a+":"+b},this.reverseKey=function(){return b+":"+a},this.connect=function(a){return 0==arguments.length?e:void(e=a)},this.element=function(a){return 0==arguments.length?f:void(f=a)},this.get=function(e){return"start"==e?a:"end"==e?b:"in_xy"==e?c:"out_xy"==e?d:void 0}};return a}),jui.define("chart.brush.topologynode.edgemanager",["util.base"],function(a){var b=function(){var b=[],c={};this.add=function(a){c[a.key()]=a,b.push(a)},this.get=function(a){return c[a]},this.is=function(a){return c[a]?!0:!1},this.list=function(){return b},this.each=function(c){if(a.typeCheck("function",c))for(var d=0;d<b.length;d++)c.call(this,b[d])}};return b}),jui.define("chart.brush.topologynode",["util.base","util.math","chart.brush.topologynode.edge","chart.brush.topologynode.edgemanager"],function(a,b,c,d){var e=function(e,f,g){function h(a,c,d,e,f){var g=a-d,h=c-e,i=Math.sqrt(Math.pow(g,2)+Math.pow(h,2)),f=f?f:0,j=b.angle(a,c,d,e);return{x:a+Math.cos(j)*(i+f),y:c+Math.sin(j)*(i+f),angle:j,distance:i}}function i(a){for(var b=0;b<g.edgeData.length;b++)if(g.edgeData[b].key==a)return g.edgeData[b];return null}function j(a){for(var b=0;b<g.edgeData.length;b++)if(a.key()==g.edgeData[b].key)return g.edgeData[b];return null}function k(b){var c=[],d=b.split(":");return w.eachData(function(b,e){var f=a.typeCheck("function",g.nodeTitle)?g.nodeTitle(e):"";e.key==d[0]&&(c[0]=f||e.key),e.key==d[1]&&(c[1]=f||e.key)}),c.length>0?c:b}function l(b,c){var d=f.c(b),h=e.svg.group({index:b},function(){var b=a.typeCheck("function",g.nodeColor)?g.nodeColor(c):g.nodeColor||w.color(0),d=a.typeCheck("function",g.nodeTitle)?g.nodeTitle(c):"",f=a.typeCheck("function",g.nodeText)?g.nodeText(c):"";a.typeCheck("function",g.nodeImage)?e.svg.image({"xlink:href":g.nodeImage(c),width:2*u,height:2*u,x:-u,y:-u,cursor:"pointer"}):e.svg.circle({r:u,fill:b,cursor:"pointer"}),f&&""!=f&&e.text({x:0,y:6,fill:e.theme("topologyNodeFontColor"),"font-size":e.theme("topologyNodeFontSize"),"text-anchor":"middle",cursor:"pointer"},f),d&&""!=d&&e.text({x:0,y:u+13,fill:e.theme("topologyNodeTitleFontColor"),"font-size":e.theme("topologyNodeTitleFontSize"),"font-weight":"bold","text-anchor":"middle",cursor:"pointer"},d)}).translate(d.x,d.y);return h.on("click",function(a){e.emit("topology.nodeclick",[c,a])}),h}function m(){x.each(function(a){var b=a.get("in_xy"),c=a.get("out_xy"),d=e.svg.group();d.append(n(a,b,c)),d.append(o(a,b,c)),s.append(d)})}function n(a,b,c){var d=e.svg.group();return a.connect()||d.append(e.svg.line({cursor:"pointer",x1:b.x,y1:b.y,x2:c.x,y2:c.y,stroke:e.theme("topologyEdgeColor"),"stroke-width":1,"shape-rendering":"geometricPrecision"})),d.append(e.svg.circle({fill:e.theme("topologyEdgeColor"),stroke:e.theme("backgroundColor"),"stroke-width":2,r:v,cx:c.x,cy:c.y})),d.on("click",function(b){r(a,b)}),a.element(d),d}function o(c,d,f){var h=null,j=f.x>d.x?"end":"start",k=i(c.key());if(null!=k){var l=a.typeCheck("function",g.edgeText)?g.edgeText(k,j):null;null!=l&&(h="end"==j?e.svg.text({x:f.x-9,y:f.y+13,cursor:"pointer",fill:e.theme("topologyEdgeFontColor"),"font-size":e.theme("topologyEdgeFontSize"),"text-anchor":j},l).rotate(b.degree(f.angle),f.x,f.y):e.svg.text({x:f.x+8,y:f.y-7,cursor:"pointer",fill:e.theme("topologyEdgeFontColor"),"font-size":e.theme("topologyEdgeFontSize"),"text-anchor":j},l).rotate(b.degree(d.angle),f.x,f.y),h.on("click",function(a){r(c,a)}))}return h}function p(a,b){var d=w.getData(a),e=w.getValue(d,"outgoing",[])[b],g=f.c(e),i=f.c(a),j=u+v+1,k=h(g.x,g.y,i.x,i.y,-j),l=h(i.x,i.y,g.x,g.y,-j),m=new c(w.getValue(d,"key"),e,k,l);x.is(m.reverseKey())&&m.connect(!0),x.add(m)}function q(b,c){if(a.typeCheck("function",g.tooltipTitle)&&a.typeCheck("function",g.tooltipText)){var d=t.get(0);text=t.get(1),d.attr({points:""}),text.element.textContent="";var f=j(b),h=b.get("in_xy"),i=b.get("out_xy"),l=i.x>h.x?"end":"start";if(e.emit("topology.edgeclick",[f,c]),null!=f){var m=document.createElementNS("http://www.w3.org/2000/svg","tspan"),n=document.createElementNS("http://www.w3.org/2000/svg","tspan"),o=2*z+("end"==l?A:0);text.element.appendChild(m),text.element.appendChild(n),m.setAttribute("x",z),m.setAttribute("y",o),m.setAttribute("font-weight","bold"),m.textContent=g.tooltipTitle(k(f.key),l),n.setAttribute("x",z),n.setAttribute("y",o+y+z/2),n.textContent=g.tooltipText(f,l);var p=e.scale(),q=text.size(),r=(q.width+2*z)/p,s=(q.height+2*z)/p,u=i.x-r/2+A/2+v/2;text.attr({x:r/2}),d.attr({points:w.balloonPoints("end"==l?"bottom":"top",r,s,A)}),t.attr({visibility:"visible"}),"end"==l?t.translate(u,i.y+A/2+v):t.translate(u,i.y-A-s+v)}}}function r(a){x.each(function(b){var c=b.element(),d=c.get(2==c.childrens.length?1:0),f=2==c.childrens.length?c.get(0):null,g=e.theme("topologyEdgeColor"),h=e.theme("topologyActiveEdgeColor");null==a||a.key()!=b.key()&&a.reverseKey()!=b.key()?(null!=f&&f.attr({stroke:g,"stroke-width":1}),d.attr({fill:g})):(null!=f&&f.attr({stroke:h,"stroke-width":2}),d.attr({fill:h}),a.key()==b.key()&&q(a))})}var s,t,u,v,w=this,x=new d,y=14,z=7,A=7;this.drawBefore=function(){s=e.svg.group(),u=e.theme("topologyNodeRadius"),v=e.theme("topologyEdgePointRadius"),t=e.svg.group({visibility:"hidden"},function(){e.svg.polygon({fill:e.theme("topologyTooltipBackgroundColor"),stroke:e.theme("topologyTooltipBorderColor"),"stroke-width":1}),e.text({"font-size":e.theme("topologyTooltipFontSize"),fill:e.theme("topologyTooltipFontColor"),y:y})})},this.draw=function(){return this.eachData(function(a,b){for(var c=0;c<b.outgoing.length;c++)p(a,c)}),m(),this.eachData(function(a,b){s.append(l(a,b))}),this.on("chart.mousedown",function(a){e.svg.root.element==a.target&&(r(null,a),t.attr({visibility:"hidden"}))}),a.typeCheck("string",g.activeEdge)&&this.on("render",function(a){if(!a){var b=x.get(g.activeEdge);r(b)}}),s}};return e.setup=function(){return{clip:!1,nodeTitle:null,nodeText:null,nodeImage:null,nodeColor:null,edgeData:[],edgeText:null,tooltipTitle:null,tooltipText:null,activeEdge:null}},e},"chart.brush.core"),jui.define("chart.brush.focus",[],function(){var a=function(a,b,c){var d;this.drawFocus=function(b,e){var f=a.theme("focusBorderColor"),g=a.theme("focusBorderWidth"),h=a.theme("focusBackgroundColor"),i=a.theme("focusBackgroundOpacity"),j=a.area("height");return d=a.svg.group({},function(){var d=b,k=e;c.hide||(a.svg.line({stroke:f,"stroke-width":g,x1:0,y1:0,x2:0,y2:j}).translate(d,0),a.svg.rect({width:Math.abs(k-d),height:j,fill:h,opacity:i}).translate(d,0),a.svg.line({stroke:f,"stroke-width":g,x1:0,y1:0,x2:0,y2:j}).translate(k,0))})},this.draw=function(){var a=0,d=0;return-1==c.start||-1==c.end?this.chart.svg.g():("block"==b.x.type?(a=b.x(c.start)-b.x.rangeBand()/2,d=b.x(c.end)+b.x.rangeBand()/2):(a=b.x(c.start),d=b.x(c.end)),this.drawFocus(a,d))}};return a.setup=function(){return{start:-1,end:-1}},a},"chart.brush.core"),jui.define("chart.brush.pin",[],function(){var a=function(a,b,c){var d=this;this.draw=function(){var e=c.size,f=a.theme("pinBorderColor"),g=a.theme("pinBorderWidth"),h=a.svg.group({},function(){var h=b.x(c.split),i=h-e/2,j=d.format(b.x.invert(h));a.text({"text-anchor":"middle","font-size":a.theme("pinFontSize"),fill:a.theme("pinFontColor")},j).translate(h,-4),a.svg.polygon({fill:f}).point(e,0).point(e/2,e).point(0,0).translate(i,0),a.svg.line({stroke:f,"stroke-width":g,x1:e/2,y1:0,x2:e/2,y2:a.area("height")}).translate(i,0)});return h}};return a.setup=function(){return{size:6,split:0,showValue:!1,format:null}},a},"chart.brush.core"),jui.define("chart.widget.core",["jquery","util.base"],function(a,b){var c=function(){function c(a){var c=[0];return b.typeCheck("array",a)?c=a:b.typeCheck("integer",a)&&(c=[a]),c}this.drawAfter=function(a){a.attr({"class":"widget widget-"+this.widget.type})},this.eachBrush=function(a){if(b.typeCheck("function",a))for(var d=c(this.widget.brush),e=0;e<d.length;e++)a.apply(this,[e,this.chart.get("brush",d[e])])},this.listBrush=function(){for(var a=c(this.widget.brush),b=[],d=0;d<a.length;d++)b[d]=this.chart.get("brush",a[d]);return b},this.getBrush=function(a){return this.listBrush()[a]},this.existBrush=function(b){var d=c(this.widget.brush);return-1==a.inArray(b,d)?!1:!0},this.isRender=function(){return this.widget.render===!0?!0:!1},this.on=function(a,b){return this.chart.on(a,b,this.isRender()?"render":"renderAll")}};return c.setup=function(){return{brush:0,render:!1,index:0}},c},"chart.draw"),jui.define("chart.widget.tooltip",["jquery"],function(){var a=function(a,b,c){function d(a,b){if(!n[a]){var c=document.createElementNS("http://www.w3.org/2000/svg","tspan");h.element.appendChild(c),n[a]=c}n[a].textContent=b}function e(a,b,d){return"function"==typeof c.format?j.format(a,b,d):b?a+": "+j.format(b):a}function f(b){if(b.dataKey&&c.all===!1){var f=a.get("series",b.dataKey),g=b.dataKey,i=null!=b.data?b.data[g]:null;"bottom"==c.orient&&h.attr({y:m+l});var j=e(f.text?f.text:g,i,b.data);d(0,j),h.attr({"text-anchor":"middle"})}else{for(var o=b.brush,p=0;p<o.target.length;p++){var q=o.target[p],f=a.get("series",q),r=k,s=m*p+2*k,i=null!=b.data?b.data[q]:null;"bottom"==c.orient&&(s+=l);var j=e(f.text?f.text:q,i,b.data);d(p,j),n[p].setAttribute("x",r),n[p].setAttribute("y",s)}h.attr({"text-anchor":"inherit"})}}var g,h,i,j=this,k=7,l=7,m=14,n=[];this.drawBefore=function(){g=a.svg.group({visibility:"hidden"},function(){i=a.svg.polygon({fill:a.theme("tooltipBackgroundColor"),"fill-opacity":a.theme("tooltipBackgroundOpacity"),stroke:a.theme("tooltipBorderColor"),"stroke-width":1}),h=a.text({"font-size":a.theme("tooltipFontSize"),fill:a.theme("tooltipFontColor"),y:m})})},this.draw=function(){var a,b,d=this,e=!1;return this.on("mouseover",function(j){if(!e&&d.existBrush(j.brush.index)&&(j.dataKey||j.data)){f(j);var m=h.size();a=m.width+2*k,b=m.height+k,h.attr({x:a/2}),i.attr({points:d.balloonPoints(c.orient,a,b,l)}),g.attr({visibility:"visible"}),e=!0}}),this.on("mousemove",function(d,f){if(e){var h=f.bgX-a/2,i=f.bgY-b-l-k/2;("left"==c.orient||"right"==c.orient)&&(i=f.bgY-b/2-k/2),"left"==c.orient?h=f.bgX-a-l:"right"==c.orient?h=f.bgX+l:"bottom"==c.orient&&(i=f.bgY+2*l),g.translate(h,i)}}),this.on("mouseout",function(){e&&(g.attr({visibility:"hidden"}),e=!1)}),g}};return a.setup=function(){return{orient:"top",all:!1,format:null}},a},"chart.widget.core"),jui.define("chart.widget.title",[],function(){var a=function(a,b,c){var d=0,e=0,f="middle";this.drawBefore=function(){e="bottom"==c.orient?a.area("y2")+a.padding("bottom")-20:"top"==c.orient?20:a.area("y")+a.area("height")/2,"center"==c.align?(d=a.area("x")+a.area("width")/2,f="middle"):"start"==c.align?(d=a.area("x"),f="start"):(d=a.area("x2"),f="end")},this.draw=function(){var b=a.svg.getTextRect(c.text),g=b.width/2,h=b.height/2,i=a.text({x:d+c.dx,y:e+c.dy,"text-anchor":f,"font-size":c.size||a.theme("titleFontSize"),"font-weight":a.theme("titleFontWeight"),fill:a.theme("titleFontColor")},c.text);return"center"==c.orient&&("start"==c.align?i.rotate(-90,d+c.dx+g,e+c.dy+h):"end"==c.align&&i.rotate(90,d+c.dx-g,e+c.dy+h)),i}};return a.setup=function(){return{orient:"top",align:"center",text:"",dx:0,dy:0,size:null}},a},"chart.widget.core"),jui.define("chart.widget.legend",["util.base"],function(){var a=function(a,b,c){function d(a){if(c.filter){f[a.index]||(f[a.index]={});for(var b=0;b<a.target.length;b++)f[a.index][a.target[b]]=!0}}function e(b){var c=[],d=b[0].index;for(var e in f[d])f[d][e]&&c.push(e);for(var g=0;g<b.length;g++)a.updateBrush(b[g].index,{target:c});a.isRender()||a.render(),a.emit("legend.filter",[c])}var f=[];this.getLegendIcon=function(b){for(var d=this,g=[],h=b.target,i=h.length,j=0,k=0;i>k;k++){var l=a.svg.group(),m=b.target[k],n=a.get("series",m).text||m,o=a.svg.getTextRect(n),p=Math.min(o.width,o.height),q=p;0==k&&(j=p),l.append(a.svg.rect({x:0,y:0,width:j,height:j,fill:a.color(k,b)})),l.append(a.text({x:p+4,y:11,"font-size":a.theme("legendFontSize"),fill:a.theme("legendFontColor"),"text-anchor":"start"},n)),g.push({icon:l,width:p+4+o.width+10,height:q+4}),c.filter&&!function(a,g){g.attr({cursor:"pointer"}),g.on("click",function(){f[b.index][a]?(g.attr({opacity:.7}),f[b.index][a]=!1):(g.attr({opacity:1}),f[b.index][a]=!0),e(c.brushSync?d.listBrush():[b])})}(m,l)}return g},this.draw=function(){var b=a.svg.group(),e=0,f=0,g=0,h=0,i=0,j=0;if(this.eachBrush(function(a,k){if(!c.brushSync||0==a){for(var l=this.getLegendIcon(k),m=0;m<l.length;m++)b.append(l[m].icon),l[m].icon.translate(e,f),"bottom"==c.orient||"top"==c.orient?(e+=l[m].width,g+=l[m].width,j<l[m].height&&(j=l[m].height)):(f+=l[m].height,h+=l[m].height,i<l[m].width&&(i=l[m].width));d(k)}}),"bottom"==c.orient||"top"==c.orient){var f="bottom"==c.orient?a.area("y2")+a.padding("bottom")-j:a.area("y")-a.padding("top");"start"==c.align?e=a.area("x"):"center"==c.align?e=a.area("x")+(a.area("width")/2-g/2):"end"==c.align&&(e=a.area("x2")-g)}else{var e="left"==c.orient?a.area("x")-a.padding("left"):a.area("x2")+a.padding("right")-i;"start"==c.align?f=a.area("y"):"center"==c.align?f=a.area("y")+(a.area("height")/2-h/2):"end"==c.align&&(f=a.area("y2")-h)}return b.translate(Math.floor(e),Math.floor(f)),b}};return a.setup=function(){return{orient:"bottom",align:"center",filter:!1,brushSync:!1}},a},"chart.widget.core"),jui.define("chart.widget.scroll",["util.base"],function(){var a=function(a,b){function c(c,g){function h(c){if(l){var h=n+c.bgX-m;0>h?h=0:h+d>a.area("width")&&(h=a.area("width")-d),g.translate(h,1),e=h;var k=h*j,o=0==k?0:Math.floor(k/i);h+d==a.area("width")&&(o+=1),b.zoom(o,o+f),a.isRender()||a.render()}}function k(){l&&(l=!1,m=0,n=0)}var l=!1,m=0,n=0;c.on("bg.mousedown",function(a){l&&g.element!=a.target||(l=!0,m=a.bgX,n=e)}),c.on("bg.mousemove",h),c.on("bg.mouseup",k),c.on("chart.mousemove",h),c.on("chart.mouseup",k)}var d=0,e=0,f=0,g=0,h=0,i=0,j=0;this.drawBefore=function(){g=b.origin.length,f=b.buffer,i=a.area("width")/f,h=i*g,j=h/a.area("width"),d=a.area("width")*(f/g)+2},this.draw=function(){var b=this;return a.svg.group({},function(){a.svg.rect({width:a.area("width"),height:7,fill:a.theme("scrollBackgroundColor")});var f=a.svg.rect({width:d,height:5,fill:a.theme("scrollThumbBackgroundColor"),stroke:a.theme("scrollThumbBorderColor"),cursor:"pointer","stroke-width":1}).translate(e,1);c(b,f)}).translate(a.area("x"),a.area("y2"))}};return a},"chart.widget.core"),jui.define("chart.widget.zoom",["util.base"],function(){var a=function(a,b){function c(c,d,e){function f(){if(h=!1,0!=j){var c=a.area("width")/(b.end-b.start),d=(j>0?i:i+j)-a.padding("left"),f=Math.floor(d/c)+b.start,k=Math.ceil((d+Math.abs(j))/c)+b.start;k>f&&(b.zoom(f,k),e.attr({visibility:"visible"}),a.isRender()||a.render()),g()}}function g(){h=!1,i=0,j=0,d.attr({width:0})}var h=!1,i=0,j=0;c.on("chart.mousedown",function(a){h||(h=!0,i=a.bgX)}),c.on("chart.mousemove",function(b){h&&(j=b.bgX-i,j>0?(d.attr({width:j}),d.translate(i,a.area("y"))):(d.attr({width:Math.abs(j)}),d.translate(i+j,a.area("y"))))}),c.on("chart.mouseup",f),c.on("bg.mouseup",f),c.on("bg.mouseout",f)}this.draw=function(){var d=this,e=a.area("width"),f=a.area("height"),g=12;return a.svg.group({},function(){var h=a.svg.rect({height:f,fill:a.theme("zoomBackgroundColor"),opacity:.3}),i=a.svg.group({visibility:"hidden"},function(){a.svg.rect({width:e,height:f,fill:a.theme("zoomFocusColor"),opacity:.2}),a.svg.group({cursor:"pointer"},function(){a.svg.circle({r:g,cx:e,cy:0,opacity:0}),a.svg.path({d:"M12,2C6.5,2,2,6.5,2,12c0,5.5,4.5,10,10,10s10-4.5,10-10C22,6.5,17.5,2,12,2z M16.9,15.5l-1.4,1.4L12,13.4l-3.5,3.5 l-1.4-1.4l3.5-3.5L7.1,8.5l1.4-1.4l3.5,3.5l3.5-3.5l1.4,1.4L13.4,12L16.9,15.5z",fill:a.theme("zoomFocusColor")}).translate(e-g,-g)}).on("click",function(){i.attr({visibility:"hidden"}),b.screen(1),a.isRender()||a.render()})}).translate(a.area("x"),a.area("y"));c(d,h,i)})}};return a},"chart.widget.core"),jui.define("chart.widget.cross",["util.base"],function(a){var b=function(b,c,d){function e(a,b,c){if(!o[a]){var d=document.createElementNS("http://www.w3.org/2000/svg","tspan");b.element.appendChild(d),o[a]=d}o[a].textContent=c}var f,g,h,i,j,k=this,l=50,m=18,n=l/10,o=[];this.drawBefore=function(){f=b.svg.group({visibility:"hidden"},function(){a.typeCheck("function",d.yFormat)&&(g=b.svg.line({x1:0,y1:0,x2:b.area("width"),y2:0,stroke:b.theme("crossBorderColor"),"stroke-width":b.theme("crossBorderWidth"),opacity:b.theme("crossBorderOpacity")}),j=b.svg.group({},function(){b.svg.polygon({fill:b.theme("crossBalloonBackgroundColor"),"fill-opacity":b.theme("crossBalloonBackgroundOpacity"),points:k.balloonPoints("left",l,m,n)}),b.text({"font-size":b.theme("crossBalloonFontSize"),fill:b.theme("crossBalloonFontColor"),"text-anchor":"middle",x:l/2,y:12})}).translate(-(l+n),0)),a.typeCheck("function",d.xFormat)&&(h=b.svg.line({x1:0,y1:0,x2:0,y2:b.area("height"),stroke:b.theme("crossBorderColor"),"stroke-width":b.theme("crossBorderWidth"),opacity:b.theme("crossBorderOpacity")}),i=b.svg.group({},function(){b.svg.polygon({fill:b.theme("crossBalloonBackgroundColor"),"fill-opacity":b.theme("crossBalloonBackgroundOpacity"),points:k.balloonPoints("bottom",l,m,n)}),b.text({"font-size":b.theme("crossBalloonFontSize"),fill:b.theme("crossBalloonFontColor"),"text-anchor":"middle",x:l/2,y:17})}).translate(0,b.area("height")+n))}).translate(b.area("x"),b.area("y"))},this.draw=function(){this.getBrush(0);return this.on("chart.mouseover",function(){f.attr({visibility:"visible"})}),this.on("chart.mouseout",function(){f.attr({visibility:"hidden"})}),this.on("chart.mousemove",function(a){var f=a.chartX+2,o=a.chartY+2;if(g&&g.attr({y1:o,y2:o}),h&&h.attr({x1:f,x2:f}),j){j.translate(-(l+n),o-m/2);var p=c.y.invert(o),q=d.yFormat.call(k.chart,p);e(0,j.get(1),q)}if(i){i.translate(f-l/2,b.area("height")+n);var p=c.x.invert(f),q=d.xFormat.call(k.chart,p);e(1,i.get(1),q)}}),f}};return b.setup=function(){return{xFormat:null,yFormat:null}},b},"chart.widget.core"),jui.define("chart.widget.topologyctrl",["util.base"],function(a){var b=function(b,c,d){function e(){function d(){a.typeCheck("string",i)&&(i=null)}l.on("chart.mousemove",function(d){if(a.typeCheck("string",i)){var e=c.c(i);e.setX(j+(d.chartX-j)),e.setY(k+(d.chartY-k)),m===!1&&(setTimeout(function(){b.render(),h(),m=!1},70),m=!0)}}),l.on("chart.mouseup",d),l.on("bg.mouseup",d),l.on("bg.mouseout",d)}function f(){$(b.root).bind("mousewheel DOMMouseScroll",function(a){return a.originalEvent.wheelDelta>0||a.originalEvent.detail<0?2>n&&(n+=.1):n>.5&&(n-=.1),b.scale(n),!1})}function g(){function c(){null!=d&&null!=e&&(d=null,e=null)}var d=null,e=null;l.on("chart.mousedown",function(b){a.typeCheck("string",i)||null==d&&null==e&&(d=o+b.x,e=p+b.y)}),l.on("chart.mousemove",function(a){if(null!=d&&null!=e){var c=b.view(d-a.x,e-a.y);o=c.x,p=c.y}}),l.on("chart.mouseup",c),l.on("bg.mouseup",c),l.on("bg.mouseout",c)}function h(){b.svg.root.get(0).each(function(b,d){var e=d.attr("class");e&&-1!=e.indexOf("topologynode")&&d.each(function(b,d){var e=parseInt(d.attr("index"));if(!isNaN(e)){var f=c.data[e];!function(b){d.on("mousedown",function(){if(!a.typeCheck("string",i)){var d=c.c(b);i=b,j=d.x,k=d.y,d.moveLast()}})}(l.axis.getValue(f,"key"))}})})}var i,j,k,l=this,m=!1,n=1,o=0,p=0;this.draw=function(){return d.zoom&&f(),d.move&&(g(),b.svg.root.attr({cursor:"move"})),e(),h(),b.svg.group()}};return b.setup=function(){return{move:!1,zoom:!1}},b},"chart.widget.core"),jui.defineUI("chartx.realtime",["jquery","util.base","util.time","chart.builder"],function(a,b,c,d){var e=function(){function e(a){for(var b=a.options,c=f(a),d=0;d<j.length&&j[d][b.axis.key].getTime()<=c[0].getTime();d++)j.splice(d,1);h.updateGrid("x",{domain:c}),h.update(j)}function f(a){var b=new Date,d=c.add(b,c.minutes,-a.options.period);return[d,b]}function g(b){var c={},d=["interval","period","axis"];for(var e in b.options)-1==a.inArray(e,d)&&(c[e]=b.options[e]);return c}var h=null,i=null,j=[];this.init=function(){var a=this.options,e=b.typeCheck("array",a.brush)?a.brush[0].target:a.brush.target,i=e;b.typeCheck("array",e)&&(i=function(a){return function(b){for(var c=[],d=0;d<a.length;d++)c.push(b[a[d]]);return c}}(e)),this.chart=d(this.selector,b.extend({axis:{x:{type:"date",domain:f(this),step:[c.minutes,a.axis.xstep],realtime:!0,format:a.axis.format,key:a.axis.key,line:a.axis.xline,hide:a.axis.xhide},y:{type:"range",domain:null!=a.axis.domain?a.axis.domain:i,step:a.axis.ystep,line:a.axis.yline,hide:a.axis.yhide},buffer:60*a.period}},g(this))),h=this.chart.get("axis",0),a.axis.data.length>0&&this.update(a.axis.data),this.start()},this.update=function(a){j=a,h.update(j)},this.clear=function(){j=[],h.update([])},this.reset=function(){this.clear(),this.stop()},this.append=function(a){var c=a;b.typeCheck("array",a)||(c=[a]),j=j.concat(c)},this.start=function(){if(null==i){var a=this;i=setInterval(function(){e(a)},1e3*this.options.interval)}},this.stop=function(){null!=i&&(clearInterval(i),i=null)}};return e.setup=function(){return{width:"100%",height:"100%",padding:{top:50,bottom:50,left:50,right:50},theme:"jennifer",style:{},series:{},brush:[],widget:[],axis:{domain:null,format:"hh:mm",key:"time",xstep:1,ystep:10,xline:!0,yline:!0,xhide:!1,yhide:!1,data:[]},interval:1,period:5}},e});