incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaven...@apache.org
Subject [17/20] git commit: Fixed BLUR-407 ConcurrentModification
Date Thu, 05 Mar 2015 23:45:33 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f4ac13f9/blur-console/src/main/webapp/public/js/blurconsole.js
----------------------------------------------------------------------
diff --git a/blur-console/src/main/webapp/public/js/blurconsole.js b/blur-console/src/main/webapp/public/js/blurconsole.js
index aeb20fe..96371f3 100644
--- a/blur-console/src/main/webapp/public/js/blurconsole.js
+++ b/blur-console/src/main/webapp/public/js/blurconsole.js
@@ -24,5 +24,5 @@ for(d=0;d<eb.yaxes.length;++d)q(lb,d+1).options=eb.yaxes[d];for(var k in pb)eb.h
 s.append(n);var o=s.children("#pieLabel"+d),p=m-o.height()/2,q=l-o.width()/2;if(o.css("top",p),o.css("left",q),0-p>0||0-q>0||k-(p+o.height())<0||j-(q+o.width())<0)return!1;if(0!=t.series.pie.label.background.opacity){var r=t.series.pie.label.background.color;null==r&&(r=b.color);var u="top:"+p+"px;left:"+q+"px;";a("<div class='pieLabelBackground' style='position:absolute;width:"+o.width()+"px;height:"+o.height()+"px;"+u+"background-color:"+r+";'></div>").css("opacity",t.series.pie.label.background.opacity).insertBefore(o)}return!0}for(var c=d,e=t.series.pie.label.radius>1?t.series.pie.label.radius:u*t.series.pie.label.radius,f=0;f<m.length;++f){if(m[f].percent>=100*t.series.pie.label.threshold&&!b(m[f],c,f))return!1;c+=m[f].angle}return!0}var d=Math.PI*t.series.pie.startAngle,e=t.series.pie.radius>1?t.series.pie.radius:u*t.series.pie.radius;y.save(),y.translate(v,w),y.scale(1,t.series.pie.tilt),y.save();for(var f=d,g=0;g<m.length;++g)m[g].startAngle=f,b(m[g].angle,m[g].color,!0);if(
 y.restore(),t.series.pie.stroke.width>0){y.save(),y.lineWidth=t.series.pie.stroke.width,f=d;for(var g=0;g<m.length;++g)b(m[g].angle,t.series.pie.stroke.color,!1);y.restore()}return h(y),y.restore(),t.series.pie.label.show?c():!0}if(s){var j=b.getPlaceholder().width(),k=b.getPlaceholder().height(),l=s.children().filter(".legend").children().width()||0;y=e,x=!1,u=Math.min(j,k/t.series.pie.tilt)/2,w=k/2+t.series.pie.offset.top,v=j/2,"auto"==t.series.pie.offset.left?(t.legend.position.match("w")?v+=l/2:v-=l/2,u>v?v=u:v>j-u&&(v=j-u)):v+=t.series.pie.offset.left;var m=b.getData(),n=0;do n>0&&(u*=d),n+=1,f(),t.series.pie.tilt<=.8&&g();while(!i()&&c>n);n>=c&&(f(),s.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>")),b.setSeries&&b.insertLegend&&(b.setSeries(m),b.insertLegend())}}function h(a){if(t.series.pie.innerRadius>0){a.save();var b=t.series.pie.innerRadius>1?t.series.pie.innerRadius:u*t.series.pie.innerRadius;a.globalCompositeOperation="destinat
 ion-out",a.beginPath(),a.fillStyle=t.series.pie.stroke.color,a.arc(0,0,b,0,2*Math.PI,!1),a.fill(),a.closePath(),a.restore(),a.save(),a.beginPath(),a.strokeStyle=t.series.pie.stroke.color,a.arc(0,0,b,0,2*Math.PI,!1),a.stroke(),a.closePath(),a.restore()}}function i(a,b){for(var c=!1,d=-1,e=a.length,f=e-1;++d<e;f=d)(a[d][1]<=b[1]&&b[1]<a[f][1]||a[f][1]<=b[1]&&b[1]<a[d][1])&&b[0]<(a[f][0]-a[d][0])*(b[1]-a[d][1])/(a[f][1]-a[d][1])+a[d][0]&&(c=!c);return c}function j(a,c){for(var d,e,f=b.getData(),g=b.getOptions(),h=g.series.pie.radius>1?g.series.pie.radius:u*g.series.pie.radius,j=0;j<f.length;++j){var k=f[j];if(k.pie.show){if(y.save(),y.beginPath(),y.moveTo(0,0),y.arc(0,0,h,k.startAngle,k.startAngle+k.angle/2,!1),y.arc(0,0,h,k.startAngle+k.angle/2,k.startAngle+k.angle,!1),y.closePath(),d=a-v,e=c-w,y.isPointInPath){if(y.isPointInPath(a-v,c-w))return y.restore(),{datapoint:[k.percent,k.data],dataIndex:0,series:k,seriesIndex:j}}else{var l=h*Math.cos(k.startAngle),m=h*Math.sin(k.startAngle),
 n=h*Math.cos(k.startAngle+k.angle/4),o=h*Math.sin(k.startAngle+k.angle/4),p=h*Math.cos(k.startAngle+k.angle/2),q=h*Math.sin(k.startAngle+k.angle/2),r=h*Math.cos(k.startAngle+k.angle/1.5),s=h*Math.sin(k.startAngle+k.angle/1.5),t=h*Math.cos(k.startAngle+k.angle),x=h*Math.sin(k.startAngle+k.angle),z=[[0,0],[l,m],[n,o],[p,q],[r,s],[t,x]],A=[d,e];if(i(z,A))return y.restore(),{datapoint:[k.percent,k.data],dataIndex:0,series:k,seriesIndex:j}}y.restore()}}return null}function k(a){m("plothover",a)}function l(a){m("plotclick",a)}function m(a,c){var d=b.offset(),e=parseInt(c.pageX-d.left),f=parseInt(c.pageY-d.top),g=j(e,f);if(t.grid.autoHighlight)for(var h=0;h<z.length;++h){var i=z[h];i.auto!=a||g&&i.series==g.series||o(i.series)}g&&n(g.series,a);var k={pageX:c.pageX,pageY:c.pageY};s.trigger(a,[k,g])}function n(a,c){var d=p(a);-1==d?(z.push({series:a,auto:c}),b.triggerRedrawOverlay()):c||(z[d].auto=!1)}function o(a){null==a&&(z=[],b.triggerRedrawOverlay());var c=p(a);-1!=c&&(z.splice(c,1),b.t
 riggerRedrawOverlay())}function p(a){for(var b=0;b<z.length;++b){var c=z[b];if(c.series==a)return b}return-1}function q(a,b){function c(a){a.angle<=0||isNaN(a.angle)||(b.fillStyle="rgba(255, 255, 255, "+d.series.pie.highlight.opacity+")",b.beginPath(),Math.abs(a.angle-2*Math.PI)>1e-9&&b.moveTo(0,0),b.arc(0,0,e,a.startAngle,a.startAngle+a.angle/2,!1),b.arc(0,0,e,a.startAngle+a.angle/2,a.startAngle+a.angle,!1),b.closePath(),b.fill())}var d=a.getOptions(),e=d.series.pie.radius>1?d.series.pie.radius:u*d.series.pie.radius;b.save(),b.translate(v,w),b.scale(1,d.series.pie.tilt);for(var f=0;f<z.length;++f)c(z[f].series);h(b),b.restore()}var r=null,s=null,t=null,u=null,v=null,w=null,x=!1,y=null,z=[];b.hooks.processOptions.push(function(a,b){b.series.pie.show&&(b.grid.show=!1,"auto"==b.series.pie.label.show&&(b.series.pie.label.show=b.legend.show?!1:!0),"auto"==b.series.pie.radius&&(b.series.pie.radius=b.series.pie.label.show?.75:1),b.series.pie.tilt>1?b.series.pie.tilt=1:b.series.pie.tilt<0&
 &(b.series.pie.tilt=0))}),b.hooks.bindEvents.push(function(a,b){var c=a.getOptions();c.series.pie.show&&(c.grid.hoverable&&b.unbind("mousemove").mousemove(k),c.grid.clickable&&b.unbind("click").click(l))}),b.hooks.processDatapoints.push(function(a,b,c,d){var f=a.getOptions();f.series.pie.show&&e(a,b,c,d)}),b.hooks.drawOverlay.push(function(a,b){var c=a.getOptions();c.series.pie.show&&q(a,b)}),b.hooks.draw.push(function(a,b){var c=a.getOptions();c.series.pie.show&&g(a,b)})}var c=10,d=.95,e={series:{pie:{show:!1,radius:"auto",innerRadius:0,startAngle:1.5,tilt:1,shadow:{left:5,top:15,alpha:.02},offset:{top:0,left:"auto"},stroke:{color:"#fff",width:1},label:{show:"auto",formatter:function(a,b){return"<div style='font-size:x-small;text-align:center;padding:2px;color:"+b.color+";'>"+a+"<br/>"+Math.round(b.percent)+"%</div>"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};a.plot.plugins.push({init:b,options:
 e,name:"pie",version:"1.1"})}(jQuery),function(a){function b(a,b,c,d){var e="categories"==b.xaxis.options.mode,f="categories"==b.yaxis.options.mode;if(e||f){var g=d.format;if(!g){var h=b;if(g=[],g.push({x:!0,number:!0,required:!0}),g.push({y:!0,number:!0,required:!0}),h.bars.show||h.lines.show&&h.lines.fill){var i=!!(h.bars.show&&h.bars.zero||h.lines.show&&h.lines.zero);g.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:i}),h.bars.horizontal&&(delete g[g.length-1].y,g[g.length-1].x=!0)}d.format=g}for(var j=0;j<g.length;++j)g[j].x&&e&&(g[j].number=!1),g[j].y&&f&&(g[j].number=!1)}}function c(a){var b=-1;for(var c in a)a[c]>b&&(b=a[c]);return b+1}function d(a){var b=[];for(var c in a.categories){var d=a.categories[c];d>=a.min&&d<=a.max&&b.push([d,c])}return b.sort(function(a,b){return a[0]-b[0]}),b}function e(b,c,e){if("categories"==b[c].options.mode){if(!b[c].categories){var g={},h=b[c].options.categories||{};if(a.isArray(h))for(var i=0;i<h.length;++i)g[h[i]]=i;else for(var j
  in h)g[j]=h[j];b[c].categories=g}b[c].options.ticks||(b[c].options.ticks=d),f(e,c,b[c].categories)}}function f(a,b,d){for(var e=a.points,f=a.pointsize,g=a.format,h=b.charAt(0),i=c(d),j=0;j<e.length;j+=f)if(null!=e[j])for(var k=0;f>k;++k){var l=e[j+k];null!=l&&g[k][h]&&(l in d||(d[l]=i,++i),e[j+k]=d[l])}}function g(a,b,c){e(b,"xaxis",c),e(b,"yaxis",c)}function h(a){a.hooks.processRawData.push(b),a.hooks.processDatapoints.push(g)}var i={xaxis:{categories:null},yaxis:{categories:null}};a.plot.plugins.push({init:h,options:i,name:"categories",version:"1.0"})}(jQuery),function(a){function b(a){function b(a,b){for(var c=null,d=0;d<b.length&&a!=b[d];++d)b[d].stack==a.stack&&(c=b[d]);return c}function c(a,c,d){if(null!=c.stack&&c.stack!==!1){var e=b(c,a.getData());if(e){for(var f,g,h,i,j,k,l,m,n=d.pointsize,o=d.points,p=e.datapoints.pointsize,q=e.datapoints.points,r=[],s=c.lines.show,t=c.bars.horizontal,u=n>2&&(t?d.format[2].x:d.format[2].y),v=s&&c.lines.steps,w=!0,x=t?1:0,y=t?0:1,z=0,A=0;;
 ){if(z>=o.length)break;if(l=r.length,null==o[z]){for(m=0;n>m;++m)r.push(o[z+m]);z+=n}else if(A>=q.length){if(!s)for(m=0;n>m;++m)r.push(o[z+m]);z+=n}else if(null==q[A]){for(m=0;n>m;++m)r.push(null);w=!0,A+=p}else{if(f=o[z+x],g=o[z+y],i=q[A+x],j=q[A+y],k=0,f==i){for(m=0;n>m;++m)r.push(o[z+m]);r[l+y]+=j,k=j,z+=n,A+=p}else if(f>i){if(s&&z>0&&null!=o[z-n]){for(h=g+(o[z-n+y]-g)*(i-f)/(o[z-n+x]-f),r.push(i),r.push(h+j),m=2;n>m;++m)r.push(o[z+m]);k=j}A+=p}else{if(w&&s){z+=n;continue}for(m=0;n>m;++m)r.push(o[z+m]);s&&A>0&&null!=q[A-p]&&(k=j+(q[A-p+y]-j)*(f-i)/(q[A-p+x]-i)),r[l+y]+=k,z+=n}w=!1,l!=r.length&&u&&(r[l+2]+=k)}if(v&&l!=r.length&&l>0&&null!=r[l]&&r[l]!=r[l-n]&&r[l+1]!=r[l-n+1]){for(m=0;n>m;++m)r[l+n+m]=r[l+m];r[l+1]=r[l-n+1]}}d.points=r}}}a.hooks.processDatapoints.push(c)}var c={series:{stack:null}};a.plot.plugins.push({init:b,options:c,name:"stack",version:"1.2"})}(jQuery),function(a){var b={isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.mat
 ch(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,getUniqueId:function(){var a=0;return function(){return a++}}(),templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return
  f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},noop:function(){}},c={wrapper:'<span class="twitter-typeahead"></span>',dropdown:'<span class="tt-dropdown-menu"></span>',dataset:'<div class="tt-dataset-%CLASS%"></div>',suggestions:'<span class="tt-suggestions"></span>',suggestion:'<div class="tt-suggestion"></div>'},d={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"bloc
 k"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};b.isMsie()&&b.mixin(d.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),b.isMsie()&&b.isMsie()<=7&&b.mixin(d.input,{marginTop:"-1px"});var e=function(){function c(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d="typeahead:";return b.mixin(c.prototype,{trigger:function(a){var b=[].slice.call(arguments,1);this.$el.trigger(d+a,b)}}),c}(),f=function(){function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift()
 ;)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0;!d&&e<a.length;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function g(){var a;return a=window.setImmediate?function(a){setImmediate(function(){a()})}:function(a){setTimeout(function(){a()},0)}}function h(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var i=/\s+/,j=g();return{onSync:c,onAsync:b,off:d,trigger:e}}(),g=function(a){function c(a,c,d){for(var e,f=[],g=0;g<a.length;g++)f.push(b.escapeRegExChars(a[g]));return e=d?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",c?new RegExp(e):new RegExp(e,"i")}var d={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(e){function f(b){var c,d;return(c=
 h.exec(b.data))&&(wrapperNode=a.createElement(e.tagName),e.className&&(wrapperNode.className=e.className),d=b.splitText(c.index),d.splitText(c[0].length),wrapperNode.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(wrapperNode,d)),!!c}function g(a,b){for(var c,d=3,e=0;e<a.childNodes.length;e++)c=a.childNodes[e],c.nodeType===d?e+=b(c)?1:0:g(c,b)}var h;e=b.mixin({},d,e),e.node&&e.pattern&&(e.pattern=b.isArray(e.pattern)?e.pattern:[e.pattern],h=c(e.pattern,e.caseSensitive,e.wordsOnly),g(e.node,f))}}(window.document),h=function(){function c(c){var e,f,g,i,j=this;c=c||{},c.input||a.error("input is missing"),e=b.bind(this._onBlur,this),f=b.bind(this._onFocus,this),g=b.bind(this._onKeydown,this),i=b.bind(this._onInput,this),this.$hint=a(c.hint),this.$input=a(c.input).on("blur.tt",e).on("focus.tt",f).on("keydown.tt",g),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=b.noop),b.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",func
 tion(a){h[a.which||a.keyCode]||b.defer(b.bind(j._onInput,j,a))}):this.$input.on("input.tt",i),this.query=this.$input.val(),this.$overflowHelper=d(this.$input)}function d(b){return a('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function e(a,b){return c.normalizeQuery(a)===c.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;return h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},c.normalizeQuery=function(a){return(a||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},b.mixin(c.prototype,f,{_onBlur:function(){this.resetInputValue(),t
 his.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a),b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(a,b){var c,d,e;switch(a){case"tab":d=this.getHint(),e=this.getInputValue(),c=d&&d!==e&&!g(b);break;case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkInputValue:function(){var a,b,c;a=this.getInputValue(),b=e(a,this.query),c=b?this.query.length!==a.length:!1,b?c&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query=a)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(a){this.query=a},getInputValue:function(){return this.$input.val()},setInputValue:function(a,b){this.$input.val(a
 ),b?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue(),b=this.getHint(),c=a!==b&&0===b.indexOf(a),d=""!==a&&c&&!this.hasOverflow(),!d&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,c,d;return a=this.$input.val().length,c=this.$input[0].selectionStart,b.isNumber(c)?c===a:document.selection?(d=document.selection.createRange(),d.moveStart("character",-a),a===d.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null}}),c}(),i=function(){function e(d)
 {d=d||{},d.templates=d.templates||{},d.source||a.error("missing source"),d.name&&!j(d.name)&&a.error("invalid dataset name: "+d.name),this.query=null,this.highlight=!!d.highlight,this.name=d.name||b.getUniqueId(),this.source=d.source,this.displayFn=h(d.display||d.displayKey),this.templates=i(d.templates,this.displayFn),this.$el=a(c.dataset.replace("%CLASS%",this.name))}function h(a){function c(b){return b[a]}return a=a||"value",b.isFunction(a)?a:c}function i(a,c){function d(a){return"<p>"+c(a)+"</p>"}return{empty:a.empty&&b.templatify(a.empty),header:a.header&&b.templatify(a.header),footer:a.footer&&b.templatify(a.footer),suggestion:a.suggestion||d}}function j(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var k="ttDataset",l="ttValue",m="ttDatum";return e.extractDatasetName=function(b){return a(b).data(k)},e.extractValue=function(b){return a(b).data(l)},e.extractDatum=function(b){return a(b).data(m)},b.mixin(e.prototype,f,{_render:function(e,f){function h(){return p.templates.empty({query:e,i
 sEmpty:!0})}function i(){function h(b){var e;return e=a(c.suggestion).append(p.templates.suggestion(b)).data(k,p.name).data(l,p.displayFn(b)).data(m,b),e.children().each(function(){a(this).css(d.suggestionChild)}),e}var i,j;return i=a(c.suggestions).css(d.suggestions),j=b.map(f,h),i.append.apply(i,j),p.highlight&&g({node:i[0],pattern:e}),i}function j(){return p.templates.header({query:e,isEmpty:!o})}function n(){return p.templates.footer({query:e,isEmpty:!o})}if(this.$el){var o,p=this;this.$el.empty(),o=f&&f.length,!o&&this.templates.empty?this.$el.html(h()).prepend(p.templates.header?j():null).append(p.templates.footer?n():null):o&&this.$el.html(i()).prepend(p.templates.header?j():null).append(p.templates.footer?n():null),this.trigger("rendered")}},getRoot:function(){return this.$el},update:function(a){function b(b){c.canceled||a!==c.query||c._render(a,b)}var c=this;this.query=a,this.canceled=!1,this.source(a,b)},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),th
 is.$el.empty(),this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),e}(),j=function(){function c(c){var d,f,g,h=this;c=c||{},c.menu||a.error("menu is required"),this.isOpen=!1,this.isEmpty=!0,this.datasets=b.map(c.datasets,e),d=b.bind(this._onSuggestionClick,this),f=b.bind(this._onSuggestionMouseEnter,this),g=b.bind(this._onSuggestionMouseLeave,this),this.$menu=a(c.menu).on("click.tt",".tt-suggestion",d).on("mouseenter.tt",".tt-suggestion",f).on("mouseleave.tt",".tt-suggestion",g),b.each(this.datasets,function(a){h.$menu.append(a.getRoot()),a.onSync("rendered",h._onRendered,h)})}function e(a){return new i(a)}return b.mixin(c.prototype,f,{_onSuggestionClick:function(b){this.trigger("suggestionClicked",a(b.currentTarget))},_onSuggestionMouseEnter:function(b){this._removeCursor(),this._setCursor(a(b.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function a(a){return a.isEmpty(
 )}this.isEmpty=b.every(this.datasets,a),this.isEmpty?this._hide():this.isOpen&&this._show(),this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(a,b){a.first().addClass("tt-cursor"),!b&&this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(a){var b,c,d,e;if(this.isOpen){if(c=this._getCursor(),b=this._getSuggestions(),this._removeCursor(),d=b.index(c)+a,d=(d+1)%(b.length+1)-1,-1===d)return void this.trigger("cursorRemoved");-1>d&&(d=b.length-1),this._setCursor(e=b.eq(d)),this._ensureVisible(e)}},_ensureVisible:function(a){var b,c,d,e;b=a.position().top,c=b+a.outerHeight(!0),d=this.$menu.scrollTop(),e=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom
 "),10),0>b?this.$menu.scrollTop(d+b):c>e&&this.$menu.scrollTop(d+(c-e))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(a){this.$menu.css("ltr"===a?d.ltr:d.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(a){var b=null;return a.length&&(b={raw:i.extractDatum(a),value:i.extractValue(a),datasetName:i.extractDatasetName(a)}),b},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(a){function c(b){b.update(a)}b.each(this.datasets,c)},empty:function(){function a(a){a.clear()}b.each(this.datasets,a),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},d
 estroy:function(){function a(a){a.destroy()}this.$menu.off(".tt"),this.$menu=null,b.each(this.datasets,a)}}),c}(),k=function(){function f(c){var d,f,i;c=c||{},c.input||a.error("missing input"),this.isActivated=!1,this.autoselect=!!c.autoselect,this.minLength=b.isNumber(c.minLength)?c.minLength:1,this.$node=g(c.input,c.withHint),d=this.$node.find(".tt-dropdown-menu"),f=this.$node.find(".tt-input"),i=this.$node.find(".tt-hint"),f.on("blur.tt",function(a){var c,e,g;c=document.activeElement,e=d.is(c),g=d.has(c).length>0,b.isMsie()&&(e||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){f.focus()}))}),d.on("mousedown.tt",function(a){a.preventDefault()}),this.eventBus=c.eventBus||new e({el:f}),this.dropdown=new j({menu:d,datasets:c.datasets}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this
 ).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=new h({input:f,hint:i}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._setLanguageDirection()}function g(b,e){var f,g,h,j;f=a(b),g=a(c.wrapper).css(d.wrapper),h=a(c.dropdown).css(d.dropdown),j=f.clone().css(d.hint).css(i(f)),j.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder").prop("disabled",!0).attr({autocomplete:"off",spellcheck:"false"}),f.data(l,{dir:f.attr("dir"),autocomplete:f.attr("autocomplete"),spellcheck:f.attr("spellcheck"),style:f.attr("style")}
 ),f.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(e?d.input:d.inputWithNoHint);try{!f.attr("dir")&&f.attr("dir","auto")}catch(k){}return f.wrap(g).parent().prepend(e?j:null).append(h)}function i(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function k(a){var c=a.find(".tt-input");b.each(c.data(l),function(a,d){b.isUndefined(a)?c.removeAttr(d):c.attr(d,a)}),c.detach().removeData(l).removeClass("tt-input").insertAfter(a),a.remove()}var l="ttAttrs";return b.mixin(f.prototype,{_onSuggestionClicked:function(a,b){var c;(c=this.dropdown.getDatumForSuggestion(b))&&this._select(c)},_onCursorMoved:function(){var a=this.dropdown.getDatumForCursor();this.input.set
 InputValue(a.value,!0),this.eventBus.trigger("cursorchanged",a.raw,a.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint(),this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint(),this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0,this.dropdown.open()},_onBlurred:function(){this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()},_onEnterKeyed:function(a,b){var c,d;c=this.dropdown.getDatumForCursor(),d=this.dropdown.getDatumForTopSuggestion(),c?(this._select(c),b.preventDefault()):this.autoselect&&d&&(this._select(d),b.preventDefault())},_onTabKeyed:function(a,b){var c;(c=this.dropdown.getDatumForCursor())?(this._select(c),b.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var a=this.input.getQuery();this.dropdown.isEm
 pty&&a.length>=this.minLength?this.dropdown.update(a):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var a=this.input.getQuery();this.dropdown.isEmpty&&a.length>=this.minLength?this.dropdown.update(a):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(a,b){this.input.clearHintIfInvalid(),b.length>=this.minLength?this.dropdown.update(b):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var a;this.dir!==(a=this.input.getLanguageDirection())&&(this.dir=a,this.$node.css("direction",a),this.dropdown.setLanguageDirection(a))},_updateHint:function(){var a,c,d,e,f,g;a=this.dropdown.getDatumForTopSuggestion(),a&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(c=this.input.getInp
 utValue(),d=h.normalizeQuery(c),e=b.escapeRegExChars(d),f=new RegExp("^(?:"+e+")(.+$)","i"),g=f.exec(a.value),g?this.input.setHint(c+g[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(a){var b,c,d,e;b=this.input.getHint(),c=this.input.getQuery(),d=a||this.input.isCursorAtEnd(),b&&c!==b&&d&&(e=this.dropdown.getDatumForTopSuggestion(),e&&this.input.setInputValue(e.value),this.eventBus.trigger("autocompleted",e.raw,e.datasetName))},_select:function(a){this.input.setQuery(a.value),this.input.setInputValue(a.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",a.raw,a.datasetName),this.dropdown.close(),b.defer(b.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(a){this.isActivated?this.input.setInputValue(a):(this.input.setQuery(a),this.input.setInputValue(a,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){
 this.input.destroy(),this.dropdown.destroy(),k(this.$node),this.$node=null}}),f}();!function(){var c,d,f;c=a.fn.typeahead,d="ttTypeahead",f={initialize:function(c,f){function g(){var g,h,i=a(this);b.each(f,function(a){a.highlight=!!c.highlight}),h=new k({input:i,eventBus:g=new e({el:i}),withHint:b.isUndefined(c.hint)?!0:!!c.hint,minLength:c.minLength,autoselect:c.autoselect,datasets:f}),i.data(d,h)}return f=b.isArray(f)?f:[].slice.call(arguments,1),c=c||{},this.each(g)},open:function(){function b(){var b,c=a(this);(b=c.data(d))&&b.open()}return this.each(b)},close:function(){function b(){var b,c=a(this);(b=c.data(d))&&b.close()}return this.each(b)},val:function(b){function c(){var c,e=a(this);(c=e.data(d))&&c.setVal(b)}function e(a){var b,c;return(b=a.data(d))&&(c=b.getVal()),c}return arguments.length?this.each(c):e(this.first())},destroy:function(){function b(){var b,c=a(this);(b=c.data(d))&&(b.destroy(),c.removeData(d))}return this.each(b)}},a.fn.typeahead=function(a){return f[a]?
 f[a].apply(this,[].slice.call(arguments,1)):f.initialize.apply(this,arguments)},a.fn.typeahead.noConflict=function(){return a.fn.typeahead=c,this}}()}(window.jQuery),function(a){"use strict";var b={prefilled:null,CapitalizeFirstLetter:!1,preventSubmitOnEnter:!0,isClearInputOnEsc:!0,externalTagId:!1,prefillIdFieldName:"Id",prefillValueFieldName:"Value",AjaxPush:null,AjaxPushAllTags:null,AjaxPushParameters:null,delimiters:[9,13,44],backspace:[8],maxTags:0,hiddenTagListName:null,hiddenTagListId:null,replace:!0,output:null,deleteTagsOnBackspace:!0,tagsContainer:null,tagCloseIcon:"x",tagClass:"",validator:null,onlyTagList:!1,tagList:null,fillInputOnTagRemove:!1},c={pushTag:function(b,c,e){var f,g,h,i,j,k,l,m,n,o,p,q=a(this),r=q.data("opts"),s=q.data("tlis"),t=q.data("tlid");if(b=d.trimTag(b,r.delimiterChars),b&&!(b.length<=0)){if(r.onlyTagList&&void 0!==r.tagList&&r.tagList){var u=r.tagList;a.each(u,function(a,b){u[a]=b.toLowerCase()});var v=a.inArray(b.toLowerCase(),u);if(-1===v)return}
 if(r.CapitalizeFirstLetter&&b.length>1&&(b=b.charAt(0).toUpperCase()+b.slice(1).toLowerCase()),r.validator&&!r.validator(b))return void q.trigger("tm:invalid",b);if(!(r.maxTags>0&&s.length>=r.maxTags)){if(f=!1,g=jQuery.map(s,function(a){return a.toLowerCase()}),j=a.inArray(b.toLowerCase(),g),-1!==j&&(f=!0),f)if(q.trigger("tm:duplicated",b),r.blinkClass)for(var w=0;6>w;++w)a("#"+q.data("tm_rndid")+"_"+t[j]).queue(function(b){a(this).toggleClass(r.blinkClass),b()}).delay(100);else a("#"+q.data("tm_rndid")+"_"+t[j]).stop().animate({backgroundColor:r.blinkBGColor_1},100).animate({backgroundColor:r.blinkBGColor_2},100).animate({backgroundColor:r.blinkBGColor_1},100).animate({backgroundColor:r.blinkBGColor_2},100).animate({backgroundColor:r.blinkBGColor_1},100).animate({backgroundColor:r.blinkBGColor_2},100);else r.externalTagId===!0?(void 0===e&&a.error("externalTagId is not passed for tag -"+b),i=e):(h=Math.max.apply(null,t),h=h===-1/0?0:h,i=++h),c||q.trigger("tm:pushing",[b,i]),s.push(
 b),t.push(i),c||null!==r.AjaxPush&&null==r.AjaxPushAllTags&&-1===a.inArray(b,r.prefilled)&&a.post(r.AjaxPush,a.extend({tag:b},r.AjaxPushParameters)),k=q.data("tm_rndid")+"_"+i,l=q.data("tm_rndid")+"_Remover_"+i,m=a("<span/>").text(b).html(),n='<span class="'+d.tagClasses.call(q)+'" id="'+k+'">',n+="<span>"+m+"</span>",n+='<a href="#" class="tm-tag-remove" id="'+l+'" TagIdToRemove="'+i+'">',n+=r.tagCloseIcon+"</a></span> ",o=a(n),null!==r.tagsContainer?a(r.tagsContainer).append(o):t.length>1?(p=q.siblings("#"+q.data("tm_rndid")+"_"+t[t.length-2]),p.after(o)):q.before(o),o.find("#"+l).on("click",q,function(b){b.preventDefault();var c=parseInt(a(this).attr("TagIdToRemove"));d.spliceTag.call(q,c,b.data)}),d.refreshHiddenTagList.call(q),c||q.trigger("tm:pushed",[b,i]),d.showOrHide.call(q);q.val("")}}},popTag:function(){var b,c,e=a(this),f=e.data("tlis"),g=e.data("tlid");g.length>0&&(b=g.pop(),c=f[f.length-1],e.trigger("tm:popping",[c,b]),f.pop(),a("#"+e.data("tm_rndid")+"_"+b).remove(),d
 .refreshHiddenTagList.call(e),e.trigger("tm:popped",[c,b]))},empty:function(){for(var b,c=a(this),e=c.data("tlis"),f=c.data("tlid");f.length>0;)b=f.pop(),e.pop(),a("#"+c.data("tm_rndid")+"_"+b).remove(),d.refreshHiddenTagList.call(c);
 c.trigger("tm:emptied",null),d.showOrHide.call(c)},tags:function(){var a=this,b=a.data("tlis");return b}},d={showOrHide:function(){var a=this,b=a.data("opts"),c=a.data("tlis");b.maxTags>0&&c.length<b.maxTags&&(a.show(),a.trigger("tm:show")),b.maxTags>0&&c.length>=b.maxTags&&(a.hide(),a.trigger("tm:hide"))},tagClasses:function(){var b,c=a(this),d=c.data("opts"),e=d.tagBaseClass,f=d.inputBaseClass;return b=e,c.attr("class")&&a.each(c.attr("class").split(" "),function(a,c){-1!==c.indexOf(f+"-")&&(b+=" "+e+c.substring(f.length))}),b+=d.tagClass?" "+d.tagClass:""},trimTag:function(b,c){var d;for(b=a.trim(b),d=0;d<b.length&&-1===a.inArray(b.charCodeAt(d),c);d++);return b.substring(0,d)},refreshHiddenTagList:function(){var b=a(this),c=b.data("tlis"),d=b.data("lhiddenTagList");d&&a(d).val(c.join(b.data("opts").baseDelimiter)).change(),b.trigger("tm:refresh",c.join(b.data("opts").baseDelimiter))},killEvent:function(a){a.cancelBubble=!0,a.returnValue=!1,a.stopPropagation(),a.preventDefault()}
 ,keyInArray:function(b,c){return-1!==a.inArray(b.which,c)},applyDelimiter:function(b){var d=a(this);c.pushTag.call(d,a(this).val()),b.preventDefault()},prefill:function(b){var d=a(this),e=d.data("opts");a.each(b,function(a,b){e.externalTagId===!0?c.pushTag.call(d,b[e.prefillValueFieldName],!0,b[e.prefillIdFieldName]):c.pushTag.call(d,b,!0)})},pushAllTags:function(b,c){var d=a(this),e=d.data("opts"),f=d.data("tlis");e.AjaxPushAllTags&&("tm:pushed"!==b.type||-1===a.inArray(c,e.prefilled))&&a.post(e.AjaxPush,a.extend({tags:f.join(e.baseDelimiter)},e.AjaxPushParameters))},spliceTag:function(b){var c,e=this,f=e.data("tlis"),g=e.data("tlid"),h=a.inArray(b,g);-1!==h&&(c=f[h],e.trigger("tm:splicing",[c,b]),a("#"+e.data("tm_rndid")+"_"+b).remove(),f.splice(h,1),g.splice(h,1),d.refreshHiddenTagList.call(e),e.trigger("tm:spliced",[c,b])),d.showOrHide.call(e)},init:function(e){var f,g,h=a.extend({},b,e);return h.hiddenTagListName=null===h.hiddenTagListName?"hidden-"+this.attr("name"):h.hiddenTa
 gListName,f=h.delimeters||h.delimiters,g=[9,13,17,18,19,37,38,39,40],h.delimiterChars=[],h.delimiterKeys=[],a.each(f,function(b,c){-1!==a.inArray(c,g)?h.delimiterKeys.push(c):h.delimiterChars.push(c)}),h.baseDelimiter=String.fromCharCode(h.delimiterChars[0]||44),h.tagBaseClass="tm-tag",h.inputBaseClass="tm-input",a.isFunction(h.validator)||(h.validator=null),this.each(function(){var b=a(this),e="",f="",g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";if(b.data("tagManager"))return!1;b.data("tagManager",!0);for(var i=0;5>i;i++)f+=g.charAt(Math.floor(Math.random()*g.length));if(b.data("tm_rndid",f),b.data("opts",h).data("tlis",[]).data("tlid",[]),null===h.output?(e=a("<input/>",{type:"hidden",name:h.hiddenTagListName}),b.after(e),b.data("lhiddenTagList",e)):b.data("lhiddenTagList",a(h.output)),h.AjaxPushAllTags&&(b.on("tm:spliced",d.pushAllTags),b.on("tm:popped",d.pushAllTags),b.on("tm:pushed",d.pushAllTags)),b.on("focus keypress",function(){a(this).popover&&a(this).popover("h
 ide")}),h.isClearInputOnEsc&&b.on("keyup",function(b){27===b.which&&(a(this).val(""),d.killEvent(b))}),b.on("keypress",function(a){d.keyInArray(a,h.delimiterChars)&&d.applyDelimiter.call(b,a)}),b.on("keydown",function(a){13===a.which&&h.preventSubmitOnEnter&&d.killEvent(a),d.keyInArray(a,h.delimiterKeys)&&d.applyDelimiter.call(b,a)}),h.deleteTagsOnBackspace&&b.on("keydown",function(e){d.keyInArray(e,h.backspace)&&a(this).val().length<=0&&(c.popTag.call(b),d.killEvent(e))}),h.fillInputOnTagRemove&&b.on("tm:popped",function(b,c){a(this).val(c)}),b.change(function(a){/webkit/.test(navigator.userAgent.toLowerCase())||b.focus(),d.killEvent(a)}),null!==h.prefilled)"object"==typeof h.prefilled?d.prefill.call(b,h.prefilled):"string"==typeof h.prefilled?d.prefill.call(b,h.prefilled.split(h.baseDelimiter)):"function"==typeof h.prefilled&&d.prefill.call(b,h.prefilled());else if(null!==h.output){if(a(h.output)&&a(h.output).val()){a(h.output)}d.prefill.call(b,a(h.output).val().split(h.baseDelimi
 ter))}}),this}};a.fn.tagsManager=function(b){var e=a(this);return 0 in this?c[b]?c[b].apply(e,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?(a.error("Method "+b+" does not exist."),!1):d.init.apply(this,arguments):this}}(jQuery),function(a){function b(a,b,c){switch(arguments.length){case 2:return null!=a?a:b;case 3:return null!=a?a:null!=b?b:c;default:throw new Error("Implement me")}}function c(a,b){return zb.call(a,b)}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function e(a){tb.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}function f(a,b){var c=!0;return m(function(){return c&&(e(a),c=!1),b.apply(this,arguments)},b)}function g(a,b){pc[a]||(e(b),pc[a]=!0)}function h(a,b){return function(c){return p(a.call(this,c),b)}}function i(a,b){return function(c){return this.localeData().ord
 inal(a.call(this,c),b)}}function j(){}function k(a,b){b!==!1&&F(a),n(this,a),this._d=new Date(+a._d)}function l(a){var b=y(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=tb.localeData(),this._bubble()}function m(a,b){for(var d in b)c(b,d)&&(a[d]=b[d]);return c(b,"toString")&&(a.toString=b.toString),c(b,"valueOf")&&(a.valueOf=b.valueOf),a}function n(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=b._pf),"und
 efined"!=typeof b._locale&&(a._locale=b._locale),Ib.length>0)for(c in Ib)d=Ib[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function o(a){return 0>a?Math.ceil(a):Math.floor(a)}function p(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.length<b;)d="0"+d;return(e?c?"+":"":"-")+d}function q(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function r(a,b){var c;return b=K(b,a),a.isBefore(b)?c=q(a,b):(c=q(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function s(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(g(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=tb.duration(c,d),t(this,e,a),this}}function t(a,b,c,d){var e=b._milliseconds,f=b._days,g=b._months;d=null==d?!0:d,e&&a._d.setTime(+a._d+e*c),f&&nb(a,"Date",mb(a,"Date")+f*c),g&&lb
 (a,mb(a,"Month")+g*c),d&&tb.updateOffset(a,f||g)}function u(a){return"[object Array]"===Object.prototype.toString.call(a)}function v(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function w(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&A(a[d])!==A(b[d]))&&g++;return g+f}function x(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=ic[a]||jc[b]||b}return a}function y(a){var b,d,e={};for(d in a)c(a,d)&&(b=x(d),b&&(e[b]=a[d]));return e}function z(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}tb[b]=function(e,f){var g,h,i=tb._locale[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=tb().utc().set(d,a);return i.call(tb._locale,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function A(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function B(a,b){return new Date(Da
 te.UTC(a,b+1,0)).getUTCDate()}function C(a,b,c){return hb(tb([a,11,31+b-c]),b,c).week}function D(a){return E(a)?366:365}function E(a){return a%4===0&&a%100!==0||a%400===0}function F(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[Bb]<0||a._a[Bb]>11?Bb:a._a[Cb]<1||a._a[Cb]>B(a._a[Ab],a._a[Bb])?Cb:a._a[Db]<0||a._a[Db]>23?Db:a._a[Eb]<0||a._a[Eb]>59?Eb:a._a[Fb]<0||a._a[Fb]>59?Fb:a._a[Gb]<0||a._a[Gb]>999?Gb:-1,a._pf._overflowDayOfYear&&(Ab>b||b>Cb)&&(b=Cb),a._pf.overflow=b)}function G(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function H(a){return a?a.toLowerCase().replace("_","-"):a}function I(a){for(var b,c,d,e,f=0;f<a.length;){for(e=H(a[f]).split("-"),b=e.length,c=H(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=J(e.slice(0,b).join("-")))return d;if(c&&c.leng
 th>=b&&w(e,c,!0)>=b-1)break;b--}f++}return null}function J(a){var b=null;if(!Hb[a]&&Jb)try{b=tb.locale(),require("./locale/"+a),tb.locale(b)}catch(c){}return Hb[a]}function K(a,b){return b._isUTC?tb(a).zone(b._offset||0):tb(a).local()}function L(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function M(a){var b,c,d=a.match(Nb);for(b=0,c=d.length;c>b;b++)d[b]=oc[d[b]]?oc[d[b]]:L(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function N(a,b){return a.isValid()?(b=O(b,a.localeData()),kc[b]||(kc[b]=M(b)),kc[b](a)):a.localeData().invalidDate()}function O(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Ob.lastIndex=0;d>=0&&Ob.test(a);)a=a.replace(Ob,c),Ob.lastIndex=0,d-=1;return a}function P(a,b){var c,d=b._strict;switch(a){case"Q":return Yb;case"DDDD":return $b;case"YYYY":case"GGGG":case"gggg":return d?_b:Rb;case"Y":case"G":case"g":return bc;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg
 ":return d?ac:Sb;case"S":if(d)return Yb;case"SS":if(d)return Zb;case"SSS":if(d)return $b;case"DDD":return Qb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Ub;case"a":case"A":return b._locale._meridiemParse;case"X":return Xb;case"Z":case"ZZ":return Vb;case"T":return Wb;case"SSSS":return Tb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?Zb:Pb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Pb;case"Do":return d?b._locale._ordinalParse:b._locale._ordinalParseLenient;default:return c=new RegExp(Y(X(a.replace("\\","")),"i"))}}function Q(a){a=a||"";var b=a.match(Vb)||[],c=b[b.length-1]||[],d=(c+"").match(gc)||["-",0,0],e=+(60*d[1])+A(d[2]);return"+"===d[0]?-e:e}function R(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[Bb]=3*(A(b)-1));break;case"M":case"MM":null!=b&&(e[Bb]=A(b)-1);break;case"MMM":case"MMMM":d=c._locale.monthsParse(b),null!=d?e[Bb]=d:c._pf.invalidMonth=b
 ;break;case"D":case"DD":null!=b&&(e[Cb]=A(b));break;case"Do":null!=b&&(e[Cb]=A(parseInt(b.match(/\d{1,2}/)[0],10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=A(b));break;case"YY":e[Ab]=tb.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[Ab]=A(b);break;case"a":case"A":c._isPm=c._locale.isPM(b);break;case"H":case"HH":case"h":case"hh":e[Db]=A(b);break;case"m":case"mm":e[Eb]=A(b);break;case"s":case"ss":e[Fb]=A(b);break;case"S":case"SS":case"SSS":case"SSSS":e[Gb]=A(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=Q(b);break;case"dd":case"ddd":case"dddd":d=c._locale.weekdaysParse(b),null!=d?(c._w=c._w||{},c._w.d=d):c._pf.invalidWeekday=b;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":a=a.substr(0,1);case"gggg":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=A(b));break;case"gg":case"GG":c._w=c._w||{},c._w[a]=tb.parseTwoDigitYear(b)}}function S(a){var c,d,e,f,g,h,i;c=a._w,null!=
 c.GG||null!=c.W||null!=c.E?(g=1,h=4,d=b(c.GG,a._a[Ab],hb(tb(),1,4).year),e=b(c.W,1),f=b(c.E,1)):(g=a._locale._week.dow,h=a._locale._week.doy,d=b(c.gg,a._a[Ab],hb(tb(),g,h).year),e=b(c.w,1),null!=c.d?(f=c.d,g>f&&++e):f=null!=c.e?c.e+g:g),i=ib(d,e,f,h,g),a._a[Ab]=i.year,a._dayOfYear=i.dayOfYear}function T(a){var c,d,e,f,g=[];if(!a._d){for(e=V(a),a._w&&null==a._a[Cb]&&null==a._a[Bb]&&S(a),a._dayOfYear&&(f=b(a._a[Ab],e[Ab]),a._dayOfYear>D(f)&&(a._pf._overflowDayOfYear=!0),d=db(f,0,a._dayOfYear),a._a[Bb]=d.getUTCMonth(),a._a[Cb]=d.getUTCDate()),c=0;3>c&&null==a._a[c];++c)a._a[c]=g[c]=e[c];for(;7>c;c++)a._a[c]=g[c]=null==a._a[c]?2===c?1:0:a._a[c];a._d=(a._useUTC?db:cb).apply(null,g),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()+a._tzm)}}function U(a){var b;a._d||(b=y(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],T(a))}function V(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate(
 )]}function W(a){if(a._f===tb.ISO_8601)return void $(a);a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=""+a._i,h=g.length,i=0;for(d=O(a._f,a._locale).match(Nb)||[],b=0;b<d.length;b++)e=d[b],c=(g.match(P(e,a))||[])[0],c&&(f=g.substr(0,g.indexOf(c)),f.length>0&&a._pf.unusedInput.push(f),g=g.slice(g.indexOf(c)+c.length),i+=c.length),oc[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),R(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=h-i,g.length>0&&a._pf.unusedInput.push(g),a._isPm&&a._a[Db]<12&&(a._a[Db]+=12),a._isPm===!1&&12===a._a[Db]&&(a._a[Db]=0),T(a),F(a)}function X(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function Y(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(a){var b,c,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;f<a._f.length;f++)g=0,b=n({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._pf=d(),b._f=a._f[f],W(b),G(b)&&(g+=b._pf.charsLeftOver,g+=10*b
 ._pf.unusedTokens.length,b._pf.score=g,(null==e||e>g)&&(e=g,c=b));m(a,c||b)}function $(a){var b,c,d=a._i,e=cc.exec(d);if(e){for(a._pf.iso=!0,b=0,c=ec.length;c>b;b++)if(ec[b][1].exec(d)){a._f=ec[b][0]+(e[6]||" ");break}for(b=0,c=fc.length;c>b;b++)if(fc[b][1].exec(d)){a._f+=fc[b][0];break}d.match(Vb)&&(a._f+="Z"),W(a)}else a._isValid=!1}function _(a){$(a),a._isValid===!1&&(delete a._isValid,tb.createFromInputFallback(a))}function ab(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function bb(b){var c,d=b._i;d===a?b._d=new Date:v(d)?b._d=new Date(+d):null!==(c=Kb.exec(d))?b._d=new Date(+c[1]):"string"==typeof d?_(b):u(d)?(b._a=ab(d.slice(0),function(a){return parseInt(a,10)}),T(b)):"object"==typeof d?U(b):"number"==typeof d?b._d=new Date(d):tb.createFromInputFallback(b)}function cb(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function db(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function eb
 (a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function fb(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function gb(a,b,c){var d=tb.duration(a).abs(),e=yb(d.as("s")),f=yb(d.as("m")),g=yb(d.as("h")),h=yb(d.as("d")),i=yb(d.as("M")),j=yb(d.as("y")),k=e<lc.s&&["s",e]||1===f&&["m"]||f<lc.m&&["mm",f]||1===g&&["h"]||g<lc.h&&["hh",g]||1===h&&["d"]||h<lc.d&&["dd",h]||1===i&&["M"]||i<lc.M&&["MM",i]||1===j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,fb.apply({},k)}function hb(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=tb(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ib(a,b,c,d,e){var f,g,h=db(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:D(a-1)+g}}function jb(b){var c=b._i,d=b._f;return b._locale=b._locale||tb.localeData(b._l),null===c||d===a&&""===c?tb.invalid({nullInput:!0}):("
 string"==typeof c&&(b._i=c=b._locale.preparse(c)),tb.isMoment(c)?new k(c,!0):(d?u(d)?Z(b):W(b):bb(b),new k(b)))}function kb(a,b){var c,d;if(1===b.length&&u(b[0])&&(b=b[0]),!b.length)return tb();for(c=b[0],d=1;d<b.length;++d)b[d][a](c)&&(c=b[d]);return c}function lb(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),B(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function mb(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function nb(a,b,c){return"Month"===b?lb(a,c):a._d["set"+(a._isUTC?"UTC":"")+b](c)}function ob(a,b){return function(c){return null!=c?(nb(this,a,c),tb.updateOffset(this,b),this):mb(this,a)}}function pb(a){return 400*a/146097}function qb(a){return 146097*a/400}function rb(a){tb.duration.fn[a]=function(){return this._data[a]}}function sb(a){"undefined"==typeof ender&&(ub=xb.moment,xb.moment=a?f("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release
 .",tb):tb)}for(var tb,ub,vb,wb="2.8.3",xb="undefined"!=typeof global?global:this,yb=Math.round,zb=Object.prototype.hasOwnProperty,Ab=0,Bb=1,Cb=2,Db=3,Eb=4,Fb=5,Gb=6,Hb={},Ib=[],Jb="undefined"!=typeof module&&module.exports,Kb=/^\/?Date\((\-?\d+)/i,Lb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Mb=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Nb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,Ob=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,Pb=/\d\d?/,Qb=/\d{1,3}/,Rb=/\d{1,4}/,Sb=/[+\-]?\d{1,6}/,Tb=/\d+/,Ub=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Vb=/Z|[\+\-]\d\d:?\d\d/gi,Wb=/T/i,Xb=/[\+\-]?\d+(\.\d{1,3})?/,Yb=/\d/,Zb=/\d\d/,$b=/\d{3}/,_b=/\d{4}/,ac=/[+-]?\d{6}/,bc=/[+-]?\d+/,cc=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\
 d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,dc="YYYY-MM-DDTHH:mm:ssZ",ec=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],fc=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],gc=/([\+\-]|\d\d)/gi,hc=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),ic={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},jc={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},kc={},lc={s:45,m:45,h:22,d:26,M:11},mc="DDD w W M D d".split(" "),nc="M D H h 
 m s w W".split(" "),oc={M:function(){return this.month()+1},MMM:function(a){return this.localeData().monthsShort(this,a)},MMMM:function(a){return this.localeData().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.localeData().weekdaysMin(this,a)},ddd:function(a){return this.localeData().weekdaysShort(this,a)},dddd:function(a){return this.localeData().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return p(this.year()%100,2)},YYYY:function(){return p(this.year(),4)},YYYYY:function(){return p(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+p(Math.abs(a),6)},gg:function(){return p(this.weekYear()%100,2)},gggg:function(){return p(this.weekYear(),4)},ggggg:function(){return p(this.weekYear(),5)},GG:function(){return p(this.isoWeekYear()%100,2)},GGGG:function(){return p(this.isoWeekYear(),4)},GGGGG:function(){r
 eturn p(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return A(this.milliseconds()/100)},SS:function(){return p(A(this.milliseconds()/10),2)},SSS:function(){return p(this.milliseconds(),3)},SSSS:function(){return p(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+":"+p(A(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+p(A(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},pc={},qc=["months","monthsShort","weekdays","weekday
 sShort","weekdaysMin"];mc.length;)vb=mc.pop(),oc[vb+"o"]=i(oc[vb],vb);for(;nc.length;)vb=nc.pop(),oc[vb+vb]=h(oc[vb],2);oc.DDDD=h(oc.DDD,3),m(j.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=tb.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:fun
 ction(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=tb([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().c
 harAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",_ordinalParse:/\d{1,2}/,preparse:function(a){return a},postformat:function(a){return a},week:function(a){return hb(a,this._week.dow,this._week
 .doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),tb=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=b,g._f=c,g._l=e,g._strict=f,g._isUTC=!1,g._pf=d(),jb(g)},tb.suppressDeprecationWarnings=!1,tb.createFromInputFallback=f("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i)}),tb.min=function(){var a=[].slice.call(arguments,0);return kb("isBefore",a)},tb.max=function(){var a=[].slice.call(arguments,0);return kb("isAfter",a)},tb.utc=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=b,g._f=c,g._strict=f,g._pf=d(),jb(g).utc()},tb.unix=function(a){return tb(1e3*a)},tb.duration=function(a,b){var d,e,f,g,h=a,i=null;return tb.isDuration(a)?h={ms:a._m
 illiseconds,d:a._days,M:a._months}:"number"==typeof a?(h={},b?h[b]=a:h.milliseconds=a):(i=Lb.exec(a))?(d="-"===i[1]?-1:1,h={y:0,d:A(i[Cb])*d,h:A(i[Db])*d,m:A(i[Eb])*d,s:A(i[Fb])*d,ms:A(i[Gb])*d}):(i=Mb.exec(a))?(d="-"===i[1]?-1:1,f=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*d},h={y:f(i[2]),M:f(i[3]),d:f(i[4]),h:f(i[5]),m:f(i[6]),s:f(i[7]),w:f(i[8])}):"object"==typeof h&&("from"in h||"to"in h)&&(g=r(tb(h.from),tb(h.to)),h={},h.ms=g.milliseconds,h.M=g.months),e=new l(h),tb.isDuration(a)&&c(a,"_locale")&&(e._locale=a._locale),e},tb.version=wb,tb.defaultFormat=dc,tb.ISO_8601=function(){},tb.momentProperties=Ib,tb.updateOffset=function(){},tb.relativeTimeThreshold=function(b,c){return lc[b]===a?!1:c===a?lc[b]:(lc[b]=c,!0)},tb.lang=f("moment.lang is deprecated. Use moment.locale instead.",function(a,b){return tb.locale(a,b)}),tb.locale=function(a,b){var c;return a&&(c="undefined"!=typeof b?tb.defineLocale(a,b):tb.localeData(a),c&&(tb.duration._locale=tb._loca
 le=c)),tb._locale._abbr},tb.defineLocale=function(a,b){return null!==b?(b.abbr=a,Hb[a]||(Hb[a]=new j),Hb[a].set(b),tb.locale(a),Hb[a]):(delete Hb[a],null)},tb.langData=f("moment.langData is deprecated. Use moment.localeData instead.",function(a){return tb.localeData(a)}),tb.localeData=function(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return tb._locale;if(!u(a)){if(b=J(a))return b;a=[a]}return I(a)},tb.isMoment=function(a){return a instanceof k||null!=a&&c(a,"_isAMomentObject")},tb.isDuration=function(a){return a instanceof l};for(vb=qc.length-1;vb>=0;--vb)z(qc[vb]);tb.normalizeUnits=function(a){return x(a)},tb.invalid=function(a){var b=tb.utc(0/0);return null!=a?m(b._pf,a):b._pf.userInvalidated=!0,b},tb.parseZone=function(){return tb.apply(null,arguments).parseZone()},tb.parseTwoDigitYear=function(a){return A(a)+(A(a)>68?1900:2e3)},m(tb.fn=k.prototype,{clone:function(){return tb(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){
 return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=tb(this).utc();return 0<a.year()&&a.year()<=9999?N(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):N(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds()]},isValid:function(){return G(this)},isDSTShifted:function(){return this._a?this.isValid()&&w(this._a,(this._isUTC?tb.utc(this._a):tb(this._a)).toArray())>0:!1},parsingFlags:function(){return m({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(a){return this.zone(0,a)},local:function(a){return this._isUTC&&(this.zone(0,a),this._isUTC=!1,a&&this.add(this._dateTzOffset(),"m")),this},format:function(a){var b=N(this,a||tb.defaultFormat);return this.localeData().postformat(b)},add:s(1,"add"),subtract:s(-1,"subtrac
 t"),diff:function(a,b,c){var d,e,f,g=K(a,this),h=6e4*(this.zone()-g.zone());return b=x(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+g.daysInMonth()),e=12*(this.year()-g.year())+(this.month()-g.month()),f=this-tb(this).startOf("month")-(g-tb(g).startOf("month")),f-=6e4*(this.zone()-tb(this).startOf("month").zone()-(g.zone()-tb(g).startOf("month").zone())),e+=f/d,"year"===b&&(e/=12)):(d=this-g,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-h)/864e5:"week"===b?(d-h)/6048e5:d),c?e:o(e)},from:function(a,b){return tb.duration({to:this,from:a}).locale(this.locale()).humanize(!b)},fromNow:function(a){return this.from(tb(),a)},calendar:function(a){var b=a||tb(),c=K(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this))},isLeapYear:function(){return E(this.year())},isDST:function(){return this.zone()<this.clone
 ().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=eb(a,this.localeData()),this.add(a-b,"d")):b},month:ob("Month",!0),startOf:function(a){switch(a=x(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(a){return a=x(a),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms")},isAfter:function(a,b){return b=x("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+this>+a):+this.clone().startOf(b)>+tb(a).startOf(b)},isBefore:function(a,b){return b=x("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+a>+this):+this.clone().start
 Of(b)<+tb(a).startOf(b)},isSame:function(a,b){return b=x(b||"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+this===+a):+this.clone().startOf(b)===+K(a,this).startOf(b)},min:f("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),this>a?this:a}),max:f("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),a>this?this:a}),zone:function(a,b){var c,d=this._offset||0;return null==a?this._isUTC?d:this._dateTzOffset():("string"==typeof a&&(a=Q(a)),Math.abs(a)<16&&(a=60*a),!this._isUTC&&b&&(c=this._dateTzOffset()),this._offset=a,this._isUTC=!0,null!=c&&this.subtract(c,"m"),d!==a&&(!b||this._changeInProgress?t(this,tb.duration(d-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,tb.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},z
 oneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?tb(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return B(this.year(),this.month())},dayOfYear:function(a){var b=yb((tb(this).startOf("day")-tb(this).startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")},quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=hb(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")},isoWeekYear:function(a){var b=hb(this,1,4).year;return null==a?b:this.add(a-b,"y")},week:function(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")},isoWeek:function(a){var b=hb(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")},weekday:function(a){var b=(this.day()+7-this.localeDa
 ta()._week.dow)%7;return null==a?b:this.add(a-b,"d")},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)
 },isoWeeksInYear:function(){return C(this.year(),1,4)},weeksInYear:function(){var a=this.localeData()._week;return C(this.year(),a.dow,a.doy)},get:function(a){return a=x(a),this[a]()},set:function(a,b){return a=x(a),"function"==typeof this[a]&&this[a](b),this},locale:function(b){var c;return b===a?this._locale._abbr:(c=tb.localeData(b),null!=c&&(this._locale=c),this)},lang:f("moment().lang() is deprecated. Use moment().localeData() instead.",function(b){return b===a?this.localeData():this.locale(b)}),localeData:function(){return this._locale},_dateTzOffset:function(){return 15*Math.round(this._d.getTimezoneOffset()/15)}}),tb.fn.millisecond=tb.fn.milliseconds=ob("Milliseconds",!1),tb.fn.second=tb.fn.seconds=ob("Seconds",!1),tb.fn.minute=tb.fn.minutes=ob("Minutes",!1),tb.fn.hour=tb.fn.hours=ob("Hours",!0),tb.fn.date=ob("Date",!0),tb.fn.dates=f("dates accessor is deprecated. Use date instead.",ob("Date",!0)),tb.fn.year=ob("FullYear",!0),tb.fn.years=f("years accessor is deprecated. Use 
 year instead.",ob("FullYear",!0)),tb.fn.days=tb.fn.day,tb.fn.months=tb.fn.month,tb.fn.weeks=tb.fn.week,tb.fn.isoWeeks=tb.fn.isoWeek,tb.fn.quarters=tb.fn.quarter,tb.fn.toJSON=tb.fn.toISOString,m(tb.duration.fn=l.prototype,{_bubble:function(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;g.milliseconds=d%1e3,a=o(d/1e3),g.seconds=a%60,b=o(a/60),g.minutes=b%60,c=o(b/60),g.hours=c%24,e+=o(c/24),h=o(pb(e)),e-=o(qb(h)),f+=o(e/30),e%=30,h+=o(f/12),f%=12,g.days=e,g.months=f,g.years=h},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return o(this.days()/7)},valueOf:func
 tion(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*A(this._months/12)},humanize:function(a){var b=gb(this,!a,this.localeData());return a&&(b=this.localeData().pastFuture(+this,b)),this.localeData().postformat(b)},add:function(a,b){var c=tb.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=tb.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=x(a),this[a.toLowerCase()+"s"]()},as:function(a){var b,c;if(a=x(a),"month"===a||"year"===a)return b=this._days+this._milliseconds/864e5,c=this._months+12*pb(b),"month"===a?c:c/12;switch(b=this._days+qb(this._months/12),a){case"week":return b/7+this._milliseconds/6048e5;case"day":return b+this._milliseconds/864e5;case"hour":return 24*b+this._milliseconds/36e5;case"minute":return 24*b*60+this._milliseconds/6e4;case"second":r
 eturn 24*b*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(24*b*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+a)}},lang:tb.fn.lang,locale:tb.fn.locale,toIsoString:f("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"},localeData:function(){return this._locale}}),tb.duration.fn.toString=tb.duration.fn.toISOString;for(vb in hc)c(hc,vb)&&rb(vb.toLowerCase());tb.duration.fn.asMilliseconds=function(){return this.as("ms")},tb.duration.fn.asSeconds=function(){return this.as("s")},tb.duration.fn.asMinutes=function(){return 
 this.as("m")},tb.duration.fn.asHours=function(){return this.as("h")},tb.duration.fn.asDays=function(){return this.as("d")},tb.duration.fn.asWeeks=function(){return this.as("weeks")},tb.duration.fn.asMonths=function(){return this.as("M")},tb.duration.fn.asYears=function(){return this.as("y")},tb.locale("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===A(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),Jb?module.exports=tb:"function"==typeof define&&define.amd?(define("moment",function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(xb.moment=ub),tb}),sb(!0)):sb()}.call(this);var blurconsole=function(){"use strict";function a(a){a.on("userLoggedIn",function(){blurconsole.model.initModule(),blurconsole.shell.initModule(a)}),blurconsole.auth.initModule(a)}return{initModule:a}}();blurconsole.auth=function(){"use strict";function a(c){c&&c.preventDefault();var d=b().find("form").serialize();return b().html('Attempting to login 
 <img src="img/ajax-loader.gif"/>'),$.ajax("service/auth/login",{type:"POST",data:d,success:function(c){c.loggedIn?(c.user&&(h=c.user.name,i=c.user.roles,j=c.user.securityNames),l.trigger("userLoggedIn")):c.formHtml?(b().html(c.formHtml),b().find("form").on("submit",a)):b().html("Login Failed")}}),!1}function b(){return m?m:(m=l.find(".auth_container"),0===m.length&&(m=$('<div class="auth_container jumbotron"></div>').appendTo(l)),m)}function c(b){l=b,window.location.href.indexOf("fakeIt=")>-1?(k=!0,h="fake user",l.trigger("userLoggedIn")):a()}function d(){return h}function e(a){if(k===!0)return!0;if(null!==i){if(i.indexOf("admin")>=0)return!0;if("manager"===a&&i.indexOf("manager")>=0)return!0;if("searcher"===a&&(i.indexOf("manager")>=0||i.indexOf("searcher")>=0))return!0}return!1}function f(){return i}function g(){return j}var h,i,j,k,l,m;return{initModule:c,getUsername:d,hasRole:e,getRoles:f,getSecurityNames:g}}(),blurconsole.browserUtils=function(){"use strict";function a(a,b){var
  c;return c='<table class="table table-bordered table-condensed table-hover table-striped">',a&&a.length>0&&a[0].width&&(c+="<colgroup>",$.each(a,function(a,b){c+='<col width="'+b.width+'"/>'}),c+="</colgroup>"),c+="<thead><tr>",$.each(a,function(a,b){c+="<th>"+b.label+"</th>"}),c+="</tr></thead><tbody>",b&&b.length>0?$.each(b,function(b,d){c+="<tr>",$.each(a,function(a,b){c+="<td",b.style&&(c+=' style="'+b.style+'"'),b["class"]&&(c+=' class="'+b["class"]+'"'),c+=">";var e;e=$.isFunction(b.key)?b.key(d):d[b.key],"number"===b.format&&(e=blurconsole.utils.formatNumber(e)),c+=e,c+="</td>"}),c+="</tr>"}):c+='<tr><td colspan="'+a.length+'">There are no items here</td></tr>',c+="</tbody></table>"}function b(a,b,c,d,e){var f,g,h=d;switch(e){case"large":f="modal-lg";break;case"medium":f="modal-md";break;default:f="modal-sm"}return g='<div class="modal fade" id="'+a+'">',g+='<div class="modal-dialog '+f+'">',g+='<div class="modal-content">',g+='<div class="modal-header"><button type="button"
  class="close" data-dismiss="modal">&times;</button><h4 class="modal-title">'+b+"</h4></div>",g+='<div class="modal-body">'+("string"===$.type(c)?c:$(c).html())+"</div>",h&&($.isArray(h)||(h=[h]),g+='<div class="modal-footer">',$.each(h,function(a,b){g+='<button type="button" class="btn '+b.classes+'" id="'+b.id+'" ',b.data&&$.each(b.data,function(a,b){g+="data-"+a+'="'+b+'" '}),g+=">"+b.label+"</button> "}),g+="</div>"),g+="</div></div></div>"}function c(a){return a.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"_")}function d(a){return!a||a!==!0&&"yes"!==a&&"true"!==a?'<div class="label label-danger"><i class="glyphicon glyphicon-minus-sign"></i></div>':'<div class="label label-success"><i class="glyphicon glyphicon-ok-sign"></i></div>'}return{table:a,modal:b,cleanId:c,booleanImg:d}}(),blurconsole.config={refreshtime:5e3},blurconsole.dashboard=function(){"use strict";function a(){var a=s.$container;t={$container:a,$zkChartHolder:$("#zookeeperNodes"),$zkInfoHolder:$("#zookeeper
 Info"),$controllerChartHolder:$("#controllerNodes"),$controllerInfoHolder:$("#controllerInfo"),$shardChartHolder:$("#shardNodes"),$tableChartHolder:$("#tableCounts"),$queryLoadChartHolder:$("#queryLoad")}}function b(){$(document).on("click",".swapper-trigger",f),$(window).on("resize",n)}function c(){$(document).off("click",".swapper-trigger"),$(window).off("resize")}function d(){e(),j(),k()}function e(){blurconsole.model.nodes.isDataLoaded()&&(g(),h(),i())}function f(a){var b=$(a.currentTarget).closest("div.swapper-parent"),c=b.find(".swapper-chart"),d=b.find(".swapper-info");c.toggleClass("hidden"),d.toggleClass("hidden")}function g(){$.plot(t.$zkChartHolder,blurconsole.model.metrics.getZookeeperChartData(),r.pieOptions),t.$zkInfoHolder.html(l(blurconsole.model.nodes.getOnlineZookeeperNodes(),blurconsole.model.nodes.getOfflineZookeeperNodes()))}function h(){$.plot(t.$controllerChartHolder,blurconsole.model.metrics.getControllerChartData(),r.pieOptions),t.$controllerInfoHolder.html(
 l(blurconsole.model.nodes.getOnlineControllerNodes(),blurconsole.model.nodes.getOfflineControllerNodes()))}function i(){t.$shardChartHolder.find("img").length>0&&t.$shardChartHolder.html(""),$.each(blurconsole.model.metrics.getClusters(),function(a,b){var c=blurconsole.model.metrics.getShardChartData(b);if(c){var d=t.$shardChartHolder.find("#cluster_"+b+"_chart_holder"),e=t.$shardChartHolder.find("#cluster_"+b+"_info");if(0===d.length){var f=$('<div class="swapper-parent"></div>');f.append($('<div class="text-center"><strong>'+b+'</strong> <small class="text-muted"><i class="glyphicon glyphicon-retweet swapper-trigger" title="Swap Chart/Info"></i></small></div>')),d=$('<div id="cluster_'+b+'_chart_holder" class="shardClusterChartHolder simple-chart swapper-chart"></div>'),f.append(d);var g=t.$shardChartHolder.parent()[0].clientWidth-150;d.css({height:g,width:g}),e=$('<div id="cluster_'+b+'_info" class="swapper-info hidden"></div>'),f.append(e),t.$shardChartHolder.append(f)}$.plot(d,
 c,r.pieOptions),e.html(l([],blurconsole.model.nodes.getOfflineShardNodes(b)))}})}function j(){blurconsole.model.tables.isDataLoaded()&&$.plot(t.$tableChartHolder,blurconsole.model.metrics.getTableChartData(),{bars:{show:!0,barWidth:.6,align:"center"},yaxis:{min:0,tickDecimals:0},xaxis:{mode:"categories"}})}function k(){$.plot(t.$queryLoadChartHolder,blurconsole.model.metrics.getQueryLoadChartData(),{series:{shadowSize:0},yaxis:{min:0},xaxis:{show:!1}})}function l(a,b){var c='<table class="table table-condensed"><thead><tr><th>Offline Node</th></tr></thead><tbody>';return 0===b.length?c+="<tr><td>Everything is Online!</td></tr>":$.each(b,function(a,b){c+="<tr><td>"+b+"</td></tr>"}),c+="</tbody></table>",a.length>0&&(c+='<table class="table table-condensed"><thead><tr><th>Online Node</th></tr></thead><tbody>',$.each(a,function(a,b){c+="<tr><td>"+b+"</td></tr>"}),c+="</tbody></table>"),$(c)}function m(a){var b;b=t[a].parent()[0].clientWidth-150,t[a].css({height:b,width:b})}function n()
 {m("$zkChartHolder"),m("$controllerChartHolder"),m("$tableChartHolder"),m("$queryLoadChartHolder");var a=t.$shardChartHolder.parent()[0].clientWidth-150,b=t.$shardChartHolder.find(".shardClusterChartHolder");b.each(function(){$(this).css({height:a,width:a})}),d()}function o(){blurconsole.model.metrics.getSlowQueryWarnings()?$("#slow-query-warnings").slideDown():$("#slow-query-warnings").slideUp()}function p(c){return c.load(r.view,function(){s.$container=c,a(),d(),o(),$.gevent.subscribe(t.$container,"node-status-updated",e),$.gevent.subscribe(t.$container,"tables-updated",j),$.gevent.subscribe(t.$container,"query-perf-updated",k),$.gevent.subscribe(t.$container,"queries-updated",o),n(),b()}),!0}function q(){$.gevent.unsubscribe(t.$container,"node-status-updated"),$.gevent.unsubscribe(t.$container,"tables-updated"),$.gevent.unsubscribe(t.$container,"query-perf-updated"),$.gevent.unsubscribe(t.$container,"queries-updated"),c()}var r={view:"views/dashboard.tpl.html",pieOptions:{series:
 {pie:{show:!0,radius:1,label:{show:!0,radius:2/3,formatter:function(a,b){return'<div style="font-size:10pt;font-weight:bold;text-align:center;padding:2px;color:white">'+a+"<br/>"+Math.round(b.percent)+"% ("+b.data[0][1]+")</div>"},threshold:.1}}},legend:{show:!1},title:"Test title"}},s={$container:null,zookeeperNodes:"chart",controllerNodes:"chart"},t={};return{initModule:p,unloadModule:q}}(),blurconsole.data=function(){"use strict";function a(a,b,c){var d=a.responseText,e=a.status;(401===e||403===e)&&window.location.reload(),blurconsole.model.logs.logError(e+" - "+d,b),c&&c("error")}function b(b){$.getJSON("service/tables",b).fail(function(c){a(c,"tables",b)})}function c(b){$.getJSON("service/nodes",b).fail(function(c){a(c,"tables",b)})}function d(b){$.getJSON("service/queries/performance",b).fail(function(c){a(c,"tables",b)})}function e(b){$.getJSON("service/queries",b).fail(function(c){a(c,"tables",b)})}function f(b,c){$.ajax("service/queries/"+c+"/cancel",{data:{table:b},error:f
 unction(b){a(b,"tables")}})}function g(b){$.ajax("service/tables/"+b+"/disable",{error:function(b){a(b,"tables")}})}function h(b){$.ajax("service/tables/"+b+"/enable",{error:function(b){a(b,"tables")}})}function i(b,c){$.ajax("service/tables/"+b+"/delete",{data:{includeFiles:c},error:function(b){a(b,"tables")}})}function j(b,c){$.getJSON("service/tables/"+b+"/schema",c).fail(function(b){a(b,"tables")})}function k(b,c,d,e,f){$.getJSON("service/tables/"+b+"/"+c+"/"+d+"/terms",{startsWith:e},f).fail(function(b){a(b,"tables")})}function l(b,c,d,e){$.ajax("service/tables/"+b+"/copy",{data:{newName:c,cluster:e,newLocation:d},error:function(b){a(b,"tables")}})}function m(b,c,d,e){var f=$.extend({table:c,query:b},d);$.ajax("service/search",{type:"POST",data:f,success:e,error:function(b){a(b,"search")}})}function n(b,c,d,e,f,g){var h={table:c,query:b,family:d,column:e,terms:f};$.ajax("service/search/facets",{type:"POST",data:h,success:g,error:function(b){a(b,"search")}})}return{getTableList:
 b,getNodeList:c,getQueryPerformance:d,getQueries:e,cancelQuery:f,disableTable:g,enableTable:h,deleteTable:i,getSchema:j,findTerms:k,copyTable:l,sendSearch:m,runFacetCount:n}}(),blurconsole.facets=function(){"use strict";function a(a){var b=k.familyChooser.val(),c=k.columnChooser.val(),d=j.query;blurconsole.shell.changeAnchorPart({tab:"search",_tab:{query:encodeURIComponent("+("+d+") +(+"+b+"."+c+":("+$(a.currentTarget).data("term")+"))"),table:j.table,rr:"rowrow"}}),k.modal.modal("hide")}function b(a,b){j.table=b.table,j.query=b.query,j.modalId=j.table+"_modal",blurconsole.model.tables.getSchema(j.table,c)}function c(b){j.schema=b,k.contentHolder=$(i.mainHtml),k.contentHolder.find("#facetFamily").html(d()),k.modal=$(blurconsole.browserUtils.modal(j.modalId,"Faceting for "+j.query,k.contentHolder,null,"large")),k.modal.modal().on("shown.bs.modal",function(){k.familyChooser=$("#facetFamily",k.modal),k.columnChooser=$("#facetColumn",k.modal),k.facetResults=$(".facetResults",k.modal),k.
 terms=$("#facetTerms",k.modal),k.terms.tagsManager({tagsContainer:$(".facetTermList",k.modal)}),$("#facetSubmit",k.modal).on("click",f)}).on("hidden.bs.modal",function(a){$(a.currentTarget).remove(),k.contentHolder.remove(),k={},j={}}).on("change","select#facetFamily",function(a){var b=$(a.currentTarget).val();return k.columnChooser.html(e(b)),!1}).on("click",".searchTrigger",a)}function d(){var a='<option value="">Select a Family</option>';return $.each(j.schema,function(b){a+='<option value="'+b+'">'+b+"</option>"}),a}function e(a){var b='<option value="">Select a Column</option>';return $.each(j.schema[a],function(a){b+='<option value="'+a+'">'+a+"</option>"}),b}function f(){var a=k.familyChooser.val(),b=k.columnChooser.val(),c=k.terms.tagsManager("tags");k.terms.val()&&(k.terms.tagsManager("pushTag",k.terms.val()),c=k.terms.tagsManager("tags")),a&&b&&c.length>0?($(".facetWarning",k.modal).hide(),blurconsole.model.search.runFacetCount(j.query,j.table,a,b,c,g)):$(".facetWarning",k
 .modal).show()}function g(a){var b='<table class="table table-condensed table-hover table-bordered"><thead><tr><th>Term</th><th>Count</th><th></th></thead><tbody>';$.each(a,function(a,c){b+="<tr>",b+="<td>"+a+"</td>",b+="<td>"+c+"</td>",b+='<td><button type="button" class="btn btn-sm btn-default searchTrigger" title="Run search with facet added" data-term="'+a+'"><i class="glyphicon glyphicon-search"/></button></td>',b+="</tr>"}),b+="</tbody></table>",k.facetResults.html(b)}function h(){$.gevent.subscribe($(document),"facet-show",b)}var i={mainHtml:String()+'<div class="container-fluid"><div class="alert alert-danger facetWarning" style="display:none">Please make sure you select a family, column and add terms to run faceting.</div><div class="row"><form><div class="col-md-6"><div class="form-group"><label for="facetFamily">Family</label><select class="form-control" id="facetFamily"></select></div><div class="form-group"><label for="facetColumn">Column</label><select class="form-cont
 rol" id="facetColumn"></select></div></div><div class="col-md-6"><div class="form-group"><label for="facetTerms">Terms</label><input type="text" name="facetTerms" class="form-control tm-input" id="facetTerms" autocomplete="off"/><div class="facetTermList"></div></div><div class="form-group"><button type="button" class="btn btn-primary" id="facetSubmit">Run</button></div></div></form></div><hr/><div class="row"><div class="col-md-12 facetResults"></div></div></div>'},j={},k={};return{initModule:h}}(),blurconsole.fake=function(){"use strict";function a(a,b){var c=Math.random()*a;return b||c++,Math.floor(c)}function b(){return a(2)%2===0}function c(a){a="undefined"!=typeof a?a:30;for(var b="",c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ",d=0;d<Math.floor(Math.random()*a+1);d++)b+=c.charAt(Math.floor(Math.random()*c.length));return b}function d(){for(var c={},d=a(20),e=["string","long","int","date","stored","customType"],f=0;d>f;f++){var g,h={},i=a(30);for(g=0;i>g;
 g++){var j="col"+g;if(1===a(10)&&(j+=".sub"),h[j]={fieldLess:b(),type:e[a(6,!0)],extra:null},b()){var k,l=a(3),m={};for(k=0;l>k;k++)m["extra"+k]="val"+k;h[j].extra=m}}c["fam"+f]=h}return c}function e(b,c){setTimeout(function(){b(c)},a(1e3))}function f(){var a=$("#fake_freeze");"Freeze"===a.html()?(y=!0,a.html("Unfreeze"),console.log("Fake data frozen")):(y=!1,a.html("Freeze"),console.log("Fake data resumed"))}function g(c){if(!y||!u){for(var f=["prodA","prodB"],g=[],h=0;5>h;h++){var i=f[a(2,!0)],j=a(1e3),k=a(1e4)+1e3,l=b();g.push({cluster:i,name:"testtable"+h,enabled:l,rows:j,records:k,families:blurconsole.utils.keys(d())})}u={tables:g,clusters:f}}e(c,u)}function h(a){if(!y||!w){for(var c={online:[],offline:[]},d=[{name:"prodA",online:[],offline:[]},{name:"prodB",online:[],offline:[]}],f={online:[],offline:[]},g=0;3>g;g++){var h=b();h?(c.online.push("controller"+g+".localhost"),d[0].online.push("prodA.shard"+g+".localhost"),d[1].online.push("prodB.shard"+g+".localhost"),f.online.pus
 h("zookeeper"+g+".localhost")):(c.offline.push("controller"+g+".localhost"),d[0].offline.push("prodA.shard"+g+".localhost"),d[1].offline.push("prodB.shard"+g+".localhost"),f.offline.push("zookeeper"+g+".localhost"))}w={controllers:c,clusters:d,zookeepers:f}}e(a,w)}function i(b){e(b,a(1e3,!0))}function j(b){if(!y||!x){for(var d=[],f=0;f<a(50);f++)d.push({uuid:c(),user:"user_"+a(10,!0),query:c(500),table:"testtable"+a(5,!0),state:a(3,!0),percent:a(100,!0),startTime:(new Date).getTime()});x={slowQueries:1===a(10),queries:d}}e(b,x)}function k(a,b){console.log("Fake sending request to cancel query ["+b+"] on table ["+a+"]")}function l(a){console.log("Fake sending request to disable table ["+a+"]")}function m(a){console.log("Fake sending request to enable table ["+a+"]")}function n(a,b){console.log("Fake sending request to delete table ["+a+"] with files ["+b+"]")}function o(a,b){console.log("getting fake schema for table ["+a+"]"),y&&v||(v=d()),e(b,v)}function p(a,b,d,f,g){console.log("g
 etting fake terms from ["+a+"] for family ["+b+"] and column ["+d+"] starting with ["+f+"]");for(var h=[],i=0;10>i;i++){var j=c();f&&(j=f+j),h.push(j)}h=h.sort(function(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())}),e(g,h)}function q(a,b,c,d){console.log("Fake sending request to copy table ["+a+"] to ["+b+"] on cluster ["+d+"] stored in location ["+c+"]")}function r(b,d,f,g){console.log("sending fake search ["+b+"] on table ["+d+"]");var h=f.families,i={},j=null!==h&&h.indexOf("rowid")>=0?1:a(5e3);(null===h||0===h.length)&&$.each(u.tables,function(a,b){if(b.name===d){var c=b.families;return c.sort(),h=[c[0]],!1}}),null!==h&&$.each(h,function(b,d){var e=a(30,!0),g=null!==h&&h.indexOf("rowid")>=0?1:f.fetch;if(j-f.start<g&&(g=j-f.start),"recordrecord"===f.rowRecordOption){i[d]=[];for(var k=0;k<a(g);k++){var l={};l.recordid=a(1e6).toString();for(var m=0;e>m;m++)l["col"+m]=c();i[d].push(l)}}else{i[d]=[];for(var n=0;n<a(g);n++){var o=a(1e7).toString();i[d][n]={rowid:o,record
 s:[]};for(var p=0;p<a(10);p++){var q={};q.recordid=a(1e6).toString();for(var r=0;e>r;r++)q["col"+r]=c();i[d][n].records.push(q)}}}}),h.indexOf("rowid")>=0?e(g,{total:j,results:i,families:h}):e(g,{families:h,results:i,total:j})}function s(b,c,d,f,g,h){console.log("sending fake facet count ["+g+"] on table ["+c+"] on against query ["+b+"]");var i={};$.each(g,function(b,c){i[c]=a(100,!0)}),e(h,i)}function t(){$("nav.navbar .pull-right").append('<button type="button" id="fake_freeze" class="btn btn-default btn-sm">Freeze</button>'),$("#fake_freeze").click(f)}var u,v,w,x,y=!1;return{initModule:t,getTableList:g,getNodeList:h,getQueryPerformance:i,getQueries:j,cancelQuery:k,disableTable:l,enableTable:m,deleteTable:n,getSchema:o,findTerms:p,copyTable:q,sendSearch:r,runFacetCount:s}}(),blurconsole.logging=function(){"use strict";function a(){null===f.modal?(f.modal=$(blurconsole.browserUtils.modal("error_log_modal","Error Logs",e.mainHtml,e.buttons,"large")),f.modal.modal().on("shown.bs.moda
 l",function(){f.logHolder=$(".log_display",f.modal),c()}).on("click","#clear-log-button",b)):f.modal.modal("show")}function b(){f.logHolder.html(e.emptyLogMsg),blurconsole.model.logs.clearErrors()}function c(){var a=blurconsole.model.logs.getLogs();if(f.logHolder)if(0===a.length)f.logHolder.html(e.emptyLogMsg);else{var b="<ul>";a.sort(function(a,b){return a.timestamp.getTime()>b.timestamp.getTime()}),$.each(a,function(a,c){b+="<li><strong>"+c.error+" ("+c.module+')</strong><div class="pull-right"><em>'+c.timestamp.toTimeString()+"</em></div></li>"}),b+="</ul>",f.logHolder.html(b)}}function d(){$.gevent.subscribe($(document),"show-logging",a),$.gevent.subscribe($(document),"logging-updated",c)}var e={emptyLogMsg:"No Errors! Yay!",mainHtml:'<div class="log_display"></div>',buttons:[{classes:"btn-default",id:"clear-log-button",label:"Clear Logs"},{classes:"btn-primary",id:"close-logs",label:"Close",data:{dismiss:"modal"}}]},f={modal:null};return{initModule:d}}(),blurconsole.model=funct
 ion(){"use strict";function a(){j.poller.getNodeList(e)}function b(){j.poller.getTableList(f)}function c(){j.poller.getQueryPerformance(g)}function d(){j.poller.getQueries(h)}function e(b){"error"===b||blurconsole.utils.equals(b,k.nodeMap)||(k.nodeMap=b,$.gevent.publish("node-status-updated")),setTimeout(a,blurconsole.config.refreshtime)}function f(a){if("error"!==a){var c=a.tables,d=a.clusters;blurconsole.utils.equals(c,k.currentTables)&&blurconsole.utils.equals(d,k.currentClusters)||(k.currentTables=c,k.currentClusters=d,$.gevent.publish("tables-updated"))}setTimeout(b,blurconsole.config.refreshtime)}function g(a){"error"!==a&&(100===k.queryPerformance.length&&k.queryPerformance.shift(),k.queryPerformance.push(a),$.gevent.publish("query-perf-updated")),setTimeout(c,blurconsole.config.refreshtime)}function h(a){"error"===a||blurconsole.utils.equals(a,k.queries)||(k.queries.slowQueries=a.slowQueries,k.queries.queries?$.each(k.queries.queries,function(a,b){b.age=(b.age||0)+1}):k.quer
 ies.queries=[],$.each(a.queries,function(a,b){var c=!1;$.each(k.queries.queries,function(a,d){d.uuid===b.uuid&&(c=!0,d.age=0,d.state=b.state,d.percent=b.percent)}),c||k.queries.queries.push(b)}),k.queries.queries=$.grep(k.queries.queries,function(a){return"undefined"==typeof a.age||a.age<5}),$.gevent.publish("queries-updated")),setTimeout(d,blurconsole.config.refreshtime)}function i(){window.location.href.indexOf("fakeIt=")>-1?(blurconsole.fake.initModule(),j.poller=blurconsole.fake):j.poller=blurconsole.data,setTimeout(function(){a(),b(),c(),d()},1e3)}var j={poller:null},k={currentTables:null,currentClusters:[],nodeMap:null,queryPerformance:[],queries:{},errors:[],schema:{}},l=function(){function a(){return null===k.currentClusters?[]:blurconsole.utils.unique(k.currentClusters,!0)}function b(a){var b=[

<TRUNCATED>

Mime
View raw message