From 6c073387828ec8a9e0431645e73a5e26673ac67b Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Fri, 13 Sep 2013 16:02:08 -0700 Subject: [PATCH] - Moved the config.js file into the root of the src and dist. - prevented the config file from being minified. - offloaded the js minification to a dedicated uglify task, which accepts more options than the require-js wrapper does. - Addded the banner to the top of the minified files. --- Gruntfile.js | 42 +- dist/app/app.js | 502 +----------------- dist/app/components/require.config.js | 6 +- dist/app/dashboards/blank.json | 0 dist/app/dashboards/default.json | 0 dist/app/dashboards/guided.json | 0 dist/app/dashboards/logstash.js | 0 dist/app/dashboards/logstash.json | 0 dist/app/dashboards/noted.json | 0 dist/app/panels/bettermap/editor.html | 0 dist/app/panels/bettermap/leaflet.amd.js | 4 +- dist/app/panels/bettermap/leaflet/leaflet.css | 0 .../panels/bettermap/leaflet/leaflet.ie.css | 0 dist/app/panels/bettermap/leaflet/leaflet.js | 124 +---- dist/app/panels/bettermap/leaflet/plugins.css | 0 dist/app/panels/bettermap/leaflet/plugins.js | 36 +- dist/app/panels/bettermap/module.html | 0 dist/app/panels/bettermap/module.js | 131 +---- dist/app/panels/column/editor.html | 0 dist/app/panels/column/module.html | 0 dist/app/panels/column/module.js | 6 +- dist/app/panels/column/panelgeneral.html | 0 dist/app/panels/dashcontrol/editor.html | 0 dist/app/panels/dashcontrol/load.html | 0 dist/app/panels/dashcontrol/module.html | 0 dist/app/panels/dashcontrol/module.js | 8 +- dist/app/panels/dashcontrol/save.html | 0 dist/app/panels/dashcontrol/share.html | 0 dist/app/panels/derivequeries/editor.html | 0 dist/app/panels/derivequeries/module.html | 0 dist/app/panels/derivequeries/module.js | 7 +- dist/app/panels/fields/editor.html | 0 dist/app/panels/fields/micropanel.html | 0 dist/app/panels/fields/module.html | 0 dist/app/panels/fields/module.js | 5 +- dist/app/panels/filtering/editor.html | 0 dist/app/panels/filtering/meta.html | 0 dist/app/panels/filtering/module.html | 0 dist/app/panels/filtering/module.js | 5 +- dist/app/panels/histogram/editor.html | 0 dist/app/panels/histogram/module.html | 2 +- dist/app/panels/histogram/module.js | 21 +- dist/app/panels/hits/editor.html | 0 dist/app/panels/hits/module.html | 0 dist/app/panels/hits/module.js | 8 +- dist/app/panels/map/editor.html | 0 dist/app/panels/map/lib/map.europe.js | 47 +- dist/app/panels/map/lib/map.usa.js | 42 +- dist/app/panels/map/lib/map.world.js | 84 +-- dist/app/panels/map/module.html | 0 dist/app/panels/map/module.js | 41 +- dist/app/panels/pie/editor.html | 0 dist/app/panels/pie/module.html | 0 dist/app/panels/pie/module.js | 8 +- dist/app/panels/query/editor.html | 0 dist/app/panels/query/meta.html | 0 dist/app/panels/query/module.html | 0 dist/app/panels/query/module.js | 6 +- dist/app/panels/query/query.css | 0 dist/app/panels/table/editor.html | 0 dist/app/panels/table/micropanel.html | 0 dist/app/panels/table/module.html | 0 dist/app/panels/table/module.js | 9 +- dist/app/panels/table/pagination.html | 0 dist/app/panels/terms/editor.html | 0 dist/app/panels/terms/module.html | 0 dist/app/panels/terms/module.js | 8 +- dist/app/panels/text/editor.html | 0 dist/app/panels/text/module.html | 0 dist/app/panels/text/module.js | 15 +- dist/app/panels/timepicker/editor.html | 0 dist/app/panels/timepicker/module.html | 0 dist/app/panels/timepicker/module.js | 8 +- dist/app/panels/timepicker/refreshctrl.html | 0 dist/app/panels/trends/editor.html | 0 dist/app/panels/trends/module.html | 0 dist/app/panels/trends/module.js | 8 +- dist/app/partials/dashLoader.html | 0 dist/app/partials/dashLoaderShare.html | 0 dist/app/partials/dashboard.html | 0 dist/app/partials/dasheditor.html | 0 dist/app/partials/inspector.html | 0 dist/app/partials/load.html | 0 dist/app/partials/modal.html | 0 dist/app/partials/paneladd.html | 0 dist/app/partials/paneleditor.html | 0 dist/app/partials/panelgeneral.html | 0 dist/app/partials/querySelect.html | 0 dist/app/partials/roweditor.html | 0 dist/build.txt | 1 - dist/config.js | 54 ++ dist/css/animate.min.css | 0 dist/css/bootstrap-responsive.min.css | 0 dist/css/bootstrap.dark.less | 0 dist/css/bootstrap.dark.min.css | 0 dist/css/bootstrap.light.less | 0 dist/css/bootstrap.light.min.css | 0 dist/css/font-awesome.min.css | 0 dist/css/main.css | 0 dist/css/normalize.min.css | 0 dist/css/timepicker.css | 0 dist/font/FontAwesome.otf | Bin dist/font/fontawesome-webfont.eot | Bin dist/font/fontawesome-webfont.svg | 0 dist/font/fontawesome-webfont.ttf | Bin dist/font/fontawesome-webfont.woff | Bin dist/img/glyphicons-halflings-white.png | Bin dist/img/glyphicons-halflings.png | Bin dist/img/kibana.png | Bin dist/img/load.gif | Bin dist/img/load_big.gif | Bin dist/index.html | 0 .../vendor/bootstrap/less/tests/css-tests.css | 0 dist/vendor/filesaver.js | 7 +- dist/vendor/require/css-build.js | 5 +- dist/vendor/require/require.js | 21 +- dist/vendor/require/tmpl.js | 5 +- dist/vendor/timezone.js | 23 +- src/app/components/require.config.js | 1 + src/app/panels/histogram/module.html | 2 +- src/{app => }/config.js | 0 121 files changed, 221 insertions(+), 1081 deletions(-) mode change 100755 => 100644 dist/app/app.js mode change 100755 => 100644 dist/app/components/require.config.js mode change 100755 => 100644 dist/app/dashboards/blank.json mode change 100755 => 100644 dist/app/dashboards/default.json mode change 100755 => 100644 dist/app/dashboards/guided.json mode change 100755 => 100644 dist/app/dashboards/logstash.js mode change 100755 => 100644 dist/app/dashboards/logstash.json mode change 100755 => 100644 dist/app/dashboards/noted.json mode change 100755 => 100644 dist/app/panels/bettermap/editor.html mode change 100755 => 100644 dist/app/panels/bettermap/leaflet.amd.js mode change 100755 => 100644 dist/app/panels/bettermap/leaflet/leaflet.css mode change 100755 => 100644 dist/app/panels/bettermap/leaflet/leaflet.ie.css mode change 100755 => 100644 dist/app/panels/bettermap/leaflet/leaflet.js mode change 100755 => 100644 dist/app/panels/bettermap/leaflet/plugins.css mode change 100755 => 100644 dist/app/panels/bettermap/leaflet/plugins.js mode change 100755 => 100644 dist/app/panels/bettermap/module.html mode change 100755 => 100644 dist/app/panels/bettermap/module.js mode change 100755 => 100644 dist/app/panels/column/editor.html mode change 100755 => 100644 dist/app/panels/column/module.html mode change 100755 => 100644 dist/app/panels/column/module.js mode change 100755 => 100644 dist/app/panels/column/panelgeneral.html mode change 100755 => 100644 dist/app/panels/dashcontrol/editor.html mode change 100755 => 100644 dist/app/panels/dashcontrol/load.html mode change 100755 => 100644 dist/app/panels/dashcontrol/module.html mode change 100755 => 100644 dist/app/panels/dashcontrol/module.js mode change 100755 => 100644 dist/app/panels/dashcontrol/save.html mode change 100755 => 100644 dist/app/panels/dashcontrol/share.html mode change 100755 => 100644 dist/app/panels/derivequeries/editor.html mode change 100755 => 100644 dist/app/panels/derivequeries/module.html mode change 100755 => 100644 dist/app/panels/derivequeries/module.js mode change 100755 => 100644 dist/app/panels/fields/editor.html mode change 100755 => 100644 dist/app/panels/fields/micropanel.html mode change 100755 => 100644 dist/app/panels/fields/module.html mode change 100755 => 100644 dist/app/panels/fields/module.js mode change 100755 => 100644 dist/app/panels/filtering/editor.html mode change 100755 => 100644 dist/app/panels/filtering/meta.html mode change 100755 => 100644 dist/app/panels/filtering/module.html mode change 100755 => 100644 dist/app/panels/filtering/module.js mode change 100755 => 100644 dist/app/panels/histogram/editor.html mode change 100755 => 100644 dist/app/panels/histogram/module.html mode change 100755 => 100644 dist/app/panels/histogram/module.js mode change 100755 => 100644 dist/app/panels/hits/editor.html mode change 100755 => 100644 dist/app/panels/hits/module.html mode change 100755 => 100644 dist/app/panels/hits/module.js mode change 100755 => 100644 dist/app/panels/map/editor.html mode change 100755 => 100644 dist/app/panels/map/lib/map.europe.js mode change 100755 => 100644 dist/app/panels/map/lib/map.usa.js mode change 100755 => 100644 dist/app/panels/map/lib/map.world.js mode change 100755 => 100644 dist/app/panels/map/module.html mode change 100755 => 100644 dist/app/panels/map/module.js mode change 100755 => 100644 dist/app/panels/pie/editor.html mode change 100755 => 100644 dist/app/panels/pie/module.html mode change 100755 => 100644 dist/app/panels/pie/module.js mode change 100755 => 100644 dist/app/panels/query/editor.html mode change 100755 => 100644 dist/app/panels/query/meta.html mode change 100755 => 100644 dist/app/panels/query/module.html mode change 100755 => 100644 dist/app/panels/query/module.js mode change 100755 => 100644 dist/app/panels/query/query.css mode change 100755 => 100644 dist/app/panels/table/editor.html mode change 100755 => 100644 dist/app/panels/table/micropanel.html mode change 100755 => 100644 dist/app/panels/table/module.html mode change 100755 => 100644 dist/app/panels/table/module.js mode change 100755 => 100644 dist/app/panels/table/pagination.html mode change 100755 => 100644 dist/app/panels/terms/editor.html mode change 100755 => 100644 dist/app/panels/terms/module.html mode change 100755 => 100644 dist/app/panels/terms/module.js mode change 100755 => 100644 dist/app/panels/text/editor.html mode change 100755 => 100644 dist/app/panels/text/module.html mode change 100755 => 100644 dist/app/panels/text/module.js mode change 100755 => 100644 dist/app/panels/timepicker/editor.html mode change 100755 => 100644 dist/app/panels/timepicker/module.html mode change 100755 => 100644 dist/app/panels/timepicker/module.js mode change 100755 => 100644 dist/app/panels/timepicker/refreshctrl.html mode change 100755 => 100644 dist/app/panels/trends/editor.html mode change 100755 => 100644 dist/app/panels/trends/module.html mode change 100755 => 100644 dist/app/panels/trends/module.js mode change 100755 => 100644 dist/app/partials/dashLoader.html mode change 100755 => 100644 dist/app/partials/dashLoaderShare.html mode change 100755 => 100644 dist/app/partials/dashboard.html mode change 100755 => 100644 dist/app/partials/dasheditor.html mode change 100755 => 100644 dist/app/partials/inspector.html mode change 100755 => 100644 dist/app/partials/load.html mode change 100755 => 100644 dist/app/partials/modal.html mode change 100755 => 100644 dist/app/partials/paneladd.html mode change 100755 => 100644 dist/app/partials/paneleditor.html mode change 100755 => 100644 dist/app/partials/panelgeneral.html mode change 100755 => 100644 dist/app/partials/querySelect.html mode change 100755 => 100644 dist/app/partials/roweditor.html mode change 100755 => 100644 dist/build.txt create mode 100644 dist/config.js mode change 100755 => 100644 dist/css/animate.min.css mode change 100755 => 100644 dist/css/bootstrap-responsive.min.css mode change 100755 => 100644 dist/css/bootstrap.dark.less mode change 100755 => 100644 dist/css/bootstrap.dark.min.css mode change 100755 => 100644 dist/css/bootstrap.light.less mode change 100755 => 100644 dist/css/bootstrap.light.min.css mode change 100755 => 100644 dist/css/font-awesome.min.css mode change 100755 => 100644 dist/css/main.css mode change 100755 => 100644 dist/css/normalize.min.css mode change 100755 => 100644 dist/css/timepicker.css mode change 100755 => 100644 dist/font/FontAwesome.otf mode change 100755 => 100644 dist/font/fontawesome-webfont.eot mode change 100755 => 100644 dist/font/fontawesome-webfont.svg mode change 100755 => 100644 dist/font/fontawesome-webfont.ttf mode change 100755 => 100644 dist/font/fontawesome-webfont.woff mode change 100755 => 100644 dist/img/glyphicons-halflings-white.png mode change 100755 => 100644 dist/img/glyphicons-halflings.png mode change 100755 => 100644 dist/img/kibana.png mode change 100755 => 100644 dist/img/load.gif mode change 100755 => 100644 dist/img/load_big.gif mode change 100755 => 100644 dist/index.html mode change 100755 => 100644 dist/vendor/bootstrap/less/tests/css-tests.css mode change 100755 => 100644 dist/vendor/filesaver.js mode change 100755 => 100644 dist/vendor/require/css-build.js mode change 100755 => 100644 dist/vendor/require/require.js mode change 100755 => 100644 dist/vendor/require/tmpl.js mode change 100755 => 100644 dist/vendor/timezone.js rename src/{app => }/config.js (100%) diff --git a/Gruntfile.js b/Gruntfile.js index 6af369501cc..195510ab41b 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -30,13 +30,7 @@ module.exports = function (grunt) { 'panels/bettermap/leaflet/*.png' ], dest: '<%= tempDir %>' - }//, - // dist_to_temp: { - // cwd: '<%= destDir %>', - // expand: true, - // src: '**/*', - // dest: '<%= tempDir %>' - // } + } }, jshint: { // just lint the source dir @@ -111,19 +105,13 @@ module.exports = function (grunt) { modules: [], // populated below mainConfigFile: '<%= tempDir %>/app/components/require.config.js', keepBuildDir: true, - optimize: 'uglify', + optimize: 'none', optimizeCss: 'none', - uglify: { - max_line_length: 1000, - // beautify: true, // uncomment for easier debugging - indent_level: 2, - }, preserveLicenseComments: false, findNestedDependencies: true, normalizeDirDefines: "none", inlineText: true, skipPragmas: true, - // stubModules: ["text"], optimizeAllPluginResources: false, removeCombined: true, fileExclusionRegExp: /^\./, @@ -147,6 +135,20 @@ module.exports = function (grunt) { } } } + }, + uglify: { + dest: { + expand: true, + src: ['**/*.js', '!config.js', '!app/dashboards/*.js'], + dest: '<%= destDir %>', + cwd: '<%= destDir %>', + options: { + quite: true, + compress: true, + preserveComments: false, + banner: '<%= meta.banner %>', + } + } } }; @@ -173,7 +175,8 @@ module.exports = function (grunt) { 'services/all', 'jquery.flot', 'jquery.flot.pie', - 'text' + 'text', + 'settings' ] } ]; @@ -186,6 +189,12 @@ module.exports = function (grunt) { }); }); + // exclude the literal config definition from all modules + requireModules.forEach(function (module) { + module.excludeShallow = module.excludeShallow || []; + module.excludeShallow.push('config'); + }); + config.requirejs.compile_temp.options.modules = requireModules; // load plugins @@ -213,7 +222,8 @@ module.exports = function (grunt) { 'copy:everthing_left_in_src', 'ngmin', 'requirejs:compile_temp', - 'clean:after_require' + 'clean:after_require', + 'uglify:dest' ]); }; \ No newline at end of file diff --git a/dist/app/app.js b/dist/app/app.js old mode 100755 new mode 100644 index af1a67e3c5d..5857e6c812c --- a/dist/app/app.js +++ b/dist/app/app.js @@ -1,483 +1,19 @@ -(function(e,t){function n(e){var t=dt[e]={};return Y.each(e.split(tt),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(mt,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:vt.test(r)?Y.parseJSON(r):r}catch(s){}Y.data(e,n,r)}else r=t}return r}function i(e){var t;for(t in e){if(t==="data"&&Y.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function s(){return!1}function o(){return!0}function u(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function a(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function f(e,t,n){t=t||0;if(Y.isFunction(t))return Y.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return Y.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=Y.grep(e,function(e){return e.nodeType===1});if(Bt.test(t))return Y.filter(t,r,!n);t=Y.filter(t,r)}return Y.grep(e,function(e,r){return Y.inArray(e,t)>=0=== -n})}function l(e){var t=It.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function c(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e,t){if(t.nodeType!==1||!Y.hasData(e))return;var n,r,i,s=Y._data(e),o=Y._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(R.body),n=t.css("display");t.remove();if(n==="none"||n===""){rn=R.body.appendChild(rn||Y.extend(R.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!sn||!rn.createElement)sn=(rn.contentWindow||rn.contentDocument -).document,sn.write(""),sn.close();t=sn.body.appendChild(sn.createElement(e)),n=nn(t,"display"),R.body.removeChild(rn)}return pn[e]=n,n}function x(e,t,n,r){var i;if(Y.isArray(t))Y.each(t,function(t,i){n||wn.test(e)?r(e,i):x(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&Y.type(t)==="object")for(i in t)x(e+"["+i+"]",t[i],n,r);else r(e,t)}function T(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(tt),u=0,a=o.length;if(Y.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,it=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,st=/^[\],:{}\s]*$/,ot=/(?:^|:|,)(?:\s*\[)+/g,ut=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,at=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ft=/^-ms-/,lt=/-([\da-z])/gi,ct=function(e,t){return(t+"").toUpperCase()},ht=function(){R.addEventListener?(R.removeEventListener("DOMContentLoaded",ht,!1),Y.ready()):R.readyState==="complete"&&(R.detachEvent("onreadystatechange",ht),Y.ready())},pt={};Y.fn=Y.prototype={constructor:Y,init:function(e,n,r){var i,s,o,u;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this -.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?i=[null,e,null]:i=rt.exec(e);if(i&&(i[1]||!n)){if(i[1])return n=n instanceof Y?n[0]:n,u=n&&n.nodeType?n.ownerDocument||n:R,e=Y.parseHTML(i[1],u,!0),it.test(i[1])&&Y.isPlainObject(n)&&this.attr.call(e,n,!0),Y.merge(this,e);s=R.getElementById(i[2]);if(s&&s.parentNode){if(s.id!==i[2])return r.find(e);this.length=1,this[0]=s}return this.context=R,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return Y.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Y.makeArray(e,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return $.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=Y.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" " -:"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return Y.each(this,e,t)},ready:function(e){return Y.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack($.apply(this,arguments),"slice",$.call(arguments).join(","))},map:function(e){return this.pushStack(Y.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:V,sort:[].sort,splice:[].splice},Y.fn.init.prototype=Y.fn,Y.extend=Y.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!Y.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;q.resolveWith(R,[Y]),Y.fn.trigger&&Y(R).trigger("ready").off("ready")},isFunction:function(e){return Y.type(e)==="function"},isArray:Array.isArray||function(e){return Y.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):pt[K.call(e)]||"object"},isPlainObject:function(e){if(!e||Y.type(e)!=="object"||e.nodeType||Y.isWindow(e))return!1;try{if(e.constructor&&!Q.call(e,"constructor")&&!Q.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||Q.call(e,r)},isEmptyObject -:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||R,(r=it.exec(e))?[t.createElement(r[1])]:(r=Y.buildFragment([e],t,n?null:[]),Y.merge([],(r.cacheable?Y.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=Y.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(st.test(t.replace(ut,"@").replace(at,"]").replace(ot,"")))return(new Function("return "+t))();Y.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&Y.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call -(e,t)})(t)},camelCase:function(e){return e.replace(ft,"ms-").replace(lt,ct)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||Y.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||Y.isArray(e));if(f)for(;u-1)f.splice(n,1),s&&(n<=u&&u--,n<=a&&a--)}),this},has:function(e){return Y.inArray(e,f)>-1},empty:function(){return f=[],this},disable:function(){return f=l=r=t,this},disabled:function(){return!f},lock:function(){return l=t,r||h.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],f&&(!i||l)&&(s?l.push(t):c(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!i}};return h},Y.extend({Deferred:function(e){var t=[["resolve","done",Y.Callbacks("once memory"),"resolved"],["reject","fail",Y.Callbacks("once memory"),"rejected"],["notify","progress",Y.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){ -return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Y.Deferred(function(n){Y.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](Y.isFunction(o)?function(){var e=o.apply(this,arguments);e&&Y.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return typeof e=="object"?Y.extend(e,r):r}},i={};return r.pipe=r.then,Y.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=$.call(arguments),r=n.length,i=r!==1||e&&Y.isFunction(e.promise)?r:0,s=i===1?e:Y.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?$.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
a",n=h.getElementsByTagName("*"),r=h.getElementsByTagName("a")[0],r.style.cssText="top:1px;float:left;opacity:.5";if(!n||!n.length||!r)return{};i=R.createElement("select"),s=i.appendChild(R.createElement("option")),o=h.getElementsByTagName("input")[0],t={leadingWhitespace:h.firstChild.nodeType===3,tbody:!h.getElementsByTagName("tbody").length,htmlSerialize:!!h.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:o.value==="on",optSelected:s.selected,getSetAttribute:h.className!=="t",enctype:!!R.createElement("form").enctype,html5Clone:R.createElement("nav" -).cloneNode(!0).outerHTML!=="<:nav>",boxModel:R.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,i.disabled=!0,t.optDisabled=!s.disabled;try{delete h.test}catch(p){t.deleteExpando=!1}!h.addEventListener&&h.attachEvent&&h.fireEvent&&(h.attachEvent("onclick",c=function(){t.noCloneEvent=!1}),h.cloneNode(!0).fireEvent("onclick"),h.detachEvent("onclick",c)),o=R.createElement("input"),o.value="t",o.setAttribute("type","radio"),t.radioValue=o.value==="t",o.setAttribute("checked","checked"),o.setAttribute("name","t"),h.appendChild(o),u=R.createDocumentFragment(),u.appendChild(h.lastChild),t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=o.checked,u.removeChild(o),u.appendChild(h);if(h.attachEvent)for(f in{submit:!0,change:!0,focusin:!0})a="on"+ -f,l=a in h,l||(h.setAttribute(a,"return;"),l=typeof h[a]=="function"),t[f+"Bubbles"]=l;return Y(function(){var n,r,i,s,o="padding:0;margin:0;border:0;display:block;overflow:hidden;",u=R.getElementsByTagName("body")[0];if(!u)return;n=R.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",u.insertBefore(n,u.firstChild),r=R.createElement("div"),n.appendChild(r),r.innerHTML="
t
",i=r.getElementsByTagName("td"),i[0].style.cssText="padding:0;margin:0;border:0;display:none",l=i[0].offsetHeight===0,i[0].style.display="",i[1].style.display="none",t.reliableHiddenOffsets=l&&i[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=u.offsetTop!==1,e.getComputedStyle&&( -t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",s=R.createElement("div"),s.style.cssText=r.style.cssText=o,s.style.marginRight=s.style.width="0",r.style.width="1px",r.appendChild(s),t.reliableMarginRight=!parseFloat((e.getComputedStyle(s,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=o+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),u.removeChild(n),n=r=i=s=null}),u.removeChild(h),n=r=i=s=o=u=h=null,t}();var vt=/^(?:\{.*\}|\[.*\])$/,mt=/([A-Z])/g;Y.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Y.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e. -nodeType?Y.cache[e[Y.expando]]:e[Y.expando],!!e&&!i(e)},data:function(e,n,r,i){if(!Y.acceptData(e))return;var s,o,u=Y.expando,a=typeof n=="string",f=e.nodeType,l=f?Y.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=Y.deletedIds.pop()||++Y.uuid:c=u),l[c]||(l[c]={},f||(l[c].toJSON=Y.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=Y.extend(l[c],n):l[c].data=Y.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[Y.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[Y.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!Y.acceptData(e))return;var r,s,o,u=e.nodeType,a=u?Y.cache:e,f=u?e[Y.expando]:Y.expando;if(!a[f])return;if(t){r=n?a[f]:a[f].data;if(r){Y.isArray(t)||(t in r?t=[t]:(t=Y.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(s=0,o=t.length;s1,null,!1))},removeData:function(e){return this.each(function(){Y.removeData(this,e)})}}),Y.extend({queue: -function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y._data(e,t),n&&(!r||Y.isArray(n)?r=Y._data(e,t,Y.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=Y.queue(e,t),r=n.shift(),i=Y._queueHooks(e,t),s=function(){Y.dequeue(e,t)};r==="inprogress"&&(r=n.shift()),r&&(t==="fx"&&n.unshift("inprogress"),delete i.stop,r.call(e,s,i)),!n.length&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y._data(e,n)||Y._data(e,n,{empty:Y.Callbacks("once memory").add(function(){Y.removeData(e,t+"queue",!0),Y.removeData(e,n,!0)})})}}),Y.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){Y.removeAttr(this,e)})},prop:function(e,t){return Y.access(this,Y.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Y.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r -,i,s,o,u;if(Y.isFunction(e))return this.each(function(t){Y(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(tt);for(n=0,r=this.length;n-1)r=r.replace(" "+n[s]+" "," ");i.className=e?Y.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return Y.isFunction(e)?this.each(function(n){Y(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function( -){if(n==="string"){var i,s=0,o=Y(this),u=t,a=e.split(tt);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&Y._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Y._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n-1)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=Y.valHooks[s.type]||Y.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(Et,""):r==null?"":r);return}return i=Y.isFunction(e),this.each(function(r){var s,o=Y(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":Y.isArray(s)&&(s=Y.map(s,function(e){return e==null?"":e+""})),n=Y.valHooks[this.type]||Y.valHooks[this.nodeName.toLowerCase()];if(! -n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),Y.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r,i,s=e.selectedIndex,o=[],u=e.options,a=e.type==="select-one";if(s<0)return null;n=a?s:0,r=a?s+1:u.length;for(;n=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&Y.isFunction(Y.fn[n]))return Y(e)[n](r);if(typeof e.getAttribute=="undefined")return Y.prop(e,n,r);u=a!==1||!Y.isXMLDoc(e),u&&(n=n.toLowerCase(),o=Y.attrHooks[n]||(Nt.test(n)?yt -:gt));if(r!==t){if(r===null){Y.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,""+r),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(tt);for(;o=0}})});var kt=/^(?:textarea|input|select)$/i,Lt=/^([^\.]*|)(?:\.(.+)|)$/,At=/(?:^|\s)hover(\.\S+|)\b/,Ot=/^key/,Mt=/^(?:mouse|contextmenu)|click/,_t=/^(?:focusinfocus|focusoutblur)$/,Dt=function(e){return Y.event.special.hover?e:e.replace(At,"mouseenter$1 mouseleave$1")};Y.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,v,m;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=Y._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=Y.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof Y=="undefined"||!!e&&Y.event.triggered===e.type?t:Y.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=Y.trim(Dt(n)).split(" ");for(f=0;f=0&&(m=m.slice(0,-1),u=!0),m.indexOf(".")>=0&&(g=m.split("."),m=g.shift(),g.sort());if((!i||Y.event.customEvent[m])&&!Y.event.global[m])return;n=typeof n=="object"?n[Y.expando]?n:new Y.Event(m,n):new Y.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=u,n.namespace=g.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c=m.indexOf(":")<0?"on"+m:"";if(!i){o=Y.cache;for(a in o)o[a].events&&o[a].events[m]&&Y.event.trigger(n,r,o[a].handle.elem,!0);return}n.result=t,n.target|| -(n.target=i),r=r!=null?Y.makeArray(r):[],r.unshift(n),h=Y.event.special[m]||{};if(h.trigger&&h.trigger.apply(i,r)===!1)return;d=[[i,h.bindType||m]];if(!s&&!h.noBubble&&!Y.isWindow(i)){v=h.delegateType||m,f=_t.test(v+m)?i:i.parentNode;for(l=i;f;f=f.parentNode)d.push([f,v]),l=f;l===(i.ownerDocument||R)&&d.push([l.defaultView||l.parentWindow||e,v])}for(a=0;av&&b.push({elem:this,matches:d.slice(v)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Ot.test(t)&&(Y.event -.fixHooks[t]=Y.event.keyHooks),Mt.test(t)&&(Y.event.fixHooks[t]=Y.event.mouseHooks)}),function(e,t){function n(e,t,n,r){var i=0,s=t.length;for(;i0?a(u,r,o):[]}function i(e,i,s,o,u){var a,f,l,c,h,p,d,v,m=0,g=u.length,y=W.POS,b=new RegExp("^"+y.source+"(?!"+T+")","i"),w=function(){var e=1,n=arguments.length-2;for(;el){d=e.slice(l,a.index),l=v,p=[i],P.test(d)&&(h&&(p=h),h=o);if(f=q.test(d))d=d.slice(0,-5).replace(P,"$&*");a.length>1&&a[0].replace(b,w),h=r(d,a[1],a[2],p,h,f)}}h?(c=c.concat(h),(d=e.slice(l))&&d!==")"?P.test(d)?n(d,c,s,o):st(d,i,s,o?o.concat(h):h):S.apply(s,c)):st(e,i,s,o)}return g===1?s:st.uniqueSort(s)}function s(e,t,n){var r,i,s,o=[],u=0,a=B.exec(e),f=!a.pop()&&!a.pop(),l=f&&e.match(H)||[""], -c=ot.preFilter,h=ot.filter,p=!n&&t!==v;for(;(i=l[u])!=null&&f;u++){o.push(r=[]),p&&(i=" "+i);while(i){f=!1;if(a=P.exec(i))i=i.slice(a[0].length),f=r.push({part:a.pop().replace(D," "),captures:a});for(s in h)(a=W[s].exec(i))&&(!c[s]||(a=c[s](a,t,n)))&&(i=i.slice(a.shift().length),f=r.push({part:s,captures:a}));if(!f)break}}return f||st.error(e),o}function o(e,t,n){var r=t.dir,i=w++;return e||(e=function(e){return e===n}),t.first?function(t,n){while(t=t[r])if(t.nodeType===1)return e(t,n)&&t}:function(t,n){var s,o=i+"."+c,u=o+"."+l;while(t=t[r])if(t.nodeType===1){if((s=t[x])===u)return t.sizset;if(typeof s=="string"&&s.indexOf(o)===0){if(t.sizset)return t}else{t[x]=u;if(e(t,n))return t.sizset=!0,t;t.sizset=!1}}}}function u(e,t){return e?function(n,r){var i=t(n,r);return i&&e(i===!0?n:i,r)}:t}function a(e,t,n){var r,i,s=0;for(;r=e[s];s++)ot.relative[r.part]?i=o(i,ot.relative[r.part],t):(r.captures.push(t,n),i=u(i,ot.filter[r.part].apply(null,r.captures)));return i}function f(e){return function( -t,n){var r,i=0;for(;r=e[i];i++)if(r(t,n))return!0;return!1}}var l,c,h,p,d,v=e.document,m=v.documentElement,g="undefined",y=!1,b=!0,w=0,E=[].slice,S=[].push,x=("sizcache"+Math.random()).replace(".",""),T="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",C=N.replace("w","w#"),k="([*^$|!~]?=)",L="\\["+T+"*("+N+")"+T+"*(?:"+k+T+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+C+")|)|)"+T+"*\\]",A=":("+N+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",O=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",M=T+"*([\\x20\\t\\r\\n\\f>+~])"+T+"*",_="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+L+"|"+A.replace(2,7)+"|[^\\\\(),])+",D=new RegExp("^"+T+"+|((?:^|[^\\\\])(?:\\\\.)*)"+T+"+$","g"),P=new RegExp("^"+M),H=new RegExp(_+"?(?="+T+"*,|$)","g"),B=new RegExp("^(?:(?!,)(?:(?:^|,)"+T+"*"+_+")*?|"+T+"*(.*?))(\\)|$)"),j=new RegExp(_.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+M,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,I=/[\x20\t\r\n\f]*[+~]/ -,q=/:not\($/,R=/h\d/i,U=/input|select|textarea|button/i,z=/\\(?!\\)/g,W={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),NAME:new RegExp("^\\[name=['\"]?("+N+")['\"]?\\]"),TAG:new RegExp("^("+N.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+L),PSEUDO:new RegExp("^"+A),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+T+"*(even|odd|(([+-]|)(\\d*)n|)"+T+"*(?:([+-]|)"+T+"*(\\d+)|))"+T+"*\\)|)","i"),POS:new RegExp(O,"ig"),needsContext:new RegExp("^"+T+"*[>+~]|"+O,"i")},X={},V=[],$={},J=[],K=function(e){return e.sizzleFilter=!0,e},Q=function(e){return function(t){return t.nodeName.toLowerCase()==="input"&&t.type===e}},G=function(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}},Z=function(e){var t=!1,n=v.createElement("div");try{t=e(n)}catch(r){}return n=null,t},et=Z(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),tt=Z(function(e){e.id=x+0,e.innerHTML="
",m.insertBefore(e,m.firstChild);var t=v.getElementsByName&&v.getElementsByName(x).length===2+v.getElementsByName(x+0).length;return d=!v.getElementById(x),m.removeChild(e),t}),nt=Z(function(e){return e.appendChild(v.createComment("")),e.getElementsByTagName("*").length===0}),rt=Z(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==g&&e.firstChild.getAttribute("href")==="#"}),it=Z(function(e){return e.innerHTML="",!e.getElementsByClassName||e.getElementsByClassName("e").length===0?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length!==1)}),st=function(e,t,n,r){n=n||[],t=t||v;var i,s,o,u,a=t.nodeType;if(a!==1&&a!==9)return[];if(!e||typeof e!="string")return n;o=at(t);if(!o&&!r)if(i=F.exec(e))if(u=i[1]){if(a===9){s=t.getElementById(u);if(!s||!s.parentNode)return n;if(s.id===u)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById -(u))&&ft(t,s)&&s.id===u)return n.push(s),n}else{if(i[2])return S.apply(n,E.call(t.getElementsByTagName(e),0)),n;if((u=i[3])&&it&&t.getElementsByClassName)return S.apply(n,E.call(t.getElementsByClassName(u),0)),n}return ht(e,t,n,r,o)},ot=st.selectors={cacheLength:50,match:W,order:["ID","TAG"],attrHandle:{},createPseudo:K,find:{ID:d?function(e,t,n){if(typeof t.getElementById!==g&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==g&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==g&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:nt?function(e,t){if(typeof t.getElementsByTagName!==g)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e -){return e[1]=e[1].replace(z,""),e[3]=(e[4]||e[5]||"").replace(z,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||st.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=e[4];return W.CHILD.test(e[0])?null:(n&&(t=B.exec(n))&&t.pop()&&(e[0]=e[0].slice(0,t[0].length-n.length-1),n=t[0].slice(0,-1)),e.splice(2,3,n||e[3]),e)}},filter:{ID:d?function(e){return e=e.replace(z,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(z,""),function(t){var n=typeof t.getAttributeNode!==g&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace(z,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=X[e];return t||(t=X[e]=new RegExp("(^|"+T+")"+e+"("+T+"|$)"),V.push(e),V.length>ot.cacheLength&&delete -X[V.shift()]),function(e){return t.test(e.className||typeof e.getAttribute!==g&&e.getAttribute("class")||"")}},ATTR:function(e,t,n){return t?function(r){var i=st.attr(r,e),s=i+"";if(i==null)return t==="!=";switch(t){case"=":return s===n;case"!=":return s!==n;case"^=":return n&&s.indexOf(n)===0;case"*=":return n&&s.indexOf(n)>-1;case"$=":return n&&s.substr(s.length-n.length)===n;case"~=":return(" "+s+" ").indexOf(n)>-1;case"|=":return s===n||s.substr(0,n.length+1)===n+"-"}}:function(t){return st.attr(t,e)!=null}},CHILD:function(e,t,n,r){if(e==="nth"){var i=w++;return function(e){var t,s,o=0,u=e;if(n===1&&r===0)return!0;t=e.parentNode;if(t&&(t[x]!==i||!e.sizset)){for(u=t.firstChild;u;u=u.nextSibling)if(u.nodeType===1){u.sizset=++o;if(u===e)break}t[x]=i}return s=e.sizset-r,n===0?s===0:s%n===0&&s/n>=0}}return function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1 -)return!1;return!0}}},PSEUDO:function(e,t,n,r){var i=ot.pseudos[e]||ot.pseudos[e.toLowerCase()];return i||st.error("unsupported pseudo: "+e),i.sizzleFilter?i(t,n,r):i}},pseudos:{not:K(function(e,t,n){var r=ct(e.replace(D,"$1"),t,n);return function(e){return!r(e)}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!ot.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},contains:K(function(e){return function(t){return(t.textContent||t.innerText||lt(t)).indexOf(e)>-1}}),has:K(function(e){return function(t){return st(e,t).length>0}}),header:function(e){return R.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&& -(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:Q("radio"),checkbox:Q("checkbox"),file:Q("file"),password:Q("password"),image:Q("image"),submit:G("submit"),reset:G("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return U.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&(!!e.type||!!e.href)},active:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t,n){return n?e.slice(1):[e[0]]},last:function(e,t,n){var r=e.pop();return n?e:[r]},even:function(e,t,n){var r=[],i=n?1:0,s=e.length;for(;iot.cacheLength&&delete $[J.shift()],u};st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){return st(t,null,null,[e]).length>0};var ht=function(e,t,n,r,s){e=e.replace(D,"$1");var o,u,a,f,h,p,d,v,m,g=e.match(H),y=e.match(j),b=t.nodeType;if(W.POS.test(e))return i(e,t,n,r,g);if(r)o=E.call(r,0);else if(g&&g.length===1){if(y.length>1&&b===9&&!s&&(g=W.ID.exec(y[0]))){t=ot.find.ID(g[1],t,s)[0];if(!t)return n;e=e.slice -(y.shift().length)}v=(g=I.exec(y[0]))&&!g.index&&t.parentNode||t,m=y.pop(),p=m.split(":not")[0];for(a=0,f=ot.order.length;a",e.querySelectorAll("[selected]").length||i.push("\\["+T+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),Z(function(e){e.innerHTML="

",e.querySelectorAll -("[test^='']").length&&i.push("[*^$]="+T+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=i.length&&new RegExp(i.join("|")),ht=function(e,r,s,o,u){if(!o&&!u&&(!i||!i.test(e)))if(r.nodeType===9)try{return S.apply(s,E.call(r.querySelectorAll(e),0)),s}catch(a){}else if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){var f=r.getAttribute("id"),l=f||x,c=I.test(e)&&r.parentNode||r;f?l=l.replace(n,"\\$&"):r.setAttribute("id",l);try{return S.apply(s,E.call(c.querySelectorAll(e.replace(H,"[id='"+l+"'] $&")),0)),s}catch(a){}finally{f||r.removeAttribute("id")}}return t(e,r,s,o,u)},o&&(Z(function(t){e=o.call(t,"div");try{o.call(t,"[test!='']:sizzle"),s.push(ot.match.PSEUDO)}catch(n){}}),s=new RegExp(s.join("|")),st.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!at(t)&&!s.test(n)&&(!i||!i.test(n)))try{var u=o.call(t,n);if(u||e||t.document&&t.document.nodeType!==11)return u}catch(a){}return st(n,null,null,[t] -).length>0})}(),st.attr=Y.attr,Y.find=st,Y.expr=st.selectors,Y.expr[":"]=Y.expr.pseudos,Y.unique=st.uniqueSort,Y.text=st.getText,Y.isXMLDoc=st.isXML,Y.contains=st.contains}(e);var Pt=/Until$/,Ht=/^(?:parents|prev(?:Until|All))/,Bt=/^.[^:#\[\.,]*$/,jt=Y.expr.match.needsContext,Ft={children:!0,contents:!0,next:!0,prev:!0};Y.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return Y(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:Y.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=jt.test(e)||typeof e!="string"?Y(e,t||this.context):0;for(;r-1:Y.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?Y.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?Y.inArray(this[0],Y(e)):Y.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?Y(e,t):Y.makeArray(e&&e.nodeType?[e]:e),r=Y.merge(this.get(),n);return this.pushStack(u(n[0])||u(r[0])?r:Y.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),Y.fn.andSelf=Y.fn.addBack,Y.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return Y.dir(e,"parentNode")},parentsUntil:function(e,t,n){return Y.dir -(e,"parentNode",n)},next:function(e){return a(e,"nextSibling")},prev:function(e){return a(e,"previousSibling")},nextAll:function(e){return Y.dir(e,"nextSibling")},prevAll:function(e){return Y.dir(e,"previousSibling")},nextUntil:function(e,t,n){return Y.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y.dir(e,"previousSibling",n)},siblings:function(e){return Y.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Y.sibling(e.firstChild)},contents:function(e){return Y.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Y.merge([],e.childNodes)}},function(e,t){Y.fn[e]=function(n,r){var i=Y.map(this,t,n);return Pt.test(e)||(r=n),r&&typeof r=="string"&&(i=Y.filter(r,i)),i=this.length>1&&!Ft[e]?Y.unique(i):i,this.length>1&&Ht.test(e)&&(i=i.reverse()),this.pushStack(i,e,$.call(arguments).join(","))}}),Y.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?Y.find.matchesSelector(t[0],e)?[t[0]]:[]:Y.find.matches(e,t)},dir:function(e,n,r){var i= -[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!Y(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var It="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",qt=/ jQuery\d+="(?:null|\d+)"/g,Rt=/^\s+/,Ut=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,zt=/<([\w:]+)/,Wt=/]","i"),Kt=/^(?:checkbox|radio)$/,Qt=/checked\s*(?:[^=]|=\s*.checked.)/i,Gt=/\/(java|ecma)script/i,Yt=/^\s*\s*$/g,Zt={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
" -],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},en=l(R),tn=en.appendChild(R.createElement("div"));Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,Zt.th=Zt.td,Y.support.htmlSerialize||(Zt._default=[1,"X
","
"]),Y.fn.extend({text:function(e){return Y.access(this,function(e){return e===t?Y.text(this):this.empty().append((this[0]&&this[0].ownerDocument||R).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(Y.isFunction(e))return this.each(function(t){Y(this).wrapAll(e.call(this,t))});if(this[0]){var t=Y(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Y.isFunction(e)?this.each(function(t){Y(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Y(this),n=t.contents();n.length?n.wrapAll -(e):t.append(e)})},wrap:function(e){var t=Y.isFunction(e);return this.each(function(n){Y(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Y.nodeName(this,"body")||Y(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!u(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(e,this),"before",this.selector)}},after:function(){if(!u(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(this,e),"after",this.selector)}},remove:function( -e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||Y.filter(e,[n]).length)!t&&n.nodeType===1&&(Y.cleanData(n.getElementsByTagName("*")),Y.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&Y.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return Y.clone(this,e,t)})},html:function(e){return Y.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(qt,""):t;if(typeof e=="string"&&!Vt.test(e)&&(Y.support.htmlSerialize||!Jt.test(e))&&(Y.support.leadingWhitespace||!Rt.test(e))&&!Zt[(zt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ut,"<$1>");try{for(;r1&&typeof f=="string"&&Qt.test(f))return this.each(function(){Y(this).domManip(e,n,r)});if(Y.isFunction(f))return this.each(function(i){var s=Y(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=Y.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&Y.nodeName(s,"tr");for(u=i.cacheable||h-1;a0?this.clone(!0):this).get(),Y(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),Y.extend({clone:function(e,t,n){var r,i,s,o;Y.support.html5Clone||Y.isXMLDoc(e)||!Jt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(tn.innerHTML=e.outerHTML,tn.removeChild(o=tn.firstChild));if((!Y.support.noCloneEvent||!Y.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!Y.isXMLDoc(e)){p(e,o),r=d(e),i=d(o);for(s=0;r[s];++s)i[s]&&p(r[s],i[s])}if(t){h(e,o);if(n){r=d(e),i=d(o);for(s=0;r[s];++s)h(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var i,s,o,u,a,f,c,h,p,d,m,g,y=0,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=R;for(s=t===R&&en;(o=e[y])!=null;y++){typeof o=="number"&&(o+="");if(!o)continue;if(typeof o=="string")if(!Xt.test(o))o=t.createTextNode(o);else{s=s||l(t),c=c||s.appendChild(t.createElement("div")),o=o.replace(Ut,"<$1>"),u=(zt.exec(o)||["",""])[1].toLowerCase(),a=Zt[u]||Zt._default,f=a[0],c.innerHTML=a[1]+o+a[2 -];while(f--)c=c.lastChild;if(!Y.support.tbody){h=Wt.test(o),p=u==="table"&&!h?c.firstChild&&c.firstChild.childNodes:a[1]===""&&!h?c.childNodes:[];for(i=p.length-1;i>=0;--i)Y.nodeName(p[i],"tbody")&&!p[i].childNodes.length&&p[i].parentNode.removeChild(p[i])}!Y.support.leadingWhitespace&&Rt.test(o)&&c.insertBefore(t.createTextNode(Rt.exec(o)[0]),c.firstChild),o=c.childNodes,c=s.lastChild}o.nodeType?b.push(o):b=Y.merge(b,o)}c&&(s.removeChild(c),o=c=s=null);if(!Y.support.appendChecked)for(y=0;(o=b[y])!=null;y++)Y.nodeName(o,"input")?v(o):typeof o.getElementsByTagName!="undefined"&&Y.grep(o.getElementsByTagName("input"),v);if(n){m=function(e){if(!e.type||Gt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(y=0;(o=b[y])!=null;y++)if(!Y.nodeName(o,"script")||!m(o))n.appendChild(o),typeof o.getElementsByTagName!="undefined"&&(g=Y.grep(Y.merge([],o.getElementsByTagName("script")),m),b.splice.apply(b,[y+1,0].concat(g)),y+=g.length)}return b},cleanData -:function(e,t){var n,r,i,s,o=0,u=Y.expando,a=Y.cache,f=Y.support.deleteExpando,l=Y.event.special;for(;(i=e[o])!=null;o++)if(t||Y.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?Y.event.remove(i,s):Y.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,Y.deletedIds.push(r))}}}}),function(){var e,t;Y.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Y.uaMatch(z.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.webkit&&(t.safari=!0),Y.browser=t,Y.sub=function(){function e(t,n){return new e.fn.init(t,n)}Y.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function n(n,r){return r&&r instanceof Y&&! -(r instanceof e)&&(r=e(r)),Y.fn.init.call(this,n,r,t)},e.fn.init.prototype=e.fn;var t=e(R);return e}}();var nn,rn,sn,on=/alpha\([^)]*\)/i,un=/opacity=([^)]*)/,an=/^(top|right|bottom|left)$/,fn=/^margin/,ln=new RegExp("^("+Z+")(.*)$","i"),cn=new RegExp("^("+Z+")(?!px)[a-z%]+$","i"),hn=new RegExp("^([-+])=("+Z+")","i"),pn={},dn={position:"absolute",visibility:"hidden",display:"block"},vn={letterSpacing:0,fontWeight:400,lineHeight:1},mn=["Top","Right","Bottom","Left"],gn=["Webkit","O","Moz","ms"],yn=Y.fn.toggle;Y.fn.extend({css:function(e,n){return Y.access(this,function(e,n,r){return r!==t?Y.style(e,n,r):Y.css(e,n)},e,n,arguments.length>1)},show:function(){return y(this,!0)},hide:function(){return y(this)},toggle:function(e,t){var n=typeof e=="boolean";return Y.isFunction(e)&&Y.isFunction(t)?yn.apply(this,arguments):this.each(function(){(n?e:g(this))?Y(this).show():Y(this).hide()})}}),Y.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nn(e,"opacity");return n===""?"1":n}}}},cssNumber -:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Y.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=Y.camelCase(n),f=e.style;n=Y.cssProps[a]||(Y.cssProps[a]=m(f,a)),u=Y.cssHooks[n]||Y.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=hn.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(Y.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!Y.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=Y.camelCase(n);return n=Y.cssProps[a]||(Y.cssProps[a]=m(e.style,a)),u=Y.cssHooks[n]||Y.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=nn(e,n)),s==="normal"&&n in vn&&(s=vn[n]),r||i!==t?(o=parseFloat(s),r||Y.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call -(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?nn=function(e,t){var n,r,i,s,o=getComputedStyle(e,null),u=e.style;return o&&(n=o[t],n===""&&!Y.contains(e.ownerDocument.documentElement,e)&&(n=Y.style(e,t)),cn.test(n)&&fn.test(t)&&(r=u.width,i=u.minWidth,s=u.maxWidth,u.minWidth=u.maxWidth=u.width=n,n=o.width,u.width=r,u.minWidth=i,u.maxWidth=s)),n}:R.documentElement.currentStyle&&(nn=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),cn.test(i)&&!an.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),Y.each(["height","width"],function(e,t){Y.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth!==0||nn(e,"display")!=="none"?E(e,t,r):Y.swap(e,dn,function(){return E(e,t,r)})},set:function(e,n,r){return b(e,n,r?w(e,t,r,Y.support.boxSizing&&Y.css(e,"boxSizing")==="border-box" -):0)}}}),Y.support.opacity||(Y.cssHooks.opacity={get:function(e,t){return un.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=Y.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&Y.trim(s.replace(on,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=on.test(s)?s.replace(on,i):s+" "+i}}),Y(function(){Y.support.reliableMarginRight||(Y.cssHooks.marginRight={get:function(e,t){return Y.swap(e,{display:"inline-block"},function(){if(t)return nn(e,"marginRight")})}}),!Y.support.pixelPosition&&Y.fn.position&&Y.each(["top","left"],function(e,t){Y.cssHooks[t]={get:function(e,n){if(n){var r=nn(e,t);return cn.test(r)?Y(e).position()[t]+"px":r}}}})}),Y.expr&&Y.expr.filters&&(Y.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!Y.support.reliableHiddenOffsets&&(e.style&&e.style.display||nn(e,"display" -))==="none"},Y.expr.filters.visible=function(e){return!Y.expr.filters.hidden(e)}),Y.each({margin:"",padding:"",border:"Width"},function(e,t){Y.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+mn[r]+t]=i[r]||i[r-2]||i[0];return s}},fn.test(e)||(Y.cssHooks[e+t].set=b)});var bn=/%20/g,wn=/\[\]$/,En=/\r?\n/g,Sn=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,xn=/^(?:select|textarea)/i;Y.fn.extend({serialize:function(){return Y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Y.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||xn.test(this.nodeName)||Sn.test(this.type))}).map(function(e,t){var n=Y(this).val();return n==null?null:Y.isArray(n)?Y.map(n,function(e,n){return{name:t.name,value:e.replace(En,"\r\n")}}):{name:t.name,value:n.replace(En,"\r\n")}}).get()}}),Y.param= -function(e,n){var r,i=[],s=function(e,t){t=Y.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=Y.ajaxSettings&&Y.ajaxSettings.traditional);if(Y.isArray(e)||e.jquery&&!Y.isPlainObject(e))Y.each(e,function(){s(this.name,this.value)});else for(r in e)x(r,e[r],n,s);return i.join("&").replace(bn,"+")};var Tn,Nn,Cn=/#.*$/,kn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Ln=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,An=/^(?:GET|HEAD)$/,On=/^\/\//,Mn=/\?/,_n=/)<[^<]*)*<\/script>/gi,Dn=/([?&])_=[^&]*/,Pn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Hn=Y.fn.load,Bn={},jn={},Fn=["*/"]+["*"];try{Tn=U.href}catch(In){Tn=R.createElement("a"),Tn.href="",Tn=Tn.href}Nn=Pn.exec(Tn.toLowerCase())||[],Y.fn.load=function(e,n,r){if(typeof e!="string"&&Hn)return Hn.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),Y.isFunction(n)?(r=n,n= -t):typeof n=="object"&&(s="POST"),Y.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?Y("
").append(e.replace(_n,"")).find(i):e)}),this},Y.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Y.fn[t]=function(e){return this.on(t,e)}}),Y.each(["get","post"],function(e,n){Y[n]=function(e,r,i,s){return Y.isFunction(r)&&(s=s||i,i=r,r=t),Y.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),Y.extend({getScript:function(e,n){return Y.get(e,t,n,"script")},getJSON:function(e,t,n){return Y.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?C(e,Y.ajaxSettings):(t=e,e=Y.ajaxSettings),C(e,t),e},ajaxSettings:{url:Tn,isLocal:Ln.test(Nn[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*" -:Fn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Y.parseJSON,"text xml":Y.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:T(Bn),ajaxTransport:T(jn),ajax:function(e,n){function r(e,n,r,o){var f,c,y,b,E,x=n;if(w===2)return;w=2,a&&clearTimeout(a),u=t,s=o||"",S.readyState=e>0?4:0,r&&(b=k(h,S,r));if(e>=200&&e<300||e===304)h.ifModified&&(E=S.getResponseHeader("Last-Modified"),E&&(Y.lastModified[i]=E),E=S.getResponseHeader("Etag"),E&&(Y.etag[i]=E)),e===304?(x="notmodified",f=!0):(f=L(h,b),x=f.state,c=f.data,y=f.error,f=!y);else{y=x;if(!x||e)x="error",e<0&&(e=0)}S.status=e,S.statusText=""+(n||x),f?v.resolveWith(p,[c,x,S]):v.rejectWith(p,[S,x,y]),S.statusCode(g),g=t,l&&d.trigger("ajax"+(f?"Success":"Error"),[S,h,f?c:y]),m.fireWith(p,[S,x]),l&&(d.trigger("ajaxComplete",[S,h]),--Y.active||Y.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var i,s,o,u,a,f,l,c,h=Y -.ajaxSetup({},n),p=h.context||h,d=p!==h&&(p.nodeType||p instanceof Y)?Y(p):Y.event,v=Y.Deferred(),m=Y.Callbacks("once memory"),g=h.statusCode||{},y={},b={},w=0,E="canceled",S={readyState:0,setRequestHeader:function(e,t){if(!w){var n=e.toLowerCase();e=b[n]=b[n]||e,y[e]=t}return this},getAllResponseHeaders:function(){return w===2?s:null},getResponseHeader:function(e){var n;if(w===2){if(!o){o={};while(n=kn.exec(s))o[n[1].toLowerCase()]=n[2]}n=o[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return w||(h.mimeType=e),this},abort:function(e){return e=e||E,u&&u.abort(e),r(0,e),this}};v.promise(S),S.success=S.done,S.error=S.fail,S.complete=m.add,S.statusCode=function(e){if(e){var t;if(w<2)for(t in e)g[t]=[g[t],e[t]];else t=e[S.status],S.always(t)}return this},h.url=((e||h.url)+"").replace(Cn,"").replace(On,Nn[1]+"//"),h.dataTypes=Y.trim(h.dataType||"*").toLowerCase().split(tt),h.crossDomain==null&&(f=Pn.exec(h.url.toLowerCase()),h.crossDomain=!(!f||f[1]==Nn[1]&&f[2]==Nn[2]&& -(f[3]||(f[1]==="http:"?80:443))==(Nn[3]||(Nn[1]==="http:"?80:443)))),h.data&&h.processData&&typeof h.data!="string"&&(h.data=Y.param(h.data,h.traditional)),N(Bn,h,n,S);if(w===2)return S;l=h.global,h.type=h.type.toUpperCase(),h.hasContent=!An.test(h.type),l&&Y.active++===0&&Y.event.trigger("ajaxStart");if(!h.hasContent){h.data&&(h.url+=(Mn.test(h.url)?"&":"?")+h.data,delete h.data),i=h.url;if(h.cache===!1){var x=Y.now(),T=h.url.replace(Dn,"$1_="+x);h.url=T+(T===h.url?(Mn.test(h.url)?"&":"?")+"_="+x:"")}}(h.data&&h.hasContent&&h.contentType!==!1||n.contentType)&&S.setRequestHeader("Content-Type",h.contentType),h.ifModified&&(i=i||h.url,Y.lastModified[i]&&S.setRequestHeader("If-Modified-Since",Y.lastModified[i]),Y.etag[i]&&S.setRequestHeader("If-None-Match",Y.etag[i])),S.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+(h.dataTypes[0]!=="*"?", "+Fn+"; q=0.01":""):h.accepts["*"]);for(c in h.headers)S.setRequestHeader(c,h.headers[c]);if(!h.beforeSend|| -h.beforeSend.call(p,S,h)!==!1&&w!==2){E="abort";for(c in{success:1,error:1,complete:1})S[c](h[c]);u=N(jn,h,n,S);if(!u)r(-1,"No Transport");else{S.readyState=1,l&&d.trigger("ajaxSend",[S,h]),h.async&&h.timeout>0&&(a=setTimeout(function(){S.abort("timeout")},h.timeout));try{w=1,u.send(y,r)}catch(C){if(!(w<2))throw C;r(-1,C)}}return S}return S.abort()},active:0,lastModified:{},etag:{}});var qn=[],Rn=/\?/,Un=/(=)\?(?=&|$)|\?\?/,zn=Y.now();Y.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=qn.pop()||Y.expando+"_"+zn++;return this[e]=!0,e}}),Y.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Un.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Un.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=Y.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Un,"$1"+s):h?n.data=a.replace(Un,"$1"+s):l&&(n.url+=(Rn.test(f)?"&":"?")+n.jsonp+"="+s),n.converters -["script json"]=function(){return u||Y.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,qn.push(s)),u&&Y.isFunction(o)&&o(u[0]),u=o=t}),"script"}),Y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Y.globalEval(e),e}}}),Y.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Y.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=R.head||R.getElementsByTagName("head")[0]||R.documentElement;return{send:function(i,s){n=R.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild -(n),n=t,i||s(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Wn,Xn=e.ActiveXObject?function(){for(var e in Wn)Wn[e](0,1)}:!1,Vn=0;Y.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&A()||O()}:A,function(e){Y.extend(Y.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Y.ajaxSettings.xhr()),Y.support.ajax&&Y.ajaxTransport(function(n){if(!n.crossDomain||Y.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=Y.noop,Xn&&delete Wn[o]);if(i)a.readyState!==4&&a.abort -();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(e){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++Vn,Xn&&(Wn||(Wn={},Y(e).unload(Xn)),Wn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var $n,Jn,Kn=/^(?:toggle|show|hide)$/,Qn=new RegExp("^(?:([-+])=|)("+Z+")([a-z%]*)$","i"),Gn=/queueHooks$/,Yn=[H],Zn={"*":[function(e,t){var n,r,i,s=this.createTween(e,t),o=Qn.exec(t),u=s.cur(),a=+u||0,f=1;if(o){n=+o[2],r=o[3]||(Y.cssNumber[e]?"":"px");if(r!=="px"&&a){a=Y.css(s.elem,e,!0)||n||1;do i=f=f||".5",a/=f,Y.style(s.elem,e,a+r),f=s.cur()/u;while(f!==1&&f!==i)}s.unit=r,s.start=a,s.end=o[1]?a+(o[1]+1)*n:n}return s}]};Y.Animation=Y.extend(D,{tweener:function(e,t){Y.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),Y.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},Y.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(Y.css(e,"marginTop"))||0,n.left-=parseFloat(Y.css(e,"marginLeft"))||0,r.top+=parseFloat(Y.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(Y.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent -:function(){return this.map(function(){var e=this.offsetParent||R.body;while(e&&!er.test(e.nodeName)&&Y.css(e,"position")==="static")e=e.offsetParent;return e||R.body})}}),Y.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);Y.fn[e]=function(i){return Y.access(this,function(e,i,s){var o=F(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?Y(o).scrollLeft():s,r?s:Y(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),Y.each({Height:"height",Width:"width"},function(e,n){Y.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){Y.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return Y.access(this,function(n,r,i){var s;return Y.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?Y.css(n,r,i,u):Y.style(n,r,i,u)},n,o?i:t,o)}})} -),e.jQuery=e.$=Y,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Y})})(window),define("jquery-src",function(e){return function(){var t,n;return t||e.jQuery}}(this)),define("jquery",["jquery-src"],function(e){var t=e(window);return e.fn.place_tt=function(){var n={offset:5,css:{position:"absolute",top:-1e3,left:0,color:"#c8c8c8",padding:"10px","font-size":"11pt","font-weight":200,"background-color":"#1f1f1f","border-radius":"5px"}};return function(r,i,s){return s=e.extend(!0,{},n,s),this.each(function(){var n=e(this),o,u;n.css(s.css),e.contains(document.body,n[0])||n.appendTo(document.body),o=n.outerWidth(!0),u=n.outerHeight(!0),n.css("left",r+s.offset+o>t.width()?r-s.offset-o:r+s.offset),n.css("top",i+s.offset+u>t.height()?i-s.offset-u:i+s.offset)})}}(),e}),function(e,t,n){function g(e){return!e||typeof e.length!="number"?!1:typeof e.hasOwnProperty!="function"&&typeof e.constructor!="function"?!0:e instanceof Ht||f&&e instanceof f||h.call(e)!=="[object Object]"||typeof -e.callee=="function"}function y(e,t,n){var r;if(e)if(j(e))for(r in e)r!="prototype"&&r!="length"&&r!="name"&&e.hasOwnProperty(r)&&t.call(n,e[r],r);else if(e.forEach&&e.forEach!==y)e.forEach(t,n);else if(g(e))for(r=0;r=0&&e.splice(n,1),t}function G(e){if(e)switch(e.nodeName){case"OPTION":case"PRE":case"TITLE":return!0}return!1}function Y(e,t){if(I(e)||q(e))throw Error("Can't copy Window or Scope");if(!t)t=e,e&&(B(e)?t=Y(e,[]):H(e)?t=new Date(e.getTime()):F(e)?t=new RegExp(e.source):_(e)&&(t=Y(e,{})));else{if(e===t)throw Error("Can't copy equivalent objects or arrays");if(B(e)){t.length=0;for(var n=0;n2?nt(arguments,2):[];return!j(t)||t instanceof RegExp?t:n.length?function(){return arguments.length?t.apply(e,n.concat(l.call(arguments,0))):t.apply(e,n)}:function(){return arguments.length?t.apply(e,arguments):t.call(e)}}function it(e,r){var i=r;return/^\$+/.test(e)?i=n:I(r)?i="$WINDOW":r&&t===r?i="$DOCUMENT":q(r)&&(i="$SCOPE"),i}function st(e,t){return typeof e=="undefined"?n:JSON.stringify(e,it,t?" ":null)}function ot(e){return D(e)?JSON.parse(e):e}function ut(e){if(e&&e.length!==0){var t=r(""+e);e= -t!="f"&&t!="0"&&t!="false"&&t!="no"&&t!="n"&&t!="[]"}else e=!1;return e}function at(e){e=a(e).clone();try{e.html("")}catch(t){}var n=3,i=a("
").append(e).html();try{return e[0].nodeType===n?r(i):i.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(e,t){return"<"+r(t)})}catch(t){return r(i)}}function ft(e){try{return decodeURIComponent(e)}catch(t){}}function lt(e){var t={},n,r;return y((e||"").split("&"),function(e){e&&(n=e.split("="),r=ft(n[0]),M(r)&&(t[r]=M(n[1])?ft(n[1]):!0))}),t}function ct(e){var t=[];return y(e,function(e,n){t.push(pt(n,!0)+(e===!0?"":"="+pt(e,!0)))}),t.length?t.join("&"):""}function ht(e){return pt(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function pt(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,t?"%20":"+")}function dt(e,n){function a(e){e&&r.push(e)}var r=[e],i,s,o=["ng:app","ng-app","x-ng-app","data-ng-app"],u=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/ -;y(o,function(n){o[n]=!0,a(t.getElementById(n)),n=n.replace(":","\\:"),e.querySelectorAll&&(y(e.querySelectorAll("."+n),a),y(e.querySelectorAll("."+n+"\\:"),a),y(e.querySelectorAll("["+n+"]"),a))}),y(r,function(e){if(!i){var t=" "+e.className+" ",n=u.exec(t);n?(i=e,s=(n[2]||"").replace(/\s+/g,",")):y(e.attributes,function(t){!i&&o[t.name]&&(i=e,s=t.value)})}}),i&&n(i,s?[s]:[])}function vt(t,n){var r=function(){t=a(t),n=n||[],n.unshift(["$provide",function(e){e.value("$rootElement",t)}]),n.unshift("ng");var e=an(n);return e.invoke(["$rootScope","$rootElement","$compile","$injector",function(e,t,n,r){e.$apply(function(){t.data("$injector",r),n(t)(e)})}]),e},i=/^NG_DEFER_BOOTSTRAP!/;if(e&&!i.test(e.name))return r();e.name=e.name.replace(i,""),p.resumeBootstrap=function(e){y(e,function(e){n.push(e)}),r()}}function gt(e,t){return t=t||"_",e.replace(mt,function(e,n){return(n?t:"")+e.toLowerCase()})}function yt(){f=e.jQuery,f?(a=f,T(f.fn,{scope:Jt.scope,controller:Jt.controller,injector:Jt.injector -,inheritedData:Jt.inheritedData}),Pt("remove",!0,!0,!1),Pt("empty",!1,!1,!1),Pt("html",!1,!1,!0)):a=Ht,p.element=a}function bt(e,t,n){if(!e)throw new Error("Argument '"+(t||"?")+"' is "+(n||"required"));return e}function wt(e,t,n){return n&&B(e)&&(e=e[e.length-1]),bt(j(e),t,"not a function, got "+(e&&typeof e=="object"?e.constructor.name||"Object":typeof e)),e}function Et(e,t,n){if(!t)return e;var r=t.split("."),i,s=e,o=r.length;for(var u=0;u 
"+e,n.removeChild(n.firstChild),Xt(this,n.childNodes),this.remove()}else Xt(this,e)}function Bt(e){return e.cloneNode(!0)}function jt(e){It(e);for(var t=0,n=e.childNodes||[];t-1}function zt(e,t){t&&y(t.split(" "),function(t){e.className=z((" "+e.className+" ").replace(/[\n\t]/g," ").replace(" "+z(t)+" "," "))})}function Wt(e,t){t&&y(t.split(" "),function(t){Ut(e,t)||(e.className=z(e.className+" "+z(t)))})}function Xt(e,t){if(t){t=!t.nodeName&&M(t.length)&&!I(t)?t:[t];for(var n=0;n0){var e=unescape(u.substring(0,f));C[e]===n&&(C[e]=unescape(u.substring(f+1)))}}}return C}t===n?o.cookie= -escape(e)+"=;path="+A+";expires=Thu, 01 Jan 1970 00:00:00 GMT":D(t)&&(i=(o.cookie=escape(e)+"="+escape(t)+";path="+A).length+1,i>4096&&r.warn("Cookie '"+e+"' possibly not set or overflowed because it was too large ("+i+" > 4096 bytes)!"))},s.defer=function(e,t){var n;return p++,n=l(function(){delete h[n],v(e)},t||0),h[n]=!0,n},s.defer.cancel=function(e){return h[e]?(delete h[e],c(e),v(k),!0):!1}}function cn(){this.$get=["$window","$log","$sniffer","$document",function(e,t,n,r){return new ln(e,r,t,n)}]}function hn(){this.$get=function(){function t(t,n){function l(e){e!=a&&(f?f==e&&(f=e.n):f=e,c(e.n,e.p),c(e,a),a=e,a.n=null)}function c(e,t){e!=t&&(e&&(e.p=t),t&&(t.n=e))}if(t in e)throw Error("cacheId "+t+" taken");var r=0,i=T({},n,{id:t}),s={},o=n&&n.capacity||Number.MAX_VALUE,u={},a=null,f=null;return e[t]={put:function(e,t){var n=u[e]||(u[e]={key:e});l(n);if(O(t))return;e in s||r++,s[e]=t,r>o&&this.remove(f.key)},get:function(e){var t=u[e];if(!t)return;return l(t),s[e]},remove:function( -e){var t=u[e];if(!t)return;t==a&&(a=t.p),t==f&&(f=t.n),c(t.n,t.p),delete u[e],delete s[e],r--},removeAll:function(){s={},r=0,u={},a=f=null},destroy:function(){s=null,i=null,u=null,delete e[t]},info:function(){return T({},i,{size:r})}}}var e={};return t.info=function(){var t={};return y(e,function(e,n){t[n]=e.info()}),t},t.get=function(t){return e[t]},t}}function pn(){this.$get=["$cacheFactory",function(e){return e("templates")}]}function vn(e){var r={},i="Directive",s=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,o=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,f="Template must have exactly one root element. was: ",l=/^\s*(https?|ftp|mailto|file):/;this.directive=function c(t,n){return D(t)?(bt(n,"directive"),r.hasOwnProperty(t)||(r[t]=[],e.factory(t+i,["$injector","$exceptionHandler",function(e,n){var i=[];return y(r[t],function(r){try{var s=e.invoke(r);j(s)?s={compile:A(s)}:!s.compile&&s.link&&(s.compile=A(s.link)),s.priority=s.priority||0,s.name=s.name||t,s.require=s.require||s.controller&&s.name,s.restrict= -s.restrict||"A",i.push(s)}catch(o){n(o)}}),i}])),r[t].push(n)):y(t,E(c)),this},this.urlSanitizationWhitelist=function(e){return M(e)?(l=e,this):l},this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document",function(e,c,h,p,d,m,g,b,w){function k(e,t,n){e instanceof a||(e=a(e)),y(e,function(t,n){t.nodeType==3&&t.nodeValue.match(/\S+/)&&(e[n]=a(t).wrap("").parent()[0])});var r=P(e,t,e,n);return function(n,i){bt(n,"scope");var s=i?Jt.clone.call(e):e;for(var o=0,u=s.length;o=8||c.specified)h=c.name,p=gn(h.toLowerCase()),a[p]=h,n[p]=d=z(u&&h=="href"?decodeURIComponent(e.getAttribute(h,2)):c.value),Gt(e,p)&&(n[p]=!0),V(e,t,d,p),I(t,p,"A",r)}l=e.className;if(D(l)&&l!=="")while(f=o.exec(l))p=gn(f[2]),I(t,p,"C",r)&&(n[p]=z(f[3])),l=l.substr(f.index+f[0].length);break;case 3:X(t,e.nodeValue);break;case 8:try{f=s.exec(e.nodeValue),f&&(p=gn(f[1]), -I(t,p,"M",r)&&(n[p]=z(f[2])))}catch(b){}}return t.sort(U),t}function F(e,r,i,s,o){function X(e,t){e&&(e.require=w.require,l.push(e)),t&&(t.require=w.require,c.push(t))}function V(e,t){var n,r="data",i=!1;if(D(e)){while((n=e.charAt(0))=="^"||n=="?")e=e.substr(1),n=="^"&&(r="inheritedData"),i=i||n=="?";n=t[r]("$"+e+"Controller");if(!n&&!i)throw Error("No controller: "+e);return n}return B(e)&&(n=[],y(e,function(e){n.push(V(e,t))})),n}function J(e,t,s,o,u){var f,p,v,b,w,S;r===s?f=i:f=Z(i,new E(a(s),i.$attr)),p=f.$$element;if(d){var x=/^\s*([@=&])\s*(\w*)\s*$/,T=t.$parent||t;y(d.scope,function(e,n){var r=e.match(x)||[],i=r[2]||n,s=r[1],o,u,a;t.$$isolateBindings[n]=s+i;switch(s){case"@":f.$observe(i,function(e){t[n]=e}),f.$$observers[i].$$scope=T;break;case"=":u=m(f[i]),a=u.assign||function(){throw o=t[n]=u(T),Error(dn+f[i]+" (directive: "+d.name+")")},o=t[n]=u(T),t.$watch(function(){var r=u(T);return r!==t[n]&&(r!==o?o=t[n]=r:a(T,r=o=t[n])),r});break;case"&":u=m(f[i]),t[n]=function(e){return u -(T,e)};break;default:throw Error("Invalid isolate scope definition for directive "+d.name+": "+e)}})}L&&y(L,function(e){var n={$scope:t,$element:p,$attrs:f,$transclude:u};S=e.controller,S=="@"&&(S=f[e.name]),p.data("$"+e.name+"Controller",g(S,n))});for(v=0,b=l.length;vw.priority)break;if(O=w.scope)W("isolated scope",d,w,b),_(O)&&(M(b,"ng-isolate-scope"),d=w),M(b,"ng-scope"),p=p||w;S=w.name;if(O=w.controller)L=L||{},W("'"+S+"' controller",L[S],w,b),L[S]=w;if(O=w.transclude)W("transclusion",T,w,b),T=w,u=w.priority,O=="element"?(x=a(r),b=i.$$element=a(t.createComment(" "+S+": "+i[S]+" ")),r=b[0],$(o,a(x[0]),r),N=k(x,s,u)):(x=a(Bt(r)).contents(),b.html(""),N=k(x,s) -);if(O=w.template){W("template",v,w,b),v=w,O=C(O);if(w.replace){x=a("
"+z(O)+"
").contents(),r=x[0];if(x.length!=1||r.nodeType!==1)throw new Error(f+O);$(o,b,r);var I={$attr:{}};e=e.concat(H(r,e.splice(P+1,e.length-(P+1)),I)),q(i,I),F=e.length}else b.html(O)}if(w.templateUrl)W("template",v,w,b),v=w,J=R(e.splice(P,e.length-P),J,b,i,o,w.replace,N),F=e.length;else if(w.compile)try{A=w.compile(b,i,N),j(A)?X(null,A):A&&X(A.pre,A.post)}catch(U){h(U,at(b))}w.terminal&&(J.terminal=!0,u=Math.max(u,w.priority))}return J.scope=p&&p.scope,J.transclude=T&&N,J}function I(t,s,o,u){var a=!1;if(r.hasOwnProperty(s))for(var f,l=e.get(s+i),c=0,p=l.length;cf.priority)&&f.restrict.indexOf(o)!=-1&&(t.push(f),a=!0)}catch(d){h(d)}return a}function q(e,t){var n=t.$attr,r=e.$attr,i=e.$$element;y(e,function(r,i){i.charAt(0)!="$"&&(t[i]&&(r+=(i==="style"?";":" ")+t[i]),e.$set(i,r,!0,n[i]))}),y(t,function(t,s){s=="class"?(M(i,t),e["class"]=(e["class"]?e["class"]+" ":"")+t):s=="style"? -i.attr("style",i.attr("style")+";"+t):s.charAt(0)!="$"&&!e.hasOwnProperty(s)&&(e[s]=t,r[s]=n[s])})}function R(e,t,n,r,i,s,o){var u=[],l,c,h=n[0],v=e.shift(),m=T({},v,{controller:null,templateUrl:null,transclude:null,scope:null});return n.html(""),p.get(v.templateUrl,{cache:d}).success(function(p){var d,v,g;p=C(p);if(s){g=a("
"+z(p)+"
").contents(),d=g[0];if(g.length!=1||d.nodeType!==1)throw new Error(f+p);v={$attr:{}},$(i,n,d),H(d,e,v),q(r,v)}else d=h,n.html(p);e.unshift(m),l=F(e,d,r,o),c=P(n[0].childNodes,o);while(u.length){var y=u.pop(),b=u.pop(),w=u.pop(),E=u.pop(),S=d;w!==h&&(S=Bt(d),$(b,a(w),S)),l(function(){t(c,E,S,i,y)},E,S,i,y)}u=null}).error(function(e,t,n,r){throw Error("Failed to load template: "+r.url)}),function(n,r,i,s,o){u?(u.push(r),u.push(i),u.push(s),u.push(o)):l(function(){t(c,r,i,s,o)},r,i,s,o)}}function U(e,t){return t.priority-e.priority}function W(e,t,n,r){if(t)throw Error("Multiple directives ["+t.name+", "+n.name+"] asking for "+e+" on: "+at(r))}function X -(e,t){var n=c(t,!0);n&&e.push({priority:0,compile:A(function(t,r){var i=r.parent(),s=i.data("$binding")||[];s.push(n),M(i.data("$binding",s),"ng-binding"),t.$watch(n,function(t){r[0].nodeValue=t})})})}function V(e,t,r,i){var s=c(r,!0);if(!s)return;t.push({priority:100,compile:A(function(t,r,o){var u=o.$$observers||(o.$$observers={});i==="class"&&(s=c(o[i],!0)),o[i]=n,(u[i]||(u[i]=[])).$$inter=!0,(o.$$observers&&o.$$observers[i].$$scope||t).$watch(s,function(t){o.$set(i,t)})})})}function $(e,t,n){var r=t[0],i=r.parentNode,s,o;if(e)for(s=0,o=e.length;s0){var i=u[0],s=i.text;if(s==e||s==t||s==n||s==r||!e&&!t&&!n&&!r)return i}return!1}function m(e,n,r,i){var s=v(e,n,r,i);return s?(t&&!s.json&&p("is not valid json",s),u.shift(),s):!1}function g(e){m(e)||p("is unexpected, expecting ["+e+"]",v())}function y(e,t){return function(n,r){return e(n,r,t)}}function b(e,t,n){return function(r,i){return t(r,i,e,n)}}function w(){ -var e=[];for(;;){u.length>0&&!v("}",")",";","]")&&e.push(h());if(!m(";"))return e.length==1?e[0]:function(t,n){var r;for(var i=0;i","<=",">="))e=b(e,t.fn,M());return e}function _(){var e=D(),t;while(t=m("+","-"))e=b( -e,t.fn,D());return e}function D(){var e=P(),t;while(t=m("*","/","%"))e=b(e,t.fn,P());return e}function P(){var e;return m("+")?H():(e=m("-"))?b(s,e.fn,P()):(e=m("!"))?y(e.fn,P()):H()}function H(){var e;if(m("("))e=h(),g(")");else if(m("["))e=I();else if(m("{"))e=q();else{var t=m();e=t.fn,e||p("not a primary expression",t)}var n,r;while(n=m("(","[","."))n.text==="("?(e=f(e,r),r=null):n.text==="["?(r=e,e=c(e)):n.text==="."?(r=e,e=l(e)):p("IMPOSSIBLE");return e}function B(e){var t=m().text,n=Kn(t,i);return T(function(t,r,i){return n(i||e(t,r),r)},{assign:function(n,r,i){return Vn(e(n,i),t,r)}})}function j(e){var t=x();return g("]"),T(function(r,i){var s=e(r,i),o=t(r,i),u,a;return s?(u=s[o],u&&u.then&&(a=u,"$$v"in u||(a.$$v=n,a.then(function(e){a.$$v=e})),u=u.$$v),u):n},{assign:function(n,r,i){return e(n,i)[t(n,i)]=r}})}function F(e,t){var n=[];if(d().text!=")")do n.push(x());while(m(","));return g(")"),function(r,i){var s=[],o=t?t(r,i):r;for(var u=0;u1;i++){var s=r.shift(),o=e[s];o||(o={},e[s]=o),e=o}return e[r.shift()]=n,n}function Jn(e,t,r,i,s){return function(o,u){var a=u&&u.hasOwnProperty(e)?u:o,f;return a===null||a===n?a:(a=a[e],a&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!t||a===null||a===n?a:(a=a[t],a&&a.then&& -("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!r||a===null||a===n?a:(a=a[r],a&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!i||a===null||a===n?a:(a=a[i],a&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),!s||a===null||a===n?a:(a=a[s],a&&a.then&&("$$v"in a||(f=a,f.$$v=n,f.then(function(e){f.$$v=e})),a=a.$$v),a)))))}}function Kn(e,t){if($n.hasOwnProperty(e))return $n[e];var r=e.split("."),i=r.length,s;if(t)s=i<6?Jn(r[0],r[1],r[2],r[3],r[4]):function(e,t){var s=0,o;do o=Jn(r[s++],r[s++],r[s++],r[s++],r[s++])(e,t),t=n,e=o;while(s7),hasEvent:function(n){if(n=="input"&&u==9)return!1;if(O(t[n])){var r=e.document.createElement("div");t[n]="on"+n in r}return t[n]},csp:!1}}]}function rr(){this.$get=A(e)}function ir(e){var t={},n,i,s;return e?(y(e.split("\n"),function(e){s=e.indexOf(":"),n=r(z(e.substr(0,s))),i=z(e.substr(s+1)),n&&(t[n]?t[n]+=", "+i:t[n]=i)}),t):t}function sr(e){var t=_(e)?e:n;return function(n){return t||(t=ir(e)), -n?t[r(n)]||null:t}}function or(e,t,n){return j(n)?n(e,t):(y(n,function(n){e=n(e,t)}),e)}function ur(e){return 200<=e&&e<300}function ar(){var e=/^\s*(\[|\{[^\{])/,t=/[\}\]]\s*$/,s=/^\)\]\}',?\n/,o=this.defaults={transformResponse:[function(n){return D(n)&&(n=n.replace(s,""),e.test(n)&&t.test(n)&&(n=ot(n,!0))),n}],transformRequest:[function(e){return _(e)&&!R(e)?st(e):e}],headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}}},u=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(e,t,s,a,f,l){function p(e){function b(e){var t=T({},e,{data:or(e.data,e.headers,s)});return ur(e.status)?t:f.reject(t)}e.method=i(e.method);var n=e.transformRequest||o.transformRequest,s=e.transformResponse||o.transformResponse,u=T({},e.headers),a=T({"X-XSRF-TOKEN":t.cookies()["XSRF-TOKEN"]},o.headers -.common,o.headers[r(e.method)]),l,c,p,d,v;e:for(c in a){p=r(c);for(d in e.headers)if(r(d)===p)continue e;u[c]=a[c]}if(O(e.data))for(var g in u)if(r(g)==="content-type"){delete u[g];break}return l=or(e.data,sr(u),n),v=m(e,l,u),v=v.then(b,b),y(h,function(e){v=e(v)}),v.success=function(t){return v.then(function(n){t(n.data,n.status,n.headers,e)}),v},v.error=function(t){return v.then(null,function(n){t(n.data,n.status,n.headers,e)}),v},v}function d(e){y(arguments,function(e){p[e]=function(t,n){return p(T(n||{},{method:e,url:t}))}})}function v(e){y(arguments,function(e){p[e]=function(t,n,r){return p(T(r||{},{method:e,url:t,data:n}))}})}function m(t,n,r){function h(e,t,n){o&&(ur(e)?o.put(l,[e,t,ir(n)]):o.remove(l)),d(t,e,n),a.$apply()}function d(e,n,r){n=Math.max(n,0),(ur(n)?i.resolve:i.reject)({data:e,status:n,headers:sr(r),config:t})}function v(){var e=K(p.pendingRequests,t);e!==-1&&p.pendingRequests.splice(e,1)}var i=f.defer(),s=i.promise,o,u,l=g(t.url,t.params);p.pendingRequests.push(t),s -.then(v,v),t.cache&&t.method=="GET"&&(o=_(t.cache)?t.cache:c);if(o){u=o.get(l);if(u){if(u.then)return u.then(v,v),u;B(u)?d(u[1],u[0],Y(u[2])):d(u,200,{})}else o.put(l,s)}return u||e(t.method,l,n,h,r,t.timeout,t.withCredentials),s}function g(e,t){if(!t)return e;var r=[];return w(t,function(e,t){if(e==null||e==n)return;_(e)&&(e=st(e)),r.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}),e+(e.indexOf("?")==-1?"?":"&")+r.join("&")}var c=s("$http"),h=[];return y(u,function(e){h.push(D(e)?l.get(e):l.invoke(e))}),p.pendingRequests=[],d("get","delete","head","jsonp"),v("post","put"),p.defaults=o,p}]}function lr(){this.$get=["$browser","$window","$document",function(e,t,n){return cr(e,fr,e.defer,t.angular.callbacks,n[0],t.location.protocol.replace(":",""))}]}function cr(e,t,n,i,s,o){function a(e,t){var n=s.createElement("script"),r=function(){s.body.removeChild(n),t&&t()};n.type="text/javascript",n.src=e,u?n.onreadystatechange=function(){/loaded|complete/.test(n.readyState)&&r()}:n.onload=n -.onerror=r,s.body.appendChild(n)}return function(s,u,f,l,c,h,p){function g(t,n,r,i){var s=(u.match(Tn)||["",o])[1];n=s=="file"?r?200:404:n,n=n==1223?204:n,t(n,r,i),e.$$completeOutstandingRequest(k)}e.$$incOutstandingRequestCount(),u=u||e.url();if(r(s)=="jsonp"){var d="_"+(i.counter++).toString(36);i[d]=function(e){i[d].data=e},a(u.replace("JSON_CALLBACK","angular.callbacks."+d),function(){i[d].data?g(l,200,i[d].data):g(l,-2),delete i[d]})}else{var v=new t;v.open(s,u,!0),y(c,function(e,t){e&&v.setRequestHeader(t,e)});var m;v.onreadystatechange=function(){if(v.readyState==4){var e=v.getAllResponseHeaders(),t,n=["Cache-Control","Content-Language","Content-Type","Expires","Last-Modified","Pragma"];e||(e="",y(n,function(t){var n=v.getResponseHeader(t);n&&(e+=t+": "+n+"\n")})),g(l,m||v.status,v.responseText,e)}},p&&(v.withCredentials=!0),v.send(f||""),h>0&&n(function(){m=-1,v.abort()},h)}}}function hr(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS -:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(e){return e===1?"one":"other"}}}}function pr(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(e,t,n,r){function s(s,o,u){var a=n.defer(),f=a.promise,l=M(u)&&!u,c,h;return c=t.defer(function(){try{a.resolve(s())}catch(t){a.reject(t),r(t)} -finally{delete i[f.$$timeoutId]}l||e.$apply()},o),f.$$timeoutId=c,i[c]=a,f}var i={};return s.cancel=function(e){return e&&e.$$timeoutId in i?(i[e.$$timeoutId].reject("canceled"),delete i[e.$$timeoutId],t.defer.cancel(e.$$timeoutId)):!1},s}]}function dr(e){function n(n,r){return e.factory(n+t,r)}var t="Filter";this.register=n,this.$get=["$injector",function(e){return function(n){return e.get(n+t)}}],n("currency",mr),n("date",Lr),n("filter",vr),n("json",Ar),n("limitTo",_r),n("lowercase",Or),n("number",gr),n("orderBy",Dr),n("uppercase",Mr)}function vr(){return function(e,t){if(!B(e))return e;var n=[];n.check=function(e){for(var t=0;t-1;case"object":for(var n in e)if(n.charAt(0)!=="$"&&r(e[n],t))return!0;return!1;case"array":for(var i=0;ii+1?o="0":(u=o,f=!0)}if(!f){var c=(o.split(yr)[1]||"").length;O(i)&&(i=Math.min(Math.max(t.minFrac -,c),t.maxFrac));var h=Math.pow(10,i);e=Math.round(e*h)/h;var p=(""+e).split(yr),d=p[0];p=p[1]||"";var v=0,m=t.lgSize,g=t.gSize;if(d.length>=m+g){v=d.length-m;for(var y=0;y0&&e>-1&&e<1&&(u=e.toFixed(i));return a.push(s?t.negPre:t.posPre),a.push(u),a.push(s?t.negSuf:t.posSuf),a.join("")}function wr(e,t,n){var r="";e<0&&(r="-",e=-e),e=""+e;while(e.length0||s>-n)s+=n;return s===0&&n==-12&&(s=12),wr(s,t,r)}}function Sr(e,t){return function(n,r){var s=n["get"+e](),o=i(t?"SHORT"+e:e);return r[o][s]}}function xr(e){var t=-1*e.getTimezoneOffset(),n=t>=0?"+":"";return n+=wr(Math[t>0?"floor":"ceil"](t/60),2)+wr(Math.abs(t%60),2),n}function Tr(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}function Lr -(e){function n(e){var n;if(n=e.match(t)){var r=new Date(0),i=0,s=0;return n[9]&&(i=N(n[9]+n[10]),s=N(n[9]+n[11])),r.setUTCFullYear(N(n[1]),N(n[2])-1,N(n[3])),r.setUTCHours(N(n[4]||0)-i,N(n[5]||0)-s,N(n[6]||0),N(n[7]||0)),r}return e}var t=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(t,r){var i="",s=[],o,u;r=r||"mediumDate",r=e.DATETIME_FORMATS[r]||r,D(t)&&(kr.test(t)?t=N(t):t=n(t)),P(t)&&(t=new Date(t));if(!H(t))return t;while(r)u=Cr.exec(r),u?(s=tt(s,u,1),r=s.pop()):(s.push(r),r=null);return y(s,function(n){o=Nr[n],i+=o?o(t,e.DATETIME_FORMATS):n.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),i}}function Ar(){return function(e){return st(e,!0)}}function _r(){return function(e,t){if(e instanceof Array){t=N(t);var n=[],r,i;if(!!e&&e instanceof Array){t>e.length?t=e.length:t<-e.length&&(t=-e.length),t>0?(r=0,i=t):(r=e.length+t,i=e.length);for(;rv?(i.$setValidity("maxlength",!1),n):(i.$setValidity("maxlength",!0),e)};i.$parsers.push(m),i.$formatters.push(m)}}function Jr(e,t,r,i,s,o){$r(e,t,r,i,s,o),i.$parsers.push(function(e){var t=Vr(e);return t||Wr.test(e)?(i.$setValidity("number",!0),e===""?null:t?e:parseFloat(e)):(i.$setValidity("number",!1),n)}),i.$formatters.push(function(e){return Vr(e)?"" -:""+e});if(r.min){var u=parseFloat(r.min),a=function(e){return!Vr(e)&&ef?(i.$setValidity("max",!1),n):(i.$setValidity("max",!0),e)};i.$parsers.push(l),i.$formatters.push(l)}i.$formatters.push(function(e){return Vr(e)||P(e)?(i.$setValidity("number",!0),e):(i.$setValidity("number",!1),n)})}function Kr(e,t,r,i,s,o){$r(e,t,r,i,s,o);var u=function(e){return Vr(e)||Ur.test(e)?(i.$setValidity("url",!0),e):(i.$setValidity("url",!1),n)};i.$formatters.push(u),i.$parsers.push(u)}function Qr(e,t,r,i,s,o){$r(e,t,r,i,s,o);var u=function(e){return Vr(e)||zr.test(e)?(i.$setValidity("email",!0),e):(i.$setValidity("email",!1),n)};i.$formatters.push(u),i.$parsers.push(u)}function Gr(e,t,n,r){O(n.name)&&t.attr("name",S()),t.bind("click",function(){t[0].checked&&e.$apply(function(){r.$setViewValue(n.value)})}),r.$render=function(){var e=n.value -;t[0].checked=e==r.$viewValue},n.$observe("value",r.$render)}function Yr(e,t,n,r){var i=n.ngTrueValue,s=n.ngFalseValue;D(i)||(i=!0),D(s)||(s=!1),t.bind("click",function(){e.$apply(function(){r.$setViewValue(t[0].checked)})}),r.$render=function(){t[0].checked=r.$viewValue},r.$formatters.push(function(e){return e===i}),r.$parsers.push(function(e){return e?i:s})}function di(e,t){return e="ngClass"+e,Pr(function(r,i,s){function u(e){if(t===!0||r.$index%2===t)o&&!et(e,o)&&a(o),f(e);o=Y(e)}function a(e){_(e)&&!B(e)&&(e=V(e,function(e,t){if(e)return t})),i.removeClass(B(e)?e.join(" "):e)}function f(e){_(e)&&!B(e)&&(e=V(e,function(e,t){if(e)return t})),e&&i.addClass(B(e)?e.join(" "):e)}var o=n;r.$watch(s[e],u,!0),s.$observe("class",function(t){var n=r.$eval(s[e]);u(n,n)}),e!=="ngClass"&&r.$watch("$index",function(n,i){var o=n&1;o!==i&1&&(o===t?f(r.$eval(s[e])):a(r.$eval(s[e])))})})}var r=function(e){return D(e)?e.toLowerCase():e},i=function(e){return D(e)?e.toUpperCase():e},s=function(e){return D -(e)?e.replace(/[A-Z]/g,function(e){return String.fromCharCode(e.charCodeAt(0)|32)}):e},o=function(e){return D(e)?e.replace(/[a-z]/g,function(e){return String.fromCharCode(e.charCodeAt(0)&-33)}):e};"i"!=="I".toLowerCase()&&(r=s,i=o);var u=N((/msie (\d+)/.exec(r(navigator.userAgent))||[])[1]),a,f,l=[].slice,c=[].push,h=Object.prototype.toString,p=e.angular||(e.angular={}),d,v,m=["0","0","0"];k.$inject=[],L.$inject=[];var z=function(){return String.prototype.trim?function(e){return D(e)?e.trim():e}:function(e){return D(e)?e.replace(/^\s*/,"").replace(/\s*$/,""):e}}();u<9?v=function(e){return e=e.nodeName?e:e[0],e.scopeName&&e.scopeName!="HTML"?i(e.scopeName+":"+e.nodeName):e.nodeName}:v=function(e){return e.nodeName?e.nodeName:e[0].nodeName};var mt=/[A-Z]/g,xt={full:"1.0.8",major:1,minor:0,dot:8,codeName:"bubble-burst"},Nt=Ht.cache={},Ct=Ht.expando="ng-"+(new Date).getTime(),kt=1,Lt=e.document.addEventListener?function(e,t,n){e.addEventListener(t,n,!1)}:function(e,t,n){e.attachEvent("on"+t -,n)},At=e.document.removeEventListener?function(e,t,n){e.removeEventListener(t,n,!1)}:function(e,t,n){e.detachEvent("on"+t,n)},Mt=/([\:\-\_]+(.))/g,_t=/^moz([A-Z])/,Jt=Ht.prototype={ready:function(t){function r(){if(n)return;n=!0,t()}var n=!1;this.bind("DOMContentLoaded",r),Ht(e).bind("load",r)},toString:function(){var e=[];return y(this,function(t){e.push(""+t)}),"["+e.join(", ")+"]"},eq:function(e){return e>=0?a(this[e]):a(this[this.length+e])},length:0,push:c,sort:[].sort,splice:[].splice},Kt={};y("multiple,selected,checked,disabled,readOnly,required".split(","),function(e){Kt[r(e)]=e});var Qt={};y("input,select,option,textarea,button,form".split(","),function(e){Qt[i(e)]=!0}),y({data:Rt,inheritedData:$t,scope:function(e){return $t(e,"$scope")},controller:Vt,injector:function(e){return $t(e,"$injector")},removeAttr:function(e,t){e.removeAttribute(t)},hasClass:Ut,css:function(e,t,r){t=Dt(t);if(!M(r)){var i;return u<=8&&(i=e.currentStyle&&e.currentStyle[t],i===""&&(i="auto")),i=i||e.style -[t],u<=8&&(i=i===""?n:i),i}e.style[t]=r},attr:function(e,t,i){var s=r(t);if(Kt[s]){if(!M(i))return e[t]||(e.attributes.getNamedItem(t)||k).specified?s:n;i?(e[t]=!0,e.setAttribute(t,s)):(e[t]=!1,e.removeAttribute(s))}else if(M(i))e.setAttribute(t,i);else if(e.getAttribute){var o=e.getAttribute(t,2);return o===null?n:o}},prop:function(e,t,n){if(!M(n))return e[t];e[t]=n},text:T(u<9?function(e,t){if(e.nodeType==1){if(O(t))return e.innerText;e.innerText=t}else{if(O(t))return e.nodeValue;e.nodeValue=t}}:function(e,t){if(O(t))return e.textContent;e.textContent=t},{$dv:""}),val:function(e,t){if(O(t)){if(v(e)==="SELECT"&&e.multiple){var n=[];return y(e.options,function(e){e.selected&&n.push(e.value||e.text)}),n.length===0?null:n}return e.value}e.value=t},html:function(e,t){if(O(t))return e.innerHTML;for(var n=0,r=e.childNodes;n":function(e,t,n,r){return n(e,t)>r(e,t)},"<=":function(e,t,n,r){return n(e,t)<=r(e,t)},">=":function(e,t,n,r){return n(e,t)>=r(e,t)},"&&":function(e,t,n,r){return n(e,t)&&r(e,t)},"||":function(e,t,n,r){return n(e,t)||r(e,t)},"&":function(e,t,n,r){return n(e,t)&r(e,t)},"|":function(e,t,n,r){return r(e,t)(e,t,n(e,t))},"!":function(e,t,n){return!n(e,t)}},zn={n:"\n",f:"\f",r:"\r",t:" ",v:" ","'":"'",'"':'"'},$n={},fr=e.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(n){}throw new Error("This browser does not support XMLHttpRequest.")};dr.$inject=["$provide"],mr.$inject=["$locale"],gr.$inject=["$locale"];var yr=".",Nr={yyyy:Er("FullYear",4), -yy:Er("FullYear",2,0,!0),y:Er("FullYear",1),MMMM:Sr("Month"),MMM:Sr("Month",!0),MM:Er("Month",2,1),M:Er("Month",1,1),dd:Er("Date",2),d:Er("Date",1),HH:Er("Hours",2),H:Er("Hours",1),hh:Er("Hours",2,-12),h:Er("Hours",1,-12),mm:Er("Minutes",2),m:Er("Minutes",1),ss:Er("Seconds",2),s:Er("Seconds",1),EEEE:Sr("Day"),EEE:Sr("Day",!0),a:Tr,Z:xr},Cr=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,kr=/^\d+$/;Lr.$inject=["$locale"];var Or=A(r),Mr=A(i);Dr.$inject=["$parse"];var Hr=A({restrict:"E",compile:function(e,n){return u<=8&&(!n.href&&!n.name&&n.$set("href",""),e.append(t.createComment("IE fix"))),function(e,t){t.bind("click",function(e){t.attr("href")||e.preventDefault()})}}}),Br={};y(Kt,function(e,t){var n=gn("ng-"+t);Br[n]=function(){return{priority:100,compile:function(){return function(e,r,i){e.$watch(i[n],function(n){i.$set(t,!!n)})}}}}}),y(["src","href"],function(e){var t=gn("ng-"+e);Br[t]=function(){return{priority:99,link:function(n,r,i){i.$observe(t,function( -t){if(!t)return;i.$set(e,t),u&&r.prop(e,i[e])})}}}});var jr={$addControl:k,$removeControl:k,$setValidity:k,$setDirty:k};Fr.$inject=["$element","$attrs","$scope"];var Ir=function(e){return["$timeout",function(t){var r={name:"form",restrict:"E",controller:Fr,compile:function(){return{pre:function(e,r,i,s){if(!i.action){var o=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1};Lt(r[0],"submit",o),r.bind("$destroy",function(){t(function(){At(r[0],"submit",o)},0,!1)})}var u=r.parent().controller("form"),a=i.name||i.ngForm;a&&(e[a]=s),u&&r.bind("$destroy",function(){u.$removeControl(s),a&&(e[a]=n),T(s,jr)})}}}};return e?T(Y(r),{restrict:"EAC"}):r}]},qr=Ir(),Rr=Ir(!0),Ur=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,zr=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}$/,Wr=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Xr={text:$r,number:Jr,url:Kr,email:Qr,radio:Gr,checkbox:Yr,hidden:k,button:k,submit:k,reset:k},Zr=["$browser","$sniffer",function(e,t -){return{restrict:"E",require:"?ngModel",link:function(n,i,s,o){o&&(Xr[r(s.type)]||Xr.text)(n,i,s,o,t,e)}}}],ei="ng-valid",ti="ng-invalid",ni="ng-pristine",ri="ng-dirty",ii=["$scope","$exceptionHandler","$attrs","$element","$parse",function(e,t,n,r,i){function l(e,t){t=t?"-"+gt(t,"-"):"",r.removeClass((e?ti:ei)+t).addClass((e?ei:ti)+t)}this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$name=n.name;var s=i(n.ngModel),o=s.assign;if(!o)throw Error(dn+n.ngModel+" ("+at(r)+")");this.$render=k;var u=r.inheritedData("$formController")||jr,a=0,f=this.$error={};r.addClass(ni),l(!0),this.$setValidity=function(e,t){if(f[e]===!t)return;t?(f[e]&&a--,a||(l(!0),this.$valid=!0,this.$invalid=!1)):(l(!1),this.$invalid=!0,this.$valid=!1,a++),f[e]=!t,l(t,e),u.$setValidity(e,t,this)},this.$setViewValue=function(n){this.$viewValue=n,this.$pristine&&(this.$dirty=!0,this. -$pristine=!1,r.removeClass(ni).addClass(ri),u.$setDirty()),y(this.$parsers,function(e){n=e(n)}),this.$modelValue!==n&&(this.$modelValue=n,o(e,n),y(this.$viewChangeListeners,function(e){try{e()}catch(n){t(n)}}))};var c=this;e.$watch(function(){var n=s(e);if(c.$modelValue!==n){var r=c.$formatters,i=r.length;c.$modelValue=n;while(i--)n=r[i](n);c.$viewValue!==n&&(c.$viewValue=n,c.$render())}})}],si=function(){return{require:["ngModel","^?form"],controller:ii,link:function(e,t,n,r){var i=r[0],s=r[1]||jr;s.$addControl(i),t.bind("$destroy",function(){s.$removeControl(i)})}}},oi=A({require:"ngModel",link:function(e,t,n,r){r.$viewChangeListeners.push(function(){e.$eval(n.ngChange)})}}),ui=function(){return{require:"?ngModel",link:function(e,t,n,r){if(!r)return;n.required=!0;var i=function(e){if(n.required&&(Vr(e)||e===!1)){r.$setValidity("required",!1);return}return r.$setValidity("required",!0),e};r.$formatters.push(i),r.$parsers.unshift(i),n.$observe("required",function(){i(r.$viewValue)})}}}, -ai=function(){return{require:"ngModel",link:function(e,t,r,i){var s=/\/(.*)\//.exec(r.ngList),o=s&&new RegExp(s[1])||r.ngList||",",u=function(e){var t=[];return e&&y(e.split(o),function(e){e&&t.push(z(e))}),t};i.$parsers.push(u),i.$formatters.push(function(e){return B(e)?e.join(", "):n})}}},fi=/^(true|false|\d+)$/,li=function(){return{priority:100,compile:function(e,t){return fi.test(t.ngValue)?function(e,t,n){n.$set("value",e.$eval(n.ngValue))}:function(e,t,n){e.$watch(n.ngValue,function(t){n.$set("value",t)})}}}},ci=Pr(function(e,t,r){t.addClass("ng-binding").data("$binding",r.ngBind),e.$watch(r.ngBind,function(r){t.text(r==n?"":r)})}),hi=["$interpolate",function(e){return function(t,n,r){var i=e(n.attr(r.$attr.ngBindTemplate));n.addClass("ng-binding").data("$binding",i),r.$observe("ngBindTemplate",function(e){n.text(e)})}}],pi=[function(){return function(e,t,n){t.addClass("ng-binding").data("$binding",n.ngBindHtmlUnsafe),e.$watch(n.ngBindHtmlUnsafe,function(n){t.html(n||"")})}}],vi=di -("",!0),mi=di("Odd",0),gi=di("Even",1),yi=Pr({compile:function(e,t){t.$set("ngCloak",n),e.removeClass("ng-cloak")}}),bi=[function(){return{scope:!0,controller:"@"}}],wi=["$sniffer",function(e){return{priority:1e3,compile:function(){e.csp=!0}}}],Ei={};y("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave submit".split(" "),function(e){var t=gn("ng-"+e);Ei[t]=["$parse",function(n){return function(i,s,o){var u=n(o[t]);s.bind(r(e),function(e){i.$apply(function(){u(i,{$event:e})})})}}]});var Si=["$http","$templateCache","$anchorScroll","$compile",function(e,t,n,r){return{restrict:"ECA",terminal:!0,compile:function(i,s){var o=s.ngInclude||s.src,u=s.onload||"",a=s.autoscroll;return function(i,s){var f=0,l,c=function(){l&&(l.$destroy(),l=null),s.html("")};i.$watch(o,function(h){var p=++f;h?e.get(h,{cache:t}).success(function(e){if(p!==f)return;l&&l.$destroy(),l=i.$new(),s.html(e),r(s.contents())(l),M(a)&&(!a||i.$eval(a))&&n(),l.$emit("$includeContentLoaded"),i.$eval -(u)}).error(function(){p===f&&c()}):c()})}}}}],xi=Pr({compile:function(){return{pre:function(e,t,n){e.$eval(n.ngInit)}}}}),Ti=Pr({terminal:!0,priority:1e3}),Ni=["$locale","$interpolate",function(e,t){var n=/{}/g;return{restrict:"EA",link:function(r,i,s){var o=s.count,u=i.attr(s.$attr.when),a=s.offset||0,f=r.$eval(u),l={},c=t.startSymbol(),h=t.endSymbol();y(f,function(e,r){l[r]=t(e.replace(n,c+o+"-"+a+h))}),r.$watch(function(){var n=parseFloat(r.$eval(o));return isNaN(n)?"":(n in f||(n=e.pluralCat(n-a)),l[n](r,i,!0))},function(t){i.text(t)})}}}],Ci=Pr({transclude:"element",priority:1e3,terminal:!0,compile:function(e,t,n){return function(e,t,r){var i=r.ngRepeat,s=i.match(/^\s*(.+)\s+in\s+(.*)\s*$/),o,u,a,f;if(!s)throw Error("Expected ngRepeat in form of '_item_ in _collection_' but got '"+i+"'.");o=s[1],u=s[2],s=o.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!s)throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '"+o+"'.");a=s[3]||s[1],f=s -[2];var l=new tn;e.$watch(function(r){var i,s,o=r.$eval(u),c=t,h=new tn,p,d,v,m,g,y;if(!B(o)){g=[];for(v in o)o.hasOwnProperty(v)&&v.charAt(0)!="$"&&g.push(v);g.sort()}else g=o||[];p=g.length-1;for(i=0,s=g.length;iO)S.pop().element.remove()}while(w.length>A)w.pop()[0].element.remove()}var u;if(!(u=p.match(i)))throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+ -p+"'.");var a=r(u[2]||u[1]),f=u[4]||u[6],l=u[5],c=r(u[3]||""),v=r(u[2]?u[1]:f),y=r(u[7]),w=[[{element:s,label:""}]];d&&(e(d)(t),d.removeClass("ng-scope"),d.remove()),s.html(""),s.bind("change",function(){t.$apply(function(){var e,r=y(t)||[],i={},u,a,c,p,d,m,g;if(h){a=[];for(d=0,g=w.length;d@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none !important;}ng\\:form{display:block;}'),define("angular",["jquery"],function(e){return function(){var t,n;return t||e.angular}}(this)),function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype -,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.5.1";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind -(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r) -{t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math -.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or||n===void 0)return 1;if(n>>1;n.call(r,e[u])=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=x.max(x.pluck(arguments,"length").concat(0)),t=new Array(e);for(var n=0;n=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t},x.values=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push(e[n]);return t},x.pairs=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push([n,e[n]]);return t},x.invert=function(e){var t={};for(var n in e)x.has(e,n)&&(t[e[n]]=n);return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments -,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;var o=e.constructor,u=t.constructor;if(o!==u&&!(x.isFunction(o)&&o instanceof o&&x.isFunction(u)&&u instanceof u))return!1;n -.push(e),r.push(t);var a=0,l=!0;if(i=="[object Array]"){a=e.length,l=a==t.length;if(l)while(a--)if(!(l=M(e[a],t[a],n,r)))break}else{for(var c in e)if(x.has(e,c)){a++;if(!(l=x.has(t,c)&&M(e[c],t[c],n,r)))break}if(l){for(c in t)if(x.has(t,c)&&!(a--))break;l=!a}}return n.pop(),r.pop(),l};x.isEqual=function(e,t){return M(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN= -function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(Math.max(0,e));for(var i=0;i":">",'"':""","'":"'","/":"/"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions -(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+ -o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore-src",function(){}),define("underscore",["underscore-src"],function(){var e=window._;return e.mixin({move:function(e,t,n){return e.splice(n,0,e.splice(t,1)[0]),e},remove:function(e -,t){return e.splice(t,1),e},toggleInOut:function(t,n){return e.contains(t,n)?t=e.without(t,n):t.push(n),t}}),e}),function(){var e=this,t=e&&e.ejs,n=Array.prototype,r=Object.prototype,i=n.slice,s=r.toString,o=r.hasOwnProperty,u=n.forEach,a=Array.isArray,f={},l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O;typeof exports!="undefined"?O=exports:O=e.ejs={},l=function(e,t){return o.call(e,t)},c=function(e,t,n){if(e==null)return;if(u&&e.forEach===u)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r0&&(t=t+"/"+n.join()),r.length>0&&(t=t+"/"+r.join()),e.length>0&&e[0]!=="/"&&(t+="/"),t+=e -;for(var o in i){if(!l(i,o)||i[o]==="")continue;s.push(o+"="+encodeURIComponent(i[o]))}return s.length>0&&(t=t+"?"+s.join("&")),t};return t={},e=e||{},e.indices==null?n=[]:v(e.indices)?n=[e.indices]:n=e.indices,e.types==null?r=[]:v(e.types)?r=[e.types]:r=e.types,n.length===0&&r.length>0&&(n=["_all"]),e.routing!=null&&(i.routing=e.routing),{sort:function(){var e,n;l(t,"sort")||(t.sort=[]);if(arguments.length===0)return t.sort;if(arguments.length===1){var r=arguments[0];if(v(r))t.sort.push(r);else if(C(r))t.sort.push(r._self());else{if(!p(r))throw new TypeError("Argument must be string, Sort, or array");t.sort=[];for(e=0,n=r.length;e0&&(n=["_all"]),this},types:function(e){if(e==null)return r;if(v(e))r=[e];else{if(!p(e))throw new TypeError("Argument must be a string or array");r=e}return n.length===0&&r.length>0&&(n=["_all"]),this},facet:function(e){if(e==null)return t.facets;t.facets==null&&(t.facets={});if(!E(e))throw new TypeError("Argument must be a Facet");return h(t.facets,e._self()),this},filter:function(e){if(e==null)return t.filter;if(!w(e))throw new TypeError("Argument must be a Filter");return t.filter=e._self(),this},highlight:function(e){if(e==null)return t.highlight;if(!k(e))throw new TypeError("Argument must be a Highlight object");return t.highlight=e._self(),this},suggest:function(e){if(e==null)return t.suggest;t.suggest==null&& -(t.suggest={});if(v(e))t.suggest.text=e;else{if(!L(e))throw new TypeError("Argument must be a string or Suggest object");h(t.suggest,e._self())}return this},scriptField:function(e){if(e==null)return t.script_fields;t.script_fields==null&&(t.script_fields={});if(!S(e))throw new TypeError("Argument must be a ScriptField");return h(t.script_fields,e._self()),this},preference:function(e){return e==null?i.preference:(i.preference=e,this)},ignoreIndices:function(e){if(e==null)return i.ignore_indices;e=e.toLowerCase();if(e==="none"||e==="missing")i.ignore_indices=e;return this},indexBoost:function(e,n){return t.indices_boost==null&&(t.indices_boost={}),arguments.length===0?t.indices_boost:(t.indices_boost[e]=n,this)},explain:function(e){return e==null?t.explain:(t.explain=e,this)},version:function(e){return e==null?t.version:(t.version=e,this)},minScore:function(e){return e==null?t.min_score:(t.min_score=e,this)},toString:function(){return JSON.stringify(t)},_type:function(){return"request"},_self -:function(){return t},doDeleteByQuery:function(e,n){var r=JSON.stringify(t.query);if(O.client==null)throw new Error("No Client Set");return O.client.del(s("_query"),r,e,n)},doCount:function(e,n){var r=JSON.stringify(t.query);if(O.client==null)throw new Error("No Client Set");return O.client.post(s("_count"),r,e,n)},doSearch:function(e,n){var r=JSON.stringify(t);if(O.client==null)throw new Error("No Client Set");return O.client.post(s("_search"),r,e,n)}}},O.ScriptField=function(e){var t={};return t[e]={},{lang:function(n){return n==null?t[e].lang:(t[e].lang=n,this)},script:function(n){return n==null?t[e].script:(t[e].script=n,this)},params:function(n){return n==null?t[e].params:(t[e].params=n,this)},ignoreFailure:function(n){return n==null?t[e].ignore_failure:(t[e].ignore_failure=n,this)},toString:function(){return JSON.stringify(t)},_type:function(){return"script field"},_self:function(){return t}}},O.Shape=function(e,t){var n={},r=function(e){var t=!1;if(e==="point"||e==="linestring"|| -e==="polygon"||e==="multipoint"||e==="envelope"||e==="multipolygon")t=!0;return t};return e=e.toLowerCase(),r(e)&&(n.type=e,n.coordinates=t),{type:function(e){return e==null?n.type:(e=e.toLowerCase(),r(e)&&(n.type=e),this)},coordinates:function(e){return e==null?n.coordinates:(n.coordinates=e,this)},toString:function(){return JSON.stringify(n)},_type:function(){return"shape"},_self:function(){return n}}},O.Sort=function(e){e==null&&(e="_score");var t={},n=e,r="_geo_distance",i="_script";return t[n]={},{field:function(r){var i=t[n];return r==null?e:(delete t[n],e=r,n=r,t[n]=i,this)},geoDistance:function(i){var s=t[n];if(i==null)return t[n][e];if(!x(i))throw new TypeError("Argument must be a GeoPoint");return delete t[n],n=r,t[n]=s,t[n][e]=i._self(),this},script:function(e){var r=t[n];return e==null?t[n].script:(delete t[n],n=i,t[n]=r,t[n].script=e,this)},order:function(e){if(e==null)return t[n].order;e=e.toLowerCase();if(e==="asc"||e==="desc")t[n].order=e;return this},asc:function(){return t -[n].order="asc",this},desc:function(){return t[n].order="desc",this},reverse:function(e){return e==null?t[n].reverse:(t[n].reverse=e,this)},missing:function(e){return e==null?t[n].missing:(t[n].missing=e,this)},ignoreUnmapped:function(e){return e==null?t[n].ignore_unmapped:(t[n].ignore_unmapped=e,this)},unit:function(e){if(e==null)return t[n].unit;e=e.toLowerCase();if(e==="mi"||e==="km")t[n].unit=e;return this},normalize:function(e){return e==null?t[n].normalize:(t[n].normalize=e,this)},distanceType:function(e){if(e==null)return t[n].distance_type;e=e.toLowerCase();if(e==="arc"||e==="plane")t[n].distance_type=e;return this},params:function(e){return e==null?t[n].params:(t[n].params=e,this)},lang:function(e){return e==null?t[n].lang:(t[n].lang=e,this)},type:function(e){if(e==null)return t[n].type;e=e.toLowerCase();if(e==="string"||e==="number")t[n].type=e;return this},mode:function(e){if(e==null)return t[n].mode;e=e.toLowerCase();if(e==="min"||e==="max"||e==="sum"||e==="avg")t[n].mode=e; -return this},nestedPath:function(e){return e==null?t[n].nested_path:(t[n].nested_path=e,this)},nestedFilter:function(e){if(e==null)return t[n].nested_filter;if(!w(e))throw new TypeError("Argument must be a Filter");return t[n].nested_filter=e._self(),this},toString:function(){return JSON.stringify(t)},_type:function(){return"sort"},_self:function(){return t}}},O.DirectGenerator=function(){var e=O.DirectSettingsMixin(),t=e._self();return h(e,{preFilter:function(e){return e==null?t.pre_filter:(t.pre_filter=e,this)},postFilter:function(e){return e==null?t.post_filter:(t.post_filter=e,this)},field:function(e){return e==null?t.field:(t.field=e,this)},size:function(e){return e==null?t.size:(t.size=e,this)},toString:function(){return JSON.stringify(t)},_type:function(){return"generator"},_self:function(){return t}})},O.DirectSettingsMixin=function(){var e={};return{accuracy:function(t){return t==null?e.accuracy:(e.accuracy=t,this)},suggestMode:function(t){if(t==null)return e.suggest_mode;t=t.toLowerCase -();if(t==="missing"||t==="popular"||t==="always")e.suggest_mode=t;return this},sort:function(t){if(t==null)return e.sort;t=t.toLowerCase();if(t==="score"||t==="frequency")e.sort=t;return this},stringDistance:function(t){if(t==null)return e.string_distance;t=t.toLowerCase();if(t==="internal"||t==="damerau_levenshtein"||t==="levenstein"||t==="jarowinkler"||t==="ngram")e.string_distance=t;return this},maxEdits:function(t){return t==null?e.max_edits:(e.max_edits=t,this)},maxInspections:function(t){return t==null?e.max_inspections:(e.max_inspections=t,this)},maxTermFreq:function(t){return t==null?e.max_term_freq:(e.max_term_freq=t,this)},prefixLength:function(t){return t==null?e.prefix_length:(e.prefix_length=t,this)},minWordLen:function(t){return t==null?e.min_word_len:(e.min_word_len=t,this)},minDocFreq:function(t){return t==null?e.min_doc_freq:(e.min_doc_freq=t,this)},_self:function(){return e}}},O.PhraseSuggester=function(e){var t={};return t[e]={phrase:{}},{text:function(n){return n==null? -t[e].text:(t[e].text=n,this)},analyzer:function(n){return n==null?t[e].phrase.analyzer:(t[e].phrase.analyzer=n,this)},field:function(n){return n==null?t[e].phrase.field:(t[e].phrase.field=n,this)},size:function(n){return n==null?t[e].phrase.size:(t[e].phrase.size=n,this)},shardSize:function(n){return n==null?t[e].phrase.shard_size:(t[e].phrase.shard_size=n,this)},realWorldErrorLikelihood:function(n){return n==null?t[e].phrase.real_world_error_likelihood:(t[e].phrase.real_world_error_likelihood=n,this)},confidence:function(n){return n==null?t[e].phrase.confidence:(t[e].phrase.confidence=n,this)},separator:function(n){return n==null?t[e].phrase.separator:(t[e].phrase.separator=n,this)},maxErrors:function(n){return n==null?t[e].phrase.max_errors:(t[e].phrase.max_errors=n,this)},gramSize:function(n){return n==null?t[e].phrase.gram_size:(t[e].phrase.gram_size=n,this)},forceUnigrams:function(n){return n==null?t[e].phrase.force_unigrams:(t[e].phrase.force_unigrams=n,this)},linearSmoothing:function( -n,r,i){return arguments.length===0?t[e].phrase.smoothing:(t[e].phrase.smoothing={linear:{trigram_lambda:n,bigram_lambda:r,unigram_lambda:i}},this)},laplaceSmoothing:function(n){return n==null?t[e].phrase.smoothing:(t[e].phrase.smoothing={laplace:{alpha:n}},this)},stupidBackoffSmoothing:function(n){return n==null?t[e].phrase.smoothing:(t[e].phrase.smoothing={stupid_backoff:{discount:n}},this)},directGenerator:function(n){var r,i;t[e].phrase.direct_generator==null&&(t[e].phrase.direct_generator=[]);if(n==null)return t[e].phrase.direct_generator;if(A(n))t[e].phrase.direct_generator.push(n._self());else{if(!p(n))throw new TypeError("Argument must be a Generator or array of Generators");t[e].phrase.direct_generator=[];for(r=0,i=n.length;rthis.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval -,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn -.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor: -t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset -(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse -(s)})}(window.jQuery),!function(e){function r(){e(".dropdown-backdrop").remove(),e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||("ontouchstart"in document.documentElement&&e('
'+(this.showSeconds?'':"")+(this.showMeridian?'':"")+""+""+" "+''+" "+(this.showSeconds?'":"")+(this.showMeridian?'":"")+""+""+''+''+''+ -(this.showSeconds?'':"")+(this.showMeridian?'':"")+""+"
   
"+t+":"+n+":'+r+" '+i+"
  
";switch(this.template){case"modal":e='";break;case"dropdown":e='"}return e},getTime:function(){return this.formatTime(this.hour,this.minute,this.second,this.meridian)},hideWidget:function(){if(this.isOpen===!1)return;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}}),this.template==="modal"?this.$widget.modal("hide"):this.$widget.removeClass("open"),e(n).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 e=this.$element.get(0);this.highlightedUnit="hour",e.setSelectionRange&&setTimeout(function(){e.setSelectionRange(0,2)},0)},highlightMinute:function(){var e=this.$element.get(0);this.highlightedUnit="minute",e.setSelectionRange&&setTimeout(function(){e.setSelectionRange(3,5)},0)},highlightSecond:function(){var e=this.$element.get(0);this.highlightedUnit="second",e.setSelectionRange&&setTimeout(function(){e.setSelectionRange(6,8)},0)},highlightMeridian:function(){var e=this.$element.get(0);this.highlightedUnit="meridian",e.setSelectionRange&&(this.showSeconds?setTimeout(function(){e.setSelectionRange(9,11)},0):setTimeout(function(){e.setSelectionRange(6,8)},0))},incrementHour:function(){if(this.showMeridian){if(this.hour===11 -)return this.hour++,this.toggleMeridian();this.hour===12&&(this.hour=0)}if(this.hour===23){this.hour=0;return}this.hour++,this.update()},incrementMinute:function(e){var t;e?t=this.minute+e:t=this.minute+this.minuteStep-this.minute%this.minuteStep,t>59?(this.incrementHour(),this.minute=t-60):this.minute=t,this.update()},incrementSecond:function(){var e=this.second+this.secondStep-this.second%this.secondStep;e>59?(this.incrementMinute(!0),this.second=e-60):this.second=e,this.update()},remove:function(){e("document").off(".timepicker"),this.$widget&&this.$widget.remove(),delete this.$element.data().timepicker},setDefaultTime:function(e){if(!this.$element.val())if(e==="current"){var t=new Date,n=t.getHours(),r=Math.floor(t.getMinutes()/this.minuteStep)*this.minuteStep,i=Math.floor(t.getSeconds()/this.secondStep)*this.secondStep,s="AM";this.showMeridian&&(n===0?n=12:n>=12?(n>12&&(n-=12),s="PM"):s="AM"),this.hour=n,this.minute=r,this.second=i,this.meridian=s,this.update()}else e===!1?(this.hour=0 -,this.minute=0,this.second=0,this.meridian="AM"):this.setTime(e);else this.updateFromElementVal()},setTime:function(e){var t,n;this.showMeridian?(t=e.split(" "),n=t[0].split(":"),this.meridian=t[1]):n=e.split(":"),this.hour=parseInt(n[0],10),this.minute=parseInt(n[1],10),this.second=parseInt(n[2],10),isNaN(this.hour)&&(this.hour=0),isNaN(this.minute)&&(this.minute=0);if(this.showMeridian){this.hour>12?this.hour=12:this.hour<1&&(this.hour=12);if(this.meridian==="am"||this.meridian==="a")this.meridian="AM";else if(this.meridian==="pm"||this.meridian==="p")this.meridian="PM";this.meridian!=="AM"&&this.meridian!=="PM"&&(this.meridian="AM")}else 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)return;if(this.$element.is(":disabled"))return;var t=this;e(n).on("mousedown.timepicker" -,function(n){e(n.target).closest(".bootstrap-timepicker-widget").length===0&&t.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(),this.template==="modal"?this.$widget.modal("show").on("hidden",e.proxy(this.hideWidget,this)):this.isOpen===!1&&this.$widget.addClass("open"),this.isOpen=!0},toggleMeridian:function(){this.meridian=this.meridian==="AM"?"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 e=this.$element.val();e&&this.setTime(e)},updateWidget:function(){if(this.$widget===!1)return;var e=this.hour<10?"0"+ -this.hour:this.hour,t=this.minute<10?"0"+this.minute:this.minute,n=this.second<10?"0"+this.second:this.second;this.showInputs?(this.$widget.find("input.bootstrap-timepicker-hour").val(e),this.$widget.find("input.bootstrap-timepicker-minute").val(t),this.showSeconds&&this.$widget.find("input.bootstrap-timepicker-second").val(n),this.showMeridian&&this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)):(this.$widget.find("span.bootstrap-timepicker-hour").text(e),this.$widget.find("span.bootstrap-timepicker-minute").text(t),this.showSeconds&&this.$widget.find("span.bootstrap-timepicker-second").text(n),this.showMeridian&&this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian))},updateFromWidgetInputs:function(){if(this.$widget===!1)return;var t=e("input.bootstrap-timepicker-hour",this.$widget).val()+":"+e("input.bootstrap-timepicker-minute",this.$widget).val()+(this.showSeconds?":"+e("input.bootstrap-timepicker-second",this.$widget).val():"")+(this. -showMeridian?" "+e("input.bootstrap-timepicker-meridian",this.$widget).val():"");this.setTime(t)},widgetClick:function(t){t.stopPropagation(),t.preventDefault();var n=e(t.target).closest("a").data("action");n&&this[n]()},widgetKeydown:function(t){var n=e(t.target).closest("input"),r=n.attr("name");switch(t.keyCode){case 9:if(this.showMeridian){if(r==="meridian")return this.hideWidget()}else if(this.showSeconds){if(r==="second")return this.hideWidget()}else if(r==="minute")return this.hideWidget();this.updateFromWidgetInputs();break;case 27:this.hideWidget();break;case 38:t.preventDefault();switch(r){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian()}break;case 40:t.preventDefault();switch(r){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian()}}}},e.fn.timepicker=function(t){var n= -Array.apply(null,arguments);return n.shift(),this.each(function(){var r=e(this),s=r.data("timepicker"),o=typeof t=="object"&&t;s||r.data("timepicker",s=new i(this,e.extend({},e.fn.timepicker.defaults,o,e(this).data()))),typeof t=="string"&&s[t].apply(s,n)})},e.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"},e.fn.timepicker.Constructor=i}(jQuery,window,document),define("timepicker",function(){}),!function(e){function t(){return new Date(Date.UTC.apply(Date,arguments))}function n(){var e=new Date;return t(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}var r=function(t,n){var r=this;this.element=e(t),this.language=n.language||this.element.data("date-language")||"en",this.language=this.language in i?this.language:this.language.split("-")[0],this.language=this.language in i?this.language:"en",this.isRTL=i[this.language -].rtl||!1,this.format=s.parseFormat(n.format||this.element.data("date-format")||i[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&&this.component.length===0&&(this.component=!1),this.forceParse=!0,"forceParse"in n?this.forceParse=n.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),this.picker=e(s.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 n?this.autoclose=n.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this -.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in n?this.keyboardNavigation=n.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.viewMode=this.startViewMode=0;switch(n.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}this.minViewMode=n.minViewMode||this.element.data("date-min-view-mode")||0;if(typeof this.minViewMode=="string")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=n.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=n.todayHighlight||this.element.data("date-today-highlight")||!1,this.calendarWeeks=!1,"calendarWeeks"in n?this.calendarWeeks=n.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(e,t){return parseInt(t)+1}),this._allow_update=!1,this.weekStart=(n.weekStart||this.element.data("date-weekstart")||i[this.language].weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-Infinity,this.endDate=Infinity,this.daysOfWeekDisabled=[],this.setStartDate(n.startDate||this.element.data("date-startdate")),this.setEndDate(n.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(n.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()};r.prototype={constructor:r,_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var t=0,n,r;tthis.endDate?this.viewDate=new Date(this.endDate):this.viewDate=new Date(this.date),this.fill()},fillDow: -function(){var e=this.weekStart,t="";if(this.calendarWeeks){var n=' ';t+=n,this.picker.find(".datepicker-days thead tr:first-child").prepend(n)}while(e'+i[this.language].daysMin[e++%7]+"";t+="",this.picker.find(".datepicker-days thead").append(t)},fillMonths:function(){var e="",t=0;while(t<12)e+=''+i[this.language].monthsShort[t++]+"";this.picker.find(".datepicker-months td").html(e)},fill:function(){var n=new Date(this.viewDate),r=n.getUTCFullYear(),o=n.getUTCMonth(),u=this.startDate!==-Infinity?this.startDate.getUTCFullYear():-Infinity,a=this.startDate!==-Infinity?this.startDate.getUTCMonth():-Infinity,f=this.endDate!==Infinity?this.endDate.getUTCFullYear():Infinity,l=this.endDate!==Infinity?this.endDate.getUTCMonth():Infinity,c=this.date&&this.date.valueOf(),h=new Date;this.picker.find(".datepicker-days thead th.switch").text(i[this.language].months[o]+" "+r),this.picker.find("tfoot th.today" -).text(i[this.language].today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var p=t(r,o-1,28,0,0,0,0),d=s.getDaysInMonth(p.getUTCFullYear(),p.getUTCMonth());p.setUTCDate(d),p.setUTCDate(d-(p.getUTCDay()-this.weekStart+7)%7);var v=new Date(p);v.setUTCDate(v.getUTCDate()+42),v=v.valueOf();var m=[],g;while(p.valueOf()");if(this.calendarWeeks){var y=new Date(+p+(this.weekStart-p.getUTCDay()-7)%7*864e5),b=new Date(+y+(11-y.getUTCDay())%7*864e5),w=new Date(+(w=t(b.getUTCFullYear(),0,1))+(11-w.getUTCDay())%7*864e5),E=(b-w)/864e5/7+1;m.push(''+E+"")}}g="";if(p.getUTCFullYear()r||p.getUTCFullYear()==r&&p.getUTCMonth()>o)g+=" new";this.todayHighlight&&p.getUTCFullYear()==h.getFullYear()&&p.getUTCMonth()==h.getMonth()&&p.getUTCDate()==h.getDate()&&(g+=" today"),c&&p.valueOf()==c&&(g+=" active");if(p.valueOf()this.endDate||e.inArray(p.getUTCDay(),this.daysOfWeekDisabled)!==-1)g+=" disabled";m.push(''+p.getUTCDate()+""),p.getUTCDay()==this.weekEnd&&m.push(""),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(m.join(""));var S=this.date&&this.date.getUTCFullYear(),x=this.picker.find(".datepicker-months").find("th:eq(1)").text(r).end().find("span").removeClass("active");S&&S==r&&x.eq(this.date.getUTCMonth()).addClass("active"),(rf)&&x.addClass("disabled"),r==u&&x.slice(0,a).addClass("disabled"),r==f&&x.slice(l+1).addClass("disabled"),m="",r=parseInt(r/10,10)*10;var T=this.picker.find(".datepicker-years").find("th:eq(1)").text(r+"-"+(r+9)).end().find("td");r-=1;for(var N=-1;N<11;N++)m+='f?" disabled":"")+'">'+r+"",r+=1;T.html(m)},updateNavArrows:function(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear -(),n=e.getUTCMonth();switch(this.viewMode){case 0:this.startDate!==-Infinity&&t<=this.startDate.getUTCFullYear()&&n<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==Infinity&&t>=this.endDate.getUTCFullYear()&&n>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.startDate!==-Infinity&&t<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==Infinity&&t>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},click:function(n){n.preventDefault();var r=e(n.target).closest("span, td, th");if(r.length==1)switch(r[0].nodeName.toLowerCase()){case"th":switch(r[0].className){case"switch":this.showMode(1);break; -case"prev":case"next":var i=s.modes[this.viewMode].navStep*(r[0].className=="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,i);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,i)}this.fill();break;case"today":var o=new Date;o=t(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0),this.showMode(-2);var u=this.todayBtn=="linked"?null:"view";this._setDate(o,u)}break;case"span":if(!r.is(".disabled")){this.viewDate.setUTCDate(1);if(r.is(".month")){var a=1,f=r.parent().find("span").index(r),l=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(f),this.element.trigger({type:"changeMonth",date:this.viewDate}),this.minViewMode==1&&this._setDate(t(l,f,a,0,0,0,0))}else{var l=parseInt(r.text(),10)||0,a=1,f=0;this.viewDate.setUTCFullYear(l),this.element.trigger({type:"changeYear",date:this.viewDate}),this.minViewMode==2&&this._setDate(t(l,f,a,0,0,0,0))}this.showMode(-1),this.fill()}break;case"td":if(r.is(".day")&&!r.is(".disabled")){var a=parseInt(r. -text(),10)||1,l=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth();r.is(".old")?f===0?(f=11,l-=1):f-=1:r.is(".new")&&(f==11?(f=0,l+=1):f+=1),this._setDate(t(l,f,a,0,0,0,0))}}},_setDate:function(e,t){if(!t||t=="date")this.date=e;if(!t||t=="view")this.viewDate=e;this.fill(),this.setValue(),this.element.trigger({type:"changeDate",date:this.date});var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&(n.change(),this.autoclose&&(!t||t=="date")&&this.hide())},moveMonth:function(e,t){if(!t)return e;var n=new Date(e.valueOf()),r=n.getUTCDate(),i=n.getUTCMonth(),s=Math.abs(t),o,u;t=t>0?1:-1;if(s==1){u=t==-1?function(){return n.getUTCMonth()==i}:function(){return n.getUTCMonth()!=o},o=i+t,n.setUTCMonth(o);if(o<0||o>11)o=(o+12)%12}else{for(var a=0;a=this.startDate&&e<=this.endDate},keydown:function(e){if(this.picker.is(":not(:visible)")){e.keyCode==27&&this.show();return}var t=!1,n,r,i,s,o;switch(e.keyCode){case 27:this.hide(),e.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;n=e.keyCode==37?-1:1,e.ctrlKey?(s=this.moveYear(this.date,n),o=this.moveYear(this.viewDate,n)):e.shiftKey?(s=this.moveMonth(this.date,n),o=this.moveMonth(this.viewDate,n)):(s=new Date(this.date),s.setUTCDate(this.date.getUTCDate()+n),o=new Date(this.viewDate),o.setUTCDate(this.viewDate.getUTCDate()+n)),this.dateWithinRange(s)&&(this.date=s,this.viewDate=o,this.setValue(),this.update(),e.preventDefault(),t=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;n=e.keyCode==38?-1:1,e.ctrlKey?(s=this.moveYear(this.date,n),o=this.moveYear(this.viewDate,n)):e.shiftKey?(s=this.moveMonth(this.date,n),o=this.moveMonth(this.viewDate,n)):(s=new Date(this.date),s.setUTCDate(this.date.getUTCDate()+n*7),o=new -Date(this.viewDate),o.setUTCDate(this.viewDate.getUTCDate()+n*7)),this.dateWithinRange(s)&&(this.date=s,this.viewDate=o,this.setValue(),this.update(),e.preventDefault(),t=!0);break;case 13:this.hide(),e.preventDefault();break;case 9:this.hide()}if(t){this.element.trigger({type:"changeDate",date:this.date});var u;this.isInput?u=this.element:this.component&&(u=this.element.find("input")),u&&u.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".datepicker-"+s.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}},e.fn.datepicker=function(t){var n=Array.apply(null,arguments);return n.shift(),this.each(function(){var i=e(this),s=i.data("datepicker"),o=typeof t=="object"&&t;s||i.data("datepicker",s=new r(this,e.extend({},e.fn.datepicker.defaults,o))),typeof t=="string"&&typeof s[t]=="function"&&s[t].apply(s,n)})},e.fn.datepicker.defaults={},e.fn.datepicker.Constructor=r;var i= -e.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"}},s={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},getDaysInMonth:function(e,t){return[31,s.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||n.length===0)throw new Error("Invalid date format." -);return{separators:t,parts:n}},parseDate:function(n,s,o){if(n instanceof Date)return n;if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(n)){var u=/([\-+]\d+)([dmwy])/,a=n.match(/([\-+]\d+)([dmwy])/g),f,l;n=new Date;for(var c=0;c',contTemplate:'',footTemplate:''};s.template='
'+s.headTemplate+""+s.footTemplate+"
"+"
"+'
'+''+s.headTemplate+s.contTemplate+s.footTemplate+"
"+"
"+'
'+''+s.headTemplate+s.contTemplate+s.footTemplate+"
"+"
"+"
",e.fn.datepicker.DPGlobal=s}(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(e,t,n){return{restrict:"A",link:function(i,s,o){var u=e(o.bsAlert),a=u.assign,f=u(i),l=function(n){t(function(){s.alert("close")},n*1)};o.bsAlert?i.$watch(o.bsAlert,function(e,t){f=e,s.html((e.title?""+e.title+" ":"")+e.content||""),!e.closed||s.hide(),n(s.contents())(i);if(e.type||t.type)t.type&&s.removeClass("alert-"+t.type),e.type&&s.addClass("alert-"+e.type);angular.isDefined(e.closeAfter)?l(e.closeAfter):o.closeAfter&&l(o.closeAfter),(angular.isUndefined(o.closeButton)||o.closeButton!=="0"&&o.closeButton!=="false")&&s.prepend('')},!0):((angular.isUndefined(o.closeButton)||o.closeButton!=="0"&&o.closeButton!=="false")&&s.prepend('' -),o.closeAfter&&l(o.closeAfter)),s.addClass("alert").alert(),s.hasClass("fade")&&(s.removeClass("in"),setTimeout(function(){s.addClass("in")}));var c=o.ngRepeat&&o.ngRepeat.split(" in ").pop();s.on("close",function(e){var t;c?(e.preventDefault(),s.removeClass("in"),t=function(){s.trigger("closed"),i.$parent&&i.$parent.$apply(function(){var e=c.split("."),t=i.$parent;for(var n=0;na.length-2?a[0]:a[l+1],n.$apply(function(){r.text(c),s&&s.$setViewValue(c)})})}}}]),angular.module("$strap.directives").directive("bsDatepicker",["$timeout","$strapConfig" -,function(e,t){var n=/(iP(a|o)d|iPhone)/g.test(navigator.userAgent),r=function(t){return t=t||"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[t].days.join("|")+")",D:"(?:"+$.fn.datepicker.dates[t].daysShort.join("|")+")",MM:"(?:"+$.fn.datepicker.dates[t].months.join("|")+")",M:"(?:"+$.fn.datepicker.dates[t].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]])"}},i=function(t,n){var i=t,s=r(n),o;return o=0,angular.forEach(s,function(e,t){i=i.split(t).join("${"+o+"}"),o++}),o=0,angular.forEach(s,function(e,t){i=i.split("${"+o+"}").join(e),o++}),new RegExp("^"+i+"$",["i"])};return{restrict:"A",require:"?ngModel",link:function(r,s,o,u){var a=angular.extend({autoclose:!0},t.datepicker||{}),f=o.dateType||a.type||"date";angular.forEach( -["format","weekStart","calendarWeeks","startDate","endDate","daysOfWeekDisabled","autoclose","startView","minViewMode","todayBtn","todayHighlight","keyboardNavigation","language","forceParse"],function(e){angular.isDefined(o[e])&&(a[e]=o[e])});var l=a.language||"en",c=o.dateFormat||a.format||$.fn.datepicker.dates[l]&&$.fn.datepicker.dates[l].format||"mm/dd/yyyy",h=n?"yyyy-mm-dd":c,p=i(h,l);u&&(u.$formatters.unshift(function(e){return f==="date"&&angular.isString(e)&&e?$.fn.datepicker.DPGlobal.parseDate(e,$.fn.datepicker.DPGlobal.parseFormat(c),l):e}),u.$parsers.unshift(function(e){return e?f==="date"&&angular.isDate(e)?(u.$setValidity("date",!0),e):angular.isString(e)&&p.test(e)?(u.$setValidity("date",!0),n?new Date(e):f==="string"?e:$.fn.datepicker.DPGlobal.parseDate(e,$.fn.datepicker.DPGlobal.parseFormat(h),l)):(u.$setValidity("date",!1),undefined):(u.$setValidity("date",!0),null)}),u.$render=function(){if(n){var t=u.$viewValue?$.fn.datepicker.DPGlobal.formatDate(u.$viewValue,$.fn.datepicker -.DPGlobal.parseFormat(h),l):"";return s.val(t),t}return u.$viewValue||s.val(""),s.datepicker("update",u.$viewValue)}),n?s.prop("type","date").css("-webkit-appearance","textfield"):(u&&s.on("changeDate",function(e){r.$apply(function(){u.$setViewValue(f==="string"?s.val():e.date)})}),s.datepicker(angular.extend(a,{format:h,language:l})),r.$on("$destroy",function(){var e=s.data("datepicker");e&&(e.picker.remove(),s.data("datepicker",null))}),o.$observe("startDate",function(e){s.datepicker("setStartDate",e)}),o.$observe("endDate",function(e){s.datepicker("setEndDate",e)}));var d=s.siblings('[data-toggle="datepicker"]');d.length&&d.on("click",function(){s.prop("disabled")||s.trigger("focus")})}}}]),angular.module("$strap.directives").directive("bsDropdown",["$parse","$compile","$timeout",function(e,t,n){var r=function(e,t){return t||(t=['"]),angular.forEach(e,function(e,n){if(e.divider)return t.splice(n+1,0,'
  • ' -);var i=""+'"+(e.text||"")+"";e.submenu&&e.submenu.length&&(i+=r(e.submenu).join("\n")),i+="",t.splice(n+1,0,i)}),t};return{restrict:"EA",scope:!0,link:function(s,o,u){var a=e(u.bsDropdown),f=a(s);n(function(){!angular.isArray(f);var e=angular.element(r(f).join(""));e.insertAfter(o),t(o.next("ul.dropdown-menu"))(s)}),o.addClass("dropdown-toggle").attr("data-toggle","dropdown")}}}]),angular.module("$strap.directives").factory("$modal",["$rootScope","$compile","$http","$timeout","$q","$templateCache","$strapConfig",function(e,t,n,r,i,s,o){var u=function(a){function f(u){var a=angular.extend({show:!0},o.modal,u),f=a.scope?a.scope:e.$new(),l=a.template;return i.when(s.get(l)||n.get(l,{cache:!0}).then(function(e){return e.data})).then(function(n){ -var i=l.replace(".html","").replace(/[\/|\.|:]/g,"-")+"-"+f.$id,s=$('').attr("id",i).addClass("fade").html(n);return a.modalClass&&s.addClass(a.modalClass),$("body").append(s),r(function(){t(s)(f)}),f.$modal=function(e){s.modal(e)},angular.forEach(["show","hide"],function(e){f[e]=function(){s.modal(e)}}),f.dismiss=f.hide,angular.forEach(["show","shown","hide","hidden"],function(e){s.on(e,function(t){f.$emit("modal-"+e,t)})}),s.on("shown",function(e){$("input[autofocus], textarea[autofocus]",s).first().trigger("focus")}),s.on("hidden",function(e){a.persist||f.$destroy()}),f.$on("$destroy",function(){s.remove()}),s.modal(a),s})}return new f(a)};return u}]).directive("bsModal",["$q","$modal",function(e,t){return{restrict:"A",scope:!0,link:function(r,i,s,o){var u={template:r.$eval(s.bsModal),persist:!0,show:!1,scope:r};angular.forEach(["modalClass","backdrop","keyboard"],function(e){angular.isDefined(s[e])&&(u[e]=s[e])}),e.when(t(u)).then(function( -t){i.attr("data-target","#"+t.attr("id")).attr("data-toggle","modal")})}}}]),angular.module("$strap.directives").directive("bsNavbar",["$location",function(e){return{restrict:"A",link:function(n,r,i,s){n.$watch(function(){return e.path()},function(e,t){$("li[data-match-route]",r).each(function(t,n){var r=angular.element(n),i=r.attr("data-match-route"),s=new RegExp("^"+i+"$",["i"]);s.test(e)?r.addClass("active").find(".collapse.in").collapse("hide"):r.removeClass("active")})})}}}]),angular.module("$strap.directives").directive("bsPopover",["$parse","$compile","$http","$timeout","$q","$templateCache",function(e,t,n,r,i,s){return $("body").on("keyup",function(e){e.keyCode===27&&$(".popover.in").each(function(){$(this).popover("hide")})}),{restrict:"A",scope:!0,link:function(u,a,f,l){var c=e(f.bsPopover),h=c.assign,p=c(u),d={};angular.isObject(p)&&(d=p),i.when(d.content||s.get(p)||n.get(p,{cache:!0})).then(function(n){angular.isObject(n)&&(n=n.data),!f.unique||a.on("show",function(e){$(".popover.in" -).each(function(){var e=$(this),t=e.data("popover");t&&!t.$element.is(a)&&e.popover("hide")})}),!f.hide||u.$watch(f.hide,function(e,t){e?i.hide():e!==t&&i.show()}),!f.show||u.$watch(f.show,function(e,t){e?r(function(){i.show()}):e!==t&&i.hide()}),a.popover(angular.extend({},d,{content:n,html:!0}));var i=a.data("popover");i.hasContent=function(){return this.getTitle()||n},i.getPosition=function(){var e=$.fn.popover.Constructor.prototype.getPosition.apply(this,arguments);return t(this.$tip)(u),u.$digest(),this.$tip.data("popover",this),e},u.$popover=function(e){i(e)},angular.forEach(["show","hide"],function(e){u[e]=function(){i[e]()}}),u.dismiss=u.hide,angular.forEach(["show","shown","hide","hidden"],function(e){a.on(e,function(t){u.$emit("popover-"+e,t)})})})}}}]),angular.module("$strap.directives").directive("bsSelect",["$timeout",function(e){var t=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/ -;return{restrict:"A",require:"?ngModel",link:function(n,r,i,s){var o=n.$eval(i.bsSelect)||{};e(function(){r.selectpicker(o),r.next().removeClass("ng-scope")}),s&&n.$watch(i.ngModel,function(e,t){angular.equals(e,t)||r.selectpicker("refresh")})}}}]),angular.module("$strap.directives").directive("bsTabs",["$parse","$compile","$timeout",function(e,t,n){var r='
    ';return{restrict:"A",require:"?ngModel",priority:0,scope:!0,template:r,replace:!0,transclude:!0,compile:function(r,i,s){return function(r,i,s,o){var u=e(s.bsTabs),a=u.assign,f=u(r);r.panes=[];var l=i.find("ul.nav-tabs"),c=i.find("div.tab-content"),h=0,p,d,v;n(function(){c.find("[data-title], [data-tab]").each(function(e){var t=angular.element(this);p="tab-"+r.$id+"-"+e,d=t.data("title")|| -t.data("tab"),v=!v&&t.hasClass("active"),t.attr("id",p).addClass("tab-pane"),s.fade&&t.addClass("fade"),r.panes.push({id:p,title:d,content:this.innerHTML,active:v})}),r.panes.length&&!v&&(c.find(".tab-pane:first-child").addClass("active"+(s.fade?" in":"")),r.panes[0].active=!0)}),o&&(i.on("show",function(e){var t=$(e.target);r.$apply(function(){o.$setViewValue(t.data("index"))})}),r.$watch(s.ngModel,function(e,t){if(angular.isUndefined(e))return;h=e,setTimeout(function(){var t=$(l[0].querySelectorAll("li")[e*1]);t.hasClass("active")||t.children("a").tab("show")})}))}}}}]),angular.module("$strap.directives").directive("bsTimepicker",["$timeout","$strapConfig",function(e,t){var n="((?:(?:[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(i,s,o,u){if(u){s.on("changeTime.timepicker",function(t){e(function(){u.$setViewValue(s.val())})});var a=new RegExp("^"+n+"$",["i"]);u.$parsers.unshift(function( -e){if(!e||a.test(e))return u.$setValidity("time",!0),e;u.$setValidity("time",!1);return})}s.attr("data-toggle","timepicker"),s.parent().addClass("bootstrap-timepicker"),s.timepicker(t.timepicker||{});var f=s.data("timepicker"),l=s.siblings('[data-toggle="timepicker"]');l.length&&l.on("click",$.proxy(f.showWidget,f))}}}]),angular.module("$strap.directives").directive("bsTooltip",["$parse","$compile",function(e,t){return{restrict:"A",scope:!0,link:function(n,r,i,s){var o=e(i.bsTooltip),u=o.assign,a=o(n);n.$watch(i.bsTooltip,function(e,t){e!==t&&(a=e)}),!i.unique||r.on("show",function(e){$(".tooltip.in").each(function(){var e=$(this),t=e.data("tooltip");t&&!t.$element.is(r)&&e.tooltip("hide")})}),r.tooltip({title:function(){return angular.isFunction(a)?a.apply(null,arguments):a},html:!0});var f=r.data("tooltip");f.show=function(){var e=$.fn.tooltip.Constructor.prototype.show.apply(this,arguments);return this.tip().data("tooltip",this),e},n._tooltip=function(e){r.tooltip(e)},n.hide=function( -){r.tooltip("hide")},n.show=function(){r.tooltip("show")},n.dismiss=n.hide}}}]),angular.module("$strap.directives").directive("bsTypeahead",["$parse",function(e){return{restrict:"A",require:"?ngModel",link:function(n,r,i,s){var o=e(i.bsTypeahead),u=o.assign,a=o(n);n.$watch(i.bsTypeahead,function(e,t){e!==t&&(a=e)}),r.attr("data-provide","typeahead"),r.typeahead({source:function(e){return angular.isFunction(a)?a.apply(null,arguments):a},minLength:i.minLength||1,items:i.items,updater:function(e){return s&&n.$apply(function(){s.$setViewValue(e)}),n.$emit("typeahead-updated",e),e}});var f=r.data("typeahead");f.lookup=function(e){var t;return this.query=this.$element.val()||"",this.query.length0&&n(function(){r.list=t.without(r.list,a)},u)},this.clear=function(e){r.list=t.without(r.list,e)},this.clearAll=function(){r.list=[]}}])}),window.Modernizr=function(e,t,n){function r(e){g.cssText=e}function i(e,t){return r(E.join(e+";")+(t||""))}function s(e,t){return typeof e===t}function o(e,t){return!!~(""+e).indexOf(t)}function u(e,t){for(var r in e){var i=e[r];if(!o(i,"-")&&g[i]!==n)return t=="pfx"?i:!0}return!1}function a(e,t,r){for(var i in e){var o=t[e[i]];if(o!==n)return r===!1?e[i]:s(o,"function")?o.bind(r||t):o}return!1}function f(e,t,n){var r=e.charAt(0).toUpperCase()+e.slice(1),i=(e+" "+x.join(r+" ")+r).split(" ");return s(t,"string")||s(t,"undefined")?u(i,t):(i=(e+" "+T.join(r+" ")+r).split(" "),a(i,t,n))}function l(){h.input=function(n){for(var r=0,i=n.length;r',e,""].join(""),a.id=v,(f?a:l).innerHTML+=s,l.appendChild(a),f||(l.style.background="",d.appendChild(l)),o=n(a,e),f?a.parentNode.removeChild(a):l.parentNode.removeChild(l),!!o},D=function(t){var n=e.matchMedia||e.msMatchMedia;if(n)return n(t).matches;var r;return _("@media "+t+" { #"+v+" { position: absolute; } }",function(t){r=(e.getComputedStyle?getComputedStyle(t,null):t.currentStyle)["position"]=="absolute"}),r},P=function(){function e(e,i){i=i||t.createElement(r[e]||"div"),e="on"+e;var o=e in i;return o||(i.setAttribute||(i=t.createElement("div")),i.setAttribute&&i.removeAttribute&&(i.setAttribute(e,""),o=s(i[e],"function"),s(i[e],"undefined")||(i[e]=n),i.removeAttribute(e))),i=null,o}var r={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return e}(),H={}.hasOwnProperty,B;!s(H,"undefined")&&!s -(H.call,"undefined")?B=function(e,t){return H.call(e,t)}:B=function(e,t){return t in e&&s(e.constructor.prototype[t],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(typeof t!="function")throw new TypeError;var n=O.call(arguments,1),r=function(){if(this instanceof r){var i=function(){};i.prototype=t.prototype;var s=new i,o=t.apply(s,n.concat(O.call(arguments)));return Object(o)===o?o:s}return t.apply(e,n.concat(O.call(arguments)))};return r}),C.flexbox=function(){return f("flexWrap")},C.canvas=function(){var e=t.createElement("canvas");return!!e.getContext&&!!e.getContext("2d")},C.canvastext=function(){return!!h.canvas&&!!s(t.createElement("canvas").getContext("2d").fillText,"function")},C.webgl=function(){return!!e.WebGLRenderingContext},C.touch=function(){var n;return"ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch?n=!0:_(["@media (",E.join("touch-enabled),("),v,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(e){ -n=e.offsetTop===9}),n},C.geolocation=function(){return"geolocation"in navigator},C.postmessage=function(){return!!e.postMessage},C.websqldatabase=function(){return!!e.openDatabase},C.indexedDB=function(){return!!f("indexedDB",e)},C.hashchange=function(){return P("hashchange",e)&&(t.documentMode===n||t.documentMode>7)},C.history=function(){return!!e.history&&!!history.pushState},C.draganddrop=function(){var e=t.createElement("div");return"draggable"in e||"ondragstart"in e&&"ondrop"in e},C.websockets=function(){return"WebSocket"in e||"MozWebSocket"in e},C.rgba=function(){return r("background-color:rgba(150,255,150,.5)"),o(g.backgroundColor,"rgba")},C.hsla=function(){return r("background-color:hsla(120,40%,100%,.5)"),o(g.backgroundColor,"rgba")||o(g.backgroundColor,"hsla")},C.multiplebgs=function(){return r("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(g.background)},C.backgroundsize=function(){return f("backgroundSize")},C.borderimage=function(){return f -("borderImage")},C.borderradius=function(){return f("borderRadius")},C.boxshadow=function(){return f("boxShadow")},C.textshadow=function(){return t.createElement("div").style.textShadow===""},C.opacity=function(){return i("opacity:.55"),/^0.55$/.test(g.opacity)},C.cssanimations=function(){return f("animationName")},C.csscolumns=function(){return f("columnCount")},C.cssgradients=function(){var e="background-image:",t="gradient(linear,left top,right bottom,from(#9f9),to(white));",n="linear-gradient(left top,#9f9, white);";return r((e+"-webkit- ".split(" ").join(t+e)+E.join(n+e)).slice(0,-e.length)),o(g.backgroundImage,"gradient")},C.cssreflections=function(){return f("boxReflect")},C.csstransforms=function(){return!!f("transform")},C.csstransforms3d=function(){var e=!!f("perspective");return e&&"webkitPerspective"in d.style&&_("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t,n){e=t.offsetLeft===9&&t.offsetHeight===3}),e},C.csstransitions= -function(){return f("transition")},C.fontface=function(){var e;return _('@font-face {font-family:"font";src:url("https://")}',function(n,r){var i=t.getElementById("smodernizr"),s=i.sheet||i.styleSheet,o=s?s.cssRules&&s.cssRules[0]?s.cssRules[0].cssText:s.cssText||"":"";e=/src/i.test(o)&&o.indexOf(r.split(" ")[0])===0}),e},C.generatedcontent=function(){var e;return _(['#modernizr:after{content:"',b,'";visibility:hidden}'].join(""),function(t){e=t.offsetHeight>=1}),e},C.video=function(){var e=t.createElement("video"),n=!1;try{if(n=!!e.canPlayType)n=new Boolean(n),n.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),n.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),n.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(r){}return n},C.audio=function(){var e=t.createElement("audio"),n=!1;try{if(n=!!e.canPlayType)n=new Boolean(n),n.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),n.mp3=e.canPlayType("audio/mpeg;" -).replace(/^no$/,""),n.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),n.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(r){}return n},C.localstorage=function(){try{return localStorage.setItem(v,v),localStorage.removeItem(v),!0}catch(e){return!1}},C.sessionstorage=function(){try{return sessionStorage.setItem(v,v),sessionStorage.removeItem(v),!0}catch(e){return!1}},C.webworkers=function(){return!!e.Worker},C.applicationcache=function(){return!!e.applicationCache},C.svg=function(){return!!t.createElementNS&&!!t.createElementNS(N.svg,"svg").createSVGRect},C.inlinesvg=function(){var e=t.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==N.svg},C.smil=function(){return!!t.createElementNS&&/SVGAnimate/.test(w.call(t.createElementNS(N.svg,"animate")))},C.svgclippaths=function(){return!!t.createElementNS&&/SVGClipPath/.test(w.call(t.createElementNS(N.svg,"clipPath")))};for(var j in C)B(C,j)&&(M=j.toLowerCase -(),h[M]=C[j](),A.push((h[M]?"":"no-")+M));return h.input||l(),h.addTest=function(e,t){if(typeof e=="object")for(var r in e)B(e,r)&&h.addTest(r,e[r]);else{e=e.toLowerCase();if(h[e]!==n)return h;t=typeof t=="function"?t():t,p&&(d.className+=" "+(t?"":"no-")+e),h[e]=t}return h},r(""),m=y=null,function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=g.elements;return typeof e=="string"?e.split(" "):e}function i(e){var t=v[e[p]];return t||(t={},d++,e[p]=d,v[d]=t),t}function s(e,n,r){n||(n=t);if(m)return n.createElement(e);r||(r=i(n));var s;return r.cache[e]?s=r.cache[e].cloneNode():c.test(e)?s=(r.cache[e]=r.createElem(e)).cloneNode():s=r.createElem(e),s.canHaveChildren&&!l.test(e)?r.frag.appendChild(s):s}function o(e,n){e||(e=t);if(m)return e.createDocumentFragment();n=n||i(e);var s=n.frag.cloneNode(),o=0,u=r(),a=u.length;for(;o",h="hidden"in e,m=e.childNodes.length==1||function(){t.createElement("a");var e=t.createDocumentFragment();return typeof e.cloneNode=="undefined"||typeof e.createDocumentFragment=="undefined"||typeof e.createElement=="undefined"}()}catch(n){h=!0,m=!0}})();var g={elements:f.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:f.shivCSS!==!1,supportsUnknownElements:m,shivMethods:f.shivMethods!==!1,type:"default",shivDocument:a,createElement:s,createDocumentFragment:o};e.html5=g,a(t)}(this,t),h._version=c,h._prefixes=E,h._domPrefixes=T,h._cssomPrefixes=x,h.mq=D,h.hasEvent=P,h.testProp=function(e){return u([e])},h.testAllProps=f,h.testStyles=_,h.prefixed=function(e,t,n){return t?f(e,t,n):f(e,"pfx")},d.className=d.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(p?" js "+A.join(" "):""),h}(this,this.document),function( -e,t,n){function r(e){return d.call(e)=="[object Function]"}function i(e){return typeof e=="string"}function s(){}function o(e){return!e||e=="loaded"||e=="complete"||e=="uninitialized"}function u(){var e=v.shift();m=1,e?e.t?h(function(){(e.t=="c"?k.injectCss:k.injectJs)(e.s,0,e.a,e.x,e.e,1)},0):(e(),u()):m=0}function a(e,n,r,i,s,a,f){function l(t){if(!d&&o(c.readyState)&&(w.r=d=1,!m&&u(),c.onload=c.onreadystatechange=null,t)){e!="img"&&h(function(){b.removeChild(c)},50);for(var r in T[n])T[n].hasOwnProperty(r)&&T[n][r].onload()}}var f=f||k.errorTimeout,c={},d=0,g=0,w={t:r,s:n,e:s,a:a,x:f};T[n]===1&&(g=1,T[n]=[],c=t.createElement(e)),e=="object"?c.data=n:(c.src=n,c.type=e),c.width=c.height="0",c.onerror=c.onload=c.onreadystatechange=function(){l.call(this,g)},v.splice(i,0,w),e!="img"&&(g||T[n]===2?(b.insertBefore(c,y?null:p),h(l,f)):T[n].push(c))}function f(e,t,n,r,s){return m=0,t=t||"j",i(e)?a(t=="c"?E:w,e,t,this.i++,n,r,s):(v.splice(this.i++,0,e),v.length==1&&u()),this}function l(){var e= -k;return e.loader={load:f,i:0},e}var c=t.documentElement,h=e.setTimeout,p=t.getElementsByTagName("script")[0],d={}.toString,v=[],m=0,g="MozAppearance"in c.style,y=g&&!!t.createRange().compareNode,b=y?c:p.parentNode,c=e.opera&&d.call(e.opera)=="[object Opera]",c=!!t.attachEvent&&!c,w=g?"object":c?"script":"img",E=c?"script":w,S=Array.isArray||function(e){return d.call(e)=="[object Array]"},x=[],T={},N={timeout:function(e,t){return t.length&&(e.timeout=t[0]),e}},C,k;k=function(e){function t(e){var e=e.split("!"),t=x.length,n=e.pop(),r=e.length,n={url:n,origUrl:n,prefixes:e},i,s,o;for(s=0;s0){var e=m.timeRange("min");l.indices(e.from,e.to,v.current.index.pattern,v.current.index.interval).then(function(e){if(e.length>0)v.indices=e;else{if(!v.current.failover)return!1;v.indices=[v.current.index.default]}o.$broadcast("refresh")})}else v.current.failover?(v.indices=[v.current.index.default],o.$broadcast("refresh")):c.set("No time filter","Timestamped indices are configured without a failover. Waiting for time filter.","info",5e3);else v.indices=[v.current.index.default],o.$broadcast("refresh")};var b=function(e){return t.defaults(e,h),t.defaults(e.index,h.index),t.defaults(e.loader,h.loader),e};this.dash_load=function(e){return f.cancel_all(),e=b(e),e.index. -interval==="none"&&(v.indices=[e.index.default]),v.current=t.clone(e),g=u.get("querySrv"),m=u.get("filterSrv"),g.init(),m.init(),e.index.interval!=="none"&&m.idsByType("time").length===0&&v.refresh(),!0},this.gist_id=function(e){if(v.is_gist(e))return e.match(d)[0].replace(/.*\//,"")},this.is_gist=function(e){return!t.isUndefined(e)&&e!==""&&!t.isNull(e.match(d))?e.match(d).length>0?!0:!1:!1},this.to_file=function(){var t=new Blob([e.toJson(v.current,!0)],{type:"application/json;charset=utf-8"});return window.saveAs(t,v.current.title+"-"+(new Date).getTime()),!0},this.set_default=function(t){return r.localstorage?(window.localStorage.dashboard=e.toJson(t||v.current),!0):!1},this.purge_default=function(){return r.localstorage?(window.localStorage.dashboard="",!0):!1},this.share_link=function(e,t,n){return{location:window.location.href.replace(window.location.hash,""),type:t,id:n,link:window.location.href.replace(window.location.hash,"")+"#dashboard/"+t+"/"+n,title:e}};var w=function(n,r) -{var i;t.templateSettings={interpolate:/\{\{(.+?)\}\}/g};var s=t.template(n),o=s({ARGS:r});try{i=e.fromJson(o)}catch(u){i=!1}return i};this.file_load=function(e){return s({url:"app/dashboards/"+e,method:"GET",transformResponse:function(e){return w(e,i)}}).then(function(e){return e?(v.dash_load(b(e.data)),!0):!1},function(){return c.set("Error","Could not load dashboards/"+e+". Please make sure it exists","error"),!1})},this.elasticsearch_load=function(t,r){return s({url:n.elasticsearch+"/"+n.kibana_index+"/"+t+"/"+r,method:"GET",transformResponse:function(t){return w(e.fromJson(t)._source.dashboard,i)}}).error(function(e,t){return t===0?c.set("Error","Could not contact Elasticsearch at "+n.elasticsearch+". Please ensure that Elasticsearch is reachable from your system.","error"):c.set("Error","Could not find "+r+". If you"+" are using a proxy, ensure it is configured correctly","error"),!1}).success(function(e){v.dash_load(e)})},this.script_load=function(e){return s({url:"dashboards/"+ -e,method:"GET",transformResponse:function(e){var t=new Function("ARGS",e);return t(i)}}).then(function(e){return e?(v.dash_load(b(e.data)),!0):!1},function(){return c.set("Error","Could not load scripts/"+e+". Please make sure it exists and returns a valid dashboard","error"),!1})},this.elasticsearch_save=function(r,i,s){var o=t.clone(v.current),u;r==="dashboard"&&(u=o.title=t.isUndefined(i)?v.current.title:i);var a=p.Document(n.kibana_index,r,u).source({user:"guest",group:"guest",title:o.title,dashboard:e.toJson(o)});return a=r==="temp"&&s?a.ttl(s):a,a.doIndex(function(e){return e},function(){return!1})},this.elasticsearch_delete=function(e){return p.Document(n.kibana_index,"dashboard",e).doDelete(function(e){return e},function(){return!1})},this.elasticsearch_list=function(e,t){var r=p.Request().indices(n.kibana_index).types("dashboard");return r.query(p.QueryStringQuery(e||"*")).size(t).doSearch(function(e){return e},function(){return!1})},this.save_gist=function(n,r){var i=t. -clone(r||v.current);return i.title=n||v.current.title,s({url:"https://api.github.com/gists",method:"POST",data:{description:i.title,"public":!1,files:{"kibana-dashboard.json":{content:e.toJson(i,!0)}}}}).then(function(e){return e.data.html_url},function(){return!1})},this.gist_list=function(e){return s.jsonp("https://api.github.com/gists/"+e+"?callback=JSON_CALLBACK").then(function(e){var n=[];return t.each(e.data.data.files,function(e){try{var t=JSON.parse(e.content);n.push(t)}catch(r){return!1}}),n},function(){return!1})}}])}),define("services/fields",["angular","underscore","config"],function(e,t,n){var r=e.module("kibana.services");r.service("fields",["dashboard","$rootScope","$http","alertSrv",function(e,r,i,s){var o=this;this.list=["_type"],this.mapping={},r.$watch(function(){return e.indices},function(e){if(!t.isUndefined(e)&&e.length){var n=t.difference(e,t.keys(o.mapping));n.length>0?o.map(n).then(function(e){o.mapping=t.extend(o.mapping,e),o.list=u(o.mapping)}):o.list=u(t.pick -(o.mapping,e))}});var u=function(e){var n=[];return t.each(e,function(e){t.each(e,function(e){n=t.union(n,t.keys(e))})}),n};this.map=function(e){var r=i({url:n.elasticsearch+"/"+e.join(",")+"/_mapping",method:"GET"}).error(function(t,r){r===0?s.set("Error","Could not contact Elasticsearch at "+n.elasticsearch+". Please ensure that Elasticsearch is reachable from your system.","error"):s.set("Error","No index found at "+n.elasticsearch+"/"+e.join(",")+"/_mapping. Please create at least one index."+"If you're using a proxy ensure it is configured correctly.","error")});return r.then(function(e){var n={};return t.each(e.data,function(e,r){n[r]={},t.each(e,function(e,t){n[r][t]=a(e)})}),n})};var a=function(e,n){var r=n?n:"",i=n?".":"",s={};for(var o in e){if(e[o].type==="multi_field"){s[o]=e[o].fields[o]||e[o];continue}o==="properties"?t.extend(s,a(e[o],r)):typeof e[o]=="object"?t.extend(s,a(e[o],r+i+o)):s[r]=e}return s}}])}),define("services/filterSrv",["angular","underscore","config"],function( -e,t,n){var r=e.module("kibana.services");r.service("filterSrv",["dashboard","ejsResource",function(e,r){e.current.services.filter=e.current.services.filter||{};var i={idQueue:[],list:{},ids:[]},s=r(n.elasticsearch),o=e.current.services.filter,u=this;this.init=function(){t.defaults(e.current.services.filter,i),u.list=e.current.services.filter.list,u.ids=e.current.services.filter.ids,o=e.current.services.filter,t.each(u.getByType("time",!0),function(e){u.list[e.id].from=new Date(e.from),u.list[e.id].to=new Date(e.to)})},this.set=function(e,n){t.defaults(e,{mandate:"must"}),e.active=!0;if(!t.isUndefined(n))return t.isUndefined(u.list[n])?!1:(t.extend(u.list[n],e),n);if(t.isUndefined(e.type))return!1;var r=a(),i={alias:"",id:r};return t.defaults(e,i),u.list[r]=e,u.ids.push(r),r},this.getBoolFilter=function(e){var n=s.BoolFilter().must(s.MatchAllFilter()),r=s.BoolFilter().must(s.MatchAllFilter());return t.each(e,function(e){if(u.list[e].active)switch(u.list[e].mandate){case"mustNot":n=n.mustNot -(u.getEjsObj(e));break;case"either":r=r.should(u.getEjsObj(e));break;default:n=n.must(u.getEjsObj(e))}}),n.must(r)},this.getEjsObj=function(e){return u.toEjsObj(u.list[e])},this.toEjsObj=function(e){if(!e.active)return!1;switch(e.type){case"time":return s.RangeFilter(e.field).from(e.from.valueOf()).to(e.to.valueOf());case"range":return s.RangeFilter(e.field).from(e.from).to(e.to);case"querystring":return s.QueryFilter(s.QueryStringQuery(e.query)).cache(!0);case"field":return s.QueryFilter(s.FieldQuery(e.field,e.query)).cache(!0);case"terms":return s.TermsFilter(e.field,e.value);case"exists":return s.ExistsFilter(e.field);case"missing":return s.MissingFilter(e.field);default:return!1}},this.getByType=function(e,n){return t.pick(u.list,u.idsByType(e,n))},this.removeByType=function(e){var n=u.idsByType(e);return t.each(n,function(e){u.remove(e)}),n},this.idsByType=function(e,n){var r=n?{type:e}:{type:e,active:!0};return t.pluck(t.where(u.list,r),"id")},this.timeField=function(){return t.pluck -(u.getByType("time"),"field")},this.timeRange=function(e){var n=t.where(u.list,{type:"time",active:!0});if(n.length===0)return!1;switch(e){case"min":return{from:new Date(t.max(t.pluck(n,"from"))),to:new Date(t.min(t.pluck(n,"to")))};case"max":return{from:new Date(t.min(t.pluck(n,"from"))),to:new Date(t.max(t.pluck(n,"to")))};default:return!1}},this.remove=function(n){return t.isUndefined(u.list[n])?!1:(delete u.list[n],u.ids=e.current.services.filter.ids=t.without(u.ids,n),o.idQueue.unshift(n),o.idQueue.sort(function(e,t){return e-t}),!0)};var a=function(){return o.idQueue.length>0?o.idQueue.shift():u.ids.length};u.init()}])}),function(e){function M(e,t){return function(n){return F(e.call(this,n),t)}}function _(e,t){return function(n){return this.lang().ordinal(e.call(this,n),t)}}function D(){}function P(e){B(this,e)}function H(e){var t=e.years||e.year||e.y||0,n=e.months||e.month||e.M||0,r=e.weeks||e.week||e.w||0,i=e.days||e.day||e.d||0,s=e.hours||e.hour||e.h||0,o=e.minutes||e.minute||e -.m||0,u=e.seconds||e.second||e.s||0,a=e.milliseconds||e.millisecond||e.ms||0;this._input=e,this._milliseconds=a+u*1e3+o*6e4+s*36e5,this._days=i+r*7,this._months=n+t*12,this._data={},this._bubble()}function B(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function j(e){return e<0?Math.ceil(e):Math.floor(e)}function F(e,t){var n=e+"";while(n.length68?1900:2e3);break;case"YYYY":case"YYYYY":i[0]=~~t;break;case"a":case"A":n._isPm=W(n._l).isPM(t);break;case"H":case"HH":case"h":case"hh":i[3]=~~t;break;case"m":case"mm":i[4]=~~t;break;case"s":case"ss":i[5]=~~t;break;case"S":case"SS":case"SSS":i[6]=~~(("0."+t)*1e3);break;case"X":n._d=new Date(parseFloat(t)*1e3);break;case"Z":case"ZZ":n._useUTC=!0,n._tzm=K(t)}t==null&&(n._isValid=!1)}function G(e){var t,n,r=[];if(e._d)return;for(t=0;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];r[3]+=~~((e._tzm||0)/60),r[4]+=~~((e._tzm||0)%60),n=new Date(0),e._useUTC?(n.setUTCFullYear(r[0],r[1],r[2]),n.setUTCHours(r[3],r[4],r[5],r[6])):(n.setFullYear(r[0],r[1],r[2]),n. -setHours(r[3],r[4],r[5],r[6])),e._d=n}function Y(e){var t=e._f.match(f),n=e._i,r,i;e._a=[];for(r=0;r0,f[4]=n,nt.apply({},f)}function it(e,n,r){var i=r-n,s=r-e.day(),o;return s>i&&(s-=7),s11?n?"pm":"PM":n?"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(e,t){var n=this._calendar[e];return typeof n=="function"?n.apply(t):n},_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(e,t,n,r){var i=this._relativeTime[n];return typeof i=="function"? -i(e,t,n,r):i.replace(/%d/i,e)},pastFuture:function(e,t){var n=this._relativeTime[e>0?"future":"past"];return typeof n=="function"?n(t):n.replace(/%s/i,t)},ordinal:function(e){return this._ordinal.replace("%d",e)},_ordinal:"%d",preparse:function(e){return e},postformat:function(e){return e},week:function(e){return it(e,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6}},t=function(e,t,n){return st({_i:e,_f:t,_l:n,_isUTC:!1})},t.utc=function(e,t,n){return st({_useUTC:!0,_isUTC:!0,_l:n,_i:e,_f:t})},t.unix=function(e){return t(e*1e3)},t.duration=function(e,n){var r=t.isDuration(e),i=typeof e=="number",s=r?e._input:i?{}:e,o=a.exec(e),u,f;return i?n?s[n]=e:s.milliseconds=e:o&&(u=o[1]==="-"?-1:1,s={y:0,d:~~o[2]*u,h:~~o[3]*u,m:~~o[4]*u,s:~~o[5]*u,ms:~~o[6]*u}),f=new H(s),r&&e.hasOwnProperty("_lang")&&(f._lang=e._lang),f},t.version=n,t.defaultFormat=E,t.updateOffset=function(){},t.lang=function(e,n){if(!e)return t.fn._lang._abbr;n?z(e,n):s[e]||W(e),t.duration.fn._lang=t.fn._lang=W(e)},t.langData= -function(e){return e&&e._lang&&e._lang._abbr&&(e=e._lang._abbr),W(e)},t.isMoment=function(e){return e instanceof P},t.isDuration=function(e){return e instanceof H},t.fn=P.prototype={clone:function(){return t(this)},valueOf:function(){return+this._d+(this._offset||0)*6e4},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 $(t(this).utc(),"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var e=this;return[e.year(),e.month(),e.date(),e.hours(),e.minutes(),e.seconds(),e.milliseconds()]},isValid:function(){return this._isValid==null&&(this._a?this._isValid=!R(this._a,(this._isUTC?t.utc(this._a):t(this._a)).toArray()):this._isValid=!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(e){var n=$(this,e||t.defaultFormat);return this -.lang().postformat(n)},add:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),I(this,r,1),this},subtract:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),I(this,r,-1),this},diff:function(e,n,r){var i=this._isUTC?t(e).zone(this._offset||0):t(e).local(),s=(this.zone()-i.zone())*6e4,o,u;return n=U(n),n==="year"||n==="month"?(o=(this.daysInMonth()+i.daysInMonth())*432e5,u=(this.year()-i.year())*12+(this.month()-i.month()),u+=(this-t(this).startOf("month")-(i-t(i).startOf("month")))/o,u-=(this.zone()-t(this).startOf("month").zone()-(i.zone()-t(i).startOf("month").zone()))*6e4/o,n==="year"&&(u/=12)):(o=this-i,u=n==="second"?o/1e3:n==="minute"?o/6e4:n==="hour"?o/36e5:n==="day"?(o-s)/864e5:n==="week"?(o-s)/6048e5:o),r?u:j(u)},from:function(e,n){return t.duration(this.diff(e)).lang(this.lang()._abbr).humanize(!n)},fromNow:function(e){return this.from(t(),e)},calendar:function(){var e=this.diff(t().startOf("day"),"days",!0),n=e<-6?"sameElse" -:e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse";return this.format(this.lang().calendar(n,this))},isLeapYear:function(){var e=this.year();return e%4===0&&e%100!==0||e%400===0},isDST:function(){return this.zone()+t(e).startOf(n)},isBefore:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)<+t(e).startOf(n)},isSame:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)===+t(e).startOf(n)},min:function(e){return e=t.apply(null,arguments),ethis?this:e},zone:function(e){var n=this._offset||0;return e==null?this._isUTC?n:this._d.getTimezoneOffset():(typeof e=="string"&&(e=K(e)),Math.abs(e)<16&&(e*=60),this._offset=e,this._isUTC=!0,n!==e&&I(this,t.duration(n-e,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},daysInMonth:function(){return t -.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(e){var n=r((t(this).startOf("day")-t(this).startOf("year"))/864e5)+1;return e==null?n:this.add("d",e-n)},weekYear:function(e){var t=it(this,this.lang()._week.dow,this.lang()._week.doy).year;return e==null?t:this.add("y",e-t)},isoWeekYear:function(e){var t=it(this,1,4).year;return e==null?t:this.add("y",e-t)},week:function(e){var t=this.lang().week(this);return e==null?t:this.add("d",(e-t)*7)},isoWeek:function(e){var t=it(this,1,4).week;return e==null?t:this.add("d",(e-t)*7)},weekday:function(e){var t=(this._d.getDay()+7-this.lang()._week.dow)%7;return e==null?t:this.add("d",e-t)},isoWeekday:function(e){return e==null?this.day()||7:this.day(this.day()%7?e:e-7)},lang:function(t){return t===e?this._lang:(this._lang=W(t),this)}};for(i=0;i0?o.idQueue.shift():u.ids.length},f=function(e){return u -.colors[e%u.colors.length]};u.init()}])}),define("services/timer",["angular","underscore"],function(e,t){var n=e.module("kibana.services");n.service("timer",["$timeout",function(e){var n=[];this.register=function(e){return n.push(e),e},this.cancel=function(r){n=t.without(n,r),e.cancel(r)},this.cancel_all=function(){t.each(n,function(t){e.cancel(t)}),n=[]}}])}),define("services/all",["./alertSrv","./dashboard","./fields","./filterSrv","./kbnIndex","./querySrv","./timer"],function(){}),define("controllers/dash",["angular","config","underscore","services/all"],function(e,t,n){var r=e.module("kibana.controllers");r.controller("DashCtrl",["$scope","$route","ejsResource","fields","dashboard","alertSrv",function(e,r,i,s,o,u){e.editor={index:0},e.init=function(){e.config=t,e._=n,e.dashboard=o,e.dashAlerts=u,u.clearAll(),e.fields=s,e.reset_row(),e.ejs=i(t.elasticsearch)},e.add_row=function(e,t){e.rows.push(t)},e.reset_row=function(){e.row={title:"",height:"150px",editable:!0}},e.row_style=function( -e){return{"min-height":e.collapse?"5px":e.height}},e.edit_path=function(e){return e?"app/panels/"+e+"/editor.html":!1},e.setEditorTabs=function(t){return e.editorTabs=["General","Panel"],n.isUndefined(t.editorTabs)||(e.editorTabs=n.union(e.editorTabs,n.pluck(t.editorTabs,"title"))),e.editorTabs},e.parse_error=function(e){var t=e.match("nested: (.*?);");return n.isNull(t)?e:t[1]},e.init()}])}),define("controllers/dashLoader",["angular","underscore"],function(e,t){var n=e.module("kibana.controllers");n.controller("dashLoader",["$scope","$http","timer","dashboard","alertSrv",function(e,n,r,i,s){e.loader=i.current.loader,e.init=function(){e.gist_pattern=/(^\d{5,}$)|(^[a-z0-9]{10,}$)|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/,e.gist=e.gist||{},e.elasticsearch=e.elasticsearch||{}},e.showDropdown=function(t){var n=e.loader;return t==="load"?n.load_elasticsearch||n.load_gist||n.load_local:t==="save"?n.save_elasticsearch||n.save_gist||n.local_local||n.save_default:t==="share"?n.save_temp:!1},e. -set_default=function(){i.set_default()?s.set("Local Default Set",i.current.title+" has been set as your local default","success",5e3):s.set("Incompatible Browser","Sorry, your browser is too old for this feature","error",5e3)},e.purge_default=function(){i.purge_default()?s.set("Local Default Clear","Your local default dashboard has been cleared","success",5e3):s.set("Incompatible Browser","Sorry, your browser is too old for this feature","error",5e3)},e.elasticsearch_save=function(n,r){i.elasticsearch_save(n,e.elasticsearch.title||i.current.title,e.loader.save_temp_ttl_enable?r:!1).then(function(r){t.isUndefined(r._id)?s.set("Save failed","Dashboard could not be saved to Elasticsearch","error",5e3):(s.set("Dashboard Saved",'This dashboard has been saved to Elasticsearch as "'+r._id+'"',"success",5e3),n==="temp"&&(e.share=i.share_link(i.current.title,"temp",r._id)))})},e.elasticsearch_delete=function(n){i.elasticsearch_delete(n).then(function(r){if(!t.isUndefined(r))if(r.found){s.set("Dashboard Deleted" -,n+" has been deleted","success",5e3);var i=t.where(e.elasticsearch.dashboards,{_id:n})[0];e.elasticsearch.dashboards=t.without(e.elasticsearch.dashboards,i)}else s.set("Dashboard Not Found","Could not find "+n+" in Elasticsearch","warning",5e3);else s.set("Dashboard Not Deleted","An error occurred deleting the dashboard","error",5e3)})},e.elasticsearch_dblist=function(n){i.elasticsearch_list(n,e.loader.load_elasticsearch_size).then(function(n){t.isUndefined(n.hits)||(e.hits=n.hits.total,e.elasticsearch.dashboards=n.hits.hits)})},e.save_gist=function(){i.save_gist(e.gist.title).then(function(n){t.isUndefined(n)?s.set("Save failed","Gist could not be saved","error",5e3):(e.gist.last=n,s.set("Gist saved",'You will be able to access your exported dashboard file at '+n+" in a moment","success"))})},e.gist_dblist=function(t){i.gist_list(t).then(function(t){t&&t.length>0?e.gist.files=t:s.set("Gist Failed","Could not retrieve dashboard list from gist","error",5e3)})}}])}),define -("controllers/row",["angular","app","underscore"],function(e,t,n){var r=e.module("kibana.controllers");r.controller("RowCtrl",["$scope","$rootScope","$timeout","ejsResource","querySrv",function(e,t,r,i,s){var o={title:"Row",height:"150px",collapse:!1,collapsable:!0,editable:!0,panels:[]};n.defaults(e.row,o),e.init=function(){e.querySrv=s,e.reset_panel()},e.toggle_row=function(t){if(!t.collapsable)return;t.collapse=t.collapse?!1:!0,t.collapse||r(function(){e.$broadcast("render")})},e.close_edit=function(){e.$broadcast("render")},e.add_panel=function(t,n){e.row.panels.push(n)},e.reset_panel=function(t){e.panel={error:!1,span:3,editable:!0,type:t}},e.init()}])}),define("controllers/all",["./dash","./dashLoader","./row"],function(){}),define("directives/addPanel",["angular","app","underscore"],function(e,t,n){e.module("kibana.directives").directive("addPanel",["$compile",function(t){return{restrict:"A",link:function(r,i){r.$watch("panel.type",function(){var s=r.panel.type;r.reset_panel(s),n -.isUndefined(r.panel.type)||(r.panel.loadingEditor=!0,r.require(["panels/"+r.panel.type+"/module"],function(){var n='
    ';i.html(t(e.element(n))(r)),r.panel.loadingEditor=!1}))})}}}])}),define("directives/arrayJoin",["angular","app","underscore"],function(e,t,n){e.module("kibana.directives").directive("arrayJoin",function(){return{restrict:"A",require:"ngModel",link:function(e,t,r,i){function s(e){return(e||"").split(",")}function o(e){return n.isArray(e)?(e||"").join(","):e}i.$parsers.push(s),i.$formatters.push(o)}}})}),define("directives/dashUpload",["angular"],function(e){var t=e.module("kibana.directives");t.directive("dashUpload",["timer","dashboard","alertSrv",function(e,t,n){return{restrict:"A",link:function(e){function r(n){var r=n.target.files,i=function(){return function(n){t.dash_load(JSON.parse(n.target.result)),e.$apply()}};for(var s=0,o;o=r[s];s++){var u=new FileReader;u.onload=i(o),u.readAsText -(o)}}window.File&&window.FileReader&&window.FileList&&window.Blob?document.getElementById("dashupload").addEventListener("change",r,!1):n.set("Oops","Sorry, the HTML5 File APIs are not fully supported in this browser.","error")}}}])}),define("directives/kibanaPanel",["angular"],function(e){e.module("kibana.directives").directive("kibanaPanel",["$compile",function(e){var t='{{panel.type}}

    {{panel.title}}

    ';return{restrict:"E",link:function(n,r,i){function s(t){t.appendTo(r),e(r.contents())(n),r.removeClass("ng-cloak")}n.$watch -(i.type,function(e){r.addClass("ng-cloak"),n.require(["jquery","text!panels/"+e+"/module.html"],function(r,i){var o=r(i),u=o.filter("ngcontroller, [ng-controller], .ng-controller");u=u.add(o.find("ngcontroller, [ng-controller], .ng-controller")),u.length?(u.first().prepend(t),n.require(["panels/"+e+"/module"],function(){s(o)})):s(o)})})}}}])}),define("directives/ngBlur",["angular"],function(e){e.module("kibana.directives").directive("ngBlur",["$parse",function(e){return function(t,n,r){var i=e(r.ngBlur);n.bind("blur",function(e){t.$apply(function(){i(t,{$event:e})})})}}])}),define("directives/ngModelOnBlur",["angular"],function(e){e.module("kibana.directives").directive("ngModelOnblur",function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,r){if(n.type==="radio"||n.type==="checkbox")return;t.unbind("input").unbind("keydown").unbind("change"),t.bind("blur",function(){e.$apply(function(){r.$setViewValue(t.val())})})}}})}),define("kbn",["jquery","underscore"],function(e,t){var n= -{};return n.get_object_fields=function(e){var t=[];e=n.flatten_json(e._source);for(var r in e)t.push(r);return t.sort()},n.get_all_fields=function(e){var n=[];return t.each(e,function(e){n=t.uniq(n.concat(t.keys(e)))}),n=t.without(n,"$$hashKey"),n},n.has_field=function(e,r){var i=n.get_object_fields(e);return t.inArray(i,r)<0?!1:!0},n.get_related_fields=function(e,n){var r=[];t.each(e,function(e){var i=t.keys(e);t.contains(i,n)&&(r=r.concat(i))});var i=t.countBy(t.without(r,n),function(e){return e});return i},n.recurse_field_dots=function(e,t){var r=null,i;return typeof e[t]!="undefined"?r=e[t]:(i=t.match(/(.*?)\.(.*)/))&&typeof e[i[1]]!="undefined"&&(r=typeof e[i[1]][i[2]]!="undefined"?e[i[1]][i[2]]:n.recurse_field_dots(e[i[1]],i[2])),r},n.top_field_values=function(e,n,r){var i=t.pluck(e,n),s={};return t.each(i,function(e){var n=t.isUndefined(e)?"":e.toString();t.has(s,n)?s[n][1]++:s[n]=[e,1]}),t.values(s).sort(function(e,t){return e[1]-t[1]}).reverse().slice(0,r)},n.calculate_interval= -function(e,r,i,s){return t.isObject(e)&&(e=e.valueOf()),t.isObject(r)&&(r=r.valueOf()),s===0?n.round_interval((r-e)/i):s},n.round_interval=function(e){switch(!0){case e<=500:return 100;case e<=5e3:return 1e3;case e<=7500:return 5e3;case e<=15e3:return 1e4;case e<=45e3:return 3e4;case e<=18e4:return 6e4;case e<=45e4:return 3e5;case e<=12e5:return 6e5;case e<=27e5:return 18e5;case e<=72e5:return 36e5;case e<=216e5:return 108e5;case e<=864e5:return 432e5;case e<=1728e5:return 864e5;case e<=6048e5:return 864e5;case e<=18144e5:return 6048e5;case e<36288e5:return 2592e6;default:return 31536e6}},n.secondsToHms=function(e){var t=Math.floor(e/31536e3);if(t)return t+"y";var n=Math.floor(e%31536e3/86400);if(n)return n+"d";var r=Math.floor(e%31536e3%86400/3600);if(r)return r+"h";var i=Math.floor(e%31536e3%86400%3600/60);if(i)return i+"m";var s=e%31536e3%86400%3600%60;return s?s+"s":"less then a second"},n.to_percent=function(e,t){return Math.floor(e/t*1e4)/100+"%"},n.addslashes=function(e){return e= -e.replace(/\\/g,"\\\\"),e=e.replace(/\'/g,"\\'"),e=e.replace(/\"/g,'\\"'),e=e.replace(/\0/g,"\\0"),e},n.interval_to_seconds=function(e){var t=e.match(/(\d+(?:\.\d+)?)([Mwdhmsy])/);switch(t[2]){case"y":return t[1]*31536e3;case"M":return t[1]*2592e3;case"w":return t[1]*604800;case"d":return t[1]*86400;case"h":return t[1]*3600;case"m":return t[1]*60;case"s":return t[1]}},n.time_ago=function(e){return new Date((new Date).getTime()-n.interval_to_seconds(e)*1e3)},n.flatten_json=function(e,r,i){typeof i=="undefined"&&(i={}),typeof r=="undefined"&&(r="");for(var s in e){var o=e[s],u=r.length===0?s:r+"."+s;if(typeof o=="object")if(t.isArray(o))if(o.length>0&&typeof o[0]=="object"){var a="";for(var f=0,l=o.length;f0&&(a+=", "),a+=JSON.stringify(o[f]);i[u]=a}else o.length===1&&t.isNumber(o[0])?i[u]=parseFloat(o[0]):i[u]=typeof o=="undefined"?null:o;else n.flatten_json(o,u,i);else i[u]=typeof o=="undefined"?null:o}return n.sortObj(i)},n.xmlEnt=function(e){if(t.isString(e)){var n=e.replace(//g,">").replace(/\r\n/g,"
    ").replace(/\r/g,"
    ").replace(/\n/g,"
    ").replace(/\t/g,"    ").replace(/ /g,"  ").replace(/<del>/g,"").replace(/<\/del>/g,"");return n}return e},n.sortObj=function(e){var t=[],n={},r;for(r in e)t.push(r);t.sort();for(r in t)n[t[r]]=e[t[r]];return n},n.query_color_dot=function(e,t){return'
    '},n}),define("directives/tip",["angular","kbn"],function(e,t){e.module("kibana.directives").directive("tip",["$compile",function(n){return{restrict:"E",link:function(r,i,s){var o='";i.replaceWith(n(e.element(o))(r))}}}])}),define("directives/all",["./addPanel","./arrayJoin","./dashUpload","./kibanaPanel","./ngBlur","./ngModelOnBlur","./tip"],function(){}),define("filters/all",["angular","jquery" -,"underscore"],function(e,t,n){var r=e.module("kibana.filters");r.filter("stringSort",function(){return function(e){return e.sort()}}),r.filter("pinnedQuery",["querySrv",function(e){return function(t,r){var i=n.filter(e.ids,function(t){var i=e.list[t];if(!n.isUndefined(i.pin)&&i.pin===!0&&r===!0)return!0;if((n.isUndefined(i.pin)||i.pin===!1)&&r===!1)return!0});return i}}]),r.filter("slice",function(){return function(e,t,r){if(!n.isUndefined(e))return e.slice(t,r)}}),r.filter("stringify",function(){return function(t){return n.isObject(t)&&!n.isArray(t)?e.toJson(t):t.toString()}}),r.filter("noXml",function(){var e=function(e){return n.isString(e)?e.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,"""):e};return function(t){return n.isArray(t)?n.map(t,e):e(t)}}),r.filter("urlLink",function(){var e=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,t=/(^|[^\/])(www\.[\S]+(\b|$))/gim,r=/(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim -,i=function(i){var s,o,u;return n.isString(i)?(n.each(i.match(e),function(){s=i.replace(e,'$1')}),i=s||i,n.each(i.match(t),function(){o=i.replace(t,'$1$2')}),i=o||i,n.each(i.match(r),function(){u=i.replace(r,'$1')}),i=u||i,i):i};return function(e){return n.isArray(e)?n.map(e,i):i(e)}}),r.filter("gistid",function(){var e=/(\d{5,})|([a-z0-9]{10,})|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/;return function(t){if(!n.isUndefined(t)){var r=t.match(e);if(!n.isNull(r)&&!n.isUndefined(r))return r[0].replace(/.*\//,"")}}})}),define("app",["angular","jquery","underscore","require","elasticjs","bootstrap","angular-sanitize","angular-strap"],function(e,t,n,r){var i=e.module("kibana",[]),s=[],o={};i.useModule=function(e){return s?s.push(e):n.extend(e,o),e},i.safeApply=function(e,t){switch(e.$$phase){case"$apply":e.$eval(t);break;case"$digest":setTimeout(function(){i.safeApply(e,t)},10);break;default:e.$apply -(t)}},i.config(["$routeProvider","$controllerProvider","$compileProvider","$filterProvider","$provide",function(e,t,n,r,i){e.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"}),o.controller=t.register,o.directive=n.directive,o.factory=i.factory,o.service=i.service,o.filter=r.register}]);var u=["elasticjs.service","$strap.directives","ngSanitize","kibana"];return n.each("controllers directives factories services filters".split(" "),function(t){var n="kibana."+t;i.useModule(e.module(n,[])),u.push(n)}),i.panel_helpers={partial:function(e){return"app/partials/"+e+".html"}},require(["controllers/all","directives/all","filters/all"],function(){e.element(document).ready(function(){t("body").attr("ng-controller","DashCtrl"),e.bootstrap(document,u).invoke(["$rootScope",function(e){n.each -(s,function(e){n.extend(e,o)}),s=!1,e.requireContext=r,e.require=function(e,t){var r=this;r.requireContext(e,function(){var e=n.toArray(arguments);r.$apply(function(){t.apply(r,e)})})}}])})}),i}),function(e){e.color={},e.color.make=function(t,n,r,i){var s={};return s.r=t||0,s.g=n||0,s.b=r||0,s.a=i!=null?i:1,s.add=function(e,t){for(var n=0;n=1?"rgb("+[s.r,s.g,s.b].join(",")+")":"rgba("+[s.r,s.g,s.b,s.a].join(",")+")"},s.normalize=function(){function e(e,t,n){return tn?n:t}return s.r=e(0,parseInt(s.r),255),s.g=e(0,parseInt(s.g),255),s.b=e(0,parseInt(s.b),255),s.a=e(0,s.a,1),s},s.clone=function(){return e.color.make(s.r,s.b,s.g,s.a)},s.normalize()},e.color.extract=function(t,n){var r;do{r=t.css(n).toLowerCase();if(r!=""&&r!="transparent")break;t=t.parent()}while(!e.nodeName(t.get(0),"body"));return r=="rgba(0, 0, 0, 0)"&& -(r="transparent"),e.color.parse(r)},e.color.parse=function(n){var r,i=e.color.make;if(r=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(n))return i(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10));if(r=/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(n))return i(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4]));if(r=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(n))return i(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55);if(r=/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(n))return i(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55,parseFloat(r[4]));if(r=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(n))return i(parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16));if(r=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/ -.exec(n))return i(parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16));var s=e.trim(n).toLowerCase();return s=="transparent"?i(255,255,255,0):(r=t[s]||[0,0,0],i(r[0],r[1],r[2]))};var t={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(e){function n(t,n){var r=n.children("."+t)[0];if(r==null){r=document.createElement("canvas"),r.className=t,e(r).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(n);if(!r.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.");r=window.G_vmlCanvasManager.initElement(r)}}this.element=r;var i=this.context=r.getContext("2d"),s=window.devicePixelRatio||1,o=i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1;this.pixelRatio=s/o,this.resize(n.width(),n.height()),this.textContainer=null,this.text={},this._textCache={}}function r(t,r,s,o){function E(e,t){t=[w].concat(t);for(var n=0;nn&&(n=i))}t<=n&&(t=n+1);var s,o=[],f=a.colors,l=f.length,c=0;for(r=0;r=0?c<.5?c=-c-.2:c=0:c=-c),o[r]=s.scale("rgb",1+c);var h=0,p;for(r=0;re.datamax&&n!=r&&(e.datamax=n)}var t=Number.POSITIVE_INFINITY,n=Number. -NEGATIVE_INFINITY,r=Number.MAX_VALUE,i,s,o,a,f,l,c,h,p,d,v,m,g,y,w,S;e.each(k(),function(e,r){r.datamin=t,r.datamax=n,r.used=!1});for(i=0;i0&&c[o-h]!=null&&c[o-h]!=c[o]&&c[o-h+1]!=c[o+1]){for(a=0;aO&&(O=m)),g.y&&(mM&&(M=m))}}if(l.bars.show){var _;switch(l.bars.align){case"left":_=0;break;case"right":_=-l.bars.barWidth;break;case"center":_=-l.bars.barWidth/2;break;default:throw new Error("Invalid bar alignment: "+l.bars.align)}l.bars.horizontal?(A+=_,M+=_+l.bars.barWidth):(L+=_,O+=_+l.bars.barWidth)}x(l.xaxis,L,O),x(l.yaxis,A,M)}e.each(k(),function(e,r){ -r.datamin==t&&(r.datamin=null),r.datamax==n&&(r.datamax=null)})}function D(){t.css("padding",0).children(":not(.flot-base,.flot-overlay)").remove(),t.css("position")=="static"&&t.css("position","relative"),f=new n("flot-base",t),l=new n("flot-overlay",t),h=f.context,p=l.context,c=e(l.element).unbind();var r=t.data("plot");r&&(r.shutdown(),l.clear()),t.data("plot",w)}function P(){a.grid.hoverable&&(c.mousemove(at),c.bind("mouseleave",ft)),a.grid.clickable&&c.click(lt),E(b.bindEvents,[c])}function H(){ot&&clearTimeout(ot),c.unbind("mousemove",at),c.unbind("mouseleave",ft),c.unbind("click",lt),E(b.shutdown,[c])}function B(e){function t(e){return e}var n,r,i=e.options.transform||t,s=e.options.inverseTransform;e.direction=="x"?(n=e.scale=g/Math.abs(i(e.max)-i(e.min)),r=Math.min(i(e.max),i(e.min))):(n=e.scale=y/Math.abs(i(e.max)-i(e.min)),n=-n,r=Math.max(i(e.max),i(e.min))),i==t?e.p2c=function(e){return(e-r)*n}:e.p2c=function(e){return(i(e)-r)*n},s?e.c2p=function(e){return s(r+e/n)}:e.c2p=function( -e){return r+e/n}}function j(e){var t=e.options,n=e.ticks||[],r=t.labelWidth||0,i=t.labelHeight||0,s=r||e.direction=="x"?Math.floor(f.width/(n.length||1)):null;legacyStyles=e.direction+"Axis "+e.direction+e.n+"Axis",layer="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+legacyStyles,font=t.font||"flot-tick-label tickLabel";for(var o=0;o=0;--t)F(o[t]);q(),e.each(o,function(e,t){I(t)})}g=f.width-m.left-m.right,y=f.height-m.bottom-m.top,e.each(n,function(e,t){B(t)}),r&&G(),it()}function U(e){var t=e.options,n=+(t.min!=null?t.min:e.datamin),r=+(t.max!=null?t.max:e.datamax),i=r-n;if(i==0){var s=r==0?1:.01;t.min==null&&(n-=s);if(t.max==null||t.min!=null)r+=s}else{var o=t.autoscaleMargin;o!=null&&(t.min==null&&(n-=i*o,n<0&&e.datamin!=null&&e.datamin>=0&&(n=0)),t.max==null&&(r+=i*o,r>0&&e.datamax!=null&&e.datamax<=0&&(r=0)))}e.min=n,e.max=r}function z(t){var n=t.options,r;typeof n.ticks=="number"&&n.ticks>0?r=n.ticks:r=.3*Math.sqrt(t.direction=="x"?f.width:f.height);var s=(t.max- -t.min)/r,o=-Math.floor(Math.log(s)/Math.LN10),u=n.tickDecimals;u!=null&&o>u&&(o=u);var a=Math.pow(10,-o),l=s/a,c;l<1.5?c=1:l<3?(c=2,l>2.25&&(u==null||o+1<=u)&&(c=2.5,++o)):l<7.5?c=5:c=10,c*=a,n.minTickSize!=null&&c0&&(n.min==null&&(t.min=Math.min(t.min,p[0])),n.max==null&&p.length>1&&(t.max=Math.max(t.max,p[p.length-1]))),t.tickGenerator=function(e){var t=[],n,r;for(r=0;r1&&/\..*0$/.test((g[1]-g[0]).toFixed(m))||(t.tickDecimals=m)}}}}function W(t){var n=t.options.ticks,r=[];n==null||typeof n=="number"&&n>0?r=t.tickGenerator(t):n&&(e.isFunction(n)?r=n(t):r=n);var i,s;t.ticks=[];for(i=0;i1&&(o=u[1])):s=+u,o==null&&(o=t.tickFormatter(s,t)),isNaN(s)||t.ticks.push({v:s,label:o})}}function X(e,t){e.options.autoscaleMargin&&t.length>0&&(e.options.min==null&&(e.min=Math.min(e.min,t[0].v)),e.options.max==null&&t.length>1&&(e.max=Math.max(e.max,t[t.length-1].v) -))}function V(){f.clear(),E(b.drawBackground,[h]);var e=a.grid;e.show&&e.backgroundColor&&K(),e.show&&!e.aboveData&&Q();for(var t=0;ti){var a=r;r=i,i=a}return{from:r,to:i,axis:n}}function K(){h.save(),h.translate(m.left,m.top),h.fillStyle=bt(a.grid.backgroundColor,y,0,"rgba(255, 255, 255, 0)"),h.fillRect(0,0,g,y),h.restore()}function Q(){var t,n,r,i;h.save(),h.translate(m.left,m.top);var s=a.grid.markings;if(s){e.isFunction(s)&&(n=w.getAxes(),n.xmin=n.xaxis.min,n.xmax=n.xaxis.max,n.ymin=n.yaxis.min,n.ymax=n.yaxis.max,s=s(n));for(t=0;tu.axis.max||f.tof.axis.max)continue;u.from=Math.max(u.from,u.axis.min),u.to=Math.min(u.to,u.axis.max),f.from=Math.max(f.from,f.axis.min),f.to=Math.min(f.to,f.axis.max);if(u.from==u.to&&f.from==f.to)continue;u.from=u.axis.p2c(u.from),u.to=u.axis.p2c(u.to),f.from=f.axis.p2c(f.from),f.to=f.axis.p2c(f.to),u.from==u.to||f.from==f.to?(h.beginPath(),h.strokeStyle=o.color||a.grid.markingsColor,h.lineWidth=o.lineWidth||a.grid.markingsLineWidth,h.moveTo(u.from,f.from),h.lineTo(u.to,f.to),h.stroke()):(h.fillStyle=o.color||a.grid.markingsColor,h.fillRect(u.from,f.to,u.to-u.from,f.from-f.to))}}n=k(),r=a.grid.borderWidth;for(var l=0;lc.max||d=="full"&&(typeof r=="object"&&r[c.position]>0||r>0)&&(x==c.min||x==c.max))continue;c.direction=="x"?(v=c.p2c(x),S=d=="full"?-y:d,c.position=="top"&&(S=-S)):(b=c.p2c(x),E=d=="full"?-g:d,c.position=="left"&&(E=-E)),h.lineWidth==1&&(c.direction=="x"?v=Math.floor(v)+.5:b=Math.floor(b)+.5),h.moveTo(v,b),h.lineTo(v+E,b+S)}h.stroke()}r&&(i=a.grid.borderColor,typeof r=="object"||typeof i=="object"?(typeof r!="object"&&(r={top:r,right:r,bottom:r,left:r}),typeof i!="object"&&(i={top:i,right:i,bottom:i,left:i}),r.top>0&&(h.strokeStyle=i.top,h.lineWidth=r.top,h.beginPath(),h.moveTo(0-r.left,0-r.top/2),h.lineTo(g,0-r.top/2),h.stroke -()),r.right>0&&(h.strokeStyle=i.right,h.lineWidth=r.right,h.beginPath(),h.moveTo(g+r.right/2,0-r.top),h.lineTo(g+r.right/2,y),h.stroke()),r.bottom>0&&(h.strokeStyle=i.bottom,h.lineWidth=r.bottom,h.beginPath(),h.moveTo(g+r.right,y+r.bottom/2),h.lineTo(0,y+r.bottom/2),h.stroke()),r.left>0&&(h.strokeStyle=i.left,h.lineWidth=r.left,h.beginPath(),h.moveTo(0-r.left/2,y+r.bottom),h.lineTo(0-r.left/2,0),h.stroke())):(h.lineWidth=r,h.strokeStyle=a.grid.borderColor,h.strokeRect(-r/2,-r/2,g+r,y+r))),h.restore()}function G(){e.each(k(),function(e,t){if(!t.show||t.ticks.length==0)return;var n=t.box,r=t.direction+"Axis "+t.direction+t.n+"Axis",i="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+r,s=t.options.font||"flot-tick-label tickLabel",o,u,a,l,c;f.removeText(i);for(var h=0;ht.max)continue;t.direction=="x"?(l="center",u=m.left+t.p2c(o.v),t.position=="bottom"?a=n.top+n.padding:(a=n.top+n.height-n.padding,c="bottom")):(c="middle" -,a=m.top+t.p2c(o.v),t.position=="left"?(u=n.left+n.width-n.padding,l="right"):u=n.left+n.padding),f.addText(i,u,a,o.label,s,null,null,l,c)}})}function Y(e){e.lines.show&&Z(e),e.bars.show&&nt(e),e.points.show&&et(e)}function Z(e){function t(e,t,n,r,i){var s=e.points,o=e.pointsize,u=null,a=null;h.beginPath();for(var f=o;f=d&&c>i.max){if(d>i.max)continue;l=(i.max-c)/(d-c)*(p-l)+l,c=i.max}else if(d>=c&&d>i.max){if(c>i.max)continue;p=(i.max-c)/(d-c)*(p-l)+l,d=i.max}if(l<=p&&l=p&&l>r.max){if(p>r.max)continue;c=(r.max-l)/(p-l)*(d-c)+c,l=r.max}else if(p>=l&&p>r.max){if(l>r.max)continue;d=(r.max-l)/(p-l)*(d-c)+c,p=r.max -}(l!=u||c!=a)&&h.moveTo(r.p2c(l)+t,i.p2c(c)+n),u=p,a=d,h.lineTo(r.p2c(p)+t,i.p2c(d)+n)}h.stroke()}function n(e,t,n){var r=e.points,i=e.pointsize,s=Math.min(Math.max(0,n.min),n.max),o=0,u,a=!1,f=1,l=0,c=0;for(;;){if(i>0&&o>r.length+i)break;o+=i;var p=r[o-i],d=r[o-i+f],v=r[o],m=r[o+f];if(a){if(i>0&&p!=null&&v==null){c=o,i=-i,f=2;continue}if(i<0&&o==l+i){h.fill(),a=!1,i=-i,f=1,o=l=c+i;continue}}if(p==null||v==null)continue;if(p<=v&&p=v&&p>t.max){if(v>t.max)continue;d=(t.max-p)/(v-p)*(m-d)+d,p=t.max}else if(v>=p&&v>t.max){if(p>t.max)continue;m=(t.max-p)/(v-p)*(m-d)+d,v=t.max}a||(h.beginPath(),h.moveTo(t.p2c(p),n.p2c(s)),a=!0);if(d>=n.max&&m>=n.max){h.lineTo(t.p2c(p),n.p2c(n.max)),h.lineTo(t.p2c(v),n.p2c(n.max));continue}if(d<=n.min&&m<=n.min){h.lineTo(t.p2c(p),n.p2c(n.min)),h.lineTo(t.p2c(v),n.p2c(n.min));continue}var g=p,y=v;d<=m&&d=n.min? -(p=(n.min-d)/(m-d)*(v-p)+p,d=n.min):m<=d&&m=n.min&&(v=(n.min-d)/(m-d)*(v-p)+p,m=n.min),d>=m&&d>n.max&&m<=n.max?(p=(n.max-d)/(m-d)*(v-p)+p,d=n.max):m>=d&&m>n.max&&d<=n.max&&(v=(n.max-d)/(m-d)*(v-p)+p,m=n.max),p!=g&&h.lineTo(t.p2c(g),n.p2c(d)),h.lineTo(t.p2c(p),n.p2c(d)),h.lineTo(t.p2c(v),n.p2c(m)),v!=y&&(h.lineTo(t.p2c(v),n.p2c(m)),h.lineTo(t.p2c(y),n.p2c(m)))}}h.save(),h.translate(m.left,m.top),h.lineJoin="round";var r=e.lines.lineWidth,i=e.shadowSize;if(r>0&&i>0){h.lineWidth=i,h.strokeStyle="rgba(0,0,0,0.1)";var s=Math.PI/18;t(e.datapoints,Math.sin(s)*(r/2+i/2),Math.cos(s)*(r/2+i/2),e.xaxis,e.yaxis),h.lineWidth=i/2,t(e.datapoints,Math.sin(s)*(r/2+i/4),Math.cos(s)*(r/2+i/4),e.xaxis,e.yaxis)}h.lineWidth=r,h.strokeStyle=e.color;var o=rt(e.lines,e.color,0,y);o&&(h.fillStyle=o,n(e.datapoints,e.xaxis,e.yaxis)),r>0&&t(e.datapoints,0,0,e.xaxis,e.yaxis),h.restore()}function et(e){function t(e,t,n,r,i,s,o,u){var a=e.points,f=e.pointsize;for(var l=0;ls.max||po.max)continue;h.beginPath(),c=s.p2c(c),p=o.p2c(p)+r,u=="circle"?h.arc(c,p,t,0,i?Math.PI:Math.PI*2,!1):u(h,c,p,t,i),h.closePath(),n&&(h.fillStyle=n,h.fill()),h.stroke()}}h.save(),h.translate(m.left,m.top);var n=e.points.lineWidth,r=e.shadowSize,i=e.points.radius,s=e.points.symbol;n==0&&(n=1e-4);if(n>0&&r>0){var o=r/2;h.lineWidth=o,h.strokeStyle="rgba(0,0,0,0.1)",t(e.datapoints,i,null,o+o/2,!0,e.xaxis,e.yaxis,s),h.strokeStyle="rgba(0,0,0,0.2)",t(e.datapoints,i,null,o/2,!0,e.xaxis,e.yaxis,s)}h.lineWidth=n,h.strokeStyle=e.color,t(e.datapoints,i,rt(e.points,e.color),0,!1,e.xaxis,e.yaxis,s),h.restore()}function tt(e,t,n,r,i,s,o,u,a,f,l,c){var h,p,d,v,m,g,y,b,w;l?(b=g=y=!0,m=!1,h=n,p=e,v=t+r,d=t+i,pu.max||va.max)return;hu.max&&(p=u.max,g=!1),da.max&&(v=a.max,y=!1),h=u.p2c(h),d=a.p2c(d),p= -u.p2c(p),v=a.p2c(v),o&&(f.beginPath(),f.moveTo(h,d),f.lineTo(h,v),f.lineTo(p,v),f.lineTo(p,d),f.fillStyle=o(d,v),f.fill()),c>0&&(m||g||y||b)&&(f.beginPath(),f.moveTo(h,d+s),m?f.lineTo(h,v+s):f.moveTo(h,v+s),y?f.lineTo(p,v+s):f.moveTo(p,v+s),g?f.lineTo(p,d+s):f.moveTo(p,d+s),b?f.lineTo(h,d+s):f.moveTo(h,d+s),f.stroke())}function nt(e){function t(t,n,r,i,s,o,u){var a=t.points,f=t.pointsize;for(var l=0;l"),n.push(""),i=!0),n.push('
    '+''+h.label+"")}i&&n.push("");if(n.length==0)return;var p=''+n.join("")+"
    ";if(a.legend.container!=null)e(a.legend.container).html(p);else{var d="",v=a.legend.position,g=a.legend.margin;g[0]==null&&(g=[g,g]),v.charAt(0)=="n"?d+="top:"+(g[1]+m.top)+"px;":v.charAt(0)=="s"&&(d+="bottom:"+(g[1]+m.bottom)+"px;"),v.charAt(1)=="e"?d+="right:"+(g[0]+m.right)+"px;":v.charAt(1)=="w"&&(d+="left:"+(g[0]+m.left)+"px;");var y=e('
    '+p.replace('style="','style="position:absolute;'+d+";")+"
    ").appendTo(t);if(a.legend.backgroundOpacity!=0){var b=a.legend.backgroundColor;b==null&&(b=a.grid.backgroundColor,b&&typeof b=="string"?b=e.color.parse(b):b=e.color.extract(y,"background-color"),b.a=1,b=b.toString());var w=y.children();e('
    ').prependTo(y).css("opacity",a.legend.backgroundOpacity)}}}function ut(e,t,n){var r=a.grid.mouseActiveRadius,i=r*r+1,s=null,o=!1,f,l,c;for(f=u.length-1;f>=0;--f){if(!n(u[f]))continue; -var h=u[f],p=h.xaxis,d=h.yaxis,v=h.datapoints.points,m=p.c2p(e),g=d.c2p(t),y=r/p.scale,b=r/d.scale;c=h.datapoints.pointsize,p.options.inverseTransform&&(y=Number.MAX_VALUE),d.options.inverseTransform&&(b=Number.MAX_VALUE);if(h.lines.show||h.points.show)for(l=0;ly||w-m<-y||E-g>b||E-g<-b)continue;var S=Math.abs(p.p2c(w)-e),x=Math.abs(d.p2c(E)-t),T=S*S+x*x;T=Math.min(k,w)&&g>=E+N&&g<=E+C:m>=w+N&&m<=w+C&&g>=Math.min(k,E)&&g<=Math.max(k,E))s=[f,l/c]}}}return s?(f=s[0],l=s[1],c=u[f].datapoints.pointsize,{datapoint:u[f].datapoints.points.slice(l*c,(l+1)*c),dataIndex:l,series:u[f],seriesIndex:f}):null}function at(e){a.grid.hoverable&&ct("plothover",e,function(e){return e["hoverable"]!=0})}function ft(e){a.grid. -hoverable&&ct("plothover",e,function(e){return!1})}function lt(e){ct("plotclick",e,function(e){return e["clickable"]!=0})}function ct(e,n,r){var i=c.offset(),s=n.pageX-i.left-m.left,o=n.pageY-i.top-m.top,u=L({left:s,top:o});u.pageX=n.pageX,u.pageY=n.pageY;var f=ut(s,o,r);f&&(f.pageX=parseInt(f.series.xaxis.p2c(f.datapoint[0])+i.left+m.left,10),f.pageY=parseInt(f.series.yaxis.p2c(f.datapoint[1])+i.top+m.top,10));if(a.grid.autoHighlight){for(var l=0;ls.max||io.max)return;var a=t.points.radius+t.points.lineWidth/2;p.lineWidth=a,p.strokeStyle=u;var f=1.5*a;r=s.p2c(r),i=o.p2c(i),p.beginPath(),t.points.symbol=="circle"?p.arc(r,i,f,0,2*Math.PI,!1):t.points.symbol(p,r,i,f,!1),p.closePath(),p.stroke()}function yt(t,n){var r=typeof t.highlightColor=="string"?t.highlightColor -:e.color.parse(t.color).scale("a",.5).toString(),i=r,s=t.bars.align=="left"?0:-t.bars.barWidth/2;p.lineWidth=t.bars.lineWidth,p.strokeStyle=r,tt(n[0],n[1],n[2]||0,s,s+t.bars.barWidth,0,function(){return i},t.xaxis,t.yaxis,p,t.bars.horizontal,t.bars.lineWidth)}function bt(t,n,r,i){if(typeof t=="string")return t;var s=h.createLinearGradient(0,r,0,n);for(var o=0,u=t.colors.length;o
    ").css({position -:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),n=this.text[t]=e("
    ").addClass(t).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),n},n.prototype.getTextInfo=function(t,n,r,i,s){var o,u,a,f;n=""+n,typeof r=="object"?o=r.style+" "+r.variant+" "+r.weight+" "+r.size+"px/"+r.lineHeight+"px "+r.family:o=r,u=this._textCache[t],u==null&&(u=this._textCache[t]={}),a=u[o],a==null&&(a=u[o]={}),f=a[n];if(f==null){var l=e("
    ").html(n).css({position:"absolute","max-width":s,top:-9999}).appendTo(this.getTextLayer(t));typeof r=="object"?l.css({font:o,color:r.color}):typeof r=="string"&&l.addClass(r),f=a[n]={width:l.outerWidth(!0),height:l.outerHeight(!0),element:l,positions:[]},l.detach()}return f},n.prototype.addText=function(e,t,n,r,i,s,o,u,a){var f=this.getTextInfo(e,r,i,s,o),l=f.positions;u=="center"?t-=f.width/2:u=="right"&&(t-=f.width),a=="middle"?n-=f.height/2:a=="bottom"&&(n-=f -.height);for(var c=0,h;h=l[c];c++)if(h.x==t&&h.y==n){h.active=!0;return}h={active:!0,rendered:!1,element:l.length?f.element.clone():f.element,x:t,y:n},l.push(h),h.element.css({top:Math.round(n),left:Math.round(t),"text-align":u})},n.prototype.removeText=function(e,n,r,i,s,o){if(i==null){var u=this._textCache[e];if(u!=null)for(var a in u)if(t.call(u,a)){var f=u[a];for(var l in f)if(t.call(f,l)){var c=f[l].positions;for(var h=0,p;p=c[h];h++)p.active=!1}}}else{var c=this.getTextInfo(e,i,s,o).positions;for(var h=0,p;p=c[h];h++)p.x==n&&p.y==r&&(p.active=!1)}},e.plot=function(t,n,i){var s=new r(e(t),n,i,e.plot.plugins);return s},e.plot.version="0.8.1",e.plot.plugins=[],e.fn.plot=function(t,n){return this.each(function(){e.plot(this,t,n)})}}(jQuery),define("jquery.flot",function(){}),function(e){function r(r){function p(t,n,r){l||(l=!0,s=t.getCanvas(),o=e(s).parent(),i=t.getOptions(),t.setData(d(t.getData())))}function d(t){var n=0,r=0,s=0,o=i.series.pie.combine.color,u=[];for(var a=0;ai.series.pie.combine.threshold)&&u.push({data:[[1,f]],color:t[a].color,label:t[a].label,angle:f*Math.PI*2/n,percent:f/(n/100)})}return s>1&&u.push({data:[[1,r]],color:o,label:i.series.pie.combine.label,angle:r*Math.PI*2/n,percent:r/(n/100)}),u}function v(r,s){function y(){c.clearRect(0,0,h,p),o.children().filter(".pieLabel, .pieLabelBackground").remove()}function b(){var e=i.series.pie.shadow.left,t=i.series.pie.shadow.top,n=10,r=i.series.pie.shadow.alpha,s=i.series.pie.radius>1?i.series.pie.radius:u*i.series.pie.radius;if(s>=h/2-e||s*i.series.pie.tilt>=p/2-t||s<=n)return;c.save -(),c.translate(e,t),c.globalAlpha=r,c.fillStyle="#000",c.translate(a,f),c.scale(1,i.series.pie.tilt);for(var o=1;o<=n;o++)c.beginPath(),c.arc(0,0,s,0,Math.PI*2,!1),c.fill(),s-=o;c.restore()}function w(){function l(e,t,i){if(e<=0||isNaN(e))return;i?c.fillStyle=t:(c.strokeStyle=t,c.lineJoin="round"),c.beginPath(),Math.abs(e-Math.PI*2)>1e-9&&c.moveTo(0,0),c.arc(0,0,n,r,r+e/2,!1),c.arc(0,0,n,r+e/2,r+e,!1),c.closePath(),r+=e,i?c.fill():c.stroke()}function d(){function l(t,n,s){if(t.data[0][1]==0)return!0;var u=i.legend.labelFormatter,l,c=i.series.pie.label.formatter;u?l=u(t.label,t):l=t.label,c&&(l=c(l,t));var d=(n+t.angle+n)/2,v=a+Math.round(Math.cos(d)*r),m=f+Math.round(Math.sin(d)*r)*i.series.pie.tilt,g=""+l+"";o.append(g);var y=o.children("#pieLabel"+s),b=m-y.height()/2,w=v-y.width()/2;y.css("top",b),y.css("left",w);if(0-b>0||0-w>0||p-(b+y.height())<0||h-(w+y.width())<0)return!1;if(i.series -.pie.label.background.opacity!=0){var E=i.series.pie.label.background.color;E==null&&(E=t.color);var S="top:"+b+"px;left:"+w+"px;";e("
    ").css("opacity",i.series.pie.label.background.opacity).insertBefore(y)}return!0}var n=t,r=i.series.pie.label.radius>1?i.series.pie.label.radius:u*i.series.pie.label.radius;for(var s=0;s=i.series.pie.label.threshold*100&&!l(v[s],n,s))return!1;n+=v[s].angle}return!0}var t=Math.PI*i.series.pie.startAngle,n=i.series.pie.radius>1?i.series.pie.radius:u*i.series.pie.radius;c.save(),c.translate(a,f),c.scale(1,i.series.pie.tilt),c.save();var r=t;for(var s=0;s0){c.save(),c.lineWidth=i.series.pie.stroke.width,r=t;for(var s=0;sh-u&&(a=h-u);var v=r.getData(),g=0;do g>0&&(u*=n),g+=1,y(),i.series.pie.tilt<=.8&&b();while(!w()&&g=t&&(y(),o.prepend("
    Could not draw pie with labels contained inside canvas
    ")),r.setSeries&&r.insertLegend&&(r.setSeries(v),r.insertLegend())}function m(e){if(i.series.pie.innerRadius>0){e.save();var t=i.series.pie.innerRadius>1?i.series.pie.innerRadius:u*i.series.pie.innerRadius;e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle=i.series.pie.stroke.color,e.arc(0,0,t,0,Math.PI*2,!1),e.fill(),e.closePath(),e.restore(),e.save(),e.beginPath(),e.strokeStyle=i.series.pie.stroke.color -,e.arc(0,0,t,0,Math.PI*2,!1),e.stroke(),e.closePath(),e.restore()}}function g(e,t){for(var n=!1,r=-1,i=e.length,s=i-1;++r1?i.series.pie.radius:u*i.series.pie.radius,o,l;for(var h=0;h1e-9&&t.moveTo(0,0),t.arc(0,0,r,e.startAngle,e.startAngle+e.angle/2,!1),t.arc(0,0,r,e.startAngle+e.angle/2,e.startAngle+e.angle,!1),t.closePath(),t.fill()}var n=e.getOptions(),r=n.series.pie.radius>1?n.series.pie.radius:u*n.series.pie.radius;t.save(),t.translate(a,f),t.scale(1,n.series.pie.tilt);for(var i=0;i1?t.series.pie.tilt=1:t.series.pie.tilt<0&&(t.series.pie.tilt=0))}),r.hooks.bindEvents.push(function(e,t){var n=e.getOptions();n.series.pie.show&&(n.grid.hoverable&&t.unbind("mousemove").mousemove(b),n.grid.clickable&& -t.unbind("click").click(w))}),r.hooks.processDatapoints.push(function(e,t,n,r){var i=e.getOptions();i.series.pie.show&&p(e,t,n,r)}),r.hooks.drawOverlay.push(function(e,t){var n=e.getOptions();n.series.pie.show&&N(e,t)}),r.hooks.draw.push(function(e,t){var n=e.getOptions();n.series.pie.show&&v(e,t)})}var t=10,n=.95,i={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(e,t){return"
    "+e+"
    "+Math.round(t.percent)+"%
    "},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};e.plot.plugins.push({init:r,options:i,name:"pie",version:"1.1"})}(jQuery),define("jquery.flot.pie",function(){}),define("text",["module"],function(e){var t,n,r,i,s,o=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0" -],u=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!="undefined"&&location.href,l=f&&location.protocol&&location.protocol.replace(/\:/,""),c=f&&location.hostname,h=f&&(location.port||undefined),p={},d=e.config&&e.config()||{};t={version:"2.0.10",strip:function(e){if(e){e=e.replace(u,"");var t=e.match(a);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.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:d.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=o[t];try{e=new ActiveXObject(n)}catch(r){}if(e){o=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.indexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)? -(t=e.substring(0,s),n=e.substring(s+1,e.length)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,d.isBuild&&(p[e]=r),i(r)},load:function(e,n,r,i){if(i.isBuild&&!i.inlineText){r();return}d.isBuild=i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),a=d.useXhr||t.useXhr;if(u.indexOf("empty:")===0){r();return}!f||a(u,l,c,h)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(p.hasOwnProperty(n)){var s=t.jsEscape(p[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function( -e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(d.env==="node"||!d.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node&&!process.versions["node-webkit"])n=require.nodeRequire("fs"),t.get=function(e,t,r){try{var i=n.readFileSync(e,"utf8");i.indexOf("")===0&&(i=i.substring(1)),t(i)}catch(s){r(s)}};else if(d.env==="xhr"||!d.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);d.onXhr&&d.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r(o)):n(s.responseText),d.onXhrComplete&&d.onXhrComplete(s,e))},s.send(null)};else if(d.env==="rhino"||!d.env&&typeof Packages!="undefined"&&typeof java!="undefined" -)t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),r!==null&&n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(d.env==="xpconnect"||!d.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var n,o,u,a={};s&&(e=e.replace(/\//g,"\\")),u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8" -,n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),a),o.close(),n.close(),t(a.value)}catch(f){throw new Error((u&&u.path||"")+": "+f)}};return t}); \ No newline at end of file +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + +!function(a,b){function c(a){var b=ob[a]={};return $.each(a.split(bb),function(a,c){b[c]=!0}),b}function d(a,c,d){if(d===b&&1===a.nodeType){var e="data-"+c.replace(qb,"-$1").toLowerCase();if(d=a.getAttribute(e),"string"==typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:+d+""===d?+d:pb.test(d)?$.parseJSON(d):d}catch(f){}$.data(a,c,d)}else d=b}return d}function e(a){var b;for(b in a)if(("data"!==b||!$.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function f(){return!1}function g(){return!0}function h(a){return!a||!a.parentNode||11===a.parentNode.nodeType}function i(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function j(a,b,c){if(b=b||0,$.isFunction(b))return $.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return $.grep(a,function(a){return a===b===c});if("string"==typeof b){var d=$.grep(a,function(a){return 1===a.nodeType});if(Kb.test(b))return $.filter(b,d,!c);b=$.filter(b,d)}return $.grep(a,function(a){return $.inArray(a,b)>=0===c})}function k(a){var b=Nb.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function l(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function m(a,b){if(1===b.nodeType&&$.hasData(a)){var c,d,e,f=$._data(a),g=$._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)$.event.add(b,c,h[c][d])}g.data&&(g.data=$.extend({},g.data))}}function n(a,b){var c;1===b.nodeType&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),$.support.html5Clone&&a.innerHTML&&!$.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Xb.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.selected=a.defaultSelected:"input"===c||"textarea"===c?b.defaultValue=a.defaultValue:"script"===c&&b.text!==a.text&&(b.text=a.text),b.removeAttribute($.expando))}function o(a){return"undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName("*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll("*"):[]}function p(a){Xb.test(a.type)&&(a.defaultChecked=a.checked)}function q(a,b){if(b in a)return b;for(var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=qc.length;e--;)if(b=qc[e]+c,b in a)return b;return d}function r(a,b){return a=b||a,"none"===$.css(a,"display")||!$.contains(a.ownerDocument,a)}function s(a,b){for(var c,d,e=[],f=0,g=a.length;g>f;f++)c=a[f],c.style&&(e[f]=$._data(c,"olddisplay"),b?(!e[f]&&"none"===c.style.display&&(c.style.display=""),""===c.style.display&&r(c)&&(e[f]=$._data(c,"olddisplay",w(c.nodeName)))):(d=cc(c,"display"),!e[f]&&"none"!==d&&$._data(c,"olddisplay",d)));for(f=0;g>f;f++)c=a[f],c.style&&(b&&"none"!==c.style.display&&""!==c.style.display||(c.style.display=b?e[f]||"":"none"));return a}function t(a,b,c){var d=jc.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function u(a,b,c,d){for(var e=c===(d?"border":"content")?4:"width"===b?1:0,f=0;4>e;e+=2)"margin"===c&&(f+=$.css(a,c+pc[e],!0)),d?("content"===c&&(f-=parseFloat(cc(a,"padding"+pc[e]))||0),"margin"!==c&&(f-=parseFloat(cc(a,"border"+pc[e]+"Width"))||0)):(f+=parseFloat(cc(a,"padding"+pc[e]))||0,"padding"!==c&&(f+=parseFloat(cc(a,"border"+pc[e]+"Width"))||0));return f}function v(a,b,c){var d="width"===b?a.offsetWidth:a.offsetHeight,e=!0,f=$.support.boxSizing&&"border-box"===$.css(a,"boxSizing");if(0>=d){if(d=cc(a,b),(0>d||null==d)&&(d=a.style[b]),kc.test(d))return d;e=f&&($.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+u(a,b,c||(f?"border":"content"),e)+"px"}function w(a){if(mc[a])return mc[a];var b=$("<"+a+">").appendTo(P.body),c=b.css("display");return b.remove(),("none"===c||""===c)&&(dc=P.body.appendChild(dc||$.extend(P.createElement("iframe"),{frameBorder:0,width:0,height:0})),ec&&dc.createElement||(ec=(dc.contentWindow||dc.contentDocument).document,ec.write(""),ec.close()),b=ec.body.appendChild(ec.createElement(a)),c=cc(b,"display"),P.body.removeChild(dc)),mc[a]=c,c}function x(a,b,c,d){var e;if($.isArray(b))$.each(b,function(b,e){c||tc.test(a)?d(a,e):x(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==$.type(b))d(a,b);else for(e in b)x(a+"["+e+"]",b[e],c,d)}function y(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(bb),h=0,i=g.length;if($.isFunction(c))for(;i>h;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function z(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;for(var h,i=a[f],j=0,k=i?i.length:0,l=a===Jc;k>j&&(l||!h);j++)h=i[j](c,d,e),"string"==typeof h&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=z(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=z(a,c,d,e,"*",g)),h}function A(a,c){var d,e,f=$.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&$.extend(!0,a,e)}function B(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);for(;"*"===j[0];)j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}return g?(g!==j[0]&&j.unshift(g),d[g]):void 0}function C(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;if(a.dataFilter&&(b=a.dataFilter(b,a.dataType)),g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if("*"!==e){if("*"!==h&&h!==e){if(c=i[h+" "+e]||i["* "+e],!c)for(d in i)if(f=d.split(" "),f[1]===e&&(c=i[h+" "+f[0]]||i["* "+f[0]])){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function D(){try{return new a.XMLHttpRequest}catch(b){}}function E(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function F(){return setTimeout(function(){Uc=b},0),Uc=$.now()}function G(a,b){$.each(b,function(b,c){for(var d=($c[b]||[]).concat($c["*"]),e=0,f=d.length;f>e;e++)if(d[e].call(a,b,c))return})}function H(a,b,c){var d,e=0,f=Zc.length,g=$.Deferred().always(function(){delete h.elem}),h=function(){for(var b=Uc||F(),c=Math.max(0,i.startTime+i.duration-b),d=1-(c/i.duration||0),e=0,f=i.tweens.length;f>e;e++)i.tweens[e].run(d);return g.notifyWith(a,[i,d,c]),1>d&&f?c:(g.resolveWith(a,[i]),!1)},i=g.promise({elem:a,props:$.extend({},b),opts:$.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Uc||F(),duration:c.duration,tweens:[],createTween:function(b,c){var d=$.Tween(a,i.opts,b,c,i.opts.specialEasing[b]||i.opts.easing);return i.tweens.push(d),d},stop:function(b){for(var c=0,d=b?i.tweens.length:0;d>c;c++)i.tweens[c].run(1);return b?g.resolveWith(a,[i,b]):g.rejectWith(a,[i,b]),this}}),j=i.props;for(I(j,i.opts.specialEasing);f>e;e++)if(d=Zc[e].call(i,a,j,i.opts))return d;return G(i,j),$.isFunction(i.opts.start)&&i.opts.start.call(a,i),$.fx.timer($.extend(h,{anim:i,queue:i.opts.queue,elem:a})),i.progress(i.opts.progress).done(i.opts.done,i.opts.complete).fail(i.opts.fail).always(i.opts.always)}function I(a,b){var c,d,e,f,g;for(c in a)if(d=$.camelCase(c),e=b[d],f=a[c],$.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=$.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function J(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],p=a.nodeType&&r(a);c.queue||(j=$._queueHooks(a,"fx"),null==j.unqueued&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,$.queue(a,"fx").length||j.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],"inline"===$.css(a,"display")&&"none"===$.css(a,"float")&&($.support.inlineBlockNeedsLayout&&"inline"!==w(a.nodeName)?m.zoom=1:m.display="inline-block")),c.overflow&&(m.overflow="hidden",$.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b)if(f=b[d],Wc.exec(f)){if(delete b[d],f===(p?"hide":"show"))continue;o.push(d)}if(g=o.length)for(h=$._data(a,"fxshow")||$._data(a,"fxshow",{}),p?$(a).show():l.done(function(){$(a).hide()}),l.done(function(){var b;$.removeData(a,"fxshow",!0);for(b in n)$.style(a,b,n[b])}),d=0;g>d;d++)e=o[d],i=l.createTween(e,p?h[e]:0),n[e]=h[e]||$.style(a,e),e in h||(h[e]=i.start,p&&(i.end=i.start,i.start="width"===e||"height"===e?1:0))}function K(a,b,c,d,e){return new K.prototype.init(a,b,c,d,e)}function L(a,b){for(var c,d={height:a},e=0;4>e;e+=2-b)c=pc[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function M(a){return $.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}var N,O,P=a.document,Q=a.location,R=a.navigator,S=a.jQuery,T=a.$,U=Array.prototype.push,V=Array.prototype.slice,W=Array.prototype.indexOf,X=Object.prototype.toString,Y=Object.prototype.hasOwnProperty,Z=String.prototype.trim,$=function(a,b){return new $.fn.init(a,b,N)},_=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,ab=/\S/,bb=/\s+/,cb=ab.test(" ")?/^[\s\xA0]+|[\s\xA0]+$/g:/^\s+|\s+$/g,db=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,eb=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,fb=/^[\],:{}\s]*$/,gb=/(?:^|:|,)(?:\s*\[)+/g,hb=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,ib=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,jb=/^-ms-/,kb=/-([\da-z])/gi,lb=function(a,b){return(b+"").toUpperCase()},mb=function(){P.addEventListener?(P.removeEventListener("DOMContentLoaded",mb,!1),$.ready()):"complete"===P.readyState&&(P.detachEvent("onreadystatechange",mb),$.ready())},nb={};$.fn=$.prototype={constructor:$,init:function(a,c,d){var e,f,g;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if("string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:db.exec(a),e&&(e[1]||!c)){if(e[1])return c=c instanceof $?c[0]:c,g=c&&c.nodeType?c.ownerDocument||c:P,a=$.parseHTML(e[1],g,!0),eb.test(e[1])&&$.isPlainObject(c)&&this.attr.call(a,c,!0),$.merge(this,a);if(f=P.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return d.find(a);this.length=1,this[0]=f}return this.context=P,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return $.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),$.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return V.call(this)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=$.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,"find"===b?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return $.each(this,a,b)},ready:function(a){return $.ready.promise().done(a),this},eq:function(a){return a=+a,-1===a?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(V.apply(this,arguments),"slice",V.call(arguments).join(","))},map:function(a){return this.pushStack($.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:U,sort:[].sort,splice:[].splice},$.fn.init.prototype=$.fn,$.extend=$.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),"object"!=typeof h&&!$.isFunction(h)&&(h={}),j===i&&(h=this,--i);j>i;i++)if(null!=(a=arguments[i]))for(c in a)d=h[c],e=a[c],h!==e&&(k&&e&&($.isPlainObject(e)||(f=$.isArray(e)))?(f?(f=!1,g=d&&$.isArray(d)?d:[]):g=d&&$.isPlainObject(d)?d:{},h[c]=$.extend(k,g,e)):e!==b&&(h[c]=e));return h},$.extend({noConflict:function(b){return a.$===$&&(a.$=T),b&&a.jQuery===$&&(a.jQuery=S),$},isReady:!1,readyWait:1,holdReady:function(a){a?$.readyWait++:$.ready(!0)},ready:function(a){if(a===!0?!--$.readyWait:!$.isReady){if(!P.body)return setTimeout($.ready,1);$.isReady=!0,a!==!0&&--$.readyWait>0||(O.resolveWith(P,[$]),$.fn.trigger&&$(P).trigger("ready").off("ready"))}},isFunction:function(a){return"function"===$.type(a)},isArray:Array.isArray||function(a){return"array"===$.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?String(a):nb[X.call(a)]||"object"},isPlainObject:function(a){if(!a||"object"!==$.type(a)||a.nodeType||$.isWindow(a))return!1;try{if(a.constructor&&!Y.call(a,"constructor")&&!Y.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||Y.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return a&&"string"==typeof a?("boolean"==typeof b&&(c=b,b=0),b=b||P,(d=eb.exec(a))?[b.createElement(d[1])]:(d=$.buildFragment([a],b,c?null:[]),$.merge([],(d.cacheable?$.clone(d.fragment):d.fragment).childNodes))):null},parseJSON:function(b){return b&&"string"==typeof b?(b=$.trim(b),a.JSON&&a.JSON.parse?a.JSON.parse(b):fb.test(b.replace(hb,"@").replace(ib,"]").replace(gb,""))?new Function("return "+b)():($.error("Invalid JSON: "+b),void 0)):null},parseXML:function(c){var d,e;if(!c||"string"!=typeof c)return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&$.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&ab.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(jb,"ms-").replace(kb,lb)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||$.isFunction(a);if(d)if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;g>f&&c.apply(a[f++],d)!==!1;);else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;g>f&&c.call(a[f],f,a[f++])!==!1;);return a},trim:Z?function(a){return null==a?"":Z.call(a)}:function(a){return null==a?"":a.toString().replace(cb,"")},makeArray:function(a,b){var c,d=b||[];return null!=a&&(c=$.type(a),null==a.length||"string"===c||"function"===c||"regexp"===c||$.isWindow(a)?U.call(d,a):$.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(W)return W.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if("number"==typeof d)for(;d>f;f++)a[e++]=c[f];else for(;c[f]!==b;)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;for(c=!!c;g>f;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof $||i!==b&&"number"==typeof i&&(i>0&&a[0]&&a[i-1]||0===i||$.isArray(a));if(j)for(;i>h;h++)e=c(a[h],h,d),null!=e&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),null!=e&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return"string"==typeof c&&(d=a[c],c=a,a=d),$.isFunction(a)?(e=V.call(arguments,2),f=function(){return a.apply(c,e.concat(V.call(arguments)))},f.guid=a.guid=a.guid||f.guid||$.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=null==d,k=0,l=a.length;if(d&&"object"==typeof d){for(k in d)$.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){if(i=h===b&&$.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call($(a),c)}):(c.call(a,e),c=null)),c)for(;l>k;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),$.ready.promise=function(b){if(!O)if(O=$.Deferred(),"complete"===P.readyState||"loading"!==P.readyState&&P.addEventListener)setTimeout($.ready,1);else if(P.addEventListener)P.addEventListener("DOMContentLoaded",mb,!1),a.addEventListener("load",$.ready,!1);else{P.attachEvent("onreadystatechange",mb),a.attachEvent("onload",$.ready);var c=!1;try{c=null==a.frameElement&&P.documentElement}catch(d){}c&&c.doScroll&&function e(){if(!$.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}$.ready()}}()}return O.promise(b)},$.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){nb["[object "+b+"]"]=b.toLowerCase()}),N=$(P);var ob={};$.Callbacks=function(a){a="string"==typeof a?ob[a]||c(a):$.extend({},a);var d,e,f,g,h,i,j=[],k=!a.once&&[],l=function(b){for(d=a.memory&&b,e=!0,i=g||0,g=0,h=j.length,f=!0;j&&h>i;i++)if(j[i].apply(b[0],b[1])===!1&&a.stopOnFalse){d=!1;break}f=!1,j&&(k?k.length&&l(k.shift()):d?j=[]:m.disable())},m={add:function(){if(j){var b=j.length;!function c(b){$.each(b,function(b,d){!$.isFunction(d)||a.unique&&m.has(d)?d&&d.length&&c(d):j.push(d)})}(arguments),f?h=j.length:d&&(g=b,l(d))}return this},remove:function(){return j&&$.each(arguments,function(a,b){for(var c;(c=$.inArray(b,j,c))>-1;)j.splice(c,1),f&&(h>=c&&h--,i>=c&&i--)}),this},has:function(a){return $.inArray(a,j)>-1},empty:function(){return j=[],this},disable:function(){return j=k=d=b,this},disabled:function(){return!j},lock:function(){return k=b,d||m.disable(),this},locked:function(){return!k},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],j&&(!e||k)&&(f?k.push(b):l(b)),this},fire:function(){return m.fireWith(this,arguments),this},fired:function(){return!!e}};return m},$.extend({Deferred:function(a){var b=[["resolve","done",$.Callbacks("once memory"),"resolved"],["reject","fail",$.Callbacks("once memory"),"rejected"],["notify","progress",$.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return $.Deferred(function(c){$.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]]($.isFunction(g)?function(){var a=g.apply(this,arguments);a&&$.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return"object"==typeof a?$.extend(a,d):d}},e={};return d.pipe=d.then,$.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b,c,d,e=0,f=V.call(arguments),g=f.length,h=1!==g||a&&$.isFunction(a.promise)?g:0,i=1===h?a:$.Deferred(),j=function(a,c,d){return function(e){c[a]=this,d[a]=arguments.length>1?V.call(arguments):e,d===b?i.notifyWith(c,d):--h||i.resolveWith(c,d)}};if(g>1)for(b=new Array(g),c=new Array(g),d=new Array(g);g>e;e++)f[e]&&$.isFunction(f[e].promise)?f[e].promise().done(j(e,d,f)).fail(i.reject).progress(j(e,c,b)):--h;return h||i.resolveWith(d,f),i.promise()}}),$.support=function(){var b,c,d,e,f,g,h,i,j,k,l,m=P.createElement("div");if(m.setAttribute("className","t"),m.innerHTML="
    a",c=m.getElementsByTagName("*"),d=m.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5",!c||!c.length||!d)return{};e=P.createElement("select"),f=e.appendChild(P.createElement("option")),g=m.getElementsByTagName("input")[0],b={leadingWhitespace:3===m.firstChild.nodeType,tbody:!m.getElementsByTagName("tbody").length,htmlSerialize:!!m.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:"/a"===d.getAttribute("href"),opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:"on"===g.value,optSelected:f.selected,getSetAttribute:"t"!==m.className,enctype:!!P.createElement("form").enctype,html5Clone:"<:nav>"!==P.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===P.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},g.checked=!0,b.noCloneChecked=g.cloneNode(!0).checked,e.disabled=!0,b.optDisabled=!f.disabled;try{delete m.test}catch(n){b.deleteExpando=!1}if(!m.addEventListener&&m.attachEvent&&m.fireEvent&&(m.attachEvent("onclick",l=function(){b.noCloneEvent=!1}),m.cloneNode(!0).fireEvent("onclick"),m.detachEvent("onclick",l)),g=P.createElement("input"),g.value="t",g.setAttribute("type","radio"),b.radioValue="t"===g.value,g.setAttribute("checked","checked"),g.setAttribute("name","t"),m.appendChild(g),h=P.createDocumentFragment(),h.appendChild(m.lastChild),b.checkClone=h.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=g.checked,h.removeChild(g),h.appendChild(m),m.attachEvent)for(j in{submit:!0,change:!0,focusin:!0})i="on"+j,k=i in m,k||(m.setAttribute(i,"return;"),k="function"==typeof m[i]),b[j+"Bubbles"]=k;return $(function(){var c,d,e,f,g="padding:0;margin:0;border:0;display:block;overflow:hidden;",h=P.getElementsByTagName("body")[0];h&&(c=P.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",h.insertBefore(c,h.firstChild),d=P.createElement("div"),c.appendChild(d),d.innerHTML="
    t
    ",e=d.getElementsByTagName("td"),e[0].style.cssText="padding:0;margin:0;border:0;display:none",k=0===e[0].offsetHeight,e[0].style.display="",e[1].style.display="none",b.reliableHiddenOffsets=k&&0===e[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=4===d.offsetWidth,b.doesNotIncludeMarginInBodyOffset=1!==h.offsetTop,a.getComputedStyle&&(b.pixelPosition="1%"!==(a.getComputedStyle(d,null)||{}).top,b.boxSizingReliable="4px"===(a.getComputedStyle(d,null)||{width:"4px"}).width,f=P.createElement("div"),f.style.cssText=d.style.cssText=g,f.style.marginRight=f.style.width="0",d.style.width="1px",d.appendChild(f),b.reliableMarginRight=!parseFloat((a.getComputedStyle(f,null)||{}).marginRight)),"undefined"!=typeof d.style.zoom&&(d.innerHTML="",d.style.cssText=g+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.style.overflow="visible",d.innerHTML="
    ",d.firstChild.style.width="5px",b.shrinkWrapBlocks=3!==d.offsetWidth,c.style.zoom=1),h.removeChild(c),c=d=e=f=null)}),h.removeChild(m),c=d=e=f=g=h=m=null,b}();var pb=/^(?:\{.*\}|\[.*\])$/,qb=/([A-Z])/g;$.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+($.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?$.cache[a[$.expando]]:a[$.expando],!!a&&!e(a)},data:function(a,c,d,e){if($.acceptData(a)){var f,g,h=$.expando,i="string"==typeof c,j=a.nodeType,k=j?$.cache:a,l=j?a[h]:a[h]&&h;if(l&&k[l]&&(e||k[l].data)||!i||d!==b)return l||(j?a[h]=l=$.deletedIds.pop()||++$.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=$.noop)),("object"==typeof c||"function"==typeof c)&&(e?k[l]=$.extend(k[l],c):k[l].data=$.extend(k[l].data,c)),f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[$.camelCase(c)]=d),i?(g=f[c],null==g&&(g=f[$.camelCase(c)])):g=f,g}},removeData:function(a,b,c){if($.acceptData(a)){var d,f,g,h=a.nodeType,i=h?$.cache:a,j=h?a[$.expando]:$.expando;if(i[j]){if(b&&(d=c?i[j]:i[j].data)){$.isArray(b)||(b in d?b=[b]:(b=$.camelCase(b),b=b in d?[b]:b.split(" ")));for(f=0,g=b.length;g>f;f++)delete d[b[f]];if(!(c?e:$.isEmptyObject)(d))return}(c||(delete i[j].data,e(i[j])))&&(h?$.cleanData([a],!0):$.support.deleteExpando||i!=i.window?delete i[j]:i[j]=null)}}},_data:function(a,b,c){return $.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&$.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),$.fn.extend({data:function(a,c){var e,f,g,h,i,j=this[0],k=0,l=null;if(a===b){if(this.length&&(l=$.data(j),1===j.nodeType&&!$._data(j,"parsedAttrs"))){for(g=j.attributes,i=g.length;i>k;k++)h=g[k].name,0===h.indexOf("data-")&&(h=$.camelCase(h.substring(5)),d(j,h,l[h]));$._data(j,"parsedAttrs",!0)}return l}return"object"==typeof a?this.each(function(){$.data(this,a)}):(e=a.split(".",2),e[1]=e[1]?"."+e[1]:"",f=e[1]+"!",$.access(this,function(c){return c===b?(l=this.triggerHandler("getData"+f,[e[0]]),l===b&&j&&(l=$.data(j,a),l=d(j,a,l)),l===b&&e[1]?this.data(e[0]):l):(e[1]=c,this.each(function(){var b=$(this);b.triggerHandler("setData"+f,e),$.data(this,a,c),b.triggerHandler("changeData"+f,e)}),void 0)},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){$.removeData(this,a)})}}),$.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=$._data(a,b),c&&(!d||$.isArray(c)?d=$._data(a,b,$.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=$.queue(a,b),d=c.shift(),e=$._queueHooks(a,b),f=function(){$.dequeue(a,b)};"inprogress"===d&&(d=c.shift()),d&&("fx"===b&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return $._data(a,c)||$._data(a,c,{empty:$.Callbacks("once memory").add(function(){$.removeData(a,b+"queue",!0),$.removeData(a,c,!0)})})}}),$.fn.extend({queue:function(a,c){var d=2;return"string"!=typeof a&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){$.removeAttr(this,a)})},prop:function(a,b){return $.access(this,$.prop,a,b,arguments.length>1)},removeProp:function(a){return a=$.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if($.isFunction(a))return this.each(function(b){$(this).addClass(a.call(this,b,this.className))});if(a&&"string"==typeof a)for(b=a.split(bb),c=0,d=this.length;d>c;c++)if(e=this[c],1===e.nodeType)if(e.className||1!==b.length){for(f=" "+e.className+" ",g=0,h=b.length;h>g;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=$.trim(f)}else e.className=a;return this},removeClass:function(a){var c,d,e,f,g,h,i;if($.isFunction(a))return this.each(function(b){$(this).removeClass(a.call(this,b,this.className))});if(a&&"string"==typeof a||a===b)for(c=(a||"").split(bb),h=0,i=this.length;i>h;h++)if(e=this[h],1===e.nodeType&&e.className){for(d=(" "+e.className+" ").replace(ub," "),f=0,g=c.length;g>f;f++)for(;d.indexOf(" "+c[f]+" ")>-1;)d=d.replace(" "+c[f]+" "," ");e.className=a?$.trim(d):""}return this},toggleClass:function(a,b){var c=typeof a,d="boolean"==typeof b;return $.isFunction(a)?this.each(function(c){$(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===c)for(var e,f=0,g=$(this),h=b,i=a.split(bb);e=i[f++];)h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e);else("undefined"===c||"boolean"===c)&&(this.className&&$._data(this,"__className__",this.className),this.className=this.className||a===!1?"":$._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];{if(arguments.length)return e=$.isFunction(a),this.each(function(d){var f,g=$(this);1===this.nodeType&&(f=e?a.call(this,d,g.val()):a,null==f?f="":"number"==typeof f?f+="":$.isArray(f)&&(f=$.map(f,function(a){return null==a?"":a+""})),c=$.valHooks[this.type]||$.valHooks[this.nodeName.toLowerCase()],c&&"set"in c&&c.set(this,f,"value")!==b||(this.value=f))});if(f)return c=$.valHooks[f.type]||$.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,"string"==typeof d?d.replace(vb,""):null==d?"":d)}}}),$.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i="select-one"===a.type;if(0>f)return null;for(c=i?f:0,d=i?f+1:h.length;d>c;c++)if(e=h[c],!(!e.selected||($.support.optDisabled?e.disabled:null!==e.getAttribute("disabled"))||e.parentNode.disabled&&$.nodeName(e.parentNode,"optgroup"))){if(b=$(e).val(),i)return b;g.push(b)}return i&&!g.length&&h.length?$(h[f]).val():g},set:function(a,b){var c=$.makeArray(b);return $(a).find("option").each(function(){this.selected=$.inArray($(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(a&&3!==i&&8!==i&&2!==i)return e&&$.isFunction($.fn[c])?$(a)[c](d):"undefined"==typeof a.getAttribute?$.prop(a,c,d):(h=1!==i||!$.isXMLDoc(a),h&&(c=c.toLowerCase(),g=$.attrHooks[c]||(zb.test(c)?sb:rb)),d!==b?null===d?($.removeAttr(a,c),void 0):g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d):g&&"get"in g&&h&&null!==(f=g.get(a,c))?f:(f=a.getAttribute(c),null===f?b:f))},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&1===a.nodeType)for(d=b.split(bb);g=0:void 0}})});var Bb=/^(?:textarea|input|select)$/i,Cb=/^([^\.]*|)(?:\.(.+)|)$/,Db=/(?:^|\s)hover(\.\S+|)\b/,Eb=/^key/,Fb=/^(?:mouse|contextmenu)|click/,Gb=/^(?:focusinfocus|focusoutblur)$/,Hb=function(a){return $.event.special.hover?a:a.replace(Db,"mouseenter$1 mouseleave$1")};$.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;if(3!==a.nodeType&&8!==a.nodeType&&c&&d&&(g=$._data(a))){for(d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=$.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return"undefined"==typeof $||a&&$.event.triggered===a.type?b:$.event.dispatch.apply(h.elem,arguments)},h.elem=a),c=$.trim(Hb(c)).split(" "),j=0;j=0&&(q=q.slice(0,-1),h=!0),q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),(!e||$.event.customEvent[q])&&!$.event.global[q])return;if(c="object"==typeof c?c[$.expando]?c:new $.Event(q,c):new $.Event(q),c.type=q,c.isTrigger=!0,c.exclusive=h,c.namespace=r.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,l=q.indexOf(":")<0?"on"+q:"",!e){g=$.cache;for(i in g)g[i].events&&g[i].events[q]&&$.event.trigger(c,d,g[i].handle.elem,!0);return}if(c.result=b,c.target||(c.target=e),d=null!=d?$.makeArray(d):[],d.unshift(c),m=$.event.special[q]||{},m.trigger&&m.trigger.apply(e,d)===!1)return;if(o=[[e,m.bindType||q]],!f&&!m.noBubble&&!$.isWindow(e)){for(p=m.delegateType||q,j=Gb.test(p+q)?e:e.parentNode,k=e;j;j=j.parentNode)o.push([j,p]),k=j;k===(e.ownerDocument||P)&&o.push([k.defaultView||k.parentWindow||a,p])}for(i=0;id;d++)l=n[d],m=l.selector,i[m]===b&&(i[m]=g.is(m)),i[m]&&k.push(l);k.length&&s.push({elem:f,matches:k})}for(n.length>o&&s.push({elem:this,matches:n.slice(o)}),d=0;d0?this.on(b,null,a,c):this.trigger(b)},Eb.test(b)&&($.event.fixHooks[b]=$.event.keyHooks),Fb.test(b)&&($.event.fixHooks[b]=$.event.mouseHooks)}),function(a,b){function c(a,b,c,d){for(var e=0,f=b.length;f>e;e++)fb(a,b[e],c,d)}function d(a,b,d,e,f,g){var h,i=gb.setFilters[b.toLowerCase()];return i||fb.error(b),(a||!(h=f))&&c(a||"*",e,h=[],f),h.length>0?i(h,d,g):[]}function e(a,e,f,g,h){for(var i,j,k,l,m,n,o,p,q=0,r=h.length,s=S.POS,t=new RegExp("^"+s.source+"(?!"+y+")","i"),u=function(){for(var a=1,c=arguments.length-2;c>a;a++)arguments[a]===b&&(i[a]=b)};r>q;q++){for(s.exec(""),a=h[q],l=[],k=0,m=g;i=s.exec(a);)p=s.lastIndex=i.index+i[0].length,p>k&&(o=a.slice(k,i.index),k=p,n=[e],I.test(o)&&(m&&(n=m),m=g),(j=O.test(o))&&(o=o.slice(0,-5).replace(I,"$&*")),i.length>1&&i[0].replace(t,u),m=d(o,i[1],i[2],n,m,j));m?(l=l.concat(m),(o=a.slice(k))&&")"!==o?I.test(o)?c(o,l,f,g):fb(o,e,f,g?g.concat(m):m):w.apply(f,l)):fb(a,e,f,g)}return 1===r?f:fb.uniqueSort(f)}function f(a,b,c){for(var d,e,f,g=[],h=0,i=K.exec(a),j=!i.pop()&&!i.pop(),k=j&&a.match(J)||[""],l=gb.preFilter,m=gb.filter,n=!c&&b!==p;null!=(e=k[h])&&j;h++)for(g.push(d=[]),n&&(e=" "+e);e;){j=!1,(i=I.exec(e))&&(e=e.slice(i[0].length),j=d.push({part:i.pop().replace(H," "),captures:i}));for(f in m)(i=S[f].exec(e))&&(!l[f]||(i=l[f](i,b,c)))&&(e=e.slice(i.shift().length),j=d.push({part:f,captures:i}));if(!j)break}return j||fb.error(a),g}function g(a,b,c){var d=b.dir,e=u++;return a||(a=function(a){return a===c}),b.first?function(b,c){for(;b=b[d];)if(1===b.nodeType)return a(b,c)&&b}:function(b,c){for(var f,g=e+"."+l,h=g+"."+k;b=b[d];)if(1===b.nodeType){if((f=b[x])===h)return b.sizset;if("string"==typeof f&&0===f.indexOf(g)){if(b.sizset)return b}else{if(b[x]=h,a(b,c))return b.sizset=!0,b;b.sizset=!1}}}}function h(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function i(a,b,c){for(var d,e,f=0;d=a[f];f++)gb.relative[d.part]?e=g(e,gb.relative[d.part],b):(d.captures.push(b,c),e=h(e,gb.filter[d.part].apply(null,d.captures)));return e}function j(a){return function(b,c){for(var d,e=0;d=a[e];e++)if(d(b,c))return!0;return!1}}var k,l,m,n,o,p=a.document,q=p.documentElement,r="undefined",s=!1,t=!0,u=0,v=[].slice,w=[].push,x=("sizcache"+Math.random()).replace(".",""),y="[\\x20\\t\\r\\n\\f]",z="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",A=z.replace("w","w#"),B="([*^$|!~]?=)",C="\\["+y+"*("+z+")"+y+"*(?:"+B+y+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+A+")|)|)"+y+"*\\]",D=":("+z+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",E=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",F=y+"*([\\x20\\t\\r\\n\\f>+~])"+y+"*",G="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+C+"|"+D.replace(2,7)+"|[^\\\\(),])+",H=new RegExp("^"+y+"+|((?:^|[^\\\\])(?:\\\\.)*)"+y+"+$","g"),I=new RegExp("^"+F),J=new RegExp(G+"?(?="+y+"*,|$)","g"),K=new RegExp("^(?:(?!,)(?:(?:^|,)"+y+"*"+G+")*?|"+y+"*(.*?))(\\)|$)"),L=new RegExp(G.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+F,"g"),M=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,N=/[\x20\t\r\n\f]*[+~]/,O=/:not\($/,P=/h\d/i,Q=/input|select|textarea|button/i,R=/\\(?!\\)/g,S={ID:new RegExp("^#("+z+")"),CLASS:new RegExp("^\\.("+z+")"),NAME:new RegExp("^\\[name=['\"]?("+z+")['\"]?\\]"),TAG:new RegExp("^("+z.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+C),PSEUDO:new RegExp("^"+D),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+y+"*(even|odd|(([+-]|)(\\d*)n|)"+y+"*(?:([+-]|)"+y+"*(\\d+)|))"+y+"*\\)|)","i"),POS:new RegExp(E,"ig"),needsContext:new RegExp("^"+y+"*[>+~]|"+E,"i")},T={},U=[],V={},W=[],X=function(a){return a.sizzleFilter=!0,a},Y=function(a){return function(b){return"input"===b.nodeName.toLowerCase()&&b.type===a}},Z=function(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}},_=function(a){var b=!1,c=p.createElement("div");try{b=a(c)}catch(d){}return c=null,b},ab=_(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return"boolean"!==b&&"string"!==b}),bb=_(function(a){a.id=x+0,a.innerHTML="
    ",q.insertBefore(a,q.firstChild);var b=p.getElementsByName&&p.getElementsByName(x).length===2+p.getElementsByName(x+0).length;return o=!p.getElementById(x),q.removeChild(a),b}),cb=_(function(a){return a.appendChild(p.createComment("")),0===a.getElementsByTagName("*").length}),db=_(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==r&&"#"===a.firstChild.getAttribute("href")}),eb=_(function(a){return a.innerHTML="",a.getElementsByClassName&&0!==a.getElementsByClassName("e").length?(a.lastChild.className="e",1!==a.getElementsByClassName("e").length):!1}),fb=function(a,b,c,d){c=c||[],b=b||p;var e,f,g,h,i=b.nodeType;if(1!==i&&9!==i)return[];if(!a||"string"!=typeof a)return c;if(g=ib(b),!g&&!d&&(e=M.exec(a)))if(h=e[1]){if(9===i){if(f=b.getElementById(h),!f||!f.parentNode)return c;if(f.id===h)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(h))&&jb(b,f)&&f.id===h)return c.push(f),c}else{if(e[2])return w.apply(c,v.call(b.getElementsByTagName(a),0)),c;if((h=e[3])&&eb&&b.getElementsByClassName)return w.apply(c,v.call(b.getElementsByClassName(h),0)),c}return mb(a,b,c,d,g)},gb=fb.selectors={cacheLength:50,match:S,order:["ID","TAG"],attrHandle:{},createPseudo:X,find:{ID:o?function(a,b,c){if(typeof b.getElementById!==r&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==r&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==r&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:cb?function(a,b){return typeof b.getElementsByTagName!==r?b.getElementsByTagName(a):void 0}:function(a,b){var c=b.getElementsByTagName(a);if("*"===a){for(var d,e=[],f=0;d=c[f];f++)1===d.nodeType&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(R,""),a[3]=(a[4]||a[5]||"").replace(R,""),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1]?(a[2]||fb.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*("even"===a[2]||"odd"===a[2])),a[4]=+(a[6]+a[7]||"odd"===a[2])):a[2]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return S.CHILD.test(a[0])?null:(c&&(b=K.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:o?function(a){return a=a.replace(R,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(R,""),function(b){var c=typeof b.getAttributeNode!==r&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return"*"===a?function(){return!0}:(a=a.replace(R,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=T[a];return b||(b=T[a]=new RegExp("(^|"+y+")"+a+"("+y+"|$)"),U.push(a),U.length>gb.cacheLength&&delete T[U.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==r&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=fb.attr(d,a),f=e+"";if(null==e)return"!="===b;switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&0===f.indexOf(c);case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return null!=fb.attr(b,a)}},CHILD:function(a,b,c,d){if("nth"===a){var e=u++;return function(a){var b,f,g=0,h=a;if(1===c&&0===d)return!0;if(b=a.parentNode,b&&(b[x]!==e||!a.sizset)){for(h=b.firstChild;h&&(1!==h.nodeType||(h.sizset=++g,h!==a));h=h.nextSibling);b[x]=e}return f=a.sizset-d,0===c?0===f:0===f%c&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":for(;c=c.previousSibling;)if(1===c.nodeType)return!1;if("first"===a)return!0;c=b;case"last":for(;c=c.nextSibling;)if(1===c.nodeType)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=gb.pseudos[a]||gb.pseudos[a.toLowerCase()];return e||fb.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:X(function(a,b,c){var d=lb(a.replace(H,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!gb.pseudos.empty(a)},empty:function(a){var b;for(a=a.firstChild;a;){if(a.nodeName>"@"||3===(b=a.nodeType)||4===b)return!1;a=a.nextSibling}return!0},contains:X(function(a){return function(b){return(b.textContent||b.innerText||kb(b)).indexOf(a)>-1}}),has:X(function(a){return function(b){return fb(a,b).length>0}}),header:function(a){return P.test(a.nodeName)},text:function(a){var b,c;return"input"===a.nodeName.toLowerCase()&&"text"===(b=a.type)&&(null==(c=a.getAttribute("type"))||c.toLowerCase()===b)},radio:Y("radio"),checkbox:Y("checkbox"),file:Y("file"),password:Y("password"),image:Y("image"),submit:Z("submit"),reset:Z("reset"),button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},input:function(a){return Q.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return!(a!==b.activeElement||b.hasFocus&&!b.hasFocus()||!a.type&&!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){for(var d=[],e=c?1:0,f=a.length;f>e;e+=2)d.push(a[e]);return d},odd:function(a,b,c){for(var d=[],e=c?0:1,f=a.length;f>e;e+=2)d.push(a[e]);return d},lt:function(a,b,c){return c?a.slice(+b):a.slice(0,+b)},gt:function(a,b,c){return c?a.slice(0,+b+1):a.slice(+b+1)},eq:function(a,b,c){var d=a.splice(+b,1);return c?a:d}}};gb.setFilters.nth=gb.setFilters.eq,gb.filters=gb.pseudos,db||(gb.attrHandle={href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}}),bb&&(gb.order.push("NAME"),gb.find.NAME=function(a,b){return typeof b.getElementsByName!==r?b.getElementsByName(a):void 0}),eb&&(gb.order.splice(1,0,"CLASS"),gb.find.CLASS=function(a,b,c){return typeof b.getElementsByClassName===r||c?void 0:b.getElementsByClassName(a)});try{v.call(q.childNodes,0)[0].nodeType}catch(hb){v=function(a){for(var b,c=[];b=this[a];a++)c.push(b);return c}}var ib=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},jb=fb.contains=q.compareDocumentPosition?function(a,b){return!!(16&a.compareDocumentPosition(b))}:q.contains?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b.parentNode;return a===d||!!(d&&1===d.nodeType&&c.contains&&c.contains(d))}:function(a,b){for(;b=b.parentNode;)if(b===a)return!0;return!1},kb=fb.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=kb(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d];d++)c+=kb(b);return c};fb.attr=function(a,b){var c,d=ib(a);return d||(b=b.toLowerCase()),gb.attrHandle[b]?gb.attrHandle[b](a):ab||d?a.getAttribute(b):(c=a.getAttributeNode(b),c?"boolean"==typeof a[b]?a[b]?b:null:c.specified?c.value:null:null)},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},[0,0].sort(function(){return t=0}),q.compareDocumentPosition?m=function(a,b){return a===b?(s=!0,0):(a.compareDocumentPosition&&b.compareDocumentPosition?4&a.compareDocumentPosition(b):a.compareDocumentPosition)?-1:1}:(m=function(a,b){if(a===b)return s=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return n(a,b);if(!g)return-1;if(!h)return 1;for(;i;)e.unshift(i),i=i.parentNode;for(i=h;i;)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;c>j&&d>j;j++)if(e[j]!==f[j])return n(e[j],f[j]);return j===c?n(a,f[j],-1):n(e[j],b,1)},n=function(a,b,c){if(a===b)return c;for(var d=a.nextSibling;d;){if(d===b)return-1;d=d.nextSibling}return 1}),fb.uniqueSort=function(a){var b,c=1;if(m&&(s=t,a.sort(m),s))for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a};var lb=fb.compile=function(a,b,c){var d,e,g,h=V[a];if(h&&h.context===b)return h;for(e=f(a,b,c),g=0;d=e[g];g++)e[g]=i(d,b,c);return h=V[a]=j(e),h.context=b,h.runs=h.dirruns=0,W.push(a),W.length>gb.cacheLength&&delete V[W.shift()],h};fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){return fb(b,null,null,[a]).length>0};var mb=function(a,b,c,d,f){a=a.replace(H,"$1");var g,h,i,j,m,n,o,p,q,r=a.match(J),s=a.match(L),t=b.nodeType;if(S.POS.test(a))return e(a,b,c,d,r);if(d)g=v.call(d,0);else if(r&&1===r.length){if(s.length>1&&9===t&&!f&&(r=S.ID.exec(s[0]))){if(b=gb.find.ID(r[1],b,f)[0],!b)return c;a=a.slice(s.shift().length)}for(p=(r=N.exec(s[0]))&&!r.index&&b.parentNode||b,q=s.pop(),n=q.split(":not")[0],i=0,j=gb.order.length;j>i;i++)if(o=gb.order[i],r=S[o].exec(n)){if(g=gb.find[o]((r[1]||"").replace(R,""),p,f),null==g)continue;n===q&&(a=a.slice(0,a.length-q.length)+n.replace(S[o],""),a||w.apply(c,v.call(g,0)));break}}if(a)for(h=lb(a,b,f),l=h.dirruns++,null==g&&(g=gb.find.TAG("*",N.test(a)&&b.parentNode||b)),i=0;m=g[i];i++)k=h.runs++,h(m,b)&&c.push(m);return c};p.querySelectorAll&&function(){var a,b=mb,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[],f=[":active"],g=q.matchesSelector||q.mozMatchesSelector||q.webkitMatchesSelector||q.oMatchesSelector||q.msMatchesSelector;_(function(a){a.innerHTML="",a.querySelectorAll("[selected]").length||e.push("\\["+y+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),_(function(a){a.innerHTML="

    ",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+y+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),mb=function(a,d,f,g,h){if(!(g||h||e&&e.test(a)))if(9===d.nodeType)try{return w.apply(f,v.call(d.querySelectorAll(a),0)),f}catch(i){}else if(1===d.nodeType&&"object"!==d.nodeName.toLowerCase()){var j=d.getAttribute("id"),k=j||x,l=N.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return w.apply(f,v.call(l.querySelectorAll(a.replace(J,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(_(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push(gb.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),fb.matchesSelector=function(b,c){if(c=c.replace(d,"='$1']"),!(ib(b)||f.test(c)||e&&e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&11!==b.document.nodeType)return h}catch(i){}return fb(c,null,null,[b]).length>0})}(),fb.attr=$.attr,$.find=fb,$.expr=fb.selectors,$.expr[":"]=$.expr.pseudos,$.unique=fb.uniqueSort,$.text=fb.getText,$.isXMLDoc=fb.isXML,$.contains=fb.contains}(a);var Ib=/Until$/,Jb=/^(?:parents|prev(?:Until|All))/,Kb=/^.[^:#\[\.,]*$/,Lb=$.expr.match.needsContext,Mb={children:!0,contents:!0,next:!0,prev:!0};$.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if("string"!=typeof a)return $(a).filter(function(){for(b=0,c=h.length;c>b;b++)if($.contains(h[b],this))return!0});for(g=this.pushStack("","find",a),b=0,c=this.length;c>b;b++)if(d=g.length,$.find(a,this[b],g),b>0)for(e=d;ef;f++)if(g[f]===g[e]){g.splice(e--,1);break}return g},has:function(a){var b,c=$(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if($.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(j(this,a,!1),"not",a)},filter:function(a){return this.pushStack(j(this,a,!0),"filter",a)},is:function(a){return!!a&&("string"==typeof a?Lb.test(a)?$(a,this.context).index(this[0])>=0:$.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=Lb.test(a)||"string"!=typeof a?$(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c.ownerDocument&&c!==b&&11!==c.nodeType;){if(g?g.index(c)>-1:$.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}return f=f.length>1?$.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?"string"==typeof a?$.inArray(this[0],$(a)):$.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c="string"==typeof a?$(a,b):$.makeArray(a&&a.nodeType?[a]:a),d=$.merge(this.get(),c);return this.pushStack(h(c[0])||h(d[0])?d:$.unique(d))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}}),$.fn.andSelf=$.fn.addBack,$.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return $.dir(a,"parentNode")},parentsUntil:function(a,b,c){return $.dir(a,"parentNode",c)},next:function(a){return i(a,"nextSibling")},prev:function(a){return i(a,"previousSibling")},nextAll:function(a){return $.dir(a,"nextSibling")},prevAll:function(a){return $.dir(a,"previousSibling")},nextUntil:function(a,b,c){return $.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return $.dir(a,"previousSibling",c)},siblings:function(a){return $.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return $.sibling(a.firstChild)},contents:function(a){return $.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:$.merge([],a.childNodes)}},function(a,b){$.fn[a]=function(c,d){var e=$.map(this,b,c);return Ib.test(a)||(d=c),d&&"string"==typeof d&&(e=$.filter(d,e)),e=this.length>1&&!Mb[a]?$.unique(e):e,this.length>1&&Jb.test(a)&&(e=e.reverse()),this.pushStack(e,a,V.call(arguments).join(","))}}),$.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),1===b.length?$.find.matchesSelector(b[0],a)?[b[0]]:[]:$.find.matches(a,b)},dir:function(a,c,d){for(var e=[],f=a[c];f&&9!==f.nodeType&&(d===b||1!==f.nodeType||!$(f).is(d));)1===f.nodeType&&e.push(f),f=f[c];return e},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var Nb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Ob=/ jQuery\d+="(?:null|\d+)"/g,Pb=/^\s+/,Qb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Rb=/<([\w:]+)/,Sb=/]","i"),Xb=/^(?:checkbox|radio)$/,Yb=/checked\s*(?:[^=]|=\s*.checked.)/i,Zb=/\/(java|ecma)script/i,$b=/^\s*\s*$/g,_b={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},ac=k(P),bc=ac.appendChild(P.createElement("div")); +_b.optgroup=_b.option,_b.tbody=_b.tfoot=_b.colgroup=_b.caption=_b.thead,_b.th=_b.td,$.support.htmlSerialize||(_b._default=[1,"X
    ","
    "]),$.fn.extend({text:function(a){return $.access(this,function(a){return a===b?$.text(this):this.empty().append((this[0]&&this[0].ownerDocument||P).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if($.isFunction(a))return this.each(function(b){$(this).wrapAll(a.call(this,b))});if(this[0]){var b=$(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return $.isFunction(a)?this.each(function(b){$(this).wrapInner(a.call(this,b))}):this.each(function(){var b=$(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=$.isFunction(a);return this.each(function(c){$(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){$.nodeName(this,"body")||$(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(1===this.nodeType||11===this.nodeType)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!h(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=$.clean(arguments);return this.pushStack($.merge(a,this),"before",this.selector)}},after:function(){if(!h(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=$.clean(arguments);return this.pushStack($.merge(this,a),"after",this.selector)}},remove:function(a,b){for(var c,d=0;null!=(c=this[d]);d++)(!a||$.filter(a,[c]).length)&&(!b&&1===c.nodeType&&($.cleanData(c.getElementsByTagName("*")),$.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)for(1===a.nodeType&&$.cleanData(a.getElementsByTagName("*"));a.firstChild;)a.removeChild(a.firstChild);return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return $.clone(this,a,b)})},html:function(a){return $.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return 1===c.nodeType?c.innerHTML.replace(Ob,""):b;if(!("string"!=typeof a||Ub.test(a)||!$.support.htmlSerialize&&Wb.test(a)||!$.support.leadingWhitespace&&Pb.test(a)||_b[(Rb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(Qb,"<$1>");try{for(;e>d;d++)c=this[d]||{},1===c.nodeType&&($.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return h(this[0])?this.length?this.pushStack($($.isFunction(a)?a():a),"replaceWith",a):this:$.isFunction(a)?this.each(function(b){var c=$(this),d=c.html();c.replaceWith(a.call(this,b,d))}):("string"!=typeof a&&(a=$(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;$(this).remove(),b?$(b).before(a):$(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],m=this.length;if(!$.support.checkClone&&m>1&&"string"==typeof j&&Yb.test(j))return this.each(function(){$(this).domManip(a,c,d)});if($.isFunction(j))return this.each(function(e){var f=$(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){if(e=$.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,1===g.childNodes.length&&(g=f),f)for(c=c&&$.nodeName(f,"tr"),h=e.cacheable||m-1;m>i;i++)d.call(c&&$.nodeName(this[i],"table")?l(this[i],"tbody"):this[i],i===h?g:$.clone(g,!0,!0));g=f=null,k.length&&$.each(k,function(a,b){b.src?$.ajax?$.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):$.error("no ajax"):$.globalEval((b.text||b.textContent||b.innerHTML||"").replace($b,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),$.buildFragment=function(a,c,d){var e,f,g,h=a[0];return c=c||P,c=(c[0]||c).ownerDocument||c[0]||c,"undefined"==typeof c.createDocumentFragment&&(c=P),1===a.length&&"string"==typeof h&&h.length<512&&c===P&&"<"===h.charAt(0)&&!Vb.test(h)&&($.support.checkClone||!Yb.test(h))&&($.support.html5Clone||!Wb.test(h))&&(f=!0,e=$.fragments[h],g=e!==b),e||(e=c.createDocumentFragment(),$.clean(a,c,e,d),f&&($.fragments[h]=g&&e)),{fragment:e,cacheable:f}},$.fragments={},$.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){$.fn[a]=function(c){var d,e=0,f=[],g=$(c),h=g.length,i=1===this.length&&this[0].parentNode;if((null==i||i&&11===i.nodeType&&1===i.childNodes.length)&&1===h)return g[b](this[0]),this;for(;h>e;e++)d=(e>0?this.clone(!0):this).get(),$(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),$.extend({clone:function(a,b,c){var d,e,f,g;if($.support.html5Clone||$.isXMLDoc(a)||!Wb.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bc.innerHTML=a.outerHTML,bc.removeChild(g=bc.firstChild)),!($.support.noCloneEvent&&$.support.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||$.isXMLDoc(a)))for(n(a,g),d=o(a),e=o(g),f=0;d[f];++f)e[f]&&n(d[f],e[f]);if(b&&(m(a,g),c))for(d=o(a),e=o(g),f=0;d[f];++f)m(d[f],e[f]);return d=e=null,g},clean:function(a,b,c,d){var e,f,g,h,i,j,l,m,n,o,q,r=0,s=[];for(b&&"undefined"!=typeof b.createDocumentFragment||(b=P),f=b===P&∾null!=(g=a[r]);r++)if("number"==typeof g&&(g+=""),g){if("string"==typeof g)if(Tb.test(g)){for(f=f||k(b),l=l||f.appendChild(b.createElement("div")),g=g.replace(Qb,"<$1>"),h=(Rb.exec(g)||["",""])[1].toLowerCase(),i=_b[h]||_b._default,j=i[0],l.innerHTML=i[1]+g+i[2];j--;)l=l.lastChild;if(!$.support.tbody)for(m=Sb.test(g),n="table"!==h||m?""!==i[1]||m?[]:l.childNodes:l.firstChild&&l.firstChild.childNodes,e=n.length-1;e>=0;--e)$.nodeName(n[e],"tbody")&&!n[e].childNodes.length&&n[e].parentNode.removeChild(n[e]);!$.support.leadingWhitespace&&Pb.test(g)&&l.insertBefore(b.createTextNode(Pb.exec(g)[0]),l.firstChild),g=l.childNodes,l=f.lastChild}else g=b.createTextNode(g);g.nodeType?s.push(g):s=$.merge(s,g)}if(l&&(f.removeChild(l),g=l=f=null),!$.support.appendChecked)for(r=0;null!=(g=s[r]);r++)$.nodeName(g,"input")?p(g):"undefined"!=typeof g.getElementsByTagName&&$.grep(g.getElementsByTagName("input"),p);if(c)for(o=function(a){return!a.type||Zb.test(a.type)?d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a):void 0},r=0;null!=(g=s[r]);r++)$.nodeName(g,"script")&&o(g)||(c.appendChild(g),"undefined"!=typeof g.getElementsByTagName&&(q=$.grep($.merge([],g.getElementsByTagName("script")),o),s.splice.apply(s,[r+1,0].concat(q)),r+=q.length));return s},cleanData:function(a,b){for(var c,d,e,f,g=0,h=$.expando,i=$.cache,j=$.support.deleteExpando,k=$.event.special;null!=(e=a[g]);g++)if((b||$.acceptData(e))&&(d=e[h],c=d&&i[d])){if(c.events)for(f in c.events)k[f]?$.event.remove(e,f):$.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,$.deletedIds.push(d))}}}),function(){var a,b;$.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=$.uaMatch(R.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),$.browser=b,$.sub=function(){function a(b,c){return new a.fn.init(b,c)}$.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof $&&!(d instanceof a)&&(d=a(d)),$.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(P);return a}}();var cc,dc,ec,fc=/alpha\([^)]*\)/i,gc=/opacity=([^)]*)/,hc=/^(top|right|bottom|left)$/,ic=/^margin/,jc=new RegExp("^("+_+")(.*)$","i"),kc=new RegExp("^("+_+")(?!px)[a-z%]+$","i"),lc=new RegExp("^([-+])=("+_+")","i"),mc={},nc={position:"absolute",visibility:"hidden",display:"block"},oc={letterSpacing:0,fontWeight:400,lineHeight:1},pc=["Top","Right","Bottom","Left"],qc=["Webkit","O","Moz","ms"],rc=$.fn.toggle;$.fn.extend({css:function(a,c){return $.access(this,function(a,c,d){return d!==b?$.style(a,c,d):$.css(a,c)},a,c,arguments.length>1)},show:function(){return s(this,!0)},hide:function(){return s(this)},toggle:function(a,b){var c="boolean"==typeof a;return $.isFunction(a)&&$.isFunction(b)?rc.apply(this,arguments):this.each(function(){(c?a:r(this))?$(this).show():$(this).hide()})}}),$.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=cc(a,"opacity");return""===c?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":$.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g,h,i=$.camelCase(c),j=a.style;if(c=$.cssProps[i]||($.cssProps[i]=q(j,i)),h=$.cssHooks[c]||$.cssHooks[i],d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];if(g=typeof d,"string"===g&&(f=lc.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat($.css(a,c)),g="number"),!(null==d||"number"===g&&isNaN(d)||("number"===g&&!$.cssNumber[i]&&(d+="px"),h&&"set"in h&&(d=h.set(a,d,e))===b)))try{j[c]=d}catch(k){}}},css:function(a,c,d,e){var f,g,h,i=$.camelCase(c);return c=$.cssProps[i]||($.cssProps[i]=q(a.style,i)),h=$.cssHooks[c]||$.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=cc(a,c)),"normal"===f&&c in oc&&(f=oc[c]),d||e!==b?(g=parseFloat(f),d||$.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?cc=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],""===c&&!$.contains(a.ownerDocument.documentElement,a)&&(c=$.style(a,b)),kc.test(c)&&ic.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:P.documentElement.currentStyle&&(cc=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return null==e&&f&&f[b]&&(e=f[b]),kc.test(e)&&!hc.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left="fontSize"===b?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),""===e?"auto":e}),$.each(["height","width"],function(a,b){$.cssHooks[b]={get:function(a,c,d){return c?0!==a.offsetWidth||"none"!==cc(a,"display")?v(a,b,d):$.swap(a,nc,function(){return v(a,b,d)}):void 0},set:function(a,c,d){return t(a,c,d?u(a,b,d,$.support.boxSizing&&"border-box"===$.css(a,"boxSizing")):0)}}}),$.support.opacity||($.cssHooks.opacity={get:function(a,b){return gc.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=$.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,b>=1&&""===$.trim(f.replace(fc,""))&&c.removeAttribute&&(c.removeAttribute("filter"),d&&!d.filter)||(c.filter=fc.test(f)?f.replace(fc,e):f+" "+e)}}),$(function(){$.support.reliableMarginRight||($.cssHooks.marginRight={get:function(a,b){return $.swap(a,{display:"inline-block"},function(){return b?cc(a,"marginRight"):void 0})}}),!$.support.pixelPosition&&$.fn.position&&$.each(["top","left"],function(a,b){$.cssHooks[b]={get:function(a,c){if(c){var d=cc(a,b);return kc.test(d)?$(a).position()[b]+"px":d}}}})}),$.expr&&$.expr.filters&&($.expr.filters.hidden=function(a){return 0===a.offsetWidth&&0===a.offsetHeight||!$.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||cc(a,"display"))},$.expr.filters.visible=function(a){return!$.expr.filters.hidden(a)}),$.each({margin:"",padding:"",border:"Width"},function(a,b){$.cssHooks[a+b]={expand:function(c){var d,e="string"==typeof c?c.split(" "):[c],f={};for(d=0;4>d;d++)f[a+pc[d]+b]=e[d]||e[d-2]||e[0];return f}},ic.test(a)||($.cssHooks[a+b].set=t)});var sc=/%20/g,tc=/\[\]$/,uc=/\r?\n/g,vc=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,wc=/^(?:select|textarea)/i;$.fn.extend({serialize:function(){return $.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?$.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||wc.test(this.nodeName)||vc.test(this.type))}).map(function(a,b){var c=$(this).val();return null==c?null:$.isArray(c)?$.map(c,function(a){return{name:b.name,value:a.replace(uc,"\r\n")}}):{name:b.name,value:c.replace(uc,"\r\n")}}).get()}}),$.param=function(a,c){var d,e=[],f=function(a,b){b=$.isFunction(b)?b():null==b?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(c===b&&(c=$.ajaxSettings&&$.ajaxSettings.traditional),$.isArray(a)||a.jquery&&!$.isPlainObject(a))$.each(a,function(){f(this.name,this.value)});else for(d in a)x(d,a[d],c,f);return e.join("&").replace(sc,"+")};var xc,yc,zc=/#.*$/,Ac=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Bc=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Cc=/^(?:GET|HEAD)$/,Dc=/^\/\//,Ec=/\?/,Fc=/)<[^<]*)*<\/script>/gi,Gc=/([?&])_=[^&]*/,Hc=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Ic=$.fn.load,Jc={},Kc={},Lc=["*/"]+["*"];try{xc=Q.href}catch(Mc){xc=P.createElement("a"),xc.href="",xc=xc.href}yc=Hc.exec(xc.toLowerCase())||[],$.fn.load=function(a,c,d){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),$.isFunction(c)?(d=c,c=b):"object"==typeof c&&(f="POST"),$.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?$("
    ").append(a.replace(Fc,"")).find(e):a)}),this},$.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){$.fn[b]=function(a){return this.on(b,a)}}),$.each(["get","post"],function(a,c){$[c]=function(a,d,e,f){return $.isFunction(d)&&(f=f||e,e=d,d=b),$.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),$.extend({getScript:function(a,c){return $.get(a,b,c,"script")},getJSON:function(a,b,c){return $.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?A(a,$.ajaxSettings):(b=a,a=$.ajaxSettings),A(a,b),a},ajaxSettings:{url:xc,isLocal:Bc.test(yc[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Lc},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":$.parseJSON,"text xml":$.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:y(Jc),ajaxTransport:y(Kc),ajax:function(a,c){function d(a,c,d,g){var j,l,s,t,v,x=c;2!==u&&(u=2,i&&clearTimeout(i),h=b,f=g||"",w.readyState=a>0?4:0,d&&(t=B(m,w,d)),a>=200&&300>a||304===a?(m.ifModified&&(v=w.getResponseHeader("Last-Modified"),v&&($.lastModified[e]=v),v=w.getResponseHeader("Etag"),v&&($.etag[e]=v)),304===a?(x="notmodified",j=!0):(j=C(m,t),x=j.state,l=j.data,s=j.error,j=!s)):(s=x,(!x||a)&&(x="error",0>a&&(a=0))),w.status=a,w.statusText=""+(c||x),j?p.resolveWith(n,[l,x,w]):p.rejectWith(n,[w,x,s]),w.statusCode(r),r=b,k&&o.trigger("ajax"+(j?"Success":"Error"),[w,m,j?l:s]),q.fireWith(n,[w,x]),k&&(o.trigger("ajaxComplete",[w,m]),--$.active||$.event.trigger("ajaxStop")))}"object"==typeof a&&(c=a,a=b),c=c||{};var e,f,g,h,i,j,k,l,m=$.ajaxSetup({},c),n=m.context||m,o=n!==m&&(n.nodeType||n instanceof $)?$(n):$.event,p=$.Deferred(),q=$.Callbacks("once memory"),r=m.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,setRequestHeader:function(a,b){if(!u){var c=a.toLowerCase();a=t[c]=t[c]||a,s[a]=b}return this},getAllResponseHeaders:function(){return 2===u?f:null},getResponseHeader:function(a){var c;if(2===u){if(!g)for(g={};c=Ac.exec(f);)g[c[1].toLowerCase()]=c[2];c=g[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return u||(m.mimeType=a),this},abort:function(a){return a=a||v,h&&h.abort(a),d(0,a),this}};if(p.promise(w),w.success=w.done,w.error=w.fail,w.complete=q.add,w.statusCode=function(a){if(a){var b;if(2>u)for(b in a)r[b]=[r[b],a[b]];else b=a[w.status],w.always(b)}return this},m.url=((a||m.url)+"").replace(zc,"").replace(Dc,yc[1]+"//"),m.dataTypes=$.trim(m.dataType||"*").toLowerCase().split(bb),null==m.crossDomain&&(j=Hc.exec(m.url.toLowerCase()),m.crossDomain=!(!j||j[1]==yc[1]&&j[2]==yc[2]&&(j[3]||("http:"===j[1]?80:443))==(yc[3]||("http:"===yc[1]?80:443)))),m.data&&m.processData&&"string"!=typeof m.data&&(m.data=$.param(m.data,m.traditional)),z(Jc,m,c,w),2===u)return w;if(k=m.global,m.type=m.type.toUpperCase(),m.hasContent=!Cc.test(m.type),k&&0===$.active++&&$.event.trigger("ajaxStart"),!m.hasContent&&(m.data&&(m.url+=(Ec.test(m.url)?"&":"?")+m.data,delete m.data),e=m.url,m.cache===!1)){var x=$.now(),y=m.url.replace(Gc,"$1_="+x);m.url=y+(y===m.url?(Ec.test(m.url)?"&":"?")+"_="+x:"")}(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",m.contentType),m.ifModified&&(e=e||m.url,$.lastModified[e]&&w.setRequestHeader("If-Modified-Since",$.lastModified[e]),$.etag[e]&&w.setRequestHeader("If-None-Match",$.etag[e])),w.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+Lc+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)w.setRequestHeader(l,m.headers[l]);if(!m.beforeSend||m.beforeSend.call(n,w,m)!==!1&&2!==u){v="abort";for(l in{success:1,error:1,complete:1})w[l](m[l]);if(h=z(Kc,m,c,w)){w.readyState=1,k&&o.trigger("ajaxSend",[w,m]),m.async&&m.timeout>0&&(i=setTimeout(function(){w.abort("timeout")},m.timeout));try{u=1,h.send(s,d)}catch(A){if(!(2>u))throw A;d(-1,A)}}else d(-1,"No Transport");return w}return w.abort()},active:0,lastModified:{},etag:{}});var Nc=[],Oc=/\?/,Pc=/(=)\?(?=&|$)|\?\?/,Qc=$.now();$.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Nc.pop()||$.expando+"_"+Qc++;return this[a]=!0,a}}),$.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&Pc.test(j),m=k&&!l&&"string"==typeof i&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&Pc.test(i);return"jsonp"===c.dataTypes[0]||l||m?(f=c.jsonpCallback=$.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(Pc,"$1"+f):m?c.data=i.replace(Pc,"$1"+f):k&&(c.url+=(Oc.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||$.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,Nc.push(f)),h&&$.isFunction(g)&&g(h[0]),h=g=b}),"script"):void 0}),$.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return $.globalEval(a),a}}}),$.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),$.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=P.head||P.getElementsByTagName("head")[0]||P.documentElement;return{send:function(e,f){c=P.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){(e||!c.readyState||/loaded|complete/.test(c.readyState))&&(c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||f(200,"success"))},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var Rc,Sc=a.ActiveXObject?function(){for(var a in Rc)Rc[a](0,1)}:!1,Tc=0;$.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&D()||E()}:D,function(a){$.extend($.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}($.ajaxSettings.xhr()),$.support.ajax&&$.ajaxTransport(function(c){if(!c.crossDomain||$.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();if(c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async),c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||4===i.readyState))if(d=b,g&&(i.onreadystatechange=$.noop,Sc&&delete Rc[g]),e)4!==i.readyState&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}h||!c.isLocal||c.crossDomain?1223===h&&(h=204):h=l.text?200:404}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?4===i.readyState?setTimeout(d,0):(g=++Tc,Sc&&(Rc||(Rc={},$(a).unload(Sc)),Rc[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var Uc,Vc,Wc=/^(?:toggle|show|hide)$/,Xc=new RegExp("^(?:([-+])=|)("+_+")([a-z%]*)$","i"),Yc=/queueHooks$/,Zc=[J],$c={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=Xc.exec(b),h=f.cur(),i=+h||0,j=1;if(g){if(c=+g[2],d=g[3]||($.cssNumber[a]?"":"px"),"px"!==d&&i){i=$.css(f.elem,a,!0)||c||1;do e=j=j||".5",i/=j,$.style(f.elem,a,i+d),j=f.cur()/h;while(1!==j&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};$.Animation=$.extend(H,{tweener:function(a,b){$.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],$c[c]=$c[c]||[],$c[c].unshift(b)},prefilter:function(a,b){b?Zc.unshift(a):Zc.push(a)}}),$.Tween=K,K.prototype={constructor:K,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||($.cssNumber[c]?"":"px")},cur:function(){var a=K.propHooks[this.prop];return a&&a.get?a.get(this):K.propHooks._default.get(this)},run:function(a){var b,c=K.propHooks[this.prop];return this.pos=b=$.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration),this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):K.propHooks._default.set(this),this}},K.prototype.init.prototype=K.prototype,K.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=$.css(a.elem,a.prop,!1,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){$.fx.step[a.prop]?$.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[$.cssProps[a.prop]]||$.cssHooks[a.prop])?$.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},K.propHooks.scrollTop=K.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},$.each(["toggle","show","hide"],function(a,b){var c=$.fn[b];$.fn[b]=function(d,e,f){return null==d||"boolean"==typeof d||!a&&$.isFunction(d)&&$.isFunction(e)?c.apply(this,arguments):this.animate(L(b,!0),d,e,f)}}),$.fn.extend({fadeTo:function(a,b,c,d){return this.filter(r).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=$.isEmptyObject(a),f=$.speed(b,c,d),g=function(){var b=H(this,$.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return"string"!=typeof a&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=null!=a&&a+"queueHooks",f=$.timers,g=$._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&Yc.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(null==a||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&$.dequeue(this,a)})}}),$.each({slideDown:L("show"),slideUp:L("hide"),slideToggle:L("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){$.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),$.speed=function(a,b,c){var d=a&&"object"==typeof a?$.extend({},a):{complete:c||!c&&b||$.isFunction(a)&&a,duration:a,easing:c&&b||b&&!$.isFunction(b)&&b};return d.duration=$.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in $.fx.speeds?$.fx.speeds[d.duration]:$.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){$.isFunction(d.old)&&d.old.call(this),d.queue&&$.dequeue(this,d.queue)},d},$.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},$.timers=[],$.fx=K.prototype.init,$.fx.tick=function(){for(var a,b=$.timers,c=0;c-1,l={},m={};k?(m=g.position(),e=m.top,f=m.left):(e=parseFloat(i)||0,f=parseFloat(j)||0),$.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(l.top=b.top-h.top+e),null!=b.left&&(l.left=b.left-h.left+f),"using"in b?b.using.call(a,l):g.css(l)}},$.fn.extend({position:function(){if(this[0]){var a=this[0],b=this.offsetParent(),c=this.offset(),d=_c.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat($.css(a,"marginTop"))||0,c.left-=parseFloat($.css(a,"marginLeft"))||0,d.top+=parseFloat($.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat($.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||P.body;a&&!_c.test(a.nodeName)&&"static"===$.css(a,"position");)a=a.offsetParent;return a||P.body})}}),$.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);$.fn[a]=function(e){return $.access(this,function(a,e,f){var g=M(a);return f===b?g?c in g?g[c]:g.document.documentElement[e]:a[e]:(g?g.scrollTo(d?$(g).scrollLeft():f,d?f:$(g).scrollTop()):a[e]=f,void 0)},a,e,arguments.length,null)}}),$.each({Height:"height",Width:"width"},function(a,c){$.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){$.fn[e]=function(e,f){var g=arguments.length&&(d||"boolean"!=typeof e),h=d||(e===!0||f===!0?"margin":"border");return $.access(this,function(c,d,e){var f;return $.isWindow(c)?c.document.documentElement["client"+a]:9===c.nodeType?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?$.css(c,d,e,h):$.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=$,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return $})}(window),define("jquery-src",function(a){return function(){var b;return b||a.jQuery}}(this)),define("jquery",["jquery-src"],function(a){var b=a(window);return a.fn.place_tt=function(){var c={offset:5,css:{position:"absolute",top:-1e3,left:0,color:"#c8c8c8",padding:"10px","font-size":"11pt","font-weight":200,"background-color":"#1f1f1f","border-radius":"5px"}};return function(d,e,f){return f=a.extend(!0,{},c,f),this.each(function(){var c,g,h=a(this);h.css(f.css),a.contains(document.body,h[0])||h.appendTo(document.body),c=h.outerWidth(!0),g=h.outerHeight(!0),h.css("left",d+f.offset+c>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}),function(a,b,c){function d(a){return a&&"number"==typeof a.length?"function"!=typeof a.hasOwnProperty&&"function"!=typeof a.constructor?!0:a instanceof hb||Wc&&a instanceof Wc||"[object Object]"!==ad.call(a)||"function"==typeof a.callee:!1}function e(a,b,c){var f;if(a)if(x(a))for(f in a)"prototype"!=f&&"length"!=f&&"name"!=f&&a.hasOwnProperty(f)&&b.call(c,a[f],f);else if(a.forEach&&a.forEach!==e)a.forEach(b,c);else if(d(a))for(f=0;f=0&&a.splice(c,1),b}function H(a,b){if(z(a)||A(a))throw Error("Can't copy Window or Scope");if(b){if(a===b)throw Error("Can't copy equivalent objects or arrays");if(w(a)){b.length=0;for(var c=0;ce;e++)if(!J(a[e],b[e]))return!1;return!0}}return!1}function K(a,b,c){return a.concat($c.call(b,c))}function L(a,b){return $c.call(a,b||0) +}function M(a,b){var c=arguments.length>2?L(arguments,2):[];return!x(b)||b instanceof RegExp?b:c.length?function(){return arguments.length?b.apply(a,c.concat($c.call(arguments,0))):b.apply(a,c)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function N(a,d){var e=d;return/^\$+/.test(a)?e=c:z(d)?e="$WINDOW":d&&b===d?e="$DOCUMENT":A(d)&&(e="$SCOPE"),e}function O(a,b){return"undefined"==typeof a?c:JSON.stringify(a,N,b?" ":null)}function P(a){return t(a)?JSON.parse(a):a}function Q(a){if(a&&0!==a.length){var b=Rc(""+a);a=!("f"==b||"0"==b||"false"==b||"no"==b||"n"==b||"[]"==b)}else a=!1;return a}function R(a){a=Vc(a).clone();try{a.html("")}catch(b){}var c=3,d=Vc("
    ").append(a).html();try{return a[0].nodeType===c?Rc(d):d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+Rc(b)})}catch(b){return Rc(d)}}function S(a){try{return decodeURIComponent(a)}catch(b){}}function T(a){var b,c,d={};return e((a||"").split("&"),function(a){a&&(b=a.split("="),c=S(b[0]),r(c)&&(d[c]=r(b[1])?S(b[1]):!0))}),d}function U(a){var b=[];return e(a,function(a,c){b.push(W(c,!0)+(a===!0?"":"="+W(a,!0)))}),b.length?b.join("&"):""}function V(a){return W(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function W(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,b?"%20":"+")}function X(a,c){function d(a){a&&h.push(a)}var f,g,h=[a],i=["ng:app","ng-app","x-ng-app","data-ng-app"],j=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;e(i,function(c){i[c]=!0,d(b.getElementById(c)),c=c.replace(":","\\:"),a.querySelectorAll&&(e(a.querySelectorAll("."+c),d),e(a.querySelectorAll("."+c+"\\:"),d),e(a.querySelectorAll("["+c+"]"),d))}),e(h,function(a){if(!f){var b=" "+a.className+" ",c=j.exec(b);c?(f=a,g=(c[2]||"").replace(/\s+/g,",")):e(a.attributes,function(b){!f&&i[b.name]&&(f=a,g=b.value)})}}),f&&c(f,g?[g]:[])}function Y(b,c){var d=function(){b=Vc(b),c=c||[],c.unshift(["$provide",function(a){a.value("$rootElement",b)}]),c.unshift("ng");var a=Ab(c);return a.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d),c(b)(a)})}]),a},f=/^NG_DEFER_BOOTSTRAP!/;return a&&!f.test(a.name)?d():(a.name=a.name.replace(f,""),bd.resumeBootstrap=function(a){e(a,function(a){c.push(a)}),d()},void 0)}function Z(a,b){return b=b||"_",a.replace(ed,function(a,c){return(c?b:"")+a.toLowerCase()})}function $(){Wc=a.jQuery,Wc?(Vc=Wc,k(Wc.fn,{scope:nd.scope,controller:nd.controller,injector:nd.injector,inheritedData:nd.inheritedData}),gb("remove",!0,!0,!1),gb("empty",!1,!1,!1),gb("html",!1,!1,!0)):Vc=hb,bd.element=Vc}function _(a,b,c){if(!a)throw new Error("Argument '"+(b||"?")+"' is "+(c||"required"));return a}function ab(a,b,c){return c&&w(a)&&(a=a[a.length-1]),_(x(a),b,"not a function, got "+(a&&"object"==typeof a?a.constructor.name||"Object":typeof a)),a}function bb(a,b,c){if(!b)return a;for(var d,e=b.split("."),f=a,g=e.length,h=0;g>h;h++)d=e[h],a&&(a=(f=a)[d]);return!c&&x(a)?M(f,a):a}function cb(a){function b(a,b,c){return a[b]||(a[b]=c())}return b(b(a,"angular",Object),"module",function(){var a={};return function(c,d,e){return d&&a.hasOwnProperty(c)&&(a[c]=null),b(a,c,function(){function a(a,c,d){return function(){return b[d||"push"]([a,c,arguments]),h}}if(!d)throw Error("No module: "+c);var b=[],f=[],g=a("$injector","invoke"),h={_invokeQueue:b,_runBlocks:f,requires:d,name:c,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:g,run:function(a){return f.push(a),this}};return e&&g(e),h})}})}function db(b){k(b,{bootstrap:Y,copy:H,extend:k,equals:J,element:Vc,forEach:e,injector:Ab,noop:n,bind:M,toJson:O,fromJson:P,identity:o,isUndefined:q,isDefined:r,isString:t,isFunction:x,isObject:s,isNumber:u,isElement:C,isArray:w,version:fd,isDate:v,lowercase:Rc,uppercase:Sc,callbacks:{counter:0}}),Xc=cb(a);try{Xc("ngLocale")}catch(c){Xc("ngLocale",[]).provider("$locale",rc)}Xc("ng",["ngLocale"],["$provide",function(a){a.provider("$compile",Gb).directive({a:Kd,input:Ud,textarea:Ud,form:Od,script:Be,select:De,style:Fe,option:Ee,ngBind:ee,ngBindHtmlUnsafe:ge,ngBindTemplate:fe,ngClass:he,ngClassEven:je,ngClassOdd:ie,ngCsp:me,ngCloak:ke,ngController:le,ngForm:Pd,ngHide:ue,ngInclude:oe,ngInit:pe,ngNonBindable:qe,ngPluralize:re,ngRepeat:se,ngShow:te,ngStyle:ve,ngSwitch:we,ngSwitchWhen:xe,ngSwitchDefault:ye,ngOptions:Ce,ngView:Ae,ngTransclude:ze,ngModel:$d,ngList:be,ngChange:_d,required:ae,ngRequired:ae,ngValue:de}).directive(Ld).directive(ne),a.provider({$anchorScroll:Bb,$browser:Db,$cacheFactory:Eb,$controller:Ib,$document:Jb,$exceptionHandler:Kb,$filter:tc,$interpolate:Lb,$http:oc,$httpBackend:pc,$location:Xb,$log:Yb,$parse:cc,$route:fc,$routeParams:gc,$rootScope:hc,$q:dc,$sniffer:ic,$templateCache:Fb,$timeout:sc,$window:jc})}])}function eb(){return++id}function fb(a){return a.replace(ld,function(a,b,c,d){return d?c.toUpperCase():c}).replace(md,"Moz$1")}function gb(a,b,c,d){function e(a){var e,g,h,i,j,k,l,m=c&&a?[this.filter(a)]:[this],n=b;if(!d||null!=a)for(;m.length;)for(e=m.shift(),g=0,h=e.length;h>g;g++)for(i=Vc(e[g]),n?i.triggerHandler("$destroy"):n=!n,j=0,k=(l=i.children()).length;k>j;j++)m.push(Wc(l[j]));return f.apply(this,arguments)}var f=Wc.fn[a];f=f.$original||f,e.$original=f,Wc.fn[a]=e}function hb(a){if(a instanceof hb)return a;if(!(this instanceof hb)){if(t(a)&&"<"!=a.charAt(0))throw Error("selectors not implemented");return new hb(a)}if(t(a)){var c=b.createElement("div");c.innerHTML="
     
    "+a,c.removeChild(c.firstChild),rb(this,c.childNodes),this.remove()}else rb(this,a)}function ib(a){return a.cloneNode(!0)}function jb(a){lb(a);for(var b=0,c=a.childNodes||[];b-1}function pb(a,b){b&&e(b.split(" "),function(b){a.className=dd((" "+a.className+" ").replace(/[\n\t]/g," ").replace(" "+dd(b)+" "," "))})}function qb(a,b){b&&e(b.split(" "),function(b){ob(a,b)||(a.className=dd(a.className+" "+dd(b)))})}function rb(a,b){if(b){b=b.nodeName||!r(b.length)||z(b)?[b]:b;for(var c=0;c=Zc?(d.preventDefault=null,d.stopPropagation=null,d.isDefaultPrevented=null):(delete d.preventDefault,delete d.stopPropagation,delete d.isDefaultPrevented)};return d.elem=a,d}function wb(a){var b,d=typeof a;return"object"==d&&null!==a?"function"==typeof(b=a.$$hashKey)?b=a.$$hashKey():b===c&&(b=a.$$hashKey=i()):b=a,d+":"+b}function xb(a){e(a,this.put,this)}function yb(){}function zb(a){var b,c,d,f;return"function"==typeof a?(b=a.$inject)||(b=[],c=a.toString().replace(td,""),d=c.match(qd),e(d[1].split(rd),function(a){a.replace(sd,function(a,c,d){b.push(d)})}),a.$inject=b):w(a)?(f=a.length-1,ab(a[f],"fn"),b=a.slice(0,f)):ab(a,"fn",!0),b}function Ab(a){function b(a){return function(b,c){return s(b)?(e(b,h(a)),void 0):a(b,c)}}function c(a,b){if((x(b)||w(b))&&(b=v.instantiate(b)),!b.$get)throw Error("Provider "+a+" must define $get factory method.");return u[a+o]=b}function d(a,b){return c(a,{$get:b})}function f(a,b){return d(a,["$injector",function(a){return a.instantiate(b)}])}function g(a,b){return d(a,p(b))}function i(a,b){u[a]=b,y[a]=b}function j(a,b){var c=v.get(a+o),d=c.$get;c.$get=function(){var a=z.invoke(d,c);return z.invoke(b,null,{$delegate:a})}}function k(a){var b=[];return e(a,function(a){if(!r.get(a))if(r.put(a,!0),t(a)){var c=Xc(a);b=b.concat(k(c.requires)).concat(c._runBlocks);try{for(var d=c._invokeQueue,e=0,f=d.length;f>e;e++){var g=d[e],h="$injector"==g[0]?v:v.get(g[0]);h[g[1]].apply(h,g[2])}}catch(i){throw i.message&&(i.message+=" from "+a),i}}else if(x(a))try{b.push(v.invoke(a))}catch(i){throw i.message&&(i.message+=" from "+a),i}else if(w(a))try{b.push(v.invoke(a))}catch(i){throw i.message&&(i.message+=" from "+String(a[a.length-1])),i}else ab(a,"module")}),b}function l(a,b){function c(c){if("string"!=typeof c)throw Error("Service name expected");if(a.hasOwnProperty(c)){if(a[c]===m)throw Error("Circular dependency: "+q.join(" <- "));return a[c]}try{return q.unshift(c),a[c]=m,a[c]=b(c)}finally{q.shift()}}function d(a,b,d){var e,f,g,h=[],i=zb(a);for(f=0,e=i.length;e>f;f++)g=i[f],h.push(d&&d.hasOwnProperty(g)?d[g]:c(g));switch(a.$inject||(a=a[e]),b?-1:h.length){case 0:return a();case 1:return a(h[0]);case 2:return a(h[0],h[1]);case 3:return a(h[0],h[1],h[2]);case 4:return a(h[0],h[1],h[2],h[3]);case 5:return a(h[0],h[1],h[2],h[3],h[4]);case 6:return a(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return a(h[0],h[1],h[2],h[3],h[4],h[5],h[6]);case 8:return a(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7]);case 9:return a(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8]);case 10:return a(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9]);default:return a.apply(b,h)}}function e(a,b){var c,e,f=function(){};return f.prototype=(w(a)?a[a.length-1]:a).prototype,c=new f,e=d(a,c,b),s(e)?e:c}return{invoke:d,instantiate:e,get:c,annotate:zb}}var m={},o="Provider",q=[],r=new xb,u={$provide:{provider:b(c),factory:b(d),service:b(f),value:b(g),constant:b(i),decorator:j}},v=l(u,function(){throw Error("Unknown provider: "+q.join(" <- "))}),y={},z=y.$injector=l(y,function(a){var b=v.get(a+o);return z.invoke(b.$get,b)});return e(k(a),function(a){z.invoke(a||n)}),z}function Bb(){var a=!0;this.disableAutoScrolling=function(){a=!1},this.$get=["$window","$location","$rootScope",function(b,c,d){function f(a){var b=null;return e(a,function(a){b||"a"!==Rc(a.nodeName)||(b=a)}),b}function g(){var a,d=c.hash();d?(a=h.getElementById(d))?a.scrollIntoView():(a=f(h.getElementsByName(d)))?a.scrollIntoView():"top"===d&&b.scrollTo(0,0):b.scrollTo(0,0)}var h=b.document;return a&&d.$watch(function(){return c.hash()},function(){d.$evalAsync(g)}),g}]}function Cb(a,b,d,f){function g(a){try{a.apply(null,L(arguments,1))}finally{if(s--,0===s)for(;u.length;)try{u.pop()()}catch(b){d.error(b)}}}function h(a,b){!function c(){e(w,function(a){a()}),v=b(c,a)}()}function i(){x!=j.url()&&(x=j.url(),e(A,function(a){a(j.url())}))}var j=this,k=b[0],l=a.location,m=a.history,o=a.setTimeout,p=a.clearTimeout,r={};j.isMock=!1;var s=0,u=[];j.$$completeOutstandingRequest=g,j.$$incOutstandingRequestCount=function(){s++},j.notifyWhenNoOutstandingRequests=function(a){e(w,function(a){a()}),0===s?a():u.push(a)};var v,w=[];j.addPollFn=function(a){return q(v)&&h(100,o),w.push(a),a};var x=l.href,y=b.find("base"),z=null;j.url=function(a,b){if(a){if(x==a)return;return x=a,f.history?b?m.replaceState(null,"",a):(m.pushState(null,"",a),y.attr("href",y.attr("href"))):b?(l.replace(a),z=a):(l.href=a,z=null),j}return z||l.href.replace(/%27/g,"'")};var A=[],B=!1;j.onUrlChange=function(b){return B||(f.history&&Vc(a).bind("popstate",i),f.hashchange?Vc(a).bind("hashchange",i):j.addPollFn(i),B=!0),A.push(b),b},j.baseHref=function(){var a=y.attr("href");return a?a.replace(/^https?\:\/\/[^\/]*/,""):""};var C={},D="",E=j.baseHref();j.cookies=function(a,b){var e,f,g,h,i;if(!a){if(k.cookie!==D)for(D=k.cookie,f=D.split("; "),C={},h=0;h0){var a=unescape(g.substring(0,i));C[a]===c&&(C[a]=unescape(g.substring(i+1)))}return C}b===c?k.cookie=escape(a)+"=;path="+E+";expires=Thu, 01 Jan 1970 00:00:00 GMT":t(b)&&(e=(k.cookie=escape(a)+"="+escape(b)+";path="+E).length+1,e>4096&&d.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+e+" > 4096 bytes)!"))},j.defer=function(a,b){var c;return s++,c=o(function(){delete r[c],g(a)},b||0),r[c]=!0,c},j.defer.cancel=function(a){return r[a]?(delete r[a],p(a),g(n),!0):!1}}function Db(){this.$get=["$window","$log","$sniffer","$document",function(a,b,c,d){return new Cb(a,d,b,c)}]}function Eb(){this.$get=function(){function a(a,c){function d(a){a!=l&&(m?m==a&&(m=a.n):m=a,e(a.n,a.p),e(a,l),l=a,l.n=null)}function e(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw Error("cacheId "+a+" taken");var f=0,g=k({},c,{id:a}),h={},i=c&&c.capacity||Number.MAX_VALUE,j={},l=null,m=null;return b[a]={put:function(a,b){var c=j[a]||(j[a]={key:a});d(c),q(b)||(a in h||f++,h[a]=b,f>i&&this.remove(m.key))},get:function(a){var b=j[a];if(b)return d(b),h[a]},remove:function(a){var b=j[a];b&&(b==l&&(l=b.p),b==m&&(m=b.n),e(b.n,b.p),delete j[a],delete h[a],f--)},removeAll:function(){h={},f=0,j={},l=m=null},destroy:function(){h=null,g=null,j=null,delete b[a]},info:function(){return k({},g,{size:f})}}}var b={};return a.info=function(){var a={};return e(b,function(b,c){a[c]=b.info()}),a},a.get=function(a){return b[a]},a}}function Fb(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function Gb(a){var d={},f="Directive",g=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,i=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,j="Template must have exactly one root element. was: ",l=/^\s*(https?|ftp|mailto|file):/;this.directive=function m(b,c){return t(b)?(_(c,"directive"),d.hasOwnProperty(b)||(d[b]=[],a.factory(b+f,["$injector","$exceptionHandler",function(a,c){var f=[];return e(d[b],function(d){try{var e=a.invoke(d);x(e)?e={compile:p(e)}:!e.compile&&e.link&&(e.compile=p(e.link)),e.priority=e.priority||0,e.name=e.name||b,e.require=e.require||e.controller&&e.name,e.restrict=e.restrict||"A",f.push(e)}catch(g){c(g)}}),f}])),d[b].push(c)):e(b,h(m)),this},this.urlSanitizationWhitelist=function(a){return r(a)?(l=a,this):l},this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document",function(a,h,m,n,q,r,u,v,y){function z(a,b,c){a instanceof Vc||(a=Vc(a)),e(a,function(b,c){3==b.nodeType&&b.nodeValue.match(/\S+/)&&(a[c]=Vc(b).wrap("").parent()[0])});var d=B(a,b,a,c);return function(b,c){_(b,"scope");for(var e=c?nd.clone.call(a):a,f=0,g=e.length;g>f;f++){var h=e[f];(1==h.nodeType||9==h.nodeType)&&e.eq(f).data("$scope",b)}return A(e,"ng-scope"),c&&c(e,b),d&&d(b,e,e),e}}function A(a,b){try{a.addClass(b)}catch(c){}}function B(a,b,d,e){function f(a,d,e,f){var g,h,i,j,k,m,n,o,p=[];for(m=0,n=d.length;n>m;m++)p.push(d[m]);for(m=0,o=0,n=l.length;n>m;o++)i=p[o],g=l[m++],h=l[m++],g?(g.scope?(j=a.$new(s(g.scope)),Vc(i).data("$scope",j)):j=a,k=g.transclude,k||!f&&b?g(h,j,i,e,function(b){return function(c){var d=a.$new();return d.$$transcluded=!0,b(d,c).bind("$destroy",M(d,d.$destroy))}}(k||b)):g(h,j,i,c,f)):h&&h(a,i.childNodes,c,f)}for(var g,h,i,j,k,l=[],m=0;mp;p++)k=o[p],(!Zc||Zc>=8||k.specified)&&(l=k.name,m=Hb(l.toLowerCase()),j[m]=l,c[m]=n=dd(Zc&&"href"==l?decodeURIComponent(a.getAttribute(l,2)):k.value),ub(a,m)&&(c[m]=!0),L(a,b,n,m),E(b,m,"A",d));if(f=a.className,t(f)&&""!==f)for(;e=i.exec(f);)m=Hb(e[2]),E(b,m,"C",d)&&(c[m]=dd(e[3])),f=f.substr(e.index+e[0].length);break;case 3:K(b,a.nodeValue);break;case 8:try{e=g.exec(a.nodeValue),e&&(m=Hb(e[1]),E(b,m,"M",d)&&(c[m]=dd(e[2])))}catch(r){}}return b.sort(H),b}function D(a,d,f,g,h){function i(a,b){a&&(a.require=n.require,E.push(a)),b&&(b.require=n.require,H.push(b))}function k(a,b){var c,d="data",f=!1;if(t(a)){for(;"^"==(c=a.charAt(0))||"?"==c;)a=a.substr(1),"^"==c&&(d="inheritedData"),f=f||"?"==c;if(c=b[d]("$"+a+"Controller"),!c&&!f)throw Error("No controller: "+a);return c}return w(a)&&(c=[],e(a,function(a){c.push(k(a,b))})),c}function l(a,b,g,h,i){var j,l,n,o,p,q;if(j=d===g?f:I(f,new O(Vc(g),f.$attr)),l=j.$$element,L){var s=/^\s*([@=&])\s*(\w*)\s*$/,t=b.$parent||b;e(L.scope,function(a,c){var d,e,f,g=a.match(s)||[],h=g[2]||c,i=g[1];switch(b.$$isolateBindings[c]=i+h,i){case"@":j.$observe(h,function(a){b[c]=a}),j.$$observers[h].$$scope=t;break;case"=":e=r(j[h]),f=e.assign||function(){throw d=b[c]=e(t),Error(ud+j[h]+" (directive: "+L.name+")")},d=b[c]=e(t),b.$watch(function(){var a=e(t);return a!==b[c]&&(a!==d?d=b[c]=a:f(t,a=d=b[c])),a});break;case"&":e=r(j[h]),b[c]=function(a){return e(t,a)};break;default:throw Error("Invalid isolate scope definition for directive "+L.name+": "+a)}})}for(v&&e(v,function(a){var c={$scope:b,$element:l,$attrs:j,$transclude:i};q=a.controller,"@"==q&&(q=j[a.name]),l.data("$"+a.name+"Controller",u(q,c))}),n=0,o=E.length;o>n;n++)try{p=E[n],p(b,l,j,p.require&&k(p.require,l))}catch(w){m(w,R(l))}for(a&&a(b,g.childNodes,c,i),n=0,o=H.length;o>n;n++)try{p=H[n],p(b,l,j,p.require&&k(p.require,l))}catch(w){m(w,R(l))}}for(var n,o,p,q,v,y,B,D=-Number.MAX_VALUE,E=[],H=[],K=null,L=null,M=null,P=f.$$element=Vc(d),Q=g,S=0,U=a.length;U>S&&(n=a[S],p=c,!(D>n.priority));S++){if((B=n.scope)&&(J("isolated scope",L,n,P),s(B)&&(A(P,"ng-isolate-scope"),L=n),A(P,"ng-scope"),K=K||n),o=n.name,(B=n.controller)&&(v=v||{},J("'"+o+"' controller",v[o],n,P),v[o]=n),(B=n.transclude)&&(J("transclusion",q,n,P),q=n,D=n.priority,"element"==B?(p=Vc(d),P=f.$$element=Vc(b.createComment(" "+o+": "+f[o]+" ")),d=P[0],N(h,Vc(p[0]),d),Q=z(p,g,D)):(p=Vc(ib(d)).contents(),P.html(""),Q=z(p,g))),B=n.template)if(J("template",M,n,P),M=n,B=T(B),n.replace){if(p=Vc("
    "+dd(B)+"
    ").contents(),d=p[0],1!=p.length||1!==d.nodeType)throw new Error(j+B);N(h,P,d);var V={$attr:{}};a=a.concat(C(d,a.splice(S+1,a.length-(S+1)),V)),F(f,V),U=a.length}else P.html(B);if(n.templateUrl)J("template",M,n,P),M=n,l=G(a.splice(S,a.length-S),l,P,f,h,n.replace,Q),U=a.length;else if(n.compile)try{y=n.compile(P,f,Q),x(y)?i(null,y):y&&i(y.pre,y.post)}catch(W){m(W,R(P))}n.terminal&&(l.terminal=!0,D=Math.max(D,n.priority))}return l.scope=K&&K.scope,l.transclude=q&&Q,l}function E(b,e,g,h){var i=!1;if(d.hasOwnProperty(e))for(var j,k=a.get(e+f),l=0,n=k.length;n>l;l++)try{j=k[l],(h===c||h>j.priority)&&-1!=j.restrict.indexOf(g)&&(b.push(j),i=!0)}catch(o){m(o)}return i}function F(a,b){var c=b.$attr,d=a.$attr,f=a.$$element;e(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))}),e(b,function(b,e){"class"==e?(A(f,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==e?f.attr("style",f.attr("style")+";"+b):"$"==e.charAt(0)||a.hasOwnProperty(e)||(a[e]=b,d[e]=c[e])})}function G(a,b,c,d,e,f,g){var h,i,l=[],m=c[0],o=a.shift(),p=k({},o,{controller:null,templateUrl:null,transclude:null,scope:null});return c.html(""),n.get(o.templateUrl,{cache:q}).success(function(k){var n,o,q;if(k=T(k),f){if(q=Vc("
    "+dd(k)+"
    ").contents(),n=q[0],1!=q.length||1!==n.nodeType)throw new Error(j+k);o={$attr:{}},N(e,c,n),C(n,a,o),F(d,o)}else n=m,c.html(k);for(a.unshift(p),h=D(a,n,d,g),i=B(c[0].childNodes,g);l.length;){var r=l.pop(),s=l.pop(),t=l.pop(),u=l.pop(),v=n;t!==m&&(v=ib(n),N(s,Vc(t),v)),h(function(){b(i,u,v,e,r)},u,v,e,r)}l=null}).error(function(a,b,c,d){throw Error("Failed to load template: "+d.url)}),function(a,c,d,e,f){l?(l.push(c),l.push(d),l.push(e),l.push(f)):h(function(){b(i,c,d,e,f)},c,d,e,f)}}function H(a,b){return b.priority-a.priority}function J(a,b,c,d){if(b)throw Error("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+R(d))}function K(a,b){var c=h(b,!0);c&&a.push({priority:0,compile:p(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c),A(d.data("$binding",e),"ng-binding"),a.$watch(c,function(a){b[0].nodeValue=a})})})}function L(a,b,d,e){var f=h(d,!0);f&&b.push({priority:100,compile:p(function(a,b,d){var g=d.$$observers||(d.$$observers={});"class"===e&&(f=h(d[e],!0)),d[e]=c,(g[e]||(g[e]=[])).$$inter=!0,(d.$$observers&&d.$$observers[e].$$scope||a).$watch(f,function(a){d.$set(e,a)})})})}function N(a,b,c){var d,e,f=b[0],g=f.parentNode;if(a)for(d=0,e=a.length;e>d;d++)if(a[d]==f){a[d]=c;break}g&&g.replaceChild(c,f),c[Vc.expando]=f[Vc.expando],b[0]=c}var O=function(a,b){this.$$element=a,this.$attr=b||{}};O.prototype={$normalize:Hb,$set:function(a,b,d,f){var g,h=ub(this.$$element[0],a),i=this.$$observers;h&&(this.$$element.prop(a,b),f=h),this[a]=b,f?this.$attr[a]=f:(f=this.$attr[a],f||(this.$attr[a]=f=Z(a,"-"))),"A"===Yc(this.$$element[0])&&"href"===a&&(P.setAttribute("href",b),g=P.href,""===g||g.match(l)||(this[a]=b="unsafe:"+g)),d!==!1&&(null===b||b===c?this.$$element.removeAttr(f):this.$$element.attr(f,b)),i&&e(i[a],function(a){try{a(b)}catch(c){m(c)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers={}),e=d[a]||(d[a]=[]);return e.push(b),v.$evalAsync(function(){e.$$inter||b(c[a])}),b}};var P=y[0].createElement("a"),Q=h.startSymbol(),S=h.endSymbol(),T="{{"==Q||"}}"==S?o:function(a){return a.replace(/\{\{/g,Q).replace(/}}/g,S)};return z}]}function Hb(a){return fb(a.replace(vd,""))}function Ib(){var a={};this.register=function(b,c){s(b)?k(a,b):a[b]=c},this.$get=["$injector","$window",function(b,c){return function(d,e){if(t(d)){var f=d;d=a.hasOwnProperty(f)?a[f]:bb(e.$scope,f,!0)||bb(c,f,!0),ab(d,f,!0)}return b.instantiate(d,e)}}]}function Jb(){this.$get=["$window",function(a){return Vc(a.document)}]}function Kb(){this.$get=["$log",function(a){return function(){a.error.apply(a,arguments)}}]}function Lb(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a},this.endSymbol=function(a){return a?(b=a,this):b},this.$get=["$parse",function(d){function e(e,h){for(var i,j,k,l,m=0,n=[],o=e.length,p=!1,q=[];o>m;)-1!=(i=e.indexOf(a,m))&&-1!=(j=e.indexOf(b,i+f))?(m!=i&&n.push(e.substring(m,i)),n.push(k=d(l=e.substring(i+f,j))),k.exp=l,m=j+g,p=!0):(m!=o&&n.push(e.substring(m)),m=o);return(o=n.length)||(n.push(""),o=1),!h||p?(q.length=o,k=function(a){for(var b,d=0,e=o;e>d;d++)"function"==typeof(b=n[d])&&(b=b(a),null==b||b==c?b="":"string"!=typeof b&&(b=O(b))),q[d]=b;return q.join("")},k.exp=e,k.parts=n,k):void 0}var f=a.length,g=b.length;return e.startSymbol=function(){return a},e.endSymbol=function(){return b},e}]}function Mb(a){for(var b=a.split("/"),c=b.length;c--;)b[c]=V(b[c]);return b.join("/")}function Nb(a,b){var c=wd.exec(a);return c={protocol:c[1],host:c[3],port:l(c[5])||zd[c[1]]||null,path:c[6]||"/",search:c[8],hash:c[10]},b&&(b.$$protocol=c.protocol,b.$$host=c.host,b.$$port=c.port),c}function Ob(a,b,c){return a+"://"+b+(c==zd[a]?"":":"+c)}function Pb(a){return a.substr(0,a.lastIndexOf("/"))}function Qb(a,b,c){var d=Nb(a);return decodeURIComponent(d.path)!=b||q(d.hash)||0!==d.hash.indexOf(c)?a:Ob(d.protocol,d.host,d.port)+Pb(b)+d.hash.substr(c.length)}function Rb(a,b,c){var d=Nb(a);if(decodeURIComponent(d.path)!=b||q(d.hash)||0!==d.hash.indexOf(c)){var e=d.search&&"?"+d.search||"",f=d.hash&&"#"+d.hash||"",g=Pb(b),h=d.path.substr(g.length);if(0!==d.path.indexOf(g))throw Error('Invalid url "'+a+'", missing path prefix "'+g+'" !');return Ob(d.protocol,d.host,d.port)+b+"#"+c+h+e+f}return a}function Sb(a,b,c){b=b||"",this.$$parse=function(a){var c=Nb(a,this);if(0!==c.path.indexOf(b))throw Error('Invalid url "'+a+'", missing path prefix "'+b+'" !');this.$$path=decodeURIComponent(c.path.substr(b.length)),this.$$search=T(c.search),this.$$hash=c.hash&&decodeURIComponent(c.hash)||"",this.$$compose()},this.$$compose=function(){var a=U(this.$$search),c=this.$$hash?"#"+V(this.$$hash):"";this.$$url=Mb(this.$$path)+(a?"?"+a:"")+c,this.$$absUrl=Ob(this.$$protocol,this.$$host,this.$$port)+b+this.$$url},this.$$rewriteAppUrl=function(a){return 0==a.indexOf(c)?a:void 0},this.$$parse(a)}function Tb(a,b,c){var d;this.$$parse=function(a){var c=Nb(a,this);if(c.hash&&0!==c.hash.indexOf(b))throw Error('Invalid url "'+a+'", missing hash prefix "'+b+'" !');d=c.path+(c.search?"?"+c.search:""),c=yd.exec((c.hash||"").substr(b.length)),this.$$path=c[1]?("/"==c[1].charAt(0)?"":"/")+decodeURIComponent(c[1]):"",this.$$search=T(c[3]),this.$$hash=c[5]&&decodeURIComponent(c[5])||"",this.$$compose()},this.$$compose=function(){var a=U(this.$$search),c=this.$$hash?"#"+V(this.$$hash):"";this.$$url=Mb(this.$$path)+(a?"?"+a:"")+c,this.$$absUrl=Ob(this.$$protocol,this.$$host,this.$$port)+d+(this.$$url?"#"+b+this.$$url:"")},this.$$rewriteAppUrl=function(a){return 0==a.indexOf(c)?a:void 0},this.$$parse(a)}function Ub(a,b,c,d){Tb.apply(this,arguments),this.$$rewriteAppUrl=function(a){return 0==a.indexOf(c)?c+d+"#"+b+a.substr(c.length):void 0}}function Vb(a){return function(){return this[a]}}function Wb(a,b){return function(c){return q(c)?this[a]:(this[a]=b(c),this.$$compose(),this)}}function Xb(){var b="",c=!1;this.hashPrefix=function(a){return r(a)?(b=a,this):b},this.html5Mode=function(a){return r(a)?(c=a,this):c},this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(d,e,f,g){function h(a){d.$broadcast("$locationChangeSuccess",i.absUrl(),a)}var i,j,k,l,m=e.url(),n=Nb(m);c?(j=e.baseHref()||"/",k=Pb(j),l=Ob(n.protocol,n.host,n.port)+k+"/",i=f.history?new Sb(Qb(m,j,b),k,l):new Ub(Rb(m,j,b),b,l,j.substr(k.length+1))):(l=Ob(n.protocol,n.host,n.port)+(n.path||"")+(n.search?"?"+n.search:"")+"#"+b+"/",i=new Tb(m,b,l)),g.bind("click",function(b){if(!b.ctrlKey&&!b.metaKey&&2!=b.which){for(var c=Vc(b.target);"a"!==Rc(c[0].nodeName);)if(c[0]===g[0]||!(c=c.parent())[0])return;var e=c.prop("href"),f=i.$$rewriteAppUrl(e);e&&!c.attr("target")&&f&&(i.$$parse(f),d.$apply(),b.preventDefault(),a.angular["ff-684208-preventDefault"]=!0)}}),i.absUrl()!=m&&e.url(i.absUrl(),!0),e.onUrlChange(function(a){if(i.absUrl()!=a){if(d.$broadcast("$locationChangeStart",a,i.absUrl()).defaultPrevented)return e.url(i.absUrl()),void 0;d.$evalAsync(function(){var b=i.absUrl();i.$$parse(a),h(b)}),d.$$phase||d.$digest()}});var o=0;return d.$watch(function(){var a=e.url(),b=i.$$replace;return o&&a==i.absUrl()||(o++,d.$evalAsync(function(){d.$broadcast("$locationChangeStart",i.absUrl(),a).defaultPrevented?i.$$parse(a):(e.url(i.absUrl(),b),h(a))})),i.$$replace=!1,o}),i}]}function Yb(){this.$get=["$window",function(a){function b(a){return a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line)),a}function c(c){var d=a.console||{},f=d[c]||d.log||n;return f.apply?function(){var a=[];return e(arguments,function(c){a.push(b(c))}),f.apply(d,a)}:function(a,b){f(a,b)}}return{log:c("log"),warn:c("warn"),info:c("info"),error:c("error")}}]}function Zb(a,b){function c(a){return-1!=a.indexOf(p)}function d(a){return-1!=a.indexOf(u)}function e(){return s+1="0"&&"9">=a}function g(a){return" "==a||"\r"==a||" "==a||"\n"==a||" "==a||" "==a}function h(a){return a>="a"&&"z">=a||a>="A"&&"Z">=a||"_"==a||"$"==a}function i(a){return"-"==a||"+"==a||f(a)}function j(b,c,d){throw d=d||s,Error("Lexer Error: "+b+" at column"+(r(c)?"s "+c+"-"+s+" ["+a.substring(c,d)+"]":" "+d)+" in expression ["+a+"].")}function l(){for(var b="",c=s;s0){var e=J[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function i(a,c,d,e){var g=h(a,c,d,e);return g?(b&&!g.json&&f("is not valid json",g),J.shift(),g):!1}function j(a){i(a)||f("is unexpected, expecting ["+a+"]",h())}function l(a,b){return function(c,d){return a(c,d,b)}}function m(a,b,c){return function(d,e){return b(d,e,a,c)}}function o(){for(var a=[];;)if(J.length>0&&!h("}",")",";","]")&&a.push(O()),!i(";"))return 1==a.length?a[0]:function(b,c){for(var d,e=0;e","<=",">="))&&(b=m(b,a.fn,x())),b}function y(){for(var a,b=z();a=i("+","-");)b=m(b,a.fn,z());return b}function z(){for(var a,b=A();a=i("*","/","%");)b=m(b,a.fn,A());return b}function A(){var a;return i("+")?B():(a=i("-"))?m(I,a.fn,A()):(a=i("!"))?l(a.fn,A()):B()}function B(){var a;if(i("("))a=O(),j(")");else if(i("["))a=F();else if(i("{"))a=G();else{var b=i();a=b.fn,a||f("not a primary expression",b)}for(var c,d;c=i("(","[",".");)"("===c.text?(a=L(a,d),d=null):"["===c.text?(d=a,a=N(a)):"."===c.text?(d=a,a=M(a)):f("IMPOSSIBLE");return a}function C(a){var b=i().text,c=bc(b,e);return k(function(b,d,e){return c(e||a(b,d),d) +},{assign:function(c,d,e){return _b(a(c,e),b,d)}})}function D(a){var b=s();return j("]"),k(function(d,e){var f,g,h=a(d,e),i=b(d,e);return h?(f=h[i],f&&f.then&&(g=f,"$$v"in f||(g.$$v=c,g.then(function(a){g.$$v=a})),f=f.$$v),f):c},{assign:function(c,d,e){return a(c,e)[b(c,e)]=d}})}function E(a,b){var c=[];if(")"!=g().text)do c.push(s());while(i(","));return j(")"),function(d,e){for(var f=[],g=b?b(d,e):d,h=0;h1;e++){var f=d.shift(),g=a[f];g||(g={},a[f]=g),a=g}return a[d.shift()]=c,c}function ac(a,b,d,e,f){return function(g,h){var i,j=h&&h.hasOwnProperty(a)?h:g;return null===j||j===c?j:(j=j[a],j&&j.then&&("$$v"in j||(i=j,i.$$v=c,i.then(function(a){i.$$v=a})),j=j.$$v),b&&null!==j&&j!==c?(j=j[b],j&&j.then&&("$$v"in j||(i=j,i.$$v=c,i.then(function(a){i.$$v=a})),j=j.$$v),d&&null!==j&&j!==c?(j=j[d],j&&j.then&&("$$v"in j||(i=j,i.$$v=c,i.then(function(a){i.$$v=a})),j=j.$$v),e&&null!==j&&j!==c?(j=j[e],j&&j.then&&("$$v"in j||(i=j,i.$$v=c,i.then(function(a){i.$$v=a})),j=j.$$v),f&&null!==j&&j!==c?(j=j[f],j&&j.then&&("$$v"in j||(i=j,i.$$v=c,i.then(function(a){i.$$v=a})),j=j.$$v),j):j):j):j):j)}}function bc(a,b){if(Cd.hasOwnProperty(a))return Cd[a];var d,f=a.split("."),g=f.length;if(b)d=6>g?ac(f[0],f[1],f[2],f[3],f[4]):function(a,b){var d,e=0;do d=ac(f[e++],f[e++],f[e++],f[e++],f[e++])(a,b),b=c,a=d;while(g>e);return d};else{var h="var l, fn, p;\n";e(f,function(a,b){h+="if(s === null || s === undefined) return s;\nl=s;\ns="+(b?"s":'((k&&k.hasOwnProperty("'+a+'"))?k:s)')+'["'+a+'"]'+";\n"+"if (s && s.then) {\n"+' if (!("$$v" in s)) {\n'+" p=s;\n"+" p.$$v = undefined;\n"+" p.then(function(v) {p.$$v=v;});\n"+"}\n"+" s=s.$$v\n"+"}\n"}),h+="return s;",d=Function("s","k",h),d.toString=function(){return h}}return Cd[a]=d}function cc(){var a={};this.$get=["$filter","$sniffer",function(b,c){return function(d){switch(typeof d){case"string":return a.hasOwnProperty(d)?a[d]:a[d]=$b(d,!1,b,c.csp);case"function":return d;default:return n}}}]}function dc(){this.$get=["$rootScope","$exceptionHandler",function(a,b){return ec(function(b){a.$evalAsync(b)},b)}]}function ec(a,b){function d(a){return a}function f(a){return j(a)}function g(a){var b=h(),c=a.length,d=[];return c?e(a,function(a,e){i(a).then(function(a){e in d||(d[e]=a,--c||b.resolve(d))},function(a){e in d||b.reject(a)})}):b.resolve(d),b.promise}var h=function(){var e,g,k=[];return g={resolve:function(b){if(k){var d=k;k=c,e=i(b),d.length&&a(function(){for(var a,b=0,c=d.length;c>b;b++)a=d[b],e.then(a[0],a[1])})}},reject:function(a){g.resolve(j(a))},promise:{then:function(a,c){var g=h(),i=function(c){try{g.resolve((a||d)(c))}catch(e){g.reject(e),b(e)}},j=function(a){try{g.resolve((c||f)(a))}catch(d){g.reject(d),b(d)}};return k?k.push([i,j]):e.then(i,j),g.promise}}}},i=function(b){return b&&b.then?b:{then:function(c){var d=h();return a(function(){d.resolve(c(b))}),d.promise}}},j=function(b){return{then:function(c,d){var e=h();return a(function(){e.resolve((d||f)(b))}),e.promise}}},k=function(c,e,g){var k,l=h(),m=function(a){try{return(e||d)(a)}catch(c){return b(c),j(c)}},n=function(a){try{return(g||f)(a)}catch(c){return b(c),j(c)}};return a(function(){i(c).then(function(a){k||(k=!0,l.resolve(i(a).then(m,n)))},function(a){k||(k=!0,l.resolve(n(a)))})}),l.promise};return{defer:h,reject:j,when:k,all:g}}function fc(){var a={};this.when=function(b,c){if(a[b]=k({reloadOnSearch:!0},c),b){var d="/"==b[b.length-1]?b.substr(0,b.length-1):b+"/";a[d]={redirectTo:b}}return this},this.otherwise=function(a){return this.when(null,a),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache",function(b,c,d,f,g,h,i){function j(a,b){b="^"+b.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"$";for(var c,d="",f=[],g={},h=/:(\w+)/g,i=0;null!==(c=h.exec(b));)d+=b.slice(i,c.index),d+="([^\\/]*)",f.push(c[1]),i=h.lastIndex;d+=b.substr(i);var j=a.match(new RegExp(d));return j&&e(f,function(a,b){g[a]=j[b+1]}),j?g:null}function l(){var a=n(),j=q.current;a&&j&&a.$$route===j.$$route&&J(a.pathParams,j.pathParams)&&!a.reloadOnSearch&&!p?(j.params=a.params,H(j.params,d),b.$broadcast("$routeUpdate",j)):(a||j)&&(p=!1,b.$broadcast("$routeChangeStart",a,j),q.current=a,a&&a.redirectTo&&(t(a.redirectTo)?c.path(o(a.redirectTo,a.params)).search(a.params).replace():c.url(a.redirectTo(a.pathParams,c.path(),c.search())).replace()),f.when(a).then(function(){if(a){var b,c=[],d=[];return e(a.resolve||{},function(a,b){c.push(b),d.push(t(a)?g.get(a):g.invoke(a))}),r(b=a.template)||r(b=a.templateUrl)&&(b=h.get(b,{cache:i}).then(function(a){return a.data})),r(b)&&(c.push("$template"),d.push(b)),f.all(d).then(function(a){var b={};return e(a,function(a,d){b[c[d]]=a}),b})}}).then(function(c){a==q.current&&(a&&(a.locals=c,H(a.params,d)),b.$broadcast("$routeChangeSuccess",a,j))},function(c){a==q.current&&b.$broadcast("$routeChangeError",a,j,c)}))}function n(){var b,d;return e(a,function(a,e){!d&&(b=j(c.path(),e))&&(d=m(a,{params:k({},c.search(),b),pathParams:b}),d.$$route=a)}),d||a[null]&&m(a[null],{params:{},pathParams:{}})}function o(a,b){var c=[];return e((a||"").split(":"),function(a,d){if(0==d)c.push(a);else{var e=a.match(/(\w+)(.*)/),f=e[1];c.push(b[f]),c.push(e[2]||""),delete b[f]}}),c.join("")}var p=!1,q={routes:a,reload:function(){p=!0,b.$evalAsync(l)}};return b.$on("$locationChangeSuccess",l),q}]}function gc(){this.$get=p({})}function hc(){var a=10;this.digestTtl=function(b){return arguments.length&&(a=b),a},this.$get=["$injector","$exceptionHandler","$parse",function(b,c,d){function e(){this.$id=i(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this["this"]=this.$root=this,this.$$destroyed=!1,this.$$asyncQueue=[],this.$$listeners={},this.$$isolateBindings={}}function f(a){if(k.$$phase)throw Error(k.$$phase+" already in progress");k.$$phase=a}function g(){k.$$phase=null}function h(a,b){var c=d(a);return ab(c,b),c}function j(){}e.prototype={$new:function(a){var b,c;if(x(a))throw Error("API-CHANGE: Use $controller to instantiate controllers.");return a?(c=new e,c.$root=this.$root):(b=function(){},b.prototype=this,c=new b,c.$id=i()),c["this"]=c,c.$$listeners={},c.$parent=this,c.$$asyncQueue=[],c.$$watchers=c.$$nextSibling=c.$$childHead=c.$$childTail=null,c.$$prevSibling=this.$$childTail,this.$$childHead?(this.$$childTail.$$nextSibling=c,this.$$childTail=c):this.$$childHead=this.$$childTail=c,c},$watch:function(a,b,c){var d=this,e=h(a,"watch"),f=d.$$watchers,g={fn:b,last:j,get:e,exp:a,eq:!!c};if(!x(b)){var i=h(b||n,"listener");g.fn=function(a,b,c){i(c)}}return f||(f=d.$$watchers=[]),f.unshift(g),function(){G(f,g)}},$digest:function(){var b,d,e,h,i,k,l,m,n,o,p,q=a,r=this,s=[];f("$digest");do{l=!1,n=r;do{for(i=n.$$asyncQueue;i.length;)try{n.$eval(i.shift())}catch(t){c(t)}if(h=n.$$watchers)for(k=h.length;k--;)try{b=h[k],b&&(d=b.get(n))!==(e=b.last)&&!(b.eq?J(d,e):"number"==typeof d&&"number"==typeof e&&isNaN(d)&&isNaN(e))&&(l=!0,b.last=b.eq?H(d):d,b.fn(d,e===j?d:e,n),5>q&&(o=4-q,s[o]||(s[o]=[]),p=x(b.exp)?"fn: "+(b.exp.name||b.exp.toString()):b.exp,p+="; newVal: "+O(d)+"; oldVal: "+O(e),s[o].push(p)))}catch(t){c(t)}if(!(m=n.$$childHead||n!==r&&n.$$nextSibling))for(;n!==r&&!(m=n.$$nextSibling);)n=n.$parent}while(n=m);if(l&&!q--)throw g(),Error(a+" $digest() iterations reached. Aborting!\n"+"Watchers fired in the last 5 iterations: "+O(s))}while(l||i.length);g()},$destroy:function(){if(k!=this&&!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,a.$$childHead==this&&(a.$$childHead=this.$$nextSibling),a.$$childTail==this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null}},$eval:function(a,b){return d(a)(this,b)},$evalAsync:function(a){this.$$asyncQueue.push(a)},$apply:function(a){try{return f("$apply"),this.$eval(a)}catch(b){c(b)}finally{g();try{k.$digest()}catch(b){throw c(b),b}}},$on:function(a,b){var c=this.$$listeners[a];return c||(this.$$listeners[a]=c=[]),c.push(b),function(){c[F(c,b)]=null}},$emit:function(a){var b,d,e,f=[],g=this,h=!1,i={name:a,targetScope:g,stopPropagation:function(){h=!0},preventDefault:function(){i.defaultPrevented=!0},defaultPrevented:!1},j=K([i],arguments,1);do{for(b=g.$$listeners[a]||f,i.currentScope=g,d=0,e=b.length;e>d;d++)if(b[d])try{if(b[d].apply(null,j),h)return i}catch(k){c(k)}else b.splice(d,1),d--,e--;g=g.$parent}while(g);return i},$broadcast:function(a){var b,d,e,f=this,g=f,h=f,i={name:a,targetScope:f,preventDefault:function(){i.defaultPrevented=!0},defaultPrevented:!1},j=K([i],arguments,1);do{for(g=h,i.currentScope=g,b=g.$$listeners[a]||[],d=0,e=b.length;e>d;d++)if(b[d])try{b[d].apply(null,j)}catch(k){c(k)}else b.splice(d,1),d--,e--;if(!(h=g.$$childHead||g!==f&&g.$$nextSibling))for(;g!==f&&!(h=g.$$nextSibling);)g=g.$parent}while(g=h);return i}};var k=new e;return k}]}function ic(){this.$get=["$window",function(a){var b={},c=l((/android (\d+)/.exec(Rc(a.navigator.userAgent))||[])[1]);return{history:!(!a.history||!a.history.pushState||4>c),hashchange:"onhashchange"in a&&(!a.document.documentMode||a.document.documentMode>7),hasEvent:function(c){if("input"==c&&9==Zc)return!1;if(q(b[c])){var d=a.document.createElement("div");b[c]="on"+c in d}return b[c]},csp:!1}}]}function jc(){this.$get=p(a)}function kc(a){var b,c,d,f={};return a?(e(a.split("\n"),function(a){d=a.indexOf(":"),b=Rc(dd(a.substr(0,d))),c=dd(a.substr(d+1)),b&&(f[b]?f[b]+=", "+c:f[b]=c)}),f):f}function lc(a){var b=s(a)?a:c;return function(c){return b||(b=kc(a)),c?b[Rc(c)]||null:b}}function mc(a,b,c){return x(c)?c(a,b):(e(c,function(c){a=c(a,b)}),a)}function nc(a){return a>=200&&300>a}function oc(){var a=/^\s*(\[|\{[^\{])/,b=/[\}\]]\s*$/,d=/^\)\]\}',?\n/,f=this.defaults={transformResponse:[function(c){return t(c)&&(c=c.replace(d,""),a.test(c)&&b.test(c)&&(c=P(c,!0))),c}],transformRequest:[function(a){return s(a)&&!B(a)?O(a):a}],headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}}},h=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,d,i,j,l){function m(a){function c(a){var b=k({},a,{data:mc(a.data,a.headers,n)});return nc(a.status)?b:j.reject(b)}a.method=Sc(a.method);var d,g,h,i,l,m=a.transformRequest||f.transformRequest,n=a.transformResponse||f.transformResponse,o=k({},a.headers),r=k({"X-XSRF-TOKEN":b.cookies()["XSRF-TOKEN"]},f.headers.common,f.headers[Rc(a.method)]);a:for(g in r){h=Rc(g);for(i in a.headers)if(Rc(i)===h)continue a;o[g]=r[g]}if(q(a.data))for(var s in o)if("content-type"===Rc(s)){delete o[s];break}return d=mc(a.data,lc(o),m),l=p(a,d,o),l=l.then(c,c),e(v,function(a){l=a(l)}),l.success=function(b){return l.then(function(c){b(c.data,c.status,c.headers,a)}),l},l.error=function(b){return l.then(null,function(c){b(c.data,c.status,c.headers,a)}),l},l}function n(){e(arguments,function(a){m[a]=function(b,c){return m(k(c||{},{method:a,url:b}))}})}function o(){e(arguments,function(a){m[a]=function(b,c,d){return m(k(d||{},{method:a,url:b,data:c}))}})}function p(b,c,d){function e(a,b,c){h&&(nc(a)?h.put(o,[a,b,kc(c)]):h.remove(o)),f(b,a,c),i.$apply()}function f(a,c,d){c=Math.max(c,0),(nc(c)?l.resolve:l.reject)({data:a,status:c,headers:lc(d),config:b})}function g(){var a=F(m.pendingRequests,b);-1!==a&&m.pendingRequests.splice(a,1)}var h,k,l=j.defer(),n=l.promise,o=r(b.url,b.params);if(m.pendingRequests.push(b),n.then(g,g),b.cache&&"GET"==b.method&&(h=s(b.cache)?b.cache:u),h)if(k=h.get(o)){if(k.then)return k.then(g,g),k;w(k)?f(k[1],k[0],H(k[2])):f(k,200,{})}else h.put(o,n);return k||a(b.method,o,c,e,d,b.timeout,b.withCredentials),n}function r(a,b){if(!b)return a;var d=[];return g(b,function(a,b){null!=a&&a!=c&&(s(a)&&(a=O(a)),d.push(encodeURIComponent(b)+"="+encodeURIComponent(a)))}),a+(-1==a.indexOf("?")?"?":"&")+d.join("&")}var u=d("$http"),v=[];return e(h,function(a){v.push(t(a)?l.get(a):l.invoke(a))}),m.pendingRequests=[],n("get","delete","head","jsonp"),o("post","put"),m.defaults=f,m}]}function pc(){this.$get=["$browser","$window","$document",function(a,b,c){return qc(a,Dd,a.defer,b.angular.callbacks,c[0],b.location.protocol.replace(":",""))}]}function qc(a,b,c,d,f,g){function h(a,b){var c=f.createElement("script"),d=function(){f.body.removeChild(c),b&&b()};c.type="text/javascript",c.src=a,Zc?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=d,f.body.appendChild(c)}return function(f,i,j,k,l,m,o){function p(b,c,d,e){var f=(i.match(wd)||["",g])[1];c="file"==f?d?200:404:c,c=1223==c?204:c,b(c,d,e),a.$$completeOutstandingRequest(n)}if(a.$$incOutstandingRequestCount(),i=i||a.url(),"jsonp"==Rc(f)){var q="_"+(d.counter++).toString(36);d[q]=function(a){d[q].data=a},h(i.replace("JSON_CALLBACK","angular.callbacks."+q),function(){d[q].data?p(k,200,d[q].data):p(k,-2),delete d[q]})}else{var r=new b;r.open(f,i,!0),e(l,function(a,b){a&&r.setRequestHeader(b,a)});var s;r.onreadystatechange=function(){if(4==r.readyState){var a=r.getAllResponseHeaders(),b=["Cache-Control","Content-Language","Content-Type","Expires","Last-Modified","Pragma"];a||(a="",e(b,function(b){var c=r.getResponseHeader(b);c&&(a+=b+": "+c+"\n")})),p(k,s||r.status,r.responseText,a)}},o&&(r.withCredentials=!0),r.send(j||""),m>0&&c(function(){s=-1,r.abort()},m)}}}function rc(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(a){return 1===a?"one":"other"}}}}function sc(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(a,b,c,d){function e(e,g,h){var i,j=c.defer(),k=j.promise,l=r(h)&&!h;return i=b.defer(function(){try{j.resolve(e())}catch(b){j.reject(b),d(b)}finally{delete f[k.$$timeoutId]}l||a.$apply()},g),k.$$timeoutId=i,f[i]=j,k}var f={};return e.cancel=function(a){return a&&a.$$timeoutId in f?(f[a.$$timeoutId].reject("canceled"),delete f[a.$$timeoutId],b.defer.cancel(a.$$timeoutId)):!1},e}]}function tc(a){function b(b,d){return a.factory(b+c,d)}var c="Filter";this.register=b,this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}],b("currency",vc),b("date",Dc),b("filter",uc),b("json",Ec),b("limitTo",Fc),b("lowercase",Id),b("number",wc),b("orderBy",Gc),b("uppercase",Jd)}function uc(){return function(a,b){if(!w(a))return a;var c=[];c.check=function(a){for(var b=0;b-1;case"object":for(var c in a)if("$"!==c.charAt(0)&&d(a[c],b))return!0;return!1;case"array":for(var e=0;ea;a=Math.abs(a);var g=a+"",h="",i=[],j=!1;if(-1!==g.indexOf("e")){var k=g.match(/([\d\.]+)e(-?)(\d+)/);k&&"-"==k[2]&&k[3]>e+1?g="0":(h=g,j=!0)}if(j)e>0&&a>-1&&1>a&&(h=a.toFixed(e));else{var l=(g.split(Ed)[1]||"").length;q(e)&&(e=Math.min(Math.max(b.minFrac,l),b.maxFrac));var m=Math.pow(10,e);a=Math.round(a*m)/m;var n=(""+a).split(Ed),o=n[0];n=n[1]||"";var p=0,r=b.lgSize,s=b.gSize;if(o.length>=r+s){p=o.length-r;for(var t=0;p>t;t++)0===(p-t)%s&&0!==t&&(h+=c),h+=o.charAt(t)}for(t=p;ta&&(d="-",a=-a),a=""+a;a.length0||f>-c)&&(f+=c),0===f&&-12==c&&(f=12),yc(f,b,d)}}function Ac(a,b){return function(c,d){var e=c["get"+a](),f=Sc(b?"SHORT"+a:a);return d[f][e]}}function Bc(a){var b=-1*a.getTimezoneOffset(),c=b>=0?"+":"";return c+=yc(Math[b>0?"floor":"ceil"](b/60),2)+yc(Math.abs(b%60),2)}function Cc(a,b){return a.getHours()<12?b.AMPMS[0]:b.AMPMS[1]}function Dc(a){function b(a){var b;if(b=a.match(c)){var d=new Date(0),e=0,f=0;return b[9]&&(e=l(b[9]+b[10]),f=l(b[9]+b[11])),d.setUTCFullYear(l(b[1]),l(b[2])-1,l(b[3])),d.setUTCHours(l(b[4]||0)-e,l(b[5]||0)-f,l(b[6]||0),l(b[7]||0)),d}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d){var f,g,h="",i=[];if(d=d||"mediumDate",d=a.DATETIME_FORMATS[d]||d,t(c)&&(c=Hd.test(c)?l(c):b(c)),u(c)&&(c=new Date(c)),!v(c))return c;for(;d;)g=Gd.exec(d),g?(i=K(i,g,1),d=i.pop()):(i.push(d),d=null);return e(i,function(b){f=Fd[b],h+=f?f(c,a.DATETIME_FORMATS):b.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),h}}function Ec(){return function(a){return O(a,!0)}}function Fc(){return function(a,b){if(!(a instanceof Array))return a;b=l(b);var c,d,e=[];if(!(a&&a instanceof Array))return e;for(b>a.length?b=a.length:b<-a.length&&(b=-a.length),b>0?(c=0,d=b):(c=a.length+b,d=a.length);d>c;c++)e.push(a[c]);return e}}function Gc(a){return function(b,c,d){function e(a,b){for(var d=0;da?-1:1):d>c?-1:1}if(!w(b))return b;if(!c)return b;c=w(c)?c:[c],c=D(c,function(b){var c=!1,d=b||o;return t(b)&&(("+"==b.charAt(0)||"-"==b.charAt(0))&&(c="-"==b.charAt(0),b=b.substring(1)),d=a(b)),f(function(a,b){return g(d(a),d(b))},c)});for(var h=[],i=0;i15&&19>b||b>=37&&40>=b||j()}),b.bind("change",h),f.hasEvent("paste")&&b.bind("paste cut",j)}e.$render=function(){b.val(Jc(e.$viewValue)?"":e.$viewValue)};var k,m=d.ngPattern,n=function(a,b){return Jc(b)||a.test(b)?(e.$setValidity("pattern",!0),b):(e.$setValidity("pattern",!1),c)};if(m&&(m.match(/^\/(.*)\/$/)?(m=new RegExp(m.substr(1,m.length-2)),k=function(a){return n(m,a)}):k=function(b){var c=a.$eval(m);if(!c||!c.test)throw new Error("Expected "+m+" to be a RegExp but was "+c);return n(c,b)},e.$formatters.push(k),e.$parsers.push(k)),d.ngMinlength){var o=l(d.ngMinlength),p=function(a){return!Jc(a)&&a.lengthq?(e.$setValidity("maxlength",!1),c):(e.$setValidity("maxlength",!0),a)};e.$parsers.push(r),e.$formatters.push(r)}}function Lc(a,b,d,e,f,g){if(Kc(a,b,d,e,f,g),e.$parsers.push(function(a){var b=Jc(a);return b||Sd.test(a)?(e.$setValidity("number",!0),""===a?null:b?a:parseFloat(a)):(e.$setValidity("number",!1),c)}),e.$formatters.push(function(a){return Jc(a)?"":""+a}),d.min){var h=parseFloat(d.min),i=function(a){return!Jc(a)&&h>a?(e.$setValidity("min",!1),c):(e.$setValidity("min",!0),a)};e.$parsers.push(i),e.$formatters.push(i)}if(d.max){var j=parseFloat(d.max),k=function(a){return!Jc(a)&&a>j?(e.$setValidity("max",!1),c):(e.$setValidity("max",!0),a)};e.$parsers.push(k),e.$formatters.push(k)}e.$formatters.push(function(a){return Jc(a)||u(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),c)})}function Mc(a,b,d,e,f,g){Kc(a,b,d,e,f,g);var h=function(a){return Jc(a)||Qd.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),c)};e.$formatters.push(h),e.$parsers.push(h)}function Nc(a,b,d,e,f,g){Kc(a,b,d,e,f,g);var h=function(a){return Jc(a)||Rd.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),c)};e.$formatters.push(h),e.$parsers.push(h)}function Oc(a,b,c,d){q(c.name)&&b.attr("name",i()),b.bind("click",function(){b[0].checked&&a.$apply(function(){d.$setViewValue(c.value)})}),d.$render=function(){var a=c.value;b[0].checked=a==d.$viewValue},c.$observe("value",d.$render)}function Pc(a,b,c,d){var e=c.ngTrueValue,f=c.ngFalseValue;t(e)||(e=!0),t(f)||(f=!1),b.bind("click",function(){a.$apply(function(){d.$setViewValue(b[0].checked)})}),d.$render=function(){b[0].checked=d.$viewValue},d.$formatters.push(function(a){return a===e}),d.$parsers.push(function(a){return a?e:f})}function Qc(a,b){return a="ngClass"+a,Hc(function(d,e,f){function g(a){(b===!0||d.$index%2===b)&&(j&&!J(a,j)&&h(j),i(a)),j=H(a)}function h(a){s(a)&&!w(a)&&(a=D(a,function(a,b){return a?b:void 0})),e.removeClass(w(a)?a.join(" "):a)}function i(a){s(a)&&!w(a)&&(a=D(a,function(a,b){return a?b:void 0})),a&&e.addClass(w(a)?a.join(" "):a)}var j=c;d.$watch(f[a],g,!0),f.$observe("class",function(){var b=d.$eval(f[a]);g(b,b)}),"ngClass"!==a&&d.$watch("$index",function(c,e){var g=1&c;1&g!==e&&(g===b?i(d.$eval(f[a])):h(d.$eval(f[a])))})})}var Rc=function(a){return t(a)?a.toLowerCase():a},Sc=function(a){return t(a)?a.toUpperCase():a},Tc=function(a){return t(a)?a.replace(/[A-Z]/g,function(a){return String.fromCharCode(32|a.charCodeAt(0))}):a},Uc=function(a){return t(a)?a.replace(/[a-z]/g,function(a){return String.fromCharCode(-33&a.charCodeAt(0))}):a};"i"!=="I".toLowerCase()&&(Rc=Tc,Sc=Uc);var Vc,Wc,Xc,Yc,Zc=l((/msie (\d+)/.exec(Rc(navigator.userAgent))||[])[1]),$c=[].slice,_c=[].push,ad=Object.prototype.toString,bd=a.angular||(a.angular={}),cd=["0","0","0"];n.$inject=[],o.$inject=[];var dd=function(){return String.prototype.trim?function(a){return t(a)?a.trim():a}:function(a){return t(a)?a.replace(/^\s*/,"").replace(/\s*$/,""):a}}();Yc=9>Zc?function(a){return a=a.nodeName?a:a[0],a.scopeName&&"HTML"!=a.scopeName?Sc(a.scopeName+":"+a.nodeName):a.nodeName}:function(a){return a.nodeName?a.nodeName:a[0].nodeName};var ed=/[A-Z]/g,fd={full:"1.0.8",major:1,minor:0,dot:8,codeName:"bubble-burst"},gd=hb.cache={},hd=hb.expando="ng-"+(new Date).getTime(),id=1,jd=a.document.addEventListener?function(a,b,c){a.addEventListener(b,c,!1)}:function(a,b,c){a.attachEvent("on"+b,c)},kd=a.document.removeEventListener?function(a,b,c){a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent("on"+b,c)},ld=/([\:\-\_]+(.))/g,md=/^moz([A-Z])/,nd=hb.prototype={ready:function(b){function c(){d||(d=!0,b())}var d=!1;this.bind("DOMContentLoaded",c),hb(a).bind("load",c)},toString:function(){var a=[];return e(this,function(b){a.push(""+b)}),"["+a.join(", ")+"]"},eq:function(a){return a>=0?Vc(this[a]):Vc(this[this.length+a])},length:0,push:_c,sort:[].sort,splice:[].splice},od={};e("multiple,selected,checked,disabled,readOnly,required".split(","),function(a){od[Rc(a)]=a});var pd={};e("input,select,option,textarea,button,form".split(","),function(a){pd[Sc(a)]=!0}),e({data:nb,inheritedData:tb,scope:function(a){return tb(a,"$scope")},controller:sb,injector:function(a){return tb(a,"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:ob,css:function(a,b,d){if(b=fb(b),!r(d)){var e;return 8>=Zc&&(e=a.currentStyle&&a.currentStyle[b],""===e&&(e="auto")),e=e||a.style[b],8>=Zc&&(e=""===e?c:e),e}a.style[b]=d},attr:function(a,b,d){var e=Rc(b);if(od[e]){if(!r(d))return a[b]||(a.attributes.getNamedItem(b)||n).specified?e:c;d?(a[b]=!0,a.setAttribute(b,e)):(a[b]=!1,a.removeAttribute(e))}else if(r(d))a.setAttribute(b,d);else if(a.getAttribute){var f=a.getAttribute(b,2);return null===f?c:f}},prop:function(a,b,c){return r(c)?(a[b]=c,void 0):a[b]},text:k(9>Zc?function(a,b){if(1==a.nodeType){if(q(b))return a.innerText;a.innerText=b}else{if(q(b))return a.nodeValue;a.nodeValue=b}}:function(a,b){return q(b)?a.textContent:(a.textContent=b,void 0)},{$dv:""}),val:function(a,b){if(q(b)){if("SELECT"===Yc(a)&&a.multiple){var c=[];return e(a.options,function(a){a.selected&&c.push(a.value||a.text)}),0===c.length?null:c}return a.value}a.value=b},html:function(a,b){if(q(b))return a.innerHTML;for(var c=0,d=a.childNodes;c":function(a,b,c,d){return c(a,b)>d(a,b)},"<=":function(a,b,c,d){return c(a,b)<=d(a,b)},">=":function(a,b,c,d){return c(a,b)>=d(a,b)},"&&":function(a,b,c,d){return c(a,b)&&d(a,b)},"||":function(a,b,c,d){return c(a,b)||d(a,b)},"&":function(a,b,c,d){return c(a,b)&d(a,b)},"|":function(a,b,c,d){return d(a,b)(a,b,c(a,b))},"!":function(a,b,c){return!c(a,b)}},Bd={n:"\n",f:"\f",r:"\r",t:" ",v:" ","'":"'",'"':'"'},Cd={},Dd=a.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0") +}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(c){}throw new Error("This browser does not support XMLHttpRequest.")};tc.$inject=["$provide"],vc.$inject=["$locale"],wc.$inject=["$locale"];var Ed=".",Fd={yyyy:zc("FullYear",4),yy:zc("FullYear",2,0,!0),y:zc("FullYear",1),MMMM:Ac("Month"),MMM:Ac("Month",!0),MM:zc("Month",2,1),M:zc("Month",1,1),dd:zc("Date",2),d:zc("Date",1),HH:zc("Hours",2),H:zc("Hours",1),hh:zc("Hours",2,-12),h:zc("Hours",1,-12),mm:zc("Minutes",2),m:zc("Minutes",1),ss:zc("Seconds",2),s:zc("Seconds",1),EEEE:Ac("Day"),EEE:Ac("Day",!0),a:Cc,Z:Bc},Gd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,Hd=/^\d+$/;Dc.$inject=["$locale"];var Id=p(Rc),Jd=p(Sc);Gc.$inject=["$parse"];var Kd=p({restrict:"E",compile:function(a,c){return 8>=Zc&&(c.href||c.name||c.$set("href",""),a.append(b.createComment("IE fix"))),function(a,b){b.bind("click",function(a){b.attr("href")||a.preventDefault()})}}}),Ld={};e(od,function(a,b){var c=Hb("ng-"+b);Ld[c]=function(){return{priority:100,compile:function(){return function(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}}}}}),e(["src","href"],function(a){var b=Hb("ng-"+a);Ld[b]=function(){return{priority:99,link:function(c,d,e){e.$observe(b,function(b){b&&(e.$set(a,b),Zc&&d.prop(a,e[a]))})}}}});var Md={$addControl:n,$removeControl:n,$setValidity:n,$setDirty:n};Ic.$inject=["$element","$attrs","$scope"];var Nd=function(a){return["$timeout",function(b){var d={name:"form",restrict:"E",controller:Ic,compile:function(){return{pre:function(a,d,e,f){if(!e.action){var g=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};jd(d[0],"submit",g),d.bind("$destroy",function(){b(function(){kd(d[0],"submit",g)},0,!1)})}var h=d.parent().controller("form"),i=e.name||e.ngForm;i&&(a[i]=f),h&&d.bind("$destroy",function(){h.$removeControl(f),i&&(a[i]=c),k(f,Md)})}}}};return a?k(H(d),{restrict:"EAC"}):d}]},Od=Nd(),Pd=Nd(!0),Qd=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,Rd=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}$/,Sd=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Td={text:Kc,number:Lc,url:Mc,email:Nc,radio:Oc,checkbox:Pc,hidden:n,button:n,submit:n,reset:n},Ud=["$browser","$sniffer",function(a,b){return{restrict:"E",require:"?ngModel",link:function(c,d,e,f){f&&(Td[Rc(e.type)]||Td.text)(c,d,e,f,b,a)}}}],Vd="ng-valid",Wd="ng-invalid",Xd="ng-pristine",Yd="ng-dirty",Zd=["$scope","$exceptionHandler","$attrs","$element","$parse",function(a,b,c,d,f){function g(a,b){b=b?"-"+Z(b,"-"):"",d.removeClass((a?Wd:Vd)+b).addClass((a?Vd:Wd)+b)}this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$name=c.name;var h=f(c.ngModel),i=h.assign;if(!i)throw Error(ud+c.ngModel+" ("+R(d)+")");this.$render=n;var j=d.inheritedData("$formController")||Md,k=0,l=this.$error={};d.addClass(Xd),g(!0),this.$setValidity=function(a,b){l[a]!==!b&&(b?(l[a]&&k--,k||(g(!0),this.$valid=!0,this.$invalid=!1)):(g(!1),this.$invalid=!0,this.$valid=!1,k++),l[a]=!b,g(b,a),j.$setValidity(a,b,this))},this.$setViewValue=function(c){this.$viewValue=c,this.$pristine&&(this.$dirty=!0,this.$pristine=!1,d.removeClass(Xd).addClass(Yd),j.$setDirty()),e(this.$parsers,function(a){c=a(c)}),this.$modelValue!==c&&(this.$modelValue=c,i(a,c),e(this.$viewChangeListeners,function(a){try{a()}catch(c){b(c)}}))};var m=this;a.$watch(function(){var b=h(a);if(m.$modelValue!==b){var c=m.$formatters,d=c.length;for(m.$modelValue=b;d--;)b=c[d](b);m.$viewValue!==b&&(m.$viewValue=b,m.$render())}})}],$d=function(){return{require:["ngModel","^?form"],controller:Zd,link:function(a,b,c,d){var e=d[0],f=d[1]||Md;f.$addControl(e),b.bind("$destroy",function(){f.$removeControl(e)})}}},_d=p({require:"ngModel",link:function(a,b,c,d){d.$viewChangeListeners.push(function(){a.$eval(c.ngChange)})}}),ae=function(){return{require:"?ngModel",link:function(a,b,c,d){if(d){c.required=!0;var e=function(a){return c.required&&(Jc(a)||a===!1)?(d.$setValidity("required",!1),void 0):(d.$setValidity("required",!0),a)};d.$formatters.push(e),d.$parsers.unshift(e),c.$observe("required",function(){e(d.$viewValue)})}}}},be=function(){return{require:"ngModel",link:function(a,b,d,f){var g=/\/(.*)\//.exec(d.ngList),h=g&&new RegExp(g[1])||d.ngList||",",i=function(a){var b=[];return a&&e(a.split(h),function(a){a&&b.push(dd(a))}),b};f.$parsers.push(i),f.$formatters.push(function(a){return w(a)?a.join(", "):c})}}},ce=/^(true|false|\d+)$/,de=function(){return{priority:100,compile:function(a,b){return ce.test(b.ngValue)?function(a,b,c){c.$set("value",a.$eval(c.ngValue))}:function(a,b,c){a.$watch(c.ngValue,function(a){c.$set("value",a)})}}}},ee=Hc(function(a,b,d){b.addClass("ng-binding").data("$binding",d.ngBind),a.$watch(d.ngBind,function(a){b.text(a==c?"":a)})}),fe=["$interpolate",function(a){return function(b,c,d){var e=a(c.attr(d.$attr.ngBindTemplate));c.addClass("ng-binding").data("$binding",e),d.$observe("ngBindTemplate",function(a){c.text(a)})}}],ge=[function(){return function(a,b,c){b.addClass("ng-binding").data("$binding",c.ngBindHtmlUnsafe),a.$watch(c.ngBindHtmlUnsafe,function(a){b.html(a||"")})}}],he=Qc("",!0),ie=Qc("Odd",0),je=Qc("Even",1),ke=Hc({compile:function(a,b){b.$set("ngCloak",c),a.removeClass("ng-cloak")}}),le=[function(){return{scope:!0,controller:"@"}}],me=["$sniffer",function(a){return{priority:1e3,compile:function(){a.csp=!0}}}],ne={};e("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave submit".split(" "),function(a){var b=Hb("ng-"+a);ne[b]=["$parse",function(c){return function(d,e,f){var g=c(f[b]);e.bind(Rc(a),function(a){d.$apply(function(){g(d,{$event:a})})})}}]});var oe=["$http","$templateCache","$anchorScroll","$compile",function(a,b,c,d){return{restrict:"ECA",terminal:!0,compile:function(e,f){var g=f.ngInclude||f.src,h=f.onload||"",i=f.autoscroll;return function(e,f){var j,k=0,l=function(){j&&(j.$destroy(),j=null),f.html("")};e.$watch(g,function(g){var m=++k;g?a.get(g,{cache:b}).success(function(a){m===k&&(j&&j.$destroy(),j=e.$new(),f.html(a),d(f.contents())(j),!r(i)||i&&!e.$eval(i)||c(),j.$emit("$includeContentLoaded"),e.$eval(h))}).error(function(){m===k&&l()}):l()})}}}}],pe=Hc({compile:function(){return{pre:function(a,b,c){a.$eval(c.ngInit)}}}}),qe=Hc({terminal:!0,priority:1e3}),re=["$locale","$interpolate",function(a,b){var c=/{}/g;return{restrict:"EA",link:function(d,f,g){var h=g.count,i=f.attr(g.$attr.when),j=g.offset||0,k=d.$eval(i),l={},m=b.startSymbol(),n=b.endSymbol();e(k,function(a,d){l[d]=b(a.replace(c,m+h+"-"+j+n))}),d.$watch(function(){var b=parseFloat(d.$eval(h));return isNaN(b)?"":(b in k||(b=a.pluralCat(b-j)),l[b](d,f,!0))},function(a){f.text(a)})}}}],se=Hc({transclude:"element",priority:1e3,terminal:!0,compile:function(a,b,c){return function(a,b,d){var e,f,g,h,i=d.ngRepeat,j=i.match(/^\s*(.+)\s+in\s+(.*)\s*$/);if(!j)throw Error("Expected ngRepeat in form of '_item_ in _collection_' but got '"+i+"'.");if(e=j[1],f=j[2],j=e.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/),!j)throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '"+e+"'.");g=j[3]||j[1],h=j[2];var k=new yb;a.$watch(function(a){var d,e,i,j,l,m,n,o,p=a.$eval(f),q=b,r=new yb;if(w(p))n=p||[];else{n=[];for(l in p)p.hasOwnProperty(l)&&"$"!=l.charAt(0)&&n.push(l);n.sort()}for(i=n.length-1,d=0,e=n.length;e>d;d++)l=p===n?d:n[d],m=p[l],o=k.shift(m),o?(j=o.scope,r.push(m,o),d===o.index?q=o.element:(o.index=d,q.after(o.element),q=o.element)):j=a.$new(),j[g]=m,h&&(j[h]=l),j.$index=d,j.$first=0===d,j.$last=d===i,j.$middle=!(j.$first||j.$last),o||c(j,function(a){q.after(a),o={scope:j,element:q=a,index:d},r.push(m,o)});for(l in k)if(k.hasOwnProperty(l))for(n=k[l];n.length;)m=n.pop(),m.element.remove(),m.scope.$destroy();k=r})}}}),te=Hc(function(a,b,c){a.$watch(c.ngShow,function(a){b.css("display",Q(a)?"":"none")})}),ue=Hc(function(a,b,c){a.$watch(c.ngHide,function(a){b.css("display",Q(a)?"none":"")})}),ve=Hc(function(a,b,c){a.$watch(c.ngStyle,function(a,c){c&&a!==c&&e(c,function(a,c){b.css(c,"")}),a&&b.css(a)},!0)}),we=p({restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(a,b,c,d){var e,f,g,h=c.ngSwitch||c.on;a.$watch(h,function(h){f&&(g.$destroy(),f.remove(),f=g=null),(e=d.cases["!"+h]||d.cases["?"])&&(a.$eval(c.change),g=a.$new(),e(g,function(a){f=a,b.append(a)}))})}}),xe=Hc({transclude:"element",priority:500,require:"^ngSwitch",compile:function(a,b,c){return function(a,d,e,f){f.cases["!"+b.ngSwitchWhen]=c}}}),ye=Hc({transclude:"element",priority:500,require:"^ngSwitch",compile:function(a,b,c){return function(a,b,d,e){e.cases["?"]=c}}}),ze=Hc({controller:["$transclude","$element",function(a,b){a(function(a){b.append(a)})}]}),Ae=["$http","$templateCache","$route","$anchorScroll","$compile","$controller",function(a,b,c,d,e,f){return{restrict:"ECA",terminal:!0,link:function(a,b,g){function h(){k&&(k.$destroy(),k=null)}function i(){b.html(""),h()}function j(){var g=c.current&&c.current.locals,j=g&&g.$template;if(j){b.html(j),h();var m,n=e(b.contents()),o=c.current;k=o.scope=a.$new(),o.controller&&(g.$scope=k,m=f(o.controller,g),b.children().data("$ngControllerController",m)),n(k),k.$emit("$viewContentLoaded"),k.$eval(l),d()}else i()}var k,l=g.onload||"";a.$on("$routeChangeSuccess",j),j()}}}],Be=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,c){if("text/ng-template"==c.type){var d=c.id,e=b[0].text;a.put(d,e)}}}}],Ce=p({terminal:!0}),De=["$compile","$parse",function(a,d){var g=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,h={$setViewValue:n};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,b,c){var d,e,f=this,g={},i=h;f.databound=c.ngModel,f.init=function(a,b,c){i=a,d=b,e=c},f.addOption=function(b){g[b]=!0,i.$viewValue==b&&(a.val(b),e.parent()&&e.remove())},f.removeOption=function(a){this.hasOption(a)&&(delete g[a],i.$viewValue==a&&this.renderUnknownOption(a))},f.renderUnknownOption=function(b){var c="? "+wb(b)+" ?";e.val(c),a.prepend(e),a.val(c),e.prop("selected",!0)},f.hasOption=function(a){return g.hasOwnProperty(a)},b.$on("$destroy",function(){f.renderUnknownOption=n})}],link:function(h,i,j,k){function l(a,b,c,d){c.$render=function(){var a=c.$viewValue;d.hasOption(a)?(y.parent()&&y.remove(),b.val(a),""===a&&o.prop("selected",!0)):q(a)&&o?b.val(""):d.renderUnknownOption(a)},b.bind("change",function(){a.$apply(function(){y.parent()&&y.remove(),c.$setViewValue(b.val())})})}function m(a,b,c){var d;c.$render=function(){var a=new xb(c.$viewValue);e(b.find("option"),function(b){b.selected=r(a.get(b.value))})},a.$watch(function(){J(d,c.$viewValue)||(d=H(c.$viewValue),c.$render())}),b.bind("change",function(){a.$apply(function(){var a=[];e(b.find("option"),function(b){b.selected&&a.push(b.value)}),c.$setViewValue(a)})})}function n(b,e,h){function i(){var a,d,g,i,j,r,s,u,y,z,A,B,C,D,E={"":[]},F=[""],G=h.$modelValue,H=p(b)||[],I=m?f(H):H,J={},K=!1;for(t&&(K=new xb(G)),z=0;u=I.length,u>z;z++)J[l]=H[m?J[m]=I[z]:z],a=n(b,J)||"",(d=E[a])||(d=E[a]=[],F.push(a)),t?A=K.remove(o(b,J))!=c:(A=G===o(b,J),K=K||A),D=k(b,J),D=D===c?"":D,d.push({id:m?I[z]:z,label:D,selected:A});for(t||(v||null===G?E[""].unshift({id:"",label:"",selected:!K}):K||E[""].unshift({id:"?",label:"",selected:!0})),y=0,s=F.length;s>y;y++){for(a=F[y],d=E[a],q.length<=y?(i={element:x.clone().attr("label",a),label:d.label},j=[i],q.push(j),e.append(i.element)):(j=q[y],i=j[0],i.label!=a&&i.element.attr("label",i.label=a)),B=null,z=0,u=d.length;u>z;z++)g=d[z],(r=j[z+1])?(B=r.element,r.label!==g.label&&B.text(r.label=g.label),r.id!==g.id&&B.val(r.id=g.id),B[0].selected!==g.selected&&B.prop("selected",r.selected=g.selected)):(""===g.id&&v?C=v:(C=w.clone()).val(g.id).attr("selected",g.selected).text(g.label),j.push(r={element:C,label:g.label,id:g.id,selected:g.selected}),B?B.after(C):i.element.append(C),B=C);for(z++;j.length>z;)j.pop().element.remove()}for(;q.length>y;)q.pop()[0].element.remove()}var j;if(!(j=u.match(g)))throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+u+"'.");var k=d(j[2]||j[1]),l=j[4]||j[6],m=j[5],n=d(j[3]||""),o=d(j[2]?j[1]:l),p=d(j[7]),q=[[{element:e,label:""}]];v&&(a(v)(b),v.removeClass("ng-scope"),v.remove()),e.html(""),e.bind("change",function(){b.$apply(function(){var a,d,f,g,i,j,k,n,r=p(b)||[],s={};if(t)for(f=[],j=0,n=q.length;n>j;j++)for(a=q[j],i=1,k=a.length;k>i;i++)(g=a[i].element)[0].selected&&(d=g.val(),m&&(s[m]=d),s[l]=r[d],f.push(o(b,s)));else d=e.val(),"?"==d?f=c:""==d?f=null:(s[l]=r[d],m&&(s[m]=d),f=o(b,s));h.$setViewValue(f)})}),h.$render=i,b.$watch(i)}if(k[1]){for(var o,p=k[0],s=k[1],t=j.multiple,u=j.ngOptions,v=!1,w=Vc(b.createElement("option")),x=Vc(b.createElement("optgroup")),y=w.clone(),z=0,A=i.children(),B=A.length;B>z;z++)if(""==A[z].value){o=v=A.eq(z);break}if(p.init(s,v,y),t&&(j.required||j.ngRequired)){var C=function(a){return s.$setValidity("required",!j.required||a&&a.length),a};s.$parsers.push(C),s.$formatters.unshift(C),j.$observe("required",function(){C(s.$viewValue)})}u?n(h,i,s):t?m(h,i,s):l(h,i,s,p)}}}}],Ee=["$interpolate",function(a){var b={addOption:n,removeOption:n};return{restrict:"E",priority:100,compile:function(c,d){if(q(d.value)){var e=a(c.text(),!0);e||d.$set("value",c.text())}return function(a,c,d){var f="$selectController",g=c.parent(),h=g.data(f)||g.parent().data(f);h&&h.databound?c.prop("selected",!1):h=b,e?a.$watch(e,function(a,b){d.$set("value",a),a!==b&&h.removeOption(b),h.addOption(a)}):h.addOption(d.value),c.bind("$destroy",function(){h.removeOption(d.value)})}}}}],Fe=p({restrict:"E",terminal:!0});$(),db(bd),Vc(b).ready(function(){X(b,Y)})}(window,document),angular.element(document).find("head").append(''),define("angular",["jquery"],function(a){return function(){var b;return b||a.angular}}(this)),function(){var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.push,h=d.slice,i=d.concat,j=e.toString,k=e.hasOwnProperty,l=d.forEach,m=d.map,n=d.reduce,o=d.reduceRight,p=d.filter,q=d.every,r=d.some,s=d.indexOf,t=d.lastIndexOf,u=Array.isArray,v=Object.keys,w=f.bind,x=function(a){return a instanceof x?a:this instanceof x?(this._wrapped=a,void 0):new x(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=x),exports._=x):a._=x,x.VERSION="1.5.1";var y=x.each=x.forEach=function(a,b,d){if(null!=a)if(l&&a.forEach===l)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;f>e;e++)if(b.call(d,a[e],e,a)===c)return}else for(var g in a)if(x.has(a,g)&&b.call(d,a[g],g,a)===c)return};x.map=x.collect=function(a,b,c){var d=[];return null==a?d:m&&a.map===m?a.map(b,c):(y(a,function(a,e,f){d.push(b.call(c,a,e,f))}),d)};var z="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),n&&a.reduce===n)return d&&(b=x.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(y(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError(z);return c},x.reduceRight=x.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),o&&a.reduceRight===o)return d&&(b=x.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=a.length;if(f!==+f){var g=x.keys(a);f=g.length}if(y(a,function(h,i,j){i=g?g[--f]:--f,e?c=b.call(d,c,a[i],i,j):(c=a[i],e=!0)}),!e)throw new TypeError(z);return c},x.find=x.detect=function(a,b,c){var d;return A(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},x.filter=x.select=function(a,b,c){var d=[];return null==a?d:p&&a.filter===p?a.filter(b,c):(y(a,function(a,e,f){b.call(c,a,e,f)&&d.push(a)}),d)},x.reject=function(a,b,c){return x.filter(a,function(a,d,e){return!b.call(c,a,d,e)},c)},x.every=x.all=function(a,b,d){b||(b=x.identity);var e=!0;return null==a?e:q&&a.every===q?a.every(b,d):(y(a,function(a,f,g){return(e=e&&b.call(d,a,f,g))?void 0:c}),!!e)};var A=x.some=x.any=function(a,b,d){b||(b=x.identity);var e=!1;return null==a?e:r&&a.some===r?a.some(b,d):(y(a,function(a,f,g){return e||(e=b.call(d,a,f,g))?c:void 0}),!!e)};x.contains=x.include=function(a,b){return null==a?!1:s&&a.indexOf===s?-1!=a.indexOf(b):A(a,function(a){return a===b})},x.invoke=function(a,b){var c=h.call(arguments,2),d=x.isFunction(b);return x.map(a,function(a){return(d?b:a[b]).apply(a,c)})},x.pluck=function(a,b){return x.map(a,function(a){return a[b]})},x.where=function(a,b,c){return x.isEmpty(b)?c?void 0:[]:x[c?"find":"filter"](a,function(a){for(var c in b)if(b[c]!==a[c])return!1;return!0})},x.findWhere=function(a,b){return x.where(a,b,!0)},x.max=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.max.apply(Math,a);if(!b&&x.isEmpty(a))return-1/0;var d={computed:-1/0,value:-1/0};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>d.computed&&(d={value:a,computed:g})}),d.value},x.min=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.min.apply(Math,a);if(!b&&x.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gd||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.indexf;){var h=f+g>>>1;c.call(d,a[h])=0})})},x.difference=function(a){var b=i.apply(d,h.call(arguments,1));return x.filter(a,function(a){return!x.contains(b,a)})},x.zip=function(){for(var a=x.max(x.pluck(arguments,"length").concat(0)),b=new Array(a),c=0;a>c;c++)b[c]=x.pluck(arguments,""+c);return b},x.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},x.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=x.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}if(s&&a.indexOf===s)return a.indexOf(b,c);for(;e>d;d++)if(a[d]===b)return d;return-1},x.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=null!=c;if(t&&a.lastIndexOf===t)return d?a.lastIndexOf(b,c):a.lastIndexOf(b);for(var e=d?c:a.length;e--;)if(a[e]===b)return e;return-1},x.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);d>e;)f[e++]=a,a+=c;return f};var E=function(){};x.bind=function(a,b){var c,d;if(w&&a.bind===w)return w.apply(a,h.call(arguments,1));if(!x.isFunction(a))throw new TypeError;return c=h.call(arguments,2),d=function(){if(!(this instanceof d))return a.apply(b,c.concat(h.call(arguments)));E.prototype=a.prototype;var e=new E;E.prototype=null;var f=a.apply(e,c.concat(h.call(arguments)));return Object(f)===f?f:e}},x.partial=function(a){var b=h.call(arguments,1);return function(){return a.apply(this,b.concat(h.call(arguments)))}},x.bindAll=function(a){var b=h.call(arguments,1);if(0===b.length)throw new Error("bindAll must be passed function names");return y(b,function(b){a[b]=x.bind(a[b],a)}),a},x.memoize=function(a,b){var c={};return b||(b=x.identity),function(){var d=b.apply(this,arguments);return x.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},x.delay=function(a,b){var c=h.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},x.defer=function(a){return x.delay.apply(x,[a,1].concat(h.call(arguments,1)))},x.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:new Date,g=null,f=a.apply(d,e)};return function(){var j=new Date;h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k?(clearTimeout(g),g=null,h=j,f=a.apply(d,e)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},x.debounce=function(a,b,c){var d,e=null;return function(){var f=this,g=arguments,h=function(){e=null,c||(d=a.apply(f,g))},i=c&&!e;return clearTimeout(e),e=setTimeout(h,b),i&&(d=a.apply(f,g)),d}},x.once=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},x.wrap=function(a,b){return function(){var c=[a];return g.apply(c,arguments),b.apply(this,c)}},x.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},x.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},x.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)x.has(a,c)&&b.push(c);return b},x.values=function(a){var b=[];for(var c in a)x.has(a,c)&&b.push(a[c]);return b},x.pairs=function(a){var b=[];for(var c in a)x.has(a,c)&&b.push([c,a[c]]);return b},x.invert=function(a){var b={};for(var c in a)x.has(a,c)&&(b[a[c]]=c);return b},x.functions=x.methods=function(a){var b=[];for(var c in a)x.isFunction(a[c])&&b.push(c);return b.sort()},x.extend=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)a[c]=b[c]}),a},x.pick=function(a){var b={},c=i.apply(d,h.call(arguments,1));return y(c,function(c){c in a&&(b[c]=a[c])}),b},x.omit=function(a){var b={},c=i.apply(d,h.call(arguments,1));for(var e in a)x.contains(c,e)||(b[e]=a[e]);return b},x.defaults=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)void 0===a[c]&&(a[c]=b[c])}),a},x.clone=function(a){return x.isObject(a)?x.isArray(a)?a.slice():x.extend({},a):a},x.tap=function(a,b){return b(a),a};var F=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof x&&(a=a._wrapped),b instanceof x&&(b=b._wrapped);var e=j.call(a);if(e!=j.call(b))return!1;switch(e){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]==a)return d[f]==b;var g=a.constructor,h=b.constructor;if(g!==h&&!(x.isFunction(g)&&g instanceof g&&x.isFunction(h)&&h instanceof h))return!1;c.push(a),d.push(b);var i=0,k=!0;if("[object Array]"==e){if(i=a.length,k=i==b.length)for(;i--&&(k=F(a[i],b[i],c,d)););}else{for(var l in a)if(x.has(a,l)&&(i++,!(k=x.has(b,l)&&F(a[l],b[l],c,d))))break;if(k){for(l in b)if(x.has(b,l)&&!i--)break;k=!i}}return c.pop(),d.pop(),k};x.isEqual=function(a,b){return F(a,b,[],[])},x.isEmpty=function(a){if(null==a)return!0;if(x.isArray(a)||x.isString(a))return 0===a.length;for(var b in a)if(x.has(a,b))return!1;return!0},x.isElement=function(a){return!(!a||1!==a.nodeType)},x.isArray=u||function(a){return"[object Array]"==j.call(a)},x.isObject=function(a){return a===Object(a)},y(["Arguments","Function","String","Number","Date","RegExp"],function(a){x["is"+a]=function(b){return j.call(b)=="[object "+a+"]"}}),x.isArguments(arguments)||(x.isArguments=function(a){return!(!a||!x.has(a,"callee"))}),"function"!=typeof/./&&(x.isFunction=function(a){return"function"==typeof a}),x.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},x.isNaN=function(a){return x.isNumber(a)&&a!=+a},x.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==j.call(a)},x.isNull=function(a){return null===a},x.isUndefined=function(a){return void 0===a},x.has=function(a,b){return k.call(a,b)},x.noConflict=function(){return a._=b,this},x.identity=function(a){return a},x.times=function(a,b,c){for(var d=Array(Math.max(0,a)),e=0;a>e;e++)d[e]=b.call(c,e);return d},x.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))};var G={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};G.unescape=x.invert(G.escape);var H={escape:new RegExp("["+x.keys(G.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(G.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(a){x[a]=function(b){return null==b?"":(""+b).replace(H[a],function(b){return G[a][b]})}}),x.result=function(a,b){if(null==a)return void 0;var c=a[b];return x.isFunction(c)?c.call(a):c},x.mixin=function(a){y(x.functions(a),function(b){var c=x[b]=a[b];x.prototype[b]=function(){var a=[this._wrapped];return g.apply(a,arguments),M.call(this,c.apply(x,a))}})};var I=0;x.uniqueId=function(a){var b=++I+"";return a?a+b:b},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var J=/(.)^/,K={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(a,b,c){var d;c=x.defaults({},c,x.templateSettings);var e=new RegExp([(c.escape||J).source,(c.interpolate||J).source,(c.evaluate||J).source].join("|")+"|$","g"),f=0,g="__p+='";a.replace(e,function(b,c,d,e,h){return g+=a.slice(f,h).replace(L,function(a){return"\\"+K[a]}),c&&(g+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),d&&(g+="'+\n((__t=("+d+"))==null?'':__t)+\n'"),e&&(g+="';\n"+e+"\n__p+='"),f=h+b.length,b}),g+="';\n",c.variable||(g="with(obj||{}){\n"+g+"}\n"),g="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+g+"return __p;\n";try{d=new Function(c.variable||"obj","_",g)}catch(h){throw h.source=g,h}if(b)return d(b,x);var i=function(a){return d.call(this,a,x)};return i.source="function("+(c.variable||"obj")+"){\n"+g+"}",i},x.chain=function(a){return x(a).chain()};var M=function(a){return this._chain?x(a).chain():a};x.mixin(x),y(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];x.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!=a&&"splice"!=a||0!==c.length||delete c[0],M.call(this,c)}}),y(["concat","join","slice"],function(a){var b=d[a];x.prototype[a]=function(){return M.call(this,b.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore-src",function(){}),define("underscore",["underscore-src"],function(){var a=window._;return a.mixin({move:function(a,b,c){return a.splice(c,0,a.splice(b,1)[0]),a},remove:function(a,b){return a.splice(b,1),a},toggleInOut:function(b,c){return a.contains(b,c)?b=a.without(b,c):b.push(c),b}}),a}),function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=this,w=v&&v.ejs,x=Array.prototype,y=Object.prototype,z=x.slice,A=y.toString,B=y.hasOwnProperty,C=x.forEach,D=Array.isArray,E={};u="undefined"!=typeof exports?exports:v.ejs={},a=function(a,b){return B.call(a,b)},b=function(b,c,d){if(null!=b)if(C&&b.forEach===C)b.forEach(c,d);else if(b.length===+b.length){for(var e=0,f=b.length;f>e;e++)if(c.call(d,b[e],e,b)===E)return}else for(var g in b)if(a(b,g)&&c.call(d,b[g],g,b)===E)return},c=function(a){return b(z.call(arguments,1),function(b){for(var c in b)a[c]=b[c]}),a},d=D||function(a){return"[object Array]"===A.call(a)},e=function(a){return a===Object(a)},f=function(a){return"[object String]"===A.call(a)},g=function(a){return"[object Number]"===A.call(a)},h="function"!=typeof/./?function(a){return"function"==typeof a}:function(a){return"[object Function]"===A.call(a)},i=function(b){return e(b)&&a(b,"_type")&&a(b,"_self")&&a(b,"toString")},j=function(a){return i(a)&&"query"===a._type()},k=function(a){return i(a)&&"filter"===a._type()},l=function(a){return i(a)&&"facet"===a._type()},m=function(a){return i(a)&&"script field"===a._type()},n=function(a){return i(a)&&"geo point"===a._type()},o=function(a){return i(a)&&"indexed shape"===a._type()},p=function(a){return i(a)&&"shape"===a._type()},q=function(a){return i(a)&&"sort"===a._type()},r=function(a){return i(a)&&"highlight"===a._type()},s=function(a){return i(a)&&"suggest"===a._type()},t=function(a){return i(a)&&"generator"===a._type()},u.DateHistogramFacet=function(a){var b={};return b[a]={date_histogram:{}},{field:function(c){return null==c?b[a].date_histogram.field:(b[a].date_histogram.field=c,this)},keyField:function(c){return null==c?b[a].date_histogram.key_field:(b[a].date_histogram.key_field=c,this)},valueField:function(c){return null==c?b[a].date_histogram.value_field:(b[a].date_histogram.value_field=c,this)},interval:function(c){return null==c?b[a].date_histogram.interval:(b[a].date_histogram.interval=c,this)},timeZone:function(c){return null==c?b[a].date_histogram.time_zone:(b[a].date_histogram.time_zone=c,this)},preZone:function(c){return null==c?b[a].date_histogram.pre_zone:(b[a].date_histogram.pre_zone=c,this)},preZoneAdjustLargeInterval:function(c){return null==c?b[a].date_histogram.pre_zone_adjust_large_interval:(b[a].date_histogram.pre_zone_adjust_large_interval=c,this)},postZone:function(c){return null==c?b[a].date_histogram.post_zone:(b[a].date_histogram.post_zone=c,this)},preOffset:function(c){return null==c?b[a].date_histogram.pre_offset:(b[a].date_histogram.pre_offset=c,this)},postOffset:function(c){return null==c?b[a].date_histogram.post_offset:(b[a].date_histogram.post_offset=c,this)},factor:function(c){return null==c?b[a].date_histogram.factor:(b[a].date_histogram.factor=c,this)},valueScript:function(c){return null==c?b[a].date_histogram.value_script:(b[a].date_histogram.value_script=c,this)},order:function(c){return null==c?b[a].date_histogram.order:(c=c.toLowerCase(),("time"===c||"count"===c||"total"===c)&&(b[a].date_histogram.order=c),this)},lang:function(c){return null==c?b[a].date_histogram.lang:(b[a].date_histogram.lang=c,this)},params:function(c){return null==c?b[a].date_histogram.params:(b[a].date_histogram.params=c,this)},facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!k(c))throw new TypeError("Argument must be a Filter");return b[a].facet_filter=c._self(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this) +},scope:function(){return this},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"facet"},_self:function(){return b}}},u.FilterFacet=function(a){var b={};return b[a]={},{filter:function(c){if(null==c)return b[a].filter;if(!k(c))throw new TypeError("Argument must be a Filter");return b[a].filter=c._self(),this},facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!k(c))throw new TypeError("Argument must be a Filter");return b[a].facet_filter=c._self(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this)},scope:function(){return this},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"facet"},_self:function(){return b}}},u.GeoDistanceFacet=function(a){var b={},c=u.GeoPoint([0,0]),d="location";return b[a]={geo_distance:{location:c._self(),ranges:[]}},{field:function(c){var e=b[a].geo_distance[d];return null==c?d:(delete b[a].geo_distance[d],d=c,b[a].geo_distance[c]=e,this)},point:function(e){if(null==e)return c;if(!n(e))throw new TypeError("Argument must be a GeoPoint");return c=e,b[a].geo_distance[d]=e._self(),this},addRange:function(c,d){return 0===arguments.length?b[a].geo_distance.ranges:(b[a].geo_distance.ranges.push({from:c,to:d}),this)},addUnboundedFrom:function(c){return null==c?b[a].geo_distance.ranges:(b[a].geo_distance.ranges.push({from:c}),this)},addUnboundedTo:function(c){return null==c?b[a].geo_distance.ranges:(b[a].geo_distance.ranges.push({to:c}),this)},unit:function(c){return null==c?b[a].geo_distance.unit:(c=c.toLowerCase(),("mi"===c||"km"===c)&&(b[a].geo_distance.unit=c),this)},distanceType:function(c){return null==c?b[a].geo_distance.distance_type:(c=c.toLowerCase(),("arc"===c||"plane"===c)&&(b[a].geo_distance.distance_type=c),this)},normalize:function(c){return null==c?b[a].geo_distance.normalize:(b[a].geo_distance.normalize=c,this)},valueField:function(c){return null==c?b[a].geo_distance.value_field:(b[a].geo_distance.value_field=c,this)},valueScript:function(c){return null==c?b[a].geo_distance.value_script:(b[a].geo_distance.value_script=c,this)},lang:function(c){return null==c?b[a].geo_distance.lang:(b[a].geo_distance.lang=c,this)},params:function(c){return null==c?b[a].geo_distance.params:(b[a].geo_distance.params=c,this)},facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!k(c))throw new TypeError("Argument must be a Filter");return b[a].facet_filter=c._self(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this)},scope:function(){return this},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"facet"},_self:function(){return b}}},u.HistogramFacet=function(a){var b={};return b[a]={histogram:{}},{field:function(c){return null==c?b[a].histogram.field:(b[a].histogram.field=c,this)},interval:function(c){return null==c?b[a].histogram.interval:(b[a].histogram.interval=c,this)},timeInterval:function(c){return null==c?b[a].histogram.time_interval:(b[a].histogram.time_interval=c,this)},from:function(c){return null==c?b[a].histogram.from:(b[a].histogram.from=c,this)},to:function(c){return null==c?b[a].histogram.to:(b[a].histogram.to=c,this)},valueField:function(c){return null==c?b[a].histogram.value_field:(b[a].histogram.value_field=c,this)},keyField:function(c){return null==c?b[a].histogram.key_field:(b[a].histogram.key_field=c,this)},valueScript:function(c){return null==c?b[a].histogram.value_script:(b[a].histogram.value_script=c,this)},keyScript:function(c){return null==c?b[a].histogram.key_script:(b[a].histogram.key_script=c,this)},lang:function(c){return null==c?b[a].histogram.lang:(b[a].histogram.lang=c,this)},params:function(c){return null==c?b[a].histogram.params:(b[a].histogram.params=c,this)},order:function(c){return null==c?b[a].histogram.order:(c=c.toLowerCase(),("key"===c||"count"===c||"total"===c)&&(b[a].histogram.order=c),this)},facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!k(c))throw new TypeError("Argument must be a Filter");return b[a].facet_filter=c._self(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this)},scope:function(){return this},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"facet"},_self:function(){return b}}},u.QueryFacet=function(a){var b={};return b[a]={},{query:function(c){if(null==c)return b[a].query;if(!j(c))throw new TypeError("Argument must be a Query");return b[a].query=c._self(),this},facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!k(c))throw new TypeError("Argumnet must be a Filter");return b[a].facet_filter=c._self(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this)},scope:function(){return this},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"facet"},_self:function(){return b}}},u.RangeFacet=function(a){var b={};return b[a]={range:{ranges:[]}},{field:function(c){return null==c?b[a].range.field:(b[a].range.field=c,this)},keyField:function(c){return null==c?b[a].range.key_field:(b[a].range.key_field=c,this)},valueField:function(c){return null==c?b[a].range.value_field:(b[a].range.value_field=c,this)},valueScript:function(c){return null==c?b[a].range.value_script:(b[a].range.value_script=c,this)},keyScript:function(c){return null==c?b[a].range.key_script:(b[a].range.key_script=c,this)},lang:function(c){return null==c?b[a].range.lang:(b[a].range.lang=c,this)},params:function(c){return null==c?b[a].range.params:(b[a].range.params=c,this)},addRange:function(c,d){return 0===arguments.length?b[a].range.ranges:(b[a].range.ranges.push({from:c,to:d}),this)},addUnboundedFrom:function(c){return null==c?b[a].range.ranges:(b[a].range.ranges.push({from:c}),this)},addUnboundedTo:function(c){return null==c?b[a].range.ranges:(b[a].range.ranges.push({to:c}),this)},facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!k(c))throw new TypeError("Argument must be a Filter");return b[a].facet_filter=c._self(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this)},scope:function(){return this},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"facet"},_self:function(){return b}}},u.StatisticalFacet=function(a){var b={};return b[a]={statistical:{}},{field:function(c){return null==c?b[a].statistical.field:(b[a].statistical.field=c,this)},fields:function(c){if(null==c)return b[a].statistical.fields;if(!d(c))throw new TypeError("Argument must be an array");return b[a].statistical.fields=c,this},script:function(c){return null==c?b[a].statistical.script:(b[a].statistical.script=c,this)},lang:function(c){return null==c?b[a].statistical.lang:(b[a].statistical.lang=c,this)},params:function(c){return null==c?b[a].statistical.params:(b[a].statistical.params=c,this)},facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!k(c))throw new TypeError("Argument must be a Filter");return b[a].facet_filter=c._self(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this)},scope:function(){return this},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"facet"},_self:function(){return b}}},u.TermStatsFacet=function(a){var b={};return b[a]={terms_stats:{}},{valueField:function(c){return null==c?b[a].terms_stats.value_field:(b[a].terms_stats.value_field=c,this)},keyField:function(c){return null==c?b[a].terms_stats.key_field:(b[a].terms_stats.key_field=c,this)},scriptField:function(c){return null==c?b[a].terms_stats.script_field:(b[a].terms_stats.script_field=c,this)},valueScript:function(c){return null==c?b[a].terms_stats.value_script:(b[a].terms_stats.value_script=c,this)},allTerms:function(c){return null==c?b[a].terms_stats.all_terms:(b[a].terms_stats.all_terms=c,this)},lang:function(c){return null==c?b[a].terms_stats.lang:(b[a].terms_stats.lang=c,this)},params:function(c){return null==c?b[a].terms_stats.params:(b[a].terms_stats.params=c,this)},size:function(c){return null==c?b[a].terms_stats.size:(b[a].terms_stats.size=c,this)},order:function(c){return null==c?b[a].terms_stats.order:(c=c.toLowerCase(),("count"===c||"term"===c||"reverse_count"===c||"reverse_term"===c||"total"===c||"reverse_total"===c||"min"===c||"reverse_min"===c||"max"===c||"reverse_max"===c||"mean"===c||"reverse_mean"===c)&&(b[a].terms_stats.order=c),this)},facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!k(c))throw new TypeError("Argument must be a Filter");return b[a].facet_filter=c._self(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this)},scope:function(){return this},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"facet"},_self:function(){return b}}},u.TermsFacet=function(a){var b={};return b[a]={terms:{}},{field:function(c){return null==c?b[a].terms.field:(b[a].terms.field=c,this)},fields:function(c){if(null==c)return b[a].terms.fields;if(!d(c))throw new TypeError("Argument must be an array");return b[a].terms.fields=c,this},scriptField:function(c){return null==c?b[a].terms.script_field:(b[a].terms.script_field=c,this)},size:function(c){return null==c?b[a].terms.size:(b[a].terms.size=c,this)},order:function(c){return null==c?b[a].terms.order:(c=c.toLowerCase(),("count"===c||"term"===c||"reverse_count"===c||"reverse_term"===c)&&(b[a].terms.order=c),this)},allTerms:function(c){return null==c?b[a].terms.all_terms:(b[a].terms.all_terms=c,this)},exclude:function(c){if(null==b[a].terms.exclude&&(b[a].terms.exclude=[]),null==c)return b[a].terms.exclude;if(f(c))b[a].terms.exclude.push(c);else{if(!d(c))throw new TypeError("Argument must be string or array");b[a].terms.exclude=c}return this},regex:function(c){return null==c?b[a].terms.regex:(b[a].terms.regex=c,this)},regexFlags:function(c){return null==c?b[a].terms.regex_flags:(b[a].terms.regex_flags=c,this)},script:function(c){return null==c?b[a].terms.script:(b[a].terms.script=c,this)},lang:function(c){return null==c?b[a].terms.lang:(b[a].terms.lang=c,this)},params:function(c){return null==c?b[a].terms.params:(b[a].terms.params=c,this)},executionHint:function(c){return null==c?b[a].terms.execution_hint:(b[a].terms.execution_hint=c,this)},facetFilter:function(c){if(null==c)return b[a].facet_filter;if(!k(c))throw new TypeError("Argument must be a Filter");return b[a].facet_filter=c._self(),this},global:function(c){return null==c?b[a].global:(b[a].global=c,this)},mode:function(c){return null==c?b[a].mode:(c=c.toLowerCase(),("collector"===c||"post"===c)&&(b[a].mode=c),this)},scope:function(){return this},cacheFilter:function(c){return null==c?b[a].cache_filter:(b[a].cache_filter=c,this)},nested:function(c){return null==c?b[a].nested:(b[a].nested=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"facet"},_self:function(){return b}}},u.AndFilter=function(a){var b,c,e={and:{filters:[]}};if(k(a))e.and.filters.push(a._self());else{if(!d(a))throw new TypeError("Argument must be a Filter or Array of Filters");for(b=0,c=a.length;c>b;b++){if(!k(a[b]))throw new TypeError("Array must contain only Filter objects");e.and.filters.push(a[b]._self())}}return{filters:function(a){var b,c;if(null==a)return e.and.filters;if(k(a))e.and.filters.push(a._self());else{if(!d(a))throw new TypeError("Argument must be a Filter or an Array of Filters");for(e.and.filters=[],b=0,c=a.length;c>b;b++){if(!k(a[b]))throw new TypeError("Array must contain only Filter objects");e.and.filters.push(a[b]._self())}}return this},name:function(a){return null==a?e.and._name:(e.and._name=a,this)},cache:function(a){return null==a?e.and._cache:(e.and._cache=a,this)},cacheKey:function(a){return null==a?e.and._cache_key:(e.and._cache_key=a,this)},toString:function(){return JSON.stringify(e)},_type:function(){return"filter"},_self:function(){return e}}},u.BoolFilter=function(){var a={bool:{}};return{must:function(b){var c,e;if(null==a.bool.must&&(a.bool.must=[]),null==b)return a.bool.must;if(k(b))a.bool.must.push(b._self());else{if(!d(b))throw new TypeError("Argument must be a Filter or array of Filters");for(a.bool.must=[],c=0,e=b.length;e>c;c++){if(!k(b[c]))throw new TypeError("Argument must be an array of Filters");a.bool.must.push(b[c]._self())}}return this},mustNot:function(b){var c,e;if(null==a.bool.must_not&&(a.bool.must_not=[]),null==b)return a.bool.must_not;if(k(b))a.bool.must_not.push(b._self());else{if(!d(b))throw new TypeError("Argument must be a Filter or array of Filters");for(a.bool.must_not=[],c=0,e=b.length;e>c;c++){if(!k(b[c]))throw new TypeError("Argument must be an array of Filters");a.bool.must_not.push(b[c]._self())}}return this},should:function(b){var c,e;if(null==a.bool.should&&(a.bool.should=[]),null==b)return a.bool.should;if(k(b))a.bool.should.push(b._self());else{if(!d(b))throw new TypeError("Argument must be a Filter or array of Filters");for(a.bool.should=[],c=0,e=b.length;e>c;c++){if(!k(b[c]))throw new TypeError("Argument must be an array of Filters");a.bool.should.push(b[c]._self())}}return this},name:function(b){return null==b?a.bool._name:(a.bool._name=b,this)},cache:function(b){return null==b?a.bool._cache:(a.bool._cache=b,this)},cacheKey:function(b){return null==b?a.bool._cache_key:(a.bool._cache_key=b,this)},toString:function(){return JSON.stringify(a)},_type:function(){return"filter"},_self:function(){return a}}},u.ExistsFilter=function(a){var b={exists:{field:a}};return{field:function(a){return null==a?b.exists.field:(b.exists.field=a,this)},name:function(a){return null==a?b.exists._name:(b.exists._name=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.GeoBboxFilter=function(a){var b={geo_bounding_box:{}};return b.geo_bounding_box[a]={},{field:function(c){var d=b.geo_bounding_box[a];return null==c?a:(delete b.geo_bounding_box[a],a=c,b.geo_bounding_box[c]=d,this)},topLeft:function(c){if(null==c)return b.geo_bounding_box[a].top_left;if(!n(c))throw new TypeError("Argument must be a GeoPoint");return b.geo_bounding_box[a].top_left=c._self(),this},bottomRight:function(c){if(null==c)return b.geo_bounding_box[a].bottom_right;if(!n(c))throw new TypeError("Argument must be a GeoPoint");return b.geo_bounding_box[a].bottom_right=c._self(),this},type:function(a){return null==a?b.geo_bounding_box.type:(a=a.toLowerCase(),("memory"===a||"indexed"===a)&&(b.geo_bounding_box.type=a),this)},normalize:function(a){return null==a?b.geo_bounding_box.normalize:(b.geo_bounding_box.normalize=a,this)},name:function(a){return null==a?b.geo_bounding_box._name:(b.geo_bounding_box._name=a,this)},cache:function(a){return null==a?b.geo_bounding_box._cache:(b.geo_bounding_box._cache=a,this)},cacheKey:function(a){return null==a?b.geo_bounding_box._cache_key:(b.geo_bounding_box._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.GeoDistanceFilter=function(a){var b={geo_distance:{}};return b.geo_distance[a]=[0,0],{field:function(c){var d=b.geo_distance[a];return null==c?a:(delete b.geo_distance[a],a=c,b.geo_distance[c]=d,this)},distance:function(a){if(null==a)return b.geo_distance.distance;if(!g(a))throw new TypeError("Argument must be a numeric value");return b.geo_distance.distance=a,this},unit:function(a){return null==a?b.geo_distance.unit:(a=a.toLowerCase(),("mi"===a||"km"===a)&&(b.geo_distance.unit=a),this)},point:function(c){if(null==c)return b.geo_distance[a];if(!n(c))throw new TypeError("Argument must be a GeoPoint");return b.geo_distance[a]=c._self(),this},distanceType:function(a){return null==a?b.geo_distance.distance_type:(a=a.toLowerCase(),("arc"===a||"plane"===a)&&(b.geo_distance.distance_type=a),this)},normalize:function(a){return null==a?b.geo_distance.normalize:(b.geo_distance.normalize=a,this)},optimizeBbox:function(a){return null==a?b.geo_distance.optimize_bbox:(a=a.toLowerCase(),("memory"===a||"indexed"===a||"none"===a)&&(b.geo_distance.optimize_bbox=a),this)},name:function(a){return null==a?b.geo_distance._name:(b.geo_distance._name=a,this)},cache:function(a){return null==a?b.geo_distance._cache:(b.geo_distance._cache=a,this)},cacheKey:function(a){return null==a?b.geo_distance._cache_key:(b.geo_distance._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.GeoDistanceRangeFilter=function(a){var b={geo_distance_range:{}};return b.geo_distance_range[a]=[0,0],{field:function(c){var d=b.geo_distance_range[a];return null==c?a:(delete b.geo_distance_range[a],a=c,b.geo_distance_range[c]=d,this)},from:function(a){if(null==a)return b.geo_distance_range.from;if(!g(a))throw new TypeError("Argument must be a numeric value");return b.geo_distance_range.from=a,this},to:function(a){if(null==a)return b.geo_distance_range.to;if(!g(a))throw new TypeError("Argument must be a numeric value");return b.geo_distance_range.to=a,this},includeLower:function(a){return null==a?b.geo_distance_range.include_lower:(b.geo_distance_range.include_lower=a,this)},includeUpper:function(a){return null==a?b.geo_distance_range.include_upper:(b.geo_distance_range.include_upper=a,this)},gt:function(a){if(null==a)return b.geo_distance_range.gt;if(!g(a))throw new TypeError("Argument must be a numeric value");return b.geo_distance_range.gt=a,this},gte:function(a){if(null==a)return b.geo_distance_range.gte;if(!g(a))throw new TypeError("Argument must be a numeric value");return b.geo_distance_range.gte=a,this},lt:function(a){if(null==a)return b.geo_distance_range.lt;if(!g(a))throw new TypeError("Argument must be a numeric value");return b.geo_distance_range.lt=a,this},lte:function(a){if(null==a)return b.geo_distance_range.lte;if(!g(a))throw new TypeError("Argument must be a numeric value");return b.geo_distance_range.lte=a,this},unit:function(a){return null==a?b.geo_distance_range.unit:(a=a.toLowerCase(),("mi"===a||"km"===a)&&(b.geo_distance_range.unit=a),this)},point:function(c){if(null==c)return b.geo_distance_range[a];if(!n(c))throw new TypeError("Argument must be a GeoPoint");return b.geo_distance_range[a]=c._self(),this},distanceType:function(a){return null==a?b.geo_distance_range.distance_type:(a=a.toLowerCase(),("arc"===a||"plane"===a)&&(b.geo_distance_range.distance_type=a),this)},normalize:function(a){return null==a?b.geo_distance_range.normalize:(b.geo_distance_range.normalize=a,this)},optimizeBbox:function(a){return null==a?b.geo_distance_range.optimize_bbox:(a=a.toLowerCase(),("memory"===a||"indexed"===a||"none"===a)&&(b.geo_distance_range.optimize_bbox=a),this)},name:function(a){return null==a?b.geo_distance_range._name:(b.geo_distance_range._name=a,this)},cache:function(a){return null==a?b.geo_distance_range._cache:(b.geo_distance_range._cache=a,this)},cacheKey:function(a){return null==a?b.geo_distance_range._cache_key:(b.geo_distance_range._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.GeoPolygonFilter=function(a){var b={geo_polygon:{}};return b.geo_polygon[a]={points:[]},{field:function(c){var d=b.geo_polygon[a];return null==c?a:(delete b.geo_polygon[a],a=c,b.geo_polygon[c]=d,this)},points:function(c){var e,f;if(null==c)return b.geo_polygon[a].points;if(n(c))b.geo_polygon[a].points.push(c._self());else{if(!d(c))throw new TypeError("Argument must be a GeoPoint or Array of GeoPoints");for(b.geo_polygon[a].points=[],e=0,f=c.length;f>e;e++){if(!n(c[e]))throw new TypeError("Argument must be Array of GeoPoints");b.geo_polygon[a].points.push(c[e]._self())}}return this},normalize:function(a){return null==a?b.geo_polygon.normalize:(b.geo_polygon.normalize=a,this)},name:function(a){return null==a?b.geo_polygon._name:(b.geo_polygon._name=a,this)},cache:function(a){return null==a?b.geo_polygon._cache:(b.geo_polygon._cache=a,this)},cacheKey:function(a){return null==a?b.geo_polygon._cache_key:(b.geo_polygon._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.GeoShapeFilter=function(a){var b={geo_shape:{}};return b.geo_shape[a]={},{field:function(c){var d=b.geo_shape[a];return null==c?a:(delete b.geo_shape[a],a=c,b.geo_shape[c]=d,this)},shape:function(c){return null==c?b.geo_shape[a].shape:(null!=b.geo_shape[a].indexed_shape&&delete b.geo_shape[a].indexed_shape,b.geo_shape[a].shape=c._self(),this)},indexedShape:function(c){return null==c?b.geo_shape[a].indexed_shape:(null!=b.geo_shape[a].shape&&delete b.geo_shape[a].shape,b.geo_shape[a].indexed_shape=c._self(),this)},relation:function(c){return null==c?b.geo_shape[a].relation:(c=c.toLowerCase(),("intersects"===c||"disjoint"===c||"within"===c)&&(b.geo_shape[a].relation=c),this)},strategy:function(c){return null==c?b.geo_shape[a].strategy:(c=c.toLowerCase(),("recursive"===c||"term"===c)&&(b.geo_shape[a].strategy=c),this)},name:function(a){return null==a?b.geo_shape._name:(b.geo_shape._name=a,this)},cache:function(a){return null==a?b.geo_shape._cache:(b.geo_shape._cache=a,this)},cacheKey:function(a){return null==a?b.geo_shape._cache_key:(b.geo_shape._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.HasChildFilter=function(a,b){if(!j(a))throw new TypeError("No Query object found");var c={has_child:{query:a._self(),type:b}};return{query:function(a){if(null==a)return c.has_child.query;if(!j(a))throw new TypeError("Argument must be a Query object");return c.has_child.query=a._self(),this},filter:function(a){if(null==a)return c.has_child.filter;if(!k(a))throw new TypeError("Argument must be a Filter object");return c.has_child.filter=a._self(),this},type:function(a){return null==a?c.has_child.type:(c.has_child.type=a,this)},scope:function(){return this},name:function(a){return null==a?c.has_child._name:(c.has_child._name=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"filter"},_self:function(){return c}}},u.HasParentFilter=function(a,b){if(!j(a))throw new TypeError("No Query object found");var c={has_parent:{query:a._self(),parent_type:b}};return{query:function(a){if(null==a)return c.has_parent.query;if(!j(a))throw new TypeError("Argument must be a Query object");return c.has_parent.query=a._self(),this},filter:function(a){if(null==a)return c.has_parent.filter;if(!k(a))throw new TypeError("Argument must be a Filter object");return c.has_parent.filter=a._self(),this},parentType:function(a){return null==a?c.has_parent.parent_type:(c.has_parent.parent_type=a,this)},scope:function(){return this},name:function(a){return null==a?c.has_parent._name:(c.has_parent._name=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"filter"},_self:function(){return c}}},u.IdsFilter=function(a){var b={ids:{}};if(f(a))b.ids.values=[a];else{if(!d(a))throw new TypeError("Argument must be a string or an array");b.ids.values=a}return{values:function(a){if(null==a)return b.ids.values;if(f(a))b.ids.values.push(a);else{if(!d(a))throw new TypeError("Argument must be a string or an array");b.ids.values=a}return this},type:function(a){if(null==b.ids.type&&(b.ids.type=[]),null==a)return b.ids.type;if(f(a))b.ids.type.push(a);else{if(!d(a))throw new TypeError("Argument must be a string or an array");b.ids.type=a}return this},name:function(a){return null==a?b.ids._name:(b.ids._name=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.IndicesFilter=function(a,b){if(!k(a))throw new TypeError("Argument must be a Filter");var c={indices:{filter:a._self()}};if(f(b))c.indices.indices=[b];else{if(!d(b))throw new TypeError("Argument must be a string or array");c.indices.indices=b}return{indices:function(a){if(null==a)return c.indices.indices;if(f(a))c.indices.indices.push(a);else{if(!d(a))throw new TypeError("Argument must be a string or array");c.indices.indices=a}return this},filter:function(a){if(null==a)return c.indices.filter;if(!k(a))throw new TypeError("Argument must be a Filter");return c.indices.filter=a._self(),this},noMatchFilter:function(a){if(null==a)return c.indices.no_match_filter;if(f(a))a=a.toLowerCase(),("none"===a||"all"===a)&&(c.indices.no_match_filter=a);else{if(!k(a))throw new TypeError("Argument must be string or Filter");c.indices.no_match_filter=a._self()}return this},toString:function(){return JSON.stringify(c)},_type:function(){return"filter"},_self:function(){return c}}},u.LimitFilter=function(a){var b={limit:{value:a}};return{value:function(a){if(null==a)return b.limit.value;if(!g(a))throw new TypeError("Argument must be a numeric value");return b.limit.value=a,this},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.MatchAllFilter=function(){var a={match_all:{}};return{toString:function(){return JSON.stringify(a)},_type:function(){return"filter"},_self:function(){return a}}},u.MissingFilter=function(a){var b={missing:{field:a}};return{field:function(a){return null==a?b.missing.field:(b.missing.field=a,this)},existence:function(a){return null==a?b.missing.existence:(b.missing.existence=a,this)},nullValue:function(a){return null==a?b.missing.null_value:(b.missing.null_value=a,this)},name:function(a){return null==a?b.missing._name:(b.missing._name=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.NestedFilter=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 object");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 object");return b.nested.filter=a._self(),this},boost:function(a){return null==a?b.nested.boost:(b.nested.boost=a,this)},join:function(a){return null==a?b.nested.join:(b.nested.join=a,this)},scope:function(){return this},name:function(a){return null==a?b.nested._name:(b.nested._name=a,this)},cache:function(a){return null==a?b.nested._cache:(b.nested._cache=a,this)},cacheKey:function(a){return null==a?b.nested._cache_key:(b.nested._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.NotFilter=function(a){if(!k(a))throw new TypeError("Argument must be a Filter");var b={not:a._self()};return{filter:function(a){if(null==a)return b.not;if(!k(a))throw new TypeError("Argument must be a Filter");return b.not=a._self(),this},name:function(a){return null==a?b.not._name:(b.not._name=a,this)},cache:function(a){return null==a?b.not._cache:(b.not._cache=a,this)},cacheKey:function(a){return null==a?b.not._cache_key:(b.not._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.NumericRangeFilter=function(a){var b={numeric_range:{}};return b.numeric_range[a]={},{field:function(c){var d=b.numeric_range[a];return null==c?a:(delete b.numeric_range[a],a=c,b.numeric_range[a]=d,this)},from:function(c){if(null==c)return b.numeric_range[a].from;if(!g(c))throw new TypeError("Argument must be a numeric value");return b.numeric_range[a].from=c,this},to:function(c){if(null==c)return b.numeric_range[a].to;if(!g(c))throw new TypeError("Argument must be a numeric value");return b.numeric_range[a].to=c,this},includeLower:function(c){return null==c?b.numeric_range[a].include_lower:(b.numeric_range[a].include_lower=c,this)},includeUpper:function(c){return null==c?b.numeric_range[a].include_upper:(b.numeric_range[a].include_upper=c,this)},gt:function(c){if(null==c)return b.numeric_range[a].gt;if(!g(c))throw new TypeError("Argument must be a numeric value");return b.numeric_range[a].gt=c,this},gte:function(c){if(null==c)return b.numeric_range[a].gte;if(!g(c))throw new TypeError("Argument must be a numeric value");return b.numeric_range[a].gte=c,this},lt:function(c){if(null==c)return b.numeric_range[a].lt;if(!g(c))throw new TypeError("Argument must be a numeric value");return b.numeric_range[a].lt=c,this},lte:function(c){if(null==c)return b.numeric_range[a].lte;if(!g(c))throw new TypeError("Argument must be a numeric value");return b.numeric_range[a].lte=c,this},name:function(a){return null==a?b.numeric_range._name:(b.numeric_range._name=a,this)},cache:function(a){return null==a?b.numeric_range._cache:(b.numeric_range._cache=a,this)},cacheKey:function(a){return null==a?b.numeric_range._cache_key:(b.numeric_range._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.OrFilter=function(a){var b,c,e;if(b={or:{filters:[]}},k(a))b.or.filters.push(a._self());else{if(!d(a))throw new TypeError("Argument must be a Filter or array of Filters");for(c=0,e=a.length;e>c;c++){if(!k(a[c]))throw new TypeError("Argument must be array of Filters");b.or.filters.push(a[c]._self())}}return{filters:function(a){var c,e;if(null==a)return b.or.filters;if(k(a))b.or.filters.push(a._self());else{if(!d(a))throw new TypeError("Argument must be a Filter or array of Filters");for(b.or.filters=[],c=0,e=a.length;e>c;c++){if(!k(a[c]))throw new TypeError("Argument must be an array of Filters");b.or.filters.push(a[c]._self())}}return this},name:function(a){return null==a?b.or._name:(b.or._name=a,this)},cache:function(a){return null==a?b.or._cache:(b.or._cache=a,this)},cacheKey:function(a){return null==a?b.or._cache_key:(b.or._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.PrefixFilter=function(a,b){var c={prefix:{}};return c.prefix[a]=b,{field:function(b){var d=c.prefix[a];return null==b?a:(delete c.prefix[a],a=b,c.prefix[a]=d,this)},prefix:function(b){return null==b?c.prefix[a]:(c.prefix[a]=b,this)},name:function(a){return null==a?c.prefix._name:(c.prefix._name=a,this)},cache:function(a){return null==a?c.prefix._cache:(c.prefix._cache=a,this)},cacheKey:function(a){return null==a?c.prefix._cache_key:(c.prefix._cache_key=a,this) +},toString:function(){return JSON.stringify(c)},_type:function(){return"filter"},_self:function(){return c}}},u.QueryFilter=function(a){if(!j(a))throw new TypeError("Argument must be a Query");var b={fquery:{query:a._self()}};return{query:function(a){if(null==a)return b.fquery.query;if(!j(a))throw new TypeError("Argument must be a Query");return b.fquery.query=a._self(),this},name:function(a){return null==a?b.fquery._name:(b.fquery._name=a,this)},cache:function(a){return null==a?b.fquery._cache:(b.fquery._cache=a,this)},cacheKey:function(a){return null==a?b.fquery._cache_key:(b.fquery._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.RangeFilter=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)},name:function(a){return null==a?b.range._name:(b.range._name=a,this)},cache:function(a){return null==a?b.range._cache:(b.range._cache=a,this)},cacheKey:function(a){return null==a?b.range._cache_key:(b.range._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.RegexpFilter=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)},name:function(a){return null==a?c.regexp._name:(c.regexp._name=a,this)},cache:function(a){return null==a?c.regexp._cache:(c.regexp._cache=a,this)},cacheKey:function(a){return null==a?c.regexp._cache_key:(c.regexp._cache_key=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"filter"},_self:function(){return c}}},u.ScriptFilter=function(a){var b={script:{script:a}};return{script:function(a){return null==a?b.script.script:(b.script.script=a,this)},params:function(a){return null==a?b.script.params:(b.script.params=a,this)},lang:function(a){return null==a?b.script.lang:(b.script.lang=a,this)},name:function(a){return null==a?b.script._name:(b.script._name=a,this)},cache:function(a){return null==a?b.script._cache:(b.script._cache=a,this)},cacheKey:function(a){return null==a?b.script._cache_key:(b.script._cache_key=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.TermFilter=function(a,b){var c={term:{}};return c.term[a]=b,{field:function(b){var d=c.term[a];return null==b?a:(delete c.term[a],a=b,c.term[a]=d,this)},term:function(b){return null==b?c.term[a]:(c.term[a]=b,this)},name:function(a){return null==a?c.term._name:(c.term._name=a,this)},cache:function(a){return null==a?c.term._cache:(c.term._cache=a,this)},cacheKey:function(a){return null==a?c.term._cache_key:(c.term._cache_key=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"filter"},_self:function(){return c}}},u.TermsFilter=function(a,b){var c={terms:{}},e=function(){d(c.terms[a])||(c.terms[a]=[])},f=function(){d(c.terms[a])&&(c.terms[a]={})};return c.terms[a]=d(b)?b:[b],{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){return e(),null==b?c.terms[a]:(d(b)?c.terms[a]=b:c.terms[a].push(b),this)},index:function(b){return f(),null==b?c.terms[a].index:(c.terms[a].index=b,this)},type:function(b){return f(),null==b?c.terms[a].type:(c.terms[a].type=b,this)},id:function(b){return f(),null==b?c.terms[a].id:(c.terms[a].id=b,this)},path:function(b){return f(),null==b?c.terms[a].path:(c.terms[a].path=b,this)},execution:function(a){return null==a?c.terms.execution:(a=a.toLowerCase(),("plain"===a||"bool"===a||"bool_nocache"===a||"and"===a||"and_nocache"===a||"or"===a||"or_nocache"===a)&&(c.terms.execution=a),this)},name:function(a){return null==a?c.terms._name:(c.terms._name=a,this)},cache:function(a){return null==a?c.terms._cache:(c.terms._cache=a,this)},cacheKey:function(a){return null==a?c.terms._cache_key:(c.terms._cache_key=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"filter"},_self:function(){return c}}},u.TypeFilter=function(a){var b={type:{value:a}};return{type:function(a){return null==a?b.type.value:(b.type.value=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"filter"},_self:function(){return b}}},u.Document=function(b,c,g){var h={},i=function(){var b=j(),c=[];for(var d in b)a(b,d)&&c.push(d+"="+encodeURIComponent(b[d]));return c.join("&")},j=function(){var b={};for(var c in h)if(a(h,c)&&"upsert"!==c&&"source"!==c&&"script"!==c&&"lang"!==c&&"params"!==c){var e=h[c];d(e)&&(e=e.join()),b[c]=e}return b};return{index:function(a){return null==a?b:(b=a,this)},type:function(a){return null==a?c:(c=a,this)},id:function(a){return null==a?g:(g=a,this)},routing:function(a){return null==a?h.routing:(h.routing=a,this)},parent:function(a){return null==a?h.parent:(h.parent=a,this)},timestamp:function(a){return null==a?h.timestamp:(h.timestamp=a,this)},ttl:function(a){return null==a?h.ttl:(h.ttl=a,this)},timeout:function(a){return null==a?h.timeout:(h.timeout=a,this)},refresh:function(a){return null==a?h.refresh:(h.refresh=a,this)},version:function(a){return null==a?h.version:(h.version=a,this)},versionType:function(a){return null==a?h.version_type:(a=a.toLowerCase(),("internal"===a||"external"===a)&&(h.version_type=a),this)},percolate:function(a){return null==a?h.percolate:(h.percolate=a,this)},opType:function(a){return null==a?h.op_type:(a=a.toLowerCase(),("index"===a||"create"===a)&&(h.op_type=a),this)},replication:function(a){return null==a?h.replication:(a=a.toLowerCase(),("async"===a||"sync"===a||"default"===a)&&(h.replication=a),this)},consistency:function(a){return null==a?h.consistency:(a=a.toLowerCase(),("default"===a||"one"===a||"quorum"===a||"all"===a)&&(h.consistency=a),this)},preference:function(a){return null==a?h.preference:(h.preference=a,this)},realtime:function(a){return null==a?h.realtime:(h.realtime=a,this)},fields:function(a){if(null==h.fields&&(h.fields=[]),null==a)return h.fields;if(f(a))h.fields.push(a);else{if(!d(a))throw new TypeError("Argument must be string or array");h.fields=a}return this},script:function(a){return null==a?h.script:(h.script=a,this)},lang:function(a){return null==a?h.lang:(h.lang=a,this)},params:function(a){if(null==a)return h.params;if(!e(a))throw new TypeError("Argument must be an object");return h.params=a,this},retryOnConflict:function(a){return null==a?h.retry_on_conflict:(h.retry_on_conflict=a,this)},upsert:function(a){if(null==a)return h.upsert;if(!e(a))throw new TypeError("Argument must be an object");return h.upsert=a,this},source:function(a){if(null==a)return h.source;if(!e(a))throw new TypeError("Argument must be an object");return h.source=a,this},toString:function(){return JSON.stringify(h)},_type:function(){return"document"},_self:function(){return h},doGet:function(a,d){if(null==u.client)throw new Error("No Client Set");if(null==b||null==c||null==g)throw new Error("Index, Type, and ID must be set");var e="/"+b+"/"+c+"/"+g;return u.client.get(e,j(),a,d)},doIndex:function(a,d){if(null==u.client)throw new Error("No Client Set");if(null==b||null==c)throw new Error("Index and Type must be set");if(null==h.source)throw new Error("No source document found");var e,f="/"+b+"/"+c,j=JSON.stringify(h.source),k=i();return null!=g&&(f=f+"/"+g),""!==k&&(f=f+"?"+k),e=null==g?u.client.post(f,j,a,d):u.client.put(f,j,a,d)},doUpdate:function(a,d){if(null==u.client)throw new Error("No Client Set");if(null==b||null==c||null==g)throw new Error("Index, Type, and ID must be set");if(null==h.script&&null==h.source)throw new Error("Update script or document required");var e="/"+b+"/"+c+"/"+g+"/_update",f={},j=i();return""!==j&&(e=e+"?"+j),null!=h.script&&(f.script=h.script),null!=h.lang&&(f.lang=h.lang),null!=h.params&&(f.params=h.params),null!=h.upsert&&(f.upsert=h.upsert),null!=h.source&&(f.doc=h.source),u.client.post(e,JSON.stringify(f),a,d)},doDelete:function(a,d){if(null==u.client)throw new Error("No Client Set");if(null==b||null==c||null==g)throw new Error("Index, Type, and ID must be set");var e="/"+b+"/"+c+"/"+g,f="",h=i();return""!==h&&(e=e+"?"+h),u.client.del(e,f,a,d)}}},u.BoolQuery=function(){var a={bool:{}};return{must:function(b){var c,e;if(null==a.bool.must&&(a.bool.must=[]),null==b)return a.bool.must;if(j(b))a.bool.must.push(b._self());else{if(!d(b))throw new TypeError("Argument must be a Query or array of Queries");for(a.bool.must=[],c=0,e=b.length;e>c;c++){if(!j(b[c]))throw new TypeError("Argument must be an array of Queries");a.bool.must.push(b[c]._self())}}return this},mustNot:function(b){var c,e;if(null==a.bool.must_not&&(a.bool.must_not=[]),null==b)return a.bool.must_not;if(j(b))a.bool.must_not.push(b._self());else{if(!d(b))throw new TypeError("Argument must be a Query or array of Queries");for(a.bool.must_not=[],c=0,e=b.length;e>c;c++){if(!j(b[c]))throw new TypeError("Argument must be an array of Queries");a.bool.must_not.push(b[c]._self())}}return this},should:function(b){var c,e;if(null==a.bool.should&&(a.bool.should=[]),null==b)return a.bool.should;if(j(b))a.bool.should.push(b._self());else{if(!d(b))throw new TypeError("Argument must be a Query or array of Queries");for(a.bool.should=[],c=0,e=b.length;e>c;c++){if(!j(b[c]))throw new TypeError("Argument must be an array of Queries");a.bool.should.push(b[c]._self())}}return this},boost:function(b){return null==b?a.bool.boost:(a.bool.boost=b,this)},disableCoord:function(b){return null==b?a.bool.disable_coord:(a.bool.disable_coord=b,this)},minimumNumberShouldMatch:function(b){return null==b?a.bool.minimum_number_should_match:(a.bool.minimum_number_should_match=b,this)},toString:function(){return JSON.stringify(a)},_type:function(){return"query"},_self:function(){return a}}},u.BoostingQuery=function(a,b,c){if(!j(a)||!j(b))throw new TypeError("Arguments must be Queries");var d={boosting:{positive:a._self(),negative:b._self(),negative_boost:c}};return{positive:function(a){if(null==a)return d.boosting.positive;if(!j(a))throw new TypeError("Argument must be a Query");return d.boosting.positive=a._self(),this},negative:function(a){if(null==a)return d.boosting.negative;if(!j(a))throw new TypeError("Argument must be a Query");return d.boosting.negative=a._self(),this},negativeBoost:function(a){return null==a?d.boosting.negative_boost:(d.boosting.negative_boost=a,this)},boost:function(a){return null==a?d.boosting.boost:(d.boosting.boost=a,this)},toString:function(){return JSON.stringify(d)},_type:function(){return"query"},_self:function(){return d}}},u.CommonTermsQuery=function(a,b){var c={common:{}};return null==a&&(a="no_field_set"),c.common[a]={},null!=b&&(c.common[a].query=b),{field:function(b){var d=c.common[a];return null==b?a:(delete c.common[a],a=b,c.common[b]=d,this)},query:function(b){return null==b?c.common[a].query:(c.common[a].query=b,this)},analyzer:function(b){return null==b?c.common[a].analyzer:(c.common[a].analyzer=b,this)},disableCoords:function(b){return null==b?c.common[a].disable_coords:(c.common[a].disable_coords=b,this)},cutoffFrequency:function(b){return null==b?c.common[a].cutoff_frequency:(c.common[a].cutoff_frequency=b,this)},highFreqOperator:function(b){return null==b?c.common[a].high_freq_operator:(b=b.toLowerCase(),("and"===b||"or"===b)&&(c.common[a].high_freq_operator=b),this)},lowFreqOperator:function(b){return null==b?c.common[a].low_freq_operator:(b=b.toLowerCase(),("and"===b||"or"===b)&&(c.common[a].low_freq_operator=b),this)},minimumShouldMatch:function(b){return null==b?c.common[a].minimum_should_match:(c.common[a].minimum_should_match=b,this)},boost:function(b){return null==b?c.common[a].boost:(c.common[a].boost=b,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.ConstantScoreQuery=function(){var a={constant_score:{}};return{query:function(b){if(null==b)return a.constant_score.query;if(!j(b))throw new TypeError("Argument must be a Query");return a.constant_score.query=b._self(),this},filter:function(b){if(null==b)return a.constant_score.filter;if(!k(b))throw new TypeError("Argument must be a Filter");return a.constant_score.filter=b._self(),this},cache:function(b){return null==b?a.constant_score._cache:(a.constant_score._cache=b,this)},cacheKey:function(b){return null==b?a.constant_score._cache_key:(a.constant_score._cache_key=b,this)},boost:function(b){return null==b?a.constant_score.boost:(a.constant_score.boost=b,this)},toString:function(){return JSON.stringify(a)},_type:function(){return"query"},_self:function(){return a}}},u.CustomBoostFactorQuery=function(a){if(!j(a))throw new TypeError("Argument must be a Query");var b={custom_boost_factor:{query:a._self()}};return{query:function(a){if(null==a)return b.custom_boost_factor.query;if(!j(a))throw new TypeError("Argument must be a Query");return b.custom_boost_factor.query=a._self(),this},boostFactor:function(a){return null==a?b.custom_boost_factor.boost_factor:(b.custom_boost_factor.boost_factor=a,this)},boost:function(a){return null==a?b.custom_boost_factor.boost:(b.custom_boost_factor.boost=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"query"},_self:function(){return b}}},u.CustomFiltersScoreQuery=function(a,c){if(!j(a))throw new TypeError("Argument must be a Query");var e={custom_filters_score:{query:a._self(),filters:[]}},f=function(a){var b=null;return a.filter&&k(a.filter)&&(b={filter:a.filter._self()},a.boost?b.boost=a.boost:a.script?b.script=a.script:b=null),b};return b(d(c)?c:[c],function(a){var b=f(a);null!==b&&e.custom_filters_score.filters.push(b)}),{query:function(a){if(null==a)return e.custom_filters_score.query;if(!j(a))throw new TypeError("Argument must be a Query");return e.custom_filters_score.query=a._self(),this},filters:function(a){return null==a?e.custom_filters_score.filters:(d(a)&&(e.custom_filters_score.filters=[]),b(d(a)?a:[a],function(a){var b=f(a);null!==b&&e.custom_filters_score.filters.push(b)}),this)},scoreMode:function(a){return null==a?e.custom_filters_score.score_mode:(a=a.toLowerCase(),("first"===a||"min"===a||"max"===a||"total"===a||"avg"===a||"multiply"===a)&&(e.custom_filters_score.score_mode=a),this)},params:function(a){return null==a?e.custom_filters_score.params:(e.custom_filters_score.params=a,this)},lang:function(a){return null==a?e.custom_filters_score.lang:(e.custom_filters_score.lang=a,this)},maxBoost:function(a){return null==a?e.custom_filters_score.max_boost:(e.custom_filters_score.max_boost=a,this)},boost:function(a){return null==a?e.custom_filters_score.boost:(e.custom_filters_score.boost=a,this)},toString:function(){return JSON.stringify(e)},_type:function(){return"query"},_self:function(){return e}}},u.CustomScoreQuery=function(a,b){if(!j(a))throw new TypeError("Argument must be a Query");var c={custom_score:{query:a._self(),script:b}};return{query:function(a){if(null==a)return c.custom_score.query;if(!j(a))throw new TypeError("Argument must be a Query");return c.custom_score.query=a._self(),this},script:function(a){return null==a?c.custom_score.script:(c.custom_score.script=a,this)},params:function(a){return null==a?c.custom_score.params:(c.custom_score.params=a,this)},lang:function(a){return null==a?c.custom_score.lang:(c.custom_score.lang=a,this)},boost:function(a){return null==a?c.custom_score.boost:(c.custom_score.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.DisMaxQuery=function(){var a={dis_max:{}};return{queries:function(b){var c,e;if(null==b)return a.dis_max.queries;if(null==a.dis_max.queries&&(a.dis_max.queries=[]),j(b))a.dis_max.queries.push(b._self());else{if(!d(b))throw new TypeError("Argument must be a Query or array of Queries");for(a.dis_max.queries=[],c=0,e=b.length;e>c;c++){if(!j(b[c]))throw new TypeError("Argument must be array of Queries");a.dis_max.queries.push(b[c]._self())}}return this},boost:function(b){return null==b?a.dis_max.boost:(a.dis_max.boost=b,this)},tieBreaker:function(b){return null==b?a.dis_max.tie_breaker:(a.dis_max.tie_breaker=b,this)},toString:function(){return JSON.stringify(a)},_type:function(){return"query"},_self:function(){return a}}},u.FieldMaskingSpanQuery=function(a,b){if(!j(a))throw new TypeError("Argument must be a SpanQuery");var c={field_masking_span:{query:a._self(),field:b}};return{query:function(a){if(null==a)return c.field_masking_span.query;if(!j(a))throw new TypeError("Argument must be a SpanQuery");return c.field_masking_span.query=a._self(),this},field:function(a){return null==a?c.field_masking_span.field:(c.field_masking_span.field=a,this)},boost:function(a){return null==a?c.field_masking_span.boost:(c.field_masking_span.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.FieldQuery=function(a,b){var c={field:{}};return c.field[a]={query:b},{field:function(b){var d=c.field[a];return null==b?a:(delete c.field[a],a=b,c.field[b]=d,this)},query:function(b){return null==b?c.field[a].query:(c.field[a].query=b,this)},defaultOperator:function(b){return null==b?c.field[a].default_operator:(b=b.toUpperCase(),("AND"===b||"OR"===b)&&(c.field[a].default_operator=b),this)},analyzer:function(b){return null==b?c.field[a].analyzer:(c.field[a].analyzer=b,this)},quoteAnalyzer:function(b){return null==b?c.field[a].quote_analyzer:(c.field[a].quote_analyzer=b,this)},autoGeneratePhraseQueries:function(b){return null==b?c.field[a].auto_generate_phrase_queries:(c.field[a].auto_generate_phrase_queries=b,this)},allowLeadingWildcard:function(b){return null==b?c.field[a].allow_leading_wildcard:(c.field[a].allow_leading_wildcard=b,this)},lowercaseExpandedTerms:function(b){return null==b?c.field[a].lowercase_expanded_terms:(c.field[a].lowercase_expanded_terms=b,this)},enablePositionIncrements:function(b){return null==b?c.field[a].enable_position_increments:(c.field[a].enable_position_increments=b,this)},fuzzyMinSim:function(b){return null==b?c.field[a].fuzzy_min_sim:(c.field[a].fuzzy_min_sim=b,this)},boost:function(b){return null==b?c.field[a].boost:(c.field[a].boost=b,this)},fuzzyPrefixLength:function(b){return null==b?c.field[a].fuzzy_prefix_length:(c.field[a].fuzzy_prefix_length=b,this)},fuzzyMaxExpansions:function(b){return null==b?c.field[a].fuzzy_max_expansions:(c.field[a].fuzzy_max_expansions=b,this)},fuzzyRewrite:function(b){return null==b?c.field[a].fuzzy_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.field[a].fuzzy_rewrite=b),this)},rewrite:function(b){return null==b?c.field[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.field[a].rewrite=b),this)},quoteFieldSuffix:function(b){return null==b?c.field[a].quote_field_suffix:(c.field[a].quote_field_suffix=b,this)},phraseSlop:function(b){return null==b?c.field[a].phrase_slop:(c.field[a].phrase_slop=b,this)},analyzeWildcard:function(b){return null==b?c.field[a].analyze_wildcard:(c.field[a].analyze_wildcard=b,this)},escape:function(b){return null==b?c.field[a].escape:(c.field[a].escape=b,this)},minimumShouldMatch:function(b){return null==b?c.field[a].minimum_should_match:(c.field[a].minimum_should_match=b,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.FilteredQuery=function(a,b){if(!j(a))throw new TypeError("Argument must be a Query");if(null!=b&&!k(b))throw new TypeError("Argument must be a Filter");var c={filtered:{query:a._self()}};return null!=b&&(c.filtered.filter=b._self()),{query:function(a){if(null==a)return c.filtered.query;if(!j(a))throw new TypeError("Argument must be a Query");return c.filtered.query=a._self(),this},filter:function(a){if(null==a)return c.filtered.filter;if(!k(a))throw new TypeError("Argument must be a Filter");return c.filtered.filter=a._self(),this},strategy:function(a){return null==a?c.filtered.strategy:(a=a.toLowerCase(),("query_first"===a||"random_access_always"===a||"leap_frog"===a||"leap_frog_filter_first"===a||0===a.indexOf("random_access_"))&&(c.filtered.strategy=a),this)},cache:function(a){return null==a?c.filtered._cache:(c.filtered._cache=a,this)},cacheKey:function(a){return null==a?c.filtered._cache_key:(c.filtered._cache_key=a,this)},boost:function(a){return null==a?c.filtered.boost:(c.filtered.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.FuzzyLikeThisFieldQuery=function(a,b){var c={flt_field:{}};return c.flt_field[a]={like_text:b},{field:function(b){var d=c.flt_field[a];return null==b?a:(delete c.flt_field[a],a=b,c.flt_field[b]=d,this)},likeText:function(b){return null==b?c.flt_field[a].like_text:(c.flt_field[a].like_text=b,this)},ignoreTf:function(b){return null==b?c.flt_field[a].ignore_tf:(c.flt_field[a].ignore_tf=b,this)},maxQueryTerms:function(b){return null==b?c.flt_field[a].max_query_terms:(c.flt_field[a].max_query_terms=b,this)},minSimilarity:function(b){return null==b?c.flt_field[a].min_similarity:(c.flt_field[a].min_similarity=b,this)},prefixLength:function(b){return null==b?c.flt_field[a].prefix_length:(c.flt_field[a].prefix_length=b,this)},analyzer:function(b){return null==b?c.flt_field[a].analyzer:(c.flt_field[a].analyzer=b,this)},boost:function(b){return null==b?c.flt_field[a].boost:(c.flt_field[a].boost=b,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.FuzzyLikeThisQuery=function(a){var b={flt:{like_text:a}};return{fields:function(a){if(null==b.flt.fields&&(b.flt.fields=[]),null==a)return b.flt.fields;if(f(a))b.flt.fields.push(a);else{if(!d(a))throw new TypeError("Argument must be a string or array");b.flt.fields=a}return this},likeText:function(a){return null==a?b.flt.like_text:(b.flt.like_text=a,this)},ignoreTf:function(a){return null==a?b.flt.ignore_tf:(b.flt.ignore_tf=a,this)},maxQueryTerms:function(a){return null==a?b.flt.max_query_terms:(b.flt.max_query_terms=a,this)},minSimilarity:function(a){return null==a?b.flt.min_similarity:(b.flt.min_similarity=a,this)},prefixLength:function(a){return null==a?b.flt.prefix_length:(b.flt.prefix_length=a,this)},analyzer:function(a){return null==a?b.flt.analyzer:(b.flt.analyzer=a,this)},boost:function(a){return null==a?b.flt.boost:(b.flt.boost=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"query"},_self:function(){return b}}},u.FuzzyQuery=function(a,b){var c={fuzzy:{}};return c.fuzzy[a]={value:b},{field:function(b){var d=c.fuzzy[a];return null==b?a:(delete c.fuzzy[a],a=b,c.fuzzy[b]=d,this)},value:function(b){return null==b?c.fuzzy[a].value:(c.fuzzy[a].value=b,this)},transpositions:function(b){return null==b?c.fuzzy[a].transpositions:(c.fuzzy[a].transpositions=b,this)},maxExpansions:function(b){return null==b?c.fuzzy[a].max_expansions:(c.fuzzy[a].max_expansions=b,this)},minSimilarity:function(b){return null==b?c.fuzzy[a].min_similarity:(c.fuzzy[a].min_similarity=b,this)},prefixLength:function(b){return null==b?c.fuzzy[a].prefix_length:(c.fuzzy[a].prefix_length=b,this)},rewrite:function(b){return null==b?c.fuzzy[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.fuzzy[a].rewrite=b),this)},boost:function(b){return null==b?c.fuzzy[a].boost:(c.fuzzy[a].boost=b,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.GeoShapeQuery=function(a){var b={geo_shape:{}};return b.geo_shape[a]={},{field:function(c){var d=b.geo_shape[a];return null==c?a:(delete b.geo_shape[a],a=c,b.geo_shape[c]=d,this)},shape:function(c){return null==c?b.geo_shape[a].shape:(null!=b.geo_shape[a].indexed_shape&&delete b.geo_shape[a].indexed_shape,b.geo_shape[a].shape=c._self(),this)},indexedShape:function(c){return null==c?b.geo_shape[a].indexed_shape:(null!=b.geo_shape[a].shape&&delete b.geo_shape[a].shape,b.geo_shape[a].indexed_shape=c._self(),this)},relation:function(c){return null==c?b.geo_shape[a].relation:(c=c.toLowerCase(),("intersects"===c||"disjoint"===c||"within"===c)&&(b.geo_shape[a].relation=c),this)},strategy:function(c){return null==c?b.geo_shape[a].strategy:(c=c.toLowerCase(),("recursive"===c||"term"===c)&&(b.geo_shape[a].strategy=c),this)},boost:function(c){return null==c?b.geo_shape[a].boost:(b.geo_shape[a].boost=c,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"query"},_self:function(){return b}}},u.HasChildQuery=function(a,b){if(!j(a))throw new TypeError("Argument must be a valid Query");var c={has_child:{query:a._self(),type:b}};return{query:function(a){if(null==a)return c.has_child.query;if(!j(a))throw new TypeError("Argument must be a valid Query");return c.has_child.query=a._self(),this},type:function(a){return null==a?c.has_child.type:(c.has_child.type=a,this)},scope:function(){return this},scoreType:function(a){return null==a?c.has_child.score_type:(a=a.toLowerCase(),("none"===a||"max"===a||"sum"===a||"avg"===a)&&(c.has_child.score_type=a),this)},boost:function(a){return null==a?c.has_child.boost:(c.has_child.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.HasParentQuery=function(a,b){if(!j(a))throw new TypeError("Argument must be a Query");var c={has_parent:{query:a._self(),parent_type:b}};return{query:function(a){if(null==a)return c.has_parent.query;if(!j(a))throw new TypeError("Argument must be a Query");return c.has_parent.query=a._self(),this},parentType:function(a){return null==a?c.has_parent.parent_type:(c.has_parent.parent_type=a,this)},scope:function(){return this},scoreType:function(a){return null==a?c.has_parent.score_type:(a=a.toLowerCase(),("none"===a||"score"===a)&&(c.has_parent.score_type=a),this)},boost:function(a){return null==a?c.has_parent.boost:(c.has_parent.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.IdsQuery=function(a){var b={ids:{}};if(f(a))b.ids.values=[a];else{if(!d(a))throw new TypeError("Argument must be string or array");b.ids.values=a}return{values:function(a){if(null==a)return b.ids.values;if(f(a))b.ids.values.push(a);else{if(!d(a))throw new TypeError("Argument must be string or array");b.ids.values=a}return this},type:function(a){if(null==b.ids.type&&(b.ids.type=[]),null==a)return b.ids.type;if(f(a))b.ids.type.push(a);else{if(!d(a))throw new TypeError("Argument must be string or array");b.ids.type=a}return this},boost:function(a){return null==a?b.ids.boost:(b.ids.boost=a,this)},toString:function(){return JSON.stringify(b)},_type:function(){return"query"},_self:function(){return b}}},u.IndicesQuery=function(a,b){if(!j(a))throw new TypeError("Argument must be a Query");var c={indices:{query:a._self()}};if(f(b))c.indices.indices=[b];else{if(!d(b))throw new TypeError("Argument must be a string or array");c.indices.indices=b}return{indices:function(a){if(null==a)return c.indices.indices;if(f(a))c.indices.indices.push(a);else{if(!d(a))throw new TypeError("Argument must be a string or array");c.indices.indices=a}return this},query:function(a){if(null==a)return c.indices.query;if(!j(a))throw new TypeError("Argument must be a Query");return c.indices.query=a._self(),this},noMatchQuery:function(a){if(null==a)return c.indices.no_match_query;if(f(a))a=a.toLowerCase(),("none"===a||"all"===a)&&(c.indices.no_match_query=a);else{if(!j(a))throw new TypeError("Argument must be string or Query");c.indices.no_match_query=a._self()}return this},boost:function(a){return null==a?c.indices.boost:(c.indices.boost=a,this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.MatchAllQuery=function(){var a={match_all:{}};return{boost:function(b){return null==b?a.match_all.boost:(a.match_all.boost=b,this)},toString:function(){return JSON.stringify(a)},_type:function(){return"query"},_self:function(){return a}}},u.MatchQuery=function(a,b){var c={match:{}};return c.match[a]={query:b},{boost:function(b){return null==b?c.match[a].boost:(c.match[a].boost=b,this)},query:function(b){return null==b?c.match[a].query:(c.match[a].query=b,this)},type:function(b){return null==b?c.match[a].type:(b=b.toLowerCase(),("boolean"===b||"phrase"===b||"phrase_prefix"===b)&&(c.match[a].type=b),this)},fuzziness:function(b){return null==b?c.match[a].fuzziness:(c.match[a].fuzziness=b,this)},cutoffFrequency:function(b){return null==b?c.match[a].cutoff_frequency:(c.match[a].cutoff_frequency=b,this)},prefixLength:function(b){return null==b?c.match[a].prefix_length:(c.match[a].prefix_length=b,this)},maxExpansions:function(b){return null==b?c.match[a].max_expansions:(c.match[a].max_expansions=b,this)},operator:function(b){return null==b?c.match[a].operator:(b=b.toLowerCase(),("and"===b||"or"===b)&&(c.match[a].operator=b),this)},slop:function(b){return null==b?c.match[a].slop:(c.match[a].slop=b,this)},analyzer:function(b){return null==b?c.match[a].analyzer:(c.match[a].analyzer=b,this)},minimumShouldMatch:function(b){return null==b?c.match[a].minimum_should_match:(c.match[a].minimum_should_match=b,this)},rewrite:function(b){return null==b?c.match[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.match[a].rewrite=b),this)},fuzzyRewrite:function(b){return null==b?c.match[a].fuzzy_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.match[a].fuzzy_rewrite=b),this)},fuzzyTranspositions:function(b){return null==b?c.match[a].fuzzy_transpositions:(c.match[a].fuzzy_transpositions=b,this)},lenient:function(b){return null==b?c.match[a].lenient:(c.match[a].lenient=b,this)},zeroTermsQuery:function(b){return null==b?c.match[a].zero_terms_query:(b=b.toLowerCase(),("all"===b||"none"===b)&&(c.match[a].zero_terms_query=b),this)},toString:function(){return JSON.stringify(c)},_type:function(){return"query"},_self:function(){return c}}},u.MoreLikeThisFieldQuery=function(a,b){var c={mlt_field:{}};return c.mlt_field[a]={like_text:b},{field:function(b){var d=c.mlt_field[a];return null==b?a:(delete c.mlt_field[a],a=b,c.mlt_field[b]=d,this)},likeText:function(b){return null==b?c.mlt_field[a].like_text:(c.mlt_field[a].like_text=b,this)},percentTermsToMatch:function(b){return null==b?c.mlt_field[a].percent_terms_to_match:(c.mlt_field[a].percent_terms_to_match=b,this)},minTermFreq:function(b){return null==b?c.mlt_field[a].min_term_freq:(c.mlt_field[a].min_term_freq=b,this)},maxQueryTerms:function(b){return null==b?c.mlt_field[a].max_query_terms:(c.mlt_field[a].max_query_terms=b,this) +},stopWords:function(b){return null==b?c.mlt_field[a].stop_words:(c.mlt_field[a].stop_words=b,this)},minDocFreq:function(b){return null==b?c.mlt_field[a].min_doc_freq:(c.mlt_field[a].min_doc_freq=b,this)},maxDocFreq:function(b){return null==b?c.mlt_field[a].max_doc_freq:(c.mlt_field[a].max_doc_freq=b,this)},minWordLen:function(b){return null==b?c.mlt_field[a].min_word_len:(c.mlt_field[a].min_word_len=b,this)},maxWordLen:function(b){return null==b?c.mlt_field[a].max_word_len:(c.mlt_field[a].max_word_len=b,this)},analyzer:function(b){return null==b?c.mlt_field[a].analyzer:(c.mlt_field[a].analyzer=b,this)},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('
    '+(this.showSeconds?'':"")+(this.showMeridian?'':"")+""+""+" "+''+" "+(this.showSeconds?'":"")+(this.showMeridian?'":"")+""+""+''+''+''+(this.showSeconds?'':"")+(this.showMeridian?'':"")+""+"
       
    "+b+":"+c+":'+d+" '+e+"
      
    ",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=""+'"+(a.text||"")+"";a.submenu&&a.submenu.length&&(e+=d(a.submenu).join("\n")),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.length0&&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.type}}

    {{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"],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=''+e.join("")+"
    ";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 diff --git a/dist/app/components/require.config.js b/dist/app/components/require.config.js old mode 100755 new mode 100644 index 8150baa9d0c..95f1ac65e0a --- a/dist/app/components/require.config.js +++ b/dist/app/components/require.config.js @@ -1,2 +1,4 @@ -require.config({baseUrl:"app",paths:{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:"components/jquery.extended","jquery-src":"../vendor/jquery/jquery-1.8.0","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-src":{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 +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + +require.config({baseUrl:"app",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:"components/jquery.extended","jquery-src":"../vendor/jquery/jquery-1.8.0","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-src":{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 diff --git a/dist/app/dashboards/blank.json b/dist/app/dashboards/blank.json old mode 100755 new mode 100644 diff --git a/dist/app/dashboards/default.json b/dist/app/dashboards/default.json old mode 100755 new mode 100644 diff --git a/dist/app/dashboards/guided.json b/dist/app/dashboards/guided.json old mode 100755 new mode 100644 diff --git a/dist/app/dashboards/logstash.js b/dist/app/dashboards/logstash.js old mode 100755 new mode 100644 diff --git a/dist/app/dashboards/logstash.json b/dist/app/dashboards/logstash.json old mode 100755 new mode 100644 diff --git a/dist/app/dashboards/noted.json b/dist/app/dashboards/noted.json old mode 100755 new mode 100644 diff --git a/dist/app/panels/bettermap/editor.html b/dist/app/panels/bettermap/editor.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/bettermap/leaflet.amd.js b/dist/app/panels/bettermap/leaflet.amd.js old mode 100755 new mode 100644 index 1c8a0e79762..694326a197a --- a/dist/app/panels/bettermap/leaflet.amd.js +++ b/dist/app/panels/bettermap/leaflet.amd.js @@ -1 +1,3 @@ -; \ No newline at end of file +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + diff --git a/dist/app/panels/bettermap/leaflet/leaflet.css b/dist/app/panels/bettermap/leaflet/leaflet.css old mode 100755 new mode 100644 diff --git a/dist/app/panels/bettermap/leaflet/leaflet.ie.css b/dist/app/panels/bettermap/leaflet/leaflet.ie.css old mode 100755 new mode 100644 diff --git a/dist/app/panels/bettermap/leaflet/leaflet.js b/dist/app/panels/bettermap/leaflet/leaflet.js old mode 100755 new mode 100644 index f21afc616bd..58b7a1f668c --- a/dist/app/panels/bettermap/leaflet/leaflet.js +++ b/dist/app/panels/bettermap/leaflet/leaflet.js @@ -1,117 +1,7 @@ -!function(e,t,n){var r=e.L,i={};i.version="0.6-dev","object"==typeof module&&"object"==typeof module.exports?module.exports=i:"function"==typeof define&&define.amd&&define("leaflet",[],function(){return i}),i.noConflict=function(){return e.L=r,this},e.L=i,i.Util={extend:function(e){var t,n,r,i,s=Array.prototype.slice.call(arguments,1);for(n=0,r=s.length;r>n;n++){i=s[n]||{};for(t in i)i.hasOwnProperty(t)&&(e[t]=i[t])}return e},bind:function(e,t){var n=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return e.apply(t,n||arguments)}},stamp:function(){var e=0,t="_leaflet_id";return function(n){return n[t]=n[t]||++e,n[t]}}(),invokeEach:function(e,t,n){var r,i;if("object"==typeof e){i=Array.prototype.slice.call(arguments,3);for(r in e)t.apply(n,[r,e[r]].concat(i));return!0}return!1},limitExecByInterval:function(e,t,n){var r,i;return function s(){var u=arguments;return r?(i=!0,void 0):(r=!0,setTimeout(function(){r=!1,i&&(s.apply(n,u),i=!1)},t),e.apply(n,u),void 0 -)}},falseFn:function(){return!1},formatNum:function(e,t){var n=Math.pow(10,t||5);return Math.round(e*n)/n},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},splitWords:function(e){return i.Util.trim(e).split(/\s+/)},setOptions:function(e,t){return e.options=i.extend({},e.options,t),e.options},getParamString:function(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+"="+encodeURIComponent(e[i]));return(t&&-1!==t.indexOf("?")?"&":"?")+r.join("&")},template:function(e,t){return e.replace(/\{ *([\w_]+) *\}/g,function(e,r){var i=t[r];if(i===n)throw new Error("No value provided for variable "+e);return"function"==typeof i&&(i=i(t)),i})},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function t(t){var n,r,i=["webkit","moz","o","ms"];for(n=0;ne;e++)r._initHooks[e].call(this)}},t},i.Class.include=function(e){i.extend(this.prototype,e)},i.Class.mergeOptions=function(e){i.extend(this.prototype.options,e)},i.Class.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n="function"==typeof e?e:function(){this[e].apply(this,t)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n)};var s="_leaflet_events";i.Mixin={},i.Mixin.Events={addEventListener:function(e,t,n){if(i.Util.invokeEach(e,this.addEventListener,this,t,n))return this;var r,u,a,f,l,c,h,p=this[s]=this[s]||{},d=n&&i.stamp(n);for(e=i.Util.splitWords(e),r=0,u=e.length;u>r;r++)a={action:t,context:n||this},f=e[r],n?(l=f+"_idx",c=l+"_len",h=p[l]=p[l]||{},h[d]||(h[d]=[],p[c]=(p[c]||0)+1),h[d].push(a)):(p[f]= -p[f]||[],p[f].push(a));return this},hasEventListeners:function(e){var t=this[s];return!!t&&(e in t&&t[e].length>0||e+"_idx"in t&&t[e+"_idx_len"]>0)},removeEventListener:function(e,t,n){if(!this[s])return this;if(!e)return this.clearAllEventListeners();if(i.Util.invokeEach(e,this.removeEventListener,this,t,n))return this;var r,u,a,f,l,c,h,p,d,v=this[s],m=n&&i.stamp(n);for(e=i.Util.splitWords(e),r=0,u=e.length;u>r;r++)if(a=e[r],c=a+"_idx",h=c+"_len",p=v[c],t){if(f=n&&p?p[m]:v[a]){for(l=f.length-1;l>=0;l--)f[l].action!==t||n&&f[l].context!==n||(d=f.splice(l,1),d[0].action=i.Util.falseFn);n&&p&&0===f.length&&(delete p[m],v[h]--)}}else delete v[a],delete v[c];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(e,t){if(!this.hasEventListeners(e))return this;var n,r,u,a,f,l=i.Util.extend({},t,{type:e,target:this}),c=this[s];if(c[e])for(n=c[e].slice(),r=0,u=n.length;u>r;r++)n[r].action.call(n[r].context||this,l);a=c[e+"_idx"];for(f in a)if(n=a[f].slice( -))for(r=0,u=n.length;u>r;r++)n[r].action.call(n[r].context||this,l);return this},addOneTimeEventListener:function(e,t,n){if(i.Util.invokeEach(e,this.addOneTimeEventListener,this,t,n))return this;var r=i.bind(function(){this.removeEventListener(e,t,n).removeEventListener(e,r,n)},this);return this.addEventListener(e,t,n).addEventListener(e,r,n)}},i.Mixin.Events.on=i.Mixin.Events.addEventListener,i.Mixin.Events.off=i.Mixin.Events.removeEventListener,i.Mixin.Events.once=i.Mixin.Events.addOneTimeEventListener,i.Mixin.Events.fire=i.Mixin.Events.fireEvent,function(){var r=!!e.ActiveXObject,s=r&&!e.XMLHttpRequest,u=r&&!t.querySelector,a=r&&!t.addEventListener,f=navigator.userAgent.toLowerCase(),l=-1!==f.indexOf("webkit"),c=-1!==f.indexOf("chrome"),h=-1!==f.indexOf("phantom"),p=-1!==f.indexOf("android"),d=-1!==f.search("android [23]"),v=typeof orientation!=n+"",m=e.navigator&&e.navigator.msPointerEnabled&&e.navigator.msMaxTouchPoints,g="devicePixelRatio"in e&&e.devicePixelRatio>1||"matchMedia"in -e&&e.matchMedia("(min-resolution:144dpi)")&&e.matchMedia("(min-resolution:144dpi)").matches,y=t.documentElement,b=r&&"transition"in y.style,w="WebKitCSSMatrix"in e&&"m11"in new e.WebKitCSSMatrix,E="MozPerspective"in y.style,S="OTransition"in y.style,x=!e.L_DISABLE_3D&&(b||w||E||S)&&!h,T=!e.L_NO_TOUCH&&!h&&function(){var e="ontouchstart";if(m||e in y)return!0;var n=t.createElement("div"),r=!1;return n.setAttribute?(n.setAttribute(e,"return;"),"function"==typeof n[e]&&(r=!0),n.removeAttribute(e),n=null,r):!1}();i.Browser={ie:r,ie6:s,ie7:u,ielt9:a,webkit:l,android:p,android23:d,chrome:c,ie3d:b,webkit3d:w,gecko3d:E,opera3d:S,any3d:x,mobile:v,mobileWebkit:v&&l,mobileWebkit3d:v&&w,mobileOpera:v&&e.opera,touch:T,msTouch:m,retina:g}}(),i.Point=function(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t},i.Point.prototype={clone:function(){return new i.Point(this.x,this.y)},add:function(e){return this.clone()._add(i.point(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract: -function(e){return this.clone()._subtract(i.point(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(e){e=i.point(e);var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return e=i.point(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=i.point(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+i.Util.formatNum(this.x)+", "+i.Util.formatNum(this.y)+")"}},i.point=function(e,t,r){return e instanceof -i.Point?e:i.Util.isArray(e)?new i.Point(e[0],e[1]):e===n||null===e?e:new i.Point(e,t,r)},i.Bounds=function(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;i>r;r++)this.extend(n[r])},i.Bounds.prototype={extend:function(e){return e=i.point(e),this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(e.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(e.y,this.max.y)):(this.min=e.clone(),this.max=e.clone()),this},getCenter:function(e){return new i.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return new i.Point(this.min.x,this.max.y)},getTopRight:function(){return new i.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return e="number"==typeof e[0]||e instanceof i.Point?i.point(e):i.bounds(e),e instanceof i.Bounds?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=i.bounds(e);var t=this -.min,n=this.max,r=e.min,s=e.max,u=s.x>=t.x&&r.x<=n.x,a=s.y>=t.y&&r.y<=n.y;return u&&a},isValid:function(){return!!this.min&&!!this.max}},i.bounds=function(e,t){return!e||e instanceof i.Bounds?e:new i.Bounds(e,t)},i.Transformation=function(e,t,n,r){this._a=e,this._b=t,this._c=n,this._d=r},i.Transformation.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new i.Point((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}},i.DomUtil={get:function(e){return"string"==typeof e?t.getElementById(e):e},getStyle:function(e,n){var r=e.style[n];if(!r&&e.currentStyle&&(r=e.currentStyle[n]),(!r||"auto"===r)&&t.defaultView){var i=t.defaultView.getComputedStyle(e,null);r=i?i[n]:null}return"auto"===r?null:r},getViewportOffset:function(e){var n,r=0,s=0,u=e,a=t.body,f=t.documentElement,l=i.Browser.ie7;do{if(r+=u.offsetTop||0,s+=u.offsetLeft||0,r+=parseInt -(i.DomUtil.getStyle(u,"borderTopWidth"),10)||0,s+=parseInt(i.DomUtil.getStyle(u,"borderLeftWidth"),10)||0,n=i.DomUtil.getStyle(u,"position"),u.offsetParent===a&&"absolute"===n)break;if("fixed"===n){r+=a.scrollTop||f.scrollTop||0,s+=a.scrollLeft||f.scrollLeft||0;break}if("relative"===n&&!u.offsetLeft){var c=i.DomUtil.getStyle(u,"width"),h=i.DomUtil.getStyle(u,"max-width"),p=u.getBoundingClientRect();("none"!==c||"none"!==h)&&(s+=p.left+u.clientLeft),r+=p.top+(a.scrollTop||f.scrollTop||0);break}u=u.offsetParent}while(u);u=e;do{if(u===a)break;r-=u.scrollTop||0,s-=u.scrollLeft||0,i.DomUtil.documentIsLtr()||!i.Browser.webkit&&!l||(s+=u.scrollWidth-u.clientWidth,l&&"hidden"!==i.DomUtil.getStyle(u,"overflow-y")&&"hidden"!==i.DomUtil.getStyle(u,"overflow")&&(s+=17)),u=u.parentNode}while(u);return new i.Point(s,r)},documentIsLtr:function(){return i.DomUtil._docIsLtrCached||(i.DomUtil._docIsLtrCached=!0,i.DomUtil._docIsLtr="ltr"===i.DomUtil.getStyle(t.body,"direction")),i.DomUtil._docIsLtr},create -:function(e,n,r){var i=t.createElement(e);return i.className=n,r&&r.appendChild(i),i},disableTextSelection:function(){t.selection&&t.selection.empty&&t.selection.empty(),this._onselectstart||(this._onselectstart=t.onselectstart||null,t.onselectstart=i.Util.falseFn)},enableTextSelection:function(){t.onselectstart===i.Util.falseFn&&(t.onselectstart=this._onselectstart,this._onselectstart=null)},hasClass:function(e,t){return e.className.length>0&&(new RegExp("(^|\\s)"+t+"(\\s|$)")).test(e.className)},addClass:function(e,t){i.DomUtil.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},removeClass:function(e,t){e.className=i.Util.trim((" "+e.className+" ").replace(" "+t+" "," "))},setOpacity:function(e,t){if("opacity"in e.style)e.style.opacity=t;else if("filter"in e.style){var n=!1,r="DXImageTransform.Microsoft.Alpha";try{n=e.filters.item(r)}catch(i){if(1===t)return}t=Math.round(100*t),n?(n.Enabled=100!==t,n.Opacity=t):e.style.filter+=" progid:"+r+"(opacity="+t+")"}},testProp:function(e){for( -var n=t.documentElement.style,r=0;rn||n===t?t:e),new i.LatLng(this.lat,n)}},i.latLng=function(e,t){return e instanceof i.LatLng?e:i.Util.isArray(e)?new i.LatLng(e[0],e[1]):e===n||null===e? -e:"object"==typeof e&&"lat"in e?new i.LatLng(e.lat,"lng"in e?e.lng:e.lon):new i.LatLng(e,t)},i.LatLngBounds=function(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;i>r;r++)this.extend(n[r])},i.LatLngBounds.prototype={extend:function(e){return e?(e="number"==typeof e[0]||"string"==typeof e[0]||e instanceof i.LatLng?i.latLng(e):i.latLngBounds(e),e instanceof i.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(e.lat,this._southWest.lat),this._southWest.lng=Math.min(e.lng,this._southWest.lng),this._northEast.lat=Math.max(e.lat,this._northEast.lat),this._northEast.lng=Math.max(e.lng,this._northEast.lng)):(this._southWest=new i.LatLng(e.lat,e.lng),this._northEast=new i.LatLng(e.lat,e.lng)):e instanceof i.LatLngBounds&&(this.extend(e._southWest),this.extend(e._northEast)),this):this},pad:function(e){var t=this._southWest,n=this._northEast,r=Math.abs(t.lat-n.lat)*e,s=Math.abs(t.lng-n.lng)*e;return new i.LatLngBounds(new i.LatLng(t.lat-r,t.lng-s),new i.LatLng(n.lat+r,n.lng+s))} -,getCenter:function(){return new i.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new i.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new i.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e="number"==typeof e[0]||e instanceof i.LatLng?i.latLng(e):i.latLngBounds(e);var t,n,r=this._southWest,s=this._northEast;return e instanceof i.LatLngBounds?(t=e.getSouthWest(),n=e.getNorthEast()):t=n=e,t.lat>=r.lat&&n.lat<=s.lat&&t.lng>=r.lng&&n.lng<=s.lng},intersects:function(e){e=i.latLngBounds(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),s=e.getNorthEast(),u=s.lat>=t.lat&&r.lat<=n.lat, -a=s.lng>=t.lng&&r.lng<=n.lng;return u&&a},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e){return e?(e=i.latLngBounds(e),this._southWest.equals(e.getSouthWest())&&this._northEast.equals(e.getNorthEast())):!1},isValid:function(){return!!this._southWest&&!!this._northEast}},i.latLngBounds=function(e,t){return!e||e instanceof i.LatLngBounds?e:new i.LatLngBounds(e,t)},i.Projection={},i.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(e){var t=i.LatLng.DEG_TO_RAD,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),s=e.lng*t,u=r*t;return u=Math.log(Math.tan(Math.PI/4+u/2)),new i.Point(s,u)},unproject:function(e){var t=i.LatLng.RAD_TO_DEG,n=e.x*t,r=(2*Math.atan(Math.exp(e.y))-Math.PI/2)*t;return new i.LatLng(r,n)}},i.Projection.LonLat={project:function(e){return new i.Point(e.lng,e.lat)},unproject:function(e){return new i.LatLng(e.y,e.x)}},i.CRS={latLngToPoint:function(e,t){var n=this.projection -.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},scale:function(e){return 256*Math.pow(2,e)}},i.CRS.Simple=i.extend({},i.CRS,{projection:i.Projection.LonLat,transformation:new i.Transformation(1,0,-1,0),scale:function(e){return Math.pow(2,e)}}),i.CRS.EPSG3857=i.extend({},i.CRS,{code:"EPSG:3857",projection:i.Projection.SphericalMercator,transformation:new i.Transformation(.5/Math.PI,.5,-0.5/Math.PI,.5),project:function(e){var t=this.projection.project(e),n=6378137;return t.multiplyBy(n)}}),i.CRS.EPSG900913=i.extend({},i.CRS.EPSG3857,{code:"EPSG:900913"}),i.CRS.EPSG4326=i.extend({},i.CRS,{code:"EPSG:4326",projection:i.Projection.LonLat,transformation:new i.Transformation(1/360,.5,-1/360,.5)}),i.Map=i.Class.extend({includes:i.Mixin.Events,options:{crs:i.CRS.EPSG3857,fadeAnimation:i.DomUtil.TRANSITION&&! -i.Browser.android23,trackResize:!0,markerZoomAnimation:i.DomUtil.TRANSITION&&i.Browser.any3d},initialize:function(e,t){t=i.setOptions(this,t),this._initContainer(e),this._initLayout(),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),t.center&&t.zoom!==n&&this.setView(i.latLng(t.center),t.zoom,{reset:!0}),this._initLayers(t.layers),this._handlers=[],this.callInitHooks()},setView:function(e,t){return this._resetView(i.latLng(e),this._limitZoom(t)),this},setZoom:function(e,t){return this.setView(this.getCenter(),e,{zoom:t})},zoomIn:function(e,t){return this.setZoom(this._zoom+(e||1),t)},zoomOut:function(e,t){return this.setZoom(this._zoom-(e||1),t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),s=this.getSize().divideBy(2),u=e instanceof i.Point?e:this.latLngToContainerPoint(e),a=u.subtract(s).multiplyBy(1-1/r),f=this.containerPointToLatLng(s.add(a));return this.setView(f,t,{zoom:n})},fitBounds:function(e,t){t=t||{},e=e.getBounds?e.getBounds():i.latLngBounds(e);var n= -i.point(t.paddingTopLeft||t.padding||[0,0]),r=i.point(t.paddingBottomRight||t.padding||[0,0]),s=this.getBoundsZoom(e,!1,n.add(r)),u=r.subtract(n).divideBy(2),a=this.project(e.getSouthWest(),s),f=this.project(e.getNorthEast(),s),l=this.unproject(a.add(f).divideBy(2).add(u),s);return this.setView(l,s,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e){return this.fire("movestart"),this._rawPanBy(i.point(e)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(e){if(e=i.latLngBounds(e),this.options.maxBounds=e,!e)return this._boundsMinZoom=null,this.off("moveend",this._panInsideMaxBounds,this),this;var t=this.getBoundsZoom(e,!0);return this._boundsMinZoom=t,this._loaded&&(this._zoomu.x&&(a=Math.floor(u.x-r.x)),n.y>s.y&&(f=Math.floor(s.y-n.y)),n.x=s);return c&&t?null:t?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new i.Point(this._container -.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var e=this._getTopLeftPoint();return new i.Bounds(e,e.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e){var t=this.options.crs;return t.scale(e)/t.scale(this._zoom)},getScaleZoom:function(e){return this._zoom+Math.log(e)/Math.LN2},project:function(e,t){return t=t===n?this._zoom:t,this.options.crs.latLngToPoint(i.latLng(e),t)},unproject:function(e,t){return t=t===n?this._zoom:t,this.options.crs.pointToLatLng(i.point(e),t)},layerPointToLatLng:function(e){var t=i.point(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){var t=this.project(i.latLng(e))._round();return t._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(e){return i.point(e).subtract(this._getMapPanePos -())},layerPointToContainerPoint:function(e){return i.point(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(i.point(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(i.latLng(e)))},mouseEventToContainerPoint:function(e){return i.DomEvent.getMousePosition(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=i.DomUtil.get(e);if(!t)throw new Error("Map container not found.");if(t._leaflet)throw new Error("Map container is already initialized.");t._leaflet=!0},_initLayout:function(){var e=this._container;i.DomUtil.addClass(e,"leaflet-container"+(i.Browser.touch?" leaflet-touch":"")+(i.Browser.retina?" leaflet-retina":"")+(this.options -.fadeAnimation?" leaflet-fade-anim":""));var t=i.DomUtil.getStyle(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._mapPane=e.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=e.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),e.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),e.shadowPane=this._createPane("leaflet-shadow-pane"),e.overlayPane=this._createPane("leaflet-overlay-pane"),e.markerPane=this._createPane("leaflet-marker-pane"),e.popupPane=this._createPane("leaflet-popup-pane");var t=" leaflet-zoom-hide";this.options.markerZoomAnimation||(i.DomUtil.addClass(e.markerPane,t),i.DomUtil.addClass(e.shadowPane,t),i.DomUtil.addClass(e.popupPane,t))},_createPane:function(e,t){return i.DomUtil.create("div",e,t||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild -(this._mapPane)},_initLayers:function(e){e=e?i.Util.isArray(e)?e:[e]:[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0;var t,n;for(t=0,n=e.length;n>t;t++)this.addLayer(e[t])},_resetView:function(e,t,n,r){var s=this._zoom!==t;r||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=t,this._initialCenter=e,this._initialTopLeftPoint=this._getNewTopLeftPoint(e),n?this._initialTopLeftPoint._add(this._getMapPanePos()):i.DomUtil.setPosition(this._mapPane,new i.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var u=!this._loaded;this._loaded=!0,u&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!n}),this.fire("move"),(s||r)&&this.fire("zoomend"),this.fire("moveend",{hard:!n})},_rawPanBy:function(e){i.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var e,t=1/0,r=-1/0,i=this._getZoomSpan();for(e in this._zoomBoundLayers -){var s=this._zoomBoundLayers[e];isNaN(s.options.minZoom)||(t=Math.min(t,s.options.minZoom)),isNaN(s.options.maxZoom)||(r=Math.max(r,s.options.maxZoom))}e===n?this._layersMaxZoom=this._layersMinZoom=n:(this._layersMaxZoom=r,this._layersMinZoom=t),i!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){if(i.DomEvent){t=t||"on",i.DomEvent[t](this._container,"click",this._onMouseClick,this);var n,r,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(n=0,r=s.length;r>n;n++)i.DomEvent[t](this._container,s[n],this._fireMouseEvent,this);this.options.trackResize&&i.DomEvent[t](e,"resize",this._onResize,this)}},_onResize:function(){i.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=i.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)}, -_onMouseClick:function(e){!this._loaded||this.dragging&&this.dragging.moved()||(this.fire("preclick"),this._fireMouseEvent(e))},_fireMouseEvent:function(e){if(this._loaded){var t=e.type;if(t="mouseenter"===t?"mouseover":"mouseleave"===t?"mouseout":t,this.hasEventListeners(t)){"contextmenu"===t&&i.DomEvent.preventDefault(e);var n=this.mouseEventToContainerPoint(e),r=this.containerPointToLayerPoint(n),s=this.layerPointToLatLng(r);this.fire(t,{latlng:s,layerPoint:r,containerPoint:n,originalEvent:e})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var e=0,t=this._handlers.length;t>e;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,this):this.on("load",e,t),this},_layerAdd:function(e){e.onAdd(this),this.fire("layeradd",{layer:e})},_getMapPanePos:function(){return i.DomUtil.getPosition(this._mapPane)},_moved:function(){var e=this._getMapPanePos -();return e&&!e.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._round()},_latLngToNewLayerPoint:function(e,t,n){var r=this._getNewTopLeftPoint(n,t).add(this._getMapPanePos());return this.project(e,t)._subtract(r)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom();return Math.max(t,Math.min(n,e))}}),i.map=function(e,t){return new i.Map(e,t)},i.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(e){var t=i.LatLng.DEG_TO_RAD,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),s=this.R_MAJOR,u=this.R_MINOR,a=e.lng*t*s,f=r*t,l=u/s,c=Math.sqrt(1-l*l),h=c*Math.sin(f) -;h=Math.pow((1-h)/(1+h),.5*c);var p=Math.tan(.5*(.5*Math.PI-f))/h;return f=-u*Math.log(p),new i.Point(a,f)},unproject:function(e){for(var t,n=i.LatLng.RAD_TO_DEG,r=this.R_MAJOR,s=this.R_MINOR,u=e.x*n/r,a=s/r,f=Math.sqrt(1-a*a),l=Math.exp(-e.y/s),c=Math.PI/2-2*Math.atan(l),h=15,p=1e-7,d=h,v=.1;Math.abs(v)>p&&--d>0;)t=f*Math.sin(c),v=Math.PI/2-2*Math.atan(l*Math.pow((1-t)/(1+t),.5*f))-c,c+=v;return new i.LatLng(c*n,u)}},i.CRS.EPSG3395=i.extend({},i.CRS,{code:"EPSG:3395",projection:i.Projection.Mercator,transformation:function(){var e=i.Projection.Mercator,t=e.R_MAJOR,n=e.R_MINOR;return new i.Transformation(.5/(Math.PI*t),.5,-0.5/(Math.PI*n),.5)}()}),i.TileLayer=i.Class.extend({includes:i.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:i.Browser.mobile,updateWhenIdle:i.Browser.mobile},initialize:function(e,t){t=i.setOptions(this,t),t.detectRetina&&i.Browser.retina&&t.maxZoom>0&&(t.tileSize=Math -.floor(t.tileSize/2),t.zoomOffset++,t.minZoom>0&&t.minZoom--,this.options.maxZoom--),t.bounds&&(t.bounds=i.latLngBounds(t.bounds)),this._url=e;var n=this.options.subdomains;"string"==typeof n&&(this.options.subdomains=n.split(""))},onAdd:function(e){this._map=e,this._animated=e.options.zoomAnimation&&i.Browser.any3d,this._initContainer(),this._createTileProto(),e.on({viewreset:this._reset,moveend:this._update},this),this._animated&&e.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=i.Util.limitExecByInterval(this._update,150,this),e.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){this._container.parentNode.removeChild(this._container),e.off({viewreset:this._reset,moveend:this._update},this),this._animated&&e.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||e.off("move",this._limitedUpdate,this -),this._container=null,this._map=null},bringToFront:function(){var e=this._map._panes.tilePane;return this._container&&(e.appendChild(this._container),this._setAutoZIndex(e,Math.max)),this},bringToBack:function(){var e=this._map._panes.tilePane;return this._container&&(e.insertBefore(this._container,e.firstChild),this._setAutoZIndex(e,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},setUrl:function(e,t){return this._url=e,t||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==n&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e,t){var n,r,i,s=e.children,o=-t(1/0,-1/0);for(r=0,i=s.length;i>r;r++)s[r]!==this. -_container&&(n=parseInt(s[r].style.zIndex,10),isNaN(n)||(o=t(o,n)));this.options.zIndex=this._container.style.zIndex=(isFinite(o)?o:0)+t(1,-1)},_updateOpacity:function(){var e,t=this._tiles;if(i.Browser.ielt9)for(e in t)i.DomUtil.setOpacity(t[e],this.options.opacity);else i.DomUtil.setOpacity(this._container,this.options.opacity);if(i.Browser.webkit)for(e in t)t[e].style.webkitTransform+=" translate(0,0)"},_initContainer:function(){var e=this._map._panes.tilePane;if(!this._container){if(this._container=i.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var t="leaflet-tile-container leaflet-zoom-animated";this._bgBuffer=i.DomUtil.create("div",t,this._container),this._bgBuffer.style.zIndex=1,this._tileContainer=i.DomUtil.create("div",t,this._container),this._tileContainer.style.zIndex=2}else this._tileContainer=this._container;e.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(e){for(var t in this._tiles)this.fire("tileunload" -,{tile:this._tiles[t]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&e&&e.hard&&this._clearBgBuffer(),this._initContainer()},_update:function(){if(this._map){var e=this._map.getPixelBounds(),t=this._map.getZoom(),n=this.options.tileSize;if(!(t>this.options.maxZoom||tr;r++)this._addTile(u[r],l);this._tileContainer.appendChild -(l)}},_tileShouldBeLoaded:function(e){if(e.x+":"+e.y in this._tiles)return!1;var t=this.options;if(!t.continuousWorld){var n=this._getWrapTileNum();if(t.noWrap&&(e.x<0||e.x>=n)||e.y<0||e.y>=n)return!1}if(t.bounds){var r=t.tileSize,i=e.multiplyBy(r),s=i.add([r,r]),o=this._map.unproject(i),u=this._map.unproject(s);if(t.continuousWorld||t.noWrap||(o=o.wrap(),u=u.wrap()),!t.bounds.intersects([o,u]))return!1}return!0},_removeOtherTiles:function(e){var t,n,r,i;for(i in this._tiles)t=i.split(":"),n=parseInt(t[0],10),r=parseInt(t[1],10),(ne.max.x||re.max.y)&&this._removeTile(i)},_removeTile:function(e){var t=this._tiles[e];this.fire("tileunload",{tile:t,url:t.src}),this.options.reuseTiles?(i.DomUtil.removeClass(t,"leaflet-tile-loaded"),this._unusedTiles.push(t)):t.parentNode===this._tileContainer&&this._tileContainer.removeChild(t),i.Browser.android||(t.onload=null,t.src=i.Util.emptyImageUrl),delete this._tiles[e]},_addTile:function(e,t){var n=this._getTilePos(e),r=this. -_getTile();i.DomUtil.setPosition(r,n,i.Browser.chrome||i.Browser.android23),this._tiles[e.x+":"+e.y]=r,this._loadTile(r,e),r.parentNode!==this._tileContainer&&t.appendChild(r)},_getZoomForUrl:function(){var e=this.options,t=this._map.getZoom();return e.zoomReverse&&(t=e.maxZoom-t),t+e.zoomOffset},_getTilePos:function(e){var t=this._map.getPixelOrigin(),n=this.options.tileSize;return e.multiplyBy(n).subtract(t)},getTileUrl:function(e){return i.Util.template(this._url,i.extend({s:this._getSubdomain(e),z:e.z,x:e.x,y:e.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(e){var t=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(e.x=(e.x%t+t)%t),this.options.tms&&(e.y=t-e.y-1),e.z=this._getZoomForUrl()},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_createTileProto:function(){var e=this._tileImg=i.DomUtil.create("img","leaflet-tile");e.style -.width=e.style.height=this.options.tileSize+"px",e.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var e=this._unusedTiles.pop();return this._resetTile(e),e}return this._createTile()},_resetTile:function(){},_createTile:function(){var e=this._tileImg.cloneNode(!1);return e.onselectstart=e.onmousemove=i.Util.falseFn,i.Browser.ielt9&&this.options.opacity!==n&&i.DomUtil.setOpacity(e,this.options.opacity),e},_loadTile:function(e,t){e._layer=this,e.onload=this._tileOnLoad,e.onerror=this._tileOnError,this._adjustTilePoint(t),e.src=this.getTileUrl(t)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(i.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var e=this._layer;this.src!==i.Util.emptyImageUrl&&(i.DomUtil.addClass(this,"leaflet-tile-loaded"),e.fire("tileload",{tile:this,url:this.src})),e._tileLoaded()},_tileOnError -:function(){var e=this._layer;e.fire("tileerror",{tile:this,url:this.src});var t=e.options.errorTileUrl;t&&(this.src=t),e._tileLoaded()}}),i.tileLayer=function(e,t){return new i.TileLayer(e,t)},i.TileLayer.WMS=i.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(e,t){this._url=e;var n=i.extend({},this.defaultWmsParams),r=t.tileSize||this.options.tileSize;n.width=n.height=t.detectRetina&&i.Browser.retina?2*r:r;for(var s in t)this.options.hasOwnProperty(s)||(n[s]=t[s]);this.wmsParams=n,i.setOptions(this,t)},onAdd:function(e){var t=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[t]=e.options.crs.code,i.TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e,t){var n=this._map,r=n.options.crs,s=this.options.tileSize,u=e.multiplyBy(s),a=u.add([s,s]),f=r.project(n.unproject(u,t)),l=r.project(n.unproject(a,t)),c=[f.x,l.y,l.x,f.y].join(","),h=i.Util.template(this. -_url,{s:this._getSubdomain(e)});return h+i.Util.getParamString(this.wmsParams,h,!0)+"&BBOX="+c},setParams:function(e,t){return i.extend(this.wmsParams,e),t||this.redraw(),this}}),i.tileLayer.wms=function(e,t){return new i.TileLayer.WMS(e,t)},i.TileLayer.Canvas=i.TileLayer.extend({options:{async:!1},initialize:function(e){i.setOptions(this,e)},redraw:function(){for(var e in this._tiles)this._redrawTile(this._tiles[e]);return this},_redrawTile:function(e){this.drawTile(e,e._tilePoint,this._map._zoom)},_createTileProto:function(){var e=this._canvasProto=i.DomUtil.create("canvas","leaflet-tile");e.width=e.height=this.options.tileSize},_createTile:function(){var e=this._canvasProto.cloneNode(!1);return e.onselectstart=e.onmousemove=i.Util.falseFn,e},_loadTile:function(e,t){e._layer=this,e._tilePoint=t,this._redrawTile(e),this.options.async||this.tileDrawn(e)},drawTile:function(){},tileDrawn:function(e){this._tileOnLoad.call(e)}}),i.tileLayer.canvas=function(e){return new i.TileLayer.Canvas(e -)},i.ImageOverlay=i.Class.extend({includes:i.Mixin.Events,options:{opacity:1},initialize:function(e,t,n){this._url=e,this._bounds=i.latLngBounds(t),i.setOptions(this,n)},onAdd:function(e){this._map=e,this._image||this._initImage(),e._panes.overlayPane.appendChild(this._image),e.on("viewreset",this._reset,this),e.options.zoomAnimation&&i.Browser.any3d&&e.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(e){e.getPanes().overlayPane.removeChild(this._image),e.off("viewreset",this._reset,this),e.options.zoomAnimation&&e.off("zoomanim",this._animateZoom,this)},addTo:function(e){return e.addLayer(this),this},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var e=this._map._panes.overlayPane;return this._image&&e.insertBefore(this._image,e.firstChild),this},_initImage:function(){this._image=i.DomUtil.create("img","leaflet-image-layer" -),this._map.options.zoomAnimation&&i.Browser.any3d?i.DomUtil.addClass(this._image,"leaflet-zoom-animated"):i.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),i.extend(this._image,{galleryimg:"no",onselectstart:i.Util.falseFn,onmousemove:i.Util.falseFn,onload:i.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(e){var t=this._map,n=this._image,r=t.getZoomScale(e.zoom),s=this._bounds.getNorthWest(),u=this._bounds.getSouthEast(),a=t._latLngToNewLayerPoint(s,e.zoom,e.center),f=t._latLngToNewLayerPoint(u,e.zoom,e.center)._subtract(a),l=a._add(f._multiplyBy(.5*(1-1/r)));n.style[i.DomUtil.TRANSFORM]=i.DomUtil.getTranslateString(l)+" scale("+r+") "},_reset:function(){var e=this._image,t=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),n=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(t);i.DomUtil.setPosition(e,t),e.style.width=n.x+"px",e.style.height=n.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function( -){i.DomUtil.setOpacity(this._image,this.options.opacity)}}),i.imageOverlay=function(e,t,n){return new i.ImageOverlay(e,t,n)},i.Icon=i.Class.extend({options:{className:""},initialize:function(e){i.setOptions(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if("icon"===e)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var r;return r=t&&"IMG"===t.tagName?this._createImg(n,t):this._createImg(n),this._setIconStyles(r,e),r},_setIconStyles:function(e,t){var n,r=this.options,s=i.point(r[t+"Size"]);n="shadow"===t?i.point(r.shadowAnchor||r.iconAnchor):i.point(r.iconAnchor),!n&&s&&(n=s.divideBy(2,!0)),e.className="leaflet-marker-"+t+" "+r.className,n&&(e.style.marginLeft=-n.x+"px",e.style.marginTop=-n.y+"px"),s&&(e.style.width=s.x+"px",e.style.height=s.y+"px")},_createImg:function(e,n){return i.Browser.ie6?(n||(n=t.createElement("div" -)),n.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+e+'")'):(n||(n=t.createElement("img")),n.src=e),n},_getIconUrl:function(e){return i.Browser.retina&&this.options[e+"RetinaUrl"]?this.options[e+"RetinaUrl"]:this.options[e+"Url"]}}),i.icon=function(e){return new i.Icon(e)},i.Icon.Default=i.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(e){var t=e+"Url";if(this.options[t])return this.options[t];i.Browser.retina&&"icon"===e&&(e+="-2x");var n=i.Icon.Default.imagePath;if(!n)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return n+"/marker-"+e+".png"}}),i.Icon.Default.imagePath=function(){var e,n,r,i,s,o=t.getElementsByTagName("script"),u=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(e=0,n=o.length;n>e;e++)if(r=o[e].src,i=r.match(u))return s=r.split(u)[0],(s?s+"/":"")+"images"}(),i.Marker=i.Class.extend({includes:i.Mixin.Events,options:{icon:new i.Icon.Default,title -:"",clickable:!0,draggable:!1,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(e,t){i.setOptions(this,t),this._latlng=i.latLng(e)},onAdd:function(e){this._map=e,e.on("viewreset",this.update,this),this._initIcon(),this.update(),e.options.zoomAnimation&&e.options.markerZoomAnimation&&e.on("zoomanim",this._animateZoom,this)},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){this.dragging&&this.dragging.disable(),this._removeIcon(),this.fire("remove"),e.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=i.latLng(e),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update(),this},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var e=this._map.latLngToLayerPoint(this._latlng).round();this -._setPos(e)}return this},_initIcon:function(){var e=this.options,t=this._map,n=t.options.zoomAnimation&&t.options.markerZoomAnimation,r=n?"leaflet-zoom-animated":"leaflet-zoom-hide",s=!1,u=this._icon;if(u){var a=e.icon.createIcon(this._icon);a!==this._icon&&(this._removeIcon(),this._icon=a,u=!1)}else this._icon=e.icon.createIcon();e.title&&(this._icon.title=e.title),this._initInteraction(),s=e.opacity<1,i.DomUtil.addClass(this._icon,r),e.riseOnHover&&i.DomEvent.on(this._icon,"mouseover",this._bringToFront,this).on(this._icon,"mouseout",this._resetZIndex,this);var f=this._shadow;f?this._shadow=e.icon.createShadow(this._shadow):(this._shadow=e.icon.createShadow(),this._shadow&&(i.DomUtil.addClass(this._shadow,r),s=e.opacity<1)),s&&this._updateOpacity();var l=this._map._panes;u||l.markerPane.appendChild(this._icon),this._shadow&&!f&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){var e=this._map._panes;this.options.riseOnHover&&i.DomEvent.off(this._icon,"mouseover",this._bringToFront -).off(this._icon,"mouseout",this._resetZIndex),e.markerPane.removeChild(this._icon),this._shadow&&e.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_setPos:function(e){i.DomUtil.setPosition(this._icon,e),this._shadow&&i.DomUtil.setPosition(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon.style.zIndex=this._zIndex+e},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPos(t)},_initInteraction:function(){if(this.options.clickable){var e=this._icon,t=["dblclick","mousedown","mouseover","mouseout","contextmenu"];i.DomUtil.addClass(e,"leaflet-clickable"),i.DomEvent.on(e,"click",this._onMouseClick,this);for(var n=0;ns?(t.height=s+"px",i.DomUtil.addClass(e,u)):i.DomUtil.removeClass(e,u),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=this._animated,n=i.point(this.options.offset);t&&i.DomUtil.setPosition(this._container,e),this._containerBottom=-n.y-(t?0:e.y),this._containerLeft=-Math.round(this._containerWidth/2)+n.x+(t?0:e.x),this._container.style.bottom=this._containerBottom+"px" -,this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);i.DomUtil.setPosition(this._container,t)},_adjustPan:function(){if(this.options.autoPan){var e=this._map,t=this._container.offsetHeight,n=this._containerWidth,r=new i.Point(this._containerLeft,-t-this._containerBottom);this._animated&&r._add(i.DomUtil.getPosition(this._container));var s=e.layerPointToContainerPoint(r),u=i.point(this.options.autoPanPadding),a=e.getSize(),f=0,l=0;s.x+n>a.x&&(f=s.x+n-a.x+u.x),s.x-f<0&&(f=s.x-u.x),s.y+t>a.y&&(l=s.y+t-a.y+u.y),s.y-l<0&&(l=s.y-u.y),(f||l)&&e.fire("autopanstart").panBy([f,l])}},_onCloseButtonClick:function(e){this._close(),i.DomEvent.stop(e)}}),i.popup=function(e,t){return new i.Popup(e,t)},i.Map.include({openPopup:function(e,t,n){if(this.closePopup(),!(e instanceof i.Popup)){var r=e;e=(new i.Popup(n)).setLatLng(t).setContent(r)}return this._popup=e,this.addLayer(e)},closePopup:function(e){return e&& -e!==this._popup||(e=this._popup,this._popup=null),e&&this.removeLayer(e),this}}),i.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(e,t){var n=i.point(this.options.icon.options.popupAnchor||[0,0]);return n=n.add(i.Popup.prototype.options.offset),t&&t.offset&&(n=n.add(t.offset)),t=i.extend({offset:n},t),this._popup||this.on("click",this.openPopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),e instanceof i.Popup?(i.setOptions(e,t),this._popup=e):this._popup=(new i.Popup(t,this)).setContent(e),this},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function( -e){this._popup.setLatLng(e.latlng)}}),i.LayerGroup=i.Class.extend({initialize:function(e){this._layers={};var t,n;if(e)for(t=0,n=e.length;n>t;t++)this.addLayer(e[t])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return e?e in this._layers||this.getLayerId(e)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(e){var t,n,r=Array.prototype.slice.call(arguments,1);for(t in this._layers)n=this._layers[t],n[e]&&n[e].apply(n,r);return this},onAdd:function(e){this._map=e,this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e),this._map=null},addTo:function(e){return e.addLayer(this),this},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers -[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];for(var t in this._layers)e.push(this._layers[t]);return e},setZIndex:function(e){return this.invoke("setZIndex",e)},getLayerId:function(e){return i.stamp(e)}}),i.layerGroup=function(e){return new i.LayerGroup(e)},i.FeatureGroup=i.LayerGroup.extend({includes:i.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu"},addLayer:function(e){return this.hasLayer(e)?this:(e.on(i.FeatureGroup.EVENTS,this._propagateEvent,this),i.LayerGroup.prototype.addLayer.call(this,e),this._popupContent&&e.bindPopup&&e.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:e}))},removeLayer:function(e){return e in this._layers&&(e=this._layers[e]),e.off(i.FeatureGroup.EVENTS,this._propagateEvent,this),i.LayerGroup.prototype.removeLayer.call(this,e),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:e})},bindPopup:function(e,t){return this -._popupContent=e,this._popupOptions=t,this.invoke("bindPopup",e,t)},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new i.LatLngBounds;return this.eachLayer(function(t){e.extend(t instanceof i.Marker?t.getLatLng():t.getBounds())}),e},_propagateEvent:function(e){e.layer||(e.layer=e.target),e.target=this,this.fire(e.type,e)}}),i.featureGroup=function(e){return new i.FeatureGroup(e)},i.Path=i.Class.extend({includes:[i.Mixin.Events],statics:{CLIP_PADDING:i.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(e.innerWidth,e.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(e){i.setOptions(this,e)},onAdd:function(e){this._map=e,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this -._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),e.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){e._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,i.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),e.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(e){return i.setOptions(this,e),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),i.Map.include({_updatePathViewport:function(){var e=i.Path.CLIP_PADDING,t=this.getSize(),n=i.DomUtil.getPosition(this._mapPane),r=n.multiplyBy(-1)._subtract(t.multiplyBy(e)._round()),s=r.add(t.multiplyBy(1+2*e)._round());this._pathViewport=new i.Bounds(r,s)}}),i.Path.SVG_NS="http://www.w3.org/2000/svg",i.Browser.svg=!!t.createElementNS&&!!t.createElementNS( -i.Path.SVG_NS,"svg").createSVGRect,i.Path=i.Path.extend({statics:{SVG:i.Browser.svg},bringToFront:function(){var e=this._map._pathRoot,t=this._container;return t&&e.lastChild!==t&&e.appendChild(t),this},bringToBack:function(){var e=this._map._pathRoot,t=this._container,n=e.firstChild;return t&&n!==t&&e.insertBefore(t,n),this},getPathString:function(){},_createElement:function(e){return t.createElementNS(i.Path.SVG_NS,e)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents|| -this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var e=this.getPathString();e||(e="M0 0"),this._path.setAttribute("d",e)},_initEvents:function(){if(this.options.clickable){(i.Browser.svg||!i.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),i.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var e=["dblclick","mousedown","mouseover" -,"mouseout","mousemove","contextmenu"],t=0;t';var n=e.firstChild;return n.style.behavior="url(#default#VML)",n&&"object"==typeof n.adj}catch(r){return!1}}(),i.Path=i.Browser.svg||!i.Browser.vml?i.Path:i.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return t.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return t.createElement("')}}catch(e){return function(e){return t.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">' -)}}}(),_initPath:function(){var e=this._container=this._createElement("shape");i.DomUtil.addClass(e,"leaflet-vml-shape"),this.options.clickable&&i.DomUtil.addClass(e,"leaflet-clickable"),e.coordsize="1 1",this._path=this._createElement("path"),e.appendChild(this._path),this._map._pathRoot.appendChild(e)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var e=this._stroke,t=this._fill,n=this.options,r=this._container;r.stroked=n.stroke,r.filled=n.fill,n.stroke?(e||(e=this._stroke=this._createElement("stroke"),e.endcap="round",r.appendChild(e)),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,e.dashStyle=n.dashArray?n.dashArray instanceof Array?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):""):e&&(r.removeChild(e),this._stroke=null),n.fill?(t||(t=this._fill=this._createElement("fill"),r.appendChild(t)),t.color=n.fillColor||n.color,t.opacity=n.fillOpacity):t&&(r.removeChild(t),this._fill=null)},_updatePath:function(){var e=this._container.style;e.display="none" -,this._path.v=this.getPathString()+" ",e.display=""}}),i.Map.include(i.Browser.svg||!i.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var e=this._pathRoot=t.createElement("div");e.className="leaflet-vml-container",this._panes.overlayPane.appendChild(e),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),i.Browser.canvas=function(){return!!t.createElement("canvas").getContext}(),i.Path=i.Path.SVG&&!e.L_PREFER_CANVAS||!i.Browser.canvas?i.Path:i.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(e){return i.setOptions(this,e),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(e){e.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function( -){this._map&&!i.Path._updateRequest&&(i.Path._updateRequest=i.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){i.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var e=this.options;e.stroke&&(this._ctx.lineWidth=e.weight,this._ctx.strokeStyle=e.color),e.fill&&(this._ctx.fillStyle=e.fillColor||e.color)},_drawPath:function(){var e,t,n,r,s,u;for(this._ctx.beginPath(),e=0,n=this._parts.length;n>e;e++){for(t=0,r=this._parts[e].length;r>t;t++)s=this._parts[e][t],u=(0===t?"move":"line")+"To",this._ctx[u](s.x,s.y);this instanceof i.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var e=this._ctx,t=this.options;this._drawPath(),e.save(),this._updateStyle(),t.fill&&(e.globalAlpha=t.fillOpacity,e.fill()),t.stroke&&(e.globalAlpha=t.opacity,e.stroke()),e.restore()}},_initEvents:function( -){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(e){this._containsPoint(e.layerPoint)&&this.fire("click",e)},_onMouseMove:function(e){this._map&&!this._map._animatingZoom&&(this._containsPoint(e.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",e)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",e)))}}),i.Map.include(i.Path.SVG&&!e.L_PREFER_CANVAS||!i.Browser.canvas?{}:{_initPathRoot:function(){var e,n=this._pathRoot;n||(n=this._pathRoot=t.createElement("canvas"),n.style.position="absolute",e=this._canvasCtx=n.getContext("2d"),e.lineCap="round",e.lineJoin="round",this._panes.overlayPane.appendChild(n),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport -())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var e=this._pathViewport,t=e.min,n=e.max.subtract(t),r=this._pathRoot;i.DomUtil.setPosition(r,t),r.width=n.x,r.height=n.y,r.getContext("2d").translate(-t.x,-t.y)}}}),i.LineUtil={simplify:function(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=this._reducePoints(e,n),e=this._simplifyDP(e,n)},pointToSegmentDistance:function(e,t,n){return Math.sqrt(this._sqClosestPointOnSegment(e,t,n,!0))},closestPointOnSegment:function(e,t,n){return this._sqClosestPointOnSegment(e,t,n)},_simplifyDP:function(e,t){var r=e.length,i=typeof Uint8Array!=n+""?Uint8Array:Array,s=new i(r);s[0]=s[r-1]=1,this._simplifyDPStep(e,s,t,0,r-1);var o,u=[];for(o=0;r>o;o++)s[o]&&u.push(e[o]);return u},_simplifyDPStep:function(e,t,n,r,i){var s,o,u,a=0;for(o=r+1;i-1>=o;o++)u=this._sqClosestPointOnSegment(e[o],e[r],e[i],!0),u>a&&(s=o,a=u);a>n&&(t[s]=1,this._simplifyDPStep(e,t,n,r,s),this._simplifyDPStep(e,t,n,s,i))},_reducePoints: -function(e,t){for(var n=[e[0]],r=1,i=0,s=e.length;s>r;r++)this._sqDist(e[r],e[i])>t&&(n.push(e[r]),i=r);return s-1>i&&n.push(e[s-1]),n},clipSegment:function(e,t,n,r){var i,s,o,u=r?this._lastCode:this._getBitCode(e,n),a=this._getBitCode(t,n);for(this._lastCode=a;;){if(!(u|a))return[e,t];if(u&a)return!1;i=u||a,s=this._getEdgeIntersection(e,t,i,n),o=this._getBitCode(s,n),i===u?(e=s,u=o):(t=s,a=o)}},_getEdgeIntersection:function(e,t,n,r){var s=t.x-e.x,u=t.y-e.y,a=r.min,f=r.max;return 8&n?new i.Point(e.x+s*(f.y-e.y)/u,f.y):4&n?new i.Point(e.x+s*(a.y-e.y)/u,a.y):2&n?new i.Point(f.x,e.y+u*(f.x-e.x)/s):1&n?new i.Point(a.x,e.y+u*(a.x-e.x)/s):void 0},_getBitCode:function(e,t){var n=0;return e.xt.max.x&&(n|=2),e.yt.max.y&&(n|=8),n},_sqDist:function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},_sqClosestPointOnSegment:function(e,t,n,r){var s,u=t.x,a=t.y,f=n.x-u,l=n.y-a,c=f*f+l*l;return c>0&&(s=((e.x-u)*f+(e.y-a)*l)/c,s>1?(u=n.x,a=n.y):s>0&&(u+=f*s,a+=l*s)),f=e.x- -u,l=e.y-a,r?f*f+l*l:new i.Point(u,a)}},i.Polyline=i.Path.extend({initialize:function(e,t){i.Path.prototype.initialize.call(this,t),this._latlngs=this._convertLatLngs(e)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var e=0,t=this._latlngs.length;t>e;e++)this._originalPoints[e]=this._map.latLngToLayerPoint(this._latlngs[e])},getPathString:function(){for(var e=0,t=this._parts.length,n="";t>e;e++)n+=this._getPathPartStr(this._parts[e]);return n},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._latlngs=this._convertLatLngs(e),this.redraw()},addLatLng:function(e){return this._latlngs.push(i.latLng(e)),this.redraw()},spliceLatLngs:function(){var e=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),e},closestLayerPoint:function(e){for(var t,n,r=1/0,s=this._parts,u=null,a=0,f=s.length;f>a;a++)for(var l=s[a],c=1,h=l.length;h>c;c++){t=l[c-1],n=l[c];var p=i.LineUtil._sqClosestPointOnSegment -(e,t,n,!0);r>p&&(r=p,u=i.LineUtil._sqClosestPointOnSegment(e,t,n))}return u&&(u.distance=Math.sqrt(r)),u},getBounds:function(){return new i.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(e,t){var n,r,s=t?e:[];for(n=0,r=e.length;r>n;n++){if(i.Util.isArray(e[n])&&"number"!=typeof e[n][0])return;s[n]=i.latLng(e[n])}return s},_initEvents:function(){i.Path.prototype._initEvents.call(this)},_getPathPartStr:function(e){for(var t,n=i.Path.VML,r=0,s=e.length,u="";s>r;r++)t=e[r],n&&t._round(),u+=(r?"L":"M")+t.x+" "+t.y;return u},_clipPoints:function(){var e,t,n,r=this._originalPoints,s=r.length;if(this.options.noClip)return this._parts=[r],void 0;this._parts=[];var u=this._parts,a=this._map._pathViewport,f=i.LineUtil;for(e=0,t=0;s-1>e;e++)n=f.clipSegment(r[e],r[e+1],a,e),n&&(u[t]=u[t]||[],u[t].push(n[0]),(n[1]!==r[e+1]||e===s-2)&&(u[t].push(n[1]),t++))},_simplifyPoints:function(){for(var e=this._parts,t=i.LineUtil,n=0,r=e.length;r>n;n++)e[n]=t.simplify(e[n],this.options.smoothFactor)}, -_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),i.Path.prototype._updatePath.call(this))}}),i.polyline=function(e,t){return new i.Polyline(e,t)},i.PolyUtil={},i.PolyUtil.clipPolygon=function(e,t){var n,r,s,u,a,f,l,c,h,p=[1,4,2,8],d=i.LineUtil;for(r=0,l=e.length;l>r;r++)e[r]._code=d._getBitCode(e[r],t);for(u=0;4>u;u++){for(c=p[u],n=[],r=0,l=e.length,s=l-1;l>r;s=r++)a=e[r],f=e[s],a._code&c?f._code&c||(h=d._getEdgeIntersection(f,a,c,t),h._code=d._getBitCode(h,t),n.push(h)):(f._code&c&&(h=d._getEdgeIntersection(f,a,c,t),h._code=d._getBitCode(h,t),n.push(h)),n.push(a));e=n}return e},i.Polygon=i.Polyline.extend({options:{fill:!0},initialize:function(e,t){var n,r,s;if(i.Polyline.prototype.initialize.call(this,e,t),e&&i.Util.isArray(e[0])&&"number"!=typeof e[0][0])for(this._latlngs=this._convertLatLngs(e[0]),this._holes=e.slice(1),n=0,r=this._holes.length;r>n;n++)s=this._holes[n]=this._convertLatLngs(this._holes[n]),s[0].equals(s[s.length-1])&&s.pop();e=this._latlngs -,e.length>=2&&e[0].equals(e[e.length-1])&&e.pop()},projectLatlngs:function(){if(i.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var e,t,n,r;for(e=0,n=this._holes.length;n>e;e++)for(this._holePoints[e]=[],t=0,r=this._holes[e].length;r>t;t++)this._holePoints[e][t]=this._map.latLngToLayerPoint(this._holes[e][t])}},_clipPoints:function(){var e=this._originalPoints,t=[];if(this._parts=[e].concat(this._holePoints),!this.options.noClip){for(var n=0,r=this._parts.length;r>n;n++){var s=i.PolyUtil.clipPolygon(this._parts[n],this._map._pathViewport);s.length&&t.push(s)}this._parts=t}},_getPathPartStr:function(e){var t=i.Polyline.prototype._getPathPartStr.call(this,e);return t+(i.Browser.svg?"z":"x")}}),i.polygon=function(e,t){return new i.Polygon(e,t)},function(){function e(e){return i.FeatureGroup.extend({initialize:function(e,t){this._layers={},this._options=t,this.setLatLngs(e)},setLatLngs:function(t){var n=0,r=t.length;for(this.eachLayer(function(e){r>n?e.setLatLngs -(t[n++]):this.removeLayer(e)},this);r>n;)this.addLayer(new e(t[n++],this._options));return this}})}i.MultiPolyline=e(i.Polyline),i.MultiPolygon=e(i.Polygon),i.multiPolyline=function(e,t){return new i.MultiPolyline(e,t)},i.multiPolygon=function(e,t){return new i.MultiPolygon(e,t)}}(),i.Rectangle=i.Polygon.extend({initialize:function(e,t){i.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=i.latLngBounds(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}}),i.rectangle=function(e,t){return new i.Rectangle(e,t)},i.Circle=i.Path.extend({initialize:function(e,t,n){i.Path.prototype.initialize.call(this,n),this._latlng=i.latLng(e),this._mRadius=t},options:{fill:!0},setLatLng:function(e){return this._latlng=i.latLng(e),this.redraw()},setRadius:function(e){return this._mRadius=e,this.redraw()},projectLatlngs:function(){var e=this._getLngRadius(),t=this._latlng -,n=this._map.latLngToLayerPoint([t.lat,t.lng-e]);this._point=this._map.latLngToLayerPoint(t),this._radius=Math.max(this._point.x-n.x,1)},getBounds:function(){var e=this._getLngRadius(),t=360*(this._mRadius/40075017),n=this._latlng;return new i.LatLngBounds([n.lat-t,n.lng-e],[n.lat+t,n.lng+e])},getLatLng:function(){return this._latlng},getPathString:function(){var e=this._point,t=this._radius;return this._checkIfEmpty()?"":i.Browser.svg?"M"+e.x+","+(e.y-t)+"A"+t+","+t+",0,1,1,"+(e.x-.1)+","+(e.y-t)+" z":(e._round(),t=Math.round(t),"AL "+e.x+","+e.y+" "+t+","+t+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(i.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var e=this._map._pathViewport,t=this._radius,n=this._point;return n.x-t>e.max.x||n.y-t>e.max.y||n.x+tn;n++)for(l=this._parts[n],r=0,a=l.length,s=a-1;a>r;s=r++)if((t||0!==r)&&(f=i.LineUtil.pointToSegmentDistance(e,l[s],l[r]),c>=f))return!0;return!1}}:{}),i.Polygon.include(i.Path.CANVAS?{_containsPoint:function(e){var t,n,r,s,u,a,f,l,c=!1;if(i.Polyline.prototype._containsPoint.call(this,e,!0))return!0;for(s=0,f=this._parts.length -;f>s;s++)for(t=this._parts[s],u=0,l=t.length,a=l-1;l>u;a=u++)n=t[u],r=t[a],n.y>e.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(c=!c);return c}}:{}),i.Circle.include(i.Path.CANVAS?{_drawPath:function(){var e=this._point;this._ctx.beginPath(),this._ctx.arc(e.x,e.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(e){var t=this._point,n=this.options.stroke?this.options.weight/2:0;return e.distanceTo(t)<=this._radius+n}}:{}),i.CircleMarker.include(i.Path.CANVAS?{_updateStyle:function(){i.Path.prototype._updateStyle.call(this)}}:{}),i.GeoJSON=i.FeatureGroup.extend({initialize:function(e,t){i.setOptions(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,n,r=i.Util.isArray(e)?e:e.features;if(r){for(t=0,n=r.length;n>t;t++)(r[t].geometries||r[t].geometry||r[t].features)&&this.addData(r[t]);return this}var s=this.options;if(!s.filter||s.filter(e)){var u=i.GeoJSON.geometryToLayer(e,s.pointToLayer,s.coordsToLatLng);return u.feature=e,u.defaultOptions=u.options,this.resetStyle -(u),s.onEachFeature&&s.onEachFeature(e,u),this.addLayer(u)}},resetStyle:function(e){var t=this.options.style;t&&(i.Util.extend(e.options,e.defaultOptions),this._setLayerStyle(e,t))},setStyle:function(e){this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(e,t){"function"==typeof t&&(t=t(e.feature)),e.setStyle&&e.setStyle(t)}}),i.extend(i.GeoJSON,{geometryToLayer:function(e,t,n){var r,s,u,a,f,l="Feature"===e.type?e.geometry:e,c=l.coordinates,h=[];switch(n=n||this.coordsToLatLng,l.type){case"Point":return r=n(c),t?t(e,r):new i.Marker(r);case"MultiPoint":for(u=0,a=c.length;a>u;u++)r=n(c[u]),f=t?t(e,r):new i.Marker(r),h.push(f);return new i.FeatureGroup(h);case"LineString":return s=this.coordsToLatLngs(c,0,n),new i.Polyline(s);case"Polygon":return s=this.coordsToLatLngs(c,1,n),new i.Polygon(s);case"MultiLineString":return s=this.coordsToLatLngs(c,1,n),new i.MultiPolyline(s);case"MultiPolygon":return s=this.coordsToLatLngs(c,2,n),new i.MultiPolygon(s);case"GeometryCollection" -:for(u=0,a=l.geometries.length;a>u;u++)f=this.geometryToLayer({geometry:l.geometries[u],type:"Feature",properties:e.properties},t),h.push(f);return new i.FeatureGroup(h);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(e){return new i.LatLng(e[1],e[0])},coordsToLatLngs:function(e,t,n){var r,i,s,o=[];for(i=0,s=e.length;s>i;i++)r=t?this.coordsToLatLngs(e[i],t-1,n):(n||this.coordsToLatLng)(e[i]),o.push(r);return o},latLngToCoords:function(e){return[e.lng,e.lat]},latLngsToCoords:function(e){for(var t=[],n=0,r=e.length;r>n;n++)t.push(i.GeoJSON.latLngToCoords(e[n]));return t}}),i.Marker.include({toGeoJSON:function(){return{type:"Point",coordinates:i.GeoJSON.latLngToCoords(this.getLatLng())}}}),i.Polyline.include({toGeoJSON:function(){return{type:"LineString",coordinates:i.GeoJSON.latLngsToCoords(this.getLatLngs())}}}),i.Polygon.include({toGeoJSON:function(){var e,t,n,r=[i.GeoJSON.latLngsToCoords(this.getLatLngs())];if(r[0].push(r[0][0]),this._holes)for(e=0,t=this._holes -.length;t>e;e++)n=i.GeoJSON.latLngsToCoords(this._holes[e]),n.push(n[0]),r.push(n);return{type:"Polygon",coordinates:r}}}),function(){function e(e,t){e.include({toGeoJSON:function(){var e=[];return this.eachLayer(function(t){e.push(t.toGeoJSON().coordinates)}),{type:t,coordinates:e}}})}e(i.MultiPolyline,"MultiLineString"),e(i.MultiPolygon,"MultiPolygon")}(),i.LayerGroup.include({toGeoJSON:function(){var e=[];return this.eachLayer(function(t){t.toGeoJSON&&e.push(t.toGeoJSON())}),{type:"GeometryCollection",geometries:e}}}),i.geoJson=function(e,t){return new i.GeoJSON(e,t)},i.DomEvent={addListener:function(e,t,n,r){var s,u,a,f=i.stamp(n),l="_leaflet_"+t+f;return e[l]?this:(s=function(t){return n.call(r||e,t||i.DomEvent._getEvent())},i.Browser.msTouch&&0===t.indexOf("touch")?this.addMsTouchListener(e,t,s,f):(i.Browser.touch&&"dblclick"===t&&this.addDoubleTapListener&&this.addDoubleTapListener(e,s,f),"addEventListener"in e?"mousewheel"===t?(e.addEventListener("DOMMouseScroll",s,!1),e.addEventListener -(t,s,!1)):"mouseenter"===t||"mouseleave"===t?(u=s,a="mouseenter"===t?"mouseover":"mouseout",s=function(t){return i.DomEvent._checkMouse(e,t)?u(t):void 0},e.addEventListener(a,s,!1)):"click"===t&&i.Browser.android?(u=s,s=function(e){return i.DomEvent._filterClick(e,u)},e.addEventListener(t,s,!1)):e.addEventListener(t,s,!1):"attachEvent"in e&&e.attachEvent("on"+t,s),e[l]=s,this))},removeListener:function(e,t,n){var r=i.stamp(n),s="_leaflet_"+t+r,u=e[s];return u?(i.Browser.msTouch&&0===t.indexOf("touch")?this.removeMsTouchListener(e,t,r):i.Browser.touch&&"dblclick"===t&&this.removeDoubleTapListener?this.removeDoubleTapListener(e,r):"removeEventListener"in e?"mousewheel"===t?(e.removeEventListener("DOMMouseScroll",u,!1),e.removeEventListener(t,u,!1)):"mouseenter"===t||"mouseleave"===t?e.removeEventListener("mouseenter"===t?"mouseover":"mouseout",u,!1):e.removeEventListener(t,u,!1):"detachEvent"in e&&e.detachEvent("on"+t,u),e[s]=null,this):this},stopPropagation:function(e){return e.stopPropagation? -e.stopPropagation():e.cancelBubble=!0,this},disableClickPropagation:function(e){for(var t=i.DomEvent.stopPropagation,n=i.Draggable.START.length-1;n>=0;n--)i.DomEvent.addListener(e,i.Draggable.START[n],t);return i.DomEvent.addListener(e,"click",t).addListener(e,"dblclick",t)},preventDefault:function(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this},stop:function(e){return i.DomEvent.preventDefault(e).stopPropagation(e)},getMousePosition:function(e,n){var r=t.body,s=t.documentElement,u=e.pageX?e.pageX:e.clientX+r.scrollLeft+s.scrollLeft,a=e.pageY?e.pageY:e.clientY+r.scrollTop+s.scrollTop,f=new i.Point(u,a);return n?f._subtract(i.DomUtil.getViewportOffset(n)):f},getWheelDelta:function(e){var t=0;return e.wheelDelta&&(t=e.wheelDelta/120),e.detail&&(t=-e.detail/3),t},_checkMouse:function(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch(r){return!1}return n!==e},_getEvent:function(){var t=e.event;if(!t)for(var n=arguments.callee.caller;n&&(t= -n.arguments[0],!t||e.Event!==t.constructor);)n=n.caller;return t},_filterClick:function(e,t){var n=e.timeStamp||e.originalEvent.timeStamp,r=i.DomEvent._lastClick&&n-i.DomEvent._lastClick;return r&&r>100&&400>r?(i.DomEvent.stop(e),void 0):(i.DomEvent._lastClick=n,t(e))}},i.DomEvent.on=i.DomEvent.addListener,i.DomEvent.off=i.DomEvent.removeListener,i.Draggable=i.Class.extend({includes:i.Mixin.Events,statics:{START:i.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"},TAP_TOLERANCE:15},initialize:function(e,t,n){this._element=e,this._dragStartTarget=t||e,this._longPress=n&&!i.Browser.msTouch},enable:function(){if(!this._enabled){for(var e=i.Draggable.START.length-1;e>=0;e--)i.DomEvent.on(this._dragStartTarget,i.Draggable.START[e],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var e=i.Draggable.START.length-1 -;e>=0;e--)i.DomEvent.off(this._dragStartTarget,i.Draggable.START[e],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(e){if(!e.shiftKey&&(1===e.which||1===e.button||e.touches)&&(i.DomEvent.preventDefault(e).stopPropagation(e),!i.Draggable._disabled)){this._simulateClick=!0;var n=e.touches&&e.touches.length||0;if(n>1)return this._simulateClick=!1,clearTimeout(this._longPressTimeout),void 0;var r=1===n?e.touches[0]:e,s=r.target;i.Browser.touch&&"a"===s.tagName.toLowerCase()&&i.DomUtil.addClass(s,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new i.Point(r.clientX,r.clientY),this._startPos=this._newPos=i.DomUtil.getPosition(this._element),1===n&&i.Browser.touch&&this._longPress&&(this._longPressTimeout=setTimeout(i.bind(function(){var e=this._newPos&&this._newPos.distanceTo(this._startPos)||0;e1)){var n=e.touches&&1===e.touches.length?e.touches[0]:e,r=new i.Point(n.clientX,n.clientY),s=r.subtract(this._startPoint);(s.x||s.y)&&(i.DomEvent.preventDefault(e),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=i.DomUtil.getPosition(this._element).subtract(s),i.Browser.touch||(i.DomUtil.disableTextSelection(),i.DomUtil.addClass(t.body,"leaflet-dragging"))),this._newPos=this._startPos.add(s),this._moving=!0,i.Util.cancelAnimFrame(this._animRequest),this._animRequest=i.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),i.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(e){var n,r,s,u,a;clearTimeout(this._longPressTimeout),this._simulateClick&&e.changedTouches&&(s=this._newPos&&this._newPos.distanceTo(this._startPos)||0,n=e.changedTouches[0],r=n.target -,"a"===r.tagName.toLowerCase()&&i.DomUtil.removeClass(r,"leaflet-active"),s200&&(this._positions.shift(),this._times -.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var e=this._map.getSize()._divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,s=(r+t+n)%e-t-n,o=Math.abs(i+n)t.inertiaThreshold||!this._positions[0];if(e.fire("dragend"),r)e.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),u=(this._lastTime+n-this._times[0])/1e3,a=t.easeLinearity,f=s.multiplyBy(a/u),l=f.distanceTo([0,0]),c=Math.min(t.inertiaMaxSpeed,l),h=f.multiplyBy(c/l),p=c/(t.inertiaDeceleration*a),d=h.multiplyBy(-p/2).round();d.x&&d.y?i.Util.requestAnimFrame(function(){e.panBy(d,{duration:p,easeLinearity:a,noMoveStart:!0})}):e.fire("moveend" -)}}}),i.Map.addInitHook("addHandler","dragging",i.Map.Drag),i.Map.mergeOptions({doubleClickZoom:!0}),i.Map.DoubleClickZoom=i.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(e){this.setZoomAround(e.containerPoint,this._zoom+1)}}),i.Map.addInitHook("addHandler","doubleClickZoom",i.Map.DoubleClickZoom),i.Map.mergeOptions({scrollWheelZoom:!0}),i.Map.ScrollWheelZoom=i.Handler.extend({addHooks:function(){i.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){i.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(e){var t=i.DomEvent.getWheelDelta(e);this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+(new Date));var n=Math.max(40-(+(new Date)-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(i.bind -(this._performZoom,this),n),i.DomEvent.preventDefault(e),i.DomEvent.stopPropagation(e)},_performZoom:function(){var e=this._map,t=this._delta,n=e.getZoom();t=t>0?Math.ceil(t):Math.floor(t),t=Math.max(Math.min(t,4),-4),t=e._limitZoom(n+t)-n,this._delta=0,this._startTime=null,t&&e.setZoomAround(this._lastMousePos,n+t)}}),i.Map.addInitHook("addHandler","scrollWheelZoom",i.Map.ScrollWheelZoom),i.extend(i.DomEvent,{_touchstart:i.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:i.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(e,n,r){function s(e){var t;if(i.Browser.msTouch?(v.push(e.pointerId),t=v.length):t=e.touches.length,!(t>1)){var n=Date.now(),r=n-(a||n);f=e.touches?e.touches[0]:e,l=r>0&&c>=r,a=n}}function u(e){if(i.Browser.msTouch){var t=v.indexOf(e.pointerId);if(-1===t)return;v.splice(t,1)}if(l){if(i.Browser.msTouch){var r,s={};for(var u in f)r=f[u],s[u]="function"==typeof r?r.bind(f):r;f=s}f.type="dblclick",n(f),a=null}}var a,f,l=!1,c=250,h="_leaflet_",p= -this._touchstart,d=this._touchend,v=[];e[h+p+r]=s,e[h+d+r]=u;var m=i.Browser.msTouch?t.documentElement:e;return e.addEventListener(p,s,!1),m.addEventListener(d,u,!1),i.Browser.msTouch&&m.addEventListener("MSPointerCancel",u,!1),this},removeDoubleTapListener:function(e,n){var r="_leaflet_";return e.removeEventListener(this._touchstart,e[r+this._touchstart+n],!1),(i.Browser.msTouch?t.documentElement:e).removeEventListener(this._touchend,e[r+this._touchend+n],!1),i.Browser.msTouch&&t.documentElement.removeEventListener("MSPointerCancel",e[r+this._touchend+n],!1),this}}),i.extend(i.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(e,t,n,r){switch(t){case"touchstart":return this.addMsTouchListenerStart(e,t,n,r);case"touchend":return this.addMsTouchListenerEnd(e,t,n,r);case"touchmove":return this.addMsTouchListenerMove(e,t,n,r);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(e,n,r,i){var s="_leaflet_",o=this._msTouches,u=function(e){for(var t=!1 -,n=0;n0?Math.ceil(u):Math.floor(u),f=e._limitZoom(s+a),l=e.getZoomScale(f)/this._scale;e._animateZoom(r,f,n,l)},_getScaleOrigin:function(){var e=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(e)}}),i.Map.addInitHook("addHandler","touchZoom",i.Map.TouchZoom),i.Map.mergeOptions({boxZoom:!0}),i.Map.BoxZoom=i.Handler.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane},addHooks:function(){i.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks -:function(){i.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(e){return!e.shiftKey||1!==e.which&&1!==e.button?!1:(i.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(e),this._box=i.DomUtil.create("div","leaflet-zoom-box",this._pane),i.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",i.DomEvent.on(t,"mousemove",this._onMouseMove,this).on(t,"mouseup",this._onMouseUp,this).on(t,"keydown",this._onKeyDown,this).preventDefault(e),this._map.fire("boxzoomstart"),void 0)},_onMouseMove:function(e){var t=this._startLayerPoint,n=this._box,r=this._map.mouseEventToLayerPoint(e),s=r.subtract(t),u=new i.Point(Math.min(r.x,t.x),Math.min(r.y,t.y));i.DomUtil.setPosition(n,u),n.style.width=Math.max(0,Math.abs(s.x)-4)+"px",n.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._pane.removeChild(this._box),this._container.style.cursor="",i.DomUtil.enableTextSelection(),i.DomEvent -.off(t,"mousemove",this._onMouseMove).off(t,"mouseup",this._onMouseUp).off(t,"keydown",this._onKeyDown)},_onMouseUp:function(e){this._finish();var t=this._map,n=t.mouseEventToLayerPoint(e);if(!this._startLayerPoint.equals(n)){var r=new i.LatLngBounds(t.layerPointToLatLng(this._startLayerPoint),t.layerPointToLatLng(n));t.fitBounds(r),t.fire("boxzoomend",{boxZoomBounds:r})}},_onKeyDown:function(e){27===e.keyCode&&this._finish()}}),i.Map.addInitHook("addHandler","boxZoom",i.Map.BoxZoom),i.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),i.Map.Keyboard=i.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(e){this._map=e,this._setPanOffset(e.options.keyboardPanOffset),this._setZoomOffset(e.options.keyboardZoomOffset)},addHooks:function(){var e=this._map._container;-1===e.tabIndex&&(e.tabIndex="0"),i.DomEvent.on(e,"focus",this._onFocus,this).on(e,"blur",this._onBlur,this).on(e,"mousedown",this -._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var e=this._map._container;i.DomEvent.off(e,"focus",this._onFocus,this).off(e,"blur",this._onBlur,this).off(e,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var n=t.body,r=t.documentElement,i=n.scrollTop||r.scrollTop,s=n.scrollTop||r.scrollLeft;this._map._container.focus(),e.scrollTo(s,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(e){var t,n,r=this._panKeys={},i=this.keyCodes;for(t=0,n=i.left.length;n>t;t++)r[i.left[t]]=[-1*e,0];for(t=0,n=i.right.length;n>t;t++)r[i.right[t]]=[e,0];for(t=0,n=i.down.length;n>t;t++)r[i.down[t]]=[0,e];for(t=0,n=i.up.length;n>t;t++)r[i.up[t]]=[0,-1*e]},_setZoomOffset:function(e){var t,n,r=this._zoomKeys={},i=this -.keyCodes;for(t=0,n=i.zoomIn.length;n>t;t++)r[i.zoomIn[t]]=e;for(t=0,n=i.zoomOut.length;n>t;t++)r[i.zoomOut[t]]=-e},_addHooks:function(){i.DomEvent.on(t,"keydown",this._onKeyDown,this)},_removeHooks:function(){i.DomEvent.off(t,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){var t=e.keyCode,n=this._map;if(t in this._panKeys)n.panBy(this._panKeys[t]),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds);else{if(!(t in this._zoomKeys))return;n.setZoom(n.getZoom()+this._zoomKeys[t])}i.DomEvent.stop(e)}}),i.Map.addInitHook("addHandler","keyboard",i.Map.Keyboard),i.Handler.MarkerDrag=i.Handler.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=new i.Draggable(e,e)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable()},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart).off("drag",this._onDrag). -off("dragend",this._onDragEnd),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var e=this._marker,t=e._shadow,n=i.DomUtil.getPosition(e._icon),r=e._map.layerPointToLatLng(n);t&&i.DomUtil.setPosition(t,n),e._latlng=r,e.fire("move",{latlng:r}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),i.Control=i.Class.extend({options:{position:"topright"},initialize:function(e){i.setOptions(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return i.DomUtil.addClass(t,"leaflet-control"),-1!==n.indexOf("bottom")?r.insertBefore(t, -r.firstChild):r.appendChild(t),this},removeFrom:function(e){var t=this.getPosition(),n=e._controlCorners[t];return n.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(e),this}}),i.control=function(e){return new i.Control(e)},i.Map.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.removeFrom(this),this},_initControlPos:function(){function e(e,s){var u=n+e+" "+n+s;t[e+s]=i.DomUtil.create("div",u,r)}var t=this._controlCorners={},n="leaflet-",r=this._controlContainer=i.DomUtil.create("div",n+"control-container",this._container);e("top","left"),e("top","right"),e("bottom","left"),e("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),i.Control.Zoom=i.Control.extend({options:{position:"topleft"},onAdd:function(e){var t="leaflet-control-zoom",n=i.DomUtil.create("div",t+" leaflet-bar");return this._map=e,this._zoomInButton=this._createButton("+","Zoom in",t+"-in",n,this._zoomIn,this -),this._zoomOutButton=this._createButton("-","Zoom out",t+"-out",n,this._zoomOut,this),e.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(e){this._map.zoomIn(e.shiftKey?3:1)},_zoomOut:function(e){this._map.zoomOut(e.shiftKey?3:1)},_createButton:function(e,t,n,r,s,u){var a=i.DomUtil.create("a",n,r);a.innerHTML=e,a.href="#",a.title=t;var f=i.DomEvent.stopPropagation;return i.DomEvent.on(a,"click",f).on(a,"mousedown",f).on(a,"dblclick",f).on(a,"click",i.DomEvent.preventDefault).on(a,"click",s,u),a},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";i.DomUtil.removeClass(this._zoomInButton,t),i.DomUtil.removeClass(this._zoomOutButton,t),e._zoom===e.getMinZoom()&&i.DomUtil.addClass(this._zoomOutButton,t),e._zoom===e.getMaxZoom()&&i.DomUtil.addClass(this._zoomInButton,t)}}),i.Map.mergeOptions({zoomControl:!0}),i.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new -i.Control.Zoom,this.addControl(this.zoomControl))}),i.control.zoom=function(e){return new i.Control.Zoom(e)},i.Control.Attribution=i.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(e){i.setOptions(this,e),this._attributions={}},onAdd:function(e){return this._container=i.DomUtil.create("div","leaflet-control-attribution"),i.DomEvent.disableClickPropagation(this._container),e.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(e){e.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):void 0},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this -._update()),this):void 0},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(" | ")}},_onLayerAdd:function(e){e.layer.getAttribution&&this.addAttribution(e.layer.getAttribution())},_onLayerRemove:function(e){e.layer.getAttribution&&this.removeAttribution(e.layer.getAttribution())}}),i.Map.mergeOptions({attributionControl:!0}),i.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new i.Control.Attribution).addTo(this))}),i.control.attribution=function(e){return new i.Control.Attribution(e)},i.Control.Scale=i.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(e){this._map=e;var t="leaflet-control-scale",n=i.DomUtil.create("div",t),r=this.options;return this._addScales(r,t,n),e.on(r.updateWhenIdle?"moveend":"move",this -._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=i.DomUtil.create("div",t+"-line",n)),e.imperial&&(this._iScale=i.DomUtil.create("div",t+"-line",n))},_update:function(){var e=this._map.getBounds(),t=e.getCenter().lat,n=6378137*Math.PI*Math.cos(t*Math.PI/180),r=n*(e.getNorthEast().lng-e.getSouthWest().lng)/180,i=this._map.getSize(),s=this.options,o=0;i.x>0&&(o=r*(s.maxWidth/i.x)),this._updateScales(s,o)},_updateScales:function(e,t){e.metric&&t&&this._updateMetric(t),e.imperial&&t&&this._updateImperial(t)},_updateMetric:function(e){var t=this._getRoundNum(e);this._mScale.style.width=this._getScaleWidth(t/e)+"px",this._mScale.innerHTML=1e3>t?t+" m":t/1e3+" km"},_updateImperial:function(e){var t,n,r,i=3.2808399*e,s=this._iScale;i>5280?(t=i/5280,n=this._getRoundNum(t),s.style.width=this._getScaleWidth(n/t)+"px",s.innerHTML=n+" mi"):(r=this._getRoundNum -(i),s.style.width=this._getScaleWidth(r/i)+"px",s.innerHTML=r+" ft")},_getScaleWidth:function(e){return Math.round(this.options.maxWidth*e)-10},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),i.control.scale=function(e){return new i.Control.Scale(e)},i.Control.Layers=i.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(e,t,n){i.setOptions(this,n),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var r in e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){return this._initLayout(),this._update(),e.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(e){e.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._update(),this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._update -(),this},removeLayer:function(e){var t=i.stamp(e);return delete this._layers[t],this._update(),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=i.DomUtil.create("div",e);t.setAttribute("aria-haspopup",!0),i.Browser.touch?i.DomEvent.on(t,"click",i.DomEvent.stopPropagation):(i.DomEvent.disableClickPropagation(t),i.DomEvent.on(t,"mousewheel",i.DomEvent.stopPropagation));var n=this._form=i.DomUtil.create("form",e+"-list");if(this.options.collapsed){i.DomEvent.on(t,"mouseover",this._expand,this).on(t,"mouseout",this._collapse,this);var r=this._layersLink=i.DomUtil.create("a",e+"-toggle",t);r.href="#",r.title="Layers",i.Browser.touch?i.DomEvent.on(r,"click",i.DomEvent.stopPropagation).on(r,"click",i.DomEvent.preventDefault).on(r,"click",this._expand,this):i.DomEvent.on(r,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=i.DomUtil.create("div",e+"-base",n),this._separator=i.DomUtil.create("div",e+"-separator" -,n),this._overlaysList=i.DomUtil.create("div",e+"-overlays",n),t.appendChild(n)},_addLayer:function(e,t,n){var r=i.stamp(e);this._layers[r]={layer:e,name:t,overlay:n},this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var e,t,n=!1,r=!1;for(e in this._layers)t=this._layers[e],this._addItem(t),r=r||t.overlay,n=n||!t.overlay;this._separator.style.display=r&&n?"":"none"}},_onLayerChange:function(e){var t=i.stamp(e.layer);this._layers[t]&&!this._handlingClick&&this._update()},_createRadioElement:function(e,n){var r='e;e++)t=i[e],n=this._layers[t.layerId],t.checked&&!this._map.hasLayer(n.layer)?(this._map.addLayer(n.layer),n.overlay?this._map.fire("overlayadd",{layer:n}):r=n.layer):!t.checked&&this._map.hasLayer(n.layer)&&(this._map.removeLayer(n.layer),this._map.fire("overlayremove",{layer:n}));r&&(this._map.setZoom(this._map.getZoom()),this._map.fire("baselayerchange",{layer:r})),this._handlingClick=!1},_expand:function(){i.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className -.replace(" leaflet-control-layers-expanded","")}}),i.control.layers=function(e,t,n){return new i.Control.Layers(e,t,n)},i.PosAnimation=i.Class.extend({includes:i.Mixin.Events,run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._newPos=t,this.fire("start"),e.style[i.DomUtil.TRANSITION]="all "+(n||.25)+"s cubic-bezier(0,0,"+(r||.5)+",1)",i.DomEvent.on(e,i.DomUtil.TRANSITION_END,this._onTransitionEnd,this),i.DomUtil.setPosition(e,t),i.Util.falseFn(e.offsetWidth),this._stepTimer=setInterval(i.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(i.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),i.Util.falseFn(this._el.offsetWidth))},_onStep:function(){this._el._leaflet_pos=this._getPos(),this.fire("step")},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var t,n,r,s=this._el,u=e.getComputedStyle(s);return i.Browser.any3d?(r=u[i.DomUtil.TRANSFORM].match(this._transformRe),t=parseFloat(r[1]),n=parseFloat(r[2] -)):(t=parseFloat(u.left),n=parseFloat(u.top)),new i.Point(t,n,!0)},_onTransitionEnd:function(){i.DomEvent.off(this._el,i.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[i.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),i.Map.include({setView:function(e,t,r){if(t=this._limitZoom(t),e=i.latLng(e),r=r||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!r.reset&&r!==!0){r.animate!==n&&(r.zoom=i.extend({animate:r.animate},r.zoom),r.pan=i.extend({animate:r.animate},r.pan));var s=this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,r.zoom):this._tryAnimatedPan(e,r.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(e,t),this},panBy:function(e,t){if(e=i.point(e).round(),t=t||{},!e.x&&!e.y)return this;if(this._panAnim||(this._panAnim=new i.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd} -,this)),t.noMoveStart||this.fire("movestart"),t.animate!==!1){i.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(e);this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){i.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._floor();return(t&&t.animate)===!0||this.getSize().contains(n)?(this.panBy(n,t),!0):!1}}),i.PosAnimation=i.DomUtil.TRANSITION?i.PosAnimation:i.PosAnimation.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=i.DomUtil.getPosition(e),this._offset=t.subtract(this._startPos),this._startTime=+(new Date),this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this. -_complete())},_animate:function(){this._animId=i.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var e=+(new Date)-this._startTime,t=1e3*this._duration;t>e?this._runFrame(this._easeOut(e/t)):(this._runFrame(1),this._complete())},_runFrame:function(e){var t=this._startPos.add(this._offset.multiplyBy(e));i.DomUtil.setPosition(this._el,t),this.fire("step")},_complete:function(){i.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(e){return 1-Math.pow(1-e,this._easeOutPower)}}),i.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),i.DomUtil.TRANSITION&&i.Map.addInitHook(function(){i.DomEvent.on(this._mapPane,i.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),i.Map.include(i.DomUtil.TRANSITION?{_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n=n||{},!this.options.zoomAnimation||n.animate===!1||!i.DomUtil.TRANSITION|| -i.Browser.android23||i.Browser.mobileOpera||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),s=this._getCenterOffset(e)._divideBy(1-1/r),u=this._getCenterLayerPoint()._add(s);return n.animate===!0||this.getSize().contains(s)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(e,t,u,r),!0):!1},_animateZoom:function(e,t,n,r,s){this._animatingZoom=!0,i.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=e,this._animateToZoom=t,i.Draggable&&(i.Draggable._disabled=!0),this.fire("zoomanim",{center:e,zoom:t,origin:n,scale:r,delta:s})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,i.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),i.Draggable&&(i.Draggable._disabled=!1)}}:{}),i.TileLayer.include({_animateZoom:function(e){var t=!1;this._animating||(this._animating=!0,t=!0),t&&this._prepareBgBuffer();var n=this._bgBuffer;t&&(clearTimeout(this. -_clearBgBufferTimer),i.Util.falseFn(n.offsetWidth));var r=i.DomUtil.TRANSFORM,s=e.delta?i.DomUtil.getTranslateString(e.delta):n.style[r];n.style[r]=s+" "+i.DomUtil.getScaleString(e.scale,e.origin)},_endZoomAnim:function(){var e=this._tileContainer,t=this._bgBuffer;e.style.visibility="",e.style.zIndex=2,t.style.zIndex=1,i.Util.falseFn(t.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var e=this._map;!e||e._animatingZoom||e.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[i.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var e=this._tileContainer,t=this._bgBuffer,n=this._getLoadedTilesPercentage(t),r=this._getLoadedTilesPercentage(e);return t&&n>.5&&.5>r?(e.style.visibility="hidden",this._stopLoadingImages(e),void 0):(t.style.visibility="hidden",t.style[i.DomUtil.TRANSFORM]="",this._tileContainer=t,t=this._bgBuffer=e,this._stopLoadingImages(t),void 0)},_getLoadedTilesPercentage:function(e){var t,n,r=e.getElementsByTagName("img"),i=0;for(t=0,n=r.length;n> -t;t++)r[t].complete&&i++;return i/n},_stopLoadingImages:function(e){var t,n,r,s=Array.prototype.slice.call(e.getElementsByTagName("img"));for(t=0,n=s.length;n>t;t++)r=s[t],r.complete||(r.onload=i.Util.falseFn,r.onerror=i.Util.falseFn,r.src=i.Util.emptyImageUrl,r.parentNode.removeChild(r))}}),i.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(e){if(e=this._locateOptions=i.extend(this._defaultLocateOptions,e),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=i.bind(this._handleGeolocationResponse,this),n=i.bind(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,n,e):navigator.geolocation.getCurrentPosition(t,n,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this} -,_handleGeolocationError:function(e){var t=e.code,n=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})},_handleGeolocationResponse:function(e){var t=e.coords.latitude,n=e.coords.longitude,r=new i.LatLng(t,n),s=180*e.coords.accuracy/40075017,u=s/Math.cos(i.LatLng.DEG_TO_RAD*t),a=i.latLngBounds([t-s,n-u],[t+s,n+u]),f=this._locateOptions;if(f.setView){var l=Math.min(this.getBoundsZoom(a),f.maxZoom);this.setView(r,l)}var c=i.extend({latlng:r,bounds:a},e.coords);this.fire("locationfound",c)}})}(window,document); \ No newline at end of file +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + +!function(a,b,c){var d=a.L,e={};e.version="0.6-dev","object"==typeof module&&"object"==typeof module.exports?module.exports=e:"function"==typeof define&&define.amd&&define("leaflet",[],function(){return e}),e.noConflict=function(){return a.L=d,this},a.L=e,e.Util={extend:function(a){var b,c,d,e,f=Array.prototype.slice.call(arguments,1);for(c=0,d=f.length;d>c;c++){e=f[c]||{};for(b in e)e.hasOwnProperty(b)&&(a[b]=e[b])}return a},bind:function(a,b){var c=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return a.apply(b,c||arguments)}},stamp:function(){var a=0,b="_leaflet_id";return function(c){return c[b]=c[b]||++a,c[b]}}(),invokeEach:function(a,b,c){var d,e;if("object"==typeof a){e=Array.prototype.slice.call(arguments,3);for(d in a)b.apply(c,[d,a[d]].concat(e));return!0}return!1},limitExecByInterval:function(a,b,c){var d,e;return function f(){var g=arguments;return d?(e=!0,void 0):(d=!0,setTimeout(function(){d=!1,e&&(f.apply(c,g),e=!1)},b),a.apply(c,g),void 0)}},falseFn:function(){return!1},formatNum:function(a,b){var c=Math.pow(10,b||5);return Math.round(a*c)/c},trim:function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")},splitWords:function(a){return e.Util.trim(a).split(/\s+/)},setOptions:function(a,b){return a.options=e.extend({},a.options,b),a.options},getParamString:function(a,b,c){var d=[];for(var e in a)d.push(encodeURIComponent(c?e.toUpperCase():e)+"="+encodeURIComponent(a[e]));return(b&&-1!==b.indexOf("?")?"&":"?")+d.join("&")},template:function(a,b){return a.replace(/\{ *([\w_]+) *\}/g,function(a,d){var e=b[d];if(e===c)throw new Error("No value provided for variable "+a);return"function"==typeof e&&(e=e(b)),e})},isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function b(b){var c,d,e=["webkit","moz","o","ms"];for(c=0;ca;a++)d._initHooks[a].call(this)}},b},e.Class.include=function(a){e.extend(this.prototype,a)},e.Class.mergeOptions=function(a){e.extend(this.prototype.options,a)},e.Class.addInitHook=function(a){var b=Array.prototype.slice.call(arguments,1),c="function"==typeof a?a:function(){this[a].apply(this,b)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c)};var f="_leaflet_events";e.Mixin={},e.Mixin.Events={addEventListener:function(a,b,c){if(e.Util.invokeEach(a,this.addEventListener,this,b,c))return this;var d,g,h,i,j,k,l,m=this[f]=this[f]||{},n=c&&e.stamp(c);for(a=e.Util.splitWords(a),d=0,g=a.length;g>d;d++)h={action:b,context:c||this},i=a[d],c?(j=i+"_idx",k=j+"_len",l=m[j]=m[j]||{},l[n]||(l[n]=[],m[k]=(m[k]||0)+1),l[n].push(h)):(m[i]=m[i]||[],m[i].push(h));return this},hasEventListeners:function(a){var b=this[f];return!!b&&(a in b&&b[a].length>0||a+"_idx"in b&&b[a+"_idx_len"]>0)},removeEventListener:function(a,b,c){if(!this[f])return this;if(!a)return this.clearAllEventListeners();if(e.Util.invokeEach(a,this.removeEventListener,this,b,c))return this;var d,g,h,i,j,k,l,m,n,o=this[f],p=c&&e.stamp(c);for(a=e.Util.splitWords(a),d=0,g=a.length;g>d;d++)if(h=a[d],k=h+"_idx",l=k+"_len",m=o[k],b){if(i=c&&m?m[p]:o[h]){for(j=i.length-1;j>=0;j--)i[j].action!==b||c&&i[j].context!==c||(n=i.splice(j,1),n[0].action=e.Util.falseFn);c&&m&&0===i.length&&(delete m[p],o[l]--)}}else delete o[h],delete o[k];return this},clearAllEventListeners:function(){return delete this[f],this},fireEvent:function(a,b){if(!this.hasEventListeners(a))return this;var c,d,g,h,i,j=e.Util.extend({},b,{type:a,target:this}),k=this[f];if(k[a])for(c=k[a].slice(),d=0,g=c.length;g>d;d++)c[d].action.call(c[d].context||this,j);h=k[a+"_idx"];for(i in h)if(c=h[i].slice())for(d=0,g=c.length;g>d;d++)c[d].action.call(c[d].context||this,j);return this},addOneTimeEventListener:function(a,b,c){if(e.Util.invokeEach(a,this.addOneTimeEventListener,this,b,c))return this;var d=e.bind(function(){this.removeEventListener(a,b,c).removeEventListener(a,d,c)},this);return this.addEventListener(a,b,c).addEventListener(a,d,c)}},e.Mixin.Events.on=e.Mixin.Events.addEventListener,e.Mixin.Events.off=e.Mixin.Events.removeEventListener,e.Mixin.Events.once=e.Mixin.Events.addOneTimeEventListener,e.Mixin.Events.fire=e.Mixin.Events.fireEvent,function(){var d=!!a.ActiveXObject,f=d&&!a.XMLHttpRequest,g=d&&!b.querySelector,h=d&&!b.addEventListener,i=navigator.userAgent.toLowerCase(),j=-1!==i.indexOf("webkit"),k=-1!==i.indexOf("chrome"),l=-1!==i.indexOf("phantom"),m=-1!==i.indexOf("android"),n=-1!==i.search("android [23]"),o=typeof orientation!=c+"",p=a.navigator&&a.navigator.msPointerEnabled&&a.navigator.msMaxTouchPoints,q="devicePixelRatio"in a&&a.devicePixelRatio>1||"matchMedia"in a&&a.matchMedia("(min-resolution:144dpi)")&&a.matchMedia("(min-resolution:144dpi)").matches,r=b.documentElement,s=d&&"transition"in r.style,t="WebKitCSSMatrix"in a&&"m11"in new a.WebKitCSSMatrix,u="MozPerspective"in r.style,v="OTransition"in r.style,w=!a.L_DISABLE_3D&&(s||t||u||v)&&!l,x=!a.L_NO_TOUCH&&!l&&function(){var a="ontouchstart";if(p||a in r)return!0;var c=b.createElement("div"),d=!1;return c.setAttribute?(c.setAttribute(a,"return;"),"function"==typeof c[a]&&(d=!0),c.removeAttribute(a),c=null,d):!1}();e.Browser={ie:d,ie6:f,ie7:g,ielt9:h,webkit:j,android:m,android23:n,chrome:k,ie3d:s,webkit3d:t,gecko3d:u,opera3d:v,any3d:w,mobile:o,mobileWebkit:o&&j,mobileWebkit3d:o&&t,mobileOpera:o&&a.opera,touch:x,msTouch:p,retina:q}}(),e.Point=function(a,b,c){this.x=c?Math.round(a):a,this.y=c?Math.round(b):b},e.Point.prototype={clone:function(){return new e.Point(this.x,this.y)},add:function(a){return this.clone()._add(e.point(a))},_add:function(a){return this.x+=a.x,this.y+=a.y,this},subtract:function(a){return this.clone()._subtract(e.point(a))},_subtract:function(a){return this.x-=a.x,this.y-=a.y,this},divideBy:function(a){return this.clone()._divideBy(a)},_divideBy:function(a){return this.x/=a,this.y/=a,this},multiplyBy:function(a){return this.clone()._multiplyBy(a)},_multiplyBy:function(a){return this.x*=a,this.y*=a,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(a){a=e.point(a);var b=a.x-this.x,c=a.y-this.y;return Math.sqrt(b*b+c*c)},equals:function(a){return a=e.point(a),a.x===this.x&&a.y===this.y},contains:function(a){return a=e.point(a),Math.abs(a.x)<=Math.abs(this.x)&&Math.abs(a.y)<=Math.abs(this.y)},toString:function(){return"Point("+e.Util.formatNum(this.x)+", "+e.Util.formatNum(this.y)+")"}},e.point=function(a,b,d){return a instanceof e.Point?a:e.Util.isArray(a)?new e.Point(a[0],a[1]):a===c||null===a?a:new e.Point(a,b,d)},e.Bounds=function(a,b){if(a)for(var c=b?[a,b]:a,d=0,e=c.length;e>d;d++)this.extend(c[d])},e.Bounds.prototype={extend:function(a){return a=e.point(a),this.min||this.max?(this.min.x=Math.min(a.x,this.min.x),this.max.x=Math.max(a.x,this.max.x),this.min.y=Math.min(a.y,this.min.y),this.max.y=Math.max(a.y,this.max.y)):(this.min=a.clone(),this.max=a.clone()),this},getCenter:function(a){return new e.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,a)},getBottomLeft:function(){return new e.Point(this.min.x,this.max.y)},getTopRight:function(){return new e.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(a){var b,c;return a="number"==typeof a[0]||a instanceof e.Point?e.point(a):e.bounds(a),a instanceof e.Bounds?(b=a.min,c=a.max):b=c=a,b.x>=this.min.x&&c.x<=this.max.x&&b.y>=this.min.y&&c.y<=this.max.y},intersects:function(a){a=e.bounds(a);var b=this.min,c=this.max,d=a.min,f=a.max,g=f.x>=b.x&&d.x<=c.x,h=f.y>=b.y&&d.y<=c.y;return g&&h},isValid:function(){return!(!this.min||!this.max)}},e.bounds=function(a,b){return!a||a instanceof e.Bounds?a:new e.Bounds(a,b)},e.Transformation=function(a,b,c,d){this._a=a,this._b=b,this._c=c,this._d=d},e.Transformation.prototype={transform:function(a,b){return this._transform(a.clone(),b)},_transform:function(a,b){return b=b||1,a.x=b*(this._a*a.x+this._b),a.y=b*(this._c*a.y+this._d),a},untransform:function(a,b){return b=b||1,new e.Point((a.x/b-this._b)/this._a,(a.y/b-this._d)/this._c)}},e.DomUtil={get:function(a){return"string"==typeof a?b.getElementById(a):a},getStyle:function(a,c){var d=a.style[c];if(!d&&a.currentStyle&&(d=a.currentStyle[c]),(!d||"auto"===d)&&b.defaultView){var e=b.defaultView.getComputedStyle(a,null);d=e?e[c]:null}return"auto"===d?null:d},getViewportOffset:function(a){var c,d=0,f=0,g=a,h=b.body,i=b.documentElement,j=e.Browser.ie7;do{if(d+=g.offsetTop||0,f+=g.offsetLeft||0,d+=parseInt(e.DomUtil.getStyle(g,"borderTopWidth"),10)||0,f+=parseInt(e.DomUtil.getStyle(g,"borderLeftWidth"),10)||0,c=e.DomUtil.getStyle(g,"position"),g.offsetParent===h&&"absolute"===c)break;if("fixed"===c){d+=h.scrollTop||i.scrollTop||0,f+=h.scrollLeft||i.scrollLeft||0;break}if("relative"===c&&!g.offsetLeft){var k=e.DomUtil.getStyle(g,"width"),l=e.DomUtil.getStyle(g,"max-width"),m=g.getBoundingClientRect();("none"!==k||"none"!==l)&&(f+=m.left+g.clientLeft),d+=m.top+(h.scrollTop||i.scrollTop||0);break}g=g.offsetParent}while(g);g=a;do{if(g===h)break;d-=g.scrollTop||0,f-=g.scrollLeft||0,e.DomUtil.documentIsLtr()||!e.Browser.webkit&&!j||(f+=g.scrollWidth-g.clientWidth,j&&"hidden"!==e.DomUtil.getStyle(g,"overflow-y")&&"hidden"!==e.DomUtil.getStyle(g,"overflow")&&(f+=17)),g=g.parentNode}while(g);return new e.Point(f,d)},documentIsLtr:function(){return e.DomUtil._docIsLtrCached||(e.DomUtil._docIsLtrCached=!0,e.DomUtil._docIsLtr="ltr"===e.DomUtil.getStyle(b.body,"direction")),e.DomUtil._docIsLtr},create:function(a,c,d){var e=b.createElement(a);return e.className=c,d&&d.appendChild(e),e},disableTextSelection:function(){b.selection&&b.selection.empty&&b.selection.empty(),this._onselectstart||(this._onselectstart=b.onselectstart||null,b.onselectstart=e.Util.falseFn)},enableTextSelection:function(){b.onselectstart===e.Util.falseFn&&(b.onselectstart=this._onselectstart,this._onselectstart=null)},hasClass:function(a,b){return a.className.length>0&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(a.className)},addClass:function(a,b){e.DomUtil.hasClass(a,b)||(a.className+=(a.className?" ":"")+b)},removeClass:function(a,b){a.className=e.Util.trim((" "+a.className+" ").replace(" "+b+" "," "))},setOpacity:function(a,b){if("opacity"in a.style)a.style.opacity=b;else if("filter"in a.style){var c=!1,d="DXImageTransform.Microsoft.Alpha";try{c=a.filters.item(d)}catch(e){if(1===b)return}b=Math.round(100*b),c?(c.Enabled=100!==b,c.Opacity=b):a.style.filter+=" progid:"+d+"(opacity="+b+")"}},testProp:function(a){for(var c=b.documentElement.style,d=0;dc||c===b?b:a),new e.LatLng(this.lat,c)}},e.latLng=function(a,b){return a instanceof e.LatLng?a:e.Util.isArray(a)?new e.LatLng(a[0],a[1]):a===c||null===a?a:"object"==typeof a&&"lat"in a?new e.LatLng(a.lat,"lng"in a?a.lng:a.lon):new e.LatLng(a,b)},e.LatLngBounds=function(a,b){if(a)for(var c=b?[a,b]:a,d=0,e=c.length;e>d;d++)this.extend(c[d])},e.LatLngBounds.prototype={extend:function(a){return a?(a="number"==typeof a[0]||"string"==typeof a[0]||a instanceof e.LatLng?e.latLng(a):e.latLngBounds(a),a instanceof e.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(a.lat,this._southWest.lat),this._southWest.lng=Math.min(a.lng,this._southWest.lng),this._northEast.lat=Math.max(a.lat,this._northEast.lat),this._northEast.lng=Math.max(a.lng,this._northEast.lng)):(this._southWest=new e.LatLng(a.lat,a.lng),this._northEast=new e.LatLng(a.lat,a.lng)):a instanceof e.LatLngBounds&&(this.extend(a._southWest),this.extend(a._northEast)),this):this},pad:function(a){var b=this._southWest,c=this._northEast,d=Math.abs(b.lat-c.lat)*a,f=Math.abs(b.lng-c.lng)*a;return new e.LatLngBounds(new e.LatLng(b.lat-d,b.lng-f),new e.LatLng(c.lat+d,c.lng+f))},getCenter:function(){return new e.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new e.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new e.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(a){a="number"==typeof a[0]||a instanceof e.LatLng?e.latLng(a):e.latLngBounds(a);var b,c,d=this._southWest,f=this._northEast;return a instanceof e.LatLngBounds?(b=a.getSouthWest(),c=a.getNorthEast()):b=c=a,b.lat>=d.lat&&c.lat<=f.lat&&b.lng>=d.lng&&c.lng<=f.lng},intersects:function(a){a=e.latLngBounds(a);var b=this._southWest,c=this._northEast,d=a.getSouthWest(),f=a.getNorthEast(),g=f.lat>=b.lat&&d.lat<=c.lat,h=f.lng>=b.lng&&d.lng<=c.lng;return g&&h},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(a){return a?(a=e.latLngBounds(a),this._southWest.equals(a.getSouthWest())&&this._northEast.equals(a.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},e.latLngBounds=function(a,b){return!a||a instanceof e.LatLngBounds?a:new e.LatLngBounds(a,b)},e.Projection={},e.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(a){var b=e.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=Math.max(Math.min(c,a.lat),-c),f=a.lng*b,g=d*b;return g=Math.log(Math.tan(Math.PI/4+g/2)),new e.Point(f,g)},unproject:function(a){var b=e.LatLng.RAD_TO_DEG,c=a.x*b,d=(2*Math.atan(Math.exp(a.y))-Math.PI/2)*b;return new e.LatLng(d,c)}},e.Projection.LonLat={project:function(a){return new e.Point(a.lng,a.lat)},unproject:function(a){return new e.LatLng(a.y,a.x)}},e.CRS={latLngToPoint:function(a,b){var c=this.projection.project(a),d=this.scale(b);return this.transformation._transform(c,d)},pointToLatLng:function(a,b){var c=this.scale(b),d=this.transformation.untransform(a,c);return this.projection.unproject(d)},project:function(a){return this.projection.project(a)},scale:function(a){return 256*Math.pow(2,a)}},e.CRS.Simple=e.extend({},e.CRS,{projection:e.Projection.LonLat,transformation:new e.Transformation(1,0,-1,0),scale:function(a){return Math.pow(2,a)}}),e.CRS.EPSG3857=e.extend({},e.CRS,{code:"EPSG:3857",projection:e.Projection.SphericalMercator,transformation:new e.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(a){var b=this.projection.project(a),c=6378137;return b.multiplyBy(c)}}),e.CRS.EPSG900913=e.extend({},e.CRS.EPSG3857,{code:"EPSG:900913"}),e.CRS.EPSG4326=e.extend({},e.CRS,{code:"EPSG:4326",projection:e.Projection.LonLat,transformation:new e.Transformation(1/360,.5,-1/360,.5)}),e.Map=e.Class.extend({includes:e.Mixin.Events,options:{crs:e.CRS.EPSG3857,fadeAnimation:e.DomUtil.TRANSITION&&!e.Browser.android23,trackResize:!0,markerZoomAnimation:e.DomUtil.TRANSITION&&e.Browser.any3d},initialize:function(a,b){b=e.setOptions(this,b),this._initContainer(a),this._initLayout(),this._initEvents(),b.maxBounds&&this.setMaxBounds(b.maxBounds),b.center&&b.zoom!==c&&this.setView(e.latLng(b.center),b.zoom,{reset:!0}),this._initLayers(b.layers),this._handlers=[],this.callInitHooks()},setView:function(a,b){return this._resetView(e.latLng(a),this._limitZoom(b)),this},setZoom:function(a,b){return this.setView(this.getCenter(),a,{zoom:b})},zoomIn:function(a,b){return this.setZoom(this._zoom+(a||1),b)},zoomOut:function(a,b){return this.setZoom(this._zoom-(a||1),b)},setZoomAround:function(a,b,c){var d=this.getZoomScale(b),f=this.getSize().divideBy(2),g=a instanceof e.Point?a:this.latLngToContainerPoint(a),h=g.subtract(f).multiplyBy(1-1/d),i=this.containerPointToLatLng(f.add(h));return this.setView(i,b,{zoom:c})},fitBounds:function(a,b){b=b||{},a=a.getBounds?a.getBounds():e.latLngBounds(a);var c=e.point(b.paddingTopLeft||b.padding||[0,0]),d=e.point(b.paddingBottomRight||b.padding||[0,0]),f=this.getBoundsZoom(a,!1,c.add(d)),g=d.subtract(c).divideBy(2),h=this.project(a.getSouthWest(),f),i=this.project(a.getNorthEast(),f),j=this.unproject(h.add(i).divideBy(2).add(g),f);return this.setView(j,f,b)},fitWorld:function(a){return this.fitBounds([[-90,-180],[90,180]],a)},panTo:function(a,b){return this.setView(a,this._zoom,{pan:b})},panBy:function(a){return this.fire("movestart"),this._rawPanBy(e.point(a)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(a){if(a=e.latLngBounds(a),this.options.maxBounds=a,!a)return this._boundsMinZoom=null,this.off("moveend",this._panInsideMaxBounds,this),this;var b=this.getBoundsZoom(a,!0);return this._boundsMinZoom=b,this._loaded&&(this._zoomg.x&&(h=Math.floor(g.x-d.x)),c.y>f.y&&(i=Math.floor(f.y-c.y)),c.x=f);return k&&b?null:b?f:f-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new e.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var a=this._getTopLeftPoint();return new e.Bounds(a,a.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(a){var b=this.options.crs;return b.scale(a)/b.scale(this._zoom)},getScaleZoom:function(a){return this._zoom+Math.log(a)/Math.LN2},project:function(a,b){return b=b===c?this._zoom:b,this.options.crs.latLngToPoint(e.latLng(a),b)},unproject:function(a,b){return b=b===c?this._zoom:b,this.options.crs.pointToLatLng(e.point(a),b)},layerPointToLatLng:function(a){var b=e.point(a).add(this.getPixelOrigin());return this.unproject(b)},latLngToLayerPoint:function(a){var b=this.project(e.latLng(a))._round();return b._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(a){return e.point(a).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(a){return e.point(a).add(this._getMapPanePos())},containerPointToLatLng:function(a){var b=this.containerPointToLayerPoint(e.point(a));return this.layerPointToLatLng(b)},latLngToContainerPoint:function(a){return this.layerPointToContainerPoint(this.latLngToLayerPoint(e.latLng(a)))},mouseEventToContainerPoint:function(a){return e.DomEvent.getMousePosition(a,this._container)},mouseEventToLayerPoint:function(a){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(a))},mouseEventToLatLng:function(a){return this.layerPointToLatLng(this.mouseEventToLayerPoint(a))},_initContainer:function(a){var b=this._container=e.DomUtil.get(a);if(!b)throw new Error("Map container not found.");if(b._leaflet)throw new Error("Map container is already initialized.");b._leaflet=!0},_initLayout:function(){var a=this._container;e.DomUtil.addClass(a,"leaflet-container"+(e.Browser.touch?" leaflet-touch":"")+(e.Browser.retina?" leaflet-retina":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var b=e.DomUtil.getStyle(a,"position");"absolute"!==b&&"relative"!==b&&"fixed"!==b&&(a.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var a=this._panes={};this._mapPane=a.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=a.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),a.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),a.shadowPane=this._createPane("leaflet-shadow-pane"),a.overlayPane=this._createPane("leaflet-overlay-pane"),a.markerPane=this._createPane("leaflet-marker-pane"),a.popupPane=this._createPane("leaflet-popup-pane");var b=" leaflet-zoom-hide";this.options.markerZoomAnimation||(e.DomUtil.addClass(a.markerPane,b),e.DomUtil.addClass(a.shadowPane,b),e.DomUtil.addClass(a.popupPane,b))},_createPane:function(a,b){return e.DomUtil.create("div",a,b||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_initLayers:function(a){a=a?e.Util.isArray(a)?a:[a]:[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0;var b,c;for(b=0,c=a.length;c>b;b++)this.addLayer(a[b])},_resetView:function(a,b,c,d){var f=this._zoom!==b;d||(this.fire("movestart"),f&&this.fire("zoomstart")),this._zoom=b,this._initialCenter=a,this._initialTopLeftPoint=this._getNewTopLeftPoint(a),c?this._initialTopLeftPoint._add(this._getMapPanePos()):e.DomUtil.setPosition(this._mapPane,new e.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var g=!this._loaded;this._loaded=!0,g&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!c}),this.fire("move"),(f||d)&&this.fire("zoomend"),this.fire("moveend",{hard:!c})},_rawPanBy:function(a){e.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(a))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var a,b=1/0,d=-1/0,e=this._getZoomSpan();for(a in this._zoomBoundLayers){var f=this._zoomBoundLayers[a];isNaN(f.options.minZoom)||(b=Math.min(b,f.options.minZoom)),isNaN(f.options.maxZoom)||(d=Math.max(d,f.options.maxZoom))}a===c?this._layersMaxZoom=this._layersMinZoom=c:(this._layersMaxZoom=d,this._layersMinZoom=b),e!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(b){if(e.DomEvent){b=b||"on",e.DomEvent[b](this._container,"click",this._onMouseClick,this);var c,d,f=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(c=0,d=f.length;d>c;c++)e.DomEvent[b](this._container,f[c],this._fireMouseEvent,this);this.options.trackResize&&e.DomEvent[b](a,"resize",this._onResize,this)}},_onResize:function(){e.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=e.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(a){!this._loaded||this.dragging&&this.dragging.moved()||(this.fire("preclick"),this._fireMouseEvent(a))},_fireMouseEvent:function(a){if(this._loaded){var b=a.type;if(b="mouseenter"===b?"mouseover":"mouseleave"===b?"mouseout":b,this.hasEventListeners(b)){"contextmenu"===b&&e.DomEvent.preventDefault(a);var c=this.mouseEventToContainerPoint(a),d=this.containerPointToLayerPoint(c),f=this.layerPointToLatLng(d);this.fire(b,{latlng:f,layerPoint:d,containerPoint:c,originalEvent:a})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var a=0,b=this._handlers.length;b>a;a++)this._handlers[a].disable()},whenReady:function(a,b){return this._loaded?a.call(b||this,this):this.on("load",a,b),this},_layerAdd:function(a){a.onAdd(this),this.fire("layeradd",{layer:a})},_getMapPanePos:function(){return e.DomUtil.getPosition(this._mapPane)},_moved:function(){var a=this._getMapPanePos();return a&&!a.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(a,b){var c=this.getSize()._divideBy(2);return this.project(a,b)._subtract(c)._round()},_latLngToNewLayerPoint:function(a,b,c){var d=this._getNewTopLeftPoint(c,b).add(this._getMapPanePos());return this.project(a,b)._subtract(d)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(a){return this.latLngToLayerPoint(a).subtract(this._getCenterLayerPoint())},_limitZoom:function(a){var b=this.getMinZoom(),c=this.getMaxZoom();return Math.max(b,Math.min(c,a))}}),e.map=function(a,b){return new e.Map(a,b)},e.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(a){var b=e.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=Math.max(Math.min(c,a.lat),-c),f=this.R_MAJOR,g=this.R_MINOR,h=a.lng*b*f,i=d*b,j=g/f,k=Math.sqrt(1-j*j),l=k*Math.sin(i);l=Math.pow((1-l)/(1+l),.5*k);var m=Math.tan(.5*(.5*Math.PI-i))/l;return i=-g*Math.log(m),new e.Point(h,i)},unproject:function(a){for(var b,c=e.LatLng.RAD_TO_DEG,d=this.R_MAJOR,f=this.R_MINOR,g=a.x*c/d,h=f/d,i=Math.sqrt(1-h*h),j=Math.exp(-a.y/f),k=Math.PI/2-2*Math.atan(j),l=15,m=1e-7,n=l,o=.1;Math.abs(o)>m&&--n>0;)b=i*Math.sin(k),o=Math.PI/2-2*Math.atan(j*Math.pow((1-b)/(1+b),.5*i))-k,k+=o;return new e.LatLng(k*c,g)}},e.CRS.EPSG3395=e.extend({},e.CRS,{code:"EPSG:3395",projection:e.Projection.Mercator,transformation:function(){var a=e.Projection.Mercator,b=a.R_MAJOR,c=a.R_MINOR;return new e.Transformation(.5/(Math.PI*b),.5,-.5/(Math.PI*c),.5)}()}),e.TileLayer=e.Class.extend({includes:e.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:e.Browser.mobile,updateWhenIdle:e.Browser.mobile},initialize:function(a,b){b=e.setOptions(this,b),b.detectRetina&&e.Browser.retina&&b.maxZoom>0&&(b.tileSize=Math.floor(b.tileSize/2),b.zoomOffset++,b.minZoom>0&&b.minZoom--,this.options.maxZoom--),b.bounds&&(b.bounds=e.latLngBounds(b.bounds)),this._url=a;var c=this.options.subdomains;"string"==typeof c&&(this.options.subdomains=c.split(""))},onAdd:function(a){this._map=a,this._animated=a.options.zoomAnimation&&e.Browser.any3d,this._initContainer(),this._createTileProto(),a.on({viewreset:this._reset,moveend:this._update},this),this._animated&&a.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=e.Util.limitExecByInterval(this._update,150,this),a.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){this._container.parentNode.removeChild(this._container),a.off({viewreset:this._reset,moveend:this._update},this),this._animated&&a.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||a.off("move",this._limitedUpdate,this),this._container=null,this._map=null +},bringToFront:function(){var a=this._map._panes.tilePane;return this._container&&(a.appendChild(this._container),this._setAutoZIndex(a,Math.max)),this},bringToBack:function(){var a=this._map._panes.tilePane;return this._container&&(a.insertBefore(this._container,a.firstChild),this._setAutoZIndex(a,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(a){return this.options.opacity=a,this._map&&this._updateOpacity(),this},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},setUrl:function(a,b){return this._url=a,b||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==c&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(a,b){var c,d,e,f=a.children,g=-b(1/0,-1/0);for(d=0,e=f.length;e>d;d++)f[d]!==this._container&&(c=parseInt(f[d].style.zIndex,10),isNaN(c)||(g=b(g,c)));this.options.zIndex=this._container.style.zIndex=(isFinite(g)?g:0)+b(1,-1)},_updateOpacity:function(){var a,b=this._tiles;if(e.Browser.ielt9)for(a in b)e.DomUtil.setOpacity(b[a],this.options.opacity);else e.DomUtil.setOpacity(this._container,this.options.opacity);if(e.Browser.webkit)for(a in b)b[a].style.webkitTransform+=" translate(0,0)"},_initContainer:function(){var a=this._map._panes.tilePane;if(!this._container){if(this._container=e.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var b="leaflet-tile-container leaflet-zoom-animated";this._bgBuffer=e.DomUtil.create("div",b,this._container),this._bgBuffer.style.zIndex=1,this._tileContainer=e.DomUtil.create("div",b,this._container),this._tileContainer.style.zIndex=2}else this._tileContainer=this._container;a.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(a){for(var b in this._tiles)this.fire("tileunload",{tile:this._tiles[b]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&a&&a.hard&&this._clearBgBuffer(),this._initContainer()},_update:function(){if(this._map){var a=this._map.getPixelBounds(),b=this._map.getZoom(),c=this.options.tileSize;if(!(b>this.options.maxZoom||bd;d++)this._addTile(g[d],j);this._tileContainer.appendChild(j)}},_tileShouldBeLoaded:function(a){if(a.x+":"+a.y in this._tiles)return!1;var b=this.options;if(!b.continuousWorld){var c=this._getWrapTileNum();if(b.noWrap&&(a.x<0||a.x>=c)||a.y<0||a.y>=c)return!1}if(b.bounds){var d=b.tileSize,e=a.multiplyBy(d),f=e.add([d,d]),g=this._map.unproject(e),h=this._map.unproject(f);if(b.continuousWorld||b.noWrap||(g=g.wrap(),h=h.wrap()),!b.bounds.intersects([g,h]))return!1}return!0},_removeOtherTiles:function(a){var b,c,d,e;for(e in this._tiles)b=e.split(":"),c=parseInt(b[0],10),d=parseInt(b[1],10),(ca.max.x||da.max.y)&&this._removeTile(e)},_removeTile:function(a){var b=this._tiles[a];this.fire("tileunload",{tile:b,url:b.src}),this.options.reuseTiles?(e.DomUtil.removeClass(b,"leaflet-tile-loaded"),this._unusedTiles.push(b)):b.parentNode===this._tileContainer&&this._tileContainer.removeChild(b),e.Browser.android||(b.onload=null,b.src=e.Util.emptyImageUrl),delete this._tiles[a]},_addTile:function(a,b){var c=this._getTilePos(a),d=this._getTile();e.DomUtil.setPosition(d,c,e.Browser.chrome||e.Browser.android23),this._tiles[a.x+":"+a.y]=d,this._loadTile(d,a),d.parentNode!==this._tileContainer&&b.appendChild(d)},_getZoomForUrl:function(){var a=this.options,b=this._map.getZoom();return a.zoomReverse&&(b=a.maxZoom-b),b+a.zoomOffset},_getTilePos:function(a){var b=this._map.getPixelOrigin(),c=this.options.tileSize;return a.multiplyBy(c).subtract(b)},getTileUrl:function(a){return e.Util.template(this._url,e.extend({s:this._getSubdomain(a),z:a.z,x:a.x,y:a.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(a){var b=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(a.x=(a.x%b+b)%b),this.options.tms&&(a.y=b-a.y-1),a.z=this._getZoomForUrl()},_getSubdomain:function(a){var b=Math.abs(a.x+a.y)%this.options.subdomains.length;return this.options.subdomains[b]},_createTileProto:function(){var a=this._tileImg=e.DomUtil.create("img","leaflet-tile");a.style.width=a.style.height=this.options.tileSize+"px",a.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var a=this._unusedTiles.pop();return this._resetTile(a),a}return this._createTile()},_resetTile:function(){},_createTile:function(){var a=this._tileImg.cloneNode(!1);return a.onselectstart=a.onmousemove=e.Util.falseFn,e.Browser.ielt9&&this.options.opacity!==c&&e.DomUtil.setOpacity(a,this.options.opacity),a},_loadTile:function(a,b){a._layer=this,a.onload=this._tileOnLoad,a.onerror=this._tileOnError,this._adjustTilePoint(b),a.src=this.getTileUrl(b)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(e.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var a=this._layer;this.src!==e.Util.emptyImageUrl&&(e.DomUtil.addClass(this,"leaflet-tile-loaded"),a.fire("tileload",{tile:this,url:this.src})),a._tileLoaded()},_tileOnError:function(){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});var b=a.options.errorTileUrl;b&&(this.src=b),a._tileLoaded()}}),e.tileLayer=function(a,b){return new e.TileLayer(a,b)},e.TileLayer.WMS=e.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a;var c=e.extend({},this.defaultWmsParams),d=b.tileSize||this.options.tileSize;c.width=c.height=b.detectRetina&&e.Browser.retina?2*d:d;for(var f in b)this.options.hasOwnProperty(f)||(c[f]=b[f]);this.wmsParams=c,e.setOptions(this,b)},onAdd:function(a){var b=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[b]=a.options.crs.code,e.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a,b){var c=this._map,d=c.options.crs,f=this.options.tileSize,g=a.multiplyBy(f),h=g.add([f,f]),i=d.project(c.unproject(g,b)),j=d.project(c.unproject(h,b)),k=[i.x,j.y,j.x,i.y].join(","),l=e.Util.template(this._url,{s:this._getSubdomain(a)});return l+e.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+k},setParams:function(a,b){return e.extend(this.wmsParams,a),b||this.redraw(),this}}),e.tileLayer.wms=function(a,b){return new e.TileLayer.WMS(a,b)},e.TileLayer.Canvas=e.TileLayer.extend({options:{async:!1},initialize:function(a){e.setOptions(this,a)},redraw:function(){for(var a in this._tiles)this._redrawTile(this._tiles[a]);return this},_redrawTile:function(a){this.drawTile(a,a._tilePoint,this._map._zoom)},_createTileProto:function(){var a=this._canvasProto=e.DomUtil.create("canvas","leaflet-tile");a.width=a.height=this.options.tileSize},_createTile:function(){var a=this._canvasProto.cloneNode(!1);return a.onselectstart=a.onmousemove=e.Util.falseFn,a},_loadTile:function(a,b){a._layer=this,a._tilePoint=b,this._redrawTile(a),this.options.async||this.tileDrawn(a)},drawTile:function(){},tileDrawn:function(a){this._tileOnLoad.call(a)}}),e.tileLayer.canvas=function(a){return new e.TileLayer.Canvas(a)},e.ImageOverlay=e.Class.extend({includes:e.Mixin.Events,options:{opacity:1},initialize:function(a,b,c){this._url=a,this._bounds=e.latLngBounds(b),e.setOptions(this,c)},onAdd:function(a){this._map=a,this._image||this._initImage(),a._panes.overlayPane.appendChild(this._image),a.on("viewreset",this._reset,this),a.options.zoomAnimation&&e.Browser.any3d&&a.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(a){a.getPanes().overlayPane.removeChild(this._image),a.off("viewreset",this._reset,this),a.options.zoomAnimation&&a.off("zoomanim",this._animateZoom,this)},addTo:function(a){return a.addLayer(this),this},setOpacity:function(a){return this.options.opacity=a,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var a=this._map._panes.overlayPane;return this._image&&a.insertBefore(this._image,a.firstChild),this},_initImage:function(){this._image=e.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&e.Browser.any3d?e.DomUtil.addClass(this._image,"leaflet-zoom-animated"):e.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),e.extend(this._image,{galleryimg:"no",onselectstart:e.Util.falseFn,onmousemove:e.Util.falseFn,onload:e.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(a){var b=this._map,c=this._image,d=b.getZoomScale(a.zoom),f=this._bounds.getNorthWest(),g=this._bounds.getSouthEast(),h=b._latLngToNewLayerPoint(f,a.zoom,a.center),i=b._latLngToNewLayerPoint(g,a.zoom,a.center)._subtract(h),j=h._add(i._multiplyBy(.5*(1-1/d)));c.style[e.DomUtil.TRANSFORM]=e.DomUtil.getTranslateString(j)+" scale("+d+") "},_reset:function(){var a=this._image,b=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),c=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(b);e.DomUtil.setPosition(a,b),a.style.width=c.x+"px",a.style.height=c.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){e.DomUtil.setOpacity(this._image,this.options.opacity)}}),e.imageOverlay=function(a,b,c){return new e.ImageOverlay(a,b,c)},e.Icon=e.Class.extend({options:{className:""},initialize:function(a){e.setOptions(this,a)},createIcon:function(a){return this._createIcon("icon",a)},createShadow:function(a){return this._createIcon("shadow",a)},_createIcon:function(a,b){var c=this._getIconUrl(a);if(!c){if("icon"===a)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var d;return d=b&&"IMG"===b.tagName?this._createImg(c,b):this._createImg(c),this._setIconStyles(d,a),d},_setIconStyles:function(a,b){var c,d=this.options,f=e.point(d[b+"Size"]);c="shadow"===b?e.point(d.shadowAnchor||d.iconAnchor):e.point(d.iconAnchor),!c&&f&&(c=f.divideBy(2,!0)),a.className="leaflet-marker-"+b+" "+d.className,c&&(a.style.marginLeft=-c.x+"px",a.style.marginTop=-c.y+"px"),f&&(a.style.width=f.x+"px",a.style.height=f.y+"px")},_createImg:function(a,c){return e.Browser.ie6?(c||(c=b.createElement("div")),c.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+a+'")'):(c||(c=b.createElement("img")),c.src=a),c},_getIconUrl:function(a){return e.Browser.retina&&this.options[a+"RetinaUrl"]?this.options[a+"RetinaUrl"]:this.options[a+"Url"]}}),e.icon=function(a){return new e.Icon(a)},e.Icon.Default=e.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(a){var b=a+"Url";if(this.options[b])return this.options[b];e.Browser.retina&&"icon"===a&&(a+="-2x");var c=e.Icon.Default.imagePath;if(!c)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return c+"/marker-"+a+".png"}}),e.Icon.Default.imagePath=function(){var a,c,d,e,f,g=b.getElementsByTagName("script"),h=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(a=0,c=g.length;c>a;a++)if(d=g[a].src,e=d.match(h))return f=d.split(h)[0],(f?f+"/":"")+"images"}(),e.Marker=e.Class.extend({includes:e.Mixin.Events,options:{icon:new e.Icon.Default,title:"",clickable:!0,draggable:!1,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(a,b){e.setOptions(this,b),this._latlng=e.latLng(a)},onAdd:function(a){this._map=a,a.on("viewreset",this.update,this),this._initIcon(),this.update(),a.options.zoomAnimation&&a.options.markerZoomAnimation&&a.on("zoomanim",this._animateZoom,this)},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){this.dragging&&this.dragging.disable(),this._removeIcon(),this.fire("remove"),a.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(a){return this._latlng=e.latLng(a),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(a){return this.options.zIndexOffset=a,this.update(),this},setIcon:function(a){return this.options.icon=a,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var a=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(a)}return this},_initIcon:function(){var a=this.options,b=this._map,c=b.options.zoomAnimation&&b.options.markerZoomAnimation,d=c?"leaflet-zoom-animated":"leaflet-zoom-hide",f=!1,g=this._icon;if(g){var h=a.icon.createIcon(this._icon);h!==this._icon&&(this._removeIcon(),this._icon=h,g=!1)}else this._icon=a.icon.createIcon();a.title&&(this._icon.title=a.title),this._initInteraction(),f=a.opacity<1,e.DomUtil.addClass(this._icon,d),a.riseOnHover&&e.DomEvent.on(this._icon,"mouseover",this._bringToFront,this).on(this._icon,"mouseout",this._resetZIndex,this);var i=this._shadow;i?this._shadow=a.icon.createShadow(this._shadow):(this._shadow=a.icon.createShadow(),this._shadow&&(e.DomUtil.addClass(this._shadow,d),f=a.opacity<1)),f&&this._updateOpacity();var j=this._map._panes;g||j.markerPane.appendChild(this._icon),this._shadow&&!i&&j.shadowPane.appendChild(this._shadow)},_removeIcon:function(){var a=this._map._panes;this.options.riseOnHover&&e.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),a.markerPane.removeChild(this._icon),this._shadow&&a.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_setPos:function(a){e.DomUtil.setPosition(this._icon,a),this._shadow&&e.DomUtil.setPosition(this._shadow,a),this._zIndex=a.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(a){this._icon.style.zIndex=this._zIndex+a},_animateZoom:function(a){var b=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);this._setPos(b)},_initInteraction:function(){if(this.options.clickable){var a=this._icon,b=["dblclick","mousedown","mouseover","mouseout","contextmenu"];e.DomUtil.addClass(a,"leaflet-clickable"),e.DomEvent.on(a,"click",this._onMouseClick,this);for(var c=0;cf?(b.height=f+"px",e.DomUtil.addClass(a,g)):e.DomUtil.removeClass(a,g),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var a=this._map.latLngToLayerPoint(this._latlng),b=this._animated,c=e.point(this.options.offset);b&&e.DomUtil.setPosition(this._container,a),this._containerBottom=-c.y-(b?0:a.y),this._containerLeft=-Math.round(this._containerWidth/2)+c.x+(b?0:a.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(a){var b=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);e.DomUtil.setPosition(this._container,b)},_adjustPan:function(){if(this.options.autoPan){var a=this._map,b=this._container.offsetHeight,c=this._containerWidth,d=new e.Point(this._containerLeft,-b-this._containerBottom);this._animated&&d._add(e.DomUtil.getPosition(this._container));var f=a.layerPointToContainerPoint(d),g=e.point(this.options.autoPanPadding),h=a.getSize(),i=0,j=0;f.x+c>h.x&&(i=f.x+c-h.x+g.x),f.x-i<0&&(i=f.x-g.x),f.y+b>h.y&&(j=f.y+b-h.y+g.y),f.y-j<0&&(j=f.y-g.y),(i||j)&&a.fire("autopanstart").panBy([i,j])}},_onCloseButtonClick:function(a){this._close(),e.DomEvent.stop(a)}}),e.popup=function(a,b){return new e.Popup(a,b)},e.Map.include({openPopup:function(a,b,c){if(this.closePopup(),!(a instanceof e.Popup)){var d=a;a=new e.Popup(c).setLatLng(b).setContent(d)}return this._popup=a,this.addLayer(a)},closePopup:function(a){return a&&a!==this._popup||(a=this._popup,this._popup=null),a&&this.removeLayer(a),this}}),e.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(a,b){var c=e.point(this.options.icon.options.popupAnchor||[0,0]);return c=c.add(e.Popup.prototype.options.offset),b&&b.offset&&(c=c.add(b.offset)),b=e.extend({offset:c},b),this._popup||this.on("click",this.openPopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),a instanceof e.Popup?(e.setOptions(a,b),this._popup=a):this._popup=new e.Popup(b,this).setContent(a),this},setPopupContent:function(a){return this._popup&&this._popup.setContent(a),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(a){this._popup.setLatLng(a.latlng)}}),e.LayerGroup=e.Class.extend({initialize:function(a){this._layers={};var b,c;if(a)for(b=0,c=a.length;c>b;b++)this.addLayer(a[b])},addLayer:function(a){var b=this.getLayerId(a);return this._layers[b]=a,this._map&&this._map.addLayer(a),this},removeLayer:function(a){var b=a in this._layers?a:this.getLayerId(a);return this._map&&this._layers[b]&&this._map.removeLayer(this._layers[b]),delete this._layers[b],this},hasLayer:function(a){return a?a in this._layers||this.getLayerId(a)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(a){var b,c,d=Array.prototype.slice.call(arguments,1);for(b in this._layers)c=this._layers[b],c[a]&&c[a].apply(c,d);return this},onAdd:function(a){this._map=a,this.eachLayer(a.addLayer,a)},onRemove:function(a){this.eachLayer(a.removeLayer,a),this._map=null},addTo:function(a){return a.addLayer(this),this},eachLayer:function(a,b){for(var c in this._layers)a.call(b,this._layers[c]);return this},getLayer:function(a){return this._layers[a]},getLayers:function(){var a=[];for(var b in this._layers)a.push(this._layers[b]);return a},setZIndex:function(a){return this.invoke("setZIndex",a)},getLayerId:function(a){return e.stamp(a)}}),e.layerGroup=function(a){return new e.LayerGroup(a)},e.FeatureGroup=e.LayerGroup.extend({includes:e.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu"},addLayer:function(a){return this.hasLayer(a)?this:(a.on(e.FeatureGroup.EVENTS,this._propagateEvent,this),e.LayerGroup.prototype.addLayer.call(this,a),this._popupContent&&a.bindPopup&&a.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:a}))},removeLayer:function(a){return a in this._layers&&(a=this._layers[a]),a.off(e.FeatureGroup.EVENTS,this._propagateEvent,this),e.LayerGroup.prototype.removeLayer.call(this,a),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:a})},bindPopup:function(a,b){return this._popupContent=a,this._popupOptions=b,this.invoke("bindPopup",a,b)},setStyle:function(a){return this.invoke("setStyle",a)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var a=new e.LatLngBounds;return this.eachLayer(function(b){a.extend(b instanceof e.Marker?b.getLatLng():b.getBounds())}),a},_propagateEvent:function(a){a.layer||(a.layer=a.target),a.target=this,this.fire(a.type,a)}}),e.featureGroup=function(a){return new e.FeatureGroup(a)},e.Path=e.Class.extend({includes:[e.Mixin.Events],statics:{CLIP_PADDING:e.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(a.innerWidth,a.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(a){e.setOptions(this,a)},onAdd:function(a){this._map=a,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),a.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){a._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,e.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),a.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(a){return e.setOptions(this,a),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),e.Map.include({_updatePathViewport:function(){var a=e.Path.CLIP_PADDING,b=this.getSize(),c=e.DomUtil.getPosition(this._mapPane),d=c.multiplyBy(-1)._subtract(b.multiplyBy(a)._round()),f=d.add(b.multiplyBy(1+2*a)._round());this._pathViewport=new e.Bounds(d,f)}}),e.Path.SVG_NS="http://www.w3.org/2000/svg",e.Browser.svg=!(!b.createElementNS||!b.createElementNS(e.Path.SVG_NS,"svg").createSVGRect),e.Path=e.Path.extend({statics:{SVG:e.Browser.svg},bringToFront:function(){var a=this._map._pathRoot,b=this._container;return b&&a.lastChild!==b&&a.appendChild(b),this},bringToBack:function(){var a=this._map._pathRoot,b=this._container,c=a.firstChild;return b&&c!==b&&a.insertBefore(b,c),this},getPathString:function(){},_createElement:function(a){return b.createElementNS(e.Path.SVG_NS,a)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var a=this.getPathString();a||(a="M0 0"),this._path.setAttribute("d",a)},_initEvents:function(){if(this.options.clickable){(e.Browser.svg||!e.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),e.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var a=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],b=0;b';var c=a.firstChild;return c.style.behavior="url(#default#VML)",c&&"object"==typeof c.adj}catch(d){return!1}}(),e.Path=e.Browser.svg||!e.Browser.vml?e.Path:e.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return b.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(a){return b.createElement("')}}catch(a){return function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var a=this._container=this._createElement("shape");e.DomUtil.addClass(a,"leaflet-vml-shape"),this.options.clickable&&e.DomUtil.addClass(a,"leaflet-clickable"),a.coordsize="1 1",this._path=this._createElement("path"),a.appendChild(this._path),this._map._pathRoot.appendChild(a)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var a=this._stroke,b=this._fill,c=this.options,d=this._container;d.stroked=c.stroke,d.filled=c.fill,c.stroke?(a||(a=this._stroke=this._createElement("stroke"),a.endcap="round",d.appendChild(a)),a.weight=c.weight+"px",a.color=c.color,a.opacity=c.opacity,a.dashStyle=c.dashArray?c.dashArray instanceof Array?c.dashArray.join(" "):c.dashArray.replace(/( *, *)/g," "):""):a&&(d.removeChild(a),this._stroke=null),c.fill?(b||(b=this._fill=this._createElement("fill"),d.appendChild(b)),b.color=c.fillColor||c.color,b.opacity=c.fillOpacity):b&&(d.removeChild(b),this._fill=null) +},_updatePath:function(){var a=this._container.style;a.display="none",this._path.v=this.getPathString()+" ",a.display=""}}),e.Map.include(e.Browser.svg||!e.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var a=this._pathRoot=b.createElement("div");a.className="leaflet-vml-container",this._panes.overlayPane.appendChild(a),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),e.Browser.canvas=function(){return!!b.createElement("canvas").getContext}(),e.Path=e.Path.SVG&&!a.L_PREFER_CANVAS||!e.Browser.canvas?e.Path:e.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(a){return e.setOptions(this,a),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(a){a.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!e.Path._updateRequest&&(e.Path._updateRequest=e.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){e.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var a=this.options;a.stroke&&(this._ctx.lineWidth=a.weight,this._ctx.strokeStyle=a.color),a.fill&&(this._ctx.fillStyle=a.fillColor||a.color)},_drawPath:function(){var a,b,c,d,f,g;for(this._ctx.beginPath(),a=0,c=this._parts.length;c>a;a++){for(b=0,d=this._parts[a].length;d>b;b++)f=this._parts[a][b],g=(0===b?"move":"line")+"To",this._ctx[g](f.x,f.y);this instanceof e.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var a=this._ctx,b=this.options;this._drawPath(),a.save(),this._updateStyle(),b.fill&&(a.globalAlpha=b.fillOpacity,a.fill()),b.stroke&&(a.globalAlpha=b.opacity,a.stroke()),a.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(a){this._containsPoint(a.layerPoint)&&this.fire("click",a)},_onMouseMove:function(a){this._map&&!this._map._animatingZoom&&(this._containsPoint(a.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",a)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",a)))}}),e.Map.include(e.Path.SVG&&!a.L_PREFER_CANVAS||!e.Browser.canvas?{}:{_initPathRoot:function(){var a,c=this._pathRoot;c||(c=this._pathRoot=b.createElement("canvas"),c.style.position="absolute",a=this._canvasCtx=c.getContext("2d"),a.lineCap="round",a.lineJoin="round",this._panes.overlayPane.appendChild(c),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var a=this._pathViewport,b=a.min,c=a.max.subtract(b),d=this._pathRoot;e.DomUtil.setPosition(d,b),d.width=c.x,d.height=c.y,d.getContext("2d").translate(-b.x,-b.y)}}}),e.LineUtil={simplify:function(a,b){if(!b||!a.length)return a.slice();var c=b*b;return a=this._reducePoints(a,c),a=this._simplifyDP(a,c)},pointToSegmentDistance:function(a,b,c){return Math.sqrt(this._sqClosestPointOnSegment(a,b,c,!0))},closestPointOnSegment:function(a,b,c){return this._sqClosestPointOnSegment(a,b,c)},_simplifyDP:function(a,b){var d=a.length,e=typeof Uint8Array!=c+""?Uint8Array:Array,f=new e(d);f[0]=f[d-1]=1,this._simplifyDPStep(a,f,b,0,d-1);var g,h=[];for(g=0;d>g;g++)f[g]&&h.push(a[g]);return h},_simplifyDPStep:function(a,b,c,d,e){var f,g,h,i=0;for(g=d+1;e-1>=g;g++)h=this._sqClosestPointOnSegment(a[g],a[d],a[e],!0),h>i&&(f=g,i=h);i>c&&(b[f]=1,this._simplifyDPStep(a,b,c,d,f),this._simplifyDPStep(a,b,c,f,e))},_reducePoints:function(a,b){for(var c=[a[0]],d=1,e=0,f=a.length;f>d;d++)this._sqDist(a[d],a[e])>b&&(c.push(a[d]),e=d);return f-1>e&&c.push(a[f-1]),c},clipSegment:function(a,b,c,d){var e,f,g,h=d?this._lastCode:this._getBitCode(a,c),i=this._getBitCode(b,c);for(this._lastCode=i;;){if(!(h|i))return[a,b];if(h&i)return!1;e=h||i,f=this._getEdgeIntersection(a,b,e,c),g=this._getBitCode(f,c),e===h?(a=f,h=g):(b=f,i=g)}},_getEdgeIntersection:function(a,b,c,d){var f=b.x-a.x,g=b.y-a.y,h=d.min,i=d.max;return 8&c?new e.Point(a.x+f*(i.y-a.y)/g,i.y):4&c?new e.Point(a.x+f*(h.y-a.y)/g,h.y):2&c?new e.Point(i.x,a.y+g*(i.x-a.x)/f):1&c?new e.Point(h.x,a.y+g*(h.x-a.x)/f):void 0},_getBitCode:function(a,b){var c=0;return a.xb.max.x&&(c|=2),a.yb.max.y&&(c|=8),c},_sqDist:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d},_sqClosestPointOnSegment:function(a,b,c,d){var f,g=b.x,h=b.y,i=c.x-g,j=c.y-h,k=i*i+j*j;return k>0&&(f=((a.x-g)*i+(a.y-h)*j)/k,f>1?(g=c.x,h=c.y):f>0&&(g+=i*f,h+=j*f)),i=a.x-g,j=a.y-h,d?i*i+j*j:new e.Point(g,h)}},e.Polyline=e.Path.extend({initialize:function(a,b){e.Path.prototype.initialize.call(this,b),this._latlngs=this._convertLatLngs(a)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var a=0,b=this._latlngs.length;b>a;a++)this._originalPoints[a]=this._map.latLngToLayerPoint(this._latlngs[a])},getPathString:function(){for(var a=0,b=this._parts.length,c="";b>a;a++)c+=this._getPathPartStr(this._parts[a]);return c},getLatLngs:function(){return this._latlngs},setLatLngs:function(a){return this._latlngs=this._convertLatLngs(a),this.redraw()},addLatLng:function(a){return this._latlngs.push(e.latLng(a)),this.redraw()},spliceLatLngs:function(){var a=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),a},closestLayerPoint:function(a){for(var b,c,d=1/0,f=this._parts,g=null,h=0,i=f.length;i>h;h++)for(var j=f[h],k=1,l=j.length;l>k;k++){b=j[k-1],c=j[k];var m=e.LineUtil._sqClosestPointOnSegment(a,b,c,!0);d>m&&(d=m,g=e.LineUtil._sqClosestPointOnSegment(a,b,c))}return g&&(g.distance=Math.sqrt(d)),g},getBounds:function(){return new e.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(a,b){var c,d,f=b?a:[];for(c=0,d=a.length;d>c;c++){if(e.Util.isArray(a[c])&&"number"!=typeof a[c][0])return;f[c]=e.latLng(a[c])}return f},_initEvents:function(){e.Path.prototype._initEvents.call(this)},_getPathPartStr:function(a){for(var b,c=e.Path.VML,d=0,f=a.length,g="";f>d;d++)b=a[d],c&&b._round(),g+=(d?"L":"M")+b.x+" "+b.y;return g},_clipPoints:function(){var a,b,c,d=this._originalPoints,f=d.length;if(this.options.noClip)return this._parts=[d],void 0;this._parts=[];var g=this._parts,h=this._map._pathViewport,i=e.LineUtil;for(a=0,b=0;f-1>a;a++)c=i.clipSegment(d[a],d[a+1],h,a),c&&(g[b]=g[b]||[],g[b].push(c[0]),(c[1]!==d[a+1]||a===f-2)&&(g[b].push(c[1]),b++))},_simplifyPoints:function(){for(var a=this._parts,b=e.LineUtil,c=0,d=a.length;d>c;c++)a[c]=b.simplify(a[c],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),e.Path.prototype._updatePath.call(this))}}),e.polyline=function(a,b){return new e.Polyline(a,b)},e.PolyUtil={},e.PolyUtil.clipPolygon=function(a,b){var c,d,f,g,h,i,j,k,l,m=[1,4,2,8],n=e.LineUtil;for(d=0,j=a.length;j>d;d++)a[d]._code=n._getBitCode(a[d],b);for(g=0;4>g;g++){for(k=m[g],c=[],d=0,j=a.length,f=j-1;j>d;f=d++)h=a[d],i=a[f],h._code&k?i._code&k||(l=n._getEdgeIntersection(i,h,k,b),l._code=n._getBitCode(l,b),c.push(l)):(i._code&k&&(l=n._getEdgeIntersection(i,h,k,b),l._code=n._getBitCode(l,b),c.push(l)),c.push(h));a=c}return a},e.Polygon=e.Polyline.extend({options:{fill:!0},initialize:function(a,b){var c,d,f;if(e.Polyline.prototype.initialize.call(this,a,b),a&&e.Util.isArray(a[0])&&"number"!=typeof a[0][0])for(this._latlngs=this._convertLatLngs(a[0]),this._holes=a.slice(1),c=0,d=this._holes.length;d>c;c++)f=this._holes[c]=this._convertLatLngs(this._holes[c]),f[0].equals(f[f.length-1])&&f.pop();a=this._latlngs,a.length>=2&&a[0].equals(a[a.length-1])&&a.pop()},projectLatlngs:function(){if(e.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var a,b,c,d;for(a=0,c=this._holes.length;c>a;a++)for(this._holePoints[a]=[],b=0,d=this._holes[a].length;d>b;b++)this._holePoints[a][b]=this._map.latLngToLayerPoint(this._holes[a][b])}},_clipPoints:function(){var a=this._originalPoints,b=[];if(this._parts=[a].concat(this._holePoints),!this.options.noClip){for(var c=0,d=this._parts.length;d>c;c++){var f=e.PolyUtil.clipPolygon(this._parts[c],this._map._pathViewport);f.length&&b.push(f)}this._parts=b}},_getPathPartStr:function(a){var b=e.Polyline.prototype._getPathPartStr.call(this,a);return b+(e.Browser.svg?"z":"x")}}),e.polygon=function(a,b){return new e.Polygon(a,b)},function(){function a(a){return e.FeatureGroup.extend({initialize:function(a,b){this._layers={},this._options=b,this.setLatLngs(a)},setLatLngs:function(b){var c=0,d=b.length;for(this.eachLayer(function(a){d>c?a.setLatLngs(b[c++]):this.removeLayer(a)},this);d>c;)this.addLayer(new a(b[c++],this._options));return this}})}e.MultiPolyline=a(e.Polyline),e.MultiPolygon=a(e.Polygon),e.multiPolyline=function(a,b){return new e.MultiPolyline(a,b)},e.multiPolygon=function(a,b){return new e.MultiPolygon(a,b)}}(),e.Rectangle=e.Polygon.extend({initialize:function(a,b){e.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(a),b)},setBounds:function(a){this.setLatLngs(this._boundsToLatLngs(a))},_boundsToLatLngs:function(a){return a=e.latLngBounds(a),[a.getSouthWest(),a.getNorthWest(),a.getNorthEast(),a.getSouthEast()]}}),e.rectangle=function(a,b){return new e.Rectangle(a,b)},e.Circle=e.Path.extend({initialize:function(a,b,c){e.Path.prototype.initialize.call(this,c),this._latlng=e.latLng(a),this._mRadius=b},options:{fill:!0},setLatLng:function(a){return this._latlng=e.latLng(a),this.redraw()},setRadius:function(a){return this._mRadius=a,this.redraw()},projectLatlngs:function(){var a=this._getLngRadius(),b=this._latlng,c=this._map.latLngToLayerPoint([b.lat,b.lng-a]);this._point=this._map.latLngToLayerPoint(b),this._radius=Math.max(this._point.x-c.x,1)},getBounds:function(){var a=this._getLngRadius(),b=360*(this._mRadius/40075017),c=this._latlng;return new e.LatLngBounds([c.lat-b,c.lng-a],[c.lat+b,c.lng+a])},getLatLng:function(){return this._latlng},getPathString:function(){var a=this._point,b=this._radius;return this._checkIfEmpty()?"":e.Browser.svg?"M"+a.x+","+(a.y-b)+"A"+b+","+b+",0,1,1,"+(a.x-.1)+","+(a.y-b)+" z":(a._round(),b=Math.round(b),"AL "+a.x+","+a.y+" "+b+","+b+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(e.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var a=this._map._pathViewport,b=this._radius,c=this._point;return c.x-b>a.max.x||c.y-b>a.max.y||c.x+bc;c++)for(j=this._parts[c],d=0,h=j.length,f=h-1;h>d;f=d++)if((b||0!==d)&&(i=e.LineUtil.pointToSegmentDistance(a,j[f],j[d]),k>=i))return!0;return!1}}:{}),e.Polygon.include(e.Path.CANVAS?{_containsPoint:function(a){var b,c,d,f,g,h,i,j,k=!1;if(e.Polyline.prototype._containsPoint.call(this,a,!0))return!0;for(f=0,i=this._parts.length;i>f;f++)for(b=this._parts[f],g=0,j=b.length,h=j-1;j>g;h=g++)c=b[g],d=b[h],c.y>a.y!=d.y>a.y&&a.x<(d.x-c.x)*(a.y-c.y)/(d.y-c.y)+c.x&&(k=!k);return k}}:{}),e.Circle.include(e.Path.CANVAS?{_drawPath:function(){var a=this._point;this._ctx.beginPath(),this._ctx.arc(a.x,a.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(a){var b=this._point,c=this.options.stroke?this.options.weight/2:0;return a.distanceTo(b)<=this._radius+c}}:{}),e.CircleMarker.include(e.Path.CANVAS?{_updateStyle:function(){e.Path.prototype._updateStyle.call(this)}}:{}),e.GeoJSON=e.FeatureGroup.extend({initialize:function(a,b){e.setOptions(this,b),this._layers={},a&&this.addData(a)},addData:function(a){var b,c,d=e.Util.isArray(a)?a:a.features;if(d){for(b=0,c=d.length;c>b;b++)(d[b].geometries||d[b].geometry||d[b].features)&&this.addData(d[b]);return this}var f=this.options;if(!f.filter||f.filter(a)){var g=e.GeoJSON.geometryToLayer(a,f.pointToLayer,f.coordsToLatLng);return g.feature=a,g.defaultOptions=g.options,this.resetStyle(g),f.onEachFeature&&f.onEachFeature(a,g),this.addLayer(g)}},resetStyle:function(a){var b=this.options.style;b&&(e.Util.extend(a.options,a.defaultOptions),this._setLayerStyle(a,b))},setStyle:function(a){this.eachLayer(function(b){this._setLayerStyle(b,a)},this)},_setLayerStyle:function(a,b){"function"==typeof b&&(b=b(a.feature)),a.setStyle&&a.setStyle(b)}}),e.extend(e.GeoJSON,{geometryToLayer:function(a,b,c){var d,f,g,h,i,j="Feature"===a.type?a.geometry:a,k=j.coordinates,l=[];switch(c=c||this.coordsToLatLng,j.type){case"Point":return d=c(k),b?b(a,d):new e.Marker(d);case"MultiPoint":for(g=0,h=k.length;h>g;g++)d=c(k[g]),i=b?b(a,d):new e.Marker(d),l.push(i);return new e.FeatureGroup(l);case"LineString":return f=this.coordsToLatLngs(k,0,c),new e.Polyline(f);case"Polygon":return f=this.coordsToLatLngs(k,1,c),new e.Polygon(f);case"MultiLineString":return f=this.coordsToLatLngs(k,1,c),new e.MultiPolyline(f);case"MultiPolygon":return f=this.coordsToLatLngs(k,2,c),new e.MultiPolygon(f);case"GeometryCollection":for(g=0,h=j.geometries.length;h>g;g++)i=this.geometryToLayer({geometry:j.geometries[g],type:"Feature",properties:a.properties},b),l.push(i);return new e.FeatureGroup(l);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(a){return new e.LatLng(a[1],a[0])},coordsToLatLngs:function(a,b,c){var d,e,f,g=[];for(e=0,f=a.length;f>e;e++)d=b?this.coordsToLatLngs(a[e],b-1,c):(c||this.coordsToLatLng)(a[e]),g.push(d);return g},latLngToCoords:function(a){return[a.lng,a.lat]},latLngsToCoords:function(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(e.GeoJSON.latLngToCoords(a[c]));return b}}),e.Marker.include({toGeoJSON:function(){return{type:"Point",coordinates:e.GeoJSON.latLngToCoords(this.getLatLng())}}}),e.Polyline.include({toGeoJSON:function(){return{type:"LineString",coordinates:e.GeoJSON.latLngsToCoords(this.getLatLngs())}}}),e.Polygon.include({toGeoJSON:function(){var a,b,c,d=[e.GeoJSON.latLngsToCoords(this.getLatLngs())];if(d[0].push(d[0][0]),this._holes)for(a=0,b=this._holes.length;b>a;a++)c=e.GeoJSON.latLngsToCoords(this._holes[a]),c.push(c[0]),d.push(c);return{type:"Polygon",coordinates:d}}}),function(){function a(a,b){a.include({toGeoJSON:function(){var a=[];return this.eachLayer(function(b){a.push(b.toGeoJSON().coordinates)}),{type:b,coordinates:a}}})}a(e.MultiPolyline,"MultiLineString"),a(e.MultiPolygon,"MultiPolygon")}(),e.LayerGroup.include({toGeoJSON:function(){var a=[];return this.eachLayer(function(b){b.toGeoJSON&&a.push(b.toGeoJSON())}),{type:"GeometryCollection",geometries:a}}}),e.geoJson=function(a,b){return new e.GeoJSON(a,b)},e.DomEvent={addListener:function(a,b,c,d){var f,g,h,i=e.stamp(c),j="_leaflet_"+b+i;return a[j]?this:(f=function(b){return c.call(d||a,b||e.DomEvent._getEvent())},e.Browser.msTouch&&0===b.indexOf("touch")?this.addMsTouchListener(a,b,f,i):(e.Browser.touch&&"dblclick"===b&&this.addDoubleTapListener&&this.addDoubleTapListener(a,f,i),"addEventListener"in a?"mousewheel"===b?(a.addEventListener("DOMMouseScroll",f,!1),a.addEventListener(b,f,!1)):"mouseenter"===b||"mouseleave"===b?(g=f,h="mouseenter"===b?"mouseover":"mouseout",f=function(b){return e.DomEvent._checkMouse(a,b)?g(b):void 0},a.addEventListener(h,f,!1)):"click"===b&&e.Browser.android?(g=f,f=function(a){return e.DomEvent._filterClick(a,g)},a.addEventListener(b,f,!1)):a.addEventListener(b,f,!1):"attachEvent"in a&&a.attachEvent("on"+b,f),a[j]=f,this))},removeListener:function(a,b,c){var d=e.stamp(c),f="_leaflet_"+b+d,g=a[f];return g?(e.Browser.msTouch&&0===b.indexOf("touch")?this.removeMsTouchListener(a,b,d):e.Browser.touch&&"dblclick"===b&&this.removeDoubleTapListener?this.removeDoubleTapListener(a,d):"removeEventListener"in a?"mousewheel"===b?(a.removeEventListener("DOMMouseScroll",g,!1),a.removeEventListener(b,g,!1)):"mouseenter"===b||"mouseleave"===b?a.removeEventListener("mouseenter"===b?"mouseover":"mouseout",g,!1):a.removeEventListener(b,g,!1):"detachEvent"in a&&a.detachEvent("on"+b,g),a[f]=null,this):this},stopPropagation:function(a){return a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,this},disableClickPropagation:function(a){for(var b=e.DomEvent.stopPropagation,c=e.Draggable.START.length-1;c>=0;c--)e.DomEvent.addListener(a,e.Draggable.START[c],b);return e.DomEvent.addListener(a,"click",b).addListener(a,"dblclick",b)},preventDefault:function(a){return a.preventDefault?a.preventDefault():a.returnValue=!1,this},stop:function(a){return e.DomEvent.preventDefault(a).stopPropagation(a)},getMousePosition:function(a,c){var d=b.body,f=b.documentElement,g=a.pageX?a.pageX:a.clientX+d.scrollLeft+f.scrollLeft,h=a.pageY?a.pageY:a.clientY+d.scrollTop+f.scrollTop,i=new e.Point(g,h);return c?i._subtract(e.DomUtil.getViewportOffset(c)):i},getWheelDelta:function(a){var b=0;return a.wheelDelta&&(b=a.wheelDelta/120),a.detail&&(b=-a.detail/3),b},_checkMouse:function(a,b){var c=b.relatedTarget;if(!c)return!0;try{for(;c&&c!==a;)c=c.parentNode}catch(d){return!1}return c!==a},_getEvent:function(){var b=a.event;if(!b)for(var c=arguments.callee.caller;c&&(b=c.arguments[0],!b||a.Event!==b.constructor);)c=c.caller;return b},_filterClick:function(a,b){var c=a.timeStamp||a.originalEvent.timeStamp,d=e.DomEvent._lastClick&&c-e.DomEvent._lastClick;return d&&d>100&&400>d?(e.DomEvent.stop(a),void 0):(e.DomEvent._lastClick=c,b(a))}},e.DomEvent.on=e.DomEvent.addListener,e.DomEvent.off=e.DomEvent.removeListener,e.Draggable=e.Class.extend({includes:e.Mixin.Events,statics:{START:e.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"},TAP_TOLERANCE:15},initialize:function(a,b,c){this._element=a,this._dragStartTarget=b||a,this._longPress=c&&!e.Browser.msTouch},enable:function(){if(!this._enabled){for(var a=e.Draggable.START.length-1;a>=0;a--)e.DomEvent.on(this._dragStartTarget,e.Draggable.START[a],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var a=e.Draggable.START.length-1;a>=0;a--)e.DomEvent.off(this._dragStartTarget,e.Draggable.START[a],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(a){if(!a.shiftKey&&(1===a.which||1===a.button||a.touches)&&(e.DomEvent.preventDefault(a).stopPropagation(a),!e.Draggable._disabled)){this._simulateClick=!0;var c=a.touches&&a.touches.length||0;if(c>1)return this._simulateClick=!1,clearTimeout(this._longPressTimeout),void 0;var d=1===c?a.touches[0]:a,f=d.target;e.Browser.touch&&"a"===f.tagName.toLowerCase()&&e.DomUtil.addClass(f,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new e.Point(d.clientX,d.clientY),this._startPos=this._newPos=e.DomUtil.getPosition(this._element),1===c&&e.Browser.touch&&this._longPress&&(this._longPressTimeout=setTimeout(e.bind(function(){var a=this._newPos&&this._newPos.distanceTo(this._startPos)||0;a1)){var c=a.touches&&1===a.touches.length?a.touches[0]:a,d=new e.Point(c.clientX,c.clientY),f=d.subtract(this._startPoint);(f.x||f.y)&&(e.DomEvent.preventDefault(a),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=e.DomUtil.getPosition(this._element).subtract(f),e.Browser.touch||(e.DomUtil.disableTextSelection(),e.DomUtil.addClass(b.body,"leaflet-dragging"))),this._newPos=this._startPos.add(f),this._moving=!0,e.Util.cancelAnimFrame(this._animRequest),this._animRequest=e.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),e.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(a){var c,d,f,g,h;clearTimeout(this._longPressTimeout),this._simulateClick&&a.changedTouches&&(f=this._newPos&&this._newPos.distanceTo(this._startPos)||0,c=a.changedTouches[0],d=c.target,"a"===d.tagName.toLowerCase()&&e.DomUtil.removeClass(d,"leaflet-active"),f200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var a=this._map.getSize()._divideBy(2),b=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=b.subtract(a).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var a=this._worldWidth,b=Math.round(a/2),c=this._initialWorldOffset,d=this._draggable._newPos.x,e=(d-b+c)%a+b-c,f=(d+b+c)%a-b-c,g=Math.abs(e+c)b.inertiaThreshold||!this._positions[0];if(a.fire("dragend"),d)a.fire("moveend");else{var f=this._lastPos.subtract(this._positions[0]),g=(this._lastTime+c-this._times[0])/1e3,h=b.easeLinearity,i=f.multiplyBy(h/g),j=i.distanceTo([0,0]),k=Math.min(b.inertiaMaxSpeed,j),l=i.multiplyBy(k/j),m=k/(b.inertiaDeceleration*h),n=l.multiplyBy(-m/2).round();n.x&&n.y?e.Util.requestAnimFrame(function(){a.panBy(n,{duration:m,easeLinearity:h,noMoveStart:!0})}):a.fire("moveend")}}}),e.Map.addInitHook("addHandler","dragging",e.Map.Drag),e.Map.mergeOptions({doubleClickZoom:!0}),e.Map.DoubleClickZoom=e.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(a){this.setZoomAround(a.containerPoint,this._zoom+1)}}),e.Map.addInitHook("addHandler","doubleClickZoom",e.Map.DoubleClickZoom),e.Map.mergeOptions({scrollWheelZoom:!0}),e.Map.ScrollWheelZoom=e.Handler.extend({addHooks:function(){e.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){e.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(a){var b=e.DomEvent.getWheelDelta(a);this._delta+=b,this._lastMousePos=this._map.mouseEventToContainerPoint(a),this._startTime||(this._startTime=+new Date);var c=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(e.bind(this._performZoom,this),c),e.DomEvent.preventDefault(a),e.DomEvent.stopPropagation(a)},_performZoom:function(){var a=this._map,b=this._delta,c=a.getZoom();b=b>0?Math.ceil(b):Math.floor(b),b=Math.max(Math.min(b,4),-4),b=a._limitZoom(c+b)-c,this._delta=0,this._startTime=null,b&&a.setZoomAround(this._lastMousePos,c+b)}}),e.Map.addInitHook("addHandler","scrollWheelZoom",e.Map.ScrollWheelZoom),e.extend(e.DomEvent,{_touchstart:e.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:e.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(a,c,d){function f(a){var b;if(e.Browser.msTouch?(o.push(a.pointerId),b=o.length):b=a.touches.length,!(b>1)){var c=Date.now(),d=c-(h||c);i=a.touches?a.touches[0]:a,j=d>0&&k>=d,h=c}}function g(a){if(e.Browser.msTouch){var b=o.indexOf(a.pointerId);if(-1===b)return;o.splice(b,1)}if(j){if(e.Browser.msTouch){var d,f={};for(var g in i)d=i[g],f[g]="function"==typeof d?d.bind(i):d;i=f}i.type="dblclick",c(i),h=null}}var h,i,j=!1,k=250,l="_leaflet_",m=this._touchstart,n=this._touchend,o=[];a[l+m+d]=f,a[l+n+d]=g;var p=e.Browser.msTouch?b.documentElement:a;return a.addEventListener(m,f,!1),p.addEventListener(n,g,!1),e.Browser.msTouch&&p.addEventListener("MSPointerCancel",g,!1),this},removeDoubleTapListener:function(a,c){var d="_leaflet_";return a.removeEventListener(this._touchstart,a[d+this._touchstart+c],!1),(e.Browser.msTouch?b.documentElement:a).removeEventListener(this._touchend,a[d+this._touchend+c],!1),e.Browser.msTouch&&b.documentElement.removeEventListener("MSPointerCancel",a[d+this._touchend+c],!1),this}}),e.extend(e.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(a,b,c,d){switch(b){case"touchstart":return this.addMsTouchListenerStart(a,b,c,d);case"touchend":return this.addMsTouchListenerEnd(a,b,c,d);case"touchmove":return this.addMsTouchListenerMove(a,b,c,d);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(a,c,d,e){var f="_leaflet_",g=this._msTouches,h=function(a){for(var b=!1,c=0;c0?Math.ceil(g):Math.floor(g),i=a._limitZoom(f+h),j=a.getZoomScale(i)/this._scale;a._animateZoom(d,i,c,j)},_getScaleOrigin:function(){var a=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(a)}}),e.Map.addInitHook("addHandler","touchZoom",e.Map.TouchZoom),e.Map.mergeOptions({boxZoom:!0}),e.Map.BoxZoom=e.Handler.extend({initialize:function(a){this._map=a,this._container=a._container,this._pane=a._panes.overlayPane},addHooks:function(){e.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){e.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(a){return!a.shiftKey||1!==a.which&&1!==a.button?!1:(e.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(a),this._box=e.DomUtil.create("div","leaflet-zoom-box",this._pane),e.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",e.DomEvent.on(b,"mousemove",this._onMouseMove,this).on(b,"mouseup",this._onMouseUp,this).on(b,"keydown",this._onKeyDown,this).preventDefault(a),this._map.fire("boxzoomstart"),void 0)},_onMouseMove:function(a){var b=this._startLayerPoint,c=this._box,d=this._map.mouseEventToLayerPoint(a),f=d.subtract(b),g=new e.Point(Math.min(d.x,b.x),Math.min(d.y,b.y));e.DomUtil.setPosition(c,g),c.style.width=Math.max(0,Math.abs(f.x)-4)+"px",c.style.height=Math.max(0,Math.abs(f.y)-4)+"px" +},_finish:function(){this._pane.removeChild(this._box),this._container.style.cursor="",e.DomUtil.enableTextSelection(),e.DomEvent.off(b,"mousemove",this._onMouseMove).off(b,"mouseup",this._onMouseUp).off(b,"keydown",this._onKeyDown)},_onMouseUp:function(a){this._finish();var b=this._map,c=b.mouseEventToLayerPoint(a);if(!this._startLayerPoint.equals(c)){var d=new e.LatLngBounds(b.layerPointToLatLng(this._startLayerPoint),b.layerPointToLatLng(c));b.fitBounds(d),b.fire("boxzoomend",{boxZoomBounds:d})}},_onKeyDown:function(a){27===a.keyCode&&this._finish()}}),e.Map.addInitHook("addHandler","boxZoom",e.Map.BoxZoom),e.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),e.Map.Keyboard=e.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(a){this._map=a,this._setPanOffset(a.options.keyboardPanOffset),this._setZoomOffset(a.options.keyboardZoomOffset)},addHooks:function(){var a=this._map._container;-1===a.tabIndex&&(a.tabIndex="0"),e.DomEvent.on(a,"focus",this._onFocus,this).on(a,"blur",this._onBlur,this).on(a,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var a=this._map._container;e.DomEvent.off(a,"focus",this._onFocus,this).off(a,"blur",this._onBlur,this).off(a,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var c=b.body,d=b.documentElement,e=c.scrollTop||d.scrollTop,f=c.scrollTop||d.scrollLeft;this._map._container.focus(),a.scrollTo(f,e)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(a){var b,c,d=this._panKeys={},e=this.keyCodes;for(b=0,c=e.left.length;c>b;b++)d[e.left[b]]=[-1*a,0];for(b=0,c=e.right.length;c>b;b++)d[e.right[b]]=[a,0];for(b=0,c=e.down.length;c>b;b++)d[e.down[b]]=[0,a];for(b=0,c=e.up.length;c>b;b++)d[e.up[b]]=[0,-1*a]},_setZoomOffset:function(a){var b,c,d=this._zoomKeys={},e=this.keyCodes;for(b=0,c=e.zoomIn.length;c>b;b++)d[e.zoomIn[b]]=a;for(b=0,c=e.zoomOut.length;c>b;b++)d[e.zoomOut[b]]=-a},_addHooks:function(){e.DomEvent.on(b,"keydown",this._onKeyDown,this)},_removeHooks:function(){e.DomEvent.off(b,"keydown",this._onKeyDown,this)},_onKeyDown:function(a){var b=a.keyCode,c=this._map;if(b in this._panKeys)c.panBy(this._panKeys[b]),c.options.maxBounds&&c.panInsideBounds(c.options.maxBounds);else{if(!(b in this._zoomKeys))return;c.setZoom(c.getZoom()+this._zoomKeys[b])}e.DomEvent.stop(a)}}),e.Map.addInitHook("addHandler","keyboard",e.Map.Keyboard),e.Handler.MarkerDrag=e.Handler.extend({initialize:function(a){this._marker=a},addHooks:function(){var a=this._marker._icon;this._draggable||(this._draggable=new e.Draggable(a,a)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable()},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart).off("drag",this._onDrag).off("dragend",this._onDragEnd),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var a=this._marker,b=a._shadow,c=e.DomUtil.getPosition(a._icon),d=a._map.layerPointToLatLng(c);b&&e.DomUtil.setPosition(b,c),a._latlng=d,a.fire("move",{latlng:d}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),e.Control=e.Class.extend({options:{position:"topright"},initialize:function(a){e.setOptions(this,a)},getPosition:function(){return this.options.position},setPosition:function(a){var b=this._map;return b&&b.removeControl(this),this.options.position=a,b&&b.addControl(this),this},getContainer:function(){return this._container},addTo:function(a){this._map=a;var b=this._container=this.onAdd(a),c=this.getPosition(),d=a._controlCorners[c];return e.DomUtil.addClass(b,"leaflet-control"),-1!==c.indexOf("bottom")?d.insertBefore(b,d.firstChild):d.appendChild(b),this},removeFrom:function(a){var b=this.getPosition(),c=a._controlCorners[b];return c.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(a),this}}),e.control=function(a){return new e.Control(a)},e.Map.include({addControl:function(a){return a.addTo(this),this},removeControl:function(a){return a.removeFrom(this),this},_initControlPos:function(){function a(a,f){var g=c+a+" "+c+f;b[a+f]=e.DomUtil.create("div",g,d)}var b=this._controlCorners={},c="leaflet-",d=this._controlContainer=e.DomUtil.create("div",c+"control-container",this._container);a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),e.Control.Zoom=e.Control.extend({options:{position:"topleft"},onAdd:function(a){var b="leaflet-control-zoom",c=e.DomUtil.create("div",b+" leaflet-bar");return this._map=a,this._zoomInButton=this._createButton("+","Zoom in",b+"-in",c,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",b+"-out",c,this._zoomOut,this),a.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(a){a.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(a){this._map.zoomIn(a.shiftKey?3:1)},_zoomOut:function(a){this._map.zoomOut(a.shiftKey?3:1)},_createButton:function(a,b,c,d,f,g){var h=e.DomUtil.create("a",c,d);h.innerHTML=a,h.href="#",h.title=b;var i=e.DomEvent.stopPropagation;return e.DomEvent.on(h,"click",i).on(h,"mousedown",i).on(h,"dblclick",i).on(h,"click",e.DomEvent.preventDefault).on(h,"click",f,g),h},_updateDisabled:function(){var a=this._map,b="leaflet-disabled";e.DomUtil.removeClass(this._zoomInButton,b),e.DomUtil.removeClass(this._zoomOutButton,b),a._zoom===a.getMinZoom()&&e.DomUtil.addClass(this._zoomOutButton,b),a._zoom===a.getMaxZoom()&&e.DomUtil.addClass(this._zoomInButton,b)}}),e.Map.mergeOptions({zoomControl:!0}),e.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new e.Control.Zoom,this.addControl(this.zoomControl))}),e.control.zoom=function(a){return new e.Control.Zoom(a)},e.Control.Attribution=e.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(a){e.setOptions(this,a),this._attributions={}},onAdd:function(a){return this._container=e.DomUtil.create("div","leaflet-control-attribution"),e.DomEvent.disableClickPropagation(this._container),a.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(a){a.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(a){return this.options.prefix=a,this._update(),this},addAttribution:function(a){return a?(this._attributions[a]||(this._attributions[a]=0),this._attributions[a]++,this._update(),this):void 0},removeAttribution:function(a){return a?(this._attributions[a]&&(this._attributions[a]--,this._update()),this):void 0},_update:function(){if(this._map){var a=[];for(var b in this._attributions)this._attributions[b]&&a.push(b);var c=[];this.options.prefix&&c.push(this.options.prefix),a.length&&c.push(a.join(", ")),this._container.innerHTML=c.join(" | ")}},_onLayerAdd:function(a){a.layer.getAttribution&&this.addAttribution(a.layer.getAttribution())},_onLayerRemove:function(a){a.layer.getAttribution&&this.removeAttribution(a.layer.getAttribution())}}),e.Map.mergeOptions({attributionControl:!0}),e.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new e.Control.Attribution).addTo(this))}),e.control.attribution=function(a){return new e.Control.Attribution(a)},e.Control.Scale=e.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(a){this._map=a;var b="leaflet-control-scale",c=e.DomUtil.create("div",b),d=this.options;return this._addScales(d,b,c),a.on(d.updateWhenIdle?"moveend":"move",this._update,this),a.whenReady(this._update,this),c},onRemove:function(a){a.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(a,b,c){a.metric&&(this._mScale=e.DomUtil.create("div",b+"-line",c)),a.imperial&&(this._iScale=e.DomUtil.create("div",b+"-line",c))},_update:function(){var a=this._map.getBounds(),b=a.getCenter().lat,c=6378137*Math.PI*Math.cos(b*Math.PI/180),d=c*(a.getNorthEast().lng-a.getSouthWest().lng)/180,e=this._map.getSize(),f=this.options,g=0;e.x>0&&(g=d*(f.maxWidth/e.x)),this._updateScales(f,g)},_updateScales:function(a,b){a.metric&&b&&this._updateMetric(b),a.imperial&&b&&this._updateImperial(b)},_updateMetric:function(a){var b=this._getRoundNum(a);this._mScale.style.width=this._getScaleWidth(b/a)+"px",this._mScale.innerHTML=1e3>b?b+" m":b/1e3+" km"},_updateImperial:function(a){var b,c,d,e=3.2808399*a,f=this._iScale;e>5280?(b=e/5280,c=this._getRoundNum(b),f.style.width=this._getScaleWidth(c/b)+"px",f.innerHTML=c+" mi"):(d=this._getRoundNum(e),f.style.width=this._getScaleWidth(d/e)+"px",f.innerHTML=d+" ft")},_getScaleWidth:function(a){return Math.round(this.options.maxWidth*a)-10},_getRoundNum:function(a){var b=Math.pow(10,(Math.floor(a)+"").length-1),c=a/b;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,b*c}}),e.control.scale=function(a){return new e.Control.Scale(a)},e.Control.Layers=e.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(a,b,c){e.setOptions(this,c),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var d in a)this._addLayer(a[d],d);for(d in b)this._addLayer(b[d],d,!0)},onAdd:function(a){return this._initLayout(),this._update(),a.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(a){a.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(a,b){return this._addLayer(a,b),this._update(),this},addOverlay:function(a,b){return this._addLayer(a,b,!0),this._update(),this},removeLayer:function(a){var b=e.stamp(a);return delete this._layers[b],this._update(),this},_initLayout:function(){var a="leaflet-control-layers",b=this._container=e.DomUtil.create("div",a);b.setAttribute("aria-haspopup",!0),e.Browser.touch?e.DomEvent.on(b,"click",e.DomEvent.stopPropagation):(e.DomEvent.disableClickPropagation(b),e.DomEvent.on(b,"mousewheel",e.DomEvent.stopPropagation));var c=this._form=e.DomUtil.create("form",a+"-list");if(this.options.collapsed){e.DomEvent.on(b,"mouseover",this._expand,this).on(b,"mouseout",this._collapse,this);var d=this._layersLink=e.DomUtil.create("a",a+"-toggle",b);d.href="#",d.title="Layers",e.Browser.touch?e.DomEvent.on(d,"click",e.DomEvent.stopPropagation).on(d,"click",e.DomEvent.preventDefault).on(d,"click",this._expand,this):e.DomEvent.on(d,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=e.DomUtil.create("div",a+"-base",c),this._separator=e.DomUtil.create("div",a+"-separator",c),this._overlaysList=e.DomUtil.create("div",a+"-overlays",c),b.appendChild(c)},_addLayer:function(a,b,c){var d=e.stamp(a);this._layers[d]={layer:a,name:b,overlay:c},this.options.autoZIndex&&a.setZIndex&&(this._lastZIndex++,a.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var a,b,c=!1,d=!1;for(a in this._layers)b=this._layers[a],this._addItem(b),d=d||b.overlay,c=c||!b.overlay;this._separator.style.display=d&&c?"":"none"}},_onLayerChange:function(a){var b=e.stamp(a.layer);this._layers[b]&&!this._handlingClick&&this._update()},_createRadioElement:function(a,c){var d='a;a++)b=e[a],c=this._layers[b.layerId],b.checked&&!this._map.hasLayer(c.layer)?(this._map.addLayer(c.layer),c.overlay?this._map.fire("overlayadd",{layer:c}):d=c.layer):!b.checked&&this._map.hasLayer(c.layer)&&(this._map.removeLayer(c.layer),this._map.fire("overlayremove",{layer:c}));d&&(this._map.setZoom(this._map.getZoom()),this._map.fire("baselayerchange",{layer:d})),this._handlingClick=!1},_expand:function(){e.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),e.control.layers=function(a,b,c){return new e.Control.Layers(a,b,c)},e.PosAnimation=e.Class.extend({includes:e.Mixin.Events,run:function(a,b,c,d){this.stop(),this._el=a,this._inProgress=!0,this._newPos=b,this.fire("start"),a.style[e.DomUtil.TRANSITION]="all "+(c||.25)+"s cubic-bezier(0,0,"+(d||.5)+",1)",e.DomEvent.on(a,e.DomUtil.TRANSITION_END,this._onTransitionEnd,this),e.DomUtil.setPosition(a,b),e.Util.falseFn(a.offsetWidth),this._stepTimer=setInterval(e.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(e.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),e.Util.falseFn(this._el.offsetWidth))},_onStep:function(){this._el._leaflet_pos=this._getPos(),this.fire("step")},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var b,c,d,f=this._el,g=a.getComputedStyle(f);return e.Browser.any3d?(d=g[e.DomUtil.TRANSFORM].match(this._transformRe),b=parseFloat(d[1]),c=parseFloat(d[2])):(b=parseFloat(g.left),c=parseFloat(g.top)),new e.Point(b,c,!0)},_onTransitionEnd:function(){e.DomEvent.off(this._el,e.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[e.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),e.Map.include({setView:function(a,b,d){if(b=this._limitZoom(b),a=e.latLng(a),d=d||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!d.reset&&d!==!0){d.animate!==c&&(d.zoom=e.extend({animate:d.animate},d.zoom),d.pan=e.extend({animate:d.animate},d.pan));var f=this._zoom!==b?this._tryAnimatedZoom&&this._tryAnimatedZoom(a,b,d.zoom):this._tryAnimatedPan(a,d.pan);if(f)return clearTimeout(this._sizeTimer),this}return this._resetView(a,b),this},panBy:function(a,b){if(a=e.point(a).round(),b=b||{},!a.x&&!a.y)return this;if(this._panAnim||(this._panAnim=new e.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),b.noMoveStart||this.fire("movestart"),b.animate!==!1){e.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(a);this._panAnim.run(this._mapPane,c,b.duration||.25,b.easeLinearity)}else this._rawPanBy(a),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){e.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(a,b){var c=this._getCenterOffset(a)._floor();return(b&&b.animate)===!0||this.getSize().contains(c)?(this.panBy(c,b),!0):!1}}),e.PosAnimation=e.DomUtil.TRANSITION?e.PosAnimation:e.PosAnimation.extend({run:function(a,b,c,d){this.stop(),this._el=a,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(d||.5,.2),this._startPos=e.DomUtil.getPosition(a),this._offset=b.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=e.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var a=+new Date-this._startTime,b=1e3*this._duration;b>a?this._runFrame(this._easeOut(a/b)):(this._runFrame(1),this._complete())},_runFrame:function(a){var b=this._startPos.add(this._offset.multiplyBy(a));e.DomUtil.setPosition(this._el,b),this.fire("step")},_complete:function(){e.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(a){return 1-Math.pow(1-a,this._easeOutPower)}}),e.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),e.DomUtil.TRANSITION&&e.Map.addInitHook(function(){e.DomEvent.on(this._mapPane,e.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),e.Map.include(e.DomUtil.TRANSITION?{_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_tryAnimatedZoom:function(a,b,c){if(this._animatingZoom)return!0;if(c=c||{},!this.options.zoomAnimation||c.animate===!1||!e.DomUtil.TRANSITION||e.Browser.android23||e.Browser.mobileOpera||Math.abs(b-this._zoom)>this.options.zoomAnimationThreshold)return!1;var d=this.getZoomScale(b),f=this._getCenterOffset(a)._divideBy(1-1/d),g=this._getCenterLayerPoint()._add(f);return c.animate===!0||this.getSize().contains(f)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(a,b,g,d),!0):!1},_animateZoom:function(a,b,c,d,f){this._animatingZoom=!0,e.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=a,this._animateToZoom=b,e.Draggable&&(e.Draggable._disabled=!0),this.fire("zoomanim",{center:a,zoom:b,origin:c,scale:d,delta:f})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,e.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),e.Draggable&&(e.Draggable._disabled=!1)}}:{}),e.TileLayer.include({_animateZoom:function(a){var b=!1;this._animating||(this._animating=!0,b=!0),b&&this._prepareBgBuffer();var c=this._bgBuffer;b&&(clearTimeout(this._clearBgBufferTimer),e.Util.falseFn(c.offsetWidth));var d=e.DomUtil.TRANSFORM,f=a.delta?e.DomUtil.getTranslateString(a.delta):c.style[d];c.style[d]=f+" "+e.DomUtil.getScaleString(a.scale,a.origin)},_endZoomAnim:function(){var a=this._tileContainer,b=this._bgBuffer;a.style.visibility="",a.style.zIndex=2,b.style.zIndex=1,e.Util.falseFn(b.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var a=this._map;!a||a._animatingZoom||a.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[e.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var a=this._tileContainer,b=this._bgBuffer,c=this._getLoadedTilesPercentage(b),d=this._getLoadedTilesPercentage(a);return b&&c>.5&&.5>d?(a.style.visibility="hidden",this._stopLoadingImages(a),void 0):(b.style.visibility="hidden",b.style[e.DomUtil.TRANSFORM]="",this._tileContainer=b,b=this._bgBuffer=a,this._stopLoadingImages(b),void 0)},_getLoadedTilesPercentage:function(a){var b,c,d=a.getElementsByTagName("img"),e=0;for(b=0,c=d.length;c>b;b++)d[b].complete&&e++;return e/c},_stopLoadingImages:function(a){var b,c,d,f=Array.prototype.slice.call(a.getElementsByTagName("img"));for(b=0,c=f.length;c>b;b++)d=f[b],d.complete||(d.onload=e.Util.falseFn,d.onerror=e.Util.falseFn,d.src=e.Util.emptyImageUrl,d.parentNode.removeChild(d))}}),e.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(a){if(a=this._locateOptions=e.extend(this._defaultLocateOptions,a),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var b=e.bind(this._handleGeolocationResponse,this),c=e.bind(this._handleGeolocationError,this);return a.watch?this._locationWatchId=navigator.geolocation.watchPosition(b,c,a):navigator.geolocation.getCurrentPosition(b,c,a),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(a){var b=a.code,c=a.message||(1===b?"permission denied":2===b?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:b,message:"Geolocation error: "+c+"."})},_handleGeolocationResponse:function(a){var b=a.coords.latitude,c=a.coords.longitude,d=new e.LatLng(b,c),f=180*a.coords.accuracy/40075017,g=f/Math.cos(e.LatLng.DEG_TO_RAD*b),h=e.latLngBounds([b-f,c-g],[b+f,c+g]),i=this._locateOptions;if(i.setView){var j=Math.min(this.getBoundsZoom(h),i.maxZoom);this.setView(d,j)}var k=e.extend({latlng:d,bounds:h},a.coords);this.fire("locationfound",k)}})}(window,document); \ No newline at end of file diff --git a/dist/app/panels/bettermap/leaflet/plugins.css b/dist/app/panels/bettermap/leaflet/plugins.css old mode 100755 new mode 100644 diff --git a/dist/app/panels/bettermap/leaflet/plugins.js b/dist/app/panels/bettermap/leaflet/plugins.js old mode 100755 new mode 100644 index bb88c1b9159..d47931ed631 --- a/dist/app/panels/bettermap/leaflet/plugins.js +++ b/dist/app/panels/bettermap/leaflet/plugins.js @@ -1,32 +1,4 @@ -!function(e,t){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),L.FeatureGroup.prototype.initialize.call(this,[]),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null},addLayer:function(e){if(e instanceof L.LayerGroup){var t=[];for(var n in e._layers)t.push(e._layers[n]);return this.addLayers(t)}if(!this._map)return this._needsClustering.push(e),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom);var r=e,i=this._map.getZoom();if(e.__parent)for(;r.__parent._zoom>=i;)r=r.__parent;return this -._currentShownBounds.contains(r.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,r):this._animationAddLayerNonAnimated(e,r)),this},removeLayer:function(e){return this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),(e._icon||e._container)&&(L.FeatureGroup.prototype.removeLayer.call(this,e),e.setOpacity&&e.setOpacity(1)),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push(e),this)},addLayers:function(e){var t,n,r;if(!this._map)return this._needsClustering=this._needsClustering.concat(e),this;for(t=0,n=e.length;n>t;t++)if(r=e[t],!this.hasLayer(r)&&(this._addLayer(r,this._maxZoom),r.__parent&&2===r.__parent.getChildCount())){var i=r.__parent.getAllChildMarkers(),s=i[0]===r?i[1]:i[0];L.FeatureGroup.prototype.removeLayer.call(this,s)}for(t in this._layers)r=this._layers[t],r instanceof L.MarkerCluster&&r._iconNeedsUpdate&&r._updateIcon();return this._topClusterLevel -._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},removeLayers:function(e){var t,n,r;if(!this._map){for(t=0,n=e.length;n>t;t++)this._arraySplice(this._needsClustering,e[t]);return this}for(t=0,n=e.length;n>t;t++)r=e[t],r.__parent&&(this._removeLayer(r,!0,!0),r._icon&&(L.FeatureGroup.prototype.removeLayer.call(this,r),r.setOpacity(1)));this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds);for(t in this._layers)r=this._layers[t],r instanceof L.MarkerCluster&&r._updateIcon();return this},clearLayers:function(){this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy();for(var e in this._layers)L.FeatureGroup.prototype.removeLayer.call(this,this._layers[e]);return this.eachLayer(function(e){delete e.__parent}),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;if(this._topClusterLevel)e.extend -(this._topClusterLevel._bounds);else for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e},eachLayer:function(e,t){var n,r=this._needsClustering.slice();for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(r),n=r.length-1;n>=0;n--)e.call(t,r[n])},hasLayer:function(e){if(!e||e._noHas)return!1;var t,n=this._needsClustering;for(t=n.length-1;t>=0;t--)if(n[t]===e)return!0;for(n=this._needsRemoving,t=n.length-1;t>=0;t--)if(n[t]===e)return!1;return!!e.__parent&&e.__parent._group===this},zoomToShowLayer:function(e,t){var n=function(){if((e._icon||e.__parent._icon)&&!this._inZoomAnimation)if(this._map.off("moveend",n,this),this.off("animationend",n,this),e._icon)t();else if(e.__parent._icon){var r=function(){this.off("spiderfied",r,this),t()};this.on("spiderfied",r,this),e.__parent.spiderfy()}};e._icon?t():e.__parent._zoomt;t++)r=this._needsRemoving[t],this._removeLayer(r);for(this._needsRemoving=[],t=0,n=this._needsClustering.length;n>t;t++)r=this._needsClustering[t],r.__parent||this._addLayer(r,this._maxZoom);this._needsClustering=[],this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),this._zoom=this._map.getZoom(),this._currentShownBounds=this._getExpandedVisibleBounds(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim" -,""),this._spiderfierOnRemove&&this._spiderfierOnRemove();for(var t in this._layers)L.FeatureGroup.prototype.removeLayer.call(this,this._layers[t]);this._map=null},_arraySplice:function(e,t){for(var n=e.length-1;n>=0;n--)if(e[n]===t)return e.splice(n,1),!0},_removeLayer:function(e,t,n){var r=this._gridClusters,i=this._gridUnclustered,s=this._map;if(t)for(var o=this._maxZoom;o>=0&&i[o].removeObject(e,s.project(e.getLatLng(),o));o--);var u,a=e.__parent,f=a._markers;for(this._arraySplice(f,e);a&&(a._childCount--,!(a._zoom<0));)t&&a._childCount<=1?(u=a._markers[0]===e?a._markers[1]:a._markers[0],r[a._zoom].removeObject(a,s.project(a._cLatLng,a._zoom)),i[a._zoom].addObject(u,s.project(u.getLatLng(),a._zoom)),this._arraySplice(a.__parent._childClusters,a),a.__parent._markers.push(u),u.__parent=a.__parent,a._icon&&(L.FeatureGroup.prototype.removeLayer.call(this,a),n||(u._noHas=!0,L.FeatureGroup.prototype.addLayer.call(this,u),delete u._noHas))):(a._recalculateBounds(),n&&a._icon||a._updateIcon -()),a=a.__parent;delete e.__parent},_propagateEvent:function(e){e.target instanceof L.MarkerCluster&&(e.type="cluster"+e.type),L.FeatureGroup.prototype._propagateEvent.call(this,e)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),n=" marker-cluster-";return n+=10>t?"small":100>t?"medium":"large",new L.DivIcon({html:"
    "+t+"
    ",className:"marker-cluster"+n,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=null,t=this._map,n=this.options.spiderfyOnMaxZoom,r=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick;(n||i)&&this.on("clusterclick",function(e){t.getMaxZoom()===t.getZoom()?n&&e.layer.spiderfy():i&&e.layer.zoomToBounds()},this),r&&(this.on("clustermouseover",function(n){this._inZoomAnimation||(e&&t.removeLayer(e),n.layer.getChildCount()>2&&n.layer!==this._spiderfied&&(e=new L.Polygon(n.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(e)))},this),this.on("clustermouseout",function(){e&&(t.removeLayer(e),e=null)} -,this),t.on("zoomend",function(){e&&(t.removeLayer(e),e=null)},this),t.on("layerremove",function(n){e&&n.layer===this&&(t.removeLayer(e),e=null)},this))},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this._map;(e||n)&&this.off("clusterclick",null,this),t&&(this.off("clustermouseover",null,this),this.off("clustermouseout",null,this),r.off("zoomend",null,this),r.off("layerremove",null,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=this._map._zoom,this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=this._map.getMaxZoom(),t=this.options.maxClusterRadius -;this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var n=e;n>=0;n--)this._gridClusters[n]=new L.DistanceGrid(t),this._gridUnclustered[n]=new L.DistanceGrid(t);this._topClusterLevel=new L.MarkerCluster(this,-1)},_addLayer:function(e,t){var n,r,i=this._gridClusters,s=this._gridUnclustered;for(this.options.singleMarkerMode&&(e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}}));t>=0;t--){n=this._map.project(e.getLatLng(),t);var o=i[t].getNearObject(n);if(o)return o._addChild(e),e.__parent=o,void 0;if(o=s[t].getNearObject(n)){var u=o.__parent;u&&this._removeLayer(o,!1);var a=new L.MarkerCluster(this,t,o,e);i[t].addObject(a,this._map.project(a._cLatLng,t)),o.__parent=a,e.__parent=a;var f=a;for(r=t-1;r>u._zoom;r--)f=new L.MarkerCluster(this,r,f),i[r].addObject(f,this._map.project(o.getLatLng(),r));for(u._addChild(f),r=t;r>=0&& -s[r].removeObject(o,this._map.project(o.getLatLng(),r));r--);return}s[t].addObject(e,n)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_mergeSplitClusters:function(){this._zoomthis._map._zoom?(this._animationStart(),this._animationZoomOut(this._zoom,this._map._zoom)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(!this.options.removeOutsideVisibleBounds)return this.getBounds();var e=this._map,t=e.getBounds(),n=t._southWest,r=t._northEast,i=L.Browser.mobile?0:Math.abs(n.lat-r.lat),s=L.Browser.mobile?0:Math.abs(n.lng-r.lng);return new L.LatLngBounds(new L.LatLng(n.lat-i,n.lng-s,!0),new L.LatLng(r.lat+i,r.lng+s,!0))},_animationAddLayerNonAnimated:function(e,t){if(t===e)e._noHas=!0,L.FeatureGroup.prototype.addLayer.call(this,e),delete -e._noHas;else if(2===t._childCount){t._addToMap();var n=t.getAllChildMarkers();L.FeatureGroup.prototype.removeLayer.call(this,n[0]),L.FeatureGroup.prototype.removeLayer.call(this,n[1])}else t._updateIcon()}}),L.MarkerClusterGroup.include(L.DomUtil.TRANSITION?{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_animationZoomIn:function(e,t){var n,r=this,i=this._getExpandedVisibleBounds();this._topClusterLevel._recursively(i,e,0,function(s){var o,u=s._latlng,a=s._markers;for(s._isSingleParent()&&e+1===t?(L.FeatureGroup.prototype.removeLayer.call(r,s),s._recursivelyAddChildrenToMap(null,t,i)):(s.setOpacity(0),s._recursivelyAddChildrenToMap(u,t,i)),n=a.length-1;n>=0;n--)o=a[n],i.contains(o._latlng)||L.FeatureGroup.prototype.removeLayer.call(r,o)}),this._forceLayout -();var s,o;r._topClusterLevel._recursivelyBecomeVisible(i,t);for(s in r._layers)o=r._layers[s],o instanceof L.MarkerCluster||!o._icon||o.setOpacity(1);r._topClusterLevel._recursively(i,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),setTimeout(function(){r._topClusterLevel._recursively(i,e,0,function(e){L.FeatureGroup.prototype.removeLayer.call(r,e),e.setOpacity(1)}),r._animationEnd()},200)},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,e,this._getExpandedVisibleBounds())},_animationZoomOutSingle:function(e,t,n){var r=this._getExpandedVisibleBounds();e._recursivelyAnimateChildrenInAndAddSelfToMap(r,t+1,n);var i=this;this._forceLayout(),e._recursivelyBecomeVisible(r,n),setTimeout(function(){if(1===e._childCount){var s=e._markers[0];s.setLatLng(s.getLatLng()),s.setOpacity -(1)}else e._recursively(r,n,0,function(e){e._recursivelyRemoveChildrenFromMap(r,t+1)});i._animationEnd()},200)},_animationAddLayer:function(e,t){var n=this;e._noHas=!0,L.FeatureGroup.prototype.addLayer.call(this,e),delete e._noHas,t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.setOpacity(0),setTimeout(function(){L.FeatureGroup.prototype.removeLayer.call(n,e),e.setOpacity(1),n._animationEnd()},200)):(this._forceLayout(),n._animationStart(),n._animationZoomOutSingle(t,this._map.getMaxZoom(),this._map.getZoom())))},_forceLayout:function(){L.Util.falseFn(t.body.offsetWidth)}}:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds())},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this -._currentShownBounds,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)},L.MarkerCluster=L.Marker.extend({initialize:function(e,t,n,r){L.Marker.prototype.initialize.call(this,n?n._cLatLng||n.getLatLng():new L.LatLng(0,0),{icon:this}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._bounds=new L.LatLngBounds,n&&this._addChild(n),r&&this._addChild(r)},getAllChildMarkers:function(e){e=e||[];for(var t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(e);for(var n=this._markers.length-1;n>=0;n--)e.push(this._markers[n]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(){this._group._map.fitBounds(this._bounds)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this. -_bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._expandBounds(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_expandBounds:function(e){var t,n=e._wLatLng||e._latlng;e instanceof L.MarkerCluster?(this._bounds.extend(e._bounds),t=e._childCount):(this._bounds.extend(n),t=1),this._cLatLng||(this._cLatLng=e._cLatLng||n);var r=this._childCount+t;this._wLatLng?(this._wLatLng.lat=(n.lat*t+this._wLatLng.lat*this._childCount)/r,this._wLatLng.lng=(n.lng*t+this._wLatLng.lng*this._childCount)/r):this._latlng=this._wLatLng=new -L.LatLng(n.lat,n.lng)},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._noHas=!0,L.FeatureGroup.prototype.addLayer.call(this._group,this),delete this._noHas},_recursivelyAnimateChildrenIn:function(e,t,n){this._recursively(e,0,n-1,function(e){var n,r,i=e._markers;for(n=i.length-1;n>=0;n--)r=i[n],r._icon&&(r._setPos(t),r.setOpacity(0))},function(e){var n,r,i=e._childClusters;for(n=i.length-1;n>=0;n--)r=i[n],r._icon&&(r._setPos(t),r.setOpacity(0))})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,n){this._recursively(e,n,0,function(r){r._recursivelyAnimateChildrenIn(e,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),t),r._isSingleParent()&&t-1===n?(r.setOpacity(1),r._recursivelyRemoveChildrenFromMap(e,t)):r.setOpacity(0),r._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,0,t,null,function(e){e.setOpacity(1)})},_recursivelyAddChildrenToMap:function(e,t,n){this._recursively(n,-1,t,function(r){if(t!==r._zoom)for(var s= -r._markers.length-1;s>=0;s--){var o=r._markers[s];n.contains(o._latlng)&&(e&&(o._backupLatlng=o.getLatLng(),o.setLatLng(e),o.setOpacity&&o.setOpacity(0)),o._noHas=!0,L.FeatureGroup.prototype.addLayer.call(r._group,o),delete o._noHas)}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var n=this._markers[t];n._backupLatlng&&(n.setLatLng(n._backupLatlng),delete n._backupLatlng)}if(e-1===this._zoom)for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._restorePosition();else for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,n){var r,i;this._recursively(e,-1,t-1,function(e){for(i=e._markers.length-1;i>=0;i--)r=e._markers[i],n&&n.contains(r._latlng)||(L.FeatureGroup.prototype.removeLayer.call -(e._group,r),r.setOpacity&&r.setOpacity(1))},function(e){for(i=e._childClusters.length-1;i>=0;i--)r=e._childClusters[i],n&&n.contains(r._latlng)||((!L.FeatureGroup.prototype.hasLayer||L.FeatureGroup.prototype.hasLayer.call(e._group,r))&&L.FeatureGroup.prototype.removeLayer.call(e._group,r),r.setOpacity&&r.setOpacity(1))})},_recursively:function(e,t,n,r,i){var s,o,u=this._childClusters,a=this._zoom;if(t>a)for(s=u.length-1;s>=0;s--)o=u[s],e.intersects(o._bounds)&&o._recursively(e,t,n,r,i);else if(r&&r(this),i&&this._zoom===n&&i(this),n>a)for(s=u.length-1;s>=0;s--)o=u[s],e.intersects(o._bounds)&&o._recursively(e,t,n,r,i)},_recalculateBounds:function(){var e,t=this._markers,n=this._childClusters;for(this._bounds=new L.LatLngBounds,delete this._wLatLng,e=t.length-1;e>=0;e--)this._expandBounds(t[e]);for(e=n.length-1;e>=0;e--)this._expandBounds(n[e])},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),L.DistanceGrid=function( -e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var n=this._getCoord(t.x),r=this._getCoord(t.y),i=this._grid,s=i[r]=i[r]||{},o=s[n]=s[n]||[],u=L.Util.stamp(e);this._objectPoint[u]=t,o.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var n,r,i=this._getCoord(t.x),s=this._getCoord(t.y),o=this._grid,u=o[s]=o[s]||{},a=u[i]=u[i]||[];for(delete this._objectPoint[L.Util.stamp(e)],n=0,r=a.length;r>n;n++)if(a[n]===e)return a.splice(n,1),1===r&&delete u[i],!0},eachObject:function(e,t){var n,r,i,s,o,u,a,f=this._grid;for(n in f){o=f[n];for(r in o)for(u=o[r],i=0,s=u.length;s>i;i++)a=e.call(t,u[i]),a&&(i--,s--)}},getNearObject:function(e){var t,n,r,i,s,o,u,a,f=this._getCoord(e.x),l=this._getCoord(e.y),c=this._objectPoint,h=this._sqCellSize,p=null;for(t=l-1;l+1>=t;t++)if(i=this._grid[t])for(n=f-1;f+1>=n;n++)if(s=i[n])for(r=0,o=s.length;o>r;r++)u=s[r],a=this._sqDist(c[L -.Util.stamp(u)],e),h>a&&(h=a,p=u);return p},_getCoord:function(e){return Math.floor(e/this._cellSize)},_sqDist:function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}},function(){L.QuickHull={getDistant:function(e,t){var n=t[1].lat-t[0].lat,r=t[0].lng-t[1].lng;return r*(e.lat-t[0].lat)+n*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var n,r,i,s=0,o=null,u=[];for(n=t.length-1;n>=0;n--)r=t[n],i=this.getDistant(r,e),i>0&&(u.push(r),i>s&&(s=i,o=r));return{maxPoint:o,newPoints:u}},buildConvexHull:function(e,t){var n=[],r=this.findMostDistantPointFromBaseLine(e,t);return r.maxPoint?(n=n.concat(this.buildConvexHull([e[0],r.maxPoint],r.newPoints)),n=n.concat(this.buildConvexHull([r.maxPoint,e[1]],r.newPoints))):[e]},getConvexHull:function(e){var t,n=!1,r=!1,i=null,s=null;for(t=e.length-1;t>=0;t--){var o=e[t];(n===!1||o.lat>n)&&(i=o,n=o.lat),(r===!1||o.lat=0;n--)t=r[n].getLatLng(),i.push(t);for(e=L.QuickHull.getConvexHull(i),n=e.length-1;n>=0;n--)s.push(e[n][0]);return s}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(),n=this._group,r=n._map,i=r.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,i):(i.y+=10,e=this._generatePointsCircle(t.length,i)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var n,r,i=this._group.options.spiderfyDistanceMultiplier* -this._circleFootSeparation*(2+e),s=i/this._2PI,o=this._2PI/e,u=[];for(u.length=e,n=e-1;n>=0;n--)r=this._circleStartAngle+n*o,u[n]=(new L.Point(t.x+s*Math.cos(r),t.y+s*Math.sin(r)))._round();return u},_generatePointsSpiral:function(e,t){var n,r=this._group.options.spiderfyDistanceMultiplier*this._spiralLengthStart,i=this._group.options.spiderfyDistanceMultiplier*this._spiralFootSeparation,s=this._group.options.spiderfyDistanceMultiplier*this._spiralLengthFactor,o=0,u=[];for(u.length=e,n=e-1;n>=0;n--)o+=i/r+5e-4*n,u[n]=(new L.Point(t.x+r*Math.cos(o),t.y+r*Math.sin(o)))._round(),r+=this._2PI*s/o;return u},_noanimationUnspiderfy:function(){var e,t,n=this._group,r=n._map,i=this.getAllChildMarkers();for(this.setOpacity(1),t=i.length-1;t>=0;t--)e=i[t],L.FeatureGroup.prototype.removeLayer.call(n,e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset(0),e._spiderLeg&&(r.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerCluster.include(L -.DomUtil.TRANSITION?{SVG_ANIMATION:function(){return t.createElementNS("http://www.w3.org/2000/svg","animate").toString().indexOf("SVGAnimate")>-1}(),_animationSpiderfy:function(e,n){var r,i,s,o,u=this,a=this._group,f=a._map,l=f.latLngToLayerPoint(this._latlng);for(r=e.length-1;r>=0;r--)i=e[r],i.setZIndexOffset(1e6),i.setOpacity(0),i._noHas=!0,L.FeatureGroup.prototype.addLayer.call(a,i),delete i._noHas,i._setPos(l);a._forceLayout(),a._animationStart();var c=L.Path.SVG?0:.3,h=L.Path.SVG_NS;for(r=e.length-1;r>=0;r--)if(o=f.layerPointToLatLng(n[r]),i=e[r],i._preSpiderfyLatlng=i._latlng,i.setLatLng(o),i.setOpacity(1),s=new L.Polyline([u._latlng,o],{weight:1.5,color:"#222",opacity:c}),f.addLayer(s),i._spiderLeg=s,L.Path.SVG&&this.SVG_ANIMATION){var p=s._path.getTotalLength();s._path.setAttribute("stroke-dasharray",p+","+p);var d=t.createElementNS(h,"animate");d.setAttribute("attributeName","stroke-dashoffset"),d.setAttribute("begin","indefinite"),d.setAttribute("from",p),d.setAttribute("to",0 -),d.setAttribute("dur",.25),s._path.appendChild(d),d.beginElement(),d=t.createElementNS(h,"animate"),d.setAttribute("attributeName","stroke-opacity"),d.setAttribute("attributeName","stroke-opacity"),d.setAttribute("begin","indefinite"),d.setAttribute("from",0),d.setAttribute("to",.5),d.setAttribute("dur",.25),s._path.appendChild(d),d.beginElement()}if(u.setOpacity(.3),L.Path.SVG)for(this._group._forceLayout(),r=e.length-1;r>=0;r--)i=e[r]._spiderLeg,i.options.opacity=.5,i._path.setAttribute("stroke-opacity",.5);setTimeout(function(){a._animationEnd(),a.fire("spiderfied")},200)},_animationUnspiderfy:function(e){var t,n,r,i=this._group,s=i._map,o=e?s._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):s.latLngToLayerPoint(this._latlng),u=this.getAllChildMarkers(),a=L.Path.SVG&&this.SVG_ANIMATION;for(i._animationStart(),this.setOpacity(1),n=u.length-1;n>=0;n--)t=u[n],t._preSpiderfyLatlng&&(t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,t._setPos(o),t.setOpacity(0),a&&(r=t._spiderLeg -._path.childNodes[0],r.setAttribute("to",r.getAttribute("from")),r.setAttribute("from",0),r.beginElement(),r=t._spiderLeg._path.childNodes[1],r.setAttribute("from",.5),r.setAttribute("to",0),r.setAttribute("stroke-opacity",0),r.beginElement(),t._spiderLeg._path.setAttribute("stroke-opacity",0)));setTimeout(function(){var e=0;for(n=u.length-1;n>=0;n--)t=u[n],t._spiderLeg&&e++;for(n=u.length-1;n>=0;n--)t=u[n],t._spiderLeg&&(t.setOpacity(1),t.setZIndexOffset(0),e>1&&L.FeatureGroup.prototype.removeLayer.call(i,t),s.removeLayer(t._spiderLeg),delete t._spiderLeg);i._animationEnd()},200)}}:{_animationSpiderfy:function(e,t){var n,r,i,s,o=this._group,u=o._map;for(n=e.length-1;n>=0;n--)s=u.layerPointToLatLng(t[n]),r=e[n],r._preSpiderfyLatlng=r._latlng,r.setLatLng(s),r.setZIndexOffset(1e6),L.FeatureGroup.prototype.addLayer.call(o,r),i=new L.Polyline([this._latlng,s],{weight:1.5,color:"#222"}),u.addLayer(i),r._spiderLeg=i;this.setOpacity(.3),o.fire("spiderfied")},_animationUnspiderfy:function(){this -._noanimationUnspiderfy()}}),L.MarkerClusterGroup.include({_spiderfied:null,_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation?this._map.on("zoomstart",this._unspiderfyZoomStart,this):this._map.on("zoomend",this._unspiderfyWrapper,this),L.Path.SVG&&!L.Browser.touch&&this._map._initPathRoot()},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this -._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(L.FeatureGroup.prototype.removeLayer.call(this,e),e.setOpacity(1),e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}})}(window,document),function(){L.labelVersion="0.1.4-dev",L.Label=L.Popup.extend({options:{autoPan:!1,className:"",closePopupOnClick:!1,noHide:!1,offset:new L.Point(12,-15),opacity:1},onAdd:function(e){this._map=e,this._pane=this._source instanceof L.Marker?e._panes.markerPane:e._panes.popupPane,this._container||this._initLayout(),this._updateContent();var t=e.options.fadeAnimation;t&&L.DomUtil.setOpacity(this._container,0),this._pane.appendChild(this._container),e.on("viewreset",this._updatePosition,this),this._animated&&e.on("zoomanim",this._zoomAnimation,this),L.Browser.touch&&!this.options.noHide&&L.DomEvent.on(this._container,"click",this.close,this),this._update(),this.setOpacity(this.options.opacity)},onRemove:function(e){this._pane.removeChild -(this._container),L.Util.falseFn(this._container.offsetWidth),e.off({viewreset:this._updatePosition,zoomanim:this._zoomAnimation},this),e.options.fadeAnimation&&L.DomUtil.setOpacity(this._container,0),this._map=null},close:function(){var e=this._map;e&&(L.Browser.touch&&!this.options.noHide&&L.DomEvent.off(this._container,"click",this.close),e._label=null,e.removeLayer(this))},updateZIndex:function(e){this._zIndex=e,this._container&&this._zIndex&&(this._container.style.zIndex=e)},setOpacity:function(e){this.options.opacity=e,this._container&&L.DomUtil.setOpacity(this._container,e)},_initLayout:function(){this._container=L.DomUtil.create("div","leaflet-label "+this.options.className+" leaflet-zoom-animated"),this.updateZIndex(this._zIndex)},_updateContent:function(){this._content&&"string"==typeof this._content&&(this._container.innerHTML=this._content)},_updateLayout:function(){},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},_setPosition -:function(e){e=e.add(this.options.offset),L.DomUtil.setPosition(this._container,e)},_zoomAnimation:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)}}),L.Icon.Default.mergeOptions({labelAnchor:new L.Point(9,-20)}),L.Marker.mergeOptions({icon:new L.Icon.Default}),L.Marker.include({showLabel:function(){return this._label&&this._map&&(this._label.setLatLng(this._latlng),this._map.showLabel(this._label)),this},hideLabel:function(){return this._label&&this._label.close(),this},setLabelNoHide:function(e){this._labelNoHide!==e&&(this._labelNoHide=e,e?(this._removeLabelRevealHandlers(),this.showLabel()):(this._addLabelRevealHandlers(),this.hideLabel()))},bindLabel:function(e,t){var n=L.point(this.options.icon.options.labelAnchor)||new L.Point(0,0);return n=n.add(L.Label.prototype.options.offset),t&&t.offset&&(n=n.add(t.offset)),t=L.Util.extend({offset:n},t),this._labelNoHide=t.noHide,this._label||(this._labelNoHide||this._addLabelRevealHandlers -(),this.on("remove",this.hideLabel,this).on("move",this._moveLabel,this),this._hasLabelHandlers=!0),this._label=(new L.Label(t,this)).setContent(e),this},unbindLabel:function(){return this._label&&(this.hideLabel(),this._label=null,this._hasLabelHandlers&&(this._labelNoHide||this._removeLabelRevealHandlers(),this.off("remove",this.hideLabel,this).off("move",this._moveLabel,this)),this._hasLabelHandlers=!1),this},updateLabelContent:function(e){this._label&&this._label.setContent(e)},_addLabelRevealHandlers:function(){this.on("mouseover",this.showLabel,this).on("mouseout",this.hideLabel,this),L.Browser.touch&&this.on("click",this.showLabel,this)},_removeLabelRevealHandlers:function(){this.off("mouseover",this.showLabel,this).off("mouseout",this.hideLabel,this).off("remove",this.hideLabel,this).off("move",this._moveLabel,this),L.Browser.touch&&this.off("click",this.showLabel,this)},_moveLabel:function(e){this._label.setLatLng(e.latlng)},_originalUpdateZIndex:L.Marker.prototype._updateZIndex -,_updateZIndex:function(e){var t=this._zIndex+e;this._originalUpdateZIndex(e),this._label&&this._label.updateZIndex(t)},_originalSetOpacity:L.Marker.prototype.setOpacity,setOpacity:function(e,t){this.options.labelHasSemiTransparency=t,this._originalSetOpacity(e)},_originalUpdateOpacity:L.Marker.prototype._updateOpacity,_updateOpacity:function(){var e=0===this.options.opacity?0:1;this._originalUpdateOpacity(),this._label&&this._label.setOpacity(this.options.labelHasSemiTransparency?this.options.opacity:e)}}),L.Path.include({bindLabel:function(e,t){return this._label&&this._label.options===t||(this._label=new L.Label(t,this)),this._label.setContent(e),this._showLabelAdded||(this.on("mouseover",this._showLabel,this).on("mousemove",this._moveLabel,this).on("mouseout remove",this._hideLabel,this),L.Browser.touch&&this.on("click",this._showLabel,this),this._showLabelAdded=!0),this},unbindLabel:function(){return this._label&&(this._hideLabel(),this._label=null,this._showLabelAdded=!1,this.off("mouseover" -,this._showLabel,this).off("mousemove",this._moveLabel,this).off("mouseout remove",this._hideLabel,this)),this},updateLabelContent:function(e){this._label&&this._label.setContent(e)},_showLabel:function(e){this._label.setLatLng(e.latlng),this._map.showLabel(this._label)},_moveLabel:function(e){this._label.setLatLng(e.latlng)},_hideLabel:function(){this._label.close()}}),L.Map.include({showLabel:function(e){return this._label=e,this.addLayer(e)}}),L.FeatureGroup.include({clearLayers:function(){return this.unbindLabel(),this.eachLayer(this.removeLayer,this),this},bindLabel:function(e,t){return this.invoke("bindLabel",e,t)},unbindLabel:function(){return this.invoke("unbindLabel")},updateLabelContent:function(e){this.invoke("updateLabelContent",e)}})}(this,document); \ No newline at end of file +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + +!function(a,b){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,polygonOptions:{}},initialize:function(a){L.Util.setOptions(this,a),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),L.FeatureGroup.prototype.initialize.call(this,[]),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null},addLayer:function(a){if(a instanceof L.LayerGroup){var b=[];for(var c in a._layers)b.push(a._layers[c]);return this.addLayers(b)}if(!this._map)return this._needsClustering.push(a),this;if(this.hasLayer(a))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(a,this._maxZoom);var d=a,e=this._map.getZoom();if(a.__parent)for(;d.__parent._zoom>=e;)d=d.__parent;return this._currentShownBounds.contains(d.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(a,d):this._animationAddLayerNonAnimated(a,d)),this},removeLayer:function(a){return this._map?a.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(a)),this._removeLayer(a,!0),(a._icon||a._container)&&(L.FeatureGroup.prototype.removeLayer.call(this,a),a.setOpacity&&a.setOpacity(1)),this):this:(!this._arraySplice(this._needsClustering,a)&&this.hasLayer(a)&&this._needsRemoving.push(a),this)},addLayers:function(a){var b,c,d;if(!this._map)return this._needsClustering=this._needsClustering.concat(a),this;for(b=0,c=a.length;c>b;b++)if(d=a[b],!this.hasLayer(d)&&(this._addLayer(d,this._maxZoom),d.__parent&&2===d.__parent.getChildCount())){var e=d.__parent.getAllChildMarkers(),f=e[0]===d?e[1]:e[0];L.FeatureGroup.prototype.removeLayer.call(this,f)}for(b in this._layers)d=this._layers[b],d instanceof L.MarkerCluster&&d._iconNeedsUpdate&&d._updateIcon();return this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},removeLayers:function(a){var b,c,d;if(!this._map){for(b=0,c=a.length;c>b;b++)this._arraySplice(this._needsClustering,a[b]);return this}for(b=0,c=a.length;c>b;b++)d=a[b],d.__parent&&(this._removeLayer(d,!0,!0),d._icon&&(L.FeatureGroup.prototype.removeLayer.call(this,d),d.setOpacity(1)));this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds);for(b in this._layers)d=this._layers[b],d instanceof L.MarkerCluster&&d._updateIcon();return this},clearLayers:function(){this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy();for(var a in this._layers)L.FeatureGroup.prototype.removeLayer.call(this,this._layers[a]);return this.eachLayer(function(a){delete a.__parent}),this._map&&this._generateInitialClusters(),this},getBounds:function(){var a=new L.LatLngBounds;if(this._topClusterLevel)a.extend(this._topClusterLevel._bounds);else for(var b=this._needsClustering.length-1;b>=0;b--)a.extend(this._needsClustering[b].getLatLng());return a},eachLayer:function(a,b){var c,d=this._needsClustering.slice();for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(d),c=d.length-1;c>=0;c--)a.call(b,d[c])},hasLayer:function(a){if(!a||a._noHas)return!1;var b,c=this._needsClustering;for(b=c.length-1;b>=0;b--)if(c[b]===a)return!0;for(c=this._needsRemoving,b=c.length-1;b>=0;b--)if(c[b]===a)return!1;return!(!a.__parent||a.__parent._group!==this)},zoomToShowLayer:function(a,b){var c=function(){if((a._icon||a.__parent._icon)&&!this._inZoomAnimation)if(this._map.off("moveend",c,this),this.off("animationend",c,this),a._icon)b();else if(a.__parent._icon){var d=function(){this.off("spiderfied",d,this),b()};this.on("spiderfied",d,this),a.__parent.spiderfy()}};a._icon?b():a.__parent._zoomb;b++)d=this._needsRemoving[b],this._removeLayer(d);for(this._needsRemoving=[],b=0,c=this._needsClustering.length;c>b;b++)d=this._needsClustering[b],d.__parent||this._addLayer(d,this._maxZoom);this._needsClustering=[],this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),this._zoom=this._map.getZoom(),this._currentShownBounds=this._getExpandedVisibleBounds(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)},onRemove:function(a){a.off("zoomend",this._zoomEnd,this),a.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove();for(var b in this._layers)L.FeatureGroup.prototype.removeLayer.call(this,this._layers[b]);this._map=null},_arraySplice:function(a,b){for(var c=a.length-1;c>=0;c--)if(a[c]===b)return a.splice(c,1),!0},_removeLayer:function(a,b,c){var d=this._gridClusters,e=this._gridUnclustered,f=this._map;if(b)for(var g=this._maxZoom;g>=0&&e[g].removeObject(a,f.project(a.getLatLng(),g));g--);var h,i=a.__parent,j=i._markers;for(this._arraySplice(j,a);i&&(i._childCount--,!(i._zoom<0));)b&&i._childCount<=1?(h=i._markers[0]===a?i._markers[1]:i._markers[0],d[i._zoom].removeObject(i,f.project(i._cLatLng,i._zoom)),e[i._zoom].addObject(h,f.project(h.getLatLng(),i._zoom)),this._arraySplice(i.__parent._childClusters,i),i.__parent._markers.push(h),h.__parent=i.__parent,i._icon&&(L.FeatureGroup.prototype.removeLayer.call(this,i),c||(h._noHas=!0,L.FeatureGroup.prototype.addLayer.call(this,h),delete h._noHas))):(i._recalculateBounds(),c&&i._icon||i._updateIcon()),i=i.__parent;delete a.__parent},_propagateEvent:function(a){a.target instanceof L.MarkerCluster&&(a.type="cluster"+a.type),L.FeatureGroup.prototype._propagateEvent.call(this,a)},_defaultIconCreateFunction:function(a){var b=a.getChildCount(),c=" marker-cluster-";return c+=10>b?"small":100>b?"medium":"large",new L.DivIcon({html:"
    "+b+"
    ",className:"marker-cluster"+c,iconSize:new L.Point(40,40)})},_bindEvents:function(){var a=null,b=this._map,c=this.options.spiderfyOnMaxZoom,d=this.options.showCoverageOnHover,e=this.options.zoomToBoundsOnClick;(c||e)&&this.on("clusterclick",function(a){b.getMaxZoom()===b.getZoom()?c&&a.layer.spiderfy():e&&a.layer.zoomToBounds()},this),d&&(this.on("clustermouseover",function(c){this._inZoomAnimation||(a&&b.removeLayer(a),c.layer.getChildCount()>2&&c.layer!==this._spiderfied&&(a=new L.Polygon(c.layer.getConvexHull(),this.options.polygonOptions),b.addLayer(a)))},this),this.on("clustermouseout",function(){a&&(b.removeLayer(a),a=null)},this),b.on("zoomend",function(){a&&(b.removeLayer(a),a=null)},this),b.on("layerremove",function(c){a&&c.layer===this&&(b.removeLayer(a),a=null)},this))},_unbindEvents:function(){var a=this.options.spiderfyOnMaxZoom,b=this.options.showCoverageOnHover,c=this.options.zoomToBoundsOnClick,d=this._map;(a||c)&&this.off("clusterclick",null,this),b&&(this.off("clustermouseover",null,this),this.off("clustermouseout",null,this),d.off("zoomend",null,this),d.off("layerremove",null,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=this._map._zoom,this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var a=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._zoom,a),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,a),this._currentShownBounds=a}},_generateInitialClusters:function(){var a=this._map.getMaxZoom(),b=this.options.maxClusterRadius;this.options.disableClusteringAtZoom&&(a=this.options.disableClusteringAtZoom-1),this._maxZoom=a,this._gridClusters={},this._gridUnclustered={};for(var c=a;c>=0;c--)this._gridClusters[c]=new L.DistanceGrid(b),this._gridUnclustered[c]=new L.DistanceGrid(b);this._topClusterLevel=new L.MarkerCluster(this,-1)},_addLayer:function(a,b){var c,d,e=this._gridClusters,f=this._gridUnclustered;for(this.options.singleMarkerMode&&(a.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[a]}}));b>=0;b--){c=this._map.project(a.getLatLng(),b);var g=e[b].getNearObject(c);if(g)return g._addChild(a),a.__parent=g,void 0;if(g=f[b].getNearObject(c)){var h=g.__parent;h&&this._removeLayer(g,!1);var i=new L.MarkerCluster(this,b,g,a);e[b].addObject(i,this._map.project(i._cLatLng,b)),g.__parent=i,a.__parent=i;var j=i;for(d=b-1;d>h._zoom;d--)j=new L.MarkerCluster(this,d,j),e[d].addObject(j,this._map.project(g.getLatLng(),d));for(h._addChild(j),d=b;d>=0&&f[d].removeObject(g,this._map.project(g.getLatLng(),d));d--);return}f[b].addObject(a,c)}this._topClusterLevel._addChild(a),a.__parent=this._topClusterLevel},_mergeSplitClusters:function(){this._zoomthis._map._zoom?(this._animationStart(),this._animationZoomOut(this._zoom,this._map._zoom)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(!this.options.removeOutsideVisibleBounds)return this.getBounds();var a=this._map,b=a.getBounds(),c=b._southWest,d=b._northEast,e=L.Browser.mobile?0:Math.abs(c.lat-d.lat),f=L.Browser.mobile?0:Math.abs(c.lng-d.lng);return new L.LatLngBounds(new L.LatLng(c.lat-e,c.lng-f,!0),new L.LatLng(d.lat+e,d.lng+f,!0))},_animationAddLayerNonAnimated:function(a,b){if(b===a)a._noHas=!0,L.FeatureGroup.prototype.addLayer.call(this,a),delete a._noHas;else if(2===b._childCount){b._addToMap();var c=b.getAllChildMarkers();L.FeatureGroup.prototype.removeLayer.call(this,c[0]),L.FeatureGroup.prototype.removeLayer.call(this,c[1])}else b._updateIcon()}}),L.MarkerClusterGroup.include(L.DomUtil.TRANSITION?{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_animationZoomIn:function(a,b){var c,d=this,e=this._getExpandedVisibleBounds();this._topClusterLevel._recursively(e,a,0,function(f){var g,h=f._latlng,i=f._markers;for(f._isSingleParent()&&a+1===b?(L.FeatureGroup.prototype.removeLayer.call(d,f),f._recursivelyAddChildrenToMap(null,b,e)):(f.setOpacity(0),f._recursivelyAddChildrenToMap(h,b,e)),c=i.length-1;c>=0;c--)g=i[c],e.contains(g._latlng)||L.FeatureGroup.prototype.removeLayer.call(d,g)}),this._forceLayout();var f,g;d._topClusterLevel._recursivelyBecomeVisible(e,b);for(f in d._layers)g=d._layers[f],g instanceof L.MarkerCluster||!g._icon||g.setOpacity(1);d._topClusterLevel._recursively(e,a,b,function(a){a._recursivelyRestoreChildPositions(b)}),setTimeout(function(){d._topClusterLevel._recursively(e,a,0,function(a){L.FeatureGroup.prototype.removeLayer.call(d,a),a.setOpacity(1)}),d._animationEnd()},200)},_animationZoomOut:function(a,b){this._animationZoomOutSingle(this._topClusterLevel,a-1,b),this._topClusterLevel._recursivelyAddChildrenToMap(null,b,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,a,this._getExpandedVisibleBounds())},_animationZoomOutSingle:function(a,b,c){var d=this._getExpandedVisibleBounds();a._recursivelyAnimateChildrenInAndAddSelfToMap(d,b+1,c);var e=this;this._forceLayout(),a._recursivelyBecomeVisible(d,c),setTimeout(function(){if(1===a._childCount){var f=a._markers[0];f.setLatLng(f.getLatLng()),f.setOpacity(1)}else a._recursively(d,c,0,function(a){a._recursivelyRemoveChildrenFromMap(d,b+1)});e._animationEnd()},200)},_animationAddLayer:function(a,b){var c=this;a._noHas=!0,L.FeatureGroup.prototype.addLayer.call(this,a),delete a._noHas,b!==a&&(b._childCount>2?(b._updateIcon(),this._forceLayout(),this._animationStart(),a._setPos(this._map.latLngToLayerPoint(b.getLatLng())),a.setOpacity(0),setTimeout(function(){L.FeatureGroup.prototype.removeLayer.call(c,a),a.setOpacity(1),c._animationEnd()},200)):(this._forceLayout(),c._animationStart(),c._animationZoomOutSingle(b,this._map.getMaxZoom(),this._map.getZoom())))},_forceLayout:function(){L.Util.falseFn(b.body.offsetWidth)}}:{_animationStart:function(){},_animationZoomIn:function(a,b){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,a),this._topClusterLevel._recursivelyAddChildrenToMap(null,b,this._getExpandedVisibleBounds())},_animationZoomOut:function(a,b){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,a),this._topClusterLevel._recursivelyAddChildrenToMap(null,b,this._getExpandedVisibleBounds())},_animationAddLayer:function(a,b){this._animationAddLayerNonAnimated(a,b)}}),L.markerClusterGroup=function(a){return new L.MarkerClusterGroup(a)},L.MarkerCluster=L.Marker.extend({initialize:function(a,b,c,d){L.Marker.prototype.initialize.call(this,c?c._cLatLng||c.getLatLng():new L.LatLng(0,0),{icon:this}),this._group=a,this._zoom=b,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._bounds=new L.LatLngBounds,c&&this._addChild(c),d&&this._addChild(d)},getAllChildMarkers:function(a){a=a||[];for(var b=this._childClusters.length-1;b>=0;b--)this._childClusters[b].getAllChildMarkers(a);for(var c=this._markers.length-1;c>=0;c--)a.push(this._markers[c]);return a},getChildCount:function(){return this._childCount},zoomToBounds:function(){this._group._map.fitBounds(this._bounds)},getBounds:function(){var a=new L.LatLngBounds;return a.extend(this._bounds),a},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(a,b){this._iconNeedsUpdate=!0,this._expandBounds(a),a instanceof L.MarkerCluster?(b||(this._childClusters.push(a),a.__parent=this),this._childCount+=a._childCount):(b||this._markers.push(a),this._childCount++),this.__parent&&this.__parent._addChild(a,!0)},_expandBounds:function(a){var b,c=a._wLatLng||a._latlng;a instanceof L.MarkerCluster?(this._bounds.extend(a._bounds),b=a._childCount):(this._bounds.extend(c),b=1),this._cLatLng||(this._cLatLng=a._cLatLng||c);var d=this._childCount+b;this._wLatLng?(this._wLatLng.lat=(c.lat*b+this._wLatLng.lat*this._childCount)/d,this._wLatLng.lng=(c.lng*b+this._wLatLng.lng*this._childCount)/d):this._latlng=this._wLatLng=new L.LatLng(c.lat,c.lng)},_addToMap:function(a){a&&(this._backupLatlng=this._latlng,this.setLatLng(a)),this._noHas=!0,L.FeatureGroup.prototype.addLayer.call(this._group,this),delete this._noHas},_recursivelyAnimateChildrenIn:function(a,b,c){this._recursively(a,0,c-1,function(a){var c,d,e=a._markers;for(c=e.length-1;c>=0;c--)d=e[c],d._icon&&(d._setPos(b),d.setOpacity(0))},function(a){var c,d,e=a._childClusters;for(c=e.length-1;c>=0;c--)d=e[c],d._icon&&(d._setPos(b),d.setOpacity(0))})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(a,b,c){this._recursively(a,c,0,function(d){d._recursivelyAnimateChildrenIn(a,d._group._map.latLngToLayerPoint(d.getLatLng()).round(),b),d._isSingleParent()&&b-1===c?(d.setOpacity(1),d._recursivelyRemoveChildrenFromMap(a,b)):d.setOpacity(0),d._addToMap()})},_recursivelyBecomeVisible:function(a,b){this._recursively(a,0,b,null,function(a){a.setOpacity(1)})},_recursivelyAddChildrenToMap:function(a,b,c){this._recursively(c,-1,b,function(d){if(b!==d._zoom)for(var e=d._markers.length-1;e>=0;e--){var f=d._markers[e];c.contains(f._latlng)&&(a&&(f._backupLatlng=f.getLatLng(),f.setLatLng(a),f.setOpacity&&f.setOpacity(0)),f._noHas=!0,L.FeatureGroup.prototype.addLayer.call(d._group,f),delete f._noHas)}},function(b){b._addToMap(a)})},_recursivelyRestoreChildPositions:function(a){for(var b=this._markers.length-1;b>=0;b--){var c=this._markers[b];c._backupLatlng&&(c.setLatLng(c._backupLatlng),delete c._backupLatlng)}if(a-1===this._zoom)for(var d=this._childClusters.length-1;d>=0;d--)this._childClusters[d]._restorePosition();else for(var e=this._childClusters.length-1;e>=0;e--)this._childClusters[e]._recursivelyRestoreChildPositions(a)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(a,b,c){var d,e;this._recursively(a,-1,b-1,function(a){for(e=a._markers.length-1;e>=0;e--)d=a._markers[e],c&&c.contains(d._latlng)||(L.FeatureGroup.prototype.removeLayer.call(a._group,d),d.setOpacity&&d.setOpacity(1))},function(a){for(e=a._childClusters.length-1;e>=0;e--)d=a._childClusters[e],c&&c.contains(d._latlng)||((!L.FeatureGroup.prototype.hasLayer||L.FeatureGroup.prototype.hasLayer.call(a._group,d))&&L.FeatureGroup.prototype.removeLayer.call(a._group,d),d.setOpacity&&d.setOpacity(1))})},_recursively:function(a,b,c,d,e){var f,g,h=this._childClusters,i=this._zoom;if(b>i)for(f=h.length-1;f>=0;f--)g=h[f],a.intersects(g._bounds)&&g._recursively(a,b,c,d,e);else if(d&&d(this),e&&this._zoom===c&&e(this),c>i)for(f=h.length-1;f>=0;f--)g=h[f],a.intersects(g._bounds)&&g._recursively(a,b,c,d,e)},_recalculateBounds:function(){var a,b=this._markers,c=this._childClusters;for(this._bounds=new L.LatLngBounds,delete this._wLatLng,a=b.length-1;a>=0;a--)this._expandBounds(b[a]);for(a=c.length-1;a>=0;a--)this._expandBounds(c[a])},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),L.DistanceGrid=function(a){this._cellSize=a,this._sqCellSize=a*a,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(a,b){var c=this._getCoord(b.x),d=this._getCoord(b.y),e=this._grid,f=e[d]=e[d]||{},g=f[c]=f[c]||[],h=L.Util.stamp(a);this._objectPoint[h]=b,g.push(a)},updateObject:function(a,b){this.removeObject(a),this.addObject(a,b)},removeObject:function(a,b){var c,d,e=this._getCoord(b.x),f=this._getCoord(b.y),g=this._grid,h=g[f]=g[f]||{},i=h[e]=h[e]||[];for(delete this._objectPoint[L.Util.stamp(a)],c=0,d=i.length;d>c;c++)if(i[c]===a)return i.splice(c,1),1===d&&delete h[e],!0},eachObject:function(a,b){var c,d,e,f,g,h,i,j=this._grid;for(c in j){g=j[c];for(d in g)for(h=g[d],e=0,f=h.length;f>e;e++)i=a.call(b,h[e]),i&&(e--,f--)}},getNearObject:function(a){var b,c,d,e,f,g,h,i,j=this._getCoord(a.x),k=this._getCoord(a.y),l=this._objectPoint,m=this._sqCellSize,n=null;for(b=k-1;k+1>=b;b++)if(e=this._grid[b])for(c=j-1;j+1>=c;c++)if(f=e[c])for(d=0,g=f.length;g>d;d++)h=f[d],i=this._sqDist(l[L.Util.stamp(h)],a),m>i&&(m=i,n=h);return n},_getCoord:function(a){return Math.floor(a/this._cellSize)},_sqDist:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d}},function(){L.QuickHull={getDistant:function(a,b){var c=b[1].lat-b[0].lat,d=b[0].lng-b[1].lng;return d*(a.lat-b[0].lat)+c*(a.lng-b[0].lng)},findMostDistantPointFromBaseLine:function(a,b){var c,d,e,f=0,g=null,h=[];for(c=b.length-1;c>=0;c--)d=b[c],e=this.getDistant(d,a),e>0&&(h.push(d),e>f&&(f=e,g=d));return{maxPoint:g,newPoints:h}},buildConvexHull:function(a,b){var c=[],d=this.findMostDistantPointFromBaseLine(a,b);return d.maxPoint?(c=c.concat(this.buildConvexHull([a[0],d.maxPoint],d.newPoints)),c=c.concat(this.buildConvexHull([d.maxPoint,a[1]],d.newPoints))):[a]},getConvexHull:function(a){var b,c=!1,d=!1,e=null,f=null;for(b=a.length-1;b>=0;b--){var g=a[b];(c===!1||g.lat>c)&&(e=g,c=g.lat),(d===!1||g.lat=0;c--)b=d[c].getLatLng(),e.push(b);for(a=L.QuickHull.getConvexHull(e),c=a.length-1;c>=0;c--)f.push(a[c][0]);return f}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var a,b=this.getAllChildMarkers(),c=this._group,d=c._map,e=d.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,b.length>=this._circleSpiralSwitchover?a=this._generatePointsSpiral(b.length,e):(e.y+=10,a=this._generatePointsCircle(b.length,e)),this._animationSpiderfy(b,a)}},unspiderfy:function(a){this._group._inZoomAnimation||(this._animationUnspiderfy(a),this._group._spiderfied=null)},_generatePointsCircle:function(a,b){var c,d,e=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+a),f=e/this._2PI,g=this._2PI/a,h=[];for(h.length=a,c=a-1;c>=0;c--)d=this._circleStartAngle+c*g,h[c]=new L.Point(b.x+f*Math.cos(d),b.y+f*Math.sin(d))._round();return h},_generatePointsSpiral:function(a,b){var c,d=this._group.options.spiderfyDistanceMultiplier*this._spiralLengthStart,e=this._group.options.spiderfyDistanceMultiplier*this._spiralFootSeparation,f=this._group.options.spiderfyDistanceMultiplier*this._spiralLengthFactor,g=0,h=[];for(h.length=a,c=a-1;c>=0;c--)g+=e/d+5e-4*c,h[c]=new L.Point(b.x+d*Math.cos(g),b.y+d*Math.sin(g))._round(),d+=this._2PI*f/g;return h},_noanimationUnspiderfy:function(){var a,b,c=this._group,d=c._map,e=this.getAllChildMarkers();for(this.setOpacity(1),b=e.length-1;b>=0;b--)a=e[b],L.FeatureGroup.prototype.removeLayer.call(c,a),a._preSpiderfyLatlng&&(a.setLatLng(a._preSpiderfyLatlng),delete a._preSpiderfyLatlng),a.setZIndexOffset(0),a._spiderLeg&&(d.removeLayer(a._spiderLeg),delete a._spiderLeg)}}),L.MarkerCluster.include(L.DomUtil.TRANSITION?{SVG_ANIMATION:function(){return b.createElementNS("http://www.w3.org/2000/svg","animate").toString().indexOf("SVGAnimate")>-1}(),_animationSpiderfy:function(a,c){var d,e,f,g,h=this,i=this._group,j=i._map,k=j.latLngToLayerPoint(this._latlng);for(d=a.length-1;d>=0;d--)e=a[d],e.setZIndexOffset(1e6),e.setOpacity(0),e._noHas=!0,L.FeatureGroup.prototype.addLayer.call(i,e),delete e._noHas,e._setPos(k);i._forceLayout(),i._animationStart();var l=L.Path.SVG?0:.3,m=L.Path.SVG_NS;for(d=a.length-1;d>=0;d--)if(g=j.layerPointToLatLng(c[d]),e=a[d],e._preSpiderfyLatlng=e._latlng,e.setLatLng(g),e.setOpacity(1),f=new L.Polyline([h._latlng,g],{weight:1.5,color:"#222",opacity:l}),j.addLayer(f),e._spiderLeg=f,L.Path.SVG&&this.SVG_ANIMATION){var n=f._path.getTotalLength();f._path.setAttribute("stroke-dasharray",n+","+n);var o=b.createElementNS(m,"animate");o.setAttribute("attributeName","stroke-dashoffset"),o.setAttribute("begin","indefinite"),o.setAttribute("from",n),o.setAttribute("to",0),o.setAttribute("dur",.25),f._path.appendChild(o),o.beginElement(),o=b.createElementNS(m,"animate"),o.setAttribute("attributeName","stroke-opacity"),o.setAttribute("attributeName","stroke-opacity"),o.setAttribute("begin","indefinite"),o.setAttribute("from",0),o.setAttribute("to",.5),o.setAttribute("dur",.25),f._path.appendChild(o),o.beginElement()}if(h.setOpacity(.3),L.Path.SVG)for(this._group._forceLayout(),d=a.length-1;d>=0;d--)e=a[d]._spiderLeg,e.options.opacity=.5,e._path.setAttribute("stroke-opacity",.5);setTimeout(function(){i._animationEnd(),i.fire("spiderfied")},200)},_animationUnspiderfy:function(a){var b,c,d,e=this._group,f=e._map,g=a?f._latLngToNewLayerPoint(this._latlng,a.zoom,a.center):f.latLngToLayerPoint(this._latlng),h=this.getAllChildMarkers(),i=L.Path.SVG&&this.SVG_ANIMATION;for(e._animationStart(),this.setOpacity(1),c=h.length-1;c>=0;c--)b=h[c],b._preSpiderfyLatlng&&(b.setLatLng(b._preSpiderfyLatlng),delete b._preSpiderfyLatlng,b._setPos(g),b.setOpacity(0),i&&(d=b._spiderLeg._path.childNodes[0],d.setAttribute("to",d.getAttribute("from")),d.setAttribute("from",0),d.beginElement(),d=b._spiderLeg._path.childNodes[1],d.setAttribute("from",.5),d.setAttribute("to",0),d.setAttribute("stroke-opacity",0),d.beginElement(),b._spiderLeg._path.setAttribute("stroke-opacity",0)));setTimeout(function(){var a=0;for(c=h.length-1;c>=0;c--)b=h[c],b._spiderLeg&&a++;for(c=h.length-1;c>=0;c--)b=h[c],b._spiderLeg&&(b.setOpacity(1),b.setZIndexOffset(0),a>1&&L.FeatureGroup.prototype.removeLayer.call(e,b),f.removeLayer(b._spiderLeg),delete b._spiderLeg);e._animationEnd()},200)}}:{_animationSpiderfy:function(a,b){var c,d,e,f,g=this._group,h=g._map;for(c=a.length-1;c>=0;c--)f=h.layerPointToLatLng(b[c]),d=a[c],d._preSpiderfyLatlng=d._latlng,d.setLatLng(f),d.setZIndexOffset(1e6),L.FeatureGroup.prototype.addLayer.call(g,d),e=new L.Polyline([this._latlng,f],{weight:1.5,color:"#222"}),h.addLayer(e),d._spiderLeg=e;this.setOpacity(.3),g.fire("spiderfied")},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerClusterGroup.include({_spiderfied:null,_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation?this._map.on("zoomstart",this._unspiderfyZoomStart,this):this._map.on("zoomend",this._unspiderfyWrapper,this),L.Path.SVG&&!L.Browser.touch&&this._map._initPathRoot()},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(a){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(a))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(a){this._spiderfied&&this._spiderfied.unspiderfy(a)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(a){a._spiderLeg&&(L.FeatureGroup.prototype.removeLayer.call(this,a),a.setOpacity(1),a.setZIndexOffset(0),this._map.removeLayer(a._spiderLeg),delete a._spiderLeg)}})}(window,document),function(){L.labelVersion="0.1.4-dev",L.Label=L.Popup.extend({options:{autoPan:!1,className:"",closePopupOnClick:!1,noHide:!1,offset:new L.Point(12,-15),opacity:1},onAdd:function(a){this._map=a,this._pane=this._source instanceof L.Marker?a._panes.markerPane:a._panes.popupPane,this._container||this._initLayout(),this._updateContent();var b=a.options.fadeAnimation;b&&L.DomUtil.setOpacity(this._container,0),this._pane.appendChild(this._container),a.on("viewreset",this._updatePosition,this),this._animated&&a.on("zoomanim",this._zoomAnimation,this),L.Browser.touch&&!this.options.noHide&&L.DomEvent.on(this._container,"click",this.close,this),this._update(),this.setOpacity(this.options.opacity)},onRemove:function(a){this._pane.removeChild(this._container),L.Util.falseFn(this._container.offsetWidth),a.off({viewreset:this._updatePosition,zoomanim:this._zoomAnimation},this),a.options.fadeAnimation&&L.DomUtil.setOpacity(this._container,0),this._map=null},close:function(){var a=this._map;a&&(L.Browser.touch&&!this.options.noHide&&L.DomEvent.off(this._container,"click",this.close),a._label=null,a.removeLayer(this))},updateZIndex:function(a){this._zIndex=a,this._container&&this._zIndex&&(this._container.style.zIndex=a)},setOpacity:function(a){this.options.opacity=a,this._container&&L.DomUtil.setOpacity(this._container,a)},_initLayout:function(){this._container=L.DomUtil.create("div","leaflet-label "+this.options.className+" leaflet-zoom-animated"),this.updateZIndex(this._zIndex)},_updateContent:function(){this._content&&"string"==typeof this._content&&(this._container.innerHTML=this._content)},_updateLayout:function(){},_updatePosition:function(){var a=this._map.latLngToLayerPoint(this._latlng);this._setPosition(a)},_setPosition:function(a){a=a.add(this.options.offset),L.DomUtil.setPosition(this._container,a)},_zoomAnimation:function(a){var b=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);this._setPosition(b)}}),L.Icon.Default.mergeOptions({labelAnchor:new L.Point(9,-20)}),L.Marker.mergeOptions({icon:new L.Icon.Default}),L.Marker.include({showLabel:function(){return this._label&&this._map&&(this._label.setLatLng(this._latlng),this._map.showLabel(this._label)),this},hideLabel:function(){return this._label&&this._label.close(),this},setLabelNoHide:function(a){this._labelNoHide!==a&&(this._labelNoHide=a,a?(this._removeLabelRevealHandlers(),this.showLabel()):(this._addLabelRevealHandlers(),this.hideLabel()))},bindLabel:function(a,b){var c=L.point(this.options.icon.options.labelAnchor)||new L.Point(0,0);return c=c.add(L.Label.prototype.options.offset),b&&b.offset&&(c=c.add(b.offset)),b=L.Util.extend({offset:c},b),this._labelNoHide=b.noHide,this._label||(this._labelNoHide||this._addLabelRevealHandlers(),this.on("remove",this.hideLabel,this).on("move",this._moveLabel,this),this._hasLabelHandlers=!0),this._label=new L.Label(b,this).setContent(a),this},unbindLabel:function(){return this._label&&(this.hideLabel(),this._label=null,this._hasLabelHandlers&&(this._labelNoHide||this._removeLabelRevealHandlers(),this.off("remove",this.hideLabel,this).off("move",this._moveLabel,this)),this._hasLabelHandlers=!1),this},updateLabelContent:function(a){this._label&&this._label.setContent(a)},_addLabelRevealHandlers:function(){this.on("mouseover",this.showLabel,this).on("mouseout",this.hideLabel,this),L.Browser.touch&&this.on("click",this.showLabel,this)},_removeLabelRevealHandlers:function(){this.off("mouseover",this.showLabel,this).off("mouseout",this.hideLabel,this).off("remove",this.hideLabel,this).off("move",this._moveLabel,this),L.Browser.touch&&this.off("click",this.showLabel,this)},_moveLabel:function(a){this._label.setLatLng(a.latlng)},_originalUpdateZIndex:L.Marker.prototype._updateZIndex,_updateZIndex:function(a){var b=this._zIndex+a;this._originalUpdateZIndex(a),this._label&&this._label.updateZIndex(b)},_originalSetOpacity:L.Marker.prototype.setOpacity,setOpacity:function(a,b){this.options.labelHasSemiTransparency=b,this._originalSetOpacity(a)},_originalUpdateOpacity:L.Marker.prototype._updateOpacity,_updateOpacity:function(){var a=0===this.options.opacity?0:1;this._originalUpdateOpacity(),this._label&&this._label.setOpacity(this.options.labelHasSemiTransparency?this.options.opacity:a)}}),L.Path.include({bindLabel:function(a,b){return this._label&&this._label.options===b||(this._label=new L.Label(b,this)),this._label.setContent(a),this._showLabelAdded||(this.on("mouseover",this._showLabel,this).on("mousemove",this._moveLabel,this).on("mouseout remove",this._hideLabel,this),L.Browser.touch&&this.on("click",this._showLabel,this),this._showLabelAdded=!0),this},unbindLabel:function(){return this._label&&(this._hideLabel(),this._label=null,this._showLabelAdded=!1,this.off("mouseover",this._showLabel,this).off("mousemove",this._moveLabel,this).off("mouseout remove",this._hideLabel,this)),this},updateLabelContent:function(a){this._label&&this._label.setContent(a)},_showLabel:function(a){this._label.setLatLng(a.latlng),this._map.showLabel(this._label)},_moveLabel:function(a){this._label.setLatLng(a.latlng)},_hideLabel:function(){this._label.close()}}),L.Map.include({showLabel:function(a){return this._label=a,this.addLayer(a)}}),L.FeatureGroup.include({clearLayers:function(){return this.unbindLabel(),this.eachLayer(this.removeLayer,this),this},bindLabel:function(a,b){return this.invoke("bindLabel",a,b)},unbindLabel:function(){return this.invoke("unbindLabel")},updateLabelContent:function(a){this.invoke("updateLabelContent",a)}})}(this,document); \ No newline at end of file diff --git a/dist/app/panels/bettermap/module.html b/dist/app/panels/bettermap/module.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/bettermap/module.js b/dist/app/panels/bettermap/module.js old mode 100755 new mode 100644 index 32f7af986c1..5b113ecb1e0 --- a/dist/app/panels/bettermap/module.js +++ b/dist/app/panels/bettermap/module.js @@ -1,123 +1,8 @@ -(function(e,t,n){var r=e.L,i={};i.version="0.6-dev",typeof module=="object"&&typeof module.exports=="object"?module.exports=i:typeof define=="function"&&define.amd&&define("panels/bettermap/leaflet/leaflet-src",i),i.noConflict=function(){return e.L=r,this},e.L=i,i.Util={extend:function(e){var t=Array.prototype.slice.call(arguments,1),n,r,i,s;for(r=0,i=t.length;r2?Array.prototype.slice.call(arguments,2):null;return function(){return e.apply(t,n||arguments)}},stamp:function(){var e=0,t="_leaflet_id";return function(n){return n[t]=n[t]||++e,n[t]}}(),invokeEach:function(e,t,n){var r,i;if(typeof e=="object"){i=Array.prototype.slice.call(arguments,3);for(r in e)t.apply(n,[r,e[r]].concat(i));return!0}return!1},limitExecByInterval:function(e,t,n){var r,i;return function s(){var o=arguments;if(r){i=!0;return}r=!0,setTimeout(function(){r=!1,i&&(s.apply(n,o),i=!1)},t),e.apply(n,o)}},falseFn -:function(){return!1},formatNum:function(e,t){var n=Math.pow(10,t||5);return Math.round(e*n)/n},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},splitWords:function(e){return i.Util.trim(e).split(/\s+/)},setOptions:function(e,t){return e.options=i.extend({},e.options,t),e.options},getParamString:function(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+"="+encodeURIComponent(e[i]));return(!t||t.indexOf("?")===-1?"?":"&")+r.join("&")},template:function(e,t){return e.replace(/\{ *([\w_]+) *\}/g,function(e,r){var i=t[r];if(i===n)throw new Error("No value provided for variable "+e);return typeof i=="function"&&(i=i(t)),i})},isArray:function(e){return Object.prototype.toString.call(e)==="[object Array]"},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function t(t){var n,r,i=["webkit","moz","o","ms"];for(n=0;n0||e+"_idx"in t&&t[e+"_idx_len"]>0)},removeEventListener:function(e,t,n){if(!this[s])return this;if(!e)return this.clearAllEventListeners();if(i.Util.invokeEach(e,this.removeEventListener,this,t,n))return this;var r=this[s],o=n&&i.stamp(n),u,a,f,l,c,h,p,d,v;e=i.Util.splitWords(e);for(u=0,a=e.length;u=0;c--)l[c].action===t&&(!n||l[c].context===n)&&(v=l.splice(c,1),v[0].action=i.Util.falseFn);n&&d&&l.length===0&&(delete d[o],r[p]--)}}}return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(e,t){if(!this.hasEventListeners(e))return this;var n=i.Util.extend({},t,{type:e,target:this}),r=this[s],o,u,a,f,l;if(r[e]){o=r[e].slice();for(u=0,a=o.length;u1||"matchMedia"in -e&&e.matchMedia("(min-resolution:144dpi)")&&e.matchMedia("(min-resolution:144dpi)").matches,g=t.documentElement,y=r&&"transition"in g.style,b="WebKitCSSMatrix"in e&&"m11"in new e.WebKitCSSMatrix,w="MozPerspective"in g.style,E="OTransition"in g.style,S=!e.L_DISABLE_3D&&(y||b||w||E)&&!c,x=!e.L_NO_TOUCH&&!c&&function(){var e="ontouchstart";if(v||e in g)return!0;var n=t.createElement("div"),r=!1;return n.setAttribute?(n.setAttribute(e,"return;"),typeof n[e]=="function"&&(r=!0),n.removeAttribute(e),n=null,r):!1}();i.Browser={ie:r,ie6:s,ie7:o,ielt9:u,webkit:f,android:h,android23:p,chrome:l,ie3d:y,webkit3d:b,gecko3d:w,opera3d:E,any3d:S,mobile:d,mobileWebkit:d&&f,mobileWebkit3d:d&&b,mobileOpera:d&&e.opera,touch:x,msTouch:v,retina:m}}(),i.Point=function(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t},i.Point.prototype={clone:function(){return new i.Point(this.x,this.y)},add:function(e){return this.clone()._add(i.point(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract: -function(e){return this.clone()._subtract(i.point(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(e){e=i.point(e);var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return e=i.point(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=i.point(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+i.Util.formatNum(this.x)+", "+i.Util.formatNum(this.y)+")"}},i.point=function(e,t,r){return e instanceof -i.Point?e:i.Util.isArray(e)?new i.Point(e[0],e[1]):e===n||e===null?e:new i.Point(e,t,r)},i.Bounds=function(e,t){if(!e)return;var n=t?[e,t]:e;for(var r=0,i=n.length;r=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=i.bounds -(e);var t=this.min,n=this.max,r=e.min,s=e.max,o=s.x>=t.x&&r.x<=n.x,u=s.y>=t.y&&r.y<=n.y;return o&&u},isValid:function(){return!!this.min&&!!this.max}},i.bounds=function(e,t){return!e||e instanceof i.Bounds?e:new i.Bounds(e,t)},i.Transformation=function(e,t,n,r){this._a=e,this._b=t,this._c=n,this._d=r},i.Transformation.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new i.Point((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}},i.DomUtil={get:function(e){return typeof e=="string"?t.getElementById(e):e},getStyle:function(e,n){var r=e.style[n];!r&&e.currentStyle&&(r=e.currentStyle[n]);if((!r||r==="auto")&&t.defaultView){var i=t.defaultView.getComputedStyle(e,null);r=i?i[n]:null}return r==="auto"?null:r},getViewportOffset:function(e){var n=0,r=0,s=e,o=t.body,u=t.documentElement,a,f=i.Browser.ie7;do{n+=s.offsetTop||0,r+=s.offsetLeft||0 -,n+=parseInt(i.DomUtil.getStyle(s,"borderTopWidth"),10)||0,r+=parseInt(i.DomUtil.getStyle(s,"borderLeftWidth"),10)||0,a=i.DomUtil.getStyle(s,"position");if(s.offsetParent===o&&a==="absolute")break;if(a==="fixed"){n+=o.scrollTop||u.scrollTop||0,r+=o.scrollLeft||u.scrollLeft||0;break}if(a==="relative"&&!s.offsetLeft){var l=i.DomUtil.getStyle(s,"width"),c=i.DomUtil.getStyle(s,"max-width"),h=s.getBoundingClientRect();if(l!=="none"||c!=="none")r+=h.left+s.clientLeft;n+=h.top+(o.scrollTop||u.scrollTop||0);break}s=s.offsetParent}while(s);s=e;do{if(s===o)break;n-=s.scrollTop||0,r-=s.scrollLeft||0,!i.DomUtil.documentIsLtr()&&(i.Browser.webkit||f)&&(r+=s.scrollWidth-s.clientWidth,f&&i.DomUtil.getStyle(s,"overflow-y")!=="hidden"&&i.DomUtil.getStyle(s,"overflow")!=="hidden"&&(r+=17)),s=s.parentNode}while(s);return new i.Point(r,n)},documentIsLtr:function(){return i.DomUtil._docIsLtrCached||(i.DomUtil._docIsLtrCached=!0,i.DomUtil._docIsLtr=i.DomUtil.getStyle(t.body,"direction")==="ltr"),i.DomUtil._docIsLtr -},create:function(e,n,r){var i=t.createElement(e);return i.className=n,r&&r.appendChild(i),i},disableTextSelection:function(){t.selection&&t.selection.empty&&t.selection.empty(),this._onselectstart||(this._onselectstart=t.onselectstart||null,t.onselectstart=i.Util.falseFn)},enableTextSelection:function(){t.onselectstart===i.Util.falseFn&&(t.onselectstart=this._onselectstart,this._onselectstart=null)},hasClass:function(e,t){return e.className.length>0&&(new RegExp("(^|\\s)"+t+"(\\s|$)")).test(e.className)},addClass:function(e,t){i.DomUtil.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},removeClass:function(e,t){e.className=i.Util.trim((" "+e.className+" ").replace(" "+t+" "," "))},setOpacity:function(e,t){if("opacity"in e.style)e.style.opacity=t;else if("filter"in e.style){var n=!1,r="DXImageTransform.Microsoft.Alpha";try{n=e.filters.item(r)}catch(i){if(t===1)return}t=Math.round(t*100),n?(n.Enabled=t!==100,n.Opacity=t):e.style.filter+=" progid:"+r+"(opacity="+t+")"}},testProp:function( -e){var n=t.documentElement.style;for(var r=0;r=t.lat&&s.lat<=n.lat&&r.lng>=t.lng&&s.lng<=n.lng},intersects:function(e){e=i.latLngBounds(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),s=e.getNorthEast -(),o=s.lat>=t.lat&&r.lat<=n.lat,u=s.lng>=t.lng&&r.lng<=n.lng;return o&&u},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e){return e?(e=i.latLngBounds(e),this._southWest.equals(e.getSouthWest())&&this._northEast.equals(e.getNorthEast())):!1},isValid:function(){return!!this._southWest&&!!this._northEast}},i.latLngBounds=function(e,t){return!e||e instanceof i.LatLngBounds?e:new i.LatLngBounds(e,t)},i.Projection={},i.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(e){var t=i.LatLng.DEG_TO_RAD,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),s=e.lng*t,o=r*t;return o=Math.log(Math.tan(Math.PI/4+o/2)),new i.Point(s,o)},unproject:function(e){var t=i.LatLng.RAD_TO_DEG,n=e.x*t,r=(2*Math.atan(Math.exp(e.y))-Math.PI/2)*t;return new i.LatLng(r,n)}},i.Projection.LonLat={project:function(e){return new i.Point(e.lng,e.lat)},unproject:function(e){return new i.LatLng(e.y,e.x)}},i.CRS={latLngToPoint:function( -e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},scale:function(e){return 256*Math.pow(2,e)}},i.CRS.Simple=i.extend({},i.CRS,{projection:i.Projection.LonLat,transformation:new i.Transformation(1,0,-1,0),scale:function(e){return Math.pow(2,e)}}),i.CRS.EPSG3857=i.extend({},i.CRS,{code:"EPSG:3857",projection:i.Projection.SphericalMercator,transformation:new i.Transformation(.5/Math.PI,.5,-0.5/Math.PI,.5),project:function(e){var t=this.projection.project(e),n=6378137;return t.multiplyBy(n)}}),i.CRS.EPSG900913=i.extend({},i.CRS.EPSG3857,{code:"EPSG:900913"}),i.CRS.EPSG4326=i.extend({},i.CRS,{code:"EPSG:4326",projection:i.Projection.LonLat,transformation:new i.Transformation(1/360,.5,-1/360,.5)}),i.Map=i.Class.extend({includes:i.Mixin.Events,options:{crs:i.CRS.EPSG3857 -,fadeAnimation:i.DomUtil.TRANSITION&&!i.Browser.android23,trackResize:!0,markerZoomAnimation:i.DomUtil.TRANSITION&&i.Browser.any3d},initialize:function(e,t){t=i.setOptions(this,t),this._initContainer(e),this._initLayout(),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),t.center&&t.zoom!==n&&this.setView(i.latLng(t.center),t.zoom,{reset:!0}),this._initLayers(t.layers),this._handlers=[],this.callInitHooks()},setView:function(e,t){return this._resetView(i.latLng(e),this._limitZoom(t)),this},setZoom:function(e,t){return this.setView(this.getCenter(),e,{zoom:t})},zoomIn:function(e,t){return this.setZoom(this._zoom+(e||1),t)},zoomOut:function(e,t){return this.setZoom(this._zoom-(e||1),t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),s=this.getSize().divideBy(2),o=e instanceof i.Point?e:this.latLngToContainerPoint(e),u=o.subtract(s).multiplyBy(1-1/r),a=this.containerPointToLatLng(s.add(u));return this.setView(a,t,{zoom:n})},fitBounds:function(e,t){t=t||{},e=e.getBounds? -e.getBounds():i.latLngBounds(e);var n=i.point(t.paddingTopLeft||t.padding||[0,0]),r=i.point(t.paddingBottomRight||t.padding||[0,0]),s=this.getBoundsZoom(e,!1,n.add(r)),o=r.subtract(n).divideBy(2),u=this.project(e.getSouthWest(),s),a=this.project(e.getNorthEast(),s),f=this.unproject(u.add(a).divideBy(2).add(o),s);return this.setView(f,s,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e){return this.fire("movestart"),this._rawPanBy(i.point(e)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(e){e=i.latLngBounds(e),this.options.maxBounds=e;if(!e)return this._boundsMinZoom=null,this.off("moveend",this._panInsideMaxBounds,this),this;var t=this.getBoundsZoom(e,!0);return this._boundsMinZoom=t,this._loaded&&(this._zoomo.x&&(u=Math.floor(o.x-r.x)),n.y>s.y&&(a=Math.floor(s.y-n.y)),n.xc&&--h>0)d=u*Math.sin(f),p=Math.PI/2-2*Math.atan(a*Math.pow((1-d)/(1+d),.5*u))-f,f+=p;return new i.LatLng(f*t,s)}},i.CRS.EPSG3395=i.extend({},i.CRS,{code:"EPSG:3395",projection:i.Projection.Mercator,transformation:function(){var e=i.Projection.Mercator,t=e.R_MAJOR,n=e.R_MINOR;return new i.Transformation(.5/(Math.PI*t),.5,-0.5/(Math.PI*n),.5)}()}),i.TileLayer=i.Class.extend({includes:i.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:i.Browser.mobile,updateWhenIdle:i.Browser.mobile},initialize:function( -e,t){t=i.setOptions(this,t),t.detectRetina&&i.Browser.retina&&t.maxZoom>0&&(t.tileSize=Math.floor(t.tileSize/2),t.zoomOffset++,t.minZoom>0&&t.minZoom--,this.options.maxZoom--),t.bounds&&(t.bounds=i.latLngBounds(t.bounds)),this._url=e;var n=this.options.subdomains;typeof n=="string"&&(this.options.subdomains=n.split(""))},onAdd:function(e){this._map=e,this._animated=e.options.zoomAnimation&&i.Browser.any3d,this._initContainer(),this._createTileProto(),e.on({viewreset:this._reset,moveend:this._update},this),this._animated&&e.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=i.Util.limitExecByInterval(this._update,150,this),e.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){this._container.parentNode.removeChild(this._container),e.off({viewreset:this._reset,moveend:this._update},this),this._animated&&e.off({zoomanim:this._animateZoom,zoomend -:this._endZoomAnim},this),this.options.updateWhenIdle||e.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var e=this._map._panes.tilePane;return this._container&&(e.appendChild(this._container),this._setAutoZIndex(e,Math.max)),this},bringToBack:function(){var e=this._map._panes.tilePane;return this._container&&(e.insertBefore(this._container,e.firstChild),this._setAutoZIndex(e,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},setUrl:function(e,t){return this._url=e,t||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==n&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex -:function(e,t){var n=e.children,r=-t(Infinity,-Infinity),i,s,o;for(s=0,o=n.length;sthis.options.maxZoom||t=n)||e.y<0||e.y>=n)return!1}if(t.bounds){var r=t.tileSize,i=e.multiplyBy(r),s=i.add([r,r]),o=this._map.unproject(i),u=this._map.unproject(s);!t.continuousWorld&&!t.noWrap&&(o=o.wrap(),u=u.wrap());if(!t.bounds.intersects([o,u]))return!1}return!0},_removeOtherTiles:function(e){var t,n,r,i;for(i in this._tiles)t=i.split(":"),n=parseInt(t[0],10),r=parseInt(t[1],10),(ne.max.x||re.max.y)&&this._removeTile(i)},_removeTile:function(e){var t=this._tiles[e];this.fire("tileunload",{tile:t,url:t.src}),this.options.reuseTiles?(i.DomUtil.removeClass(t,"leaflet-tile-loaded"),this._unusedTiles.push(t)):t.parentNode===this._tileContainer&&this._tileContainer.removeChild(t),i.Browser.android||(t.onload= -null,t.src=i.Util.emptyImageUrl),delete this._tiles[e]},_addTile:function(e,t){var n=this._getTilePos(e),r=this._getTile();i.DomUtil.setPosition(r,n,i.Browser.chrome||i.Browser.android23),this._tiles[e.x+":"+e.y]=r,this._loadTile(r,e),r.parentNode!==this._tileContainer&&t.appendChild(r)},_getZoomForUrl:function(){var e=this.options,t=this._map.getZoom();return e.zoomReverse&&(t=e.maxZoom-t),t+e.zoomOffset},_getTilePos:function(e){var t=this._map.getPixelOrigin(),n=this.options.tileSize;return e.multiplyBy(n).subtract(t)},getTileUrl:function(e){return i.Util.template(this._url,i.extend({s:this._getSubdomain(e),z:e.z,x:e.x,y:e.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(e){var t=this._getWrapTileNum();!this.options.continuousWorld&&!this.options.noWrap&&(e.x=(e.x%t+t)%t),this.options.tms&&(e.y=t-e.y-1),e.z=this._getZoomForUrl()},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this -.options.subdomains[t]},_createTileProto:function(){var e=this._tileImg=i.DomUtil.create("img","leaflet-tile");e.style.width=e.style.height=this.options.tileSize+"px",e.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var e=this._unusedTiles.pop();return this._resetTile(e),e}return this._createTile()},_resetTile:function(){},_createTile:function(){var e=this._tileImg.cloneNode(!1);return e.onselectstart=e.onmousemove=i.Util.falseFn,i.Browser.ielt9&&this.options.opacity!==n&&i.DomUtil.setOpacity(e,this.options.opacity),e},_loadTile:function(e,t){e._layer=this,e.onload=this._tileOnLoad,e.onerror=this._tileOnError,this._adjustTilePoint(t),e.src=this.getTileUrl(t)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(i.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var e=this._layer;this.src!==i.Util.emptyImageUrl&& -(i.DomUtil.addClass(this,"leaflet-tile-loaded"),e.fire("tileload",{tile:this,url:this.src})),e._tileLoaded()},_tileOnError:function(){var e=this._layer;e.fire("tileerror",{tile:this,url:this.src});var t=e.options.errorTileUrl;t&&(this.src=t),e._tileLoaded()}}),i.tileLayer=function(e,t){return new i.TileLayer(e,t)},i.TileLayer.WMS=i.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(e,t){this._url=e;var n=i.extend({},this.defaultWmsParams),r=t.tileSize||this.options.tileSize;t.detectRetina&&i.Browser.retina?n.width=n.height=r*2:n.width=n.height=r;for(var s in t)this.options.hasOwnProperty(s)||(n[s]=t[s]);this.wmsParams=n,i.setOptions(this,t)},onAdd:function(e){var t=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[t]=e.options.crs.code,i.TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e,t){var n=this._map,r=n.options.crs,s=this.options.tileSize,o=e.multiplyBy -(s),u=o.add([s,s]),a=r.project(n.unproject(o,t)),f=r.project(n.unproject(u,t)),l=[a.x,f.y,f.x,a.y].join(","),c=i.Util.template(this._url,{s:this._getSubdomain(e)});return c+i.Util.getParamString(this.wmsParams,c,!0)+"&BBOX="+l},setParams:function(e,t){return i.extend(this.wmsParams,e),t||this.redraw(),this}}),i.tileLayer.wms=function(e,t){return new i.TileLayer.WMS(e,t)},i.TileLayer.Canvas=i.TileLayer.extend({options:{async:!1},initialize:function(e){i.setOptions(this,e)},redraw:function(){for(var e in this._tiles)this._redrawTile(this._tiles[e]);return this},_redrawTile:function(e){this.drawTile(e,e._tilePoint,this._map._zoom)},_createTileProto:function(){var e=this._canvasProto=i.DomUtil.create("canvas","leaflet-tile");e.width=e.height=this.options.tileSize},_createTile:function(){var e=this._canvasProto.cloneNode(!1);return e.onselectstart=e.onmousemove=i.Util.falseFn,e},_loadTile:function(e,t){e._layer=this,e._tilePoint=t,this._redrawTile(e),this.options.async||this.tileDrawn(e)},drawTile -:function(){},tileDrawn:function(e){this._tileOnLoad.call(e)}}),i.tileLayer.canvas=function(e){return new i.TileLayer.Canvas(e)},i.ImageOverlay=i.Class.extend({includes:i.Mixin.Events,options:{opacity:1},initialize:function(e,t,n){this._url=e,this._bounds=i.latLngBounds(t),i.setOptions(this,n)},onAdd:function(e){this._map=e,this._image||this._initImage(),e._panes.overlayPane.appendChild(this._image),e.on("viewreset",this._reset,this),e.options.zoomAnimation&&i.Browser.any3d&&e.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(e){e.getPanes().overlayPane.removeChild(this._image),e.off("viewreset",this._reset,this),e.options.zoomAnimation&&e.off("zoomanim",this._animateZoom,this)},addTo:function(e){return e.addLayer(this),this},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var e=this._map._panes.overlayPane;return this -._image&&e.insertBefore(this._image,e.firstChild),this},_initImage:function(){this._image=i.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&i.Browser.any3d?i.DomUtil.addClass(this._image,"leaflet-zoom-animated"):i.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),i.extend(this._image,{galleryimg:"no",onselectstart:i.Util.falseFn,onmousemove:i.Util.falseFn,onload:i.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(e){var t=this._map,n=this._image,r=t.getZoomScale(e.zoom),s=this._bounds.getNorthWest(),o=this._bounds.getSouthEast(),u=t._latLngToNewLayerPoint(s,e.zoom,e.center),a=t._latLngToNewLayerPoint(o,e.zoom,e.center)._subtract(u),f=u._add(a._multiplyBy(.5*(1-1/r)));n.style[i.DomUtil.TRANSFORM]=i.DomUtil.getTranslateString(f)+" scale("+r+") "},_reset:function(){var e=this._image,t=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),n=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(t);i.DomUtil -.setPosition(e,t),e.style.width=n.x+"px",e.style.height=n.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){i.DomUtil.setOpacity(this._image,this.options.opacity)}}),i.imageOverlay=function(e,t,n){return new i.ImageOverlay(e,t,n)},i.Icon=i.Class.extend({options:{className:""},initialize:function(e){i.setOptions(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if(e==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var r;return!t||t.tagName!=="IMG"?r=this._createImg(n):r=this._createImg(n,t),this._setIconStyles(r,e),r},_setIconStyles:function(e,t){var n=this.options,r=i.point(n[t+"Size"]),s;t==="shadow"?s=i.point(n.shadowAnchor||n.iconAnchor):s=i.point(n.iconAnchor),!s&&r&&(s=r.divideBy(2,!0)),e.className="leaflet-marker-"+t+" "+n.className,s&&(e.style.marginLeft=-s.x+"px",e.style.marginTop=- -s.y+"px"),r&&(e.style.width=r.x+"px",e.style.height=r.y+"px")},_createImg:function(e,n){return i.Browser.ie6?(n||(n=t.createElement("div")),n.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+e+'")'):(n||(n=t.createElement("img")),n.src=e),n},_getIconUrl:function(e){return i.Browser.retina&&this.options[e+"RetinaUrl"]?this.options[e+"RetinaUrl"]:this.options[e+"Url"]}}),i.icon=function(e){return new i.Icon(e)},i.Icon.Default=i.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(e){var t=e+"Url";if(this.options[t])return this.options[t];i.Browser.retina&&e==="icon"&&(e+="-2x");var n=i.Icon.Default.imagePath;if(!n)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return n+"/marker-"+e+".png"}}),i.Icon.Default.imagePath=function(){var e=t.getElementsByTagName("script"),n=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/,r,i,s,o,u;for(r=0,i=e.length;rs?(t.height=s+"px",i.DomUtil.addClass(e,o)):i.DomUtil.removeClass(e,o),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(!this._map)return;var e=this._map.latLngToLayerPoint(this._latlng),t=this._animated,n=i.point(this.options.offset);t&& -i.DomUtil.setPosition(this._container,e),this._containerBottom=-n.y-(t?0:e.y),this._containerLeft=-Math.round(this._containerWidth/2)+n.x+(t?0:e.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"},_zoomAnimation:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);i.DomUtil.setPosition(this._container,t)},_adjustPan:function(){if(!this.options.autoPan)return;var e=this._map,t=this._container.offsetHeight,n=this._containerWidth,r=new i.Point(this._containerLeft,-t-this._containerBottom);this._animated&&r._add(i.DomUtil.getPosition(this._container));var s=e.layerPointToContainerPoint(r),o=i.point(this.options.autoPanPadding),u=e.getSize(),a=0,f=0;s.x+n>u.x&&(a=s.x+n-u.x+o.x),s.x-a<0&&(a=s.x-o.x),s.y+t>u.y&&(f=s.y+t-u.y+o.y),s.y-f<0&&(f=s.y-o.y),(a||f)&&e.fire("autopanstart").panBy([a,f])},_onCloseButtonClick:function(e){this._close(),i.DomEvent.stop(e)}}),i.popup=function(e,t){return new i.Popup(e,t)}, -i.Map.include({openPopup:function(e,t,n){this.closePopup();if(!(e instanceof i.Popup)){var r=e;e=(new i.Popup(n)).setLatLng(t).setContent(r)}return this._popup=e,this.addLayer(e)},closePopup:function(e){if(!e||e===this._popup)e=this._popup,this._popup=null;return e&&this.removeLayer(e),this}}),i.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(e,t){var n=i.point(this.options.icon.options.popupAnchor||[0,0]);return n=n.add(i.Popup.prototype.options.offset),t&&t.offset&&(n=n.add(t.offset)),t=i.extend({offset:n},t),this._popup||this.on("click",this.openPopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),e instanceof i.Popup?(i.setOptions(e,t),this._popup=e):this._popup=(new i.Popup(t,this)).setContent(e),this},setPopupContent:function(e){return this. -_popup&&this._popup.setContent(e),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(e){this._popup.setLatLng(e.latlng)}}),i.LayerGroup=i.Class.extend({initialize:function(e){this._layers={};var t,n;if(e)for(t=0,n=e.length;t';var n=e.firstChild;return n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch(r){return!1}}(),i.Path=i.Browser.svg||! -i.Browser.vml?i.Path:i.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return t.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return t.createElement("')}}catch(e){return function(e){return t.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var e=this._container=this._createElement("shape");i.DomUtil.addClass(e,"leaflet-vml-shape"),this.options.clickable&&i.DomUtil.addClass(e,"leaflet-clickable"),e.coordsize="1 1",this._path=this._createElement("path"),e.appendChild(this._path),this._map._pathRoot.appendChild(e)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var e=this._stroke,t=this._fill,n=this.options,r=this._container;r.stroked=n.stroke,r.filled=n.fill,n.stroke?(e||(e=this._stroke=this._createElement("stroke"),e.endcap="round",r.appendChild(e)),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=n.dashArray instanceof -Array?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle=""):e&&(r.removeChild(e),this._stroke=null),n.fill?(t||(t=this._fill=this._createElement("fill"),r.appendChild(t)),t.color=n.fillColor||n.color,t.opacity=n.fillOpacity):t&&(r.removeChild(t),this._fill=null)},_updatePath:function(){var e=this._container.style;e.display="none",this._path.v=this.getPathString()+" ",e.display=""}}),i.Map.include(i.Browser.svg||!i.Browser.vml?{}:{_initPathRoot:function(){if(this._pathRoot)return;var e=this._pathRoot=t.createElement("div");e.className="leaflet-vml-container",this._panes.overlayPane.appendChild(e),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}),i.Browser.canvas=function(){return!!t.createElement("canvas").getContext}(),i.Path=i.Path.SVG&&!e.L_PREFER_CANVAS||!i.Browser.canvas?i.Path:i.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(e){return i.setOptions -(this,e),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(e){e.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!i.Path._updateRequest&&(i.Path._updateRequest=i.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){i.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var e=this.options;e.stroke&&(this._ctx.lineWidth=e.weight,this._ctx.strokeStyle=e.color),e.fill&&(this._ctx.fillStyle=e.fillColor||e.color)},_drawPath:function(){var e,t,n,r,s,o;this._ctx.beginPath();for(e=0,n=this._parts.length;es&&(o=u,s=a);s>n&&(t[o]=1,this._simplifyDPStep(e,t,n,r,o),this._simplifyDPStep(e,t,n,o,i))},_reducePoints:function(e,t){var n=[e[0]];for(var r=1,i=0,s=e.length;rt&&(n.push(e[r]),i=r);return it.max.x&&(n|=2),e.yt.max.y&&(n|=8),n},_sqDist:function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},_sqClosestPointOnSegment:function(e,t,n,r){var s=t.x,o=t.y,u=n.x-s,a=n.y-o,f=u*u+a*a,l;return f>0&&(l=((e.x-s)*u+(e.y-o)*a)/f,l>1?(s=n.x,o=n.y):l>0&&(s+=u*l,o+=a*l)),u=e.x-s,a=e.y-o,r?u*u+a*a:new i.Point(s,o)}},i.Polyline=i.Path.extend({initialize:function(e,t){i.Path.prototype.initialize.call(this,t),this._latlngs=this._convertLatLngs(e)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var e=0,t=this._latlngs.length;e=2&&e[0].equals(e[e.length-1])&&e.pop()},projectLatlngs:function(){i.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[];if(!this._holes)return;var e,t,n,r;for(e=0,n=this._holes.length;ee.max.x||n.y-t>e.max.y||n.x+te.y!=s.y>e.y&&e.x<(s.x-r.x)*(e.y-r.y)/(s.y-r.y)+r.x&&(t=!t)}return t}}:{}),i.Circle.include(i.Path.CANVAS?{_drawPath:function(){var e=this._point;this._ctx.beginPath(),this._ctx.arc(e.x,e.y,this._radius,0,Math.PI*2,!1)},_containsPoint:function(e){var t=this._point,n=this.options.stroke?this.options.weight/2:0;return e.distanceTo(t)<=this._radius+n}}:{}),i.CircleMarker.include(i.Path.CANVAS?{_updateStyle:function(){i.Path.prototype._updateStyle -.call(this)}}:{}),i.GeoJSON=i.FeatureGroup.extend({initialize:function(e,t){i.setOptions(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t=i.Util.isArray(e)?e:e.features,n,r;if(t){for(n=0,r=t.length;n=0;n--)i.DomEvent.addListener(e,i.Draggable.START[n],t);return i.DomEvent.addListener(e,"click",t).addListener(e,"dblclick",t)},preventDefault:function(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this},stop:function(e){return i.DomEvent.preventDefault(e).stopPropagation(e)},getMousePosition:function(e,n){var r=t.body,s=t. -documentElement,o=e.pageX?e.pageX:e.clientX+r.scrollLeft+s.scrollLeft,u=e.pageY?e.pageY:e.clientY+r.scrollTop+s.scrollTop,a=new i.Point(o,u);return n?a._subtract(i.DomUtil.getViewportOffset(n)):a},getWheelDelta:function(e){var t=0;return e.wheelDelta&&(t=e.wheelDelta/120),e.detail&&(t=-e.detail/3),t},_checkMouse:function(e,t){var n=t.relatedTarget;if(!n)return!0;try{while(n&&n!==e)n=n.parentNode}catch(r){return!1}return n!==e},_getEvent:function(){var t=e.event;if(!t){var n=arguments.callee.caller;while(n){t=n.arguments[0];if(t&&e.Event===t.constructor)break;n=n.caller}}return t},_filterClick:function(e,t){var n=e.timeStamp||e.originalEvent.timeStamp,r=i.DomEvent._lastClick&&n-i.DomEvent._lastClick;if(r&&r>100&&r<400){i.DomEvent.stop(e);return}return i.DomEvent._lastClick=n,t(e)}},i.DomEvent.on=i.DomEvent.addListener,i.DomEvent.off=i.DomEvent.removeListener,i.Draggable=i.Class.extend({includes:i.Mixin.Events,statics:{START:i.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown -:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"},TAP_TOLERANCE:15},initialize:function(e,t,n){this._element=e,this._dragStartTarget=t||e,this._longPress=n&&!i.Browser.msTouch},enable:function(){if(this._enabled)return;for(var e=i.Draggable.START.length-1;e>=0;e--)i.DomEvent.on(this._dragStartTarget,i.Draggable.START[e],this._onDown,this);this._enabled=!0},disable:function(){if(!this._enabled)return;for(var e=i.Draggable.START.length-1;e>=0;e--)i.DomEvent.off(this._dragStartTarget,i.Draggable.START[e],this._onDown,this);this._enabled=!1,this._moved=!1},_onDown:function(e){if(e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)return;i.DomEvent.preventDefault(e).stopPropagation(e);if(i.Draggable._disabled)return;this._simulateClick=!0;var n=e.touches&&e.touches.length||0;if(n>1){this._simulateClick=!1,clearTimeout(this._longPressTimeout);return}var r=n===1?e.touches[0]:e,s=r.target;i.Browser.touch&&s.tagName -.toLowerCase()==="a"&&i.DomUtil.addClass(s,"leaflet-active"),this._moved=!1;if(this._moving)return;this._startPoint=new i.Point(r.clientX,r.clientY),this._startPos=this._newPos=i.DomUtil.getPosition(this._element),n===1&&i.Browser.touch&&this._longPress&&(this._longPressTimeout=setTimeout(i.bind(function(){var e=this._newPos&&this._newPos.distanceTo(this._startPos)||0;e1)return;var n=e.touches&&e.touches.length===1?e.touches[0]:e,r=new i.Point(n.clientX,n.clientY),s=r.subtract(this._startPoint);if(!s.x&&!s.y)return;i.DomEvent.preventDefault(e),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=i.DomUtil.getPosition(this._element).subtract(s),i.Browser.touch||(i.DomUtil.disableTextSelection(),i.DomUtil. -addClass(t.body,"leaflet-dragging"))),this._newPos=this._startPos.add(s),this._moving=!0,i.Util.cancelAnimFrame(this._animRequest),this._animRequest=i.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)},_updatePosition:function(){this.fire("predrag"),i.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(e){var n,r,s,o,u;clearTimeout(this._longPressTimeout),this._simulateClick&&e.changedTouches&&(s=this._newPos&&this._newPos.distanceTo(this._startPos)||0,n=e.changedTouches[0],r=n.target,r.tagName.toLowerCase()==="a"&&i.DomUtil.removeClass(r,"leaflet-active"),s200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var e=this._map.getSize()._divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,s=(r+t+n)%e-t-n,o=Math.abs(i+n)t.inertiaThreshold||!this._positions[0];e.fire("dragend");if(r)e.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),o=(this._lastTime+n-this._times[0])/1e3,u=t.easeLinearity,a=s.multiplyBy(u/o),f=a.distanceTo([0,0]),l=Math.min(t.inertiaMaxSpeed,f),c=a.multiplyBy(l/f),h=l/(t.inertiaDeceleration*u),p=c.multiplyBy(-h/2).round();!p.x||!p.y?e.fire("moveend"):i.Util.requestAnimFrame(function(){e.panBy(p,{duration:h,easeLinearity:u,noMoveStart:!0})})}}}),i.Map.addInitHook("addHandler","dragging",i.Map.Drag),i.Map.mergeOptions({doubleClickZoom:!0}),i.Map.DoubleClickZoom=i.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(e){this.setZoomAround(e.containerPoint,this._zoom+1)}}),i.Map.addInitHook("addHandler","doubleClickZoom",i.Map.DoubleClickZoom),i.Map.mergeOptions -({scrollWheelZoom:!0}),i.Map.ScrollWheelZoom=i.Handler.extend({addHooks:function(){i.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){i.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(e){var t=i.DomEvent.getWheelDelta(e);this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+(new Date));var n=Math.max(40-(+(new Date)-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(i.bind(this._performZoom,this),n),i.DomEvent.preventDefault(e),i.DomEvent.stopPropagation(e)},_performZoom:function(){var e=this._map,t=this._delta,n=e.getZoom();t=t>0?Math.ceil(t):Math.floor(t),t=Math.max(Math.min(t,4),-4),t=e._limitZoom(n+t)-n,this._delta=0,this._startTime=null;if(!t)return;e.setZoomAround(this._lastMousePos,n+t)}}),i.Map.addInitHook("addHandler","scrollWheelZoom",i.Map.ScrollWheelZoom),i.extend(i.DomEvent,{_touchstart:i.Browser.msTouch?"MSPointerDown" -:"touchstart",_touchend:i.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(e,n,r){function p(e){var t;i.Browser.msTouch?(h.push(e.pointerId),t=h.length):t=e.touches.length;if(t>1)return;var n=Date.now(),r=n-(s||n);a=e.touches?e.touches[0]:e,o=r>0&&r<=u,s=n}function d(e){if(i.Browser.msTouch){var t=h.indexOf(e.pointerId);if(t===-1)return;h.splice(t,1)}if(o){if(i.Browser.msTouch){var r={},u;for(var f in a)u=a[f],typeof u=="function"?r[f]=u.bind(a):r[f]=u;a=r}a.type="dblclick",n(a),s=null}}var s,o=!1,u=250,a,f="_leaflet_",l=this._touchstart,c=this._touchend,h=[];e[f+l+r]=p,e[f+c+r]=d;var v=i.Browser.msTouch?t.documentElement:e;return e.addEventListener(l,p,!1),v.addEventListener(c,d,!1),i.Browser.msTouch&&v.addEventListener("MSPointerCancel",d,!1),this},removeDoubleTapListener:function(e,n){var r="_leaflet_";return e.removeEventListener(this._touchstart,e[r+this._touchstart+n],!1),(i.Browser.msTouch?t.documentElement:e).removeEventListener(this._touchend,e[r+this._touchend+ -n],!1),i.Browser.msTouch&&t.documentElement.removeEventListener("MSPointerCancel",e[r+this._touchend+n],!1),this}}),i.extend(i.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(e,t,n,r){switch(t){case"touchstart":return this.addMsTouchListenerStart(e,t,n,r);case"touchend":return this.addMsTouchListenerEnd(e,t,n,r);case"touchmove":return this.addMsTouchListenerMove(e,t,n,r);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(e,n,r,i){var s="_leaflet_",o=this._msTouches,u=function(e){var t=!1;for(var n=0;n0?Math.ceil(o):Math.floor(o),a=e._limitZoom(s+u),f=e.getZoomScale(a)/this._scale;e._animateZoom(r,a,n,f)},_getScaleOrigin:function(){var e=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(e)}}),i.Map.addInitHook("addHandler","touchZoom",i.Map.TouchZoom),i.Map.mergeOptions({boxZoom:!0}),i.Map.BoxZoom=i.Handler.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane},addHooks:function(){i.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){i.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;i.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(e),this._box=i.DomUtil.create("div","leaflet-zoom-box",this._pane),i.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",i.DomEvent -.on(t,"mousemove",this._onMouseMove,this).on(t,"mouseup",this._onMouseUp,this).on(t,"keydown",this._onKeyDown,this).preventDefault(e),this._map.fire("boxzoomstart")},_onMouseMove:function(e){var t=this._startLayerPoint,n=this._box,r=this._map.mouseEventToLayerPoint(e),s=r.subtract(t),o=new i.Point(Math.min(r.x,t.x),Math.min(r.y,t.y));i.DomUtil.setPosition(n,o),n.style.width=Math.max(0,Math.abs(s.x)-4)+"px",n.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._pane.removeChild(this._box),this._container.style.cursor="",i.DomUtil.enableTextSelection(),i.DomEvent.off(t,"mousemove",this._onMouseMove).off(t,"mouseup",this._onMouseUp).off(t,"keydown",this._onKeyDown)},_onMouseUp:function(e){this._finish();var t=this._map,n=t.mouseEventToLayerPoint(e);if(this._startLayerPoint.equals(n))return;var r=new i.LatLngBounds(t.layerPointToLatLng(this._startLayerPoint),t.layerPointToLatLng(n));t.fitBounds(r),t.fire("boxzoomend",{boxZoomBounds:r})},_onKeyDown:function(e){e.keyCode===27&& -this._finish()}}),i.Map.addInitHook("addHandler","boxZoom",i.Map.BoxZoom),i.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),i.Map.Keyboard=i.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(e){this._map=e,this._setPanOffset(e.options.keyboardPanOffset),this._setZoomOffset(e.options.keyboardZoomOffset)},addHooks:function(){var e=this._map._container;e.tabIndex===-1&&(e.tabIndex="0"),i.DomEvent.on(e,"focus",this._onFocus,this).on(e,"blur",this._onBlur,this).on(e,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var e=this._map._container;i.DomEvent.off(e,"focus",this._onFocus,this).off(e,"blur",this._onBlur,this).off(e,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(this._focused)return;var n= -t.body,r=t.documentElement,i=n.scrollTop||r.scrollTop,s=n.scrollTop||r.scrollLeft;this._map._container.focus(),e.scrollTo(s,i)},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(e){var t=this._panKeys={},n=this.keyCodes,r,i;for(r=0,i=n.left.length;rLeaflet'},initialize:function(e){i.setOptions(this,e),this._attributions={}},onAdd:function(e){return this._container=i.DomUtil.create("div" -,"leaflet-control-attribution"),i.DomEvent.disableClickPropagation(this._container),e.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(e){e.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){if(!e)return;return this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this},removeAttribution:function(e){if(!e)return;return this._attributions[e]&&(this._attributions[e]--,this._update()),this},_update:function(){if(!this._map)return;var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(" | ")},_onLayerAdd:function(e){e.layer.getAttribution&&this.addAttribution(e.layer.getAttribution())},_onLayerRemove:function(e){e.layer. -getAttribution&&this.removeAttribution(e.layer.getAttribution())}}),i.Map.mergeOptions({attributionControl:!0}),i.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new i.Control.Attribution).addTo(this))}),i.control.attribution=function(e){return new i.Control.Attribution(e)},i.Control.Scale=i.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(e){this._map=e;var t="leaflet-control-scale",n=i.DomUtil.create("div",t),r=this.options;return this._addScales(r,t,n),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=i.DomUtil.create("div",t+"-line",n)),e.imperial&&(this._iScale=i.DomUtil.create("div",t+"-line",n))},_update:function(){var e=this._map.getBounds(),t=e.getCenter().lat,n=6378137*Math.PI*Math.cos(t*Math -.PI/180),r=n*(e.getNorthEast().lng-e.getSouthWest().lng)/180,i=this._map.getSize(),s=this.options,o=0;i.x>0&&(o=r*(s.maxWidth/i.x)),this._updateScales(s,o)},_updateScales:function(e,t){e.metric&&t&&this._updateMetric(t),e.imperial&&t&&this._updateImperial(t)},_updateMetric:function(e){var t=this._getRoundNum(e);this._mScale.style.width=this._getScaleWidth(t/e)+"px",this._mScale.innerHTML=t<1e3?t+" m":t/1e3+" km"},_updateImperial:function(e){var t=e*3.2808399,n=this._iScale,r,i,s;t>5280?(r=t/5280,i=this._getRoundNum(r),n.style.width=this._getScaleWidth(i/r)+"px",n.innerHTML=i+" mi"):(s=this._getRoundNum(t),n.style.width=this._getScaleWidth(s/t)+"px",n.innerHTML=s+" ft")},_getScaleWidth:function(e){return Math.round(this.options.maxWidth*e)-10},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),i.control.scale=function(e){return new i.Control.Scale(e)},i.Control.Layers=i.Control.extend({options:{collapsed:!0,position -:"topright",autoZIndex:!0},initialize:function(e,t,n){i.setOptions(this,n),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var r in e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){return this._initLayout(),this._update(),e.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(e){e.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._update(),this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._update(),this},removeLayer:function(e){var t=i.stamp(e);return delete this._layers[t],this._update(),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=i.DomUtil.create("div",e);t.setAttribute("aria-haspopup",!0),i.Browser.touch?i.DomEvent.on(t,"click",i.DomEvent.stopPropagation):(i.DomEvent.disableClickPropagation(t),i.DomEvent.on(t,"mousewheel",i.DomEvent.stopPropagation -));var n=this._form=i.DomUtil.create("form",e+"-list");if(this.options.collapsed){i.DomEvent.on(t,"mouseover",this._expand,this).on(t,"mouseout",this._collapse,this);var r=this._layersLink=i.DomUtil.create("a",e+"-toggle",t);r.href="#",r.title="Layers",i.Browser.touch?i.DomEvent.on(r,"click",i.DomEvent.stopPropagation).on(r,"click",i.DomEvent.preventDefault).on(r,"click",this._expand,this):i.DomEvent.on(r,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=i.DomUtil.create("div",e+"-base",n),this._separator=i.DomUtil.create("div",e+"-separator",n),this._overlaysList=i.DomUtil.create("div",e+"-overlays",n),t.appendChild(n)},_addLayer:function(e,t,n){var r=i.stamp(e);this._layers[r]={layer:e,name:t,overlay:n},this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex))},_update:function(){if(!this._container)return;this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var e=!1,t=!1,n,r;for( -n in this._layers)r=this._layers[n],this._addItem(r),t=t||r.overlay,e=e||!r.overlay;this._separator.style.display=t&&e?"":"none"},_onLayerChange:function(e){var t=i.stamp(e.layer);this._layers[t]&&!this._handlingClick&&this._update()},_createRadioElement:function(e,n){var r='this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),s=this._getCenterOffset(e)._divideBy(1-1/r),o=this._getCenterLayerPoint()._add(s);return n.animate!==!0&&!this.getSize().contains(s)?!1:(this.fire("movestart").fire("zoomstart"),this._animateZoom(e,t,o,r),!0)},_animateZoom -:function(e,t,n,r,s){this._animatingZoom=!0,i.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=e,this._animateToZoom=t,i.Draggable&&(i.Draggable._disabled=!0),this.fire("zoomanim",{center:e,zoom:t,origin:n,scale:r,delta:s})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,i.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),i.Draggable&&(i.Draggable._disabled=!1)}}:{}),i.TileLayer.include({_animateZoom:function(e){var t=!1;this._animating||(this._animating=!0,t=!0),t&&this._prepareBgBuffer();var n=this._bgBuffer;t&&(clearTimeout(this._clearBgBufferTimer),i.Util.falseFn(n.offsetWidth));var r=i.DomUtil.TRANSFORM,s=e.delta?i.DomUtil.getTranslateString(e.delta):n.style[r];n.style[r]=s+" "+i.DomUtil.getScaleString(e.scale,e.origin)},_endZoomAnim:function(){var e=this._tileContainer,t=this._bgBuffer;e.style.visibility="",e.style.zIndex=2,t.style.zIndex=1,i.Util.falseFn(t.offsetWidth),this._animating=!1 -},_clearBgBuffer:function(){var e=this._map;e&&!e._animatingZoom&&!e.touchZoom._zooming&&(this._bgBuffer.innerHTML="",this._bgBuffer.style[i.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var e=this._tileContainer,t=this._bgBuffer,n=this._getLoadedTilesPercentage(t),r=this._getLoadedTilesPercentage(e);if(t&&n>.5&&r<.5){e.style.visibility="hidden",this._stopLoadingImages(e);return}t.style.visibility="hidden",t.style[i.DomUtil.TRANSFORM]="",this._tileContainer=t,t=this._bgBuffer=e,this._stopLoadingImages(t)},_getLoadedTilesPercentage:function(e){var t=e.getElementsByTagName("img"),n,r,i=0;for(n=0,r=t.length;ndoes query sequentially. This however means that it transfers more data and is generally heavier to compute, while showing less actual data. If you have a time filter, it will attempt to show to most recent points in your search, up to your defined limit"};var a={queries:{mode:"all",ids:[]},size:1e3,spyable:!0,tooltip:"_id",field:null};n.defaults(t.panel,a),t.requireContext=i,t.init=function(){t.$on("refresh" -,function(){t.get_data()}),t.get_data()},t.get_data=function(e,i){t.require(["./leaflet/plugins"],function(){t.panel.error=!1;if(o.indices.length===0)return;if(n.isUndefined(t.panel.field)){t.panel.error="Please select a field that contains geo point in [lon,lat] format";return}var a=n.uniq(n.pluck(u.getByType("time"),"field"));a.length>1?t.panel.error="Time field must be consistent amongst time filters":a.length===0?a=null:a=a[0];var f=n.isUndefined(e)?0:e;t.panel.queries.ids=s.idsByMode(t.panel.queries);var l=t.ejs.BoolQuery();n.each(t.panel.queries.ids,function(e){l=l.should(s.getEjsObj(e))});var c=t.ejs.Request().indices(o.indices[f]).query(t.ejs.FilteredQuery(l,u.getBoolFilter(u.ids).must(t.ejs.ExistsFilter(t.panel.field)))).fields([t.panel.field,t.panel.tooltip]).size(t.panel.size);n.isNull(a)||(c=c.sort(a,"desc")),t.populate_modal(c);var h=c.doSearch();h.then(function(e){t.panelMeta.loading=!1,f===0&&(t.hits=0,t.data=[],i=t.query_id=(new Date).getTime());if(!n.isUndefined(e.error -)){t.panel.error=t.parse_error(e.error);return}if(t.query_id!==i)return;t.data=t.data.slice(0,t.panel.size).concat(n.map(e.hits.hits,function(e){return{coordinates:new r.LatLng(e.fields[t.panel.field][1],e.fields[t.panel.field][0]),tooltip:e.fields[t.panel.tooltip]}})),t.$emit("draw"),t.data.length'),e.$on("draw",function(){u()}),e.$on("render",function(){n.isUndefined(s)||(s.invalidateSize(),s.getPanes())});var s,o}}})}); \ No newline at end of file +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + +!function(a,b,c){var d=a.L,e={};e.version="0.6-dev","object"==typeof module&&"object"==typeof module.exports?module.exports=e:"function"==typeof define&&define.amd&&define("panels/bettermap/leaflet/leaflet-src",e),e.noConflict=function(){return a.L=d,this},a.L=e,e.Util={extend:function(a){var b,c,d,e,f=Array.prototype.slice.call(arguments,1);for(c=0,d=f.length;d>c;c++){e=f[c]||{};for(b in e)e.hasOwnProperty(b)&&(a[b]=e[b])}return a},bind:function(a,b){var c=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return a.apply(b,c||arguments)}},stamp:function(){var a=0,b="_leaflet_id";return function(c){return c[b]=c[b]||++a,c[b]}}(),invokeEach:function(a,b,c){var d,e;if("object"==typeof a){e=Array.prototype.slice.call(arguments,3);for(d in a)b.apply(c,[d,a[d]].concat(e));return!0}return!1},limitExecByInterval:function(a,b,c){var d,e;return function f(){var g=arguments;return d?(e=!0,void 0):(d=!0,setTimeout(function(){d=!1,e&&(f.apply(c,g),e=!1)},b),a.apply(c,g),void 0)}},falseFn:function(){return!1},formatNum:function(a,b){var c=Math.pow(10,b||5);return Math.round(a*c)/c},trim:function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")},splitWords:function(a){return e.Util.trim(a).split(/\s+/)},setOptions:function(a,b){return a.options=e.extend({},a.options,b),a.options},getParamString:function(a,b,c){var d=[];for(var e in a)d.push(encodeURIComponent(c?e.toUpperCase():e)+"="+encodeURIComponent(a[e]));return(b&&-1!==b.indexOf("?")?"&":"?")+d.join("&")},template:function(a,b){return a.replace(/\{ *([\w_]+) *\}/g,function(a,d){var e=b[d];if(e===c)throw new Error("No value provided for variable "+a);return"function"==typeof e&&(e=e(b)),e})},isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function b(b){var c,d,e=["webkit","moz","o","ms"];for(c=0;ca;a++)d._initHooks[a].call(this)}},b},e.Class.include=function(a){e.extend(this.prototype,a)},e.Class.mergeOptions=function(a){e.extend(this.prototype.options,a)},e.Class.addInitHook=function(a){var b=Array.prototype.slice.call(arguments,1),c="function"==typeof a?a:function(){this[a].apply(this,b)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c)};var f="_leaflet_events";e.Mixin={},e.Mixin.Events={addEventListener:function(a,b,c){if(e.Util.invokeEach(a,this.addEventListener,this,b,c))return this;var d,g,h,i,j,k,l,m=this[f]=this[f]||{},n=c&&e.stamp(c);for(a=e.Util.splitWords(a),d=0,g=a.length;g>d;d++)h={action:b,context:c||this},i=a[d],c?(j=i+"_idx",k=j+"_len",l=m[j]=m[j]||{},l[n]||(l[n]=[],m[k]=(m[k]||0)+1),l[n].push(h)):(m[i]=m[i]||[],m[i].push(h));return this},hasEventListeners:function(a){var b=this[f];return!!b&&(a in b&&b[a].length>0||a+"_idx"in b&&b[a+"_idx_len"]>0)},removeEventListener:function(a,b,c){if(!this[f])return this;if(!a)return this.clearAllEventListeners();if(e.Util.invokeEach(a,this.removeEventListener,this,b,c))return this;var d,g,h,i,j,k,l,m,n,o=this[f],p=c&&e.stamp(c);for(a=e.Util.splitWords(a),d=0,g=a.length;g>d;d++)if(h=a[d],k=h+"_idx",l=k+"_len",m=o[k],b){if(i=c&&m?m[p]:o[h]){for(j=i.length-1;j>=0;j--)i[j].action!==b||c&&i[j].context!==c||(n=i.splice(j,1),n[0].action=e.Util.falseFn);c&&m&&0===i.length&&(delete m[p],o[l]--)}}else delete o[h],delete o[k];return this},clearAllEventListeners:function(){return delete this[f],this},fireEvent:function(a,b){if(!this.hasEventListeners(a))return this;var c,d,g,h,i,j=e.Util.extend({},b,{type:a,target:this}),k=this[f];if(k[a])for(c=k[a].slice(),d=0,g=c.length;g>d;d++)c[d].action.call(c[d].context||this,j);h=k[a+"_idx"];for(i in h)if(c=h[i].slice())for(d=0,g=c.length;g>d;d++)c[d].action.call(c[d].context||this,j);return this},addOneTimeEventListener:function(a,b,c){if(e.Util.invokeEach(a,this.addOneTimeEventListener,this,b,c))return this;var d=e.bind(function(){this.removeEventListener(a,b,c).removeEventListener(a,d,c)},this);return this.addEventListener(a,b,c).addEventListener(a,d,c)}},e.Mixin.Events.on=e.Mixin.Events.addEventListener,e.Mixin.Events.off=e.Mixin.Events.removeEventListener,e.Mixin.Events.once=e.Mixin.Events.addOneTimeEventListener,e.Mixin.Events.fire=e.Mixin.Events.fireEvent,function(){var d=!!a.ActiveXObject,f=d&&!a.XMLHttpRequest,g=d&&!b.querySelector,h=d&&!b.addEventListener,i=navigator.userAgent.toLowerCase(),j=-1!==i.indexOf("webkit"),k=-1!==i.indexOf("chrome"),l=-1!==i.indexOf("phantom"),m=-1!==i.indexOf("android"),n=-1!==i.search("android [23]"),o=typeof orientation!=c+"",p=a.navigator&&a.navigator.msPointerEnabled&&a.navigator.msMaxTouchPoints,q="devicePixelRatio"in a&&a.devicePixelRatio>1||"matchMedia"in a&&a.matchMedia("(min-resolution:144dpi)")&&a.matchMedia("(min-resolution:144dpi)").matches,r=b.documentElement,s=d&&"transition"in r.style,t="WebKitCSSMatrix"in a&&"m11"in new a.WebKitCSSMatrix,u="MozPerspective"in r.style,v="OTransition"in r.style,w=!a.L_DISABLE_3D&&(s||t||u||v)&&!l,x=!a.L_NO_TOUCH&&!l&&function(){var a="ontouchstart";if(p||a in r)return!0;var c=b.createElement("div"),d=!1;return c.setAttribute?(c.setAttribute(a,"return;"),"function"==typeof c[a]&&(d=!0),c.removeAttribute(a),c=null,d):!1}();e.Browser={ie:d,ie6:f,ie7:g,ielt9:h,webkit:j,android:m,android23:n,chrome:k,ie3d:s,webkit3d:t,gecko3d:u,opera3d:v,any3d:w,mobile:o,mobileWebkit:o&&j,mobileWebkit3d:o&&t,mobileOpera:o&&a.opera,touch:x,msTouch:p,retina:q}}(),e.Point=function(a,b,c){this.x=c?Math.round(a):a,this.y=c?Math.round(b):b},e.Point.prototype={clone:function(){return new e.Point(this.x,this.y)},add:function(a){return this.clone()._add(e.point(a))},_add:function(a){return this.x+=a.x,this.y+=a.y,this},subtract:function(a){return this.clone()._subtract(e.point(a))},_subtract:function(a){return this.x-=a.x,this.y-=a.y,this},divideBy:function(a){return this.clone()._divideBy(a)},_divideBy:function(a){return this.x/=a,this.y/=a,this},multiplyBy:function(a){return this.clone()._multiplyBy(a)},_multiplyBy:function(a){return this.x*=a,this.y*=a,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(a){a=e.point(a);var b=a.x-this.x,c=a.y-this.y;return Math.sqrt(b*b+c*c)},equals:function(a){return a=e.point(a),a.x===this.x&&a.y===this.y},contains:function(a){return a=e.point(a),Math.abs(a.x)<=Math.abs(this.x)&&Math.abs(a.y)<=Math.abs(this.y)},toString:function(){return"Point("+e.Util.formatNum(this.x)+", "+e.Util.formatNum(this.y)+")"}},e.point=function(a,b,d){return a instanceof e.Point?a:e.Util.isArray(a)?new e.Point(a[0],a[1]):a===c||null===a?a:new e.Point(a,b,d)},e.Bounds=function(a,b){if(a)for(var c=b?[a,b]:a,d=0,e=c.length;e>d;d++)this.extend(c[d])},e.Bounds.prototype={extend:function(a){return a=e.point(a),this.min||this.max?(this.min.x=Math.min(a.x,this.min.x),this.max.x=Math.max(a.x,this.max.x),this.min.y=Math.min(a.y,this.min.y),this.max.y=Math.max(a.y,this.max.y)):(this.min=a.clone(),this.max=a.clone()),this},getCenter:function(a){return new e.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,a)},getBottomLeft:function(){return new e.Point(this.min.x,this.max.y)},getTopRight:function(){return new e.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(a){var b,c;return a="number"==typeof a[0]||a instanceof e.Point?e.point(a):e.bounds(a),a instanceof e.Bounds?(b=a.min,c=a.max):b=c=a,b.x>=this.min.x&&c.x<=this.max.x&&b.y>=this.min.y&&c.y<=this.max.y},intersects:function(a){a=e.bounds(a);var b=this.min,c=this.max,d=a.min,f=a.max,g=f.x>=b.x&&d.x<=c.x,h=f.y>=b.y&&d.y<=c.y;return g&&h},isValid:function(){return!(!this.min||!this.max)}},e.bounds=function(a,b){return!a||a instanceof e.Bounds?a:new e.Bounds(a,b)},e.Transformation=function(a,b,c,d){this._a=a,this._b=b,this._c=c,this._d=d},e.Transformation.prototype={transform:function(a,b){return this._transform(a.clone(),b)},_transform:function(a,b){return b=b||1,a.x=b*(this._a*a.x+this._b),a.y=b*(this._c*a.y+this._d),a},untransform:function(a,b){return b=b||1,new e.Point((a.x/b-this._b)/this._a,(a.y/b-this._d)/this._c)}},e.DomUtil={get:function(a){return"string"==typeof a?b.getElementById(a):a},getStyle:function(a,c){var d=a.style[c];if(!d&&a.currentStyle&&(d=a.currentStyle[c]),(!d||"auto"===d)&&b.defaultView){var e=b.defaultView.getComputedStyle(a,null);d=e?e[c]:null}return"auto"===d?null:d},getViewportOffset:function(a){var c,d=0,f=0,g=a,h=b.body,i=b.documentElement,j=e.Browser.ie7;do{if(d+=g.offsetTop||0,f+=g.offsetLeft||0,d+=parseInt(e.DomUtil.getStyle(g,"borderTopWidth"),10)||0,f+=parseInt(e.DomUtil.getStyle(g,"borderLeftWidth"),10)||0,c=e.DomUtil.getStyle(g,"position"),g.offsetParent===h&&"absolute"===c)break;if("fixed"===c){d+=h.scrollTop||i.scrollTop||0,f+=h.scrollLeft||i.scrollLeft||0;break}if("relative"===c&&!g.offsetLeft){var k=e.DomUtil.getStyle(g,"width"),l=e.DomUtil.getStyle(g,"max-width"),m=g.getBoundingClientRect();("none"!==k||"none"!==l)&&(f+=m.left+g.clientLeft),d+=m.top+(h.scrollTop||i.scrollTop||0);break}g=g.offsetParent}while(g);g=a;do{if(g===h)break;d-=g.scrollTop||0,f-=g.scrollLeft||0,e.DomUtil.documentIsLtr()||!e.Browser.webkit&&!j||(f+=g.scrollWidth-g.clientWidth,j&&"hidden"!==e.DomUtil.getStyle(g,"overflow-y")&&"hidden"!==e.DomUtil.getStyle(g,"overflow")&&(f+=17)),g=g.parentNode}while(g);return new e.Point(f,d)},documentIsLtr:function(){return e.DomUtil._docIsLtrCached||(e.DomUtil._docIsLtrCached=!0,e.DomUtil._docIsLtr="ltr"===e.DomUtil.getStyle(b.body,"direction")),e.DomUtil._docIsLtr},create:function(a,c,d){var e=b.createElement(a);return e.className=c,d&&d.appendChild(e),e},disableTextSelection:function(){b.selection&&b.selection.empty&&b.selection.empty(),this._onselectstart||(this._onselectstart=b.onselectstart||null,b.onselectstart=e.Util.falseFn)},enableTextSelection:function(){b.onselectstart===e.Util.falseFn&&(b.onselectstart=this._onselectstart,this._onselectstart=null)},hasClass:function(a,b){return a.className.length>0&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(a.className)},addClass:function(a,b){e.DomUtil.hasClass(a,b)||(a.className+=(a.className?" ":"")+b)},removeClass:function(a,b){a.className=e.Util.trim((" "+a.className+" ").replace(" "+b+" "," "))},setOpacity:function(a,b){if("opacity"in a.style)a.style.opacity=b;else if("filter"in a.style){var c=!1,d="DXImageTransform.Microsoft.Alpha";try{c=a.filters.item(d)}catch(e){if(1===b)return}b=Math.round(100*b),c?(c.Enabled=100!==b,c.Opacity=b):a.style.filter+=" progid:"+d+"(opacity="+b+")"}},testProp:function(a){for(var c=b.documentElement.style,d=0;dc||c===b?b:a),new e.LatLng(this.lat,c)}},e.latLng=function(a,b){return a instanceof e.LatLng?a:e.Util.isArray(a)?new e.LatLng(a[0],a[1]):a===c||null===a?a:"object"==typeof a&&"lat"in a?new e.LatLng(a.lat,"lng"in a?a.lng:a.lon):new e.LatLng(a,b)},e.LatLngBounds=function(a,b){if(a)for(var c=b?[a,b]:a,d=0,e=c.length;e>d;d++)this.extend(c[d])},e.LatLngBounds.prototype={extend:function(a){return a?(a="number"==typeof a[0]||"string"==typeof a[0]||a instanceof e.LatLng?e.latLng(a):e.latLngBounds(a),a instanceof e.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(a.lat,this._southWest.lat),this._southWest.lng=Math.min(a.lng,this._southWest.lng),this._northEast.lat=Math.max(a.lat,this._northEast.lat),this._northEast.lng=Math.max(a.lng,this._northEast.lng)):(this._southWest=new e.LatLng(a.lat,a.lng),this._northEast=new e.LatLng(a.lat,a.lng)):a instanceof e.LatLngBounds&&(this.extend(a._southWest),this.extend(a._northEast)),this):this},pad:function(a){var b=this._southWest,c=this._northEast,d=Math.abs(b.lat-c.lat)*a,f=Math.abs(b.lng-c.lng)*a;return new e.LatLngBounds(new e.LatLng(b.lat-d,b.lng-f),new e.LatLng(c.lat+d,c.lng+f))},getCenter:function(){return new e.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new e.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new e.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(a){a="number"==typeof a[0]||a instanceof e.LatLng?e.latLng(a):e.latLngBounds(a);var b,c,d=this._southWest,f=this._northEast;return a instanceof e.LatLngBounds?(b=a.getSouthWest(),c=a.getNorthEast()):b=c=a,b.lat>=d.lat&&c.lat<=f.lat&&b.lng>=d.lng&&c.lng<=f.lng},intersects:function(a){a=e.latLngBounds(a);var b=this._southWest,c=this._northEast,d=a.getSouthWest(),f=a.getNorthEast(),g=f.lat>=b.lat&&d.lat<=c.lat,h=f.lng>=b.lng&&d.lng<=c.lng;return g&&h},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(a){return a?(a=e.latLngBounds(a),this._southWest.equals(a.getSouthWest())&&this._northEast.equals(a.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},e.latLngBounds=function(a,b){return!a||a instanceof e.LatLngBounds?a:new e.LatLngBounds(a,b)},e.Projection={},e.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(a){var b=e.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=Math.max(Math.min(c,a.lat),-c),f=a.lng*b,g=d*b;return g=Math.log(Math.tan(Math.PI/4+g/2)),new e.Point(f,g)},unproject:function(a){var b=e.LatLng.RAD_TO_DEG,c=a.x*b,d=(2*Math.atan(Math.exp(a.y))-Math.PI/2)*b;return new e.LatLng(d,c)}},e.Projection.LonLat={project:function(a){return new e.Point(a.lng,a.lat)},unproject:function(a){return new e.LatLng(a.y,a.x)}},e.CRS={latLngToPoint:function(a,b){var c=this.projection.project(a),d=this.scale(b);return this.transformation._transform(c,d)},pointToLatLng:function(a,b){var c=this.scale(b),d=this.transformation.untransform(a,c);return this.projection.unproject(d)},project:function(a){return this.projection.project(a)},scale:function(a){return 256*Math.pow(2,a)}},e.CRS.Simple=e.extend({},e.CRS,{projection:e.Projection.LonLat,transformation:new e.Transformation(1,0,-1,0),scale:function(a){return Math.pow(2,a)}}),e.CRS.EPSG3857=e.extend({},e.CRS,{code:"EPSG:3857",projection:e.Projection.SphericalMercator,transformation:new e.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(a){var b=this.projection.project(a),c=6378137;return b.multiplyBy(c)}}),e.CRS.EPSG900913=e.extend({},e.CRS.EPSG3857,{code:"EPSG:900913"}),e.CRS.EPSG4326=e.extend({},e.CRS,{code:"EPSG:4326",projection:e.Projection.LonLat,transformation:new e.Transformation(1/360,.5,-1/360,.5)}),e.Map=e.Class.extend({includes:e.Mixin.Events,options:{crs:e.CRS.EPSG3857,fadeAnimation:e.DomUtil.TRANSITION&&!e.Browser.android23,trackResize:!0,markerZoomAnimation:e.DomUtil.TRANSITION&&e.Browser.any3d},initialize:function(a,b){b=e.setOptions(this,b),this._initContainer(a),this._initLayout(),this._initEvents(),b.maxBounds&&this.setMaxBounds(b.maxBounds),b.center&&b.zoom!==c&&this.setView(e.latLng(b.center),b.zoom,{reset:!0}),this._initLayers(b.layers),this._handlers=[],this.callInitHooks()},setView:function(a,b){return this._resetView(e.latLng(a),this._limitZoom(b)),this},setZoom:function(a,b){return this.setView(this.getCenter(),a,{zoom:b})},zoomIn:function(a,b){return this.setZoom(this._zoom+(a||1),b)},zoomOut:function(a,b){return this.setZoom(this._zoom-(a||1),b)},setZoomAround:function(a,b,c){var d=this.getZoomScale(b),f=this.getSize().divideBy(2),g=a instanceof e.Point?a:this.latLngToContainerPoint(a),h=g.subtract(f).multiplyBy(1-1/d),i=this.containerPointToLatLng(f.add(h));return this.setView(i,b,{zoom:c})},fitBounds:function(a,b){b=b||{},a=a.getBounds?a.getBounds():e.latLngBounds(a);var c=e.point(b.paddingTopLeft||b.padding||[0,0]),d=e.point(b.paddingBottomRight||b.padding||[0,0]),f=this.getBoundsZoom(a,!1,c.add(d)),g=d.subtract(c).divideBy(2),h=this.project(a.getSouthWest(),f),i=this.project(a.getNorthEast(),f),j=this.unproject(h.add(i).divideBy(2).add(g),f);return this.setView(j,f,b)},fitWorld:function(a){return this.fitBounds([[-90,-180],[90,180]],a)},panTo:function(a,b){return this.setView(a,this._zoom,{pan:b})},panBy:function(a){return this.fire("movestart"),this._rawPanBy(e.point(a)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(a){if(a=e.latLngBounds(a),this.options.maxBounds=a,!a)return this._boundsMinZoom=null,this.off("moveend",this._panInsideMaxBounds,this),this;var b=this.getBoundsZoom(a,!0);return this._boundsMinZoom=b,this._loaded&&(this._zoomg.x&&(h=Math.floor(g.x-d.x)),c.y>f.y&&(i=Math.floor(f.y-c.y)),c.x=f);return k&&b?null:b?f:f-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new e.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var a=this._getTopLeftPoint();return new e.Bounds(a,a.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(a){var b=this.options.crs;return b.scale(a)/b.scale(this._zoom)},getScaleZoom:function(a){return this._zoom+Math.log(a)/Math.LN2},project:function(a,b){return b=b===c?this._zoom:b,this.options.crs.latLngToPoint(e.latLng(a),b)},unproject:function(a,b){return b=b===c?this._zoom:b,this.options.crs.pointToLatLng(e.point(a),b)},layerPointToLatLng:function(a){var b=e.point(a).add(this.getPixelOrigin());return this.unproject(b)},latLngToLayerPoint:function(a){var b=this.project(e.latLng(a))._round();return b._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(a){return e.point(a).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(a){return e.point(a).add(this._getMapPanePos())},containerPointToLatLng:function(a){var b=this.containerPointToLayerPoint(e.point(a));return this.layerPointToLatLng(b)},latLngToContainerPoint:function(a){return this.layerPointToContainerPoint(this.latLngToLayerPoint(e.latLng(a)))},mouseEventToContainerPoint:function(a){return e.DomEvent.getMousePosition(a,this._container)},mouseEventToLayerPoint:function(a){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(a))},mouseEventToLatLng:function(a){return this.layerPointToLatLng(this.mouseEventToLayerPoint(a))},_initContainer:function(a){var b=this._container=e.DomUtil.get(a);if(!b)throw new Error("Map container not found.");if(b._leaflet)throw new Error("Map container is already initialized.");b._leaflet=!0},_initLayout:function(){var a=this._container;e.DomUtil.addClass(a,"leaflet-container"+(e.Browser.touch?" leaflet-touch":"")+(e.Browser.retina?" leaflet-retina":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var b=e.DomUtil.getStyle(a,"position");"absolute"!==b&&"relative"!==b&&"fixed"!==b&&(a.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var a=this._panes={};this._mapPane=a.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=a.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),a.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),a.shadowPane=this._createPane("leaflet-shadow-pane"),a.overlayPane=this._createPane("leaflet-overlay-pane"),a.markerPane=this._createPane("leaflet-marker-pane"),a.popupPane=this._createPane("leaflet-popup-pane");var b=" leaflet-zoom-hide";this.options.markerZoomAnimation||(e.DomUtil.addClass(a.markerPane,b),e.DomUtil.addClass(a.shadowPane,b),e.DomUtil.addClass(a.popupPane,b))},_createPane:function(a,b){return e.DomUtil.create("div",a,b||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_initLayers:function(a){a=a?e.Util.isArray(a)?a:[a]:[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0;var b,c;for(b=0,c=a.length;c>b;b++)this.addLayer(a[b])},_resetView:function(a,b,c,d){var f=this._zoom!==b;d||(this.fire("movestart"),f&&this.fire("zoomstart")),this._zoom=b,this._initialCenter=a,this._initialTopLeftPoint=this._getNewTopLeftPoint(a),c?this._initialTopLeftPoint._add(this._getMapPanePos()):e.DomUtil.setPosition(this._mapPane,new e.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var g=!this._loaded;this._loaded=!0,g&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!c}),this.fire("move"),(f||d)&&this.fire("zoomend"),this.fire("moveend",{hard:!c})},_rawPanBy:function(a){e.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(a))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var a,b=1/0,d=-1/0,e=this._getZoomSpan();for(a in this._zoomBoundLayers){var f=this._zoomBoundLayers[a];isNaN(f.options.minZoom)||(b=Math.min(b,f.options.minZoom)),isNaN(f.options.maxZoom)||(d=Math.max(d,f.options.maxZoom))}a===c?this._layersMaxZoom=this._layersMinZoom=c:(this._layersMaxZoom=d,this._layersMinZoom=b),e!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(b){if(e.DomEvent){b=b||"on",e.DomEvent[b](this._container,"click",this._onMouseClick,this);var c,d,f=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(c=0,d=f.length;d>c;c++)e.DomEvent[b](this._container,f[c],this._fireMouseEvent,this);this.options.trackResize&&e.DomEvent[b](a,"resize",this._onResize,this)}},_onResize:function(){e.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=e.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(a){!this._loaded||this.dragging&&this.dragging.moved()||(this.fire("preclick"),this._fireMouseEvent(a))},_fireMouseEvent:function(a){if(this._loaded){var b=a.type;if(b="mouseenter"===b?"mouseover":"mouseleave"===b?"mouseout":b,this.hasEventListeners(b)){"contextmenu"===b&&e.DomEvent.preventDefault(a);var c=this.mouseEventToContainerPoint(a),d=this.containerPointToLayerPoint(c),f=this.layerPointToLatLng(d);this.fire(b,{latlng:f,layerPoint:d,containerPoint:c,originalEvent:a})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var a=0,b=this._handlers.length;b>a;a++)this._handlers[a].disable()},whenReady:function(a,b){return this._loaded?a.call(b||this,this):this.on("load",a,b),this},_layerAdd:function(a){a.onAdd(this),this.fire("layeradd",{layer:a})},_getMapPanePos:function(){return e.DomUtil.getPosition(this._mapPane)},_moved:function(){var a=this._getMapPanePos();return a&&!a.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(a,b){var c=this.getSize()._divideBy(2);return this.project(a,b)._subtract(c)._round()},_latLngToNewLayerPoint:function(a,b,c){var d=this._getNewTopLeftPoint(c,b).add(this._getMapPanePos());return this.project(a,b)._subtract(d)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(a){return this.latLngToLayerPoint(a).subtract(this._getCenterLayerPoint())},_limitZoom:function(a){var b=this.getMinZoom(),c=this.getMaxZoom();return Math.max(b,Math.min(c,a))}}),e.map=function(a,b){return new e.Map(a,b)},e.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(a){var b=e.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=Math.max(Math.min(c,a.lat),-c),f=this.R_MAJOR,g=this.R_MINOR,h=a.lng*b*f,i=d*b,j=g/f,k=Math.sqrt(1-j*j),l=k*Math.sin(i);l=Math.pow((1-l)/(1+l),.5*k);var m=Math.tan(.5*(.5*Math.PI-i))/l;return i=-g*Math.log(m),new e.Point(h,i)},unproject:function(a){for(var b,c=e.LatLng.RAD_TO_DEG,d=this.R_MAJOR,f=this.R_MINOR,g=a.x*c/d,h=f/d,i=Math.sqrt(1-h*h),j=Math.exp(-a.y/f),k=Math.PI/2-2*Math.atan(j),l=15,m=1e-7,n=l,o=.1;Math.abs(o)>m&&--n>0;)b=i*Math.sin(k),o=Math.PI/2-2*Math.atan(j*Math.pow((1-b)/(1+b),.5*i))-k,k+=o;return new e.LatLng(k*c,g)}},e.CRS.EPSG3395=e.extend({},e.CRS,{code:"EPSG:3395",projection:e.Projection.Mercator,transformation:function(){var a=e.Projection.Mercator,b=a.R_MAJOR,c=a.R_MINOR;return new e.Transformation(.5/(Math.PI*b),.5,-.5/(Math.PI*c),.5)}()}),e.TileLayer=e.Class.extend({includes:e.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:e.Browser.mobile,updateWhenIdle:e.Browser.mobile},initialize:function(a,b){b=e.setOptions(this,b),b.detectRetina&&e.Browser.retina&&b.maxZoom>0&&(b.tileSize=Math.floor(b.tileSize/2),b.zoomOffset++,b.minZoom>0&&b.minZoom--,this.options.maxZoom--),b.bounds&&(b.bounds=e.latLngBounds(b.bounds)),this._url=a;var c=this.options.subdomains;"string"==typeof c&&(this.options.subdomains=c.split(""))},onAdd:function(a){this._map=a,this._animated=a.options.zoomAnimation&&e.Browser.any3d,this._initContainer(),this._createTileProto(),a.on({viewreset:this._reset,moveend:this._update},this),this._animated&&a.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=e.Util.limitExecByInterval(this._update,150,this),a.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){this._container.parentNode.removeChild(this._container),a.off({viewreset:this._reset,moveend:this._update},this),this._animated&&a.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||a.off("move",this._limitedUpdate,this),this._container=null,this._map=null +},bringToFront:function(){var a=this._map._panes.tilePane;return this._container&&(a.appendChild(this._container),this._setAutoZIndex(a,Math.max)),this},bringToBack:function(){var a=this._map._panes.tilePane;return this._container&&(a.insertBefore(this._container,a.firstChild),this._setAutoZIndex(a,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(a){return this.options.opacity=a,this._map&&this._updateOpacity(),this},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},setUrl:function(a,b){return this._url=a,b||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==c&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(a,b){var c,d,e,f=a.children,g=-b(1/0,-1/0);for(d=0,e=f.length;e>d;d++)f[d]!==this._container&&(c=parseInt(f[d].style.zIndex,10),isNaN(c)||(g=b(g,c)));this.options.zIndex=this._container.style.zIndex=(isFinite(g)?g:0)+b(1,-1)},_updateOpacity:function(){var a,b=this._tiles;if(e.Browser.ielt9)for(a in b)e.DomUtil.setOpacity(b[a],this.options.opacity);else e.DomUtil.setOpacity(this._container,this.options.opacity);if(e.Browser.webkit)for(a in b)b[a].style.webkitTransform+=" translate(0,0)"},_initContainer:function(){var a=this._map._panes.tilePane;if(!this._container){if(this._container=e.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var b="leaflet-tile-container leaflet-zoom-animated";this._bgBuffer=e.DomUtil.create("div",b,this._container),this._bgBuffer.style.zIndex=1,this._tileContainer=e.DomUtil.create("div",b,this._container),this._tileContainer.style.zIndex=2}else this._tileContainer=this._container;a.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(a){for(var b in this._tiles)this.fire("tileunload",{tile:this._tiles[b]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&a&&a.hard&&this._clearBgBuffer(),this._initContainer()},_update:function(){if(this._map){var a=this._map.getPixelBounds(),b=this._map.getZoom(),c=this.options.tileSize;if(!(b>this.options.maxZoom||bd;d++)this._addTile(g[d],j);this._tileContainer.appendChild(j)}},_tileShouldBeLoaded:function(a){if(a.x+":"+a.y in this._tiles)return!1;var b=this.options;if(!b.continuousWorld){var c=this._getWrapTileNum();if(b.noWrap&&(a.x<0||a.x>=c)||a.y<0||a.y>=c)return!1}if(b.bounds){var d=b.tileSize,e=a.multiplyBy(d),f=e.add([d,d]),g=this._map.unproject(e),h=this._map.unproject(f);if(b.continuousWorld||b.noWrap||(g=g.wrap(),h=h.wrap()),!b.bounds.intersects([g,h]))return!1}return!0},_removeOtherTiles:function(a){var b,c,d,e;for(e in this._tiles)b=e.split(":"),c=parseInt(b[0],10),d=parseInt(b[1],10),(ca.max.x||da.max.y)&&this._removeTile(e)},_removeTile:function(a){var b=this._tiles[a];this.fire("tileunload",{tile:b,url:b.src}),this.options.reuseTiles?(e.DomUtil.removeClass(b,"leaflet-tile-loaded"),this._unusedTiles.push(b)):b.parentNode===this._tileContainer&&this._tileContainer.removeChild(b),e.Browser.android||(b.onload=null,b.src=e.Util.emptyImageUrl),delete this._tiles[a]},_addTile:function(a,b){var c=this._getTilePos(a),d=this._getTile();e.DomUtil.setPosition(d,c,e.Browser.chrome||e.Browser.android23),this._tiles[a.x+":"+a.y]=d,this._loadTile(d,a),d.parentNode!==this._tileContainer&&b.appendChild(d)},_getZoomForUrl:function(){var a=this.options,b=this._map.getZoom();return a.zoomReverse&&(b=a.maxZoom-b),b+a.zoomOffset},_getTilePos:function(a){var b=this._map.getPixelOrigin(),c=this.options.tileSize;return a.multiplyBy(c).subtract(b)},getTileUrl:function(a){return e.Util.template(this._url,e.extend({s:this._getSubdomain(a),z:a.z,x:a.x,y:a.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(a){var b=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(a.x=(a.x%b+b)%b),this.options.tms&&(a.y=b-a.y-1),a.z=this._getZoomForUrl()},_getSubdomain:function(a){var b=Math.abs(a.x+a.y)%this.options.subdomains.length;return this.options.subdomains[b]},_createTileProto:function(){var a=this._tileImg=e.DomUtil.create("img","leaflet-tile");a.style.width=a.style.height=this.options.tileSize+"px",a.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var a=this._unusedTiles.pop();return this._resetTile(a),a}return this._createTile()},_resetTile:function(){},_createTile:function(){var a=this._tileImg.cloneNode(!1);return a.onselectstart=a.onmousemove=e.Util.falseFn,e.Browser.ielt9&&this.options.opacity!==c&&e.DomUtil.setOpacity(a,this.options.opacity),a},_loadTile:function(a,b){a._layer=this,a.onload=this._tileOnLoad,a.onerror=this._tileOnError,this._adjustTilePoint(b),a.src=this.getTileUrl(b)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(e.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var a=this._layer;this.src!==e.Util.emptyImageUrl&&(e.DomUtil.addClass(this,"leaflet-tile-loaded"),a.fire("tileload",{tile:this,url:this.src})),a._tileLoaded()},_tileOnError:function(){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});var b=a.options.errorTileUrl;b&&(this.src=b),a._tileLoaded()}}),e.tileLayer=function(a,b){return new e.TileLayer(a,b)},e.TileLayer.WMS=e.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a;var c=e.extend({},this.defaultWmsParams),d=b.tileSize||this.options.tileSize;c.width=c.height=b.detectRetina&&e.Browser.retina?2*d:d;for(var f in b)this.options.hasOwnProperty(f)||(c[f]=b[f]);this.wmsParams=c,e.setOptions(this,b)},onAdd:function(a){var b=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[b]=a.options.crs.code,e.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a,b){var c=this._map,d=c.options.crs,f=this.options.tileSize,g=a.multiplyBy(f),h=g.add([f,f]),i=d.project(c.unproject(g,b)),j=d.project(c.unproject(h,b)),k=[i.x,j.y,j.x,i.y].join(","),l=e.Util.template(this._url,{s:this._getSubdomain(a)});return l+e.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+k},setParams:function(a,b){return e.extend(this.wmsParams,a),b||this.redraw(),this}}),e.tileLayer.wms=function(a,b){return new e.TileLayer.WMS(a,b)},e.TileLayer.Canvas=e.TileLayer.extend({options:{async:!1},initialize:function(a){e.setOptions(this,a)},redraw:function(){for(var a in this._tiles)this._redrawTile(this._tiles[a]);return this},_redrawTile:function(a){this.drawTile(a,a._tilePoint,this._map._zoom)},_createTileProto:function(){var a=this._canvasProto=e.DomUtil.create("canvas","leaflet-tile");a.width=a.height=this.options.tileSize},_createTile:function(){var a=this._canvasProto.cloneNode(!1);return a.onselectstart=a.onmousemove=e.Util.falseFn,a},_loadTile:function(a,b){a._layer=this,a._tilePoint=b,this._redrawTile(a),this.options.async||this.tileDrawn(a)},drawTile:function(){},tileDrawn:function(a){this._tileOnLoad.call(a)}}),e.tileLayer.canvas=function(a){return new e.TileLayer.Canvas(a)},e.ImageOverlay=e.Class.extend({includes:e.Mixin.Events,options:{opacity:1},initialize:function(a,b,c){this._url=a,this._bounds=e.latLngBounds(b),e.setOptions(this,c)},onAdd:function(a){this._map=a,this._image||this._initImage(),a._panes.overlayPane.appendChild(this._image),a.on("viewreset",this._reset,this),a.options.zoomAnimation&&e.Browser.any3d&&a.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(a){a.getPanes().overlayPane.removeChild(this._image),a.off("viewreset",this._reset,this),a.options.zoomAnimation&&a.off("zoomanim",this._animateZoom,this)},addTo:function(a){return a.addLayer(this),this},setOpacity:function(a){return this.options.opacity=a,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var a=this._map._panes.overlayPane;return this._image&&a.insertBefore(this._image,a.firstChild),this},_initImage:function(){this._image=e.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&e.Browser.any3d?e.DomUtil.addClass(this._image,"leaflet-zoom-animated"):e.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),e.extend(this._image,{galleryimg:"no",onselectstart:e.Util.falseFn,onmousemove:e.Util.falseFn,onload:e.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(a){var b=this._map,c=this._image,d=b.getZoomScale(a.zoom),f=this._bounds.getNorthWest(),g=this._bounds.getSouthEast(),h=b._latLngToNewLayerPoint(f,a.zoom,a.center),i=b._latLngToNewLayerPoint(g,a.zoom,a.center)._subtract(h),j=h._add(i._multiplyBy(.5*(1-1/d)));c.style[e.DomUtil.TRANSFORM]=e.DomUtil.getTranslateString(j)+" scale("+d+") "},_reset:function(){var a=this._image,b=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),c=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(b);e.DomUtil.setPosition(a,b),a.style.width=c.x+"px",a.style.height=c.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){e.DomUtil.setOpacity(this._image,this.options.opacity)}}),e.imageOverlay=function(a,b,c){return new e.ImageOverlay(a,b,c)},e.Icon=e.Class.extend({options:{className:""},initialize:function(a){e.setOptions(this,a)},createIcon:function(a){return this._createIcon("icon",a)},createShadow:function(a){return this._createIcon("shadow",a)},_createIcon:function(a,b){var c=this._getIconUrl(a);if(!c){if("icon"===a)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var d;return d=b&&"IMG"===b.tagName?this._createImg(c,b):this._createImg(c),this._setIconStyles(d,a),d},_setIconStyles:function(a,b){var c,d=this.options,f=e.point(d[b+"Size"]);c="shadow"===b?e.point(d.shadowAnchor||d.iconAnchor):e.point(d.iconAnchor),!c&&f&&(c=f.divideBy(2,!0)),a.className="leaflet-marker-"+b+" "+d.className,c&&(a.style.marginLeft=-c.x+"px",a.style.marginTop=-c.y+"px"),f&&(a.style.width=f.x+"px",a.style.height=f.y+"px")},_createImg:function(a,c){return e.Browser.ie6?(c||(c=b.createElement("div")),c.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+a+'")'):(c||(c=b.createElement("img")),c.src=a),c},_getIconUrl:function(a){return e.Browser.retina&&this.options[a+"RetinaUrl"]?this.options[a+"RetinaUrl"]:this.options[a+"Url"]}}),e.icon=function(a){return new e.Icon(a)},e.Icon.Default=e.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(a){var b=a+"Url";if(this.options[b])return this.options[b];e.Browser.retina&&"icon"===a&&(a+="-2x");var c=e.Icon.Default.imagePath;if(!c)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return c+"/marker-"+a+".png"}}),e.Icon.Default.imagePath=function(){var a,c,d,e,f,g=b.getElementsByTagName("script"),h=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(a=0,c=g.length;c>a;a++)if(d=g[a].src,e=d.match(h))return f=d.split(h)[0],(f?f+"/":"")+"images"}(),e.Marker=e.Class.extend({includes:e.Mixin.Events,options:{icon:new e.Icon.Default,title:"",clickable:!0,draggable:!1,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(a,b){e.setOptions(this,b),this._latlng=e.latLng(a)},onAdd:function(a){this._map=a,a.on("viewreset",this.update,this),this._initIcon(),this.update(),a.options.zoomAnimation&&a.options.markerZoomAnimation&&a.on("zoomanim",this._animateZoom,this)},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){this.dragging&&this.dragging.disable(),this._removeIcon(),this.fire("remove"),a.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(a){return this._latlng=e.latLng(a),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(a){return this.options.zIndexOffset=a,this.update(),this},setIcon:function(a){return this.options.icon=a,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var a=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(a)}return this},_initIcon:function(){var a=this.options,b=this._map,c=b.options.zoomAnimation&&b.options.markerZoomAnimation,d=c?"leaflet-zoom-animated":"leaflet-zoom-hide",f=!1,g=this._icon;if(g){var h=a.icon.createIcon(this._icon);h!==this._icon&&(this._removeIcon(),this._icon=h,g=!1)}else this._icon=a.icon.createIcon();a.title&&(this._icon.title=a.title),this._initInteraction(),f=a.opacity<1,e.DomUtil.addClass(this._icon,d),a.riseOnHover&&e.DomEvent.on(this._icon,"mouseover",this._bringToFront,this).on(this._icon,"mouseout",this._resetZIndex,this);var i=this._shadow;i?this._shadow=a.icon.createShadow(this._shadow):(this._shadow=a.icon.createShadow(),this._shadow&&(e.DomUtil.addClass(this._shadow,d),f=a.opacity<1)),f&&this._updateOpacity();var j=this._map._panes;g||j.markerPane.appendChild(this._icon),this._shadow&&!i&&j.shadowPane.appendChild(this._shadow)},_removeIcon:function(){var a=this._map._panes;this.options.riseOnHover&&e.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),a.markerPane.removeChild(this._icon),this._shadow&&a.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_setPos:function(a){e.DomUtil.setPosition(this._icon,a),this._shadow&&e.DomUtil.setPosition(this._shadow,a),this._zIndex=a.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(a){this._icon.style.zIndex=this._zIndex+a},_animateZoom:function(a){var b=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);this._setPos(b)},_initInteraction:function(){if(this.options.clickable){var a=this._icon,b=["dblclick","mousedown","mouseover","mouseout","contextmenu"];e.DomUtil.addClass(a,"leaflet-clickable"),e.DomEvent.on(a,"click",this._onMouseClick,this);for(var c=0;cf?(b.height=f+"px",e.DomUtil.addClass(a,g)):e.DomUtil.removeClass(a,g),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var a=this._map.latLngToLayerPoint(this._latlng),b=this._animated,c=e.point(this.options.offset);b&&e.DomUtil.setPosition(this._container,a),this._containerBottom=-c.y-(b?0:a.y),this._containerLeft=-Math.round(this._containerWidth/2)+c.x+(b?0:a.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(a){var b=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);e.DomUtil.setPosition(this._container,b)},_adjustPan:function(){if(this.options.autoPan){var a=this._map,b=this._container.offsetHeight,c=this._containerWidth,d=new e.Point(this._containerLeft,-b-this._containerBottom);this._animated&&d._add(e.DomUtil.getPosition(this._container));var f=a.layerPointToContainerPoint(d),g=e.point(this.options.autoPanPadding),h=a.getSize(),i=0,j=0;f.x+c>h.x&&(i=f.x+c-h.x+g.x),f.x-i<0&&(i=f.x-g.x),f.y+b>h.y&&(j=f.y+b-h.y+g.y),f.y-j<0&&(j=f.y-g.y),(i||j)&&a.fire("autopanstart").panBy([i,j])}},_onCloseButtonClick:function(a){this._close(),e.DomEvent.stop(a)}}),e.popup=function(a,b){return new e.Popup(a,b)},e.Map.include({openPopup:function(a,b,c){if(this.closePopup(),!(a instanceof e.Popup)){var d=a;a=new e.Popup(c).setLatLng(b).setContent(d)}return this._popup=a,this.addLayer(a)},closePopup:function(a){return a&&a!==this._popup||(a=this._popup,this._popup=null),a&&this.removeLayer(a),this}}),e.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(a,b){var c=e.point(this.options.icon.options.popupAnchor||[0,0]);return c=c.add(e.Popup.prototype.options.offset),b&&b.offset&&(c=c.add(b.offset)),b=e.extend({offset:c},b),this._popup||this.on("click",this.openPopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),a instanceof e.Popup?(e.setOptions(a,b),this._popup=a):this._popup=new e.Popup(b,this).setContent(a),this},setPopupContent:function(a){return this._popup&&this._popup.setContent(a),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(a){this._popup.setLatLng(a.latlng)}}),e.LayerGroup=e.Class.extend({initialize:function(a){this._layers={};var b,c;if(a)for(b=0,c=a.length;c>b;b++)this.addLayer(a[b])},addLayer:function(a){var b=this.getLayerId(a);return this._layers[b]=a,this._map&&this._map.addLayer(a),this},removeLayer:function(a){var b=a in this._layers?a:this.getLayerId(a);return this._map&&this._layers[b]&&this._map.removeLayer(this._layers[b]),delete this._layers[b],this},hasLayer:function(a){return a?a in this._layers||this.getLayerId(a)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(a){var b,c,d=Array.prototype.slice.call(arguments,1);for(b in this._layers)c=this._layers[b],c[a]&&c[a].apply(c,d);return this},onAdd:function(a){this._map=a,this.eachLayer(a.addLayer,a)},onRemove:function(a){this.eachLayer(a.removeLayer,a),this._map=null},addTo:function(a){return a.addLayer(this),this},eachLayer:function(a,b){for(var c in this._layers)a.call(b,this._layers[c]);return this},getLayer:function(a){return this._layers[a]},getLayers:function(){var a=[];for(var b in this._layers)a.push(this._layers[b]);return a},setZIndex:function(a){return this.invoke("setZIndex",a)},getLayerId:function(a){return e.stamp(a)}}),e.layerGroup=function(a){return new e.LayerGroup(a)},e.FeatureGroup=e.LayerGroup.extend({includes:e.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu"},addLayer:function(a){return this.hasLayer(a)?this:(a.on(e.FeatureGroup.EVENTS,this._propagateEvent,this),e.LayerGroup.prototype.addLayer.call(this,a),this._popupContent&&a.bindPopup&&a.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:a}))},removeLayer:function(a){return a in this._layers&&(a=this._layers[a]),a.off(e.FeatureGroup.EVENTS,this._propagateEvent,this),e.LayerGroup.prototype.removeLayer.call(this,a),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:a})},bindPopup:function(a,b){return this._popupContent=a,this._popupOptions=b,this.invoke("bindPopup",a,b)},setStyle:function(a){return this.invoke("setStyle",a)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var a=new e.LatLngBounds;return this.eachLayer(function(b){a.extend(b instanceof e.Marker?b.getLatLng():b.getBounds())}),a},_propagateEvent:function(a){a.layer||(a.layer=a.target),a.target=this,this.fire(a.type,a)}}),e.featureGroup=function(a){return new e.FeatureGroup(a)},e.Path=e.Class.extend({includes:[e.Mixin.Events],statics:{CLIP_PADDING:e.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(a.innerWidth,a.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(a){e.setOptions(this,a)},onAdd:function(a){this._map=a,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),a.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){a._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,e.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),a.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(a){return e.setOptions(this,a),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),e.Map.include({_updatePathViewport:function(){var a=e.Path.CLIP_PADDING,b=this.getSize(),c=e.DomUtil.getPosition(this._mapPane),d=c.multiplyBy(-1)._subtract(b.multiplyBy(a)._round()),f=d.add(b.multiplyBy(1+2*a)._round());this._pathViewport=new e.Bounds(d,f)}}),e.Path.SVG_NS="http://www.w3.org/2000/svg",e.Browser.svg=!(!b.createElementNS||!b.createElementNS(e.Path.SVG_NS,"svg").createSVGRect),e.Path=e.Path.extend({statics:{SVG:e.Browser.svg},bringToFront:function(){var a=this._map._pathRoot,b=this._container;return b&&a.lastChild!==b&&a.appendChild(b),this},bringToBack:function(){var a=this._map._pathRoot,b=this._container,c=a.firstChild;return b&&c!==b&&a.insertBefore(b,c),this},getPathString:function(){},_createElement:function(a){return b.createElementNS(e.Path.SVG_NS,a)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var a=this.getPathString();a||(a="M0 0"),this._path.setAttribute("d",a)},_initEvents:function(){if(this.options.clickable){(e.Browser.svg||!e.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),e.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var a=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],b=0;b';var c=a.firstChild;return c.style.behavior="url(#default#VML)",c&&"object"==typeof c.adj}catch(d){return!1}}(),e.Path=e.Browser.svg||!e.Browser.vml?e.Path:e.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return b.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(a){return b.createElement("')}}catch(a){return function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var a=this._container=this._createElement("shape");e.DomUtil.addClass(a,"leaflet-vml-shape"),this.options.clickable&&e.DomUtil.addClass(a,"leaflet-clickable"),a.coordsize="1 1",this._path=this._createElement("path"),a.appendChild(this._path),this._map._pathRoot.appendChild(a)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var a=this._stroke,b=this._fill,c=this.options,d=this._container;d.stroked=c.stroke,d.filled=c.fill,c.stroke?(a||(a=this._stroke=this._createElement("stroke"),a.endcap="round",d.appendChild(a)),a.weight=c.weight+"px",a.color=c.color,a.opacity=c.opacity,a.dashStyle=c.dashArray?c.dashArray instanceof Array?c.dashArray.join(" "):c.dashArray.replace(/( *, *)/g," "):""):a&&(d.removeChild(a),this._stroke=null),c.fill?(b||(b=this._fill=this._createElement("fill"),d.appendChild(b)),b.color=c.fillColor||c.color,b.opacity=c.fillOpacity):b&&(d.removeChild(b),this._fill=null) +},_updatePath:function(){var a=this._container.style;a.display="none",this._path.v=this.getPathString()+" ",a.display=""}}),e.Map.include(e.Browser.svg||!e.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var a=this._pathRoot=b.createElement("div");a.className="leaflet-vml-container",this._panes.overlayPane.appendChild(a),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),e.Browser.canvas=function(){return!!b.createElement("canvas").getContext}(),e.Path=e.Path.SVG&&!a.L_PREFER_CANVAS||!e.Browser.canvas?e.Path:e.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(a){return e.setOptions(this,a),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(a){a.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!e.Path._updateRequest&&(e.Path._updateRequest=e.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){e.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var a=this.options;a.stroke&&(this._ctx.lineWidth=a.weight,this._ctx.strokeStyle=a.color),a.fill&&(this._ctx.fillStyle=a.fillColor||a.color)},_drawPath:function(){var a,b,c,d,f,g;for(this._ctx.beginPath(),a=0,c=this._parts.length;c>a;a++){for(b=0,d=this._parts[a].length;d>b;b++)f=this._parts[a][b],g=(0===b?"move":"line")+"To",this._ctx[g](f.x,f.y);this instanceof e.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var a=this._ctx,b=this.options;this._drawPath(),a.save(),this._updateStyle(),b.fill&&(a.globalAlpha=b.fillOpacity,a.fill()),b.stroke&&(a.globalAlpha=b.opacity,a.stroke()),a.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(a){this._containsPoint(a.layerPoint)&&this.fire("click",a)},_onMouseMove:function(a){this._map&&!this._map._animatingZoom&&(this._containsPoint(a.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",a)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",a)))}}),e.Map.include(e.Path.SVG&&!a.L_PREFER_CANVAS||!e.Browser.canvas?{}:{_initPathRoot:function(){var a,c=this._pathRoot;c||(c=this._pathRoot=b.createElement("canvas"),c.style.position="absolute",a=this._canvasCtx=c.getContext("2d"),a.lineCap="round",a.lineJoin="round",this._panes.overlayPane.appendChild(c),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var a=this._pathViewport,b=a.min,c=a.max.subtract(b),d=this._pathRoot;e.DomUtil.setPosition(d,b),d.width=c.x,d.height=c.y,d.getContext("2d").translate(-b.x,-b.y)}}}),e.LineUtil={simplify:function(a,b){if(!b||!a.length)return a.slice();var c=b*b;return a=this._reducePoints(a,c),a=this._simplifyDP(a,c)},pointToSegmentDistance:function(a,b,c){return Math.sqrt(this._sqClosestPointOnSegment(a,b,c,!0))},closestPointOnSegment:function(a,b,c){return this._sqClosestPointOnSegment(a,b,c)},_simplifyDP:function(a,b){var d=a.length,e=typeof Uint8Array!=c+""?Uint8Array:Array,f=new e(d);f[0]=f[d-1]=1,this._simplifyDPStep(a,f,b,0,d-1);var g,h=[];for(g=0;d>g;g++)f[g]&&h.push(a[g]);return h},_simplifyDPStep:function(a,b,c,d,e){var f,g,h,i=0;for(g=d+1;e-1>=g;g++)h=this._sqClosestPointOnSegment(a[g],a[d],a[e],!0),h>i&&(f=g,i=h);i>c&&(b[f]=1,this._simplifyDPStep(a,b,c,d,f),this._simplifyDPStep(a,b,c,f,e))},_reducePoints:function(a,b){for(var c=[a[0]],d=1,e=0,f=a.length;f>d;d++)this._sqDist(a[d],a[e])>b&&(c.push(a[d]),e=d);return f-1>e&&c.push(a[f-1]),c},clipSegment:function(a,b,c,d){var e,f,g,h=d?this._lastCode:this._getBitCode(a,c),i=this._getBitCode(b,c);for(this._lastCode=i;;){if(!(h|i))return[a,b];if(h&i)return!1;e=h||i,f=this._getEdgeIntersection(a,b,e,c),g=this._getBitCode(f,c),e===h?(a=f,h=g):(b=f,i=g)}},_getEdgeIntersection:function(a,b,c,d){var f=b.x-a.x,g=b.y-a.y,h=d.min,i=d.max;return 8&c?new e.Point(a.x+f*(i.y-a.y)/g,i.y):4&c?new e.Point(a.x+f*(h.y-a.y)/g,h.y):2&c?new e.Point(i.x,a.y+g*(i.x-a.x)/f):1&c?new e.Point(h.x,a.y+g*(h.x-a.x)/f):void 0},_getBitCode:function(a,b){var c=0;return a.xb.max.x&&(c|=2),a.yb.max.y&&(c|=8),c},_sqDist:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d},_sqClosestPointOnSegment:function(a,b,c,d){var f,g=b.x,h=b.y,i=c.x-g,j=c.y-h,k=i*i+j*j;return k>0&&(f=((a.x-g)*i+(a.y-h)*j)/k,f>1?(g=c.x,h=c.y):f>0&&(g+=i*f,h+=j*f)),i=a.x-g,j=a.y-h,d?i*i+j*j:new e.Point(g,h)}},e.Polyline=e.Path.extend({initialize:function(a,b){e.Path.prototype.initialize.call(this,b),this._latlngs=this._convertLatLngs(a)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var a=0,b=this._latlngs.length;b>a;a++)this._originalPoints[a]=this._map.latLngToLayerPoint(this._latlngs[a])},getPathString:function(){for(var a=0,b=this._parts.length,c="";b>a;a++)c+=this._getPathPartStr(this._parts[a]);return c},getLatLngs:function(){return this._latlngs},setLatLngs:function(a){return this._latlngs=this._convertLatLngs(a),this.redraw()},addLatLng:function(a){return this._latlngs.push(e.latLng(a)),this.redraw()},spliceLatLngs:function(){var a=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),a},closestLayerPoint:function(a){for(var b,c,d=1/0,f=this._parts,g=null,h=0,i=f.length;i>h;h++)for(var j=f[h],k=1,l=j.length;l>k;k++){b=j[k-1],c=j[k];var m=e.LineUtil._sqClosestPointOnSegment(a,b,c,!0);d>m&&(d=m,g=e.LineUtil._sqClosestPointOnSegment(a,b,c))}return g&&(g.distance=Math.sqrt(d)),g},getBounds:function(){return new e.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(a,b){var c,d,f=b?a:[];for(c=0,d=a.length;d>c;c++){if(e.Util.isArray(a[c])&&"number"!=typeof a[c][0])return;f[c]=e.latLng(a[c])}return f},_initEvents:function(){e.Path.prototype._initEvents.call(this)},_getPathPartStr:function(a){for(var b,c=e.Path.VML,d=0,f=a.length,g="";f>d;d++)b=a[d],c&&b._round(),g+=(d?"L":"M")+b.x+" "+b.y;return g},_clipPoints:function(){var a,b,c,d=this._originalPoints,f=d.length;if(this.options.noClip)return this._parts=[d],void 0;this._parts=[];var g=this._parts,h=this._map._pathViewport,i=e.LineUtil;for(a=0,b=0;f-1>a;a++)c=i.clipSegment(d[a],d[a+1],h,a),c&&(g[b]=g[b]||[],g[b].push(c[0]),(c[1]!==d[a+1]||a===f-2)&&(g[b].push(c[1]),b++))},_simplifyPoints:function(){for(var a=this._parts,b=e.LineUtil,c=0,d=a.length;d>c;c++)a[c]=b.simplify(a[c],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),e.Path.prototype._updatePath.call(this))}}),e.polyline=function(a,b){return new e.Polyline(a,b)},e.PolyUtil={},e.PolyUtil.clipPolygon=function(a,b){var c,d,f,g,h,i,j,k,l,m=[1,4,2,8],n=e.LineUtil;for(d=0,j=a.length;j>d;d++)a[d]._code=n._getBitCode(a[d],b);for(g=0;4>g;g++){for(k=m[g],c=[],d=0,j=a.length,f=j-1;j>d;f=d++)h=a[d],i=a[f],h._code&k?i._code&k||(l=n._getEdgeIntersection(i,h,k,b),l._code=n._getBitCode(l,b),c.push(l)):(i._code&k&&(l=n._getEdgeIntersection(i,h,k,b),l._code=n._getBitCode(l,b),c.push(l)),c.push(h));a=c}return a},e.Polygon=e.Polyline.extend({options:{fill:!0},initialize:function(a,b){var c,d,f;if(e.Polyline.prototype.initialize.call(this,a,b),a&&e.Util.isArray(a[0])&&"number"!=typeof a[0][0])for(this._latlngs=this._convertLatLngs(a[0]),this._holes=a.slice(1),c=0,d=this._holes.length;d>c;c++)f=this._holes[c]=this._convertLatLngs(this._holes[c]),f[0].equals(f[f.length-1])&&f.pop();a=this._latlngs,a.length>=2&&a[0].equals(a[a.length-1])&&a.pop()},projectLatlngs:function(){if(e.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var a,b,c,d;for(a=0,c=this._holes.length;c>a;a++)for(this._holePoints[a]=[],b=0,d=this._holes[a].length;d>b;b++)this._holePoints[a][b]=this._map.latLngToLayerPoint(this._holes[a][b])}},_clipPoints:function(){var a=this._originalPoints,b=[];if(this._parts=[a].concat(this._holePoints),!this.options.noClip){for(var c=0,d=this._parts.length;d>c;c++){var f=e.PolyUtil.clipPolygon(this._parts[c],this._map._pathViewport);f.length&&b.push(f)}this._parts=b}},_getPathPartStr:function(a){var b=e.Polyline.prototype._getPathPartStr.call(this,a);return b+(e.Browser.svg?"z":"x")}}),e.polygon=function(a,b){return new e.Polygon(a,b)},function(){function a(a){return e.FeatureGroup.extend({initialize:function(a,b){this._layers={},this._options=b,this.setLatLngs(a)},setLatLngs:function(b){var c=0,d=b.length;for(this.eachLayer(function(a){d>c?a.setLatLngs(b[c++]):this.removeLayer(a)},this);d>c;)this.addLayer(new a(b[c++],this._options));return this}})}e.MultiPolyline=a(e.Polyline),e.MultiPolygon=a(e.Polygon),e.multiPolyline=function(a,b){return new e.MultiPolyline(a,b)},e.multiPolygon=function(a,b){return new e.MultiPolygon(a,b)}}(),e.Rectangle=e.Polygon.extend({initialize:function(a,b){e.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(a),b)},setBounds:function(a){this.setLatLngs(this._boundsToLatLngs(a))},_boundsToLatLngs:function(a){return a=e.latLngBounds(a),[a.getSouthWest(),a.getNorthWest(),a.getNorthEast(),a.getSouthEast()]}}),e.rectangle=function(a,b){return new e.Rectangle(a,b)},e.Circle=e.Path.extend({initialize:function(a,b,c){e.Path.prototype.initialize.call(this,c),this._latlng=e.latLng(a),this._mRadius=b},options:{fill:!0},setLatLng:function(a){return this._latlng=e.latLng(a),this.redraw()},setRadius:function(a){return this._mRadius=a,this.redraw()},projectLatlngs:function(){var a=this._getLngRadius(),b=this._latlng,c=this._map.latLngToLayerPoint([b.lat,b.lng-a]);this._point=this._map.latLngToLayerPoint(b),this._radius=Math.max(this._point.x-c.x,1)},getBounds:function(){var a=this._getLngRadius(),b=360*(this._mRadius/40075017),c=this._latlng;return new e.LatLngBounds([c.lat-b,c.lng-a],[c.lat+b,c.lng+a])},getLatLng:function(){return this._latlng},getPathString:function(){var a=this._point,b=this._radius;return this._checkIfEmpty()?"":e.Browser.svg?"M"+a.x+","+(a.y-b)+"A"+b+","+b+",0,1,1,"+(a.x-.1)+","+(a.y-b)+" z":(a._round(),b=Math.round(b),"AL "+a.x+","+a.y+" "+b+","+b+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(e.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var a=this._map._pathViewport,b=this._radius,c=this._point;return c.x-b>a.max.x||c.y-b>a.max.y||c.x+bc;c++)for(j=this._parts[c],d=0,h=j.length,f=h-1;h>d;f=d++)if((b||0!==d)&&(i=e.LineUtil.pointToSegmentDistance(a,j[f],j[d]),k>=i))return!0;return!1}}:{}),e.Polygon.include(e.Path.CANVAS?{_containsPoint:function(a){var b,c,d,f,g,h,i,j,k=!1;if(e.Polyline.prototype._containsPoint.call(this,a,!0))return!0;for(f=0,i=this._parts.length;i>f;f++)for(b=this._parts[f],g=0,j=b.length,h=j-1;j>g;h=g++)c=b[g],d=b[h],c.y>a.y!=d.y>a.y&&a.x<(d.x-c.x)*(a.y-c.y)/(d.y-c.y)+c.x&&(k=!k);return k}}:{}),e.Circle.include(e.Path.CANVAS?{_drawPath:function(){var a=this._point;this._ctx.beginPath(),this._ctx.arc(a.x,a.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(a){var b=this._point,c=this.options.stroke?this.options.weight/2:0;return a.distanceTo(b)<=this._radius+c}}:{}),e.CircleMarker.include(e.Path.CANVAS?{_updateStyle:function(){e.Path.prototype._updateStyle.call(this)}}:{}),e.GeoJSON=e.FeatureGroup.extend({initialize:function(a,b){e.setOptions(this,b),this._layers={},a&&this.addData(a)},addData:function(a){var b,c,d=e.Util.isArray(a)?a:a.features;if(d){for(b=0,c=d.length;c>b;b++)(d[b].geometries||d[b].geometry||d[b].features)&&this.addData(d[b]);return this}var f=this.options;if(!f.filter||f.filter(a)){var g=e.GeoJSON.geometryToLayer(a,f.pointToLayer,f.coordsToLatLng);return g.feature=a,g.defaultOptions=g.options,this.resetStyle(g),f.onEachFeature&&f.onEachFeature(a,g),this.addLayer(g)}},resetStyle:function(a){var b=this.options.style;b&&(e.Util.extend(a.options,a.defaultOptions),this._setLayerStyle(a,b))},setStyle:function(a){this.eachLayer(function(b){this._setLayerStyle(b,a)},this)},_setLayerStyle:function(a,b){"function"==typeof b&&(b=b(a.feature)),a.setStyle&&a.setStyle(b)}}),e.extend(e.GeoJSON,{geometryToLayer:function(a,b,c){var d,f,g,h,i,j="Feature"===a.type?a.geometry:a,k=j.coordinates,l=[];switch(c=c||this.coordsToLatLng,j.type){case"Point":return d=c(k),b?b(a,d):new e.Marker(d);case"MultiPoint":for(g=0,h=k.length;h>g;g++)d=c(k[g]),i=b?b(a,d):new e.Marker(d),l.push(i);return new e.FeatureGroup(l);case"LineString":return f=this.coordsToLatLngs(k,0,c),new e.Polyline(f);case"Polygon":return f=this.coordsToLatLngs(k,1,c),new e.Polygon(f);case"MultiLineString":return f=this.coordsToLatLngs(k,1,c),new e.MultiPolyline(f);case"MultiPolygon":return f=this.coordsToLatLngs(k,2,c),new e.MultiPolygon(f);case"GeometryCollection":for(g=0,h=j.geometries.length;h>g;g++)i=this.geometryToLayer({geometry:j.geometries[g],type:"Feature",properties:a.properties},b),l.push(i);return new e.FeatureGroup(l);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(a){return new e.LatLng(a[1],a[0])},coordsToLatLngs:function(a,b,c){var d,e,f,g=[];for(e=0,f=a.length;f>e;e++)d=b?this.coordsToLatLngs(a[e],b-1,c):(c||this.coordsToLatLng)(a[e]),g.push(d);return g},latLngToCoords:function(a){return[a.lng,a.lat]},latLngsToCoords:function(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(e.GeoJSON.latLngToCoords(a[c]));return b}}),e.Marker.include({toGeoJSON:function(){return{type:"Point",coordinates:e.GeoJSON.latLngToCoords(this.getLatLng())}}}),e.Polyline.include({toGeoJSON:function(){return{type:"LineString",coordinates:e.GeoJSON.latLngsToCoords(this.getLatLngs())}}}),e.Polygon.include({toGeoJSON:function(){var a,b,c,d=[e.GeoJSON.latLngsToCoords(this.getLatLngs())];if(d[0].push(d[0][0]),this._holes)for(a=0,b=this._holes.length;b>a;a++)c=e.GeoJSON.latLngsToCoords(this._holes[a]),c.push(c[0]),d.push(c);return{type:"Polygon",coordinates:d}}}),function(){function a(a,b){a.include({toGeoJSON:function(){var a=[];return this.eachLayer(function(b){a.push(b.toGeoJSON().coordinates)}),{type:b,coordinates:a}}})}a(e.MultiPolyline,"MultiLineString"),a(e.MultiPolygon,"MultiPolygon")}(),e.LayerGroup.include({toGeoJSON:function(){var a=[];return this.eachLayer(function(b){b.toGeoJSON&&a.push(b.toGeoJSON())}),{type:"GeometryCollection",geometries:a}}}),e.geoJson=function(a,b){return new e.GeoJSON(a,b)},e.DomEvent={addListener:function(a,b,c,d){var f,g,h,i=e.stamp(c),j="_leaflet_"+b+i;return a[j]?this:(f=function(b){return c.call(d||a,b||e.DomEvent._getEvent())},e.Browser.msTouch&&0===b.indexOf("touch")?this.addMsTouchListener(a,b,f,i):(e.Browser.touch&&"dblclick"===b&&this.addDoubleTapListener&&this.addDoubleTapListener(a,f,i),"addEventListener"in a?"mousewheel"===b?(a.addEventListener("DOMMouseScroll",f,!1),a.addEventListener(b,f,!1)):"mouseenter"===b||"mouseleave"===b?(g=f,h="mouseenter"===b?"mouseover":"mouseout",f=function(b){return e.DomEvent._checkMouse(a,b)?g(b):void 0},a.addEventListener(h,f,!1)):"click"===b&&e.Browser.android?(g=f,f=function(a){return e.DomEvent._filterClick(a,g)},a.addEventListener(b,f,!1)):a.addEventListener(b,f,!1):"attachEvent"in a&&a.attachEvent("on"+b,f),a[j]=f,this))},removeListener:function(a,b,c){var d=e.stamp(c),f="_leaflet_"+b+d,g=a[f];return g?(e.Browser.msTouch&&0===b.indexOf("touch")?this.removeMsTouchListener(a,b,d):e.Browser.touch&&"dblclick"===b&&this.removeDoubleTapListener?this.removeDoubleTapListener(a,d):"removeEventListener"in a?"mousewheel"===b?(a.removeEventListener("DOMMouseScroll",g,!1),a.removeEventListener(b,g,!1)):"mouseenter"===b||"mouseleave"===b?a.removeEventListener("mouseenter"===b?"mouseover":"mouseout",g,!1):a.removeEventListener(b,g,!1):"detachEvent"in a&&a.detachEvent("on"+b,g),a[f]=null,this):this},stopPropagation:function(a){return a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,this},disableClickPropagation:function(a){for(var b=e.DomEvent.stopPropagation,c=e.Draggable.START.length-1;c>=0;c--)e.DomEvent.addListener(a,e.Draggable.START[c],b);return e.DomEvent.addListener(a,"click",b).addListener(a,"dblclick",b)},preventDefault:function(a){return a.preventDefault?a.preventDefault():a.returnValue=!1,this},stop:function(a){return e.DomEvent.preventDefault(a).stopPropagation(a)},getMousePosition:function(a,c){var d=b.body,f=b.documentElement,g=a.pageX?a.pageX:a.clientX+d.scrollLeft+f.scrollLeft,h=a.pageY?a.pageY:a.clientY+d.scrollTop+f.scrollTop,i=new e.Point(g,h);return c?i._subtract(e.DomUtil.getViewportOffset(c)):i},getWheelDelta:function(a){var b=0;return a.wheelDelta&&(b=a.wheelDelta/120),a.detail&&(b=-a.detail/3),b},_checkMouse:function(a,b){var c=b.relatedTarget;if(!c)return!0;try{for(;c&&c!==a;)c=c.parentNode}catch(d){return!1}return c!==a},_getEvent:function(){var b=a.event;if(!b)for(var c=arguments.callee.caller;c&&(b=c.arguments[0],!b||a.Event!==b.constructor);)c=c.caller;return b},_filterClick:function(a,b){var c=a.timeStamp||a.originalEvent.timeStamp,d=e.DomEvent._lastClick&&c-e.DomEvent._lastClick;return d&&d>100&&400>d?(e.DomEvent.stop(a),void 0):(e.DomEvent._lastClick=c,b(a))}},e.DomEvent.on=e.DomEvent.addListener,e.DomEvent.off=e.DomEvent.removeListener,e.Draggable=e.Class.extend({includes:e.Mixin.Events,statics:{START:e.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"},TAP_TOLERANCE:15},initialize:function(a,b,c){this._element=a,this._dragStartTarget=b||a,this._longPress=c&&!e.Browser.msTouch},enable:function(){if(!this._enabled){for(var a=e.Draggable.START.length-1;a>=0;a--)e.DomEvent.on(this._dragStartTarget,e.Draggable.START[a],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var a=e.Draggable.START.length-1;a>=0;a--)e.DomEvent.off(this._dragStartTarget,e.Draggable.START[a],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(a){if(!a.shiftKey&&(1===a.which||1===a.button||a.touches)&&(e.DomEvent.preventDefault(a).stopPropagation(a),!e.Draggable._disabled)){this._simulateClick=!0;var c=a.touches&&a.touches.length||0;if(c>1)return this._simulateClick=!1,clearTimeout(this._longPressTimeout),void 0;var d=1===c?a.touches[0]:a,f=d.target;e.Browser.touch&&"a"===f.tagName.toLowerCase()&&e.DomUtil.addClass(f,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new e.Point(d.clientX,d.clientY),this._startPos=this._newPos=e.DomUtil.getPosition(this._element),1===c&&e.Browser.touch&&this._longPress&&(this._longPressTimeout=setTimeout(e.bind(function(){var a=this._newPos&&this._newPos.distanceTo(this._startPos)||0;a1)){var c=a.touches&&1===a.touches.length?a.touches[0]:a,d=new e.Point(c.clientX,c.clientY),f=d.subtract(this._startPoint);(f.x||f.y)&&(e.DomEvent.preventDefault(a),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=e.DomUtil.getPosition(this._element).subtract(f),e.Browser.touch||(e.DomUtil.disableTextSelection(),e.DomUtil.addClass(b.body,"leaflet-dragging"))),this._newPos=this._startPos.add(f),this._moving=!0,e.Util.cancelAnimFrame(this._animRequest),this._animRequest=e.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),e.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(a){var c,d,f,g,h;clearTimeout(this._longPressTimeout),this._simulateClick&&a.changedTouches&&(f=this._newPos&&this._newPos.distanceTo(this._startPos)||0,c=a.changedTouches[0],d=c.target,"a"===d.tagName.toLowerCase()&&e.DomUtil.removeClass(d,"leaflet-active"),f200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var a=this._map.getSize()._divideBy(2),b=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=b.subtract(a).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var a=this._worldWidth,b=Math.round(a/2),c=this._initialWorldOffset,d=this._draggable._newPos.x,e=(d-b+c)%a+b-c,f=(d+b+c)%a-b-c,g=Math.abs(e+c)b.inertiaThreshold||!this._positions[0];if(a.fire("dragend"),d)a.fire("moveend");else{var f=this._lastPos.subtract(this._positions[0]),g=(this._lastTime+c-this._times[0])/1e3,h=b.easeLinearity,i=f.multiplyBy(h/g),j=i.distanceTo([0,0]),k=Math.min(b.inertiaMaxSpeed,j),l=i.multiplyBy(k/j),m=k/(b.inertiaDeceleration*h),n=l.multiplyBy(-m/2).round();n.x&&n.y?e.Util.requestAnimFrame(function(){a.panBy(n,{duration:m,easeLinearity:h,noMoveStart:!0})}):a.fire("moveend")}}}),e.Map.addInitHook("addHandler","dragging",e.Map.Drag),e.Map.mergeOptions({doubleClickZoom:!0}),e.Map.DoubleClickZoom=e.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(a){this.setZoomAround(a.containerPoint,this._zoom+1)}}),e.Map.addInitHook("addHandler","doubleClickZoom",e.Map.DoubleClickZoom),e.Map.mergeOptions({scrollWheelZoom:!0}),e.Map.ScrollWheelZoom=e.Handler.extend({addHooks:function(){e.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){e.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(a){var b=e.DomEvent.getWheelDelta(a);this._delta+=b,this._lastMousePos=this._map.mouseEventToContainerPoint(a),this._startTime||(this._startTime=+new Date);var c=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(e.bind(this._performZoom,this),c),e.DomEvent.preventDefault(a),e.DomEvent.stopPropagation(a)},_performZoom:function(){var a=this._map,b=this._delta,c=a.getZoom();b=b>0?Math.ceil(b):Math.floor(b),b=Math.max(Math.min(b,4),-4),b=a._limitZoom(c+b)-c,this._delta=0,this._startTime=null,b&&a.setZoomAround(this._lastMousePos,c+b)}}),e.Map.addInitHook("addHandler","scrollWheelZoom",e.Map.ScrollWheelZoom),e.extend(e.DomEvent,{_touchstart:e.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:e.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(a,c,d){function f(a){var b;if(e.Browser.msTouch?(o.push(a.pointerId),b=o.length):b=a.touches.length,!(b>1)){var c=Date.now(),d=c-(h||c);i=a.touches?a.touches[0]:a,j=d>0&&k>=d,h=c}}function g(a){if(e.Browser.msTouch){var b=o.indexOf(a.pointerId);if(-1===b)return;o.splice(b,1)}if(j){if(e.Browser.msTouch){var d,f={};for(var g in i)d=i[g],f[g]="function"==typeof d?d.bind(i):d;i=f}i.type="dblclick",c(i),h=null}}var h,i,j=!1,k=250,l="_leaflet_",m=this._touchstart,n=this._touchend,o=[];a[l+m+d]=f,a[l+n+d]=g;var p=e.Browser.msTouch?b.documentElement:a;return a.addEventListener(m,f,!1),p.addEventListener(n,g,!1),e.Browser.msTouch&&p.addEventListener("MSPointerCancel",g,!1),this},removeDoubleTapListener:function(a,c){var d="_leaflet_";return a.removeEventListener(this._touchstart,a[d+this._touchstart+c],!1),(e.Browser.msTouch?b.documentElement:a).removeEventListener(this._touchend,a[d+this._touchend+c],!1),e.Browser.msTouch&&b.documentElement.removeEventListener("MSPointerCancel",a[d+this._touchend+c],!1),this}}),e.extend(e.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(a,b,c,d){switch(b){case"touchstart":return this.addMsTouchListenerStart(a,b,c,d);case"touchend":return this.addMsTouchListenerEnd(a,b,c,d);case"touchmove":return this.addMsTouchListenerMove(a,b,c,d);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(a,c,d,e){var f="_leaflet_",g=this._msTouches,h=function(a){for(var b=!1,c=0;c0?Math.ceil(g):Math.floor(g),i=a._limitZoom(f+h),j=a.getZoomScale(i)/this._scale;a._animateZoom(d,i,c,j)},_getScaleOrigin:function(){var a=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(a)}}),e.Map.addInitHook("addHandler","touchZoom",e.Map.TouchZoom),e.Map.mergeOptions({boxZoom:!0}),e.Map.BoxZoom=e.Handler.extend({initialize:function(a){this._map=a,this._container=a._container,this._pane=a._panes.overlayPane},addHooks:function(){e.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){e.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(a){return!a.shiftKey||1!==a.which&&1!==a.button?!1:(e.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(a),this._box=e.DomUtil.create("div","leaflet-zoom-box",this._pane),e.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",e.DomEvent.on(b,"mousemove",this._onMouseMove,this).on(b,"mouseup",this._onMouseUp,this).on(b,"keydown",this._onKeyDown,this).preventDefault(a),this._map.fire("boxzoomstart"),void 0)},_onMouseMove:function(a){var b=this._startLayerPoint,c=this._box,d=this._map.mouseEventToLayerPoint(a),f=d.subtract(b),g=new e.Point(Math.min(d.x,b.x),Math.min(d.y,b.y));e.DomUtil.setPosition(c,g),c.style.width=Math.max(0,Math.abs(f.x)-4)+"px",c.style.height=Math.max(0,Math.abs(f.y)-4)+"px" +},_finish:function(){this._pane.removeChild(this._box),this._container.style.cursor="",e.DomUtil.enableTextSelection(),e.DomEvent.off(b,"mousemove",this._onMouseMove).off(b,"mouseup",this._onMouseUp).off(b,"keydown",this._onKeyDown)},_onMouseUp:function(a){this._finish();var b=this._map,c=b.mouseEventToLayerPoint(a);if(!this._startLayerPoint.equals(c)){var d=new e.LatLngBounds(b.layerPointToLatLng(this._startLayerPoint),b.layerPointToLatLng(c));b.fitBounds(d),b.fire("boxzoomend",{boxZoomBounds:d})}},_onKeyDown:function(a){27===a.keyCode&&this._finish()}}),e.Map.addInitHook("addHandler","boxZoom",e.Map.BoxZoom),e.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),e.Map.Keyboard=e.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(a){this._map=a,this._setPanOffset(a.options.keyboardPanOffset),this._setZoomOffset(a.options.keyboardZoomOffset)},addHooks:function(){var a=this._map._container;-1===a.tabIndex&&(a.tabIndex="0"),e.DomEvent.on(a,"focus",this._onFocus,this).on(a,"blur",this._onBlur,this).on(a,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var a=this._map._container;e.DomEvent.off(a,"focus",this._onFocus,this).off(a,"blur",this._onBlur,this).off(a,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var c=b.body,d=b.documentElement,e=c.scrollTop||d.scrollTop,f=c.scrollTop||d.scrollLeft;this._map._container.focus(),a.scrollTo(f,e)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(a){var b,c,d=this._panKeys={},e=this.keyCodes;for(b=0,c=e.left.length;c>b;b++)d[e.left[b]]=[-1*a,0];for(b=0,c=e.right.length;c>b;b++)d[e.right[b]]=[a,0];for(b=0,c=e.down.length;c>b;b++)d[e.down[b]]=[0,a];for(b=0,c=e.up.length;c>b;b++)d[e.up[b]]=[0,-1*a]},_setZoomOffset:function(a){var b,c,d=this._zoomKeys={},e=this.keyCodes;for(b=0,c=e.zoomIn.length;c>b;b++)d[e.zoomIn[b]]=a;for(b=0,c=e.zoomOut.length;c>b;b++)d[e.zoomOut[b]]=-a},_addHooks:function(){e.DomEvent.on(b,"keydown",this._onKeyDown,this)},_removeHooks:function(){e.DomEvent.off(b,"keydown",this._onKeyDown,this)},_onKeyDown:function(a){var b=a.keyCode,c=this._map;if(b in this._panKeys)c.panBy(this._panKeys[b]),c.options.maxBounds&&c.panInsideBounds(c.options.maxBounds);else{if(!(b in this._zoomKeys))return;c.setZoom(c.getZoom()+this._zoomKeys[b])}e.DomEvent.stop(a)}}),e.Map.addInitHook("addHandler","keyboard",e.Map.Keyboard),e.Handler.MarkerDrag=e.Handler.extend({initialize:function(a){this._marker=a},addHooks:function(){var a=this._marker._icon;this._draggable||(this._draggable=new e.Draggable(a,a)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable()},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart).off("drag",this._onDrag).off("dragend",this._onDragEnd),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var a=this._marker,b=a._shadow,c=e.DomUtil.getPosition(a._icon),d=a._map.layerPointToLatLng(c);b&&e.DomUtil.setPosition(b,c),a._latlng=d,a.fire("move",{latlng:d}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),e.Control=e.Class.extend({options:{position:"topright"},initialize:function(a){e.setOptions(this,a)},getPosition:function(){return this.options.position},setPosition:function(a){var b=this._map;return b&&b.removeControl(this),this.options.position=a,b&&b.addControl(this),this},getContainer:function(){return this._container},addTo:function(a){this._map=a;var b=this._container=this.onAdd(a),c=this.getPosition(),d=a._controlCorners[c];return e.DomUtil.addClass(b,"leaflet-control"),-1!==c.indexOf("bottom")?d.insertBefore(b,d.firstChild):d.appendChild(b),this},removeFrom:function(a){var b=this.getPosition(),c=a._controlCorners[b];return c.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(a),this}}),e.control=function(a){return new e.Control(a)},e.Map.include({addControl:function(a){return a.addTo(this),this},removeControl:function(a){return a.removeFrom(this),this},_initControlPos:function(){function a(a,f){var g=c+a+" "+c+f;b[a+f]=e.DomUtil.create("div",g,d)}var b=this._controlCorners={},c="leaflet-",d=this._controlContainer=e.DomUtil.create("div",c+"control-container",this._container);a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),e.Control.Zoom=e.Control.extend({options:{position:"topleft"},onAdd:function(a){var b="leaflet-control-zoom",c=e.DomUtil.create("div",b+" leaflet-bar");return this._map=a,this._zoomInButton=this._createButton("+","Zoom in",b+"-in",c,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",b+"-out",c,this._zoomOut,this),a.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(a){a.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(a){this._map.zoomIn(a.shiftKey?3:1)},_zoomOut:function(a){this._map.zoomOut(a.shiftKey?3:1)},_createButton:function(a,b,c,d,f,g){var h=e.DomUtil.create("a",c,d);h.innerHTML=a,h.href="#",h.title=b;var i=e.DomEvent.stopPropagation;return e.DomEvent.on(h,"click",i).on(h,"mousedown",i).on(h,"dblclick",i).on(h,"click",e.DomEvent.preventDefault).on(h,"click",f,g),h},_updateDisabled:function(){var a=this._map,b="leaflet-disabled";e.DomUtil.removeClass(this._zoomInButton,b),e.DomUtil.removeClass(this._zoomOutButton,b),a._zoom===a.getMinZoom()&&e.DomUtil.addClass(this._zoomOutButton,b),a._zoom===a.getMaxZoom()&&e.DomUtil.addClass(this._zoomInButton,b)}}),e.Map.mergeOptions({zoomControl:!0}),e.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new e.Control.Zoom,this.addControl(this.zoomControl))}),e.control.zoom=function(a){return new e.Control.Zoom(a)},e.Control.Attribution=e.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(a){e.setOptions(this,a),this._attributions={}},onAdd:function(a){return this._container=e.DomUtil.create("div","leaflet-control-attribution"),e.DomEvent.disableClickPropagation(this._container),a.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(a){a.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(a){return this.options.prefix=a,this._update(),this},addAttribution:function(a){return a?(this._attributions[a]||(this._attributions[a]=0),this._attributions[a]++,this._update(),this):void 0},removeAttribution:function(a){return a?(this._attributions[a]&&(this._attributions[a]--,this._update()),this):void 0},_update:function(){if(this._map){var a=[];for(var b in this._attributions)this._attributions[b]&&a.push(b);var c=[];this.options.prefix&&c.push(this.options.prefix),a.length&&c.push(a.join(", ")),this._container.innerHTML=c.join(" | ")}},_onLayerAdd:function(a){a.layer.getAttribution&&this.addAttribution(a.layer.getAttribution())},_onLayerRemove:function(a){a.layer.getAttribution&&this.removeAttribution(a.layer.getAttribution())}}),e.Map.mergeOptions({attributionControl:!0}),e.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new e.Control.Attribution).addTo(this))}),e.control.attribution=function(a){return new e.Control.Attribution(a)},e.Control.Scale=e.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(a){this._map=a;var b="leaflet-control-scale",c=e.DomUtil.create("div",b),d=this.options;return this._addScales(d,b,c),a.on(d.updateWhenIdle?"moveend":"move",this._update,this),a.whenReady(this._update,this),c},onRemove:function(a){a.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(a,b,c){a.metric&&(this._mScale=e.DomUtil.create("div",b+"-line",c)),a.imperial&&(this._iScale=e.DomUtil.create("div",b+"-line",c))},_update:function(){var a=this._map.getBounds(),b=a.getCenter().lat,c=6378137*Math.PI*Math.cos(b*Math.PI/180),d=c*(a.getNorthEast().lng-a.getSouthWest().lng)/180,e=this._map.getSize(),f=this.options,g=0;e.x>0&&(g=d*(f.maxWidth/e.x)),this._updateScales(f,g)},_updateScales:function(a,b){a.metric&&b&&this._updateMetric(b),a.imperial&&b&&this._updateImperial(b)},_updateMetric:function(a){var b=this._getRoundNum(a);this._mScale.style.width=this._getScaleWidth(b/a)+"px",this._mScale.innerHTML=1e3>b?b+" m":b/1e3+" km"},_updateImperial:function(a){var b,c,d,e=3.2808399*a,f=this._iScale;e>5280?(b=e/5280,c=this._getRoundNum(b),f.style.width=this._getScaleWidth(c/b)+"px",f.innerHTML=c+" mi"):(d=this._getRoundNum(e),f.style.width=this._getScaleWidth(d/e)+"px",f.innerHTML=d+" ft")},_getScaleWidth:function(a){return Math.round(this.options.maxWidth*a)-10},_getRoundNum:function(a){var b=Math.pow(10,(Math.floor(a)+"").length-1),c=a/b;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,b*c}}),e.control.scale=function(a){return new e.Control.Scale(a)},e.Control.Layers=e.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(a,b,c){e.setOptions(this,c),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var d in a)this._addLayer(a[d],d);for(d in b)this._addLayer(b[d],d,!0)},onAdd:function(a){return this._initLayout(),this._update(),a.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(a){a.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(a,b){return this._addLayer(a,b),this._update(),this},addOverlay:function(a,b){return this._addLayer(a,b,!0),this._update(),this},removeLayer:function(a){var b=e.stamp(a);return delete this._layers[b],this._update(),this},_initLayout:function(){var a="leaflet-control-layers",b=this._container=e.DomUtil.create("div",a);b.setAttribute("aria-haspopup",!0),e.Browser.touch?e.DomEvent.on(b,"click",e.DomEvent.stopPropagation):(e.DomEvent.disableClickPropagation(b),e.DomEvent.on(b,"mousewheel",e.DomEvent.stopPropagation));var c=this._form=e.DomUtil.create("form",a+"-list");if(this.options.collapsed){e.DomEvent.on(b,"mouseover",this._expand,this).on(b,"mouseout",this._collapse,this);var d=this._layersLink=e.DomUtil.create("a",a+"-toggle",b);d.href="#",d.title="Layers",e.Browser.touch?e.DomEvent.on(d,"click",e.DomEvent.stopPropagation).on(d,"click",e.DomEvent.preventDefault).on(d,"click",this._expand,this):e.DomEvent.on(d,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=e.DomUtil.create("div",a+"-base",c),this._separator=e.DomUtil.create("div",a+"-separator",c),this._overlaysList=e.DomUtil.create("div",a+"-overlays",c),b.appendChild(c)},_addLayer:function(a,b,c){var d=e.stamp(a);this._layers[d]={layer:a,name:b,overlay:c},this.options.autoZIndex&&a.setZIndex&&(this._lastZIndex++,a.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var a,b,c=!1,d=!1;for(a in this._layers)b=this._layers[a],this._addItem(b),d=d||b.overlay,c=c||!b.overlay;this._separator.style.display=d&&c?"":"none"}},_onLayerChange:function(a){var b=e.stamp(a.layer);this._layers[b]&&!this._handlingClick&&this._update()},_createRadioElement:function(a,c){var d='a;a++)b=e[a],c=this._layers[b.layerId],b.checked&&!this._map.hasLayer(c.layer)?(this._map.addLayer(c.layer),c.overlay?this._map.fire("overlayadd",{layer:c}):d=c.layer):!b.checked&&this._map.hasLayer(c.layer)&&(this._map.removeLayer(c.layer),this._map.fire("overlayremove",{layer:c}));d&&(this._map.setZoom(this._map.getZoom()),this._map.fire("baselayerchange",{layer:d})),this._handlingClick=!1},_expand:function(){e.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),e.control.layers=function(a,b,c){return new e.Control.Layers(a,b,c)},e.PosAnimation=e.Class.extend({includes:e.Mixin.Events,run:function(a,b,c,d){this.stop(),this._el=a,this._inProgress=!0,this._newPos=b,this.fire("start"),a.style[e.DomUtil.TRANSITION]="all "+(c||.25)+"s cubic-bezier(0,0,"+(d||.5)+",1)",e.DomEvent.on(a,e.DomUtil.TRANSITION_END,this._onTransitionEnd,this),e.DomUtil.setPosition(a,b),e.Util.falseFn(a.offsetWidth),this._stepTimer=setInterval(e.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(e.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),e.Util.falseFn(this._el.offsetWidth))},_onStep:function(){this._el._leaflet_pos=this._getPos(),this.fire("step")},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var b,c,d,f=this._el,g=a.getComputedStyle(f);return e.Browser.any3d?(d=g[e.DomUtil.TRANSFORM].match(this._transformRe),b=parseFloat(d[1]),c=parseFloat(d[2])):(b=parseFloat(g.left),c=parseFloat(g.top)),new e.Point(b,c,!0)},_onTransitionEnd:function(){e.DomEvent.off(this._el,e.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[e.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),e.Map.include({setView:function(a,b,d){if(b=this._limitZoom(b),a=e.latLng(a),d=d||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!d.reset&&d!==!0){d.animate!==c&&(d.zoom=e.extend({animate:d.animate},d.zoom),d.pan=e.extend({animate:d.animate},d.pan));var f=this._zoom!==b?this._tryAnimatedZoom&&this._tryAnimatedZoom(a,b,d.zoom):this._tryAnimatedPan(a,d.pan);if(f)return clearTimeout(this._sizeTimer),this}return this._resetView(a,b),this},panBy:function(a,b){if(a=e.point(a).round(),b=b||{},!a.x&&!a.y)return this;if(this._panAnim||(this._panAnim=new e.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),b.noMoveStart||this.fire("movestart"),b.animate!==!1){e.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(a);this._panAnim.run(this._mapPane,c,b.duration||.25,b.easeLinearity)}else this._rawPanBy(a),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){e.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(a,b){var c=this._getCenterOffset(a)._floor();return(b&&b.animate)===!0||this.getSize().contains(c)?(this.panBy(c,b),!0):!1}}),e.PosAnimation=e.DomUtil.TRANSITION?e.PosAnimation:e.PosAnimation.extend({run:function(a,b,c,d){this.stop(),this._el=a,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(d||.5,.2),this._startPos=e.DomUtil.getPosition(a),this._offset=b.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=e.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var a=+new Date-this._startTime,b=1e3*this._duration;b>a?this._runFrame(this._easeOut(a/b)):(this._runFrame(1),this._complete())},_runFrame:function(a){var b=this._startPos.add(this._offset.multiplyBy(a));e.DomUtil.setPosition(this._el,b),this.fire("step")},_complete:function(){e.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(a){return 1-Math.pow(1-a,this._easeOutPower)}}),e.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),e.DomUtil.TRANSITION&&e.Map.addInitHook(function(){e.DomEvent.on(this._mapPane,e.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),e.Map.include(e.DomUtil.TRANSITION?{_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_tryAnimatedZoom:function(a,b,c){if(this._animatingZoom)return!0;if(c=c||{},!this.options.zoomAnimation||c.animate===!1||!e.DomUtil.TRANSITION||e.Browser.android23||e.Browser.mobileOpera||Math.abs(b-this._zoom)>this.options.zoomAnimationThreshold)return!1;var d=this.getZoomScale(b),f=this._getCenterOffset(a)._divideBy(1-1/d),g=this._getCenterLayerPoint()._add(f);return c.animate===!0||this.getSize().contains(f)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(a,b,g,d),!0):!1},_animateZoom:function(a,b,c,d,f){this._animatingZoom=!0,e.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=a,this._animateToZoom=b,e.Draggable&&(e.Draggable._disabled=!0),this.fire("zoomanim",{center:a,zoom:b,origin:c,scale:d,delta:f})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,e.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),e.Draggable&&(e.Draggable._disabled=!1)}}:{}),e.TileLayer.include({_animateZoom:function(a){var b=!1;this._animating||(this._animating=!0,b=!0),b&&this._prepareBgBuffer();var c=this._bgBuffer;b&&(clearTimeout(this._clearBgBufferTimer),e.Util.falseFn(c.offsetWidth));var d=e.DomUtil.TRANSFORM,f=a.delta?e.DomUtil.getTranslateString(a.delta):c.style[d];c.style[d]=f+" "+e.DomUtil.getScaleString(a.scale,a.origin)},_endZoomAnim:function(){var a=this._tileContainer,b=this._bgBuffer;a.style.visibility="",a.style.zIndex=2,b.style.zIndex=1,e.Util.falseFn(b.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var a=this._map;!a||a._animatingZoom||a.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[e.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var a=this._tileContainer,b=this._bgBuffer,c=this._getLoadedTilesPercentage(b),d=this._getLoadedTilesPercentage(a);return b&&c>.5&&.5>d?(a.style.visibility="hidden",this._stopLoadingImages(a),void 0):(b.style.visibility="hidden",b.style[e.DomUtil.TRANSFORM]="",this._tileContainer=b,b=this._bgBuffer=a,this._stopLoadingImages(b),void 0)},_getLoadedTilesPercentage:function(a){var b,c,d=a.getElementsByTagName("img"),e=0;for(b=0,c=d.length;c>b;b++)d[b].complete&&e++;return e/c},_stopLoadingImages:function(a){var b,c,d,f=Array.prototype.slice.call(a.getElementsByTagName("img"));for(b=0,c=f.length;c>b;b++)d=f[b],d.complete||(d.onload=e.Util.falseFn,d.onerror=e.Util.falseFn,d.src=e.Util.emptyImageUrl,d.parentNode.removeChild(d))}}),e.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(a){if(a=this._locateOptions=e.extend(this._defaultLocateOptions,a),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var b=e.bind(this._handleGeolocationResponse,this),c=e.bind(this._handleGeolocationError,this);return a.watch?this._locationWatchId=navigator.geolocation.watchPosition(b,c,a):navigator.geolocation.getCurrentPosition(b,c,a),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(a){var b=a.code,c=a.message||(1===b?"permission denied":2===b?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:b,message:"Geolocation error: "+c+"."})},_handleGeolocationResponse:function(a){var b=a.coords.latitude,c=a.coords.longitude,d=new e.LatLng(b,c),f=180*a.coords.accuracy/40075017,g=f/Math.cos(e.LatLng.DEG_TO_RAD*b),h=e.latLngBounds([b-f,c-g],[b+f,c+g]),i=this._locateOptions;if(i.setView){var j=Math.min(this.getBoundsZoom(h),i.maxZoom);this.setView(d,j)}var k=e.extend({latlng:d,bounds:h},a.coords);this.fire("locationfound",k)}})}(window,document),define("css",{load:function(a,b,c){function d(a){var b=document.getElementsByTagName("head")[0],c=document.createElement("link");c.href=a,c.rel="stylesheet",c.type="text/css",b.appendChild(c)}d(requirejs.toUrl(a)),c(!0)},pluginBuilder:"../vendor/require/css-build"}),define("css-embed",function(){function a(a){var b=document.getElementsByTagName("head")[0],c=document.createElement("style"),d=document.createTextNode(a);c.type="text/css",c.styleSheet?c.styleSheet.cssText=d.nodeValue:c.appendChild(d),b.appendChild(c)}return a}),define("css!panels/bettermap/leaflet/leaflet.css",["css-embed"],function(a){return a(".leaflet-map-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-pane,.leaflet-tile-container,.leaflet-overlay-pane,.leaflet-shadow-pane,.leaflet-marker-pane,.leaflet-popup-pane,.leaflet-overlay-pane svg,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden;-ms-touch-action:none}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container img{max-width:none!important}.leaflet-container img.leaflet-image-layer{max-width:15000px!important}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0}.leaflet-tile-pane{z-index:2}.leaflet-objects-pane{z-index:3}.leaflet-overlay-pane{z-index:4}.leaflet-shadow-pane{z-index:5}.leaflet-marker-pane{z-index:6}.leaflet-popup-pane{z-index:7}.leaflet-control{position:relative;z-index:7;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile,.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-tile-loaded,.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile,.leaflet-touching .leaflet-zoom-animated{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-clickable{cursor:pointer}.leaflet-container{cursor:-webkit-grab;cursor:-moz-grab}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging,.leaflet-dragging .leaflet-clickable,.leaflet-dragging .leaflet-container{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing}.leaflet-container{background:#ddd;outline:0}.leaflet-container a{color:#0078A8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{border:2px dotted #05f;background:#fff;opacity:.5}.leaflet-container{font:12px/1.5 \"Helvetica Neue\",Arial,Helvetica,sans-serif}.leaflet-bar{box-shadow:0 1px 7px rgba(0,0,0,.65);-webkit-border-radius:4px;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;border-bottom:0}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar{-webkit-border-radius:10px;border-radius:10px}.leaflet-touch .leaflet-bar a{width:30px;height:30px}.leaflet-touch .leaflet-bar a:first-child{-webkit-border-top-left-radius:7px;border-top-left-radius:7px;-webkit-border-top-right-radius:7px;border-top-right-radius:7px}.leaflet-touch .leaflet-bar a:last-child{-webkit-border-bottom-left-radius:7px;border-bottom-left-radius:7px;-webkit-border-bottom-right-radius:7px;border-bottom-right-radius:7px;border-bottom:0}.leaflet-control-zoom-in{font:700 18px 'Lucida Console',Monaco,monospace}.leaflet-control-zoom-out{font:700 22px 'Lucida Console',Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in{font-size:22px;line-height:30px}.leaflet-touch .leaflet-control-zoom-out{font-size:28px;line-height:30px}.leaflet-control-layers{box-shadow:0 1px 7px rgba(0,0,0,.4);background:#f8f8f9;-webkit-border-radius:5px;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-container .leaflet-control-attribution{background-color:rgba(255,255,255,.7);box-shadow:0 0 5px #bbb;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:0;color:#000;line-height:1.1;padding:2px 5px 1px;font-size:11px;text-shadow:1px 1px 1px #fff;background-color:rgba(255,255,255,.5);box-shadow:0 -1px 5px rgba(0,0,0,.2);white-space:nowrap;overflow:hidden}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:0;margin-top:-2px;box-shadow:0 2px 5px rgba(0,0,0,.2)}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-control-zoom{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-control-zoom{border:4px solid rgba(0,0,0,.3)}.leaflet-popup{position:absolute;text-align:center}.leaflet-popup-content-wrapper{padding:1px;text-align:left;-webkit-border-radius:12px;border-radius:12px}.leaflet-popup-content{margin:13px 19px;line-height:1.4}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{margin:0 auto;width:40px;height:20px;position:relative;overflow:hidden}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;padding:4px 4px 0 0;text-align:center;width:18px;height:14px;font:16px/14px Tahoma,Verdana,sans-serif;color:#c3c3c3;text-decoration:none;font-weight:700;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-editing-icon{-webkit-border-radius:2px;border-radius:2px}"),!0}),define("css!panels/bettermap/leaflet/plugins.css",["css-embed"],function(a){return a('.leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{-webkit-transition:-webkit-transform .2s ease-out,opacity .2s ease-in;-moz-transition:-moz-transform .2s ease-out,opacity .2s ease-in;-o-transition:-o-transform .2s ease-out,opacity .2s ease-in;transition:transform .2s ease-out,opacity .2s ease-in}.marker-cluster-small{background-color:rgba(181,226,140,.6)}.marker-cluster-small div{background-color:rgba(110,204,57,.6)}.marker-cluster-medium{background-color:rgba(241,211,87,.6)}.marker-cluster-medium div{background-color:rgba(240,194,12,.6)}.marker-cluster-large{background-color:rgba(253,156,115,.6)}.marker-cluster-large div{background-color:rgba(241,128,23,.6)}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{width:30px;height:30px;margin-left:5px;margin-top:5px;text-align:center;border-radius:15px;font:12px "Helvetica Neue",Arial,Helvetica,sans-serif}.marker-cluster span{line-height:30px}.leaflet-label{background:#1f1f1f;background-clip:padding-box;border-radius:4px;border-style:solid;border-width:0;display:block;font-weight:200;font-size:11pt;padding:5px;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;z-index:99999!important}.leaflet-label:before{border-right:6px solid #000;border-right-color:inherit;border-top:6px solid transparent;border-bottom:6px solid transparent;content:"";position:absolute;top:5px;left:-10px;display:none}'),!0}),define("panels/bettermap/module",["angular","app","underscore","./leaflet/leaflet-src","require","css!./leaflet/leaflet.css","css!./leaflet/plugins.css"],function(a,b,c,d,e){var f=a.module("kibana.panels.bettermap",[]);b.useModule(f),f.controller("bettermap",["$scope","querySrv","dashboard","filterSrv",function(b,f,g,h){b.panelMeta={editorTabs:[{title:"Queries",src:"app/partials/querySelect.html"}],status:"Experimental",description:"Displays geo points in clustered groups on a map. The cavaet for this panel is that, for better or worse, it does NOT use the terms facet and it does query sequentially. This however means that it transfers more data and is generally heavier to compute, while showing less actual data. If you have a time filter, it will attempt to show to most recent points in your search, up to your defined limit"};var i={queries:{mode:"all",ids:[]},size:1e3,spyable:!0,tooltip:"_id",field:null};c.defaults(b.panel,i),b.requireContext=e,b.init=function(){b.$on("refresh",function(){b.get_data()}),b.get_data()},b.get_data=function(a,e){b.require(["./leaflet/plugins"],function(){if(b.panel.error=!1,0!==g.indices.length){if(c.isUndefined(b.panel.field))return b.panel.error="Please select a field that contains geo point in [lon,lat] format",void 0; +var i=c.uniq(c.pluck(h.getByType("time"),"field"));i.length>1?b.panel.error="Time field must be consistent amongst time filters":i=0===i.length?null:i[0];var j=c.isUndefined(a)?0:a;b.panel.queries.ids=f.idsByMode(b.panel.queries);var k=b.ejs.BoolQuery();c.each(b.panel.queries.ids,function(a){k=k.should(f.getEjsObj(a))});var l=b.ejs.Request().indices(g.indices[j]).query(b.ejs.FilteredQuery(k,h.getBoolFilter(h.ids).must(b.ejs.ExistsFilter(b.panel.field)))).fields([b.panel.field,b.panel.tooltip]).size(b.panel.size);c.isNull(i)||(l=l.sort(i,"desc")),b.populate_modal(l);var m=l.doSearch();m.then(function(a){return b.panelMeta.loading=!1,0===j&&(b.hits=0,b.data=[],e=b.query_id=(new Date).getTime()),c.isUndefined(a.error)?(b.query_id===e&&(b.data=b.data.slice(0,b.panel.size).concat(c.map(a.hits.hits,function(a){return{coordinates:new d.LatLng(a.fields[b.panel.field][1],a.fields[b.panel.field][0]),tooltip:a.fields[b.panel.tooltip]}})),b.$emit("draw"),b.data.length'),a.$on("draw",function(){f()}),a.$on("render",function(){c.isUndefined(g)||(g.invalidateSize(),g.getPanes())});var g,h}}})}); \ No newline at end of file diff --git a/dist/app/panels/column/editor.html b/dist/app/panels/column/editor.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/column/module.html b/dist/app/panels/column/module.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/column/module.js b/dist/app/panels/column/module.js old mode 100755 new mode 100644 index dbf24f48b73..02b97cd2d0f --- a/dist/app/panels/column/module.js +++ b/dist/app/panels/column/module.js @@ -1,2 +1,4 @@ -define("panels/column/module",["angular","app","underscore","config"],function(e,t,n,r){var i=e.module("kibana.panels.column",[]);t.useModule(i),i.controller("column",["$scope","$rootScope","$timeout",function(e,t,r){e.panelMeta={status:"Stable",description:"A pseudo panel that lets you add other panels to be arranged in a column withdefined heights."};var i={panels:[]};n.defaults(e.panel,i),e.init=function(){e.reset_panel()},e.toggle_row=function(t){t.collapse=t.collapse?!1:!0,t.collapse||r(function(){e.send_render()})},e.send_render=function(){e.$broadcast("render")},e.add_panel=function(t){e.panel.panels.push(t)},e.reset_panel=function(t){e.new_panel={loading:!1,error:!1,sizeable:!1,span:12,height:"150px",editable:!0,type:t}}}]),i.directive("columnEdit",["$compile","$timeout",function(t,r){return{scope:{new_panel:"=panel",row:"=",config:"=",dashboards:"=",type:"=type"},link:function(i,s){i.$on("render",function(){r(function(){i.panel=i.new_panel;var r="
    " -;!n.isUndefined(i.type)&&i.type!==""&&(r=r+"
    "),s.html(t(e.element(r))(i))})})}}}]),i.filter("withoutColumn",function(){return function(){return n.without(r.panel_names,"column")}})}); \ No newline at end of file +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + +define("panels/column/module",["angular","app","underscore","config"],function(a,b,c,d){var e=a.module("kibana.panels.column",[]);b.useModule(e),e.controller("column",["$scope","$rootScope","$timeout",function(a,b,d){a.panelMeta={status:"Stable",description:"A pseudo panel that lets you add other panels to be arranged in a column withdefined heights."};var e={panels:[]};c.defaults(a.panel,e),a.init=function(){a.reset_panel()},a.toggle_row=function(b){b.collapse=b.collapse?!1:!0,b.collapse||d(function(){a.send_render()})},a.send_render=function(){a.$broadcast("render")},a.add_panel=function(b){a.panel.panels.push(b)},a.reset_panel=function(b){a.new_panel={loading:!1,error:!1,sizeable:!1,span:12,height:"150px",editable:!0,type:b}}}]),e.directive("columnEdit",["$compile","$timeout",function(b,d){return{scope:{new_panel:"=panel",row:"=",config:"=",dashboards:"=",type:"=type"},link:function(e,f){e.$on("render",function(){d(function(){e.panel=e.new_panel;var d="
    ";c.isUndefined(e.type)||""===e.type||(d=d+"
    "),f.html(b(a.element(d))(e))})})}}}]),e.filter("withoutColumn",function(){return function(){return c.without(d.panel_names,"column")}})}); \ No newline at end of file diff --git a/dist/app/panels/column/panelgeneral.html b/dist/app/panels/column/panelgeneral.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/dashcontrol/editor.html b/dist/app/panels/dashcontrol/editor.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/dashcontrol/load.html b/dist/app/panels/dashcontrol/load.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/dashcontrol/module.html b/dist/app/panels/dashcontrol/module.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/dashcontrol/module.js b/dist/app/panels/dashcontrol/module.js old mode 100755 new mode 100644 index ecc78ed5512..d04324759b9 --- a/dist/app/panels/dashcontrol/module.js +++ b/dist/app/panels/dashcontrol/module.js @@ -1,4 +1,4 @@ -define("panels/dashcontrol/module",["angular","app","underscore"],function(e,t,n){var r=e.module("kibana.panels.dashcontrol",[]);t.useModule(r),r.controller("dashcontrol",["$scope","$http","timer","dashboard","alertSrv",function(e,t,r,i,s){e.panelMeta={status:"Deprecated",description:"This panel has been moved to the navigation bar. See the dashboard setting editor to configure it."},e.panel=e.panel||{};var o={save:{gist:!1,elasticsearch:!0,local:!0,"default":!0},load:{gist:!0,elasticsearch:!0,local:!0},hide_control:!1,elasticsearch_size:20,temp:!0,ttl_enable:!0,temp_ttl:"30d"};n.defaults(e.panel,o),e.init=function(){e.gist_pattern=/(^\d{5,}$)|(^[a-z0-9]{10,}$)|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/,e.gist={},e.elasticsearch={}},e.set_default=function(){i.set_default()?s.set("Local Default Set",i.current.title+" has been set as your local default","success",5e3):s.set("Incompatible Browser","Sorry, your browser is too old for this feature","error",5e3)},e.purge_default=function(){i -.purge_default()?s.set("Local Default Clear","Your local default dashboard has been cleared","success",5e3):s.set("Incompatible Browser","Sorry, your browser is too old for this feature","error",5e3)},e.elasticsearch_save=function(t,r){i.elasticsearch_save(t,e.elasticsearch.title||i.current.title,e.panel.ttl_enable?r:!1).then(function(r){n.isUndefined(r._id)?s.set("Save failed","Dashboard could not be saved to Elasticsearch","error",5e3):(s.set("Dashboard Saved",'This dashboard has been saved to Elasticsearch as "'+r._id+'"',"success",5e3),t==="temp"&&(e.share=i.share_link(i.current.title,"temp",r._id)))})},e.elasticsearch_delete=function(t){i.elasticsearch_delete(t).then(function(r){if(!n.isUndefined(r))if(r.found){s.set("Dashboard Deleted",t+" has been deleted","success",5e3);var i=n.where(e.elasticsearch.dashboards,{_id:t})[0];e.elasticsearch.dashboards=n.without(e.elasticsearch.dashboards,i)}else s.set("Dashboard Not Found","Could not find "+t+" in Elasticsearch","warning",5e3);else s -.set("Dashboard Not Deleted","An error occurred deleting the dashboard","error",5e3)})},e.elasticsearch_dblist=function(t){i.elasticsearch_list(t,e.panel.elasticsearch_size).then(function(t){n.isUndefined(t.hits)||(e.panel.error=!1,e.hits=t.hits.total,e.elasticsearch.dashboards=t.hits.hits)})},e.save_gist=function(){i.save_gist(e.gist.title).then(function(t){n.isUndefined(t)?s.set("Save failed","Gist could not be saved","error",5e3):(e.gist.last=t,s.set("Gist saved",'You will be able to access your exported dashboard file at '+t+" in a moment","success"))})},e.gist_dblist=function(t){i.gist_list(t).then(function(t){t&&t.length>0?e.gist.files=t:s.set("Gist Failed","Could not retrieve dashboard list from gist","error",5e3)})}}]),r.directive("dashUpload",["timer","dashboard","alertSrv",function(e,t,n){return{restrict:"A",link:function(e){function r(n){var r=n.target.files,i=function(){return function(n){t.dash_load(JSON.parse(n.target.result)),e.$apply()}};for(var s=0,o -;o=r[s];s++){var u=new FileReader;u.onload=i(o),u.readAsText(o)}}window.File&&window.FileReader&&window.FileList&&window.Blob?document.getElementById("dashupload").addEventListener("change",r,!1):n.set("Oops","Sorry, the HTML5 File APIs are not fully supported in this browser.","error")}}}]),r.filter("gistid",function(){var e=/(\d{5,})|([a-z0-9]{10,})|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/;return function(t){if(!n.isUndefined(t)){var r=t.match(e);if(!n.isNull(r)&&!n.isUndefined(r))return r[0].replace(/.*\//,"")}}})}); \ No newline at end of file +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + +define("panels/dashcontrol/module",["angular","app","underscore"],function(a,b,c){var d=a.module("kibana.panels.dashcontrol",[]);b.useModule(d),d.controller("dashcontrol",["$scope","$http","timer","dashboard","alertSrv",function(a,b,d,e,f){a.panelMeta={status:"Deprecated",description:"This panel has been moved to the navigation bar. See the dashboard setting editor to configure it."},a.panel=a.panel||{};var g={save:{gist:!1,elasticsearch:!0,local:!0,"default":!0},load:{gist:!0,elasticsearch:!0,local:!0},hide_control:!1,elasticsearch_size:20,temp:!0,ttl_enable:!0,temp_ttl:"30d"};c.defaults(a.panel,g),a.init=function(){a.gist_pattern=/(^\d{5,}$)|(^[a-z0-9]{10,}$)|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/,a.gist={},a.elasticsearch={}},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(b,d){e.elasticsearch_save(b,a.elasticsearch.title||e.current.title,a.panel.ttl_enable?d:!1).then(function(d){c.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"===b&&(a.share=e.share_link(e.current.title,"temp",d._id)))})},a.elasticsearch_delete=function(b){e.elasticsearch_delete(b).then(function(d){if(c.isUndefined(d))f.set("Dashboard Not Deleted","An error occurred deleting the dashboard","error",5e3);else if(d.found){f.set("Dashboard Deleted",b+" has been deleted","success",5e3);var e=c.where(a.elasticsearch.dashboards,{_id:b})[0];a.elasticsearch.dashboards=c.without(a.elasticsearch.dashboards,e)}else f.set("Dashboard Not Found","Could not find "+b+" in Elasticsearch","warning",5e3)})},a.elasticsearch_dblist=function(b){e.elasticsearch_list(b,a.panel.elasticsearch_size).then(function(b){c.isUndefined(b.hits)||(a.panel.error=!1,a.hits=b.hits.total,a.elasticsearch.dashboards=b.hits.hits)})},a.save_gist=function(){e.save_gist(a.gist.title).then(function(b){c.isUndefined(b)?f.set("Save failed","Gist could not be saved","error",5e3):(a.gist.last=b,f.set("Gist saved",'You will be able to access your exported dashboard file at '+b+" 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)})}}]),d.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")}}}]),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(/.*\//,"")}}})}); \ No newline at end of file diff --git a/dist/app/panels/dashcontrol/save.html b/dist/app/panels/dashcontrol/save.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/dashcontrol/share.html b/dist/app/panels/dashcontrol/share.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/derivequeries/editor.html b/dist/app/panels/derivequeries/editor.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/derivequeries/module.html b/dist/app/panels/derivequeries/module.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/derivequeries/module.js b/dist/app/panels/derivequeries/module.js old mode 100755 new mode 100644 index 0dd98dd1ae6..ff570316fc5 --- a/dist/app/panels/derivequeries/module.js +++ b/dist/app/panels/derivequeries/module.js @@ -1,3 +1,4 @@ -define("panels/derivequeries/module",["angular","app","underscore"],function(e,t,n){var r=e.module("kibana.panels.derivequeries",[]);t.useModule(r),r.controller("derivequeries",["$scope","$rootScope","querySrv","fields","dashboard","filterSrv",function(t,r,i,s,o,u){t.panelMeta={status:"Experimental",description:"Creates a new set of queries using the Elasticsearch terms facet. For example, you might want to create 5 queries showing the most frequent HTTP response codes. Be careful not to select a high cardinality field, as Elasticsearch must load all unique values into memory."};var a={loading:!1,label:"Search",query:"*",ids:[],field:"_type",fields:[],spyable:!0,rest:!1,size:5,mode:"terms only",exclude:[],history:[],remember:10};n.defaults(t.panel,a),t.init=function(){t.editing=!1,t.panel.fields=s.list},t.get_data=function(){f(t.panel.query);if(o.indices.length===0)return;t.panelMeta.loading=!0;var e=t.ejs.Request().indices(o.indices);e=e.facet(t.ejs.TermsFacet("query").field(t.panel.field -).size(t.panel.size).exclude(t.panel.exclude).facetFilter(t.ejs.QueryFilter(t.ejs.FilteredQuery(t.ejs.QueryStringQuery(t.panel.query||"*"),u.getBoolFilter(u.ids))))).size(0),t.populate_modal(e);var r=e.doSearch();r.then(function(e){t.panelMeta.loading=!1;var r;t.panel.query===""||t.panel.mode==="terms only"?r="":t.panel.mode==="AND"?r=" AND ("+t.panel.query+")":t.panel.mode==="OR"&&(r=" OR ("+t.panel.query+")");var s=[],u=e.facets.query.terms,a=[];n.each(u,function(e){var n=t.panel.field+':"'+e.term+'"'+r,o=i.findQuery(n);o?s.push(o.id):s.push(i.set({alias:e.term,query:n})),a.push("NOT ("+n+")")});if(t.panel.rest){var f=a.join(" AND "),l=i.findQuery(f);l?s.push(l.id):s.push(i.set({alias:"other",query:f}))}n.each(n.difference(t.panel.ids,s),function(e){i.remove(e)}),t.panel.ids=s,o.refresh()})},t.set_refresh=function(e){t.refresh=e},t.close_edit=function(){t.refresh&&t.get_data(),t.refresh=!1},t.populate_modal=function(n){t.inspector=e.toJson(JSON.parse(n.toString()),!0)};var f=function( -e){e=n.isArray(e)?e:[e];if(t.panel.remember>0){t.panel.history=n.union(e.reverse(),t.panel.history);var r=t.panel.history.length;r>t.panel.remember&&(t.panel.history=t.panel.history.slice(0,t.panel.remember))}}}])}); \ No newline at end of file +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + +define("panels/derivequeries/module",["angular","app","underscore"],function(a,b,c){var d=a.module("kibana.panels.derivequeries",[]);b.useModule(d),d.controller("derivequeries",["$scope","$rootScope","querySrv","fields","dashboard","filterSrv",function(b,d,e,f,g,h){b.panelMeta={status:"Experimental",description:"Creates a new set of queries using the Elasticsearch terms facet. For example, you might want to create 5 queries showing the most frequent HTTP response codes. Be careful not to select a high cardinality field, as Elasticsearch must load all unique values into memory."};var i={loading:!1,label:"Search",query:"*",ids:[],field:"_type",fields:[],spyable:!0,rest:!1,size:5,mode:"terms only",exclude:[],history:[],remember:10};c.defaults(b.panel,i),b.init=function(){b.editing=!1,b.panel.fields=f.list},b.get_data=function(){if(j(b.panel.query),0!==g.indices.length){b.panelMeta.loading=!0;var a=b.ejs.Request().indices(g.indices);a=a.facet(b.ejs.TermsFacet("query").field(b.panel.field).size(b.panel.size).exclude(b.panel.exclude).facetFilter(b.ejs.QueryFilter(b.ejs.FilteredQuery(b.ejs.QueryStringQuery(b.panel.query||"*"),h.getBoolFilter(h.ids))))).size(0),b.populate_modal(a);var d=a.doSearch();d.then(function(a){b.panelMeta.loading=!1;var d;""===b.panel.query||"terms only"===b.panel.mode?d="":"AND"===b.panel.mode?d=" AND ("+b.panel.query+")":"OR"===b.panel.mode&&(d=" OR ("+b.panel.query+")");var f=[],h=a.facets.query.terms,i=[];if(c.each(h,function(a){var c=b.panel.field+':"'+a.term+'"'+d,g=e.findQuery(c);g?f.push(g.id):f.push(e.set({alias:a.term,query:c})),i.push("NOT ("+c+")")}),b.panel.rest){var j=i.join(" AND "),k=e.findQuery(j);k?f.push(k.id):f.push(e.set({alias:"other",query:j}))}c.each(c.difference(b.panel.ids,f),function(a){e.remove(a)}),b.panel.ids=f,g.refresh()})}},b.set_refresh=function(a){b.refresh=a},b.close_edit=function(){b.refresh&&b.get_data(),b.refresh=!1},b.populate_modal=function(c){b.inspector=a.toJson(JSON.parse(c.toString()),!0)};var j=function(a){if(a=c.isArray(a)?a:[a],b.panel.remember>0){b.panel.history=c.union(a.reverse(),b.panel.history);var d=b.panel.history.length;d>b.panel.remember&&(b.panel.history=b.panel.history.slice(0,b.panel.remember))}}}])}); \ No newline at end of file diff --git a/dist/app/panels/fields/editor.html b/dist/app/panels/fields/editor.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/fields/micropanel.html b/dist/app/panels/fields/micropanel.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/fields/module.html b/dist/app/panels/fields/module.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/fields/module.js b/dist/app/panels/fields/module.js old mode 100755 new mode 100644 index e7edfd74442..240cbb54cbc --- a/dist/app/panels/fields/module.js +++ b/dist/app/panels/fields/module.js @@ -1 +1,4 @@ -define("panels/fields/module",["angular","app","underscore"],function(e,t,n){var r=e.module("kibana.panels.fields",[]);t.useModule(r),r.controller("fields",["$scope",function(e){e.panelMeta={status:"Deprecated",description:"You should not use this table, it does not work anymore. The table panel nowintegrates a field selector. This module will soon be removed."};var t={style:{},arrange:"vertical",micropanel_position:"right"};n.defaults(e.panel,t),e.init=function(){}}])}); \ No newline at end of file +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + +define("panels/fields/module",["angular","app","underscore"],function(a,b,c){var d=a.module("kibana.panels.fields",[]);b.useModule(d),d.controller("fields",["$scope",function(a){a.panelMeta={status:"Deprecated",description:"You should not use this table, it does not work anymore. The table panel nowintegrates a field selector. This module will soon be removed."};var b={style:{},arrange:"vertical",micropanel_position:"right"};c.defaults(a.panel,b),a.init=function(){}}])}); \ No newline at end of file diff --git a/dist/app/panels/filtering/editor.html b/dist/app/panels/filtering/editor.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/filtering/meta.html b/dist/app/panels/filtering/meta.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/filtering/module.html b/dist/app/panels/filtering/module.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/filtering/module.js b/dist/app/panels/filtering/module.js old mode 100755 new mode 100644 index a9b63a9f6c4..34d747707f5 --- a/dist/app/panels/filtering/module.js +++ b/dist/app/panels/filtering/module.js @@ -1 +1,4 @@ -define("panels/filtering/module",["angular","app","underscore"],function(e,t,n){var r=e.module("kibana.panels.filtering",[]);t.useModule(r),r.controller("filtering",["$scope","filterSrv","$rootScope","dashboard",function(e,t,r,i){e.panelMeta={status:"Beta",description:"A controllable list of all filters currently applied to the dashboard. You almost certainly want one of these on your dashboard somewhere."};var s={};n.defaults(e.panel,s),e.init=function(){e.filterSrv=t},e.remove=function(e){t.remove(e),i.refresh()},e.toggle=function(e){t.list[e].active=!t.list[e].active,i.refresh()},e.refresh=function(){r.$broadcast("refresh")},e.render=function(){r.$broadcast("render")},e.show_key=function(e){return!n.contains(["type","id","alias","mandate","active","editing"],e)},e.isEditable=function(e){var t=["time"];return n.contains(t,e.type)?!1:!0}}])}); \ No newline at end of file +/*! kibana - v3.0.0m3pre - 2013-09-13 + * Copyright (c) 2013 Rashid Khan; Licensed Apache License */ + +define("panels/filtering/module",["angular","app","underscore"],function(a,b,c){var d=a.module("kibana.panels.filtering",[]);b.useModule(d),d.controller("filtering",["$scope","filterSrv","$rootScope","dashboard",function(a,b,d,e){a.panelMeta={status:"Beta",description:"A controllable list of all filters currently applied to the dashboard. You almost certainly want one of these on your dashboard somewhere."};var f={};c.defaults(a.panel,f),a.init=function(){a.filterSrv=b},a.remove=function(a){b.remove(a),e.refresh()},a.toggle=function(a){b.list[a].active=!b.list[a].active,e.refresh()},a.refresh=function(){d.$broadcast("refresh")},a.render=function(){d.$broadcast("render")},a.show_key=function(a){return!c.contains(["type","id","alias","mandate","active","editing"],a)},a.isEditable=function(a){var b=["time"];return c.contains(b,a.type)?!1:!0}}])}); \ No newline at end of file diff --git a/dist/app/panels/histogram/editor.html b/dist/app/panels/histogram/editor.html old mode 100755 new mode 100644 diff --git a/dist/app/panels/histogram/module.html b/dist/app/panels/histogram/module.html old mode 100755 new mode 100644 index d6198b9b8d6..27bef3b0351 --- a/dist/app/panels/histogram/module.html +++ b/dist/app/panels/histogram/module.html @@ -1,4 +1,4 @@ -