Version Description
- [New] We separated errors and notices in the log, to avoid confusion when users were trying to troubleshoot issues with the tracker.
- [Update] Because of old settings stuck in the database, some people were not able to uninstall the Browscap data file as expected.
- [Update] AmMap, the library used to render the world map, has been updated to version 3.20.17, released on October 24, 2016.
Download this release
Release Info
Developer | coolmann |
Plugin | Slimstat Analytics |
Version | 4.4.5 |
Comparing to | |
See all releases |
Code changes from version 4.4.4 to 4.4.5
- admin/config/maintenance.php +18 -10
- admin/js/ammap/ammap.js +212 -213
- admin/wp-slimstat-admin.php +6 -7
- browscap/browser.php +2 -5
- readme.txt +7 -40
- wp-slimstat.php +53 -53
admin/config/maintenance.php
CHANGED
@@ -68,13 +68,10 @@ if (!empty($_REQUEST['action'])){
|
|
68 |
break;
|
69 |
|
70 |
case 'download-browscap':
|
71 |
-
$error = wp_slimstat::update_browscap_database();
|
72 |
|
73 |
-
if (
|
74 |
-
wp_slimstat_admin::show_alert_message( $error, 'wp-ui-notification below-h2' );
|
75 |
-
}
|
76 |
-
else {
|
77 |
-
wp_slimstat_admin::show_alert_message( __( 'The Browscap data file has been installed on your server.', 'wp-slimstat' ), 'wp-ui-highlight below-h2' );
|
78 |
}
|
79 |
break;
|
80 |
|
@@ -88,10 +85,14 @@ if (!empty($_REQUEST['action'])){
|
|
88 |
}
|
89 |
break;
|
90 |
|
91 |
-
case 'reset-tracker-status':
|
92 |
wp_slimstat::$settings[ 'last_tracker_error' ] = array();
|
93 |
break;
|
94 |
|
|
|
|
|
|
|
|
|
95 |
case 'restore-views':
|
96 |
$GLOBALS['wpdb']->query("DELETE FROM {$GLOBALS['wpdb']->prefix}usermeta WHERE meta_key LIKE '%meta-box-order_admin_page_slimlayout%'");
|
97 |
$GLOBALS['wpdb']->query("DELETE FROM {$GLOBALS['wpdb']->prefix}usermeta WHERE meta_key LIKE '%mmetaboxhidden_admin_page_slimview%'");
|
@@ -151,10 +152,17 @@ $slim_browsers_exists =wp_slimstat::$wpdb->get_col( "SHOW TABLES LIKE '{$GLOBALS
|
|
151 |
<td colspan="2" class="slimstat-options-section-header" id="wp-slimstat-troubleshooting"><?php _e('Troubleshooting','wp-slimstat') ?></td>
|
152 |
</tr>
|
153 |
<tr>
|
154 |
-
<th scope="row"><?php _e('Tracker
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
<td>
|
156 |
-
<?php echo ( !empty( wp_slimstat::$settings[ '
|
157 |
-
<span class="description"><?php _e('The
|
158 |
</td>
|
159 |
</tr>
|
160 |
<tr class="alternate">
|
68 |
break;
|
69 |
|
70 |
case 'download-browscap':
|
71 |
+
$error = wp_slimstat::update_browscap_database( true );
|
72 |
|
73 |
+
if ( is_array( $error ) ) {
|
74 |
+
wp_slimstat_admin::show_alert_message( $error[ 1 ], ( empty( $error[ 0 ] ) ? 'wp-ui-highlight below-h2': 'wp-ui-notification below-h2' ) );
|
|
|
|
|
|
|
75 |
}
|
76 |
break;
|
77 |
|
85 |
}
|
86 |
break;
|
87 |
|
88 |
+
case 'reset-tracker-error-status':
|
89 |
wp_slimstat::$settings[ 'last_tracker_error' ] = array();
|
90 |
break;
|
91 |
|
92 |
+
case 'reset-tracker-notice-status':
|
93 |
+
wp_slimstat::$settings[ 'last_tracker_notice' ] = array();
|
94 |
+
break;
|
95 |
+
|
96 |
case 'restore-views':
|
97 |
$GLOBALS['wpdb']->query("DELETE FROM {$GLOBALS['wpdb']->prefix}usermeta WHERE meta_key LIKE '%meta-box-order_admin_page_slimlayout%'");
|
98 |
$GLOBALS['wpdb']->query("DELETE FROM {$GLOBALS['wpdb']->prefix}usermeta WHERE meta_key LIKE '%mmetaboxhidden_admin_page_slimview%'");
|
152 |
<td colspan="2" class="slimstat-options-section-header" id="wp-slimstat-troubleshooting"><?php _e('Troubleshooting','wp-slimstat') ?></td>
|
153 |
</tr>
|
154 |
<tr>
|
155 |
+
<th scope="row"><?php _e( 'Tracker Error', 'wp-slimstat' ) ?></th>
|
156 |
+
<td>
|
157 |
+
<?php echo ( !empty( wp_slimstat::$settings[ 'last_tracker_error' ][ 1 ] ) && !empty( wp_slimstat::$settings[ 'last_tracker_error' ][ 2 ] ) ) ? '<strong>[' . date_i18n( wp_slimstat::$settings[ 'date_format' ], wp_slimstat::$settings[ 'last_tracker_error' ][ 2 ], true ) . ' ' . date_i18n( wp_slimstat::$settings[ 'time_format' ], wp_slimstat::$settings[ 'last_tracker_error' ][ 2 ], true ) . '] ' . wp_slimstat::$settings[ 'last_tracker_error' ][ 0 ] . ' ' . wp_slimstat::$settings[ 'last_tracker_error' ][ 1 ] . '</strong><a class="slimstat-font-cancel" title="' . htmlentities( __( 'Reset this error', 'wp-slimstat' ), ENT_QUOTES, 'UTF-8' ) . '" href="' . wp_slimstat_admin::$config_url.$current_tab . '&action=reset-tracker-error-status"></a>' : __( 'So far so good.', 'wp-slimstat' ); ?>
|
158 |
+
<span class="description"><?php _e( 'The information here above is useful to troubleshoot issues with the tracker. <strong>Errors</strong> are returned when the tracker could not record a page view for some reason, and are indicative of some kind of malfunction. Please include the message here above when sending a support request.', 'wp-slimstat' ) ?></span>
|
159 |
+
</td>
|
160 |
+
</tr>
|
161 |
+
<tr>
|
162 |
+
<th scope="row"><?php _e( 'Tracker Notice', 'wp-slimstat' ) ?></th>
|
163 |
<td>
|
164 |
+
<?php echo ( !empty( wp_slimstat::$settings[ 'last_tracker_notice' ][ 1 ] ) && !empty( wp_slimstat::$settings[ 'last_tracker_notice' ][ 2 ] ) ) ? '<strong>[' . date_i18n( wp_slimstat::$settings[ 'date_format' ], wp_slimstat::$settings[ 'last_tracker_notice' ][ 2 ], true ) . ' ' . date_i18n( wp_slimstat::$settings[ 'time_format' ], wp_slimstat::$settings[ 'last_tracker_notice' ][ 2 ], true ) . '] ' . wp_slimstat::$settings[ 'last_tracker_notice' ][ 0 ] . ' ' . wp_slimstat::$settings[ 'last_tracker_notice' ][ 1 ] . '</strong><a class="slimstat-font-cancel" title="' . htmlentities( __( 'Reset this notice', 'wp-slimstat' ), ENT_QUOTES, 'UTF-8' ) . '" href="' . wp_slimstat_admin::$config_url.$current_tab . '&action=reset-tracker-notice-status"></a>' : __( 'So far so good.', 'wp-slimstat' ); ?>
|
165 |
+
<span class="description"><?php _e( 'The message here above will indicate if a page view was not recorded because it matched at least one of the conditions you configured in your settings (filters, blackslists, etc).', 'wp-slimstat' ) ?></span>
|
166 |
</td>
|
167 |
</tr>
|
168 |
<tr class="alternate">
|
admin/js/ammap/ammap.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
(function(){var d;window.AmCharts?d=window.AmCharts:(d={},window.AmCharts=d,d.themes={},d.maps={},d.inheriting={},d.charts=[],d.onReadyArray=[],d.useUTC=!1,d.updateRate=60,d.uid=0,d.lang={},d.translations={},d.mapTranslations={},d.windows={},d.initHandlers=[],d.amString="am",d.pmString="pm");d.Class=function(a){var b=function(){arguments[0]!==d.inheriting&&(this.events={},this.construct.apply(this,arguments))};a.inherits?(b.prototype=new a.inherits(d.inheriting),b.base=a.inherits.prototype,delete a.inherits):
|
2 |
(b.prototype.createEvents=function(){for(var a=0;a<arguments.length;a++)this.events[arguments[a]]=[]},b.prototype.listenTo=function(a,b,c){this.removeListener(a,b,c);a.events[b].push({handler:c,scope:this})},b.prototype.addListener=function(a,b,c){this.removeListener(this,a,b);a&&this.events[a]&&this.events[a].push({handler:b,scope:c})},b.prototype.removeListener=function(a,b,c){if(a&&a.events&&(a=a.events[b]))for(b=a.length-1;0<=b;b--)a[b].handler===c&&a.splice(b,1)},b.prototype.fire=function(a){for(var b=
|
3 |
-
this.events[a.type],c=0;c<b.length;c++){var d=b[c];d.handler.call(d.scope,a)}});for(var c in a)b.prototype[c]=a[c];return b};d.addChart=function(a){window.requestAnimationFrame?d.animationRequested||(d.animationRequested=!0,window.requestAnimationFrame(d.update)):d.updateInt||(d.updateInt=setInterval(function(){d.update()},Math.round(1E3/d.updateRate)));d.charts.push(a)};d.removeChart=function(a){for(var b=d.charts,c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1);0===b.length&&d.
|
4 |
-
d.updateInt=NaN)};d.isModern=!0;d.getIEVersion=function(){var a=0,b,c;"Microsoft Internet Explorer"==navigator.appName&&(b=navigator.userAgent,c=/MSIE ([0-9]{1,}[.0-9]{0,})/,null!==c.exec(b)&&(a=parseFloat(RegExp.$1)));return a};d.applyLang=function(a,b){var c=d.translations;b.dayNames=d.extend({},d.dayNames);b.shortDayNames=d.extend({},d.shortDayNames);b.monthNames=d.extend({},d.monthNames);b.shortMonthNames=d.extend({},d.shortMonthNames);
|
5 |
-
(b.dayNames=d.extend({},c.dayNames),b.shortDayNames=d.extend({},c.shortDayNames),b.monthNames=d.extend({},c.monthNames),b.shortMonthNames=d.extend({},c.shortMonthNames)),c.am&&(b.amString=c.am),c.pm&&(b.pmString=c.pm));d.amString=b.amString;d.pmString=b.pmString};d.IEversion=d.getIEVersion();9>d.IEversion&&0<d.IEversion&&(d.isModern=!1,d.isIE=!0);d.dx=0;d.dy=0;if(document.addEventListener||window.opera)d.isNN=!0,d.isIE
|
6 |
-
0,d.dy=0));window.chrome&&(d.chrome=!0);d.handleMouseUp=function(a){for(var b=d.charts,c=0;c<b.length;c++){var e=b[c];e&&e.handleReleaseOutside&&e.handleReleaseOutside(a)}};d.handleMouseMove=function(a){for(var b=d.charts,c=0;c<b.length;c++){var e=b[c];e&&e.handleMouseMove&&e.handleMouseMove(a)}};d.handleWheel=function(a){for(var b=d.charts,c=0;c<b.length;c++){var e=b[c];if(e&&e.mouseIsOver){e.mouseWheelScrollEnabled||
|
7 |
-
break}}};d.resetMouseOver=function(){for(var a=d.charts,b=0;b<a.length;b++){var c=a[b];c&&(c.mouseIsOver=!1)}};d.ready=function(a){d.onReadyArray.push(a)};d.handleLoad=function(){d.isReady=!0;for(var a=d.onReadyArray,b=0;b<a.length;b++){var c=a[b];isNaN(d.processDelay)?c():setTimeout(c,d.processDelay*b)}};d.addInitHandler=function(a,b){d.initHandlers.push({method:a,types:b})};d.callInitHandler=function(a){var b=d.initHandlers;if(d.initHandlers)for(var c=
|
8 |
-
a.type)&&e.method(a):e.method(a)}};d.getUniqueId=function(){d.uid++;return"AmChartsEl-"+d.uid};d.isNN&&(document.addEventListener("mousemove",d.handleMouseMove),document.addEventListener("mouseup",d.handleMouseUp,!0),window.addEventListener("load",d.handleLoad,!0),window.addEventListener("DOMMouseScroll",d.handleWheel,!0),document.addEventListener("mousewheel",d.handleWheel,!0));d.isIE&&(document.attachEvent("onmousemove",d.handleMouseMove),
|
9 |
-
d.handleLoad),document.attachEvent("onmousewheel",d.handleWheel));d.clear=function(){var a=d.charts;if(a)for(var b=a.length-1;0<=b;b--)a[b].clear();d.updateInt&&clearInterval(d.updateInt);d.charts=[];d.isNN&&(document.removeEventListener("mousemove",d.handleMouseMove,!0),document.removeEventListener("mouseup",d.handleMouseUp,!0),window.removeEventListener("load",
|
10 |
-
d.isIE&&(document.detachEvent("onmousemove",d.handleMouseMove),document.detachEvent("onmouseup",d.handleMouseUp),window.detachEvent("onload",d.handleLoad))};d.makeChart=function(a,b,c){var e=b.type,f=b.theme;d.isString(f)&&(f=d.themes[f],b.theme=f);var g;switch(e){case "serial":g=new d.AmSerialChart(f);break;case "xy":g=new d.AmXYChart(f);break;case "pie":g=new d.AmPieChart(f);
|
11 |
-
break;case "map":g=new d.AmMap(f);break;case "stock":g=new d.AmStockChart(f);break;case "gantt":g=new d.AmGanttChart(f)}d.extend(g,b);d.isReady?isNaN(c)?g.write(a):setTimeout(function(){d.realWrite(g,a)},c):d.ready(function(){isNaN(c)?g.write(a):setTimeout(function(){d.realWrite(g,a)},c)});return g};d.realWrite=function(a,b){a.write(b)};d.updateCount=0;d.validateAt=
|
12 |
-
0);if(a)for(var c=a.length-1;0<=c;c--)a[c].update&&a[c].update(),b&&(a[c].autoResize?a[c].validateSize&&a[c].validateSize():a[c].premeasure&&a[c].premeasure());window.requestAnimationFrame&&window.requestAnimationFrame(d.update)};d.bezierX=3;d.bezierY=6;"complete"==document.readyState&&d.handleLoad()})();(function(){var d=window.AmCharts;d.toBoolean=function(a,b){if(void 0===a)return b;switch(String(a).toLowerCase()){case "true":case "yes":case "1":return!0;case "false":case "no":case "0":case null:return!1;default:return!!a}};d.removeFromArray=function(a,b){var c;if(void 0!==b&&void 0!==a)for(c=a.length-1;0<=c;c--)a[c]==b&&a.splice(c,1)};d.getPath=function(){var a=document.getElementsByTagName("script");if(a)for(var b=0;b<a.length;b++){var c=a[b].src;if(-1!==c.search(/\/(amcharts|ammap)\.js/))return c.replace(/\/(amcharts|ammap)\.js.*/,
|
13 |
"/")}};d.normalizeUrl=function(a){return""!==a&&-1===a.search(/\/$/)?a+"/":a};d.isAbsolute=function(a){return 0===a.search(/^http[s]?:|^\//)};d.isInArray=function(a,b){for(var c=0;c<a.length;c++)if(a[c]==b)return!0;return!1};d.getDecimals=function(a){var b=0;isNaN(a)||(a=String(a),-1!=a.indexOf("e-")?b=Number(a.split("-")[1]):-1!=a.indexOf(".")&&(b=a.split(".")[1].length));return b};d.wordwrap=function(a,b,c,e){var f,g,h,k;a+="";if(1>b)return a;f=-1;for(a=(k=a.split(/\r\n|\n|\r/)).length;++f<a;k[f]+=
|
14 |
h){h=k[f];for(k[f]="";h.length>b;k[f]+=d.trim(h.slice(0,g))+((h=h.slice(g)).length?c:""))g=2==e||(g=h.slice(0,b+1).match(/\S*(\s)?$/))[1]?b:g.input.length-g[0].length||1==e&&b||g.input.length+(g=h.slice(b).match(/^\S*/))[0].length;h=d.trim(h)}return k.join(c)};d.trim=function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};d.wrappedText=function(a,b,c,e,f,g,h,k){var l=d.text(a,b,c,e,f,g,h);if(l){var m=l.getBBox();if(m.width>k){var n="\n";d.isModern||(n="<br>");k=Math.floor(k/(m.width/
|
15 |
b.length));2<k&&(k-=2);b=d.wordwrap(b,k,n,!0);l.remove();l=d.text(a,b,c,e,f,g,h)}}return l};d.getStyle=function(a,b){var c="";if(document.defaultView&&document.defaultView.getComputedStyle)try{c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b)}catch(e){}else a.currentStyle&&(b=b.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),c=a.currentStyle[b]);return c};d.removePx=function(a){if(void 0!==a)return Number(a.substring(0,a.length-2))};d.getURL=function(a,b){if(a)if("_self"!=
|
@@ -23,13 +23,13 @@ a[1]?a[0]+b+a[1]:a[0]};d.scientificToNormal=function(a){var b;a=String(a).split(
|
|
23 |
function(){return"#"+("00000"+(16777216*Math.random()<<0).toString(16)).substr(-6)};d.hitTest=function(a,b,c){var e=!1,f=a.x,g=a.x+a.width,h=a.y,k=a.y+a.height,l=d.isInRectangle;e||(e=l(f,h,b));e||(e=l(f,k,b));e||(e=l(g,h,b));e||(e=l(g,k,b));e||!0===c||(e=d.hitTest(b,a,!0));return e};d.isInRectangle=function(a,b,c){return a>=c.x-5&&a<=c.x+c.width+5&&b>=c.y-5&&b<=c.y+c.height+5?!0:!1};d.isPercents=function(a){if(-1!=String(a).indexOf("%"))return!0};d.formatValue=function(a,b,c,e,f,g,h,k){if(b){void 0===
|
24 |
f&&(f="");var l;for(l=0;l<c.length;l++){var m=c[l],n=b[m];void 0!==n&&(n=g?d.addPrefix(n,k,h,e):d.formatNumber(n,e),a=a.replace(new RegExp("\\[\\["+f+""+m+"\\]\\]","g"),n))}}return a};d.formatDataContextValue=function(a,b){if(a){var c=a.match(/\[\[.*?\]\]/g),e;for(e=0;e<c.length;e++){var d=c[e],d=d.substr(2,d.length-4);void 0!==b[d]&&(a=a.replace(new RegExp("\\[\\["+d+"\\]\\]","g"),b[d]))}}return a};d.massReplace=function(a,b){for(var c in b)if(b.hasOwnProperty(c)){var e=b[c];void 0===e&&(e="");a=
|
25 |
a.replace(c,e)}return a};d.cleanFromEmpty=function(a){return a.replace(/\[\[[^\]]*\]\]/g,"")};d.addPrefix=function(a,b,c,e,f){var g=d.formatNumber(a,e),h="",k,l,m;if(0===a)return"0";0>a&&(h="-");a=Math.abs(a);if(1<a)for(k=b.length-1;-1<k;k--){if(a>=b[k].number&&(l=a/b[k].number,m=Number(e.precision),1>m&&(m=1),c=d.roundTo(l,m),m=d.formatNumber(c,{precision:-1,decimalSeparator:e.decimalSeparator,thousandsSeparator:e.thousandsSeparator}),!f||l==c)){g=h+""+m+""+b[k].prefix;break}}else for(k=0;k<c.length;k++)if(a<=
|
26 |
-
c[k].number){l=a/c[k].number;m=Math.abs(Math.floor(Math.log(l)*Math.LOG10E));l=d.roundTo(l,m);g=h+""+l+""+c[k].prefix;break}return g};d.remove=function(a){a&&a.remove()};d.getEffect=function(a){">"==a&&(a="easeOutSine");"<"==a&&(a="easeInSine");"elastic"==a&&(a="easeOutElastic");return a};d.getObjById=function(a,b){var c,e;for(e=0;e<a.length;e++){var d=a[e];if(d.id==b){c=d;break}}return c};d.applyTheme=function(a,b,c){b||(b=d.theme);b&&b[c]&&d.extend(a,
|
27 |
-
typeof a?!0:!1};d.extend=function(a,b,c){var e;a||(a={});for(e in b)c?a.hasOwnProperty(e)||(a[e]=b[e]):a[e]=b[e];return a};d.copyProperties=function(a,b){for(var c in a)a.hasOwnProperty(c)&&"events"!=c&&void 0!==a[c]&&"function"!=typeof a[c]&&"cname"!=c&&(b[c]=a[c])};d.processObject=function(a,b,c,e){if(!1===a instanceof b&&(a=e?d.extend(new b(c),a):d.extend(a,new b(c),!0),a.listeners))for(var f in a.listeners)b=a.listeners[f],a.addListener(b.event,b.method);
|
28 |
-
RegExp("\\n","g");a&&(a=a.replace(b,"<br />"));return a};d.fixBrakes=function(a){if(d.isModern){var b=RegExp("<br>","g");a&&(a=a.replace(b,"\n"))}else a=d.fixNewLines(a);return a};d.deleteObject=function(a,b){if(a){if(void 0===b||null===b)b=20;if(0!==b)if("[object Array]"===Object.prototype.toString.call(a))for(var c=0;c<a.length;c++)d.deleteObject(a[c],b-1),a[c]=null;else if(a&&!a.tagName)try{for(c in a)a[c]&&("object"==typeof a[c]&&d.deleteObject(a[c],
|
29 |
-
d.bounce=function(a,b,c,e,d){return(b/=d)<1/2.75?7.5625*e*b*b+c:b<2/2.75?e*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?e*(7.5625*(b-=2.25/2.75)*b+.9375)+c:e*(7.5625*(b-=2.625/2.75)*b+.984375)+c};d.easeInOutQuad=function(a,b,c,e,d){b/=d/2;if(1>b)return e/2*b*b+c;b--;return-e/2*(b*(b-2)-1)+c};d.easeInSine=function(a,b,c,e,d){return-e*Math.cos(b/d*(Math.PI/2))+e+c};d.easeOutSine=function(a,b,c,e,d){return e*Math.sin(b/d*(Math.PI/2))+c};d.easeOutElastic=
|
30 |
-
b)return c;if(1==(b/=d))return c+e;g||(g=.3*d);h<Math.abs(e)?(h=e,a=g/4):a=g/(2*Math.PI)*Math.asin(e/h);return h*Math.pow(2,-10*b)*Math.sin(2*(b*d-a)*Math.PI/g)+e+c};d.fixStepE=function(a){a=a.toExponential(0).split("e");var b=Number(a[1]);9==Number(a[0])&&b++;return d.generateNumber(1,b)};d.generateNumber=function(a,b){var c="",e;e=0>b?Math.abs(b)-1:Math.abs(b);var d;for(d=0;d<e;d++)c+="0";return 0>b?Number("0."+c+String(a)):Number(String(a)+c)};d.setCN=
|
31 |
-
b.node)&&c){var d=b.getAttribute("class");a=a.classNamePrefix+"-";e&&(a="");d?b.setAttribute("class",d+" "+a+c):b.setAttribute("class",a+c)}};d.removeCN=function(a,b,c){b&&(b=b.node)&&c&&(b=b.classList)&&b.remove(a.classNamePrefix+"-"+c)};d.parseDefs=function(a,b){for(var c in a){var e=typeof a[c];if(0<a[c].length&&"object"==e)for(var f=0;f<a[c].length;f++)e=document.createElementNS(d.SVG_NS,c),b.appendChild(e),d.parseDefs(a[c][f],e);else"object"==e?(e=
|
32 |
-
d.parseDefs(a[c],e)):b.setAttribute(c,a[c])}}})();(function(){var d=window.AmCharts;d.AmDraw=d.Class({construct:function(a,b,c,e){d.SVG_NS="http://www.w3.org/2000/svg";d.SVG_XLINK="http://www.w3.org/1999/xlink";d.hasSVG=!!document.createElementNS&&!!document.createElementNS(d.SVG_NS,"svg").createSVGRect;1>b&&(b=10);1>c&&(c=10);this.div=a;this.width=b;this.height=c;this.rBin=document.createElement("div");d.hasSVG?(d.SVG=!0,b=this.createSvgElement("svg"),a.appendChild(b),this.container=b,this.addDefs(e),this.R=new d.SVGRenderer(this)):d.isIE&&d.VMLRenderer&&
|
33 |
(d.VML=!0,d.vmlStyleSheet||(document.namespaces.add("amvml","urn:schemas-microsoft-com:vml"),31>document.styleSheets.length?(b=document.createStyleSheet(),b.addRule(".amvml","behavior:url(#default#VML); display:inline-block; antialias:true"),d.vmlStyleSheet=b):document.styleSheets[0].addRule(".amvml","behavior:url(#default#VML); display:inline-block; antialias:true")),this.container=a,this.R=new d.VMLRenderer(this,e),this.R.disableSelection(a))},createSvgElement:function(a){return document.createElementNS(d.SVG_NS,
|
34 |
a)},circle:function(a,b,c,e){var f=new d.AmDObject("circle",this);f.attr({r:c,cx:a,cy:b});this.addToContainer(f.node,e);return f},ellipse:function(a,b,c,e,f){var g=new d.AmDObject("ellipse",this);g.attr({rx:c,ry:e,cx:a,cy:b});this.addToContainer(g.node,f);return g},setSize:function(a,b){0<a&&0<b&&(this.container.style.width=a+"px",this.container.style.height=b+"px")},rect:function(a,b,c,e,f,g,h){var k=new d.AmDObject("rect",this);d.VML&&(f=Math.round(100*f/Math.min(c,e)),c+=2*g,e+=2*g,k.bw=g,k.node.style.marginLeft=
|
35 |
-g,k.node.style.marginTop=-g);1>c&&(c=1);1>e&&(e=1);k.attr({x:a,y:b,width:c,height:e,rx:f,ry:f,"stroke-width":g});this.addToContainer(k.node,h);return k},image:function(a,b,c,e,f,g){var h=new d.AmDObject("image",this);h.attr({x:b,y:c,width:e,height:f});this.R.path(h,a);this.addToContainer(h.node,g);return h},addToContainer:function(a,b){b||(b=this.container);b.appendChild(a)},text:function(a,b,c){return this.R.text(a,b,c)},path:function(a,b,c,e){var f=new d.AmDObject("path",this);e||(e="100,100");
|
@@ -49,102 +49,101 @@ move:function(a,b,c,e){isNaN(b)&&(b=0);isNaN(c)&&(c=0);b="translate("+b+","+c+")
|
|
49 |
g&&this.D.remove(g);b=document.createElementNS(d.SVG_NS,b);g=d.getUniqueId();b.setAttribute("id",g);if(!isNaN(e)){var h=0,k=0,l=0,m=0;90==e?l=100:270==e?m=100:180==e?h=100:0===e&&(k=100);b.setAttribute("x1",h+"%");b.setAttribute("x2",k+"%");b.setAttribute("y1",l+"%");b.setAttribute("y2",m+"%")}for(e=0;e<c.length;e++)h=document.createElementNS(d.SVG_NS,"stop"),k=100*e/(c.length-1),0===e&&(k=0),h.setAttribute("offset",k+"%"),h.setAttribute("stop-color",c[e]),b.appendChild(h);f.parentNode.appendChild(b);
|
50 |
c="#";d.baseHref&&!d.isIE&&(c=this.removeTarget(window.location.href)+c);f.setAttribute("fill","url("+c+g+")");a.grad=b},removeTarget:function(a){return a.split("#")[0]},pattern:function(a,b,c,e){var f=a.node;isNaN(c)&&(c=1);var g=a.patternNode;g&&this.D.remove(g);var g=document.createElementNS(d.SVG_NS,"pattern"),h=d.getUniqueId(),k=b;b.url&&(k=b.url);d.isAbsolute(k)||-1!=k.indexOf("data:image")||(k=e+k);e=Number(b.width);isNaN(e)&&(e=4);var l=Number(b.height);isNaN(l)&&(l=4);e/=c;l/=c;c=b.x;isNaN(c)&&
|
51 |
(c=0);var m=-Math.random()*Number(b.randomX);isNaN(m)||(c=m);m=b.y;isNaN(m)&&(m=0);var n=-Math.random()*Number(b.randomY);isNaN(n)||(m=n);g.setAttribute("id",h);g.setAttribute("width",e);g.setAttribute("height",l);g.setAttribute("patternUnits","userSpaceOnUse");g.setAttribute("xlink:href",k);b.color&&(n=document.createElementNS(d.SVG_NS,"rect"),n.setAttributeNS(null,"height",e),n.setAttributeNS(null,"width",l),n.setAttributeNS(null,"fill",b.color),g.appendChild(n));this.D.image(k,0,0,e,l,g).translate(c,
|
52 |
-
m);k="#";d.baseHref&&!d.isIE&&(k=this.removeTarget(window.location.href)+k);f.setAttribute("fill","url("+k+h+")");a.patternNode=g;f.parentNode.appendChild(g)},remove:function(a){a.clipPath&&this.D.remove(a.clipPath);a.grad&&this.D.remove(a.grad);a.patternNode&&this.D.remove(a.patternNode);this.D.remove(a.node)}})})();(function(){var d=window.AmCharts;d.AmChart=d.Class({construct:function(a){this.svgIcons=this.tapToActivate=!0;this.theme=a;this.classNamePrefix="amcharts";this.addClassNames=!1;this.version="3.20.
|
53 |
0;this.color=this.borderColor="#000000";this.fontFamily="Verdana";this.fontSize=11;this.usePrefixes=!1;this.autoResize=!0;this.autoDisplay=!1;this.addCodeCredits=this.accessible=!0;this.touchStartTime=this.touchClickDuration=0;this.precision=-1;this.percentPrecision=2;this.decimalSeparator=".";this.thousandsSeparator=",";this.labels=[];this.allLabels=[];this.titles=[];this.marginRight=this.marginLeft=this.autoMarginOffset=0;this.timeOuts=[];this.creditsPosition="top-left";var b=document.createElement("div"),
|
54 |
c=b.style;c.overflow="hidden";c.position="relative";c.textAlign="left";this.chartDiv=b;b=document.createElement("div");c=b.style;c.overflow="hidden";c.position="relative";c.textAlign="left";this.legendDiv=b;this.titleHeight=0;this.hideBalloonTime=150;this.handDrawScatter=2;this.cssScale=this.handDrawThickness=1;this.cssAngle=0;this.prefixesOfBigNumbers=[{number:1E3,prefix:"k"},{number:1E6,prefix:"M"},{number:1E9,prefix:"G"},{number:1E12,prefix:"T"},{number:1E15,prefix:"P"},{number:1E18,prefix:"E"},
|
55 |
-
{number:1E21,prefix:"Z"},{number:1E24,prefix:"Y"}];this.prefixesOfSmallNumbers=[{number:1E-24,prefix:"y"},{number:1E-21,prefix:"z"},{number:1E-18,prefix:"a"},{number:1E-15,prefix:"f"},{number:1E-12,prefix:"p"},{number:1E-9,prefix:"n"},{number:1E-6,prefix:"\u03bc"},{number:.001,prefix:"m"}];this.panEventsEnabled=!0;this.product="amcharts";this.animations=[];this.balloon=new d.AmBalloon(this.theme);this.balloon.chart=this;this.processTimeout=0;this.processCount=1E3;this.animatable=[];
|
56 |
-
a,"AmChart")},drawChart:function(){0<this.realWidth&&0<this.realHeight&&(this.drawBackground(),this.redrawLabels(),this.drawTitles(),this.brr(),this.renderFix(),this.chartDiv&&(this.boundingRect=this.chartDiv.getBoundingClientRect()))},makeAccessible:function(a,b,c){this.accessible&&a&&(c&&a.setAttr("role",c),a.setAttr("aria-label",b))},drawBackground:function(){d.remove(this.background);var a=this.container,b=this.backgroundColor,c=this.backgroundAlpha,e=this.set;d.isModern||0!==
|
57 |
-
this.updateWidth();this.realWidth=f;var g=this.updateHeight();this.realHeight=g;b=d.polygon(a,[0,f-1,f-1,0],[0,0,g-1,g-1],b,c,1,this.borderColor,this.borderAlpha);d.setCN(this,b,"bg");this.background=b;e.push(b);if(b=this.backgroundImage)a=a.image(b,0,0,f,g),d.setCN(this,b,"bg-image"),this.bgImg=a,e.push(a)},drawTitles:function(a){var b=this.titles;this.titleHeight=0;if(d.ifArray(b)){var c=20,e;for(e=0;e<b.length;e++){var f=b[e],f=d.processObject(f,d.Title,this.theme);if(!1!==f.enabled){var g=
|
58 |
-
void 0===g&&(g=this.color);var h=f.size;isNaN(h)&&(h=this.fontSize+2);isNaN(f.alpha);var k=this.marginLeft,l=!0;void 0!==f.bold&&(l=f.bold);g=d.wrappedText(this.container,f.text,g,this.fontFamily,h,"middle",l,this.realWidth-35);g.translate(k+(this.realWidth-this.marginRight-k)/2,c);g.node.style.pointerEvents="none";f.sprite=g;void 0!==f.tabIndex&&g.setAttr("tabindex",f.tabIndex);d.setCN(this,g,"title");f.id&&d.setCN(this,g,"title-"+f.id);g.attr({opacity:f.alpha});c+=g.getBBox().height+5;a?
|
59 |
-
this.freeLabelsSet.push(g)}}this.titleHeight=c-10}},write:function(a){var b=this;if(b.listeners)for(var c=0;c<b.listeners.length;c++){var e=b.listeners[c];b.addListener(e.event,e.method)}b.fire({type:"buildStarted",chart:b});b.afterWriteTO&&clearTimeout(b.afterWriteTO);0<b.processTimeout?b.afterWriteTO=setTimeout(function(){b.afterWrite.call(b,a)},b.processTimeout):b.afterWrite(a)},afterWrite:function(a){if(
|
60 |
-
this.div=
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
void 0===this.
|
65 |
-
|
66 |
-
|
67 |
-
d.remove(this.
|
68 |
-
|
69 |
-
|
70 |
-
(
|
71 |
-
|
72 |
-
|
73 |
-
clear:function(a){
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
b)},!0),
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
var
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
b&&(l=d-k-5,m=g-a-3);"top-right"==b&&(l=d-k-5,m=e+5);h.left=l+"px";h.top=m+"px"}}}});d.Slice=d.Class({construct:function(){}});d.SerialDataItem=d.Class({construct:function(){}});d.GraphDataItem=d.Class({construct:function(){}});d.Guide=d.Class({construct:function(a){this.cname="Guide";d.applyTheme(this,a,this.cname)}});d.Title=d.Class({construct:function(a){this.cname="Title";d.applyTheme(this,a,this.cname)}});d.Label=d.Class({construct:function(a){this.cname="Label";d.applyTheme(this,a,this.cname)}})})();(function(){var d=window.AmCharts;d.AmBalloon=d.Class({construct:function(a){this.cname="AmBalloon";this.enabled=!0;this.fillColor="#FFFFFF";this.fillAlpha=.8;this.borderThickness=2;this.borderColor="#FFFFFF";this.borderAlpha=1;this.cornerRadius=0;this.maxWidth=220;this.horizontalPadding=8;this.verticalPadding=4;this.pointerWidth=6;this.pointerOrientation="V";this.color="#000000";this.adjustBorderColor=!0;this.show=this.follow=this.showBullet=!1;this.bulletSize=3;this.shadowAlpha=.4;this.shadowColor=
|
98 |
"#000000";this.fadeOutDuration=this.animationDuration=.3;this.fixedPosition=!0;this.offsetY=6;this.offsetX=1;this.textAlign="center";this.disableMouseEvents=!0;this.deltaSignX=this.deltaSignY=1;d.isModern||(this.offsetY*=1.5);this.sdy=this.sdx=0;d.applyTheme(this,a,this.cname)},draw:function(){var a=this.pointToX,b=this.pointToY;d.isModern||(this.drop=!1);var c=this.chart;d.VML&&(this.fadeOutDuration=0);this.xAnim&&c.stopAnim(this.xAnim);this.yAnim&&c.stopAnim(this.yAnim);this.sdy=this.sdx=0;if(!isNaN(a)){var e=
|
99 |
-
this.follow,f=c.container,g=this.set;d.remove(g);this.removeDiv();g=f.set();g.node.style.pointerEvents="none";this.set=g;this.mainSet?(this.mainSet.push(this.set),this.sdx=this.mainSet.x,this.sdy=this.mainSet.y):c.balloonsSet.push(g);if(this.show){var h=this.l,k=this.t,l=this.r,m=this.b,n=this.balloonColor,q=this.fillColor,
|
100 |
-
v=c.fontFamily,
|
101 |
-
v+'">'+this.text+"</div>";c.chartDiv.appendChild(n);this.textDiv=n;var F=n.offsetWidth,E=n.offsetHeight;n.clientHeight&&(F=n.clientWidth,E=n.clientHeight);v=E+2*y;z=F+2*p;!isNaN(
|
102 |
-
|
103 |
-
G,
|
104 |
-
d.setCN(c,q,"balloon-bg-"+this.className);f=1*this.deltaSignX;m+=this.sdx;k+=this.sdy;C.left=m+"px";C.top=k+"px";g.translate(
|
105 |
-
"px"),this.yAnim=c.animate({node:n},"top",this.prevTY,k,b,"easeOutSine","px")));this.prevX=
|
106 |
this.sdy;this.pointToX=a;this.pointToY=b;if(a!=this.previousX||b!=this.previousY)if(this.previousX=a,this.previousY=b,0===this.cornerRadius)this.draw();else{var c=this.set;if(c){var e=c.getBBox(),a=a-e.width/2,d=b-e.height-10;a<this.l&&(a=this.l);a>this.r-e.width&&(a=this.r-e.width);d<this.t&&(d=b+10);c.translate(a,d);b=this.textDiv.style;b.left=a+this.horizontalPadding+"px";b.top=d+this.verticalPadding+"px"}}}},changeColor:function(a){this.balloonColor=a},setBounds:function(a,b,c,e){this.l=a;this.t=
|
107 |
b;this.r=c;this.b=e;this.destroyTO&&clearTimeout(this.destroyTO)},showBalloon:function(a){if(this.text!=a||this.positionChanged)this.text=a,this.isHiding=!1,this.show=!0,this.destroyTO&&clearTimeout(this.destroyTO),a=this.chart,this.fadeAnim1&&a.stopAnim(this.fadeAnim1),this.fadeAnim2&&a.stopAnim(this.fadeAnim2),this.draw(),this.positionChanged=!1},hide:function(a){var b=this;b.text=void 0;isNaN(a)&&(a=b.fadeOutDuration);var c=b.chart;if(0<a&&!b.isHiding){b.isHiding=!0;b.destroyTO&&clearTimeout(b.destroyTO);
|
108 |
b.destroyTO=setTimeout(function(){b.destroy.call(b)},1E3*a);b.follow=!1;b.show=!1;var e=b.set;e&&(e.setAttr("opacity",b.fillAlpha),b.fadeAnim1=e.animate({opacity:0},a,"easeInSine"));b.textDiv&&(b.fadeAnim2=c.animate({node:b.textDiv},"opacity",1,0,a,"easeInSine",""))}else b.show=!1,b.follow=!1,b.destroy()},setPosition:function(a,b){if(a!=this.pointToX||b!=this.pointToY)this.previousX=this.pointToX,this.previousY=this.pointToY,this.pointToX=a,this.pointToY=b,this.positionChanged=!0},followCursor:function(a){var b=
|
109 |
this;b.follow=a;clearInterval(b.interval);var c=b.chart.mouseX-b.sdx,e=b.chart.mouseY-b.sdy;!isNaN(c)&&a&&(b.pointToX=c-b.offsetX*b.deltaSignX,b.pointToY=e,b.followMouse(),b.interval=setInterval(function(){b.followMouse.call(b)},40))},removeDiv:function(){if(this.textDiv){var a=this.textDiv.parentNode;a&&a.removeChild(this.textDiv)}},destroy:function(){clearInterval(this.interval);d.remove(this.set);this.removeDiv();this.set=null}})})();(function(){var d=window.AmCharts;d.circle=function(a,b,c,e,f,g,h,k,l){0>=b&&(b=.001);if(void 0==f||0===f)f=.01;void 0===g&&(g="#000000");void 0===h&&(h=0);e={fill:c,stroke:g,"fill-opacity":e,"stroke-width":f,"stroke-opacity":h};a=isNaN(l)?a.circle(0,0,b).attr(e):a.ellipse(0,0,b,l).attr(e);k&&a.gradient("radialGradient",[c,d.adjustLuminosity(c,-.6)]);return a};d.text=function(a,b,c,e,f,g,h,k){g||(g="middle");"right"==g&&(g="end");"left"==g&&(g="start");isNaN(k)&&(k=1);void 0!==b&&(b=String(b),d.isIE&&
|
110 |
-
!d.isModern&&(b=b.replace("&","&"),b=b.replace("&","&")));c={fill:c,"font-family":e,"font-size":f+"px",opacity:k};!0===h&&(c["font-weight"]="bold");c["text-anchor"]=g;return a.text(b,c)};d.polygon=function(a,b,c,e,f,g,h,k,l,m,n){isNaN(g)&&(g=.01);isNaN(k)&&(k=f);var q=e,
|
111 |
-
c,a.handDrawScatter),b=c[0],c=c[1]);h=Math.round;m&&(b[
|
112 |
-
(q=q[0],
|
113 |
-
2,c/2,c/2,-c/2],[c/2,c/2,-c/2,-c/2],e,f,g,h,k,m-180,void 0,
|
114 |
-
g,h,k,!0);break;case "line":
|
115 |
k&&(k=0);e={fill:e,stroke:h,"fill-opacity":d,"stroke-width":g,"stroke-opacity":k};b/=2;var l;0===c&&(l=" M"+-b+","+b+" L0,"+-b+" L"+b+","+b+" Z");180==c&&(l=" M"+-b+","+-b+" L0,"+b+" L"+b+","+-b+" Z");90==c&&(l=" M"+-b+","+-b+" L"+b+",0 L"+-b+","+b+" Z");270==c&&(l=" M"+-b+",0 L"+b+","+b+" L"+b+","+-b+" Z");return a.path(l).attr(e)};d.line=function(a,b,c,e,f,g,h,k,l,m,n){if(a.handDrawn&&!n)return d.handDrawnLine(a,b,c,e,f,g,h,k,l,m,n);g={fill:"none","stroke-width":g};void 0!==h&&0<h&&(g["stroke-dasharray"]=
|
116 |
h);isNaN(f)||(g["stroke-opacity"]=f);e&&(g.stroke=e);e=Math.round;m&&(e=Number,b[0]=d.roundTo(b[0],5),c[0]=d.roundTo(c[0],5));m=d.dx;f=d.dy;h="M"+(e(b[0])+m)+","+(e(c[0])+f);for(k=1;k<b.length;k++)b[k]=d.roundTo(b[k],5),c[k]=d.roundTo(c[k],5),h+=" L"+(e(b[k])+m)+","+(e(c[k])+f);if(d.VML)return a.path(h,void 0,!0).attr(g);l&&(h+=" M0,0 L0,0");return a.path(h).attr(g)};d.makeHD=function(a,b,c){for(var e=[],d=[],g=1;g<a.length;g++)for(var h=Number(a[g-1]),k=Number(b[g-1]),l=Number(a[g]),m=Number(b[g]),
|
117 |
-
n=Math.round(Math.sqrt(Math.pow(l-h,2)+Math.pow(m-k,2))/50)+1,l=(l-h)/n,m=(m-k)/n,q=0;q<=n;q++){var
|
118 |
-
function(a){return a};d.drop=function(a,b,c,e,d,g,h,k){var l=1/180*Math.PI,m=c-20,n=Math.sin(m*l)*b,q=Math.cos(m*l)*b,
|
119 |
-
void 0,"1000,1000").attr(c)};d.wedge=function(a,b,c,e,f,g,h,k,l,m,n,q,t
|
120 |
-
var G;
|
121 |
-
(l+c+y)+","+F+","+(l+
|
122 |
-
"1000,1000").attr(E);e.push(D);e.push(l)}
|
123 |
-
e.push(k));a=a.path(h+" Z",void 0,void 0,"1000,1000").attr(m);if(n){k=[];for(y=0;y<n.length;y++)k.push(d.adjustLuminosity(m.fill,n[y]));"radial"!=
|
124 |
4===a.length?"#"+("0"+parseInt(a[1],10).toString(16)).slice(-2)+("0"+parseInt(a[2],10).toString(16)).slice(-2)+("0"+parseInt(a[3],10).toString(16)).slice(-2):""};d.adjustLuminosity=function(a,b){a&&-1!=a.indexOf("rgb")&&(a=d.rgb2hex(a));a=String(a).replace(/[^0-9a-f]/gi,"");6>a.length&&(a=String(a[0])+String(a[0])+String(a[1])+String(a[1])+String(a[2])+String(a[2]));b=b||0;var c="#",e,f;for(f=0;3>f;f++)e=parseInt(a.substr(2*f,2),16),e=Math.round(Math.min(Math.max(0,e+e*b),255)).toString(16),c+=("00"+
|
125 |
-
e).substr(e.length);return c}})();(function(){var d=window.AmCharts;d.AmLegend=d.Class({construct:function(a){this.enabled=!0;this.cname="AmLegend";this.createEvents("rollOverMarker","rollOverItem","rollOutMarker","rollOutItem","showItem","hideItem","clickMarker","
|
126 |
-
|
127 |
-
|
128 |
-
this.
|
129 |
-
b?
|
130 |
-
|
131 |
-
this.
|
132 |
-
|
133 |
-
|
134 |
-
a.legendEntryWidth=b.markerSize;
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
b){this.switchable&&this.dispatch("rollOutMarker",a,b);this.dispatch("rollOutItem",a,b)},clickMarker:function(a,b){this.switchable&&(!0===a.hidden?this.dispatch("showItem",a,b):this.dispatch("hideItem",a,b));this.dispatch("clickMarker",a,b)},rollOverLabel:function(a,b){a.hidden||
|
141 |
-
this.selectedColor&&a.showBalloon&&(c=this.selectedColor);this.useMarkerColorForLabels&&(c=a.lineColor,void 0===c&&(c=a.color));a.legendLabel.attr({fill:c})}this.dispatch("rollOutItem",a,b)}
|
142 |
this.fire(a)},createValue:function(a){var b=this,c=b.fontSize,e=b.chart;if(!1!==a.visibleInLegend&&!a.hideFromLegend){var f=b.maxLabelWidth;b.forceWidth&&(f=b.labelWidth);b.equalWidths||(b.valueAlign="left");"left"==b.valueAlign&&a.legendLabel&&(f=a.legendLabel.getBBox().width);var g=f;if(b.valueText&&0<b.valueWidth){var h=b.color;b.useMarkerColorForValues&&(h=a.color,a.legendKeyColor&&(h=a.legendKeyColor()));!0===a.hidden&&(h=b.markerDisabledColor);var k=b.valueText,f=f+b.lx+b.labelDx+b.markerLabelGap+
|
143 |
b.valueWidth,l="end";"left"==b.valueAlign&&(f-=b.valueWidth,l="start");h=d.text(b.container,k,h,b.chart.fontFamily,c,l);d.setCN(e,h,"legend-value");h.translate(f,b.ly);b.entries[b.index].push(h);g+=b.valueWidth+2*b.markerLabelGap;h.dItem=a;b.valueLabels.push(h)}b.index++;e=b.markerSize;e<c+7&&(e=c+7,d.VML&&(e+=3));c=b.container.rect(a.legendEntryWidth,0,g,e,0,0).attr({stroke:"none",fill:"#fff","fill-opacity":.005});c.dItem=a;b.entries[b.index-1].push(c);c.mouseover(function(c){b.rollOverLabel(a,c)}).mouseout(function(c){b.rollOutLabel(a,
|
144 |
c)}).click(function(c){b.clickLabel(a,c)})}},createV:function(){var a=this.markerSize;return d.polygon(this.container,[a/5,a/2,a-a/5,a/2],[a/3,a-a/5,a/5,a/1.7],this.switchColor)},createX:function(){var a=(this.markerSize-4)/2,b={stroke:this.switchColor,"stroke-width":3},c=this.container,e=d.line(c,[-a,a],[-a,a]).attr(b),a=d.line(c,[-a,a],[a,-a]).attr(b);return this.container.set([e,a])},createMarker:function(a,b,c,e,f,g,h,k,l){var m=this.markerSize,n=this.container;f||(f=this.markerBorderColor);f||
|
145 |
(f=b);isNaN(e)&&(e=this.markerBorderThickness);isNaN(g)&&(g=this.markerBorderAlpha);return d.bullet(n,a,m,b,c,e,f,g,m,h,k,this.chart.path,l)},validateNow:function(){this.invalidateSize()},updateValues:function(){var a=this.valueLabels,b=this.chart,c,e=this.data;if(a)for(c=0;c<a.length;c++){var f=a[c],g=f.dItem;g.periodDataItem=void 0;g.periodPercentDataItem=void 0;var h=" ";if(e)g.value?f.text(g.value):f.text("");else{var k=null;if(void 0!==g.type){var k=g.currentDataItem,l=this.periodValueText;g.legendPeriodValueText&&
|
146 |
(l=g.legendPeriodValueText);k?(h=this.valueText,g.legendValueText&&(h=g.legendValueText),h=b.formatString(h,k)):l&&b.formatPeriodString&&(l=d.massReplace(l,{"[[title]]":g.title}),h=b.formatPeriodString(l,g))}else h=b.formatString(this.valueText,g);l=g;k&&(l=k);var m=this.valueFunction;m&&(h=m(l,h,b.periodDataItem));var n;this.useMarkerColorForLabels&&!k&&g.lastDataItem&&(k=g.lastDataItem);k?n=b.getBalloonColor(g,k):g.legendKeyColor&&(n=g.legendKeyColor());g.legendColorFunction&&(n=g.legendColorFunction(l,
|
147 |
-
h,g.periodDataItem,g.periodPercentDataItem));f.text(h);this.useMarkerColorForValues&&f.setAttr("fill",n)
|
148 |
this.zoomControl=new d.ZoomControl(a);this.fitMapToContainer=!0;this.mouseWheelZoomEnabled=this.backgroundZoomsToTop=!1;this.allowClickOnSelectedObject=this.useHandCursorOnClickableOjects=this.showBalloonOnSelectedObject=!0;this.showObjectsAfterZoom=this.wheelBusy=!1;this.zoomOnDoubleClick=this.useObjectColorForBalloon=!0;this.allowMultipleDescriptionWindows=!1;this.dragMap=this.centerMap=this.linesAboveImages=!0;this.colorSteps=5;this.forceNormalize=!1;this.showAreasInList=!0;this.showLinesInList=
|
149 |
this.showImagesInList=!1;this.areasProcessor=new d.AreasProcessor(this);this.areasSettings=new d.AreasSettings(a);this.imagesProcessor=new d.ImagesProcessor(this);this.imagesSettings=new d.ImagesSettings(a);this.linesProcessor=new d.LinesProcessor(this);this.linesSettings=new d.LinesSettings(a);this.initialTouchZoom=1;this.showDescriptionOnHover=!1;d.AmMap.base.construct.call(this,a);this.creditsPosition="bottom-left";this.product="ammap";this.areasClasses={};d.applyTheme(this,a,this.cname)},initChart:function(){this.zoomInstantly=
|
150 |
!0;var a=this.container;this.panRequired=!0;if(this.sizeChanged&&d.hasSVG&&this.chartCreated){this.freeLabelsSet&&this.freeLabelsSet.remove();this.freeLabelsSet=a.set();this.container.setSize(this.realWidth,this.realHeight);this.resizeMap();this.drawBackground();this.redrawLabels();this.drawTitles();this.processObjects(!0);this.rescaleObjects();this.zoomControl.init(this,a);this.drawBg();var b=this.smallMap;b&&b.init(this,a);(b=this.valueLegend)&&b.init(this,a);this.sizeChanged=!1;this.zoomToLongLat(this.zLevelTemp,
|
@@ -160,130 +159,130 @@ this.linkSet.toFront()}else this.cleanChart()},hideGroup:function(a){this.showHi
|
|
160 |
this.formatString(a.accessibleLabel,a);a.displayObject&&this.makeAccessible(a.displayObject,b,"menuitem")}},update:function(){d.hasSVG&&(d.AmMap.base.update.call(this),this.zoomControl&&this.zoomControl.update&&this.zoomControl.update())},animateMap:function(){var a=this;a.totalFrames=a.zoomDuration*d.updateRate;a.totalFrames+=1;a.frame=0;a.tweenPercent=0;a.balloon.hide(0);setTimeout(function(){a.updateSize.call(a)},1E3/d.updateRate)},updateSize:function(){var a=this,b=a.totalFrames;a.preventHover=
|
161 |
!0;a.frame<=b?(a.frame++,b=d.easeOutSine(0,a.frame,0,1,b),1<=b?(b=1,a.preventHover=!1,a.wheelBusy=!1):window.requestAnimationFrame?window.requestAnimationFrame(function(){a.updateSize.call(a)}):setTimeout(function(){a.updateSize.call(a)},1E3/d.updateRate),.8<b&&(a.preventHover=!1)):(b=1,a.preventHover=!1,a.wheelBusy=!1);a.tweenPercent=b;a.rescaleMapAndObjects()},rescaleMapAndObjects:function(){var a=this.initialScale,b=this.initialX,c=this.initialY,e=this.tweenPercent,a=a+(this.finalScale-a)*e;this.mapContainer.translate(b+
|
162 |
(this.finalX-b)*e,c+(this.finalY-c)*e,a,!0);if(this.areasSettings.adjustOutlineThickness){for(var b=this.svgAreas,d=0;d<b.length;d++)(c=b[d])&&c.setAttr("stroke-width",this.areasSettings.outlineThickness/a/this.mapScale);if(b=this.dataProvider.areas)for(d=0;d<b.length;d++){var c=b[d],g=c.displayObject;g&&g.setAttr("stroke-width",c.outlineThicknessReal/a/this.mapScale)}}this.rescaleObjects();this.positionChanged();this.updateSmallMap();1==e&&this.fire({type:"zoomCompleted",chart:this})},updateSmallMap:function(){this.smallMap&&
|
163 |
-
this.smallMap.update()},rescaleObjects:function(){var a=this.mapContainer.scale,b=this.imagesProcessor.objectsToResize,c;for(c=0;c<b.length;c++){var e=b[c].image;e.translate(e.x,e.y,
|
164 |
-
0;c<b.length;c++)e=b[c],e.translate(e.x,e.y,1/a,!0)},handleTouchEnd:function(a){this.initialDistance=NaN;this.mouseIsDown=this.isDragging=!1;d.AmMap.base.handleTouchEnd.call(this,a)},handleMouseDown:function(a){d.resetMouseOver();this.mouseIsDown=this.mouseIsOver=!0;this.balloon.hide(0);a&&this.mouseIsOver&&a.preventDefault&&this.panEventsEnabled&&a.preventDefault();if(this.chartCreated&&!this.preventHover&&
|
165 |
-
this.mapContainer.x,this.mapContainerClickY=this.mapContainer.y),a||(a=window.event),a.shiftKey&&!0===this.developerMode&&this.getDevInfo(),a&&a.touches)){var b=this.mouseX,c=this.mouseY,e=a.touches.item(1);e&&this.panEventsEnabled&&this.boundingRect&&(a=e.clientX-this.boundingRect.left,e=e.clientY-this.boundingRect.top,this.middleXP=(b+(a-b)/2)/this.realWidth,this.middleYP=(c+(e-c)/2)/this.realHeight,
|
166 |
-
|
167 |
-
a.fire(b));(a.mouseIsOver&&!a.mapWasDragged&&!a.skipClick||a.wasTouched&&3>Math.abs(a.mouseX-a.tmx)&&3>Math.abs(a.mouseY-a.tmy))&&a.fire({type:"click",x:a.mouseX,y:a.mouseY,chart:a});a.mapContainerClickX=NaN;a.mapContainerClickY=NaN;a.objectWasClicked=!1;a.zoomOnDoubleClick&&a.mouseIsOver&&(b=(new Date).getTime(),200>b-a.previousClickTime&&40<b-a.previousClickTime&&a.doDoubleClickZoom(),a.previousClickTime=
|
168 |
-
this;d.AmMap.base.handleMouseMove.call(b,a);if(!a||!a.touches||!b.tapToActivate||b.tapped){b.panEventsEnabled&&b.mouseIsOver&&a&&a.preventDefault&&a.preventDefault();var c=b.previuosMouseX,e=b.previuosMouseY,f=b.mouseX,g=b.mouseY,h=b.zoomControl;isNaN(c)&&(c=f);isNaN(e)&&(e=g);b.mouse2X=NaN;b.mouse2Y=NaN;a&&a.touches&&(a=a.touches.item(1))&&b.panEventsEnabled&&b.boundingRect&&(b.mouse2X=a.clientX-b.boundingRect.left,
|
169 |
-
b.pinchTO&&clearTimeout(b.pinchTO);b.pinchTO=setTimeout(function(){b.resetPinch.call(b)},1E3);var m=b.realHeight,n=b.realWidth,q=b.mapWidth,
|
170 |
-
h.maxZoomLevel),h=b.zoomLevel(),p=b.middleXP,l=b.middleYP,
|
171 |
-
b){var c=this;a||(a=c.dataProvider);a.isOver=!1;var e=a.linkToObject;d.isString(e)&&(e=c.getObjectById(e));a.useTargetsZoomValues&&e&&(a.zoomX=e.zoomX,a.zoomY=e.zoomY,a.zoomLatitude=e.zoomLatitude,a.zoomLongitude=e.zoomLongitude,a.zoomLevel=e.zoomLevel);var f=c.selectedObject;f&&c.returnInitialColor(f);c.selectedObject=a;var g=!1,h,k;"MapArea"==a.objectType&&(a.autoZoomReal&&(g=!0),h=c.areasSettings.selectedOutlineColor,
|
172 |
-
isNaN(a.zoomLevel)&&isNaN(a.zoomX)&&isNaN(a.zoomY))){if(c.extendMapData(e))return;c.selectObject(e);return}c.allowMultipleDescriptionWindows||c.closeAllDescriptions();clearTimeout(c.selectedObjectTimeOut);clearTimeout(c.processObjectsTimeOut);e=c.zoomDuration;!g&&isNaN(a.zoomLevel)&&isNaN(a.zoomX)&&isNaN(a.zoomY)?(c.showDescriptionAndGetUrl(),b||c.processObjects()):(c.selectedObjectTimeOut=setTimeout(function(){c.showDescriptionAndGetUrl.call(c)},
|
173 |
-
setTimeout(function(){c.processObjects.call(c)},1E3*e+200)):b||c.processObjects();e=a.displayObject;g=a.selectedColorReal;"MapImage"==a.objectType
|
174 |
-
e.setAttr("stroke",h);void 0!==k&&e.setAttr("stroke-width",k);
|
175 |
-
e=n.displayObject
|
176 |
-
this.selectedObject.displayObject;c&&c.toFront()}if(c=a.groupId){var c=this.getGroupById(c),
|
177 |
-
if(b){d.removeCN(this,b,"selected-object");b.toPrevious();if("MapImage"==a.objectType){var c=a.tempScale;isNaN(c)||b.translate(b.x,b.y,c,!0);a.tempScale=NaN;b=a.image}c=a.colorReal;if("MapLine"==a.objectType){var e=a.lineSvg;e&&e.setAttr("stroke",
|
178 |
-
|
179 |
-
(c=
|
180 |
-
(c*h):.8*g/(e*h),k.minZoomLevel,k.maxZoomLevel);this.zoomToMapXY(f,(a+c/2)*h,(b+e/2)*h)},zoomToLatLongRectangle:function(a,b,c,e){var f=this.dataProvider,g=this.zoomControl,h=Math.abs(c-a),k=Math.abs(b-e),l=Math.abs(f.rightLongitude-f.leftLongitude),
|
181 |
-
a,b);this.getGroup(this.areasProcessor.allObjects,a,b);return b},zoomToGroup:function(a){a="object"==typeof a?a:this.getGroupById(a);var b,c,
|
182 |
-
a[d];f.groupId==b&&c.push(f)}}},zoomToStageXY:function(a,b,c,e){if(!this.objectWasClicked){var f=this.zoomControl;a=d.fitToBounds(a,f.minZoomLevel,f.maxZoomLevel);var f=this.zoomLevel(),g=this.mapSet.getBBox();b=this.xyToCoordinates((b-
|
183 |
-
g=this.mapHeight;this.zoomTo(a,-(b/f)*a+this.realWidth/f/2,-(c/g)*a+this.realHeight/g/2,d)},zoomToObject:function(a){if(a){var b=a.zoomLatitude,c=a.zoomLongitude;isNaN(a.zoomLatitudeC)||(b=a.zoomLatitudeC);isNaN(a.zoomLongitudeC)||
|
184 |
-
isNaN(a.zoomLatitude)&&isNaN(a.zoomLongitude)&&!isNaN(a.latitude)&&!isNaN(a.longitude)&&this.zoomToLongLat(a.zoomLevel,a.longitude,a.latitude);"MapArea"==a.objectType&&(f=a.displayObject.getBBox(),g=this.mapScale,b=(f.x+this.diffX)*
|
185 |
-
b+e/2,c+f/2));this.zoomControl.update()}},zoomToSelectedObject:function(){this.zoomToObject(this.selectedObject)},zoomTo:function(a,b,c,e){var f=this.zoomControl;a=d.fitToBounds(a,f.minZoomLevel,f.maxZoomLevel);f=this.zoomLevel();
|
186 |
-
this.mapWidth*b,this.finalY=this.mapHeight*c,this.finalScale=a,this.finalX!=this.initialX||this.finalY!=this.initialY||this.finalScale!=this.initialScale?e?(this.tweenPercent=1,this.rescaleMapAndObjects(),this.wheelBusy=!1):
|
187 |
-
this.totalFrames},processObjects:function(a){var b=this.selectedObject;if(0<b.images.length||0<b.areas.length||0<b.lines.length||b==this.dataProvider||a){a=this.container;var c=this.stageImagesContainer;
|
188 |
-
|
189 |
-
buildSVGMap:function(){d.remove(this.mapSet);var a=this.svgData.g.path,b=this.container,c=b.set();this.svgAreas=[];this.svgAreasById={};void 0===a.length&&(a=[a]);var e;for(e=0;e<a.length;e++){var f=
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
"bubble"==a.type&&(c=void 0);void 0==c&&(isNaN(a.rollOverBrightnessReal)||(c=d.adjustLuminosity(a.colorReal,a.rollOverBrightnessReal/100)));if(void 0!=c)if("MapImage"==a.objectType)(e=a.image)&&
|
194 |
-
("
|
195 |
-
(
|
196 |
-
b,c){if(this.chartCreated){this.handleMouseMove();var d=this.previouslyHovered;d&&d!=a?(!1===this.checkIfSelected(d)&&(this.returnInitialColor(d,!0),this.previouslyHovered=null),this.balloon.hide(0)):
|
197 |
-
|
198 |
-
|
199 |
-
this.
|
200 |
-
this.nf,e=this.pf,f=b.title;b.titleTr&&(f=b.titleTr);void 0==f&&(f="");var g=b.value,g=isNaN(g)?"":d.formatNumber(g,c),c=b.percents,c=isNaN(c)?"":d.formatNumber(c,e),e=b.description;void 0==e&&(e="");var h=b.customData;void 0==
|
201 |
-
isNaN(a.zoomLevel)&&isNaN(a.zoomX)&&isNaN(a.zoomY)||c.hideBalloon());if(c.chartCreated&&!c.preventHover&&c.checkTouchDuration(b)&&!c.mapWasDragged&&c.checkIfClickable(a)&&!c.mapWasPinched){c.selectObject(a);var d=c.zoomLevel(),
|
202 |
-
c.fire({type:"clickMapObject",mapObject:a,chart:c,event:b});c.objectWasClicked=!0}},showBalloonAfterZoom:function(){var a=this.clickLongitude,b=this.clickLatitude,c=this.selectedObject;"MapImage"!=c.objectType||isNaN(c.longitude)||
|
203 |
-
a||b?!0===a.selectable||"MapArea"==a.objectType&&a.autoZoomReal||a.url||a.linkToObject||0<a.images.length||0<a.lines.length||!isNaN(a.zoomLevel)||!isNaN(a.zoomX)||!isNaN(a.zoomY)||a.description?!0:!1:!1},resizeMap:function(){var a=
|
204 |
-
this.
|
205 |
-
this.zoomControl.panStepSize;this.zoomTo(this.zoomLevel(),this.
|
206 |
-
if(a){this.showDescription();var b=a.url;if(b)d.getURL(b,a.urlTarget);else if(b=a.linkToObject){if(d.isString(b)){var c=this.getObjectById(b);if(c){this.selectObject(c);return}}b&&a.passZoomValuesToTarget&&(b.zoomLatitude=this.zoomLatitude(),
|
207 |
-
this.zoomInstantly=!0,this.validateData(),!0},showDescription:function(a){a||(a=this.selectedObject);this.allowMultipleDescriptionWindows||this.closeAllDescriptions();if(a.description){var b=a.descriptionWindow;b&&b.close();b=new d.DescriptionWindow;
|
208 |
-
a.descriptionWindowX;isNaN(l)||(f=l);l=a.descriptionWindowY;isNaN(l)||(g=l);isNaN(f)&&(f=this.mouseX,f=f>this.realWidth/2?f-c-20:f+20);isNaN(g)&&(g=this.mouseY);b.maxHeight=e;l=a.title;a.titleTr&&(l=a.titleTr);b.show(this,this.descriptionsDiv,a.description,
|
209 |
-
b.root.svg;this.getBounds()},getBounds:function(){var a=this.dataProvider;try{var b=this.svgData.defs["amcharts:ammap"];a.leftLongitude=Number(b.leftLongitude);a.rightLongitude=Number(b.rightLongitude);a.topLatitude=Number(b.topLatitude);a.bottomLatitude=
|
210 |
-
360:a:a},latitudeToCoordinate:function(a){var b,c=this.dataProvider;if(this.mapSet){b=c.topLatitude;var d=c.bottomLatitude;"mercator"==c.projection&&(a=this.mercatorLatitudeToCoordinate(a),b=this.mercatorLatitudeToCoordinate(b),d=this.mercatorLatitudeToCoordinate(d));
|
211 |
-
a&&(a=89.5);-89.5>a&&(a=-89.5);a=d.degreesToRadians(a);return d.radiansToDegrees(.5*Math.log((1+Math.sin(a))/(1-Math.sin(a)))/2)},zoomLatitude:function(){if(this.mapContainer){var a=this.mapSet.getBBox(),b=(-this.mapContainer.x+this.previousWidth/
|
212 |
-
|
213 |
-
return this.xyToCoordinates((a.x+a.width/2+this.diffX)*b-c.x*b,(a.y+a.height/2+this.diffY)*b-c.y*b).
|
214 |
-
else{var b=a.zoomX,c=a.zoomY,d=a.zoomLongitude,f=a.zoomLatitude,a=a.zoomLevel;isNaN(b)||isNaN(c)||this.zoomTo(a,b,c);isNaN(d)||isNaN(f)||this.zoomToLongLat(a,d,f,!0)}}},parseXMLNode:function(a,b,c,d){void 0===d&&(d="");var f,g,h;if(c){var k=c.childNodes.length;
|
215 |
-
g++;g?a[b]["#text"]=m:a[b]=m}}else if(1==g.nodeType){var q;void 0!==a[b][l]?void 0===a[b][l].length?(q=a[b][l],a[b][l]=[],a[b][l].push(q),a[b][l].push({}),q=a[b][l][1]):"object"==typeof a[b][l]&&(a[b][l].push({}),q=a[b][l][a[b][l].length-
|
216 |
-
"";for(h in a[b])"#text"==h?c=a[b][h]:g++;0===g&&void 0===a[b].length&&(a[b]=c)}},doDoubleClickZoom:function(){if(!this.mapWasDragged){var a=this.zoomLevel()*this.zoomControl.zoomFactor;this.zoomToStageXY(a,this.mouseX,this.mouseY)}},getDevInfo:function(){var a=
|
217 |
-
zoomLatitude:this.zoomLatitude(),zoomLongitude:this.zoomLongitude(),latitude:b.latitude,longitude:b.longitude,left:this.mouseX,top:this.mouseY,right:this.realWidth-this.mouseX,bottom:this.realHeight-this.mouseY,percentLeft:Math.round(this.mouseX/
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
this.processObject(f.lines,f,"line")}}},positionChanged:function(){var a={type:"positionChanged",zoomX:this.zoomX(),zoomY:this.zoomY(),zoomLevel:this.zoomLevel(),chart:this};this.fire(a)},getX:function(a,b){return this.getXY(a,
|
222 |
-
a.
|
223 |
-
(a-b)/(this.dataProvider.rightLongitude-b)*100)/100},y2c:function(a){var b=this.dataProvider.topLatitude;return Math.round(this.unscaledMapHeight*(a-b)/(this.dataProvider.bottomLatitude-b)*100)/100},normalize:function(a){if(!a.pathsArray){var b;
|
224 |
-
(this.minMapY=c.minY)}a.node.setAttribute("d",b)}},redraw:function(a){var b=a.normalized,b=b.split(" Z").join(""),b=b.split("M");a.pathsArray=[];for(var c=0;c<b.length;c++){var d=b[c];if(d){for(var d=d.split("L"),f=[],g=0;g<d.length;g++)if(d[g]){var h=
|
225 |
-
a.node.setAttribute("d",b);a.path=b},redrawArea:function(a){for(var b=!1,c="",e=0;e<a.length;e++){var f=a[e][0],g=a[e][1],h=d.degreesToRadians(a[e][0]),k=d.degreesToRadians(a[e][1]),k=this.projectionFunction(h,k),h=d.roundTo(this.x2c(d.radiansToDegrees(k[0])),
|
226 |
-
this.topLongLat={longitude:f,latitude:g});k>this.maxMapYY&&(this.maxMapYY=k,this.bottomLongLat={longitude:f,latitude:g});b?c+=" L ":(c+=" M ",b=!0);c+=h+" "+k}return c+" Z "},normalizeMap:function(){var a=d.degreesToRadians(this.dataProvider.leftLongitude),b=
|
227 |
-
e)[1],l=this.dpProjectionFunction(a,g)[0],m=this.dpProjectionFunction(b,g)[0],c=d.equirectangular(f,c),e=d.equirectangular(f,e),h=(c[1]-e[1])/(h-k),a=d.equirectangular(a,g),b=d.equirectangular(b,g),l=(a[0]-b[0])/(l-m);this.minMapX=Infinity;this.maxMapX
|
228 |
-
this.sourceMapWidth*l;this.unscaledMapHeight=this.sourceMapHeight*h;this.diffY=this.diffX=0},fixMapPosition:function(){var a=d.degreesToRadians(this.dataProvider.leftLongitude),b=d.degreesToRadians(this.dataProvider.rightLongitude),c=d.degreesToRadians(this.dataProvider.topLatitude),
|
229 |
-
g)[0];this.sourceMapHeight=this.mapHeight/this.mapScale;this.sourceMapWidth=this.mapWidth/this.mapScale;this.unscaledMapWidth=(a-b)/(l-m)*this.sourceMapWidth;this.unscaledMapHeight=(c-e)/(h-k)*this.sourceMapHeight;b=this.coordinatesToXY(d.radiansToDegrees(f),d.radiansToDegrees(c));a=
|
230 |
-
this.mapScale-c;for(e=0;e<this.svgAreas.length;e++)this.svgAreas[e].translate(this.diffX,this.diffY)},changeProjection:function(){this.minMapXX=Infinity;this.maxMapXX=-Infinity;this.minMapYY=Infinity;this.maxMapYY=-Infinity;this.projectionChanged=!1;for(var a=0;a<this.svgAreas.length;a++)this.redraw(this.svgAreas[a]);
|
231 |
-
d.degreesToRadians(b)),c=this.mapScale*d.roundTo(this.x2c(d.radiansToDegrees(e[0])),3),e=this.mapScale*d.roundTo(this.y2c(d.radiansToDegrees(e[1])),3)):(c=this.longitudeToCoordinate(a),e=this.latitudeToCoordinate(b));return{x:c,y:e}},coordinatesToStageXY:function(a,b){var c=this.coordinatesToXY(a,
|
232 |
-
c.x*this.mapScale,c=(b-this.mapContainer.y)/this.zoomLevel()-c.y*this.mapScale;return this.xyToCoordinates(d,c)},xyToCoordinates:function(a,b,c,e,f){var g;isNaN(e)&&(e=this.mapWidth);isNaN(f)&&(f=this.mapHeight);c||(c=this.projectionFunction);if(g=c.invert){var h=this.dataProvider.leftLongitude,
|
233 |
-
|
234 |
-
d.degreesToRadians(this.leftLongLat.latitude))[0]),k=d.radiansToDegrees(c(d.degreesToRadians(this.rightLongLat.longitude),d.degreesToRadians(this.rightLongLat.latitude))[0]));a=d.degreesToRadians(a/e*(k-h)+h);b=d.degreesToRadians(b/f*(m-l)+l);b=g(a,b);g=d.radiansToDegrees(b[0]);
|
235 |
-
if(this.mapSet){var e=this.dataProvider,f=e.bottomLatitude;c=e.topLatitude;"mercator"==e.projection?(e=this.mercatorLatitudeToCoordinate(f),c=this.mercatorLatitudeToCoordinate(c),c=2*d.degreesToRadians(a*(e-c)/b+c),c=d.radiansToDegrees(2*Math.atan(Math.exp(c))-.5*Math.PI)):c=
|
236 |
-
c)/1E6}})})();(function(){var d=window.AmCharts;d.ZoomControl=d.Class({construct:function(a){this.cname="ZoomControl";this.panStepSize=.1;this.zoomFactor=2;this.maxZoomLevel=64;this.minZoomLevel=1;this.panControlEnabled=!1;this.zoomControlEnabled=!0;this.buttonRollOverColor="#DADADA";this.buttonFillColor="#FFFFFF";this.buttonFillAlpha=1;this.buttonBorderColor="#000000";this.buttonBorderAlpha=.1;this.buttonIconAlpha=this.buttonBorderThickness=1;this.gridColor=this.buttonIconColor="#000000";this.homeIconFile="homeIcon.gif";
|
237 |
this.gridBackgroundColor="#000000";this.draggerAlpha=this.gridAlpha=this.gridBackgroundAlpha=0;this.draggerSize=this.buttonSize=31;this.iconSize=11;this.homeButtonEnabled=!0;this.buttonCornerRadius=2;this.gridHeight=5;this.roundButtons=!0;this.top=this.left=10;d.applyTheme(this,a,this.cname)},init:function(a,b){var c=this;c.chart=a;d.remove(c.set);var e=b.set();d.setCN(a,e,"zoom-control");var f=c.buttonSize,g=c.zoomControlEnabled,h=c.panControlEnabled,k=c.buttonFillColor,l=c.buttonFillAlpha,m=c.buttonBorderThickness,
|
238 |
-
n=c.buttonBorderColor,q=c.buttonBorderAlpha,
|
239 |
-
e.push(F);c.set=e;c.zoomSet=F;5<p&&(g=d.rect(b,f+6,p+2*f+6,c.gridBackgroundColor,c.gridBackgroundAlpha,0,"#000000",0,4),d.setCN(a,g,"zoom-bg"),g.translate(-3,-3),g.mouseup(function(){c.handleBgUp()}).touchend(function(){c.handleBgUp()}),F.push(g));var E=f;
|
240 |
-
z=new d.SimpleButton;z.setDownHandler(c.draggerDown,c);z.setClickHandler(c.draggerUp,c);z.init(b,E,g,k,l,m,n,q,t
|
241 |
-
F.push(z.set);z=new d.SimpleButton;C?z.svgIcon=d.line(b,[-
|
242 |
-
|
243 |
-
[-
|
244 |
-
C?h.svgIcon=d.polygon(b,[-
|
245 |
this.chart;a.zoomTo(100*Math.pow(this.zoomFactor,this.stepMax-(a.mouseY-this.zoomSet.y-this.set.y-this.buttonSize-this.realStepSize/2)/this.realStepSize))},update:function(){var a;a=this.zoomFactor;var b=this.realStepSize,c=this.stepMax,e=this.dragger,f=this.buttonSize,g,h=this.chart;h&&(this.isDragging?(h.stopDrag(),g=e.y+(h.mouseY-this.previousY),g=d.fitToBounds(g,f,this.realGridHeight+f),h.zoomTo(100*Math.pow(a,c-(g-f)/b),NaN,NaN,!0)):(a=Math.log(h.zoomLevel()/100)/Math.log(a),g=(c-a)*b+f),this.previousY=
|
246 |
-
h.mouseY,this.previousDY!=g&&e&&(e.translate((this.buttonSize-this.draggerSize)/2,g),this.previousDY=g))}})})();(function(){var d=window.AmCharts;d.SimpleButton=d.Class({construct:function(){},init:function(a,b,c,e,f,g,h,k,l,m,n,q,
|
247 |
-
n),p.node.style.pointerEvents="none");e.mousedown(function(){
|
248 |
handleDown:function(){var a=this.downHandler;a&&a.call(this.scope)},handleOver:function(){this.container.chart.skipClick=!0;this.bg.setAttr("fill",this.rollOverColor)},handleOut:function(){this.container.chart.skipClick=!1;this.bg.setAttr("fill",this.color)}})})();(function(){var d=window.AmCharts;d.SmallMap=d.Class({construct:function(a){this.cname="SmallMap";this.mapColor="#e6e6e6";this.rectangleColor="#FFFFFF";this.top=this.right=10;this.minimizeButtonWidth=23;this.backgroundColor="#9A9A9A";this.backgroundAlpha=1;this.borderColor="#FFFFFF";this.iconColor="#000000";this.borderThickness=3;this.borderAlpha=1;this.size=.2;this.enabled=!0;d.applyTheme(this,a,this.cname)},init:function(a,b){var c=this;if(c.enabled){c.chart=a;c.container=b;c.width=a.realWidth*
|
249 |
c.size;c.height=a.realHeight*c.size;d.remove(c.mapSet);d.remove(c.allSet);d.remove(c.set);var e=b.set();c.set=e;d.setCN(a,e,"small-map");var f=b.set();c.allSet=f;e.push(f);c.buildSVGMap();var g=c.borderThickness,h=c.borderColor,k=d.rect(b,c.width+g,c.height+g,c.backgroundColor,c.backgroundAlpha,g,h,c.borderAlpha);d.setCN(a,k,"small-map-bg");k.translate(-g/2,-g/2);f.push(k);k.toBack();var l,m,k=c.minimizeButtonWidth,n=new d.SimpleButton,q=k/2;a.svgIcons?n.svgIcon=d.line(b,[-q/2,0,q/2],[-q/4,q/4,-q/
|
250 |
-
4],c.iconColor,1,1):n.setIcon(a.pathToImages+"arrowDown.gif",k);n.setClickHandler(c.minimize,c);n.init(b,k,k,h,1,1,h,1);d.setCN(a,n.set,"small-map-down");n=n.set;c.downButtonSet=n;e.push(n);var
|
251 |
-
g,p=0);isNaN(c.bottom)||(l=a.getY(c.bottom,!0)-c.height-g,p=c.height-k+g/2);isNaN(c.left)||(m=a.getX(c.left)+g,
|
252 |
this.allSet.hide()},maximize:function(){this.downButtonSet.show();this.upButtonSet.hide();this.allSet.show()},buildSVGMap:function(){var a=this.chart,b={fill:this.mapColor,stroke:this.mapColor,"stroke-opacity":1},c=this.container,e=c.set();d.setCN(a,e,"small-map-image");var f;for(f=0;f<a.svgAreas.length;f++){var g=c.path(a.svgAreas[f].path).attr(b);e.push(g)}this.allSet.push(e);b=e.getBBox();c=this.size*a.mapScale;f=-b.x*c;var g=-b.y*c,h=0,k=0;a.centerMap&&(h=(this.width-b.width*c)/2,k=(this.height-
|
253 |
b.height*c)/2);this.mapWidth=b.width*c;this.mapHeight=b.height*c;f+=h;g+=k;this.dx=h;this.dy=k;e.translate(f,g,c);this.mapSet=e;this.mapX=f;this.mapY=g},update:function(){var a=this.chart;if(a){var b=a.zoomLevel(),c=this.width,d=this.height,f=c/(a.realWidth*b),g=a.mapContainer.getBBox(),c=c/b,d=d/b,h=this.rectangle;h.translate(-(a.mapContainer.x+g.x*b)*f+this.dx,-(a.mapContainer.y+g.y*b)*f+this.dy);0<c&&0<d&&(h.setAttr("width",Math.ceil(c+1)),h.setAttr("height",Math.ceil(d+1)));this.rWidth=c;this.rHeight=
|
254 |
d}},drawRectangle:function(){var a=this.rectangle;d.remove(a);a=d.rect(this.container,10,10,"#000",0,1,this.rectangleColor,1);d.setCN(this.chart,a,"small-map-rectangle");this.rectangleC.push(a);this.rectangle=a},handleMouseUp:function(){var a=this.chart,b=a.zoomLevel();a.zoomToMapXY(b,(a.mouseX-this.set.x-this.mapX)/this.size+a.diffX*a.mapScale,(a.mouseY-this.set.y-this.mapY)/this.size+a.diffY*a.mapScale)}})})();(function(){var d=window.AmCharts;d.AreasProcessor=d.Class({construct:function(a){this.chart=a},process:function(a){this.updateAllAreas();this.allObjects=[];a=a.areas;var b=this.chart;b.outlines=[];var c=a.length,d,f,g=0,h=!1,k=!1,l=0;for(d=0;d<c;d++)if(f=a[d],f=f.value,!isNaN(f)){if(!1===h||h<f)h=f;if(!1===k||k>f)k=f;g+=Math.abs(f);l++}this.minValue=k;this.maxValue=h;isNaN(b.minValue)||(this.minValue=b.minValue);isNaN(b.maxValue)||(this.maxValue=b.maxValue);b.maxValueReal=h;b.minValueReal=k;for(d=
|
255 |
0;d<c;d++)f=a[d],isNaN(f.value)?f.percents=void 0:(f.percents=(f.value-k)/g*100,k==h&&(f.percents=100));for(d=0;d<c;d++)f=a[d],this.createArea(f);b.outlinesToFront()},updateAllAreas:function(){var a=this.chart,b=a.areasSettings,c=b.unlistedAreasColor,e=b.unlistedAreasAlpha,f=b.unlistedAreasOutlineColor,g=b.unlistedAreasOutlineAlpha,h=a.svgAreas,k=a.dataProvider,l=k.areas,m={},n;for(n=0;n<l.length;n++)m[l[n].id]=l[n];for(n=0;n<h.length;n++){l=h[n];if(b.preserveOriginalAttributes){if(l.customAttr)for(var q in l.customAttr)l.setAttr(q,
|
256 |
-
l.customAttr[q])}else{void 0!=c&&l.setAttr("fill",c);isNaN(e)||l.setAttr("fill-opacity",e);void 0!=f&&l.setAttr("stroke",f);isNaN(g)||l.setAttr("stroke-opacity",g);var
|
257 |
-
b.areasClasses[c.className];f&&(e=d.processObject(f,d.AreasSettings,b.theme))}var g=e.color,h=e.alpha,k=e.outlineThickness,l=e.rollOverColor,m=e.selectedColor,n=e.rollOverAlpha,q=e.rollOverBrightness,
|
258 |
-
isNaN(
|
259 |
-
(a.selectable=y);void 0==a.colorReal&&(a.colorReal=g);g=a.outlineColor;void 0==g&&(g=
|
260 |
-
h;a.balloonTextReal=m;a.selectedColorReal=
|
261 |
-
q.setAttr("tabindex",c);a.displayObject=q;a.outline&&(
|
262 |
-
(q.setAttr("fill",C),q.setAttr("stroke",g),q.setAttr("stroke-opacity",
|
263 |
250;this.bringForwardOnHover=this.adjustOutlineThickness=!0;this.accessibleLabel="[[title]] [[value]] [[description]]";d.applyTheme(this,a,this.cname)}})})();(function(){var d=window.AmCharts;d.ImagesProcessor=d.Class({construct:function(a){this.chart=a;this.reset()},process:function(a){var b=a.images,c;for(c=0;c<b.length;c++){var d=b[c];this.createImage(d,c);d.parentArray=b}this.counter=c;a.parentObject&&a.remainVisible&&this.process(a.parentObject)},createImage:function(a,b){a=d.processObject(a,d.MapImage);isNaN(b)&&(this.counter++,b=this.counter);var c=this.chart,e=c.container,f=c.mapImagesContainer,g=c.stageImagesContainer,h=c.imagesSettings;a.remove&&
|
264 |
-
a.remove();var k=h.color,l=h.alpha,m=h.rollOverColor,n=h.rollOverOutlineColor,q=h.selectedColor,
|
265 |
-
void 0==a.bringForwardOnHover&&(a.bringForwardOnHover=
|
266 |
-
isNaN(
|
267 |
-
(a.accessibleLabel=h.accessibleLabel);d.processDescriptionWindow(h,a);a.centeredReal=void 0==a.centered?h.centered:a.centered;n=a.type;u=a.imageURL;
|
268 |
-
"miles"==a.widthAndHeightUnits&&(C=c.milesToPixels(a.width),E=c.milesToPixels(a.height));if("circle"==n||"bubble"==n)E=C;D=this.createPredefinedImage(G,t,
|
269 |
-
!0))):
|
270 |
h),G=a.selectedLabelColorReal);D=null;void 0!==a.label&&(D=d.text(e,a.label,G,c.fontFamily,a.labelFontSizeReal,a.labelAlign),d.setCN(c,D,"map-image-label"),void 0!==a.id&&d.setCN(c,D,"map-image-label-"+a.id),G=a.labelBackgroundAlpha,(k=a.labelBackgroundColor)&&0<G&&(l=D.getBBox(),e=d.rect(e,l.width+16,l.height+10,k,G),d.setCN(c,e,"map-image-label-background"),void 0!=a.id&&d.setCN(c,e,"map-image-label-background-"+a.id),H.push(e),a.labelBG=e),a.imageLabel=D,H.push(D),d.setCN(c,H,"map-image-container"),
|
271 |
void 0!=a.id&&d.setCN(c,H,"map-image-container-"+a.id));e=isNaN(a.latitude)||isNaN(a.longitude)?!0:!1;a.lineId&&(D=this.chart.getObjectById(a.lineId))&&0<D.longitudes.length&&(e=!1);e?g.push(H):f.push(H);H&&(H.rotation=a.rotation,isNaN(a.rotation)||H.rotate(a.rotation));this.updateSizeAndPosition(a);a.mouseEnabled&&c.addObjectEventListeners(H,a);a.hidden&&H.hide();a.animateAlongLine&&setTimeout(function(){a.animateAlong.call(a)},100);return a},updateSizeAndPosition:function(a){var b=this.chart,c=
|
272 |
-
a.displayObject,e=b.getX(a.left),f=b.getY(a.top),g,h=a.image.getBBox();isNaN(a.right)||(e=b.getX(a.right,!0)-h.width*a.scale);isNaN(a.bottom)||(f=b.getY(a.bottom,!0)-h.height*a.scale);var k=a.longitude,l=a.latitude,m=a.positionOnLine,h=this.objectsToResize;this.allSvgObjects.push(c);this.allObjects.push(a);a.arrays.push({arr:this.allSvgObjects,el:c});a.arrays.push({arr:this.allObjects,el:a});var n=a.imageLabel,q=this.chart.zoomLevel(),t
|
273 |
-
var p=a.tabIndex;void 0===p&&(p=b.imagesSettings.tabIndex);void 0!==p&&c.setAttr("tabindex",p);a.line&&a.line.getCoordinates&&(a.line.chart=b,p=a.line.getCoordinates(m,a.lineSegment))&&(k=b.coordinateToLongitude(p.x),l=b.coordinateToLatitude(p.y),
|
274 |
-
|
275 |
-
h+l/2+5,g+=k/2-2);"left"==c&&(f+=-l/2-5,g+=k/2-2);"top"==c&&(g-=m/2+3,f+=h/2);"bottom"==c&&(g+=k+m/2,f+=h/2);"middle"==c&&(f+=h/2,g+=k/2);a.translate(f+b.labelShiftX,g+b.labelShiftY,NaN,!0);a=b.labelFontSizeReal;b.labelBG&&b.labelBG.translate(f-d.width/2+b.labelShiftX-9,g-a/2+b.labelShiftY-4,NaN,!0)}},createPredefinedImage:function(a,b,c,e,f,g){var h=this.chart.container,k;switch(e){case "circle":k=d.circle(h,f/2,a,1,c,b,1);break;case "rectangle":k=d.polygon(h,[-f/2,f/2,f/2,-f/2],
|
276 |
-
2],a,1,c,b,1,0,!0);break;case "bubble":k=d.circle(h,f/2,a,1,c,b,1,!0);break;case "hexagon":f/=Math.sqrt(3),k=d.polygon(h,[.866*f,0*f,-.866*f,-.866*f,0*f,.866*f],[.5*f,1*f,.5*f,-.5*f,-1*f,-.5*f],a,1,c,b,1)}return k},reset:function(){this.objectsToResize=[];this.allSvgObjects=[];this.allObjects=[];this.allLabels=[];this.labelsToReposition=[]}})})();(function(){var d=window.AmCharts;d.ImagesSettings=d.Class({construct:function(a){this.cname="ImagesSettings";this.balloonText="[[title]]";this.alpha=1;this.borderAlpha=0;this.borderThickness=1;this.labelPosition="right";this.labelColor="#000000";this.labelFontSize=11;this.color="#000000";this.labelRollOverColor="#00CC00";this.centered=!0;this.rollOverScale=this.selectedScale=1;this.descriptionWindowWidth=250;this.bringForwardOnHover=!0;this.outlineColor="transparent";this.adjustAnimationSpeed=!1;
|
277 |
this.baseAnimationDistance=500;this.pauseDuration=0;this.easingFunction=d.easeInOutQuad;this.animationDuration=3;this.positionScale=1;this.accessibleLabel="[[title]] [[description]]";d.applyTheme(this,a,this.cname)}})})();(function(){var d=window.AmCharts;d.LinesProcessor=d.Class({construct:function(a){this.chart=a;this.reset()},process:function(a){var b=a.lines,c;for(c=0;c<b.length;c++){var d=b[c];this.createLine(d,c);d.parentArray=b}this.counter=c;a.parentObject&&a.remainVisible&&this.process(a.parentObject)},createLine:function(a,b){a=d.processObject(a,d.MapLine);isNaN(b)&&(this.counter++,b=this.counter);a.index=b;a.remove&&a.remove();var c=this.chart,e=c.linesSettings,f=this.objectsToResize,g=c.mapLinesContainer,
|
278 |
-
h=c.stageLinesContainer,k=e.thickness,l=e.dashLength,m=e.arrow,n=e.arrowSize,q=e.arrowColor,
|
279 |
-
a.arrays.push({arr:this.allObjects,el:a});a.mouseEnabled&&c.addObjectEventListeners(z,a);if(a.remainVisible||c.selectedObject==a.parentObject){F=a.thickness;isNaN(F)&&(F=k);k=a.dashLength;isNaN(k)&&(k=l);l=a.color;void 0==l&&(l=
|
280 |
-
(m=q);void 0==m&&(m=l);q=a.arrowAlpha;isNaN(q)&&(q=
|
281 |
-
void 0==a.bringForwardOnHover&&(a.bringForwardOnHover=v);d.processDescriptionWindow(e,a);v=this.processCoordinates(a.x,c.realWidth);C=this.processCoordinates(a.y,c.realHeight);n=a.longitudes;e=a.latitudes;p=n.length;if(0<p)for(v=[],C=[],u=0;u<p;u++)
|
282 |
-
Math.sqrt(Math.pow(v[p+1]-v[p],2)+Math.pow(C[p+1]-C[p],2)),a.distances[p]=H;p=d.line(
|
283 |
-
G)/Math.PI;isNaN(E)&&(E=270);if(K<J){var P=K,K=J,J=P,P=L,L=O,O=P;E=-E}0<
|
284 |
-
(
|
285 |
-
M)/(
|
286 |
-
N,1/n,!0);isNaN(I)||
|
287 |
a.length;d++){var f=a[d],g=Number(f);isNaN(g)&&(g=Number(f.replace("%",""))*b/100);isNaN(g)||c.push(g)}return c},reset:function(){this.objectsToResize=[];this.allSvgObjects=[];this.allObjects=[];this.linesToResize=[]}})})();(function(){var d=window.AmCharts;d.LinesSettings=d.Class({construct:function(a){this.cname="LinesSettings";this.balloonText="[[title]]";this.thickness=1;this.dashLength=0;this.arrowSize=10;this.arrowAlpha=1;this.arrow="none";this.color="#990000";this.descriptionWindowWidth=250;this.bringForwardOnHover=!0;d.applyTheme(this,a,this.cname)}})})();(function(){var d=window.AmCharts;d.MapObject=d.Class({construct:function(a){this.fixedSize=this.mouseEnabled=!0;this.images=[];this.lines=[];this.areas=[];this.remainVisible=!0;this.passZoomValuesToTarget=!1;this.objectType=this.cname;d.applyTheme(this,a,"MapObject");this.arrays=[]},deleteObject:function(){this.remove();this.parentArray&&d.removeFromArray(this.parentArray,this);if(this.arrays)for(var a=0;a<this.arrays.length;a++)d.removeFromArray(this.arrays[a].arr,this.arrays[a].el);this.arrays=
|
288 |
[]}})})();(function(){var d=window.AmCharts;d.MapArea=d.Class({inherits:d.MapObject,construct:function(a){this.cname="MapArea";d.MapArea.base.construct.call(this,a);d.applyTheme(this,a,this.cname)},validate:function(){this.chart.areasProcessor.createArea(this)}})})();(function(){var d=window.AmCharts;d.MapLine=d.Class({inherits:d.MapObject,construct:function(a){this.cname="MapLine";this.longitudes=[];this.latitudes=[];this.x=[];this.y=[];this.segments=0;this.arrow="none";d.MapLine.base.construct.call(this,a);d.applyTheme(this,a,this.cname)},validate:function(){this.chart.linesProcessor.createLine(this)},remove:function(){var a=this.displayObject;a&&a.remove()},getCoordinates:function(a,b){isNaN(b)&&(b=0);if(!isNaN(a)){var c,e,f,g,h,k;if(1<this.longitudes.length){e=
|
289 |
this.chart.coordinatesToXY(this.longitudes[b],this.latitudes[b]);var l=this.chart.coordinatesToXY(this.longitudes[b+1],this.latitudes[b+1]);c=e.x;f=l.x;e=e.y;g=l.y}else 1<this.x.length&&(c=this.x[b],f=this.x[b+1],e=this.y[b],g=this.y[b+1]);l=Math.sqrt(Math.pow(f-c,2)+Math.pow(g-e,2));c<f&&!isNaN(this.arc)&&0!==this.arc&&(a=1-a);h=c+(f-c)*a;k=e+(g-e)*a;var m=Math.atan2(g-e,f-c);if(!isNaN(this.arc)&&0!==this.arc&&this.arcRadius){var n=0;c<f&&(n=c,c=f,f=n,n=e,e=g,g=n,n=Math.PI);k=this.arcRadius[b];0>
|
@@ -297,10 +296,10 @@ a.timeOut=setTimeout(function(){a.update.call(a)},b)):(a.fire({type:"animationEn
|
|
297 |
(a.direction=1,a.extraAngle=0,a.delayAnimateAlong()):a.loop&&a.delayAnimateAlong()))},delayAnimateAlong:function(){var a=this;a.clearTO();a.animateAlongLine&&(a.timeOut=setTimeout(function(){a.animateAlong.call(a)},1E3*a.chart.imagesSettings.pauseDuration))},fixToStage:function(){if(!isNaN(this.longitude)){var a=this.chart.coordinatesToStageXY(this.longitude,this.latitude);this.left=a.x;this.top=a.y;this.latitude=this.longitude=void 0}this.validate()},fixToMap:function(){if(!isNaN(this.left)){var a=
|
298 |
this.chart.stageXYToCoordinates(this.left,this.top);this.longitude=a.longitude;this.latitude=a.latitude;this.top=this.left=void 0}this.validate()}})})();(function(){var d=window.AmCharts;d.degreesToRadians=function(a){return a/180*Math.PI};d.radiansToDegrees=function(a){return a/Math.PI*180};d.getColorFade=function(a,b,c){var e=d.hex2RGB(b);b=e[0];var f=e[1],e=e[2],g=d.hex2RGB(a);a=g[0];var h=g[1],g=g[2];a+=Math.round((b-a)*c);h+=Math.round((f-h)*c);g+=Math.round((e-g)*c);return"rgb("+a+","+h+","+g+")"};d.hex2RGB=function(a){return[parseInt(a.substring(1,3),16),parseInt(a.substring(3,5),16),parseInt(a.substring(5,7),16)]};d.processDescriptionWindow=
|
299 |
function(a,b){isNaN(b.descriptionWindowX)&&(b.descriptionWindowX=a.descriptionWindowX);isNaN(b.descriptionWindowY)&&(b.descriptionWindowY=a.descriptionWindowY);isNaN(b.descriptionWindowLeft)&&(b.descriptionWindowLeft=a.descriptionWindowLeft);isNaN(b.descriptionWindowRight)&&(b.descriptionWindowRight=a.descriptionWindowRight);isNaN(b.descriptionWindowTop)&&(b.descriptionWindowTop=a.descriptionWindowTop);isNaN(b.descriptionWindowBottom)&&(b.descriptionWindowBottom=a.descriptionWindowBottom);isNaN(b.descriptionWindowWidth)&&
|
300 |
-
(b.descriptionWindowWidth=a.descriptionWindowWidth);isNaN(b.descriptionWindowHeight)&&(b.descriptionWindowHeight=a.descriptionWindowHeight)};d.normalizePath=function(a){for(var b="",c=d.parsePath(a.getAttribute("d")),e,f,g=Infinity,h=-Infinity,k=Infinity,l=-Infinity,m=0;m<c.length;m++){var n=c[m],q=n.letter,
|
301 |
-
|
302 |
break;case "H":case "h":f.x=Number(d[1]);break;default:f.x=Number(d[1]),f.y=Number(d[2])}b.push(f)}return b};d.acos=function(a){return 1<a?0:-1>a?Math.PI:Math.acos(a)};d.asin=function(a){return 1<a?Math.PI/2:-1>a?-Math.PI/2:Math.asin(a)};d.sinci=function(a){return a?a/Math.sin(a):1};d.asqrt=function(a){return 0<a?Math.sqrt(a):0};d.winkel3=function(a,b){var c=d.aitoff(a,b);return[(c[0]+a/Math.PI*2)/2,(c[1]+b)/2]};d.winkel3.invert=function(a,b){var c=a,e=b,f=25,g=Math.PI/2;do var h=Math.cos(e),k=Math.sin(e),
|
303 |
-
l=Math.sin(2*e),m=k*k,n=h*h,q=Math.sin(c),
|
304 |
function(a,b){return[Math.cos(b)*Math.sin(a),Math.sin(b)]};d.equirectangular=function(a,b){return[a,b]};d.equirectangular.invert=function(a,b){return[a,b]};d.eckert5=function(a,b){var c=Math.PI;return[a*(1+Math.cos(b))/Math.sqrt(2+c),2*b/Math.sqrt(2+c)]};d.eckert5.invert=function(a,b){var c=Math.sqrt(2+Math.PI),d=b*c/2;return[c*a/(1+Math.cos(d)),d]};d.eckert6=function(a,b){for(var c=Math.PI,d=(1+c/2)*Math.sin(b),f=0,g=Infinity;10>f&&1E-5<Math.abs(g);f++)b-=g=(b+Math.sin(b)-d)/(1+Math.cos(b));d=Math.sqrt(2+
|
305 |
c);return[a*(1+Math.cos(b))/d,2*b/d]};d.eckert6.invert=function(a,b){var c=1+Math.PI/2,e=Math.sqrt(c/2);return[2*a*e/(1+Math.cos(b*=e)),d.asin((b+Math.sin(b))/c)]};d.mercator=function(a,b){b>=Math.PI/2-.02&&(b=Math.PI/2-.02);b<=-Math.PI/2+.02&&(b=-Math.PI/2+.02);return[a,Math.log(Math.tan(Math.PI/4+b/2))]};d.mercator.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Math.PI/2]};d.miller=function(a,b){return[a,1.25*Math.log(Math.tan(Math.PI/4+.4*b))]};d.miller.invert=function(a,b){return[a,2.5*
|
306 |
Math.atan(Math.exp(.8*b))-.625*Math.PI]};d.eckert3=function(a,b){var c=Math.PI,d=Math.sqrt(c*(4+c));return[2/d*a*(1+Math.sqrt(1-4*b*b/(c*c))),4/d*b]};d.eckert3.invert=function(a,b){var c=Math.PI,e=Math.sqrt(c*(4+c))/2;return[a*e/(1+d.asqrt(1-b*b*(4+c)/(4*c))),b*e/2]}})();(function(){var d=window.AmCharts;d.MapData=d.Class({inherits:d.MapObject,construct:function(){this.cname="MapData";d.MapData.base.construct.call(this);this.projection="mercator";this.topLatitude=90;this.bottomLatitude=-90;this.leftLongitude=-180;this.rightLongitude=180;this.zoomLevel=1;this.getAreasFromMap=!1}})})();(function(){var d=window.AmCharts;d.DescriptionWindow=d.Class({construct:function(){},show:function(a,b,c,d){var f=this;f.chart=a;var g=document.createElement("div");g.style.position="absolute";var h=a.classNamePrefix+"-description-";g.className="ammapDescriptionWindow "+h+"div";f.div=g;b.appendChild(g);var k=".gif";a.svgIcons&&(k=".svg");var l=document.createElement("img");l.className="ammapDescriptionWindowCloseButton "+h+"close-img";l.src=a.pathToImages+"xIcon"+k;l.style.cssFloat="right";l.style.cursor=
|
1 |
(function(){var d;window.AmCharts?d=window.AmCharts:(d={},window.AmCharts=d,d.themes={},d.maps={},d.inheriting={},d.charts=[],d.onReadyArray=[],d.useUTC=!1,d.updateRate=60,d.uid=0,d.lang={},d.translations={},d.mapTranslations={},d.windows={},d.initHandlers=[],d.amString="am",d.pmString="pm");d.Class=function(a){var b=function(){arguments[0]!==d.inheriting&&(this.events={},this.construct.apply(this,arguments))};a.inherits?(b.prototype=new a.inherits(d.inheriting),b.base=a.inherits.prototype,delete a.inherits):
|
2 |
(b.prototype.createEvents=function(){for(var a=0;a<arguments.length;a++)this.events[arguments[a]]=[]},b.prototype.listenTo=function(a,b,c){this.removeListener(a,b,c);a.events[b].push({handler:c,scope:this})},b.prototype.addListener=function(a,b,c){this.removeListener(this,a,b);a&&this.events[a]&&this.events[a].push({handler:b,scope:c})},b.prototype.removeListener=function(a,b,c){if(a&&a.events&&(a=a.events[b]))for(b=a.length-1;0<=b;b--)a[b].handler===c&&a.splice(b,1)},b.prototype.fire=function(a){for(var b=
|
3 |
+
this.events[a.type],c=0;c<b.length;c++){var d=b[c];d.handler.call(d.scope,a)}});for(var c in a)b.prototype[c]=a[c];return b};d.addChart=function(a){window.requestAnimationFrame?d.animationRequested||(d.animationRequested=!0,window.requestAnimationFrame(d.update)):d.updateInt||(d.updateInt=setInterval(function(){d.update()},Math.round(1E3/d.updateRate)));d.charts.push(a)};d.removeChart=function(a){for(var b=d.charts,c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1);0===b.length&&(d.requestAnimation&&(window.cancelAnimationFrame(d.requestAnimation),
|
4 |
+
d.animationRequested=!1),d.updateInt&&(clearInterval(d.updateInt),d.updateInt=NaN))};d.isModern=!0;d.getIEVersion=function(){var a=0,b,c;"Microsoft Internet Explorer"==navigator.appName&&(b=navigator.userAgent,c=/MSIE ([0-9]{1,}[.0-9]{0,})/,null!==c.exec(b)&&(a=parseFloat(RegExp.$1)));return a};d.applyLang=function(a,b){var c=d.translations;b.dayNames=d.extend({},d.dayNames);b.shortDayNames=d.extend({},d.shortDayNames);b.monthNames=d.extend({},d.monthNames);b.shortMonthNames=d.extend({},d.shortMonthNames);
|
5 |
+
b.amString="am";b.pmString="pm";c&&(c=c[a])&&(d.lang=c,b.langObj=c,c.monthNames&&(b.dayNames=d.extend({},c.dayNames),b.shortDayNames=d.extend({},c.shortDayNames),b.monthNames=d.extend({},c.monthNames),b.shortMonthNames=d.extend({},c.shortMonthNames)),c.am&&(b.amString=c.am),c.pm&&(b.pmString=c.pm));d.amString=b.amString;d.pmString=b.pmString};d.IEversion=d.getIEVersion();9>d.IEversion&&0<d.IEversion&&(d.isModern=!1,d.isIE=!0);d.dx=0;d.dy=0;if(document.addEventListener||window.opera)d.isNN=!0,d.isIE=
|
6 |
+
!1,d.dx=.5,d.dy=.5;document.attachEvent&&(d.isNN=!1,d.isIE=!0,d.isModern||(d.dx=0,d.dy=0));window.chrome&&(d.chrome=!0);d.handleMouseUp=function(a){for(var b=d.charts,c=0;c<b.length;c++){var e=b[c];e&&e.handleReleaseOutside&&e.handleReleaseOutside(a)}};d.handleMouseMove=function(a){for(var b=d.charts,c=0;c<b.length;c++){var e=b[c];e&&e.handleMouseMove&&e.handleMouseMove(a)}};d.handleWheel=function(a){for(var b=d.charts,c=0;c<b.length;c++){var e=b[c];if(e&&e.mouseIsOver){(e.mouseWheelScrollEnabled||
|
7 |
+
e.mouseWheelZoomEnabled)&&e.handleWheel&&e.handleWheel(a);break}}};d.resetMouseOver=function(){for(var a=d.charts,b=0;b<a.length;b++){var c=a[b];c&&(c.mouseIsOver=!1)}};d.ready=function(a){d.onReadyArray.push(a)};d.handleLoad=function(){d.isReady=!0;for(var a=d.onReadyArray,b=0;b<a.length;b++){var c=a[b];isNaN(d.processDelay)?c():setTimeout(c,d.processDelay*b)}};d.addInitHandler=function(a,b){d.initHandlers.push({method:a,types:b})};d.callInitHandler=function(a){var b=d.initHandlers;if(d.initHandlers)for(var c=
|
8 |
+
0;c<b.length;c++){var e=b[c];e.types?d.isInArray(e.types,a.type)&&e.method(a):e.method(a)}};d.getUniqueId=function(){d.uid++;return"AmChartsEl-"+d.uid};d.isNN&&(document.addEventListener("mousemove",d.handleMouseMove),document.addEventListener("mouseup",d.handleMouseUp,!0),window.addEventListener("load",d.handleLoad,!0),window.addEventListener("DOMMouseScroll",d.handleWheel,!0),document.addEventListener("mousewheel",d.handleWheel,!0));d.isIE&&(document.attachEvent("onmousemove",d.handleMouseMove),
|
9 |
+
document.attachEvent("onmouseup",d.handleMouseUp),window.attachEvent("onload",d.handleLoad),document.attachEvent("onmousewheel",d.handleWheel));d.clear=function(){var a=d.charts;if(a)for(var b=a.length-1;0<=b;b--)a[b].clear();d.updateInt&&clearInterval(d.updateInt);d.requestAnimation&&window.cancelAnimationFrame(d.requestAnimation);d.charts=[];d.isNN&&(document.removeEventListener("mousemove",d.handleMouseMove,!0),document.removeEventListener("mouseup",d.handleMouseUp,!0),window.removeEventListener("load",
|
10 |
+
d.handleLoad,!0),window.removeEventListener("DOMMouseScroll",d.handleWheel,!0),document.removeEventListener("mousewheel",d.handleWheel,!0));d.isIE&&(document.detachEvent("onmousemove",d.handleMouseMove),document.detachEvent("onmouseup",d.handleMouseUp),window.detachEvent("onload",d.handleLoad))};d.makeChart=function(a,b,c){var e=b.type,f=b.theme;d.isString(f)&&(f=d.themes[f],b.theme=f);var g;switch(e){case "serial":g=new d.AmSerialChart(f);break;case "xy":g=new d.AmXYChart(f);break;case "pie":g=new d.AmPieChart(f);
|
11 |
+
break;case "radar":g=new d.AmRadarChart(f);break;case "gauge":g=new d.AmAngularGauge(f);break;case "funnel":g=new d.AmFunnelChart(f);break;case "map":g=new d.AmMap(f);break;case "stock":g=new d.AmStockChart(f);break;case "gantt":g=new d.AmGanttChart(f)}d.extend(g,b);d.isReady?isNaN(c)?g.write(a):setTimeout(function(){d.realWrite(g,a)},c):d.ready(function(){isNaN(c)?g.write(a):setTimeout(function(){d.realWrite(g,a)},c)});return g};d.realWrite=function(a,b){a.write(b)};d.updateCount=0;d.validateAt=
|
12 |
+
Math.round(d.updateRate/10);d.update=function(){var a=d.charts;d.updateCount++;var b=!1;d.updateCount==d.validateAt&&(b=!0,d.updateCount=0);if(a)for(var c=a.length-1;0<=c;c--)a[c].update&&a[c].update(),b&&(a[c].autoResize?a[c].validateSize&&a[c].validateSize():a[c].premeasure&&a[c].premeasure());window.requestAnimationFrame&&(d.requestAnimation=window.requestAnimationFrame(d.update))};d.bezierX=3;d.bezierY=6;"complete"==document.readyState&&d.handleLoad()})();(function(){var d=window.AmCharts;d.toBoolean=function(a,b){if(void 0===a)return b;switch(String(a).toLowerCase()){case "true":case "yes":case "1":return!0;case "false":case "no":case "0":case null:return!1;default:return!!a}};d.removeFromArray=function(a,b){var c;if(void 0!==b&&void 0!==a)for(c=a.length-1;0<=c;c--)a[c]==b&&a.splice(c,1)};d.getPath=function(){var a=document.getElementsByTagName("script");if(a)for(var b=0;b<a.length;b++){var c=a[b].src;if(-1!==c.search(/\/(amcharts|ammap)\.js/))return c.replace(/\/(amcharts|ammap)\.js.*/,
|
13 |
"/")}};d.normalizeUrl=function(a){return""!==a&&-1===a.search(/\/$/)?a+"/":a};d.isAbsolute=function(a){return 0===a.search(/^http[s]?:|^\//)};d.isInArray=function(a,b){for(var c=0;c<a.length;c++)if(a[c]==b)return!0;return!1};d.getDecimals=function(a){var b=0;isNaN(a)||(a=String(a),-1!=a.indexOf("e-")?b=Number(a.split("-")[1]):-1!=a.indexOf(".")&&(b=a.split(".")[1].length));return b};d.wordwrap=function(a,b,c,e){var f,g,h,k;a+="";if(1>b)return a;f=-1;for(a=(k=a.split(/\r\n|\n|\r/)).length;++f<a;k[f]+=
|
14 |
h){h=k[f];for(k[f]="";h.length>b;k[f]+=d.trim(h.slice(0,g))+((h=h.slice(g)).length?c:""))g=2==e||(g=h.slice(0,b+1).match(/\S*(\s)?$/))[1]?b:g.input.length-g[0].length||1==e&&b||g.input.length+(g=h.slice(b).match(/^\S*/))[0].length;h=d.trim(h)}return k.join(c)};d.trim=function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};d.wrappedText=function(a,b,c,e,f,g,h,k){var l=d.text(a,b,c,e,f,g,h);if(l){var m=l.getBBox();if(m.width>k){var n="\n";d.isModern||(n="<br>");k=Math.floor(k/(m.width/
|
15 |
b.length));2<k&&(k-=2);b=d.wordwrap(b,k,n,!0);l.remove();l=d.text(a,b,c,e,f,g,h)}}return l};d.getStyle=function(a,b){var c="";if(document.defaultView&&document.defaultView.getComputedStyle)try{c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b)}catch(e){}else a.currentStyle&&(b=b.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),c=a.currentStyle[b]);return c};d.removePx=function(a){if(void 0!==a)return Number(a.substring(0,a.length-2))};d.getURL=function(a,b){if(a)if("_self"!=
|
23 |
function(){return"#"+("00000"+(16777216*Math.random()<<0).toString(16)).substr(-6)};d.hitTest=function(a,b,c){var e=!1,f=a.x,g=a.x+a.width,h=a.y,k=a.y+a.height,l=d.isInRectangle;e||(e=l(f,h,b));e||(e=l(f,k,b));e||(e=l(g,h,b));e||(e=l(g,k,b));e||!0===c||(e=d.hitTest(b,a,!0));return e};d.isInRectangle=function(a,b,c){return a>=c.x-5&&a<=c.x+c.width+5&&b>=c.y-5&&b<=c.y+c.height+5?!0:!1};d.isPercents=function(a){if(-1!=String(a).indexOf("%"))return!0};d.formatValue=function(a,b,c,e,f,g,h,k){if(b){void 0===
|
24 |
f&&(f="");var l;for(l=0;l<c.length;l++){var m=c[l],n=b[m];void 0!==n&&(n=g?d.addPrefix(n,k,h,e):d.formatNumber(n,e),a=a.replace(new RegExp("\\[\\["+f+""+m+"\\]\\]","g"),n))}}return a};d.formatDataContextValue=function(a,b){if(a){var c=a.match(/\[\[.*?\]\]/g),e;for(e=0;e<c.length;e++){var d=c[e],d=d.substr(2,d.length-4);void 0!==b[d]&&(a=a.replace(new RegExp("\\[\\["+d+"\\]\\]","g"),b[d]))}}return a};d.massReplace=function(a,b){for(var c in b)if(b.hasOwnProperty(c)){var e=b[c];void 0===e&&(e="");a=
|
25 |
a.replace(c,e)}return a};d.cleanFromEmpty=function(a){return a.replace(/\[\[[^\]]*\]\]/g,"")};d.addPrefix=function(a,b,c,e,f){var g=d.formatNumber(a,e),h="",k,l,m;if(0===a)return"0";0>a&&(h="-");a=Math.abs(a);if(1<a)for(k=b.length-1;-1<k;k--){if(a>=b[k].number&&(l=a/b[k].number,m=Number(e.precision),1>m&&(m=1),c=d.roundTo(l,m),m=d.formatNumber(c,{precision:-1,decimalSeparator:e.decimalSeparator,thousandsSeparator:e.thousandsSeparator}),!f||l==c)){g=h+""+m+""+b[k].prefix;break}}else for(k=0;k<c.length;k++)if(a<=
|
26 |
+
c[k].number){l=a/c[k].number;m=Math.abs(Math.floor(Math.log(l)*Math.LOG10E));l=d.roundTo(l,m);g=h+""+l+""+c[k].prefix;break}return g};d.remove=function(a){a&&a.remove()};d.getEffect=function(a){">"==a&&(a="easeOutSine");"<"==a&&(a="easeInSine");"elastic"==a&&(a="easeOutElastic");return a};d.getObjById=function(a,b){var c,e;for(e=0;e<a.length;e++){var d=a[e];if(d.id==b){c=d;break}}return c};d.applyTheme=function(a,b,c){b||(b=d.theme);try{b=JSON.parse(JSON.stringify(b))}catch(e){}b&&b[c]&&d.extend(a,
|
27 |
+
b[c])};d.isString=function(a){return"string"==typeof a?!0:!1};d.extend=function(a,b,c){var e;a||(a={});for(e in b)c?a.hasOwnProperty(e)||(a[e]=b[e]):a[e]=b[e];return a};d.copyProperties=function(a,b){for(var c in a)a.hasOwnProperty(c)&&"events"!=c&&void 0!==a[c]&&"function"!=typeof a[c]&&"cname"!=c&&(b[c]=a[c])};d.processObject=function(a,b,c,e){if(!1===a instanceof b&&(a=e?d.extend(new b(c),a):d.extend(a,new b(c),!0),a.listeners))for(var f in a.listeners)b=a.listeners[f],a.addListener(b.event,b.method);
|
28 |
+
return a};d.fixNewLines=function(a){var b=RegExp("\\n","g");a&&(a=a.replace(b,"<br />"));return a};d.fixBrakes=function(a){if(d.isModern){var b=RegExp("<br>","g");a&&(a=a.replace(b,"\n"))}else a=d.fixNewLines(a);return a};d.deleteObject=function(a,b){if(a){if(void 0===b||null===b)b=20;if(0!==b)if("[object Array]"===Object.prototype.toString.call(a))for(var c=0;c<a.length;c++)d.deleteObject(a[c],b-1),a[c]=null;else if(a&&!a.tagName)try{for(c in a.theme=null,a)a[c]&&("object"==typeof a[c]&&d.deleteObject(a[c],
|
29 |
+
b-1),"function"!=typeof a[c]&&(a[c]=null))}catch(e){}}};d.bounce=function(a,b,c,e,d){return(b/=d)<1/2.75?7.5625*e*b*b+c:b<2/2.75?e*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?e*(7.5625*(b-=2.25/2.75)*b+.9375)+c:e*(7.5625*(b-=2.625/2.75)*b+.984375)+c};d.easeInOutQuad=function(a,b,c,e,d){b/=d/2;if(1>b)return e/2*b*b+c;b--;return-e/2*(b*(b-2)-1)+c};d.easeInSine=function(a,b,c,e,d){return-e*Math.cos(b/d*(Math.PI/2))+e+c};d.easeOutSine=function(a,b,c,e,d){return e*Math.sin(b/d*(Math.PI/2))+c};d.easeOutElastic=
|
30 |
+
function(a,b,c,e,d){a=1.70158;var g=0,h=e;if(0===b)return c;if(1==(b/=d))return c+e;g||(g=.3*d);h<Math.abs(e)?(h=e,a=g/4):a=g/(2*Math.PI)*Math.asin(e/h);return h*Math.pow(2,-10*b)*Math.sin(2*(b*d-a)*Math.PI/g)+e+c};d.fixStepE=function(a){a=a.toExponential(0).split("e");var b=Number(a[1]);9==Number(a[0])&&b++;return d.generateNumber(1,b)};d.generateNumber=function(a,b){var c="",e;e=0>b?Math.abs(b)-1:Math.abs(b);var d;for(d=0;d<e;d++)c+="0";return 0>b?Number("0."+c+String(a)):Number(String(a)+c)};d.setCN=
|
31 |
+
function(a,b,c,e){if(a.addClassNames&&b&&(b=b.node)&&c){var d=b.getAttribute("class");a=a.classNamePrefix+"-";e&&(a="");d?b.setAttribute("class",d+" "+a+c):b.setAttribute("class",a+c)}};d.removeCN=function(a,b,c){b&&(b=b.node)&&c&&(b=b.classList)&&b.remove(a.classNamePrefix+"-"+c)};d.parseDefs=function(a,b){for(var c in a){var e=typeof a[c];if(0<a[c].length&&"object"==e)for(var f=0;f<a[c].length;f++)e=document.createElementNS(d.SVG_NS,c),b.appendChild(e),d.parseDefs(a[c][f],e);else"object"==e?(e=
|
32 |
+
document.createElementNS(d.SVG_NS,c),b.appendChild(e),d.parseDefs(a[c],e)):b.setAttribute(c,a[c])}}})();(function(){var d=window.AmCharts;d.AmDraw=d.Class({construct:function(a,b,c,e){d.SVG_NS="http://www.w3.org/2000/svg";d.SVG_XLINK="http://www.w3.org/1999/xlink";d.hasSVG=!!document.createElementNS&&!!document.createElementNS(d.SVG_NS,"svg").createSVGRect;1>b&&(b=10);1>c&&(c=10);this.div=a;this.width=b;this.height=c;this.rBin=document.createElement("div");d.hasSVG?(d.SVG=!0,b=this.createSvgElement("svg"),a.appendChild(b),this.container=b,this.addDefs(e),this.R=new d.SVGRenderer(this)):d.isIE&&d.VMLRenderer&&
|
33 |
(d.VML=!0,d.vmlStyleSheet||(document.namespaces.add("amvml","urn:schemas-microsoft-com:vml"),31>document.styleSheets.length?(b=document.createStyleSheet(),b.addRule(".amvml","behavior:url(#default#VML); display:inline-block; antialias:true"),d.vmlStyleSheet=b):document.styleSheets[0].addRule(".amvml","behavior:url(#default#VML); display:inline-block; antialias:true")),this.container=a,this.R=new d.VMLRenderer(this,e),this.R.disableSelection(a))},createSvgElement:function(a){return document.createElementNS(d.SVG_NS,
|
34 |
a)},circle:function(a,b,c,e){var f=new d.AmDObject("circle",this);f.attr({r:c,cx:a,cy:b});this.addToContainer(f.node,e);return f},ellipse:function(a,b,c,e,f){var g=new d.AmDObject("ellipse",this);g.attr({rx:c,ry:e,cx:a,cy:b});this.addToContainer(g.node,f);return g},setSize:function(a,b){0<a&&0<b&&(this.container.style.width=a+"px",this.container.style.height=b+"px")},rect:function(a,b,c,e,f,g,h){var k=new d.AmDObject("rect",this);d.VML&&(f=Math.round(100*f/Math.min(c,e)),c+=2*g,e+=2*g,k.bw=g,k.node.style.marginLeft=
|
35 |
-g,k.node.style.marginTop=-g);1>c&&(c=1);1>e&&(e=1);k.attr({x:a,y:b,width:c,height:e,rx:f,ry:f,"stroke-width":g});this.addToContainer(k.node,h);return k},image:function(a,b,c,e,f,g){var h=new d.AmDObject("image",this);h.attr({x:b,y:c,width:e,height:f});this.R.path(h,a);this.addToContainer(h.node,g);return h},addToContainer:function(a,b){b||(b=this.container);b.appendChild(a)},text:function(a,b,c){return this.R.text(a,b,c)},path:function(a,b,c,e){var f=new d.AmDObject("path",this);e||(e="100,100");
|
49 |
g&&this.D.remove(g);b=document.createElementNS(d.SVG_NS,b);g=d.getUniqueId();b.setAttribute("id",g);if(!isNaN(e)){var h=0,k=0,l=0,m=0;90==e?l=100:270==e?m=100:180==e?h=100:0===e&&(k=100);b.setAttribute("x1",h+"%");b.setAttribute("x2",k+"%");b.setAttribute("y1",l+"%");b.setAttribute("y2",m+"%")}for(e=0;e<c.length;e++)h=document.createElementNS(d.SVG_NS,"stop"),k=100*e/(c.length-1),0===e&&(k=0),h.setAttribute("offset",k+"%"),h.setAttribute("stop-color",c[e]),b.appendChild(h);f.parentNode.appendChild(b);
|
50 |
c="#";d.baseHref&&!d.isIE&&(c=this.removeTarget(window.location.href)+c);f.setAttribute("fill","url("+c+g+")");a.grad=b},removeTarget:function(a){return a.split("#")[0]},pattern:function(a,b,c,e){var f=a.node;isNaN(c)&&(c=1);var g=a.patternNode;g&&this.D.remove(g);var g=document.createElementNS(d.SVG_NS,"pattern"),h=d.getUniqueId(),k=b;b.url&&(k=b.url);d.isAbsolute(k)||-1!=k.indexOf("data:image")||(k=e+k);e=Number(b.width);isNaN(e)&&(e=4);var l=Number(b.height);isNaN(l)&&(l=4);e/=c;l/=c;c=b.x;isNaN(c)&&
|
51 |
(c=0);var m=-Math.random()*Number(b.randomX);isNaN(m)||(c=m);m=b.y;isNaN(m)&&(m=0);var n=-Math.random()*Number(b.randomY);isNaN(n)||(m=n);g.setAttribute("id",h);g.setAttribute("width",e);g.setAttribute("height",l);g.setAttribute("patternUnits","userSpaceOnUse");g.setAttribute("xlink:href",k);b.color&&(n=document.createElementNS(d.SVG_NS,"rect"),n.setAttributeNS(null,"height",e),n.setAttributeNS(null,"width",l),n.setAttributeNS(null,"fill",b.color),g.appendChild(n));this.D.image(k,0,0,e,l,g).translate(c,
|
52 |
+
m);k="#";d.baseHref&&!d.isIE&&(k=this.removeTarget(window.location.href)+k);f.setAttribute("fill","url("+k+h+")");a.patternNode=g;f.parentNode.appendChild(g)},remove:function(a){a.clipPath&&this.D.remove(a.clipPath);a.grad&&this.D.remove(a.grad);a.patternNode&&this.D.remove(a.patternNode);this.D.remove(a.node)}})})();(function(){var d=window.AmCharts;d.AmChart=d.Class({construct:function(a){this.svgIcons=this.tapToActivate=!0;this.theme=a;this.classNamePrefix="amcharts";this.addClassNames=!1;this.version="3.20.17";d.addChart(this);this.createEvents("buildStarted","dataUpdated","init","rendered","drawn","failed","resized","animationFinished");this.height=this.width="100%";this.dataChanged=!0;this.chartCreated=!1;this.previousWidth=this.previousHeight=0;this.backgroundColor="#FFFFFF";this.borderAlpha=this.backgroundAlpha=
|
53 |
0;this.color=this.borderColor="#000000";this.fontFamily="Verdana";this.fontSize=11;this.usePrefixes=!1;this.autoResize=!0;this.autoDisplay=!1;this.addCodeCredits=this.accessible=!0;this.touchStartTime=this.touchClickDuration=0;this.precision=-1;this.percentPrecision=2;this.decimalSeparator=".";this.thousandsSeparator=",";this.labels=[];this.allLabels=[];this.titles=[];this.marginRight=this.marginLeft=this.autoMarginOffset=0;this.timeOuts=[];this.creditsPosition="top-left";var b=document.createElement("div"),
|
54 |
c=b.style;c.overflow="hidden";c.position="relative";c.textAlign="left";this.chartDiv=b;b=document.createElement("div");c=b.style;c.overflow="hidden";c.position="relative";c.textAlign="left";this.legendDiv=b;this.titleHeight=0;this.hideBalloonTime=150;this.handDrawScatter=2;this.cssScale=this.handDrawThickness=1;this.cssAngle=0;this.prefixesOfBigNumbers=[{number:1E3,prefix:"k"},{number:1E6,prefix:"M"},{number:1E9,prefix:"G"},{number:1E12,prefix:"T"},{number:1E15,prefix:"P"},{number:1E18,prefix:"E"},
|
55 |
+
{number:1E21,prefix:"Z"},{number:1E24,prefix:"Y"}];this.prefixesOfSmallNumbers=[{number:1E-24,prefix:"y"},{number:1E-21,prefix:"z"},{number:1E-18,prefix:"a"},{number:1E-15,prefix:"f"},{number:1E-12,prefix:"p"},{number:1E-9,prefix:"n"},{number:1E-6,prefix:"\u03bc"},{number:.001,prefix:"m"}];this.panEventsEnabled=!0;this.product="amcharts";this.animations=[];this.balloon=new d.AmBalloon(this.theme);this.balloon.chart=this;this.processTimeout=0;this.processCount=1E3;this.animatable=[];this.langObj={};
|
56 |
+
d.applyTheme(this,a,"AmChart")},drawChart:function(){0<this.realWidth&&0<this.realHeight&&(this.drawBackground(),this.redrawLabels(),this.drawTitles(),this.brr(),this.renderFix(),this.chartDiv&&(this.boundingRect=this.chartDiv.getBoundingClientRect()))},makeAccessible:function(a,b,c){this.accessible&&a&&(c&&a.setAttr("role",c),a.setAttr("aria-label",b))},drawBackground:function(){d.remove(this.background);var a=this.container,b=this.backgroundColor,c=this.backgroundAlpha,e=this.set;d.isModern||0!==
|
57 |
+
c||(c=.001);var f=this.updateWidth();this.realWidth=f;var g=this.updateHeight();this.realHeight=g;b=d.polygon(a,[0,f-1,f-1,0],[0,0,g-1,g-1],b,c,1,this.borderColor,this.borderAlpha);d.setCN(this,b,"bg");this.background=b;e.push(b);if(b=this.backgroundImage)a=a.image(b,0,0,f,g),d.setCN(this,b,"bg-image"),this.bgImg=a,e.push(a)},drawTitles:function(a){var b=this.titles;this.titleHeight=0;if(d.ifArray(b)){var c=20,e;for(e=0;e<b.length;e++){var f=b[e],f=d.processObject(f,d.Title,this.theme);if(!1!==f.enabled){var g=
|
58 |
+
f.color;void 0===g&&(g=this.color);var h=f.size;isNaN(h)&&(h=this.fontSize+2);isNaN(f.alpha);var k=this.marginLeft,l=!0;void 0!==f.bold&&(l=f.bold);g=d.wrappedText(this.container,f.text,g,this.fontFamily,h,"middle",l,this.realWidth-35);g.translate(k+(this.realWidth-this.marginRight-k)/2,c);g.node.style.pointerEvents="none";f.sprite=g;void 0!==f.tabIndex&&g.setAttr("tabindex",f.tabIndex);d.setCN(this,g,"title");f.id&&d.setCN(this,g,"title-"+f.id);g.attr({opacity:f.alpha});c+=g.getBBox().height+5;a?
|
59 |
+
g.remove():this.freeLabelsSet.push(g)}}this.titleHeight=c-10}},write:function(a){var b=this;if(b.listeners)for(var c=0;c<b.listeners.length;c++){var e=b.listeners[c];b.addListener(e.event,e.method)}b.fire({type:"buildStarted",chart:b});b.afterWriteTO&&clearTimeout(b.afterWriteTO);0<b.processTimeout?b.afterWriteTO=setTimeout(function(){b.afterWrite.call(b,a)},b.processTimeout):b.afterWrite(a)},afterWrite:function(a){var b;if(b="object"!=typeof a?document.getElementById(a):a){for(;b.firstChild;)b.removeChild(b.firstChild);
|
60 |
+
this.div=b;b.style.overflow="hidden";b.style.textAlign="left";a=this.chartDiv;var c=this.legendDiv,e=this.legend,f=c.style,g=a.style;this.measure();this.previousHeight=this.divRealHeight;this.previousWidth=this.divRealWidth;var h,k=document.createElement("div");h=k.style;h.position="relative";this.containerDiv=k;k.className=this.classNamePrefix+"-main-div";a.className=this.classNamePrefix+"-chart-div";b.appendChild(k);(b=this.exportConfig)&&d.AmExport&&!this.AmExport&&(this.AmExport=new d.AmExport(this,
|
61 |
+
b));this.amExport&&d.AmExport&&(this.AmExport=d.extend(this.amExport,new d.AmExport(this),!0));this.AmExport&&this.AmExport.init&&this.AmExport.init();if(e){e=this.addLegend(e,e.divId);if(e.enabled)switch(f.left=null,f.top=null,f.right=null,g.left=null,g.right=null,g.top=null,f.position="relative",g.position="relative",h.width="100%",h.height="100%",e.position){case "bottom":k.appendChild(a);k.appendChild(c);break;case "top":k.appendChild(c);k.appendChild(a);break;case "absolute":f.position="absolute";
|
62 |
+
g.position="absolute";void 0!==e.left&&(f.left=e.left+"px");void 0!==e.right&&(f.right=e.right+"px");void 0!==e.top&&(f.top=e.top+"px");void 0!==e.bottom&&(f.bottom=e.bottom+"px");e.marginLeft=0;e.marginRight=0;k.appendChild(a);k.appendChild(c);break;case "right":f.position="relative";g.position="absolute";k.appendChild(a);k.appendChild(c);break;case "left":f.position="absolute";g.position="relative";k.appendChild(a);k.appendChild(c);break;case "outside":k.appendChild(a)}else k.appendChild(a);this.prevLegendPosition=
|
63 |
+
e.position}else k.appendChild(a);this.listenersAdded||(this.addListeners(),this.listenersAdded=!0);this.initChart()}},createLabelsSet:function(){d.remove(this.labelsSet);this.labelsSet=this.container.set();this.freeLabelsSet.push(this.labelsSet)},initChart:function(){this.balloon=d.processObject(this.balloon,d.AmBalloon,this.theme);window.AmCharts_path&&(this.path=window.AmCharts_path);void 0===this.path&&(this.path=d.getPath());void 0===this.path&&(this.path="amcharts/");this.path=d.normalizeUrl(this.path);
|
64 |
+
void 0===this.pathToImages&&(this.pathToImages=this.path+"images/");this.initHC||(d.callInitHandler(this),this.initHC=!0);d.applyLang(this.language,this);var a=this.numberFormatter;a&&(isNaN(a.precision)||(this.precision=a.precision),void 0!==a.thousandsSeparator&&(this.thousandsSeparator=a.thousandsSeparator),void 0!==a.decimalSeparator&&(this.decimalSeparator=a.decimalSeparator));(a=this.percentFormatter)&&!isNaN(a.precision)&&(this.percentPrecision=a.precision);this.nf={precision:this.precision,
|
65 |
+
thousandsSeparator:this.thousandsSeparator,decimalSeparator:this.decimalSeparator};this.pf={precision:this.percentPrecision,thousandsSeparator:this.thousandsSeparator,decimalSeparator:this.decimalSeparator};this.destroy();(a=this.container)?(a.container.innerHTML="",a.width=this.realWidth,a.height=this.realHeight,a.addDefs(this),this.chartDiv.appendChild(a.container)):a=new d.AmDraw(this.chartDiv,this.realWidth,this.realHeight,this);this.container=a;this.extension=".png";this.svgIcons&&d.SVG&&(this.extension=
|
66 |
+
".svg");this.checkDisplay();this.checkTransform(this.div);a.chart=this;d.VML||d.SVG?(a.handDrawn=this.handDrawn,a.handDrawScatter=this.handDrawScatter,a.handDrawThickness=this.handDrawThickness,d.remove(this.set),this.set=a.set(),d.remove(this.gridSet),this.gridSet=a.set(),d.remove(this.cursorLineSet),this.cursorLineSet=a.set(),d.remove(this.graphsBehindSet),this.graphsBehindSet=a.set(),d.remove(this.bulletBehindSet),this.bulletBehindSet=a.set(),d.remove(this.columnSet),this.columnSet=a.set(),d.remove(this.graphsSet),
|
67 |
+
this.graphsSet=a.set(),d.remove(this.trendLinesSet),this.trendLinesSet=a.set(),d.remove(this.axesSet),this.axesSet=a.set(),d.remove(this.cursorSet),this.cursorSet=a.set(),d.remove(this.scrollbarsSet),this.scrollbarsSet=a.set(),d.remove(this.bulletSet),this.bulletSet=a.set(),d.remove(this.freeLabelsSet),this.freeLabelsSet=a.set(),d.remove(this.axesLabelsSet),this.axesLabelsSet=a.set(),d.remove(this.balloonsSet),this.balloonsSet=a.set(),d.remove(this.plotBalloonsSet),this.plotBalloonsSet=a.set(),d.remove(this.zoomButtonSet),
|
68 |
+
this.zoomButtonSet=a.set(),d.remove(this.zbSet),this.zbSet=null,d.remove(this.linkSet),this.linkSet=a.set()):this.fire({type:"failed",chart:this})},premeasure:function(){var a=this.div;if(a){try{this.boundingRect=this.chartDiv.getBoundingClientRect()}catch(e){}var b=a.offsetWidth,c=a.offsetHeight;a.clientHeight&&(b=a.clientWidth,c=a.clientHeight);if(b!=this.mw||c!=this.mh)this.mw=b,this.mh=c,this.measure()}},measure:function(){var a=this.div;if(a){var b=this.chartDiv,c=a.offsetWidth,e=a.offsetHeight,
|
69 |
+
f=this.container;a.clientHeight&&(c=a.clientWidth,e=a.clientHeight);var e=Math.round(e),c=Math.round(c),a=Math.round(d.toCoordinate(this.width,c)),g=Math.round(d.toCoordinate(this.height,e));(c!=this.previousWidth||e!=this.previousHeight)&&0<a&&0<g&&(b.style.width=a+"px",b.style.height=g+"px",b.style.padding=0,f&&f.setSize(a,g),this.balloon=d.processObject(this.balloon,d.AmBalloon,this.theme));this.updateWidth();this.balloon.chart=this;this.realWidth=a;this.realHeight=g;this.divRealWidth=c;this.divRealHeight=
|
70 |
+
e}},checkDisplay:function(){if(this.autoDisplay&&this.container){var a=d.rect(this.container,10,10),b=a.getBBox();0===b.width&&0===b.height&&(this.divRealHeight=this.divRealWidth=this.realHeight=this.realWidth=0,this.previousWidth=this.previousHeight=NaN);a.remove()}},checkTransform:function(a){if(this.autoTransform&&window.getComputedStyle&&a){if(a.style){var b=window.getComputedStyle(a,null);if(b&&(b=b.getPropertyValue("-webkit-transform")||b.getPropertyValue("-moz-transform")||b.getPropertyValue("-ms-transform")||
|
71 |
+
b.getPropertyValue("-o-transform")||b.getPropertyValue("transform"))&&"none"!==b){var c=b.split("(")[1].split(")")[0].split(","),b=c[0],c=c[1],b=Math.sqrt(b*b+c*c);isNaN(b)||(this.cssScale*=b)}}a.parentNode&&this.checkTransform(a.parentNode)}},destroy:function(){this.chartDiv.innerHTML="";this.clearTimeOuts();this.legend&&this.legend.destroy()},clearTimeOuts:function(){var a=this.timeOuts;if(a){var b;for(b=0;b<a.length;b++)clearTimeout(a[b])}this.timeOuts=[]},clear:function(a){try{document.removeEventListener("touchstart",
|
72 |
+
this.docfn1,!0),document.removeEventListener("touchend",this.docfn2,!0)}catch(b){}d.callMethod("clear",[this.chartScrollbar,this.scrollbarV,this.scrollbarH,this.chartCursor]);this.chartCursor=this.scrollbarH=this.scrollbarV=this.chartScrollbar=null;this.clearTimeOuts();this.container&&(this.container.remove(this.chartDiv),this.container.remove(this.legendDiv));a||d.removeChart(this);if(a=this.div)for(;a.firstChild;)a.removeChild(a.firstChild);this.legend&&this.legend.destroy();this.AmExport&&this.AmExport.clear&&
|
73 |
+
this.AmExport.clear()},setMouseCursor:function(a){"auto"==a&&d.isNN&&(a="default");this.chartDiv.style.cursor=a;this.legendDiv.style.cursor=a},redrawLabels:function(){this.labels=[];var a=this.allLabels;this.createLabelsSet();var b;for(b=0;b<a.length;b++)this.drawLabel(a[b])},drawLabel:function(a){var b=this;if(b.container&&!1!==a.enabled){a=d.processObject(a,d.Label,b.theme);var c=a.y,e=a.text,f=a.align,g=a.size,h=a.color,k=a.rotation,l=a.alpha,m=a.bold,n=d.toCoordinate(a.x,b.realWidth),c=d.toCoordinate(c,
|
74 |
+
b.realHeight);n||(n=0);c||(c=0);void 0===h&&(h=b.color);isNaN(g)&&(g=b.fontSize);f||(f="start");"left"==f&&(f="start");"right"==f&&(f="end");"center"==f&&(f="middle",k?c=b.realHeight-c+c/2:n=b.realWidth/2-n);void 0===l&&(l=1);void 0===k&&(k=0);c+=g/2;e=d.text(b.container,e,h,b.fontFamily,g,f,m,l);e.translate(n,c);void 0!==a.tabIndex&&e.setAttr("tabindex",a.tabIndex);d.setCN(b,e,"label");a.id&&d.setCN(b,e,"label-"+a.id);0!==k&&e.rotate(k);a.url?(e.setAttr("cursor","pointer"),e.click(function(){d.getURL(a.url,
|
75 |
+
b.urlTarget)})):e.node.style.pointerEvents="none";b.labelsSet.push(e);b.labels.push(e)}},addLabel:function(a,b,c,e,d,g,h,k,l,m){a={x:a,y:b,text:c,align:e,size:d,color:g,alpha:k,rotation:h,bold:l,url:m,enabled:!0};this.container&&this.drawLabel(a);this.allLabels.push(a)},clearLabels:function(){var a=this.labels,b;for(b=a.length-1;0<=b;b--)a[b].remove();this.labels=[];this.allLabels=[]},updateHeight:function(){var a=this.divRealHeight,b=this.legend;if(b){var c=this.legendDiv.offsetHeight,b=b.position;
|
76 |
+
if("top"==b||"bottom"==b){a-=c;if(0>a||isNaN(a))a=0;this.chartDiv.style.height=a+"px"}}return a},updateWidth:function(){var a=this.divRealWidth,b=this.divRealHeight,c=this.legend;if(c){var e=this.legendDiv,d=e.offsetWidth;isNaN(c.width)||(d=c.width);c.ieW&&(d=c.ieW);var g=e.offsetHeight,e=e.style,h=this.chartDiv.style,c=c.position;if("right"==c||"left"==c){a-=d;if(0>a||isNaN(a))a=0;h.width=a+"px";this.balloon.setBounds(2,2,a-2,this.realHeight);"left"==c?(h.left=d+"px",e.left="0px"):(h.left="0px",
|
77 |
+
e.left=a+"px");b>g&&(e.top=(b-g)/2+"px")}}return a},getTitleHeight:function(){this.drawTitles(!0);return this.titleHeight},addTitle:function(a,b,c,e,d){isNaN(b)&&(b=this.fontSize+2);a={text:a,size:b,color:c,alpha:e,bold:d,enabled:!0};this.titles.push(a);return a},handleWheel:function(a){var b=0;a||(a=window.event);a.wheelDelta?b=a.wheelDelta/120:a.detail&&(b=-a.detail/3);b&&this.handleWheelReal(b,a.shiftKey);a.preventDefault&&a.preventDefault()},handleWheelReal:function(){},handleDocTouchStart:function(){var a=
|
78 |
+
this;setTimeout(function(){a.hideBalloonReal()},300);a.handleMouseMove();a.tmx=a.mouseX;a.tmy=a.mouseY;a.touchStartTime=(new Date).getTime()},handleDocTouchEnd:function(){-.5<this.tmx&&this.tmx<this.divRealWidth+1&&0<this.tmy&&this.tmy<this.divRealHeight?(this.handleMouseMove(),4>Math.abs(this.mouseX-this.tmx)&&4>Math.abs(this.mouseY-this.tmy)?(this.tapped=!0,this.panRequired&&this.panEventsEnabled&&this.chartDiv&&(this.chartDiv.style.msTouchAction="none",this.chartDiv.style.touchAction="none")):
|
79 |
+
this.mouseIsOver||this.resetTouchStyle()):(this.tapped=!1,this.resetTouchStyle())},resetTouchStyle:function(){this.panEventsEnabled&&this.chartDiv&&(this.chartDiv.style.msTouchAction="auto",this.chartDiv.style.touchAction="auto")},checkTouchDuration:function(a){var b=this,c=(new Date).getTime();if(a)if(a.touches)b.isTouchEvent=!0;else if(!b.isTouchEvent)return!0;if(c-b.touchStartTime>b.touchClickDuration)return!0;setTimeout(function(){b.resetTouchDuration()},300)},resetTouchDuration:function(){this.isTouchEvent=
|
80 |
+
!1},checkTouchMoved:function(){if(4<Math.abs(this.mouseX-this.tmx)||4<Math.abs(this.mouseY-this.tmy))return!0},addListeners:function(){var a=this,b=a.chartDiv;document.addEventListener?("ontouchstart"in document.documentElement&&(b.addEventListener("touchstart",function(b){a.handleTouchStart.call(a,b)},!0),b.addEventListener("touchmove",function(b){a.handleMouseMove.call(a,b)},!0),b.addEventListener("touchend",function(b){a.handleTouchEnd.call(a,b)},!0),a.docfn1=function(b){a.handleDocTouchStart.call(a,
|
81 |
+
b)},a.docfn2=function(b){a.handleDocTouchEnd.call(a,b)},document.addEventListener("touchstart",a.docfn1,!0),document.addEventListener("touchend",a.docfn2,!0)),b.addEventListener("mousedown",function(b){a.mouseIsOver=!0;a.handleMouseMove.call(a,b);a.handleMouseDown.call(a,b);a.handleDocTouchStart.call(a,b)},!0),b.addEventListener("mouseover",function(b){a.handleMouseOver.call(a,b)},!0),b.addEventListener("mouseout",function(b){a.handleMouseOut.call(a,b)},!0),b.addEventListener("mouseup",function(b){a.handleDocTouchEnd.call(a,
|
82 |
+
b)},!0)):(b.attachEvent("onmousedown",function(b){a.handleMouseDown.call(a,b)}),b.attachEvent("onmouseover",function(b){a.handleMouseOver.call(a,b)}),b.attachEvent("onmouseout",function(b){a.handleMouseOut.call(a,b)}))},dispDUpd:function(){this.skipEvents||(this.dispatchDataUpdated&&(this.dispatchDataUpdated=!1,this.fire({type:"dataUpdated",chart:this})),this.chartCreated||(this.chartCreated=!0,this.fire({type:"init",chart:this})),this.chartRendered||(this.fire({type:"rendered",chart:this}),this.chartRendered=
|
83 |
+
!0),this.fire({type:"drawn",chart:this}));this.skipEvents=!1},validateSize:function(){var a=this;a.premeasure();a.checkDisplay();a.cssScale=1;a.cssAngle=0;a.checkTransform(a.div);if(a.divRealWidth!=a.previousWidth||a.divRealHeight!=a.previousHeight){var b=a.legend;if(0<a.realWidth&&0<a.realHeight){a.sizeChanged=!0;if(b){a.legendInitTO&&clearTimeout(a.legendInitTO);var c=setTimeout(function(){b.invalidateSize()},10);a.timeOuts.push(c);a.legendInitTO=c}a.marginsUpdated=!1;clearTimeout(a.initTO);c=setTimeout(function(){a.initChart()},
|
84 |
+
10);a.timeOuts.push(c);a.initTO=c}a.renderFix();b&&b.renderFix&&b.renderFix();clearTimeout(a.resizedTO);a.resizedTO=setTimeout(function(){a.fire({type:"resized",chart:a})},10);a.previousHeight=a.divRealHeight;a.previousWidth=a.divRealWidth}},invalidateSize:function(){this.previousHeight=this.previousWidth=NaN;this.invalidateSizeReal()},invalidateSizeReal:function(){var a=this;a.marginsUpdated=!1;clearTimeout(a.validateTO);var b=setTimeout(function(){a.validateSize()},5);a.timeOuts.push(b);a.validateTO=
|
85 |
+
b},validateData:function(a){this.chartCreated&&(this.dataChanged=!0,this.marginsUpdated=!1,this.initChart(a))},validateNow:function(a,b){this.initTO&&clearTimeout(this.initTO);a&&(this.dataChanged=!0,this.marginsUpdated=!1);this.skipEvents=b;this.chartRendered=!1;var c=this.legend;c&&c.position!=this.prevLegendPosition&&(this.previousWidth=this.mw=0,c.invalidateSize&&(c.invalidateSize(),this.validateSize()));this.write(this.div)},showItem:function(a){a.hidden=!1;this.initChart()},hideItem:function(a){a.hidden=
|
86 |
+
!0;this.initChart()},hideBalloon:function(){var a=this;clearTimeout(a.hoverInt);clearTimeout(a.balloonTO);a.hoverInt=setTimeout(function(){a.hideBalloonReal.call(a)},a.hideBalloonTime)},cleanChart:function(){},hideBalloonReal:function(){var a=this.balloon;a&&a.hide&&a.hide()},showBalloon:function(a,b,c,e,d){var g=this;clearTimeout(g.balloonTO);clearTimeout(g.hoverInt);g.balloonTO=setTimeout(function(){g.showBalloonReal.call(g,a,b,c,e,d)},1)},showBalloonReal:function(a,b,c,e,d){this.handleMouseMove();
|
87 |
+
var g=this.balloon;g.enabled&&(g.followCursor(!1),g.changeColor(b),!c||g.fixedPosition?(g.setPosition(e,d),isNaN(e)||isNaN(d)?g.followCursor(!0):g.followCursor(!1)):g.followCursor(!0),a&&g.showBalloon(a))},handleMouseOver:function(){this.outTO&&clearTimeout(this.outTO);d.resetMouseOver();this.mouseIsOver=!0},handleMouseOut:function(){var a=this;d.resetMouseOver();a.outTO&&clearTimeout(a.outTO);a.outTO=setTimeout(function(){a.handleMouseOutReal()},10)},handleMouseOutReal:function(){this.mouseIsOver=
|
88 |
+
!1},handleMouseMove:function(a){a||(a=window.event);this.mouse2Y=this.mouse2X=NaN;var b,c,e,d;if(a){if(a.touches){var g=a.touches.item(1);g&&this.panEventsEnabled&&this.boundingRect&&(e=g.clientX-this.boundingRect.left,d=g.clientY-this.boundingRect.top);a=a.touches.item(0);if(!a)return}else this.wasTouched=!1;this.boundingRect&&a.clientX&&(b=a.clientX-this.boundingRect.left,c=a.clientY-this.boundingRect.top);isNaN(e)?this.mouseX=b:(this.mouseX=Math.min(b,e),this.mouse2X=Math.max(b,e));isNaN(d)?this.mouseY=
|
89 |
+
c:(this.mouseY=Math.min(c,d),this.mouse2Y=Math.max(c,d));this.autoTransform&&(this.mouseX/=this.cssScale,this.mouseY/=this.cssScale)}},handleTouchStart:function(a){this.hideBalloonReal();a&&(a.touches&&this.tapToActivate&&!this.tapped||!this.panRequired)||(this.handleMouseMove(a),this.handleMouseDown(a))},handleTouchEnd:function(a){this.wasTouched=!0;this.handleMouseMove(a);d.resetMouseOver();this.handleReleaseOutside(a)},handleReleaseOutside:function(){this.handleDocTouchEnd.call(this)},handleMouseDown:function(a){d.resetMouseOver();
|
90 |
+
this.mouseIsOver=!0;a&&a.preventDefault&&(this.panEventsEnabled?a.preventDefault():a.touches||a.preventDefault())},addLegend:function(a,b){a=d.processObject(a,d.AmLegend,this.theme);a.divId=b;a.ieW=0;var c;c="object"!=typeof b&&b?document.getElementById(b):b;this.legend=a;a.chart=this;c?(a.div=c,a.position="outside",a.autoMargins=!1):a.div=this.legendDiv;return a},removeLegend:function(){this.legend=void 0;this.previousWidth=0;this.legendDiv.innerHTML=""},handleResize:function(){(d.isPercents(this.width)||
|
91 |
+
d.isPercents(this.height))&&this.invalidateSizeReal();this.renderFix()},renderFix:function(){if(!d.VML){var a=this.container;a&&a.renderFix()}},getSVG:function(){if(d.hasSVG)return this.container},animate:function(a,b,c,e,f,g,h){a["an_"+b]&&d.removeFromArray(this.animations,a["an_"+b]);c={obj:a,frame:0,attribute:b,from:c,to:e,time:f,effect:g,suffix:h};a["an_"+b]=c;this.animations.push(c);return c},setLegendData:function(a){var b=this.legend;b&&b.setData(a)},stopAnim:function(a){d.removeFromArray(this.animations,
|
92 |
+
a)},updateAnimations:function(){var a;this.container&&this.container.update();if(this.animations)for(a=this.animations.length-1;0<=a;a--){var b=this.animations[a],c=d.updateRate*b.time,e=b.frame+1,f=b.obj,g=b.attribute;if(e<=c){b.frame++;var h=Number(b.from),k=Number(b.to)-h,c=d[b.effect](0,e,h,k,c);0===k?(this.animations.splice(a,1),f.node.style[g]=Number(b.to)+b.suffix):f.node.style[g]=c+b.suffix}else f.node.style[g]=Number(b.to)+b.suffix,f.animationFinished=!0,this.animations.splice(a,1)}},update:function(){this.updateAnimations();
|
93 |
+
var a=this.animatable;if(0<a.length){for(var b=!0,c=a.length-1;0<=c;c--){var e=a[c];e&&(e.animationFinished?a.splice(c,1):b=!1)}b&&(this.fire({type:"animationFinished",chart:this}),this.animatable=[])}},inIframe:function(){try{return window.self!==window.top}catch(a){return!0}},brr:function(){if(!this.hideCredits){var a="amcharts.com",b=window.location.hostname.split("."),c;2<=b.length&&(c=b[b.length-2]+"."+b[b.length-1]);this.amLink&&(b=this.amLink.parentNode)&&b.removeChild(this.amLink);b=this.creditsPosition;
|
94 |
+
if(c!=a||!0===this.inIframe()){var a="http://www."+a,e=c=0,d=this.realWidth,g=this.realHeight,h=this.type;if("serial"==h||"xy"==h||"gantt"==h)c=this.marginLeftReal,e=this.marginTopReal,d=c+this.plotAreaWidth,g=e+this.plotAreaHeight;var h=a+"/javascript-charts/",k="JavaScript charts",l="JS chart by amCharts";"ammap"==this.product&&(h=a+"/javascript-maps/",k="Interactive JavaScript maps",l="JS map by amCharts");a=document.createElement("a");l=document.createTextNode(l);a.setAttribute("href",h);a.setAttribute("title",
|
95 |
+
k);this.urlTarget&&a.setAttribute("target",this.urlTarget);a.appendChild(l);this.chartDiv.appendChild(a);this.amLink=a;h=a.style;h.position="absolute";h.textDecoration="none";h.color=this.color;h.fontFamily=this.fontFamily;h.fontSize="11px";h.opacity=.7;h.display="block";var k=a.offsetWidth,a=a.offsetHeight,l=5+c,m=e+5;"bottom-left"==b&&(l=5+c,m=g-a-3);"bottom-right"==b&&(l=d-k-5,m=g-a-3);"top-right"==b&&(l=d-k-5,m=e+5);h.left=l+"px";h.top=m+"px"}}}});d.Slice=d.Class({construct:function(){}});d.SerialDataItem=
|
96 |
+
d.Class({construct:function(){}});d.GraphDataItem=d.Class({construct:function(){}});d.Guide=d.Class({construct:function(a){this.cname="Guide";d.applyTheme(this,a,this.cname)}});d.Title=d.Class({construct:function(a){this.cname="Title";d.applyTheme(this,a,this.cname)}});d.Label=d.Class({construct:function(a){this.cname="Label";d.applyTheme(this,a,this.cname)}})})();(function(){var d=window.AmCharts;d.AmBalloon=d.Class({construct:function(a){this.cname="AmBalloon";this.enabled=!0;this.fillColor="#FFFFFF";this.fillAlpha=.8;this.borderThickness=2;this.borderColor="#FFFFFF";this.borderAlpha=1;this.cornerRadius=0;this.maxWidth=220;this.horizontalPadding=8;this.verticalPadding=4;this.pointerWidth=6;this.pointerOrientation="V";this.color="#000000";this.adjustBorderColor=!0;this.show=this.follow=this.showBullet=!1;this.bulletSize=3;this.shadowAlpha=.4;this.shadowColor=
|
|
|
97 |
"#000000";this.fadeOutDuration=this.animationDuration=.3;this.fixedPosition=!0;this.offsetY=6;this.offsetX=1;this.textAlign="center";this.disableMouseEvents=!0;this.deltaSignX=this.deltaSignY=1;d.isModern||(this.offsetY*=1.5);this.sdy=this.sdx=0;d.applyTheme(this,a,this.cname)},draw:function(){var a=this.pointToX,b=this.pointToY;d.isModern||(this.drop=!1);var c=this.chart;d.VML&&(this.fadeOutDuration=0);this.xAnim&&c.stopAnim(this.xAnim);this.yAnim&&c.stopAnim(this.yAnim);this.sdy=this.sdx=0;if(!isNaN(a)){var e=
|
98 |
+
this.follow,f=c.container,g=this.set;d.remove(g);this.removeDiv();g=f.set();g.node.style.pointerEvents="none";this.set=g;this.mainSet?(this.mainSet.push(this.set),this.sdx=this.mainSet.x,this.sdy=this.mainSet.y):c.balloonsSet.push(g);if(this.show){var h=this.l,k=this.t,l=this.r,m=this.b,n=this.balloonColor,q=this.fillColor,r=this.borderColor,t=q;void 0!=n&&(this.adjustBorderColor?t=r=n:q=n);var p=this.horizontalPadding,y=this.verticalPadding,B=this.pointerWidth,u=this.pointerOrientation,w=this.cornerRadius,
|
99 |
+
v=c.fontFamily,A=this.fontSize;void 0==A&&(A=c.fontSize);var n=document.createElement("div"),C=c.classNamePrefix;n.className=C+"-balloon-div";this.className&&(n.className=n.className+" "+C+"-balloon-div-"+this.className);C=n.style;this.disableMouseEvents&&(C.pointerEvents="none");C.position="absolute";var x=this.minWidth,z="";isNaN(x)||(z="min-width:"+(x-2*p)+"px; ");n.innerHTML='<div style="text-align:'+this.textAlign+"; "+z+"max-width:"+this.maxWidth+"px; font-size:"+A+"px; color:"+this.color+"; font-family:"+
|
100 |
+
v+'">'+this.text+"</div>";c.chartDiv.appendChild(n);this.textDiv=n;var F=n.offsetWidth,E=n.offsetHeight;n.clientHeight&&(F=n.clientWidth,E=n.clientHeight);v=E+2*y;z=F+2*p;!isNaN(x)&&z<x&&(z=x);window.opera&&(v+=2);var H=!1,A=this.offsetY;c.handDrawn&&(A+=c.handDrawScatter+2);"H"!=u?(x=a-z/2,b<k+v+10&&"down"!=u?(H=!0,e&&(b+=A),A=b+B,this.deltaSignY=-1):(e&&(b-=A),A=b-v-B,this.deltaSignY=1)):(2*B>v&&(B=v/2),A=b-v/2,a<h+(l-h)/2?(x=a+B,this.deltaSignX=-1):(x=a-z-B,this.deltaSignX=1));A+v>=m&&(A=m-v);
|
101 |
+
A<k&&(A=k);x<h&&(x=h);x+z>l&&(x=l-z);var k=A+y,m=x+p,G=this.shadowAlpha,D=this.shadowColor,p=this.borderThickness,K=this.bulletSize,J,y=this.fillAlpha,L=this.borderAlpha;this.showBullet&&(J=d.circle(f,K,t,y),g.push(J));this.drop?(h=z/1.6,l=0,"V"==u&&(u="down"),"H"==u&&(u="left"),"down"==u&&(x=a+1,A=b-h-h/3),"up"==u&&(l=180,x=a+1,A=b+h+h/3),"left"==u&&(l=270,x=a+h+h/3+2,A=b),"right"==u&&(l=90,x=a-h-h/3+2,A=b),k=A-E/2+1,m=x-F/2-1,q=d.drop(f,h,l,q,y,p,r,L)):0<w||0===B?(0<G&&(a=d.rect(f,z,v,q,0,p+1,D,
|
102 |
+
G,w),d.isModern?a.translate(1,1):a.translate(4,4),g.push(a)),q=d.rect(f,z,v,q,y,p,r,L,w)):(t=[],w=[],"H"!=u?(h=a-x,h>z-B&&(h=z-B),h<B&&(h=B),t=[0,h-B,a-x,h+B,z,z,0,0],w=H?[0,0,b-A,0,0,v,v,0]:[v,v,b-A,v,v,0,0,v]):(u=b-A,u>v-B&&(u=v-B),u<B&&(u=B),w=[0,u-B,b-A,u+B,v,v,0,0],t=a<h+(l-h)/2?[0,0,x<a?0:a-x,0,0,z,z,0]:[z,z,x+z>a?z:a-x,z,z,0,0,z]),0<G&&(a=d.polygon(f,t,w,q,0,p,D,G),a.translate(1,1),g.push(a)),q=d.polygon(f,t,w,q,y,p,r,L));this.bg=q;g.push(q);q.toFront();d.setCN(c,q,"balloon-bg");this.className&&
|
103 |
+
d.setCN(c,q,"balloon-bg-"+this.className);f=1*this.deltaSignX;m+=this.sdx;k+=this.sdy;C.left=m+"px";C.top=k+"px";g.translate(x-f,A,1,!0);q=q.getBBox();this.bottom=A+v+1;this.yPos=q.y+A;J&&J.translate(this.pointToX-x+f,b-A);b=this.animationDuration;0<this.animationDuration&&!e&&!isNaN(this.prevX)&&(g.translate(this.prevX,this.prevY,NaN,!0),g.animate({translate:x-f+","+A},b,"easeOutSine"),n&&(C.left=this.prevTX+"px",C.top=this.prevTY+"px",this.xAnim=c.animate({node:n},"left",this.prevTX,m,b,"easeOutSine",
|
104 |
+
"px"),this.yAnim=c.animate({node:n},"top",this.prevTY,k,b,"easeOutSine","px")));this.prevX=x-f;this.prevY=A;this.prevTX=m;this.prevTY=k}}},fixPrevious:function(){this.rPrevX=this.prevX;this.rPrevY=this.prevY;this.rPrevTX=this.prevTX;this.rPrevTY=this.prevTY},restorePrevious:function(){this.prevX=this.rPrevX;this.prevY=this.rPrevY;this.prevTX=this.rPrevTX;this.prevTY=this.rPrevTY},followMouse:function(){if(this.follow&&this.show){var a=this.chart.mouseX-this.offsetX*this.deltaSignX-this.sdx,b=this.chart.mouseY-
|
105 |
this.sdy;this.pointToX=a;this.pointToY=b;if(a!=this.previousX||b!=this.previousY)if(this.previousX=a,this.previousY=b,0===this.cornerRadius)this.draw();else{var c=this.set;if(c){var e=c.getBBox(),a=a-e.width/2,d=b-e.height-10;a<this.l&&(a=this.l);a>this.r-e.width&&(a=this.r-e.width);d<this.t&&(d=b+10);c.translate(a,d);b=this.textDiv.style;b.left=a+this.horizontalPadding+"px";b.top=d+this.verticalPadding+"px"}}}},changeColor:function(a){this.balloonColor=a},setBounds:function(a,b,c,e){this.l=a;this.t=
|
106 |
b;this.r=c;this.b=e;this.destroyTO&&clearTimeout(this.destroyTO)},showBalloon:function(a){if(this.text!=a||this.positionChanged)this.text=a,this.isHiding=!1,this.show=!0,this.destroyTO&&clearTimeout(this.destroyTO),a=this.chart,this.fadeAnim1&&a.stopAnim(this.fadeAnim1),this.fadeAnim2&&a.stopAnim(this.fadeAnim2),this.draw(),this.positionChanged=!1},hide:function(a){var b=this;b.text=void 0;isNaN(a)&&(a=b.fadeOutDuration);var c=b.chart;if(0<a&&!b.isHiding){b.isHiding=!0;b.destroyTO&&clearTimeout(b.destroyTO);
|
107 |
b.destroyTO=setTimeout(function(){b.destroy.call(b)},1E3*a);b.follow=!1;b.show=!1;var e=b.set;e&&(e.setAttr("opacity",b.fillAlpha),b.fadeAnim1=e.animate({opacity:0},a,"easeInSine"));b.textDiv&&(b.fadeAnim2=c.animate({node:b.textDiv},"opacity",1,0,a,"easeInSine",""))}else b.show=!1,b.follow=!1,b.destroy()},setPosition:function(a,b){if(a!=this.pointToX||b!=this.pointToY)this.previousX=this.pointToX,this.previousY=this.pointToY,this.pointToX=a,this.pointToY=b,this.positionChanged=!0},followCursor:function(a){var b=
|
108 |
this;b.follow=a;clearInterval(b.interval);var c=b.chart.mouseX-b.sdx,e=b.chart.mouseY-b.sdy;!isNaN(c)&&a&&(b.pointToX=c-b.offsetX*b.deltaSignX,b.pointToY=e,b.followMouse(),b.interval=setInterval(function(){b.followMouse.call(b)},40))},removeDiv:function(){if(this.textDiv){var a=this.textDiv.parentNode;a&&a.removeChild(this.textDiv)}},destroy:function(){clearInterval(this.interval);d.remove(this.set);this.removeDiv();this.set=null}})})();(function(){var d=window.AmCharts;d.circle=function(a,b,c,e,f,g,h,k,l){0>=b&&(b=.001);if(void 0==f||0===f)f=.01;void 0===g&&(g="#000000");void 0===h&&(h=0);e={fill:c,stroke:g,"fill-opacity":e,"stroke-width":f,"stroke-opacity":h};a=isNaN(l)?a.circle(0,0,b).attr(e):a.ellipse(0,0,b,l).attr(e);k&&a.gradient("radialGradient",[c,d.adjustLuminosity(c,-.6)]);return a};d.text=function(a,b,c,e,f,g,h,k){g||(g="middle");"right"==g&&(g="end");"left"==g&&(g="start");isNaN(k)&&(k=1);void 0!==b&&(b=String(b),d.isIE&&
|
109 |
+
!d.isModern&&(b=b.replace("&","&"),b=b.replace("&","&")));c={fill:c,"font-family":e,"font-size":f+"px",opacity:k};!0===h&&(c["font-weight"]="bold");c["text-anchor"]=g;return a.text(b,c)};d.polygon=function(a,b,c,e,f,g,h,k,l,m,n){isNaN(g)&&(g=.01);isNaN(k)&&(k=f);var q=e,r=!1;"object"==typeof q&&1<q.length&&(r=!0,q=q[0]);void 0===h&&(h=q);f={fill:q,stroke:h,"fill-opacity":f,"stroke-width":g,"stroke-opacity":k};void 0!==n&&0<n&&(f["stroke-dasharray"]=n);n=d.dx;g=d.dy;a.handDrawn&&(c=d.makeHD(b,
|
110 |
+
c,a.handDrawScatter),b=c[0],c=c[1]);h=Math.round;m&&(b[t]=d.roundTo(b[t],5),c[t]=d.roundTo(c[t],5),h=Number);k="M"+(h(b[0])+n)+","+(h(c[0])+g);for(var t=1;t<b.length;t++)m&&(b[t]=d.roundTo(b[t],5),c[t]=d.roundTo(c[t],5)),k+=" L"+(h(b[t])+n)+","+(h(c[t])+g);a=a.path(k+" Z").attr(f);r&&a.gradient("linearGradient",e,l);return a};d.rect=function(a,b,c,e,f,g,h,k,l,m,n){if(isNaN(b)||isNaN(c))return a.set();isNaN(g)&&(g=0);void 0===l&&(l=0);void 0===m&&(m=270);isNaN(f)&&(f=0);var q=e,r=!1;"object"==typeof q&&
|
111 |
+
(q=q[0],r=!0);void 0===h&&(h=q);void 0===k&&(k=f);b=Math.round(b);c=Math.round(c);var t=0,p=0;0>b&&(b=Math.abs(b),t=-b);0>c&&(c=Math.abs(c),p=-c);t+=d.dx;p+=d.dy;f={fill:q,stroke:h,"fill-opacity":f,"stroke-opacity":k};void 0!==n&&0<n&&(f["stroke-dasharray"]=n);a=a.rect(t,p,b,c,l,g).attr(f);r&&a.gradient("linearGradient",e,m);return a};d.bullet=function(a,b,c,e,f,g,h,k,l,m,n,q,r){var t;"circle"==b&&(b="round");switch(b){case "round":t=d.circle(a,c/2,e,f,g,h,k);break;case "square":t=d.polygon(a,[-c/
|
112 |
+
2,c/2,c/2,-c/2],[c/2,c/2,-c/2,-c/2],e,f,g,h,k,m-180,void 0,r);break;case "rectangle":t=d.polygon(a,[-c,c,c,-c],[c/2,c/2,-c/2,-c/2],e,f,g,h,k,m-180,void 0,r);break;case "diamond":t=d.polygon(a,[-c/2,0,c/2,0],[0,-c/2,0,c/2],e,f,g,h,k);break;case "triangleUp":t=d.triangle(a,c,0,e,f,g,h,k);break;case "triangleDown":t=d.triangle(a,c,180,e,f,g,h,k);break;case "triangleLeft":t=d.triangle(a,c,270,e,f,g,h,k);break;case "triangleRight":t=d.triangle(a,c,90,e,f,g,h,k);break;case "bubble":t=d.circle(a,c/2,e,f,
|
113 |
+
g,h,k,!0);break;case "line":t=d.line(a,[-c/2,c/2],[0,0],e,f,g,h,k);break;case "yError":t=a.set();t.push(d.line(a,[0,0],[-c/2,c/2],e,f,g));t.push(d.line(a,[-l,l],[-c/2,-c/2],e,f,g));t.push(d.line(a,[-l,l],[c/2,c/2],e,f,g));break;case "xError":t=a.set(),t.push(d.line(a,[-c/2,c/2],[0,0],e,f,g)),t.push(d.line(a,[-c/2,-c/2],[-l,l],e,f,g)),t.push(d.line(a,[c/2,c/2],[-l,l],e,f,g))}t&&t.pattern(n,NaN,q);return t};d.triangle=function(a,b,c,e,d,g,h,k){if(void 0===g||0===g)g=1;void 0===h&&(h="#000");void 0===
|
114 |
k&&(k=0);e={fill:e,stroke:h,"fill-opacity":d,"stroke-width":g,"stroke-opacity":k};b/=2;var l;0===c&&(l=" M"+-b+","+b+" L0,"+-b+" L"+b+","+b+" Z");180==c&&(l=" M"+-b+","+-b+" L0,"+b+" L"+b+","+-b+" Z");90==c&&(l=" M"+-b+","+-b+" L"+b+",0 L"+-b+","+b+" Z");270==c&&(l=" M"+-b+",0 L"+b+","+b+" L"+b+","+-b+" Z");return a.path(l).attr(e)};d.line=function(a,b,c,e,f,g,h,k,l,m,n){if(a.handDrawn&&!n)return d.handDrawnLine(a,b,c,e,f,g,h,k,l,m,n);g={fill:"none","stroke-width":g};void 0!==h&&0<h&&(g["stroke-dasharray"]=
|
115 |
h);isNaN(f)||(g["stroke-opacity"]=f);e&&(g.stroke=e);e=Math.round;m&&(e=Number,b[0]=d.roundTo(b[0],5),c[0]=d.roundTo(c[0],5));m=d.dx;f=d.dy;h="M"+(e(b[0])+m)+","+(e(c[0])+f);for(k=1;k<b.length;k++)b[k]=d.roundTo(b[k],5),c[k]=d.roundTo(c[k],5),h+=" L"+(e(b[k])+m)+","+(e(c[k])+f);if(d.VML)return a.path(h,void 0,!0).attr(g);l&&(h+=" M0,0 L0,0");return a.path(h).attr(g)};d.makeHD=function(a,b,c){for(var e=[],d=[],g=1;g<a.length;g++)for(var h=Number(a[g-1]),k=Number(b[g-1]),l=Number(a[g]),m=Number(b[g]),
|
116 |
+
n=Math.round(Math.sqrt(Math.pow(l-h,2)+Math.pow(m-k,2))/50)+1,l=(l-h)/n,m=(m-k)/n,q=0;q<=n;q++){var r=k+q*m+Math.random()*c;e.push(h+q*l+Math.random()*c);d.push(r)}return[e,d]};d.handDrawnLine=function(a,b,c,e,f,g,h,k,l,m){var n,q=a.set();for(n=1;n<b.length;n++)for(var r=[b[n-1],b[n]],t=[c[n-1],c[n]],t=d.makeHD(r,t,a.handDrawScatter),r=t[0],t=t[1],p=1;p<r.length;p++)q.push(d.line(a,[r[p-1],r[p]],[t[p-1],t[p]],e,f,g+Math.random()*a.handDrawThickness-a.handDrawThickness/2,h,k,l,m,!0));return q};d.doNothing=
|
117 |
+
function(a){return a};d.drop=function(a,b,c,e,d,g,h,k){var l=1/180*Math.PI,m=c-20,n=Math.sin(m*l)*b,q=Math.cos(m*l)*b,r=Math.sin((m+40)*l)*b,t=Math.cos((m+40)*l)*b,p=.8*b,y=-b/3,B=b/3;0===c&&(y=-y,B=0);180==c&&(B=0);90==c&&(y=0);270==c&&(y=0,B=-B);c={fill:e,stroke:h,"stroke-width":g,"stroke-opacity":k,"fill-opacity":d};b="M"+n+","+q+" A"+b+","+b+",0,1,1,"+r+","+t+(" A"+p+","+p+",0,0,0,"+(Math.sin((m+20)*l)*b+B)+","+(Math.cos((m+20)*l)*b+y));b+=" A"+p+","+p+",0,0,0,"+n+","+q;return a.path(b,void 0,
|
118 |
+
void 0,"1000,1000").attr(c)};d.wedge=function(a,b,c,e,f,g,h,k,l,m,n,q,r,t){var p=Math.round;g=p(g);h=p(h);k=p(k);var y=p(h/g*k),B=d.VML,u=359.5+g/100;359.94<u&&(u=359.94);f>=u&&(f=u);var w=1/180*Math.PI,u=b+Math.sin(e*w)*k,v=c-Math.cos(e*w)*y,A=b+Math.sin(e*w)*g,C=c-Math.cos(e*w)*h,x=b+Math.sin((e+f)*w)*g,z=c-Math.cos((e+f)*w)*h,F=b+Math.sin((e+f)*w)*k,w=c-Math.cos((e+f)*w)*y,E={fill:d.adjustLuminosity(m.fill,-.2),"stroke-opacity":0,"fill-opacity":m["fill-opacity"]},H=0;180<Math.abs(f)&&(H=1);e=a.set();
|
119 |
+
var G;B&&(u=p(10*u),A=p(10*A),x=p(10*x),F=p(10*F),v=p(10*v),C=p(10*C),z=p(10*z),w=p(10*w),b=p(10*b),l=p(10*l),c=p(10*c),g*=10,h*=10,k*=10,y*=10,1>Math.abs(f)&&1>=Math.abs(x-A)&&1>=Math.abs(z-C)&&(G=!0));f="";var D;q&&(E["fill-opacity"]=0,E["stroke-opacity"]=m["stroke-opacity"]/2,E.stroke=m.stroke);if(0<l){D=" M"+u+","+(v+l)+" L"+A+","+(C+l);B?(G||(D+=" A"+(b-g)+","+(l+c-h)+","+(b+g)+","+(l+c+h)+","+A+","+(C+l)+","+x+","+(z+l)),D+=" L"+F+","+(w+l),0<k&&(G||(D+=" B"+(b-k)+","+(l+c-y)+","+(b+k)+","+
|
120 |
+
(l+c+y)+","+F+","+(l+w)+","+u+","+(l+v)))):(D+=" A"+g+","+h+",0,"+H+",1,"+x+","+(z+l)+" L"+F+","+(w+l),0<k&&(D+=" A"+k+","+y+",0,"+H+",0,"+u+","+(v+l)));D+=" Z";var K=l;B&&(K/=10);for(var J=0;J<K;J+=10){var L=a.path(D,void 0,void 0,"1000,1000").attr(E);e.push(L);L.translate(0,-J)}D=a.path(" M"+u+","+v+" L"+u+","+(v+l)+" L"+A+","+(C+l)+" L"+A+","+C+" L"+u+","+v+" Z",void 0,void 0,"1000,1000").attr(E);l=a.path(" M"+x+","+z+" L"+x+","+(z+l)+" L"+F+","+(w+l)+" L"+F+","+w+" L"+x+","+z+" Z",void 0,void 0,
|
121 |
+
"1000,1000").attr(E);e.push(D);e.push(l)}B?(G||(f=" A"+p(b-g)+","+p(c-h)+","+p(b+g)+","+p(c+h)+","+p(A)+","+p(C)+","+p(x)+","+p(z)),h=" M"+p(u)+","+p(v)+" L"+p(A)+","+p(C)+f+" L"+p(F)+","+p(w)):h=" M"+u+","+v+" L"+A+","+C+(" A"+g+","+h+",0,"+H+",1,"+x+","+z)+" L"+F+","+w;0<k&&(B?G||(h+=" B"+(b-k)+","+(c-y)+","+(b+k)+","+(c+y)+","+F+","+w+","+u+","+v):h+=" A"+k+","+y+",0,"+H+",0,"+u+","+v);a.handDrawn&&(k=d.line(a,[u,A],[v,C],m.stroke,m.thickness*Math.random()*a.handDrawThickness,m["stroke-opacity"]),
|
122 |
+
e.push(k));a=a.path(h+" Z",void 0,void 0,"1000,1000").attr(m);if(n){k=[];for(y=0;y<n.length;y++)k.push(d.adjustLuminosity(m.fill,n[y]));"radial"!=t||d.isModern||(k=[]);0<k.length&&a.gradient(t+"Gradient",k)}d.isModern&&"radial"==t&&a.grad&&(a.grad.setAttribute("gradientUnits","userSpaceOnUse"),a.grad.setAttribute("r",g),a.grad.setAttribute("cx",b),a.grad.setAttribute("cy",c));a.pattern(q,NaN,r);e.wedge=a;e.push(a);return e};d.rgb2hex=function(a){return(a=a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&
|
123 |
4===a.length?"#"+("0"+parseInt(a[1],10).toString(16)).slice(-2)+("0"+parseInt(a[2],10).toString(16)).slice(-2)+("0"+parseInt(a[3],10).toString(16)).slice(-2):""};d.adjustLuminosity=function(a,b){a&&-1!=a.indexOf("rgb")&&(a=d.rgb2hex(a));a=String(a).replace(/[^0-9a-f]/gi,"");6>a.length&&(a=String(a[0])+String(a[0])+String(a[1])+String(a[1])+String(a[2])+String(a[2]));b=b||0;var c="#",e,f;for(f=0;3>f;f++)e=parseInt(a.substr(2*f,2),16),e=Math.round(Math.min(Math.max(0,e+e*b),255)).toString(16),c+=("00"+
|
124 |
+
e).substr(e.length);return c}})();(function(){var d=window.AmCharts;d.AmLegend=d.Class({construct:function(a){this.enabled=!0;this.cname="AmLegend";this.createEvents("rollOverMarker","rollOverItem","rollOutMarker","rollOutItem","showItem","hideItem","clickMarker","clickLabel");this.position="bottom";this.borderColor=this.color="#000000";this.borderAlpha=0;this.markerLabelGap=5;this.verticalGap=10;this.align="left";this.horizontalGap=0;this.spacing=10;this.markerDisabledColor="#AAB3B3";this.markerType="square";this.markerSize=16;this.markerBorderThickness=
|
125 |
+
this.markerBorderAlpha=1;this.marginBottom=this.marginTop=0;this.marginLeft=this.marginRight=20;this.autoMargins=!0;this.valueWidth=50;this.switchable=!0;this.switchType="x";this.switchColor="#FFFFFF";this.rollOverColor="#CC0000";this.reversedOrder=!1;this.labelText="[[title]]";this.valueText="[[value]]";this.accessibleLabel="[[title]]";this.useMarkerColorForLabels=!1;this.rollOverGraphAlpha=1;this.textClickEnabled=!1;this.equalWidths=!0;this.backgroundColor="#FFFFFF";this.backgroundAlpha=0;this.useGraphSettings=
|
126 |
+
!1;this.showEntries=!0;this.labelDx=0;d.applyTheme(this,a,this.cname)},setData:function(a){this.legendData=a;this.invalidateSize()},invalidateSize:function(){this.destroy();this.entries=[];this.valueLabels=[];var a=this.legendData;this.enabled&&(d.ifArray(a)||d.ifArray(this.data))&&this.drawLegend()},drawLegend:function(){var a=this.chart,b=this.position,c=this.width,e=a.divRealWidth,f=a.divRealHeight,g=this.div,h=this.legendData;this.data&&(h=this.combineLegend?this.legendData.concat(this.data):
|
127 |
+
this.data);isNaN(this.fontSize)&&(this.fontSize=a.fontSize);this.maxColumnsReal=this.maxColumns;if("right"==b||"left"==b)this.maxColumnsReal=1,this.autoMargins&&(this.marginLeft=this.marginRight=10);else if(this.autoMargins){this.marginRight=a.marginRight;this.marginLeft=a.marginLeft;var k=a.autoMarginOffset;"bottom"==b?(this.marginBottom=k,this.marginTop=0):(this.marginTop=k,this.marginBottom=0)}c=void 0!==c?d.toCoordinate(c,e):"right"!=b&&"left"!=b?a.realWidth:0<this.ieW?this.ieW:a.realWidth;"outside"==
|
128 |
+
b?(c=g.offsetWidth,f=g.offsetHeight,g.clientHeight&&(c=g.clientWidth,f=g.clientHeight)):(isNaN(c)||(g.style.width=c+"px"),g.className="amChartsLegend "+a.classNamePrefix+"-legend-div");this.divWidth=c;(b=this.container)?(b.container.innerHTML="",g.appendChild(b.container),b.width=c,b.height=f,b.setSize(c,f),b.addDefs(a)):b=new d.AmDraw(g,c,f,a);this.container=b;this.lx=0;this.ly=8;f=this.markerSize;f>this.fontSize&&(this.ly=f/2-1);0<f&&(this.lx+=f+this.markerLabelGap);this.titleWidth=0;if(f=this.title)f=
|
129 |
+
d.text(this.container,f,this.color,a.fontFamily,this.fontSize,"start",!0),d.setCN(a,f,"legend-title"),f.translate(this.marginLeft,this.marginTop+this.verticalGap+this.ly+1),a=f.getBBox(),this.titleWidth=a.width+15,this.titleHeight=a.height+6;this.index=this.maxLabelWidth=0;if(this.showEntries){for(a=0;a<h.length;a++)this.createEntry(h[a]);for(a=this.index=0;a<h.length;a++)this.createValue(h[a])}this.arrangeEntries();this.updateValues()},arrangeEntries:function(){var a=this.position,b=this.marginLeft+
|
130 |
+
this.titleWidth,c=this.marginRight,e=this.marginTop,f=this.marginBottom,g=this.horizontalGap,h=this.div,k=this.divWidth,l=this.maxColumnsReal,m=this.verticalGap,n=this.spacing,q=k-c-b,r=0,t=0,p=this.container;this.set&&this.set.remove();var y=p.set();this.set=y;var B=p.set();y.push(B);var u=this.entries,w,v;for(v=0;v<u.length;v++){w=u[v].getBBox();var A=w.width;A>r&&(r=A);w=w.height;w>t&&(t=w)}var A=t=0,C=g,x=0,z=0;for(v=0;v<u.length;v++){var F=u[v];this.reversedOrder&&(F=u[u.length-v-1]);w=F.getBBox();
|
131 |
+
var E;this.equalWidths?E=A*(r+n+this.markerLabelGap):(E=C,C=C+w.width+g+n);E+w.width>q&&0<v&&0!==A&&(t++,E=A=0,C=E+w.width+g+n,x=x+z+m,z=0);w.height>z&&(z=w.height);F.translate(E,x);A++;!isNaN(l)&&A>=l&&(A=0,t++,x=x+z+m,C=g,z=0);B.push(F)}w=B.getBBox();l=w.height+2*m-1;"left"==a||"right"==a?(n=w.width+2*g,k=n+b+c,h.style.width=k+"px",this.ieW=k):n=k-b-c-1;c=d.polygon(this.container,[0,n,n,0],[0,0,l,l],this.backgroundColor,this.backgroundAlpha,1,this.borderColor,this.borderAlpha);d.setCN(this.chart,
|
132 |
+
c,"legend-bg");y.push(c);y.translate(b,e);c.toBack();b=g;if("top"==a||"bottom"==a||"absolute"==a||"outside"==a)"center"==this.align?b=g+(n-w.width)/2:"right"==this.align&&(b=g+n-w.width);B.translate(b,m+1);this.titleHeight>l&&(l=this.titleHeight);a=l+e+f+1;0>a&&(a=0);a>this.chart.divRealHeight&&(h.style.top="0px");h.style.height=Math.round(a)+"px";p.setSize(this.divWidth,a)},createEntry:function(a){if(!1!==a.visibleInLegend&&!a.hideFromLegend){var b=this,c=b.chart,e=b.useGraphSettings,f=a.markerType;
|
133 |
+
f&&(e=!1);a.legendEntryWidth=b.markerSize;f||(f=b.markerType);var g=a.color,h=a.alpha;a.legendKeyColor&&(g=a.legendKeyColor());a.legendKeyAlpha&&(h=a.legendKeyAlpha());var k;!0===a.hidden&&(k=g=b.markerDisabledColor);var l=a.pattern,m,n=a.customMarker;n||(n=b.customMarker);var q=b.container,r=b.markerSize,t=0,p=0,y=r/2;if(e){e=a.type;b.switchType=void 0;if("line"==e||"step"==e||"smoothedLine"==e||"ohlc"==e)m=q.set(),a.hidden||(g=a.lineColorR,k=a.bulletBorderColorR),t=d.line(q,[0,2*r],[r/2,r/2],g,
|
134 |
+
a.lineAlpha,a.lineThickness,a.dashLength),d.setCN(c,t,"graph-stroke"),m.push(t),a.bullet&&(a.hidden||(g=a.bulletColorR),t=d.bullet(q,a.bullet,a.bulletSize,g,a.bulletAlpha,a.bulletBorderThickness,k,a.bulletBorderAlpha))&&(d.setCN(c,t,"graph-bullet"),t.translate(r+1,r/2),m.push(t)),y=0,t=r,p=r/3;else{a.getGradRotation&&(m=a.getGradRotation(),0===m&&(m=180));t=a.fillColorsR;!0===a.hidden&&(t=g);if(m=b.createMarker("rectangle",t,a.fillAlphas,a.lineThickness,g,a.lineAlpha,m,l,a.dashLength))y=r,m.translate(y,
|
135 |
+
r/2);t=r}d.setCN(c,m,"graph-"+e);d.setCN(c,m,"graph-"+a.id)}else if(n)m=q.image(n,0,0,r,r);else{var B;isNaN(b.gradientRotation)||(B=180+b.gradientRotation);(m=b.createMarker(f,g,h,void 0,void 0,void 0,B,l))&&m.translate(r/2,r/2)}d.setCN(c,m,"legend-marker");b.addListeners(m,a);q=q.set([m]);b.switchable&&a.switchable&&q.setAttr("cursor","pointer");void 0!==a.id&&d.setCN(c,q,"legend-item-"+a.id);d.setCN(c,q,a.className,!0);k=b.switchType;var u;k&&"none"!=k&&0<r&&("x"==k?(u=b.createX(),u.translate(r/
|
136 |
+
2,r/2)):u=b.createV(),u.dItem=a,!0!==a.hidden?"x"==k?u.hide():u.show():"x"!=k&&u.hide(),b.switchable||u.hide(),b.addListeners(u,a),a.legendSwitch=u,q.push(u),d.setCN(c,u,"legend-switch"));k=b.color;a.showBalloon&&b.textClickEnabled&&void 0!==b.selectedColor&&(k=b.selectedColor);b.useMarkerColorForLabels&&!l&&(k=g);!0===a.hidden&&(k=b.markerDisabledColor);g=d.massReplace(b.labelText,{"[[title]]":a.title});void 0!==b.tabIndex&&(q.setAttr("tabindex",b.tabIndex),q.setAttr("role","menuitem"),q.keyup(function(c){13==
|
137 |
+
c.keyCode&&b.clickMarker(a,c)}));c.accessible&&b.accessibleLabel&&(l=d.massReplace(b.accessibleLabel,{"[[title]]":a.title}),c.makeAccessible(q,l));l=b.fontSize;m&&(r<=l&&(r=r/2+b.ly-l/2+(l+2-r)/2-p,m.translate(y,r),u&&u.translate(u.x,r)),a.legendEntryWidth=m.getBBox().width);var w;g&&(g=d.fixBrakes(g),a.legendTextReal=g,w=b.labelWidth,w=isNaN(w)?d.text(b.container,g,k,c.fontFamily,l,"start"):d.wrappedText(b.container,g,k,c.fontFamily,l,"start",!1,w,0),d.setCN(c,w,"legend-label"),w.translate(b.lx+
|
138 |
+
t,b.ly),q.push(w),b.labelDx=t,c=w.getBBox().width,b.maxLabelWidth<c&&(b.maxLabelWidth=c));b.entries[b.index]=q;a.legendEntry=b.entries[b.index];a.legendMarker=m;a.legendLabel=w;b.index++}},addListeners:function(a,b){var c=this;a&&a.mouseover(function(a){c.rollOverMarker(b,a)}).mouseout(function(a){c.rollOutMarker(b,a)}).click(function(a){c.clickMarker(b,a)})},rollOverMarker:function(a,b){this.switchable&&this.dispatch("rollOverMarker",a,b);this.dispatch("rollOverItem",a,b)},rollOutMarker:function(a,
|
139 |
+
b){this.switchable&&this.dispatch("rollOutMarker",a,b);this.dispatch("rollOutItem",a,b)},clickMarker:function(a,b){this.switchable&&(!0===a.hidden?this.dispatch("showItem",a,b):this.dispatch("hideItem",a,b));this.dispatch("clickMarker",a,b)},rollOverLabel:function(a,b){a.hidden||this.textClickEnabled&&a.legendLabel&&a.legendLabel.attr({fill:this.rollOverColor});this.dispatch("rollOverItem",a,b)},rollOutLabel:function(a,b){if(!a.hidden&&this.textClickEnabled&&a.legendLabel){var c=this.color;void 0!==
|
140 |
+
this.selectedColor&&a.showBalloon&&(c=this.selectedColor);this.useMarkerColorForLabels&&(c=a.lineColor,void 0===c&&(c=a.color));a.legendLabel.attr({fill:c})}this.dispatch("rollOutItem",a,b)},clickLabel:function(a,b){this.textClickEnabled?a.hidden||this.dispatch("clickLabel",a,b):this.switchable&&(!0===a.hidden?this.dispatch("showItem",a,b):this.dispatch("hideItem",a,b))},dispatch:function(a,b,c){a={type:a,dataItem:b,target:this,event:c,chart:this.chart};this.chart&&this.chart.handleLegendEvent(a);
|
141 |
this.fire(a)},createValue:function(a){var b=this,c=b.fontSize,e=b.chart;if(!1!==a.visibleInLegend&&!a.hideFromLegend){var f=b.maxLabelWidth;b.forceWidth&&(f=b.labelWidth);b.equalWidths||(b.valueAlign="left");"left"==b.valueAlign&&a.legendLabel&&(f=a.legendLabel.getBBox().width);var g=f;if(b.valueText&&0<b.valueWidth){var h=b.color;b.useMarkerColorForValues&&(h=a.color,a.legendKeyColor&&(h=a.legendKeyColor()));!0===a.hidden&&(h=b.markerDisabledColor);var k=b.valueText,f=f+b.lx+b.labelDx+b.markerLabelGap+
|
142 |
b.valueWidth,l="end";"left"==b.valueAlign&&(f-=b.valueWidth,l="start");h=d.text(b.container,k,h,b.chart.fontFamily,c,l);d.setCN(e,h,"legend-value");h.translate(f,b.ly);b.entries[b.index].push(h);g+=b.valueWidth+2*b.markerLabelGap;h.dItem=a;b.valueLabels.push(h)}b.index++;e=b.markerSize;e<c+7&&(e=c+7,d.VML&&(e+=3));c=b.container.rect(a.legendEntryWidth,0,g,e,0,0).attr({stroke:"none",fill:"#fff","fill-opacity":.005});c.dItem=a;b.entries[b.index-1].push(c);c.mouseover(function(c){b.rollOverLabel(a,c)}).mouseout(function(c){b.rollOutLabel(a,
|
143 |
c)}).click(function(c){b.clickLabel(a,c)})}},createV:function(){var a=this.markerSize;return d.polygon(this.container,[a/5,a/2,a-a/5,a/2],[a/3,a-a/5,a/5,a/1.7],this.switchColor)},createX:function(){var a=(this.markerSize-4)/2,b={stroke:this.switchColor,"stroke-width":3},c=this.container,e=d.line(c,[-a,a],[-a,a]).attr(b),a=d.line(c,[-a,a],[a,-a]).attr(b);return this.container.set([e,a])},createMarker:function(a,b,c,e,f,g,h,k,l){var m=this.markerSize,n=this.container;f||(f=this.markerBorderColor);f||
|
144 |
(f=b);isNaN(e)&&(e=this.markerBorderThickness);isNaN(g)&&(g=this.markerBorderAlpha);return d.bullet(n,a,m,b,c,e,f,g,m,h,k,this.chart.path,l)},validateNow:function(){this.invalidateSize()},updateValues:function(){var a=this.valueLabels,b=this.chart,c,e=this.data;if(a)for(c=0;c<a.length;c++){var f=a[c],g=f.dItem;g.periodDataItem=void 0;g.periodPercentDataItem=void 0;var h=" ";if(e)g.value?f.text(g.value):f.text("");else{var k=null;if(void 0!==g.type){var k=g.currentDataItem,l=this.periodValueText;g.legendPeriodValueText&&
|
145 |
(l=g.legendPeriodValueText);k?(h=this.valueText,g.legendValueText&&(h=g.legendValueText),h=b.formatString(h,k)):l&&b.formatPeriodString&&(l=d.massReplace(l,{"[[title]]":g.title}),h=b.formatPeriodString(l,g))}else h=b.formatString(this.valueText,g);l=g;k&&(l=k);var m=this.valueFunction;m&&(h=m(l,h,b.periodDataItem));var n;this.useMarkerColorForLabels&&!k&&g.lastDataItem&&(k=g.lastDataItem);k?n=b.getBalloonColor(g,k):g.legendKeyColor&&(n=g.legendKeyColor());g.legendColorFunction&&(n=g.legendColorFunction(l,
|
146 |
+
h,g.periodDataItem,g.periodPercentDataItem));f.text(h);if(!g.pattern&&(this.useMarkerColorForValues&&f.setAttr("fill",n),this.useMarkerColorForLabels)){if(f=g.legendMarker)f.setAttr("fill",n),f.setAttr("stroke",n);(g=g.legendLabel)&&g.setAttr("fill",n)}}}},renderFix:function(){if(!d.VML&&this.enabled){var a=this.container;a&&a.renderFix()}},destroy:function(){this.div.innerHTML="";d.remove(this.set)}})})();(function(){var d=window.AmCharts;d.AmMap=d.Class({inherits:d.AmChart,construct:function(a){this.cname="AmMap";this.type="map";this.theme=a;this.svgNotSupported="This browser doesn't support SVG. Use Chrome, Firefox, Internet Explorer 9 or later.";this.createEvents("rollOverMapObject","rollOutMapObject","clickMapObject","mouseDownMapObject","selectedObjectChanged","homeButtonClicked","zoomCompleted","dragCompleted","positionChanged","writeDevInfo","click","descriptionClosed");this.zoomDuration=.6;
|
147 |
this.zoomControl=new d.ZoomControl(a);this.fitMapToContainer=!0;this.mouseWheelZoomEnabled=this.backgroundZoomsToTop=!1;this.allowClickOnSelectedObject=this.useHandCursorOnClickableOjects=this.showBalloonOnSelectedObject=!0;this.showObjectsAfterZoom=this.wheelBusy=!1;this.zoomOnDoubleClick=this.useObjectColorForBalloon=!0;this.allowMultipleDescriptionWindows=!1;this.dragMap=this.centerMap=this.linesAboveImages=!0;this.colorSteps=5;this.forceNormalize=!1;this.showAreasInList=!0;this.showLinesInList=
|
148 |
this.showImagesInList=!1;this.areasProcessor=new d.AreasProcessor(this);this.areasSettings=new d.AreasSettings(a);this.imagesProcessor=new d.ImagesProcessor(this);this.imagesSettings=new d.ImagesSettings(a);this.linesProcessor=new d.LinesProcessor(this);this.linesSettings=new d.LinesSettings(a);this.initialTouchZoom=1;this.showDescriptionOnHover=!1;d.AmMap.base.construct.call(this,a);this.creditsPosition="bottom-left";this.product="ammap";this.areasClasses={};d.applyTheme(this,a,this.cname)},initChart:function(){this.zoomInstantly=
|
149 |
!0;var a=this.container;this.panRequired=!0;if(this.sizeChanged&&d.hasSVG&&this.chartCreated){this.freeLabelsSet&&this.freeLabelsSet.remove();this.freeLabelsSet=a.set();this.container.setSize(this.realWidth,this.realHeight);this.resizeMap();this.drawBackground();this.redrawLabels();this.drawTitles();this.processObjects(!0);this.rescaleObjects();this.zoomControl.init(this,a);this.drawBg();var b=this.smallMap;b&&b.init(this,a);(b=this.valueLegend)&&b.init(this,a);this.sizeChanged=!1;this.zoomToLongLat(this.zLevelTemp,
|
159 |
this.formatString(a.accessibleLabel,a);a.displayObject&&this.makeAccessible(a.displayObject,b,"menuitem")}},update:function(){d.hasSVG&&(d.AmMap.base.update.call(this),this.zoomControl&&this.zoomControl.update&&this.zoomControl.update())},animateMap:function(){var a=this;a.totalFrames=a.zoomDuration*d.updateRate;a.totalFrames+=1;a.frame=0;a.tweenPercent=0;a.balloon.hide(0);setTimeout(function(){a.updateSize.call(a)},1E3/d.updateRate)},updateSize:function(){var a=this,b=a.totalFrames;a.preventHover=
|
160 |
!0;a.frame<=b?(a.frame++,b=d.easeOutSine(0,a.frame,0,1,b),1<=b?(b=1,a.preventHover=!1,a.wheelBusy=!1):window.requestAnimationFrame?window.requestAnimationFrame(function(){a.updateSize.call(a)}):setTimeout(function(){a.updateSize.call(a)},1E3/d.updateRate),.8<b&&(a.preventHover=!1)):(b=1,a.preventHover=!1,a.wheelBusy=!1);a.tweenPercent=b;a.rescaleMapAndObjects()},rescaleMapAndObjects:function(){var a=this.initialScale,b=this.initialX,c=this.initialY,e=this.tweenPercent,a=a+(this.finalScale-a)*e;this.mapContainer.translate(b+
|
161 |
(this.finalX-b)*e,c+(this.finalY-c)*e,a,!0);if(this.areasSettings.adjustOutlineThickness){for(var b=this.svgAreas,d=0;d<b.length;d++)(c=b[d])&&c.setAttr("stroke-width",this.areasSettings.outlineThickness/a/this.mapScale);if(b=this.dataProvider.areas)for(d=0;d<b.length;d++){var c=b[d],g=c.displayObject;g&&g.setAttr("stroke-width",c.outlineThicknessReal/a/this.mapScale)}}this.rescaleObjects();this.positionChanged();this.updateSmallMap();1==e&&this.fire({type:"zoomCompleted",chart:this})},updateSmallMap:function(){this.smallMap&&
|
162 |
+
this.smallMap.update()},rescaleObjects:function(){var a=this.mapContainer.scale,b=this.imagesProcessor.objectsToResize,c;for(c=0;c<b.length;c++){var e=b[c].image,d=b[c].scale,g=b[c].mapImage;isNaN(g.selectedScaleReal)||g!=this.selectedObject||(g.tempScale=d,d*=g.selectedScaleReal);e.translate(e.x,e.y,d/a,!0)}b=this.imagesProcessor.labelsToReposition;for(c=0;c<b.length;c++)e=b[c],e.imageLabel&&this.imagesProcessor.positionLabel(e.imageLabel,e,e.labelPositionReal);b=this.linesProcessor;if(e=b.linesToResize)for(c=
|
163 |
+
0;c<e.length;c++)d=e[c],d.line.setAttr("stroke-width",d.thickness/a);b=b.objectsToResize;for(c=0;c<b.length;c++)e=b[c],e.translate(e.x,e.y,1/a,!0)},handleTouchEnd:function(a){this.initialDistance=NaN;this.mouseIsDown=this.isDragging=!1;d.AmMap.base.handleTouchEnd.call(this,a)},handleMouseDown:function(a){d.resetMouseOver();this.mouseIsDown=this.mouseIsOver=!0;this.balloon.hide(0);a&&this.mouseIsOver&&a.preventDefault&&this.panEventsEnabled&&a.preventDefault();if(this.chartCreated&&!this.preventHover&&
|
164 |
+
(this.initialTouchZoom=this.zoomLevel(),this.dragMap&&(this.stopAnimation(),this.mapContainerClickX=this.mapContainer.x,this.mapContainerClickY=this.mapContainer.y),a||(a=window.event),a.shiftKey&&!0===this.developerMode&&this.getDevInfo(),a&&a.touches)){var b=this.mouseX,c=this.mouseY,e=a.touches.item(1);e&&this.panEventsEnabled&&this.boundingRect&&(a=e.clientX-this.boundingRect.left,e=e.clientY-this.boundingRect.top,this.middleXP=(b+(a-b)/2)/this.realWidth,this.middleYP=(c+(e-c)/2)/this.realHeight,
|
165 |
+
this.initialDistance=Math.sqrt(Math.pow(a-b,2)+Math.pow(e-c,2)))}},stopDrag:function(){this.isDragging=!1},handleReleaseOutside:function(){if(d.isModern){var a=this;d.AmMap.base.handleReleaseOutside.call(a);a.mouseIsDown=!1;setTimeout(function(){a.resetPinch.call(a)},100);if(!a.preventHover){a.stopDrag();var b=a.zoomControl;b&&b.draggerUp&&b.draggerUp();a.mapWasDragged=!1;var b=a.mapContainer,c=a.mapContainerClickX,e=a.mapContainerClickY;isNaN(c)||isNaN(e)||!(3<Math.abs(b.x-c)||3<Math.abs(b.y-e))||
|
166 |
+
(a.mapWasDragged=!0,b={type:"dragCompleted",zoomX:a.zoomX(),zoomY:a.zoomY(),zoomLevel:a.zoomLevel(),chart:a},a.fire(b));(a.mouseIsOver&&!a.mapWasDragged&&!a.skipClick||a.wasTouched&&3>Math.abs(a.mouseX-a.tmx)&&3>Math.abs(a.mouseY-a.tmy))&&a.fire({type:"click",x:a.mouseX,y:a.mouseY,chart:a});a.mapContainerClickX=NaN;a.mapContainerClickY=NaN;a.objectWasClicked=!1;a.zoomOnDoubleClick&&a.mouseIsOver&&(b=(new Date).getTime(),200>b-a.previousClickTime&&40<b-a.previousClickTime&&a.doDoubleClickZoom(),a.previousClickTime=
|
167 |
+
b)}a.wasTouched=!1}},resetPinch:function(){this.mapWasPinched=!1},handleMouseMove:function(a){var b=this;d.AmMap.base.handleMouseMove.call(b,a);if(!a||!a.touches||!b.tapToActivate||b.tapped){b.panEventsEnabled&&b.mouseIsOver&&a&&a.preventDefault&&a.preventDefault();var c=b.previuosMouseX,e=b.previuosMouseY,f=b.mouseX,g=b.mouseY,h=b.zoomControl;isNaN(c)&&(c=f);isNaN(e)&&(e=g);b.mouse2X=NaN;b.mouse2Y=NaN;a&&a.touches&&(a=a.touches.item(1))&&b.panEventsEnabled&&b.boundingRect&&(b.mouse2X=a.clientX-b.boundingRect.left,
|
168 |
+
b.mouse2Y=a.clientY-b.boundingRect.top);if(a=b.mapContainer){var k=b.mouse2X,l=b.mouse2Y;b.pinchTO&&clearTimeout(b.pinchTO);b.pinchTO=setTimeout(function(){b.resetPinch.call(b)},1E3);var m=b.realHeight,n=b.realWidth,q=b.mapWidth,r=b.mapHeight;b.mouseIsDown&&b.dragMap&&(3<Math.abs(b.previuosMouseX-b.mouseX)||3<Math.abs(b.previuosMouseY-b.mouseY))&&(b.isDragging=!0);if(!isNaN(k)){b.stopDrag();var t=Math.sqrt(Math.pow(k-f,2)+Math.pow(l-g,2)),p=b.initialDistance;isNaN(p)&&(p=Math.sqrt(Math.pow(k-f,2)+
|
169 |
+
Math.pow(l-g,2)));if(!isNaN(p)){var k=b.initialTouchZoom*t/p,k=d.fitToBounds(k,h.minZoomLevel,h.maxZoomLevel),h=b.zoomLevel(),p=b.middleXP,l=b.middleYP,t=m/r,y=n/q,p=(b.zoomX()-p*y)*(k/h)+p*y,l=(b.zoomY()-l*t)*(k/h)+l*t;.1<Math.abs(k-h)&&(b.zoomTo(k,p,l,!0),b.mapWasPinched=!0,clearTimeout(b.pinchTO))}}k=a.scale;b.isDragging&&(b.balloon.hide(0),b.positionChanged(),c=a.x+(f-c),e=a.y+(g-e),b.preventDragOut&&(r=-r*k+m/2,m/=2,c=d.fitToBounds(c,-q*k+n/2,n/2),e=d.fitToBounds(e,r,m)),isNaN(c)||isNaN(e)||
|
170 |
+
(a.translate(c,e,k,!0),b.updateSmallMap()));b.previuosMouseX=f;b.previuosMouseY=g}}},selectObject:function(a,b){var c=this;a||(a=c.dataProvider);a.isOver=!1;var e=a.linkToObject;d.isString(e)&&(e=c.getObjectById(e));a.useTargetsZoomValues&&e&&(a.zoomX=e.zoomX,a.zoomY=e.zoomY,a.zoomLatitude=e.zoomLatitude,a.zoomLongitude=e.zoomLongitude,a.zoomLevel=e.zoomLevel);var f=c.selectedObject;f&&c.returnInitialColor(f);c.selectedObject=a;var g=!1,h,k;"MapArea"==a.objectType&&(a.autoZoomReal&&(g=!0),h=c.areasSettings.selectedOutlineColor,
|
171 |
+
k=c.areasSettings.selectedOutlineThickness);if(e&&!g&&(d.isString(e)&&(e=c.getObjectById(e)),isNaN(a.zoomLevel)&&isNaN(a.zoomX)&&isNaN(a.zoomY))){if(c.extendMapData(e))return;c.selectObject(e);return}c.allowMultipleDescriptionWindows||c.closeAllDescriptions();clearTimeout(c.selectedObjectTimeOut);clearTimeout(c.processObjectsTimeOut);e=c.zoomDuration;!g&&isNaN(a.zoomLevel)&&isNaN(a.zoomX)&&isNaN(a.zoomY)?(c.showDescriptionAndGetUrl(),b||c.processObjects()):(c.selectedObjectTimeOut=setTimeout(function(){c.showDescriptionAndGetUrl.call(c)},
|
172 |
+
1E3*e+200),c.showObjectsAfterZoom)?b||(c.processObjectsTimeOut=setTimeout(function(){c.processObjects.call(c)},1E3*e+200)):b||c.processObjects();e=a.displayObject;g=a.selectedColorReal;if("MapImage"==a.objectType){h=c.imagesSettings.selectedOutlineColor;k=c.imagesSettings.selectedOutlineThickness;var e=a.image,l=a.selectedScaleReal;if(!isNaN(l)&&1!=l){var m=a.scale;isNaN(a.tempScale)||(m=a.tempScale);isNaN(m)&&(m=1);a.tempScale=m;var n=a.displayObject;n.translate(n.x,n.y,m*l,!0)}}if(e){if(d.removeCN(c,
|
173 |
+
e,"selected-object"),d.setCN(c,e,"selected-object"),a.bringForwardOnHover&&a.displayObject.toFront(),c.outlinesToFront(),!a.preserveOriginalAttributes){e.setAttr("stroke",a.outlineColorReal);void 0!==g&&e.setAttr("fill",g);void 0!==h&&e.setAttr("stroke",h);void 0!==k&&e.setAttr("stroke-width",k);"MapLine"==a.objectType&&((l=a.lineSvg)&&l.setAttr("stroke",g),l=a.arrowSvg)&&(l.setAttr("fill",g),l.setAttr("stroke",g));if(l=a.imageLabel)m=a.selectedLabelColorReal,void 0!==m&&l.setAttr("fill",m);a.selectable||
|
174 |
+
(e.setAttr("cursor","default"),l&&l.setAttr("cursor","default"))}}else c.returnInitialColorReal(a);if(e=a.groupId)for(l=a.groupArray,l||(l=c.getGroupById(e),a.groupArray=l),m=0;m<l.length;m++)if(n=l[m],n.isOver=!1,e=n.displayObject,"MapImage"==n.objectType&&(e=n.image),e){var q=n.selectedColorReal;void 0!==q&&e.setAttr("fill",q);void 0!==h&&e.setAttr("stroke",h);void 0!==k&&e.setAttr("stroke-width",k);"MapLine"==n.objectType&&((e=n.lineSvg)&&e.setAttr("stroke",g),e=n.arrowSvg)&&(e.setAttr("fill",
|
175 |
+
g),e.setAttr("stroke",g))}c.rescaleObjects();c.zoomToSelectedObject();f!=a&&c.fire({type:"selectedObjectChanged",chart:c})},returnInitialColor:function(a,b){this.returnInitialColorReal(a);b&&(a.isFirst=!1);if(this.selectedObject.bringForwardOnHover){var c=this.selectedObject.displayObject;c&&c.toFront()}if(c=a.groupId){var c=this.getGroupById(c),d;for(d=0;d<c.length;d++)this.returnInitialColorReal(c[d]),b&&(c[d].isFirst=!1)}this.outlinesToFront()},outlinesToFront:function(){if(this.outlines)for(var a=
|
176 |
+
0;a<this.outlines.length;a++)this.outlines[a].toFront()},closeAllDescriptions:function(){this.descriptionsDiv.innerHTML=""},fireClosed:function(){this.fire({type:"descriptionClosed",chart:this})},returnInitialColorReal:function(a){a.isOver=!1;var b=a.displayObject;if(b){d.removeCN(this,b,"selected-object");b.toPrevious();if("MapImage"==a.objectType){var c=a.tempScale;isNaN(c)||b.translate(b.x,b.y,c,!0);a.tempScale=NaN;b=a.image}c=a.colorReal;if("MapLine"==a.objectType){var e=a.lineSvg;e&&e.setAttr("stroke",
|
177 |
+
c);if(e=a.arrowSvg){var f=a.arrowColor;void 0==f&&(f=c);e.setAttr("fill",f);e.setAttr("stroke",f)}}var e=a.alphaReal,f=a.outlineAlphaReal,g=a.outlineThicknessReal,h=a.outlineColorReal;if(a.showAsSelected){var c=a.selectedColorReal,k,l;"MapImage"==a.objectType&&(k=this.imagesSettings.selectedOutlineColor,l=this.imagesSettings.selectedOutlineThickness);"MapArea"==a.objectType&&(k=this.areasSettings.selectedOutlineColor,l=this.areasSettings.selectedOutlineThickness);void 0!==k&&(h=k);void 0!==l&&(g=
|
178 |
+
l)}"bubble"==a.type&&(c=void 0);void 0!==c&&b.setAttr("fill",c);if(k=a.image)k.setAttr("fill",c),k.setAttr("stroke",h),k.setAttr("stroke-width",g),k.setAttr("fill-opacity",e),k.setAttr("stroke-opacity",f);"MapArea"==a.objectType&&(c=1,this.areasSettings.adjustOutlineThickness&&(c=this.zoomLevel()*this.mapScale),b.setAttr("stroke",h),b.setAttr("stroke-width",g/c),b.setAttr("fill-opacity",e),b.setAttr("stroke-opacity",f));(c=a.pattern)&&b.pattern(c,this.mapScale,this.path);(b=a.imageLabel)&&!a.labelInactive&&
|
179 |
+
(a.showAsSelected&&void 0!==a.selectedLabelColor?b.setAttr("fill",a.selectedLabelColor):b.setAttr("fill",a.labelColorReal))}},zoomToRectangle:function(a,b,c,e){var f=this.realWidth,g=this.realHeight,h=this.mapSet.scale,k=this.zoomControl,f=d.fitToBounds(c/f>e/g?.8*f/(c*h):.8*g/(e*h),k.minZoomLevel,k.maxZoomLevel);this.zoomToMapXY(f,(a+c/2)*h,(b+e/2)*h)},zoomToLatLongRectangle:function(a,b,c,e){var f=this.dataProvider,g=this.zoomControl,h=Math.abs(c-a),k=Math.abs(b-e),l=Math.abs(f.rightLongitude-f.leftLongitude),
|
180 |
+
f=Math.abs(f.topLatitude-f.bottomLatitude),g=d.fitToBounds(h/l>k/f?.8*l/h:.8*f/k,g.minZoomLevel,g.maxZoomLevel);this.zoomToLongLat(g,a+(c-a)/2,e+(b-e)/2)},getGroupById:function(a){var b=[];this.getGroup(this.imagesProcessor.allObjects,a,b);this.getGroup(this.linesProcessor.allObjects,a,b);this.getGroup(this.areasProcessor.allObjects,a,b);return b},zoomToGroup:function(a){a="object"==typeof a?a:this.getGroupById(a);var b,c,d,f,g;for(g=0;g<a.length;g++){var h=a[g].displayObject;if(h){var k=h.getBBox(),
|
181 |
+
h=k.y,l=k.y+k.height,m=k.x,k=k.x+k.width;if(h<b||isNaN(b))b=h;if(l>f||isNaN(f))f=l;if(m<c||isNaN(c))c=m;if(k>d||isNaN(d))d=k}}c+=this.diffX;d+=this.diffX;f+=this.diffY;b+=this.diffY;this.zoomToRectangle(c,b,d-c,f-b)},getGroup:function(a,b,c){if(a){var d;for(d=0;d<a.length;d++){var f=a[d];f.groupId==b&&c.push(f)}}},zoomToStageXY:function(a,b,c,e){if(!this.objectWasClicked){var f=this.zoomControl;a=d.fitToBounds(a,f.minZoomLevel,f.maxZoomLevel);var f=this.zoomLevel(),g=this.mapSet.getBBox();b=this.xyToCoordinates((b-
|
182 |
+
this.mapContainer.x)/f-g.x*this.mapScale,(c-this.mapContainer.y)/f-g.y*this.mapScale);this.zoomToLongLat(a,b.longitude,b.latitude,e)}},zoomToLongLat:function(a,b,c,d){b=this.coordinatesToXY(b,c);this.zoomToMapXY(a,b.x,b.y,d)},zoomToMapXY:function(a,b,c,d){var f=this.mapWidth,g=this.mapHeight;this.zoomTo(a,-(b/f)*a+this.realWidth/f/2,-(c/g)*a+this.realHeight/g/2,d)},zoomToObject:function(a){if(a){var b=a.zoomLatitude,c=a.zoomLongitude;isNaN(a.zoomLatitudeC)||(b=a.zoomLatitudeC);isNaN(a.zoomLongitudeC)||
|
183 |
+
(c=a.zoomLongitudeC);var e=a.zoomLevel,f=this.zoomInstantly,g=a.zoomX,h=a.zoomY,k=this.realWidth,l=this.realHeight;isNaN(e)||(isNaN(b)||isNaN(c)?this.zoomTo(e,g,h,f):this.zoomToLongLat(e,c,b,f));this.zoomInstantly=!1;"MapImage"==a.objectType&&isNaN(a.zoomX)&&isNaN(a.zoomY)&&isNaN(a.zoomLatitude)&&isNaN(a.zoomLongitude)&&!isNaN(a.latitude)&&!isNaN(a.longitude)&&this.zoomToLongLat(a.zoomLevel,a.longitude,a.latitude);"MapArea"==a.objectType&&(f=a.displayObject.getBBox(),g=this.mapScale,b=(f.x+this.diffX)*
|
184 |
+
g,c=(f.y+this.diffY)*g,e=f.width*g,f=f.height*g,k=a.autoZoomReal&&isNaN(a.zoomLevel)?e/k>f/l?.8*k/e:.8*l/f:a.zoomLevel,l=this.zoomControl,k=d.fitToBounds(k,l.minZoomLevel,l.maxZoomLevel),isNaN(a.zoomX)&&isNaN(a.zoomY)&&isNaN(a.zoomLatitude)&&isNaN(a.zoomLongitude)&&this.zoomToMapXY(k,b+e/2,c+f/2));this.zoomControl.update()}},zoomToSelectedObject:function(){this.zoomToObject(this.selectedObject)},zoomTo:function(a,b,c,e){var f=this.zoomControl;a=d.fitToBounds(a,f.minZoomLevel,f.maxZoomLevel);f=this.zoomLevel();
|
185 |
+
isNaN(b)&&(b=this.realWidth/this.mapWidth,b=(this.zoomX()-.5*b)*(a/f)+.5*b);isNaN(c)&&(c=this.realHeight/this.mapHeight,c=(this.zoomY()-.5*c)*(a/f)+.5*c);this.stopAnimation();isNaN(a)||(f=this.mapContainer,this.initialX=f.x,this.initialY=f.y,this.initialScale=f.scale,this.finalX=this.mapWidth*b,this.finalY=this.mapHeight*c,this.finalScale=a,this.finalX!=this.initialX||this.finalY!=this.initialY||this.finalScale!=this.initialScale?e?(this.tweenPercent=1,this.rescaleMapAndObjects(),this.wheelBusy=!1):
|
186 |
+
this.animateMap():this.wheelBusy=!1)},loadXml:function(a){var b;window.XMLHttpRequest&&(b=new XMLHttpRequest);b.overrideMimeType&&b.overrideMimeType("text/xml");b.open("GET",a,!1);b.send();this.parseXMLObject(b.responseXML);this.svgData&&this.buildEverything()},stopAnimation:function(){this.frame=this.totalFrames},processObjects:function(a){var b=this.selectedObject;if(0<b.images.length||0<b.areas.length||0<b.lines.length||b==this.dataProvider||a){a=this.container;var c=this.stageImagesContainer;
|
187 |
+
c&&c.remove();this.stageImagesContainer=c=a.set();this.trendLinesSet.push(c);var d=this.stageLinesContainer;d&&d.remove();this.stageLinesContainer=d=a.set();this.trendLinesSet.push(d);var f=this.mapImagesContainer;f&&f.remove();this.mapImagesContainer=f=a.set();this.mapContainer.push(f);var g=this.mapLinesContainer;g&&g.remove();this.mapLinesContainer=g=a.set();this.mapContainer.push(g);this.linesAboveImages?(f.toFront(),c.toFront(),g.toFront(),d.toFront()):(g.toFront(),d.toFront(),f.toFront(),c.toFront());
|
188 |
+
b&&(this.imagesProcessor.reset(),this.linesProcessor.reset(),this.linesAboveImages?(this.imagesProcessor.process(b),this.linesProcessor.process(b)):(this.linesProcessor.process(b),this.imagesProcessor.process(b)));this.rescaleObjects()}},processAreas:function(){this.areasProcessor.process(this.dataProvider)},buildSVGMap:function(){d.remove(this.mapSet);var a=this.svgData.g.path,b=this.container,c=b.set();this.svgAreas=[];this.svgAreasById={};void 0===a.length&&(a=[a]);var e;for(e=0;e<a.length;e++){var f=
|
189 |
+
a[e],g=f.d,h=f.title;f.titleTr&&(h=f.titleTr);var k=b.path(g);k.id=f.id;if(this.areasSettings.preserveOriginalAttributes){k.customAttr={};for(var l in f)"d"!=l&&"id"!=l&&"title"!=l&&(k.customAttr[l]=f[l])}k.path=g;this.svgAreasById[f.id]={area:k,title:h,className:f["class"]};this.svgAreas.push(k);c.push(k)}this.mapSet=c;this.mapContainer.push(c);this.resizeMap()},centerAlign:function(){},setProjection:function(a){this.projection=a;this.chartCreated=!1;this.buildEverything()},addObjectEventListeners:function(a,
|
190 |
+
b){var c=this;a.mousedown(function(a){c.mouseDownMapObject(b,a)}).mouseup(function(a){c.clickMapObject(b,a)}).mouseover(function(a){c.balloonX=NaN;c.rollOverMapObject(b,!0,a)}).mouseout(function(a){c.balloonX=NaN;c.rollOutMapObject(b,a)}).touchend(function(a){4>Math.abs(c.mouseX-c.tmx)&&4>Math.abs(c.mouseY-c.tmy)&&(c.tapped=!0);c.tapToActivate&&!c.tapped||c.mapWasDragged||c.mapWasPinched||(c.balloonX=NaN,c.rollOverMapObject(b,!0,a),c.clickMapObject(b,a))}).touchstart(function(a){c.tmx=c.mouseX;c.tmy=
|
191 |
+
c.mouseY;c.mouseDownMapObject(b,a)}).keyup(function(a){13==a.keyCode&&c.clickMapObject(b,a)})},checkIfSelected:function(a){var b=this.selectedObject;if(b==a)return!0;if(b=b.groupId){var b=this.getGroupById(b),c;for(c=0;c<b.length;c++)if(b[c]==a)return!0}return!1},clearMap:function(){this.chartDiv.innerHTML="";this.clearObjectList()},clearObjectList:function(){var a=this.objectList;a&&a.div&&(a.div.innerHTML="")},checkIfLast:function(a){if(a){var b=a.parentNode;if(b&&b.lastChild==a)return!0}return!1},
|
192 |
+
showAsRolledOver:function(a){var b=a.displayObject;if(!a.showAsSelected&&b&&!a.isOver){b.node.onmouseout=function(){};b.node.onmouseover=function(){};b.node.onclick=function(){};!a.isFirst&&a.bringForwardOnHover&&(b.toFront(),a.isFirst=!0);var c=a.rollOverColorReal,e;a.preserveOriginalAttributes&&(c=void 0);"bubble"==a.type&&(c=void 0);void 0==c&&(isNaN(a.rollOverBrightnessReal)||(c=d.adjustLuminosity(a.colorReal,a.rollOverBrightnessReal/100)));if(void 0!=c)if("MapImage"==a.objectType)(e=a.image)&&
|
193 |
+
e.setAttr("fill",c);else if("MapLine"==a.objectType){if((e=a.lineSvg)&&e.setAttr("stroke",c),e=a.arrowSvg)e.setAttr("fill",c),e.setAttr("stroke",c)}else b.setAttr("fill",c);(c=a.imageLabel)&&!a.labelInactive&&(e=a.labelRollOverColorReal,void 0!=e&&c.setAttr("fill",e));c=a.rollOverOutlineColorReal;void 0!=c&&("MapImage"==a.objectType?(e=a.image)&&e.setAttr("stroke",c):b.setAttr("stroke",c));"MapImage"==a.objectType?(c=this.imagesSettings.rollOverOutlineThickness,(e=a.image)&&(isNaN(c)||e.setAttr("stroke-width",
|
194 |
+
c))):(c=this.areasSettings.rollOverOutlineThickness,isNaN(c)||b.setAttr("stroke-width",c));if("MapArea"==a.objectType){c=this.areasSettings;e=a.rollOverAlphaReal;isNaN(e)||b.setAttr("fill-opacity",e);e=c.rollOverOutlineAlpha;isNaN(e)||b.setAttr("stroke-opacity",e);e=1;this.areasSettings.adjustOutlineThickness&&(e=this.zoomLevel()*this.mapScale);var f=c.rollOverOutlineThickness;isNaN(f)||b.setAttr("stroke-width",f/e);(c=c.rollOverPattern)&&b.pattern(c,this.mapScale,this.path)}"MapImage"==a.objectType&&
|
195 |
+
(c=a.rollOverScaleReal,isNaN(c)||1==c||(e=b.scale,isNaN(e)&&(e=1),a.tempScale=e,b.translate(b.x,b.y,e*c,!0)));this.useHandCursorOnClickableOjects&&this.checkIfClickable(a)&&b.setAttr("cursor","pointer");a.mouseEnabled&&this.addObjectEventListeners(b,a);a.isOver=!0}this.outlinesToFront()},rollOverMapObject:function(a,b,c){if(this.chartCreated){this.handleMouseMove();var d=this.previouslyHovered;d&&d!=a?(!1===this.checkIfSelected(d)&&(this.returnInitialColor(d,!0),this.previouslyHovered=null),this.balloon.hide(0)):
|
196 |
+
clearTimeout(this.hoverInt);if(!this.preventHover){if(!1===this.checkIfSelected(a)){if(d=a.groupId){var d=this.getGroupById(d),f;for(f=0;f<d.length;f++)d[f]!=a&&this.showAsRolledOver(d[f])}this.showAsRolledOver(a)}else(d=a.displayObject)&&(this.allowClickOnSelectedObject?d.setAttr("cursor","pointer"):d.setAttr("cursor","default"));this.showDescriptionOnHover?this.showDescription(a):!this.showBalloonOnSelectedObject&&this.checkIfSelected(a)||!1===b||(f=this.balloon,this.balloon.fixedPosition=!1,b=
|
197 |
+
a.colorReal,d="",void 0!==b&&this.useObjectColorForBalloon||(b=f.fillColor),(f=a.balloonTextReal)&&(d=this.formatString(f,a)),this.balloonLabelFunction&&(d=this.balloonLabelFunction(a,this)),d&&""!==d&&this.showBalloon(d,b,!1,this.balloonX,this.balloonY));this.fire({type:"rollOverMapObject",mapObject:a,chart:this,event:c});this.previouslyHovered=a}}},longitudeToX:function(a){return(this.longitudeToCoordinate(a)+this.diffX*this.mapScale)*this.zoomLevel()+this.mapContainer.x},latitudeToY:function(a){return(this.latitudeToCoordinate(a)+
|
198 |
+
this.diffY*this.mapScale)*this.zoomLevel()+this.mapContainer.y},latitudeToStageY:function(a){return this.latitudeToCoordinate(a)*this.zoomLevel()+this.mapContainer.y+this.diffY*this.mapScale},longitudeToStageX:function(a){return this.longitudeToCoordinate(a)*this.zoomLevel()+this.mapContainer.x+this.diffX*this.mapScale},stageXToLongitude:function(a){a=(a-this.mapContainer.x)/this.zoomLevel();return this.coordinateToLongitude(a)},stageYToLatitude:function(a){a=(a-this.mapContainer.y)/this.zoomLevel();
|
199 |
+
return this.coordinateToLatitude(a)},rollOutMapObject:function(a,b){this.hideBalloon();a&&this.chartCreated&&a.isOver&&(this.checkIfSelected(a)||this.returnInitialColor(a),this.fire({type:"rollOutMapObject",mapObject:a,chart:this,event:b}))},formatString:function(a,b){var c=this.nf,e=this.pf,f=b.title;b.titleTr&&(f=b.titleTr);void 0==f&&(f="");var g=b.value,g=isNaN(g)?"":d.formatNumber(g,c),c=b.percents,c=isNaN(c)?"":d.formatNumber(c,e),e=b.description;void 0==e&&(e="");var h=b.customData;void 0==
|
200 |
+
h&&(h="");return a=d.massReplace(a,{"[[title]]":f,"[[value]]":g,"[[percent]]":c,"[[description]]":e,"[[customData]]":h})},mouseDownMapObject:function(a,b){this.fire({type:"mouseDownMapObject",mapObject:a,chart:this,event:b})},clickMapObject:function(a,b){var c=this;b&&(b.touches||isNaN(a.zoomLevel)&&isNaN(a.zoomX)&&isNaN(a.zoomY)||c.hideBalloon());if(c.chartCreated&&!c.preventHover&&c.checkTouchDuration(b)&&!c.mapWasDragged&&c.checkIfClickable(a)&&!c.mapWasPinched){c.selectObject(a);var d=c.zoomLevel(),
|
201 |
+
f=c.mapSet.getBBox(),d=c.xyToCoordinates((c.mouseX-c.mapContainer.x)/d-f.x*c.mapScale,(c.mouseY-c.mapContainer.y)/d-f.y*c.mapScale);c.clickLatitude=d.latitude;c.clickLongitude=d.longitude;b&&b.touches&&setTimeout(function(){c.showBalloonAfterZoom.call(c)},1E3*c.zoomDuration);c.fire({type:"clickMapObject",mapObject:a,chart:c,event:b});c.objectWasClicked=!0}},showBalloonAfterZoom:function(){var a=this.clickLongitude,b=this.clickLatitude,c=this.selectedObject;"MapImage"!=c.objectType||isNaN(c.longitude)||
|
202 |
+
(a=c.longitude,b=c.latitude);a=this.coordinatesToStageXY(a,b);this.balloonX=a.x;this.balloonY=a.y;this.rollOverMapObject(this.selectedObject,!0)},checkIfClickable:function(a){var b=this.allowClickOnSelectedObject;return this.selectedObject==a&&b?!0:this.selectedObject!=a||b?!0===a.selectable||"MapArea"==a.objectType&&a.autoZoomReal||a.url||a.linkToObject||0<a.images.length||0<a.lines.length||!isNaN(a.zoomLevel)||!isNaN(a.zoomX)||!isNaN(a.zoomY)||a.description?!0:!1:!1},resizeMap:function(){var a=
|
203 |
+
this.mapSet;if(a){var b=1,c=a.getBBox(),d=this.realWidth,f=this.realHeight,g=c.width,c=c.height;0<g&&0<c&&(this.fitMapToContainer&&(b=g/d>c/f?d/g:f/c),a.translate(0,0,b,!0),this.mapScale=b,this.mapHeight=c*b,this.mapWidth=g*b)}},zoomIn:function(){var a=this.zoomLevel()*this.zoomControl.zoomFactor;this.zoomTo(a)},zoomOut:function(){var a=this.zoomLevel()/this.zoomControl.zoomFactor;this.zoomTo(a)},moveLeft:function(){var a=this.zoomX()+this.zoomControl.panStepSize;this.zoomTo(this.zoomLevel(),a,this.zoomY())},
|
204 |
+
moveRight:function(){var a=this.zoomX()-this.zoomControl.panStepSize;this.zoomTo(this.zoomLevel(),a,this.zoomY())},moveUp:function(){var a=this.zoomY()+this.zoomControl.panStepSize;this.zoomTo(this.zoomLevel(),this.zoomX(),a)},moveDown:function(){var a=this.zoomY()-this.zoomControl.panStepSize;this.zoomTo(this.zoomLevel(),this.zoomX(),a)},zoomX:function(){return this.mapSet?Math.round(1E4*this.mapContainer.x/this.mapWidth)/1E4:NaN},zoomY:function(){return this.mapSet?Math.round(1E4*this.mapContainer.y/
|
205 |
+
this.mapHeight)/1E4:NaN},goHome:function(){this.selectObject(this.dataProvider);this.fire({type:"homeButtonClicked",chart:this})},zoomLevel:function(){return Math.round(1E5*this.mapContainer.scale)/1E5},showDescriptionAndGetUrl:function(){var a=this.selectedObject;if(a){this.showDescription();var b=a.url;if(b)d.getURL(b,a.urlTarget);else if(b=a.linkToObject){if(d.isString(b)){var c=this.getObjectById(b);if(c){this.selectObject(c);return}}b&&a.passZoomValuesToTarget&&(b.zoomLatitude=this.zoomLatitude(),
|
206 |
+
b.zoomLongitude=this.zoomLongitude(),b.zoomLevel=this.zoomLevel());this.extendMapData(b)||this.selectObject(b)}}},extendMapData:function(a){var b=a.objectType;if("MapImage"!=b&&"MapArea"!=b&&"MapLine"!=b)return d.extend(a,new d.MapData,!0),this.dataProvider=a,this.zoomInstantly=!0,this.validateData(),!0},showDescription:function(a){a||(a=this.selectedObject);this.allowMultipleDescriptionWindows||this.closeAllDescriptions();if(a.description){var b=a.descriptionWindow;b&&b.close();b=new d.DescriptionWindow;
|
207 |
+
a.descriptionWindow=b;var c=a.descriptionWindowWidth,e=a.descriptionWindowHeight,f=a.descriptionWindowLeft,g=a.descriptionWindowTop,h=a.descriptionWindowRight,k=a.descriptionWindowBottom;isNaN(h)||(f=this.realWidth-h);isNaN(k)||(g=this.realHeight-k);var l=a.descriptionWindowX;isNaN(l)||(f=l);l=a.descriptionWindowY;isNaN(l)||(g=l);isNaN(f)&&(f=this.mouseX,f=f>this.realWidth/2?f-c-20:f+20);isNaN(g)&&(g=this.mouseY);b.maxHeight=e;l=a.title;a.titleTr&&(l=a.titleTr);b.show(this,this.descriptionsDiv,a.description,
|
208 |
+
l);a=b.div.style;a.position="absolute";a.width=c+"px";a.maxHeight=e+"px";isNaN(k)||(g-=b.div.offsetHeight);isNaN(h)||(f-=b.div.offsetWidth);a.left=f+"px";a.top=g+"px"}},parseXMLObject:function(a){var b={root:{}};this.parseXMLNode(b,"root",a);this.svgData=b.root.svg;this.getBounds()},getBounds:function(){var a=this.dataProvider;try{var b=this.svgData.defs["amcharts:ammap"];a.leftLongitude=Number(b.leftLongitude);a.rightLongitude=Number(b.rightLongitude);a.topLatitude=Number(b.topLatitude);a.bottomLatitude=
|
209 |
+
Number(b.bottomLatitude);a.projection=b.projection;var c=b.wrappedLongitudes;c&&(a.rightLongitude+=360);a.wrappedLongitudes=c}catch(d){}},recalcLongitude:function(a){return this.dataProvider.wrappedLongitudes?a<this.dataProvider.leftLongitude?Number(a)+360:a:a},latitudeToCoordinate:function(a){var b,c=this.dataProvider;if(this.mapSet){b=c.topLatitude;var d=c.bottomLatitude;"mercator"==c.projection&&(a=this.mercatorLatitudeToCoordinate(a),b=this.mercatorLatitudeToCoordinate(b),d=this.mercatorLatitudeToCoordinate(d));
|
210 |
+
b=(a-b)/(d-b)*this.mapHeight}return b},longitudeToCoordinate:function(a){a=this.recalcLongitude(a);var b,c=this.dataProvider;this.mapSet&&(b=c.leftLongitude,b=(a-b)/(c.rightLongitude-b)*this.mapWidth);return b},mercatorLatitudeToCoordinate:function(a){89.5<a&&(a=89.5);-89.5>a&&(a=-89.5);a=d.degreesToRadians(a);return d.radiansToDegrees(.5*Math.log((1+Math.sin(a))/(1-Math.sin(a)))/2)},zoomLatitude:function(){if(this.mapContainer){var a=this.mapSet.getBBox(),b=(-this.mapContainer.x+this.previousWidth/
|
211 |
+
2)/this.zoomLevel()-a.x*this.mapScale,a=(-this.mapContainer.y+this.previousHeight/2)/this.zoomLevel()-a.y*this.mapScale;return this.xyToCoordinates(b,a).latitude}},zoomLongitude:function(){if(this.mapContainer){var a=this.mapSet.getBBox(),b=(-this.mapContainer.x+this.previousWidth/2)/this.zoomLevel()-a.x*this.mapScale,a=(-this.mapContainer.y+this.previousHeight/2)/this.zoomLevel()-a.y*this.mapScale;return this.xyToCoordinates(b,a).longitude}},getAreaCenterLatitude:function(a){a=a.displayObject.getBBox();
|
212 |
+
var b=this.mapScale,c=this.mapSet.getBBox();return this.xyToCoordinates((a.x+a.width/2+this.diffX)*b-c.x*b,(a.y+a.height/2+this.diffY)*b-c.y*b).latitude},getAreaCenterLongitude:function(a){a=a.displayObject.getBBox();var b=this.mapScale,c=this.mapSet.getBBox();return this.xyToCoordinates((a.x+a.width/2+this.diffX)*b-c.x*b,(a.y+a.height/2+this.diffY)*b-c.y*b).longitude},milesToPixels:function(a){var b=this.dataProvider;return this.mapWidth/(b.rightLongitude-b.leftLongitude)*a/69.172},kilometersToPixels:function(a){var b=
|
213 |
+
this.dataProvider;return this.mapWidth/(b.rightLongitude-b.leftLongitude)*a/111.325},handleBackgroundClick:function(){if(this.backgroundZoomsToTop&&!this.mapWasDragged){var a=this.dataProvider;if(this.checkIfClickable(a))this.clickMapObject(a);else{var b=a.zoomX,c=a.zoomY,d=a.zoomLongitude,f=a.zoomLatitude,a=a.zoomLevel;isNaN(b)||isNaN(c)||this.zoomTo(a,b,c);isNaN(d)||isNaN(f)||this.zoomToLongLat(a,d,f,!0)}}},parseXMLNode:function(a,b,c,d){void 0===d&&(d="");var f,g,h;if(c){var k=c.childNodes.length;
|
214 |
+
for(f=0;f<k;f++){g=c.childNodes[f];var l=g.nodeName,m=g.nodeValue?this.trim(g.nodeValue):"",n=!1;g.attributes&&0<g.attributes.length&&(n=!0);if(0!==g.childNodes.length||""!==m||!1!==n)if(3==g.nodeType||4==g.nodeType){if(""!==m){g=0;for(h in a[b])a[b].hasOwnProperty(h)&&g++;g?a[b]["#text"]=m:a[b]=m}}else if(1==g.nodeType){var q;void 0!==a[b][l]?void 0===a[b][l].length?(q=a[b][l],a[b][l]=[],a[b][l].push(q),a[b][l].push({}),q=a[b][l][1]):"object"==typeof a[b][l]&&(a[b][l].push({}),q=a[b][l][a[b][l].length-
|
215 |
+
1]):(a[b][l]={},q=a[b][l]);if(g.attributes&&g.attributes.length)for(m=0;m<g.attributes.length;m++)q[g.attributes[m].name]=g.attributes[m].value;void 0!==a[b][l].length?this.parseXMLNode(a[b][l],a[b][l].length-1,g,d+" "):this.parseXMLNode(a[b],l,g,d+" ")}}g=0;c="";for(h in a[b])"#text"==h?c=a[b][h]:g++;0===g&&void 0===a[b].length&&(a[b]=c)}},doDoubleClickZoom:function(){if(!this.mapWasDragged){var a=this.zoomLevel()*this.zoomControl.zoomFactor;this.zoomToStageXY(a,this.mouseX,this.mouseY)}},getDevInfo:function(){var a=
|
216 |
+
this.zoomLevel(),b=this.mapSet.getBBox(),b=this.xyToCoordinates((this.mouseX-this.mapContainer.x)/a-b.x*this.mapScale,(this.mouseY-this.mapContainer.y)/a-b.y*this.mapScale),a={chart:this,type:"writeDevInfo",zoomLevel:a,zoomX:this.zoomX(),zoomY:this.zoomY(),zoomLatitude:this.zoomLatitude(),zoomLongitude:this.zoomLongitude(),latitude:b.latitude,longitude:b.longitude,left:this.mouseX,top:this.mouseY,right:this.realWidth-this.mouseX,bottom:this.realHeight-this.mouseY,percentLeft:Math.round(this.mouseX/
|
217 |
+
this.realWidth*100)+"%",percentTop:Math.round(this.mouseY/this.realHeight*100)+"%",percentRight:Math.round((this.realWidth-this.mouseX)/this.realWidth*100)+"%",percentBottom:Math.round((this.realHeight-this.mouseY)/this.realHeight*100)+"%"},b="zoomLevel:"+a.zoomLevel+", zoomLongitude:"+a.zoomLongitude+", zoomLatitude:"+a.zoomLatitude+"\n",b=b+("zoomX:"+a.zoomX+", zoomY:"+a.zoomY+"\n"),b=b+("latitude:"+a.latitude+", longitude:"+a.longitude+"\n"),b=b+("left:"+a.left+", top:"+a.top+"\n"),b=b+("right:"+
|
218 |
+
a.right+", bottom:"+a.bottom+"\n"),b=b+("left:"+a.percentLeft+", top:"+a.percentTop+"\n"),b=b+("right:"+a.percentRight+", bottom:"+a.percentBottom+"\n");a.str=b;this.fire(a);return a},getXY:function(a,b,c){void 0!==a&&(-1!=String(a).indexOf("%")?(a=Number(a.split("%").join("")),c&&(a=100-a),a=Number(a)*b/100):c&&(a=b-a));return a},getObjectById:function(a){var b=this.dataProvider;if(b.areas){var c=this.getObject(a,b.areas);if(c)return c}if(c=this.getObject(a,b.images))return c;if(a=this.getObject(a,
|
219 |
+
b.lines))return a},getObject:function(a,b){if(b){var c;for(c=0;c<b.length;c++){var d=b[c];if(d.id==a)return d;if(d.areas){var f=this.getObject(a,d.areas);if(f)return f}if(f=this.getObject(a,d.images))return f;if(d=this.getObject(a,d.lines))return d}}},parseData:function(){var a=this.dataProvider;this.processObject(a.areas,a,"area");this.processObject(a.images,a,"image");this.processObject(a.lines,a,"line")},processObject:function(a,b,c){if(a){var e;for(e=0;e<a.length;e++){var f=a[e];f.parentObject=
|
220 |
+
b;"area"==c&&d.extend(f,new d.MapArea(this.theme),!0);"image"==c&&(f=d.extend(f,new d.MapImage(this.theme),!0));"line"==c&&(f=d.extend(f,new d.MapLine(this.theme),!0));a[e]=f;f.areas&&this.processObject(f.areas,f,"area");f.images&&this.processObject(f.images,f,"image");f.lines&&this.processObject(f.lines,f,"line")}}},positionChanged:function(){var a={type:"positionChanged",zoomX:this.zoomX(),zoomY:this.zoomY(),zoomLevel:this.zoomLevel(),chart:this};this.fire(a)},getX:function(a,b){return this.getXY(a,
|
221 |
+
this.realWidth,b)},getY:function(a,b){return this.getXY(a,this.realHeight,b)},trim:function(a){if(a){var b;for(b=0;b<a.length;b++)if(-1===" \n\r\t\f\x0B\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000".indexOf(a.charAt(b))){a=a.substring(b);break}for(b=a.length-1;0<=b;b--)if(-1===" \n\r\t\f\x0B\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000".indexOf(a.charAt(b))){a=a.substring(0,b+1);break}return-1===
|
222 |
+
" \n\r\t\f\x0B\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000".indexOf(a.charAt(0))?a:""}},destroy:function(){d.AmMap.base.destroy.call(this)},x2c:function(a){var b=this.dataProvider.leftLongitude;return Math.round(this.unscaledMapWidth*(a-b)/(this.dataProvider.rightLongitude-b)*100)/100},y2c:function(a){var b=this.dataProvider.topLatitude;return Math.round(this.unscaledMapHeight*(a-b)/(this.dataProvider.bottomLatitude-b)*100)/100},normalize:function(a){if(!a.pathsArray){var b;
|
223 |
+
if(a.normalized)b=a.normalized;else{var c=d.normalizePath(a.node);b=a.node.getAttribute("d");a.normalized=b;c.maxX>this.maxMapX&&(this.maxMapX=c.maxX);c.minX<this.minMapX&&(this.minMapX=c.minX);c.maxY>this.maxMapY&&(this.maxMapY=c.maxY);c.minY<this.minMapY&&(this.minMapY=c.minY)}a.node.setAttribute("d",b)}},redraw:function(a){var b=a.normalized,b=b.split(" Z").join(""),b=b.split("M");a.pathsArray=[];for(var c=0;c<b.length;c++){var d=b[c];if(d){for(var d=d.split("L"),f=[],g=0;g<d.length;g++)if(d[g]){var h=
|
224 |
+
d[g].split(" "),h=this.xyToCoordinates(Number(h[1]),Number(h[2]),this.dpProjectionFunction,this.sourceMapWidth,this.sourceMapHeight);f.push([h.longitude,h.latitude])}a.pathsArray.push(f)}}b="";for(c=0;c<a.pathsArray.length;c++)b+=this.redrawArea(a.pathsArray[c]);a.node.setAttribute("d",b);a.path=b},redrawArea:function(a){for(var b=!1,c="",e=0;e<a.length;e++){var f=a[e][0],g=a[e][1],h=d.degreesToRadians(a[e][0]),k=d.degreesToRadians(a[e][1]),k=this.projectionFunction(h,k),h=d.roundTo(this.x2c(d.radiansToDegrees(k[0])),
|
225 |
+
3),k=d.roundTo(this.y2c(d.radiansToDegrees(k[1])),3);h<this.minMapXX&&(this.minMapXX=h,this.leftLongLat={longitude:f,latitude:g});h>this.maxMapXX&&(this.maxMapXX=h,this.rightLongLat={longitude:f,latitude:g});k<this.minMapYY&&(this.minMapYY=k,this.topLongLat={longitude:f,latitude:g});k>this.maxMapYY&&(this.maxMapYY=k,this.bottomLongLat={longitude:f,latitude:g});b?c+=" L ":(c+=" M ",b=!0);c+=h+" "+k}return c+" Z "},normalizeMap:function(){var a=d.degreesToRadians(this.dataProvider.leftLongitude),b=
|
226 |
+
d.degreesToRadians(this.dataProvider.rightLongitude),c=d.degreesToRadians(this.dataProvider.topLatitude),e=d.degreesToRadians(this.dataProvider.bottomLatitude),f=a+(b-a)/2,g=c+(e-c)/2,h=this.dpProjectionFunction(f,c)[1],k=this.dpProjectionFunction(f,e)[1],l=this.dpProjectionFunction(a,g)[0],m=this.dpProjectionFunction(b,g)[0],c=d.equirectangular(f,c),e=d.equirectangular(f,e),h=(c[1]-e[1])/(h-k),a=d.equirectangular(a,g),b=d.equirectangular(b,g),l=(a[0]-b[0])/(l-m);this.minMapX=Infinity;this.maxMapX=
|
227 |
+
-Infinity;this.minMapY=Infinity;this.maxMapY=-Infinity;for(m=0;m<this.svgAreas.length;m++)this.normalize(this.svgAreas[m]);this.sourceMapHeight=Math.abs(this.maxMapY-this.minMapY);this.sourceMapWidth=Math.abs(this.maxMapX-this.minMapX);this.unscaledMapWidth=this.sourceMapWidth*l;this.unscaledMapHeight=this.sourceMapHeight*h;this.diffY=this.diffX=0},fixMapPosition:function(){var a=d.degreesToRadians(this.dataProvider.leftLongitude),b=d.degreesToRadians(this.dataProvider.rightLongitude),c=d.degreesToRadians(this.dataProvider.topLatitude),
|
228 |
+
e=d.degreesToRadians(this.dataProvider.bottomLatitude),f=a+(b-a)/2,g=c+(e-c)/2,h=this.dpProjectionFunction(f,c)[1],k=this.dpProjectionFunction(f,e)[1],l=this.dpProjectionFunction(a,g)[0],m=this.dpProjectionFunction(b,g)[0];this.sourceMapHeight=this.mapHeight/this.mapScale;this.sourceMapWidth=this.mapWidth/this.mapScale;this.unscaledMapWidth=(a-b)/(l-m)*this.sourceMapWidth;this.unscaledMapHeight=(c-e)/(h-k)*this.sourceMapHeight;b=this.coordinatesToXY(d.radiansToDegrees(f),d.radiansToDegrees(c));a=
|
229 |
+
this.coordinatesToXY(d.radiansToDegrees(a),d.radiansToDegrees(g));c=g=Infinity;for(e=0;e<this.svgAreas.length;e++)f=this.svgAreas[e].getBBox(),f.y<g&&(g=f.y),f.x<c&&(c=f.x);this.diffY=b.y/this.mapScale-g;this.diffX=a.x/this.mapScale-c;for(e=0;e<this.svgAreas.length;e++)this.svgAreas[e].translate(this.diffX,this.diffY)},changeProjection:function(){this.minMapXX=Infinity;this.maxMapXX=-Infinity;this.minMapYY=Infinity;this.maxMapYY=-Infinity;this.projectionChanged=!1;for(var a=0;a<this.svgAreas.length;a++)this.redraw(this.svgAreas[a]);
|
230 |
+
this.projectionChanged=!0;this.resizeMap()},coordinatesToXY:function(a,b){var c,e;c=!1;this.dataProvider&&(c=this.dataProvider.wrappedLongitudes);this.projectionFunction&&!c?(e=this.projectionFunction(d.degreesToRadians(a),d.degreesToRadians(b)),c=this.mapScale*d.roundTo(this.x2c(d.radiansToDegrees(e[0])),3),e=this.mapScale*d.roundTo(this.y2c(d.radiansToDegrees(e[1])),3)):(c=this.longitudeToCoordinate(a),e=this.latitudeToCoordinate(b));return{x:c,y:e}},coordinatesToStageXY:function(a,b){var c=this.coordinatesToXY(a,
|
231 |
+
b),d=c.x*this.zoomLevel()+this.mapContainer.x,c=c.y*this.zoomLevel()+this.mapContainer.y;return{x:d,y:c}},stageXYToCoordinates:function(a,b){var c=this.mapSet.getBBox(),d=(a-this.mapContainer.x)/this.zoomLevel()-c.x*this.mapScale,c=(b-this.mapContainer.y)/this.zoomLevel()-c.y*this.mapScale;return this.xyToCoordinates(d,c)},xyToCoordinates:function(a,b,c,e,f){var g;isNaN(e)&&(e=this.mapWidth);isNaN(f)&&(f=this.mapHeight);c||(c=this.projectionFunction);if(g=c.invert){var h=this.dataProvider.leftLongitude,
|
232 |
+
k=this.dataProvider.rightLongitude,l=this.dataProvider.topLatitude,m=this.dataProvider.bottomLatitude,n=h+(k-h)/2,q=l+(m-l)/2,l=d.radiansToDegrees(c(d.degreesToRadians(n),d.degreesToRadians(l))[1]),m=d.radiansToDegrees(c(d.degreesToRadians(n),d.degreesToRadians(m))[1]),h=d.radiansToDegrees(c(d.degreesToRadians(h),d.degreesToRadians(q))[0]),k=d.radiansToDegrees(c(d.degreesToRadians(k),d.degreesToRadians(q))[0]);this.projectionChanged&&(l=d.radiansToDegrees(c(d.degreesToRadians(this.topLongLat.longitude),
|
233 |
+
d.degreesToRadians(this.topLongLat.latitude))[1]),m=d.radiansToDegrees(c(d.degreesToRadians(this.bottomLongLat.longitude),d.degreesToRadians(this.bottomLongLat.latitude))[1]),h=d.radiansToDegrees(c(d.degreesToRadians(this.leftLongLat.longitude),d.degreesToRadians(this.leftLongLat.latitude))[0]),k=d.radiansToDegrees(c(d.degreesToRadians(this.rightLongLat.longitude),d.degreesToRadians(this.rightLongLat.latitude))[0]));a=d.degreesToRadians(a/e*(k-h)+h);b=d.degreesToRadians(b/f*(m-l)+l);b=g(a,b);g=d.radiansToDegrees(b[0]);
|
234 |
+
b=d.radiansToDegrees(b[1])}else g=this.coordinateToLongitude(a),b=this.coordinateToLatitude(b);return{longitude:d.roundTo(g,4),latitude:d.roundTo(b,4)}},coordinateToLatitude:function(a,b){var c;void 0===b&&(b=this.mapHeight);if(this.mapSet){var e=this.dataProvider,f=e.bottomLatitude;c=e.topLatitude;"mercator"==e.projection?(e=this.mercatorLatitudeToCoordinate(f),c=this.mercatorLatitudeToCoordinate(c),c=2*d.degreesToRadians(a*(e-c)/b+c),c=d.radiansToDegrees(2*Math.atan(Math.exp(c))-.5*Math.PI)):c=
|
235 |
+
a/b*(f-c)+c}return Math.round(1E6*c)/1E6},coordinateToLongitude:function(a,b){var c,d=this.dataProvider;void 0===b&&(b=this.mapWidth);this.mapSet&&(c=a/b*(d.rightLongitude-d.leftLongitude)+d.leftLongitude);return Math.round(1E6*c)/1E6}})})();(function(){var d=window.AmCharts;d.ZoomControl=d.Class({construct:function(a){this.cname="ZoomControl";this.panStepSize=.1;this.zoomFactor=2;this.maxZoomLevel=64;this.minZoomLevel=1;this.panControlEnabled=!1;this.zoomControlEnabled=!0;this.buttonRollOverColor="#DADADA";this.buttonFillColor="#FFFFFF";this.buttonFillAlpha=1;this.buttonBorderColor="#000000";this.buttonBorderAlpha=.1;this.buttonIconAlpha=this.buttonBorderThickness=1;this.gridColor=this.buttonIconColor="#000000";this.homeIconFile="homeIcon.gif";
|
236 |
this.gridBackgroundColor="#000000";this.draggerAlpha=this.gridAlpha=this.gridBackgroundAlpha=0;this.draggerSize=this.buttonSize=31;this.iconSize=11;this.homeButtonEnabled=!0;this.buttonCornerRadius=2;this.gridHeight=5;this.roundButtons=!0;this.top=this.left=10;d.applyTheme(this,a,this.cname)},init:function(a,b){var c=this;c.chart=a;d.remove(c.set);var e=b.set();d.setCN(a,e,"zoom-control");var f=c.buttonSize,g=c.zoomControlEnabled,h=c.panControlEnabled,k=c.buttonFillColor,l=c.buttonFillAlpha,m=c.buttonBorderThickness,
|
237 |
+
n=c.buttonBorderColor,q=c.buttonBorderAlpha,r=c.buttonCornerRadius,t=c.buttonRollOverColor,p=c.gridHeight,y=c.zoomFactor,B=c.minZoomLevel,u=c.maxZoomLevel,w=c.buttonIconAlpha,v=c.buttonIconColor,A=c.roundButtons,C=a.svgIcons,x=a.getX(c.left),z=a.getY(c.top);isNaN(c.right)||(x=a.getX(c.right,!0),x=h?x-3*f:x-f);isNaN(c.bottom)||(z=a.getY(c.bottom,!0),g&&(z-=p+3*f),z=h?z-3*f:c.homeButtonEnabled?z-.5*f:z+f);e.translate(x,z);c.previousDY=NaN;var F,x=f/4-1;if(g){F=b.set();d.setCN(a,F,"zoom-control-zoom");
|
238 |
+
e.push(F);c.set=e;c.zoomSet=F;5<p&&(g=d.rect(b,f+6,p+2*f+6,c.gridBackgroundColor,c.gridBackgroundAlpha,0,"#000000",0,4),d.setCN(a,g,"zoom-bg"),g.translate(-3,-3),g.mouseup(function(){c.handleBgUp()}).touchend(function(){c.handleBgUp()}),F.push(g));var E=f;A&&(E=f/1.5);c.draggerSize=E;var H=Math.log(u/B)/Math.log(y)+1;1E3<H&&(H=1E3);var g=p/H,G,D=b.set();D.translate((f-E)/2+1,1,NaN,!0);F.push(D);for(G=1;G<H;G++)z=f+G*g,z=d.line(b,[1,E-2],[z,z],c.gridColor,c.gridAlpha,1),d.setCN(a,z,"zoom-grid"),D.push(z);
|
239 |
+
z=new d.SimpleButton;z.setDownHandler(c.draggerDown,c);z.setClickHandler(c.draggerUp,c);z.init(b,E,g,k,l,m,n,q,r,t);d.setCN(a,z.set,"zoom-dragger");F.push(z.set);z.set.setAttr("opacity",c.draggerAlpha);c.dragger=z.set;c.previousY=NaN;z=new d.SimpleButton;C?(E=b.set(),H=d.line(b,[-x,x],[0,0],v,w,1),G=d.line(b,[0,0],[-x,x],v,w,1),E.push(H),E.push(G),z.svgIcon=E):z.setIcon(a.pathToImages+"plus.gif",c.iconSize);z.setClickHandler(a.zoomIn,a);z.init(b,f,f,k,l,m,n,q,r,t,w,v,A);d.setCN(a,z.set,"zoom-in");
|
240 |
+
F.push(z.set);z=new d.SimpleButton;C?z.svgIcon=d.line(b,[-x,x],[0,0],v,w,1):z.setIcon(a.pathToImages+"minus.gif",c.iconSize);z.setClickHandler(a.zoomOut,a);z.init(b,f,f,k,l,m,n,q,r,t,w,v,A);z.set.translate(0,p+f);d.setCN(a,z.set,"zoom-out");F.push(z.set);p-=g;u=Math.log(u/100)/Math.log(y);c.realStepSize=p/(u-Math.log(B/100)/Math.log(y));c.realGridHeight=p;c.stepMax=u}h&&(h=b.set(),d.setCN(a,h,"zoom-control-pan"),e.push(h),F&&F.translate(f,4*f),y=new d.SimpleButton,C?y.svgIcon=d.line(b,[x/5,-x+x/5,
|
241 |
+
x/5],[-x,0,x],v,w,1):y.setIcon(a.pathToImages+"panLeft.gif",c.iconSize),y.setClickHandler(a.moveLeft,a),y.init(b,f,f,k,l,m,n,q,r,t,w,v,A),y.set.translate(0,f),d.setCN(a,y.set,"pan-left"),h.push(y.set),y=new d.SimpleButton,C?y.svgIcon=d.line(b,[-x/5,x-x/5,-x/5],[-x,0,x],v,w,1):y.setIcon(a.pathToImages+"panRight.gif",c.iconSize),y.setClickHandler(a.moveRight,a),y.init(b,f,f,k,l,m,n,q,r,t,w,v,A),y.set.translate(2*f,f),d.setCN(a,y.set,"pan-right"),h.push(y.set),y=new d.SimpleButton,C?y.svgIcon=d.line(b,
|
242 |
+
[-x,0,x],[x/5,-x+x/5,x/5],v,w,1):y.setIcon(a.pathToImages+"panUp.gif",c.iconSize),y.setClickHandler(a.moveUp,a),y.init(b,f,f,k,l,m,n,q,r,t,w,v,A),y.set.translate(f,0),d.setCN(a,y.set,"pan-up"),h.push(y.set),y=new d.SimpleButton,C?y.svgIcon=d.line(b,[-x,0,x],[-x/5,x-x/5,-x/5],v,w,1):y.setIcon(a.pathToImages+"panDown.gif",c.iconSize),y.setClickHandler(a.moveDown,a),y.init(b,f,f,k,l,m,n,q,r,t,w,v,A),y.set.translate(f,2*f),d.setCN(a,y.set,"pan-down"),h.push(y.set),e.push(h));c.homeButtonEnabled&&(h=new d.SimpleButton,
|
243 |
+
C?h.svgIcon=d.polygon(b,[-x,0,x,x-1,x-1,2,2,-2,-2,-x+1,-x+1],[0,-x,0,0,x-1,x-1,2,2,x-1,x-1,0],v,w,1,v,w):h.setIcon(a.pathToImages+c.homeIconFile,c.iconSize),h.setClickHandler(a.goHome,a),c.panControlEnabled&&(q=l=0),h.init(b,f,f,k,l,m,n,q,r,t,w,v,A),c.panControlEnabled?h.set.translate(f,f):F&&F.translate(0,1.5*f),d.setCN(a,h.set,"pan-home"),e.push(h.set));c.update()},draggerDown:function(){this.chart.stopDrag();this.isDragging=!0},draggerUp:function(){this.isDragging=!1},handleBgUp:function(){var a=
|
244 |
this.chart;a.zoomTo(100*Math.pow(this.zoomFactor,this.stepMax-(a.mouseY-this.zoomSet.y-this.set.y-this.buttonSize-this.realStepSize/2)/this.realStepSize))},update:function(){var a;a=this.zoomFactor;var b=this.realStepSize,c=this.stepMax,e=this.dragger,f=this.buttonSize,g,h=this.chart;h&&(this.isDragging?(h.stopDrag(),g=e.y+(h.mouseY-this.previousY),g=d.fitToBounds(g,f,this.realGridHeight+f),h.zoomTo(100*Math.pow(a,c-(g-f)/b),NaN,NaN,!0)):(a=Math.log(h.zoomLevel()/100)/Math.log(a),g=(c-a)*b+f),this.previousY=
|
245 |
+
h.mouseY,this.previousDY!=g&&e&&(e.translate((this.buttonSize-this.draggerSize)/2,g),this.previousDY=g))}})})();(function(){var d=window.AmCharts;d.SimpleButton=d.Class({construct:function(){},init:function(a,b,c,e,f,g,h,k,l,m,n,q,r){var t=this;t.rollOverColor=m;t.color=e;t.container=a;m=a.set();t.set=m;r?(b/=2,e=d.circle(a,b,e,f,g,h,k),e.translate(b,b)):e=d.rect(a,b,c,e,f,g,h,k,l);m.push(e);f=t.iconPath;var p;f&&(p=t.iconSize,g=(b-p)/2,r&&(g=(2*b-p)/2),p=a.image(f,g,(c-p)/2,p,p));t.svgIcon&&(p=t.svgIcon,r?p.translate(b,b):p.translate(b/2,b/2));m.setAttr("cursor","pointer");p&&(m.push(p),p.setAttr("opacity",
|
246 |
+
n),p.node.style.pointerEvents="none");e.mousedown(function(){t.handleDown()}).touchstart(function(){t.handleDown()}).mouseup(function(){t.handleUp()}).touchend(function(){t.handleUp()}).mouseover(function(){t.handleOver()}).mouseout(function(){t.handleOut()});t.bg=e},setIcon:function(a,b){this.iconPath=a;this.iconSize=b},setClickHandler:function(a,b){this.clickHandler=a;this.scope=b},setDownHandler:function(a,b){this.downHandler=a;this.scope=b},handleUp:function(){var a=this.clickHandler;a&&a.call(this.scope)},
|
247 |
handleDown:function(){var a=this.downHandler;a&&a.call(this.scope)},handleOver:function(){this.container.chart.skipClick=!0;this.bg.setAttr("fill",this.rollOverColor)},handleOut:function(){this.container.chart.skipClick=!1;this.bg.setAttr("fill",this.color)}})})();(function(){var d=window.AmCharts;d.SmallMap=d.Class({construct:function(a){this.cname="SmallMap";this.mapColor="#e6e6e6";this.rectangleColor="#FFFFFF";this.top=this.right=10;this.minimizeButtonWidth=23;this.backgroundColor="#9A9A9A";this.backgroundAlpha=1;this.borderColor="#FFFFFF";this.iconColor="#000000";this.borderThickness=3;this.borderAlpha=1;this.size=.2;this.enabled=!0;d.applyTheme(this,a,this.cname)},init:function(a,b){var c=this;if(c.enabled){c.chart=a;c.container=b;c.width=a.realWidth*
|
248 |
c.size;c.height=a.realHeight*c.size;d.remove(c.mapSet);d.remove(c.allSet);d.remove(c.set);var e=b.set();c.set=e;d.setCN(a,e,"small-map");var f=b.set();c.allSet=f;e.push(f);c.buildSVGMap();var g=c.borderThickness,h=c.borderColor,k=d.rect(b,c.width+g,c.height+g,c.backgroundColor,c.backgroundAlpha,g,h,c.borderAlpha);d.setCN(a,k,"small-map-bg");k.translate(-g/2,-g/2);f.push(k);k.toBack();var l,m,k=c.minimizeButtonWidth,n=new d.SimpleButton,q=k/2;a.svgIcons?n.svgIcon=d.line(b,[-q/2,0,q/2],[-q/4,q/4,-q/
|
249 |
+
4],c.iconColor,1,1):n.setIcon(a.pathToImages+"arrowDown.gif",k);n.setClickHandler(c.minimize,c);n.init(b,k,k,h,1,1,h,1);d.setCN(a,n.set,"small-map-down");n=n.set;c.downButtonSet=n;e.push(n);var r=new d.SimpleButton;a.svgIcons?r.svgIcon=d.line(b,[-q/2,0,q/2],[q/4,-q/4,q/4],c.iconColor,1,1):r.setIcon(a.pathToImages+"arrowUp.gif",k);r.setClickHandler(c.maximize,c);r.init(b,k,k,h,1,1,h,1);d.setCN(a,r.set,"small-map-up");h=r.set;c.upButtonSet=h;h.hide();e.push(h);var t,p;isNaN(c.top)||(l=a.getY(c.top)+
|
250 |
+
g,p=0);isNaN(c.bottom)||(l=a.getY(c.bottom,!0)-c.height-g,p=c.height-k+g/2);isNaN(c.left)||(m=a.getX(c.left)+g,t=-g/2);isNaN(c.right)||(m=a.getX(c.right,!0)-c.width-g,t=c.width-k+g/2);g=b.set();g.clipRect(1,1,c.width,c.height);f.push(g);c.rectangleC=g;e.translate(m,l);n.translate(t,p);h.translate(t,p);f.mouseup(function(){c.handleMouseUp()});c.drawRectangle()}else d.remove(c.allSet),d.remove(c.downButtonSet),d.remove(c.upButtonSet)},minimize:function(){this.downButtonSet.hide();this.upButtonSet.show();
|
251 |
this.allSet.hide()},maximize:function(){this.downButtonSet.show();this.upButtonSet.hide();this.allSet.show()},buildSVGMap:function(){var a=this.chart,b={fill:this.mapColor,stroke:this.mapColor,"stroke-opacity":1},c=this.container,e=c.set();d.setCN(a,e,"small-map-image");var f;for(f=0;f<a.svgAreas.length;f++){var g=c.path(a.svgAreas[f].path).attr(b);e.push(g)}this.allSet.push(e);b=e.getBBox();c=this.size*a.mapScale;f=-b.x*c;var g=-b.y*c,h=0,k=0;a.centerMap&&(h=(this.width-b.width*c)/2,k=(this.height-
|
252 |
b.height*c)/2);this.mapWidth=b.width*c;this.mapHeight=b.height*c;f+=h;g+=k;this.dx=h;this.dy=k;e.translate(f,g,c);this.mapSet=e;this.mapX=f;this.mapY=g},update:function(){var a=this.chart;if(a){var b=a.zoomLevel(),c=this.width,d=this.height,f=c/(a.realWidth*b),g=a.mapContainer.getBBox(),c=c/b,d=d/b,h=this.rectangle;h.translate(-(a.mapContainer.x+g.x*b)*f+this.dx,-(a.mapContainer.y+g.y*b)*f+this.dy);0<c&&0<d&&(h.setAttr("width",Math.ceil(c+1)),h.setAttr("height",Math.ceil(d+1)));this.rWidth=c;this.rHeight=
|
253 |
d}},drawRectangle:function(){var a=this.rectangle;d.remove(a);a=d.rect(this.container,10,10,"#000",0,1,this.rectangleColor,1);d.setCN(this.chart,a,"small-map-rectangle");this.rectangleC.push(a);this.rectangle=a},handleMouseUp:function(){var a=this.chart,b=a.zoomLevel();a.zoomToMapXY(b,(a.mouseX-this.set.x-this.mapX)/this.size+a.diffX*a.mapScale,(a.mouseY-this.set.y-this.mapY)/this.size+a.diffY*a.mapScale)}})})();(function(){var d=window.AmCharts;d.AreasProcessor=d.Class({construct:function(a){this.chart=a},process:function(a){this.updateAllAreas();this.allObjects=[];a=a.areas;var b=this.chart;b.outlines=[];var c=a.length,d,f,g=0,h=!1,k=!1,l=0;for(d=0;d<c;d++)if(f=a[d],f=f.value,!isNaN(f)){if(!1===h||h<f)h=f;if(!1===k||k>f)k=f;g+=Math.abs(f);l++}this.minValue=k;this.maxValue=h;isNaN(b.minValue)||(this.minValue=b.minValue);isNaN(b.maxValue)||(this.maxValue=b.maxValue);b.maxValueReal=h;b.minValueReal=k;for(d=
|
254 |
0;d<c;d++)f=a[d],isNaN(f.value)?f.percents=void 0:(f.percents=(f.value-k)/g*100,k==h&&(f.percents=100));for(d=0;d<c;d++)f=a[d],this.createArea(f);b.outlinesToFront()},updateAllAreas:function(){var a=this.chart,b=a.areasSettings,c=b.unlistedAreasColor,e=b.unlistedAreasAlpha,f=b.unlistedAreasOutlineColor,g=b.unlistedAreasOutlineAlpha,h=a.svgAreas,k=a.dataProvider,l=k.areas,m={},n;for(n=0;n<l.length;n++)m[l[n].id]=l[n];for(n=0;n<h.length;n++){l=h[n];if(b.preserveOriginalAttributes){if(l.customAttr)for(var q in l.customAttr)l.setAttr(q,
|
255 |
+
l.customAttr[q])}else{void 0!=c&&l.setAttr("fill",c);isNaN(e)||l.setAttr("fill-opacity",e);void 0!=f&&l.setAttr("stroke",f);isNaN(g)||l.setAttr("stroke-opacity",g);var r=b.outlineThickness;b.adjustOutlineThickness&&(r=r/a.zoomLevel()/a.mapScale);l.setAttr("stroke-width",r)}d.setCN(a,l,"map-area-unlisted");k.getAreasFromMap&&!m[l.id]&&(r=new d.MapArea(a.theme),r.parentObject=k,r.id=l.id,k.areas.push(r))}},createArea:function(a){var b=this.chart,c=b.svgAreasById[a.id],e=b.areasSettings;if(c&&c.className){var f=
|
256 |
+
b.areasClasses[c.className];f&&(e=d.processObject(f,d.AreasSettings,b.theme))}var g=e.color,h=e.alpha,k=e.outlineThickness,l=e.rollOverColor,m=e.selectedColor,n=e.rollOverAlpha,q=e.rollOverBrightness,r=e.outlineColor,t=e.outlineAlpha,p=e.balloonText,y=e.selectable,B=e.pattern,u=e.rollOverOutlineColor,w=e.bringForwardOnHover,v=e.preserveOriginalAttributes;this.allObjects.push(a);a.chart=b;a.baseSettings=e;a.autoZoomReal=void 0==a.autoZoom?e.autoZoom:a.autoZoom;f=a.color;void 0==f&&(f=g);var A=a.alpha;
|
257 |
+
isNaN(A)&&(A=h);h=a.rollOverAlpha;isNaN(h)&&(h=n);isNaN(h)&&(h=A);n=a.rollOverColor;void 0==n&&(n=l);l=a.pattern;void 0==l&&(l=B);B=a.selectedColor;void 0==B&&(B=m);m=a.balloonText;void 0===m&&(m=p);void 0==e.colorSolid||isNaN(a.value)||(p=Math.floor((a.value-this.minValue)/((this.maxValue-this.minValue)/b.colorSteps)),p==b.colorSteps&&p--,p*=1/(b.colorSteps-1),this.maxValue==this.minValue&&(p=1),a.colorReal=d.getColorFade(f,e.colorSolid,p));void 0!=a.color&&(a.colorReal=a.color);void 0==a.selectable&&
|
258 |
+
(a.selectable=y);void 0==a.colorReal&&(a.colorReal=g);g=a.outlineColor;void 0==g&&(g=r);r=a.outlineAlpha;isNaN(r)&&(r=t);t=a.outlineThickness;isNaN(t)&&(t=k);k=a.rollOverOutlineColor;void 0==k&&(k=u);u=a.rollOverBrightness;void 0==u&&(u=q);void 0==a.bringForwardOnHover&&(a.bringForwardOnHover=w);void 0==a.preserveOriginalAttributes&&(a.preserveOriginalAttributes=v);isNaN(e.selectedBrightness)||(B=d.adjustLuminosity(a.colorReal,e.selectedBrightness/100));a.alphaReal=A;a.rollOverColorReal=n;a.rollOverAlphaReal=
|
259 |
+
h;a.balloonTextReal=m;a.selectedColorReal=B;a.outlineColorReal=g;a.outlineAlphaReal=r;a.rollOverOutlineColorReal=k;a.outlineThicknessReal=t;a.patternReal=l;a.rollOverBrightnessReal=u;a.accessibleLabel||(a.accessibleLabel=e.accessibleLabel);d.processDescriptionWindow(e,a);if(c&&(q=c.area,w=c.title,a.enTitle=c.title,w&&!a.title&&(a.title=w),(c=b.language)?(w=d.mapTranslations)&&(c=w[c])&&c[a.enTitle]&&(a.titleTr=c[a.enTitle]):a.titleTr=void 0,q)){c=a.tabIndex;void 0===c&&(c=e.tabIndex);void 0!==c&&
|
260 |
+
q.setAttr("tabindex",c);a.displayObject=q;a.outline&&(A=0,a.alphaReal=0,a.rollOverAlphaReal=0,a.mouseEnabled=!1,b.outlines.push(q),q.node.setAttribute("pointer-events","none"));a.mouseEnabled&&b.addObjectEventListeners(q,a);var C;void 0!=f&&(C=f);void 0!=a.colorReal&&(C=a.showAsSelected||b.selectedObject==a?a.selectedColorReal:a.colorReal);q.node.setAttribute("class","");d.setCN(b,q,"map-area");d.setCN(b,q,"map-area-"+q.id);e.adjustOutlineThickness&&(t=t/b.zoomLevel()/b.mapScale);a.preserveOriginalAttributes||
|
261 |
+
(q.setAttr("fill",C),q.setAttr("stroke",g),q.setAttr("stroke-opacity",r),q.setAttr("stroke-width",t),q.setAttr("fill-opacity",A));b.makeObjectAccessible(a);l&&q.pattern(l,b.mapScale,b.path);a.hidden&&q.hide()}}})})();(function(){var d=window.AmCharts;d.AreasSettings=d.Class({construct:function(a){this.cname="AreasSettings";this.alpha=1;this.autoZoom=!1;this.balloonText="[[title]]";this.color="#FFCC00";this.colorSolid="#990000";this.unlistedAreasAlpha=1;this.unlistedAreasColor="#DDDDDD";this.outlineColor="#FFFFFF";this.outlineThickness=this.outlineAlpha=1;this.selectedColor=this.rollOverOutlineColor="#CC0000";this.unlistedAreasOutlineColor="#FFFFFF";this.unlistedAreasOutlineAlpha=1;this.descriptionWindowWidth=
|
262 |
250;this.bringForwardOnHover=this.adjustOutlineThickness=!0;this.accessibleLabel="[[title]] [[value]] [[description]]";d.applyTheme(this,a,this.cname)}})})();(function(){var d=window.AmCharts;d.ImagesProcessor=d.Class({construct:function(a){this.chart=a;this.reset()},process:function(a){var b=a.images,c;for(c=0;c<b.length;c++){var d=b[c];this.createImage(d,c);d.parentArray=b}this.counter=c;a.parentObject&&a.remainVisible&&this.process(a.parentObject)},createImage:function(a,b){a=d.processObject(a,d.MapImage);isNaN(b)&&(this.counter++,b=this.counter);var c=this.chart,e=c.container,f=c.mapImagesContainer,g=c.stageImagesContainer,h=c.imagesSettings;a.remove&&
|
263 |
+
a.remove();var k=h.color,l=h.alpha,m=h.rollOverColor,n=h.rollOverOutlineColor,q=h.selectedColor,r=h.balloonText,t=h.outlineColor,p=h.outlineAlpha,y=h.outlineThickness,B=h.selectedScale,u=h.rollOverScale,w=h.selectable,v=h.labelPosition,A=h.labelColor,C=h.labelFontSize,x=h.bringForwardOnHover,z=h.labelRollOverColor,F=h.rollOverBrightness,E=h.selectedLabelColor;a.index=b;a.chart=c;a.baseSettings=c.imagesSettings;var H=e.set();a.displayObject=H;var G=a.color;void 0==G&&(G=k);k=a.alpha;isNaN(k)&&(k=l);
|
264 |
+
void 0==a.bringForwardOnHover&&(a.bringForwardOnHover=x);l=a.outlineAlpha;isNaN(l)&&(l=p);p=a.rollOverColor;void 0==p&&(p=m);m=a.selectedColor;void 0==m&&(m=q);q=a.balloonText;void 0===q&&(q=r);r=a.outlineColor;void 0==r&&(r=t);a.outlineColorReal=r;t=a.outlineThickness;isNaN(t)&&(t=y);(y=a.labelPosition)||(y=v);v=a.labelColor;void 0==v&&(v=A);A=a.labelRollOverColor;void 0==A&&(A=z);z=a.selectedLabelColor;void 0==z&&(z=E);E=a.labelFontSize;isNaN(E)&&(E=C);C=a.selectedScale;isNaN(C)&&(C=B);B=a.rollOverScale;
|
265 |
+
isNaN(B)&&(B=u);u=a.rollOverBrightness;void 0==u&&(u=F);void 0==a.selectable&&(a.selectable=w);a.colorReal=G;isNaN(h.selectedBrightness)||(m=d.adjustLuminosity(a.colorReal,h.selectedBrightness/100));a.alphaReal=k;a.rollOverColorReal=p;a.balloonTextReal=q;a.selectedColorReal=m;a.labelColorReal=v;a.labelRollOverColorReal=A;a.selectedLabelColorReal=z;a.labelFontSizeReal=E;a.labelPositionReal=y;a.selectedScaleReal=C;a.rollOverScaleReal=B;a.rollOverOutlineColorReal=n;a.rollOverBrightnessReal=u;a.accessibleLabel||
|
266 |
+
(a.accessibleLabel=h.accessibleLabel);d.processDescriptionWindow(h,a);a.centeredReal=void 0==a.centered?h.centered:a.centered;n=a.type;u=a.imageURL;B=a.svgPath;C=a.width;E=a.height;w=a.scale;isNaN(a.percentWidth)||(C=a.percentWidth/100*c.realWidth);isNaN(a.percentHeight)||(E=a.percentHeight/100*c.realHeight);var D;u||n||B||(n="circle",C=1,l=k=0);p=F=0;h=a.selectedColorReal;if(n){isNaN(C)&&(C=10);isNaN(E)&&(E=10);"kilometers"==a.widthAndHeightUnits&&(C=c.kilometersToPixels(a.width),E=c.kilometersToPixels(a.height));
|
267 |
+
"miles"==a.widthAndHeightUnits&&(C=c.milesToPixels(a.width),E=c.milesToPixels(a.height));if("circle"==n||"bubble"==n)E=C;D=this.createPredefinedImage(G,r,t,n,C,E);p=F=0;a.centeredReal?(isNaN(a.right)||(F=C*w),isNaN(a.bottom)||(p=E*w)):(F=C*w/2,p=E*w/2);D.translate(F,p,w,!0)}else u?(isNaN(C)&&(C=10),isNaN(E)&&(E=10),D=e.image(u,0,0,C,E),D.node.setAttribute("preserveAspectRatio","none"),D.setAttr("opacity",k),a.centeredReal&&(F=isNaN(a.right)?-C/2:C/2,p=isNaN(a.bottom)?-E/2:E/2,D.translate(F,p,NaN,
|
268 |
+
!0))):B&&(D=e.path(B),u=D.getBBox(),a.centeredReal?(F=-u.x*w-u.width*w/2,isNaN(a.right)||(F=-F),p=-u.y*w-u.height*w/2,isNaN(a.bottom)||(p=-p)):F=p=0,D.translate(F,p,w,!0),D.x=F,D.y=p);D&&(H.push(D),a.image=D,D.setAttr("stroke-opacity",l),D.setAttr("stroke-width",t),D.setAttr("stroke",r),D.setAttr("fill-opacity",k),"bubble"!=n&&D.setAttr("fill",G),d.setCN(c,D,"map-image"),void 0!=a.id&&d.setCN(c,D,"map-image-"+a.id));G=a.labelColorReal;!a.showAsSelected&&c.selectedObject!=a||void 0==h||(D.setAttr("fill",
|
269 |
h),G=a.selectedLabelColorReal);D=null;void 0!==a.label&&(D=d.text(e,a.label,G,c.fontFamily,a.labelFontSizeReal,a.labelAlign),d.setCN(c,D,"map-image-label"),void 0!==a.id&&d.setCN(c,D,"map-image-label-"+a.id),G=a.labelBackgroundAlpha,(k=a.labelBackgroundColor)&&0<G&&(l=D.getBBox(),e=d.rect(e,l.width+16,l.height+10,k,G),d.setCN(c,e,"map-image-label-background"),void 0!=a.id&&d.setCN(c,e,"map-image-label-background-"+a.id),H.push(e),a.labelBG=e),a.imageLabel=D,H.push(D),d.setCN(c,H,"map-image-container"),
|
270 |
void 0!=a.id&&d.setCN(c,H,"map-image-container-"+a.id));e=isNaN(a.latitude)||isNaN(a.longitude)?!0:!1;a.lineId&&(D=this.chart.getObjectById(a.lineId))&&0<D.longitudes.length&&(e=!1);e?g.push(H):f.push(H);H&&(H.rotation=a.rotation,isNaN(a.rotation)||H.rotate(a.rotation));this.updateSizeAndPosition(a);a.mouseEnabled&&c.addObjectEventListeners(H,a);a.hidden&&H.hide();a.animateAlongLine&&setTimeout(function(){a.animateAlong.call(a)},100);return a},updateSizeAndPosition:function(a){var b=this.chart,c=
|
271 |
+
a.displayObject,e=b.getX(a.left),f=b.getY(a.top),g,h=a.image.getBBox();isNaN(a.right)||(e=b.getX(a.right,!0)-h.width*a.scale);isNaN(a.bottom)||(f=b.getY(a.bottom,!0)-h.height*a.scale);var k=a.longitude,l=a.latitude,m=a.positionOnLine,h=this.objectsToResize;this.allSvgObjects.push(c);this.allObjects.push(a);a.arrays.push({arr:this.allSvgObjects,el:c});a.arrays.push({arr:this.allObjects,el:a});var n=a.imageLabel,q=this.chart.zoomLevel(),r,t;a.lineId&&(a.line=this.chart.getObjectById(a.lineId));b.makeObjectAccessible(a);
|
272 |
+
var p=a.tabIndex;void 0===p&&(p=b.imagesSettings.tabIndex);void 0!==p&&c.setAttr("tabindex",p);a.line&&a.line.getCoordinates&&(a.line.chart=b,p=a.line.getCoordinates(m,a.lineSegment))&&(k=b.coordinateToLongitude(p.x),l=b.coordinateToLatitude(p.y),r=p.x,t=p.y,a.animateAngle&&(g=d.radiansToDegrees(p.angle)));isNaN(g)||c.rotate(g+a.extraAngle);isNaN(e)||isNaN(f)?isNaN(l)||isNaN(k)||(f=b.coordinatesToXY(k,l),e=f.x,f=f.y,isNaN(r)||(e=r),isNaN(t)||(f=t),a.fixedSize?(r=a.positionScale,isNaN(r)?r=0:(--r,
|
273 |
+
r*=1-2*Math.abs(m-.5)),m={image:c,scale:1+r,mapImage:a},h.push(m),a.arrays.push({arr:h,el:m}),c.translate(e,f,1/q+r,!0)):(c.translate(e,f,NaN,!0),n&&(this.labelsToReposition.push(a),a.arrays.push({arr:this.labelsToReposition,el:a})))):c.translate(e,f,NaN,!0);this.positionLabel(n,a,a.labelPositionReal)},positionLabel:function(a,b,c){if(a){var d=b.image,f=0,g=0,h=0,k=0;d&&(k=d.getBBox(),g=d.y+k.y,f=d.x+k.x,h=k.width,k=k.height,b.svgPath&&(h*=b.scale,k*=b.scale));var d=a.getBBox(),l=d.width,m=d.height;
|
274 |
+
"right"==c&&(f+=h+l/2+5,g+=k/2-2);"left"==c&&(f+=-l/2-5,g+=k/2-2);"top"==c&&(g-=m/2+3,f+=h/2);"bottom"==c&&(g+=k+m/2,f+=h/2);"middle"==c&&(f+=h/2,g+=k/2);a.translate(f+b.labelShiftX,g+b.labelShiftY,NaN,!0);a=b.labelFontSizeReal;b.labelBG&&b.labelBG.translate(f-d.width/2+b.labelShiftX-9,g-a/2+b.labelShiftY-4,NaN,!0)}},createPredefinedImage:function(a,b,c,e,f,g){var h=this.chart.container,k;switch(e){case "circle":k=d.circle(h,f/2,a,1,c,b,1);break;case "rectangle":k=d.polygon(h,[-f/2,f/2,f/2,-f/2],
|
275 |
+
[g/2,g/2,-g/2,-g/2],a,1,c,b,1,0,!0);break;case "bubble":k=d.circle(h,f/2,a,1,c,b,1,!0);break;case "hexagon":f/=Math.sqrt(3),k=d.polygon(h,[.866*f,0*f,-.866*f,-.866*f,0*f,.866*f],[.5*f,1*f,.5*f,-.5*f,-1*f,-.5*f],a,1,c,b,1)}return k},reset:function(){this.objectsToResize=[];this.allSvgObjects=[];this.allObjects=[];this.allLabels=[];this.labelsToReposition=[]}})})();(function(){var d=window.AmCharts;d.ImagesSettings=d.Class({construct:function(a){this.cname="ImagesSettings";this.balloonText="[[title]]";this.alpha=1;this.borderAlpha=0;this.borderThickness=1;this.labelPosition="right";this.labelColor="#000000";this.labelFontSize=11;this.color="#000000";this.labelRollOverColor="#00CC00";this.centered=!0;this.rollOverScale=this.selectedScale=1;this.descriptionWindowWidth=250;this.bringForwardOnHover=!0;this.outlineColor="transparent";this.adjustAnimationSpeed=!1;
|
276 |
this.baseAnimationDistance=500;this.pauseDuration=0;this.easingFunction=d.easeInOutQuad;this.animationDuration=3;this.positionScale=1;this.accessibleLabel="[[title]] [[description]]";d.applyTheme(this,a,this.cname)}})})();(function(){var d=window.AmCharts;d.LinesProcessor=d.Class({construct:function(a){this.chart=a;this.reset()},process:function(a){var b=a.lines,c;for(c=0;c<b.length;c++){var d=b[c];this.createLine(d,c);d.parentArray=b}this.counter=c;a.parentObject&&a.remainVisible&&this.process(a.parentObject)},createLine:function(a,b){a=d.processObject(a,d.MapLine);isNaN(b)&&(this.counter++,b=this.counter);a.index=b;a.remove&&a.remove();var c=this.chart,e=c.linesSettings,f=this.objectsToResize,g=c.mapLinesContainer,
|
277 |
+
h=c.stageLinesContainer,k=e.thickness,l=e.dashLength,m=e.arrow,n=e.arrowSize,q=e.arrowColor,r=e.arrowAlpha,t=e.color,p=e.alpha,y=e.rollOverColor,B=e.selectedColor,u=e.rollOverAlpha,w=e.balloonText,v=e.bringForwardOnHover,A=e.arc,C=e.rollOverBrightness,x=c.container;a.chart=c;a.baseSettings=e;var z=x.set();a.displayObject=z;var F=a.tabIndex;void 0===F&&(F=e.tabIndex);void 0!==F&&z.setAttr("tabindex",F);this.allSvgObjects.push(z);a.arrays.push({arr:this.allSvgObjects,el:z});this.allObjects.push(a);
|
278 |
+
a.arrays.push({arr:this.allObjects,el:a});a.mouseEnabled&&c.addObjectEventListeners(z,a);if(a.remainVisible||c.selectedObject==a.parentObject){F=a.thickness;isNaN(F)&&(F=k);k=a.dashLength;isNaN(k)&&(k=l);l=a.color;void 0==l&&(l=t);t=a.alpha;isNaN(t)&&(t=p);p=a.rollOverAlpha;isNaN(p)&&(p=u);isNaN(p)&&(p=t);u=a.rollOverColor;void 0==u&&(u=y);y=a.selectedColor;void 0==y&&(y=B);B=a.balloonText;void 0===B&&(B=w);w=a.arc;isNaN(w)&&(w=A);A=a.arrow;if(!A||"none"==A&&"none"!=m)A=m;m=a.arrowColor;void 0==m&&
|
279 |
+
(m=q);void 0==m&&(m=l);q=a.arrowAlpha;isNaN(q)&&(q=r);isNaN(q)&&(q=t);r=a.arrowSize;isNaN(r)&&(r=n);n=a.rollOverBrightness;void 0==n&&(n=C);a.colorReal=l;a.arrowColor=m;isNaN(e.selectedBrightness)||(y=d.adjustLuminosity(a.colorReal,e.selectedBrightness/100));a.alphaReal=t;a.rollOverColorReal=u;a.rollOverAlphaReal=p;a.balloonTextReal=B;a.selectedColorReal=y;a.thicknessReal=F;a.rollOverBrightnessReal=n;a.accessibleLabel||(a.accessibleLabel=e.accessibleLabel);void 0===a.shiftArrow&&(a.shiftArrow=e.shiftArrow);
|
280 |
+
void 0==a.bringForwardOnHover&&(a.bringForwardOnHover=v);d.processDescriptionWindow(e,a);v=this.processCoordinates(a.x,c.realWidth);C=this.processCoordinates(a.y,c.realHeight);n=a.longitudes;e=a.latitudes;p=n.length;if(0<p)for(v=[],C=[],u=0;u<p;u++)B=c.coordinatesToXY(n[u],e[u]),v.push(B.x),C.push(B.y);if(0<v.length){a.segments=v.length;d.dx=0;d.dy=0;var E,H,G,p=10*(1-Math.abs(w));10<=p&&(p=NaN);1>p&&(p=1);a.arcRadius=[];a.distances=[];n=c.mapContainer.scale;if(isNaN(p)){for(p=0;p<v.length-1;p++)H=
|
281 |
+
Math.sqrt(Math.pow(v[p+1]-v[p],2)+Math.pow(C[p+1]-C[p],2)),a.distances[p]=H;p=d.line(x,v,C,l,1,F/n,k,!1,!1,!0);l=d.line(x,v,C,l,.001,5/n,k,!1,!1,!0);p.setAttr("stroke-linecap","round")}else{u=1;0>w&&(u=0);B={fill:"none",stroke:l,"stroke-opacity":1,"stroke-width":F/n,"fill-opacity":0,"stroke-linecap":"round"};void 0!==k&&0<k&&(B["stroke-dasharray"]=k);for(var k="",D=0;D<v.length-1;D++){var K=v[D],J=v[D+1],L=C[D],O=C[D+1];H=Math.sqrt(Math.pow(J-K,2)+Math.pow(O-L,2));G=H/2*p;E=270+180*Math.acos(H/2/
|
282 |
+
G)/Math.PI;isNaN(E)&&(E=270);if(K<J){var P=K,K=J,J=P,P=L,L=O,O=P;E=-E}0<w&&(E=-E);k+="M"+K+","+L+"A"+G+","+G+",0,0,"+u+","+J+","+O;a.arcRadius[D]=G;a.distances[D]=H}p=x.path(k).attr(B);l=x.path(k).attr({"fill-opacity":0,stroke:l,"stroke-width":5/n,"stroke-opacity":.001,fill:"none"})}d.setCN(c,p,"map-line");void 0!=a.id&&d.setCN(c,p,"map-line-"+a.id);d.dx=.5;d.dy=.5;z.push(p);z.push(l);p.setAttr("opacity",t);if("none"!=A){var I,M,N;if("end"==A||"both"==A)u=v[v.length-1],D=C[C.length-1],1<v.length?
|
283 |
+
(B=v[v.length-2],I=C[C.length-2]):(B=u,I=D),I=180*Math.atan((D-I)/(u-B))/Math.PI,isNaN(E)||(I+=E),M=u,N=D,I=0>u-B?I-90:I+90;t=[-r/2-.5,-.5,r/2-.5];k=[r,-.5,r];a.shiftArrow&&"middle"!=A&&(k=[0,1.2*-r,0]);"both"==A&&(r=d.polygon(x,t,k,m,q,1,m,q,void 0,!0),z.push(r),r.translate(M,N,1/n,!0),isNaN(I)||r.rotate(I),d.setCN(c,p,"map-line-arrow"),void 0!=a.id&&d.setCN(c,p,"map-line-arrow-"+a.id),a.fixedSize&&f.push(r));if("start"==A||"both"==A)r=v[0],N=C[0],1<v.length?(u=v[1],M=C[1]):(u=r,M=N),I=180*Math.atan((N-
|
284 |
+
M)/(r-u))/Math.PI,isNaN(E)||(I-=E),M=r,I=0>r-u?I-90:I+90;"middle"==A&&(u=v[v.length-1],D=C[C.length-1],1<v.length?(B=v[v.length-2],I=C[C.length-2]):(B=u,I=D),M=B+(u-B)/2,N=I+(D-I)/2,I=180*Math.atan((D-I)/(u-B))/Math.PI,isNaN(E)||(E=H/2,G-=Math.sqrt(G*G-E*E),0>w&&(G=-G),E=Math.sin(I/180*Math.PI),-1==E&&(E=1),M-=E*G,N+=Math.cos(I/180*Math.PI)*G),I=0>u-B?I-90:I+90);r=d.polygon(x,t,k,m,q,1,m,q,void 0,!0);d.setCN(c,p,"map-line-arrow");void 0!=a.id&&d.setCN(c,p,"map-line-arrow-"+a.id);z.push(r);r.translate(M,
|
285 |
+
N,1/n,!0);isNaN(I)||r.rotate(I);a.fixedSize&&(f.push(r),a.arrays.push({arr:f,el:r}));a.arrowSvg=r}a.fixedSize&&p&&(f={line:p,thickness:F},this.linesToResize.push(f),a.arrays.push({arr:this.linesToResize,el:f}),f={line:l,thickness:5},this.linesToResize.push(f),a.arrays.push({arr:this.linesToResize,el:f}));a.lineSvg=p;a.showAsSelected&&!isNaN(y)&&p.setAttr("stroke",y);0<e.length?g.push(z):h.push(z);a.hidden&&z.hide();c.makeObjectAccessible(a)}}},processCoordinates:function(a,b){var c=[],d;for(d=0;d<
|
286 |
a.length;d++){var f=a[d],g=Number(f);isNaN(g)&&(g=Number(f.replace("%",""))*b/100);isNaN(g)||c.push(g)}return c},reset:function(){this.objectsToResize=[];this.allSvgObjects=[];this.allObjects=[];this.linesToResize=[]}})})();(function(){var d=window.AmCharts;d.LinesSettings=d.Class({construct:function(a){this.cname="LinesSettings";this.balloonText="[[title]]";this.thickness=1;this.dashLength=0;this.arrowSize=10;this.arrowAlpha=1;this.arrow="none";this.color="#990000";this.descriptionWindowWidth=250;this.bringForwardOnHover=!0;d.applyTheme(this,a,this.cname)}})})();(function(){var d=window.AmCharts;d.MapObject=d.Class({construct:function(a){this.fixedSize=this.mouseEnabled=!0;this.images=[];this.lines=[];this.areas=[];this.remainVisible=!0;this.passZoomValuesToTarget=!1;this.objectType=this.cname;d.applyTheme(this,a,"MapObject");this.arrays=[]},deleteObject:function(){this.remove();this.parentArray&&d.removeFromArray(this.parentArray,this);if(this.arrays)for(var a=0;a<this.arrays.length;a++)d.removeFromArray(this.arrays[a].arr,this.arrays[a].el);this.arrays=
|
287 |
[]}})})();(function(){var d=window.AmCharts;d.MapArea=d.Class({inherits:d.MapObject,construct:function(a){this.cname="MapArea";d.MapArea.base.construct.call(this,a);d.applyTheme(this,a,this.cname)},validate:function(){this.chart.areasProcessor.createArea(this)}})})();(function(){var d=window.AmCharts;d.MapLine=d.Class({inherits:d.MapObject,construct:function(a){this.cname="MapLine";this.longitudes=[];this.latitudes=[];this.x=[];this.y=[];this.segments=0;this.arrow="none";d.MapLine.base.construct.call(this,a);d.applyTheme(this,a,this.cname)},validate:function(){this.chart.linesProcessor.createLine(this)},remove:function(){var a=this.displayObject;a&&a.remove()},getCoordinates:function(a,b){isNaN(b)&&(b=0);if(!isNaN(a)){var c,e,f,g,h,k;if(1<this.longitudes.length){e=
|
288 |
this.chart.coordinatesToXY(this.longitudes[b],this.latitudes[b]);var l=this.chart.coordinatesToXY(this.longitudes[b+1],this.latitudes[b+1]);c=e.x;f=l.x;e=e.y;g=l.y}else 1<this.x.length&&(c=this.x[b],f=this.x[b+1],e=this.y[b],g=this.y[b+1]);l=Math.sqrt(Math.pow(f-c,2)+Math.pow(g-e,2));c<f&&!isNaN(this.arc)&&0!==this.arc&&(a=1-a);h=c+(f-c)*a;k=e+(g-e)*a;var m=Math.atan2(g-e,f-c);if(!isNaN(this.arc)&&0!==this.arc&&this.arcRadius){var n=0;c<f&&(n=c,c=f,f=n,n=e,e=g,g=n,n=Math.PI);k=this.arcRadius[b];0>
|
296 |
(a.direction=1,a.extraAngle=0,a.delayAnimateAlong()):a.loop&&a.delayAnimateAlong()))},delayAnimateAlong:function(){var a=this;a.clearTO();a.animateAlongLine&&(a.timeOut=setTimeout(function(){a.animateAlong.call(a)},1E3*a.chart.imagesSettings.pauseDuration))},fixToStage:function(){if(!isNaN(this.longitude)){var a=this.chart.coordinatesToStageXY(this.longitude,this.latitude);this.left=a.x;this.top=a.y;this.latitude=this.longitude=void 0}this.validate()},fixToMap:function(){if(!isNaN(this.left)){var a=
|
297 |
this.chart.stageXYToCoordinates(this.left,this.top);this.longitude=a.longitude;this.latitude=a.latitude;this.top=this.left=void 0}this.validate()}})})();(function(){var d=window.AmCharts;d.degreesToRadians=function(a){return a/180*Math.PI};d.radiansToDegrees=function(a){return a/Math.PI*180};d.getColorFade=function(a,b,c){var e=d.hex2RGB(b);b=e[0];var f=e[1],e=e[2],g=d.hex2RGB(a);a=g[0];var h=g[1],g=g[2];a+=Math.round((b-a)*c);h+=Math.round((f-h)*c);g+=Math.round((e-g)*c);return"rgb("+a+","+h+","+g+")"};d.hex2RGB=function(a){return[parseInt(a.substring(1,3),16),parseInt(a.substring(3,5),16),parseInt(a.substring(5,7),16)]};d.processDescriptionWindow=
|
298 |
function(a,b){isNaN(b.descriptionWindowX)&&(b.descriptionWindowX=a.descriptionWindowX);isNaN(b.descriptionWindowY)&&(b.descriptionWindowY=a.descriptionWindowY);isNaN(b.descriptionWindowLeft)&&(b.descriptionWindowLeft=a.descriptionWindowLeft);isNaN(b.descriptionWindowRight)&&(b.descriptionWindowRight=a.descriptionWindowRight);isNaN(b.descriptionWindowTop)&&(b.descriptionWindowTop=a.descriptionWindowTop);isNaN(b.descriptionWindowBottom)&&(b.descriptionWindowBottom=a.descriptionWindowBottom);isNaN(b.descriptionWindowWidth)&&
|
299 |
+
(b.descriptionWindowWidth=a.descriptionWindowWidth);isNaN(b.descriptionWindowHeight)&&(b.descriptionWindowHeight=a.descriptionWindowHeight)};d.normalizePath=function(a){for(var b="",c=d.parsePath(a.getAttribute("d")),e,f,g=Infinity,h=-Infinity,k=Infinity,l=-Infinity,m=0;m<c.length;m++){var n=c[m],q=n.letter,r=n.x,n=n.y;"h"==q&&(q="L",r+=e,n=f);"H"==q&&(q="L",n=f);"v"==q&&(q="L",r=e,n+=f);"V"==q&&(q="L",r=e);if("m"===q||"l"===q)q=q.toUpperCase(),r+=e,n+=f;r=d.roundTo(r,3);n=d.roundTo(n,3);e=r;f=n;
|
300 |
+
r>h&&(h=r);r<g&&(g=r);n>l&&(l=n);n<k&&(k=n);b="z"==q.toLowerCase()?b+"Z ":b+(q+" "+r+" "+n+" ")}a.setAttribute("d",b);return{minX:g,maxX:h,minY:k,maxY:l}};d.mercatorLatitudeToRadians=function(a){return Math.log(Math.tan(Math.PI/4+d.degreesToRadians(a)/2))};d.parsePath=function(a){a=a.match(/([MmLlHhVvZz]{1}[0-9.,\-\s]*)/g);for(var b=[],c=0;c<a.length;c++){var d=a[c].match(/([MmLlHhVvZz]{1})|([0-9.\-]+)/g),f={letter:d[0]};switch(d[0]){case "Z":case "Z":case "z":break;case "V":case "v":f.y=Number(d[1]);
|
301 |
break;case "H":case "h":f.x=Number(d[1]);break;default:f.x=Number(d[1]),f.y=Number(d[2])}b.push(f)}return b};d.acos=function(a){return 1<a?0:-1>a?Math.PI:Math.acos(a)};d.asin=function(a){return 1<a?Math.PI/2:-1>a?-Math.PI/2:Math.asin(a)};d.sinci=function(a){return a?a/Math.sin(a):1};d.asqrt=function(a){return 0<a?Math.sqrt(a):0};d.winkel3=function(a,b){var c=d.aitoff(a,b);return[(c[0]+a/Math.PI*2)/2,(c[1]+b)/2]};d.winkel3.invert=function(a,b){var c=a,e=b,f=25,g=Math.PI/2;do var h=Math.cos(e),k=Math.sin(e),
|
302 |
+
l=Math.sin(2*e),m=k*k,n=h*h,q=Math.sin(c),r=Math.cos(c/2),t=Math.sin(c/2),p=t*t,y=1-n*r*r,B=y?d.acos(h*r)*Math.sqrt(u=1/y):u=0,u,y=.5*(2*B*h*t+c/g)-a,w=.5*(B*k+e)-b,v=.5*u*(n*p+B*h*r*m)+.5/g,A=u*(q*l/4-B*k*t),k=.125*u*(l*t-B*k*n*q),m=.5*u*(m*r+B*p*h)+.5,h=A*k-m*v,A=(w*A-y*m)/h,y=(y*k-w*v)/h,c=c-A,e=e-y;while((1E-6<Math.abs(A)||1E-6<Math.abs(y))&&0<--f);return[c,e]};d.aitoff=function(a,b){var c=Math.cos(b),e=d.sinci(d.acos(c*Math.cos(a/=2)));return[2*c*Math.sin(a)*e,Math.sin(b)*e]};d.orthographic=
|
303 |
function(a,b){return[Math.cos(b)*Math.sin(a),Math.sin(b)]};d.equirectangular=function(a,b){return[a,b]};d.equirectangular.invert=function(a,b){return[a,b]};d.eckert5=function(a,b){var c=Math.PI;return[a*(1+Math.cos(b))/Math.sqrt(2+c),2*b/Math.sqrt(2+c)]};d.eckert5.invert=function(a,b){var c=Math.sqrt(2+Math.PI),d=b*c/2;return[c*a/(1+Math.cos(d)),d]};d.eckert6=function(a,b){for(var c=Math.PI,d=(1+c/2)*Math.sin(b),f=0,g=Infinity;10>f&&1E-5<Math.abs(g);f++)b-=g=(b+Math.sin(b)-d)/(1+Math.cos(b));d=Math.sqrt(2+
|
304 |
c);return[a*(1+Math.cos(b))/d,2*b/d]};d.eckert6.invert=function(a,b){var c=1+Math.PI/2,e=Math.sqrt(c/2);return[2*a*e/(1+Math.cos(b*=e)),d.asin((b+Math.sin(b))/c)]};d.mercator=function(a,b){b>=Math.PI/2-.02&&(b=Math.PI/2-.02);b<=-Math.PI/2+.02&&(b=-Math.PI/2+.02);return[a,Math.log(Math.tan(Math.PI/4+b/2))]};d.mercator.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Math.PI/2]};d.miller=function(a,b){return[a,1.25*Math.log(Math.tan(Math.PI/4+.4*b))]};d.miller.invert=function(a,b){return[a,2.5*
|
305 |
Math.atan(Math.exp(.8*b))-.625*Math.PI]};d.eckert3=function(a,b){var c=Math.PI,d=Math.sqrt(c*(4+c));return[2/d*a*(1+Math.sqrt(1-4*b*b/(c*c))),4/d*b]};d.eckert3.invert=function(a,b){var c=Math.PI,e=Math.sqrt(c*(4+c))/2;return[a*e/(1+d.asqrt(1-b*b*(4+c)/(4*c))),b*e/2]}})();(function(){var d=window.AmCharts;d.MapData=d.Class({inherits:d.MapObject,construct:function(){this.cname="MapData";d.MapData.base.construct.call(this);this.projection="mercator";this.topLatitude=90;this.bottomLatitude=-90;this.leftLongitude=-180;this.rightLongitude=180;this.zoomLevel=1;this.getAreasFromMap=!1}})})();(function(){var d=window.AmCharts;d.DescriptionWindow=d.Class({construct:function(){},show:function(a,b,c,d){var f=this;f.chart=a;var g=document.createElement("div");g.style.position="absolute";var h=a.classNamePrefix+"-description-";g.className="ammapDescriptionWindow "+h+"div";f.div=g;b.appendChild(g);var k=".gif";a.svgIcons&&(k=".svg");var l=document.createElement("img");l.className="ammapDescriptionWindowCloseButton "+h+"close-img";l.src=a.pathToImages+"xIcon"+k;l.style.cssFloat="right";l.style.cursor=
|
admin/wp-slimstat-admin.php
CHANGED
@@ -11,7 +11,7 @@ class wp_slimstat_admin {
|
|
11 |
* Init -- Sets things up.
|
12 |
*/
|
13 |
public static function init() {
|
14 |
-
self::$admin_notice = "The
|
15 |
self::$admin_notice .= '<br/><br/><a id="slimstat-hide-admin-notice" href="#" class="button-secondary">Got it, thanks</a>';
|
16 |
|
17 |
// Load language files
|
@@ -647,13 +647,12 @@ class wp_slimstat_admin {
|
|
647 |
}
|
648 |
// --- END: Updates for version 4.3.7 ---
|
649 |
|
650 |
-
// --- Updates for version 4.4.
|
651 |
-
if ( version_compare( wp_slimstat::$settings[ 'version' ], '4.4.
|
652 |
-
|
653 |
-
|
654 |
-
wp_slimstat::$settings[ 'enable_ads_network' ] = 'yes';
|
655 |
}
|
656 |
-
// --- END: Updates for version 4.4.
|
657 |
|
658 |
// Now we can update the version stored in the database
|
659 |
wp_slimstat::$settings[ 'version' ] = wp_slimstat::$version;
|
11 |
* Init -- Sets things up.
|
12 |
*/
|
13 |
public static function init() {
|
14 |
+
self::$admin_notice = "The Browscap Project recently released a new version of their data file. Leveraging the new autoupdate feature introduced a few weeks ago, we will publish our optimized version on our repository. Even those who are not ready to upgrade to the latest version of Slimstat, should receive the update in the next few days. Please let us know if you experience any issues by contacting our support team.";
|
15 |
self::$admin_notice .= '<br/><br/><a id="slimstat-hide-admin-notice" href="#" class="button-secondary">Got it, thanks</a>';
|
16 |
|
17 |
// Load language files
|
647 |
}
|
648 |
// --- END: Updates for version 4.3.7 ---
|
649 |
|
650 |
+
// --- Updates for version 4.4.5 ---
|
651 |
+
if ( version_compare( wp_slimstat::$settings[ 'version' ], '4.4.5', '<' ) ) {
|
652 |
+
wp_slimstat::$settings[ 'last_tracker_error' ] = array();
|
653 |
+
wp_slimstat::$settings[ 'last_tracker_notice' ] = array();
|
|
|
654 |
}
|
655 |
+
// --- END: Updates for version 4.4.5 ---
|
656 |
|
657 |
// Now we can update the version stored in the database
|
658 |
wp_slimstat::$settings[ 'version' ] = wp_slimstat::$version;
|
browscap/browser.php
CHANGED
@@ -2,7 +2,6 @@
|
|
2 |
|
3 |
class slim_browser {
|
4 |
public static $browser = array();
|
5 |
-
protected static $browscap_exists = false;
|
6 |
|
7 |
public static function init() {
|
8 |
self::$browser = array(
|
@@ -13,10 +12,8 @@ class slim_browser {
|
|
13 |
'user_agent' => self::_get_user_agent()
|
14 |
);
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
if ( self::$browscap_exists ) {
|
19 |
-
wp_slimstat::update_browscap_database();
|
20 |
include_once( wp_slimstat::$browscap_path );
|
21 |
|
22 |
self::$browser = slim_browscap_db::get_browser_from_browscap( self::$browser );
|
2 |
|
3 |
class slim_browser {
|
4 |
public static $browser = array();
|
|
|
5 |
|
6 |
public static function init() {
|
7 |
self::$browser = array(
|
12 |
'user_agent' => self::_get_user_agent()
|
13 |
);
|
14 |
|
15 |
+
if ( file_exists( wp_slimstat::$browscap_path ) ) {
|
16 |
+
$error = wp_slimstat::update_browscap_database( false );
|
|
|
|
|
17 |
include_once( wp_slimstat::$browscap_path );
|
18 |
|
19 |
self::$browser = slim_browscap_db::get_browser_from_browscap( self::$browser );
|
readme.txt
CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: analytics, statistics, counter, tracking, reports, wassup, geolocation, online users, spider, tracker, pageviews, stats, maxmind, statistics, statpress, power stats, hit
|
5 |
Text Domain: wp-slimstat
|
6 |
Requires at least: 3.8
|
7 |
-
Tested up to: 4.
|
8 |
-
Stable tag: 4.4.
|
9 |
|
10 |
== Description ==
|
11 |
[youtube https://www.youtube.com/watch?v=iJCtjxArq4U]
|
@@ -72,6 +72,11 @@ Our knowledge base is available on our [support center](http://docs.wp-slimstat.
|
|
72 |
|
73 |
== Changelog ==
|
74 |
|
|
|
|
|
|
|
|
|
|
|
75 |
= 4.4.4 =
|
76 |
* [Fix] Certain fields in the settings were not accepting case sensitive values (thank you, [undertheboardwalk](https://wordpress.org/support/topic/access-control-whitelist-is-not-case-sensitive)).
|
77 |
* [Fix] The heuristic browser detection functionality was failing to do its job under certain circumstances.
|
@@ -95,44 +100,6 @@ Our knowledge base is available on our [support center](http://docs.wp-slimstat.
|
|
95 |
* [Fix] Calls to admin-ajax.php were being tracked under certain circumstances.
|
96 |
* [Fix] The javascript code used to run various functions in the admin has been cleaned up and optimized.
|
97 |
|
98 |
-
= 4.3.7 =
|
99 |
-
* [New] A few users have experienced a conflict between AdBlock (and friends) and our stylesheet and javascript files. Apparently an overzealous ad blocker can prevent our assets from loading, thus showing [a quite messy interface](https://slimstat.freshdesk.com/support/solutions/articles/12000000414-the-reports-are-not-being-rendered-correctly-or-buttons-do-not-work). A notice has been added to the plugin and it will be displayed if this behavior is detected. If you are getting the message but you're not using AdBlock, then make sure to refresh your browser cache (thank you, [acekin](https://wordpress.org/support/topic/interface-questions)).
|
100 |
-
* [New] Top and Recent Downloads will now show a preview thumbnail when hovering each entry, if the downloaded file's extension ends in JPG, PNG or GIF (thank you, [willfretwell](https://wordpress.org/support/topic/thumbnails-of-downloads)).
|
101 |
-
* [New] If you configured Slimstat to display its menu in your admin bar, and you browse your website while logged in, the links to the various report screens will now automatically activate a filter for the current page.
|
102 |
-
* [Update] The [Browscap](http://browscap.org/) database has been updated to version 6016, released on August 4th, 2016.
|
103 |
-
* [Fix] The new Settings interface was saving more information than needed, specifically for backward compatibility with the Network Settings add-on, even if it was not installed.
|
104 |
-
* [Fix] The Live Stream functionality (i.e. auto-refreshing the access log report every few seconds) could not be deactivated.
|
105 |
-
* [Fix] Minor clean-up around the new Settings screens (thanks to all those who pointed out the glitches)
|
106 |
-
* [Fix] Multiple data purges were being scheduled under certain circumstances (second attempt).
|
107 |
-
|
108 |
-
= 4.3.6 =
|
109 |
-
* [New] In the last few weeks we've been working on revamping the Settings screens, by turning those boring radio buttons and text areas into more polished and modern switches and sortable tag lists. No more separating values with commas, when creating blacklists or configuring access control lists. Now you can type values as tokens, drag and drop them to reorganize your lists, and easily delete values. Pleae note: we had to rename some class variables to streamline our codebase, so if you're referencing them in your code, make sure to use the new names to avoid errors. Please report any issues or concern to our [support team](http://support.wp-slimstat.com).
|
110 |
-
* [Update] New versions of our premium add-ons will be released in the next few hours, to update the compatibility to the latest version of Slimstat. If you are not upgrading the main plugin, please DO NOT upgrade the add-ons.
|
111 |
-
* [Update] Introduced some PHP code optimizations to the tracker. Readability has also been improved, by retrofitting our existing code and applying our style guide to it.
|
112 |
-
* [Update] [AmCharts Map](https://www.amcharts.com/javascript-maps/), the library used to render our geolocation map, has been updated to version 3.20.9.
|
113 |
-
* [Update] Language files now contain all the new strings introduced in the last few updates. Please consider contributing to the project by submitting a translation in your language.
|
114 |
-
|
115 |
-
= 4.3.5 =
|
116 |
-
* [New] The slim_events table is now being archived along with the main slim_stats table.
|
117 |
-
* [Update] qTip2 and SlimScroll jQuery libraries have been updated to version 3.0.3 and 1.3.8 respectively.
|
118 |
-
* [Fix] The "out" timestamp was not being archived, when data was being copied over to the archive table.
|
119 |
-
* [Fix] Fixed an issue with HTTPS and Cloudflare when enqueueing the javascript tracker (thank you, [wuboys](https://wordpress.org/support/topic/use-admin_url-without-second-parameter))
|
120 |
-
* [Fix] Some more fields in the settings could not be reset to an empty value, if a non-empty value had been set (thank you, [codx26](https://wordpress.org/support/topic/slimstat-not-displaying-any-type-of-stats-after-switching-from-temporary-url)).
|
121 |
-
|
122 |
-
= 4.3.4 =
|
123 |
-
* [Update] [Browscap](http://browscap.org/) library updated to version 6015, released on June 20th, 2016.
|
124 |
-
* [Fix] WordPress had changed a global variable we use in our code, and made it 'protected' (thank you, [chrisl27](https://wordpress.org/support/topic/slimstat-uses-wpdb-dbname-instead-of-wpdb-prefix))
|
125 |
-
* [Fix] Some fields in the settings could not be reset to an empty value, if a non-empty value had been set (thank you, Christian)
|
126 |
-
* [Fix] Switching the menu position in the settings from Sidebar to Admin Bar was returning a permission error (thank you, [janiesc](https://wordpress.org/support/topic/cant-move-menu-position-to-admin-bar))
|
127 |
-
* [Fix] Download links with query string appended at the end of their URL were not being tracked as expected (thank you, [willfretwell](https://wordpress.org/support/topic/tracking-downloads-3)).
|
128 |
-
|
129 |
-
= 4.3.3 =
|
130 |
-
* [New] The tracker can now record more than one outbound link per pageview. The corresponding reports have been updated to keep the new column structure into consideration when calculating the values. (thank you, [john](https://wordpress.org/support/topic/external-link-tracking-replace-with-another-link))
|
131 |
-
* [Update] The default method for determining the browser from the user agent string will now be our proprietary heuristic function, not browscap anymore. If needed, you can change this under Settings > Tracker tab.
|
132 |
-
* [Fix] A PHP warning was being returned after tracking a click event on an internal download (thank you, [Stephen S](https://wordpress.org/support/topic/php-notice-undefined-var-data_js)).
|
133 |
-
* [Fix] The new version of Browscap bundled with Slimstat 4.3.2 was causing quite a few 500 Server Error messages for our users. The nature of the issue remains unclear, however we decided to roll back to the previous version of the data file, which was working without any problems.
|
134 |
-
* [Fix] Adding a trailing comma to some of the text settings could trigger unexpected behaviors in the tracker. (thank you, [paronomasiaster](https://wordpress.org/support/topic/slimstat-not-recording-hits))
|
135 |
-
|
136 |
== Supporters ==
|
137 |
Slimstat Analytics is an open source project, dependent in large parts on donations. [This page](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BNJR5EZNY3W38)
|
138 |
is for those who want to donate money - be it once, be it regularly, be it a small or a big amount. Everything is set up for an easy donation process.
|
4 |
Tags: analytics, statistics, counter, tracking, reports, wassup, geolocation, online users, spider, tracker, pageviews, stats, maxmind, statistics, statpress, power stats, hit
|
5 |
Text Domain: wp-slimstat
|
6 |
Requires at least: 3.8
|
7 |
+
Tested up to: 4.7
|
8 |
+
Stable tag: 4.4.5
|
9 |
|
10 |
== Description ==
|
11 |
[youtube https://www.youtube.com/watch?v=iJCtjxArq4U]
|
72 |
|
73 |
== Changelog ==
|
74 |
|
75 |
+
= 4.4.5 =
|
76 |
+
* [New] We separated errors and notices in the log, to avoid confusion when users were trying to troubleshoot issues with the tracker.
|
77 |
+
* [Update] Because of old settings stuck in the database, some people were not able to uninstall the Browscap data file as expected.
|
78 |
+
* [Update] [AmMap](https://www.amcharts.com/javascript-maps/), the library used to render the world map, has been updated to version 3.20.17, released on October 24, 2016.
|
79 |
+
|
80 |
= 4.4.4 =
|
81 |
* [Fix] Certain fields in the settings were not accepting case sensitive values (thank you, [undertheboardwalk](https://wordpress.org/support/topic/access-control-whitelist-is-not-case-sensitive)).
|
82 |
* [Fix] The heuristic browser detection functionality was failing to do its job under certain circumstances.
|
100 |
* [Fix] Calls to admin-ajax.php were being tracked under certain circumstances.
|
101 |
* [Fix] The javascript code used to run various functions in the admin has been cleaned up and optimized.
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
== Supporters ==
|
104 |
Slimstat Analytics is an open source project, dependent in large parts on donations. [This page](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BNJR5EZNY3W38)
|
105 |
is for those who want to donate money - be it once, be it regularly, be it a small or a big amount. Everything is set up for an easy donation process.
|
wp-slimstat.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Slim Stat Analytics
|
4 |
Plugin URI: http://wordpress.org/plugins/wp-slimstat/
|
5 |
Description: The leading web analytics plugin for WordPress
|
6 |
-
Version: 4.4.
|
7 |
Author: Jason Crouse
|
8 |
Author URI: http://www.wp-slimstat.com/
|
9 |
Text Domain: wp-slimstat
|
@@ -15,7 +15,7 @@ if ( !empty( wp_slimstat::$settings ) ) {
|
|
15 |
}
|
16 |
|
17 |
class wp_slimstat {
|
18 |
-
public static $version = '4.4.
|
19 |
public static $settings = array();
|
20 |
public static $options = array(); // To be removed, here just for backward compatibility
|
21 |
|
@@ -254,8 +254,8 @@ class wp_slimstat {
|
|
254 |
|
255 |
// Third-party tools can decide that this pageview should not be tracked, by setting its datestamp to zero
|
256 |
if ( empty( self::$stat ) || empty( self::$stat[ 'dt' ] ) ) {
|
257 |
-
self::$stat[ 'id' ] = -
|
258 |
-
self::_set_error_array( __( '
|
259 |
return $_argument;
|
260 |
}
|
261 |
|
@@ -271,8 +271,8 @@ class wp_slimstat {
|
|
271 |
// Is this a 'seriously malformed' URL?
|
272 |
$referer = parse_url( self::$stat[ 'referer' ] );
|
273 |
if ( !$referer ) {
|
274 |
-
self::$stat[ 'id' ] = -
|
275 |
-
self::_set_error_array( sprintf( __( '
|
276 |
return $_argument;
|
277 |
}
|
278 |
|
@@ -295,8 +295,8 @@ class wp_slimstat {
|
|
295 |
foreach ( self::string_to_array( self::$settings[ 'ignore_referers' ] ) as $a_filter ) {
|
296 |
$pattern = str_replace( array( '\*', '\!' ) , array( '(.*)', '.' ), preg_quote( $a_filter, '/' ) );
|
297 |
if ( preg_match( "@^$pattern$@i", self::$stat[ 'referer' ] ) ) {
|
298 |
-
self::$stat[ 'id' ] = -
|
299 |
-
self::_set_error_array( sprintf( __( '
|
300 |
return $_argument;
|
301 |
}
|
302 |
}
|
@@ -377,8 +377,8 @@ class wp_slimstat {
|
|
377 |
foreach ( self::string_to_array( self::$settings[ 'ignore_resources' ] ) as $a_filter ) {
|
378 |
$pattern = str_replace( array('\*', '\!') , array('(.*)', '.'), preg_quote($a_filter, '/'));
|
379 |
if ( preg_match( "@^$pattern$@i", self::$stat[ 'resource' ] ) ) {
|
380 |
-
self::$stat['id'] = -
|
381 |
-
self::_set_error_array( sprintf( __( '
|
382 |
return $_argument;
|
383 |
}
|
384 |
}
|
@@ -388,8 +388,8 @@ class wp_slimstat {
|
|
388 |
list ( self::$stat[ 'ip' ], self::$stat[ 'other_ip' ] ) = self::_get_remote_ip();
|
389 |
|
390 |
if ( empty( self::$stat[ 'ip' ] ) || self::$stat[ 'ip' ] == '0.0.0.0' ) {
|
391 |
-
self::$stat[ 'id' ] = -
|
392 |
-
self::_set_error_array( __( '
|
393 |
return $_argument;
|
394 |
}
|
395 |
|
@@ -397,16 +397,16 @@ class wp_slimstat {
|
|
397 |
if ( !empty( $GLOBALS[ 'current_user' ]->ID ) ) {
|
398 |
// Don't track logged-in users, if the corresponding option is enabled
|
399 |
if ( self::$settings[ 'track_users' ] == 'no' ) {
|
400 |
-
self::$stat[ 'id' ] = -
|
401 |
-
self::_set_error_array( sprintf( __( '
|
402 |
return $_argument;
|
403 |
}
|
404 |
|
405 |
// Don't track users with given capabilities
|
406 |
foreach ( self::string_to_array( self::$settings[ 'ignore_capabilities' ] ) as $a_capability ) {
|
407 |
if ( array_key_exists( strtolower( $a_capability ), $GLOBALS[ 'current_user' ]->allcaps ) ) {
|
408 |
-
self::$stat[ 'id' ] = -
|
409 |
-
self::_set_error_array( sprintf( __( '
|
410 |
return $_argument;
|
411 |
}
|
412 |
}
|
@@ -415,8 +415,8 @@ class wp_slimstat {
|
|
415 |
foreach ( self::string_to_array( self::$settings[ 'ignore_users' ] ) as $a_filter ) {
|
416 |
$pattern = str_replace( array( '\*', '\!' ) , array( '(.*)', '.' ), preg_quote( $a_filter, '/' ) );
|
417 |
if ( preg_match( "~^$pattern$~i", $GLOBALS[ 'current_user' ]->data->user_login ) ) {
|
418 |
-
self::$stat['id'] = -
|
419 |
-
self::_set_error_array( sprintf( __( '
|
420 |
return $_argument;
|
421 |
}
|
422 |
}
|
@@ -436,8 +436,8 @@ class wp_slimstat {
|
|
436 |
|
437 |
if ( !empty( $spam_comment[ 'comment_count' ] ) ) {
|
438 |
if ( self::$settings[ 'ignore_spammers' ] == 'yes' ){
|
439 |
-
self::$stat[ 'id' ] = -
|
440 |
-
self::_set_error_array( sprintf( __( '
|
441 |
return $_argument;
|
442 |
}
|
443 |
else{
|
@@ -465,8 +465,8 @@ class wp_slimstat {
|
|
465 |
$long_masked_user_other_ip = substr( self::dtr_pton( self::$stat[ 'other_ip' ] ), 0 , $cidr_mask );
|
466 |
|
467 |
if ( $long_masked_user_ip === $long_masked_ip_to_ignore || $long_masked_user_other_ip === $long_masked_ip_to_ignore ) {
|
468 |
-
self::$stat['id'] = -
|
469 |
-
self::_set_error_array( sprintf( __('
|
470 |
return $_argument;
|
471 |
}
|
472 |
}
|
@@ -494,8 +494,8 @@ class wp_slimstat {
|
|
494 |
|
495 |
// Is this country blacklisted?
|
496 |
if ( is_string( self::$settings[ 'ignore_countries' ] ) && stripos( self::$settings[ 'ignore_countries' ], self::$stat[ 'country' ] ) !== false ) {
|
497 |
-
self::$stat['id'] = -
|
498 |
-
self::_set_error_array( sprintf( __('
|
499 |
return $_argument;
|
500 |
}
|
501 |
|
@@ -503,8 +503,8 @@ class wp_slimstat {
|
|
503 |
if ( ( isset( $_SERVER[ 'HTTP_X_MOZ' ] ) && ( strtolower( $_SERVER[ 'HTTP_X_MOZ' ] ) == 'prefetch' ) ) ||
|
504 |
( isset( $_SERVER[ 'HTTP_X_PURPOSE' ] ) && ( strtolower( $_SERVER[ 'HTTP_X_PURPOSE' ] ) == 'preview' ) ) ) {
|
505 |
if ( self::$settings[ 'ignore_prefetch' ] == 'yes' ) {
|
506 |
-
self::$stat[ 'id' ] = -
|
507 |
-
self::_set_error_array( __( '
|
508 |
return $_argument;
|
509 |
}
|
510 |
else{
|
@@ -519,8 +519,8 @@ class wp_slimstat {
|
|
519 |
|
520 |
// Are we ignoring bots?
|
521 |
if ( ( self::$settings[ 'javascript_mode' ] == 'yes' || self::$settings[ 'ignore_bots' ] == 'yes' ) && self::$browser[ 'browser_type' ] % 2 != 0 ) {
|
522 |
-
self::$stat[ 'id' ] = -
|
523 |
-
self::_set_error_array( __( '
|
524 |
return $_argument;
|
525 |
}
|
526 |
|
@@ -528,8 +528,8 @@ class wp_slimstat {
|
|
528 |
foreach ( self::string_to_array( self::$settings[ 'ignore_browsers' ] ) as $a_filter ) {
|
529 |
$pattern = str_replace( array( '\*', '\!' ) , array( '(.*)', '.' ), preg_quote( $a_filter, '/' ) );
|
530 |
if ( preg_match( "~^$pattern$~i", self::$browser[ 'browser' ] . '/' . self::$browser[ 'version' ] ) || preg_match( "~^$pattern$~i", self::$browser[ 'browser' ] ) || preg_match( "~^$pattern$~i", self::$browser[ 'user_agent' ] ) ) {
|
531 |
-
self::$stat[ 'id' ] = -
|
532 |
-
self::_set_error_array( sprintf( __( '
|
533 |
return $_argument;
|
534 |
}
|
535 |
}
|
@@ -545,8 +545,8 @@ class wp_slimstat {
|
|
545 |
|
546 |
// Third-party tools can decide that this pageview should not be tracked, by setting its datestamp to zero
|
547 |
if (empty(self::$stat) || empty(self::$stat['dt'])){
|
548 |
-
self::$stat['id'] = -
|
549 |
-
self::_set_error_array( __( '
|
550 |
return $_argument;
|
551 |
}
|
552 |
|
@@ -572,9 +572,8 @@ class wp_slimstat {
|
|
572 |
self::$stat['id'] = self::insert_row(self::$stat, $GLOBALS['wpdb']->prefix.'slim_stats');
|
573 |
|
574 |
if ( empty( self::$stat[ 'id' ] ) ) {
|
575 |
-
self::$stat[ 'id' ] = -
|
576 |
-
self::_set_error_array(
|
577 |
-
|
578 |
return $_argument;
|
579 |
}
|
580 |
}
|
@@ -1028,8 +1027,8 @@ class wp_slimstat {
|
|
1028 |
// Do we have an id for this request?
|
1029 |
if ( empty( self::$data_js[ 'id' ] ) || empty( self::$data_js[ 'op' ] ) ) {
|
1030 |
do_action( 'slimstat_track_exit_102' );
|
1031 |
-
self::$stat[ 'id' ] = -
|
1032 |
-
self::_set_error_array( __( 'Invalid payload string. Try clearing your WordPress cache.', 'wp-slimstat' ) );
|
1033 |
self::slimstat_save_options();
|
1034 |
exit( self::_get_id_with_checksum( self::$stat[ 'id' ] ) );
|
1035 |
}
|
@@ -1038,8 +1037,8 @@ class wp_slimstat {
|
|
1038 |
self::$data_js[ 'id' ] = self::_separate_id_from_checksum( self::$data_js[ 'id' ] );
|
1039 |
if ( self::$data_js['id'] === false ) {
|
1040 |
do_action( 'slimstat_track_exit_103' );
|
1041 |
-
self::$stat[ 'id' ] = -
|
1042 |
-
self::_set_error_array( __( 'Invalid data signature. Try clearing your WordPress cache.', 'wp-slimstat' ) );
|
1043 |
self::slimstat_save_options();
|
1044 |
exit( self::_get_id_with_checksum( self::$stat[ 'id' ] ) );
|
1045 |
}
|
@@ -1054,10 +1053,15 @@ class wp_slimstat {
|
|
1054 |
}
|
1055 |
// end _check_data_integrity
|
1056 |
|
1057 |
-
protected static function _set_error_array( $_error_message = '' ) {
|
1058 |
$error_code = abs( self::$stat[ 'id' ] );
|
1059 |
self::toggle_date_i18n_filters( false );
|
1060 |
-
|
|
|
|
|
|
|
|
|
|
|
1061 |
self::toggle_date_i18n_filters( true );
|
1062 |
}
|
1063 |
|
@@ -1127,10 +1131,10 @@ class wp_slimstat {
|
|
1127 |
}
|
1128 |
|
1129 |
// Download the most recent database directly from MaxMind's repository
|
1130 |
-
if (!function_exists('download_url')){
|
1131 |
require_once(ABSPATH . 'wp-admin/includes/file.php');
|
1132 |
}
|
1133 |
-
$maxmind_tmp = download_url('http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', 5);
|
1134 |
|
1135 |
if (is_wp_error($maxmind_tmp)){
|
1136 |
return __('There was an error downloading the MaxMind Geolite DB:', 'wp-slimstat').' '.$maxmind_tmp->get_error_message();
|
@@ -1173,20 +1177,16 @@ class wp_slimstat {
|
|
1173 |
/**
|
1174 |
* Downloads the Browscap User Agent database from our repository
|
1175 |
*/
|
1176 |
-
public static function update_browscap_database() {
|
1177 |
// Create the folder, if it doesn't exist
|
1178 |
if ( !file_exists( dirname( self::$browscap_path ) ) ) {
|
1179 |
mkdir( dirname( self::$browscap_path ) );
|
1180 |
}
|
1181 |
|
1182 |
-
$download_flag =
|
1183 |
|
1184 |
-
// Do we need to update the database?
|
1185 |
-
if ( !file_exists( self::$browscap_path ) ) {
|
1186 |
-
$download_flag = true;
|
1187 |
-
}
|
1188 |
// Check for updates once a week ( 604800 seconds )
|
1189 |
-
|
1190 |
|
1191 |
// Find the version of the local data file
|
1192 |
while ( ( $buffer = fgets( $handle, 4096 ) ) !== false ) {
|
@@ -1213,15 +1213,15 @@ class wp_slimstat {
|
|
1213 |
$response = wp_safe_remote_get( 'http://s3.amazonaws.com/browscap/browscap-db.php', array( 'timeout' => 300, 'stream' => true, 'filename' => self::$browscap_path ) );
|
1214 |
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
|
1215 |
@unlink( self::$browscap_path );
|
1216 |
-
return __( 'There was an error downloading the Browscap data file from our server. Please try again later.', 'wp-slimstat' );
|
1217 |
}
|
1218 |
|
1219 |
if ( !file_exists( self::$browscap_path ) ) {
|
1220 |
-
return __( 'There was an error saving the Browscap data file on your server. Please check your server permissions.', 'wp-slimstat' );
|
1221 |
}
|
1222 |
}
|
1223 |
|
1224 |
-
return 0;
|
1225 |
}
|
1226 |
|
1227 |
public static function slimstat_shortcode( $_attributes = '', $_content = '' ){
|
3 |
Plugin Name: Slim Stat Analytics
|
4 |
Plugin URI: http://wordpress.org/plugins/wp-slimstat/
|
5 |
Description: The leading web analytics plugin for WordPress
|
6 |
+
Version: 4.4.5
|
7 |
Author: Jason Crouse
|
8 |
Author URI: http://www.wp-slimstat.com/
|
9 |
Text Domain: wp-slimstat
|
15 |
}
|
16 |
|
17 |
class wp_slimstat {
|
18 |
+
public static $version = '4.4.5';
|
19 |
public static $settings = array();
|
20 |
public static $options = array(); // To be removed, here just for backward compatibility
|
21 |
|
254 |
|
255 |
// Third-party tools can decide that this pageview should not be tracked, by setting its datestamp to zero
|
256 |
if ( empty( self::$stat ) || empty( self::$stat[ 'dt' ] ) ) {
|
257 |
+
self::$stat[ 'id' ] = -300;
|
258 |
+
self::_set_error_array( __( 'Pageview filtered by third-party code', 'wp-slimstat' ), true );
|
259 |
return $_argument;
|
260 |
}
|
261 |
|
271 |
// Is this a 'seriously malformed' URL?
|
272 |
$referer = parse_url( self::$stat[ 'referer' ] );
|
273 |
if ( !$referer ) {
|
274 |
+
self::$stat[ 'id' ] = -201;
|
275 |
+
self::_set_error_array( sprintf( __( 'Malformed URL %s', 'wp-slimstat' ), self::$stat[ 'referer' ] ), false );
|
276 |
return $_argument;
|
277 |
}
|
278 |
|
295 |
foreach ( self::string_to_array( self::$settings[ 'ignore_referers' ] ) as $a_filter ) {
|
296 |
$pattern = str_replace( array( '\*', '\!' ) , array( '(.*)', '.' ), preg_quote( $a_filter, '/' ) );
|
297 |
if ( preg_match( "@^$pattern$@i", self::$stat[ 'referer' ] ) ) {
|
298 |
+
self::$stat[ 'id' ] = -301;
|
299 |
+
self::_set_error_array( sprintf( __( 'Referrer %s is blacklisted', 'wp-slimstat' ), self::$stat[ 'referer' ] ), true );
|
300 |
return $_argument;
|
301 |
}
|
302 |
}
|
377 |
foreach ( self::string_to_array( self::$settings[ 'ignore_resources' ] ) as $a_filter ) {
|
378 |
$pattern = str_replace( array('\*', '\!') , array('(.*)', '.'), preg_quote($a_filter, '/'));
|
379 |
if ( preg_match( "@^$pattern$@i", self::$stat[ 'resource' ] ) ) {
|
380 |
+
self::$stat['id'] = -302;
|
381 |
+
self::_set_error_array( sprintf( __( 'Permalink %s is blacklisted', 'wp-slimstat' ), self::$stat[ 'resource' ] ), true );
|
382 |
return $_argument;
|
383 |
}
|
384 |
}
|
388 |
list ( self::$stat[ 'ip' ], self::$stat[ 'other_ip' ] ) = self::_get_remote_ip();
|
389 |
|
390 |
if ( empty( self::$stat[ 'ip' ] ) || self::$stat[ 'ip' ] == '0.0.0.0' ) {
|
391 |
+
self::$stat[ 'id' ] = -202;
|
392 |
+
self::_set_error_array( __( 'Empty or not supported IP address format (IPv6)', 'wp-slimstat' ), false );
|
393 |
return $_argument;
|
394 |
}
|
395 |
|
397 |
if ( !empty( $GLOBALS[ 'current_user' ]->ID ) ) {
|
398 |
// Don't track logged-in users, if the corresponding option is enabled
|
399 |
if ( self::$settings[ 'track_users' ] == 'no' ) {
|
400 |
+
self::$stat[ 'id' ] = -303;
|
401 |
+
self::_set_error_array( sprintf( __( 'Logged in user %s not tracked', 'wp-slimstat' ), $GLOBALS[ 'current_user' ]->data->user_login ), true );
|
402 |
return $_argument;
|
403 |
}
|
404 |
|
405 |
// Don't track users with given capabilities
|
406 |
foreach ( self::string_to_array( self::$settings[ 'ignore_capabilities' ] ) as $a_capability ) {
|
407 |
if ( array_key_exists( strtolower( $a_capability ), $GLOBALS[ 'current_user' ]->allcaps ) ) {
|
408 |
+
self::$stat[ 'id' ] = -304;
|
409 |
+
self::_set_error_array( sprintf( __( 'User with capability %s not tracked', 'wp-slimstat' ), $a_capability ), true );
|
410 |
return $_argument;
|
411 |
}
|
412 |
}
|
415 |
foreach ( self::string_to_array( self::$settings[ 'ignore_users' ] ) as $a_filter ) {
|
416 |
$pattern = str_replace( array( '\*', '\!' ) , array( '(.*)', '.' ), preg_quote( $a_filter, '/' ) );
|
417 |
if ( preg_match( "~^$pattern$~i", $GLOBALS[ 'current_user' ]->data->user_login ) ) {
|
418 |
+
self::$stat['id'] = -305;
|
419 |
+
self::_set_error_array( sprintf( __( 'User %s is blacklisted', 'wp-slimstat' ), $GLOBALS[ 'current_user' ]->data->user_login ), true );
|
420 |
return $_argument;
|
421 |
}
|
422 |
}
|
436 |
|
437 |
if ( !empty( $spam_comment[ 'comment_count' ] ) ) {
|
438 |
if ( self::$settings[ 'ignore_spammers' ] == 'yes' ){
|
439 |
+
self::$stat[ 'id' ] = -306;
|
440 |
+
self::_set_error_array( sprintf( __( 'Spammer %s not tracked', 'wp-slimstat' ), $spam_comment[ 'comment_author' ] ), true );
|
441 |
return $_argument;
|
442 |
}
|
443 |
else{
|
465 |
$long_masked_user_other_ip = substr( self::dtr_pton( self::$stat[ 'other_ip' ] ), 0 , $cidr_mask );
|
466 |
|
467 |
if ( $long_masked_user_ip === $long_masked_ip_to_ignore || $long_masked_user_other_ip === $long_masked_ip_to_ignore ) {
|
468 |
+
self::$stat['id'] = -307;
|
469 |
+
self::_set_error_array( sprintf( __('IP address %s is blacklisted', 'wp-slimstat'), self::$stat[ 'ip' ] . ( !empty( self::$stat[ 'other_ip' ] ) ? ' (' . self::$stat[ 'other_ip' ] . ')' : '' ) ), true );
|
470 |
return $_argument;
|
471 |
}
|
472 |
}
|
494 |
|
495 |
// Is this country blacklisted?
|
496 |
if ( is_string( self::$settings[ 'ignore_countries' ] ) && stripos( self::$settings[ 'ignore_countries' ], self::$stat[ 'country' ] ) !== false ) {
|
497 |
+
self::$stat['id'] = -308;
|
498 |
+
self::_set_error_array( sprintf( __('Country %s is blacklisted', 'wp-slimstat'), self::$stat[ 'country' ] ), true );
|
499 |
return $_argument;
|
500 |
}
|
501 |
|
503 |
if ( ( isset( $_SERVER[ 'HTTP_X_MOZ' ] ) && ( strtolower( $_SERVER[ 'HTTP_X_MOZ' ] ) == 'prefetch' ) ) ||
|
504 |
( isset( $_SERVER[ 'HTTP_X_PURPOSE' ] ) && ( strtolower( $_SERVER[ 'HTTP_X_PURPOSE' ] ) == 'preview' ) ) ) {
|
505 |
if ( self::$settings[ 'ignore_prefetch' ] == 'yes' ) {
|
506 |
+
self::$stat[ 'id' ] = -309;
|
507 |
+
self::_set_error_array( __( 'Prefetch requests are ignored', 'wp-slimstat' ), true );
|
508 |
return $_argument;
|
509 |
}
|
510 |
else{
|
519 |
|
520 |
// Are we ignoring bots?
|
521 |
if ( ( self::$settings[ 'javascript_mode' ] == 'yes' || self::$settings[ 'ignore_bots' ] == 'yes' ) && self::$browser[ 'browser_type' ] % 2 != 0 ) {
|
522 |
+
self::$stat[ 'id' ] = -310;
|
523 |
+
self::_set_error_array( __( 'Bot not tracked', 'wp-slimstat' ), true );
|
524 |
return $_argument;
|
525 |
}
|
526 |
|
528 |
foreach ( self::string_to_array( self::$settings[ 'ignore_browsers' ] ) as $a_filter ) {
|
529 |
$pattern = str_replace( array( '\*', '\!' ) , array( '(.*)', '.' ), preg_quote( $a_filter, '/' ) );
|
530 |
if ( preg_match( "~^$pattern$~i", self::$browser[ 'browser' ] . '/' . self::$browser[ 'version' ] ) || preg_match( "~^$pattern$~i", self::$browser[ 'browser' ] ) || preg_match( "~^$pattern$~i", self::$browser[ 'user_agent' ] ) ) {
|
531 |
+
self::$stat[ 'id' ] = -311;
|
532 |
+
self::_set_error_array( sprintf( __( 'Browser %s is blacklisted', 'wp-slimstat' ), self::$browser[ 'browser' ] ), true );
|
533 |
return $_argument;
|
534 |
}
|
535 |
}
|
545 |
|
546 |
// Third-party tools can decide that this pageview should not be tracked, by setting its datestamp to zero
|
547 |
if (empty(self::$stat) || empty(self::$stat['dt'])){
|
548 |
+
self::$stat['id'] = -300;
|
549 |
+
self::_set_error_array( __( 'Pageview filtered by third-party code', 'wp-slimstat' ), true );
|
550 |
return $_argument;
|
551 |
}
|
552 |
|
572 |
self::$stat['id'] = self::insert_row(self::$stat, $GLOBALS['wpdb']->prefix.'slim_stats');
|
573 |
|
574 |
if ( empty( self::$stat[ 'id' ] ) ) {
|
575 |
+
self::$stat[ 'id' ] = -200;
|
576 |
+
self::_set_error_array( self::$wpdb->last_error, false );
|
|
|
577 |
return $_argument;
|
578 |
}
|
579 |
}
|
1027 |
// Do we have an id for this request?
|
1028 |
if ( empty( self::$data_js[ 'id' ] ) || empty( self::$data_js[ 'op' ] ) ) {
|
1029 |
do_action( 'slimstat_track_exit_102' );
|
1030 |
+
self::$stat[ 'id' ] = -100;
|
1031 |
+
self::_set_error_array( __( 'Invalid payload string. Try clearing your WordPress cache.', 'wp-slimstat' ), false );
|
1032 |
self::slimstat_save_options();
|
1033 |
exit( self::_get_id_with_checksum( self::$stat[ 'id' ] ) );
|
1034 |
}
|
1037 |
self::$data_js[ 'id' ] = self::_separate_id_from_checksum( self::$data_js[ 'id' ] );
|
1038 |
if ( self::$data_js['id'] === false ) {
|
1039 |
do_action( 'slimstat_track_exit_103' );
|
1040 |
+
self::$stat[ 'id' ] = -101;
|
1041 |
+
self::_set_error_array( __( 'Invalid data signature. Try clearing your WordPress cache.', 'wp-slimstat' ), false );
|
1042 |
self::slimstat_save_options();
|
1043 |
exit( self::_get_id_with_checksum( self::$stat[ 'id' ] ) );
|
1044 |
}
|
1053 |
}
|
1054 |
// end _check_data_integrity
|
1055 |
|
1056 |
+
protected static function _set_error_array( $_error_message = '', $_is_notice = false ) {
|
1057 |
$error_code = abs( self::$stat[ 'id' ] );
|
1058 |
self::toggle_date_i18n_filters( false );
|
1059 |
+
if ( $_is_notice ) {
|
1060 |
+
self::$settings[ 'last_tracker_notice' ] = array( $error_code, $_error_message, date_i18n( 'U' ) );
|
1061 |
+
}
|
1062 |
+
else {
|
1063 |
+
self::$settings[ 'last_tracker_error' ] = array( $error_code, $_error_message, date_i18n( 'U' ) );
|
1064 |
+
}
|
1065 |
self::toggle_date_i18n_filters( true );
|
1066 |
}
|
1067 |
|
1131 |
}
|
1132 |
|
1133 |
// Download the most recent database directly from MaxMind's repository
|
1134 |
+
if ( !function_exists( 'download_url' ) ) {
|
1135 |
require_once(ABSPATH . 'wp-admin/includes/file.php');
|
1136 |
}
|
1137 |
+
$maxmind_tmp = download_url( 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', 5 );
|
1138 |
|
1139 |
if (is_wp_error($maxmind_tmp)){
|
1140 |
return __('There was an error downloading the MaxMind Geolite DB:', 'wp-slimstat').' '.$maxmind_tmp->get_error_message();
|
1177 |
/**
|
1178 |
* Downloads the Browscap User Agent database from our repository
|
1179 |
*/
|
1180 |
+
public static function update_browscap_database( $_force_download = false ) {
|
1181 |
// Create the folder, if it doesn't exist
|
1182 |
if ( !file_exists( dirname( self::$browscap_path ) ) ) {
|
1183 |
mkdir( dirname( self::$browscap_path ) );
|
1184 |
}
|
1185 |
|
1186 |
+
$download_flag = $_force_download;
|
1187 |
|
|
|
|
|
|
|
|
|
1188 |
// Check for updates once a week ( 604800 seconds )
|
1189 |
+
if ( false !== ( $file_stat = @stat( self::$browscap_path ) ) && ( date( 'U' ) - $file_stat[ 'mtime' ] > 604800 ) && false !== ( $handle = @fopen( self::$browscap_path, "rb" ) ) ) {
|
1190 |
|
1191 |
// Find the version of the local data file
|
1192 |
while ( ( $buffer = fgets( $handle, 4096 ) ) !== false ) {
|
1213 |
$response = wp_safe_remote_get( 'http://s3.amazonaws.com/browscap/browscap-db.php', array( 'timeout' => 300, 'stream' => true, 'filename' => self::$browscap_path ) );
|
1214 |
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
|
1215 |
@unlink( self::$browscap_path );
|
1216 |
+
return array( 1, __( 'There was an error downloading the Browscap data file from our server. Please try again later.', 'wp-slimstat' ) );
|
1217 |
}
|
1218 |
|
1219 |
if ( !file_exists( self::$browscap_path ) ) {
|
1220 |
+
return array( 2, __( 'There was an error saving the Browscap data file on your server. Please check your server permissions.', 'wp-slimstat' ) );
|
1221 |
}
|
1222 |
}
|
1223 |
|
1224 |
+
return array( 0, __( 'The Browscap data file has been installed on your server.', 'wp-slimstat' ) );
|
1225 |
}
|
1226 |
|
1227 |
public static function slimstat_shortcode( $_attributes = '', $_content = '' ){
|