UNPKG

highcharts

Version:
108 lines (105 loc) 128 kB
/* Highcharts JS v10.0.0 (2022-03-07) Accessibility module (c) 2010-2021 Highsoft AS Author: Oystein Moseng License: www.highcharts.com/license */ (function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/accessibility",["highcharts"],function(t){a(t);a.Highcharts=t;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function t(a,h,r,q){a.hasOwnProperty(h)||(a[h]=q.apply(null,r),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:h,module:a[h]}})))}a=a?a._modules:{}; t(a,"Accessibility/A11yI18n.js",[a["Core/FormatUtilities.js"],a["Core/Utilities.js"]],function(a,h){var k=a.format,q=h.pick,m;(function(a){function m(a,c){var e=a.indexOf("#each("),d=a.indexOf("#plural("),b=a.indexOf("["),f=a.indexOf("]");if(-1<e){f=a.slice(e).indexOf(")")+e;d=a.substring(0,e);b=a.substring(f+1);f=a.substring(e+6,f).split(",");e=Number(f[1]);a="";if(c=c[f[0]])for(e=isNaN(e)?c.length:e,e=0>e?c.length+e:Math.min(e,c.length),f=0;f<e;++f)a+=d+c[f]+b;return a.length?a:""}if(-1<d){b=a.slice(d).indexOf(")")+ d;d=a.substring(d+8,b).split(",");switch(Number(c[d[0]])){case 0:a=q(d[4],d[1]);break;case 1:a=q(d[2],d[1]);break;case 2:a=q(d[3],d[1]);break;default:a=d[1]}a?(c=a,c=c.trim&&c.trim()||c.replace(/^\s+|\s+$/g,"")):c="";return c}return-1<b?(d=a.substring(0,b),b=Number(a.substring(b+1,f)),a=void 0,c=c[d],!isNaN(b)&&c&&(0>b?(a=c[c.length+b],"undefined"===typeof a&&(a=c[0])):(a=c[b],"undefined"===typeof a&&(a=c[c.length-1]))),"undefined"!==typeof a?a:""):"{"+a+"}"}function v(a,c,e){var d=function(b,d){b= b.slice(d||0);var f=b.indexOf("{"),c=b.indexOf("}");if(-1<f&&c>f)return{statement:b.substring(f+1,c),begin:d+f+1,end:d+c}},b=[],f=0;do{var u=d(a,f);var y=a.substring(f,u&&u.begin-1);y.length&&b.push({value:y,type:"constant"});u&&b.push({value:u.statement,type:"statement"});f=u?u.end+1:f+1}while(u);b.forEach(function(b){"statement"===b.type&&(b.value=m(b.value,c))});return k(b.reduce(function(b,d){return b+d.value},""),c,e)}function g(a,c){a=a.split(".");for(var e=this.options.lang,d=0;d<a.length;++d)e= e&&e[a[d]];return"string"===typeof e?v(e,c,this):""}var n=[];a.compose=function(a){-1===n.indexOf(a)&&(n.push(a),a.prototype.langFormat=g);return a};a.i18nFormat=v})(m||(m={}));return m});t(a,"Accessibility/Utils/HTMLUtilities.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,h){function k(a){if("function"===typeof w.MouseEvent)return new w.MouseEvent(a.type,a);if(m.createEvent){var v=m.createEvent("MouseEvent");if(v.initMouseEvent)return v.initMouseEvent(a.type,a.bubbles,a.cancelable, a.view||w,a.detail,a.screenX,a.screenY,a.clientX,a.clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,a.button,a.relatedTarget),v}return q(a.type)}function q(a,g){g=g||{x:0,y:0};if("function"===typeof w.MouseEvent)return new w.MouseEvent(a,{bubbles:!0,cancelable:!0,composed:!0,view:w,detail:"click"===a?1:0,screenX:g.x,screenY:g.y,clientX:g.x,clientY:g.y});if(m.createEvent){var v=m.createEvent("MouseEvent");if(v.initMouseEvent)return v.initMouseEvent(a,!0,!0,w,"click"===a?1:0,g.x,g.y,g.x,g.y,!1,!1,!1, !1,0,null),v}return{type:a}}var m=a.doc,w=a.win,C=h.css;return{addClass:function(a,g){a.classList?a.classList.add(g):0>a.className.indexOf(g)&&(a.className+=" "+g)},cloneMouseEvent:k,cloneTouchEvent:function(a){var g=function(a){for(var g=[],c=0;c<a.length;++c){var e=a.item(c);e&&g.push(e)}return g};if("function"===typeof w.TouchEvent)return g=new w.TouchEvent(a.type,{touches:g(a.touches),targetTouches:g(a.targetTouches),changedTouches:g(a.changedTouches),ctrlKey:a.ctrlKey,shiftKey:a.shiftKey,altKey:a.altKey, metaKey:a.metaKey,bubbles:a.bubbles,cancelable:a.cancelable,composed:a.composed,detail:a.detail,view:a.view}),a.defaultPrevented&&g.preventDefault(),g;g=k(a);g.touches=a.touches;g.changedTouches=a.changedTouches;g.targetTouches=a.targetTouches;return g},escapeStringForHTML:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")},getElement:function(a){return m.getElementById(a)},getFakeMouseEvent:q, getHeadingTagNameForElement:function(a){var g=function(a){a=parseInt(a.slice(1),10);return"h"+Math.min(6,a+1)},v=function(a){var c;a:{for(c=a;c=c.previousSibling;){var e=c.tagName||"";if(/H[1-6]/.test(e)){c=e;break a}}c=""}if(c)return g(c);a=a.parentElement;if(!a)return"p";c=a.tagName;return/H[1-6]/.test(c)?g(c):v(a)};return v(a)},removeChildNodes:function(a){for(;a.lastChild;)a.removeChild(a.lastChild)},removeClass:function(a,g){a.classList?a.classList.remove(g):a.className=a.className.replace(new RegExp(g, "g"),"")},removeElement:function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},reverseChildNodes:function(a){for(var g=a.childNodes.length;g--;)a.appendChild(a.childNodes[g])},stripHTMLTagsFromString:function(a){return"string"===typeof a?a.replace(/<\/?[^>]+(>|$)/g,""):a},visuallyHideElement:function(a){C(a,{position:"absolute",width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(1px, 1px, 1px, 1px)",marginTop:"-3px","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)", filter:"alpha(opacity=1)",opacity:.01})}}});t(a,"Accessibility/Utils/ChartUtilities.js",[a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,h,r){function k(b,f){var a=f.type,c=b.hcEvents;n.createEvent&&(b.dispatchEvent||b.fireEvent)?b.dispatchEvent?b.dispatchEvent(f):b.fireEvent(a,f):c&&c[a]?d(b,a,f):b.element&&k(b.element,f)}function m(b){var d=b.chart,a={},c="Seconds";a.Seconds=((b.max||0)-(b.min||0))/1E3;a.Minutes=a.Seconds/60;a.Hours=a.Minutes/60; a.Days=a.Hours/24;["Minutes","Hours","Days"].forEach(function(b){2<a[b]&&(c=b)});var e=a[c].toFixed("Seconds"!==c&&"Minutes"!==c?1:0);return d.langFormat("accessibility.axis.timeRange"+c,{chart:d,axis:b,range:e.replace(".0","")})}function w(b){var d=b.chart,a=d.options,c=a&&a.accessibility&&a.accessibility.screenReaderSection.axisRangeDateFormat||"";a=function(f){return b.dateTime?d.time.dateFormat(c,b[f]):b[f]};return d.langFormat("accessibility.axis.rangeFromTo",{chart:d,axis:b,rangeFrom:a("min"), rangeTo:a("max")})}function C(b){if(b.points&&b.points.length)return(b=e(b.points,function(b){return!!b.graphic}))&&b.graphic&&b.graphic.element}function v(b){var d=C(b);return d&&d.parentNode||b.graph&&b.graph.element||b.group&&b.group.element}function g(b,d){d.setAttribute("aria-hidden",!1);d!==b.renderTo&&d.parentNode&&d.parentNode!==n.body&&(Array.prototype.forEach.call(d.parentNode.childNodes,function(b){b.hasAttribute("aria-hidden")||b.setAttribute("aria-hidden",!0)}),g(b,d.parentNode))}var n= a.doc,x=h.stripHTMLTagsFromString,c=r.defined,e=r.find,d=r.fireEvent;return{fireEventOnWrappedOrUnwrappedElement:k,getChartTitle:function(b){return x(b.options.title.text||b.langFormat("accessibility.defaultChartTitle",{chart:b}))},getAxisDescription:function(b){return b&&(b.userOptions&&b.userOptions.accessibility&&b.userOptions.accessibility.description||b.axisTitle&&b.axisTitle.textStr||b.options.id||b.categories&&"categories"||b.dateTime&&"Time"||"values")},getAxisRangeDescription:function(b){var d= b.options||{};return d.accessibility&&"undefined"!==typeof d.accessibility.rangeDescription?d.accessibility.rangeDescription:b.categories?(d=b.chart,b=b.dataMax&&b.dataMin?d.langFormat("accessibility.axis.rangeCategories",{chart:d,axis:b,numCategories:b.dataMax-b.dataMin+1}):"",b):!b.dateTime||0!==b.min&&0!==b.dataMin?w(b):m(b)},getPointFromXY:function(b,d,a){for(var f=b.length,c;f--;)if(c=e(b[f].points||[],function(b){return b.x===d&&b.y===a}))return c},getSeriesFirstPointElement:C,getSeriesFromName:function(b, d){return d?(b.series||[]).filter(function(b){return b.name===d}):b.series},getSeriesA11yElement:v,unhideChartElementFromAT:g,hideSeriesFromAT:function(b){(b=v(b))&&b.setAttribute("aria-hidden",!0)},scrollToPoint:function(b){var a=b.series.xAxis,e=b.series.yAxis,y=a&&a.scrollbar?a:e;if((a=y&&y.scrollbar)&&c(a.to)&&c(a.from)){e=a.to-a.from;if(c(y.dataMin)&&c(y.dataMax)){var g=y.toPixels(y.dataMin),x=y.toPixels(y.dataMax);b=(y.toPixels(b["xAxis"===y.coll?"x":"y"]||0)-g)/(x-g)}else b=0;a.updatePosition(b- e/2,b+e/2);d(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:null})}}}});t(a,"Accessibility/Utils/DOMElementProvider.js",[a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,h){var k=a.doc,q=h.removeElement;return function(){function a(){this.elements=[]}a.prototype.createElement=function(){var a=k.createElement.apply(k,arguments);this.elements.push(a);return a};a.prototype.destroyCreatedElements=function(){this.elements.forEach(function(a){q(a)});this.elements= []};return a}()});t(a,"Accessibility/Utils/EventProvider.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,h){var k=h.addEvent;return function(){function h(){this.eventRemovers=[]}h.prototype.addEvent=function(){var h=k.apply(a,arguments);this.eventRemovers.push(h);return h};h.prototype.removeAddedEvents=function(){this.eventRemovers.forEach(function(a){return a()});this.eventRemovers=[]};return h}()});t(a,"Accessibility/AccessibilityComponent.js",[a["Accessibility/Utils/ChartUtilities.js"], a["Accessibility/Utils/DOMElementProvider.js"],a["Accessibility/Utils/EventProvider.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,h,r,q,m){var k=a.fireEventOnWrappedOrUnwrappedElement,C=q.getFakeMouseEvent;a=m.extend;q=function(){function a(){this.proxyProvider=this.keyCodes=this.eventProvider=this.domElementProvider=this.chart=void 0}a.prototype.initBase=function(a,n){this.chart=a;this.eventProvider=new r;this.domElementProvider=new h;this.proxyProvider=n;this.keyCodes= {left:37,right:39,up:38,down:40,enter:13,space:32,esc:27,tab:9,pageUp:33,pageDown:34,end:35,home:36}};a.prototype.addEvent=function(a,n,x,c){return this.eventProvider.addEvent(a,n,x,c)};a.prototype.createElement=function(a,n){return this.domElementProvider.createElement(a,n)};a.prototype.fakeClickEvent=function(a){var g=C("click");k(a,g)};a.prototype.destroyBase=function(){this.domElementProvider.destroyCreatedElements();this.eventProvider.removeAddedEvents()};return a}();a(q.prototype,{init:function(){}, getKeyboardNavigation:function(){},onChartUpdate:function(){},onChartRender:function(){},destroy:function(){}});return q});t(a,"Accessibility/KeyboardNavigationHandler.js",[a["Core/Utilities.js"]],function(a){var h=a.find;a=function(){function a(a,h){this.chart=a;this.keyCodeMap=h.keyCodeMap||[];this.validate=h.validate;this.init=h.init;this.terminate=h.terminate;this.response={success:1,prev:2,next:3,noHandler:4,fail:5}}a.prototype.run=function(a){var k=a.which||a.keyCode,w=this.response.noHandler, r=h(this.keyCodeMap,function(a){return-1<a[0].indexOf(k)});r?w=r[1].call(this,k,a):9===k&&(w=this.response[a.shiftKey?"prev":"next"]);return w};return a}();"";return a});t(a,"Accessibility/Components/ContainerComponent.js",[a["Accessibility/AccessibilityComponent.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,h,r,q,m){var k=this&&this.__extends||function(){var a=function(c,e){a= Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var a in b)b.hasOwnProperty(a)&&(d[a]=b[a])};return a(c,e)};return function(c,e){function d(){this.constructor=c}a(c,e);c.prototype=null===e?Object.create(e):(d.prototype=e.prototype,new d)}}(),C=r.unhideChartElementFromAT,v=r.getChartTitle,g=q.doc,n=m.stripHTMLTagsFromString;return function(a){function c(){return null!==a&&a.apply(this,arguments)||this}k(c,a);c.prototype.onChartUpdate=function(){this.handleSVGTitleElement(); this.setSVGContainerLabel();this.setGraphicContainerAttrs();this.setRenderToAttrs();this.makeCreditsAccessible()};c.prototype.handleSVGTitleElement=function(){var a=this.chart,d="highcharts-title-"+a.index,b=n(a.langFormat("accessibility.svgContainerTitle",{chartTitle:v(a)}));if(b.length){var c=this.svgTitleElement=this.svgTitleElement||g.createElementNS("http://www.w3.org/2000/svg","title");c.textContent=b;c.id=d;a.renderTo.insertBefore(c,a.renderTo.firstChild)}};c.prototype.setSVGContainerLabel= function(){var a=this.chart,d=a.langFormat("accessibility.svgContainerLabel",{chartTitle:v(a)});a.renderer.box&&d.length&&a.renderer.box.setAttribute("aria-label",d)};c.prototype.setGraphicContainerAttrs=function(){var a=this.chart,d=a.langFormat("accessibility.graphicContainerLabel",{chartTitle:v(a)});d.length&&a.container.setAttribute("aria-label",d)};c.prototype.setRenderToAttrs=function(){var a=this.chart;"disabled"!==a.options.accessibility.landmarkVerbosity?a.renderTo.setAttribute("role","region"): a.renderTo.removeAttribute("role");a.renderTo.setAttribute("aria-label",a.langFormat("accessibility.chartContainerLabel",{title:v(a),chart:a}))};c.prototype.makeCreditsAccessible=function(){var a=this.chart,d=a.credits;d&&(d.textStr&&d.element.setAttribute("aria-label",a.langFormat("accessibility.credits",{creditsStr:n(d.textStr)})),C(a,d.element))};c.prototype.getKeyboardNavigation=function(){var a=this.chart;return new h(a,{keyCodeMap:[],validate:function(){return!0},init:function(){var d=a.accessibility; d&&d.keyboardNavigation.tabindexContainer.focus()}})};c.prototype.destroy=function(){this.chart.renderTo.setAttribute("aria-hidden",!0)};return c}(a)});t(a,"Accessibility/FocusBorder.js",[a["Core/Renderer/SVG/SVGLabel.js"],a["Core/Utilities.js"]],function(a,h){var k=h.addEvent,q=h.pick,m;(function(h){function m(){var a=this.focusElement,b=this.options.accessibility.keyboardNavigation.focusBorder;a&&(a.removeFocusBorder(),b.enabled&&a.addFocusBorder(b.margin,{stroke:b.style.color,strokeWidth:b.style.lineWidth, r:b.style.borderRadius}))}function v(a,b){var d=this.options.accessibility.keyboardNavigation.focusBorder;(b=b||a.element)&&b.focus&&(b.hcEvents&&b.hcEvents.focusin||k(b,"focusin",function(){}),b.focus(),d.hideBrowserFocusOutline&&(b.style.outline="none"));this.focusElement&&this.focusElement.removeFocusBorder();this.focusElement=a;this.renderFocusBorder()}function g(a){if(!a.focusBorderDestroyHook){var b=a.destroy;a.destroy=function(){a.focusBorder&&a.focusBorder.destroy&&a.focusBorder.destroy(); return b.apply(a,arguments)};a.focusBorderDestroyHook=b}}function n(b,d){this.focusBorder&&this.removeFocusBorder();var c=this.getBBox(),f=q(b,3);c.x+=this.translateX?this.translateX:0;c.y+=this.translateY?this.translateY:0;var e=c.x-f,u=c.y-f,n=c.width+2*f,h=c.height+2*f,z=this instanceof a;if("text"===this.element.nodeName||z){var E=!!this.rotation;if(z)var D={x:E?1:0,y:0};else{var F=D=0;"middle"===this.attr("text-anchor")?D=F=.5:this.rotation?D=.25:F=.75;D={x:D,y:F}}F=+this.attr("x");var p=+this.attr("y"); isNaN(F)||(e=F-c.width*D.x-f);isNaN(p)||(u=p-c.height*D.y-f);z&&E&&(z=n,n=h,h=z,isNaN(F)||(e=F-c.height*D.x-f),isNaN(p)||(u=p-c.width*D.y-f))}this.focusBorder=this.renderer.rect(e,u,n,h,parseInt((d&&d.r||0).toString(),10)).addClass("highcharts-focus-border").attr({zIndex:99}).add(this.parentGroup);this.renderer.styledMode||this.focusBorder.attr({stroke:d&&d.stroke,"stroke-width":d&&d.strokeWidth});x(this,b,d);g(this)}function x(a){for(var d=[],c=1;c<arguments.length;c++)d[c-1]=arguments[c];a.focusBorderUpdateHooks|| (a.focusBorderUpdateHooks={},b.forEach(function(b){b+="Setter";var c=a[b]||a._defaultSetter;a.focusBorderUpdateHooks[b]=c;a[b]=function(){var b=c.apply(a,arguments);a.addFocusBorder.apply(a,d);return b}}))}function c(){e(this);this.focusBorderDestroyHook&&(this.destroy=this.focusBorderDestroyHook,delete this.focusBorderDestroyHook);this.focusBorder&&(this.focusBorder.destroy(),delete this.focusBorder)}function e(a){a.focusBorderUpdateHooks&&(Object.keys(a.focusBorderUpdateHooks).forEach(function(b){var d= a.focusBorderUpdateHooks[b];d===a._defaultSetter?delete a[b]:a[b]=d}),delete a.focusBorderUpdateHooks)}var d=[],b="x y transform width height r d stroke-width".split(" ");h.compose=function(a,b){-1===d.indexOf(a)&&(d.push(a),a=a.prototype,a.renderFocusBorder=m,a.setFocusToElement=v);-1===d.indexOf(b)&&(d.push(b),b=b.prototype,b.addFocusBorder=n,b.removeFocusBorder=c)}})(m||(m={}));return m});t(a,"Accessibility/Utils/Announcer.js",[a["Core/Renderer/HTML/AST.js"],a["Accessibility/Utils/DOMElementProvider.js"], a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,h,r,q,m){var k=r.doc,C=q.addClass,v=q.visuallyHideElement,g=m.attr;return function(){function n(a,c){this.chart=a;this.domElementProvider=new h;this.announceRegion=this.addAnnounceRegion(c)}n.prototype.destroy=function(){this.domElementProvider.destroyCreatedElements()};n.prototype.announce=function(g){var c=this;a.setElementHTML(this.announceRegion,g);this.clearAnnouncementRegionTimer&&clearTimeout(this.clearAnnouncementRegionTimer); this.clearAnnouncementRegionTimer=setTimeout(function(){c.announceRegion.innerHTML=a.emptyHTML;delete c.clearAnnouncementRegionTimer},1E3)};n.prototype.addAnnounceRegion=function(a){var c=this.chart.announcerContainer||this.createAnnouncerContainer(),e=this.domElementProvider.createElement("div");g(e,{"aria-hidden":!1,"aria-live":a});this.chart.styledMode?C(e,"highcharts-visually-hidden"):v(e);c.appendChild(e);return e};n.prototype.createAnnouncerContainer=function(){var a=this.chart,c=k.createElement("div"); g(c,{"aria-hidden":!1,"class":"highcharts-announcer-container"});c.style.position="relative";a.renderTo.insertBefore(c,a.renderTo.firstChild);return a.announcerContainer=c};return n}()});t(a,"Accessibility/Components/AnnotationsA11y.js",[a["Accessibility/Utils/HTMLUtilities.js"]],function(a){function h(a){return(a.annotations||[]).reduce(function(a,n){n.options&&!1!==n.options.visible&&(a=a.concat(n.labels));return a},[])}function k(a){return a.options&&a.options.accessibility&&a.options.accessibility.description|| a.graphic&&a.graphic.text&&a.graphic.text.textStr||""}function q(a){var g=a.options&&a.options.accessibility&&a.options.accessibility.description;if(g)return g;g=a.chart;var n=k(a),h=a.points.filter(function(a){return!!a.graphic}).map(function(a){var b=a.accessibility&&a.accessibility.valueDescription||a.graphic&&a.graphic.element&&a.graphic.element.getAttribute("aria-label")||"";a=a&&a.series.name||"";return(a?a+", ":"")+"data point "+b}).filter(function(a){return!!a}),c=h.length,e="accessibility.screenReaderSection.annotations.description"+ (1<c?"MultiplePoints":c?"SinglePoint":"NoPoints");a={annotationText:n,annotation:a,numPoints:c,annotationPoint:h[0],additionalAnnotationPoints:h.slice(1)};return g.langFormat(e,a)}function m(a){return h(a).map(function(a){return(a=w(C(q(a))))?"<li>"+a+"</li>":""})}var w=a.escapeStringForHTML,C=a.stripHTMLTagsFromString;return{getAnnotationsInfoHTML:function(a){var g=a.annotations;return g&&g.length?'<ul style="list-style-type: none">'+m(a).join(" ")+"</ul>":""},getAnnotationLabelDescription:q,getAnnotationListItems:m, getPointAnnotationTexts:function(a){var g=h(a.series.chart).filter(function(g){return-1<g.points.indexOf(a)});return g.length?g.map(function(a){return""+k(a)}):[]}}});t(a,"Accessibility/Components/InfoRegionsComponent.js",[a["Accessibility/A11yI18n.js"],a["Accessibility/AccessibilityComponent.js"],a["Accessibility/Utils/Announcer.js"],a["Accessibility/Components/AnnotationsA11y.js"],a["Core/Renderer/HTML/AST.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Core/FormatUtilities.js"],a["Core/Globals.js"], a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,h,r,q,m,w,C,v,g,n){function x(a,b){var d=b[0],l=a.series&&a.series[0]||{};l={numSeries:a.series.length,numPoints:l.points&&l.points.length,chart:a,mapTitle:l.mapTitle};if(!d)return a.langFormat("accessibility.chartTypes.emptyChart",l);if("map"===d)return l.mapTitle?a.langFormat("accessibility.chartTypes.mapTypeDescription",l):a.langFormat("accessibility.chartTypes.unknownMap",l);if(1<a.types.length)return a.langFormat("accessibility.chartTypes.combinationChart", l);b=b[0];d=a.langFormat("accessibility.seriesTypeDescriptions."+b,l);var c=a.series&&2>a.series.length?"Single":"Multiple";return(a.langFormat("accessibility.chartTypes."+b+c,l)||a.langFormat("accessibility.chartTypes.default"+c,l))+(d?" "+d:"")}var c=this&&this.__extends||function(){var a=function(b,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d])};return a(b,d)};return function(b,d){function l(){this.constructor= b}a(b,d);b.prototype=null===d?Object.create(d):(l.prototype=d.prototype,new l)}}(),e=q.getAnnotationsInfoHTML,d=w.getAxisDescription,b=w.getAxisRangeDescription,f=w.getChartTitle,u=w.unhideChartElementFromAT,y=C.format,k=v.doc,G=g.addClass,t=g.getElement,B=g.getHeadingTagNameForElement,I=g.stripHTMLTagsFromString,z=g.visuallyHideElement,E=n.attr,D=n.pick;return function(g){function p(){var a=null!==g&&g.apply(this,arguments)||this;a.announcer=void 0;a.screenReaderSections={};return a}c(p,g);p.prototype.init= function(){var a=this.chart,b=this;this.initRegionsDefinitions();this.addEvent(a,"aftergetTableAST",function(a){b.onDataTableCreated(a)});this.addEvent(a,"afterViewData",function(a){b.dataTableDiv=a;setTimeout(function(){b.focusDataTable()},300)});this.announcer=new r(a,"assertive")};p.prototype.initRegionsDefinitions=function(){var a=this;this.screenReaderSections={before:{element:null,buildContent:function(b){var d=b.options.accessibility.screenReaderSection.beforeChartFormatter;return d?d(b):a.defaultBeforeChartFormatter(b)}, insertIntoDOM:function(a,b){b.renderTo.insertBefore(a,b.renderTo.firstChild)},afterInserted:function(){"undefined"!==typeof a.sonifyButtonId&&a.initSonifyButton(a.sonifyButtonId);"undefined"!==typeof a.dataTableButtonId&&a.initDataTableButton(a.dataTableButtonId)}},after:{element:null,buildContent:function(b){var d=b.options.accessibility.screenReaderSection.afterChartFormatter;return d?d(b):a.defaultAfterChartFormatter()},insertIntoDOM:function(a,b){b.renderTo.insertBefore(a,b.container.nextSibling)}, afterInserted:function(){a.chart.accessibility&&a.chart.accessibility.keyboardNavigation.updateExitAnchor()}}}};p.prototype.onChartRender=function(){var a=this;this.linkedDescriptionElement=this.getLinkedDescriptionElement();this.setLinkedDescriptionAttrs();Object.keys(this.screenReaderSections).forEach(function(b){a.updateScreenReaderSection(b)})};p.prototype.getLinkedDescriptionElement=function(){var a=this.chart.options.accessibility.linkedDescription;if(a){if("string"!==typeof a)return a;a=y(a, this.chart);a=k.querySelectorAll(a);if(1===a.length)return a[0]}};p.prototype.setLinkedDescriptionAttrs=function(){var a=this.linkedDescriptionElement;a&&(a.setAttribute("aria-hidden","true"),G(a,"highcharts-linked-description"))};p.prototype.updateScreenReaderSection=function(a){var b=this.chart,d=this.screenReaderSections[a],c=d.buildContent(b),A=d.element=d.element||this.createElement("div"),e=A.firstChild||this.createElement("div");c?(this.setScreenReaderSectionAttribs(A,a),m.setElementHTML(e, c),A.appendChild(e),d.insertIntoDOM(A,b),b.styledMode?G(e,"highcharts-visually-hidden"):z(e),u(b,e),d.afterInserted&&d.afterInserted()):(A.parentNode&&A.parentNode.removeChild(A),delete d.element)};p.prototype.setScreenReaderSectionAttribs=function(a,b){var d=this.chart,c=d.langFormat("accessibility.screenReaderSection."+b+"RegionLabel",{chart:d,chartTitle:f(d)});E(a,{id:"highcharts-screen-reader-region-"+b+"-"+d.index,"aria-label":c});a.style.position="relative";"all"===d.options.accessibility.landmarkVerbosity&& c&&a.setAttribute("role","region")};p.prototype.defaultBeforeChartFormatter=function(){var b=this.chart,d=b.options.accessibility.screenReaderSection.beforeChartFormat;if(!d)return"";var c=this.getAxesDescription(),L=b.sonify&&b.options.sonification&&b.options.sonification.enabled,J="highcharts-a11y-sonify-data-btn-"+b.index,u="hc-linkto-highcharts-data-table-"+b.index,p=e(b),y=b.langFormat("accessibility.screenReaderSection.annotations.heading",{chart:b});c={headingTagName:B(b.renderTo),chartTitle:f(b), typeDescription:this.getTypeDescriptionText(),chartSubtitle:this.getSubtitleText(),chartLongdesc:this.getLongdescText(),xAxisDescription:c.xAxis,yAxisDescription:c.yAxis,playAsSoundButton:L?this.getSonifyButtonText(J):"",viewTableButton:b.getCSV?this.getDataTableButtonText(u):"",annotationsTitle:p?y:"",annotationsList:p};b=a.i18nFormat(d,c,b);this.dataTableButtonId=u;this.sonifyButtonId=J;return b.replace(/<(\w+)[^>]*?>\s*<\/\1>/g,"")};p.prototype.defaultAfterChartFormatter=function(){var b=this.chart, d=b.options.accessibility.screenReaderSection.afterChartFormat;if(!d)return"";var c={endOfChartMarker:this.getEndOfChartMarkerText()};return a.i18nFormat(d,c,b).replace(/<(\w+)[^>]*?>\s*<\/\1>/g,"")};p.prototype.getLinkedDescription=function(){var a=this.linkedDescriptionElement;return I(a&&a.innerHTML||"")};p.prototype.getLongdescText=function(){var a=this.chart.options,b=a.caption;b=b&&b.text;var d=this.getLinkedDescription();return a.accessibility.description||d||b||""};p.prototype.getTypeDescriptionText= function(){var a=this.chart;return a.types?a.options.accessibility.typeDescription||x(a,a.types):""};p.prototype.getDataTableButtonText=function(a){var b=this.chart;b=b.langFormat("accessibility.table.viewAsDataTableButtonText",{chart:b,chartTitle:f(b)});return'<button id="'+a+'">'+b+"</button>"};p.prototype.getSonifyButtonText=function(a){var b=this.chart;if(b.options.sonification&&!1===b.options.sonification.enabled)return"";b=b.langFormat("accessibility.sonification.playAsSoundButtonText",{chart:b, chartTitle:f(b)});return'<button id="'+a+'">'+b+"</button>"};p.prototype.getSubtitleText=function(){var a=this.chart.options.subtitle;return I(a&&a.text||"")};p.prototype.getEndOfChartMarkerText=function(){var a=this.chart,b=a.langFormat("accessibility.screenReaderSection.endOfChartMarker",{chart:a});return'<div id="highcharts-end-of-chart-marker-'+a.index+'">'+b+"</div>"};p.prototype.onDataTableCreated=function(a){var b=this.chart;if(b.options.accessibility.enabled){this.viewDataTableButton&&this.viewDataTableButton.setAttribute("aria-expanded", "true");var d=a.tree.attributes||{};d.tabindex=-1;d.summary=b.langFormat("accessibility.table.tableSummary",{chart:b});a.tree.attributes=d}};p.prototype.focusDataTable=function(){var a=this.dataTableDiv;(a=a&&a.getElementsByTagName("table")[0])&&a.focus&&a.focus()};p.prototype.initSonifyButton=function(a){var b=this,d=this.sonifyButton=t(a),c=this.chart,e=function(a){d&&(d.setAttribute("aria-hidden","true"),d.setAttribute("aria-label",""));a.preventDefault();a.stopPropagation();a=c.langFormat("accessibility.sonification.playAsSoundClickAnnouncement", {chart:c});b.announcer.announce(a);setTimeout(function(){d&&(d.removeAttribute("aria-hidden"),d.removeAttribute("aria-label"));c.sonify&&c.sonify()},1E3)};d&&c&&(d.setAttribute("tabindex",-1),d.onclick=function(a){(c.options.accessibility&&c.options.accessibility.screenReaderSection.onPlayAsSoundClick||e).call(this,a,c)})};p.prototype.initDataTableButton=function(a){var b=this.viewDataTableButton=t(a),d=this.chart;a=a.replace("hc-linkto-","");b&&(E(b,{tabindex:-1,"aria-expanded":!!t(a)}),b.onclick= d.options.accessibility.screenReaderSection.onViewDataTableClick||function(){d.viewData()})};p.prototype.getAxesDescription=function(){var a=this.chart,b=function(b,d){b=a[b];return 1<b.length||b[0]&&D(b[0].options.accessibility&&b[0].options.accessibility.enabled,d)},d=!!a.types&&0>a.types.indexOf("map"),c=!!a.hasCartesianSeries,e=b("xAxis",!a.angular&&c&&d);b=b("yAxis",c&&d);d={};e&&(d.xAxis=this.getAxisDescriptionText("xAxis"));b&&(d.yAxis=this.getAxisDescriptionText("yAxis"));return d};p.prototype.getAxisDescriptionText= function(a){var c=this.chart,e=c[a];return c.langFormat("accessibility.axis."+a+"Description"+(1<e.length?"Plural":"Singular"),{chart:c,names:e.map(function(a){return d(a)}),ranges:e.map(function(a){return b(a)}),numAxes:e.length})};p.prototype.destroy=function(){this.announcer&&this.announcer.destroy()};return p}(h)});t(a,"Accessibility/Components/MenuComponent.js",[a["Core/Chart/Chart.js"],a["Core/Utilities.js"],a["Accessibility/AccessibilityComponent.js"],a["Accessibility/KeyboardNavigationHandler.js"], a["Accessibility/Utils/ChartUtilities.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,h,r,q,m,w){var k=this&&this.__extends||function(){var a=function(c,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,d){a.__proto__=d}||function(a,d){for(var b in d)d.hasOwnProperty(b)&&(a[b]=d[b])};return a(c,d)};return function(c,d){function b(){this.constructor=c}a(c,d);c.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)}}(),v=h.attr,g=m.getChartTitle,n=m.unhideChartElementFromAT, x=w.getFakeMouseEvent;h=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}k(c,a);c.prototype.init=function(){var a=this.chart,b=this;this.addEvent(a,"exportMenuShown",function(){b.onMenuShown()});this.addEvent(a,"exportMenuHidden",function(){b.onMenuHidden()});this.createProxyGroup()};c.prototype.onMenuHidden=function(){var a=this.chart.exportContextMenu;a&&a.setAttribute("aria-hidden","true");this.setExportButtonExpandedState("false")};c.prototype.onMenuShown=function(){var a= this.chart,b=a.exportContextMenu;b&&(this.addAccessibleContextMenuAttribs(),n(a,b));this.setExportButtonExpandedState("true")};c.prototype.setExportButtonExpandedState=function(a){this.exportButtonProxy&&this.exportButtonProxy.buttonElement.setAttribute("aria-expanded",a)};c.prototype.onChartRender=function(){var a=this.chart,b=a.focusElement,c=a.accessibility;this.proxyProvider.clearGroup("chartMenu");this.proxyMenuButton();this.exportButtonProxy&&b&&b===a.exportingGroup&&(b.focusBorder?a.setFocusToElement(b, this.exportButtonProxy.buttonElement):c&&c.keyboardNavigation.tabindexContainer.focus())};c.prototype.proxyMenuButton=function(){var a=this.chart,b=this.proxyProvider,c=a.exportSVGElements&&a.exportSVGElements[0],e=a.options.exporting,y=a.exportSVGElements&&a.exportSVGElements[0];e&&!1!==e.enabled&&e.accessibility&&e.accessibility.enabled&&y&&y.element&&c&&(this.exportButtonProxy=b.addProxyElement("chartMenu",{click:c},{"aria-label":a.langFormat("accessibility.exporting.menuButtonLabel",{chart:a, chartTitle:g(a)}),"aria-expanded":!1,title:a.options.lang.contextButtonTitle||null}))};c.prototype.createProxyGroup=function(){this.chart&&this.proxyProvider&&this.proxyProvider.addGroup("chartMenu","div")};c.prototype.addAccessibleContextMenuAttribs=function(){var a=this.chart,b=a.exportDivElements;b&&b.length&&(b.forEach(function(a){a&&("LI"!==a.tagName||a.children&&a.children.length?a.setAttribute("aria-hidden","true"):a.setAttribute("tabindex",-1))}),(b=b[0]&&b[0].parentNode)&&v(b,{"aria-hidden":void 0, "aria-label":a.langFormat("accessibility.exporting.chartMenuLabel",{chart:a}),role:"list"}))};c.prototype.getKeyboardNavigation=function(){var a=this.keyCodes,b=this.chart,c=this;return new q(b,{keyCodeMap:[[[a.left,a.up],function(){return c.onKbdPrevious(this)}],[[a.right,a.down],function(){return c.onKbdNext(this)}],[[a.enter,a.space],function(){return c.onKbdClick(this)}]],validate:function(){return!!b.exporting&&!1!==b.options.exporting.enabled&&!1!==b.options.exporting.accessibility.enabled}, init:function(){var a=c.exportButtonProxy,d=c.chart.exportingGroup;a&&d&&b.setFocusToElement(d,a.buttonElement)},terminate:function(){b.hideExportMenu()}})};c.prototype.onKbdPrevious=function(a){var b=this.chart,d=b.options.accessibility;a=a.response;for(var c=b.highlightedExportItemIx||0;c--;)if(b.highlightExportItem(c))return a.success;return d.keyboardNavigation.wrapAround?(b.highlightLastExportItem(),a.success):a.prev};c.prototype.onKbdNext=function(a){var b=this.chart,d=b.options.accessibility; a=a.response;for(var c=(b.highlightedExportItemIx||0)+1;c<b.exportDivElements.length;++c)if(b.highlightExportItem(c))return a.success;return d.keyboardNavigation.wrapAround?(b.highlightExportItem(0),a.success):a.next};c.prototype.onKbdClick=function(a){var b=this.chart,d=b.exportDivElements[b.highlightedExportItemIx],c=(b.exportSVGElements&&b.exportSVGElements[0]).element;b.openMenu?this.fakeClickEvent(d):(this.fakeClickEvent(c),b.highlightExportItem(0));return a.response.success};return c}(r);(function(c){function e(){var a= this.exportSVGElements&&this.exportSVGElements[0];if(a&&(a=a.element,a.onclick))a.onclick(x("click"))}function d(){var a=this.exportDivElements;a&&this.exportContextMenu&&this.openMenu&&(a.forEach(function(a){if(a&&"highcharts-menu-item"===a.className&&a.onmouseout)a.onmouseout(x("mouseout"))}),this.highlightedExportItemIx=0,this.exportContextMenu.hideMenu(),this.container.focus())}function b(a){var b=this.exportDivElements&&this.exportDivElements[a],d=this.exportDivElements&&this.exportDivElements[this.highlightedExportItemIx]; if(b&&"LI"===b.tagName&&(!b.children||!b.children.length)){var c=!!(this.renderTo.getElementsByTagName("g")[0]||{}).focus;b.focus&&c&&b.focus();if(d&&d.onmouseout)d.onmouseout(x("mouseout"));if(b.onmouseover)b.onmouseover(x("mouseover"));this.highlightedExportItemIx=a;return!0}return!1}function f(){if(this.exportDivElements)for(var a=this.exportDivElements.length;a--;)if(this.highlightExportItem(a))return!0;return!1}var u=[];c.compose=function(c){-1===u.indexOf(c)&&(u.push(c),c=a.prototype,c.hideExportMenu= d,c.highlightExportItem=b,c.highlightLastExportItem=f,c.showExportMenu=e)}})(h||(h={}));return h});t(a,"Accessibility/KeyboardNavigation.js",[a["Core/Globals.js"],a["Accessibility/Components/MenuComponent.js"],a["Core/Utilities.js"],a["Accessibility/Utils/EventProvider.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,h,r,q,m){var k=a.doc,C=a.win,v=r.addEvent,g=r.fireEvent,n=m.getElement;r=function(){function a(a,e){this.components=this.chart=void 0;this.currentModuleIx=NaN;this.exitAnchor= this.eventProvider=void 0;this.modules=[];this.tabindexContainer=void 0;this.init(a,e)}a.prototype.init=function(a,e){var d=this,b=this.eventProvider=new q;this.chart=a;this.components=e;this.modules=[];this.currentModuleIx=0;this.update();b.addEvent(this.tabindexContainer,"keydown",function(a){return d.onKeydown(a)});b.addEvent(this.tabindexContainer,"focus",function(a){return d.onFocus(a)});["mouseup","touchend"].forEach(function(a){return b.addEvent(k,a,function(){return d.onMouseUp()})});["mousedown", "touchstart"].forEach(function(c){return b.addEvent(a.renderTo,c,function(){d.isClickingChart=!0})});b.addEvent(a.renderTo,"mouseover",function(){d.pointerIsOverChart=!0});b.addEvent(a.renderTo,"mouseout",function(){d.pointerIsOverChart=!1})};a.prototype.update=function(a){var c=this.chart.options.accessibility;c=c&&c.keyboardNavigation;var d=this.components;this.updateContainerTabindex();c&&c.enabled&&a&&a.length?(this.modules=a.reduce(function(a,c){c=d[c].getKeyboardNavigation();return a.concat(c)}, []),this.updateExitAnchor()):(this.modules=[],this.currentModuleIx=0,this.removeExitAnchor())};a.prototype.updateExitAnchor=function(){var a=n("highcharts-end-of-chart-marker-"+this.chart.index);this.removeExitAnchor();a?(this.makeElementAnExitAnchor(a),this.exitAnchor=a):this.createExitAnchor()};a.prototype.move=function(a){var c=this.modules&&this.modules[this.currentModuleIx];c&&c.terminate&&c.terminate(a);this.chart.focusElement&&this.chart.focusElement.removeFocusBorder();this.currentModuleIx+= a;if(c=this.modules&&this.modules[this.currentModuleIx]){if(c.validate&&!c.validate())return this.move(a);if(c.init)return c.init(a),!0}this.currentModuleIx=0;this.exiting=!0;0<a?this.exitAnchor.focus():this.tabindexContainer.focus();return!1};a.prototype.onFocus=function(a){var c=this.chart;a=a.relatedTarget&&c.container.contains(a.relatedTarget);this.exiting||this.tabbingInBackwards||this.isClickingChart||a||(a=this.getFirstValidModuleIx(),null!==a&&(this.currentModuleIx=a,this.modules[a].init(1))); this.exiting=!1};a.prototype.onMouseUp=function(){delete this.isClickingChart;if(!this.keyboardReset){var a=this.chart;if(!this.pointerIsOverChart){var e=this.modules&&this.modules[this.currentModuleIx||0];e&&e.terminate&&e.terminate();this.currentModuleIx=0}a.focusElement&&(a.focusElement.removeFocusBorder(),delete a.focusElement);this.keyboardReset=!0}};a.prototype.onKeydown=function(a){a=a||C.event;var c=this.modules&&this.modules.length&&this.modules[this.currentModuleIx],d;this.exiting=this.keyboardReset= !1;if(c){var b=c.run(a);b===c.response.success?d=!0:b===c.response.prev?d=this.move(-1):b===c.response.next&&(d=this.move(1));d&&(a.preventDefault(),a.stopPropagation())}};a.prototype.updateContainerTabindex=function(){var a=this.chart.options.accessibility;a=a&&a.keyboardNavigation;a=!(a&&!1===a.enabled);var e=this.chart,d=e.container;e.renderTo.hasAttribute("tabindex")&&(d.removeAttribute("tabindex"),d=e.renderTo);this.tabindexContainer=d;var b=d.getAttribute("tabindex");a&&!b?d.setAttribute("tabindex", "0"):a||e.container.removeAttribute("tabindex")};a.prototype.createExitAnchor=function(){var a=this.chart,e=this.exitAnchor=k.createElement("div");a.renderTo.appendChild(e);this.makeElementAnExitAnchor(e)};a.prototype.makeElementAnExitAnchor=function(a){var c=this.tabindexContainer.getAttribute("tabindex")||0;a.setAttribute("class","highcharts-exit-anchor");a.setAttribute("tabindex",c);a.setAttribute("aria-hidden",!1);this.addExitAnchorEventsToEl(a)};a.prototype.removeExitAnchor=function(){this.exitAnchor&& this.exitAnchor.parentNode&&(this.exitAnchor.parentNode.removeChild(this.exitAnchor),delete this.exitAnchor)};a.prototype.addExitAnchorEventsToEl=function(a){var c=this.chart,d=this;this.eventProvider.addEvent(a,"focus",function(a){a=a||C.event;var b=!(a.relatedTarget&&c.container.contains(a.relatedTarget)||d.exiting);c.focusElement&&delete c.focusElement;b?(d.tabbingInBackwards=!0,d.tabindexContainer.focus(),delete d.tabbingInBackwards,a.preventDefault(),d.modules&&d.modules.length&&(d.currentModuleIx= d.modules.length-1,(a=d.modules[d.currentModuleIx])&&a.validate&&!a.validate()?d.move(-1):a&&a.init(-1))):d.exiting=!1})};a.prototype.getFirstValidModuleIx=function(){for(var a=this.modules.length,e=0;e<a;++e){var d=this.modules[e];if(!d.validate||d.validate())return e}return null};a.prototype.destroy=function(){this.removeExitAnchor();this.eventProvider.removeAddedEvents();this.chart.container.removeAttribute("tabindex")};return a}();(function(n){function c(){var a=this;g(this,"dismissPopupContent", {},function(){a.tooltip&&a.tooltip.hide(0);a.hideExportMenu()})}function e(b){27===(b.which||b.keyCode)&&a.charts&&a.charts.forEach(function(a){a&&a.dismissPopupContent&&a.dismissPopupContent()})}var d=[];n.compose=function(a){h.compose(a);-1===d.indexOf(a)&&(d.push(a),a.prototype.dismissPopupContent=c);-1===d.indexOf(k)&&(d.push(k),v(k,"keydown",e));return a}})(r||(r={}));return r});t(a,"Accessibility/Components/LegendComponent.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Globals.js"], a["Core/Legend/Legend.js"],a["Core/Utilities.js"],a["Accessibility/AccessibilityComponent.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,h,r,q,m,w,C,v){function g(a){var b=a.legend&&a.legend.allItems,d=a.options.legend.accessibility||{};return!(!b||!b.length||a.colorAxis&&a.colorAxis.length||!1===d.enabled)}function n(a,d){d.setState(a?"hover":"",!0);["legendGroup","legendItem","legendSymbol"].forEach(function(c){(c= (c=d[c])&&c.element||c)&&b(c,a?"mouseover":"mouseout")})}var x=this&&this.__extends||function(){var a=function(b,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d])};return a(b,d)};return function(b,d){function c(){this.constructor=b}a(b,d);b.prototype=null===d?Object.create(d):(c.prototype=d.prototype,new c)}}(),c=a.animObject,e=h.doc,d=q.addEvent,b=q.fireEvent,f=q.isNumber,u=q.pick,y=q.syncTimeout, k=C.getChartTitle,t=v.stripHTMLTagsFromString,H=v.addClass,B=v.removeClass;a=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;b.highlightedLegendItemIx=NaN;b.proxyGroup=null;return b}x(b,a);b.prototype.init=function(){var a=this;this.recreateProxies();this.addEvent(r,"afterScroll",function(){this.chart===a.chart&&(a.proxyProvider.updateGroupProxyElementPositions("legend"),a.updateLegendItemProxyVisibility(),-1<a.highlightedLegendItemIx&&this.chart.highlightLegendItem(a.highlightedLegendItemIx))}); this.addEvent(r,"afterPositionItem",function(b){this.chart===a.chart&&this.chart.renderer&&a.updateProxyPositionForItem(b.item)});this.addEvent(r,"afterRender",function(){this.chart===a.chart&&this.chart.renderer&&a.recreateProxies()&&y(function(){return a.proxyProvider.updateGroupProxyElementPositions("legend")},c(u(this.chart.renderer.globalAnimation,!0)).duration)})};b.prototype.updateLegendItemProxyVisibility=function(){var a=this.chart,b=a.legend,d=b.currentPage||1,c=b.clipHeight||0;(b.allItems|| []).forEach(function(e){if(e.a11yProxyElement){var l=e.a11yProxyElement.element,f=!1;if(b.pages&&b.pages.length){f=e.pageIx||0;var A=e._legendItemPos?e._legendItemPos[1]:0;e=e.legendItem?Math.round(e.legendItem.getBBox().height):0;f=A+e-b.pages[f]>c||f!==d-1}f?a.styledMode?H(l,"highcharts-a11y-invisible"):l.style.visibility="hidden":(B(l,"highcharts-a11y-invisible"),l.style.visibility="")}})};b.prototype.onChartRender=function(){g(this.chart)||this.removeProxies()};b.prototype.highlightAdjacentLegendPage= function(a){var b=this.chart,d=b.legend;a=(d.currentPage||1)+a;var c=d.pages||[];if(0<a&&a<=c.length){c=d.allItems.length;for(var e=0;e<c;++e)if(d.allItems[e].pageIx+1===a){b.highlightLegendItem(e)&&(this.highlightedLegendItemIx=e);break}}};b.prototype.updateProxyPositionForItem=function(a){a.a11yProxyElement&&a.a11yProxyElement.refreshPosition()};b.prototype.recreateProxies=function(){var a=e.activeElement,b=this.proxyGroup;a=a&&b&&b.contains(a);this.removeProxies();return g(this.chart)?(this.addLegendProxyGroup(), this.proxyLegendItems(),this.updateLegendItemProxyVisibility(),this.updateLegendTitle(),a&&this.chart.highlightLegendItem(this.highlightedLegendItemIx),!0):!1};b.prototype.removeProxies=function(){this.proxyProvider.removeGroup("legend")};b.prototype.updateLegendTitle=function(){var a=this.chart,b=t((a.legend&&a.legend.options.title&&a.legend.options.title.text||"").replace(/<br ?\/?>/g," "));a=a.langFormat("accessibility.legend.legendLabel"+(b?"":"NoTitle"),{chart:a,legendTitle:b,chartTitle:k(a)}); this.proxyProvider.updateGroupAttrs("legend",{"aria-label":a})};b.prototype.addLegendProxyGroup=function(){this.proxyGroup=this.proxyProvider.addGroup("legend","ul",{"aria-label":"_placeholder_",role:"all"===this.chart.options.accessibility.landmarkVerbosity?"region":null})};b.prototype.proxyLegendItems=function(){var a=this;(this.chart.legend&&this.chart.legend.allItems||[]).forEach(function(b){b.legendItem&&b.legendItem.element&&a.proxyLegendItem(b)})};b.prototype.proxyLegendItem=function(a){if(a.legendItem&& a.legendGroup){var b=this.chart.langFormat("accessibility.legend.legendItem",{chart:this.chart,itemName:t(a.name),item:a});a.a11yProxyElement=this.proxyProvider.addProxyElement("legend",{click:a.legendItem,visual:(a.legendGroup.div?a.legendItem:a.legendGroup).element},{tabindex:-1,"aria-pressed":a.visible,"aria-label":b})}};b.prototype.getKeyboardNavigation=function(){var a=this.keyCodes,b=this,d=this.chart;return new w(d,{keyCodeMap:[[[a.left,a.right,a.up,a.down],function(a){return b.onKbdArrowKey(this, a)}],[[a.enter,a.space],function(d){return h.isFirefox&&d===a.space?this.response.success:b.onKbdClick(this)}],[[a.pageDown,a.pageUp],function(d){b.highlightAdjacentLegendPage(d===a.pageDown?1:-1);return this.response.success}]],validate:function(){return b.shouldHaveLegendNavigation()},init:function(){d.highlightLegendItem(0);b.highlightedLegendItemIx=0},terminate:function(){b.highlightedLegendItemIx=-1;d.legend.allItems.forEach(function(a){return n(!1,a)})}})};b.prototype.onKbdArrowKey=function(a, b){var d=this.keyCodes,c=a.response,e=this.chart,l=e.options.accessibility,f=e.legend.allItems.length;b=b===d.left||b===d.up?-1:1;if(e.highlightLegendItem(this.highlightedLegendItemIx+b))return this.highlightedLegendItemIx+=b,c.success;1<f&&l.keyboardNavigation.wrapAround&&a.init(b);return c.success};b.prototype.onKbdClick=function(a){var b=this.chart.legend.allItems[this.highlightedLegendItemIx];b&&b.a11yProxyElement&&b.a11yProxyElement.click();return a.response.success};b.prototype.shouldHaveLegendNavigation= function(){var a=this.chart,b=a.colorAxis&&a.colorAxis.length,d=(a.options.legend||{}).accessibility||{};return!!(a.legend&&a.legend.allItems&&a.legend.display&&!b&&d.enabled&&d.keyboardNavigation&&d.keyboardNavigation.enabled)};return b}(m);(function(a){function b(a){var b=this.legend.allItems,d=this.accessibility&&this.accessibility.components.legend.highlightedLegendItemIx,c=b[a];return c?(f(d)&&b[d]&&n(!1,b[d]),b=this.legend,a=b.allItems[a].pageIx,d=b.currentPage,"undefined"!==typeof a&&a+1!== d&&b.scroll(1+a-d),a=c.legendItem,b=c.a11yProxyElement&&c.a11yProxyElement.buttonElement,a&&a.element&&b&&this.setFocusToElement(a,b),n(!0,c),!0):!1}function c(a){var b=a.item;this.chart.options.accessibility.enabled&&b&&b.a11yProxyElement&&b.a11yProxyElement.buttonElement.setAttribute("aria-pressed",a.visible?"true":"false")}var e=[];a.compose=function(a,f){-1===e.indexOf(a)&&(e.push(a),a.prototype.highlightLegendItem=b);-1===e.indexOf(f)&&(e.push(f),d(f,"afterColorizeItem",c))}})(a||(a={}));return a}); t(a,"Accessibility/Components/SeriesComponent/SeriesDescriber.js",[a["Accessibility/Components/AnnotationsA11y.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Core/FormatUtilities.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,h,r,q,m){function k(a){var b=a.index;return a.series&&a.series.data&&A(b)?D(a.series.data,function(a){return!!(a&&"undefined"!==typeof a.index&&a.index>b&&a.graphic&&a.graphic.element)})||null:null}function C(a){var b=a.chart.options.accessibility.series.pointDescriptionEnabledThreshold; return!!(!1!==b&&a.points&&a.points.length>=b)}function v(a){var b=a.options.accessibility||{};return!C(a)&&!b.exposeAsGroupOnly}function g(a){var b=a.chart.options.accessibility.keyboardNavigation.seriesNavigation;return!(!a.points||!(a.points.length<b.pointNavigationEnabledThreshold||!1===b.pointNavigationEnabledThreshold))}function n(a,b){var d=a.series,c=d.chart;a=c.options.accessibility.point||{};var e=d.options.accessibility&&d.options.accessibility.point||{};d=d.tooltipOptions||{};c=c.options.lang; return F(b)?I(b,e.valueDecimals||a.valueDecimals||d.valueDecimals||-1,c.decimalPoint,c.accessibility.thousandsSep||c.thousandsSep):b}function x(a){var b=(a.options.accessibility||{}).description;return b&&a.chart.langFormat("accessibility.series.description",{description:b,series:a})||""}function c(a,b){return a.chart.langFormat("accessibility.series."+b+"Description",{name:y(a[b]),series:a})}function e(a,b,d){var c=b||"",e=d||"";return a.series.pointArrayMap.reduce(function(b,d){b+=b.length?", ": "";var l=n(a,p(a[d],a.options[d]));return b+(d+": "+c+l+e)},"")}function d(a){var b=a.series,d=1<b.chart.series.length||b.options.name,c=a.series;var f=c.chart;var l=c.options.accessibility;l=l&&l.point&&l.point.valueDescriptionFormat||f.options.accessibility.point.valueDescriptionFormat;c=p(c.xAxis&&c.xAxis.options.accessibility&&c.xAxis.options.accessibility.enabled,!f.angular);if(c){var g=a.series;var y=g.chart;var h=g.options.accessibility&&g.options.accessibility.point||{},k=y.options.accessibility.point|| {};(g=g.xAxis&&g.xAxis.dateTime)?(g=g.getXDateFormat(a.x||0,y.options.tooltip.dateTimeLabelFormats),h=h.dateFormatter&&h.dateFormatter(a)||k.dateFormatter&&k.dateFormatter(a)||h.dateFormat||k.dateFormat||g,y=y.time.dateFormat(h,a.x||0,void 0)):y=void 0;h=(a.series.xAxis||{}).categories&&A(a.category)&&(""+a.category).replace("<br/>"," ");k=a.id&&0>a.id.indexOf("highcharts-");g="x, "+a.x;y=a.name||y||h||(k?a.id:g)}else y="";h=A(a.index)?a.index+1:"";k=a.series;var x=k.chart.options.accessibility.point|| {},z=k.chart.options.accessibility&&k.chart.options.accessibility.point||{},m=k.tooltipOptions||{};g=z.valuePrefix||x.valuePrefix||m.valuePrefix||"";x=z.valueSuffix||x.valueSuffix||m.valueSuffix||"";z=n(a,a["undefined"!==typeof a.value?"value":"y"]);k=a.isNull?k.chart.langFormat("accessibility.series.nullPointValue",{point:a}):k.pointArrayMap?e(a,g,x):g+z+x;f=B(l,{point:a,index:h,xDescription:y,value:k,separator:c?", ":""},f);l=(l=a.options&&a.options.accessibility&&a.options.accessibility.description)? " "+l:"";b=d?" "+b.name+".":"";d=a.series.chart;c=u(a);y={point:a,annotations:c};d=c.length?d.langFormat("accessibility.series.pointAnnotationsDescription",y):"";a.accessibility=a.accessibility||{};a.accessibility.valueDescription=f;return f+l+b+(d?" "+d:"")}function b(a){var b=v(a),c=g(a);(b||c)&&a.points.forEach(function(c){var e;if(!(e=c.graphic&&c.graphic.element)&&(e=c.series&&c.series.is("sunburst"),e=c.isNull&&!e)){var f=c.series,l=k(c);f=(e=l&&l.graphic)?e.parentGroup:f.graph||f.group;l=l? {x:p(c.plotX,l.plotX,0),y:p(c.plotY,l.plotY,0)}:{x:p(c.plotX,0),y:p(c.plotY,0)};l=c.series.chart.renderer.rect(l.x,l.y,1,1);l.attr({"class":"highcharts-a11y-dummy-point",fill:"none",opacity:0,"fill-opacity":0,"stroke-opacity":0});f&&f.element?(c.graphic=l,c.hasDummyGraphic=!0,l.add(f),f.element.insertBefore(l.element,e?e.element:null),e=l.element):e=void 0}f=c.options&&c.options.accessibility&&!1===c.options.accessibility.enabled;e&&(e.setAttribute("tabindex","-1"),a.chart.styledMode||(e.style.outline= "none"),