;(function (factory){
if(typeof define==='function'&&define.amd){
define(['jquery'], factory);
}else if(typeof exports==='object'){
factory(require('jquery'));
}else{
factory(window.jQuery||window.Zepto);
}}(function($){
var CLOSE_EVENT='Close',
BEFORE_CLOSE_EVENT='BeforeClose',
AFTER_CLOSE_EVENT='AfterClose',
BEFORE_APPEND_EVENT='BeforeAppend',
MARKUP_PARSE_EVENT='MarkupParse',
OPEN_EVENT='Open',
CHANGE_EVENT='Change',
NS='mfp',
EVENT_NS='.' + NS,
READY_CLASS='mfp-ready',
REMOVING_CLASS='mfp-removing',
PREVENT_CLOSE_CLASS='mfp-prevent-close';
var mfp,
MagnificPopup=function(){},
_isJQ = !!(window.jQuery),
_prevStatus,
_window=$(window),
_document,
_prevContentType,
_wrapClasses,
_currPopupType;
var _mfpOn=function(name, f){
mfp.ev.on(NS + name + EVENT_NS, f);
},
_getEl=function(className, appendTo, html, raw){
var el=document.createElement('div');
el.className='mfp-'+className;
if(html){
el.innerHTML=html;
}
if(!raw){
el=$(el);
if(appendTo){
el.appendTo(appendTo);
}}else if(appendTo){
appendTo.appendChild(el);
}
return el;
},
_mfpTrigger=function(e, data){
mfp.ev.triggerHandler(NS + e, data);
if(mfp.st.callbacks){
e=e.charAt(0).toLowerCase() + e.slice(1);
if(mfp.st.callbacks[e]){
mfp.st.callbacks[e].apply(mfp, Array.isArray(data) ? data:[data]);
}}
},
_getCloseBtn=function(type){
if(type!==_currPopupType||!mfp.currTemplate.closeBtn){
mfp.currTemplate.closeBtn=$(mfp.st.closeMarkup.replace(/%title%/g, mfp.st.tClose) );
_currPopupType=type;
}
return mfp.currTemplate.closeBtn;
},
_checkInstance=function(){
if(!$.magnificPopup.instance){
mfp=new MagnificPopup();
mfp.init();
$.magnificPopup.instance=mfp;
}},
supportsTransitions=function(){
var s=document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
v=['ms','O','Moz','Webkit']; // 'v' for vendor
if(s['transition']!==undefined){
return true;
}
while(v.length){
if(v.pop() + 'Transition' in s){
return true;
}}
return false;
};
MagnificPopup.prototype={
constructor: MagnificPopup,
init: function(){
var appVersion=navigator.appVersion;
mfp.isLowIE=mfp.isIE8=document.all&&!document.addEventListener;
mfp.isAndroid=(/android/gi).test(appVersion);
mfp.isIOS=(/iphone|ipad|ipod/gi).test(appVersion);
mfp.supportsTransition=supportsTransitions();
mfp.probablyMobile=(mfp.isAndroid||mfp.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent));
_document=$(document);
mfp.popupsCache={};},
open: function(data){
var i;
if(data.isObj===false){
mfp.items=data.items.toArray();
mfp.index=0;
var items=data.items,
item;
for(i=0; i < items.length; i++){
item=items[i];
if(item.parsed){
item=item.el[0];
}
if(item===data.el[0]){
mfp.index=i;
break;
}}
}else{
mfp.items=Array.isArray(data.items) ? data.items:[data.items];
mfp.index=data.index||0;
}
if(mfp.isOpen){
mfp.updateItemHTML();
return;
}
mfp.types=[];
_wrapClasses='';
if(data.mainEl&&data.mainEl.length){
mfp.ev=data.mainEl.eq(0);
}else{
mfp.ev=_document;
}
if(data.key){
if(!mfp.popupsCache[data.key]){
mfp.popupsCache[data.key]={};}
mfp.currTemplate=mfp.popupsCache[data.key];
}else{
mfp.currTemplate={};}
mfp.st=$.extend(true, {}, $.magnificPopup.defaults, data);
mfp.fixedContentPos=mfp.st.fixedContentPos==='auto' ? !mfp.probablyMobile:mfp.st.fixedContentPos;
if(mfp.st.modal){
mfp.st.closeOnContentClick=false;
mfp.st.closeOnBgClick=false;
mfp.st.showCloseBtn=false;
mfp.st.enableEscapeKey=false;
}
if(!mfp.bgOverlay){
mfp.bgOverlay=_getEl('bg').on('click'+EVENT_NS, function(){
mfp.close();
});
mfp.wrap=_getEl('wrap')
.attr('tabindex', -1)
.attr('role', 'dialog')
.attr('aria-modal', true)
.attr('aria-label', 'Popup Image')
.on('click'+EVENT_NS, function(e){
if(mfp._checkIfClose(e.target)){
mfp.close();
}});
mfp.container=_getEl('container', mfp.wrap);
}
mfp.contentContainer=_getEl('content');
if(mfp.st.preloader){
mfp.preloader=_getEl('preloader', mfp.container, mfp.st.tLoading);
}
var modules=$.magnificPopup.modules;
for(i=0; i < modules.length; i++){
var n=modules[i];
n=n.charAt(0).toUpperCase() + n.slice(1);
mfp['init'+n].call(mfp);
}
_mfpTrigger('BeforeOpen');
if(mfp.st.showCloseBtn){
if(!mfp.st.closeBtnInside){
mfp.wrap.append(_getCloseBtn());
}else{
_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item){
values.close_replaceWith=_getCloseBtn(item.type);
});
_wrapClasses +=' mfp-close-btn-in';
}}
if(mfp.st.alignTop){
_wrapClasses +=' mfp-align-top';
}
if(mfp.fixedContentPos){
mfp.wrap.css({
overflow: mfp.st.overflowY,
overflowX: 'hidden',
overflowY: mfp.st.overflowY
});
}else{
mfp.wrap.css({
top: _window.scrollTop(),
position: 'absolute'
});
}
if(mfp.st.fixedBgPos===false||(mfp.st.fixedBgPos==='auto'&&!mfp.fixedContentPos)){
mfp.bgOverlay.css({
height: _document.height(),
position: 'absolute'
});
}
if(mfp.st.enableEscapeKey){
_document.on('keyup' + EVENT_NS, function(e){
if(e.keyCode===27){
mfp.close();
}});
}
_window.on('resize' + EVENT_NS, function(){
mfp.updateSize();
});
if(!mfp.st.closeOnContentClick){
_wrapClasses +=' mfp-auto-cursor';
}
if(_wrapClasses)
mfp.wrap.addClass(_wrapClasses);
var windowHeight=mfp.wH=_window.height();
var windowStyles={};
if(mfp.fixedContentPos){
if(mfp._hasScrollBar(windowHeight)){
var s=mfp._getScrollbarSize();
if(s){
windowStyles.marginRight=s;
}}
}
if(mfp.fixedContentPos){
if(!mfp.isIE7){
windowStyles.overflow='hidden';
}else{
$('body, html').css('overflow', 'hidden');
}}
var classesToadd=mfp.st.mainClass;
if(mfp.isIE7){
classesToadd +=' mfp-ie7';
}
if(classesToadd){
mfp._addClassToMFP(classesToadd);
}
mfp.updateItemHTML();
_mfpTrigger('BuildControls');
$('html').css(windowStyles);
mfp.bgOverlay.add(mfp.wrap).prependTo(mfp.st.prependTo||$(document.body));
mfp._lastFocusedEl=document.activeElement;
setTimeout(function(){
if(mfp.content){
mfp._addClassToMFP(READY_CLASS);
mfp._setFocus();
}else{
mfp.bgOverlay.addClass(READY_CLASS);
}
_document.on('focusin' + EVENT_NS, mfp._onFocusIn);
}, 16);
mfp.isOpen=true;
mfp.updateSize(windowHeight);
_mfpTrigger(OPEN_EVENT);
return data;
},
close: function(){
if(!mfp.isOpen) return;
_mfpTrigger(BEFORE_CLOSE_EVENT);
mfp.isOpen=false;
if(mfp.st.removalDelay&&!mfp.isLowIE&&mfp.supportsTransition){
mfp._addClassToMFP(REMOVING_CLASS);
setTimeout(function(){
mfp._close();
}, mfp.st.removalDelay);
}else{
mfp._close();
}},
_close: function(){
_mfpTrigger(CLOSE_EVENT);
var classesToRemove=REMOVING_CLASS + ' ' + READY_CLASS + ' ';
mfp.bgOverlay.detach();
mfp.wrap.detach();
mfp.container.empty();
if(mfp.st.mainClass){
classesToRemove +=mfp.st.mainClass + ' ';
}
mfp._removeClassFromMFP(classesToRemove);
if(mfp.fixedContentPos){
var windowStyles={marginRight: ''};
if(mfp.isIE7){
$('body, html').css('overflow', '');
}else{
windowStyles.overflow='';
}
$('html').css(windowStyles);
}
_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
mfp.ev.off(EVENT_NS);
mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
mfp.bgOverlay.attr('class', 'mfp-bg');
mfp.container.attr('class', 'mfp-container');
if(mfp.st.showCloseBtn &&
(!mfp.st.closeBtnInside||mfp.currTemplate[mfp.currItem.type]===true)){
if(mfp.currTemplate.closeBtn)
mfp.currTemplate.closeBtn.detach();
}
if(mfp.st.autoFocusLast&&mfp._lastFocusedEl){
$(mfp._lastFocusedEl).trigger('focus');
}
mfp.currItem=null;
mfp.content=null;
mfp.currTemplate=null;
mfp.prevHeight=0;
_mfpTrigger(AFTER_CLOSE_EVENT);
},
updateSize: function(winHeight){
if(mfp.isIOS){
var zoomLevel=document.documentElement.clientWidth / window.innerWidth;
var height=window.innerHeight * zoomLevel;
mfp.wrap.css('height', height);
mfp.wH=height;
}else{
mfp.wH=winHeight||_window.height();
}
if(!mfp.fixedContentPos){
mfp.wrap.css('height', mfp.wH);
}
_mfpTrigger('Resize');
},
updateItemHTML: function(){
var item=mfp.items[mfp.index];
mfp.contentContainer.detach();
if(mfp.content)
mfp.content.detach();
if(!item.parsed){
item=mfp.parseEl(mfp.index);
}
var type=item.type;
_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type:'', type]);
mfp.currItem=item;
if(!mfp.currTemplate[type]){
var markup=mfp.st[type] ? mfp.st[type].markup:false;
_mfpTrigger('FirstMarkupParse', markup);
if(markup){
mfp.currTemplate[type]=$(markup);
}else{
mfp.currTemplate[type]=true;
}}
if(_prevContentType&&_prevContentType!==item.type){
mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
}
var newContent=mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
mfp.appendContent(newContent, type);
item.preloaded=true;
_mfpTrigger(CHANGE_EVENT, item);
_prevContentType=item.type;
mfp.container.prepend(mfp.contentContainer);
_mfpTrigger('AfterChange');
},
appendContent: function(newContent, type){
mfp.content=newContent;
if(newContent){
if(mfp.st.showCloseBtn&&mfp.st.closeBtnInside &&
mfp.currTemplate[type]===true){
if(!mfp.content.find('.mfp-close').length){
mfp.content.append(_getCloseBtn());
}}else{
mfp.content=newContent;
}}else{
mfp.content='';
}
_mfpTrigger(BEFORE_APPEND_EVENT);
mfp.container.addClass('mfp-'+type+'-holder');
mfp.contentContainer.append(mfp.content);
},
parseEl: function(index){
var item=mfp.items[index],
type;
if(item.tagName){
item={ el: $(item) };}else{
type=item.type;
item={ data: item, src: item.src };}
if(item.el){
var types=mfp.types;
for(var i=0; i < types.length; i++){
if(item.el.hasClass('mfp-'+types[i])){
type=types[i];
break;
}}
item.src=item.el.attr('data-mfp-src');
if(!item.src){
item.src=item.el.attr('href');
}}
item.type=type||mfp.st.type||'inline';
item.index=index;
item.parsed=true;
mfp.items[index]=item;
_mfpTrigger('ElementParse', item);
return mfp.items[index];
},
addGroup: function(el, options){
var eHandler=function(e){
e.mfpEl=this;
mfp._openClick(e, el, options);
};
if(!options){
options={};}
var eName='click.magnificPopup';
options.mainEl=el;
if(options.items){
options.isObj=true;
el.off(eName).on(eName, eHandler);
}else{
options.isObj=false;
if(options.delegate){
el.off(eName).on(eName, options.delegate , eHandler);
}else{
options.items=el;
el.off(eName).on(eName, eHandler);
}}
},
_openClick: function(e, el, options){
var midClick=options.midClick!==undefined ? options.midClick:$.magnificPopup.defaults.midClick;
if(!midClick&&(e.which===2||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey) ){
return;
}
var disableOn=options.disableOn!==undefined ? options.disableOn:$.magnificPopup.defaults.disableOn;
if(disableOn){
if(typeof disableOn==="function"){
if(!disableOn.call(mfp)){
return true;
}}else{
if(_window.width() < disableOn){
return true;
}}
}
if(e.type){
e.preventDefault();
if(mfp.isOpen){
e.stopPropagation();
}}
options.el=$(e.mfpEl);
if(options.delegate){
options.items=el.find(options.delegate);
}
mfp.open(options);
},
updateStatus: function(status, text){
if(mfp.preloader){
if(_prevStatus!==status){
mfp.container.removeClass('mfp-s-'+_prevStatus);
}
if(!text&&status==='loading'){
text=mfp.st.tLoading;
}
var data={
status: status,
text: text
};
_mfpTrigger('UpdateStatus', data);
status=data.status;
text=data.text;
if(mfp.st.allowHTMLInStatusIndicator){
mfp.preloader.html(text);
}else{
mfp.preloader.text(text);
}
mfp.preloader.find('a').on('click', function(e){
e.stopImmediatePropagation();
});
mfp.container.addClass('mfp-s-'+status);
_prevStatus=status;
}},
/*
"Private" helpers that aren't private at all
*/
_checkIfClose: function(target){
if($(target).closest('.' + PREVENT_CLOSE_CLASS).length){
return;
}
var closeOnContent=mfp.st.closeOnContentClick;
var closeOnBg=mfp.st.closeOnBgClick;
if(closeOnContent&&closeOnBg){
return true;
}else{
if(!mfp.content||$(target).closest('.mfp-close').length||(mfp.preloader&&target===mfp.preloader[0])){
return true;
}
if((target!==mfp.content[0]&&!$.contains(mfp.content[0], target))){
if(closeOnBg){
if($.contains(document, target)){
return true;
}}
}else if(closeOnContent){
return true;
}}
return false;
},
_addClassToMFP: function(cName){
mfp.bgOverlay.addClass(cName);
mfp.wrap.addClass(cName);
},
_removeClassFromMFP: function(cName){
this.bgOverlay.removeClass(cName);
mfp.wrap.removeClass(cName);
},
_hasScrollBar: function(winHeight){
return((mfp.isIE7 ? _document.height():document.body.scrollHeight) > (winHeight||_window.height()));
},
_setFocus: function(){
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0):mfp.wrap).trigger('focus');
},
_onFocusIn: function(e){
if(e.target!==mfp.wrap[0]&&!$.contains(mfp.wrap[0], e.target)){
mfp._setFocus();
return false;
}},
_parseMarkup: function(template, values, item){
var arr;
if(item.data){
values=$.extend(item.data, values);
}
_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item]);
$.each(values, function(key, value){
if(value===undefined||value===false){
return true;
}
arr=key.split('_');
if(arr.length > 1){
var el=template.find(EVENT_NS + '-'+arr[0]);
if(el.length > 0){
var attr=arr[1];
if(attr==='replaceWith'){
if(el[0]!==value[0]){
el.replaceWith(value);
}}else if(attr==='img'){
if(el.is('img')){
el.attr('src', value);
}else{
el.replaceWith($('<img>').attr('src', value).attr('class', el.attr('class')));
}}else{
el.attr(arr[1], value);
}}
}else{
if(mfp.st.allowHTMLInTemplate){
template.find(EVENT_NS + '-'+key).html(value);
}else{
template.find(EVENT_NS + '-'+key).text(value);
}}
});
},
_getScrollbarSize: function(){
if(mfp.scrollbarSize===undefined){
var scrollDiv=document.createElement("div");
scrollDiv.style.cssText='width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
document.body.appendChild(scrollDiv);
mfp.scrollbarSize=scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
}
return mfp.scrollbarSize;
}}; 
$.magnificPopup={
instance: null,
proto: MagnificPopup.prototype,
modules: [],
open: function(options, index){
_checkInstance();
if(!options){
options={};}else{
options=$.extend(true, {}, options);
}
options.isObj=true;
options.index=index||0;
return this.instance.open(options);
},
close: function(){
return $.magnificPopup.instance&&$.magnificPopup.instance.close();
},
registerModule: function(name, module){
if(module.options){
$.magnificPopup.defaults[name]=module.options;
}
$.extend(this.proto, module.proto);
this.modules.push(name);
},
defaults: {
disableOn: 0,
key: null,
midClick: false,
mainClass: '',
preloader: true,
focus: '',
closeOnContentClick: false,
closeOnBgClick: true,
closeBtnInside: true,
showCloseBtn: true,
enableEscapeKey: true,
modal: false,
alignTop: false,
removalDelay: 0,
prependTo: null,
fixedContentPos: 'auto',
fixedBgPos: 'auto',
overflowY: 'auto',
closeMarkup: '<button title="%title%" type="button" class="mfp-close" aria-label="%title%"><span aria-hidden="true">&times;</span></button>',
tClose: 'Close (Esc)',
tLoading: 'Loading...',
autoFocusLast: true,
allowHTMLInStatusIndicator: false,
allowHTMLInTemplate: false
}};
$.fn.magnificPopup=function(options){
_checkInstance();
var jqEl=$(this);
if(typeof options==="string"){
if(options==='open'){
var items,
itemOpts=_isJQ ? jqEl.data('magnificPopup'):jqEl[0].magnificPopup,
index=parseInt(arguments[1], 10)||0;
if(itemOpts.items){
items=itemOpts.items[index];
}else{
items=jqEl;
if(itemOpts.delegate){
items=items.find(itemOpts.delegate);
}
items=items.eq(index);
}
mfp._openClick({mfpEl:items}, jqEl, itemOpts);
}else{
if(mfp.isOpen)
mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
}}else{
options=$.extend(true, {}, options);
if(_isJQ){
jqEl.data('magnificPopup', options);
}else{
jqEl[0].magnificPopup=options;
}
mfp.addGroup(jqEl, options);
}
return jqEl;
};
var INLINE_NS='inline',
_hiddenClass,
_inlinePlaceholder,
_lastInlineElement,
_putInlineElementsBack=function(){
if(_lastInlineElement){
_inlinePlaceholder.after(_lastInlineElement.addClass(_hiddenClass)).detach();
_lastInlineElement=null;
}};
$.magnificPopup.registerModule(INLINE_NS, {
options: {
hiddenClass: 'hide',
markup: '',
tNotFound: 'Content not found'
},
proto: {
initInline: function(){
mfp.types.push(INLINE_NS);
_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function(){
_putInlineElementsBack();
});
},
getInline: function(item, template){
_putInlineElementsBack();
if(item.src){
var inlineSt=mfp.st.inline,
el=$(item.src);
if(el.length){
var parent=el[0].parentNode;
if(parent&&parent.tagName){
if(!_inlinePlaceholder){
_hiddenClass=inlineSt.hiddenClass;
_inlinePlaceholder=_getEl(_hiddenClass);
_hiddenClass='mfp-'+_hiddenClass;
}
_lastInlineElement=el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
}
mfp.updateStatus('ready');
}else{
mfp.updateStatus('error', inlineSt.tNotFound);
el=$('<div>');
}
item.inlineElement=el;
return el;
}
mfp.updateStatus('ready');
mfp._parseMarkup(template, {}, item);
return template;
}}
});
var AJAX_NS='ajax',
_ajaxCur,
_removeAjaxCursor=function(){
if(_ajaxCur){
$(document.body).removeClass(_ajaxCur);
}},
_destroyAjaxRequest=function(){
_removeAjaxCursor();
if(mfp.req){
mfp.req.abort();
}};
$.magnificPopup.registerModule(AJAX_NS, {
options: {
settings: null,
cursor: 'mfp-ajax-cur',
tError: 'The content could not be loaded.'
},
proto: {
initAjax: function(){
mfp.types.push(AJAX_NS);
_ajaxCur=mfp.st.ajax.cursor;
_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
},
getAjax: function(item){
if(_ajaxCur){
$(document.body).addClass(_ajaxCur);
}
mfp.updateStatus('loading');
var opts=$.extend({
url: item.src,
success: function(data, textStatus, jqXHR){
var temp={
data:data,
xhr:jqXHR
};
_mfpTrigger('ParseAjax', temp);
mfp.appendContent($(temp.data), AJAX_NS);
item.finished=true;
_removeAjaxCursor();
mfp._setFocus();
setTimeout(function(){
mfp.wrap.addClass(READY_CLASS);
}, 16);
mfp.updateStatus('ready');
_mfpTrigger('AjaxContentAdded');
},
error: function(){
_removeAjaxCursor();
item.finished=item.loadError=true;
mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
}}, mfp.st.ajax.settings);
mfp.req=$.ajax(opts);
return '';
}}
});
var _imgInterval,
_getTitle=function(item){
if(item.data&&item.data.title!==undefined)
return item.data.title;
var src=mfp.st.image.titleSrc;
if(src){
if(typeof src==="function"){
return src.call(mfp, item);
}else if(item.el){
return item.el.attr(src)||'';
}}
return '';
};
$.magnificPopup.registerModule('image', {
options: {
markup: '<div class="mfp-figure">'+
'<div class="mfp-close"></div>'+
'<figure>'+
'<div class="mfp-img"></div>'+
'<figcaption>'+
'<div class="mfp-bottom-bar">'+
'<div class="mfp-title"></div>'+
'<div class="mfp-counter"></div>'+
'</div>'+
'</figcaption>'+
'</figure>'+
'</div>',
cursor: 'mfp-zoom-out-cur',
titleSrc: 'title',
verticalFit: true,
tError: 'The image could not be loaded.'
},
proto: {
initImage: function(){
var imgSt=mfp.st.image,
ns='.image';
mfp.types.push('image');
_mfpOn(OPEN_EVENT+ns, function(){
if(mfp.currItem.type==='image'&&imgSt.cursor){
$(document.body).addClass(imgSt.cursor);
}});
_mfpOn(CLOSE_EVENT+ns, function(){
if(imgSt.cursor){
$(document.body).removeClass(imgSt.cursor);
}
_window.off('resize' + EVENT_NS);
});
_mfpOn('Resize'+ns, mfp.resizeImage);
if(mfp.isLowIE){
_mfpOn('AfterChange', mfp.resizeImage);
}},
resizeImage: function(){
var item=mfp.currItem;
if(!item||!item.img) return;
if(mfp.st.image.verticalFit){
var decr=0;
if(mfp.isLowIE){
decr=parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
}
item.img.css('max-height', mfp.wH-decr);
}},
_onImageHasSize: function(item){
if(item.img){
item.hasSize=true;
if(_imgInterval){
clearInterval(_imgInterval);
}
item.isCheckingImgSize=false;
_mfpTrigger('ImageHasSize', item);
if(item.imgHidden){
if(mfp.content)
mfp.content.removeClass('mfp-loading');
item.imgHidden=false;
}}
},
findImageSize: function(item){
var counter=0,
img=item.img[0],
mfpSetInterval=function(delay){
if(_imgInterval){
clearInterval(_imgInterval);
}
_imgInterval=setInterval(function(){
if(img.naturalWidth > 0){
mfp._onImageHasSize(item);
return;
}
if(counter > 200){
clearInterval(_imgInterval);
}
counter++;
if(counter===3){
mfpSetInterval(10);
}else if(counter===40){
mfpSetInterval(50);
}else if(counter===100){
mfpSetInterval(500);
}}, delay);
};
mfpSetInterval(1);
},
getImage: function(item, template){
var guard=0,
imgSt=mfp.st.image,
onLoadError=function(){
if(item){
item.img.off('.mfploader');
if(item===mfp.currItem){
mfp._onImageHasSize(item);
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src));
}
item.hasSize=true;
item.loaded=true;
item.loadError=true;
}},
onLoadComplete=function(){
if(item){
if(item.img[0].complete){
item.img.off('.mfploader');
if(item===mfp.currItem){
mfp._onImageHasSize(item);
mfp.updateStatus('ready');
}
item.hasSize=true;
item.loaded=true;
_mfpTrigger('ImageLoadComplete');
}else{
guard++;
if(guard < 200){
setTimeout(onLoadComplete,100);
}else{
onLoadError();
}}
}};
var el=template.find('.mfp-img');
if(el.length){
var img=document.createElement('img');
img.className='mfp-img';
if(item.el&&item.el.find('img').length){
img.alt=item.el.find('img').attr('alt');
}
item.img=$(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
img.src=item.src;
if(el.is('img')){
item.img=item.img.clone();
}
img=item.img[0];
if(img.naturalWidth > 0){
item.hasSize=true;
}else if(!img.width){
item.hasSize=false;
}}
mfp._parseMarkup(template, {
title: _getTitle(item),
img_replaceWith: item.img
}, item);
mfp.resizeImage();
if(item.hasSize){
if(_imgInterval) clearInterval(_imgInterval);
if(item.loadError){
template.addClass('mfp-loading');
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src));
}else{
template.removeClass('mfp-loading');
mfp.updateStatus('ready');
}
return template;
}
mfp.updateStatus('loading');
item.loading=true;
if(!item.hasSize){
item.imgHidden=true;
template.addClass('mfp-loading');
mfp.findImageSize(item);
}
return template;
}}
});
var hasMozTransform,
getHasMozTransform=function(){
if(hasMozTransform===undefined){
hasMozTransform=document.createElement('p').style.MozTransform!==undefined;
}
return hasMozTransform;
};
$.magnificPopup.registerModule('zoom', {
options: {
enabled: false,
easing: 'ease-in-out',
duration: 300,
opener: function(element){
return element.is('img') ? element:element.find('img');
}},
proto: {
initZoom: function(){
var zoomSt=mfp.st.zoom,
ns='.zoom',
image;
if(!zoomSt.enabled||!mfp.supportsTransition){
return;
}
var duration=zoomSt.duration,
getElToAnimate=function(image){
var newImg=image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
transition='all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
cssObj={
position: 'fixed',
zIndex: 9999,
left: 0,
top: 0,
'-webkit-backface-visibility': 'hidden'
},
t='transition';
cssObj['-webkit-'+t]=cssObj['-moz-'+t]=cssObj['-o-'+t]=cssObj[t]=transition;
newImg.css(cssObj);
return newImg;
},
showMainContent=function(){
mfp.content.css('visibility', 'visible');
},
openTimeout,
animatedImg;
_mfpOn('BuildControls'+ns, function(){
if(mfp._allowZoom()){
clearTimeout(openTimeout);
mfp.content.css('visibility', 'hidden');
image=mfp._getItemToZoom();
if(!image){
showMainContent();
return;
}
animatedImg=getElToAnimate(image);
animatedImg.css(mfp._getOffset());
mfp.wrap.append(animatedImg);
openTimeout=setTimeout(function(){
animatedImg.css(mfp._getOffset(true) );
openTimeout=setTimeout(function(){
showMainContent();
setTimeout(function(){
animatedImg.remove();
image=animatedImg=null;
_mfpTrigger('ZoomAnimationEnded');
}, 16);
}, duration);
}, 16);
}});
_mfpOn(BEFORE_CLOSE_EVENT+ns, function(){
if(mfp._allowZoom()){
clearTimeout(openTimeout);
mfp.st.removalDelay=duration;
if(!image){
image=mfp._getItemToZoom();
if(!image){
return;
}
animatedImg=getElToAnimate(image);
}
animatedImg.css(mfp._getOffset(true));
mfp.wrap.append(animatedImg);
mfp.content.css('visibility', 'hidden');
setTimeout(function(){
animatedImg.css(mfp._getOffset());
}, 16);
}});
_mfpOn(CLOSE_EVENT+ns, function(){
if(mfp._allowZoom()){
showMainContent();
if(animatedImg){
animatedImg.remove();
}
image=null;
}});
},
_allowZoom: function(){
return mfp.currItem.type==='image';
},
_getItemToZoom: function(){
if(mfp.currItem.hasSize){
return mfp.currItem.img;
}else{
return false;
}},
_getOffset: function(isLarge){
var el;
if(isLarge){
el=mfp.currItem.img;
}else{
el=mfp.st.zoom.opener(mfp.currItem.el||mfp.currItem);
}
var offset=el.offset();
var paddingTop=parseInt(el.css('padding-top'),10);
var paddingBottom=parseInt(el.css('padding-bottom'),10);
offset.top -=($(window).scrollTop() - paddingTop);
var obj={
width: el.width(),
height: (_isJQ ? el.innerHeight():el[0].offsetHeight) - paddingBottom - paddingTop
};
if(getHasMozTransform()){
obj['-moz-transform']=obj['transform']='translate(' + offset.left + 'px,' + offset.top + 'px)';
}else{
obj.left=offset.left;
obj.top=offset.top;
}
return obj;
}}
});
var IFRAME_NS='iframe',
_emptyPage='//about:blank',
_fixIframeBugs=function(isShowing){
if(mfp.currTemplate[IFRAME_NS]){
var el=mfp.currTemplate[IFRAME_NS].find('iframe');
if(el.length){
if(!isShowing){
el[0].src=_emptyPage;
}
if(mfp.isIE8){
el.css('display', isShowing ? 'block':'none');
}}
}};
$.magnificPopup.registerModule(IFRAME_NS, {
options: {
markup: '<div class="mfp-iframe-scaler">'+
'<div class="mfp-close"></div>'+
'<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
'</div>',
srcAction: 'iframe_src',
patterns: {
youtube: {
index: 'youtube.com',
id: 'v=',
src: '//www.youtube.com/embed/%id%?autoplay=1'
},
youtu_be: {
index: 'youtu.be',
id: '/',
src: '//www.youtube.com/embed/%id%?autoplay=1',
},
youtube_nocookie: {
index: 'youtube-nocookie.com',
id: '/',
src: '//www.youtube-nocookie.com/embed/%id%?autoplay=1',
},
vimeo: {
index: 'vimeo.com/',
id: '/',
src: '//player.vimeo.com/video/%id%?autoplay=1'
},
gmaps: {
index: '//maps.google.',
src: '%id%&output=embed'
}}
},
proto: {
initIframe: function(){
mfp.types.push(IFRAME_NS);
_mfpOn('BeforeChange', function(e, prevType, newType){
if(prevType!==newType){
if(prevType===IFRAME_NS){
_fixIframeBugs();
}else if(newType===IFRAME_NS){
_fixIframeBugs(true);
}}
});
_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function(){
_fixIframeBugs();
});
},
getIframe: function(item, template){
var embedSrc=item.src;
var iframeSt=mfp.st.iframe;
$.each(iframeSt.patterns, function(){
if(embedSrc.indexOf(this.index) > -1){
if(this.id){
if(typeof this.id==='string'){
embedSrc=embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
}else{
embedSrc=this.id.call(this, embedSrc);
}}
embedSrc=this.src.replace('%id%', embedSrc);
return false;
}});
var dataObj={};
if(iframeSt.srcAction){
dataObj[iframeSt.srcAction]=embedSrc;
}
mfp._parseMarkup(template, dataObj, item);
mfp.updateStatus('ready');
return template;
}}
});
var _getLoopedId=function(index){
var numSlides=mfp.items.length;
if(index > numSlides - 1){
return index - numSlides;
}else if(index < 0){
return numSlides + index;
}
return index;
},
_replaceCurrTotal=function(text, curr, total){
return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
};
$.magnificPopup.registerModule('gallery', {
options: {
enabled: false,
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
preload: [0,2],
navigateByImgClick: true,
arrows: true,
tPrev: 'Previous (Left arrow key)',
tNext: 'Next (Right arrow key)',
tCounter: '%curr% of %total%',
langDir: null,
loop: true,
},
proto: {
initGallery: function(){
var gSt=mfp.st.gallery,
ns='.mfp-gallery';
mfp.direction=true;
if(!gSt||!gSt.enabled) return false;
if(!gSt.langDir){
gSt.langDir=document.dir||'ltr';
}
_wrapClasses +=' mfp-gallery';
_mfpOn(OPEN_EVENT+ns, function(){
if(gSt.navigateByImgClick){
mfp.wrap.on('click'+ns, '.mfp-img', function(){
if(mfp.items.length > 1){
mfp.next();
return false;
}});
}
_document.on('keydown'+ns, function(e){
if(e.keyCode===37){
if(gSt.langDir==='rtl') mfp.next();
else mfp.prev();
}else if(e.keyCode===39){
if(gSt.langDir==='rtl') mfp.prev();
else mfp.next();
}});
mfp.updateGalleryButtons();
});
_mfpOn('UpdateStatus'+ns, function(){
mfp.updateGalleryButtons();
});
_mfpOn('UpdateStatus'+ns, function(e, data){
if(data.text){
data.text=_replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
}});
_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item){
var l=mfp.items.length;
values.counter=l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l):'';
});
_mfpOn('BuildControls' + ns, function(){
if(mfp.items.length > 1&&gSt.arrows&&!mfp.arrowLeft){
var arrowLeftDesc, arrowRightDesc, arrowLeftAction, arrowRightAction;
if(gSt.langDir==='rtl'){
arrowLeftDesc=gSt.tNext;
arrowRightDesc=gSt.tPrev;
arrowLeftAction='next';
arrowRightAction='prev';
}else{
arrowLeftDesc=gSt.tPrev;
arrowRightDesc=gSt.tNext;
arrowLeftAction='prev';
arrowRightAction='next';
}
var markup=gSt.arrowMarkup,
arrowLeft=mfp.arrowLeft=$(markup.replace(/%title%/gi, arrowLeftDesc)
.replace(/%action%/gi, arrowLeftAction)
.replace(/%dir%/gi, 'left'))
.attr('aria-label', arrowLeftDesc)
.addClass(PREVENT_CLOSE_CLASS),
arrowRight=mfp.arrowRight=$(markup.replace(/%title%/gi, arrowRightDesc)
.replace(/%action%/gi, arrowRightAction)
.replace(/%dir%/gi, 'right'))
.attr('aria-label', arrowRightDesc)
.addClass(PREVENT_CLOSE_CLASS);
if(gSt.langDir==='rtl'){
mfp.arrowNext=arrowLeft;
mfp.arrowPrev=arrowRight;
}else{
mfp.arrowNext=arrowRight;
mfp.arrowPrev=arrowLeft;
}
arrowLeft.on('click', function(){
if(gSt.langDir==='rtl') mfp.next();
else mfp.prev();
});
arrowRight.on('click', function(){
if(gSt.langDir==='rtl') mfp.prev();
else mfp.next();
});
mfp.container.append(arrowLeft.add(arrowRight));
mfp.container
.attr('role', 'region')
.attr('aria-label', 'carousel');
}});
_mfpOn(CHANGE_EVENT+ns, function(){
if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
mfp._preloadTimeout=setTimeout(function(){
mfp.preloadNearbyImages();
mfp._preloadTimeout=null;
}, 16);
});
_mfpOn(CLOSE_EVENT+ns, function(){
_document.off(ns);
mfp.wrap.off('click'+ns);
mfp.arrowRight=mfp.arrowLeft=null;
});
},
next: function(){
var newIndex=_getLoopedId(mfp.index + 1);
if(!mfp.st.gallery.loop&&newIndex===0) return false;
mfp.direction=true;
mfp.index=newIndex;
mfp.updateItemHTML();
},
prev: function(){
var newIndex=mfp.index - 1;
if(!mfp.st.gallery.loop&&newIndex < 0) return false;
mfp.direction=false;
mfp.index=_getLoopedId(newIndex);
mfp.updateItemHTML();
},
goTo: function(newIndex){
mfp.direction=(newIndex >=mfp.index);
mfp.index=newIndex;
mfp.updateItemHTML();
},
preloadNearbyImages: function(){
var p=mfp.st.gallery.preload,
preloadBefore=Math.min(p[0], mfp.items.length),
preloadAfter=Math.min(p[1], mfp.items.length),
i;
for(i=1; i <=(mfp.direction ? preloadAfter:preloadBefore); i++){
mfp._preloadItem(mfp.index+i);
}
for(i=1; i <=(mfp.direction ? preloadBefore:preloadAfter); i++){
mfp._preloadItem(mfp.index-i);
}},
_preloadItem: function(index){
index=_getLoopedId(index);
if(mfp.items[index].preloaded){
return;
}
var item=mfp.items[index];
if(!item.parsed){
item=mfp.parseEl(index);
}
_mfpTrigger('LazyLoad', item);
if(item.type==='image'){
item.img=$('<img class="mfp-img" />').on('load.mfploader', function(){
item.hasSize=true;
}).on('error.mfploader', function(){
item.hasSize=true;
item.loadError=true;
_mfpTrigger('LazyLoadError', item);
}).attr('src', item.src);
}
item.preloaded=true;
},
updateGalleryButtons: function(){
if(!mfp.st.gallery.loop&&typeof mfp.arrowPrev==='object'&&mfp.arrowPrev!==null){
if(mfp.index===0) mfp.arrowPrev.hide();
else mfp.arrowPrev.show();
if(mfp.index===(mfp.items.length - 1)) mfp.arrowNext.hide();
else mfp.arrowNext.show();
}},
}});
var RETINA_NS='retina';
$.magnificPopup.registerModule(RETINA_NS, {
options: {
replaceSrc: function(item){
return item.src.replace(/\.\w+$/, function(m){ return '@2x' + m; });
},
ratio: 1 
},
proto: {
initRetina: function(){
if(window.devicePixelRatio > 1){
var st=mfp.st.retina,
ratio=st.ratio;
ratio = !isNaN(ratio) ? ratio:ratio();
if(ratio > 1){
_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item){
item.img.css({
'max-width': item.img[0].naturalWidth / ratio,
'width': '100%'
});
});
_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item){
item.src=st.replaceSrc(item, ratio);
});
}}
}}
});
_checkInstance(); }));
var wpAjaxUrl='https://biancadata.com/wp-admin/admin-ajax.php';var flBuilderUrl='https://biancadata.com/wp-content/plugins/bb-plugin/';var FLBuilderLayoutConfig={
anchorLinkAnimations:{
duration:1000,
easing:'swing',
offset:100
},
paths:{
pluginUrl:'https://biancadata.com/wp-content/plugins/bb-plugin/',
wpAjaxUrl:'https://biancadata.com/wp-admin/admin-ajax.php'
},
breakpoints:{
small:768,
medium:992,
large:1200	},
waypoint: {
offset: 80
},
emptyColWidth: '0%'
};
(function($){
if(typeof FLBuilderLayout!='undefined'){
return;
}
FLBuilderLayout={
init: function(){
FLBuilderLayout._destroy();
FLBuilderLayout._initClasses();
FLBuilderLayout._initBackgrounds();
FLBuilderLayout._initButtons();
FLBuilderLayout._initRowShapeLayerHeight();
if(0===$('.fl-builder-edit').length){
FLBuilderLayout._initAnchorLinks();
FLBuilderLayout._initHash();
FLBuilderLayout._initForms();
FLBuilderLayout._reorderMenu();
}else{
FLBuilderLayout._initNestedColsWidth();
}
$('body').removeClass('fl-no-js');
},
refreshGalleries: function(element){
var $element='undefined'==typeof element ? $('body'):$(element),
mfContent=$element.find('.fl-mosaicflow-content'),
wmContent=$element.find('.fl-gallery'),
mfObject=null;
if(mfContent){
mfObject=mfContent.data('mosaicflow');
if(mfObject){
mfObject.columns=$([]);
mfObject.columnsHeights=[];
mfContent.data('mosaicflow', mfObject);
mfContent.mosaicflow('refill');
}}
if(wmContent){
wmContent.trigger('refreshWookmark');
}},
refreshGridLayout: function(element){
var $element='undefined'==typeof element ? $('body'):$(element),
msnryContent=$element.find('.masonry');
if(msnryContent.length){
msnryContent.masonry('layout');
}},
reloadSlider: function(content){
var $content='undefined'==typeof content ? $('body'):$(content);
if($content.find('.bx-viewport > div').length > 0){
$.each($content.find('.bx-viewport > div'), function (key, slider){
setTimeout(function (){
$(slider).data('bxSlider').reloadSlider();
}, 100);
});
}},
resizeAudio: function(element){
var $element='undefined'==typeof element ? $('body'):$(element),
audioPlayers=$element.find('.wp-audio-shortcode.mejs-audio'),
player=null,
mejsPlayer=null,
rail=null,
railWidth=400;
if(audioPlayers.length&&typeof mejs!=='undefined'){
audioPlayers.each(function(){
player=$(this);
mejsPlayer=mejs.players[player.attr('id')];
rail=player.find('.mejs-controls .mejs-time-rail');
var innerMejs=player.find('.mejs-inner'),
total=player.find('.mejs-controls .mejs-time-total');
if(typeof mejsPlayer!=='undefined'){
railWidth=Math.ceil(player.width() * 0.8);
if(innerMejs.length){
rail.css('width', railWidth +'px!important');
mejsPlayer.options.autosizeProgress=true;
setTimeout(function (){
mejsPlayer.setControlsSize();
}, 50);
player.find('.mejs-inner').css({
visibility: 'visible',
height: 'inherit'
});
}}
});
}},
preloadAudio: function(element){
var $element='undefined'==typeof element ? $('body'):$(element),
contentWrap=$element.closest('.fl-accordion-item'),
audioPlayers=$element.find('.wp-audio-shortcode.mejs-audio');
if(! contentWrap.hasClass('fl-accordion-item-active')&&audioPlayers.find('.mejs-inner').length){
audioPlayers.find('.mejs-inner').css({
visibility:'hidden',
height: 0
});
}},
resizeSlideshow: function(){
if(typeof YUI!=='undefined'){
YUI().use('node-event-simulate', function(Y){
Y.one(window).simulate("resize");
});
}},
reloadGoogleMap: function(element){
var $element='undefined'==typeof element ? $('body'):$(element),
googleMap=$element.find('iframe[src*="google.com/maps"]');
if(googleMap.length){
googleMap.attr('src', function(i, val){
return val;
});
}},
_destroy: function(){
var win=$(window);
win.off('scroll.fl-bg-parallax');
win.off('resize.fl-bg-video');
},
_isTouch: function(){
if(('ontouchstart' in window)||(window.DocumentTouch&&document instanceof DocumentTouch)){
return true;
}
return false;
},
_isMobile: function(){
return /Mobile|Android|Silk\/|Kindle|BlackBerry|Opera Mini|Opera Mobi|webOS/i.test(navigator.userAgent);
},
_initClasses: function(){
var body=$('body'),
ua=navigator.userAgent;
if(! body.hasClass('fl-builder-blocks-only')&&! body.hasClass('archive')&&$('.fl-builder-content-primary').length > 0){
body.addClass('fl-builder');
}
if(FLBuilderLayout._isTouch()){
body.addClass('fl-builder-touch');
}
if(FLBuilderLayout._isMobile()){
body.addClass('fl-builder-mobile');
}
if($(window).width() < FLBuilderLayoutConfig.breakpoints.small){
body.addClass('fl-builder-breakpoint-small');
}
if($(window).width() > FLBuilderLayoutConfig.breakpoints.small&&$(window).width() < FLBuilderLayoutConfig.breakpoints.medium){
body.addClass('fl-builder-breakpoint-medium');
}
if($(window).width() > FLBuilderLayoutConfig.breakpoints.medium&&$(window).width() < FLBuilderLayoutConfig.breakpoints.large){
body.addClass('fl-builder-breakpoint-large');
}
if($(window).width() > FLBuilderLayoutConfig.breakpoints.large){
body.addClass('fl-builder-breakpoint-default');
}
if(ua.indexOf('Trident/7.0') > -1&&ua.indexOf('rv:11.0') > -1){
body.addClass('fl-builder-ie-11');
}},
_initBackgrounds: function(){
var win=$(window);
if($('.fl-row-bg-parallax').length > 0&&!FLBuilderLayout._isMobile()){
FLBuilderLayout._scrollParallaxBackgrounds();
FLBuilderLayout._initParallaxBackgrounds();
win.on('resize.fl-bg-parallax', FLBuilderLayout._initParallaxBackgrounds);
win.on('scroll.fl-bg-parallax', FLBuilderLayout._scrollParallaxBackgrounds);
}
if($('.fl-bg-video').length > 0){
FLBuilderLayout._initBgVideos();
FLBuilderLayout._resizeBgVideos();
var resizeBGTimer=null;
win.on('resize.fl-bg-video', function(e){
clearTimeout(resizeBGTimer);
resizeBGTimer=setTimeout(function(){
FLBuilderLayout._resizeBgVideos(e);
}, 100);
});
}},
_initButtons: function(){
$('a.fl-button[role="button"]').on('keydown', function(event){
if(event.key==='Enter'||event.key===' '){
event.preventDefault();
$(this).trigger('click');
}});
},
_initParallaxBackgrounds: function(){
$('.fl-row-bg-parallax').each(FLBuilderLayout._initParallaxBackground);
},
_initParallaxBackground: function(){
var row=$(this),
content=row.find('> .fl-row-content-wrap'),
winWidth=$(window).width(),
screenSize='',
imageSrc={
default: '',
medium: '',
responsive: '',
};
imageSrc.default=row.data('parallax-image')||'';
imageSrc.medium=row.data('parallax-image-medium')||imageSrc.default;
imageSrc.responsive=row.data('parallax-image-responsive')||imageSrc.medium;
if(winWidth > FLBuilderLayoutConfig.breakpoints.medium){
screenSize='default';
}else if(winWidth > FLBuilderLayoutConfig.breakpoints.small&&winWidth <=FLBuilderLayoutConfig.breakpoints.medium){
screenSize='medium';
}else if(winWidth <=FLBuilderLayoutConfig.breakpoints.small){
screenSize='responsive';
}
content.css('background-image', 'url(' + imageSrc[screenSize] + ')');
row.data('current-image-loaded', screenSize);
},
_scrollParallaxBackgrounds: function(){
$('.fl-row-bg-parallax').each(FLBuilderLayout._scrollParallaxBackground);
},
_scrollParallaxBackground: function(){
var win=$(window),
row=$(this),
content=row.find('> .fl-row-content-wrap'),
speed=row.data('parallax-speed'),
offset=content.offset(),
yPos=-((win.scrollTop() - offset.top) / speed),
initialOffset=(row.data('parallax-offset')!=null) ? row.data('parallax-offset'):0,
totalOffset=yPos - initialOffset;
content.css('background-position', 'center ' + totalOffset + 'px');
},
_initBgVideos: function(){
$('.fl-bg-video').each(FLBuilderLayout._initBgVideo);
},
_initBgVideo: function(){
var wrap=$(this),
width=wrap.data('width'),
height=wrap.data('height'),
mp4=wrap.data('mp4'),
youtube=wrap.data('youtube'),
vimeo=wrap.data('vimeo'),
mp4Type=wrap.data('mp4-type'),
webm=wrap.data('webm'),
webmType=wrap.data('webm-type'),
fallback=wrap.data('fallback'),
loaded=wrap.data('loaded'),
videoMobile=wrap.data('video-mobile'),
playPauseButton=wrap.find('.fl-bg-video-play-pause-control'),
fallbackTag='',
videoTag=null,
mp4Tag=null,
webmTag=null;
if(loaded){
return;
}
videoTag=$('<video autoplay loop muted playsinline></video>');
if('undefined'!=typeof fallback&&''!=fallback){
videoTag.attr('poster', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7')
videoTag.css({
backgroundImage: 'url("' + fallback + '")',
backgroundColor: 'transparent',
backgroundRepeat: 'no-repeat',
backgroundSize: 'cover',
backgroundPosition: 'center center',
})
}
if('undefined'!=typeof mp4&&''!=mp4){
mp4Tag=$('<source />');
mp4Tag.attr('src', mp4);
mp4Tag.attr('type', mp4Type);
videoTag.append(mp4Tag);
}
if('undefined'!=typeof webm&&''!=webm){
webmTag=$('<source />');
webmTag.attr('src', webm);
webmTag.attr('type', webmType);
videoTag.append(webmTag);
}
if(! FLBuilderLayout._isMobile()||(FLBuilderLayout._isMobile()&&"yes"==videoMobile) ){
if('undefined'!=typeof youtube){
FLBuilderLayout._initYoutubeBgVideo.apply(this);
}
else if('undefined'!=typeof vimeo){
FLBuilderLayout._initVimeoBgVideo.apply(this);
}else{
wrap.append(videoTag);
if(playPauseButton.length > 0){
var video=videoTag[0];
playPauseButton.on('click', { video: video }, function(e){
var video=e.data.video;
if(video.paused){
video.play();
}else{
video.pause();
}});
$(video).on('play playing', function (){
playPauseButton.removeClass('fa-play').addClass('fa-pause');
});
$(video).on('pause ended waiting', function (){
playPauseButton.removeClass('fa-pause').addClass('fa-play');
});
}}
}else{
videoTag.attr('src', '')
wrap.append(videoTag);
}
wrap.data('loaded', true);
},
_initYoutubeBgVideo: function(){
var playerWrap=$(this),
videoId=playerWrap.data('video-id'),
videoPlayer=playerWrap.find('.fl-bg-video-player'),
enableAudio=playerWrap.data('enable-audio'),
audioButton=playerWrap.find('.fl-bg-video-audio'),
playPauseButton=playerWrap.find('.fl-bg-video-play-pause-control'),
startTime='undefined'!==typeof playerWrap.data('start') ? playerWrap.data('start'):0,
startTime='undefined'!==typeof playerWrap.data('t')&&startTime===0 ? playerWrap.data('t'):startTime,
endTime='undefined'!==typeof playerWrap.data('end') ? playerWrap.data('end'):0,
loop='undefined'!==typeof playerWrap.data('loop') ? playerWrap.data('loop'):1,
stateCount=0,
player,fallback_showing;
if(videoId){
fallback=playerWrap.data('fallback')||false
if(fallback){
playerWrap.find('iframe').remove()
fallbackTag=$('<div></div>');
fallbackTag.addClass('fl-bg-video-fallback');
fallbackTag.css('background-image', 'url(' + playerWrap.data('fallback') + ')');
fallbackTag.css('background-size', 'cover');
fallbackTag.css('transition', 'background-image 1s')
playerWrap.append(fallbackTag);
fallback_showing=true;
}
FLBuilderLayout._onYoutubeApiReady(function(YT){
setTimeout(function(){
player=new YT.Player(videoPlayer[0], {
videoId: videoId,
events: {
onReady: function(event){
if("no"===enableAudio||FLBuilderLayout._isMobile()){
event.target.mute();
}
else if("yes"===enableAudio&&event.target.isMuted){
event.target.unMute();
}
playerWrap.data('YTPlayer', player);
FLBuilderLayout._resizeYoutubeBgVideo.apply(playerWrap);
event.target.playVideo();
if(audioButton.length > 0&&! FLBuilderLayout._isMobile()){
audioButton.on('click', {button: audioButton, player: player}, FLBuilderLayout._toggleBgVideoAudio);
}
if(playPauseButton.length > 0){
playPauseButton.on('click', {player: player}, function(e){
var player=e.data.player;
if(1===player.getPlayerState()){
player.pauseVideo();
}else{
player.playVideo();
}});
}},
onStateChange: function(event){
if(event.data===1){
if(fallback_showing){
$('.fl-bg-video-fallback').css('background-image', 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)')
}}
if(stateCount < 4){
stateCount++;
}
if(stateCount > 1&&-1===event.data&&"yes"===enableAudio){
player.mute();
player.playVideo();
audioButton.show();
}
if(event.data===YT.PlayerState.ENDED&&1===loop){
if(startTime > 0){
player.seekTo(startTime);
}else{
player.playVideo();
}}
if(event.data===YT.PlayerState.PLAYING){
playPauseButton.removeClass('fa-play').addClass('fa-pause');
}else if(event.data===YT.PlayerState.PAUSED){
playPauseButton.removeClass('fa-pause').addClass('fa-play');
}else if(event.data===YT.PlayerState.BUFFERING){
playPauseButton.removeClass('fa-play').addClass('fa-pause');
}else if(event.data===YT.PlayerState.CUED){
playPauseButton.removeClass('fa-pause').addClass('fa-play');
}else if(event.data===YT.PlayerState.ENDED){
playPauseButton.removeClass('fa-pause').addClass('fa-play');
}},
onError: function(event){
console.info('YT Error: ' + event.data)
FLBuilderLayout._onErrorYoutubeVimeo(playerWrap)
}},
playerVars: {
playsinline: FLBuilderLayout._isMobile() ? 1:0,
controls: 0,
showinfo: 0,
rel:0,
start: startTime,
end: endTime,
}});
}, 1);
});
}},
_onErrorYoutubeVimeo: function(playerWrap){
fallback=playerWrap.data('fallback')||false
if(! fallback){
return false;
}
playerWrap.find('iframe').remove()
fallbackTag=$('<div></div>');
fallbackTag.addClass('fl-bg-video-fallback');
fallbackTag.css('background-image', 'url(' + playerWrap.data('fallback') + ')');
playerWrap.append(fallbackTag);
},
_onYoutubeApiReady: function(callback){
if(window.YT&&YT.loaded){
callback(YT);
}else{
setTimeout(function(){
FLBuilderLayout._onYoutubeApiReady(callback);
}, 350);
}},
_initVimeoBgVideo: function(){
var playerWrap=$(this),
videoId=playerWrap.data('video-id'),
videoHash=playerWrap.data('video-hash'),
videoPlayer=playerWrap.find('.fl-bg-video-player'),
enableAudio=playerWrap.data('enable-audio'),
audioButton=playerWrap.find('.fl-bg-video-audio'),
playPauseButton=playerWrap.find('.fl-bg-video-play-pause-control'),
playerState='',
player,
width=playerWrap.outerWidth(),
ua=navigator.userAgent;
if(typeof Vimeo!=='undefined'&&videoId){
const vimOptions={
loop:true,
title:false,
portrait:false,
background:true,
autopause:false,
muted:true,
};
if(videoHash.length){
vimOptions.url=`https://player.vimeo.com/video/${ videoId }?h=${ videoHash }`;
}else{
vimOptions.id=videoId;
}
player=new Vimeo.Player(videoPlayer[0], vimOptions);
playerWrap.data('VMPlayer', player);
if("no"===enableAudio){
player.setVolume(0);
}
else if("yes"===enableAudio){
if(ua.indexOf("Safari") > -1||ua.indexOf("Chrome") > -1||ua.indexOf("Firefox") > -1){
player.setVolume(0);
audioButton.show();
}else{
player.setVolume(1);
}}
player.play().catch(function(error){
FLBuilderLayout._onErrorYoutubeVimeo(playerWrap)
});
if(audioButton.length > 0){
audioButton.on('click', {button: audioButton, player: player}, FLBuilderLayout._toggleBgVideoAudio);
}
player.on('play', function(){
playerState='play';
playPauseButton.removeClass('fa-play').addClass('fa-pause');
});
player.on('pause', function(){
playerState='pause';
playPauseButton.removeClass('fa-pause').addClass('fa-play');
});
player.on('ended', function(){
playerState='ended';
playPauseButton.removeClass('fa-pause').addClass('fa-play');
});
player.on('bufferstart', function(){
playerState='bufferstart';
playPauseButton.removeClass('fa-play').addClass('fa-pause');
});
if(playPauseButton.length > 0){
playPauseButton.on('click', { player: player }, function(e){
var player=e.data.player;
if(playerState==='play'){
player.pause();
}else{
player.play();
}});
}}
},
_toggleBgVideoAudio: function(e){
var player=e.data.player,
control=e.data.button.find('.fl-audio-control');
if(control.hasClass('fa-volume-off') ){
control
.removeClass('fa-volume-off')
.addClass('fa-volume-up');
e.data.button.find('.fa-times').hide();
if('function'===typeof player.unMute){
player.unMute();
}else{
player.setVolume(1);
}}else{
control
.removeClass('fa-volume-up')
.addClass('fa-volume-off');
e.data.button.find('.fa-times').show();
if('function'===typeof player.unMute){
player.mute();
}else{
player.setVolume(0);
}}
},
_videoBgSourceError: function(e){
var source=$(e.target),
wrap=source.closest('.fl-bg-video'),
vid=wrap.find('video'),
fallback=wrap.data('fallback'),
fallbackTag='';
source.remove();
if(vid.find('source').length){
return;
}else if(''!==fallback){
fallbackTag=$('<div></div>');
fallbackTag.addClass('fl-bg-video-fallback');
fallbackTag.css('background-image', 'url(' + fallback + ')');
wrap.append(fallbackTag);
vid.remove();
}},
_resizeBgVideos: function(){
$('.fl-bg-video').each(function(){
FLBuilderLayout._resizeBgVideo.apply(this);
if($(this).parent().find('img').length > 0){
$(this).parent().imagesLoaded($.proxy(FLBuilderLayout._resizeBgVideo, this) );
}});
},
_resizeBgVideo: function(){
if(0===$(this).find('video').length&&0===$(this).find('iframe').length){
return;
}
var wrap=$(this),
wrapHeight=wrap.outerHeight(),
wrapWidth=wrap.outerWidth(),
vid=wrap.find('video'),
vidHeight=wrap.data('height'),
vidWidth=wrap.data('width'),
newWidth=wrapWidth,
newHeight=Math.round(vidHeight * wrapWidth/vidWidth),
newLeft=0,
newTop=0,
iframe=wrap.find('iframe'),
isRowFullHeight=$(this).closest('.fl-row-bg-video').hasClass('fl-row-full-height'),
vidCSS={
top:       '50%',
left:      '50%',
transform: 'translate(-50%,-50%)',
};
if(vid.length){
if(vidHeight===''||typeof vidHeight==='undefined'||vidWidth===''||typeof vidWidth==='undefined'){
vid.css({
'left':'0px',
'top':'0px',
'width':newWidth + 'px'
});
vid.on('loadedmetadata', FLBuilderLayout._resizeOnLoadedMeta);
return;
}
if(! isRowFullHeight){
if(newHeight < wrapHeight){
newHeight=wrapHeight;
newLeft=-((newWidth - wrapWidth) / 2);
newWidth=vidHeight ? Math.round(vidWidth * wrapHeight/vidHeight):newWidth;
}else{
newTop=-((newHeight - wrapHeight)/2);
}
vidCSS={
left:newLeft + 'px',
top:newTop + 'px',
height:newHeight + 'px',
width:newWidth + 'px',
}}
vid.css(vidCSS);
}
else if(iframe.length){
if(typeof wrap.data('youtube')!=='undefined'){
FLBuilderLayout._resizeYoutubeBgVideo.apply(this);
}}
},
_resizeOnLoadedMeta: function(){
var video=$(this),
wrapHeight=video.parent().outerHeight(),
wrapWidth=video.parent().outerWidth(),
vidWidth=video[0].videoWidth,
vidHeight=video[0].videoHeight,
newHeight=Math.round(vidHeight * wrapWidth/vidWidth),
newWidth=wrapWidth,
newLeft=0,
newTop=0;
if(newHeight < wrapHeight){
newHeight=wrapHeight;
newWidth=Math.round(vidWidth * wrapHeight/vidHeight);
newLeft=-((newWidth - wrapWidth)/2);
}else{
newTop=-((newHeight - wrapHeight)/2);
}
video.parent().data('width', vidWidth);
video.parent().data('height', vidHeight);
video.css({
'left':newLeft + 'px',
'top':newTop + 'px',
'width':newWidth + 'px',
'height':newHeight + 'px'
});
},
_resizeYoutubeBgVideo: function(){
var wrap=$(this),
wrapWidth=wrap.outerWidth(),
wrapHeight=wrap.outerHeight(),
player=wrap.data('YTPlayer'),
video=player ? player.getIframe():null,
aspectRatioSetting='16:9',
aspectRatioArray=aspectRatioSetting.split(':'),
aspectRatio=aspectRatioArray[0] / aspectRatioArray[1],
ratioWidth=wrapWidth / aspectRatio,
ratioHeight=wrapHeight * aspectRatio,
isWidthFixed=wrapWidth / wrapHeight > aspectRatio,
width=isWidthFixed ? wrapWidth:ratioHeight,
height=isWidthFixed ? ratioWidth:wrapHeight;
if(video){
$(video).width(width).height(height);
}},
_initHash: function(){
var hash=window.location.hash.replace('#', '').split('/').shift(),
element=null,
tabs=null,
responsiveLabel=null,
tabIndex=null,
label=null;
if(''!==hash){
try {
element=$('#' + hash);
if(element.length > 0){
if(element.hasClass('fl-accordion-item') ){
setTimeout(function(){
element.find('.fl-accordion-button').trigger('click');
}, 100);
}
if(element.hasClass('fl-tabs-panel') ){
setTimeout(function(){
tabs=element.closest('.fl-tabs');
responsiveLabel=element.find('.fl-tabs-panel-label');
tabIndex=responsiveLabel.data('index');
label=tabs.find('.fl-tabs-labels .fl-tabs-label[data-index=' + tabIndex + ']');
label[0].click();
FLBuilderLayout._scrollToElement(element);
}, 100);
}}
}
catch(e){}}
},
_initAnchorLinks: function(){
$('a, [role="link"]').each(FLBuilderLayout._initAnchorLink);
},
_initAnchorLink: function(){
var link=$(this),
href=link.data('url') ? link.data('url'):link.attr('href'),
target=link.data('url') ? new URL(href, window.location.href):this,
loc=window.location,
id=null,
element=null,
flNode=false;
if('undefined'!=typeof href&&href.indexOf('#') > -1&&link.closest('svg').length < 1){
if(loc.pathname.replace(/^\//, '')==target.pathname.replace(/^\//, '')&&loc.hostname==target.hostname){
try {
id=href.split('#').pop();
if(! id){
return;
}
element=$('#' + id);
if(element.length > 0){
flNode=element.hasClass('fl-row')||element.hasClass('fl-col')||element.hasClass('fl-module');
if(!element.hasClass('fl-no-scroll')&&(link.hasClass('fl-scroll-link')||flNode) ){
$(link).on('click', FLBuilderLayout._scrollToElementOnLinkClick);
}
if(element.hasClass('fl-accordion-item') ){
$(link).on('click', FLBuilderLayout._scrollToAccordionOnLinkClick);
}
if(element.hasClass('fl-tabs-panel') ){
$(link).on('click', FLBuilderLayout._scrollToTabOnLinkClick);
}}
}
catch(e){}}
}},
_scrollToElementOnLinkClick: function(e, callback){
var attribute=$(this).data('url') ? $(this).data('url'):$(this).attr('href');
var element=$('#' + attribute.split('#').pop());
FLBuilderLayout._scrollToElement(element, callback);
e.preventDefault();
},
_scrollToElement: function(element, callback){
var config=FLBuilderLayoutConfig.anchorLinkAnimations,
dest=0,
win=$(window),
doc=$(document);
if(element.length > 0){
if('fixed'===element.css('position')||'fixed'===element.parent().css('position')){
dest=element.position().top;
}
else if(element.offset().top > doc.height() - win.height()){
dest=doc.height() - win.height();
}else{
dest=element.offset().top - config.offset;
}
$('html, body').stop(true).animate({ scrollTop: dest }, config.duration, config.easing, function(){
if('undefined'!=typeof callback){
callback();
}
if(undefined!=element.attr('id')&&window.location.hash!=='#' + element.attr('id') ){
var firefox_version=window.navigator.userAgent.match(/Firefox\/(\d+)\./),
firefox_version=firefox_version ? parseInt(firefox_version[1], 10):null;
if(firefox_version!==null&&firefox_version < 135){
window.location.hash=element.attr('id');
}else{
if(history.pushState){
history.pushState(null, null, '#' + element.attr('id') );
}else{
window.location.hash=element.attr('id');
}}
}});
}},
_scrollToAccordionOnLinkClick: function(e){
var element=$('#' + $(this).attr('href').split('#').pop());
if(element.length > 0){
var callback=function(){
if(element){
element.find('.fl-accordion-button').trigger('click');
element=false;
}};
FLBuilderLayout._scrollToElementOnLinkClick.call(this, e, callback);
}},
_scrollToTabOnLinkClick: function(e){
var element=$('#' + $(this).attr('href').split('#').pop()),
tabs=null,
label=null,
responsiveLabel=null;
if(element.length > 0){
tabs=element.closest('.fl-tabs');
responsiveLabel=element.find('.fl-tabs-panel-label');
tabIndex=responsiveLabel.data('index');
label=tabs.find('.fl-tabs-labels .fl-tabs-label[data-index=' + tabIndex + ']');
if(responsiveLabel.is(':visible') ){
var callback=function(){
if(element){
responsiveLabel.trigger($.Event('click', { which: 1 }) );
}};
FLBuilderLayout._scrollToElementOnLinkClick.call(this, e, callback);
}else{
label[0].click();
FLBuilderLayout._scrollToElement(element);
}
e.preventDefault();
}},
_initForms: function(){
if(! FLBuilderLayout._hasPlaceholderSupport){
$('.fl-form-field input').each(FLBuilderLayout._initFormFieldPlaceholderFallback);
}
$('.fl-form-field input').on('focus', FLBuilderLayout._clearFormFieldError);
},
_hasPlaceholderSupport: function(){
var input=document.createElement('input');
return 'undefined'!=input.placeholder;
},
_initFormFieldPlaceholderFallback: function(){
var field=$(this),
val=field.val(),
placeholder=field.attr('placeholder');
if('undefined'!=placeholder&&''===val){
field.val(placeholder);
field.on('focus', FLBuilderLayout._hideFormFieldPlaceholderFallback);
field.on('blur', FLBuilderLayout._showFormFieldPlaceholderFallback);
}},
_hideFormFieldPlaceholderFallback: function(){
var field=$(this),
val=field.val(),
placeholder=field.attr('placeholder');
if(val==placeholder){
field.val('');
}},
_showFormFieldPlaceholderFallback: function(){
var field=$(this),
val=field.val(),
placeholder=field.attr('placeholder');
if(''===val){
field.val(placeholder);
}},
_clearFormFieldError: function(){
var field=$(this);
field.removeAttr('aria-invalid');
field.removeClass('fl-form-error');
const message=field.attr('aria-describedby');
message ? $('#' + message).hide():field.siblings('.fl-form-error-message').hide();
},
_initRowShapeLayerHeight: function (){
FLBuilderLayout._adjustRowShapeLayerHeight();
$(window).on('resize', FLBuilderLayout._adjustRowShapeLayerHeight);
},
_initNestedColsWidth: function(){
var nestedCols=$('.fl-col-has-cols');
if(nestedCols.length <=0){
return;
}
$(nestedCols).each(function(index, col){
if($(col).width() <=0){
$(col).css('width', FLBuilderLayoutConfig.emptyColWidth);
}});
},
_adjustRowShapeLayerHeight: function(){
var rowShapeLayers=$('.fl-builder-shape-layer');
$(rowShapeLayers).each(function (index){
var rowShapeLayer=$(this),
shape=$(rowShapeLayer).find('svg'),
height=shape.height(),
excludeShapes='.fl-builder-shape-circle, .fl-builder-shape-dot-cluster, .fl-builder-shape-topography, .fl-builder-shape-rect';
if(! rowShapeLayer.is(excludeShapes) ){
$(shape).css('height', Math.ceil(height) );
}});
},
_string_to_slug: function(str){
str=str.replace(/^\s+|\s+$/g, '');
if('undefined'==typeof window._fl_string_to_slug_regex){
regex=new RegExp('[^a-zA-Z0-9\'":() !.,-_|]', 'g');
}else{
regex=new RegExp('[^' + window._fl_string_to_slug_regex + '\'":\(\) !.,-_|\\\p{Letter}]', 'ug');
}
str=str.replace(regex, '')
.replace(/\s+/g, ' ');
return str;
},
_reorderMenu: function(){
if($('#wp-admin-bar-fl-builder-frontend-edit-link-default li').length > 1){
$('#wp-admin-bar-fl-builder-frontend-duplicate-link')
.appendTo('#wp-admin-bar-fl-builder-frontend-edit-link-default')
.css('padding-top', '5px')
.css('border-top', '2px solid #1D2125')
.css('margin-top', '5px')
}}
};
$(function(){
FLBuilderLayout.init();
});
})(jQuery);
(function($){
if(typeof FLBuilderLayoutModules!=='undefined'){
return;
}
FLBuilderLayoutModules={
init: function(){
if(0===$('.fl-builder-edit').length){
FLBuilderLayoutModules._initModuleAnimations();
}},
_initModuleAnimations: function(){
if(typeof jQuery.fn.waypoint!=='undefined'){
$('.fl-animation').each(function(){
var node=$(this),
nodeTop=node.offset().top,
winHeight=$(window).height(),
bodyHeight=$('body').height(),
waypoint=FLBuilderLayoutConfig.waypoint,
offset='80%';
if(typeof waypoint.offset!==undefined){
offset=FLBuilderLayoutConfig.waypoint.offset + '%';
}
if(bodyHeight - nodeTop < winHeight * 0.2){
offset='100%';
}
node.waypoint({
offset: offset,
handler: FLBuilderLayoutModules._doModuleAnimation
});
});
}},
_doModuleAnimation: function(){
var module='undefined'==typeof this.element ? $(this):$(this.element),
delay=parseFloat(module.data('animation-delay')),
duration=parseFloat(module.data('animation-duration'));
if(! isNaN(duration) ){
module.css('animation-duration', duration + 's');
}
if(!isNaN(delay)&&delay > 0){
setTimeout(function(){
module.addClass('fl-animated');
}, delay * 1000);
}else{
setTimeout(function(){
module.addClass('fl-animated');
}, 1);
}}
};
$(function(){
FLBuilderLayoutModules.init();
});
})(jQuery);
;
(function($){
FLBuilderPostGrid=function(settings){
this.settings=settings;
this.nodeClass='.fl-node-' + settings.id;
this.matchHeight=settings.matchHeight;
if('columns'==this.settings.layout){
this.wrapperClass=this.nodeClass + ' .fl-post-grid';
this.postClass=this.nodeClass + ' .fl-post-column';
}else{
this.wrapperClass=this.nodeClass + ' .fl-post-' + this.settings.layout;
this.postClass=this.wrapperClass + '-post';
}
if(this._hasPosts()){
this._initLayout();
this._initInfiniteScroll();
}};
FLBuilderPostGrid.prototype={
settings:{},
nodeClass:'',
wrapperClass:'',
postClass:'',
gallery:null,
currPage:1,
totalPages:1,
_hasPosts: function(){
return $(this.postClass).length > 0;
},
_initLayout: function(){
switch(this.settings.layout){
case 'columns':
this._columnsLayout();
break;
case 'grid':
this._gridLayout();
break;
case 'gallery':
this._galleryLayout();
break;
}
$(this.postClass).css('visibility', 'visible');
FLBuilderLayout._scrollToElement($(this.nodeClass + ' .fl-paged-scroll-to') );
},
_columnsLayout: function(){
$(this.wrapperClass).imagesLoaded($.proxy(function(){
this._gridLayoutMatchHeight();
}, this) );
$(window).on('resize', $.proxy(function(){
$(this.wrapperClass).imagesLoaded($.proxy(function(){
this._gridLayoutMatchHeight();
}, this) );
}, this) );
},
_gridLayout: function(){
var wrap=$(this.wrapperClass);
wrap.masonry({
columnWidth:this.nodeClass + ' .fl-post-grid-sizer',
gutter:parseInt(this.settings.postSpacing),
isFitWidth:true,
itemSelector:this.postClass,
transitionDuration:0,
isRTL:this.settings.isRTL
});
wrap.imagesLoaded($.proxy(function(){
this._gridLayoutMatchHeight();
wrap.masonry();
}, this) );
$(window).scroll($.debounce(25, function(){
wrap.masonry()
}));
},
_gridLayoutMatchHeight: function(){
var highestBox=0;
if(! this._isMatchHeight()){
$(this.nodeClass + ' .fl-post-grid-post').css('height', '');
return;
}
$(this.nodeClass + ' .fl-post-grid-post').css('height', '').each(function(){
if($(this).height() > highestBox){
highestBox=$(this).height();
}});
$(this.nodeClass + ' .fl-post-grid-post').height(highestBox);
},
_isMatchHeight: function(){
var width=$(window).width(),
breakpoints=FLBuilderLayoutConfig.breakpoints,
matchLarge=''!=this.matchHeight.large ? this.matchHeight.large:this.matchHeight.default,
matchMedium=''!=this.matchHeight.medium ? this.matchHeight.medium:this.matchHeight.default,
matchSmall=''!=this.matchHeight.responsive ? this.matchHeight.responsive:this.matchHeight.default;
return (width > breakpoints.medium&&1==this.matchHeight.default)
|| (width > breakpoints.medium&&width <=breakpoints.large&&1==matchLarge)
|| (width > breakpoints.small&&width <=breakpoints.medium&&1==matchMedium)
|| (width <=breakpoints.small&&1==matchSmall);
},
_galleryLayout: function(){
this.gallery=new FLBuilderGalleryGrid({
'wrapSelector':this.wrapperClass,
'itemSelector':'.fl-post-gallery-post',
'isRTL':this.settings.isRTL
});
},
_initInfiniteScroll: function(){
var isScroll='scroll'==this.settings.pagination||'load_more'==this.settings.pagination,
pages=$(this.nodeClass + ' .fl-builder-pagination').find('li .page-numbers:not(.next)');
if(pages.length > 1){
total=pages.last().text().replace(/\D/g, '')
this.totalPages=parseInt(total);
}
if(isScroll&&this.totalPages > 1&&'undefined'===typeof FLBuilder){
this._infiniteScroll();
if('load_more'==this.settings.pagination){
this._infiniteScrollLoadMore();
}}
},
_infiniteScroll: function(){
var path=$(this.nodeClass + ' .fl-builder-pagination a.next').attr('href'),
pagePattern=/(.*?(\/|&|\?)paged-[0-9]{1,}(\/|=))([0-9]{1,})+(.*)/,
wpPattern=/^(.*?\/?page\/?)(?:\d+)(.*?$)/,
pageMatched=null,
scrollData={
navSelector:this.nodeClass + ' .fl-builder-pagination',
nextSelector:this.nodeClass + ' .fl-builder-pagination a.next',
itemSelector:this.postClass,
prefill:true,
bufferPx:200,
loading:{
msgText:this.settings.loadingText,
finishedMsg:'',
img:FLBuilderLayoutConfig.paths.pluginUrl + 'img/ajax-loader-grey.gif',
speed:1
}};
if(pagePattern.test(path) ){
scrollData.path=function(currPage){
pageMatched=path.match(pagePattern);
path=pageMatched[1] + currPage + pageMatched[5];
return path;
}}
else if(wpPattern.test(path) ){
scrollData.path=path.match(wpPattern).slice(1);
}
$(this.postClass).first().parent().infinitescroll(scrollData, $.proxy(this._infiniteScrollComplete, this));
setTimeout(function(){
$(window).trigger('resize');
}, 100);
},
_infiniteScrollComplete: function(elements){
var wrap=$(this.wrapperClass);
elements=$(elements);
if(this.settings.layout=='columns'){
wrap.imagesLoaded($.proxy(function(){
$('#infscr-loading').remove();
this._gridLayoutMatchHeight();
elements.css('visibility', 'visible');
}, this) );
}
else if(this.settings.layout=='grid'){
wrap.imagesLoaded($.proxy(function(){
this._gridLayoutMatchHeight();
wrap.masonry('appended', elements);
wrap.masonry();
elements.css('visibility', 'visible');
}, this) );
}
else if(this.settings.layout=='gallery'){
this.gallery.resize();
elements.css('visibility', 'visible');
}
if('load_more'==this.settings.pagination){
$(this.wrapperClass + ' .fl-post-grid-sizer.masonry-brick').appendTo(this.wrapperClass);
$('#infscr-loading').appendTo(this.wrapperClass);
}
this.currPage++;
this._removeLoadMoreButton();
node=$(wrap).closest('.fl-module-post-grid').data('node')
$('.fl-node-' + node).trigger('gridScrollComplete', this);
},
_infiniteScrollLoadMore: function(){
var wrap=$(this.postClass).first().parent();
$(window).unbind('.infscr');
$(this.nodeClass + ' .fl-builder-pagination-load-more .fl-button').on('click', function(){
if($('#infscr-loading').length){
$('#infscr-loading').remove();
}
wrap.infinitescroll('retrieve');
return false;
});
},
_removeLoadMoreButton: function(){
if('load_more'==this.settings.pagination&&this.totalPages==this.currPage){
$(this.nodeClass + ' .fl-builder-pagination-load-more').remove();
}}
};})(jQuery);
(function($){
$(function(){
new FLBuilderPostGrid({
id: '5ec3039d3898b',
layout: 'feed',
pagination: 'numbers',
postSpacing: '60',
postWidth: '300',
matchHeight: {
default:'0',
large:'',
medium:'',
responsive:''
},
isRTL: false,
loadingText: 'Loading...'
});
});
})(jQuery);
(function($){
$('.fl-node-5f5fc332051b6').each(function(){
var $this=$(this);
$this.find('.fl-button-lightbox').magnificPopup({
type: 'inline',
items: {
src: $this.find('.fl-button-lightbox-content')[0]
},
callbacks: {
open: function(){
var content=$(this.content),
divWrap=$(content[0]).find('> div');
divWrap.css('display', 'block');
if(divWrap.find('form select').length > 0){
divWrap.find('form select').trigger('change');
}
FLBuilderLayout.reloadSlider(content);
FLBuilderLayout.resizeSlideshow();
},
},
closeBtnInside: true,
fixedContentPos: true,
tLoading: '<i class="fas fa-spinner fa-spin fa-3x fa-fw"></i>',
});
});
})(jQuery);
(function($){
})(jQuery);
function on_keydown_remove_from_cart(e){" "===e.key&&(e.preventDefault(),e.currentTarget.click())}function focus_populate_live_region(){var e=["woocommerce-message","woocommerce-error","wc-block-components-notice-banner"].map(function(e){return"."+e+'[role="alert"]'}).join(", "),o=document.querySelectorAll(e);if(0!==o.length){var t=o[0];t.setAttribute("tabindex","-1");var n=setTimeout(function(){t.focus(),clearTimeout(n)},500)}}function refresh_sorted_by_live_region(){var e=document.querySelector(".woocommerce-result-count"),o=document.querySelector('[data-wp-interactive="woocommerce/product-filters"]');if(e&&window.location.search&&!o){var t=e.innerHTML;e.setAttribute("role","alert"),e.setAttribute("aria-hidden","true");var n=setTimeout(function(){e.setAttribute("aria-hidden","false"),e.innerHTML="",e.innerHTML=t,clearTimeout(n)},2e3)}}function on_document_ready(){focus_populate_live_region(),refresh_sorted_by_live_region()}jQuery(function(e){e(".woocommerce-ordering").on("change","select.orderby",function(){e(this).closest("form").trigger("submit")}),e("input.qty:not(.product-quantity input.qty)").each(function(){var o=parseFloat(e(this).attr("min"));o>=0&&parseFloat(e(this).val())<o&&e(this).val(o)});var o="store_notice"+(e(".woocommerce-store-notice").data("noticeId")||"");if("hidden"===Cookies.get(o))e(".woocommerce-store-notice").hide();else{function t(o){["Enter"," "].includes(o.key)&&(o.preventDefault(),e(".woocommerce-store-notice__dismiss-link").click())}e(".woocommerce-store-notice").show(),e(".woocommerce-store-notice__dismiss-link").on("click",function n(r){Cookies.set(o,"hidden",{path:"/"}),e(".woocommerce-store-notice").hide(),r.preventDefault(),e(".woocommerce-store-notice__dismiss-link").off("click",n).off("keydown",t)}).on("keydown",t)}e(".woocommerce-input-wrapper span.description").length&&e(document.body).on("click",function(){e(".woocommerce-input-wrapper span.description:visible").prop("aria-hidden",!0).slideUp(250)}),e(".woocommerce-input-wrapper").on("click",function(e){e.stopPropagation()}),e(".woocommerce-input-wrapper :input").on("keydown",function(o){var t=e(this).parent().find("span.description");if(27===o.which&&t.length&&t.is(":visible"))return t.prop("aria-hidden",!0).slideUp(250),o.preventDefault(),!1}).on("click focus",function(){var o=e(this).parent(),t=o.find("span.description");o.addClass("currentTarget"),e(".woocommerce-input-wrapper:not(.currentTarget) span.description:visible").prop("aria-hidden",!0).slideUp(250),t.length&&t.is(":hidden")&&t.prop("aria-hidden",!1).slideDown(250),o.removeClass("currentTarget")}),e.scroll_to_notices=function(o){o.length&&e("html, body").animate({scrollTop:o.offset().top-100},1e3)},e('.woocommerce form .woocommerce-Input[type="password"]').wrap('<span class="password-input"></span>'),e(".woocommerce form input").filter(":password").parent("span").addClass("password-input"),e(".password-input").each(function(){const o=e(this).find("input").attr("id");e(this).append('<button type="button" class="show-password-input" aria-label="'+woocommerce_params.i18n_password_show+'" aria-describedBy="'+o+'"></button>')}),e(".show-password-input").on("click",function(o){o.preventDefault(),e(this).hasClass("display-password")?(e(this).removeClass("display-password"),e(this).attr("aria-label",woocommerce_params.i18n_password_show)):(e(this).addClass("display-password"),e(this).attr("aria-label",woocommerce_params.i18n_password_hide)),e(this).hasClass("display-password")?e(this).siblings(['input[type="password"]']).prop("type","text"):e(this).siblings('input[type="text"]').prop("type","password"),e(this).siblings("input").focus()}),e("a.coming-soon-footer-banner-dismiss").on("click",function(o){var t=e(o.target);e.ajax({type:"post",url:t.data("rest-url"),data:{woocommerce_meta:{coming_soon_banner_dismissed:"yes"}},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",t.data("rest-nonce"))},complete:function(){e("#coming-soon-footer-banner").hide()}})}),"undefined"==typeof wc_add_to_cart_params&&e(document.body).on("keydown",".remove_from_cart_button",on_keydown_remove_from_cart),e(document.body).on("item_removed_from_classic_cart updated_wc_div",focus_populate_live_region)}),document.addEventListener("DOMContentLoaded",on_document_ready);
(function($){
var quickView={
css: '',
js: '',
html: {},
height: {},
node: ''
};
var scriptsEnqueued={
css: false,
js: false,
};
$('body').on('click', '.woopack-product-quick-view', function(e){
e.preventDefault();
e.stopPropagation();
var nodeId=$(this).parents('.fl-module').attr('data-node'),
products=$('.fl-node-' + nodeId).find('.woopack-products');
var product=$(this).parents('.product'),
productId=product.data('product-id')||$(this).data('product'),
template=$(this).data('template')||false,
processAjax=true;
quickView.node=$('.fl-node-' + nodeId);
if('undefined'!==typeof quickView.html[productId]){
processAjax=false;
}
if(products.hasClass('owl-carousel')){
products.trigger('stop.owl.autoplay');
}
new WooPackModal({
source: 'ajax',
ajaxUrl: woopack_config.ajaxurl,
ajaxData: {
action: 'woopack_product_quick_view',
node_id: nodeId,
product_id: productId,
template: template,
templateJS: ''===quickView.js,
templateCSS: ''===quickView.css,
},
processAjax: processAjax,
breakpoint: 767,
animationSpeed: 0,
cssClass: 'woopack-modal-' + nodeId,
responseHandler: function(response, object){
var contentWrap=object.contentWrap;
if('undefined'!==typeof quickView.height[productId]){
}
if(''===quickView.css&&'undefined'!==typeof response.css){
quickView.css=response.css;
}
if(''===quickView.js&&'undefined'!==typeof response.js){
quickView.js=response.js;
}
if(! scriptsEnqueued.css){
$('head').prepend(quickView.css);
scriptsEnqueued.css=true;
}
if('undefined'!==typeof quickView.html[productId]){
contentWrap.html(quickView.html[productId]);
}else{
contentWrap.html(response.html);
quickView.html[productId]=response.html;
}
if(template){
contentWrap.imagesLoaded(function(){
if(! scriptsEnqueued.js){
$('body').append(quickView.js);
scriptsEnqueued.js=true;
}else{
contentWrap.find('.woocommerce-product-gallery').each(function(){
$(this).trigger('wc-product-gallery-before-init', [ this, wc_single_product_params ]);
$(this).wc_product_gallery(wc_single_product_params);
$(this).trigger('wc-product-gallery-after-init', [ this, wc_single_product_params ]);
});
contentWrap.find('.wc-tabs-wrapper, .woocommerce-tabs, #rating').trigger('init');
}
$(quickView.html[productId]).find('.woopack-product').html(contentWrap.find('.woopack-product').html());
object._resetHeight();
setTimeout(function(){
object.wrapper.addClass('woopack-ajax-loaded');
}, 100);
});
}else{
setTimeout(function(){
object.wrapper.addClass('woopack-ajax-loaded');
}, 100);
}},
onAjaxLoad: function(object){
var wrapper=object.wrapper;
if('undefined'===typeof quickView.height[productId]){
quickView.height[productId]=wrapper.find('.woopack-modal-inner').outerHeight();
}
wrapper.find('.woocommerce-product-gallery .woocommerce-product-gallery__image a').on('click', function(e){
e.preventDefault();
e.stopPropagation();
var imageEl=$(this).parents('.woocommerce-product-gallery__image');
var firstEl=imageEl.parents('.woocommerce-product-gallery').find('.woocommerce-product-gallery__image:first');
imageEl.insertBefore(firstEl);
});
if(typeof $.fn.wc_variation_form!=='undefined'){
if(wrapper.find('form.variations_form').length > 0){
wrapper.find('form.variations_form').wc_variation_form();
}}
wrapper.find('.product-type-external form.cart').attr('target', '_blank');
if(wrapper.find('.woo-variation-gallery-wrapper').length > 0&&'undefined'!==typeof jQuery.fn.WooVariationGallery){
wrapper.find('.woo-variation-gallery-wrapper').WooVariationGallery();
}
if(wrapper.find('.form.variations_form').length > 0&&'undefined'!==typeof jQuery.fn.WooVariationSwatches){
if(wrapper.find('.woo-variation-items-wrapper').length > 0){
wrapper.find('.form.variations_form').WooVariationSwatches();
}}
wrapper.trigger('quick-view-displayed');
$('body').trigger('woopack.quickview.ajaxload', [wrapper]);
},
onClose: function(wrapper){
wrapper.removeClass('woopack-modal-' + nodeId);
wrapper.removeClass('woopack-ajax-loaded');
wrapper.removeClass('woopack-images-loaded');
$('body').remove('woopack-pswp');
setTimeout(function(){
if(products.hasClass('owl-carousel')){
products.trigger('refresh.owl.carousel');
}}, 500);
},
});
});
$(window).on('resize', function(){
if(window.innerWidth > 767){
$('.woopack-modal .woopack-modal-inner').css({
height: 'auto'
});
}});
$(document).on('added_to_cart', function(e, fragments, cart_hash, $button){
if($button&&$button.length > 0&&$button.parents('.woopack-modal').length > 0){
if(''!==quickView.node&&quickView.node.length > 0&&quickView.node.hasClass('woopack-qv-close-on-add') ){
setTimeout(function(){
$button.parents('.woopack-modal').fadeOut(function(){
$(this).find('.woopack-modal-close').trigger('click')
});
}, 500);
}}
});
$('body').on('change keyup blur', '.woopack-products .quantity input.qty', function(){
var qty=parseFloat($(this).val());
qty=(0===qty||''===qty) ? 1:qty;
$(this).val(qty);
$(this).parents('.woopack-product-action').find('a.button').attr('data-quantity', qty);
});
if('undefined'===typeof wc_add_to_cart_params){
return false;
}
var getAjaxExtraData=function(){
var data={};
if('undefined'!==typeof wc_cart_fragments_params){
var ajaxUrl=wc_cart_fragments_params.wc_ajax_url;
var fragments=ajaxUrl.split('&');
fragments=fragments.slice(1, fragments.length);
fragments.forEach(function(item){
var queryArg=item.split('=');
var value='undefined'===typeof queryArg[1] ? true:queryArg[1];
data[ queryArg[0] ]=value;
});
}
return data;
};
$('body').on('submit', '.woopack-modal form.cart, .woopack-single-product form.cart', function(e){
if($(this).hasClass('variations_form')&&typeof $.fn.wc_variation_form==='undefined'){
return;
}
if($(this).parents('.product-type-external').length > 0){
return;
}
if($(this).parents('.woopack-no-ajax').length > 0){
return;
}
e.preventDefault();
e.stopPropagation();
var form=$(this);
var grouped=$(this).hasClass('grouped_form');
var $thisbutton=$(this).find('button[type="submit"]');
if(grouped){
$(this).find('.woocommerce-grouped-product-list tr').each(function(){
var qty=$(this).find('input.qty').val();
var productId=$(this).attr('id').split('-')[1];
if(qty > 0){
var data={
'quantity': qty,
'product_id': productId,
};
$thisbutton.removeClass('added');
$thisbutton.addClass('loading');
$(document.body).trigger('adding_to_cart', [ $thisbutton, data ]);
addToCart($thisbutton, data);
}});
}else{
if($(this).find('input[name="variation_id"]').length > 0){
handleVariationForm($(this));
}else{
var data={
'action': 'woopack_add_to_cart',
'quantity': $(this).find('.qty').val(),
'product_id': $(this).find('.single_add_to_cart_button').val(),
};
var formData=form.serializeArray();
formData.forEach(function(field, index){
if('undefined'!==typeof field&&'undefined'===typeof data[field.name]&&'add-to-cart'!==field.name){
data[field.name]=field.value;
}});
if(form.find('.wc-bookings-booking-form').length > 0){
data.product_id=form.find('.wc-booking-product-id').val();
}
if(form.find('.wc-appointment-product-id').length > 0){
data.product_id=form.find('.wc-appointment-product-id').val();
}
$thisbutton.removeClass('added');
$thisbutton.addClass('loading');
$(document.body).trigger('adding_to_cart', [ $thisbutton, data ]);
addToCart($thisbutton, data);
}}
});
$('body').on('submit', '.woopack-products .product .variations_form, .woopack-product-add-to-cart .variations_form', function(e){
if(typeof wc_add_to_cart_params==='undefined'){
return;
}
if($(this).parents('.woopack-no-ajax').length > 0){
return;
}
e.preventDefault();
e.stopPropagation();
handleVariationForm($(this));
});
$('body').on('submit', '.woopack-products .product .grouped_form', function(e){
e.preventDefault();
e.stopPropagation();
var $thisbutton=$(this).find('button[type="submit"]');
$(this).find('.woocommerce-grouped-product-list tr').each(function(){
var qty=$(this).find('input.qty').val();
var productId=$(this).attr('id').split('-')[1];
if(qty > 0){
var data={
'quantity': qty,
'product_id': productId,
};
$thisbutton.removeClass('added');
$thisbutton.addClass('loading');
$(document.body).trigger('adding_to_cart', [ $thisbutton, data ]);
addToCart($thisbutton, data);
}});
});
var handleVariationForm=function($form){
var data={
'action': 'woopack_add_to_cart',
'quantity': $form.find('.qty').val(),
'product_id': $form.find('input[name="product_id"]').val(),
'variation_id': $form.find('input[name="variation_id"]').val(),
};
var variations=$form.data('product_variations')[0];
var attributes=[];
var attrKeys=[];
if(variations&&'undefined'!==typeof variations.attributes){
Object.keys(variations.attributes).map(function(attr){
if($form.find('[name="' + attr + '"]').length > 0){
var attr_string=attr + '|' + $form.find('[name="' + attr + '"]').val();
attributes.push(attr_string);
attrKeys.push(attr);
}});
data['variation']=attributes;
}
var formData=$form.serializeArray();
formData.forEach(function(d, i){
if('undefined'!==typeof d&&'undefined'===typeof data[d.name]&&'add-to-cart'!==d.name&&-1===$.inArray(d.name, attrKeys) ){
data[d.name]=d.value;
}});
var $thisbutton=$form.find('button[type="submit"]');
$thisbutton.removeClass('added');
$thisbutton.addClass('loading');
$(document.body).trigger('adding_to_cart', [ $thisbutton, data ]);
addToCart($thisbutton, data);
};
var addToCart=function($thisbutton, data){
var url=wc_add_to_cart_params.wc_ajax_url.toString().replace('%%endpoint%%', 'add_to_cart');
if(typeof data.action!=='undefined'){
url=woopack_config.ajaxurl;
data=$.extend(data, getAjaxExtraData());
}
$.post(url, data, function(response){
if(! response){
return;
}
if(response.error&&response.product_url){
window.location=response.product_url;
return;
}
if(wc_add_to_cart_params.cart_redirect_after_add==='yes'){
window.location=wc_add_to_cart_params.cart_url;
return;
}
$(document.body).trigger('added_to_cart', [ response.fragments, response.cart_hash, $thisbutton ]);
});
};
$('body').on('change', '.woopack-products .product .variations_form select, .woopack-single-product .variations_form select', function(){
var $this=$(this), attr=$this.attr('name'), val=$this.val(),
form=$this.parents('.variations_form');
if($this.parents('.woopack-product-grid.product').length > 0){
var img=$this.parents('.woopack-product-grid.product').find('.woopack-product-image img');
}else{
var img=$this.parents('.woopack-single-product').find('.single-product-image img');
}
var variations=form.data('product_variations');
if(! variations){
return;
}
variations.forEach(function (item){
if('undefined'!==typeof item.attributes[ attr ]&&val===item.attributes[ attr ]){
if('undefined'!==typeof item.image){
img.attr('src', item.image.thumb_src);
img.attr('srcset', item.image.srcset);
}}
});
});
$(document).on('wc_cart_button_updated', function(e, $button){
if($button&&$button.length > 0){
$button.parent().find('a.added_to_cart').addClass('button alt');
}});
var w=$('.woopack-product-image').find('.woopack-product-featured-image').attr('width');
$('.woopack-product-image').find('.woocommerce-placeholder.wp-post-image').width(w);
var setCustomQty=function(){
if($('.woopack-qty-custom').length > 0&&$('.woopack-qty-custom .qty-minus').length===0){
var minus='<span class="qty-minus"></span>';
var plus='<span class="qty-plus"></span>';
$('.woopack-qty-custom input.qty').each(function(){
if(! $(this).parent().hasClass('woopack-qty-input')){
$(this).parent().addClass('woopack-qty-input');
}
$(minus).insertBefore($(this));
$(plus).insertAfter($(this));
var qty=$(this);
$(this).parent().find('.qty-minus').on('click', function(){
qty[0].stepDown();
qty.trigger('change');
});
$(this).parent().find('.qty-plus').on('click', function(){
qty[0].stepUp();
qty.trigger('change');
});
});
}};
setCustomQty();
$(document).on('woopack.grid.rendered', function(){
setCustomQty();
});
$('.woopack-checkout.style-enhanced button[name="apply_coupon"]').on('click', function(e){
e.preventDefault();
if(! wc_checkout_params){
return;
}
var $form=$(this).parents('.woopack-checkout-coupon');
startFormProcessing($form);
var data={
security: wc_checkout_params.apply_coupon_nonce,
coupon_code: $form.find('input[name="coupon_code"]').val()
};
$.ajax({
type: 'POST',
url: wc_checkout_params.wc_ajax_url.toString().replace('%%endpoint%%', 'apply_coupon'),
context: this,
data,
success: function(code){
$('.woocommerce-error, .woocommerce-message').remove();
stopFormProcessing($form);
if(code){
$form.append(code);
$form.find('input[name="coupon_code"]').val('');
$('body').trigger('applied_coupon_in_checkout', [data.coupon_code]);
$('body').trigger('update_checkout', {
update_shipping_method: false
});
}},
dataType: 'html'
});
});
var startFormProcessing=function($form){
if($form.is('.processing')){
return;
}
$form.addClass('processing').block({
message: null,
overlayCSS: {
background: '#fff',
opacity: 0.6
}});
}
var stopFormProcessing=function($form){
$form.removeClass('processing').unblock();
};})(jQuery);
!function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(h=t,h.fn.imagesLoaded=function(e,t){var i=new o(this,e,t);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o});
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
;
(function($){
FLBuilderMenu=function(settings){
this.nodeId=settings.id;
this.nodeClass='.fl-node-' + settings.id;
this.wrapperClass=this.nodeClass + ' .fl-menu';
this.type=settings.type;
this.mobileToggle=settings.mobile;
this.mobileBelowRow=settings.mobileBelowRow;
this.mobileFlyout=settings.mobileFlyout;
this.breakPoints=settings.breakPoints;
this.mobileBreakpoint=settings.mobileBreakpoint;
this.currentBrowserWidth=$(window).width();
this.postId=settings.postId;
this.mobileStacked=settings.mobileStacked;
this.submenuIcon=settings.submenuIcon;
this.flyoutWidth=settings.flyoutWidth;
this._initMenu();
$(window).on('resize', $.proxy(function(){
var width=$(window).width();
if(width!=this.currentBrowserWidth){
this.currentBrowserWidth=width;
this._initMenu(true);
this._clickOrHover(true);
}
this._resizeFlyoutMenuPanel();
}, this) );
$(window).on('scroll', $.proxy(function(){
this._resizeFlyoutMenuPanel();
}, this) );
$(this.wrapperClass).on('keydown', '.fl-menu-mobile-toggle, .menu-item:first a:first', $.proxy(function(event){
if(event.key!=='Tab'||! this._isMenuToggle()||! this._isMobileBelowRowEnabled()){
return;
}
if(event.shiftKey&&$(event.currentTarget).is('a') ){
event.preventDefault();
$(this.wrapperClass).find('.fl-menu-mobile-toggle').trigger('focus');
}
else if(! event.shiftKey&&$(event.currentTarget).hasClass('fl-menu-mobile-toggle')&&$(event.currentTarget).hasClass('fl-active') ){
event.preventDefault();
$(this.wrapperClass).find('.menu-item:first a:first').trigger('focus');
}}, this) );
$(this.wrapperClass).on('focusout', $.proxy(function(event){
if($(this.wrapperClass + ' nav').has($(event.relatedTarget) ).length===0){
if(this.type==='accordion'){
this._toggleSubmenu($(event.target).parents('.fl-has-submenu:last'), false);
}else{
this._clickOrHover(true);
}
const mobileToggle=$(this.wrapperClass).find('.fl-menu-mobile-toggle');
if(this._isMenuToggle()&&mobileToggle.hasClass('fl-active')&&! $(event.relatedTarget).is(mobileToggle)&&'expanded'!==this.mobileToggle){
mobileToggle.trigger('click');
}}
}, this) );
};
FLBuilderMenu.prototype={
nodeClass:'',
wrapperClass: '',
type:'',
breakPoints:{},
$submenus:null,
_isMobile: function(){
return this.currentBrowserWidth <=this.breakPoints.small ? true:false;
},
_isMouseAvailable: function(){
return window.matchMedia("(pointer: fine) and (hover: hover)").matches;
},
_isMedium: function(){
return this.currentBrowserWidth <=this.breakPoints.medium ? true:false;
},
_isLarge: function(){
return this.currentBrowserWidth <=this.breakPoints.large ? true:false;
},
_isMenuToggle: function(){
if(( 'always'==this.mobileBreakpoint
||(this._isMobile()&&'mobile'==this.mobileBreakpoint)
||(this._isMedium()&&'medium-mobile'==this.mobileBreakpoint)
||(this._isLarge()&&'large-mobile'==this.mobileBreakpoint)
)&&($(this.wrapperClass).find('.fl-menu-mobile-toggle').is(':visible')||'expanded'==this.mobileToggle) ){
return true;
}
return false;
},
_initMenu: function(resized=false){
this._setupSubmenu();
if(! resized){
this._menuOnFocus();
this._menuOnClick();
this._menuOnEscape();
}
if($(this.nodeClass).length&&this.type=='horizontal'){
this._initMegaMenus();
}
if(this._isMenuToggle()||this.type=='accordion'){
$(this.wrapperClass).off('mouseenter mouseleave');
this._clickOrHover();
}else{
this._submenuOnRight();
this._submenuRowZindexFix();
}
if(this.mobileToggle!='expanded'){
this._toggleForMobile();
}
if($(this.wrapperClass).find('.fl-menu-search-item').length){
this._toggleMenuSearch();
}
if($(this.wrapperClass).find('.fl-menu-cart-item').length){
this._wooUpdateParams();
}},
_setupSubmenu: function(){
if(! this._isMouseAvailable()||this._isMenuToggle()||this.type==='accordion'){
$(this.wrapperClass).addClass('no-hover');
}else{
$(this.wrapperClass).removeClass('no-hover');
}},
_menuOnFocus: function(){
$(this.wrapperClass).on('focus', 'a, .fl-menu-toggle', $.proxy(function(event){
const focusedMenuItem=$(event.currentTarget).closest('.menu-item');
const blurredMenuItem=$(event.relatedTarget).closest('.menu-item');
if(focusedMenuItem.closest('ul').is(blurredMenuItem.closest('ul') )){
if(! focusedMenuItem.is(blurredMenuItem) ){
this._toggleSubmenu(blurredMenuItem, false);
}}
else if(focusedMenuItem.has(blurredMenuItem).length===blurredMenuItem.has(focusedMenuItem).length){
blurredMenuItem.parents('.fl-has-submenu').each(( _, parent)=> {
if(focusedMenuItem.closest('ul').is($(parent).closest('ul') )){
this._toggleSubmenu($(parent), false);
return false;
}});
}
else if(focusedMenuItem.has(blurredMenuItem).length){
if(this.type!=='accordion'&&this.submenuIcon==='none'){
this._toggleSubmenu(blurredMenuItem, false);
}}
}, this) );
},
_menuOnEscape: function(){
$(this.wrapperClass).on('keydown', $.proxy(function(event){
if(event.key!=='Escape') return;
const menuItem=$(event.target).closest('.menu-item');
const mobileToggle=$(this.wrapperClass).find('.fl-menu-mobile-toggle');
if(menuItem.length||$(event.target).hasClass('fl-menu-mobile-close') ){
if(menuItem.hasClass('fl-has-submenu')&&menuItem.find('.sub-menu:first').is(':visible') ){
this._toggleSubmenu(menuItem, false);
}else{
const parentMenuItem=menuItem.parents('.fl-has-submenu').not('.mega-menu.hide-heading, .mega-menu-disabled.hide-heading').first();
if(parentMenuItem.length===0&&this._isMenuToggle()&&mobileToggle.hasClass('fl-active') ){
mobileToggle.trigger('blur').trigger('focus');
}
else if(parentMenuItem.length!==0){
this._toggleSubmenu(parentMenuItem, false);
parentMenuItem.find('a:first').trigger('focus');
}}
}
else if($(event.target).hasClass('fl-menu-mobile-toggle')&&mobileToggle.hasClass('fl-active') ){
mobileToggle.trigger('blur').trigger('focus');
}}, this) );
},
_menuOnClick: function(){
$(this.wrapperClass).on('keydown', 'span.fl-menu-toggle', $.proxy(function(event){
if(event.key==='Enter'||event.key===' '){
event.preventDefault();
$(event.currentTarget).trigger('click');
}}, this) );
$(this.wrapperClass).on('click', 'a, .fl-menu-toggle', $.proxy(function(event){
if(this._isMouseAvailable()&&! this._isMenuToggle()&&event.detail&&this.type!=='accordion') return;
if($(event.currentTarget).is('a')&&(this.submenuIcon!=='none'||this.type==='accordion') ) return;
const menuItem=$(event.currentTarget).closest('.menu-item, .fl-menu-logo');
const menuLink=menuItem.find('a:first').attr('href');
const submenuHidden=menuItem.find('.sub-menu:first').is(':hidden');
if(typeof menuLink==='undefined'||menuLink==='#'||submenuHidden){
event.preventDefault();
}
if($(event.currentTarget).hasClass('fl-menu-toggle')||submenuHidden){
this._toggleSubmenu(menuItem, submenuHidden);
}}, this) );
},
_toggleSubmenu: function(menuItem, opened){
const togglingClass=this._isMenuToggle()||this.type==='accordion' ? 'fl-active':'focus';
const toggleElement=this.submenuIcon==='none' ? 'a':'.fl-menu-toggle';
const hiddenMenu='.mega-menu.hide-heading, .mega-menu-disabled.hide-heading';
if(opened&&menuItem.hasClass('fl-has-submenu')&&! menuItem.is(hiddenMenu) ){
menuItem.addClass(togglingClass);
menuItem.find(toggleElement).first().attr('aria-expanded', true);
if(this._isMenuToggle()||this.type==='accordion'){
menuItem.find('.sub-menu:first:hidden').slideDown();
}}else{
menuItem.parent().find('.menu-item').removeClass(togglingClass);
menuItem.parent().find('.fl-has-submenu').not(hiddenMenu).find(toggleElement).attr('aria-expanded', false);
if(this._isMenuToggle()||this.type==='accordion'){
menuItem.find('.sub-menu:visible').slideUp();
}}
},
_clickOrHover: function(clear=false){
const selector=this._isMobileBelowRowEnabled() ? this.nodeClass + '-clone':this.nodeClass;
this.$submenus=this.$submenus||$(selector).find('.sub-menu');
const className=this._isMenuToggle()||this.type==='accordion' ? 'fl-active':'focus';
const toggleElement=this.submenuIcon==='none' ? 'a':'.fl-menu-toggle';
const hiddenMenu='.mega-menu.hide-heading, .mega-menu-disabled.hide-heading';
$(selector).find('.fl-has-submenu').not(hiddenMenu).each(function(){
if(clear||! $(this).hasClass(className) ){
if(clear) $(this).removeClass(className);
$(this).find(toggleElement + ':first').attr('aria-expanded', false);
if(className==='fl-active'){
$(this).find('.sub-menu').fadeOut();
}else if(className==='focus'){
$(this).find('.sub-menu').css({
'display':'',
'opacity':''
});
}}
});
},
_submenuOnRight: function(){
$(this.wrapperClass)
.on('mouseenter focus', '.fl-has-submenu', $.proxy(function(e){
if($(e.currentTarget).find('.sub-menu').length===0){
return;
}
var $link=$(e.currentTarget),
$parent=$link.parent(),
$subMenu=$link.find('.sub-menu'),
subMenuWidth=$subMenu.width(),
subMenuPos=0,
bodyWidth=$('body').width();
if($link.closest('.fl-menu-submenu-right').length!==0){
$link.addClass('fl-menu-submenu-right');
}else if($('body').hasClass('rtl') ){
subMenuPos=$parent.is('.sub-menu') ?
$parent.offset().left - subMenuWidth:
$link.offset().left - $link.width() - subMenuWidth;
if(subMenuPos <=0){
$link.addClass('fl-menu-submenu-right');
}}else{
subMenuPos=$parent.is('.sub-menu') ?
$parent.offset().left + $parent.width() + subMenuWidth :
$link.offset().left + $link.width() + subMenuWidth;
if(subMenuPos > bodyWidth){
$link.addClass('fl-menu-submenu-right');
}}
}, this) )
.on('mouseleave', '.fl-has-submenu', $.proxy(function(e){
$(e.currentTarget).removeClass('fl-menu-submenu-right');
}, this) );
},
_submenuRowZindexFix: function(){
$(this.wrapperClass)
.on('mouseenter', 'ul.menu > .fl-has-submenu', $.proxy(function(e){
if($(e.currentTarget).find('.sub-menu').length===0){
return;
}
$(this.nodeClass)
.closest('.fl-row')
.find('.fl-row-content')
.css('z-index', '10');
}, this) )
.on('mouseleave', 'ul.menu > .fl-has-submenu', $.proxy(function(){
$(this.nodeClass)
.closest('.fl-row')
.find('.fl-row-content')
.css('z-index', '');
}, this) );
},
_toggleForMobile: function(){
var $wrapper=null,
$menu=null,
self=this;
$(this.wrapperClass).find('.fl-menu-mobile-toggle').attr('aria-controls', $(this.wrapperClass).find('ul.menu').attr('id'));
if(this._isMenuToggle()){
if(this._isMobileBelowRowEnabled()){
this._placeMobileMenuBelowRow();
$wrapper=$(this.wrapperClass);
$menu=$(this.nodeClass + '-clone');
$menu.find('ul.menu').show();
}else{
$wrapper=$(this.wrapperClass);
$menu=$wrapper.find('.menu');
}
if(!$wrapper.find('.fl-menu-mobile-toggle').hasClass('fl-active')&&! self.mobileFlyout){
$menu.css({ display: 'none' });
}
if(self.mobileFlyout){
this._initFlyoutMenu();
}
$wrapper.on('click', '.fl-menu-mobile-toggle', function(e){
e.stopImmediatePropagation();
$(this).toggleClass('fl-active');
if(self.mobileFlyout){
self._toggleFlyoutMenu();
const flyoutWrapper=$('.fl-menu-mobile-flyout');
if($(this).hasClass('fl-active') ){
flyoutWrapper.attr('aria-hidden', false);
flyoutWrapper.find('a[href], button, input, select, textarea, span.fl-menu-toggle, [tabindex="-1"]').attr('tabindex', 0);
}else{
flyoutWrapper.attr('aria-hidden', true);
flyoutWrapper.find('a[href], button, input, select, textarea, span.fl-menu-toggle, [tabindex]:not([tabindex="-1"])').attr('tabindex', -1);
}}else{
var targetMenu=null;
if(self.mobileBelowRow){
var $closestCol=$(this).parents('.fl-col, .fl-module-box'),
$closestColGroup=$closestCol.length ? $closestCol.parent('.fl-col-group'):null;
targetMenu=$closestCol.length ? $closestCol.last().next('.fl-menu-mobile-clone'):null;
if($closestColGroup.length){
if($closestColGroup.hasClass('fl-col-group-responsive-reversed') ){
$closestColGroup.find('.fl-menu-mobile-clone').css('order', -1);
}else if($closestColGroup){
$closestColGroup.find('.fl-menu-mobile-clone').css('order', 2);
}}
}else{
targetMenu=$(this).closest('.fl-menu').find('ul.menu');
}
if(targetMenu.length){
$menu=$(targetMenu);
}
$menu.slideToggle();
}
e.stopPropagation();
});
$menu.off().on('click', '.menu-item > a[href*="#"]:not([href="#"])', function(){
var $href=$(this).attr('href'),
$targetID=$href.split('#')[1],
element=$('#' + $targetID);
if($('body').find(element).length > 0){
$(this).toggleClass('fl-active');
FLBuilderLayout._scrollToElement(element);
if(! self._isMenuToggle()){
$menu.slideToggle();
}}
});
}else{
if(this._isMobileBelowRowEnabled()){
this._removeMenuFromBelowRow();
}
$wrapper=$(this.wrapperClass),
$menu=$wrapper.find('ul.menu');
$wrapper.find('.fl-menu-mobile-toggle').removeClass('fl-active');
$menu.css({ display: '' });
if(! this._isMobileBelowRowEnabled()){
$menu.off('click', '.menu-item > a[href*="#"]:not([href="#"])');
}
if(this.mobileFlyout&&$wrapper.find('.fl-menu-mobile-flyout').length > 0){
$('body').css('margin', '');
$('.fl-builder-ui-pinned-content-transform').css('transform', '');
$menu.unwrap();
$wrapper.find('.fl-menu-mobile-close').remove();
$wrapper.find('.fl-menu-mobile-opacity').remove();
}}
},
_initMegaMenus: function(){
var module=$(this.nodeClass),
rowContent=module.closest('.fl-row-content'),
rowWidth=rowContent.width(),
megas=module.find('.mega-menu'),
disabled=module.find('.mega-menu-disabled'),
isToggle=this._isMenuToggle();
if(isToggle){
megas.removeClass('mega-menu').addClass('mega-menu-disabled');
module.find('li.mega-menu-disabled > ul.sub-menu').css('width', '');
rowContent.css('position', '');
}else{
disabled.removeClass('mega-menu-disabled').addClass('mega-menu');
module.find('li.mega-menu > ul.sub-menu').css('width', rowWidth + 'px');
rowContent.css('position', 'relative');
}},
_isMobileBelowRowEnabled: function(){
return this.mobileBelowRow&&($(this.nodeClass).parents('.fl-col, .fl-module-box').length);
},
_placeMobileMenuBelowRow: function(){
if($(this.nodeClass + '-clone').length){
return;
}
var module=$(this.nodeClass),
clone=null,
col=module.parents('.fl-col, .fl-module-box').last();
if(module.length < 1){
return;
}
clone=(module.length > 1) ? $(module[0]).clone():module.clone();
module.find('ul.menu').remove();
clone.addClass(( this.nodeClass + '-clone').replace('.', '') );
clone.addClass('fl-menu-mobile-clone');
clone.find('.fl-menu-mobile-toggle').remove();
col.after(clone);
if(module.hasClass('fl-animation') ){
clone.removeClass('fl-animation');
}
this._menuOnFocus();
this._menuOnClick();
this._menuOnEscape();
},
_removeMenuFromBelowRow: function(){
if(! $(this.nodeClass + '-clone').length){
return;
}
var module=$(this.nodeClass),
clone=$(this.nodeClass + '-clone'),
menu=clone.find('ul.menu'),
nav=module.find('nav');
if(nav.length){
nav.append(menu);
}else{
module.find('.fl-menu-mobile-toggle').after(menu);
}
clone.remove();
menu.find('a').each(FLBuilderLayout._initAnchorLink);
},
_initFlyoutMenu: function(){
var wrapper=$(this.wrapperClass),
menu=wrapper.find('ul.menu'),
button=wrapper.find('.fl-menu-mobile-toggle');
if(0===wrapper.find('.fl-menu-mobile-flyout').length){
menu.wrap('<div class="fl-menu-mobile-flyout" aria-hidden="true"></div>');
}
if(0===wrapper.find('.fl-menu-mobile-close').length){
var close=window.fl_responsive_close||'Close'
wrapper.find('.fl-menu-mobile-flyout').prepend('<button class="fl-menu-mobile-close fl-content-ui-button" aria-label="' + close + '"><i class="fas fa-times"></i></button>');
}
if(wrapper.hasClass('fl-menu-responsive-flyout-push-opacity')&&0===wrapper.find('.fl-menu-mobile-opacity').length){
wrapper.append('<div class="fl-menu-mobile-opacity"></div>');
}
wrapper.off('click', '.fl-menu-mobile-opacity, .fl-menu-mobile-close').on('click', '.fl-menu-mobile-opacity, .fl-menu-mobile-close', function(e){
button.trigger('focus').trigger('click');
e.stopPropagation();
});
if('undefined'!==typeof FLBuilder){
FLBuilder.addHook('restartEditingSession', function(){
$('.fl-builder-ui-pinned-content-transform').css('transform', '');
if(button.hasClass('fl-active') ){
button.trigger('click');
}});
}
$('.fl-menu-mobile-flyout').find('a[href], button, input, select, textarea, span.fl-menu-toggle, [tabindex]:not([tabindex="-1"])').attr('tabindex', -1);
},
_toggleFlyoutMenu: function(){
var wrapper=$(this.wrapperClass),
button=wrapper.find('.fl-menu-mobile-toggle'),
position=wrapper.hasClass('fl-flyout-right') ? 'right':'left',
pushMenu=wrapper.hasClass('fl-menu-responsive-flyout-push')||wrapper.hasClass('fl-menu-responsive-flyout-push-opacity'),
opacity=wrapper.find('.fl-menu-mobile-opacity'),
marginPos={},
fixedPos={},
fixedHeader=$('header, header > div');
this._resizeFlyoutMenuPanel();
if($('.fl-builder-ui-pinned-content-transform').length > 0&&! $('body').hasClass('fl-builder-edit') ){
$('.fl-builder-ui-pinned-content-transform').css('transform', 'none');
}
if(pushMenu){
marginPos[ 'margin-' + position ]=button.hasClass('fl-active') ? this.flyoutWidth + 'px':'0px';
$('body').animate(marginPos, 200);
if(fixedHeader.length > 0){
fixedPos[ position]=button.hasClass('fl-active') ? this.flyoutWidth + 'px':'0px';
fixedHeader.each(function(){
if('fixed'==$(this).css('position') ){
$(this).css({ 'transition':'none' });
$(this).animate(fixedPos, 200);
}});
}}
if(opacity.length > 0&&button.hasClass('fl-active') ){
opacity.show();
}else{
opacity.hide();
}},
_resizeFlyoutMenuPanel: function(){
const wrapper=$(this.wrapperClass);
const wrapFlyout=wrapper.find('.fl-menu-mobile-flyout');
if(wrapFlyout.length > 0){
wrapFlyout.css(this._getFlyoutMenuPanelPosition());
}},
_getFlyoutMenuPanelPosition: function(){
var wrapper=$(this.wrapperClass),
button=wrapper.find('.fl-menu-mobile-toggle'),
side=wrapper.hasClass('fl-flyout-right') ? 'right':'left',
winHeight=$(window).outerHeight(),
winTop=$(window).scrollTop(),
adminBarHeight=$('#wpadminbar').length ? $('#wpadminbar').height():0,
flyoutPosition={};
flyoutPosition[ side ]='-' +(parseInt(this.flyoutWidth) + 15) + 'px';
if(! button.hasClass('fl-active') ){
return flyoutPosition;
}
flyoutPosition[ side ]='0px';
flyoutPosition[ 'height' ]=winHeight + 'px';
flyoutPosition[ 'top' ]='0px';
if(adminBarHeight > 0){
const diff=adminBarHeight - winTop;
flyoutPosition[ 'top' ]=diff <=0 ? '0px':(diff) + 'px';
}
return flyoutPosition;
},
_toggleMenuSearch: function(){
var wrapper=$(this.wrapperClass).find('.fl-menu-search-item'),
button=wrapper.find('.fl-button:is(a, button)'),
form=wrapper.find('.fl-search-form-input-wrap'),
self=this;
button.attr('tabindex', 0);
button.attr('aria-label', 'Search');
button.on('click', function(e){
e.preventDefault();
if(form.is(':visible')){
form.stop().fadeOut(200);
}else{
form.stop().fadeIn(200);
$('body').on('click.fl-menu-search', $.proxy(self._hideMenuSearch, self));
form.find('.fl-search-text').focus();
}});
},
_hideMenuSearch: function(e){
var form=$(this.wrapperClass).find('.fl-search-form-input-wrap');
if(e!==undefined){
if($(e.target).closest('.fl-menu-search-item').length > 0){
return;
}}
form.stop().fadeOut(200);
$('body').off('click.fl-menu-search');
},
_wooUpdateParams: function(){
if('undefined'!==typeof wc_cart_fragments_params){
wc_cart_fragments_params.wc_ajax_url +='&fl-menu-node='+ this.nodeId +'&post-id='+ this.postId;
}
if('undefined'!==typeof wc_add_to_cart_params){
wc_add_to_cart_params.wc_ajax_url +='&fl-menu-node='+ this.nodeId +'&post-id='+ this.postId;
}},
};})(jQuery);
(function($){
$(function(){
new FLBuilderMenu({
id: '5b7b9842daee3',
type: 'horizontal',
mobile: 'hamburger',
mobileBelowRow: true,
mobileFlyout: false,
breakPoints: {
large: 1200,
medium: 992,
small: 768			},
mobileBreakpoint: 'mobile',
postId:'71',
mobileStacked: true,
submenuIcon: 'arrows',
flyoutWidth: '250',
});
});
})(jQuery);
(function($){
FLThemeBuilderHeaderLayout={
win:null,
body:null,
header:null,
overlay:false,
hasAdminBar:false,
stickyOn: '',
breakpointWidth: 0,
init: function(){
var editing=$('html.fl-builder-edit').length,
header=$('.fl-builder-content[data-type=header]'),
menuModule=header.find('.fl-module-menu'),
breakpoint=null;
if(! editing&&header.length){
header.imagesLoaded($.proxy(function(){
this.win=$(window);
this.body=$('body');
this.header=header.eq(0);
this.overlay     = !! Number(header.attr('data-overlay') );
this.hasAdminBar = !! $('body.admin-bar').length;
this.stickyOn=this.header.data('sticky-on');
breakpoint=this.header.data('sticky-breakpoint');
if(''==this.stickyOn){
if(typeof FLBuilderLayoutConfig.breakpoints[ breakpoint ]!==undefined){
this.breakpointWidth=FLBuilderLayoutConfig.breakpoints[ breakpoint ];
}else{
this.breakpointWidth=FLBuilderLayoutConfig.breakpoints.medium;
}}
if(Number(header.attr('data-sticky') )){
this.header.data('original-top', this.header.offset().top);
this.win.on('resize', $.throttle(500, $.proxy(this._initSticky, this) ));
this._initSticky();
}}, this) );
}},
_initSticky: function(e){
var header=$('.fl-builder-content[data-type=header]'),
windowSize=this.win.width(),
makeSticky=false;
makeSticky=this._makeWindowSticky(windowSize);
if(makeSticky||(this.breakpointWidth > 0&&windowSize >=this.breakpointWidth) ){
this.win.on('scroll.fl-theme-builder-header-sticky', $.proxy(this._doSticky, this) );
if(e&&'resize'===e.type){
if(this.header.hasClass('fl-theme-builder-header-sticky') ){
this._doSticky(e);
}
this._adjustStickyHeaderWidth();
}
if(Number(header.attr('data-shrink') )){
this.header.data('original-height', this.header.outerHeight());
this.win.on('resize', $.throttle(500, $.proxy(this._initShrink, this) ));
this._initShrink();
}
this._initFlyoutMenuFix(e);
}else{
this.win.off('scroll.fl-theme-builder-header-sticky');
this.win.off('resize.fl-theme-builder-header-sticky');
this.header.removeClass('fl-theme-builder-header-sticky');
this.header.removeAttr('style');
this.header.parent().css('padding-top', '0');
}},
_makeWindowSticky: function(windowSize){
var makeSticky=false;
switch (this.stickyOn){
case 'xl':
makeSticky=windowSize > FLBuilderLayoutConfig.breakpoints['large'];
break;
case '':
case 'desktop':
makeSticky=windowSize >=FLBuilderLayoutConfig.breakpoints['medium'];
break;
case 'desktop-medium':
makeSticky=windowSize > FLBuilderLayoutConfig.breakpoints['small'];
break;
case 'large':
makeSticky=windowSize > FLBuilderLayoutConfig.breakpoints['medium']&&windowSize <=FLBuilderLayoutConfig.breakpoints['large'];
break;
case 'large-medium':
makeSticky=windowSize > FLBuilderLayoutConfig.breakpoints['small']&&windowSize <=FLBuilderLayoutConfig.breakpoints['large'];
break;
case 'medium':
makeSticky=(windowSize <=FLBuilderLayoutConfig.breakpoints['medium']&&windowSize > FLBuilderLayoutConfig.breakpoints['small']);
break;
case 'medium-mobile':
makeSticky=(windowSize <=FLBuilderLayoutConfig.breakpoints['medium']);
break;
case 'mobile':
makeSticky=(windowSize <=FLBuilderLayoutConfig.breakpoints['small']);
break;
case 'all':
makeSticky=true;
break;
}
return makeSticky;
},
_doSticky: function(e){
var winTop=Math.floor(this.win.scrollTop()),
headerTop=Math.floor(this.header.data('original-top') ),
hasStickyClass=this.header.hasClass('fl-theme-builder-header-sticky'),
hasScrolledClass=this.header.hasClass('fl-theme-builder-header-scrolled'),
beforeHeader=this.header.prevAll('.fl-builder-content'),
bodyTopPadding=parseInt(jQuery('body').css('padding-top')),
winBarHeight=$('#wpadminbar').length ? $('#wpadminbar').outerHeight():0,
headerHeight=0;
if(isNaN(bodyTopPadding) ){
bodyTopPadding=0;
}
if(this.hasAdminBar&&this.win.width() > 600){
winTop +=Math.floor(winBarHeight);
}
if(winTop > headerTop){
if(! hasStickyClass){
if(e&&('scroll'===e.type||'smartscroll'===e.type) ){
this.header.addClass('fl-theme-builder-header-sticky');
if(this.overlay&&beforeHeader.length){
this.header.css('top', winBarHeight);
}}
if(! this.overlay){
this._adjustHeaderHeight();
}}
}
else if(hasStickyClass){
this.header.removeClass('fl-theme-builder-header-sticky');
this.header.removeAttr('style');
this.header.parent().css('padding-top', '0');
}
this._adjustStickyHeaderWidth();
if(winTop > headerTop){
if(! hasScrolledClass){
this.header.addClass('fl-theme-builder-header-scrolled');
}}else if(hasScrolledClass){
this.header.removeClass('fl-theme-builder-header-scrolled');
}
this._flyoutMenuFix(e);
},
_initFlyoutMenuFix: function(e){
var header=this.header,
menuModule=header.closest('.fl-menu'),
flyoutMenu=menuModule.find('.fl-menu-mobile-flyout'),
isPushMenu=menuModule.hasClass('fl-menu-responsive-flyout-push')||menuModule.hasClass('fl-menu-responsive-flyout-push-opacity'),
isOverlay=menuModule.hasClass('fl-menu-responsive-flyout-overlay'),
flyoutPos=menuModule.hasClass('fl-flyout-right') ? 'right':'left',
flyoutParent=header.parent().is('header') ? header.parent().parent():header.parent();
isFullWidth=this.win.width()===header.width(),
flyoutLayout='',
activePos=250,
headerPos=0;
if(! flyoutMenu.length){
return;
}
if(this.win.width() > header.parent().width()){
headerPos=(this.win.width() - header.width()) / 2;
}
if(isOverlay){
activePos=headerPos;
}
else if(isPushMenu){
activePos=activePos + headerPos;
}
flyoutMenu.data('activePos', activePos);
if(isPushMenu){
flyoutLayout='push-' + flyoutPos;
}
else if(isOverlay){
flyoutLayout='overlay-' + flyoutPos;
}
if(isPushMenu&&! $('html').hasClass('fl-theme-builder-has-flyout-menu') ){
$('html').addClass('fl-theme-builder-has-flyout-menu');
}
if(! flyoutParent.hasClass('fl-theme-builder-flyout-menu-' + flyoutLayout) ){
flyoutParent.addClass('fl-theme-builder-flyout-menu-' + flyoutLayout);
}
if(! header.hasClass('fl-theme-builder-flyout-menu-overlay')&&isOverlay){
header.addClass('fl-theme-builder-flyout-menu-overlay');
}
if(! header.hasClass('fl-theme-builder-header-full-width')&&isFullWidth){
header.addClass('fl-theme-builder-header-full-width');
}
else if(! isFullWidth){
header.removeClass('fl-theme-builder-header-full-width');
}
menuModule.on('click', '.fl-menu-mobile-toggle', $.proxy(function(event){
if(menuModule.find('.fl-menu-mobile-toggle.fl-active').length){
$('html').addClass('fl-theme-builder-flyout-menu-active');
event.stopImmediatePropagation();
}else{
$('html').removeClass('fl-theme-builder-flyout-menu-active');
}
this._flyoutMenuFix(event);
}, this) );
},
_flyoutMenuFix: function(e){
var header=this.header,
menuModule=$(e.target).closest('.fl-menu'),
flyoutMenu=menuModule.find('.fl-menu-mobile-flyout'),
flyoutPos=menuModule.hasClass('fl-flyout-right') ? 'right':'left',
menuOpacity=menuModule.find('.fl-menu-mobile-opacity'),
isScroll='undefined'!==typeof e&&'scroll'===e.handleObj.type,
activePos='undefined'!==typeof flyoutMenu.data('activePos') ? flyoutMenu.data('activePos'):0,
headerPos=(this.win.width() - header.width()) / 2,
inactivePos=headerPos > 0 ? activePos + 4:254;
if(! flyoutMenu.length){
return;
}
if(this.overlay){
return;
}
if($('.fl-theme-builder-flyout-menu-active').length){
if(isScroll&&! flyoutMenu.hasClass('fl-menu-disable-transition') ){
flyoutMenu.addClass('fl-menu-disable-transition');
}
if(header.hasClass('fl-theme-builder-header-sticky') ){
if(! isScroll){
setTimeout($.proxy(function(){
flyoutMenu.css(flyoutPos, '-' + activePos + 'px');
}, this), 1);
}else{
flyoutMenu.css(flyoutPos, '-' + activePos + 'px');
}}else{
flyoutMenu.css(flyoutPos, '0px');
}}else{
if(flyoutMenu.hasClass('fl-menu-disable-transition') ){
flyoutMenu.removeClass('fl-menu-disable-transition');
}
if(header.hasClass('fl-theme-builder-flyout-menu-overlay')&&headerPos > 0&&headerPos < 250){
if(header.hasClass('fl-theme-builder-header-sticky') ){
inactivePos=headerPos + 254;
}else{
inactivePos=254;
}}
if(e&&e.type==='resize'){
inactivePos=headerPos + 254;
}
flyoutMenu.css(flyoutPos, '-' + inactivePos + 'px');
}
if(e&&menuModule.is('.fl-menu-responsive-flyout-overlay')&&$.infinitescroll){
e.stopImmediatePropagation();
}
if(menuOpacity.length){
if(header.hasClass('fl-theme-builder-header-sticky') ){
if('0px'===menuOpacity.css('left') ){
menuOpacity.css('left', '-' + headerPos + 'px');
}}else{
menuOpacity.css('left', '');
}}
},
_adjustStickyHeaderWidth: function (){
if($('body').hasClass('fl-fixed-width') ){
var parentWidth=this.header.parent().width();
if(this.win.width() >=992){
this.header.css({
'margin': '0 auto',
'max-width': parentWidth,
});
}else{
this.header.css({
'margin': '',
'max-width': '',
});
}}
},
_adjustHeaderHeight: function (){
var beforeHeader=this.header.prevAll('.fl-builder-content'),
beforeHeaderHeight=0,
beforeHeaderFix=0,
headerHeight=Math.floor(this.header.outerHeight()),
bodyTopPadding=parseInt($('body').css('padding-top') ),
wpAdminBarHeight=0,
totalHeaderHeight=0;
if(isNaN(bodyTopPadding) ){
bodyTopPadding=0;
}
if(beforeHeader.length){
$.each(beforeHeader, function(){
beforeHeaderHeight +=Math.floor($(this).outerHeight());
});
beforeHeaderFix=2;
}
if(this.hasAdminBar&&this.win.width() <=600){
wpAdminBarHeight=Math.floor($('#wpadminbar').outerHeight());
}
totalHeaderHeight=Math.floor(beforeHeaderHeight + headerHeight);
if(headerHeight > 0){
var headerParent=this.header.parent(),
headerParentTopPadding=0;
if($(headerParent).is('body')){
headerParentTopPadding=Math.floor(headerHeight - wpAdminBarHeight);
}else{
headerParentTopPadding=Math.floor(headerHeight - bodyTopPadding - wpAdminBarHeight);
}
$(headerParent).css('padding-top',(headerParentTopPadding - beforeHeaderFix) + 'px');
this.header.css({
'-webkit-transform': 'translate(0px, -' + totalHeaderHeight + 'px)',
'-ms-transform': 'translate(0px, -' + totalHeaderHeight + 'px)',
'transform': 'translate(0px, -' + totalHeaderHeight + 'px)'
});
}},
_initShrink: function(e){
if(this.win.width() >=this.breakpointWidth){
this.win.on('scroll.fl-theme-builder-header-shrink', $.proxy(this._doShrink, this) );
this._setImageMaxHeight();
if(this.win.scrollTop() > 0){
this._doShrink();
}}else{
this.header.parent().css('padding-top', '0');
this.win.off('scroll.fl-theme-builder-header-shrink');
this._removeShrink();
this._removeImageMaxHeight();
}},
_doShrink: function(e){
var winTop=this.win.scrollTop(),
headerTop=this.header.data('original-top'),
headerHeight=this.header.data('original-height'),
shrinkImageHeight=this.header.data('shrink-image-height'),
windowSize=this.win.width(),
makeSticky=this._makeWindowSticky(windowSize),
hasClass=this.header.hasClass('fl-theme-builder-header-shrink');
if(this.hasAdminBar){
winTop +=32;
}
if(makeSticky&&(winTop > headerTop + headerHeight) ){
if(! hasClass){
this.header.addClass('fl-theme-builder-header-shrink');
this.header.find('img').each(function(i){
var image=$(this),
maxMegaMenu=image.closest('.max-mega-menu').length,
imageInLightbox=image.closest('.fl-button-lightbox-content').length,
imageInNavMenu=image.closest('li.menu-item').length;
if(!(imageInLightbox||imageInNavMenu||maxMegaMenu) ){
image.css('max-height', shrinkImageHeight);
}});
this.header.find('.fl-row-content-wrap').each(function(){
var row=$(this);
if(parseInt(row.css('padding-bottom') ) > 5){
row.addClass('fl-theme-builder-header-shrink-row-bottom');
}
if(parseInt(row.css('padding-top') ) > 5){
row.addClass('fl-theme-builder-header-shrink-row-top');
}});
this.header.find('.fl-module').each(function(){
var module=$(this).find('.fl-module-content').length ? $(this).find('.fl-module-content'):$(this);
if(parseInt(module.css('margin-bottom') ) > 5){
module.addClass('fl-theme-builder-header-shrink-module-bottom');
}
if(parseInt(module.css('margin-top') ) > 5){
module.addClass('fl-theme-builder-header-shrink-module-top');
}});
}}else if(hasClass){
this.header.find('img').css('max-height', '');
this._removeShrink();
}
if('undefined'===typeof(e)&&$('body').hasClass('fl-fixed-width') ){
if(! this.overlay){
this._adjustHeaderHeight();
}}
},
_removeShrink: function(){
var rows=this.header.find('.fl-row-content-wrap'),
modules=this.header.find('.fl-module, .fl-module-content');
rows.removeClass('fl-theme-builder-header-shrink-row-bottom');
rows.removeClass('fl-theme-builder-header-shrink-row-top');
modules.removeClass('fl-theme-builder-header-shrink-module-bottom');
modules.removeClass('fl-theme-builder-header-shrink-module-top');
this.header.removeClass('fl-theme-builder-header-shrink');
},
_setImageMaxHeight: function(){
var head=$('head'),
stylesId='fl-header-styles-' + this.header.data('post-id'),
styles='',
images=this.header.find('.fl-module img');
if($('#' + stylesId).length){
return;
}
images.each(function(i){
var image=$(this),
height=image.height(),
node=image.closest('.fl-module').data('node'),
className='fl-node-' + node + '-img-' + i,
maxMegaMenu=image.closest('.max-mega-menu').length,
imageInLightbox=image.closest('.fl-button-lightbox-content').length,
imageInNavMenu=image.closest('li.menu-item').length;
if(!(imageInLightbox||imageInNavMenu||maxMegaMenu) ){
image.addClass(className);
styles +='.' + className + ' { max-height: ' +(height ? height:image[0].height)  + 'px }';
}});
if(''!==styles){
head.append('<style id="' + stylesId + '">' + styles + '</style>');
}},
_removeImageMaxHeight: function(){
$('#fl-header-styles-' + this.header.data('post-id') ).remove();
},
};
$(function(){ FLThemeBuilderHeaderLayout.init(); });
})(jQuery);
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";var n=e("./init"),a={init:function(e){this.get=n(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}};t.exports=a},{"./init":6}],2:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/utils"),i={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(e){return i.aliases.main.type+"="+e.type+i.delimiter+i.aliases.main.source+"="+e.source+i.delimiter+i.aliases.main.medium+"="+e.medium+i.delimiter+i.aliases.main.campaign+"="+e.campaign+i.delimiter+i.aliases.main.content+"="+e.content+i.delimiter+i.aliases.main.term+"="+e.term+i.delimiter+i.aliases.main.id+"="+e.id+i.delimiter+i.aliases.main.platform+"="+e.platform+i.delimiter+i.aliases.main.format+"="+e.format+i.delimiter+i.aliases.main.tactic+"="+e.tactic},extra:function(e){return i.aliases.extra.fire_date+"="+a.setDate(new Date,e)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||n.none)},user:function(e,t){return i.aliases.udata.visits+"="+e+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return i.aliases.session.pages_seen+"="+e+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(e){return i.aliases.promo+"="+a.setLeadingZeroToInt(a.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,r){"use strict";var n=e("../data").delimiter;t.exports={useBase64:!1,setBase64Flag:function(e){this.useBase64=e},encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(e){try{return decodeURIComponent(e).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(e)}catch(r){return""}}},set:function(e,t,r,n,a){var i,s;if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}else i="";s=n&&!a?";domain=."+n:"";var c=this.encodeData(t);this.useBase64&&(c=btoa(c).replace(/=+$/,"")),document.cookie=this.encodeData(e)+"="+c+i+s+"; path=/"},get:function(e){for(var t=this.encodeData(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t)){var i=a.substring(t.length,a.length);if(/^[A-Za-z0-9+/]+$/.test(i))try{i=atob(i.padEnd(4*Math.ceil(i.length/4),"="))}catch(s){}return this.decodeData(i)}}return null},destroy:function(e,t,r){this.set(e,"",-1,t,r)},parse:function(e){var t=[],r={};if("string"==typeof e)t.push(e);else for(var a in e)e.hasOwnProperty(a)&&t.push(e[a]);for(var i=0;i<t.length;i++){var s;r[this.unsbjs(t[i])]={},s=this.get(t[i])?this.get(t[i]).split(n):[];for(var o=0;o<s.length;o++){var c=s[o].split("="),u=c.splice(0,1);u.push(c.join("=")),r[this.unsbjs(t[i])][u[0]]=this.decodeData(u[1])}}return r},unsbjs:function(e){return e.replace("sbjs_","")}}},{"../data":2}],4:[function(e,t,r){"use strict";t.exports={parse:function(e){for(var t=this.parseOptions,r=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},a=14;a--;)n[t.key[a]]=r[a]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,r,a){r&&(n[t.q.name][r]=a)}),n},parseOptions:{strictMode:!1,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(e){for(var t={},r=(e||window.location.search.substring(1)).split("&"),n=0;n<r.length;n++){var a=r[n].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=a[1];else if("string"==typeof t[a[0]]){var i=[t[a[0]],a[1]];t[a[0]]=i}else t[a[0]].push(a[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,r){"use strict";t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var r=e.getTimezoneOffset()/60,n=e.getHours(),a=t||0===t?t:-r;return e.setHours(n+r+a),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,r){"use strict";var n=e("./data"),a=e("./terms"),i=e("./helpers/cookies"),s=e("./helpers/uri"),o=e("./helpers/utils"),c=e("./params"),u=e("./migrations");t.exports=function(e){var t,r,p,f,m,d,l,g,h,y,_,v,b,x=c.fetch(e),k=s.getParam(),w=x.domain.host,q=x.domain.isolate,I=x.lifetime;function j(e){switch(e){case a.traffic.utm:t=a.traffic.utm,r="undefined"!=typeof k.utm_source?k.utm_source:"undefined"!=typeof k.gclid?"google":"undefined"!=typeof k.yclid?"yandex":a.none,p="undefined"!=typeof k.utm_medium?k.utm_medium:"undefined"!=typeof k.gclid?"cpc":"undefined"!=typeof k.yclid?"cpc":a.none,f="undefined"!=typeof k.utm_campaign?k.utm_campaign:"undefined"!=typeof k[x.campaign_param]?k[x.campaign_param]:"undefined"!=typeof k.gclid?"google_cpc":"undefined"!=typeof k.yclid?"yandex_cpc":a.none,m="undefined"!=typeof k.utm_content?k.utm_content:"undefined"!=typeof k[x.content_param]?k[x.content_param]:a.none,l=k.utm_id||a.none,g=k.utm_source_platform||a.none,h=k.utm_creative_format||a.none,y=k.utm_marketing_tactic||a.none,d="undefined"!=typeof k.utm_term?k.utm_term:"undefined"!=typeof k[x.term_param]?k[x.term_param]:function(){var e=document.referrer;if(k.utm_term)return k.utm_term;if(!(e&&s.parse(e).host&&s.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return s.getParam(s.parse(document.referrer).query).text}catch(t){return!1}}()||a.none;break;case a.traffic.organic:t=a.traffic.organic,r=r||s.getHost(document.referrer),p=a.referer.organic,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.referral:t=a.traffic.referral,r=r||s.getHost(document.referrer),p=p||a.referer.referral,f=a.none,m=s.parse(document.referrer).path,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.typein:t=a.traffic.typein,r=x.typein_attributes.source,p=x.typein_attributes.medium,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;default:t=a.oops,r=a.oops,p=a.oops,f=a.oops,m=a.oops,d=a.oops,l=a.oops,g=a.oops,h=a.oops,y=a.oops}var i={type:t,source:r,medium:p,campaign:f,content:m,term:d,id:l,platform:g,format:h,tactic:y};return n.pack.main(i)}function R(e){var t=document.referrer;switch(e){case a.traffic.organic:return!!t&&H(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp("yandex")+"\\..{2,9}$"),n=new RegExp(".*"+o.escapeRegexp("text")+"=.*"),a=new RegExp("^(?:www\\.)?"+o.escapeRegexp("google")+"\\..{2,9}$");if(s.parse(e).query&&s.parse(e).host.match(t)&&s.parse(e).query.match(n))return r="yandex",!0;if(s.parse(e).host.match(a))return r="google",!0;if(!s.parse(e).query)return!1;for(var i=0;i<x.organics.length;i++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.organics[i].host)+"$","i"))&&s.parse(e).query.match(new RegExp(".*"+o.escapeRegexp(x.organics[i].param)+"=.*","i")))return r=x.organics[i].display||x.organics[i].host,!0;if(i+1===x.organics.length)return!1}}(t);case a.traffic.referral:return!!t&&H(t)&&function(e){if(!(x.referrals.length>0))return r=s.getHost(e),!0;for(var t=0;t<x.referrals.length;t++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.referrals[t].host)+"$","i")))return r=x.referrals[t].display||x.referrals[t].host,p=x.referrals[t].medium||a.referer.referral,!0;if(t+1===x.referrals.length)return r=s.getHost(e),!0}}(t);default:return!1}}function H(e){if(x.domain){if(q)return s.getHost(e)!==s.getHost(w);var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp(w)+"$","i");return!s.getHost(e).match(t)}return s.getHost(e)!==s.getHost(document.location.href)}function D(){i.set(n.containers.current_extra,n.pack.extra(x.timezone_offset),I,w,q),i.get(n.containers.first_extra)||i.set(n.containers.first_extra,n.pack.extra(x.timezone_offset),I,w,q)}return i.setBase64Flag(x.base64),u.go(I,w,q),i.set(n.containers.current,function(){var e;if("undefined"!=typeof k.utm_source||"undefined"!=typeof k.utm_medium||"undefined"!=typeof k.utm_campaign||"undefined"!=typeof k.utm_content||"undefined"!=typeof k.utm_term||"undefined"!=typeof k.utm_id||"undefined"!=typeof k.utm_source_platform||"undefined"!=typeof k.utm_creative_format||"undefined"!=typeof k.utm_marketing_tactic||"undefined"!=typeof k.gclid||"undefined"!=typeof k.yclid||"undefined"!=typeof k[x.campaign_param]||"undefined"!=typeof k[x.term_param]||"undefined"!=typeof k[x.content_param])D(),e=j(a.traffic.utm);else if(R(a.traffic.organic))D(),e=j(a.traffic.organic);else if(!i.get(n.containers.session)&&R(a.traffic.referral))D(),e=j(a.traffic.referral);else{if(i.get(n.containers.first)||i.get(n.containers.current))return i.get(n.containers.current);D(),e=j(a.traffic.typein)}return e}(),I,w,q),i.get(n.containers.first)||i.set(n.containers.first,i.get(n.containers.current),I,w,q),i.get(n.containers.udata)?(_=parseInt(i.parse(n.containers.udata)[i.unsbjs(n.containers.udata)][n.aliases.udata.visits])||1,_=i.get(n.containers.session)?_:_+1,v=n.pack.user(_,x.user_ip)):(_=1,v=n.pack.user(_,x.user_ip)),i.set(n.containers.udata,v,I,w,q),i.get(n.containers.session)?(b=parseInt(i.parse(n.containers.session)[i.unsbjs(n.containers.session)][n.aliases.session.pages_seen])||1,b+=1):b=1,i.set(n.containers.session,n.pack.session(b),x.session_length,w,q),x.promocode&&!i.get(n.containers.promocode)&&i.set(n.containers.promocode,n.pack.promo(x.promocode),I,w,q),i.parse(n.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,r){"use strict";var n=e("./data"),a=e("./helpers/cookies");t.exports={go:function(e,t,r){var i,s=this.migrations,o={l:e,d:t,i:r};if(a.get(n.containers.first)||a.get(n.service.migrations)){if(!a.get(n.service.migrations))for(i=0;i<s.length;i++)s[i].go(s[i].id,o)}else{var c=[];for(i=0;i<s.length;i++)c.push(s[i].id);var u="";for(i=0;i<c.length;i++)u+=c[i]+"=1",i<c.length-1&&(u+=n.delimiter);a.set(n.service.migrations,u,o.l,o.d,o.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(e,t){var r=e+"=1",i=e+"=0",s=function(e,t,r){return t||r?e:n.delimiter};try{var o=[];for(var c in n.containers)n.containers.hasOwnProperty(c)&&o.push(n.containers[c]);for(var u=0;u<o.length;u++)if(a.get(o[u])){var p=a.get(o[u]).replace(/(\|)?\|(\|)?/g,s);a.destroy(o[u],t.d,t.i),a.destroy(o[u],t.d,!t.i),a.set(o[u],p,t.l,t.d,t.i)}a.get(n.containers.session)&&a.set(n.containers.session,n.pack.session(0),t.l,t.d,t.i),a.set(n.service.migrations,r,t.l,t.d,t.i)}catch(f){a.set(n.service.migrations,i,t.l,t.d,t.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},r={};if(r.lifetime=this.validate.checkFloat(t.lifetime)||6,r.lifetime=parseInt(30*r.lifetime*24*60),r.session_length=this.validate.checkInt(t.session_length)||30,r.timezone_offset=this.validate.checkInt(t.timezone_offset),r.base64=t.base64||!1,r.campaign_param=t.campaign_param||!1,r.term_param=t.term_param||!1,r.content_param=t.content_param||!1,r.user_ip=t.user_ip||n.none,t.promocode?(r.promocode={},r.promocode.min=parseInt(t.promocode.min)||1e5,r.promocode.max=parseInt(t.promocode.max)||999999):r.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(r.typein_attributes={},r.typein_attributes.source=t.typein_attributes.source,r.typein_attributes.medium=t.typein_attributes.medium):r.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?r.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?r.domain=t.domain:r.domain={host:a.getHost(document.location.hostname),isolate:!1},r.referrals=[],t.referrals&&t.referrals.length>0)for(var i=0;i<t.referrals.length;i++)t.referrals[i].host&&r.referrals.push(t.referrals[i]);if(r.organics=[],t.organics&&t.organics.length>0)for(var s=0;s<t.organics.length;s++)t.organics[s].host&&t.organics[s].param&&r.organics.push(t.organics[s]);return r.organics.push({host:"bing.com",param:"q",display:"bing"}),r.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),r.organics.push({host:"about.com",param:"q",display:"about"}),r.organics.push({host:"aol.com",param:"q",display:"aol"}),r.organics.push({host:"ask.com",param:"q",display:"ask"}),r.organics.push({host:"globososo.com",param:"q",display:"globo"}),r.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),r.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),r.organics.push({host:"tut.by",param:"query",display:"tut.by"}),r.referrals.push({host:"t.co",display:"twitter.com"}),r.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),r},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,r){"use strict";t.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(t){"use strict";const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){document.querySelectorAll("wc-order-attribution-inputs").forEach((t,e)=>{e>0&&t.remove()});for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}function r(t){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",t,!0)}function c(){return"undefined"!=typeof sbjs}function d(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),r(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&c()?n:i,o=c()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!c())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();a(i),r(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);
!function(n,t){var r,e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("underscore",t):(n="undefined"!=typeof globalThis?globalThis:n||self,r=n._,(e=n._=t()).noConflict=function(){return n._=r,e})}(this,function(){var n="1.13.8",t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},e=Array.prototype,V=Object.prototype,F="undefined"!=typeof Symbol?Symbol.prototype:null,P=e.push,f=e.slice,s=V.toString,q=V.hasOwnProperty,r="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,U=Array.isArray,W=Object.keys,z=Object.create,L=r&&ArrayBuffer.isView,$=isNaN,C=isFinite,K=!{toString:null}.propertyIsEnumerable("toString"),J=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G=Math.pow(2,53)-1;function l(u,i){return i=null==i?u.length-1:+i,function(){for(var n=Math.max(arguments.length-i,0),t=Array(n),r=0;r<n;r++)t[r]=arguments[r+i];switch(i){case 0:return u.call(this,t);case 1:return u.call(this,arguments[0],t);case 2:return u.call(this,arguments[0],arguments[1],t)}for(var e=Array(i+1),r=0;r<i;r++)e[r]=arguments[r];return e[i]=t,u.apply(this,e)}}function i(n){var t=typeof n;return"function"==t||"object"==t&&!!n}function H(n){return void 0===n}function Q(n){return!0===n||!1===n||"[object Boolean]"===s.call(n)}function o(n){var t="[object "+n+"]";return function(n){return s.call(n)===t}}var X=o("String"),Y=o("Number"),Z=o("Date"),nn=o("RegExp"),tn=o("Error"),rn=o("Symbol"),en=o("ArrayBuffer"),a=o("Function"),t=t.document&&t.document.childNodes,p=a="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof t?function(n){return"function"==typeof n||!1}:a,t=o("Object"),un=u&&(!/\[native code\]/.test(String(DataView))||t(new DataView(new ArrayBuffer(8)))),a="undefined"!=typeof Map&&t(new Map),u=o("DataView");var h=un?function(n){return null!=n&&p(n.getInt8)&&en(n.buffer)}:u,c=U||o("Array");function v(n,t){return null!=n&&q.call(n,t)}var on=o("Arguments"),an=(!function(){on(arguments)||(on=function(n){return v(n,"callee")})}(),on);function fn(n){return Y(n)&&$(n)}function cn(n){return function(){return n}}function ln(t){return function(n){n=t(n);return"number"==typeof n&&0<=n&&n<=G}}function sn(t){return function(n){return null==n?void 0:n[t]}}var y=sn("byteLength"),pn=ln(y),hn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var vn=r?function(n){return L?L(n)&&!h(n):pn(n)&&hn.test(s.call(n))}:cn(!1),d=sn("length");function yn(n,t){t=function(t){for(var r={},n=t.length,e=0;e<n;++e)r[t[e]]=!0;return{contains:function(n){return!0===r[n]},push:function(n){return r[n]=!0,t.push(n)}}}(t);var r=J.length,e=n.constructor,u=p(e)&&e.prototype||V,i="constructor";for(v(n,i)&&!t.contains(i)&&t.push(i);r--;)(i=J[r])in n&&n[i]!==u[i]&&!t.contains(i)&&t.push(i)}function g(n){if(!i(n))return[];if(W)return W(n);var t,r=[];for(t in n)v(n,t)&&r.push(t);return K&&yn(n,r),r}function dn(n,t){var r=g(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;i<e;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0}function b(n){return n instanceof b?n:this instanceof b?void(this._wrapped=n):new b(n)}function gn(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,y(n))}b.VERSION=n,b.prototype.valueOf=b.prototype.toJSON=b.prototype.value=function(){return this._wrapped},b.prototype.toString=function(){return String(this._wrapped)};var bn="[object DataView]";function m(n){if(!i(n))return[];var t,r=[];for(t in n)r.push(t);return K&&yn(n,r),r}function mn(e){var u=d(e);return function(n){if(null==n)return!1;var t=m(n);if(d(t))return!1;for(var r=0;r<u;r++)if(!p(n[e[r]]))return!1;return e!==wn||!p(n[jn])}}var jn="forEach",t=["clear","delete"],u=["get","has","set"],U=t.concat(jn,u),wn=t.concat(u),r=["add"].concat(t,jn,"has"),u=a?mn(U):o("Map"),t=a?mn(wn):o("WeakMap"),U=a?mn(r):o("Set"),a=o("WeakSet");function j(n){for(var t=g(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=n[t[u]];return e}function _n(n){for(var t={},r=g(n),e=0,u=r.length;e<u;e++)t[n[r[e]]]=r[e];return t}function An(n){var t,r=[];for(t in n)p(n[t])&&r.push(t);return r.sort()}function xn(f,c){return function(n){var t=arguments.length;if(c&&(n=Object(n)),!(t<2||null==n))for(var r=1;r<t;r++)for(var e=arguments[r],u=f(e),i=u.length,o=0;o<i;o++){var a=u[o];c&&void 0!==n[a]||(n[a]=e[a])}return n}}var Sn=xn(m),w=xn(g),On=xn(m,!0);function Mn(n){var t;return i(n)?z?z(n):((t=function(){}).prototype=n,n=new t,t.prototype=null,n):{}}function En(n){return c(n)?n:[n]}function _(n){return b.toPath(n)}function Bn(n,t){for(var r=t.length,e=0;e<r;e++){if(null==n)return;n=n[t[e]]}return r?n:void 0}function Nn(n,t,r){n=Bn(n,_(t));return H(n)?r:n}function kn(n){return n}function A(t){return t=w({},t),function(n){return dn(n,t)}}function In(t){return t=_(t),function(n){return Bn(n,t)}}function x(u,i,n){if(void 0===i)return u;switch(null==n?3:n){case 1:return function(n){return u.call(i,n)};case 3:return function(n,t,r){return u.call(i,n,t,r)};case 4:return function(n,t,r,e){return u.call(i,n,t,r,e)}}return function(){return u.apply(i,arguments)}}function Tn(n,t,r){return null==n?kn:p(n)?x(n,t,r):(i(n)&&!c(n)?A:In)(n)}function Dn(n,t){return Tn(n,t,1/0)}function S(n,t,r){return b.iteratee!==Dn?b.iteratee(n,t):Tn(n,t,r)}function Rn(){}function Vn(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))}b.toPath=En,b.iteratee=Dn;var O=Date.now||function(){return(new Date).getTime()};function Fn(t){function r(n){return t[n]}var n="(?:"+g(t).join("|")+")",e=RegExp(n),u=RegExp(n,"g");return function(n){return e.test(n=null==n?"":""+n)?n.replace(u,r):n}}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},Pn=Fn(r),r=Fn(_n(r)),qn=b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Un=/(.)^/,Wn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},zn=/\\|'|\r|\n|\u2028|\u2029/g;function Ln(n){return"\\"+Wn[n]}var $n=/^\s*(\w|\$)+\s*$/;var Cn=0;function Kn(n,t,r,e,u){return e instanceof t?(e=Mn(n.prototype),i(t=n.apply(e,u))?t:e):n.apply(r,u)}var M=l(function(u,i){function o(){for(var n=0,t=i.length,r=Array(t),e=0;e<t;e++)r[e]=i[e]===a?arguments[n++]:i[e];for(;n<arguments.length;)r.push(arguments[n++]);return Kn(u,o,this,this,r)}var a=M.placeholder;return o}),Jn=(M.placeholder=b,l(function(t,r,e){var u;if(p(t))return u=l(function(n){return Kn(t,u,r,this,e.concat(n))});throw new TypeError("Bind must be called on a function")})),E=ln(d);function B(n,t,r){t||0===t||(t=1/0);for(var e=[],u=0,i=0,o=d(n)||0,a=[];;){if(o<=i){if(a.length){var f=a.pop(),i=f.i,o=d(n=f.v);continue}break}f=n[i++];t<=a.length?e[u++]=f:E(f)&&(c(f)||an(f))?(a.push({i:i,v:n}),i=0,o=d(n=f)):r||(e[u++]=f)}return e}var Gn=l(function(n,t){var r=(t=B(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var e=t[r];n[e]=Jn(n[e],n)}return n});var Hn=l(function(n,t,r){return setTimeout(function(){return n.apply(null,r)},t)}),Qn=M(Hn,b,1);function Xn(n){return function(){return!n.apply(this,arguments)}}function Yn(n,t){var r;return function(){return 0<--n&&(r=t.apply(this,arguments)),n<=1&&(t=null),r}}var Zn=M(Yn,2);function nt(n,t,r){t=S(t,r);for(var e,u=g(n),i=0,o=u.length;i<o;i++)if(t(n[e=u[i]],e,n))return e}function tt(i){return function(n,t,r){t=S(t,r);for(var e=d(n),u=0<i?0:e-1;0<=u&&u<e;u+=i)if(t(n[u],u,n))return u;return-1}}var rt=tt(1),et=tt(-1);function ut(n,t,r,e){for(var u=(r=S(r,e,1))(t),i=0,o=d(n);i<o;){var a=Math.floor((i+o)/2);r(n[a])<u?i=a+1:o=a}return i}function it(i,o,a){return function(n,t,r){var e=0,u=d(n);if("number"==typeof r)0<i?e=0<=r?r:Math.max(r+u,e):u=0<=r?Math.min(r+1,u):r+u+1;else if(a&&r&&u)return n[r=a(n,t)]===t?r:-1;if(t!=t)return 0<=(r=o(f.call(n,e,u),fn))?r+e:-1;for(r=0<i?e:u-1;0<=r&&r<u;r+=i)if(n[r]===t)return r;return-1}}var ot=it(1,rt,ut),at=it(-1,et);function ft(n,t,r){t=(E(n)?rt:nt)(n,t,r);if(void 0!==t&&-1!==t)return n[t]}function N(n,t,r){if(t=x(t,r),E(n))for(u=0,i=n.length;u<i;u++)t(n[u],u,n);else for(var e=g(n),u=0,i=e.length;u<i;u++)t(n[e[u]],e[u],n);return n}function k(n,t,r){t=S(t,r);for(var e=!E(n)&&g(n),u=(e||n).length,i=Array(u),o=0;o<u;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i}function ct(f){return function(n,t,r,e){var u=3<=arguments.length;return function(n,t,r,e){var u=!E(n)&&g(n),i=(u||n).length,o=0<f?0:i-1;for(e||(r=n[u?u[o]:o],o+=f);0<=o&&o<i;o+=f){var a=u?u[o]:o;r=t(r,n[a],a,n)}return r}(n,x(t,e,4),r,u)}}var lt=ct(1),st=ct(-1);function I(n,e,t){var u=[];return e=S(e,t),N(n,function(n,t,r){e(n,t,r)&&u.push(n)}),u}function pt(n,t,r){t=S(t,r);for(var e=!E(n)&&g(n),u=(e||n).length,i=0;i<u;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0}function ht(n,t,r){t=S(t,r);for(var e=!E(n)&&g(n),u=(e||n).length,i=0;i<u;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1}function T(n,t,r,e){return E(n)||(n=j(n)),0<=ot(n,t,r="number"==typeof r&&!e?r:0)}var vt=l(function(n,r,e){var u,i;return p(r)?i=r:(r=_(r),u=r.slice(0,-1),r=r[r.length-1]),k(n,function(n){var t=i;if(!t){if(null==(n=u&&u.length?Bn(n,u):n))return;t=n[r]}return null==t?t:t.apply(n,e)})});function yt(n,t){return k(n,In(t))}function dt(n,e,t){var r,u,i=-1/0,o=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&i<r&&(i=r);else e=S(e,t),N(n,function(n,t,r){u=e(n,t,r),(o<u||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i}var gt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function bt(n){return n?c(n)?f.call(n):X(n)?n.match(gt):E(n)?k(n,kn):j(n):[]}function mt(n,t,r){if(null==t||r)return(n=E(n)?n:j(n))[Vn(n.length-1)];for(var e=bt(n),r=d(e),u=(t=Math.max(Math.min(t,r),0),r-1),i=0;i<t;i++){var o=Vn(i,u),a=e[i];e[i]=e[o],e[o]=a}return e.slice(0,t)}function D(i,t){return function(r,e,n){var u=t?[[],[]]:{};return e=S(e,n),N(r,function(n,t){t=e(n,t,r);i(u,n,t)}),u}}var jt=D(function(n,t,r){v(n,r)?n[r].push(t):n[r]=[t]}),wt=D(function(n,t,r){n[r]=t}),_t=D(function(n,t,r){v(n,r)?n[r]++:n[r]=1}),At=D(function(n,t,r){n[r?0:1].push(t)},!0);function xt(n,t,r){return t in r}var St=l(function(n,t){var r={},e=t[0];if(null!=n){p(e)?(1<t.length&&(e=x(e,t[1])),t=m(n)):(e=xt,t=B(t,!1,!1),n=Object(n));for(var u=0,i=t.length;u<i;u++){var o=t[u],a=n[o];e(a,o,n)&&(r[o]=a)}}return r}),Ot=l(function(n,r){var t,e=r[0];return p(e)?(e=Xn(e),1<r.length&&(t=r[1])):(r=k(B(r,!1,!1),String),e=function(n,t){return!T(r,t)}),St(n,e,t)});function Mt(n,t,r){return f.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))}function Et(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[0]:Mt(n,n.length-t)}function R(n,t,r){return f.call(n,null==t||r?1:t)}var Bt=l(function(n,t){return t=B(t,!0,!0),I(n,function(n){return!T(t,n)})}),Nt=l(function(n,t){return Bt(n,t)});function kt(n,t,r,e){Q(t)||(e=r,r=t,t=!1),null!=r&&(r=S(r,e));for(var u=[],i=[],o=0,a=d(n);o<a;o++){var f=n[o],c=r?r(f,o,n):f;t&&!r?(o&&i===c||u.push(f),i=c):r?T(i,c)||(i.push(c),u.push(f)):T(u,f)||u.push(f)}return u}var It=l(function(n){return kt(B(n,!0,!0))});function Tt(n){for(var t=n&&dt(n,d).length||0,r=Array(t),e=0;e<t;e++)r[e]=yt(n,e);return r}var Dt=l(Tt);function Rt(n,t){return n._chain?b(t).chain():t}function Vt(r){return N(An(r),function(n){var t=b[n]=r[n];b.prototype[n]=function(){var n=[this._wrapped];return P.apply(n,arguments),Rt(this,t.apply(b,n))}}),b}N(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];b.prototype[t]=function(){var n=this._wrapped;return null!=n&&(r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),Rt(this,n)}}),N(["concat","join","slice"],function(n){var t=e[n];b.prototype[n]=function(){var n=this._wrapped;return Rt(this,n=null!=n?t.apply(n,arguments):n)}});n=Vt({__proto__:null,VERSION:n,restArguments:l,isObject:i,isNull:function(n){return null===n},isUndefined:H,isBoolean:Q,isElement:function(n){return!(!n||1!==n.nodeType)},isString:X,isNumber:Y,isDate:Z,isRegExp:nn,isError:tn,isSymbol:rn,isArrayBuffer:en,isDataView:h,isArray:c,isFunction:p,isArguments:an,isFinite:function(n){return!rn(n)&&C(n)&&!isNaN(parseFloat(n))},isNaN:fn,isTypedArray:vn,isEmpty:function(n){var t;return null==n||("number"==typeof(t=d(n))&&(c(n)||X(n)||an(n))?0===t:0===d(g(n)))},isMatch:dn,isEqual:function(n,t){for(var r=[{a:n,b:t}],e=[],u=[];r.length;){var i=r.pop();if(!0===i)e.pop(),u.pop();else{if((n=i.a)===(t=i.b)){if(0!==n||1/n==1/t)continue;return!1}if(null==n||null==t)return!1;if(n!=n){if(t!=t)continue;return!1}i=typeof n;if("function"!=i&&"object"!=i&&"object"!=typeof t)return!1;n instanceof b&&(n=n._wrapped),t instanceof b&&(t=t._wrapped);i=s.call(n);if(i!==s.call(t))return!1;if(un&&"[object Object]"==i&&h(n)){if(!h(t))return!1;i=bn}switch(i){case"[object RegExp]":case"[object String]":if(""+n==""+t)continue;return!1;case"[object Number]":r.push({a:+n,b:+t});continue;case"[object Date]":case"[object Boolean]":if(+n==+t)continue;return!1;case"[object Symbol]":if(F.valueOf.call(n)===F.valueOf.call(t))continue;return!1;case"[object ArrayBuffer]":case bn:r.push({a:gn(n),b:gn(t)});continue}i="[object Array]"===i;if(!i&&vn(n)){if(y(n)!==y(t))return!1;if(n.buffer===t.buffer&&n.byteOffset===t.byteOffset)continue;i=!0}if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(p(o)&&o instanceof o&&p(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}for(var f=e.length;f--;)if(e[f]===n){if(u[f]===t)break;return!1}if(!(0<=f))if(e.push(n),u.push(t),r.push(!0),i){if((f=n.length)!==t.length)return!1;for(;f--;)r.push({a:n[f],b:t[f]})}else{var c,l=g(n),f=l.length;if(g(t).length!==f)return!1;for(;f--;){if(!v(t,c=l[f]))return!1;r.push({a:n[c],b:t[c]})}}}}return!0},isMap:u,isWeakMap:t,isSet:U,isWeakSet:a,keys:g,allKeys:m,values:j,pairs:function(n){for(var t=g(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=[t[u],n[t[u]]];return e},invert:_n,functions:An,methods:An,extend:Sn,extendOwn:w,assign:w,defaults:On,create:function(n,t){return n=Mn(n),t&&w(n,t),n},clone:function(n){return i(n)?c(n)?n.slice():Sn({},n):n},tap:function(n,t){return t(n),n},get:Nn,has:function(n,t){for(var r=(t=_(t)).length,e=0;e<r;e++){var u=t[e];if(!v(n,u))return!1;n=n[u]}return!!r},mapObject:function(n,t,r){t=S(t,r);for(var e=g(n),u=e.length,i={},o=0;o<u;o++){var a=e[o];i[a]=t(n[a],a,n)}return i},identity:kn,constant:cn,noop:Rn,toPath:En,property:In,propertyOf:function(t){return null==t?Rn:function(n){return Nn(t,n)}},matcher:A,matches:A,times:function(n,t,r){var e=Array(Math.max(0,n));t=x(t,r,1);for(var u=0;u<n;u++)e[u]=t(u);return e},random:Vn,now:O,escape:Pn,unescape:r,templateSettings:qn,template:function(i,n,t){n=On({},n=!n&&t?t:n,b.templateSettings);var r,t=RegExp([(n.escape||Un).source,(n.interpolate||Un).source,(n.evaluate||Un).source].join("|")+"|$","g"),o=0,a="__p+='";if(i.replace(t,function(n,t,r,e,u){return a+=i.slice(o,u).replace(zn,Ln),o=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",t=n.variable){if(!$n.test(t))throw new Error("variable is not a bare identifier: "+t)}else a="with(obj||{}){\n"+a+"}\n",t="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(t,"_",a)}catch(n){throw n.source=a,n}function e(n){return r.call(this,n,b)}return e.source="function("+t+"){\n"+a+"}",e},result:function(n,t,r){var e=(t=_(t)).length;if(!e)return p(r)?r.call(n):r;for(var u=0;u<e;u++){var i=null==n?void 0:n[t[u]];void 0===i&&(i=r,u=e),n=p(i)?i.call(n):i}return n},uniqueId:function(n){var t=++Cn+"";return n?n+t:t},chain:function(n){return(n=b(n))._chain=!0,n},iteratee:Dn,partial:M,bind:Jn,bindAll:Gn,memoize:function(e,u){function i(n){var t=i.cache,r=""+(u?u.apply(this,arguments):n);return v(t,r)||(t[r]=e.apply(this,arguments)),t[r]}return i.cache={},i},delay:Hn,defer:Qn,throttle:function(r,e,u){function i(){l=!1===u.leading?0:O(),o=null,c=r.apply(a,f),o||(a=f=null)}function n(){var n=O(),t=(l||!1!==u.leading||(l=n),e-(n-l));return a=this,f=arguments,t<=0||e<t?(o&&(clearTimeout(o),o=null),l=n,c=r.apply(a,f),o||(a=f=null)):o||!1===u.trailing||(o=setTimeout(i,t)),c}var o,a,f,c,l=0;return u=u||{},n.cancel=function(){clearTimeout(o),l=0,o=a=f=null},n},debounce:function(t,r,e){function u(){var n=O()-o;n<r?i=setTimeout(u,r-n):(i=null,e||(f=t.apply(c,a)),i||(a=c=null))}var i,o,a,f,c,n=l(function(n){return c=this,a=n,o=O(),i||(i=setTimeout(u,r),e&&(f=t.apply(c,a))),f});return n.cancel=function(){clearTimeout(i),i=a=c=null},n},wrap:function(n,t){return M(t,n)},negate:Xn,compose:function(){var r=arguments,e=r.length-1;return function(){for(var n=e,t=r[e].apply(this,arguments);n--;)t=r[n].call(this,t);return t}},after:function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}},before:Yn,once:Zn,findKey:nt,findIndex:rt,findLastIndex:et,sortedIndex:ut,indexOf:ot,lastIndexOf:at,find:ft,detect:ft,findWhere:function(n,t){return ft(n,A(t))},each:N,forEach:N,map:k,collect:k,reduce:lt,foldl:lt,inject:lt,reduceRight:st,foldr:st,filter:I,select:I,reject:function(n,t,r){return I(n,Xn(S(t)),r)},every:pt,all:pt,some:ht,any:ht,contains:T,includes:T,include:T,invoke:vt,pluck:yt,where:function(n,t){return I(n,A(t))},max:dt,min:function(n,e,t){var r,u,i=1/0,o=1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&r<i&&(i=r);else e=S(e,t),N(n,function(n,t,r){((u=e(n,t,r))<o||u===1/0&&i===1/0)&&(i=n,o=u)});return i},shuffle:function(n){return mt(n,1/0)},sample:mt,sortBy:function(n,e,t){var u=0;return e=S(e,t),yt(k(n,function(n,t,r){return{value:n,index:u++,criteria:e(n,t,r)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(e<r||void 0===r)return 1;if(r<e||void 0===e)return-1}return n.index-t.index}),"value")},groupBy:jt,indexBy:wt,countBy:_t,partition:At,toArray:bt,size:function(n){return null==n?0:(E(n)?n:g(n)).length},pick:St,omit:Ot,first:Et,head:Et,take:Et,initial:Mt,last:function(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[n.length-1]:R(n,Math.max(0,n.length-t))},rest:R,tail:R,drop:R,compact:function(n){return I(n,Boolean)},flatten:function(n,t){return B(n,t,!1)},without:Nt,uniq:kt,unique:kt,union:It,intersection:function(n){for(var t=[],r=arguments.length,e=0,u=d(n);e<u;e++){var i=n[e];if(!T(t,i)){for(var o=1;o<r&&T(arguments[o],i);o++);o===r&&t.push(i)}}return t},difference:Bt,unzip:Tt,transpose:Tt,zip:Dt,object:function(n,t){for(var r={},e=0,u=d(n);e<u;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},range:function(n,t,r){null==t&&(t=n||0,n=0),r=r||(t<n?-1:1);for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;i<e;i++,n+=r)u[i]=n;return u},chunk:function(n,t){if(null==t||t<1)return[];for(var r=[],e=0,u=n.length;e<u;)r.push(f.call(n,e,e+=t));return r},mixin:Vt,default:b});return n._=n});
!function(n){var s="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(t,e,i){s.Backbone=n(s,i,t,e)});else if("undefined"!=typeof exports){var t,e=require("underscore");try{t=require("jquery")}catch(t){}n(s,exports,e,t)}else s.Backbone=n(s,{},s._,s.jQuery||s.Zepto||s.ender||s.$)}(function(t,h,b,e){function a(t,e,i,n,s){var r,o=0;if(i&&"object"==typeof i){void 0!==n&&"context"in s&&void 0===s.context&&(s.context=n);for(r=b.keys(i);o<r.length;o++)e=a(t,e,r[o],i[r[o]],s)}else if(i&&l.test(i))for(r=i.split(l);o<r.length;o++)e=t(e,r[o],n,s);else e=t(e,i,n,s);return e}function x(t,e,i){i=Math.min(Math.max(i,0),t.length);for(var n=Array(t.length-i),s=e.length,r=0;r<n.length;r++)n[r]=t[r+i];for(r=0;r<s;r++)t[r+i]=e[r];for(r=0;r<n.length;r++)t[r+s+i]=n[r]}function s(i,n,t,s){b.each(t,function(t,e){n[e]&&(i.prototype[e]=function(n,t,s,r){switch(t){case 1:return function(){return n[s](this[r])};case 2:return function(t){return n[s](this[r],t)};case 3:return function(t,e){return n[s](this[r],T(t,this),e)};case 4:return function(t,e,i){return n[s](this[r],T(t,this),e,i)};default:return function(){var t=u.call(arguments);return t.unshift(this[r]),n[s].apply(n,t)}}}(n,t,e,s))})}var o,i=t.Backbone,u=Array.prototype.slice,e=(h.VERSION="1.6.1",h.$=e,h.noConflict=function(){return t.Backbone=i,this},h.emulateHTTP=!1,h.emulateJSON=!1,h.Events={}),l=/\s+/,n=(e.on=function(t,e,i){return this._events=a(n,this._events||{},t,e,{context:i,ctx:this,listening:o}),o&&(((this._listeners||(this._listeners={}))[o.id]=o).interop=!1),this},e.listenTo=function(t,e,i){if(t){var n=t._listenId||(t._listenId=b.uniqueId("l")),s=this._listeningTo||(this._listeningTo={}),r=o=s[n],s=(r||(this._listenId||(this._listenId=b.uniqueId("l")),r=o=s[n]=new g(this,t)),c(t,e,i,this));if(o=void 0,s)throw s;r.interop&&r.on(e,i)}return this},function(t,e,i,n){var s,r;return i&&(e=t[e]||(t[e]=[]),s=n.context,r=n.ctx,(n=n.listening)&&n.count++,e.push({callback:i,context:s,ctx:s||r,listening:n})),t}),c=function(t,e,i,n){try{t.on(e,i,n)}catch(t){return t}},r=(e.off=function(t,e,i){return this._events&&(this._events=a(r,this._events,t,e,{context:i,listeners:this._listeners})),this},e.stopListening=function(t,e,i){var n=this._listeningTo;if(n){for(var s=t?[t._listenId]:b.keys(n),r=0;r<s.length;r++){var o=n[s[r]];if(!o)break;o.obj.off(e,i,this),o.interop&&o.off(e,i)}b.isEmpty(n)&&(this._listeningTo=void 0)}return this},function(t,e,i,n){if(t){var s,r=n.context,o=n.listeners,h=0;if(e||r||i){for(s=e?[e]:b.keys(t);h<s.length;h++){var a=t[e=s[h]];if(!a)break;for(var u=[],l=0;l<a.length;l++){var c=a[l];i&&i!==c.callback&&i!==c.callback._callback||r&&r!==c.context?u.push(c):(c=c.listening)&&c.off(e,i)}u.length?t[e]=u:delete t[e]}return t}for(s=b.keys(o);h<s.length;h++)o[s[h]].cleanup()}}),d=(e.once=function(t,e,i){var n=a(d,{},t,e,this.off.bind(this));return this.on(n,e="string"==typeof t&&null==i?void 0:e,i)},e.listenToOnce=function(t,e,i){e=a(d,{},e,i,this.stopListening.bind(this,t));return this.listenTo(t,e)},function(t,e,i,n){var s;return i&&((s=t[e]=b.once(function(){n(e,s),i.apply(this,arguments)}))._callback=i),t}),f=(e.trigger=function(t){if(this._events){for(var e=Math.max(0,arguments.length-1),i=Array(e),n=0;n<e;n++)i[n]=arguments[n+1];a(f,this._events,t,void 0,i)}return this},function(t,e,i,n){var s,r;return t&&(s=t[e],r=t.all,s&&(r=r&&r.slice()),s&&p(s,n),r)&&p(r,[e].concat(n)),t}),p=function(t,e){var i,n=-1,s=t.length,r=e[0],o=e[1],h=e[2];switch(e.length){case 0:for(;++n<s;)(i=t[n]).callback.call(i.ctx);return;case 1:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r);return;case 2:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,o);return;case 3:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,o,h);return;default:for(;++n<s;)(i=t[n]).callback.apply(i.ctx,e);return}},g=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0},v=(g.prototype.on=e.on,g.prototype.off=function(t,e){t=this.interop?(this._events=a(r,this._events,t,e,{context:void 0,listeners:void 0}),!this._events):(this.count--,0===this.count);t&&this.cleanup()},g.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},e.bind=e.on,e.unbind=e.off,b.extend(h,e),h.Model=function(t,e){var i=t||{},n=(e=e||{},this.preinitialize.apply(this,arguments),this.cid=b.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(i=this.parse(i,e)||{}),b.result(this,"defaults")),i=b.defaults(b.extend({},n,i),n);this.set(i,e),this.changed={},this.initialize.apply(this,arguments)}),m=(b.extend(v.prototype,e,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return b.clone(this.attributes)},sync:function(){return h.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return b.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!b.iteratee(t,this)(this.attributes)},set:function(t,e,i){if(null!=t){var n;if("object"==typeof t?(n=t,i=e):(n={})[t]=e,!this._validate(n,i=i||{}))return!1;var s,r,o=i.unset,t=i.silent,h=[],a=this._changing,u=(this._changing=!0,a||(this._previousAttributes=b.clone(this.attributes),this.changed={}),this.attributes),l=this.changed,c=this._previousAttributes;for(s in n)e=n[s],b.isEqual(u[s],e)||h.push(s),b.isEqual(c[s],e)?delete l[s]:l[s]=e,o?delete u[s]:u[s]=e;if(this.idAttribute in n&&(r=this.id,this.id=this.get(this.idAttribute),this.id!==r)&&this.trigger("changeId",this,r,i),!t){h.length&&(this._pending=i);for(var d=0;d<h.length;d++)this.trigger("change:"+h[d],this,u[h[d]],i)}if(!a){if(!t)for(;this._pending;)i=this._pending,this._pending=!1,this.trigger("change",this,i);this._pending=!1,this._changing=!1}}return this},unset:function(t,e){return this.set(t,void 0,b.extend({},e,{unset:!0}))},clear:function(t){var e,i={};for(e in this.attributes)i[e]=void 0;return this.set(i,b.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!b.isEmpty(this.changed):b.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&b.clone(this.changed);var e,i,n=this._changing?this._previousAttributes:this.attributes,s={};for(i in t){var r=t[i];b.isEqual(n[i],r)||(s[i]=r,e=!0)}return!!e&&s},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return b.clone(this._previousAttributes)},fetch:function(i){i=b.extend({parse:!0},i);var n=this,s=i.success;return i.success=function(t){var e=i.parse?n.parse(t,i):t;if(!n.set(e,i))return!1;s&&s.call(i.context,n,t,i),n.trigger("sync",n,t,i)},N(this,i),this.sync("read",this,i)},save:function(t,e,i){null==t||"object"==typeof t?(n=t,i=e):(n={})[t]=e;var n,s=(i=b.extend({validate:!0,parse:!0},i)).wait;if(n&&!s){if(!this.set(n,i))return!1}else if(!this._validate(n,i))return!1;var r=this,o=i.success,h=this.attributes,t=(i.success=function(t){r.attributes=h;var e=i.parse?r.parse(t,i):t;if((e=s?b.extend({},n,e):e)&&!r.set(e,i))return!1;o&&o.call(i.context,r,t,i),r.trigger("sync",r,t,i)},N(this,i),n&&s&&(this.attributes=b.extend({},h,n)),this.isNew()?"create":i.patch?"patch":"update"),e=("patch"!=t||i.attrs||(i.attrs=n),this.sync(t,this,i));return this.attributes=h,e},destroy:function(e){e=e?b.clone(e):{};function i(){n.stopListening(),n.trigger("destroy",n,n.collection,e)}var n=this,s=e.success,r=e.wait,t=!(e.success=function(t){r&&i(),s&&s.call(e.context,n,t,e),n.isNew()||n.trigger("sync",n,t,e)});return this.isNew()?b.defer(e.success):(N(this,e),t=this.sync("delete",this,e)),r||i(),t},url:function(){var t,e=b.result(this,"urlRoot")||b.result(this.collection,"url")||M();return this.isNew()?e:(t=this.get(this.idAttribute),e.replace(/[^\/]$/,"$&/")+encodeURIComponent(t))},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},b.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=b.extend({},this.attributes,t);t=this.validationError=this.validate(t,e)||null;return!t||(this.trigger("invalid",this,t,b.extend(e,{validationError:t})),!1)}}),h.Collection=function(t,e){e=e||{},this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,b.extend({silent:!0},e))}),w={add:!0,remove:!0,merge:!0},_={add:!0,remove:!1},y=(b.extend(m.prototype,e,{model:v,preinitialize:function(){},initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return h.sync.apply(this,arguments)},add:function(t,e){return this.set(t,b.extend({merge:!1},e,_))},remove:function(t,e){e=b.extend({},e);var i=!b.isArray(t),t=(t=i?[t]:t.slice(),this._removeModels(t,e));return!e.silent&&t.length&&(e.changes={added:[],merged:[],removed:t},this.trigger("update",this,e)),i?t[0]:t},set:function(t,e){if(null!=t){(e=b.extend({},w,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);for(var i=!b.isArray(t),n=(t=i?[t]:t.slice(),e.at),s=((n=(n=null!=n?+n:n)>this.length?this.length:n)<0&&(n+=this.length+1),[]),r=[],o=[],h=[],a={},u=e.add,l=e.merge,c=e.remove,d=!1,f=this.comparator&&null==n&&!1!==e.sort,p=b.isString(this.comparator)?this.comparator:null,g=0;g<t.length;g++){var v,m=t[g],_=this.get(m);_?(l&&m!==_&&(v=this._isModel(m)?m.attributes:m,e.parse&&(v=_.parse(v,e)),_.set(v,e),o.push(_),f)&&!d&&(d=_.hasChanged(p)),a[_.cid]||(a[_.cid]=!0,s.push(_)),t[g]=_):u&&(m=t[g]=this._prepareModel(m,e))&&(r.push(m),this._addReference(m,e),a[m.cid]=!0,s.push(m))}if(c){for(g=0;g<this.length;g++)a[(m=this.models[g]).cid]||h.push(m);h.length&&this._removeModels(h,e)}var y=!1;if(s.length&&(!f&&u&&c)?(y=this.length!==s.length||b.some(this.models,function(t,e){return t!==s[e]}),this.models.length=0,x(this.models,s,0),this.length=this.models.length):r.length&&(f&&(d=!0),x(this.models,r,null==n?this.length:n),this.length=this.models.length),d&&this.sort({silent:!0}),!e.silent){for(g=0;g<r.length;g++)null!=n&&(e.index=n+g),(m=r[g]).trigger("add",m,this,e);(d||y)&&this.trigger("sort",this,e),(r.length||h.length||o.length)&&(e.changes={added:r,removed:h,merged:o},this.trigger("update",this,e))}return i?t[0]:t}},reset:function(t,e){e=e?b.clone(e):{};for(var i=0;i<this.models.length;i++)this._removeReference(this.models[i],e);return e.previousModels=this.models,this._reset(),t=this.add(t,b.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,b.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,b.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return u.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t,t.idAttribute)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t=t||{};var i=e.length;return b.isFunction(e)&&(e=e.bind(this)),1===i||b.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(i){var n=(i=b.extend({parse:!0},i)).success,s=this;return i.success=function(t){var e=i.reset?"reset":"set";s[e](t,i),n&&n.call(i.context,s,t,i),s.trigger("sync",s,t,i)},N(this,i),this.sync("read",this,i)},create:function(t,e){var n=(e=e?b.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;n||this.add(t,e);var s=this,r=e.success;return e.success=function(t,e,i){n&&(t.off("error",s._forwardPristineError,s),s.add(t,i)),r&&r.call(i.context,t,e,i)},n&&t.once("error",this._forwardPristineError,this),t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t,e){return t[e||this.model.prototype.idAttribute||"id"]},values:function(){return new E(this,S)},keys:function(){return new E(this,I)},entries:function(){return new E(this,k)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){return this._isModel(t)?(t.collection||(t.collection=this),t):(t=((e=e?b.clone(e):{}).collection=this).model.prototype?new this.model(t,e):this.model(t,e)).validationError?(this.trigger("invalid",this,t.validationError,e),!1):t},_removeModels:function(t,e){for(var i=[],n=0;n<t.length;n++){var s,r,o=this.get(t[n]);o&&(s=this.indexOf(o),this.models.splice(s,1),this.length--,delete this._byId[o.cid],null!=(r=this.modelId(o.attributes,o.idAttribute))&&delete this._byId[r],e.silent||(e.index=s,o.trigger("remove",o,this,e)),i.push(o),this._removeReference(o,e))}return 0<t.length&&!e.silent&&delete e.index,i},_isModel:function(t){return t instanceof v},_addReference:function(t,e){this._byId[t.cid]=t;var i=this.modelId(t.attributes,t.idAttribute);null!=i&&(this._byId[i]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var i=this.modelId(t.attributes,t.idAttribute);null!=i&&delete this._byId[i],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){if(e){if(("add"===t||"remove"===t)&&i!==this)return;var s,r;"destroy"===t&&this.remove(e,n),"changeId"===t&&(s=this.modelId(e.previousAttributes(),e.idAttribute),r=this.modelId(e.attributes,e.idAttribute),null!=s&&delete this._byId[s],null!=r)&&(this._byId[r]=e)}this.trigger.apply(this,arguments)},_forwardPristineError:function(t,e,i){this.has(t)||this._onModelEvent("error",t,e,i)}}),"function"==typeof Symbol&&Symbol.iterator),E=(y&&(m.prototype[y]=m.prototype.values),function(t,e){this._collection=t,this._kind=e,this._index=0}),S=1,I=2,k=3,y=(y&&(E.prototype[y]=function(){return this}),E.prototype.next=function(){if(this._collection){var t,e;if(this._index<this._collection.length)return t=this._collection.at(this._index),this._index++,{value:this._kind===S?t:(e=this._collection.modelId(t.attributes,t.idAttribute),this._kind===I?e:[e,t]),done:!1};this._collection=void 0}return{value:void 0,done:!0}},h.View=function(t){this.cid=b.uniqueId("view"),this.preinitialize.apply(this,arguments),b.extend(this,b.pick(t,P)),this._ensureElement(),this.initialize.apply(this,arguments)}),A=/^(\S+)\s*(.*)$/,P=["model","collection","el","id","attributes","className","tagName","events"],T=(b.extend(y.prototype,e,{tagName:"div",$:function(t){return this.$el.find(t)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof h.$?t:h.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t=t||b.result(this,"events"))for(var e in this.undelegateEvents(),t){var i=t[e];(i=b.isFunction(i)?i:this[i])&&(e=e.match(A),this.delegate(e[1],e[2],i.bind(this)))}return this},delegate:function(t,e,i){return this.$el.on(t+".delegateEvents"+this.cid,e,i),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,i){return this.$el.off(t+".delegateEvents"+this.cid,e,i),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){var t;this.el?this.setElement(b.result(this,"el")):(t=b.extend({},b.result(this,"attributes")),this.id&&(t.id=b.result(this,"id")),this.className&&(t.class=b.result(this,"className")),this.setElement(this._createElement(b.result(this,"tagName"))),this._setAttributes(t))},_setAttributes:function(t){this.$el.attr(t)}}),function(e,t){return b.isFunction(e)?e:b.isObject(e)&&!t._isModel(e)?H(e):b.isString(e)?function(t){return t.get(e)}:e}),H=function(t){var e=b.matches(t);return function(t){return e(t.attributes)}},$=(b.each([[m,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},"models"],[v,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes"]],function(t){var i=t[0],e=t[1],n=t[2];i.mixin=function(t){var e=b.reduce(b.functions(t),function(t,e){return t[e]=0,t},{});s(i,t,e,n)},s(i,b,e,n)}),h.sync=function(t,e,n){var i,s=$[t],r=(b.defaults(n=n||{},{emulateHTTP:h.emulateHTTP,emulateJSON:h.emulateJSON}),{type:s,dataType:"json"}),o=(n.url||(r.url=b.result(e,"url")||M()),null!=n.data||!e||"create"!==t&&"update"!==t&&"patch"!==t||(r.contentType="application/json",r.data=JSON.stringify(n.attrs||e.toJSON(n))),n.emulateJSON&&(r.contentType="application/x-www-form-urlencoded",r.data=r.data?{model:r.data}:{}),!n.emulateHTTP||"PUT"!==s&&"DELETE"!==s&&"PATCH"!==s||(r.type="POST",n.emulateJSON&&(r.data._method=s),i=n.beforeSend,n.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",s),i)return i.apply(this,arguments)}),"GET"===r.type||n.emulateJSON||(r.processData=!1),n.error),t=(n.error=function(t,e,i){n.textStatus=e,n.errorThrown=i,o&&o.call(n.context,t,e,i)},n.xhr=h.ajax(b.extend(r,n)));return e.trigger("request",e,t,n),t},{create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"}),C=(h.ajax=function(){return h.$.ajax.apply(h.$,arguments)},h.Router=function(t){t=t||{},this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)}),j=/\((.*?)\)/g,O=/(\(\?)?:\w+/g,U=/\*\w+/g,z=/[\-{}\[\]+?.,\\\^$|#\s]/g,R=(b.extend(C.prototype,e,{preinitialize:function(){},initialize:function(){},route:function(e,i,n){b.isRegExp(e)||(e=this._routeToRegExp(e)),b.isFunction(i)&&(n=i,i=""),n=n||this[i];var s=this;return h.history.route(e,function(t){t=s._extractParameters(e,t);!1!==s.execute(n,t,i)&&(s.trigger.apply(s,["route:"+i].concat(t)),s.trigger("route",i,t),h.history.trigger("route",s,i,t))}),this},execute:function(t,e,i){t&&t.apply(this,e)},navigate:function(t,e){return h.history.navigate(t,e),this},_bindRoutes:function(){if(this.routes){this.routes=b.result(this,"routes");for(var t,e=b.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(z,"\\$&").replace(j,"(?:$1)?").replace(O,function(t,e){return e?t:"([^/?]+)"}).replace(U,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return b.map(i,function(t,e){return e===i.length-1?t||null:t?decodeURIComponent(t):null})}}),h.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)}),q=/^[#\/]|\s+$/g,F=/^\/+|\/+$/g,B=/#.*$/,M=(R.started=!1,b.extend(R.prototype,e,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){t=(t||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return(t=null==t?this._usePushState||!this._wantsHashChange?this.getPath():this.getHash():t).replace(q,"")},start:function(t){if(R.started)throw new Error("Backbone.history has already been started");if(R.started=!0,this.options=b.extend({root:"/"},this.options,t),this.root=this.options.root,this._trailingSlash=this.options.trailingSlash,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||7<document.documentMode),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(F,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return t=this.root.slice(0,-1)||"/",this.location.replace(t+"#"+this.getPath()),!0;this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}this._hasHashChange||!this._wantsHashChange||this._usePushState||(this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1,(t=(t=document.body).insertBefore(this.iframe,t.firstChild).contentWindow).document.open(),t.document.close(),t.location.hash="#"+this.fragment);t=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?t("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),R.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if((e=e===this.fragment&&this.iframe?this.getHash(this.iframe.contentWindow):e)===this.fragment)return!this.matchRoot()&&this.notfound();this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(e){return this.matchRoot()&&(e=this.fragment=this.getFragment(e),b.some(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0}))||this.notfound()},notfound:function(){return this.trigger("notfound"),!1},navigate:function(t,e){if(!R.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var i=this.root,i=(i=this._trailingSlash||""!==t&&"?"!==t.charAt(0)?i:i.slice(0,-1)||"/")+t,n=(t=t.replace(B,""),this.decodeFragment(t));if(this.fragment!==n){if(this.fragment=n,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)&&(n=this.iframe.contentWindow,e.replace||(n.document.open(),n.document.close()),this._updateHash(n.location,t,e.replace))}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,i){i?(i=t.href.replace(/(javascript:|#).*$/,""),t.replace(i+"#"+e)):t.hash="#"+e}}),h.history=new R,v.extend=m.extend=C.extend=y.extend=R.extend=function(t,e){var i=this,n=t&&b.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)};return b.extend(n,i,e),n.prototype=b.create(i.prototype,t),(n.prototype.constructor=n).__super__=i.prototype,n},function(){throw new Error('A "url" property or function must be specified')}),N=function(e,i){var n=i.error;i.error=function(t){n&&n.call(i.context,e,t,i),e.trigger("error",e,t,i)}};return h._debug=function(){return{root:t,_:b}},h});
(()=>{"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e){if(Array.isArray(e))return e}const l="email",a="phone",u="name",c={[l]:["email","e-mail","mail","email address"],[a]:["phone","tel","mobile","cell","telephone","phone number"],[u]:["name","full-name","full name","full_name","fullname","first-name","first name","first_name","firstname","last-name","last name","last_name","lastname","given-name","given name","given_name","givenname","family-name","family name","family_name","familyname","fname","lname","first","last","your-name","your name"]};function s(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function f(e){const t=s(e),r=t.lastIndexOf("@");if(-1===r)return t;const n=t.slice(r+1);if(["gmail.com","googlemail.com"].includes(n)){const e=t.slice(0,r).replace(/\./g,"");return"".concat(e,"@").concat(n)}return t}function m(e){const t=s(e),r=t.replace(/\D/g,"");return t.startsWith("+")?"+".concat(r):r}function p(l){const a=l.filter(e=>e.type===u).map(e=>s(e.value)).filter(Boolean);if(!a.length)return;const c=o(p=1===a.length?a[0].split(" "):a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(p)||n(p)||r(),f=c[0],m=i(c).slice(1);var p;return function(r){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach(function(e){t(r,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}({first_name:f},(null==m?void 0:m.length)>0?{last_name:m.join(" ")}:{})}function y(e){var t;return null===(t=e.find(e=>e.type===l))||void 0===t?void 0:t.value}function b(e){var t;return null===(t=e.find(e=>e.type===a))||void 0===t?void 0:t.value}function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function d(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}((e,t,i)=>{if(!e||!t||!i)return;const v=t.Object.extend({initialize(){this.listenTo(i.Radio.channel("forms"),"submit:response",this.actionSubmit)},actionSubmit(e){var t,i,v,d;const O=(null===(t=globalThis._googlesitekit)||void 0===t?void 0:t.gtagUserData)?(j=e.data.fields,function(e){const t=[["address",p(e)],["email",y(e)],["phone_number",b(e)]].filter(e=>{return(t=e,i=2,o(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,l,a=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw i}}return a}}(t,i)||n(t,i)||r())[1];var t,i});if(0!==t.length)return Object.fromEntries(t)}(Object.values(j).map(e=>{var t;const r=e.label,n=e.type,i=e.value,o=e.key;return function(e){let t=e||{},r=t.type,n=t.name,i=t.value,o=t.label;switch(r=s(r),n=s(n),i=s(i),o=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(o),r){case"email":return{type:l,value:f(i)};case"tel":return{type:a,value:m(i)}}return function(e){if(!e)return!1;const t=f(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(i)||c[l].includes(n)||c[l].includes(o)?{type:l,value:f(i)}:c[a].includes(n)||c[a].includes(o)?{type:a,value:m(i)}:c[u].includes(n)||c[u].includes(o)?{type:u,value:s(i)}:function(e){if(!e)return!1;if(!function(e){const t=e.replace(/\D/g,"");return!(t.length<7||t.length<e.length/2)&&/^[\s\-()+.\d]*$/.test(e)}(e))return!1;const t=m(e);if(!/^\+?\d{7,}$/.test(t))return!1;const r=/[\s\-()+.]/.test(e),n=e.trim().startsWith("+");return!(!r&&!n)}(i)?{type:a,value:m(i)}:null}({label:r,type:null!==(t=h[n])&&void 0!==t?t:n,value:i,name:o})}).filter(Boolean))):void 0;var j;const w=null===(i=e.data)||void 0===i?void 0:i.form_id;null===(v=globalThis._googlesitekit)||void 0===v||null===(d=v.gtagEvent)||void 0===d||d.call(v,"submit_lead_form",g(g({googlesitekit_event_provider:"ninja-forms"},w?{googlesitekit_form_id:String(w)}:{}),O?{user_data:O}:{}))}});e(document).ready(()=>{new v})})(globalThis.jQuery,globalThis.Marionette,globalThis.Backbone);const h={phone:"tel",textbox:"text"}})();