function scrollToQueryId(queryId){
const targetElement=document.getElementById(`uagb-block-queryid-${queryId}`);
if(targetElement){
const rect=targetElement.getBoundingClientRect();
const adminBar=document.querySelector('#wpadminbar');
const adminBarOffSetHeight=adminBar?.offsetHeight||0;
const scrollTop=window?.pageYOffset||document?.documentElement?.scrollTop;
const targetOffset=(rect?.top + scrollTop) - adminBarOffSetHeight;
window.scrollTo({
top: targetOffset,
behavior: 'smooth'
});
}}
function findAncestorWithClass(element, className){
while(element&&! element.classList.contains(className) ){
element=element.parentNode;
}
return element;
}
document.addEventListener('DOMContentLoaded', function (){
function debounce(func, wait){
let timeout;
return function executedFunction(...args){
const context=this;
const later=()=> {
timeout=null;
func.apply(context, args);
};
clearTimeout(timeout);
timeout=setTimeout(later, wait);
};};
async function updateContent(event, paged=null, buttonFilter=null, current=null, loopParentContainer){
try{
const loopBuilder=loopParentContainer;
const search=loopBuilder?.querySelector('.uagb-loop-search' )?.value;
const sorting=loopBuilder?.querySelector('.uagb-loop-sort' )?.value;
const category=current?.value;
const categoryButtonFilterContainer=loopBuilder?.querySelector('.uagb-loop-category-inner');
const formData=new FormData();
if(search){
formData.append('search', search);
}
if(sorting){
formData.append('sorting', sorting);
}
if(category){
formData.append('category', category);
}
const checkBoxValues=loopParentContainer?.querySelectorAll('.uagb-cat-checkbox');
const checkedValues=[];
checkBoxValues?.forEach(checkBoxVal=> {
const isChecked=checkBoxVal.checked;
if(isChecked&&checkBoxVal.getAttribute('data-uagb-block-query-id')===event.target.dataset.uagbBlockQueryId){
checkedValues.push(checkBoxVal.value);
}});
if(checkedValues){
formData.append('checkbox', checkedValues);
}
if(paged){
formData.append('paged', paged);
}
if(buttonFilter){
formData.append('buttonFilter', JSON.stringify(buttonFilter.type) );
}
const queryId=event.target?.dataset?.uagbBlockQueryId||event.target?.parentElement?.dataset?.uagbBlockQueryId||categoryButtonFilterContainer?.dataset?.uagbBlockQueryId||event?.dataset?.uagbBlockQueryId||event.target.closest('a' )?.getAttribute('data-uagb-block-query-id');
scrollToQueryId(queryId);
formData.append('queryId', queryId);
formData.append('block_id', loopBuilder?.getAttribute('data-block_id') );
const output=await getUpdatedLoopWrapperContent(formData);
const loopElement=loopBuilder?.querySelector('#uagb-block-queryid-' + queryId);
if(loopElement&&output?.content?.wrapper){
loopElement.innerHTML=output.content.wrapper;
}
const loopPaginationContainers=loopBuilder?.querySelectorAll('#uagb-block-pagination-queryid-'+queryId);
if(loopPaginationContainers&&output?.content?.pagination){
loopPaginationContainers.innerHTML=output?.content?.pagination;
}
loopPaginationContainers?.forEach(loopPaginationContainer=> {
loopPaginationContainer.innerHTML=output.content.pagination;
});
} catch(error){
throw error;
}}
function handleInput(event){
const loopParentContainer=this.closest('.wp-block-uagb-loop-builder');
const searchInputs=loopParentContainer.querySelectorAll('.uagb-loop-search');
searchInputs.forEach(searchInput=> {
if(searchInput.getAttribute('data-uagb-block-query-id')===event.target.dataset.uagbBlockQueryId){
searchInput.value=event.target.value;
}});
updateContent(event, null, null, null, loopParentContainer);
}
function handleCheckBoxVal(event){
const loopParentContainer=this.closest('.wp-block-uagb-loop-builder');
const checkBoxValues=loopParentContainer.querySelectorAll('.uagb-cat-checkbox');
const checkedValues=[];
checkBoxValues.forEach(checkBoxVal=> {
const isChecked=checkBoxVal.checked;
if(isChecked&&checkBoxVal.getAttribute('data-uagb-block-query-id')===event.target.dataset.uagbBlockQueryId){
checkedValues.push(checkBoxVal.value);
}});
updateContent(event, null, null, null, loopParentContainer);
}
function handleSelect(event){
const loopParentContainer=this.closest('.wp-block-uagb-loop-builder');
const sortSelects=loopParentContainer.querySelectorAll('.uagb-loop-sort');
sortSelects.forEach(sortSelect=> {
if(sortSelect.getAttribute('data-uagb-block-query-id')===event.target.dataset.uagbBlockQueryId){
sortSelect.value=event.target.value;
}});
updateContent(event, null, null, null, loopParentContainer);
}
function handleCatSelect(event){
const loopParentContainer=this.closest('.wp-block-uagb-loop-builder');
const categorySelects=loopParentContainer.querySelectorAll('.uagb-loop-category');
categorySelects.forEach(categorySelect=> {
if(categorySelect.getAttribute('data-uagb-block-query-id')===event.target.dataset.uagbBlockQueryId){
categorySelect.value=event.target.value;
}});
updateContent(event, null, null, this, loopParentContainer);
}
function resetValues(container, selector, queryId, resetCallback){
const elements=container.querySelectorAll(selector);
elements.forEach(element=> {
const elementQueryId=element.dataset.uagbBlockQueryId;
if(elementQueryId===queryId){
resetCallback(element);
}});
}
function handleReset(event){
const loopParentContainer=this.closest('.wp-block-uagb-loop-builder');
let queryId=event.target.parentElement.dataset.uagbBlockQueryId;
if(event.target.tagName.toLowerCase()==='a'){
queryId=event.target.dataset.uagbBlockQueryId;
}else if(event.target.tagName.toLowerCase()==='svg'||event.target.tagName.toLowerCase()==='path'){
queryId=event.target.closest('a' )?.getAttribute('data-uagb-block-query-id');
}
const loopBuilder=findAncestorWithClass(event.target.parentNode, 'wp-block-uagb-loop-builder');
resetValues(loopBuilder, '.uagb-loop-search', queryId, element=> {
element.value='';
});
resetValues(loopBuilder, '.uagb-loop-sort', queryId, element=> {
element.value='';
});
resetValues(loopBuilder, '.uagb-loop-category', queryId, element=> {
element.value='';
});
resetValues(loopBuilder, '.uagb-cat-checkbox', queryId, element=> {
element.checked=false;
});
updateContent(event, null, null, null, loopParentContainer);
}
const resetButtons=document.querySelectorAll('.uagb-loop-reset');
const searchInputs=document.querySelectorAll('.uagb-loop-search');
searchInputs.forEach(searchInput=> {
const debouncedHandleInput=debounce(handleInput, 250);
searchInput.addEventListener('input', debouncedHandleInput);
});
const sortSelects=document.querySelectorAll('.uagb-loop-sort');
sortSelects.forEach(sortSelect=> {
const debouncedHandleInput=debounce(handleSelect, 250);
sortSelect.addEventListener('change', debouncedHandleInput);
});
const categorySelects=document.querySelectorAll('.uagb-loop-category');
categorySelects.forEach(categorySelect=> {
const debouncedHandleInput=debounce(handleCatSelect, 250);
categorySelect.addEventListener('change', debouncedHandleInput);
});
const checkBoxValues=document.querySelectorAll('.uagb-cat-checkbox');
checkBoxValues.forEach(checkBoxVal=> {
const debouncedHandleInput=debounce(handleCheckBoxVal, 250);
checkBoxVal.addEventListener('click', debouncedHandleInput);
});
resetButtons.forEach(resetButton=> {
const debouncedHandleReset=debounce(handleReset, 250);
resetButton.addEventListener('click', debouncedHandleReset);
});
const oldPaginations=document.querySelectorAll('.wp-block-uagb-loop-builder > :not(.uagb-loop-pagination).wp-block-uagb-buttons');
oldPaginations?.forEach(function(container){
const parentContainer=document.createElement('div');
parentContainer.classList.add('uagb-loop-pagination');
const queryIdPAginationLink=container.querySelector('a').getAttribute('data-uagb-block-query-id');
parentContainer.id='uagb-block-pagination-queryid-'+queryIdPAginationLink;
parentContainer.innerHTML=container.outerHTML;
container.parentNode.insertBefore(parentContainer, container.nextSibling);
container.parentNode.removeChild(container);
});
const paginationContainer=document.querySelectorAll('.uagb-loop-pagination');
paginationContainer.forEach(pagination=> {
pagination.addEventListener('click', function(event){
event.preventDefault();
const loopParentContainer=this.closest('.wp-block-uagb-loop-builder');
if(event.target.tagName.toLowerCase()==='a'){
updateContent(event, event.target.dataset.uagbBlockQueryPaged, null, null, loopParentContainer);
}
if(( event.target.tagName.toLowerCase()==='div'&&event.target.parentElement.tagName.toLowerCase()==='a') ){
updateContent(event, event.target.parentElement.dataset.uagbBlockQueryPaged, null, null, loopParentContainer);
}
if(event.target.tagName.toLowerCase()==='svg'&&event.target.tagName.toLowerCase()==='path'){
updateContent(event.target.parentElement.parentElement, event?.target?.closest('a' )?.getAttribute('data-uagb-block-query-paged'), null, null, loopParentContainer);
}});
});
const categoryButtonFilterContainer=document.querySelectorAll('.uagb-loop-category-inner ');
categoryButtonFilterContainer.forEach(buttons=> {
buttons.addEventListener('click', function(event){
event.preventDefault();
const loopParentContainer=this.closest('.wp-block-uagb-loop-builder');
if(event.target.tagName.toLowerCase()==='a'){
updateContent(event, null, event.target.children[0].dataset, null, loopParentContainer);
}
if(( event.target.tagName.toLowerCase()==='div'&&event.target.parentElement.tagName.toLowerCase()==='a') ){
updateContent(event, null, event.target.dataset, null, loopParentContainer);
}});
});
});
function getUpdatedLoopWrapperContent(data){
data.append('action', 'uagb_update_loop_builder_content');
data.append('postId', uagb_loop_builder?.post_id);
data.append('postType', uagb_loop_builder?.what_post_type);
data.append('security', uagb_loop_builder?.nonce)
return fetch(uagb_loop_builder?.ajax_url, {
method: 'POST',
credentials: 'same-origin',
body: data,
})
.then(response=> {
if(! response.ok){
throw new Error('Network response was not ok');
}
return response.json();
})
.then(output=> {
if(output.success){
return output.data;
}
throw new Error(output.data.message);
})
.catch(error=> {
throw error;
});
};
const UAGBBlockPositioning={init(t,e){const s=document.querySelector(e);s?.classList.contains("uagb-position__sticky")&&UAGBBlockPositioning.handleSticky(s,t)},handleSticky(t,e){var s=()=>{return document.querySelector("#wpadminbar")?.offsetHeight||0},p=()=>{"undefined"!=typeof AOS&&e?.UAGAnimationType&&(t.dataset.aos=e?.UAGAnimationType,t.dataset.aosDuration=e?.UAGAnimationTime,t.dataset.aosDelay=e?.UAGAnimationDelay,t.dataset.aosEasing=e?.UAGAnimationEasing,t.dataset.aosOnce=!0,setTimeout(()=>{AOS.refreshHard()},100))};const o=t.getBoundingClientRect(),y=e?.isBlockRootParent?null:t.parentElement,i=((t,e,s)=>{const o=document.createElement("div"),i=(o.style.height=e.height+"px",o.style.boxSizing="border-box",window.getComputedStyle(t));return s?(o.style.width="100%",o.style.maxWidth=i.getPropertyValue("max-width")||e.width+"px",o.style.padding=i.getPropertyValue("padding")||0,o.style.margin=i.getPropertyValue("margin")||0,o.style.border=i.getPropertyValue("border")||0,o.style.borderColor="transparent"):(o.style.width=e.width+"px",o.style.margin=i.getPropertyValue("margin")||0),o})(t,o,y);let n,a,l,r;const c={top:0,bottom:0},d={top:0,right:0,bottom:0,left:0};if(e?.UAGStickyRestricted){r=y.getBoundingClientRect();const g=window.getComputedStyle(y);d.top=parseInt(g.getPropertyValue("padding-top")||0,10),d.bottom=parseInt(g.getPropertyValue("padding-bottom")||0,10),c.top=r.top+(window.pageYOffset||0)+d.top,c.bottom=r.bottom+(window.pageYOffset||0)-d.bottom-o.height-s()-(e?.UAGStickyOffset||0)}"bottom"===e?.UAGStickyLocation?(n=o.top+(window.pageYOffset||0)-window.innerHeight+o.height+(e?.UAGStickyOffset||0),a=`${e?.UAGStickyOffset||0}px`,(l=void 0!==window.pageYOffset?window.pageYOffset:document.body.scrollTop)<=n&&!t.classList.contains("uagb-position__sticky--stuck")&&(t.parentNode.insertBefore(i,t),t.classList.add("uagb-position__sticky--stuck"),t.style.bottom=`calc(${a} - ${window.innerHeight}px)`,t.style.left=o.left+"px",t.style.width=o.width+"px",t.style.zIndex="999",setTimeout(()=>{t.style.bottom=a},50)),p(),window.addEventListener("scroll",()=>{(l=void 0!==window.pageYOffset?window.pageYOffset:document.body.scrollTop)<=n?t.classList.contains("uagb-position__sticky--stuck")||(t.parentNode.insertBefore(i,t),t.classList.add("uagb-position__sticky--stuck"),t.style.bottom=a,t.style.left=o.left+"px",t.style.width=o.width+"px",t.style.zIndex="999"):l>n&&t.classList.contains("uagb-position__sticky--stuck")&&(t.parentNode.removeChild(i),t.classList.remove("uagb-position__sticky--stuck"),t.style.bottom="",t.style.left="",t.style.width="",t.style.zIndex="")})):(n=o.top+(window.pageYOffset||0)-s()-(e?.UAGStickyOffset||0),a=s()+(e?.UAGStickyOffset||0)+"px",(l=void 0!==window.pageYOffset?window.pageYOffset:document.body.scrollTop)>=n&&!t.classList.contains("uagb-position__sticky--stuck")&&(t.parentNode.insertBefore(i,t),t.classList.add("uagb-position__sticky--stuck"),e?.UAGStickyRestricted&&l>=c.bottom?(t.classList.remove("uagb-position__sticky--stuck"),t.classList.add("uagb-position__sticky--restricted"),t.style.top="",t.style.bottom=d.bottom+"px",t.style.left=`${i?.offsetLeft||0}px`):(t.style.top=`calc(${a} - ${window.innerHeight}px)`,t.style.left=o.left+"px",t.style.top=a),t.style.width=o.width+"px",t.style.zIndex="999"),p(),window.addEventListener("scroll",()=>{(l=void 0!==window.pageYOffset?window.pageYOffset:document.body.scrollTop)>=n?t.classList.contains("uagb-position__sticky--stuck")||t.classList.contains("uagb-position__sticky--restricted")?e?.UAGStickyRestricted&&!t.classList.contains("uagb-position__sticky--restricted")&&l>=c.bottom?(t.classList.remove("uagb-position__sticky--stuck"),t.classList.add("uagb-position__sticky--restricted"),t.style.top="",t.style.bottom=d.bottom+"px",t.style.left=`${i?.offsetLeft||0}px`):t.classList.contains("uagb-position__sticky--restricted")&&l<c.bottom&&(t.classList.remove("uagb-position__sticky--restricted"),t.classList.add("uagb-position__sticky--stuck"),t.style.top=a,t.style.bottom="",t.style.left=o.left+"px",t.style.width=o.width+"px",t.style.zIndex="999"):(t.parentNode.insertBefore(i,t),t.classList.add("uagb-position__sticky--stuck"),t.style.top=a,t.style.left=o.left+"px",t.style.width=o.width+"px",t.style.zIndex="999"):l<n&&t.classList.contains("uagb-position__sticky--stuck")&&(t.parentNode.removeChild(i),t.classList.remove("uagb-position__sticky--stuck"),t.style.top="",t.style.left="",t.style.width="",t.style.zIndex="")}))}};
UAGBButtonChild={
init($selector){
const block=document.querySelector($selector);
if(! block){
return;
}
block.addEventListener('focusin', ()=> {
document.addEventListener('keydown', this.handleKeyDown);
});
block.addEventListener('focusout', ()=> {
document.removeEventListener('keydown', this.handleKeyDown);
});
},
handleKeyDown(e){
if(e.key===' '||e.key==='Spacebar'){
if(e.target.tagName==='A'&&e.target.classList.contains('uagb-buttons-repeater') ){
e.preventDefault();
e.target.click();
}}
},
};
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AOS=t():e.AOS=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=n(1),a=(o(r),n(6)),u=o(a),c=n(7),f=o(c),s=n(8),d=o(s),l=n(9),p=o(l),m=n(10),b=o(m),v=n(11),y=o(v),g=n(14),h=o(g),w=[],k=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,startEvent:"DOMContentLoaded",throttleDelay:99,debounceDelay:50,disableMutationObserver:!1},j=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&(k=!0),k)return w=(0,y.default)(w,x),(0,b.default)(w,x.once),w},O=function(){w=(0,h.default)(),j()},_=function(){w.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay")})},S=function(e){return e===!0||"mobile"===e&&p.default.mobile()||"phone"===e&&p.default.phone()||"tablet"===e&&p.default.tablet()||"function"==typeof e&&e()===!0},z=function(e){x=i(x,e),w=(0,h.default)();var t=document.all&&!window.atob;return S(x.disable)||t?_():(document.querySelector("body").setAttribute("data-aos-easing",x.easing),document.querySelector("body").setAttribute("data-aos-duration",x.duration),document.querySelector("body").setAttribute("data-aos-delay",x.delay),"DOMContentLoaded"===x.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1?j(!0):"load"===x.startEvent?window.addEventListener(x.startEvent,function(){j(!0)}):document.addEventListener(x.startEvent,function(){j(!0)}),window.addEventListener("resize",(0,f.default)(j,x.debounceDelay,!0)),window.addEventListener("orientationchange",(0,f.default)(j,x.debounceDelay,!0)),window.addEventListener("scroll",(0,u.default)(function(){(0,b.default)(w,x.once)},x.throttleDelay)),x.disableMutationObserver||(0,d.default)("[data-aos]",O),w)};e.exports={init:z,refresh:j,refreshHard:O}},function(e,t){},,,,,function(e,t){(function(t){"use strict";function n(e,t,n){function o(t){var n=b,o=v;return b=v=void 0,k=t,g=e.apply(o,n)}function r(e){return k=e,h=setTimeout(s,t),_?o(e):g}function a(e){var n=e-w,o=e-k,i=t-n;return S?j(i,y-o):i}function c(e){var n=e-w,o=e-k;return void 0===w||n>=t||n<0||S&&o>=y}function s(){var e=O();return c(e)?d(e):void(h=setTimeout(s,a(e)))}function d(e){return h=void 0,z&&b?o(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),k=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(O())}function m(){var e=O(),n=c(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(s,t),o(w)}return void 0===h&&(h=setTimeout(s,t)),g}var b,v,y,g,h,w,k=0,_=!1,S=!1,z=!0;if("function"!=typeof e)throw new TypeError(f);return t=u(t)||0,i(n)&&(_=!!n.leading,S="maxWait"in n,y=S?x(u(n.maxWait)||0,t):y,z="trailing"in n?!!n.trailing:z),m.cancel=l,m.flush=p,m}function o(e,t,o){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(f);return i(o)&&(r="leading"in o?!!o.leading:r,a="trailing"in o?!!o.trailing:a),n(e,t,{leading:r,maxWait:t,trailing:a})}function i(e){var t="undefined"==typeof e?"undefined":c(e);return!!e&&("object"==t||"function"==t)}function r(e){return!!e&&"object"==("undefined"==typeof e?"undefined":c(e))}function a(e){return"symbol"==("undefined"==typeof e?"undefined":c(e))||r(e)&&k.call(e)==d}function u(e){if("number"==typeof e)return e;if(a(e))return s;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=m.test(e);return n||b.test(e)?v(e.slice(2),n?2:8):p.test(e)?s:+e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f="Expected a function",s=NaN,d="[object Symbol]",l=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,b=/^0o[0-7]+$/i,v=parseInt,y="object"==("undefined"==typeof t?"undefined":c(t))&&t&&t.Object===Object&&t,g="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,h=y||g||Function("return this")(),w=Object.prototype,k=w.toString,x=Math.max,j=Math.min,O=function(){return h.Date.now()};e.exports=o}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";function n(e,t,n){function i(t){var n=b,o=v;return b=v=void 0,O=t,g=e.apply(o,n)}function r(e){return O=e,h=setTimeout(s,t),_?i(e):g}function u(e){var n=e-w,o=e-O,i=t-n;return S?x(i,y-o):i}function f(e){var n=e-w,o=e-O;return void 0===w||n>=t||n<0||S&&o>=y}function s(){var e=j();return f(e)?d(e):void(h=setTimeout(s,u(e)))}function d(e){return h=void 0,z&&b?i(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),O=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(j())}function m(){var e=j(),n=f(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(s,t),i(w)}return void 0===h&&(h=setTimeout(s,t)),g}var b,v,y,g,h,w,O=0,_=!1,S=!1,z=!0;if("function"!=typeof e)throw new TypeError(c);return t=a(t)||0,o(n)&&(_=!!n.leading,S="maxWait"in n,y=S?k(a(n.maxWait)||0,t):y,z="trailing"in n?!!n.trailing:z),m.cancel=l,m.flush=p,m}function o(e){var t="undefined"==typeof e?"undefined":u(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==("undefined"==typeof e?"undefined":u(e))}function r(e){return"symbol"==("undefined"==typeof e?"undefined":u(e))||i(e)&&w.call(e)==s}function a(e){if("number"==typeof e)return e;if(r(e))return f;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=p.test(e);return n||m.test(e)?b(e.slice(2),n?2:8):l.test(e)?f:+e}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c="Expected a function",f=NaN,s="[object Symbol]",d=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,v="object"==("undefined"==typeof t?"undefined":u(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":u(self))&&self&&self.Object===Object&&self,g=v||y||Function("return this")(),h=Object.prototype,w=h.toString,k=Math.max,x=Math.min,j=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){"use strict";function n(e,t){var n=window.document,r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,a=new r(o);i=t,a.observe(n.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}function o(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),n=Array.prototype.slice.call(e.removedNodes),o=t.concat(n).filter(function(e){return e.hasAttribute&&e.hasAttribute("data-aos")}).length;o&&i()})}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){};t.default=n},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return navigator.userAgent||navigator.vendor||window.opera||""}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,a=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,u=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,c=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,f=function(){function e(){n(this,e)}return i(e,[{key:"phone",value:function(){var e=o();return!(!r.test(e)&&!a.test(e.substr(0,4)))}},{key:"mobile",value:function(){var e=o();return!(!u.test(e)&&!c.test(e.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}}]),e}();t.default=new f},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,n){var o=e.node.getAttribute("data-aos-once");t>e.position?e.node.classList.add("aos-animate"):"undefined"!=typeof o&&("false"===o||!n&&"true"!==o)&&e.node.classList.remove("aos-animate")},o=function(e,t){var o=window.pageYOffset,i=window.innerHeight;e.forEach(function(e,r){n(e,i+o,t)})};t.default=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),r=o(i),a=function(e,t){return e.forEach(function(e,n){e.node.classList.add("aos-init"),e.position=(0,r.default)(e.node,t.offset)}),e};t.default=a},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),r=o(i),a=function(e,t){var n=0,o=0,i=window.innerHeight,a={offset:e.getAttribute("data-aos-offset"),anchor:e.getAttribute("data-aos-anchor"),anchorPlacement:e.getAttribute("data-aos-anchor-placement")};switch(a.offset&&!isNaN(a.offset)&&(o=parseInt(a.offset)),a.anchor&&document.querySelectorAll(a.anchor)&&(e=document.querySelectorAll(a.anchor)[0]),n=(0,r.default)(e).top,a.anchorPlacement){case"top-bottom":break;case"center-bottom":n+=e.offsetHeight/2;break;case"bottom-bottom":n+=e.offsetHeight;break;case"top-center":n+=i/2;break;case"bottom-center":n+=i/2+e.offsetHeight;break;case"center-center":n+=i/2+e.offsetHeight/2;break;case"top-top":n+=i;break;case"bottom-top":n+=e.offsetHeight+i;break;case"center-top":n+=e.offsetHeight/2+i}return a.anchorPlacement||a.offset||isNaN(t)||(o=t),n+o};t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}};t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e=e||document.querySelectorAll("[data-aos]"),Array.prototype.map.call(e,function(e){return{node:e}})};t.default=n}])});
window.addEventListener('load', function(){
setTimeout(function(){
AOS.init();
}, 0);
});
let scrollData=true;
let scrollOffset=30;
let scrolltoTop=false;
let scrollElement=null;
let uagbTOCCollapseListener=true;
UAGBTableOfContents={
_getDocumentElement(){
let document_element=document;
const getEditorIframe=document.querySelectorAll('iframe[name="editor-canvas"]');
if(getEditorIframe?.length){
const iframeDocument=getEditorIframe?.[0]?.contentWindow?.document||getEditorIframe?.[0]?.contentDocument;
if(iframeDocument){
document_element=iframeDocument;
}}
return document_element;
},
_setCollapseIconMargin(id, attr){
const document_collapsable=UAGBTableOfContents._getDocumentElement();
const block_element=document_collapsable.querySelector(id);
const uagbLoader=block_element.querySelector('.uagb-toc__loader');
const firstListItem=block_element.querySelector('li.uagb-toc__list:not(.uagb-toc__list--expandable)');
if(firstListItem){
const listFontSize=window.getComputedStyle(firstListItem).fontSize;
const listWrap=block_element.querySelector('.uagb-toc__list-wrap');
const widthValue=`calc(${listFontSize} / 3)`;
const escapedId=id?.replace(/\./g, '');
const existingStyleSheet=document_collapsable.querySelector(`#${escapedId}-toc-style`);
if(existingStyleSheet){
existingStyleSheet.remove();
}
const styleSheet=document_collapsable.createElement('style');
styleSheet.id=`${escapedId}-toc-style`;
const userAgent=navigator.userAgent.toLowerCase();
const isSafari=/^((?!chrome|android|crios|fxios).)*safari/i.test(userAgent)&&!userAgent.includes('edge');
const isFirefox=userAgent.includes('firefox');
const isFirefoxOrSafari=isSafari||isFirefox;
const calculateMarginRightDisc=(fontSize)=> {
const baseFontSize=8;
const baseMargin=5;
const increment=5;
const fontSizeNumeric=parseFloat(fontSize);
const increments=(( fontSizeNumeric - baseFontSize) / 8);
const marginRight=baseMargin +(increments * increment);
return `${marginRight}px`;
};
const calculateMarginRightDecimal=(ListFontSize)=> {
const fontSize=parseFloat(ListFontSize);
const baseMargin=(1 / 4) * fontSize;
const additionalMargin=Math.max(0,(fontSize - 16) / 8) * 2;
return(baseMargin + additionalMargin);
};
let marginRight;
let marginLeft='-0.5px';
if('disc'===attr?.markerView){
if(isFirefoxOrSafari){
marginRight=calculateMarginRightDisc(listFontSize);
marginLeft=isFirefox ? '1px':'-0.5px';
}else{
marginRight=listFontSize;
}}
if('decimal'===attr?.markerView){
const marginRightDeducting=calculateMarginRightDecimal(listFontSize)
marginRight=`${parseFloat(listFontSize) - marginRightDeducting}px`;
marginLeft='1px'
}
styleSheet.innerHTML +=`
${ id } .list-open::before,
${ id } .list-collapsed::before {
width: ${ widthValue };}
${ id } .list-open,
${ id } .list-collapsed {
margin-right: ${ marginRight };
margin-left: ${ marginLeft };}
[dir="rtl"] ${ id } .list-open,
[dir="rtl"] ${ id } .list-collapsed {
margin-right: ${ marginLeft };
margin-left: ${ marginRight };}
`;
document_collapsable.head.appendChild(styleSheet);
setTimeout(()=> {
block_element.style.opacity='';
uagbLoader?.remove();
listWrap?.classList.remove('uagb-toc__list-hidden');
}, 300);
}},
_initCollapsableList(id, attr){
const document_collapsable=UAGBTableOfContents._getDocumentElement();
const block_element=document_collapsable.querySelector(id);
if(attr?.isFrontend&&attr?.enableCollapsableList&&! block_element.classList.contains('init-collapsed-script') ){
block_element.classList.add('init-collapsed-script');
const ulElements=block_element.querySelectorAll('ul.uagb-toc__list');
if('function'===typeof UAGBTableOfContents._setCollapseIconMargin){
UAGBTableOfContents._setCollapseIconMargin(id, attr);
}
ulElements.forEach(( ul)=> {
const spanElement=ul.parentElement.querySelector('.list-open');
ul.classList.add('transition');
ul.dataset.originalMaxHeight=ul.scrollHeight + 'px';
if(spanElement){
const isExpanded=spanElement.getAttribute('aria-expanded')==='true';
ul.style.maxHeight=isExpanded ? ul.dataset.originalMaxHeight:'0px';
ul.style.overflow=isExpanded ? 'visible':'hidden';
ul.addEventListener('transitionend', ()=> {
if(ul.style.maxHeight!=='0px'){
ul.style.overflow='visible';
}});
}else{
ul.style.maxHeight=ul.dataset.originalMaxHeight;
ul.style.overflow='visible';
}});
const spanList=Array.from(block_element.getElementsByClassName('list-open') );
spanList.forEach(( ele)=> {
const handleToggle=()=> {
const ulElement=ele.parentElement.querySelector('ul');
if(! ulElement){
return;
}
const isExpanded=ele.getAttribute('aria-expanded')==='true';
ele.setAttribute('aria-expanded', ! isExpanded);
if(! isExpanded){
ulElement.classList.remove('uagb-toc__list--hidden-child');
}
setTimeout(()=> {
if(isExpanded){
ulElement.style.maxHeight='0px';
ulElement.style.overflow='hidden';
}else{
ulElement.style.maxHeight=ulElement.dataset.originalMaxHeight;
}
ele.classList.toggle('list-open', ! isExpanded);
ele.classList.toggle('list-collapsed', isExpanded);
ulElement.classList.toggle('uagb-toc__list--child-of-closed-list');
}, 0);
if(isExpanded){
setTimeout(()=> {
ulElement.classList.add('uagb-toc__list--hidden-child');
}, 300);
}};
ele.addEventListener('click', handleToggle);
ele.addEventListener('keydown',(event)=> {
if(event.key==='Enter'||event.key===' '){
event.preventDefault();
handleToggle(event);
}});
ele.setAttribute('aria-expanded', ele.classList.contains('list-open') );
});
if(attr?.initiallyCollapseList){
ulElements.forEach(( ul)=> {
const hasSiblingSpan=ul.parentElement.querySelector('span');
if(hasSiblingSpan){
ul.style.maxHeight='0px';
ul.style.overflow='hidden';
ul.classList.add('uagb-toc__list--child-of-closed-list');
setTimeout(()=> {
ul.classList.add('uagb-toc__list--hidden-child');
}, 300);
const spanElement=ul.parentElement.querySelector('.list-open');
if(spanElement){
spanElement.setAttribute('aria-expanded', 'false');
spanElement.classList.remove('list-open');
spanElement.classList.add('list-collapsed');
}}
});
}}
},
init(id, attr){
if(( attr?.makeCollapsible&&! attr?.initialCollapse)||! attr?.makeCollapsible){
UAGBTableOfContents._initCollapsableList(id, attr);
}
const document_element=UAGBTableOfContents._getDocumentElement();
if(document.querySelector('.uagb-toc__list')!==null){
document.querySelector('.uagb-toc__list').addEventListener('click',
UAGBTableOfContents._scroll
);
}
if(document.querySelector('.uagb-toc__scroll-top')!==null){
document.querySelector('.uagb-toc__scroll-top').addEventListener('click',
UAGBTableOfContents._scrollTop
);
}
if(attr?.makeCollapsible){
const elementToOpen=document_element.querySelector(id);
if(uagbTOCCollapseListener){
document_element.addEventListener('click', collapseListener);
uagbTOCCollapseListener=false;
}
function collapseListener(event){
const element=event.target;
const condition1=element?.tagName==='path'||element?.tagName==='svg'||element?.tagName==='DIV';
const condition2=element?.className==='uagb-toc__title'||element?.parentNode?.className==='uagb-toc__title'||element?.parentNode?.tagName==='svg';
if(condition1&&condition2){
const $root=element?.closest(`.wp-block-uagb-table-of-contents${id}`);
const tocListWrapEl=elementToOpen?.querySelector('.wp-block-uagb-table-of-contents .uagb-toc__list-wrap');
if(! tocListWrapEl){
return;
}
if($root?.classList?.contains('uagb-toc__collapse') ){
$root?.classList?.remove('uagb-toc__collapse');
UAGBTableOfContents._slideDown(tocListWrapEl,
500,
id,
attr
);
}else{
$root?.classList?.add('uagb-toc__collapse');
UAGBTableOfContents._slideUp(tocListWrapEl,
500
);
}}
}}
document.addEventListener('scroll',
UAGBTableOfContents._showHideScroll
);
},
_slideUp(target, duration){
target.style.transitionProperty='height, margin, padding';
target.style.transitionDuration=duration + 'ms';
target.style.boxSizing='border-box';
target.style.height=target.offsetHeight + 'px';
target.offsetHeight;
target.style.overflow='hidden';
target.style.height=0;
target.style.paddingTop=0;
target.style.paddingBottom=0;
target.style.marginTop=0;
target.style.marginBottom=0;
window.setTimeout(()=> {
target.style.display='none';
target.style.removeProperty('height');
target.style.removeProperty('padding-top');
target.style.removeProperty('padding-bottom');
target.style.removeProperty('margin-top');
target.style.removeProperty('margin-bottom');
target.style.removeProperty('overflow');
target.style.removeProperty('transition-duration');
target.style.removeProperty('transition-property');
}, duration);
},
_slideDown(target, duration, id, attr){
target.style?.removeProperty('display');
let display=window?.getComputedStyle(target).display;
if(display==='none') display='block';
target.style.display=display;
const height=target.offsetHeight;
target.style.overflow='hidden';
target.style.height=0;
target.style.paddingTop=0;
target.style.paddingBottom=0;
target.style.marginTop=0;
target.style.marginBottom=0;
target.offsetHeight;
target.style.boxSizing='border-box';
target.style.transitionProperty='height, margin, padding';
target.style.transitionDuration=duration + 'ms';
target.style.height=height + 'px';
target.style.removeProperty('padding-top');
target.style.removeProperty('padding-bottom');
target.style.removeProperty('margin-top');
target.style.removeProperty('margin-bottom');
window.setTimeout(()=> {
target.style.removeProperty('height');
target.style.removeProperty('overflow');
target.style.removeProperty('transition-duration');
target.style.removeProperty('transition-property');
UAGBTableOfContents._initCollapsableList(id, attr);
}, duration);
},
hyperLinks(){
const hash=window.location.hash.substring(0);
if(''===hash||/[^a-z0-9_-]$/.test(hash) ){
return;
}
function escapeSelector(selector){
return selector.replace(/([.#$+\^*[\](){}|\\])/g, '\\$1');
}
let hashId=encodeURI(hash.substring(0) );
hashId=escapeSelector(hash);
const selectedAnchor=document?.querySelector(hashId);
if(null===selectedAnchor){
return;
}
const node=document.querySelector('.wp-block-uagb-table-of-contents');
scrollOffset=node.getAttribute('data-offset');
const offset=document.querySelector(hash).offsetTop;
if(null!==offset){
scroll( {
top: offset - scrollOffset,
behavior: 'smooth',
});
}},
_showHideScroll(){
scrollElement=document.querySelector('.uagb-toc__scroll-top');
if(null!==scrollElement){
if(window.scrollY > 300){
if(scrolltoTop){
scrollElement.classList.add('uagb-toc__show-scroll');
}else{
scrollElement.classList.remove('uagb-toc__show-scroll');
}}else{
scrollElement.classList.remove('uagb-toc__show-scroll');
}}
},
_scrollTop(){
window.scrollTo({
top: 0,
behavior: 'smooth',
});
},
_scroll(e){
e.preventDefault();
let hash=e.target.getAttribute('href');
if(! hash&&e.target.tagName&&e.target.tagName!=='A'){
const getHash=e.target.closest('a');
if(getHash){
hash=getHash.getAttribute('href');
}}
if(hash){
const node=document.querySelector('.wp-block-uagb-table-of-contents');
scrollData=node.getAttribute('data-scroll');
scrollOffset=node.getAttribute('data-offset');
let offset=null;
hash=hash.substring(1);
if(document?.querySelector("[id='" + hash + "']") ){
offset=document.querySelector("[id='" + hash + "']" )?.getBoundingClientRect().top + window.scrollY;
}
if(scrollData){
if(null!==offset){
scroll( {
top: offset - scrollOffset,
behavior: 'smooth',
});
}}else{
scroll( {
top: offset,
behavior: 'auto',
});
}}
},
selectDomElement(id){
const thisScope=document.querySelector(`${ id }:not(.script-init)`);
if(! thisScope){
return null;
}
thisScope.classList.add('script-init');
return thisScope;
},
parseTocSlug(slug){
if(! slug){
return slug;
}
const parsedSlug=slug
.toString()
.toLowerCase()
.replace(/\…+/g, '')
.replace(/\u2013|\u2014/g, '')
.replace(/&(amp;)/g, '')
.replace(/[&]nbsp[;]/gi, '-')
.replace(/[^a-zA-Z0-9\u00C0-\u017F _-]/g, '')
.replace(/&(mdash;)/g, '')
.replace(/\s+/g, '-')
.replace(/[&\/\\#,^!+()$~%.\[\]'":*?;-_<>{}@‘’”“|]/g, '')
.replace(/\-\-+/g, '-')
.replace(/^-+/, '')
.replace(/-+$/, '');
return decodeURI(encodeURIComponent(parsedSlug) );
},
mapTocAnchorsForHref(anchors){
for(const anchor of anchors){
const href=anchor.textContent;
const parsedHref=UAGBTableOfContents.parseTocSlug(href);
anchor.setAttribute('href', `#${parsedHref}`);
}},
_run(attr, id){
setTimeout(function (){
UAGBTableOfContents._runWithTimeOut(attr, id);
}, 500);
},
_runWithTimeOut(attr, id){
const $thisScope=UAGBTableOfContents.selectDomElement(id);
if(! $thisScope){
return;
}
if($thisScope.querySelector('.uag-toc__collapsible-wrap')!==null){
if($thisScope.querySelector('.uag-toc__collapsible-wrap').length > 0){
$thisScope.querySelector('.uagb-toc__title-wrap').classList.add('uagb-toc__is-collapsible');
}}
const allowedHTags=[];
let allowedHTagStr;
if(undefined!==attr.mappingHeaders){
attr.mappingHeaders.forEach(function(h_tag, index){
h_tag===true ? allowedHTags.push('h' +(index + 1) ):null;
});
allowedHTagStr=null!==allowedHTags ? allowedHTags.join(','):'';
}
const allHeader =
undefined!==allowedHTagStr&&''!==allowedHTagStr
? document.body.querySelectorAll(allowedHTagStr)
: document.body.querySelectorAll('h1, h2, h3, h4, h5, h6');
if(0!==allHeader.length){
const tocListWrap=$thisScope.querySelector('.uagb-toc__list-wrap');
if(! tocListWrap){
return;
}
const divsArr=Array.from(allHeader);
const aTags=tocListWrap.getElementsByTagName('a');
UAGBTableOfContents.mapTocAnchorsForHref(aTags);
const ArrayOfDuplicateElements=function(headingArray=[]){
const arrayWithDuplicateEntries=[];
headingArray.reduce(( temporaryArray, currentVal)=> {
if(! temporaryArray.some(( item)=> item.innerText===currentVal.innerText) ){
temporaryArray.push(currentVal);
}else{
arrayWithDuplicateEntries.push(currentVal);
}
return temporaryArray;
}, []);
return arrayWithDuplicateEntries;
};
const duplicateHeadings=ArrayOfDuplicateElements(divsArr);
for(let i=0; i < divsArr.length; i++){
let headerText=UAGBTableOfContents.parseTocSlug(divsArr[ i ].innerText);
if(''!==divsArr[ i ].innerText){
if(headerText.length < 1){
const searchText=divsArr[ i ].innerText;
for(let j=0; j < aTags.length; j++){
if(aTags[ j ].textContent===searchText){
const randomID='#toc_' + Math.random();
aTags[ j ].setAttribute('href', randomID);
headerText=randomID.substring(1);
}}
}}
const span=document.createElement('span');
span.id=headerText;
span.className='uag-toc__heading-anchor';
divsArr[ i ].prepend(span);
for(let k=0; k < duplicateHeadings.length; k++){
const randomID='#toc_' + Math.random();
duplicateHeadings[ k ]
?.querySelector('.uag-toc__heading-anchor')
?.setAttribute('id', randomID.substring(1) );
const anchorElements=Array.from(tocListWrap.getElementsByTagName('a') );
const duplicateHeadingsInTOC=ArrayOfDuplicateElements(anchorElements);
for(let l=0; l < duplicateHeadingsInTOC.length; l++){
duplicateHeadingsInTOC[ k ]?.setAttribute('href', randomID);
}}
}}
scrolltoTop=attr.scrollToTop;
const scrollToTopSvg =
'<svg xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="26px" height="16.043px" viewBox="57 35.171 26 16.043" enable-background="new 57 35.171 26 16.043" xml:space="preserve"><path d="M57.5,38.193l12.5,12.5l12.5-12.5l-2.5-2.5l-10,10l-10-10L57.5,38.193z"/></svg>';
scrollElement=document.querySelector('.uagb-toc__scroll-top');
if(scrollElement===null){
const scrollToTopDiv=document.createElement('div');
scrollToTopDiv.classList.add('uagb-toc__scroll-top');
scrollToTopDiv.innerHTML=scrollToTopSvg;
document.body.appendChild(scrollToTopDiv);
}
if(scrollElement!==null){
scrollElement.classList.add('uagb-toc__show-scroll');
}
UAGBTableOfContents._showHideScroll();
UAGBTableOfContents.hyperLinks();
UAGBTableOfContents.init(id, attr);
},
};
document.addEventListener("DOMContentLoaded", function(){ window.addEventListener('load', function(){
UAGBButtonChild.init('.uagb-block-53b340de');
});
window.addEventListener('load', function(){
UAGBButtonChild.init('.uagb-block-xnyrdpup');
});
window.addEventListener('load', function(){
UAGBButtonChild.init('.uagb-block-19da190f');
});
window.addEventListener('load', function(){
UAGBButtonChild.init('.uagb-block-o1wgol0c');
});
window.addEventListener('load', function(){
UAGBTableOfContents._run({"mappingHeaders":[false,true,false,false,false,false],"scrollToTop":false,"makeCollapsible":false,"enableCollapsableList":false,"initialCollapse":false,"markerView":"disc","isFrontend":true,"initiallyCollapseList":false}, '.uagb-block-5ea66dbd');
});
});
!function(e){var t=!0,a={swing:"cubic-bezier(.02, .01, .47, 1)",linear:"linear",easeInQuad:"cubic-bezier(0.11, 0, 0.5, 0)",easeOutQuad:"cubic-bezier(0.5, 1, 0.89, 1)",easeInOutQuad:"cubic-bezier(0.45, 0, 0.55, 1)",easeInCubic:"cubic-bezier(0.32, 0, 0.67, 0)",easeOutCubic:"cubic-bezier(0.33, 1, 0.68, 1)",easeInOutCubic:"cubic-bezier(0.65, 0, 0.35, 1)",easeInQuart:"cubic-bezier(0.5, 0, 0.75, 0)",easeOutQuart:"cubic-bezier(0.25, 1, 0.5, 1)",easeInOutQuart:"cubic-bezier(0.76, 0, 0.24, 1)",easeInQuint:"cubic-bezier(0.64, 0, 0.78, 0)",easeOutQuint:"cubic-bezier(0.22, 1, 0.36, 1)",easeInOutQuint:"cubic-bezier(0.83, 0, 0.17, 1)",easeInSine:"cubic-bezier(0.12, 0, 0.39, 0)",easeOutSine:"cubic-bezier(0.61, 1, 0.88, 1)",easeInOutSine:"cubic-bezier(0.37, 0, 0.63, 1)",easeInExpo:"cubic-bezier(0.7, 0, 0.84, 0)",easeOutExpo:"cubic-bezier(0.16, 1, 0.3, 1)",easeInOutExpo:"cubic-bezier(0.87, 0, 0.13, 1)",easeInCirc:"cubic-bezier(0.55, 0, 1, 0.45)",easeOutCirc:"cubic-bezier(0, 0.55, 0.45, 1)",easeInOutCirc:"cubic-bezier(0.85, 0, 0.15, 1)",easeInBack:"cubic-bezier(0.36, 0, 0.66, -0.56)",easeOutBack:"cubic-bezier(0.34, 1.56, 0.64, 1)",easeInOutBack:"cubic-bezier(0.68, -0.6, 0.32, 1.6)"};a.jswing=a.swing,e.flexslider=function(i,n){var s=e(i);"undefined"==typeof n.rtl&&"rtl"==e("html").attr("dir")&&(n.rtl=!0),s.vars=e.extend({},e.flexslider.defaults,n);var r,o=s.vars.namespace,l=("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&s.vars.touch,c="click touchend keyup flexslider-click",u="",d=a[s.vars.easing]||"ease",v="vertical"===s.vars.direction,p=s.vars.reverse,m=s.vars.itemWidth>0,f="fade"===s.vars.animation,h=""!==s.vars.asNavFor,g={};e.data(i,"flexslider",s),g={init:function(){s.animating=!1,s.currentSlide=parseInt(s.vars.startAt?s.vars.startAt:0,10),isNaN(s.currentSlide)&&(s.currentSlide=0),s.animatingTo=s.currentSlide,s.atEnd=0===s.currentSlide||s.currentSlide===s.last,s.containerSelector=s.vars.selector.substr(0,s.vars.selector.search(" ")),s.slides=e(s.vars.selector,s),s.container=e(s.containerSelector,s),s.count=s.slides.length,s.syncExists=e(s.vars.sync).length>0,"slide"===s.vars.animation&&(s.vars.animation="swing"),s.prop=v?"top":s.vars.rtl?"marginRight":"marginLeft",s.args={},s.manualPause=!1,s.stopped=!1,s.started=!1,s.startTimeout=null,s.transforms=s.transitions=!s.vars.video&&!f&&s.vars.useCSS,s.transforms&&(s.prop="transform"),s.isFirefox=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,s.ensureAnimationEnd="",""!==s.vars.controlsContainer&&(s.controlsContainer=e(s.vars.controlsContainer).length>0&&e(s.vars.controlsContainer)),""!==s.vars.manualControls&&(s.manualControls=e(s.vars.manualControls).length>0&&e(s.vars.manualControls)),""!==s.vars.customDirectionNav&&(s.customDirectionNav=2===e(s.vars.customDirectionNav).length&&e(s.vars.customDirectionNav)),s.vars.randomize&&(s.slides.sort(function(){return Math.round(Math.random())-.5}),s.container.empty().append(s.slides)),s.doMath(),s.setup("init"),s.vars.controlNav&&g.controlNav.setup(),s.vars.directionNav&&g.directionNav.setup(),s.vars.keyboard&&(1===e(s.containerSelector).length||s.vars.multipleKeyboard)&&e(document).on("keyup",function(e){var t=e.keyCode;if(!s.animating&&(39===t||37===t)){var a=s.vars.rtl?37===t?s.getTarget("next"):39===t&&s.getTarget("prev"):39===t?s.getTarget("next"):37===t&&s.getTarget("prev");s.flexAnimate(a,s.vars.pauseOnAction)}}),s.vars.mousewheel&&s.on("mousewheel",function(e,t,a,i){e.preventDefault();var n=t<0?s.getTarget("next"):s.getTarget("prev");s.flexAnimate(n,s.vars.pauseOnAction)}),s.vars.pausePlay&&g.pausePlay.setup(),s.vars.slideshow&&s.vars.pauseInvisible&&g.pauseInvisible(),s.vars.slideshow&&(s.vars.pauseOnHover&&s.on("mouseenter",function(){s.manualPlay||s.manualPause||s.pause()}).on("mouseleave",function(){s.manualPause||s.manualPlay||s.stopped||s.play()}),s.vars.pauseInvisible&&"visible"!==document.visibilityState||(s.vars.initDelay>0?s.startTimeout=setTimeout(s.play,s.vars.initDelay):s.play())),h&&g.asNav.setup(),l&&s.vars.touch&&g.touch(),(!f||f&&s.vars.smoothHeight)&&e(window).on("resize orientationchange focus",g.resize),s.find("img").attr("draggable","false"),setTimeout(function(){s.vars.start(s)},200)},asNav:{setup:function(){s.asNav=!0,s.animatingTo=Math.floor(s.currentSlide/s.move),s.currentItem=s.currentSlide,s.slides.removeClass(o+"active-slide").eq(s.currentItem).addClass(o+"active-slide"),s.slides.on(c,function(t){t.preventDefault();var a=e(this),i=a.index();(s.vars.rtl?-1*(a.offset().right-e(s).scrollLeft()):a.offset().left-e(s).scrollLeft())<=0&&a.hasClass(o+"active-slide")?s.flexAnimate(s.getTarget("prev"),!0):e(s.vars.asNavFor).data("flexslider").animating||a.hasClass(o+"active-slide")||(s.direction=s.currentItem<i?"next":"prev",s.flexAnimate(i,s.vars.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){s.manualControls?g.controlNav.setupManual():g.controlNav.setupPaging()},setupPaging:function(){var t,a,i="thumbnails"===s.vars.controlNav?"control-thumbs":"control-paging",n=1;if(s.controlNavScaffold=e('<ol class="'+o+"control-nav "+o+i+'"></ol>'),s.pagingCount>1)for(var r=0;r<s.pagingCount;r++){if(a=s.slides.eq(r),undefined===a.attr("data-thumb-alt")&&a.attr("data-thumb-alt",""),t=e("<a></a>").attr("href","#").text(n),"thumbnails"===s.vars.controlNav&&(t=e("<img/>",{onload:"this.width=this.naturalWidth; this.height=this.naturalHeight",src:a.attr("data-thumb"),srcset:a.attr("data-thumb-srcset"),sizes:a.attr("data-thumb-sizes"),alt:a.attr("alt")})),""!==a.attr("data-thumb-alt")&&t.attr("alt",a.attr("data-thumb-alt")),"thumbnails"===s.vars.controlNav&&!0===s.vars.thumbCaptions){var l=a.attr("data-thumbcaption");if(""!==l&&undefined!==l){var d=e("<span></span>").addClass(o+"caption").text(l);t.append(d)}}var v=e("<li>");t.appendTo(v),v.append("</li>"),s.controlNavScaffold.append(v),n++}s.controlsContainer?e(s.controlsContainer).append(s.controlNavScaffold):s.append(s.controlNavScaffold),g.controlNav.set(),g.controlNav.active(),s.controlNavScaffold.on(c,"a, img",function(t){if(t.preventDefault(),""===u||u===t.type||"flexslider-click"===t.type){var a=e(this),i=s.controlNav.index(a);a.hasClass(o+"active")||(s.direction=i>s.currentSlide?"next":"prev",s.flexAnimate(i,s.vars.pauseOnAction))}""===u&&"flexslider-click"!==t.type&&(u=t.type),g.setToClearWatchedEvent()})},setupManual:function(){s.controlNav=s.manualControls,g.controlNav.active(),s.controlNav.on(c,function(t){if(t.preventDefault(),""===u||u===t.type||"flexslider-click"===t.type){var a=e(this),i=s.controlNav.index(a);a.hasClass(o+"active")||(i>s.currentSlide?s.direction="next":s.direction="prev",s.flexAnimate(i,s.vars.pauseOnAction))}""===u&&"flexslider-click"!==t.type&&(u=t.type),g.setToClearWatchedEvent()})},set:function(){var t="thumbnails"===s.vars.controlNav?"img":"a";s.controlNav=e("."+o+"control-nav li "+t,s.controlsContainer?s.controlsContainer:s)},active:function(){s.controlNav.removeClass(o+"active").eq(s.animatingTo).addClass(o+"active")},update:function(t,a){s.pagingCount>1&&"add"===t?s.controlNavScaffold.append(e('<li><a href="#">'+s.count+"</a></li>")):1===s.pagingCount?s.controlNavScaffold.find("li").remove():s.controlNav.eq(a).closest("li").remove(),g.controlNav.set(),s.pagingCount>1&&s.pagingCount!==s.controlNav.length?s.update(a,t):g.controlNav.active()}},directionNav:{setup:function(){var t=e('<ul class="'+o+'direction-nav"><li class="'+o+'nav-prev"><a class="'+o+'prev" href="#">'+s.vars.prevText+'</a></li><li class="'+o+'nav-next"><a class="'+o+'next" href="#">'+s.vars.nextText+"</a></li></ul>");s.customDirectionNav?s.directionNav=s.customDirectionNav:s.controlsContainer?(e(s.controlsContainer).append(t),s.directionNav=e("."+o+"direction-nav li a",s.controlsContainer)):(s.append(t),s.directionNav=e("."+o+"direction-nav li a",s)),g.directionNav.update(),s.directionNav.on(c,function(t){var a;t.preventDefault(),""!==u&&u!==t.type&&"flexslider-click"!==t.type||(a=e(this).hasClass(o+"next")?s.getTarget("next"):s.getTarget("prev"),s.flexAnimate(a,s.vars.pauseOnAction)),""===u&&"flexslider-click"!==t.type&&(u=t.type),g.setToClearWatchedEvent()})},update:function(){var e=o+"disabled";1===s.pagingCount?s.directionNav.addClass(e).attr("tabindex","-1"):s.vars.animationLoop?s.directionNav.removeClass(e).prop("tabindex","-1"):0===s.animatingTo?s.directionNav.removeClass(e).filter("."+o+"prev").addClass(e).attr("tabindex","-1"):s.animatingTo===s.last?s.directionNav.removeClass(e).filter("."+o+"next").addClass(e).attr("tabindex","-1"):s.directionNav.removeClass(e).prop("tabindex","-1")}},pausePlay:{setup:function(){var t=e('<div class="'+o+'pauseplay"><a href="#"></a></div>');s.controlsContainer?(s.controlsContainer.append(t),s.pausePlay=e("."+o+"pauseplay a",s.controlsContainer)):(s.append(t),s.pausePlay=e("."+o+"pauseplay a",s)),g.pausePlay.update(s.vars.slideshow?o+"pause":o+"play"),s.pausePlay.on(c,function(t){t.preventDefault(),""!==u&&u!==t.type&&"flexslider-click"!==t.type||(e(this).hasClass(o+"pause")?(s.manualPause=!0,s.manualPlay=!1,s.pause()):(s.manualPause=!1,s.manualPlay=!0,s.play())),""===u&&"flexslider-click"!==t.type&&(u=t.type),g.setToClearWatchedEvent()})},update:function(e){"play"===e?s.pausePlay.removeClass(o+"pause").addClass(o+"play").html(s.vars.playText):s.pausePlay.removeClass(o+"play").addClass(o+"pause").html(s.vars.pauseText)}},touch:function(){var e,t,a,n,r,o,l,c,u,d=!1,h=0,g=0;l=function(r){s.animating?r.preventDefault():1===r.touches.length&&(s.pause(),n=v?s.h:s.w,o=Number(new Date),h=r.touches[0].pageX,g=r.touches[0].pageY,a=m&&p&&s.animatingTo===s.last?0:m&&p?s.limit-(s.itemW+s.vars.itemMargin)*s.move*s.animatingTo:m&&s.currentSlide===s.last?s.limit:m?(s.itemW+s.vars.itemMargin)*s.move*s.currentSlide:p?(s.last-s.currentSlide+s.cloneOffset)*n:(s.currentSlide+s.cloneOffset)*n,e=v?g:h,t=v?h:g,i.addEventListener("touchmove",c,!1),i.addEventListener("touchend",u,!1))},c=function(i){h=i.touches[0].pageX,g=i.touches[0].pageY,r=v?e-g:(s.vars.rtl?-1:1)*(e-h);(!(d=v?Math.abs(r)<Math.abs(h-t):Math.abs(r)<Math.abs(g-t))||Number(new Date)-o>500)&&(i.preventDefault(),f||(s.vars.animationLoop||(r/=0===s.currentSlide&&r<0||s.currentSlide===s.last&&r>0?Math.abs(r)/n+2:1),s.setProps(a+r,"setTouch")))},u=function(l){if(i.removeEventListener("touchmove",c,!1),s.animatingTo===s.currentSlide&&!d&&null!==r){var v=p?-r:r,m=v>0?s.getTarget("next"):s.getTarget("prev");s.canAdvance(m)&&(Number(new Date)-o<550&&Math.abs(v)>50||Math.abs(v)>n/2)?s.flexAnimate(m,s.vars.pauseOnAction):f||s.flexAnimate(s.currentSlide,s.vars.pauseOnAction,!0)}i.removeEventListener("touchend",u,!1),e=null,t=null,r=null,a=null},i.addEventListener("touchstart",l,!1)},resize:function(){!s.animating&&s.is(":visible")&&(m||s.doMath(),f?g.smoothHeight():m?(s.slides.width(s.computedW),s.update(s.pagingCount),s.setProps()):v?(s.viewport.height(s.h),s.setProps(s.h,"setTotal")):(s.setProps(s.computedW,"setTotal"),s.newSlides.width(s.computedW),s.vars.smoothHeight&&g.smoothHeight()))},smoothHeight:function(e){v&&!f||(f?s:s.viewport).css({height:s.slides.eq(s.animatingTo).innerHeight(),transition:e?"height "+e+"ms":"none"})},sync:function(t){var a=e(s.vars.sync).data("flexslider"),i=s.animatingTo;switch(t){case"animate":a.flexAnimate(i,s.vars.pauseOnAction,!1,!0);break;case"play":a.playing||a.asNav||a.play();break;case"pause":a.pause()}},uniqueID:function(t){return t.filter("[id]").add(t.find("[id]")).each(function(){var t=e(this);t.attr("id",t.attr("id")+"_clone")}),t},pauseInvisible:function(){document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState?s.startTimeout?clearTimeout(s.startTimeout):s.pause():s.started?s.play():s.vars.initDelay>0?setTimeout(s.play,s.vars.initDelay):s.play()})},setToClearWatchedEvent:function(){clearTimeout(r),r=setTimeout(function(){u=""},3e3)}},s.flexAnimate=function(t,a,i,n,r){if(s.vars.animationLoop||t===s.currentSlide||(s.direction=t>s.currentSlide?"next":"prev"),h&&1===s.pagingCount&&(s.direction=s.currentItem<t?"next":"prev"),!s.animating&&(s.canAdvance(t,r)||i)&&s.is(":visible")){if(h&&n){var c=e(s.vars.asNavFor).data("flexslider");if(s.atEnd=0===t||t===s.count-1,c.flexAnimate(t,!0,!1,!0,r),s.direction=s.currentItem<t?"next":"prev",c.direction=s.direction,Math.ceil((t+1)/s.visible)-1===s.currentSlide||0===t)return s.currentItem=t,s.slides.removeClass(o+"active-slide").eq(t).addClass(o+"active-slide"),!1;s.currentItem=t,s.slides.removeClass(o+"active-slide").eq(t).addClass(o+"active-slide"),t=Math.floor(t/s.visible)}if(s.animating=!0,s.animatingTo=t,a&&s.pause(),s.vars.before(s),s.syncExists&&!r&&g.sync("animate"),s.vars.controlNav&&g.controlNav.active(),m||s.slides.removeClass(o+"active-slide").eq(t).addClass(o+"active-slide"),s.atEnd=0===t||t===s.last,s.vars.directionNav&&g.directionNav.update(),t===s.last&&(s.vars.end(s),s.vars.animationLoop||s.pause()),f)l||(s.slides.eq(s.currentSlide).off("transitionend"),s.slides.eq(t).off("transitionend").on("transitionend",s.wrapup)),s.slides.eq(s.currentSlide).css({opacity:0,zIndex:1}),s.slides.eq(t).css({opacity:1,zIndex:2}),l&&s.wrapup(y);else{var u,d,b,y=v?s.slides.filter(":first").height():s.computedW;m?(u=s.vars.itemMargin,d=(b=(s.itemW+u)*s.move*s.animatingTo)>s.limit&&1!==s.visible?s.limit:b):d=0===s.currentSlide&&t===s.count-1&&s.vars.animationLoop&&"next"!==s.direction?p?(s.count+s.cloneOffset)*y:0:s.currentSlide===s.last&&0===t&&s.vars.animationLoop&&"prev"!==s.direction?p?0:(s.count+1)*y:p?(s.count-1-t+s.cloneOffset)*y:(t+s.cloneOffset)*y,s.setProps(d,"",s.vars.animationSpeed),s.vars.animationLoop&&s.atEnd||(s.animating=!1,s.currentSlide=s.animatingTo),s.container.off("transitionend"),s.container.on("transitionend",function(){clearTimeout(s.ensureAnimationEnd),s.wrapup(y)}),clearTimeout(s.ensureAnimationEnd),s.ensureAnimationEnd=setTimeout(function(){s.wrapup(y)},s.vars.animationSpeed+100)}s.vars.smoothHeight&&g.smoothHeight(s.vars.animationSpeed)}},s.wrapup=function(e){f||m||(0===s.currentSlide&&s.animatingTo===s.last&&s.vars.animationLoop?s.setProps(e,"jumpEnd"):s.currentSlide===s.last&&0===s.animatingTo&&s.vars.animationLoop&&s.setProps(e,"jumpStart")),s.animating=!1,s.currentSlide=s.animatingTo,s.vars.after(s)},s.animateSlides=function(){!s.animating&&t&&s.flexAnimate(s.getTarget("next"))},s.pause=function(){clearInterval(s.animatedSlides),s.animatedSlides=null,s.playing=!1,s.vars.pausePlay&&g.pausePlay.update("play"),s.syncExists&&g.sync("pause")},s.play=function(){s.playing&&clearInterval(s.animatedSlides),s.animatedSlides=s.animatedSlides||setInterval(s.animateSlides,s.vars.slideshowSpeed),s.started=s.playing=!0,s.vars.pausePlay&&g.pausePlay.update("pause"),s.syncExists&&g.sync("play")},s.stop=function(){s.pause(),s.stopped=!0},s.canAdvance=function(e,t){var a=h?s.pagingCount-1:s.last;return!!t||(!(!h||s.currentItem!==s.count-1||0!==e||"prev"!==s.direction)||(!h||0!==s.currentItem||e!==s.pagingCount-1||"next"===s.direction)&&(!(e===s.currentSlide&&!h)&&(!!s.vars.animationLoop||(!s.atEnd||0!==s.currentSlide||e!==a||"next"===s.direction)&&(!s.atEnd||s.currentSlide!==a||0!==e||"next"!==s.direction))))},s.getTarget=function(e){return s.direction=e,"next"===e?s.currentSlide===s.last?0:s.currentSlide+1:0===s.currentSlide?s.last:s.currentSlide-1},s.setProps=function(e,t,a){var i,n=(i=e||(s.itemW+s.vars.itemMargin)*s.move*s.animatingTo,function(){if(m)return"setTouch"===t?e:p&&s.animatingTo===s.last?0:p?s.limit-(s.itemW+s.vars.itemMargin)*s.move*s.animatingTo:s.animatingTo===s.last?s.limit:i;switch(t){case"setTotal":return p?(s.count-1-s.currentSlide+s.cloneOffset)*e:(s.currentSlide+s.cloneOffset)*e;case"setTouch":return e;case"jumpEnd":return p?e:s.count*e;case"jumpStart":return p?s.count*e:e;default:return e}}()*(s.vars.rtl?1:-1)+"px");a=a!==undefined?a/1e3+"s":"0s",s.container.css("transition-duration",a),s.transforms?n=v?"translate3d(0,"+n+",0)":"translate3d("+parseInt(n)+"px,0,0)":s.container.css("transition-timing-function",d),s.args[s.prop]=n,s.container.css(s.args)},s.setup=function(t){var a,i;f?(s.vars.rtl?s.slides.css({width:"100%",float:"right",marginLeft:"-100%",position:"relative"}):s.slides.css({width:"100%",float:"left",marginRight:"-100%",position:"relative"}),"init"===t&&(l?s.slides.css({opacity:0,display:"block",transition:"opacity "+s.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(s.currentSlide).css({opacity:1,zIndex:2}):(0==s.vars.fadeFirstSlide?(s.slides.css({opacity:0,display:"block",zIndex:1}).eq(s.currentSlide).css({opacity:1,zIndex:2}),s.slides.outerWidth()):(s.slides.css({opacity:0,display:"block",zIndex:1}).outerWidth(),s.slides.eq(s.currentSlide).css({opacity:1,zIndex:2})),s.slides.css({transition:"opacity "+s.vars.animationSpeed/1e3+"s "+d}))),s.vars.smoothHeight&&g.smoothHeight()):("init"===t&&(s.viewport=e('<div class="'+o+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(s).append(s.container),s.cloneCount=0,s.cloneOffset=0,p&&(i=e.makeArray(s.slides).reverse(),s.slides=e(i),s.container.empty().append(s.slides))),s.vars.animationLoop&&!m&&(s.cloneCount=2,s.cloneOffset=1,"init"!==t&&s.container.find(".clone").remove(),s.container.append(g.uniqueID(s.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(g.uniqueID(s.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),s.newSlides=e(s.vars.selector,s),a=p?s.count-1-s.currentSlide+s.cloneOffset:s.currentSlide+s.cloneOffset,v&&!m?(s.container.height(200*(s.count+s.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){s.newSlides.css({display:"block"}),s.doMath(),s.viewport.height(s.h),s.setProps(a*s.h,"init")},"init"===t?100:0)):(s.container.width(200*(s.count+s.cloneCount)+"%"),s.setProps(a*s.computedW,"init"),setTimeout(function(){s.doMath(),s.vars.rtl?s.newSlides.css({width:s.computedW,marginRight:s.computedM,float:"right",display:"block"}):s.newSlides.css({width:s.computedW,marginRight:s.computedM,float:"left",display:"block"}),s.vars.smoothHeight&&g.smoothHeight()},"init"===t?100:0)));m||s.slides.removeClass(o+"active-slide").eq(s.currentSlide).addClass(o+"active-slide"),s.vars.init(s)},s.doMath=function(){var e=s.slides.first(),t=s.vars.itemMargin,a=s.vars.minItems,i=s.vars.maxItems;s.w=s.viewport===undefined?s.width():s.viewport.width(),s.isFirefox&&(s.w=s.width()),s.h=e.height(),s.boxPadding=e.outerWidth()-e.width(),m?(s.itemT=s.vars.itemWidth+t,s.itemM=t,s.minW=a?a*s.itemT:s.w,s.maxW=i?i*s.itemT-t:s.w,s.itemW=s.minW>s.w?(s.w-t*(a-1))/a:s.maxW<s.w?(s.w-t*(i-1))/i:s.vars.itemWidth>s.w?s.w:s.vars.itemWidth,s.visible=Math.floor(s.w/s.itemW),s.move=s.vars.move>0&&s.vars.move<s.visible?s.vars.move:s.visible,s.pagingCount=Math.ceil((s.count-s.visible)/s.move+1),s.last=s.pagingCount-1,s.limit=1===s.pagingCount?0:s.vars.itemWidth>s.w?s.itemW*(s.count-1)+t*(s.count-1):(s.itemW+t)*s.count-s.w-t):(s.itemW=s.w,s.itemM=t,s.pagingCount=s.count,s.last=s.count-1),s.computedW=s.itemW-s.boxPadding,s.computedM=s.itemM},s.update=function(e,t){s.doMath(),m||(e<s.currentSlide?s.currentSlide+=1:e<=s.currentSlide&&0!==e&&(s.currentSlide-=1),s.animatingTo=s.currentSlide),s.vars.controlNav&&!s.manualControls&&("add"===t&&!m||s.pagingCount>s.controlNav.length?g.controlNav.update("add"):("remove"===t&&!m||s.pagingCount<s.controlNav.length)&&(m&&s.currentSlide>s.last&&(s.currentSlide-=1,s.animatingTo-=1),g.controlNav.update("remove",s.last))),s.vars.directionNav&&g.directionNav.update()},s.addSlide=function(t,a){var i=e(t);s.count+=1,s.last=s.count-1,v&&p?a!==undefined?s.slides.eq(s.count-a).after(i):s.container.prepend(i):a!==undefined?s.slides.eq(a).before(i):s.container.append(i),s.update(a,"add"),s.slides=e(s.vars.selector+":not(.clone)",s),s.setup(),s.vars.added(s)},s.removeSlide=function(t){var a=isNaN(t)?s.slides.index(e(t)):t;s.count-=1,s.last=s.count-1,isNaN(t)?e(t,s.slides).remove():v&&p?s.slides.eq(s.last).remove():s.slides.eq(t).remove(),s.doMath(),s.update(a,"remove"),s.slides=e(s.vars.selector+":not(.clone)",s),s.setup(),s.vars.removed(s)},g.init()},e(window).on("blur",function(e){t=!1}).on("focus",function(e){t=!0}),e.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,fadeFirstSlide:!0,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",customDirectionNav:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,isFirefox:!1,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){},init:function(){},rtl:!1},e.fn.flexslider=function(t){if(t===undefined&&(t={}),"object"==typeof t)return this.each(function(){var a=e(this),i=t.selector?t.selector:".slides > li",n=a.find(i);if(1===n.length&&!1===t.allowOneSlide||0===n.length){n.length&&n[0].animate([{opacity:0},{opacity:1}],400),t.start&&t.start(a)}else a.data("flexslider")===undefined&&new e.flexslider(this,t)});var a=e(this).data("flexslider");switch(t){case"play":a.play();break;case"pause":a.pause();break;case"stop":a.stop();break;case"next":a.flexAnimate(a.getTarget("next"),!0);break;case"prev":case"previous":a.flexAnimate(a.getTarget("prev"),!0);break;default:"number"==typeof t&&a.flexAnimate(t,!0)}}}(jQuery);