!function(n){"use strict";class t extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{container:".elementor-column-wrap",content:".elementor-widget-wrap"},classes:{isActive:"tm-collapsible--active",isOpen:"tm-collapsible--open"},speed:300,prevDevice:""}}getDefaultElements(){var e=this.getSettings("selectors");return{$container:this.findElement(e.container),$content:this.findElement(e.content)}}toggle(e){var t=this.getElementSettings(),s=elementorFrontend.getCurrentDeviceMode(),n=t.tm_collapsible_on;t.prevDevice!==s&&(-1!==n.indexOf(s)?!0===e?this.reactivate():this.activate():this.deactivate()),t.prevDevice=s}activate(){var e=this.getElementSettings(),t=this.getSettings("classes");this.$element.addClass(t.isActive),"open"===e.tm_collapsible_status&&this.$element.hasClass(t.isActive)?(this.elements.$content.show(),this.$element.addClass(t.isOpen)):(this.elements.$content.hide(),this.$element.removeClass(t.isOpen))}deactivate(){var e=this.getSettings("classes");this.$element.removeClass(e.isActive),this.$element.removeClass(e.isOpen),this.elements.$content.show()}reactivate(){this.deactivate(),this.activate()}onElementChange(e){-1!==["collapsible","collapsible_on","tm_collapsible_status"].indexOf(e)&&this.toggle(!0)}bindEvents(){var e,t=this,s=this.getElementSettings();void 0!==s.tm_collapsible&&"yes"===s.tm_collapsible&&(e=window.innerWidth,elementorFrontend.elements.$window.on("resize",function(){e!=window.innerWidth&&t.toggle(),e=window.innerWidth}))}generateHeading(){var e=this.getElementSettings(),t=e.tm_collapsible_title,e=e.tm_collapsible_title_size,s=this.$element.find(".tm-collapsible__title"),s=(s.length&&s.remove(),n(document.createElement(e)));s.addClass("tm-collapsible__title").removeClass("has-text"),void 0!==t&&t&&s.addClass("has-text").text(t),this.elements.$container.prepend(s)}onInit(){super.onInit();var e=this.getElementSettings();if(void 0!==e.tm_collapsible&&"yes"===e.tm_collapsible){this.isEdit&&this.$element.addClass("elementor-column__tm-collapsible");const t=this.getSettings(),s=this.getSettings("classes");this.generateHeading(),this.toggle(),this.$element.find(".tm-collapsible__title").on("click",e=>{if(!this.$element.hasClass(s.isActive))return!1;e.preventDefault(),this.$element.toggleClass(s.isOpen),this.elements.$content.slideToggle(t.speed)})}else this.deactivate()}}n(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/column",e=>{elementorFrontend.elementsHandler.addHandler(t,{$element:e})})})}(jQuery);