/home/silvwabw/public_html/wp-content/plugins/gutenverse/assets/js/frontend/accordion.js
(()=>{"use strict";var t={};function e(t){return e="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},e(t)}function n(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}function o(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const a=gutenverseCoreFrontend,c=window.animejs;var u=t.n(c);function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(s=function(){return!!t})()}var f=function(t){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),t=this,i=arguments,o=r(o=n),function(t,n){if(n&&("object"==e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,s()?Reflect.construct(o,i||[],r(t).constructor):o.apply(t,i));var t,o,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(n,t),c=n,f=[{key:"init",value:function(){var t=this;this._elements.map(function(e){t._accordionItems(e)})}},{key:"_accordionItems",value:function(t){var e=(0,a.u)(t),n={accordions:e.find(".accordion-item"),headingItems:e.find(".accordion-item").find(".accordion-heading"),bodyItems:e.find(".accordion-item").find(".accordion-body")};this._addClickEvents(n)}},{key:"_animate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.map(function(t){var n=(0,a.u)(t),o=n.find(".accordion-body .accordion-content").size(),r=n.find(".accordion-body");n.hasClass("active")?u()({targets:r.first(),height:o.height,duration:500,easing:"easeOutCubic"}).finished.finally(function(){r.addClass("expanded"),r.attr("style","")}):(e&&r.addClass("closed"),u()({targets:r.first(),height:"0",duration:500,easing:"easeOutCubic"}).finished.finally(function(){e&&r.removeClass("closed"),r.attr("style","")}))})}},{key:"_addClickEvents",value:function(t){var e=t.accordions,n=t.headingItems,o=t.bodyItems,r=this;r._animate(e,!1),(0,a.u)(n).on("click",function(t){var n=(0,a.u)(t.currentTarget).parent();o.map(function(t){var e=(0,a.u)(t);if(e.hasClass("expanded")){var n=e.find(".accordion-content").size();e.attr("style","height: ".concat(n.height,"px")),e.removeClass("expanded")}}),e.map(function(t){var e=(0,a.u)(t);return e.is(n)&&!e.hasClass("active")?e.addClass("active"):e.removeClass("active")}),r._animate(e,!0)})}}],f&&o(c.prototype,f),Object.defineProperty(c,"prototype",{writable:!1}),c;var c,f}(a.Default),l=(0,a.u)(".guten-accordions");l&&new f(l)})();