diff --git a/dist/app/app.js b/dist/app/app.js
index 6a78d451269..0a4e38fd981 100644
--- a/dist/app/app.js
+++ b/dist/app/app.js
@@ -12,7 +12,8 @@ Dc.$inject=["$locale"];var Id=p(Rc),Jd=p(Sc);Gc.$inject=["$parse"];var Kd=p({res
},boostTerms:function(b){return null==b?c.mlt_field[a].boost_terms:(c.mlt_field[a].boost_terms=b,this)},boost:function(b){return null==b?c.mlt_field[a].boost:(c.mlt_field[a].boost=b,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.MoreLikeThisQuery=function(a,b){var c={mlt:{like_text:b,fields:[]}};if(f(a))c.mlt.fields.push(a);else{if(!d(a))throw new TypeError("Argument must be string or array");c.mlt.fields=a}return{fields:function(a){if(null==a)return c.mlt.fields;if(f(a))c.mlt.fields.push(a);else{if(!d(a))throw new TypeError("Argument must be a string or array");c.mlt.fields=a}return this},likeText:function(a){return null==a?c.mlt.like_text:(c.mlt.like_text=a,this)},percentTermsToMatch:function(a){return null==a?c.mlt.percent_terms_to_match:(c.mlt.percent_terms_to_match=a,this)},minTermFreq:function(a){return null==a?c.mlt.min_term_freq:(c.mlt.min_term_freq=a,this)},maxQueryTerms:function(a){return null==a?c.mlt.max_query_terms:(c.mlt.max_query_terms=a,this)},stopWords:function(a){return null==a?c.mlt.stop_words:(c.mlt.stop_words=a,this)},minDocFreq:function(a){return null==a?c.mlt.min_doc_freq:(c.mlt.min_doc_freq=a,this)},maxDocFreq:function(a){return null==a?c.mlt.max_doc_freq:(c.mlt.max_doc_freq=a,this)},minWordLen:function(a){return null==a?c.mlt.min_word_len:(c.mlt.min_word_len=a,this)},maxWordLen:function(a){return null==a?c.mlt.max_word_len:(c.mlt.max_word_len=a,this)},analyzer:function(a){return null==a?c.mlt.analyzer:(c.mlt.analyzer=a,this)},boostTerms:function(a){return null==a?c.mlt.boost_terms:(c.mlt.boost_terms=a,this)},boost:function(a){return null==a?c.mlt.boost:(c.mlt.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.MultiMatchQuery=function(a,b){var c={multi_match:{query:b,fields:[]}};if(f(a))c.multi_match.fields.push(a);else{if(!d(a))throw new TypeError("Argument must be string or array");c.multi_match.fields=a}return{fields:function(a){if(null==a)return c.multi_match.fields;if(f(a))c.multi_match.fields.push(a);else{if(!d(a))throw new TypeError("Argument must be string or array");c.multi_match.fields=a}return this},useDisMax:function(a){return null==a?c.multi_match.use_dis_max:(c.multi_match.use_dis_max=a,this)},tieBreaker:function(a){return null==a?c.multi_match.tie_breaker:(c.multi_match.tie_breaker=a,this)},cutoffFrequency:function(a){return null==a?c.multi_match.cutoff_frequency:(c.multi_match.cutoff_frequency=a,this)},minimumShouldMatch:function(a){return null==a?c.multi_match.minimum_should_match:(c.multi_match.minimum_should_match=a,this)},rewrite:function(a){return null==a?c.multi_match.rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(c.multi_match.rewrite=a),this)},fuzzyRewrite:function(a){return null==a?c.multi_match.fuzzy_rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(c.multi_match.fuzzy_rewrite=a),this)},lenient:function(a){return null==a?c.multi_match.lenient:(c.multi_match.lenient=a,this)},boost:function(a){return null==a?c.multi_match.boost:(c.multi_match.boost=a,this)},query:function(a){return null==a?c.multi_match.query:(c.multi_match.query=a,this)},type:function(a){return null==a?c.multi_match.type:(a=a.toLowerCase(),("boolean"===a||"phrase"===a||"phrase_prefix"===a)&&(c.multi_match.type=a),this)},fuzziness:function(a){return null==a?c.multi_match.fuzziness:(c.multi_match.fuzziness=a,this)},prefixLength:function(a){return null==a?c.multi_match.prefix_length:(c.multi_match.prefix_length=a,this)},maxExpansions:function(a){return null==a?c.multi_match.max_expansions:(c.multi_match.max_expansions=a,this)},operator:function(a){return null==a?c.multi_match.operator:(a=a.toLowerCase(),("and"===a||"or"===a)&&(c.multi_match.operator=a),this)},slop:function(a){return null==a?c.multi_match.slop:(c.multi_match.slop=a,this)},analyzer:function(a){return null==a?c.multi_match.analyzer:(c.multi_match.analyzer=a,this)},zeroTermsQuery:function(a){return null==a?c.multi_match.zero_terms_query:(a=a.toLowerCase(),("all"===a||"none"===a)&&(c.multi_match.zero_terms_query=a),this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.NestedQuery=function(a){var b={nested:{path:a}};return{path:function(a){return null==a?b.nested.path:(b.nested.path=a,this)},query:function(a){if(null==a)return b.nested.query;if(!j(a))throw new TypeError("Argument must be a Query");return b.nested.query=a._self(),this},filter:function(a){if(null==a)return b.nested.filter;if(!k(a))throw new TypeError("Argument must be a Filter");return b.nested.filter=a._self(),this},scoreMode:function(a){return null==a?b.nested.score_mode:(a=a.toLowerCase(),("avg"===a||"total"===a||"max"===a||"none"===a)&&(b.nested.score_mode=a),this)},scope:function(){return this},boost:function(a){return null==a?b.nested.boost:(b.nested.boost=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"query"},_self:function(){return b}}},u.PrefixQuery=function(a,b){var c={prefix:{}};return c.prefix[a]={value:b},{field:function(b){var d=c.prefix[a];return null==b?a:(delete c.prefix[a],a=b,c.prefix[b]=d,this)},value:function(b){return null==b?c.prefix[a].value:(c.prefix[a].value=b,this)},rewrite:function(b){return null==b?c.prefix[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(c.prefix[a].rewrite=b),this)},boost:function(b){return null==b?c.prefix[a].boost:(c.prefix[a].boost=b,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.QueryStringQuery=function(a){var b={query_string:{}};return b.query_string.query=a,{query:function(a){return null==a?b.query_string.query:(b.query_string.query=a,this)},defaultField:function(a){return null==a?b.query_string.default_field:(b.query_string.default_field=a,this)},fields:function(a){if(null==b.query_string.fields&&(b.query_string.fields=[]),null==a)return b.query_string.fields;if(f(a))b.query_string.fields.push(a);else{if(!d(a))throw new TypeError("Argument must be a string or array");b.query_string.fields=a}return this},useDisMax:function(a){return null==a?b.query_string.use_dis_max:(b.query_string.use_dis_max=a,this)},defaultOperator:function(a){return null==a?b.query_string.default_operator:(a=a.toUpperCase(),("AND"===a||"OR"===a)&&(b.query_string.default_operator=a),this)},analyzer:function(a){return null==a?b.query_string.analyzer:(b.query_string.analyzer=a,this)},quoteAnalyzer:function(a){return null==a?b.query_string.quote_analyzer:(b.query_string.quote_analyzer=a,this)},allowLeadingWildcard:function(a){return null==a?b.query_string.allow_leading_wildcard:(b.query_string.allow_leading_wildcard=a,this)},lowercaseExpandedTerms:function(a){return null==a?b.query_string.lowercase_expanded_terms:(b.query_string.lowercase_expanded_terms=a,this)},enablePositionIncrements:function(a){return null==a?b.query_string.enable_position_increments:(b.query_string.enable_position_increments=a,this)},fuzzyPrefixLength:function(a){return null==a?b.query_string.fuzzy_prefix_length:(b.query_string.fuzzy_prefix_length=a,this)},fuzzyMinSim:function(a){return null==a?b.query_string.fuzzy_min_sim:(b.query_string.fuzzy_min_sim=a,this)},phraseSlop:function(a){return null==a?b.query_string.phrase_slop:(b.query_string.phrase_slop=a,this)},boost:function(a){return null==a?b.query_string.boost:(b.query_string.boost=a,this)},analyzeWildcard:function(a){return null==a?b.query_string.analyze_wildcard:(b.query_string.analyze_wildcard=a,this)},autoGeneratePhraseQueries:function(a){return null==a?b.query_string.auto_generate_phrase_queries:(b.query_string.auto_generate_phrase_queries=a,this)},minimumShouldMatch:function(a){return null==a?b.query_string.minimum_should_match:(b.query_string.minimum_should_match=a,this)},tieBreaker:function(a){return null==a?b.query_string.tie_breaker:(b.query_string.tie_breaker=a,this)},escape:function(a){return null==a?b.query_string.escape:(b.query_string.escape=a,this)},fuzzyMaxExpansions:function(a){return null==a?b.query_string.fuzzy_max_expansions:(b.query_string.fuzzy_max_expansions=a,this)},fuzzyRewrite:function(a){return null==a?b.query_string.fuzzy_rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(b.query_string.fuzzy_rewrite=a),this)},rewrite:function(a){return null==a?b.query_string.rewrite:(a=a.toLowerCase(),("constant_score_auto"===a||"scoring_boolean"===a||"constant_score_boolean"===a||"constant_score_filter"===a||0===a.indexOf("top_terms_boost_")||0===a.indexOf("top_terms_"))&&(b.query_string.rewrite=a),this)},quoteFieldSuffix:function(a){return null==a?b.query_string.quote_field_suffix:(b.query_string.quote_field_suffix=a,this)},lenient:function(a){return null==a?b.query_string.lenient:(b.query_string.lenient=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"query"},_self:function(){return b}}},u.RangeQuery=function(a){var b={range:{}};return b.range[a]={},{field:function(c){var d=b.range[a];return null==c?a:(delete b.range[a],a=c,b.range[c]=d,this)},from:function(c){return null==c?b.range[a].from:(b.range[a].from=c,this)},to:function(c){return null==c?b.range[a].to:(b.range[a].to=c,this)},includeLower:function(c){return null==c?b.range[a].include_lower:(b.range[a].include_lower=c,this)},includeUpper:function(c){return null==c?b.range[a].include_upper:(b.range[a].include_upper=c,this)},gt:function(c){return null==c?b.range[a].gt:(b.range[a].gt=c,this)},gte:function(c){return null==c?b.range[a].gte:(b.range[a].gte=c,this)},lt:function(c){return null==c?b.range[a].lt:(b.range[a].lt=c,this)},lte:function(c){return null==c?b.range[a].lte:(b.range[a].lte=c,this)},boost:function(c){return null==c?b.range[a].boost:(b.range[a].boost=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"query"},_self:function(){return b}}},u.RegexpQuery=function(a,b){var c={regexp:{}};return c.regexp[a]={value:b},{field:function(b){var d=c.regexp[a];return null==b?a:(delete c.regexp[a],a=b,c.regexp[b]=d,this)},value:function(b){return null==b?c.regexp[a].value:(c.regexp[a].value=b,this)},flags:function(b){return null==b?c.regexp[a].flags:(c.regexp[a].flags=b,this)},flagsValue:function(b){return null==b?c.regexp[a].flags_value:(c.regexp[a].flags_value=b,this)},rewrite:function(b){return null==b?c.regexp[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(c.regexp[a].rewrite=b),this)},boost:function(b){return null==b?c.regexp[a].boost:(c.regexp[a].boost=b,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.SpanFirstQuery=function(a,b){if(!j(a))throw new TypeError("Argument must be a SpanQuery");var c={span_first:{match:a._self(),end:b}};return{match:function(a){if(null==a)return c.span_first.match;if(!j(a))throw new TypeError("Argument must be a SpanQuery");return c.span_first.match=a._self(),this},end:function(a){return null==a?c.span_first.end:(c.span_first.end=a,this)},boost:function(a){return null==a?c.span_first.boost:(c.span_first.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.SpanNearQuery=function(a,b){var c,e,f={span_near:{clauses:[],slop:b}};if(j(a))f.span_near.clauses.push(a._self());else{if(!d(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(c=0,e=a.length;e>c;c++){if(!j(a[c]))throw new TypeError("Argument must be array of SpanQueries");f.span_near.clauses.push(a[c]._self())}}return{clauses:function(a){var b,c;if(null==a)return f.span_near.clauses;if(j(a))f.span_near.clauses.push(a._self());else{if(!d(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(f.span_near.clauses=[],b=0,c=a.length;c>b;b++){if(!j(a[b]))throw new TypeError("Argument must be array of SpanQueries");f.span_near.clauses.push(a[b]._self())}}return this},slop:function(a){return null==a?f.span_near.slop:(f.span_near.slop=a,this)},inOrder:function(a){return null==a?f.span_near.in_order:(f.span_near.in_order=a,this)},collectPayloads:function(a){return null==a?f.span_near.collect_payloads:(f.span_near.collect_payloads=a,this)},boost:function(a){return null==a?f.span_near.boost:(f.span_near.boost=a,this)},toString:function(){return JSON.stringify(f)},_type:function(){return"query"},_self:function(){return f}}},u.SpanNotQuery=function(a,b){if(!j(a)||!j(b))throw new TypeError("Argument must be a SpanQuery");var c={span_not:{include:a._self(),exclude:b._self()}};return{include:function(a){if(null==a)return c.span_not.include;if(!j(a))throw new TypeError("Argument must be a SpanQuery");return c.span_not.include=a._self(),this},exclude:function(a){if(null==a)return c.span_not.exclude;if(!j(a))throw new TypeError("Argument must be a SpanQuery");return c.span_not.exclude=a._self(),this},boost:function(a){return null==a?c.span_not.boost:(c.span_not.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.SpanOrQuery=function(a){var b,c,e={span_or:{clauses:[]}};if(j(a))e.span_or.clauses.push(a._self());else{if(!d(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(b=0,c=a.length;c>b;b++){if(!j(a[b]))throw new TypeError("Argument must be array of SpanQueries");e.span_or.clauses.push(a[b]._self())}}return{clauses:function(a){var b,c;if(null==a)return e.span_or.clauses;if(j(a))e.span_or.clauses.push(a._self());else{if(!d(a))throw new TypeError("Argument must be SpanQuery or array of SpanQueries");for(e.span_or.clauses=[],b=0,c=a.length;c>b;b++){if(!j(a[b]))throw new TypeError("Argument must be array of SpanQueries");e.span_or.clauses.push(a[b]._self())}}return this},boost:function(a){return null==a?e.span_or.boost:(e.span_or.boost=a,this)},toString:function(){return JSON.stringify(e)},_type:function(){return"query"},_self:function(){return e}}},u.SpanTermQuery=function(a,b){var c={span_term:{}};return c.span_term[a]={term:b},{field:function(b){var d=c.span_term[a];return null==b?a:(delete c.span_term[a],a=b,c.span_term[b]=d,this)},term:function(b){return null==b?c.span_term[a].term:(c.span_term[a].term=b,this)},boost:function(b){return null==b?c.span_term[a].boost:(c.span_term[a].boost=b,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.TermQuery=function(a,b){var c={term:{}};return c.term[a]={term:b},{field:function(b){var d=c.term[a];return null==b?a:(delete c.term[a],a=b,c.term[b]=d,this)},term:function(b){return null==b?c.term[a].term:(c.term[a].term=b,this)},boost:function(b){return null==b?c.term[a].boost:(c.term[a].boost=b,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.TermsQuery=function(a,b){var c={terms:{}};if(f(b))c.terms[a]=[b];else{if(!d(b))throw new TypeError("Argument must be string or array");c.terms[a]=b}return{field:function(b){var d=c.terms[a];return null==b?a:(delete c.terms[a],a=b,c.terms[b]=d,this)},terms:function(b){if(null==b)return c.terms[a];if(f(b))c.terms[a].push(b);else{if(!d(b))throw new TypeError("Argument must be string or array");c.terms[a]=b}return this},minimumShouldMatch:function(a){return null==a?c.terms.minimum_should_match:(c.terms.minimum_should_match=a,this)},disableCoord:function(a){return null==a?c.terms.disable_coord:(c.terms.disable_coord=a,this)},boost:function(a){return null==a?c.terms.boost:(c.terms.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.TopChildrenQuery=function(a,b){if(!j(a))throw new TypeError("Argument must be a Query");var c={top_children:{query:a._self(),type:b}};return{query:function(a){if(null==a)return c.top_children.query;if(!j(a))throw new TypeError("Argument must be a Query");return c.top_children.query=a._self(),this},type:function(a){return null==a?c.top_children.type:(c.top_children.type=a,this)},scope:function(){return this},score:function(a){return null==a?c.top_children.score:(a=a.toLowerCase(),("max"===a||"sum"===a||"avg"===a)&&(c.top_children.score=a),this)},factor:function(a){return null==a?c.top_children.factor:(c.top_children.factor=a,this)},incrementalFactor:function(a){return null==a?c.top_children.incremental_factor:(c.top_children.incremental_factor=a,this)},boost:function(a){return null==a?c.top_children.boost:(c.top_children.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.WildcardQuery=function(a,b){var c={wildcard:{}};return c.wildcard[a]={value:b},{field:function(b){var d=c.wildcard[a];return null==b?a:(delete c.wildcard[a],a=b,c.wildcard[b]=d,this)},value:function(b){return null==b?c.wildcard[a].value:(c.wildcard[a].value=b,this)},rewrite:function(b){return null==b?c.wildcard[a].rewrite:(b=b.toLowerCase(),("constant_score_auto"===b||"scoring_boolean"===b||"constant_score_boolean"===b||"constant_score_filter"===b||0===b.indexOf("top_terms_boost_")||0===b.indexOf("top_terms_"))&&(c.wildcard[a].rewrite=b),this)},boost:function(b){return null==b?c.wildcard[a].boost:(c.wildcard[a].boost=b,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.GeoPoint=function(b){var c=[0,0];return null!=b&&d(b)&&2===b.length&&(c=[b[1],b[0]]),{properties:function(b){return null==b?c:(e(b)&&a(b,"lat")&&a(b,"lon")&&(c={lat:b.lat,lon:b.lon}),this)},string:function(a){return null==a?c:(f(a)&&-1!==a.indexOf(",")&&(c=a),this)},geohash:function(a,b){return b=null!=b&&g(b)?b:12,null==a?c:(f(a)&&a.length===b&&(c=a),this)},array:function(a){return null==a?c:(d(a)&&2===a.length&&(c=[a[1],a[0]]),this)},toString:function(){return JSON.stringify(c)},_type:function(){return"geo point"},_self:function(){return c}}},u.Highlight=function(c){var e={fields:{}},g=function(b,c,d){null==b?e[c]=d:(a(e.fields,b)||(e.fields[b]={}),e.fields[b][c]=d)};return null!=c&&(f(c)?e.fields[c]={}:d(c)&&b(c,function(a){e.fields[a]={}})),{fields:function(c){return null==c?e.fields:(f(c)?a(e.fields,c)||(e.fields[c]={}):d(c)&&b(c,function(b){a(e.fields,b)||(e.fields[b]={})}),void 0)},preTags:function(a,b){return null===a&&null!=b?e.fields[b].pre_tags:null==a?e.pre_tags:(f(a)?g(b,"pre_tags",[a]):d(a)&&g(b,"pre_tags",a),this)},postTags:function(a,b){return null===a&&null!=b?e.fields[b].post_tags:null==a?e.post_tags:(f(a)?g(b,"post_tags",[a]):d(a)&&g(b,"post_tags",a),this)},order:function(a,b){return null===a&&null!=b?e.fields[b].order:null==a?e.order:(a=a.toLowerCase(),"score"===a&&g(b,"order",a),this)},tagsSchema:function(a){return null==a?e.tags_schema:(a=a.toLowerCase(),"styled"===a&&(e.tags_schema=a),this)},highlightFilter:function(a,b){return null===a&&null!=b?e.fields[b].highlight_filter:null==a?e.highlight_filter:(g(b,"highlight_filter",a),this)},fragmentSize:function(a,b){return null===a&&null!=b?e.fields[b].fragment_size:null==a?e.fragment_size:(g(b,"fragment_size",a),this)},numberOfFragments:function(a,b){return null===a&&null!=b?e.fields[b].number_of_fragments:null==a?e.number_of_fragments:(g(b,"number_of_fragments",a),this)},encoder:function(a){return null==a?e.encoder:(a=a.toLowerCase(),("default"===a||"html"===a)&&(e.encoder=a),this)},requireFieldMatch:function(a,b){return null===a&&null!=b?e.fields[b].require_field_match:null==a?e.require_field_match:(g(b,"require_field_match",a),this)},boundaryMaxScan:function(a,b){return null===a&&null!=b?e.fields[b].boundary_max_scan:null==a?e.boundary_max_scan:(g(b,"boundary_max_scan",a),this)},boundaryChars:function(a,b){return null===a&&null!=b?e.fields[b].boundary_chars:null==a?e.boundary_chars:(g(b,"boundary_chars",a),this)},type:function(a,b){return null===a&&null!=b?e.fields[b].type:null==a?e.type:(a=a.toLowerCase(),("fast-vector-highlighter"===a||"highlighter"===a)&&g(b,"type",a),this)},fragmenter:function(a,b){return null===a&&null!=b?e.fields[b].fragmenter:null==a?e.fragmenter:(a=a.toLowerCase(),("simple"===a||"span"===a)&&g(b,"fragmenter",a),this)},toString:function(){return JSON.stringify(e)},_type:function(){return"highlight"},_self:function(){return e}}},u.IndexedShape=function(a,b){var c={type:a,id:b};return{type:function(a){return null==a?c.type:(c.type=a,this)},id:function(a){return null==a?c.id:(c.id=a,this)},index:function(a){return null==a?c.index:(c.index=a,this)},shapeFieldName:function(a){return null==a?c.shape_field_name:(c.shape_field_name=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"indexed shape"},_self:function(){return c}}},u.Request=function(b){var e,g,h,i={},n=function(b){var c="",d=[];g.length>0&&(c=c+"/"+g.join()),h.length>0&&(c=c+"/"+h.join()),b.length>0&&"/"!==b[0]&&(c+="/"),c+=b;for(var e in i)a(i,e)&&""!==i[e]&&d.push(e+"="+encodeURIComponent(i[e]));return d.length>0&&(c=c+"?"+d.join("&")),c};return e={},b=b||{},g=null==b.indices?[]:f(b.indices)?[b.indices]:b.indices,h=null==b.types?[]:f(b.types)?[b.types]:b.types,0===g.length&&h.length>0&&(g=["_all"]),null!=b.routing&&(i.routing=b.routing),{sort:function(){var b,c;if(a(e,"sort")||(e.sort=[]),0===arguments.length)return e.sort;if(1===arguments.length){var g=arguments[0];if(f(g))e.sort.push(g);else if(q(g))e.sort.push(g._self());else{if(!d(g))throw new TypeError("Argument must be string, Sort, or array");for(e.sort=[],b=0,c=g.length;c>b;b++)if(f(g[b]))e.sort.push(g[b]);else{if(!q(g[b]))throw new TypeError("Invalid object in array");e.sort.push(g[b]._self())}}}else if(2===arguments.length){var h=arguments[0],i=arguments[1];if(f(h)&&f(i)&&(i=i.toLowerCase(),"asc"===i||"desc"===i)){var j={};j[h]={order:i},e.sort.push(j)}}return this},trackScores:function(a){return null==a?e.track_scores:(e.track_scores=a,this)},size:function(a){return null==a?e.size:(e.size=a,this)},timeout:function(a){return null==a?i.timeout:(i.timeout=a,this)},routing:function(a){return null==a?i.routing:(i.routing=a,this)},replication:function(a){return null==a?i.replication:(a=a.toLowerCase(),("async"===a||"sync"===a||"default"===a)&&(i.replication=a),this)},consistency:function(a){return null==a?i.consistency:(a=a.toLowerCase(),("default"===a||"one"===a||"quorum"===a||"all"===a)&&(i.consistency=a),this)},searchType:function(a){return null==a?i.search_type:(a=a.toLowerCase(),("dfs_query_then_fetch"===a||"dfs_query_and_fetch"===a||"query_then_fetch"===a||"query_and_fetch"===a||"scan"===a||"count"===a)&&(i.search_type=a),this)},fields:function(a){if(null==a)return e.fields;if(null==e.fields&&(e.fields=[]),f(a))e.fields.push(a);else{if(!d(a))throw new TypeError("Argument must be string or array");e.fields=a}return this},from:function(a){return null==a?e.from:(e.from=a,this)},query:function(a){if(null==a)return e.query;if(!j(a))throw new TypeError("Argument must be a Query");return e.query=a._self(),this},indices:function(a){if(null==a)return g;if(f(a))g=[a];else{if(!d(a))throw new TypeError("Argument must be a string or array");g=a}return 0===g.length&&h.length>0&&(g=["_all"]),this},types:function(a){if(null==a)return h;if(f(a))h=[a];else{if(!d(a))throw new TypeError("Argument must be a string or array");h=a}return 0===g.length&&h.length>0&&(g=["_all"]),this},facet:function(a){if(null==a)return e.facets;if(null==e.facets&&(e.facets={}),!l(a))throw new TypeError("Argument must be a Facet");return c(e.facets,a._self()),this},filter:function(a){if(null==a)return e.filter;if(!k(a))throw new TypeError("Argument must be a Filter");return e.filter=a._self(),this},highlight:function(a){if(null==a)return e.highlight;if(!r(a))throw new TypeError("Argument must be a Highlight object");return e.highlight=a._self(),this},suggest:function(a){if(null==a)return e.suggest;if(null==e.suggest&&(e.suggest={}),f(a))e.suggest.text=a;else{if(!s(a))throw new TypeError("Argument must be a string or Suggest object");c(e.suggest,a._self())}return this},scriptField:function(a){if(null==a)return e.script_fields;if(null==e.script_fields&&(e.script_fields={}),!m(a))throw new TypeError("Argument must be a ScriptField");return c(e.script_fields,a._self()),this},preference:function(a){return null==a?i.preference:(i.preference=a,this)},ignoreIndices:function(a){return null==a?i.ignore_indices:(a=a.toLowerCase(),("none"===a||"missing"===a)&&(i.ignore_indices=a),this)},indexBoost:function(a,b){return null==e.indices_boost&&(e.indices_boost={}),0===arguments.length?e.indices_boost:(e.indices_boost[a]=b,this)},explain:function(a){return null==a?e.explain:(e.explain=a,this)},version:function(a){return null==a?e.version:(e.version=a,this)},minScore:function(a){return null==a?e.min_score:(e.min_score=a,this)},toString:function(){return JSON.stringify(e)},_type:function(){return"request"},_self:function(){return e},doDeleteByQuery:function(a,b){var c=JSON.stringify(e.query);if(null==u.client)throw new Error("No Client Set");return u.client.del(n("_query"),c,a,b)},doCount:function(a,b){var c=JSON.stringify(e.query);if(null==u.client)throw new Error("No Client Set");return u.client.post(n("_count"),c,a,b)},doSearch:function(a,b){var c=JSON.stringify(e);if(null==u.client)throw new Error("No Client Set");return u.client.post(n("_search"),c,a,b)}}},u.ScriptField=function(a){var b={};return b[a]={},{lang:function(c){return null==c?b[a].lang:(b[a].lang=c,this)},script:function(c){return null==c?b[a].script:(b[a].script=c,this)},params:function(c){return null==c?b[a].params:(b[a].params=c,this)},ignoreFailure:function(c){return null==c?b[a].ignore_failure:(b[a].ignore_failure=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"script field"},_self:function(){return b}}},u.Shape=function(a,b){var c={},d=function(a){var b=!1;return("point"===a||"linestring"===a||"polygon"===a||"multipoint"===a||"envelope"===a||"multipolygon"===a)&&(b=!0),b};return a=a.toLowerCase(),d(a)&&(c.type=a,c.coordinates=b),{type:function(a){return null==a?c.type:(a=a.toLowerCase(),d(a)&&(c.type=a),this)},coordinates:function(a){return null==a?c.coordinates:(c.coordinates=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"shape"},_self:function(){return c}}},u.Sort=function(a){null==a&&(a="_score");var b={},c=a,d="_geo_distance",e="_script";return b[c]={},{field:function(d){var e=b[c];return null==d?a:(delete b[c],a=d,c=d,b[c]=e,this)},geoDistance:function(e){var f=b[c];if(null==e)return b[c][a];if(!n(e))throw new TypeError("Argument must be a GeoPoint");return delete b[c],c=d,b[c]=f,b[c][a]=e._self(),this},script:function(a){var d=b[c];return null==a?b[c].script:(delete b[c],c=e,b[c]=d,b[c].script=a,this)},order:function(a){return null==a?b[c].order:(a=a.toLowerCase(),("asc"===a||"desc"===a)&&(b[c].order=a),this)},asc:function(){return b[c].order="asc",this},desc:function(){return b[c].order="desc",this},reverse:function(a){return null==a?b[c].reverse:(b[c].reverse=a,this)},missing:function(a){return null==a?b[c].missing:(b[c].missing=a,this)},ignoreUnmapped:function(a){return null==a?b[c].ignore_unmapped:(b[c].ignore_unmapped=a,this)},unit:function(a){return null==a?b[c].unit:(a=a.toLowerCase(),("mi"===a||"km"===a)&&(b[c].unit=a),this)},normalize:function(a){return null==a?b[c].normalize:(b[c].normalize=a,this)},distanceType:function(a){return null==a?b[c].distance_type:(a=a.toLowerCase(),("arc"===a||"plane"===a)&&(b[c].distance_type=a),this)},params:function(a){return null==a?b[c].params:(b[c].params=a,this)},lang:function(a){return null==a?b[c].lang:(b[c].lang=a,this)},type:function(a){return null==a?b[c].type:(a=a.toLowerCase(),("string"===a||"number"===a)&&(b[c].type=a),this)},mode:function(a){return null==a?b[c].mode:(a=a.toLowerCase(),("min"===a||"max"===a||"sum"===a||"avg"===a)&&(b[c].mode=a),this)},nestedPath:function(a){return null==a?b[c].nested_path:(b[c].nested_path=a,this)},nestedFilter:function(a){if(null==a)return b[c].nested_filter;if(!k(a))throw new TypeError("Argument must be a Filter");return b[c].nested_filter=a._self(),this},toString:function(){return JSON.stringify(b)},_type:function(){return"sort"},_self:function(){return b}}},u.DirectGenerator=function(){var a=u.DirectSettingsMixin(),b=a._self();return c(a,{preFilter:function(a){return null==a?b.pre_filter:(b.pre_filter=a,this)},postFilter:function(a){return null==a?b.post_filter:(b.post_filter=a,this)},field:function(a){return null==a?b.field:(b.field=a,this)},size:function(a){return null==a?b.size:(b.size=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"generator"},_self:function(){return b}})},u.DirectSettingsMixin=function(){var a={};return{accuracy:function(b){return null==b?a.accuracy:(a.accuracy=b,this)},suggestMode:function(b){return null==b?a.suggest_mode:(b=b.toLowerCase(),("missing"===b||"popular"===b||"always"===b)&&(a.suggest_mode=b),this)},sort:function(b){return null==b?a.sort:(b=b.toLowerCase(),("score"===b||"frequency"===b)&&(a.sort=b),this)},stringDistance:function(b){return null==b?a.string_distance:(b=b.toLowerCase(),("internal"===b||"damerau_levenshtein"===b||"levenstein"===b||"jarowinkler"===b||"ngram"===b)&&(a.string_distance=b),this)},maxEdits:function(b){return null==b?a.max_edits:(a.max_edits=b,this)},maxInspections:function(b){return null==b?a.max_inspections:(a.max_inspections=b,this)},maxTermFreq:function(b){return null==b?a.max_term_freq:(a.max_term_freq=b,this)},prefixLength:function(b){return null==b?a.prefix_length:(a.prefix_length=b,this)},minWordLen:function(b){return null==b?a.min_word_len:(a.min_word_len=b,this)},minDocFreq:function(b){return null==b?a.min_doc_freq:(a.min_doc_freq=b,this)},_self:function(){return a}}},u.PhraseSuggester=function(a){var b={};return b[a]={phrase:{}},{text:function(c){return null==c?b[a].text:(b[a].text=c,this)},analyzer:function(c){return null==c?b[a].phrase.analyzer:(b[a].phrase.analyzer=c,this)},field:function(c){return null==c?b[a].phrase.field:(b[a].phrase.field=c,this)},size:function(c){return null==c?b[a].phrase.size:(b[a].phrase.size=c,this)},shardSize:function(c){return null==c?b[a].phrase.shard_size:(b[a].phrase.shard_size=c,this)},realWorldErrorLikelihood:function(c){return null==c?b[a].phrase.real_world_error_likelihood:(b[a].phrase.real_world_error_likelihood=c,this)},confidence:function(c){return null==c?b[a].phrase.confidence:(b[a].phrase.confidence=c,this)},separator:function(c){return null==c?b[a].phrase.separator:(b[a].phrase.separator=c,this)},maxErrors:function(c){return null==c?b[a].phrase.max_errors:(b[a].phrase.max_errors=c,this)},gramSize:function(c){return null==c?b[a].phrase.gram_size:(b[a].phrase.gram_size=c,this)},forceUnigrams:function(c){return null==c?b[a].phrase.force_unigrams:(b[a].phrase.force_unigrams=c,this)},linearSmoothing:function(c,d,e){return 0===arguments.length?b[a].phrase.smoothing:(b[a].phrase.smoothing={linear:{trigram_lambda:c,bigram_lambda:d,unigram_lambda:e}},this)},laplaceSmoothing:function(c){return null==c?b[a].phrase.smoothing:(b[a].phrase.smoothing={laplace:{alpha:c}},this)},stupidBackoffSmoothing:function(c){return null==c?b[a].phrase.smoothing:(b[a].phrase.smoothing={stupid_backoff:{discount:c}},this)},directGenerator:function(c){var e,f;if(null==b[a].phrase.direct_generator&&(b[a].phrase.direct_generator=[]),null==c)return b[a].phrase.direct_generator;
if(t(c))b[a].phrase.direct_generator.push(c._self());else{if(!d(c))throw new TypeError("Argument must be a Generator or array of Generators");for(b[a].phrase.direct_generator=[],e=0,f=c.length;f>e;e++){if(!t(c[e]))throw new TypeError("Argument must be an array of Generators");b[a].phrase.direct_generator.push(c[e]._self())}}return this},toString:function(){return JSON.stringify(b)},_type:function(){return"suggest"},_self:function(){return b}}},u.TermSuggester=function(a){var b={},d=u.DirectSettingsMixin();return b[a]={term:d._self()},c(d,{text:function(c){return null==c?b[a].text:(b[a].text=c,this)},analyzer:function(c){return null==c?b[a].term.analyzer:(b[a].term.analyzer=c,this)},field:function(c){return null==c?b[a].term.field:(b[a].term.field=c,this)},size:function(c){return null==c?b[a].term.size:(b[a].term.size=c,this)},shardSize:function(c){return null==c?b[a].term.shard_size:(b[a].term.shard_size=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"suggest"},_self:function(){return b}})},u.noConflict=function(){return v.ejs=w,this}}.call(this),define("../vendor/elasticjs/elastic",function(){}),angular.module("elasticjs.service",[]).factory("ejsResource",["$http",function(a){return function(b){var c=window.ejs||{},d=function(a,b,c){return a.then(function(a){return(b||angular.noop)(a.data),a.data},function(a){return(c||angular.noop)(a.data),a.data})};return null==b&&(b=""),c.client={server:function(a){return null==a?b:(b=a,this)},post:function(c,e,f,g){return c=b+c,d(a.post(c,e),f,g)},get:function(c,e,f,g){return c=b+c,d(a.get(c,e),f,g)},put:function(c,e,f,g){return c=b+c,d(a.put(c,e),f,g)},del:function(c,e,f,g){return c=b+c,d(a.delete(c,e),f,g)},head:function(c,d,e,f){return c=b+c,a.head(c,d).then(function(a){return(e||angular.noop)(a.headers()),a.headers()},function(){return(f||angular.noop)(void 0),void 0})}},c}}]),define("elasticjs",function(){}),!function(a){a(function(){a.support.transition=function(){var a=function(){var a,b=document.createElement("bootstrap"),c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(a in c)if(void 0!==b.style[a])return c[a]}();return a&&{end:a}}()})}(window.jQuery),!function(a){var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){d.trigger("closed").remove()}var d,e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,"")),d=a(f),b&&b.preventDefault(),d.length||(d=e.hasClass("alert")?e:e.parent()),d.trigger(b=a.Event("close")),b.isDefaultPrevented()||(d.removeClass("in"),a.support.transition&&d.hasClass("fade")?d.on(a.support.transition.end,c):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.alert.data-api",b,c.prototype.close)}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f="object"==typeof c&&c;e||d.data("button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle")})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.prototype={cycle:function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(b){var c=this.getActiveIndex(),d=this;if(!(b>this.$items.length-1||0>b))return this.sliding?this.$element.one("slid",function(){d.to(b)}):c==b?this.pause().cycle():this.slide(b>c?"next":"prev",a(this.$items[b]))},pause:function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(b,c){var d,e=this.$element.find(".item.active"),f=c||e[b](),g=this.interval,h="next"==b?"left":"right",i="next"==b?"first":"last",j=this;if(this.sliding=!0,g&&this.pause(),f=f.length?f:this.$element.find(".item")[i](),d=a.Event("slide",{relatedTarget:f[0],direction:h}),!f.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(j.$indicators.children()[j.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(d),d.isDefaultPrevented())return;f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),this.$element.one(a.support.transition.end,function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),j.sliding=!1,setTimeout(function(){j.$element.trigger("slid")},0)})}else{if(this.$element.trigger(d),d.isDefaultPrevented())return;e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return g&&this.cycle(),this}}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=a.extend({},a.fn.carousel.defaults,"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.defaults={interval:5e3,pause:"hover"},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d,e=a(this),f=a(e.attr("data-target")||(c=e.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),g=a.extend({},f.data(),e.data());f.carousel(g),(d=e.attr("data-slide-to"))&&f.data("carousel").pause().to(d).cycle(),b.preventDefault()})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b,c,d,e;if(!this.transitioning&&!this.$element.hasClass("in")){if(b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find("> .accordion-group > .in"),d&&d.length){if(e=d.data("collapse"),e&&e.transitioning)return;d.collapse("hide"),e||d.data("collapse",null)}this.$element[b](0),this.transition("addClass",a.Event("show"),"shown"),a.support.transition&&this.$element[b](this.$element[0][c])}},hide:function(){var b;!this.transitioning&&this.$element.hasClass("in")&&(b=this.dimension(),this.reset(this.$element[b]()),this.transition("removeClass",a.Event("hide"),"hidden"),this.$element[b](0))},reset:function(a){var b=this.dimension();return this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element[null!==a?"addClass":"removeClass"]("collapse"),this},transition:function(b,c,d){var e=this,f=function(){"show"==c.type&&e.reset(),e.transitioning=0,e.$element.trigger(d)};this.$element.trigger(c),c.isDefaultPrevented()||(this.transitioning=1,this.$element[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=a.extend({},a.fn.collapse.defaults,d.data(),"object"==typeof c&&c);e||d.data("collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":d.data();d[a(e).hasClass("in")?"addClass":"removeClass"]("collapsed"),a(e).collapse(f)})}(window.jQuery),!function(a){function b(){a(".dropdown-backdrop").remove(),a(d).each(function(){c(a(this)).removeClass("open")})}function c(b){var c,d=b.attr("data-target");return d||(d=b.attr("href"),d=d&&/#/.test(d)&&d.replace(/.*(?=#[^\s]*$)/,"")),c=d&&a(d),c&&c.length||(c=b.parent()),c}var d="[data-toggle=dropdown]",e=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};e.prototype={constructor:e,toggle:function(){var d,e,f=a(this);if(!f.is(".disabled, :disabled"))return d=c(f),e=d.hasClass("open"),b(),e||("ontouchstart"in document.documentElement&&a('
').insertBefore(a(this)).on("click",b),d.toggleClass("open")),f.focus(),!1},keydown:function(b){var e,f,g,h,i;if(/(38|40|27)/.test(b.keyCode)&&(e=a(this),b.preventDefault(),b.stopPropagation(),!e.is(".disabled, :disabled"))){if(g=c(e),h=g.hasClass("open"),!h||h&&27==b.keyCode)return 27==b.which&&g.find(d).focus(),e.click();f=a("[role=menu] li:not(.divider):visible a",g),f.length&&(i=f.index(f.filter(":focus")),38==b.keyCode&&i>0&&i--,40==b.keyCode&&i ').appendTo(document.body),this.$backdrop.click("static"==this.options.backdrop?a.proxy(this.$element[0].focus,this.$element[0]):a.proxy(this.hide,this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b):b()):b&&b()}};var c=a.fn.modal;a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=a.extend({},a.fn.modal.defaults,d.data(),"object"==typeof c&&c);e||d.data("modal",e=new b(this,f)),"string"==typeof c?e[c]():f.show&&e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f).one("hide",function(){c.focus()})})}(window.jQuery),!function(a){var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f,g,h,i;for(this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,g=this.options.trigger.split(" "),i=g.length;i--;)h=g[i],"click"==h?this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this)):"manual"!=h&&(e="hover"==h?"mouseenter":"focus",f="hover"==h?"mouseleave":"blur",this.$element.on(e+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f+"."+this.type,this.options.selector,a.proxy(this.leave,this)));this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c,d=a.fn[this.type].defaults,e={};return this._options&&a.each(this._options,function(a,b){d[a]!=b&&(e[a]=b)},this),c=a(b.currentTarget)[this.type](e).data(this.type),c.options.delay&&c.options.delay.show?(clearTimeout(this.timeout),c.hoverState="in",this.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show),void 0):c.show()},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);return this.timeout&&clearTimeout(this.timeout),c.options.delay&&c.options.delay.hide?(c.hoverState="out",this.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide),void 0):c.hide()},show:function(){var b,c,d,e,f,g,h=a.Event("show");if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),h.isDefaultPrevented())return;switch(b=this.tip(),this.setContent(),this.options.animation&&b.addClass("fade"),f="function"==typeof this.options.placement?this.options.placement.call(this,b[0],this.$element[0]):this.options.placement,b.detach().css({top:0,left:0,display:"block"}),this.options.container?b.appendTo(this.options.container):b.insertAfter(this.$element),c=this.getPosition(),d=b[0].offsetWidth,e=b[0].offsetHeight,f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}this.applyPlacement(g,f),this.$element.trigger("shown")}},applyPlacement:function(a,b){var c,d,e,f,g=this.tip(),h=g[0].offsetWidth,i=g[0].offsetHeight;g.offset(a).addClass(b).addClass("in"),c=g[0].offsetWidth,d=g[0].offsetHeight,"top"==b&&d!=i&&(a.top=a.top+i-d,f=!0),"bottom"==b||"top"==b?(e=0,a.left<0&&(e=-2*a.left,a.left=0,g.offset(a),c=g[0].offsetWidth,d=g[0].offsetHeight),this.replaceArrow(e-h+c,c,"left")):this.replaceArrow(d-i,d,"top"),f&&g.offset(a)},replaceArrow:function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},setContent:function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},hide:function(){function b(){var b=setTimeout(function(){c.off(a.support.transition.end).detach()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.detach()})}var c=this.tip(),d=a.Event("hide");return this.$element.trigger(d),d.isDefaultPrevented()?void 0:(c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?b():c.detach(),this.$element.trigger("hidden"),this)},fixTitle:function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var b=this.$element[0];return a.extend({},"function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},tip:function(){return this.$tip=this.$tip||a(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(b){var c=b?a(b.currentTarget)[this.type](this._options).data(this.type):this;c.tip().hasClass("in")?c.hide():c.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f="object"==typeof c&&c;e||d.data("tooltip",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(window.jQuery),!function(a){var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=("function"==typeof c.content?c.content.call(b[0]):c.content)||b.attr("data-content")},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f="object"==typeof c&&c;e||d.data("popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:''}),a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),!function(a){function b(b,c){var d,e=a.proxy(this.process,this),f=a(b).is("body")?a(window):a(b);this.options=a.extend({},a.fn.scrollspy.defaults,c),this.$scrollElement=f.on("scroll.scroll-spy.data-api",e),this.selector=(this.options.target||(d=a(b).attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=a("body"),this.refresh(),this.process()}b.prototype={constructor:b,refresh:function(){var b,c=this;this.offsets=a([]),this.targets=a([]),b=this.$body.find(this.selector).map(function(){var b=a(this),d=b.data("target")||b.attr("href"),e=/^#\w/.test(d)&&a(d);return e&&e.length&&[[e.position().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),d]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},process:function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},activate:function(b){var c,d;this.activeTarget=b,a(this.selector).parent(".active").removeClass("active"),d=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',c=a(d).parent("li").addClass("active"),c.parent(".dropdown-menu").length&&(c=c.closest("li.dropdown").addClass("active")),c.trigger("activate")}};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f="object"==typeof c&&c;e||d.data("scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b,c,d,e=this.element,f=e.closest("ul:not(.dropdown-menu)"),g=e.attr("data-target");g||(g=e.attr("href"),g=g&&g.replace(/.*(?=#[^\s]*$)/,"")),e.parent("li").hasClass("active")||(b=f.find(".active:last a")[0],d=a.Event("show",{relatedTarget:b}),e.trigger(d),d.isDefaultPrevented()||(c=a(g),this.activate(e.parent("li"),f),this.activate(c,c.parent(),function(){e.trigger({type:"shown",relatedTarget:b})})))},activate:function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e):e(),f.removeClass("in")}};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=a(this.options.menu),this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(a)).change(),this.hide()},updater:function(a){return a},show:function(){var b=a.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:b.top+b.height,left:b.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(){var b;return this.query=this.$element.val(),!this.query||this.query.length"+b+""})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(){var b=this.$menu.find(".active").removeClass("active"),c=b.next();c.length||(c=a(this.$menu.find("li")[0])),c.addClass("active")},prev:function(){var a=this.$menu.find(".active").removeClass("active"),b=a.prev();b.length||(b=this.$menu.find("li").last()),b.addClass("active")},listen:function(){this.$element.on("focus",a.proxy(this.focus,this)).on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",a.proxy(this.keydown,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this)).on("mouseleave","li",a.proxy(this.mouseleave,this))},eventSupported:function(a){var b=a in this.$element;return b||(this.$element.setAttribute(a,"return;"),b="function"==typeof this.$element[a]),b},move:function(a){if(this.shown){switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:a.preventDefault(),this.prev();break;case 40:a.preventDefault(),this.next()}a.stopPropagation()}},keydown:function(b){this.suppressKeyPressRepeat=~a.inArray(b.keyCode,[40,38,9,13,27]),this.move(b)},keypress:function(a){this.suppressKeyPressRepeat||this.move(a)},keyup:function(a){switch(a.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}a.stopPropagation(),a.preventDefault()},focus:function(){this.focused=!0},blur:function(){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(a){a.stopPropagation(),a.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(b){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")},mouseleave:function(){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var c=a.fn.typeahead;a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f="object"==typeof c&&c;e||d.data("typeahead",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'',item:' ',minLength:1},a.fn.typeahead.Constructor=b,a.fn.typeahead.noConflict=function(){return a.fn.typeahead=c,this},a(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(){var b=a(this);b.data("typeahead")||b.typeahead(b.data())})}(window.jQuery),!function(a){var b=function(b,c){this.options=a.extend({},a.fn.affix.defaults,c),this.$window=a(window).on("scroll.affix.data-api",a.proxy(this.checkPosition,this)).on("click.affix.data-api",a.proxy(function(){setTimeout(a.proxy(this.checkPosition,this),1)},this)),this.$element=a(b),this.checkPosition()};b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b,c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.bottom,h=f.top,i="affix affix-top affix-bottom";"object"!=typeof f&&(g=h=f),"function"==typeof h&&(h=f.top()),"function"==typeof g&&(g=f.bottom()),b=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=g&&e.top+this.$element.height()>=c-g?"bottom":null!=h&&h>=d?"top":!1,this.affixed!==b&&(this.affixed=b,this.unpin="bottom"==b?e.top-d:null,this.$element.removeClass(i).addClass("affix"+(b?"-"+b:"")))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("affix"),f="object"==typeof c&&c;e||d.data("affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.defaults={offset:0},a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery),define("bootstrap",["jquery"],function(){}),function(a,b){function c(a){var b,c={},d=a.split(",");for(b=0;b=0&&q[f]!=d;f--);if(f>=0){for(e=q.length-1;e>=f;e--)c.end&&c.end(q[e]);q.length=f}}var g,h,p,q=[],s=a;for(q.last=function(){return q[q.length-1]};a;){if(h=!0,q.last()&&x[q.last()])a=a.replace(new RegExp("(.*)<\\s*\\/\\s*"+q.last()+"[^>]*>","i"),function(a,b){return b=b.replace(n,"$1").replace(o,"$1"),c.chars&&c.chars(e(b)),""}),f("",q.last());else if(0===a.indexOf(""),g>=0&&(c.comment&&c.comment(a.substring(4,g)),a=a.substring(g+3),h=!1)):m.test(a)?(p=a.match(j),p&&(a=a.substring(p[0].length),p[0].replace(j,f),h=!1)):l.test(a)&&(p=a.match(i),p&&(a=a.substring(p[0].length),p[0].replace(i,d),h=!1)),h){g=a.indexOf("<");var t=0>g?a:a.substring(0,g);a=0>g?"":a.substring(g),c.chars&&c.chars(e(t))}if(a==s)throw"Parse Error: "+a;s=a}f()}function e(a){return B.innerHTML=a.replace(//g,">")}function g(a){var c=!1,d=b.bind(a,a.push);return{start:function(a,e,g){a=b.lowercase(a),!c&&x[a]&&(c=a),c||1!=y[a]||(d("<"),d(a),b.forEach(e,function(a,c){var e=b.lowercase(c);1!=A[e]||z[e]===!0&&!a.match(p)||(d(" "),d(c),d('="'),d(f(a)),d('"'))}),d(g?"/>":">"))},end:function(a){a=b.lowercase(a),c||1!=y[a]||(d(""),d(a),d(">")),a==c&&(c=!1)},chars:function(a){c||d(f(a))}}}var h=function(a){var b=[];return d(a,g(b)),b.join("")},i=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,j=/^<\s*\/\s*([\w:-]+)[^>]*>/,k=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,l=/^,m=/^<\s*\//,n=//g,o=//g,p=/^((ftp|https?):\/\/|mailto:|#)/i,q=/([^\#-~| |!])/g,r=c("area,br,col,hr,img,wbr"),s=c("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),t=c("rp,rt"),u=b.extend({},t,s),v=b.extend({},s,c("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),w=b.extend({},t,c("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),x=c("script,style"),y=b.extend({},r,v,w,u),z=c("background,cite,href,longdesc,src,usemap"),A=b.extend({},z,c("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,span,start,summary,target,title,type,valign,value,vspace,width")),B=document.createElement("pre");
b.module("ngSanitize",[]).value("$sanitize",h),b.module("ngSanitize").directive("ngBindHtml",["$sanitize",function(a){return function(b,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtml),b.$watch(d.ngBindHtml,function(b){b=a(b),c.html(b||"")})}}]),b.module("ngSanitize").filter("linky",function(){var a=/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/,b=/^mailto:/;return function(c){if(!c)return c;for(var d,e,f,h=c,i=[],j=g(i);d=h.match(a);)e=d[0],d[2]==d[3]&&(e="mailto:"+e),f=d.index,j.chars(h.substr(0,f)),j.start("a",{href:e}),j.chars(d[0].replace(b,"")),j.end("a"),h=h.substring(f+d[0].length);return j.chars(h),i.join("")}})}(window,window.angular),define("angular-sanitize",function(){}),function(a,b,c,d){var e=function(b,c){this.widget="",this.$element=a(b),this.defaultTime=c.defaultTime,this.disableFocus=c.disableFocus,this.isOpen=c.isOpen,this.minuteStep=c.minuteStep,this.modalBackdrop=c.modalBackdrop,this.secondStep=c.secondStep,this.showInputs=c.showInputs,this.showMeridian=c.showMeridian,this.showSeconds=c.showSeconds,this.template=c.template,this.appendWidgetTo=c.appendWidgetTo,this._init()};e.prototype={constructor:e,_init:function(){var b=this;this.$element.parent().hasClass("input-append")||this.$element.parent().hasClass("input-prepend")?(this.$element.parent(".input-append, .input-prepend").find(".add-on").on({"click.timepicker":a.proxy(this.showWidget,this)}),this.$element.on({"focus.timepicker":a.proxy(this.highlightUnit,this),"click.timepicker":a.proxy(this.highlightUnit,this),"keydown.timepicker":a.proxy(this.elementKeydown,this),"blur.timepicker":a.proxy(this.blurElement,this)})):this.template?this.$element.on({"focus.timepicker":a.proxy(this.showWidget,this),"click.timepicker":a.proxy(this.showWidget,this),"blur.timepicker":a.proxy(this.blurElement,this)}):this.$element.on({"focus.timepicker":a.proxy(this.highlightUnit,this),"click.timepicker":a.proxy(this.highlightUnit,this),"keydown.timepicker":a.proxy(this.elementKeydown,this),"blur.timepicker":a.proxy(this.blurElement,this)}),this.$widget=this.template!==!1?a(this.getTemplate()).prependTo(this.$element.parents(this.appendWidgetTo)).on("click",a.proxy(this.widgetClick,this)):!1,this.showInputs&&this.$widget!==!1&&this.$widget.find("input").each(function(){a(this).on({"click.timepicker":function(){a(this).select()},"keydown.timepicker":a.proxy(b.widgetKeydown,b)})}),this.setDefaultTime(this.defaultTime)},blurElement:function(){this.highlightedUnit=d,this.updateFromElementVal()},decrementHour:function(){if(this.showMeridian)if(1===this.hour)this.hour=12;else{if(12===this.hour)return this.hour--,this.toggleMeridian();if(0===this.hour)return this.hour=11,this.toggleMeridian();this.hour--}else 0===this.hour?this.hour=23:this.hour--;this.update()},decrementMinute:function(a){var b;b=a?this.minute-a:this.minute-this.minuteStep,0>b?(this.decrementHour(),this.minute=b+60):this.minute=b,this.update()},decrementSecond:function(){var a=this.second-this.secondStep;0>a?(this.decrementMinute(!0),this.second=a+60):this.second=a,this.update()},elementKeydown:function(a){switch(a.keyCode){case 9:switch(this.updateFromElementVal(),this.highlightedUnit){case"hour":a.preventDefault(),this.highlightNextUnit();break;case"minute":(this.showMeridian||this.showSeconds)&&(a.preventDefault(),this.highlightNextUnit());break;case"second":this.showMeridian&&(a.preventDefault(),this.highlightNextUnit())}break;case 27:this.updateFromElementVal();break;case 37:a.preventDefault(),this.highlightPrevUnit(),this.updateFromElementVal();break;case 38:switch(a.preventDefault(),this.highlightedUnit){case"hour":this.incrementHour(),this.highlightHour();break;case"minute":this.incrementMinute(),this.highlightMinute();break;case"second":this.incrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}break;case 39:a.preventDefault(),this.updateFromElementVal(),this.highlightNextUnit();break;case 40:switch(a.preventDefault(),this.highlightedUnit){case"hour":this.decrementHour(),this.highlightHour();break;case"minute":this.decrementMinute(),this.highlightMinute();break;case"second":this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}}},formatTime:function(a,b,c,d){return a=10>a?"0"+a:a,b=10>b?"0"+b:b,c=10>c?"0"+c:c,a+":"+b+(this.showSeconds?":"+c:"")+(this.showMeridian?" "+d:"")},getCursorPosition:function(){var a=this.$element.get(0);if("selectionStart"in a)return a.selectionStart;if(c.selection){a.focus();var b=c.selection.createRange(),d=c.selection.createRange().text.length;return b.moveStart("character",-a.value.length),b.text.length-d}},getTemplate:function(){var a,b,c,d,e,f;switch(this.showInputs?(b=' ',c=' ',d=' ',e=' '):(b=' ',c=' ',d=' ',e=' '),f=' '+(this.showSeconds?' ':"")+(this.showMeridian?' ':"")+" "+""+""+b+" "+': '+""+c+" "+(this.showSeconds?': '+d+" ":"")+(this.showMeridian?' '+e+" ":"")+" "+""+' '+' '+' '+(this.showSeconds?' ':"")+(this.showMeridian?' ':"")+" "+"
",this.template){case"modal":a='";break;case"dropdown":a='"}return a},getTime:function(){return this.formatTime(this.hour,this.minute,this.second,this.meridian)},hideWidget:function(){this.isOpen!==!1&&(this.showInputs&&this.updateFromWidgetInputs(),this.$element.trigger({type:"hide.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),"modal"===this.template?this.$widget.modal("hide"):this.$widget.removeClass("open"),a(c).off("mousedown.timepicker"),this.isOpen=!1)},highlightUnit:function(){this.position=this.getCursorPosition(),this.position>=0&&this.position<=2?this.highlightHour():this.position>=3&&this.position<=5?this.highlightMinute():this.position>=6&&this.position<=8?this.showSeconds?this.highlightSecond():this.highlightMeridian():this.position>=9&&this.position<=11&&this.highlightMeridian()},highlightNextUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMinute();break;case"minute":this.showSeconds?this.highlightSecond():this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"second":this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"meridian":this.highlightHour()}},highlightPrevUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMeridian();break;case"minute":this.highlightHour();break;case"second":this.highlightMinute();break;case"meridian":this.showSeconds?this.highlightSecond():this.highlightMinute()}},highlightHour:function(){var a=this.$element.get(0);this.highlightedUnit="hour",a.setSelectionRange&&setTimeout(function(){a.setSelectionRange(0,2)},0)},highlightMinute:function(){var a=this.$element.get(0);this.highlightedUnit="minute",a.setSelectionRange&&setTimeout(function(){a.setSelectionRange(3,5)},0)},highlightSecond:function(){var a=this.$element.get(0);this.highlightedUnit="second",a.setSelectionRange&&setTimeout(function(){a.setSelectionRange(6,8)},0)},highlightMeridian:function(){var a=this.$element.get(0);this.highlightedUnit="meridian",a.setSelectionRange&&(this.showSeconds?setTimeout(function(){a.setSelectionRange(9,11)},0):setTimeout(function(){a.setSelectionRange(6,8)},0))},incrementHour:function(){if(this.showMeridian){if(11===this.hour)return this.hour++,this.toggleMeridian();12===this.hour&&(this.hour=0)}return 23===this.hour?(this.hour=0,void 0):(this.hour++,this.update(),void 0)},incrementMinute:function(a){var b;b=a?this.minute+a:this.minute+this.minuteStep-this.minute%this.minuteStep,b>59?(this.incrementHour(),this.minute=b-60):this.minute=b,this.update()},incrementSecond:function(){var a=this.second+this.secondStep-this.second%this.secondStep;a>59?(this.incrementMinute(!0),this.second=a-60):this.second=a,this.update()},remove:function(){a("document").off(".timepicker"),this.$widget&&this.$widget.remove(),delete this.$element.data().timepicker},setDefaultTime:function(a){if(this.$element.val())this.updateFromElementVal();else if("current"===a){var b=new Date,c=b.getHours(),d=Math.floor(b.getMinutes()/this.minuteStep)*this.minuteStep,e=Math.floor(b.getSeconds()/this.secondStep)*this.secondStep,f="AM";this.showMeridian&&(0===c?c=12:c>=12?(c>12&&(c-=12),f="PM"):f="AM"),this.hour=c,this.minute=d,this.second=e,this.meridian=f,this.update()}else a===!1?(this.hour=0,this.minute=0,this.second=0,this.meridian="AM"):this.setTime(a)},setTime:function(a){var b,c;this.showMeridian?(b=a.split(" "),c=b[0].split(":"),this.meridian=b[1]):c=a.split(":"),this.hour=parseInt(c[0],10),this.minute=parseInt(c[1],10),this.second=parseInt(c[2],10),isNaN(this.hour)&&(this.hour=0),isNaN(this.minute)&&(this.minute=0),this.showMeridian?(this.hour>12?this.hour=12:this.hour<1&&(this.hour=12),"am"===this.meridian||"a"===this.meridian?this.meridian="AM":("pm"===this.meridian||"p"===this.meridian)&&(this.meridian="PM"),"AM"!==this.meridian&&"PM"!==this.meridian&&(this.meridian="AM")):this.hour>=24?this.hour=23:this.hour<0&&(this.hour=0),this.minute<0?this.minute=0:this.minute>=60&&(this.minute=59),this.showSeconds&&(isNaN(this.second)?this.second=0:this.second<0?this.second=0:this.second>=60&&(this.second=59)),this.update()},showWidget:function(){if(!this.isOpen&&!this.$element.is(":disabled")){var b=this;a(c).on("mousedown.timepicker",function(c){0===a(c.target).closest(".bootstrap-timepicker-widget").length&&b.hideWidget()}),this.$element.trigger({type:"show.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),this.disableFocus&&this.$element.blur(),this.updateFromElementVal(),"modal"===this.template?this.$widget.modal("show").on("hidden",a.proxy(this.hideWidget,this)):this.isOpen===!1&&this.$widget.addClass("open"),this.isOpen=!0}},toggleMeridian:function(){this.meridian="AM"===this.meridian?"PM":"AM",this.update()},update:function(){this.$element.trigger({type:"changeTime.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),this.updateElement(),this.updateWidget()},updateElement:function(){this.$element.val(this.getTime()).change()},updateFromElementVal:function(){var a=this.$element.val();a&&this.setTime(a)},updateWidget:function(){if(this.$widget!==!1){var a=this.hour<10?"0"+this.hour:this.hour,b=this.minute<10?"0"+this.minute:this.minute,c=this.second<10?"0"+this.second:this.second;this.showInputs?(this.$widget.find("input.bootstrap-timepicker-hour").val(a),this.$widget.find("input.bootstrap-timepicker-minute").val(b),this.showSeconds&&this.$widget.find("input.bootstrap-timepicker-second").val(c),this.showMeridian&&this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)):(this.$widget.find("span.bootstrap-timepicker-hour").text(a),this.$widget.find("span.bootstrap-timepicker-minute").text(b),this.showSeconds&&this.$widget.find("span.bootstrap-timepicker-second").text(c),this.showMeridian&&this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian))}},updateFromWidgetInputs:function(){if(this.$widget!==!1){var b=a("input.bootstrap-timepicker-hour",this.$widget).val()+":"+a("input.bootstrap-timepicker-minute",this.$widget).val()+(this.showSeconds?":"+a("input.bootstrap-timepicker-second",this.$widget).val():"")+(this.showMeridian?" "+a("input.bootstrap-timepicker-meridian",this.$widget).val():"");this.setTime(b)}},widgetClick:function(b){b.stopPropagation(),b.preventDefault();var c=a(b.target).closest("a").data("action");c&&this[c]()},widgetKeydown:function(b){var c=a(b.target).closest("input"),d=c.attr("name");switch(b.keyCode){case 9:if(this.showMeridian){if("meridian"===d)return this.hideWidget()}else if(this.showSeconds){if("second"===d)return this.hideWidget()}else if("minute"===d)return this.hideWidget();this.updateFromWidgetInputs();break;case 27:this.hideWidget();break;case 38:switch(b.preventDefault(),d){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian()}break;case 40:switch(b.preventDefault(),d){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian()}}}},a.fn.timepicker=function(b){var c=Array.apply(null,arguments);return c.shift(),this.each(function(){var d=a(this),f=d.data("timepicker"),g="object"==typeof b&&b;f||d.data("timepicker",f=new e(this,a.extend({},a.fn.timepicker.defaults,g,a(this).data()))),"string"==typeof b&&f[b].apply(f,c)})},a.fn.timepicker.defaults={defaultTime:"current",disableFocus:!1,isOpen:!1,minuteStep:15,modalBackdrop:!1,secondStep:15,showSeconds:!1,showInputs:!0,showMeridian:!0,template:"dropdown",appendWidgetTo:".bootstrap-timepicker"},a.fn.timepicker.Constructor=e}(jQuery,window,document),define("timepicker",function(){}),!function(a){function b(){return new Date(Date.UTC.apply(Date,arguments))}var c=function(b,c){switch(this.element=a(b),this.language=c.language||this.element.data("date-language")||"en",this.language=this.language in d?this.language:this.language.split("-")[0],this.language=this.language in d?this.language:"en",this.isRTL=d[this.language].rtl||!1,this.format=e.parseFormat(c.format||this.element.data("date-format")||d[this.language].format||"mm/dd/yyyy"),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on, .btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.forceParse=!0,"forceParse"in c?this.forceParse=c.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),this.picker=a(e.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.isRTL&&(this.picker.addClass("datepicker-rtl"),this.picker.find(".prev i, .next i").toggleClass("icon-arrow-left icon-arrow-right")),this.autoclose=!1,"autoclose"in c?this.autoclose=c.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in c?this.keyboardNavigation=c.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.viewMode=this.startViewMode=0,c.startView||this.element.data("date-start-view")){case 2:case"decade":this.viewMode=this.startViewMode=2;break;case 1:case"year":this.viewMode=this.startViewMode=1}if(this.minViewMode=c.minViewMode||this.element.data("date-min-view-mode")||0,"string"==typeof this.minViewMode)switch(this.minViewMode){case"months":this.minViewMode=1;break;case"years":this.minViewMode=2;break;default:this.minViewMode=0}this.viewMode=this.startViewMode=Math.max(this.startViewMode,this.minViewMode),this.todayBtn=c.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=c.todayHighlight||this.element.data("date-today-highlight")||!1,this.calendarWeeks=!1,"calendarWeeks"in c?this.calendarWeeks=c.calendarWeeks:"dateCalendarWeeks"in this.element.data()&&(this.calendarWeeks=this.element.data("date-calendar-weeks")),this.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(a,b){return parseInt(b)+1}),this._allow_update=!1,this.weekStart=(c.weekStart||this.element.data("date-weekstart")||d[this.language].weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-1/0,this.endDate=1/0,this.daysOfWeekDisabled=[],this.setStartDate(c.startDate||this.element.data("date-startdate")),this.setEndDate(c.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(c.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};c.prototype={constructor:c,_events:[],_secondaryEvents:[],_applyEvents:function(a){for(var b,c,d=0;dthis.endDate?new Date(this.endDate):new Date(this.date),this.fill()}},fillDow:function(){var a=this.weekStart,b="";if(this.calendarWeeks){var c=' ';b+=c,this.picker.find(".datepicker-days thead tr:first-child").prepend(c)}for(;a'+d[this.language].daysMin[a++%7]+"";b+=" ",this.picker.find(".datepicker-days thead").append(b)},fillMonths:function(){for(var a="",b=0;12>b;)a+=''+d[this.language].monthsShort[b++]+" ";this.picker.find(".datepicker-months td").html(a)},fill:function(){var c=new Date(this.viewDate),f=c.getUTCFullYear(),g=c.getUTCMonth(),h=this.startDate!==-1/0?this.startDate.getUTCFullYear():-1/0,i=this.startDate!==-1/0?this.startDate.getUTCMonth():-1/0,j=1/0!==this.endDate?this.endDate.getUTCFullYear():1/0,k=1/0!==this.endDate?this.endDate.getUTCMonth():1/0,l=this.date&&this.date.valueOf(),m=new Date;this.picker.find(".datepicker-days thead th.switch").text(d[this.language].months[g]+" "+f),this.picker.find("tfoot th.today").text(d[this.language].today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var n=b(f,g-1,28,0,0,0,0),o=e.getDaysInMonth(n.getUTCFullYear(),n.getUTCMonth());n.setUTCDate(o),n.setUTCDate(o-(n.getUTCDay()-this.weekStart+7)%7);var p=new Date(n);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();for(var q,r=[];n.valueOf()"),this.calendarWeeks)){var s=new Date(+n+864e5*((this.weekStart-n.getUTCDay()-7)%7)),t=new Date(+s+864e5*((11-s.getUTCDay())%7)),u=new Date(+(u=b(t.getUTCFullYear(),0,1))+864e5*((11-u.getUTCDay())%7)),v=(t-u)/864e5/7+1;r.push('
'+v+" ")}q="",n.getUTCFullYear()f||n.getUTCFullYear()==f&&n.getUTCMonth()>g)&&(q+=" new"),this.todayHighlight&&n.getUTCFullYear()==m.getFullYear()&&n.getUTCMonth()==m.getMonth()&&n.getUTCDate()==m.getDate()&&(q+=" today"),l&&n.valueOf()==l&&(q+=" active"),(n.valueOf()this.endDate||-1!==a.inArray(n.getUTCDay(),this.daysOfWeekDisabled))&&(q+=" disabled"),r.push(''+n.getUTCDate()+" "),n.getUTCDay()==this.weekEnd&&r.push(""),n.setUTCDate(n.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(r.join(""));var w=this.date&&this.date.getUTCFullYear(),x=this.picker.find(".datepicker-months").find("th:eq(1)").text(f).end().find("span").removeClass("active");w&&w==f&&x.eq(this.date.getUTCMonth()).addClass("active"),(h>f||f>j)&&x.addClass("disabled"),f==h&&x.slice(0,i).addClass("disabled"),f==j&&x.slice(k+1).addClass("disabled"),r="",f=10*parseInt(f/10,10);var y=this.picker.find(".datepicker-years").find("th:eq(1)").text(f+"-"+(f+9)).end().find("td");f-=1;for(var z=-1;11>z;z++)r+='f||f>j?" disabled":"")+'">'+f+" ",f+=1;y.html(r)},updateNavArrows:function(){if(this._allow_update){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth();switch(this.viewMode){case 0:this.startDate!==-1/0&&b<=this.startDate.getUTCFullYear()&&c<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()&&c>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.startDate!==-1/0&&b<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(c){c.preventDefault();var d=a(c.target).closest("span, td, th");if(1==d.length)switch(d[0].nodeName.toLowerCase()){case"th":switch(d[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var f=e.modes[this.viewMode].navStep*("prev"==d[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,f);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,f)}this.fill();break;case"today":var g=new Date;g=b(g.getFullYear(),g.getMonth(),g.getDate(),0,0,0),this.showMode(-2);var h="linked"==this.todayBtn?null:"view";this._setDate(g,h)}break;case"span":if(!d.is(".disabled")){if(this.viewDate.setUTCDate(1),d.is(".month")){var i=1,j=d.parent().find("span").index(d),k=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(j),this.element.trigger({type:"changeMonth",date:this.viewDate}),1==this.minViewMode&&this._setDate(b(k,j,i,0,0,0,0))}else{var k=parseInt(d.text(),10)||0,i=1,j=0;this.viewDate.setUTCFullYear(k),this.element.trigger({type:"changeYear",date:this.viewDate}),2==this.minViewMode&&this._setDate(b(k,j,i,0,0,0,0))}this.showMode(-1),this.fill()}break;case"td":if(d.is(".day")&&!d.is(".disabled")){var i=parseInt(d.text(),10)||1,k=this.viewDate.getUTCFullYear(),j=this.viewDate.getUTCMonth();d.is(".old")?0===j?(j=11,k-=1):j-=1:d.is(".new")&&(11==j?(j=0,k+=1):j+=1),this._setDate(b(k,j,i,0,0,0,0))}}},_setDate:function(a,b){b&&"date"!=b||(this.date=a),b&&"view"!=b||(this.viewDate=a),this.fill(),this.setValue(),this.element.trigger({type:"changeDate",date:this.date});var c;this.isInput?c=this.element:this.component&&(c=this.element.find("input")),c&&(c.change(),!this.autoclose||b&&"date"!=b||this.hide())},moveMonth:function(a,b){if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),g=e.getUTCMonth(),h=Math.abs(b);if(b=b>0?1:-1,1==h)d=-1==b?function(){return e.getUTCMonth()==g}:function(){return e.getUTCMonth()!=c},c=g+b,e.setUTCMonth(c),(0>c||c>11)&&(c=(c+12)%12);else{for(var i=0;h>i;i++)e=this.moveMonth(e,b);c=e.getUTCMonth(),e.setUTCDate(f),d=function(){return c!=e.getUTCMonth()}}for(;d();)e.setUTCDate(--f),e.setUTCMonth(c);return e},moveYear:function(a,b){return this.moveMonth(a,12*b)},dateWithinRange:function(a){return a>=this.startDate&&a<=this.endDate},keydown:function(a){if(this.picker.is(":not(:visible)"))return 27==a.keyCode&&this.show(),void 0;var b,c,d,e=!1;switch(a.keyCode){case 27:this.hide(),a.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;b=37==a.keyCode?-1:1,a.ctrlKey?(c=this.moveYear(this.date,b),d=this.moveYear(this.viewDate,b)):a.shiftKey?(c=this.moveMonth(this.date,b),d=this.moveMonth(this.viewDate,b)):(c=new Date(this.date),c.setUTCDate(this.date.getUTCDate()+b),d=new Date(this.viewDate),d.setUTCDate(this.viewDate.getUTCDate()+b)),this.dateWithinRange(c)&&(this.date=c,this.viewDate=d,this.setValue(),this.update(),a.preventDefault(),e=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;b=38==a.keyCode?-1:1,a.ctrlKey?(c=this.moveYear(this.date,b),d=this.moveYear(this.viewDate,b)):a.shiftKey?(c=this.moveMonth(this.date,b),d=this.moveMonth(this.viewDate,b)):(c=new Date(this.date),c.setUTCDate(this.date.getUTCDate()+7*b),d=new Date(this.viewDate),d.setUTCDate(this.viewDate.getUTCDate()+7*b)),this.dateWithinRange(c)&&(this.date=c,this.viewDate=d,this.setValue(),this.update(),a.preventDefault(),e=!0);break;case 13:this.hide(),a.preventDefault();break;case 9:this.hide()}if(e){this.element.trigger({type:"changeDate",date:this.date});var f;this.isInput?f=this.element:this.component&&(f=this.element.find("input")),f&&f.change()}},showMode:function(a){a&&(this.viewMode=Math.max(this.minViewMode,Math.min(2,this.viewMode+a))),this.picker.find(">div").hide().filter(".datepicker-"+e.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}},a.fn.datepicker=function(b){var d=Array.apply(null,arguments);return d.shift(),this.each(function(){var e=a(this),f=e.data("datepicker"),g="object"==typeof b&&b;f||e.data("datepicker",f=new c(this,a.extend({},a.fn.datepicker.defaults,g))),"string"==typeof b&&"function"==typeof f[b]&&f[b].apply(f,d)})},a.fn.datepicker.defaults={},a.fn.datepicker.Constructor=c;var d=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"}},e={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(a){return 0===a%4&&0!==a%100||0===a%400},getDaysInMonth:function(a,b){return[31,e.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(a){var b=a.replace(this.validParts,"\x00").split("\x00"),c=a.match(this.validParts);if(!b||!b.length||!c||0===c.length)throw new Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(e,f,g){if(e instanceof Date)return e;if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e)){var h,i,j=/([\-+]\d+)([dmwy])/,k=e.match(/([\-+]\d+)([dmwy])/g);e=new Date;for(var l=0;lb;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!=b;)a.setUTCDate(a.getUTCDate()-1);
-return a},d:function(a,b){return a.setUTCDate(b)}};q.M=q.MM=q.mm=q.m,q.dd=q.d,e=b(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);var r=f.parts.slice();if(k.length!=r.length&&(r=a(r).filter(function(b,c){return-1!==a.inArray(c,p)}).toArray()),k.length==r.length){for(var l=0,s=r.length;s>l;l++){if(m=parseInt(k[l],10),h=r[l],isNaN(m))switch(h){case"MM":n=a(d[g].months).filter(function(){var a=this.slice(0,k[l].length),b=k[l].slice(0,a.length);return a==b}),m=a.inArray(n[0],d[g].months)+1;break;case"M":n=a(d[g].monthsShort).filter(function(){var a=this.slice(0,k[l].length),b=k[l].slice(0,a.length);return a==b}),m=a.inArray(n[0],d[g].monthsShort)+1}o[h]=m}for(var t,l=0;lh;h++)g.length&&b.push(g.shift()),b.push(f[c.parts[h]]);return b.join("")},headTemplate:' ',contTemplate:' ',footTemplate:' '};e.template=''+e.headTemplate+" "+e.footTemplate+"
"+"
"+'
'+'
'+e.headTemplate+e.contTemplate+e.footTemplate+"
"+"
"+'
'+'
'+e.headTemplate+e.contTemplate+e.footTemplate+"
"+"
"+"
",a.fn.datepicker.DPGlobal=e}(window.jQuery),define("datepicker",function(){}),angular.module("$strap.config",[]).value("$strapConfig",{}),angular.module("$strap.filters",["$strap.config"]),angular.module("$strap.directives",["$strap.config"]),angular.module("$strap",["$strap.filters","$strap.directives","$strap.config"]),angular.module("$strap.directives").directive("bsAlert",["$parse","$timeout","$compile",function(a,b,c){return{restrict:"A",link:function(d,e,f){var g=a(f.bsAlert),h=(g.assign,g(d)),i=function(a){b(function(){e.alert("close")},1*a)};f.bsAlert?d.$watch(f.bsAlert,function(a,b){h=a,e.html((a.title?""+a.title+" ":"")+a.content||""),a.closed&&e.hide(),c(e.contents())(d),(a.type||b.type)&&(b.type&&e.removeClass("alert-"+b.type),a.type&&e.addClass("alert-"+a.type)),angular.isDefined(a.closeAfter)?i(a.closeAfter):f.closeAfter&&i(f.closeAfter),(angular.isUndefined(f.closeButton)||"0"!==f.closeButton&&"false"!==f.closeButton)&&e.prepend('× ')},!0):((angular.isUndefined(f.closeButton)||"0"!==f.closeButton&&"false"!==f.closeButton)&&e.prepend('× '),f.closeAfter&&i(f.closeAfter)),e.addClass("alert").alert(),e.hasClass("fade")&&(e.removeClass("in"),setTimeout(function(){e.addClass("in")}));var j=f.ngRepeat&&f.ngRepeat.split(" in ").pop();e.on("close",function(a){var b;j?(a.preventDefault(),e.removeClass("in"),b=function(){e.trigger("closed"),d.$parent&&d.$parent.$apply(function(){for(var a=j.split("."),b=d.$parent,c=0;cg.length-2?g[0]:g[i+1],b.$apply(function(){c.text(j),e&&e.$setViewValue(j)})})}}}]),angular.module("$strap.directives").directive("bsDatepicker",["$timeout","$strapConfig",function(a,b){var c=/(iP(a|o)d|iPhone)/g.test(navigator.userAgent),d=function(a){return a=a||"en",{"/":"[\\/]","-":"[-]",".":"[.]"," ":"[\\s]",dd:"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))",d:"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))",mm:"(?:[0]?[1-9]|[1][012])",m:"(?:[0]?[1-9]|[1][012])",DD:"(?:"+$.fn.datepicker.dates[a].days.join("|")+")",D:"(?:"+$.fn.datepicker.dates[a].daysShort.join("|")+")",MM:"(?:"+$.fn.datepicker.dates[a].months.join("|")+")",M:"(?:"+$.fn.datepicker.dates[a].monthsShort.join("|")+")",yyyy:"(?:(?:[1]{1}[0-9]{1}[0-9]{1}[0-9]{1})|(?:[2]{1}[0-9]{3}))(?![[0-9]])",yy:"(?:(?:[0-9]{1}[0-9]{1}))(?![[0-9]])"}},e=function(a,b){var c,e=a,f=d(b);return c=0,angular.forEach(f,function(a,b){e=e.split(b).join("${"+c+"}"),c++}),c=0,angular.forEach(f,function(a){e=e.split("${"+c+"}").join(a),c++}),new RegExp("^"+e+"$",["i"])};return{restrict:"A",require:"?ngModel",link:function(a,d,f,g){var h=angular.extend({autoclose:!0},b.datepicker||{}),i=f.dateType||h.type||"date";angular.forEach(["format","weekStart","calendarWeeks","startDate","endDate","daysOfWeekDisabled","autoclose","startView","minViewMode","todayBtn","todayHighlight","keyboardNavigation","language","forceParse"],function(a){angular.isDefined(f[a])&&(h[a]=f[a])});var j=h.language||"en",k=f.dateFormat||h.format||$.fn.datepicker.dates[j]&&$.fn.datepicker.dates[j].format||"mm/dd/yyyy",l=c?"yyyy-mm-dd":k,m=e(l,j);g&&(g.$formatters.unshift(function(a){return"date"===i&&angular.isString(a)&&a?$.fn.datepicker.DPGlobal.parseDate(a,$.fn.datepicker.DPGlobal.parseFormat(k),j):a}),g.$parsers.unshift(function(a){return a?"date"===i&&angular.isDate(a)?(g.$setValidity("date",!0),a):angular.isString(a)&&m.test(a)?(g.$setValidity("date",!0),c?new Date(a):"string"===i?a:$.fn.datepicker.DPGlobal.parseDate(a,$.fn.datepicker.DPGlobal.parseFormat(l),j)):(g.$setValidity("date",!1),void 0):(g.$setValidity("date",!0),null)}),g.$render=function(){if(c){var a=g.$viewValue?$.fn.datepicker.DPGlobal.formatDate(g.$viewValue,$.fn.datepicker.DPGlobal.parseFormat(l),j):"";return d.val(a),a}return g.$viewValue||d.val(""),d.datepicker("update",g.$viewValue)}),c?d.prop("type","date").css("-webkit-appearance","textfield"):(g&&d.on("changeDate",function(b){a.$apply(function(){g.$setViewValue("string"===i?d.val():b.date)})}),d.datepicker(angular.extend(h,{format:l,language:j})),a.$on("$destroy",function(){var a=d.data("datepicker");a&&(a.picker.remove(),d.data("datepicker",null))}),f.$observe("startDate",function(a){d.datepicker("setStartDate",a)}),f.$observe("endDate",function(a){d.datepicker("setEndDate",a)}));var n=d.siblings('[data-toggle="datepicker"]');n.length&&n.on("click",function(){d.prop("disabled")||d.trigger("focus")})}}}]),angular.module("$strap.directives").directive("bsDropdown",["$parse","$compile","$timeout",function(a,b,c){var d=function(a,b){return b||(b=['"]),angular.forEach(a,function(a,c){if(a.divider)return b.splice(c+1,0,' ');var e="",b.splice(c+1,0,e)}),b};return{restrict:"EA",scope:!0,link:function(e,f,g){var h=a(g.bsDropdown),i=h(e);c(function(){!angular.isArray(i);var a=angular.element(d(i).join(""));a.insertAfter(f),b(f.next("ul.dropdown-menu"))(e)}),f.addClass("dropdown-toggle").attr("data-toggle","dropdown")}}}]),angular.module("$strap.directives").factory("$modal",["$rootScope","$compile","$http","$timeout","$q","$templateCache","$strapConfig",function(a,b,c,d,e,f,g){var h=function(h){function i(h){var i=angular.extend({show:!0},g.modal,h),j=i.scope?i.scope:a.$new(),k=i.template;return e.when(f.get(k)||c.get(k,{cache:!0}).then(function(a){return a.data})).then(function(a){var c=k.replace(".html","").replace(/[\/|\.|:]/g,"-")+"-"+j.$id,e=$('
').attr("id",c).addClass("fade").html(a);return i.modalClass&&e.addClass(i.modalClass),$("body").append(e),d(function(){b(e)(j)}),j.$modal=function(a){e.modal(a)},angular.forEach(["show","hide"],function(a){j[a]=function(){e.modal(a)}}),j.dismiss=j.hide,angular.forEach(["show","shown","hide","hidden"],function(a){e.on(a,function(b){j.$emit("modal-"+a,b)})}),e.on("shown",function(){$("input[autofocus], textarea[autofocus]",e).first().trigger("focus")}),e.on("hidden",function(){i.persist||j.$destroy()}),j.$on("$destroy",function(){e.remove()}),e.modal(i),e})}return new i(h)};return h}]).directive("bsModal",["$q","$modal",function(a,b){return{restrict:"A",scope:!0,link:function(c,d,e){var f={template:c.$eval(e.bsModal),persist:!0,show:!1,scope:c};angular.forEach(["modalClass","backdrop","keyboard"],function(a){angular.isDefined(e[a])&&(f[a]=e[a])}),a.when(b(f)).then(function(a){d.attr("data-target","#"+a.attr("id")).attr("data-toggle","modal")})}}}]),angular.module("$strap.directives").directive("bsNavbar",["$location",function(a){return{restrict:"A",link:function(b,c){b.$watch(function(){return a.path()},function(a){$("li[data-match-route]",c).each(function(b,c){var d=angular.element(c),e=d.attr("data-match-route"),f=new RegExp("^"+e+"$",["i"]);f.test(a)?d.addClass("active").find(".collapse.in").collapse("hide"):d.removeClass("active")})})}}}]),angular.module("$strap.directives").directive("bsPopover",["$parse","$compile","$http","$timeout","$q","$templateCache",function(a,b,c,d,e,f){return $("body").on("keyup",function(a){27===a.keyCode&&$(".popover.in").each(function(){$(this).popover("hide")})}),{restrict:"A",scope:!0,link:function(g,h,i){var j=a(i.bsPopover),k=(j.assign,j(g)),l={};angular.isObject(k)&&(l=k),e.when(l.content||f.get(k)||c.get(k,{cache:!0})).then(function(a){angular.isObject(a)&&(a=a.data),i.unique&&h.on("show",function(){$(".popover.in").each(function(){var a=$(this),b=a.data("popover");b&&!b.$element.is(h)&&a.popover("hide")})}),i.hide&&g.$watch(i.hide,function(a,b){a?c.hide():a!==b&&c.show()}),i.show&&g.$watch(i.show,function(a,b){a?d(function(){c.show()}):a!==b&&c.hide()}),h.popover(angular.extend({},l,{content:a,html:!0}));var c=h.data("popover");c.hasContent=function(){return this.getTitle()||a},c.getPosition=function(){var a=$.fn.popover.Constructor.prototype.getPosition.apply(this,arguments);return b(this.$tip)(g),g.$digest(),this.$tip.data("popover",this),a},g.$popover=function(a){c(a)},angular.forEach(["show","hide"],function(a){g[a]=function(){c[a]()}}),g.dismiss=g.hide,angular.forEach(["show","shown","hide","hidden"],function(a){h.on(a,function(b){g.$emit("popover-"+a,b)})})})}}}]),angular.module("$strap.directives").directive("bsSelect",["$timeout",function(a){return{restrict:"A",require:"?ngModel",link:function(b,c,d,e){var f=b.$eval(d.bsSelect)||{};a(function(){c.selectpicker(f),c.next().removeClass("ng-scope")}),e&&b.$watch(d.ngModel,function(a,b){angular.equals(a,b)||c.selectpicker("refresh")})}}}]),angular.module("$strap.directives").directive("bsTabs",["$parse","$compile","$timeout",function(a,b,c){var d='
';return{restrict:"A",require:"?ngModel",priority:0,scope:!0,template:d,replace:!0,transclude:!0,compile:function(){return function(b,d,e,f){var g=a(e.bsTabs);g.assign,g(b),b.panes=[];var h,i,j,k=d.find("ul.nav-tabs"),l=d.find("div.tab-content"),m=0;c(function(){l.find("[data-title], [data-tab]").each(function(a){var c=angular.element(this);h="tab-"+b.$id+"-"+a,i=c.data("title")||c.data("tab"),j=!j&&c.hasClass("active"),c.attr("id",h).addClass("tab-pane"),e.fade&&c.addClass("fade"),b.panes.push({id:h,title:i,content:this.innerHTML,active:j})}),b.panes.length&&!j&&(l.find(".tab-pane:first-child").addClass("active"+(e.fade?" in":"")),b.panes[0].active=!0)}),f&&(d.on("show",function(a){var c=$(a.target);b.$apply(function(){f.$setViewValue(c.data("index"))})}),b.$watch(e.ngModel,function(a){angular.isUndefined(a)||(m=a,setTimeout(function(){var b=$(k[0].querySelectorAll("li")[1*a]);b.hasClass("active")||b.children("a").tab("show")}))}))}}}}]),angular.module("$strap.directives").directive("bsTimepicker",["$timeout","$strapConfig",function(a,b){var c="((?:(?:[0-1][0-9])|(?:[2][0-3])|(?:[0-9])):(?:[0-5][0-9])(?::[0-5][0-9])?(?:\\s?(?:am|AM|pm|PM))?)";return{restrict:"A",require:"?ngModel",link:function(d,e,f,g){if(g){e.on("changeTime.timepicker",function(){a(function(){g.$setViewValue(e.val())})});var h=new RegExp("^"+c+"$",["i"]);g.$parsers.unshift(function(a){return!a||h.test(a)?(g.$setValidity("time",!0),a):(g.$setValidity("time",!1),void 0)})}e.attr("data-toggle","timepicker"),e.parent().addClass("bootstrap-timepicker"),e.timepicker(b.timepicker||{});var i=e.data("timepicker"),j=e.siblings('[data-toggle="timepicker"]');j.length&&j.on("click",$.proxy(i.showWidget,i))}}}]),angular.module("$strap.directives").directive("bsTooltip",["$parse","$compile",function(a){return{restrict:"A",scope:!0,link:function(b,c,d){var e=a(d.bsTooltip),f=(e.assign,e(b));b.$watch(d.bsTooltip,function(a,b){a!==b&&(f=a)}),d.unique&&c.on("show",function(){$(".tooltip.in").each(function(){var a=$(this),b=a.data("tooltip");b&&!b.$element.is(c)&&a.tooltip("hide")})}),c.tooltip({title:function(){return angular.isFunction(f)?f.apply(null,arguments):f},html:!0});var g=c.data("tooltip");g.show=function(){var a=$.fn.tooltip.Constructor.prototype.show.apply(this,arguments);return this.tip().data("tooltip",this),a},b._tooltip=function(a){c.tooltip(a)},b.hide=function(){c.tooltip("hide")},b.show=function(){c.tooltip("show")},b.dismiss=b.hide}}}]),angular.module("$strap.directives").directive("bsTypeahead",["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,c,d,e){var f=a(d.bsTypeahead),g=(f.assign,f(b));b.$watch(d.bsTypeahead,function(a,b){a!==b&&(g=a)}),c.attr("data-provide","typeahead"),c.typeahead({source:function(){return angular.isFunction(g)?g.apply(null,arguments):g},minLength:d.minLength||1,items:d.items,updater:function(a){return e&&b.$apply(function(){e.$setViewValue(a)}),b.$emit("typeahead-updated",a),a}});var h=c.data("typeahead");h.lookup=function(){var a;return this.query=this.$element.val()||"",this.query.length
b.width()?d-f.offset-c:d+f.offset),h.css("top",e+f.offset+g>b.height()?e-f.offset-g:e+f.offset)})}}(),a}),define("settings",["underscore"],function(a){return function(b){var c={elasticsearch:"http://"+window.location.hostname+":9200",panel_names:[],kibana_index:"kibana-int"},d={};return a.each(c,function(a,e){d[e]="undefined"!=typeof b[e]?b[e]:c[e]}),d}}),define("services/alertSrv",["angular","underscore"],function(a,b){var c=a.module("kibana.services");c.service("alertSrv",["$timeout",function(c){var d=this;this.list=[],this.set=function(e,f,g,h){var i={title:e||"",text:f||"",severity:g||"info"},j=a.toJson(i),k=b.map(d.list,function(b){return a.toJson(b)});b.contains(k,j)&&b.remove(d.list,b.indexOf(k,j)),d.list.push(i),h>0&&c(function(){d.list=b.without(d.list,i)},h)},this.clear=function(a){d.list=b.without(d.list,a)},this.clearAll=function(){d.list=[]}}])}),window.Modernizr=function(a,b,c){function d(a){t.cssText=a}function e(a,b){return d(x.join(a+";")+(b||""))}function f(a,b){return typeof a===b}function g(a,b){return!!~(""+a).indexOf(b)}function h(a,b){for(var d in a){var e=a[d];if(!g(e,"-")&&t[e]!==c)return"pfx"==b?e:!0}return!1}function i(a,b,d){for(var e in a){var g=b[a[e]];if(g!==c)return d===!1?a[e]:f(g,"function")?g.bind(d||b):g}return!1}function j(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+z.join(d+" ")+d).split(" ");return f(b,"string")||f(b,"undefined")?h(e,b):(e=(a+" "+A.join(d+" ")+d).split(" "),i(e,b,c))}function k(){o.input=function(c){for(var d=0,e=c.length;e>d;d++)E[c[d]]=c[d]in u;return E.list&&(E.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),E}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),o.inputtypes=function(a){for(var d,e,f,g=0,h=a.length;h>g;g++)u.setAttribute("type",e=a[g]),d="text"!==u.type,d&&(u.value=v,u.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(e)&&u.style.WebkitAppearance!==c?(q.appendChild(u),f=b.defaultView,d=f.getComputedStyle&&"textfield"!==f.getComputedStyle(u,null).WebkitAppearance&&0!==u.offsetHeight,q.removeChild(u)):/^(search|tel)$/.test(e)||(d=/^(url|email)$/.test(e)?u.checkValidity&&u.checkValidity()===!1:u.value!=v)),D[a[g]]=!!d;return D}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var l,m,n="2.6.1",o={},p=!0,q=b.documentElement,r="modernizr",s=b.createElement(r),t=s.style,u=b.createElement("input"),v=":)",w={}.toString,x=" -webkit- -moz- -o- -ms- ".split(" "),y="Webkit Moz O ms",z=y.split(" "),A=y.toLowerCase().split(" "),B={svg:"http://www.w3.org/2000/svg"},C={},D={},E={},F=[],G=F.slice,H=function(a,c,d,e){var f,g,h,i=b.createElement("div"),j=b.body,k=j?j:b.createElement("body");if(parseInt(d,10))for(;d--;)h=b.createElement("div"),h.id=e?e[d]:r+(d+1),i.appendChild(h);return f=["",'"].join(""),i.id=r,(j?i:k).innerHTML+=f,k.appendChild(i),j||(k.style.background="",q.appendChild(k)),g=c(i,a),j?i.parentNode.removeChild(i):k.parentNode.removeChild(k),!!g},I=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return H("@media "+b+" { #"+r+" { position: absolute; } }",function(b){d="absolute"==(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position}),d},J=function(){function a(a,e){e=e||b.createElement(d[a]||"div"),a="on"+a;var g=a in e;return g||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(a,""),g=f(e[a],"function"),f(e[a],"undefined")||(e[a]=c),e.removeAttribute(a))),e=null,g}var d={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return a}(),K={}.hasOwnProperty;m=f(K,"undefined")||f(K.call,"undefined")?function(a,b){return b in a&&f(a.constructor.prototype[b],"undefined")}:function(a,b){return K.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=G.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(G.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(G.call(arguments)))};return d}),C.flexbox=function(){return j("flexWrap")},C.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},C.canvastext=function(){return!!o.canvas&&!!f(b.createElement("canvas").getContext("2d").fillText,"function")},C.webgl=function(){return!!a.WebGLRenderingContext},C.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:H(["@media (",x.join("touch-enabled),("),r,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=9===a.offsetTop}),c},C.geolocation=function(){return"geolocation"in navigator},C.postmessage=function(){return!!a.postMessage},C.websqldatabase=function(){return!!a.openDatabase},C.indexedDB=function(){return!!j("indexedDB",a)},C.hashchange=function(){return J("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},C.history=function(){return!!a.history&&!!history.pushState},C.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},C.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},C.rgba=function(){return d("background-color:rgba(150,255,150,.5)"),g(t.backgroundColor,"rgba")},C.hsla=function(){return d("background-color:hsla(120,40%,100%,.5)"),g(t.backgroundColor,"rgba")||g(t.backgroundColor,"hsla")},C.multiplebgs=function(){return d("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(t.background)},C.backgroundsize=function(){return j("backgroundSize")},C.borderimage=function(){return j("borderImage")},C.borderradius=function(){return j("borderRadius")},C.boxshadow=function(){return j("boxShadow")},C.textshadow=function(){return""===b.createElement("div").style.textShadow},C.opacity=function(){return e("opacity:.55"),/^0.55$/.test(t.opacity)},C.cssanimations=function(){return j("animationName")},C.csscolumns=function(){return j("columnCount")},C.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return d((a+"-webkit- ".split(" ").join(b+a)+x.join(c+a)).slice(0,-a.length)),g(t.backgroundImage,"gradient")},C.cssreflections=function(){return j("boxReflect")},C.csstransforms=function(){return!!j("transform")},C.csstransforms3d=function(){var a=!!j("perspective");return a&&"webkitPerspective"in q.style&&H("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b){a=9===b.offsetLeft&&3===b.offsetHeight}),a},C.csstransitions=function(){return j("transition")},C.fontface=function(){var a;return H('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&0===g.indexOf(d.split(" ")[0])}),a},C.generatedcontent=function(){var a;return H(['#modernizr:after{content:"',v,'";visibility:hidden}'].join(""),function(b){a=b.offsetHeight>=1}),a},C.video=function(){var a=b.createElement("video"),c=!1;try{(c=!!a.canPlayType)&&(c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(d){}return c},C.audio=function(){var a=b.createElement("audio"),c=!1;try{(c=!!a.canPlayType)&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(d){}return c},C.localstorage=function(){try{return localStorage.setItem(r,r),localStorage.removeItem(r),!0}catch(a){return!1}},C.sessionstorage=function(){try{return sessionStorage.setItem(r,r),sessionStorage.removeItem(r),!0}catch(a){return!1}},C.webworkers=function(){return!!a.Worker},C.applicationcache=function(){return!!a.applicationCache},C.svg=function(){return!!b.createElementNS&&!!b.createElementNS(B.svg,"svg").createSVGRect},C.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML=" ",(a.firstChild&&a.firstChild.namespaceURI)==B.svg},C.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(w.call(b.createElementNS(B.svg,"animate")))},C.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(w.call(b.createElementNS(B.svg,"clipPath")))};for(var L in C)m(C,L)&&(l=L.toLowerCase(),o[l]=C[L](),F.push((o[l]?"":"no-")+l));return o.input||k(),o.addTest=function(a,b){if("object"==typeof a)for(var d in a)m(a,d)&&o.addTest(d,a[d]);else{if(a=a.toLowerCase(),o[a]!==c)return o;b="function"==typeof b?b():b,p&&(q.className+=" "+(b?"":"no-")+a),o[a]=b}return o},d(""),s=u=null,function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=r.elements;return"string"==typeof a?a.split(" "):a}function e(a){var b=q[a[o]];return b||(b={},p++,a[o]=p,q[p]=b),b}function f(a,c,d){if(c||(c=b),k)return c.createElement(a);d||(d=e(c));var f;return f=d.cache[a]?d.cache[a].cloneNode():n.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),f.canHaveChildren&&!m.test(a)?d.frag.appendChild(f):f}function g(a,c){if(a||(a=b),k)return a.createDocumentFragment();c=c||e(a);for(var f=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)f.createElement(h[g]);return f}function h(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?f(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function i(a){a||(a=b);var d=e(a);return r.shivCSS&&!j&&!d.hasCSS&&(d.hasCSS=!!c(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),k||h(a,d),a}var j,k,l=a.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,n=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,o="_html5shiv",p=0,q={};!function(){try{var a=b.createElement("a");a.innerHTML=" ",j="hidden"in a,k=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){j=!0,k=!0}}();var r={elements:l.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:l.shivCSS!==!1,supportsUnknownElements:k,shivMethods:l.shivMethods!==!1,type:"default",shivDocument:i,createElement:f,createDocumentFragment:g};a.html5=r,i(b)}(this,b),o._version=n,o._prefixes=x,o._domPrefixes=A,o._cssomPrefixes=z,o.mq=I,o.hasEvent=J,o.testProp=function(a){return h([a])},o.testAllProps=j,o.testStyles=H,o.prefixed=function(a,b,c){return b?j(a,b,c):j(a,"pfx")},q.className=q.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(p?" js "+F.join(" "):""),o}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==q.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=r.shift();s=1,a?a.t?o(function(){("c"==a.t?m.injectCss:m.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):s=0}function i(a,c,d,e,f,i,j){function k(b){if(!n&&g(l.readyState)&&(t.r=n=1,!s&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&o(function(){v.removeChild(l)},50);for(var d in A[c])A[c].hasOwnProperty(d)&&A[c][d].onload()}}var j=j||m.errorTimeout,l={},n=0,q=0,t={t:d,s:c,e:f,a:i,x:j};1===A[c]&&(q=1,A[c]=[],l=b.createElement(a)),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,q)},r.splice(e,0,t),"img"!=a&&(q||2===A[c]?(v.insertBefore(l,u?null:p),o(k,j)):A[c].push(l))}function j(a,b,c,d,f){return s=0,b=b||"j",e(a)?i("c"==b?x:w,a,b,this.i++,c,d,f):(r.splice(this.i++,0,a),1==r.length&&h()),this}function k(){var a=m;return a.loader={load:j,i:0},a}var l,m,n=b.documentElement,o=a.setTimeout,p=b.getElementsByTagName("script")[0],q={}.toString,r=[],s=0,t="MozAppearance"in n.style,u=t&&!!b.createRange().compareNode,v=u?n:p.parentNode,n=a.opera&&"[object Opera]"==q.call(a.opera),n=!!b.attachEvent&&!n,w=t?"object":n?"script":"img",x=n?"script":w,y=Array.isArray||function(a){return"[object Array]"==q.call(a)},z=[],A={},B={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}};m=function(a){function b(a){var b,c,d,a=a.split("!"),e=z.length,f=a.pop(),g=a.length,f={url:f,origUrl:f,prefixes:a};for(c=0;g>c;c++)d=a[c].split("="),(b=B[d.shift()])&&(f=b(f,d));for(c=0;e>c;c++)f=z[c](f);return f}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(A[j.url]?j.noexec=!0:A[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),A[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(l=function(){var a=[].slice.call(arguments);m.apply(this,a),n()}),g(a,l,b,0,j);else if(Object(a)===a)for(i in h=function(){var b,c=0;for(b in a)a.hasOwnProperty(b)&&c++;return c}(),a)a.hasOwnProperty(i)&&(!c&&!--h&&(d(l)?l=function(){var a=[].slice.call(arguments);m.apply(this,a),n()}:l[i]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),n()}}(m[i])),g(a[i],l,b,i,j))}else!c&&n()}var h,i,j=!!a.test,k=a.load||a.both,l=a.callback||f,m=l,n=a.complete||f;
-c(j?a.yep:a.nope,!!k),k&&c(k)}var j,l,n=this.yepnope.loader;if(e(a))g(a,0,n,0);else if(y(a))for(j=0;j0){var a=m.timeRange("min");k.indices(a.from,a.to,r.current.index.pattern,r.current.index.interval).then(function(a){if(a.length>0)r.indices=a;else{if(!r.current.failover)return!1;r.indices=[r.current.index.default]}g.$broadcast("refresh")})}else r.current.failover?(r.indices=[r.current.index.default],g.$broadcast("refresh")):l.set("No time filter","Timestamped indices are configured without a failover. Waiting for time filter.","info",5e3);else r.indices=[r.current.index.default],g.$broadcast("refresh")};var t=function(a){return b.defaults(a,o),b.defaults(a.index,o.index),b.defaults(a.loader,o.loader),a};this.dash_load=function(a){return j.cancel_all(),a=t(a),"none"===a.index.interval&&(r.indices=[a.index.default]),r.current=b.clone(a),n=h.get("querySrv"),m=h.get("filterSrv"),n.init(),m.init(),"none"!==a.index.interval&&0===m.idsByType("time").length&&r.refresh(),!0},this.gist_id=function(a){return r.is_gist(a)?a.match(q)[0].replace(/.*\//,""):void 0},this.is_gist=function(a){return b.isUndefined(a)||""===a||b.isNull(a.match(q))?!1:a.match(q).length>0?!0:!1},this.to_file=function(){var b=new Blob([a.toJson(r.current,!0)],{type:"application/json;charset=utf-8"});return window.saveAs(b,r.current.title+"-"+(new Date).getTime()),!0},this.set_default=function(b){return d.localstorage?(window.localStorage.dashboard=a.toJson(b||r.current),!0):!1},this.purge_default=function(){return d.localstorage?(window.localStorage.dashboard="",!0):!1},this.share_link=function(a,b,c){return{location:window.location.href.replace(window.location.hash,""),type:b,id:c,link:window.location.href.replace(window.location.hash,"")+"#dashboard/"+b+"/"+c,title:a}};var u=function(c,d){var e;b.templateSettings={interpolate:/\{\{(.+?)\}\}/g};var f=b.template(c),g=f({ARGS:d});try{e=a.fromJson(g)}catch(h){e=!1}return e};this.file_load=function(a){return f({url:"app/dashboards/"+a,method:"GET",transformResponse:function(a){return u(a,e)}}).then(function(a){return a?(r.dash_load(t(a.data)),!0):!1},function(){return l.set("Error","Could not load dashboards/"+a+" . Please make sure it exists","error"),!1})},this.elasticsearch_load=function(b,d){return f({url:c.elasticsearch+"/"+c.kibana_index+"/"+b+"/"+d,method:"GET",transformResponse:function(b){return u(a.fromJson(b)._source.dashboard,e)}}).error(function(a,b){return 0===b?l.set("Error","Could not contact Elasticsearch at "+c.elasticsearch+". Please ensure that Elasticsearch is reachable from your system.","error"):l.set("Error","Could not find "+d+". If you"+" are using a proxy, ensure it is configured correctly","error"),!1}).success(function(a){r.dash_load(a)})},this.script_load=function(a){return f({url:"dashboards/"+a,method:"GET",transformResponse:function(a){var b=new Function("ARGS",a);return b(e)}}).then(function(a){return a?(r.dash_load(t(a.data)),!0):!1},function(){return l.set("Error","Could not load scripts/"+a+" . Please make sure it exists and returns a valid dashboard","error"),!1})},this.elasticsearch_save=function(d,e,f){var g,h=b.clone(r.current);"dashboard"===d&&(g=h.title=b.isUndefined(e)?r.current.title:e);var i=p.Document(c.kibana_index,d,g).source({user:"guest",group:"guest",title:h.title,dashboard:a.toJson(h)});return i="temp"===d&&f?i.ttl(f):i,i.doIndex(function(a){return a},function(){return!1})},this.elasticsearch_delete=function(a){return p.Document(c.kibana_index,"dashboard",a).doDelete(function(a){return a},function(){return!1})},this.elasticsearch_list=function(a,b){var d=p.Request().indices(c.kibana_index).types("dashboard");return d.query(p.QueryStringQuery(a||"*")).size(b).doSearch(function(a){return a},function(){return!1})},this.save_gist=function(c,d){var e=b.clone(d||r.current);return e.title=c||r.current.title,f({url:"https://api.github.com/gists",method:"POST",data:{description:e.title,"public":!1,files:{"kibana-dashboard.json":{content:a.toJson(e,!0)}}}}).then(function(a){return a.data.html_url},function(){return!1})},this.gist_list=function(a){return f.jsonp("https://api.github.com/gists/"+a+"?callback=JSON_CALLBACK").then(function(a){var c=[];return b.each(a.data.data.files,function(a){try{var b=JSON.parse(a.content);c.push(b)}catch(d){return!1}}),c},function(){return!1})}}])}),define("services/fields",["angular","underscore","config"],function(a,b,c){var d=a.module("kibana.services");d.service("fields",["dashboard","$rootScope","$http","alertSrv",function(a,d,e,f){var g=this;this.list=["_type"],this.mapping={},d.$watch(function(){return a.indices},function(a){if(!b.isUndefined(a)&&a.length){var c=b.difference(a,b.keys(g.mapping));c.length>0?g.map(c).then(function(a){g.mapping=b.extend(g.mapping,a),g.list=h(g.mapping)}):g.list=h(b.pick(g.mapping,a))}});var h=function(a){var c=[];return b.each(a,function(a){b.each(a,function(a){c=b.union(c,b.keys(a))})}),c};this.map=function(a){var d=e({url:c.elasticsearch+"/"+a.join(",")+"/_mapping",method:"GET"}).error(function(b,d){0===d?f.set("Error","Could not contact Elasticsearch at "+c.elasticsearch+". Please ensure that Elasticsearch is reachable from your system.","error"):f.set("Error","No index found at "+c.elasticsearch+"/"+a.join(",")+"/_mapping. Please create at least one index."+"If you're using a proxy ensure it is configured correctly.","error")});return d.then(function(a){var c={};return b.each(a.data,function(a,d){c[d]={},b.each(a,function(a,b){c[d][b]=i(a)})}),c})};var i=function(a,c){var d=c?c:"",e=c?".":"",f={};for(var g in a)"multi_field"!==a[g].type?"properties"===g?b.extend(f,i(a[g],d)):"object"==typeof a[g]?b.extend(f,i(a[g],d+e+g)):f[d]=a:f[g]=a[g].fields[g]||a[g];return f}}])}),define("services/filterSrv",["angular","underscore","config"],function(a,b,c){var d=a.module("kibana.services");d.service("filterSrv",["dashboard","ejsResource",function(a,d){a.current.services.filter=a.current.services.filter||{};var e={idQueue:[],list:{},ids:[]},f=d(c.elasticsearch),g=a.current.services.filter,h=this;this.init=function(){b.defaults(a.current.services.filter,e),h.list=a.current.services.filter.list,h.ids=a.current.services.filter.ids,g=a.current.services.filter,b.each(h.getByType("time",!0),function(a){h.list[a.id].from=new Date(a.from),h.list[a.id].to=new Date(a.to)})},this.set=function(a,c){if(b.defaults(a,{mandate:"must"}),a.active=!0,b.isUndefined(c)){if(b.isUndefined(a.type))return!1;var d=i(),e={alias:"",id:d};return b.defaults(a,e),h.list[d]=a,h.ids.push(d),d}return b.isUndefined(h.list[c])?!1:(b.extend(h.list[c],a),c)},this.getBoolFilter=function(a){var c=f.BoolFilter().must(f.MatchAllFilter()),d=f.BoolFilter().must(f.MatchAllFilter());return b.each(a,function(a){if(h.list[a].active)switch(h.list[a].mandate){case"mustNot":c=c.mustNot(h.getEjsObj(a));break;case"either":d=d.should(h.getEjsObj(a));break;default:c=c.must(h.getEjsObj(a))}}),c.must(d)},this.getEjsObj=function(a){return h.toEjsObj(h.list[a])},this.toEjsObj=function(a){if(!a.active)return!1;switch(a.type){case"time":return f.RangeFilter(a.field).from(a.from.valueOf()).to(a.to.valueOf());case"range":return f.RangeFilter(a.field).from(a.from).to(a.to);case"querystring":return f.QueryFilter(f.QueryStringQuery(a.query)).cache(!0);case"field":return f.QueryFilter(f.FieldQuery(a.field,a.query)).cache(!0);case"terms":return f.TermsFilter(a.field,a.value);case"exists":return f.ExistsFilter(a.field);case"missing":return f.MissingFilter(a.field);default:return!1}},this.getByType=function(a,c){return b.pick(h.list,h.idsByType(a,c))},this.removeByType=function(a){var c=h.idsByType(a);return b.each(c,function(a){h.remove(a)}),c},this.idsByType=function(a,c){var d=c?{type:a}:{type:a,active:!0};return b.pluck(b.where(h.list,d),"id")},this.timeField=function(){return b.pluck(h.getByType("time"),"field")},this.timeRange=function(a){var c=b.where(h.list,{type:"time",active:!0});if(0===c.length)return!1;switch(a){case"min":return{from:new Date(b.max(b.pluck(c,"from"))),to:new Date(b.min(b.pluck(c,"to")))};case"max":return{from:new Date(b.min(b.pluck(c,"from"))),to:new Date(b.max(b.pluck(c,"to")))};default:return!1}},this.remove=function(c){return b.isUndefined(h.list[c])?!1:(delete h.list[c],h.ids=a.current.services.filter.ids=b.without(h.ids,c),g.idQueue.unshift(c),g.idQueue.sort(function(a,b){return a-b}),!0)};var i=function(){return g.idQueue.length>0?g.idQueue.shift():h.ids.length};h.init()}])}),function(a){function b(a,b){return function(c){return i(a.call(this,c),b)}}function c(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function d(){}function e(a){g(this,a)}function f(a){var b=a.years||a.year||a.y||0,c=a.months||a.month||a.M||0,d=a.weeks||a.week||a.w||0,e=a.days||a.day||a.d||0,f=a.hours||a.hour||a.h||0,g=a.minutes||a.minute||a.m||0,h=a.seconds||a.second||a.s||0,i=a.milliseconds||a.millisecond||a.ms||0;this._input=a,this._milliseconds=i+1e3*h+6e4*g+36e5*f,this._days=e+7*d,this._months=c+12*b,this._data={},this._bubble()}function g(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function h(a){return 0>a?Math.ceil(a):Math.floor(a)}function i(a,b){for(var c=a+"";c.lengthc;c++)~~a[c]!==~~b[c]&&f++;return f+e}function m(a){return a?eb[a]||a.toLowerCase().replace(/(.)s$/,"$1"):a}function n(a,b){return b.abbr=a,L[a]||(L[a]=new d),L[a].set(b),L[a]}function o(a){if(!a)return H.fn._lang;if(!L[a]&&M)try{require("./lang/"+a)}catch(b){return H.fn._lang}return L[a]}function p(a){return a.match(/\[.*\]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function q(a){var b,c,d=a.match(P);for(b=0,c=d.length;c>b;b++)d[b]=ib[d[b]]?ib[d[b]]:p(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 r(a,b){function c(b){return a.lang().longDateFormat(b)||b}for(var d=5;d--&&Q.test(b);)b=b.replace(Q,c);return fb[b]||(fb[b]=q(b)),fb[b](a)}function s(a,b){switch(a){case"DDDD":return T;case"YYYY":return U;case"YYYYY":return V;case"S":case"SS":case"SSS":case"DDD":return S;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return W;case"a":case"A":return o(b._l)._meridiemParse;case"X":return Z;case"Z":case"ZZ":return X;case"T":return Y;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return R;default:return new RegExp(a.replace("\\",""))}}function t(a){var b=(X.exec(a)||[])[0],c=(b+"").match(bb)||["-",0,0],d=+(60*c[1])+~~c[2];return"+"===c[0]?-d:d}function u(a,b,c){var d,e=c._a;switch(a){case"M":case"MM":e[1]=null==b?0:~~b-1;break;case"MMM":case"MMMM":d=o(c._l).monthsParse(b),null!=d?e[1]=d:c._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":null!=b&&(e[2]=~~b);break;case"YY":e[0]=~~b+(~~b>68?1900:2e3);break;case"YYYY":case"YYYYY":e[0]=~~b;break;case"a":case"A":c._isPm=o(c._l).isPM(b);break;case"H":case"HH":case"h":case"hh":e[3]=~~b;break;case"m":case"mm":e[4]=~~b;break;case"s":case"ss":e[5]=~~b;break;case"S":case"SS":case"SSS":e[6]=~~(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=t(b)}null==b&&(c._isValid=!1)}function v(a){var b,c,d=[];if(!a._d){for(b=0;7>b;b++)a._a[b]=d[b]=null==a._a[b]?2===b?1:0:a._a[b];d[3]+=~~((a._tzm||0)/60),d[4]+=~~((a._tzm||0)%60),c=new Date(0),a._useUTC?(c.setUTCFullYear(d[0],d[1],d[2]),c.setUTCHours(d[3],d[4],d[5],d[6])):(c.setFullYear(d[0],d[1],d[2]),c.setHours(d[3],d[4],d[5],d[6])),a._d=c}}function w(a){var b,c,d=a._f.match(P),e=a._i;for(a._a=[],b=0;bh&&(i=h,d=c);g(a,d)}function y(a){var b,c=a._i,d=$.exec(c);if(d){for(a._f="YYYY-MM-DD"+(d[2]||" "),b=0;4>b;b++)if(ab[b][1].exec(c)){a._f+=ab[b][0];break}X.exec(c)&&(a._f+=" Z"),w(a)}else a._d=new Date(c)}function z(b){var c=b._i,d=N.exec(c);c===a?b._d=new Date:d?b._d=new Date(+d[1]):"string"==typeof c?y(b):k(c)?(b._a=c.slice(0),v(b)):b._d=c instanceof Date?new Date(+c):new Date(c)}function A(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function B(a,b,c){var d=K(Math.abs(a)/1e3),e=K(d/60),f=K(e/60),g=K(f/24),h=K(g/365),i=45>d&&["s",d]||1===e&&["m"]||45>e&&["mm",e]||1===f&&["h"]||22>f&&["hh",f]||1===g&&["d"]||25>=g&&["dd",g]||45>=g&&["M"]||345>g&&["MM",K(g/30)]||1===h&&["y"]||["yy",h];return i[2]=b,i[3]=a>0,i[4]=c,A.apply({},i)}function C(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=H(a).add("d",f),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function D(a){var b=a._i,c=a._f;return null===b||""===b?null:("string"==typeof b&&(a._i=b=o().preparse(b)),H.isMoment(b)?(a=g({},b),a._d=new Date(+b._d)):c?k(c)?x(a):w(a):z(a),new e(a))}function E(a,b){H.fn[a]=H.fn[a+"s"]=function(a){var c=this._isUTC?"UTC":"";return null!=a?(this._d["set"+c+b](a),H.updateOffset(this),this):this._d["get"+c+b]()}}function F(a){H.duration.fn[a]=function(){return this._data[a]}}function G(a,b){H.duration.fn["as"+a]=function(){return+this/b}}for(var H,I,J="2.1.0",K=Math.round,L={},M="undefined"!=typeof module&&module.exports,N=/^\/?Date\((\-?\d+)/i,O=/(\-)?(\d*)?\.?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/,P=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,Q=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,R=/\d\d?/,S=/\d{1,3}/,T=/\d{3}/,U=/\d{1,4}/,V=/[+\-]?\d{1,6}/,W=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,X=/Z|[\+\-]\d\d:?\d\d/i,Y=/T/i,Z=/[\+\-]?\d+(\.\d{1,3})?/,$=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,_="YYYY-MM-DDTHH:mm:ssZ",ab=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],bb=/([\+\-]|\d\d)/gi,cb="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),db={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},eb={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",w:"week",M:"month",y:"year"},fb={},gb="DDD w W M D d".split(" "),hb="M D H h m s w W".split(" "),ib={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return i(this.year()%100,2)},YYYY:function(){return i(this.year(),4)},YYYYY:function(){return i(this.year(),5)},gg:function(){return i(this.weekYear()%100,2)},gggg:function(){return this.weekYear()},ggggg:function(){return i(this.weekYear(),5)},GG:function(){return i(this.isoWeekYear()%100,2)},GGGG:function(){return this.isoWeekYear()},GGGGG:function(){return i(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().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~~(this.milliseconds()/100)},SS:function(){return i(~~(this.milliseconds()/10),2)},SSS:function(){return i(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+i(~~(a/60),2)+":"+i(~~a%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+i(~~(10*a/6),4)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()}};gb.length;)I=gb.pop(),ib[I+"o"]=c(ib[I],I);for(;hb.length;)I=hb.pop(),ib[I+I]=b(ib[I],2);for(ib.DDDD=b(ib.DDD,3),d.prototype={set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_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=H([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:function(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=H([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()[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",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return C(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6}},H=function(a,b,c){return D({_i:a,_f:b,_l:c,_isUTC:!1})},H.utc=function(a,b,c){return D({_useUTC:!0,_isUTC:!0,_l:c,_i:a,_f:b})},H.unix=function(a){return H(1e3*a)},H.duration=function(a,b){var c,d,e=H.isDuration(a),g="number"==typeof a,h=e?a._input:g?{}:a,i=O.exec(a);return g?b?h[b]=a:h.milliseconds=a:i&&(c="-"===i[1]?-1:1,h={y:0,d:~~i[2]*c,h:~~i[3]*c,m:~~i[4]*c,s:~~i[5]*c,ms:~~i[6]*c}),d=new f(h),e&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d},H.version=J,H.defaultFormat=_,H.updateOffset=function(){},H.lang=function(a,b){return a?(b?n(a,b):L[a]||o(a),H.duration.fn._lang=H.fn._lang=o(a),void 0):H.fn._lang._abbr},H.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),o(a)},H.isMoment=function(a){return a instanceof e},H.isDuration=function(a){return a instanceof f},H.fn=e.prototype={clone:function(){return H(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){return r(H(this).utc(),"YYYY-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 null==this._isValid&&(this._isValid=this._a?!l(this._a,(this._isUTC?H.utc(this._a):H(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){var b=r(this,a||H.defaultFormat);return this.lang().postformat(b)},add:function(a,b){var c;return c="string"==typeof a?H.duration(+b,a):H.duration(a,b),j(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?H.duration(+b,a):H.duration(a,b),j(this,c,-1),this},diff:function(a,b,c){var d,e,f=this._isUTC?H(a).zone(this._offset||0):H(a).local(),g=6e4*(this.zone()-f.zone());return b=m(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+f.daysInMonth()),e=12*(this.year()-f.year())+(this.month()-f.month()),e+=(this-H(this).startOf("month")-(f-H(f).startOf("month")))/d,e-=6e4*(this.zone()-H(this).startOf("month").zone()-(f.zone()-H(f).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:h(e)},from:function(a,b){return H.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(H(),a)},calendar:function(){var a=this.diff(H().startOf("day"),"days",!0),b=-6>a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse";return this.format(this.lang().calendar(b,this))},isLeapYear:function(){var a=this.year();return 0===a%4&&0!==a%100||0===a%400},isDST:function(){return this.zone()+H(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+H(a).startOf(b)},isSame:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)===+H(a).startOf(b)},min:function(a){return a=H.apply(null,arguments),this>a?this:a},max:function(a){return a=H.apply(null,arguments),a>this?this:a},zone:function(a){var b=this._offset||0;return null==a?this._isUTC?b:this._d.getTimezoneOffset():("string"==typeof a&&(a=t(a)),Math.abs(a)<16&&(a=60*a),this._offset=a,this._isUTC=!0,b!==a&&j(this,H.duration(b-a,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},daysInMonth:function(){return H.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(a){var b=K((H(this).startOf("day")-H(this).startOf("year"))/864e5)+1;return null==a?b:this.add("d",a-b)},weekYear:function(a){var b=C(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=C(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=C(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this._d.getDay()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},lang:function(b){return b===a?this._lang:(this._lang=o(b),this)}},I=0;I0?g.idQueue.shift():h.ids.length},j=function(a){return h.colors[a%h.colors.length]};h.init()}])}),define("services/timer",["angular","underscore"],function(a,b){var c=a.module("kibana.services");c.service("timer",["$timeout",function(a){var c=[];this.register=function(a){return c.push(a),a},this.cancel=function(d){c=b.without(c,d),a.cancel(d)},this.cancel_all=function(){b.each(c,function(b){a.cancel(b)}),c=[]}}])}),define("services/all",["./alertSrv","./dashboard","./fields","./filterSrv","./kbnIndex","./querySrv","./timer"],function(){}),define("controllers/dash",["angular","config","underscore","services/all"],function(a,b,c){var d=a.module("kibana.controllers");d.controller("DashCtrl",["$scope","$route","ejsResource","fields","dashboard","alertSrv",function(a,d,e,f,g,h){a.editor={index:0},a.init=function(){a.config=b,a._=c,a.dashboard=g,a.dashAlerts=h,h.clearAll(),a.fields=f,a.reset_row(),a.ejs=e(b.elasticsearch)},a.add_row=function(a,b){a.rows.push(b)},a.reset_row=function(){a.row={title:"",height:"150px",editable:!0}},a.row_style=function(a){return{"min-height":a.collapse?"5px":a.height}},a.edit_path=function(a){return a?"app/panels/"+a+"/editor.html":!1},a.setEditorTabs=function(b){return a.editorTabs=["General","Panel"],c.isUndefined(b.editorTabs)||(a.editorTabs=c.union(a.editorTabs,c.pluck(b.editorTabs,"title"))),a.editorTabs},a.parse_error=function(a){var b=a.match("nested: (.*?);");return c.isNull(b)?a:b[1]},a.init()}])}),define("controllers/dashLoader",["angular","underscore"],function(a,b){var c=a.module("kibana.controllers");c.controller("dashLoader",["$scope","$http","timer","dashboard","alertSrv",function(a,c,d,e,f){a.loader=e.current.loader,a.init=function(){a.gist_pattern=/(^\d{5,}$)|(^[a-z0-9]{10,}$)|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/,a.gist=a.gist||{},a.elasticsearch=a.elasticsearch||{}},a.showDropdown=function(b){var c=a.loader;return"load"===b?c.load_elasticsearch||c.load_gist||c.load_local:"save"===b?c.save_elasticsearch||c.save_gist||c.local_local||c.save_default:"share"===b?c.save_temp:!1},a.set_default=function(){e.set_default()?f.set("Local Default Set",e.current.title+" has been set as your local default","success",5e3):f.set("Incompatible Browser","Sorry, your browser is too old for this feature","error",5e3)},a.purge_default=function(){e.purge_default()?f.set("Local Default Clear","Your local default dashboard has been cleared","success",5e3):f.set("Incompatible Browser","Sorry, your browser is too old for this feature","error",5e3)},a.elasticsearch_save=function(c,d){e.elasticsearch_save(c,a.elasticsearch.title||e.current.title,a.loader.save_temp_ttl_enable?d:!1).then(function(d){b.isUndefined(d._id)?f.set("Save failed","Dashboard could not be saved to Elasticsearch","error",5e3):(f.set("Dashboard Saved",'This dashboard has been saved to Elasticsearch as "'+d._id+'"',"success",5e3),"temp"===c&&(a.share=e.share_link(e.current.title,"temp",d._id)))})},a.elasticsearch_delete=function(c){e.elasticsearch_delete(c).then(function(d){if(b.isUndefined(d))f.set("Dashboard Not Deleted","An error occurred deleting the dashboard","error",5e3);else if(d.found){f.set("Dashboard Deleted",c+" has been deleted","success",5e3);var e=b.where(a.elasticsearch.dashboards,{_id:c})[0];a.elasticsearch.dashboards=b.without(a.elasticsearch.dashboards,e)}else f.set("Dashboard Not Found","Could not find "+c+" in Elasticsearch","warning",5e3)})},a.elasticsearch_dblist=function(c){e.elasticsearch_list(c,a.loader.load_elasticsearch_size).then(function(c){b.isUndefined(c.hits)||(a.hits=c.hits.total,a.elasticsearch.dashboards=c.hits.hits)})},a.save_gist=function(){e.save_gist(a.gist.title).then(function(c){b.isUndefined(c)?f.set("Save failed","Gist could not be saved","error",5e3):(a.gist.last=c,f.set("Gist saved",'You will be able to access your exported dashboard file at '+c+" in a moment","success"))})},a.gist_dblist=function(b){e.gist_list(b).then(function(b){b&&b.length>0?a.gist.files=b:f.set("Gist Failed","Could not retrieve dashboard list from gist","error",5e3)})}}])}),define("controllers/row",["angular","app","underscore"],function(a,b,c){var d=a.module("kibana.controllers");d.controller("RowCtrl",["$scope","$rootScope","$timeout","ejsResource","querySrv",function(a,b,d,e,f){var g={title:"Row",height:"150px",collapse:!1,collapsable:!0,editable:!0,panels:[]};c.defaults(a.row,g),a.init=function(){a.querySrv=f,a.reset_panel()},a.toggle_row=function(b){b.collapsable&&(b.collapse=b.collapse?!1:!0,b.collapse||d(function(){a.$broadcast("render")}))},a.close_edit=function(){a.$broadcast("render")},a.add_panel=function(b,c){a.row.panels.push(c)},a.reset_panel=function(b){a.panel={error:!1,span:3,editable:!0,type:b}},a.init()}])}),define("controllers/all",["./dash","./dashLoader","./row"],function(){}),define("directives/addPanel",["angular","app","underscore"],function(a,b,c){a.module("kibana.directives").directive("addPanel",["$compile",function(b){return{restrict:"A",link:function(d,e){d.$watch("panel.type",function(){var f=d.panel.type;d.reset_panel(f),c.isUndefined(d.panel.type)||(d.panel.loadingEditor=!0,d.require(["panels/"+d.panel.type+"/module"],function(){var c='
';e.html(b(a.element(c))(d)),d.panel.loadingEditor=!1}))})}}}])}),define("directives/arrayJoin",["angular","app","underscore"],function(a,b,c){a.module("kibana.directives").directive("arrayJoin",function(){return{restrict:"A",require:"ngModel",link:function(a,b,d,e){function f(a){return(a||"").split(",")}function g(a){return c.isArray(a)?(a||"").join(","):a}e.$parsers.push(f),e.$formatters.push(g)}}})}),define("directives/dashUpload",["angular"],function(a){var b=a.module("kibana.directives");b.directive("dashUpload",["timer","dashboard","alertSrv",function(a,b,c){return{restrict:"A",link:function(a){function d(c){for(var d,e=c.target.files,f=function(){return function(c){b.dash_load(JSON.parse(c.target.result)),a.$apply()}},g=0;d=e[g];g++){var h=new FileReader;h.onload=f(d),h.readAsText(d)}}window.File&&window.FileReader&&window.FileList&&window.Blob?document.getElementById("dashupload").addEventListener("change",d,!1):c.set("Oops","Sorry, the HTML5 File APIs are not fully supported in this browser.","error")}}}])}),define("directives/kibanaPanel",["angular"],function(a){a.module("kibana.directives").directive("kibanaPanel",["$compile",function(a){var b='{{panel.title}} ';return{restrict:"E",link:function(c,d,e){function f(b){b.appendTo(d),a(d.contents())(c),d.removeClass("ng-cloak")}c.$watch(e.type,function(a){d.addClass("ng-cloak"),c.require(["jquery","text!panels/"+a+"/module.html"],function(d,e){var g=d(e),h=g.filter("ngcontroller, [ng-controller], .ng-controller");h=h.add(g.find("ngcontroller, [ng-controller], .ng-controller")),h.length?(h.first().prepend(b),c.require(["panels/"+a+"/module"],function(){f(g)})):f(g)})})}}}])}),define("directives/ngBlur",["angular"],function(a){a.module("kibana.directives").directive("ngBlur",["$parse",function(a){return function(b,c,d){var e=a(d.ngBlur);c.bind("blur",function(a){b.$apply(function(){e(b,{$event:a})})})}}])}),define("directives/ngModelOnBlur",["angular"],function(a){a.module("kibana.directives").directive("ngModelOnblur",function(){return{restrict:"A",require:"ngModel",link:function(a,b,c,d){"radio"!==c.type&&"checkbox"!==c.type&&(b.unbind("input").unbind("keydown").unbind("change"),b.bind("blur",function(){a.$apply(function(){d.$setViewValue(b.val())})}))}}})}),define("kbn",["jquery","underscore"],function(a,b){var c={};return c.get_object_fields=function(a){var b=[];a=c.flatten_json(a._source);for(var d in a)b.push(d);return b.sort()},c.get_all_fields=function(a){var c=[];return b.each(a,function(a){c=b.uniq(c.concat(b.keys(a)))}),c=b.without(c,"$$hashKey")},c.has_field=function(a,d){var e=c.get_object_fields(a);return b.inArray(e,d)<0?!1:!0},c.get_related_fields=function(a,c){var d=[];b.each(a,function(a){var e=b.keys(a);b.contains(e,c)&&(d=d.concat(e))});var e=b.countBy(b.without(d,c),function(a){return a});return e},c.recurse_field_dots=function(a,b){var d,e=null;return"undefined"!=typeof a[b]?e=a[b]:(d=b.match(/(.*?)\.(.*)/))&&"undefined"!=typeof a[d[1]]&&(e="undefined"!=typeof a[d[1]][d[2]]?a[d[1]][d[2]]:c.recurse_field_dots(a[d[1]],d[2])),e},c.top_field_values=function(a,c,d){var e=b.pluck(a,c),f={};return b.each(e,function(a){var c=b.isUndefined(a)?"":a.toString();b.has(f,c)?f[c][1]++:f[c]=[a,1]}),b.values(f).sort(function(a,b){return a[1]-b[1]}).reverse().slice(0,d)},c.calculate_interval=function(a,d,e,f){return b.isObject(a)&&(a=a.valueOf()),b.isObject(d)&&(d=d.valueOf()),0===f?c.round_interval((d-a)/e):f},c.round_interval=function(a){switch(!0){case 500>=a:return 100;case 5e3>=a:return 1e3;case 7500>=a:return 5e3;case 15e3>=a:return 1e4;case 45e3>=a:return 3e4;case 18e4>=a:return 6e4;case 45e4>=a:return 3e5;case 12e5>=a:return 6e5;case 27e5>=a:return 18e5;case 72e5>=a:return 36e5;case 216e5>=a:return 108e5;case 864e5>=a:return 432e5;case 1728e5>=a:return 864e5;case 6048e5>=a:return 864e5;case 18144e5>=a:return 6048e5;case 36288e5>a:return 2592e6;default:return 31536e6}},c.secondsToHms=function(a){var b=Math.floor(a/31536e3);if(b)return b+"y";var c=Math.floor(a%31536e3/86400);if(c)return c+"d";var d=Math.floor(a%31536e3%86400/3600);if(d)return d+"h";var e=Math.floor(a%31536e3%86400%3600/60);if(e)return e+"m";var f=a%31536e3%86400%3600%60;return f?f+"s":"less then a second"},c.to_percent=function(a,b){return Math.floor(1e4*(a/b))/100+"%"},c.addslashes=function(a){return a=a.replace(/\\/g,"\\\\"),a=a.replace(/\'/g,"\\'"),a=a.replace(/\"/g,'\\"'),a=a.replace(/\0/g,"\\0")},c.interval_to_seconds=function(a){var b=a.match(/(\d+(?:\.\d+)?)([Mwdhmsy])/);switch(b[2]){case"y":return 31536e3*b[1];case"M":return 2592e3*b[1];case"w":return 604800*b[1];case"d":return 86400*b[1];case"h":return 3600*b[1];case"m":return 60*b[1];case"s":return b[1]}},c.time_ago=function(a){return new Date((new Date).getTime()-1e3*c.interval_to_seconds(a))},c.flatten_json=function(a,d,e){"undefined"==typeof e&&(e={}),"undefined"==typeof d&&(d="");for(var f in a){var g=a[f],h=0===d.length?f:d+"."+f;if("object"==typeof g)if(b.isArray(g))if(g.length>0&&"object"==typeof g[0]){for(var i="",j=0,k=g.length;k>j;j++)j>0&&(i+=", "),i+=JSON.stringify(g[j]);e[h]=i}else e[h]=1===g.length&&b.isNumber(g[0])?parseFloat(g[0]):"undefined"==typeof g?null:g;else c.flatten_json(g,h,e);else e[h]="undefined"==typeof g?null:g}return c.sortObj(e)},c.xmlEnt=function(a){if(b.isString(a)){var c=a.replace(//g,">").replace(/\r\n/g," ").replace(/\r/g," ").replace(/\n/g," ").replace(/\t/g," ").replace(/ /g," ").replace(/<del>/g,"").replace(/<\/del>/g,"");return c}return a},c.sortObj=function(a){var b,c=[],d={};for(b in a)c.push(b);c.sort();for(b in c)d[c[b]]=a[c[b]];return d},c.query_color_dot=function(a,b){return'
'},c}),define("directives/tip",["angular","kbn"],function(a,b){a.module("kibana.directives").directive("tip",["$compile",function(c){return{restrict:"E",link:function(d,e,f){var g=' ";e.replaceWith(c(a.element(g))(d))}}}])}),define("directives/all",["./addPanel","./arrayJoin","./dashUpload","./kibanaPanel","./ngBlur","./ngModelOnBlur","./tip"],function(){}),define("filters/all",["angular","jquery","underscore"],function(a,b,c){var d=a.module("kibana.filters");d.filter("stringSort",function(){return function(a){return a.sort()}}),d.filter("pinnedQuery",["querySrv",function(a){return function(b,d){var e=c.filter(a.ids,function(b){var e=a.list[b];return c.isUndefined(e.pin)||e.pin!==!0||d!==!0?!c.isUndefined(e.pin)&&e.pin!==!1||d!==!1?void 0:!0:!0});return e}}]),d.filter("slice",function(){return function(a,b,d){return c.isUndefined(a)?void 0:a.slice(b,d)}}),d.filter("stringify",function(){return function(b){return c.isObject(b)&&!c.isArray(b)?a.toJson(b):b.toString()}}),d.filter("noXml",function(){var a=function(a){return c.isString(a)?a.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,"""):a};return function(b){return c.isArray(b)?c.map(b,a):a(b)}}),d.filter("urlLink",function(){var a=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,b=/(^|[^\/])(www\.[\S]+(\b|$))/gim,d=/(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim,e=function(e){var f,g,h;return c.isString(e)?(c.each(e.match(a),function(){f=e.replace(a,'$1 ')}),e=f||e,c.each(e.match(b),function(){g=e.replace(b,'$1$2 ')}),e=g||e,c.each(e.match(d),function(){h=e.replace(d,'$1 ')}),e=h||e):e};return function(a){return c.isArray(a)?c.map(a,e):e(a)}}),d.filter("gistid",function(){var a=/(\d{5,})|([a-z0-9]{10,})|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/;return function(b){if(!c.isUndefined(b)){var d=b.match(a);if(!c.isNull(d)&&!c.isUndefined(d))return d[0].replace(/.*\//,"")}}})}),define("app",["angular","jquery","underscore","require","elasticjs","bootstrap","angular-sanitize","angular-strap","extend-jquery"],function(a,b,c,d){var e=a.module("kibana",[]),f=[],g={};e.useModule=function(a){return f?f.push(a):c.extend(a,g),a},e.safeApply=function(a,b){switch(a.$$phase){case"$apply":a.$eval(b);break;case"$digest":setTimeout(function(){e.safeApply(a,b)},10);break;default:a.$apply(b)}},e.config(["$routeProvider","$controllerProvider","$compileProvider","$filterProvider","$provide",function(a,b,c,d,e){a.when("/dashboard",{templateUrl:"app/partials/dashboard.html"}).when("/dashboard/:kbnType/:kbnId",{templateUrl:"app/partials/dashboard.html"}).when("/dashboard/:kbnType/:kbnId/:params",{templateUrl:"app/partials/dashboard.html"}).otherwise({redirectTo:"dashboard"}),g.controller=b.register,g.directive=c.directive,g.factory=e.factory,g.service=e.service,g.filter=d.register}]);var h=["elasticjs.service","$strap.directives","ngSanitize","kibana"];return c.each("controllers directives factories services filters".split(" "),function(b){var c="kibana."+b;e.useModule(a.module(c,[])),h.push(c)}),e.panel_helpers={partial:function(a){return"app/partials/"+a+".html"}},require(["controllers/all","directives/all","filters/all"],function(){a.element(document).ready(function(){b("body").attr("ng-controller","DashCtrl"),a.bootstrap(document,h).invoke(["$rootScope",function(a){c.each(f,function(a){c.extend(a,g)}),f=!1,a.requireContext=d,a.require=function(a,b){var d=this;d.requireContext(a,function(){var a=c.toArray(arguments);d.$apply(function(){b.apply(d,a)})})}}])})}),e}),function(a){a.color={},a.color.make=function(b,c,d,e){var f={};return f.r=b||0,f.g=c||0,f.b=d||0,f.a=null!=e?e:1,f.add=function(a,b){for(var c=0;c=1?"rgb("+[f.r,f.g,f.b].join(",")+")":"rgba("+[f.r,f.g,f.b,f.a].join(",")+")"},f.normalize=function(){function a(a,b,c){return a>b?a:b>c?c:b}return f.r=a(0,parseInt(f.r),255),f.g=a(0,parseInt(f.g),255),f.b=a(0,parseInt(f.b),255),f.a=a(0,f.a,1),f},f.clone=function(){return a.color.make(f.r,f.b,f.g,f.a)},f.normalize()},a.color.extract=function(b,c){var d;do{if(d=b.css(c).toLowerCase(),""!=d&&"transparent"!=d)break;b=b.parent()}while(!a.nodeName(b.get(0),"body"));return"rgba(0, 0, 0, 0)"==d&&(d="transparent"),a.color.parse(d)},a.color.parse=function(c){var d,e=a.color.make;if(d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return e(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10));if(d=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c))return e(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10),parseFloat(d[4]));if(d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return e(2.55*parseFloat(d[1]),2.55*parseFloat(d[2]),2.55*parseFloat(d[3]));if(d=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c))return e(2.55*parseFloat(d[1]),2.55*parseFloat(d[2]),2.55*parseFloat(d[3]),parseFloat(d[4]));if(d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return e(parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16));if(d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return e(parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16));var f=a.trim(c).toLowerCase();return"transparent"==f?e(255,255,255,0):(d=b[f]||[0,0,0],e(d[0],d[1],d[2]))};var b={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(a){function b(b,c){var d=c.children("."+b)[0];if(null==d&&(d=document.createElement("canvas"),d.className=b,a(d).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(c),!d.getContext)){if(!window.G_vmlCanvasManager)throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");d=window.G_vmlCanvasManager.initElement(d)}this.element=d;var e=this.context=d.getContext("2d"),f=window.devicePixelRatio||1,g=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;this.pixelRatio=f/g,this.resize(c.width(),c.height()),this.textContainer=null,this.text={},this._textCache={}}function c(c,e,f,g){function h(a,b){b=[qb].concat(b);for(var c=0;cd;++d)e=eb.xaxes[d],e&&!e.tickColor&&(e.tickColor=e.color),e=a.extend(!0,{},eb.xaxis,e),eb.xaxes[d]=e,e.font&&(e.font=a.extend({},g,e.font),e.font.color||(e.font.color=e.color));for(f=eb.yaxes.length||1,d=0;f>d;++d)e=eb.yaxes[d],e&&!e.tickColor&&(e.tickColor=e.color),e=a.extend(!0,{},eb.yaxis,e),eb.yaxes[d]=e,e.font&&(e.font=a.extend({},g,e.font),e.font.color||(e.font.color=e.color));for(eb.xaxis.noTicks&&null==eb.xaxis.ticks&&(eb.xaxis.ticks=eb.xaxis.noTicks),eb.yaxis.noTicks&&null==eb.yaxis.ticks&&(eb.yaxis.ticks=eb.yaxis.noTicks),eb.x2axis&&(eb.xaxes[1]=a.extend(!0,{},eb.xaxis,eb.x2axis),eb.xaxes[1].position="top"),eb.y2axis&&(eb.yaxes[1]=a.extend(!0,{},eb.yaxis,eb.y2axis),eb.yaxes[1].position="right"),eb.grid.coloredAreas&&(eb.grid.markings=eb.grid.coloredAreas),eb.grid.coloredAreasColor&&(eb.grid.markingsColor=eb.grid.coloredAreasColor),eb.lines&&a.extend(!0,eb.series.lines,eb.lines),eb.points&&a.extend(!0,eb.series.points,eb.points),eb.bars&&a.extend(!0,eb.series.bars,eb.bars),null!=eb.shadowSize&&(eb.series.shadowSize=eb.shadowSize),null!=eb.highlightColor&&(eb.series.highlightColor=eb.highlightColor),d=0;dd&&(d=e))}d>=c&&(c=d+1);var f,g=[],h=eb.colors,i=h.length,j=0;for(b=0;c>b;b++)f=a.color.parse(h[b%i]||"#666"),0==b%i&&b&&(j=j>=0?.5>j?-j-.2:0:-j),g[b]=f.scale("rgb",1+j);var k,l=0;for(b=0;ba.datamax&&c!=s&&(a.datamax=c)}var c,d,e,f,g,i,j,k,l,m,o,p,q=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=Number.MAX_VALUE;for(a.each(n(),function(a,b){b.datamin=q,b.datamax=r,b.used=!1}),c=0;cf;++f)k=m[f],l=p[f],l&&(l.number&&null!=k&&(k=+k,isNaN(k)?k=null:1/0==k?k=s:k==-1/0&&(k=-s)),null==k&&(l.required&&(v=!0),null!=l.defaultValue&&(k=l.defaultValue))),i[e+f]=k;if(v)for(f=0;j>f;++f)k=i[e+f],null!=k&&(l=p[f],l.autoscale&&(l.x&&b(g.xaxis,k,k),l.y&&b(g.yaxis,k,k))),i[e+f]=null;else if(u&&e>0&&null!=i[e-j]&&i[e-j]!=i[e]&&i[e-j+1]!=i[e+1]){for(f=0;j>f;++f)i[e+j+f]=i[e+f];i[e+1]=i[e-j+1],e+=j}}}}for(c=0;cf;++f)k=i[d+f],l=p[f],l&&l.autoscale!==!1&&k!=s&&k!=-s&&(l.x&&(w>k&&(w=k),k>y&&(y=k)),l.y&&(x>k&&(x=k),k>z&&(z=k)));if(g.bars.show){var A;switch(g.bars.align){case"left":A=0;break;case"right":A=-g.bars.barWidth;break;case"center":A=-g.bars.barWidth/2;break;default:throw new Error("Invalid bar alignment: "+g.bars.align)}g.bars.horizontal?(x+=A,z+=A+g.bars.barWidth):(w+=A,y+=A+g.bars.barWidth)}b(g.xaxis,w,y),b(g.yaxis,x,z)}a.each(n(),function(a,b){b.datamin==q&&(b.datamin=null),b.datamax==r&&(b.datamax=null)})}function t(){c.css("padding",0).children(":not(.flot-base,.flot-overlay)").remove(),"static"==c.css("position")&&c.css("position","relative"),fb=new b("flot-base",c),gb=new b("flot-overlay",c),ib=fb.context,jb=gb.context,hb=a(gb.element).unbind();var d=c.data("plot");d&&(d.shutdown(),gb.clear()),c.data("plot",qb)}function u(){eb.grid.hoverable&&(hb.mousemove(T),hb.bind("mouseleave",U)),eb.grid.clickable&&hb.click(V),h(pb.bindEvents,[hb])}function v(){sb&&clearTimeout(sb),hb.unbind("mousemove",T),hb.unbind("mouseleave",U),hb.unbind("click",V),h(pb.shutdown,[hb])}function w(a){function b(a){return a}var c,d,e=a.options.transform||b,f=a.options.inverseTransform;"x"==a.direction?(c=a.scale=nb/Math.abs(e(a.max)-e(a.min)),d=Math.min(e(a.max),e(a.min))):(c=a.scale=ob/Math.abs(e(a.max)-e(a.min)),c=-c,d=Math.max(e(a.max),e(a.min))),a.p2c=e==b?function(a){return(a-d)*c}:function(a){return(e(a)-d)*c},a.c2p=f?function(a){return f(d+a/c)}:function(a){return d+a/c}}function x(a){var b=a.options,c=a.ticks||[],d=b.labelWidth||0,e=b.labelHeight||0,f=d||"x"==a.direction?Math.floor(fb.width/(c.length||1)):null;legacyStyles=a.direction+"Axis "+a.direction+a.n+"Axis",layer="flot-"+a.direction+"-axis flot-"+a.direction+a.n+"-axis "+legacyStyles,font=b.font||"flot-tick-label tickLabel";for(var g=0;g=0;--b)y(g[b]);A(),a.each(g,function(a,b){z(b)})}nb=fb.width-mb.left-mb.right,ob=fb.height-mb.bottom-mb.top,a.each(c,function(a,b){w(b)}),d&&K(),R()}function C(a){var b=a.options,c=+(null!=b.min?b.min:a.datamin),d=+(null!=b.max?b.max:a.datamax),e=d-c;if(0==e){var f=0==d?1:.01;null==b.min&&(c-=f),(null==b.max||null!=b.min)&&(d+=f)}else{var g=b.autoscaleMargin;null!=g&&(null==b.min&&(c-=e*g,0>c&&null!=a.datamin&&a.datamin>=0&&(c=0)),null==b.max&&(d+=e*g,d>0&&null!=a.datamax&&a.datamax<=0&&(d=0)))}a.min=c,a.max=d}function D(b){var c,e=b.options;c="number"==typeof e.ticks&&e.ticks>0?e.ticks:.3*Math.sqrt("x"==b.direction?fb.width:fb.height);var f=(b.max-b.min)/c,g=-Math.floor(Math.log(f)/Math.LN10),h=e.tickDecimals;null!=h&&g>h&&(g=h);var i,j=Math.pow(10,-g),k=f/j;if(1.5>k?i=1:3>k?(i=2,k>2.25&&(null==h||h>=g+1)&&(i=2.5,++g)):i=7.5>k?5:10,i*=j,null!=e.minTickSize&&i0&&(null==e.min&&(b.min=Math.min(b.min,m[0])),null==e.max&&m.length>1&&(b.max=Math.max(b.max,m[m.length-1]))),b.tickGenerator=function(a){var b,c,d=[];for(c=0;c1&&/\..*0$/.test((o[1]-o[0]).toFixed(n))||(b.tickDecimals=n)}}}}function E(b){var c=b.options.ticks,d=[];null==c||"number"==typeof c&&c>0?d=b.tickGenerator(b):c&&(d=a.isFunction(c)?c(b):c);var e,f;for(b.ticks=[],e=0;e1&&(g=h[1])):f=+h,null==g&&(g=b.tickFormatter(f,b)),isNaN(f)||b.ticks.push({v:f,label:g})}}function F(a,b){a.options.autoscaleMargin&&b.length>0&&(null==a.options.min&&(a.min=Math.min(a.min,b[0].v)),null==a.options.max&&b.length>1&&(a.max=Math.max(a.max,b[b.length-1].v)))}function G(){fb.clear(),h(pb.drawBackground,[ib]);var a=eb.grid;a.show&&a.backgroundColor&&I(),a.show&&!a.aboveData&&J();for(var b=0;be){var i=d;d=e,e=i}return{from:d,to:e,axis:c}}function I(){ib.save(),ib.translate(mb.left,mb.top),ib.fillStyle=cb(eb.grid.backgroundColor,ob,0,"rgba(255, 255, 255, 0)"),ib.fillRect(0,0,nb,ob),ib.restore()}function J(){var b,c,d,e;ib.save(),ib.translate(mb.left,mb.top);var f=eb.grid.markings;if(f)for(a.isFunction(f)&&(c=qb.getAxes(),c.xmin=c.xaxis.min,c.xmax=c.xaxis.max,c.ymin=c.yaxis.min,c.ymax=c.yaxis.max,f=f(c)),b=0;bh.axis.max||i.toi.axis.max||(h.from=Math.max(h.from,h.axis.min),h.to=Math.min(h.to,h.axis.max),i.from=Math.max(i.from,i.axis.min),i.to=Math.min(i.to,i.axis.max),(h.from!=h.to||i.from!=i.to)&&(h.from=h.axis.p2c(h.from),h.to=h.axis.p2c(h.to),i.from=i.axis.p2c(i.from),i.to=i.axis.p2c(i.to),h.from==h.to||i.from==i.to?(ib.beginPath(),ib.strokeStyle=g.color||eb.grid.markingsColor,ib.lineWidth=g.lineWidth||eb.grid.markingsLineWidth,ib.moveTo(h.from,i.from),ib.lineTo(h.to,i.to),ib.stroke()):(ib.fillStyle=g.color||eb.grid.markingsColor,ib.fillRect(h.from,i.to,h.to-h.from,i.from-i.to))))}c=n(),d=eb.grid.borderWidth;for(var j=0;jp.max||"full"==r&&("object"==typeof d&&d[p.position]>0||d>0)&&(s==p.min||s==p.max)||("x"==p.direction?(k=p.p2c(s),o="full"==r?-ob:r,"top"==p.position&&(o=-o)):(l=p.p2c(s),m="full"==r?-nb:r,"left"==p.position&&(m=-m)),1==ib.lineWidth&&("x"==p.direction?k=Math.floor(k)+.5:l=Math.floor(l)+.5),ib.moveTo(k,l),ib.lineTo(k+m,l+o))}ib.stroke()}}d&&(e=eb.grid.borderColor,"object"==typeof d||"object"==typeof e?("object"!=typeof d&&(d={top:d,right:d,bottom:d,left:d}),"object"!=typeof e&&(e={top:e,right:e,bottom:e,left:e}),d.top>0&&(ib.strokeStyle=e.top,ib.lineWidth=d.top,ib.beginPath(),ib.moveTo(0-d.left,0-d.top/2),ib.lineTo(nb,0-d.top/2),ib.stroke()),d.right>0&&(ib.strokeStyle=e.right,ib.lineWidth=d.right,ib.beginPath(),ib.moveTo(nb+d.right/2,0-d.top),ib.lineTo(nb+d.right/2,ob),ib.stroke()),d.bottom>0&&(ib.strokeStyle=e.bottom,ib.lineWidth=d.bottom,ib.beginPath(),ib.moveTo(nb+d.right,ob+d.bottom/2),ib.lineTo(0,ob+d.bottom/2),ib.stroke()),d.left>0&&(ib.strokeStyle=e.left,ib.lineWidth=d.left,ib.beginPath(),ib.moveTo(0-d.left/2,ob+d.bottom),ib.lineTo(0-d.left/2,0),ib.stroke())):(ib.lineWidth=d,ib.strokeStyle=eb.grid.borderColor,ib.strokeRect(-d/2,-d/2,nb+d,ob+d))),ib.restore()}function K(){a.each(n(),function(a,b){if(b.show&&0!=b.ticks.length){var c,d,e,f,g,h=b.box,i=b.direction+"Axis "+b.direction+b.n+"Axis",j="flot-"+b.direction+"-axis flot-"+b.direction+b.n+"-axis "+i,k=b.options.font||"flot-tick-label tickLabel";fb.removeText(j);for(var l=0;lb.max||("x"==b.direction?(f="center",d=mb.left+b.p2c(c.v),"bottom"==b.position?e=h.top+h.padding:(e=h.top+h.height-h.padding,g="bottom")):(g="middle",e=mb.top+b.p2c(c.v),"left"==b.position?(d=h.left+h.width-h.padding,f="right"):d=h.left+h.padding),fb.addText(j,d,e,c.label,k,null,null,f,g))}})}function L(a){a.lines.show&&M(a),a.bars.show&&P(a),a.points.show&&N(a)}function M(a){function b(a,b,c,d,e){var f=a.points,g=a.pointsize,h=null,i=null;ib.beginPath();for(var j=g;j=l&&l=n&&n=n&&l>e.max){if(n>e.max)continue;k=(e.max-l)/(n-l)*(m-k)+k,l=e.max}else if(n>=l&&n>e.max){if(l>e.max)continue;m=(e.max-l)/(n-l)*(m-k)+k,n=e.max}if(m>=k&&k=m&&m=m&&k>d.max){if(m>d.max)continue;l=(d.max-k)/(m-k)*(n-l)+l,k=d.max}else if(m>=k&&m>d.max){if(k>d.max)continue;n=(d.max-k)/(m-k)*(n-l)+l,m=d.max}(k!=h||l!=i)&&ib.moveTo(d.p2c(k)+b,e.p2c(l)+c),h=m,i=n,ib.lineTo(d.p2c(m)+b,e.p2c(n)+c)}}ib.stroke()}function c(a,b,c){for(var d=a.points,e=a.pointsize,f=Math.min(Math.max(0,c.min),c.max),g=0,h=!1,i=1,j=0,k=0;;){if(e>0&&g>d.length+e)break;g+=e;var l=d[g-e],m=d[g-e+i],n=d[g],o=d[g+i];if(h){if(e>0&&null!=l&&null==n){k=g,e=-e,i=2;continue}if(0>e&&g==j+e){ib.fill(),h=!1,e=-e,i=1,g=j=k+e;continue}}if(null!=l&&null!=n){if(n>=l&&l=n&&n=n&&l>b.max){if(n>b.max)continue;m=(b.max-l)/(n-l)*(o-m)+m,l=b.max}else if(n>=l&&n>b.max){if(l>b.max)continue;o=(b.max-l)/(n-l)*(o-m)+m,n=b.max}if(h||(ib.beginPath(),ib.moveTo(b.p2c(l),c.p2c(f)),h=!0),m>=c.max&&o>=c.max)ib.lineTo(b.p2c(l),c.p2c(c.max)),ib.lineTo(b.p2c(n),c.p2c(c.max));else if(m<=c.min&&o<=c.min)ib.lineTo(b.p2c(l),c.p2c(c.min)),ib.lineTo(b.p2c(n),c.p2c(c.min));else{var p=l,q=n;o>=m&&m=c.min?(l=(c.min-m)/(o-m)*(n-l)+l,m=c.min):m>=o&&o=c.min&&(n=(c.min-m)/(o-m)*(n-l)+l,o=c.min),m>=o&&m>c.max&&o<=c.max?(l=(c.max-m)/(o-m)*(n-l)+l,m=c.max):o>=m&&o>c.max&&m<=c.max&&(n=(c.max-m)/(o-m)*(n-l)+l,o=c.max),l!=p&&ib.lineTo(b.p2c(p),c.p2c(m)),ib.lineTo(b.p2c(l),c.p2c(m)),ib.lineTo(b.p2c(n),c.p2c(o)),n!=q&&(ib.lineTo(b.p2c(n),c.p2c(o)),ib.lineTo(b.p2c(q),c.p2c(o)))}}}}ib.save(),ib.translate(mb.left,mb.top),ib.lineJoin="round";var d=a.lines.lineWidth,e=a.shadowSize;if(d>0&&e>0){ib.lineWidth=e,ib.strokeStyle="rgba(0,0,0,0.1)";var f=Math.PI/18;b(a.datapoints,Math.sin(f)*(d/2+e/2),Math.cos(f)*(d/2+e/2),a.xaxis,a.yaxis),ib.lineWidth=e/2,b(a.datapoints,Math.sin(f)*(d/2+e/4),Math.cos(f)*(d/2+e/4),a.xaxis,a.yaxis)}ib.lineWidth=d,ib.strokeStyle=a.color;var g=Q(a.lines,a.color,0,ob);g&&(ib.fillStyle=g,c(a.datapoints,a.xaxis,a.yaxis)),d>0&&b(a.datapoints,0,0,a.xaxis,a.yaxis),ib.restore()}function N(a){function b(a,b,c,d,e,f,g,h){for(var i=a.points,j=a.pointsize,k=0;kf.max||mg.max||(ib.beginPath(),l=f.p2c(l),m=g.p2c(m)+d,"circle"==h?ib.arc(l,m,b,0,e?Math.PI:2*Math.PI,!1):h(ib,l,m,b,e),ib.closePath(),c&&(ib.fillStyle=c,ib.fill()),ib.stroke())}}ib.save(),ib.translate(mb.left,mb.top);var c=a.points.lineWidth,d=a.shadowSize,e=a.points.radius,f=a.points.symbol;if(0==c&&(c=1e-4),c>0&&d>0){var g=d/2;ib.lineWidth=g,ib.strokeStyle="rgba(0,0,0,0.1)",b(a.datapoints,e,null,g+g/2,!0,a.xaxis,a.yaxis,f),ib.strokeStyle="rgba(0,0,0,0.2)",b(a.datapoints,e,null,g/2,!0,a.xaxis,a.yaxis,f)}ib.lineWidth=c,ib.strokeStyle=a.color,b(a.datapoints,e,Q(a.points,a.color),0,!1,a.xaxis,a.yaxis,f),ib.restore()}function O(a,b,c,d,e,f,g,h,i,j,k,l){var m,n,o,p,q,r,s,t,u;k?(t=r=s=!0,q=!1,m=c,n=a,p=b+d,o=b+e,m>n&&(u=n,n=m,m=u,q=!0,r=!1)):(q=r=s=!0,t=!1,m=a+d,n=a+e,o=c,p=b,o>p&&(u=p,p=o,o=u,t=!0,s=!1)),nh.max||pi.max||(mh.max&&(n=h.max,r=!1),oi.max&&(p=i.max,s=!1),m=h.p2c(m),o=i.p2c(o),n=h.p2c(n),p=i.p2c(p),g&&(j.beginPath(),j.moveTo(m,o),j.lineTo(m,p),j.lineTo(n,p),j.lineTo(n,o),j.fillStyle=g(o,p),j.fill()),l>0&&(q||r||s||t)&&(j.beginPath(),j.moveTo(m,o+f),q?j.lineTo(m,p+f):j.moveTo(m,p+f),s?j.lineTo(n,p+f):j.moveTo(n,p+f),r?j.lineTo(n,o+f):j.moveTo(n,o+f),t?j.lineTo(m,o+f):j.moveTo(m,o+f),j.stroke()))}function P(a){function b(b,c,d,e,f,g,h){for(var i=b.points,j=b.pointsize,k=0;k"),e.push(""),g=!0),e.push(' '+''+k.label+" ")}if(g&&e.push(" "),0!=e.length){var l='";if(null!=eb.legend.container)a(eb.legend.container).html(l);else{var m="",n=eb.legend.position,o=eb.legend.margin;null==o[0]&&(o=[o,o]),"n"==n.charAt(0)?m+="top:"+(o[1]+mb.top)+"px;":"s"==n.charAt(0)&&(m+="bottom:"+(o[1]+mb.bottom)+"px;"),"e"==n.charAt(1)?m+="right:"+(o[0]+mb.right)+"px;":"w"==n.charAt(1)&&(m+="left:"+(o[0]+mb.left)+"px;");var p=a(''+l.replace('style="','style="position:absolute;'+m+";")+"
").appendTo(c);if(0!=eb.legend.backgroundOpacity){var q=eb.legend.backgroundColor;null==q&&(q=eb.grid.backgroundColor,q=q&&"string"==typeof q?a.color.parse(q):a.color.extract(p,"background-color"),q.a=1,q=q.toString());var r=p.children();a('
').prependTo(p).css("opacity",eb.legend.backgroundOpacity)}}}}}function S(a,b,c){var d,e,f,g=eb.grid.mouseActiveRadius,h=g*g+1,i=null;for(d=db.length-1;d>=0;--d)if(c(db[d])){var j=db[d],k=j.xaxis,l=j.yaxis,m=j.datapoints.points,n=k.c2p(a),o=l.c2p(b),p=g/k.scale,q=g/l.scale;if(f=j.datapoints.pointsize,k.options.inverseTransform&&(p=Number.MAX_VALUE),l.options.inverseTransform&&(q=Number.MAX_VALUE),j.lines.show||j.points.show)for(e=0;ep||-p>r-n||s-o>q||-q>s-o)){var t=Math.abs(k.p2c(r)-a),u=Math.abs(l.p2c(s)-b),v=t*t+u*u;h>v&&(h=v,i=[d,e/f])}}if(j.bars.show&&!i){var w="left"==j.bars.align?0:-j.bars.barWidth/2,x=w+j.bars.barWidth;for(e=0;e=Math.min(y,r)&&o>=s+w&&s+x>=o:n>=r+w&&r+x>=n&&o>=Math.min(y,s)&&o<=Math.max(y,s))&&(i=[d,e/f])}}}return i?(d=i[0],e=i[1],f=db[d].datapoints.pointsize,{datapoint:db[d].datapoints.points.slice(e*f,(e+1)*f),dataIndex:e,series:db[d],seriesIndex:d}):null}function T(a){eb.grid.hoverable&&W("plothover",a,function(a){return 0!=a.hoverable})}function U(a){eb.grid.hoverable&&W("plothover",a,function(){return!1})}function V(a){W("plotclick",a,function(a){return 0!=a.clickable})}function W(a,b,d){var e=hb.offset(),f=b.pageX-e.left-mb.left,g=b.pageY-e.top-mb.top,h=o({left:f,top:g});h.pageX=b.pageX,h.pageY=b.pageY;var i=S(f,g,d);if(i&&(i.pageX=parseInt(i.series.xaxis.p2c(i.datapoint[0])+e.left+mb.left,10),i.pageY=parseInt(i.series.yaxis.p2c(i.datapoint[1])+e.top+mb.top,10)),eb.grid.autoHighlight){for(var j=0;jf.max||eg.max)){var i=b.points.radius+b.points.lineWidth/2;jb.lineWidth=i,jb.strokeStyle=h;var j=1.5*i;d=f.p2c(d),e=g.p2c(e),jb.beginPath(),"circle"==b.points.symbol?jb.arc(d,e,j,0,2*Math.PI,!1):b.points.symbol(jb,d,e,j,!1),jb.closePath(),jb.stroke()}}function bb(b,c){var d="string"==typeof b.highlightColor?b.highlightColor:a.color.parse(b.color).scale("a",.5).toString(),e=d,f="left"==b.bars.align?0:-b.bars.barWidth/2;jb.lineWidth=b.bars.lineWidth,jb.strokeStyle=d,O(c[0],c[1],c[2]||0,f,f+b.bars.barWidth,0,function(){return e},b.xaxis,b.yaxis,jb,b.bars.horizontal,b.bars.lineWidth)}function cb(b,c,d,e){if("string"==typeof b)return b;for(var f=ib.createLinearGradient(0,d,0,c),g=0,h=b.colors.length;h>g;++g){var i=b.colors[g];if("string"!=typeof i){var j=a.color.parse(e);null!=i.brightness&&(j=j.scale("rgb",i.brightness)),null!=i.opacity&&(j.a*=i.opacity),i=j.toString()}f.addColorStop(g/(h-1),i)}return f}var db=[],eb={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},fb=null,gb=null,hb=null,ib=null,jb=null,kb=[],lb=[],mb={left:0,right:0,top:0,bottom:0},nb=0,ob=0,pb={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},qb=this;qb.setData=k,qb.setupGrid=B,qb.draw=G,qb.getPlaceholder=function(){return c},qb.getCanvas=function(){return fb.element},qb.getPlotOffset=function(){return mb},qb.width=function(){return nb},qb.height=function(){return ob},qb.offset=function(){var a=hb.offset();return a.left+=mb.left,a.top+=mb.top,a},qb.getData=function(){return db},qb.getAxes=function(){var b={};return a.each(kb.concat(lb),function(a,c){c&&(b[c.direction+(1!=c.n?c.n:"")+"axis"]=c)}),b},qb.getXAxes=function(){return kb},qb.getYAxes=function(){return lb},qb.c2p=o,qb.p2c=p,qb.getOptions=function(){return eb},qb.highlight=Z,qb.unhighlight=$,qb.triggerRedrawOverlay=X,qb.pointOffset=function(a){return{left:parseInt(kb[m(a,"x")-1].p2c(+a.x)+mb.left,10),top:parseInt(lb[m(a,"y")-1].p2c(+a.y)+mb.top,10)}},qb.shutdown=v,qb.resize=function(){var a=c.width(),b=c.height();fb.resize(a,b),gb.resize(a,b)},qb.hooks=pb,i(qb),j(f),t(),k(e),B(),G(),u();var rb=[],sb=null}function d(a,b){return b*Math.floor(a/b)}var e=Object.prototype.hasOwnProperty;b.prototype.resize=function(a,b){if(0>=a||0>=b)throw new Error("Invalid dimensions for plot, width = "+a+", height = "+b);var c=this.element,d=this.context,e=this.pixelRatio;this.width!=a&&(c.width=a*e,c.style.width=a+"px",this.width=a),this.height!=b&&(c.height=b*e,c.style.height=b+"px",this.height=b),d.restore(),d.save(),d.scale(e,e)},b.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},b.prototype.render=function(){var a=this._textCache;for(var b in a)if(e.call(a,b)){var c=this.getTextLayer(b),d=a[b];c.hide();for(var f in d)if(e.call(d,f)){var g=d[f];for(var h in g)if(e.call(g,h)){for(var i,j=g[h].positions,k=0;i=j[k];k++)i.active?i.rendered||(c.append(i.element),i.rendered=!0):(j.splice(k--,1),i.rendered&&i.element.detach());0==j.length&&delete g[h]}}c.show()}},b.prototype.getTextLayer=function(b){var c=this.text[b];return null==c&&(null==this.textContainer&&(this.textContainer=a("
").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),c=this.text[b]=a("
").addClass(b).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),c},b.prototype.getTextInfo=function(b,c,d,e,f){var g,h,i,j;if(c=""+c,g="object"==typeof d?d.style+" "+d.variant+" "+d.weight+" "+d.size+"px/"+d.lineHeight+"px "+d.family:d,h=this._textCache[b],null==h&&(h=this._textCache[b]={}),i=h[g],null==i&&(i=h[g]={}),j=i[c],null==j){var k=a("
").html(c).css({position:"absolute","max-width":f,top:-9999}).appendTo(this.getTextLayer(b));"object"==typeof d?k.css({font:g,color:d.color}):"string"==typeof d&&k.addClass(d),j=i[c]={width:k.outerWidth(!0),height:k.outerHeight(!0),element:k,positions:[]},k.detach()}return j},b.prototype.addText=function(a,b,c,d,e,f,g,h,i){var j=this.getTextInfo(a,d,e,f,g),k=j.positions;"center"==h?b-=j.width/2:"right"==h&&(b-=j.width),"middle"==i?c-=j.height/2:"bottom"==i&&(c-=j.height);for(var l,m=0;l=k[m];m++)if(l.x==b&&l.y==c)return l.active=!0,void 0;l={active:!0,rendered:!1,element:k.length?j.element.clone():j.element,x:b,y:c},k.push(l),l.element.css({top:Math.round(c),left:Math.round(b),"text-align":h})},b.prototype.removeText=function(a,b,c,d,f,g){if(null==d){var h=this._textCache[a];if(null!=h)for(var i in h)if(e.call(h,i)){var j=h[i];for(var k in j)if(e.call(j,k))for(var l,m=j[k].positions,n=0;l=m[n];n++)l.active=!1}}else for(var l,m=this.getTextInfo(a,d,f,g).positions,n=0;l=m[n];n++)l.x==b&&l.y==c&&(l.active=!1)},a.plot=function(b,d,e){var f=new c(a(b),d,e,a.plot.plugins);return f},a.plot.version="0.8.1",a.plot.plugins=[],a.fn.plot=function(b,c){return this.each(function(){a.plot(this,b,c)})}}(jQuery),define("jquery.flot",function(){}),function(a){function b(b){function f(b){x||(x=!0,s=b.getCanvas(),t=a(s).parent(),e=b.getOptions(),b.setData(g(b.getData())))}function g(b){for(var c=0,d=0,f=0,g=e.series.pie.combine.color,h=[],i=0;if||j/c>e.series.pie.combine.threshold)&&h.push({data:[[1,j]],color:b[i].color,label:b[i].label,angle:2*j*Math.PI/c,percent:j/(c/100)})}return f>1&&h.push({data:[[1,d]],color:g,label:e.series.pie.combine.label,angle:2*d*Math.PI/c,percent:d/(c/100)}),h}function h(b,f){function g(){y.clearRect(0,0,k,l),t.children().filter(".pieLabel, .pieLabelBackground").remove()}function h(){var a=e.series.pie.shadow.left,b=e.series.pie.shadow.top,c=10,d=e.series.pie.shadow.alpha,f=e.series.pie.radius>1?e.series.pie.radius:u*e.series.pie.radius;if(!(f>=k/2-a||f*e.series.pie.tilt>=l/2-b||c>=f)){y.save(),y.translate(a,b),y.globalAlpha=d,y.fillStyle="#000",y.translate(v,w),y.scale(1,e.series.pie.tilt);for(var g=1;c>=g;g++)y.beginPath(),y.arc(0,0,f,0,2*Math.PI,!1),y.fill(),f-=g;y.restore()}}function j(){function b(a,b,c){0>=a||isNaN(a)||(c?y.fillStyle=b:(y.strokeStyle=b,y.lineJoin="round"),y.beginPath(),Math.abs(a-2*Math.PI)>1e-9&&y.moveTo(0,0),y.arc(0,0,f,g,g+a/2,!1),y.arc(0,0,f,g+a/2,g+a,!1),y.closePath(),g+=a,c?y.fill():y.stroke())}function c(){function b(b,c,d){if(0==b.data[0][1])return!0;var g,h=e.legend.labelFormatter,i=e.series.pie.label.formatter;g=h?h(b.label,b):b.label,i&&(g=i(g,b));var j=(c+b.angle+c)/2,m=v+Math.round(Math.cos(j)*f),n=w+Math.round(Math.sin(j)*f)*e.series.pie.tilt,o=""+g+" ";t.append(o);var p=t.children("#pieLabel"+d),q=n-p.height()/2,r=m-p.width()/2;if(p.css("top",q),p.css("left",r),0-q>0||0-r>0||l-(q+p.height())<0||k-(r+p.width())<0)return!1;if(0!=e.series.pie.label.background.opacity){var s=e.series.pie.label.background.color;null==s&&(s=b.color);var u="top:"+q+"px;left:"+r+"px;";a("
").css("opacity",e.series.pie.label.background.opacity).insertBefore(p)}return!0}for(var c=d,f=e.series.pie.label.radius>1?e.series.pie.label.radius:u*e.series.pie.label.radius,g=0;g=100*e.series.pie.label.threshold&&!b(n[g],c,g))return!1;c+=n[g].angle}return!0}var d=Math.PI*e.series.pie.startAngle,f=e.series.pie.radius>1?e.series.pie.radius:u*e.series.pie.radius;y.save(),y.translate(v,w),y.scale(1,e.series.pie.tilt),y.save();for(var g=d,h=0;h0){y.save(),y.lineWidth=e.series.pie.stroke.width,g=d;for(var h=0;hv?v=u:v>k-u&&(v=k-u);var n=b.getData(),o=0;do o>0&&(u*=d),o+=1,g(),e.series.pie.tilt<=.8&&h();while(!j()&&c>o);o>=c&&(g(),t.prepend("Could not draw pie with labels contained inside canvas
")),b.setSeries&&b.insertLegend&&(b.setSeries(n),b.insertLegend())}}function i(a){if(e.series.pie.innerRadius>0){a.save();var b=e.series.pie.innerRadius>1?e.series.pie.innerRadius:u*e.series.pie.innerRadius;a.globalCompositeOperation="destination-out",a.beginPath(),a.fillStyle=e.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=e.series.pie.stroke.color,a.arc(0,0,b,0,2*Math.PI,!1),a.stroke(),a.closePath(),a.restore()}}function j(a,b){for(var c=!1,d=-1,e=a.length,f=e-1;++d1?g.series.pie.radius:u*g.series.pie.radius,i=0;i1e-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;f1?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(l),c.grid.clickable&&b.unbind("click").click(m))}),b.hooks.processDatapoints.push(function(a,b,c,d){var e=a.getOptions();e.series.pie.show&&f(a,b,c,d)}),b.hooks.drawOverlay.push(function(a,b){var c=a.getOptions();c.series.pie.show&&r(a,b)}),b.hooks.draw.push(function(a,b){var c=a.getOptions();c.series.pie.show&&h(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""+a+" "+Math.round(b.percent)+"%
"},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),define("jquery.flot.pie",function(){}),define("text",["module"],function(a){var b,c,d,e,f,g=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],h=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,i=/]*>\s*([\s\S]+)\s*<\/body>/im,j="undefined"!=typeof location&&location.href,k=j&&location.protocol&&location.protocol.replace(/\:/,""),l=j&&location.hostname,m=j&&(location.port||void 0),n={},o=a.config&&a.config()||{};return b={version:"2.0.10",strip:function(a){if(a){a=a.replace(h,"");var b=a.match(i);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:o.createXhr||function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(b=0;3>b;b+=1){c=g[b];try{a=new ActiveXObject(c)}catch(d){}if(a){g=[c];break}}return a},parseName:function(a){var b,c,d,e=!1,f=a.indexOf("."),g=0===a.indexOf("./")||0===a.indexOf("../");return-1!==f&&(!g||f>1)?(b=a.substring(0,f),c=a.substring(f+1,a.length)):b=a,d=c||b,f=d.indexOf("!"),-1!==f&&(e="strip"===d.substring(f+1),d=d.substring(0,f),c?c=d:b=d),{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,d,e){var f,g,h,i=b.xdRegExp.exec(a);return i?(f=i[2],g=i[3],g=g.split(":"),h=g[1],g=g[0],!(f&&f!==c||g&&g.toLowerCase()!==d.toLowerCase()||(h||g)&&h!==e)):!0},finishLoad:function(a,c,d,e){d=c?b.strip(d):d,o.isBuild&&(n[a]=d),e(d)},load:function(a,c,d,e){if(e.isBuild&&!e.inlineText)return d(),void 0;o.isBuild=e.isBuild;var f=b.parseName(a),g=f.moduleName+(f.ext?"."+f.ext:""),h=c.toUrl(g),i=o.useXhr||b.useXhr;return 0===h.indexOf("empty:")?(d(),void 0):(!j||i(h,k,l,m)?b.get(h,function(c){b.finishLoad(a,f.strip,c,d)},function(a){d.error&&d.error(a)}):c([g],function(a){b.finishLoad(f.moduleName+"."+f.ext,f.strip,a,d)}),void 0)},write:function(a,c,d){if(n.hasOwnProperty(c)){var e=b.jsEscape(n[c]);d.asModule(a+"!"+c,"define(function () { return '"+e+"';});\n")}},writeFile:function(a,c,d,e,f){var g=b.parseName(c),h=g.ext?"."+g.ext:"",i=g.moduleName+h,j=d.toUrl(g.moduleName+h)+".js";b.load(i,d,function(){var c=function(a){return e(j,a)};c.asModule=function(a,b){return e.asModule(a,j,b)},b.write(a,i,c,f)},f)}},"node"===o.env||!o.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(c=require.nodeRequire("fs"),b.get=function(a,b,d){try{var e=c.readFileSync(a,"utf8");0===e.indexOf("")&&(e=e.substring(1)),b(e)}catch(f){d(f)}}):"xhr"===o.env||!o.env&&b.createXhr()?b.get=function(a,c,d,e){var f,g=b.createXhr();if(g.open("GET",a,!0),e)for(f in e)e.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),e[f]);o.onXhr&&o.onXhr(g,a),g.onreadystatechange=function(){var b,e;4===g.readyState&&(b=g.status,b>399&&600>b?(e=new Error(a+" HTTP status: "+b),e.xhr=g,d(e)):c(g.responseText),o.onXhrComplete&&o.onXhrComplete(g,a))},g.send(null)}:"rhino"===o.env||!o.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?b.get=function(a,b){var c,d,e="utf-8",f=new java.io.File(a),g=java.lang.System.getProperty("line.separator"),h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),e)),i="";try{for(c=new java.lang.StringBuffer,d=h.readLine(),d&&d.length()&&65279===d.charAt(0)&&(d=d.substring(1)),null!==d&&c.append(d);null!==(d=h.readLine());)c.append(g),c.append(d);i=String(c.toString())}finally{h.close()}b(i)}:("xpconnect"===o.env||!o.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(d=Components.classes,e=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),f="@mozilla.org/windows-registry-key;1"in d,b.get=function(a,b){var c,g,h,i={};f&&(a=a.replace(/\//g,"\\")),h=new FileUtils.File(a);try{c=d["@mozilla.org/network/file-input-stream;1"].createInstance(e.nsIFileInputStream),c.init(h,1,0,!1),g=d["@mozilla.org/intl/converter-input-stream;1"].createInstance(e.nsIConverterInputStream),g.init(c,"utf-8",c.available(),e.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),g.readString(c.available(),i),g.close(),c.close(),b(i.value)}catch(j){throw new Error((h&&h.path||"")+": "+j)}}),b});
\ No newline at end of file
+return a},d:function(a,b){return a.setUTCDate(b)}};q.M=q.MM=q.mm=q.m,q.dd=q.d,e=b(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);var r=f.parts.slice();if(k.length!=r.length&&(r=a(r).filter(function(b,c){return-1!==a.inArray(c,p)}).toArray()),k.length==r.length){for(var l=0,s=r.length;s>l;l++){if(m=parseInt(k[l],10),h=r[l],isNaN(m))switch(h){case"MM":n=a(d[g].months).filter(function(){var a=this.slice(0,k[l].length),b=k[l].slice(0,a.length);return a==b}),m=a.inArray(n[0],d[g].months)+1;break;case"M":n=a(d[g].monthsShort).filter(function(){var a=this.slice(0,k[l].length),b=k[l].slice(0,a.length);return a==b}),m=a.inArray(n[0],d[g].monthsShort)+1}o[h]=m}for(var t,l=0;lh;h++)g.length&&b.push(g.shift()),b.push(f[c.parts[h]]);return b.join("")},headTemplate:' ',contTemplate:' ',footTemplate:' '};e.template=''+e.headTemplate+" "+e.footTemplate+"
"+"
"+'
'+'
'+e.headTemplate+e.contTemplate+e.footTemplate+"
"+"
"+'
'+'
'+e.headTemplate+e.contTemplate+e.footTemplate+"
"+"
"+"
",a.fn.datepicker.DPGlobal=e}(window.jQuery),define("datepicker",function(){}),angular.module("$strap.config",[]).value("$strapConfig",{}),angular.module("$strap.filters",["$strap.config"]),angular.module("$strap.directives",["$strap.config"]),angular.module("$strap",["$strap.filters","$strap.directives","$strap.config"]),angular.module("$strap.directives").directive("bsAlert",["$parse","$timeout","$compile",function(a,b,c){return{restrict:"A",link:function(d,e,f){var g=a(f.bsAlert),h=(g.assign,g(d)),i=function(a){b(function(){e.alert("close")},1*a)};f.bsAlert?d.$watch(f.bsAlert,function(a,b){h=a,e.html((a.title?""+a.title+" ":"")+a.content||""),a.closed&&e.hide(),c(e.contents())(d),(a.type||b.type)&&(b.type&&e.removeClass("alert-"+b.type),a.type&&e.addClass("alert-"+a.type)),angular.isDefined(a.closeAfter)?i(a.closeAfter):f.closeAfter&&i(f.closeAfter),(angular.isUndefined(f.closeButton)||"0"!==f.closeButton&&"false"!==f.closeButton)&&e.prepend('× ')},!0):((angular.isUndefined(f.closeButton)||"0"!==f.closeButton&&"false"!==f.closeButton)&&e.prepend('× '),f.closeAfter&&i(f.closeAfter)),e.addClass("alert").alert(),e.hasClass("fade")&&(e.removeClass("in"),setTimeout(function(){e.addClass("in")}));var j=f.ngRepeat&&f.ngRepeat.split(" in ").pop();e.on("close",function(a){var b;j?(a.preventDefault(),e.removeClass("in"),b=function(){e.trigger("closed"),d.$parent&&d.$parent.$apply(function(){for(var a=j.split("."),b=d.$parent,c=0;cg.length-2?g[0]:g[i+1],b.$apply(function(){c.text(j),e&&e.$setViewValue(j)})})}}}]),angular.module("$strap.directives").directive("bsDatepicker",["$timeout","$strapConfig",function(a,b){var c=/(iP(a|o)d|iPhone)/g.test(navigator.userAgent),d=function(a){return a=a||"en",{"/":"[\\/]","-":"[-]",".":"[.]"," ":"[\\s]",dd:"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))",d:"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))",mm:"(?:[0]?[1-9]|[1][012])",m:"(?:[0]?[1-9]|[1][012])",DD:"(?:"+$.fn.datepicker.dates[a].days.join("|")+")",D:"(?:"+$.fn.datepicker.dates[a].daysShort.join("|")+")",MM:"(?:"+$.fn.datepicker.dates[a].months.join("|")+")",M:"(?:"+$.fn.datepicker.dates[a].monthsShort.join("|")+")",yyyy:"(?:(?:[1]{1}[0-9]{1}[0-9]{1}[0-9]{1})|(?:[2]{1}[0-9]{3}))(?![[0-9]])",yy:"(?:(?:[0-9]{1}[0-9]{1}))(?![[0-9]])"}},e=function(a,b){var c,e=a,f=d(b);return c=0,angular.forEach(f,function(a,b){e=e.split(b).join("${"+c+"}"),c++}),c=0,angular.forEach(f,function(a){e=e.split("${"+c+"}").join(a),c++}),new RegExp("^"+e+"$",["i"])};return{restrict:"A",require:"?ngModel",link:function(a,d,f,g){var h=angular.extend({autoclose:!0},b.datepicker||{}),i=f.dateType||h.type||"date";angular.forEach(["format","weekStart","calendarWeeks","startDate","endDate","daysOfWeekDisabled","autoclose","startView","minViewMode","todayBtn","todayHighlight","keyboardNavigation","language","forceParse"],function(a){angular.isDefined(f[a])&&(h[a]=f[a])});var j=h.language||"en",k=f.dateFormat||h.format||$.fn.datepicker.dates[j]&&$.fn.datepicker.dates[j].format||"mm/dd/yyyy",l=c?"yyyy-mm-dd":k,m=e(l,j);g&&(g.$formatters.unshift(function(a){return"date"===i&&angular.isString(a)&&a?$.fn.datepicker.DPGlobal.parseDate(a,$.fn.datepicker.DPGlobal.parseFormat(k),j):a}),g.$parsers.unshift(function(a){return a?"date"===i&&angular.isDate(a)?(g.$setValidity("date",!0),a):angular.isString(a)&&m.test(a)?(g.$setValidity("date",!0),c?new Date(a):"string"===i?a:$.fn.datepicker.DPGlobal.parseDate(a,$.fn.datepicker.DPGlobal.parseFormat(l),j)):(g.$setValidity("date",!1),void 0):(g.$setValidity("date",!0),null)}),g.$render=function(){if(c){var a=g.$viewValue?$.fn.datepicker.DPGlobal.formatDate(g.$viewValue,$.fn.datepicker.DPGlobal.parseFormat(l),j):"";return d.val(a),a}return g.$viewValue||d.val(""),d.datepicker("update",g.$viewValue)}),c?d.prop("type","date").css("-webkit-appearance","textfield"):(g&&d.on("changeDate",function(b){a.$apply(function(){g.$setViewValue("string"===i?d.val():b.date)})}),d.datepicker(angular.extend(h,{format:l,language:j})),a.$on("$destroy",function(){var a=d.data("datepicker");a&&(a.picker.remove(),d.data("datepicker",null))}),f.$observe("startDate",function(a){d.datepicker("setStartDate",a)}),f.$observe("endDate",function(a){d.datepicker("setEndDate",a)}));var n=d.siblings('[data-toggle="datepicker"]');n.length&&n.on("click",function(){d.prop("disabled")||d.trigger("focus")})}}}]),angular.module("$strap.directives").directive("bsDropdown",["$parse","$compile","$timeout",function(a,b,c){var d=function(a,b){return b||(b=['"]),angular.forEach(a,function(a,c){if(a.divider)return b.splice(c+1,0,' ');var e="",b.splice(c+1,0,e)}),b};return{restrict:"EA",scope:!0,link:function(e,f,g){var h=a(g.bsDropdown),i=h(e);c(function(){!angular.isArray(i);var a=angular.element(d(i).join(""));a.insertAfter(f),b(f.next("ul.dropdown-menu"))(e)}),f.addClass("dropdown-toggle").attr("data-toggle","dropdown")}}}]),angular.module("$strap.directives").factory("$modal",["$rootScope","$compile","$http","$timeout","$q","$templateCache","$strapConfig",function(a,b,c,d,e,f,g){var h=function(h){function i(h){var i=angular.extend({show:!0},g.modal,h),j=i.scope?i.scope:a.$new(),k=i.template;return e.when(f.get(k)||c.get(k,{cache:!0}).then(function(a){return a.data})).then(function(a){var c=k.replace(".html","").replace(/[\/|\.|:]/g,"-")+"-"+j.$id,e=$('
').attr("id",c).addClass("fade").html(a);return i.modalClass&&e.addClass(i.modalClass),$("body").append(e),d(function(){b(e)(j)}),j.$modal=function(a){e.modal(a)},angular.forEach(["show","hide"],function(a){j[a]=function(){e.modal(a)}}),j.dismiss=j.hide,angular.forEach(["show","shown","hide","hidden"],function(a){e.on(a,function(b){j.$emit("modal-"+a,b)})}),e.on("shown",function(){$("input[autofocus], textarea[autofocus]",e).first().trigger("focus")}),e.on("hidden",function(){i.persist||j.$destroy()}),j.$on("$destroy",function(){e.remove()}),e.modal(i),e})}return new i(h)};return h}]).directive("bsModal",["$q","$modal",function(a,b){return{restrict:"A",scope:!0,link:function(c,d,e){var f={template:c.$eval(e.bsModal),persist:!0,show:!1,scope:c};angular.forEach(["modalClass","backdrop","keyboard"],function(a){angular.isDefined(e[a])&&(f[a]=e[a])}),a.when(b(f)).then(function(a){d.attr("data-target","#"+a.attr("id")).attr("data-toggle","modal")})}}}]),angular.module("$strap.directives").directive("bsNavbar",["$location",function(a){return{restrict:"A",link:function(b,c){b.$watch(function(){return a.path()},function(a){$("li[data-match-route]",c).each(function(b,c){var d=angular.element(c),e=d.attr("data-match-route"),f=new RegExp("^"+e+"$",["i"]);f.test(a)?d.addClass("active").find(".collapse.in").collapse("hide"):d.removeClass("active")})})}}}]),angular.module("$strap.directives").directive("bsPopover",["$parse","$compile","$http","$timeout","$q","$templateCache",function(a,b,c,d,e,f){return $("body").on("keyup",function(a){27===a.keyCode&&$(".popover.in").each(function(){$(this).popover("hide")})}),{restrict:"A",scope:!0,link:function(g,h,i){var j=a(i.bsPopover),k=(j.assign,j(g)),l={};angular.isObject(k)&&(l=k),e.when(l.content||f.get(k)||c.get(k,{cache:!0})).then(function(a){angular.isObject(a)&&(a=a.data),i.unique&&h.on("show",function(){$(".popover.in").each(function(){var a=$(this),b=a.data("popover");b&&!b.$element.is(h)&&a.popover("hide")})}),i.hide&&g.$watch(i.hide,function(a,b){a?c.hide():a!==b&&c.show()}),i.show&&g.$watch(i.show,function(a,b){a?d(function(){c.show()}):a!==b&&c.hide()}),h.popover(angular.extend({},l,{content:a,html:!0}));var c=h.data("popover");c.hasContent=function(){return this.getTitle()||a},c.getPosition=function(){var a=$.fn.popover.Constructor.prototype.getPosition.apply(this,arguments);return b(this.$tip)(g),g.$digest(),this.$tip.data("popover",this),a},g.$popover=function(a){c(a)},angular.forEach(["show","hide"],function(a){g[a]=function(){c[a]()}}),g.dismiss=g.hide,angular.forEach(["show","shown","hide","hidden"],function(a){h.on(a,function(b){g.$emit("popover-"+a,b)})})})}}}]),angular.module("$strap.directives").directive("bsSelect",["$timeout",function(a){return{restrict:"A",require:"?ngModel",link:function(b,c,d,e){var f=b.$eval(d.bsSelect)||{};a(function(){c.selectpicker(f),c.next().removeClass("ng-scope")}),e&&b.$watch(d.ngModel,function(a,b){angular.equals(a,b)||c.selectpicker("refresh")})}}}]),angular.module("$strap.directives").directive("bsTabs",["$parse","$compile","$timeout",function(a,b,c){var d='
';return{restrict:"A",require:"?ngModel",priority:0,scope:!0,template:d,replace:!0,transclude:!0,compile:function(){return function(b,d,e,f){var g=a(e.bsTabs);g.assign,g(b),b.panes=[];var h,i,j,k=d.find("ul.nav-tabs"),l=d.find("div.tab-content"),m=0;c(function(){l.find("[data-title], [data-tab]").each(function(a){var c=angular.element(this);h="tab-"+b.$id+"-"+a,i=c.data("title")||c.data("tab"),j=!j&&c.hasClass("active"),c.attr("id",h).addClass("tab-pane"),e.fade&&c.addClass("fade"),b.panes.push({id:h,title:i,content:this.innerHTML,active:j})}),b.panes.length&&!j&&(l.find(".tab-pane:first-child").addClass("active"+(e.fade?" in":"")),b.panes[0].active=!0)}),f&&(d.on("show",function(a){var c=$(a.target);b.$apply(function(){f.$setViewValue(c.data("index"))})}),b.$watch(e.ngModel,function(a){angular.isUndefined(a)||(m=a,setTimeout(function(){var b=$(k[0].querySelectorAll("li")[1*a]);b.hasClass("active")||b.children("a").tab("show")}))}))}}}}]),angular.module("$strap.directives").directive("bsTimepicker",["$timeout","$strapConfig",function(a,b){var c="((?:(?:[0-1][0-9])|(?:[2][0-3])|(?:[0-9])):(?:[0-5][0-9])(?::[0-5][0-9])?(?:\\s?(?:am|AM|pm|PM))?)";return{restrict:"A",require:"?ngModel",link:function(d,e,f,g){if(g){e.on("changeTime.timepicker",function(){a(function(){g.$setViewValue(e.val())})});var h=new RegExp("^"+c+"$",["i"]);g.$parsers.unshift(function(a){return!a||h.test(a)?(g.$setValidity("time",!0),a):(g.$setValidity("time",!1),void 0)})}e.attr("data-toggle","timepicker"),e.parent().addClass("bootstrap-timepicker"),e.timepicker(b.timepicker||{});var i=e.data("timepicker"),j=e.siblings('[data-toggle="timepicker"]');j.length&&j.on("click",$.proxy(i.showWidget,i))}}}]),angular.module("$strap.directives").directive("bsTooltip",["$parse","$compile",function(a){return{restrict:"A",scope:!0,link:function(b,c,d){var e=a(d.bsTooltip),f=(e.assign,e(b));b.$watch(d.bsTooltip,function(a,b){a!==b&&(f=a)}),d.unique&&c.on("show",function(){$(".tooltip.in").each(function(){var a=$(this),b=a.data("tooltip");b&&!b.$element.is(c)&&a.tooltip("hide")})}),c.tooltip({title:function(){return angular.isFunction(f)?f.apply(null,arguments):f},html:!0});var g=c.data("tooltip");g.show=function(){var a=$.fn.tooltip.Constructor.prototype.show.apply(this,arguments);return this.tip().data("tooltip",this),a},b._tooltip=function(a){c.tooltip(a)},b.hide=function(){c.tooltip("hide")},b.show=function(){c.tooltip("show")},b.dismiss=b.hide}}}]),angular.module("$strap.directives").directive("bsTypeahead",["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,c,d,e){var f=a(d.bsTypeahead),g=(f.assign,f(b));b.$watch(d.bsTypeahead,function(a,b){a!==b&&(g=a)}),c.attr("data-provide","typeahead"),c.typeahead({source:function(){return angular.isFunction(g)?g.apply(null,arguments):g},minLength:d.minLength||1,items:d.items,updater:function(a){return e&&b.$apply(function(){e.$setViewValue(a)}),b.$emit("typeahead-updated",a),a}});var h=c.data("typeahead");h.lookup=function(){var a;return this.query=this.$element.val()||"",this.query.length
b.width()?d-f.offset-c:d+f.offset),h.css("top",e+f.offset+g>b.height()?e-f.offset-g:e+f.offset)})}}(),a}),define("settings",["underscore"],function(a){return function(b){var c={elasticsearch:"http://"+window.location.hostname+":9200",panel_names:[],kibana_index:"kibana-int"},d={};return a.each(c,function(a,e){d[e]="undefined"!=typeof b[e]?b[e]:c[e]}),d}}),define("services/alertSrv",["angular","underscore"],function(a,b){var c=a.module("kibana.services");c.service("alertSrv",["$timeout",function(c){var d=this;this.list=[],this.set=function(e,f,g,h){var i={title:e||"",text:f||"",severity:g||"info"},j=a.toJson(i),k=b.map(d.list,function(b){return a.toJson(b)});b.contains(k,j)&&b.remove(d.list,b.indexOf(k,j)),d.list.push(i),h>0&&c(function(){d.list=b.without(d.list,i)},h)},this.clear=function(a){d.list=b.without(d.list,a)},this.clearAll=function(){d.list=[]}}])}),define("kbn",["jquery","underscore"],function(a,b){var c={};return c.get_object_fields=function(a){var b=[];a=c.flatten_json(a._source);for(var d in a)b.push(d);return b.sort()},c.get_all_fields=function(a){var c=[];return b.each(a,function(a){c=b.uniq(c.concat(b.keys(a)))}),c=b.without(c,"$$hashKey")},c.has_field=function(a,d){var e=c.get_object_fields(a);return b.inArray(e,d)<0?!1:!0},c.get_related_fields=function(a,c){var d=[];b.each(a,function(a){var e=b.keys(a);b.contains(e,c)&&(d=d.concat(e))});var e=b.countBy(b.without(d,c),function(a){return a});return e},c.recurse_field_dots=function(a,b){var d,e=null;return"undefined"!=typeof a[b]?e=a[b]:(d=b.match(/(.*?)\.(.*)/))&&"undefined"!=typeof a[d[1]]&&(e="undefined"!=typeof a[d[1]][d[2]]?a[d[1]][d[2]]:c.recurse_field_dots(a[d[1]],d[2])),e},c.top_field_values=function(a,c,d){var e=b.pluck(a,c),f={};return b.each(e,function(a){var c=b.isUndefined(a)?"":a.toString();b.has(f,c)?f[c][1]++:f[c]=[a,1]}),b.values(f).sort(function(a,b){return a[1]-b[1]}).reverse().slice(0,d)},c.calculate_interval=function(a,d,e,f){return b.isObject(a)&&(a=a.valueOf()),b.isObject(d)&&(d=d.valueOf()),0===f?c.round_interval((d-a)/e):f},c.round_interval=function(a){switch(!0){case 500>=a:return 100;case 5e3>=a:return 1e3;case 7500>=a:return 5e3;case 15e3>=a:return 1e4;case 45e3>=a:return 3e4;case 18e4>=a:return 6e4;case 45e4>=a:return 3e5;case 12e5>=a:return 6e5;case 27e5>=a:return 18e5;case 72e5>=a:return 36e5;case 216e5>=a:return 108e5;case 864e5>=a:return 432e5;case 1728e5>=a:return 864e5;case 6048e5>=a:return 864e5;case 18144e5>=a:return 6048e5;case 36288e5>a:return 2592e6;default:return 31536e6}},c.secondsToHms=function(a){var b=Math.floor(a/31536e3);if(b)return b+"y";var c=Math.floor(a%31536e3/86400);if(c)return c+"d";var d=Math.floor(a%31536e3%86400/3600);if(d)return d+"h";var e=Math.floor(a%31536e3%86400%3600/60);if(e)return e+"m";var f=a%31536e3%86400%3600%60;return f?f+"s":"less then a second"},c.to_percent=function(a,b){return Math.floor(1e4*(a/b))/100+"%"},c.addslashes=function(a){return a=a.replace(/\\/g,"\\\\"),a=a.replace(/\'/g,"\\'"),a=a.replace(/\"/g,'\\"'),a=a.replace(/\0/g,"\\0")},c.interval_to_seconds=function(a){var b=a.match(/(\d+(?:\.\d+)?)([Mwdhmsy])/);switch(b[2]){case"y":return 31536e3*b[1];case"M":return 2592e3*b[1];case"w":return 604800*b[1];case"d":return 86400*b[1];case"h":return 3600*b[1];case"m":return 60*b[1];case"s":return b[1]}},c.time_ago=function(a){return new Date((new Date).getTime()-1e3*c.interval_to_seconds(a))},c.flatten_json=function(a,d,e){"undefined"==typeof e&&(e={}),"undefined"==typeof d&&(d="");for(var f in a){var g=a[f],h=0===d.length?f:d+"."+f;if("object"==typeof g)if(b.isArray(g))if(g.length>0&&"object"==typeof g[0]){for(var i="",j=0,k=g.length;k>j;j++)j>0&&(i+=", "),i+=JSON.stringify(g[j]);e[h]=i}else e[h]=1===g.length&&b.isNumber(g[0])?parseFloat(g[0]):"undefined"==typeof g?null:g;else c.flatten_json(g,h,e);else e[h]="undefined"==typeof g?null:g}return c.sortObj(e)},c.xmlEnt=function(a){if(b.isString(a)){var c=a.replace(//g,">").replace(/\r\n/g," ").replace(/\r/g," ").replace(/\n/g," ").replace(/\t/g," ").replace(/ /g," ").replace(/<del>/g,"").replace(/<\/del>/g,"");return c}return a},c.sortObj=function(a){var b,c=[],d={};for(b in a)c.push(b);c.sort();for(b in c)d[c[b]]=a[c[b]];return d},c.query_color_dot=function(a,b){return'
'},c}),function(a){function b(a,b){return function(c){return i(a.call(this,c),b)}}function c(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function d(){}function e(a){g(this,a)}function f(a){var b=a.years||a.year||a.y||0,c=a.months||a.month||a.M||0,d=a.weeks||a.week||a.w||0,e=a.days||a.day||a.d||0,f=a.hours||a.hour||a.h||0,g=a.minutes||a.minute||a.m||0,h=a.seconds||a.second||a.s||0,i=a.milliseconds||a.millisecond||a.ms||0;this._input=a,this._milliseconds=i+1e3*h+6e4*g+36e5*f,this._days=e+7*d,this._months=c+12*b,this._data={},this._bubble()}function g(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function h(a){return 0>a?Math.ceil(a):Math.floor(a)}function i(a,b){for(var c=a+"";c.lengthc;c++)~~a[c]!==~~b[c]&&f++;return f+e}function m(a){return a?eb[a]||a.toLowerCase().replace(/(.)s$/,"$1"):a}function n(a,b){return b.abbr=a,L[a]||(L[a]=new d),L[a].set(b),L[a]}function o(a){if(!a)return H.fn._lang;if(!L[a]&&M)try{require("./lang/"+a)}catch(b){return H.fn._lang}return L[a]}function p(a){return a.match(/\[.*\]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function q(a){var b,c,d=a.match(P);for(b=0,c=d.length;c>b;b++)d[b]=ib[d[b]]?ib[d[b]]:p(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 r(a,b){function c(b){return a.lang().longDateFormat(b)||b}for(var d=5;d--&&Q.test(b);)b=b.replace(Q,c);return fb[b]||(fb[b]=q(b)),fb[b](a)}function s(a,b){switch(a){case"DDDD":return T;case"YYYY":return U;case"YYYYY":return V;case"S":case"SS":case"SSS":case"DDD":return S;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return W;case"a":case"A":return o(b._l)._meridiemParse;case"X":return Z;case"Z":case"ZZ":return X;case"T":return Y;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return R;default:return new RegExp(a.replace("\\",""))}}function t(a){var b=(X.exec(a)||[])[0],c=(b+"").match(bb)||["-",0,0],d=+(60*c[1])+~~c[2];return"+"===c[0]?-d:d}function u(a,b,c){var d,e=c._a;switch(a){case"M":case"MM":e[1]=null==b?0:~~b-1;break;case"MMM":case"MMMM":d=o(c._l).monthsParse(b),null!=d?e[1]=d:c._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":null!=b&&(e[2]=~~b);break;case"YY":e[0]=~~b+(~~b>68?1900:2e3);break;case"YYYY":case"YYYYY":e[0]=~~b;break;case"a":case"A":c._isPm=o(c._l).isPM(b);break;case"H":case"HH":case"h":case"hh":e[3]=~~b;break;case"m":case"mm":e[4]=~~b;break;case"s":case"ss":e[5]=~~b;break;case"S":case"SS":case"SSS":e[6]=~~(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=t(b)}null==b&&(c._isValid=!1)}function v(a){var b,c,d=[];if(!a._d){for(b=0;7>b;b++)a._a[b]=d[b]=null==a._a[b]?2===b?1:0:a._a[b];d[3]+=~~((a._tzm||0)/60),d[4]+=~~((a._tzm||0)%60),c=new Date(0),a._useUTC?(c.setUTCFullYear(d[0],d[1],d[2]),c.setUTCHours(d[3],d[4],d[5],d[6])):(c.setFullYear(d[0],d[1],d[2]),c.setHours(d[3],d[4],d[5],d[6])),a._d=c}}function w(a){var b,c,d=a._f.match(P),e=a._i;for(a._a=[],b=0;bh&&(i=h,d=c);g(a,d)}function y(a){var b,c=a._i,d=$.exec(c);if(d){for(a._f="YYYY-MM-DD"+(d[2]||" "),b=0;4>b;b++)if(ab[b][1].exec(c)){a._f+=ab[b][0];break}X.exec(c)&&(a._f+=" Z"),w(a)}else a._d=new Date(c)}function z(b){var c=b._i,d=N.exec(c);c===a?b._d=new Date:d?b._d=new Date(+d[1]):"string"==typeof c?y(b):k(c)?(b._a=c.slice(0),v(b)):b._d=c instanceof Date?new Date(+c):new Date(c)}function A(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function B(a,b,c){var d=K(Math.abs(a)/1e3),e=K(d/60),f=K(e/60),g=K(f/24),h=K(g/365),i=45>d&&["s",d]||1===e&&["m"]||45>e&&["mm",e]||1===f&&["h"]||22>f&&["hh",f]||1===g&&["d"]||25>=g&&["dd",g]||45>=g&&["M"]||345>g&&["MM",K(g/30)]||1===h&&["y"]||["yy",h];return i[2]=b,i[3]=a>0,i[4]=c,A.apply({},i)}function C(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=H(a).add("d",f),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function D(a){var b=a._i,c=a._f;return null===b||""===b?null:("string"==typeof b&&(a._i=b=o().preparse(b)),H.isMoment(b)?(a=g({},b),a._d=new Date(+b._d)):c?k(c)?x(a):w(a):z(a),new e(a))}function E(a,b){H.fn[a]=H.fn[a+"s"]=function(a){var c=this._isUTC?"UTC":"";return null!=a?(this._d["set"+c+b](a),H.updateOffset(this),this):this._d["get"+c+b]()}}function F(a){H.duration.fn[a]=function(){return this._data[a]}}function G(a,b){H.duration.fn["as"+a]=function(){return+this/b}}for(var H,I,J="2.1.0",K=Math.round,L={},M="undefined"!=typeof module&&module.exports,N=/^\/?Date\((\-?\d+)/i,O=/(\-)?(\d*)?\.?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/,P=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,Q=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,R=/\d\d?/,S=/\d{1,3}/,T=/\d{3}/,U=/\d{1,4}/,V=/[+\-]?\d{1,6}/,W=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,X=/Z|[\+\-]\d\d:?\d\d/i,Y=/T/i,Z=/[\+\-]?\d+(\.\d{1,3})?/,$=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,_="YYYY-MM-DDTHH:mm:ssZ",ab=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],bb=/([\+\-]|\d\d)/gi,cb="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),db={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},eb={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",w:"week",M:"month",y:"year"},fb={},gb="DDD w W M D d".split(" "),hb="M D H h m s w W".split(" "),ib={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return i(this.year()%100,2)},YYYY:function(){return i(this.year(),4)},YYYYY:function(){return i(this.year(),5)},gg:function(){return i(this.weekYear()%100,2)},gggg:function(){return this.weekYear()},ggggg:function(){return i(this.weekYear(),5)},GG:function(){return i(this.isoWeekYear()%100,2)},GGGG:function(){return this.isoWeekYear()},GGGGG:function(){return i(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().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~~(this.milliseconds()/100)},SS:function(){return i(~~(this.milliseconds()/10),2)},SSS:function(){return i(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+i(~~(a/60),2)+":"+i(~~a%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+i(~~(10*a/6),4)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()}};gb.length;)I=gb.pop(),ib[I+"o"]=c(ib[I],I);for(;hb.length;)I=hb.pop(),ib[I+I]=b(ib[I],2);for(ib.DDDD=b(ib.DDD,3),d.prototype={set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_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=H([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:function(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=H([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()[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",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return C(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6}},H=function(a,b,c){return D({_i:a,_f:b,_l:c,_isUTC:!1})},H.utc=function(a,b,c){return D({_useUTC:!0,_isUTC:!0,_l:c,_i:a,_f:b})},H.unix=function(a){return H(1e3*a)},H.duration=function(a,b){var c,d,e=H.isDuration(a),g="number"==typeof a,h=e?a._input:g?{}:a,i=O.exec(a);return g?b?h[b]=a:h.milliseconds=a:i&&(c="-"===i[1]?-1:1,h={y:0,d:~~i[2]*c,h:~~i[3]*c,m:~~i[4]*c,s:~~i[5]*c,ms:~~i[6]*c}),d=new f(h),e&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d},H.version=J,H.defaultFormat=_,H.updateOffset=function(){},H.lang=function(a,b){return a?(b?n(a,b):L[a]||o(a),H.duration.fn._lang=H.fn._lang=o(a),void 0):H.fn._lang._abbr},H.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),o(a)},H.isMoment=function(a){return a instanceof e},H.isDuration=function(a){return a instanceof f},H.fn=e.prototype={clone:function(){return H(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){return r(H(this).utc(),"YYYY-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 null==this._isValid&&(this._isValid=this._a?!l(this._a,(this._isUTC?H.utc(this._a):H(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){var b=r(this,a||H.defaultFormat);return this.lang().postformat(b)},add:function(a,b){var c;return c="string"==typeof a?H.duration(+b,a):H.duration(a,b),j(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?H.duration(+b,a):H.duration(a,b),j(this,c,-1),this},diff:function(a,b,c){var d,e,f=this._isUTC?H(a).zone(this._offset||0):H(a).local(),g=6e4*(this.zone()-f.zone());return b=m(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+f.daysInMonth()),e=12*(this.year()-f.year())+(this.month()-f.month()),e+=(this-H(this).startOf("month")-(f-H(f).startOf("month")))/d,e-=6e4*(this.zone()-H(this).startOf("month").zone()-(f.zone()-H(f).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:h(e)},from:function(a,b){return H.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(H(),a)},calendar:function(){var a=this.diff(H().startOf("day"),"days",!0),b=-6>a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse";return this.format(this.lang().calendar(b,this))},isLeapYear:function(){var a=this.year();return 0===a%4&&0!==a%100||0===a%400},isDST:function(){return this.zone()+H(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+H(a).startOf(b)},isSame:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)===+H(a).startOf(b)},min:function(a){return a=H.apply(null,arguments),this>a?this:a},max:function(a){return a=H.apply(null,arguments),a>this?this:a},zone:function(a){var b=this._offset||0;return null==a?this._isUTC?b:this._d.getTimezoneOffset():("string"==typeof a&&(a=t(a)),Math.abs(a)<16&&(a=60*a),this._offset=a,this._isUTC=!0,b!==a&&j(this,H.duration(b-a,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},daysInMonth:function(){return H.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(a){var b=K((H(this).startOf("day")-H(this).startOf("year"))/864e5)+1;return null==a?b:this.add("d",a-b)},weekYear:function(a){var b=C(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=C(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=C(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this._d.getDay()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},lang:function(b){return b===a?this._lang:(this._lang=o(b),this)}},I=0;Id;d++)E[c[d]]=c[d]in u;return E.list&&(E.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),E}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),o.inputtypes=function(a){for(var d,e,f,g=0,h=a.length;h>g;g++)u.setAttribute("type",e=a[g]),d="text"!==u.type,d&&(u.value=v,u.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(e)&&u.style.WebkitAppearance!==c?(q.appendChild(u),f=b.defaultView,d=f.getComputedStyle&&"textfield"!==f.getComputedStyle(u,null).WebkitAppearance&&0!==u.offsetHeight,q.removeChild(u)):/^(search|tel)$/.test(e)||(d=/^(url|email)$/.test(e)?u.checkValidity&&u.checkValidity()===!1:u.value!=v)),D[a[g]]=!!d;return D}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var l,m,n="2.6.1",o={},p=!0,q=b.documentElement,r="modernizr",s=b.createElement(r),t=s.style,u=b.createElement("input"),v=":)",w={}.toString,x=" -webkit- -moz- -o- -ms- ".split(" "),y="Webkit Moz O ms",z=y.split(" "),A=y.toLowerCase().split(" "),B={svg:"http://www.w3.org/2000/svg"},C={},D={},E={},F=[],G=F.slice,H=function(a,c,d,e){var f,g,h,i=b.createElement("div"),j=b.body,k=j?j:b.createElement("body");if(parseInt(d,10))for(;d--;)h=b.createElement("div"),h.id=e?e[d]:r+(d+1),i.appendChild(h);return f=["",'"].join(""),i.id=r,(j?i:k).innerHTML+=f,k.appendChild(i),j||(k.style.background="",q.appendChild(k)),g=c(i,a),j?i.parentNode.removeChild(i):k.parentNode.removeChild(k),!!g},I=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return H("@media "+b+" { #"+r+" { position: absolute; } }",function(b){d="absolute"==(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position}),d},J=function(){function a(a,e){e=e||b.createElement(d[a]||"div"),a="on"+a;var g=a in e;return g||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(a,""),g=f(e[a],"function"),f(e[a],"undefined")||(e[a]=c),e.removeAttribute(a))),e=null,g}var d={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return a}(),K={}.hasOwnProperty;m=f(K,"undefined")||f(K.call,"undefined")?function(a,b){return b in a&&f(a.constructor.prototype[b],"undefined")}:function(a,b){return K.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=G.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(G.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(G.call(arguments)))};return d}),C.flexbox=function(){return j("flexWrap")},C.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},C.canvastext=function(){return!!o.canvas&&!!f(b.createElement("canvas").getContext("2d").fillText,"function")},C.webgl=function(){return!!a.WebGLRenderingContext},C.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:H(["@media (",x.join("touch-enabled),("),r,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=9===a.offsetTop}),c},C.geolocation=function(){return"geolocation"in navigator},C.postmessage=function(){return!!a.postMessage},C.websqldatabase=function(){return!!a.openDatabase},C.indexedDB=function(){return!!j("indexedDB",a)},C.hashchange=function(){return J("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},C.history=function(){return!!a.history&&!!history.pushState},C.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},C.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},C.rgba=function(){return d("background-color:rgba(150,255,150,.5)"),g(t.backgroundColor,"rgba")},C.hsla=function(){return d("background-color:hsla(120,40%,100%,.5)"),g(t.backgroundColor,"rgba")||g(t.backgroundColor,"hsla")},C.multiplebgs=function(){return d("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(t.background)},C.backgroundsize=function(){return j("backgroundSize")},C.borderimage=function(){return j("borderImage")},C.borderradius=function(){return j("borderRadius")},C.boxshadow=function(){return j("boxShadow")},C.textshadow=function(){return""===b.createElement("div").style.textShadow},C.opacity=function(){return e("opacity:.55"),/^0.55$/.test(t.opacity)},C.cssanimations=function(){return j("animationName")},C.csscolumns=function(){return j("columnCount")},C.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return d((a+"-webkit- ".split(" ").join(b+a)+x.join(c+a)).slice(0,-a.length)),g(t.backgroundImage,"gradient")},C.cssreflections=function(){return j("boxReflect")},C.csstransforms=function(){return!!j("transform")},C.csstransforms3d=function(){var a=!!j("perspective");return a&&"webkitPerspective"in q.style&&H("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b){a=9===b.offsetLeft&&3===b.offsetHeight}),a},C.csstransitions=function(){return j("transition")},C.fontface=function(){var a;return H('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&0===g.indexOf(d.split(" ")[0])}),a},C.generatedcontent=function(){var a;return H(['#modernizr:after{content:"',v,'";visibility:hidden}'].join(""),function(b){a=b.offsetHeight>=1}),a},C.video=function(){var a=b.createElement("video"),c=!1;try{(c=!!a.canPlayType)&&(c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(d){}return c},C.audio=function(){var a=b.createElement("audio"),c=!1;try{(c=!!a.canPlayType)&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(d){}return c},C.localstorage=function(){try{return localStorage.setItem(r,r),localStorage.removeItem(r),!0}catch(a){return!1}},C.sessionstorage=function(){try{return sessionStorage.setItem(r,r),sessionStorage.removeItem(r),!0}catch(a){return!1}},C.webworkers=function(){return!!a.Worker},C.applicationcache=function(){return!!a.applicationCache},C.svg=function(){return!!b.createElementNS&&!!b.createElementNS(B.svg,"svg").createSVGRect},C.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML=" ",(a.firstChild&&a.firstChild.namespaceURI)==B.svg},C.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(w.call(b.createElementNS(B.svg,"animate")))},C.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(w.call(b.createElementNS(B.svg,"clipPath")))};for(var L in C)m(C,L)&&(l=L.toLowerCase(),o[l]=C[L](),F.push((o[l]?"":"no-")+l));return o.input||k(),o.addTest=function(a,b){if("object"==typeof a)for(var d in a)m(a,d)&&o.addTest(d,a[d]);else{if(a=a.toLowerCase(),o[a]!==c)return o;b="function"==typeof b?b():b,p&&(q.className+=" "+(b?"":"no-")+a),o[a]=b}return o},d(""),s=u=null,function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=r.elements;return"string"==typeof a?a.split(" "):a}function e(a){var b=q[a[o]];return b||(b={},p++,a[o]=p,q[p]=b),b}function f(a,c,d){if(c||(c=b),k)return c.createElement(a);d||(d=e(c));var f;return f=d.cache[a]?d.cache[a].cloneNode():n.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),f.canHaveChildren&&!m.test(a)?d.frag.appendChild(f):f}function g(a,c){if(a||(a=b),k)return a.createDocumentFragment();c=c||e(a);for(var f=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)f.createElement(h[g]);return f}function h(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?f(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function i(a){a||(a=b);var d=e(a);return r.shivCSS&&!j&&!d.hasCSS&&(d.hasCSS=!!c(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),k||h(a,d),a}var j,k,l=a.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,n=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,o="_html5shiv",p=0,q={};!function(){try{var a=b.createElement("a");a.innerHTML=" ",j="hidden"in a,k=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){j=!0,k=!0}}();var r={elements:l.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:l.shivCSS!==!1,supportsUnknownElements:k,shivMethods:l.shivMethods!==!1,type:"default",shivDocument:i,createElement:f,createDocumentFragment:g};a.html5=r,i(b)}(this,b),o._version=n,o._prefixes=x,o._domPrefixes=A,o._cssomPrefixes=z,o.mq=I,o.hasEvent=J,o.testProp=function(a){return h([a])},o.testAllProps=j,o.testStyles=H,o.prefixed=function(a,b,c){return b?j(a,b,c):j(a,"pfx")},q.className=q.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(p?" js "+F.join(" "):""),o}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==q.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=r.shift();s=1,a?a.t?o(function(){("c"==a.t?m.injectCss:m.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):s=0}function i(a,c,d,e,f,i,j){function k(b){if(!n&&g(l.readyState)&&(t.r=n=1,!s&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&o(function(){v.removeChild(l)},50);for(var d in A[c])A[c].hasOwnProperty(d)&&A[c][d].onload()}}var j=j||m.errorTimeout,l={},n=0,q=0,t={t:d,s:c,e:f,a:i,x:j};1===A[c]&&(q=1,A[c]=[],l=b.createElement(a)),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,q)},r.splice(e,0,t),"img"!=a&&(q||2===A[c]?(v.insertBefore(l,u?null:p),o(k,j)):A[c].push(l))}function j(a,b,c,d,f){return s=0,b=b||"j",e(a)?i("c"==b?x:w,a,b,this.i++,c,d,f):(r.splice(this.i++,0,a),1==r.length&&h()),this}function k(){var a=m;return a.loader={load:j,i:0},a}var l,m,n=b.documentElement,o=a.setTimeout,p=b.getElementsByTagName("script")[0],q={}.toString,r=[],s=0,t="MozAppearance"in n.style,u=t&&!!b.createRange().compareNode,v=u?n:p.parentNode,n=a.opera&&"[object Opera]"==q.call(a.opera),n=!!b.attachEvent&&!n,w=t?"object":n?"script":"img",x=n?"script":w,y=Array.isArray||function(a){return"[object Array]"==q.call(a)},z=[],A={},B={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}};m=function(a){function b(a){var b,c,d,a=a.split("!"),e=z.length,f=a.pop(),g=a.length,f={url:f,origUrl:f,prefixes:a};for(c=0;g>c;c++)d=a[c].split("="),(b=B[d.shift()])&&(f=b(f,d));for(c=0;e>c;c++)f=z[c](f);return f}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(A[j.url]?j.noexec=!0:A[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),A[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(l=function(){var a=[].slice.call(arguments);m.apply(this,a),n()}),g(a,l,b,0,j);else if(Object(a)===a)for(i in h=function(){var b,c=0;for(b in a)a.hasOwnProperty(b)&&c++;return c}(),a)a.hasOwnProperty(i)&&(!c&&!--h&&(d(l)?l=function(){var a=[].slice.call(arguments);m.apply(this,a),n()}:l[i]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),n()}}(m[i])),g(a[i],l,b,i,j))}else!c&&n()}var h,i,j=!!a.test,k=a.load||a.both,l=a.callback||f,m=l,n=a.complete||f;c(j?a.yep:a.nope,!!k),k&&c(k)}var j,l,n=this.yepnope.loader;if(e(a))g(a,0,n,0);else if(y(a))for(j=0;j0){var a=o.timeRange("min");m.indices(a.from,a.to,t.current.index.pattern,t.current.index.interval).then(function(a){if(a.length>0)t.indices=a;else{if(!t.current.failover)return!1;t.indices=[t.current.index.default]}i.$broadcast("refresh")})}else t.current.failover?(t.indices=[t.current.index.default],i.$broadcast("refresh")):n.set("No time filter","Timestamped indices are configured without a failover. Waiting for time filter.","info",5e3);else t.indices=[t.current.index.default],i.$broadcast("refresh")};var v=function(a){return d.defaults(a,q),d.defaults(a.index,q.index),d.defaults(a.loader,q.loader),a};this.dash_load=function(a){return l.cancel_all(),a=v(a),"none"===a.index.interval&&(t.indices=[a.index.default]),t.current=d.clone(a),p=j.get("querySrv"),o=j.get("filterSrv"),p.init(),o.init(),"none"!==a.index.interval&&0===o.idsByType("time").length&&t.refresh(),!0},this.gist_id=function(a){return t.is_gist(a)?a.match(s)[0].replace(/.*\//,""):void 0},this.is_gist=function(a){return d.isUndefined(a)||""===a||d.isNull(a.match(s))?!1:a.match(s).length>0?!0:!1},this.to_file=function(){var b=new Blob([a.toJson(t.current,!0)],{type:"application/json;charset=utf-8"});return window.saveAs(b,t.current.title+"-"+(new Date).getTime()),!0},this.set_default=function(b){return g.localstorage?(window.localStorage.dashboard=a.toJson(b||t.current),!0):!1},this.purge_default=function(){return g.localstorage?(window.localStorage.dashboard="",!0):!1},this.share_link=function(a,b,c){return{location:window.location.href.replace(window.location.hash,""),type:b,id:c,link:window.location.href.replace(window.location.hash,"")+"#dashboard/"+b+"/"+c,title:a}};var w=function(b,c){var e;d.templateSettings={interpolate:/\{\{(.+?)\}\}/g};var f=d.template(b),g=f({ARGS:c});try{e=a.fromJson(g)}catch(h){e=!1}return e};this.file_load=function(a){return h({url:"app/dashboards/"+a,method:"GET",transformResponse:function(a){return w(a,b)}}).then(function(a){return a?(t.dash_load(v(a.data)),!0):!1},function(){return n.set("Error","Could not load dashboards/"+a+" . Please make sure it exists","error"),!1})},this.elasticsearch_load=function(c,d){return h({url:e.elasticsearch+"/"+e.kibana_index+"/"+c+"/"+d,method:"GET",transformResponse:function(c){return w(a.fromJson(c)._source.dashboard,b)}}).error(function(a,b){return 0===b?n.set("Error","Could not contact Elasticsearch at "+e.elasticsearch+". Please ensure that Elasticsearch is reachable from your system.","error"):n.set("Error","Could not find "+d+". If you"+" are using a proxy, ensure it is configured correctly","error"),!1}).success(function(a){t.dash_load(a)})},this.script_load=function(a){return h({url:"app/dashboards/"+a,method:"GET",transformResponse:function(a){var e=new Function("ARGS","kbn","_","moment","window","document","angular","require","define","$","jQuery",a);return e(b,c,d,f)}}).then(function(a){return a?(t.dash_load(v(a.data)),!0):!1},function(){return n.set("Error","Could not load scripts/"+a+" . Please make sure it exists and returns a valid dashboard","error"),!1})},this.elasticsearch_save=function(b,c,f){var g,h=d.clone(t.current);"dashboard"===b&&(g=h.title=d.isUndefined(c)?t.current.title:c);var i=r.Document(e.kibana_index,b,g).source({user:"guest",group:"guest",title:h.title,dashboard:a.toJson(h)});return i="temp"===b&&f?i.ttl(f):i,i.doIndex(function(a){return a},function(){return!1})},this.elasticsearch_delete=function(a){return r.Document(e.kibana_index,"dashboard",a).doDelete(function(a){return a},function(){return!1})},this.elasticsearch_list=function(a,b){var c=r.Request().indices(e.kibana_index).types("dashboard");return c.query(r.QueryStringQuery(a||"*")).size(b).doSearch(function(a){return a},function(){return!1})},this.save_gist=function(b,c){var e=d.clone(c||t.current);return e.title=b||t.current.title,h({url:"https://api.github.com/gists",method:"POST",data:{description:e.title,"public":!1,files:{"kibana-dashboard.json":{content:a.toJson(e,!0)}}}}).then(function(a){return a.data.html_url},function(){return!1})},this.gist_list=function(a){return h.jsonp("https://api.github.com/gists/"+a+"?callback=JSON_CALLBACK").then(function(a){var b=[];return d.each(a.data.data.files,function(a){try{var c=JSON.parse(a.content);b.push(c)}catch(d){return!1}}),b},function(){return!1})}}])}),define("services/fields",["angular","underscore","config"],function(a,b,c){var d=a.module("kibana.services");d.service("fields",["dashboard","$rootScope","$http","alertSrv",function(a,d,e,f){var g=this;this.list=["_type"],this.mapping={},d.$watch(function(){return a.indices},function(a){if(!b.isUndefined(a)&&a.length){var c=b.difference(a,b.keys(g.mapping));c.length>0?g.map(c).then(function(a){g.mapping=b.extend(g.mapping,a),g.list=h(g.mapping)}):g.list=h(b.pick(g.mapping,a))}});var h=function(a){var c=[];return b.each(a,function(a){b.each(a,function(a){c=b.union(c,b.keys(a))})}),c};this.map=function(a){var d=e({url:c.elasticsearch+"/"+a.join(",")+"/_mapping",method:"GET"}).error(function(b,d){0===d?f.set("Error","Could not contact Elasticsearch at "+c.elasticsearch+". Please ensure that Elasticsearch is reachable from your system.","error"):f.set("Error","No index found at "+c.elasticsearch+"/"+a.join(",")+"/_mapping. Please create at least one index."+"If you're using a proxy ensure it is configured correctly.","error")});return d.then(function(a){var c={};return b.each(a.data,function(a,d){c[d]={},b.each(a,function(a,b){c[d][b]=i(a)})}),c})};var i=function(a,c){var d=c?c:"",e=c?".":"",f={};for(var g in a)"multi_field"!==a[g].type?"properties"===g?b.extend(f,i(a[g],d)):"object"==typeof a[g]?b.extend(f,i(a[g],d+e+g)):f[d]=a:f[g]=a[g].fields[g]||a[g];return f}}])}),define("services/filterSrv",["angular","underscore","config"],function(a,b,c){var d=a.module("kibana.services");d.service("filterSrv",["dashboard","ejsResource",function(a,d){a.current.services.filter=a.current.services.filter||{};var e={idQueue:[],list:{},ids:[]},f=d(c.elasticsearch),g=a.current.services.filter,h=this;this.init=function(){b.defaults(a.current.services.filter,e),h.list=a.current.services.filter.list,h.ids=a.current.services.filter.ids,g=a.current.services.filter,b.each(h.getByType("time",!0),function(a){h.list[a.id].from=new Date(a.from),h.list[a.id].to=new Date(a.to)})},this.set=function(a,c){if(b.defaults(a,{mandate:"must"}),a.active=!0,b.isUndefined(c)){if(b.isUndefined(a.type))return!1;var d=i(),e={alias:"",id:d};return b.defaults(a,e),h.list[d]=a,h.ids.push(d),d}return b.isUndefined(h.list[c])?!1:(b.extend(h.list[c],a),c)},this.getBoolFilter=function(a){var c=f.BoolFilter().must(f.MatchAllFilter()),d=f.BoolFilter().must(f.MatchAllFilter());return b.each(a,function(a){if(h.list[a].active)switch(h.list[a].mandate){case"mustNot":c=c.mustNot(h.getEjsObj(a));break;case"either":d=d.should(h.getEjsObj(a));break;default:c=c.must(h.getEjsObj(a))}}),c.must(d)},this.getEjsObj=function(a){return h.toEjsObj(h.list[a])},this.toEjsObj=function(a){if(!a.active)return!1;switch(a.type){case"time":return f.RangeFilter(a.field).from(a.from.valueOf()).to(a.to.valueOf());case"range":return f.RangeFilter(a.field).from(a.from).to(a.to);case"querystring":return f.QueryFilter(f.QueryStringQuery(a.query)).cache(!0);case"field":return f.QueryFilter(f.FieldQuery(a.field,a.query)).cache(!0);case"terms":return f.TermsFilter(a.field,a.value);case"exists":return f.ExistsFilter(a.field);case"missing":return f.MissingFilter(a.field);default:return!1}},this.getByType=function(a,c){return b.pick(h.list,h.idsByType(a,c))},this.removeByType=function(a){var c=h.idsByType(a);return b.each(c,function(a){h.remove(a)}),c},this.idsByType=function(a,c){var d=c?{type:a}:{type:a,active:!0};return b.pluck(b.where(h.list,d),"id")},this.timeField=function(){return b.pluck(h.getByType("time"),"field")
+},this.timeRange=function(a){var c=b.where(h.list,{type:"time",active:!0});if(0===c.length)return!1;switch(a){case"min":return{from:new Date(b.max(b.pluck(c,"from"))),to:new Date(b.min(b.pluck(c,"to")))};case"max":return{from:new Date(b.min(b.pluck(c,"from"))),to:new Date(b.max(b.pluck(c,"to")))};default:return!1}},this.remove=function(c){return b.isUndefined(h.list[c])?!1:(delete h.list[c],h.ids=a.current.services.filter.ids=b.without(h.ids,c),g.idQueue.unshift(c),g.idQueue.sort(function(a,b){return a-b}),!0)};var i=function(){return g.idQueue.length>0?g.idQueue.shift():h.ids.length};h.init()}])}),define("services/kbnIndex",["angular","underscore","config","moment"],function(a,b,c,d){var e=a.module("kibana.services");e.service("kbnIndex",["$http","alertSrv",function(a,e){function f(){var d=a({url:c.elasticsearch+"/_aliases",method:"GET"}).error(function(a,b){0===b?e.set("Error","Could not contact Elasticsearch at "+c.elasticsearch+". Please ensure that Elasticsearch is reachable from your system.","error"):e.set("Error","Could not reach "+c.elasticsearch+"/_aliases. If you"+" are using a proxy, ensure it is configured correctly","error")});return d.then(function(a){var c=[];return b.each(a.data,function(a,d){c.push(d),b.each(a.aliases,function(a,b){c.push(b)})}),c})}function g(a){return a=d(a).clone().toDate(),d(new Date(a.getTime()+6e4*a.getTimezoneOffset()))}function h(a,c,e){if(b.contains(["hour","day","week","month","year"],e)){var f;for(a=d(a).clone(),f=[];a.isBefore(c);)switch(f.push(a.clone()),e){case"hour":a.add("hours",1);break;case"day":a.add("days",1);break;case"week":a.add("weeks",1);break;case"month":a.add("months",1);break;case"year":a.add("years",1)}return f.push(d(c).clone()),f}return!1}this.indices=function(a,c,d,e){var i=[];return b.each(h(g(a),g(c),e),function(a){i.push(a.format(d))}),f().then(function(a){var c=b.intersection(i,a);return c.reverse(),c})}}])}),define("services/querySrv",["angular","underscore","config"],function(a,b,c){var d=a.module("kibana.services");d.service("querySrv",["dashboard","ejsResource",function(a,d){a.current.services.query=a.current.services.query||{},b.defaults(a.current.services.query,{idQueue:[],list:{},ids:[]});var e={query:"*",alias:"",pin:!1,type:"lucene"},f=d(c.elasticsearch),g=a.current.services.query;this.colors=["#7EB26D","#EAB839","#6ED0E0","#EF843C","#E24D42","#1F78C1","#BA43A9","#705DA0","#508642","#CCA300","#447EBC","#C15C17","#890F02","#0A437C","#6D1F62","#584477","#B7DBAB","#F4D598","#70DBED","#F9BA8F","#F29191","#82B5D8","#E5A8E2","#AEA2E0","#629E51","#E5AC0E","#64B0C8","#E0752D","#BF1B00","#0A50A1","#962D82","#614D93","#9AC48A","#F2C96D","#65C5DB","#F9934E","#EA6460","#5195CE","#D683CE","#806EB7","#3F6833","#967302","#2F575E","#99440A","#58140C","#052B51","#511749","#3F2B5B","#E0F9D7","#FCEACA","#CFFAFF","#F9E2D2","#FCE2DE","#BADFF4","#F9D9F9","#DEDAF7"];var h=this;this.init=function(){g=a.current.services.query,h.list=a.current.services.query.list,h.ids=a.current.services.query.ids,b.each(h.list,function(a,c){b.defaults(a,e),a.color=j(c)}),0===h.ids.length&&h.set({})},this.set=function(a,c){if(b.isUndefined(c)){var d=a.id||i();return a.id=d,a.color=a.color||j(d),b.defaults(a,e),h.list[d]=a,h.ids.push(d),d}return b.isUndefined(h.list[c])?!1:(b.extend(h.list[c],a),c)},this.remove=function(c){return b.isUndefined(h.list[c])?!1:(delete h.list[c],h.ids=a.current.services.query.ids=b.without(h.ids,c),g.idQueue.unshift(c),g.idQueue.sort(function(a,b){return a-b}),!0)},this.getEjsObj=function(a){return h.toEjsObj(h.list[a])},this.toEjsObj=function(a){switch(a.type){case"lucene":return f.QueryStringQuery(a.query||"*");default:return b.isUndefined(a.query)?!1:f.QueryStringQuery(a.query||"*")}},this.findQuery=function(a){return b.findWhere(h.list,{query:a})},this.idsByMode=function(a){switch(a.mode){case"all":return h.ids;case"pinned":return b.pluck(b.where(h.list,{pin:!0}),"id");case"unpinned":return b.difference(h.ids,b.pluck(b.where(h.list,{pin:!0}),"id"));case"selected":return b.intersection(h.ids,a.ids);default:return h.ids}};var i=function(){return g.idQueue.length>0?g.idQueue.shift():h.ids.length},j=function(a){return h.colors[a%h.colors.length]};h.init()}])}),define("services/timer",["angular","underscore"],function(a,b){var c=a.module("kibana.services");c.service("timer",["$timeout",function(a){var c=[];this.register=function(a){return c.push(a),a},this.cancel=function(d){c=b.without(c,d),a.cancel(d)},this.cancel_all=function(){b.each(c,function(b){a.cancel(b)}),c=[]}}])}),define("services/all",["./alertSrv","./dashboard","./fields","./filterSrv","./kbnIndex","./querySrv","./timer"],function(){}),define("controllers/dash",["angular","config","underscore","services/all"],function(a,b,c){var d=a.module("kibana.controllers");d.controller("DashCtrl",["$scope","$route","ejsResource","fields","dashboard","alertSrv",function(a,d,e,f,g,h){a.editor={index:0},a.init=function(){a.config=b,a._=c,a.dashboard=g,a.dashAlerts=h,h.clearAll(),a.fields=f,a.reset_row(),a.ejs=e(b.elasticsearch)},a.add_row=function(a,b){a.rows.push(b)},a.reset_row=function(){a.row={title:"",height:"150px",editable:!0}},a.row_style=function(a){return{"min-height":a.collapse?"5px":a.height}},a.edit_path=function(a){return a?"app/panels/"+a+"/editor.html":!1},a.setEditorTabs=function(b){return a.editorTabs=["General","Panel"],c.isUndefined(b.editorTabs)||(a.editorTabs=c.union(a.editorTabs,c.pluck(b.editorTabs,"title"))),a.editorTabs},a.parse_error=function(a){var b=a.match("nested: (.*?);");return c.isNull(b)?a:b[1]},a.init()}])}),define("controllers/dashLoader",["angular","underscore"],function(a,b){var c=a.module("kibana.controllers");c.controller("dashLoader",["$scope","$http","timer","dashboard","alertSrv",function(a,c,d,e,f){a.loader=e.current.loader,a.init=function(){a.gist_pattern=/(^\d{5,}$)|(^[a-z0-9]{10,}$)|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/,a.gist=a.gist||{},a.elasticsearch=a.elasticsearch||{}},a.showDropdown=function(b){var c=a.loader;return"load"===b?c.load_elasticsearch||c.load_gist||c.load_local:"save"===b?c.save_elasticsearch||c.save_gist||c.local_local||c.save_default:"share"===b?c.save_temp:!1},a.set_default=function(){e.set_default()?f.set("Local Default Set",e.current.title+" has been set as your local default","success",5e3):f.set("Incompatible Browser","Sorry, your browser is too old for this feature","error",5e3)},a.purge_default=function(){e.purge_default()?f.set("Local Default Clear","Your local default dashboard has been cleared","success",5e3):f.set("Incompatible Browser","Sorry, your browser is too old for this feature","error",5e3)},a.elasticsearch_save=function(c,d){e.elasticsearch_save(c,a.elasticsearch.title||e.current.title,a.loader.save_temp_ttl_enable?d:!1).then(function(d){b.isUndefined(d._id)?f.set("Save failed","Dashboard could not be saved to Elasticsearch","error",5e3):(f.set("Dashboard Saved",'This dashboard has been saved to Elasticsearch as "'+d._id+'"',"success",5e3),"temp"===c&&(a.share=e.share_link(e.current.title,"temp",d._id)))})},a.elasticsearch_delete=function(c){e.elasticsearch_delete(c).then(function(d){if(b.isUndefined(d))f.set("Dashboard Not Deleted","An error occurred deleting the dashboard","error",5e3);else if(d.found){f.set("Dashboard Deleted",c+" has been deleted","success",5e3);var e=b.where(a.elasticsearch.dashboards,{_id:c})[0];a.elasticsearch.dashboards=b.without(a.elasticsearch.dashboards,e)}else f.set("Dashboard Not Found","Could not find "+c+" in Elasticsearch","warning",5e3)})},a.elasticsearch_dblist=function(c){e.elasticsearch_list(c,a.loader.load_elasticsearch_size).then(function(c){b.isUndefined(c.hits)||(a.hits=c.hits.total,a.elasticsearch.dashboards=c.hits.hits)})},a.save_gist=function(){e.save_gist(a.gist.title).then(function(c){b.isUndefined(c)?f.set("Save failed","Gist could not be saved","error",5e3):(a.gist.last=c,f.set("Gist saved",'You will be able to access your exported dashboard file at '+c+" in a moment","success"))})},a.gist_dblist=function(b){e.gist_list(b).then(function(b){b&&b.length>0?a.gist.files=b:f.set("Gist Failed","Could not retrieve dashboard list from gist","error",5e3)})}}])}),define("controllers/row",["angular","app","underscore"],function(a,b,c){var d=a.module("kibana.controllers");d.controller("RowCtrl",["$scope","$rootScope","$timeout","ejsResource","querySrv",function(a,b,d,e,f){var g={title:"Row",height:"150px",collapse:!1,collapsable:!0,editable:!0,panels:[]};c.defaults(a.row,g),a.init=function(){a.querySrv=f,a.reset_panel()},a.toggle_row=function(b){b.collapsable&&(b.collapse=b.collapse?!1:!0,b.collapse||d(function(){a.$broadcast("render")}))},a.close_edit=function(){a.$broadcast("render")},a.add_panel=function(b,c){a.row.panels.push(c)},a.reset_panel=function(b){a.panel={error:!1,span:3,editable:!0,type:b}},a.init()}])}),define("controllers/all",["./dash","./dashLoader","./row"],function(){}),define("directives/addPanel",["angular","app","underscore"],function(a,b,c){a.module("kibana.directives").directive("addPanel",["$compile",function(b){return{restrict:"A",link:function(d,e){d.$watch("panel.type",function(){var f=d.panel.type;d.reset_panel(f),c.isUndefined(d.panel.type)||(d.panel.loadingEditor=!0,d.require(["panels/"+d.panel.type+"/module"],function(){var c='
';e.html(b(a.element(c))(d)),d.panel.loadingEditor=!1}))})}}}])}),define("directives/arrayJoin",["angular","app","underscore"],function(a,b,c){a.module("kibana.directives").directive("arrayJoin",function(){return{restrict:"A",require:"ngModel",link:function(a,b,d,e){function f(a){return(a||"").split(",")}function g(a){return c.isArray(a)?(a||"").join(","):a}e.$parsers.push(f),e.$formatters.push(g)}}})}),define("directives/dashUpload",["angular"],function(a){var b=a.module("kibana.directives");b.directive("dashUpload",["timer","dashboard","alertSrv",function(a,b,c){return{restrict:"A",link:function(a){function d(c){for(var d,e=c.target.files,f=function(){return function(c){b.dash_load(JSON.parse(c.target.result)),a.$apply()}},g=0;d=e[g];g++){var h=new FileReader;h.onload=f(d),h.readAsText(d)}}window.File&&window.FileReader&&window.FileList&&window.Blob?document.getElementById("dashupload").addEventListener("change",d,!1):c.set("Oops","Sorry, the HTML5 File APIs are not fully supported in this browser.","error")}}}])}),define("directives/kibanaPanel",["angular"],function(a){a.module("kibana.directives").directive("kibanaPanel",["$compile",function(a){var b='{{panel.title}} ';return{restrict:"E",link:function(c,d,e){function f(b){b.appendTo(d),a(d.contents())(c),d.removeClass("ng-cloak")}c.$watch(e.type,function(a){d.addClass("ng-cloak"),c.require(["jquery","text!panels/"+a+"/module.html"],function(d,e){var g=d(e),h=g.filter("ngcontroller, [ng-controller], .ng-controller");h=h.add(g.find("ngcontroller, [ng-controller], .ng-controller")),h.length?(h.first().prepend(b),c.require(["panels/"+a+"/module"],function(){f(g)})):f(g)})})}}}])}),define("directives/ngBlur",["angular"],function(a){a.module("kibana.directives").directive("ngBlur",["$parse",function(a){return function(b,c,d){var e=a(d.ngBlur);c.bind("blur",function(a){b.$apply(function(){e(b,{$event:a})})})}}])}),define("directives/ngModelOnBlur",["angular"],function(a){a.module("kibana.directives").directive("ngModelOnblur",function(){return{restrict:"A",require:"ngModel",link:function(a,b,c,d){"radio"!==c.type&&"checkbox"!==c.type&&(b.unbind("input").unbind("keydown").unbind("change"),b.bind("blur",function(){a.$apply(function(){d.$setViewValue(b.val())})}))}}})}),define("directives/tip",["angular","kbn"],function(a,b){a.module("kibana.directives").directive("tip",["$compile",function(c){return{restrict:"E",link:function(d,e,f){var g=' ";e.replaceWith(c(a.element(g))(d))}}}])}),define("directives/all",["./addPanel","./arrayJoin","./dashUpload","./kibanaPanel","./ngBlur","./ngModelOnBlur","./tip"],function(){}),define("filters/all",["angular","jquery","underscore"],function(a,b,c){var d=a.module("kibana.filters");d.filter("stringSort",function(){return function(a){return a.sort()}}),d.filter("pinnedQuery",["querySrv",function(a){return function(b,d){var e=c.filter(a.ids,function(b){var e=a.list[b];return c.isUndefined(e.pin)||e.pin!==!0||d!==!0?!c.isUndefined(e.pin)&&e.pin!==!1||d!==!1?void 0:!0:!0});return e}}]),d.filter("slice",function(){return function(a,b,d){return c.isUndefined(a)?void 0:a.slice(b,d)}}),d.filter("stringify",function(){return function(b){return c.isObject(b)&&!c.isArray(b)?a.toJson(b):b.toString()}}),d.filter("noXml",function(){var a=function(a){return c.isString(a)?a.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,"""):a};return function(b){return c.isArray(b)?c.map(b,a):a(b)}}),d.filter("urlLink",function(){var a=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,b=/(^|[^\/])(www\.[\S]+(\b|$))/gim,d=/(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim,e=function(e){var f,g,h;return c.isString(e)?(c.each(e.match(a),function(){f=e.replace(a,'$1 ')}),e=f||e,c.each(e.match(b),function(){g=e.replace(b,'$1$2 ')}),e=g||e,c.each(e.match(d),function(){h=e.replace(d,'$1 ')}),e=h||e):e};return function(a){return c.isArray(a)?c.map(a,e):e(a)}}),d.filter("gistid",function(){var a=/(\d{5,})|([a-z0-9]{10,})|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/;return function(b){if(!c.isUndefined(b)){var d=b.match(a);if(!c.isNull(d)&&!c.isUndefined(d))return d[0].replace(/.*\//,"")}}})}),define("app",["angular","jquery","underscore","require","elasticjs","bootstrap","angular-sanitize","angular-strap","extend-jquery"],function(a,b,c,d){var e=a.module("kibana",[]),f=[],g={};e.useModule=function(a){return f?f.push(a):c.extend(a,g),a},e.safeApply=function(a,b){switch(a.$$phase){case"$apply":a.$eval(b);break;case"$digest":setTimeout(function(){e.safeApply(a,b)},10);break;default:a.$apply(b)}},e.config(["$routeProvider","$controllerProvider","$compileProvider","$filterProvider","$provide",function(a,b,c,d,e){a.when("/dashboard",{templateUrl:"app/partials/dashboard.html"}).when("/dashboard/:kbnType/:kbnId",{templateUrl:"app/partials/dashboard.html"}).when("/dashboard/:kbnType/:kbnId/:params",{templateUrl:"app/partials/dashboard.html"}).otherwise({redirectTo:"dashboard"}),g.controller=b.register,g.directive=c.directive,g.factory=e.factory,g.service=e.service,g.filter=d.register}]);var h=["elasticjs.service","$strap.directives","ngSanitize","kibana"];return c.each("controllers directives factories services filters".split(" "),function(b){var c="kibana."+b;e.useModule(a.module(c,[])),h.push(c)}),e.panel_helpers={partial:function(a){return"app/partials/"+a+".html"}},require(["controllers/all","directives/all","filters/all"],function(){a.element(document).ready(function(){b("body").attr("ng-controller","DashCtrl"),a.bootstrap(document,h).invoke(["$rootScope",function(a){c.each(f,function(a){c.extend(a,g)}),f=!1,a.requireContext=d,a.require=function(a,b){var d=this;d.requireContext(a,function(){var a=c.toArray(arguments);d.$apply(function(){b.apply(d,a)})})}}])})}),e}),function(a){a.color={},a.color.make=function(b,c,d,e){var f={};return f.r=b||0,f.g=c||0,f.b=d||0,f.a=null!=e?e:1,f.add=function(a,b){for(var c=0;c=1?"rgb("+[f.r,f.g,f.b].join(",")+")":"rgba("+[f.r,f.g,f.b,f.a].join(",")+")"},f.normalize=function(){function a(a,b,c){return a>b?a:b>c?c:b}return f.r=a(0,parseInt(f.r),255),f.g=a(0,parseInt(f.g),255),f.b=a(0,parseInt(f.b),255),f.a=a(0,f.a,1),f},f.clone=function(){return a.color.make(f.r,f.b,f.g,f.a)},f.normalize()},a.color.extract=function(b,c){var d;do{if(d=b.css(c).toLowerCase(),""!=d&&"transparent"!=d)break;b=b.parent()}while(!a.nodeName(b.get(0),"body"));return"rgba(0, 0, 0, 0)"==d&&(d="transparent"),a.color.parse(d)},a.color.parse=function(c){var d,e=a.color.make;if(d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return e(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10));if(d=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c))return e(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10),parseFloat(d[4]));if(d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return e(2.55*parseFloat(d[1]),2.55*parseFloat(d[2]),2.55*parseFloat(d[3]));if(d=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c))return e(2.55*parseFloat(d[1]),2.55*parseFloat(d[2]),2.55*parseFloat(d[3]),parseFloat(d[4]));if(d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return e(parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16));if(d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return e(parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16));var f=a.trim(c).toLowerCase();return"transparent"==f?e(255,255,255,0):(d=b[f]||[0,0,0],e(d[0],d[1],d[2]))};var b={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(a){function b(b,c){var d=c.children("."+b)[0];if(null==d&&(d=document.createElement("canvas"),d.className=b,a(d).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(c),!d.getContext)){if(!window.G_vmlCanvasManager)throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");d=window.G_vmlCanvasManager.initElement(d)}this.element=d;var e=this.context=d.getContext("2d"),f=window.devicePixelRatio||1,g=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;this.pixelRatio=f/g,this.resize(c.width(),c.height()),this.textContainer=null,this.text={},this._textCache={}}function c(c,e,f,g){function h(a,b){b=[qb].concat(b);for(var c=0;cd;++d)e=eb.xaxes[d],e&&!e.tickColor&&(e.tickColor=e.color),e=a.extend(!0,{},eb.xaxis,e),eb.xaxes[d]=e,e.font&&(e.font=a.extend({},g,e.font),e.font.color||(e.font.color=e.color));for(f=eb.yaxes.length||1,d=0;f>d;++d)e=eb.yaxes[d],e&&!e.tickColor&&(e.tickColor=e.color),e=a.extend(!0,{},eb.yaxis,e),eb.yaxes[d]=e,e.font&&(e.font=a.extend({},g,e.font),e.font.color||(e.font.color=e.color));for(eb.xaxis.noTicks&&null==eb.xaxis.ticks&&(eb.xaxis.ticks=eb.xaxis.noTicks),eb.yaxis.noTicks&&null==eb.yaxis.ticks&&(eb.yaxis.ticks=eb.yaxis.noTicks),eb.x2axis&&(eb.xaxes[1]=a.extend(!0,{},eb.xaxis,eb.x2axis),eb.xaxes[1].position="top"),eb.y2axis&&(eb.yaxes[1]=a.extend(!0,{},eb.yaxis,eb.y2axis),eb.yaxes[1].position="right"),eb.grid.coloredAreas&&(eb.grid.markings=eb.grid.coloredAreas),eb.grid.coloredAreasColor&&(eb.grid.markingsColor=eb.grid.coloredAreasColor),eb.lines&&a.extend(!0,eb.series.lines,eb.lines),eb.points&&a.extend(!0,eb.series.points,eb.points),eb.bars&&a.extend(!0,eb.series.bars,eb.bars),null!=eb.shadowSize&&(eb.series.shadowSize=eb.shadowSize),null!=eb.highlightColor&&(eb.series.highlightColor=eb.highlightColor),d=0;dd&&(d=e))}d>=c&&(c=d+1);var f,g=[],h=eb.colors,i=h.length,j=0;for(b=0;c>b;b++)f=a.color.parse(h[b%i]||"#666"),0==b%i&&b&&(j=j>=0?.5>j?-j-.2:0:-j),g[b]=f.scale("rgb",1+j);var k,l=0;for(b=0;ba.datamax&&c!=s&&(a.datamax=c)}var c,d,e,f,g,i,j,k,l,m,o,p,q=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=Number.MAX_VALUE;for(a.each(n(),function(a,b){b.datamin=q,b.datamax=r,b.used=!1}),c=0;cf;++f)k=m[f],l=p[f],l&&(l.number&&null!=k&&(k=+k,isNaN(k)?k=null:1/0==k?k=s:k==-1/0&&(k=-s)),null==k&&(l.required&&(v=!0),null!=l.defaultValue&&(k=l.defaultValue))),i[e+f]=k;if(v)for(f=0;j>f;++f)k=i[e+f],null!=k&&(l=p[f],l.autoscale&&(l.x&&b(g.xaxis,k,k),l.y&&b(g.yaxis,k,k))),i[e+f]=null;else if(u&&e>0&&null!=i[e-j]&&i[e-j]!=i[e]&&i[e-j+1]!=i[e+1]){for(f=0;j>f;++f)i[e+j+f]=i[e+f];i[e+1]=i[e-j+1],e+=j}}}}for(c=0;cf;++f)k=i[d+f],l=p[f],l&&l.autoscale!==!1&&k!=s&&k!=-s&&(l.x&&(w>k&&(w=k),k>y&&(y=k)),l.y&&(x>k&&(x=k),k>z&&(z=k)));if(g.bars.show){var A;switch(g.bars.align){case"left":A=0;break;case"right":A=-g.bars.barWidth;break;case"center":A=-g.bars.barWidth/2;break;default:throw new Error("Invalid bar alignment: "+g.bars.align)}g.bars.horizontal?(x+=A,z+=A+g.bars.barWidth):(w+=A,y+=A+g.bars.barWidth)}b(g.xaxis,w,y),b(g.yaxis,x,z)}a.each(n(),function(a,b){b.datamin==q&&(b.datamin=null),b.datamax==r&&(b.datamax=null)})}function t(){c.css("padding",0).children(":not(.flot-base,.flot-overlay)").remove(),"static"==c.css("position")&&c.css("position","relative"),fb=new b("flot-base",c),gb=new b("flot-overlay",c),ib=fb.context,jb=gb.context,hb=a(gb.element).unbind();var d=c.data("plot");d&&(d.shutdown(),gb.clear()),c.data("plot",qb)}function u(){eb.grid.hoverable&&(hb.mousemove(T),hb.bind("mouseleave",U)),eb.grid.clickable&&hb.click(V),h(pb.bindEvents,[hb])}function v(){sb&&clearTimeout(sb),hb.unbind("mousemove",T),hb.unbind("mouseleave",U),hb.unbind("click",V),h(pb.shutdown,[hb])}function w(a){function b(a){return a}var c,d,e=a.options.transform||b,f=a.options.inverseTransform;"x"==a.direction?(c=a.scale=nb/Math.abs(e(a.max)-e(a.min)),d=Math.min(e(a.max),e(a.min))):(c=a.scale=ob/Math.abs(e(a.max)-e(a.min)),c=-c,d=Math.max(e(a.max),e(a.min))),a.p2c=e==b?function(a){return(a-d)*c}:function(a){return(e(a)-d)*c},a.c2p=f?function(a){return f(d+a/c)}:function(a){return d+a/c}}function x(a){var b=a.options,c=a.ticks||[],d=b.labelWidth||0,e=b.labelHeight||0,f=d||"x"==a.direction?Math.floor(fb.width/(c.length||1)):null;legacyStyles=a.direction+"Axis "+a.direction+a.n+"Axis",layer="flot-"+a.direction+"-axis flot-"+a.direction+a.n+"-axis "+legacyStyles,font=b.font||"flot-tick-label tickLabel";for(var g=0;g=0;--b)y(g[b]);A(),a.each(g,function(a,b){z(b)})}nb=fb.width-mb.left-mb.right,ob=fb.height-mb.bottom-mb.top,a.each(c,function(a,b){w(b)}),d&&K(),R()}function C(a){var b=a.options,c=+(null!=b.min?b.min:a.datamin),d=+(null!=b.max?b.max:a.datamax),e=d-c;if(0==e){var f=0==d?1:.01;null==b.min&&(c-=f),(null==b.max||null!=b.min)&&(d+=f)}else{var g=b.autoscaleMargin;null!=g&&(null==b.min&&(c-=e*g,0>c&&null!=a.datamin&&a.datamin>=0&&(c=0)),null==b.max&&(d+=e*g,d>0&&null!=a.datamax&&a.datamax<=0&&(d=0)))}a.min=c,a.max=d}function D(b){var c,e=b.options;c="number"==typeof e.ticks&&e.ticks>0?e.ticks:.3*Math.sqrt("x"==b.direction?fb.width:fb.height);var f=(b.max-b.min)/c,g=-Math.floor(Math.log(f)/Math.LN10),h=e.tickDecimals;null!=h&&g>h&&(g=h);var i,j=Math.pow(10,-g),k=f/j;if(1.5>k?i=1:3>k?(i=2,k>2.25&&(null==h||h>=g+1)&&(i=2.5,++g)):i=7.5>k?5:10,i*=j,null!=e.minTickSize&&i0&&(null==e.min&&(b.min=Math.min(b.min,m[0])),null==e.max&&m.length>1&&(b.max=Math.max(b.max,m[m.length-1]))),b.tickGenerator=function(a){var b,c,d=[];for(c=0;c1&&/\..*0$/.test((o[1]-o[0]).toFixed(n))||(b.tickDecimals=n)}}}}function E(b){var c=b.options.ticks,d=[];null==c||"number"==typeof c&&c>0?d=b.tickGenerator(b):c&&(d=a.isFunction(c)?c(b):c);var e,f;for(b.ticks=[],e=0;e1&&(g=h[1])):f=+h,null==g&&(g=b.tickFormatter(f,b)),isNaN(f)||b.ticks.push({v:f,label:g})}}function F(a,b){a.options.autoscaleMargin&&b.length>0&&(null==a.options.min&&(a.min=Math.min(a.min,b[0].v)),null==a.options.max&&b.length>1&&(a.max=Math.max(a.max,b[b.length-1].v)))}function G(){fb.clear(),h(pb.drawBackground,[ib]);var a=eb.grid;a.show&&a.backgroundColor&&I(),a.show&&!a.aboveData&&J();for(var b=0;be){var i=d;d=e,e=i}return{from:d,to:e,axis:c}}function I(){ib.save(),ib.translate(mb.left,mb.top),ib.fillStyle=cb(eb.grid.backgroundColor,ob,0,"rgba(255, 255, 255, 0)"),ib.fillRect(0,0,nb,ob),ib.restore()}function J(){var b,c,d,e;ib.save(),ib.translate(mb.left,mb.top);var f=eb.grid.markings;if(f)for(a.isFunction(f)&&(c=qb.getAxes(),c.xmin=c.xaxis.min,c.xmax=c.xaxis.max,c.ymin=c.yaxis.min,c.ymax=c.yaxis.max,f=f(c)),b=0;bh.axis.max||i.toi.axis.max||(h.from=Math.max(h.from,h.axis.min),h.to=Math.min(h.to,h.axis.max),i.from=Math.max(i.from,i.axis.min),i.to=Math.min(i.to,i.axis.max),(h.from!=h.to||i.from!=i.to)&&(h.from=h.axis.p2c(h.from),h.to=h.axis.p2c(h.to),i.from=i.axis.p2c(i.from),i.to=i.axis.p2c(i.to),h.from==h.to||i.from==i.to?(ib.beginPath(),ib.strokeStyle=g.color||eb.grid.markingsColor,ib.lineWidth=g.lineWidth||eb.grid.markingsLineWidth,ib.moveTo(h.from,i.from),ib.lineTo(h.to,i.to),ib.stroke()):(ib.fillStyle=g.color||eb.grid.markingsColor,ib.fillRect(h.from,i.to,h.to-h.from,i.from-i.to))))}c=n(),d=eb.grid.borderWidth;for(var j=0;jp.max||"full"==r&&("object"==typeof d&&d[p.position]>0||d>0)&&(s==p.min||s==p.max)||("x"==p.direction?(k=p.p2c(s),o="full"==r?-ob:r,"top"==p.position&&(o=-o)):(l=p.p2c(s),m="full"==r?-nb:r,"left"==p.position&&(m=-m)),1==ib.lineWidth&&("x"==p.direction?k=Math.floor(k)+.5:l=Math.floor(l)+.5),ib.moveTo(k,l),ib.lineTo(k+m,l+o))}ib.stroke()}}d&&(e=eb.grid.borderColor,"object"==typeof d||"object"==typeof e?("object"!=typeof d&&(d={top:d,right:d,bottom:d,left:d}),"object"!=typeof e&&(e={top:e,right:e,bottom:e,left:e}),d.top>0&&(ib.strokeStyle=e.top,ib.lineWidth=d.top,ib.beginPath(),ib.moveTo(0-d.left,0-d.top/2),ib.lineTo(nb,0-d.top/2),ib.stroke()),d.right>0&&(ib.strokeStyle=e.right,ib.lineWidth=d.right,ib.beginPath(),ib.moveTo(nb+d.right/2,0-d.top),ib.lineTo(nb+d.right/2,ob),ib.stroke()),d.bottom>0&&(ib.strokeStyle=e.bottom,ib.lineWidth=d.bottom,ib.beginPath(),ib.moveTo(nb+d.right,ob+d.bottom/2),ib.lineTo(0,ob+d.bottom/2),ib.stroke()),d.left>0&&(ib.strokeStyle=e.left,ib.lineWidth=d.left,ib.beginPath(),ib.moveTo(0-d.left/2,ob+d.bottom),ib.lineTo(0-d.left/2,0),ib.stroke())):(ib.lineWidth=d,ib.strokeStyle=eb.grid.borderColor,ib.strokeRect(-d/2,-d/2,nb+d,ob+d))),ib.restore()}function K(){a.each(n(),function(a,b){if(b.show&&0!=b.ticks.length){var c,d,e,f,g,h=b.box,i=b.direction+"Axis "+b.direction+b.n+"Axis",j="flot-"+b.direction+"-axis flot-"+b.direction+b.n+"-axis "+i,k=b.options.font||"flot-tick-label tickLabel";fb.removeText(j);for(var l=0;lb.max||("x"==b.direction?(f="center",d=mb.left+b.p2c(c.v),"bottom"==b.position?e=h.top+h.padding:(e=h.top+h.height-h.padding,g="bottom")):(g="middle",e=mb.top+b.p2c(c.v),"left"==b.position?(d=h.left+h.width-h.padding,f="right"):d=h.left+h.padding),fb.addText(j,d,e,c.label,k,null,null,f,g))}})}function L(a){a.lines.show&&M(a),a.bars.show&&P(a),a.points.show&&N(a)}function M(a){function b(a,b,c,d,e){var f=a.points,g=a.pointsize,h=null,i=null;ib.beginPath();for(var j=g;j=l&&l=n&&n=n&&l>e.max){if(n>e.max)continue;k=(e.max-l)/(n-l)*(m-k)+k,l=e.max}else if(n>=l&&n>e.max){if(l>e.max)continue;m=(e.max-l)/(n-l)*(m-k)+k,n=e.max}if(m>=k&&k=m&&m=m&&k>d.max){if(m>d.max)continue;l=(d.max-k)/(m-k)*(n-l)+l,k=d.max}else if(m>=k&&m>d.max){if(k>d.max)continue;n=(d.max-k)/(m-k)*(n-l)+l,m=d.max}(k!=h||l!=i)&&ib.moveTo(d.p2c(k)+b,e.p2c(l)+c),h=m,i=n,ib.lineTo(d.p2c(m)+b,e.p2c(n)+c)}}ib.stroke()}function c(a,b,c){for(var d=a.points,e=a.pointsize,f=Math.min(Math.max(0,c.min),c.max),g=0,h=!1,i=1,j=0,k=0;;){if(e>0&&g>d.length+e)break;g+=e;var l=d[g-e],m=d[g-e+i],n=d[g],o=d[g+i];if(h){if(e>0&&null!=l&&null==n){k=g,e=-e,i=2;continue}if(0>e&&g==j+e){ib.fill(),h=!1,e=-e,i=1,g=j=k+e;continue}}if(null!=l&&null!=n){if(n>=l&&l=n&&n=n&&l>b.max){if(n>b.max)continue;m=(b.max-l)/(n-l)*(o-m)+m,l=b.max}else if(n>=l&&n>b.max){if(l>b.max)continue;o=(b.max-l)/(n-l)*(o-m)+m,n=b.max}if(h||(ib.beginPath(),ib.moveTo(b.p2c(l),c.p2c(f)),h=!0),m>=c.max&&o>=c.max)ib.lineTo(b.p2c(l),c.p2c(c.max)),ib.lineTo(b.p2c(n),c.p2c(c.max));else if(m<=c.min&&o<=c.min)ib.lineTo(b.p2c(l),c.p2c(c.min)),ib.lineTo(b.p2c(n),c.p2c(c.min));else{var p=l,q=n;o>=m&&m=c.min?(l=(c.min-m)/(o-m)*(n-l)+l,m=c.min):m>=o&&o=c.min&&(n=(c.min-m)/(o-m)*(n-l)+l,o=c.min),m>=o&&m>c.max&&o<=c.max?(l=(c.max-m)/(o-m)*(n-l)+l,m=c.max):o>=m&&o>c.max&&m<=c.max&&(n=(c.max-m)/(o-m)*(n-l)+l,o=c.max),l!=p&&ib.lineTo(b.p2c(p),c.p2c(m)),ib.lineTo(b.p2c(l),c.p2c(m)),ib.lineTo(b.p2c(n),c.p2c(o)),n!=q&&(ib.lineTo(b.p2c(n),c.p2c(o)),ib.lineTo(b.p2c(q),c.p2c(o)))}}}}ib.save(),ib.translate(mb.left,mb.top),ib.lineJoin="round";var d=a.lines.lineWidth,e=a.shadowSize;if(d>0&&e>0){ib.lineWidth=e,ib.strokeStyle="rgba(0,0,0,0.1)";var f=Math.PI/18;b(a.datapoints,Math.sin(f)*(d/2+e/2),Math.cos(f)*(d/2+e/2),a.xaxis,a.yaxis),ib.lineWidth=e/2,b(a.datapoints,Math.sin(f)*(d/2+e/4),Math.cos(f)*(d/2+e/4),a.xaxis,a.yaxis)}ib.lineWidth=d,ib.strokeStyle=a.color;var g=Q(a.lines,a.color,0,ob);g&&(ib.fillStyle=g,c(a.datapoints,a.xaxis,a.yaxis)),d>0&&b(a.datapoints,0,0,a.xaxis,a.yaxis),ib.restore()}function N(a){function b(a,b,c,d,e,f,g,h){for(var i=a.points,j=a.pointsize,k=0;kf.max||mg.max||(ib.beginPath(),l=f.p2c(l),m=g.p2c(m)+d,"circle"==h?ib.arc(l,m,b,0,e?Math.PI:2*Math.PI,!1):h(ib,l,m,b,e),ib.closePath(),c&&(ib.fillStyle=c,ib.fill()),ib.stroke())}}ib.save(),ib.translate(mb.left,mb.top);var c=a.points.lineWidth,d=a.shadowSize,e=a.points.radius,f=a.points.symbol;if(0==c&&(c=1e-4),c>0&&d>0){var g=d/2;ib.lineWidth=g,ib.strokeStyle="rgba(0,0,0,0.1)",b(a.datapoints,e,null,g+g/2,!0,a.xaxis,a.yaxis,f),ib.strokeStyle="rgba(0,0,0,0.2)",b(a.datapoints,e,null,g/2,!0,a.xaxis,a.yaxis,f)}ib.lineWidth=c,ib.strokeStyle=a.color,b(a.datapoints,e,Q(a.points,a.color),0,!1,a.xaxis,a.yaxis,f),ib.restore()}function O(a,b,c,d,e,f,g,h,i,j,k,l){var m,n,o,p,q,r,s,t,u;k?(t=r=s=!0,q=!1,m=c,n=a,p=b+d,o=b+e,m>n&&(u=n,n=m,m=u,q=!0,r=!1)):(q=r=s=!0,t=!1,m=a+d,n=a+e,o=c,p=b,o>p&&(u=p,p=o,o=u,t=!0,s=!1)),nh.max||pi.max||(mh.max&&(n=h.max,r=!1),oi.max&&(p=i.max,s=!1),m=h.p2c(m),o=i.p2c(o),n=h.p2c(n),p=i.p2c(p),g&&(j.beginPath(),j.moveTo(m,o),j.lineTo(m,p),j.lineTo(n,p),j.lineTo(n,o),j.fillStyle=g(o,p),j.fill()),l>0&&(q||r||s||t)&&(j.beginPath(),j.moveTo(m,o+f),q?j.lineTo(m,p+f):j.moveTo(m,p+f),s?j.lineTo(n,p+f):j.moveTo(n,p+f),r?j.lineTo(n,o+f):j.moveTo(n,o+f),t?j.lineTo(m,o+f):j.moveTo(m,o+f),j.stroke()))}function P(a){function b(b,c,d,e,f,g,h){for(var i=b.points,j=b.pointsize,k=0;k"),e.push(""),g=!0),e.push(' '+''+k.label+" ")}if(g&&e.push(" "),0!=e.length){var l='";if(null!=eb.legend.container)a(eb.legend.container).html(l);else{var m="",n=eb.legend.position,o=eb.legend.margin;null==o[0]&&(o=[o,o]),"n"==n.charAt(0)?m+="top:"+(o[1]+mb.top)+"px;":"s"==n.charAt(0)&&(m+="bottom:"+(o[1]+mb.bottom)+"px;"),"e"==n.charAt(1)?m+="right:"+(o[0]+mb.right)+"px;":"w"==n.charAt(1)&&(m+="left:"+(o[0]+mb.left)+"px;");var p=a(''+l.replace('style="','style="position:absolute;'+m+";")+"
").appendTo(c);if(0!=eb.legend.backgroundOpacity){var q=eb.legend.backgroundColor;null==q&&(q=eb.grid.backgroundColor,q=q&&"string"==typeof q?a.color.parse(q):a.color.extract(p,"background-color"),q.a=1,q=q.toString());var r=p.children();a('
').prependTo(p).css("opacity",eb.legend.backgroundOpacity)}}}}}function S(a,b,c){var d,e,f,g=eb.grid.mouseActiveRadius,h=g*g+1,i=null;for(d=db.length-1;d>=0;--d)if(c(db[d])){var j=db[d],k=j.xaxis,l=j.yaxis,m=j.datapoints.points,n=k.c2p(a),o=l.c2p(b),p=g/k.scale,q=g/l.scale;if(f=j.datapoints.pointsize,k.options.inverseTransform&&(p=Number.MAX_VALUE),l.options.inverseTransform&&(q=Number.MAX_VALUE),j.lines.show||j.points.show)for(e=0;ep||-p>r-n||s-o>q||-q>s-o)){var t=Math.abs(k.p2c(r)-a),u=Math.abs(l.p2c(s)-b),v=t*t+u*u;h>v&&(h=v,i=[d,e/f])}}if(j.bars.show&&!i){var w="left"==j.bars.align?0:-j.bars.barWidth/2,x=w+j.bars.barWidth;for(e=0;e=Math.min(y,r)&&o>=s+w&&s+x>=o:n>=r+w&&r+x>=n&&o>=Math.min(y,s)&&o<=Math.max(y,s))&&(i=[d,e/f])}}}return i?(d=i[0],e=i[1],f=db[d].datapoints.pointsize,{datapoint:db[d].datapoints.points.slice(e*f,(e+1)*f),dataIndex:e,series:db[d],seriesIndex:d}):null}function T(a){eb.grid.hoverable&&W("plothover",a,function(a){return 0!=a.hoverable})}function U(a){eb.grid.hoverable&&W("plothover",a,function(){return!1})}function V(a){W("plotclick",a,function(a){return 0!=a.clickable})}function W(a,b,d){var e=hb.offset(),f=b.pageX-e.left-mb.left,g=b.pageY-e.top-mb.top,h=o({left:f,top:g});h.pageX=b.pageX,h.pageY=b.pageY;var i=S(f,g,d);if(i&&(i.pageX=parseInt(i.series.xaxis.p2c(i.datapoint[0])+e.left+mb.left,10),i.pageY=parseInt(i.series.yaxis.p2c(i.datapoint[1])+e.top+mb.top,10)),eb.grid.autoHighlight){for(var j=0;jf.max||eg.max)){var i=b.points.radius+b.points.lineWidth/2;jb.lineWidth=i,jb.strokeStyle=h;var j=1.5*i;d=f.p2c(d),e=g.p2c(e),jb.beginPath(),"circle"==b.points.symbol?jb.arc(d,e,j,0,2*Math.PI,!1):b.points.symbol(jb,d,e,j,!1),jb.closePath(),jb.stroke()}}function bb(b,c){var d="string"==typeof b.highlightColor?b.highlightColor:a.color.parse(b.color).scale("a",.5).toString(),e=d,f="left"==b.bars.align?0:-b.bars.barWidth/2;jb.lineWidth=b.bars.lineWidth,jb.strokeStyle=d,O(c[0],c[1],c[2]||0,f,f+b.bars.barWidth,0,function(){return e},b.xaxis,b.yaxis,jb,b.bars.horizontal,b.bars.lineWidth)}function cb(b,c,d,e){if("string"==typeof b)return b;for(var f=ib.createLinearGradient(0,d,0,c),g=0,h=b.colors.length;h>g;++g){var i=b.colors[g];if("string"!=typeof i){var j=a.color.parse(e);null!=i.brightness&&(j=j.scale("rgb",i.brightness)),null!=i.opacity&&(j.a*=i.opacity),i=j.toString()}f.addColorStop(g/(h-1),i)}return f}var db=[],eb={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},fb=null,gb=null,hb=null,ib=null,jb=null,kb=[],lb=[],mb={left:0,right:0,top:0,bottom:0},nb=0,ob=0,pb={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},qb=this;qb.setData=k,qb.setupGrid=B,qb.draw=G,qb.getPlaceholder=function(){return c},qb.getCanvas=function(){return fb.element},qb.getPlotOffset=function(){return mb},qb.width=function(){return nb},qb.height=function(){return ob},qb.offset=function(){var a=hb.offset();return a.left+=mb.left,a.top+=mb.top,a},qb.getData=function(){return db},qb.getAxes=function(){var b={};return a.each(kb.concat(lb),function(a,c){c&&(b[c.direction+(1!=c.n?c.n:"")+"axis"]=c)}),b},qb.getXAxes=function(){return kb},qb.getYAxes=function(){return lb},qb.c2p=o,qb.p2c=p,qb.getOptions=function(){return eb},qb.highlight=Z,qb.unhighlight=$,qb.triggerRedrawOverlay=X,qb.pointOffset=function(a){return{left:parseInt(kb[m(a,"x")-1].p2c(+a.x)+mb.left,10),top:parseInt(lb[m(a,"y")-1].p2c(+a.y)+mb.top,10)}},qb.shutdown=v,qb.resize=function(){var a=c.width(),b=c.height();fb.resize(a,b),gb.resize(a,b)},qb.hooks=pb,i(qb),j(f),t(),k(e),B(),G(),u();var rb=[],sb=null}function d(a,b){return b*Math.floor(a/b)}var e=Object.prototype.hasOwnProperty;b.prototype.resize=function(a,b){if(0>=a||0>=b)throw new Error("Invalid dimensions for plot, width = "+a+", height = "+b);var c=this.element,d=this.context,e=this.pixelRatio;this.width!=a&&(c.width=a*e,c.style.width=a+"px",this.width=a),this.height!=b&&(c.height=b*e,c.style.height=b+"px",this.height=b),d.restore(),d.save(),d.scale(e,e)},b.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},b.prototype.render=function(){var a=this._textCache;for(var b in a)if(e.call(a,b)){var c=this.getTextLayer(b),d=a[b];c.hide();for(var f in d)if(e.call(d,f)){var g=d[f];for(var h in g)if(e.call(g,h)){for(var i,j=g[h].positions,k=0;i=j[k];k++)i.active?i.rendered||(c.append(i.element),i.rendered=!0):(j.splice(k--,1),i.rendered&&i.element.detach());0==j.length&&delete g[h]}}c.show()}},b.prototype.getTextLayer=function(b){var c=this.text[b];return null==c&&(null==this.textContainer&&(this.textContainer=a("
").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),c=this.text[b]=a("
").addClass(b).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),c},b.prototype.getTextInfo=function(b,c,d,e,f){var g,h,i,j;if(c=""+c,g="object"==typeof d?d.style+" "+d.variant+" "+d.weight+" "+d.size+"px/"+d.lineHeight+"px "+d.family:d,h=this._textCache[b],null==h&&(h=this._textCache[b]={}),i=h[g],null==i&&(i=h[g]={}),j=i[c],null==j){var k=a("
").html(c).css({position:"absolute","max-width":f,top:-9999}).appendTo(this.getTextLayer(b));"object"==typeof d?k.css({font:g,color:d.color}):"string"==typeof d&&k.addClass(d),j=i[c]={width:k.outerWidth(!0),height:k.outerHeight(!0),element:k,positions:[]},k.detach()}return j},b.prototype.addText=function(a,b,c,d,e,f,g,h,i){var j=this.getTextInfo(a,d,e,f,g),k=j.positions;"center"==h?b-=j.width/2:"right"==h&&(b-=j.width),"middle"==i?c-=j.height/2:"bottom"==i&&(c-=j.height);for(var l,m=0;l=k[m];m++)if(l.x==b&&l.y==c)return l.active=!0,void 0;l={active:!0,rendered:!1,element:k.length?j.element.clone():j.element,x:b,y:c},k.push(l),l.element.css({top:Math.round(c),left:Math.round(b),"text-align":h})},b.prototype.removeText=function(a,b,c,d,f,g){if(null==d){var h=this._textCache[a];if(null!=h)for(var i in h)if(e.call(h,i)){var j=h[i];for(var k in j)if(e.call(j,k))for(var l,m=j[k].positions,n=0;l=m[n];n++)l.active=!1}}else for(var l,m=this.getTextInfo(a,d,f,g).positions,n=0;l=m[n];n++)l.x==b&&l.y==c&&(l.active=!1)},a.plot=function(b,d,e){var f=new c(a(b),d,e,a.plot.plugins);return f},a.plot.version="0.8.1",a.plot.plugins=[],a.fn.plot=function(b,c){return this.each(function(){a.plot(this,b,c)})}}(jQuery),define("jquery.flot",function(){}),function(a){function b(b){function f(b){x||(x=!0,s=b.getCanvas(),t=a(s).parent(),e=b.getOptions(),b.setData(g(b.getData())))}function g(b){for(var c=0,d=0,f=0,g=e.series.pie.combine.color,h=[],i=0;if||j/c>e.series.pie.combine.threshold)&&h.push({data:[[1,j]],color:b[i].color,label:b[i].label,angle:2*j*Math.PI/c,percent:j/(c/100)})}return f>1&&h.push({data:[[1,d]],color:g,label:e.series.pie.combine.label,angle:2*d*Math.PI/c,percent:d/(c/100)}),h}function h(b,f){function g(){y.clearRect(0,0,k,l),t.children().filter(".pieLabel, .pieLabelBackground").remove()}function h(){var a=e.series.pie.shadow.left,b=e.series.pie.shadow.top,c=10,d=e.series.pie.shadow.alpha,f=e.series.pie.radius>1?e.series.pie.radius:u*e.series.pie.radius;if(!(f>=k/2-a||f*e.series.pie.tilt>=l/2-b||c>=f)){y.save(),y.translate(a,b),y.globalAlpha=d,y.fillStyle="#000",y.translate(v,w),y.scale(1,e.series.pie.tilt);for(var g=1;c>=g;g++)y.beginPath(),y.arc(0,0,f,0,2*Math.PI,!1),y.fill(),f-=g;y.restore()}}function j(){function b(a,b,c){0>=a||isNaN(a)||(c?y.fillStyle=b:(y.strokeStyle=b,y.lineJoin="round"),y.beginPath(),Math.abs(a-2*Math.PI)>1e-9&&y.moveTo(0,0),y.arc(0,0,f,g,g+a/2,!1),y.arc(0,0,f,g+a/2,g+a,!1),y.closePath(),g+=a,c?y.fill():y.stroke())}function c(){function b(b,c,d){if(0==b.data[0][1])return!0;var g,h=e.legend.labelFormatter,i=e.series.pie.label.formatter;g=h?h(b.label,b):b.label,i&&(g=i(g,b));var j=(c+b.angle+c)/2,m=v+Math.round(Math.cos(j)*f),n=w+Math.round(Math.sin(j)*f)*e.series.pie.tilt,o=""+g+" ";t.append(o);var p=t.children("#pieLabel"+d),q=n-p.height()/2,r=m-p.width()/2;if(p.css("top",q),p.css("left",r),0-q>0||0-r>0||l-(q+p.height())<0||k-(r+p.width())<0)return!1;if(0!=e.series.pie.label.background.opacity){var s=e.series.pie.label.background.color;null==s&&(s=b.color);var u="top:"+q+"px;left:"+r+"px;";a("
").css("opacity",e.series.pie.label.background.opacity).insertBefore(p)}return!0}for(var c=d,f=e.series.pie.label.radius>1?e.series.pie.label.radius:u*e.series.pie.label.radius,g=0;g=100*e.series.pie.label.threshold&&!b(n[g],c,g))return!1;c+=n[g].angle}return!0}var d=Math.PI*e.series.pie.startAngle,f=e.series.pie.radius>1?e.series.pie.radius:u*e.series.pie.radius;y.save(),y.translate(v,w),y.scale(1,e.series.pie.tilt),y.save();for(var g=d,h=0;h0){y.save(),y.lineWidth=e.series.pie.stroke.width,g=d;for(var h=0;hv?v=u:v>k-u&&(v=k-u);var n=b.getData(),o=0;do o>0&&(u*=d),o+=1,g(),e.series.pie.tilt<=.8&&h();while(!j()&&c>o);o>=c&&(g(),t.prepend("Could not draw pie with labels contained inside canvas
")),b.setSeries&&b.insertLegend&&(b.setSeries(n),b.insertLegend())}}function i(a){if(e.series.pie.innerRadius>0){a.save();var b=e.series.pie.innerRadius>1?e.series.pie.innerRadius:u*e.series.pie.innerRadius;a.globalCompositeOperation="destination-out",a.beginPath(),a.fillStyle=e.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=e.series.pie.stroke.color,a.arc(0,0,b,0,2*Math.PI,!1),a.stroke(),a.closePath(),a.restore()}}function j(a,b){for(var c=!1,d=-1,e=a.length,f=e-1;++d1?g.series.pie.radius:u*g.series.pie.radius,i=0;i1e-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;f1?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(l),c.grid.clickable&&b.unbind("click").click(m))}),b.hooks.processDatapoints.push(function(a,b,c,d){var e=a.getOptions();e.series.pie.show&&f(a,b,c,d)}),b.hooks.drawOverlay.push(function(a,b){var c=a.getOptions();c.series.pie.show&&r(a,b)}),b.hooks.draw.push(function(a,b){var c=a.getOptions();c.series.pie.show&&h(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""+a+" "+Math.round(b.percent)+"%
"},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),define("jquery.flot.pie",function(){}),define("text",["module"],function(a){var b,c,d,e,f,g=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],h=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,i=/]*>\s*([\s\S]+)\s*<\/body>/im,j="undefined"!=typeof location&&location.href,k=j&&location.protocol&&location.protocol.replace(/\:/,""),l=j&&location.hostname,m=j&&(location.port||void 0),n={},o=a.config&&a.config()||{};return b={version:"2.0.10",strip:function(a){if(a){a=a.replace(h,"");var b=a.match(i);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:o.createXhr||function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(b=0;3>b;b+=1){c=g[b];try{a=new ActiveXObject(c)}catch(d){}if(a){g=[c];break}}return a},parseName:function(a){var b,c,d,e=!1,f=a.indexOf("."),g=0===a.indexOf("./")||0===a.indexOf("../");return-1!==f&&(!g||f>1)?(b=a.substring(0,f),c=a.substring(f+1,a.length)):b=a,d=c||b,f=d.indexOf("!"),-1!==f&&(e="strip"===d.substring(f+1),d=d.substring(0,f),c?c=d:b=d),{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,d,e){var f,g,h,i=b.xdRegExp.exec(a);return i?(f=i[2],g=i[3],g=g.split(":"),h=g[1],g=g[0],!(f&&f!==c||g&&g.toLowerCase()!==d.toLowerCase()||(h||g)&&h!==e)):!0},finishLoad:function(a,c,d,e){d=c?b.strip(d):d,o.isBuild&&(n[a]=d),e(d)},load:function(a,c,d,e){if(e.isBuild&&!e.inlineText)return d(),void 0;o.isBuild=e.isBuild;var f=b.parseName(a),g=f.moduleName+(f.ext?"."+f.ext:""),h=c.toUrl(g),i=o.useXhr||b.useXhr;return 0===h.indexOf("empty:")?(d(),void 0):(!j||i(h,k,l,m)?b.get(h,function(c){b.finishLoad(a,f.strip,c,d)},function(a){d.error&&d.error(a)}):c([g],function(a){b.finishLoad(f.moduleName+"."+f.ext,f.strip,a,d)}),void 0)},write:function(a,c,d){if(n.hasOwnProperty(c)){var e=b.jsEscape(n[c]);d.asModule(a+"!"+c,"define(function () { return '"+e+"';});\n")}},writeFile:function(a,c,d,e,f){var g=b.parseName(c),h=g.ext?"."+g.ext:"",i=g.moduleName+h,j=d.toUrl(g.moduleName+h)+".js";b.load(i,d,function(){var c=function(a){return e(j,a)};c.asModule=function(a,b){return e.asModule(a,j,b)},b.write(a,i,c,f)},f)}},"node"===o.env||!o.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(c=require.nodeRequire("fs"),b.get=function(a,b,d){try{var e=c.readFileSync(a,"utf8");0===e.indexOf("")&&(e=e.substring(1)),b(e)}catch(f){d(f)}}):"xhr"===o.env||!o.env&&b.createXhr()?b.get=function(a,c,d,e){var f,g=b.createXhr();if(g.open("GET",a,!0),e)for(f in e)e.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),e[f]);o.onXhr&&o.onXhr(g,a),g.onreadystatechange=function(){var b,e;4===g.readyState&&(b=g.status,b>399&&600>b?(e=new Error(a+" HTTP status: "+b),e.xhr=g,d(e)):c(g.responseText),o.onXhrComplete&&o.onXhrComplete(g,a))},g.send(null)}:"rhino"===o.env||!o.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?b.get=function(a,b){var c,d,e="utf-8",f=new java.io.File(a),g=java.lang.System.getProperty("line.separator"),h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),e)),i="";try{for(c=new java.lang.StringBuffer,d=h.readLine(),d&&d.length()&&65279===d.charAt(0)&&(d=d.substring(1)),null!==d&&c.append(d);null!==(d=h.readLine());)c.append(g),c.append(d);i=String(c.toString())}finally{h.close()}b(i)}:("xpconnect"===o.env||!o.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(d=Components.classes,e=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),f="@mozilla.org/windows-registry-key;1"in d,b.get=function(a,b){var c,g,h,i={};f&&(a=a.replace(/\//g,"\\")),h=new FileUtils.File(a);try{c=d["@mozilla.org/network/file-input-stream;1"].createInstance(e.nsIFileInputStream),c.init(h,1,0,!1),g=d["@mozilla.org/intl/converter-input-stream;1"].createInstance(e.nsIConverterInputStream),g.init(c,"utf-8",c.available(),e.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),g.readString(c.available(),i),g.close(),c.close(),b(i.value)}catch(j){throw new Error((h&&h.path||"")+": "+j)
+}}),b});
diff --git a/dist/app/components/require.config.js b/dist/app/components/require.config.js
index e8e3595b6ec..d9a2085169a 100644
--- a/dist/app/components/require.config.js
+++ b/dist/app/components/require.config.js
@@ -1,4 +1,4 @@
/*! kibana - v3.0.0m3pre - 2013-09-16
* Copyright (c) 2013 Rashid Khan; Licensed Apache License */
-require.config({baseUrl:"app",urlArgs:"r=2534463",paths:{config:"../config",settings:"components/settings",kbn:"components/kbn",css:"../vendor/require/css",text:"../vendor/require/text",moment:"../vendor/moment",filesaver:"../vendor/filesaver",angular:"../vendor/angular/angular","angular-strap":"../vendor/angular/angular-strap","angular-sanitize":"../vendor/angular/angular-sanitize",timepicker:"../vendor/angular/timepicker",datepicker:"../vendor/angular/datepicker",underscore:"components/underscore.extended","underscore-src":"../vendor/underscore",bootstrap:"../vendor/bootstrap/bootstrap",jquery:"../vendor/jquery/jquery-1.8.0","extend-jquery":"components/extend-jquery","jquery.flot":"../vendor/jquery/jquery.flot","jquery.flot.pie":"../vendor/jquery/jquery.flot.pie","jquery.flot.selection":"../vendor/jquery/jquery.flot.selection","jquery.flot.stack":"../vendor/jquery/jquery.flot.stack","jquery.flot.time":"../vendor/jquery/jquery.flot.time",modernizr:"../vendor/modernizr-2.6.1",elasticjs:"../vendor/elasticjs/elastic-angular-client"},shim:{underscore:{exports:"_"},angular:{deps:["jquery"],exports:"angular"},bootstrap:{deps:["jquery"]},modernizr:{exports:"Modernizr"},jquery:{exports:"jQuery"},"jquery.flot":["jquery"],"jquery.flot.pie":["jquery","jquery.flot"],"jquery.flot.selection":["jquery","jquery.flot"],"jquery.flot.stack":["jquery","jquery.flot"],"jquery.flot.time":["jquery","jquery.flot"],"angular-sanitize":["angular"],"angular-cookies":["angular"],"angular-loader":["angular"],"angular-mocks":["angular"],"angular-resource":["angular"],"angular-route":["angular"],"angular-touch":["angular"],"angular-strap":["angular","bootstrap","timepicker","datepicker"],timepicker:["jquery","bootstrap"],datepicker:["jquery","bootstrap"],elasticjs:["angular","../vendor/elasticjs/elastic"]}});
\ No newline at end of file
+require.config({baseUrl:"app",urlArgs:"r=2534463",paths:{config:"../config",settings:"components/settings",kbn:"components/kbn",css:"../vendor/require/css",text:"../vendor/require/text",moment:"../vendor/moment",filesaver:"../vendor/filesaver",angular:"../vendor/angular/angular","angular-strap":"../vendor/angular/angular-strap","angular-sanitize":"../vendor/angular/angular-sanitize",timepicker:"../vendor/angular/timepicker",datepicker:"../vendor/angular/datepicker",underscore:"components/underscore.extended","underscore-src":"../vendor/underscore",bootstrap:"../vendor/bootstrap/bootstrap",jquery:"../vendor/jquery/jquery-1.8.0","extend-jquery":"components/extend-jquery","jquery.flot":"../vendor/jquery/jquery.flot","jquery.flot.pie":"../vendor/jquery/jquery.flot.pie","jquery.flot.selection":"../vendor/jquery/jquery.flot.selection","jquery.flot.stack":"../vendor/jquery/jquery.flot.stack","jquery.flot.time":"../vendor/jquery/jquery.flot.time",modernizr:"../vendor/modernizr-2.6.1",elasticjs:"../vendor/elasticjs/elastic-angular-client"},shim:{underscore:{exports:"_"},angular:{deps:["jquery"],exports:"angular"},bootstrap:{deps:["jquery"]},modernizr:{exports:"Modernizr"},jquery:{exports:"jQuery"},"jquery.flot":["jquery"],"jquery.flot.pie":["jquery","jquery.flot"],"jquery.flot.selection":["jquery","jquery.flot"],"jquery.flot.stack":["jquery","jquery.flot"],"jquery.flot.time":["jquery","jquery.flot"],"angular-sanitize":["angular"],"angular-cookies":["angular"],"angular-loader":["angular"],"angular-mocks":["angular"],"angular-resource":["angular"],"angular-route":["angular"],"angular-touch":["angular"],"angular-strap":["angular","bootstrap","timepicker","datepicker"],timepicker:["jquery","bootstrap"],datepicker:["jquery","bootstrap"],elasticjs:["angular","../vendor/elasticjs/elastic"]}});
diff --git a/dist/app/panels/map/module.js b/dist/app/panels/map/module.js
index 4862c0df1e3..6f00c68b3d5 100644
--- a/dist/app/panels/map/module.js
+++ b/dist/app/panels/map/module.js
@@ -2,4 +2,4 @@
* Copyright (c) 2013 Rashid Khan; Licensed Apache License */
!function(a){var b={set:{colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,focus:1},get:{selectedRegions:1,selectedMarkers:1,mapObject:1,regionName:1}};a.fn.vectorMap=function(a){var c,d,c=this.children(".jvectormap-container").data("mapObject");if("addMap"===a)jvm.WorldMap.maps[arguments[1]]=arguments[2];else{if(("set"===a||"get"===a)&&b[a][arguments[1]])return d=arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1),c[a+d].apply(c,Array.prototype.slice.call(arguments,2));a=a||{},a.container=this,c=new jvm.WorldMap(a)}return this}}(jQuery),function(a){function b(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=0,g=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),g=e,void 0!==c.axis&&c.axis===c.HORIZONTAL_AXIS&&(g=0,f=-1*e),void 0!==c.wheelDeltaY&&(g=c.wheelDeltaY/120),void 0!==c.wheelDeltaX&&(f=-1*c.wheelDeltaX/120),d.unshift(b,e,f,g),(a.event.dispatch||a.event.handle).apply(this,d)}var c=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var d=c.length;d;)a.event.fixHooks[c[--d]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],b,!1);else this.onmousewheel=b},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],b,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}(jQuery);var jvm={inherits:function(a,b){function c(){}c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a,a.parentClass=b},mixin:function(a,b){var c;for(c in b.prototype)b.prototype.hasOwnProperty(c)&&(a.prototype[c]=b.prototype[c])},min:function(a){var b,c=Number.MAX_VALUE;if(a instanceof Array)for(b=0;bc&&(c=a[b]);else for(b in a)a[b]>c&&(c=a[b]);return c},keys:function(a){var b,c=[];for(b in a)c.push(b);return c},values:function(a){var b,c,d=[];for(c=0;c')}}catch(a){jvm.VMLElement.prototype.createElement=function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"),jvm.VMLElement.VMLInitialized=!0},jvm.VMLElement.prototype.getElementCtr=function(a){return jvm["VML"+a]},jvm.VMLElement.prototype.addClass=function(a){jvm.$(this.node).addClass(a)},jvm.VMLElement.prototype.applyAttr=function(a,b){this.node[a]=b},jvm.VMLElement.prototype.getBBox=function(){var a=jvm.$(this.node);return{x:a.position().left/this.canvas.scale,y:a.position().top/this.canvas.scale,width:a.width()/this.canvas.scale,height:a.height()/this.canvas.scale}},jvm.VMLGroupElement=function(){jvm.VMLGroupElement.parentClass.call(this,"group"),this.node.style.left="0px",this.node.style.top="0px",this.node.coordorigin="0 0"},jvm.inherits(jvm.VMLGroupElement,jvm.VMLElement),jvm.VMLGroupElement.prototype.add=function(a){this.node.appendChild(a.node)},jvm.VMLCanvasElement=function(){this.classPrefix="VML",jvm.VMLCanvasElement.parentClass.call(this,"group"),jvm.AbstractCanvasElement.apply(this,arguments),this.node.style.position="absolute"},jvm.inherits(jvm.VMLCanvasElement,jvm.VMLElement),jvm.mixin(jvm.VMLCanvasElement,jvm.AbstractCanvasElement),jvm.VMLCanvasElement.prototype.setSize=function(a,b){var c,d,e,f;if(this.width=a,this.height=b,this.node.style.width=a+"px",this.node.style.height=b+"px",this.node.coordsize=a+" "+b,this.node.coordorigin="0 0",this.rootElement){for(c=this.rootElement.node.getElementsByTagName("shape"),e=0,f=c.length;f>e;e++)c[e].coordsize=a+" "+b,c[e].style.width=a+"px",c[e].style.height=b+"px";for(d=this.node.getElementsByTagName("group"),e=0,f=d.length;f>e;e++)d[e].coordsize=a+" "+b,d[e].style.width=a+"px",d[e].style.height=b+"px"}},jvm.VMLCanvasElement.prototype.applyTransformParams=function(a,b,c){this.scale=a,this.transX=b,this.transY=c,this.rootElement.node.coordorigin=this.width-b-this.width/100+","+(this.height-c-this.height/100),this.rootElement.node.coordsize=this.width/a+","+this.height/a},jvm.VMLShapeElement=function(a,b){jvm.VMLShapeElement.parentClass.call(this,a,b),this.fillElement=new jvm.VMLElement("fill"),this.strokeElement=new jvm.VMLElement("stroke"),this.node.appendChild(this.fillElement.node),this.node.appendChild(this.strokeElement.node),this.node.stroked=!1,jvm.AbstractShapeElement.apply(this,arguments)},jvm.inherits(jvm.VMLShapeElement,jvm.VMLElement),jvm.mixin(jvm.VMLShapeElement,jvm.AbstractShapeElement),jvm.VMLShapeElement.prototype.applyAttr=function(a,b){switch(a){case"fill":this.node.fillcolor=b;break;case"fill-opacity":this.fillElement.node.opacity=Math.round(100*b)+"%";break;case"stroke":this.node.stroked="none"===b?!1:!0,this.node.strokecolor=b;break;case"stroke-opacity":this.strokeElement.node.opacity=Math.round(100*b)+"%";break;case"stroke-width":this.node.stroked=0===parseInt(b,10)?!1:!0,this.node.strokeweight=b;break;case"d":this.node.path=jvm.VMLPathElement.pathSvgToVml(b);break;default:jvm.VMLShapeElement.parentClass.prototype.applyAttr.apply(this,arguments)}},jvm.VMLPathElement=function(a,b){var c=new jvm.VMLElement("skew");jvm.VMLPathElement.parentClass.call(this,"shape",a,b),this.node.coordorigin="0 0",c.node.on=!0,c.node.matrix="0.01,0,0,0.01,0,0",c.node.offset="0,0",this.node.appendChild(c.node)},jvm.inherits(jvm.VMLPathElement,jvm.VMLShapeElement),jvm.VMLPathElement.prototype.applyAttr=function(a,b){"d"===a?this.node.path=jvm.VMLPathElement.pathSvgToVml(b):jvm.VMLShapeElement.prototype.applyAttr.call(this,a,b)},jvm.VMLPathElement.pathSvgToVml=function(a){var b,c,d=0,e=0;return a=a.replace(/(-?\d+)e(-?\d+)/g,"0"),a.replace(/([MmLlHhVvCcSs])\s*((?:-?\d*(?:\.\d+)?\s*,?\s*)+)/g,function(a,f,g){g=g.replace(/(\d)-/g,"$1,-").replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/\s+/g,",").split(","),g[0]||g.shift();for(var h=0,i=g.length;i>h;h++)g[h]=Math.round(100*g[h]);switch(f){case"m":return d+=g[0],e+=g[1],"t"+g.join(",");case"M":return d=g[0],e=g[1],"m"+g.join(",");case"l":return d+=g[0],e+=g[1],"r"+g.join(",");case"L":return d=g[0],e=g[1],"l"+g.join(",");case"h":return d+=g[0],"r"+g[0]+",0";case"H":return d=g[0],"l"+d+","+e;case"v":return e+=g[0],"r0,"+g[0];case"V":return e=g[0],"l"+d+","+e;case"c":return b=d+g[g.length-4],c=e+g[g.length-3],d+=g[g.length-2],e+=g[g.length-1],"v"+g.join(",");case"C":return b=g[g.length-4],c=g[g.length-3],d=g[g.length-2],e=g[g.length-1],"c"+g.join(",");case"s":return g.unshift(e-c),g.unshift(d-b),b=d+g[g.length-4],c=e+g[g.length-3],d+=g[g.length-2],e+=g[g.length-1],"v"+g.join(",");case"S":return g.unshift(e+e-c),g.unshift(d+d-b),b=g[g.length-4],c=g[g.length-3],d=g[g.length-2],e=g[g.length-1],"c"+g.join(",")}return""}).replace(/z/g,"e")},jvm.VMLCircleElement=function(a,b){jvm.VMLCircleElement.parentClass.call(this,"oval",a,b)},jvm.inherits(jvm.VMLCircleElement,jvm.VMLShapeElement),jvm.VMLCircleElement.prototype.applyAttr=function(a,b){switch(a){case"r":this.node.style.width=2*b+"px",this.node.style.height=2*b+"px",this.applyAttr("cx",this.get("cx")||0),this.applyAttr("cy",this.get("cy")||0);break;case"cx":if(!b)return;this.node.style.left=b-(this.get("r")||0)+"px";break;case"cy":if(!b)return;this.node.style.top=b-(this.get("r")||0)+"px";break;default:jvm.VMLCircleElement.parentClass.prototype.applyAttr.call(this,a,b)}},jvm.VectorCanvas=function(a,b,c){return this.mode=window.SVGAngle?"svg":"vml",this.impl="svg"==this.mode?new jvm.SVGCanvasElement(a,b,c):new jvm.VMLCanvasElement(a,b,c),this.impl},jvm.SimpleScale=function(a){this.scale=a},jvm.SimpleScale.prototype.getValue=function(a){return a},jvm.OrdinalScale=function(a){this.scale=a},jvm.OrdinalScale.prototype.getValue=function(a){return this.scale[a]},jvm.NumericScale=function(a,b,c,d){this.scale=[],b=b||"linear",a&&this.setScale(a),b&&this.setNormalizeFunction(b),c&&this.setMin(c),d&&this.setMax(d)},jvm.NumericScale.prototype={setMin:function(a){this.clearMinValue=a,this.minValue="function"==typeof this.normalize?this.normalize(a):a},setMax:function(a){this.clearMaxValue=a,this.maxValue="function"==typeof this.normalize?this.normalize(a):a},setScale:function(a){var b;for(b=0;b=0;)a-=d[f],f++;return a=f==this.scale.length-1?this.vectorToNum(this.scale[f]):this.vectorToNum(this.vectorAdd(this.scale[f],this.vectorMult(this.vectorSubtract(this.scale[f+1],this.scale[f]),a/d[f])))},vectorToNum:function(a){var b,c=0;for(b=0;bd&&(d=a[c]),e>b&&(e=b);this.params.min||this.scale.setMin(e),this.params.max||this.scale.setMax(d),this.params.min=e,this.params.max=d}for(c in a)b=parseFloat(a[c]),f[c]=isNaN(b)?this.elements[c].element.style.initial[this.params.attribute]:this.scale.getValue(b)}this.setAttributes(f),jvm.$.extend(this.values,a)},clear:function(){var a,b={};for(a in this.values)this.elements[a]&&(b[a]=this.elements[a].element.style.initial[this.params.attribute]);this.setAttributes(b),this.values={}},setScale:function(a){this.scale.setScale(a),this.values&&this.setValues(this.values)},setNormalizeFunction:function(a){this.scale.setNormalizeFunction(a),this.values&&this.setValues(this.values)}},jvm.Proj={degRad:180/Math.PI,radDeg:Math.PI/180,radius:6381372,sgn:function(a){return a>0?1:0>a?-1:a},mill:function(a,b,c){return{x:this.radius*(b-c)*this.radDeg,y:-this.radius*Math.log(Math.tan((45+.4*a)*this.radDeg))/.8}},mill_inv:function(a,b,c){return{lat:(2.5*Math.atan(Math.exp(.8*b/this.radius))-5*Math.PI/8)*this.degRad,lng:(c*this.radDeg+a/this.radius)*this.degRad}},merc:function(a,b,c){return{x:this.radius*(b-c)*this.radDeg,y:-this.radius*Math.log(Math.tan(Math.PI/4+a*Math.PI/360))}},merc_inv:function(a,b,c){return{lat:(2*Math.atan(Math.exp(b/this.radius))-Math.PI/2)*this.degRad,lng:(c*this.radDeg+a/this.radius)*this.degRad}},aea:function(a,b,c){var d=0,e=c*this.radDeg,f=29.5*this.radDeg,g=45.5*this.radDeg,h=a*this.radDeg,i=b*this.radDeg,j=(Math.sin(f)+Math.sin(g))/2,k=Math.cos(f)*Math.cos(f)+2*j*Math.sin(f),l=j*(i-e),m=Math.sqrt(k-2*j*Math.sin(h))/j,n=Math.sqrt(k-2*j*Math.sin(d))/j;return{x:m*Math.sin(l)*this.radius,y:-(n-m*Math.cos(l))*this.radius}},aea_inv:function(a,b,c){var d=a/this.radius,e=b/this.radius,f=0,g=c*this.radDeg,h=29.5*this.radDeg,i=45.5*this.radDeg,j=(Math.sin(h)+Math.sin(i))/2,k=Math.cos(h)*Math.cos(h)+2*j*Math.sin(h),l=Math.sqrt(k-2*j*Math.sin(f))/j,m=Math.sqrt(d*d+(l-e)*(l-e)),n=Math.atan(d/(l-e));return{lat:Math.asin((k-m*m*j*j)/(2*j))*this.degRad,lng:(g+n/j)*this.degRad}},lcc:function(a,b,c){var d=0,e=c*this.radDeg,f=b*this.radDeg,g=33*this.radDeg,h=45*this.radDeg,i=a*this.radDeg,j=Math.log(Math.cos(g)*(1/Math.cos(h)))/Math.log(Math.tan(Math.PI/4+h/2)*(1/Math.tan(Math.PI/4+g/2))),k=Math.cos(g)*Math.pow(Math.tan(Math.PI/4+g/2),j)/j,l=k*Math.pow(1/Math.tan(Math.PI/4+i/2),j),m=k*Math.pow(1/Math.tan(Math.PI/4+d/2),j);return{x:l*Math.sin(j*(f-e))*this.radius,y:-(m-l*Math.cos(j*(f-e)))*this.radius}},lcc_inv:function(a,b,c){var d=a/this.radius,e=b/this.radius,f=0,g=c*this.radDeg,h=33*this.radDeg,i=45*this.radDeg,j=Math.log(Math.cos(h)*(1/Math.cos(i)))/Math.log(Math.tan(Math.PI/4+i/2)*(1/Math.tan(Math.PI/4+h/2))),k=Math.cos(h)*Math.pow(Math.tan(Math.PI/4+h/2),j)/j,l=k*Math.pow(1/Math.tan(Math.PI/4+f/2),j),m=this.sgn(j)*Math.sqrt(d*d+(l-e)*(l-e)),n=Math.atan(d/(l-e));return{lat:(2*Math.atan(Math.pow(k/m,1/j))-Math.PI/2)*this.degRad,lng:(g+n/j)*this.degRad}}},jvm.WorldMap=function(a){var b,c=this;if(this.params=jvm.$.extend(!0,{},jvm.WorldMap.defaultParams,a),!jvm.WorldMap.maps[this.params.map])throw new Error("Attempt to use map which was not loaded: "+this.params.map);this.mapData=jvm.WorldMap.maps[this.params.map],this.markers={},this.regions={},this.regionsColors={},this.regionsData={},this.container=jvm.$("").css({width:"100%",height:"100%"}).addClass("jvectormap-container"),this.params.container.append(this.container),this.container.data("mapObject",this),this.container.css({position:"relative",overflow:"hidden"}),this.defaultWidth=this.mapData.width,this.defaultHeight=this.mapData.height,this.setBackgroundColor(this.params.backgroundColor),this.onResize=function(){c.setSize()},jvm.$(window).resize(this.onResize);for(b in jvm.WorldMap.apiEvents)this.params[b]&&this.container.bind(jvm.WorldMap.apiEvents[b]+".jvectormap",this.params[b]);this.canvas=new jvm.VectorCanvas(this.container[0],this.width,this.height),"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch?this.params.bindTouchEvents&&this.bindContainerTouchEvents():this.bindContainerEvents(),this.bindElementEvents(),this.createLabel(),this.params.zoomButtons&&this.bindZoomButtons(),this.createRegions(),this.createMarkers(this.params.markers||{}),this.setSize(),this.params.focusOn&&("object"==typeof this.params.focusOn?this.setFocus.call(this,this.params.focusOn.scale,this.params.focusOn.x,this.params.focusOn.y):this.setFocus.call(this,this.params.focusOn)),this.params.selectedRegions&&this.setSelectedRegions(this.params.selectedRegions),this.params.selectedMarkers&&this.setSelectedMarkers(this.params.selectedMarkers),this.params.series&&this.createSeries()},jvm.WorldMap.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,setBackgroundColor:function(a){this.container.css("background-color",a)},resize:function(){var a=this.baseScale;this.width/this.height>this.defaultWidth/this.defaultHeight?(this.baseScale=this.height/this.defaultHeight,this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)):(this.baseScale=this.width/this.defaultWidth,this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)),this.scale*=this.baseScale/a,this.transX*=this.baseScale/a,this.transY*=this.baseScale/a},setSize:function(){this.width=this.container.width(),this.height=this.container.height(),this.resize(),this.canvas.setSize(this.width,this.height),this.applyTransform()},reset:function(){var a,b;for(a in this.series)for(b=0;b
b?this.transY=b:this.transYa?this.transX=a:this.transXn[1].pageX?n[1].pageX+(n[0].pageX-n[1].pageX)/2:n[0].pageX+(n[1].pageX-n[0].pageX)/2,f=n[0].pageY>n[1].pageY?n[1].pageY+(n[0].pageY-n[1].pageY)/2:n[0].pageY+(n[1].pageY-n[0].pageY)/2,e-=j.left,f-=j.top,a=h.scale,b=Math.sqrt(Math.pow(n[0].pageX-n[1].pageX,2)+Math.pow(n[0].pageY-n[1].pageY,2)))),g=n.length};jvm.$(this.container).bind("touchstart",i),jvm.$(this.container).bind("touchmove",i)},bindElementEvents:function(){var a,b=this;this.container.mousemove(function(){a=!0}),this.container.delegate("[class~='jvectormap-element']","mouseover mouseout",function(a){var c=jvm.$(this).attr("class").baseVal?jvm.$(this).attr("class").baseVal:jvm.$(this).attr("class"),d=-1===c.indexOf("jvectormap-region")?"marker":"region",e="region"==d?jvm.$(this).attr("data-code"):jvm.$(this).attr("data-index"),f="region"==d?b.regions[e].element:b.markers[e].element,g="region"==d?b.mapData.paths[e].name:b.markers[e].config.name||"",h=jvm.$.Event(d+"LabelShow.jvectormap"),i=jvm.$.Event(d+"Over.jvectormap");"mouseover"==a.type?(b.container.trigger(i,[e]),i.isDefaultPrevented()||f.setHovered(!0),b.label.text(g),b.container.trigger(h,[b.label,e]),h.isDefaultPrevented()||(b.label.show(),b.labelWidth=b.label.width(),b.labelHeight=b.label.height())):(f.setHovered(!1),b.label.hide(),b.container.trigger(d+"Out.jvectormap",[e]))}),this.container.delegate("[class~='jvectormap-element']","mousedown",function(){a=!1}),this.container.delegate("[class~='jvectormap-element']","mouseup",function(){var c=jvm.$(this).attr("class").baseVal?jvm.$(this).attr("class").baseVal:jvm.$(this).attr("class"),d=-1===c.indexOf("jvectormap-region")?"marker":"region",e="region"==d?jvm.$(this).attr("data-code"):jvm.$(this).attr("data-index"),f=jvm.$.Event(d+"Click.jvectormap"),g="region"==d?b.regions[e].element:b.markers[e].element;a||(b.container.trigger(f,[e]),("region"===d&&b.params.regionsSelectable||"marker"===d&&b.params.markersSelectable)&&(f.isDefaultPrevented()||(b.params[d+"sSelectableOne"]&&b.clearSelected(d+"s"),g.setSelected(!g.isSelected))))})},bindZoomButtons:function(){var a=this;jvm.$("
").addClass("jvectormap-zoomin").text("+").appendTo(this.container),jvm.$("
").addClass("jvectormap-zoomout").html("−").appendTo(this.container),this.container.find(".jvectormap-zoomin").click(function(){a.setScale(a.scale*a.params.zoomStep,a.width/2,a.height/2)}),this.container.find(".jvectormap-zoomout").click(function(){a.setScale(a.scale/a.params.zoomStep,a.width/2,a.height/2)})},createLabel:function(){var a=this;this.label=jvm.$("
").addClass("jvectormap-label").appendTo(jvm.$("body")),this.container.mousemove(function(b){var c=b.pageX-15-a.labelWidth,d=b.pageY-15-a.labelHeight;5>c&&(c=b.pageX+15),5>d&&(d=b.pageY+15),a.label.is(":visible")&&a.label.css({left:c,top:d})})},setScale:function(a,b,c,d){var e,f=jvm.$.Event("zoom.jvectormap");a>this.params.zoomMax*this.baseScale?a=this.params.zoomMax*this.baseScale:ab&&(b+=360),c=jvm.Proj[f.type](a,b,g),d=this.getInsetForPoint(c.x,c.y),d?(e=d.bbox,c.x=(c.x-e[0].x)/(e[1].x-e[0].x)*d.width*this.scale,c.y=(c.y-e[0].y)/(e[1].y-e[0].y)*d.height*this.scale,{x:c.x+this.transX*this.scale+d.left*this.scale,y:c.y+this.transY*this.scale+d.top*this.scale}):!1},pointToLatLng:function(a,b){var c,d,e,f,g,h=jvm.WorldMap.maps[this.params.map].projection,i=h.centralMeridian,j=jvm.WorldMap.maps[this.params.map].insets;for(c=0;ce[0].x&&fe[0].y&&gd[0].x&&ad[0].y&&bLast Elasticsearch Querycurl -XGET "+e.elasticsearch+"/"+g.indices+"/_search?pretty -d'\n"+a.toJson(JSON.parse(c.toString()),!0)+"' "}},b.build_search=function(a,b){h.set({type:"querystring",mandate:"must",query:a+":"+b}),g.refresh()}}]),f.directive("map",function(){return{restrict:"A",link:function(b,e){function f(){e.text(""),d(".jvectormap-zoomin,.jvectormap-zoomout,.jvectormap-label").remove(),require(["./panels/map/lib/map."+b.panel.map],function(){e.vectorMap({map:b.panel.map,regionStyle:{initial:{fill:"#8c8c8c"}},zoomOnScroll:!1,backgroundColor:null,series:{regions:[{values:b.data,scale:b.panel.colors,normalizeFunction:"polynomial"}]},onRegionLabelShow:function(a,d,f){e.children(".map-legend").show();var g=c.isUndefined(b.data[f])?0:b.data[f];e.children(".map-legend").text(d.text()+": "+g)},onRegionOut:function(){d(".map-legend").hide()},onRegionClick:function(a,d){var e=c.isUndefined(b.data[d])?0:b.data[d];0!==e&&b.build_search(b.panel.field,d)}}),e.prepend(' '),d(".map-legend").hide()})}e.html(' '),b.$on("render",function(){f()}),a.element(window).bind("resize",function(){f()})}}})});
\ No newline at end of file
+}},jvm.WorldMap.maps={},jvm.WorldMap.defaultParams={map:"world_mill_en",backgroundColor:"#505050",zoomButtons:!0,zoomOnScroll:!0,zoomMax:8,zoomMin:1,zoomStep:1.6,regionsSelectable:!1,markersSelectable:!1,bindTouchEvents:!0,regionStyle:{initial:{fill:"white","fill-opacity":1,stroke:"none","stroke-width":0,"stroke-opacity":1},hover:{"fill-opacity":.8},selected:{fill:"yellow"},selectedHover:{}},markerStyle:{initial:{fill:"grey",stroke:"#505050","fill-opacity":1,"stroke-width":1,"stroke-opacity":1,r:5},hover:{stroke:"black","stroke-width":2},selected:{fill:"blue"},selectedHover:{}}},jvm.WorldMap.apiEvents={onRegionLabelShow:"regionLabelShow",onRegionOver:"regionOver",onRegionOut:"regionOut",onRegionClick:"regionClick",onRegionSelected:"regionSelected",onMarkerLabelShow:"markerLabelShow",onMarkerOver:"markerOver",onMarkerOut:"markerOut",onMarkerClick:"markerClick",onMarkerSelected:"markerSelected",onViewportChange:"viewportChange"},define("panels/map/lib/jquery.jvectormap.min",function(){}),define("panels/map/module",["angular","app","underscore","jquery","config","./lib/jquery.jvectormap.min"],function(a,b,c,d,e){var f=a.module("kibana.panels.map",[]);b.useModule(f),f.controller("map",["$scope","$rootScope","querySrv","dashboard","filterSrv",function(b,d,f,g,h){b.panelMeta={editorTabs:[{title:"Queries",src:"app/partials/querySelect.html"}],status:"Stable",description:"Displays a map of shaded regions using a field containing a 2 letter country , or US state, code. Regions with more hit are shaded darker. Node that this does use the Elasticsearch terms facet, so it is important that you set it to the correct field."};var i={queries:{mode:"all",ids:[]},map:"world",colors:["#A0E2E2","#265656"],size:100,exclude:[],spyable:!0,index_limit:0};c.defaults(b.panel,i),b.init=function(){b.$on("refresh",function(){b.get_data()}),b.get_data()},b.get_data=function(){if(0!==g.indices.length){b.panelMeta.loading=!0;var a;a=b.ejs.Request().indices(g.indices),b.panel.queries.ids=f.idsByMode(b.panel.queries);var d=b.ejs.BoolQuery();c.each(b.panel.queries.ids,function(a){d=d.should(f.getEjsObj(a))}),a=a.facet(b.ejs.TermsFacet("map").field(b.panel.field).size(b.panel.size).exclude(b.panel.exclude).facetFilter(b.ejs.QueryFilter(b.ejs.FilteredQuery(d,h.getBoolFilter(h.ids))))).size(0),b.populate_modal(a);var e=a.doSearch();e.then(function(a){b.panelMeta.loading=!1,b.hits=a.hits.total,b.data={},c.each(a.facets.map.terms,function(a){b.data[a.term.toUpperCase()]=a.count}),b.$emit("render")})}},b.populate_modal=function(c){b.modal={title:"Inspector",body:"Last Elasticsearch Query curl -XGET "+e.elasticsearch+"/"+g.indices+"/_search?pretty -d'\n"+a.toJson(JSON.parse(c.toString()),!0)+"' "}},b.build_search=function(a,b){h.set({type:"querystring",mandate:"must",query:a+":"+b}),g.refresh()}}]),f.directive("map",function(){return{restrict:"A",link:function(b,e){function f(){e.text(""),d(".jvectormap-zoomin,.jvectormap-zoomout,.jvectormap-label").remove(),require(["./panels/map/lib/map."+b.panel.map],function(){e.vectorMap({map:b.panel.map,regionStyle:{initial:{fill:"#8c8c8c"}},zoomOnScroll:!1,backgroundColor:null,series:{regions:[{values:b.data,scale:b.panel.colors,normalizeFunction:"polynomial"}]},onRegionLabelShow:function(a,d,f){e.children(".map-legend").show();var g=c.isUndefined(b.data[f])?0:b.data[f];e.children(".map-legend").text(d.text()+": "+g)},onRegionOut:function(){d(".map-legend").hide()},onRegionClick:function(a,d){var e=c.isUndefined(b.data[d])?0:b.data[d];0!==e&&b.build_search(b.panel.field,d)}}),e.prepend(' '),d(".map-legend").hide()})}e.html(' '),b.$on("render",function(){f()}),a.element(window).bind("resize",function(){f()})}}})});
diff --git a/dist/build.txt b/dist/build.txt
index c9bdf93b08e..efd2f4791d0 100644
--- a/dist/build.txt
+++ b/dist/build.txt
@@ -15,11 +15,12 @@ vendor/angular/angular-strap.js
app/components/extend-jquery.js
app/components/settings.js
app/services/alertSrv.js
+app/components/kbn.js
+vendor/moment.js
vendor/modernizr-2.6.1.js
app/services/dashboard.js
app/services/fields.js
app/services/filterSrv.js
-vendor/moment.js
app/services/kbnIndex.js
app/services/querySrv.js
app/services/timer.js
@@ -34,7 +35,6 @@ app/directives/dashUpload.js
app/directives/kibanaPanel.js
app/directives/ngBlur.js
app/directives/ngModelOnBlur.js
-app/components/kbn.js
app/directives/tip.js
app/directives/all.js
app/filters/all.js
diff --git a/src/app/services/dashboard.js b/src/app/services/dashboard.js
index 1a7913da903..1b232fc2425 100755
--- a/src/app/services/dashboard.js
+++ b/src/app/services/dashboard.js
@@ -1,10 +1,13 @@
define([
'angular',
+ 'jquery',
+ 'kbn',
'underscore',
'config',
+ 'moment',
'modernizr'
],
-function (angular, _, config, Modernizr) {
+function (angular, $, kbn, _, config, moment, Modernizr) {
'use strict';
var module = angular.module('kibana.services');
@@ -280,12 +283,12 @@ function (angular, _, config, Modernizr) {
this.script_load = function(file) {
return $http({
- url: "dashboards/"+file,
+ url: "app/dashboards/"+file,
method: "GET",
transformResponse: function(response) {
/*jshint -W054 */
- var _f = new Function("ARGS",response);
- return _f($routeParams);
+ var _f = new Function('ARGS','kbn','_','moment','window','document','angular','require','define','$','jQuery',response);
+ return _f($routeParams,kbn,_,moment);
}
}).then(function(result) {
if(!result) {