UNPKG

accessibility

Version:

add accessibility to your website

2 lines β€’ 79.5 kB
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var n in s)("object"==typeof exports?exports:e)[n]=s[n]}}(globalThis,(()=>(()=>{var e={958:e=>{var t=function(e){"use strict";var t,s=Object.prototype,n=s.hasOwnProperty,i=Object.defineProperty||function(e,t,s){e[t]=s.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",r=o.toStringTag||"@@toStringTag";function l(e,t,s){return Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,s){return e[t]=s}}function u(e,t,s,n){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:E(e,s,c)}),a}function d(e,t,s){try{return{type:"normal",arg:e.call(t,s)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",m="suspendedYield",p="executing",g="completed",_={};function y(){}function f(){}function b(){}var v={};l(v,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==s&&n.call(S,a)&&(v=S);var w=b.prototype=y.prototype=Object.create(v);function L(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function s(i,o,a,c){var r=d(e[i],e,o);if("throw"!==r.type){var l=r.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){s("next",e,a,c)}),(function(e){s("throw",e,a,c)})):t.resolve(u).then((function(e){l.value=e,a(l)}),(function(e){return s("throw",e,a,c)}))}c(r.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){s(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function E(e,s,n){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var c=n.delegate;if(c){var r=k(c,n);if(r){if(r===_)continue;return r}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var l=d(e,s,n);if("normal"===l.type){if(i=n.done?g:m,l.arg===_)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=g,n.method="throw",n.arg=l.arg)}}}function k(e,s){var n=s.method,i=e.iterator[n];if(i===t)return s.delegate=null,"throw"===n&&e.iterator.return&&(s.method="return",s.arg=t,k(e,s),"throw"===s.method)||"return"!==n&&(s.method="throw",s.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var o=d(i,e.iterator,s.arg);if("throw"===o.type)return s.method="throw",s.arg=o.arg,s.delegate=null,_;var a=o.arg;return a?a.done?(s[e.resultName]=a.value,s.next=e.nextLoc,"return"!==s.method&&(s.method="next",s.arg=t),s.delegate=null,_):a:(s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,_)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(e){if(null!=e){var s=e[a];if(s)return s.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function s(){for(;++i<e.length;)if(n.call(e,i))return s.value=e[i],s.done=!1,s;return s.value=t,s.done=!0,s};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return f.prototype=b,i(w,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:f,configurable:!0}),f.displayName=l(b,r,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,r,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},L(T.prototype),l(T.prototype,c,(function(){return this})),e.AsyncIterator=T,e.async=function(t,s,n,i,o){void 0===o&&(o=Promise);var a=new T(u(t,s,n,i),o);return e.isGeneratorFunction(s)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},L(w),l(w,r,"Generator"),l(w,a,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),s=[];for(var n in t)s.push(n);return s.reverse(),function e(){for(;s.length;){var n=s.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=A,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var s in this)"t"===s.charAt(0)&&n.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var s=this;function i(n,i){return c.type="throw",c.arg=e,s.next=n,i&&(s.method="next",s.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var r=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(r&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(r){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var s=this.tryEntries.length-1;s>=0;--s){var i=this.tryEntries[s];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var s=this.tryEntries[t];if(s.finallyLoc===e)return this.complete(s.completion,s.afterLoc),C(s),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var s=this.tryEntries[t];if(s.tryLoc===e){var n=s.completion;if("throw"===n.type){var i=n.arg;C(s)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,s,n){return this.delegate={iterator:A(e),resultName:s,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function s(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,s),o.exports}s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";s.r(n),s.d(n,{Accessibility:()=>l,AccessibilityModulesType:()=>e}),s(958);var e;class t{constructor(){this.body=document.body||document.querySelector("body"),this.deployedMap=new Map}isIOS(){return"boolean"==typeof this._isIOS||(this._isIOS=(()=>{var e=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"];if(navigator.platform)for(;e.length;)if(navigator.platform===e.pop())return!0;return!1})()),this._isIOS}jsonToHtml(e){let t=document.createElement(e.type);for(let s in e.attrs)t.setAttribute(s,e.attrs[s]);for(let s in e.children){let n=null;n="#text"===e.children[s].type?document.createTextNode(e.children[s].text):this.jsonToHtml(e.children[s]),(n&&n.tagName&&"undefined"!==n.tagName.toLowerCase()||3===n.nodeType)&&t.appendChild(n)}return t}injectStyle(e,t={}){let s=document.createElement("style");return s.appendChild(document.createTextNode(e)),t.className&&s.classList.add(t.className),this.body.appendChild(s),s}getFormattedDim(e){if(!e)return null;let t=function(e,t){return{size:e.substring(0,e.indexOf(t)),suffix:t}};return(e=String(e)).indexOf("%")>-1?t(e,"%"):e.indexOf("px")>-1?t(e,"px"):e.indexOf("em")>-1?t(e,"em"):e.indexOf("rem")>-1?t(e,"rem"):e.indexOf("pt")>-1?t(e,"pt"):"auto"===e?t(e,""):void 0}extend(e,t){for(let s in e)"object"==typeof e[s]?t&&t[s]&&(t[s]instanceof Array?e[s]=t[s]:e[s]=this.extend(e[s],t[s])):"object"==typeof t&&void 0!==t[s]&&(e[s]=t[s]);return e}injectIconsFont(e,t){if(e&&e.length){let s=document.getElementsByTagName("head")[0],n=0,i=!1,o=e=>{i=i||""===e.type,--n||t(i)};e.forEach((e=>{let t=document.createElement("link");t.type="text/css",t.rel="stylesheet",t.href=e,t.className="_access-font-icon-"+n++,t.onload=o,t.onerror=o,this.deployedObjects.set("."+t.className,!0),s.appendChild(t)}))}}getFixedFont(e){return this.isIOS()?e.replaceAll(" ","+"):e}getFixedPseudoFont(e){return this.isIOS()?e.replaceAll("+"," "):e}isFontLoaded(e,t){try{const s=()=>t(document.fonts.check(`1em ${e.replaceAll("+"," ")}`));document.fonts.ready.then((()=>{s()}),(()=>{s()}))}catch(e){return t(!0)}}warn(e){let t="Accessibility: ";console.warn?console.warn(t+e):console.log(t+e)}get deployedObjects(){return{get:e=>this.deployedMap.get(e),contains:e=>this.deployedMap.has(e),set:(e,t)=>{this.deployedMap.set(e,t)},remove:e=>{this.deployedMap.delete(e)},getAll:()=>this.deployedMap}}createScreenshot(e){return new Promise(((s,n)=>{this._canvas||(this._canvas=document.createElement("canvas"));const i=new Image;this._canvas.style.position="fixed",this._canvas.style.top="0",this._canvas.style.left="0",this._canvas.style.opacity="0.05",this._canvas.style.transform="scale(0.05)",i.crossOrigin="anonymous",i.onload=()=>{return e=this,n=void 0,a=function*(){document.body.appendChild(this._canvas);const e=this._canvas.getContext("2d");this._canvas.width=i.naturalWidth,this._canvas.height=i.naturalHeight,e.clearRect(0,0,this._canvas.width,this._canvas.height),e.drawImage(i,0,0);let n=t.DEFAULT_PIXEL;try{n=this._canvas.toDataURL("image/png")}catch(e){}s(n),this._canvas.remove()},new((o=void 0)||(o=Promise))((function(t,s){function i(e){try{r(a.next(e))}catch(e){s(e)}}function c(e){try{r(a.throw(e))}catch(e){s(e)}}function r(e){var s;e.done?t(e.value):(s=e.value,s instanceof o?s:new o((function(e){e(s)}))).then(i,c)}r((a=a.apply(e,n||[])).next())}));var e,n,o,a},i.onerror=()=>{s(t.DEFAULT_PIXEL)},i.src=e}))}getFileExtension(e){return e.substring(e.lastIndexOf(".")+1,e.length)||e}}t.DEFAULT_PIXEL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdj+P///38ACfsD/QVDRcoAAAAASUVORK5CYII=",function(e){e[e.increaseText=1]="increaseText",e[e.decreaseText=2]="decreaseText",e[e.increaseTextSpacing=3]="increaseTextSpacing",e[e.decreaseTextSpacing=4]="decreaseTextSpacing",e[e.increaseLineHeight=5]="increaseLineHeight",e[e.decreaseLineHeight=6]="decreaseLineHeight",e[e.invertColors=7]="invertColors",e[e.grayHues=8]="grayHues",e[e.bigCursor=9]="bigCursor",e[e.readingGuide=10]="readingGuide",e[e.underlineLinks=11]="underlineLinks",e[e.textToSpeech=12]="textToSpeech",e[e.speechToText=13]="speechToText",e[e.disableAnimations=14]="disableAnimations",e[e.iframeModals=15]="iframeModals",e[e.customFunctions=16]="customFunctions"}(e||(e={}));var i=function(e,t,s,n){return new(s||(s=Promise))((function(i,o){function a(e){try{r(n.next(e))}catch(e){o(e)}}function c(e){try{r(n.throw(e))}catch(e){o(e)}}function r(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(a,c)}r((n=n.apply(e,t||[])).next())}))};class o{constructor(e){this._acc=e,this.readBind=this._acc.read.bind(this._acc)}increaseText(){this._acc.alterTextSize(!0)}decreaseText(){this._acc.alterTextSize(!1)}increaseTextSpacing(){this._acc.alterTextSpace(!0)}decreaseTextSpacing(){this._acc.alterTextSpace(!1)}invertColors(e){if(void 0===this._acc.stateValues.html.backgroundColor&&(this._acc.stateValues.html.backgroundColor=getComputedStyle(this._acc.html).backgroundColor),void 0===this._acc.stateValues.html.color&&(this._acc.stateValues.html.color=getComputedStyle(this._acc.html).color),e)return this._acc.resetIfDefined(this._acc.stateValues.html.backgroundColor,this._acc.html.style,"backgroundColor"),this._acc.resetIfDefined(this._acc.stateValues.html.color,this._acc.html.style,"color"),this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="invertColors"]').classList.remove("active"),this._acc.stateValues.invertColors=!1,this._acc.sessionState.invertColors=this._acc.stateValues.invertColors,this._acc.onChange(!0),void(this._acc.html.style.filter="");this._acc.stateValues.invertColors&&this._acc.stateValues.textToSpeech&&this._acc.textToSpeech("Colors Set To Normal"),this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="invertColors"]').classList.toggle("active"),this._acc.stateValues.invertColors=!this._acc.stateValues.invertColors,this._acc.sessionState.invertColors=this._acc.stateValues.invertColors,this._acc.onChange(!0),this._acc.stateValues.invertColors?(this._acc.stateValues.grayHues&&this._acc.menuInterface.grayHues(!0),this._acc.html.style.filter="invert(1)",this._acc.stateValues.textToSpeech&&this._acc.textToSpeech("Colors Inverted")):this._acc.html.style.filter=""}grayHues(e){if(void 0===this._acc.stateValues.html.filter&&(this._acc.stateValues.html.filter=getComputedStyle(this._acc.html).filter),void 0===this._acc.stateValues.html.webkitFilter&&(this._acc.stateValues.html.webkitFilter=getComputedStyle(this._acc.html).webkitFilter),void 0===this._acc.stateValues.html.mozFilter&&(this._acc.stateValues.html.mozFilter=getComputedStyle(this._acc.html).mozFilter),void 0===this._acc.stateValues.html.msFilter&&(this._acc.stateValues.html.msFilter=getComputedStyle(this._acc.html).msFilter),e)return this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="grayHues"]').classList.remove("active"),this._acc.stateValues.grayHues=!1,this._acc.sessionState.grayHues=this._acc.stateValues.grayHues,this._acc.onChange(!0),this._acc.resetIfDefined(this._acc.stateValues.html.filter,this._acc.html.style,"filter"),this._acc.resetIfDefined(this._acc.stateValues.html.webkitFilter,this._acc.html.style,"webkitFilter"),this._acc.resetIfDefined(this._acc.stateValues.html.mozFilter,this._acc.html.style,"mozFilter"),void this._acc.resetIfDefined(this._acc.stateValues.html.msFilter,this._acc.html.style,"msFilter");let t;this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="grayHues"]').classList.toggle("active"),this._acc.stateValues.grayHues=!this._acc.stateValues.grayHues,this._acc.sessionState.grayHues=this._acc.stateValues.grayHues,this._acc.onChange(!0),this._acc.stateValues.textToSpeech&&!this._acc.stateValues.grayHues&&this._acc.textToSpeech("Gray Hues Disabled."),this._acc.stateValues.grayHues?(t="grayscale(1)",this._acc.stateValues.invertColors&&this.invertColors(!0),this._acc.stateValues.textToSpeech&&this._acc.textToSpeech("Gray Hues Enabled.")):t="",this._acc.html.style.webkitFilter=t,this._acc.html.style.mozFilter=t,this._acc.html.style.msFilter=t,this._acc.html.style.filter=t}underlineLinks(e){let t="_access-underline",s=()=>{let e=document.querySelector("."+t);e&&(e.parentElement.removeChild(e),this._acc.common.deployedObjects.remove("."+t))};if(e)return this._acc.stateValues.underlineLinks=!1,this._acc.sessionState.underlineLinks=this._acc.stateValues.underlineLinks,this._acc.onChange(!0),this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="underlineLinks"]').classList.remove("active"),s();if(this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="underlineLinks"]').classList.toggle("active"),this._acc.stateValues.underlineLinks=!this._acc.stateValues.underlineLinks,this._acc.sessionState.underlineLinks=this._acc.stateValues.underlineLinks,this._acc.onChange(!0),this._acc.stateValues.underlineLinks){let e="\n            body a {\n                text-decoration: underline !important;\n            }\n        ";this._acc.common.injectStyle(e,{className:t}),this._acc.common.deployedObjects.set("."+t,!0),this._acc.stateValues.textToSpeech&&this._acc.textToSpeech("Links UnderLined")}else this._acc.stateValues.textToSpeech&&this._acc.textToSpeech("Links UnderLine Removed"),s()}bigCursor(e){if(e)return this._acc.html.classList.remove("_access_cursor"),this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="bigCursor"]').classList.remove("active"),this._acc.stateValues.bigCursor=!1,this._acc.sessionState.bigCursor=!1,void this._acc.onChange(!0);this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="bigCursor"]').classList.toggle("active"),this._acc.stateValues.bigCursor=!this._acc.stateValues.bigCursor,this._acc.sessionState.bigCursor=this._acc.stateValues.bigCursor,this._acc.onChange(!0),this._acc.html.classList.toggle("_access_cursor"),this._acc.stateValues.textToSpeech&&this._acc.stateValues.bigCursor&&this._acc.textToSpeech("Big Cursor Enabled"),this._acc.stateValues.textToSpeech&&!this._acc.stateValues.bigCursor&&this._acc.textToSpeech("Big Cursor Disabled")}readingGuide(e){if(e)return document.getElementById("access_read_guide_bar")&&document.getElementById("access_read_guide_bar").remove(),this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="readingGuide"]').classList.remove("active"),this._acc.stateValues.readingGuide=!1,this._acc.sessionState.readingGuide=this._acc.stateValues.readingGuide,this._acc.onChange(!0),document.body.removeEventListener("touchmove",this._acc.updateReadGuide,!1),document.body.removeEventListener("mousemove",this._acc.updateReadGuide,!1),void(this._acc.stateValues.textToSpeech&&this._acc.textToSpeech("Reading Guide Enabled"));if(this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="readingGuide"]').classList.toggle("active"),this._acc.stateValues.readingGuide=!this._acc.stateValues.readingGuide,this._acc.sessionState.readingGuide=this._acc.stateValues.readingGuide,this._acc.onChange(!0),this._acc.stateValues.readingGuide){let e=document.createElement("div");e.id="access_read_guide_bar",e.classList.add("access_read_guide_bar"),document.body.append(e),document.body.addEventListener("touchmove",this._acc.updateReadGuide,!1),document.body.addEventListener("mousemove",this._acc.updateReadGuide,!1)}else void 0!==document.getElementById("access_read_guide_bar")&&document.getElementById("access_read_guide_bar").remove(),document.body.removeEventListener("touchmove",this._acc.updateReadGuide,!1),document.body.removeEventListener("mousemove",this._acc.updateReadGuide,!1),this._acc.stateValues.textToSpeech&&this._acc.textToSpeech("Reading Guide Disabled")}textToSpeech(e){const t=document.querySelector('._access-menu [data-access-action="textToSpeech"]');if(!t)return;let s=document.getElementsByClassName("screen-reader-wrapper-step-1"),n=document.getElementsByClassName("screen-reader-wrapper-step-2"),i=document.getElementsByClassName("screen-reader-wrapper-step-3");this._acc.onChange(!1);const o="_access-text-to-speech";let a=()=>{let e=document.querySelector("."+o);e&&(e.parentElement.removeChild(e),document.removeEventListener("click",this.readBind,!1),document.removeEventListener("keyup",this.readBind,!1),this._acc.common.deployedObjects.remove("."+o)),window.speechSynthesis&&window.speechSynthesis.cancel(),this._acc.isReading=!1};if(e)return t.classList.remove("active"),s[0].classList.remove("active"),n[0].classList.remove("active"),i[0].classList.remove("active"),this._acc.stateValues.textToSpeech=!1,window.speechSynthesis.cancel(),a();if(1!==this._acc.stateValues.speechRate||t.classList.contains("active"))if(1===this._acc.stateValues.speechRate&&t.classList.contains("active"))this._acc.stateValues.speechRate=1.5,this._acc.textToSpeech("Reading Pace - Fast"),s[0].classList.remove("active");else{if(1.5!==this._acc.stateValues.speechRate||!t.classList.contains("active")){this._acc.stateValues.speechRate=1,this._acc.textToSpeech("Screen Reader - Disabled"),t.classList.remove("active"),i[0].classList.remove("active");let e=setInterval((()=>{this._acc.isReading||(this._acc.stateValues.textToSpeech=!1,a(),clearTimeout(e))}),500);return}this._acc.stateValues.speechRate=.7,this._acc.textToSpeech("Reading Pace - Slow"),n[0].classList.remove("active")}else this._acc.stateValues.textToSpeech=!0,this._acc.textToSpeech("Screen Reader enabled. Reading Pace - Normal"),t.classList.add("active"),s[0].classList.add("active"),n[0].classList.add("active"),i[0].classList.add("active");t.classList.contains("active")&&1===this._acc.stateValues.speechRate&&(this._acc.common.injectStyle("\n            *:hover {\n                box-shadow: 2px 2px 2px rgba(180,180,180,0.7);\n            }\n        ",{className:o}),this._acc.common.deployedObjects.set("."+o,!0),document.addEventListener("click",this.readBind,!1),document.addEventListener("keyup",this.readBind,!1))}speechToText(e){const t=document.querySelector('._access-menu [data-access-action="speechToText"]');if(!t)return;this._acc.onChange(!1);let s="_access-speech-to-text",n=()=>{this._acc.recognition&&(this._acc.recognition.stop(),this._acc.body.classList.remove("_access-listening"));let e=document.querySelector("."+s);e&&(e.parentElement.removeChild(e),this._acc.common.deployedObjects.remove("."+s));let n=document.querySelectorAll("._access-mic");for(let e=0;e<n.length;e++)n[e].removeEventListener("focus",this._acc.listen.bind(this._acc),!1),n[e].classList.remove("_access-mic");t.classList.remove("active")};if(e)return this._acc.stateValues.speechToText=!1,n();if(this._acc.stateValues.speechToText=!this._acc.stateValues.speechToText,this._acc.stateValues.speechToText){let e=`\n                body:after {\n                    content: ${this._acc.options.icon.useEmojis?'var(--_access-menu-item-icon-mic,"🎀")':'"mic"'};\n                    ${this._acc.options.icon.useEmojis?"":`font-family: var(--_access-menu-item-icon-font-family-after, ${this._acc.fixedDefaultFont}`}\n                    position: fixed;\n                    z-index: 1100;\n                    top: 1vw;\n                    right: 1vw;\n                    width: 36px;\n                    height: 36px;\n                    font-size: 30px;\n                    line-height: 36px;\n                    border-radius: 50%;\n                    background: rgba(255,255,255,0.7);\n                    display: flex;\n                    justify-content: center;\n                    aling-items: center;\n                }\n\n                body._access-listening:after {\n                    animation: _access-listening-animation 2s infinite ease;\n                }\n\n                @keyframes _access-listening-animation {\n                    0%  {background-color: transparent;}\n                    50%  {background-color: #EF9A9A;}\n                }\n            `;this._acc.common.injectStyle(e,{className:s}),this._acc.common.deployedObjects.set("."+s,!0);let n=document.querySelectorAll('input[type="text"], input[type="email"], input[type="tel"], input[type="search"], textarea, [contenteditable]');for(let e=0;e<n.length;e++)n[e].addEventListener("blur",(()=>{"object"==typeof this._acc.recognition&&"function"==typeof this._acc.recognition.stop&&this._acc.recognition.stop()}),!1),n[e].addEventListener("focus",this._acc.listen.bind(this._acc),!1),n[e].parentElement.classList.add("_access-mic");t.classList.add("active")}else n()}disableAnimations(e){const t="_access-disable-animations",s="data-autoplay-stopped",n=()=>{this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="disableAnimations"]').classList.remove("active"),this._acc.stateValues.disableAnimations=!1;let e=document.querySelector("."+t);e&&(e.parentElement.removeChild(e),this._acc.common.deployedObjects.remove("."+t)),document.querySelectorAll("[data-org-src]").forEach((e=>i(this,void 0,void 0,(function*(){const t=e.src;e.setAttribute("src",e.getAttribute("data-org-src")),e.setAttribute("data-org-src",t)})))),document.querySelectorAll(`video[${s}]`).forEach((e=>{e.setAttribute("autoplay",""),e.removeAttribute(s),e.play()}))};e?n():(this._acc.stateValues.disableAnimations=!this._acc.stateValues.disableAnimations,this._acc.stateValues.disableAnimations?(this._acc.options.suppressDomInjection||document.querySelector('._access-menu [data-access-action="disableAnimations"]').classList.add("active"),this._acc.common.injectStyle("\n                body * {\n                    animation-duration: 0.0ms !important;\n                    transition-duration: 0.0ms !important;\n                }\n        ",{className:t}),this._acc.common.deployedObjects.set("."+t,!0),document.querySelectorAll("img").forEach((e=>i(this,void 0,void 0,(function*(){let t=this._acc.common.getFileExtension(e.src);if(t&&"gif"===t.toLowerCase()){let t=e.getAttribute("data-org-src");t||(t=yield this._acc.common.createScreenshot(e.src)),e.setAttribute("data-org-src",e.src),e.src=t}})))),document.querySelectorAll("video[autoplay]").forEach((e=>{e.setAttribute(s,""),e.removeAttribute("autoplay"),e.pause()}))):n())}iframeModals(e,t){t||(e=!0);const s=()=>{this._dialog&&(this._dialog.classList.add("closing"),setTimeout((()=>{this._dialog.classList.remove("closing"),this._dialog.close(),this._dialog.remove()}),350),i()),t&&t.classList.remove("active")},n=()=>{s()},i=()=>{this._dialog.querySelector("button").removeEventListener("click",n,!1),this._dialog.removeEventListener("close",n)};e?s():(t.classList.add("active"),this._dialog||(this._dialog=document.createElement("dialog")),this._dialog.classList.add("_access"),this._dialog.innerHTML="",this._dialog.appendChild(this._acc.common.jsonToHtml({type:"div",children:[{type:"div",children:[{type:"button",attrs:{role:"button",class:this._acc.options.icon.useEmojis?"":this._acc.options.icon.fontClass,style:"position: absolute;\n                                    top: 5px;\n                                    cursor: pointer;\n                                    font-size: 24px !important;\n                                    font-weight: bold;\n                                    background: transparent;\n                                    border: none;\n                                    left: 5px;\n                                    color: #d63c3c;\n                                    padding: 0;"},children:[{type:"#text",text:this._acc.options.icon.useEmojis?"X":"close"}]}]},{type:"div",children:[{type:"iframe",attrs:{src:t.getAttribute("data-access-url"),style:"width: 50vw;height: 50vh;padding: 30px;"}}]}]})),document.body.appendChild(this._dialog),this._dialog.querySelector("button").addEventListener("click",n,!1),this._dialog.addEventListener("close",n),this._dialog.showModal())}customFunctions(e,t){if(!t)return;const s=this._acc.options.customFunctions[parseInt(t.getAttribute("data-access-custom-index"))];s.toggle&&t.classList.contains("active")&&(e=!0),e?(s.toggle&&t.classList.remove("active"),s.method(s,!1)):(s.toggle&&t.classList.add("active"),s.method(s,!0))}increaseLineHeight(){this._acc.alterLineHeight(!0)}decreaseLineHeight(){this._acc.alterLineHeight(!1)}}class a{constructor(){}has(e){return window.localStorage.hasOwnProperty(e)}set(e,t){window.localStorage.setItem(e,JSON.stringify(t))}get(e){let t=window.localStorage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}clear(){window.localStorage.clear()}remove(e){window.localStorage.removeItem(e)}isSupported(){let e="_test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}}var c=function(e,t,s,n){return new(s||(s=Promise))((function(i,o){function a(e){try{r(n.next(e))}catch(e){o(e)}}function c(e){try{r(n.throw(e))}catch(e){o(e)}}function r(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(a,c)}r((n=n.apply(e,t||[])).next())}))};class r{constructor(e={}){this._common=new t,this._storage=new a,this._fixedDefaultFont=this._common.getFixedFont("Material Icons"),this._options=this.defaultOptions,this.options=this._common.extend(this._options,e),this.addModuleOrderIfNotDefined(),this.addDefaultOptions(e),this.disabledUnsupportedFeatures(),this._onKeyDownBind=this.onKeyDown.bind(this),this._sessionState={textSize:0,textSpace:0,lineHeight:0,invertColors:!1,grayHues:!1,underlineLinks:!1,bigCursor:!1,readingGuide:!1},this.options.icon.useEmojis?(this.fontFallback(),this.build()):this._common.injectIconsFont(this.options.icon.fontFaceSrc,(e=>{this.build(),this.options.icon.fontFamilyValidation&&setTimeout((()=>{this._common.isFontLoaded(this.options.icon.fontFamilyValidation,(t=>{t&&!e||(console.log("!isLoaded || hasError",!t||e),this._common.warn(`${this.options.icon.fontFamilyValidation} font was not loaded, using emojis instead`),this.fontFallback(),this.destroy(),this.build())}))}))})),this.options.modules.speechToText&&window.addEventListener("beforeunload",(()=>{this._isReading&&(window.speechSynthesis.cancel(),this._isReading=!1)}))}get stateValues(){return this._stateValues}set stateValues(e){this._stateValues=e}get html(){return this._html}get body(){return this._body}get sessionState(){return this._sessionState}set sessionState(e){this._sessionState=e}get common(){return this._common}get recognition(){return this._recognition}get isReading(){return this._isReading}set isReading(e){this._isReading=e}get fixedDefaultFont(){return this._fixedDefaultFont}get defaultOptions(){const t={icon:{img:"accessibility",fontFaceSrc:["https://fonts.googleapis.com/icon?family=Material+Icons"],fontClass:"material-icons",useEmojis:!1,closeIcon:"close",resetIcon:"refresh"},hotkeys:{enabled:!1,helpTitles:!0,keys:{toggleMenu:["ctrlKey","altKey",65],invertColors:["ctrlKey","altKey",73],grayHues:["ctrlKey","altKey",71],underlineLinks:["ctrlKey","altKey",85],bigCursor:["ctrlKey","altKey",67],readingGuide:["ctrlKey","altKey",82],textToSpeech:["ctrlKey","altKey",84],speechToText:["ctrlKey","altKey",83],disableAnimations:["ctrlKey","altKey",81]}},guide:{cBorder:"#20ff69",cBackground:"#000000",height:"12px"},suppressCssInjection:!1,suppressDomInjection:!1,labels:{resetTitle:"Reset",closeTitle:"Close",menuTitle:"Accessibility Options",increaseText:"increase text size",decreaseText:"decrease text size",increaseTextSpacing:"increase text spacing",decreaseTextSpacing:"decrease text spacing",invertColors:"invert colors",grayHues:"gray hues",bigCursor:"big cursor",readingGuide:"reading guide",underlineLinks:"underline links",textToSpeech:"text to speech",speechToText:"speech to text",disableAnimations:"disable animations",increaseLineHeight:"increase line height",decreaseLineHeight:"decrease line height",hotkeyPrefix:"Hotkey: "},textPixelMode:!1,textEmlMode:!0,textSizeFactor:12.5,animations:{buttons:!0},modules:{increaseText:!0,decreaseText:!0,increaseTextSpacing:!0,decreaseTextSpacing:!0,increaseLineHeight:!0,decreaseLineHeight:!0,invertColors:!0,grayHues:!0,bigCursor:!0,readingGuide:!0,underlineLinks:!0,textToSpeech:!0,speechToText:!0,disableAnimations:!0,iframeModals:!0,customFunctions:!0},modulesOrder:[],session:{persistent:!0},iframeModals:[],customFunctions:[],statement:{url:""},feedback:{url:""},language:{textToSpeechLang:"",speechToTextLang:""}};return Object.keys(e).forEach(((e,s)=>{const n=parseInt(e);isNaN(n)||t.modulesOrder.push({type:n,order:n})})),t}initFontSize(){if(!this._htmlInitFS){let e=this._common.getFormattedDim(getComputedStyle(this._html).fontSize),t=this._common.getFormattedDim(getComputedStyle(this._body).fontSize);this._html.style.fontSize=e.size/16*100+"%",this._htmlOrgFontSize=this._html.style.fontSize,this._body.style.fontSize=t.size/e.size+"em"}}fontFallback(){this.options.icon.useEmojis=!0,this.options.icon.img="β™Ώ",this.options.icon.fontClass=""}addDefaultOptions(e){var t,s,n;(null===(t=e.icon)||void 0===t?void 0:t.closeIconElem)&&(this.options.icon.closeIconElem=e.icon.closeIconElem),(null===(s=e.icon)||void 0===s?void 0:s.resetIconElem)&&(this.options.icon.resetIconElem=e.icon.resetIconElem),(null===(n=e.icon)||void 0===n?void 0:n.imgElem)&&(this.options.icon.imgElem=e.icon.imgElem),this.options.icon.closeIconElem||(this.options.icon.closeIconElem={type:"#text",text:`${this.options.icon.useEmojis?"X":this.options.icon.closeIcon}`}),this.options.icon.resetIconElem||(this.options.icon.resetIconElem={type:"#text",text:`${this.options.icon.useEmojis?"β™²":this.options.icon.resetIcon}`}),this.options.icon.imgElem||(this.options.icon.imgElem={type:"#text",text:this.options.icon.img})}addModuleOrderIfNotDefined(){this.defaultOptions.modulesOrder.forEach((e=>{this.options.modulesOrder.find((t=>t.type===e.type))||this.options.modulesOrder.push(e)}))}disabledUnsupportedFeatures(){"webkitSpeechRecognition"in window&&"https:"===location.protocol||(this._common.warn("speech to text isn't supported in this browser or in http protocol (https required)"),this.options.modules.speechToText=!1);const e=window;e.SpeechSynthesisUtterance&&e.speechSynthesis||(this._common.warn("text to speech isn't supported in this browser"),this.options.modules.textToSpeech=!1)}injectCss(e){const t="7px",s="5px";let n;const i=`\n        html._access_cursor * {\n            cursor: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyOS4xODhweCIgaGVpZ2h0PSI0My42MjVweCIgdmlld0JveD0iMCAwIDI5LjE4OCA0My42MjUiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI5LjE4OCA0My42MjUiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwb2x5Z29uIGZpbGw9IiNGRkZGRkYiIHN0cm9rZT0iI0Q5REFEOSIgc3Ryb2tlLXdpZHRoPSIxLjE0MDYiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgcG9pbnRzPSIyLjgsNC41NDkgMjYuODQ3LDE5LjkwMiAxNi45NjQsMjIuNzAxIDI0LjIzOSwzNy43NDkgMTguMjc4LDQyLjAxNyA5Ljc0MSwzMC43MjQgMS4xMzgsMzUuODA5ICIvPjxnPjxnPjxnPjxwYXRoIGZpbGw9IiMyMTI2MjciIGQ9Ik0yOS4xNzUsMjEuMTU1YzAuMDcxLTAuNjEzLTAuMTY1LTEuMjUzLTAuNjM1LTEuNTczTDIuMTY1LDAuMjU4Yy0wLjQyNC0wLjMyLTAuOTg4LTAuMzQ2LTEuNDM1LTAuMDUzQzAuMjgyLDAuNDk3LDAsMS4wMywwLDEuNjE3djM0LjE3MWMwLDAuNjEzLDAuMzA2LDEuMTQ2LDAuNzc2LDEuNDM5YzAuNDcxLDAuMjY3LDEuMDU5LDAuMjEzLDEuNDgyLTAuMTZsNy40ODItNi4zNDRsNi44NDcsMTIuMTU1YzAuMjU5LDAuNDgsMC43MjksMC43NDYsMS4yLDAuNzQ2YzAuMjM1LDAsMC40OTQtMC4wOCwwLjcwNi0wLjIxM2w2Ljk4OC00LjU4NWMwLjMyOS0wLjIxMywwLjU2NS0wLjU4NiwwLjY1OS0xLjAxM2MwLjA5NC0wLjQyNiwwLjAyNC0wLjg4LTAuMTg4LTEuMjI2bC02LjM3Ni0xMS4zODJsOC42MTEtMi43NDVDMjguNzA1LDIyLjI3NCwyOS4xMDUsMjEuNzY4LDI5LjE3NSwyMS4xNTV6IE0xNi45NjQsMjIuNzAxYy0wLjQyNCwwLjEzMy0wLjc3NiwwLjUwNi0wLjk0MSwwLjk2Yy0wLjE2NSwwLjQ4LTAuMTE4LDEuMDEzLDAuMTE4LDEuNDM5bDYuNTg4LDExLjc4MWwtNC41NDEsMi45ODVsLTYuODk0LTEyLjMxNWMtMC4yMTItMC4zNzMtMC41NDEtMC42NC0wLjk0MS0wLjcyYy0wLjA5NC0wLjAyNy0wLjE2NS0wLjAyNy0wLjI1OS0wLjAyN2MtMC4zMDYsMC0wLjU4OCwwLjEwNy0wLjg0NywwLjMyTDIuOCwzMi41OVY0LjU0OWwyMS41OTksMTUuODA2TDE2Ljk2NCwyMi43MDF6Ii8+PC9nPjwvZz48L2c+PC9nPjwvc3ZnPg==),auto!important;\n        }\n        @keyframes _access-dialog-backdrop {\n            0% {\n                background: var(--_access-menu-dialog-backdrop-background-start, rgba(0, 0, 0, 0.1))\n            }\n            100% {\n                background: var(--_access-menu-dialog-backdrop-background-end, rgba(0, 0, 0, 0.5))\n            }\n        }\n        dialog._access::backdrop, dialog._access {\n            transition-duration: var(--_access-menu-dialog-backdrop-transition-duration, 0.35s);\n            transition-timing-function: var(--_access-menu-dialog-backdrop-transition-timing-function, ease-in-out);\n        }\n        dialog._access:modal {\n            border-color: transparent;\n            border-width: 0;\n            padding: 0;\n        }\n        dialog._access[open]::backdrop {\n            background: var(--_access-menu-dialog-backdrop-background-end, rgba(0, 0, 0, 0.5));\n            animation: _access-dialog-backdrop var(--_access-menu-dialog-backdrop-transition-duration, 0.35s) ease-in-out;\n        }\n        dialog._access.closing[open]::backdrop {\n            background: var(--_access-menu-dialog-backdrop-background-start, rgba(0, 0, 0, 0.1));\n        }\n        dialog._access.closing[open] {\n            opacity: 0;\n        }\n        .screen-reader-wrapper {\n            margin: 0;\n            position: absolute;\n            bottom: -4px;\n            width: calc(100% - 2px);\n            left: 1px;\n        }\n        .screen-reader-wrapper-step-1, .screen-reader-wrapper-step-2,.screen-reader-wrapper-step-3 {\n            float: left;\n            background: var(--_access-menu-background-color, #fff);\n            width: 33.33%;\n            height: 3px;\n            border-radius: 10px;\n        }\n        .screen-reader-wrapper-step-1.active, .screen-reader-wrapper-step-2.active,.screen-reader-wrapper-step-3.active {\n            background: var(--_access-menu-item-button-background, #f9f9f9);\n        }\n        .access_read_guide_bar {\n            box-sizing: border-box;\n            background: var(--_access-menu-read-guide-bg, ${this.options.guide.cBackground});\n            width: 100%!important;\n            min-width: 100%!important;\n            position: fixed!important;\n            height: var(--_access-menu-read-guide-height, ${this.options.guide.height}) !important;\n            border: var(--_access-menu-read-guide-border, solid 3px ${this.options.guide.cBorder});\n            border-radius: 5px;\n            top: 15px;\n            z-index: 2147483647;\n        }`;n=e?`\n            ._access-scrollbar::-webkit-scrollbar-track, .mat-autocomplete-panel::-webkit-scrollbar-track, .mat-tab-body-content::-webkit-scrollbar-track, .mat-select-panel:not([class*='mat-elevation-z'])::-webkit-scrollbar-track, .mat-menu-panel::-webkit-scrollbar-track {\n                -webkit-box-shadow: var(--_access-scrollbar-track-box-shadow, inset 0 0 6px rgba(0,0,0,0.3));\n                background-color: var(--_access-scrollbar-track-background-color, #F5F5F5);\n            }\n            ._access-scrollbar::-webkit-scrollbar, .mat-autocomplete-panel::-webkit-scrollbar, .mat-tab-body-content::-webkit-scrollbar, .mat-select-panel:not([class*='mat-elevation-z'])::-webkit-scrollbar, .mat-menu-panel::-webkit-scrollbar {\n                width: var(--_access-scrollbar-width, 6px);\n                background-color: var(--_access-scrollbar-background-color, #F5F5F5);\n            }\n            ._access-scrollbar::-webkit-scrollbar-thumb, .mat-autocomplete-panel::-webkit-scrollbar-thumb, .mat-tab-body-content::-webkit-scrollbar-thumb, .mat-select-panel:not([class*='mat-elevation-z'])::-webkit-scrollbar-thumb, .mat-menu-panel::-webkit-scrollbar-thumb {\n                background-color: var(--_access-scrollbar-thumb-background-color, #999999);\n            }\n            ._access-icon {\n                position: var(--_access-icon-position, fixed);\n                width: var(--_access-icon-width, 50px);\n                height: var(--_access-icon-height, 50px);\n                bottom: var(--_access-icon-bottom, 50px);\n                top: var(--_access-icon-top, unset);\n                left: var(--_access-icon-left, unset);\n                right: var(--_access-icon-right, 10px);\n                z-index: var(--_access-icon-z-index, 9999);\n                font: var(--_access-icon-font, 40px / 45px "Material Icons");\n                background: var(--_access-icon-bg, #4054b2);\n                color: var(--_access-icon-color, #fff);\n                background-repeat: no-repeat;\n                background-size: contain;\n                cursor: pointer;\n                opacity: 0;\n                transition-duration: .35s;\n                -moz-user-select: none;\n                -webkit-user-select: none;\n                -ms-user-select: none;\n                user-select: none;\n                ${this.options.icon.useEmojis?"":"box-shadow: 1px 1px 5px rgba(0,0,0,.5);"}\n                transform: ${this.options.icon.useEmojis?"skewX(14deg)":"scale(1)"};\n                border-radius: var(--_access-icon-border-radius);\n                border: var(--_access-icon-border);\n                text-align: var(--_access-icon-text-align, center);\n            }\n            ._access-icon:hover {\n                transform: var(--_access-icon-transform-hover, scale(1.1));\n                vertical-align: var(--_access-icon-vertical-align-hover);\n            }\n            ._access-menu {\n                -moz-user-select: none;\n                -webkit-user-select: none;\n                -ms-user-select: none;\n                user-select: none;\n                position: fixed;\n                width: var(--_access-menu-width, ${r.MENU_WIDTH});\n                height: var(--_access-menu-height, auto);\n                transition-duration: var(--_access-menu-transition-duration, .35s);\n                z-index: var(--_access-menu-z-index, 99991);\n                opacity: 1;\n                background-color: var(--_access-menu-background-color, #fff);\n                color: var(--_access-menu-color, #000);\n                border-radius: var(--_access-menu-border-radius, 3px);\n                border: var(--_access-menu-border, solid 1px #f1f0f1);\n                font-family: var(--_access-menu-font-family, RobotoDraft, Roboto, sans-serif, Arial);\n                min-width: var(--_access-menu-min-width, 300px);\n                box-shadow: var(--_access-menu-box-shadow, 0px 0px 1px #aaa);\n                max-height: calc(100vh - 80px);\n                ${"rtl"===getComputedStyle(this._body).direction?"text-indent: -5px":""}\n                top: var(--_access-menu-top, unset);\n                left: var(--_access-menu-left, unset);\n                bottom: var(--_access-menu-bottom, 0);\n                right: var(--_access-menu-right, 0);\n            }\n            ._access-menu.close {\n                z-index: -1;\n                width: 0;\n                opacity: 0;\n                background-color: transparent;\n                left: calc(-1 * var(--_access-menu-left), unset);\n                right: calc(-1 * var(--_access-menu-width, ${r.MENU_WIDTH}));\n            }\n            ._access-menu ._text-center {\n                font-size: var(--_access-menu-header-font-size, 22px);\n                font-weight: var(--_access-menu-header-font-weight, nornal);\n                margin: var(--_access-menu-header-margin, 20px 0 10px);\n                padding: 0;\n                color: var(--_access-menu-header-color, rgba(0,0,0,.87));\n                letter-spacing: var(--_access-menu-header-letter-spacing, initial);\n                word-spacing: var(--_access-menu-header-word-spacing, initial);\n                text-align: var(--_access-menu-header-text-align, center);\n            }\n            ._access-menu ._menu-close-btn {\n                left: 5px;\n                color: #d63c3c;\n                transition: .3s ease;\n                transform: rotate(0deg);\n                font-style: normal !important;\n            }\n            ._access-menu ._menu-reset-btn:hover,._access-menu ._menu-close-btn:hover {\n                transform: var(--_access-menu-header-btn-hover-rotate, rotate(180deg));\n            }\n            ._access-menu ._menu-reset-btn {\n                right: 5px;\n                color: #4054b2;\n                transition: .3s ease;\n                transform: rotate(0deg);\n                font-style: normal !important;\n            }\n            ._access-menu ._menu-btn {\n                position: absolute;\n                top: 5px;\n                cursor: pointer;\n                font-size: 24px !important;\n                font-weight: bold;\n                background: transparent;\n                border: none;\n            }\n            ._access-menu ul {\n                padding: 0 0 5px;\n                position: relative;\n                font-size: var(--_access-menu-font-size, 18px);\n                margin: 0;\n                overflow: auto;\n                max-height: var(--_access-menu-max-height, calc(100vh - 145px));\n                display: flex;\n                flex-flow: column;\n                gap: 5px;\n            }\n            ${i}\n            ._access-menu ul li {\n                position: relative;\n                list-style-type: none;\n                -ms-user-select: none;\n                -moz-user-select: none;\n                -webkit-user-select: none;\n                user-select: none;\n                margin: 0 5px 0 8px;\n                font: { size: 18, units: 'px' }\n                font-size: var(--_access-menu-item-font-size, 18px) !important;\n                line-height: var(--_access-menu-item-line-height, 18px) !important;\n                color: var(--_access-menu-item-color, rgba(0,0,0,.6));\n                letter-spacing: var(--_access-menu-item-letter-spacing, initial);\n                word-spacing: var(--_access-menu-item-word-spacing, initial);\n                width: calc(100% - 17px);\n            }\n            ._access-menu ul li button {\n                background: var(--_access-menu-item-button-background, #f9f9f9);\n                padding: var(--_access-menu-item-button-padding, 10px 0);\n                width: 100%;\n                text-indent: var(--_access-menu-item-button-text-indent, 35px);\n                text-align: start;\n                position: relative;\n                transition-duration: var(--_access-menu-item-button-transition-duration, .35s);\n                transition-timing-function: var(--_access-menu-item-button-transition-timing-function, ease-in-out);\n                border: var(--_access-menu-item-button-border, solid 1px #f1f0f1);\n                border-radius: var(--_access-menu-item-button-border-radius, 4px);\n                cursor: pointer;\n            }\n            ._access-menu ul li.position {\n                display: inline-block;\n                width: auto;\n            }\n            ._access-menu ul.before-collapse li button {\n                opacity: var(--_access-menu-item-button-before-collapse-opacity, 0.05);\n            }\n            ._access-menu ul li button.active, ._access-menu ul li button.active:hover {\n                background-color: var(--_access-menu-item-button-active-background-color, #000);\n            }\n            ._access-menu div.active {\n                color: var(--_access-menu-div-active-color, #fff);\n                background-color: var(--_access-menu-div-active-background-color, #000);\n            }\n            ._access-menu ul li button.active, ._access-menu ul li button.active:hover, ._access-menu ul li button.active:before, ._access-menu ul li button.active:hover:before {\n                color: var(--_access-menu-item-button-active-color, #fff);\n            }\n            ._access-menu ul li button:hover {\n                color: var(--_access-menu-item-button-hover-color, rgba(0,0,0,.8));\n                background-color: var(--_access-menu-item-button-hover-background-color, #eaeaea);\n            }\n            ._access-menu ul li.not-supported {\n                display: none;\n            }\n            ._access-menu ul li button:before {\n                content: ' ';\n                font-family: var(--_access-menu-button-font-family-before, ${this._fixedDefaultFont});\n                text-rendering: optimizeLegibility;\n                font-feature-settings: "liga" 1;\n                font-style: normal;\n                text-transform: none;\n                line-height: ${this.options.icon.useEmojis?"1.1":"1"};\n                font-size: ${this.options.icon.useEmojis?"20px":"24px"} !important;\n                width: 30px;\n                height: 30px;\n                display: inline-block;\n                overflow: hidden;\n                -webkit-font-smoothing: antialiased;\n                top: 7px;\n                left: 5px;\n                position: absolute;\n                color: var(--_access-menu-item-icon-color, rgba(0,0,0,.6));\n                direction: ltr;\n                text-indent: 0;\n                transition-duration: .35s;\n                transition-timing-function: ease-in-out;\n            }\n            ._access-menu ul li button svg path {\n                fill: var(--_access-menu-item-icon-color, rgba(0,0,0,.6));\n                transition-duration: .35s;\n                transition-timing-function: ease-in-out;\n            }\n            ._access-menu ul li button:hover svg path {\n                fill: var(--_access-menu-item-hover-icon-color, rgba(0,0,0,.8));\n            }\n            ._access-menu ul li button.active svg path {\n                fill: var(--_access-menu-item-active-icon-color, #fff);\n            }\n            ._access-menu ul li:hover button:before {\n                color: var(--_access-menu-item-hover-icon-color, rgba(0,0,0,.8));\n            }\n            ._access-menu ul li button.active button:before {\n                color: var(--_access-menu-item-active-icon-color, #fff);\n            }\n            ._access-menu ul li button[data-access-action="increaseText"]:before {\n                content: var(--_access-menu-item-icon-increase-text, ${this.options.icon.useEmojis?'"πŸ”Ό"':'"zoom_in"'});\n                transform: var(--_access-menu-item-icon-increase-text-transform, unset);\n                top: var(--_access-menu-item-icon-increase-text-top, ${t});\n                left: var(--_access-menu-item-icon-increase-text-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="decreaseText"]:before {\n                content: var(--_access-menu-item-icon-decrease-text, ${this.options.icon.useEmojis?'"πŸ”½"':'"zoom_out"'});\n                transform: var(--_access-menu-item-icon-decrease-text-spacing-transform, unset);\n                top: var(--_access-menu-item-icon-decrease-text-spacing-top, ${t});\n                left: var(--_access-menu-item-icon-decrease-text-spacing-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="increaseTextSpacing"]:before {\n                content: var(--_access-menu-item-icon-increase-text-spacing, ${this.options.icon.useEmojis?'"πŸ”Ό"':'"unfold_more"'});\n                transform: var(--_access-menu-item-icon-increase-text-spacing-transform, rotate(90deg) translate(-7px, 2px));\n                top: var(--_access-menu-item-icon-increase-text-spacing-top, 14px);\n                left: var(--_access-menu-item-icon-increase-text-spacing-left, 0);\n            }\n            ._access-menu ul li button[data-access-action="decreaseTextSpacing"]:before {\n                content: var(--_access-menu-item-icon-decrease-text-spacing, ${this.options.icon.useEmojis?'"πŸ”½"':'"unfold_less"'});\n                transform: var(--_access-menu-item-icon-decrease-text-spacing-transform, rotate(90deg) translate(-7px, 2px));\n                top: var(--_access-menu-item-icon-decrease-text-spacing-top, 14px);\n                left: var(--_access-menu-item-icon-decrease-text-spacing-left, 0);\n            }\n            ._access-menu ul li button[data-access-action="invertColors"]:before {\n                content: var(--_access-menu-item-icon-invert-colors, ${this.options.icon.useEmojis?'"πŸŽ†"':'"invert_colors"'});\n                transform: var(--_access-menu-item-icon-invert-colors-transform, unset);\n                top: var(--_access-menu-item-icon-invert-colors-top, ${t});\n                left: var(--_access-menu-item-icon-invert-colors-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="grayHues"]:before {\n                content: var(--_access-menu-item-icon-gray-hues, ${this.options.icon.useEmojis?'"🌫️"':'"format_color_reset"'});\n                transform: var(--_access-menu-item-icon-gray-hues-transform, unset);\n                top: var(--_access-menu-item-icon-gray-hues-top, ${t});\n                left: var(--_access-menu-item-icon-gray-hues-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="underlineLinks"]:before {\n                content: var(--_access-menu-item-icon-underline-links, ${this.options.icon.useEmojis?'"πŸ”—"':'"format_underlined"'});\n                transform: var(--_access-menu-item-icon-underline-links-transform, unset);\n                top: var(--_access-menu-item-icon-underline-links-top, ${t});\n                left: var(--_access-menu-item-icon-underline-links-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="bigCursor"]:before {\n                /*content: 'touch_app';*/\n                content: var(--_access-menu-item-icon-big-cursor, inherit);\n                transform: var(--_access-menu-item-icon-big-cursor-transform, unset);\n                top: var(--_access-menu-item-icon-big-cursor-top, ${t});\n                left: var(--_access-menu-item-icon-big-cursor-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="readingGuide"]:before {\n                content: var(--_access-menu-item-icon-reading-guide, ${this.options.icon.useEmojis?'"↔️"':'"border_horizontal"'});\n                transform: var(--_access-menu-item-icon-reading-guide-transform, unset);\n                top: var(--_access-menu-item-icon-reading-guide-top, ${t});\n                left: var(--_access-menu-item-icon-reading-guide-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="textToSpeech"]:before {\n                content: var(--_access-menu-item-icon-text-to-speech, ${this.options.icon.useEmojis?'"⏺️"':'"record_voice_over"'});\n                transform: var(--_access-menu-item-icon-text-to-speech-transform, unset);\n                top: var(--_access-menu-item-icon-text-to-speech-top, ${t});\n                left: var(--_access-menu-item-icon-text-to-speech-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="speechToText"]:before {\n                content: var(--_access-menu-item-icon-speech-to-text, ${this.options.icon.useEmojis?'"🎀"':'"mic"'});\n                transform: var(--_access-menu-item-icon-speech-to-text-transform, unset);\n                top: var(--_access-menu-item-icon-speech-to-text-top, ${t});\n                left: var(--_access-menu-item-icon-speech-to-text-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="disableAnimations"]:before {\n                content: var(--_access-menu-item-icon-disable-animations, ${this.options.icon.useEmojis?'"πŸƒβ€β™‚οΈ"':'"animation"'});\n                transform: var(--_access-menu-item-icon-disable-animations-transform, unset);\n                top: var(--_access-menu-item-icon-disable-animations-top, ${t});\n                left: var(--_access-menu-item-icon-disable-animations-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="iframeModals"]:before {\n                content: var(--_access-menu-item-icon-iframe-modals, ${this.options.icon.useEmojis?'"βš–οΈ"':'"policy"'});\n                transform: var(--_access-menu-item-icon-iframe-transform, unset);\n                top: var(--_access-menu-item-icon-iframe-top, ${t});\n                left: var(--_access-menu-item-icon-iframe-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="customFunctions"]:before {\n                content: var(--_access-menu-item-icon-custom-functions, ${this.options.icon.useEmojis?'"❓"':'"psychology_alt"'});\n                transform: var(--_access-menu-item-icon-custom-functions-transform, unset);\n                top: var(--_access-menu-item-icon-custom-functions-top, ${t});\n                left: var(--_access-menu-item-icon-custom-functions-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="increaseLineHeight"]:before {\n                content: var(--_access-menu-item-icon-increase-line-height, ${this.options.icon.useEmojis?'"πŸ”Ό"':'"unfold_more"'});\n                transform: var(--_access-menu-item-icon-increase-line-height-transform, unset);\n                top: var(--_access-menu-item-icon-increase-line-height-top, ${t});\n                left: var(--_access-menu-item-icon-increase-line-height-left, ${s});\n            }\n            ._access-menu ul li button[data-access-action="decreaseLineHeight"]:before {\n                content: var(--_access-menu-item-icon-decrease-line-height, ${this.options.icon.useEmojis?'"πŸ”½"':'"unfold_less"'});\n                transform: var(--_access-menu-item-icon-decrease-line-height-transform, unset);\n                top: var(--_access-menu-item-icon-decrease-line-height-top, ${t});\n                left: var(--_access-menu-item-icon-decrease-line-height-left, ${s});\n            }`:i;const o=r.CSS_CLASS_NAME;this._common.injectStyle(n,{className:o}),this._common.deployedObjects.set(`.${o}`,!1)}removeCSS(){const e=document.querySelector(`.${r.CSS_CLASS_NAME}`);e&&e.remove()}injectIcon(){let e=`_access-icon ${this.options.icon.fontClass} _access`,t=this._common.jsonToHtml({type:"i",attrs:{class:e,title:this.options.hotkeys.enabled?this.parseKeys(this.options.hotkeys.keys.toggleMenu):this.options.labels.menuTitle,tabIndex:0},children:[this.options.icon.imgElem]});return this._body.appendChild(t),this._common.deployedObjects.set("._access-icon",!1),t}parseKeys(e){return this.options.hotkeys.enabled&&this.options.hotkeys.helpTitles?this.options.labels.hotkeyPrefix+e.map((function(e){return Number.isInteger(e)?String.fromCharCode(e).toLowerCase():e.replace("Key","")})).join("+"):""}injectMenu(){const e={type:"div",attrs:{class:"_access-menu close _access"},children:[{type:"p",attrs:{class:"_text-center",role:"presentation"},children:[{type:"button",attrs:{class:`_menu-close-btn _menu-btn ${this.options.icon.fontClass}`,style:`font-family: var(--_access-menu-close-btn-font-family, ${this._fixedDefaultFont})`,title:this.options.hotkeys.enabled?this.parseKeys(this.options.hotkeys.keys.toggleMenu):this.options.labels.closeTitle},children:[this.options.icon.closeIconElem]},{type:"#text",text:this.options.labels.menuTitle},{type:"button",attrs:{class:`_menu-reset-btn _menu-btn ${this.options.icon.fontClass}`,style:`font-family: var(--_access-menu-reset-btn-font-family, ${this._fixedDefaultFont})`,title:this.options.labels.resetTitle},children:[this.options.icon.resetIconElem]}]},{type:"ul",attrs:{class:"before-collapse _access-scrollbar"},children:[{type:"li",children:[{type:"button",attrs:{"data-access-action":"increaseText"},children:[{type:"#text",text:this.options.labels.increaseText}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"decreaseText"},children:[{type:"#text",text:this.options.labels.decreaseText}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"increaseTextSpacing"},children:[{type:"#text",text:this.options.labels.increaseTextSpacing}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"decreaseTextSpacing"},children:[{type:"#text",text:this.options.labels.decreaseTextSpacing}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"increaseLineHeight"},children:[{type:"#text",text:this.options.labels.increaseLineHeight}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"decreaseLineHeight"},children:[{type:"#text",text:this.options.labels.decreaseLineHeight}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"invertColors",title:this.parseKeys(this.options.hotkeys.keys.invertColors)},children:[{type:"#text",text:this.options.labels.invertColors}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"grayHues",title:this.parseKeys(this.options.hotkeys.keys.grayHues)},children:[{type:"#text",text:this.options.labels.grayHues}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"underlineLinks",title:this.parseKeys(this.options.hotkeys.keys.underlineLinks)},children:[{type:"#text",text:this.options.labels.underlineLinks}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"bigCursor",title:this.parseKeys(this.options.hotkeys.keys.bigCursor)},children:[{type:"div",attrs:{id:"iconBigCursor"}},{type:"#text",text:this.options.labels.bigCursor}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"readingGuide",title:this.parseKeys(this.options.hotkeys.keys.readingGuide)},children:[{type:"#text",text:this.options.labels.readingGuide}]}]},{type:"li",children:[{type:"button",attrs:{"data-access-action":"disableAnimations",title:this.parseKeys(this.options.hotkeys.keys.disableAnimations)},children:[{type:"#text",text:this.options.labels.disableAnimations}]}]}]}]};this.options.iframeModals&&this.options.iframeModals.forEach(((t,s)=>{const n={type:"li",children:[{type:"button",attrs:{"data-access-action":"iframeModals","data-access-url":t.iframeUrl},children:[{type:"#text",text:t.buttonText}]}]};let i=null;if(t.icon&&!this.options.icon.useEmojis?i=t.icon:t.emoji&&this.options.icon.useEmojis&&(i=t.emoji),i){n.children[0].attrs["data-access-iframe-index"]=s;const e=`._access-menu ul li button[data-access-action="iframeModals"][data-access-iframe-index="${s}"]:before {\n                        content: "${i}";\n                    }`;let t="_data-access-iframe-index-"+s;this._common.injectStyle(e,{className:t}),this._common.deployedObjects.set("."+t,!1)}this.options.modules.textToSpeech?e.children[1].children.splice(e.children[1].children.length-2,0,n):e.children[1].children.push(n)})),this.options.customFunctions&&this.options.customFunctions.forEach(((t,s)=>{const n={type:"li",children:[{type:"button",attrs:{"data-access-action":"customFunctions","data-access-custom-id":t.id,"data-access-custom-index":s},children:[{type:"#text",text:t.buttonText}]}]};let i=null;if(t.icon&&!this.options.icon.useEmojis?i=t.icon:t.emoji&&this.options.icon.useEmojis&&(i=t.emoji),i){const e=`._access-menu ul li button[data-access-action="customFunctions"][data-access-custom-id="${t.id}"]:before {\n                        content: "${i}";\n                    }`;let s="_data-access-custom-id-"+t.id;this._common.injectStyle(e,{className:s}),this._common.deployedObjects.set("."+s,!1)}this.options.modules.textToSpeech?e.children[1].children.splice(e.children[1].children.length-2,0,n):e.children[1].children.push(n)}));let t=this._common.jsonToHtml(e);this._body.appendChild(t),setTimeout((function(){let e=document.getElementById("iconBigCursor");e&&(e.outerHTML=e.outerHTML+'<svg version="1.1" id="iconBigCursorSvg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" style="position: absolute;width: 19px;height: 19px;top: 9px; left: 9px;" xml:space="preserve"><path d="M 423.547 323.115 l -320 -320 c -3.051 -3.051 -7.637 -3.947 -11.627 -2.304 s -6.592 5.547 -6.592 9.856 V 480 c 0 4.501 2.837 8.533 7.083 10.048 c 4.224 1.536 8.981 0.192 11.84 -3.285 l 85.205 -104.128 l 56.853 123.179 c 1.792 3.883 5.653 6.187 9.685 6.187 c 1.408 0 2.837 -0.277 4.203 -0.875 l 74.667 -32 c 2.645 -1.131 4.736 -3.285 5.76 -5.973 c 1.024 -2.688 0.939 -5.675 -0.277 -8.299 l -57.024 -123.52 h 132.672 c 4.309 0 8.213 -2.603 9.856 -6.592 C 427.515 330.752 426.598 326.187 423.547 323.115 Z"/></svg>',document.getElementById("iconBigCursor").remove())}),1),this._common.deployedObjects.set("._access-menu",!1);let s=document.querySelector("._access-menu ._menu-close-btn");["click","keyup"].forEach((e=>{s.addEventListener(e,(e=>{let t=e||window.event;0===t.detail&&"Enter"!==t.key||this.toggleMenu()}),!1)}));let n=document.querySelector("._access-menu ._menu-reset-btn");return["click","keyup"].forEach((e=>{n.addEventListener(e,(e=>{let t=e||window.event;0===t.detail&&"Enter"!==t.key||this.resetAll()}),!1)})),t}getVoices(){return new Promise((e=>{let t,s=window.speechSynthesis;t=setInterval((()=>{0!==s.getVoices().length&&(e(s.getVoices()),clearInterval(t))}),10)}))}injectTts(){return c(this,void 0,void 0,(function*(){let e=yield this.getVoices(),t=!1;for(let s=0;s<e.length;s++)if(e[s].lang===this.options.language.textToSpeechLang){t=!0;break}if(t){let e=this.common.jsonToHtml({type:"li",children:[{type:"button",attrs:{"data-access-action":"textToSpeech",title:this.parseKeys(this.options.hotkeys.keys.textToSpeech)},children:[{type:"#text",text:this.options.labels.textToSpeech}]},{type:"div",attrs:{class:"screen-reader-wrapper"},children:[{type:"div",attrs:{class:"screen-reader-wrapper-step-1",tabIndex:"-1"}},{type:"div",attrs:{class:"screen-reader-wrapper-step-2",tabIndex:"-1"}},{type:"div",attrs:{class:"screen-reader-wrapper-step-3",tabIndex:"-1"}}]}]}),t=this.common.jsonToHtml({type:"li",children:[{type:"button",attrs:{"data-access-action":"speechToText",title:this.parseKeys(this.options.hotkeys.keys.speechToText)},children:[{type:"#text",text:this.options.labels.speechToText}]}]}),s=document.querySelector("._access-menu ul");s.appendChild(t),s.appendChild(e)}}))}addListeners(){let e=document.querySelectorAll("._access-menu ul li"),t=document.getElementsByClassName("screen-reader-wrapper-step-1"),s=document.getElementsByClassName("screen-reader-wrapper-step-2"),n=document.getElementsByClassName("screen-reader-wrapper-step-3");for(let t=0;t<e.length;t++)["click","keyup"].forEach((s=>e[t].addEventListener(s,(e=>{let t=e||window.event;0===t.detail&&"Enter"!==t.key||this.invoke(t.target.getAttribute("data-access-action"),t.target)}))));[...Array.from(t),...Array.from(s),...Array.from(n)].forEach((e=>e.addEventListener("click",(e=>{let t=e||window.event;this.invoke(t.target.parentElement.parentElement.getAttribute("data-access-action"),t.target)}),!1)))}sortModuleTypes(){this.options.modulesOrder.sort(((e,t)=>e.order-t.order))}disableUnsupportedModulesAndSort(){this.sortModuleTypes();let t=document.querySelector("._access-menu ul");this.options.modulesOrder.forEach((s=>{const n=s.type,i=e[n];let o=this.options.modules;o=o[i];let a=document.querySelector('button[data-access-action="'+i+'"]');a&&(a.parentElement.remove(),t.appendChild(a.parentElement),o||a.parentElement.classList.add("not-supported"))}))}resetAll(){this.menuInterface.textToSpeech(!0),this.menuInterface.speechToText(!0),this.menuInterface.disableAnimations(!0),this.menuInterface.underlineLinks(!0),this.menuInterface.grayHues(!0),this.menuInterface.invertColors(!0),this.menuInterface.bigCursor(!0),this.menuInterface.readingGuide(!0),this.resetTextSize(),this.resetTextSpace(),this.resetLineHeight()}resetTextSize(){this.resetIfDefined(this._stateValues.body.fontSize,this._body.style,"fontSize"),void 0!==this._htmlOrgFontSize&&(this._html.style.fontSize=this._htmlOrgFontSize);let e=document.querySelectorAll("[data-init-font-size]");for(let t=0;t<e.length;t++)e[t].style.fontSize=e[t].getAttribute("data-init-font-size"),e[t].removeAttribute("data-init-font-size");this._sessionState.textSize=0,this.onChange(!0)}resetLineHeight(){this.resetIfDefined(this._stateValues.body.lineHeight,this.body.style,"lineHeight");let e=document.querySelectorAll("[data-init-line-height]");for(let t=0;t<e.length;t++)e[t].style.lineHeight=e[t].getAttribute("data-init-line-height"),e[t].removeAttribute("data-init-line-height");this.sessionState.lineHeight=0,this.onChange(!0)}resetTextSpace(){this.resetIfDefined(this._stateValues.body.wordSpacing,this._body.style,"wordSpacing"),this.resetIfDefined(this._stateValues.body.letterSpacing,this._body.style,"letterSpacing");let e=document.querySelectorAll("[data-init-word-spacing]"),t=document.querySelectorAll("[data-init-letter-spacing]");for(let t=0;t<e.length;t++)e[t].style.wordSpacing=e[t].getAttribute("data-init-word-spacing"),e[t].removeAttribute("data-init-word-spacing");for(let s=0;s<t.length;s++)e[s].style.letterSpacing=e[s].getAttribute("data-init-letter-spacing"),e[s].removeAttribute("data-init-letter-spacing");this._sessionState.textSpace=0,this.onChange(!0)}alterTextSize(e){this._sessionState.textSize+=e?1:-1,this.onChange(!0);let t=this.options.textSizeFactor;if(e||(t*=-1),this.options.textPixelMode){let s=document.querySelectorAll("*:not(._access)");for(let e=0;e<s.length;e++){let t=getComputedStyle(s[e]).fontSize;t&&t.indexOf("px")>-1&&(s[e].getAttribute("data-init-font-size")||s[e].setAttribute("data-init-font-size",t))}for(let n=0;n<s.length;n++){let i=getComputedStyle(s[n]).fontSize;i&&i.indexOf("px")>-1&&(i=parseInt(i.replace("px",""))+t,s[n].style.fontSize=i+"px"),this._stateValues.textToSpeech&&this.textToSpeech("Text Size "+(e?"Increased":"Decreased"))}let n=getComputedStyle(this._body).fontSize;n&&n.indexOf("px")>-1&&(this._body.getAttribute("data-init-font-size")||this._body.setAttribute("data-init-font-size",n),n=parseInt(n.replace("px",""))+t,this._body.style.fontSize=n+"px")}else if(this.options.textEmlMode){let s=this._html.style.fontSize;s.indexOf("%")?(s=parseInt(s.replace("%","")),this._html.style.fontSize=s+t+"%",this._stateValues.textToSpeech&&this.textToSpeech("Text Size "+(e?"Increased":"Decreased"))):this._common.warn("Accessibility.textEmlMode, html element is not set in %.")}else{let e=this._common.getFormattedDim(getComputedStyle(this._body).fontSize);void 0===this._stateValues.body.fontSize&&(this._stateValues.body.fontSize=e.size+e.suffix),e&&e.suffix&&!isNaN(1*e.size)&&(this._body.style.fontSize=1*e.size+t+e.suffix)}}alterLineHeight(e){this.sessionState.lineHeight+=e?1:-1,this.onChange(!0);let t=2;e||(t*=-1),this.options.textEmlMode&&(t*=10);let s=document.querySelectorAll("*:not(._access)"),n=Array.prototype.slice.call(document.querySelectorAll("._access-menu *"));for(let i=0;i<s.length;i++)if(!n.includes(s[i]))if(this.options.textPixelMode){let n=getComputedStyle(s[i]).lineHeight;if(n&&n.indexOf("px")>-1){s[i].getAttribute("data-init-line-height")||s[i].setAttribute("data-init-line-height",n);const e=parseInt(n.replace("px",""))+t;s[i].style.lineHeight=`${e}px`}this._stateValues.textToSpeech&&this.textToSpeech("Line Height "+(e?"Increased":"Decreased"))}else if(this.options.textEmlMode){let n=getComputedStyle(s[i]).fontSize,o=getComputedStyle(s[i]).lineHeight;"normal"===o&&(o=(1.2*parseInt(n.replace("px",""))).toString()+"px");let a=o.replace("px",""),c=n.replace("px",""),r=100*parseInt(a)/parseInt(c);o&&o.indexOf("px")>-1&&(s[i].getAttribute("data-init-line-height")||s[i].setAttribute("data-init-line-height",r+"%"),r+=t,s[i].style.lineHeight=r+"%"),void 0===this._stateValues.body.lineHeight&&(this._stateValues.body.lineHeight=""),this._stateValues.textToSpeech&&this.textToSpeech("Line height "+(e?"Increased":"Decreased"))}}alterTextSpace(e){this._sessionState.textSpace+=e?1:-1,this.onChange(!0);let t=2;if(e||(t*=-1),this.options.textPixelMode){let s=document.querySelectorAll("*:not(._access)"),n=Array.prototype.slice.call(document.querySelectorAll("._access-menu *"));for(let e=0;e<s.length;e++){if(n.includes(s[e]))continue;let i=s[e].style.wordSpacing;i&&i.indexOf("px")>-1?(s[e].getAttribute("data-init-word-spacing")||s[e].setAttribute("data-init-word-spacing",i),i=1*i.replace("px","")+t,s[e].style.wordSpacing=i+"px"):(s[e].setAttribute("data-init-word-spacing",i),s[e].style.wordSpacing=t+"px");let o=s[e].style.letterSpacing;o&&o.indexOf("px")>-1?(s[e].getAttribute("data-init-letter-spacing")||s[e].setAttribute("data-init-letter-spacing",o),o=1*o.replace("px","")+t,s[e].style.letterSpacing=o+"px"):(s[e].setAttribute("data-init-letter-spacing",o),s[e].style.letterSpacing=t+"px")}this._stateValues.textToSpeech&&this.textToSpeech("Text Spacing "+(e?"Increased":"Decreased"))}else{let s=this._common.getFormattedDim(getComputedStyle(this._body).wordSpacing);void 0===this._stateValues.body.wordSpacing&&(this._stateValues.body.wordSpacing=""),s&&s.suffix&&!isNaN(1*s.size)&&(this._body.style.wordSpacing=1*s.size+t+s.suffix);let n=this._common.getFormattedDim(getComputedStyle(this._body).letterSpacing);void 0===this._stateValues.body.letterSpacing&&(this._stateValues.body.letterSpacing=""),n&&n.sufix&&!isNaN(1*n.size)&&(this._body.style.letterSpacing=1*n.size+t+n.sufix),this._stateValues.textToSpeech&&this.textToSpeech("Text Spacing "+(e?"Increased":"Decreased"))}}speechToText(){("webkitSpeechRecognition"in window||"SpeechRecognition"in window)&&(this._recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this._recognition.continuous=!0,this._recognition.interimResults=!0,this._recognition.onstart=()=>{this._body.classList.add("_access-listening")},this._recognition.onend=()=>{this._body.classList.remove("_access-listening")},this._recognition.onresult=e=>{let t="";if(void 0!==e.results){for(let s=e.resultIndex;s<e.results.length;++s)e.results[s].isFinal&&(t+=e.results[s][0].transcript);t&&this._speechToTextTarget&&(this._speechToTextTarget.parentElement.classList.remove("_access-listening"),"input"===this._speechToTextTarget.tagName.toLowerCase()||"textarea"===this._speechToTextTarget.tagName.toLowerCase()?this._speechToTextTarget.value=t:null!==this._speechToTextTarget.getAttribute("contenteditable")&&(this._speechToTextTarget.innerText=t))}},this._recognition.lang=this.options.language.speechToTextLang,this._recognition.start())}textToSpeech(e){const t=window;if(!t.SpeechSynthesisUtterance||!t.speechSynthesis)return;let s=new t.SpeechSynthesisUtterance(e);s.lang=this.options.language.textToSpeechLang,s.lang=this.options.textToSpeechLang,s.rate=this._stateValues.speechRate,s.onend=()=>{this._isReading=!1};let n=t.speechSynthesis.getVoices(),i=!1;for(let e=0;e<n.length;e++)if(n[e].lang===s.lang){s.voice=n[e],i=!0;break}i||this._common.warn("text to speech language not supported!"),(window.speechSynthesis.pending||window.speechSynthesis.speaking)&&(window.speechSynthesis.pause,window.speechSynthesis.cancel()),window.speechSynthesis.speak(s),this._isReading=!0}createScreenShot(e){return new Promise((s=>{let n=document.createElement("canvas"),i=new Image;n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",n.style.transform="scale(0.05)",i.crossOrigin="anonymous",i.onload=()=>c(this,void 0,void 0,(function*(){document.body.appendChild(n);const e=n.getContext("2d");let t;n.width=i.naturalWidth,n.height=i.naturalHeight,e.clearRect(0,0,n.width,n.height),e.drawImage(i,0,0);try{t=n.toDataURL("image/png")}catch(e){}s(t),n.remove()})),i.onerror=()=>{s(t.DEFAULT_PIXEL)},i.src=e}))}listen(){"object"==typeof this._recognition&&"function"==typeof this._recognition.stop&&this._recognition.stop(),this._speechToTextTarget=window.event.target,this.speechToText()}read(e){try{(e=window.event||e||arguments[0])&&e.preventDefault&&(e.preventDefault(),e.stopPropagation())}catch(e){}let t=Array.prototype.slice.call(document.querySelectorAll("._access-menu *"));for(const s in t)if(t[s]===window.event.target&&e instanceof MouseEvent)return;e instanceof KeyboardEvent&&(e.shiftKey&&"Tab"===e.key||"Tab"===e.key)?this.textToSpeech(window.event.target.innerText):this._isReading?(window.speechSynthesis.cancel(),this._isReading=!1):this.textToSpeech(window.event.target.innerText)}runHotkey(e){"toggleMenu"===e?this.toggleMenu():"function"==typeof this.menuInterface[e]&&this._options.modules[e]&&this.menuInterface[e](!1)}toggleMenu(){const e=this._menu.classList.contains("close");setTimeout((()=>{this._menu.querySelector("ul").classList.toggle("before-collapse")}),e?500:10),this._menu.classList.toggle("close"),this.options.icon.tabIndex=e?0:-1,this._menu.childNodes.forEach((e=>{e.hasChildNodes()&&e.nodeType===Node.ELEMENT_NODE&&"P"===e.tagName&&(e.tabIndex=-1)}))}invoke(e,t){"function"==typeof this.menuInterface[e]&&this.menuInterface[e](void 0,t)}onKeyDown(e){let t=Object.entries(this.options.hotkeys.keys).find((function(t){let s=!0;for(var n=0;n<t[1].length;n++)Number.isInteger(t[1][n])?e.keyCode!==t[1][n]&&(s=!1):void 0!==e[t[1][n]]&&!1!==e[t[1][n]]||(s=!1);return s}));void 0!==t&&this.runHotkey(t[0])}build(){this._stateValues={underlineLinks:!1,textToSpeech:!1,bigCursor:!1,readingGuide:!1,speechRate:1,body:{},html:{}},this._body=document.body||document.getElementsByTagName("body")[0],this._html=document.documentElement||document.getElementsByTagName("html")[0],this.options.textEmlMode&&this.initFontSize(),this.injectCss(!this.options.suppressCssInjection&&!this.options.suppressDomInjection),this.options.suppressDomInjection||(this._icon=this.injectIcon(),this._menu=this.injectMenu(),this.injectTts(),setTimeout((()=>{this.addListeners(),this.disableUnsupportedModulesAndSort()}),10),this.options.hotkeys.enabled&&document.addEventListener("keydown",this._onKeyDownBind,!1),this._icon.addEventListener("click",(()=>{this.toggleMenu()}),!1),this._icon.addEventListener("keyup",(e=>{"Enter"===e.key&&this.toggleMenu()}),!1),setTimeout((()=>{this._icon.style.opacity="1"}),10)),this.updateReadGuide=e=>{let t=0;t="touchmove"===e.type?e.changedTouches[0].clientY:e.y,document.getElementById("access_read_guide_bar").style.top=t-(parseInt(this.options.guide.height.replace("px",""))+5)+"px"},this.menuInterface=new o(this),this.options.session.persistent&&this.setSessionFromCache()}updateReadGuide(e){let t=0;t="touchmove"===e.type?e.changedTouches[0].clientY:e.y,document.getElementById("access_read_guide_bar").style.top=t-(parseInt(this.options.guide.height.replace("px",""))+5)+"px"}resetIfDefined(e,t,s){void 0!==e&&(t[s]=e)}onChange(e){e&&this.options.session.persistent&&this.saveSession()}saveSession(){this._storage.set("_accessState",this.sessionState)}setSessionFromCache(){let e=this._storage.get("_accessState");if(e){if(e.textSize){let t=e.textSize;if(t>0)for(;t--;)this.alterTextSize(!0);else for(;t++;)this.alterTextSize(!1)}if(e.textSpace){let t=e.textSpace;if(t>0)for(;t--;)this.alterTextSpace(!0);else for(;t++;)this.alterTextSpace(!1)}if(e.lineHeight){let t=e.lineHeight;if(t>0)for(;t--;)this.alterLineHeight(!0);else for(;t++;)this.alterLineHeight(!1)}e.invertColors&&this.menuInterface.invertColors(),e.grayHues&&this.menuInterface.grayHues(),e.underlineLinks&&this.menuInterface.underlineLinks(),e.bigCursor&&this.menuInterface.bigCursor(),e.readingGuide&&this.menuInterface.readingGuide(),this.sessionState=e}}destroy(){this._common.deployedObjects.getAll().forEach(((e,t)=>{const s=document.querySelector(t);s&&s.parentElement.removeChild(s)})),document.removeEventListener("keydown",this._onKeyDownBind,!1)}}r.CSS_CLASS_NAME="_access-main-css",r.MENU_WIDTH="25vw",r.init=e=>{console.warn('"Accessibility.init()" is deprecated! Please use "new Accessibility()" instead'),new r(e)};const l=r;"undefined"!=typeof window&&(window.Accessibility=l)})(),n})()));
//# sourceMappingURL=main.bundle.js.map