Plugin Directory

Changeset 3429587


Ignore:
Timestamp:
12/30/2025 12:15:56 PM (3 months ago)
Author:
pixelemu
Message:

Plugin updated to 1.15 version

Location:
dj-accessibility/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • dj-accessibility/trunk/base.php

    r3028285 r3429587  
    126126            $plugin_type = DJAcc::pluginType();
    127127
     128            $mobile = DJAcc::getParam('mobile', true);
     129            $breakpoint = DJAcc::getParam('breakpoint', '767') ?: 767;
     130
     131            if(!$mobile) {
     132                wp_add_inline_style('djacc-style','@media(max-width: ' . $breakpoint - 1 . 'px) { .djacc { display: none !important; }');
     133            }
     134
    128135            $options = json_encode(array(
    129136                'cms'                    => 'wp',
     
    136143                'align_position_toolbar' => esc_js($align_toolbar),
    137144                'align_mobile_position'  => esc_js($align_mobile_position),
    138                 'breakpoint'             => '767px',
     145                'breakpoint'             => $breakpoint,
    139146                'direction'              => esc_js($direction),
    140147                'space'                  => esc_js($space),
  • dj-accessibility/trunk/dj-accessibility-light.php

    r3028285 r3429587  
    66 * Plugin URI: https://dj-extensions.com/yootheme/dj-accessibility
    77 * Description: Accessibility plugin for WordPress
    8  * Version: 1.12
     8 * Version: 1.15
    99 * Author: DJ-Extensions.com
    1010 * Author URI: https://dj-extensions.com
     
    1616    define ('DJACC', true);
    1717    define ('DJACC_DEBUG', false);
    18     define ('DJACC_VERSION', '1.12');
     18    define ('DJACC_VERSION', '1.15');
    1919    define ('DJACC_PATH', __DIR__);
    2020
  • dj-accessibility/trunk/helpers/helper.php

    r3028285 r3429587  
    6565    }
    6666
     67    public static function getImage($param, $default = null) {
     68        $image = self::getParam($param, null);
     69        if(!empty($image)) {
     70            $image = str_replace(get_site_url(), '', $image);
     71            $image = str_replace('http://', '', $image);
     72            $image = str_replace('https://', '', $image);
     73            $image = get_site_url() . '/' . $image;
     74            return $image;
     75        }
     76        return $default;
     77    }
     78
    6779    public static function getLayout( $layout ) {
    6880
  • dj-accessibility/trunk/helpers/options.php

    r3028285 r3429587  
    290290    }
    291291
     292        $cmb->add_field( array(
     293        'name'             => esc_html__('Display on mobile', 'dj-accessibility'),
     294        'id'               => 'djacc_mobile',
     295        'type'             => 'select',
     296        'default'          => '1',
     297        'options'          => array(
     298            '1'  => esc_html__( 'Yes', 'dj-accessibility' ),
     299            '0' => esc_html__( 'No', 'dj-accessibility' ),
     300        ),
     301    ) );
     302
     303    $cmb->add_field( array(
     304            'name'    => esc_html__('Mobile breakpoint', 'dj-accessibility'),
     305            'desc'    => esc_html__('Resolution at which the layout will be switched to mobile', 'dj-accessibility'),
     306            'id'      => 'djacc_breakpoint',
     307            'default' => '767',
     308            'type'    => 'text_small',
     309            'attributes'    => array(
     310                'type' => 'number',
     311            ),
     312        ) );
     313
    292314    $cmb->add_field( array(
    293315        'name'    => esc_html__('[Popup] Button', 'dj-accessibility'),
  • dj-accessibility/trunk/module/assets/js/accessibility.min.js

    r3028285 r3429587  
    1 "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _createForOfIteratorHelper(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,i=function(){};return{s:i,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){c=!0,r=t},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw r}}}}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function _regeneratorRuntime(){_regeneratorRuntime=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var r=e&&e.prototype instanceof h?e:h,o=Object.create(r.prototype),c=new w(i||[]);return a(o,"_invoke",{value:j(t,n,c)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var u={};function h(){}function p(){}function f(){}var y={};s(y,r,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(E([])));m&&m!==e&&n.call(m,r)&&(y=m);var g=f.prototype=h.prototype=Object.create(y);function _(t){["next","throw","return"].forEach(function(e){s(t,e,function(t){return this._invoke(e,t)})})}function b(t,e){var i;a(this,"_invoke",{value:function(a,r){function o(){return new e(function(i,o){!function a(i,r,o,c){var s=d(t[i],t,r);if("throw"!==s.type){var l=s.arg,u=l.value;return u&&"object"==_typeof(u)&&n.call(u,"__await")?e.resolve(u.__await).then(function(t){a("next",t,o,c)},function(t){a("throw",t,o,c)}):e.resolve(u).then(function(t){l.value=t,o(l)},function(t){return a("throw",t,o,c)})}c(s.arg)}(a,r,i,o)})}return i=i?i.then(o,o):o()}})}function j(t,e,n){var a="suspendedStart";return function(i,r){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===i)throw r;return T()}for(n.method=i,n.arg=r;;){var o=n.delegate;if(o){var c=L(o,n);if(c){if(c===u)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var s=d(t,e,n);if("normal"===s.type){if(a=n.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a="completed",n.method="throw",n.arg=s.arg)}}}function L(t,e){var n=e.method,a=t.iterator[n];if(void 0===a)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var i=d(a,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,u;var r=i.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function e(){for(;++a<t.length;)if(n.call(t,a))return e.value=t[a],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return p.prototype=f,a(g,"constructor",{value:f,configurable:!0}),a(f,"constructor",{value:p,configurable:!0}),p.displayName=s(f,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(b.prototype),s(b.prototype,o,function(){return this}),t.AsyncIterator=b,t.async=function(e,n,a,i,r){void 0===r&&(r=Promise);var o=new b(l(e,n,a,i),r);return t.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},_(g),s(g,c,"Generator"),s(g,r,function(){return this}),s(g,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),n=[];for(var a in e)n.push(a);return n.reverse(),function t(){for(;n.length;){var a=n.pop();if(a in e)return t.value=a,t.done=!1,t}return t.done=!0,t}},t.values=E,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function a(n,a){return o.type="throw",o.arg=t,e.next=n,a&&(e.method="next",e.arg=void 0),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],o=r.completion;if("root"===r.tryLoc)return a("end");if(r.tryLoc<=this.prev){var c=n.call(r,"catchLoc"),s=n.call(r,"finallyLoc");if(c&&s){if(this.prev<r.catchLoc)return a(r.catchLoc,!0);if(this.prev<r.finallyLoc)return a(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return a(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return a(r.finallyLoc)}}}},abrupt:function(t,e){for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=t,o.arg=e,r?(this.method="next",this.next=r.finallyLoc,u):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var a=n.completion;if("throw"===a.type){var i=a.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:E(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}function asyncGeneratorStep(t,e,n,a,i,r,o){try{var c=t[r](o),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(a,i)}function _asyncToGenerator(t){return function(){var e=this,n=arguments;return new Promise(function(a,i){var r=t.apply(e,n);function o(t){asyncGeneratorStep(r,a,i,o,c,"next",t)}function c(t){asyncGeneratorStep(r,a,i,o,c,"throw",t)}o(void 0)})}}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,_toPropertyKey(a.key),a)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _defineProperty(t,e,n){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e||"default");if("object"!==_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var DJAccessibility=function(){function t(e){var n=this;_classCallCheck(this,t),_defineProperty(this,"handleScreenReaderClick",function(t){n.screenReaderEvent(t,n.options)});this.options=_objectSpread(_objectSpread({},{target:"#djacc",speech_pitch:1,speech_rate:1,speech_volume:1}),e),this.page=document.documentElement,this.state={},this.nodes={},this.textNodes={},this.initiated=!1,this.template={},this.template.current=this.options.layout,this.layout="desktop",this.position_type=this.options.position,"toolbar"==this.template.current?this.options.align_position=this.options.align_position_toolbar:this.options.align_position=this.options.align_position_popup,this.ver=this.getVersion(),this.init()}return _createClass(t,[{key:"init",value:function(){var t=this;document.addEventListener("DOMContentLoaded",function(){var e;(t.container=document.body.querySelector(".djacc"),t.container)&&(t.template.desktop=null===(e=t.container)||void 0===e?void 0:e.outerHTML);t.setLayout(),window.addEventListener("resize",function(e){t.setLayout()})})}},{key:"loadTemplate",value:function(){var t=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var n,a,i,r;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=new FormData,a="mobile"===e?this.options.mobile_layout:this.options.layout,this.options.ajax_action&&n.append("action",this.options.ajax_action),n.append("djacc_template",a),t.next=6,fetch(this.options.ajax_url,{method:"POST",credentials:"same-origin",body:n});case 6:return i=t.sent,t.next=9,i.text();case 9:if(r=t.sent,200!==i.status){t.next=12;break}return t.abrupt("return",r);case 12:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"setLayout",value:function(){var t=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.container&&this.options.layout==this.options.mobile_layout){t.next=10;break}if(this.template.desktop){t.next=5;break}return t.next=4,this.loadTemplate("desktop");case 4:this.template.desktop=t.sent;case 5:if(this.template.mobile){t.next=9;break}return t.next=8,this.loadTemplate("mobile");case 8:this.template.mobile=t.sent;case 9:this.isMobile()&&this.template.current===this.options.layout?(this.initiated=!1,this.layout="mobile",this.position_type=this.options.mobile_position,this.template.current=this.options.mobile_layout,this.setTemplate(this.template.mobile),this.initPanel()):this.isDesktop()&&this.template.current===this.options.mobile_layout&&(this.initiated=!1,this.layout="desktop",this.position_type=this.options.position,this.template.current=this.options.layout,this.setTemplate(this.template.desktop),this.initPanel());case 10:this.initiated||this.initPanel();case 11:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"setTemplate",value:function(t){"popup"==this.template.current&&this.options.space&&(document.body.style.paddingTop="",document.body.style.paddingLeft="",document.body.style.paddingRight="",document.body.style.paddingBottom=""),"popup"==this.template.current&&(this.options.align_position=this.options.align_position_popup),"toolbar"==this.template.current&&(this.options.align_position=this.options.align_position_toolbar),this.container&&this.container.remove(),document.body.insertAdjacentHTML("afterbegin",t),this.container=document.body.querySelector(".djacc")}},{key:"setPositionClass",value:function(t){var e="djacc--"+t.replace(" ","-");this.container.classList.contains(e)||(this.container.classList.remove("djacc--top-center","djacc--top-left","djacc--top-right","djacc--center-left","djacc--center-right","djacc--bottom-center","djacc--bottom-left","djacc--bottom-right"),this.container.classList.add(e))}},{key:"initPanel",value:function(){var t=this;t.container&&(t.initiated=!0,t.panel=t.container.querySelector(".djacc__panel"),t.registerEvents(),t.parseURL(),t.setVersion(),"custom"==t.position_type?t.setStaticPosition():(t.setFixedPosition(),t.setPanelSize(),t.setMobilePosition(),t.reserveSpace(),t.updateDirection(),window.addEventListener("resize",function(e){t.setPanelSize(),t.setMobilePosition(),t.reserveSpace()})),window.addEventListener("resize",function(e){t.updateDirection()}))}},{key:"parseURL",value:function(){if(window.location.hash){var t=window.location.hash.substring(1);t=(t=t.replaceAll(/[^A-Za-z0-9_-]+/g,"")).replace("djacc-","");var e=document.body.querySelector(".djacc__btn--"+t);e&&e.click()}}},{key:"setStaticPosition",value:function(){var t=this.options.target,e=document.body.querySelector(t);e&&(e.append(this.container),this.container.classList.remove("djacc--sticky"),this.container.classList.add("djacc--static"),this.container.classList.remove("djacc--hidden"),this.visible=!0)}},{key:"setFixedPosition",value:function(){"djacc"!=document.body.firstElementChild.className&&document.body.prepend(this.container),this.container.classList.remove("djacc--static"),this.container.classList.add("djacc--sticky"),this.container.classList.remove("djacc--hidden")}},{key:"addState",value:function(t,e){this.state[t]=e,this.saveCookie(this.state)}},{key:"removeState",value:function(t){delete this.state[t],0===Object.keys(this.state).length?this.removeCookie():this.saveCookie(this.state)}},{key:"setState",value:function(){var t=this.getCookie();if(t)for(var e in t=JSON.parse(t))if("contrast"===e||"links"===e||"titles"===e||"sr"===e){var n=t[e],a=document.body.querySelector(".djacc__btn.djacc__btn--"+n);a&&a.click()}else{var i=document.body.querySelector(".djacc__arrows.djacc__arrows--"+e);if(i)for(var r=t[e],o=i.querySelector(".djacc__inc"),c=i.querySelector(".djacc__dec"),s=0;s<Math.abs(r);s++)r<0?c.click():o.click()}}},{key:"setPanelSize",value:function(){if(!this.container.classList.contains("djacc--static")){var t,e=this.panel.getBoundingClientRect();if(this.container.classList.contains("djacc--bottom-left")||this.container.classList.contains("djacc--bottom-right")||this.container.classList.contains("djacc--bottom-center")){var n=window.screen.height-e.bottom;t=window.screen.height-n}else t=window.screen.height-e.top;t>0&&(this.container.classList.contains("djacc-toolbar")?this.panel.querySelector(".djacc__list").style.maxHeight=t+"px":this.panel.style.maxHeight=t+"px")}}},{key:"reserveSpace",value:function(){if(!this.container.classList.contains("djacc--static")&&this.container.classList.contains("djacc-toolbar")&&0!=this.options.space){var t=this.panel.querySelector(".djacc__list"),e=window.getComputedStyle(this.container),n=t.scrollWidth,a=parseInt(e.marginLeft),i=t.scrollHeight,r=parseInt(e.marginTop);this.container.classList.contains("djacc--center-left")?document.body.style.paddingLeft=n+a+"px":this.container.classList.contains("djacc--center-right")?document.body.style.paddingRight=n+a+"px":this.container.classList.contains("djacc--top-left")||this.container.classList.contains("djacc--top-right")||this.container.classList.contains("djacc--top-center")?document.body.style.paddingTop=i+r+"px":document.body.style.paddingBottom=i+r+"px"}}},{key:"updateDirection",value:function(){if(!this.container.classList.contains("djacc-toolbar")){var t=this.panel.getBoundingClientRect();(this.container.classList.contains("djacc--top-right")||this.container.classList.contains("djacc--bottom-right"))&&(t.left<0?this.container.classList.add("djacc--direction"):this.container.classList.contains("djacc--direction")&&this.container.classList.remove("djacc--direction")),(this.container.classList.contains("djacc--top-left")||this.container.classList.contains("djacc--bottom-left"))&&(window.innerWidth<t.right?this.container.classList.add("djacc--direction"):this.container.classList.contains("djacc--direction")&&this.container.classList.remove("djacc--direction"))}}},{key:"setMobilePosition",value:function(){if(!this.container.classList.contains("djacc--static")&&!this.container.classList.contains("djacc-toolbar")&&this.options.align_position_popup!=this.options.align_mobile_position){var t="djacc--"+this.options.align_position.replace(" ","-"),e="djacc--"+this.options.align_mobile_position.replace(" ","-");this.isMobile()?this.container.classList.contains(t)&&(this.container.classList.add(e),this.container.classList.remove(t)):this.container.classList.contains(e)&&(this.container.classList.add(t),this.container.classList.remove(e))}}},{key:"registerEvents",value:function(){var t=this,e=document.body.querySelector(".djacc__openbtn");e&&e.addEventListener("click",function(e){t.panel.classList.toggle("djacc__panel--active"),this.classList.toggle("djacc__openbtn--active"),t.page.classList.toggle("djacc-opened")});var n=function(t){if(t.classList.contains("djacc__btn--active"))t.classList.remove("djacc__btn--active");else{var e=_toConsumableArray(document.body.querySelectorAll(".djacc__item--contrast > .djacc__btn"));if(e){var n,a=_createForOfIteratorHelper(e);try{for(a.s();!(n=a.n()).done;){n.value.classList.remove("djacc__btn--active")}}catch(t){a.e(t)}finally{a.f()}}t.classList.add("djacc__btn--active")}},a=document.body.querySelector(".djacc__close");if(a&&(a.addEventListener("click",function(n){t.panel.classList.remove("djacc__panel--active"),e&&e.classList.remove("djacc__openbtn--active"),t.page.classList.remove("djacc-opened")}),!t.container.classList.contains("djacc--toolbar"))){var i=t.panel.querySelectorAll('button, [href], input, [tabindex="0"]'),r=i[0],o=i[i.length-1];r.addEventListener("keydown",function(t){"Tab"===t.key&&t.shiftKey&&setTimeout(function(){a.click(),e.focus()},300)}),o.addEventListener("keydown",function(t){"Tab"!==t.key||t.shiftKey||setTimeout(function(){a.click(),e.focus()},300)}),document.addEventListener("keyup",function(e){"Escape"!=e.key&&"Esc"!=e.key||!t.page.classList.contains("djacc-opened")||setTimeout(function(){a.click()},300)})}var c=document.body.querySelector(".djacc__reset");c&&c.addEventListener("click",function(e){var n=document.body.querySelectorAll(".djacc__item > .djacc__btn, .djacc__item > .djacc__arrows");if(n){var a,i=_createForOfIteratorHelper(n);try{for(i.s();!(a=i.n()).done;){a.value.classList.remove("djacc__btn--active","djacc__arrows--active")}}catch(t){i.e(t)}finally{i.f()}}var r=document.body.querySelectorAll(".djacc__size");if(r){var o,c=_createForOfIteratorHelper(r);try{for(c.s();!(o=c.n()).done;){var s=o.value;s.innerHTML="100%",s.parentNode.removeAttribute("data-djacc-count")}}catch(t){c.e(t)}finally{c.f()}}t.page.classList.contains("djacc-font-size")&&t.updateTextStyle("font-size",0),t.page.classList.contains("djacc-line-height")&&t.updateTextStyle("line-height",0),t.page.classList.contains("djacc-letter-spacing")&&t.updateTextStyle("letter-spacing",0),t.page.classList.contains("djacc-highlight-links")&&t.updateLinks(),t.page.classList.contains("djacc-highlight-titles")&&t.updateTitles(),t.page.classList.contains("djacc-screen-reader")&&t.screenReader(),t.page.style.filter="",t.page.style.zoom="",t.page.style.transform="",t.page.style.transformOrigin="",t.removeCookie(),t.clearClasses(),t.page.classList.contains("djacc-read-mode")&&window.location.reload(!1)});var s=document.body.querySelector(".djacc__btn.djacc__btn--invert-colors");s&&s.addEventListener("click",function(e){n(this),t.contrastInvert()});var l=document.body.querySelector(".djacc__btn.djacc__btn--monochrome");l&&l.addEventListener("click",function(e){n(this),t.contrastMono()});var d=document.body.querySelector(".djacc__btn.djacc__btn--low-saturation");d&&d.addEventListener("click",function(e){n(this),t.contrastLowSaturation()});var u=document.body.querySelector(".djacc__btn.djacc__btn--high-saturation");u&&u.addEventListener("click",function(e){n(this),t.contrastHighSaturation()});var h=document.body.querySelector(".djacc__btn.djacc__btn--dark-contrast");h&&h.addEventListener("click",function(e){n(this),t.contrastDark()});var p=document.body.querySelector(".djacc__btn.djacc__btn--light-contrast");p&&p.addEventListener("click",function(e){n(this),t.contrastLight()});var f=document.body.querySelector(".djacc__btn.djacc__btn--highlight-links");f&&f.addEventListener("click",function(e){this.classList.toggle("djacc__btn--active"),t.highlightLinks()});var y=document.body.querySelector(".djacc__btn.djacc__btn--highlight-titles");y&&y.addEventListener("click",function(e){this.classList.toggle("djacc__btn--active"),t.highlightTitles()});var v=document.body.querySelector(".djacc__btn.djacc__btn--read-mode");v&&v.addEventListener("click",function(e){this.classList.toggle("djacc__btn--active"),t.readMode(v)});var m=document.body.querySelector(".djacc__btn.djacc__btn--screen-reader");m&&("speechSynthesis"in window?m.addEventListener("click",function(e){e.stopPropagation(),this.classList.toggle("djacc__btn--active"),t.screenReader()}):m.remove());var g=document.body.querySelector(".djacc__arrows--zoom .djacc__inc");g&&g.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"+");t.zoomPage(n)});var _=document.body.querySelector(".djacc__arrows--zoom .djacc__dec");_&&_.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"-");t.zoomPage(n)});var b=document.body.querySelector(".djacc__arrows--font-size .djacc__inc");b&&b.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"+");t.updateTextStyle("font-size",n)});var j=document.body.querySelector(".djacc__arrows--font-size .djacc__dec");j&&j.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"-");t.updateTextStyle("font-size",n)});var L=document.body.querySelector(".djacc__arrows--line-height .djacc__inc");L&&L.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"+");t.updateTextStyle("line-height",n)});var k=document.body.querySelector(".djacc__arrows--line-height .djacc__dec");k&&k.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"-");t.updateTextStyle("line-height",n)});var S=document.body.querySelector(".djacc__arrows--letter-spacing .djacc__inc");S&&S.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"+");t.updateTextStyle("letter-spacing",n)});var w=document.body.querySelector(".djacc__arrows--letter-spacing .djacc__dec");w&&w.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"-");t.updateTextStyle("letter-spacing",n)}),this.setState()}},{key:"contrastInvert",value:function(){this.page.classList.contains("djacc-invert-colors")?(this.removeState("contrast"),this.page.classList.remove("djacc-invert-colors"),this.page.style.filter=""):(this.clearContrast(),this.addState("contrast","invert-colors"),this.page.classList.add("djacc-invert-colors"),this.page.style.filter="invert(100%)")}},{key:"contrastMono",value:function(){this.page.classList.contains("djacc-monochrome")?(this.removeState("contrast"),this.page.classList.remove("djacc-monochrome"),this.page.style.filter=""):(this.clearContrast(),this.addState("contrast","monochrome"),this.page.classList.add("djacc-monochrome"),this.page.style.filter="grayscale(100%)")}},{key:"contrastLowSaturation",value:function(){this.page.classList.contains("djacc-low-saturation")?(this.removeState("contrast"),this.page.classList.remove("djacc-low-saturation"),this.page.style.filter=""):(this.clearContrast(),this.addState("contrast","low-saturation"),this.page.classList.add("djacc-low-saturation"),this.page.style.filter="saturate(50%)")}},{key:"contrastHighSaturation",value:function(){this.page.classList.contains("djacc-high-saturation")?(this.removeState("contrast"),this.page.classList.remove("djacc-high-saturation"),this.page.style.filter=""):(this.clearContrast(),this.addState("contrast","high-saturation"),this.page.classList.add("djacc-high-saturation"),this.page.style.filter="saturate(200%)")}},{key:"contrastDark",value:function(){this.page.classList.contains("djacc-dark-contrast")?(this.removeState("contrast"),this.page.classList.remove("djacc-dark-contrast"),this.updateContrastElements()):(this.clearContrast(),this.addState("contrast","dark-contrast"),this.page.classList.add("djacc-dark-contrast"),this.updateContrastElements(1))}},{key:"contrastLight",value:function(){this.page.classList.contains("djacc-light-contrast")?(this.removeState("contrast"),this.page.classList.remove("djacc-light-contrast"),this.updateContrastElements()):(this.clearContrast(),this.addState("contrast","light-contrast"),this.page.classList.add("djacc-light-contrast"),this.updateContrastElements(1))}},{key:"highlightLinks",value:function(){this.page.classList.contains("djacc-highlight-links")?(this.removeState("links"),this.page.classList.remove("djacc-highlight-links"),this.updateLinks()):(this.addState("links","highlight-links"),this.page.classList.add("djacc-highlight-links"),this.updateLinks(1))}},{key:"highlightTitles",value:function(){this.page.classList.contains("djacc-highlight-titles")?(this.removeState("titles"),this.page.classList.remove("djacc-highlight-titles"),this.updateTitles()):(this.addState("titles","highlight-titles"),this.page.classList.add("djacc-highlight-titles"),this.updateTitles(1))}},{key:"readMode",value:function(t){if(this.page.classList.contains("djacc-read-mode"))window.location.reload(!1);else{this.page.classList.add("djacc-read-mode");var e,n=_createForOfIteratorHelper(document.body.querySelectorAll("nav, header, footer, aside, iframe, canvas, img, form, [uk-modal], [uk-sticky], .uk-slider"));try{for(n.s();!(e=n.n()).done;){var a=e.value;a.contains(self.container)||a.remove()}}catch(t){n.e(t)}finally{n.f()}var i,r=_createForOfIteratorHelper(this.getNodes("readmode"));try{for(r.s();!(i=r.n()).done;){var o=i.value;o.removeAttribute("style"),o.removeAttribute("id"),o.removeAttribute("class"),o.removeAttribute("uk-scrollspy"),o.removeAttribute("uk-grid"),o.removeAttribute("uk-img"),o.removeAttribute("uk-parallax"),o.removeAttribute("uk-scrollspy-class"),o.removeAttribute("uk-filter")}}catch(t){r.e(t)}finally{r.f()}var c=document.createElement("button");c.classList.add("djacc-readmode-disable","btn","button"),c.innerHTML=t.getAttribute("data-label")||"Disable readmode",c.addEventListener("click",function(){window.location.reload(!1)}),document.body.prepend(c),this.setState()}}},{key:"screenReader",value:function(){if(this.page.classList.contains("djacc-screen-reader")){this.removeState("sr"),this.page.classList.remove("djacc-screen-reader");var t,e=_createForOfIteratorHelper(document.body.querySelectorAll(".djacc-reader"));try{for(e.s();!(t=e.n()).done;){t.value.classList.remove("djacc-reader")}}catch(t){e.e(t)}finally{e.f()}window.speechSynthesis.cancel(),document.body.removeEventListener("click",this.handleScreenReaderClick,!0),document.body.removeEventListener("focus",this.handleScreenReaderClick,!0)}else this.addState("sr","screen-reader"),this.page.classList.add("djacc-screen-reader"),document.body.addEventListener("click",this.handleScreenReaderClick,!0),document.body.addEventListener("focus",this.handleScreenReaderClick,!0)}},{key:"screenReaderEvent",value:function(t,e){var n=t.target;if(n){var a=document.documentElement.getAttribute("lang"),i=n.innerText;if(i){var r,o=_createForOfIteratorHelper(document.body.querySelectorAll(".djacc-reader"));try{for(o.s();!(r=o.n()).done;){r.value.classList.remove("djacc-reader")}}catch(t){o.e(t)}finally{o.f()}window.speechSynthesis.cancel();var c=new SpeechSynthesisUtterance;n.classList.add("djacc-reader"),c.text=i,c.volume=e.speech_volume,c.rate=e.speech_rate,c.pitch=e.speech_pitch,a&&(c.lang=a),c.onend=function(t){setTimeout(function(){t.target.accElement.classList.remove("djacc-reader")},500)},c.accElement=n,window.speechSynthesis.speak(c)}}}},{key:"updateContrastElements",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=_createForOfIteratorHelper(this.getNodes());try{for(n.s();!(t=n.n()).done;){var a=t.value;e?a.classList.add("djacc-contrast"):a.classList.remove("djacc-contrast")}}catch(t){n.e(t)}finally{n.f()}}},{key:"updateLinks",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=_createForOfIteratorHelper(this.getNodes("links",function(t){return"A"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));try{for(n.s();!(t=n.n()).done;){var a=t.value;e?a.classList.add("djacc-link"):a.classList.remove("djacc-link")}}catch(t){n.e(t)}finally{n.f()}}},{key:"updateTitles",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=_createForOfIteratorHelper(this.getNodes("titles",function(t){switch(t.tagName){case"H1":case"H2":case"H3":case"H4":case"H5":return NodeFilter.FILTER_ACCEPT;default:return NodeFilter.FILTER_SKIP}}));try{for(n.s();!(t=n.n()).done;){var a=t.value;e?a.classList.add("djacc-title"):a.classList.remove("djacc-title")}}catch(t){n.e(t)}finally{n.f()}}},{key:"countClicks",value:function(t,e){t.classList.contains("djacc__arrows--active")||t.classList.add("djacc__arrows--active"),t.hasAttribute("data-djacc-count")||t.setAttribute("data-djacc-count",0);var n=t.getAttribute("data-djacc-count"),a=t.querySelector(".djacc__size");if("+"===e){t.setAttribute("data-djacc-count",++n);var i=100*(1+.1*n);a.innerHTML=parseInt(i)+"%"}else{t.setAttribute("data-djacc-count",--n);var r=100*(1+.1*n);a.innerHTML=parseInt(r)+"%"}return 0===n&&t.classList.remove("djacc__arrows--active"),t.getAttribute("data-djacc-count")}},{key:"zoomPage",value:function(t){t=parseInt(t);var e=void 0!==this.page.style.zoom;this.page;if(0!==t){var n=1+.1*t;this.addState("zoom",t),this.page.classList.add("djacc-zoom"),e?this.page.style.zoom=n:(this.page.style.transform="scale("+n+")",this.page.style.transformOrigin="center top",document.body.scrollLeft=(document.body.scrollWidth-document.body.clientWidth)/2)}else this.removeState("zoom"),this.page.classList.remove("djacc-zoom"),e?this.page.style.zoom="":(this.page.style.transform="",this.page.style.transformOrigin="")}},{key:"getCurrentStyle",value:function(t,e){return window.getComputedStyle(t).getPropertyValue(e)}},{key:"setTextData",value:function(t){for(var e=0,n=["font-size","line-height","letter-spacing"];e<n.length;e++){var a=n[e],i="data-djacc-"+a;if(!t.hasAttribute(i)){var r=this.getCurrentStyle(t,a);t.setAttribute(i,r)}}}},{key:"updateTextStyle",value:function(t,e){var n,a=this.getTextNodes(),i="data-djacc-"+t,r="djacc-"+t,o=t;if(0===(e=parseInt(e))?(this.removeState(t),this.page.classList.remove(r)):(this.addState(t,e),this.page.classList.add(r)),"font-size"===t?(o="fontSize",n="16px"):"line-height"===t?(o="lineHeight",n="16px"):"letter-spacing"===t&&(o="letterSpacing",n="1px"),a){var c,s=_createForOfIteratorHelper(a);try{for(s.s();!(c=s.n()).done;){var l=c.value;0!==e&&this.setTextData(l)}}catch(t){s.e(t)}finally{s.f()}var d,u=_createForOfIteratorHelper(a);try{for(u.s();!(d=u.n()).done;){var h=d.value,p=h.getAttribute(i);if(p)if(e>0||e<0){var f=1+.1*e,y=parseFloat(p);Number.isNaN(y)&&(y=parseFloat(n)),h.style[o]=(y*f).toFixed(2)+"px"}else h.style[o]=p}}catch(t){u.e(t)}finally{u.f()}}}},{key:"clearContrast",value:function(){var t;(this.page.classList.contains("djacc-dark-contrast")||this.page.classList.contains("djacc-light-contrast"))&&this.updateContrastElements();(t=this.page.classList).remove.apply(t,["djacc-invert-colors","djacc-monochrome","djacc-low-saturation","djacc-high-saturation","djacc-dark-contrast","djacc-light-contrast"]),this.page.style.filter=""}},{key:"clearClasses",value:function(){var t;this.clearContrast();(t=this.page.classList).remove.apply(t,["djacc-font-size","djacc-line-height","djacc-letter-spacing","djacc-zoom","djacc-highlight-links","djacc-highlight-titles"])}},{key:"getTextNodes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.body;if(t in this.textNodes)return this.textNodes[t];for(var n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,function(t){return"SCRIPT"===t.parentNode.tagName||"STYLE"===t.parentNode.tagName?NodeFilter.FILTER_SKIP:t.parentNode.closest(".djacc-container")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}),a=[];n.nextNode();){var i=n.currentNode;i.textContent.replace(/(\r\n|\n|\r|\t)/gm,"").trim().length&&a.push(i.parentNode)}return this.textNodes[t]=a,a}},{key:"getNodes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",e=arguments.length>1?arguments[1]:void 0;if(t in this.nodes)return this.nodes[t];e||(e=function(t){return 3===t.nodeType||8===t.nodeType?NodeFilter.FILTER_SKIP:t.closest(".djacc-container")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT});for(var n=document.createTreeWalker(document.body,NodeFilter.SHOW_ALL,e),a=[];n.nextNode();){var i=n.currentNode;a.push(i)}return this.nodes[t]=a,a}},{key:"getVersion",value:function(){return"dmVyc2lvbnBybw=="===this.options.version}},{key:"setVersion",value:function(){"dmVyc2lvbnBybw=="!==this.options.version&&(document.body.querySelector(".djacc__btn.djacc__btn--read-mode").remove(),document.body.querySelector(".djacc__btn.djacc__btn--screen-reader").remove())}},{key:"saveCookie",value:function(t){this.setCookie("dj-acc-cookie",JSON.stringify(t))}},{key:"removeCookie",value:function(){this.deleteCookie("dj-acc-cookie")}},{key:"getCookie",value:function(){return document.cookie.split("; ").reduce(function(t,e){var n=e.split("=");return"dj-acc-cookie"===n[0]?decodeURIComponent(n[1]):t},"")}},{key:"setCookie",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"/",i=new Date(Date.now()+864e5*n).toUTCString();document.cookie=t+"="+encodeURIComponent(e)+"; expires="+i+"; path="+a+"; SameSite=Lax"}},{key:"deleteCookie",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";this.setCookie(t,"",-1,e)}},{key:"isMobile",value:function(){var t=this.options.yootheme?getComputedStyle(document.body).getPropertyValue("--uk-breakpoint-s").slice(0,-2):this.options.breakpoint,e=parseInt(t);return window.innerWidth<=e}},{key:"isDesktop",value:function(){return!this.isMobile()}}]),t}();
     1"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _createForOfIteratorHelper(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,a=function(){};return{s:a,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){c=!0,r=t},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw r}}}}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function _regeneratorRuntime(){_regeneratorRuntime=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,a){var r=e&&e.prototype instanceof h?e:h,o=Object.create(r.prototype),c=new w(a||[]);return i(o,"_invoke",{value:j(t,n,c)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var u={};function h(){}function p(){}function y(){}var f={};s(f,r,function(){return this});var v=Object.getPrototypeOf,m=v&&v(v(T([])));m&&m!==e&&n.call(m,r)&&(f=m);var g=y.prototype=h.prototype=Object.create(f);function _(t){["next","throw","return"].forEach(function(e){s(t,e,function(t){return this._invoke(e,t)})})}function b(t,e){var a;i(this,"_invoke",{value:function(i,r){function o(){return new e(function(a,o){!function i(a,r,o,c){var s=d(t[a],t,r);if("throw"!==s.type){var l=s.arg,u=l.value;return u&&"object"==_typeof(u)&&n.call(u,"__await")?e.resolve(u.__await).then(function(t){i("next",t,o,c)},function(t){i("throw",t,o,c)}):e.resolve(u).then(function(t){l.value=t,o(l)},function(t){return i("throw",t,o,c)})}c(s.arg)}(i,r,a,o)})}return a=a?a.then(o,o):o()}})}function j(t,e,n){var i="suspendedStart";return function(a,r){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===a)throw r;return E()}for(n.method=a,n.arg=r;;){var o=n.delegate;if(o){var c=L(o,n);if(c){if(c===u)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var s=d(t,e,n);if("normal"===s.type){if(i=n.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(i="completed",n.method="throw",n.arg=s.arg)}}}function L(t,e){var n=e.method,i=t.iterator[n];if(void 0===i)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var a=d(i,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,u;var r=a.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:E}}function E(){return{value:void 0,done:!0}}return p.prototype=y,i(g,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:p,configurable:!0}),p.displayName=s(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(b.prototype),s(b.prototype,o,function(){return this}),t.AsyncIterator=b,t.async=function(e,n,i,a,r){void 0===r&&(r=Promise);var o=new b(l(e,n,i,a),r);return t.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},_(g),s(g,c,"Generator"),s(g,r,function(){return this}),s(g,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},t.values=T,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return o.type="throw",o.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],o=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var c=n.call(r,"catchLoc"),s=n.call(r,"finallyLoc");if(c&&s){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var r=a;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=t,o.arg=e,r?(this.method="next",this.next=r.finallyLoc,u):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var a=i.arg;S(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}function asyncGeneratorStep(t,e,n,i,a,r,o){try{var c=t[r](o),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(i,a)}function _asyncToGenerator(t){return function(){var e=this,n=arguments;return new Promise(function(i,a){var r=t.apply(e,n);function o(t){asyncGeneratorStep(r,i,a,o,c,"next",t)}function c(t){asyncGeneratorStep(r,i,a,o,c,"throw",t)}o(void 0)})}}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,_toPropertyKey(i.key),i)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _defineProperty(t,e,n){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var DJAccessibility=function(){function t(e){var n=this;_classCallCheck(this,t),_defineProperty(this,"handleScreenReaderClick",function(t){n.screenReaderEvent(t,n.options)});this.options=_objectSpread(_objectSpread({},{target:"#djacc",speech_pitch:1,speech_rate:1,speech_volume:1}),e),this.page=document.documentElement,this.state={},this.nodes={},this.textNodes={},this.initiated=!1,this.template={},this.template.current=this.options.layout,this.layout="desktop",this.position_type=this.options.position,"toolbar"==this.template.current?this.options.align_position=this.options.align_position_toolbar:this.options.align_position=this.options.align_position_popup,this.ver=this.getVersion(),this.init()}return _createClass(t,[{key:"init",value:function(){var t=this;document.addEventListener("DOMContentLoaded",function(){var e;(t.container=document.body.querySelector(".djacc"),t.container)&&(t.template.desktop=null===(e=t.container)||void 0===e?void 0:e.outerHTML);t.setLayout(),window.addEventListener("resize",function(e){t.setLayout()})})}},{key:"loadTemplate",value:function(){var t=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var n,i,a,r;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=new FormData,i="mobile"===e?this.options.mobile_layout:this.options.layout,this.options.ajax_action&&n.append("action",this.options.ajax_action),n.append("djacc_template",i),t.next=6,fetch(this.options.ajax_url,{method:"POST",credentials:"same-origin",body:n});case 6:return a=t.sent,t.next=9,a.text();case 9:if(r=t.sent,200!==a.status){t.next=12;break}return t.abrupt("return",r);case 12:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"setLayout",value:function(){var t=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.container&&this.options.layout==this.options.mobile_layout){t.next=10;break}if(this.template.desktop){t.next=5;break}return t.next=4,this.loadTemplate("desktop");case 4:this.template.desktop=t.sent;case 5:if(this.template.mobile){t.next=9;break}return t.next=8,this.loadTemplate("mobile");case 8:this.template.mobile=t.sent;case 9:this.isMobile()&&this.template.current===this.options.layout?(this.initiated=!1,this.layout="mobile",this.position_type=this.options.mobile_position,this.template.current=this.options.mobile_layout,this.setTemplate(this.template.mobile),this.initPanel()):this.isDesktop()&&this.template.current===this.options.mobile_layout&&(this.initiated=!1,this.layout="desktop",this.position_type=this.options.position,this.template.current=this.options.layout,this.setTemplate(this.template.desktop),this.initPanel());case 10:this.initiated||this.initPanel();case 11:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"setTemplate",value:function(t){"popup"==this.template.current&&this.options.space&&(document.body.style.paddingTop="",document.body.style.paddingLeft="",document.body.style.paddingRight="",document.body.style.paddingBottom=""),"popup"==this.template.current&&(this.options.align_position=this.options.align_position_popup),"toolbar"==this.template.current&&(this.options.align_position=this.options.align_position_toolbar),this.container&&this.container.remove(),document.body.insertAdjacentHTML("afterbegin",t),this.container=document.body.querySelector(".djacc")}},{key:"setPositionClass",value:function(t){var e="djacc--"+t.replace(" ","-");this.container.classList.contains(e)||(this.container.classList.remove("djacc--top-center","djacc--top-left","djacc--top-right","djacc--center-left","djacc--center-right","djacc--bottom-center","djacc--bottom-left","djacc--bottom-right"),this.container.classList.add(e))}},{key:"initPanel",value:function(){var t=this;t.container&&(t.initiated=!0,t.panel=t.container.querySelector(".djacc__panel"),t.registerEvents(),t.parseURL(),t.setVersion(),"custom"==t.position_type?t.setStaticPosition():(t.setFixedPosition(),t.setPanelSize(),t.setMobilePosition(),t.reserveSpace(),t.updateDirection(),window.addEventListener("resize",function(e){t.setPanelSize(),t.setMobilePosition(),t.reserveSpace()})),window.addEventListener("resize",function(e){t.updateDirection(),t.resizeTextStyles()}))}},{key:"parseURL",value:function(){if(window.location.hash){var t=window.location.hash.substring(1);t=(t=t.replaceAll(/[^A-Za-z0-9_-]+/g,"")).replace("djacc-","");var e=document.body.querySelector(".djacc__btn--"+t);e&&e.click()}}},{key:"setStaticPosition",value:function(){var t=this.options.target,e=document.body.querySelector(t);e&&(e.append(this.container),this.container.classList.remove("djacc--sticky"),this.container.classList.add("djacc--static"),this.container.classList.remove("djacc--hidden"),this.visible=!0)}},{key:"setFixedPosition",value:function(){"djacc"!=document.body.firstElementChild.className&&document.body.prepend(this.container),this.container.classList.remove("djacc--static"),this.container.classList.add("djacc--sticky"),this.container.classList.remove("djacc--hidden")}},{key:"addState",value:function(t,e){this.state[t]=e,this.saveCookie(this.state)}},{key:"removeState",value:function(t){delete this.state[t],0===Object.keys(this.state).length?this.removeCookie():this.saveCookie(this.state)}},{key:"setState",value:function(){var t=this.getCookie();if(t)for(var e in t=JSON.parse(t))if("contrast"===e||"links"===e||"titles"===e||"sr"===e){var n=t[e],i=document.body.querySelector(".djacc__btn.djacc__btn--"+n);i&&i.click()}else{var a=document.body.querySelector(".djacc__arrows.djacc__arrows--"+e);if(a)for(var r=t[e],o=a.querySelector(".djacc__inc"),c=a.querySelector(".djacc__dec"),s=0;s<Math.abs(r);s++)r<0?c.click():o.click()}}},{key:"setPanelSize",value:function(){if(!this.container.classList.contains("djacc--static")){var t,e=this.panel.getBoundingClientRect();if(this.container.classList.contains("djacc--bottom-left")||this.container.classList.contains("djacc--bottom-right")||this.container.classList.contains("djacc--bottom-center")){var n=window.screen.height-e.bottom;t=window.screen.height-n}else t=window.screen.height-e.top;t>0&&(this.container.classList.contains("djacc-toolbar")?this.panel.querySelector(".djacc__list").style.maxHeight=t+"px":this.panel.style.maxHeight=t+"px")}}},{key:"reserveSpace",value:function(){if(!this.container.classList.contains("djacc--static")&&this.container.classList.contains("djacc-toolbar")&&0!=this.options.space){var t=this.panel.querySelector(".djacc__list"),e=window.getComputedStyle(this.container),n=t.scrollWidth,i=parseInt(e.marginLeft),a=t.scrollHeight,r=parseInt(e.marginTop);this.container.classList.contains("djacc--center-left")?document.body.style.paddingLeft=n+i+"px":this.container.classList.contains("djacc--center-right")?document.body.style.paddingRight=n+i+"px":this.container.classList.contains("djacc--top-left")||this.container.classList.contains("djacc--top-right")||this.container.classList.contains("djacc--top-center")?document.body.style.paddingTop=a+r+"px":document.body.style.paddingBottom=a+r+"px"}}},{key:"updateDirection",value:function(){if(!this.container.classList.contains("djacc-toolbar")){var t=this.panel.getBoundingClientRect();(this.container.classList.contains("djacc--top-right")||this.container.classList.contains("djacc--bottom-right"))&&(t.left<0?this.container.classList.add("djacc--direction"):this.container.classList.contains("djacc--direction")&&this.container.classList.remove("djacc--direction")),(this.container.classList.contains("djacc--top-left")||this.container.classList.contains("djacc--bottom-left"))&&(window.innerWidth<t.right?this.container.classList.add("djacc--direction"):this.container.classList.contains("djacc--direction")&&this.container.classList.remove("djacc--direction"))}}},{key:"setMobilePosition",value:function(){if(!this.container.classList.contains("djacc--static")&&!this.container.classList.contains("djacc-toolbar")&&this.options.align_position_popup!=this.options.align_mobile_position){var t="djacc--"+this.options.align_position.replace(" ","-"),e="djacc--"+this.options.align_mobile_position.replace(" ","-");this.isMobile()?this.container.classList.contains(t)&&(this.container.classList.add(e),this.container.classList.remove(t)):this.container.classList.contains(e)&&(this.container.classList.add(t),this.container.classList.remove(e))}}},{key:"registerEvents",value:function(){var t=this,e=document.body.querySelector(".djacc__openbtn");e&&e.addEventListener("click",function(e){t.panel.classList.toggle("djacc__panel--active"),this.classList.toggle("djacc__openbtn--active"),t.page.classList.toggle("djacc-opened")});var n=function(t){if(t.classList.contains("djacc__btn--active"))t.classList.remove("djacc__btn--active");else{var e=_toConsumableArray(document.body.querySelectorAll(".djacc__item--contrast > .djacc__btn"));if(e){var n,i=_createForOfIteratorHelper(e);try{for(i.s();!(n=i.n()).done;){n.value.classList.remove("djacc__btn--active")}}catch(t){i.e(t)}finally{i.f()}}t.classList.add("djacc__btn--active")}},i=document.body.querySelector(".djacc__close");if(i&&(i.addEventListener("click",function(n){t.panel.classList.remove("djacc__panel--active"),e&&e.classList.remove("djacc__openbtn--active"),t.page.classList.remove("djacc-opened")}),!t.container.classList.contains("djacc--toolbar"))){var a=t.panel.querySelectorAll('button, [href], input, [tabindex="0"]'),r=a[0],o=a[a.length-1];r.addEventListener("keydown",function(t){"Tab"===t.key&&t.shiftKey&&setTimeout(function(){i.click(),e.focus()},300)}),o.addEventListener("keydown",function(t){"Tab"!==t.key||t.shiftKey||setTimeout(function(){i.click(),e.focus()},300)}),document.addEventListener("keyup",function(e){"Escape"!=e.key&&"Esc"!=e.key||!t.page.classList.contains("djacc-opened")||setTimeout(function(){i.click()},300)})}var c=document.body.querySelector(".djacc__reset");c&&c.addEventListener("click",function(e){var n=document.body.querySelectorAll(".djacc__item > .djacc__btn, .djacc__item > .djacc__arrows");if(n){var i,a=_createForOfIteratorHelper(n);try{for(a.s();!(i=a.n()).done;){i.value.classList.remove("djacc__btn--active","djacc__arrows--active")}}catch(t){a.e(t)}finally{a.f()}}var r=document.body.querySelectorAll(".djacc__size");if(r){var o,c=_createForOfIteratorHelper(r);try{for(c.s();!(o=c.n()).done;){var s=o.value;s.innerHTML="100%",s.parentNode.removeAttribute("data-djacc-count")}}catch(t){c.e(t)}finally{c.f()}}t.page.classList.contains("djacc-font-size")&&t.updateTextStyle("font-size",0),t.page.classList.contains("djacc-line-height")&&t.updateTextStyle("line-height",0),t.page.classList.contains("djacc-letter-spacing")&&t.updateTextStyle("letter-spacing",0),t.page.classList.contains("djacc-highlight-links")&&t.updateLinks(),t.page.classList.contains("djacc-highlight-titles")&&t.updateTitles(),t.page.classList.contains("djacc-screen-reader")&&t.screenReader(),t.page.style.filter="",t.page.style.zoom="",t.page.style.transform="",t.page.style.transformOrigin="",t.removeCookie(),t.clearClasses(),t.page.classList.contains("djacc-read-mode")&&window.location.reload(!1)});var s=document.body.querySelector(".djacc__btn.djacc__btn--invert-colors");s&&s.addEventListener("click",function(e){n(this),t.contrastInvert()});var l=document.body.querySelector(".djacc__btn.djacc__btn--monochrome");l&&l.addEventListener("click",function(e){n(this),t.contrastMono()});var d=document.body.querySelector(".djacc__btn.djacc__btn--low-saturation");d&&d.addEventListener("click",function(e){n(this),t.contrastLowSaturation()});var u=document.body.querySelector(".djacc__btn.djacc__btn--high-saturation");u&&u.addEventListener("click",function(e){n(this),t.contrastHighSaturation()});var h=document.body.querySelector(".djacc__btn.djacc__btn--dark-contrast");h&&h.addEventListener("click",function(e){n(this),t.contrastDark()});var p=document.body.querySelector(".djacc__btn.djacc__btn--light-contrast");p&&p.addEventListener("click",function(e){n(this),t.contrastLight()});var y=document.body.querySelector(".djacc__btn.djacc__btn--highlight-links");y&&y.addEventListener("click",function(e){this.classList.toggle("djacc__btn--active"),t.highlightLinks()});var f=document.body.querySelector(".djacc__btn.djacc__btn--highlight-titles");f&&f.addEventListener("click",function(e){this.classList.toggle("djacc__btn--active"),t.highlightTitles()});var v=document.body.querySelector(".djacc__btn.djacc__btn--read-mode");v&&v.addEventListener("click",function(e){this.classList.toggle("djacc__btn--active"),t.readMode(v)});var m=document.body.querySelector(".djacc__btn.djacc__btn--screen-reader");m&&("speechSynthesis"in window?m.addEventListener("click",function(e){e.stopPropagation(),this.classList.toggle("djacc__btn--active"),t.screenReader()}):m.remove());var g=document.body.querySelector(".djacc__arrows--zoom .djacc__inc");g&&g.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"+");t.zoomPage(n)});var _=document.body.querySelector(".djacc__arrows--zoom .djacc__dec");_&&_.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"-");t.zoomPage(n)});var b=document.body.querySelector(".djacc__arrows--font-size .djacc__inc");b&&b.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"+");t.updateTextStyle("font-size",n)});var j=document.body.querySelector(".djacc__arrows--font-size .djacc__dec");j&&j.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"-");t.updateTextStyle("font-size",n)});var L=document.body.querySelector(".djacc__arrows--line-height .djacc__inc");L&&L.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"+");t.updateTextStyle("line-height",n)});var k=document.body.querySelector(".djacc__arrows--line-height .djacc__dec");k&&k.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"-");t.updateTextStyle("line-height",n)});var S=document.body.querySelector(".djacc__arrows--letter-spacing .djacc__inc");S&&S.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"+");t.updateTextStyle("letter-spacing",n)});var w=document.body.querySelector(".djacc__arrows--letter-spacing .djacc__dec");w&&w.addEventListener("click",function(e){var n=t.countClicks(this.parentNode,"-");t.updateTextStyle("letter-spacing",n)}),this.setState()}},{key:"contrastInvert",value:function(){this.page.classList.contains("djacc-invert-colors")?(this.removeState("contrast"),this.page.classList.remove("djacc-invert-colors"),this.page.style.filter=""):(this.clearContrast(),this.addState("contrast","invert-colors"),this.page.classList.add("djacc-invert-colors"),this.page.style.filter="invert(100%)")}},{key:"contrastMono",value:function(){this.page.classList.contains("djacc-monochrome")?(this.removeState("contrast"),this.page.classList.remove("djacc-monochrome"),this.page.style.filter=""):(this.clearContrast(),this.addState("contrast","monochrome"),this.page.classList.add("djacc-monochrome"),this.page.style.filter="grayscale(100%)")}},{key:"contrastLowSaturation",value:function(){this.page.classList.contains("djacc-low-saturation")?(this.removeState("contrast"),this.page.classList.remove("djacc-low-saturation"),this.page.style.filter=""):(this.clearContrast(),this.addState("contrast","low-saturation"),this.page.classList.add("djacc-low-saturation"),this.page.style.filter="saturate(50%)")}},{key:"contrastHighSaturation",value:function(){this.page.classList.contains("djacc-high-saturation")?(this.removeState("contrast"),this.page.classList.remove("djacc-high-saturation"),this.page.style.filter=""):(this.clearContrast(),this.addState("contrast","high-saturation"),this.page.classList.add("djacc-high-saturation"),this.page.style.filter="saturate(200%)")}},{key:"contrastDark",value:function(){this.page.classList.contains("djacc-dark-contrast")?(this.removeState("contrast"),this.page.classList.remove("djacc-dark-contrast"),this.updateContrastElements()):(this.clearContrast(),this.addState("contrast","dark-contrast"),this.page.classList.add("djacc-dark-contrast"),this.updateContrastElements(1))}},{key:"contrastLight",value:function(){this.page.classList.contains("djacc-light-contrast")?(this.removeState("contrast"),this.page.classList.remove("djacc-light-contrast"),this.updateContrastElements()):(this.clearContrast(),this.addState("contrast","light-contrast"),this.page.classList.add("djacc-light-contrast"),this.updateContrastElements(1))}},{key:"highlightLinks",value:function(){this.page.classList.contains("djacc-highlight-links")?(this.removeState("links"),this.page.classList.remove("djacc-highlight-links"),this.updateLinks()):(this.addState("links","highlight-links"),this.page.classList.add("djacc-highlight-links"),this.updateLinks(1))}},{key:"highlightTitles",value:function(){this.page.classList.contains("djacc-highlight-titles")?(this.removeState("titles"),this.page.classList.remove("djacc-highlight-titles"),this.updateTitles()):(this.addState("titles","highlight-titles"),this.page.classList.add("djacc-highlight-titles"),this.updateTitles(1))}},{key:"readMode",value:function(t){if(this.page.classList.contains("djacc-read-mode"))window.location.reload(!1);else{this.page.classList.add("djacc-read-mode");var e,n=_createForOfIteratorHelper(document.body.querySelectorAll("nav, header, footer, aside, iframe, canvas, img, form, [uk-modal], [uk-sticky], .uk-slider"));try{for(n.s();!(e=n.n()).done;){var i=e.value;i.contains(self.container)||i.remove()}}catch(t){n.e(t)}finally{n.f()}var a,r=_createForOfIteratorHelper(this.getNodes("readmode"));try{for(r.s();!(a=r.n()).done;){var o=a.value;o.removeAttribute("style"),o.removeAttribute("id"),o.removeAttribute("class"),o.removeAttribute("uk-scrollspy"),o.removeAttribute("uk-grid"),o.removeAttribute("uk-img"),o.removeAttribute("uk-parallax"),o.removeAttribute("uk-scrollspy-class"),o.removeAttribute("uk-filter")}}catch(t){r.e(t)}finally{r.f()}var c=document.createElement("button");c.classList.add("djacc-readmode-disable","btn","button"),c.innerHTML=t.getAttribute("data-label")||"Disable readmode",c.addEventListener("click",function(){window.location.reload(!1)}),document.body.prepend(c),this.setState()}}},{key:"screenReader",value:function(){if(this.page.classList.contains("djacc-screen-reader")){this.removeState("sr"),this.page.classList.remove("djacc-screen-reader");var t,e=_createForOfIteratorHelper(document.body.querySelectorAll(".djacc-reader"));try{for(e.s();!(t=e.n()).done;){t.value.classList.remove("djacc-reader")}}catch(t){e.e(t)}finally{e.f()}window.speechSynthesis.cancel(),document.body.removeEventListener("click",this.handleScreenReaderClick,!0),document.body.removeEventListener("focus",this.handleScreenReaderClick,!0)}else this.addState("sr","screen-reader"),this.page.classList.add("djacc-screen-reader"),document.body.addEventListener("click",this.handleScreenReaderClick,!0),document.body.addEventListener("focus",this.handleScreenReaderClick,!0)}},{key:"screenReaderEvent",value:function(t,e){var n=t.target;if(n){var i=document.documentElement.getAttribute("lang"),a=n.innerText;if(a){var r,o=_createForOfIteratorHelper(document.body.querySelectorAll(".djacc-reader"));try{for(o.s();!(r=o.n()).done;){r.value.classList.remove("djacc-reader")}}catch(t){o.e(t)}finally{o.f()}window.speechSynthesis.cancel();var c=new SpeechSynthesisUtterance;n.classList.add("djacc-reader"),c.text=a,c.volume=e.speech_volume,c.rate=e.speech_rate,c.pitch=e.speech_pitch,i&&(c.lang=i),c.onend=function(t){setTimeout(function(){t.target.accElement.classList.remove("djacc-reader")},500)},c.accElement=n,window.speechSynthesis.speak(c)}}}},{key:"updateContrastElements",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=_createForOfIteratorHelper(this.getNodes());try{for(n.s();!(t=n.n()).done;){var i=t.value;e?i.classList.add("djacc-contrast"):i.classList.remove("djacc-contrast")}}catch(t){n.e(t)}finally{n.f()}}},{key:"updateLinks",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=_createForOfIteratorHelper(this.getNodes("links",function(t){return"A"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));try{for(n.s();!(t=n.n()).done;){var i=t.value;e?i.classList.add("djacc-link"):i.classList.remove("djacc-link")}}catch(t){n.e(t)}finally{n.f()}}},{key:"updateTitles",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=_createForOfIteratorHelper(this.getNodes("titles",function(t){switch(t.tagName){case"H1":case"H2":case"H3":case"H4":case"H5":return NodeFilter.FILTER_ACCEPT;default:return NodeFilter.FILTER_SKIP}}));try{for(n.s();!(t=n.n()).done;){var i=t.value;e?i.classList.add("djacc-title"):i.classList.remove("djacc-title")}}catch(t){n.e(t)}finally{n.f()}}},{key:"countClicks",value:function(t,e){t.classList.contains("djacc__arrows--active")||t.classList.add("djacc__arrows--active"),t.hasAttribute("data-djacc-count")||t.setAttribute("data-djacc-count",0);var n=t.getAttribute("data-djacc-count"),i=t.querySelector(".djacc__size");if("+"===e){t.setAttribute("data-djacc-count",++n);var a=100*(1+.1*n);i.innerHTML=parseInt(a)+"%"}else{t.setAttribute("data-djacc-count",--n);var r=100*(1+.1*n);i.innerHTML=parseInt(r)+"%"}return 0===n&&t.classList.remove("djacc__arrows--active"),t.getAttribute("data-djacc-count")}},{key:"zoomPage",value:function(t){t=parseInt(t);var e=void 0!==this.page.style.zoom;this.page;if(0!==t){var n=1+.1*t;this.addState("zoom",t),this.page.classList.add("djacc-zoom"),e?this.page.style.zoom=n:(this.page.style.transform="scale("+n+")",this.page.style.transformOrigin="center top",document.body.scrollLeft=(document.body.scrollWidth-document.body.clientWidth)/2)}else this.removeState("zoom"),this.page.classList.remove("djacc-zoom"),e?this.page.style.zoom="":(this.page.style.transform="",this.page.style.transformOrigin="")}},{key:"getCurrentStyle",value:function(t,e){return window.getComputedStyle(t).getPropertyValue(e)}},{key:"toCamelCase",value:function(t){return t.replace(/-([a-z])/g,function(t,e){return e.toUpperCase()})}},{key:"setTextData",value:function(t,e){var n="data-djacc-"+t;if(!e.hasAttribute(n)){var i=this.getCurrentStyle(e,t);e.setAttribute(n,i),e.style[this.toCamelCase(t)]&&e.setAttribute(n+"-inline",1)}}},{key:"updateTextStyle",value:function(t,e,n){var i,a=this.getTextNodes(),r="data-djacc-"+t,o=r+"-inline",c="djacc-"+t,s=this.toCamelCase(t);if(0===(e=parseInt(e))?(this.removeState(t),this.page.classList.remove(c)):(this.addState(t,e),this.page.classList.add(c)),"font-size"===t?i="16px":"line-height"===t?i="16px":"letter-spacing"===t&&(i="1px"),a){var l,d=_createForOfIteratorHelper(a);try{for(d.s();!(l=d.n()).done;){var u=l.value;0!==e&&this.setTextData(t,u);var h=u.getAttribute(r);if(h){var p=u.getAttribute(o);if(e>0||e<0){var y=1+.1*e,f=parseFloat(h);Number.isNaN(f)&&(f=parseFloat(i)),u.style[s]=(f*y).toFixed(2)+"px"}else n||!p?(u.style[s]="",u.removeAttribute(r)):u.style[s]=h}}}catch(t){d.e(t)}finally{d.f()}}}},{key:"resizeTextStyles",value:function(){var t=this,e=this.getCookie();e=!!e&&JSON.parse(e);var n=document.querySelector("[data-djacc-font-size]");(t.page.classList.contains("djacc-font-size")||n)&&(t.updateTextStyle("font-size",0),e&&e["font-size"]&&setTimeout(function(){t.updateTextStyle("font-size",e["font-size"])},50));var i=document.querySelector("[data-djacc-line-height]");(t.page.classList.contains("djacc-line-height")||i)&&(t.updateTextStyle("line-height",0),e&&e["line-height"]&&setTimeout(function(){t.updateTextStyle("line-height",e["line-height"])},50));var a=document.querySelector("[data-djacc-letter-spacing]");(t.page.classList.contains("djacc-letter-spacing")||a)&&(t.updateTextStyle("letter-spacing",0),e&&e["letter-spacing"]&&setTimeout(function(){t.updateTextStyle("letter-spacing",e["letter-spacing"])},50))}},{key:"clearContrast",value:function(){var t;(this.page.classList.contains("djacc-dark-contrast")||this.page.classList.contains("djacc-light-contrast"))&&this.updateContrastElements();(t=this.page.classList).remove.apply(t,["djacc-invert-colors","djacc-monochrome","djacc-low-saturation","djacc-high-saturation","djacc-dark-contrast","djacc-light-contrast"]),this.page.style.filter=""}},{key:"clearClasses",value:function(){var t;this.clearContrast();(t=this.page.classList).remove.apply(t,["djacc-font-size","djacc-line-height","djacc-letter-spacing","djacc-zoom","djacc-highlight-links","djacc-highlight-titles"])}},{key:"getTextNodes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.body;if(t in this.textNodes)return this.textNodes[t];for(var n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,function(t){return"SCRIPT"===t.parentNode.tagName||"STYLE"===t.parentNode.tagName?NodeFilter.FILTER_SKIP:t.parentNode.closest(".djacc-container")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}),i=[];n.nextNode();){var a=n.currentNode;a.textContent.replace(/(\r\n|\n|\r|\t)/gm,"").trim().length&&i.push(a.parentNode)}return this.textNodes[t]=i,i}},{key:"getNodes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",e=arguments.length>1?arguments[1]:void 0;if(t in this.nodes)return this.nodes[t];e||(e=function(t){return 3===t.nodeType||8===t.nodeType?NodeFilter.FILTER_SKIP:t.closest(".djacc-container")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT});for(var n=document.createTreeWalker(document.body,NodeFilter.SHOW_ALL,e),i=[];n.nextNode();){var a=n.currentNode;i.push(a)}return this.nodes[t]=i,i}},{key:"getVersion",value:function(){return"dmVyc2lvbnBybw=="===this.options.version}},{key:"setVersion",value:function(){"dmVyc2lvbnBybw=="!==this.options.version&&(document.body.querySelector(".djacc__btn.djacc__btn--read-mode").remove(),document.body.querySelector(".djacc__btn.djacc__btn--screen-reader").remove())}},{key:"saveCookie",value:function(t){this.setCookie("dj-acc-cookie",JSON.stringify(t))}},{key:"removeCookie",value:function(){this.deleteCookie("dj-acc-cookie")}},{key:"getCookie",value:function(){return document.cookie.split("; ").reduce(function(t,e){var n=e.split("=");return"dj-acc-cookie"===n[0]?decodeURIComponent(n[1]):t},"")}},{key:"setCookie",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"/",a=new Date(Date.now()+864e5*n).toUTCString();document.cookie=t+"="+encodeURIComponent(e)+"; expires="+a+"; path="+i+"; SameSite=Lax"}},{key:"deleteCookie",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";this.setCookie(t,"",-1,e)}},{key:"isMobile",value:function(){var t=this.options.yootheme&&!this.options.breakpoint?getComputedStyle(document.body).getPropertyValue("--uk-breakpoint-s").slice(0,-2):this.options.breakpoint+"px",e=parseInt(t);return window.innerWidth<=e}},{key:"isDesktop",value:function(){return!this.isMobile()}}]),t}();
  • dj-accessibility/trunk/module/assets/json/fconfig.json

    r3028285 r3429587  
    2525                "djacc_mobile_position": {
    2626                    "type": "select",
    27                     "label": "Position type",
     27                    "label": "Mobile position type",
    2828                    "options": {
    2929                        "Sticky (fixed)": "sticky",
  • dj-accessibility/trunk/readme.txt

    r3028285 r3429587  
    44Requires at least: 5.5
    55Requires PHP: 5.6
    6 Tested up to: 6.4.2
    7 Stable tag: 1.11
     6Tested up to: 6.9
     7Stable tag: 1.14
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838
    3939== Changelog ==
     40= 1.15 =
     41(+) Added possibility to disable displaying plugin on mobile devices
     42(+) Added option to change mobile breakpoint resolution
     43
     44= 1.14 =
     45(+) Added Italian language pack (Joomla!)
     46(+) Added Greece language pack (Joomla!)
     47(!) Fixed missleading label in Yootheme related to mobile position type
     48(!) Fixed the problem with wrong button custom image path (WordPress)
     49
     50= 1.13 =
     51(!) Fixed deprecated warning related to htmlspecialchars on PHP8 (Joomla!)
     52(!) Font sizes are now recalculated when windows size changes
     53(!) JavaScript optimizations
    4054
    4155= 1.12 =
  • dj-accessibility/trunk/tmpl/default.php

    r3028285 r3429587  
    77$directionParam = DJAcc::getParam('direction', 'top left');
    88$align = ( 'custom' == $positionParam ) ? ' djacc--' . str_replace(' ', '-', $directionParam) : ' djacc--' . str_replace(' ', '-', $alignParam);
    9 $customBtn = DJAcc::getParam('image', false);
     9$customBtn = DJAcc::getImage('image', false);
    1010$custom_links = (array) DJAcc::getParam('custom_links');
    1111?>
Note: See TracChangeset for help on using the changeset viewer.