vendor: 4,066 bytes, lines 1-11
1var _document = document, 2 _navigator = navigator, 3 _undefined = undefined, 4 _window = window; 5 6/*! 7 * imagesLoaded PACKAGED v4.1.4 8 * JavaScript is all like "You images are done yet or what?" 9 * MIT License 10 */ 11!function(a,b){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",b):"object"==typeof module&&module.exports?module.exports=b():a.EvEmitter=b()}("undefined"==typeof window?this:window,function(){function a(){}var b=a.prototype;return b.on=function(a,b){if(a&&b){var c=this._events=this._events||{},d=c[a]=c[a]||[];return-1==d.indexOf(b)&&d.push(b),this}},b.once=function(a,b){if(a&&b){this.on(a,b);var c=this._onceEvents=this._onceEvents||{},d=c[a]=c[a]||{};return d[b]=!0,this}},b.off=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=c.indexOf(b);return-1!=d&&c.splice(d,1),this}},b.emitEvent=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){c=c.slice(0),b=b||[];for(var d=this._onceEvents&&this._onceEvents[a],e=0;e<c.length;e++){var f=c[e],g=d&&d[f];g&&(this.off(a,f),delete d[f]),f.apply(this,b)}return this}},b.allOff=function(){delete this._events,delete this._onceEvents},a}),function(a,b){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("ev-emitter")):a.imagesLoaded=b(a,a.EvEmitter)}("undefined"==typeof window?this:window,function(b,c){function f(a,b){for(var c in b)a[c]=b[c];return a}function g(b){if(Array.isArray(b))return b;var c="object"==typeof b&&"number"==typeof b.length;return c?a.call(b):[b]}function j(a,b,c){if(!(this instanceof j))return new j(a,b,c);var d=a;return"string"==typeof a&&(d=document.querySelectorAll(a)),d?(this.elements=g(d),this.options=f({},this.options),"function"==typeof b?c=b:f(this.options,b),c&&this.on("always",c),this.getImages(),l&&(this.jqDeferred=new l.Deferred),void setTimeout(this.check.bind(this))):void m.error("Bad element for imagesLoaded "+(d||a))}function i(a){this.img=a}function k(a,b){this.url=a,this.element=b,this.img=new Image}var l=b.jQuery,m=b.console,a=Array.prototype.slice;j.prototype=Object.create(c.prototype),j.prototype.options={},j.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},j.prototype.addElementImages=function(a){"IMG"==a.nodeName&&this.addImage(a),!0===this.options.background&&this.addElementBackgroundImages(a);var b=a.nodeType;if(b&&d[b]){for(var c,e=a.querySelectorAll("img"),f=0;f<e.length;f++)c=e[f],this.addImage(c);if("string"==typeof this.options.background){var g=a.querySelectorAll(this.options.background);for(f=0;f<g.length;f++){var h=g[f];this.addElementBackgroundImages(h)}}}};var d={1:!0,9:!0,11:!0};return j.prototype.addElementBackgroundImages=function(a){var b=getComputedStyle(a);if(b)for(var c,d=/url\((['"])?(.*?)\1\)/gi,e=d.exec(b.backgroundImage);null!==e;)c=e&&e[2],c&&this.addBackground(c,a),e=d.exec(b.backgroundImage)},j.prototype.addImage=function(a){var b=new i(a);this.images.push(b)},j.prototype.addBackground=function(a,b){var c=new k(a,b);this.images.push(c)},j.prototype.check=function(){function a(a,c,d){setTimeout(function(){b.progress(a,c,d)})}var b=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(b){b.once("progress",a),b.check()}):void this.complete()},j.prototype.progress=function(a,b,c){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!a.isLoaded,this.emitEvent("progress",[this,a,b]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,a),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&m&&m.log("progress: "+c,a,b)},j.prototype.complete=function(){var a=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(a,[this]),this.emitEvent("always",[this]),this.jqDeferred){var b=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[b](this)}},i.prototype=Object.create(c.prototype),i.prototype.check=function(){var a=this.getIsImageComplete();
11return a?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},i.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},i.prototype.confirm=function(a,b){this.isLoaded=a,this.emitEvent("progress",[this,this.img,b])},i.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},i.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},i.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},i.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},k.prototype=Object.create(i.prototype),k.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var a=this.getIsImageComplete();a&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},k.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},k.prototype.confirm=function(a,b){this.isLoaded=a,this.emitEvent("progress",[this,this.element,b])},j.makeJQueryPlugin=function(a){a=a||b.jQuery,a&&(l=a,l.fn.imagesLoaded=function(a,b){var c=new j(this,a,b);return c.jqDeferred.promise(l(this))})},j.makeJQueryPlugin(),j}); 12 13/* 14 * jQuery Easing v1.4.1 - http://gsgd.co.uk/sandbox/jquery/easing/ 15 * Open source under the BSD License. 16 * Copyright © 2008 George McGinley Smith 17 * All rights reserved. 18 * https://raw.github.com/gdsmith/jquery-easing/master/LICENSE 19*/ 20jQuery.easing.jswing=jQuery.easing.swing;var pow=Math.pow;jQuery.extend(jQuery.easing,{def:"easeOutExpo",easeInExpo:function(a){return 0===a?0:pow(2,10*a-10)},easeOutExpo:function(a){return 1===a?1:1-pow(2,-10*a)},easeInOutExpo:function(a){return 0===a?0:1===a?1:.5>a?pow(2,20*a-10)/2:(2-pow(2,-20*a+10))/2}}); 21 22// UpSolution Theme Core 23_window.$us = _window.$us || {}; 24 25// UpSolution Helper Library 26_window.$ush = _window.$ush || {}; 27 28/** 29 * Determines if the device is iOS 30 * 31 * @return {Boolean} True if iOS device, False otherwise 32 */ 33$us.iOS = ( 34 /^iPad|iPhone|iPod/.test( _navigator.platform ) 35 // iPad on iOS 13 detection 36 || ( 37 _navigator.userAgent.indexOf( 'Mac' ) > -1 38 && _navigator.maxTouchPoints > 1 39 && $ush.isTouchend 40 ) 41); 42 43// Note: The variable is needed for the page-scroll.js file which changes only in menu.js 44$us.mobileNavOpened = 0; 45 46// The parameters that are in the code but not applied in the absence of a header 47// When connecting header, correct parameters will be loaded 48$us.header = {}; 49[ 50 'getCurrentHeight', 51 'getHeaderInitialPos', 52 'getHeight', 53 'getScrollDirection', 54 'getScrollTop', 55 'isFixed', 56 'isHidden', 57 'isHorizontal', 58 'isStatic', 59 'isSticky', 60 'isStickyAutoHidden', 61 'stickyAutoHideEnabled', 62 'stickyEnabled', 63 'isTransparent', 64 'isVertical', 65 'on' 66].map( ( name ) => { 67 $us.header[ name ] = jQuery.noop; 68} ); 69 70/** 71 * Retrieve/set/erase dom modificator class <mod>_<value> for UpSolution CSS Framework 72 * @param {String} mod Modificator namespace 73 * @param {String} [value] Value 74 * @returns {String|self} 75 */ 76jQuery.fn.usMod = function( mod, value ) { 77 const self = this; 78 if ( self.length == 0 ) return self; 79 // Retrieve modificator (The modifier will only be obtained from the first node) 80 if ( value === _undefined ) { 81 const pcre = new RegExp( '^.*?' + mod + '_([\dA-z_-]+).*?$' ); 82 return ( pcre.exec( self.get( 0 ).className ) || [] )[ 1 ] || false; 83 } 84 // Set/Remove class modificator 85 self.each( ( _, item ) => { 86 // Remove class modificator 87 item.className = item.className.replace( new RegExp( '(^| )' + mod + '_[\dA-z_-]+( |$)' ), '$2' ); 88 if ( value !== false ) { 89 item.className += ' ' + mod + '_' + value; 90 } 91 } ); 92 return self; 93}; 94 95/** 96 * Determines whether animation is available or not 97 * @param {String} animationName The ease animation name 98 * @param {String} defaultAnimationName The default animation name 99 * @return {String} 100 */ 101$us.getAnimationName = function( animationName, defaultAnimationName ) { 102 if ( jQuery.easing.hasOwnProperty( animationName ) ) { 103 return animationName; 104 } 105 return defaultAnimationName 106 ? defaultAnimationName 107 : jQuery.easing._default; 108}; 109 110// Prototype mixin for all classes working with events 111// TODO: Replace with $ush.mixinEvents 112$us.mixins = {}; 113$us.mixins.Events = { 114 /** 115 * Attach a handler to an event for the class instance 116 * @param {String}
116 eventType A string containing event type, such as 'beforeShow' or 'change' 117 * @param {Function} handler A function to execute each time the event is triggered 118 */ 119 on: function( eventType, handler ) { 120 const self = this; 121 if ( self.$$events === _undefined ) { 122 self.$$events = {}; 123 } 124 if ( self.$$events[ eventType ] === _undefined ) { 125 self.$$events[ eventType ] = []; 126 } 127 self.$$events[ eventType ].push( handler ); 128 return self; 129 }, 130 /** 131 * Remove a previously-attached event handler from the class instance 132 * @param {String} eventType A string containing event type, such as 'beforeShow' or 'change' 133 * @param {Function} [handler] The function that is to be no longer executed. 134 * @chainable 135 */ 136 off: function( eventType, handler ) { 137 const self = this; 138 if ( self.$$events === _undefined || self.$$events[ eventType ] === _undefined ) { 139 return self; 140 } 141 if ( handler !== _undefined ) { 142 var handlerPos = jQuery.inArray( handler, self.$$events[ eventType ] ); 143 if ( handlerPos != - 1 ) { 144 self.$$events[ eventType ].splice( handlerPos, 1 ); 145 } 146 } else { 147 self.$$events[ eventType ] = []; 148 } 149 return self; 150 }, 151 /** 152 * Execute all handlers and behaviours attached to the class instance for the given event type 153 * @param {String} eventType A string containing event type, such as 'beforeShow' or 'change' 154 * @param {Array} extraParameters Additional parameters to pass along to the event handler 155 * @chainable 156 */ 157 trigger: function( eventType, extraParameters ) { 158 const self = this; 159 if ( self.$$events === _undefined || self.$$events[ eventType ] === _undefined || self.$$events[ eventType ].length == 0 ) { 160 return self; 161 } 162 var args = arguments, 163 params = ( args.length > 2 || ! Array.isArray( extraParameters ) ) 164 ? Array.prototype.slice.call( args, 1 ) 165 : extraParameters; 166 // First argument is the current class instance 167 params.unshift( self ); 168 for ( var index = 0; index < self.$$events[ eventType ].length; index ++ ) { 169 self.$$events[ eventType ][ index ].apply( self.$$events[ eventType ][ index ], params ); 170 } 171 return self; 172 } 173}; 174 175/** 176 * Determines if mobile 177 * Note: Fixing hovers for devices with both mouse and touch screen 178 * 179 * @return {Boolean} True if mobile, False otherwise 180 */ 181jQuery.isMobile = ( 182 /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( _navigator.userAgent ) 183 || ( _navigator.platform == 'MacIntel' && _navigator.maxTouchPoints > 1 ) 184); 185 186/** 187 * Commonly used jQuery objects 188 */ 189! function( $ ) { 190 $us.$window = $( _window ); 191 $us.$document = $( _document ); 192 $us.$html = $( 'html' ); 193 $us.$body = $( '.l-body:first' ); 194 $us.$htmlBody = $us.$html.add( $us.$body ); 195 $us.$canvas = $( '.l-canvas:first' ); 196 197 /** 198 * Determines if context of Live Builder. 199 * 200 * @return {Boolean} True if context of Live Builder, False otherwise. 201 */ 202 $us.usbPreview = () => { 203 return _document.body.className.includes( 'usb_preview' ); 204 }; 205 206 // Add class to define touch devices 207 if ( $us.iOS ) { 208 // For all iOS devices 209 $us.$html.removeClass( 'no-touch' ).addClass( 'ios-touch' ); 210 211 } else if ( $.isMobile || $ush.isTouchend ) { 212 // For all mobile or supported touch devices 213 $us.$html.removeClass( 'no-touch' ).addClass( 'touch' ); 214 } else { 215 // All other devices without touch support 216 } 217 218}( jQuery ); 219 220/** 221 * Helper Global Methods 222 */ 223! function( $ ) { 224 /** 225 * Get the current state. 226 * 227 * @return {String} Returns the current state (default|laptops|tablets|mobiles). 228 */ 229 $us.getCurrentState = () => { 230 return $ush.toString( $us.$body.usMod( 'state' ) ); 231 }; 232 233 /** 234 * Checks if given state is current state. 235 * 236 * @param {String|[]} state State to be compared with. 237 * @return {Boolean} True if the state matches, False otherwise. 238 */ 239 $us.currentStateIs = ( state ) => { 240 if ( ! state ) { 241 return false; 242 } 243 if ( ! Array.isArray( state ) ) { 244 state = [ $ush.toString( state ) ]; 245 } 246 return state.includes( $us.getCurrentState() ); 247 }; 248 249 /** 250 * Get the admin bar height. 251 * 252 * @return {Number} Returns the height of the admin bar if it exists. 253 */ 254 $us.getAdminBarHeight = () => { 255 return ( _document.getElementById('wpadminbar') || {} ).offsetHeight || 0; 256 }; 257} ( jQuery ); 258 259/** 260 * $us.canvas 261 * 262 * All the needed data and functions to work with overall canvas. 263 * 264 * TODO: Check all data that is linked from `$us.header` and use the functionality 265 * of object `$us.header` and clear the current object. 266 */ 267! function( $ ) { 268 "use strict"; 269
270 function USCanvas( options ) { 271 const self = this; 272 273 // Setting options 274 const defaults = { 275 disableEffectsWidth: 900, 276 backToTopDisplay: 100 277 }; 278 279 self.options = $.extend( {}, defaults, options || {} ); 280 281 // Commonly used dom elements 282 self.$header = $( '.l-header', $us.$canvas ); 283 self.$main = $( '.l-main', $us.$canvas ); 284 // Content sections 285 self.$sections = $( '> *:not(.l-header) .l-section', $us.$canvas ); 286 self.$firstSection = self.$sections.first(); 287 self.$secondSection = self.$sections.eq( 1 ); 288 self.$stickySections = self.$sections.filter( '.type_sticky:visible' ); 289 self.$fullscreenSections = self.$sections.filter( '.full_height' ); 290 self.$topLink = $( '.w-toplink' ); 291 292 // Canvas modificators 293 self.type = $us.$canvas.usMod( 'type' ); 294 // Initial header position 295 self._headerPos = self.$header.usMod( 'pos' ); 296 // Current header position 297 self.headerPos = self._headerPos; 298 self.headerBg = self.$header.usMod( 'bg' ); 299 self.rtl = $us.$body.hasClass( 'rtl' ); 300 301 // Used to prevent resize events on scroll for Android browsers 302 self.isScrolling = false; 303 self.isAndroid = /Android/i.test( _navigator.userAgent ); 304 305 // Bondable events 306 self._events = { 307 scroll: self.scroll.bind( self ), 308 resize: self.resize.bind( self ), 309 toggleClassIsSticky: self.toggleClassIsSticky.bind( self ), 310 } 311 312 // If in iframe... 313 if ( $us.$body.hasClass( 'us_iframe' ) ) { 314 // change links so they lead to main window 315 $( 'a:not([target])' ).each( ( _, node ) => $( node ).attr( 'target', '_parent' ) ); 316 // hide preloader 317 $( () => $( '.l-popup-box-content .g-preloader', _window.parent.document ).hide() ); 318 } 319 320 // Class assignments for adjusting header position via css. 321 if ( self.hasStickyFirstSection() ) { 322 $us.$body.addClass( 'sticky_first_section' ); 323 } 324 325 // Events 326 $us.$window 327 .on( 'scroll.noPreventDefault', self._events.scroll ) 328 .on( 'resize load', self._events.resize ) 329 .on( 'scroll.noPreventDefault resize load', self._events.toggleClassIsSticky ); 330 331 // Complex logics requires two initial renders: before inner elements render and after 332 $ush.timeout( self._events.resize, 25 ); 333 $ush.timeout( self._events.resize, 75 ); 334 } 335 336 USCanvas.prototype = { 337 338 /** 339 * Get the offset top. 340 * 341 * @return {Number} The offset top. 342 */ 343 getOffsetTop: function() { 344 var top = Math.ceil( $us.$canvas.offset().top ); 345 if ( $us.currentStateIs( 'mobiles' ) ) { 346 top -= $us.getAdminBarHeight(); 347 } 348 return top; 349 }, 350 351 /** 352 * Determines if sticky section. 353 * 354 * @return {Boolean} True if sticky section, False otherwise. 355 */ 356 isStickySection: function() { 357 return this.$stickySections.length > 0; 358 }, 359 360 /** 361 * Determines if there is a sticky active section 362 * 363 * @return {Boolean} True if sticky section, False otherwise. 364 */ 365 hasStickySection: function () { 366 const self = this; 367 if ( self.isStickySection() ) { 368 return self.$stickySections.hasClass( 'is_sticky' ); 369 } 370 return false 371 }, 372 373 /** 374 * Determines if position sticky sections. 375 * 376 * @return {Boolean} True if position sticky sections, False otherwise. 377 */ 378 hasPositionStickySections: function() { 379 const self = this; 380 if ( self.isStickySection() ) { 381 return self.$stickySections 382 .filter( ( _, node ) => { return $( node ).css( 'position' ) == 'sticky' } ) 383 .length > 0; 384 } 385 return false; 386 }, 387 388 /** 389 * Get the height first sticky section. 390 * 391 * @return {Number} The height first sticky section. 392 */ 393 getStickySectionHeight: function() { 394 const self = this; 395 var stickySectionHeight = 0; 396 if ( self.isStickySection() ) { 397 var header = $us.header, 398 $stickySection = self.$stickySections.first(); 399 stickySectionHeight = $stickySection.outerHeight( true ); 400 // If the first section on page is sticky, it has header height added to its padding 401 // Subtracting the header height from function return value in this case 402 if ( self.hasStickyFirstSection() && header.isHorizontal() && ! header.isStatic() ) { 403 stickySectionHeight -= header.getCurrentHeight(); 404 } 405 } 406 return stickySectionHeight; 407 }, 408 409 /** 410 * Determines if sticky first section. 411 * 412 * @return {boolean}
412 True if first sticky section, False otherwise. 413 */ 414 hasStickyFirstSection: function() { 415 const self = this; 416 const $first = self.$stickySections.first(); 417 return self.isStickySection() && $first.index() === 0 && $first.hasClass( 'is_sticky' ); 418 }, 419 420 /** 421 * Checks that the specified section is after the sticky section. 422 * 423 * @param {*} node Start node 424 * @return {Boolean} True if after sticky section, False otherwise. 425 */ 426 isAfterStickySection: function( node ) { 427 var $node = $( node ); 428 if ( $node.length == 0 ) { 429 return false; 430 } 431 if ( ! $node.hasClass( 'l-section' ) ) { 432 $node = $node.closest( '.l-section' ); 433 } 434 return $node.index() > this.$stickySections.index(); 435 }, 436 437 /** 438 * Gets the height first section. 439 * 440 * @return {number} The height first section. 441 */ 442 getHeightFirstSection: function() { 443 return this.$firstSection.length > 0 444 ? parseFloat( this.$firstSection.outerHeight( true ) ) 445 : 0; 446 }, 447 448 /** 449 * Scroll-driven logics 450 * 451 * @event handler 452 */ 453 scroll: function() { 454 const self = this; 455 const scrollTop = parseInt( $us.$window.scrollTop() ); 456 457 // Show/hide go to top link 458 self.$topLink 459 .toggleClass( 'active', ( scrollTop >= self.winHeight * self.options.backToTopDisplay / 100 ) ); 460 461 if ( self.isAndroid ) { 462 if ( self.pid ) { 463 $ush.clearTimeout( self.pid ); 464 } 465 self.isScrolling = true; 466 self.pid = $ush.timeout( () => { 467 self.isScrolling = false; 468 }, 100 ); 469 } 470 }, 471 472 /** 473 * Resize-driven logics 474 * 475 * @event handler 476 */ 477 resize: function() { 478 const self = this; 479 480 // Window dimensions 481 self.winHeight = parseInt( $us.$window.height() ); 482 self.winWidth = parseInt( $us.$window.width() ); 483 484 // Disabling animation on mobile devices 485 $us.$body.toggleClass( 'disable_effects', ( self.winWidth < self.options.disableEffectsWidth ) ); 486 487 // If the page is loaded in iframe 488 if ( $us.$body.hasClass( 'us_iframe' ) ) { 489 var $frameContent = $( '.l-popup-box-content', _window.parent.document ), 490 outerHeight = $us.$body.outerHeight( true ); 491 if ( outerHeight > 0 && $( _window.parent ).height() > outerHeight ) { 492 $frameContent.css( 'height', outerHeight ); 493 } else { 494 $frameContent.css( 'height', '' ); 495 } 496 } 497 498 // Fix scroll glitches that could occur after the resize 499 self.scroll(); 500 }, 501 502 /** 503 * Determining whether a section is fixed sticky or not 504 * 505 * @event handler 506 */ 507 toggleClassIsSticky: function() { 508 const self = this; 509 if ( ! self.isStickySection() ) { 510 return; 511 } 512 self.$stickySections.each( ( _, section ) => { 513 const $section = $( section ); 514 const offsetTop = section.getBoundingClientRect().top - parseInt( $section.css( 'top' ) ); 515 $section 516 .toggleClass( 'is_sticky', ( parseInt( offsetTop ) === 0 && $section.css( 'position' ) == 'sticky' ) ); 517 } ); 518 } 519 }; 520 521 $us.canvas = new USCanvas( $us.canvasOptions || {} ); 522 523}( jQuery ); 524 525/** 526 * CSS-analog of jQuery slideDown/slideUp/fadeIn/fadeOut functions (for better rendering) 527 */ 528! function( $ ) { 529 530 /** 531 * Remove the passed inline CSS attributes. 532 * 533 * Usage: `$node.resetInlineCSS( 'height', 'width' )` or `$node.resetInlineCSS( [ 'height', 'width' ] )` 534 */ 535 $.fn.resetInlineCSS = function() { 536 const self = this; 537 var args = [].slice.call( arguments ); 538 if ( args.length > 0 && Array.isArray( args[0] ) ) { 539 args = args[0]; 540 } 541 for ( var index = 0; index < args.length; index++ ) { 542 self.css( args[ index ], '' ); 543 } 544 return self; 545 }; 546 547 $.fn.clearPreviousTransitions = function() { 548 const self = this; 549 // Stopping previous events, if there were any 550 const prevTimers = ( self.data( 'animation-timers' ) || '' ).split( ',' ); 551 if ( prevTimers.length >= 2 ) { 552 self.resetInlineCSS( 'transition' ); 553 prevTimers.map( clearTimeout ); 554 self.removeData( 'animation-timers' ); 555 } 556 return self; 557 }; 558 559 /** 560 * 561 * @param {Object} css key-value pairs of animated css 562 * @param {Number} duration in milliseconds 563 * @param {Function} onFinish 564 * @param {String} easing CSS easing name 565 * @param {Number} delay in milliseconds 566 */ 567 $.fn.performCSSTransition = function( css, duration, onFinish, easing, delay ) { 568 const self = this; 569 570 var transition = []; 571 572 duration = duration || 250; 573 delay = delay || 25; 574 easing = easing || 'ease'; 575 576 self.clearPreviousTransitions(); 577 578 for ( const attr in css ) { 579 if ( ! css.hasOwnProperty( attr ) ) { 580 continue; 581 } 582 transition.push( attr + ' ' + ( duration / 1000 ) + 's ' + easing ); 583 } 584 transition = transition.join( ', ' ); 585 self.css( { 586 transition: transition 587 } ); 588 589 // Starting the transition with a slight delay for the proper application of CSS transition properties 590 const timer1 = setTimeout( () => self.css( css ), delay ); 591 const timer2 = setTimeout( () => { 592 self.resetInlineCSS( 'transition' ); 593 if ( typeof onFinish === 'function' ) { 594 onFinish(); 595 } 596 }, duration + delay ); 597 598 self.data( 'animation-timers', timer1 + ',' + timer2 ); 599 }; 600 601 // Height animations 602 $.fn.slideDownCSS = function( duration, onFinish, easing, delay ) { 603 const self = this; 604 if ( self.length == 0 ) { 605 return; 606 } 607 self.clearPreviousTransitions(); 608 // Grabbing paddings 609 self.resetInlineCSS( 'padding-top', 'padding-bottom' ); 610 const timer1 = setTimeout( () => { 611 const paddingTop = parseInt( self.css( 'padding-top' ) );
612 const paddingBottom = parseInt( self.css( 'padding-bottom' ) ); 613 // Grabbing the "auto" height in px 614 self.css( { 615 visibility: 'hidden', 616 position: 'absolute', 617 height: 'auto', 618 'padding-top': 0, 619 'padding-bottom': 0, 620 display: 'block' 621 } ); 622 var height = self.height(); 623 self.css( { 624 overflow: 'hidden', 625 height: '0px', 626 opacity: 0, 627 visibility: '', 628 position: '' 629 } ); 630 self.performCSSTransition( { 631 opacity: 1, 632 height: height + paddingTop + paddingBottom, 633 'padding-top': paddingTop, 634 'padding-bottom': paddingBottom 635 }, duration, () => { 636 self.resetInlineCSS( 'overflow' ).css( 'height', 'auto' ); 637 if ( typeof onFinish == 'function' ) { 638 onFinish(); 639 } 640 }, easing, delay ); 641 }, 25 ); 642 self.data( 'animation-timers', timer1 + ',null' ); 643 }; 644 645 $.fn.slideUpCSS = function( duration, onFinish, easing, delay ) { 646 const self = this; 647 if ( self.length == 0 ) { 648 return; 649 } 650 self.clearPreviousTransitions(); 651 self.css( { 652 height: self.outerHeight(), 653 overflow: 'hidden', 654 'padding-top': self.css( 'padding-top' ), 655 'padding-bottom': self.css( 'padding-bottom' ) 656 } ); 657 self.performCSSTransition( { 658 height: 0, 659 opacity: 0, 660 'padding-top': 0, 661 'padding-bottom': 0 662 }, duration, () => { 663 self.resetInlineCSS( 'overflow', 'padding-top', 'padding-bottom' ).css( 664 { 665 display: 'none' 666 } 667 ); 668 if ( typeof onFinish == 'function' ) { 669 onFinish(); 670 } 671 }, easing, delay ); 672 }; 673 674 // Opacity animations 675 $.fn.fadeInCSS = function( duration, onFinish, easing, delay ) { 676 const self = this; 677 if ( self.length == 0 ) { 678 return; 679 } 680 self.clearPreviousTransitions(); 681 self.css( { opacity: 0, display: 'block' } ); 682 self.performCSSTransition( { opacity: 1 }, duration, onFinish, easing, delay ); 683 }; 684 685 $.fn.fadeOutCSS = function( duration, onFinish, easing, delay ) { 686 const self = this; 687 if ( self.length == 0 ) { 688 return; 689 } 690 self.performCSSTransition( { 691 opacity: 0 692 }, duration, () => { 693 self.css( 'display', 'none' ); 694 if ( typeof onFinish === 'function' ) { 695 onFinish(); 696 } 697 }, easing, delay ); 698 }; 699 700}( jQuery ); 701 702jQuery( function( $ ) { 703 "use strict"; 704 705 if ( _document.cookie.indexOf( 'us_cookie_notice_accepted=true' ) !== -1 ) { 706 $( '.l-cookie' ).remove(); 707 708 } else { 709 $us.$document .on( 'click', '#us-set-cookie', ( e ) => { 710 e.preventDefault(); 711 e.stopPropagation(); 712 const d = new Date(); 713 d.setFullYear( d.getFullYear() + 1 ); 714 _document.cookie = `us_cookie_notice_accepted=true; expires=${d.toUTCString()}; path=/;`; 715 if ( location.protocol === 'https:' ) { 716 _document.cookie += ' secure;'; 717 } 718 $( '.l-cookie' ).remove(); 719 } ); 720 } 721 722 // Color Scheme Switch 723 $( '.w-color-switch input[name=us-color-scheme-switch]' ) 724 .prop( 'checked', $ush.getCookie( 'us_color_scheme_switch_is_on' ) === 'true' ); 725 726 $us.$document.on( 'change', '[name=us-color-scheme-switch]', ( e ) => { 727 if ( $ush.getCookie( 'us_color_scheme_switch_is_on' ) === 'true' ) { 728 $us.$html.removeClass( 'us-color-scheme-on' ); 729 $ush.removeCookie( 'us_color_scheme_switch_is_on' ); 730 } else { 731 $us.$html.addClass( 'us-color-scheme-on' ); 732 $ush.setCookie( 'us_color_scheme_switch_is_on', 'true', 30 ); 733 } 734 735 if ( $us.header.$container.length ) { 736 $us.header.$container.addClass( 'notransition' ); 737 $ush.timeout( () => $us.header.$container.removeClass( 'notransition' ), 50 ); 738 } 739 } ); 740 741 // Force popup opening on links with ref 742 function usPopupLink( context, opts ) { 743 const $links = $( 'a[ref=magnificPopup][class!=direct-link]:not(.inited)', context || _document ); 744 const defaultOptions = { 745 fixedContentPos: true, 746 mainClass: 'mfp-fade', 747 removalDelay: 300, 748 type: 'image' 749 }; 750 if ( $links.length > 0 ) { 751 $links 752 .addClass( 'inited' ) 753 .magnificPopup( $.extend( {}, defaultOptions, opts || {} ) ); 754 } 755 }; 756 $.fn.wPopupLink = function( opts ) { 757 return this.each( function() { 758 $( this ).data( 'usPopupLink', new usPopupLink( this, opts ) ); 759 } ); 760 }; 761 762 $( () => $us.$document.wPopupLink() ); 763 764 // Footer Reveal handler 765 ( function() { 766 const $footer = $( '.l-footer' ); 767 768 if ( $us.$body.hasClass( 'footer_reveal' ) && $footer.length > 0 && $footer.html().trim().length > 0 ) { 769 function usFooterReveal() {
770 var footerHeight = $footer.innerHeight(); 771 if ( _window.innerWidth > parseInt( $us.canvasOptions.columnsStackingWidth ) -1 ) { 772 $us.$canvas.css( 'margin-bottom', Math.round( footerHeight ) -1 ); 773 } else { 774 $us.$canvas.css( 'margin-bottom', '' ); 775 } 776 }; 777 778 usFooterReveal(); 779 $us.$window.on( 'resize load', usFooterReveal ); 780 } 781 } )(); 782 783 /* YouTube/Vimeo background */ 784 const $usYTVimeoVideoContainer = $( '.with_youtube, .with_vimeo' ); 785 if ( $usYTVimeoVideoContainer.length > 0 ) { 786 $us.$window.on( 'resize load', () => { 787 $usYTVimeoVideoContainer.each( function() { 788 var $container = $( this ), 789 $frame = $container.find( 'iframe' ).first(), 790 cHeight = $container.innerHeight(), 791 cWidth = $container.innerWidth(), 792 fWidth = '', 793 fHeight = ''; 794 795 if ( cWidth / cHeight < 16 / 9 ) { 796 fWidth = cHeight * ( 16 / 9 ); 797 fHeight = cHeight; 798 } else { 799 fWidth = cWidth; 800 fHeight = fWidth * ( 9 / 16 ); 801 } 802 803 $frame.css( { 804 'width': Math.round( fWidth ), 805 'height': Math.round( fHeight ), 806 } ); 807 } ); 808 } ); 809 } 810} ); 811 812/** 813 * $us.waypoints 814 */ 815;( function( $ ) { 816 "use strict"; 817 818 function USWaypoints() { 819 const self = this; 820 821 // Waypoints that will be called at certain scroll position 822 self.waypoints = []; 823 824 // Recount scroll waypoints on any content changes 825 $us.$canvas 826 .on( 'contentChange', self._countAll.bind( self ) ); 827 $us.$window 828 .on( 'resize load', self._events.resize.bind( self ) ) 829 .on( 'scroll scroll.waypoints', self._events.scroll.bind( self ) ); 830 831 $ush.timeout( self._events.resize.bind( self ), 75 ); 832 $ush.timeout( self._events.scroll.bind( self ), 75 ); 833 } 834 /** 835 * Export API 836 */ 837 USWaypoints.prototype = { 838 // Handler's 839 _events: { 840 /** 841 * Scroll handler 842 */ 843 scroll: function() { 844 const self = this; 845 var scrollTop = parseInt( $us.$window.scrollTop() ); 846 847 // Safari negative scroller fix 848 scrollTop = ( scrollTop >= 0 ) ? scrollTop : 0; 849 850 // Handling waypoints 851 for ( var i = 0; i < self.waypoints.length; i ++ ) { 852 if ( self.waypoints[ i ].scrollPos < scrollTop ) { 853 self.waypoints[ i ].fn( self.waypoints[ i ].$node ); 854 self.waypoints.splice( i, 1 ); 855 i --; 856 } 857 } 858 }, 859 /** 860 * Resize handler 861 */ 862 resize: function() { 863 const self = this; 864 // Delaying the resize event to prevent glitches 865 $ush.timeout( () => { 866 self._countAll.call( self ); 867 self._events.scroll.call( self ); 868 }, 150 ); 869 self._countAll.call( self ); 870 self._events.scroll.call( self ); 871 } 872 }, 873 /** 874 * Add new waypoint 875 * 876 * @param {jQuery} $node object with the element 877 * @param {*} offset Offset from bottom of screen in pixels ('100') or percents ('20%') 878 * @param {Function} fn The function that will be called 879 */ 880 add: function( $node, offset, fn ) { 881 const self = this; 882 $node = ( $node instanceof $ ) ? $node : $( $node ); 883 if ( $node.length == 0 ) { 884 return; 885 } 886 if ( typeof offset != 'string' || offset.indexOf( '%' ) == - 1 ) { 887 // Not percent: using pixels 888 offset = parseInt( offset ); 889 } 890 // Determining whether an element is already in the scope, 891 // if it is visible, reset offset 892 if ( $node.offset().top < ( $us.$window.height() + $us.$window.scrollTop() ) ) { 893 offset = 0; 894 } 895 var waypoint = { 896 $node: $node, offset: offset, fn: fn 897 }; 898 self._count( waypoint ); 899 self.waypoints.push( waypoint ); 900 }, 901 /** 902 * Count target for proper scrolling 903 * 904 * @param {{}} waypoint 905 */ 906 _count: function( waypoint ) { 907 const elmTop = waypoint.$node.offset().top, winHeight = $us.$window.height(); 908 if ( typeof waypoint.offset == 'number' ) { 909 // Offset is defined in pixels 910 waypoint.scrollPos = elmTop - winHeight + waypoint.offset; 911 } else { 912 // Offset is defined in percents 913 waypoint.scrollPos = elmTop - winHeight + winHeight * parseInt( waypoint.offset ) / 100; 914 } 915 }, 916 /** 917 * Count all targets for proper scrolling 918 */ 919 _countAll: function() { 920 const self = this; 921 // Counting waypoints 922 for ( var i = 0; i < self.waypoints.length; i ++ ) { 923 self._count( self.waypoints[ i ] ); 924 } 925 } 926 };
927 $us.waypoints = new USWaypoints; 928})( jQuery ); 929 930;( function() { 931 var lastTime = 0; 932 const vendors = ['ms', 'moz', 'webkit', 'o']; 933 for ( var x = 0; x < vendors.length && ! _window.requestAnimationFrame; ++ x ) { 934 _window.requestAnimationFrame = _window[ vendors[ x ] + 'RequestAnimationFrame' ]; 935 _window.cancelAnimationFrame = _window[ vendors[ x ] + 'CancelAnimationFrame' ] || _window[ vendors[ x ] + 'CancelRequestAnimationFrame' ]; 936 } 937 if ( ! _window.requestAnimationFrame ) { 938 _window.requestAnimationFrame = ( callback, element ) => { 939 const currTime = new Date().getTime(); 940 const timeToCall = Math.max( 0, 16 - ( currTime - lastTime ) ); 941 const id = _window.setTimeout( () => callback( currTime + timeToCall ), timeToCall ); 942 lastTime = currTime + timeToCall; 943 return id; 944 }; 945 } 946 if ( ! _window.cancelAnimationFrame ) { 947 _window.cancelAnimationFrame = ( id ) => clearTimeout( id ); 948 } 949}() ); 950 951/* 952 * Remove empty space before content for video post type with active preview 953 */ 954! function( $ ) { 955 if ( $us.$body.hasClass( 'single-format-video' ) ) { 956 $( 'figure.wp-block-embed div.wp-block-embed__wrapper', $us.$body ).each( ( _, node ) => { 957 if ( node.firstElementChild === null ) { 958 node.remove(); 959 } 960 } ); 961 } 962}( jQuery ); 963 964/* 965 * With "Show More" link, used in Text Block and Post Content elements 966 */ 967! function( $ ) { 968 "use strict"; 969 970 function usCollapsibleContent( container ) { 971 const self = this; 972 973 /** 974 * @var {{}} Bondable events. 975 */ 976 self._events = { 977 showContent: self.showContent.bind( self ), 978 }; 979 980 // Elements 981 self.$container = $( container ); 982 self.$firstElement = $( '> *:first', self.$container ); 983 self.collapsedHeight = self.$container.data( 'content-height' ) || 200; 984 985 // Events 986 self.$container 987 .on( 'click', '.collapsible-content-more, .collapsible-content-less', self._events.showContent ); 988 989 // Init if not in Owl Carousel context 990 if ( self.$container.closest( '.owl-carousel' ).length == 0 ) { 991 self.setHeight.call( self ); 992 } 993 }; 994 995 // Collapsible Content API 996 usCollapsibleContent.prototype = { 997 998 setHeight: function() { 999 const self = this; 1000 1001 // Set the height to the element in any unit of measurement and get the height in pixels 1002 let collapsedHeight = self.$firstElement.css( 'height', self.collapsedHeight ).height(); 1003 self.$firstElement.css( 'height', '' ); 1004 let heightFirstElement = self.$firstElement.height(); 1005 1006 if ( heightFirstElement && heightFirstElement <= collapsedHeight ) { 1007 $( '.toggle-links', self.$container ).hide(); 1008 self.$firstElement.css( 'height', '' ); 1009 self.$container.removeClass( 'with_collapsible_content' ); 1010 } else { 1011 $( '.toggle-links', self.$container ).show(); 1012 self.$firstElement.css( 'height', self.collapsedHeight ); 1013 } 1014 }, 1015 1016 /** 1017 * Toggle show or hide content. 1018 * 1019 * @param {Event} e The Event interface represents an event which takes place in the DOM 1020 */ 1021 showContent: function( e ) { 1022 const self = this; 1023 1024 e.preventDefault(); 1025 e.stopPropagation(); 1026 1027 self.$container 1028 .toggleClass( 'show_content', $( e.target ).hasClass( 'collapsible-content-more' ) ) 1029 .trigger( 'showContent' ); 1030 $ush.timeout( () => { 1031 $us.$canvas.trigger( 'contentChange' ); 1032 if ( $.isMobile && ! $ush.isNodeInViewport( self.$container[0] ) ) { 1033 $us.$htmlBody 1034 .stop( true, false ) 1035 .scrollTop( self.$container.offset().top - $us.header.getCurrentHeight( /* adminBar */true ) ); 1036 } 1037 }, 1 ); 1038 } 1039 }; 1040 1041 $.fn.usCollapsibleContent = function() { 1042 return this.each( function() { 1043 $( this ).data( 'usCollapsibleContent', new usCollapsibleContent( this ) ); 1044 } ); 1045 }; 1046 1047 $( '[data-content-height]', $us.$canvas ).usCollapsibleContent(); 1048 1049 // Init in Post\Product List or Grid context 1050 $us.$document.on( 'usPostList.itemsLoaded usGrid.itemsLoaded', ( _, $items ) => { 1051 $( '[data-content-height]', $items ).usCollapsibleContent(); 1052 } ); 1053 1054 /** 1055 * Additional event validation for scanned Owl Carousel items 1056 */ 1057 if ( $( '.owl-carousel', $us.$canvas ).length > 0 ) { 1058 $us.$canvas.on( 'click', '.collapsible-content-more, .collapsible-content-less', ( e ) => { 1059 const $target = $( e.target );
1060 const $container = $target.closest( '[data-content-height]' ); 1061 if ( ! $container.data( 'usCollapsibleContent' ) ) { 1062 $container.usCollapsibleContent(); 1063 $target.trigger( 'click' ); 1064 } 1065 } ); 1066 } 1067 1068}( jQuery ); 1069 1070/** 1071 * Will fire the original resize event so that the video element 1072 * recalculates the width and height of the player in WPopup 1073 */ 1074! function( $ ) { 1075 $us.$window.on( 'us.wpopup.afterShow', ( _, WPopup ) => { 1076 if ( WPopup instanceof $us.WPopup && $( 'video.wp-video-shortcode', WPopup.$box ).length > 0 ) { 1077 const handle = $ush.timeout( () => { 1078 $ush.clearTimeout( handle ); 1079 _window.dispatchEvent( new Event( 'resize' ) ); 1080 }, 1 ); 1081 } 1082 } ); 1083}( jQuery ); 1084 1085/** 1086 * Scrollbar settings for all popups 1087 */ 1088! function( $ ) { 1089 "use strict"; 1090 1091 $us.scrollbarWidth = function( force ) { 1092 const self = this; 1093 if ( $ush.isUndefined( self.width ) || force ) { 1094 const scrollDiv = _document.createElement( 'div' ); 1095 scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; 1096 _document.body.appendChild( scrollDiv ); 1097 self.width = scrollDiv.offsetWidth - scrollDiv.clientWidth; 1098 _document.body.removeChild( scrollDiv ); 1099 } 1100 return self.width; 1101 }; 1102 1103 if ( $.magnificPopup ) { 1104 1105 // Override MagnificPopup methods 1106 const origMfpOpen = $.magnificPopup.proto.open; 1107 const origMfpClose = $.magnificPopup.proto.close; 1108 1109 $.magnificPopup.proto.open = function() { 1110 const result = origMfpOpen.apply( this, arguments ); 1111 $us.$html.removeAttr( 'style' ); 1112 $us.$document.trigger( 'usPopupOpened', this ); 1113 return result; 1114 }; 1115 1116 $.magnificPopup.proto.close = function() { 1117 const result = origMfpClose.apply( this, arguments ); 1118 $us.$document.trigger( 'usPopupClosed', this ); 1119 return result; 1120 }; 1121 } 1122 1123 $us.$document.on( 'usPopupOpened', () => { 1124 $us.$html.addClass( 'us_popup_is_opened' ); 1125 if ( ! $.isMobile && $us.$html[0].scrollHeight > $us.$html[0].clientHeight ) { 1126 const scrollbarWidth = $us.scrollbarWidth(); 1127 if ( scrollbarWidth ) { 1128 $us.$html.css( '--scrollbar-width', scrollbarWidth + 'px' ); 1129 } 1130 } 1131 } ); 1132 1133 $us.$document.on( 'usPopupClosed', () => { 1134 $us.$html.removeClass( 'us_popup_is_opened' ); 1135 if ( ! $.isMobile ) { 1136 $us.$html.css( '--scrollbar-width', '' ); 1137 } 1138 } ); 1139 1140}( 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.