/*! License information can be found in readabler.js.LICENSE.txt */ (()=>{"use strict";function e(e,t="",n=""){let o=[];return t.length>0&&o.push(t),o=e.split(/[\s-_.:]/),n.length>0&&o.push(n),1===o.length?e.trim():o.map(((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1))).join("")}let t=[];function n(e){t.push(e)}function o(){return t}class i{static storageName="readabler";constructor(){this.migrate(),this.loadSaved()}migrate(){if(!this.isMigrationNeeded())return;let t="mdpReadabler",n=Object.keys(localStorage);for(const o in n){if(!n[o].toString().startsWith(t))continue;let a=i.prepareKey(n[o].toString().replace(t,"")),r=localStorage.getItem(n[o]);r&&("true"===r?r=!0:"false"===r&&(r=!1),i.save(e(a),r),localStorage.removeItem(n[o]))}}loadSaved(){const e=i.settings();if(e){for(const[t,n]of Object.entries(e))window.dispatchEvent(new CustomEvent("readabler-headless",{detail:{action:t,value:n}}));n({id:"load_saved",value:1})}}setConfig(){}isMigrationNeeded(){return!localStorage.getItem(i.storageName)}static prepareKey(t){return e(t=(t=(t=t.replace("mdp-readabler-","")).replace("action-","")).trim())}static get(e){return i.settings()[this.prepareKey(e)]??null}static save(e,t){let n=i.settings();n[this.prepareKey(e)]=t;for(const[e,t]of Object.entries(n))t&&""!==t&&void 0!==t||delete n[e];localStorage.setItem(i.storageName,JSON.stringify(n))}static settings(){const e=localStorage.getItem(i.storageName);if(e){const t=JSON.parse(e);return t||{}}return localStorage.setItem(i.storageName,JSON.stringify({})),{}}static haveSavedSettings(){return!!localStorage.getItem(i.storageName)}static reset(){localStorage.removeItem(i.storageName)}}let a={init:function(){let e=document.querySelectorAll(".mdp-readabler-toggle-box");e.forEach((e=>e.addEventListener("click",(e=>a.toggle(e))))),e.forEach((e=>e.addEventListener("keydown",(e=>a.toggle(e)))))},toggle:function(e){if("keydown"===e.type&&13!==e.keyCode)return;let t=e.target.closest(".mdp-readabler-toggle-box");t.classList.toggle("mdp-active"),i.save(t.id,t.classList.contains("mdp-active"));const n=new CustomEvent("ReadablerToggleBoxChanged",{detail:{isTrusted:e.isTrusted}});t.dispatchEvent(n);const o=new CustomEvent("ReadablerAnalyticsEvent",{detail:{category:"toggle-box",id:t.id,value:t.classList.contains("mdp-active")?1:0,timestamp:(new Date).getTime()}});window.dispatchEvent(o)},loadSaved:function(){document.querySelectorAll(".mdp-readabler-toggle-box").forEach((e=>{"true"===i.get(e.id)&&e.click()}))}};const r={init:function(){let e=document.querySelectorAll(".mdp-readabler-input-spinner-box .mdp-readabler-plus");e.forEach((e=>e.addEventListener("click",(e=>r.step(e)))));let t,n=document.querySelectorAll(".mdp-readabler-input-spinner-box .mdp-readabler-minus");n.forEach((e=>e.addEventListener("click",(e=>r.step(e))))),e.forEach((e=>e.addEventListener("mousedown",(e=>{t=setInterval((function(){r.step(e)}),500)})))),e.forEach((e=>e.addEventListener("mouseup",(()=>{clearInterval(t)})))),e.forEach((e=>e.addEventListener("mouseleave",(()=>{clearInterval(t)})))),n.forEach((e=>e.addEventListener("mousedown",(e=>{t=setInterval((function(){r.step(e)}),500)})))),n.forEach((e=>e.addEventListener("mouseup",(()=>{clearInterval(t)})))),n.forEach((e=>e.addEventListener("mouseleave",(()=>{clearInterval(t)}))))},step:function(e){let t=e.target.closest(".mdp-readabler-control").querySelector(".mdp-readabler-value"),n=parseInt(t.dataset.value),o=parseInt(e.target.closest(".mdp-readabler-input-spinner-box").dataset.step);e.target.classList.contains("mdp-readabler-minus")?n-=o:n+=o,t.dataset.value=n.toString(),r.setLabel(t,n),i.save(e.target.closest(".mdp-readabler-action-box").id,t.dataset.value);const a=new CustomEvent("ReadablerInputSpinnerChanged",{});t.dispatchEvent(a);const d=new CustomEvent("ReadablerAnalyticsEvent",{detail:{id:e.target.closest(".mdp-readabler-action-box").id,value:t.dataset.value>0?1:0}});window.dispatchEvent(d)},setLabel:function(e,t){t=parseInt(t);let n=window.mdpReadablerOptions;if(0===t)e.innerHTML=n.DEFAULT;else{let n=t>0?"+":"";e.innerHTML=n+t+"%"}},loadSaved:function(){document.querySelectorAll(".mdp-readabler-spinner-box").forEach((e=>{let t=i.get(e.id);if(!t)return;if(t=parseInt(t),0===t)return;let n=e.querySelector(".mdp-readabler-value");n.dataset.value=t.toString(),r.setLabel(n,t);const o=new CustomEvent("ReadablerInputSpinnerChanged",{detail:{load:!0}});n.dispatchEvent(o)}))}},d={init:function(){let e=document.querySelectorAll(".mdp-readabler-palette-box");e.forEach((e=>e.addEventListener("click",(e=>d.selectColor(e))))),e.forEach((e=>e.addEventListener("keydown",(e=>d.selectColor(e)))))},selectColor:function(e){if("keydown"===e.type&&13!==e.keyCode)return;if(!e.target.classList.contains("mdp-readabler-color"))return;let t=e.target.closest(".mdp-readabler-palette-box");if(e.target.classList.contains("mdp-active"))e.target.classList.remove("mdp-active"),d.firePaletteChange(t,null),i.save(e.target.closest(".mdp-readabler-palette-box").id,null);else{let n=t.querySelector(".mdp-readabler-color.mdp-active");null!==n&&n.classList.remove("mdp-active"),e.target.classList.add("mdp-active"),d.firePaletteChange(t,e.target.dataset.color),i.save(e.target.closest(".mdp-readabler-palette-box").id,e.target.dataset.color)}},loadSaved:function(){document.querySelectorAll(".mdp-readabler-palette-box").forEach((e=>{let t=i.get(e.id);null!==t&&e.querySelectorAll(".mdp-readabler-color").forEach((e=>{e.dataset.color===t&&e.click()}))}))},firePaletteChange:function(e,t){const n=new CustomEvent("ReadablerPaletteChanged",{detail:{color:t}});e.dispatchEvent(n)}};function s(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,o=new Array(t);n0&&this.registerTriggers.apply(this,l(i)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var t,n;return t=e,(n=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,n=new Array(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){this.modal.addEventListener("animationend",(function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()}),!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var n=this.config.openClass;this.modal.addEventListener("animationend",(function e(){t.classList.remove(n),t.removeEventListener("animationend",e,!1)}),!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(u);return Array.apply(void 0,l(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var n=t.filter((function(t){return!t.hasAttribute(e.config.closeTrigger)}));n.length>0&&n[0].focus(),0===n.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter((function(e){return null!==e.offsetParent})),this.modal.contains(document.activeElement)){var n=t.indexOf(document.activeElement);e.shiftKey&&0===n&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&n===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&s(t.prototype,n),e}(),m=null,b=function(e){if(!document.getElementById(e))return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'')),!1},f=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''))}(e),!t)return!0;for(var n in t)b(n);return!0},{init:function(e){var t=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),n=l(document.querySelectorAll("[".concat(t.openTrigger,"]"))),o=function(e,t){var n=[];return e.forEach((function(e){var o=e.attributes[t].value;void 0===n[o]&&(n[o]=[]),n[o].push(e)})),n}(n,t.openTrigger);if(!0!==t.debugMode||!1!==f(n,o))for(var i in o){var a=o[i];t.targetModal=i,t.triggers=l(a),m=new p(t)}},show:function(e,t){var n=t||{};n.targetModal=e,!0===n.debugMode&&!1===b(e)||(m&&m.removeEventListeners(),(m=new p(n)).showModal())},close:function(e){e?m.closeModalById(e):m.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=g);const h=g;function v(e){const t=window.mdpReadablerOptions,n=e.target,o="mdp-readabler-popup",i="mdp-readabler-trigger-button",a="mdp-readabler-popup-close";return n.id===i||n.closest(`#${i}`)||n.classList.contains("readabler-trigger")||n.closest(".readabler-trigger")?(e.preventDefault(),void k()):n.dataset.readablerShow?(e.preventDefault(),void C()):n.id===a||n.closest(`#${a}`)?(e.preventDefault(),void T()):void("1"===t.closeAnywhere&&(n.id===o||n.closest(`#${o}`)||document.querySelector("#mdp-readabler-popup-box.is-open")&&(e.preventDefault(),T())))}function y(e,t){let n=0;return function(...o){clearTimeout(n),n=setTimeout(e.bind(this,...o),t||0)}}const w=document.getElementById("mdp-readabler-popup");function E(e){"1"===e.popupDraggable&&(!function(){let e=document.getElementById("mdp-readabler-popup-header");if(!e)return;let t=0,n=0,o=0,a=0;function r(e){l(e=e||window.event)&&(e.preventDefault(),o=e.clientX,a=e.clientY,document.addEventListener("mousemove",d),document.addEventListener("mouseup",s))}function d(e){(e=e||window.event).preventDefault(),t=o-e.clientX,n=a-e.clientY,o=e.clientX,a=e.clientY;let r=w.offsetTop-n,d=w.offsetLeft-t;L(r,d),i.save("popupTop",r.toString()),i.save("popupLeft",d.toString())}function s(){document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",s)}function l(e){if("buttons"in e)return 1===e.buttons;return 1===(e.which||e.button)}e.onmousedown=r}(),x(),window.addEventListener("resize",(e=>{y(x(e),300)})))}function x(e=void 0){let t=i.get("popupTop"),n=i.get("popupLeft");return null!==t&&null!==n&&(L(t,n,e),!0)}function L(e,t,n=void 0){e=function(e){let t=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0);e<0&&(e=0);e>t-w.offsetHeight&&(e=t-w.offsetHeight);return e}(e),t=function(e){let t=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0);e<0&&(e=0);e>t-w.offsetWidth&&(e=t-w.offsetWidth);return e}(t),w.style.top=e+"px",w.style.left=t+"px",w.style.transition=void 0!==n?"top 0.3s ease, left 0.3s ease":"none",i.save("popupTop",e),i.save("popupLeft",t),w.removeAttribute("data-start")}const S=document.getElementById("mdp-readabler-popup");function k(){"false"===document.querySelector("#mdp-readabler-popup-box").getAttribute("aria-hidden")?T():C()}function C(){window.mdpReadablerMicroModal.show("mdp-readabler-popup-box"),function(e){e.querySelectorAll(".select2").forEach((e=>e.remove())),e.querySelectorAll(".select2-hidden-accessible").forEach((e=>{e.classList.remove("select2-hidden-accessible"),e.removeAttribute("tabindex")}))}(S),function(){const e=document.querySelectorAll("[data-readabler-trigger]");if(!e)return;e.forEach((e=>e.classList.add("mdp-opened")))}(),x();const e=new CustomEvent("ReadablerAnalyticsEvent",{detail:{category:"popup",id:"open",value:1,timestamp:(new Date).getTime()}});window.dispatchEvent(e,!1)}function T(){window.mdpReadablerMicroModal.close("mdp-readabler-popup-box"),R();const e=new CustomEvent("ReadablerAnalyticsEvent",{detail:{category:"popup",id:"open",value:0,timestamp:(new Date).getTime()}});window.dispatchEvent(e,!1)}function R(){const e=document.querySelectorAll("[data-readabler-trigger]");e&&(e.forEach((e=>e.classList.remove("mdp-opened"))),function(){let e=document.getElementById("mdp-readabler-accessibility-statement-box");null!==e&&e.classList.contains("mdp-open")&&e.classList.remove("mdp-open")}())}const A=function(){const e=0,t=12,n=8,o={enabled:!1,trigger:i};function i(e,t){b?E():function(){const e=function(){const{highlightFocusColor:e}=window.mdpReadablerOptions??{},t=d.createElement("div");return t.innerHTML='\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t',t}();b=w(e,"svg"),f=w(e,"polygon"),g=w(e,"start"),h=w(e,"middle"),v=w(e,"end"),y=w(e,"gradient"),l.appendChild(b)}();const n=k(e),o=k(t);let i=0,s=0,c=0,p=0;const x=function(e){return 50*Math.pow(function(e,t,n){if(e<=t)return t;if(e>=n)return n;return e}(e,32,1024),1/3)}(function(e,t,n,o){const i=e-n,a=t-o;return Math.sqrt(i*i+a*a)}(n.left,n.top,o.left,o.top));let T=!0;!function(e,t){const n=Date.now();!function o(){u=requestAnimationFrame((function(){const i=Date.now()-n;e(i/t),i=0?a:a+1,y2:r>=0?r:r+1}}(Math.atan2(l.y-c.y,l.x-c.x));e.setAttribute("x1",u.x1),e.setAttribute("y1",u.y1),e.setAttribute("x2",isNaN(u.x2)?0:u.x2),e.setAttribute("y2",isNaN(u.y2)?0:u.y2)}(y,s,p,n.width,n.height,i,c,o.width,o.height);const e=function(e,t){let n=0;e.topt.right&&(n+=2);e.bottom>t.bottom&&(n+=4);e.left.4?a((e-.4)/.6):0,d=e<.8?a(e/.8):1;g.setAttribute("offset",100*t+"%"),h.setAttribute("offset",100*d+"%"),e>=1&&E(),T=!1}),x)}function a(e){return 2*e-e*e}let r=window;const d=document,s=d.documentElement,l=d.body;let c=null,u=0,p=0;function m(e,t,n,o){return{x:e+n/2,y:t+o/2}}s.addEventListener("keydown",(function(e){o.enabled&&(p=Date.now())}),!1),s.addEventListener("blur",(function(e){o.enabled&&(E(),c=x()?e.target:null)}),!0),s.addEventListener("focus",(function(e){c&&x()&&i(c,e.target)}),!0);let b=null,f=null,g=null,h=null,v=null,y=null;function w(e,t){return e.querySelector("#focus-snail_"+t)}function E(){u&&(cancelAnimationFrame(u),u=0,b.classList.remove("focus-snail_visible"))}function x(){return Date.now()-p<42}function L(e,t){const n=e.ownerSVGElement.createSVGPoint();n.x=isNaN(t.x)?0:t.x,n.y=isNaN(t.y)?0:t.y,e.points.appendItem(n)}function S(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.right,y:e.bottom},{x:e.left,y:e.bottom}]}function k(o){const i=function(e){const t=e.getBoundingClientRect(),n=C(),o=s.clientTop||l.clientTop,i=s.clientLeft||l.clientLeft,a=t.top+n.top-o,r=t.left+n.left-i;return{top:a||0,left:r||0}}(o);return{left:i.left-e,top:i.top-e,width:Math.max(t,o.offsetWidth)+2*e,height:Math.max(n,o.offsetHeight)+2*e}}function C(){return{top:r.pageYOffset||s.scrollTop||0,left:r.pageXOffset||s.scrollLeft||0}}const T=d.createElement("style");return T.textContent="#focus-snail_svg {\tposition: absolute;\ttop: 0;\tright: 0;\tbottom: 0;\tleft: 0;\tmargin: 0;\tbackground: transparent;\tvisibility: hidden;\tpointer-events: none;\t-webkit-transform: translateZ(0);}#focus-snail_svg.focus-snail_visible {\tvisibility: visible;\tz-index: 999;}#focus-snail_polygon {\tstroke-width: 0;}",l.appendChild(T),o}();function O(e,t){const n=document.querySelector(`#mdp-readabler-action-${e}`);n&&(t?n.classList.add("mdp-active"):n.classList.remove("mdp-active")),window.dispatchEvent(new CustomEvent("readabler-ai-popup",{detail:{action:"visualInterface",type:"toggle",mode:e,toggleState:t}})),i.save(e,t)}let $={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-keyboard-navigation").addEventListener("ReadablerToggleBoxChanged",$.keyboardNavigation)},keyboardNavigation:function(e){e.target.classList.contains("mdp-active")?$.enable("keyboard-navigation"):$.disable("keyboard-navigation")},enable(e="keyboard-navigation"){O(e,!0),document.body.classList.add(`${this.p}-${e}`),$.makeFocusable(),A.enabled=!0},disable(e="keyboard-navigation"){O(e,!1),document.body.classList.remove(`${this.p}-${e}`),$.restoreOriginalTabIndex(),A.enabled=!1},makeFocusable:function(){document.querySelectorAll('nav, [role="navigation"], h1, h2, h3, h4, h5, h6, [role="heading"], form:not([disabled]), button:not([disabled]), [role="button"]:not([disabled]), img, picture, svg').forEach((e=>{e.tabIndex<0&&(e.dataset.readablerOriginalTabIndex=e.tabIndex,e.tabIndex=0)}))},restoreOriginalTabIndex:function(){document.querySelectorAll('nav, [role="navigation"], h1, h2, h3, h4, h5, h6, [role="heading"], form:not([disabled]), button:not([disabled]), [role="button"]:not([disabled]), img, picture, svg').forEach((e=>{null!=e.dataset.readablerOriginalTabIndex&&(e.tabIndex=e.dataset.readablerOriginalTabIndex,delete e.dataset.readablerOriginalTabIndex)}))},setFocus:function(e,t=!0){if(document.activeElement){let n=Array.prototype.filter.call(document.querySelectorAll(e),(function(e){return e.offsetWidth>0||e.offsetHeight>0||e===document.activeElement})),o=n.indexOf(document.activeElement);if(o>-1){let e;e=t?n[o+1]||n[0]:n[o-1]||n[n.length-1],e.focus()}else t?n[0].focus():n[n.length-1].focus()}}};function I(e){!function(e){hotkeys(e.hotKeyOpenInterface,(function(e){e.preventDefault(),k()}))}(e),M(e.hotKeyMenu,'nav, [role="navigation"]'),M(e.hotKeyHeadings,'h1, h2, h3, h4, h5, h6, [role="heading"]'),M(e.hotKeyForms,"form:not([disabled])"),M(e.hotKeyButtons,'button:not([disabled]), [role="button"]:not([disabled])'),M(e.hotKeyGraphics,"img, picture, svg"),document.body.onkeydown=function(e){32===(e.keyCode||e.charCode||e.which)&&function(e){let t=document.activeElement;(t.classList.contains("mdp-readabler-accessibility-profile-item")||t.classList.contains("mdp-readabler-toggle-box")||t.classList.contains("mdp-readabler-color"))&&(e.preventDefault(),t.click())}(e)}}function M(e,t){hotkeys(e+",shift+"+e,(function(e,n){if(!document.body.classList.contains("mdp-readabler-keyboard-navigation"))return;e.preventDefault();let o=!0;n.key.startsWith("shift+")&&(o=!1),$.setFocus(t,o)}))}let B=!0,N=!1,q=!1,D=!1,F=0,H=0,_=0,P=0;const j=window.mdpReadablerOptions;function V(e){"focus"===e.type?B=!0:"blur"===e.type&&(B=!1)}function U(){if(0===_)return F;if(0===P&&0!==_)if(0===F)F=(new Date).getTime()-_;else{const{analyticsSendInterval:e}=j;let t=(new Date).getTime()-H;F+=t<1e3*e?t:1e3*e}return H=(new Date).getTime(),F>36e5&&(F=0),F}let z="";const W=window.mdpReadablerOptions;class K{constructor(){if(function(){const e=new URLSearchParams(window.location.search).get("readabler-analyzer")??null;return!!e&&"true"===e}())return;z=function(){const e=Math.random().toString(36)+Math.random().toString(36);return btoa(e.replace("0.",""),!0).toLowerCase()}(),window.addEventListener("blur",V),window.addEventListener("focus",V),window.addEventListener("ReadablerAnalyticsEvent",this.processing),this.pageLoadAnalytics();const e=1e3*parseInt(W.analyticsSendInterval);setInterval((()=>{N&&B&&K.send(K.requestData())}),e)}pageLoadAnalytics(){let e=this.sessionData();"on"!==W.analyticsGDPR?fetch("https://ipapi.co/json/").then((e=>e.json())).then((t=>{e.country_code=t.country_code??"unknown",K.send(e)})).catch((t=>{console.error("Error fetching IP address:",t),K.send(e)})):K.send(e)}sessionData(){return{uid:z,post_id:W.postID??"",post_type:W.postType??"",page_lang:document.documentElement.lang??"",is_mobile:(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?1:0)??!1,events:o(),open_timer:U()}}processing(e){if(!e.detail)return;let{id:t,value:o}=e.detail;t=t.replace("readabler-",""),t=t.replace("mdp-action-",""),t=t.replaceAll("-","_"),function(e){const{id:t,value:n}=e;"open"===t&&(q=n),"action-voice-navigation"===t&&(1===n?D=!0:0===n&&(D=!1)),N=q||D}(e.detail),function(e){let{id:t,value:n}=e;"open"===t&&(1===n?_=(new Date).getTime():(P=(new Date).getTime(),F+=P-H,_=0,P=0),H=(new Date).getTime())}(e.detail),n({id:t,value:o}),function(e){let{id:t,value:n}=e;return"open"===t&&0===n||"reset"===t||"hide"===t}(e.detail)&&K.send(K.requestData())}static requestData(){return{uid:z,events:o(),open_timer:U()}}static send(e=null){if(!e)return;const{ajaxurl:n,nonce:o}=W;fetch(`${n}?action=readabler_usage_analytics&nonce=${o}`,{method:"PUT",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then((e=>e.json())).then((e=>{e.success||console.warn(e.data)})).catch((e=>console.error("Error:",e))),t=[]}}function G(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]/g,"-").toLowerCase()}const X={p:"mdp-readabler",actions:["dark-contrast","light-contrast","monochrome","high-contrast","high-saturation","low-saturation"],enable(e){!1!==this.actions.includes(e)&&(O(e,!0),document.body.classList.contains(`${this.p}-${e}`)||document.body.classList.add(`${this.p}-${e}`),this.disableOthers(e))},disable(e){!1!==this.actions.includes(e)&&(O(e,!1),document.body.classList.contains(`${this.p}-${e}`)&&document.body.classList.remove(`${this.p}-${e}`))},disableOthers(e){e=G(e),this.actions.forEach((t=>{t!==e&&this.disable(t)}))}};let Y={init:function(){document.querySelector("#mdp-readabler-action-dyslexia-font").addEventListener("ReadablerToggleBoxChanged",Y.dyslexiaFriendly)},dyslexiaFriendly:function(e){e.target.classList.contains("mdp-active")?(Y.disableOthers(),document.body.classList.add("mdp-readabler-dyslexia-font"),Y.appendStyles()):document.body.classList.remove("mdp-readabler-dyslexia-font")},appendStyles:function(){const{pluginURL:e}=window.mdpReadablerOptions,t=document.createElement("style");t.id="mdp-readabler-style-dyslexia-font",t.innerHTML=`\n @font-face {\n font-family: 'OpenDyslexic';\n src: url("${e}fonts/OpenDyslexic-Italic.eot");\n src: local("OpenDyslexic Italic"), local("OpenDyslexic-Italic"),\n url("${e}fonts/OpenDyslexic-Italic.eot?#iefix") format("embedded-opentype"),\n url("${e}fonts/OpenDyslexic-Italic.woff2") format("woff2"),\n url("${e}fonts/OpenDyslexic-Italic.woff") format("woff");\n font-weight: normal;\n font-style: italic;\n font-display: swap;\n }\n @font-face {\n font-family: 'OpenDyslexic';\n src: url("${e}fonts/OpenDyslexic-Bold-Italic.eot");\n src: local("OpenDyslexic Bold Italic"), local("OpenDyslexic-Bold-Italic"),\n url("${e}fonts/OpenDyslexic-Bold-Italic.eot?#iefix") format("embedded-opentype"),\n url("${e}fonts/OpenDyslexic-Bold-Italic.woff2") format("woff2"),\n url("${e}fonts/OpenDyslexic-Bold-Italic.woff") format("woff");\n font-weight: bold;\n font-style: italic;\n font-display: swap;\n }\n @font-face {\n font-family: 'OpenDyslexic';\n src: url("${e}fonts/OpenDyslexic-Bold.eot");\n src: local("OpenDyslexic Bold"), local("OpenDyslexic-Bold"),\n url("${e}fonts/OpenDyslexic-Bold.eot?#iefix") format("embedded-opentype"),\n url("${e}fonts/OpenDyslexic-Bold.woff2") format("woff2"),\n url("${e}fonts/OpenDyslexic-Bold.woff") format("woff");\n font-weight: bold;\n font-style: normal;\n font-display: swap;\n }\n @font-face {\n font-family: 'OpenDyslexic';\n src: url("${e}fonts/OpenDyslexic-Regular.eot");\n src: local("OpenDyslexic Regular"), local("OpenDyslexic-Regular"),\n url("${e}fonts/OpenDyslexic-Regular.eot?#iefix") format("embedded-opentype"),\n url("${e}fonts/OpenDyslexic-Regular.woff2") format("woff2"),\n url("${e}fonts/OpenDyslexic-Regular.woff") format("woff");\n font-weight: normal;\n font-style: normal;\n font-display: swap;\n }\n `,document.head.appendChild(t)},disableOthers:function(){let e=document.getElementById("mdp-readabler-action-readable-font");e.classList.contains("mdp-active")&&e.click()}};const J={p:"mdp-readabler",actions:["dyslexia-font","readable-font"],enable(e){!1!==this.actions.includes(e)&&(O(e,!0),document.body.classList.contains(`${this.p}-${e}`)||document.body.classList.add(`${this.p}-${e}`),this.disableOthers(e),"dyslexia-font"===e&&Y.appendStyles())},disable(e){!1!==this.actions.includes(e)&&(O(e,!1),document.body.classList.contains(`${this.p}-${e}`)&&document.body.classList.remove(`${this.p}-${e}`),document.querySelector(`style#${this.p}-style-${e}`)&&document.querySelector(`style#${this.p}-style-${e}`).remove())},disableOthers(e){e=G(e),this.actions.forEach((t=>{t!==e&&this.disable(t)}))}};let Z={init:function(){document.querySelector("#mdp-readabler-action-text-colors").addEventListener("ReadablerPaletteChanged",Z.textColors)},textColors:function(e){let t=e.detail.color;null!==t?(document.body.classList.add("mdp-readabler-text-colors"),Z.appendStyles(t)):document.body.classList.remove("mdp-readabler-text-colors")},appendStyles:function(e){const t=document.createElement("style");t.id="mdp-readabler-style-text-colors",t.innerHTML=`\n body.mdp-readabler-text-colors a,\n body.mdp-readabler-text-colors p,\n body.mdp-readabler-text-colors li,\n body.mdp-readabler-text-colors label,\n body.mdp-readabler-text-colors input,\n body.mdp-readabler-text-colors select,\n body.mdp-readabler-text-colors textarea,\n body.mdp-readabler-text-colors legend,\n body.mdp-readabler-text-colors code,\n body.mdp-readabler-text-colors pre,\n body.mdp-readabler-text-colors dd,\n body.mdp-readabler-text-colors dt,\n body.mdp-readabler-text-colors span,\n body.mdp-readabler-text-colors blockquote {\n color: ${e} !important;\n }\n `,document.head.appendChild(t)}},Q={init:function(){document.querySelector("#mdp-readabler-action-title-colors").addEventListener("ReadablerPaletteChanged",Q.titleColors)},titleColors:function(e){let t=e.detail.color;null!==t?(document.body.classList.add("mdp-readabler-title-colors"),Q.appendStyles(t)):document.body.classList.remove("mdp-readabler-title-colors")},appendStyles(e){const t=document.createElement("style");t.id="mdp-readabler-style-title-colors",t.innerHTML=`\n body.mdp-readabler-title-colors h1,\n body.mdp-readabler-title-colors h1 *,\n body.mdp-readabler-title-colors h2,\n body.mdp-readabler-title-colors h2 *,\n body.mdp-readabler-title-colors h3,\n body.mdp-readabler-title-colors h3 *,\n body.mdp-readabler-title-colors h4,\n body.mdp-readabler-title-colors h4 *,\n body.mdp-readabler-title-colors h5,\n body.mdp-readabler-title-colors h5 *,\n body.mdp-readabler-title-colors h6,\n body.mdp-readabler-title-colors h6 * {\n color: ${e} !important;\n }\n `,document.head.appendChild(t)}},ee={init:function(){document.querySelector("#mdp-readabler-action-background-colors").addEventListener("ReadablerPaletteChanged",ee.backgroundColors)},backgroundColors:function(e){let t=e.detail.color;null!==t?(document.body.classList.add("mdp-readabler-background-colors"),ee.appendStyles(t)):document.body.classList.remove("mdp-readabler-background-colors")},appendStyles:function(e){const t=document.createElement("style");t.id="mdp-readabler-style-background-colors",t.innerHTML=`\n /*noinspection CssUnusedSymbol*/\n body.mdp-readabler-background-colors,\n body.mdp-readabler-background-colors h1,\n body.mdp-readabler-background-colors h1 span,\n body.mdp-readabler-background-colors h2,\n body.mdp-readabler-background-colors h2 span,\n body.mdp-readabler-background-colors h3,\n body.mdp-readabler-background-colors h3 span,\n body.mdp-readabler-background-colors h4,\n body.mdp-readabler-background-colors h4 span,\n body.mdp-readabler-background-colors h5,\n body.mdp-readabler-background-colors h5 span,\n body.mdp-readabler-background-colors h6,\n body.mdp-readabler-background-colors h6 span,\n\n body.mdp-readabler-background-colors p,\n body.mdp-readabler-background-colors a,\n body.mdp-readabler-background-colors li,\n body.mdp-readabler-background-colors label,\n body.mdp-readabler-background-colors input,\n body.mdp-readabler-background-colors select,\n body.mdp-readabler-background-colors textarea,\n body.mdp-readabler-background-colors legend,\n body.mdp-readabler-background-colors code,\n body.mdp-readabler-background-colors pre,\n body.mdp-readabler-background-colors dd,\n body.mdp-readabler-background-colors dt,\n body.mdp-readabler-background-colors span,\n body.mdp-readabler-background-colors blockquote {\n background-color: ${e} !important;\n }\n `,document.head.appendChild(t)}};function te(e,t,n){const o=document.querySelector(`.mdp-readabler-color[data-color="${t}"]`);o&&(n?o.classList.add("mdp-active"):o.classList.remove("mdp-active")),window.dispatchEvent(new CustomEvent("readabler-ai-popup",{detail:{action:"visualInterface",type:"color",mode:e,color:t,status:n}})),i.save(e,n?t:null)}const ne=JSON.parse('[{"name":"maroon","value":"maroon"},{"name":"red","value":"red"},{"name":"orange","value":"orange"},{"name":"yellow","value":"yellow"},{"name":"olive","value":"olive"},{"name":"green","value":"green"},{"name":"purple","value":"purple"},{"name":"fuchsia","value":"fuchsia"},{"name":"lime","value":"lime"},{"name":"teal","value":"teal"},{"name":"aqua","value":"aqua"},{"name":"blue","value":"blue"},{"name":"navy","value":"navy"},{"name":"black","value":"black"},{"name":"white","value":"white"}]'),oe={p:"mdp-readabler",actions:["text-colors","title-colors","background-colors"],enable(e,t){if(!1!==this.actions.includes(e))switch(this.disableOtherColor(e,t),te(e,t,!0),document.body.classList.contains(`${this.p}-${e}`)||document.body.classList.add(`${this.p}-${e}`),e){case"text-colors":Z.appendStyles(t);break;case"title-colors":Q.appendStyles(t);break;case"background-colors":ee.appendStyles(t)}},disable(e,t=null){if(!1===this.actions.includes(e))return;t||(t=i.get(`action-${e}`)),te(e,t,!1),document.body.classList.contains(`${this.p}-${e}`)&&document.body.classList.remove(`${this.p}-${e}`);const n=document.getElementById(`mdp-readabler-style-${e}`);n&&n.remove()},disableOtherColor:function(e){ne.forEach((t=>{this.disable(e,t.name)}))}},ie={p:"mdp-readabler",actions:["align-left","align-center","align-right"],enable(e){!1!==this.actions.includes(e)&&(this.disableOthers(e),O(e,!0),document.body.classList.contains(`${this.p}-${e}`)||document.body.classList.add(`${this.p}-${e}`))},disable(e){!1!==this.actions.includes(e)&&(O(e,!1),document.body.classList.contains(`${this.p}-${e}`)&&document.body.classList.remove(`${this.p}-${e}`))},disableOthers(e){e=G(e),this.actions.forEach((t=>{t!==e&&this.disable(t)}))}};let ae={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-highlight-titles").addEventListener("ReadablerToggleBoxChanged",ae.highlightTitles)},highlightTitles:function(e){e.target.classList.contains("mdp-active")?ae.enable("highlight-titles"):ae.disable("highlight-titles")},enable(e){O(e,!0),document.body.classList.contains(`${this.p}-${e}`)||document.body.classList.add(`${this.p}-${e}`)},disable(e){O(e,!1),document.body.classList.contains(`${this.p}-${e}`)&&document.body.classList.remove(`${this.p}-${e}`)}},re={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-highlight-links").addEventListener("ReadablerToggleBoxChanged",re.highlightLinks)},highlightLinks:function(e){e.target.classList.contains("mdp-active")?re.enable("highlight-links"):re.disable("highlight-links")},enable(e){O(e,!0),document.body.classList.contains(`${this.p}-${e}`)||document.body.classList.add(`${this.p}-${e}`)},disable(e){O(e,!1),document.body.classList.contains(`${this.p}-${e}`)&&document.body.classList.remove(`${this.p}-${e}`)}},de={p:"mdp-readabler",tooltip:document.createElement("div"),init:function(){document.querySelector("#mdp-readabler-action-text-magnifier").addEventListener("ReadablerToggleBoxChanged",de.textMagnifier)},textMagnifier:function(e){e.target.classList.contains("mdp-active")?de.enable("text-magnifier"):de.disable("text-magnifier")},updateTooltip:function(e){const t=e.target;if(!["H1","H2","H3","H4","H5","H6","SPAN","P","LI","LABEL","INPUT","SELECT","TEXTAREA","LEGEND","CODE","PRE","DD","DT","TD","TH","A","STRONG","B","BLOCKQUOTE","BUTTON","IMG","FIGCAPTION","DIV"].includes(t.nodeName))return void de.hideTooltip();let n="";switch(t.nodeName){case"DIV":0===t.children.length&&(n=t.innerText??"");break;case"A":n=t.innerText??t.title??"";break;case"IMG":n=t.alt??"";break;case"INPUT":if("button"===t.type||"submit"===t.type){n=t.value??"";break}if("radio"===t.type||"checkbox"===t.type){n=t.labels[0].innerText??"";break}if("text"===t.type){n=t.value??"";break}break;case"BUTTON":n=t.innerText&&""!==t.innerText?t.innerText:t.title??"";break;case"SELECT":n=t.options[t.selectedIndex].text??"";break;case"TEXTAREA":n=t.value??"";break;default:n=t.innerText??""}if(""===n.trim())return void de.hideTooltip();de.showTooltip(),de.tooltip.innerHTML=n;const o=15;let i=window.innerWidth;de.tooltip.style.top=`${e.clientY+o}px`,e.clientX>.5*window.innerWidth?(i=e.clientX-o<=680?e.clientX-o:680,de.tooltip.style.left="unset",de.tooltip.style.right=window.innerWidth-e.clientX-o+"px",de.tooltip.style.maxWidth=`${i}px`):(i=window.innerWidth-e.clientX-45<680?window.innerWidth-e.clientX-45:680,de.tooltip.style.right="unset",de.tooltip.style.left=`${e.clientX+o}px`,de.tooltip.style.maxWidth=`${i}px`),e.clientY>.5*window.innerHeight?(de.tooltip.style.bottom=`${window.innerHeight-e.clientY+o}px`,de.tooltip.style.top="unset"):de.tooltip.style.bottom="unset"},hideTooltip:function(){de.tooltip.style.visibility="hidden"},showTooltip:function(){de.tooltip.style.visibility="visible"},enable(e){O(e,!0),document.body.classList.add(`${this.p}-${e}`),document.body.appendChild(de.tooltip),de.tooltip.id="mdp-readabler-text-magnifier-tooltip",document.addEventListener("mousemove",de.updateTooltip,!1),document.addEventListener("mouseleave",de.hideTooltip,!1),document.addEventListener("mouseenter",de.showTooltip,!1)},disable(e){O(e,!1),document.body.classList.remove(`${this.p}-${e}`),document.removeEventListener("mousemove",de.updateTooltip,!1),document.body.contains(de.tooltip)&&document.body.removeChild(de.tooltip),document.removeEventListener("mouseleave",de.hideTooltip,!1),document.removeEventListener("mouseenter",de.showTooltip,!1)}},se={p:"mdp-readabler",readingMaskTop:null,readingMaskBottom:null,init:function(){document.querySelector("#mdp-readabler-action-reading-mask").addEventListener("ReadablerToggleBoxChanged",se.readingMask)},readingMask:function(e){e.target.classList.contains("mdp-active")?se.enable("reading-mask"):se.disable("reading-mask")},enable(e){document.querySelectorAll(`.${this.p}-${e}-top`).length||(O(e,!0),document.body.classList.add(`${this.p}-${e}`),se.readingMaskTop=document.createElement("div"),se.readingMaskTop.classList.add(`${this.p}-${e}-top`),document.body.appendChild(se.readingMaskTop),se.readingMaskBottom=document.createElement("div"),se.readingMaskBottom.classList.add(`${this.p}-${e}-bottom`),document.body.appendChild(se.readingMaskBottom),document.addEventListener("mousemove",se.moveReadingMask))},disable(e){document.body.classList.remove(`${this.p}-${e}`),O(e,!1),se.readingMaskTop&&se.readingMaskTop.remove(),se.readingMaskBottom&&se.readingMaskBottom.remove(),document.removeEventListener("mousemove",se.moveReadingMask)},moveReadingMask:function(e){let t=e.clientY,n=Math.round(window.mdpReadablerOptions.readingMaskHeight/2);se.readingMaskTop&&(se.readingMaskTop.style.height=t-n+"px"),se.readingMaskBottom&&(se.readingMaskBottom.style.top=`${t+n}px`)}},le={p:"mdp-readabler",readingGuideEl:null,init:function(){document.querySelector("#mdp-readabler-action-reading-guide").addEventListener("ReadablerToggleBoxChanged",le.readingGuide)},readingGuide:function(e){e.target.classList.contains("mdp-active")?le.enable("reading-guide"):le.disable("reading-guide")},enable(e){document.querySelectorAll(`.${this.p}-${e}-element`).length||(O(e,!0),document.body.classList.add(`${this.p}-${e}`),le.readingGuideEl=document.createElement("div"),le.readingGuideEl.classList.add(`${this.p}-${e}-element`),document.body.appendChild(le.readingGuideEl),document.addEventListener("mousemove",le.moveReadingGuide),document.addEventListener("click",le.moveReadingGuide))},disable(e){O(e,!1),document.body.classList.remove(`${this.p}-${e}`),le.readingGuideEl&&le.readingGuideEl.remove(),document.removeEventListener("mousemove",le.moveReadingGuide),document.removeEventListener("click",le.moveReadingGuide)},moveReadingGuide:function(e){let t=e.clientX-Math.round(le.readingGuideEl.clientWidth/2),n=e.clientY;le.readingGuideEl.style.transform="translate3d("+t+"px,"+n+"px,0px)"}},ce={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-highlight-focus").addEventListener("ReadablerToggleBoxChanged",ce.highlightFocus)},highlightFocus:function(e){e.target.classList.contains("mdp-active")?ce.enable("highlight-focus"):ce.disable("highlight-focus")},enable(e){O(e,!0),document.body.classList.add(`${this.p}-${e}`)},disable(e){O(e,!1),document.body.classList.remove(`${this.p}-${e}`)}},ue={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-mute-sounds").addEventListener("ReadablerToggleBoxChanged",ue.muteSounds)},muteSounds:function(e){e.target.classList.contains("mdp-active")?ue.enable("mute-sounds"):ue.disable("mute-sounds")},enable(e){O(e,!0),ue.mute(!0),document.documentElement.classList.add(`${this.p}-${e}`)},disable(e){O(e,!1),ue.mute(!1),document.documentElement.classList.remove(`${this.p}-${e}`)},mute(e){document.querySelectorAll("video, audio").forEach((t=>{t.muted=e})),document.querySelectorAll("iframe").forEach((t=>{if(t.src.toLowerCase().includes("youtube.com")||t.src.toLowerCase().includes("vimeo.com")){let n=new URL(t.src);e?(n.searchParams.append("mute","1"),n.searchParams.append("muted","1")):(n.searchParams.delete("mute"),n.searchParams.delete("muted")),t.src=n.href}}))}},pe={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-hide-images").addEventListener("ReadablerToggleBoxChanged",pe.hideImages)},hideImages:function(e){e.target.classList.contains("mdp-active")?pe.enable("hide-images"):pe.disable("hide-images")},enable(e){O(e,!0),document.body.classList.add(`${this.p}-${e}`)},disable(e){O(e,!1),document.body.classList.remove(`${this.p}-${e}`)}},me={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-stop-animations").addEventListener("ReadablerToggleBoxChanged",me.stopAnimations)},stopAnimations:function(e){e.target.classList.contains("mdp-active")?me.enable("stop-animations"):me.disable("stop-animations")},enable(e="stop-animations"){O(e,!0),document.body.classList.add(`${this.p}-${e}`),document.querySelectorAll("video").forEach((e=>{!1===e.paused&&(e.pause(),e.dataset.pausedByReadabler="true")})),document.querySelectorAll("iframe").forEach((e=>{"undefined"===e.dataset.pausedByReadabler?e.dataset.pausedByReadabler="true":setTimeout((function(){let t=e.src;t.includes("www.youtube.com/embed")&&(e.src=t,e.dataset.pausedByReadabler="true")}),300)}))},disable(e="stop-animations"){O(e,!1),document.body.classList.remove(`${this.p}-${e}`),document.querySelectorAll("video").forEach((e=>{!0===e.paused&&"true"===e.dataset.pausedByReadabler&&(e.play(),e.dataset.pausedByReadabler="false")}))}};function be(e,t=" "){return e.toLowerCase().split(t).map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(t)}class fe{static storageName="readabler";constructor(){this.migrate(),this.loadSaved()}migrate(){if(!this.isMigrationNeeded())return;let t="mdpReadabler",n=Object.keys(localStorage);for(const o in n){if(!n[o].toString().startsWith(t))continue;let i=fe.prepareKey(n[o].toString().replace(t,"")),a=localStorage.getItem(n[o]);a&&("true"===a?a=!0:"false"===a&&(a=!1),fe.save(e(i),a),localStorage.removeItem(n[o]))}}loadSaved(){const e=fe.settings();if(e){for(const[t,n]of Object.entries(e))window.dispatchEvent(new CustomEvent("readabler-headless",{detail:{action:t,value:n}}));n({id:"load_saved",value:1})}}setConfig(){}isMigrationNeeded(){return!localStorage.getItem(fe.storageName)}static prepareKey(t){return e(t=(t=(t=t.replace("mdp-readabler-","")).replace("action-","")).trim())}static get(e){return fe.settings()[this.prepareKey(e)]??null}static save(e,t){let n=fe.settings();n[this.prepareKey(e)]=t;for(const[e,t]of Object.entries(n))t&&""!==t&&void 0!==t||delete n[e];localStorage.setItem(fe.storageName,JSON.stringify(n))}static settings(){const e=localStorage.getItem(fe.storageName);if(e){const t=JSON.parse(e);return t||{}}return localStorage.setItem(fe.storageName,JSON.stringify({})),{}}static haveSavedSettings(){return!!localStorage.getItem(fe.storageName)}static reset(){localStorage.removeItem(fe.storageName)}}function ge(e,t){const n="mdp-readabler";t=parseInt(t);const o=document.querySelector(`#${n}-action-${e} .${n}-value`);o&&(o.textContent=0===t?o.getAttribute("data-default"):`${t}%`,o.setAttribute("data-value",t)),window.dispatchEvent(new CustomEvent("readabler-ai-popup",{detail:{action:"visualInterface",type:"spinner",mode:e,spinnerValue:t}})),fe.save(e,t)}let he={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-content-scaling .mdp-readabler-value").addEventListener("ReadablerInputSpinnerChanged",this.scaleContent)},scaleContent:function(e){let t=parseInt(e.target.dataset.value);he.setElementProperty(t,"body > *","zoom","")},enable(e,t){ge(e,t),document.body.classList.add(`${this.p}-${e}`),he.setElementProperty(parseInt(t),"body > *","zoom","")},disable(e){ge(e,0),document.body.classList.remove(`${this.p}-${e}`),navigator.userAgent.toLowerCase().indexOf("firefox")>0?he.setFirefoxProperty(0,"body","-moz-transform",""):he.setElementProperty(0,"body > *","zoom","")},setFirefoxProperty:function(e,t,n,o=""){let i=be(n,"-").replace("-","");i="readabler"+i;let a=document.querySelector(t),r=parseFloat(a.dataset[i]);if(!r||isNaN(r)){let e=window.getComputedStyle(a,null).getPropertyValue(n);r="none"===e?1:parseFloat(e.split("(")[1].split(")")[0]),a.dataset[i]=r.toString()}0===r&&(r=1);let d=(r+Math.abs(r/100)*e).toFixed(2);1===parseFloat(d)?(a.style.setProperty(n,"none","important"),a.style.removeProperty("-moz-transform-origin")):(a.style.setProperty(n,`scale(${d.toString()})`,"important"),a.style.setProperty("-moz-transform-origin","top left","important"))},setElementProperty:function(e,t,n,o){let i=be(n,"-").replace("-","");i="readabler"+i,document.querySelectorAll(t).forEach((t=>{let a=parseFloat(t.dataset[i]);if(!a){let e=window.getComputedStyle(t,null).getPropertyValue(n);a=parseFloat(e),"normal"===e&&(a=0),t.dataset[i]=a.toString()}0===a&&(a=1);let r=(a+Math.abs(a/100)*e).toFixed(2);t.style.setProperty(n,r.toString()+o,"important")}))}};const ve=window.mdpReadablerOptions??{};let ye={p:"mdp-readabler",keyboardBox:document.getElementById("mdp-readabler-keyboard-box"),keyboard:null,selectedInput:null,init:function(){if(!ve.virtualKeyboard)return;document.querySelector("#mdp-readabler-action-virtual-keyboard").addEventListener("ReadablerToggleBoxChanged",ye.virtualKeyboard)},enable(e){if(O(e,!0),document.body.classList.add(`${this.p}-${e}`),!document.getElementById("mdp-readabler-keyboard-box")){const e=document.createElement("div");e.id="mdp-readabler-keyboard-box",e.innerHTML='
',document.body.appendChild(e)}document.addEventListener("focusin",ye.focusInHandler,!0),document.addEventListener("click",ye.clickHandler),ye.makeKeyboardDraggable();let t={newLineOnEnter:!0,onChange:e=>ye.onChange(e),onKeyPress:e=>ye.onKeyPress(e),theme:`${this.p}-simple-keyboard`,physicalKeyboardHighlight:!0},n=ye.simpleKeyboardLayout();n&&(t.layout=n),window.SimpleKeyboard.default&&(ye.keyboard=new window.SimpleKeyboard.default(t))},disable(e){O(e,!1),document.body.classList.remove(`${this.p}-${e}`),ye.keyboard&&ye.keyboard.destroy(),document.getElementById("mdp-readabler-keyboard-box")&&document.getElementById("mdp-readabler-keyboard-box").remove()},focusInHandler(e){const t=ye.isTextInput(),n=document.getElementById("mdp-readabler-keyboard-box");n&&(t?(ye.onInputFocus(t),t.addEventListener("input",ye.onInputChange)):"none"!==n.style&&(n.style.display="none"))},clickHandler(e){const t=document.getElementById("mdp-readabler-keyboard-box");if(!t)return;let n=e.target.nodeName.toLowerCase();null===e.target.closest("#mdp-readabler-keyboard-box")&&"input"!==n&&"textarea"!==n&&(t.style.display="none")},isTextInput:function(){const e=document.activeElement,t=e.tagName,n=e.getAttribute("type");return!(!["TEXTAREA","INPUT"].includes(t)||["radio","checkbox","hidden"].includes(n)&&null!==n)&&e},onInputFocus:function(e){if(!document.body.classList.contains("mdp-readabler-virtual-keyboard"))return;const t=document.getElementById("mdp-readabler-keyboard-box");t&&(t.style.display="block",e.id||(e.id=ye.uid()),ye.selectedInput=`#${e.id}`,ye.keyboard.setOptions({inputName:e.id}))},onInputChange:function(e){document.body.classList.contains("mdp-readabler-virtual-keyboard")&&ye.keyboard.setInput(e.target.value,e.target.id)},virtualKeyboard:function(){"true"===fe.get("virtualKeyboard")||!0===fe.get("virtualKeyboard")?ye.enable("virtual-keyboard"):ye.disable("virtual-keyboard")},simpleKeyboardLayout:function(){let e=ve.virtualKeyboardLayouts[function(){const e=navigator.language??"en";let t=document.documentElement.lang??e;return t=t.replace(/-/g,"_"),t.split("_")[0]}()]??!1;if(!e)return!1;e=e.replace(/\\\\u/g,"\\u");try{return JSON.parse(e)}catch(e){return console.warn(e),!1}},onChange:function(e){document.querySelector(ye.selectedInput).value=e},onKeyPress:function(e){"{lock}"!==e&&"{shift}"!==e||ye.handleShiftButton()},handleShiftButton:function(){let e="default"===ye.keyboard.options.layoutName?"shift":"default";ye.keyboard.setOptions({layoutName:e})},uid:function(){return"mdp-"+Date.now().toString(36)+Math.random().toString(36).substring(2)},makeKeyboardDraggable:function(){const e=document.getElementById("mdp-readabler-keyboard-box");if(!e)return;let t,n,o,i,a=document.documentElement,r=!1,d=0,s=0;function l(t){"touchstart"===t.type?(o=t.touches[0].clientX-d,i=t.touches[0].clientY-s):(o=t.clientX-d,i=t.clientY-s),t.target===e&&(r=!0)}function c(){o=t,i=n,r=!1}function u(a){var l,c;r&&("touchmove"===a.type?(t=a.touches[0].clientX-o,n=a.touches[0].clientY-i):(t=a.clientX-o,n=a.clientY-i),d=t,s=n,l=t,c=n,e.style.transform="translate3d("+l+"px, "+c+"px, 0)")}a.addEventListener("touchstart",l,!1),a.addEventListener("touchend",c,!1),a.addEventListener("touchmove",u,!1),a.addEventListener("mousedown",l,!1),a.addEventListener("mouseup",c,!1),a.addEventListener("mousemove",u,!1)}};const we={p:"mdp-readabler",actions:["big-black-cursor","big-white-cursor"],enable(e){O(e,!0),document.body.classList.add(`${this.p}-${e}`),we.disableOthers(e)},disable(e){O(e,!1),document.body.classList.remove(`${this.p}-${e}`)},disableOthers(e){this.actions.forEach((t=>{t!==e&&this.disable(t)}))}};let Ee={p:"mdp-readabler",highlightHoverStyle:document.createElement("style"),init:function(){document.querySelector("#mdp-readabler-action-highlight-hover").addEventListener("ReadablerToggleBoxChanged",Ee.highlightHover)},highlightHover:function(e){e.target.classList.contains("mdp-active")?Ee.enable("highlight-hover"):Ee.disable("highlight-hover")},enable(e){O(e,!0),document.body.classList.add(`${this.p}-${e}`)},disable(e){O(e,!1),document.body.classList.remove(`${this.p}-${e}`)}};const xe={p:"mdp-readabler",textSelectors:"h1, h2, h3, h4, h5, h6, p, a, span, li, label, legend, dd, dt, blockquote, time",init:function(){document.querySelector("#mdp-readabler-action-cognitive-reading").addEventListener("ReadablerToggleBoxChanged",this.cognitiveReading)},cognitiveReading:function(e){document.querySelectorAll(`${xe.textSelectors}`)&&(e.target.classList.contains("mdp-active")?xe.enable("cognitive-reading"):xe.disable("cognitive-reading"))},enable(e){O(e,!0),document.body.classList.add(`${this.p}-${e}`),this.addCognitiveExperience()},disable(e){O(e,!1),document.body.classList.remove(`${this.p}-${e}`),document.querySelectorAll(`b.${this.p}-${e}`).forEach((e=>{e.outerHTML=e.innerHTML})),document.querySelectorAll(`.${this.p}-${e}-color`).forEach((t=>{t.style.color="",t.classList.remove(`${this.p}-${e}-color`)}))},cognitivePlaintNode:function(e){if(this.isSkipNode(e))return;if(""===e.innerText||e.innerText.length<2)return;let t=getComputedStyle(e).color;e.innerHTML=this.cognitiveSentence(e.innerText,t),this.addCognitiveFocus(e)},cognitiveMixedNode:function(e){if(this.isSkipNode(e))return;if(0===e.innerHTML.replaceAll(/(<+.+>)/g,"").trim().length)return;let t=getComputedStyle(e).color,n=[];e.innerHTML.split(/(<+.+>)/g).forEach((e=>{e?e.match(/(<[^>]+>)/g)||e.match(/(<\/[^>]+>)/g)?n.push(e):""!==e.trim()&&"."!==e.trim()&&","!==e.trim()&&":"!==e.trim()&&";"!==e.trim()&&"?"!==e.trim()&&"!"!==e.trim()?n.push(this.cognitiveSentence(e,t)):n.push(e):n.push(e)})),e.innerHTML=n.join(""),this.addCognitiveFocus(e)},addCognitiveExperience:function(){document.querySelectorAll(`${xe.textSelectors}`).forEach((e=>{0===e.children.length&&this.cognitivePlaintNode(e)})),document.querySelectorAll(`${xe.textSelectors}`).forEach((e=>{0!==e.children.length&&this.cognitiveMixedNode(e)}))},addCognitiveFocus:function(e){let t=getComputedStyle(e).color;(window.mdpReadablerOptions.cognitiveReadingFocus??!1)&&(e.classList.add("mdp-readabler-cognitive-reading-color"),e.style.color=xe.toRGBA(t,.5))},toRGBA:function(e,t=1){if(-1!==e.indexOf("rgba"))return e;if(-1!==e.indexOf("rgb"))return e.replace("rgb","rgba").replace(")",`, ${t})`);if(-1!==e.indexOf("#")){let n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t=Math.min(Math.max(t,0),1)})`}return e},cognitiveSentence:function(e,t){let n=[];return e.split(/\s+/).forEach((e=>{0!==e.trim().length?n.push(xe.congnitiveWord(e,t)):n.push(e)})),n.join(" ")},congnitiveWord(e,t){const n=xe.charIndex(e);return`${e.slice(0,n)}${e.slice(n)}`},charIndex:function(e){if(e.length<3)return 0;if(/\d/.test(e))return e.length;if(e.includes("[[[mdp-readabler-cognitive-reading-a]]]"))return 0;if(/^[#@&()–\[\]{}:;?/*`~$^+=<>.,]/.test(e))return 0;const t=window.mdpReadablerOptions.cognitiveReadingFixation??"normal";let n=Math.min(Math.floor(e.length/3),e.length-1);switch(t){case"low":n=Math.min(Math.floor(e.length/4),e.length-1);break;case"strong":n=Math.min(Math.floor(e.length/2),e.length-1)}return 1===n&&e.length>2?2:n},isSkipNode:function(e){return 1!==e.nodeType||(!(!e.className.includes("mdp-readabler")&&!e.id.includes("mdp-readabler"))||e.closest("#mdp-readabler-popup-box"))}},Le={p:"mdp-readabler",fontSizingStyle:document.createElement("style"),textTags:["h1","h2","h3","h4","h5","h6","p","span","a","li","label","input","select","textarea","legend","code","pre","dd","dt","span","blockquote","th","bdi",'button[type="submit"]',"button.fusion-button"],init:function(){document.querySelector("#mdp-readabler-action-font-sizing .mdp-readabler-value").addEventListener("ReadablerInputSpinnerChanged",this.fontSizing)},fontScaling(e){console.log("Font scaling",e);const t="object"==typeof avadaHeaderVars||"object"==typeof avadaSelectVars;for(let n of Le.textTags)if(document.querySelectorAll(n)&&0!==document.querySelectorAll(n).length)for(let o of document.querySelectorAll(n)){let n=!1;if(t&&Le.avadaFontScaling(o))continue;const i=fe.get("fontSizing");if(null===i||"0"===i){let e=o.closest("[original-size]");if(e){const t=window.getComputedStyle(o).fontSize.split("px",1)[0],n=window.getComputedStyle(e).fontSize.split("px",1)[0];if(parseInt(t)===parseInt(n))continue}}else if("INPUT"!==o.tagName){const e=this.getElementOriginalSize(o),t=this.getParentOriginalSize(o);n=null!==t&&e===t}if(n){const t=this.getParentOriginalSize(o);o.style.fontSize=`${this.newFontSize(t,e)}px`}else{const t=this.getElementOriginalSize(o);o.style.fontSize=`${this.newFontSize(t,e)}px`}}},fontSizing(e){let t=parseInt(e.target.dataset.value);0!==t?Le.enable("font-sizing",t):Le.disable("font-sizing")},enable(e,t){ge(e,t),document.body.classList.add(`${this.p}-${e}`),Le.fontScaling(parseInt(t))},disable(e){ge(e,0),document.body.classList.remove(`${this.p}-${e}`),Le.fontScaling(0)},getElementOriginalSize:function(e){let t=window.getComputedStyle(e).fontSize.split("px",1)[0];return t=parseInt(t),null===e.getAttribute("original-size")?e.setAttribute("original-size",t):t=e.getAttribute("original-size"),t},getParentOriginalSize:function(e){const t=e.parentElement;return t?t.getAttribute("original-size"):null},newFontSize:function(e,t){return Math.floor(parseInt(e)+e*(.01*t))},avadaFontScaling:function(e){if(setTimeout((function(){let t=e.getAttribute("style");t&&t.includes("--fontSize")&&(t=t.replace("--fontSize:","--fusionFontSize:"),e.setAttribute("style",t)),e.classList.contains("fusion-responsive-typography-calculated")&&e.classList.remove("fusion-responsive-typography-calculated")}),0),"INPUT"!==e.tagName&&"BUTTON"!==e.tagName&&(null!==e.parentElement.getAttribute("original-size")||null!==e.parentElement.parentElement.getAttribute("original-size"))){if(null!==e.getAttribute("style")){let t=e.getAttribute("style");t=t.replace(/font-size:.*?;/,""),t=t.replace("font-size:",""),e.setAttribute("style",t)}return!0}return!1}},Se={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-line-height .mdp-readabler-value").addEventListener("ReadablerInputSpinnerChanged",this.lineHeight)},fontLeading:function(e){const t=["h1","h2","h3","h4","h5","h6","p","span","p","a","li","label","input","select","textarea","legend","code","pre","dd","dt","span","blockquote"];for(let n of t)if(document.getElementsByTagName(n).length>0)for(let t of document.getElementsByTagName(n)){let n=window.getComputedStyle(t).lineHeight.split("px",1)[0];null===t.getAttribute("original-leading")?t.setAttribute("original-leading",n):n=t.getAttribute("original-leading"),t.style.lineHeight=`${parseInt(n)+n*(.01*e)}px`}},lineHeight:function(e){let t=parseInt(e.target.dataset.value);0!==t?Se.enable("line-height",t):Se.disable("line-height")},enable(e,t){ge(e,t),document.body.classList.add(`${this.p}-${e}`),Se.fontLeading(parseInt(t))},disable(e){ge(e,0),document.body.classList.remove(`${this.p}-${e}`),Se.fontLeading(0)}},ke={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-letter-spacing .mdp-readabler-value").addEventListener("ReadablerInputSpinnerChanged",this.letterSpacing)},letterSpacing:function(e){let t=parseInt(e.target.dataset.value);0!==t?ke.enable("letter-spacing",t):ke.disable("letter-spacing")},enable(e,t){ge(e,t),document.body.classList.add(`${this.p}-${e}`),ke.appendStyles(parseInt(t))},disable(e){ge(e,0),document.body.classList.remove(`${this.p}-${e}`),ke.deleteStyles()},appendStyles(e){let t=e/100;const n=document.createElement("style");n.id="mdp-readabler-style-letter-spacing",n.innerHTML=`\n :root {\n --readabler-letter-spacing: ${t}px;\n }\n `,document.head.appendChild(n)},deleteStyles(){const e=document.getElementById("mdp-readabler-style-letter-spacing");e&&e.remove()}};function Ce(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Te(e){return e instanceof Ce(e).Element||e instanceof Element}function Re(e){return e instanceof Ce(e).HTMLElement||e instanceof HTMLElement}function Ae(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Ce(e).ShadowRoot||e instanceof ShadowRoot)}var Oe=Math.max,$e=Math.min,Ie=Math.round;function Me(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Be(){return!/^((?!chrome|android).)*safari/i.test(Me())}function Ne(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),i=1,a=1;t&&Re(e)&&(i=e.offsetWidth>0&&Ie(o.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Ie(o.height)/e.offsetHeight||1);var r=(Te(e)?Ce(e):window).visualViewport,d=!Be()&&n,s=(o.left+(d&&r?r.offsetLeft:0))/i,l=(o.top+(d&&r?r.offsetTop:0))/a,c=o.width/i,u=o.height/a;return{width:c,height:u,top:l,right:s+c,bottom:l+u,left:s,x:s,y:l}}function qe(e){var t=Ce(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function De(e){return e?(e.nodeName||"").toLowerCase():null}function Fe(e){return((Te(e)?e.ownerDocument:e.document)||window.document).documentElement}function He(e){return Ne(Fe(e)).left+qe(e).scrollLeft}function _e(e){return Ce(e).getComputedStyle(e)}function Pe(e){var t=_e(e),n=t.overflow,o=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function je(e,t,n){void 0===n&&(n=!1);var o,i,a=Re(t),r=Re(t)&&function(e){var t=e.getBoundingClientRect(),n=Ie(t.width)/e.offsetWidth||1,o=Ie(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(t),d=Fe(t),s=Ne(e,r,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(a||!a&&!n)&&(("body"!==De(t)||Pe(d))&&(l=(o=t)!==Ce(o)&&Re(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:qe(o)),Re(t)?((c=Ne(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):d&&(c.x=He(d))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function Ve(e){var t=Ne(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function Ue(e){return"html"===De(e)?e:e.assignedSlot||e.parentNode||(Ae(e)?e.host:null)||Fe(e)}function ze(e){return["html","body","#document"].indexOf(De(e))>=0?e.ownerDocument.body:Re(e)&&Pe(e)?e:ze(Ue(e))}function We(e,t){var n;void 0===t&&(t=[]);var o=ze(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),a=Ce(o),r=i?[a].concat(a.visualViewport||[],Pe(o)?o:[]):o,d=t.concat(r);return i?d:d.concat(We(Ue(r)))}function Ke(e){return["table","td","th"].indexOf(De(e))>=0}function Ge(e){return Re(e)&&"fixed"!==_e(e).position?e.offsetParent:null}function Xe(e){for(var t=Ce(e),n=Ge(e);n&&Ke(n)&&"static"===_e(n).position;)n=Ge(n);return n&&("html"===De(n)||"body"===De(n)&&"static"===_e(n).position)?t:n||function(e){var t=/firefox/i.test(Me());if(/Trident/i.test(Me())&&Re(e)&&"fixed"===_e(e).position)return null;var n=Ue(e);for(Ae(n)&&(n=n.host);Re(n)&&["html","body"].indexOf(De(n))<0;){var o=_e(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||t}var Ye="top",Je="bottom",Ze="right",Qe="left",et="auto",tt=[Ye,Je,Ze,Qe],nt="start",ot="end",it="clippingParents",at="viewport",rt="popper",dt="reference",st=tt.reduce((function(e,t){return e.concat([t+"-"+nt,t+"-"+ot])}),[]),lt=[].concat(tt,[et]).reduce((function(e,t){return e.concat([t,t+"-"+nt,t+"-"+ot])}),[]),ct=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ut(e){var t=new Map,n=new Set,o=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&i(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),o}var pt={placement:"bottom",modifiers:[],strategy:"absolute"};function mt(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function wt(e){var t,n=e.reference,o=e.element,i=e.placement,a=i?ht(i):null,r=i?vt(i):null,d=n.x+n.width/2-o.width/2,s=n.y+n.height/2-o.height/2;switch(a){case Ye:t={x:d,y:n.y-o.height};break;case Je:t={x:d,y:n.y+n.height};break;case Ze:t={x:n.x+n.width,y:s};break;case Qe:t={x:n.x-o.width,y:s};break;default:t={x:n.x,y:n.y}}var l=a?yt(a):null;if(null!=l){var c="y"===l?"height":"width";switch(r){case nt:t[l]=t[l]-(n[c]/2-o[c]/2);break;case ot:t[l]=t[l]+(n[c]/2-o[c]/2)}}return t}var Et={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xt(e){var t,n=e.popper,o=e.popperRect,i=e.placement,a=e.variation,r=e.offsets,d=e.position,s=e.gpuAcceleration,l=e.adaptive,c=e.roundOffsets,u=e.isFixed,p=r.x,m=void 0===p?0:p,b=r.y,f=void 0===b?0:b,g="function"==typeof c?c({x:m,y:f}):{x:m,y:f};m=g.x,f=g.y;var h=r.hasOwnProperty("x"),v=r.hasOwnProperty("y"),y=Qe,w=Ye,E=window;if(l){var x=Xe(n),L="clientHeight",S="clientWidth";if(x===Ce(n)&&"static"!==_e(x=Fe(n)).position&&"absolute"===d&&(L="scrollHeight",S="scrollWidth"),i===Ye||(i===Qe||i===Ze)&&a===ot)w=Je,f-=(u&&x===E&&E.visualViewport?E.visualViewport.height:x[L])-o.height,f*=s?1:-1;if(i===Qe||(i===Ye||i===Je)&&a===ot)y=Ze,m-=(u&&x===E&&E.visualViewport?E.visualViewport.width:x[S])-o.width,m*=s?1:-1}var k,C=Object.assign({position:d},l&&Et),T=!0===c?function(e,t){var n=e.x,o=e.y,i=t.devicePixelRatio||1;return{x:Ie(n*i)/i||0,y:Ie(o*i)/i||0}}({x:m,y:f},Ce(n)):{x:m,y:f};return m=T.x,f=T.y,s?Object.assign({},C,((k={})[w]=v?"0":"",k[y]=h?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+m+"px, "+f+"px)":"translate3d("+m+"px, "+f+"px, 0)",k)):Object.assign({},C,((t={})[w]=v?f+"px":"",t[y]=h?m+"px":"",t.transform="",t))}const Lt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,i=void 0===o||o,a=n.adaptive,r=void 0===a||a,d=n.roundOffsets,s=void 0===d||d,l={placement:ht(t.placement),variation:vt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,xt(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,xt(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};const St={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},i=t.elements[e];Re(i)&&De(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Re(o)&&De(o)&&(Object.assign(o.style,a),Object.keys(i).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};const kt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,i=n.offset,a=void 0===i?[0,0]:i,r=lt.reduce((function(e,n){return e[n]=function(e,t,n){var o=ht(e),i=[Qe,Ye].indexOf(o)>=0?-1:1,a="function"==typeof n?n(Object.assign({},t,{placement:e})):n,r=a[0],d=a[1];return r=r||0,d=(d||0)*i,[Qe,Ze].indexOf(o)>=0?{x:d,y:r}:{x:r,y:d}}(n,t.rects,a),e}),{}),d=r[t.placement],s=d.x,l=d.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=l),t.modifiersData[o]=r}};var Ct={left:"right",right:"left",bottom:"top",top:"bottom"};function Tt(e){return e.replace(/left|right|bottom|top/g,(function(e){return Ct[e]}))}var Rt={start:"end",end:"start"};function At(e){return e.replace(/start|end/g,(function(e){return Rt[e]}))}function Ot(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ae(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function $t(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function It(e,t,n){return t===at?$t(function(e,t){var n=Ce(e),o=Fe(e),i=n.visualViewport,a=o.clientWidth,r=o.clientHeight,d=0,s=0;if(i){a=i.width,r=i.height;var l=Be();(l||!l&&"fixed"===t)&&(d=i.offsetLeft,s=i.offsetTop)}return{width:a,height:r,x:d+He(e),y:s}}(e,n)):Te(t)?function(e,t){var n=Ne(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):$t(function(e){var t,n=Fe(e),o=qe(e),i=null==(t=e.ownerDocument)?void 0:t.body,a=Oe(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),r=Oe(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),d=-o.scrollLeft+He(e),s=-o.scrollTop;return"rtl"===_e(i||n).direction&&(d+=Oe(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:r,x:d,y:s}}(Fe(e)))}function Mt(e,t,n,o){var i="clippingParents"===t?function(e){var t=We(Ue(e)),n=["absolute","fixed"].indexOf(_e(e).position)>=0&&Re(e)?Xe(e):e;return Te(n)?t.filter((function(e){return Te(e)&&Ot(e,n)&&"body"!==De(e)})):[]}(e):[].concat(t),a=[].concat(i,[n]),r=a[0],d=a.reduce((function(t,n){var i=It(e,n,o);return t.top=Oe(i.top,t.top),t.right=$e(i.right,t.right),t.bottom=$e(i.bottom,t.bottom),t.left=Oe(i.left,t.left),t}),It(e,r,o));return d.width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d}function Bt(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Nt(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function qt(e,t){void 0===t&&(t={});var n=t,o=n.placement,i=void 0===o?e.placement:o,a=n.strategy,r=void 0===a?e.strategy:a,d=n.boundary,s=void 0===d?it:d,l=n.rootBoundary,c=void 0===l?at:l,u=n.elementContext,p=void 0===u?rt:u,m=n.altBoundary,b=void 0!==m&&m,f=n.padding,g=void 0===f?0:f,h=Bt("number"!=typeof g?g:Nt(g,tt)),v=p===rt?dt:rt,y=e.rects.popper,w=e.elements[b?v:p],E=Mt(Te(w)?w:w.contextElement||Fe(e.elements.popper),s,c,r),x=Ne(e.elements.reference),L=wt({reference:x,element:y,strategy:"absolute",placement:i}),S=$t(Object.assign({},y,L)),k=p===rt?S:x,C={top:E.top-k.top+h.top,bottom:k.bottom-E.bottom+h.bottom,left:E.left-k.left+h.left,right:k.right-E.right+h.right},T=e.modifiersData.offset;if(p===rt&&T){var R=T[i];Object.keys(C).forEach((function(e){var t=[Ze,Je].indexOf(e)>=0?1:-1,n=[Ye,Je].indexOf(e)>=0?"y":"x";C[e]+=R[n]*t}))}return C}const Dt={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var i=n.mainAxis,a=void 0===i||i,r=n.altAxis,d=void 0===r||r,s=n.fallbackPlacements,l=n.padding,c=n.boundary,u=n.rootBoundary,p=n.altBoundary,m=n.flipVariations,b=void 0===m||m,f=n.allowedAutoPlacements,g=t.options.placement,h=ht(g),v=s||(h===g||!b?[Tt(g)]:function(e){if(ht(e)===et)return[];var t=Tt(e);return[At(e),t,At(t)]}(g)),y=[g].concat(v).reduce((function(e,n){return e.concat(ht(n)===et?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,i=n.boundary,a=n.rootBoundary,r=n.padding,d=n.flipVariations,s=n.allowedAutoPlacements,l=void 0===s?lt:s,c=vt(o),u=c?d?st:st.filter((function(e){return vt(e)===c})):tt,p=u.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=u);var m=p.reduce((function(t,n){return t[n]=qt(e,{placement:n,boundary:i,rootBoundary:a,padding:r})[ht(n)],t}),{});return Object.keys(m).sort((function(e,t){return m[e]-m[t]}))}(t,{placement:n,boundary:c,rootBoundary:u,padding:l,flipVariations:b,allowedAutoPlacements:f}):n)}),[]),w=t.rects.reference,E=t.rects.popper,x=new Map,L=!0,S=y[0],k=0;k=0,O=A?"width":"height",$=qt(t,{placement:C,boundary:c,rootBoundary:u,altBoundary:p,padding:l}),I=A?R?Ze:Qe:R?Je:Ye;w[O]>E[O]&&(I=Tt(I));var M=Tt(I),B=[];if(a&&B.push($[T]<=0),d&&B.push($[I]<=0,$[M]<=0),B.every((function(e){return e}))){S=C,L=!1;break}x.set(C,B)}if(L)for(var N=function(e){var t=y.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},q=b?3:1;q>0;q--){if("break"===N(q))break}t.placement!==S&&(t.modifiersData[o]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ft(e,t,n){return Oe(e,$e(t,n))}const Ht={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name,i=n.mainAxis,a=void 0===i||i,r=n.altAxis,d=void 0!==r&&r,s=n.boundary,l=n.rootBoundary,c=n.altBoundary,u=n.padding,p=n.tether,m=void 0===p||p,b=n.tetherOffset,f=void 0===b?0:b,g=qt(t,{boundary:s,rootBoundary:l,padding:u,altBoundary:c}),h=ht(t.placement),v=vt(t.placement),y=!v,w=yt(h),E="x"===w?"y":"x",x=t.modifiersData.popperOffsets,L=t.rects.reference,S=t.rects.popper,k="function"==typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,C="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(x){if(a){var A,O="y"===w?Ye:Qe,$="y"===w?Je:Ze,I="y"===w?"height":"width",M=x[w],B=M+g[O],N=M-g[$],q=m?-S[I]/2:0,D=v===nt?L[I]:S[I],F=v===nt?-S[I]:-L[I],H=t.elements.arrow,_=m&&H?Ve(H):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},j=P[O],V=P[$],U=Ft(0,L[I],_[I]),z=y?L[I]/2-q-U-j-C.mainAxis:D-U-j-C.mainAxis,W=y?-L[I]/2+q+U+V+C.mainAxis:F+U+V+C.mainAxis,K=t.elements.arrow&&Xe(t.elements.arrow),G=K?"y"===w?K.clientTop||0:K.clientLeft||0:0,X=null!=(A=null==T?void 0:T[w])?A:0,Y=M+W-X,J=Ft(m?$e(B,M+z-X-G):B,M,m?Oe(N,Y):N);x[w]=J,R[w]=J-M}if(d){var Z,Q="x"===w?Ye:Qe,ee="x"===w?Je:Ze,te=x[E],ne="y"===E?"height":"width",oe=te+g[Q],ie=te-g[ee],ae=-1!==[Ye,Qe].indexOf(h),re=null!=(Z=null==T?void 0:T[E])?Z:0,de=ae?oe:te-L[ne]-S[ne]-re+C.altAxis,se=ae?te+L[ne]+S[ne]-re-C.altAxis:ie,le=m&&ae?function(e,t,n){var o=Ft(e,t,n);return o>n?n:o}(de,te,se):Ft(m?de:oe,te,m?se:ie);x[E]=le,R[E]=le-te}t.modifiersData[o]=R}},requiresIfExists:["offset"]};const _t={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,i=e.options,a=n.elements.arrow,r=n.modifiersData.popperOffsets,d=ht(n.placement),s=yt(d),l=[Qe,Ze].indexOf(d)>=0?"height":"width";if(a&&r){var c=function(e,t){return Bt("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Nt(e,tt))}(i.padding,n),u=Ve(a),p="y"===s?Ye:Qe,m="y"===s?Je:Ze,b=n.rects.reference[l]+n.rects.reference[s]-r[s]-n.rects.popper[l],f=r[s]-n.rects.reference[s],g=Xe(a),h=g?"y"===s?g.clientHeight||0:g.clientWidth||0:0,v=b/2-f/2,y=c[p],w=h-u[l]-c[m],E=h/2-u[l]/2+v,x=Ft(y,E,w),L=s;n.modifiersData[o]=((t={})[L]=x,t.centerOffset=x-E,t)}},effect:function(e){var t=e.state,n=e.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!=typeof o||(o=t.elements.popper.querySelector(o)))&&Ot(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Pt(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function jt(e){return[Ye,Ze,Je,Qe].some((function(t){return e[t]>=0}))}var Vt=bt({defaultModifiers:[gt,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=wt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},Lt,St,kt,Dt,Ht,_t,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,r=qt(t,{elementContext:"reference"}),d=qt(t,{altBoundary:!0}),s=Pt(r,o),l=Pt(d,i,a),c=jt(s),u=jt(l);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":u})}}]}),Ut="tippy-content",zt="tippy-backdrop",Wt="tippy-arrow",Kt="tippy-svg-arrow",Gt={passive:!0,capture:!0},Xt=function(){return document.body};function Yt(e,t,n){if(Array.isArray(e)){var o=e[t];return null==o?Array.isArray(n)?n[t]:n:o}return e}function Jt(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Zt(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Qt(e,t){return 0===t?e:function(o){clearTimeout(n),n=setTimeout((function(){e(o)}),t)};var n}function en(e){return[].concat(e)}function tn(e,t){-1===e.indexOf(t)&&e.push(t)}function nn(e){return e.split("-")[0]}function on(e){return[].slice.call(e)}function an(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function rn(){return document.createElement("div")}function dn(e){return["Element","Fragment"].some((function(t){return Jt(e,t)}))}function sn(e){return Jt(e,"MouseEvent")}function ln(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function cn(e){return dn(e)?[e]:function(e){return Jt(e,"NodeList")}(e)?on(e):Array.isArray(e)?e:on(document.querySelectorAll(e))}function un(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function pn(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function mn(e){var t,n=en(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function bn(e,t,n){var o=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[o](t,n)}))}function fn(e,t){for(var n=t;n;){var o;if(e.contains(n))return!0;n=null==n.getRootNode||null==(o=n.getRootNode())?void 0:o.host}return!1}var gn={isTouch:!1},hn=0;function vn(){gn.isTouch||(gn.isTouch=!0,window.performance&&document.addEventListener("mousemove",yn))}function yn(){var e=performance.now();e-hn<20&&(gn.isTouch=!1,document.removeEventListener("mousemove",yn)),hn=e}function wn(){var e=document.activeElement;if(ln(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var En=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var xn={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Ln=Object.assign({appendTo:Xt,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},xn,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Sn=Object.keys(Ln);function kn(e){var t=(e.plugins||[]).reduce((function(t,n){var o,i=n.name,a=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(o=Ln[i])?o:a);return t}),{});return Object.assign({},e,t)}function Cn(e,t){var n=Object.assign({},t,{content:Zt(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(kn(Object.assign({},Ln,{plugins:t}))):Sn).reduce((function(t,n){var o=(e.getAttribute("data-tippy-"+n)||"").trim();if(!o)return t;if("content"===n)t[n]=o;else try{t[n]=JSON.parse(o)}catch(e){t[n]=o}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Ln.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}var Tn=function(){return"innerHTML"};function Rn(e,t){e[Tn()]=t}function An(e){var t=rn();return!0===e?t.className=Wt:(t.className=Kt,dn(e)?t.appendChild(e):Rn(t,e)),t}function On(e,t){dn(t.content)?(Rn(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Rn(e,t.content):e.textContent=t.content)}function $n(e){var t=e.firstElementChild,n=on(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Ut)})),arrow:n.find((function(e){return e.classList.contains(Wt)||e.classList.contains(Kt)})),backdrop:n.find((function(e){return e.classList.contains(zt)}))}}function In(e){var t=rn(),n=rn();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var o=rn();function i(n,o){var i=$n(t),a=i.box,r=i.content,d=i.arrow;o.theme?a.setAttribute("data-theme",o.theme):a.removeAttribute("data-theme"),"string"==typeof o.animation?a.setAttribute("data-animation",o.animation):a.removeAttribute("data-animation"),o.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof o.maxWidth?o.maxWidth+"px":o.maxWidth,o.role?a.setAttribute("role",o.role):a.removeAttribute("role"),n.content===o.content&&n.allowHTML===o.allowHTML||On(r,e.props),o.arrow?d?n.arrow!==o.arrow&&(a.removeChild(d),a.appendChild(An(o.arrow))):a.appendChild(An(o.arrow)):d&&a.removeChild(d)}return o.className=Ut,o.setAttribute("data-state","hidden"),On(o,e.props),t.appendChild(n),n.appendChild(o),i(e.props,e.props),{popper:t,onUpdate:i}}In.$$tippy=!0;var Mn=1,Bn=[],Nn=[];function qn(e,t){var n,o,i,a,r,d,s,l,c=Cn(e,Object.assign({},Ln,kn(an(t)))),u=!1,p=!1,m=!1,b=!1,f=[],g=Qt(K,c.interactiveDebounce),h=Mn++,v=(l=c.plugins).filter((function(e,t){return l.indexOf(e)===t})),y={id:h,reference:e,popper:rn(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(i)},setProps:function(t){0;if(y.state.isDestroyed)return;M("onBeforeUpdate",[y,t]),z();var n=y.props,o=Cn(e,Object.assign({},n,an(t),{ignoreAttributes:!0}));y.props=o,U(),n.interactiveDebounce!==o.interactiveDebounce&&(q(),g=Qt(K,o.interactiveDebounce));n.triggerTarget&&!o.triggerTarget?en(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):o.triggerTarget&&e.removeAttribute("aria-expanded");N(),I(),x&&x(n,o);y.popperInstance&&(J(),Q().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));M("onAfterUpdate",[y,t])},setContent:function(e){y.setProps({content:e})},show:function(){0;var e=y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,o=gn.isTouch&&!y.props.touch,i=Yt(y.props.duration,0,Ln.duration);if(e||t||n||o)return;if(R().hasAttribute("disabled"))return;if(M("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,T()&&(E.style.visibility="visible");I(),_(),y.state.isMounted||(E.style.transition="none");if(T()){var a=O();un([a.box,a.content],0)}d=function(){var e;if(y.state.isVisible&&!b){if(b=!0,E.offsetHeight,E.style.transition=y.props.moveTransition,T()&&y.props.animation){var t=O(),n=t.box,o=t.content;un([n,o],i),pn([n,o],"visible")}B(),N(),tn(Nn,y),null==(e=y.popperInstance)||e.forceUpdate(),M("onMount",[y]),y.props.animation&&T()&&function(e,t){j(e,t)}(i,(function(){y.state.isShown=!0,M("onShown",[y])}))}},function(){var e,t=y.props.appendTo,n=R();e=y.props.interactive&&t===Xt||"parent"===t?n.parentNode:Zt(t,[n]);e.contains(E)||e.appendChild(E);y.state.isMounted=!0,J(),!1}()},hide:function(){0;var e=!y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,o=Yt(y.props.duration,1,Ln.duration);if(e||t||n)return;if(M("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,b=!1,u=!1,T()&&(E.style.visibility="hidden");if(q(),P(),I(!0),T()){var i=O(),a=i.box,r=i.content;y.props.animation&&(un([a,r],o),pn([a,r],"hidden"))}B(),N(),y.props.animation?T()&&function(e,t){j(e,(function(){!y.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&t()}))}(o,y.unmount):y.unmount()},hideWithInteractivity:function(e){0;A().addEventListener("mousemove",g),tn(Bn,g),g(e)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){0;y.state.isVisible&&y.hide();if(!y.state.isMounted)return;Z(),Q().forEach((function(e){e._tippy.unmount()})),E.parentNode&&E.parentNode.removeChild(E);Nn=Nn.filter((function(e){return e!==y})),y.state.isMounted=!1,M("onHidden",[y])},destroy:function(){0;if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),z(),delete e._tippy,y.state.isDestroyed=!0,M("onDestroy",[y])}};if(!c.render)return y;var w=c.render(y),E=w.popper,x=w.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+y.id,y.popper=E,e._tippy=y,E._tippy=y;var L=v.map((function(e){return e.fn(y)})),S=e.hasAttribute("aria-expanded");return U(),N(),I(),M("onCreate",[y]),c.showOnCreate&&ee(),E.addEventListener("mouseenter",(function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()})),E.addEventListener("mouseleave",(function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&A().addEventListener("mousemove",g)})),y;function k(){var e=y.props.touch;return Array.isArray(e)?e:[e,0]}function C(){return"hold"===k()[0]}function T(){var e;return!(null==(e=y.props.render)||!e.$$tippy)}function R(){return s||e}function A(){var e=R().parentNode;return e?mn(e):document}function O(){return $n(E)}function $(e){return y.state.isMounted&&!y.state.isVisible||gn.isTouch||a&&"focus"===a.type?0:Yt(y.props.delay,e?0:1,Ln.delay)}function I(e){void 0===e&&(e=!1),E.style.pointerEvents=y.props.interactive&&!e?"":"none",E.style.zIndex=""+y.props.zIndex}function M(e,t,n){var o;(void 0===n&&(n=!0),L.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(o=y.props)[e].apply(o,t)}function B(){var t=y.props.aria;if(t.content){var n="aria-"+t.content,o=E.id;en(y.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(y.state.isVisible)e.setAttribute(n,t?t+" "+o:o);else{var i=t&&t.replace(o,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function N(){!S&&y.props.aria.expanded&&en(y.props.triggerTarget||e).forEach((function(e){y.props.interactive?e.setAttribute("aria-expanded",y.state.isVisible&&e===R()?"true":"false"):e.removeAttribute("aria-expanded")}))}function q(){A().removeEventListener("mousemove",g),Bn=Bn.filter((function(e){return e!==g}))}function D(t){if(!gn.isTouch||!m&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!y.props.interactive||!fn(E,n)){if(en(y.props.triggerTarget||e).some((function(e){return fn(e,n)}))){if(gn.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else M("onClickOutside",[y,t]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),p=!0,setTimeout((function(){p=!1})),y.state.isMounted||P())}}}function F(){m=!0}function H(){m=!1}function _(){var e=A();e.addEventListener("mousedown",D,!0),e.addEventListener("touchend",D,Gt),e.addEventListener("touchstart",H,Gt),e.addEventListener("touchmove",F,Gt)}function P(){var e=A();e.removeEventListener("mousedown",D,!0),e.removeEventListener("touchend",D,Gt),e.removeEventListener("touchstart",H,Gt),e.removeEventListener("touchmove",F,Gt)}function j(e,t){var n=O().box;function o(e){e.target===n&&(bn(n,"remove",o),t())}if(0===e)return t();bn(n,"remove",r),bn(n,"add",o),r=o}function V(t,n,o){void 0===o&&(o=!1),en(y.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,o),f.push({node:e,eventType:t,handler:n,options:o})}))}function U(){var e;C()&&(V("touchstart",W,{passive:!0}),V("touchend",G,{passive:!0})),(e=y.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(V(e,W),e){case"mouseenter":V("mouseleave",G);break;case"focus":V(En?"focusout":"blur",X);break;case"focusin":V("focusout",X)}}))}function z(){f.forEach((function(e){var t=e.node,n=e.eventType,o=e.handler,i=e.options;t.removeEventListener(n,o,i)})),f=[]}function W(e){var t,n=!1;if(y.state.isEnabled&&!Y(e)&&!p){var o="focus"===(null==(t=a)?void 0:t.type);a=e,s=e.currentTarget,N(),!y.state.isVisible&&sn(e)&&Bn.forEach((function(t){return t(e)})),"click"===e.type&&(y.props.trigger.indexOf("mouseenter")<0||u)&&!1!==y.props.hideOnClick&&y.state.isVisible?n=!0:ee(e),"click"===e.type&&(u=!n),n&&!o&&te(e)}}function K(e){var t=e.target,n=R().contains(t)||E.contains(t);if("mousemove"!==e.type||!n){var o=Q().concat(E).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean);(function(e,t){var n=t.clientX,o=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,a=e.props.interactiveBorder,r=nn(i.placement),d=i.modifiersData.offset;if(!d)return!0;var s="bottom"===r?d.top.y:0,l="top"===r?d.bottom.y:0,c="right"===r?d.left.x:0,u="left"===r?d.right.x:0,p=t.top-o+s>a,m=o-t.bottom-l>a,b=t.left-n+c>a,f=n-t.right-u>a;return p||m||b||f}))})(o,e)&&(q(),te(e))}}function G(e){Y(e)||y.props.trigger.indexOf("click")>=0&&u||(y.props.interactive?y.hideWithInteractivity(e):te(e))}function X(e){y.props.trigger.indexOf("focusin")<0&&e.target!==R()||y.props.interactive&&e.relatedTarget&&E.contains(e.relatedTarget)||te(e)}function Y(e){return!!gn.isTouch&&C()!==e.type.indexOf("touch")>=0}function J(){Z();var t=y.props,n=t.popperOptions,o=t.placement,i=t.offset,a=t.getReferenceClientRect,r=t.moveTransition,s=T()?$n(E).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||R()}:e,c={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(T()){var n=O().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},u=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},c];T()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),y.popperInstance=Vt(l,E,Object.assign({},n,{placement:o,onFirstUpdate:d,modifiers:u}))}function Z(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Q(){return on(E.querySelectorAll("[data-tippy-root]"))}function ee(e){y.clearDelayTimeouts(),e&&M("onTrigger",[y,e]),_();var t=$(!0),o=k(),i=o[0],a=o[1];gn.isTouch&&"hold"===i&&a&&(t=a),t?n=setTimeout((function(){y.show()}),t):y.show()}function te(e){if(y.clearDelayTimeouts(),M("onUntrigger",[y,e]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&u)){var t=$(!1);t?o=setTimeout((function(){y.state.isVisible&&y.hide()}),t):i=requestAnimationFrame((function(){y.hide()}))}}else P()}}function Dn(e,t){void 0===t&&(t={});var n=Ln.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",vn,Gt),window.addEventListener("blur",wn);var o=Object.assign({},t,{plugins:n}),i=cn(e).reduce((function(e,t){var n=t&&qn(t,o);return n&&e.push(n),e}),[]);return dn(e)?i[0]:i}Dn.defaultProps=Ln,Dn.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Ln[t]=e[t]}))},Dn.currentInput=gn;Object.assign({},St,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});Dn.setDefaultProps({render:In});const Fn=Dn;function Hn(e="",t=""){const n=document.querySelector("#mdp-readabler-voice-navigation-input");n&&(n.value=e,n.placeholder=t,window.mdpReadablerSpeechRecognitionTimestamp=Date.now())}function _n(e=""){const t=document.querySelector("#mdp-readabler-voice-navigation-history");t&&(t.value=e)}class Pn{constructor(){if("off"===window.mdpReadablerOptions.voiceNavigationVoiceGraph)return;let e=!1;try{e=window.navigator.mediaDevices.getUserMedia({audio:!0,video:!1})}catch(e){return void console.warn("Your browser does not have MediaStream support")}e.then((function(e){let t=function(){let e,t=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.msAudioContext;try{return e=new t,e}catch(e){return console.warn("Not support AudioContext"),console.warn(e),!1}}(),n=t.createMediaStreamSource(e),o=t.createAnalyser();n.connect(o),function(e){const t=document.querySelector("#mdp-readabler-voice-visualization");if(!t)return;let n=2,o=6,i=t.width/(n+o),a=t.getContext("2d");const r=a.createLinearGradient(0,0,0,t.height);function d(){let r=new Uint8Array(e.frequencyBinCount);e.getByteFrequencyData(r);let s=Math.round(r.length/i);a.clearRect(0,0,t.width,t.height);for(let e=0;e{e.getTracks().forEach((function(e){e.stop()}))}))})),e.catch((function(e){console.warn("Your browser does not have MediaStream support"),console.warn(e)}))}}const jn=new SpeechSynthesisUtterance,Vn=window.mdpReadablerOptions;function Un(e){"on"===Vn.voiceNavigationFeedback&&async function(e){const t=window.speechSynthesis;Wn();try{if(0===t.getVoices().length)return new Promise(((n,o)=>{t.onvoiceschanged=()=>{n();try{!function(){const e=window.speechSynthesis,t=document.documentElement.lang,n=e.getVoices().find((e=>e.lang===t));n?(jn.voice=n,jn.lang=document.documentElement.lang):(jn.voice=e.getVoices().find((e=>e.lang.startsWith(t))),jn.lang=jn.voice.lang);jn.voice||(jn.voice=e.getVoices().find((e=>e.lang.startsWith("en-GB"))),jn.lang=jn.voice.lang)}(),zn(e)}catch(e){return console.warn("SpeechSynthesisUtterance not supported in your browser"),console.warn(e),!1}}}));zn(e)}catch(e){return console.warn("SpeechSynthesisUtterance not supported in your browser"),console.warn(e),!1}}(e).then()}function zn(e){const t=window.speechSynthesis;Wn(),jn.text=e,t.speak(jn)}function Wn(){window.speechSynthesis.cancel()}const Kn=window.mdpReadablerOptions;class Gn{constructor(){const e=this.setRecognitionProperties();return e?(window.mdpReadablerSpeechRecognition=!1,window.ReadablerVoiceRecognition=e,this.addRecognitionEvents(e),!0):(console.warn("Speech recognition is not supported in your browser"),!1)}setRecognitionProperties(){let e=null;if("SpeechRecognition"in window)e=new SpeechRecognition;else{if(!("webkitSpeechRecognition"in window))return console.warn("Recognition is not supported"),e;e=new webkitSpeechRecognition}return e.lang=this.getPageLang(),e.continuous=!0,e.interimResults="on"===Kn.voiceNavigationInterimResults,e.maxAlternatives=0,e}addRecognitionEvents(e){window.mdpReadablerSpeechRecognitionTimestamp=Date.now(),e.addEventListener("start",this.eventRecognitionStart),e.addEventListener("end",this.eventRecognitionEnd),e.addEventListener("result",(e=>{if(Date.now()-window.mdpReadablerSpeechRecognitionTimestamp<2500)return;const{resultIndex:t}=e;let{transcript:n}=e.results[t][0];if(""===n)return;n=n.trim();const o=document.querySelector("#mdp-readabler-voice-navigation-input");o&&(o.value=n);let i=this.recognizeCommand(n);if(!i)return;window.mdpReadablerSpeechRecognitionTimestamp=Date.now();const a=new CustomEvent("ReadablerVoiceNavigationAction",{detail:{command:n,commandGroup:i.commandKey,number:i.number??!1}});window.dispatchEvent(a)})),e.addEventListener("error",this.eventRecognitionError)}static setBodyClass(e){document.body.classList.forEach((e=>{e.includes("mdp-readabler-recognition-")&&document.body.classList.remove(e)})),document.body.classList.add(`mdp-readabler-recognition-${e}`)}static manageRecognition(e=!1){if(!window.ReadablerVoiceRecognition)return;const t=window.mdpReadablerSpeechRecognition??!1;e&&!t?(window.ReadablerVoiceRecognition.start(),Hn("",Kn.translation.voiceRecognitionStart),_n(""),new Pn):(window.ReadablerVoiceRecognition.stop(),Hn("",Kn.translation.voiceRecognitionEnd),window.dispatchEvent(new Event("ReadablerVoiceVisualizationStop")))}eventRecognitionStart(){window.mdpReadablerSpeechRecognition=!0,Un(Kn.voiceNavigationFeedbackStart[Math.floor(Math.random()*Kn.voiceNavigationFeedbackStart.length)]),Gn.setBodyClass("running");const e=document.querySelector("#mdp-readabler-voice-navigation-record-button");e&&e.removeAttribute("disabled"),Hn("",Kn.translation.voiceRecognitionStart);const t=new CustomEvent("ReadablerRecognitionStart");window.dispatchEvent(t)}eventRecognitionEnd(){if(window.mdpReadablerSpeechRecognition=!1,Un(Kn.voiceNavigationFeedbackEnd[Math.floor(Math.random()*Kn.voiceNavigationFeedbackEnd.length)]),document.body.classList.contains("mdp-readabler-recognition-error"))return;Gn.setBodyClass("paused"),Hn("",Kn.translation.voiceRecognitionEnd),window.dispatchEvent(new Event("ReadablerVoiceVisualizationStop"));const e=new CustomEvent("ReadablerRecognitionEnd");window.dispatchEvent(e)}eventRecognitionError(e){window.mdpReadablerSpeechRecognition=!1;const{translation:t,voiceNavigationRerun:n}=Kn;if(Gn.setBodyClass("error"),"no-speech"===e.error){const e=t.voiceRecognitionErrorNoVoice.split(". ");Un(t.voiceRecognitionErrorNoVoice),Hn("",e[0]),_n(e[1]??""),"on"===n&&setTimeout((()=>{window.ReadablerVoiceRecognition.start()}),1e3)}else if("network"===e.error){const e=t.voiceRecognitionErrorNoNetwork.split(". ");Un(t.voiceRecognitionErrorNoNetwork),Hn("",e[0]),_n(e[1]??""),"on"===n&&setTimeout((()=>{window.ReadablerVoiceRecognition.start()}),1e3)}else if("not-allowed"===e.error){const e=t.voiceRecognitionErrorNotAllowed.split(". ");Un(t.voiceRecognitionErrorNotAllowed),Hn("",e[0]),_n(e[1]??"")}else Un(t.voiceRecognitionErrorUnknown),Hn("",t.voiceRecognitionErrorUnknown);console.warn(`Speech recognition error: ${e.error}`),window.dispatchEvent(new Event("ReadablerVoiceVisualizationStop"));const o=new CustomEvent("ReadablerRecognitionError",{detail:{message:e.error}});window.dispatchEvent(o)}recognizeCommand(e){let t=!1;e=e.toLowerCase().trim();const n=Gn.recognizeNumberCommand(e);if(n)return{commandKey:"number",number:n};for(const[n,o]of Object.entries(Kn.voiceNavigation))if("number"!==n&&(o.forEach((o=>{let i=Kn.voiceNavigationAliases[o]??o;i.toLowerCase().trim()===e&&(t=n),e.includes(i.toLowerCase().trim())&&(t=n)})),t))break;return t?{commandKey:t}:t}static recognizeNumberCommand(e){let t=0;const n=Kn.voiceNavigation.number,o=Kn.voiceNavigationAliases,i=Kn.translation.voiceRecognitionNumbers;if(!n)return!1;if(/\d/.test(e)){const t=e.match(/\d+/)[0];if(e===t)return parseInt(t);let i=!1;if(n.forEach((t=>{i||o[t]&&e.includes(o[t].toLowerCase().trim())&&(i=!0)})),i)return t}return n.forEach((n=>{e.includes(n)&&i.forEach(((n,o)=>{e.includes(n)&&(t=o)}))})),t||!1}getPageLang(){const e=document.querySelector("html");if(!e)return!1;return(e.getAttribute("lang")??"en-US").split("-")[0]}}function Xn(e){if(!e||!e.parentNode||e.parentNode===window||e.parentNode===document)return!0;const t=window.getComputedStyle(e.parentNode);return"none"!==t.display&&"hidden"!==t.visibility&&"0"!==t.opacity&&Xn(e.parentNode)}class Yn{constructor(){window.addEventListener("ReadablerVoiceNavigationAction",(e=>{const{voiceNavigationAliases:t,translation:n,voiceNavigationFeedbackOk:o}=window.mdpReadablerOptions;let{command:i,commandGroup:a}=e.detail;if(i){i=i.toLowerCase().trim();try{Un(o[Math.floor(Math.random()*o.length)]);Hn(t[i.replaceAll(" ","_")]??i,n.voiceRecognitionStart),Yn[a](e),this.updateHistory(i)}catch(e){console.warn(`Readabler: Command ${i} not found.`)}}}))}updateHistory(e){const t=document.querySelector("#mdp-readabler-voice-navigation-input"),n=document.querySelector("#mdp-readabler-voice-navigation-history");t&&n&&(_n(""),n.classList.remove("mdp-readabler-voice-navigation-memorized"),t.classList.add("mdp-readabler-voice-navigation-recognized"),setTimeout((()=>{t.classList.remove("mdp-readabler-voice-navigation-recognized"),n.classList.add("mdp-readabler-voice-navigation-memorized"),_n(t.value),t.value=""}),1500))}static help(){const e=new CustomEvent("ReadablerVoiceCommandsAccordion",{detail:"expand"});window.dispatchEvent(e)}static hide_help(){const e=new CustomEvent("ReadablerVoiceCommandsAccordion",{detail:"collapse"});window.dispatchEvent(e)}static scroll_down(){const e=window.mdpReadablerOptions??{};window.scrollBy({top:e.scrollDownValue??200,behavior:"smooth"})}static down(){const e=window.mdpReadablerOptions??{};window.scrollBy({top:e.scrollDownValue??200,behavior:"smooth"})}static scroll_up(){const e=window.mdpReadablerOptions??{};window.scrollBy({top:e.scrollUpValue??-200,behavior:"smooth"})}static up(){const e=window.mdpReadablerOptions??{};window.scrollBy({top:e.scrollUpValue??-200,behavior:"smooth"})}static scroll_right(){const e=window.mdpReadablerOptions??{};window.scrollBy({left:e.scrollRightValue??200,behavior:"smooth"})}static scroll_left(){const e=window.mdpReadablerOptions??{};window.scrollBy({left:e.scrollLeftValue??-200,behavior:"smooth"})}static go_to_top(){window.scrollTo({top:0,behavior:"smooth"})}static go_to_bottom(){window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})}static tab(){const e=document.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),t=Array.from(e).filter((e=>!e.disabled&&!e.hidden)),n=document.activeElement;if(n){t[(Array.from(t).indexOf(n)+1)%t.length].focus()}else t[0].focus()}static tab_back(){const e=document.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),t=Array.from(e).filter((e=>!e.disabled&&!e.hidden)),n=document.activeElement;if(n){t[(Array.from(t).indexOf(n)-1)%t.length].focus()}else t[0].focus()}static show_numbers(){const e=document.querySelectorAll("a, button, input, select, textarea");if(!e)return;let t=1;e.forEach((e=>{e.closest("#mdp-readabler-popup-box")||e.closest("#mdp-readabler-sidebar")||e.closest("#mdp-readabler-keyboard-box")||e.closest("#mdp-readabler-voice-navigation")||"none"!==e.style.display&&"hidden"!==e.style.visibility&&"0"!==e.style.opacity&&"none"!==e.style.pointerEvents&&Xn(e)&&(e.setAttribute("data-readabler-number",t.toString()),e.setAttribute("data-tippy-content",t.toString()),t++)})),Fn("[data-readabler-number]",{showOnCreate:!0,hideOnClick:!1,trigger:"manual",interactive:!1,arrow:!0,onCreate(e){e.popper.classList.add("mdp-readabler-voice-navigation-number")}})}static number(e){if(!e.detail.number)return;const t=document.querySelector(`[data-readabler-number="${e.detail.number}"]`);t&&t.click()}static hide_numbers(){const e=document.querySelectorAll("[data-tippy-root]");e&&e.forEach((e=>{e._tippy.hide()}))}static clear_input(){const e=document.activeElement;"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName||(e.value="")}static enter(){const e=document.activeElement;"FORM"===e.tagName?e.submit():e.click()}static reload(){window.location.reload()}static stop(){Gn.manageRecognition(!1)}static exit(){let e=document.querySelector("#mdp-readabler-action-voice-navigation");e&&e.click()}}function Jn(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/([-.])/g,"_").toLowerCase()}class Zn{constructor(e){this.options=e}init(){const{profileEpilepsy:e,profileVisuallyImpaired:t,profileCognitiveDisability:n,profileAdhdFriendly:o,profileBlindUsers:i}=this.options;if(e||t||n||o||i){const e=document.querySelectorAll("#mdp-readabler-accessibility-profiles-box .mdp-readabler-accessibility-profile-item");e.forEach((e=>e.addEventListener("click",y(this.toggleProfile,100)))),e.forEach((e=>e.addEventListener("keydown",y(this.toggleProfile,100))))}}toggleProfile(t){if("keydown"===t.type&&13!==t.keyCode)return;let n=t.target.classList&&t.target.classList.contains("mdp-readabler-accessibility-profile-item")?t.target:t.target.closest(".mdp-readabler-accessibility-profile-item");if(!n)return;let o=n.id.replace("mdp-readabler-accessibility-","");n.classList.contains("mdp-active")?Zn.disable(e(o)):Zn.enable(e(o))}static profileActions(e){return{profileEpilepsy:["lowSaturation","stopAnimations"],profileVisuallyImpaired:["readableFonts","highSaturation"],profileCognitiveDisability:["highlightTitles","highlightLinks","stopAnimations"],profileAdhdFriendly:["highSaturation","stopAnimations","readingMask"],profileBlindUsers:["readableFont","virtualKeyboard","textToSpeech","keyboardNavigation"]}[e]??[]}static enable(e){Zn.disableOthers(e),Zn.activate(e,!0),document.body.classList.add(`mdp-readabler-${G(e)}`),Zn.profileActions(e).forEach((e=>{window.dispatchEvent(new CustomEvent("readabler-headless",{detail:{action:e,value:!0}}))})),window.dispatchEvent(new CustomEvent("ReadablerAnalyticsEvent",{detail:{category:"profile",id:G(e),value:1,timestamp:(new Date).getTime()}}))}static disable(e){Zn.activate(e,!1),document.body.classList.remove(`mdp-readabler-${G(e)}`),Zn.profileActions(e).forEach((e=>{window.dispatchEvent(new CustomEvent("readabler-headless",{detail:{action:e,value:!1}}))})),window.dispatchEvent(new CustomEvent("ReadablerAnalyticsEvent",{detail:{category:"profile",id:G(e),value:0,timestamp:(new Date).getTime()}}))}static activeProfile(){return["profileEpilepsy","profileVisuallyImpaired","profileCognitiveDisability","profileAdhdFriendly","profileBlindUsers"].find((e=>fe.get(e)))}static disableOthers(e=""){const t=Zn.activeProfile();t&&t!==e&&Zn.disable(t)}static activate(e,t){const n=document.querySelector(`#mdp-readabler-accessibility-${G(e)}`);if(n){const e=n.querySelector('input[type="checkbox"]');e&&(t?(n.classList.add("mdp-active"),e.checked=!0):(n.classList.remove("mdp-active"),e.checked=!1))}window.dispatchEvent(new CustomEvent("readabler-ai-popup",{detail:{action:"visualInterface",type:"toggle",mode:G(e).replace("profile-",""),toggleState:t}})),fe.save(e,t)}}let Qn={init:function(){let e=document.getElementById("mdp-readabler-hide-btn");e&&e.addEventListener("click",Qn.hide)},hide:function(e){e.preventDefault(),Qn.enable()},enable(){window.confirm(window.mdpReadablerOptions.HIDE_ACCESSIBILITY_INTERFACE)&&(Qn.writeCookie("mdp-readabler-hide","1",365),window.location.reload())},disable(){Qn.writeCookie("mdp-readabler-hide","",-1)},writeCookie:function(e,t,n){let o=new Date;return n=n||365,o.setTime(+o+864e5*n),window.document.cookie=e+"="+t+"; expires="+o.toGMTString()+"; path=/",t}};const eo=function(){let e=null,t=!1;function n(e,t){const n=document.createElement("button");return n.classList.add("mdp-readabler-tts-button"),n.innerHTML=e,n.onclick=t,"mdp-readabler-tts-preloader"===n.id?n.style.transition="none":(n.onmouseover=function(){this.style.transform="scale(1.2)"},n.onmouseout=function(){this.style.transform="scale(1)"}),n}function o(){e&&(e.onended=null,e.stop(0))}return function(){const i={gspeak:!0,disable:!1},a={icon:'',preloader_icon:'',stop_icon:''};let r="",d="",s="",l={},c=52,u=0,p=0;function m(){return new n(a.icon,(function(){if(this.disabled)return;if(document.querySelector(".mdp-readabler-tts.stop"))return o(),void b();const t=this;t.disabled=!0,function(){const e=document.querySelector(".mdp-readabler-tts");if(!e)return;const t=document.querySelector(".mdp-readabler-tts .selection__icon"),n=document.createElement("div");n.innerHTML=a.preloader_icon,t.parentNode.replaceChild(n,t),e.classList.remove("stop")}();let n=new XMLHttpRequest,i=window.mdpReadablerOptions;n.open("POST",i.textToSpeechAjaxUrl,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.onload=function(){if(t.disabled=!1,this.status>=200&&this.status<400){if(!no.AudioContext)return void console.warn("Error with creating AudioContext.");no.mdp_readabler_context.decodeAudioData(this.response,(function(t){const n=no.mdp_readabler_context.createBufferSource();n.buffer=t,o(),e=n,n.connect(no.mdp_readabler_context.destination),n.onended=b,n.start(0),function(){const e=document.querySelector(".mdp-readabler-tts .selection__icon"),t=document.createElement("div");t.innerHTML=a.stop_icon,e.parentNode.replaceChild(t,e);const n=document.querySelector(".mdp-readabler-tts");n.classList.remove("loading"),n.classList.add("stop")}()}),(function(e){console.warn("Error with decoding audio data"+e.err)}))}else console.error(this.response)},n.onerror=function(){t.disabled=!1,console.error("Connection error.")},n.responseType="arraybuffer",n.send(`action=readablergspeak&nonce=${i.textToSpeechNonce}&text=${encodeURIComponent(s)}&lang=${document.documentElement.lang}`)}))}function b(){document.querySelector(".mdp-readabler-tts.stop")&&document.querySelector(".mdp-readabler-tts").remove(),window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}function f(){const e=r.getRangeAt(0).getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollTop||document.body.scrollTop;p=e.left+(e.width-c*l.length)/2,u=t?e.bottom+n+10:e.top+n-c-10}function g(){if(document.querySelector(".mdp-readabler-tts")){f();let e=document.querySelector(".mdp-readabler-tts");e.style.top=u+"px",e.style.left=p+"px"}}function h(){l=function(){const e=[{feature:"gspeak",call:m()}],t=document.createElement("div");let n=0;return e.forEach((function(e){i[e.feature]&&(t.appendChild(e.call),n++)})),{icons:t,length:n}}(),f();const e=document.createElement("div");e.className="mdp-readabler-tts",e.style="top:"+u+"px;left:"+p+"px;",e.appendChild(l.icons);const n=document.createElement("div");n.classList.add("mdp-readabler-tts-arrow"),t&&n.classList.add("mdp-readabler-tts-arrow-mobile"),n.style="left:"+(c*l.length/2-8)+"px;",i.disable||e.appendChild(n),document.body.appendChild(e)}function v(){function e(){return null!==no.readabler&&!!window.getSelection().toString()}function n(){let e;if(document.selection&&document.selection.createRange)return e=document.selection.createRange(),e.htmlText;if(window.getSelection){const t=window.getSelection();if(t.rangeCount>0){e=t.getRangeAt(0);const n=e.cloneContents(),o=document.createElement("div");return o.appendChild(n),o.innerHTML}return""}return""}function o(){let e;if(t)return window.getSelection?e=window.getSelection():document.getSelection?e=document.getSelection():document.selection&&(e=document.selection.createRange().text),e;if(window.getSelection&&(e=window.getSelection()).modify){if(e=window.getSelection(),!e.isCollapsed){const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;t.detach();const o=e.focusNode,i=e.focusOffset;let a;e.collapse(e.anchorNode,e.anchorOffset),a=n?["backward","forward"]:["forward","backward"],e.modify("move",a[0],"character"),e.modify("move",a[1],"word"),e.extend(o,i),e.modify("extend",a[1],"character"),e.modify("extend",a[0],"word")}}else if((e=document.selection)&&"Control"!==e.type){const t=e.createRange();if(t.text){for(t.expand("word");/\s$/.test(t.text);)t.moveEnd("character",-1);t.select()}}return e}const i=function(){setTimeout((function(){document.querySelector(".mdp-readabler-tts")?e()?(r=o(),d=n(),s=d,g(),(document.querySelector(".mdp-readabler-tts.stop")||document.querySelector(".mdp-readabler-tts.loading"))&&function(){const e=document.querySelector(".mdp-readabler-tts .selection__icon"),t=document.createElement("div");t.innerHTML=a.icon,e.parentNode.replaceChild(t,e);const n=document.querySelector(".mdp-readabler-tts");n.classList.remove("stop"),n.classList.remove("loading")}()):t||document.querySelector(".mdp-readabler-tts.stop")||document.querySelector(".mdp-readabler-tts.loading")||document.querySelector(".mdp-readabler-tts").remove():e()&&(r=o(),d=n(),s=d,h())}),10)};window.addEventListener("mouseup",i,!0),window.addEventListener("touchend",i,!1),window.addEventListener("touchcancel",i,!1),window.addEventListener("selectionchange",i,!1),window.addEventListener("resize",g,!1),window.addEventListener("touchstart",(function e(){t=!0,document.addEventListener("selectionchange",i,!0),window.removeEventListener("touchstart",e,!1)}),!1)}return{config:function(e){return i.gspeak=void 0===e.gspeak?i.gspeak:e.gspeak,i.disable=void 0===e.disable?i.disable:e.disable,this},init:function(){return v(),this}}}}();let to=window.mdpReadablerOptions,no={readabler:null,AudioContext:window.AudioContext||window.webkitAudioContext||!1,mdp_readabler_context:null,init:function(){if(document.querySelectorAll("#mdp-readabler-action-text-to-speech").length<1)return;document.querySelector("#mdp-readabler-action-text-to-speech").addEventListener("ReadablerToggleBoxChanged",no.textToSpeech)},webAudioTouchUnlock:function(e){null===no.mdp_readabler_context&&!1!==e.isTrusted&&(no.mdp_readabler_context=new AudioContext,no.mdp_readabler_context.resume())},textToSpeech:function(e){e.target.classList.contains("mdp-active")?no.enable("text-to-speech"):no.disable("text-to-speech")},voiceGuide:function(e){if(e.length<1)return;if(null===e.match(/^([\w\-]+)/g))return;let t=new XMLHttpRequest,n=window.mdpReadablerOptions;t.open("POST",n.textToSpeechAjaxUrl,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.onload=function(){if(this.status>=200&&this.status<400){if(!no.AudioContext)return void console.warn("Error with creating AudioContext.");if(this.response.byteLength<1)return void console.warn(`Error with creating AudioContext. WordPress response with audio buffer size ${this.response.byteLength}`);try{no.mdp_readabler_context.decodeAudioData(this.response,(function(e){const t=no.mdp_readabler_context.createBufferSource();t.buffer=e,t.connect(no.mdp_readabler_context.destination),t.start(0)}),(e=>console.warn("Error with decoding audio data"+e.err)))}catch(e){console.warn("Unable to decode and play audio data")}}else console.error(this.response)},t.onerror=function(){console.error("Connection error.")},t.responseType="arraybuffer",t.send(`action=readablergspeak&nonce=${n.textToSpeechNonce}&text=${e}`)},highlightParagraph:function(){to.highlightP&&document.querySelectorAll("p").forEach((function(e){e.addEventListener("click",(function(t){let n=document.createRange(),o=window.getSelection();n.selectNodeContents(e),o.removeAllRanges(),o.addRange(n)}))}))},readAlt:function(){to.readAlt&&document.querySelectorAll("img").forEach((function(e){!e.alt||e.alt.length<1||(e.classList.add("mdp-readabler-tts-read-alt"),e.addEventListener("click",(function(){!e.alt||e.alt.length<1||no.voiceGuide(e.alt)})))}))},enable(e){O(e,!0),no.readabler=new eo,no.readabler.init(),document.body.addEventListener("click",no.webAudioTouchUnlock,!1),no.voiceGuide(to.translation?.voiceGuide??"Highlight a piece of text and click Play to listen"),no.highlightParagraph(),no.readAlt()},disable(e){O(e,!1),no.readabler=null,document.body.removeEventListener("click",no.webAudioTouchUnlock,!1)}},oo={p:"mdp-readabler",init:function(){document.querySelector("#mdp-readabler-action-hide-emoji").addEventListener("ReadablerToggleBoxChanged",oo.hideEmoji)},hideEmoji:function(e){e.target.classList.contains("mdp-active")?oo.enable("hide-emoji"):oo.disable("hide-emoji")},removeEmojis:e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|[\uD83C-\uD83E][\uDC00-\uDFFF])/g,'$&'),enable(e){O(e,!0),document.body.classList.add(`${this.p}-${e}`);const t=/([\u2700-\u27BF]|[\u2B50]|[\uE000-\uF8FF]|[\uD83C-\uD83E][\uDC00-\uDFFF])/g;document.querySelectorAll("p, h1, h2, h3, h4, h5, h6, span, li, td, th, i").forEach((e=>{e.closest('[class^="mdp-readabler"]')||e.closest('[id^="mdp-readabler"]')||"SCRIPT"!==e.tagName&&"STYLE"!==e.tagName&&(e.innerHTML=e.innerHTML.replace(t,(t=>e.innerHTML.includes(`${t}`)?t:`${t}`)))}))},disable(e){O(e,!1),document.body.classList.remove(`${this.p}-${e}`)}};const io=["contentScaling","textMagnifier","readableFont","dyslexiaFont","highlightTitles","highlightLinks","fontSizing","lineHeight","letterSpacing","alignLeft","alignCenter","alignRight","darkContrast","lightContrast","monochrome","highSaturation","highContrast","lowSaturation","textColors","titleColors","backgroundColors","muteSounds","hideImages","hideEmoji","virtualKeyboard","readingGuide","stopAnimations","readingMask","highlightHover","highlightFocus","bigBlackCursor","bigWhiteCursor","cognitiveReading","textToSpeech","keyboardNavigation","profileEpilepsy","profileVisuallyImpaired","profileCognitiveDisability","profileAdhdFriendly","profileBlindUsers","epilepsy","visuallyImpaired","cognitiveDisability","adhdFriendly","blindUsers","reset","resetReload","hideForever"];let ao={init:function(){if(null===document.getElementById("mdp-readabler-statement-btn"))return;document.getElementById("mdp-readabler-statement-btn").addEventListener("click",ao.show),document.getElementById("mdp-readabler-close-statement-btn").addEventListener("click",ao.close)},show:function(e){e.preventDefault(),document.getElementById("mdp-readabler-accessibility-statement-box").classList.add("mdp-open")},close:function(e){e.preventDefault(),document.getElementById("mdp-readabler-accessibility-statement-box").classList.remove("mdp-open")}},ro={init:function(){let e=document.getElementById("mdp-readabler-reset-btn");e&&e.addEventListener("click",ro.reset)},reset:function(e){e.preventDefault(),fe.reset(),location.reload()}},so={options:window.mdpReadablerOptions??[],clearResultsBtn:document.querySelector("#mdp-readabler-online-dictionary-search-close"),searchInput:document.getElementById("mdp-readabler-online-dictionary-search"),searchResultsUL:document.getElementById("mdp-readabler-online-dictionary-search-results"),init:function(){this.searchInput&&(this.searchInput.addEventListener("input",(e=>{y(this.searchQuery(e),800)})),this.clearResultsBtn.addEventListener("click",this.clearSearchResults))},getLang:function(){if("auto"===this.options.language){const e=document.querySelector("html");return e.getAttribute("lang")?e.getAttribute("lang").split("-",1)[0]:"en"}return this.options.language},searchQuery:function(e){let t=e.target.value;if(0===t.trim().length)return;if(t.trim().length<3)return void(this.searchResultsUL.innerHTML="");let n=encodeURI(t),o=`https://${this.getLang()}.wikipedia.org/w/api.php?action=query&format=json&utf8=&explaintext=&exlimit=3&generator=prefixsearch&prop=pageprops|extracts|extracts|description&redirects=&gpssearch=${n}&gpslimit=3&origin=*`;return fetch(o).then((e=>e.json())).then((e=>{this.searchResultsUL.innerHTML="";for(let t in e.query.pages)e.query.pages.hasOwnProperty(t)&&this.addResultToList(e.query.pages[t]);this.clearResultsBtn.style.display="block"})).catch((e=>{console.warn(e)})),!0},addResultToList:function(e){const t=void 0!==e.description?e.description:"";let n=document.createElement("li");n.innerHTML=`\n
${e.title}
\n

${t}

\n ${this.options.LEARN_MORE_IN_WIKIPEDIA}\n `,this.searchResultsUL.appendChild(n)},clearSearchResults:function(){so.searchInput.setAttribute("value",""),so.searchResultsUL.innerHTML="",so.clearResultsBtn.style.display="none"}},lo={init:function(){document.querySelector("#mdp-readabler-action-readable-font").addEventListener("ReadablerToggleBoxChanged",lo.readableFont)},readableFont:function(e){e.target.classList.contains("mdp-active")?(lo.disableOthers(),document.body.classList.add("mdp-readabler-readable-font")):document.body.classList.remove("mdp-readabler-readable-font")},disableOthers:function(){let e=document.getElementById("mdp-readabler-action-dyslexia-font");e&&e.classList.contains("mdp-active")&&e.click()}},co={alignCenterStyle:document.createElement("style"),init:function(){document.querySelector("#mdp-readabler-action-align-center").addEventListener("ReadablerToggleBoxChanged",co.alignCenter)},alignCenter:function(e){e.target.classList.contains("mdp-active")?(co.disableOthers(),document.body.classList.add("mdp-readabler-align-center"),co.alignCenterStyle.innerHTML="\n /*noinspection CssUnusedSymbol*/\n body.mdp-readabler-align-center,\n body.mdp-readabler-align-center h1,\n body.mdp-readabler-align-center h1 span,\n body.mdp-readabler-align-center h2,\n body.mdp-readabler-align-center h2 span,\n body.mdp-readabler-align-center h3,\n body.mdp-readabler-align-center h3 span,\n body.mdp-readabler-align-center h4,\n body.mdp-readabler-align-center h4 span,\n body.mdp-readabler-align-center h5,\n body.mdp-readabler-align-center h5 span,\n body.mdp-readabler-align-center h6,\n body.mdp-readabler-align-center h6 span,\n\n body.mdp-readabler-align-center p,\n body.mdp-readabler-align-center li,\n body.mdp-readabler-align-center label,\n body.mdp-readabler-align-center input,\n body.mdp-readabler-align-center select,\n body.mdp-readabler-align-center textarea,\n body.mdp-readabler-align-center legend,\n body.mdp-readabler-align-center code,\n body.mdp-readabler-align-center pre,\n body.mdp-readabler-align-center dd,\n body.mdp-readabler-align-center dt,\n body.mdp-readabler-align-center span,\n body.mdp-readabler-align-center blockquote {\n text-align: center !important;\n }\n ",document.head.appendChild(co.alignCenterStyle)):document.body.classList.remove("mdp-readabler-align-center")},disableOthers:function(){let e=document.getElementById("mdp-readabler-action-align-left");null!==e&&e.classList.contains("mdp-active")&&e.click();let t=document.getElementById("mdp-readabler-action-align-right");null!==t&&t.classList.contains("mdp-active")&&t.click()}},uo={alignLeftStyle:document.createElement("style"),init:function(){document.querySelector("#mdp-readabler-action-align-left").addEventListener("ReadablerToggleBoxChanged",uo.alignLeft)},alignLeft:function(e){e.target.classList.contains("mdp-active")?(uo.disableOthers(),document.body.classList.add("mdp-readabler-align-left"),uo.alignLeftStyle.innerHTML="\n /*noinspection CssUnusedSymbol*/\n body.mdp-readabler-align-left,\n body.mdp-readabler-align-left h1,\n body.mdp-readabler-align-left h1 span,\n body.mdp-readabler-align-left h2,\n body.mdp-readabler-align-left h2 span,\n body.mdp-readabler-align-left h3,\n body.mdp-readabler-align-left h3 span,\n body.mdp-readabler-align-left h4,\n body.mdp-readabler-align-left h4 span,\n body.mdp-readabler-align-left h5,\n body.mdp-readabler-align-left h5 span,\n body.mdp-readabler-align-left h6,\n body.mdp-readabler-align-left h6 span,\n\n body.mdp-readabler-align-left p,\n body.mdp-readabler-align-left li,\n body.mdp-readabler-align-left label,\n body.mdp-readabler-align-left input,\n body.mdp-readabler-align-left select,\n body.mdp-readabler-align-left textarea,\n body.mdp-readabler-align-left legend,\n body.mdp-readabler-align-left code,\n body.mdp-readabler-align-left pre,\n body.mdp-readabler-align-left dd,\n body.mdp-readabler-align-left dt,\n body.mdp-readabler-align-left span,\n body.mdp-readabler-align-left blockquote {\n text-align: left !important;\n }\n ",document.head.appendChild(uo.alignLeftStyle)):document.body.classList.remove("mdp-readabler-align-left")},disableOthers:function(){let e=document.getElementById("mdp-readabler-action-align-center");null!==e&&e.classList.contains("mdp-active")&&e.click();let t=document.getElementById("mdp-readabler-action-align-right");null!==t&&t.classList.contains("mdp-active")&&t.click()}},po={alignRightStyle:document.createElement("style"),init:function(){document.querySelector("#mdp-readabler-action-align-right").addEventListener("ReadablerToggleBoxChanged",po.alignRight)},alignRight:function(e){e.target.classList.contains("mdp-active")?(po.disableOthers(),document.body.classList.add("mdp-readabler-align-right"),po.alignRightStyle.innerHTML="\n /*noinspection CssUnusedSymbol*/\n body.mdp-readabler-align-right,\n body.mdp-readabler-align-right h1,\n body.mdp-readabler-align-right h1 span,\n body.mdp-readabler-align-right h2,\n body.mdp-readabler-align-right h2 span,\n body.mdp-readabler-align-right h3,\n body.mdp-readabler-align-right h3 span,\n body.mdp-readabler-align-right h4,\n body.mdp-readabler-align-right h4 span,\n body.mdp-readabler-align-right h5,\n body.mdp-readabler-align-right h5 span,\n body.mdp-readabler-align-right h6,\n body.mdp-readabler-align-right h6 span,\n\n body.mdp-readabler-align-right p,\n body.mdp-readabler-align-right li,\n body.mdp-readabler-align-right label,\n body.mdp-readabler-align-right input,\n body.mdp-readabler-align-right select,\n body.mdp-readabler-align-right textarea,\n body.mdp-readabler-align-right legend,\n body.mdp-readabler-align-right code,\n body.mdp-readabler-align-right pre,\n body.mdp-readabler-align-right dd,\n body.mdp-readabler-align-right dt,\n body.mdp-readabler-align-right span,\n body.mdp-readabler-align-right blockquote {\n text-align: right !important;\n }\n ",document.head.appendChild(po.alignRightStyle)):document.body.classList.remove("mdp-readabler-align-right")},disableOthers:function(){let e=document.getElementById("mdp-readabler-action-align-center");null!==e&&e.classList.contains("mdp-active")&&e.click();let t=document.getElementById("mdp-readabler-action-align-left");null!==t&&t.classList.contains("mdp-active")&&t.click()}};const mo=function(e){document.querySelectorAll("#mdp-readabler-visually-pleasing-experience-box .mdp-readabler-toggle-box.mdp-active").forEach((t=>{e.id!==t.id&&t.click()}))};let bo={darkContrastStyle:document.createElement("style"),init:function(){document.querySelector("#mdp-readabler-action-dark-contrast").addEventListener("ReadablerToggleBoxChanged",bo.darkContrast)},darkContrast:function(e){e.target.classList.contains("mdp-active")?(mo(e.target),document.body.classList.add("mdp-readabler-dark-contrast")):document.body.classList.remove("mdp-readabler-dark-contrast")}},fo={lightContrastStyle:document.createElement("style"),init:function(){document.querySelector("#mdp-readabler-action-light-contrast").addEventListener("ReadablerToggleBoxChanged",fo.lightContrast)},lightContrast:function(e){e.target.classList.contains("mdp-active")?(mo(e.target),document.body.classList.add("mdp-readabler-light-contrast")):document.body.classList.remove("mdp-readabler-light-contrast")}};const go={init:function(){document.querySelector("#mdp-readabler-action-monochrome").addEventListener("ReadablerToggleBoxChanged",go.monochrome)},monochrome:function(e){e.target.classList.contains("mdp-active")?(mo(e.target),document.body.classList.add("mdp-readabler-monochrome")):document.body.classList.remove("mdp-readabler-monochrome")}},ho={init:function(){document.querySelector("#mdp-readabler-action-high-saturation").addEventListener("ReadablerToggleBoxChanged",ho.highSaturation)},highSaturation:function(e){e.target.classList.contains("mdp-active")?(mo(e.target),document.body.classList.add("mdp-readabler-high-saturation")):document.body.classList.remove("mdp-readabler-high-saturation")}},vo={init:function(){document.querySelector("#mdp-readabler-action-high-contrast").addEventListener("ReadablerToggleBoxChanged",vo.highContrast)},highContrast:function(e){e.target.classList.contains("mdp-active")?(mo(e.target),document.body.classList.add("mdp-readabler-high-contrast")):document.body.classList.remove("mdp-readabler-high-contrast")}};let yo={init:function(){document.querySelector("#mdp-readabler-action-low-saturation").addEventListener("ReadablerToggleBoxChanged",yo.lowSaturation)},lowSaturation:function(e){e.target.classList.contains("mdp-active")?(mo(e.target),document.body.classList.add("mdp-readabler-low-saturation")):document.body.classList.remove("mdp-readabler-low-saturation")}},wo={select:document.getElementById("mdp-readabler-useful-links"),init:function(){wo.buildSelect(),wo.select.addEventListener("change",(e=>{window.location.href=e.target.value}))},grabLinks:function(){let e=document.querySelectorAll("a"),t=[];const n=window.mdpReadablerOptions;t.push([n.HOME,window.location.origin]);for(let n=0;nString.fromCharCode(t)))}function Co(e){const t=e.target;if(!t)return;const n=t.querySelector(".mdp-readabler-voice-navigation-commands-container");if(!n)return;t.getBoundingClientRect().top>n.getBoundingClientRect().top?t.classList.add("scroll-up-gradient"):t.classList.remove("scroll-up-gradient")}const{translation:To}=window.mdpReadablerOptions;function Ro(){const e="mdp-readabler-voice-navigation",t=document.createElement("div");t.id=e,t.setAttribute("aria-hidden","true");const n=document.createElement("div");n.id=`${e}-overlay`,n.setAttribute("tabindex","-1");const o=document.createElement("div");o.id=`${e}-content`,o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",To.voiceRecognitionCommands),o.appendChild(function(){const e=document.createElement("div");return e.id="mdp-readabler-voice-navigation-commands-form",e.appendChild(function(){const e=document.createElement("button");return e.id="mdp-readabler-voice-navigation-record-button",e.ariaLabel=To.voiceRecognitionStart,e.disabled=!0,e.addEventListener("click",(()=>{Gn.manageRecognition(!document.body.classList.contains("mdp-readabler-recognition-running"))})),e}()),e.appendChild(function(){const e=document.createElement("fieldset");e.id="mdp-readabler-voice-navigation-fieldset";const t=document.createElement("legend");t.innerText=To.voiceRecognitionLegend,e.appendChild(t);const n=document.createElement("input");n.type="text",n.id="mdp-readabler-voice-navigation-history",n.name="mdp-readabler-voice-navigation-history",n.ariaLabel=To.voiceRecognitionHistory,n.autocomplete="off",n.disabled=!0,e.appendChild(n);const o=document.createElement("label");o.htmlFor="mdp-readabler-voice-navigation-input",o.innerText=To.voiceRecognitionWait,o.visibility="hidden",e.appendChild(o);const i=document.createElement("input");if(i.type="text",i.id="mdp-readabler-voice-navigation-input",i.autocomplete="off",i.placeholder=To.voiceRecognitionWait,i.disabled=!0,e.appendChild(i),"on"===window.mdpReadablerOptions.voiceNavigationVoiceGraph){const t=document.createElement("canvas");t.id="mdp-readabler-voice-visualization",e.appendChild(t)}return e}()),e.appendChild(function(){const e=document.createElement("button");return e.id="mdp-readabler-voice-navigation-commands-trigger",e.dataset.accordion="collapse",e.ariaLabel=To.voiceRecognitionCommands,e.addEventListener("click",(()=>{const t=new CustomEvent("ReadablerVoiceCommandsAccordion",{detail:e.dataset.accordion});window.dispatchEvent(t)})),e}()),e.appendChild(function(){const e="mdp-readabler-voice-navigation",t=document.createElement("button");return t.id=`${e}-close-button`,t.ariaLabel=To.voiceRecognitionClose,t.addEventListener("click",(()=>{Gn.manageRecognition(!1);let e=document.querySelector("#mdp-readabler-action-voice-navigation");e&&e.click()})),t}()),e}()),o.appendChild(function(){const{voiceNavigation:e,voiceNavigationAliases:t,voiceNavigationDescription:n}=window.mdpReadablerOptions;new Yn;const o=document.createElement("div");o.classList.add("mdp-readabler-voice-navigation-commands-list");const i=document.createElement("div");i.classList.add("mdp-readabler-voice-navigation-commands-container");for(const[o,a]of Object.entries(e)){const e=document.createElement("div");e.classList.add("mdp-readabler-voice-navigation-command-group");const r=document.createElement("p"),d=(t[o]??o).replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(t))),s=`${d}`,l=n[o].replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(t)));r.innerHTML=`${s}${d}${l}`,e.appendChild(r);const c=document.createElement("div");c.classList.add("mdp-readabler-voice-navigation-commands"),a.forEach((t=>{const n=document.createElement("button");n.classList.add("mdp-readabler-voice-navigation-command"),n.setAttribute("data-command",t),n.setAttribute("data-command-group",o),n.innerText=ko(o,t),c.appendChild(n),e.appendChild(c)})),i.appendChild(e)}return o.appendChild(i),window.addEventListener("ReadablerVoiceCommandsAccordion",(e=>{const t=document.querySelector("#mdp-readabler-voice-navigation-commands-trigger");if(t)switch(e.detail){case"collapse":o.classList.remove("expand-commands-accordion"),o.classList.add("collapse-commands-accordion"),t.dataset.accordion="expand";break;case"expand":o.classList.remove("collapse-commands-accordion"),o.classList.add("expand-commands-accordion"),t.dataset.accordion="collapse"}})),o.addEventListener("scroll",Co),o.addEventListener("click",(e=>{if(e.preventDefault(),"BUTTON"!==e.target.tagName)return;if(!document.querySelector("#mdp-readabler-voice-navigation-input"))return;Hn(t[e.target.dataset.command]??e.target.dataset.command,window.mdpReadablerOptions.translation.voiceRecognitionStart);const n=new CustomEvent("ReadablerVoiceNavigationAction",{detail:{command:e.target.dataset.command,commandGroup:e.target.dataset.commandGroup,number:"number"===e.target.dataset.commandGroup&&Gn.recognizeNumberCommand(e.target.innerText)}});window.dispatchEvent(n)})),o}()),t.appendChild(o),document.body.appendChild(t)}let Ao={init:function(){let e=document.querySelector("#mdp-readabler-action-voice-navigation");new Gn?(window.mdpReadablerVoiceNavigationMicroModal=h,Ro(),e.addEventListener("ReadablerToggleBoxChanged",Ao.voiceNavigation)):e.classList.add("mdp-disabled")},voiceNavigation:function(e){const t="mdp-readabler-voice-navigation";if(!e.target.classList.contains("mdp-active"))return document.body.classList.remove(t),void window.mdpReadablerVoiceNavigationMicroModal.close(t);document.body.classList.add(t),window.mdpReadablerVoiceNavigationMicroModal.show(t,{onClose:e=>{e.id&&e.id===t&&Gn.manageRecognition(!1)},onShow:e=>{e.id&&e.id===t&&Gn.manageRecognition(!0)},closeTrigger:"data-readabler-voice-navigation-close",openTrigger:"data-readabler-voice-navigation-open",disableScroll:!1,disableFocus:!0,awaitOpenAnimation:!1,awaitCloseAnimation:!1})}};class Oo{constructor(e){this.options=e,this.p="mdp-readabler"}init(){const e=this.options;ao.init(),ro.init(),Qn.init(),e.onlineDictionary&&so.init(),e.contentScaling&&he.init(),e.fontSizing&&Le.init(),e.lineHeight&&Se.init(),e.letterSpacing&&ke.init(),(e.readableFont||e.profileVisuallyImpaired||e.profileBlindUsers)&&lo.init(),e.dyslexiaFont&&Y.init(),(e.highlightTitles||e.profileCognitiveDisability)&&ae.init(),(e.highlightLinks||e.profileCognitiveDisability)&&re.init(),e.textMagnifier&&de.init(),e.alignCenter&&co.init(),e.alignLeft&&uo.init(),e.alignRight&&po.init(),e.darkContrast&&bo.init(),e.lightContrast&&fo.init(),e.monochrome&&go.init(),(e.highSaturation||e.profileVisuallyImpaired||e.profileAdhdFriendly)&&ho.init(),e.highContrast&&vo.init(),(e.lowSaturation||e.profileEpilepsy)&&yo.init(),e.textColors&&Z.init(),e.titleColors&&Q.init(),e.backgroundColors&&ee.init(),e.muteSounds&&ue.init(),e.hideImages&&pe.init(),e.hideEmoji&&oo.init(),(e.virtualKeyboard||e.profileBlindUsers)&&ye.init(),e.readingGuide&&le.init(),e.usefulLinks&&wo.init(),(e.stopAnimations||e.profileEpilepsy||e.profileCognitiveDisability||e.profileAdhdFriendly)&&me.init(),(e.readingMask||e.profileAdhdFriendly)&&se.init(),e.highlightHover&&Ee.init(),e.highlightFocus&&ce.init(),e.bigBlackCursor&&xo.init(),e.bigWhiteCursor&&So.init(),e.cognitiveReading&&xe.init(),(e.textToSpeech||e.profileBlindUsers)&&no.init(),(e.keyboardNavigation||e.profileBlindUsers)&&$.init(),e.voiceNavigation&&Ao.init()}}class $o{constructor(){const e=document.querySelectorAll(".mdp-readabler-toggle-shortcode");!e||e.length<1||e.forEach((e=>this.initShortcode(e)))}initShortcode(t){let n=t.dataset.readablerAction;if(!n||n.length<1)return;if(n=n.replace(/[^a-zA-Z-]/g,""),n=e(n),!io.includes(n))return void console.warn("Shortcode action not available:",n);fe.get(n);t.setAttribute("data-readabler-action-state",fe.get(n)?"active":"inactive"),t.addEventListener("click",(e=>{e.preventDefault();let o=fe.get(n)??!1;t.setAttribute("data-readabler-action-state",o?"inactive":"active"),this.invokeAction(n,!o)}))}invokeAction(e,t=!0){window.dispatchEvent(new CustomEvent("readabler-headless",{detail:{action:e,value:t}}))}}function Io(){const e=navigator.userAgent,t=/^((?!chrome|android).)*safari/i.test(e),n=/Macintosh/i.test(e),o="ontouchend"in document;return t&&n&&!o}let Mo=0;let Bo=function(){let t,n={init:function(){let n="on"===t.ignoreSavedConfig;const o=["content_scaling","font_sizing","line_height","letter_spacing"];i.haveSavedSettings()&&!n||t.startConfig&&t.startConfig.forEach((n=>{const a=n.includes("profile")?`accessibility-${n}`:`action-${n}`,d=`mdp-readabler-${a.replaceAll("_","-")}`,s=document.getElementById(d);if(s)if(o.includes(n)){const o=t[e(n,"start")]?t[e(n,"start")]:0;let a=s.querySelector(".mdp-readabler-value");a.dataset.value=o.toString(),r.setLabel(a,o);const l=new CustomEvent("ReadablerInputSpinnerChanged",{detail:{load:!0}});a.dispatchEvent(l),i.save(d,a.dataset.value)}else{const e=i.get(`mdp-readabler-${a.replaceAll("_","-")}`);JSON.parse(e)||s.click()}}))}};function o(e){if(window.document.cookie.indexOf("mdp-readabler-hide=1")>-1){const e=document.querySelector("#mdp-readabler-popup-box"),t=document.querySelector("#mdp-readabler-trigger-button");return e&&e.remove(),void(t&&t.remove())}t=e,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",s):s()}function s(){const e=document.querySelector("#mdp-readabler-popup-box");e&&(e.removeAttribute("style"),function(e){window.mdpReadablerMicroModal=h,window.mdpReadablerMicroModal.init("mdp-readabler-popup-box",{onClose:e=>{e.id&&"mdp-readabler-popup-box"===e.id&&R()},openTrigger:"data-readabler-trigger",closeTrigger:"data-readabler-close",disableScroll:!e.popupScroll,disableFocus:!1}),document.addEventListener("click",v,!1),E(e)}(t),I(t),r.init(),a.init(),d.init(),new Oo(t).init(),new Zn(t).init()),n.init(),"on"===t.analytics&&new K,window.addEventListener("readabler-headless",(e=>{let{action:t,value:n}=e.detail;switch(n="true"===n||"false"!==n&&n,t){case"contentScaling":n?he.enable(G(t),n):he.disable(G(t));break;case"textMagnifier":n?de.enable(G(t)):de.disable(G(t));break;case"readableFont":case"dyslexiaFont":n?J.enable(G(t)):J.disable(G(t));break;case"highlightTitles":n?ae.enable(G(t)):ae.disable(G(t));break;case"highlightLinks":n?re.enable(G(t)):re.disable(G(t));break;case"fontSizing":n?Le.enable(G(t),n):Le.disable(G(t));break;case"lineHeight":n?Se.enable(G(t),n):Se.disable(G(t));break;case"letterSpacing":n?ke.enable(G(t),n):ke.disable(G(t));break;case"alignLeft":case"alignCenter":case"alignRight":n?ie.enable(G(t)):ie.disable(G(t));break;case"darkContrast":case"lightContrast":case"monochrome":case"highSaturation":case"highContrast":case"lowSaturation":n?X.enable(G(t)):X.disable(G(t));break;case"textColors":case"titleColors":case"backgroundColors":n?oe.enable(G(t),n):oe.disable(G(t),n);break;case"muteSounds":n?ue.enable(G(t)):ue.disable(G(t));break;case"hideImages":n?pe.enable(G(t)):pe.disable(G(t));break;case"hideEmoji":n?oo.enable(G(t)):oo.disable(G(t));case"virtualKeyboard":n?ye.enable(G(t)):ye.disable(G(t));break;case"readingGuide":n?le.enable(G(t)):le.disable(G(t));break;case"stopAnimations":n?me.enable(G(t)):me.disable(G(t));break;case"readingMask":n?se.enable(G(t)):se.disable(G(t));break;case"highlightHover":n?Ee.enable(G(t)):Ee.disable(G(t));break;case"highlightFocus":n?ce.enable(G(t)):ce.disable(G(t));break;case"bigBlackCursor":case"bigWhiteCursor":n?we.enable(G(t)):we.disable(G(t));break;case"cognitiveReading":n?xe.enable(G(t)):xe.disable(G(t));break;case"textToSpeech":n?no.enable(G(t)):no.disable(G(t));break;case"keyboardNavigation":n?$.enable(G(t)):$.disable(G(t));break;case"profileEpilepsy":case"profileVisuallyImpaired":case"profileCognitiveDisability":case"profileAdhdFriendly":case"profileBlindUsers":n?Zn.enable(t):Zn.disable(t);break;case"epilepsy":case"visuallyImpaired":case"cognitiveDisability":case"adhdFriendly":case"blindUsers":n?Zn.enable(`profile${t.charAt(0).toUpperCase()}${t.slice(1)}`):Zn.disable(`profile${t.charAt(0).toUpperCase()}${t.slice(1)}`);break;case"voiceNavigation":if(!n)break;try{if(n.includes(":")){const e=n.split(":");Yn[Jn(e[0])](e[1]??null)}else Yn[Jn(n)]()}catch(e){console.error(e)}break;case"reset":io.forEach((e=>{window.dispatchEvent(new CustomEvent("readabler-headless",{detail:{action:e,value:!1}}))}));break;case"resetReload":fe.reset(),window.location.reload();break;case"hideForever":Qn.enable()}})),new $o,new i,Io()&&function(){if(!Io())return;const e=document.querySelectorAll('a, button, input, textarea, select, [tabindex]:not([tabindex="-1"])');0!==e.length&&document.addEventListener("keydown",(t=>{"Tab"===t.key&&t.isTrusted&&(t.preventDefault(),t.shiftKey?Mo<=0?Mo=e.length-1:Mo--:Mo>=e.length-1?Mo=0:Mo++,e[Mo].focus())}))}()}return{run:function(e){o(e)}}}();Bo.run(window.mdpReadablerOptions)})();