Accessibility.AccessibilityNode=class extends SDK.SDKObject{constructor(accessibilityModel,payload){super(accessibilityModel.target());this._accessibilityModel=accessibilityModel;this._agent=accessibilityModel._agent;this._id=payload.nodeId;accessibilityModel._setAXNodeForAXId(this._id,this);if(payload.backendDOMNodeId){accessibilityModel._setAXNodeForBackendDOMNodeId(payload.backendDOMNodeId,this);this._backendDOMNodeId=payload.backendDOMNodeId;this._deferredDOMNode=new SDK.DeferredDOMNode(this.target(),payload.backendDOMNodeId);}else{this._backendDOMNodeId=null;this._deferredDOMNode=null;}
this._ignored=payload.ignored;if(this._ignored&&'ignoredReasons'in payload)
this._ignoredReasons=payload.ignoredReasons;this._role=payload.role||null;this._name=payload.name||null;this._description=payload.description||null;this._value=payload.value||null;this._properties=payload.properties||null;this._childIds=payload.childIds||null;this._parentNode=null;}
ignored(){return this._ignored;}
ignoredReasons(){return this._ignoredReasons||null;}
role(){return this._role||null;}
coreProperties(){var properties=[];if(this._name)
properties.push(({name:'name',value:this._name}));if(this._description){properties.push(({name:'description',value:this._description}));}
if(this._value)
properties.push(({name:'value',value:this._value}));return properties;}
name(){return this._name||null;}
description(){return this._description||null;}
value(){return this._value||null;}
properties(){return this._properties||null;}
parentNode(){return this._parentNode;}
_setParentNode(parentNode){this._parentNode=parentNode;}
isDOMNode(){return!!this._backendDOMNodeId;}
backendDOMNodeId(){return this._backendDOMNodeId;}
deferredDOMNode(){return this._deferredDOMNode;}
highlightDOMNode(){if(!this.isDOMNode())
return;this.deferredDOMNode().resolvePromise().then(node=>{SDK.DOMModel.fromTarget(this.target()).nodeHighlightRequested(node.id);});}
children(){var children=[];if(!this._childIds)
return children;for(var childId of this._childIds){var child=this._accessibilityModel.axNodeForId(childId);if(child)
children.push(child);}
return children;}
numChildren(){if(!this._childIds)
return 0;return this._childIds.length;}
hasOnlyUnloadedChildren(){if(!this._childIds||!this._childIds.length)
return false;return!this._childIds.some(id=>this._accessibilityModel.axNodeForId(id)!==undefined);}
printSelfAndChildren(inspectedNode,leadingSpace){var string=leadingSpace||'';if(this._role)
string+=this._role.value;else
string+='<no role>';string+=(this._name?' '+this._name.value:'');string+=' '+this._id;if(this._domNode)
string+=' ('+this._domNode.nodeName()+')';if(this===inspectedNode)
string+=' *';for(var child of this.children())
string+='\n'+child.printSelfAndChildren(inspectedNode,(leadingSpace||'')+'  ');return string;}};Accessibility.AccessibilityModel=class extends SDK.SDKModel{constructor(target){super(target);this._agent=target.accessibilityAgent();this._axIdToAXNode=new Map();this._backendDOMNodeIdToAXNode=new Map();}
static fromTarget(target){return target.model(Accessibility.AccessibilityModel);}
clear(){this._axIdToAXNode.clear();}
requestPartialAXTree(node){function parsePayload(error,payloads){if(error){console.error('AccessibilityAgent.getAXNodeChain(): '+error);return null;}
if(!payloads)
return;for(var payload of payloads)
new Accessibility.AccessibilityNode(this,payload);for(var axNode of this._axIdToAXNode.values()){for(var axChild of axNode.children())
axChild._setParentNode(axNode);}}
return this._agent.getPartialAXTree(node.id,true,parsePayload.bind(this));}
axNodeForId(axId){return this._axIdToAXNode.get(axId);}
_setAXNodeForAXId(axId,axNode){this._axIdToAXNode.set(axId,axNode);}
axNodeForDOMNode(domNode){if(!domNode)
return null;return this._backendDOMNodeIdToAXNode.get(domNode.backendNodeId());}
_setAXNodeForBackendDOMNodeId(backendDOMNodeId,axNode){this._backendDOMNodeIdToAXNode.set(backendDOMNodeId,axNode);}
logTree(inspectedNode){var rootNode=inspectedNode;while(rootNode.parentNode())
rootNode=rootNode.parentNode();console.log(rootNode.printSelfAndChildren(inspectedNode));}};SDK.SDKModel.register(Accessibility.AccessibilityModel,SDK.Target.Capability.DOM);;Accessibility.AccessibilitySidebarView=class extends UI.ThrottledWidget{constructor(){super();this._node=null;this._axNode=null;this._sidebarPaneStack=UI.viewManager.createStackLocation();this._treeSubPane=new Accessibility.AXTreePane(this);this._sidebarPaneStack.showView(this._treeSubPane);this._ariaSubPane=new Accessibility.ARIAAttributesPane();this._sidebarPaneStack.showView(this._ariaSubPane);this._axNodeSubPane=new Accessibility.AXNodeSubPane();this._sidebarPaneStack.showView(this._axNodeSubPane);this._sidebarPaneStack.widget().show(this.element);UI.context.addFlavorChangeListener(SDK.DOMNode,this._pullNode,this);this._pullNode();}
node(){return this._node;}
setNode(node){this._node=node;this.update();}
accessibilityNodeCallback(axNode){if(!axNode)
return;this._axNode=axNode;if(axNode.ignored())
this._sidebarPaneStack.removeView(this._ariaSubPane);else
this._sidebarPaneStack.showView(this._ariaSubPane,this._axNodeSubPane);if(this._axNodeSubPane)
this._axNodeSubPane.setAXNode(axNode);if(this._treeSubPane)
this._treeSubPane.setAXNode(axNode);}
doUpdate(){var node=this.node();this._treeSubPane.setNode(node);this._axNodeSubPane.setNode(node);this._ariaSubPane.setNode(node);if(!node)
return Promise.resolve();var accessibilityModel=Accessibility.AccessibilityModel.fromTarget(node.target());accessibilityModel.clear();return accessibilityModel.requestPartialAXTree(node).then(()=>{this.accessibilityNodeCallback(accessibilityModel.axNodeForDOMNode(node));});}
wasShown(){super.wasShown();this._treeSubPane.setNode(this.node());this._axNodeSubPane.setNode(this.node());this._ariaSubPane.setNode(this.node());SDK.targetManager.addModelListener(SDK.DOMModel,SDK.DOMModel.Events.AttrModified,this._onAttrChange,this);SDK.targetManager.addModelListener(SDK.DOMModel,SDK.DOMModel.Events.AttrRemoved,this._onAttrChange,this);SDK.targetManager.addModelListener(SDK.DOMModel,SDK.DOMModel.Events.CharacterDataModified,this._onNodeChange,this);SDK.targetManager.addModelListener(SDK.DOMModel,SDK.DOMModel.Events.ChildNodeCountUpdated,this._onNodeChange,this);}
willHide(){SDK.targetManager.removeModelListener(SDK.DOMModel,SDK.DOMModel.Events.AttrModified,this._onAttrChange,this);SDK.targetManager.removeModelListener(SDK.DOMModel,SDK.DOMModel.Events.AttrRemoved,this._onAttrChange,this);SDK.targetManager.removeModelListener(SDK.DOMModel,SDK.DOMModel.Events.CharacterDataModified,this._onNodeChange,this);SDK.targetManager.removeModelListener(SDK.DOMModel,SDK.DOMModel.Events.ChildNodeCountUpdated,this._onNodeChange,this);}
_pullNode(){this.setNode(UI.context.flavor(SDK.DOMNode));}
_onAttrChange(event){if(!this.node())
return;var node=event.data.node;if(this.node()!==node)
return;this.update();}
_onNodeChange(event){if(!this.node())
return;var node=event.data;if(this.node()!==node)
return;this.update();}};Accessibility.AccessibilitySubPane=class extends UI.SimpleView{constructor(name){super(name);this._axNode=null;this.registerRequiredCSS('accessibility/accessibilityNode.css');}
setAXNode(axNode){}
node(){return this._node;}
setNode(node){this._node=node;}
createInfo(textContent,className){var classNameOrDefault=className||'gray-info-message';var info=this.element.createChild('div',classNameOrDefault);info.textContent=textContent;return info;}
createTreeOutline(){var treeOutline=new UI.TreeOutlineInShadow();treeOutline.registerRequiredCSS('accessibility/accessibilityNode.css');treeOutline.registerRequiredCSS('object_ui/objectValue.css');treeOutline.element.classList.add('hidden');this.element.appendChild(treeOutline.element);return treeOutline;}};;Accessibility.AXNodeSubPane=class extends Accessibility.AccessibilitySubPane{constructor(){super(Common.UIString('Computed Properties'));this._noNodeInfo=this.createInfo(Common.UIString('No accessibility node'));this._ignoredInfo=this.createInfo(Common.UIString('Accessibility node not exposed'),'ax-ignored-info hidden');this._treeOutline=this.createTreeOutline();this._ignoredReasonsTree=this.createTreeOutline();this.element.classList.add('accessibility-computed');}
setAXNode(axNode){if(this._axNode===axNode)
return;this._axNode=axNode;var treeOutline=this._treeOutline;treeOutline.removeChildren();var ignoredReasons=this._ignoredReasonsTree;ignoredReasons.removeChildren();if(!axNode){treeOutline.element.classList.add('hidden');this._ignoredInfo.classList.add('hidden');ignoredReasons.element.classList.add('hidden');this._noNodeInfo.classList.remove('hidden');this.element.classList.add('ax-ignored-node-pane');return;}
if(axNode.ignored()){this._noNodeInfo.classList.add('hidden');treeOutline.element.classList.add('hidden');this.element.classList.add('ax-ignored-node-pane');this._ignoredInfo.classList.remove('hidden');ignoredReasons.element.classList.remove('hidden');function addIgnoredReason(property){ignoredReasons.appendChild(new Accessibility.AXNodeIgnoredReasonTreeElement(property,(axNode)));}
var ignoredReasonsArray=(axNode.ignoredReasons());for(var reason of ignoredReasonsArray)
addIgnoredReason(reason);if(!ignoredReasons.firstChild())
ignoredReasons.element.classList.add('hidden');return;}
this.element.classList.remove('ax-ignored-node-pane');this._ignoredInfo.classList.add('hidden');ignoredReasons.element.classList.add('hidden');this._noNodeInfo.classList.add('hidden');treeOutline.element.classList.remove('hidden');function addProperty(property){treeOutline.appendChild(new Accessibility.AXNodePropertyTreePropertyElement(property,(axNode)));}
for(var property of axNode.coreProperties())
addProperty(property);var roleProperty=({name:'role',value:axNode.role()});addProperty(roleProperty);var propertyMap={};var propertiesArray=(axNode.properties());for(var property of propertiesArray)
propertyMap[property.name]=property;for(var propertySet
of[Protocol.Accessibility.AXWidgetAttributes,Protocol.Accessibility.AXWidgetStates,Protocol.Accessibility.AXGlobalStates,Protocol.Accessibility.AXLiveRegionAttributes,Protocol.Accessibility.AXRelationshipAttributes]){for(var propertyKey in propertySet){var property=propertySet[propertyKey];if(property in propertyMap)
addProperty(propertyMap[property]);}}}
setNode(node){super.setNode(node);this._axNode=null;}};Accessibility.AXNodePropertyTreeElement=class extends UI.TreeElement{constructor(axNode){super('');this._axNode=axNode;}
static createSimpleValueElement(type,value){var valueElement;var AXValueType=Protocol.Accessibility.AXValueType;if(!type||type===AXValueType.ValueUndefined||type===AXValueType.ComputedString)
valueElement=createElement('span');else
valueElement=createElementWithClass('span','monospace');var valueText;var isStringProperty=type&&Accessibility.AXNodePropertyTreeElement.StringProperties.has(type);if(isStringProperty){valueText='"'+value.replace(/\n/g,'\u21B5')+'"';valueElement._originalTextContent=value;}else{valueText=String(value);}
if(type&&type in Accessibility.AXNodePropertyTreeElement.TypeStyles)
valueElement.classList.add(Accessibility.AXNodePropertyTreeElement.TypeStyles[type]);valueElement.setTextContentTruncatedIfNeeded(valueText||'');valueElement.title=String(value)||'';return valueElement;}
static createExclamationMark(tooltip){var exclamationElement=createElement('label','dt-icon-label');exclamationElement.type='smallicon-warning';exclamationElement.title=tooltip;return exclamationElement;}
appendNameElement(name){var nameElement=createElement('span');var AXAttributes=Accessibility.AccessibilityStrings.AXAttributes;if(name in AXAttributes){nameElement.textContent=Common.UIString(AXAttributes[name].name);nameElement.title=AXAttributes[name].description;nameElement.classList.add('ax-readable-name');}else{nameElement.textContent=name;nameElement.classList.add('ax-name');nameElement.classList.add('monospace');}
this.listItemElement.appendChild(nameElement);}
appendValueElement(value){var AXValueType=Protocol.Accessibility.AXValueType;if(value.type===AXValueType.Idref||value.type===AXValueType.Node||value.type===AXValueType.IdrefList||value.type===AXValueType.NodeList){this.appendRelatedNodeListValueElement(value);return;}else if(value.sources){var sources=value.sources;for(var i=0;i<sources.length;i++){var source=sources[i];var child=new Accessibility.AXValueSourceTreeElement(source,this._axNode);this.appendChild(child);}
this.expand();}
var element=Accessibility.AXNodePropertyTreeElement.createSimpleValueElement(value.type,String(value.value));this.listItemElement.appendChild(element);}
appendRelatedNode(relatedNode,index){var deferredNode=new SDK.DeferredDOMNode(this._axNode.target(),relatedNode.backendDOMNodeId);var nodeTreeElement=new Accessibility.AXRelatedNodeSourceTreeElement({deferredNode:deferredNode},relatedNode);this.appendChild(nodeTreeElement);}
appendRelatedNodeInline(relatedNode){var deferredNode=new SDK.DeferredDOMNode(this._axNode.target(),relatedNode.backendDOMNodeId);var linkedNode=new Accessibility.AXRelatedNodeElement({deferredNode:deferredNode},relatedNode);this.listItemElement.appendChild(linkedNode.render());}
appendRelatedNodeListValueElement(value){if(value.relatedNodes.length===1&&!value.value){this.appendRelatedNodeInline(value.relatedNodes[0]);return;}
value.relatedNodes.forEach(this.appendRelatedNode,this);if(value.relatedNodes.length<=3)
this.expand();else
this.collapse();}};Accessibility.AXNodePropertyTreeElement.TypeStyles={attribute:'ax-value-string',boolean:'object-value-boolean',booleanOrUndefined:'object-value-boolean',computedString:'ax-readable-string',idref:'ax-value-string',idrefList:'ax-value-string',integer:'object-value-number',internalRole:'ax-internal-role',number:'ax-value-number',role:'ax-role',string:'ax-value-string',tristate:'object-value-boolean',valueUndefined:'ax-value-undefined'};Accessibility.AXNodePropertyTreeElement.StringProperties=new Set([Protocol.Accessibility.AXValueType.String,Protocol.Accessibility.AXValueType.ComputedString,Protocol.Accessibility.AXValueType.IdrefList,Protocol.Accessibility.AXValueType.Idref]);Accessibility.AXNodePropertyTreePropertyElement=class extends Accessibility.AXNodePropertyTreeElement{constructor(property,axNode){super(axNode);this._property=property;this.toggleOnClick=true;this.selectable=false;this.listItemElement.classList.add('property');}
onattach(){this._update();}
_update(){this.listItemElement.removeChildren();this.appendNameElement(this._property.name);this.listItemElement.createChild('span','separator').textContent=':\u00A0';this.appendValueElement(this._property.value);}};Accessibility.AXValueSourceTreeElement=class extends Accessibility.AXNodePropertyTreeElement{constructor(source,axNode){super(axNode);this._source=source;this.selectable=false;}
onattach(){this._update();}
appendRelatedNodeWithIdref(relatedNode,index,idref){var deferredNode=new SDK.DeferredDOMNode(this._axNode.target(),relatedNode.backendDOMNodeId);var nodeTreeElement=new Accessibility.AXRelatedNodeSourceTreeElement({deferredNode:deferredNode,idref:idref},relatedNode);this.appendChild(nodeTreeElement);}
appendIDRefValueElement(value){var relatedNodes=value.relatedNodes;var idrefs=value.value.trim().split(/\s+/);if(idrefs.length===1){var idref=idrefs[0];var matchingNode=relatedNodes.find(node=>node.idref===idref);if(matchingNode)
this.appendRelatedNodeWithIdref(matchingNode,0,idref);else
this.listItemElement.appendChild(new Accessibility.AXRelatedNodeElement({idref:idref}).render());}else{for(var i=0;i<idrefs.length;++i){var idref=idrefs[i];var matchingNode=relatedNodes.find(node=>node.idref===idref);if(matchingNode)
this.appendRelatedNodeWithIdref(matchingNode,i,idref);else
this.appendChild(new Accessibility.AXRelatedNodeSourceTreeElement({idref:idref}));}}}
appendRelatedNodeListValueElement(value){var relatedNodes=value.relatedNodes;var numNodes=relatedNodes.length;if(value.type===Protocol.Accessibility.AXValueType.IdrefList||value.type===Protocol.Accessibility.AXValueType.Idref)
this.appendIDRefValueElement(value);else
super.appendRelatedNodeListValueElement(value);if(numNodes<=3)
this.expand();else
this.collapse();}
appendSourceNameElement(source){var nameElement=createElement('span');var AXValueSourceType=Protocol.Accessibility.AXValueSourceType;var type=source.type;switch(type){case AXValueSourceType.Attribute:case AXValueSourceType.Placeholder:case AXValueSourceType.RelatedElement:if(source.nativeSource){var AXNativeSourceTypes=Accessibility.AccessibilityStrings.AXNativeSourceTypes;var nativeSource=source.nativeSource;nameElement.textContent=Common.UIString(AXNativeSourceTypes[nativeSource].name);nameElement.title=Common.UIString(AXNativeSourceTypes[nativeSource].description);nameElement.classList.add('ax-readable-name');break;}
nameElement.textContent=source.attribute;nameElement.classList.add('ax-name');nameElement.classList.add('monospace');break;default:var AXSourceTypes=Accessibility.AccessibilityStrings.AXSourceTypes;if(type in AXSourceTypes){nameElement.textContent=Common.UIString(AXSourceTypes[type].name);nameElement.title=Common.UIString(AXSourceTypes[type].description);nameElement.classList.add('ax-readable-name');}else{console.warn(type,'not in AXSourceTypes');nameElement.textContent=Common.UIString(type);}}
this.listItemElement.appendChild(nameElement);}
_update(){this.listItemElement.removeChildren();if(this._source.invalid){var exclamationMark=Accessibility.AXNodePropertyTreeElement.createExclamationMark(Common.UIString('Invalid source.'));this.listItemElement.appendChild(exclamationMark);this.listItemElement.classList.add('ax-value-source-invalid');}else if(this._source.superseded){this.listItemElement.classList.add('ax-value-source-unused');}
this.appendSourceNameElement(this._source);this.listItemElement.createChild('span','separator').textContent=':\u00a0';if(this._source.attributeValue){this.appendValueElement(this._source.attributeValue);this.listItemElement.createTextChild('\u00a0');}else if(this._source.nativeSourceValue){this.appendValueElement(this._source.nativeSourceValue);this.listItemElement.createTextChild('\u00a0');if(this._source.value)
this.appendValueElement(this._source.value);}else if(this._source.value){this.appendValueElement(this._source.value);}else{var valueElement=Accessibility.AXNodePropertyTreeElement.createSimpleValueElement(Protocol.Accessibility.AXValueType.ValueUndefined,Common.UIString('Not specified'));this.listItemElement.appendChild(valueElement);this.listItemElement.classList.add('ax-value-source-unused');}
if(this._source.value&&this._source.superseded)
this.listItemElement.classList.add('ax-value-source-superseded');}};Accessibility.AXRelatedNodeSourceTreeElement=class extends UI.TreeElement{constructor(node,value){super('');this._value=value;this._axRelatedNodeElement=new Accessibility.AXRelatedNodeElement(node,value);this.selectable=false;}
onattach(){this.listItemElement.appendChild(this._axRelatedNodeElement.render());if(!this._value)
return;if(this._value.text){this.listItemElement.appendChild(Accessibility.AXNodePropertyTreeElement.createSimpleValueElement(Protocol.Accessibility.AXValueType.ComputedString,this._value.text));}}};Accessibility.AXRelatedNodeElement=class{constructor(node,value){this._deferredNode=node.deferredNode;this._idref=node.idref;this._value=value;}
render(){var element=createElement('span');var valueElement;function onNodeResolved(node){valueElement.appendChild(Components.DOMPresentationUtils.linkifyNodeReference(node,this._idref));}
if(this._deferredNode){valueElement=createElement('span');element.appendChild(valueElement);this._deferredNode.resolve(onNodeResolved.bind(this));}else if(this._idref){element.classList.add('invalid');valueElement=Accessibility.AXNodePropertyTreeElement.createExclamationMark(Common.UIString('No node with this ID.'));valueElement.createTextChild(this._idref);element.appendChild(valueElement);}
return element;}};Accessibility.AXNodeIgnoredReasonTreeElement=class extends Accessibility.AXNodePropertyTreeElement{constructor(property,axNode){super(axNode);this._property=property;this._axNode=axNode;this.toggleOnClick=true;this.selectable=false;}
static createReasonElement(reason,axNode){var reasonElement=null;switch(reason){case'activeModalDialog':reasonElement=UI.formatLocalized('Element is hidden by active modal dialog:\u00a0',[]);break;case'ancestorDisallowsChild':reasonElement=UI.formatLocalized('Element is not permitted as child of ',[]);break;case'ancestorIsLeafNode':reasonElement=UI.formatLocalized('Ancestor\'s children are all presentational:\u00a0',[]);break;case'ariaHidden':var ariaHiddenSpan=createElement('span','source-code').textContent='aria-hidden';reasonElement=UI.formatLocalized('Element is %s.',[ariaHiddenSpan]);break;case'ariaHiddenRoot':var ariaHiddenSpan=createElement('span','source-code').textContent='aria-hidden';var trueSpan=createElement('span','source-code').textContent='true';reasonElement=UI.formatLocalized('%s is %s on ancestor:\u00a0',[ariaHiddenSpan,trueSpan]);break;case'emptyAlt':reasonElement=UI.formatLocalized('Element has empty alt text.',[]);break;case'emptyText':reasonElement=UI.formatLocalized('No text content.',[]);break;case'inert':reasonElement=UI.formatLocalized('Element is inert.',[]);break;case'inheritsPresentation':reasonElement=UI.formatLocalized('Element inherits presentational role from\u00a0',[]);break;case'labelContainer':reasonElement=UI.formatLocalized('Part of label element:\u00a0',[]);break;case'labelFor':reasonElement=UI.formatLocalized('Label for\u00a0',[]);break;case'notRendered':reasonElement=UI.formatLocalized('Element is not rendered.',[]);break;case'notVisible':reasonElement=UI.formatLocalized('Element is not visible.',[]);break;case'presentationalRole':var rolePresentationSpan=createElement('span','source-code').textContent='role='+axNode.role().value;reasonElement=UI.formatLocalized('Element has %s.',[rolePresentationSpan]);break;case'probablyPresentational':reasonElement=UI.formatLocalized('Element is presentational.',[]);break;case'staticTextUsedAsNameFor':reasonElement=UI.formatLocalized('Static text node is used as name for\u00a0',[]);break;case'uninteresting':reasonElement=UI.formatLocalized('Element not interesting for accessibility.',[]);break;}
if(reasonElement)
reasonElement.classList.add('ax-reason');return reasonElement;}
onattach(){this.listItemElement.removeChildren();this._reasonElement=Accessibility.AXNodeIgnoredReasonTreeElement.createReasonElement(this._property.name,this._axNode);this.listItemElement.appendChild(this._reasonElement);var value=this._property.value;if(value.type===Protocol.Accessibility.AXValueType.Idref)
this.appendRelatedNodeListValueElement(value);}};;Accessibility.AccessibilityStrings={};Accessibility.AccessibilityStrings.AXAttributes={'disabled':{name:'Disabled',description:'If true, this element currently cannot be interacted with.',group:'AXGlobalStates'},'invalid':{name:'Invalid user entry',description:'If true, this element\'s user-entered value does not conform to validation requirement.',group:'AXGlobalStates'},'live':{name:'Live region',description:'Whether and what priority of live updates may be expected for this element.',group:'AXLiveRegionAttributes'},'atomic':{name:'Atomic (live regions)',description:'If this element may receive live updates, whether the entire live region should be presented to the user on changes, or only changed nodes.',group:'AXLiveRegionAttributes'},'relevant':{name:'Relevant (live regions)',description:'If this element may receive live updates, what type of updates should trigger a notification.',group:'AXLiveRegionAttributes'},'busy':{name:'Busy (live regions)',description:'Whether this element or its subtree are currently being updated (and thus may be in an inconsistent state).',group:'AXLiveRegionAttributes'},'root':{name:'Live region root',description:'If this element may receive live updates, the root element of the containing live region.',group:'AXLiveRegionAttributes'},'autocomplete':{name:'Has autocomplete',description:'Whether and what type of autocomplete suggestions are currently provided by this element.',group:'AXWidgetAttributes'},'haspopup':{name:'Has popup',description:'Whether this element has caused some kind of pop-up (such as a menu) to appear.',group:'AXWidgetAttributes'},'level':{name:'Level',description:'The hierarchical level of this element.',group:'AXWidgetAttributes'},'multiselectable':{name:'Multi-selectable',description:'Whether a user may select more than one option from this widget.',group:'AXWidgetAttributes'},'orientation':{name:'Orientation',description:'Whether this linear element\'s orientation is horizontal or vertical.',group:'AXWidgetAttributes'},'multiline':{name:'Multi-line',description:'Whether this textbox may have more than one line.',group:'AXWidgetAttributes'},'readonly':{name:'Read-only',description:'If true, this element may be interacted with, but its value cannot be changed.',group:'AXWidgetAttributes'},'required':{name:'Required',description:'Whether this element is a required field in a form.',group:'AXWidgetAttributes'},'valuemin':{name:'Minimum value',description:'For a range widget, the minimum allowed value.',group:'AXWidgetAttributes'},'valuemax':{name:'Maximum value',description:'For a range widget, the maximum allowed value.',group:'AXWidgetAttributes'},'valuetext':{name:'Value description',description:'A human-readable version of the value of a range widget (where necessary).',group:'AXWidgetAttributes'},'checked':{name:'Checked',description:'Whether this checkbox, radio button or tree item is checked, unchecked, or mixed (e.g. has both checked and un-checked children).',group:'AXWidgetStates'},'expanded':{name:'Expanded',description:'Whether this element, or another grouping element it controls, is expanded.',group:'AXWidgetStates'},'pressed':{name:'Pressed',description:'Whether this toggle button is currently in a pressed state.',group:'AXWidgetStates'},'selected':{name:'Selected',description:'Whether the option represented by this element is currently selected.',group:'AXWidgetStates'},'activedescendant':{name:'Active descendant',description:'The descendant of this element which is active; i.e. the element to which focus should be delegated.',group:'AXRelationshipAttributes'},'flowto':{name:'Flows to',description:'Element to which the user may choose to navigate after this one, instead of the next element in the DOM order.',group:'AXRelationshipAttributes'},'controls':{name:'Controls',description:'Element or elements whose content or presence is/are controlled by this widget.',group:'AXRelationshipAttributes'},'describedby':{name:'Described by',description:'Element or elements which form the description of this element.',group:'AXRelationshipAttributes'},'labelledby':{name:'Labeled by',description:'Element or elements which may form the name of this element.',group:'AXRelationshipAttributes'},'owns':{name:'Owns',description:'Element or elements which should be considered descendants of this element, despite not being descendants in the DOM.',group:'AXRelationshipAttributes'},'name':{name:'Name',description:'The computed name of this element.',group:'Default'},'role':{name:'Role',description:'Indicates the purpose of this element, such as a user interface idiom for a widget, or structural role within a document.',group:'Default'},'value':{name:'Value',description:'The value of this element; this may be user-provided or developer-provided, depending on the element.',group:'Default'},'help':{name:'Help',description:'The computed help text for this element.',group:'Default'},'description':{name:'Description',description:'The accessible description for this element.',group:'Default'}};Accessibility.AccessibilityStrings.AXSourceTypes={'attribute':{name:'From attribute',description:'Value from attribute.'},'implicit':{name:'Implicit',description:'Implicit value.',},'style':{name:'From style',description:'Value from style.'},'contents':{name:'Contents',description:'Value from element contents.'},'placeholder':{name:'From placeholder attribute',description:'Value from placeholder attribute.'},'relatedElement':{name:'Related element',description:'Value from related element.'}};Accessibility.AccessibilityStrings.AXNativeSourceTypes={'figcaption':{name:'From caption',description:'Value from figcaption element.'},'label':{name:'From label',description:'Value from label element.'},'labelfor':{name:'From label (for)',description:'Value from label element with for= attribute.'},'labelwrapped':{name:'From label (wrapped)',description:'Value from label element wrapped.'},'tablecaption':{name:'From caption',description:'Value from table caption.'},'title':{'name':'From title','description':'Value from title attribute.'},'other':{name:'From native HTML',description:'Value from native HTML (unknown source).'},};;Accessibility.ARIAAttributesPane=class extends Accessibility.AccessibilitySubPane{constructor(){super(Common.UIString('ARIA Attributes'));this._noPropertiesInfo=this.createInfo(Common.UIString('No ARIA attributes'));this._treeOutline=this.createTreeOutline();}
setNode(node){super.setNode(node);this._treeOutline.removeChildren();if(!this.node())
return;var target=this.node().target();var attributes=node.attributes();for(var i=0;i<attributes.length;++i){var attribute=attributes[i];if(Accessibility.ARIAAttributesPane._attributes.indexOf(attribute.name)<0)
continue;this._treeOutline.appendChild(new Accessibility.ARIAAttributesTreeElement(this,attribute,target));}
var foundAttributes=(this._treeOutline.rootElement().childCount()!==0);this._noPropertiesInfo.classList.toggle('hidden',foundAttributes);this._treeOutline.element.classList.toggle('hidden',!foundAttributes);}};Accessibility.ARIAAttributesTreeElement=class extends UI.TreeElement{constructor(parentPane,attribute,target){super('');this._parentPane=parentPane;this._attribute=attribute;this.selectable=false;}
static createARIAValueElement(value){var valueElement=createElementWithClass('span','monospace');valueElement.setTextContentTruncatedIfNeeded(value||'');return valueElement;}
onattach(){this._populateListItem();this.listItemElement.addEventListener('click',this._mouseClick.bind(this));}
_populateListItem(){this.listItemElement.removeChildren();this.appendNameElement(this._attribute.name);this.listItemElement.createChild('span','separator').textContent=':\u00A0';this.appendAttributeValueElement(this._attribute.value);}
appendNameElement(name){this._nameElement=createElement('span');this._nameElement.textContent=name;this._nameElement.classList.add('ax-name');this._nameElement.classList.add('monospace');this.listItemElement.appendChild(this._nameElement);}
appendAttributeValueElement(value){this._valueElement=Accessibility.ARIAAttributesTreeElement.createARIAValueElement(value);this.listItemElement.appendChild(this._valueElement);}
_mouseClick(event){if(event.target===this.listItemElement)
return;event.consume(true);this._startEditing();}
_startEditing(){var valueElement=this._valueElement;if(UI.isBeingEdited(valueElement))
return;var previousContent=valueElement.textContent;function blurListener(previousContent,event){var text=event.target.textContent;this._editingCommitted(text,previousContent);}
this._prompt=new Accessibility.ARIAAttributesPane.ARIAAttributePrompt(Accessibility.ariaMetadata().valuesForProperty(this._nameElement.textContent),this);this._prompt.setAutocompletionTimeout(0);var proxyElement=this._prompt.attachAndStartEditing(valueElement,blurListener.bind(this,previousContent));proxyElement.addEventListener('keydown',this._editingValueKeyDown.bind(this,previousContent),false);valueElement.getComponentSelection().selectAllChildren(valueElement);}
_removePrompt(){if(!this._prompt)
return;this._prompt.detach();delete this._prompt;}
_editingCommitted(userInput,previousContent){this._removePrompt();if(userInput!==previousContent)
this._parentPane.node().setAttributeValue(this._attribute.name,userInput);}
_editingCancelled(){this._removePrompt();this._populateListItem();}
_editingValueKeyDown(previousContent,event){if(event.handled)
return;if(isEnterKey(event)){this._editingCommitted(event.target.textContent,previousContent);event.consume();return;}
if(event.keyCode===UI.KeyboardShortcut.Keys.Esc.code||event.keyIdentifier==='U+001B'){this._editingCancelled();event.consume();return;}}};Accessibility.ARIAAttributesPane.ARIAAttributePrompt=class extends UI.TextPrompt{constructor(ariaCompletions,treeElement){super();this.initialize(this._buildPropertyCompletions.bind(this));this._ariaCompletions=ariaCompletions;this._treeElement=treeElement;}
_buildPropertyCompletions(expression,prefix,force){prefix=prefix.toLowerCase();if(!prefix&&!force&&(this._isEditingName||expression))
return Promise.resolve([]);return Promise.resolve(this._ariaCompletions.filter(value=>value.startsWith(prefix)).map(c=>({text:c})));}};Accessibility.ARIAAttributesPane._attributes=['role','aria-busy','aria-checked','aria-disabled','aria-expanded','aria-grabbed','aria-hidden','aria-invalid','aria-pressed','aria-selected','aria-activedescendant','aria-atomic','aria-autocomplete','aria-controls','aria-describedby','aria-dropeffect','aria-flowto','aria-haspopup','aria-label','aria-labelledby','aria-level','aria-live','aria-multiline','aria-multiselectable','aria-orientation','aria-owns','aria-posinset','aria-readonly','aria-relevant','aria-required','aria-setsize','aria-sort','aria-valuemax','aria-valuemin','aria-valuenow','aria-valuetext',];;Accessibility.ARIAMetadata=class{constructor(config){this._attributes=new Map();if(config)
this._initialize(config);}
_initialize(config){var attributes=config['attributes'];var booleanEnum=['true','false'];for(var name in attributes){var attributeConfig=attributes[name];if(attributeConfig.type==='boolean')
attributeConfig.enum=booleanEnum;this._attributes.set(name,new Accessibility.ARIAMetadata.Attribute(attributeConfig));}
this._roleNames=Object.keys(config['roles']);}
valuesForProperty(property){if(this._attributes.has(property))
return this._attributes.get(property).getEnum();if(property==='role')
return this._roleNames;return[];}};Accessibility.ariaMetadata=function(){if(!Accessibility.ARIAMetadata._instance)
Accessibility.ARIAMetadata._instance=new Accessibility.ARIAMetadata(Accessibility.ARIAMetadata._config||null);return Accessibility.ARIAMetadata._instance;};Accessibility.ARIAMetadata.Attribute=class{constructor(config){this._enum=[];if('enum'in config)
this._enum=config.enum;}
getEnum(){return this._enum;}};;Accessibility.ARIAMetadata._config={'attributes':{'aria-activedescendant':{'type':'IDREF'},'aria-atomic':{'default':'false','type':'boolean'},'aria-autocomplete':{'default':'none','enum':['inline','list','both','none'],'type':'token'},'aria-busy':{'default':'false','type':'boolean'},'aria-checked':{'default':'undefined','enum':['true','false','mixed','undefined'],'type':'token'},'aria-controls':{'type':'IDREF_list'},'aria-describedby':{'type':'IDREF_list'},'aria-disabled':{'default':'false','type':'boolean'},'aria-dropeffect':{'default':'none','enum':['copy','move','link','execute','popup','none'],'type':'token_list'},'aria-expanded':{'default':'undefined','enum':['true','false','undefined'],'type':'token'},'aria-flowto':{'type':'IDREF_list'},'aria-grabbed':{'default':'undefined','enum':['true','false','undefined'],'type':'token'},'aria-haspopup':{'default':'false','type':'boolean'},'aria-hidden':{'default':'false','type':'boolean'},'aria-invalid':{'default':'false','enum':['grammar','false','spelling','true'],'type':'token'},'aria-label':{'type':'string'},'aria-labelledby':{'type':'IDREF_list'},'aria-level':{'type':'integer'},'aria-live':{'default':'off','enum':['off','polite','assertive'],'type':'token'},'aria-multiline':{'default':'false','type':'boolean'},'aria-multiselectable':{'default':'false','type':'boolean'},'aria-orientation':{'default':'vertical','enum':['horizontal','vertical'],'type':'token'},'aria-owns':{'type':'IDREF_list'},'aria-posinset':{'type':'integer'},'aria-pressed':{'default':'undefined','enum':['true','false','mixed','undefined'],'type':'token'},'aria-readonly':{'default':'false','type':'boolean'},'aria-relevant':{'default':'additions text','enum':['additions','removals','text','all'],'type':'token_list'},'aria-required':{'default':'false','type':'boolean'},'aria-selected':{'default':'undefined','enum':['true','false','undefined'],'type':'token'},'aria-setsize':{'type':'integer'},'aria-sort':{'default':'none','enum':['ascending','descending','none','other'],'type':'token'},'aria-valuemax':{'type':'decimal'},'aria-valuemin':{'type':'decimal'},'aria-valuenow':{'type':'decimal'},'aria-valuetext':{'type':'string'},'tabindex':{'type':'integer'}},'roles':{'alert':{'nameFrom':['author'],'superclasses':['region']},'alertdialog':{'nameFrom':['author'],'superclasses':['alert','dialog']},'application':{'nameFrom':['author'],'superclasses':['landmark']},'article':{'nameFrom':['author'],'superclasses':['document','region']},'banner':{'nameFrom':['author'],'superclasses':['landmark']},'button':{'nameFrom':['contents','author'],'superclasses':['command'],'supportedAttributes':['aria-expanded','aria-pressed']},'checkbox':{'nameFrom':['contents','author'],'requiredAttributes':['aria-checked'],'superclasses':['input']},'columnheader':{'nameFrom':['contents','author'],'scope':['row'],'superclasses':['gridcell','sectionhead','widget'],'supportedAttributes':['aria-sort']},'combobox':{'mustContain':['listbox','textbox'],'nameFrom':['author'],'requiredAttributes':['aria-expanded'],'superclasses':['select'],'supportedAttributes':['aria-autocomplete','aria-required']},'command':{'abstract':true,'nameFrom':['author'],'superclasses':['widget']},'complementary':{'nameFrom':['author'],'superclasses':['landmark']},'composite':{'abstract':true,'nameFrom':['author'],'superclasses':['widget'],'supportedAttributes':['aria-activedescendant'],},'contentinfo':{'nameFrom':['author'],'superclasses':['landmark']},'definition':{'nameFrom':['author'],'superclasses':['section']},'dialog':{'nameFrom':['author'],'superclasses':['window']},'directory':{'nameFrom':['contents','author'],'superclasses':['list']},'document':{'nameFrom':['author'],'superclasses':['structure'],'supportedAttributes':['aria-expanded']},'form':{'nameFrom':['author'],'superclasses':['landmark']},'grid':{'mustContain':['row','rowgroup','row'],'nameFrom':['author'],'superclasses':['composite','region'],'supportedAttributes':['aria-level','aria-multiselectable','aria-readonly']},'gridcell':{'nameFrom':['contents','author'],'scope':['row'],'superclasses':['section','widget'],'supportedAttributes':['aria-readonly','aria-required','aria-selected']},'group':{'nameFrom':['author'],'superclasses':['section'],'supportedAttributes':['aria-activedescendant']},'heading':{'superclasses':['sectionhead'],'supportedAttributes':['aria-level']},'img':{'nameFrom':['author'],'superclasses':['section']},'input':{'abstract':true,'nameFrom':['author'],'superclasses':['widget']},'landmark':{'abstract':true,'nameFrom':['contents','author'],'superclasses':['region']},'link':{'nameFrom':['contents','author'],'superclasses':['command'],'supportedAttributes':['aria-expanded']},'list':{'mustContain':['group','listitem','listitem'],'nameFrom':['author'],'superclasses':['region']},'listbox':{'mustContain':['option'],'nameFrom':['author'],'superclasses':['list','select'],'supportedAttributes':['aria-multiselectable','aria-required']},'listitem':{'nameFrom':['contents','author'],'scope':['list'],'superclasses':['section'],'supportedAttributes':['aria-level','aria-posinset','aria-setsize']},'log':{'nameFrom':['author'],'superclasses':['region']},'main':{'nameFrom':['author'],'superclasses':['landmark']},'marquee':{'superclasses':['section']},'math':{'nameFrom':['author'],'superclasses':['section']},'menu':{'mustContain':['group','menuitemradio','menuitem','menuitemcheckbox','menuitemradio'],'nameFrom':['author'],'superclasses':['list','select']},'menubar':{'nameFrom':['author'],'superclasses':['menu']},'menuitem':{'nameFrom':['contents','author'],'scope':['menu','menubar'],'superclasses':['command']},'menuitemcheckbox':{'nameFrom':['contents','author'],'scope':['menu','menubar'],'superclasses':['checkbox','menuitem']},'menuitemradio':{'nameFrom':['contents','author'],'scope':['menu','menubar'],'superclasses':['menuitemcheckbox','radio']},'navigation':{'nameFrom':['author'],'superclasses':['landmark']},'note':{'nameFrom':['author'],'superclasses':['section']},'option':{'nameFrom':['contents','author'],'superclasses':['input'],'supportedAttributes':['aria-checked','aria-posinset','aria-selected','aria-setsize']},'presentation':{'superclasses':['structure']},'progressbar':{'nameFrom':['author'],'superclasses':['range']},'radio':{'nameFrom':['contents','author'],'superclasses':['checkbox','option']},'radiogroup':{'mustContain':['radio'],'nameFrom':['author'],'superclasses':['select'],'supportedAttributes':['aria-required']},'range':{'abstract':true,'nameFrom':['author'],'superclasses':['widget'],'supportedAttributes':['aria-valuemax','aria-valuemin','aria-valuenow','aria-valuetext']},'region':{'nameFrom':['author'],'superclasses':['section']},'roletype':{'abstract':true,'supportedAttributes':['aria-atomic','aria-busy','aria-controls','aria-describedby','aria-disabled','aria-dropeffect','aria-flowto','aria-grabbed','aria-haspopup','aria-hidden','aria-invalid','aria-label','aria-labelledby','aria-live','aria-owns','aria-relevant']},'row':{'mustContain':['columnheader','gridcell','rowheader'],'nameFrom':['contents','author'],'scope':['grid','rowgroup','treegrid'],'superclasses':['group','widget'],'supportedAttributes':['aria-level','aria-selected']},'rowgroup':{'mustContain':['row'],'nameFrom':['contents','author'],'scope':['grid'],'superclasses':['group']},'rowheader':{'nameFrom':['contents','author'],'scope':['row'],'superclasses':['gridcell','sectionhead','widget'],'supportedAttributes':['aria-sort']},'scrollbar':{'nameFrom':['author'],'requiredAttributes':['aria-controls','aria-orientation','aria-valuemax','aria-valuemin','aria-valuenow'],'superclasses':['input','range']},'search':{'nameFrom':['author'],'superclasses':['landmark']},'section':{'abstract':true,'nameFrom':['contents','author'],'superclasses':['structure'],'supportedAttributes':['aria-expanded']},'sectionhead':{'abstract':true,'nameFrom':['contents','author'],'superclasses':['structure'],'supportedAttributes':['aria-expanded']},'select':{'abstract':true,'nameFrom':['author'],'superclasses':['composite','group','input']},'separator':{'nameFrom':['author'],'superclasses':['structure'],'supportedAttributes':['aria-expanded','aria-orientation']},'slider':{'nameFrom':['author'],'requiredAttributes':['aria-valuemax','aria-valuemin','aria-valuenow'],'superclasses':['input','range'],'supportedAttributes':['aria-orientation']},'spinbutton':{'nameFrom':['author'],'requiredAttributes':['aria-valuemax','aria-valuemin','aria-valuenow'],'superclasses':['input','range'],'supportedAttributes':['aria-required']},'status':{'superclasses':['region']},'structure':{'abstract':true,'superclasses':['roletype']},'tab':{'nameFrom':['contents','author'],'scope':['tablist'],'superclasses':['sectionhead','widget'],'supportedAttributes':['aria-selected']},'tablist':{'mustContain':['tab'],'nameFrom':['author'],'superclasses':['composite','directory'],'supportedAttributes':['aria-level']},'tabpanel':{'nameFrom':['author'],'superclasses':['region']},'textbox':{'nameFrom':['author'],'superclasses':['input'],'supportedAttributes':['aria-activedescendant','aria-autocomplete','aria-multiline','aria-readonly','aria-required']},'timer':{'nameFrom':['author'],'superclasses':['status']},'toolbar':{'nameFrom':['author'],'superclasses':['group']},'tooltip':{'superclasses':['section']},'tree':{'mustContain':['group','treeitem','treeitem'],'nameFrom':['author'],'superclasses':['select'],'supportedAttributes':['aria-multiselectable','aria-required']},'treegrid':{'mustContain':['row'],'nameFrom':['author'],'superclasses':['grid','tree']},'treeitem':{'nameFrom':['contents','author'],'scope':['group','tree'],'superclasses':['listitem','option']},'widget':{'abstract':true,'superclasses':['roletype']},'window':{'abstract':true,'nameFrom':['author'],'superclasses':['roletype'],'supportedAttributes':['aria-expanded']}}};;Accessibility.AXTreePane=class extends Accessibility.AccessibilitySubPane{constructor(axSidebarView){super(Common.UIString('Accessibility Tree'));this._axSidebarView=axSidebarView;this._treeOutline=this.createTreeOutline();this._treeOutline.setPaddingSize(12);this._treeOutline.element.addEventListener('keydown',this._onKeyDown.bind(this),true);this.element.classList.add('accessibility-computed');this._preselectedTreeElement=null;this._hoveredTreeElement=null;}
setAXNode(axNode){this._axNode=axNode;var treeOutline=this._treeOutline;treeOutline.removeChildren();if(!axNode)
return;treeOutline.element.classList.remove('hidden');var previousTreeElement=treeOutline.rootElement();var inspectedNodeTreeElement=new Accessibility.AXNodeTreeElement(axNode,this);inspectedNodeTreeElement.setInspected(true);var parent=axNode.parentNode();if(parent){var ancestorChain=[];var ancestor=parent;while(ancestor){ancestorChain.unshift(ancestor);ancestor=ancestor.parentNode();}
for(var ancestorNode of ancestorChain){var ancestorTreeElement=new Accessibility.AXNodeTreeElement(ancestorNode,this);previousTreeElement.appendChild(ancestorTreeElement);previousTreeElement.expand();previousTreeElement=ancestorTreeElement;}}
previousTreeElement.appendChild(inspectedNodeTreeElement);previousTreeElement.expand();inspectedNodeTreeElement.selectable=true;inspectedNodeTreeElement.setInspected(true);inspectedNodeTreeElement.select(!this._selectedByUser,false);inspectedNodeTreeElement.expand();this._preselectedTreeElement=inspectedNodeTreeElement;this.clearSelectedByUser();}
_onKeyDown(event){if(!this._preselectedTreeElement)
return;if(!event.path.some(element=>element===this._preselectedTreeElement.listItemElement))
return;if(event.shiftKey||event.metaKey||event.ctrlKey)
return;var handled=false;if(event.key==='ArrowUp'&&!event.altKey)
handled=this._preselectPrevious();else if(event.key==='ArrowDown'&&!event.altKey)
handled=this._preselectNext();else if(event.key==='ArrowLeft')
handled=this._preselectedTreeElement.collapseOrAscend(event.altKey);else if(event.key==='ArrowRight')
handled=this._preselectedTreeElement.descendOrExpand(event.altKey);else if(isEnterKey(event))
handled=this._preselectedTreeElement.onenter();if(handled)
event.consume(true);}
_preselectPrevious(){var previousElement=this._preselectedTreeElement.traversePreviousTreeElement(true);if(!previousElement)
return false;previousElement.reveal();previousElement.setPreselected(true);previousElement.focus();return true;}
_preselectNext(){var nextElement=this._preselectedTreeElement.traverseNextTreeElement(true);if(!nextElement)
return false;nextElement.reveal();nextElement.setPreselected(true);nextElement.focus();return true;}
_setPreselectedTreeElement(treeElement){if(treeElement===this._preselectedTreeElement)
return;if(this._preselectedTreeElement)
this._preselectedTreeElement.setPreselected(false);this._preselectedTreeElement=treeElement;}
setHoveredElement(treeElement){if(treeElement===this._hoveredElement)
return;if(this._hoveredElement)
this._hoveredElement.setHovered(false);this._hoveredElement=treeElement;}
setInspectedNode(axNode){var axSidebarView=this._axSidebarView;if(axNode.parentNode()){var inspectedDOMNode=UI.context.flavor(SDK.DOMNode);axNode.deferredDOMNode().resolve(domNode=>{if(domNode!==inspectedDOMNode)
Common.Revealer.reveal(axNode.deferredDOMNode(),true);else
axSidebarView.setNode(domNode);});}else{axNode.deferredDOMNode().resolve(domNode=>{axSidebarView.setNode(domNode);});}}
setSelectedByUser(selectedByUser){this._selectedByUser=true;}
clearSelectedByUser(){delete this._selectedByUser;}
target(){return this.node().target();}};Accessibility.AXNodeTreeElement=class extends UI.TreeElement{constructor(axNode,treePane){super('');this._axNode=axNode;this._treePane=treePane;this.selectable=false;this.paddingSize=12;this._preselected=false;this._hovered=false;this.listItemElement.addEventListener('mousemove',this._onmousemove.bind(this),false);this.listItemElement.addEventListener('mouseleave',this._onmouseleave.bind(this),false);this.listItemElement.addEventListener('click',this._onClick.bind(this),false);}
setPreselected(x){if(this._preselected===x)
return;this._preselected=x;this.listItemElement.classList.toggle('hovered',x||this._hovered);this.setFocusable(x);if(this._preselected){this._treePane._setPreselectedTreeElement(this);this.listItemElement.classList.toggle('hovered',true);this._axNode.highlightDOMNode();}}
setHovered(x){if(this._hovered===x)
return;this._hovered=x;this.listItemElement.classList.toggle('hovered',x||this._preselected);if(this._hovered){this._treePane.setHoveredElement(this);this.listItemElement.classList.toggle('hovered',true);this._axNode.highlightDOMNode();}}
focus(){this.listItemElement.focus();}
setFocusable(focusable){if(focusable)
this.listItemElement.setAttribute('tabIndex',0);else
this.listItemElement.removeAttribute('tabIndex');}
_onmousemove(event){if(this._preselected||this._inspected||!this._axNode.isDOMNode())
return;this.setHovered(true);}
_onmouseleave(event){if(this._inspected)
return;this.setHovered(false);}
axNode(){return this._axNode;}
setInspected(inspected){this._inspected=inspected;}
onenter(){this.inspectDOMNode();return true;}
ondblclick(event){if(!this.axNode().isDOMNode())
return false;this.inspectDOMNode();return true;}
_onClick(event){if(!this.axNode().isDOMNode()||this._inspected)
return;this.inspectDOMNode();}
onpopulate(){for(var child of this._axNode.children()){var childTreeElement=new Accessibility.AXNodeTreeElement(child,this._treePane);this.appendChild(childTreeElement);if(childTreeElement.isExpandable()&&!child.hasOnlyUnloadedChildren())
childTreeElement.expand();}}
inspectDOMNode(){this._treePane.setSelectedByUser(true);this._treePane.setInspectedNode(this._axNode);}
onattach(){this._update();}
_update(){this.titleElement().removeChildren();if(this._axNode.ignored()){this._appendIgnoredNodeElement();}else{this._appendRoleElement(this._axNode.role());if(this._axNode.name()&&this._axNode.name().value){this.titleElement().createChild('span','separator').textContent='\u00A0';this._appendNameElement((this._axNode.name().value));}}
if(this._axNode.hasOnlyUnloadedChildren()){this.listItemElement.classList.add('children-unloaded');this.setExpandable(true);}else{this.setExpandable(!!this._axNode.numChildren());}
if(!this._axNode.isDOMNode())
this.listItemElement.classList.add('no-dom-node');}
expand(){if(!this._axNode||this._axNode.hasOnlyUnloadedChildren())
return;super.expand();}
collapse(){if(!this._axNode||this._axNode.hasOnlyUnloadedChildren())
return;super.collapse();}
collapseOrAscend(altKey){if(this.expanded){if(altKey)
this.collapseRecursively();else
this.collapse();return true;}
if(!this.parent||this.parent.root)
return false;var nextElement=this.parent;if(nextElement){nextElement.reveal();nextElement.setPreselected(true);nextElement.focus();return true;}
return false;}
descendOrExpand(altKey){if(!this.isExpandable())
return false;if(!this.expanded){if(altKey)
this.expandRecursively();else
this.expand();return true;}
var nextElement=this.firstChild();if(nextElement){nextElement.reveal();nextElement.setPreselected(true);nextElement.focus();return true;}
return false;}
_appendNameElement(name){var nameElement=createElement('span');nameElement.textContent='"'+name+'"';nameElement.classList.add('ax-readable-string');this.titleElement().appendChild(nameElement);}
_appendRoleElement(role){if(!role)
return;var roleElement=createElementWithClass('span','monospace');roleElement.classList.add(Accessibility.AXNodeTreeElement.RoleStyles[role.type]);roleElement.setTextContentTruncatedIfNeeded(role.value||'');this.titleElement().appendChild(roleElement);}
_appendIgnoredNodeElement(){var ignoredNodeElement=createElementWithClass('span','monospace');ignoredNodeElement.textContent=Common.UIString('Ignored');ignoredNodeElement.classList.add('ax-tree-ignored-node');this.titleElement().appendChild(ignoredNodeElement);}
select(omitFocus,selectedByUser){this._treePane.setSelectedByUser(!!selectedByUser);return super.select(omitFocus,selectedByUser);}};Accessibility.AXNodeTreeElement.RoleStyles={internalRole:'ax-internal-role',role:'ax-role',};;Runtime.cachedResources["accessibility/accessibilityNode.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.sidebar-pane.accessibility-computed {\n    background-color: rgba(0, 0, 0, 0.03);\n}\n\n.ax-computed-text {\n    background-image: url(Images/speech.png);\n    background-repeat: no-repeat;\n    background-position: 0px center;\n    background-size: 12px;\n    padding-left: 17px;\n}\n\n.ax-computed-text div {\n    display: inline-block;\n    padding: 2px;\n    width: 100%;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    overflow: hidden;\n    width: 100%;\n}\n\ndiv.ax-text-alternatives {\n    margin-bottom: 3px;\n    border-bottom: 1px solid #BFBFBF;\n}\n\n.ax-name {\n    color: rgb(153, 69, 0);\n    flex-shrink: 0;\n}\n\n.ax-readable-name {\n    flex-shrink: 0;\n    padding-left: 2px;\n}\n\n.ax-readable-string {\n    font-style: italic;\n}\n\nspan.ax-role {\n    font-weight: bold;\n}\n\nspan.ax-internal-role {\n    font-style: italic;\n}\n\n.ax-ignored-info {\n    padding: 6px;\n}\n\n.ax-ignored-node-pane {\n    flex: none;\n}\n\n.ax-tree-ignored-node {\n    font-style: italic;\n    opacity: 0.7;\n}\n\n.tree-outline li {\n    padding-left: 1px;\n    align-items: baseline;\n}\n\n.tree-outline li.property {\n    color: rgb(33, 33, 33);\n}\n\n.tree-outline li.invalid {\n    position: relative;\n    left: -2px;\n}\n\n.tree-outline li.no-dom-node {\n    opacity: 0.5;\n}\n\n.tree-outline li.children-unloaded::before {\n    opacity: 0.2;\n}\n\n.tree-outline li.partially-expanded::before {\n    -webkit-mask-position: -19px -108px;\n}\n\n.invalid {\n    text-decoration: line-through;\n}\n\n.tree-outline label[is=dt-icon-label] {\n    position: relative;\n    left: -11px;\n}\n\nspan.ax-value-undefined {\n    font-style: italic;\n}\n\n.ax-value-source-unused {\n    opacity: 0.5;\n}\n\n.ax-value-source-superseded,\n.ax-value-source-invalid {\n    text-decoration: line-through;\n}\n\n.tree-outline label[is=dt-icon-label] + .ax-name {\n    margin-left: -11px;\n}\n\n.ax-value-string {\n    color: rgb(200, 0, 0);\n}\n\n.sidebar-pane-stack .sidebar-pane {\n    padding-left: 4px;\n}\n\nbutton.expand-siblings {\n    border-radius: 1px;\n    background-color: #f3f3f3;\n    border: 1px solid #ddd;\n    margin-left: 5px;\n    margin-bottom: 1px;\n}\n\nli.siblings-expanded button.expand-siblings {\n    display: none;\n}\n\n.tree-outline li.preselected:not(.selected) .selection (\n    display: block;\n    left: 3px;\n    right: 3px;\n    background-color: rgba(56, 121, 217, 0.1);\n    border-radius: 5px;\n}\n\n.tree-outline li.inspected .selection {\n    background-color: rgb(56, 121, 217);\n}\n\n/*# sourceURL=accessibility/accessibilityNode.css */";