1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Merge remote-tracking branch 'multiwii/master'

Conflicts:
	changelog.html
	main.js
This commit is contained in:
Dominic Clifton 2014-07-20 01:01:25 +01:00
commit 1688b41eb2
32 changed files with 476 additions and 407 deletions

View file

@ -184,7 +184,10 @@
"message": "<strong>Backup</strong> your configuration in case of an accident. (<strong>CLI</strong> settings are <strong style=\"color: red\">not</strong> included)." "message": "<strong>Backup</strong> your configuration in case of an accident. (<strong>CLI</strong> settings are <strong style=\"color: red\">not</strong> included)."
}, },
"initialSetupButtonResetZaxis": { "initialSetupButtonResetZaxis": {
"message": "Reset Z axis" "message": "Reset Z axis, offset: 0 deg"
},
"initialSetupButtonResetZaxisValue": {
"message": "Reset Z axis, offset: $1 deg"
}, },
"initialSetupThrottleHead": { "initialSetupThrottleHead": {
"message": "Throttle Settings" "message": "Throttle Settings"
@ -261,6 +264,9 @@
"initialSetupModel": { "initialSetupModel": {
"message": "Model: $1" "message": "Model: $1"
}, },
"initialSetupHeading": {
"message": "Heading: $1 deg"
},
"initialSetupAccelCalibStarted": { "initialSetupAccelCalibStarted": {
"message": "Accelerometer calibration started" "message": "Accelerometer calibration started"
}, },

View file

@ -1,15 +1,23 @@
/* /*
If an id is also specified and a window with a matching id has been shown before, the remembered bounds of the window will be used instead. If an id is also specified and a window with a matching id has been shown before, the remembered bounds of the window will be used instead.
Size calculation for innerBounds seems to be faulty, app was designed for 960x625, using arbitrary values to make innerBounds happy for now Size calculation for innerBounds seems to be faulty, app was designed for 960x625
arbitrary values do match the windows ui, how it will affect other OSs is currently unknown
Bug was confirmed on Windows 7
OSX seems to be unaffected
Linux and cros is unknown
I am using arbitrary dimensions which fixes the Windows 7 problem, hopefully it will get resolved in future release so other OSs won't have to
use bigger dimensions by default.
*/ */
function start_app() { function start_app() {
chrome.app.window.create('main.html', { chrome.app.window.create('main.html', {
id: 'main-window', id: 'main-window',
frame: 'chrome', frame: 'chrome',
minWidth: 960, innerBounds: {
minHeight: 625 minWidth: 974,
minHeight: 632
}
}, function(createdWindow) { }, function(createdWindow) {
createdWindow.onClosed.addListener(function() { createdWindow.onClosed.addListener(function() {
// connectionId is passed from the script side through the chrome.runtime.getBackgroundPage refference // connectionId is passed from the script side through the chrome.runtime.getBackgroundPage refference
@ -57,31 +65,6 @@ function start_app() {
} }
}); });
}); });
/* code belowis chrome 36+ ready, till this is enforced in manifest we have to use the old version
chrome.app.window.create('main.html', {
id: 'main-window',
frame: 'chrome',
innerBounds: {
minWidth: 974,
minHeight: 632
}
}, function(createdWindow) {
createdWindow.onClosed.addListener(function() {
// connectionId is passed from the script side through the chrome.runtime.getBackgroundPage refference
// allowing us to automatically close the port when application shut down
// save connectionId in separate variable before app_window is destroyed
var connectionId = app_window.serial.connectionId;
if (connectionId > 0) {
chrome.serial.disconnect(connectionId, function(result) {
console.log('SERIAL: Connection closed - ' + result);
});
}
});
});
*/
} }
chrome.app.runtime.onLaunched.addListener(function() { chrome.app.runtime.onLaunched.addListener(function() {

View file

@ -1,4 +1,13 @@
<span>07.06.2014</span> <span>07.17.2014 - 0.47</span>
<p>
- Bugfixes related to Chrome 36+ release<br />
- Various optimizations and behavior improvements<br />
</p>
<span>07.11.2014 - 0.46</span>
<p>
- Application will display a spinner while waiting for data<br />
- Bugfixes<br />
<span>07.06.2014 - cleanflight</span>
<p> <p>
- Servos tab updated to support Cleanflight's cleaner implementation of channel forwarding<br /> - Servos tab updated to support Cleanflight's cleaner implementation of channel forwarding<br />
</p> </p>

17
images/loading-bars.svg Normal file
View file

@ -0,0 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="64" height="64" fill="silver">
<path transform="translate(2)" d="M0 12 V20 H4 V12z">
<animate attributeName="d" values="M0 12 V20 H4 V12z; M0 4 V28 H4 V4z; M0 12 V20 H4 V12z; M0 12 V20 H4 V12z" dur="1.2s" repeatCount="indefinite" begin="0" keytimes="0;.2;.5;1" keySplines="0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.8 0.4 0.8" calcMode="spline" />
</path>
<path transform="translate(8)" d="M0 12 V20 H4 V12z">
<animate attributeName="d" values="M0 12 V20 H4 V12z; M0 4 V28 H4 V4z; M0 12 V20 H4 V12z; M0 12 V20 H4 V12z" dur="1.2s" repeatCount="indefinite" begin="0.2" keytimes="0;.2;.5;1" keySplines="0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.8 0.4 0.8" calcMode="spline" />
</path>
<path transform="translate(14)" d="M0 12 V20 H4 V12z">
<animate attributeName="d" values="M0 12 V20 H4 V12z; M0 4 V28 H4 V4z; M0 12 V20 H4 V12z; M0 12 V20 H4 V12z" dur="1.2s" repeatCount="indefinite" begin="0.4" keytimes="0;.2;.5;1" keySplines="0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.8 0.4 0.8" calcMode="spline" />
</path>
<path transform="translate(20)" d="M0 12 V20 H4 V12z">
<animate attributeName="d" values="M0 12 V20 H4 V12z; M0 4 V28 H4 V4z; M0 12 V20 H4 V12z; M0 12 V20 H4 V12z" dur="1.2s" repeatCount="indefinite" begin="0.6" keytimes="0;.2;.5;1" keySplines="0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.8 0.4 0.8" calcMode="spline" />
</path>
<path transform="translate(26)" d="M0 12 V20 H4 V12z">
<animate attributeName="d" values="M0 12 V20 H4 V12z; M0 4 V28 H4 V4z; M0 12 V20 H4 V12z; M0 12 V20 H4 V12z" dur="1.2s" repeatCount="indefinite" begin="0.8" keytimes="0;.2;.5;1" keySplines="0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.8 0.4 0.8" calcMode="spline" />
</path>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

6
images/loading-spin.svg Normal file
View file

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="64" height="64" fill="silver">
<path opacity=".25" d="M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"/>
<path d="M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z">
<animateTransform attributeName="transform" type="rotate" from="0 16 16" to="360 16 16" dur="0.8s" repeatCount="indefinite" />
</path>
</svg>

After

Width:  |  Height:  |  Size: 424 B

View file

@ -40,6 +40,7 @@ var RC_tuning = {
var AUX_CONFIG = []; var AUX_CONFIG = [];
var AUX_CONFIG_values = []; var AUX_CONFIG_values = [];
var AUX_CONFIG_IDS = [];
var SERVO_CONFIG = []; var SERVO_CONFIG = [];

View file

@ -1,8 +1,12 @@
var tabs = {}; // filled by individual tab js file
var GUI_control = function() { var GUI_control = function() {
this.auto_connect = false; this.auto_connect = false;
this.connecting_to = false; this.connecting_to = false;
this.connected_to = false; this.connected_to = false;
this.active_tab; this.active_tab;
this.active_tab_ref = false;
this.tab_switch_in_progress = false;
this.operating_system; this.operating_system;
this.optional_usb_permissions = false; // controlled by usb permissions code this.optional_usb_permissions = false; // controlled by usb permissions code
this.interval_array = []; this.interval_array = [];
@ -190,97 +194,9 @@ GUI_control.prototype.log = function(message) {
// default switch doesn't require callback to be set // default switch doesn't require callback to be set
GUI_control.prototype.tab_switch_cleanup = function(callback) { GUI_control.prototype.tab_switch_cleanup = function(callback) {
MSP.callbacks_cleanup(); // we don't care about any old data that might or might not arrive MSP.callbacks_cleanup(); // we don't care about any old data that might or might not arrive
GUI.interval_kill_all(); // all intervals (mostly data pulling) needs to be removed on tab switch
switch (this.active_tab) { this.active_tab_ref.cleanup(callback);
case 'initial_setup':
GUI.interval_remove('initial_setup_data_pull');
GUI.interval_remove('status_pull');
if (callback) callback();
break;
case 'pid_tuning':
GUI.interval_remove('status_pull');
if (callback) callback();
break;
case 'receiver':
GUI.interval_remove('receiver_pull');
GUI.interval_remove('status_pull');
if (callback) callback();
break;
case 'auxiliary_configuration':
GUI.interval_remove('aux_data_pull');
GUI.interval_remove('status_pull');
if (callback) callback();
break;
case 'servos':
GUI.interval_remove('status_pull');
if (callback) callback();
break;
case 'gps':
GUI.interval_remove('gps_pull');
GUI.interval_remove('status_pull');
if (callback) callback();
break;
case 'motor_outputs':
GUI.interval_kill_all();
if (callback) callback();
break;
case 'sensors':
GUI.interval_kill_all();
serial.empty_output_buffer();
// sensor data tab uses scrollbars, emptying the content before loading another tab
// prevents scrollbar exposure to any of the tabs while new content is loaded in
$('#content').empty();
if (callback) callback();
break;
case 'cli':
var bufferOut = new ArrayBuffer(5);
var bufView = new Uint8Array(bufferOut);
bufView[0] = 0x65; // e
bufView[1] = 0x78; // x
bufView[2] = 0x69; // i
bufView[3] = 0x74; // t
bufView[4] = 0x0D; // enter
serial.send(bufferOut, function(writeInfo) {
// we could handle this "nicely", but this will do for now
// (another approach is however much more complicated):
// we can setup an interval asking for data lets say every 200ms, when data arrives, callback will be triggered and tab switched
// we could probably implement this someday
GUI.timeout_add('waiting_for_bootup', function() {
CLI_active = false;
CLI_valid = false;
if (callback) callback();
}, 5000); // if we dont allow enough time to reboot, CRC of "first" command sent will fail, keep an eye for this one
});
break;
case 'logging':
GUI.interval_kill_all();
if (callback) callback();
break;
case 'firmware_flasher':
// this.interval_remove('factory_mode');
PortHandler.flush_callbacks();
// unbind "global" events
$(document).unbind('keypress');
if (callback) callback();
break;
default:
if (callback) callback();
}
}; };
// initialize object into GUI variable // initialize object into GUI variable

File diff suppressed because one or more lines are too long

View file

@ -1,75 +1,77 @@
(function() { var h,aa=aa||{},k=this,ba=function(){},ca=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&& (function() { var h,aa=aa||{},k=this,ba=function(){},ca=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&
!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},m=function(a){return"array"==ca(a)},da=function(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length},n=function(a){return"string"==typeof a},p=function(a){return"function"==ca(a)},ea=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},fa=function(a,b,c){return a.call.apply(a.bind,arguments)},ga=function(a,b,c){if(!a)throw Error(); !a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},m=function(a){return"array"==ca(a)},da=function(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length},n=function(a){return"string"==typeof a},p=function(a){return"function"==ca(a)},ea=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},fa=function(a,b,c){return a.call.apply(a.bind,arguments)},ga=function(a,b,c){if(!a)throw Error();
if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},q=function(a,b,c){q=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa:ga;return q.apply(null,arguments)},ha=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments); if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},q=function(a,b,c){q=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa:ga;return q.apply(null,arguments)},ha=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);
return a.apply(this,b)}},r=Date.now||function(){return+new Date},s=function(a,b){var c=a.split("."),d=k;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d=d[e]?d[e]:d[e]={}:d[e]=b},t=function(a,b){function c(){}c.prototype=b.prototype;a.J=b.prototype;a.prototype=new c;a.ic=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}}; return a.apply(this,b)}},r=Date.now||function(){return+new Date},s=function(a,b){var c=a.split("."),d=k;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d=d[e]?d[e]:d[e]={}:d[e]=b},t=function(a,b){function c(){}c.prototype=b.prototype;a.I=b.prototype;a.prototype=new c;a.oc=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};
Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.length){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return q.apply(null,c)}return q(this,a)};var u=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,u);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};t(u,Error);u.prototype.name="CustomError";var ia=function(a,b){return a<b?-1:a>b?1:0};var v=Array.prototype,ja=v.indexOf?function(a,b,c){return v.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(n(a))return n(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},ka=v.forEach?function(a,b,c){v.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=n(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},la=v.some?function(a,b,c){return v.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=n(a)?a.split(""): Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.length){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return q.apply(null,c)}return q(this,a)};var u=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,u);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};t(u,Error);u.prototype.name="CustomError";var ia=function(a,b){return a<b?-1:a>b?1:0};var v=Array.prototype,ja=v.indexOf?function(a,b,c){return v.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(n(a))return n(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},ka=v.forEach?function(a,b,c){v.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=n(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},la=v.some?function(a,b,c){return v.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=n(a)?a.split(""):
a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1},na=function(a){var b;t:{b=ma;for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break t}b=-1}return 0>b?null:n(a)?a.charAt(b):a[b]},oa=function(a,b){var c=ja(a,b),d;(d=0<=c)&&v.splice.call(a,c,1);return d},pa=function(a){return v.concat.apply(v,arguments)},qa=function(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};var ra="StopIteration"in k?k.StopIteration:Error("StopIteration"),sa=function(){};sa.prototype.next=function(){throw ra;};sa.prototype.Tb=function(){return this};var ta=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)},ua=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b},va=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},wa=function(a,b){var c;t:{for(c in a)if(b.call(void 0,a[c],c,a))break t;c=void 0}return c&&a[c]},xa="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),ya=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<xa.length;f++)c= a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1},na=function(a){var b;t:{b=ma;for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break t}b=-1}return 0>b?null:n(a)?a.charAt(b):a[b]},oa=function(a,b){var c=ja(a,b),d;(d=0<=c)&&v.splice.call(a,c,1);return d},pa=function(a){return v.concat.apply(v,arguments)};var qa="StopIteration"in k?k.StopIteration:Error("StopIteration"),ra=function(){};ra.prototype.next=function(){throw qa;};ra.prototype.$b=function(){return this};var sa=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)},ta=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b},ua=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},va=function(a,b){var c;t:{for(c in a)if(b.call(void 0,a[c],c,a))break t;c=void 0}return c&&a[c]},wa="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),xa=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<wa.length;f++)c=
xa[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var w=function(a,b){this.o={};this.b=[];this.ea=this.g=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.Aa(a)};w.prototype.q=function(){za(this);for(var a=[],b=0;b<this.b.length;b++)a.push(this.o[this.b[b]]);return a};w.prototype.C=function(){za(this);return this.b.concat()};w.prototype.Q=function(a){return x(this.o,a)}; wa[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var w=function(a,b){this.o={};this.b=[];this.fa=this.g=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.Ba(a)};w.prototype.q=function(){ya(this);for(var a=[],b=0;b<this.b.length;b++)a.push(this.o[this.b[b]]);return a};w.prototype.B=function(){ya(this);return this.b.concat()};w.prototype.Q=function(a){return x(this.o,a)};
w.prototype.remove=function(a){return x(this.o,a)?(delete this.o[a],this.g--,this.ea++,this.b.length>2*this.g&&za(this),!0):!1};var za=function(a){if(a.g!=a.b.length){for(var b=0,c=0;b<a.b.length;){var d=a.b[b];x(a.o,d)&&(a.b[c++]=d);b++}a.b.length=c}if(a.g!=a.b.length){for(var e={},c=b=0;b<a.b.length;)d=a.b[b],x(e,d)||(a.b[c++]=d,e[d]=1),b++;a.b.length=c}};h=w.prototype;h.get=function(a,b){return x(this.o,a)?this.o[a]:b}; w.prototype.remove=function(a){return x(this.o,a)?(delete this.o[a],this.g--,this.fa++,this.b.length>2*this.g&&ya(this),!0):!1};var ya=function(a){if(a.g!=a.b.length){for(var b=0,c=0;b<a.b.length;){var d=a.b[b];x(a.o,d)&&(a.b[c++]=d);b++}a.b.length=c}if(a.g!=a.b.length){for(var e={},c=b=0;b<a.b.length;)d=a.b[b],x(e,d)||(a.b[c++]=d,e[d]=1),b++;a.b.length=c}};h=w.prototype;h.get=function(a,b){return x(this.o,a)?this.o[a]:b};
h.set=function(a,b){x(this.o,a)||(this.g++,this.b.push(a),this.ea++);this.o[a]=b};h.Aa=function(a){var b;a instanceof w?(b=a.C(),a=a.q()):(b=va(a),a=ua(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};h.B=function(){return new w(this)};h.jb=function(){za(this);for(var a={},b=0;b<this.b.length;b++){var c=this.b[b];a[c]=this.o[c]}return a}; h.set=function(a,b){x(this.o,a)||(this.g++,this.b.push(a),this.fa++);this.o[a]=b};h.Ba=function(a){var b;a instanceof w?(b=a.B(),a=a.q()):(b=ua(a),a=ta(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};h.forEach=function(a,b){for(var c=this.B(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};h.clone=function(){return new w(this)};h.mb=function(){ya(this);for(var a={},b=0;b<this.b.length;b++){var c=this.b[b];a[c]=this.o[c]}return a};
h.Tb=function(a){za(this);var b=0,c=this.b,d=this.o,e=this.ea,f=this,g=new sa;g.next=function(){for(;;){if(e!=f.ea)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw ra;var g=c[b++];return a?g:d[g]}};return g};var x=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var Aa={id:"hitType",name:"t",valueType:"text",maxLength:void 0,defaultValue:void 0},Ba={id:"sessionControl",name:"sc",valueType:"text",maxLength:void 0,defaultValue:void 0},Ca={id:"description",name:"cd",valueType:"text",maxLength:2048,defaultValue:void 0},Da={Jc:Aa,jc:{id:"anonymizeIp",name:"aip",valueType:"boolean",maxLength:void 0,defaultValue:void 0},Vc:{id:"queueTime",name:"qt",valueType:"integer",maxLength:void 0,defaultValue:void 0},pc:{id:"cacheBuster",name:"z",valueType:"text",maxLength:void 0, h.$b=function(a){ya(this);var b=0,c=this.b,d=this.o,e=this.fa,f=this,g=new ra;g.next=function(){for(;;){if(e!=f.fa)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw qa;var g=c[b++];return a?g:d[g]}};return g};var x=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var za={id:"hitType",name:"t",valueType:"text",maxLength:void 0,defaultValue:void 0},Aa={id:"sessionControl",name:"sc",valueType:"text",maxLength:void 0,defaultValue:void 0},Ba={id:"description",name:"cd",valueType:"text",maxLength:2048,defaultValue:void 0},Ca={Pc:za,pc:{id:"anonymizeIp",name:"aip",valueType:"boolean",maxLength:void 0,defaultValue:void 0},ad:{id:"queueTime",name:"qt",valueType:"integer",maxLength:void 0,defaultValue:void 0},vc:{id:"cacheBuster",name:"z",valueType:"text",maxLength:void 0,
defaultValue:void 0},$c:Ba,Sc:{id:"nonInteraction",name:"ni",valueType:"boolean",maxLength:void 0,defaultValue:void 0},zc:Ca,jd:{id:"title",name:"dt",valueType:"text",maxLength:1500,defaultValue:void 0},Ac:{id:"dimension",name:"cd[1-9][0-9]*",valueType:"text",maxLength:150,defaultValue:void 0},Rc:{id:"metric",name:"cm[1-9][0-9]*",valueType:"integer",maxLength:void 0,defaultValue:void 0},lc:{id:"appId",name:"aid",valueType:"text",maxLength:150,defaultValue:void 0},mc:{id:"appInstallerId",name:"aiid", defaultValue:void 0},gd:Aa,xd:{id:"userId",name:"uid",valueType:"text",maxLength:void 0,defaultValue:void 0},Yc:{id:"nonInteraction",name:"ni",valueType:"boolean",maxLength:void 0,defaultValue:void 0},Fc:Ba,qd:{id:"title",name:"dt",valueType:"text",maxLength:1500,defaultValue:void 0},Gc:{id:"dimension",name:"cd[1-9][0-9]*",valueType:"text",maxLength:150,defaultValue:void 0},Xc:{id:"metric",name:"cm[1-9][0-9]*",valueType:"integer",maxLength:void 0,defaultValue:void 0},rc:{id:"appId",name:"aid",valueType:"text",
valueType:"text",maxLength:150,defaultValue:void 0},Dc:{id:"eventCategory",name:"ec",valueType:"text",maxLength:150,defaultValue:void 0},Cc:{id:"eventAction",name:"ea",valueType:"text",maxLength:500,defaultValue:void 0},Ec:{id:"eventLabel",name:"el",valueType:"text",maxLength:500,defaultValue:void 0},Fc:{id:"eventValue",name:"ev",valueType:"integer",maxLength:void 0,defaultValue:void 0},bd:{id:"socialNetwork",name:"sn",valueType:"text",maxLength:50,defaultValue:void 0},ad:{id:"socialAction",name:"sa", maxLength:150,defaultValue:void 0},sc:{id:"appInstallerId",name:"aiid",valueType:"text",maxLength:150,defaultValue:void 0},Jc:{id:"eventCategory",name:"ec",valueType:"text",maxLength:150,defaultValue:void 0},Ic:{id:"eventAction",name:"ea",valueType:"text",maxLength:500,defaultValue:void 0},Kc:{id:"eventLabel",name:"el",valueType:"text",maxLength:500,defaultValue:void 0},Lc:{id:"eventValue",name:"ev",valueType:"integer",maxLength:void 0,defaultValue:void 0},jd:{id:"socialNetwork",name:"sn",valueType:"text",
valueType:"text",maxLength:50,defaultValue:void 0},cd:{id:"socialTarget",name:"st",valueType:"text",maxLength:2048,defaultValue:void 0},md:{id:"transactionId",name:"ti",valueType:"text",maxLength:500,defaultValue:void 0},ld:{id:"transactionAffiliation",name:"ta",valueType:"text",maxLength:500,defaultValue:void 0},nd:{id:"transactionRevenue",name:"tr",valueType:"currency",maxLength:void 0,defaultValue:void 0},od:{id:"transactionShipping",name:"ts",valueType:"currency",maxLength:void 0,defaultValue:void 0}, maxLength:50,defaultValue:void 0},hd:{id:"socialAction",name:"sa",valueType:"text",maxLength:50,defaultValue:void 0},kd:{id:"socialTarget",name:"st",valueType:"text",maxLength:2048,defaultValue:void 0},td:{id:"transactionId",name:"ti",valueType:"text",maxLength:500,defaultValue:void 0},sd:{id:"transactionAffiliation",name:"ta",valueType:"text",maxLength:500,defaultValue:void 0},ud:{id:"transactionRevenue",name:"tr",valueType:"currency",maxLength:void 0,defaultValue:void 0},vd:{id:"transactionShipping",
pd:{id:"transactionTax",name:"tt",valueType:"currency",maxLength:void 0,defaultValue:void 0},xc:{id:"currencyCode",name:"cu",valueType:"text",maxLength:10,defaultValue:void 0},Nc:{id:"itemPrice",name:"ip",valueType:"currency",maxLength:void 0,defaultValue:void 0},Oc:{id:"itemQuantity",name:"iq",valueType:"integer",maxLength:void 0,defaultValue:void 0},Lc:{id:"itemCode",name:"ic",valueType:"text",maxLength:500,defaultValue:void 0},Mc:{id:"itemName",name:"in",valueType:"text",maxLength:500,defaultValue:void 0}, name:"ts",valueType:"currency",maxLength:void 0,defaultValue:void 0},wd:{id:"transactionTax",name:"tt",valueType:"currency",maxLength:void 0,defaultValue:void 0},Dc:{id:"currencyCode",name:"cu",valueType:"text",maxLength:10,defaultValue:void 0},Tc:{id:"itemPrice",name:"ip",valueType:"currency",maxLength:void 0,defaultValue:void 0},Uc:{id:"itemQuantity",name:"iq",valueType:"integer",maxLength:void 0,defaultValue:void 0},Rc:{id:"itemCode",name:"ic",valueType:"text",maxLength:500,defaultValue:void 0},
Kc:{id:"itemCategory",name:"iv",valueType:"text",maxLength:500,defaultValue:void 0},vc:{id:"campaignSource",name:"cs",valueType:"text",maxLength:100,defaultValue:void 0},tc:{id:"campaignMedium",name:"cm",valueType:"text",maxLength:50,defaultValue:void 0},uc:{id:"campaignName",name:"cn",valueType:"text",maxLength:100,defaultValue:void 0},sc:{id:"campaignKeyword",name:"ck",valueType:"text",maxLength:500,defaultValue:void 0},qc:{id:"campaignContent",name:"cc",valueType:"text",maxLength:500,defaultValue:void 0}, Sc:{id:"itemName",name:"in",valueType:"text",maxLength:500,defaultValue:void 0},Qc:{id:"itemCategory",name:"iv",valueType:"text",maxLength:500,defaultValue:void 0},Bc:{id:"campaignSource",name:"cs",valueType:"text",maxLength:100,defaultValue:void 0},zc:{id:"campaignMedium",name:"cm",valueType:"text",maxLength:50,defaultValue:void 0},Ac:{id:"campaignName",name:"cn",valueType:"text",maxLength:100,defaultValue:void 0},yc:{id:"campaignKeyword",name:"ck",valueType:"text",maxLength:500,defaultValue:void 0},
rc:{id:"campaignId",name:"ci",valueType:"text",maxLength:100,defaultValue:void 0},Ic:{id:"gclid",name:"gclid",valueType:"text",maxLength:void 0,defaultValue:void 0},yc:{id:"dclid",name:"dclid",valueType:"text",maxLength:void 0,defaultValue:void 0},Uc:{id:"pageLoadTime",name:"plt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Bc:{id:"dnsTime",name:"dns",valueType:"integer",maxLength:void 0,defaultValue:void 0},dd:{id:"tcpConnectTime",name:"tcp",valueType:"integer",maxLength:void 0,defaultValue:void 0}, wc:{id:"campaignContent",name:"cc",valueType:"text",maxLength:500,defaultValue:void 0},xc:{id:"campaignId",name:"ci",valueType:"text",maxLength:100,defaultValue:void 0},Oc:{id:"gclid",name:"gclid",valueType:"text",maxLength:void 0,defaultValue:void 0},Ec:{id:"dclid",name:"dclid",valueType:"text",maxLength:void 0,defaultValue:void 0},$c:{id:"pageLoadTime",name:"plt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Hc:{id:"dnsTime",name:"dns",valueType:"integer",maxLength:void 0,defaultValue:void 0},
Zc:{id:"serverResponseTime",name:"srt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Tc:{id:"pageDownloadTime",name:"pdt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Wc:{id:"redirectResponseTime",name:"rrt",valueType:"integer",maxLength:void 0,defaultValue:void 0},ed:{id:"timingCategory",name:"utc",valueType:"text",maxLength:150,defaultValue:void 0},hd:{id:"timingVar",name:"utv",valueType:"text",maxLength:500,defaultValue:void 0},gd:{id:"timingValue",name:"utt",valueType:"integer", ld:{id:"tcpConnectTime",name:"tcp",valueType:"integer",maxLength:void 0,defaultValue:void 0},fd:{id:"serverResponseTime",name:"srt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Zc:{id:"pageDownloadTime",name:"pdt",valueType:"integer",maxLength:void 0,defaultValue:void 0},bd:{id:"redirectResponseTime",name:"rrt",valueType:"integer",maxLength:void 0,defaultValue:void 0},md:{id:"timingCategory",name:"utc",valueType:"text",maxLength:150,defaultValue:void 0},pd:{id:"timingVar",name:"utv",
maxLength:void 0,defaultValue:void 0},fd:{id:"timingLabel",name:"utl",valueType:"text",maxLength:500,defaultValue:void 0},Gc:{id:"exDescription",name:"exd",valueType:"text",maxLength:150,defaultValue:void 0},Hc:{id:"exFatal",name:"exf",valueType:"boolean",maxLength:void 0,defaultValue:"1"}};var Ea=function(a,b){this.width=a;this.height=b};Ea.prototype.B=function(){return new Ea(this.width,this.height)};Ea.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};var y,Fa,Ga,Ha,Ia=function(){return k.navigator?k.navigator.userAgent:null};Ha=Ga=Fa=y=!1;var Ja;if(Ja=Ia()){var Ka=k.navigator;y=0==Ja.lastIndexOf("Opera",0);Fa=!y&&(-1!=Ja.indexOf("MSIE")||-1!=Ja.indexOf("Trident"));Ga=!y&&-1!=Ja.indexOf("WebKit");Ha=!y&&!Ga&&!Fa&&"Gecko"==Ka.product}var La=y,z=Fa,A=Ha,B=Ga,Ma=function(){var a=k.document;return a?a.documentMode:void 0},Na; valueType:"text",maxLength:500,defaultValue:void 0},od:{id:"timingValue",name:"utt",valueType:"integer",maxLength:void 0,defaultValue:void 0},nd:{id:"timingLabel",name:"utl",valueType:"text",maxLength:500,defaultValue:void 0},Mc:{id:"exDescription",name:"exd",valueType:"text",maxLength:150,defaultValue:void 0},Nc:{id:"exFatal",name:"exf",valueType:"boolean",maxLength:void 0,defaultValue:"1"}};var Da=function(a,b){this.width=a;this.height=b};Da.prototype.clone=function(){return new Da(this.width,this.height)};Da.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};var y;t:{var Ea=k.navigator;if(Ea){var Fa=Ea.userAgent;if(Fa){y=Fa;break t}}y=""}var z=function(a){return-1!=y.indexOf(a)};var Ga=z("Opera")||z("OPR"),A=z("Trident")||z("MSIE"),B=z("Gecko")&&-1==y.toLowerCase().indexOf("webkit")&&!(z("Trident")||z("MSIE")),C=-1!=y.toLowerCase().indexOf("webkit"),Ha=function(){var a=k.document;return a?a.documentMode:void 0},Ia=function(){var a="",b;if(Ga&&k.opera)return a=k.opera.version,p(a)?a():a;B?b=/rv\:([^\);]+)(\)|;)/:A?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:C&&(b=/WebKit\/(\S+)/);b&&(a=(a=b.exec(y))?a[1]:"");return A&&(b=Ha(),b>parseFloat(a))?String(b):a}(),Ja={},D=function(a){var b;
t:{var Oa="",Pa;if(La&&k.opera)var Qa=k.opera.version,Oa="function"==typeof Qa?Qa():Qa;else if(A?Pa=/rv\:([^\);]+)(\)|;)/:z?Pa=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:B&&(Pa=/WebKit\/(\S+)/),Pa)var Ra=Pa.exec(Ia()),Oa=Ra?Ra[1]:"";if(z){var Sa=Ma();if(Sa>parseFloat(Oa)){Na=String(Sa);break t}}Na=Oa} if(!(b=Ja[a])){b=0;for(var c=String(Ia).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",l=d[f]||"",I=RegExp("(\\d*)(\\D*)","g"),F=RegExp("(\\d*)(\\D*)","g");do{var S=I.exec(g)||["","",""],T=F.exec(l)||["","",""];if(0==S[0].length&&0==T[0].length)break;b=ia(0==S[1].length?0:parseInt(S[1],10),0==T[1].length?0:parseInt(T[1],10))||ia(0==S[2].length,0==T[2].length)||ia(S[2],T[2])}while(0==
var Ta=Na,Ua={},C=function(a){var b;if(!(b=Ua[a])){b=0;for(var c=String(Ta).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",l=d[f]||"",I=RegExp("(\\d*)(\\D*)","g"),F=RegExp("(\\d*)(\\D*)","g");do{var S=I.exec(g)||["","",""],T=F.exec(l)||["","",""];if(0==S[0].length&&0==T[0].length)break;b=ia(0==S[1].length?0:parseInt(S[1],10),0==T[1].length?0:parseInt(T[1],10))||ia(0==S[2].length, b)}b=Ja[a]=0<=b}return b},Ka=k.document,La=Ka&&A?Ha()||("CSS1Compat"==Ka.compatMode?parseInt(Ia,10):5):void 0;!B&&!A||A&&A&&9<=La||B&&D("1.9.1");A&&D("9");var Ma=function(){};Ma.prototype.Ka=!1;Ma.prototype.na=function(){this.Ka||(this.Ka=!0,this.j())};Ma.prototype.j=function(){if(this.rb)for(;this.rb.length;)this.rb.shift()()};var E=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.N=!1;this.Wa=!0};E.prototype.j=function(){};E.prototype.na=function(){};E.prototype.preventDefault=function(){this.defaultPrevented=!0;this.Wa=!1};var Na=function(a){Na[" "](a);return a};Na[" "]=ba;var Oa=!A||A&&9<=La,Pa=A&&!D("9"),Qa=!C||D("528"),Ra=B&&D("1.9b")||A&&D("8")||Ga&&D("9.5")||C&&D("528"),Sa=B&&!D("8")||A&&!D("9");var G=function(a,b){E.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.lb=this.state=null;if(a){var c=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(B){var e;t:{try{Na(d.nodeName);e=!0;break t}catch(f){}e=!1}e||(d=null)}}else"mouseover"==
0==T[2].length)||ia(S[2],T[2])}while(0==b)}b=Ua[a]=0<=b}return b},Va=k.document,Wa=Va&&z?Ma()||("CSS1Compat"==Va.compatMode?parseInt(Ta,10):5):void 0;!A&&!z||z&&z&&9<=Wa||A&&C("1.9.1");z&&C("9");var Xa=function(){};Xa.prototype.Ga=!1;Xa.prototype.na=function(){this.Ga||(this.Ga=!0,this.j())};Xa.prototype.j=function(){if(this.ob)for(;this.ob.length;)this.ob.shift()()};var D=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.N=!1;this.Ra=!0};D.prototype.j=function(){};D.prototype.na=function(){};D.prototype.preventDefault=function(){this.defaultPrevented=!0;this.Ra=!1};var Ya=function(a){Ya[" "](a);return a};Ya[" "]=ba;var Za=!z||z&&9<=Wa,$a=z&&!C("9"),ab=!B||C("528"),bb=A&&C("1.9b")||z&&C("8")||La&&C("9.5")||B&&C("528"),cb=A&&!C("8")||z&&!C("9");var E=function(a,b){D.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.ib=this.state=null;if(a){var c=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(A){var e;t:{try{Ya(d.nodeName);e=!0;break t}catch(f){}e=!1}e||(d=null)}}else"mouseover"== c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.offsetX=C||void 0!==a.offsetX?a.offsetX:a.layerX;this.offsetY=C||void 0!==a.offsetY?a.offsetY:a.layerY;this.clientX=void 0!==a.clientX?a.clientX:a.pageX;this.clientY=void 0!==a.clientY?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=
c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.offsetX=B||void 0!==a.offsetX?a.offsetX:a.layerX;this.offsetY=B||void 0!==a.offsetY?a.offsetY:a.layerY;this.clientX=void 0!==a.clientX?a.clientX:a.pageX;this.clientY=void 0!==a.clientY?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey= a.metaKey;this.state=a.state;this.lb=a;a.defaultPrevented&&this.preventDefault()}};t(G,E);G.prototype.preventDefault=function(){G.I.preventDefault.call(this);var a=this.lb;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Pa)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};G.prototype.j=function(){};var Ta="closure_listenable_"+(1E6*Math.random()|0),Ua=function(a){return!(!a||!a[Ta])},Va=0;var Wa=function(a,b,c,d,e){this.K=a;this.proxy=null;this.src=b;this.type=c;this.ga=!!d;this.ia=e;this.key=++Va;this.removed=this.ha=!1},Xa=function(a){a.removed=!0;a.K=null;a.proxy=null;a.src=null;a.ia=null};var H=function(a){this.src=a;this.h={};this.T=0};H.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.h[f];a||(a=this.h[f]=[],this.T++);var g=Ya(a,b,d,e);-1<g?(b=a[g],c||(b.ha=!1)):(b=new Wa(b,this.src,f,!!d,e),b.ha=c,a.push(b));return b};H.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.h))return!1;var e=this.h[a];b=Ya(e,b,c,d);return-1<b?(Xa(e[b]),v.splice.call(e,b,1),0==e.length&&(delete this.h[a],this.T--),!0):!1};
a.metaKey;this.state=a.state;this.ib=a;a.defaultPrevented&&this.preventDefault()}};t(E,D);E.prototype.preventDefault=function(){E.J.preventDefault.call(this);var a=this.ib;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,$a)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};E.prototype.j=function(){};var db="closure_listenable_"+(1E6*Math.random()|0),eb=function(a){try{return!(!a||!a[db])}catch(b){return!1}},fb=0;var gb=function(a,b,c,d,e){this.H=a;this.proxy=null;this.src=b;this.type=c;this.fa=!!d;this.ha=e;this.key=++fb;this.removed=this.ga=!1},hb=function(a){a.removed=!0;a.H=null;a.proxy=null;a.src=null;a.ha=null};var G=function(a){this.src=a;this.h={};this.S=0};G.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.h[f];a||(a=this.h[f]=[],this.S++);var g=ib(a,b,d,e);-1<g?(b=a[g],c||(b.ga=!1)):(b=new gb(b,this.src,f,!!d,e),b.ga=c,a.push(b));return b};G.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.h))return!1;var e=this.h[a];b=ib(e,b,c,d);return-1<b?(hb(e[b]),v.splice.call(e,b,1),0==e.length&&(delete this.h[a],this.S--),!0):!1}; var Za=function(a,b){var c=b.type;if(!(c in a.h))return!1;var d=oa(a.h[c],b);d&&(Xa(b),0==a.h[c].length&&(delete a.h[c],a.T--));return d};H.prototype.removeAll=function(a){a=a&&a.toString();var b=0,c;for(c in this.h)if(!a||c==a){for(var d=this.h[c],e=0;e<d.length;e++)++b,Xa(d[e]);delete this.h[c];this.T--}return b};H.prototype.S=function(a,b,c,d){a=this.h[a.toString()];var e=-1;a&&(e=Ya(a,b,c,d));return-1<e?a[e]:null};
var jb=function(a,b){var c=b.type;if(!(c in a.h))return!1;var d=oa(a.h[c],b);d&&(hb(b),0==a.h[c].length&&(delete a.h[c],a.S--));return d};G.prototype.removeAll=function(a){a=a&&a.toString();var b=0,c;for(c in this.h)if(!a||c==a){for(var d=this.h[c],e=0;e<d.length;e++)++b,hb(d[e]);delete this.h[c];this.S--}return b};G.prototype.R=function(a,b,c,d){a=this.h[a.toString()];var e=-1;a&&(e=ib(a,b,c,d));return-1<e?a[e]:null}; var Ya=function(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.removed&&f.K==b&&f.ga==!!c&&f.ia==d)return e}return-1};var $a="closure_lm_"+(1E6*Math.random()|0),ab={},bb=0,cb=function(a,b,c,d,e){if(m(b)){for(var f=0;f<b.length;f++)cb(a,b[f],c,d,e);return null}c=db(c);return Ua(a)?a.listen(b,c,d,e):eb(a,b,c,!1,d,e)},eb=function(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var g=!!e,l=fb(a);l||(a[$a]=l=new H(a));c=l.add(b,c,d,e,f);if(c.proxy)return c;d=gb();c.proxy=d;d.src=a;d.K=c;a.addEventListener?a.addEventListener(b.toString(),d,g):a.attachEvent(hb(b.toString()),d);bb++;return c},gb=function(){var a=ib,
var ib=function(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.removed&&f.H==b&&f.fa==!!c&&f.ha==d)return e}return-1};var kb="closure_lm_"+(1E6*Math.random()|0),lb={},mb=0,nb=function(a,b,c,d,e){if(m(b)){for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);return null}c=ob(c);return eb(a)?a.listen(b,c,d,e):pb(a,b,c,!1,d,e)},pb=function(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var g=!!e,l=qb(a);l||(a[kb]=l=new G(a));c=l.add(b,c,d,e,f);if(c.proxy)return c;d=rb();c.proxy=d;d.src=a;d.H=c;a.addEventListener?a.addEventListener(b.toString(),d,g):a.attachEvent(sb(b.toString()),d);mb++;return c},rb=function(){var a=tb, b=Oa?function(c){return a.call(b.src,b.K,c)}:function(c){c=a.call(b.src,b.K,c);if(!c)return c};return b},jb=function(a,b,c,d,e){if(m(b)){for(var f=0;f<b.length;f++)jb(a,b[f],c,d,e);return null}c=db(c);return Ua(a)?a.Oa(b,c,d,e):eb(a,b,c,!0,d,e)},kb=function(a,b,c,d,e){if(m(b))for(var f=0;f<b.length;f++)kb(a,b[f],c,d,e);else c=db(c),Ua(a)?a.Ja(b,c,d,e):a&&(a=fb(a))&&(b=a.S(b,c,!!d,e))&&lb(b)},lb=function(a){if("number"==typeof a||!a||a.removed)return!1;var b=a.src;if(Ua(b))return Za(b.v,a);var c=a.type,
b=Za?function(c){return a.call(b.src,b.H,c)}:function(c){c=a.call(b.src,b.H,c);if(!c)return c};return b},ub=function(a,b,c,d,e){if(m(b)){for(var f=0;f<b.length;f++)ub(a,b[f],c,d,e);return null}c=ob(c);return eb(a)?a.Ja(b,c,d,e):pb(a,b,c,!0,d,e)},vb=function(a,b,c,d,e){if(m(b))for(var f=0;f<b.length;f++)vb(a,b[f],c,d,e);else c=ob(c),eb(a)?a.Fa(b,c,d,e):a&&(a=qb(a))&&(b=a.R(b,c,!!d,e))&&wb(b)},wb=function(a){if("number"==typeof a||!a||a.removed)return!1;var b=a.src;if(eb(b))return jb(b.t,a);var c=a.type, d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.ga):b.detachEvent&&b.detachEvent(hb(c),d);bb--;(c=fb(b))?(Za(c,a),0==c.T&&(c.src=null,b[$a]=null)):Xa(a);return!0},hb=function(a){return a in ab?ab[a]:ab[a]="on"+a},nb=function(a,b,c,d){var e=1;if(a=fb(a))if(b=a.h[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.ga==c&&!f.removed&&(e&=!1!==mb(f,d))}return Boolean(e)},mb=function(a,b){var c=a.K,d=a.ia||a.src;a.ha&&lb(a);return c.call(d,b)},ib=function(a,b){if(a.removed)return!0;
d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.fa):b.detachEvent&&b.detachEvent(sb(c),d);mb--;(c=qb(b))?(jb(c,a),0==c.S&&(c.src=null,b[kb]=null)):hb(a);return!0},sb=function(a){return a in lb?lb[a]:lb[a]="on"+a},yb=function(a,b,c,d){var e=1;if(a=qb(a))if(b=a.h[b.toString()])for(b=qa(b),a=0;a<b.length;a++){var f=b[a];f&&f.fa==c&&!f.removed&&(e&=!1!==xb(f,d))}return Boolean(e)},xb=function(a,b){var c=a.H,d=a.ha||a.src;a.ga&&wb(a);return c.call(d,b)},tb=function(a,b){if(a.removed)return!0; if(!Oa){var c;if(!(c=b))t:{c=["window","event"];for(var d=k,e;e=c.shift();)if(null!=d[e])d=d[e];else{c=null;break t}c=d}e=c;c=new G(e,this);d=!0;if(!(0>e.keyCode||void 0!=e.returnValue)){t:{var f=!1;if(0==e.keyCode)try{e.keyCode=-1;break t}catch(g){f=!0}if(f||void 0==e.returnValue)e.returnValue=!0}e=[];for(f=c.currentTarget;f;f=f.parentNode)e.push(f);for(var f=a.type,l=e.length-1;!c.N&&0<=l;l--)c.currentTarget=e[l],d&=nb(e[l],f,!0,c);for(l=0;!c.N&&l<e.length;l++)c.currentTarget=e[l],d&=nb(e[l],f,
if(!Za){var c;if(!(c=b))t:{c=["window","event"];for(var d=k,e;e=c.shift();)if(null!=d[e])d=d[e];else{c=null;break t}c=d}e=c;c=new E(e,this);d=!0;if(!(0>e.keyCode||void 0!=e.returnValue)){t:{var f=!1;if(0==e.keyCode)try{e.keyCode=-1;break t}catch(g){f=!0}if(f||void 0==e.returnValue)e.returnValue=!0}e=[];for(f=c.currentTarget;f;f=f.parentNode)e.push(f);for(var f=a.type,l=e.length-1;!c.N&&0<=l;l--)c.currentTarget=e[l],d&=yb(e[l],f,!0,c);for(l=0;!c.N&&l<e.length;l++)c.currentTarget=e[l],d&=yb(e[l],f, !1,c)}return d}return mb(a,new G(b,this))},fb=function(a){a=a[$a];return a instanceof H?a:null},ob="__closure_events_fn_"+(1E9*Math.random()>>>0),db=function(a){if(p(a))return a;a[ob]||(a[ob]=function(b){return a.handleEvent(b)});return a[ob]};var J=function(){this.v=new H(this);this.Lb=this;this.Fa=null};t(J,Ma);J.prototype[Ta]=!0;h=J.prototype;h.addEventListener=function(a,b,c,d){cb(this,a,b,c,d)};h.removeEventListener=function(a,b,c,d){kb(this,a,b,c,d)};
!1,c)}return d}return xb(a,new E(b,this))},qb=function(a){a=a[kb];return a instanceof G?a:null},zb="__closure_events_fn_"+(1E9*Math.random()>>>0),ob=function(a){return p(a)?a:a[zb]||(a[zb]=function(b){return a.handleEvent(b)})};var H=function(){this.t=new G(this);this.Cb=this};t(H,Xa);H.prototype[db]=!0;h=H.prototype;h.Da=null;h.addEventListener=function(a,b,c,d){nb(this,a,b,c,d)};h.removeEventListener=function(a,b,c,d){vb(this,a,b,c,d)}; h.dispatchEvent=function(a){var b,c=this.Fa;if(c){b=[];for(var d=1;c;c=c.Fa)b.push(c),++d}c=this.Lb;d=a.type||a;if(n(a))a=new E(a,c);else if(a instanceof E)a.target=a.target||c;else{var e=a;a=new E(d,c);xa(a,e)}var e=!0,f;if(b)for(var g=b.length-1;!a.N&&0<=g;g--)f=a.currentTarget=b[g],e=pb(f,d,!0,a)&&e;a.N||(f=a.currentTarget=c,e=pb(f,d,!0,a)&&e,a.N||(e=pb(f,d,!1,a)&&e));if(b)for(g=0;!a.N&&g<b.length;g++)f=a.currentTarget=b[g],e=pb(f,d,!1,a)&&e;return e};
h.dispatchEvent=function(a){var b,c=this.Da;if(c){b=[];for(var d=1;c;c=c.Da)b.push(c),++d}c=this.Cb;d=a.type||a;if(n(a))a=new D(a,c);else if(a instanceof D)a.target=a.target||c;else{var e=a;a=new D(d,c);ya(a,e)}var e=!0,f;if(b)for(var g=b.length-1;!a.N&&0<=g;g--)f=a.currentTarget=b[g],e=Ab(f,d,!0,a)&&e;a.N||(f=a.currentTarget=c,e=Ab(f,d,!0,a)&&e,a.N||(e=Ab(f,d,!1,a)&&e));if(b)for(g=0;!a.N&&g<b.length;g++)f=a.currentTarget=b[g],e=Ab(f,d,!1,a)&&e;return e}; h.j=function(){J.I.j.call(this);this.v&&this.v.removeAll(void 0);this.Fa=null};h.listen=function(a,b,c,d){return this.v.add(String(a),b,!1,c,d)};h.Oa=function(a,b,c,d){return this.v.add(String(a),b,!0,c,d)};h.Ja=function(a,b,c,d){return this.v.remove(String(a),b,c,d)};var pb=function(a,b,c,d){b=a.v.h[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var g=b[f];if(g&&!g.removed&&g.ga==c){var l=g.K,I=g.ia||g.src;g.ha&&Za(a.v,g);e=!1!==l.call(I,d)&&e}}return e&&!1!=d.Wa};
h.j=function(){H.J.j.call(this);this.t&&this.t.removeAll(void 0);this.Da=null};h.listen=function(a,b,c,d){return this.t.add(String(a),b,!1,c,d)};h.Ja=function(a,b,c,d){return this.t.add(String(a),b,!0,c,d)};h.Fa=function(a,b,c,d){return this.t.remove(String(a),b,c,d)};var Ab=function(a,b,c,d){b=a.t.h[String(b)];if(!b)return!0;b=qa(b);for(var e=!0,f=0;f<b.length;++f){var g=b[f];if(g&&!g.removed&&g.fa==c){var l=g.H,I=g.ha||g.src;g.ga&&jb(a.t,g);e=!1!==l.call(I,d)&&e}}return e&&!1!=d.Ra}; J.prototype.S=function(a,b,c,d){return this.v.S(String(a),b,c,d)};var qb=function(a,b){J.call(this);this.oa=a||1;this.L=b||k;this.Ga=q(this.Nb,this);this.Ha=r()};t(qb,J);h=qb.prototype;h.enabled=!1;h.e=null;h.Nb=function(){if(this.enabled){var a=r()-this.Ha;0<a&&a<.8*this.oa?this.e=this.L.setTimeout(this.Ga,this.oa-a):(this.e&&(this.L.clearTimeout(this.e),this.e=null),this.dispatchEvent("tick"),this.enabled&&(this.e=this.L.setTimeout(this.Ga,this.oa),this.Ha=r()))}};h.start=function(){this.enabled=!0;this.e||(this.e=this.L.setTimeout(this.Ga,this.oa),this.Ha=r())};
H.prototype.R=function(a,b,c,d){return this.t.R(String(a),b,c,d)};var Bb=function(a,b){H.call(this);this.oa=a||1;this.L=b||k;this.Ba=q(this.Db,this);this.Ca=r()};t(Bb,H);h=Bb.prototype;h.enabled=!1;h.e=null;h.Db=function(){if(this.enabled){var a=r()-this.Ca;0<a&&a<0.8*this.oa?this.e=this.L.setTimeout(this.Ba,this.oa-a):(this.e&&(this.L.clearTimeout(this.e),this.e=null),this.dispatchEvent("tick"),this.enabled&&(this.e=this.L.setTimeout(this.Ba,this.oa),this.Ca=r()))}};h.start=function(){this.enabled=!0;this.e||(this.e=this.L.setTimeout(this.Ba,this.oa),this.Ca=r())}; h.stop=function(){this.enabled=!1;this.e&&(this.L.clearTimeout(this.e),this.e=null)};h.j=function(){qb.I.j.call(this);this.stop();delete this.L};var rb=function(a,b,c){if(p(a))c&&(a=q(a,c));else if(a&&"function"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<b?-1:k.setTimeout(a,b||0)};var K=function(a){this.Ia=a;this.b={}};t(K,Ma);var sb=[];K.prototype.listen=function(a,b,c,d){m(b)||(b&&(sb[0]=b.toString()),b=sb);for(var e=0;e<b.length;e++){var f=cb(a,b[e],c||this.handleEvent,d||!1,this.Ia||this);if(!f)break;this.b[f.key]=f}return this};K.prototype.Oa=function(a,b,c,d){return tb(this,a,b,c,d)};var tb=function(a,b,c,d,e,f){if(m(c))for(var g=0;g<c.length;g++)tb(a,b,c[g],d,e,f);else{b=jb(b,c,d||a.handleEvent,e,f||a.Ia||a);if(!b)return a;a.b[b.key]=b}return a};
h.stop=function(){this.enabled=!1;this.e&&(this.L.clearTimeout(this.e),this.e=null)};h.j=function(){Bb.J.j.call(this);this.stop();delete this.L};var Cb=function(a,b,c){if(p(a))c&&(a=q(a,c));else if(a&&"function"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<b?-1:k.setTimeout(a,b||0)};var J=function(a){this.Ea=a;this.b={}};t(J,Xa);var Db=[];J.prototype.listen=function(a,b,c,d){m(b)||(Db[0]=b,b=Db);for(var e=0;e<b.length;e++){var f=nb(a,b[e],c||this.handleEvent,d||!1,this.Ea||this);if(!f)break;this.b[f.key]=f}return this};J.prototype.Ja=function(a,b,c,d){return Eb(this,a,b,c,d)};var Eb=function(a,b,c,d,e,f){if(m(c))for(var g=0;g<c.length;g++)Eb(a,b,c[g],d,e,f);else{b=ub(b,c,d||a.handleEvent,e,f||a.Ea||a);if(!b)return a;a.b[b.key]=b}return a}; K.prototype.Ja=function(a,b,c,d,e){if(m(b))for(var f=0;f<b.length;f++)this.Ja(a,b[f],c,d,e);else c=c||this.handleEvent,e=e||this.Ia||this,c=db(c),d=!!d,b=Ua(a)?a.S(b,c,d,e):a?(a=fb(a))?a.S(b,c,d,e):null:null,b&&(lb(b),delete this.b[b.key]);return this};K.prototype.removeAll=function(){sa(this.b,lb);this.b={}};K.prototype.j=function(){K.I.j.call(this);this.removeAll()};K.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};var L=function(){J.call(this);this.ja=new K(this);Qa&&(Ra?this.ja.listen(Sa?document.body:window,["online","offline"],this.cb):(this.eb=Qa?navigator.onLine:!0,this.e=new qb(250),this.ja.listen(this.e,"tick",this.Fb),this.e.start()))};t(L,J);L.prototype.Fb=function(){var a=Qa?navigator.onLine:!0;a!=this.eb&&(this.eb=a,this.cb())};L.prototype.cb=function(){this.dispatchEvent((Qa?navigator.onLine:1)?"online":"offline")};
J.prototype.Fa=function(a,b,c,d,e){if(m(b))for(var f=0;f<b.length;f++)this.Fa(a,b[f],c,d,e);else c=c||this.handleEvent,e=e||this.Ea||this,c=ob(c),d=!!d,b=eb(a)?a.R(b,c,d,e):a?(a=qb(a))?a.R(b,c,d,e):null:null,b&&(wb(b),delete this.b[b.key]);return this};J.prototype.removeAll=function(){ta(this.b,wb);this.b={}};J.prototype.j=function(){J.J.j.call(this);this.removeAll()};J.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};var K=function(){H.call(this);this.ia=new J(this);ab&&(bb?this.ia.listen(cb?document.body:window,["online","offline"],this.Wa):(this.Ya=ab?navigator.onLine:!0,this.e=new Bb(250),this.ia.listen(this.e,"tick",this.zb),this.e.start()))};t(K,H);K.prototype.zb=function(){var a=ab?navigator.onLine:!0;a!=this.Ya&&(this.Ya=a,this.Wa())};K.prototype.Wa=function(){this.dispatchEvent((ab?navigator.onLine:1)?"online":"offline")}; L.prototype.j=function(){L.I.j.call(this);this.ja.na();this.ja=null;this.e&&(this.e.na(),this.e=null)};var ub=function(a){k.setTimeout(function(){throw a;},0)},vb,wb=function(){if(k.Promise&&k.Promise.resolve){var a=k.Promise.resolve();return function(b){a.then(function(){try{b()}catch(a){ub(a)}})}}var b=k.MessageChannel;"undefined"===typeof b&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&(b=function(){var a=document.createElement("iframe");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();
K.prototype.j=function(){K.J.j.call(this);this.ia.na();this.ia=null;this.e&&(this.e.na(),this.e=null)};var Hb=function(a){p(k.setImmediate)?k.setImmediate(a):(Fb||(Fb=Gb()),Fb(a))},Fb,Gb=function(){var a=k.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&(a=function(){var a=document.createElement("iframe");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d=b.location.protocol+"//"+b.location.host,a=q(function(a){if(a.origin== var c="callImmediate"+Math.random(),d=b.location.protocol+"//"+b.location.host,a=q(function(a){if(a.origin==d||a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof b){var c=new b,d={},e=d;c.port1.onmessage=function(){d=d.next;var a=d.ob;d.ob=null;a()};return function(a){e.next={ob:a};e=e.next;c.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("script")?
d||a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a){var b=new a,c={},d=c;b.port1.onmessage=function(){c=c.next;var a=c.lb;c.lb=null;a()};return function(a){d.next={lb:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("script")?function(a){var b=document.createElement("script");b.onreadystatechange=function(){b.onreadystatechange= function(a){var b=document.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){k.setTimeout(a,0)}};var Bb=function(a,b){if(!xb){var c=yb;p(k.setImmediate)?k.setImmediate(c):(vb||(vb=wb()),vb(c));xb=!0}zb.push(new Ab(a,b))},xb=!1,zb=[],yb=function(){for(;zb.length;){var a=zb;zb=[];for(var b=0;b<a.length;b++){var c=a[b];try{c.ac.call(c.scope)}catch(d){ub(d)}}}xb=!1},Ab=function(a,b){this.ac=a;this.scope=b};var Cb=function(a){a.prototype.then=a.prototype.then;a.prototype.$goog_Thenable=!0},Db=function(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};var N=function(a,b){this.l=0;this.r=void 0;this.m=this.n=null;this.ka=this.za=!1;try{var c=this;a.call(b,function(a){M(c,2,a)},function(a){M(c,3,a)})}catch(d){M(this,3,d)}};N.prototype.then=function(a,b,c){return Eb(this,p(a)?a:null,p(b)?b:null,c)};Cb(N);N.prototype.cancel=function(a){0==this.l&&Bb(function(){var b=new Fb(a);Gb(this,b)},this)};
null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){k.setTimeout(a,0)}};var Ib=function(a){Hb(function(){throw a;})},Nb=function(a,b){Jb||(Hb(Kb),Jb=!0);Lb.push(new Mb(a,b))},Jb=!1,Lb=[],Kb=function(){for(;Lb.length;){var a=Lb;Lb=[];for(var b=0;b<a.length;b++){var c=a[b];try{c.Vb.call(c.scope)}catch(d){Ib(d)}}}Jb=!1},Mb=function(a,b){this.Vb=a;this.scope=b};var Ob=function(a){a.prototype.then=a.prototype.then;a.prototype.$goog_Thenable=!0},Pb=function(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};var M=function(a,b){this.k=0;this.r=void 0;this.l=this.m=null;this.ja=this.ya=!1;try{var c=this;a.call(b,function(a){L(c,2,a)},function(a){L(c,3,a)})}catch(d){L(this,3,d)}};M.prototype.then=function(a,b,c){return Qb(this,p(a)?a:null,p(b)?b:null,c)};Ob(M);M.prototype.cancel=function(a){0==this.k&&Nb(function(){var b=new Rb(a);Sb(this,b)},this)}; var Gb=function(a,b){if(0==a.l)if(a.n){var c=a.n;if(c.m){for(var d=0,e=-1,f=0,g;g=c.m[f];f++)if(g=g.ma)if(d++,g==a&&(e=f),0<=e&&1<d)break;0<=e&&(0==c.l&&1==d?Gb(c,b):(d=c.m.splice(e,1)[0],Hb(c),d.Aa(b)))}}else M(a,3,b)},Jb=function(a,b){a.m&&a.m.length||2!=a.l&&3!=a.l||Ib(a);a.m||(a.m=[]);a.m.push(b)},Eb=function(a,b,c,d){var e={ma:null,Va:null,Aa:null};e.ma=new N(function(a,g){e.Va=b?function(c){try{var e=b.call(d,c);a(e)}catch(F){g(F)}}:a;e.Aa=c?function(b){try{var e=c.call(d,b);void 0===e&&b instanceof
var Sb=function(a,b){if(0==a.k)if(a.m){var c=a.m;if(c.l){for(var d=0,e=-1,f=0,g;g=c.l[f];f++)if(g=g.la)if(d++,g==a&&(e=f),0<=e&&1<d)break;0<=e&&(0==c.k&&1==d?Sb(c,b):(d=c.l.splice(e,1)[0],Tb(c),d.za(b)))}}else L(a,3,b)},Vb=function(a,b){a.l&&a.l.length||2!=a.k&&3!=a.k||Ub(a);a.l||(a.l=[]);a.l.push(b)},Qb=function(a,b,c,d){var e={la:null,Qa:null,za:null};e.la=new M(function(a,g){e.Qa=b?function(c){try{var e=b.call(d,c);a(e)}catch(F){g(F)}}:a;e.za=c?function(b){try{var e=c.call(d,b);void 0===e&&b instanceof Fb?g(b):a(e)}catch(F){g(F)}}:g});e.ma.n=a;Jb(a,e);return e.ma};N.prototype.gb=function(a){this.l=0;M(this,2,a)};N.prototype.hb=function(a){this.l=0;M(this,3,a)};
Rb?g(b):a(e)}catch(F){g(F)}}:g});e.la.m=a;Vb(a,e);return e.la};M.prototype.Za=function(a){this.k=0;L(this,2,a)};M.prototype.$a=function(a){this.k=0;L(this,3,a)}; var M=function(a,b,c){if(0==a.l){if(a==c)b=3,c=new TypeError("Promise cannot resolve to itself");else{if(Db(c)){a.l=1;c.then(a.gb,a.hb,a);return}if(ea(c))try{var d=c.then;if(p(d)){Kb(a,c,d);return}}catch(e){b=3,c=e}}a.r=c;a.l=b;Ib(a);3!=b||c instanceof Fb||Lb(a,c)}},Kb=function(a,b,c){a.l=1;var d=!1,e=function(b){d||(d=!0,a.gb(b))},f=function(b){d||(d=!0,a.hb(b))};try{c.call(b,e,f)}catch(g){f(g)}},Ib=function(a){a.za||(a.za=!0,Bb(a.Yb,a))};
var L=function(a,b,c){if(0==a.k){if(a==c)b=3,c=new TypeError("Promise cannot resolve to itself");else{if(Pb(c)){a.k=1;c.then(a.Za,a.$a,a);return}if(ea(c))try{var d=c.then;if(p(d)){Wb(a,c,d);return}}catch(e){b=3,c=e}}a.r=c;a.k=b;Ub(a);3!=b||c instanceof Rb||Yb(a,c)}},Wb=function(a,b,c){a.k=1;var d=!1,e=function(b){d||(d=!0,a.Za(b))},f=function(b){d||(d=!0,a.$a(b))};try{c.call(b,e,f)}catch(g){f(g)}},Ub=function(a){a.ya||(a.ya=!0,Nb(a.Rb,a))}; N.prototype.Yb=function(){for(;this.m&&this.m.length;){var a=this.m;this.m=[];for(var b=0;b<a.length;b++){var c=a[b],d=this.r;2==this.l?c.Va(d):(Hb(this),c.Aa(d))}}this.za=!1};var Hb=function(a){for(;a&&a.ka;a=a.n)a.ka=!1},Lb=function(a,b){a.ka=!0;Bb(function(){a.ka&&Mb.call(null,b)})},Mb=ub,Fb=function(a){u.call(this,a)};t(Fb,u);Fb.prototype.name="cancel";/*
M.prototype.Rb=function(){for(;this.l&&this.l.length;){var a=this.l;this.l=[];for(var b=0;b<a.length;b++){var c=a[b],d=this.r;2==this.k?c.Qa(d):(Tb(this),c.za(d))}}this.ya=!1};var Tb=function(a){for(;a&&a.ja;a=a.m)a.ja=!1},Yb=function(a,b){a.ja=!0;Nb(function(){a.ja&&Zb.call(null,b)})},Zb=Ib,Rb=function(a){u.call(this,a)};t(Rb,u);Rb.prototype.name="cancel";/*
Portions of this code are from MochiKit, received by Portions of this code are from MochiKit, received by
The Closure Authors under the MIT license. All other code is Copyright The Closure Authors under the MIT license. All other code is Copyright
2005-2009 The Closure Authors. All Rights Reserved. 2005-2009 The Closure Authors. All Rights Reserved.
*/ */
var N=function(a,b){this.ba=[];this.Oa=a;this.Na=b||null;this.O=this.K=!1;this.r=void 0;this.wa=this.qb=this.va=!1;this.ca=0;this.m=null;this.ua=0};N.prototype.cancel=function(a){if(this.K)this.r instanceof N&&this.r.cancel();else{if(this.m){var b=this.m;delete this.m;a?b.cancel(a):(b.ua--,0>=b.ua&&b.cancel())}this.Oa?this.Oa.call(this.Na,this):this.wa=!0;this.K||this.A(new $b)}};N.prototype.Pa=function(a,b){this.va=!1;ac(this,a,b)}; var O=function(a,b){this.ba=[];this.Ta=a;this.Sa=b||null;this.P=this.G=!1;this.r=void 0;this.xa=this.tb=this.wa=!1;this.ca=0;this.n=null;this.va=0};O.prototype.cancel=function(a){if(this.G)this.r instanceof O&&this.r.cancel();else{if(this.n){var b=this.n;delete this.n;a?b.cancel(a):(b.va--,0>=b.va&&b.cancel())}this.Ta?this.Ta.call(this.Sa,this):this.xa=!0;this.G||this.t(new Nb)}};O.prototype.Ua=function(a,b){this.wa=!1;Ob(this,a,b)};
var ac=function(a,b,c){a.K=!0;a.r=c;a.O=!b;bc(a)},dc=function(a){if(a.K){if(!a.wa)throw new cc;a.wa=!1}};N.prototype.G=function(a){dc(this);ac(this,!0,a)};N.prototype.A=function(a){dc(this);ac(this,!1,a)};N.prototype.Ub=function(a,b){return O(this,a,null,b)};var ec=function(a,b,c){O(a,b,b,c)},O=function(a,b,c,d){a.ba.push([b,c,d]);a.K&&bc(a);return a};N.prototype.then=function(a,b,c){var d,e,f=new M(function(a,b){d=a;e=b});O(this,d,function(a){a instanceof $b?f.cancel():e(a)});return f.then(a,b,c)}; var Ob=function(a,b,c){a.G=!0;a.r=c;a.P=!b;Pb(a)},Sb=function(a){if(a.G){if(!a.xa)throw new Rb;a.xa=!1}};O.prototype.C=function(a){Sb(this);Ob(this,!0,a)};O.prototype.t=function(a){Sb(this);Ob(this,!1,a)};O.prototype.F=function(a,b){return P(this,a,null,b)};var P=function(a,b,c,d){a.ba.push([b,c,d]);a.G&&Pb(a);return a};O.prototype.then=function(a,b,c){var d,e,f=new N(function(a,b){d=a;e=b});P(this,d,function(a){a instanceof Nb?f.cancel():e(a)});return f.then(a,b,c)};Cb(O);
Ob(N); var Tb=function(a){var b=new O;P(a,b.C,b.t,b);return b},Ub=function(a){return la(a.ba,function(a){return p(a[1])})},Pb=function(a){if(a.ca&&a.G&&Ub(a)){var b=a.ca,c=Vb[b];c&&(k.clearTimeout(c.da),delete Vb[b]);a.ca=0}a.n&&(a.n.va--,delete a.n);for(var b=a.r,d=c=!1;a.ba.length&&!a.wa;){var e=a.ba.shift(),f=e[0],g=e[1],e=e[2];if(f=a.P?g:f)try{var l=f.call(e||a.Sa,b);void 0!==l&&(a.P=a.P&&(l==b||l instanceof Error),a.r=b=l);Db(b)&&(d=!0,a.wa=!0)}catch(I){b=I,a.P=!0,Ub(a)||(c=!0)}}a.r=b;d&&(l=q(a.Ua,
var fc=function(a){var b=new N;O(a,b.G,b.A,b);return b},gc=function(a){return la(a.ba,function(a){return p(a[1])})},bc=function(a){if(a.ca&&a.K&&gc(a)){var b=a.ca,c=hc[b];c&&(k.clearTimeout(c.da),delete hc[b]);a.ca=0}a.m&&(a.m.ua--,delete a.m);for(var b=a.r,d=c=!1;a.ba.length&&!a.va;){var e=a.ba.shift(),f=e[0],g=e[1],e=e[2];if(f=a.O?g:f)try{var l=f.call(e||a.Na,b);void 0!==l&&(a.O=a.O&&(l==b||l instanceof Error),a.r=b=l);Pb(b)&&(d=!0,a.va=!0)}catch(I){b=I,a.O=!0,gc(a)||(c=!0)}}a.r=b;d&&(l=q(a.Pa,a, a,!0),d=q(a.Ua,a,!1),b instanceof O?(P(b,l,d),b.tb=!0):b.then(l,d));c&&(b=new Wb(b),Vb[b.da]=b,a.ca=b.da)},Xb=function(a){var b=new O;b.C(a);return b},Zb=function(){var a=Yb,b=new O;b.t(a);return b},Rb=function(){u.call(this)};t(Rb,u);Rb.prototype.message="Deferred has already fired";Rb.prototype.name="AlreadyCalledError";var Nb=function(){u.call(this)};t(Nb,u);Nb.prototype.message="Deferred was canceled";Nb.prototype.name="CanceledError";
!0),d=q(a.Pa,a,!1),b instanceof N?(O(b,l,d),b.qb=!0):b.then(l,d));c&&(b=new ic(b),hc[b.da]=b,a.ca=b.da)},jc=function(a){var b=new N;b.G(a);return b},lc=function(){var a=kc,b=new N;b.A(a);return b},cc=function(){u.call(this)};t(cc,u);cc.prototype.message="Deferred has already fired";cc.prototype.name="AlreadyCalledError";var $b=function(){u.call(this)};t($b,u);$b.prototype.message="Deferred was canceled";$b.prototype.name="CanceledError"; var Wb=function(a){this.da=k.setTimeout(q(this.Ub,this),0);this.aa=a};Wb.prototype.Ub=function(){delete Vb[this.da];throw this.aa;};var Vb={};var $b=function(a,b){var c=Array.prototype.slice.call(arguments),d=c.shift();if("undefined"==typeof d)throw Error("[goog.string.format] Template required");return d.replace(/%([0\-\ \+]*)(\d+)?(\.(\d+))?([%sfdiu])/g,function(a,b,d,l,I,F,S,T){if("%"==F)return"%";var Qb=c.shift();if("undefined"==typeof Qb)throw Error("[goog.string.format] Not enough arguments");arguments[0]=Qb;return Q[F].apply(null,arguments)})},Q={s:function(a,b,c){return isNaN(c)||""==c||a.length>=c?a:a=-1<b.indexOf("-",0)?a+Array(c-
var ic=function(a){this.da=k.setTimeout(q(this.Nb,this),0);this.$=a};ic.prototype.Nb=function(){delete hc[this.da];throw this.$;};var hc={};var mc=function(a,b){var c=Array.prototype.slice.call(arguments),d=c.shift();if("undefined"==typeof d)throw Error("[goog.string.format] Template required");return d.replace(/%([0\-\ \+]*)(\d+)?(\.(\d+))?([%sfdiu])/g,function(a,b,d,l,I,F,S,T){if("%"==F)return"%";var Xb=c.shift();if("undefined"==typeof Xb)throw Error("[goog.string.format] Not enough arguments");arguments[0]=Xb;return P[F].apply(null,arguments)})},P={s:function(a,b,c){return isNaN(c)||""==c||a.length>=c?a:a=-1<b.indexOf("-",0)?a+Array(c- a.length+1).join(" "):Array(c-a.length+1).join(" ")+a},f:function(a,b,c,d,e){d=a.toString();isNaN(e)||""==e||(d=a.toFixed(e));var f;f=0>a?"-":0<=b.indexOf("+")?"+":0<=b.indexOf(" ")?" ":"";0<=a&&(d=f+d);if(isNaN(c)||d.length>=c)return d;d=isNaN(e)?Math.abs(a).toString():Math.abs(a).toFixed(e);a=c-d.length-f.length;return d=0<=b.indexOf("-",0)?f+d+Array(a+1).join(" "):f+Array(a+1).join(0<=b.indexOf("0",0)?"0":" ")+d},d:function(a,b,c,d,e,f,g,l){return Q.f(parseInt(a,10),b,c,d,0,f,g,l)}};Q.i=Q.d;
a.length+1).join(" "):Array(c-a.length+1).join(" ")+a},f:function(a,b,c,d,e){d=a.toString();isNaN(e)||""==e||(d=a.toFixed(e));var f;f=0>a?"-":0<=b.indexOf("+")?"+":0<=b.indexOf(" ")?" ":"";0<=a&&(d=f+d);if(isNaN(c)||d.length>=c)return d;d=isNaN(e)?Math.abs(a).toString():Math.abs(a).toFixed(e);a=c-d.length-f.length;return d=0<=b.indexOf("-",0)?f+d+Array(a+1).join(" "):f+Array(a+1).join(0<=b.indexOf("0",0)?"0":" ")+d},d:function(a,b,c,d,e,f,g,l){return P.f(parseInt(a,10),b,c,d,0,f,g,l)}};P.i=P.d; Q.u=Q.d;var ac=function(a){if("function"==typeof a.q)return a.q();if(n(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return ta(a)},bc=function(a,b){if("function"==typeof a.forEach)a.forEach(b,void 0);else if(da(a)||n(a))ka(a,b,void 0);else{var c;if("function"==typeof a.B)c=a.B();else if("function"!=typeof a.q)if(da(a)||n(a)){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=ua(a);else c=void 0;for(var d=ac(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],
P.u=P.d;var nc=function(a){if("function"==typeof a.q)return a.q();if(n(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return ua(a)},oc=function(a,b,c){if("function"==typeof a.forEach)a.forEach(b,c);else if(da(a)||n(a))ka(a,b,c);else{var d;if("function"==typeof a.C)d=a.C();else if("function"!=typeof a.q)if(da(a)||n(a)){d=[];for(var e=a.length,f=0;f<e;f++)d.push(f)}else d=va(a);else d=void 0;for(var e=nc(a),f=e.length,g=0;g<f;g++)b.call(c,e[g],d&&d[g],a)}};var Q=function(a){this.M=new w;this.Aa(arguments)};Q.prototype.set=function(a,b){this.M.set(a.name,{key:a,value:b})};Q.prototype.remove=function(a){this.M.remove(a.name)};Q.prototype.get=function(a){a=this.M.get(a.name,null);return null===a?null:a.value};Q.prototype.Aa=function(a){for(var b=0;b<a.length;b+=2)this.set(a[b],a[b+1])};var pc=function(a,b){ka(a.M.q(),function(a){b(a.key,a.value)})};Q.prototype.jb=function(){var a={};pc(this,function(b,c){a[b.id]=c});return a}; a)}};var R=function(a){this.M=new w;this.Ba(arguments)};R.prototype.set=function(a,b){this.M.set(a.name,{key:a,value:b})};R.prototype.remove=function(a){this.M.remove(a.name)};R.prototype.get=function(a){a=this.M.get(a.name,null);return null===a?null:a.value};R.prototype.Ba=function(a){for(var b=0;b<a.length;b+=2)this.set(a[b],a[b+1])};var cc=function(a,b){ka(a.M.q(),function(a){b(a.key,a.value)})};R.prototype.mb=function(){var a={};cc(this,function(b,c){a[b.id]=c});return a};
Q.prototype.B=function(){var a=new Q;a.M=this.M.B();return a};Q.prototype.toString=function(){var a={};pc(this,function(b,c){a[b.id]=c});return JSON.stringify(a)};var qc={id:"apiVersion",name:"v",valueType:"text",maxLength:void 0,defaultValue:void 0},rc={id:"appName",name:"an",valueType:"text",maxLength:100,defaultValue:void 0},sc={id:"appVersion",name:"av",valueType:"text",maxLength:100,defaultValue:void 0},tc={id:"clientId",name:"cid",valueType:"text",maxLength:void 0,defaultValue:void 0},uc={id:"language",name:"ul",valueType:"text",maxLength:20,defaultValue:void 0},vc={id:"libVersion",name:"_v",valueType:"text",maxLength:void 0,defaultValue:void 0},wc={id:"screenColors", R.prototype.clone=function(){var a=new R;a.M=this.M.clone();return a};R.prototype.toString=function(){var a={};cc(this,function(b,c){a[b.id]=c});return JSON.stringify(a)};var dc={id:"apiVersion",name:"v",valueType:"text",maxLength:void 0,defaultValue:void 0},ec={id:"appName",name:"an",valueType:"text",maxLength:100,defaultValue:void 0},fc={id:"appVersion",name:"av",valueType:"text",maxLength:100,defaultValue:void 0},gc={id:"clientId",name:"cid",valueType:"text",maxLength:void 0,defaultValue:void 0},hc={id:"language",name:"ul",valueType:"text",maxLength:20,defaultValue:void 0},ic={id:"libVersion",name:"_v",valueType:"text",maxLength:void 0,defaultValue:void 0},jc={id:"sampleRateOverride",
name:"sd",valueType:"text",maxLength:20,defaultValue:void 0},xc={id:"screenResolution",name:"sr",valueType:"text",maxLength:20,defaultValue:void 0},yc={id:"trackingId",name:"tid",valueType:"text",maxLength:void 0,defaultValue:void 0},zc={id:"viewportSize",name:"vp",valueType:"text",maxLength:20,defaultValue:void 0},Ac={kc:qc,nc:rc,oc:sc,wc:tc,Pc:uc,Qc:vc,Xc:wc,Yc:xc,kd:yc,qd:zc},Cc=function(a){if(!n(a))return a;var b=Bc(a,Da);if(ea(b))return b;b=Bc(a,Ac);if(ea(b))return b;b=/^dimension(\d+)$/.exec(a); name:"usro",valueType:"integer",maxLength:void 0,defaultValue:void 0},kc={id:"screenColors",name:"sd",valueType:"text",maxLength:20,defaultValue:void 0},lc={id:"screenResolution",name:"sr",valueType:"text",maxLength:20,defaultValue:void 0},mc={id:"trackingId",name:"tid",valueType:"text",maxLength:void 0,defaultValue:void 0},nc={id:"viewportSize",name:"vp",valueType:"text",maxLength:20,defaultValue:void 0},oc={qc:dc,tc:ec,uc:fc,Cc:gc,Vc:hc,Wc:ic,cd:jc,dd:kc,ed:lc,rd:mc,yd:nc},qc=function(a){if(!n(a))return a;
if(null!==b)return{id:a,name:"cd"+b[1],valueType:"text",maxLength:150,defaultValue:void 0};b=/^metric(\d+)$/.exec(a);if(null!==b)return{id:a,name:"cm"+b[1],valueType:"integer",maxLength:void 0,defaultValue:void 0};throw Error(a+" is not a valid parameter name.");},Bc=function(a,b){var c=wa(b,function(b){return b.id==a&&"metric"!=a&&"dimension"!=a});return ea(c)?c:null};var Dc=function(a,b){this.n=a;this.v=b};Dc.prototype.send=function(a,b){b.set(tc,this.n.xa);return this.v.send(a,b)};var R=function(){};R.Lb=function(){return R.nb?R.nb:R.nb=new R};R.prototype.send=function(){return jc()};var U=function(a,b){D.call(this,"a");this.Sb=a;this.Ob=b};t(U,D);U.prototype.$b=function(){return this.Sb};U.prototype.Zb=function(){return this.Ob.jb()};var Ec=function(a,b){this.Ha=a;this.v=b};Ec.prototype.send=function(a,b){this.Ha.dispatchEvent(new U(a,b));return this.v.send(a,b)};var Fc=function(a){this.v=a};Fc.prototype.send=function(a,b){Gc(b);Hc(b);return this.v.send(a,b)};var Gc=function(a){pc(a,function(b,c){void 0!==b.maxLength&&"text"==b.valueType&&0<b.maxLength&&c.length>b.maxLength&&a.set(b,c.substring(0,b.maxLength))})},Hc=function(a){pc(a,function(b,c){void 0!==b.defaultValue&&c==b.defaultValue&&a.remove(b)})};var kc={status:"device-offline",pa:void 0},Ic={status:"rate-limited",pa:void 0},Jc={status:"sampled-out",pa:void 0},Kc={status:"sent",pa:void 0};var Lc=function(a,b){this.yb=a;this.v=b};Lc.prototype.send=function(a,b){var c;c=this.yb;var d=c.Ua(),e=Math.floor((d-c.Ta)*c.vb);0<e&&(c.T=Math.min(c.T+e,c.wb),c.Ta=d);1>c.T?c=!1:(c.T-=1,c=!0);return c||"item"==a||"transaction"==a?this.v.send(a,b):jc(Ic)};var Mc=function(a){this.Pb=a};Mc.prototype.send=function(a,b){this.Pb.push({tb:a,ub:b});return jc()};var Nc=function(a,b,c){this.n=a;this.ka=[];this.I={enabled:new Mc(this.ka),disabled:c};this.P=this.I.enabled;O(fc(this.n.aa),ha(this.sb,b),this.rb,this)};Nc.prototype.sb=function(a){this.I.enabled=a(this.n);Oc(this);ka(this.ka,function(a){this.send(a.tb,a.ub)},this);this.ka=null;Pc(this.n,q(this.xb,this))};Nc.prototype.rb=function(){this.P=this.I.enabled=this.I.disabled;this.ka=null};Nc.prototype.send=function(a,b){return this.P.send(a,b)};var Oc=function(a){a.P=a.n.ab()?a.I.enabled:a.I.disabled}; var b=pc(a,Ca);if(ea(b))return b;b=pc(a,oc);if(ea(b))return b;b=/^dimension(\d+)$/.exec(a);if(null!==b)return{id:a,name:"cd"+b[1],valueType:"text",maxLength:150,defaultValue:void 0};b=/^metric(\d+)$/.exec(a);if(null!==b)return{id:a,name:"cm"+b[1],valueType:"integer",maxLength:void 0,defaultValue:void 0};throw Error(a+" is not a valid parameter name.");},pc=function(a,b){var c=va(b,function(b){return b.id==a&&"metric"!=a&&"dimension"!=a});return ea(c)?c:null};var rc=function(a,b){this.k=a;this.w=b};rc.prototype.send=function(a,b){b.set(gc,this.k.ea);return this.w.send(a,b)};var U=function(){};U.Sb=function(){return U.qb?U.qb:U.qb=new U};U.prototype.send=function(){return Xb()};var V=function(a,b){E.call(this,"a");this.Zb=a;this.Vb=b};t(V,E);V.prototype.fc=function(){return this.Zb};V.prototype.ec=function(){return this.Vb.mb()};var sc=function(a,b){this.Ma=a;this.w=b};sc.prototype.send=function(a,b){this.Ma.dispatchEvent(new V(a,b));return this.w.send(a,b)};var tc=function(a){this.w=a};tc.prototype.send=function(a,b){uc(b);vc(b);return this.w.send(a,b)};var uc=function(a){cc(a,function(b,c){void 0!==b.maxLength&&"text"==b.valueType&&0<b.maxLength&&c.length>b.maxLength&&a.set(b,c.substring(0,b.maxLength))})},vc=function(a){cc(a,function(b,c){void 0!==b.defaultValue&&c==b.defaultValue&&a.remove(b)})};var Yb={status:"device-offline",qa:void 0},wc={status:"rate-limited",qa:void 0},xc={status:"sampled-out",qa:void 0},yc={status:"sent",qa:void 0};var zc=function(a,b){this.Eb=a;this.w=b};zc.prototype.send=function(a,b){var c;c=this.Eb;var d=c.ab(),e=Math.floor((d-c.$a)*c.Bb);0<e&&(c.U=Math.min(c.U+e,c.Cb),c.$a=d);1>c.U?c=!1:(c.U-=1,c=!0);return c||"item"==a||"transaction"==a?this.w.send(a,b):Xb(wc)};var Ac=function(a){this.Wb=a};Ac.prototype.send=function(a,b){this.Wb.push({zb:a,Ab:b});return Xb()};var Bc=function(a,b,c){this.k=a;this.la=[];this.J={enabled:new Ac(this.la),disabled:c};this.R=this.J.enabled;P(Tb(this.k.ya),ha(this.yb,b),this.xb,this)};Bc.prototype.yb=function(a){this.J.enabled=a(this.k);Cc(this);ka(this.la,function(a){this.send(a.zb,a.Ab)},this);this.la=null;Dc(this.k,q(this.Db,this))};Bc.prototype.xb=function(){this.R=this.J.enabled=this.J.disabled;this.la=null};Bc.prototype.send=function(a,b){return this.R.send(a,b)};var Cc=function(a){a.R=a.k.pa()?a.J.enabled:a.J.disabled};
Nc.prototype.xb=function(a){switch(a){case "analytics.tracking-permitted":Oc(this)}};var V=function(a,b){this.P=a;this.Ha=b;this.cb=new Q;this.Ia=!1};h=V.prototype;h.set=function(a,b){var c=Cc(a);this.cb.set(c,b)};h.send=function(a,b){var c=this.cb.B();b&&ta(b,function(a,b){null!=a&&c.set(Cc(b),a)},this);this.Ia&&(this.Ia=!1,c.set(Ba,"start"));return this.P.send(a,c)};h.bc=function(a){var b={description:a};this.set(Ca,a);return this.send("appview",b)};h.cc=function(a,b,c,d){return this.send("event",{eventCategory:a,eventAction:b,eventLabel:c,eventValue:d})}; Bc.prototype.Db=function(a){switch(a){case "analytics.tracking-permitted":Cc(this)}};var W=function(a,b){this.R=a;this.Ma=b;this.kb=new R;this.Na=!1};h=W.prototype;h.set=function(a,b){var c=qc(a);this.kb.set(c,b)};h.send=function(a,b){var c=this.kb.clone();b&&sa(b,function(a,b){null!=a&&c.set(qc(b),a)},this);this.Na&&(this.Na=!1,c.set(Aa,"start"));return this.R.send(a,c)};h.hc=function(a){var b={description:a};this.set(Ba,a);return this.send("appview",b)};h.ic=function(a,b,c,d){return this.send("event",{eventCategory:a,eventAction:b,eventLabel:c,eventValue:d})};
h.ec=function(a,b,c){return this.send("social",{socialNetwork:a,socialAction:b,socialTarget:c})};h.dc=function(a,b){return this.send("exception",{exDescription:a,exFatal:b})};h.hb=function(a,b,c,d){return this.send("timing",{timingCategory:a,timingVar:b,timingLabel:d,timingValue:c})};h.Wb=function(){this.Ia=!0};h.hc=function(a,b,c){return new Qc(this,a,b,c)};h.Yb=function(){return this.Ha};var Qc=function(a,b,c,d){this.eb=a;this.Gb=b;this.Kb=c;this.Hb=d;this.Jb=r()}; h.kc=function(a,b,c){return this.send("social",{socialNetwork:a,socialAction:b,socialTarget:c})};h.jc=function(a,b){return this.send("exception",{exDescription:a,exFatal:b})};h.jb=function(a,b,c,d,e){return this.send("timing",{timingCategory:a,timingVar:b,timingLabel:d,timingValue:c,sampleRateOverride:e})};h.bc=function(){this.Na=!0};h.nc=function(a,b,c,d){return new Ec(this,a,b,c,d)};h.dc=function(){return this.Ma};
Qc.prototype.send=function(){var a=this.eb.hb(this.Gb,this.Kb,r()-this.Jb,this.Hb);this.eb=null;return a};var Rc=function(){this.T=60;this.wb=500;this.vb=5E-4;this.Ua=function(){return(new Date).getTime()};this.Ta=this.Ua()};var Sc=function(a,b){this.n=a;this.v=b};Sc.prototype.send=function(a,b){var c=b.get(tc);return parseInt(c.split("-")[1],16)<655.36*this.n.Sa?this.v.send(a,b):jc(Jc)};var Tc=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),Uc=B,Vc=function(a,b){if(Uc){Uc=!1;var c=k.location;if(c){var d=c.href;if(d&&(d=(d=Vc(3,d))&&decodeURIComponent(d))&&d!=c.hostname)throw Uc=!0,Error();}}return b.match(Tc)[a]||null};var Wc=function(){};Wc.prototype.kb=null;var Yc=function(a){var b;(b=a.kb)||(b={},Xc(a)&&(b[0]=!0,b[1]=!0),b=a.kb=b);return b};var Zc,$c=function(){};t($c,Wc);var ad=function(a){return(a=Xc(a))?new ActiveXObject(a):new XMLHttpRequest},Xc=function(a){if(!a.mb&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.mb=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.mb};Zc=new $c;var W=function(a){H.call(this);this.headers=new w;this.Z=a||null;this.w=!1;this.W=this.a=null;this.V=this.ra="";this.D=this.qa=this.U=this.ta=!1;this.Y=0;this.X=null;this.Ka="";this.sa=this.pb=!1};t(W,H);var bd=/^https?$/i,cd=["POST","PUT"],dd=[],ed=function(a,b,c){var d=new W;dd.push(d);b&&d.listen("complete",b);d.Ja("ready",d.Qb);d.send(a,"POST",c,void 0)};W.prototype.Qb=function(){this.na();oa(dd,this)}; var Ec=function(a,b,c,d,e){this.ib=a;this.Hb=b;this.Kb=c;this.Ib=d;this.O=e;this.Jb=r()};Ec.prototype.send=function(){var a=this.ib.jb(this.Hb,this.Kb,r()-this.Jb,this.Ib,this.O);this.ib=null;return a};var Fc=function(){this.U=60;this.Cb=500;this.Bb=5E-4;this.ab=function(){return(new Date).getTime()};this.$a=this.ab()};var Gc=function(a,b){this.k=a;this.w=b};Gc.prototype.send=function(a,b){var c=b.get(gc),c=parseInt(c.split("-")[1],16),d;"timing"!=a?d=this.k.O:((d=b.get(jc))&&b.remove(jc),d||(d=this.k.O));return c<655.36*d?this.w.send(a,b):Xb(xc)};var Hc=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/,Ic=C,Jc=function(a,b){if(Ic){Ic=!1;var c=k.location;if(c){var d=c.href;if(d&&(d=(d=Jc(3,d))&&decodeURIComponent(d))&&d!=c.hostname)throw Ic=!0,Error();}}return b.match(Hc)[a]||null};var Kc=function(){};Kc.prototype.nb=null;var Mc=function(a){var b;(b=a.nb)||(b={},Lc(a)&&(b[0]=!0,b[1]=!0),b=a.nb=b);return b};var Nc,Oc=function(){};t(Oc,Kc);var Pc=function(a){return(a=Lc(a))?new ActiveXObject(a):new XMLHttpRequest},Lc=function(a){if(!a.pb&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.pb=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.pb};Nc=new Oc;var X=function(a){J.call(this);this.headers=new w;this.$=a||null;this.A=!1;this.X=this.a=null;this.W=this.sa="";this.H=this.ra=this.V=this.ua=!1;this.Z=0;this.Y=null;this.Pa="";this.ta=this.sb=!1};t(X,J);var Qc=/^https?$/i,Rc=["POST","PUT"],Sc=[],Tc=function(a,b,c){var d=new X;Sc.push(d);b&&d.listen("complete",b);d.Oa("ready",d.Xb);d.send(a,"POST",c,void 0)};X.prototype.Xb=function(){this.na();oa(Sc,this)};
W.prototype.send=function(a,b,c,d){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.ra+"; newUri="+a);b=b?b.toUpperCase():"GET";this.ra=a;this.V="";this.ta=!1;this.w=!0;this.a=this.Z?ad(this.Z):ad(Zc);this.W=this.Z?Yc(this.Z):Yc(Zc);this.a.onreadystatechange=q(this.La,this);try{this.qa=!0,this.a.open(b,String(a),!0),this.qa=!1}catch(e){this.$(5,e);return}a=c||"";var f=this.headers.B();d&&oc(d,function(a,b){f.set(b,a)});d=na(f.C());c=k.FormData&&a instanceof k.FormData; X.prototype.send=function(a,b,c,d){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.sa+"; newUri="+a);b=b?b.toUpperCase():"GET";this.sa=a;this.W="";this.ua=!1;this.A=!0;this.a=this.$?Pc(this.$):Pc(Nc);this.X=this.$?Mc(this.$):Mc(Nc);this.a.onreadystatechange=q(this.Qa,this);try{this.ra=!0,this.a.open(b,String(a),!0),this.ra=!1}catch(e){this.aa(5,e);return}a=c||"";var f=this.headers.clone();d&&bc(d,function(a,b){f.set(b,a)});d=na(f.B());c=k.FormData&&a instanceof
!(0<=ja(cd,b))||d||c||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");oc(f,function(a,b){this.a.setRequestHeader(b,a)},this);this.Ka&&(this.a.responseType=this.Ka);"withCredentials"in this.a&&(this.a.withCredentials=this.pb);try{fd(this),0<this.Y&&((this.sa=gd(this.a))?(this.a.timeout=this.Y,this.a.ontimeout=q(this.Ma,this)):this.X=Cb(this.Ma,this.Y,this)),this.U=!0,this.a.send(a),this.U=!1}catch(g){this.$(5,g)}}; k.FormData;!(0<=ja(Rc,b))||d||c||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");f.forEach(function(a,b){this.a.setRequestHeader(b,a)},this);this.Pa&&(this.a.responseType=this.Pa);"withCredentials"in this.a&&(this.a.withCredentials=this.sb);try{Uc(this),0<this.Z&&((this.ta=Vc(this.a))?(this.a.timeout=this.Z,this.a.ontimeout=q(this.Ra,this)):this.Y=rb(this.Ra,this.Z,this)),this.V=!0,this.a.send(a),this.V=!1}catch(g){this.aa(5,g)}};
var gd=function(a){return z&&C(9)&&"number"==typeof a.timeout&&void 0!==a.ontimeout},ma=function(a){return"content-type"==a.toLowerCase()};W.prototype.Ma=function(){"undefined"!=typeof aa&&this.a&&(this.V="Timed out after "+this.Y+"ms, aborting",this.dispatchEvent("timeout"),this.abort(8))};W.prototype.$=function(a,b){this.w=!1;this.a&&(this.D=!0,this.a.abort(),this.D=!1);this.V=b;hd(this);id(this)};var hd=function(a){a.ta||(a.ta=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))}; var Vc=function(a){return A&&D(9)&&"number"==typeof a.timeout&&void 0!==a.ontimeout},ma=function(a){return"content-type"==a.toLowerCase()};X.prototype.Ra=function(){"undefined"!=typeof aa&&this.a&&(this.W="Timed out after "+this.Z+"ms, aborting",this.dispatchEvent("timeout"),this.abort(8))};X.prototype.aa=function(a,b){this.A=!1;this.a&&(this.H=!0,this.a.abort(),this.H=!1);this.W=b;Wc(this);Xc(this)};var Wc=function(a){a.ua||(a.ua=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))};
W.prototype.abort=function(){this.a&&this.w&&(this.w=!1,this.D=!0,this.a.abort(),this.D=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),id(this))};W.prototype.j=function(){this.a&&(this.w&&(this.w=!1,this.D=!0,this.a.abort(),this.D=!1),id(this,!0));W.J.j.call(this)};W.prototype.La=function(){this.Ga||(this.qa||this.U||this.D?jd(this):this.Bb())};W.prototype.Bb=function(){jd(this)}; X.prototype.abort=function(){this.a&&this.A&&(this.A=!1,this.H=!0,this.a.abort(),this.H=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Xc(this))};X.prototype.j=function(){this.a&&(this.A&&(this.A=!1,this.H=!0,this.a.abort(),this.H=!1),Xc(this,!0));X.I.j.call(this)};X.prototype.Qa=function(){this.Ka||(this.ra||this.V||this.H?Yc(this):this.Mb())};X.prototype.Mb=function(){Yc(this)};
var jd=function(a){if(a.w&&"undefined"!=typeof aa&&(!a.W[1]||4!=kd(a)||2!=ld(a)))if(a.U&&4==kd(a))Cb(a.La,0,a);else if(a.dispatchEvent("readystatechange"),4==kd(a)){a.w=!1;try{var b=ld(a),c,d;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:d=!0;break t;default:d=!1}if(!(c=d)){var e;if(e=0===b){var f=Vc(1,String(a.ra));if(!f&&self.location)var g=self.location.protocol,f=g.substr(0,g.length-1);e=!bd.test(f?f.toLowerCase():"")}c=e}if(c)a.dispatchEvent("complete"),a.dispatchEvent("success"); var Yc=function(a){if(a.A&&"undefined"!=typeof aa&&(!a.X[1]||4!=Zc(a)||2!=$c(a)))if(a.V&&4==Zc(a))rb(a.Qa,0,a);else if(a.dispatchEvent("readystatechange"),4==Zc(a)){a.A=!1;try{var b=$c(a),c,d;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:d=!0;break t;default:d=!1}if(!(c=d)){var e;if(e=0===b){var f=Jc(1,String(a.sa));if(!f&&self.location)var g=self.location.protocol,f=g.substr(0,g.length-1);e=!Qc.test(f?f.toLowerCase():"")}c=e}if(c)a.dispatchEvent("complete"),a.dispatchEvent("success");
else{var l;try{l=2<kd(a)?a.a.statusText:""}catch(I){l=""}a.V=l+" ["+ld(a)+"]";hd(a)}}finally{id(a)}}},id=function(a,b){if(a.a){fd(a);var c=a.a,d=a.W[0]?ba:null;a.a=null;a.W=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},fd=function(a){a.a&&a.sa&&(a.a.ontimeout=null);"number"==typeof a.X&&(k.clearTimeout(a.X),a.X=null)},kd=function(a){return a.a?a.a.readyState:0},ld=function(a){try{return 2<kd(a)?a.a.status:-1}catch(b){return-1}};var md=function(a,b,c){this.p=a||null;this.Mb=!!c},Y=function(a){if(!a.c&&(a.c=new w,a.g=0,a.p))for(var b=a.p.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null,f=null;0<=d?(e=b[c].substring(0,d),f=b[c].substring(d+1)):e=b[c];e=decodeURIComponent(e.replace(/\+/g," "));e=X(a,e);a.add(e,f?decodeURIComponent(f.replace(/\+/g," ")):"")}};h=md.prototype;h.c=null;h.g=null;h.add=function(a,b){Y(this);this.p=null;a=X(this,a);var c=this.c.get(a);c||this.c.set(a,c=[]);c.push(b);this.g++;return this}; else{var l;try{l=2<Zc(a)?a.a.statusText:""}catch(I){l=""}a.W=l+" ["+$c(a)+"]";Wc(a)}}finally{Xc(a)}}},Xc=function(a,b){if(a.a){Uc(a);var c=a.a,d=a.X[0]?ba:null;a.a=null;a.X=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},Uc=function(a){a.a&&a.ta&&(a.a.ontimeout=null);"number"==typeof a.Y&&(k.clearTimeout(a.Y),a.Y=null)},Zc=function(a){return a.a?a.a.readyState:0},$c=function(a){try{return 2<Zc(a)?a.a.status:-1}catch(b){return-1}};var ad=function(a,b,c){this.p=a||null;this.Tb=!!c},Z=function(a){if(!a.c&&(a.c=new w,a.g=0,a.p))for(var b=a.p.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null,f=null;0<=d?(e=b[c].substring(0,d),f=b[c].substring(d+1)):e=b[c];e=decodeURIComponent(e.replace(/\+/g," "));e=Y(a,e);a.add(e,f?decodeURIComponent(f.replace(/\+/g," ")):"")}};h=ad.prototype;h.c=null;h.g=null;h.add=function(a,b){Z(this);this.p=null;a=Y(this,a);var c=this.c.get(a);c||this.c.set(a,c=[]);c.push(b);this.g++;return this};
h.remove=function(a){Y(this);a=X(this,a);return this.c.Q(a)?(this.p=null,this.g-=this.c.get(a).length,this.c.remove(a)):!1};h.Q=function(a){Y(this);a=X(this,a);return this.c.Q(a)};h.C=function(){Y(this);for(var a=this.c.q(),b=this.c.C(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};h.q=function(a){Y(this);var b=[];if(n(a))this.Q(a)&&(b=pa(b,this.c.get(X(this,a))));else{a=this.c.q();for(var c=0;c<a.length;c++)b=pa(b,a[c])}return b}; h.remove=function(a){Z(this);a=Y(this,a);return this.c.Q(a)?(this.p=null,this.g-=this.c.get(a).length,this.c.remove(a)):!1};h.Q=function(a){Z(this);a=Y(this,a);return this.c.Q(a)};h.B=function(){Z(this);for(var a=this.c.q(),b=this.c.B(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};h.q=function(a){Z(this);var b=[];if(n(a))this.Q(a)&&(b=pa(b,this.c.get(Y(this,a))));else{a=this.c.q();for(var c=0;c<a.length;c++)b=pa(b,a[c])}return b};
h.set=function(a,b){Y(this);this.p=null;a=X(this,a);this.Q(a)&&(this.g-=this.c.get(a).length);this.c.set(a,[b]);this.g++;return this};h.get=function(a,b){var c=a?this.q(a):[];return 0<c.length?String(c[0]):b};h.toString=function(){if(this.p)return this.p;if(!this.c)return"";for(var a=[],b=this.c.C(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.q(d),f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="="+encodeURIComponent(String(d[f])));a.push(g)}return this.p=a.join("&")}; h.set=function(a,b){Z(this);this.p=null;a=Y(this,a);this.Q(a)&&(this.g-=this.c.get(a).length);this.c.set(a,[b]);this.g++;return this};h.get=function(a,b){var c=a?this.q(a):[];return 0<c.length?String(c[0]):b};h.toString=function(){if(this.p)return this.p;if(!this.c)return"";for(var a=[],b=this.c.B(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.q(d),f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="="+encodeURIComponent(String(d[f])));a.push(g)}return this.p=a.join("&")};
h.B=function(){var a=new md;a.p=this.p;this.c&&(a.c=this.c.B(),a.g=this.g);return a};var X=function(a,b){var c=String(b);a.Mb&&(c=c.toLowerCase());return c};var nd=function(a,b){this.Ab=a;this.bb=b};nd.prototype.send=function(a,b){if(ab&&!navigator.onLine)return lc();var c=new N,d=od(a,b);d.length>this.bb?c.A({status:"payload-too-big",pa:mc("Encoded hit length == %s, but should be <= %s.",d.length,this.bb)}):ed(this.Ab,function(){c.G(Kc)},d);return c};var od=function(a,b){var c=new md;c.add(Aa.name,a);pc(b,function(a,b){c.add(a.name,b.toString())});return c.toString()};var Z=function(a,b,c,d){this.Ib=a;this.Eb=b;this.Fb=c;this.n=d},pd;Z.prototype.ac=function(a){var b=new H,b=new V(qd(this,b),b);b.set(vc,this.Ib);b.set(qc,1);b.set(rc,this.Eb);b.set(sc,this.Fb);b.set(yc,a);a=window.navigator.language;b.set(uc,a);a=screen.colorDepth+"-bit";b.set(wc,a);a=[screen.width,screen.height].join("x");b.set(xc,a);a=window.document;a="CSS1Compat"==a.compatMode?a.documentElement:a.body;a=new Ea(a.clientWidth,a.clientHeight);a=[a.width,a.height].join("x");b.set(zc,a);return b}; h.clone=function(){var a=new ad;a.p=this.p;this.c&&(a.c=this.c.clone(),a.g=this.g);return a};var Y=function(a,b){var c=String(b);a.Tb&&(c=c.toLowerCase());return c};var bd=function(a,b){this.Gb=a;this.fb=b};bd.prototype.send=function(a,b){if(Qa&&!navigator.onLine)return Zb();var c=new O,d=cd(a,b);d.length>this.fb?c.t({status:"payload-too-big",qa:$b("Encoded hit length == %s, but should be <= %s.",d.length,this.fb)}):Tc(this.Gb,function(){c.C(yc)},d);return c};var cd=function(a,b){var c=new ad;c.add(za.name,a);cc(b,function(a,b){c.add(a.name,b.toString())});return c.toString()};var dd=function(a,b,c,d){this.Qb=a;this.Ob=b;this.Pb=c;this.k=d},ed;dd.prototype.gc=function(a){var b=new J,b=new W(fd(this,b),b);b.set(ic,this.Qb);b.set(dc,1);b.set(ec,this.Ob);b.set(fc,this.Pb);b.set(mc,a);a=window.navigator.language;b.set(hc,a);a=screen.colorDepth+"-bit";b.set(kc,a);a=[screen.width,screen.height].join("x");b.set(lc,a);a=window.document;a="CSS1Compat"==a.compatMode?a.documentElement:a.body;a=new Da(a.clientWidth,a.clientHeight);a=[a.width,a.height].join("x");b.set(nc,a);return b};
var qd=function(a,b){return new Nc(a.n,function(a){if(!pd){new K;var d=new Fc(new nd("https://www.google-analytics.com/collect",8192)),e=new Rc;pd=new Dc(a,new Sc(a,new Lc(e,d)))}return new Ec(b,pd)},R.Lb())};Z.prototype.Xb=function(){return fc(this.n.aa)};var $=function(a){this.F=a;this.Sa=100;this.Va=[];this.aa=new N;this.ma=this.xa=null;rd(this)},rd=function(a){O(a.F.get("analytics.tracking-permitted"),function(a){this.ma=void 0!==a?a:!0;this.fb()},a.gb,a);O(sd(a),a.fb,a.gb,a)};$.prototype.gb=function(a){this.aa.A(a)};$.prototype.fb=function(){null===this.ma||null===this.xa||this.aa.G(this)};var Pc=function(a,b){a.Va.push(b)}; var fd=function(a,b){return new Bc(a.k,function(a){if(!ed){new L;var d=new tc(new bd("https://www.google-analytics.com/collect",8192)),e=new Fc;ed=new rc(a,new Gc(a,new zc(e,d)))}return new sc(b,ed)},U.Sb())};dd.prototype.cc=function(){return Tb(this.k.ya)};var gd=function(a,b,c,d,e,f){O.call(this,e,f);this.Ca=a;this.Da=[];this.Xa=!!b;this.vb=!!c;this.ub=!!d;for(b=this.Ya=0;b<a.length;b++)P(a[b],q(this.bb,this,b,!0),q(this.bb,this,b,!1));0!=a.length||this.Xa||this.C(this.Da)};t(gd,O);gd.prototype.bb=function(a,b,c){this.Ya++;this.Da[a]=[b,c];this.G||(this.Xa&&b?this.C([a,c]):this.vb&&!b?this.t(c):this.Ya==this.Ca.length&&this.C(this.Da));this.ub&&!b&&(c=null);return c};gd.prototype.t=function(a){gd.I.t.call(this,a);for(a=0;a<this.Ca.length;a++)this.Ca[a].cancel()};
$.prototype.gc=function(a){ec(this.F.set("analytics.tracking-permitted",a),function(){this.ma=a;ka(this.Va,function(a){a("analytics.tracking-permitted")})},this)};$.prototype.ab=function(){var a;if(a=this.ma)a=k._gaUserPrefs,a=!(a&&a.ioo&&a.ioo());return a};$.prototype.fc=function(a){this.Sa=a}; var hd=function(a){return(new gd(a,!1,!0)).F(function(a){for(var c=[],d=0;d<a.length;d++)c[d]=a[d][1];return c})};var $=function(a){this.D=a;this.O=100;this.Za=[];this.Ea=this.ea=null;this.ya=id(this);this.ya.F(function(){cb(this.D,"b",q(this.wb,this))},this)},id=function(a){return jd(a).F(function(){return this},a)},jd=function(a){return hd([kd(a),ld(a)])};$.prototype.wb=function(){var a=this.ea,b=this.pa();jd(this).F(function(){if(a!=this.ea)throw Error("User ID changed unexpectedly!");b!=this.pa()&&md(this)},this)};var Dc=function(a,b){a.Za.push(b)};
var sd=function(a){var b=new N;O(a.F.get("analytics.user-id"),function(a){if(!a){a="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".split("");for(var d=0,e=a.length;d<e;d++)switch(a[d]){case "x":a[d]=Math.floor(16*Math.random()).toString(16);break;case "y":a[d]=(Math.floor(4*Math.random())+8).toString(16)}a=a.join("");this.F.set("analytics.user-id",a)}this.xa=a;b.G()},function(a){b.A(a)},a);return b};var td=function(a,b){if(!ea(a))throw Error("'storage' argument must be defined and not null.");this.F=a;this.Xa=b||""};td.prototype.get=function(a){var b=new N,c=this.Xa+"."+a;this.F.get(c,function(a){var e=chrome.runtime.lastError;e?b.A(e):b.G(a[c])});return b};td.prototype.set=function(a,b){var c=new N,d={};d[this.Xa+"."+a]=b;this.F.set(d,function(){var a=chrome.runtime.lastError;a?c.A(a):c.G()});return c};var ud=new w;s("goog.async.Deferred",N);s("goog.async.Deferred.prototype.addCallback",N.prototype.Ub);s("goog.events.EventTarget",H);s("goog.events.EventTarget.prototype.listen",H.prototype.listen);s("analytics.getService",function(a){var b=ud.get(a,null);if(null===b){var b=chrome.runtime.getManifest().version,c;c=new td(chrome.storage.local,"google-analytics");c=new $(c);b=new Z("ca3",a,b,c);ud.set(a,b)}return b});s("analytics.internal.GoogleAnalyticsService",Z); $.prototype.mc=function(a){this.D.set("analytics.tracking-permitted",a).F(function(){this.Ea=a},this)};$.prototype.pa=function(){var a;if(a=this.Ea)a=k._gaUserPrefs,a=!(a&&a.ioo&&a.ioo());return a};
s("analytics.internal.GoogleAnalyticsService.prototype.getTracker",Z.prototype.ac);s("analytics.internal.GoogleAnalyticsService.prototype.getConfig",Z.prototype.Xb);s("analytics.internal.ServiceSettings",$);s("analytics.internal.ServiceSettings.prototype.setTrackingPermitted",$.prototype.gc);s("analytics.internal.ServiceSettings.prototype.isTrackingPermitted",$.prototype.ab);s("analytics.internal.ServiceSettings.prototype.setSampleRate",$.prototype.fc);s("analytics.internal.ServiceTracker",V); var kd=function(a){return a.D.get("analytics.tracking-permitted").F(function(a){this.Ea=void 0!==a?a:!0},a)},ld=function(a){return a.D.get("analytics.user-id").F(function(a){if(!a){a="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".split("");for(var c=0,d=a.length;c<d;c++)switch(a[c]){case "x":a[c]=Math.floor(16*Math.random()).toString(16);break;case "y":a[c]=(Math.floor(4*Math.random())+8).toString(16)}a=a.join("");this.D.set("analytics.user-id",a)}this.ea=a},a)};$.prototype.lc=function(a){this.O=a};
s("analytics.internal.ServiceTracker.prototype.send",V.prototype.send);s("analytics.internal.ServiceTracker.prototype.sendAppView",V.prototype.bc);s("analytics.internal.ServiceTracker.prototype.sendEvent",V.prototype.cc);s("analytics.internal.ServiceTracker.prototype.sendSocial",V.prototype.ec);s("analytics.internal.ServiceTracker.prototype.sendException",V.prototype.dc);s("analytics.internal.ServiceTracker.prototype.sendTiming",V.prototype.hb); var md=function(a){ka(a.Za,function(a){a("analytics.tracking-permitted")})};var nd=function(a){J.call(this);this.La=a;this.D=chrome.storage.local;chrome.storage.onChanged.addListener(q(this.Rb,this))};t(nd,J);nd.prototype.Rb=function(a){od(this,a)&&this.dispatchEvent("b")};var od=function(a,b){return la(ua(b),function(a){return 0==a.lastIndexOf(this.La,0)},a)};nd.prototype.get=function(a){var b=new O,c=this.La+"."+a;this.D.get(c,function(a){var e=chrome.runtime.lastError;e?b.t(e):b.C(a[c])});return b};
s("analytics.internal.ServiceTracker.prototype.startTiming",V.prototype.hc);s("analytics.internal.ServiceTracker.Timing",Qc);s("analytics.internal.ServiceTracker.Timing.prototype.send",Qc.prototype.send);s("analytics.internal.ServiceTracker.prototype.forceSessionStart",V.prototype.Wb);s("analytics.internal.ServiceTracker.prototype.getEventTarget",V.prototype.Yb);s("analytics.HitTypes.APPVIEW","appview");s("analytics.HitTypes.EVENT","event");s("analytics.HitTypes.SOCIAL","social"); nd.prototype.set=function(a,b){var c=new O,d={};d[this.La+"."+a]=b;this.D.set(d,function(){var a=chrome.runtime.lastError;a?c.t(a):c.C()});return c};var pd=new w;s("goog.async.Deferred",O);s("goog.async.Deferred.prototype.addCallback",O.prototype.F);s("goog.events.EventTarget",J);s("goog.events.EventTarget.prototype.listen",J.prototype.listen);s("analytics.getService",function(a){var b=pd.get(a,null);if(null===b){var b=chrome.runtime.getManifest().version,c;c=new nd("google-analytics");c=new $(c);b=new dd("ca1.4.0",a,b,c);pd.set(a,b)}return b});s("analytics.internal.GoogleAnalyticsService",dd);
s("analytics.HitTypes.TRANSACTION","transaction");s("analytics.HitTypes.ITEM","item");s("analytics.HitTypes.TIMING","timing");s("analytics.HitTypes.EXCEPTION","exception");s("analytics.Tracker.HitEvent",U);s("analytics.Tracker.HitEvent.EVENT_TYPE","a");s("analytics.Tracker.HitEvent.prototype.getHitType",U.prototype.$b);s("analytics.Tracker.HitEvent.prototype.getHit",U.prototype.Zb);ta(Da,function(a){var b=a.id.replace(/[A-Z]/,"_$&").toUpperCase();s("analytics.Parameters."+b,a)}); })() s("analytics.internal.GoogleAnalyticsService.prototype.getTracker",dd.prototype.gc);s("analytics.internal.GoogleAnalyticsService.prototype.getConfig",dd.prototype.cc);s("analytics.internal.ServiceSettings",$);s("analytics.internal.ServiceSettings.prototype.setTrackingPermitted",$.prototype.mc);s("analytics.internal.ServiceSettings.prototype.isTrackingPermitted",$.prototype.pa);s("analytics.internal.ServiceSettings.prototype.setSampleRate",$.prototype.lc);s("analytics.internal.ServiceTracker",W);
s("analytics.internal.ServiceTracker.prototype.send",W.prototype.send);s("analytics.internal.ServiceTracker.prototype.sendAppView",W.prototype.hc);s("analytics.internal.ServiceTracker.prototype.sendEvent",W.prototype.ic);s("analytics.internal.ServiceTracker.prototype.sendSocial",W.prototype.kc);s("analytics.internal.ServiceTracker.prototype.sendException",W.prototype.jc);s("analytics.internal.ServiceTracker.prototype.sendTiming",W.prototype.jb);
s("analytics.internal.ServiceTracker.prototype.startTiming",W.prototype.nc);s("analytics.internal.ServiceTracker.Timing",Ec);s("analytics.internal.ServiceTracker.Timing.prototype.send",Ec.prototype.send);s("analytics.internal.ServiceTracker.prototype.forceSessionStart",W.prototype.bc);s("analytics.internal.ServiceTracker.prototype.getEventTarget",W.prototype.dc);s("analytics.HitTypes.APPVIEW","appview");s("analytics.HitTypes.EVENT","event");s("analytics.HitTypes.SOCIAL","social");
s("analytics.HitTypes.TRANSACTION","transaction");s("analytics.HitTypes.ITEM","item");s("analytics.HitTypes.TIMING","timing");s("analytics.HitTypes.EXCEPTION","exception");s("analytics.Tracker.HitEvent",V);s("analytics.Tracker.HitEvent.EVENT_TYPE","a");s("analytics.Tracker.HitEvent.prototype.getHitType",V.prototype.fc);s("analytics.Tracker.HitEvent.prototype.getHit",V.prototype.ec);sa(Ca,function(a){var b=a.id.replace(/[A-Z]/,"_$&").toUpperCase();s("analytics.Parameters."+b,a)}); })()

View file

@ -356,7 +356,11 @@ MSP.process_data = function(code, message_buffer, message_length) {
console.log(data); console.log(data);
break; break;
case MSP_codes.MSP_BOXIDS: case MSP_codes.MSP_BOXIDS:
console.log(data); AUX_CONFIG_IDS = []; // empty the array as new data is coming in
for (var i = 0; i < data.byteLength; i++) {
AUX_CONFIG_IDS.push(data.getUint8(i));
}
break; break;
case MSP_codes.MSP_SERVO_CONF: case MSP_codes.MSP_SERVO_CONF:
SERVO_CONFIG = []; // empty the array as new data is coming in SERVO_CONFIG = []; // empty the array as new data is coming in

View file

@ -23,7 +23,7 @@ var serial = {
self.onReceiveError.addListener(function watch_for_on_receive_errors(info) { self.onReceiveError.addListener(function watch_for_on_receive_errors(info) {
console.error(info); console.error(info);
ga_tracker.sendEvent('Error', 'Serial', info.error); googleAnalytics.sendException('Serial: ' + info.error, false);
switch (info.error) { switch (info.error) {
case 'system_error': // we might be able to recover from this one case 'system_error': // we might be able to recover from this one
@ -36,11 +36,11 @@ var serial = {
function crunch_status(info) { function crunch_status(info) {
if (!info.paused) { if (!info.paused) {
console.log('SERIAL: Connection recovered from last onReceiveError'); console.log('SERIAL: Connection recovered from last onReceiveError');
ga_tracker.sendEvent('Error', 'Serial', 'recovered'); googleAnalytics.sendException('Serial: onReceiveError - recovered', false);
} else { } else {
console.log('SERIAL: Connection did not recover from last onReceiveError, disconnecting'); console.log('SERIAL: Connection did not recover from last onReceiveError, disconnecting');
GUI.log('Unrecoverable <span style="color: red">failure</span> of serial connection, disconnecting...'); GUI.log('Unrecoverable <span style="color: red">failure</span> of serial connection, disconnecting...');
ga_tracker.sendEvent('Error', 'Serial', 'unrecoverable'); googleAnalytics.sendException('Serial: onReceiveError - unrecoverable', false);
if (GUI.connected_to || GUI.connecting_to) { if (GUI.connected_to || GUI.connecting_to) {
$('a.connect').click(); $('a.connect').click();
@ -67,7 +67,7 @@ var serial = {
if (callback) callback(connectionInfo); if (callback) callback(connectionInfo);
} else { } else {
console.log('SERIAL: Failed to open serial port'); console.log('SERIAL: Failed to open serial port');
ga_tracker.sendEvent('Error', 'Serial', 'FailedToOpen'); googleAnalytics.sendException('Serial: FailedToOpen', false);
if (callback) callback(false); if (callback) callback(false);
} }
}); });
@ -91,7 +91,7 @@ var serial = {
console.log('SERIAL: Connection with ID: ' + self.connectionId + ' closed'); console.log('SERIAL: Connection with ID: ' + self.connectionId + ' closed');
} else { } else {
console.log('SERIAL: Failed to close connection with ID: ' + self.connectionId + ' closed'); console.log('SERIAL: Failed to close connection with ID: ' + self.connectionId + ' closed');
ga_tracker.sendEvent('Error', 'Serial', 'FailedToClose'); googleAnalytics.sendException('Serial: FailedToClose', false);
} }
console.log('SERIAL: Statistics - Sent: ' + self.bytes_sent + ' bytes, Received: ' + self.bytes_received + ' bytes'); console.log('SERIAL: Statistics - Sent: ' + self.bytes_sent + ' bytes, Received: ' + self.bytes_received + ' bytes');
@ -115,12 +115,12 @@ var serial = {
getInfo: function(callback) { getInfo: function(callback) {
chrome.serial.getInfo(this.connectionId, callback); chrome.serial.getInfo(this.connectionId, callback);
}, },
setControlSignals: function(signals, callback) {
chrome.serial.setControlSignals(this.connectionId, signals, callback);
},
getControlSignals: function(callback) { getControlSignals: function(callback) {
chrome.serial.getControlSignals(this.connectionId, callback); chrome.serial.getControlSignals(this.connectionId, callback);
}, },
setControlSignals: function(signals, callback) {
chrome.serial.setControlSignals(this.connectionId, signals, callback);
},
send: function(data, callback) { send: function(data, callback) {
var self = this; var self = this;
self.output_buffer.push({'data': data, 'callback': callback}); self.output_buffer.push({'data': data, 'callback': callback});

View file

@ -22,6 +22,7 @@ $(document).ready(function() {
GUI.timeout_kill_all(); GUI.timeout_kill_all();
GUI.interval_kill_all(); GUI.interval_kill_all();
GUI.tab_switch_cleanup(); GUI.tab_switch_cleanup();
GUI.tab_switch_in_progress = false;
serial.disconnect(onClosed); serial.disconnect(onClosed);
@ -50,7 +51,7 @@ $(document).ready(function() {
$('#content').empty(); $('#content').empty();
// load default html // load default html
tab_initialize_default(); tabs.default.initialize();
} }
$(this).data("clicks", !clicks); $(this).data("clicks", !clicks);

View file

@ -143,7 +143,7 @@ STM32_protocol.prototype.initialize = function() {
} else { } else {
console.log('STM32 - timed out, programming failed ...'); console.log('STM32 - timed out, programming failed ...');
GUI.log('STM32 - timed out, programming: <strong style="color: red">FAILED</strong>'); GUI.log('STM32 - timed out, programming: <strong style="color: red">FAILED</strong>');
ga_tracker.sendEvent('Flashing', 'Programming', 'timeout'); googleAnalytics.sendEvent('Flashing', 'Programming', 'timeout');
// protocol got stuck, clear timer and disconnect // protocol got stuck, clear timer and disconnect
GUI.interval_remove('STM32_timeout'); GUI.interval_remove('STM32_timeout');
@ -589,7 +589,7 @@ STM32_protocol.prototype.upload_procedure = function(step) {
if (verify) { if (verify) {
console.log('Programming: SUCCESSFUL'); console.log('Programming: SUCCESSFUL');
GUI.log('Programming: <strong style="color: green">SUCCESSFUL</strong>'); GUI.log('Programming: <strong style="color: green">SUCCESSFUL</strong>');
ga_tracker.sendEvent('Flashing', 'Programming', 'success'); googleAnalytics.sendEvent('Flashing', 'Programming', 'success');
// update progress bar // update progress bar
self.progress_bar_e.addClass('valid'); self.progress_bar_e.addClass('valid');
@ -599,7 +599,7 @@ STM32_protocol.prototype.upload_procedure = function(step) {
} else { } else {
console.log('Programming: FAILED'); console.log('Programming: FAILED');
GUI.log('Programming: <strong style="color: red">FAILED</strong>'); GUI.log('Programming: <strong style="color: red">FAILED</strong>');
ga_tracker.sendEvent('Flashing', 'Programming', 'fail'); googleAnalytics.sendEvent('Flashing', 'Programming', 'fail');
// update progress bar // update progress bar
self.progress_bar_e.addClass('invalid'); self.progress_bar_e.addClass('invalid');

View file

@ -421,7 +421,7 @@ STM32DFU_protocol.prototype.upload_procedure = function(step) {
if (verify) { if (verify) {
console.log('Programming: SUCCESSFUL'); console.log('Programming: SUCCESSFUL');
GUI.log('Programming: <strong style="color: green">SUCCESSFUL</strong>'); GUI.log('Programming: <strong style="color: green">SUCCESSFUL</strong>');
ga_tracker.sendEvent('Flashing', 'Programming', 'success'); googleAnalytics.sendEvent('Flashing', 'Programming', 'success');
// update progress bar // update progress bar
self.progress_bar_e.addClass('valid'); self.progress_bar_e.addClass('valid');
@ -431,7 +431,7 @@ STM32DFU_protocol.prototype.upload_procedure = function(step) {
} else { } else {
console.log('Programming: FAILED'); console.log('Programming: FAILED');
GUI.log('Programming: <strong style="color: red">FAILED</strong>'); GUI.log('Programming: <strong style="color: red">FAILED</strong>');
ga_tracker.sendEvent('Flashing', 'Programming', 'fail'); googleAnalytics.sendEvent('Flashing', 'Programming', 'fail');
// update progress bar // update progress bar
self.progress_bar_e.addClass('invalid'); self.progress_bar_e.addClass('invalid');

View file

@ -282,7 +282,6 @@ input[type="number"]::-webkit-inner-spin-button {
border-top: 1px solid #7d7d79; border-top: 1px solid #7d7d79;
background-color: #bfbeb5; background-color: #bfbeb5;
} }
#status-bar div { #status-bar div {
float: left; float: left;
@ -291,6 +290,25 @@ input[type="number"]::-webkit-inner-spin-button {
border-right: 1px solid #7d7d79; border-right: 1px solid #7d7d79;
} }
#cache {
display: none;
}
.data-loading {
width: 100%;
height: 100%;
background-image: url('../images/loading-bars.svg');
background-repeat: no-repeat;
background-position: center 45%;
}
.data-loading p {
position: relative;
top: calc(45% + 45px);
text-align: center;
font-weight: bold;
}
@font-face { @font-face {
font-family: 'icons'; font-family: 'icons';

View file

@ -130,5 +130,10 @@
<span i18n="statusbar_cycle_time"></span> <span class="cycle-time">0</span> <span i18n="statusbar_cycle_time"></span> <span class="cycle-time">0</span>
</div> </div>
</div> </div>
<div id="cache">
<div class="data-loading">
<p>Waiting for data ...</p>
</div>
</div>
</body> </body>
</html> </html>

116
main.js
View file

@ -1,28 +1,20 @@
// Get access to the background window object // Get access to the background window object
// This object is used to pass current connectionId to the backround page // This object is used to pass variables between active page and background page
// so the onClosed event can close the port for us if it was left opened, without this
// users can experience weird behavior if they would like to access the serial bus afterwards.
chrome.runtime.getBackgroundPage(function(result) { chrome.runtime.getBackgroundPage(function(result) {
backgroundPage = result; backgroundPage = result;
backgroundPage.app_window = window; backgroundPage.app_window = window;
}); });
// Google Analytics BEGIN // Google Analytics
var ga_config; // google analytics config reference var googleAnalyticsService = analytics.getService('ice_cream_app');
var ga_tracking; // global result of isTrackingPermitted var googleAnalytics = googleAnalyticsService.getTracker(atob("VUEtNTI4MjA5MjAtMQ=="));
var googleAnalyticsConfig = false;
var service = analytics.getService('ice_cream_app'); googleAnalyticsService.getConfig().addCallback(function(config) {
service.getConfig().addCallback(function(config) { googleAnalyticsConfig = config;
ga_config = config;
ga_tracking = config.isTrackingPermitted();
}); });
var ga_tracker = service.getTracker(("VUEtNTI4MjA5MjAtMQ=="));
ga_tracker.sendAppView('Application Started');
// Google Analytics END
$(document).ready(function() { $(document).ready(function() {
googleAnalytics.sendAppView('Application Started');
// translate to user-selected language // translate to user-selected language
localize(); localize();
@ -47,9 +39,9 @@ $(document).ready(function() {
} }
// Tabs // Tabs
var tabs = $('#tabs > ul'); var ui_tabs = $('#tabs > ul');
$('a', tabs).click(function() { $('a', ui_tabs).click(function() {
if ($(this).parent().hasClass('active') == false) { // only initialize when the tab isn't already active if ($(this).parent().hasClass('active') == false && !GUI.tab_switch_in_progress) { // only initialize when the tab isn't already active
var self = this; var self = this;
var index = $(self).parent().index(); var index = $(self).parent().index();
var tab = $(self).parent().prop('class'); var tab = $(self).parent().prop('class');
@ -60,53 +52,63 @@ $(document).ready(function() {
return; return;
} }
GUI.tab_switch_in_progress = true;
GUI.tab_switch_cleanup(function() { GUI.tab_switch_cleanup(function() {
// disable previously active tab highlight // disable previously active tab highlight
$('li', tabs).removeClass('active'); $('li', ui_tabs).removeClass('active');
// Highlight selected tab // Highlight selected tab
$(self).parent().addClass('active'); $(self).parent().addClass('active');
// detach listeners and remove element data // detach listeners and remove element data
$('#content').empty(); var content = $('#content');
content.empty();
// display loading screen
$('#cache .data-loading').clone().appendTo(content);
switch (tab) { switch (tab) {
case 'tab_initial_setup': case 'tab_initial_setup':
tab_initialize_initial_setup(); tabs.initial_setup.initialize(content_ready);
break; break;
case 'tab_pid_tuning': case 'tab_pid_tuning':
tab_initialize_pid_tuning(); tabs.pid_tuning.initialize(content_ready);
break; break;
case 'tab_receiver': case 'tab_receiver':
tab_initialize_receiver(); tabs.receiver.initialize(content_ready);
break; break;
case 'tab_auxiliary_configuration': case 'tab_auxiliary_configuration':
tab_initialize_auxiliary_configuration(); tabs.auxiliary_configuration.initialize(content_ready);
break; break;
case 'tab_servos': case 'tab_servos':
tab_initialize_servos(); tabs.servos.initialize(content_ready);
break; break;
case 'tab_gps': case 'tab_gps':
tab_initialize_gps(); tabs.gps.initialize(content_ready);
break; break;
case 'tab_motor_outputs': case 'tab_motor_outputs':
tab_initialize_motor_outputs(); tabs.motor_outputs.initialize(content_ready);
break; break;
case 'tab_sensors': case 'tab_sensors':
tab_initialize_sensors(); tabs.sensors.initialize(content_ready);
break; break;
case 'tab_cli': case 'tab_cli':
tab_initialize_cli(); tabs.cli.initialize(content_ready);
break; break;
case 'tab_logging': case 'tab_logging':
tab_initialize_logging(); tabs.logging.initialize(content_ready);
break; break;
} }
function content_ready() {
GUI.tab_switch_in_progress = false;
}
}); });
} }
}); });
tab_initialize_default(); tabs.default.initialize();
// options // options
$('a#options').click(function() { $('a#options').click(function() {
@ -115,8 +117,9 @@ $(document).ready(function() {
if (!el.hasClass('active')) { if (!el.hasClass('active')) {
el.addClass('active'); el.addClass('active');
el.after('<div id="options-window"></div>'); el.after('<div id="options-window"></div>');
$('div#options-window').load('./tabs/options.html', function() { $('div#options-window').load('./tabs/options.html', function() {
ga_tracker.sendAppView('Options'); googleAnalytics.sendAppView('Options');
// translate to user-selected language // translate to user-selected language
localize(); localize();
@ -135,25 +138,30 @@ $(document).ready(function() {
}); });
// if tracking is enabled, check the statistics checkbox // if tracking is enabled, check the statistics checkbox
if (ga_tracking == true) { if (googleAnalyticsConfig.isTrackingPermitted()) {
$('div.statistics input').prop('checked', true); $('div.statistics input').prop('checked', true);
} }
$('div.statistics input').change(function() { $('div.statistics input').change(function() {
var check = $(this).is(':checked'); var result = $(this).is(':checked');
googleAnalyticsConfig.setTrackingPermitted(result);
ga_tracking = check;
ga_config.setTrackingPermitted(check);
}); });
function close_and_cleanup(e) {
if (e.type == 'click' && !$.contains($('div#options-window')[0], e.target) || e.type == 'keyup' && e.keyCode == 27) {
$(document).unbind('click keyup', close_and_cleanup);
$('div#options-window').slideUp(function() {
el.removeClass('active');
$(this).empty().remove();
});
}
}
$(document).bind('click keyup', close_and_cleanup);
$(this).slideDown(); $(this).slideDown();
}); });
} else {
$('div#options-window').slideUp(function() {
el.removeClass('active');
$(this).empty().remove();
});
} }
}); });
@ -169,15 +177,15 @@ $(document).ready(function() {
$("#content").on('keydown', 'input[type="number"]', function(e) { $("#content").on('keydown', 'input[type="number"]', function(e) {
// whitelist all that we need for numeric control // whitelist all that we need for numeric control
if ((e.keyCode >= 96 && e.keyCode <= 105) || (e.keyCode >= 48 && e.keyCode <= 57)) { // allow numpad and standard number keypad var whitelist = [
} else if (e.keyCode == 109 || e.keyCode == 189) { // minus on numpad and in standard keyboard 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, // numpad and standard number keypad
} else if (e.keyCode == 8 || e.keyCode == 46) { // backspace and delete 109, 189, // minus on numpad and in standard keyboard
} else if (e.keyCode == 190 || e.keyCode == 110) { // allow and decimal point 8, 46, 9, // backspace, delete, tab
} else if ((e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13) { // allow arrows, enter 190, 110, // decimal point
} else { 37, 38, 39, 40, 13 // arrows and enter
// block everything else ];
e.preventDefault();
} if (whitelist.indexOf(e.keyCode) == -1) e.preventDefault();
}); });
$("#content").on('change', 'input[type="number"]', function() { $("#content").on('change', 'input[type="number"]', function() {

View file

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"minimum_chrome_version": "33", "minimum_chrome_version": "36",
"version": "0.45", "version": "0.47.1",
"author": "Hydra", "author": "Hydra",
"name": "Cleanflight - Configurator", "name": "Cleanflight - Configurator",

View file

@ -1,12 +1,18 @@
// TODO: rework box_highlight & update_ui to accept flexible amount of aux channels // TODO: rework box_highlight & update_ui to accept flexible amount of aux channels
function tab_initialize_auxiliary_configuration() { tabs.auxiliary_configuration = {};
ga_tracker.sendAppView('Auxiliary Configuration'); tabs.auxiliary_configuration.initialize = function(callback) {
GUI.active_tab_ref = this;
GUI.active_tab = 'auxiliary_configuration'; GUI.active_tab = 'auxiliary_configuration';
googleAnalytics.sendAppView('Auxiliary Configuration');
MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_box_data); MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_box_data);
function get_box_data() { function get_box_data() {
MSP.send_message(MSP_codes.MSP_BOX, false, false, get_rc_data); MSP.send_message(MSP_codes.MSP_BOX, false, false, get_box_ids);
}
function get_box_ids() {
MSP.send_message(MSP_codes.MSP_BOXIDS, false, false, get_rc_data);
} }
function get_rc_data() { function get_rc_data() {
@ -170,5 +176,11 @@ function tab_initialize_auxiliary_configuration() {
GUI.interval_add('status_pull', function() { GUI.interval_add('status_pull', function() {
MSP.send_message(MSP_codes.MSP_STATUS); MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true); }, 250, true);
if (callback) callback();
} }
} };
tabs.auxiliary_configuration.cleanup = function(callback) {
if (callback) callback();
};

View file

@ -1,35 +1,12 @@
var CLI_active = false; var CLI_active = false;
var CLI_valid = false; var CLI_valid = false;
var CliHistory = function () { tabs.cli = {};
this.history = []; tabs.cli.initialize = function(callback) {
this.index = 0; var self = this;
}; GUI.active_tab_ref = this;
CliHistory.prototype = {
add: function (str) {
this.history.push(str);
this.index = this.history.length;
},
prev: function () {
if (this.index > 0) this.index -= 1;
return this.history[this.index];
},
next: function () {
if (this.index < this.history.length) this.index += 1;
return this.history[this.index - 1];
}
};
cli_history = new CliHistory();
function tab_initialize_cli() {
ga_tracker.sendAppView('CLI Page');
GUI.active_tab = 'cli'; GUI.active_tab = 'cli';
googleAnalytics.sendAppView('CLI Page');
// remove any active interval for delayed command
MSP.callbacks_cleanup();
$('#content').load("./tabs/cli.html", function() { $('#content').load("./tabs/cli.html", function() {
// translate to user-selected language // translate to user-selected language
@ -53,7 +30,7 @@ function tab_initialize_cli() {
var out_string = textarea.val(); var out_string = textarea.val();
var out_arr = out_string.split("\n"); var out_arr = out_string.split("\n");
cli_history.add(out_string.trim()); self.history.add(out_string.trim());
var timeout_needle = 0; var timeout_needle = 0;
for (var i = 0; i < out_arr.length; i++) { for (var i = 0; i < out_arr.length; i++) {
@ -68,16 +45,60 @@ function tab_initialize_cli() {
var keyUp = { 38: true }, keyDown = { 40: true }; var keyUp = { 38: true }, keyDown = { 40: true };
if (event.keyCode in keyUp) if (event.keyCode in keyUp)
textarea.val(cli_history.prev()); textarea.val(self.history.prev());
if (event.keyCode in keyDown) if (event.keyCode in keyDown)
textarea.val(cli_history.next()); textarea.val(self.history.next());
}); });
// give input element user focus // give input element user focus
textarea.focus(); textarea.focus();
if (callback) callback();
}); });
} };
tabs.cli.history = {
history: [],
index: 0
};
tabs.cli.history.add = function(str) {
this.history.push(str);
this.index = this.history.length;
};
tabs.cli.history.prev = function() {
if (this.index > 0) this.index -= 1;
return this.history[this.index];
};
tabs.cli.history.next = function() {
if (this.index < this.history.length) this.index += 1;
return this.history[this.index - 1];
};
tabs.cli.cleanup = function(callback) {
var bufferOut = new ArrayBuffer(5);
var bufView = new Uint8Array(bufferOut);
bufView[0] = 0x65; // e
bufView[1] = 0x78; // x
bufView[2] = 0x69; // i
bufView[3] = 0x74; // t
bufView[4] = 0x0D; // enter
serial.send(bufferOut, function(writeInfo) {
// we could handle this "nicely", but this will do for now
// (another approach is however much more complicated):
// we can setup an interval asking for data lets say every 200ms, when data arrives, callback will be triggered and tab switched
// we could probably implement this someday
GUI.timeout_add('waiting_for_bootup', function() {
CLI_active = false;
CLI_valid = false;
if (callback) callback();
}, 5000); // if we dont allow enough time to reboot, CRC of "first" command sent will fail, keep an eye for this one
});
};
function send_slowly(out_arr, i, timeout_needle) { function send_slowly(out_arr, i, timeout_needle) {
GUI.timeout_add('CLI_send_slowly', function() { GUI.timeout_add('CLI_send_slowly', function() {

View file

@ -1,4 +1,6 @@
function tab_initialize_default() { tabs.default = {};
tabs.default.initialize = function(callback) {
GUI.active_tab_ref = this;
GUI.active_tab = 'default'; GUI.active_tab = 'default';
$('#content').load("./tabs/default.html", function() { $('#content').load("./tabs/default.html", function() {
@ -11,10 +13,18 @@ function tab_initialize_default() {
$('div.changelog.configurator .wrapper').load('./changelog.html'); $('div.changelog.configurator .wrapper').load('./changelog.html');
// UI Hooks // UI Hooks
$('a.firmware_flasher').click(tab_initialize_firmware_flasher); $('a.firmware_flasher').click(function() {
tabs.firmware_flasher.initialize();
});
$('div.welcome a').click(function() { $('div.welcome a').click(function() {
ga_tracker.sendEvent('ExternalUrls', 'Click', $(this).prop('href')); googleAnalytics.sendEvent('ExternalUrls', 'Click', $(this).prop('href'));
}); });
if (callback) callback();
}); });
} };
tabs.default.cleanup = function(callback) {
if (callback) callback();
};

View file

@ -1,6 +1,8 @@
function tab_initialize_firmware_flasher() { tabs.firmware_flasher = {};
ga_tracker.sendAppView('Firmware Flasher'); tabs.firmware_flasher.initialize = function(callback) {
GUI.active_tab_ref = this;
GUI.active_tab = 'firmware_flasher'; GUI.active_tab = 'firmware_flasher';
googleAnalytics.sendAppView('Firmware Flasher');
var intel_hex = false; // standard intel hex in string format var intel_hex = false; // standard intel hex in string format
var parsed_hex = false; // parsed raw hex in array format var parsed_hex = false; // parsed raw hex in array format
@ -47,7 +49,7 @@ function tab_initialize_firmware_flasher() {
if (parsed_hex) { if (parsed_hex) {
GUI.log(chrome.i18n.getMessage('firmwareFlasherLocalFirmwareLoaded')); GUI.log(chrome.i18n.getMessage('firmwareFlasherLocalFirmwareLoaded'));
ga_tracker.sendEvent('Flashing', 'Firmware', 'local'); googleAnalytics.sendEvent('Flashing', 'Firmware', 'local');
$('a.flash_firmware').removeClass('locked'); $('a.flash_firmware').removeClass('locked');
$('span.size').html(parsed_hex.bytes_total + ' bytes'); $('span.size').html(parsed_hex.bytes_total + ' bytes');
@ -73,7 +75,7 @@ function tab_initialize_firmware_flasher() {
if (parsed_hex) { if (parsed_hex) {
GUI.log(chrome.i18n.getMessage('firmwareFlasherRemoteFirmwareLoaded')); GUI.log(chrome.i18n.getMessage('firmwareFlasherRemoteFirmwareLoaded'));
ga_tracker.sendEvent('Flashing', 'Firmware', 'online'); googleAnalytics.sendEvent('Flashing', 'Firmware', 'online');
$('a.flash_firmware').removeClass('locked'); $('a.flash_firmware').removeClass('locked');
$('span.path').text('Using remote Firmware'); $('span.path').text('Using remote Firmware');
@ -211,61 +213,6 @@ function tab_initialize_firmware_flasher() {
}); });
}); });
/*
chrome.storage.local.get('dev_mode', function(result) {
if (typeof result.dev_mode !== 'undefined') {
if (result.dev_mode) {
GUI.log('Dev mode: <strong>Enabled</strong>');
bind_enter_handler();
}
}
});
var keys_down = {};
$(document).keydown(function(e) {
keys_down[e.which] = true;
// idkfa
if (keys_down[65] && keys_down[68] && keys_down[70] && keys_down[73] && keys_down[75]) {
chrome.storage.local.get('dev_mode', function(result) {
if (typeof result.dev_mode === 'undefined') {
GUI.log('Dev mode: <strong>Enabled</strong>');
bind_enter_handler();
chrome.storage.local.set({'dev_mode': true});
}
});
}
});
$(document).keyup(function(e) {
delete keys_down[e.which];
});
function bind_enter_handler() {
// unbind first (in case there is anything bound here)
$(document).unbind('keypress');
$(document).keypress(function(e) {
if (e.which == 13) { // enter
// Trigger regular Flashing sequence
$('a.flash_firmware').click();
}
});
}
*/
/*
GUI.interval_add('factory_mode', function factory_mode() {
serial.getControlSignals(function(result) {
if (result.cts == true) {
// Trigger regular Flashing sequence
$('a.flash_firmware').click();
}
});
}, 500);
*/
$(document).keypress(function(e) { $(document).keypress(function(e) {
if (e.which == 13) { // enter if (e.which == 13) { // enter
// Trigger regular Flashing sequence // Trigger regular Flashing sequence
@ -277,14 +224,25 @@ function tab_initialize_firmware_flasher() {
$('a.back').click(function() { $('a.back').click(function() {
if (!GUI.connect_lock) { // button disabled while flashing is in progress if (!GUI.connect_lock) { // button disabled while flashing is in progress
GUI.tab_switch_cleanup(function() { GUI.tab_switch_cleanup(function() {
tab_initialize_default(); tabs.default.initialize();
}); });
} else { } else {
GUI.log(chrome.i18n.getMessage('firmwareFlasherWaitForFinish')); GUI.log(chrome.i18n.getMessage('firmwareFlasherWaitForFinish'));
} }
}); });
if (callback) callback();
}); });
} };
tabs.firmware_flasher.cleanup = function(callback) {
PortHandler.flush_callbacks();
// unbind "global" events
$(document).unbind('keypress');
if (callback) callback();
};
function parse_hex(str, callback) { function parse_hex(str, callback) {
// parsing hex in different thread // parsing hex in different thread

View file

@ -1,6 +1,8 @@
function tab_initialize_gps () { tabs.gps = {};
ga_tracker.sendAppView('GPS Page'); tabs.gps.initialize = function(callback) {
GUI.active_tab_ref = this;
GUI.active_tab = 'gps'; GUI.active_tab = 'gps';
googleAnalytics.sendAppView('GPS Page');
MSP.send_message(MSP_codes.MSP_RAW_GPS, false, false, load_html); MSP.send_message(MSP_codes.MSP_RAW_GPS, false, false, load_html);
@ -52,5 +54,11 @@ function tab_initialize_gps () {
GUI.interval_add('status_pull', function() { GUI.interval_add('status_pull', function() {
MSP.send_message(MSP_codes.MSP_STATUS); MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true); }, 250, true);
if (callback) callback();
} }
} };
tabs.gps.cleanup = function(callback) {
if (callback) callback();
};

View file

@ -45,6 +45,7 @@
} }
#interactive_block { #interactive_block {
float: left; float: left;
position: relative;
height: 280px; height: 280px;
width: 400px; width: 400px;
@ -53,17 +54,25 @@
background-color: white; background-color: white;
} }
#interactive_block .model { #interactive_block .model {
display: block; float: left;
height: 15px;
margin: 10px 0 0 10px; margin: 10px 0 0 10px;
font-weight: bold; font-weight: bold;
} }
#interactive_block .heading {
float: right;
height: 15px;
margin: 10px 10px 0 0;
font-weight: bold;
}
#interactive_block a.reset { #interactive_block a.reset {
position: absolute; position: absolute;
display: block; display: block;
margin-left: 10px; bottom: 10px;
margin-top: 215px; right: 10px;
height: 28px; height: 28px;
line-height: 28px; line-height: 28px;

View file

@ -22,6 +22,8 @@
</div> </div>
<div id="interactive_block"> <div id="interactive_block">
<span class="model"></span> <span class="model"></span>
<span class="heading"></span>
<div class="clear-both"></div>
<a class="reset" href="#" i18n="initialSetupButtonResetZaxis"></a> <a class="reset" href="#" i18n="initialSetupButtonResetZaxis"></a>
<div id="perspective"> <div id="perspective">
<div id="cube"> <div id="cube">

View file

@ -1,6 +1,11 @@
function tab_initialize_initial_setup() { tabs.initial_setup = {
ga_tracker.sendAppView('Initial Setup'); yaw_fix: 0.0
};
tabs.initial_setup.initialize = function(callback) {
var self = this;
GUI.active_tab_ref = this;
GUI.active_tab = 'initial_setup'; GUI.active_tab = 'initial_setup';
googleAnalytics.sendAppView('Initial Setup');
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, load_ident); MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, load_ident);
@ -20,8 +25,6 @@ function tab_initialize_initial_setup() {
// translate to user-selected language // translate to user-selected language
localize(); localize();
var yaw_fix = 0.0;
// Fill in misc stuff // Fill in misc stuff
$('input[name="mincellvoltage"]').val(MISC.vbatmincellvoltage); $('input[name="mincellvoltage"]').val(MISC.vbatmincellvoltage);
$('input[name="maxcellvoltage"]').val(MISC.vbatmaxcellvoltage); $('input[name="maxcellvoltage"]').val(MISC.vbatmaxcellvoltage);
@ -103,6 +106,7 @@ function tab_initialize_initial_setup() {
} }
$('span.model').text(chrome.i18n.getMessage('initialSetupModel', [str])); $('span.model').text(chrome.i18n.getMessage('initialSetupModel', [str]));
$('span.heading').text(chrome.i18n.getMessage('initialSetupheading', [0]));
// UI Hooks // UI Hooks
$('a.calibrateAccel').click(function() { $('a.calibrateAccel').click(function() {
@ -150,7 +154,7 @@ function tab_initialize_initial_setup() {
GUI.log(chrome.i18n.getMessage('initialSetupSettingsRestored')); GUI.log(chrome.i18n.getMessage('initialSetupSettingsRestored'));
GUI.tab_switch_cleanup(function() { GUI.tab_switch_cleanup(function() {
tab_initialize_initial_setup(); tabs.initial_setup.initialize();
}); });
}); });
}); });
@ -215,10 +219,15 @@ function tab_initialize_initial_setup() {
} }
}); });
// display current yaw fix value (important during tab re-initialization)
$('div#interactive_block > a.reset').text(chrome.i18n.getMessage('initialSetupButtonResetZaxisValue', [self.yaw_fix]));
// reset yaw button hook // reset yaw button hook
$('div#interactive_block > a.reset').click(function() { $('div#interactive_block > a.reset').click(function() {
yaw_fix = SENSOR_DATA.kinematics[2] * - 1.0; self.yaw_fix = SENSOR_DATA.kinematics[2] * - 1.0;
console.log('YAW reset to 0 deg, fix: ' + yaw_fix + ' deg'); $(this).text(chrome.i18n.getMessage('initialSetupButtonResetZaxisValue', [self.yaw_fix]));
console.log('YAW reset to 0 deg, fix: ' + self.yaw_fix + ' deg');
}); });
$('#content .backup').click(configuration_backup); $('#content .backup').click(configuration_backup);
@ -244,9 +253,12 @@ function tab_initialize_initial_setup() {
// Update cube // Update cube
var cube = $('div#cube'); var cube = $('div#cube');
cube.css('-webkit-transform', 'rotateY(' + ((SENSOR_DATA.kinematics[2] * -1.0) - yaw_fix) + 'deg)'); cube.css('-webkit-transform', 'rotateY(' + ((SENSOR_DATA.kinematics[2] * -1.0) - self.yaw_fix) + 'deg)');
$('#cubePITCH', cube).css('-webkit-transform', 'rotateX(' + SENSOR_DATA.kinematics[1] + 'deg)'); $('#cubePITCH', cube).css('-webkit-transform', 'rotateX(' + SENSOR_DATA.kinematics[1] + 'deg)');
$('#cubeROLL', cube).css('-webkit-transform', 'rotateZ(' + SENSOR_DATA.kinematics[0] + 'deg)'); $('#cubeROLL', cube).css('-webkit-transform', 'rotateZ(' + SENSOR_DATA.kinematics[0] + 'deg)');
// Update heading
$('span.heading').text(chrome.i18n.getMessage('initialSetupheading', [SENSOR_DATA.kinematics[2]]));
} }
GUI.interval_add('initial_setup_data_pull', get_analog_data, 50, true); GUI.interval_add('initial_setup_data_pull', get_analog_data, 50, true);
@ -255,5 +267,11 @@ function tab_initialize_initial_setup() {
GUI.interval_add('status_pull', function() { GUI.interval_add('status_pull', function() {
MSP.send_message(MSP_codes.MSP_STATUS); MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true); }, 250, true);
if (callback) callback();
} }
} };
tabs.initial_setup.cleanup = function(callback) {
if (callback) callback();
};

View file

@ -1,8 +1,10 @@
var MSP_pass_through = false; var MSP_pass_through = false;
function tab_initialize_logging() { tabs.logging = {};
ga_tracker.sendAppView('Logging'); tabs.logging.initialize = function(callback) {
GUI.active_tab_ref = this;
GUI.active_tab = 'logging'; GUI.active_tab = 'logging';
googleAnalytics.sendAppView('Logging');
var requested_properties = []; var requested_properties = [];
@ -59,7 +61,7 @@ function tab_initialize_logging() {
// print header for the csv file // print header for the csv file
print_head(); print_head();
function poll_data() { function log_data_poll() {
if (requests) { if (requests) {
// save current data (only after everything is initialized) // save current data (only after everything is initialized)
crunch_data(); crunch_data();
@ -73,8 +75,8 @@ function tab_initialize_logging() {
} }
} }
GUI.interval_add('log_data_pull', poll_data, parseInt($('select.speed').val()), true); // refresh rate goes here GUI.interval_add('log_data_poll', log_data_poll, parseInt($('select.speed').val()), true); // refresh rate goes here
GUI.interval_add('flush_data', function() { GUI.interval_add('write_data', function write_data() {
if (log_buffer.length) { // only execute when there is actual data to write if (log_buffer.length) { // only execute when there is actual data to write
if (fileWriter.readyState == 0 || fileWriter.readyState == 2) { if (fileWriter.readyState == 0 || fileWriter.readyState == 2) {
append_to_file(log_buffer.join('\n')); append_to_file(log_buffer.join('\n'));
@ -95,8 +97,7 @@ function tab_initialize_logging() {
GUI.log(chrome.i18n.getMessage('loggingErrorOneProperty')); GUI.log(chrome.i18n.getMessage('loggingErrorOneProperty'));
} }
} else { } else {
GUI.interval_remove('log_data_pull'); GUI.interval_kill_all();
GUI.interval_remove('flush_data');
$('.speed').prop('disabled', false); $('.speed').prop('disabled', false);
$(this).text(chrome.i18n.getMessage('loggingStart')); $(this).text(chrome.i18n.getMessage('loggingStart'));
@ -120,7 +121,7 @@ function tab_initialize_logging() {
GUI.tab_switch_cleanup(function() { GUI.tab_switch_cleanup(function() {
MSP_pass_through = false; MSP_pass_through = false;
$('#tabs > ul li').removeClass('active'); $('#tabs > ul li').removeClass('active');
tab_initialize_default(); tabs.default.initialize();
}); });
} }
}); });
@ -134,6 +135,8 @@ function tab_initialize_logging() {
}); });
} }
}); });
if (callback) callback();
} }
function print_head() { function print_head() {
@ -332,4 +335,8 @@ function tab_initialize_logging() {
fileWriter.write(new Blob([data + '\n'], {type: 'text/plain'})); fileWriter.write(new Blob([data + '\n'], {type: 'text/plain'}));
} }
} };
tabs.logging.cleanup = function(callback) {
if (callback) callback();
};

View file

@ -1,6 +1,8 @@
function tab_initialize_motor_outputs() { tabs.motor_outputs = {};
ga_tracker.sendAppView('Motor Outputs Page'); tabs.motor_outputs.initialize = function(callback) {
GUI.active_tab_ref = this;
GUI.active_tab = 'motor_outputs'; GUI.active_tab = 'motor_outputs';
googleAnalytics.sendAppView('Motor Outputs Page');
function initSensorData() { function initSensorData() {
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
@ -37,7 +39,7 @@ function tab_initialize_motor_outputs() {
return sampleNumber + 1; return sampleNumber + 1;
} }
var margin = {top: 20, right: 10, bottom: 10, left: 20}; var margin = {top: 20, right: 30, bottom: 10, left: 20};
function updateGraphHelperSize(helpers) { function updateGraphHelperSize(helpers) {
helpers.width = helpers.targetElement.width() - margin.left - margin.right; helpers.width = helpers.targetElement.width() - margin.left - margin.right;
helpers.height = helpers.targetElement.height() - margin.top - margin.bottom; helpers.height = helpers.targetElement.height() - margin.top - margin.bottom;
@ -364,5 +366,11 @@ function tab_initialize_motor_outputs() {
GUI.interval_add('status_pull', function get_status_data() { GUI.interval_add('status_pull', function get_status_data() {
MSP.send_message(MSP_codes.MSP_STATUS); MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true); }, 250, true);
if (callback) callback();
} }
} };
tabs.motor_outputs.cleanup = function(callback) {
if (callback) callback();
};

View file

@ -1,6 +1,8 @@
function tab_initialize_pid_tuning() { tabs.pid_tuning = {};
ga_tracker.sendAppView('PID Tuning'); tabs.pid_tuning.initialize = function(callback) {
GUI.active_tab_ref = this;
GUI.active_tab = 'pid_tuning'; GUI.active_tab = 'pid_tuning';
googleAnalytics.sendAppView('PID Tuning');
// requesting MSP_STATUS manually because it contains CONFIG.profile // requesting MSP_STATUS manually because it contains CONFIG.profile
MSP.send_message(MSP_codes.MSP_STATUS, false, false, get_pid_names); MSP.send_message(MSP_codes.MSP_STATUS, false, false, get_pid_names);
@ -183,7 +185,9 @@ function tab_initialize_pid_tuning() {
MSP.send_message(MSP_codes.MSP_SELECT_SETTING, [profile - 1], false, function() { MSP.send_message(MSP_codes.MSP_SELECT_SETTING, [profile - 1], false, function() {
GUI.log(chrome.i18n.getMessage('pidTuningLoadedProfile', [profile])); GUI.log(chrome.i18n.getMessage('pidTuningLoadedProfile', [profile]));
GUI.tab_switch_cleanup(tab_initialize_pid_tuning); GUI.tab_switch_cleanup(function() {
tabs.pid_tuning.initialize();
});
}); });
}); });
@ -191,7 +195,7 @@ function tab_initialize_pid_tuning() {
GUI.tab_switch_cleanup(function() { GUI.tab_switch_cleanup(function() {
GUI.log(chrome.i18n.getMessage('pidTuningDataRefreshed')); GUI.log(chrome.i18n.getMessage('pidTuningDataRefreshed'));
tab_initialize_pid_tuning(); tabs.pid_tuning.initialize();
}); });
}); });
@ -308,5 +312,11 @@ function tab_initialize_pid_tuning() {
GUI.interval_add('status_pull', function() { GUI.interval_add('status_pull', function() {
MSP.send_message(MSP_codes.MSP_STATUS); MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true); }, 250, true);
if (callback) callback();
} }
};
tabs.pid_tuning.cleanup = function(callback) {
if (callback) callback();
} }

View file

@ -1,6 +1,8 @@
function tab_initialize_receiver() { tabs.receiver = {};
ga_tracker.sendAppView('Receiver Page'); tabs.receiver.initialize = function(callback) {
GUI.active_tab_ref = this;
GUI.active_tab = 'receiver'; GUI.active_tab = 'receiver';
googleAnalytics.sendAppView('Receiver Page');
MSP.send_message(MSP_codes.MSP_RC_TUNING, false, false, get_rc_data); MSP.send_message(MSP_codes.MSP_RC_TUNING, false, false, get_rc_data);
@ -266,5 +268,11 @@ function tab_initialize_receiver() {
GUI.interval_add('status_pull', function() { GUI.interval_add('status_pull', function() {
MSP.send_message(MSP_codes.MSP_STATUS); MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true); }, 250, true);
if (callback) callback();
} }
} };
tabs.receiver.cleanup = function(callback) {
if (callback) callback();
};

View file

@ -1,6 +1,8 @@
function tab_initialize_sensors() { tabs.sensors = {};
ga_tracker.sendAppView('Sensor Page'); tabs.sensors.initialize = function(callback) {
GUI.active_tab_ref = this;
GUI.active_tab = 'sensors'; GUI.active_tab = 'sensors';
googleAnalytics.sendAppView('Sensor Page');
function initSensorData(){ function initSensorData(){
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
@ -405,5 +407,17 @@ function tab_initialize_sensors() {
GUI.interval_add('status_pull', function() { GUI.interval_add('status_pull', function() {
MSP.send_message(MSP_codes.MSP_STATUS); MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true); }, 250, true);
if (callback) callback();
}); });
} };
tabs.sensors.cleanup = function(callback) {
serial.empty_output_buffer();
// sensor data tab uses scrollbars, emptying the content before loading another tab
// prevents scrollbar exposure to any of the tabs while new content is loaded in
$('#content').empty();
if (callback) callback();
};

View file

@ -5,9 +5,11 @@
that there was just no other way around this then hardcoding/implementing each model separately. that there was just no other way around this then hardcoding/implementing each model separately.
*/ */
function tab_initialize_servos() { tabs.servos = {};
ga_tracker.sendAppView('Servos'); tabs.servos.initialize = function(callback) {
GUI.active_tab_ref = this;
GUI.active_tab = 'servos'; GUI.active_tab = 'servos';
googleAnalytics.sendAppView('Servos');
MSP.send_message(MSP_codes.MSP_IDENT, false, false, get_servo_conf_data); MSP.send_message(MSP_codes.MSP_IDENT, false, false, get_servo_conf_data);
@ -302,5 +304,11 @@ function tab_initialize_servos() {
GUI.interval_add('status_pull', function() { GUI.interval_add('status_pull', function() {
MSP.send_message(MSP_codes.MSP_STATUS); MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true); }, 250, true);
if (callback) callback();
} }
} };
tabs.servos.cleanup = function(callback) {
if (callback) callback();
};