1"use strict"; 2 3function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 4function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 5function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 6function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } 7function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 8function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 9; 10function haObserveTarget(target, callback) { 11 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 12 var observer = new IntersectionObserver(function (entries, observer) { 13 entries.forEach(function (entry) { 14 if (entry.isIntersecting) { 15 callback(entry); 16 } 17 }); 18 }, options); 19 observer.observe(target); 20} 21(function ($) { 22 'use strict'; 23 24 var $window = $(window); 25 $.fn.getHappySettings = function () { 26 return this.data('happy-settings'); 27 }; 28 function debounce(func, wait, immediate) { 29 var timeout; 30 return function () { 31 var context = this, 32 args = arguments; 33 var later = function later() { 34 timeout = null; 35 if (!immediate) func.apply(context, args); 36 }; 37 var callNow = immediate && !timeout; 38 clearTimeout(timeout); 39 timeout = setTimeout(later, wait); 40 if (callNow) func.apply(context, args); 41 }; 42 } 43 function initFilterNav($scope, filterFn) { 44 var $filterNav = $scope.find('.hajs-filter'), 45 defaultFilter = $filterNav.data('default-filter'); 46 if ($filterNav.length) { 47 $filterNav.on('click.onFilterNav', 'button', function (event) { 48 event.stopPropagation(); 49 var $current = $(this); 50 $current.addClass('ha-filter__item--active').siblings().removeClass('ha-filter__item--active'); 51 filterFn($current.data('filter')); 52 }); 53 $filterNav.find('[data-filter="' + defaultFilter + '"]').click(); 54 } 55 } 56 57 /** 58 * Initialize magnific lighbox gallery 59 * 60 * @param {$element, selector, isEnabled, key} settings 61 */ 62 function initPopupGallery(settings) { 63 settings.$element.on('click', settings.selector, function (event) { 64 event.preventDefault(); 65 }); 66 if (!$.fn.magnificPopup) { 67 return; 68 } 69 if (!settings.isEnabled) { 70 $.magnificPopup.close(); 71 return; 72 } 73 var windowWidth = $(window).width(), 74 mobileWidth = elementorFrontendConfig.breakpoints.md, 75 tabletWidth = elementorFrontendConfig.breakpoints.lg; 76 settings.$element.find(settings.selector).magnificPopup({ 77 key: settings.key, 78 type: 'image', 79 image: { 80 titleSrc: function titleSrc(item) { 81 return item.el.attr('title') ? item.el.attr('title') : item.el.find('img').attr('alt'); 82 } 83 }, 84 gallery: { 85 enabled: true, 86 preload: [1, 2] 87 }, 88 zoom: { 89 enabled: true, 90 duration: 300, 91 easing: 'ease-in-out', 92 opener: function opener(openerElement) { 93 return openerElement.is('img') ? openerElement : openerElement.find('img'); 94 } 95 }, 96 disableOn: function disableOn() { 97 if (settings.disableOnMobile && windowWidth < mobileWidth) { 98 return false;
99 } 100 if (settings.disableOnTablet && windowWidth >= mobileWidth && windowWidth < tabletWidth) { 101 return false; 102 } 103 return true; 104 } 105 }); 106 } 107 var HandleImageCompare = function HandleImageCompare($scope) { 108 var $item = $scope.find('.hajs-image-comparison'), 109 settings = $item.getHappySettings(), 110 fieldMap = { 111 on_hover: 'move_slider_on_hover', 112 on_swipe: 'move_with_handle_only', 113 on_click: 'click_to_move' 114 }; 115 settings[fieldMap[settings.move_handle || 'on_swipe']] = true; 116 delete settings.move_handle; 117 $item.imagesLoaded().done(function () { 118 $item.twentytwenty(settings); 119 var t = setTimeout(function () { 120 $window.trigger('resize.twentytwenty'); 121 clearTimeout(t); 122 }, 400); 123 }); 124 }; 125 $window.on('elementor/frontend/init', function () { 126 var ModuleHandler = elementorModules.frontend.handlers.Base; 127 var SliderBase = ModuleHandler.extend({ 128 bindEvents: function bindEvents() { 129 this.removeArrows(); 130 this.run(); 131 }, 132 removeArrows: function removeArrows() { 133 var _this = this; 134 this.elements.$container.on('init', function () { 135 _this.elements.$container.siblings().hide(); 136 }); 137 }, 138 getDefaultSettings: function getDefaultSettings() { 139 return { 140 autoplay: true, 141 arrows: false, 142 checkVisible: false, 143 container: '.hajs-slick', 144 dots: false, 145 infinite: true, 146 rows: 0, 147 slidesToShow: 1, 148 prevArrow: $('<div />').append(this.findElement('.slick-prev').clone().show()).html(), 149 nextArrow: $('<div />').append(this.findElement('.slick-next').clone().show()).html() 150 }; 151 }, 152 getDefaultElements: function getDefaultElements() { 153 return { 154 $container: this.findElement(this.getSettings('container')) 155 }; 156 }, 157 onElementChange: debounce(function () { 158 this.elements.$container.slick('unslick'); 159 this.run(); 160 }, 200), 161 getSlickSettings: function getSlickSettings() { 162 var $rtl = $('html[dir="rtl"]').length == 1 || $('body').hasClass('rtl'); 163 if ('yes' == this.getElementSettings('vertical')) { 164 $rtl = false; // for vertical direction rtl is off 165 } 166 167 // Determine if the widget has the 'ha-slider' class 168 var isHaSlider = this.$element.hasClass('ha-slider'); 169 170 // Generate the settings object 171 var settings = { 172 fade: isHaSlider ? this.getElementSettings('slides_transition') === 'fade' : this.getElementSettings('slides_transition') === 'fade' && parseInt(this.getElementSettings('slides_to_show')) === 1, 173 infinite: !!this.getElementSettings('loop'), 174 autoplay: !!this.getElementSettings('autoplay'), 175 autoplaySpeed: this.getElementSettings('autoplay_speed'), 176 speed: this.getElementSettings('animation_speed'), 177 centerMode: !!this.getElementSettings('center'), 178 vertical: !!this.getElementSettings('vertical'), 179 // slidesToScroll: 1, 180 rtl: $rtl 181 }; 182 switch (this.getElementSettings('navigation')) { 183 case 'arrow': 184 settings.arrows = true; 185 break; 186 case 'dots': 187 settings.dots = true; 188 break; 189 case 'both': 190 settings.arrows = true; 191 settings.dots = true; 192 break; 193 } 194 var slides_to_scroll = !!this.getElementSettings('slides_to_scroll'); 195 settings.slidesToShow = parseInt(this.getElementSettings('slides_to_show')) || 1; 196 settings.slidesToScroll = slides_to_scroll ? parseInt(this.getElementSettings('slides_to_show')) || 1 : 1; 197 settings.responsive = [{ 198 breakpoint: elementorFrontend.config.breakpoints.lg, 199 settings: { 200 slidesToShow: parseInt(this.getElementSettings('slides_to_show_tablet')) || settings.slidesToShow, 201 slidesToScroll: slides_to_scroll ? parseInt(this.getElementSettings('slides_to_show_tablet')) || settings.slidesToShow : 1 202 } 203 }, { 204 breakpoint: elementorFrontend.config.breakpoints.md, 205 settings: { 206 slidesToShow: parseInt(this.getElementSettings('slides_to_show_mobile')) || parseInt(this.getElementSettings('slides_to_show_tablet')) || settings.slidesToShow, 207 slidesToScroll: slides_to_scroll ? parseInt(this.getElementSettings('slides_to_show_mobile')) || parseInt(this.getElementSettings('slides_to_show_tablet')) || settings.slidesToShow : 1 208 } 209 }]; 210 return $.extend({}
210, this.getSettings(), settings); 211 }, 212 run: function run() { 213 this.elements.$container.slick(this.getSlickSettings()); 214 } 215 }); 216 var NumberHandler = function NumberHandler($scope) { 217 haObserveTarget($scope[0], function () { 218 var $number = $scope.find('.ha-number-text'); 219 $number.numerator($number.data('animation')); 220 }); 221 }; 222 var SkillHandler = function SkillHandler($scope) { 223 haObserveTarget($scope[0], function () { 224 $scope.find('.ha-skill-level').each(function () { 225 var $current = $(this), 226 $lt = $current.find('.ha-skill-level-text'), 227 lv = $current.data('level'); 228 $current.animate({ 229 width: lv + '%' 230 }, 500); 231 $lt.numerator({ 232 toValue: lv + '%', 233 duration: 1300, 234 onStep: function onStep() { 235 $lt.append('%'); 236 } 237 }); 238 }); 239 }); 240 }; 241 var ImageGrid = ModuleHandler.extend({ 242 onInit: function onInit() { 243 ModuleHandler.prototype.onInit.apply(this, arguments); 244 this.run(); 245 this.runFilter(); 246 $window.on('resize', debounce(this.run.bind(this), 100)); 247 }, 248 getLayoutMode: function getLayoutMode() { 249 var layout = this.getElementSettings('layout'); 250 return layout === 'even' ? 'masonry' : layout; 251 }, 252 getDefaultSettings: function getDefaultSettings() { 253 return { 254 itemSelector: '.ha-image-grid__item', 255 percentPosition: true, 256 layoutMode: this.getLayoutMode() 257 }; 258 }, 259 getDefaultElements: function getDefaultElements() { 260 return { 261 $container: this.findElement('.hajs-isotope') 262 }; 263 }, 264 getLightBoxSettings: function getLightBoxSettings() { 265 return { 266 key: 'imagegrid', 267 $element: this.$element, 268 selector: '.ha-js-lightbox', 269 isEnabled: !!this.getElementSettings('enable_popup'), 270 disableOnTablet: !!this.getElementSettings('disable_lightbox_on_tablet'), 271 disableOnMobile: !!this.getElementSettings('disable_lightbox_on_mobile') 272 }; 273 }, 274 runFilter: function runFilter() { 275 var self = this, 276 lbSettings = this.getLightBoxSettings(); 277 initFilterNav(this.$element, function (filter) { 278 self.elements.$container.isotope({ 279 filter: filter 280 }); 281 if (filter !== '*') { 282 lbSettings.selector = filter; 283 } 284 initPopupGallery(lbSettings); 285 }); 286 }, 287 onElementChange: function onElementChange(changedProp) { 288 if (['layout', 'image_height', 'columns', 'image_margin', 'enable_popup'].indexOf(changedProp) !== -1) { 289 this.run(); 290 } 291 }, 292 run: function run() { 293 var self = this; 294 self.elements.$container.isotope(self.getDefaultSettings()).imagesLoaded().progress(function () { 295 self.elements.$container.isotope('layout'); 296 }); 297 initPopupGallery(self.getLightBoxSettings()); 298 } 299 }); 300 var JustifiedGrid = ModuleHandler.extend({ 301 onInit: function onInit() { 302 ModuleHandler.prototype.onInit.apply(this, arguments); 303 this.run(); 304 this.runFilter(); 305 $window.on('resize', debounce(this.run.bind(this), 100)); 306 }, 307 getDefaultSettings: function getDefaultSettings() { 308 var $defaultSettings = { 309 rowHeight: +this.getElementSettings('row_height.size') || 150, 310 lastRow: this.getElementSettings('last_row'), 311 margins: +this.getElementSettings('margins.size'), 312 captions: !!this.getElementSettings('show_caption') 313 }; 314 var $maxRowHeight = {}; 315 if ('yes' == this.getElementSettings('max_row_height')) { 316 $maxRowHeight = { 317 maxRowHeight: +this.getElementSettings('row_height.size') || 150 318 }; 319 } 320 return $.extend($defaultSettings, $maxRowHeight); 321 }, 322 getDefaultElements: function getDefaultElements() { 323 return { 324 $container: this.findElement('.hajs-justified-grid') 325 }; 326 }, 327 getLightBoxSettings: function getLightBoxSettings() { 328 return { 329 key: 'justifiedgallery', 330 $element: this.$element, 331 selector: '.ha-js-lightbox', 332 isEnabled: !!this.getElementSettings('enable_popup'), 333 disableOnTablet: !!this.getElementSettings('disable_lightbox_on_tablet'), 334 disableOnMobile: !!this.getElementSettings('disable_lightbox_on_mobile') 335 }; 336 }, 337 runFilter: function runFilter() { 338 var self = this, 339 lbSettings = this.getLightBoxSettings(), 340 settings = { 341 lastRow: this.getElementSettings('last_row') 342 }; 343 initFilterNav(self.$element, function (filter) { 344 if (filter !== '*') { 345 settings.lastRow = 'nojustify'; 346 lbSettings.selector = filter; 347 }
348 settings.filter = filter; 349 self.elements.$container.justifiedGallery(settings); 350 initPopupGallery(lbSettings); 351 }); 352 }, 353 onElementChange: function onElementChange(changedProp) { 354 if (['row_height', 'max_row_height', 'last_row', 'margins', 'show_caption', 'enable_popup'].indexOf(changedProp) !== -1) { 355 this.run(); 356 } 357 }, 358 run: function run() { 359 this.elements.$container.justifiedGallery(this.getDefaultSettings()); 360 initPopupGallery(this.getLightBoxSettings()); 361 } 362 }); 363 364 // NewsTicker 365 var NewsTicker = ModuleHandler.extend({ 366 onInit: function onInit() { 367 ModuleHandler.prototype.onInit.apply(this, arguments); 368 this.wrapper = this.$element.find('.ha-news-ticker-wrapper'); 369 this.run(); 370 }, 371 onElementChange: function onElementChange(changed_prop) { 372 if (changed_prop === 'item_space' || changed_prop === 'title_typography_font_size') { 373 this.run(); 374 } 375 }, 376 run: function run() { 377 if (0 == this.wrapper.length) { 378 return; 379 } 380 var wrapper_height = this.wrapper.innerHeight(), 381 wrapper_width = this.wrapper.innerWidth(), 382 container = this.wrapper.find('.ha-news-ticker-container'), 383 single_item = container.find('.ha-news-ticker-item'), 384 scroll_direction = this.wrapper.data('scroll-direction'), 385 scroll = "scroll" + scroll_direction + parseInt(wrapper_height) + parseInt(wrapper_width), 386 duration = this.wrapper.data('duration'), 387 direction = 'normal', 388 all_title_width = 10; 389 var start = { 390 'transform': 'translateX(0' + wrapper_width + 'px)' 391 }, 392 end = { 393 'transform': 'translateX(-101%)' 394 }; 395 if ('right' === scroll_direction) { 396 direction = 'reverse'; 397 } 398 single_item.each(function () { 399 all_title_width += $(this).outerWidth(true); 400 }); 401 container.css({ 402 'width': all_title_width, 403 'display': 'flex' 404 }); 405 $.keyframe.define([{ 406 name: scroll, 407 '0%': start, 408 '100%': end 409 }]); 410 container.playKeyframe({ 411 name: scroll, 412 duration: duration.toString() + "ms", 413 timingFunction: 'linear', 414 delay: '0s', 415 iterationCount: 'infinite', 416 direction: direction, 417 fillMode: 'none', 418 complete: function complete() {} 419 }); 420 } 421 }); 422 423 // Fun factor 424 var FunFactor = function FunFactor($scope) { 425 haObserveTarget($scope[0], function () { 426 var $fun_factor = $scope.find('.ha-fun-factor__content-number'); 427 $fun_factor.numerator($fun_factor.data('animation')); 428 }); 429 }; 430 var BarChart = function BarChart($scope) { 431 haObserveTarget($scope[0], function () { 432 var $container = $scope.find('.ha-bar-chart-container'), 433 $chart_canvas = $scope.find('#ha-bar-chart'), 434 settings = $container.data('settings'); 435 if ($container.length) { 436 new Chart($chart_canvas, settings); 437 } 438 }); 439 }; 440 441 //twitter Feed 442 var TwitterFeed = function TwitterFeed($scope) { 443 var button = $scope.find('.ha-twitter-load-more'); 444 var twitter_wrap = $scope.find('.ha-tweet-items'); 445 button.on("click", function (e) { 446 e.preventDefault(); 447 var $self = $(this), 448 query_settings = $self.data("settings"), 449 widget_id = $scope.data("id"), 450 total = $self.data("total"), 451 items = $scope.find('.ha-tweet-item').length; 452 $.ajax({ 453 url: HappyLocalize.ajax_url, 454 type: 'POST', 455 data: { 456 action: "ha_twitter_feed_action", 457 security: HappyLocalize.nonce, 458 query_settings: query_settings, 459 widget_id: widget_id, 460 loaded_item: items 461 }, 462 success: function success(response) { 463 if (total > items) { 464 $(response).appendTo(twitter_wrap); 465 } else { 466 $self.text('All Loaded').addClass('loaded'); 467 setTimeout(function () { 468 $self.css({ 469 "display": "none" 470 }); 471 }, 800); 472 } 473 }, 474 error: function error(_error) {} 475 }); 476 }); 477 }; 478 479 //PostTab 480 var PostTab = ModuleHandler.extend({ 481 onInit: function onInit() { 482 ModuleHandler.prototype.onInit.apply(this, arguments); 483 this.wrapper = this.$element.find('.ha-post-tab'); 484 this.run(); 485 }, 486 run: function run() { 487 var filter_wrap = this.wrapper.find('.ha-post-tab-filter'),
488 filter = filter_wrap.find('li'), 489 event = this.wrapper.data('event'), 490 args = this.wrapper.data('query-args'); 491 filter.on(event, debounce(function (e) { 492 e.preventDefault(); 493 var $self = $(this), 494 term_id = $self.data("term"), 495 $wrapper = $self.closest(".ha-post-tab"), 496 content = $wrapper.find('.ha-post-tab-content'), 497 loading = content.find('.ha-post-tab-loading'), 498 tab_item = content.find('.ha-post-tab-item-wrapper'), 499 $content_exist = false; 500 if (0 === loading.length) { 501 filter.removeClass('active'); 502 tab_item.removeClass('active'); 503 $self.addClass('active'); 504 tab_item.each(function () { 505 var $self = $(this), 506 $content_id = $self.data("term"); 507 if (term_id === $content_id) { 508 $self.addClass('active'); 509 $content_exist = true; 510 } 511 }); 512 if (false === $content_exist) { 513 $.ajax({ 514 url: HappyLocalize.ajax_url, 515 type: 'POST', 516 data: { 517 action: "ha_post_tab_action", 518 security: HappyLocalize.nonce, 519 post_tab_query: args, 520 term_id: term_id 521 }, 522 beforeSend: function beforeSend() { 523 content.append('<span class="ha-post-tab-loading"><i class="eicon-spinner eicon-animation-spin"></i></span>'); 524 }, 525 success: function success(response) { 526 content.find('.ha-post-tab-loading').remove(); 527 content.append(response); 528 }, 529 error: function error(_error2) {} 530 }); 531 } 532 } 533 }, 200)); 534 } 535 }); 536 var DataTable = function DataTable($scope) { 537 var columnTH = $scope.find('.ha-table__head-column-cell'); 538 var rowTR = $scope.find('.ha-table__body-row'); 539 540 // Step 1: Handle rowspan by inserting placeholder cells ("nullval") 541 rowTR.each(function (i, tr) { 542 var cells = $(tr).find('.ha-table__body-row-cell'); 543 cells.each(function (index, cell) { 544 var $cell = $(cell); 545 var rowspan = parseInt($cell.attr("rowspan"), 10); 546 if (rowspan > 1) { 547 for (var j = i + 1; j < i + rowspan && j < rowTR.length; j++) { 548 var targetRow = $(rowTR).eq(j); 549 var targetCell = targetRow.children().eq(index); 550 $('<td class="ha-table__body-row-cell test">nullval</td>').insertBefore(targetCell); 551 } 552 } 553 }); 554 }); 555 556 // Step 2: Add header labels or remove placeholder cells 557 rowTR.each(function (i, tr) { 558 var cells = $(tr).find('.ha-table__body-row-cell'); 559 cells.each(function (index, cell) { 560 var $cell = $(cell); 561 var cellContent = $cell.html(); 562 if (cellContent.indexOf("nullval") === -1) { 563 var headerContent = columnTH.eq(index).html(); 564 $cell.prepend('<div class="ha-table__head-column-cell">' + headerContent + '</div>'); 565 } else { 566 $cell.remove(); 567 } 568 }); 569 }); 570 }; 571 572 //Threesixty Rotation 573 var Threesixty_Rotation = function Threesixty_Rotation($scope) { 574 var ha_circlr = $scope.find('.ha-threesixty-rotation-inner'); 575 var cls = ha_circlr.data('selector'); 576 var autoplay = ha_circlr.data('autoplay'); 577 var glass_on = $scope.find('.ha-threesixty-rotation-magnify'); 578 var t360 = $scope.find('.ha-threesixty-rotation-360img'); 579 var zoom = glass_on.data('zoom'); 580 var playb = $scope.find('.ha-threesixty-rotation-play'); 581 var crl = circlr(cls, { 582 play: true 583 }); 584 if ('on' === autoplay) { 585 var autoplay_btn = $scope.find('.ha-threesixty-rotation-autoplay'); 586 autoplay_btn.on('click', function (el) { 587 el.preventDefault(); 588 crl.play(); 589 t360.remove(); 590 }); 591 setTimeout(function () { 592 autoplay_btn.trigger('click'); 593 autoplay_btn.remove(); 594 }, 1000); 595 } else { 596 playb.on('click', function (el) { 597 el.preventDefault(); 598 var $self = $(this); 599 var $i = $self.find('i'); 600 if ($i.hasClass('hm-play-button')) { 601 $i.removeClass('hm-play-button'); 602 $i.addClass('hm-stop'); 603 crl.play(); 604 } else { 605 $i.removeClass('hm-stop'); 606 $i.addClass('hm-play-button'); 607 crl.stop(); 608 } 609 t360.remove(); 610 }); 611 } 612 glass_on.on('click', function (el) { 613 var img_block = $scope.find('img'); 614 img_block.each(function () { 615 var style = $(this).attr('style'); 616 if (-1 !== style.indexOf("block")) { 617 HappySimplaMagnify($(this)[0], zoom); 618 glass_on.css('display', 'none'); 619 t360.remove(); 620 } 621 }); 622 }); 623 $(document).on('click', function (e) { 624 var t = $(e.target); 625 var magnifier = $scope.find('.ha-img-magnifier-glass'); 626 var i = glass_on.find('i'); 627 if (magnifier.length && t[0] !== i[0]) { 628 magnifier.remove(); 629 glass_on.removeAttr('style'); 630 } 631 if (t[0] === ha_circlr[0]) { 632 t360.remove(); 633 } 634 }); 635 ha_circlr.on('mouseup mousedown touchstart touchend', function (e) { 636 t360.remove(); 637 }); 638 }; 639 640 //Event Calendar 641 var Event_Calendar = function Event_Calendar($scope) { 642 var calendarEl = $scope.find('.ha-ec'); 643 var popup = $scope.find('.ha-ec-popup-wrapper'); 644 var popupClose = $scope.find(".ha-ec-popup-close"); 645 // var events = calendarEl.data('events'); 646 var initialview = calendarEl.data('initialview'); 647 var firstday = calendarEl.data('firstday'); 648 var locale = calendarEl.data('locale'); 649 var showPopup = calendarEl.data('show-popup'); 650 var allday_text = calendarEl.data('allday-text'); 651 var time_format = calendarEl.data('time-format'); 652 var ECjson = window['HaECjson' + $scope.data('id')]; 653 var events = ECjson; 654 if ('undefined' == typeof events) { 655 return; 656 } 657 var option = { 658 stickyHeaderDates: false, 659 locale: locale, 660 headerToolbar: { 661 left: "prev,next today", 662 center: "title", 663 right: "dayGridMonth,timeGridWeek,timeGridDay,listMonth" 664 }, 665 initialView: initialview, 666 firstDay: firstday, 667 eventTimeFormat: { 668 // like '7pm' 669 hour: 'numeric', 670 minute: '2-digit', 671 meridiem: 'short' 672 }, 673 events: events, 674 height: 'auto', 675 eventClick: function eventClick(info) { 676 if ('yes' == showPopup) { 677 // don't let the browser navigate 678 var getTheDate = function getTheDate(timeString) { 679 return new Date(timeString); 680 }; 681 var timeFormat = function timeFormat(date) { 682 var time_format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'g:i a'; 683 return function (date) { 684 // Parse the input time 685 var hours = date.getHours(); 686 var minutes = date.getMinutes(); 687 var date = new Date(); 688 date.setHours(hours); 689 date.setMinutes(minutes); 690 var options = {}; 691 if (time_format.includes('H')) { 692 options.hour = '2-digit'; 693 options.hour12 = false;
694 } else { 695 options.hour = 'numeric'; 696 options.hour12 = true; 697 if (time_format.includes('a') || time_format.includes('A')) { 698 options.hour = 'numeric'; 699 } 700 } 701 options.minute = '2-digit'; 702 var formattedTime = new Intl.DateTimeFormat('en-US', options).format(date); 703 if (time_format.includes('a')) { 704 formattedTime = formattedTime.toLowerCase(); 705 } 706 return formattedTime; 707 }(date); 708 }; 709 info.jsEvent.preventDefault(); 710 var todayDateString = info.view.calendar.currentData.currentDate.toString(), 711 allDay = info.event.allDay, 712 title = info.event.title, 713 startDate = info.event.startStr, 714 endDate = info.event.endStr, 715 guest = info.event.extendedProps.guest, 716 location = info.event.extendedProps.location, 717 description = info.event.extendedProps.description, 718 detailsUrl = info.event.url, 719 imageUrl = info.event.extendedProps.image; 720 var titleWrap = popup.find('.ha-ec-event-title'), 721 timeWrap = popup.find('.ha-ec-event-time-wrap'), 722 guestWrap = popup.find('.ha-ec-event-guest-wrap'), 723 locationWrap = popup.find('.ha-ec-event-location-wrap'), 724 descWrap = popup.find('.ha-ec-popup-desc'), 725 detailsWrap = popup.find('.ha-ec-popup-readmore-link'), 726 imageWrap = popup.find('.ha-ec-popup-image'); 727 728 // display none 729 imageWrap.css('display', 'none'); 730 titleWrap.css('display', 'none'); 731 timeWrap.css('display', 'none'); 732 guestWrap.css('display', 'none'); 733 locationWrap.css('display', 'none'); 734 descWrap.css('display', 'none'); 735 detailsWrap.css('display', 'none'); 736 popup.addClass("ha-ec-popup-ready"); 737 738 // image markup 739 if (imageUrl) { 740 imageWrap.removeAttr("style"); 741 imageWrap.find('img').attr("src", imageUrl); 742 imageWrap.find('img').attr("alt", title); 743 } 744 745 // title markup 746 if (title) { 747 titleWrap.removeAttr("style"); 748 titleWrap.text(title); 749 } 750 751 // guest markup 752 if (guest) { 753 guestWrap.removeAttr("style"); 754 guestWrap.find('span.ha-ec-event-guest').text(guest); 755 } 756 757 // location markup 758 if (location) { 759 locationWrap.removeAttr("style"); 760 locationWrap.find('span.ha-ec-event-location').text(location); 761 } 762 763 // description markup 764 if (description) { 765 descWrap.removeAttr("style"); 766 descWrap.html(description); 767 } 768 769 // time markup 770 if (allDay !== true) { 771 timeWrap.removeAttr("style"); 772 startDate = Date.parse(getTheDate(startDate)); 773 endDate = Date.parse(getTheDate(endDate)); 774 var startTimeText = timeFormat(getTheDate(startDate), time_format); 775 var endTimeText = 'Invalid Data'; 776 if (startDate < endDate) { 777 endTimeText = timeFormat(getTheDate(endDate), time_format); 778 } 779 timeWrap.find('span.ha-ec-event-time').text(startTimeText + ' - ' + endTimeText); 780 } else { 781 timeWrap.removeAttr("style"); 782 timeWrap.find('span.ha-ec-event-time').text(allday_text); 783 } 784 785 // read more markup 786 if (detailsUrl) { 787 detailsWrap.removeAttr("style"); 788 detailsWrap.attr("href", detailsUrl); 789 if ("on" === info.event.extendedProps.external) { 790 detailsWrap.attr("target", "_blank"); 791 } 792 if ("on" === info.event.extendedProps.nofollow) { 793 detailsWrap.attr("rel", "nofollow"); 794 } 795 } 796 } else { 797 if (info.event.url && info.event.extendedProps.external) { 798 info.jsEvent.preventDefault(); 799 var id = $scope.data('id'), 800 anchor = document.createElement('a'), 801 anchorReal, 802 timeout; 803 anchor.id = 'happy-even-calender-link-' + id; 804 anchor.href = info.event.url; 805 anchor.target = info.event.extendedProps.external ? '_blank' : '_self'; 806 anchor.rel = info.event.extendedProps.nofollow ? 'nofollow noreferer' : ''; 807 anchor.style.display = 'none'; 808 document.body.appendChild(anchor); 809 anchorReal = document.getElementById(anchor.id); 810 anchorReal.click(); 811 timeout = setTimeout(function () { 812 document.body.removeChild(anchorReal); 813 clearTimeout(timeout); 814 }); 815 return false;
816 } 817 } 818 }, 819 dateClick: function dateClick(arg) { 820 itemDate = arg.date.toUTCString(); 821 } 822 }; 823 var calendar = new FullCalendar.Calendar(calendarEl[0], option); 824 calendar.render(); 825 $scope.find(".ha-ec-popup-wrapper").on("click", function (e) { 826 e.stopPropagation(); 827 if (e.target === e.currentTarget || e.target == popupClose[0] || e.target == popupClose.find(".eicon-editor-close")[0]) { 828 popup.addClass("ha-ec-popup-removing").removeClass("ha-ec-popup-ready"); 829 } 830 }); 831 }; 832 var MailChimp = function MailChimp($scope) { 833 var elForm = $scope.find('.ha-mailchimp-form'), 834 elMessage = $scope.find('.ha-mc-response-message'), 835 successMessage = elForm.data('success-message'); 836 elForm.on('submit', function (e) { 837 e.preventDefault(); 838 var data = { 839 action: 'ha_mailchimp_ajax', 840 security: HappyLocalize.nonce, 841 subscriber_info: elForm.serialize(), 842 list_id: elForm.data('list-id'), 843 post_id: elForm.parent().data('post-id'), 844 widget_id: elForm.parent().data('widget-id') 845 }; 846 $.ajax({ 847 type: 'post', 848 url: HappyLocalize.ajax_url, 849 data: data, 850 success: function success(response) { 851 elForm.trigger('reset'); 852 if (response.status) { 853 elMessage.removeClass('error'); 854 elMessage.addClass('success'); 855 elMessage.text(successMessage); 856 } else { 857 elMessage.addClass('error'); 858 elMessage.removeClass('success'); 859 elMessage.text(response.msg); 860 } 861 var hideMsg = setTimeout(function () { 862 elMessage.removeClass('error'); 863 elMessage.removeClass('success'); 864 clearTimeout(hideMsg); 865 }, 5000); 866 }, 867 error: function error(_error3) {} 868 }); 869 }); 870 }; 871 872 //Image Accordion 873 var Image_Accordion = function Image_Accordion($scope) { 874 if ($scope.hasClass('ha-image-accordion-click')) { 875 var items = $scope.find('.ha-ia-item'); 876 items.each(function (inx, btn) { 877 $(this).on('click', function (e) { 878 // e.preventDefault(); 879 if ($(this).hasClass('active')) { 880 return; 881 } else { 882 items.removeClass('active'); 883 $(this).addClass('active'); 884 } 885 }); 886 }); 887 } 888 }; 889 890 //Content Switcher 891 var Content_Switcher = function Content_Switcher($scope) { 892 var parent = $scope.find('.ha-content-switcher-wrapper'), 893 designType = parent.data('design-type'); 894 if (designType == 'button') { 895 var buttons = parent.find('.ha-cs-button'), 896 contents = parent.find('.ha-cs-content-section'); 897 buttons.each(function (inx, btn) { 898 $(this).on('click', function (e) { 899 e.preventDefault(); 900 if ($(this).hasClass('active')) { 901 return; 902 } else { 903 buttons.removeClass('active'); 904 $(this).addClass('active'); 905 contents.removeClass('active'); 906 var contentId = $(this).data('content-id'); 907 parent.find('#' + contentId).addClass('active'); 908 } 909 }); 910 }); 911 } else { 912 var toggleSwitch = parent.find('.ha-cs-switch.ha-input-label'), 913 input = parent.find('input.ha-cs-toggle-switch'), 914 primarySwitcher = parent.find('.ha-cs-switch.primary'), 915 secondarySwitcher = parent.find('.ha-cs-switch.secondary'), 916 primaryContent = parent.find('.ha-cs-content-section.primary'), 917 secondaryContent = parent.find('.ha-cs-content-section.secondary'); 918 toggleSwitch.on('click', function (e) { 919 if (input.is(':checked')) { 920 primarySwitcher.removeClass('active'); 921 primaryContent.removeClass('active'); 922 secondarySwitcher.addClass('active'); 923 secondaryContent.addClass('active'); 924 } else { 925 secondarySwitcher.removeClass('active'); 926 secondaryContent.removeClass('active'); 927 primarySwitcher.addClass('active'); 928 primaryContent.addClass('active'); 929 } 930 }); 931 } 932 }; 933 934 //Team Member 935 var Team_Member = function Team_Member($scope) { 936 var btn = $scope.find('.ha-btn'); 937 var lightBox = $scope.find('.ha-member-lightbox'); 938 if (lightBox.length > 0) { 939 var close = lightBox.find('.ha-member-lightbox-close'); 940 btn.on('click', function () { 941 lightBox.addClass('ha-member-lightbox-show'); 942 }); 943 lightBox.on('click', function (e) { 944 if (lightBox.hasClass('ha-member-lightbox-show')) { 945 if (e.target == lightBox[0]) { 946 lightBox.removeClass('ha-member-lightbox-show'); 947 } else if (e.target == close[0]) { 948 lightBox.removeClass('ha-member-lightbox-show'); 949 } else if (e.target == close.find('i.eicon-editor-close')[0]) { 950 lightBox.removeClass('ha-member-lightbox-show'); 951 } 952 } 953 }); 954 } 955 }; 956 957 //Creative Button 958 var Creative_Button = function Creative_Button($scope) { 959 var btn_wrap = $scope.find('.ha-creative-btn-wrap'); 960 var magnetic = btn_wrap.data('magnetic'); 961 var btn = btn_wrap.find('a.ha-creative-btn'); 962 if ('yes' == magnetic) { 963 btn_wrap.on('mousemove', function (e) { 964 var x = e.pageX - (btn_wrap.offset().left + btn_wrap.outerWidth() / 2); 965 var y = e.pageY - (btn_wrap.offset().top + btn_wrap.outerHeight() / 2); 966 btn.css("transform", "translate(" + x * 0.3 + "px, " + y * 0.5 + "px)"); 967 }); 968 btn_wrap.on('mouseout', function (e) { 969 btn.css("transform", "translate(0px, 0px)"); 970 }); 971 } 972 //For expandable button style only 973 var expandable = $scope.find('.ha-eft--expandable'); 974 var text = expandable.find('.text'); 975 if (expandable.length > 0 && text.length > 0) { 976 text[0].addEventListener("transitionend", function () { 977 if (text[0].style.width) { 978 text[0].style.width = "auto"; 979 } 980 }); 981 expandable[0].addEventListener("mouseenter", function (e) { 982 e.currentTarget.classList.add('hover'); 983 text[0].style.width = "auto"; 984 var predicted_answer = text[0].offsetWidth; 985 text[0].style.width = "0"; 986 window.getComputedStyle(text[0]).transform; 987 text[0].style.width = "".concat(predicted_answer, "px"); 988 }); 989 expandable[0].addEventListener("mouseleave", function (e) { 990 e.currentTarget.classList.remove('hover'); 991 text[0].style.width = "".concat(text[0].offsetWidth, "px"); 992 window.getComputedStyle(text[0]).transform; 993 text[0].style.width = ""; 994 }); 995 } 996 }; 997 var PDF_View = function PDF_View($scope) { 998 var $id = $scope.data('id'); 999 var $settings = $scope.find(".viewer-" + $id).data('pdf-settings'); 1000 var options = { 1001 width: $settings.width, 1002 height: $settings.height, 1003 page: $settings.page_number 1004 }; 1005 PDFObject.embed($settings.pdf_url, "#" + $settings.unique_id, options); 1006 }; 1007 var Comparison_Table = function Comparison_Table($scope) { 1008 var $table = $scope.find('.ha-comparison-table-wrapper'); 1009 var $table_head = $scope.find('.ha-comparison-table__head'); 1010 var $sticky_header = $table_head.data('sticky-header'); 1011 var $section_height = $scope.height();
1012 var $table_height = $table.innerHeight(); 1013 var $tableOffsetTop = $table.offset().top; 1014 if ($sticky_header === 'yes') { 1015 $window.scroll(function () { 1016 var offset = $(this).scrollTop(); 1017 if (offset >= $tableOffsetTop) { 1018 $table_head.addClass('table-sticky'); 1019 } else if (offset > $table_height) { 1020 $table_head.removeClass('table-sticky'); 1021 } 1022 }); 1023 } 1024 }; 1025 1026 // Slider 1027 elementorFrontend.hooks.addAction('frontend/element_ready/ha-slider.default', function ($scope) { 1028 elementorFrontend.elementsHandler.addHandler(SliderBase, { 1029 $element: $scope 1030 }); 1031 }); 1032 1033 // Carousel 1034 elementorFrontend.hooks.addAction('frontend/element_ready/ha-carousel.default', function ($scope) { 1035 elementorFrontend.elementsHandler.addHandler(SliderBase, { 1036 $element: $scope 1037 }); 1038 }); 1039 1040 //Horizontal Timeline 1041 elementorFrontend.hooks.addAction('frontend/element_ready/ha-horizontal-timeline.default', function ($scope) { 1042 elementorFrontend.elementsHandler.addHandler(SliderBase, { 1043 $element: $scope, 1044 autoplay: false, 1045 container: '.ha-horizontal-timeline-wrapper', 1046 navigation: 'arrow', 1047 arrows: true 1048 }); 1049 var img_wrap = $scope.find(".ha-horizontal-timeline-image"); 1050 var magnific_popup = img_wrap.data("mfp-src"); 1051 if (undefined !== magnific_popup) { 1052 img_wrap.magnificPopup({ 1053 type: "image", 1054 gallery: { 1055 enabled: true 1056 } 1057 }); 1058 } 1059 }); 1060 1061 // elementorFrontend.hooks.addAction( 1062 // 'frontend/element_ready/ha-mailchimp.default', 1063 // function ($scope) { 1064 // elementorFrontend.elementsHandler.addHandler(MailChimp, { 1065 // $element: $scope, 1066 // }); 1067 // } 1068 // ); 1069 1070 $('body').on('click.onWrapperLink', '[data-ha-element-link]', function () { 1071 var $wrapper = $(this), 1072 data = $wrapper.data('ha-element-link'), 1073 id = $wrapper.data('id'), 1074 anchor = document.createElement('a'), 1075 anchorReal, 1076 timeout; 1077 anchor.id = 'happy-addons-wrapper-link-' + id; 1078 anchor.href = data.url; 1079 anchor.target = data.is_external ? '_blank' : '_self'; 1080 anchor.rel = data.nofollow ? 'nofollow noreferer' : ''; 1081 anchor.style.display = 'none'; 1082 document.body.appendChild(anchor); 1083 anchorReal = document.getElementById(anchor.id); 1084 anchorReal.click(); 1085 timeout = setTimeout(function () { 1086 document.body.removeChild(anchorReal); 1087 clearTimeout(timeout); 1088 }); 1089 }); 1090 1091 // Background overlay extension
1092 var BackgroundOverlay = function BackgroundOverlay($scope) { 1093 $scope.hasClass('elementor-element-edit-mode') && $scope.addClass('ha-has-bg-overlay'); 1094 }; 1095 var fnHanlders = { 1096 'ha-image-compare.default': HandleImageCompare, 1097 'ha-number.default': NumberHandler, 1098 'ha-skills.default': SkillHandler, 1099 'ha-fun-factor.default': FunFactor, 1100 'ha-bar-chart.default': BarChart, 1101 'ha-twitter-feed.default': TwitterFeed, 1102 'ha-threesixty-rotation.default': Threesixty_Rotation, 1103 'ha-data-table.default': DataTable, 1104 // 'widget' : BackgroundOverlay, 1105 'section': BackgroundOverlay, 1106 'column': BackgroundOverlay, 1107 'ha-event-calendar.default': Event_Calendar, 1108 'ha-mailchimp.default': MailChimp, 1109 'ha-image-accordion.default': Image_Accordion, 1110 'ha-content-switcher.default': Content_Switcher, 1111 'ha-member.default': Team_Member, 1112 'ha-creative-button.default': Creative_Button, 1113 'ha-pdf-view.default': PDF_View, 1114 'ha-comparison-table.default': Comparison_Table 1115 }; 1116 $.each(fnHanlders, function (widgetName, handlerFn) { 1117 elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName, handlerFn); 1118 }); 1119 var classHandlers = { 1120 'ha-image-grid.default': ImageGrid, 1121 'ha-justified-gallery.default': JustifiedGrid, 1122 'ha-news-ticker.default': NewsTicker, 1123 'ha-post-tab.default': PostTab 1124 }; 1125 $.each(classHandlers, function (widgetName, handlerClass) { 1126 elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName, function ($scope) { 1127 elementorFrontend.elementsHandler.addHandler(handlerClass, { 1128 $element: $scope 1129 }); 1130 }); 1131 }); 1132 1133 //nav menu 1134 var NavigationMenu = function __init($scope) { 1135 var navMenu = $scope.find('.ha-nav-menu'); 1136 1137 //for tablet only 1138 if (jQuery(window).width() < 1025 && jQuery(window).width() > 767) { 1139 var indicator = navMenu.find('.ha-submenu-indicator-wrap'); 1140 indicator.on('click', function (e) { 1141 e.preventDefault(); 1142 var $parentEl = $(this).parent('li.menu-item-has-children'); 1143 if ($parentEl) { 1144 $parentEl.children('ul.sub-menu').slideToggle(); 1145 } 1146 }); 1147 } 1148 var humBurgerBtn = navMenu.find('.ha-menu-toggler'); 1149 humBurgerBtn.on('click', function (e) { 1150 var humberger = $(this).data('humberger'); 1151 var $pel = navMenu.find('ul.menu'); 1152 if ('open' == humberger) { 1153 $('.ha-menu-open-icon').addClass('hide-icon'); 1154 $('.ha-menu-close-icon').removeClass('hide-icon'); 1155 $('.ha-menu-close-icon').addClass('show-icon'); 1156 $pel.slideDown(); 1157 } else { 1158 $('.ha-menu-close-icon').addClass('hide-icon'); 1159 $('.ha-menu-open-icon').removeClass('hide-icon'); 1160 $('.ha-menu-open-icon').addClass('show-icon'); 1161 $pel.slideUp(); 1162 } 1163 }); 1164 function burgerClsAdd() { 1165 if (jQuery(window).width() < 768) { 1166 navMenu.removeClass('ha-navigation-menu-wrapper'); 1167 navMenu.addClass('ha-navigation-burger-menu'); 1168 var humBurgerSubMenuBtn = navMenu.find('.ha-submenu-indicator-wrap'); 1169 humBurgerSubMenuBtn.on('click', function (e) { 1170 e.preventDefault(); 1171 var $parentEl = $(this).parent('li.menu-item-has-children'); 1172 if ($parentEl) { 1173 $parentEl.children('ul.sub-menu').slideToggle(); 1174 } 1175 }); 1176 } else { 1177 navMenu.addClass('ha-navigation-menu-wrapper'); 1178 navMenu.removeClass('ha-navigation-burger-menu'); 1179 navMenu.find('ul.menu').removeAttr('style'); 1180 navMenu.find('ul.sub-menu').removeAttr('style'); 1181 } 1182 } 1183 burgerClsAdd(); 1184 $window.on('resize', debounce(burgerClsAdd, 100)); 1185 }; 1186 elementorFrontend.hooks.addAction("frontend/element_ready/ha-navigation-menu.default", NavigationMenu); 1187 var AgeGate = function AgeGate($scope, $) { 1188 if (elementorFrontend.isEditMode()) { 1189 localStorage.removeItem("ha-age-gate-expire-time"); 1190 if ($scope.find('.ha-age-gate-wrapper').length) { 1191 var editor_mood = $scope.find('.ha-age-gate-wrapper').data('editor_mood');
1192 if ('no' == editor_mood) { 1193 $scope.find('.ha-age-gate-wrapper').hide(); 1194 } 1195 } 1196 } else if (!elementorFrontend.isEditMode()) { 1197 var container = $scope.find('.ha-age-gate-wrapper'), 1198 cookies_time = container.data('age_gate_cookies_time'), 1199 exd = localStorage.getItem("ha-age-gate-expire-time"); 1200 //container.closest("body").find("header").css("display","none"); 1201 container.closest("body").css("overflow", "hidden"); 1202 var cdate = new Date(); 1203 var endDate = new Date(); 1204 endDate.setDate(cdate.getDate() + cookies_time); 1205 $("body,html,document").scrollTop($scope.offset().top); 1206 var t = setTimeout(function () { 1207 $("body,html,document").scrollTop($("body").offset().top); 1208 clearTimeout(t); 1209 }, 1000); 1210 if (exd != '' && exd != undefined && new Date(cdate) <= new Date(exd)) { 1211 $('.ha-age-gate-wrapper').hide(); 1212 container.closest("body").css("overflow", ""); 1213 } else if (exd != '' && exd != undefined && new Date(cdate) > new Date(exd)) { 1214 localStorage.removeItem("ha-age-gate-expire-time"); 1215 $('.ha-age-gate-wrapper').show(); 1216 } else { 1217 $('.ha-age-gate-wrapper').show(); 1218 } 1219 1220 /*confirm-age*/ 1221 if ($scope.find('.ha-age-gate-wrapper.ha-age-gate-confirm-age').length) { 1222 $(".ha-age-gate-confirm-age-btn").on("click", function () { 1223 localStorage.setItem("ha-age-gate-expire-time", endDate); 1224 $(this).closest(".ha-age-gate-wrapper").hide(); 1225 //$(this).closest("body").find("header").css("display","block"); 1226 $(this).closest("body").css("overflow", ""); 1227 }); 1228 } 1229 1230 /*confirm-dob*/ 1231 if ($scope.find('.ha-age-gate-wrapper.ha-age-gate-confirm-dob').length) { 1232 $(".ha-age-gate-confirm-dob-btn").on("click", function () { 1233 var birthYear = new Date(Date.parse($(this).closest('.ha-age-gate-form-body').find('.ha-age-gate-date-input').val())), 1234 agebirth = birthYear.getFullYear(), 1235 currentYear = cdate.getFullYear(), 1236 userage = currentYear - agebirth, 1237 agelimit = $(this).closest('.ha-age-gate-wrapper').data("userbirth"); 1238 if (userage < agelimit) { 1239 $(this).closest('.ha-age-gate-boxes').find('.ha-age-gate-warning-msg').show(); 1240 } else { 1241 localStorage.setItem("ha-age-gate-expire-time", endDate); 1242 $(this).closest('.ha-age-gate-wrapper').hide(); 1243 //$(this).closest("body").find("header").css("display","block"); 1244 $(this).closest("body").css("overflow", ""); 1245 } 1246 }); 1247 } 1248 1249 /*confirm-by-boolean*/ 1250 if ($scope.find('.ha-age-gate-wrapper.ha-age-gate-confirm-by-boolean').length) { 1251 $(".ha-age-gate-wrapper .ha-age-gate-confirm-yes-btn").on("click", function () { 1252 localStorage.setItem("ha-age-gate-expire-time", endDate); 1253 $(this).closest('.ha-age-gate-wrapper').hide(); 1254 //$(this).closest("body").find("header").css("display","block"); 1255 $(this).closest("body").css("overflow", ""); 1256 }); 1257 $(".ha-age-gate-wrapper .ha-age-gate-confirm-no-btn").on("click", function () { 1258 $(this).closest('.ha-age-gate-boxes').find('.ha-age-gate-warning-msg').show(); 1259 }); 1260 } 1261 } 1262 }; 1263 elementorFrontend.hooks.addAction("frontend/element_ready/ha-age-gate.default", AgeGate); 1264 var LiquidHoverImage = ModuleHandler.extend({ 1265 onInit: function onInit() { 1266 ModuleHandler.prototype.onInit.apply(this, arguments); 1267 this.run(); 1268 1269 // $window.on('resize', debounce(this.run.bind(this), 100)); 1270 }, 1271 onElementChange: debounce(function (changedProp) { 1272 var $keys = ['width', 'title_typography_typography', 'title_typography_font_size', 'title_typography_line_height', 'title_typography_font_weight', 'sub_title_typography_typography', 'sub_title_typography_font_size', 'sub_title_typography_line_height', 'sub_title_typography_font_weight']; 1273 if ($keys.indexOf(changedProp) !== -1) { 1274 this.run(); 1275 } 1276 }, 300), 1277 run: function run() { 1278 var self = this, 1279 settings = JSON.parse(self.$element.find('.ha-lhi-image-area').attr("data-settings")), 1280 liquidImage = self.$element.find('.ha-lhi-image'), 1281 title = self.$element.find('.ha-lhi-title h2'), 1282 sub_title = self.$element.find('.ha-lhi-title p'),
1283 canvas = self.$element.find('canvas'), 1284 style = settings.hover_style, 1285 hover_effect = settings.plugin_url + 'liquid-hover-image/' + settings.hover_effect; 1286 if ('custom' == settings.hover_effect) { 1287 hover_effect = settings.custom_effect ? settings.custom_effect : ''; 1288 } 1289 if (canvas) { 1290 canvas.remove(); 1291 } 1292 var myAnimation = new hoverEffect({ 1293 parent: liquidImage[0], 1294 intensity: settings.intensity, 1295 image1: settings.first_image, 1296 image2: settings.second_image, 1297 displacementImage: hover_effect, 1298 imagesRatio: liquidImage.height() / liquidImage.width(), 1299 angle1: (settings.angle - 45) * (Math.PI / 180) * -1, 1300 angle2: (settings.angle - 45) * (Math.PI / 180) * -1, 1301 speedIn: settings.speed, 1302 speedOut: settings.speed 1303 }); 1304 1305 /* if title or subtitle enable */ 1306 if ('style-1' == style && (title.length || sub_title.length)) { 1307 var HoverOutDelay = function HoverOutDelay(el, i, a) { 1308 return 'right' == style_direction ? (a - i) * 40 : 40 * i; 1309 }; 1310 var style_direction = settings.style_1_direction; 1311 if (title.length) { 1312 title[0].innerHTML = title[0].textContent.replace(/\S/g, "<span class='letter'>$&</span>"); 1313 } 1314 if (sub_title.length) { 1315 sub_title.addClass("letter"); 1316 } 1317 var HoverTranslateX = [0, 0], 1318 HoverOutTranslateX = [0, 0], 1319 HoverTranslateY = [0, 0], 1320 HoverOutTranslateY = [0, 0]; 1321 ; 1322 if ('left' == style_direction) { 1323 HoverTranslateX = [80, 0], HoverOutTranslateX = [0, -80]; 1324 } else if ('right' == style_direction) { 1325 HoverTranslateX = [0, 80], HoverOutTranslateX = [80, 200]; 1326 } else if ('up' == style_direction) { 1327 HoverTranslateY = [80, 0], HoverOutTranslateY = [0, -80]; 1328 } else if ('down' == style_direction) { 1329 HoverTranslateY = [-80, 0], HoverOutTranslateY = [0, 80]; 1330 } 1331 self.$element.hover(function () { 1332 anime.timeline({ 1333 loop: false 1334 }).add({ 1335 targets: '.elementor-element-' + self.getID() + ' .ha-lhi-title .letter', 1336 translateX: HoverTranslateX, 1337 translateY: HoverTranslateY, 1338 translateZ: 0, 1339 opacity: [0, 1], 1340 easing: "easeOutExpo", 1341 duration: 800, 1342 delay: function delay(el, i) { 1343 return 40 * i; 1344 } 1345 }); 1346 }, function () { 1347 anime.timeline({ 1348 loop: false 1349 }).add({ 1350 targets: '.elementor-element-' + self.getID() + ' .ha-lhi-title .letter', 1351 translateX: HoverOutTranslateX, 1352 translateY: HoverOutTranslateY, 1353 opacity: [1, 0], 1354 // easing: "easeInExpo", 1355 duration: 850, 1356 delay: function delay(el, i, a) { 1357 return HoverOutDelay(el, i, a); 1358 } 1359 }); 1360 }); 1361 } 1362 if ('style-2' == style && (title.length || sub_title.length)) { 1363 if (title.length) { 1364 var height = title.find('.normal').outerHeight(); 1365 title.height(height); 1366 } 1367 if (sub_title.length) { 1368 var height = sub_title.find('.normal').outerHeight(); 1369 sub_title.height(height); 1370 } 1371 self.$element.hover(function () { 1372 title.addClass('play'); 1373 sub_title.addClass('play'); 1374 }, function () { 1375 title.removeClass('play'); 1376 sub_title.removeClass('play'); 1377 }); 1378 } 1379 if ('style-5' == style && (title.length || sub_title.length)) { 1380 if (title.length) { 1381 var height = title.find('.normal').outerHeight(); 1382 title.attr('style', '--ha-lhi-style-5-height:' + height + 'px'); 1383 } 1384 } 1385 } 1386 }); 1387 elementorFrontend.hooks.addAction('frontend/element_ready/ha-liquid-hover-image.default', function ($scope) { 1388 elementorFrontend.elementsHandler.addHandler(LiquidHoverImage, { 1389 $element: $scope 1390 }); 1391 }); 1392 var TextScroll = ModuleHandler.extend({ 1393 onInit: function onInit() { 1394 ModuleHandler.prototype.onInit.apply(this, arguments); 1395 this.run(); 1396 }, 1397 onElementChange: debounce(function (changedProp) { 1398 var $keys = ['text_scroll_type']; 1399 if ($keys.indexOf(changedProp) !== -1) { 1400 this.run(); 1401 } 1402 }, 300), 1403 getReadySettings: function getReadySettings() { 1404 var settings = {}; 1405 var scroll_type = this.getElementSettings('text_scroll_type'); 1406 if (scroll_type) settings.scroll_type = scroll_type; 1407 return $.extend({}
1407, this.getSettings(), settings); 1408 }, 1409 run: function run() { 1410 var settings = this.getReadySettings(); 1411 var $element = this.$element; 1412 var elementsToSplit = $element.find('.ha-split-lines')[0]; 1413 var instancesOfSplit = []; 1414 var textScrollType = settings.scroll_type; 1415 var lastScrollTop = 0; 1416 var typeSplit; 1417 if (typeof gsap === 'undefined' || typeof ScrollTrigger === 'undefined') return; 1418 gsap.registerPlugin(ScrollTrigger); 1419 function runSplit() { 1420 if (elementsToSplit.length <= 0) return; 1421 if (textScrollType === 'horizontal_line_mask' || textScrollType === 'vertical_line_mask') { 1422 $(elementsToSplit).each(function (index) { 1423 var currentElement = $(this); 1424 instancesOfSplit[index] = new SplitType(currentElement, { 1425 types: "lines, words" 1426 }); 1427 }); 1428 $(elementsToSplit).find(".line").each(function (index) { 1429 $(this).append("<div class='ha-line-mask'></div>"); 1430 }); 1431 } else if (textScrollType === 'horizontal_line_highlight') { 1432 $(elementsToSplit).each(function (index) { 1433 var currentElement = $(this); 1434 instancesOfSplit[index] = new SplitType(currentElement, { 1435 types: "words, chars" 1436 }); 1437 }); 1438 } else { 1439 typeSplit = new SplitType(elementsToSplit, { 1440 types: 'lines, words' 1441 }); 1442 } 1443 createAnimation(); 1444 } 1445 runSplit(); 1446 function createAnimation() { 1447 if (textScrollType === 'horizontal_line_mask' || textScrollType === 'vertical_line_mask') { 1448 $element.find('.line').each(function (index, targetElement) { 1449 var mask = $(targetElement).find('.ha-line-mask'); 1450 if (mask.length <= 0) return; 1451 $(targetElement).addClass('mask-active'); 1452 var scrollTriggerProps = { 1453 start: textScrollType === 'horizontal_line_mask' ? 'bottom 50%' : 'bottom center', 1454 end: 'bottom center', 1455 scrub: 3 1456 }; 1457 var animationProps = textScrollType === 'horizontal_line_mask' ? { 1458 width: '0%' 1459 } : { 1460 height: '0%' 1461 }; 1462 var tl = gsap.timeline({ 1463 scrollTrigger: _objectSpread({ 1464 trigger: targetElement 1465 }, scrollTriggerProps) 1466 }); 1467 tl.to(mask, _objectSpread(_objectSpread({}, animationProps), {}, { 1468 duration: 1 1469 })); 1470 }); 1471 } else if (textScrollType === 'horizontal_line_highlight') { 1472 var charsTargetElement = $element.find('.word .char'); 1473 var triggerElement = $element.find('.ha-split-lines'); 1474 if (charsTargetElement.length >= 0 && triggerElement.length >= 0) { 1475 gsap.to(charsTargetElement, { 1476 scrollTrigger: { 1477 trigger: triggerElement, 1478 start: 'top 40%', 1479 end: 'bottom center', 1480 scrub: 1 1481 }, 1482 opacity: 1, 1483 duration: 2, 1484 stagger: 1 1485 }); 1486 } 1487 } else { 1488 $element.find('.line').each(function () { 1489 var _this2 = this; 1490 gsap.to(this, { 1491 scrollTrigger: { 1492 trigger: this, 1493 start: 'top 50%', 1494 end: 'bottom 50%', 1495 onEnter: function onEnter() { 1496 $(_this2).addClass('highlight'); 1497 }, 1498 onLeaveBack: function onLeaveBack() { 1499 $(_this2).removeClass('highlight'); 1500 } 1501 } 1502 }); 1503 }); 1504 } 1505 } 1506 } 1507 }); 1508 1509 // Hook into Elementor's frontend ready event 1510 elementorFrontend.hooks.addAction('frontend/element_ready/ha-text-scroll.default', function ($scope) { 1511 elementorFrontend.elementsHandler.addHandler(TextScroll, { 1512 $element: $scope 1513 }); 1514 }); 1515 1516 // SVG Draw Handler 1517 var haSvgDrawHandler = ModuleHandler.extend({ 1518 onInit: function onInit() { 1519 ModuleHandler.prototype.onInit.apply(this, arguments); 1520 this.run(); 1521 }, 1522 bindEvents: function bindEvents() { 1523 ScrollTrigger.config({ 1524 limitCallbacks: true, 1525 ignoreMobileResize: true 1526 }); 1527 }, 1528 run: function run() { 1529 gsap.registerPlugin(ScrollTrigger); 1530 var $scope = this.$element; 1531 $scope.find("title").remove(); 1532 if (!$scope.hasClass("ha-svg-animated-yes")) return; 1533 var elemID = $scope.data("id"), 1534 settings = this.getElementSettings(), 1535 scrollAction = settings.scroll_action, 1536 scrollTrigger = null, 1537 repeatDelay = parseFloat(settings.repeat_delay) || 0.5, 1538 timeLine = new TimelineMax({ 1539 repeat: 0, 1540 yoyo: false, 1541 repeatDelay: 0.5 1542 }); 1543 if ('automatic' === scrollAction) { 1544 scrollTrigger = 'custom' !== settings.animate_trigger ? settings.animate_trigger : settings.animate_offset.size + "%"; 1545 var animRev = settings.anim_rev ? 'pause play reverse' : 'none'; 1546 1547 // Configure the timeline 1548 timeLine.repeat(settings.loop ? -1 : 0).yoyo(settings.yoyo).repeatDelay(settings.loop ? repeatDelay : 0); 1549 ScrollTrigger.create({ 1550 trigger: '.elementor-element-' + elemID, 1551 toggleActions: "play " + animRev, 1552 start: "top " + scrollTrigger, 1553 animation: timeLine 1554 }); 1555 } else { 1556 // Configure timeline for non-automatic cases 1557 timeLine.repeat('hover' === scrollAction && settings.loop ? -1 : 0).yoyo('hover' === scrollAction && settings.yoyo).repeatDelay('hover' === scrollAction && settings.loop ? repeatDelay : 0); 1558 if ('viewport' === scrollAction) { 1559 scrollTrigger = settings.animate_offset.size / 100; 1560 } 1561 } 1562 var fromOrTo = !$scope.hasClass("ha-svg-animation-rev-yes") ? 'from' : 'to', 1563 $paths = $scope.find("path, circle, rect, square, ellipse, polyline, polygon, line"), 1564 lastPathIndex = 0, 1565 startOrEndPoint = 'from' === fromOrTo ? settings.animate_start_point.size : settings.animate_end_point.size; 1566 $paths.each(function (pathIndex, path) { 1567 var $path = $(path); 1568 $path.attr("fill", "transparent"); 1569 if ($scope.hasClass("ha-svg-sync-together-yes")) pathIndex = 0; 1570 lastPathIndex = pathIndex; 1571 1572 // Use the timeline's from/to methods 1573 if (fromOrTo === 'from') { 1574 timeLine.from($path, 1, {
1575 PaSvgDrawer: (startOrEndPoint || 0) + "% 0" 1576 }, pathIndex); 1577 } else { 1578 timeLine.to($path, 1, { 1579 PaSvgDrawer: (startOrEndPoint || 0) + "% 0" 1580 }, pathIndex); 1581 } 1582 }); 1583 if ('yes' === settings.svg_fill) { 1584 if (lastPathIndex == 0) lastPathIndex = 1; 1585 timeLine.to($paths, 1, { 1586 fill: settings.svg_color, 1587 stroke: settings.svg_stroke 1588 }, lastPathIndex); 1589 } 1590 if ('viewport' === scrollAction) { 1591 var controller = new ScrollMagic.Controller(), 1592 scene = new ScrollMagic.Scene({ 1593 triggerElement: '.elementor-element-' + elemID, 1594 triggerHook: scrollTrigger, 1595 duration: settings.draw_speed ? settings.draw_speed.size * 1000 : "150%" 1596 }); 1597 scene.setTween(timeLine).addTo(controller); 1598 } else { 1599 if (settings.frames) { 1600 timeLine.duration(settings.frames); 1601 timeLine.repeatDelay(repeatDelay); 1602 } 1603 if ('hover' === scrollAction) { 1604 timeLine.pause(); 1605 $scope.find("svg").hover(function () { 1606 timeLine.play(); 1607 }, function () { 1608 timeLine.pause(); 1609 }); 1610 } 1611 } 1612 } 1613 }); 1614 1615 // Hook into Elementor's frontend ready event with svg draw 1616 elementorFrontend.hooks.addAction('frontend/element_ready/ha-svg-draw.default', function ($scope) { 1617 elementorFrontend.elementsHandler.addHandler(haSvgDrawHandler, { 1618 $element: $scope 1619 }); 1620 }); 1621 }); 1622})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.