"use strict";Liferay.Loader.define("liferay!analytics-settings-web$dom-accessibility-api@0.5.16/dist/getRole",["module","exports","require"],(function(e,a,t){window;{function getLocalName(e){var a;return null!==(a=e.localName)&&void 0!==a?a:e.tagName.toLowerCase()}a.__esModule=!0,a.default=function getRole(e){var a=function getExplicitRole(e){var a=e.getAttribute("role");if(null!==a){var t=a.trim().split(" ")[0];if(t.length>0)return t}return null}(e);if(null===a||"presentation"===a){var t=function getImplicitRole(e){var a=r[getLocalName(e)];if(void 0!==a)return a;switch(getLocalName(e)){case"a":case"area":case"link":if(e.hasAttribute("href"))return"link";break;case"img":return""!==e.getAttribute("alt")||ignorePresentationalRole(e,"img")?"img":"presentation";case"input":var t=e.type;switch(t){case"button":case"image":case"reset":case"submit":return"button";case"checkbox":case"radio":return t;case"range":return"slider";case"email":case"tel":case"text":case"url":return e.hasAttribute("list")?"combobox":"textbox";case"search":return e.hasAttribute("list")?"combobox":"searchbox";case"number":return"spinbutton";default:return null}case"select":return e.hasAttribute("multiple")||e.size>1?"listbox":"combobox"}return null}(e);if("presentation"!==a||ignorePresentationalRole(e,t||""))return t}return a},a.getLocalName=getLocalName;var r={article:"article",aside:"complementary",button:"button",datalist:"listbox",dd:"definition",details:"group",dialog:"dialog",dt:"term",fieldset:"group",figure:"figure",form:"form",footer:"contentinfo",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",header:"banner",hr:"separator",html:"document",legend:"legend",li:"listitem",math:"math",main:"main",menu:"list",nav:"navigation",ol:"list",optgroup:"group",option:"option",output:"status",progress:"progressbar",section:"region",summary:"button",table:"table",tbody:"rowgroup",textarea:"textbox",tfoot:"rowgroup",td:"cell",th:"columnheader",thead:"rowgroup",tr:"row",ul:"list"},i={caption:new Set(["aria-label","aria-labelledby"]),code:new Set(["aria-label","aria-labelledby"]),deletion:new Set(["aria-label","aria-labelledby"]),emphasis:new Set(["aria-label","aria-labelledby"]),generic:new Set(["aria-label","aria-labelledby","aria-roledescription"]),insertion:new Set(["aria-label","aria-labelledby"]),paragraph:new Set(["aria-label","aria-labelledby"]),presentation:new Set(["aria-label","aria-labelledby"]),strong:new Set(["aria-label","aria-labelledby"]),subscript:new Set(["aria-label","aria-labelledby"]),superscript:new Set(["aria-label","aria-labelledby"])};function ignorePresentationalRole(e,a){return function hasGlobalAriaAttributes(e,a){return["aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-dropeffect","aria-flowto","aria-grabbed","aria-hidden","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-roledescription"].some((function(t){var r;return e.hasAttribute(t)&&!(null!==(r=i[a])&&void 0!==r&&r.has(t))}))}(e,a)}}}));
//# sourceMappingURL=getRole.js.map