(function(factory){
if(typeof define==='function'&&define.amd){
define(['jquery'], factory);
}else if(typeof module==='object'&&typeof module.exports==='object'){
module.exports=factory(require('jquery'));
}else{
factory(jQuery);
}} (function($){
var menuTrees=[],
mouse=false,
touchEvents='ontouchstart' in window,
mouseDetectionEnabled=false,
requestAnimationFrame=window.requestAnimationFrame||function(callback){ return setTimeout(callback, 1000 / 60); },
cancelAnimationFrame=window.cancelAnimationFrame||function(id){ clearTimeout(id); },
canAnimate = !!$.fn.animate;
function initMouseDetection(disable){
var eNS='.smartmenus_mouse';
if(!mouseDetectionEnabled&&!disable){
var firstTime=true,
lastMove=null,
events={
'mousemove': function(e){
var thisMove={ x: e.pageX, y: e.pageY, timeStamp: new Date().getTime() };
if(lastMove){
var deltaX=Math.abs(lastMove.x - thisMove.x),
deltaY=Math.abs(lastMove.y - thisMove.y);
if((deltaX > 0||deltaY > 0)&&deltaX <=4&&deltaY <=4&&thisMove.timeStamp - lastMove.timeStamp <=300){
mouse=true;
if(firstTime){
var $a=$(e.target).closest('a');
if($a.is('a')){
$.each(menuTrees, function(){
if($.contains(this.$root[0], $a[0])){
this.itemEnter({ currentTarget: $a[0] });
return false;
}});
}
firstTime=false;
}}
}
lastMove=thisMove;
}};
events[touchEvents ? 'touchstart':'pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut']=function(e){
if(isTouchEvent(e.originalEvent)){
mouse=false;
}};
$(document).on(getEventsNS(events, eNS));
mouseDetectionEnabled=true;
}else if(mouseDetectionEnabled&&disable){
$(document).off(eNS);
mouseDetectionEnabled=false;
}}
function isTouchEvent(e){
return !/^(4|mouse)$/.test(e.pointerType);
}
function getEventsNS(events, eNS){
if(!eNS){
eNS='';
}
var eventsNS={};
for (var i in events){
eventsNS[i.split(' ').join(eNS + ' ') + eNS]=events[i];
}
return eventsNS;
}
$.SmartMenus=function(elm, options){
this.$root=$(elm);
this.opts=options;
this.rootId='';
this.accessIdPrefix='';
this.$subArrow=null;
this.activatedItems=[];
this.visibleSubMenus=[];
this.showTimeout=0;
this.hideTimeout=0;
this.scrollTimeout=0;
this.clickActivated=false;
this.focusActivated=false;
this.zIndexInc=0;
this.idInc=0;
this.$firstLink=null;
this.$firstSub=null;
this.disabled=false;
this.$disableOverlay=null;
this.$touchScrollingSub=null;
this.cssTransforms3d='perspective' in elm.style||'webkitPerspective' in elm.style;
this.wasCollapsible=false;
this.init();
};
$.extend($.SmartMenus, {
hideAll: function(){
$.each(menuTrees, function(){
this.menuHideAll();
});
},
destroy: function(){
while (menuTrees.length){
menuTrees[0].destroy();
}
initMouseDetection(true);
},
prototype: {
init: function(refresh){
var self=this;
if(!refresh){
menuTrees.push(this);
this.rootId=(new Date().getTime() + Math.random() + '').replace(/\D/g, '');
this.accessIdPrefix='sm-' + this.rootId + '-';
if(this.$root.hasClass('sm-rtl')){
this.opts.rightToLeftSubMenus=true;
}
var eNS='.smartmenus';
this.$root
.data('smartmenus', this)
.attr('data-smartmenus-id', this.rootId)
.dataSM('level', 1)
.on(getEventsNS({
'mouseover focusin': $.proxy(this.rootOver, this),
'mouseout focusout': $.proxy(this.rootOut, this),
'keydown': $.proxy(this.rootKeyDown, this)
}, eNS))
.on(getEventsNS({
'mouseenter': $.proxy(this.itemEnter, this),
'mouseleave': $.proxy(this.itemLeave, this),
'mousedown': $.proxy(this.itemDown, this),
'focus': $.proxy(this.itemFocus, this),
'blur': $.proxy(this.itemBlur, this),
'click': $.proxy(this.itemClick, this)
}, eNS), 'a');
eNS +=this.rootId;
if(this.opts.hideOnClick){
$(document).on(getEventsNS({
'touchstart': $.proxy(this.docTouchStart, this),
'touchmove': $.proxy(this.docTouchMove, this),
'touchend': $.proxy(this.docTouchEnd, this),
'click': $.proxy(this.docClick, this)
}, eNS));
}
$(window).on(getEventsNS({ 'resize orientationchange': $.proxy(this.winResize, this) }, eNS));
if(this.opts.subIndicators){
this.$subArrow=$('<span/>').addClass('sub-arrow');
if(this.opts.subIndicatorsText){
this.$subArrow.html(this.opts.subIndicatorsText);
}}
initMouseDetection();
}
this.$firstSub=this.$root.find('ul').each(function(){ self.menuInit($(this)); }).eq(0);
this.$firstLink=this.$root.find('a').eq(0);
if(this.opts.markCurrentItem){
var reDefaultDoc=/(index|default)\.[^#\?\/]*/i,
reHash=/#.*/,
locHref=window.location.href.replace(reDefaultDoc, ''),
locHrefNoHash=locHref.replace(reHash, '');
this.$root.find('a:not(.mega-menu a)').each(function(){
var href=this.href.replace(reDefaultDoc, ''),
$this=$(this);
if(href==locHref||href==locHrefNoHash){
$this.addClass('current');
if(self.opts.markCurrentTree){
$this.parentsUntil('[data-smartmenus-id]', 'ul').each(function(){
$(this).dataSM('parent-a').addClass('current');
});
}}
});
}
this.wasCollapsible=this.isCollapsible();
},
destroy: function(refresh){
if(!refresh){
var eNS='.smartmenus';
this.$root
.removeData('smartmenus')
.removeAttr('data-smartmenus-id')
.removeDataSM('level')
.off(eNS);
eNS +=this.rootId;
$(document).off(eNS);
$(window).off(eNS);
if(this.opts.subIndicators){
this.$subArrow=null;
}}
this.menuHideAll();
var self=this;
this.$root.find('ul').each(function(){
var $this=$(this);
if($this.dataSM('scroll-arrows')){
$this.dataSM('scroll-arrows').remove();
}
if($this.dataSM('shown-before')){
if(self.opts.subMenusMinWidth||self.opts.subMenusMaxWidth){
$this.css({ width: '', minWidth: '', maxWidth: '' }).removeClass('sm-nowrap');
}
if($this.dataSM('scroll-arrows')){
$this.dataSM('scroll-arrows').remove();
}
$this.css({ zIndex: '', top: '', left: '', marginLeft: '', marginTop: '', display: '' });
}
if(($this.attr('id')||'').indexOf(self.accessIdPrefix)==0){
$this.removeAttr('id');
}})
.removeDataSM('in-mega')
.removeDataSM('shown-before')
.removeDataSM('scroll-arrows')
.removeDataSM('parent-a')
.removeDataSM('level')
.removeDataSM('beforefirstshowfired')
.removeAttr('role')
.removeAttr('aria-hidden')
.removeAttr('aria-labelledby')
.removeAttr('aria-expanded');
this.$root.find('a.has-submenu').each(function(){
var $this=$(this);
if($this.attr('id').indexOf(self.accessIdPrefix)==0){
$this.removeAttr('id');
}})
.removeClass('has-submenu')
.removeDataSM('sub')
.removeAttr('aria-haspopup')
.removeAttr('aria-controls')
.removeAttr('aria-expanded')
.closest('li').removeDataSM('sub');
if(this.opts.subIndicators){
this.$root.find('span.sub-arrow').remove();
}
if(this.opts.markCurrentItem){
this.$root.find('a.current').removeClass('current');
}
if(!refresh){
this.$root=null;
this.$firstLink=null;
this.$firstSub=null;
if(this.$disableOverlay){
this.$disableOverlay.remove();
this.$disableOverlay=null;
}
menuTrees.splice($.inArray(this, menuTrees), 1);
}},
disable: function(noOverlay){
if(!this.disabled){
this.menuHideAll();
if(!noOverlay&&!this.opts.isPopup&&this.$root.is(':visible')){
var pos=this.$root.offset();
this.$disableOverlay=$('<div class="sm-jquery-disable-overlay"/>').css({
position: 'absolute',
top: pos.top,
left: pos.left,
width: this.$root.outerWidth(),
height: this.$root.outerHeight(),
zIndex: this.getStartZIndex(true),
opacity: 0
}).appendTo(document.body);
}
this.disabled=true;
}},
docClick: function(e){
if(this.$touchScrollingSub){
this.$touchScrollingSub=null;
return;
}
if(this.visibleSubMenus.length&&!$.contains(this.$root[0], e.target)||$(e.target).closest('a').length){
this.menuHideAll();
}},
docTouchEnd: function(e){
if(!this.lastTouch){
return;
}
if(this.visibleSubMenus.length&&(this.lastTouch.x2===undefined||this.lastTouch.x1==this.lastTouch.x2)&&(this.lastTouch.y2===undefined||this.lastTouch.y1==this.lastTouch.y2)&&(!this.lastTouch.target||!$.contains(this.$root[0], this.lastTouch.target))){
if(this.hideTimeout){
clearTimeout(this.hideTimeout);
this.hideTimeout=0;
}
var self=this;
this.hideTimeout=setTimeout(function(){ self.menuHideAll(); }, 350);
}
this.lastTouch=null;
},
docTouchMove: function(e){
if(!this.lastTouch){
return;
}
var touchPoint=e.originalEvent.touches[0];
this.lastTouch.x2=touchPoint.pageX;
this.lastTouch.y2=touchPoint.pageY;
},
docTouchStart: function(e){
var touchPoint=e.originalEvent.touches[0];
this.lastTouch={ x1: touchPoint.pageX, y1: touchPoint.pageY, target: touchPoint.target };},
enable: function(){
if(this.disabled){
if(this.$disableOverlay){
this.$disableOverlay.remove();
this.$disableOverlay=null;
}
this.disabled=false;
}},
getClosestMenu: function(elm){
var $closestMenu=$(elm).closest('ul');
while ($closestMenu.dataSM('in-mega')){
$closestMenu=$closestMenu.parent().closest('ul');
}
return $closestMenu[0]||null;
},
getHeight: function($elm){
return this.getOffset($elm, true);
},
getOffset: function($elm, height){
var old;
if($elm.css('display')=='none'){
old={ position: $elm[0].style.position, visibility: $elm[0].style.visibility };
$elm.css({ position: 'absolute', visibility: 'hidden' }).show();
}
var box=$elm[0].getBoundingClientRect&&$elm[0].getBoundingClientRect(),
val=box&&(height ? box.height||box.bottom - box.top:box.width||box.right - box.left);
if(!val&&val!==0){
val=height ? $elm[0].offsetHeight:$elm[0].offsetWidth;
}
if(old){
$elm.hide().css(old);
}
return val;
},
getStartZIndex: function(root){
var zIndex=parseInt(this[root ? '$root':'$firstSub'].css('z-index'));
if(!root&&isNaN(zIndex)){
zIndex=parseInt(this.$root.css('z-index'));
}
return !isNaN(zIndex) ? zIndex:1;
},
getTouchPoint: function(e){
return e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0]||e;
},
getViewport: function(height){
var name=height ? 'Height':'Width',
val=document.documentElement['client' + name],
val2=window['inner' + name];
if(val2){
val=Math.min(val, val2);
}
return val;
},
getViewportHeight: function(){
return this.getViewport(true);
},
getViewportWidth: function(){
return this.getViewport();
},
getWidth: function($elm){
return this.getOffset($elm);
},
handleEvents: function(){
return !this.disabled&&this.isCSSOn();
},
handleItemEvents: function($a){
return this.handleEvents()&&!this.isLinkInMegaMenu($a);
},
isCollapsible: function(){
return this.$firstSub.css('position')=='static';
},
isCSSOn: function(){
return this.$firstLink.css('display')!='inline';
},
isFixed: function(){
var isFixed=this.$root.css('position')=='fixed';
if(!isFixed){
this.$root.parentsUntil('body').each(function(){
if($(this).css('position')=='fixed'){
isFixed=true;
return false;
}});
}
return isFixed;
},
isLinkInMegaMenu: function($a){
return $(this.getClosestMenu($a[0])).hasClass('mega-menu');
},
isTouchMode: function(){
return !mouse||this.opts.noMouseOver||this.isCollapsible();
},
itemActivate: function($a, hideDeeperSubs){
var $ul=$a.closest('ul'),
level=$ul.dataSM('level');
if(level > 1&&(!this.activatedItems[level - 2]||this.activatedItems[level - 2][0]!=$ul.dataSM('parent-a')[0])){
var self=this;
$($ul.parentsUntil('[data-smartmenus-id]', 'ul').get().reverse()).add($ul).each(function(){
self.itemActivate($(this).dataSM('parent-a'));
});
}
if(!this.isCollapsible()||hideDeeperSubs){
this.menuHideSubMenus(!this.activatedItems[level - 1]||this.activatedItems[level - 1][0]!=$a[0] ? level - 1:level);
}
this.activatedItems[level - 1]=$a;
if(this.$root.triggerHandler('activate.smapi', $a[0])===false){
return;
}
var $sub=$a.dataSM('sub');
if($sub&&(this.isTouchMode()||(!this.opts.showOnClick||this.clickActivated))){
this.menuShow($sub);
}},
itemBlur: function(e){
var $a=$(e.currentTarget);
if(!this.handleItemEvents($a)){
return;
}
this.$root.triggerHandler('blur.smapi', $a[0]);
},
itemClick: function(e){
var $a=$(e.currentTarget);
if(!this.handleItemEvents($a)){
return;
}
if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==$a.closest('ul')[0]){
this.$touchScrollingSub=null;
e.stopPropagation();
return false;
}
if(this.$root.triggerHandler('click.smapi', $a[0])===false){
return false;
}
var $sub=$a.dataSM('sub'),
firstLevelSub=$sub ? $sub.dataSM('level')==2:false;
if($sub){
var subArrowClicked=$(e.target).is('.sub-arrow'),
collapsible=this.isCollapsible(),
behaviorToggle=/toggle$/.test(this.opts.collapsibleBehavior),
behaviorLink=/link$/.test(this.opts.collapsibleBehavior),
behaviorAccordion=/^accordion/.test(this.opts.collapsibleBehavior);
if(!$sub.is(':visible')){
if(!behaviorLink||!collapsible||subArrowClicked){
if(!collapsible&&this.opts.showOnClick&&firstLevelSub){
this.clickActivated=true;
}
this.itemActivate($a, behaviorAccordion);
if($sub.is(':visible')){
this.focusActivated=true;
return false;
}}
}else if(!collapsible&&this.opts.showOnClick&&firstLevelSub){
this.menuHide($sub);
this.clickActivated=false;
this.focusActivated=false;
return false;
}else if(collapsible&&(behaviorToggle||subArrowClicked)){
this.itemActivate($a, behaviorAccordion);
this.menuHide($sub);
return false;
}}
if(!collapsible&&this.opts.showOnClick&&firstLevelSub||$a.hasClass('disabled')||this.$root.triggerHandler('select.smapi', $a[0])===false){
return false;
}},
itemDown: function(e){
var $a=$(e.currentTarget);
if(!this.handleItemEvents($a)){
return;
}
$a.dataSM('mousedown', true);
},
itemEnter: function(e){
var $a=$(e.currentTarget);
if(!this.handleItemEvents($a)){
return;
}
if(!this.isTouchMode()){
if(this.showTimeout){
clearTimeout(this.showTimeout);
this.showTimeout=0;
}
var self=this;
this.showTimeout=setTimeout(function(){ self.itemActivate($a); }, this.opts.showOnClick&&$a.closest('ul').dataSM('level')==1 ? 1:this.opts.showTimeout);
}
this.$root.triggerHandler('mouseenter.smapi', $a[0]);
},
itemFocus: function(e){
var $a=$(e.currentTarget);
if(!this.handleItemEvents($a)){
return;
}
if(this.focusActivated&&(!this.isTouchMode()||!$a.dataSM('mousedown'))&&(!this.activatedItems.length||this.activatedItems[this.activatedItems.length - 1][0]!=$a[0])){
this.itemActivate($a, true);
}
this.$root.triggerHandler('focus.smapi', $a[0]);
},
itemLeave: function(e){
var $a=$(e.currentTarget);
if(!this.handleItemEvents($a)){
return;
}
if(!this.isTouchMode()){
$a[0].blur();
if(this.showTimeout){
clearTimeout(this.showTimeout);
this.showTimeout=0;
}}
$a.removeDataSM('mousedown');
this.$root.triggerHandler('mouseleave.smapi', $a[0]);
},
menuHide: function($sub){
if(this.$root.triggerHandler('beforehide.smapi', $sub[0])===false){
return;
}
if(canAnimate){
$sub.stop(true, true);
}
if($sub.css('display')!='none'){
var complete=function(){
$sub.css('z-index', '');
};
if(this.isCollapsible()){
if(canAnimate&&this.opts.collapsibleHideFunction){
this.opts.collapsibleHideFunction.call(this, $sub, complete);
}else{
$sub.hide(this.opts.collapsibleHideDuration, complete);
}}else{
if(canAnimate&&this.opts.hideFunction){
this.opts.hideFunction.call(this, $sub, complete);
}else{
$sub.hide(this.opts.hideDuration, complete);
}}
if($sub.dataSM('scroll')){
this.menuScrollStop($sub);
$sub.css({ 'touch-action': '', '-ms-touch-action': '', '-webkit-transform': '', transform: '' })
.off('.smartmenus_scroll').removeDataSM('scroll').dataSM('scroll-arrows').hide();
}
$sub.dataSM('parent-a').removeClass('highlighted').attr('aria-expanded', 'false');
$sub.attr({
'aria-expanded': 'false',
'aria-hidden': 'true'
});
var level=$sub.dataSM('level');
this.activatedItems.splice(level - 1, 1);
this.visibleSubMenus.splice($.inArray($sub, this.visibleSubMenus), 1);
this.$root.triggerHandler('hide.smapi', $sub[0]);
}},
menuHideAll: function(){
if(this.showTimeout){
clearTimeout(this.showTimeout);
this.showTimeout=0;
}
var level=this.opts.isPopup ? 1:0;
for (var i=this.visibleSubMenus.length - 1; i >=level; i--){
this.menuHide(this.visibleSubMenus[i]);
}
if(this.opts.isPopup){
if(canAnimate){
this.$root.stop(true, true);
}
if(this.$root.is(':visible')){
if(canAnimate&&this.opts.hideFunction){
this.opts.hideFunction.call(this, this.$root);
}else{
this.$root.hide(this.opts.hideDuration);
}}
}
this.activatedItems=[];
this.visibleSubMenus=[];
this.clickActivated=false;
this.focusActivated=false;
this.zIndexInc=0;
this.$root.triggerHandler('hideAll.smapi');
},
menuHideSubMenus: function(level){
for (var i=this.activatedItems.length - 1; i >=level; i--){
var $sub=this.activatedItems[i].dataSM('sub');
if($sub){
this.menuHide($sub);
}}
},
menuInit: function($ul){
if(!$ul.dataSM('in-mega')){
if($ul.hasClass('mega-menu')){
$ul.find('ul').dataSM('in-mega', true);
}
var level=2,
par=$ul[0];
while ((par=par.parentNode.parentNode)!=this.$root[0]){
level++;
}
var $a=$ul.prevAll('a').eq(-1);
if(!$a.length){
$a=$ul.prevAll().find('a').eq(-1);
}
$a.addClass('has-submenu').dataSM('sub', $ul);
$ul.dataSM('parent-a', $a)
.dataSM('level', level)
.parent().dataSM('sub', $ul);
var aId=$a.attr('id')||this.accessIdPrefix + (++this.idInc),
ulId=$ul.attr('id')||this.accessIdPrefix + (++this.idInc);
$a.attr({
id: aId,
'aria-haspopup': 'true',
'aria-controls': ulId,
'aria-expanded': 'false'
});
$ul.attr({
id: ulId,
'role': 'group',
'aria-hidden': 'true',
'aria-labelledby': aId,
'aria-expanded': 'false'
});
if(this.opts.subIndicators){
$a[this.opts.subIndicatorsPos](this.$subArrow.clone());
}}
},
menuPosition: function($sub){
var $a=$sub.dataSM('parent-a'),
$li=$a.closest('li'),
$ul=$li.parent(),
level=$sub.dataSM('level'),
subW=this.getWidth($sub),
subH=this.getHeight($sub),
itemOffset=$a.offset(),
itemX=itemOffset.left,
itemY=itemOffset.top,
itemW=this.getWidth($a),
itemH=this.getHeight($a),
$win=$(window),
winX=$win.scrollLeft(),
winY=$win.scrollTop(),
winW=this.getViewportWidth(),
winH=this.getViewportHeight(),
horizontalParent=$ul.parent().is('[data-sm-horizontal-sub]')||level==2&&!$ul.hasClass('sm-vertical'),
rightToLeft=this.opts.rightToLeftSubMenus&&!$li.is('[data-sm-reverse]')||!this.opts.rightToLeftSubMenus&&$li.is('[data-sm-reverse]'),
subOffsetX=level==2 ? this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,
subOffsetY=level==2 ? this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY,
x, y;
if(horizontalParent){
x=rightToLeft ? itemW - subW - subOffsetX:subOffsetX;
y=this.opts.bottomToTopSubMenus ? -subH - subOffsetY:itemH + subOffsetY;
}else{
x=rightToLeft ? subOffsetX - subW:itemW - subOffsetX;
y=this.opts.bottomToTopSubMenus ? itemH - subOffsetY - subH:subOffsetY;
}
if(this.opts.keepInViewport){
var absX=itemX + x,
absY=itemY + y;
if(rightToLeft&&absX < winX){
x=horizontalParent ? winX - absX + x:itemW - subOffsetX;
}else if(!rightToLeft&&absX + subW > winX + winW){
x=horizontalParent ? winX + winW - subW - absX + x:subOffsetX - subW;
}
if(!horizontalParent){
if(subH < winH&&absY + subH > winY + winH){
y +=winY + winH - subH - absY;
}else if(subH >=winH||absY < winY){
y +=winY - absY;
}}
if(horizontalParent&&(absY + subH > winY + winH + 0.49||absY < winY)||!horizontalParent&&subH > winH + 0.49){
var self=this;
if(!$sub.dataSM('scroll-arrows')){
$sub.dataSM('scroll-arrows', $([$('<span class="scroll-up"><span class="scroll-up-arrow"></span></span>')[0], $('<span class="scroll-down"><span class="scroll-down-arrow"></span></span>')[0]])
.on({
mouseenter: function(){
$sub.dataSM('scroll').up=$(this).hasClass('scroll-up');
self.menuScroll($sub);
},
mouseleave: function(e){
self.menuScrollStop($sub);
self.menuScrollOut($sub, e);
},
'mousewheel DOMMouseScroll': function(e){ e.preventDefault(); }})
.insertAfter($sub)
);
}
var eNS='.smartmenus_scroll';
$sub.dataSM('scroll', {
y: this.cssTransforms3d ? 0:y - itemH,
step: 1,
itemH: itemH,
subH: subH,
arrowDownH: this.getHeight($sub.dataSM('scroll-arrows').eq(1))
})
.on(getEventsNS({
'mouseover': function(e){ self.menuScrollOver($sub, e); },
'mouseout': function(e){ self.menuScrollOut($sub, e); },
'mousewheel DOMMouseScroll': function(e){ self.menuScrollMousewheel($sub, e); }}, eNS))
.dataSM('scroll-arrows').css({ top: 'auto', left: '0', marginLeft: x + (parseInt($sub.css('border-left-width'))||0), width: subW - (parseInt($sub.css('border-left-width'))||0) - (parseInt($sub.css('border-right-width'))||0), zIndex: $sub.css('z-index') })
.eq(horizontalParent&&this.opts.bottomToTopSubMenus ? 0:1).show();
if(this.isFixed()){
var events={};
events[touchEvents ? 'touchstart touchmove touchend':'pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp']=function(e){
self.menuScrollTouch($sub, e);
};
$sub.css({ 'touch-action': 'none', '-ms-touch-action': 'none' }).on(getEventsNS(events, eNS));
}}
}
$sub.css({ top: 'auto', left: '0', marginLeft: x, marginTop: y - itemH });
},
menuScroll: function($sub, once, step){
var data=$sub.dataSM('scroll'),
$arrows=$sub.dataSM('scroll-arrows'),
end=data.up ? data.upEnd:data.downEnd,
diff;
if(!once&&data.momentum){
data.momentum *=0.92;
diff=data.momentum;
if(diff < 0.5){
this.menuScrollStop($sub);
return;
}}else{
diff=step||(once||!this.opts.scrollAccelerate ? this.opts.scrollStep:Math.floor(data.step));
}
var level=$sub.dataSM('level');
if(this.activatedItems[level - 1]&&this.activatedItems[level - 1].dataSM('sub')&&this.activatedItems[level - 1].dataSM('sub').is(':visible')){
this.menuHideSubMenus(level - 1);
}
data.y=data.up&&end <=data.y||!data.up&&end >=data.y ? data.y:(Math.abs(end - data.y) > diff ? data.y + (data.up ? diff:-diff):end);
$sub.css(this.cssTransforms3d ? { '-webkit-transform': 'translate3d(0, ' + data.y + 'px, 0)', transform: 'translate3d(0, ' + data.y + 'px, 0)' }:{ marginTop: data.y });
if(mouse&&(data.up&&data.y > data.downEnd||!data.up&&data.y < data.upEnd)){
$arrows.eq(data.up ? 1:0).show();
}
if(data.y==end){
if(mouse){
$arrows.eq(data.up ? 0:1).hide();
}
this.menuScrollStop($sub);
}else if(!once){
if(this.opts.scrollAccelerate&&data.step < this.opts.scrollStep){
data.step +=0.2;
}
var self=this;
this.scrollTimeout=requestAnimationFrame(function(){ self.menuScroll($sub); });
}},
menuScrollMousewheel: function($sub, e){
if(this.getClosestMenu(e.target)==$sub[0]){
e=e.originalEvent;
var up=(e.wheelDelta||-e.detail) > 0;
if($sub.dataSM('scroll-arrows').eq(up ? 0:1).is(':visible')){
$sub.dataSM('scroll').up=up;
this.menuScroll($sub, true);
}}
e.preventDefault();
},
menuScrollOut: function($sub, e){
if(mouse){
if(!/^scroll-(up|down)/.test((e.relatedTarget||'').className)&&($sub[0]!=e.relatedTarget&&!$.contains($sub[0], e.relatedTarget)||this.getClosestMenu(e.relatedTarget)!=$sub[0])){
$sub.dataSM('scroll-arrows').css('visibility', 'hidden');
}}
},
menuScrollOver: function($sub, e){
if(mouse){
if(!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==$sub[0]){
this.menuScrollRefreshData($sub);
var data=$sub.dataSM('scroll'),
upEnd=$(window).scrollTop() - $sub.dataSM('parent-a').offset().top - data.itemH;
$sub.dataSM('scroll-arrows').eq(0).css('margin-top', upEnd).end()
.eq(1).css('margin-top', upEnd + this.getViewportHeight() - data.arrowDownH).end()
.css('visibility', 'visible');
}}
},
menuScrollRefreshData: function($sub){
var data=$sub.dataSM('scroll'),
upEnd=$(window).scrollTop() - $sub.dataSM('parent-a').offset().top - data.itemH;
if(this.cssTransforms3d){
upEnd=-(parseFloat($sub.css('margin-top')) - upEnd);
}
$.extend(data, {
upEnd: upEnd,
downEnd: upEnd + this.getViewportHeight() - data.subH
});
},
menuScrollStop: function($sub){
if(this.scrollTimeout){
cancelAnimationFrame(this.scrollTimeout);
this.scrollTimeout=0;
$sub.dataSM('scroll').step=1;
return true;
}},
menuScrollTouch: function($sub, e){
e=e.originalEvent;
if(isTouchEvent(e)){
var touchPoint=this.getTouchPoint(e);
if(this.getClosestMenu(touchPoint.target)==$sub[0]){
var data=$sub.dataSM('scroll');
if(/(start|down)$/i.test(e.type)){
if(this.menuScrollStop($sub)){
e.preventDefault();
this.$touchScrollingSub=$sub;
}else{
this.$touchScrollingSub=null;
}
this.menuScrollRefreshData($sub);
$.extend(data, {
touchStartY: touchPoint.pageY,
touchStartTime: e.timeStamp
});
}else if(/move$/i.test(e.type)){
var prevY=data.touchY!==undefined ? data.touchY:data.touchStartY;
if(prevY!==undefined&&prevY!=touchPoint.pageY){
this.$touchScrollingSub=$sub;
var up=prevY < touchPoint.pageY;
if(data.up!==undefined&&data.up!=up){
$.extend(data, {
touchStartY: touchPoint.pageY,
touchStartTime: e.timeStamp
});
}
$.extend(data, {
up: up,
touchY: touchPoint.pageY
});
this.menuScroll($sub, true, Math.abs(touchPoint.pageY - prevY));
}
e.preventDefault();
}else{
if(data.touchY!==undefined){
if(data.momentum=Math.pow(Math.abs(touchPoint.pageY - data.touchStartY) / (e.timeStamp - data.touchStartTime), 2) * 15){
this.menuScrollStop($sub);
this.menuScroll($sub);
e.preventDefault();
}
delete data.touchY;
}}
}}
},
menuShow: function($sub){
if(!$sub.dataSM('beforefirstshowfired')){
$sub.dataSM('beforefirstshowfired', true);
if(this.$root.triggerHandler('beforefirstshow.smapi', $sub[0])===false){
return;
}}
if(this.$root.triggerHandler('beforeshow.smapi', $sub[0])===false){
return;
}
$sub.dataSM('shown-before', true);
if(canAnimate){
$sub.stop(true, true);
}
if(!$sub.is(':visible')){
var $a=$sub.dataSM('parent-a'),
collapsible=this.isCollapsible();
if(this.opts.keepHighlighted||collapsible){
$a.addClass('highlighted');
}
if(collapsible){
$sub.removeClass('sm-nowrap').css({ zIndex: '', width: 'auto', minWidth: '', maxWidth: '', top: '', left: '', marginLeft: '', marginTop: '' });
}else{
$sub.css('z-index', this.zIndexInc=(this.zIndexInc||this.getStartZIndex()) + 1);
if(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth){
$sub.css({ width: 'auto', minWidth: '', maxWidth: '' }).addClass('sm-nowrap');
if(this.opts.subMenusMinWidth){
$sub.css('min-width', this.opts.subMenusMinWidth);
}
if(this.opts.subMenusMaxWidth){
var noMaxWidth=this.getWidth($sub);
$sub.css('max-width', this.opts.subMenusMaxWidth);
if(noMaxWidth > this.getWidth($sub)){
$sub.removeClass('sm-nowrap').css('width', this.opts.subMenusMaxWidth);
}}
}
this.menuPosition($sub);
}
var complete=function(){
$sub.css('overflow', '');
};
if(collapsible){
if(canAnimate&&this.opts.collapsibleShowFunction){
this.opts.collapsibleShowFunction.call(this, $sub, complete);
}else{
$sub.show(this.opts.collapsibleShowDuration, complete);
}}else{
if(canAnimate&&this.opts.showFunction){
this.opts.showFunction.call(this, $sub, complete);
}else{
$sub.show(this.opts.showDuration, complete);
}}
$a.attr('aria-expanded', 'true');
$sub.attr({
'aria-expanded': 'true',
'aria-hidden': 'false'
});
this.visibleSubMenus.push($sub);
this.$root.triggerHandler('show.smapi', $sub[0]);
}},
popupHide: function(noHideTimeout){
if(this.hideTimeout){
clearTimeout(this.hideTimeout);
this.hideTimeout=0;
}
var self=this;
this.hideTimeout=setTimeout(function(){
self.menuHideAll();
}, noHideTimeout ? 1:this.opts.hideTimeout);
},
popupShow: function(left, top){
if(!this.opts.isPopup){
alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.');
return;
}
if(this.hideTimeout){
clearTimeout(this.hideTimeout);
this.hideTimeout=0;
}
this.$root.dataSM('shown-before', true);
if(canAnimate){
this.$root.stop(true, true);
}
if(!this.$root.is(':visible')){
this.$root.css({ left: left, top: top });
var self=this,
complete=function(){
self.$root.css('overflow', '');
};
if(canAnimate&&this.opts.showFunction){
this.opts.showFunction.call(this, this.$root, complete);
}else{
this.$root.show(this.opts.showDuration, complete);
}
this.visibleSubMenus[0]=this.$root;
}},
refresh: function(){
this.destroy(true);
this.init(true);
},
rootKeyDown: function(e){
if(!this.handleEvents()){
return;
}
switch (e.keyCode){
case 27:
var $activeTopItem=this.activatedItems[0];
if($activeTopItem){
this.menuHideAll();
$activeTopItem[0].focus();
var $sub=$activeTopItem.dataSM('sub');
if($sub){
this.menuHide($sub);
}}
break;
case 32:
var $target=$(e.target);
if($target.is('a')&&this.handleItemEvents($target)){
var $sub=$target.dataSM('sub');
if($sub&&!$sub.is(':visible')){
this.itemClick({ currentTarget: e.target });
e.preventDefault();
}}
break;
}},
rootOut: function(e){
if(!this.handleEvents()||this.isTouchMode()||e.target==this.$root[0]){
return;
}
if(this.hideTimeout){
clearTimeout(this.hideTimeout);
this.hideTimeout=0;
}
if(!this.opts.showOnClick||!this.opts.hideOnClick){
var self=this;
this.hideTimeout=setTimeout(function(){ self.menuHideAll(); }, this.opts.hideTimeout);
}},
rootOver: function(e){
if(!this.handleEvents()||this.isTouchMode()||e.target==this.$root[0]){
return;
}
if(this.hideTimeout){
clearTimeout(this.hideTimeout);
this.hideTimeout=0;
}},
winResize: function(e){
if(!this.handleEvents()){
if(this.$disableOverlay){
var pos=this.$root.offset();
this.$disableOverlay.css({
top: pos.top,
left: pos.left,
width: this.$root.outerWidth(),
height: this.$root.outerHeight()
});
}
return;
}
if(!('onorientationchange' in window)||e.type=='orientationchange'){
var collapsible=this.isCollapsible();
if(!(this.wasCollapsible&&collapsible)){
if(this.activatedItems.length){
this.activatedItems[this.activatedItems.length - 1][0].blur();
}
this.menuHideAll();
}
this.wasCollapsible=collapsible;
}}
}});
$.fn.dataSM=function(key, val){
if(val){
return this.data(key + '_smartmenus', val);
}
return this.data(key + '_smartmenus');
};
$.fn.removeDataSM=function(key){
return this.removeData(key + '_smartmenus');
};
$.fn.smartmenus=function(options){
if(typeof options=='string'){
var args=arguments,
method=options;
Array.prototype.shift.call(args);
return this.each(function(){
var smartmenus=$(this).data('smartmenus');
if(smartmenus&&smartmenus[method]){
smartmenus[method].apply(smartmenus, args);
}});
}
return this.each(function(){
var dataOpts=$(this).data('sm-options')||null;
if(dataOpts&&typeof dataOpts!='object'){
dataOpts=null;
alert('ERROR\n\nSmartMenus jQuery init:\nThe value of the "data-sm-options" attribute must be valid JSON.');
}
if(dataOpts){
$.each(['showFunction', 'hideFunction', 'collapsibleShowFunction', 'collapsibleHideFunction'], function(){
if(this in dataOpts){
delete dataOpts[this];
}});
}
new $.SmartMenus(this, $.extend({}, $.fn.smartmenus.defaults, options, dataOpts));
});
};
$.fn.smartmenus.defaults={
isPopup:		false,
mainMenuSubOffsetX:	0,
mainMenuSubOffsetY:	0,
subMenusSubOffsetX:	0,
subMenusSubOffsetY:	0,
subMenusMinWidth:	'10em',
subMenusMaxWidth:	'20em',
subIndicators: 		true,
subIndicatorsPos: 	'append',
subIndicatorsText:	'',
scrollStep: 		30,
scrollAccelerate:	true,
showTimeout:		250,
hideTimeout:		500,
showDuration:		0,
showFunction:		null,
hideDuration:		0,
hideFunction:		function($ul, complete){ $ul.fadeOut(200, complete); },
collapsibleShowDuration:0,
collapsibleShowFunction:function($ul, complete){ $ul.slideDown(200, complete); },
collapsibleHideDuration:0,
collapsibleHideFunction:function($ul, complete){ $ul.slideUp(200, complete); },
showOnClick:		false,
hideOnClick:		true,
noMouseOver:		false,
keepInViewport:		true,
keepHighlighted:	true,
markCurrentItem:	false,
markCurrentTree:	true,
rightToLeftSubMenus:	false,
bottomToTopSubMenus:	false,
collapsibleBehavior:	'default'
};
return $;
}));
!function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i){s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t})),
function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){let i=t.jQuery,s=t.console;function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var h;("string"==typeof t&&(r=document.querySelectorAll(t)),r)?(this.elements=(h=r,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?[...h]:[h]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function h(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new h(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new d(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=Object.create(e.prototype),h.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n}));
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.sbjs=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
"use strict";
var init=_dereq_('./init');
var sbjs={
init: function(prefs){
this.get=init(prefs);
if(prefs&&prefs.callback&&typeof prefs.callback==='function'){
prefs.callback(this.get);
}}
};
module.exports=sbjs;
},{"./init":6}],2:[function(_dereq_,module,exports){
"use strict";
var terms=_dereq_('./terms'),
utils=_dereq_('./helpers/utils');
var data={
containers: {
current:          'sbjs_current',
current_extra:    'sbjs_current_add',
first:            'sbjs_first',
first_extra:      'sbjs_first_add',
session:          'sbjs_session',
udata:            'sbjs_udata',
promocode:        'sbjs_promo'
},
service: {
migrations:       'sbjs_migrations'
},
delimiter:          '|||',
aliases: {
main: {
type:           'typ',
source:         'src',
medium:         'mdm',
campaign:       'cmp',
content:        'cnt',
term:           'trm',
id:             'id',
platform:       'plt',
format:         'fmt',
tactic:         'tct'
},
extra: {
fire_date:      'fd',
entrance_point: 'ep',
referer:        'rf'
},
session: {
pages_seen:     'pgs',
current_page:   'cpg'
},
udata: {
visits:         'vst',
ip:             'uip',
agent:          'uag'
},
promo:            'code'
},
pack: {
main: function(sbjs){
return (
data.aliases.main.type      + '=' + sbjs.type     + data.delimiter +
data.aliases.main.source    + '=' + sbjs.source   + data.delimiter +
data.aliases.main.medium    + '=' + sbjs.medium   + data.delimiter +
data.aliases.main.campaign  + '=' + sbjs.campaign + data.delimiter +
data.aliases.main.content   + '=' + sbjs.content  + data.delimiter +
data.aliases.main.term      + '=' + sbjs.term     + data.delimiter +
data.aliases.main.id        + '=' + sbjs.id       + data.delimiter +
data.aliases.main.platform  + '=' + sbjs.platform + data.delimiter +
data.aliases.main.format    + '=' + sbjs.format   + data.delimiter +
data.aliases.main.tactic    + '=' + sbjs.tactic
);
},
extra: function(timezone_offset){
return (
data.aliases.extra.fire_date      + '=' + utils.setDate(new Date, timezone_offset) + data.delimiter +
data.aliases.extra.entrance_point + '=' + document.location.href                   + data.delimiter +
data.aliases.extra.referer        + '=' + (document.referrer||terms.none)
);
},
user: function(visits, user_ip){
return (
data.aliases.udata.visits + '=' + visits  + data.delimiter +
data.aliases.udata.ip     + '=' + user_ip + data.delimiter +
data.aliases.udata.agent  + '=' + navigator.userAgent
);
},
session: function(pages){
return (
data.aliases.session.pages_seen   + '=' + pages + data.delimiter +
data.aliases.session.current_page + '=' + document.location.href
);
},
promo: function(promo){
return (
data.aliases.promo + '=' + utils.setLeadingZeroToInt(utils.randomInt(promo.min, promo.max), promo.max.toString().length)
);
}}
};
module.exports=data;
},{"./helpers/utils":5,"./terms":9}],3:[function(_dereq_,module,exports){
"use strict";
var delimiter=_dereq_('../data').delimiter;
module.exports={
useBase64: false,
setBase64Flag: function(value){
this.useBase64=value;
},
encodeData: function(s){
return encodeURIComponent(s).replace(/\!/g, '%21')
.replace(/\~/g, '%7E')
.replace(/\*/g, '%2A')
.replace(/\'/g, '%27')
.replace(/\(/g, '%28')
.replace(/\)/g, '%29');
},
decodeData: function(s){
try {
return decodeURIComponent(s).replace(/\%21/g, '!')
.replace(/\%7E/g, '~')
.replace(/\%2A/g, '*')
.replace(/\%27/g, "'")
.replace(/\%28/g, '(')
.replace(/\%29/g, ')');
} catch(err1){
try { return unescape(s); } catch(err2){ return ''; }}
},
set: function(name, value, minutes, domain, excl_subdomains){
var expires, basehost;
if(minutes){
var date=new Date();
date.setTime(date.getTime() + (minutes * 60 * 1000));
expires='; expires=' + date.toGMTString();
}else{
expires='';
}
if(domain&&!excl_subdomains){
basehost=';domain=.' + domain;
}else{
basehost='';
}
var cookie_content=this.encodeData(value);
if(this.useBase64){
cookie_content=btoa(cookie_content).replace(/=+$/, '');
}
document.cookie=this.encodeData(name) + '=' + cookie_content + expires + basehost + '; path=/';
},
get: function(name){
var nameEQ=this.encodeData(name) + '=',
ca=document.cookie.split(';');
for (var i=0; i < ca.length; i++){
var c=ca[i];
while (c.charAt(0)===' '){ c=c.substring(1, c.length); }
if(c.indexOf(nameEQ)===0){
var cookie_content=c.substring(nameEQ.length, c.length);
if(/^[A-Za-z0-9+/]+$/.test(cookie_content)){
try {
cookie_content=atob(cookie_content.padEnd(Math.ceil(cookie_content.length / 4) * 4, "="));
} catch (error){
}}
return this.decodeData(cookie_content);
}}
return null;
},
destroy: function(name, domain, excl_subdomains){
this.set(name, '', -1, domain, excl_subdomains);
},
parse: function(yummy){
var cookies=[],
data={};
if(typeof yummy==='string'){
cookies.push(yummy);
}else{
for (var prop in yummy){
if(yummy.hasOwnProperty(prop)){
cookies.push(yummy[prop]);
}}
}
for (var i1=0; i1 < cookies.length; i1++){
var cookie_array;
data[this.unsbjs(cookies[i1])]={};
if(this.get(cookies[i1])){
cookie_array=this.get(cookies[i1]).split(delimiter);
}else{
cookie_array=[];
}
for (var i2=0; i2 < cookie_array.length; i2++){
var tmp_array=cookie_array[i2].split('='),
result_array=tmp_array.splice(0, 1);
result_array.push(tmp_array.join('='));
data[this.unsbjs(cookies[i1])][result_array[0]]=this.decodeData(result_array[1]);
}}
return data;
},
unsbjs: function (string){
return string.replace('sbjs_', '');
}};},{"../data":2}],4:[function(_dereq_,module,exports){
"use strict";
module.exports={
parse: function(str){
var o=this.parseOptions,
m=o.parser[o.strictMode ? 'strict':'loose'].exec(str),
uri={},
i=14;
while (i--){ uri[o.key[i]]=m[i]||''; }
uri[o.q.name]={};
uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2){
if($1){ uri[o.q.name][$1]=$2; }});
return uri;
},
parseOptions: {
strictMode: false,
key: ['source','protocol','authority','userInfo','user','password','host','port','relative','path','directory','file','query','anchor'],
q: {
name:   'queryKey',
parser: /(?:^|&)([^&=]*)=?([^&]*)/g
},
parser: {
strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
}},
getParam: function(custom_params){
var query_string={},
query=custom_params ? custom_params:window.location.search.substring(1),
vars=query.split('&');
for (var i=0; i < vars.length; i++){
var pair=vars[i].split('=');
if(typeof query_string[pair[0]]==='undefined'){
query_string[pair[0]]=pair[1];
}else if(typeof query_string[pair[0]]==='string'){
var arr=[ query_string[pair[0]], pair[1] ];
query_string[pair[0]]=arr;
}else{
query_string[pair[0]].push(pair[1]);
}}
return query_string;
},
getHost: function(request){
return this.parse(request).host.replace('www.', '');
}};},{}],5:[function(_dereq_,module,exports){
"use strict";
module.exports={
escapeRegexp: function(string){
return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
},
setDate: function(date, offset){
var utc_offset=date.getTimezoneOffset() / 60,
now_hours=date.getHours(),
custom_offset=offset||offset===0 ? offset:-utc_offset;
date.setHours(now_hours + utc_offset + custom_offset);
var year=date.getFullYear(),
month=this.setLeadingZeroToInt(date.getMonth() + 1,   2),
day=this.setLeadingZeroToInt(date.getDate(),        2),
hour=this.setLeadingZeroToInt(date.getHours(),       2),
minute=this.setLeadingZeroToInt(date.getMinutes(),     2),
second=this.setLeadingZeroToInt(date.getSeconds(),     2);
return (year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second);
},
setLeadingZeroToInt: function(num, size){
var s=num + '';
while (s.length < size){ s='0' + s; }
return s;
},
randomInt: function(min, max){
return Math.floor(Math.random() * (max - min + 1)) + min;
}};},{}],6:[function(_dereq_,module,exports){
"use strict";
var data=_dereq_('./data'),
terms=_dereq_('./terms'),
cookies=_dereq_('./helpers/cookies'),
uri=_dereq_('./helpers/uri'),
utils=_dereq_('./helpers/utils'),
params=_dereq_('./params'),
migrations=_dereq_('./migrations');
module.exports=function(prefs){
var p=params.fetch(prefs);
var get_param=uri.getParam();
var domain=p.domain.host,
isolate=p.domain.isolate,
lifetime=p.lifetime;
cookies.setBase64Flag(p.base64);
migrations.go(lifetime, domain, isolate);
var __sbjs_type,
__sbjs_source,
__sbjs_medium,
__sbjs_campaign,
__sbjs_content,
__sbjs_term,
__sbjs_id,
__sbjs_platform,
__sbjs_format,
__sbjs_tactic;
function mainData(){
var sbjs_data;
if(typeof get_param.utm_source!=='undefined' ||
typeof get_param.utm_medium!=='undefined' ||
typeof get_param.utm_campaign!=='undefined' ||
typeof get_param.utm_content!=='undefined' ||
typeof get_param.utm_term!=='undefined' ||
typeof get_param.utm_id!=='undefined' ||
typeof get_param.utm_source_platform!=='undefined' ||
typeof get_param.utm_creative_format!=='undefined' ||
typeof get_param.utm_marketing_tactic!=='undefined' ||
typeof get_param.gclid!=='undefined' ||
typeof get_param.yclid!=='undefined' ||
typeof get_param[p.campaign_param]!=='undefined' ||
typeof get_param[p.term_param]!=='undefined' ||
typeof get_param[p.content_param]!=='undefined'
){
setFirstAndCurrentExtraData();
sbjs_data=getData(terms.traffic.utm);
}else if(checkReferer(terms.traffic.organic)){
setFirstAndCurrentExtraData();
sbjs_data=getData(terms.traffic.organic);
}else if(!cookies.get(data.containers.session)&&checkReferer(terms.traffic.referral)){
setFirstAndCurrentExtraData();
sbjs_data=getData(terms.traffic.referral);
}else if(!cookies.get(data.containers.first)&&!cookies.get(data.containers.current)){
setFirstAndCurrentExtraData();
sbjs_data=getData(terms.traffic.typein);
}else{
return cookies.get(data.containers.current);
}
return sbjs_data;
}
function getData(type){
switch (type){
case terms.traffic.utm:
__sbjs_type=terms.traffic.utm;
if(typeof get_param.utm_source!=='undefined'){
__sbjs_source=get_param.utm_source;
}else if(typeof get_param.gclid!=='undefined'){
__sbjs_source='google';
}else if(typeof get_param.yclid!=='undefined'){
__sbjs_source='yandex';
}else{
__sbjs_source=terms.none;
}
if(typeof get_param.utm_medium!=='undefined'){
__sbjs_medium=get_param.utm_medium;
}else if(typeof get_param.gclid!=='undefined'){
__sbjs_medium='cpc';
}else if(typeof get_param.yclid!=='undefined'){
__sbjs_medium='cpc';
}else{
__sbjs_medium=terms.none;
}
if(typeof get_param.utm_campaign!=='undefined'){
__sbjs_campaign=get_param.utm_campaign;
}else if(typeof get_param[p.campaign_param]!=='undefined'){
__sbjs_campaign=get_param[p.campaign_param];
}else if(typeof get_param.gclid!=='undefined'){
__sbjs_campaign='google_cpc';
}else if(typeof get_param.yclid!=='undefined'){
__sbjs_campaign='yandex_cpc';
}else{
__sbjs_campaign=terms.none;
}
if(typeof get_param.utm_content!=='undefined'){
__sbjs_content=get_param.utm_content;
}else if(typeof get_param[p.content_param]!=='undefined'){
__sbjs_content=get_param[p.content_param];
}else{
__sbjs_content=terms.none;
}
__sbjs_id=get_param.utm_id||terms.none;
__sbjs_platform=get_param.utm_source_platform||terms.none;
__sbjs_format=get_param.utm_creative_format||terms.none;
__sbjs_tactic=get_param.utm_marketing_tactic||terms.none;
if(typeof get_param.utm_term!=='undefined'){
__sbjs_term=get_param.utm_term;
}else if(typeof get_param[p.term_param]!=='undefined'){
__sbjs_term=get_param[p.term_param];
}else{
__sbjs_term=getUtmTerm()||terms.none;
}
break;
case terms.traffic.organic:
__sbjs_type=terms.traffic.organic;
__sbjs_source=__sbjs_source||uri.getHost(document.referrer);
__sbjs_medium=terms.referer.organic;
__sbjs_campaign=terms.none;
__sbjs_content=terms.none;
__sbjs_term=terms.none;
__sbjs_id=terms.none;
__sbjs_platform=terms.none;
__sbjs_format=terms.none;
__sbjs_tactic=terms.none;
break;
case terms.traffic.referral:
__sbjs_type=terms.traffic.referral;
__sbjs_source=__sbjs_source||uri.getHost(document.referrer);
__sbjs_medium=__sbjs_medium||terms.referer.referral;
__sbjs_campaign=terms.none;
__sbjs_content=uri.parse(document.referrer).path;
__sbjs_term=terms.none;
__sbjs_id=terms.none;
__sbjs_platform=terms.none;
__sbjs_format=terms.none;
__sbjs_tactic=terms.none;
break;
case terms.traffic.typein:
__sbjs_type=terms.traffic.typein;
__sbjs_source=p.typein_attributes.source;
__sbjs_medium=p.typein_attributes.medium;
__sbjs_campaign=terms.none;
__sbjs_content=terms.none;
__sbjs_term=terms.none;
__sbjs_id=terms.none;
__sbjs_platform=terms.none;
__sbjs_format=terms.none;
__sbjs_tactic=terms.none;
break;
default:
__sbjs_type=terms.oops;
__sbjs_source=terms.oops;
__sbjs_medium=terms.oops;
__sbjs_campaign=terms.oops;
__sbjs_content=terms.oops;
__sbjs_term=terms.oops;
__sbjs_id=terms.oops;
__sbjs_platform=terms.oops;
__sbjs_format=terms.oops;
__sbjs_tactic=terms.oops;
}
var sbjs_data={
type:             __sbjs_type,
source:           __sbjs_source,
medium:           __sbjs_medium,
campaign:         __sbjs_campaign,
content:          __sbjs_content,
term:             __sbjs_term,
id:               __sbjs_id,
platform:         __sbjs_platform,
format:           __sbjs_format,
tactic:           __sbjs_tactic
};
return data.pack.main(sbjs_data);
}
function getUtmTerm(){
var referer=document.referrer;
if(get_param.utm_term){
return get_param.utm_term;
}else if(referer&&uri.parse(referer).host&&uri.parse(referer).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)){
try {
return uri.getParam(uri.parse(document.referrer).query).text;
} catch (err){
return false;
}}else{
return false;
}}
function checkReferer(type){
var referer=document.referrer;
switch(type){
case terms.traffic.organic:
return (!!referer&&checkRefererHost(referer)&&isOrganic(referer));
case terms.traffic.referral:
return (!!referer&&checkRefererHost(referer)&&isReferral(referer));
default:
return false;
}}
function checkRefererHost(referer){
if(p.domain){
if(!isolate){
var host_regex=new RegExp('^(?:.*\\.)?' + utils.escapeRegexp(domain) + '$', 'i');
return !(uri.getHost(referer).match(host_regex));
}else{
return (uri.getHost(referer)!==uri.getHost(domain));
}}else{
return (uri.getHost(referer)!==uri.getHost(document.location.href));
}}
function isOrganic(referer){
var y_host='yandex',
y_param='text',
g_host='google';
var y_host_regex=new RegExp('^(?:.*\\.)?'  + utils.escapeRegexp(y_host)  + '\\..{2,9}$'),
y_param_regex=new RegExp('.*'           + utils.escapeRegexp(y_param) + '=.*'),
g_host_regex=new RegExp('^(?:www\\.)?' + utils.escapeRegexp(g_host)  + '\\..{2,9}$');
if(!!uri.parse(referer).query &&
!!uri.parse(referer).host.match(y_host_regex) &&
!!uri.parse(referer).query.match(y_param_regex)
){
__sbjs_source=y_host;
return true;
}else if(!!uri.parse(referer).host.match(g_host_regex)){
__sbjs_source=g_host;
return true;
}else if(!!uri.parse(referer).query){
for (var i=0; i < p.organics.length; i++){
if(uri.parse(referer).host.match(new RegExp('^(?:.*\\.)?' + utils.escapeRegexp(p.organics[i].host)  + '$', 'i')) &&
uri.parse(referer).query.match(new RegExp('.*'         + utils.escapeRegexp(p.organics[i].param) + '=.*', 'i'))
){
__sbjs_source=p.organics[i].display||p.organics[i].host;
return true;
}
if(i + 1===p.organics.length){
return false;
}}
}else{
return false;
}}
function isReferral(referer){
if(p.referrals.length > 0){
for (var i=0; i < p.referrals.length; i++){
if(uri.parse(referer).host.match(new RegExp('^(?:.*\\.)?' + utils.escapeRegexp(p.referrals[i].host) + '$', 'i'))){
__sbjs_source=p.referrals[i].display||p.referrals[i].host;
__sbjs_medium=p.referrals[i].medium||terms.referer.referral;
return true;
}
if(i + 1===p.referrals.length){
__sbjs_source=uri.getHost(referer);
return true;
}}
}else{
__sbjs_source=uri.getHost(referer);
return true;
}}
function setFirstAndCurrentExtraData(){
cookies.set(data.containers.current_extra, data.pack.extra(p.timezone_offset), lifetime, domain, isolate);
if(!cookies.get(data.containers.first_extra)){
cookies.set(data.containers.first_extra, data.pack.extra(p.timezone_offset), lifetime, domain, isolate);
}}
(function setData(){
cookies.set(data.containers.current, mainData(), lifetime, domain, isolate);
if(!cookies.get(data.containers.first)){
cookies.set(data.containers.first, cookies.get(data.containers.current), lifetime, domain, isolate);
}
var visits, udata;
if(!cookies.get(data.containers.udata)){
visits=1;
udata=data.pack.user(visits, p.user_ip);
}else{
visits=parseInt(cookies.parse(data.containers.udata)[cookies.unsbjs(data.containers.udata)][data.aliases.udata.visits])||1;
visits=cookies.get(data.containers.session) ? visits:visits + 1;
udata=data.pack.user(visits, p.user_ip);
}
cookies.set(data.containers.udata, udata, lifetime, domain, isolate);
var pages_count;
if(!cookies.get(data.containers.session)){
pages_count=1;
}else{
pages_count=parseInt(cookies.parse(data.containers.session)[cookies.unsbjs(data.containers.session)][data.aliases.session.pages_seen])||1;
pages_count +=1;
}
cookies.set(data.containers.session, data.pack.session(pages_count), p.session_length, domain, isolate);
if(p.promocode&&!cookies.get(data.containers.promocode)){
cookies.set(data.containers.promocode, data.pack.promo(p.promocode), lifetime, domain, isolate);
}})();
return cookies.parse(data.containers);
};},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(_dereq_,module,exports){
"use strict";
var data=_dereq_('./data'),
cookies=_dereq_('./helpers/cookies');
module.exports={
go: function(lifetime, domain, isolate){
var migrate=this.migrations,
_with={ l: lifetime, d: domain, i: isolate };
var i;
if(!cookies.get(data.containers.first)&&!cookies.get(data.service.migrations)){
var mids=[];
for (i=0; i < migrate.length; i++){ mids.push(migrate[i].id); }
var advance='';
for (i=0; i < mids.length; i++){
advance +=mids[i] + '=1';
if(i < mids.length - 1){ advance +=data.delimiter; }}
cookies.set(data.service.migrations, advance, _with.l, _with.d, _with.i);
}else if(!cookies.get(data.service.migrations)){
for (i=0; i < migrate.length; i++){
migrate[i].go(migrate[i].id, _with);
}}
},
migrations: [
{
id: '1418474375998',
version: '1.0.0-beta',
go: function(mid, _with){
var success=mid + '=1',
fail=mid + '=0';
var safeReplace=function($0, $1, $2){
return ($1||$2 ? $0:data.delimiter);
};
try {
var _in=[];
for (var prop in data.containers){
if(data.containers.hasOwnProperty(prop)){
_in.push(data.containers[prop]);
}}
for (var i=0; i < _in.length; i++){
if(cookies.get(_in[i])){
var buffer=cookies.get(_in[i]).replace(/(\|)?\|(\|)?/g, safeReplace);
cookies.destroy(_in[i], _with.d, _with.i);
cookies.destroy(_in[i], _with.d, !_with.i);
cookies.set(_in[i], buffer, _with.l, _with.d, _with.i);
}}
if(cookies.get(data.containers.session)){
cookies.set(data.containers.session, data.pack.session(0), _with.l, _with.d, _with.i);
}
cookies.set(data.service.migrations, success, _with.l, _with.d, _with.i);
} catch (err){
cookies.set(data.service.migrations, fail, _with.l, _with.d, _with.i);
}}
}
]
};},{"./data":2,"./helpers/cookies":3}],8:[function(_dereq_,module,exports){
"use strict";
var terms=_dereq_('./terms'),
uri=_dereq_('./helpers/uri');
module.exports={
fetch: function(prefs){
var user=prefs||{},
params={};
params.lifetime=this.validate.checkFloat(user.lifetime)||6;
params.lifetime=parseInt(params.lifetime * 30 * 24 * 60);
params.session_length=this.validate.checkInt(user.session_length)||30;
params.timezone_offset=this.validate.checkInt(user.timezone_offset);
params.base64=user.base64||false;
params.campaign_param=user.campaign_param||false;
params.term_param=user.term_param||false;
params.content_param=user.content_param||false;
params.user_ip=user.user_ip||terms.none;
if(user.promocode){
params.promocode={};
params.promocode.min=parseInt(user.promocode.min)||100000;
params.promocode.max=parseInt(user.promocode.max)||999999;
}else{
params.promocode=false;
}
if(user.typein_attributes&&user.typein_attributes.source&&user.typein_attributes.medium){
params.typein_attributes={};
params.typein_attributes.source=user.typein_attributes.source;
params.typein_attributes.medium=user.typein_attributes.medium;
}else{
params.typein_attributes={ source: '(direct)', medium: '(none)' };}
if(user.domain&&this.validate.isString(user.domain)){
params.domain={ host: user.domain, isolate: false };}else if(user.domain&&user.domain.host){
params.domain=user.domain;
}else{
params.domain={ host: uri.getHost(document.location.hostname), isolate: false };}
params.referrals=[];
if(user.referrals&&user.referrals.length > 0){
for (var ir=0; ir < user.referrals.length; ir++){
if(user.referrals[ir].host){
params.referrals.push(user.referrals[ir]);
}}
}
params.organics=[];
if(user.organics&&user.organics.length > 0){
for (var io=0; io < user.organics.length; io++){
if(user.organics[io].host&&user.organics[io].param){
params.organics.push(user.organics[io]);
}}
}
params.organics.push({ host: 'bing.com',      param: 'q',     display: 'bing'            });
params.organics.push({ host: 'yahoo.com',     param: 'p',     display: 'yahoo'           });
params.organics.push({ host: 'about.com',     param: 'q',     display: 'about'           });
params.organics.push({ host: 'aol.com',       param: 'q',     display: 'aol'             });
params.organics.push({ host: 'ask.com',       param: 'q',     display: 'ask'             });
params.organics.push({ host: 'globososo.com', param: 'q',     display: 'globo'           });
params.organics.push({ host: 'go.mail.ru',    param: 'q',     display: 'go.mail.ru'      });
params.organics.push({ host: 'rambler.ru',    param: 'query', display: 'rambler'         });
params.organics.push({ host: 'tut.by',        param: 'query', display: 'tut.by'          });
params.referrals.push({ host: 't.co',                         display: 'twitter.com'     });
params.referrals.push({ host: 'plus.url.google.com',          display: 'plus.google.com' });
return params;
},
validate: {
checkFloat: function(v){
return v&&this.isNumeric(parseFloat(v)) ? parseFloat(v):false;
},
checkInt: function(v){
return v&&this.isNumeric(parseInt(v)) ? parseInt(v):false;
},
isNumeric: function(v){
return !isNaN(v);
},
isString: function(v){
return Object.prototype.toString.call(v)==='[object String]';
}}
};},{"./helpers/uri":4,"./terms":9}],9:[function(_dereq_,module,exports){
"use strict";
module.exports={
traffic: {
utm:        'utm',
organic:    'organic',
referral:   'referral',
typein:     'typein'
},
referer: {
referral:   'referral',
organic:    'organic',
social:     'social'
},
none:         '(none)',
oops:         '(Houston, we have a problem)'
};},{}]},{},[1])(1)
});
(function(wc_order_attribution){
'use strict';
const params=wc_order_attribution.params;
const $=document.querySelector.bind(document);
const propertyAccessor=(obj, path)=> path.split('.').reduce(( acc, part)=> acc&&acc[ part ], obj);
const returnNull=()=> null;
const stringifyFalsyInputValue=(value)=> value===null||value===undefined ? '':value;
const CHECKOUT_STORE_KEY='wc/store/checkout';
wc_order_attribution.getAttributionData=function(){
const accessor=params.allowTracking&&isSbjsAvailable() ? propertyAccessor:returnNull;
const getter=isSbjsAvailable() ? sbjs.get:{};
const entries=Object.entries(wc_order_attribution.fields)
.map(( [ key, property ])=> [ key, accessor(getter, property) ]);
return Object.fromEntries(entries);
}
function removeDuplicateInputGroups(){
document.querySelectorAll('wc-order-attribution-inputs').forEach(( group, index)=> {
if(index > 0){
group.remove();
}});
}
function updateFormValues(values){
removeDuplicateInputGroups();
for(const element of document.querySelectorAll('wc-order-attribution-inputs')){
element.values=values;
}};
function updateCheckoutBlockData(values){
if(window.wp &&
window.wp.data &&
window.wp.data.dispatch &&
window.wc &&
window.wc.wcBlocksData
){
window.wp.data
.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY)
.setExtensionData('woocommerce/order-attribution',
values,
true
);
}}
function isSbjsAvailable(){
return typeof sbjs!=='undefined';
}
wc_order_attribution.setOrderTracking=function(allow){
params.allowTracking=allow;
if(! allow){
removeTrackingCookies();
}else if(! isSbjsAvailable()){
return;
}else{
sbjs.init({
lifetime: Number(params.lifetime),
session_length: Number(params.session),
base64: Boolean(params.base64),
timezone_offset: '0',
});
}
const values=wc_order_attribution.getAttributionData();
updateFormValues(values);
updateCheckoutBlockData(values);
}
function removeTrackingCookies(){
const domain=window.location.hostname;
const sbCookies=[
'sbjs_current',
'sbjs_current_add',
'sbjs_first',
'sbjs_first_add',
'sbjs_session',
'sbjs_udata',
'sbjs_migrations',
'sbjs_promo'
];
sbCookies.forEach(( name)=> {
document.cookie=`${name}=; path=/; max-age=-999; domain=.${domain};`;
});
}
wc_order_attribution.setOrderTracking(params.allowTracking);
function eventuallyInitializeCheckoutBlock(){
if(window.wp&&window.wp.data&&typeof window.wp.data.subscribe==='function'
){
const unsubscribe=window.wp.data.subscribe(function (){
unsubscribe();
updateCheckoutBlockData(wc_order_attribution.getAttributionData());
}, CHECKOUT_STORE_KEY);
}};
if(document.readyState==="loading"){
document.addEventListener("DOMContentLoaded", eventuallyInitializeCheckoutBlock);
}else{
eventuallyInitializeCheckoutBlock();
}
window.customElements.define('wc-order-attribution-inputs', class extends HTMLElement {
constructor(){
super();
this._fieldNames=Object.keys(wc_order_attribution.fields);
if(this.hasOwnProperty('_values')){
let values=this.values;
delete this.values;
this.values=values||{};}}
connectedCallback(){
this.innerHTML='';
const inputs=new DocumentFragment();
for(const fieldName of this._fieldNames){
const input=document.createElement('input');
input.type='hidden';
input.name=`${params.prefix}${fieldName}`;
input.value=stringifyFalsyInputValue(( this.values&&this.values[ fieldName ])||'');
inputs.appendChild(input);
}
this.appendChild(inputs);
}
set values(values){
this._values=values;
if(this.isConnected){
for(const fieldName of this._fieldNames){
const input=this.querySelector(`input[name="${params.prefix}${fieldName}"]`);
if(input){
input.value=stringifyFalsyInputValue(this.values[ fieldName ]);
}else{
console.warn(`Field "${fieldName}" not found. ` +
`Most likely, the '<wc-order-attribution-inputs>' element was manipulated.`
);
}}
}}
get values(){
return this._values;
}});
}(window.wc_order_attribution));
(()=> {
"use strict";
var __webpack_modules__=({});
var __webpack_module_cache__={};
function __webpack_require__(moduleId){
var cachedModule=__webpack_module_cache__[moduleId];
if(cachedModule!==undefined){
return cachedModule.exports;
}
var module=__webpack_module_cache__[moduleId]={
exports: {}
};
if(!(moduleId in __webpack_modules__)){
delete __webpack_module_cache__[moduleId];
var e=new Error("Cannot find module '" + moduleId + "'");
e.code='MODULE_NOT_FOUND';
throw e;
}
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
return module.exports;
}
__webpack_require__.m=__webpack_modules__;
(()=> {
var deferred=[];
__webpack_require__.O=(result, chunkIds, fn, priority)=> {
if(chunkIds){
priority=priority||0;
for(var i=deferred.length; i > 0&&deferred[i - 1][2] > priority; i--) deferred[i]=deferred[i - 1];
deferred[i]=[chunkIds, fn, priority];
return;
}
var notFulfilled=Infinity;
for (var i=0; i < deferred.length; i++){
var [chunkIds, fn, priority]=deferred[i];
var fulfilled=true;
for (var j=0; j < chunkIds.length; j++){
if((priority & 1===0||notFulfilled >=priority)&&Object.keys(__webpack_require__.O).every((key)=> (__webpack_require__.O[key](chunkIds[j])))){
chunkIds.splice(j--, 1);
}else{
fulfilled=false;
if(priority < notFulfilled) notFulfilled=priority;
}
}
if(fulfilled){
deferred.splice(i--, 1)
var r=fn();
if(r!==undefined) result=r;
}
}
return result;
};
})();
(()=> {
__webpack_require__.f={};
__webpack_require__.e=(chunkId)=> {
return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key)=> {
__webpack_require__.f[key](chunkId, promises);
return promises;
}, []));
};
})();
(()=> {
__webpack_require__.u=(chunkId)=> {
if(chunkId==="code-highlight") return "" + chunkId + ".872070dcb83100cdc6a7.bundle.js";
if(chunkId==="video-playlist") return "" + chunkId + ".d7d184236c3e54fc0c27.bundle.js";
if(chunkId==="paypal-button") return "" + chunkId + ".557bf338d556d8411f0e.bundle.js";
if(chunkId==="vendors-node_modules_dompurify_dist_purify_cjs_js") return "e8fec410b4ec8b8ad5e5.bundle.js";
if(chunkId==="stripe-button") return "" + chunkId + ".ff670b274b64f1097386.bundle.js";
if(chunkId==="progress-tracker") return "" + chunkId + ".26b12b208974a26b52d0.bundle.js";
if(chunkId==="animated-headline") return "" + chunkId + ".248bbeadaf74dd446e7d.bundle.js";
if(chunkId==="media-carousel") return "" + chunkId + ".1eb08e97c13152575144.bundle.js";
if(chunkId==="carousel") return "" + chunkId + ".f93681c60a8355c99044.bundle.js";
if(chunkId==="countdown") return "" + chunkId + ".7bd51efbed8eaac97b16.bundle.js";
if(chunkId==="hotspot") return "" + chunkId + ".1555f80c1d14215e6b69.bundle.js";
if(chunkId==="form") return "form.333cc493ca6159f7ee0e.bundle.js";
if(chunkId==="gallery") return "" + chunkId + ".1f2d6260aa05f94aca68.bundle.js";
if(chunkId==="lottie") return "" + chunkId + ".4cf7a751c39c2d5e59f3.bundle.js";
if(chunkId==="nav-menu") return "" + chunkId + ".393f7e8d1eb984d695bc.bundle.js";
if(chunkId==="popup") return "" + chunkId + ".467433314d83de8c86ec.bundle.js";
if(chunkId==="load-more") return "" + chunkId + ".862f17c31e360ff1934e.bundle.js";
if(chunkId==="posts") return "" + chunkId + ".b01cefd7be5b5933ef48.bundle.js";
if(chunkId==="portfolio") return "" + chunkId + ".d389311c484631ccbb99.bundle.js";
if(chunkId==="share-buttons") return "" + chunkId + ".c76474949213ab8d37c0.bundle.js";
if(chunkId==="slides") return "" + chunkId + ".aefbc8effd03bc1b7881.bundle.js";
if(chunkId==="social") return "" + chunkId + ".b8ce24160d1e761ca0a6.bundle.js";
if(chunkId==="table-of-contents") return "" + chunkId + ".8496840ef16d1ad4138f.bundle.js";
if(chunkId==="archive-posts") return "" + chunkId + ".d82fc1f6376a91acb912.bundle.js";
if(chunkId==="search-form") return "" + chunkId + ".2fe57bcace4909ad8f6a.bundle.js";
if(chunkId==="woocommerce-menu-cart") return "" + chunkId + ".d64f5409c5ae5e079f89.bundle.js";
if(chunkId==="woocommerce-purchase-summary") return "" + chunkId + ".f27e4afffb08961d9bd6.bundle.js";
if(chunkId==="woocommerce-checkout-page") return "" + chunkId + ".1e854a92527f7870a712.bundle.js";
if(chunkId==="woocommerce-cart") return "" + chunkId + ".b85d04bc7b7a472432cf.bundle.js";
if(chunkId==="woocommerce-my-account") return "" + chunkId + ".9a2312ed0688c67a0cb5.bundle.js";
if(chunkId==="woocommerce-notices") return "" + chunkId + ".a2feb6e26254257dbe93.bundle.js";
if(chunkId==="product-add-to-cart") return "" + chunkId + ".7dd001c520feddf0ce5a.bundle.js";
if(chunkId==="loop") return "loop.8f668e18a5d491cc01b7.bundle.js";
if(chunkId==="loop-carousel") return "" + chunkId + ".5eddbaa4e0c79c44c5c1.bundle.js";
if(chunkId==="ajax-pagination") return "" + chunkId + ".dfa3a82618d618a6a6bf.bundle.js";
if(chunkId==="mega-menu") return "" + chunkId + ".9c175c27b10a1a51ffad.bundle.js";
if(chunkId==="mega-menu-stretch-content") return "" + chunkId + ".65ac3ff61cbda73d513e.bundle.js";
if(chunkId==="menu-title-keyboard-handler") return "" + chunkId + ".000fb4658b703c6ebe56.bundle.js";
if(chunkId==="nested-carousel") return "" + chunkId + ".925fbc1c35869d1767d5.bundle.js";
if(chunkId==="taxonomy-filter") return "" + chunkId + ".77f346809c2657dd250a.bundle.js";
if(chunkId==="off-canvas") return "" + chunkId + ".c6c9ad84eff54adcd9f3.bundle.js";
if(chunkId==="contact-buttons") return "" + chunkId + ".0f9a28de84eecdb341e1.bundle.js";
if(chunkId==="contact-buttons-var-10") return "" + chunkId + ".6caef1cb29200dd63f5a.bundle.js";
if(chunkId==="modules_floating-buttons_assets_js_frontend_classes_floatin-bar-dom_js-modules_floating-butto-2c1e90") return "38a015cfd4402fcba18c.bundle.js";
if(chunkId==="floating-bars-var-2") return "" + chunkId + ".a7a076850ecbe78bb8c7.bundle.js";
if(chunkId==="floating-bars-var-3") return "" + chunkId + ".c5d9c759b0475977fd76.bundle.js";
if(chunkId==="search") return "" + chunkId + ".eb99cbb2b336e50a443a.bundle.js";
return undefined;
};
})();
(()=> {
__webpack_require__.g=(function(){
if(typeof globalThis==='object') return globalThis;
try {
return this||new Function('return this')();
} catch (e){
if(typeof window==='object') return window;
}
})();
})();
(()=> {
__webpack_require__.o=(obj, prop)=> (Object.prototype.hasOwnProperty.call(obj, prop))
})();
(()=> {
var inProgress={};
var dataWebpackPrefix="elementor-pro:";
__webpack_require__.l=(url, done, key, chunkId)=> {
if(inProgress[url]){ inProgress[url].push(done); return; }
var script, needAttach;
if(key!==undefined){
var scripts=document.getElementsByTagName("script");
for(var i=0; i < scripts.length; i++){
var s=scripts[i];
if(s.getAttribute("src")==url||s.getAttribute("data-webpack")==dataWebpackPrefix + key){ script=s; break; }
}
}
if(!script){
needAttach=true;
script=document.createElement('script');
script.charset='utf-8';
if(__webpack_require__.nc){
script.setAttribute("nonce", __webpack_require__.nc);
}
script.setAttribute("data-webpack", dataWebpackPrefix + key);
script.src=url;
}
inProgress[url]=[done];
var onScriptComplete=(prev, event)=> {
script.onerror=script.onload=null;
clearTimeout(timeout);
var doneFns=inProgress[url];
delete inProgress[url];
script.parentNode&&script.parentNode.removeChild(script);
doneFns&&doneFns.forEach((fn)=> (fn(event)));
if(prev) return prev(event);
}
var timeout=setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
script.onerror=onScriptComplete.bind(null, script.onerror);
script.onload=onScriptComplete.bind(null, script.onload);
needAttach&&document.head.appendChild(script);
};
})();
(()=> {
var scriptUrl;
if(__webpack_require__.g.importScripts) scriptUrl=__webpack_require__.g.location + "";
var document=__webpack_require__.g.document;
if(!scriptUrl&&document){
if(document.currentScript&&document.currentScript.tagName.toUpperCase()==='SCRIPT')
scriptUrl=document.currentScript.src;
if(!scriptUrl){
var scripts=document.getElementsByTagName("script");
if(scripts.length){
var i=scripts.length - 1;
while (i > -1&&(!scriptUrl||!/^http(s?):/.test(scriptUrl))) scriptUrl=scripts[i--].src;
}
}
}
if(!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
scriptUrl=scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
__webpack_require__.p=scriptUrl;
})();
(()=> {
var installedChunks={
"webpack-pro.runtime": 0
};
__webpack_require__.f.j=(chunkId, promises)=> {
var installedChunkData=__webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId]:undefined;
if(installedChunkData!==0){
if(installedChunkData){
promises.push(installedChunkData[2]);
}else{
if("webpack-pro.runtime"!=chunkId){
var promise=new Promise((resolve, reject)=> (installedChunkData=installedChunks[chunkId]=[resolve, reject]));
promises.push(installedChunkData[2]=promise);
var url=__webpack_require__.p + __webpack_require__.u(chunkId);
var error=new Error();
var loadingEnded=(event)=> {
if(__webpack_require__.o(installedChunks, chunkId)){
installedChunkData=installedChunks[chunkId];
if(installedChunkData!==0) installedChunks[chunkId]=undefined;
if(installedChunkData){
var errorType=event&&(event.type==='load' ? 'missing':event.type);
var realSrc=event&&event.target&&event.target.src;
error.message='Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
error.name='ChunkLoadError';
error.type=errorType;
error.request=realSrc;
installedChunkData[1](error);
}
}
};
__webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
} else installedChunks[chunkId]=0;
}
}
};
__webpack_require__.O.j=(chunkId)=> (installedChunks[chunkId]===0);
var webpackJsonpCallback=(parentChunkLoadingFunction, data)=> {
var [chunkIds, moreModules, runtime]=data;
var moduleId, chunkId, i=0;
if(chunkIds.some((id)=> (installedChunks[id]!==0))){
for(moduleId in moreModules){
if(__webpack_require__.o(moreModules, moduleId)){
__webpack_require__.m[moduleId]=moreModules[moduleId];
}
}
if(runtime) var result=runtime(__webpack_require__);
}
if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
for(;i < chunkIds.length; i++){
chunkId=chunkIds[i];
if(__webpack_require__.o(installedChunks, chunkId)&&installedChunks[chunkId]){
installedChunks[chunkId][0]();
}
installedChunks[chunkId]=0;
}
return __webpack_require__.O(result);
}
var chunkLoadingGlobal=self["webpackChunkelementor_pro"]=self["webpackChunkelementor_pro"]||[];
chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
chunkLoadingGlobal.push=webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
})();
})()
;
(self["webpackChunkelementor_pro"]=self["webpackChunkelementor_pro"]||[]).push([["frontend"],{
"../../elementor/assets/dev/js/frontend/utils/utils.js"
(__unused_webpack_module, exports){
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.isScrollSnapActive=exports.escapeHTML=void 0;
const escapeHTML=str=> {
const specialChars={
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
"'": '&#39;',
'"': '&quot;'
};
return str.replace(/[&<>'"]/g, tag=> specialChars[tag]||tag);
};
exports.escapeHTML=escapeHTML;
const isScrollSnapActive=()=> {
const scrollSnapStatus=elementorFrontend.isEditMode() ? elementor.settings.page.model.attributes?.scroll_snap:elementorFrontend.config.settings.page?.scroll_snap;
return 'yes'===scrollSnapStatus ? true:false;
};
exports.isScrollSnapActive=isScrollSnapActive;
},
"../assets/dev/js/frontend/frontend.js"
(__unused_webpack_module, __unused_webpack_exports, __webpack_require__){
"use strict";
var _interopRequireDefault=__webpack_require__( "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
__webpack_require__( "../assets/dev/js/public-path.js");
var _frontend=_interopRequireDefault(__webpack_require__( "../modules/motion-fx/assets/js/frontend/frontend.js"));
var _frontend2=_interopRequireDefault(__webpack_require__( "../modules/sticky/assets/js/frontend/frontend.js"));
var _frontend3=_interopRequireDefault(__webpack_require__( "../modules/code-highlight/assets/js/frontend/frontend.js"));
var _frontend4=_interopRequireDefault(__webpack_require__( "../modules/video-playlist/assets/js/frontend/frontend.js"));
var _frontend5=_interopRequireDefault(__webpack_require__( "../modules/payments/assets/js/frontend/frontend.js"));
var _frontend6=_interopRequireDefault(__webpack_require__( "../modules/progress-tracker/assets/js/frontend/frontend.js"));
var _controls=_interopRequireDefault(__webpack_require__( "../assets/dev/js/frontend/utils/controls.js"));
var _dropdownMenuHeightController=_interopRequireDefault(__webpack_require__( "../assets/dev/js/frontend/utils/dropdown-menu-height-controller.js"));
class ElementorProFrontend extends elementorModules.ViewModule {
onInit(){
super.onInit();
this.config=ElementorProFrontendConfig;
this.modules={};
this.initOnReadyComponents();
}
bindEvents(){
jQuery(window).on('elementor/frontend/init', this.onElementorFrontendInit.bind(this));
}
initModules(){
let handlers={
motionFX: _frontend.default,
sticky: _frontend2.default,
codeHighlight: _frontend3.default,
videoPlaylist: _frontend4.default,
payments: _frontend5.default,
progressTracker: _frontend6.default
};
elementorProFrontend.trigger('elementor-pro/modules/init/before');
handlers=elementorFrontend.hooks.applyFilters('elementor-pro/frontend/handlers', handlers);
jQuery.each(handlers, (moduleName, ModuleClass)=> {
this.modules[moduleName]=new ModuleClass();
});
this.modules.linkActions={
addAction: (...args)=> {
elementorFrontend.utils.urlActions.addAction(...args);
}};}
onElementorFrontendInit(){
this.initModules();
}
initOnReadyComponents(){
this.utils={
controls: new _controls.default(),
DropdownMenuHeightController: _dropdownMenuHeightController.default
};}}
window.elementorProFrontend=new ElementorProFrontend();
},
"../assets/dev/js/frontend/utils/controls.js"
(__unused_webpack_module, exports){
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
class Controls {
getControlValue(controlSettings, controlKey, controlSubKey){
let value;
if('object'===typeof controlSettings[controlKey]&&controlSubKey){
value=controlSettings[controlKey][controlSubKey];
}else{
value=controlSettings[controlKey];
}
return value;
}
getResponsiveControlValue(controlSettings, controlKey, controlSubKey=''){
const currentDeviceMode=elementorFrontend.getCurrentDeviceMode(),
controlValueDesktop=this.getControlValue(controlSettings, controlKey, controlSubKey);
if('widescreen'===currentDeviceMode){
const controlValueWidescreen=this.getControlValue(controlSettings, `${controlKey}_widescreen`, controlSubKey);
return !!controlValueWidescreen||0===controlValueWidescreen ? controlValueWidescreen:controlValueDesktop;
}
const activeBreakpoints=elementorFrontend.breakpoints.getActiveBreakpointsList({
withDesktop: true
});
let parentDeviceMode=currentDeviceMode,
deviceIndex=activeBreakpoints.indexOf(currentDeviceMode),
controlValue='';
while (deviceIndex <=activeBreakpoints.length){
if('desktop'===parentDeviceMode){
controlValue=controlValueDesktop;
break;
}
const responsiveControlKey=`${controlKey}_${parentDeviceMode}`,
responsiveControlValue=this.getControlValue(controlSettings, responsiveControlKey, controlSubKey);
if(!!responsiveControlValue||0===responsiveControlValue){
controlValue=responsiveControlValue;
break;
}
deviceIndex++;
parentDeviceMode=activeBreakpoints[deviceIndex];
}
return controlValue;
}}
exports["default"]=Controls;
},
"../assets/dev/js/frontend/utils/dropdown-menu-height-controller.js"
(__unused_webpack_module, exports){
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
class DropdownMenuHeightController {
constructor(widgetConfig){
this.widgetConfig=widgetConfig;
}
calculateStickyMenuNavHeight(){
this.widgetConfig.elements.$dropdownMenuContainer.css(this.widgetConfig.settings.menuHeightCssVarName, '');
const menuToggleHeight=this.widgetConfig.elements.$dropdownMenuContainer.offset().top - jQuery(window).scrollTop();
return elementorFrontend.elements.$window.height() - menuToggleHeight;
}
calculateMenuTabContentHeight($tab){
return elementorFrontend.elements.$window.height() - $tab[0].getBoundingClientRect().top;
}
isElementSticky(){
return this.widgetConfig.elements.$element.hasClass('elementor-sticky')||this.widgetConfig.elements.$element.parents('.elementor-sticky').length;
}
getMenuHeight(){
return this.isElementSticky() ? this.calculateStickyMenuNavHeight() + 'px':this.widgetConfig.settings.dropdownMenuContainerMaxHeight;
}
setMenuHeight(menuHeight){
this.widgetConfig.elements.$dropdownMenuContainer.css(this.widgetConfig.settings.menuHeightCssVarName, menuHeight);
}
reassignMobileMenuHeight(){
const menuHeight=this.isToggleActive() ? this.getMenuHeight():0;
return this.setMenuHeight(menuHeight);
}
reassignMenuHeight($activeTabContent){
if(!this.isElementSticky()||0===$activeTabContent.length){
return;
}
const offsetBottom=elementorFrontend.elements.$window.height() - $activeTabContent[0].getBoundingClientRect().top,
isContentHeightBiggerThanWindow=$activeTabContent.height() > offsetBottom;
if(!isContentHeightBiggerThanWindow){
return;
}
$activeTabContent.css('height', this.calculateMenuTabContentHeight($activeTabContent) + 'px');
$activeTabContent.css('overflow-y', 'scroll');
}
resetMenuHeight($activeTabContent){
if(!this.isElementSticky()){
return;
}
$activeTabContent.css('height', 'initial');
$activeTabContent.css('overflow-y', 'visible');
}
isToggleActive(){
const $menuToggle=this.widgetConfig.elements.$menuToggle;
if(!!this.widgetConfig.attributes?.menuToggleState){
return 'true'===$menuToggle.attr(this.widgetConfig.attributes.menuToggleState);
}
return $menuToggle.hasClass(this.widgetConfig.classes.menuToggleActiveClass);
}}
exports["default"]=DropdownMenuHeightController;
},
"../assets/dev/js/public-path.js"
(__unused_webpack_module, __unused_webpack_exports, __webpack_require__){
"use strict";
__webpack_require__.p=ElementorProFrontendConfig.urls.assets + 'js/';
},
"../modules/code-highlight/assets/js/frontend/frontend.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
class _default extends elementorModules.Module {
constructor(){
super();
elementorFrontend.elementsHandler.attachHandler('code-highlight', ()=> __webpack_require__.e( "code-highlight").then(__webpack_require__.bind(__webpack_require__,  "../modules/code-highlight/assets/js/frontend/handler.js")));
}}
exports["default"]=_default;
},
"../modules/motion-fx/assets/js/frontend/frontend.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
var _interopRequireDefault=__webpack_require__( "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
var _handler=_interopRequireDefault(__webpack_require__( "../modules/motion-fx/assets/js/frontend/handler.js"));
class _default extends elementorModules.Module {
constructor(){
super();
elementorFrontend.elementsHandler.attachHandler('global', _handler.default, null);
}}
exports["default"]=_default;
},
"../modules/motion-fx/assets/js/frontend/handler.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
var _interopRequireDefault=__webpack_require__( "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
var _motionFx=_interopRequireDefault(__webpack_require__( "../modules/motion-fx/assets/js/frontend/motion-fx/motion-fx.js"));
class _default extends elementorModules.frontend.handlers.Base {
__construct(...args){
super.__construct(...args);
this.toggle=elementorFrontend.debounce(this.toggle, 200);
}
getDefaultSettings(){
return {
selectors: {
container: '.elementor-widget-container'
}};}
getDefaultElements(){
const selectors=this.getSettings('selectors');
let container=this.$element.find(selectors.container);
if(0===container.length){
container=this.$element;
}
return {
$container: container
};}
bindEvents(){
elementorFrontend.elements.$window.on('resize', this.toggle);
}
unbindEvents(){
elementorFrontend.elements.$window.off('resize', this.toggle);
}
addCSSTransformEvents(){
const motionFxScrolling=this.getElementSettings('motion_fx_motion_fx_scrolling');
if(motionFxScrolling&&!this.isTransitionEventAdded){
this.isTransitionEventAdded=true;
this.elements.$container.on('mouseenter', ()=> {
this.elements.$container.css('--e-transform-transition-duration', '');
});
}}
initEffects(){
this.effects={
translateY: {
interaction: 'scroll',
actions: ['translateY']
},
translateX: {
interaction: 'scroll',
actions: ['translateX']
},
rotateZ: {
interaction: 'scroll',
actions: ['rotateZ']
},
scale: {
interaction: 'scroll',
actions: ['scale']
},
opacity: {
interaction: 'scroll',
actions: ['opacity']
},
blur: {
interaction: 'scroll',
actions: ['blur']
},
mouseTrack: {
interaction: 'mouseMove',
actions: ['translateXY']
},
tilt: {
interaction: 'mouseMove',
actions: ['tilt']
}};}
prepareOptions(name){
const elementSettings=this.getElementSettings(),
type='motion_fx'===name ? 'element':'background',
interactions={};
jQuery.each(elementSettings, (key, value)=> {
const keyRegex=new RegExp('^' + name + '_(.+?)_effect'),
keyMatches=key.match(keyRegex);
if(!keyMatches||!value){
return;
}
const options={},
effectName=keyMatches[1];
jQuery.each(elementSettings, (subKey, subValue)=> {
const subKeyRegex=new RegExp(name + '_' + effectName + '_(.+)'),
subKeyMatches=subKey.match(subKeyRegex);
if(!subKeyMatches){
return;
}
const subFieldName=subKeyMatches[1];
if('effect'===subFieldName){
return;
}
if('object'===typeof subValue){
subValue=Object.keys(subValue.sizes).length ? subValue.sizes:subValue.size;
}
options[subKeyMatches[1]]=subValue;
});
const effect=this.effects[effectName],
interactionName=effect.interaction;
if(!interactions[interactionName]){
interactions[interactionName]={};}
effect.actions.forEach(action=> interactions[interactionName][action]=options);
});
let $element=this.$element,
$dimensionsElement,
$childElement;
const elementType=this.getElementType();
if('element'===type&&!['section', 'container'].includes(elementType)){
$dimensionsElement=$element;
let childElementSelector;
if('column'===elementType){
childElementSelector='.elementor-widget-wrap';
}else{
childElementSelector='.elementor-widget-container';
}
$childElement=$element.find('> ' + childElementSelector);
$element=0===$childElement.length ? this.$element:$childElement;
}
const options={
type,
interactions,
elementSettings,
$element,
$dimensionsElement,
refreshDimensions: this.isEdit,
range: elementSettings[name + '_range'],
classes: {
element: 'elementor-motion-effects-element',
parent: 'elementor-motion-effects-parent',
backgroundType: 'elementor-motion-effects-element-type-background',
container: 'elementor-motion-effects-container',
layer: 'elementor-motion-effects-layer',
perspective: 'elementor-motion-effects-perspective'
}};
if(!options.range&&'fixed'===this.getCurrentDeviceSetting('_position')){
options.range='page';
}
if('fixed'===this.getCurrentDeviceSetting('_position')){
options.isFixedPosition=true;
}
if('background'===type&&'column'===this.getElementType()){
options.addBackgroundLayerTo=' > .elementor-element-populated';
}
return options;
}
activate(name){
const options=this.prepareOptions(name);
if(jQuery.isEmptyObject(options.interactions)){
return;
}
this[name]=new _motionFx.default(options);
}
deactivate(name){
if(this[name]){
this[name].destroy();
delete this[name];
}}
toggle(){
const currentDeviceMode=elementorFrontend.getCurrentDeviceMode(),
elementSettings=this.getElementSettings();
['motion_fx', 'background_motion_fx'].forEach(name=> {
const devices=elementSettings[name + '_devices'],
isCurrentModeActive = !devices||-1!==devices.indexOf(currentDeviceMode);
if(isCurrentModeActive&&(elementSettings[name + '_motion_fx_scrolling']||elementSettings[name + '_motion_fx_mouse'])){
if(this[name]){
this.refreshInstance(name);
}else{
this.activate(name);
}}else{
this.deactivate(name);
}});
}
refreshInstance(instanceName){
const instance=this[instanceName];
if(!instance){
return;
}
const preparedOptions=this.prepareOptions(instanceName);
instance.setSettings(preparedOptions);
instance.refresh();
}
onInit(){
super.onInit();
const prefersReducedMotion=window.matchMedia('(prefers-reduced-motion: reduce)');
if(prefersReducedMotion&&prefersReducedMotion.matches){
return;
}
this.initEffects();
this.addCSSTransformEvents();
this.toggle();
}
onElementChange(propertyName){
if(/motion_fx_((scrolling)|(mouse)|(devices))$/.test(propertyName)){
if('motion_fx_motion_fx_scrolling'===propertyName){
this.addCSSTransformEvents();
}
this.toggle();
return;
}
const propertyMatches=propertyName.match('.*?(motion_fx|_transform)');
if(propertyMatches){
const instanceName=propertyMatches[0].match('(_transform)') ? 'motion_fx':propertyMatches[0];
this.refreshInstance(instanceName);
if(!this[instanceName]){
this.activate(instanceName);
}}
if(/^_position/.test(propertyName)){
['motion_fx', 'background_motion_fx'].forEach(instanceName=> {
this.refreshInstance(instanceName);
});
}}
onDestroy(){
super.onDestroy();
['motion_fx', 'background_motion_fx'].forEach(name=> {
this.deactivate(name);
});
}}
exports["default"]=_default;
},
"../modules/motion-fx/assets/js/frontend/motion-fx/actions.js"
(__unused_webpack_module, exports){
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
class _default extends elementorModules.Module {
getMovePointFromPassedPercents(movableRange, passedPercents){
const movePoint=passedPercents / movableRange * 100;
return +movePoint.toFixed(2);
}
getEffectValueFromMovePoint(range, movePoint){
return range * movePoint / 100;
}
getStep(passedPercents, options){
if('element'===this.getSettings('type')){
return this.getElementStep(passedPercents, options);
}
return this.getBackgroundStep(passedPercents, options);
}
getElementStep(passedPercents, options){
return -(passedPercents - 50) * options.speed;
}
getBackgroundStep(passedPercents, options){
const movableRange=this.getSettings('dimensions.movable' + options.axis.toUpperCase());
return -this.getEffectValueFromMovePoint(movableRange, passedPercents);
}
getDirectionMovePoint(passedPercents, direction, range){
let movePoint;
if(passedPercents < range.start){
if('out-in'===direction){
movePoint=0;
}else if('in-out'===direction){
movePoint=100;
}else{
movePoint=this.getMovePointFromPassedPercents(range.start, passedPercents);
if('in-out-in'===direction){
movePoint=100 - movePoint;
}}
}else if(passedPercents < range.end){
if('in-out-in'===direction){
movePoint=0;
}else if('out-in-out'===direction){
movePoint=100;
}else{
movePoint=this.getMovePointFromPassedPercents(range.end - range.start, passedPercents - range.start);
if('in-out'===direction){
movePoint=100 - movePoint;
}}
}else if('in-out'===direction){
movePoint=0;
}else if('out-in'===direction){
movePoint=100;
}else{
movePoint=this.getMovePointFromPassedPercents(100 - range.end, 100 - passedPercents);
if('in-out-in'===direction){
movePoint=100 - movePoint;
}}
return movePoint;
}
translateX(actionData, passedPercents){
actionData.axis='x';
actionData.unit='px';
this.transform('translateX', passedPercents, actionData);
}
translateY(actionData, passedPercents){
actionData.axis='y';
actionData.unit='px';
this.transform('translateY', passedPercents, actionData);
}
translateXY(actionData, passedPercentsX, passedPercentsY){
this.translateX(actionData, passedPercentsX);
this.translateY(actionData, passedPercentsY);
}
tilt(actionData, passedPercentsX, passedPercentsY){
const options={
speed: actionData.speed / 10,
direction: actionData.direction
};
this.rotateX(options, passedPercentsY);
this.rotateY(options, 100 - passedPercentsX);
}
rotateX(actionData, passedPercents){
actionData.axis='x';
actionData.unit='deg';
this.transform('rotateX', passedPercents, actionData);
}
rotateY(actionData, passedPercents){
actionData.axis='y';
actionData.unit='deg';
this.transform('rotateY', passedPercents, actionData);
}
rotateZ(actionData, passedPercents){
actionData.unit='deg';
this.transform('rotateZ', passedPercents, actionData);
}
scale(actionData, passedPercents){
const movePoint=this.getDirectionMovePoint(passedPercents, actionData.direction, actionData.range);
this.updateRulePart('transform', 'scale', 1 + actionData.speed * movePoint / 1000);
}
transform(action, passedPercents, actionData){
if(actionData.direction){
passedPercents=100 - passedPercents;
}
this.updateRulePart('transform', action, this.getStep(passedPercents, actionData) + actionData.unit);
}
setCSSTransformVariables(elementSettings){
this.CSSTransformVariables=[];
jQuery.each(elementSettings, (settingKey, settingValue)=> {
const transformKeyMatches=settingKey.match(/_transform_(.+?)_effect/m);
if(transformKeyMatches&&settingValue){
if('perspective'===transformKeyMatches[1]){
this.CSSTransformVariables.unshift(transformKeyMatches[1]);
return;
}
if(this.CSSTransformVariables.includes(transformKeyMatches[1])){
return;
}
this.CSSTransformVariables.push(transformKeyMatches[1]);
}});
}
opacity(actionData, passedPercents){
const movePoint=this.getDirectionMovePoint(passedPercents, actionData.direction, actionData.range),
level=actionData.level / 10,
opacity=1 - level + this.getEffectValueFromMovePoint(level, movePoint);
this.$element.css({
opacity,
'will-change': 'opacity'
});
}
blur(actionData, passedPercents){
const movePoint=this.getDirectionMovePoint(passedPercents, actionData.direction, actionData.range),
blur=actionData.level - this.getEffectValueFromMovePoint(actionData.level, movePoint);
this.updateRulePart('filter', 'blur', blur + 'px');
}
updateRulePart(ruleName, key, value){
if(!this.rulesVariables[ruleName]){
this.rulesVariables[ruleName]={};}
if(!this.rulesVariables[ruleName][key]){
this.rulesVariables[ruleName][key]=true;
this.updateRule(ruleName);
}
const cssVarKey=`--${key}`;
this.$element[0].style.setProperty(cssVarKey, value);
}
updateRule(ruleName){
let value='';
value +=this.concatTransformCSSProperties(ruleName);
value +=this.concatTransformMotionEffectCSSProperties(ruleName);
this.$element.css(ruleName, value);
}
concatTransformCSSProperties(ruleName){
let value='';
if('transform'===ruleName){
jQuery.each(this.CSSTransformVariables, (index, variableKey)=> {
const variableName=variableKey;
if(variableKey.startsWith('flip')){
variableKey=variableKey.replace('flip', 'scale');
}
const defaultUnit=variableKey.startsWith('rotate')||variableKey.startsWith('skew') ? 'deg':'px',
defaultValue=variableKey.startsWith('scale') ? 1:0 + defaultUnit;
value +=`${variableKey}(var(--e-transform-${variableName}, ${defaultValue}))`;
});
}
return value;
}
concatTransformMotionEffectCSSProperties(ruleName){
let value='';
jQuery.each(this.rulesVariables[ruleName], variableKey=> {
value +=`${variableKey}(var(--${variableKey}))`;
});
return value;
}
runAction(actionName, actionData, passedPercents, ...args){
if(actionData.affectedRange){
if(actionData.affectedRange.start > passedPercents){
passedPercents=actionData.affectedRange.start;
}
if(actionData.affectedRange.end < passedPercents){
passedPercents=actionData.affectedRange.end;
}}
this[actionName](actionData, passedPercents, ...args);
}
refresh(){
this.rulesVariables={};
this.CSSTransformVariables=[];
this.$element.css({
transform: '',
filter: '',
opacity: '',
'will-change': ''
});
}
onInit(){
this.$element=this.getSettings('$targetElement');
this.refresh();
}}
exports["default"]=_default;
},
"../modules/motion-fx/assets/js/frontend/motion-fx/interactions/base.js"
(__unused_webpack_module, exports){
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
class _default extends elementorModules.ViewModule {
__construct(options){
this.motionFX=options.motionFX;
if(!this.intersectionObservers){
this.setElementInViewportObserver();
}}
setElementInViewportObserver(){
this.intersectionObserver=elementorModules.utils.Scroll.scrollObserver({
callback: event=> {
if(event.isInViewport){
this.onInsideViewport();
}else{
this.removeAnimationFrameRequest();
}}
});
const observedElement='page'===this.motionFX.getSettings('range') ? elementorFrontend.elements.$body[0]:this.motionFX.elements.$parent[0];
this.intersectionObserver.observe(observedElement);
}
onInsideViewport=()=> {
this.run();
this.animationFrameRequest=requestAnimationFrame(this.onInsideViewport);
};
runCallback(...args){
const callback=this.getSettings('callback');
callback(...args);
}
removeIntersectionObserver(){
if(this.intersectionObserver){
this.intersectionObserver.unobserve(this.motionFX.elements.$parent[0]);
}}
removeAnimationFrameRequest(){
if(this.animationFrameRequest){
cancelAnimationFrame(this.animationFrameRequest);
}}
destroy(){
this.removeAnimationFrameRequest();
this.removeIntersectionObserver();
}
onInit(){
super.onInit();
}}
exports["default"]=_default;
},
"../modules/motion-fx/assets/js/frontend/motion-fx/interactions/mouse-move.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
var _interopRequireDefault=__webpack_require__( "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
var _base=_interopRequireDefault(__webpack_require__( "../modules/motion-fx/assets/js/frontend/motion-fx/interactions/base.js"));
class MouseMoveInteraction extends _base.default {
bindEvents(){
if(!MouseMoveInteraction.mouseTracked){
elementorFrontend.elements.$window.on('mousemove', MouseMoveInteraction.updateMousePosition);
MouseMoveInteraction.mouseTracked=true;
}}
run(){
const mousePosition=MouseMoveInteraction.mousePosition,
oldMousePosition=this.oldMousePosition;
if(oldMousePosition.x===mousePosition.x&&oldMousePosition.y===mousePosition.y){
return;
}
this.oldMousePosition={
x: mousePosition.x,
y: mousePosition.y
};
const passedPercentsX=100 / innerWidth * mousePosition.x,
passedPercentsY=100 / innerHeight * mousePosition.y;
this.runCallback(passedPercentsX, passedPercentsY);
}
onInit(){
this.oldMousePosition={};
super.onInit();
}}
exports["default"]=MouseMoveInteraction;
MouseMoveInteraction.mousePosition={};
MouseMoveInteraction.updateMousePosition=event=> {
MouseMoveInteraction.mousePosition={
x: event.clientX,
y: event.clientY
};};
},
"../modules/motion-fx/assets/js/frontend/motion-fx/interactions/scroll.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
var _interopRequireDefault=__webpack_require__( "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
var _base=_interopRequireDefault(__webpack_require__( "../modules/motion-fx/assets/js/frontend/motion-fx/interactions/base.js"));
class _default extends _base.default {
run(){
if(pageYOffset===this.windowScrollTop){
return false;
}
this.onScrollMovement();
this.windowScrollTop=pageYOffset;
}
onScrollMovement(){
this.updateMotionFxDimensions();
this.updateAnimation();
this.resetTransitionVariable();
}
resetTransitionVariable(){
this.motionFX.$element.css('--e-transform-transition-duration', '100ms');
}
updateMotionFxDimensions(){
const motionFXSettings=this.motionFX.getSettings();
if(motionFXSettings.refreshDimensions){
this.motionFX.defineDimensions();
}}
updateAnimation(){
let passedRangePercents;
if('page'===this.motionFX.getSettings('range')){
passedRangePercents=elementorModules.utils.Scroll.getPageScrollPercentage();
}else if(this.motionFX.getSettings('isFixedPosition')){
passedRangePercents=elementorModules.utils.Scroll.getPageScrollPercentage({}, window.innerHeight);
}else{
passedRangePercents=elementorModules.utils.Scroll.getElementViewportPercentage(this.motionFX.elements.$parent);
}
this.runCallback(passedRangePercents);
}}
exports["default"]=_default;
},
"../modules/motion-fx/assets/js/frontend/motion-fx/motion-fx.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
var _interopRequireDefault=__webpack_require__( "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
var _scroll=_interopRequireDefault(__webpack_require__( "../modules/motion-fx/assets/js/frontend/motion-fx/interactions/scroll.js"));
var _mouseMove=_interopRequireDefault(__webpack_require__( "../modules/motion-fx/assets/js/frontend/motion-fx/interactions/mouse-move.js"));
var _actions=_interopRequireDefault(__webpack_require__( "../modules/motion-fx/assets/js/frontend/motion-fx/actions.js"));
class _default extends elementorModules.ViewModule {
getDefaultSettings(){
return {
type: 'element',
$element: null,
$dimensionsElement: null,
addBackgroundLayerTo: null,
interactions: {},
refreshDimensions: false,
range: 'viewport',
classes: {
element: 'motion-fx-element',
parent: 'motion-fx-parent',
backgroundType: 'motion-fx-element-type-background',
container: 'motion-fx-container',
layer: 'motion-fx-layer',
perspective: 'motion-fx-perspective'
}};}
bindEvents(){
this.defineDimensions=this.defineDimensions.bind(this);
elementorFrontend.elements.$window.on('resize elementor-pro/motion-fx/recalc', this.defineDimensions);
}
unbindEvents(){
elementorFrontend.elements.$window.off('resize elementor-pro/motion-fx/recalc', this.defineDimensions);
}
addBackgroundLayer(){
const settings=this.getSettings();
this.elements.$motionFXContainer=jQuery('<div>', {
class: settings.classes.container
});
this.elements.$motionFXLayer=jQuery('<div>', {
class: settings.classes.layer
});
this.updateBackgroundLayerSize();
this.elements.$motionFXContainer.prepend(this.elements.$motionFXLayer);
const $addBackgroundLayerTo=settings.addBackgroundLayerTo ? this.$element.find(settings.addBackgroundLayerTo):this.$element;
$addBackgroundLayerTo.prepend(this.elements.$motionFXContainer);
}
removeBackgroundLayer(){
this.elements.$motionFXContainer.remove();
}
updateBackgroundLayerSize(){
const settings=this.getSettings(),
speed={
x: 0,
y: 0
},
mouseInteraction=settings.interactions.mouseMove,
scrollInteraction=settings.interactions.scroll;
if(mouseInteraction&&mouseInteraction.translateXY){
speed.x=mouseInteraction.translateXY.speed * 10;
speed.y=mouseInteraction.translateXY.speed * 10;
}
if(scrollInteraction){
if(scrollInteraction.translateX){
speed.x=scrollInteraction.translateX.speed * 10;
}
if(scrollInteraction.translateY){
speed.y=scrollInteraction.translateY.speed * 10;
}}
this.elements.$motionFXLayer.css({
width: 100 + speed.x + '%',
height: 100 + speed.y + '%'
});
}
defineDimensions(){
const $dimensionsElement=this.getSettings('$dimensionsElement')||this.$element,
elementOffset=$dimensionsElement.offset();
const dimensions={
elementHeight: $dimensionsElement.outerHeight(),
elementWidth: $dimensionsElement.outerWidth(),
elementTop: elementOffset.top,
elementLeft: elementOffset.left
};
dimensions.elementRange=dimensions.elementHeight + innerHeight;
this.setSettings('dimensions', dimensions);
if('background'===this.getSettings('type')){
this.defineBackgroundLayerDimensions();
}}
defineBackgroundLayerDimensions(){
const dimensions=this.getSettings('dimensions');
dimensions.layerHeight=this.elements.$motionFXLayer.height();
dimensions.layerWidth=this.elements.$motionFXLayer.width();
dimensions.movableX=dimensions.layerWidth - dimensions.elementWidth;
dimensions.movableY=dimensions.layerHeight - dimensions.elementHeight;
this.setSettings('dimensions', dimensions);
}
initInteractionsTypes(){
this.interactionsTypes={
scroll: _scroll.default,
mouseMove: _mouseMove.default
};}
prepareSpecialActions(){
const settings=this.getSettings(),
hasTiltEffect = !!(settings.interactions.mouseMove&&settings.interactions.mouseMove.tilt);
this.elements.$parent.toggleClass(settings.classes.perspective, hasTiltEffect);
}
cleanSpecialActions(){
const settings=this.getSettings();
this.elements.$parent.removeClass(settings.classes.perspective);
}
runInteractions(){
const settings=this.getSettings();
this.actions.setCSSTransformVariables(settings.elementSettings);
this.prepareSpecialActions();
jQuery.each(settings.interactions, (interactionName, actions)=> {
this.interactions[interactionName]=new this.interactionsTypes[interactionName]({
motionFX: this,
callback: (...args)=> {
jQuery.each(actions, (actionName, actionData)=> this.actions.runAction(actionName, actionData, ...args));
}});
this.interactions[interactionName].run();
});
}
destroyInteractions(){
this.cleanSpecialActions();
jQuery.each(this.interactions, (interactionName, interaction)=> interaction.destroy());
this.interactions={};}
refresh(){
this.actions.setSettings(this.getSettings());
if('background'===this.getSettings('type')){
this.updateBackgroundLayerSize();
this.defineBackgroundLayerDimensions();
}
this.actions.refresh();
this.destroyInteractions();
this.runInteractions();
}
destroy(){
this.destroyInteractions();
this.actions.refresh();
const settings=this.getSettings();
this.$element.removeClass(settings.classes.element);
this.elements.$parent.removeClass(settings.classes.parent);
if('background'===settings.type){
this.$element.removeClass(settings.classes.backgroundType);
this.removeBackgroundLayer();
}}
onInit(){
super.onInit();
const settings=this.getSettings();
this.$element=settings.$element;
this.elements.$parent=this.$element.parent();
this.$element.addClass(settings.classes.element);
this.elements.$parent=this.$element.parent();
this.elements.$parent.addClass(settings.classes.parent);
if('background'===settings.type){
this.$element.addClass(settings.classes.backgroundType);
this.addBackgroundLayer();
}
this.defineDimensions();
settings.$targetElement='element'===settings.type ? this.$element:this.elements.$motionFXLayer;
this.interactions={};
this.actions=new _actions.default(settings);
this.initInteractionsTypes();
this.runInteractions();
}}
exports["default"]=_default;
},
"../modules/payments/assets/js/frontend/frontend.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
class _default extends elementorModules.Module {
constructor(){
super();
elementorFrontend.elementsHandler.attachHandler('paypal-button', ()=> __webpack_require__.e( "paypal-button").then(__webpack_require__.bind(__webpack_require__,  "../modules/payments/assets/js/frontend/handlers/paypal-button.js")));
elementorFrontend.elementsHandler.attachHandler('stripe-button', ()=> Promise.all([__webpack_require__.e("vendors-node_modules_dompurify_dist_purify_cjs_js"), __webpack_require__.e("stripe-button")]).then(__webpack_require__.bind(__webpack_require__,  "../modules/payments/assets/js/frontend/handlers/stripe-button.js")));
}}
exports["default"]=_default;
},
"../modules/progress-tracker/assets/js/frontend/frontend.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
class _default extends elementorModules.Module {
constructor(){
super();
elementorFrontend.elementsHandler.attachHandler('progress-tracker', ()=> __webpack_require__.e( "progress-tracker").then(__webpack_require__.bind(__webpack_require__,  "../modules/progress-tracker/assets/js/frontend/handlers/progress-tracker.js")));
}}
exports["default"]=_default;
},
"../modules/sticky/assets/js/frontend/frontend.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
var _interopRequireDefault=__webpack_require__( "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
var _sticky=_interopRequireDefault(__webpack_require__( "../modules/sticky/assets/js/frontend/handlers/sticky.js"));
class _default extends elementorModules.Module {
constructor(){
super();
elementorFrontend.elementsHandler.attachHandler('section', _sticky.default, null);
elementorFrontend.elementsHandler.attachHandler('container', _sticky.default, null);
elementorFrontend.elementsHandler.attachHandler('widget', _sticky.default, null);
}}
exports["default"]=_default;
},
"../modules/sticky/assets/js/frontend/handlers/sticky.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
var _utils=__webpack_require__( "../../elementor/assets/dev/js/frontend/utils/utils.js");
var _default=exports["default"]=elementorModules.frontend.handlers.Base.extend({
currentConfig: {},
debouncedReactivate: null,
bindEvents(){
elementorFrontend.addListenerOnce(this.getUniqueHandlerID() + 'sticky', 'resize', this.reactivateOnResize);
},
unbindEvents(){
elementorFrontend.removeListeners(this.getUniqueHandlerID() + 'sticky', 'resize', this.reactivateOnResize);
},
isStickyInstanceActive(){
return undefined!==this.$element.data('sticky');
},
getResponsiveSetting(setting){
const elementSettings=this.getElementSettings();
return elementorFrontend.getCurrentDeviceSetting(elementSettings, setting);
},
getResponsiveSettingList(setting){
const breakpoints=Object.keys(elementorFrontend.config.responsive.activeBreakpoints);
return ['', ...breakpoints].map(suffix=> {
return suffix ? `${setting}_${suffix}`:setting;
});
},
getConfig(){
const elementSettings=this.getElementSettings(),
stickyOptions={
to: elementSettings.sticky,
offset: this.getResponsiveSetting('sticky_offset'),
effectsOffset: this.getResponsiveSetting('sticky_effects_offset'),
classes: {
sticky: 'elementor-sticky',
stickyActive: 'elementor-sticky--active elementor-section--handles-inside',
stickyEffects: 'elementor-sticky--effects',
spacer: 'elementor-sticky__spacer'
},
isRTL: elementorFrontend.config.is_rtl,
isScrollSnapActive: (0, _utils.isScrollSnapActive)(),
handleScrollbarWidth: elementorFrontend.isEditMode()
},
$wpAdminBar=elementorFrontend.elements.$wpAdminBar,
isParentContainer=this.isContainerElement(this.$element[0])&&!this.isContainerElement(this.$element[0].parentElement);
if($wpAdminBar.length&&'top'===elementSettings.sticky&&'fixed'===$wpAdminBar.css('position')){
stickyOptions.offset +=$wpAdminBar.height();
}
if(elementSettings.sticky_parent&&!isParentContainer){
stickyOptions.parent='.e-con, .e-con-inner, .elementor-widget-wrap';
}
return stickyOptions;
},
activate(){
this.currentConfig=this.getConfig();
this.$element.sticky(this.currentConfig);
},
deactivate(){
if(!this.isStickyInstanceActive()){
return;
}
this.$element.sticky('destroy');
},
run(refresh){
if(!this.getElementSettings('sticky')){
this.deactivate();
return;
}
var currentDeviceMode=elementorFrontend.getCurrentDeviceMode(),
activeDevices=this.getElementSettings('sticky_on');
if(-1!==activeDevices.indexOf(currentDeviceMode)){
if(true===refresh){
this.reactivate();
}else if(!this.isStickyInstanceActive()){
this.activate();
}}else{
this.deactivate();
}},
reactivateOnResize(){
clearTimeout(this.debouncedReactivate);
this.debouncedReactivate=setTimeout(()=> {
const config=this.getConfig(),
isDifferentConfig=JSON.stringify(config)!==JSON.stringify(this.currentConfig);
if(isDifferentConfig){
this.run(true);
}}, 300);
},
reactivate(){
this.deactivate();
this.activate();
},
onElementChange(settingKey){
if(-1!==['sticky', 'sticky_on'].indexOf(settingKey)){
this.run(true);
}
const settings=[...this.getResponsiveSettingList('sticky_offset'), ...this.getResponsiveSettingList('sticky_effects_offset'), 'sticky_parent'];
if(-1!==settings.indexOf(settingKey)){
this.reactivate();
}},
onDeviceModeChange(){
setTimeout(()=> this.run(true));
},
onInit(){
elementorModules.frontend.handlers.Base.prototype.onInit.apply(this, arguments);
if(elementorFrontend.isEditMode()){
elementor.listenTo(elementor.channels.deviceMode, 'change', ()=> this.onDeviceModeChange());
}
this.run();
},
onDestroy(){
elementorModules.frontend.handlers.Base.prototype.onDestroy.apply(this, arguments);
this.deactivate();
},
isContainerElement(element){
const containerClasses=['e-con', 'e-con-inner'];
return containerClasses.some(containerClass=> {
return element?.classList.contains(containerClass);
});
}});
},
"../modules/video-playlist/assets/js/frontend/frontend.js"
(__unused_webpack_module, exports, __webpack_require__){
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"]=void 0;
class _default extends elementorModules.Module {
constructor(){
super();
elementorFrontend.hooks.addAction('frontend/element_ready/video-playlist.default', $element=> {
__webpack_require__.e( "video-playlist").then(__webpack_require__.bind(__webpack_require__,  "../modules/video-playlist/assets/js/frontend/handler.js")).then(({
default: dynamicHandler
})=> {
elementorFrontend.elementsHandler.addHandler(dynamicHandler, {
$element,
toggleSelf: false
});
});
});
}}
exports["default"]=_default;
},
"../node_modules/@babel/runtime/helpers/interopRequireDefault.js"
(module){
function _interopRequireDefault(e){
return e&&e.__esModule ? e:{
"default": e
};}
module.exports=_interopRequireDefault, module.exports.__esModule=true, module.exports["default"]=module.exports;
}},
__webpack_require__=> {
var __webpack_exec__=(moduleId)=> (__webpack_require__(__webpack_require__.s=moduleId))
var __webpack_exports__=(__webpack_exec__("../assets/dev/js/frontend/frontend.js"));
}
]);