summaryrefslogtreecommitdiffstats
path: root/chrome/third_party
diff options
context:
space:
mode:
authorplundblad@chromium.org <plundblad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-05 14:37:37 +0000
committerplundblad@chromium.org <plundblad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-05 14:37:37 +0000
commit3fda54ad92524fe479eeb3515f3f6ac669e72618 (patch)
treeb730538d576ba954dd35c6b664ebc05fd3382be1 /chrome/third_party
parent576d65a58af228f0b5843cfff515ae8b4926f5cd (diff)
downloadchromium_src-3fda54ad92524fe479eeb3515f3f6ac669e72618.zip
chromium_src-3fda54ad92524fe479eeb3515f3f6ac669e72618.tar.gz
chromium_src-3fda54ad92524fe479eeb3515f3f6ac669e72618.tar.bz2
Update latest ChromeVox from upstream
Change log for this version: Skip elements that are referenced by another element using aria-labelledby. Override sticky mode within a single tab, rather than globally. Don't crash if chrome.experimental doesn't exist anymore. Basic Chrome OS touch screen support. Handle braille text input, contracted and uncontracted. BUG=310285 TBR=dtseng@chromium.org Review URL: https://codereview.chromium.org/316803004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275102 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/third_party')
-rw-r--r--chrome/third_party/chromevox/chromeVoxChromeBackgroundScript.js142
-rw-r--r--chrome/third_party/chromevox/chromeVoxChromeOptionsScript.js122
-rw-r--r--chrome/third_party/chromevox/chromeVoxChromePageScript.js110
-rw-r--r--chrome/third_party/chromevox/chromeVoxKbExplorerScript.js10
-rw-r--r--chrome/third_party/chromevox/chromevox/injected/mathjax.js2
5 files changed, 210 insertions, 176 deletions
diff --git a/chrome/third_party/chromevox/chromeVoxChromeBackgroundScript.js b/chrome/third_party/chromevox/chromeVoxChromeBackgroundScript.js
index cf78dab..54dc713 100644
--- a/chrome/third_party/chromevox/chromeVoxChromeBackgroundScript.js
+++ b/chrome/third_party/chromevox/chromeVoxChromeBackgroundScript.js
@@ -1,5 +1,5 @@
var goog=goog||{};goog.global=this;goog.isDef=function(a){return void 0!==a};goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&goog.isDef(b)?c[d]=b:c=c[d]?c[d]:c[d]={}};goog.define=function(a,b){var c=b;goog.exportPath_(a,c)};goog.DEBUG=!1;goog.LOCALE="en";goog.TRUSTED_SITE=!0;goog.STRICT_MODE_COMPATIBLE=!1;goog.provide=function(a){goog.exportPath_(a)};
-goog.setTestOnly=function(a){if(!goog.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+a?": "+a:".");};goog.forwardDeclare=function(){};goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
+goog.setTestOnly=function(a){if(!goog.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+(a?": "+a:"."));};goog.forwardDeclare=function(){};goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
goog.addDependency=function(a,b,c){if(goog.DEPENDENCIES_ENABLED){var d;a=a.replace(/\\/g,"/");for(var e=goog.dependencies_,f=0;d=b[f];f++)e.nameToPath[d]=a,a in e.pathToNames||(e.pathToNames[a]={}),e.pathToNames[a][d]=!0;for(d=0;b=c[d];d++)a in e.requires||(e.requires[a]={}),e.requires[a][b]=!0}};goog.useStrictRequires=!1;goog.ENABLE_DEBUG_LOADER=!0;goog.require=function(){};goog.basePath="";goog.nullFunction=function(){};goog.identityFunction=function(a){return a};
goog.abstractMethod=function(){throw Error("unimplemented abstract method");};goog.addSingletonGetter=function(a){a.getInstance=function(){if(a.instance_)return a.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=a);return a.instance_=new a}};goog.instantiatedSingletons_=[];goog.DEPENDENCIES_ENABLED=!1;
goog.DEPENDENCIES_ENABLED&&(goog.included_={},goog.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}},goog.inHtmlDocument_=function(){var a=goog.global.document;return"undefined"!=typeof a&&"write"in a},goog.findBasePath_=function(){if(goog.global.CLOSURE_BASE_PATH)goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var a=goog.global.document,a=a.getElementsByTagName("script"),b=a.length-1;0<=b;--b){var c=a[b].src,d=c.lastIndexOf("?"),d=-1==d?
@@ -19,9 +19,11 @@ goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=
goog.base=function(a,b,c){var d=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!d)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(d.superClass_)return d.superClass_.constructor.apply(a,Array.prototype.slice.call(arguments,1));for(var e=Array.prototype.slice.call(arguments,2),f=!1,g=a.constructor;g;g=g.superClass_&&g.superClass_.constructor)if(g.prototype[b]===d)f=!0;else if(f)return g.prototype[b].apply(a,
e);if(a[b]===d)return a.constructor.prototype[b].apply(a,e);throw Error("goog.base called from a method of one name to a method of a different name");};goog.scope=function(a){a.call(goog.global)};goog.MODIFY_FUNCTION_PROTOTYPES=!0;
goog.MODIFY_FUNCTION_PROTOTYPES&&(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 goog.bind.apply(null,c)}return goog.bind(this,a)},Function.prototype.partial=function(a){var b=Array.prototype.slice.call(arguments);b.unshift(this,null);return goog.bind.apply(null,b)},Function.prototype.inherits=function(a){goog.inherits(this,a)},Function.prototype.mixin=function(a){goog.mixin(this.prototype,
-a)});var cvox={AbstractMsgs:function(){}};cvox.AbstractMsgs.prototype.getMsg=function(){};cvox.AbstractMsgs.prototype.getNumber=function(){};cvox.VERBOSITY_VERBOSE=0;cvox.VERBOSITY_BRIEF=1;cvox.ChromeVox=function(){};cvox.ChromeVox.host=null;cvox.ChromeVox.msgs=null;cvox.ChromeVox.isActive=!0;cvox.ChromeVox.version=null;cvox.ChromeVox.earcons=null;cvox.ChromeVox.navigationManager=null;cvox.ChromeVox.serializer=null;cvox.ChromeVox.isStickyOn=!1;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVox.verbosity=cvox.VERBOSITY_VERBOSE;cvox.ChromeVox.typingEcho=0;cvox.ChromeVox.keyEcho={};cvox.ChromeVox.position={};cvox.ChromeVox.isChromeOS=-1!=navigator.userAgent.indexOf("CrOS");
-cvox.ChromeVox.isMac=-1!=navigator.platform.indexOf("Mac");cvox.ChromeVox.modKeyStr=cvox.ChromeVox.isChromeOS?"Shift+Search":cvox.ChromeVox.isMac?"Ctrl+Cmd":"Shift+Alt";cvox.ChromeVox.sequenceSwitchKeyCodes=[];cvox.ChromeVox.visitedUrls={};cvox.ChromeVox.markInUserCommand=function(){};cvox.ChromeVox.syncToNode=function(){};cvox.ChromeVox.speakNode=function(){};cvox.ChromeVox.executeUserCommand=function(){};cvox.ChromeVox.entireDocumentIsHidden=!1;
-cvox.ChromeVox.storeOn=function(a){a.isStickyOn=cvox.ChromeVox.isStickyOn;cvox.ChromeVox.navigationManager.storeOn(a)};cvox.ChromeVox.readFrom=function(a){cvox.ChromeVox.isStickyOn=a.isStickyOn;cvox.ChromeVox.navigationManager.readFrom(a)};cvox.Cursor=function(a,b,c){this.node=a;this.index=b;this.text=c};cvox.Cursor.prototype.clone=function(){return new cvox.Cursor(this.node,this.index,this.text)};cvox.Cursor.prototype.copyFrom=function(a){this.node=a.node;this.index=a.index;this.text=a.text};cvox.Cursor.prototype.equals=function(a){return this.node==a.node&&this.index==a.index&&this.text==a.text};goog.debug={};goog.debug.Error=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.dom={};goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.string={};goog.string.DETECT_DOUBLE_ESCAPING=!1;goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};goog.string.endsWith=function(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))};goog.string.caseInsensitiveEndsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(a.length-b.length,b.length))};
+a)});goog.defineClass=function(a,b){var c=b.constructor,d=b.statics;if(!c||c==Object.prototype.constructor)throw Error("constructor property is required.");c=goog.defineClass.createSealingConstructor_(c);a&&goog.inherits(c,a);delete b.constructor;delete b.statics;goog.defineClass.applyProperties_(c.prototype,b);null!=d&&(d instanceof Function?d(c):goog.defineClass.applyProperties_(c,d));return c};goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG;
+goog.defineClass.createSealingConstructor_=function(a){if(goog.defineClass.SEAL_CLASS_INSTANCES&&Object.seal instanceof Function){var b=function(){var c=a.apply(this,arguments)||this;this.constructor===b&&Object.seal(c);return c};return b}return a};goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
+goog.defineClass.applyProperties_=function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);for(var d=0;d<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++)c=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d],Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};var cvox={AbstractMsgs:function(){}};cvox.AbstractMsgs.prototype.getMsg=function(){};cvox.AbstractMsgs.prototype.getNumber=function(){};cvox.VERBOSITY_VERBOSE=0;cvox.VERBOSITY_BRIEF=1;cvox.ChromeVox=function(){};cvox.ChromeVox.host=null;cvox.ChromeVox.msgs=null;cvox.ChromeVox.isActive=!0;cvox.ChromeVox.version=null;cvox.ChromeVox.earcons=null;cvox.ChromeVox.navigationManager=null;cvox.ChromeVox.serializer=null;cvox.ChromeVox.isStickyPrefOn=!1;cvox.ChromeVox.stickyOverride=null;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVox.verbosity=cvox.VERBOSITY_VERBOSE;cvox.ChromeVox.typingEcho=0;cvox.ChromeVox.keyEcho={};
+cvox.ChromeVox.position={};cvox.ChromeVox.isChromeOS=-1!=navigator.userAgent.indexOf("CrOS");cvox.ChromeVox.isMac=-1!=navigator.platform.indexOf("Mac");cvox.ChromeVox.modKeyStr=cvox.ChromeVox.isChromeOS?"Shift+Search":cvox.ChromeVox.isMac?"Ctrl+Cmd":"Shift+Alt";cvox.ChromeVox.sequenceSwitchKeyCodes=[];cvox.ChromeVox.visitedUrls={};cvox.ChromeVox.markInUserCommand=function(){};cvox.ChromeVox.syncToNode=function(){};cvox.ChromeVox.speakNode=function(){};cvox.ChromeVox.executeUserCommand=function(){};
+cvox.ChromeVox.entireDocumentIsHidden=!1;cvox.ChromeVox.storeOn=function(a){a.isStickyPrefOn=cvox.ChromeVox.isStickyPrefOn;cvox.ChromeVox.navigationManager.storeOn(a)};cvox.ChromeVox.readFrom=function(a){cvox.ChromeVox.isStickyPrefOn=a.isStickyPrefOn;cvox.ChromeVox.navigationManager.readFrom(a)};cvox.ChromeVox.isStickyModeOn=function(){return null!==cvox.ChromeVox.stickyOverride?cvox.ChromeVox.stickyOverride:cvox.ChromeVox.isStickyPrefOn};cvox.Cursor=function(a,b,c){this.node=a;this.index=b;this.text=c};cvox.Cursor.prototype.clone=function(){return new cvox.Cursor(this.node,this.index,this.text)};cvox.Cursor.prototype.copyFrom=function(a){this.node=a.node;this.index=a.index;this.text=a.text};cvox.Cursor.prototype.equals=function(a){return this.node==a.node&&this.index==a.index&&this.text==a.text};goog.debug={};goog.debug.Error=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.dom={};goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.string={};goog.string.DETECT_DOUBLE_ESCAPING=!1;goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};goog.string.endsWith=function(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))};goog.string.caseInsensitiveEndsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(a.length-b.length,b.length))};
goog.string.caseInsensitiveEquals=function(a,b){return a.toLowerCase()==b.toLowerCase()};goog.string.subs=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")};goog.string.collapseWhitespace=function(a){return a.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};goog.string.isEmpty=function(a){return/^[\s\xa0]*$/.test(a)};goog.string.isEmptySafe=function(a){return goog.string.isEmpty(goog.string.makeSafe(a))};
goog.string.isBreakingWhitespace=function(a){return!/[^\t\n\r ]/.test(a)};goog.string.isAlpha=function(a){return!/[^a-zA-Z]/.test(a)};goog.string.isNumeric=function(a){return!/[^0-9]/.test(a)};goog.string.isAlphaNumeric=function(a){return!/[^a-zA-Z0-9]/.test(a)};goog.string.isSpace=function(a){return" "==a};goog.string.isUnicodeChar=function(a){return 1==a.length&&" "<=a&&"~">=a||"\u0080"<=a&&"\ufffd">=a};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};
goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")};goog.string.normalizeWhitespace=function(a){return a.replace(/\xa0|\s/g," ")};goog.string.normalizeSpaces=function(a){return a.replace(/\xa0|[ \t]+/g," ")};goog.string.collapseBreakingSpaces=function(a){return a.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")};goog.string.trim=function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};
@@ -712,10 +714,11 @@ d++;if(b&&c){for(var d=a,e=0;d&&!cvox.DomUtil.isDescendantOfNode(b,d);)d=d.paren
cvox.DomUtil.getValue=function(a){var b=cvox.AriaUtil.getActiveDescendant(a);if(b)return cvox.DomUtil.collapseWhitespace(cvox.DomUtil.getValue(b)+" "+cvox.DomUtil.getName(b));if(a.constructor==HTMLSelectElement){var b="",c=a.selectedOptions?a.selectedOptions[0]:null;a=a.selectedOptions?a.selectedOptions[a.selectedOptions.length-1]:null;c&&a&&c!=a?b=cvox.ChromeVox.msgs.getMsg("selected_options_value",[c.text,a.text]):c&&(b=c.text+"");return b}if(a.constructor==HTMLTextAreaElement)return a.value;if(a.constructor==
HTMLInputElement)switch(a.type){case "hidden":case "image":case "submit":case "reset":case "button":case "checkbox":case "radio":return"";case "password":return a.value.replace(/./g,"dot ");default:return a.value}return a.isContentEditable?cvox.DomUtil.getNameFromChildren(a,!0):""};
cvox.DomUtil.getImageTitle=function(a){a.hasAttribute("alt")?a=a.alt:a.hasAttribute("title")?a=a.title:(a=a.src,"data"!=a.substring(0,4)?(a=a.substring(a.lastIndexOf("/")+1,a.lastIndexOf(".")),a=1<=a.length&&16>=a.length?a+" Image":"Image"):a="Image");return a};
+cvox.DomUtil.getLabelledByTargets=function(){if(cvox.labelledByTargets)return cvox.labelledByTargets;for(var a=document.querySelectorAll("[aria-labelledby]"),b={},c=0;c<a.length;++c)for(var d=a[c],d=d.getAttribute("aria-labelledby"),d=d.split(/ +/),e=0;e<d.length;e++)b[d[e]]=!0;cvox.labelledByTargets=b;window.setTimeout(function(){cvox.labelledByTargets=null},0);return b};
cvox.DomUtil.hasContent=function(a){if(8==a.nodeType||cvox.DomUtil.isDescendantOf(a,"HEAD")||cvox.DomUtil.isDescendantOf(a,"SCRIPT")||cvox.DomUtil.isDescendantOf(a,"NOSCRIPT")||cvox.DomUtil.isDescendantOf(a,"NOEMBED")||cvox.DomUtil.isDescendantOf(a,"STYLE")||!cvox.DomUtil.isVisible(a)||cvox.AriaUtil.isHidden(a))return!1;if(cvox.DomUtil.isControl(a)||cvox.DomUtil.isDescendantOf(a,"VIDEO")||cvox.DomUtil.isDescendantOf(a,"AUDIO")||"IFRAME"==a.tagName&&a.src&&0!=a.src.indexOf("javascript:"))return!0;
for(var b="button,input,select,textarea",c=a.parentElement;c&&"LABEL"!=c.tagName;)c=c.parentElement;if(c){var d=c.querySelector(b);if(c.hasAttribute("for")){if(c=c.getAttribute("for"),(c=document.getElementById(c))&&cvox.DomUtil.isControl(c)&&!d)return!1}else if(d)return!1}for(d=a.parentElement;d&&"LEGEND"!=d.tagName;)d=d.parentElement;if(d){for(c=d.parentElement;c&&"FIELDSET"!=c.tagName;)c=c.parentElement;d=c&&c.querySelector(b);if(c&&!d)return!1}if(cvox.DomPredicates.linkPredicate([a])||"TABLE"==
-a.tagName&&!cvox.DomUtil.isLayoutTable(a)||cvox.DomUtil.isMath(a)||cvox.DomPredicates.headingPredicate([a]))return!0;b=cvox.DomUtil.getValue(a)+" "+cvox.DomUtil.getName(a);a=cvox.DomUtil.getState(a,!0);return b.match(/^\s+$/)&&""===a?!1:!0};cvox.DomUtil.getAncestors=function(a){for(var b=[];a;)b.push(a),a=a.parentNode;for(b.reverse();b.length&&!b[0].tagName&&!b[0].nodeValue;)b.shift();return b};
-cvox.DomUtil.compareAncestors=function(a,b){for(var c=0;a[c]&&b[c]&&a[c]==b[c];)c++;a[c]||b[c]||(c=-1);return c};cvox.DomUtil.getUniqueAncestors=function(a,b,c){a=cvox.DomUtil.getAncestors(a);b=cvox.DomUtil.getAncestors(b);a=cvox.DomUtil.compareAncestors(a,b);a=b.slice(a);return 0==a.length&&c?b:a};
+a.tagName&&!cvox.DomUtil.isLayoutTable(a)||cvox.DomUtil.isMath(a)||cvox.DomPredicates.headingPredicate([a])||cvox.DomUtil.isFocusable(a))return!0;b=cvox.DomUtil.getLabelledByTargets();for(d=a;d;){if(d.id&&b[d.id])if(c=d.getAttribute("aria-labelledby")){if(c=c.split(/ +/),-1==c.indexOf(d.id))return!1}else return!1;d=d.parentElement}b=cvox.DomUtil.getValue(a)+" "+cvox.DomUtil.getName(a);a=cvox.DomUtil.getState(a,!0);return b.match(/^\s+$/)&&""===a?!1:!0};
+cvox.DomUtil.getAncestors=function(a){for(var b=[];a;)b.push(a),a=a.parentNode;for(b.reverse();b.length&&!b[0].tagName&&!b[0].nodeValue;)b.shift();return b};cvox.DomUtil.compareAncestors=function(a,b){for(var c=0;a[c]&&b[c]&&a[c]==b[c];)c++;a[c]||b[c]||(c=-1);return c};cvox.DomUtil.getUniqueAncestors=function(a,b,c){a=cvox.DomUtil.getAncestors(a);b=cvox.DomUtil.getAncestors(b);a=cvox.DomUtil.compareAncestors(a,b);a=b.slice(a);return 0==a.length&&c?b:a};
cvox.DomUtil.getRoleMsg=function(a,b){var c;c=cvox.AriaUtil.getRoleNameMsg(a);c||("INPUT"==a.tagName?c=cvox.DomUtil.INPUT_TYPE_TO_INFORMATION_TABLE_MSG[a.type]:"A"==a.tagName&&cvox.DomUtil.isInternalLink(a)?c="internal_link":"A"==a.tagName&&a.getAttribute("name")?c="":a.isContentEditable?c="input_type_text":cvox.DomUtil.isMath(a)?c="math_expr":"TABLE"==a.tagName&&cvox.DomUtil.isLayoutTable(a)?c="":b==cvox.VERBOSITY_BRIEF?c=cvox.DomUtil.TAG_TO_INFORMATION_TABLE_BRIEF_MSG[a.tagName]:(c=cvox.DomUtil.TAG_TO_INFORMATION_TABLE_VERBOSE_MSG[a.tagName],
cvox.DomUtil.hasLongDesc(a)&&(c="image_with_long_desc"),!c&&a.onclick&&(c="clickable")));return c};cvox.DomUtil.getRole=function(a,b){var c=cvox.DomUtil.getRoleMsg(a,b)||"",d=c&&" "!=c?cvox.ChromeVox.msgs.getMsg(c):"";return d?d:c};
cvox.DomUtil.getListLength=function(a){var b=0;for(a=a.firstChild;a;a=a.nextSibling)if(cvox.DomUtil.isVisible(a)&&("LI"==a.tagName||a.getAttribute&&"listitem"==a.getAttribute("role"))){if(a.hasAttribute("aria-setsize")){var c=parseInt(a.getAttribute("aria-setsize"),10);if(!isNaN(c))return c}b++}return b};
@@ -813,13 +816,14 @@ cvox.Focuser.shouldEnterSuspendEvents_=function(a){if(a.constructor&&a.construct
cvox.BrailleUtil.TEMPLATE={base:"c n v r s",aria_role_alert:"r: n",aria_role_button:"[n]",aria_role_textbox:"n: v r",input_type_button:"[n]",input_type_checkbox:"n (s)",input_type_email:"n: v r",input_type_number:"n: v r",input_type_password:"n: v r",input_type_search:"n: v r",input_type_submit:"[n]",input_type_text:"n: v r",input_type_tel:"n: v r",input_type_url:"n: v r",tag_button:"[n]",tag_textarea:"n: v r"};cvox.BrailleUtil.ValueSpan=function(a){this.offset=a};
cvox.BrailleUtil.ValueSpan.fromJson=function(a){return new cvox.BrailleUtil.ValueSpan(a.offset)};cvox.BrailleUtil.ValueSpan.prototype.toJson=function(){return this};cvox.Spannable.registerSerializableSpan(cvox.BrailleUtil.ValueSpan,"cvox.BrailleUtil.ValueSpan",cvox.BrailleUtil.ValueSpan.fromJson,cvox.BrailleUtil.ValueSpan.prototype.toJson);cvox.BrailleUtil.ValueSelectionSpan=function(){};cvox.Spannable.registerStatelessSerializableSpan(cvox.BrailleUtil.ValueSelectionSpan,"cvox.BrailleUtil.ValueSelectionSpan");
cvox.BrailleUtil.getName=function(a){return a?cvox.DomUtil.getName(a).trim():""};cvox.BrailleUtil.getRoleMsg=function(a){if(!a)return"";(a=cvox.DomUtil.getRoleMsg(a,cvox.VERBOSITY_VERBOSE))&&(a=cvox.DomUtil.collapseWhitespace(a));a&&0<a.length&&cvox.ChromeVox.msgs.getMsg(a+"_brl")&&(a+="_brl");return a};cvox.BrailleUtil.getRole=function(a){return a?(a=cvox.BrailleUtil.getRoleMsg(a))?cvox.ChromeVox.msgs.getMsg(a):"":""};
-cvox.BrailleUtil.getState=function(a){return a?cvox.NodeStateUtil.expand(cvox.DomUtil.getStateMsgs(a,!0).map(function(a){cvox.ChromeVox.msgs.getMsg(a[0]+"_brl")&&(a[0]+="_brl");return a})):""};cvox.BrailleUtil.getContainer=function(a,b){if(!a||!b)return"";for(var c=cvox.DomUtil.getUniqueAncestors(a,b),d=0,e;e=c[d];d++)if((e=cvox.BrailleUtil.getRoleMsg(e))&&-1!=cvox.BrailleUtil.CONTAINER.indexOf(e))return cvox.ChromeVox.msgs.getMsg(e);return""};
-cvox.BrailleUtil.getValue=function(a){if(!a)return new cvox.Spannable;var b=new cvox.BrailleUtil.ValueSpan(0);if(cvox.DomUtil.isInputTypeText(a)){var c=a.value;"password"===a.type&&(c=c.replace(/./g,"*"));b=new cvox.Spannable(c,b);if(a===document.activeElement&&cvox.DomUtil.doesInputSupportSelection(a)){var d=goog.math.clamp(a.selectionStart,0,b.getLength());a=goog.math.clamp(a.selectionEnd,0,b.getLength());b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a))}return b}if(a instanceof
-HTMLTextAreaElement){d=new cvox.EditableTextAreaShadow;d.update(a);var e=d.getLineIndex(a.selectionEnd),c=d.getLineStart(e),d=d.getLineEnd(e),d=a.value.substring(c,d);b.offset=c;b=new cvox.Spannable(d,b);a===document.activeElement&&(d=goog.math.clamp(a.selectionStart-c,0,b.getLength()),a=goog.math.clamp(a.selectionEnd-c,0,b.getLength()),b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a)));return b}return new cvox.Spannable(cvox.DomUtil.getValue(a),b)};
-cvox.BrailleUtil.getTemplated=function(a,b,c){c=c?c:{};var d=c.roleMsg||(b?cvox.DomUtil.getRoleMsg(b,cvox.VERBOSITY_VERBOSE):""),e=c.role;!e&&c.roleMsg&&(e=cvox.ChromeVox.msgs.getMsg(c.roleMsg+"_brl")||cvox.ChromeVox.msgs.getMsg(c.roleMsg));for(var e=e||cvox.BrailleUtil.getRole(b),d=cvox.BrailleUtil.TEMPLATE[d]||cvox.BrailleUtil.TEMPLATE.base,f=new cvox.Spannable,g=function(d){switch(d){case "n":return c.name||cvox.BrailleUtil.getName(b);case "r":return e;case "s":return c.state||cvox.BrailleUtil.getState(b);
-case "c":return c.container||cvox.BrailleUtil.getContainer(a,b);case "v":return c.value||cvox.BrailleUtil.getValue(b);default:return d}},h=0;h<d.length;h++){var k=g(d[h]);f.append(k);k.toString()||" "!=d[h+1]||h++}return f.trimRight()};cvox.BrailleUtil.createValue=function(a,b,c,d){a=new cvox.Spannable(a,new cvox.BrailleUtil.ValueSpan(d||0));goog.isDef(b)&&(c=goog.isDef(c)?c:b,b>c&&(d=b,b=c,c=d),a.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,b,c));return a};
+cvox.BrailleUtil.getState=function(a){return a?cvox.NodeStateUtil.expand(cvox.DomUtil.getStateMsgs(a,!0).map(function(a){var c=["dummy","dummy","dummy"];cvox.ChromeVox.msgs.getMsg(a[0]+"_brl",c)&&(a[0]+="_brl");return a})):""};cvox.BrailleUtil.getContainer=function(a,b){if(!a||!b)return"";for(var c=cvox.DomUtil.getUniqueAncestors(a,b),d=0,e;e=c[d];d++)if((e=cvox.BrailleUtil.getRoleMsg(e))&&-1!=cvox.BrailleUtil.CONTAINER.indexOf(e))return cvox.ChromeVox.msgs.getMsg(e);return""};
+cvox.BrailleUtil.getValue=function(a){if(!a)return new cvox.Spannable;var b=new cvox.BrailleUtil.ValueSpan(0);if(cvox.DomUtil.isInputTypeText(a)){var c=a.value;"password"===a.type&&(c=c.replace(/./g,"*"));b=new cvox.Spannable(c,b);if(a===document.activeElement&&cvox.DomUtil.doesInputSupportSelection(a)){var d=cvox.BrailleUtil.clamp_(a.selectionStart,0,b.getLength());a=cvox.BrailleUtil.clamp_(a.selectionEnd,0,b.getLength());b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,
+a))}return b}if(a instanceof HTMLTextAreaElement){d=new cvox.EditableTextAreaShadow;d.update(a);var e=d.getLineIndex(a.selectionEnd),c=d.getLineStart(e),d=d.getLineEnd(e),d=a.value.substring(c,d);b.offset=c;b=new cvox.Spannable(d,b);a===document.activeElement&&(d=cvox.BrailleUtil.clamp_(a.selectionStart-c,0,b.getLength()),a=cvox.BrailleUtil.clamp_(a.selectionEnd-c,0,b.getLength()),b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a)));return b}return new cvox.Spannable(cvox.DomUtil.getValue(a),
+b)};
+cvox.BrailleUtil.getTemplated=function(a,b,c){c=c?c:{};var d=c.roleMsg||(b?cvox.DomUtil.getRoleMsg(b,cvox.VERBOSITY_VERBOSE):""),e=c.role;!e&&c.roleMsg&&(e=cvox.ChromeVox.msgs.getMsg(c.roleMsg+"_brl")||cvox.ChromeVox.msgs.getMsg(c.roleMsg));for(var e=e||cvox.BrailleUtil.getRole(b),d=cvox.BrailleUtil.TEMPLATE[d]||cvox.BrailleUtil.TEMPLATE.base,f=new cvox.Spannable,g=function(d){switch(d){case "n":return c.name||cvox.BrailleUtil.getName(b);case "r":return e;case "s":return c.state||cvox.BrailleUtil.getState(b);case "c":return c.container||
+cvox.BrailleUtil.getContainer(a,b);case "v":return c.value||cvox.BrailleUtil.getValue(b);default:return d}},h=0;h<d.length;h++){var k=g(d[h]);f.append(k);k.toString()||" "!=d[h+1]||h++}return f.trimRight()};cvox.BrailleUtil.createValue=function(a,b,c,d){a=new cvox.Spannable(a,new cvox.BrailleUtil.ValueSpan(d||0));goog.isDef(b)&&(c=goog.isDef(c)?c:b,b>c&&(d=b,b=c,c=d),a.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,b,c));return a};
cvox.BrailleUtil.click=function(a,b){var c=a.text.getSpans(b||0),d=c.filter(function(a){return a instanceof Node})[0];d&&(cvox.Focuser.setFocus(d),goog.isDef(b)&&(cvox.DomUtil.isInputTypeText(d)||d instanceof HTMLTextAreaElement)&&(c=c.filter(function(a){return a instanceof cvox.BrailleUtil.ValueSpan})[0]))&&(c=b-a.text.getSpanStart(c)+c.offset,cvox.ChromeVoxEventWatcher.setUpTextHandler(),d.selectionStart=d.selectionEnd=c,cvox.ChromeVoxEventWatcher.handleTextChanged(!0));cvox.DomUtil.clickElem(d||
-cvox.ChromeVox.navigationManager.getCurrentNode(),!1,!1)};cvox.BrailleTextHandler=function(a){this.braille_=a};cvox.BrailleTextHandler.prototype.changed=function(a,b,c,d,e,f){var g;d?(d=cvox.BrailleUtil.createValue(a,b,c,f),e&&d.setSpan(e,0,a.length),g=new cvox.NavBraille({text:d,startIndex:b,endIndex:c})):cvox.ChromeVox.navigationManager&&(g=cvox.ChromeVox.navigationManager.getBraille());g&&this.braille_.write(g)};cvox.ContentEditableExtractor=function(){this.text_="";this.end_=this.start_=0;this.lines_={};this.characterToLineMap_=[]};
+cvox.ChromeVox.navigationManager.getCurrentNode(),!1,!1)};cvox.BrailleUtil.clamp_=function(a,b,c){return Math.min(Math.max(a,b),c)};cvox.BrailleTextHandler=function(a){this.braille_=a};cvox.BrailleTextHandler.prototype.changed=function(a,b,c,d,e,f){var g;d?(d=cvox.BrailleUtil.createValue(a,b,c,f),e&&d.setSpan(e,0,a.length),g=new cvox.NavBraille({text:d,startIndex:b,endIndex:c})):cvox.ChromeVox.navigationManager&&(g=cvox.ChromeVox.navigationManager.getBraille());g&&this.braille_.write(g)};cvox.ContentEditableExtractor=function(){this.text_="";this.end_=this.start_=0;this.lines_={};this.characterToLineMap_=[]};
cvox.ContentEditableExtractor.prototype.update=function(a){for(var b={0:{startIndex:0,endIndex:0}},c=new cvox.Cursor(a,0,""),d=c.clone(),e=document.createRange(),f,g=0,h=null,k="",l=0,n=-1,p=-1,q=window.getSelection(),m=new cvox.Cursor(q.baseNode,q.baseOffset,""),q=new cvox.Cursor(q.extentNode,q.extentOffset,""),s=!1,u=!1;;){f=[];var t=[],r=cvox.TraverseUtil.forwardsChar(d,f,t),v=!1;r||(v=!0);for(f=0;f<t.length&&!v;f++)t[f]==a&&(v=!0);if(v)break;e.setStart(c.node,c.index);e.setEnd(d.node,d.index);
if((f=e.getBoundingClientRect())&&0!=f.width&&0!=f.height){null!==h&&f.bottom!=h&&0<l&&k.substr(-1).match(/\S/)&&r.match(/\S/)&&(k+="\n",l++);if(c.node!=d.node&&0<d.index&&(e.setStart(d.node,d.index-1),f=e.getBoundingClientRect(),!f||0==f.width||0==f.height))continue;!s&&-1==n&&d.node==m.node&&d.index>=m.index&&(d.index>m.index?n=l:s=!0);!u&&-1==p&&d.node==q.node&&d.index>=q.index&&(d.index>q.index?p=l:u=!0);null===h?h=f.bottom:f.bottom!=h&&(b[g].endIndex=l,g++,b[g]={startIndex:l,endIndex:l},h=f.bottom);
k+=r;l++;c=d.clone();s&&(n=l,s=!1);u&&(p=l,u=!1)}}b[g].endIndex=l;a=[];for(f=0;f<=g;f++)for(c=b[f].startIndex;c<=b[f].endIndex;c++)a[c]=f;this.text_=k;this.characterToLineMap_=a;this.lines_=b;this.start_=0<=n?n:k.length;this.end_=0<=p?p:k.length};cvox.ContentEditableExtractor.prototype.getText=function(){return this.text_};cvox.ContentEditableExtractor.prototype.getStartIndex=function(){return this.start_};cvox.ContentEditableExtractor.prototype.getEndIndex=function(){return this.end_};
@@ -863,7 +867,8 @@ cvox.LibLouis.prototype.onInstanceLoad_=function(){window.console.info("loaded l
cvox.LibLouis.prototype.onInstanceError_=function(){window.console.error("failed to load liblouis Native Client instance");this.instanceState_=cvox.LibLouis.InstanceState.ERROR;this.pendingTranslators_.forEach(goog.bind(function(a){this.getTranslator(a.tableName,a.callback)},this));this.pendingTranslators_.length=0};
cvox.LibLouis.prototype.onInstanceMessage_=function(a){goog.DEBUG&&window.console.debug("RPC <- "+a.data);a=JSON.parse(a.data);var b=a.in_reply_to;if(goog.isDef(b)){goog.isDef(a.error)&&window.console.error("liblouis Native Client error",a.error);var c=this.pendingRpcCallbacks_[b];goog.isDef(c)&&(delete this.pendingRpcCallbacks_[b],c(a))}else window.console.warn("liblouis Native Client module sent message with no ID",a)};cvox.LibLouis.Translator=function(a,b){this.instance_=a;this.tableName_=b};
cvox.LibLouis.Translator.prototype.translate=function(a,b){var c={table_name:this.tableName_,text:a};this.instance_.rpc_("Translate",c,function(d){var e=null,f=null,g=null;d.success&&goog.isString(d.cells)?(e=cvox.LibLouis.Translator.decodeHexString_(d.cells),goog.isDef(d.text_to_braille)&&(f=d.text_to_braille),goog.isDef(d.braille_to_text)&&(g=d.braille_to_text)):0<a.length&&console.error("Braille translation error for "+JSON.stringify(c));b(e,f,g)})};
-cvox.LibLouis.Translator.decodeHexString_=function(a){if(!/^([0-9a-f]{2})*$/i.test(a))throw Error("invalid hexadecimal string");for(var b=new Uint8Array(a.length/2),c=0,d=0;d<a.length;d+=2)b[c++]=parseInt(a.substring(d,d+2),16);return b.buffer};cvox.LibLouis.Translator.encodeHexString_=function(a){a=new Uint8Array(a);for(var b="",c=0;c<a.length;c++)var d=a[c],b=b+((16>d?"0":"")+d.toString(16));return b};cvox.ChromeVoxJSON||(cvox.ChromeVoxJSON={});
+cvox.LibLouis.Translator.prototype.backTranslate=function(a,b){var c={table_name:this.tableName_,cells:cvox.LibLouis.Translator.encodeHexString_(a)};this.instance_.rpc_("BackTranslate",c,function(a){a.success&&goog.isString(a.text)?b(a.text):b(null)})};cvox.LibLouis.Translator.decodeHexString_=function(a){if(!/^([0-9a-f]{2})*$/i.test(a))throw Error("invalid hexadecimal string");for(var b=new Uint8Array(a.length/2),c=0,d=0;d<a.length;d+=2)b[c++]=parseInt(a.substring(d,d+2),16);return b.buffer};
+cvox.LibLouis.Translator.encodeHexString_=function(a){a=new Uint8Array(a);for(var b="",c=0;c<a.length;c++)var d=a[c],b=b+((16>d?"0":"")+d.toString(16));return b};cvox.ChromeVoxJSON||(cvox.ChromeVoxJSON={});
window.JSON&&"[object JSON]"==window.JSON.toString()?cvox.ChromeVoxJSON=window.JSON:function(){function a(a){return 10>a?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=h[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(a,d){var e,h,m,s,u=f,t,r=d[a];r&&"object"===typeof r&&"function"===typeof r.toJSON&&(r=r.toJSON(a));"function"===typeof k&&(r=k.call(d,a,r));switch(typeof r){case "string":return b(r);
case "number":return isFinite(r)?String(r):"null";case "boolean":case "null":return String(r);case "object":if(!r)return"null";f+=g;t=[];if("[object Array]"===Object.prototype.toString.apply(r)){s=r.length;for(e=0;e<s;e+=1)t[e]=c(e,r)||"null";m=0===t.length?"[]":f?"[\n"+f+t.join(",\n"+f)+"\n"+u+"]":"["+t.join(",")+"]";f=u;return m}if(k&&"object"===typeof k)for(s=k.length,e=0;e<s;e+=1)h=k[e],"string"===typeof h&&(m=c(h,r))&&t.push(b(h)+(f?": ":":")+m);else for(h in r)Object.hasOwnProperty.call(r,h)&&
(m=c(h,r))&&t.push(b(h)+(f?": ":":")+m);m=0===t.length?"{}":f?"{\n"+f+t.join(",\n"+f)+"\n"+u+"}":"{"+t.join(",")+"}";f=u;return m}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":"null"},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});
@@ -881,30 +886,42 @@ cvox.ExtensionBridge.gotPongFromBackgroundPage=function(a){var b=cvox.ExtensionB
cvox.ExtensionBridge.sendBackgroundToContentScript=function(a){chrome.tabs.query({active:!0,lastFocusedWindow:!0},function(b){b&&0<b.length?chrome.tabs.sendMessage(b[0].id,a):cvox.ExtensionBridge.portCache_.forEach(function(b){b.postMessage(a)})})};cvox.ExtensionBridge.init();cvox.BrailleCaptionsBackground={};cvox.BrailleCaptionsBackground.PREF_KEY="brailleCaptions";cvox.BrailleCaptionsBackground.BRAILLE_UNICODE_BLOCK_START=10240;cvox.BrailleCaptionsBackground.init=function(a){var b=cvox.BrailleCaptionsBackground;b.stateCallback_=a};cvox.BrailleCaptionsBackground.isEnabled=function(){var a=cvox.BrailleCaptionsBackground;return"true"===localStorage[a.PREF_KEY]};
cvox.BrailleCaptionsBackground.setContent=function(a,b){for(var c=cvox.BrailleCaptionsBackground,d=new Uint8Array(b),e="",f=0;f<d.length;++f)e+=String.fromCharCode(c.BRAILLE_UNICODE_BLOCK_START|d[f]);cvox.ExtensionBridge.send({message:"BRAILLE_CAPTION",text:a,brailleChars:e})};
cvox.BrailleCaptionsBackground.setActive=function(a){var b=cvox.BrailleCaptionsBackground,c=b.isEnabled();window.prefs.setPref(b.PREF_KEY,String(a));c!=a&&(b.stateCallback_&&b.stateCallback_(),a=a?cvox.ChromeVox.msgs.getMsg("braille_captions_enabled"):cvox.ChromeVox.msgs.getMsg("braille_captions_disabled"),cvox.ChromeVox.tts.speak(a),cvox.ChromeVox.braille.write(cvox.NavBraille.fromText(a)))};
-cvox.BrailleCaptionsBackground.getVirtualDisplayState=function(){var a=cvox.BrailleCaptionsBackground;return a.isEnabled()?{available:!0,textCellCount:40}:{available:!1}};cvox.ExpandingBrailleTranslator=function(a,b){this.defaultTranslator_=a;this.uncontractedTranslator_=b||null};
-cvox.ExpandingBrailleTranslator.prototype.translate=function(a,b){function c(a,b,c){g.push({translator:a,start:b,end:c})}function d(a,b,c,d){a.cells=b;a.textToBraille=c;a.brailleToText=d;0>=--n&&e()}function e(){function a(b,c,d){b.push.apply(b,c.map(function(a){return d+a}))}for(var c=g.reduce(function(a,b){return a+b.cells.byteLength},0),c=new Uint8Array(c),d=0,e=[],f=[],h=0,k;k=g[h];++h)c.set(new Uint8Array(k.cells),d),a(e,k.textToBraille,d),a(f,k.brailleToText,k.start),d+=k.cells.byteLength;b(c.buffer,
-e,f)}var f=this.findExpandRanges_(a);if(0==f.length)this.defaultTranslator_.translate(a.toString(),cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_(a.getLength(),b));else{for(var g=[],h=0,k=0;k<f.length;++k){var l=f[k];h<l.start&&c(this.defaultTranslator_,h,l.start);c(this.uncontractedTranslator_,l.start,l.end);h=l.end}h<a.getLength()&&c(this.defaultTranslator_,h,a.getLength());for(var n=g.length,k=0;f=g[k];++k)f.translator.translate(a.toString().substring(f.start,f.end),cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_(f.end-
-f.start,goog.partial(d,f)))}};cvox.ExpandingBrailleTranslator.rangeForPosition_=function(a,b){if(0>b||b>=a.length)throw Error("Position out of range looking for braille expansion range");var c=a.substring(0,b+1).search(/(\s+|\S+)$/),d=b+/^(\s+|\S+)/.exec(a.substring(b))[0].length;return{start:c,end:d}};
-cvox.ExpandingBrailleTranslator.prototype.findExpandRanges_=function(a){var b=[];if(this.uncontractedTranslator_){var c=a.getSpanInstanceOf(cvox.BrailleUtil.ValueSelectionSpan);if(c){var d=a.getSpanStart(c),e=a.getSpanEnd(c);if(d<a.getLength())for(c=[d],e>d+1&&c.push(e-1),d=null,e=0;e<c.length;++e){var f=cvox.ExpandingBrailleTranslator.rangeForPosition_(a.toString(),c[e]);d&&d.end>=f.start?d.end=f.end:(b.push(f),d=f)}}}return b};
-cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_=function(a,b){return function(c,d,e){b(c||new ArrayBuffer(0),d||goog.array.repeat(0,a),e||[])}};cvox.BrailleDisplayManager=function(){this.translator_=null;this.content_=new cvox.NavBraille({});this.translatedContent_=new ArrayBuffer(0);this.panPosition_=0;this.commandListener_=function(){};this.realDisplayState_=this.displayState_={available:!1,textCellCount:void 0};this.textToBraille_=[];this.brailleToText_=[];cvox.BrailleCaptionsBackground.init(goog.bind(this.onCaptionsStateChanged_,this));if(goog.isDef(chrome.brailleDisplayPrivate)){var a=goog.bind(this.refreshDisplayState_,this);chrome.brailleDisplayPrivate.getDisplayState(a);
-chrome.brailleDisplayPrivate.onDisplayStateChanged.addListener(a);chrome.brailleDisplayPrivate.onKeyEvent.addListener(goog.bind(this.onKeyEvent_,this))}else this.onCaptionsStateChanged_()};cvox.BrailleDisplayManager.CURSOR_DOTS_=192;cvox.BrailleDisplayManager.prototype.setContent=function(a){this.translateContent_(a)};cvox.BrailleDisplayManager.prototype.setCommandListener=function(a){this.commandListener_=a};
-cvox.BrailleDisplayManager.prototype.setTranslator=function(a,b){var c=null!=this.translator_;this.translator_=a?new cvox.ExpandingBrailleTranslator(a,b):null;this.translateContent_(this.content_);c&&!this.translator_&&this.refresh_()};cvox.BrailleDisplayManager.prototype.refreshDisplayState_=function(a){this.realDisplayState_=a;this.displayState_=a.available?a:cvox.BrailleCaptionsBackground.getVirtualDisplayState();this.panPosition_=0;this.refresh_()};
-cvox.BrailleDisplayManager.prototype.onCaptionsStateChanged_=function(){this.refreshDisplayState_(this.realDisplayState_)};
+cvox.BrailleCaptionsBackground.getVirtualDisplayState=function(){var a=cvox.BrailleCaptionsBackground;return a.isEnabled()?{available:!0,textCellCount:40}:{available:!1}};cvox.ExpandingBrailleTranslator=function(a,b){this.defaultTranslator_=a;this.uncontractedTranslator_=b||null};cvox.ExpandingBrailleTranslator.ExpansionType={NONE:0,SELECTION:1,ALL:2};
+cvox.ExpandingBrailleTranslator.prototype.translate=function(a,b,c){function d(a,b,c){h.push({translator:a,start:b,end:c})}function e(a,b,c,d){a.cells=b;a.textToBraille=c;a.brailleToText=d;0>=--n&&f()}function f(){function a(b,c,d){b.push.apply(b,c.map(function(a){return d+a}))}for(var b=h.reduce(function(a,b){return a+b.cells.byteLength},0),b=new Uint8Array(b),d=0,e=[],f=[],g=0,k;k=h[g];++g)b.set(new Uint8Array(k.cells),d),a(e,k.textToBraille,d),a(f,k.brailleToText,k.start),d+=k.cells.byteLength;
+c(b.buffer,e,f)}var g=this.findExpandRanges_(a,b);if(0==g.length)this.defaultTranslator_.translate(a.toString(),cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_(a.getLength(),c));else{var h=[],k=0;for(b=0;b<g.length;++b){var l=g[b];k<l.start&&d(this.defaultTranslator_,k,l.start);d(this.uncontractedTranslator_,l.start,l.end);k=l.end}k<a.getLength()&&d(this.defaultTranslator_,k,a.getLength());var n=h.length;for(b=0;g=h[b];++b)g.translator.translate(a.toString().substring(g.start,g.end),cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_(g.end-
+g.start,goog.partial(e,g)))}};cvox.ExpandingBrailleTranslator.rangeForPosition_=function(a,b,c,d){if(0>c||d>a.length)throw RangeError("End-points out of range looking for braille expansion range");if(b<c||b>=d)throw RangeError("Position out of range looking for braille expansion range");c=a.substring(c,b+1).search(/(\s+|\S+)$/)+c;d=b+/^(\s+|\S+)/.exec(a.substring(b,d))[0].length;return{start:c,end:d}};
+cvox.ExpandingBrailleTranslator.prototype.findExpandRanges_=function(a,b){var c=[];if(this.uncontractedTranslator_&&b!=cvox.ExpandingBrailleTranslator.ExpansionType.NONE){var d=a.getSpanInstanceOf(cvox.BrailleUtil.ValueSpan);if(d){var e=a.getSpanStart(d),d=a.getSpanEnd(d);switch(b){case cvox.ExpandingBrailleTranslator.ExpansionType.SELECTION:this.addRangesForSelection_(a,e,d,c);break;case cvox.ExpandingBrailleTranslator.ExpansionType.ALL:c.push({start:e,end:d})}}}return c};
+cvox.ExpandingBrailleTranslator.prototype.addRangesForSelection_=function(a,b,c,d){var e=a.getSpanInstanceOf(cvox.BrailleUtil.ValueSelectionSpan);if(e){var f=a.getSpanStart(e),g=a.getSpanEnd(e);if(!(f<b||g>c))for(e=[],f==c?f>b&&e.push(f-1):(f==g&&f>b&&e.push(f-1),e.push(f),g>f+1&&e.push(g-1)),f=d[d.length-1]||null,g=0;g<e.length;++g){var h=cvox.ExpandingBrailleTranslator.rangeForPosition_(a.toString(),e[g],b,c);f&&f.end>=h.start?f.end=h.end:(d.push(h),f=h)}}};
+cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_=function(a,b){return function(c,d,e){if(!d){d=Array(a);for(var f=0;f<a;++f)d[f]=0}b(c||new ArrayBuffer(0),d,e||[])}};cvox.BrailleDisplayManager=function(){this.translator_=null;this.content_=new cvox.NavBraille({});this.expansionType_=cvox.ExpandingBrailleTranslator.ExpansionType.SELECTION;this.translatedContent_=new ArrayBuffer(0);this.panPosition_=0;this.commandListener_=function(){};this.realDisplayState_=this.displayState_={available:!1,textCellCount:void 0};this.textToBraille_=[];this.brailleToText_=[];cvox.BrailleCaptionsBackground.init(goog.bind(this.onCaptionsStateChanged_,this));if(goog.isDef(chrome.brailleDisplayPrivate)){var a=
+goog.bind(this.refreshDisplayState_,this);chrome.brailleDisplayPrivate.getDisplayState(a);chrome.brailleDisplayPrivate.onDisplayStateChanged.addListener(a);chrome.brailleDisplayPrivate.onKeyEvent.addListener(goog.bind(this.onKeyEvent_,this))}else this.onCaptionsStateChanged_()};cvox.BrailleDisplayManager.CURSOR_DOTS_=192;cvox.BrailleDisplayManager.prototype.setContent=function(a,b){this.translateContent_(a,b)};
+cvox.BrailleDisplayManager.prototype.setCommandListener=function(a){this.commandListener_=a};cvox.BrailleDisplayManager.prototype.setTranslator=function(a,b){var c=null!=this.translator_;this.translator_=a?new cvox.ExpandingBrailleTranslator(a,b):null;this.translateContent_(this.content_,this.expansionType_);c&&!this.translator_&&this.refresh_()};
+cvox.BrailleDisplayManager.prototype.refreshDisplayState_=function(a){this.realDisplayState_=a;this.displayState_=a.available?a:cvox.BrailleCaptionsBackground.getVirtualDisplayState();this.panPosition_=0;this.refresh_()};cvox.BrailleDisplayManager.prototype.onCaptionsStateChanged_=function(){this.refreshDisplayState_(this.realDisplayState_)};
cvox.BrailleDisplayManager.prototype.refresh_=function(){if(this.displayState_.available){var a=this.translatedContent_.slice(this.panPosition_,this.panPosition_+this.displayState_.textCellCount);this.realDisplayState_.available&&chrome.brailleDisplayPrivate.writeDots(a);if(cvox.BrailleCaptionsBackground.isEnabled()){var b=this.brailleToTextPosition_(this.panPosition_),c=this.brailleToTextPosition_(this.panPosition_+a.byteLength);cvox.BrailleCaptionsBackground.setContent(this.content_.text.toString().substring(b,
c),a)}}};
-cvox.BrailleDisplayManager.prototype.translateContent_=function(a){this.translator_?this.translator_.translate(a.text,goog.bind(function(b,c,d){this.content_=a;var e=this.content_.startIndex,f=this.content_.endIndex;this.panPosition_=0;if(0<=e){if(e>=c.length){var e=new ArrayBuffer(b.byteLength+1),g=new Uint8Array(e);g.set(new Uint8Array(b));b=e;e=b.byteLength-1}else e=c[e];f=f>=c.length?b.byteLength:c[f];this.writeCursor_(b,e,f);this.displayState_.available&&(f=this.displayState_.textCellCount,this.panPosition_=
-Math.floor(e/f)*f)}this.translatedContent_=b;this.brailleToText_=d;this.textToBraille_=c;this.refresh_()},this)):(this.content_=a,this.translatedContent_=new ArrayBuffer(0),this.textToBraille_.length=0,this.brailleToText_.length=0)};
-cvox.BrailleDisplayManager.prototype.onKeyEvent_=function(a){switch(a.command){case cvox.BrailleKeyCommand.ROUTING:a.displayPosition=this.brailleToTextPosition_(a.displayPosition+this.panPosition_);case cvox.BrailleKeyCommand.LINE_UP:case cvox.BrailleKeyCommand.LINE_DOWN:case cvox.BrailleKeyCommand.TOP:case cvox.BrailleKeyCommand.BOTTOM:this.commandListener_(a,this.content_);break;case cvox.BrailleKeyCommand.PAN_LEFT:this.panLeft_();break;case cvox.BrailleKeyCommand.PAN_RIGHT:this.panRight_()}};
+cvox.BrailleDisplayManager.prototype.translateContent_=function(a,b){this.translator_?this.translator_.translate(a.text,b,goog.bind(function(c,d,e){this.content_=a;this.expansionType_=b;var f=this.content_.startIndex,g=this.content_.endIndex;this.panPosition_=0;if(0<=f){if(f>=d.length){var f=new ArrayBuffer(c.byteLength+1),h=new Uint8Array(f);h.set(new Uint8Array(c));c=f;f=c.byteLength-1}else f=d[f];g=g>=d.length?c.byteLength:d[g];this.writeCursor_(c,f,g);this.displayState_.available&&(g=this.displayState_.textCellCount,
+this.panPosition_=Math.floor(f/g)*g)}this.translatedContent_=c;this.brailleToText_=e;this.textToBraille_=d;this.refresh_()},this)):(this.content_=a,this.expansionType_=b,this.translatedContent_=new ArrayBuffer(0),this.textToBraille_.length=0,this.brailleToText_.length=0)};
+cvox.BrailleDisplayManager.prototype.onKeyEvent_=function(a){switch(a.command){case cvox.BrailleKeyCommand.PAN_LEFT:this.panLeft_();break;case cvox.BrailleKeyCommand.PAN_RIGHT:this.panRight_();break;case cvox.BrailleKeyCommand.ROUTING:a.displayPosition=this.brailleToTextPosition_(a.displayPosition+this.panPosition_);default:this.commandListener_(a,this.content_)}};
cvox.BrailleDisplayManager.prototype.panLeft_=function(){0>=this.panPosition_?this.commandListener_({command:cvox.BrailleKeyCommand.PAN_LEFT},this.content_):(this.panPosition_=Math.max(0,this.panPosition_-this.displayState_.textCellCount),this.refresh_())};
cvox.BrailleDisplayManager.prototype.panRight_=function(){var a=this.panPosition_+this.displayState_.textCellCount;a>=this.translatedContent_.byteLength?this.commandListener_({command:cvox.BrailleKeyCommand.PAN_RIGHT},this.content_):(this.panPosition_=a,this.refresh_())};
-cvox.BrailleDisplayManager.prototype.writeCursor_=function(a,b,c){if(!(0>b||b>=a.byteLength||c<b||c>a.byteLength))for(b==c&&(c=b+1),a=new DataView(a);b<c;){var d=a.getUint8(b),d=d|cvox.BrailleDisplayManager.CURSOR_DOTS_;a.setUint8(b,d);b++}};cvox.BrailleDisplayManager.prototype.brailleToTextPosition_=function(a){var b=this.brailleToText_;return 0>a?(console.error("WARNING: Braille position < 0: "+a),0):a>=b.length?this.content_.text.getLength():b[a]};cvox.BrailleTable={};cvox.BrailleTable.TABLE_PATH="chromevox/background/braille/tables.json";cvox.BrailleTable.getAll=function(a){var b=chrome.extension.getURL(cvox.BrailleTable.TABLE_PATH);if(!b)throw"Invalid path: "+cvox.BrailleTable.TABLE_PATH;var c=new XMLHttpRequest;c.open("GET",b,!0);c.onreadystatechange=function(){4==c.readyState&&200==c.status&&a(JSON.parse(c.responseText))};c.send()};cvox.BrailleTable.forId=function(a,b){return a.filter(function(a){return a.id===b})[0]||null};
-cvox.BrailleTable.getUncontracted=function(a,b){function c(a,b){return"6"===a.dots&&"8"===b.dots&&goog.string.startsWith(a.locale,b.locale)||a.locale===b.locale&&a.dots===b.dots&&goog.isDef(a.grade)&&goog.isDef(b.grade)&&b.grade<a.grade?b:a}return a.reduce(c,b)};cvox.BrailleBackground=function(a){this.displayManager_=a||new cvox.BrailleDisplayManager;cvox.BrailleTable.getAll(goog.bind(function(a){this.tables_=a;this.initialize_(0)},this));this.displayManager_.setCommandListener(goog.bind(this.sendCommand_,this));this.lastContentId_=this.lastContent_=null};goog.inherits(cvox.BrailleBackground,cvox.AbstractBraille);cvox.BrailleBackground.prototype.write=function(a){this.lastContent_=this.lastContentId_=null;this.displayManager_.setContent(a)};
-cvox.BrailleBackground.prototype.setCommandListener=function(){};
+cvox.BrailleDisplayManager.prototype.writeCursor_=function(a,b,c){if(!(0>b||b>=a.byteLength||c<b||c>a.byteLength))for(b==c&&(c=b+1),a=new DataView(a);b<c;){var d=a.getUint8(b),d=d|cvox.BrailleDisplayManager.CURSOR_DOTS_;a.setUint8(b,d);b++}};cvox.BrailleDisplayManager.prototype.brailleToTextPosition_=function(a){var b=this.brailleToText_;return 0>a?(console.error("WARNING: Braille position < 0: "+a),0):a>=b.length?this.content_.text.getLength():b[a]};cvox.BrailleInputHandler=function(){this.imePort_=null;this.imeActive_=!1;this.activeTranslator_=this.uncontractedTranslator_=this.defaultTranslator_=this.inputContext_=null;this.cells_=[];this.currentTextAfter_=this.currentTextBefore_=this.text_="";this.pendingTextsBefore_=[];this.pendingCells_=[]};cvox.BrailleInputHandler.IME_EXTENSION_ID_="jddehjeebkoimngcbdkaahpobgicbffp";cvox.BrailleInputHandler.IME_PORT_NAME_="cvox.BrailleIme.Port";
+cvox.BrailleInputHandler.prototype.init=function(){chrome.runtime.onConnectExternal.addListener(goog.bind(this.onImeConnect_,this))};cvox.BrailleInputHandler.prototype.setTranslator=function(a,b){this.defaultTranslator_=a;this.uncontractedTranslator_=b||null;this.resetText_()};
+cvox.BrailleInputHandler.prototype.onDisplayContentChanged=function(a){var b=a.getSpanInstanceOf(cvox.BrailleUtil.ValueSpan),c=a.getSpanInstanceOf(cvox.BrailleUtil.ValueSelectionSpan);if(b&&c){var d=a.getSpanStart(b),b=a.getSpanEnd(b),e=a.getSpanStart(c),c=a.getSpanEnd(c);if(e<d||c>b)console.error("Selection outside of value in braille content"),this.resetText_();else{var f=this.currentTextBefore_;this.currentTextBefore_=a.toString().substring(d,e);this.currentTextAfter_=a.toString().substring(c,
+b);if(0<this.cells_.length){if(f!==this.currentTextBefore_){if(0<this.pendingTextsBefore_.length)for(a=0;a<this.pendingTextsBefore_.length;++a)if(this.currentTextBefore_===this.pendingTextsBefore_[a]){this.pendingTextsBefore_.splice(0,a+1);return}this.resetText_()}}else this.updateActiveTranslator_()}}};cvox.BrailleInputHandler.prototype.onBrailleKeyEvent=function(a){if(a.command===cvox.BrailleKeyCommand.DOTS)return this.onBrailleDots_(a.brailleDots);this.pendingCells_.length=0;return!1};
+cvox.BrailleInputHandler.prototype.getExpansionType=function(){return this.inAlwaysUncontractedContext_()?cvox.ExpandingBrailleTranslator.ExpansionType.ALL:0<this.cells_.length&&this.activeTranslator_===this.defaultTranslator_?cvox.ExpandingBrailleTranslator.ExpansionType.NONE:cvox.ExpandingBrailleTranslator.ExpansionType.SELECTION};cvox.BrailleInputHandler.prototype.inAlwaysUncontractedContext_=function(){if(this.inputContext_){var a=this.inputContext_.type;return"url"===a||"email"===a}return!1};
+cvox.BrailleInputHandler.prototype.onBrailleDots_=function(a){if(!this.imeActive_)return this.pendingCells_.push(a),!0;if(!this.inputContext_||!this.activeTranslator_)return!1;0<this.cells_.length&&0==this.cells_[this.cells_.length-1]&&this.resetText_();this.cells_.push(a);a=(new Uint8Array(this.cells_)).buffer;this.activeTranslator_.backTranslate(a,goog.bind(function(a){if(a){var c=this.text_.length,d=this.longestCommonPrefixLength_(this.text_,a);this.text_=a;c-=d;a=a.substring(d);if(0<c||0<a.length)d=
+this.currentTextBefore_.substring(0,this.currentTextBefore_.length-c),0<c&&this.pendingTextsBefore_.push(d),0<a.length&&this.pendingTextsBefore_.push(d+a),this.postImeMessage_({type:"replaceText",contextID:this.inputContext_.contextID,deleteBefore:c,newText:a})}else console.error("Error when backtranslating braille cells")},this));return!0};cvox.BrailleInputHandler.prototype.resetText_=function(){this.cells_.length=0;this.text_="";this.pendingTextsBefore_.length=0;this.updateActiveTranslator_()};
+cvox.BrailleInputHandler.prototype.updateActiveTranslator_=function(){this.activeTranslator_=this.defaultTranslator_;if(this.uncontractedTranslator_){var a=this.currentTextBefore_,b=this.currentTextAfter_;if(this.inAlwaysUncontractedContext_()||0<a.length&&/\S$/.test(a)||0<b.length&&/^\S/.test(b))this.activeTranslator_=this.uncontractedTranslator_}};
+cvox.BrailleInputHandler.prototype.onImeConnect_=function(a){a.name===cvox.BrailleInputHandler.IME_PORT_NAME_&&a.sender.id===cvox.BrailleInputHandler.IME_EXTENSION_ID_&&(this.imePort_&&this.imePort_.disconnect(),a.onDisconnect.addListener(goog.bind(this.onImeDisconnect_,this,a)),a.onMessage.addListener(goog.bind(this.onImeMessage_,this)),this.imePort_=a)};
+cvox.BrailleInputHandler.prototype.onImeMessage_=function(a){goog.isObject(a)||console.error("Unexpected message from Braille IME: ",JSON.stringify(a));switch(a.type){case "activeState":this.imeActive_=a.active;break;case "inputContext":this.inputContext_=a.context;this.resetText_();this.imeActive_&&this.inputContext_&&this.pendingCells_.forEach(goog.bind(this.onBrailleDots_,this));this.pendingCells_.length=0;break;case "brailleDots":this.onBrailleDots_(a.dots);break;case "reset":this.resetText_();
+break;default:console.error("Unexpected message from Braille IME: ",JSON.stringify(a))}};cvox.BrailleInputHandler.prototype.onImeDisconnect_=function(){this.imePort_=null;this.resetText_();this.imeActive_=!1;this.inputContext_=null};cvox.BrailleInputHandler.prototype.postImeMessage_=function(a){return this.imePort_?(this.imePort_.postMessage(a),!0):!1};
+cvox.BrailleInputHandler.prototype.longestCommonPrefixLength_=function(a,b){var c=Math.min(a.length,b.length),d;for(d=0;d<c&&a.charAt(d)==b.charAt(d);++d);return d};cvox.BrailleTable={};cvox.BrailleTable.TABLE_PATH="chromevox/background/braille/tables.json";cvox.BrailleTable.getAll=function(a){var b=chrome.extension.getURL(cvox.BrailleTable.TABLE_PATH);if(!b)throw"Invalid path: "+cvox.BrailleTable.TABLE_PATH;var c=new XMLHttpRequest;c.open("GET",b,!0);c.onreadystatechange=function(){4==c.readyState&&200==c.status&&a(JSON.parse(c.responseText))};c.send()};cvox.BrailleTable.forId=function(a,b){return a.filter(function(a){return a.id===b})[0]||null};
+cvox.BrailleTable.getUncontracted=function(a,b){function c(a,b){return"6"===a.dots&&"8"===b.dots&&0==a.locale.lastIndexOf(b.locale,0)||a.locale===b.locale&&a.dots===b.dots&&goog.isDef(a.grade)&&goog.isDef(b.grade)&&b.grade<a.grade?b:a}return a.reduce(c,b)};cvox.BrailleBackground=function(a,b){this.displayManager_=a||new cvox.BrailleDisplayManager;cvox.BrailleTable.getAll(goog.bind(function(a){this.tables_=a;this.initialize_(0)},this));this.displayManager_.setCommandListener(goog.bind(this.onBrailleKeyEvent_,this));this.lastContentId_=this.lastContent_=null;this.inputHandler_=b||new cvox.BrailleInputHandler;this.inputHandler_.init()};goog.inherits(cvox.BrailleBackground,cvox.AbstractBraille);
+cvox.BrailleBackground.prototype.write=function(a){this.lastContent_=this.lastContentId_=null;this.inputHandler_.onDisplayContentChanged(a.text);this.displayManager_.setContent(a,this.inputHandler_.getExpansionType())};cvox.BrailleBackground.prototype.setCommandListener=function(){};
cvox.BrailleBackground.prototype.refreshTranslator=function(){if(this.liblouis_){var a=this.tables_,b=cvox.BrailleTable.forId(a,localStorage.brailleTable);if(!b){var c=chrome.i18n.getMessage("@@ui_locale").split(/[_-]/),d=c[0],e=c[1],c=a.filter(function(a){return a.locale.split(/[_-]/)[0]==d});0<c.length&&(b=c[0],e&&(c=c.filter(function(a){return a.locale.split(/[_-]/)[1]==e}),0<c.length&&(b=c[0])))}b||(b=cvox.BrailleTable.forId(a,"en-US-comp8"));localStorage.brailleTable=b.id;"6"==b.dots?(localStorage.brailleTableType=
-"brailleTable6",localStorage.brailleTable6=b.id):(localStorage.brailleTableType="brailleTable8",localStorage.brailleTable8=b.id);localStorage.brailleTable6||(localStorage.brailleTable6="en-US-g1");localStorage.brailleTable8||(localStorage.brailleTable8="en-US-comp8");var c=cvox.BrailleTable.forId(a,localStorage.brailleTable8),f=cvox.BrailleTable.getUncontracted(a,c?c:b);this.liblouis_.getTranslator(b.fileName,goog.bind(function(a){f.id===b.id?this.displayManager_.setTranslator(a):this.liblouis_.getTranslator(f.fileName,
-goog.bind(function(b){this.displayManager_.setTranslator(a,b)},this))},this))}};cvox.BrailleBackground.prototype.onBrailleMessage=function(a){"write"==a.action&&(this.lastContentId_=a.contentId,this.lastContent_=cvox.NavBraille.fromJson(a.params),this.displayManager_.setContent(this.lastContent_))};
+"brailleTable6",localStorage.brailleTable6=b.id):(localStorage.brailleTableType="brailleTable8",localStorage.brailleTable8=b.id);localStorage.brailleTable6||(localStorage.brailleTable6="en-US-g1");localStorage.brailleTable8||(localStorage.brailleTable8="en-US-comp8");var c=cvox.BrailleTable.forId(a,localStorage.brailleTable8),f=cvox.BrailleTable.getUncontracted(a,c?c:b);this.liblouis_.getTranslator(b.fileName,goog.bind(function(a){f.id===b.id?(this.displayManager_.setTranslator(a),this.inputHandler_.setTranslator(a)):
+this.liblouis_.getTranslator(f.fileName,goog.bind(function(b){this.displayManager_.setTranslator(a,b);this.inputHandler_.setTranslator(a,b)},this))},this))}};cvox.BrailleBackground.prototype.onBrailleMessage=function(a){"write"==a.action&&(this.lastContentId_=a.contentId,this.lastContent_=cvox.NavBraille.fromJson(a.params),this.inputHandler_.onDisplayContentChanged(this.lastContent_.text),this.displayManager_.setContent(this.lastContent_,this.inputHandler_.getExpansionType()))};
cvox.BrailleBackground.prototype.initialize_=function(a){5<a?console.error("Timeout waiting for document.body; not initializing braille."):document.body?(this.liblouis_=new cvox.LibLouis(chrome.extension.getURL("chromevox/background/braille/liblouis_nacl.nmf"),chrome.extension.getURL("chromevox/background/braille/tables")),this.liblouis_.attachToElement(document.body),this.refreshTranslator()):window.setTimeout(goog.bind(this.initialize_,this,++a),500)};
-cvox.BrailleBackground.prototype.sendCommand_=function(a,b){var c={message:"BRAILLE",args:a};b===this.lastContent_&&(c.contentId=this.lastContentId_);cvox.ExtensionBridge.send(c)};cvox.EarconsBackground=function(){cvox.AbstractEarcons.call(this);this.audioMap={};"false"===localStorage.earcons&&(this.enabled=!1)};goog.inherits(cvox.EarconsBackground,cvox.AbstractEarcons);cvox.EarconsBackground.prototype.getName=function(){return"ChromeVox earcons"};cvox.EarconsBackground.prototype.getBaseUrl=function(){return cvox.EarconsBackground.BASE_URL};
+cvox.BrailleBackground.prototype.onBrailleKeyEvent_=function(a,b){this.inputHandler_.onBrailleKeyEvent(a)||this.sendCommand_(a,b)};cvox.BrailleBackground.prototype.sendCommand_=function(a,b){var c={message:"BRAILLE",args:a};b===this.lastContent_&&(c.contentId=this.lastContentId_);cvox.ExtensionBridge.send(c)};cvox.EarconsBackground=function(){cvox.AbstractEarcons.call(this);this.audioMap={};"false"===localStorage.earcons&&(this.enabled=!1)};goog.inherits(cvox.EarconsBackground,cvox.AbstractEarcons);cvox.EarconsBackground.prototype.getName=function(){return"ChromeVox earcons"};cvox.EarconsBackground.prototype.getBaseUrl=function(){return cvox.EarconsBackground.BASE_URL};
cvox.EarconsBackground.prototype.playEarcon=function(a){cvox.EarconsBackground.superClass_.playEarcon.call(this,a);if(this.enabled){window.console&&window.console.log("Earcon "+this.getEarconName(a));this.currentAudio=this.audioMap[a];this.currentAudio||(this.currentAudio=new Audio(this.getBaseUrl()+this.getEarconFilename(a)),this.audioMap[a]=this.currentAudio);try{this.currentAudio.currentTime=0}catch(b){}this.currentAudio.paused&&(this.currentAudio.volume=.7,this.currentAudio.play())}};
cvox.EarconsBackground.BASE_URL="earcons/";cvox.MathUtil={};cvox.MathUtil.isMathmlNodeOfClass_=function(a,b){return-1!=b.indexOf(a.tagName.toUpperCase())};cvox.MathUtil.isMathjaxNodeOfClass_=function(a,b){if("SPAN"==a.tagName){var c=a.className.split(" ");return c.some(function(a){return-1!=b.indexOf(a.toUpperCase())})}return!1};cvox.MathUtil.isMathNodeOfClass_=function(a,b){return a.nodeType==Node.ELEMENT_NODE&&(cvox.MathUtil.isMathmlNodeOfClass_(a,b)||cvox.MathUtil.isMathjaxNodeOfClass_(a,b))};cvox.MathUtil.TOKEN_LIST="MI MN MO MTEXT MSPACE MS".split(" ");
cvox.MathUtil.isToken=function(a){return cvox.MathUtil.isMathNodeOfClass_(a,cvox.MathUtil.TOKEN_LIST)};cvox.MathUtil.LAYOUT_LIST="MROW MFRAC MSQRT MROOT MSTYLE MERROR MPADDED MPHANTOM MFENCED MENCLOSE".split(" ");cvox.MathUtil.isLayout=function(a){return cvox.MathUtil.isMathNodeOfClass_(a,cvox.MathUtil.LAYOUT_LIST)};cvox.MathUtil.SCRIPT_LIST="MSUB MSUP MSUBSUP MUNDER MOVER MUNDEROVER MMULTISCRIPTS MPRESCRIPTS".split(" ");
@@ -1076,19 +1093,20 @@ cvox.TtsBackground.prototype.preprocess=function(a,b){b=b?b:{};b.math&&(a=this.p
cvox.TtsBackground.prototype.preprocessMath_=function(a,b){if(!this.mathmap)return a;var c="",c=cvox.MathStore.createDynamicConstraint(b.domain,b.style);return(c=this.mathmap.store.lookupString(a,c))?c:a};cvox.TtsBackground.prototype.getNumberAsDigits_=function(a){return a.replace(/\d+/g,function(a){return 4>=a.length?a:a.split("").join(" ")})};
cvox.TtsBackground.prototype.createPunctuationReplace_=function(a){return goog.bind(function(b){var c=-1!=this.retainPunctuation_.indexOf(b)?b:" ";return a?c:" "+(new goog.i18n.MessageFormat(cvox.ChromeVox.msgs.getMsg(cvox.AbstractTts.CHARACTER_DICTIONARY[b]))).format({COUNT:1})+c+" "},this)};
cvox.TtsBackground.prototype.pronouncePhonetically_=function(a){if(!this.PHONETIC_MAP_)return!1;a=a.toLowerCase();if(a=this.PHONETIC_MAP_[a]){this.clearTimeout_();var b=this;this.timeoutId_=setTimeout(function(){b.speak(a,1)},cvox.TtsBackground.PHONETIC_DELAY_MS_);return!0}return!1};cvox.TtsBackground.prototype.clearTimeout_=function(){goog.isDef(this.timeoutId_)&&(clearTimeout(this.timeoutId_),this.timeoutId_=void 0)};
-cvox.TtsBackground.prototype.setDefaultVoiceName_=function(){chrome.tts.getVoices(goog.bind(function(a){var b=chrome.i18n.getMessage("@@ui_locale").replace("_","-");a.sort(function(a,d){return a.remote&&!d.remote?1:!a.remote&&d.remote||a.lang==b&&d.lang!=b?-1:a.lang!=b&&d.lang==b?1:0});a[0]&&(this.currentVoice=a=a[0].voiceName)},this))};chrome.accessibilityPrivate||(chrome.accessibilityPrivate=chrome.experimental.accessibility);cvox.AccessibilityApiHandler=function(a,b,c){this.tts=a;this.braille=b;this.earcons=c;this.prevDescription_={};try{chrome.accessibilityPrivate.setAccessibilityEnabled(!0),chrome.accessibilityPrivate.setNativeAccessibilityEnabled(!cvox.ChromeVox.isActive),this.addEventListeners_(),cvox.ChromeVox.isActive&&this.queueAlertsForActiveTab()}catch(d){console.log("Error trying to access accessibility extension api.")}};
+cvox.TtsBackground.prototype.setDefaultVoiceName_=function(){chrome.tts.getVoices(goog.bind(function(a){var b=chrome.i18n.getMessage("@@ui_locale").replace("_","-");a.sort(function(a,d){return a.remote&&!d.remote?1:!a.remote&&d.remote||a.lang==b&&d.lang!=b?-1:a.lang!=b&&d.lang==b?1:0});a[0]&&(this.currentVoice=a=a[0].voiceName)},this))};chrome.experimental||(chrome.experimental={});chrome.accessibilityPrivate||(chrome.accessibilityPrivate=chrome.experimental.accessibility);cvox.AccessibilityApiHandler=function(a,b,c){this.tts=a;this.braille=b;this.earcons=c;this.prevDescription_={};try{chrome.accessibilityPrivate.setAccessibilityEnabled(!0),chrome.accessibilityPrivate.setNativeAccessibilityEnabled(!cvox.ChromeVox.isActive),this.addEventListeners_(),cvox.ChromeVox.isActive&&this.queueAlertsForActiveTab()}catch(d){console.log("Error trying to access accessibility extension api.")}};
cvox.AccessibilityApiHandler.prototype.tts=null;cvox.AccessibilityApiHandler.prototype.braille=null;cvox.AccessibilityApiHandler.prototype.earcons=null;cvox.AccessibilityApiHandler.prototype.editableTextHandler=null;cvox.AccessibilityApiHandler.prototype.editableTextName="";cvox.AccessibilityApiHandler.prototype.nextQueueMode=0;cvox.AccessibilityApiHandler.prototype.textChangeTimeout=null;cvox.AccessibilityApiHandler.prototype.lastContext=null;
cvox.AccessibilityApiHandler.prototype.TEXT_CHANGE_DELAY=10;cvox.AccessibilityApiHandler.prototype.idleSpeechTimeout_=null;cvox.AccessibilityApiHandler.prototype.idleSpeechQueue_=[];cvox.AccessibilityApiHandler.prototype.IDLE_SPEECH_DELAY_MS=500;cvox.AccessibilityApiHandler.prototype.setWebContext=function(){this.lastContext="--internal-web--";this.editableTextHandler=null;this.editableTextName=""};
cvox.AccessibilityApiHandler.prototype.addEventListeners_=function(){var a=goog.bind(cvox.ChromeVox.msgs.getMsg,cvox.ChromeVox.msgs);chrome.tabs.onCreated.addListener(goog.bind(function(){cvox.ChromeVox.isActive&&(this.tts.speak(a("chrome_tab_created"),0,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT),this.braille.write(cvox.NavBraille.fromText(a("chrome_tab_created"))),this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN))},this));chrome.tabs.onRemoved.addListener(goog.bind(function(){cvox.ChromeVox.isActive&&
this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE)},this));chrome.tabs.onActivated.addListener(goog.bind(function(b){cvox.ChromeVox.isActive&&chrome.tabs.get(b.tabId,goog.bind(function(b){"loading"!=b.status&&(b=b.title?b.title:b.url,this.tts.speak(a("chrome_tab_selected",[b]),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT),this.braille.write(cvox.NavBraille.fromText(a("chrome_tab_selected",[b]))),this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_SELECT),this.queueAlertsForActiveTab())},
-this))},this));chrome.tabs.onUpdated.addListener(goog.bind(function(a){cvox.ChromeVox.isActive&&chrome.tabs.get(a,goog.bind(function(a){a.active&&("loading"==a.status?this.earcons.playEarcon(cvox.AbstractEarcons.BUSY_PROGRESS_LOOP):this.earcons.playEarcon(cvox.AbstractEarcons.TASK_SUCCESS))},this))},this));chrome.windows.onFocusChanged.addListener(goog.bind(function(b){cvox.ChromeVox.isActive&&b!=chrome.windows.WINDOW_ID_NONE&&chrome.windows.get(b,goog.bind(function(c){chrome.tabs.getSelected(b,goog.bind(function(b){var e=
-c.incognito?"chrome_incognito_window_selected":"chrome_normal_window_selected";b=b.title?b.title:b.url;this.tts.speak(a(e,[b]),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);this.braille.write(cvox.NavBraille.fromText(a(e,[b])));this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_SELECT)},this))},this))},this));chrome.accessibilityPrivate.onWindowOpened.addListener(goog.bind(function(a){cvox.ChromeVox.isActive&&(this.tts.speak(a.name,cvox.AbstractTts.QUEUE_MODE_FLUSH,
+this))},this));chrome.tabs.onUpdated.addListener(goog.bind(function(a){cvox.ChromeVox.isActive&&chrome.tabs.get(a,goog.bind(function(a){a.active&&("loading"==a.status?this.earcons.playEarcon(cvox.AbstractEarcons.BUSY_PROGRESS_LOOP):this.earcons.playEarcon(cvox.AbstractEarcons.TASK_SUCCESS))},this))},this));chrome.windows.onFocusChanged.addListener(goog.bind(function(b){cvox.ChromeVox.isActive&&b!=chrome.windows.WINDOW_ID_NONE&&chrome.windows.get(b,goog.bind(function(d){chrome.tabs.getSelected(b,goog.bind(function(b){var c=
+d.incognito?"chrome_incognito_window_selected":"chrome_normal_window_selected";b=b.title?b.title:b.url;this.tts.speak(a(c,[b]),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);this.braille.write(cvox.NavBraille.fromText(a(c,[b])));this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_SELECT)},this))},this))},this));chrome.accessibilityPrivate.onWindowOpened.addListener(goog.bind(function(a){cvox.ChromeVox.isActive&&(this.tts.speak(a.name,cvox.AbstractTts.QUEUE_MODE_FLUSH,
cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT),this.braille.write(cvox.NavBraille.fromText(a.name)),this.nextQueueMode=1,this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN),this.queueAlertsForActiveTab())},this));chrome.accessibilityPrivate.onWindowClosed.addListener(goog.bind(function(){cvox.ChromeVox.isActive&&this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE)},this));chrome.accessibilityPrivate.onMenuOpened.addListener(goog.bind(function(b){cvox.ChromeVox.isActive&&(this.tts.speak(a("chrome_menu_opened",
-[b.name]),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT),this.braille.write(cvox.NavBraille.fromText(a("chrome_menu_opened",[b.name]))),this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN))},this));chrome.accessibilityPrivate.onMenuClosed.addListener(goog.bind(function(){cvox.ChromeVox.isActive&&this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE)},this));chrome.permissions.contains({permissions:["systemPrivate"]},goog.bind(function(b){if(b){var c=goog.bind(function(){chrome.systemPrivate.onVolumeChanged.addListener(goog.bind(function(){cvox.ChromeVox.isActive&&
-this.earcons.playEarcon(cvox.AbstractEarcons.TASK_SUCCESS)},this))},this);chrome.commandLinePrivate?chrome.commandLinePrivate.hasSwitch("disable-volume-adjust-sound",goog.bind(function(a){a&&c()},this)):c();chrome.systemPrivate.onBrightnessChanged.addListener(goog.bind(function(b){b.userInitiated&&(this.earcons.playEarcon(cvox.AbstractEarcons.TASK_SUCCESS),this.tts.speak(a("chrome_brightness_changed",[b.brightness]),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT),this.braille.write(cvox.NavBraille.fromText(a("chrome_brightness_changed",
+[b.name]),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT),this.braille.write(cvox.NavBraille.fromText(a("chrome_menu_opened",[b.name]))),this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN))},this));chrome.accessibilityPrivate.onMenuClosed.addListener(goog.bind(function(){cvox.ChromeVox.isActive&&this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE)},this));chrome.permissions.contains({permissions:["systemPrivate"]},goog.bind(function(b){if(b){var d=goog.bind(function(){chrome.systemPrivate.onVolumeChanged.addListener(goog.bind(function(){cvox.ChromeVox.isActive&&
+this.earcons.playEarcon(cvox.AbstractEarcons.TASK_SUCCESS)},this))},this);chrome.commandLinePrivate?chrome.commandLinePrivate.hasSwitch("disable-volume-adjust-sound",goog.bind(function(a){a&&d()},this)):d();chrome.systemPrivate.onBrightnessChanged.addListener(goog.bind(function(b){b.userInitiated&&(this.earcons.playEarcon(cvox.AbstractEarcons.TASK_SUCCESS),this.tts.speak(a("chrome_brightness_changed",[b.brightness]),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT),this.braille.write(cvox.NavBraille.fromText(a("chrome_brightness_changed",
[b.brightness]))))},this));chrome.systemPrivate.onScreenUnlocked.addListener(goog.bind(function(){chrome.systemPrivate.getUpdateStatus(goog.bind(function(b){cvox.ChromeVox.isActive&&"NeedRestart"==b.state&&(this.tts.speak(a("chrome_system_need_restart"),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT),this.braille.write(cvox.NavBraille.fromText(a("chrome_system_need_restart"))))},this))},this));chrome.systemPrivate.onWokeUp.addListener(goog.bind(function(){cvox.ChromeVox.isActive&&
-this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN)},this))}},this));chrome.accessibilityPrivate.onControlFocused.addListener(goog.bind(this.onControlFocused,this));chrome.accessibilityPrivate.onControlAction.addListener(goog.bind(function(a){cvox.ChromeVox.isActive&&(a=this.describe(a,!0),this.tts.speak(a.utterance,cvox.AbstractTts.QUEUE_MODE_FLUSH,a.ttsProps),a.braille.write(),a.earcon&&this.earcons.playEarcon(a.earcon))},this));chrome.accessibilityPrivate.onTextChanged.addListener(goog.bind(function(a){if(cvox.ChromeVox.isActive)if(this.editableTextHandler&&
-this.editableTextName==a.name&&this.lastContext==a.context)this.textChangeTimeout&&window.clearTimeout(this.textChangeTimeout),this.textChangeTimeout=window.setTimeout(goog.bind(function(){var c=new cvox.TextChangeEvent(a.details.value,a.details.selectionStart,a.details.selectionEnd,!0);this.editableTextHandler.changed(c);this.describe(a,!1).braille.write()},this),this.TEXT_CHANGE_DELAY);else this.onControlFocused(a)},this));this.tts.addCapturingEventListener(this)};
+this.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN)},this))}},this));chrome.accessibilityPrivate.onControlFocused.addListener(goog.bind(this.onControlFocused,this));chrome.accessibilityPrivate.onControlAction.addListener(goog.bind(function(a){cvox.ChromeVox.isActive&&(a=this.describe(a,!0),this.tts.speak(a.utterance,cvox.AbstractTts.QUEUE_MODE_FLUSH,a.ttsProps),a.braille.write(),a.earcon&&this.earcons.playEarcon(a.earcon))},this));try{chrome.accessibilityPrivate.onControlHover.addListener(goog.bind(function(a){if(cvox.ChromeVox.isActive){var b=
+"ontouchstart"in window;b&&(a=this.describe(a,!1),this.tts.speak(a.utterance,cvox.AbstractTts.QUEUE_MODE_FLUSH,a.ttsProps),a.braille.write(),a.earcon&&this.earcons.playEarcon(a.earcon))}},this))}catch(b){}chrome.accessibilityPrivate.onTextChanged.addListener(goog.bind(function(a){if(cvox.ChromeVox.isActive)if(this.editableTextHandler&&this.editableTextName==a.name&&this.lastContext==a.context)this.textChangeTimeout&&window.clearTimeout(this.textChangeTimeout),this.textChangeTimeout=window.setTimeout(goog.bind(function(){var b=
+new cvox.TextChangeEvent(a.details.value,a.details.selectionStart,a.details.selectionEnd,!0);this.editableTextHandler.changed(b);this.describe(a,!1).braille.write()},this),this.TEXT_CHANGE_DELAY);else this.onControlFocused(a)},this));this.tts.addCapturingEventListener(this)};
cvox.AccessibilityApiHandler.prototype.onControlFocused=function(a){if(cvox.ChromeVox.isActive){var b=this.describe(a,!1);if("textbox"==a.type){var c=a.details.selectionStart,d=a.details.selectionEnd;c>d&&(c=a.details.selectionEnd,d=a.details.selectionStart);this.editableTextName=a.name;this.editableTextHandler=new cvox.ChromeVoxEditableTextBase(a.details.value,c,d,a.details.isPassword,this.tts)}else this.editableTextHandler=null;this.tts.speak(b.utterance,this.nextQueueMode,b.ttsProps);b.braille.write();
this.nextQueueMode=0;b.earcon&&this.earcons.playEarcon(b.earcon)}};cvox.AccessibilityApiHandler.prototype.onTtsStart=function(){this.idleSpeechTimeout_&&window.clearTimeout(this.idleSpeechTimeout_)};cvox.AccessibilityApiHandler.prototype.onTtsEnd=function(){0<this.idleSpeechQueue_.length&&(this.idleSpeechTimeout_=window.setTimeout(goog.bind(this.onTtsIdle,this),this.IDLE_SPEECH_DELAY_MS))};
cvox.AccessibilityApiHandler.prototype.onTtsIdle=function(){if(0!=this.idleSpeechQueue_.length){var a=this.idleSpeechQueue_.shift();goog.bind(cvox.ChromeVox.msgs.getMsg,cvox.ChromeVox.msgs);this.tts.speak(a,cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT)}};
@@ -1244,10 +1262,9 @@ cvox.SpokenMessages.speak=function(a){for(var b=0;b<cvox.SpokenMessages.messages
c.id);cvox.ChromeVox.tts.speak(d,a,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);a=cvox.AbstractTts.QUEUE_MODE_QUEUE}cvox.SpokenMessages.messages=[]};cvox.SpokenMessages.currentMessage=function(){if(0==cvox.SpokenMessages.messages.length)throw"Invalid usage of SpokenMessages; start the chain using $m()";return cvox.SpokenMessages.messages[cvox.SpokenMessages.messages.length-1]};cvox.SpokenMessages.withCount=function(a){cvox.SpokenMessages.currentMessage().count=a;return cvox.SpokenMessages};
cvox.SpokenMessages.andIndexTotal=function(a,b){var c=new cvox.SpokenMessage;c.raw=cvox.ChromeVox.msgs.getMsg("index_total",[a,b]);cvox.SpokenMessages.messages.push(c);return cvox.SpokenMessages};cvox.SpokenMessages.andEnd=function(){return cvox.SpokenMessages.andMessage("end")};cvox.SpokenMessages.andMessage=function(a){var b=new cvox.SpokenMessage;b.id="string"==typeof a?[a]:a;cvox.SpokenMessages.messages.push(b);return cvox.SpokenMessages};
cvox.SpokenMessages.andRawMessage=function(a){var b=new cvox.SpokenMessage;b.raw=a;cvox.SpokenMessages.messages.push(b);return cvox.SpokenMessages};cvox.SpokenMessages.andPause=function(){return cvox.SpokenMessages.andMessage("pause")};cvox.$m=cvox.SpokenMessages.andMessage;cvox.Widget=function(){this.active=!1;this.initialNode=null;cvox.Widget.ref_&&cvox.Widget.ref_.isActive()||(cvox.Widget.ref_=this)};cvox.Widget.prototype.isActive=function(){return this.active};
-cvox.Widget.prototype.show=function(){this.isActive()&&this.hide(!0);this.onKeyDown=goog.bind(this.onKeyDown,this);this.onKeyPress=goog.bind(this.onKeyPress,this);window.addEventListener("keydown",this.onKeyDown,!0);window.addEventListener("keypress",this.onKeyPress,!0);this.initialNode=cvox.ChromeVox.navigationManager.getCurrentNode();this.isStickyOn=cvox.ChromeVox.isStickyOn;cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!1,announce:!1});this.getNameMsg()&&
-this.getHelpMsg()&&cvox.$m(this.getNameMsg()).andPause().andMessage(this.getHelpMsg()).speakFlush();cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN);this.active=!0};
-cvox.Widget.prototype.hide=function(a){window.removeEventListener("keypress",this.onKeyPress,!0);window.removeEventListener("keydown",this.onKeyDown,!0);cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:this.isStickyOn,announce:!1});cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE);a||(this.initialNode=1==this.initialNode.nodeType?this.initialNode:this.initialNode.parentNode,cvox.ApiImplementation.syncToNode(this.initialNode,!0,cvox.AbstractTts.QUEUE_MODE_QUEUE));
-this.active=!1};cvox.Widget.prototype.toggle=function(){this.isActive()?this.hide():this.show()};cvox.Widget.prototype.onKeyDown=function(a){if(27==a.keyCode)return this.hide(),a.preventDefault(),!0;if(9==a.keyCode)return this.hide(),!0;17==a.keyCode&&cvox.ChromeVox.tts.stop();a.stopPropagation();return!0};cvox.Widget.prototype.onKeyPress=function(){return!1};cvox.Widget.isActive=function(){return cvox.Widget.ref_&&cvox.Widget.ref_.isActive()||!1};cvox.MathmlStore=function(){cvox.MathStore.call(this)};goog.inherits(cvox.MathmlStore,cvox.MathStore);goog.addSingletonGetter(cvox.MathmlStore);cvox.MathmlStore.prototype.defineDefaultMathmlRule=function(a,b){this.defineRule(a,"default.default",b,"self::mathml:"+a)};cvox.SpeechRuleEngine=function(){this.activeStore_=null;this.dynamicCstr={};this.dynamicCstr[cvox.SpeechRule.DynamicCstrAttrib.STYLE]="short"};goog.addSingletonGetter(cvox.SpeechRuleEngine);cvox.SpeechRuleEngine.prototype.parameterize=function(a){try{a.initialize()}catch(b){if("StoreError"==b.name)console.log("Store Error:",b.message);else throw b;}this.activeStore_=a};cvox.SpeechRuleEngine.prototype.setDynamicConstraint=function(a){a&&(this.dynamicCstr=a)};
+cvox.Widget.prototype.show=function(){this.isActive()&&this.hide(!0);this.onKeyDown=goog.bind(this.onKeyDown,this);this.onKeyPress=goog.bind(this.onKeyPress,this);window.addEventListener("keydown",this.onKeyDown,!0);window.addEventListener("keypress",this.onKeyPress,!0);this.initialNode=cvox.ChromeVox.navigationManager.getCurrentNode();cvox.ChromeVox.stickyOverride=!1;this.getNameMsg()&&this.getHelpMsg()&&cvox.$m(this.getNameMsg()).andPause().andMessage(this.getHelpMsg()).speakFlush();cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN);
+this.active=!0};cvox.Widget.prototype.hide=function(a){window.removeEventListener("keypress",this.onKeyPress,!0);window.removeEventListener("keydown",this.onKeyDown,!0);cvox.ChromeVox.stickyOverride=null;cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE);a||(this.initialNode=1==this.initialNode.nodeType?this.initialNode:this.initialNode.parentNode,cvox.ApiImplementation.syncToNode(this.initialNode,!0,cvox.AbstractTts.QUEUE_MODE_QUEUE));this.active=!1};
+cvox.Widget.prototype.toggle=function(){this.isActive()?this.hide():this.show()};cvox.Widget.prototype.onKeyDown=function(a){if(27==a.keyCode)return this.hide(),a.preventDefault(),!0;if(9==a.keyCode)return this.hide(),!0;17==a.keyCode&&cvox.ChromeVox.tts.stop();a.stopPropagation();return!0};cvox.Widget.prototype.onKeyPress=function(){return!1};cvox.Widget.isActive=function(){return cvox.Widget.ref_&&cvox.Widget.ref_.isActive()||!1};cvox.MathmlStore=function(){cvox.MathStore.call(this)};goog.inherits(cvox.MathmlStore,cvox.MathStore);goog.addSingletonGetter(cvox.MathmlStore);cvox.MathmlStore.prototype.defineDefaultMathmlRule=function(a,b){this.defineRule(a,"default.default",b,"self::mathml:"+a)};cvox.SpeechRuleEngine=function(){this.activeStore_=null;this.dynamicCstr={};this.dynamicCstr[cvox.SpeechRule.DynamicCstrAttrib.STYLE]="short"};goog.addSingletonGetter(cvox.SpeechRuleEngine);cvox.SpeechRuleEngine.prototype.parameterize=function(a){try{a.initialize()}catch(b){if("StoreError"==b.name)console.log("Store Error:",b.message);else throw b;}this.activeStore_=a};cvox.SpeechRuleEngine.prototype.setDynamicConstraint=function(a){a&&(this.dynamicCstr=a)};
cvox.SpeechRuleEngine.prototype.constructString=function(a,b){if(!b)return"";if('"'==b.charAt(0))return b.slice(1,-1);var c=this.activeStore_.customStrings.lookup(b);return c?c(a):cvox.XpathUtil.evaluateString(b,a)};cvox.SpeechRuleEngine.prototype.evaluateNode=function(a){return a?this.evaluateTree_(a):[]};
cvox.SpeechRuleEngine.prototype.evaluateTree_=function(a){var b=this.activeStore_.lookupRule(a,this.dynamicCstr);if(!b)return this.activeStore_.evaluateDefault(a);for(var b=b.action.components,c=[],d=0,e;e=b[d];d++){var f=[],g=e.content||"";switch(e.type){case cvox.SpeechRule.Type.NODE:(g=this.activeStore_.applyQuery(a,g))&&(f=this.evaluateTree_(g));break;case cvox.SpeechRule.Type.MULTI:g=this.activeStore_.applySelector(a,g);0<g.length&&(f=this.evaluateNodeList_(g,e.sepFunc,this.constructString(a,
e.separator),e.ctxtFunc,this.constructString(a,e.context)));break;case cvox.SpeechRule.Type.TEXT:(g=this.constructString(a,g))&&(f=[new cvox.NavDescription({text:g})]);break;default:f=[new cvox.NavDescription({text:g})]}f[0]&&e.context&&e.type!=cvox.SpeechRule.Type.MULTI&&(f[0].context=this.constructString(a,e.context)+(f[0].context||""));c=c.concat(this.addPersonality_(f,e))}return c};
@@ -1452,9 +1469,8 @@ cvox.NavigationManager.prototype.speakDescriptionArray=function(a,b,c,d){d&&a.ev
cvox.NavigationManager.prototype.finishNavCommand=function(a,b,c,d){if(this.pageEnd_&&!this.pageEndAnnounced_)this.pageEndAnnounced_=!0,cvox.ChromeVox.tts.stop(),cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.WRAP),cvox.ChromeVox.verbosity===cvox.VERBOSITY_VERBOSE&&(a=cvox.ChromeVox.msgs.getMsg("wrapped_to_top"),this.isReversed()&&(a=cvox.ChromeVox.msgs.getMsg("wrapped_to_bottom")),cvox.ChromeVox.tts.speak(a,cvox.AbstractTts.QUEUE_MODE_QUEUE,cvox.AbstractTts.PERSONALITY_ANNOTATION));else{if(this.enteredShifter_||
this.exitedShifter_)a=cvox.ChromeVox.msgs.getMsg("enter_content_say",[this.shifter_.getName()]);var e=cvox.ChromeVox.navigationManager.getDescription();(b=void 0===b?!0:b)&&this.setFocus();this.updateIndicator();b=c||cvox.AbstractTts.QUEUE_MODE_FLUSH;a&&(cvox.ChromeVox.tts.speak(a,b,cvox.AbstractTts.PERSONALITY_ANNOTATION),b=cvox.AbstractTts.QUEUE_MODE_QUEUE);this.speakDescriptionArray(e,b,d||null);this.getBraille().write();this.updatePosition(this.getCurrentNode())}};
cvox.NavigationManager.prototype.navigate=function(a,b){this.pageEndAnnounced_=!1;if(this.pageEnd_)return this.pageEnd_=!1,this.syncToBeginning(a),!0;if(!this.resolve())return!1;this.ensureNotSubnavigating();void 0!==b&&(b!==this.getGranularity()||0<this.shifterStack_.length)&&(this.setGranularity(b,!0),this.sync());return this.next_(!a)};cvox.NavigationManager.prototype.subnavigate=function(){this.pageEndAnnounced_=!1;this.resolve()&&(this.ensureSubnavigating(),this.next_(!0))};
-cvox.NavigationManager.prototype.skip=function(){if(!this.keepReading_)return!1;cvox.ChromeVox.host.hasTtsCallback()&&(this.skipped_=!0,this.setReversed(!1),this.startCallbackReading_(cvox.AbstractTts.QUEUE_MODE_FLUSH));return!0};
-cvox.NavigationManager.prototype.startReading=function(a){this.keepReading_=!0;cvox.ChromeVox.host.hasTtsCallback()?this.startCallbackReading_(a):this.startNonCallbackReading_(a);this.prevStickyState_=cvox.ChromeVox.isStickyOn;cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!0,announce:!1})};
-cvox.NavigationManager.prototype.stopReading=function(a){this.keepReading_=!1;this.navSpeaker_.stopReading=!0;a&&cvox.ChromeVox.tts.stop();void 0!=this.prevStickyState_&&(cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:this.prevStickyState_,announce:!1}),this.prevStickyState_=void 0)};cvox.NavigationManager.prototype.isReading=function(){return this.keepReading_};
+cvox.NavigationManager.prototype.skip=function(){if(!this.keepReading_)return!1;cvox.ChromeVox.host.hasTtsCallback()&&(this.skipped_=!0,this.setReversed(!1),this.startCallbackReading_(cvox.AbstractTts.QUEUE_MODE_FLUSH));return!0};cvox.NavigationManager.prototype.startReading=function(a){this.keepReading_=!0;cvox.ChromeVox.host.hasTtsCallback()?this.startCallbackReading_(a):this.startNonCallbackReading_(a);cvox.ChromeVox.stickyOverride=!0};
+cvox.NavigationManager.prototype.stopReading=function(a){this.keepReading_=!1;this.navSpeaker_.stopReading=!0;a&&cvox.ChromeVox.tts.stop();cvox.ChromeVox.stickyOverride=null};cvox.NavigationManager.prototype.isReading=function(){return this.keepReading_};
cvox.NavigationManager.prototype.startCallbackReading_=cvox.ChromeVoxEventSuspender.withSuspendedEvents(function(a){this.finishNavCommand("",!0,a,goog.bind(function(){this.next_(!0)&&this.keepReading_&&this.startCallbackReading_(cvox.AbstractTts.QUEUE_MODE_QUEUE)},this))});
cvox.NavigationManager.prototype.startNonCallbackReading_=cvox.ChromeVoxEventSuspender.withSuspendedEvents(function(a){this.keepReading_&&(cvox.ChromeVox.tts.isSpeaking()||(this.finishNavCommand("",!0,a,null),this.next_(!0)||(this.keepReading_=!1)),window.setTimeout(goog.bind(this.startNonCallbackReading_,this),1E3))});
cvox.NavigationManager.prototype.getFullDescription=function(){return this.pageSel_?this.pageSel_.getFullDescription():[cvox.DescriptionUtil.getDescriptionFromAncestors(cvox.DomUtil.getAncestors(this.curSel_.start.node),!0,cvox.ChromeVox.verbosity)]};cvox.NavigationManager.prototype.setFocus=function(a){this.pageSel_||a&&this.curSel_.start.node.constructor==Text||cvox.Focuser.setFocus(this.curSel_.start.node)};cvox.NavigationManager.prototype.getCurrentNode=function(){return this.curSel_.absStart().node};
@@ -1497,7 +1513,7 @@ cvox.ContextMenuWidget.prototype.onKeyDown=function(a){if(13==a.keyCode){var b=c
cvox.NodeSearchWidget.create=function(a,b){return new cvox.NodeSearchWidget(a,b)};cvox.SelectWidget=function(a){cvox.OverlayWidget.call(this,"");this.selectNode_=a};goog.inherits(cvox.SelectWidget,cvox.OverlayWidget);
cvox.SelectWidget.prototype.show=function(){cvox.SelectWidget.superClass_.show.call(this);var a=document.createElement("div");a.setAttribute("role","menu");for(var b=0,c=null;c=this.selectNode_.options[b];b++){var d=document.createElement("p");d.innerHTML=c.innerHTML;d.id=b;d.setAttribute("role","menuitem");a.appendChild(d)}this.host_.appendChild(a);b=this.selectNode_.selectedIndex;"number"==typeof b&&cvox.ChromeVox.syncToNode(a.children[b],!0)};
cvox.SelectWidget.prototype.hide=function(){var a=document.createEvent("Event");a.initEvent("change",!1,!1);this.selectNode_.dispatchEvent(a);cvox.SelectWidget.superClass_.hide.call(this,!0)};cvox.SelectWidget.prototype.onNavigate=function(){var a=this;cvox.ChromeVoxEventSuspender.withSuspendedEvents(function(){var b=cvox.ChromeVox.navigationManager.getCurrentNode().parentNode.id;a.selectNode_.selectedIndex=b})()};cvox.SelectWidget.prototype.getNameMsg=function(){return["aria_role_menu"]};cvox.FocusUtil=function(){};cvox.FocusUtil.INPUT_TYPE_ACCEPTS_SELECTION_TABLE={hidden:!1,text:!0,search:!0,tel:!0,url:!0,email:!0,password:!0,datetime:!1,date:!1,month:!1,week:!1,time:!1,"datetime-local":!1,number:!1,range:!1,color:!1,checkbox:!1,radio:!1,file:!1,submit:!1,image:!1,reset:!1,button:!1};
-cvox.FocusUtil.isFocusInTextInputField=function(){var a=document.activeElement;return a?a.isContentEditable||"textbox"==a.getAttribute("role")?!0:"true"==a.getAttribute("readOnly")?!1:"TEXTAREA"===a.tagName||"SELECT"===a.tagName?!0:"INPUT"===a.tagName?a.hasAttribute("type")?(a=a.getAttribute("type").toLowerCase(),cvox.FocusUtil.INPUT_TYPE_ACCEPTS_SELECTION_TABLE[a]):!0:!1:!1};cvox.SpokenListBuilder=function(){this.list_=[]};cvox.SpokenListBuilder.prototype.flush=function(a){this.list_.push([a,cvox.AbstractTts.QUEUE_MODE_FLUSH]);return this};cvox.SpokenListBuilder.prototype.build=function(){return this.list_};cvox.RunnerInterface=function(){};cvox.RunnerInterface.prototype.setFocus=function(){};cvox.AbstractTestCase=function(){};cvox.TestTts=function(){cvox.AbstractTts.call(this);this.utterances_=[]};goog.inherits(cvox.TestTts,cvox.AbstractTts);cvox.TestTts.prototype.sentinelText_="@@@STOP@@@";cvox.TestTts.prototype.speak=function(a,b,c){this.utterances_.push({text:a,queueMode:b});c&&void 0!=c.endCallback&&(a=this.utterances_.length,this.utterances_[a-1].text!=this.sentinelText_&&c.endCallback())};cvox.HostFactory.ttsConstructor=cvox.TestTts;cvox.AutoRunner=function(){new cvox.TestTts};cvox.AutoRunner.TestSummary=function(a,b,c,d){this.tag=a;this.status=c;this.scope=d};cvox.AutoRunner.PASS="pass";cvox.AutoRunner.FAIL="fail";cvox.AutoRunner.prototype.setFocus=function(a){document.getElementById(a).focus();return this};cvox.ChromeVoxUserCommands={};cvox.ChromeVoxUserCommands.init_=function(){if(!cvox.ChromeVoxUserCommands.commands){cvox.ChromeVoxUserCommands.commands={};for(var a in cvox.CommandStore.CMD_WHITELIST)cvox.ChromeVoxUserCommands.commands[a]=cvox.ChromeVoxUserCommands.createCommand_(a)}};cvox.ChromeVoxUserCommands.wasMouseClicked=!1;cvox.ChromeVoxUserCommands.enableCommandDispatchingToPage=!0;
+cvox.FocusUtil.isFocusInTextInputField=function(){var a=document.activeElement;return a?a.isContentEditable||"textbox"==a.getAttribute("role")?!0:"true"==a.getAttribute("readOnly")?!1:"TEXTAREA"===a.tagName||"SELECT"===a.tagName?!0:"INPUT"===a.tagName?a.hasAttribute("type")?(a=a.getAttribute("type").toLowerCase(),cvox.FocusUtil.INPUT_TYPE_ACCEPTS_SELECTION_TABLE[a]):!0:!1:!1};cvox.ChromeVoxUserCommands={};cvox.ChromeVoxUserCommands.init_=function(){if(!cvox.ChromeVoxUserCommands.commands){cvox.ChromeVoxUserCommands.commands={};for(var a in cvox.CommandStore.CMD_WHITELIST)cvox.ChromeVoxUserCommands.commands[a]=cvox.ChromeVoxUserCommands.createCommand_(a)}};cvox.ChromeVoxUserCommands.wasMouseClicked=!1;cvox.ChromeVoxUserCommands.enableCommandDispatchingToPage=!0;
cvox.ChromeVoxUserCommands.handleTabAction_=function(){cvox.ChromeVox.tts.stop();if(!cvox.ChromeVox.navigationManager.resolve(cvox.DomUtil.isFocusable))return cvox.ChromeVox.navigationManager.setFocus(),!1;var a=cvox.ChromeVoxUserCommands.isFocusedOnLinkControl_();if(a)return!0;var b=a=null,b=window.getSelection();cvox.ChromeVoxUserCommands.wasMouseClicked?cvox.ChromeVoxUserCommands.wasMouseClicked=!1:b=null;null==b||null==b.anchorNode||null==b.focusNode?(a=cvox.ChromeVox.navigationManager.getCurrentNode(),
b=cvox.ChromeVox.navigationManager.getCurrentNode()):(a=b.anchorNode,b=b.focusNode);if(null==a||null==b)return!0;if(cvox.DomUtil.isFocusable(a))return a.focus(),!0;if(cvox.DomUtil.isFocusable(b))return b.focus(),!0;if(cvox.DomUtil.isFocusable(a.parentNode))return a.parentNode.focus(),!0;if(cvox.DomUtil.isFocusable(b.parentNode))return b.parentNode.focus(),!0;b=cvox.ChromeVoxUserCommands.createTabDummySpan_();a.parentNode.insertBefore(b,a);b.focus();return!0};
cvox.ChromeVoxUserCommands.isFocusedOnLinkControl_=function(){var a="A";return document.activeElement.tagName==a||cvox.DomUtil.isControl(document.activeElement)?!0:!1};cvox.ChromeVoxUserCommands.removeTabDummySpan=function(){var a=document.getElementById("ChromeVoxTabDummySpan");a&&document.activeElement!=a&&a.parentNode.removeChild(a)};cvox.ChromeVoxUserCommands.createTabDummySpan_=function(){var a=document.createElement("span");a.id="ChromeVoxTabDummySpan";a.tabIndex=-1;return a};
@@ -1519,7 +1535,7 @@ g=cvox.ChromeVox.navigationManager.getCurrentNode();cvox.DomUtil.clickElem(g,!1,
", "+g.toLocaleDateString());break;case "toggleSelection":d=cvox.ChromeVox.navigationManager.togglePageSel();d=cvox.ChromeVox.msgs.getMsg(d?"begin_selection":"end_selection");break;case "startHistoryRecording":cvox.History.getInstance().startRecording();break;case "stopHistoryRecording":cvox.History.getInstance().stopRecording();break;case "enableConsoleTts":cvox.ConsoleTts.getInstance().setEnabled(!0);break;case "toggleBrailleCaptions":cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",
pref:"brailleCaptions",value:!cvox.BrailleOverlayWidget.getInstance().isActive()});break;case "goToFirstCell":case "goToLastCell":case "goToRowFirstCell":case "goToRowLastCell":case "goToColFirstCell":case "goToColLastCell":case "announceHeaders":case "speakTableLocation":case "exitShifterContent":cvox.DomPredicates.tablePredicate(cvox.DomUtil.getAncestors(cvox.ChromeVox.navigationManager.getCurrentNode()))&&cvox.ChromeVox.navigationManager.performAction(b)||(c="not_inside_table");break;case "enterShifter":case "exitShifter":cvox.ChromeVox.navigationManager.performAction(b);
break;case "decreaseTtsRate":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.RATE,!1);break;case "increaseTtsRate":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.RATE,!0);break;case "decreaseTtsPitch":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.PITCH,!1);break;case "increaseTtsPitch":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.PITCH,!0);break;case "decreaseTtsVolume":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.VOLUME,
-!1);break;case "increaseTtsVolume":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.VOLUME,!0);break;case "cyclePunctuationEcho":cvox.ChromeVox.host.sendToBackgroundPage({target:"TTS",action:"cyclePunctuationEcho"});break;case "toggleStickyMode":cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!cvox.ChromeVox.isStickyOn,announce:!0});break;case "toggleKeyPrefix":cvox.ChromeVox.keyPrefixOn=!cvox.ChromeVox.keyPrefixOn;break;case "passThroughMode":cvox.ChromeVox.passThroughMode=
+!1);break;case "increaseTtsVolume":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.VOLUME,!0);break;case "cyclePunctuationEcho":cvox.ChromeVox.host.sendToBackgroundPage({target:"TTS",action:"cyclePunctuationEcho"});break;case "toggleStickyMode":cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!cvox.ChromeVox.isStickyPrefOn,announce:!0});break;case "toggleKeyPrefix":cvox.ChromeVox.keyPrefixOn=!cvox.ChromeVox.keyPrefixOn;break;case "passThroughMode":cvox.ChromeVox.passThroughMode=
!0;cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("pass_through_key"));break;case "toggleSearchWidget":cvox.SearchWidget.getInstance().toggle();break;case "toggleEarcons":d=cvox.ChromeVox.earcons.toggle()?cvox.ChromeVox.msgs.getMsg("earcons_on"):cvox.ChromeVox.msgs.getMsg("earcons_off");break;case "showHeadingsList":case "showLinksList":case "showFormsList":case "showTablesList":case "showLandmarksList":if(!a.nodeList)break;g=cvox.CommandStore.NODE_INFO_MAP[a.nodeList];cvox.NodeSearchWidget.create(g.typeMsg,
cvox.DomPredicates[g.predicate]).show();break;case "openLongDesc":g=cvox.ChromeVox.navigationManager.getCurrentNode();cvox.DomUtil.hasLongDesc(g)?cvox.ChromeVox.host.sendToBackgroundPage({target:"OpenTab",url:g.longDesc}):cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("no_long_desc"),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOTATION);break;case "pauseAllMedia":k=document.getElementsByTagName("VIDEO");for(g=0;h=k[g];g++)h.pause();k=document.getElementsByTagName("AUDIO");
for(g=0;h=k[g];g++)h.pause();break;case "toggleSemantics":cvox.TraverseMath.toggleSemantic()?cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("semantics_on")):cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("semantics_off"));break;case cvox.BrailleKeyCommand.ROUTING:(g=a.content)&&cvox.BrailleUtil.click(g,a.event.displayPosition);break;case cvox.BrailleKeyCommand.PAN_LEFT:case cvox.BrailleKeyCommand.LINE_UP:case cvox.BrailleKeyCommand.PAN_RIGHT:case cvox.BrailleKeyCommand.LINE_DOWN:cvox.ChromeVox.navigationManager.navigate(!1,
@@ -1563,15 +1579,15 @@ cvox.ChromeVoxEventWatcher.setLastFocusedNode_=function(a){cvox.ChromeVoxEventWa
cvox.ChromeVoxEventWatcher.mutationHandler=function(a){if(cvox.ChromeVoxEventSuspender.areEventsSuspended())return!0;cvox.ChromeVox.navigationManager.updateIndicatorIfChanged();cvox.LiveRegions.processMutations(a,function(a,c){var d=new window.Event("LiveRegion");d.navDescriptions=c;d.assertive=a;cvox.ChromeVoxEventWatcher.addEvent(d,!0);return!0})};
cvox.ChromeVoxEventWatcher.mouseClickEventWatcher=function(a){if(a.fromCvox)return!0;if(cvox.ChromeVox.host.mustRedispatchClickEvent())return cvox.ChromeVoxUserCommands.wasMouseClicked=!0,a.stopPropagation(),a.preventDefault(),cvox.Focuser.setFocus(cvox.ChromeVox.navigationManager.getCurrentNode()),cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("element_clicked"),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOTATION),a=cvox.ChromeVox.navigationManager.getCurrentNode(),cvox.DomUtil.clickElem(a,
!1,!0),!1;cvox.ChromeVoxEventWatcher.addEvent(a);return cvox.ChromeVoxUserCommands.wasMouseClicked=!0};
-cvox.ChromeVoxEventWatcher.mouseOverEventWatcher=function(a){if(!cvox.ChromeVoxEventWatcher.focusFollowsMouse||cvox.DomUtil.isDescendantOfNode(cvox.ChromeVoxEventWatcher.announcedMouseOverNode,a.target)||a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode)return!0;cvox.ChromeVoxEventWatcher.pendingMouseOverNode=a.target;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null);if(a.target.tagName&&
-"BODY"==a.target.tagName)return cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.announcedMouseOverNode=null,!0;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=window.setTimeout(function(){cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null;if(a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode){cvox.ChromeVox.navigationManager.stopReading(!0);var b=a.target;cvox.Focuser.setFocus(b);cvox.ApiImplementation.syncToNode(b,!0,cvox.AbstractTts.QUEUE_MODE_FLUSH);cvox.ChromeVoxEventWatcher.announcedMouseOverNode=
-b}},cvox.ChromeVoxEventWatcher.mouseoverDelayMs);return!0};cvox.ChromeVoxEventWatcher.mouseOutEventWatcher=function(a){a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode&&(cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null));return!0};
+cvox.ChromeVoxEventWatcher.mouseOverEventWatcher=function(a){var b="ontouchstart"in window,c=cvox.ChromeVoxEventWatcher.mouseoverDelayMs;if(b)c=0;else if(!cvox.ChromeVoxEventWatcher.focusFollowsMouse)return!0;if(cvox.DomUtil.isDescendantOfNode(cvox.ChromeVoxEventWatcher.announcedMouseOverNode,a.target)||a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode)return!0;cvox.ChromeVoxEventWatcher.pendingMouseOverNode=a.target;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),
+cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null);if(a.target.tagName&&"BODY"==a.target.tagName)return cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.announcedMouseOverNode=null,!0;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=window.setTimeout(function(){cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null;if(a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode){cvox.ChromeVox.navigationManager.stopReading(!0);var b=a.target;cvox.Focuser.setFocus(b);cvox.ApiImplementation.syncToNode(b,
+!0,cvox.AbstractTts.QUEUE_MODE_FLUSH);cvox.ChromeVoxEventWatcher.announcedMouseOverNode=b}},c);return!0};cvox.ChromeVoxEventWatcher.mouseOutEventWatcher=function(a){a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode&&(cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null));return!0};
cvox.ChromeVoxEventWatcher.focusEventWatcher=function(a){cvox.ChromeVoxUserCommands.removeTabDummySpan();cvox.ChromeVoxEventSuspender.areEventsSuspended()?a.target&&a.target.nodeType==Node.ELEMENT_NODE&&cvox.ChromeVoxEventWatcher.setLastFocusedNode_(a.target):cvox.ChromeVoxEventWatcher.addEvent(a);return!0};
cvox.ChromeVoxEventWatcher.focusHandler=function(a){if(a.target&&a.target.hasAttribute&&"true"==a.target.getAttribute("aria-hidden")&&"true"!=a.target.getAttribute("chromevoxignoreariahidden"))cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null),cvox.ChromeVoxEventWatcher.setUpTextHandler();else if(a.target&&a.target!=window){var b=a.target,c=cvox.DomUtil.getSurroundingControl(b);if(c&&c==cvox.ChromeVoxEventWatcher.lastFocusedNode)cvox.ChromeVoxEventWatcher.handleControlChanged(b);else{c?cvox.ChromeVoxEventWatcher.setLastFocusedNode_(c):
cvox.ChromeVoxEventWatcher.setLastFocusedNode_(b);c=cvox.ChromeVoxEventWatcher.queueMode_();if(cvox.ChromeVoxEventWatcher.getInitialVisibility()||cvox.ChromeVoxEventWatcher.handleDialogFocus(b))c=cvox.AbstractTts.QUEUE_MODE_QUEUE;cvox.ChromeVox.navigationManager.clearPageSel(!0)&&(c=cvox.AbstractTts.QUEUE_MODE_QUEUE);cvox.ApiImplementation.syncToNode(b,!document.webkitHidden,c);if(a.target.constructor==HTMLVideoElement||a.target.constructor==HTMLAudioElement)cvox.ChromeVoxEventWatcher.setUpMediaHandler_();
else{if(a.target.hasAttribute)switch(a=a.target.getAttribute("type"),a){case "time":cvox.ChromeVoxEventWatcher.setUpTimeHandler_();return;case "date":case "month":case "week":cvox.ChromeVoxEventWatcher.setUpDateHandler_();return}cvox.ChromeVoxEventWatcher.setUpTextHandler()}}}else cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null)};
cvox.ChromeVoxEventWatcher.blurEventWatcher=function(a){window.setTimeout(function(){document.activeElement||(cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null),cvox.ChromeVoxEventWatcher.addEvent(a))},0);return!0};
-cvox.ChromeVoxEventWatcher.keyDownEventWatcher=function(a){if(cvox.ChromeVox.passThroughMode)return!0;cvox.ChromeVox.isChromeOS&&91==a.keyCode&&(cvox.ChromeVox.searchKeyHeld=!0);a.searchKeyHeld=cvox.ChromeVox.searchKeyHeld&&cvox.ChromeVox.isActive;a.stickyMode=cvox.ChromeVox.isStickyOn&&cvox.ChromeVox.isActive;a.keyPrefix=cvox.ChromeVox.keyPrefixOn&&cvox.ChromeVox.isActive;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVoxEventWatcher.eventToEat=null;if(!cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(a)||
+cvox.ChromeVoxEventWatcher.keyDownEventWatcher=function(a){if(cvox.ChromeVox.passThroughMode)return!0;cvox.ChromeVox.isChromeOS&&91==a.keyCode&&(cvox.ChromeVox.searchKeyHeld=!0);a.searchKeyHeld=cvox.ChromeVox.searchKeyHeld&&cvox.ChromeVox.isActive;a.stickyMode=cvox.ChromeVox.isStickyModeOn()&&cvox.ChromeVox.isActive;a.keyPrefix=cvox.ChromeVox.keyPrefixOn&&cvox.ChromeVox.isActive;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVoxEventWatcher.eventToEat=null;if(!cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(a)||
cvox.ChromeVoxEventWatcher.handleControlAction(a))return a.preventDefault(),a.stopPropagation(),cvox.ChromeVoxEventWatcher.eventToEat=a,!1;cvox.ChromeVoxEventWatcher.addEvent(a);return!0};
cvox.ChromeVoxEventWatcher.keyUpEventWatcher=function(a){91==a.keyCode&&(cvox.ChromeVox.searchKeyHeld=!1);if(cvox.ChromeVox.passThroughMode)return a.ctrlKey||a.altKey||a.metaKey||a.shiftKey||cvox.ChromeVox.searchKeyHeld||(this.secondPassThroughKeyUp_?(this.secondPassThroughKeyUp_=!1,cvox.ChromeVox.passThroughMode=!1):this.secondPassThroughKeyUp_=!0),!0;if(cvox.ChromeVoxEventWatcher.eventToEat&&a.keyCode==cvox.ChromeVoxEventWatcher.eventToEat.keyCode)return a.stopPropagation(),a.preventDefault(),!1;
cvox.ChromeVoxEventWatcher.addEvent(a);return!0};
@@ -1600,7 +1616,7 @@ cvox.ChromeVoxEventWatcherUtil.shouldWaitToProcess=function(a,b,c){a=c-a;b=c-b;r
cvox.ChromeVoxEventWatcher.processQueue_=function(){if(0!=cvox.ChromeVoxEventWatcher.events_.length){var a=cvox.ChromeVoxEventWatcher.events_,b=-1,c=0,d,e;for(e=0;d=a[e];e++)"focus"==d.type&&(b=e,c=d.timeStamp);cvox.ChromeVoxEventWatcher.events_=[];for(e=0;d=a[e];e++){var f=a[e-1]||{};!(e>=b||"LiveRegion"==d.type||"DOMSubtreeModified"==d.type)||"focus"==f.type&&"change"==d.type||cvox.ChromeVoxEventWatcher.events_.push(d)}cvox.ChromeVoxEventWatcher.events_.sort(function(a,b){return"LiveRegion"!=b.type&&
"LiveRegion"==a.type||"DOMSubtreeModified"!=b.type&&"DOMSubtreeModified"==a.type?1:-1});a=(new Date).getTime();if(0<=b&&cvox.ChromeVoxEventWatcherUtil.shouldWaitToProcess(c,cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime,a))window.setTimeout(cvox.ChromeVoxEventWatcher.processQueue_,cvox.ChromeVoxEventWatcher.WAIT_TIME_MS_);else{for(e=0;d=cvox.ChromeVoxEventWatcher.events_[e];e++)cvox.ChromeVoxEventWatcher.handleEvent_(d),cvox.ChromeVoxEventWatcher.processing_=!0;cvox.ChromeVoxEventWatcher.processing_=
!1;cvox.ChromeVoxEventWatcher.events_=[];cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime=-1;cvox.ChromeVoxEventWatcher.queueProcessingScheduled_=!1;cvox.ChromeVoxEventWatcher.maybeCallReadyCallbacks_()}}};
-cvox.ChromeVoxEventWatcher.handleEvent_=function(a){switch(a.type){case "keydown":cvox.ChromeVoxEventWatcher.setUpTextHandler();if(cvox.ChromeVoxEventWatcher.currentTextControl&&(cvox.ChromeVoxEventWatcher.handleTextChanged(!0),(a=cvox.ChromeVoxEventWatcher.currentTextHandler)&&a.lastChangeDescribed))break;cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keyup":cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keypress":cvox.ChromeVoxEventWatcher.setUpTextHandler();
+cvox.ChromeVoxEventWatcher.handleEvent_=function(a){switch(a.type){case "keydown":case "input":cvox.ChromeVoxEventWatcher.setUpTextHandler();if(cvox.ChromeVoxEventWatcher.currentTextControl&&(cvox.ChromeVoxEventWatcher.handleTextChanged(!0),(a=cvox.ChromeVoxEventWatcher.currentTextHandler)&&a.lastChangeDescribed))break;cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keyup":cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keypress":cvox.ChromeVoxEventWatcher.setUpTextHandler();
break;case "click":cvox.ApiImplementation.syncToNode(a.target,!0);break;case "focus":cvox.ChromeVoxEventWatcher.focusHandler(a);break;case "blur":cvox.ChromeVoxEventWatcher.setUpTextHandler();break;case "change":cvox.ChromeVoxEventWatcher.changeHandler(a);break;case "select":cvox.ChromeVoxEventWatcher.setUpTextHandler();break;case "LiveRegion":cvox.ChromeVoxEventWatcher.speakLiveRegion_(a.assertive,a.navDescriptions);break;case "DOMSubtreeModified":cvox.ChromeVoxEventWatcher.subtreeModifiedHandler(a)}};
cvox.ChromeVoxEventWatcher.setUpTimeHandler_=function(){var a=document.activeElement;a&&a.hasAttribute&&"true"==a.getAttribute("aria-hidden")&&"true"!=a.getAttribute("chromevoxignoreariahidden")&&(a=null);cvox.ChromeVoxEventWatcher.currentTimeHandler=a.constructor==HTMLInputElement&&a.type&&"time"==a.type?new cvox.ChromeVoxHTMLTimeWidget(a,cvox.ChromeVox.tts):null;return null!=cvox.ChromeVoxEventWatcher.currentTimeHandler};
cvox.ChromeVoxEventWatcher.setUpMediaHandler_=function(){var a=document.activeElement;a&&a.hasAttribute&&"true"==a.getAttribute("aria-hidden")&&"true"!=a.getAttribute("chromevoxignoreariahidden")&&(a=null);cvox.ChromeVoxEventWatcher.currentMediaHandler=a.constructor==HTMLVideoElement||a.constructor==HTMLAudioElement?new cvox.ChromeVoxHTMLMediaWidget(a,cvox.ChromeVox.tts):null;return null!=cvox.ChromeVoxEventWatcher.currentMediaHandler};
@@ -1645,9 +1661,9 @@ cvox.SearchContextMenu.focusAds=function(){cvox.Search.populateAdResults();0===c
cvox.SearchContextMenu.init=function(){var a=[{desc:"Main Results",cmd:Command.MAIN},{desc:"Search Tools",cmd:Command.TOOLS},{desc:"Ads",cmd:Command.ADS}],b=document.querySelector("body");b.setAttribute("contextMenuActions",JSON.stringify(a));b.addEventListener("ATCustomEvent",cvox.SearchContextMenu.contextMenuHandler,!0);window.addEventListener("keydown",cvox.SearchContextMenu.keyhandler,!0);cvox.Search.init()};cvox.SearchLoader=function(){};cvox.SearchLoader.onReadyStateChange=function(){"complete"===document.readyState&&"www.google.com"===window.location.host&&"/search"===window.location.pathname&&cvox.SearchContextMenu.init()};cvox.SearchLoader.init=function(){if("complete"!==document.readyState)document.onreadystatechange=cvox.SearchLoader.onReadyStateChange;else cvox.SearchLoader.onReadyStateChange()};cvox.ChromeHost=function(){this.gotPrefsAtLeastOnce_=!1};goog.inherits(cvox.ChromeHost,cvox.AbstractHost);
cvox.ChromeHost.prototype.init=function(){var a=this,b=function(b){b.history&&(cvox.ChromeVox.visitedUrls=b.history);b.keyBindings&&cvox.ChromeVoxKbHandler.loadKeyToFunctionsTable(b.keyBindings);if(b.prefs){b=b.prefs;cvox.ChromeVoxEditableTextBase.useIBeamCursor="true"==b.useIBeamCursor;cvox.ChromeVoxEditableTextBase.eventTypingEcho=!0;cvox.ChromeVoxEventWatcher.focusFollowsMouse="true"==b.focusFollowsMouse;cvox.ChromeVox.version=b.version;cvox.ChromeVox.earcons.enabled=JSON.parse(b.earcons);cvox.ChromeVox.typingEcho=
JSON.parse(b.typingEcho);b.position&&(cvox.ChromeVox.position=JSON.parse(b.position));"undefined"!=b.granularity&&cvox.ChromeVox.navigationManager.setGranularity(JSON.parse(b.granularity));a.activateOrDeactivateChromeVox("true"==b.active);a.activateOrDeactivateStickyMode("true"==b.sticky);a.gotPrefsAtLeastOnce_||cvox.InitialSpeech.speak();a.gotPrefsAtLeastOnce_=!0;cvox.ChromeVox.verbosity="false"==b.useVerboseMode?cvox.VERBOSITY_BRIEF:cvox.VERBOSITY_VERBOSE;b.cvoxKey&&(cvox.ChromeVox.modKeyStr=b.cvoxKey);
-var d=b.siteSpecificScriptLoader!=cvox.ApiImplementation.siteSpecificScriptLoader||b.siteSpecificScriptBase!=cvox.ApiImplementation.siteSpecificScriptBase;cvox.ApiImplementation.siteSpecificScriptLoader=b.siteSpecificScriptLoader;cvox.ApiImplementation.siteSpecificScriptBase=b.siteSpecificScriptBase;d&&(d="true"===b.siteSpecificEnhancements?cvox.SearchLoader.init:null,cvox.ApiImplementation.init(d));cvox.BrailleOverlayWidget.getInstance().setActive("true"==b.brailleCaptions)}};cvox.ExtensionBridge.addMessageListener(b);
+var d=b.siteSpecificScriptLoader!=cvox.ApiImplementation.siteSpecificScriptLoader||b.siteSpecificScriptBase!=cvox.ApiImplementation.siteSpecificScriptBase;cvox.ApiImplementation.siteSpecificScriptLoader=b.siteSpecificScriptLoader;cvox.ApiImplementation.siteSpecificScriptBase=b.siteSpecificScriptBase;d&&(d="true"===b.siteSpecificEnhancements?cvox.SearchLoader.init:void 0,cvox.ApiImplementation.init(d));cvox.BrailleOverlayWidget.getInstance().setActive("true"==b.brailleCaptions)}};cvox.ExtensionBridge.addMessageListener(b);
cvox.ExtensionBridge.addMessageListener(function(a){"DOMAINS_STYLES"==a.message&&cvox.TraverseMath.getInstance().addDomainsAndStyles(a.domains,a.styles)});cvox.ExtensionBridge.addMessageListener(function(a){var b=a.message;"USER_COMMAND"==b&&(b=a.command,cvox.ChromeVoxUserCommands.commands[b](a))});cvox.ExtensionBridge.send({target:"Prefs",action:"getPrefs"});cvox.ExtensionBridge.send({target:"Data",action:"getHistory"})};cvox.ChromeHost.prototype.sendToBackgroundPage=function(a){cvox.ExtensionBridge.send(a)};
-cvox.ChromeHost.prototype.getApiSrc=function(){return this.getFileSrc("chromevox/injected/api.js")};cvox.ChromeHost.prototype.getFileSrc=function(a){return window.chrome.extension.getURL(a)};cvox.ChromeHost.prototype.activateOrDeactivateStickyMode=function(a){cvox.ChromeVox.isStickyOn=a};cvox.HostFactory.hostConstructor=cvox.ChromeHost;cvox.ChromeTts=function(){cvox.ChromeTtsBase.call(this);this.addBridgeListener()};goog.inherits(cvox.ChromeTts,cvox.ChromeTtsBase);cvox.ChromeTts.callId=1;cvox.ChromeTts.functionMap={};cvox.ChromeTts.prototype.speak=function(a,b,c){c||(c={});cvox.ChromeTts.superClass_.speak.call(this,a,b,c);cvox.ExtensionBridge.send(this.createMessageForProperties_(a,b,c))};cvox.ChromeTts.prototype.isSpeaking=function(){cvox.ChromeTts.superClass_.isSpeaking.call(this);return!1};
+cvox.ChromeHost.prototype.getApiSrc=function(){return this.getFileSrc("chromevox/injected/api.js")};cvox.ChromeHost.prototype.getFileSrc=function(a){return window.chrome.extension.getURL(a)};cvox.ChromeHost.prototype.activateOrDeactivateStickyMode=function(a){cvox.ChromeVox.isStickyPrefOn=a};cvox.HostFactory.hostConstructor=cvox.ChromeHost;cvox.ChromeTts=function(){cvox.ChromeTtsBase.call(this);this.addBridgeListener()};goog.inherits(cvox.ChromeTts,cvox.ChromeTtsBase);cvox.ChromeTts.callId=1;cvox.ChromeTts.functionMap={};cvox.ChromeTts.prototype.speak=function(a,b,c){c||(c={});cvox.ChromeTts.superClass_.speak.call(this,a,b,c);cvox.ExtensionBridge.send(this.createMessageForProperties_(a,b,c))};cvox.ChromeTts.prototype.isSpeaking=function(){cvox.ChromeTts.superClass_.isSpeaking.call(this);return!1};
cvox.ChromeTts.prototype.stop=function(){cvox.ChromeTts.superClass_.stop.call(this);cvox.ExtensionBridge.send({target:"TTS",action:"stop"})};cvox.ChromeTts.prototype.increaseOrDecreaseProperty=function(a,b){cvox.ExtensionBridge.send({target:"TTS",action:"increaseOrDecrease",property:a,increase:b})};cvox.ChromeTts.prototype.addBridgeListener=function(){cvox.ExtensionBridge.addMessageListener(function(a){var b=a.message;"TTS_CALLBACK"==b&&(a=a.id,b=cvox.ChromeTts.functionMap[a],void 0!=b&&(b(),delete cvox.ChromeTts.functionMap[a]))})};
cvox.ChromeTts.prototype.createMessageForProperties_=function(a,b,c){a={target:"TTS",action:"speak",text:a,queueMode:b,properties:c};void 0!=c.startCallback&&(cvox.ChromeTts.functionMap[cvox.ChromeTts.callId]=c.startCallback,a.startCallbackId=cvox.ChromeTts.callId++);void 0!=c.endCallback&&(cvox.ChromeTts.functionMap[cvox.ChromeTts.callId]=c.endCallback,a.endCallbackId=cvox.ChromeTts.callId++);return a};cvox.HostFactory.ttsConstructor=cvox.ChromeTts;cvox.ChromeVoxPrefs=function(){var a=localStorage.lastRunVersion;a||(a="1.16.0");var b=!0;"1.16.0"==a&&(b=!1);localStorage.lastRunVersion=chrome.app.getDetails().version;this.keyMap_=cvox.KeyMap.fromLocalStorage()||cvox.KeyMap.fromDefaults();this.keyMap_.merge(cvox.KeyMap.fromDefaults());localStorage.position="{}";localStorage.sticky=!1;this.init(b)};
cvox.ChromeVoxPrefs.DEFAULT_PREFS={active:!0,brailleCaptions:!1,currentKeyMap:cvox.KeyMap.DEFAULT_KEYMAP,cvoxKey:"",earcons:!0,focusFollowsMouse:!1,granularity:void 0,position:"{}",siteSpecificScriptBase:"https://ssl.gstatic.com/accessibility/javascript/ext/",siteSpecificScriptLoader:"https://ssl.gstatic.com/accessibility/javascript/ext/loader.js",sticky:!1,typingEcho:0,useIBeamCursor:cvox.ChromeVox.isMac,useVerboseMode:!0,siteSpecificEnhancements:!0};
@@ -1659,13 +1675,13 @@ cvox.OptionsPage.init=function(){cvox.ChromeVox.msgs=cvox.HostFactory.getMsgs();
cvox.OptionsPage.eventListener,!1);document.addEventListener("click",cvox.OptionsPage.eventListener,!1);document.addEventListener("keydown",cvox.OptionsPage.eventListener,!1);cvox.ExtensionBridge.addMessageListener(function(a){(a.keyBindings||a.prefs)&&cvox.OptionsPage.update()});document.getElementById("selectKeys").addEventListener("click",cvox.OptionsPage.reset,!1);cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.WML)&&(document.getElementById("version").textContent=chrome.app.getDetails().version)};
cvox.OptionsPage.update=function(){var a=cvox.OptionsPage.prefs.getPrefs(),b;for(b in a)for(var c=document.querySelectorAll('*[name="'+b+'"]'),d=0;d<c.length;d++)cvox.OptionsPage.setValue(c[d],a[b])};
cvox.OptionsPage.populateKeyMapSelect=function(){var a=document.getElementById("cvox_keymaps"),b;for(b in cvox.KeyMap.AVAILABLE_MAP_INFO){var c=document.createElement("option");c.id=b;c.className="i18n";c.setAttribute("msgid",b);cvox.OptionsPage.prefs.getPrefs().currentKeyMap==b&&c.setAttribute("selected","");a.appendChild(c)}a.addEventListener("change",cvox.OptionsPage.reset,!0)};
-cvox.OptionsPage.addKeys=function(){var a=document.getElementById("keysContainer"),b=cvox.OptionsPage.prefs.getKeyMap();this.prevTime=(new Date).getTime();this.keyCount=0;a.addEventListener("keypress",goog.bind(function(a){if("cvoxKey"!=a.target.id){this.keyCount++;var b=(new Date).getTime();1E3<b-this.prevTime||2<this.keyCount?("toggleKeyPrefix"==document.activeElement.id?(this.keySequence=new cvox.KeySequence(a,!1),this.keySequence.keys.ctrlKey[0]=!0):this.keySequence=new cvox.KeySequence(a,!0),
-this.keyCount=1):this.keySequence.addKeyEvent(a);var c=cvox.KeyUtil.keySequenceToString(this.keySequence,!0),d=c.replace(/\+/g," "+cvox.ChromeVox.msgs.getMsg("then")+" "),d=d.replace(/>/g," "+cvox.ChromeVox.msgs.getMsg("followed_by")+" "),d=d.replace("Cvox"," "+cvox.ChromeVox.msgs.getMsg("modifier_key")+" ");cvox.OptionsPage.prefs.setKey(document.activeElement.id,this.keySequence)?document.activeElement.value=c:d=cvox.ChromeVox.msgs.getMsg("key_conflict",[d]);chrome.extension.getBackgroundPage().speak(d);
-this.prevTime=b;a.preventDefault();a.stopPropagation()}},cvox.OptionsPage),!0);for(var c=cvox.CommandStore.categories(),d=0;d<c.length;d++)if("braille"!=c[d]){var e=document.createElement("h3");e.className="i18n";e.setAttribute("msgid",c[d]);e.id=c[d];a.appendChild(e);for(var f=cvox.CommandStore.commandsForCategory(c[d]),g=0;g<f.length;g++){var h=f[g],k=b.keyForCommand(h)[0];if("toggleChromeVox"!=h||!cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.CHROMEOS)){e=document.createElement("input");
-e.type="text";e.className="key active-key";e.id=h;k=null!=k?cvox.KeyUtil.keySequenceToString(k,!0):"";e.value=k;if("toggleStickyMode"==h||"stopSpeech"==h)e.disabled=!0;(k=cvox.CommandStore.messageForCommand(h))||(k=h);h=document.createElement("label");h.className="i18n";h.setAttribute("msgid",k);h.setAttribute("for",e.id);k=document.createElement("div");k.className="key-container";a.appendChild(k);k.appendChild(e);k.appendChild(h)}}e=document.createElement("br");a.appendChild(e)}null==document.getElementById("cvoxKey")&&
+cvox.OptionsPage.addKeys=function(){var a=document.getElementById("keysContainer"),b=cvox.OptionsPage.prefs.getKeyMap();cvox.OptionsPage.prevTime=(new Date).getTime();cvox.OptionsPage.keyCount=0;a.addEventListener("keypress",goog.bind(function(a){if("cvoxKey"!=a.target.id){this.keyCount++;var b=(new Date).getTime();1E3<b-this.prevTime||2<this.keyCount?("toggleKeyPrefix"==document.activeElement.id?(this.keySequence=new cvox.KeySequence(a,!1),this.keySequence.keys.ctrlKey[0]=!0):this.keySequence=new cvox.KeySequence(a,
+!0),this.keyCount=1):this.keySequence.addKeyEvent(a);var c=cvox.KeyUtil.keySequenceToString(this.keySequence,!0),d=c.replace(/\+/g," "+cvox.ChromeVox.msgs.getMsg("then")+" "),d=d.replace(/>/g," "+cvox.ChromeVox.msgs.getMsg("followed_by")+" "),d=d.replace("Cvox"," "+cvox.ChromeVox.msgs.getMsg("modifier_key")+" ");cvox.OptionsPage.prefs.setKey(document.activeElement.id,this.keySequence)?document.activeElement.value=c:d=cvox.ChromeVox.msgs.getMsg("key_conflict",[d]);cvox.OptionsPage.speak(d);this.prevTime=
+b;a.preventDefault();a.stopPropagation()}},cvox.OptionsPage),!0);for(var c=cvox.CommandStore.categories(),d=0;d<c.length;d++)if("braille"!=c[d]){var e=document.createElement("h3");e.className="i18n";e.setAttribute("msgid",c[d]);e.id=c[d];a.appendChild(e);for(var f=cvox.CommandStore.commandsForCategory(c[d]),g=0;g<f.length;g++){var h=f[g],k=b.keyForCommand(h)[0];if("toggleChromeVox"!=h||!cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.CHROMEOS)){e=document.createElement("input");e.type="text";
+e.className="key active-key";e.id=h;k=null!=k?cvox.KeyUtil.keySequenceToString(k,!0):"";e.value=k;if("toggleStickyMode"==h||"stopSpeech"==h)e.disabled=!0;(k=cvox.CommandStore.messageForCommand(h))||(k=h);h=document.createElement("label");h.className="i18n";h.setAttribute("msgid",k);h.setAttribute("for",e.id);k=document.createElement("div");k.className="key-container";a.appendChild(k);k.appendChild(e);k.appendChild(h)}}e=document.createElement("br");a.appendChild(e)}null==document.getElementById("cvoxKey")&&
(e=document.createElement("input"),e.type="text",e.className="key",e.id="cvoxKey",h=document.createElement("label"),h.className="i18n",h.setAttribute("msgid","options_cvox_modifier_key"),h.setAttribute("for","cvoxKey"),a=document.getElementById("modifier_keys").nextSibling,b=a.parentNode,b.insertBefore(h,a),b.insertBefore(e,h),a=document.getElementById("cvoxKey"),a.value=localStorage.cvoxKey,a.addEventListener("keydown",function(a){this.modifierSeq_?this.modifierSeq_.addKeyEvent(a):(this.modifierCount_=
-0,this.modifierSeq_=new cvox.KeySequence(a,!1));this.modifierSeq_.isAnyModifierActive()?this.modifierCount_++:(9!=a.keyCode&&chrome.extension.getBackgroundPage().speak(cvox.ChromeVox.msgs.getMsg("modifier_entry_error"),0,{}),this.modifierSeq_=null);a.shiftKey||9==a.keyCode||(a.preventDefault(),a.stopPropagation())},!0),a.addEventListener("keyup",function(a){if(this.modifierSeq_){this.modifierCount_--;if(0==this.modifierCount_){var b=cvox.KeyUtil.keySequenceToString(this.modifierSeq_,!0,!0);a.target.value=
-b;chrome.extension.getBackgroundPage().speak(cvox.ChromeVox.msgs.getMsg("modifier_entry_set",[b]));localStorage.cvoxKey=b;this.modifierSeq_=null}a.preventDefault();a.stopPropagation()}},!0))};
+0,this.modifierSeq_=new cvox.KeySequence(a,!1));this.modifierSeq_.isAnyModifierActive()?this.modifierCount_++:(9!=a.keyCode&&cvox.OptionsPage.speak(cvox.ChromeVox.msgs.getMsg("modifier_entry_error"),0,{}),this.modifierSeq_=null);a.shiftKey||9==a.keyCode||(a.preventDefault(),a.stopPropagation())},!0),a.addEventListener("keyup",function(a){if(this.modifierSeq_){this.modifierCount_--;if(0==this.modifierCount_){var b=cvox.KeyUtil.keySequenceToString(this.modifierSeq_,!0,!0);a.target.value=b;cvox.OptionsPage.speak(cvox.ChromeVox.msgs.getMsg("modifier_entry_set",
+[b]));localStorage.cvoxKey=b;this.modifierSeq_=null}a.preventDefault();a.stopPropagation()}},!0))};
cvox.OptionsPage.populateVoicesSelect=function(){var a=document.getElementById("voices");chrome.tts.getVoices(function(b){b.forEach(function(b){var d=document.createElement("option");d.voiceName=b.voiceName||"";d.innerText=d.voiceName;localStorage.voiceName==b.voiceName&&d.setAttribute("selected","");a.add(d)})});a.addEventListener("change",function(){var b=a.selectedIndex,b=a.options[b];localStorage.voiceName=b.voiceName},!0)};
cvox.OptionsPage.populateBrailleTablesSelect=function(){if(cvox.ChromeVox.isChromeOS){var a=cvox.OptionsPage.brailleTables,b=JSON.parse(cvox.ChromeVox.msgs.getMsg("locale_dict")),c=function(c,d){for(var e=[],f=localStorage[c.id]||localStorage.brailleTable,g=0,q;q=a[g];g++)if(q.dots===d){var m=document.createElement("option");m.id=q.id;e[q.locale]||(e[q.locale]=0);e[q.locale]++;var s=q.grade;m.textContent=s?cvox.ChromeVox.msgs.getMsg("options_braille_locale_grade",[b[q.locale],s]):b[q.locale];q.id==
f&&m.setAttribute("selected","");c.appendChild(m)}},d=document.getElementById("brailleTable6"),e=document.getElementById("brailleTable8");c(d,"6");c(e,"8");c=function(a){return function(){var b=a.selectedIndex,b=a.options[b];localStorage.brailleTable=b.id;localStorage[a.id]=b.id;b=chrome.extension.getBackgroundPage().braille;b.refreshTranslator()}};d.addEventListener("change",c(d),!0);e.addEventListener("change",c(e),!0);var f=document.getElementById("brailleTableType"),g=function(a){var b=localStorage.brailleTableType||
@@ -1675,7 +1691,7 @@ cvox.OptionsPage.setValue=function(a,b){"INPUT"==a.tagName&&"checkbox"==a.type?a
cvox.OptionsPage.eventListener=function(a){window.setTimeout(function(){var b=a.target;if(b.classList.contains("pref"))if("INPUT"==b.tagName&&"checkbox"==b.type)cvox.OptionsPage.prefs.setPref(b.name,b.checked);else{if("INPUT"==b.tagName&&"radio"==b.type)for(var c=b.name,c=document.querySelectorAll('*[name="'+c+'"]'),d=0;d<c.length;d++)c[d].checked&&cvox.OptionsPage.prefs.setPref(b.name,c[d].value)}else b.classList.contains("key")&&(c=cvox.KeySequence.fromStr(b.value),"cvoxKey"==b.id?(cvox.OptionsPage.prefs.setPref(b.id,
b.value),cvox.OptionsPage.prefs.sendPrefsToAllTabs(!0,!0)):cvox.OptionsPage.prefs.setKey(b.id,c))},0);return!0};
cvox.OptionsPage.reset=function(){var a=document.getElementById("cvox_keymaps"),a=a.options[a.selectedIndex].id,b=cvox.ChromeVox.msgs,b=cvox.OptionsPage.prefs.getPrefs().currentKeyMap==a?b.getMsg("keymap_reset",[b.getMsg(a)]):b.getMsg("keymap_switch",[b.getMsg(a)]);cvox.OptionsPage.updateStatus_(b);cvox.OptionsPage.prefs.switchToKeyMap(a);document.getElementById("keysContainer").innerHTML="";cvox.OptionsPage.addKeys();cvox.ChromeVox.msgs.addTranslatedMessagesToDom(document)};
-cvox.OptionsPage.updateStatus_=function(a){document.getElementById("status").innerText=a};cvox.OptionsPage.hidePlatformSpecifics=function(){if(!cvox.ChromeVox.isChromeOS)for(var a=document.body.querySelectorAll(".chromeos"),b=0,c;c=a[b];b++)c.setAttribute("aria-hidden","true"),c.style.display="none"};document.addEventListener("DOMContentLoaded",function(){cvox.OptionsPage.init()},!1);cvox.ChromeVoxBackground=function(){};
+cvox.OptionsPage.updateStatus_=function(a){document.getElementById("status").innerText=a};cvox.OptionsPage.hidePlatformSpecifics=function(){if(!cvox.ChromeVox.isChromeOS)for(var a=document.body.querySelectorAll(".chromeos"),b=0,c;c=a[b];b++)c.setAttribute("aria-hidden","true"),c.style.display="none"};cvox.OptionsPage.speak=function(a,b,c){var d=chrome.extension.getBackgroundPage().speak;d.apply(null,arguments)};document.addEventListener("DOMContentLoaded",function(){cvox.OptionsPage.init()},!1);cvox.ChromeVoxBackground=function(){};
cvox.ChromeVoxBackground.prototype.init=function(){if(!cvox.ChromeVox.isChromeOS||"mndnfokpggljbaajbnioimlmbfngpief"==chrome.i18n.getMessage("@@extension_id")){cvox.ChromeVox.msgs=cvox.HostFactory.getMsgs();this.prefs=new cvox.ChromeVoxPrefs;this.readPrefs();var a=cvox.ConsoleTts.getInstance();a.setEnabled(!0);this.backgroundTts_=new cvox.TtsBackground;this.tts=(new cvox.CompositeTts).add(this.backgroundTts_).add(a);this.earcons=new cvox.EarconsBackground;this.addBridgeListener();this.backgroundBraille_=
new cvox.BrailleBackground;this.accessibilityApiHandler_=new cvox.AccessibilityApiHandler(this.tts,this.backgroundBraille_,this.earcons);cvox.ChromeVox.tts=this.tts;cvox.ChromeVox.braille=this.backgroundBraille_;cvox.ChromeVox.earcons=this.earcons;cvox.ChromeVox.isChromeOS&&chrome.accessibilityPrivate.onChromeVoxLoadStateChanged&&chrome.accessibilityPrivate.onChromeVoxLoadStateChanged.addListener(this.onLoadStateChanged);var b;b=["chromeVoxChromePageScript.js"];var c=this,a=function(a){chrome.windows.getAll({populate:!0},
function(e){for(var f=0;f<e.length;f++)for(var g=e[f].tabs,h=0;h<g.length;h++){var k=g[h];c.injectChromeVoxIntoTab(k,b,a)}})};this.checkVersionNumber();chrome.extension.onMessage.addListener(function(a,b,c){if(a.srcFile){var g=a.srcFile;cvox.InjectedScriptLoader.fetchCode([g],function(a){c({code:a[g]})})}return!0});cvox.InjectedScriptLoader.fetchCode(b,a);"false"==localStorage.active?this.tts.speak(cvox.ChromeVox.msgs.getMsg("chromevox_inactive"),1):cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.WML)&&
@@ -1691,5 +1707,5 @@ break;case cvox.TypingEcho.NONE:c=cvox.ChromeVox.msgs.getMsg("none_echo")}c&&thi
id:a.startCallbackId})});void 0!=a.endCallbackId&&(a.properties.endCallback=function(){b.postMessage({message:"TTS_CALLBACK",id:a.endCallbackId})});try{this.onTtsMessage(a)}catch(f){console.log(f)}break;case "EARCON":this.onEarconMessage(a);break;case "BRAILLE":try{this.backgroundBraille_.onBrailleMessage(a)}catch(g){console.log(g)}}},this))};cvox.ChromeVoxBackground.prototype.checkVersionNumber=function(){this.isIncognito_()||(this.localStorageVersion=localStorage.versionString,this.showNotesIfNewVersion())};
cvox.ChromeVoxBackground.prototype.displayReleaseNotes=function(){chrome.tabs.create({url:"http://chromevox.com/release_notes.html"})};
cvox.ChromeVoxBackground.prototype.showNotesIfNewVersion=function(){var a=chrome.extension.getURL("manifest.json"),b=new XMLHttpRequest,c=this;b.onreadystatechange=function(){if(4==b.readyState){var a=JSON.parse(b.responseText);console.log("Version: "+a.version);var e=c.localStorageVersion!=a.version;-1!=navigator.userAgent.indexOf("CrOS")&&void 0==c.localStorageVersion&&(e=!1);e&&c.displayReleaseNotes();this.localStorageVersion=localStorage.versionString=a.version}};b.open("GET",a);b.send()};
-cvox.ChromeVoxBackground.prototype.readPrefs=function(){var a=this.prefs.getPrefs();cvox.ChromeVoxEditableTextBase.useIBeamCursor="true"==a.useIBeamCursor;cvox.ChromeVox.isActive="true"==a.active||cvox.ChromeVox.isChromeOS;cvox.ChromeVox.isStickyOn="true"==a.sticky};cvox.ChromeVoxBackground.prototype.isIncognito_=function(){var a=!1;chrome.tabs.getCurrent(function(b){a=b?b.incognito:!0});return a};
-cvox.ChromeVoxBackground.prototype.onLoadStateChanged=function(a,b){a&&b&&(cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("chromevox_intro"),1,{doNotInterrupt:!0}),cvox.ChromeVox.braille.write(cvox.NavBraille.fromText(cvox.ChromeVox.msgs.getMsg("intro_brl"))))};var background$$inline_14=new cvox.ChromeVoxBackground;background$$inline_14.init();window.speak=goog.bind(background$$inline_14.tts.speak,background$$inline_14.tts);window.prefs=background$$inline_14.prefs;window.braille=cvox.ChromeVox.braille;
+cvox.ChromeVoxBackground.prototype.readPrefs=function(){var a=this.prefs.getPrefs();cvox.ChromeVoxEditableTextBase.useIBeamCursor="true"==a.useIBeamCursor;cvox.ChromeVox.isActive="true"==a.active||cvox.ChromeVox.isChromeOS;cvox.ChromeVox.isStickyPrefOn="true"==a.sticky};cvox.ChromeVoxBackground.prototype.isIncognito_=function(){var a=!1;chrome.tabs.getCurrent(function(b){a=b?b.incognito:!0});return a};
+cvox.ChromeVoxBackground.prototype.onLoadStateChanged=function(a,b){a&&b&&(cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("chromevox_intro"),1,{doNotInterrupt:!0}),cvox.ChromeVox.braille.write(cvox.NavBraille.fromText(cvox.ChromeVox.msgs.getMsg("intro_brl"))))};var background$$inline_8=new cvox.ChromeVoxBackground;background$$inline_8.init();window.speak=goog.bind(background$$inline_8.tts.speak,background$$inline_8.tts);window.prefs=background$$inline_8.prefs;window.braille=cvox.ChromeVox.braille;
diff --git a/chrome/third_party/chromevox/chromeVoxChromeOptionsScript.js b/chrome/third_party/chromevox/chromeVoxChromeOptionsScript.js
index a941e05..ebb06d2 100644
--- a/chrome/third_party/chromevox/chromeVoxChromeOptionsScript.js
+++ b/chrome/third_party/chromevox/chromeVoxChromeOptionsScript.js
@@ -1,5 +1,5 @@
var goog=goog||{};goog.global=this;goog.isDef=function(a){return void 0!==a};goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&goog.isDef(b)?c[d]=b:c=c[d]?c[d]:c[d]={}};goog.define=function(a,b){var c=b;goog.exportPath_(a,c)};goog.DEBUG=!1;goog.LOCALE="en";goog.TRUSTED_SITE=!0;goog.STRICT_MODE_COMPATIBLE=!1;goog.provide=function(a){goog.exportPath_(a)};
-goog.setTestOnly=function(a){if(!goog.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+a?": "+a:".");};goog.forwardDeclare=function(){};goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
+goog.setTestOnly=function(a){if(!goog.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+(a?": "+a:"."));};goog.forwardDeclare=function(){};goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
goog.addDependency=function(a,b,c){if(goog.DEPENDENCIES_ENABLED){var d;a=a.replace(/\\/g,"/");for(var e=goog.dependencies_,f=0;d=b[f];f++)e.nameToPath[d]=a,a in e.pathToNames||(e.pathToNames[a]={}),e.pathToNames[a][d]=!0;for(d=0;b=c[d];d++)a in e.requires||(e.requires[a]={}),e.requires[a][b]=!0}};goog.useStrictRequires=!1;goog.ENABLE_DEBUG_LOADER=!0;goog.require=function(){};goog.basePath="";goog.nullFunction=function(){};goog.identityFunction=function(a){return a};
goog.abstractMethod=function(){throw Error("unimplemented abstract method");};goog.addSingletonGetter=function(a){a.getInstance=function(){if(a.instance_)return a.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=a);return a.instance_=new a}};goog.instantiatedSingletons_=[];goog.DEPENDENCIES_ENABLED=!1;
goog.DEPENDENCIES_ENABLED&&(goog.included_={},goog.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}},goog.inHtmlDocument_=function(){var a=goog.global.document;return"undefined"!=typeof a&&"write"in a},goog.findBasePath_=function(){if(goog.global.CLOSURE_BASE_PATH)goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var a=goog.global.document,a=a.getElementsByTagName("script"),b=a.length-1;0<=b;--b){var c=a[b].src,d=c.lastIndexOf("?"),d=-1==d?
@@ -19,9 +19,11 @@ goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=
goog.base=function(a,b,c){var d=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!d)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(d.superClass_)return d.superClass_.constructor.apply(a,Array.prototype.slice.call(arguments,1));for(var e=Array.prototype.slice.call(arguments,2),f=!1,g=a.constructor;g;g=g.superClass_&&g.superClass_.constructor)if(g.prototype[b]===d)f=!0;else if(f)return g.prototype[b].apply(a,
e);if(a[b]===d)return a.constructor.prototype[b].apply(a,e);throw Error("goog.base called from a method of one name to a method of a different name");};goog.scope=function(a){a.call(goog.global)};goog.MODIFY_FUNCTION_PROTOTYPES=!0;
goog.MODIFY_FUNCTION_PROTOTYPES&&(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 goog.bind.apply(null,c)}return goog.bind(this,a)},Function.prototype.partial=function(a){var b=Array.prototype.slice.call(arguments);b.unshift(this,null);return goog.bind.apply(null,b)},Function.prototype.inherits=function(a){goog.inherits(this,a)},Function.prototype.mixin=function(a){goog.mixin(this.prototype,
-a)});var cvox={VERBOSITY_VERBOSE:0,VERBOSITY_BRIEF:1,ChromeVox:function(){}};cvox.ChromeVox.host=null;cvox.ChromeVox.msgs=null;cvox.ChromeVox.isActive=!0;cvox.ChromeVox.version=null;cvox.ChromeVox.earcons=null;cvox.ChromeVox.navigationManager=null;cvox.ChromeVox.serializer=null;cvox.ChromeVox.isStickyOn=!1;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVox.verbosity=cvox.VERBOSITY_VERBOSE;cvox.ChromeVox.typingEcho=0;cvox.ChromeVox.keyEcho={};cvox.ChromeVox.position={};cvox.ChromeVox.isChromeOS=-1!=navigator.userAgent.indexOf("CrOS");
-cvox.ChromeVox.isMac=-1!=navigator.platform.indexOf("Mac");cvox.ChromeVox.modKeyStr=cvox.ChromeVox.isChromeOS?"Shift+Search":cvox.ChromeVox.isMac?"Ctrl+Cmd":"Shift+Alt";cvox.ChromeVox.sequenceSwitchKeyCodes=[];cvox.ChromeVox.visitedUrls={};cvox.ChromeVox.markInUserCommand=function(){};cvox.ChromeVox.syncToNode=function(){};cvox.ChromeVox.speakNode=function(){};cvox.ChromeVox.executeUserCommand=function(){};cvox.ChromeVox.entireDocumentIsHidden=!1;
-cvox.ChromeVox.storeOn=function(a){a.isStickyOn=cvox.ChromeVox.isStickyOn;cvox.ChromeVox.navigationManager.storeOn(a)};cvox.ChromeVox.readFrom=function(a){cvox.ChromeVox.isStickyOn=a.isStickyOn;cvox.ChromeVox.navigationManager.readFrom(a)};cvox.KeySequence=function(a,b,c,d){this.doubleTap=!!d;this.cvoxModifier=void 0==b?this.isCVoxModifierActive(a):b;this.stickyMode=!!a.stickyMode;this.prefixKey=!!a.keyPrefix;this.skipStripping=!!c;if(this.stickyMode&&this.prefixKey)throw"Prefix key and sticky mode cannot both be enabled: "+a;a=this.resolveChromeOSSpecialKeys_(a);this.keys={ctrlKey:[],searchKeyHeld:[],altKey:[],altGraphKey:[],shiftKey:[],metaKey:[],keyCode:[]};this.extractKey_(a)};
+a)});goog.defineClass=function(a,b){var c=b.constructor,d=b.statics;if(!c||c==Object.prototype.constructor)throw Error("constructor property is required.");c=goog.defineClass.createSealingConstructor_(c);a&&goog.inherits(c,a);delete b.constructor;delete b.statics;goog.defineClass.applyProperties_(c.prototype,b);null!=d&&(d instanceof Function?d(c):goog.defineClass.applyProperties_(c,d));return c};goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG;
+goog.defineClass.createSealingConstructor_=function(a){if(goog.defineClass.SEAL_CLASS_INSTANCES&&Object.seal instanceof Function){var b=function(){var c=a.apply(this,arguments)||this;this.constructor===b&&Object.seal(c);return c};return b}return a};goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
+goog.defineClass.applyProperties_=function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);for(var d=0;d<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++)c=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d],Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};var cvox={VERBOSITY_VERBOSE:0,VERBOSITY_BRIEF:1,ChromeVox:function(){}};cvox.ChromeVox.host=null;cvox.ChromeVox.msgs=null;cvox.ChromeVox.isActive=!0;cvox.ChromeVox.version=null;cvox.ChromeVox.earcons=null;cvox.ChromeVox.navigationManager=null;cvox.ChromeVox.serializer=null;cvox.ChromeVox.isStickyPrefOn=!1;cvox.ChromeVox.stickyOverride=null;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVox.verbosity=cvox.VERBOSITY_VERBOSE;cvox.ChromeVox.typingEcho=0;cvox.ChromeVox.keyEcho={};cvox.ChromeVox.position={};
+cvox.ChromeVox.isChromeOS=-1!=navigator.userAgent.indexOf("CrOS");cvox.ChromeVox.isMac=-1!=navigator.platform.indexOf("Mac");cvox.ChromeVox.modKeyStr=cvox.ChromeVox.isChromeOS?"Shift+Search":cvox.ChromeVox.isMac?"Ctrl+Cmd":"Shift+Alt";cvox.ChromeVox.sequenceSwitchKeyCodes=[];cvox.ChromeVox.visitedUrls={};cvox.ChromeVox.markInUserCommand=function(){};cvox.ChromeVox.syncToNode=function(){};cvox.ChromeVox.speakNode=function(){};cvox.ChromeVox.executeUserCommand=function(){};
+cvox.ChromeVox.entireDocumentIsHidden=!1;cvox.ChromeVox.storeOn=function(a){a.isStickyPrefOn=cvox.ChromeVox.isStickyPrefOn;cvox.ChromeVox.navigationManager.storeOn(a)};cvox.ChromeVox.readFrom=function(a){cvox.ChromeVox.isStickyPrefOn=a.isStickyPrefOn;cvox.ChromeVox.navigationManager.readFrom(a)};cvox.ChromeVox.isStickyModeOn=function(){return null!==cvox.ChromeVox.stickyOverride?cvox.ChromeVox.stickyOverride:cvox.ChromeVox.isStickyPrefOn};cvox.KeySequence=function(a,b,c,d){this.doubleTap=!!d;this.cvoxModifier=void 0==b?this.isCVoxModifierActive(a):b;this.stickyMode=!!a.stickyMode;this.prefixKey=!!a.keyPrefix;this.skipStripping=!!c;if(this.stickyMode&&this.prefixKey)throw"Prefix key and sticky mode cannot both be enabled: "+a;a=this.resolveChromeOSSpecialKeys_(a);this.keys={ctrlKey:[],searchKeyHeld:[],altKey:[],altGraphKey:[],shiftKey:[],metaKey:[],keyCode:[]};this.extractKey_(a)};
cvox.KeySequence.KEY_PRESS_CODE={39:222,44:188,45:189,46:190,47:191,59:186,91:219,92:220,93:221};cvox.KeySequence.doubleTapCache=[];cvox.KeySequence.prototype.addKeyEvent=function(a){if(1<this.keys.keyCode.length)return!1;this.extractKey_(a);return!0};cvox.KeySequence.prototype.equals=function(a){if(!this.checkKeyEquality_(a)||this.doubleTap!=a.doubleTap)return!1;if(this.cvoxModifier===a.cvoxModifier)return!0;a=this.cvoxModifier?a:this;return a.stickyMode||a.prefixKey};
cvox.KeySequence.prototype.extractKey_=function(a){for(var b in this.keys)if("keyCode"==b){var c;"keypress"==a.type&&97<=a[b]&&122>=a[b]?c=a[b]-32:"keypress"==a.type&&(c=cvox.KeySequence.KEY_PRESS_CODE[a[b]]);this.keys[b].push(c||a[b])}else this.isKeyModifierActive(a,b)?this.keys[b].push(!0):this.keys[b].push(!1);this.cvoxModifier&&this.rationalizeKeys_()};
cvox.KeySequence.prototype.rationalizeKeys_=function(){if(!this.skipStripping){var a=cvox.ChromeVox.modKeyStr.split(/\+/g),b=this.keys.keyCode.length-1;-1!=a.indexOf("Ctrl")&&(this.keys.ctrlKey[b]=!1);-1!=a.indexOf("Alt")&&(this.keys.altKey[b]=!1);-1!=a.indexOf("Shift")&&(this.keys.shiftKey[b]=!1);var c=this.getMetaKeyName_();if(-1!=a.indexOf(c))if("Search"==c)this.keys.searchKeyHeld[b]=!1;else if("Cmd"==c||"Win"==c)this.keys.metaKey[b]=!1}};
@@ -765,10 +767,11 @@ d++;if(b&&c){for(var d=a,e=0;d&&!cvox.DomUtil.isDescendantOfNode(b,d);)d=d.paren
cvox.DomUtil.getValue=function(a){var b=cvox.AriaUtil.getActiveDescendant(a);if(b)return cvox.DomUtil.collapseWhitespace(cvox.DomUtil.getValue(b)+" "+cvox.DomUtil.getName(b));if(a.constructor==HTMLSelectElement){var b="",c=a.selectedOptions?a.selectedOptions[0]:null;a=a.selectedOptions?a.selectedOptions[a.selectedOptions.length-1]:null;c&&a&&c!=a?b=cvox.ChromeVox.msgs.getMsg("selected_options_value",[c.text,a.text]):c&&(b=c.text+"");return b}if(a.constructor==HTMLTextAreaElement)return a.value;if(a.constructor==
HTMLInputElement)switch(a.type){case "hidden":case "image":case "submit":case "reset":case "button":case "checkbox":case "radio":return"";case "password":return a.value.replace(/./g,"dot ");default:return a.value}return a.isContentEditable?cvox.DomUtil.getNameFromChildren(a,!0):""};
cvox.DomUtil.getImageTitle=function(a){a.hasAttribute("alt")?a=a.alt:a.hasAttribute("title")?a=a.title:(a=a.src,"data"!=a.substring(0,4)?(a=a.substring(a.lastIndexOf("/")+1,a.lastIndexOf(".")),a=1<=a.length&&16>=a.length?a+" Image":"Image"):a="Image");return a};
+cvox.DomUtil.getLabelledByTargets=function(){if(cvox.labelledByTargets)return cvox.labelledByTargets;for(var a=document.querySelectorAll("[aria-labelledby]"),b={},c=0;c<a.length;++c)for(var d=a[c],d=d.getAttribute("aria-labelledby"),d=d.split(/ +/),e=0;e<d.length;e++)b[d[e]]=!0;cvox.labelledByTargets=b;window.setTimeout(function(){cvox.labelledByTargets=null},0);return b};
cvox.DomUtil.hasContent=function(a){if(8==a.nodeType||cvox.DomUtil.isDescendantOf(a,"HEAD")||cvox.DomUtil.isDescendantOf(a,"SCRIPT")||cvox.DomUtil.isDescendantOf(a,"NOSCRIPT")||cvox.DomUtil.isDescendantOf(a,"NOEMBED")||cvox.DomUtil.isDescendantOf(a,"STYLE")||!cvox.DomUtil.isVisible(a)||cvox.AriaUtil.isHidden(a))return!1;if(cvox.DomUtil.isControl(a)||cvox.DomUtil.isDescendantOf(a,"VIDEO")||cvox.DomUtil.isDescendantOf(a,"AUDIO")||"IFRAME"==a.tagName&&a.src&&0!=a.src.indexOf("javascript:"))return!0;
for(var b="button,input,select,textarea",c=a.parentElement;c&&"LABEL"!=c.tagName;)c=c.parentElement;if(c){var d=c.querySelector(b);if(c.hasAttribute("for")){if(c=c.getAttribute("for"),(c=document.getElementById(c))&&cvox.DomUtil.isControl(c)&&!d)return!1}else if(d)return!1}for(d=a.parentElement;d&&"LEGEND"!=d.tagName;)d=d.parentElement;if(d){for(c=d.parentElement;c&&"FIELDSET"!=c.tagName;)c=c.parentElement;d=c&&c.querySelector(b);if(c&&!d)return!1}if(cvox.DomPredicates.linkPredicate([a])||"TABLE"==
-a.tagName&&!cvox.DomUtil.isLayoutTable(a)||cvox.DomUtil.isMath(a)||cvox.DomPredicates.headingPredicate([a]))return!0;b=cvox.DomUtil.getValue(a)+" "+cvox.DomUtil.getName(a);a=cvox.DomUtil.getState(a,!0);return b.match(/^\s+$/)&&""===a?!1:!0};cvox.DomUtil.getAncestors=function(a){for(var b=[];a;)b.push(a),a=a.parentNode;for(b.reverse();b.length&&!b[0].tagName&&!b[0].nodeValue;)b.shift();return b};
-cvox.DomUtil.compareAncestors=function(a,b){for(var c=0;a[c]&&b[c]&&a[c]==b[c];)c++;a[c]||b[c]||(c=-1);return c};cvox.DomUtil.getUniqueAncestors=function(a,b,c){a=cvox.DomUtil.getAncestors(a);b=cvox.DomUtil.getAncestors(b);a=cvox.DomUtil.compareAncestors(a,b);a=b.slice(a);return 0==a.length&&c?b:a};
+a.tagName&&!cvox.DomUtil.isLayoutTable(a)||cvox.DomUtil.isMath(a)||cvox.DomPredicates.headingPredicate([a])||cvox.DomUtil.isFocusable(a))return!0;b=cvox.DomUtil.getLabelledByTargets();for(d=a;d;){if(d.id&&b[d.id])if(c=d.getAttribute("aria-labelledby")){if(c=c.split(/ +/),-1==c.indexOf(d.id))return!1}else return!1;d=d.parentElement}b=cvox.DomUtil.getValue(a)+" "+cvox.DomUtil.getName(a);a=cvox.DomUtil.getState(a,!0);return b.match(/^\s+$/)&&""===a?!1:!0};
+cvox.DomUtil.getAncestors=function(a){for(var b=[];a;)b.push(a),a=a.parentNode;for(b.reverse();b.length&&!b[0].tagName&&!b[0].nodeValue;)b.shift();return b};cvox.DomUtil.compareAncestors=function(a,b){for(var c=0;a[c]&&b[c]&&a[c]==b[c];)c++;a[c]||b[c]||(c=-1);return c};cvox.DomUtil.getUniqueAncestors=function(a,b,c){a=cvox.DomUtil.getAncestors(a);b=cvox.DomUtil.getAncestors(b);a=cvox.DomUtil.compareAncestors(a,b);a=b.slice(a);return 0==a.length&&c?b:a};
cvox.DomUtil.getRoleMsg=function(a,b){var c;c=cvox.AriaUtil.getRoleNameMsg(a);c||("INPUT"==a.tagName?c=cvox.DomUtil.INPUT_TYPE_TO_INFORMATION_TABLE_MSG[a.type]:"A"==a.tagName&&cvox.DomUtil.isInternalLink(a)?c="internal_link":"A"==a.tagName&&a.getAttribute("name")?c="":a.isContentEditable?c="input_type_text":cvox.DomUtil.isMath(a)?c="math_expr":"TABLE"==a.tagName&&cvox.DomUtil.isLayoutTable(a)?c="":b==cvox.VERBOSITY_BRIEF?c=cvox.DomUtil.TAG_TO_INFORMATION_TABLE_BRIEF_MSG[a.tagName]:(c=cvox.DomUtil.TAG_TO_INFORMATION_TABLE_VERBOSE_MSG[a.tagName],
cvox.DomUtil.hasLongDesc(a)&&(c="image_with_long_desc"),!c&&a.onclick&&(c="clickable")));return c};cvox.DomUtil.getRole=function(a,b){var c=cvox.DomUtil.getRoleMsg(a,b)||"",d=c&&" "!=c?cvox.ChromeVox.msgs.getMsg(c):"";return d?d:c};
cvox.DomUtil.getListLength=function(a){var b=0;for(a=a.firstChild;a;a=a.nextSibling)if(cvox.DomUtil.isVisible(a)&&("LI"==a.tagName||a.getAttribute&&"listitem"==a.getAttribute("role"))){if(a.hasAttribute("aria-setsize")){var c=parseInt(a.getAttribute("aria-setsize"),10);if(!isNaN(c))return c}b++}return b};
@@ -861,7 +864,8 @@ cvox.LibLouis.prototype.onInstanceLoad_=function(){window.console.info("loaded l
cvox.LibLouis.prototype.onInstanceError_=function(){window.console.error("failed to load liblouis Native Client instance");this.instanceState_=cvox.LibLouis.InstanceState.ERROR;this.pendingTranslators_.forEach(goog.bind(function(a){this.getTranslator(a.tableName,a.callback)},this));this.pendingTranslators_.length=0};
cvox.LibLouis.prototype.onInstanceMessage_=function(a){goog.DEBUG&&window.console.debug("RPC <- "+a.data);a=JSON.parse(a.data);var b=a.in_reply_to;if(goog.isDef(b)){goog.isDef(a.error)&&window.console.error("liblouis Native Client error",a.error);var c=this.pendingRpcCallbacks_[b];goog.isDef(c)&&(delete this.pendingRpcCallbacks_[b],c(a))}else window.console.warn("liblouis Native Client module sent message with no ID",a)};cvox.LibLouis.Translator=function(a,b){this.instance_=a;this.tableName_=b};
cvox.LibLouis.Translator.prototype.translate=function(a,b){var c={table_name:this.tableName_,text:a};this.instance_.rpc_("Translate",c,function(d){var e=null,f=null,g=null;d.success&&goog.isString(d.cells)?(e=cvox.LibLouis.Translator.decodeHexString_(d.cells),goog.isDef(d.text_to_braille)&&(f=d.text_to_braille),goog.isDef(d.braille_to_text)&&(g=d.braille_to_text)):0<a.length&&console.error("Braille translation error for "+JSON.stringify(c));b(e,f,g)})};
-cvox.LibLouis.Translator.decodeHexString_=function(a){if(!/^([0-9a-f]{2})*$/i.test(a))throw Error("invalid hexadecimal string");for(var b=new Uint8Array(a.length/2),c=0,d=0;d<a.length;d+=2)b[c++]=parseInt(a.substring(d,d+2),16);return b.buffer};cvox.LibLouis.Translator.encodeHexString_=function(a){a=new Uint8Array(a);for(var b="",c=0;c<a.length;c++)var d=a[c],b=b+((16>d?"0":"")+d.toString(16));return b};cvox.ChromeVoxJSON||(cvox.ChromeVoxJSON={});
+cvox.LibLouis.Translator.prototype.backTranslate=function(a,b){var c={table_name:this.tableName_,cells:cvox.LibLouis.Translator.encodeHexString_(a)};this.instance_.rpc_("BackTranslate",c,function(a){a.success&&goog.isString(a.text)?b(a.text):b(null)})};cvox.LibLouis.Translator.decodeHexString_=function(a){if(!/^([0-9a-f]{2})*$/i.test(a))throw Error("invalid hexadecimal string");for(var b=new Uint8Array(a.length/2),c=0,d=0;d<a.length;d+=2)b[c++]=parseInt(a.substring(d,d+2),16);return b.buffer};
+cvox.LibLouis.Translator.encodeHexString_=function(a){a=new Uint8Array(a);for(var b="",c=0;c<a.length;c++)var d=a[c],b=b+((16>d?"0":"")+d.toString(16));return b};cvox.ChromeVoxJSON||(cvox.ChromeVoxJSON={});
window.JSON&&"[object JSON]"==window.JSON.toString()?cvox.ChromeVoxJSON=window.JSON:function(){function a(a){return 10>a?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=h[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(a,d){var e,h,m,s,u=f,t,r=d[a];r&&"object"===typeof r&&"function"===typeof r.toJSON&&(r=r.toJSON(a));"function"===typeof k&&(r=k.call(d,a,r));switch(typeof r){case "string":return b(r);
case "number":return isFinite(r)?String(r):"null";case "boolean":case "null":return String(r);case "object":if(!r)return"null";f+=g;t=[];if("[object Array]"===Object.prototype.toString.apply(r)){s=r.length;for(e=0;e<s;e+=1)t[e]=c(e,r)||"null";m=0===t.length?"[]":f?"[\n"+f+t.join(",\n"+f)+"\n"+u+"]":"["+t.join(",")+"]";f=u;return m}if(k&&"object"===typeof k)for(s=k.length,e=0;e<s;e+=1)h=k[e],"string"===typeof h&&(m=c(h,r))&&t.push(b(h)+(f?": ":":")+m);else for(h in r)Object.hasOwnProperty.call(r,h)&&
(m=c(h,r))&&t.push(b(h)+(f?": ":":")+m);m=0===t.length?"{}":f?"{\n"+f+t.join(",\n"+f)+"\n"+u+"}":"{"+t.join(",")+"}";f=u;return m}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":"null"},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});
@@ -887,36 +891,49 @@ cvox.Focuser.shouldEnterSuspendEvents_=function(a){if(a.constructor&&a.construct
cvox.BrailleUtil.TEMPLATE={base:"c n v r s",aria_role_alert:"r: n",aria_role_button:"[n]",aria_role_textbox:"n: v r",input_type_button:"[n]",input_type_checkbox:"n (s)",input_type_email:"n: v r",input_type_number:"n: v r",input_type_password:"n: v r",input_type_search:"n: v r",input_type_submit:"[n]",input_type_text:"n: v r",input_type_tel:"n: v r",input_type_url:"n: v r",tag_button:"[n]",tag_textarea:"n: v r"};cvox.BrailleUtil.ValueSpan=function(a){this.offset=a};
cvox.BrailleUtil.ValueSpan.fromJson=function(a){return new cvox.BrailleUtil.ValueSpan(a.offset)};cvox.BrailleUtil.ValueSpan.prototype.toJson=function(){return this};cvox.Spannable.registerSerializableSpan(cvox.BrailleUtil.ValueSpan,"cvox.BrailleUtil.ValueSpan",cvox.BrailleUtil.ValueSpan.fromJson,cvox.BrailleUtil.ValueSpan.prototype.toJson);cvox.BrailleUtil.ValueSelectionSpan=function(){};cvox.Spannable.registerStatelessSerializableSpan(cvox.BrailleUtil.ValueSelectionSpan,"cvox.BrailleUtil.ValueSelectionSpan");
cvox.BrailleUtil.getName=function(a){return a?cvox.DomUtil.getName(a).trim():""};cvox.BrailleUtil.getRoleMsg=function(a){if(!a)return"";(a=cvox.DomUtil.getRoleMsg(a,cvox.VERBOSITY_VERBOSE))&&(a=cvox.DomUtil.collapseWhitespace(a));a&&0<a.length&&cvox.ChromeVox.msgs.getMsg(a+"_brl")&&(a+="_brl");return a};cvox.BrailleUtil.getRole=function(a){return a?(a=cvox.BrailleUtil.getRoleMsg(a))?cvox.ChromeVox.msgs.getMsg(a):"":""};
-cvox.BrailleUtil.getState=function(a){return a?cvox.NodeStateUtil.expand(cvox.DomUtil.getStateMsgs(a,!0).map(function(a){cvox.ChromeVox.msgs.getMsg(a[0]+"_brl")&&(a[0]+="_brl");return a})):""};cvox.BrailleUtil.getContainer=function(a,b){if(!a||!b)return"";for(var c=cvox.DomUtil.getUniqueAncestors(a,b),d=0,e;e=c[d];d++)if((e=cvox.BrailleUtil.getRoleMsg(e))&&-1!=cvox.BrailleUtil.CONTAINER.indexOf(e))return cvox.ChromeVox.msgs.getMsg(e);return""};
-cvox.BrailleUtil.getValue=function(a){if(!a)return new cvox.Spannable;var b=new cvox.BrailleUtil.ValueSpan(0);if(cvox.DomUtil.isInputTypeText(a)){var c=a.value;"password"===a.type&&(c=c.replace(/./g,"*"));b=new cvox.Spannable(c,b);if(a===document.activeElement&&cvox.DomUtil.doesInputSupportSelection(a)){var d=goog.math.clamp(a.selectionStart,0,b.getLength());a=goog.math.clamp(a.selectionEnd,0,b.getLength());b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a))}return b}if(a instanceof
-HTMLTextAreaElement){d=new cvox.EditableTextAreaShadow;d.update(a);var e=d.getLineIndex(a.selectionEnd),c=d.getLineStart(e),d=d.getLineEnd(e),d=a.value.substring(c,d);b.offset=c;b=new cvox.Spannable(d,b);a===document.activeElement&&(d=goog.math.clamp(a.selectionStart-c,0,b.getLength()),a=goog.math.clamp(a.selectionEnd-c,0,b.getLength()),b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a)));return b}return new cvox.Spannable(cvox.DomUtil.getValue(a),b)};
-cvox.BrailleUtil.getTemplated=function(a,b,c){c=c?c:{};var d=c.roleMsg||(b?cvox.DomUtil.getRoleMsg(b,cvox.VERBOSITY_VERBOSE):""),e=c.role;!e&&c.roleMsg&&(e=cvox.ChromeVox.msgs.getMsg(c.roleMsg+"_brl")||cvox.ChromeVox.msgs.getMsg(c.roleMsg));for(var e=e||cvox.BrailleUtil.getRole(b),d=cvox.BrailleUtil.TEMPLATE[d]||cvox.BrailleUtil.TEMPLATE.base,f=new cvox.Spannable,g=function(d){switch(d){case "n":return c.name||cvox.BrailleUtil.getName(b);case "r":return e;case "s":return c.state||cvox.BrailleUtil.getState(b);
-case "c":return c.container||cvox.BrailleUtil.getContainer(a,b);case "v":return c.value||cvox.BrailleUtil.getValue(b);default:return d}},h=0;h<d.length;h++){var k=g(d[h]);f.append(k);k.toString()||" "!=d[h+1]||h++}return f.trimRight()};cvox.BrailleUtil.createValue=function(a,b,c,d){a=new cvox.Spannable(a,new cvox.BrailleUtil.ValueSpan(d||0));goog.isDef(b)&&(c=goog.isDef(c)?c:b,b>c&&(d=b,b=c,c=d),a.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,b,c));return a};
+cvox.BrailleUtil.getState=function(a){return a?cvox.NodeStateUtil.expand(cvox.DomUtil.getStateMsgs(a,!0).map(function(a){var c=["dummy","dummy","dummy"];cvox.ChromeVox.msgs.getMsg(a[0]+"_brl",c)&&(a[0]+="_brl");return a})):""};cvox.BrailleUtil.getContainer=function(a,b){if(!a||!b)return"";for(var c=cvox.DomUtil.getUniqueAncestors(a,b),d=0,e;e=c[d];d++)if((e=cvox.BrailleUtil.getRoleMsg(e))&&-1!=cvox.BrailleUtil.CONTAINER.indexOf(e))return cvox.ChromeVox.msgs.getMsg(e);return""};
+cvox.BrailleUtil.getValue=function(a){if(!a)return new cvox.Spannable;var b=new cvox.BrailleUtil.ValueSpan(0);if(cvox.DomUtil.isInputTypeText(a)){var c=a.value;"password"===a.type&&(c=c.replace(/./g,"*"));b=new cvox.Spannable(c,b);if(a===document.activeElement&&cvox.DomUtil.doesInputSupportSelection(a)){var d=cvox.BrailleUtil.clamp_(a.selectionStart,0,b.getLength());a=cvox.BrailleUtil.clamp_(a.selectionEnd,0,b.getLength());b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,
+a))}return b}if(a instanceof HTMLTextAreaElement){d=new cvox.EditableTextAreaShadow;d.update(a);var e=d.getLineIndex(a.selectionEnd),c=d.getLineStart(e),d=d.getLineEnd(e),d=a.value.substring(c,d);b.offset=c;b=new cvox.Spannable(d,b);a===document.activeElement&&(d=cvox.BrailleUtil.clamp_(a.selectionStart-c,0,b.getLength()),a=cvox.BrailleUtil.clamp_(a.selectionEnd-c,0,b.getLength()),b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a)));return b}return new cvox.Spannable(cvox.DomUtil.getValue(a),
+b)};
+cvox.BrailleUtil.getTemplated=function(a,b,c){c=c?c:{};var d=c.roleMsg||(b?cvox.DomUtil.getRoleMsg(b,cvox.VERBOSITY_VERBOSE):""),e=c.role;!e&&c.roleMsg&&(e=cvox.ChromeVox.msgs.getMsg(c.roleMsg+"_brl")||cvox.ChromeVox.msgs.getMsg(c.roleMsg));for(var e=e||cvox.BrailleUtil.getRole(b),d=cvox.BrailleUtil.TEMPLATE[d]||cvox.BrailleUtil.TEMPLATE.base,f=new cvox.Spannable,g=function(d){switch(d){case "n":return c.name||cvox.BrailleUtil.getName(b);case "r":return e;case "s":return c.state||cvox.BrailleUtil.getState(b);case "c":return c.container||
+cvox.BrailleUtil.getContainer(a,b);case "v":return c.value||cvox.BrailleUtil.getValue(b);default:return d}},h=0;h<d.length;h++){var k=g(d[h]);f.append(k);k.toString()||" "!=d[h+1]||h++}return f.trimRight()};cvox.BrailleUtil.createValue=function(a,b,c,d){a=new cvox.Spannable(a,new cvox.BrailleUtil.ValueSpan(d||0));goog.isDef(b)&&(c=goog.isDef(c)?c:b,b>c&&(d=b,b=c,c=d),a.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,b,c));return a};
cvox.BrailleUtil.click=function(a,b){var c=a.text.getSpans(b||0),d=c.filter(function(a){return a instanceof Node})[0];d&&(cvox.Focuser.setFocus(d),goog.isDef(b)&&(cvox.DomUtil.isInputTypeText(d)||d instanceof HTMLTextAreaElement)&&(c=c.filter(function(a){return a instanceof cvox.BrailleUtil.ValueSpan})[0]))&&(c=b-a.text.getSpanStart(c)+c.offset,cvox.ChromeVoxEventWatcher.setUpTextHandler(),d.selectionStart=d.selectionEnd=c,cvox.ChromeVoxEventWatcher.handleTextChanged(!0));cvox.DomUtil.clickElem(d||
-cvox.ChromeVox.navigationManager.getCurrentNode(),!1,!1)};cvox.ExpandingBrailleTranslator=function(a,b){this.defaultTranslator_=a;this.uncontractedTranslator_=b||null};
-cvox.ExpandingBrailleTranslator.prototype.translate=function(a,b){function c(a,b,c){g.push({translator:a,start:b,end:c})}function d(a,b,c,d){a.cells=b;a.textToBraille=c;a.brailleToText=d;0>=--n&&e()}function e(){function a(b,c,d){b.push.apply(b,c.map(function(a){return d+a}))}for(var c=g.reduce(function(a,b){return a+b.cells.byteLength},0),c=new Uint8Array(c),d=0,e=[],f=[],h=0,k;k=g[h];++h)c.set(new Uint8Array(k.cells),d),a(e,k.textToBraille,d),a(f,k.brailleToText,k.start),d+=k.cells.byteLength;b(c.buffer,
-e,f)}var f=this.findExpandRanges_(a);if(0==f.length)this.defaultTranslator_.translate(a.toString(),cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_(a.getLength(),b));else{for(var g=[],h=0,k=0;k<f.length;++k){var l=f[k];h<l.start&&c(this.defaultTranslator_,h,l.start);c(this.uncontractedTranslator_,l.start,l.end);h=l.end}h<a.getLength()&&c(this.defaultTranslator_,h,a.getLength());for(var n=g.length,k=0;f=g[k];++k)f.translator.translate(a.toString().substring(f.start,f.end),cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_(f.end-
-f.start,goog.partial(d,f)))}};cvox.ExpandingBrailleTranslator.rangeForPosition_=function(a,b){if(0>b||b>=a.length)throw Error("Position out of range looking for braille expansion range");var c=a.substring(0,b+1).search(/(\s+|\S+)$/),d=b+/^(\s+|\S+)/.exec(a.substring(b))[0].length;return{start:c,end:d}};
-cvox.ExpandingBrailleTranslator.prototype.findExpandRanges_=function(a){var b=[];if(this.uncontractedTranslator_){var c=a.getSpanInstanceOf(cvox.BrailleUtil.ValueSelectionSpan);if(c){var d=a.getSpanStart(c),e=a.getSpanEnd(c);if(d<a.getLength())for(c=[d],e>d+1&&c.push(e-1),d=null,e=0;e<c.length;++e){var f=cvox.ExpandingBrailleTranslator.rangeForPosition_(a.toString(),c[e]);d&&d.end>=f.start?d.end=f.end:(b.push(f),d=f)}}}return b};
-cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_=function(a,b){return function(c,d,e){b(c||new ArrayBuffer(0),d||goog.array.repeat(0,a),e||[])}};cvox.BrailleDisplayManager=function(){this.translator_=null;this.content_=new cvox.NavBraille({});this.translatedContent_=new ArrayBuffer(0);this.panPosition_=0;this.commandListener_=function(){};this.realDisplayState_=this.displayState_={available:!1,textCellCount:void 0};this.textToBraille_=[];this.brailleToText_=[];cvox.BrailleCaptionsBackground.init(goog.bind(this.onCaptionsStateChanged_,this));if(goog.isDef(chrome.brailleDisplayPrivate)){var a=goog.bind(this.refreshDisplayState_,this);chrome.brailleDisplayPrivate.getDisplayState(a);
-chrome.brailleDisplayPrivate.onDisplayStateChanged.addListener(a);chrome.brailleDisplayPrivate.onKeyEvent.addListener(goog.bind(this.onKeyEvent_,this))}else this.onCaptionsStateChanged_()};cvox.BrailleDisplayManager.CURSOR_DOTS_=192;cvox.BrailleDisplayManager.prototype.setContent=function(a){this.translateContent_(a)};cvox.BrailleDisplayManager.prototype.setCommandListener=function(a){this.commandListener_=a};
-cvox.BrailleDisplayManager.prototype.setTranslator=function(a,b){var c=null!=this.translator_;this.translator_=a?new cvox.ExpandingBrailleTranslator(a,b):null;this.translateContent_(this.content_);c&&!this.translator_&&this.refresh_()};cvox.BrailleDisplayManager.prototype.refreshDisplayState_=function(a){this.realDisplayState_=a;this.displayState_=a.available?a:cvox.BrailleCaptionsBackground.getVirtualDisplayState();this.panPosition_=0;this.refresh_()};
-cvox.BrailleDisplayManager.prototype.onCaptionsStateChanged_=function(){this.refreshDisplayState_(this.realDisplayState_)};
+cvox.ChromeVox.navigationManager.getCurrentNode(),!1,!1)};cvox.BrailleUtil.clamp_=function(a,b,c){return Math.min(Math.max(a,b),c)};cvox.ExpandingBrailleTranslator=function(a,b){this.defaultTranslator_=a;this.uncontractedTranslator_=b||null};cvox.ExpandingBrailleTranslator.ExpansionType={NONE:0,SELECTION:1,ALL:2};
+cvox.ExpandingBrailleTranslator.prototype.translate=function(a,b,c){function d(a,b,c){h.push({translator:a,start:b,end:c})}function e(a,b,c,d){a.cells=b;a.textToBraille=c;a.brailleToText=d;0>=--n&&f()}function f(){function a(b,c,d){b.push.apply(b,c.map(function(a){return d+a}))}for(var b=h.reduce(function(a,b){return a+b.cells.byteLength},0),b=new Uint8Array(b),d=0,e=[],f=[],g=0,k;k=h[g];++g)b.set(new Uint8Array(k.cells),d),a(e,k.textToBraille,d),a(f,k.brailleToText,k.start),d+=k.cells.byteLength;
+c(b.buffer,e,f)}var g=this.findExpandRanges_(a,b);if(0==g.length)this.defaultTranslator_.translate(a.toString(),cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_(a.getLength(),c));else{var h=[],k=0;for(b=0;b<g.length;++b){var l=g[b];k<l.start&&d(this.defaultTranslator_,k,l.start);d(this.uncontractedTranslator_,l.start,l.end);k=l.end}k<a.getLength()&&d(this.defaultTranslator_,k,a.getLength());var n=h.length;for(b=0;g=h[b];++b)g.translator.translate(a.toString().substring(g.start,g.end),cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_(g.end-
+g.start,goog.partial(e,g)))}};cvox.ExpandingBrailleTranslator.rangeForPosition_=function(a,b,c,d){if(0>c||d>a.length)throw RangeError("End-points out of range looking for braille expansion range");if(b<c||b>=d)throw RangeError("Position out of range looking for braille expansion range");c=a.substring(c,b+1).search(/(\s+|\S+)$/)+c;d=b+/^(\s+|\S+)/.exec(a.substring(b,d))[0].length;return{start:c,end:d}};
+cvox.ExpandingBrailleTranslator.prototype.findExpandRanges_=function(a,b){var c=[];if(this.uncontractedTranslator_&&b!=cvox.ExpandingBrailleTranslator.ExpansionType.NONE){var d=a.getSpanInstanceOf(cvox.BrailleUtil.ValueSpan);if(d){var e=a.getSpanStart(d),d=a.getSpanEnd(d);switch(b){case cvox.ExpandingBrailleTranslator.ExpansionType.SELECTION:this.addRangesForSelection_(a,e,d,c);break;case cvox.ExpandingBrailleTranslator.ExpansionType.ALL:c.push({start:e,end:d})}}}return c};
+cvox.ExpandingBrailleTranslator.prototype.addRangesForSelection_=function(a,b,c,d){var e=a.getSpanInstanceOf(cvox.BrailleUtil.ValueSelectionSpan);if(e){var f=a.getSpanStart(e),g=a.getSpanEnd(e);if(!(f<b||g>c))for(e=[],f==c?f>b&&e.push(f-1):(f==g&&f>b&&e.push(f-1),e.push(f),g>f+1&&e.push(g-1)),f=d[d.length-1]||null,g=0;g<e.length;++g){var h=cvox.ExpandingBrailleTranslator.rangeForPosition_(a.toString(),e[g],b,c);f&&f.end>=h.start?f.end=h.end:(d.push(h),f=h)}}};
+cvox.ExpandingBrailleTranslator.nullParamsToEmptyAdapter_=function(a,b){return function(c,d,e){if(!d){d=Array(a);for(var f=0;f<a;++f)d[f]=0}b(c||new ArrayBuffer(0),d,e||[])}};cvox.BrailleDisplayManager=function(){this.translator_=null;this.content_=new cvox.NavBraille({});this.expansionType_=cvox.ExpandingBrailleTranslator.ExpansionType.SELECTION;this.translatedContent_=new ArrayBuffer(0);this.panPosition_=0;this.commandListener_=function(){};this.realDisplayState_=this.displayState_={available:!1,textCellCount:void 0};this.textToBraille_=[];this.brailleToText_=[];cvox.BrailleCaptionsBackground.init(goog.bind(this.onCaptionsStateChanged_,this));if(goog.isDef(chrome.brailleDisplayPrivate)){var a=
+goog.bind(this.refreshDisplayState_,this);chrome.brailleDisplayPrivate.getDisplayState(a);chrome.brailleDisplayPrivate.onDisplayStateChanged.addListener(a);chrome.brailleDisplayPrivate.onKeyEvent.addListener(goog.bind(this.onKeyEvent_,this))}else this.onCaptionsStateChanged_()};cvox.BrailleDisplayManager.CURSOR_DOTS_=192;cvox.BrailleDisplayManager.prototype.setContent=function(a,b){this.translateContent_(a,b)};
+cvox.BrailleDisplayManager.prototype.setCommandListener=function(a){this.commandListener_=a};cvox.BrailleDisplayManager.prototype.setTranslator=function(a,b){var c=null!=this.translator_;this.translator_=a?new cvox.ExpandingBrailleTranslator(a,b):null;this.translateContent_(this.content_,this.expansionType_);c&&!this.translator_&&this.refresh_()};
+cvox.BrailleDisplayManager.prototype.refreshDisplayState_=function(a){this.realDisplayState_=a;this.displayState_=a.available?a:cvox.BrailleCaptionsBackground.getVirtualDisplayState();this.panPosition_=0;this.refresh_()};cvox.BrailleDisplayManager.prototype.onCaptionsStateChanged_=function(){this.refreshDisplayState_(this.realDisplayState_)};
cvox.BrailleDisplayManager.prototype.refresh_=function(){if(this.displayState_.available){var a=this.translatedContent_.slice(this.panPosition_,this.panPosition_+this.displayState_.textCellCount);this.realDisplayState_.available&&chrome.brailleDisplayPrivate.writeDots(a);if(cvox.BrailleCaptionsBackground.isEnabled()){var b=this.brailleToTextPosition_(this.panPosition_),c=this.brailleToTextPosition_(this.panPosition_+a.byteLength);cvox.BrailleCaptionsBackground.setContent(this.content_.text.toString().substring(b,
c),a)}}};
-cvox.BrailleDisplayManager.prototype.translateContent_=function(a){this.translator_?this.translator_.translate(a.text,goog.bind(function(b,c,d){this.content_=a;var e=this.content_.startIndex,f=this.content_.endIndex;this.panPosition_=0;if(0<=e){if(e>=c.length){var e=new ArrayBuffer(b.byteLength+1),g=new Uint8Array(e);g.set(new Uint8Array(b));b=e;e=b.byteLength-1}else e=c[e];f=f>=c.length?b.byteLength:c[f];this.writeCursor_(b,e,f);this.displayState_.available&&(f=this.displayState_.textCellCount,this.panPosition_=
-Math.floor(e/f)*f)}this.translatedContent_=b;this.brailleToText_=d;this.textToBraille_=c;this.refresh_()},this)):(this.content_=a,this.translatedContent_=new ArrayBuffer(0),this.textToBraille_.length=0,this.brailleToText_.length=0)};
-cvox.BrailleDisplayManager.prototype.onKeyEvent_=function(a){switch(a.command){case cvox.BrailleKeyCommand.ROUTING:a.displayPosition=this.brailleToTextPosition_(a.displayPosition+this.panPosition_);case cvox.BrailleKeyCommand.LINE_UP:case cvox.BrailleKeyCommand.LINE_DOWN:case cvox.BrailleKeyCommand.TOP:case cvox.BrailleKeyCommand.BOTTOM:this.commandListener_(a,this.content_);break;case cvox.BrailleKeyCommand.PAN_LEFT:this.panLeft_();break;case cvox.BrailleKeyCommand.PAN_RIGHT:this.panRight_()}};
+cvox.BrailleDisplayManager.prototype.translateContent_=function(a,b){this.translator_?this.translator_.translate(a.text,b,goog.bind(function(c,d,e){this.content_=a;this.expansionType_=b;var f=this.content_.startIndex,g=this.content_.endIndex;this.panPosition_=0;if(0<=f){if(f>=d.length){var f=new ArrayBuffer(c.byteLength+1),h=new Uint8Array(f);h.set(new Uint8Array(c));c=f;f=c.byteLength-1}else f=d[f];g=g>=d.length?c.byteLength:d[g];this.writeCursor_(c,f,g);this.displayState_.available&&(g=this.displayState_.textCellCount,
+this.panPosition_=Math.floor(f/g)*g)}this.translatedContent_=c;this.brailleToText_=e;this.textToBraille_=d;this.refresh_()},this)):(this.content_=a,this.expansionType_=b,this.translatedContent_=new ArrayBuffer(0),this.textToBraille_.length=0,this.brailleToText_.length=0)};
+cvox.BrailleDisplayManager.prototype.onKeyEvent_=function(a){switch(a.command){case cvox.BrailleKeyCommand.PAN_LEFT:this.panLeft_();break;case cvox.BrailleKeyCommand.PAN_RIGHT:this.panRight_();break;case cvox.BrailleKeyCommand.ROUTING:a.displayPosition=this.brailleToTextPosition_(a.displayPosition+this.panPosition_);default:this.commandListener_(a,this.content_)}};
cvox.BrailleDisplayManager.prototype.panLeft_=function(){0>=this.panPosition_?this.commandListener_({command:cvox.BrailleKeyCommand.PAN_LEFT},this.content_):(this.panPosition_=Math.max(0,this.panPosition_-this.displayState_.textCellCount),this.refresh_())};
cvox.BrailleDisplayManager.prototype.panRight_=function(){var a=this.panPosition_+this.displayState_.textCellCount;a>=this.translatedContent_.byteLength?this.commandListener_({command:cvox.BrailleKeyCommand.PAN_RIGHT},this.content_):(this.panPosition_=a,this.refresh_())};
-cvox.BrailleDisplayManager.prototype.writeCursor_=function(a,b,c){if(!(0>b||b>=a.byteLength||c<b||c>a.byteLength))for(b==c&&(c=b+1),a=new DataView(a);b<c;){var d=a.getUint8(b),d=d|cvox.BrailleDisplayManager.CURSOR_DOTS_;a.setUint8(b,d);b++}};cvox.BrailleDisplayManager.prototype.brailleToTextPosition_=function(a){var b=this.brailleToText_;return 0>a?(console.error("WARNING: Braille position < 0: "+a),0):a>=b.length?this.content_.text.getLength():b[a]};cvox.BrailleTable={};cvox.BrailleTable.TABLE_PATH="chromevox/background/braille/tables.json";cvox.BrailleTable.getAll=function(a){var b=chrome.extension.getURL(cvox.BrailleTable.TABLE_PATH);if(!b)throw"Invalid path: "+cvox.BrailleTable.TABLE_PATH;var c=new XMLHttpRequest;c.open("GET",b,!0);c.onreadystatechange=function(){4==c.readyState&&200==c.status&&a(JSON.parse(c.responseText))};c.send()};cvox.BrailleTable.forId=function(a,b){return a.filter(function(a){return a.id===b})[0]||null};
-cvox.BrailleTable.getUncontracted=function(a,b){function c(a,b){return"6"===a.dots&&"8"===b.dots&&goog.string.startsWith(a.locale,b.locale)||a.locale===b.locale&&a.dots===b.dots&&goog.isDef(a.grade)&&goog.isDef(b.grade)&&b.grade<a.grade?b:a}return a.reduce(c,b)};cvox.BrailleBackground=function(a){this.displayManager_=a||new cvox.BrailleDisplayManager;cvox.BrailleTable.getAll(goog.bind(function(a){this.tables_=a;this.initialize_(0)},this));this.displayManager_.setCommandListener(goog.bind(this.sendCommand_,this));this.lastContentId_=this.lastContent_=null};goog.inherits(cvox.BrailleBackground,cvox.AbstractBraille);cvox.BrailleBackground.prototype.write=function(a){this.lastContent_=this.lastContentId_=null;this.displayManager_.setContent(a)};
-cvox.BrailleBackground.prototype.setCommandListener=function(){};
+cvox.BrailleDisplayManager.prototype.writeCursor_=function(a,b,c){if(!(0>b||b>=a.byteLength||c<b||c>a.byteLength))for(b==c&&(c=b+1),a=new DataView(a);b<c;){var d=a.getUint8(b),d=d|cvox.BrailleDisplayManager.CURSOR_DOTS_;a.setUint8(b,d);b++}};cvox.BrailleDisplayManager.prototype.brailleToTextPosition_=function(a){var b=this.brailleToText_;return 0>a?(console.error("WARNING: Braille position < 0: "+a),0):a>=b.length?this.content_.text.getLength():b[a]};cvox.BrailleInputHandler=function(){this.imePort_=null;this.imeActive_=!1;this.activeTranslator_=this.uncontractedTranslator_=this.defaultTranslator_=this.inputContext_=null;this.cells_=[];this.currentTextAfter_=this.currentTextBefore_=this.text_="";this.pendingTextsBefore_=[];this.pendingCells_=[]};cvox.BrailleInputHandler.IME_EXTENSION_ID_="jddehjeebkoimngcbdkaahpobgicbffp";cvox.BrailleInputHandler.IME_PORT_NAME_="cvox.BrailleIme.Port";
+cvox.BrailleInputHandler.prototype.init=function(){chrome.runtime.onConnectExternal.addListener(goog.bind(this.onImeConnect_,this))};cvox.BrailleInputHandler.prototype.setTranslator=function(a,b){this.defaultTranslator_=a;this.uncontractedTranslator_=b||null;this.resetText_()};
+cvox.BrailleInputHandler.prototype.onDisplayContentChanged=function(a){var b=a.getSpanInstanceOf(cvox.BrailleUtil.ValueSpan),c=a.getSpanInstanceOf(cvox.BrailleUtil.ValueSelectionSpan);if(b&&c){var d=a.getSpanStart(b),b=a.getSpanEnd(b),e=a.getSpanStart(c),c=a.getSpanEnd(c);if(e<d||c>b)console.error("Selection outside of value in braille content"),this.resetText_();else{var f=this.currentTextBefore_;this.currentTextBefore_=a.toString().substring(d,e);this.currentTextAfter_=a.toString().substring(c,
+b);if(0<this.cells_.length){if(f!==this.currentTextBefore_){if(0<this.pendingTextsBefore_.length)for(a=0;a<this.pendingTextsBefore_.length;++a)if(this.currentTextBefore_===this.pendingTextsBefore_[a]){this.pendingTextsBefore_.splice(0,a+1);return}this.resetText_()}}else this.updateActiveTranslator_()}}};cvox.BrailleInputHandler.prototype.onBrailleKeyEvent=function(a){if(a.command===cvox.BrailleKeyCommand.DOTS)return this.onBrailleDots_(a.brailleDots);this.pendingCells_.length=0;return!1};
+cvox.BrailleInputHandler.prototype.getExpansionType=function(){return this.inAlwaysUncontractedContext_()?cvox.ExpandingBrailleTranslator.ExpansionType.ALL:0<this.cells_.length&&this.activeTranslator_===this.defaultTranslator_?cvox.ExpandingBrailleTranslator.ExpansionType.NONE:cvox.ExpandingBrailleTranslator.ExpansionType.SELECTION};cvox.BrailleInputHandler.prototype.inAlwaysUncontractedContext_=function(){if(this.inputContext_){var a=this.inputContext_.type;return"url"===a||"email"===a}return!1};
+cvox.BrailleInputHandler.prototype.onBrailleDots_=function(a){if(!this.imeActive_)return this.pendingCells_.push(a),!0;if(!this.inputContext_||!this.activeTranslator_)return!1;0<this.cells_.length&&0==this.cells_[this.cells_.length-1]&&this.resetText_();this.cells_.push(a);a=(new Uint8Array(this.cells_)).buffer;this.activeTranslator_.backTranslate(a,goog.bind(function(a){if(a){var c=this.text_.length,d=this.longestCommonPrefixLength_(this.text_,a);this.text_=a;c-=d;a=a.substring(d);if(0<c||0<a.length)d=
+this.currentTextBefore_.substring(0,this.currentTextBefore_.length-c),0<c&&this.pendingTextsBefore_.push(d),0<a.length&&this.pendingTextsBefore_.push(d+a),this.postImeMessage_({type:"replaceText",contextID:this.inputContext_.contextID,deleteBefore:c,newText:a})}else console.error("Error when backtranslating braille cells")},this));return!0};cvox.BrailleInputHandler.prototype.resetText_=function(){this.cells_.length=0;this.text_="";this.pendingTextsBefore_.length=0;this.updateActiveTranslator_()};
+cvox.BrailleInputHandler.prototype.updateActiveTranslator_=function(){this.activeTranslator_=this.defaultTranslator_;if(this.uncontractedTranslator_){var a=this.currentTextBefore_,b=this.currentTextAfter_;if(this.inAlwaysUncontractedContext_()||0<a.length&&/\S$/.test(a)||0<b.length&&/^\S/.test(b))this.activeTranslator_=this.uncontractedTranslator_}};
+cvox.BrailleInputHandler.prototype.onImeConnect_=function(a){a.name===cvox.BrailleInputHandler.IME_PORT_NAME_&&a.sender.id===cvox.BrailleInputHandler.IME_EXTENSION_ID_&&(this.imePort_&&this.imePort_.disconnect(),a.onDisconnect.addListener(goog.bind(this.onImeDisconnect_,this,a)),a.onMessage.addListener(goog.bind(this.onImeMessage_,this)),this.imePort_=a)};
+cvox.BrailleInputHandler.prototype.onImeMessage_=function(a){goog.isObject(a)||console.error("Unexpected message from Braille IME: ",JSON.stringify(a));switch(a.type){case "activeState":this.imeActive_=a.active;break;case "inputContext":this.inputContext_=a.context;this.resetText_();this.imeActive_&&this.inputContext_&&this.pendingCells_.forEach(goog.bind(this.onBrailleDots_,this));this.pendingCells_.length=0;break;case "brailleDots":this.onBrailleDots_(a.dots);break;case "reset":this.resetText_();
+break;default:console.error("Unexpected message from Braille IME: ",JSON.stringify(a))}};cvox.BrailleInputHandler.prototype.onImeDisconnect_=function(){this.imePort_=null;this.resetText_();this.imeActive_=!1;this.inputContext_=null};cvox.BrailleInputHandler.prototype.postImeMessage_=function(a){return this.imePort_?(this.imePort_.postMessage(a),!0):!1};
+cvox.BrailleInputHandler.prototype.longestCommonPrefixLength_=function(a,b){var c=Math.min(a.length,b.length),d;for(d=0;d<c&&a.charAt(d)==b.charAt(d);++d);return d};cvox.BrailleTable={};cvox.BrailleTable.TABLE_PATH="chromevox/background/braille/tables.json";cvox.BrailleTable.getAll=function(a){var b=chrome.extension.getURL(cvox.BrailleTable.TABLE_PATH);if(!b)throw"Invalid path: "+cvox.BrailleTable.TABLE_PATH;var c=new XMLHttpRequest;c.open("GET",b,!0);c.onreadystatechange=function(){4==c.readyState&&200==c.status&&a(JSON.parse(c.responseText))};c.send()};cvox.BrailleTable.forId=function(a,b){return a.filter(function(a){return a.id===b})[0]||null};
+cvox.BrailleTable.getUncontracted=function(a,b){function c(a,b){return"6"===a.dots&&"8"===b.dots&&0==a.locale.lastIndexOf(b.locale,0)||a.locale===b.locale&&a.dots===b.dots&&goog.isDef(a.grade)&&goog.isDef(b.grade)&&b.grade<a.grade?b:a}return a.reduce(c,b)};cvox.BrailleBackground=function(a,b){this.displayManager_=a||new cvox.BrailleDisplayManager;cvox.BrailleTable.getAll(goog.bind(function(a){this.tables_=a;this.initialize_(0)},this));this.displayManager_.setCommandListener(goog.bind(this.onBrailleKeyEvent_,this));this.lastContentId_=this.lastContent_=null;this.inputHandler_=b||new cvox.BrailleInputHandler;this.inputHandler_.init()};goog.inherits(cvox.BrailleBackground,cvox.AbstractBraille);
+cvox.BrailleBackground.prototype.write=function(a){this.lastContent_=this.lastContentId_=null;this.inputHandler_.onDisplayContentChanged(a.text);this.displayManager_.setContent(a,this.inputHandler_.getExpansionType())};cvox.BrailleBackground.prototype.setCommandListener=function(){};
cvox.BrailleBackground.prototype.refreshTranslator=function(){if(this.liblouis_){var a=this.tables_,b=cvox.BrailleTable.forId(a,localStorage.brailleTable);if(!b){var c=chrome.i18n.getMessage("@@ui_locale").split(/[_-]/),d=c[0],e=c[1],c=a.filter(function(a){return a.locale.split(/[_-]/)[0]==d});0<c.length&&(b=c[0],e&&(c=c.filter(function(a){return a.locale.split(/[_-]/)[1]==e}),0<c.length&&(b=c[0])))}b||(b=cvox.BrailleTable.forId(a,"en-US-comp8"));localStorage.brailleTable=b.id;"6"==b.dots?(localStorage.brailleTableType=
-"brailleTable6",localStorage.brailleTable6=b.id):(localStorage.brailleTableType="brailleTable8",localStorage.brailleTable8=b.id);localStorage.brailleTable6||(localStorage.brailleTable6="en-US-g1");localStorage.brailleTable8||(localStorage.brailleTable8="en-US-comp8");var c=cvox.BrailleTable.forId(a,localStorage.brailleTable8),f=cvox.BrailleTable.getUncontracted(a,c?c:b);this.liblouis_.getTranslator(b.fileName,goog.bind(function(a){f.id===b.id?this.displayManager_.setTranslator(a):this.liblouis_.getTranslator(f.fileName,
-goog.bind(function(b){this.displayManager_.setTranslator(a,b)},this))},this))}};
+"brailleTable6",localStorage.brailleTable6=b.id):(localStorage.brailleTableType="brailleTable8",localStorage.brailleTable8=b.id);localStorage.brailleTable6||(localStorage.brailleTable6="en-US-g1");localStorage.brailleTable8||(localStorage.brailleTable8="en-US-comp8");var c=cvox.BrailleTable.forId(a,localStorage.brailleTable8),f=cvox.BrailleTable.getUncontracted(a,c?c:b);this.liblouis_.getTranslator(b.fileName,goog.bind(function(a){f.id===b.id?(this.displayManager_.setTranslator(a),this.inputHandler_.setTranslator(a)):
+this.liblouis_.getTranslator(f.fileName,goog.bind(function(b){this.displayManager_.setTranslator(a,b);this.inputHandler_.setTranslator(a,b)},this))},this))}};
cvox.BrailleBackground.prototype.initialize_=function(a){5<a?console.error("Timeout waiting for document.body; not initializing braille."):document.body?(this.liblouis_=new cvox.LibLouis(chrome.extension.getURL("chromevox/background/braille/liblouis_nacl.nmf"),chrome.extension.getURL("chromevox/background/braille/tables")),this.liblouis_.attachToElement(document.body),this.refreshTranslator()):window.setTimeout(goog.bind(this.initialize_,this,++a),500)};
-cvox.BrailleBackground.prototype.sendCommand_=function(a,b){var c={message:"BRAILLE",args:a};b===this.lastContent_&&(c.contentId=this.lastContentId_);cvox.ExtensionBridge.send(c)};cvox.AbstractHost=function(){};cvox.AbstractHost.State={ACTIVE:0,INACTIVE:1,KILLED:2};cvox.AbstractHost.prototype.init=function(){};cvox.AbstractHost.prototype.sendToBackgroundPage=function(){};cvox.AbstractHost.prototype.getApiSrc=function(){return""};cvox.AbstractHost.prototype.getFileSrc=function(){return""};cvox.AbstractHost.prototype.hasTtsCallback=function(){return!0};cvox.AbstractHost.prototype.mustRedispatchClickEvent=function(){return!1};
+cvox.BrailleBackground.prototype.onBrailleKeyEvent_=function(a,b){this.inputHandler_.onBrailleKeyEvent(a)||this.sendCommand_(a,b)};cvox.BrailleBackground.prototype.sendCommand_=function(a,b){var c={message:"BRAILLE",args:a};b===this.lastContent_&&(c.contentId=this.lastContentId_);cvox.ExtensionBridge.send(c)};cvox.AbstractHost=function(){};cvox.AbstractHost.State={ACTIVE:0,INACTIVE:1,KILLED:2};cvox.AbstractHost.prototype.init=function(){};cvox.AbstractHost.prototype.sendToBackgroundPage=function(){};cvox.AbstractHost.prototype.getApiSrc=function(){return""};cvox.AbstractHost.prototype.getFileSrc=function(){return""};cvox.AbstractHost.prototype.hasTtsCallback=function(){return!0};cvox.AbstractHost.prototype.mustRedispatchClickEvent=function(){return!1};
cvox.AbstractHost.prototype.activateOrDeactivateChromeVox=function(a){this.onStateChanged_(a?cvox.AbstractHost.State.ACTIVE:cvox.AbstractHost.State.INACTIVE)};
cvox.AbstractHost.prototype.onStateChanged_=function(a){var b=a==cvox.AbstractHost.State.ACTIVE;if(b!=cvox.ChromeVox.isActive)switch(cvox.ChromeVoxEventWatcher.cleanup(window),a){case cvox.AbstractHost.State.ACTIVE:cvox.ChromeVox.isActive=!0;cvox.ChromeVox.navigationManager.showOrHideIndicator(!0);cvox.ChromeVoxEventWatcher.init(window);document.activeElement?(a=document.hasFocus()&&!document.webkitHidden,cvox.ApiImplementation.syncToNode(document.activeElement,a)):cvox.ChromeVox.navigationManager.updateIndicator();
break;case cvox.AbstractHost.State.INACTIVE:cvox.ChromeVox.isActive=!1;cvox.ChromeVox.navigationManager.showOrHideIndicator(!1);cvox.ChromeVoxEventWatcher.init(window);break;case cvox.AbstractHost.State.KILLED:cvox.ChromeVox.isActive=!1,cvox.ChromeVox.navigationManager.showOrHideIndicator(!1)}};cvox.MathJaxInterface=function(){};cvox.MathJaxInterface.prototype.getAllJax=function(){};cvox.AbstractMathJax=function(){};cvox.AbstractMsgs=function(){};cvox.AbstractMsgs.prototype.getMsg=function(){};cvox.AbstractMsgs.prototype.getNumber=function(){};cvox.HostFactory=function(){};cvox.HostFactory.getHost=function(){return new cvox.HostFactory.hostConstructor};cvox.HostFactory.getTts=function(){return new cvox.HostFactory.ttsConstructor};cvox.HostFactory.getBraille=function(){return new cvox.HostFactory.brailleConstructor};cvox.HostFactory.getMsgs=function(){return new cvox.HostFactory.msgsConstructor};cvox.HostFactory.getEarcons=function(){return new cvox.HostFactory.earconsConstructor};cvox.HostFactory.getMathJax=function(){return new cvox.HostFactory.mathJaxConstructor};cvox.ChromeEarcons=function(){cvox.AbstractEarcons.call(this)};goog.inherits(cvox.ChromeEarcons,cvox.AbstractEarcons);cvox.ChromeEarcons.prototype.playEarcon=function(a){cvox.ChromeEarcons.superClass_.playEarcon.call(this,a);this.enabled&&cvox.ExtensionBridge.send({target:"EARCON",action:"play",earcon:a})};
@@ -1037,10 +1054,9 @@ cvox.SpokenMessages.speak=function(a){for(var b=0;b<cvox.SpokenMessages.messages
c.id);cvox.ChromeVox.tts.speak(d,a,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);a=cvox.AbstractTts.QUEUE_MODE_QUEUE}cvox.SpokenMessages.messages=[]};cvox.SpokenMessages.currentMessage=function(){if(0==cvox.SpokenMessages.messages.length)throw"Invalid usage of SpokenMessages; start the chain using $m()";return cvox.SpokenMessages.messages[cvox.SpokenMessages.messages.length-1]};cvox.SpokenMessages.withCount=function(a){cvox.SpokenMessages.currentMessage().count=a;return cvox.SpokenMessages};
cvox.SpokenMessages.andIndexTotal=function(a,b){var c=new cvox.SpokenMessage;c.raw=cvox.ChromeVox.msgs.getMsg("index_total",[a,b]);cvox.SpokenMessages.messages.push(c);return cvox.SpokenMessages};cvox.SpokenMessages.andEnd=function(){return cvox.SpokenMessages.andMessage("end")};cvox.SpokenMessages.andMessage=function(a){var b=new cvox.SpokenMessage;b.id="string"==typeof a?[a]:a;cvox.SpokenMessages.messages.push(b);return cvox.SpokenMessages};
cvox.SpokenMessages.andRawMessage=function(a){var b=new cvox.SpokenMessage;b.raw=a;cvox.SpokenMessages.messages.push(b);return cvox.SpokenMessages};cvox.SpokenMessages.andPause=function(){return cvox.SpokenMessages.andMessage("pause")};cvox.$m=cvox.SpokenMessages.andMessage;cvox.Widget=function(){this.active=!1;this.initialNode=null;cvox.Widget.ref_&&cvox.Widget.ref_.isActive()||(cvox.Widget.ref_=this)};cvox.Widget.prototype.isActive=function(){return this.active};
-cvox.Widget.prototype.show=function(){this.isActive()&&this.hide(!0);this.onKeyDown=goog.bind(this.onKeyDown,this);this.onKeyPress=goog.bind(this.onKeyPress,this);window.addEventListener("keydown",this.onKeyDown,!0);window.addEventListener("keypress",this.onKeyPress,!0);this.initialNode=cvox.ChromeVox.navigationManager.getCurrentNode();this.isStickyOn=cvox.ChromeVox.isStickyOn;cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!1,announce:!1});this.getNameMsg()&&
-this.getHelpMsg()&&cvox.$m(this.getNameMsg()).andPause().andMessage(this.getHelpMsg()).speakFlush();cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN);this.active=!0};
-cvox.Widget.prototype.hide=function(a){window.removeEventListener("keypress",this.onKeyPress,!0);window.removeEventListener("keydown",this.onKeyDown,!0);cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:this.isStickyOn,announce:!1});cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE);a||(this.initialNode=1==this.initialNode.nodeType?this.initialNode:this.initialNode.parentNode,cvox.ApiImplementation.syncToNode(this.initialNode,!0,cvox.AbstractTts.QUEUE_MODE_QUEUE));
-this.active=!1};cvox.Widget.prototype.toggle=function(){this.isActive()?this.hide():this.show()};cvox.Widget.prototype.onKeyDown=function(a){if(27==a.keyCode)return this.hide(),a.preventDefault(),!0;if(9==a.keyCode)return this.hide(),!0;17==a.keyCode&&cvox.ChromeVox.tts.stop();a.stopPropagation();return!0};cvox.Widget.prototype.onKeyPress=function(){return!1};cvox.Widget.isActive=function(){return cvox.Widget.ref_&&cvox.Widget.ref_.isActive()||!1};cvox.NavDescription=function(a){this.context=a.context?a.context:"";this.text=a.text?a.text:"";this.userValue=a.userValue?a.userValue:"";this.annotation=a.annotation?a.annotation:"";this.earcons=a.earcons?a.earcons:[];this.personality=a.personality;this.hint=a.hint?a.hint:""};cvox.NavDescription.prototype.isEmpty=function(){return 0==this.context.length&&0==this.earcons.length&&0==this.text.length&&0==this.userValue.length&&0==this.annotation.length};
+cvox.Widget.prototype.show=function(){this.isActive()&&this.hide(!0);this.onKeyDown=goog.bind(this.onKeyDown,this);this.onKeyPress=goog.bind(this.onKeyPress,this);window.addEventListener("keydown",this.onKeyDown,!0);window.addEventListener("keypress",this.onKeyPress,!0);this.initialNode=cvox.ChromeVox.navigationManager.getCurrentNode();cvox.ChromeVox.stickyOverride=!1;this.getNameMsg()&&this.getHelpMsg()&&cvox.$m(this.getNameMsg()).andPause().andMessage(this.getHelpMsg()).speakFlush();cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN);
+this.active=!0};cvox.Widget.prototype.hide=function(a){window.removeEventListener("keypress",this.onKeyPress,!0);window.removeEventListener("keydown",this.onKeyDown,!0);cvox.ChromeVox.stickyOverride=null;cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE);a||(this.initialNode=1==this.initialNode.nodeType?this.initialNode:this.initialNode.parentNode,cvox.ApiImplementation.syncToNode(this.initialNode,!0,cvox.AbstractTts.QUEUE_MODE_QUEUE));this.active=!1};
+cvox.Widget.prototype.toggle=function(){this.isActive()?this.hide():this.show()};cvox.Widget.prototype.onKeyDown=function(a){if(27==a.keyCode)return this.hide(),a.preventDefault(),!0;if(9==a.keyCode)return this.hide(),!0;17==a.keyCode&&cvox.ChromeVox.tts.stop();a.stopPropagation();return!0};cvox.Widget.prototype.onKeyPress=function(){return!1};cvox.Widget.isActive=function(){return cvox.Widget.ref_&&cvox.Widget.ref_.isActive()||!1};cvox.NavDescription=function(a){this.context=a.context?a.context:"";this.text=a.text?a.text:"";this.userValue=a.userValue?a.userValue:"";this.annotation=a.annotation?a.annotation:"";this.earcons=a.earcons?a.earcons:[];this.personality=a.personality;this.hint=a.hint?a.hint:""};cvox.NavDescription.prototype.isEmpty=function(){return 0==this.context.length&&0==this.earcons.length&&0==this.text.length&&0==this.userValue.length&&0==this.annotation.length};
cvox.NavDescription.prototype.toString=function(){return'NavDescription(context="'+this.context+'" text="'+this.text+'" userValue="'+this.userValue+'" annotation="'+this.annotation+'")'};cvox.NavDescription.prototype.pushEarcon=function(a){this.earcons.push(a)};
cvox.NavDescription.prototype.speak=function(a,b,c){function d(){var a={},b=cvox.AbstractTts.PERSONALITY_ANNOTATION,c;for(c in b)a[c]=b[c];return a}var e=[];this.context&&(e.push([this.context,a,d()]),a=1);e.push([this.text,a,this.personality?this.personality:{}]);a=1;this.userValue&&e.push([this.userValue,a,{}]);this.annotation&&e.push([this.annotation,a,d()]);this.hint&&e.push([this.hint,a,d()]);a=e.length;for(var f=0;f<a;f++)0==f&&b&&(e[f][2].startCallback=b),f==a-1&&c&&(e[f][2].endCallback=c),
cvox.ChromeVox.tts.speak.apply(cvox.ChromeVox.tts,e[f])};cvox.NavDescription.prototype.equals=function(a){return this.context==a.context&&this.text==a.text&&this.userValue==a.userValue&&this.annotation==a.annotation};cvox.NavMathDescription=function(a){cvox.NavDescription.call(this,a);var b=this.personality?this.personality:{},c={};c.domain=a.domain?a.domain:"";c.style=a.style?a.style:"";b.math=c;this.personality=b};goog.inherits(cvox.NavMathDescription,cvox.NavDescription);cvox.SemanticUtil=function(){};cvox.SemanticUtil.objectsToKeys=function(a){a=Array.prototype.slice.call(arguments,0);var b=[];return b.concat.apply(b,a.map(Object.keys))};cvox.SemanticUtil.objectsToValues=function(a){a=Array.prototype.slice.call(arguments,0);var b=[],c=function(a){for(var c in a)b.push(a[c])};a.forEach(c);return b};
@@ -1395,9 +1411,8 @@ cvox.NavigationManager.prototype.speakDescriptionArray=function(a,b,c,d){d&&a.ev
cvox.NavigationManager.prototype.finishNavCommand=function(a,b,c,d){if(this.pageEnd_&&!this.pageEndAnnounced_)this.pageEndAnnounced_=!0,cvox.ChromeVox.tts.stop(),cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.WRAP),cvox.ChromeVox.verbosity===cvox.VERBOSITY_VERBOSE&&(a=cvox.ChromeVox.msgs.getMsg("wrapped_to_top"),this.isReversed()&&(a=cvox.ChromeVox.msgs.getMsg("wrapped_to_bottom")),cvox.ChromeVox.tts.speak(a,cvox.AbstractTts.QUEUE_MODE_QUEUE,cvox.AbstractTts.PERSONALITY_ANNOTATION));else{if(this.enteredShifter_||
this.exitedShifter_)a=cvox.ChromeVox.msgs.getMsg("enter_content_say",[this.shifter_.getName()]);var e=cvox.ChromeVox.navigationManager.getDescription();(b=void 0===b?!0:b)&&this.setFocus();this.updateIndicator();b=c||cvox.AbstractTts.QUEUE_MODE_FLUSH;a&&(cvox.ChromeVox.tts.speak(a,b,cvox.AbstractTts.PERSONALITY_ANNOTATION),b=cvox.AbstractTts.QUEUE_MODE_QUEUE);this.speakDescriptionArray(e,b,d||null);this.getBraille().write();this.updatePosition(this.getCurrentNode())}};
cvox.NavigationManager.prototype.navigate=function(a,b){this.pageEndAnnounced_=!1;if(this.pageEnd_)return this.pageEnd_=!1,this.syncToBeginning(a),!0;if(!this.resolve())return!1;this.ensureNotSubnavigating();void 0!==b&&(b!==this.getGranularity()||0<this.shifterStack_.length)&&(this.setGranularity(b,!0),this.sync());return this.next_(!a)};cvox.NavigationManager.prototype.subnavigate=function(){this.pageEndAnnounced_=!1;this.resolve()&&(this.ensureSubnavigating(),this.next_(!0))};
-cvox.NavigationManager.prototype.skip=function(){if(!this.keepReading_)return!1;cvox.ChromeVox.host.hasTtsCallback()&&(this.skipped_=!0,this.setReversed(!1),this.startCallbackReading_(cvox.AbstractTts.QUEUE_MODE_FLUSH));return!0};
-cvox.NavigationManager.prototype.startReading=function(a){this.keepReading_=!0;cvox.ChromeVox.host.hasTtsCallback()?this.startCallbackReading_(a):this.startNonCallbackReading_(a);this.prevStickyState_=cvox.ChromeVox.isStickyOn;cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!0,announce:!1})};
-cvox.NavigationManager.prototype.stopReading=function(a){this.keepReading_=!1;this.navSpeaker_.stopReading=!0;a&&cvox.ChromeVox.tts.stop();void 0!=this.prevStickyState_&&(cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:this.prevStickyState_,announce:!1}),this.prevStickyState_=void 0)};cvox.NavigationManager.prototype.isReading=function(){return this.keepReading_};
+cvox.NavigationManager.prototype.skip=function(){if(!this.keepReading_)return!1;cvox.ChromeVox.host.hasTtsCallback()&&(this.skipped_=!0,this.setReversed(!1),this.startCallbackReading_(cvox.AbstractTts.QUEUE_MODE_FLUSH));return!0};cvox.NavigationManager.prototype.startReading=function(a){this.keepReading_=!0;cvox.ChromeVox.host.hasTtsCallback()?this.startCallbackReading_(a):this.startNonCallbackReading_(a);cvox.ChromeVox.stickyOverride=!0};
+cvox.NavigationManager.prototype.stopReading=function(a){this.keepReading_=!1;this.navSpeaker_.stopReading=!0;a&&cvox.ChromeVox.tts.stop();cvox.ChromeVox.stickyOverride=null};cvox.NavigationManager.prototype.isReading=function(){return this.keepReading_};
cvox.NavigationManager.prototype.startCallbackReading_=cvox.ChromeVoxEventSuspender.withSuspendedEvents(function(a){this.finishNavCommand("",!0,a,goog.bind(function(){this.next_(!0)&&this.keepReading_&&this.startCallbackReading_(cvox.AbstractTts.QUEUE_MODE_QUEUE)},this))});
cvox.NavigationManager.prototype.startNonCallbackReading_=cvox.ChromeVoxEventSuspender.withSuspendedEvents(function(a){this.keepReading_&&(cvox.ChromeVox.tts.isSpeaking()||(this.finishNavCommand("",!0,a,null),this.next_(!0)||(this.keepReading_=!1)),window.setTimeout(goog.bind(this.startNonCallbackReading_,this),1E3))});
cvox.NavigationManager.prototype.getFullDescription=function(){return this.pageSel_?this.pageSel_.getFullDescription():[cvox.DescriptionUtil.getDescriptionFromAncestors(cvox.DomUtil.getAncestors(this.curSel_.start.node),!0,cvox.ChromeVox.verbosity)]};cvox.NavigationManager.prototype.setFocus=function(a){this.pageSel_||a&&this.curSel_.start.node.constructor==Text||cvox.Focuser.setFocus(this.curSel_.start.node)};cvox.NavigationManager.prototype.getCurrentNode=function(){return this.curSel_.absStart().node};
@@ -1441,8 +1456,7 @@ cvox.NodeSearchWidget.create=function(a,b){return new cvox.NodeSearchWidget(a,b)
cvox.SelectWidget.prototype.show=function(){cvox.SelectWidget.superClass_.show.call(this);var a=document.createElement("div");a.setAttribute("role","menu");for(var b=0,c=null;c=this.selectNode_.options[b];b++){var d=document.createElement("p");d.innerHTML=c.innerHTML;d.id=b;d.setAttribute("role","menuitem");a.appendChild(d)}this.host_.appendChild(a);b=this.selectNode_.selectedIndex;"number"==typeof b&&cvox.ChromeVox.syncToNode(a.children[b],!0)};
cvox.SelectWidget.prototype.hide=function(){var a=document.createEvent("Event");a.initEvent("change",!1,!1);this.selectNode_.dispatchEvent(a);cvox.SelectWidget.superClass_.hide.call(this,!0)};cvox.SelectWidget.prototype.onNavigate=function(){var a=this;cvox.ChromeVoxEventSuspender.withSuspendedEvents(function(){var b=cvox.ChromeVox.navigationManager.getCurrentNode().parentNode.id;a.selectNode_.selectedIndex=b})()};cvox.SelectWidget.prototype.getNameMsg=function(){return["aria_role_menu"]};cvox.FocusUtil=function(){};cvox.FocusUtil.INPUT_TYPE_ACCEPTS_SELECTION_TABLE={hidden:!1,text:!0,search:!0,tel:!0,url:!0,email:!0,password:!0,datetime:!1,date:!1,month:!1,week:!1,time:!1,"datetime-local":!1,number:!1,range:!1,color:!1,checkbox:!1,radio:!1,file:!1,submit:!1,image:!1,reset:!1,button:!1};
cvox.FocusUtil.isFocusInTextInputField=function(){var a=document.activeElement;return a?a.isContentEditable||"textbox"==a.getAttribute("role")?!0:"true"==a.getAttribute("readOnly")?!1:"TEXTAREA"===a.tagName||"SELECT"===a.tagName?!0:"INPUT"===a.tagName?a.hasAttribute("type")?(a=a.getAttribute("type").toLowerCase(),cvox.FocusUtil.INPUT_TYPE_ACCEPTS_SELECTION_TABLE[a]):!0:!1:!1};cvox.ConsoleTts=function(){this.enabled_=!1};goog.addSingletonGetter(cvox.ConsoleTts);cvox.ConsoleTts.prototype.speak=function(a,b,c){if(this.enabled_&&window.console){var d="Speak",d=b==cvox.AbstractTts.QUEUE_MODE_FLUSH?d+" (I)":d+" (Q)",d=d+(' "'+a+'"');window.console.log(d);c&&void 0!=c.startCallback&&window.console.log(" using startCallback");c&&void 0!=c.endCallback&&window.console.log(" using endCallback")}return this};cvox.ConsoleTts.prototype.isSpeaking=function(){return!1};
-cvox.ConsoleTts.prototype.stop=function(){this.enabled_&&window.console.log("Stop")};cvox.ConsoleTts.prototype.increaseOrDecreaseProperty=function(){};cvox.ConsoleTts.prototype.setEnabled=function(a){this.enabled_=a};cvox.ConsoleTts.prototype.getDefaultProperty=function(){};cvox.SpokenListBuilder=function(){this.list_=[]};cvox.SpokenListBuilder.prototype.flush=function(a){this.list_.push([a,cvox.AbstractTts.QUEUE_MODE_FLUSH]);return this};cvox.SpokenListBuilder.prototype.build=function(){return this.list_};cvox.RunnerInterface=function(){};cvox.RunnerInterface.prototype.setFocus=function(){};cvox.AbstractTestCase=function(){};cvox.CompositeTts=function(){this.ttsEngines_=[]};cvox.CompositeTts.prototype.add=function(a){this.ttsEngines_.push(a);return this};cvox.CompositeTts.prototype.speak=function(a,b,c){this.ttsEngines_.forEach(function(d){d.speak(a,b,c)})};cvox.CompositeTts.prototype.isSpeaking=function(){return this.ttsEngines_.some(function(a){return a.isSpeaking()})};cvox.CompositeTts.prototype.stop=function(){this.ttsEngines_.forEach(function(a){a.stop()})};
-cvox.CompositeTts.prototype.increaseOrDecreaseProperty=function(a,b){this.ttsEngines_.forEach(function(c){c.increaseOrDecreaseProperty(a,b)})};cvox.CompositeTts.prototype.getDefaultProperty=function(a){for(var b=0,c;c=this.ttsEngines_[b];b++)if(c=c.getDefaultProperty(a))return c};cvox.TestTts=function(){cvox.AbstractTts.call(this);this.utterances_=[]};goog.inherits(cvox.TestTts,cvox.AbstractTts);cvox.TestTts.prototype.sentinelText_="@@@STOP@@@";cvox.TestTts.prototype.speak=function(a,b,c){this.utterances_.push({text:a,queueMode:b});c&&void 0!=c.endCallback&&(a=this.utterances_.length,this.utterances_[a-1].text!=this.sentinelText_&&c.endCallback())};cvox.HostFactory.ttsConstructor=cvox.TestTts;cvox.AutoRunner=function(){new cvox.TestTts};cvox.AutoRunner.TestSummary=function(a,b,c,d){this.tag=a;this.status=c;this.scope=d};cvox.AutoRunner.PASS="pass";cvox.AutoRunner.FAIL="fail";cvox.AutoRunner.prototype.setFocus=function(a){document.getElementById(a).focus();return this};cvox.ChromeVoxUserCommands={};cvox.ChromeVoxUserCommands.init_=function(){if(!cvox.ChromeVoxUserCommands.commands){cvox.ChromeVoxUserCommands.commands={};for(var a in cvox.CommandStore.CMD_WHITELIST)cvox.ChromeVoxUserCommands.commands[a]=cvox.ChromeVoxUserCommands.createCommand_(a)}};cvox.ChromeVoxUserCommands.wasMouseClicked=!1;cvox.ChromeVoxUserCommands.enableCommandDispatchingToPage=!0;
+cvox.ConsoleTts.prototype.stop=function(){this.enabled_&&window.console.log("Stop")};cvox.ConsoleTts.prototype.increaseOrDecreaseProperty=function(){};cvox.ConsoleTts.prototype.setEnabled=function(a){this.enabled_=a};cvox.ConsoleTts.prototype.getDefaultProperty=function(){};cvox.ChromeVoxUserCommands={};cvox.ChromeVoxUserCommands.init_=function(){if(!cvox.ChromeVoxUserCommands.commands){cvox.ChromeVoxUserCommands.commands={};for(var a in cvox.CommandStore.CMD_WHITELIST)cvox.ChromeVoxUserCommands.commands[a]=cvox.ChromeVoxUserCommands.createCommand_(a)}};cvox.ChromeVoxUserCommands.wasMouseClicked=!1;cvox.ChromeVoxUserCommands.enableCommandDispatchingToPage=!0;
cvox.ChromeVoxUserCommands.handleTabAction_=function(){cvox.ChromeVox.tts.stop();if(!cvox.ChromeVox.navigationManager.resolve(cvox.DomUtil.isFocusable))return cvox.ChromeVox.navigationManager.setFocus(),!1;var a=cvox.ChromeVoxUserCommands.isFocusedOnLinkControl_();if(a)return!0;var b=a=null,b=window.getSelection();cvox.ChromeVoxUserCommands.wasMouseClicked?cvox.ChromeVoxUserCommands.wasMouseClicked=!1:b=null;null==b||null==b.anchorNode||null==b.focusNode?(a=cvox.ChromeVox.navigationManager.getCurrentNode(),
b=cvox.ChromeVox.navigationManager.getCurrentNode()):(a=b.anchorNode,b=b.focusNode);if(null==a||null==b)return!0;if(cvox.DomUtil.isFocusable(a))return a.focus(),!0;if(cvox.DomUtil.isFocusable(b))return b.focus(),!0;if(cvox.DomUtil.isFocusable(a.parentNode))return a.parentNode.focus(),!0;if(cvox.DomUtil.isFocusable(b.parentNode))return b.parentNode.focus(),!0;b=cvox.ChromeVoxUserCommands.createTabDummySpan_();a.parentNode.insertBefore(b,a);b.focus();return!0};
cvox.ChromeVoxUserCommands.isFocusedOnLinkControl_=function(){var a="A";return document.activeElement.tagName==a||cvox.DomUtil.isControl(document.activeElement)?!0:!1};cvox.ChromeVoxUserCommands.removeTabDummySpan=function(){var a=document.getElementById("ChromeVoxTabDummySpan");a&&document.activeElement!=a&&a.parentNode.removeChild(a)};cvox.ChromeVoxUserCommands.createTabDummySpan_=function(){var a=document.createElement("span");a.id="ChromeVoxTabDummySpan";a.tabIndex=-1;return a};
@@ -1464,7 +1478,7 @@ g=cvox.ChromeVox.navigationManager.getCurrentNode();cvox.DomUtil.clickElem(g,!1,
", "+g.toLocaleDateString());break;case "toggleSelection":d=cvox.ChromeVox.navigationManager.togglePageSel();d=cvox.ChromeVox.msgs.getMsg(d?"begin_selection":"end_selection");break;case "startHistoryRecording":cvox.History.getInstance().startRecording();break;case "stopHistoryRecording":cvox.History.getInstance().stopRecording();break;case "enableConsoleTts":cvox.ConsoleTts.getInstance().setEnabled(!0);break;case "toggleBrailleCaptions":cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",
pref:"brailleCaptions",value:!cvox.BrailleOverlayWidget.getInstance().isActive()});break;case "goToFirstCell":case "goToLastCell":case "goToRowFirstCell":case "goToRowLastCell":case "goToColFirstCell":case "goToColLastCell":case "announceHeaders":case "speakTableLocation":case "exitShifterContent":cvox.DomPredicates.tablePredicate(cvox.DomUtil.getAncestors(cvox.ChromeVox.navigationManager.getCurrentNode()))&&cvox.ChromeVox.navigationManager.performAction(b)||(c="not_inside_table");break;case "enterShifter":case "exitShifter":cvox.ChromeVox.navigationManager.performAction(b);
break;case "decreaseTtsRate":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.RATE,!1);break;case "increaseTtsRate":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.RATE,!0);break;case "decreaseTtsPitch":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.PITCH,!1);break;case "increaseTtsPitch":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.PITCH,!0);break;case "decreaseTtsVolume":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.VOLUME,
-!1);break;case "increaseTtsVolume":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.VOLUME,!0);break;case "cyclePunctuationEcho":cvox.ChromeVox.host.sendToBackgroundPage({target:"TTS",action:"cyclePunctuationEcho"});break;case "toggleStickyMode":cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!cvox.ChromeVox.isStickyOn,announce:!0});break;case "toggleKeyPrefix":cvox.ChromeVox.keyPrefixOn=!cvox.ChromeVox.keyPrefixOn;break;case "passThroughMode":cvox.ChromeVox.passThroughMode=
+!1);break;case "increaseTtsVolume":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.VOLUME,!0);break;case "cyclePunctuationEcho":cvox.ChromeVox.host.sendToBackgroundPage({target:"TTS",action:"cyclePunctuationEcho"});break;case "toggleStickyMode":cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!cvox.ChromeVox.isStickyPrefOn,announce:!0});break;case "toggleKeyPrefix":cvox.ChromeVox.keyPrefixOn=!cvox.ChromeVox.keyPrefixOn;break;case "passThroughMode":cvox.ChromeVox.passThroughMode=
!0;cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("pass_through_key"));break;case "toggleSearchWidget":cvox.SearchWidget.getInstance().toggle();break;case "toggleEarcons":d=cvox.ChromeVox.earcons.toggle()?cvox.ChromeVox.msgs.getMsg("earcons_on"):cvox.ChromeVox.msgs.getMsg("earcons_off");break;case "showHeadingsList":case "showLinksList":case "showFormsList":case "showTablesList":case "showLandmarksList":if(!a.nodeList)break;g=cvox.CommandStore.NODE_INFO_MAP[a.nodeList];cvox.NodeSearchWidget.create(g.typeMsg,
cvox.DomPredicates[g.predicate]).show();break;case "openLongDesc":g=cvox.ChromeVox.navigationManager.getCurrentNode();cvox.DomUtil.hasLongDesc(g)?cvox.ChromeVox.host.sendToBackgroundPage({target:"OpenTab",url:g.longDesc}):cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("no_long_desc"),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOTATION);break;case "pauseAllMedia":k=document.getElementsByTagName("VIDEO");for(g=0;h=k[g];g++)h.pause();k=document.getElementsByTagName("AUDIO");
for(g=0;h=k[g];g++)h.pause();break;case "toggleSemantics":cvox.TraverseMath.toggleSemantic()?cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("semantics_on")):cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("semantics_off"));break;case cvox.BrailleKeyCommand.ROUTING:(g=a.content)&&cvox.BrailleUtil.click(g,a.event.displayPosition);break;case cvox.BrailleKeyCommand.PAN_LEFT:case cvox.BrailleKeyCommand.LINE_UP:case cvox.BrailleKeyCommand.PAN_RIGHT:case cvox.BrailleKeyCommand.LINE_DOWN:cvox.ChromeVox.navigationManager.navigate(!1,
@@ -1508,15 +1522,15 @@ cvox.ChromeVoxEventWatcher.setLastFocusedNode_=function(a){cvox.ChromeVoxEventWa
cvox.ChromeVoxEventWatcher.mutationHandler=function(a){if(cvox.ChromeVoxEventSuspender.areEventsSuspended())return!0;cvox.ChromeVox.navigationManager.updateIndicatorIfChanged();cvox.LiveRegions.processMutations(a,function(a,c){var d=new window.Event("LiveRegion");d.navDescriptions=c;d.assertive=a;cvox.ChromeVoxEventWatcher.addEvent(d,!0);return!0})};
cvox.ChromeVoxEventWatcher.mouseClickEventWatcher=function(a){if(a.fromCvox)return!0;if(cvox.ChromeVox.host.mustRedispatchClickEvent())return cvox.ChromeVoxUserCommands.wasMouseClicked=!0,a.stopPropagation(),a.preventDefault(),cvox.Focuser.setFocus(cvox.ChromeVox.navigationManager.getCurrentNode()),cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("element_clicked"),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOTATION),a=cvox.ChromeVox.navigationManager.getCurrentNode(),cvox.DomUtil.clickElem(a,
!1,!0),!1;cvox.ChromeVoxEventWatcher.addEvent(a);return cvox.ChromeVoxUserCommands.wasMouseClicked=!0};
-cvox.ChromeVoxEventWatcher.mouseOverEventWatcher=function(a){if(!cvox.ChromeVoxEventWatcher.focusFollowsMouse||cvox.DomUtil.isDescendantOfNode(cvox.ChromeVoxEventWatcher.announcedMouseOverNode,a.target)||a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode)return!0;cvox.ChromeVoxEventWatcher.pendingMouseOverNode=a.target;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null);if(a.target.tagName&&
-"BODY"==a.target.tagName)return cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.announcedMouseOverNode=null,!0;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=window.setTimeout(function(){cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null;if(a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode){cvox.ChromeVox.navigationManager.stopReading(!0);var b=a.target;cvox.Focuser.setFocus(b);cvox.ApiImplementation.syncToNode(b,!0,cvox.AbstractTts.QUEUE_MODE_FLUSH);cvox.ChromeVoxEventWatcher.announcedMouseOverNode=
-b}},cvox.ChromeVoxEventWatcher.mouseoverDelayMs);return!0};cvox.ChromeVoxEventWatcher.mouseOutEventWatcher=function(a){a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode&&(cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null));return!0};
+cvox.ChromeVoxEventWatcher.mouseOverEventWatcher=function(a){var b="ontouchstart"in window,c=cvox.ChromeVoxEventWatcher.mouseoverDelayMs;if(b)c=0;else if(!cvox.ChromeVoxEventWatcher.focusFollowsMouse)return!0;if(cvox.DomUtil.isDescendantOfNode(cvox.ChromeVoxEventWatcher.announcedMouseOverNode,a.target)||a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode)return!0;cvox.ChromeVoxEventWatcher.pendingMouseOverNode=a.target;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),
+cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null);if(a.target.tagName&&"BODY"==a.target.tagName)return cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.announcedMouseOverNode=null,!0;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=window.setTimeout(function(){cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null;if(a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode){cvox.ChromeVox.navigationManager.stopReading(!0);var b=a.target;cvox.Focuser.setFocus(b);cvox.ApiImplementation.syncToNode(b,
+!0,cvox.AbstractTts.QUEUE_MODE_FLUSH);cvox.ChromeVoxEventWatcher.announcedMouseOverNode=b}},c);return!0};cvox.ChromeVoxEventWatcher.mouseOutEventWatcher=function(a){a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode&&(cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null));return!0};
cvox.ChromeVoxEventWatcher.focusEventWatcher=function(a){cvox.ChromeVoxUserCommands.removeTabDummySpan();cvox.ChromeVoxEventSuspender.areEventsSuspended()?a.target&&a.target.nodeType==Node.ELEMENT_NODE&&cvox.ChromeVoxEventWatcher.setLastFocusedNode_(a.target):cvox.ChromeVoxEventWatcher.addEvent(a);return!0};
cvox.ChromeVoxEventWatcher.focusHandler=function(a){if(a.target&&a.target.hasAttribute&&"true"==a.target.getAttribute("aria-hidden")&&"true"!=a.target.getAttribute("chromevoxignoreariahidden"))cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null),cvox.ChromeVoxEventWatcher.setUpTextHandler();else if(a.target&&a.target!=window){var b=a.target,c=cvox.DomUtil.getSurroundingControl(b);if(c&&c==cvox.ChromeVoxEventWatcher.lastFocusedNode)cvox.ChromeVoxEventWatcher.handleControlChanged(b);else{c?cvox.ChromeVoxEventWatcher.setLastFocusedNode_(c):
cvox.ChromeVoxEventWatcher.setLastFocusedNode_(b);c=cvox.ChromeVoxEventWatcher.queueMode_();if(cvox.ChromeVoxEventWatcher.getInitialVisibility()||cvox.ChromeVoxEventWatcher.handleDialogFocus(b))c=cvox.AbstractTts.QUEUE_MODE_QUEUE;cvox.ChromeVox.navigationManager.clearPageSel(!0)&&(c=cvox.AbstractTts.QUEUE_MODE_QUEUE);cvox.ApiImplementation.syncToNode(b,!document.webkitHidden,c);if(a.target.constructor==HTMLVideoElement||a.target.constructor==HTMLAudioElement)cvox.ChromeVoxEventWatcher.setUpMediaHandler_();
else{if(a.target.hasAttribute)switch(a=a.target.getAttribute("type"),a){case "time":cvox.ChromeVoxEventWatcher.setUpTimeHandler_();return;case "date":case "month":case "week":cvox.ChromeVoxEventWatcher.setUpDateHandler_();return}cvox.ChromeVoxEventWatcher.setUpTextHandler()}}}else cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null)};
cvox.ChromeVoxEventWatcher.blurEventWatcher=function(a){window.setTimeout(function(){document.activeElement||(cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null),cvox.ChromeVoxEventWatcher.addEvent(a))},0);return!0};
-cvox.ChromeVoxEventWatcher.keyDownEventWatcher=function(a){if(cvox.ChromeVox.passThroughMode)return!0;cvox.ChromeVox.isChromeOS&&91==a.keyCode&&(cvox.ChromeVox.searchKeyHeld=!0);a.searchKeyHeld=cvox.ChromeVox.searchKeyHeld&&cvox.ChromeVox.isActive;a.stickyMode=cvox.ChromeVox.isStickyOn&&cvox.ChromeVox.isActive;a.keyPrefix=cvox.ChromeVox.keyPrefixOn&&cvox.ChromeVox.isActive;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVoxEventWatcher.eventToEat=null;if(!cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(a)||
+cvox.ChromeVoxEventWatcher.keyDownEventWatcher=function(a){if(cvox.ChromeVox.passThroughMode)return!0;cvox.ChromeVox.isChromeOS&&91==a.keyCode&&(cvox.ChromeVox.searchKeyHeld=!0);a.searchKeyHeld=cvox.ChromeVox.searchKeyHeld&&cvox.ChromeVox.isActive;a.stickyMode=cvox.ChromeVox.isStickyModeOn()&&cvox.ChromeVox.isActive;a.keyPrefix=cvox.ChromeVox.keyPrefixOn&&cvox.ChromeVox.isActive;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVoxEventWatcher.eventToEat=null;if(!cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(a)||
cvox.ChromeVoxEventWatcher.handleControlAction(a))return a.preventDefault(),a.stopPropagation(),cvox.ChromeVoxEventWatcher.eventToEat=a,!1;cvox.ChromeVoxEventWatcher.addEvent(a);return!0};
cvox.ChromeVoxEventWatcher.keyUpEventWatcher=function(a){91==a.keyCode&&(cvox.ChromeVox.searchKeyHeld=!1);if(cvox.ChromeVox.passThroughMode)return a.ctrlKey||a.altKey||a.metaKey||a.shiftKey||cvox.ChromeVox.searchKeyHeld||(this.secondPassThroughKeyUp_?(this.secondPassThroughKeyUp_=!1,cvox.ChromeVox.passThroughMode=!1):this.secondPassThroughKeyUp_=!0),!0;if(cvox.ChromeVoxEventWatcher.eventToEat&&a.keyCode==cvox.ChromeVoxEventWatcher.eventToEat.keyCode)return a.stopPropagation(),a.preventDefault(),!1;
cvox.ChromeVoxEventWatcher.addEvent(a);return!0};
@@ -1545,7 +1559,7 @@ cvox.ChromeVoxEventWatcherUtil.shouldWaitToProcess=function(a,b,c){a=c-a;b=c-b;r
cvox.ChromeVoxEventWatcher.processQueue_=function(){if(0!=cvox.ChromeVoxEventWatcher.events_.length){var a=cvox.ChromeVoxEventWatcher.events_,b=-1,c=0,d,e;for(e=0;d=a[e];e++)"focus"==d.type&&(b=e,c=d.timeStamp);cvox.ChromeVoxEventWatcher.events_=[];for(e=0;d=a[e];e++){var f=a[e-1]||{};!(e>=b||"LiveRegion"==d.type||"DOMSubtreeModified"==d.type)||"focus"==f.type&&"change"==d.type||cvox.ChromeVoxEventWatcher.events_.push(d)}cvox.ChromeVoxEventWatcher.events_.sort(function(a,b){return"LiveRegion"!=b.type&&
"LiveRegion"==a.type||"DOMSubtreeModified"!=b.type&&"DOMSubtreeModified"==a.type?1:-1});a=(new Date).getTime();if(0<=b&&cvox.ChromeVoxEventWatcherUtil.shouldWaitToProcess(c,cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime,a))window.setTimeout(cvox.ChromeVoxEventWatcher.processQueue_,cvox.ChromeVoxEventWatcher.WAIT_TIME_MS_);else{for(e=0;d=cvox.ChromeVoxEventWatcher.events_[e];e++)cvox.ChromeVoxEventWatcher.handleEvent_(d),cvox.ChromeVoxEventWatcher.processing_=!0;cvox.ChromeVoxEventWatcher.processing_=
!1;cvox.ChromeVoxEventWatcher.events_=[];cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime=-1;cvox.ChromeVoxEventWatcher.queueProcessingScheduled_=!1;cvox.ChromeVoxEventWatcher.maybeCallReadyCallbacks_()}}};
-cvox.ChromeVoxEventWatcher.handleEvent_=function(a){switch(a.type){case "keydown":cvox.ChromeVoxEventWatcher.setUpTextHandler();if(cvox.ChromeVoxEventWatcher.currentTextControl&&(cvox.ChromeVoxEventWatcher.handleTextChanged(!0),(a=cvox.ChromeVoxEventWatcher.currentTextHandler)&&a.lastChangeDescribed))break;cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keyup":cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keypress":cvox.ChromeVoxEventWatcher.setUpTextHandler();
+cvox.ChromeVoxEventWatcher.handleEvent_=function(a){switch(a.type){case "keydown":case "input":cvox.ChromeVoxEventWatcher.setUpTextHandler();if(cvox.ChromeVoxEventWatcher.currentTextControl&&(cvox.ChromeVoxEventWatcher.handleTextChanged(!0),(a=cvox.ChromeVoxEventWatcher.currentTextHandler)&&a.lastChangeDescribed))break;cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keyup":cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keypress":cvox.ChromeVoxEventWatcher.setUpTextHandler();
break;case "click":cvox.ApiImplementation.syncToNode(a.target,!0);break;case "focus":cvox.ChromeVoxEventWatcher.focusHandler(a);break;case "blur":cvox.ChromeVoxEventWatcher.setUpTextHandler();break;case "change":cvox.ChromeVoxEventWatcher.changeHandler(a);break;case "select":cvox.ChromeVoxEventWatcher.setUpTextHandler();break;case "LiveRegion":cvox.ChromeVoxEventWatcher.speakLiveRegion_(a.assertive,a.navDescriptions);break;case "DOMSubtreeModified":cvox.ChromeVoxEventWatcher.subtreeModifiedHandler(a)}};
cvox.ChromeVoxEventWatcher.setUpTimeHandler_=function(){var a=document.activeElement;a&&a.hasAttribute&&"true"==a.getAttribute("aria-hidden")&&"true"!=a.getAttribute("chromevoxignoreariahidden")&&(a=null);cvox.ChromeVoxEventWatcher.currentTimeHandler=a.constructor==HTMLInputElement&&a.type&&"time"==a.type?new cvox.ChromeVoxHTMLTimeWidget(a,cvox.ChromeVox.tts):null;return null!=cvox.ChromeVoxEventWatcher.currentTimeHandler};
cvox.ChromeVoxEventWatcher.setUpMediaHandler_=function(){var a=document.activeElement;a&&a.hasAttribute&&"true"==a.getAttribute("aria-hidden")&&"true"!=a.getAttribute("chromevoxignoreariahidden")&&(a=null);cvox.ChromeVoxEventWatcher.currentMediaHandler=a.constructor==HTMLVideoElement||a.constructor==HTMLAudioElement?new cvox.ChromeVoxHTMLMediaWidget(a,cvox.ChromeVox.tts):null;return null!=cvox.ChromeVoxEventWatcher.currentMediaHandler};
@@ -1590,9 +1604,9 @@ cvox.SearchContextMenu.focusAds=function(){cvox.Search.populateAdResults();0===c
cvox.SearchContextMenu.init=function(){var a=[{desc:"Main Results",cmd:Command.MAIN},{desc:"Search Tools",cmd:Command.TOOLS},{desc:"Ads",cmd:Command.ADS}],b=document.querySelector("body");b.setAttribute("contextMenuActions",JSON.stringify(a));b.addEventListener("ATCustomEvent",cvox.SearchContextMenu.contextMenuHandler,!0);window.addEventListener("keydown",cvox.SearchContextMenu.keyhandler,!0);cvox.Search.init()};cvox.SearchLoader=function(){};cvox.SearchLoader.onReadyStateChange=function(){"complete"===document.readyState&&"www.google.com"===window.location.host&&"/search"===window.location.pathname&&cvox.SearchContextMenu.init()};cvox.SearchLoader.init=function(){if("complete"!==document.readyState)document.onreadystatechange=cvox.SearchLoader.onReadyStateChange;else cvox.SearchLoader.onReadyStateChange()};cvox.ChromeHost=function(){this.gotPrefsAtLeastOnce_=!1};goog.inherits(cvox.ChromeHost,cvox.AbstractHost);
cvox.ChromeHost.prototype.init=function(){var a=this,b=function(b){b.history&&(cvox.ChromeVox.visitedUrls=b.history);b.keyBindings&&cvox.ChromeVoxKbHandler.loadKeyToFunctionsTable(b.keyBindings);if(b.prefs){b=b.prefs;cvox.ChromeVoxEditableTextBase.useIBeamCursor="true"==b.useIBeamCursor;cvox.ChromeVoxEditableTextBase.eventTypingEcho=!0;cvox.ChromeVoxEventWatcher.focusFollowsMouse="true"==b.focusFollowsMouse;cvox.ChromeVox.version=b.version;cvox.ChromeVox.earcons.enabled=JSON.parse(b.earcons);cvox.ChromeVox.typingEcho=
JSON.parse(b.typingEcho);b.position&&(cvox.ChromeVox.position=JSON.parse(b.position));"undefined"!=b.granularity&&cvox.ChromeVox.navigationManager.setGranularity(JSON.parse(b.granularity));a.activateOrDeactivateChromeVox("true"==b.active);a.activateOrDeactivateStickyMode("true"==b.sticky);a.gotPrefsAtLeastOnce_||cvox.InitialSpeech.speak();a.gotPrefsAtLeastOnce_=!0;cvox.ChromeVox.verbosity="false"==b.useVerboseMode?cvox.VERBOSITY_BRIEF:cvox.VERBOSITY_VERBOSE;b.cvoxKey&&(cvox.ChromeVox.modKeyStr=b.cvoxKey);
-var d=b.siteSpecificScriptLoader!=cvox.ApiImplementation.siteSpecificScriptLoader||b.siteSpecificScriptBase!=cvox.ApiImplementation.siteSpecificScriptBase;cvox.ApiImplementation.siteSpecificScriptLoader=b.siteSpecificScriptLoader;cvox.ApiImplementation.siteSpecificScriptBase=b.siteSpecificScriptBase;d&&(d="true"===b.siteSpecificEnhancements?cvox.SearchLoader.init:null,cvox.ApiImplementation.init(d));cvox.BrailleOverlayWidget.getInstance().setActive("true"==b.brailleCaptions)}};cvox.ExtensionBridge.addMessageListener(b);
+var d=b.siteSpecificScriptLoader!=cvox.ApiImplementation.siteSpecificScriptLoader||b.siteSpecificScriptBase!=cvox.ApiImplementation.siteSpecificScriptBase;cvox.ApiImplementation.siteSpecificScriptLoader=b.siteSpecificScriptLoader;cvox.ApiImplementation.siteSpecificScriptBase=b.siteSpecificScriptBase;d&&(d="true"===b.siteSpecificEnhancements?cvox.SearchLoader.init:void 0,cvox.ApiImplementation.init(d));cvox.BrailleOverlayWidget.getInstance().setActive("true"==b.brailleCaptions)}};cvox.ExtensionBridge.addMessageListener(b);
cvox.ExtensionBridge.addMessageListener(function(a){"DOMAINS_STYLES"==a.message&&cvox.TraverseMath.getInstance().addDomainsAndStyles(a.domains,a.styles)});cvox.ExtensionBridge.addMessageListener(function(a){var b=a.message;"USER_COMMAND"==b&&(b=a.command,cvox.ChromeVoxUserCommands.commands[b](a))});cvox.ExtensionBridge.send({target:"Prefs",action:"getPrefs"});cvox.ExtensionBridge.send({target:"Data",action:"getHistory"})};cvox.ChromeHost.prototype.sendToBackgroundPage=function(a){cvox.ExtensionBridge.send(a)};
-cvox.ChromeHost.prototype.getApiSrc=function(){return this.getFileSrc("chromevox/injected/api.js")};cvox.ChromeHost.prototype.getFileSrc=function(a){return window.chrome.extension.getURL(a)};cvox.ChromeHost.prototype.activateOrDeactivateStickyMode=function(a){cvox.ChromeVox.isStickyOn=a};cvox.HostFactory.hostConstructor=cvox.ChromeHost;cvox.ChromeMsgs=function(){};goog.inherits(cvox.ChromeMsgs,cvox.AbstractMsgs);cvox.ChromeMsgs.NAMESPACE_="chromevox_";cvox.ChromeMsgs.prototype.getMsg=function(a,b){var c=chrome.i18n.getMessage(cvox.ChromeMsgs.NAMESPACE_+a,b);if(void 0==c||""==c)throw Error("Invalid ChromeVox message id: "+a);return c};
+cvox.ChromeHost.prototype.getApiSrc=function(){return this.getFileSrc("chromevox/injected/api.js")};cvox.ChromeHost.prototype.getFileSrc=function(a){return window.chrome.extension.getURL(a)};cvox.ChromeHost.prototype.activateOrDeactivateStickyMode=function(a){cvox.ChromeVox.isStickyPrefOn=a};cvox.HostFactory.hostConstructor=cvox.ChromeHost;cvox.ChromeMsgs=function(){};goog.inherits(cvox.ChromeMsgs,cvox.AbstractMsgs);cvox.ChromeMsgs.NAMESPACE_="chromevox_";cvox.ChromeMsgs.prototype.getMsg=function(a,b){var c=chrome.i18n.getMessage(cvox.ChromeMsgs.NAMESPACE_+a,b);if(void 0==c||""==c)throw Error("Invalid ChromeVox message id: "+a);return c};
cvox.ChromeMsgs.prototype.addTranslatedMessagesToDom=function(a){a=a.querySelectorAll(".i18n");for(var b=0;b<a.length;b++){var c=a[b].getAttribute("msgid");if(!c)throw Error("Element has no msgid attribute: "+a[b]);a[b].textContent=this.getMsg(c);a[b].classList.add("i18n-processed")}};cvox.ChromeMsgs.prototype.getNumber=function(a){return""+a};cvox.HostFactory.msgsConstructor=cvox.ChromeMsgs;cvox.ChromeTtsBase=function(){cvox.AbstractTts.call(this);this.propertyDefault.pitch=1;this.propertyMin.pitch=.2;this.propertyMax.pitch=2;this.propertyDefault.rate=1;this.propertyMin.rate=.2;this.propertyMax.rate=5;this.propertyDefault.volume=1;this.propertyMin.volume=.2;this.propertyMax.volume=1};goog.inherits(cvox.ChromeTtsBase,cvox.AbstractTts);cvox.ChromeTts=function(){cvox.ChromeTtsBase.call(this);this.addBridgeListener()};goog.inherits(cvox.ChromeTts,cvox.ChromeTtsBase);cvox.ChromeTts.callId=1;cvox.ChromeTts.functionMap={};cvox.ChromeTts.prototype.speak=function(a,b,c){c||(c={});cvox.ChromeTts.superClass_.speak.call(this,a,b,c);cvox.ExtensionBridge.send(this.createMessageForProperties_(a,b,c))};cvox.ChromeTts.prototype.isSpeaking=function(){cvox.ChromeTts.superClass_.isSpeaking.call(this);return!1};
cvox.ChromeTts.prototype.stop=function(){cvox.ChromeTts.superClass_.stop.call(this);cvox.ExtensionBridge.send({target:"TTS",action:"stop"})};cvox.ChromeTts.prototype.increaseOrDecreaseProperty=function(a,b){cvox.ExtensionBridge.send({target:"TTS",action:"increaseOrDecrease",property:a,increase:b})};cvox.ChromeTts.prototype.addBridgeListener=function(){cvox.ExtensionBridge.addMessageListener(function(a){var b=a.message;"TTS_CALLBACK"==b&&(a=a.id,b=cvox.ChromeTts.functionMap[a],void 0!=b&&(b(),delete cvox.ChromeTts.functionMap[a]))})};
cvox.ChromeTts.prototype.createMessageForProperties_=function(a,b,c){a={target:"TTS",action:"speak",text:a,queueMode:b,properties:c};void 0!=c.startCallback&&(cvox.ChromeTts.functionMap[cvox.ChromeTts.callId]=c.startCallback,a.startCallbackId=cvox.ChromeTts.callId++);void 0!=c.endCallback&&(cvox.ChromeTts.functionMap[cvox.ChromeTts.callId]=c.endCallback,a.endCallbackId=cvox.ChromeTts.callId++);return a};cvox.HostFactory.ttsConstructor=cvox.ChromeTts;cvox.ChromeVoxPrefs=function(){var a=localStorage.lastRunVersion;a||(a="1.16.0");var b=!0;"1.16.0"==a&&(b=!1);localStorage.lastRunVersion=chrome.app.getDetails().version;this.keyMap_=cvox.KeyMap.fromLocalStorage()||cvox.KeyMap.fromDefaults();this.keyMap_.merge(cvox.KeyMap.fromDefaults());localStorage.position="{}";localStorage.sticky=!1;this.init(b)};
@@ -1605,13 +1619,13 @@ cvox.OptionsPage.init=function(){cvox.ChromeVox.msgs=cvox.HostFactory.getMsgs();
cvox.OptionsPage.eventListener,!1);document.addEventListener("click",cvox.OptionsPage.eventListener,!1);document.addEventListener("keydown",cvox.OptionsPage.eventListener,!1);cvox.ExtensionBridge.addMessageListener(function(a){(a.keyBindings||a.prefs)&&cvox.OptionsPage.update()});document.getElementById("selectKeys").addEventListener("click",cvox.OptionsPage.reset,!1);cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.WML)&&(document.getElementById("version").textContent=chrome.app.getDetails().version)};
cvox.OptionsPage.update=function(){var a=cvox.OptionsPage.prefs.getPrefs(),b;for(b in a)for(var c=document.querySelectorAll('*[name="'+b+'"]'),d=0;d<c.length;d++)cvox.OptionsPage.setValue(c[d],a[b])};
cvox.OptionsPage.populateKeyMapSelect=function(){var a=document.getElementById("cvox_keymaps"),b;for(b in cvox.KeyMap.AVAILABLE_MAP_INFO){var c=document.createElement("option");c.id=b;c.className="i18n";c.setAttribute("msgid",b);cvox.OptionsPage.prefs.getPrefs().currentKeyMap==b&&c.setAttribute("selected","");a.appendChild(c)}a.addEventListener("change",cvox.OptionsPage.reset,!0)};
-cvox.OptionsPage.addKeys=function(){var a=document.getElementById("keysContainer"),b=cvox.OptionsPage.prefs.getKeyMap();this.prevTime=(new Date).getTime();this.keyCount=0;a.addEventListener("keypress",goog.bind(function(a){if("cvoxKey"!=a.target.id){this.keyCount++;var b=(new Date).getTime();1E3<b-this.prevTime||2<this.keyCount?("toggleKeyPrefix"==document.activeElement.id?(this.keySequence=new cvox.KeySequence(a,!1),this.keySequence.keys.ctrlKey[0]=!0):this.keySequence=new cvox.KeySequence(a,!0),
-this.keyCount=1):this.keySequence.addKeyEvent(a);var c=cvox.KeyUtil.keySequenceToString(this.keySequence,!0),d=c.replace(/\+/g," "+cvox.ChromeVox.msgs.getMsg("then")+" "),d=d.replace(/>/g," "+cvox.ChromeVox.msgs.getMsg("followed_by")+" "),d=d.replace("Cvox"," "+cvox.ChromeVox.msgs.getMsg("modifier_key")+" ");cvox.OptionsPage.prefs.setKey(document.activeElement.id,this.keySequence)?document.activeElement.value=c:d=cvox.ChromeVox.msgs.getMsg("key_conflict",[d]);chrome.extension.getBackgroundPage().speak(d);
-this.prevTime=b;a.preventDefault();a.stopPropagation()}},cvox.OptionsPage),!0);for(var c=cvox.CommandStore.categories(),d=0;d<c.length;d++)if("braille"!=c[d]){var e=document.createElement("h3");e.className="i18n";e.setAttribute("msgid",c[d]);e.id=c[d];a.appendChild(e);for(var f=cvox.CommandStore.commandsForCategory(c[d]),g=0;g<f.length;g++){var h=f[g],k=b.keyForCommand(h)[0];if("toggleChromeVox"!=h||!cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.CHROMEOS)){e=document.createElement("input");
-e.type="text";e.className="key active-key";e.id=h;k=null!=k?cvox.KeyUtil.keySequenceToString(k,!0):"";e.value=k;if("toggleStickyMode"==h||"stopSpeech"==h)e.disabled=!0;(k=cvox.CommandStore.messageForCommand(h))||(k=h);h=document.createElement("label");h.className="i18n";h.setAttribute("msgid",k);h.setAttribute("for",e.id);k=document.createElement("div");k.className="key-container";a.appendChild(k);k.appendChild(e);k.appendChild(h)}}e=document.createElement("br");a.appendChild(e)}null==document.getElementById("cvoxKey")&&
+cvox.OptionsPage.addKeys=function(){var a=document.getElementById("keysContainer"),b=cvox.OptionsPage.prefs.getKeyMap();cvox.OptionsPage.prevTime=(new Date).getTime();cvox.OptionsPage.keyCount=0;a.addEventListener("keypress",goog.bind(function(a){if("cvoxKey"!=a.target.id){this.keyCount++;var b=(new Date).getTime();1E3<b-this.prevTime||2<this.keyCount?("toggleKeyPrefix"==document.activeElement.id?(this.keySequence=new cvox.KeySequence(a,!1),this.keySequence.keys.ctrlKey[0]=!0):this.keySequence=new cvox.KeySequence(a,
+!0),this.keyCount=1):this.keySequence.addKeyEvent(a);var c=cvox.KeyUtil.keySequenceToString(this.keySequence,!0),d=c.replace(/\+/g," "+cvox.ChromeVox.msgs.getMsg("then")+" "),d=d.replace(/>/g," "+cvox.ChromeVox.msgs.getMsg("followed_by")+" "),d=d.replace("Cvox"," "+cvox.ChromeVox.msgs.getMsg("modifier_key")+" ");cvox.OptionsPage.prefs.setKey(document.activeElement.id,this.keySequence)?document.activeElement.value=c:d=cvox.ChromeVox.msgs.getMsg("key_conflict",[d]);cvox.OptionsPage.speak(d);this.prevTime=
+b;a.preventDefault();a.stopPropagation()}},cvox.OptionsPage),!0);for(var c=cvox.CommandStore.categories(),d=0;d<c.length;d++)if("braille"!=c[d]){var e=document.createElement("h3");e.className="i18n";e.setAttribute("msgid",c[d]);e.id=c[d];a.appendChild(e);for(var f=cvox.CommandStore.commandsForCategory(c[d]),g=0;g<f.length;g++){var h=f[g],k=b.keyForCommand(h)[0];if("toggleChromeVox"!=h||!cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.CHROMEOS)){e=document.createElement("input");e.type="text";
+e.className="key active-key";e.id=h;k=null!=k?cvox.KeyUtil.keySequenceToString(k,!0):"";e.value=k;if("toggleStickyMode"==h||"stopSpeech"==h)e.disabled=!0;(k=cvox.CommandStore.messageForCommand(h))||(k=h);h=document.createElement("label");h.className="i18n";h.setAttribute("msgid",k);h.setAttribute("for",e.id);k=document.createElement("div");k.className="key-container";a.appendChild(k);k.appendChild(e);k.appendChild(h)}}e=document.createElement("br");a.appendChild(e)}null==document.getElementById("cvoxKey")&&
(e=document.createElement("input"),e.type="text",e.className="key",e.id="cvoxKey",h=document.createElement("label"),h.className="i18n",h.setAttribute("msgid","options_cvox_modifier_key"),h.setAttribute("for","cvoxKey"),a=document.getElementById("modifier_keys").nextSibling,b=a.parentNode,b.insertBefore(h,a),b.insertBefore(e,h),a=document.getElementById("cvoxKey"),a.value=localStorage.cvoxKey,a.addEventListener("keydown",function(a){this.modifierSeq_?this.modifierSeq_.addKeyEvent(a):(this.modifierCount_=
-0,this.modifierSeq_=new cvox.KeySequence(a,!1));this.modifierSeq_.isAnyModifierActive()?this.modifierCount_++:(9!=a.keyCode&&chrome.extension.getBackgroundPage().speak(cvox.ChromeVox.msgs.getMsg("modifier_entry_error"),0,{}),this.modifierSeq_=null);a.shiftKey||9==a.keyCode||(a.preventDefault(),a.stopPropagation())},!0),a.addEventListener("keyup",function(a){if(this.modifierSeq_){this.modifierCount_--;if(0==this.modifierCount_){var b=cvox.KeyUtil.keySequenceToString(this.modifierSeq_,!0,!0);a.target.value=
-b;chrome.extension.getBackgroundPage().speak(cvox.ChromeVox.msgs.getMsg("modifier_entry_set",[b]));localStorage.cvoxKey=b;this.modifierSeq_=null}a.preventDefault();a.stopPropagation()}},!0))};
+0,this.modifierSeq_=new cvox.KeySequence(a,!1));this.modifierSeq_.isAnyModifierActive()?this.modifierCount_++:(9!=a.keyCode&&cvox.OptionsPage.speak(cvox.ChromeVox.msgs.getMsg("modifier_entry_error"),0,{}),this.modifierSeq_=null);a.shiftKey||9==a.keyCode||(a.preventDefault(),a.stopPropagation())},!0),a.addEventListener("keyup",function(a){if(this.modifierSeq_){this.modifierCount_--;if(0==this.modifierCount_){var b=cvox.KeyUtil.keySequenceToString(this.modifierSeq_,!0,!0);a.target.value=b;cvox.OptionsPage.speak(cvox.ChromeVox.msgs.getMsg("modifier_entry_set",
+[b]));localStorage.cvoxKey=b;this.modifierSeq_=null}a.preventDefault();a.stopPropagation()}},!0))};
cvox.OptionsPage.populateVoicesSelect=function(){var a=document.getElementById("voices");chrome.tts.getVoices(function(b){b.forEach(function(b){var d=document.createElement("option");d.voiceName=b.voiceName||"";d.innerText=d.voiceName;localStorage.voiceName==b.voiceName&&d.setAttribute("selected","");a.add(d)})});a.addEventListener("change",function(){var b=a.selectedIndex,b=a.options[b];localStorage.voiceName=b.voiceName},!0)};
cvox.OptionsPage.populateBrailleTablesSelect=function(){if(cvox.ChromeVox.isChromeOS){var a=cvox.OptionsPage.brailleTables,b=JSON.parse(cvox.ChromeVox.msgs.getMsg("locale_dict")),c=function(c,d){for(var e=[],f=localStorage[c.id]||localStorage.brailleTable,g=0,q;q=a[g];g++)if(q.dots===d){var m=document.createElement("option");m.id=q.id;e[q.locale]||(e[q.locale]=0);e[q.locale]++;var s=q.grade;m.textContent=s?cvox.ChromeVox.msgs.getMsg("options_braille_locale_grade",[b[q.locale],s]):b[q.locale];q.id==
f&&m.setAttribute("selected","");c.appendChild(m)}},d=document.getElementById("brailleTable6"),e=document.getElementById("brailleTable8");c(d,"6");c(e,"8");c=function(a){return function(){var b=a.selectedIndex,b=a.options[b];localStorage.brailleTable=b.id;localStorage[a.id]=b.id;b=chrome.extension.getBackgroundPage().braille;b.refreshTranslator()}};d.addEventListener("change",c(d),!0);e.addEventListener("change",c(e),!0);var f=document.getElementById("brailleTableType"),g=function(a){var b=localStorage.brailleTableType||
@@ -1621,4 +1635,4 @@ cvox.OptionsPage.setValue=function(a,b){"INPUT"==a.tagName&&"checkbox"==a.type?a
cvox.OptionsPage.eventListener=function(a){window.setTimeout(function(){var b=a.target;if(b.classList.contains("pref"))if("INPUT"==b.tagName&&"checkbox"==b.type)cvox.OptionsPage.prefs.setPref(b.name,b.checked);else{if("INPUT"==b.tagName&&"radio"==b.type)for(var c=b.name,c=document.querySelectorAll('*[name="'+c+'"]'),d=0;d<c.length;d++)c[d].checked&&cvox.OptionsPage.prefs.setPref(b.name,c[d].value)}else b.classList.contains("key")&&(c=cvox.KeySequence.fromStr(b.value),"cvoxKey"==b.id?(cvox.OptionsPage.prefs.setPref(b.id,
b.value),cvox.OptionsPage.prefs.sendPrefsToAllTabs(!0,!0)):cvox.OptionsPage.prefs.setKey(b.id,c))},0);return!0};
cvox.OptionsPage.reset=function(){var a=document.getElementById("cvox_keymaps"),a=a.options[a.selectedIndex].id,b=cvox.ChromeVox.msgs,b=cvox.OptionsPage.prefs.getPrefs().currentKeyMap==a?b.getMsg("keymap_reset",[b.getMsg(a)]):b.getMsg("keymap_switch",[b.getMsg(a)]);cvox.OptionsPage.updateStatus_(b);cvox.OptionsPage.prefs.switchToKeyMap(a);document.getElementById("keysContainer").innerHTML="";cvox.OptionsPage.addKeys();cvox.ChromeVox.msgs.addTranslatedMessagesToDom(document)};
-cvox.OptionsPage.updateStatus_=function(a){document.getElementById("status").innerText=a};cvox.OptionsPage.hidePlatformSpecifics=function(){if(!cvox.ChromeVox.isChromeOS)for(var a=document.body.querySelectorAll(".chromeos"),b=0,c;c=a[b];b++)c.setAttribute("aria-hidden","true"),c.style.display="none"};document.addEventListener("DOMContentLoaded",function(){cvox.OptionsPage.init()},!1);
+cvox.OptionsPage.updateStatus_=function(a){document.getElementById("status").innerText=a};cvox.OptionsPage.hidePlatformSpecifics=function(){if(!cvox.ChromeVox.isChromeOS)for(var a=document.body.querySelectorAll(".chromeos"),b=0,c;c=a[b];b++)c.setAttribute("aria-hidden","true"),c.style.display="none"};cvox.OptionsPage.speak=function(a,b,c){var d=chrome.extension.getBackgroundPage().speak;d.apply(null,arguments)};document.addEventListener("DOMContentLoaded",function(){cvox.OptionsPage.init()},!1);
diff --git a/chrome/third_party/chromevox/chromeVoxChromePageScript.js b/chrome/third_party/chromevox/chromeVoxChromePageScript.js
index cf5289d..e8aae47 100644
--- a/chrome/third_party/chromevox/chromeVoxChromePageScript.js
+++ b/chrome/third_party/chromevox/chromeVoxChromePageScript.js
@@ -1,5 +1,5 @@
var goog=goog||{};goog.global=this;goog.isDef=function(a){return void 0!==a};goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&goog.isDef(b)?c[d]=b:c=c[d]?c[d]:c[d]={}};goog.define=function(a,b){var c=b;goog.exportPath_(a,c)};goog.DEBUG=!1;goog.LOCALE="en";goog.TRUSTED_SITE=!0;goog.STRICT_MODE_COMPATIBLE=!1;goog.provide=function(a){goog.exportPath_(a)};
-goog.setTestOnly=function(a){if(!goog.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+a?": "+a:".");};goog.forwardDeclare=function(){};goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
+goog.setTestOnly=function(a){if(!goog.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+(a?": "+a:"."));};goog.forwardDeclare=function(){};goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
goog.addDependency=function(a,b,c){if(goog.DEPENDENCIES_ENABLED){var d;a=a.replace(/\\/g,"/");for(var e=goog.dependencies_,f=0;d=b[f];f++)e.nameToPath[d]=a,a in e.pathToNames||(e.pathToNames[a]={}),e.pathToNames[a][d]=!0;for(d=0;b=c[d];d++)a in e.requires||(e.requires[a]={}),e.requires[a][b]=!0}};goog.useStrictRequires=!1;goog.ENABLE_DEBUG_LOADER=!0;goog.require=function(){};goog.basePath="";goog.nullFunction=function(){};goog.identityFunction=function(a){return a};
goog.abstractMethod=function(){throw Error("unimplemented abstract method");};goog.addSingletonGetter=function(a){a.getInstance=function(){if(a.instance_)return a.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=a);return a.instance_=new a}};goog.instantiatedSingletons_=[];goog.DEPENDENCIES_ENABLED=!1;
goog.DEPENDENCIES_ENABLED&&(goog.included_={},goog.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}},goog.inHtmlDocument_=function(){var a=goog.global.document;return"undefined"!=typeof a&&"write"in a},goog.findBasePath_=function(){if(goog.global.CLOSURE_BASE_PATH)goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var a=goog.global.document,a=a.getElementsByTagName("script"),b=a.length-1;0<=b;--b){var c=a[b].src,d=c.lastIndexOf("?"),d=-1==d?
@@ -19,7 +19,9 @@ goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=
goog.base=function(a,b,c){var d=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!d)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(d.superClass_)return d.superClass_.constructor.apply(a,Array.prototype.slice.call(arguments,1));for(var e=Array.prototype.slice.call(arguments,2),f=!1,g=a.constructor;g;g=g.superClass_&&g.superClass_.constructor)if(g.prototype[b]===d)f=!0;else if(f)return g.prototype[b].apply(a,
e);if(a[b]===d)return a.constructor.prototype[b].apply(a,e);throw Error("goog.base called from a method of one name to a method of a different name");};goog.scope=function(a){a.call(goog.global)};goog.MODIFY_FUNCTION_PROTOTYPES=!0;
goog.MODIFY_FUNCTION_PROTOTYPES&&(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 goog.bind.apply(null,c)}return goog.bind(this,a)},Function.prototype.partial=function(a){var b=Array.prototype.slice.call(arguments);b.unshift(this,null);return goog.bind.apply(null,b)},Function.prototype.inherits=function(a){goog.inherits(this,a)},Function.prototype.mixin=function(a){goog.mixin(this.prototype,
-a)});goog.object={};goog.object.forEach=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)};goog.object.filter=function(a,b,c){var d={},e;for(e in a)b.call(c,a[e],e,a)&&(d[e]=a[e]);return d};goog.object.map=function(a,b,c){var d={},e;for(e in a)d[e]=b.call(c,a[e],e,a);return d};goog.object.some=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return!0;return!1};goog.object.every=function(a,b,c){for(var d in a)if(!b.call(c,a[d],d,a))return!1;return!0};
+a)});goog.defineClass=function(a,b){var c=b.constructor,d=b.statics;if(!c||c==Object.prototype.constructor)throw Error("constructor property is required.");c=goog.defineClass.createSealingConstructor_(c);a&&goog.inherits(c,a);delete b.constructor;delete b.statics;goog.defineClass.applyProperties_(c.prototype,b);null!=d&&(d instanceof Function?d(c):goog.defineClass.applyProperties_(c,d));return c};goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG;
+goog.defineClass.createSealingConstructor_=function(a){if(goog.defineClass.SEAL_CLASS_INSTANCES&&Object.seal instanceof Function){var b=function(){var c=a.apply(this,arguments)||this;this.constructor===b&&Object.seal(c);return c};return b}return a};goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
+goog.defineClass.applyProperties_=function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);for(var d=0;d<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++)c=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d],Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};goog.object={};goog.object.forEach=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)};goog.object.filter=function(a,b,c){var d={},e;for(e in a)b.call(c,a[e],e,a)&&(d[e]=a[e]);return d};goog.object.map=function(a,b,c){var d={},e;for(e in a)d[e]=b.call(c,a[e],e,a);return d};goog.object.some=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return!0;return!1};goog.object.every=function(a,b,c){for(var d in a)if(!b.call(c,a[d],d,a))return!1;return!0};
goog.object.getCount=function(a){var b=0,c;for(c in a)b++;return b};goog.object.getAnyKey=function(a){for(var b in a)return b};goog.object.getAnyValue=function(a){for(var b in a)return a[b]};goog.object.contains=function(a,b){return goog.object.containsValue(a,b)};goog.object.getValues=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b};goog.object.getKeys=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b};
goog.object.getValueByKeys=function(a,b){for(var c=goog.isArrayLike(b),d=c?b:arguments,c=c?0:1;c<d.length&&(a=a[d[c]],goog.isDef(a));c++);return a};goog.object.containsKey=function(a,b){return b in a};goog.object.containsValue=function(a,b){for(var c in a)if(a[c]==b)return!0;return!1};goog.object.findKey=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return d};goog.object.findValue=function(a,b,c){return(b=goog.object.findKey(a,b,c))&&a[b]};
goog.object.isEmpty=function(a){for(var b in a)return!1;return!0};goog.object.clear=function(a){for(var b in a)delete a[b]};goog.object.remove=function(a,b){var c;(c=b in a)&&delete a[b];return c};goog.object.add=function(a,b,c){if(b in a)throw Error('The object already contains the key "'+b+'"');goog.object.set(a,b,c)};goog.object.get=function(a,b,c){return b in a?a[b]:c};goog.object.set=function(a,b,c){a[b]=c};goog.object.setIfUndefined=function(a,b,c){return b in a?a[b]:a[b]=c};
@@ -46,9 +48,9 @@ cvox.BrailleOverlayWidget.prototype.show_=function(){var a=this.createContainerN
cvox.BrailleOverlayWidget.prototype.hide_=function(){if(this.containerNode_){var a=this.containerNode_;a.style.opacity="0.0";window.setTimeout(function(){document.body.removeChild(a)},1E3);this.brailleNode_=this.contentNode_=this.containerNode_=null}};cvox.BrailleOverlayWidget.prototype.setContent_=function(a,b){this.contentNode_||this.show_();this.contentNode_.textContent=a;this.brailleNode_.textContent=b};
cvox.BrailleOverlayWidget.prototype.createContainerNode_=function(){var a=document.createElement("div");a.id="cvox-braille-overlay";a.style.position="fixed";a.style.top="50%";a.style.left="50%";a.style["-webkit-transition"]="all 0.3s ease-in";a.style.opacity="0.0";a.style["z-index"]="2147483647";a.setAttribute("aria-hidden","true");return a};
cvox.BrailleOverlayWidget.prototype.createOverlayNode_=function(){var a=document.createElement("div");a.style.position="fixed";a.style.left="40px";a.style.bottom="20px";a.style["line-height"]="1.2em";a.style["font-size"]="20px";a.style["font-family"]="monospace";a.style.padding="30px";a.style["min-width"]="150px";a.style.color="#fff";a.style["background-color"]="rgba(0, 0, 0, 0.7)";a.style["border-radius"]="10px";return a};
-cvox.BrailleOverlayWidget.prototype.onMessage_=function(a){"BRAILLE_CAPTION"==a.message&&this.setContent_(a.text,a.brailleChars)};cvox.VERBOSITY_VERBOSE=0;cvox.VERBOSITY_BRIEF=1;cvox.ChromeVox=function(){};cvox.ChromeVox.host=null;cvox.ChromeVox.msgs=null;cvox.ChromeVox.isActive=!0;cvox.ChromeVox.version=null;cvox.ChromeVox.earcons=null;cvox.ChromeVox.navigationManager=null;cvox.ChromeVox.serializer=null;cvox.ChromeVox.isStickyOn=!1;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVox.verbosity=cvox.VERBOSITY_VERBOSE;cvox.ChromeVox.typingEcho=0;cvox.ChromeVox.keyEcho={};cvox.ChromeVox.position={};cvox.ChromeVox.isChromeOS=-1!=navigator.userAgent.indexOf("CrOS");
-cvox.ChromeVox.isMac=-1!=navigator.platform.indexOf("Mac");cvox.ChromeVox.modKeyStr=cvox.ChromeVox.isChromeOS?"Shift+Search":cvox.ChromeVox.isMac?"Ctrl+Cmd":"Shift+Alt";cvox.ChromeVox.sequenceSwitchKeyCodes=[];cvox.ChromeVox.visitedUrls={};cvox.ChromeVox.markInUserCommand=function(){};cvox.ChromeVox.syncToNode=function(){};cvox.ChromeVox.speakNode=function(){};cvox.ChromeVox.executeUserCommand=function(){};cvox.ChromeVox.entireDocumentIsHidden=!1;
-cvox.ChromeVox.storeOn=function(a){a.isStickyOn=cvox.ChromeVox.isStickyOn;cvox.ChromeVox.navigationManager.storeOn(a)};cvox.ChromeVox.readFrom=function(a){cvox.ChromeVox.isStickyOn=a.isStickyOn;cvox.ChromeVox.navigationManager.readFrom(a)};cvox.UserEventDetail=function(a){this.command=this.category="";-1!=cvox.UserEventDetail.JUMP_COMMANDS.indexOf(a.command)&&(this.command=a.command,this.category=cvox.UserEventDetail.Category.JUMP);this.customCommand="";a.customCommand&&(this.customCommand=a.customCommand,this.category=cvox.UserEventDetail.Category.CUSTOM);this.status=cvox.UserEventDetail.Status.PENDING;switch(a.status){case cvox.UserEventDetail.Status.SUCCESS:this.status=cvox.UserEventDetail.Status.SUCCESS;break;case cvox.UserEventDetail.Status.FAILURE:this.status=
+cvox.BrailleOverlayWidget.prototype.onMessage_=function(a){"BRAILLE_CAPTION"==a.message&&this.setContent_(a.text,a.brailleChars)};cvox.VERBOSITY_VERBOSE=0;cvox.VERBOSITY_BRIEF=1;cvox.ChromeVox=function(){};cvox.ChromeVox.host=null;cvox.ChromeVox.msgs=null;cvox.ChromeVox.isActive=!0;cvox.ChromeVox.version=null;cvox.ChromeVox.earcons=null;cvox.ChromeVox.navigationManager=null;cvox.ChromeVox.serializer=null;cvox.ChromeVox.isStickyPrefOn=!1;cvox.ChromeVox.stickyOverride=null;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVox.verbosity=cvox.VERBOSITY_VERBOSE;cvox.ChromeVox.typingEcho=0;cvox.ChromeVox.keyEcho={};
+cvox.ChromeVox.position={};cvox.ChromeVox.isChromeOS=-1!=navigator.userAgent.indexOf("CrOS");cvox.ChromeVox.isMac=-1!=navigator.platform.indexOf("Mac");cvox.ChromeVox.modKeyStr=cvox.ChromeVox.isChromeOS?"Shift+Search":cvox.ChromeVox.isMac?"Ctrl+Cmd":"Shift+Alt";cvox.ChromeVox.sequenceSwitchKeyCodes=[];cvox.ChromeVox.visitedUrls={};cvox.ChromeVox.markInUserCommand=function(){};cvox.ChromeVox.syncToNode=function(){};cvox.ChromeVox.speakNode=function(){};cvox.ChromeVox.executeUserCommand=function(){};
+cvox.ChromeVox.entireDocumentIsHidden=!1;cvox.ChromeVox.storeOn=function(a){a.isStickyPrefOn=cvox.ChromeVox.isStickyPrefOn;cvox.ChromeVox.navigationManager.storeOn(a)};cvox.ChromeVox.readFrom=function(a){cvox.ChromeVox.isStickyPrefOn=a.isStickyPrefOn;cvox.ChromeVox.navigationManager.readFrom(a)};cvox.ChromeVox.isStickyModeOn=function(){return null!==cvox.ChromeVox.stickyOverride?cvox.ChromeVox.stickyOverride:cvox.ChromeVox.isStickyPrefOn};cvox.UserEventDetail=function(a){this.command=this.category="";-1!=cvox.UserEventDetail.JUMP_COMMANDS.indexOf(a.command)&&(this.command=a.command,this.category=cvox.UserEventDetail.Category.JUMP);this.customCommand="";a.customCommand&&(this.customCommand=a.customCommand,this.category=cvox.UserEventDetail.Category.CUSTOM);this.status=cvox.UserEventDetail.Status.PENDING;switch(a.status){case cvox.UserEventDetail.Status.SUCCESS:this.status=cvox.UserEventDetail.Status.SUCCESS;break;case cvox.UserEventDetail.Status.FAILURE:this.status=
cvox.UserEventDetail.Status.FAILURE}this.resultNode=null;a.resultNode&&cvox.DomUtil.isAttachedToDocument(a.resultNode)&&(this.resultNode=a.resultNode)};cvox.UserEventDetail.Category={JUMP:"ATJumpEvent",CUSTOM:"ATCustomEvent"};cvox.UserEventDetail.Status={PENDING:"PENDING",SUCCESS:"SUCCESS",FAILURE:"FAILURE"};cvox.UserEventDetail.JUMP_COMMANDS="nextCheckbox previousCheckbox nextRadio previousRadio nextSlider previousSlider nextGraphic previousGraphic nextButton previousButton nextComboBox previousComboBox nextEditText previousEditText nextHeading previousHeading nextHeading1 previousHeading1 nextHeading2 previousHeading2 nextHeading3 previousHeading3 nextHeading4 previousHeading4 nextHeading5 previousHeading5 nextHeading6 previousHeading6 nextLink previousLink nextMath previousMath nextTable previousTable nextList previousList nextListItem previousListItem nextFormField previousFormField nextLandmark previousLandmark nextSection previousSection nextControl previousControl".split(" ");
cvox.UserEventDetail.prototype.createEventObject=function(){var a=document.createEvent("CustomEvent");a.initCustomEvent(this.category,!0,!0,this);return a};goog.debug={};goog.debug.Error=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.dom={};goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.string={};goog.string.DETECT_DOUBLE_ESCAPING=!1;goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};goog.string.endsWith=function(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))};goog.string.caseInsensitiveEndsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(a.length-b.length,b.length))};
goog.string.caseInsensitiveEquals=function(a,b){return a.toLowerCase()==b.toLowerCase()};goog.string.subs=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")};goog.string.collapseWhitespace=function(a){return a.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};goog.string.isEmpty=function(a){return/^[\s\xa0]*$/.test(a)};goog.string.isEmptySafe=function(a){return goog.string.isEmpty(goog.string.makeSafe(a))};
@@ -733,10 +735,11 @@ d++;if(b&&c){for(var d=a,e=0;d&&!cvox.DomUtil.isDescendantOfNode(b,d);)d=d.paren
cvox.DomUtil.getValue=function(a){var b=cvox.AriaUtil.getActiveDescendant(a);if(b)return cvox.DomUtil.collapseWhitespace(cvox.DomUtil.getValue(b)+" "+cvox.DomUtil.getName(b));if(a.constructor==HTMLSelectElement){var b="",c=a.selectedOptions?a.selectedOptions[0]:null;a=a.selectedOptions?a.selectedOptions[a.selectedOptions.length-1]:null;c&&a&&c!=a?b=cvox.ChromeVox.msgs.getMsg("selected_options_value",[c.text,a.text]):c&&(b=c.text+"");return b}if(a.constructor==HTMLTextAreaElement)return a.value;if(a.constructor==
HTMLInputElement)switch(a.type){case "hidden":case "image":case "submit":case "reset":case "button":case "checkbox":case "radio":return"";case "password":return a.value.replace(/./g,"dot ");default:return a.value}return a.isContentEditable?cvox.DomUtil.getNameFromChildren(a,!0):""};
cvox.DomUtil.getImageTitle=function(a){a.hasAttribute("alt")?a=a.alt:a.hasAttribute("title")?a=a.title:(a=a.src,"data"!=a.substring(0,4)?(a=a.substring(a.lastIndexOf("/")+1,a.lastIndexOf(".")),a=1<=a.length&&16>=a.length?a+" Image":"Image"):a="Image");return a};
+cvox.DomUtil.getLabelledByTargets=function(){if(cvox.labelledByTargets)return cvox.labelledByTargets;for(var a=document.querySelectorAll("[aria-labelledby]"),b={},c=0;c<a.length;++c)for(var d=a[c],d=d.getAttribute("aria-labelledby"),d=d.split(/ +/),e=0;e<d.length;e++)b[d[e]]=!0;cvox.labelledByTargets=b;window.setTimeout(function(){cvox.labelledByTargets=null},0);return b};
cvox.DomUtil.hasContent=function(a){if(8==a.nodeType||cvox.DomUtil.isDescendantOf(a,"HEAD")||cvox.DomUtil.isDescendantOf(a,"SCRIPT")||cvox.DomUtil.isDescendantOf(a,"NOSCRIPT")||cvox.DomUtil.isDescendantOf(a,"NOEMBED")||cvox.DomUtil.isDescendantOf(a,"STYLE")||!cvox.DomUtil.isVisible(a)||cvox.AriaUtil.isHidden(a))return!1;if(cvox.DomUtil.isControl(a)||cvox.DomUtil.isDescendantOf(a,"VIDEO")||cvox.DomUtil.isDescendantOf(a,"AUDIO")||"IFRAME"==a.tagName&&a.src&&0!=a.src.indexOf("javascript:"))return!0;
for(var b="button,input,select,textarea",c=a.parentElement;c&&"LABEL"!=c.tagName;)c=c.parentElement;if(c){var d=c.querySelector(b);if(c.hasAttribute("for")){if(c=c.getAttribute("for"),(c=document.getElementById(c))&&cvox.DomUtil.isControl(c)&&!d)return!1}else if(d)return!1}for(d=a.parentElement;d&&"LEGEND"!=d.tagName;)d=d.parentElement;if(d){for(c=d.parentElement;c&&"FIELDSET"!=c.tagName;)c=c.parentElement;d=c&&c.querySelector(b);if(c&&!d)return!1}if(cvox.DomPredicates.linkPredicate([a])||"TABLE"==
-a.tagName&&!cvox.DomUtil.isLayoutTable(a)||cvox.DomUtil.isMath(a)||cvox.DomPredicates.headingPredicate([a]))return!0;b=cvox.DomUtil.getValue(a)+" "+cvox.DomUtil.getName(a);a=cvox.DomUtil.getState(a,!0);return b.match(/^\s+$/)&&""===a?!1:!0};cvox.DomUtil.getAncestors=function(a){for(var b=[];a;)b.push(a),a=a.parentNode;for(b.reverse();b.length&&!b[0].tagName&&!b[0].nodeValue;)b.shift();return b};
-cvox.DomUtil.compareAncestors=function(a,b){for(var c=0;a[c]&&b[c]&&a[c]==b[c];)c++;a[c]||b[c]||(c=-1);return c};cvox.DomUtil.getUniqueAncestors=function(a,b,c){a=cvox.DomUtil.getAncestors(a);b=cvox.DomUtil.getAncestors(b);a=cvox.DomUtil.compareAncestors(a,b);a=b.slice(a);return 0==a.length&&c?b:a};
+a.tagName&&!cvox.DomUtil.isLayoutTable(a)||cvox.DomUtil.isMath(a)||cvox.DomPredicates.headingPredicate([a])||cvox.DomUtil.isFocusable(a))return!0;b=cvox.DomUtil.getLabelledByTargets();for(d=a;d;){if(d.id&&b[d.id])if(c=d.getAttribute("aria-labelledby")){if(c=c.split(/ +/),-1==c.indexOf(d.id))return!1}else return!1;d=d.parentElement}b=cvox.DomUtil.getValue(a)+" "+cvox.DomUtil.getName(a);a=cvox.DomUtil.getState(a,!0);return b.match(/^\s+$/)&&""===a?!1:!0};
+cvox.DomUtil.getAncestors=function(a){for(var b=[];a;)b.push(a),a=a.parentNode;for(b.reverse();b.length&&!b[0].tagName&&!b[0].nodeValue;)b.shift();return b};cvox.DomUtil.compareAncestors=function(a,b){for(var c=0;a[c]&&b[c]&&a[c]==b[c];)c++;a[c]||b[c]||(c=-1);return c};cvox.DomUtil.getUniqueAncestors=function(a,b,c){a=cvox.DomUtil.getAncestors(a);b=cvox.DomUtil.getAncestors(b);a=cvox.DomUtil.compareAncestors(a,b);a=b.slice(a);return 0==a.length&&c?b:a};
cvox.DomUtil.getRoleMsg=function(a,b){var c;c=cvox.AriaUtil.getRoleNameMsg(a);c||("INPUT"==a.tagName?c=cvox.DomUtil.INPUT_TYPE_TO_INFORMATION_TABLE_MSG[a.type]:"A"==a.tagName&&cvox.DomUtil.isInternalLink(a)?c="internal_link":"A"==a.tagName&&a.getAttribute("name")?c="":a.isContentEditable?c="input_type_text":cvox.DomUtil.isMath(a)?c="math_expr":"TABLE"==a.tagName&&cvox.DomUtil.isLayoutTable(a)?c="":b==cvox.VERBOSITY_BRIEF?c=cvox.DomUtil.TAG_TO_INFORMATION_TABLE_BRIEF_MSG[a.tagName]:(c=cvox.DomUtil.TAG_TO_INFORMATION_TABLE_VERBOSE_MSG[a.tagName],
cvox.DomUtil.hasLongDesc(a)&&(c="image_with_long_desc"),!c&&a.onclick&&(c="clickable")));return c};cvox.DomUtil.getRole=function(a,b){var c=cvox.DomUtil.getRoleMsg(a,b)||"",d=c&&" "!=c?cvox.ChromeVox.msgs.getMsg(c):"";return d?d:c};
cvox.DomUtil.getListLength=function(a){var b=0;for(a=a.firstChild;a;a=a.nextSibling)if(cvox.DomUtil.isVisible(a)&&("LI"==a.tagName||a.getAttribute&&"listitem"==a.getAttribute("role"))){if(a.hasAttribute("aria-setsize")){var c=parseInt(a.getAttribute("aria-setsize"),10);if(!isNaN(c))return c}b++}return b};
@@ -786,10 +789,9 @@ cvox.SpokenMessages.speak=function(a){for(var b=0;b<cvox.SpokenMessages.messages
c.id);cvox.ChromeVox.tts.speak(d,a,cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);a=cvox.AbstractTts.QUEUE_MODE_QUEUE}cvox.SpokenMessages.messages=[]};cvox.SpokenMessages.currentMessage=function(){if(0==cvox.SpokenMessages.messages.length)throw"Invalid usage of SpokenMessages; start the chain using $m()";return cvox.SpokenMessages.messages[cvox.SpokenMessages.messages.length-1]};cvox.SpokenMessages.withCount=function(a){cvox.SpokenMessages.currentMessage().count=a;return cvox.SpokenMessages};
cvox.SpokenMessages.andIndexTotal=function(a,b){var c=new cvox.SpokenMessage;c.raw=cvox.ChromeVox.msgs.getMsg("index_total",[a,b]);cvox.SpokenMessages.messages.push(c);return cvox.SpokenMessages};cvox.SpokenMessages.andEnd=function(){return cvox.SpokenMessages.andMessage("end")};cvox.SpokenMessages.andMessage=function(a){var b=new cvox.SpokenMessage;b.id="string"==typeof a?[a]:a;cvox.SpokenMessages.messages.push(b);return cvox.SpokenMessages};
cvox.SpokenMessages.andRawMessage=function(a){var b=new cvox.SpokenMessage;b.raw=a;cvox.SpokenMessages.messages.push(b);return cvox.SpokenMessages};cvox.SpokenMessages.andPause=function(){return cvox.SpokenMessages.andMessage("pause")};cvox.$m=cvox.SpokenMessages.andMessage;cvox.Widget=function(){this.active=!1;this.initialNode=null;cvox.Widget.ref_&&cvox.Widget.ref_.isActive()||(cvox.Widget.ref_=this)};cvox.Widget.prototype.isActive=function(){return this.active};
-cvox.Widget.prototype.show=function(){this.isActive()&&this.hide(!0);this.onKeyDown=goog.bind(this.onKeyDown,this);this.onKeyPress=goog.bind(this.onKeyPress,this);window.addEventListener("keydown",this.onKeyDown,!0);window.addEventListener("keypress",this.onKeyPress,!0);this.initialNode=cvox.ChromeVox.navigationManager.getCurrentNode();this.isStickyOn=cvox.ChromeVox.isStickyOn;cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!1,announce:!1});this.getNameMsg()&&
-this.getHelpMsg()&&cvox.$m(this.getNameMsg()).andPause().andMessage(this.getHelpMsg()).speakFlush();cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN);this.active=!0};
-cvox.Widget.prototype.hide=function(a){window.removeEventListener("keypress",this.onKeyPress,!0);window.removeEventListener("keydown",this.onKeyDown,!0);cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:this.isStickyOn,announce:!1});cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE);a||(this.initialNode=1==this.initialNode.nodeType?this.initialNode:this.initialNode.parentNode,cvox.ApiImplementation.syncToNode(this.initialNode,!0,cvox.AbstractTts.QUEUE_MODE_QUEUE));
-this.active=!1};cvox.Widget.prototype.toggle=function(){this.isActive()?this.hide():this.show()};cvox.Widget.prototype.onKeyDown=function(a){if(27==a.keyCode)return this.hide(),a.preventDefault(),!0;if(9==a.keyCode)return this.hide(),!0;17==a.keyCode&&cvox.ChromeVox.tts.stop();a.stopPropagation();return!0};cvox.Widget.prototype.onKeyPress=function(){return!1};cvox.Widget.isActive=function(){return cvox.Widget.ref_&&cvox.Widget.ref_.isActive()||!1};cvox.Cursor=function(a,b,c){this.node=a;this.index=b;this.text=c};cvox.Cursor.prototype.clone=function(){return new cvox.Cursor(this.node,this.index,this.text)};cvox.Cursor.prototype.copyFrom=function(a){this.node=a.node;this.index=a.index;this.text=a.text};cvox.Cursor.prototype.equals=function(a){return this.node==a.node&&this.index==a.index&&this.text==a.text};cvox.SelectionUtil=function(){};cvox.SelectionUtil.cleanUpParagraphForward=function(a){for(;3==a.focusNode.nodeType;){var b=a.focusNode,c=a.focusOffset;a.modify("extend","forward","sentence");if(b==a.focusNode&&c==a.focusOffset)return!1}return!0};cvox.SelectionUtil.cleanUpParagraphBack=function(a){for(var b,c;3==a.focusNode.nodeType&&(b=a.focusNode,c=a.focusOffset,a.modify("extend","backward","sentence"),b!=a.focusNode||c!=a.focusOffset););return!0};
+cvox.Widget.prototype.show=function(){this.isActive()&&this.hide(!0);this.onKeyDown=goog.bind(this.onKeyDown,this);this.onKeyPress=goog.bind(this.onKeyPress,this);window.addEventListener("keydown",this.onKeyDown,!0);window.addEventListener("keypress",this.onKeyPress,!0);this.initialNode=cvox.ChromeVox.navigationManager.getCurrentNode();cvox.ChromeVox.stickyOverride=!1;this.getNameMsg()&&this.getHelpMsg()&&cvox.$m(this.getNameMsg()).andPause().andMessage(this.getHelpMsg()).speakFlush();cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_OPEN);
+this.active=!0};cvox.Widget.prototype.hide=function(a){window.removeEventListener("keypress",this.onKeyPress,!0);window.removeEventListener("keydown",this.onKeyDown,!0);cvox.ChromeVox.stickyOverride=null;cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE);a||(this.initialNode=1==this.initialNode.nodeType?this.initialNode:this.initialNode.parentNode,cvox.ApiImplementation.syncToNode(this.initialNode,!0,cvox.AbstractTts.QUEUE_MODE_QUEUE));this.active=!1};
+cvox.Widget.prototype.toggle=function(){this.isActive()?this.hide():this.show()};cvox.Widget.prototype.onKeyDown=function(a){if(27==a.keyCode)return this.hide(),a.preventDefault(),!0;if(9==a.keyCode)return this.hide(),!0;17==a.keyCode&&cvox.ChromeVox.tts.stop();a.stopPropagation();return!0};cvox.Widget.prototype.onKeyPress=function(){return!1};cvox.Widget.isActive=function(){return cvox.Widget.ref_&&cvox.Widget.ref_.isActive()||!1};cvox.Cursor=function(a,b,c){this.node=a;this.index=b;this.text=c};cvox.Cursor.prototype.clone=function(){return new cvox.Cursor(this.node,this.index,this.text)};cvox.Cursor.prototype.copyFrom=function(a){this.node=a.node;this.index=a.index;this.text=a.text};cvox.Cursor.prototype.equals=function(a){return this.node==a.node&&this.index==a.index&&this.text==a.text};cvox.SelectionUtil=function(){};cvox.SelectionUtil.cleanUpParagraphForward=function(a){for(;3==a.focusNode.nodeType;){var b=a.focusNode,c=a.focusOffset;a.modify("extend","forward","sentence");if(b==a.focusNode&&c==a.focusOffset)return!1}return!0};cvox.SelectionUtil.cleanUpParagraphBack=function(a){for(var b,c;3==a.focusNode.nodeType&&(b=a.focusNode,c=a.focusOffset,a.modify("extend","backward","sentence"),b!=a.focusNode||c!=a.focusOffset););return!0};
cvox.SelectionUtil.cleanUpSentence=function(a){for(var b=!0;b;)if(3==a.focusNode.nodeType){var c=a.focusNode,d=a.focusOffset;if(0<a.rangeCount&&0<a.getRangeAt(0).endOffset)if("."==c.substringData(a.getRangeAt(0).endOffset-1,1))break;else if(" "==c.substringData(a.getRangeAt(0).endOffset-1,1))break;else{if(a.modify("extend","forward","sentence"),c==a.focusNode&&d==a.focusOffset)return!1}else break}else break;return!0};
cvox.SelectionUtil.findSelPosition=function(a){if(0==a.rangeCount)return[0,0];var b=a.getRangeAt(0).getBoundingClientRect();if(!b)return[0,0];a=window.pageYOffset+b.top;b=window.pageXOffset+b.left;return[a,b]};cvox.SelectionUtil.findTopLeftPosition=function(a){var b=0,c=0;if(a.offsetParent)for(b=a.offsetLeft,c=a.offsetTop,a=a.offsetParent;null!==a;)b+=a.offsetLeft,c+=a.offsetTop,a=a.offsetParent;return[c,b]};
cvox.SelectionUtil.isSelectionValid=function(a){var b=new RegExp(/^\s+$/);return!(b.test(a.toString())||""==a.toString())};cvox.SelectionUtil.isRangeValid=function(a){a=a.cloneContents().textContent;var b=new RegExp(/^\s+$/);return!(b.test(a)||""==a)};cvox.SelectionUtil.findPos_=function(a){var b=0,c=0;if(a.offsetParent){do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent)}return[b,c]};
@@ -1038,12 +1040,13 @@ cvox.BrailleUtil.TEMPLATE={base:"c n v r s",aria_role_alert:"r: n",aria_role_but
cvox.BrailleUtil.ValueSpan.fromJson=function(a){return new cvox.BrailleUtil.ValueSpan(a.offset)};cvox.BrailleUtil.ValueSpan.prototype.toJson=function(){return this};cvox.Spannable.registerSerializableSpan(cvox.BrailleUtil.ValueSpan,"cvox.BrailleUtil.ValueSpan",cvox.BrailleUtil.ValueSpan.fromJson,cvox.BrailleUtil.ValueSpan.prototype.toJson);cvox.BrailleUtil.ValueSelectionSpan=function(){};cvox.Spannable.registerStatelessSerializableSpan(cvox.BrailleUtil.ValueSelectionSpan,"cvox.BrailleUtil.ValueSelectionSpan");
cvox.BrailleUtil.getName=function(a){return a?cvox.DomUtil.getName(a).trim():""};cvox.BrailleUtil.getRoleMsg=function(a){if(!a)return"";(a=cvox.DomUtil.getRoleMsg(a,cvox.VERBOSITY_VERBOSE))&&(a=cvox.DomUtil.collapseWhitespace(a));a&&0<a.length&&cvox.ChromeVox.msgs.getMsg(a+"_brl")&&(a+="_brl");return a};cvox.BrailleUtil.getRole=function(a){return a?(a=cvox.BrailleUtil.getRoleMsg(a))?cvox.ChromeVox.msgs.getMsg(a):"":""};
cvox.BrailleUtil.getState=function(a){return a?cvox.NodeStateUtil.expand(cvox.DomUtil.getStateMsgs(a,!0).map(function(a){var c=["dummy","dummy","dummy"];cvox.ChromeVox.msgs.getMsg(a[0]+"_brl",c)&&(a[0]+="_brl");return a})):""};cvox.BrailleUtil.getContainer=function(a,b){if(!a||!b)return"";for(var c=cvox.DomUtil.getUniqueAncestors(a,b),d=0,e;e=c[d];d++)if((e=cvox.BrailleUtil.getRoleMsg(e))&&-1!=cvox.BrailleUtil.CONTAINER.indexOf(e))return cvox.ChromeVox.msgs.getMsg(e);return""};
-cvox.BrailleUtil.getValue=function(a){if(!a)return new cvox.Spannable;var b=new cvox.BrailleUtil.ValueSpan(0);if(cvox.DomUtil.isInputTypeText(a)){var c=a.value;"password"===a.type&&(c=c.replace(/./g,"*"));b=new cvox.Spannable(c,b);if(a===document.activeElement&&cvox.DomUtil.doesInputSupportSelection(a)){var d=goog.math.clamp(a.selectionStart,0,b.getLength());a=goog.math.clamp(a.selectionEnd,0,b.getLength());b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a))}return b}if(a instanceof
-HTMLTextAreaElement){d=new cvox.EditableTextAreaShadow;d.update(a);var e=d.getLineIndex(a.selectionEnd),c=d.getLineStart(e),d=d.getLineEnd(e),d=a.value.substring(c,d);b.offset=c;b=new cvox.Spannable(d,b);a===document.activeElement&&(d=goog.math.clamp(a.selectionStart-c,0,b.getLength()),a=goog.math.clamp(a.selectionEnd-c,0,b.getLength()),b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a)));return b}return new cvox.Spannable(cvox.DomUtil.getValue(a),b)};
-cvox.BrailleUtil.getTemplated=function(a,b,c){c=c?c:{};var d=c.roleMsg||(b?cvox.DomUtil.getRoleMsg(b,cvox.VERBOSITY_VERBOSE):""),e=c.role;!e&&c.roleMsg&&(e=cvox.ChromeVox.msgs.getMsg(c.roleMsg+"_brl")||cvox.ChromeVox.msgs.getMsg(c.roleMsg));for(var e=e||cvox.BrailleUtil.getRole(b),d=cvox.BrailleUtil.TEMPLATE[d]||cvox.BrailleUtil.TEMPLATE.base,f=new cvox.Spannable,g=function(d){switch(d){case "n":return c.name||cvox.BrailleUtil.getName(b);case "r":return e;case "s":return c.state||cvox.BrailleUtil.getState(b);
-case "c":return c.container||cvox.BrailleUtil.getContainer(a,b);case "v":return c.value||cvox.BrailleUtil.getValue(b);default:return d}},h=0;h<d.length;h++){var k=g(d[h]);f.append(k);k.toString()||" "!=d[h+1]||h++}return f.trimRight()};cvox.BrailleUtil.createValue=function(a,b,c,d){a=new cvox.Spannable(a,new cvox.BrailleUtil.ValueSpan(d||0));goog.isDef(b)&&(c=goog.isDef(c)?c:b,b>c&&(d=b,b=c,c=d),a.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,b,c));return a};
+cvox.BrailleUtil.getValue=function(a){if(!a)return new cvox.Spannable;var b=new cvox.BrailleUtil.ValueSpan(0);if(cvox.DomUtil.isInputTypeText(a)){var c=a.value;"password"===a.type&&(c=c.replace(/./g,"*"));b=new cvox.Spannable(c,b);if(a===document.activeElement&&cvox.DomUtil.doesInputSupportSelection(a)){var d=cvox.BrailleUtil.clamp_(a.selectionStart,0,b.getLength());a=cvox.BrailleUtil.clamp_(a.selectionEnd,0,b.getLength());b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,
+a))}return b}if(a instanceof HTMLTextAreaElement){d=new cvox.EditableTextAreaShadow;d.update(a);var e=d.getLineIndex(a.selectionEnd),c=d.getLineStart(e),d=d.getLineEnd(e),d=a.value.substring(c,d);b.offset=c;b=new cvox.Spannable(d,b);a===document.activeElement&&(d=cvox.BrailleUtil.clamp_(a.selectionStart-c,0,b.getLength()),a=cvox.BrailleUtil.clamp_(a.selectionEnd-c,0,b.getLength()),b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a)));return b}return new cvox.Spannable(cvox.DomUtil.getValue(a),
+b)};
+cvox.BrailleUtil.getTemplated=function(a,b,c){c=c?c:{};var d=c.roleMsg||(b?cvox.DomUtil.getRoleMsg(b,cvox.VERBOSITY_VERBOSE):""),e=c.role;!e&&c.roleMsg&&(e=cvox.ChromeVox.msgs.getMsg(c.roleMsg+"_brl")||cvox.ChromeVox.msgs.getMsg(c.roleMsg));for(var e=e||cvox.BrailleUtil.getRole(b),d=cvox.BrailleUtil.TEMPLATE[d]||cvox.BrailleUtil.TEMPLATE.base,f=new cvox.Spannable,g=function(d){switch(d){case "n":return c.name||cvox.BrailleUtil.getName(b);case "r":return e;case "s":return c.state||cvox.BrailleUtil.getState(b);case "c":return c.container||
+cvox.BrailleUtil.getContainer(a,b);case "v":return c.value||cvox.BrailleUtil.getValue(b);default:return d}},h=0;h<d.length;h++){var k=g(d[h]);f.append(k);k.toString()||" "!=d[h+1]||h++}return f.trimRight()};cvox.BrailleUtil.createValue=function(a,b,c,d){a=new cvox.Spannable(a,new cvox.BrailleUtil.ValueSpan(d||0));goog.isDef(b)&&(c=goog.isDef(c)?c:b,b>c&&(d=b,b=c,c=d),a.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,b,c));return a};
cvox.BrailleUtil.click=function(a,b){var c=a.text.getSpans(b||0),d=c.filter(function(a){return a instanceof Node})[0];d&&(cvox.Focuser.setFocus(d),goog.isDef(b)&&(cvox.DomUtil.isInputTypeText(d)||d instanceof HTMLTextAreaElement)&&(c=c.filter(function(a){return a instanceof cvox.BrailleUtil.ValueSpan})[0]))&&(c=b-a.text.getSpanStart(c)+c.offset,cvox.ChromeVoxEventWatcher.setUpTextHandler(),d.selectionStart=d.selectionEnd=c,cvox.ChromeVoxEventWatcher.handleTextChanged(!0));cvox.DomUtil.clickElem(d||
-cvox.ChromeVox.navigationManager.getCurrentNode(),!1,!1)};cvox.MathmlStoreUtil={};cvox.MathmlStoreUtil.matchMathjaxToMathml=function(a){var b=cvox.TraverseMath.getInstance().activeMathmlHost;return b.querySelector("#"+a.id)};cvox.MathmlStoreUtil.retrieveMathjaxExtender=function(a){return(a=cvox.MathmlStoreUtil.matchMathjaxToMathml(a))?[a]:[]};cvox.MathmlStoreUtil.retrieveMathjaxLeaf=function(a){return(a=cvox.MathmlStoreUtil.matchMathjaxToMathml(a))?[a]:[]};
+cvox.ChromeVox.navigationManager.getCurrentNode(),!1,!1)};cvox.BrailleUtil.clamp_=function(a,b,c){return Math.min(Math.max(a,b),c)};cvox.MathmlStoreUtil={};cvox.MathmlStoreUtil.matchMathjaxToMathml=function(a){var b=cvox.TraverseMath.getInstance().activeMathmlHost;return b.querySelector("#"+a.id)};cvox.MathmlStoreUtil.retrieveMathjaxExtender=function(a){return(a=cvox.MathmlStoreUtil.matchMathjaxToMathml(a))?[a]:[]};cvox.MathmlStoreUtil.retrieveMathjaxLeaf=function(a){return(a=cvox.MathmlStoreUtil.matchMathjaxToMathml(a))?[a]:[]};
cvox.MathmlStoreUtil.checkMathjaxTag=function(a,b){var c=cvox.MathmlStoreUtil.matchMathjaxToMathml(a);return c&&c.tagName.toUpperCase()==b?[c]:[]};cvox.MathmlStoreUtil.checkMathjaxMunder=function(a){return cvox.MathmlStoreUtil.checkMathjaxTag(a,"MUNDER")};cvox.MathmlStoreUtil.checkMathjaxMover=function(a){return cvox.MathmlStoreUtil.checkMathjaxTag(a,"MOVER")};cvox.MathmlStoreUtil.checkMathjaxMsub=function(a){return cvox.MathmlStoreUtil.checkMathjaxTag(a,"MSUB")};
cvox.MathmlStoreUtil.checkMathjaxMsup=function(a){return cvox.MathmlStoreUtil.checkMathjaxTag(a,"MSUP")};cvox.MathmlStoreUtil.nextSeparatorFunction=function(a){if(a){if(a.match(/^\s+$/))return null;var b=a.replace(/\s/g,"").split("").filter(function(a){return a})}else b=[","];return function(){return 1<b.length?b.shift():b[0]}};cvox.MathmlStoreUtil.mfencedSeparators=function(a,b){var c=cvox.MathmlStoreUtil.nextSeparatorFunction(b);return function(){return c?c():""}};
cvox.MathmlStoreUtil.contentIterator=function(a,b){var c=0<a.length?cvox.XpathUtil.evalXPath("../../content/*",a[0]):[];return function(){var a=c.shift();return b+(a?a.textContent:"")}};cvox.StoreUtil={};cvox.StoreUtil.nodeCounter=function(a,b){var c=a.length,d=0,e=b;b||(e="");return function(){d<c&&(d+=1);return e+" "+d}};cvox.MathmlStoreRules=function(){cvox.MathmlStoreRules.initCustomFunctions_();cvox.MathmlStoreRules.initDefaultRules_();cvox.MathmlStoreRules.initMathjaxRules_();cvox.MathmlStoreRules.initAliases_();cvox.MathmlStoreRules.initSpecializationRules_();cvox.MathmlStoreRules.initSemanticRules_()};goog.addSingletonGetter(cvox.MathmlStoreRules);cvox.MathmlStoreRules.mathStore=cvox.MathmlStore.getInstance();cvox.MathmlStoreRules.mathStore.initialize=cvox.MathmlStoreRules.getInstance;
@@ -1229,9 +1232,8 @@ cvox.NavigationManager.prototype.speakDescriptionArray=function(a,b,c,d){d&&a.ev
cvox.NavigationManager.prototype.finishNavCommand=function(a,b,c,d){if(this.pageEnd_&&!this.pageEndAnnounced_)this.pageEndAnnounced_=!0,cvox.ChromeVox.tts.stop(),cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.WRAP),cvox.ChromeVox.verbosity===cvox.VERBOSITY_VERBOSE&&(a=cvox.ChromeVox.msgs.getMsg("wrapped_to_top"),this.isReversed()&&(a=cvox.ChromeVox.msgs.getMsg("wrapped_to_bottom")),cvox.ChromeVox.tts.speak(a,cvox.AbstractTts.QUEUE_MODE_QUEUE,cvox.AbstractTts.PERSONALITY_ANNOTATION));else{if(this.enteredShifter_||
this.exitedShifter_)a=cvox.ChromeVox.msgs.getMsg("enter_content_say",[this.shifter_.getName()]);var e=cvox.ChromeVox.navigationManager.getDescription();(b=void 0===b?!0:b)&&this.setFocus();this.updateIndicator();b=c||cvox.AbstractTts.QUEUE_MODE_FLUSH;a&&(cvox.ChromeVox.tts.speak(a,b,cvox.AbstractTts.PERSONALITY_ANNOTATION),b=cvox.AbstractTts.QUEUE_MODE_QUEUE);this.speakDescriptionArray(e,b,d||null);this.getBraille().write();this.updatePosition(this.getCurrentNode())}};
cvox.NavigationManager.prototype.navigate=function(a,b){this.pageEndAnnounced_=!1;if(this.pageEnd_)return this.pageEnd_=!1,this.syncToBeginning(a),!0;if(!this.resolve())return!1;this.ensureNotSubnavigating();void 0!==b&&(b!==this.getGranularity()||0<this.shifterStack_.length)&&(this.setGranularity(b,!0),this.sync());return this.next_(!a)};cvox.NavigationManager.prototype.subnavigate=function(){this.pageEndAnnounced_=!1;this.resolve()&&(this.ensureSubnavigating(),this.next_(!0))};
-cvox.NavigationManager.prototype.skip=function(){if(!this.keepReading_)return!1;cvox.ChromeVox.host.hasTtsCallback()&&(this.skipped_=!0,this.setReversed(!1),this.startCallbackReading_(cvox.AbstractTts.QUEUE_MODE_FLUSH));return!0};
-cvox.NavigationManager.prototype.startReading=function(a){this.keepReading_=!0;cvox.ChromeVox.host.hasTtsCallback()?this.startCallbackReading_(a):this.startNonCallbackReading_(a);this.prevStickyState_=cvox.ChromeVox.isStickyOn;cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!0,announce:!1})};
-cvox.NavigationManager.prototype.stopReading=function(a){this.keepReading_=!1;this.navSpeaker_.stopReading=!0;a&&cvox.ChromeVox.tts.stop();void 0!=this.prevStickyState_&&(cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:this.prevStickyState_,announce:!1}),this.prevStickyState_=void 0)};cvox.NavigationManager.prototype.isReading=function(){return this.keepReading_};
+cvox.NavigationManager.prototype.skip=function(){if(!this.keepReading_)return!1;cvox.ChromeVox.host.hasTtsCallback()&&(this.skipped_=!0,this.setReversed(!1),this.startCallbackReading_(cvox.AbstractTts.QUEUE_MODE_FLUSH));return!0};cvox.NavigationManager.prototype.startReading=function(a){this.keepReading_=!0;cvox.ChromeVox.host.hasTtsCallback()?this.startCallbackReading_(a):this.startNonCallbackReading_(a);cvox.ChromeVox.stickyOverride=!0};
+cvox.NavigationManager.prototype.stopReading=function(a){this.keepReading_=!1;this.navSpeaker_.stopReading=!0;a&&cvox.ChromeVox.tts.stop();cvox.ChromeVox.stickyOverride=null};cvox.NavigationManager.prototype.isReading=function(){return this.keepReading_};
cvox.NavigationManager.prototype.startCallbackReading_=cvox.ChromeVoxEventSuspender.withSuspendedEvents(function(a){this.finishNavCommand("",!0,a,goog.bind(function(){this.next_(!0)&&this.keepReading_&&this.startCallbackReading_(cvox.AbstractTts.QUEUE_MODE_QUEUE)},this))});
cvox.NavigationManager.prototype.startNonCallbackReading_=cvox.ChromeVoxEventSuspender.withSuspendedEvents(function(a){this.keepReading_&&(cvox.ChromeVox.tts.isSpeaking()||(this.finishNavCommand("",!0,a,null),this.next_(!0)||(this.keepReading_=!1)),window.setTimeout(goog.bind(this.startNonCallbackReading_,this),1E3))});
cvox.NavigationManager.prototype.getFullDescription=function(){return this.pageSel_?this.pageSel_.getFullDescription():[cvox.DescriptionUtil.getDescriptionFromAncestors(cvox.DomUtil.getAncestors(this.curSel_.start.node),!0,cvox.ChromeVox.verbosity)]};cvox.NavigationManager.prototype.setFocus=function(a){this.pageSel_||a&&this.curSel_.start.node.constructor==Text||cvox.Focuser.setFocus(this.curSel_.start.node)};cvox.NavigationManager.prototype.getCurrentNode=function(){return this.curSel_.absStart().node};
@@ -1361,29 +1363,7 @@ cvox.ChromeVoxEditableContentEditable.prototype.getLineEnd=function(a){return th
cvox.ChromeVoxEditableContentEditable.prototype.changed=function(a){a.triggeredByUser&&(this.shouldDescribeChange(a)?cvox.ChromeVoxEditableContentEditable.superClass_.changed.call(this,a):this.speak(cvox.ChromeVox.msgs.getMsg("text_box_blank"),!0))};
cvox.ChromeVoxEditableContentEditable.prototype.shouldDescribeChange=function(a){var b=window.getSelection(),c=new cvox.Cursor(b.baseNode,b.baseOffset,"");return 1!=Math.abs(this.start-a.start)&&this.start==this.end&&a.start==a.end&&b.baseNode==b.extentNode&&b.baseOffset==b.extentOffset&&b.baseNode.nodeType==Node.ELEMENT_NODE&&b.baseNode.querySelector("BR")&&cvox.TraverseUtil.forwardsChar(c,[],[])?!1:!0};cvox.FocusUtil=function(){};cvox.FocusUtil.INPUT_TYPE_ACCEPTS_SELECTION_TABLE={hidden:!1,text:!0,search:!0,tel:!0,url:!0,email:!0,password:!0,datetime:!1,date:!1,month:!1,week:!1,time:!1,"datetime-local":!1,number:!1,range:!1,color:!1,checkbox:!1,radio:!1,file:!1,submit:!1,image:!1,reset:!1,button:!1};
cvox.FocusUtil.isFocusInTextInputField=function(){var a=document.activeElement;return a?a.isContentEditable||"textbox"==a.getAttribute("role")?!0:"true"==a.getAttribute("readOnly")?!1:"TEXTAREA"===a.tagName||"SELECT"===a.tagName?!0:"INPUT"===a.tagName?a.hasAttribute("type")?(a=a.getAttribute("type").toLowerCase(),cvox.FocusUtil.INPUT_TYPE_ACCEPTS_SELECTION_TABLE[a]):!0:!1:!1};cvox.ConsoleTts=function(){this.enabled_=!1};goog.addSingletonGetter(cvox.ConsoleTts);cvox.ConsoleTts.prototype.speak=function(a,b,c){if(this.enabled_&&window.console){var d="Speak",d=b==cvox.AbstractTts.QUEUE_MODE_FLUSH?d+" (I)":d+" (Q)",d=d+(' "'+a+'"');window.console.log(d);c&&void 0!=c.startCallback&&window.console.log(" using startCallback");c&&void 0!=c.endCallback&&window.console.log(" using endCallback")}return this};cvox.ConsoleTts.prototype.isSpeaking=function(){return!1};
-cvox.ConsoleTts.prototype.stop=function(){this.enabled_&&window.console.log("Stop")};cvox.ConsoleTts.prototype.increaseOrDecreaseProperty=function(){};cvox.ConsoleTts.prototype.setEnabled=function(a){this.enabled_=a};cvox.ConsoleTts.prototype.getDefaultProperty=function(){};cvox.SpokenListBuilder=function(){this.list_=[]};cvox.SpokenListBuilder.prototype.flush=function(a){this.list_.push([a,cvox.AbstractTts.QUEUE_MODE_FLUSH]);return this};cvox.SpokenListBuilder.prototype.build=function(){return this.list_};cvox.RunnerInterface=function(){};cvox.RunnerInterface.prototype.setFocus=function(){};cvox.AbstractTestCase=function(){};cvox.CompositeTts=function(){this.ttsEngines_=[]};cvox.CompositeTts.prototype.add=function(a){this.ttsEngines_.push(a);return this};cvox.CompositeTts.prototype.speak=function(a,b,c){this.ttsEngines_.forEach(function(d){d.speak(a,b,c)})};cvox.CompositeTts.prototype.isSpeaking=function(){return this.ttsEngines_.some(function(a){return a.isSpeaking()})};cvox.CompositeTts.prototype.stop=function(){this.ttsEngines_.forEach(function(a){a.stop()})};
-cvox.CompositeTts.prototype.increaseOrDecreaseProperty=function(a,b){this.ttsEngines_.forEach(function(c){c.increaseOrDecreaseProperty(a,b)})};cvox.CompositeTts.prototype.getDefaultProperty=function(a){for(var b=0,c;c=this.ttsEngines_[b];b++)if(c=c.getDefaultProperty(a))return c};cvox.AbstractBraille=function(){};cvox.AbstractHost=function(){};cvox.AbstractHost.State={ACTIVE:0,INACTIVE:1,KILLED:2};cvox.AbstractHost.prototype.init=function(){};cvox.AbstractHost.prototype.reinit=function(){};cvox.AbstractHost.prototype.onPageLoad=function(){};cvox.AbstractHost.prototype.sendToBackgroundPage=function(){};cvox.AbstractHost.prototype.getApiSrc=function(){return""};cvox.AbstractHost.prototype.getFileSrc=function(){return""};cvox.AbstractHost.prototype.hasTtsCallback=function(){return!0};
-cvox.AbstractHost.prototype.ttsLoaded=function(){return!0};cvox.AbstractHost.prototype.mustRedispatchClickEvent=function(){return!1};cvox.AbstractHost.prototype.activateOrDeactivateChromeVox=function(a){this.onStateChanged_(a?cvox.AbstractHost.State.ACTIVE:cvox.AbstractHost.State.INACTIVE)};cvox.AbstractHost.prototype.killChromeVox=function(){this.onStateChanged_(cvox.AbstractHost.State.KILLED)};
-cvox.AbstractHost.prototype.onStateChanged_=function(a){var b=a==cvox.AbstractHost.State.ACTIVE;if(b!=cvox.ChromeVox.isActive)switch(cvox.ChromeVoxEventWatcher.cleanup(window),a){case cvox.AbstractHost.State.ACTIVE:cvox.ChromeVox.isActive=!0;cvox.ChromeVox.navigationManager.showOrHideIndicator(!0);cvox.ChromeVoxEventWatcher.init(window);document.activeElement?(a=document.hasFocus()&&!document.webkitHidden,cvox.ApiImplementation.syncToNode(document.activeElement,a)):cvox.ChromeVox.navigationManager.updateIndicator();
-break;case cvox.AbstractHost.State.INACTIVE:cvox.ChromeVox.isActive=!1;cvox.ChromeVox.navigationManager.showOrHideIndicator(!1);cvox.ChromeVoxEventWatcher.init(window);break;case cvox.AbstractHost.State.KILLED:cvox.ChromeVox.isActive=!1,cvox.ChromeVox.navigationManager.showOrHideIndicator(!1)}};cvox.MathJaxInterface=function(){};cvox.MathJaxInterface.prototype.isMathjaxActive=function(){};cvox.MathJaxInterface.prototype.getAllJax=function(){};cvox.MathJaxInterface.prototype.registerSignal=function(){};cvox.MathJaxInterface.prototype.injectScripts=function(){};cvox.MathJaxInterface.prototype.configMediaWiki=function(){};cvox.MathJaxInterface.prototype.getTex=function(){};cvox.MathJaxInterface.prototype.getAsciiMath=function(){};cvox.AbstractMathJax=function(){};cvox.AbstractMathJax.prototype.getAllTexs=function(a){for(var b=document.querySelectorAll(cvox.DomUtil.altMathQuerySelector("tex")),c=0,d;d=b[c];c++)this.getTex(a,d)};cvox.AbstractMathJax.prototype.getAllAsciiMaths=function(a){for(var b=document.querySelectorAll(cvox.DomUtil.altMathQuerySelector("asciimath")),c=0,d;d=b[c];c++)this.getAsciiMath(a,d)};
-cvox.AbstractMathJax.prototype.convertMarkupToDom=function(a,b,c){if(b){var d=new DOMParser;b=b.replace(/>\s+</g,"><");a(d.parseFromString(b,"text/xml").firstChild,c)}};cvox.AbstractMsgs=function(){};cvox.AbstractMsgs.prototype.getMsg=function(){};cvox.AbstractMsgs.prototype.getNumber=function(){};cvox.HostFactory=function(){};cvox.HostFactory.getHost=function(){return new cvox.HostFactory.hostConstructor};cvox.HostFactory.getTts=function(){return new cvox.HostFactory.ttsConstructor};cvox.HostFactory.getBraille=function(){return new cvox.HostFactory.brailleConstructor};cvox.HostFactory.getMsgs=function(){return new cvox.HostFactory.msgsConstructor};cvox.HostFactory.getEarcons=function(){return new cvox.HostFactory.earconsConstructor};cvox.HostFactory.getMathJax=function(){return new cvox.HostFactory.mathJaxConstructor};cvox.TestTts=function(){cvox.AbstractTts.call(this);this.utterances_=[]};goog.inherits(cvox.TestTts,cvox.AbstractTts);cvox.TestTts.prototype.sentinelText_="@@@STOP@@@";cvox.TestTts.prototype.speak=function(a,b,c){this.utterances_.push({text:a,queueMode:b});c&&void 0!=c.endCallback&&(a=this.utterances_.length,this.utterances_[a-1].text!=this.sentinelText_&&c.endCallback())};cvox.HostFactory.ttsConstructor=cvox.TestTts;cvox.NodeBreadcrumb=function(){this.cvTagCounter_=0};goog.addSingletonGetter(cvox.NodeBreadcrumb);cvox.NodeBreadcrumb.TOUCHED_TAG="chromevoxtag";cvox.NodeBreadcrumb.NEEDED_TAG_="chromevoxneeded";
-cvox.NodeBreadcrumb.prototype.tagCurrentNode=function(){for(var a,b=cvox.ChromeVox.navigationManager.getCurrentNode();b&&!b.hasAttribute;)b=b.parentNode;b?b.hasAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG)?a=b.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG):(a=this.cvTagCounter_,b.setAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG,a),this.cvTagCounter_++):a=-1;return a};
-cvox.NodeBreadcrumb.prototype.smartStart_=function(a){for(var b=0;b<a.children.length;++b){var c=a.children[b];this.smartStart_(c);c.getAttribute&&!goog.isNull(c.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG))&&this.setNeeded_(c)}};cvox.NodeBreadcrumb.prototype.setNeeded_=function(a){a&&a.getAttribute&&goog.isNull(a.getAttribute(cvox.NodeBreadcrumb.NEEDED_TAG_))&&(a.setAttribute(cvox.NodeBreadcrumb.NEEDED_TAG_,!0),"body"!==a.nodeName&&this.setNeeded_(a.parentElement))};
-cvox.NodeBreadcrumb.prototype.smartClone_=function(a){var b={};b[cvox.NodeBreadcrumb.TOUCHED_TAG]=!0;b[cvox.NodeBreadcrumb.NEEDED_TAG_]=!0;if(a.getAttribute&&a.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG))return cvox.DomUtil.deepClone(a,b);for(var b=cvox.DomUtil.shallowChildlessClone(a,b),c=0;c<a.childNodes.length;++c){var d=a.childNodes[c];d.getAttribute&&!goog.isNull(d.getAttribute(cvox.NodeBreadcrumb.NEEDED_TAG_))&&b.appendChild(this.smartClone_(d))}return b};
-cvox.NodeBreadcrumb.prototype.dumpWalkedDom=function(){this.smartStart_(document.body);return this.smartClone_(document.body)};cvox.NodeBreadcrumb.getCurrentNodeTag=function(){for(var a=cvox.ChromeVox.navigationManager.getCurrentNode();a&&!a.hasAttribute;)a=a.parentNode;return a&&a.hasAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG)?a.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG):-1};cvox.HistoryEvent=function(a){this.spoken_=[];a?this.userCommand_=a.cmd:this.startTime_=(new Date).getTime()};cvox.HistoryEvent.prototype.withUserCommand=function(a){if(this.userCommand_)return window.console.error("Two user commands on "+a,this),this;this.userCommand_=a;return this};cvox.HistoryEvent.prototype.speak=function(a){this.spoken_.push(a);return this};
-cvox.HistoryEvent.prototype.done=function(){this.endTime_=(new Date).getTime();cvox.NodeBreadcrumb.getInstance().tagCurrentNode();window.console.log("User command done.",this);return this};cvox.HistoryEvent.prototype.outputObject=function(){return{start:this.startTime_,end:this.endTime_,cmd:this.userCommand_,spoken:this.spoken_}};
-cvox.HistoryEvent.prototype.outputHTML=function(){var a=document.createElement("div");a.className="cvoxHistoryEvent";var b=this.endTime_-this.startTime_;a.innerHTML=this.userCommand_+" ("+b+"ms)";for(b=0;b<this.spoken_.length;b++){var c=document.createElement("div");c.className="cvoxHistoryEventSpoken";c.innerHTML=this.spoken_[b].substr(0,20);20<this.spoken_[b].length&&(c.innerHTML+="...");a.appendChild(c)}return a};
-cvox.HistoryEvent.prototype.outputJs=function(){var a="this.waitForCalm(this.userCommand, '"+this.userCommand_+"')";return a=0<this.spoken_.length?a+("\n .waitForCalm(this.assertSpoken, '"+cvox.DomUtil.collapseWhitespace(this.spoken_.join(" "))+"');\n"):a+";\n"};cvox.History=function(){this.recording_=!1;this.events_=[];this.styleDiv_=this.listDiv_=this.mainDiv_=this.currentEvent_=null;this.nodeBreadcrumb_=cvox.NodeBreadcrumb.getInstance()};goog.addSingletonGetter(cvox.History);
-cvox.History.prototype.addListDiv_=function(){this.mainDiv_=document.createElement("div");this.mainDiv_.style.position="fixed";this.mainDiv_.style.bottom="0";this.mainDiv_.style.right="0";this.mainDiv_.style.zIndex="999";this.listDiv_=document.createElement("div");this.listDiv_.id="cvoxEventList";this.mainDiv_.appendChild(this.listDiv_);var a=document.createElement("div"),b=document.createElement("button");b.onclick=cvox.History.sendToFeedback;b.innerHTML="Create bug";a.appendChild(b);this.mainDiv_.appendChild(a);
-a=document.createElement("div");b=document.createElement("button");b.onclick=cvox.History.dumpJs;b.innerHTML="Dump test case";a.appendChild(b);this.mainDiv_.appendChild(a);document.body.appendChild(this.mainDiv_);this.styleDiv_=document.createElement("style");this.styleDiv_.innerHTML=".cvoxHistoryEventSpoken { color: gray; font-size: 75% }";document.body.appendChild(this.styleDiv_)};
-cvox.History.prototype.removeListDiv_=function(){document.body.removeChild(this.mainDiv_);document.body.removeChild(this.styleDiv_);this.styleDiv_=this.listDiv_=this.mainDiv_=null};
-cvox.History.prototype.addBigTextBox_=function(){function a(a,b){var c=document.createElement("button");c.onclick=b;c.innerHTML=a;d.appendChild(c)}var b=document.createElement("div");b.style.position="fixed";b.style.top="0";b.style.left="0";b.style.zIndex="999";var c=document.createElement("textarea");c.style.width="500px";c.style.height="500px";c.innerHTML=this.dumpJsOutput_();b.appendChild(c);var d=document.createElement("div");b.appendChild(d);a("Close dialog",function(){document.body.removeChild(b)});
-a("Remove fluff",goog.bind(function(){c.innerHTML=this.dumpJsOutput_(["stopSpeech","toggleKeyPrefix"])},this));document.body.appendChild(b)};cvox.History.prototype.startRecording=function(){this.recording_=!0;this.addListDiv_()};cvox.History.prototype.stopRecording=function(){this.recording_=!1;this.removeListDiv_();this.events_=[];this.currentEvent_=null};
-cvox.History.prototype.enterUserCommand=function(a){this.recording_&&(this.currentEvent_&&window.console.error("User command "+a+" overlaps current event",this.currentEvent_),this.currentEvent_=(new cvox.HistoryEvent).withUserCommand(a),this.events_.push(this.currentEvent_))};cvox.History.prototype.exitUserCommand=function(){this.recording_&&this.currentEvent_&&(this.currentEvent_.done(),this.listDiv_.appendChild(this.currentEvent_.outputHTML()),this.currentEvent_=null)};
-cvox.History.prototype.speak=function(a){if(!this.recording_)return this;if(!this.currentEvent_)return window.console.error("Speak called outside of a user command."),this;this.currentEvent_.speak(a);return this};cvox.History.prototype.isSpeaking=function(){return!1};cvox.History.prototype.stop=function(){};cvox.History.prototype.increaseOrDecreaseProperty=function(){};cvox.History.prototype.getDefaultProperty=function(){};
-cvox.History.dumpJs=function(){var a=cvox.History.getInstance();a.addBigTextBox_();window.console.log(a.dumpJsOutput_())};cvox.History.prototype.dumpJsOutput_=function(a){var b={};a&&a.forEach(function(a){b[a]=1});return["/*DOC: += ",this.nodeBreadcrumb_.dumpWalkedDom().innerHTML,"*/\n"].concat(this.events_.filter(function(a){return!(a.userCommand_ in b)}).map(function(a){return a.outputJs()})).join("")};
-cvox.History.sendToFeedback=function(){var a=cvox.History.getInstance(),a=a.events_.map(function(a){return a.outputObject()}),b=document.createElement("script");b.type="text/javascript";b.src="https://www.gstatic.com/feedback/api.js";var c=document.createElement("script");c.type="text/javascript";c.innerHTML="userfeedback.api.startFeedback({ productId: '76092' }, { cvoxHistory: "+cvox.ChromeVoxJSON.stringify(cvox.ChromeVoxJSON.stringify(a))+" });";b.onload=function(){document.body.appendChild(c)};
-document.body.appendChild(b)};cvox.AutoRunner=function(){new cvox.TestTts};cvox.AutoRunner.TestSummary=function(a,b,c,d){this.tag=a;this.status=c;this.scope=d};cvox.AutoRunner.PASS="pass";cvox.AutoRunner.FAIL="fail";cvox.AutoRunner.prototype.setFocus=function(a){document.getElementById(a).focus();return this};cvox.ChromeVoxUserCommands={};cvox.ChromeVoxUserCommands.init_=function(){if(!cvox.ChromeVoxUserCommands.commands){cvox.ChromeVoxUserCommands.commands={};for(var a in cvox.CommandStore.CMD_WHITELIST)cvox.ChromeVoxUserCommands.commands[a]=cvox.ChromeVoxUserCommands.createCommand_(a)}};cvox.ChromeVoxUserCommands.wasMouseClicked=!1;cvox.ChromeVoxUserCommands.enableCommandDispatchingToPage=!0;
+cvox.ConsoleTts.prototype.stop=function(){this.enabled_&&window.console.log("Stop")};cvox.ConsoleTts.prototype.increaseOrDecreaseProperty=function(){};cvox.ConsoleTts.prototype.setEnabled=function(a){this.enabled_=a};cvox.ConsoleTts.prototype.getDefaultProperty=function(){};cvox.ChromeVoxUserCommands={};cvox.ChromeVoxUserCommands.init_=function(){if(!cvox.ChromeVoxUserCommands.commands){cvox.ChromeVoxUserCommands.commands={};for(var a in cvox.CommandStore.CMD_WHITELIST)cvox.ChromeVoxUserCommands.commands[a]=cvox.ChromeVoxUserCommands.createCommand_(a)}};cvox.ChromeVoxUserCommands.wasMouseClicked=!1;cvox.ChromeVoxUserCommands.enableCommandDispatchingToPage=!0;
cvox.ChromeVoxUserCommands.handleTabAction_=function(){cvox.ChromeVox.tts.stop();if(!cvox.ChromeVox.navigationManager.resolve(cvox.DomUtil.isFocusable))return cvox.ChromeVox.navigationManager.setFocus(),!1;var a=cvox.ChromeVoxUserCommands.isFocusedOnLinkControl_();if(a)return!0;var b=a=null,b=window.getSelection();cvox.ChromeVoxUserCommands.wasMouseClicked?cvox.ChromeVoxUserCommands.wasMouseClicked=!1:b=null;null==b||null==b.anchorNode||null==b.focusNode?(a=cvox.ChromeVox.navigationManager.getCurrentNode(),
b=cvox.ChromeVox.navigationManager.getCurrentNode()):(a=b.anchorNode,b=b.focusNode);if(null==a||null==b)return!0;if(cvox.DomUtil.isFocusable(a))return a.focus(),!0;if(cvox.DomUtil.isFocusable(b))return b.focus(),!0;if(cvox.DomUtil.isFocusable(a.parentNode))return a.parentNode.focus(),!0;if(cvox.DomUtil.isFocusable(b.parentNode))return b.parentNode.focus(),!0;b=cvox.ChromeVoxUserCommands.createTabDummySpan_();a.parentNode.insertBefore(b,a);b.focus();return!0};
cvox.ChromeVoxUserCommands.isFocusedOnLinkControl_=function(){var a="A";return document.activeElement.tagName==a||cvox.DomUtil.isControl(document.activeElement)?!0:!1};cvox.ChromeVoxUserCommands.removeTabDummySpan=function(){var a=document.getElementById("ChromeVoxTabDummySpan");a&&document.activeElement!=a&&a.parentNode.removeChild(a)};cvox.ChromeVoxUserCommands.createTabDummySpan_=function(){var a=document.createElement("span");a.id="ChromeVoxTabDummySpan";a.tabIndex=-1;return a};
@@ -1405,12 +1385,16 @@ g=cvox.ChromeVox.navigationManager.getCurrentNode();cvox.DomUtil.clickElem(g,!1,
", "+g.toLocaleDateString());break;case "toggleSelection":d=cvox.ChromeVox.navigationManager.togglePageSel();d=cvox.ChromeVox.msgs.getMsg(d?"begin_selection":"end_selection");break;case "startHistoryRecording":cvox.History.getInstance().startRecording();break;case "stopHistoryRecording":cvox.History.getInstance().stopRecording();break;case "enableConsoleTts":cvox.ConsoleTts.getInstance().setEnabled(!0);break;case "toggleBrailleCaptions":cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",
pref:"brailleCaptions",value:!cvox.BrailleOverlayWidget.getInstance().isActive()});break;case "goToFirstCell":case "goToLastCell":case "goToRowFirstCell":case "goToRowLastCell":case "goToColFirstCell":case "goToColLastCell":case "announceHeaders":case "speakTableLocation":case "exitShifterContent":cvox.DomPredicates.tablePredicate(cvox.DomUtil.getAncestors(cvox.ChromeVox.navigationManager.getCurrentNode()))&&cvox.ChromeVox.navigationManager.performAction(b)||(c="not_inside_table");break;case "enterShifter":case "exitShifter":cvox.ChromeVox.navigationManager.performAction(b);
break;case "decreaseTtsRate":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.RATE,!1);break;case "increaseTtsRate":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.RATE,!0);break;case "decreaseTtsPitch":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.PITCH,!1);break;case "increaseTtsPitch":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.PITCH,!0);break;case "decreaseTtsVolume":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.VOLUME,
-!1);break;case "increaseTtsVolume":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.VOLUME,!0);break;case "cyclePunctuationEcho":cvox.ChromeVox.host.sendToBackgroundPage({target:"TTS",action:"cyclePunctuationEcho"});break;case "toggleStickyMode":cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!cvox.ChromeVox.isStickyOn,announce:!0});break;case "toggleKeyPrefix":cvox.ChromeVox.keyPrefixOn=!cvox.ChromeVox.keyPrefixOn;break;case "passThroughMode":cvox.ChromeVox.passThroughMode=
+!1);break;case "increaseTtsVolume":cvox.ChromeVox.tts.increaseOrDecreaseProperty(cvox.AbstractTts.VOLUME,!0);break;case "cyclePunctuationEcho":cvox.ChromeVox.host.sendToBackgroundPage({target:"TTS",action:"cyclePunctuationEcho"});break;case "toggleStickyMode":cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"sticky",value:!cvox.ChromeVox.isStickyPrefOn,announce:!0});break;case "toggleKeyPrefix":cvox.ChromeVox.keyPrefixOn=!cvox.ChromeVox.keyPrefixOn;break;case "passThroughMode":cvox.ChromeVox.passThroughMode=
!0;cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("pass_through_key"));break;case "toggleSearchWidget":cvox.SearchWidget.getInstance().toggle();break;case "toggleEarcons":d=cvox.ChromeVox.earcons.toggle()?cvox.ChromeVox.msgs.getMsg("earcons_on"):cvox.ChromeVox.msgs.getMsg("earcons_off");break;case "showHeadingsList":case "showLinksList":case "showFormsList":case "showTablesList":case "showLandmarksList":if(!a.nodeList)break;g=cvox.CommandStore.NODE_INFO_MAP[a.nodeList];cvox.NodeSearchWidget.create(g.typeMsg,
cvox.DomPredicates[g.predicate]).show();break;case "openLongDesc":g=cvox.ChromeVox.navigationManager.getCurrentNode();cvox.DomUtil.hasLongDesc(g)?cvox.ChromeVox.host.sendToBackgroundPage({target:"OpenTab",url:g.longDesc}):cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("no_long_desc"),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOTATION);break;case "pauseAllMedia":k=document.getElementsByTagName("VIDEO");for(g=0;h=k[g];g++)h.pause();k=document.getElementsByTagName("AUDIO");
for(g=0;h=k[g];g++)h.pause();break;case "toggleSemantics":cvox.TraverseMath.toggleSemantic()?cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("semantics_on")):cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("semantics_off"));break;case cvox.BrailleKeyCommand.ROUTING:(g=a.content)&&cvox.BrailleUtil.click(g,a.event.displayPosition);break;case cvox.BrailleKeyCommand.PAN_LEFT:case cvox.BrailleKeyCommand.LINE_UP:case cvox.BrailleKeyCommand.PAN_RIGHT:case cvox.BrailleKeyCommand.LINE_DOWN:cvox.ChromeVox.navigationManager.navigate(!1,
cvox.NavigationShifter.GRANULARITIES.LINE);break;case "debug":break;case "nop":break;default:throw"Command behavior not defined: "+b;}""!=c?cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg(c),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOTATION):cvox.ChromeVox.navigationManager.isReading()?a.disallowContinuation?cvox.ChromeVox.navigationManager.stopReading(!0):"readFromHere"!=b&&cvox.ChromeVox.navigationManager.skip():a.announce&&cvox.ChromeVox.navigationManager.finishNavCommand(d);
-a.allowEvents||cvox.ChromeVoxEventSuspender.exitSuspendEvents();return!!a.doDefault||e};cvox.ChromeVoxUserCommands.handleChromeVoxUserEvent=function(a){a=new cvox.UserEventDetail(a.detail);a.command&&cvox.ChromeVoxUserCommands.doCommand_(cvox.ChromeVoxUserCommands.lookupCommand_(a.command,a))};cvox.ChromeVoxUserCommands.lookupCommand_=function(a,b){var c=cvox.CommandStore.CMD_WHITELIST[a];if(!c)throw"Invalid command: "+a;c=goog.object.clone(c);c.command=a;b&&goog.object.extend(c,b);return c};cvox.ChromeVoxUserCommands.init_();cvox.ChromeBraille=function(){this.commandListener_=this.defaultCommandListener_;this.lastContent_=null;this.lastContentId_="";this.nextLocalId_=1;cvox.ExtensionBridge.addMessageListener(goog.bind(function(a){if(document.hasFocus()&&"IFRAME"!=document.activeElement.tagName&&"BRAILLE"==a.message&&a.args){var b=null;a.contentId==this.lastContentId_&&(b=this.lastContent_);this.commandListener_(a.args,b)}},this))};goog.inherits(cvox.ChromeBraille,cvox.AbstractBraille);
+a.allowEvents||cvox.ChromeVoxEventSuspender.exitSuspendEvents();return!!a.doDefault||e};cvox.ChromeVoxUserCommands.handleChromeVoxUserEvent=function(a){a=new cvox.UserEventDetail(a.detail);a.command&&cvox.ChromeVoxUserCommands.doCommand_(cvox.ChromeVoxUserCommands.lookupCommand_(a.command,a))};cvox.ChromeVoxUserCommands.lookupCommand_=function(a,b){var c=cvox.CommandStore.CMD_WHITELIST[a];if(!c)throw"Invalid command: "+a;c=goog.object.clone(c);c.command=a;b&&goog.object.extend(c,b);return c};cvox.ChromeVoxUserCommands.init_();cvox.AbstractBraille=function(){};cvox.AbstractHost=function(){};cvox.AbstractHost.State={ACTIVE:0,INACTIVE:1,KILLED:2};cvox.AbstractHost.prototype.init=function(){};cvox.AbstractHost.prototype.reinit=function(){};cvox.AbstractHost.prototype.onPageLoad=function(){};cvox.AbstractHost.prototype.sendToBackgroundPage=function(){};cvox.AbstractHost.prototype.getApiSrc=function(){return""};cvox.AbstractHost.prototype.getFileSrc=function(){return""};cvox.AbstractHost.prototype.hasTtsCallback=function(){return!0};
+cvox.AbstractHost.prototype.ttsLoaded=function(){return!0};cvox.AbstractHost.prototype.mustRedispatchClickEvent=function(){return!1};cvox.AbstractHost.prototype.activateOrDeactivateChromeVox=function(a){this.onStateChanged_(a?cvox.AbstractHost.State.ACTIVE:cvox.AbstractHost.State.INACTIVE)};cvox.AbstractHost.prototype.killChromeVox=function(){this.onStateChanged_(cvox.AbstractHost.State.KILLED)};
+cvox.AbstractHost.prototype.onStateChanged_=function(a){var b=a==cvox.AbstractHost.State.ACTIVE;if(b!=cvox.ChromeVox.isActive)switch(cvox.ChromeVoxEventWatcher.cleanup(window),a){case cvox.AbstractHost.State.ACTIVE:cvox.ChromeVox.isActive=!0;cvox.ChromeVox.navigationManager.showOrHideIndicator(!0);cvox.ChromeVoxEventWatcher.init(window);document.activeElement?(a=document.hasFocus()&&!document.webkitHidden,cvox.ApiImplementation.syncToNode(document.activeElement,a)):cvox.ChromeVox.navigationManager.updateIndicator();
+break;case cvox.AbstractHost.State.INACTIVE:cvox.ChromeVox.isActive=!1;cvox.ChromeVox.navigationManager.showOrHideIndicator(!1);cvox.ChromeVoxEventWatcher.init(window);break;case cvox.AbstractHost.State.KILLED:cvox.ChromeVox.isActive=!1,cvox.ChromeVox.navigationManager.showOrHideIndicator(!1)}};cvox.MathJaxInterface=function(){};cvox.MathJaxInterface.prototype.isMathjaxActive=function(){};cvox.MathJaxInterface.prototype.getAllJax=function(){};cvox.MathJaxInterface.prototype.registerSignal=function(){};cvox.MathJaxInterface.prototype.injectScripts=function(){};cvox.MathJaxInterface.prototype.configMediaWiki=function(){};cvox.MathJaxInterface.prototype.getTex=function(){};cvox.MathJaxInterface.prototype.getAsciiMath=function(){};cvox.AbstractMathJax=function(){};cvox.AbstractMathJax.prototype.getAllTexs=function(a){for(var b=document.querySelectorAll(cvox.DomUtil.altMathQuerySelector("tex")),c=0,d;d=b[c];c++)this.getTex(a,d)};cvox.AbstractMathJax.prototype.getAllAsciiMaths=function(a){for(var b=document.querySelectorAll(cvox.DomUtil.altMathQuerySelector("asciimath")),c=0,d;d=b[c];c++)this.getAsciiMath(a,d)};
+cvox.AbstractMathJax.prototype.convertMarkupToDom=function(a,b,c){if(b){var d=new DOMParser;b=b.replace(/>\s+</g,"><");a(d.parseFromString(b,"text/xml").firstChild,c)}};cvox.AbstractMsgs=function(){};cvox.AbstractMsgs.prototype.getMsg=function(){};cvox.AbstractMsgs.prototype.getNumber=function(){};cvox.HostFactory=function(){};cvox.HostFactory.getHost=function(){return new cvox.HostFactory.hostConstructor};cvox.HostFactory.getTts=function(){return new cvox.HostFactory.ttsConstructor};cvox.HostFactory.getBraille=function(){return new cvox.HostFactory.brailleConstructor};cvox.HostFactory.getMsgs=function(){return new cvox.HostFactory.msgsConstructor};cvox.HostFactory.getEarcons=function(){return new cvox.HostFactory.earconsConstructor};cvox.HostFactory.getMathJax=function(){return new cvox.HostFactory.mathJaxConstructor};cvox.ChromeBraille=function(){this.commandListener_=this.defaultCommandListener_;this.lastContent_=null;this.lastContentId_="";this.nextLocalId_=1;cvox.ExtensionBridge.addMessageListener(goog.bind(function(a){if(document.hasFocus()&&"IFRAME"!=document.activeElement.tagName&&"BRAILLE"==a.message&&a.args){var b=null;a.contentId==this.lastContentId_&&(b=this.lastContent_);this.commandListener_(a.args,b)}},this))};goog.inherits(cvox.ChromeBraille,cvox.AbstractBraille);
cvox.ChromeBraille.prototype.write=function(a){this.lastContent_=a;this.updateLastContentId_();a=a.toJson();a={target:"BRAILLE",action:"write",params:a,contentId:this.lastContentId_};cvox.ExtensionBridge.send(a)};cvox.ChromeBraille.prototype.updateLastContentId_=function(){this.lastContentId_=cvox.ExtensionBridge.uniqueId()+"."+this.nextLocalId_++};
cvox.ChromeBraille.prototype.defaultCommandListener_=function(a,b){var c=cvox.ChromeVoxUserCommands.commands[a.command];c?c({event:a,content:b}):console.error("Unknown braille command: "+JSON.stringify(a))};cvox.HostFactory.brailleConstructor=cvox.ChromeBraille;cvox.ChromeEarcons=function(){cvox.AbstractEarcons.call(this)};goog.inherits(cvox.ChromeEarcons,cvox.AbstractEarcons);cvox.ChromeEarcons.prototype.playEarcon=function(a){cvox.ChromeEarcons.superClass_.playEarcon.call(this,a);this.enabled&&cvox.ExtensionBridge.send({target:"EARCON",action:"play",earcon:a})};
cvox.ChromeEarcons.prototype.toggle=function(){cvox.ChromeEarcons.superClass_.toggle.call(this);cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"earcons",value:this.enabled});this.enabled||cvox.ChromeVox.host.sendToBackgroundPage({target:"Prefs",action:"setPref",pref:"useVerboseMode",value:!0});return this.enabled};cvox.HostFactory.earconsConstructor=cvox.ChromeEarcons;cvox.ChromeVoxHTMLDateWidget=function(a,b){var c=this;this.pos_=0;var d=2;if("month"==a.type||"week"==a.type)d=1;this.maxPos_=d;this.dateElem_=a;this.dateTts_=b;this.pDay_=this.pWeek_=this.pMonth_=this.pYear_=-1;this.keyListener_=function(a){c.eventHandler_(a)};this.blurListener_=function(){c.shutdown()};0==this.dateElem_.value.length&&this.forceInitTime_();for(d=0;d<this.maxPos_;d++){var e=document.createEvent("KeyboardEvent");e.initKeyboardEvent("keydown",!0,!0,window,"Left",0,!1,!1,!1,!1);this.dateElem_.dispatchEvent(e);
@@ -1430,7 +1414,24 @@ cvox.ChromeVoxHTMLTimeWidget.prototype.shutdown=function(){this.timeElem_.remove
cvox.ChromeVoxHTMLTimeWidget.prototype.handlePosChange_=function(){0>this.pos_&&(this.pos_=0);this.pos_>this.maxPos_&&(this.pos_=this.maxPos_);if(this.pos_==this.maxPos_)this.pAmpm_="";else switch(this.pos_){case 0:this.pHours_=-1;break;case 1:this.pMinutes_=-1;break;case 2:this.pSeconds_=-1;break;case 3:this.pMilliseconds_=-1}};
cvox.ChromeVoxHTMLTimeWidget.prototype.update_=function(a){var b=this.timeElem_.value.split(":");if(1>b.length)this.forceInitTime_();else{var c=b[0],d=-1,e=0,f=0,g=cvox.ChromeVox.msgs.getMsg("timewidget_am");1<b.length&&(d=b[1]);2<b.length&&(b=b[2].split("."),e=b[0],1<b.length&&(f=b[1]));12<c&&(c-=12,g=cvox.ChromeVox.msgs.getMsg("timewidget_pm"));12==c&&(g=cvox.ChromeVox.msgs.getMsg("timewidget_pm"));0==c&&(c=12,g=cvox.ChromeVox.msgs.getMsg("timewidget_am"));b="";a&&(b=cvox.DomUtil.getName(this.timeElem_,
!0,!0)+"\n");c!=this.pHours_&&(b=b+c+" "+cvox.ChromeVox.msgs.getMsg("timewidget_hours")+"\n",this.pHours_=c);d!=this.pMinutes_&&(b=b+d+" "+cvox.ChromeVox.msgs.getMsg("timewidget_minutes")+"\n",this.pMinutes_=d);e!=this.pSeconds_&&(b=b+e+" "+cvox.ChromeVox.msgs.getMsg("timewidget_seconds")+"\n",this.pSeconds_=e);f!=this.pMilliseconds_&&(b=b+f+" "+cvox.ChromeVox.msgs.getMsg("timewidget_milliseconds")+"\n",this.pMilliseconds_=f);g!=this.pAmpm_&&(b+=g,this.pAmpm_=g);0<b.length&&this.timeTts_.speak(b,
-0,null)}};cvox.ChromeVoxHTMLTimeWidget.prototype.eventHandler_=function(a){var b=!1;if("keydown"==a.type){if(9==a.keyCode&&!a.shiftKey||39==a.keyCode)this.pos_++,this.handlePosChange_(),b=!0;if(9==a.keyCode&&a.shiftKey||37==a.keyCode)this.pos_--,this.handlePosChange_(),b=!0}this.update_(b)};cvox.KeyMap=function(a){this.bindings_=a;this.commandToKey_={};this.buildCommandToKey_()};cvox.KeyMap.KEYMAP_PATH="chromevox/background/keymaps/";cvox.KeyMap.AVAILABLE_MAP_INFO={keymap_classic:{file:"classic_keymap.json"},keymap_flat:{file:"flat_keymap.json"},keymap_experimental:{file:"experimental.json"}};cvox.KeyMap.DEFAULT_KEYMAP=0;cvox.KeyMap.prototype.length=function(){return this.bindings_.length};cvox.KeyMap.prototype.keys=function(){return this.bindings_.map(function(a){return a.sequence})};
+0,null)}};cvox.ChromeVoxHTMLTimeWidget.prototype.eventHandler_=function(a){var b=!1;if("keydown"==a.type){if(9==a.keyCode&&!a.shiftKey||39==a.keyCode)this.pos_++,this.handlePosChange_(),b=!0;if(9==a.keyCode&&a.shiftKey||37==a.keyCode)this.pos_--,this.handlePosChange_(),b=!0}this.update_(b)};cvox.NodeBreadcrumb=function(){this.cvTagCounter_=0};goog.addSingletonGetter(cvox.NodeBreadcrumb);cvox.NodeBreadcrumb.TOUCHED_TAG="chromevoxtag";cvox.NodeBreadcrumb.NEEDED_TAG_="chromevoxneeded";
+cvox.NodeBreadcrumb.prototype.tagCurrentNode=function(){for(var a,b=cvox.ChromeVox.navigationManager.getCurrentNode();b&&!b.hasAttribute;)b=b.parentNode;b?b.hasAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG)?a=b.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG):(a=this.cvTagCounter_,b.setAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG,a),this.cvTagCounter_++):a=-1;return a};
+cvox.NodeBreadcrumb.prototype.smartStart_=function(a){for(var b=0;b<a.children.length;++b){var c=a.children[b];this.smartStart_(c);c.getAttribute&&!goog.isNull(c.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG))&&this.setNeeded_(c)}};cvox.NodeBreadcrumb.prototype.setNeeded_=function(a){a&&a.getAttribute&&goog.isNull(a.getAttribute(cvox.NodeBreadcrumb.NEEDED_TAG_))&&(a.setAttribute(cvox.NodeBreadcrumb.NEEDED_TAG_,!0),"body"!==a.nodeName&&this.setNeeded_(a.parentElement))};
+cvox.NodeBreadcrumb.prototype.smartClone_=function(a){var b={};b[cvox.NodeBreadcrumb.TOUCHED_TAG]=!0;b[cvox.NodeBreadcrumb.NEEDED_TAG_]=!0;if(a.getAttribute&&a.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG))return cvox.DomUtil.deepClone(a,b);for(var b=cvox.DomUtil.shallowChildlessClone(a,b),c=0;c<a.childNodes.length;++c){var d=a.childNodes[c];d.getAttribute&&!goog.isNull(d.getAttribute(cvox.NodeBreadcrumb.NEEDED_TAG_))&&b.appendChild(this.smartClone_(d))}return b};
+cvox.NodeBreadcrumb.prototype.dumpWalkedDom=function(){this.smartStart_(document.body);return this.smartClone_(document.body)};cvox.NodeBreadcrumb.getCurrentNodeTag=function(){for(var a=cvox.ChromeVox.navigationManager.getCurrentNode();a&&!a.hasAttribute;)a=a.parentNode;return a&&a.hasAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG)?a.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG):-1};cvox.HistoryEvent=function(a){this.spoken_=[];a?this.userCommand_=a.cmd:this.startTime_=(new Date).getTime()};cvox.HistoryEvent.prototype.withUserCommand=function(a){if(this.userCommand_)return window.console.error("Two user commands on "+a,this),this;this.userCommand_=a;return this};cvox.HistoryEvent.prototype.speak=function(a){this.spoken_.push(a);return this};
+cvox.HistoryEvent.prototype.done=function(){this.endTime_=(new Date).getTime();cvox.NodeBreadcrumb.getInstance().tagCurrentNode();window.console.log("User command done.",this);return this};cvox.HistoryEvent.prototype.outputObject=function(){return{start:this.startTime_,end:this.endTime_,cmd:this.userCommand_,spoken:this.spoken_}};
+cvox.HistoryEvent.prototype.outputHTML=function(){var a=document.createElement("div");a.className="cvoxHistoryEvent";var b=this.endTime_-this.startTime_;a.innerHTML=this.userCommand_+" ("+b+"ms)";for(b=0;b<this.spoken_.length;b++){var c=document.createElement("div");c.className="cvoxHistoryEventSpoken";c.innerHTML=this.spoken_[b].substr(0,20);20<this.spoken_[b].length&&(c.innerHTML+="...");a.appendChild(c)}return a};
+cvox.HistoryEvent.prototype.outputJs=function(){var a="this.waitForCalm(this.userCommand, '"+this.userCommand_+"')";return a=0<this.spoken_.length?a+("\n .waitForCalm(this.assertSpoken, '"+cvox.DomUtil.collapseWhitespace(this.spoken_.join(" "))+"');\n"):a+";\n"};cvox.History=function(){this.recording_=!1;this.events_=[];this.styleDiv_=this.listDiv_=this.mainDiv_=this.currentEvent_=null;this.nodeBreadcrumb_=cvox.NodeBreadcrumb.getInstance()};goog.addSingletonGetter(cvox.History);
+cvox.History.prototype.addListDiv_=function(){this.mainDiv_=document.createElement("div");this.mainDiv_.style.position="fixed";this.mainDiv_.style.bottom="0";this.mainDiv_.style.right="0";this.mainDiv_.style.zIndex="999";this.listDiv_=document.createElement("div");this.listDiv_.id="cvoxEventList";this.mainDiv_.appendChild(this.listDiv_);var a=document.createElement("div"),b=document.createElement("button");b.onclick=cvox.History.sendToFeedback;b.innerHTML="Create bug";a.appendChild(b);this.mainDiv_.appendChild(a);
+a=document.createElement("div");b=document.createElement("button");b.onclick=cvox.History.dumpJs;b.innerHTML="Dump test case";a.appendChild(b);this.mainDiv_.appendChild(a);document.body.appendChild(this.mainDiv_);this.styleDiv_=document.createElement("style");this.styleDiv_.innerHTML=".cvoxHistoryEventSpoken { color: gray; font-size: 75% }";document.body.appendChild(this.styleDiv_)};
+cvox.History.prototype.removeListDiv_=function(){document.body.removeChild(this.mainDiv_);document.body.removeChild(this.styleDiv_);this.styleDiv_=this.listDiv_=this.mainDiv_=null};
+cvox.History.prototype.addBigTextBox_=function(){function a(a,b){var c=document.createElement("button");c.onclick=b;c.innerHTML=a;d.appendChild(c)}var b=document.createElement("div");b.style.position="fixed";b.style.top="0";b.style.left="0";b.style.zIndex="999";var c=document.createElement("textarea");c.style.width="500px";c.style.height="500px";c.innerHTML=this.dumpJsOutput_();b.appendChild(c);var d=document.createElement("div");b.appendChild(d);a("Close dialog",function(){document.body.removeChild(b)});
+a("Remove fluff",goog.bind(function(){c.innerHTML=this.dumpJsOutput_(["stopSpeech","toggleKeyPrefix"])},this));document.body.appendChild(b)};cvox.History.prototype.startRecording=function(){this.recording_=!0;this.addListDiv_()};cvox.History.prototype.stopRecording=function(){this.recording_=!1;this.removeListDiv_();this.events_=[];this.currentEvent_=null};
+cvox.History.prototype.enterUserCommand=function(a){this.recording_&&(this.currentEvent_&&window.console.error("User command "+a+" overlaps current event",this.currentEvent_),this.currentEvent_=(new cvox.HistoryEvent).withUserCommand(a),this.events_.push(this.currentEvent_))};cvox.History.prototype.exitUserCommand=function(){this.recording_&&this.currentEvent_&&(this.currentEvent_.done(),this.listDiv_.appendChild(this.currentEvent_.outputHTML()),this.currentEvent_=null)};
+cvox.History.prototype.speak=function(a){if(!this.recording_)return this;if(!this.currentEvent_)return window.console.error("Speak called outside of a user command."),this;this.currentEvent_.speak(a);return this};cvox.History.prototype.isSpeaking=function(){return!1};cvox.History.prototype.stop=function(){};cvox.History.prototype.increaseOrDecreaseProperty=function(){};cvox.History.prototype.getDefaultProperty=function(){};
+cvox.History.dumpJs=function(){var a=cvox.History.getInstance();a.addBigTextBox_();window.console.log(a.dumpJsOutput_())};cvox.History.prototype.dumpJsOutput_=function(a){var b={};a&&a.forEach(function(a){b[a]=1});return["/*DOC: += ",this.nodeBreadcrumb_.dumpWalkedDom().innerHTML,"*/\n"].concat(this.events_.filter(function(a){return!(a.userCommand_ in b)}).map(function(a){return a.outputJs()})).join("")};
+cvox.History.sendToFeedback=function(){var a=cvox.History.getInstance(),a=a.events_.map(function(a){return a.outputObject()}),b=document.createElement("script");b.type="text/javascript";b.src="https://www.gstatic.com/feedback/api.js";var c=document.createElement("script");c.type="text/javascript";c.innerHTML="userfeedback.api.startFeedback({ productId: '76092' }, { cvoxHistory: "+cvox.ChromeVoxJSON.stringify(cvox.ChromeVoxJSON.stringify(a))+" });";b.onload=function(){document.body.appendChild(c)};
+document.body.appendChild(b)};cvox.KeyMap=function(a){this.bindings_=a;this.commandToKey_={};this.buildCommandToKey_()};cvox.KeyMap.KEYMAP_PATH="chromevox/background/keymaps/";cvox.KeyMap.AVAILABLE_MAP_INFO={keymap_classic:{file:"classic_keymap.json"},keymap_flat:{file:"flat_keymap.json"},keymap_experimental:{file:"experimental.json"}};cvox.KeyMap.DEFAULT_KEYMAP=0;cvox.KeyMap.prototype.length=function(){return this.bindings_.length};cvox.KeyMap.prototype.keys=function(){return this.bindings_.map(function(a){return a.sequence})};
cvox.KeyMap.prototype.bindings=function(){return this.bindings_};cvox.KeyMap.prototype.toJSON=function(){return JSON.stringify({bindings:this.bindings_})};cvox.KeyMap.prototype.hasKey=function(a){for(var b=0;b<this.bindings_.length;b++){var c=this.bindings_[b];if(c.sequence.equals(a))return!0}return!1};cvox.KeyMap.prototype.commandForKey=function(a){if(null!=a)for(var b=0;b<this.bindings_.length;b++){var c=this.bindings_[b];if(c.sequence.equals(a))return c.command}return null};
cvox.KeyMap.fromDefaults=function(){return cvox.KeyMap.fromPath(cvox.KeyMap.KEYMAP_PATH+cvox.KeyMap.AVAILABLE_MAP_INFO.keymap_classic.file)};cvox.KeyMap.fromJSON=function(a){try{var b=JSON.parse(a).bindings,b=b.filter(function(a){return void 0===a.sequence.platformFilter||cvox.PlatformUtil.matchesPlatform(a.sequence.platformFilter)})}catch(c){return null}if("object"!=typeof b)return null;for(a=0;a<b.length;a++){if(void 0==b[a].command||void 0==b[a].sequence)return null;b[a].sequence=cvox.KeySequence.deserialize(b[a].sequence)}return new cvox.KeyMap(b)};
cvox.KeyMap.fromLocalStorage=function(){return localStorage.keyBindings?cvox.KeyMap.fromJSON(localStorage.keyBindings):null};cvox.KeyMap.fromPath=function(a){return cvox.KeyMap.fromJSON(cvox.KeyMap.readJSON_(a))};cvox.KeyMap.fromCurrentKeyMap=function(){var a=localStorage.currentKeyMap;return a&&cvox.KeyMap.AVAILABLE_MAP_INFO[a]?cvox.KeyMap.fromPath(cvox.KeyMap.KEYMAP_PATH+cvox.KeyMap.AVAILABLE_MAP_INFO[a].file):cvox.KeyMap.fromDefaults()};
@@ -1473,15 +1474,15 @@ cvox.ChromeVoxEventWatcher.setLastFocusedNode_=function(a){cvox.ChromeVoxEventWa
cvox.ChromeVoxEventWatcher.mutationHandler=function(a){if(cvox.ChromeVoxEventSuspender.areEventsSuspended())return!0;cvox.ChromeVox.navigationManager.updateIndicatorIfChanged();cvox.LiveRegions.processMutations(a,function(a,c){var d=new window.Event("LiveRegion");d.navDescriptions=c;d.assertive=a;cvox.ChromeVoxEventWatcher.addEvent(d,!0);return!0})};
cvox.ChromeVoxEventWatcher.mouseClickEventWatcher=function(a){if(a.fromCvox)return!0;if(cvox.ChromeVox.host.mustRedispatchClickEvent())return cvox.ChromeVoxUserCommands.wasMouseClicked=!0,a.stopPropagation(),a.preventDefault(),cvox.Focuser.setFocus(cvox.ChromeVox.navigationManager.getCurrentNode()),cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("element_clicked"),cvox.AbstractTts.QUEUE_MODE_FLUSH,cvox.AbstractTts.PERSONALITY_ANNOTATION),a=cvox.ChromeVox.navigationManager.getCurrentNode(),cvox.DomUtil.clickElem(a,
!1,!0),!1;cvox.ChromeVoxEventWatcher.addEvent(a);return cvox.ChromeVoxUserCommands.wasMouseClicked=!0};
-cvox.ChromeVoxEventWatcher.mouseOverEventWatcher=function(a){if(!cvox.ChromeVoxEventWatcher.focusFollowsMouse||cvox.DomUtil.isDescendantOfNode(cvox.ChromeVoxEventWatcher.announcedMouseOverNode,a.target)||a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode)return!0;cvox.ChromeVoxEventWatcher.pendingMouseOverNode=a.target;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null);if(a.target.tagName&&
-"BODY"==a.target.tagName)return cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.announcedMouseOverNode=null,!0;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=window.setTimeout(function(){cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null;if(a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode){cvox.ChromeVox.navigationManager.stopReading(!0);var b=a.target;cvox.Focuser.setFocus(b);cvox.ApiImplementation.syncToNode(b,!0,cvox.AbstractTts.QUEUE_MODE_FLUSH);cvox.ChromeVoxEventWatcher.announcedMouseOverNode=
-b}},cvox.ChromeVoxEventWatcher.mouseoverDelayMs);return!0};cvox.ChromeVoxEventWatcher.mouseOutEventWatcher=function(a){a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode&&(cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null));return!0};
+cvox.ChromeVoxEventWatcher.mouseOverEventWatcher=function(a){var b="ontouchstart"in window,c=cvox.ChromeVoxEventWatcher.mouseoverDelayMs;if(b)c=0;else if(!cvox.ChromeVoxEventWatcher.focusFollowsMouse)return!0;if(cvox.DomUtil.isDescendantOfNode(cvox.ChromeVoxEventWatcher.announcedMouseOverNode,a.target)||a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode)return!0;cvox.ChromeVoxEventWatcher.pendingMouseOverNode=a.target;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),
+cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null);if(a.target.tagName&&"BODY"==a.target.tagName)return cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.announcedMouseOverNode=null,!0;cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=window.setTimeout(function(){cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null;if(a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode){cvox.ChromeVox.navigationManager.stopReading(!0);var b=a.target;cvox.Focuser.setFocus(b);cvox.ApiImplementation.syncToNode(b,
+!0,cvox.AbstractTts.QUEUE_MODE_FLUSH);cvox.ChromeVoxEventWatcher.announcedMouseOverNode=b}},c);return!0};cvox.ChromeVoxEventWatcher.mouseOutEventWatcher=function(a){a.target==cvox.ChromeVoxEventWatcher.pendingMouseOverNode&&(cvox.ChromeVoxEventWatcher.pendingMouseOverNode=null,cvox.ChromeVoxEventWatcher.mouseOverTimeoutId&&(window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId),cvox.ChromeVoxEventWatcher.mouseOverTimeoutId=null));return!0};
cvox.ChromeVoxEventWatcher.focusEventWatcher=function(a){cvox.ChromeVoxUserCommands.removeTabDummySpan();cvox.ChromeVoxEventSuspender.areEventsSuspended()?a.target&&a.target.nodeType==Node.ELEMENT_NODE&&cvox.ChromeVoxEventWatcher.setLastFocusedNode_(a.target):cvox.ChromeVoxEventWatcher.addEvent(a);return!0};
cvox.ChromeVoxEventWatcher.focusHandler=function(a){if(a.target&&a.target.hasAttribute&&"true"==a.target.getAttribute("aria-hidden")&&"true"!=a.target.getAttribute("chromevoxignoreariahidden"))cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null),cvox.ChromeVoxEventWatcher.setUpTextHandler();else if(a.target&&a.target!=window){var b=a.target,c=cvox.DomUtil.getSurroundingControl(b);if(c&&c==cvox.ChromeVoxEventWatcher.lastFocusedNode)cvox.ChromeVoxEventWatcher.handleControlChanged(b);else{c?cvox.ChromeVoxEventWatcher.setLastFocusedNode_(c):
cvox.ChromeVoxEventWatcher.setLastFocusedNode_(b);c=cvox.ChromeVoxEventWatcher.queueMode_();if(cvox.ChromeVoxEventWatcher.getInitialVisibility()||cvox.ChromeVoxEventWatcher.handleDialogFocus(b))c=cvox.AbstractTts.QUEUE_MODE_QUEUE;cvox.ChromeVox.navigationManager.clearPageSel(!0)&&(c=cvox.AbstractTts.QUEUE_MODE_QUEUE);cvox.ApiImplementation.syncToNode(b,!document.webkitHidden,c);if(a.target.constructor==HTMLVideoElement||a.target.constructor==HTMLAudioElement)cvox.ChromeVoxEventWatcher.setUpMediaHandler_();
else{if(a.target.hasAttribute)switch(a=a.target.getAttribute("type"),a){case "time":cvox.ChromeVoxEventWatcher.setUpTimeHandler_();return;case "date":case "month":case "week":cvox.ChromeVoxEventWatcher.setUpDateHandler_();return}cvox.ChromeVoxEventWatcher.setUpTextHandler()}}}else cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null)};
cvox.ChromeVoxEventWatcher.blurEventWatcher=function(a){window.setTimeout(function(){document.activeElement||(cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null),cvox.ChromeVoxEventWatcher.addEvent(a))},0);return!0};
-cvox.ChromeVoxEventWatcher.keyDownEventWatcher=function(a){if(cvox.ChromeVox.passThroughMode)return!0;cvox.ChromeVox.isChromeOS&&91==a.keyCode&&(cvox.ChromeVox.searchKeyHeld=!0);a.searchKeyHeld=cvox.ChromeVox.searchKeyHeld&&cvox.ChromeVox.isActive;a.stickyMode=cvox.ChromeVox.isStickyOn&&cvox.ChromeVox.isActive;a.keyPrefix=cvox.ChromeVox.keyPrefixOn&&cvox.ChromeVox.isActive;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVoxEventWatcher.eventToEat=null;if(!cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(a)||
+cvox.ChromeVoxEventWatcher.keyDownEventWatcher=function(a){if(cvox.ChromeVox.passThroughMode)return!0;cvox.ChromeVox.isChromeOS&&91==a.keyCode&&(cvox.ChromeVox.searchKeyHeld=!0);a.searchKeyHeld=cvox.ChromeVox.searchKeyHeld&&cvox.ChromeVox.isActive;a.stickyMode=cvox.ChromeVox.isStickyModeOn()&&cvox.ChromeVox.isActive;a.keyPrefix=cvox.ChromeVox.keyPrefixOn&&cvox.ChromeVox.isActive;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVoxEventWatcher.eventToEat=null;if(!cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(a)||
cvox.ChromeVoxEventWatcher.handleControlAction(a))return a.preventDefault(),a.stopPropagation(),cvox.ChromeVoxEventWatcher.eventToEat=a,!1;cvox.ChromeVoxEventWatcher.addEvent(a);return!0};
cvox.ChromeVoxEventWatcher.keyUpEventWatcher=function(a){91==a.keyCode&&(cvox.ChromeVox.searchKeyHeld=!1);if(cvox.ChromeVox.passThroughMode)return a.ctrlKey||a.altKey||a.metaKey||a.shiftKey||cvox.ChromeVox.searchKeyHeld||(this.secondPassThroughKeyUp_?(this.secondPassThroughKeyUp_=!1,cvox.ChromeVox.passThroughMode=!1):this.secondPassThroughKeyUp_=!0),!0;if(cvox.ChromeVoxEventWatcher.eventToEat&&a.keyCode==cvox.ChromeVoxEventWatcher.eventToEat.keyCode)return a.stopPropagation(),a.preventDefault(),!1;
cvox.ChromeVoxEventWatcher.addEvent(a);return!0};
@@ -1510,7 +1511,7 @@ cvox.ChromeVoxEventWatcherUtil.shouldWaitToProcess=function(a,b,c){a=c-a;b=c-b;r
cvox.ChromeVoxEventWatcher.processQueue_=function(){if(0!=cvox.ChromeVoxEventWatcher.events_.length){var a=cvox.ChromeVoxEventWatcher.events_,b=-1,c=0,d,e;for(e=0;d=a[e];e++)"focus"==d.type&&(b=e,c=d.timeStamp);cvox.ChromeVoxEventWatcher.events_=[];for(e=0;d=a[e];e++){var f=a[e-1]||{};!(e>=b||"LiveRegion"==d.type||"DOMSubtreeModified"==d.type)||"focus"==f.type&&"change"==d.type||cvox.ChromeVoxEventWatcher.events_.push(d)}cvox.ChromeVoxEventWatcher.events_.sort(function(a,b){return"LiveRegion"!=b.type&&
"LiveRegion"==a.type||"DOMSubtreeModified"!=b.type&&"DOMSubtreeModified"==a.type?1:-1});a=(new Date).getTime();if(0<=b&&cvox.ChromeVoxEventWatcherUtil.shouldWaitToProcess(c,cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime,a))window.setTimeout(cvox.ChromeVoxEventWatcher.processQueue_,cvox.ChromeVoxEventWatcher.WAIT_TIME_MS_);else{for(e=0;d=cvox.ChromeVoxEventWatcher.events_[e];e++)cvox.ChromeVoxEventWatcher.handleEvent_(d),cvox.ChromeVoxEventWatcher.processing_=!0;cvox.ChromeVoxEventWatcher.processing_=
!1;cvox.ChromeVoxEventWatcher.events_=[];cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime=-1;cvox.ChromeVoxEventWatcher.queueProcessingScheduled_=!1;cvox.ChromeVoxEventWatcher.maybeCallReadyCallbacks_()}}};
-cvox.ChromeVoxEventWatcher.handleEvent_=function(a){switch(a.type){case "keydown":cvox.ChromeVoxEventWatcher.setUpTextHandler();if(cvox.ChromeVoxEventWatcher.currentTextControl&&(cvox.ChromeVoxEventWatcher.handleTextChanged(!0),(a=cvox.ChromeVoxEventWatcher.currentTextHandler)&&a.lastChangeDescribed))break;cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keyup":cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keypress":cvox.ChromeVoxEventWatcher.setUpTextHandler();
+cvox.ChromeVoxEventWatcher.handleEvent_=function(a){switch(a.type){case "keydown":case "input":cvox.ChromeVoxEventWatcher.setUpTextHandler();if(cvox.ChromeVoxEventWatcher.currentTextControl&&(cvox.ChromeVoxEventWatcher.handleTextChanged(!0),(a=cvox.ChromeVoxEventWatcher.currentTextHandler)&&a.lastChangeDescribed))break;cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keyup":cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement);break;case "keypress":cvox.ChromeVoxEventWatcher.setUpTextHandler();
break;case "click":cvox.ApiImplementation.syncToNode(a.target,!0);break;case "focus":cvox.ChromeVoxEventWatcher.focusHandler(a);break;case "blur":cvox.ChromeVoxEventWatcher.setUpTextHandler();break;case "change":cvox.ChromeVoxEventWatcher.changeHandler(a);break;case "select":cvox.ChromeVoxEventWatcher.setUpTextHandler();break;case "LiveRegion":cvox.ChromeVoxEventWatcher.speakLiveRegion_(a.assertive,a.navDescriptions);break;case "DOMSubtreeModified":cvox.ChromeVoxEventWatcher.subtreeModifiedHandler(a)}};
cvox.ChromeVoxEventWatcher.setUpTimeHandler_=function(){var a=document.activeElement;a&&a.hasAttribute&&"true"==a.getAttribute("aria-hidden")&&"true"!=a.getAttribute("chromevoxignoreariahidden")&&(a=null);cvox.ChromeVoxEventWatcher.currentTimeHandler=a.constructor==HTMLInputElement&&a.type&&"time"==a.type?new cvox.ChromeVoxHTMLTimeWidget(a,cvox.ChromeVox.tts):null;return null!=cvox.ChromeVoxEventWatcher.currentTimeHandler};
cvox.ChromeVoxEventWatcher.setUpMediaHandler_=function(){var a=document.activeElement;a&&a.hasAttribute&&"true"==a.getAttribute("aria-hidden")&&"true"!=a.getAttribute("chromevoxignoreariahidden")&&(a=null);cvox.ChromeVoxEventWatcher.currentMediaHandler=a.constructor==HTMLVideoElement||a.constructor==HTMLAudioElement?new cvox.ChromeVoxHTMLMediaWidget(a,cvox.ChromeVox.tts):null;return null!=cvox.ChromeVoxEventWatcher.currentMediaHandler};
@@ -1555,18 +1556,19 @@ cvox.SearchContextMenu.focusAds=function(){cvox.Search.populateAdResults();0===c
cvox.SearchContextMenu.init=function(){var a=[{desc:"Main Results",cmd:Command.MAIN},{desc:"Search Tools",cmd:Command.TOOLS},{desc:"Ads",cmd:Command.ADS}],b=document.querySelector("body");b.setAttribute("contextMenuActions",JSON.stringify(a));b.addEventListener("ATCustomEvent",cvox.SearchContextMenu.contextMenuHandler,!0);window.addEventListener("keydown",cvox.SearchContextMenu.keyhandler,!0);cvox.Search.init()};cvox.SearchLoader=function(){};cvox.SearchLoader.onReadyStateChange=function(){"complete"===document.readyState&&"www.google.com"===window.location.host&&"/search"===window.location.pathname&&cvox.SearchContextMenu.init()};cvox.SearchLoader.init=function(){if("complete"!==document.readyState)document.onreadystatechange=cvox.SearchLoader.onReadyStateChange;else cvox.SearchLoader.onReadyStateChange()};cvox.ChromeHost=function(){this.gotPrefsAtLeastOnce_=!1};goog.inherits(cvox.ChromeHost,cvox.AbstractHost);
cvox.ChromeHost.prototype.init=function(){var a=this,b=function(b){b.history&&(cvox.ChromeVox.visitedUrls=b.history);b.keyBindings&&cvox.ChromeVoxKbHandler.loadKeyToFunctionsTable(b.keyBindings);if(b.prefs){b=b.prefs;cvox.ChromeVoxEditableTextBase.useIBeamCursor="true"==b.useIBeamCursor;cvox.ChromeVoxEditableTextBase.eventTypingEcho=!0;cvox.ChromeVoxEventWatcher.focusFollowsMouse="true"==b.focusFollowsMouse;cvox.ChromeVox.version=b.version;cvox.ChromeVox.earcons.enabled=JSON.parse(b.earcons);cvox.ChromeVox.typingEcho=
JSON.parse(b.typingEcho);b.position&&(cvox.ChromeVox.position=JSON.parse(b.position));"undefined"!=b.granularity&&cvox.ChromeVox.navigationManager.setGranularity(JSON.parse(b.granularity));a.activateOrDeactivateChromeVox("true"==b.active);a.activateOrDeactivateStickyMode("true"==b.sticky);a.gotPrefsAtLeastOnce_||cvox.InitialSpeech.speak();a.gotPrefsAtLeastOnce_=!0;cvox.ChromeVox.verbosity="false"==b.useVerboseMode?cvox.VERBOSITY_BRIEF:cvox.VERBOSITY_VERBOSE;b.cvoxKey&&(cvox.ChromeVox.modKeyStr=b.cvoxKey);
-var d=b.siteSpecificScriptLoader!=cvox.ApiImplementation.siteSpecificScriptLoader||b.siteSpecificScriptBase!=cvox.ApiImplementation.siteSpecificScriptBase;cvox.ApiImplementation.siteSpecificScriptLoader=b.siteSpecificScriptLoader;cvox.ApiImplementation.siteSpecificScriptBase=b.siteSpecificScriptBase;d&&(d="true"===b.siteSpecificEnhancements?cvox.SearchLoader.init:null,cvox.ApiImplementation.init(d));cvox.BrailleOverlayWidget.getInstance().setActive("true"==b.brailleCaptions)}};cvox.ExtensionBridge.addMessageListener(b);
+var d=b.siteSpecificScriptLoader!=cvox.ApiImplementation.siteSpecificScriptLoader||b.siteSpecificScriptBase!=cvox.ApiImplementation.siteSpecificScriptBase;cvox.ApiImplementation.siteSpecificScriptLoader=b.siteSpecificScriptLoader;cvox.ApiImplementation.siteSpecificScriptBase=b.siteSpecificScriptBase;d&&(d="true"===b.siteSpecificEnhancements?cvox.SearchLoader.init:void 0,cvox.ApiImplementation.init(d));cvox.BrailleOverlayWidget.getInstance().setActive("true"==b.brailleCaptions)}};cvox.ExtensionBridge.addMessageListener(b);
cvox.ExtensionBridge.addMessageListener(function(a){"DOMAINS_STYLES"==a.message&&cvox.TraverseMath.getInstance().addDomainsAndStyles(a.domains,a.styles)});cvox.ExtensionBridge.addMessageListener(function(a){var b=a.message;"USER_COMMAND"==b&&(b=a.command,cvox.ChromeVoxUserCommands.commands[b](a))});cvox.ExtensionBridge.send({target:"Prefs",action:"getPrefs"});cvox.ExtensionBridge.send({target:"Data",action:"getHistory"})};cvox.ChromeHost.prototype.reinit=function(){cvox.ExtensionBridge.init()};
cvox.ChromeHost.prototype.onPageLoad=function(){cvox.PdfProcessor.processEmbeddedPdfs();cvox.ExtensionBridge.addDisconnectListener(goog.bind(function(){cvox.ChromeVox.isActive=!1;cvox.ChromeVoxEventWatcher.cleanup(window);cvox.ChromeVox.navigationManager.reset()},this))};cvox.ChromeHost.prototype.sendToBackgroundPage=function(a){cvox.ExtensionBridge.send(a)};cvox.ChromeHost.prototype.getApiSrc=function(){return this.getFileSrc("chromevox/injected/api.js")};cvox.ChromeHost.prototype.getFileSrc=function(a){return window.chrome.extension.getURL(a)};
-cvox.ChromeHost.prototype.killChromeVox=function(){cvox.ChromeHost.superClass_.killChromeVox.call(this);cvox.ExtensionBridge.removeMessageListeners()};cvox.ChromeHost.prototype.activateOrDeactivateStickyMode=function(a){cvox.ChromeVox.isStickyOn=a};cvox.HostFactory.hostConstructor=cvox.ChromeHost;cvox.ChromeMathJax=function(){this.port=null;this.nextCallbackId_=1;this.callbackMap_={};this.texNodeId_=0;this.init()};goog.inherits(cvox.ChromeMathJax,cvox.AbstractMathJax);cvox.ChromeMathJax.prototype.registerCallback_=function(a){var b=this.nextCallbackId_;this.nextCallbackId_++;this.callbackMap_[b]=a;return b};cvox.ChromeMathJax.prototype.retrieveCallback_=function(a){a=parseInt(a,10);return(a=this.callbackMap_[a])?a:null};
-cvox.ChromeMathJax.prototype.init=function(){window.addEventListener("message",goog.bind(this.portSetup,this),!0);var a=[];a.push(cvox.ChromeVox.host.getFileSrc("chromevox/injected/mathjax_external_util.js"));a.push(cvox.ChromeVox.host.getFileSrc("chromevox/injected/mathjax.js"));a.push(cvox.ApiImplementation.siteSpecificScriptLoader);cvox.ScriptInstaller.installScript(a,"mathjax",null,cvox.ApiImplementation.siteSpecificScriptBase)};
+cvox.ChromeHost.prototype.killChromeVox=function(){cvox.ChromeHost.superClass_.killChromeVox.call(this);cvox.ExtensionBridge.removeMessageListeners()};cvox.ChromeHost.prototype.activateOrDeactivateStickyMode=function(a){cvox.ChromeVox.isStickyPrefOn=a};cvox.HostFactory.hostConstructor=cvox.ChromeHost;cvox.ChromeMathJax=function(){this.port=null;this.nextCallbackId_=1;this.callbackMap_={};this.texNodeId_=0;this.init()};goog.inherits(cvox.ChromeMathJax,cvox.AbstractMathJax);cvox.ChromeMathJax.prototype.registerCallback_=function(a){var b=this.nextCallbackId_;this.nextCallbackId_++;this.callbackMap_[b]=a;return b};cvox.ChromeMathJax.prototype.retrieveCallback_=function(a){a=parseInt(a,10);return(a=this.callbackMap_[a])?a:null};
+cvox.ChromeMathJax.prototype.init=function(){window.addEventListener("message",goog.bind(this.portSetup,this),!0);var a=[];a.push(cvox.ChromeVox.host.getFileSrc("chromevox/injected/mathjax_external_util.js"));a.push(cvox.ChromeVox.host.getFileSrc("chromevox/injected/mathjax.js"));a.push(cvox.ApiImplementation.siteSpecificScriptLoader);cvox.ScriptInstaller.installScript(a,"mathjax",void 0,cvox.ApiImplementation.siteSpecificScriptBase)};
cvox.ChromeMathJax.prototype.postMsg=function(a,b,c){c=c||{};b=this.registerCallback_(b);b=b.toString();this.port.postMessage({cmd:a,id:b,args:c})};cvox.ChromeMathJax.prototype.portSetup=function(a){return"cvox.MathJaxPortSetup"==a.data?(this.port=a.ports[0],this.port.onmessage=goog.bind(function(a){this.dispatchMessage(a.data)},this),!1):!0};
cvox.ChromeMathJax.prototype.dispatchMessage=function(a){var b,c=[];switch(a.cmd){case "NodeMml":b=this.convertMarkupToDom;c=["mathml","elementId"];break;case "Active":b=this.applyBoolean,c=["status"]}if(!b)throw"Unknown MathJax call: "+a.cmd;var d=this.retrieveCallback_(a.id),e=a.args;d&&b&&b.apply(this,[d].concat(c.map(function(a){return e[a]})))};cvox.ChromeMathJax.prototype.applyBoolean=function(a,b){a(b)};
cvox.ChromeMathJax.prototype.isMathjaxActive=function(a){var b=0,c=goog.bind(function(){b++;try{this.postMsg("Active",function(d){d?a(d):5>b&&setTimeout(c,1E3)})}catch(d){if(5>b)setTimeout(c,1E3);else throw d;}},this);c()};cvox.ChromeMathJax.prototype.getAllJax=function(a){this.postMsg("AllJax",a)};cvox.ChromeMathJax.prototype.registerSignal=function(a,b){this.postMsg("RegSig",a,{sig:b})};
cvox.ChromeMathJax.prototype.injectScripts=function(){var a=0,b=goog.bind(function(){a++;this.port?this.postMsg("InjectScripts",function(){}):10>a&&setTimeout(b,500)},this);b()};cvox.ChromeMathJax.prototype.configMediaWiki=function(){this.postMsg("ConfWikipedia",function(){})};cvox.ChromeMathJax.prototype.getTex=function(a,b){var c=b.alt||b.title;if(c){var d="cvoxId-"+this.texNodeId_++;b.setAttribute("cvoxId",d);this.postMsg("TexToMml",a,{alt:c,id:d})}};
cvox.ChromeMathJax.prototype.getAsciiMath=function(a,b){var c=b.alt||b.title;if(c){var d="cvoxId-"+this.texNodeId_++;b.setAttribute("cvoxId",d);this.postMsg("AsciiMathToMml",a,{alt:c,id:d})}};cvox.HostFactory.mathJaxConstructor=cvox.ChromeMathJax;cvox.ChromeMsgs=function(){};goog.inherits(cvox.ChromeMsgs,cvox.AbstractMsgs);cvox.ChromeMsgs.NAMESPACE_="chromevox_";cvox.ChromeMsgs.prototype.getMsg=function(a,b){var c=chrome.i18n.getMessage(cvox.ChromeMsgs.NAMESPACE_+a,b);if(void 0==c||""==c)throw Error("Invalid ChromeVox message id: "+a);return c};cvox.ChromeMsgs.prototype.getNumber=function(a){return""+a};cvox.HostFactory.msgsConstructor=cvox.ChromeMsgs;cvox.ChromeTtsBase=function(){cvox.AbstractTts.call(this);this.propertyDefault.pitch=1;this.propertyMin.pitch=.2;this.propertyMax.pitch=2;this.propertyDefault.rate=1;this.propertyMin.rate=.2;this.propertyMax.rate=5;this.propertyDefault.volume=1;this.propertyMin.volume=.2;this.propertyMax.volume=1};goog.inherits(cvox.ChromeTtsBase,cvox.AbstractTts);cvox.ChromeTts=function(){cvox.ChromeTtsBase.call(this);this.addBridgeListener()};goog.inherits(cvox.ChromeTts,cvox.ChromeTtsBase);cvox.ChromeTts.callId=1;cvox.ChromeTts.functionMap={};cvox.ChromeTts.prototype.speak=function(a,b,c){c||(c={});cvox.ChromeTts.superClass_.speak.call(this,a,b,c);cvox.ExtensionBridge.send(this.createMessageForProperties_(a,b,c))};cvox.ChromeTts.prototype.isSpeaking=function(){cvox.ChromeTts.superClass_.isSpeaking.call(this);return!1};
cvox.ChromeTts.prototype.stop=function(){cvox.ChromeTts.superClass_.stop.call(this);cvox.ExtensionBridge.send({target:"TTS",action:"stop"})};cvox.ChromeTts.prototype.increaseOrDecreaseProperty=function(a,b){cvox.ExtensionBridge.send({target:"TTS",action:"increaseOrDecrease",property:a,increase:b})};cvox.ChromeTts.prototype.addBridgeListener=function(){cvox.ExtensionBridge.addMessageListener(function(a){var b=a.message;"TTS_CALLBACK"==b&&(a=a.id,b=cvox.ChromeTts.functionMap[a],void 0!=b&&(b(),delete cvox.ChromeTts.functionMap[a]))})};
-cvox.ChromeTts.prototype.createMessageForProperties_=function(a,b,c){a={target:"TTS",action:"speak",text:a,queueMode:b,properties:c};void 0!=c.startCallback&&(cvox.ChromeTts.functionMap[cvox.ChromeTts.callId]=c.startCallback,a.startCallbackId=cvox.ChromeTts.callId++);void 0!=c.endCallback&&(cvox.ChromeTts.functionMap[cvox.ChromeTts.callId]=c.endCallback,a.endCallbackId=cvox.ChromeTts.callId++);return a};cvox.HostFactory.ttsConstructor=cvox.ChromeTts;cvox.Serializer=function(){};cvox.Serializer.prototype.storeOn=function(a){cvox.ChromeVox.storeOn(a);cvox.ChromeVoxEventWatcher.storeOn(a)};cvox.Serializer.prototype.readFrom=function(a){cvox.ChromeVox.readFrom(a);cvox.ChromeVoxEventWatcher.readFrom(a)};cvox.InitGlobals=function(){};
+cvox.ChromeTts.prototype.createMessageForProperties_=function(a,b,c){a={target:"TTS",action:"speak",text:a,queueMode:b,properties:c};void 0!=c.startCallback&&(cvox.ChromeTts.functionMap[cvox.ChromeTts.callId]=c.startCallback,a.startCallbackId=cvox.ChromeTts.callId++);void 0!=c.endCallback&&(cvox.ChromeTts.functionMap[cvox.ChromeTts.callId]=c.endCallback,a.endCallbackId=cvox.ChromeTts.callId++);return a};cvox.HostFactory.ttsConstructor=cvox.ChromeTts;cvox.CompositeTts=function(){this.ttsEngines_=[]};cvox.CompositeTts.prototype.add=function(a){this.ttsEngines_.push(a);return this};cvox.CompositeTts.prototype.speak=function(a,b,c){this.ttsEngines_.forEach(function(d){d.speak(a,b,c)})};cvox.CompositeTts.prototype.isSpeaking=function(){return this.ttsEngines_.some(function(a){return a.isSpeaking()})};cvox.CompositeTts.prototype.stop=function(){this.ttsEngines_.forEach(function(a){a.stop()})};
+cvox.CompositeTts.prototype.increaseOrDecreaseProperty=function(a,b){this.ttsEngines_.forEach(function(c){c.increaseOrDecreaseProperty(a,b)})};cvox.CompositeTts.prototype.getDefaultProperty=function(a){for(var b=0,c;c=this.ttsEngines_[b];b++)if(c=c.getDefaultProperty(a))return c};cvox.Serializer=function(){};cvox.Serializer.prototype.storeOn=function(a){cvox.ChromeVox.storeOn(a);cvox.ChromeVoxEventWatcher.storeOn(a)};cvox.Serializer.prototype.readFrom=function(a){cvox.ChromeVox.readFrom(a);cvox.ChromeVoxEventWatcher.readFrom(a)};cvox.InitGlobals=function(){};
cvox.InitGlobals.initGlobals=function(){cvox.ChromeVox.host||(cvox.ChromeVox.host=cvox.HostFactory.getHost());cvox.ChromeVox.tts=(new cvox.CompositeTts).add(cvox.HostFactory.getTts()).add(cvox.History.getInstance()).add(cvox.ConsoleTts.getInstance());cvox.ChromeVox.braille||(cvox.ChromeVox.braille=cvox.HostFactory.getBraille());cvox.ChromeVox.mathJax=cvox.HostFactory.getMathJax();cvox.ChromeVox.earcons=cvox.HostFactory.getEarcons();cvox.ChromeVox.msgs=cvox.HostFactory.getMsgs();cvox.ChromeVox.isActive=
!0;cvox.ChromeVox.navigationManager=new cvox.NavigationManager;cvox.ChromeVox.navigationManager.updateIndicator();cvox.ChromeVox.syncToNode=cvox.ApiImplementation.syncToNode;cvox.ChromeVox.speakNode=cvox.ApiImplementation.speakNode;cvox.ChromeVox.serializer=new cvox.Serializer;cvox.ChromeVox.host.init();cvox.ChromeVoxEventWatcher.init(window);cvox.ChromeVox.executeUserCommand=function(a){cvox.ChromeVoxUserCommands.commands[a]()};cvox.ChromeVox.host.onPageLoad()};cvox.ChromeVoxInit={};cvox.ChromeVox.initTimeout_=100;cvox.ChromeVox.recallInit_=function(a){window.console.log(a+" Will try again in "+cvox.ChromeVox.initTimeout_+"ms");window.setTimeout(cvox.ChromeVox.initDocument,cvox.ChromeVox.initTimeout_);cvox.ChromeVox.initTimeout_*=2};
cvox.ChromeVox.initDocument=function(){document.body?(cvox.ChromeVox.host=cvox.HostFactory.getHost(),cvox.ChromeVox.host.ttsLoaded()?(window.console.log("Starting ChromeVox."),cvox.InitGlobals.initGlobals(),window.disableChromeVox=function(){cvox.ChromeVox.host.killChromeVox()}):cvox.ChromeVox.recallInit_("ChromeVox not starting; waiting for TTS. "+document.location.href+".")):cvox.ChromeVox.recallInit_("ChromeVox not starting on unloaded page: "+document.location.href+".")};
diff --git a/chrome/third_party/chromevox/chromeVoxKbExplorerScript.js b/chrome/third_party/chromevox/chromeVoxKbExplorerScript.js
index c639a02..3fe46e1 100644
--- a/chrome/third_party/chromevox/chromeVoxKbExplorerScript.js
+++ b/chrome/third_party/chromevox/chromeVoxKbExplorerScript.js
@@ -1,5 +1,5 @@
var goog=goog||{};goog.global=this;goog.isDef=function(a){return void 0!==a};goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&goog.isDef(b)?c[d]=b:c=c[d]?c[d]:c[d]={}};goog.define=function(a,b){var c=b;goog.exportPath_(a,c)};goog.DEBUG=!1;goog.LOCALE="en";goog.TRUSTED_SITE=!0;goog.STRICT_MODE_COMPATIBLE=!1;goog.provide=function(a){goog.exportPath_(a)};
-goog.setTestOnly=function(a){if(!goog.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+a?": "+a:".");};goog.forwardDeclare=function(){};goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
+goog.setTestOnly=function(a){if(!goog.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+(a?": "+a:"."));};goog.forwardDeclare=function(){};goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
goog.addDependency=function(a,b,c){if(goog.DEPENDENCIES_ENABLED){var d;a=a.replace(/\\/g,"/");for(var e=goog.dependencies_,h=0;d=b[h];h++)e.nameToPath[d]=a,a in e.pathToNames||(e.pathToNames[a]={}),e.pathToNames[a][d]=!0;for(d=0;b=c[d];d++)a in e.requires||(e.requires[a]={}),e.requires[a][b]=!0}};goog.useStrictRequires=!1;goog.ENABLE_DEBUG_LOADER=!0;goog.require=function(){};goog.basePath="";goog.nullFunction=function(){};goog.identityFunction=function(a){return a};
goog.abstractMethod=function(){throw Error("unimplemented abstract method");};goog.addSingletonGetter=function(a){a.getInstance=function(){if(a.instance_)return a.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=a);return a.instance_=new a}};goog.instantiatedSingletons_=[];goog.DEPENDENCIES_ENABLED=!1;
goog.DEPENDENCIES_ENABLED&&(goog.included_={},goog.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}},goog.inHtmlDocument_=function(){var a=goog.global.document;return"undefined"!=typeof a&&"write"in a},goog.findBasePath_=function(){if(goog.global.CLOSURE_BASE_PATH)goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var a=goog.global.document,a=a.getElementsByTagName("script"),b=a.length-1;0<=b;--b){var c=a[b].src,d=c.lastIndexOf("?"),d=-1==d?
@@ -19,9 +19,11 @@ goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=
goog.base=function(a,b,c){var d=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!d)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(d.superClass_)return d.superClass_.constructor.apply(a,Array.prototype.slice.call(arguments,1));for(var e=Array.prototype.slice.call(arguments,2),h=!1,f=a.constructor;f;f=f.superClass_&&f.superClass_.constructor)if(f.prototype[b]===d)h=!0;else if(h)return f.prototype[b].apply(a,
e);if(a[b]===d)return a.constructor.prototype[b].apply(a,e);throw Error("goog.base called from a method of one name to a method of a different name");};goog.scope=function(a){a.call(goog.global)};goog.MODIFY_FUNCTION_PROTOTYPES=!0;
goog.MODIFY_FUNCTION_PROTOTYPES&&(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 goog.bind.apply(null,c)}return goog.bind(this,a)},Function.prototype.partial=function(a){var b=Array.prototype.slice.call(arguments);b.unshift(this,null);return goog.bind.apply(null,b)},Function.prototype.inherits=function(a){goog.inherits(this,a)},Function.prototype.mixin=function(a){goog.mixin(this.prototype,
-a)});var cvox={VERBOSITY_VERBOSE:0,VERBOSITY_BRIEF:1,ChromeVox:function(){}};cvox.ChromeVox.host=null;cvox.ChromeVox.msgs=null;cvox.ChromeVox.isActive=!0;cvox.ChromeVox.version=null;cvox.ChromeVox.earcons=null;cvox.ChromeVox.navigationManager=null;cvox.ChromeVox.serializer=null;cvox.ChromeVox.isStickyOn=!1;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVox.verbosity=cvox.VERBOSITY_VERBOSE;cvox.ChromeVox.typingEcho=0;cvox.ChromeVox.keyEcho={};cvox.ChromeVox.position={};cvox.ChromeVox.isChromeOS=-1!=navigator.userAgent.indexOf("CrOS");
-cvox.ChromeVox.isMac=-1!=navigator.platform.indexOf("Mac");cvox.ChromeVox.modKeyStr=cvox.ChromeVox.isChromeOS?"Shift+Search":cvox.ChromeVox.isMac?"Ctrl+Cmd":"Shift+Alt";cvox.ChromeVox.sequenceSwitchKeyCodes=[];cvox.ChromeVox.visitedUrls={};cvox.ChromeVox.markInUserCommand=function(){};cvox.ChromeVox.syncToNode=function(){};cvox.ChromeVox.speakNode=function(){};cvox.ChromeVox.executeUserCommand=function(){};cvox.ChromeVox.entireDocumentIsHidden=!1;
-cvox.ChromeVox.storeOn=function(a){a.isStickyOn=cvox.ChromeVox.isStickyOn;cvox.ChromeVox.navigationManager.storeOn(a)};cvox.ChromeVox.readFrom=function(a){cvox.ChromeVox.isStickyOn=a.isStickyOn;cvox.ChromeVox.navigationManager.readFrom(a)};cvox.KeySequence=function(a,b,c,d){this.doubleTap=!!d;this.cvoxModifier=void 0==b?this.isCVoxModifierActive(a):b;this.stickyMode=!!a.stickyMode;this.prefixKey=!!a.keyPrefix;this.skipStripping=!!c;if(this.stickyMode&&this.prefixKey)throw"Prefix key and sticky mode cannot both be enabled: "+a;a=this.resolveChromeOSSpecialKeys_(a);this.keys={ctrlKey:[],searchKeyHeld:[],altKey:[],altGraphKey:[],shiftKey:[],metaKey:[],keyCode:[]};this.extractKey_(a)};
+a)});goog.defineClass=function(a,b){var c=b.constructor,d=b.statics;if(!c||c==Object.prototype.constructor)throw Error("constructor property is required.");c=goog.defineClass.createSealingConstructor_(c);a&&goog.inherits(c,a);delete b.constructor;delete b.statics;goog.defineClass.applyProperties_(c.prototype,b);null!=d&&(d instanceof Function?d(c):goog.defineClass.applyProperties_(c,d));return c};goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG;
+goog.defineClass.createSealingConstructor_=function(a){if(goog.defineClass.SEAL_CLASS_INSTANCES&&Object.seal instanceof Function){var b=function(){var c=a.apply(this,arguments)||this;this.constructor===b&&Object.seal(c);return c};return b}return a};goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
+goog.defineClass.applyProperties_=function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);for(var d=0;d<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++)c=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d],Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};var cvox={VERBOSITY_VERBOSE:0,VERBOSITY_BRIEF:1,ChromeVox:function(){}};cvox.ChromeVox.host=null;cvox.ChromeVox.msgs=null;cvox.ChromeVox.isActive=!0;cvox.ChromeVox.version=null;cvox.ChromeVox.earcons=null;cvox.ChromeVox.navigationManager=null;cvox.ChromeVox.serializer=null;cvox.ChromeVox.isStickyPrefOn=!1;cvox.ChromeVox.stickyOverride=null;cvox.ChromeVox.keyPrefixOn=!1;cvox.ChromeVox.verbosity=cvox.VERBOSITY_VERBOSE;cvox.ChromeVox.typingEcho=0;cvox.ChromeVox.keyEcho={};cvox.ChromeVox.position={};
+cvox.ChromeVox.isChromeOS=-1!=navigator.userAgent.indexOf("CrOS");cvox.ChromeVox.isMac=-1!=navigator.platform.indexOf("Mac");cvox.ChromeVox.modKeyStr=cvox.ChromeVox.isChromeOS?"Shift+Search":cvox.ChromeVox.isMac?"Ctrl+Cmd":"Shift+Alt";cvox.ChromeVox.sequenceSwitchKeyCodes=[];cvox.ChromeVox.visitedUrls={};cvox.ChromeVox.markInUserCommand=function(){};cvox.ChromeVox.syncToNode=function(){};cvox.ChromeVox.speakNode=function(){};cvox.ChromeVox.executeUserCommand=function(){};
+cvox.ChromeVox.entireDocumentIsHidden=!1;cvox.ChromeVox.storeOn=function(a){a.isStickyPrefOn=cvox.ChromeVox.isStickyPrefOn;cvox.ChromeVox.navigationManager.storeOn(a)};cvox.ChromeVox.readFrom=function(a){cvox.ChromeVox.isStickyPrefOn=a.isStickyPrefOn;cvox.ChromeVox.navigationManager.readFrom(a)};cvox.ChromeVox.isStickyModeOn=function(){return null!==cvox.ChromeVox.stickyOverride?cvox.ChromeVox.stickyOverride:cvox.ChromeVox.isStickyPrefOn};cvox.KeySequence=function(a,b,c,d){this.doubleTap=!!d;this.cvoxModifier=void 0==b?this.isCVoxModifierActive(a):b;this.stickyMode=!!a.stickyMode;this.prefixKey=!!a.keyPrefix;this.skipStripping=!!c;if(this.stickyMode&&this.prefixKey)throw"Prefix key and sticky mode cannot both be enabled: "+a;a=this.resolveChromeOSSpecialKeys_(a);this.keys={ctrlKey:[],searchKeyHeld:[],altKey:[],altGraphKey:[],shiftKey:[],metaKey:[],keyCode:[]};this.extractKey_(a)};
cvox.KeySequence.KEY_PRESS_CODE={39:222,44:188,45:189,46:190,47:191,59:186,91:219,92:220,93:221};cvox.KeySequence.doubleTapCache=[];cvox.KeySequence.prototype.addKeyEvent=function(a){if(1<this.keys.keyCode.length)return!1;this.extractKey_(a);return!0};cvox.KeySequence.prototype.equals=function(a){if(!this.checkKeyEquality_(a)||this.doubleTap!=a.doubleTap)return!1;if(this.cvoxModifier===a.cvoxModifier)return!0;a=this.cvoxModifier?a:this;return a.stickyMode||a.prefixKey};
cvox.KeySequence.prototype.extractKey_=function(a){for(var b in this.keys)if("keyCode"==b){var c;"keypress"==a.type&&97<=a[b]&&122>=a[b]?c=a[b]-32:"keypress"==a.type&&(c=cvox.KeySequence.KEY_PRESS_CODE[a[b]]);this.keys[b].push(c||a[b])}else this.isKeyModifierActive(a,b)?this.keys[b].push(!0):this.keys[b].push(!1);this.cvoxModifier&&this.rationalizeKeys_()};
cvox.KeySequence.prototype.rationalizeKeys_=function(){if(!this.skipStripping){var a=cvox.ChromeVox.modKeyStr.split(/\+/g),b=this.keys.keyCode.length-1;-1!=a.indexOf("Ctrl")&&(this.keys.ctrlKey[b]=!1);-1!=a.indexOf("Alt")&&(this.keys.altKey[b]=!1);-1!=a.indexOf("Shift")&&(this.keys.shiftKey[b]=!1);var c=this.getMetaKeyName_();if(-1!=a.indexOf(c))if("Search"==c)this.keys.searchKeyHeld[b]=!1;else if("Cmd"==c||"Win"==c)this.keys.metaKey[b]=!1}};
diff --git a/chrome/third_party/chromevox/chromevox/injected/mathjax.js b/chrome/third_party/chromevox/chromevox/injected/mathjax.js
index aaa13ad..754aa04 100644
--- a/chrome/third_party/chromevox/chromevox/injected/mathjax.js
+++ b/chrome/third_party/chromevox/chromevox/injected/mathjax.js
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.