(()=>{"use strict";const e=window.wp.i18n,t=e=>Math.abs(parseInt(e,10)),a=(e,t,a)=>{const n=new CustomEvent(`wpcf7${t}`,{bubbles:!0,detail:a});"string"==typeof e&&(e=document.querySelector(e)),e.dispatchEvent(n)},n=(e,t)=>{const n=new Map([["init","init"],["validation_failed","invalid"],["acceptance_missing","unaccepted"],["spam","spam"],["aborted","aborted"],["mail_sent","sent"],["mail_failed","failed"],["submitting","submitting"],["resetting","resetting"],["validating","validating"],["payment_required","payment-required"]]);n.has(t)&&(t=n.get(t)),Array.from(n.values()).includes(t)||(t=`custom-${t=(t=t.replace(/[^0-9a-z]+/i," ").trim()).replace(/\s+/,"-")}`);const r=e.getAttribute("data-status");if(e.wpcf7.status=t,e.setAttribute("data-status",t),e.classList.add(t),r&&r!==t){e.classList.remove(r);const t={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,prevStatus:r};a(e,"statuschanged",t)}return t},r=e=>{const{root:t,namespace:a="contact-form-7/v1"}=wpcf7.api;return c.reduceRight(((e,t)=>a=>t(a,e)),(e=>{let n,r,{url:c,path:o,endpoint:s,headers:i,body:l,data:p,...d}=e;"string"==typeof s&&(n=a.replace(/^\/|\/$/g,""),r=s.replace(/^\//,""),o=r?n+"/"+r:n),"string"==typeof o&&(-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),c=t+o),i={Accept:"application/json, */*;q=0.1",...i},delete i["X-WP-Nonce"],p&&(l=JSON.stringify(p),i["Content-Type"]="application/json");const f={code:"fetch_error",message:"You are probably offline."},u={code:"invalid_json",message:"The response is not a valid JSON response."};return window.fetch(c||o||window.location.href,{...d,headers:i,body:l}).then((e=>Promise.resolve(e).then((e=>{if(e.status>=200&&e.status<300)return e;throw e})).then((e=>{if(204===e.status)return null;if(e&&e.json)return e.json().catch((()=>{throw u}));throw u}))),(()=>{throw f}))}))(e)},c=[];function o(e,t={}){const{target:a,scope:r=e,...c}=t;if(void 0===e.wpcf7?.schema)return;const o={...e.wpcf7.schema};if(void 0!==a){if(!e.contains(a))return;if(!a.closest(".wpcf7-form-control-wrap[data-name]"))return;if(a.closest(".novalidate"))return}const p=r.querySelectorAll(".wpcf7-form-control-wrap"),d=Array.from(p).reduce(((e,t)=>(t.closest(".novalidate")||t.querySelectorAll(":where(input, textarea, select):enabled").forEach((t=>{if(t.name)switch(t.type){case"button":case"image":case"reset":case"submit":break;case"checkbox":case"radio":t.checked&&e.append(t.name,t.value);break;case"select-multiple":for(const a of t.selectedOptions)e.append(t.name,a.value);break;case"file":for(const a of t.files)e.append(t.name,a);break;default:e.append(t.name,t.value)}})),e)),new FormData),f=e.getAttribute("data-status");Promise.resolve(n(e,"validating")).then((n=>{if(void 0!==swv){const n=swv.validate(o,d,t);for(const t of p){if(void 0===t.dataset.name)continue;const c=t.dataset.name;if(n.has(c)){const{error:t,validInputs:a}=n.get(c);i(e,c),void 0!==t&&s(e,c,t,{scope:r}),l(e,c,null!=a?a:[])}if(t.contains(a))break}}})).finally((()=>{n(e,f)}))}r.use=e=>{c.unshift(e)};const s=(e,t,a,n)=>{const{scope:r=e,...c}=null!=n?n:{},o=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,""),s=e.querySelector(`.wpcf7-form-control-wrap[data-name="${t}"] .wpcf7-form-control`);(()=>{const t=document.createElement("li");t.setAttribute("id",o),s&&s.id?t.insertAdjacentHTML("beforeend",`<a href="#${s.id}">${a}</a>`):t.insertAdjacentText("beforeend",a),e.wpcf7.parent.querySelector(".screen-reader-response ul").appendChild(t)})(),r.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{const t=document.createElement("span");t.classList.add("wpcf7-not-valid-tip"),t.setAttribute("aria-hidden","true"),t.insertAdjacentText("beforeend",a),e.appendChild(t),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","true")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.classList.add("wpcf7-not-valid"),e.setAttribute("aria-describedby",o),"function"==typeof e.setCustomValidity&&e.setCustomValidity(a),e.closest(".use-floating-validation-tip")&&(e.addEventListener("focus",(e=>{t.setAttribute("style","display: none")})),t.addEventListener("click",(e=>{t.setAttribute("style","display: none")})))}))}))},i=(e,t)=>{const a=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,"");e.wpcf7.parent.querySelector(`.screen-reader-response ul li#${a}`)?.remove(),e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{e.querySelector(".wpcf7-not-valid-tip")?.remove(),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","false")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid"),"function"==typeof e.setCustomValidity&&e.setCustomValidity("")}))}))},l=(e,t,a)=>{e.querySelectorAll(`[data-reflection-of="${t}"]`).forEach((e=>{if("output"===e.tagName.toLowerCase()){const t=e;0===a.length&&a.push(t.dataset.default),a.slice(0,1).forEach((e=>{e instanceof File&&(e=e.name),t.textContent=e}))}else e.querySelectorAll("output").forEach((e=>{e.hasAttribute("data-default")?0===a.length?e.removeAttribute("hidden"):e.setAttribute("hidden","hidden"):e.remove()})),a.forEach((a=>{a instanceof File&&(a=a.name);const n=document.createElement("output");n.setAttribute("name",t),n.textContent=a,e.appendChild(n)}))}))};function p(e,t={}){if(wpcf7.blocked)return d(e),void n(e,"submitting");const c=new FormData(e);t.submitter&&t.submitter.name&&c.append(t.submitter.name,t.submitter.value);const o={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(c,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:c};r({endpoint:`contact-forms/${e.wpcf7.id}/feedback`,method:"POST",body:c,wpcf7:{endpoint:"feedback",form:e,detail:o}}).then((t=>{const r=n(e,t.status);return o.status=t.status,o.apiResponse=t,["invalid","unaccepted","spam","aborted"].includes(r)?a(e,r,o):["sent","failed"].includes(r)&&a(e,`mail${r}`,o),a(e,"submit",o),t})).then((t=>{t.posted_data_hash&&(e.querySelector('input[name="_wpcf7_posted_data_hash"]').value=t.posted_data_hash),"mail_sent"===t.status&&(e.reset(),e.wpcf7.resetOnMailSent=!0),t.invalid_fields&&t.invalid_fields.forEach((t=>{s(e,t.field,t.message)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').insertAdjacentText("beforeend",t.message),e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=t.message}))})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"feedback"===e.wpcf7.endpoint){const{form:t,detail:r}=e.wpcf7;d(t),a(t,"beforesubmit",r),n(t,"submitting")}return t(e)}));const d=e=>{e.querySelectorAll(".wpcf7-form-control-wrap").forEach((t=>{t.dataset.name&&i(e,t.dataset.name)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').innerText="",e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=""}))};function f(e){const t=new FormData(e),c={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(t,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:t};r({endpoint:`contact-forms/${e.wpcf7.id}/refill`,method:"GET",wpcf7:{endpoint:"refill",form:e,detail:c}}).then((t=>{e.wpcf7.resetOnMailSent?(delete e.wpcf7.resetOnMailSent,n(e,"mail_sent")):n(e,"init"),c.apiResponse=t,a(e,"reset",c)})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"refill"===e.wpcf7.endpoint){const{form:t,detail:a}=e.wpcf7;d(t),n(t,"resetting")}return t(e)}));const u=(e,t)=>{for(const a in t){const n=t[a];e.querySelectorAll(`input[name="${a}"]`).forEach((e=>{e.value=""})),e.querySelectorAll(`img.wpcf7-captcha-${a.replaceAll(":","")}`).forEach((e=>{e.setAttribute("src",n)}));const r=/([0-9]+)\.(png|gif|jpeg)$/.exec(n);r&&e.querySelectorAll(`input[name="_wpcf7_captcha_challenge_${a}"]`).forEach((e=>{e.value=r[1]}))}},m=(e,t)=>{for(const a in t){const n=t[a][0],r=t[a][1];e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${a}"]`).forEach((e=>{e.querySelector(`input[name="${a}"]`).value="",e.querySelector(".wpcf7-quiz-label").textContent=n,e.querySelector(`input[name="_wpcf7_quiz_answer_${a}"]`).value=r}))}};function w(e){const a=new FormData(e);e.wpcf7={id:t(a.get("_wpcf7")),status:e.getAttribute("data-status"),pluginVersion:a.get("_wpcf7_version"),locale:a.get("_wpcf7_locale"),unitTag:a.get("_wpcf7_unit_tag"),containerPost:t(a.get("_wpcf7_container_post")),parent:e.closest(".wpcf7"),get schema(){return wpcf7.schemas.get(this.id)}},wpcf7.schemas.set(e.wpcf7.id,void 0),e.querySelectorAll(".has-spinner").forEach((e=>{e.insertAdjacentHTML("afterend",'<span class="wpcf7-spinner"></span>')})),(e=>{e.querySelectorAll(".wpcf7-exclusive-checkbox").forEach((t=>{t.addEventListener("change",(t=>{const a=t.target.getAttribute("name");e.querySelectorAll(`input[type="checkbox"][name="${a}"]`).forEach((e=>{e!==t.target&&(e.checked=!1)}))}))}))})(e),(e=>{e.querySelectorAll(".has-free-text").forEach((t=>{const a=t.querySelector("input.wpcf7-free-text"),n=t.querySelector('input[type="checkbox"], input[type="radio"]');a.disabled=!n.checked,e.addEventListener("change",(e=>{a.disabled=!n.checked,e.target===n&&n.checked&&a.focus()}))}))})(e),(e=>{e.querySelectorAll(".wpcf7-validates-as-url").forEach((e=>{e.addEventListener("change",(t=>{let a=e.value.trim();a&&!a.match(/^[a-z][a-z0-9.+-]*:/i)&&-1!==a.indexOf(".")&&(a=a.replace(/^\/+/,""),a="http://"+a),e.value=a}))}))})(e),(e=>{if(!e.querySelector(".wpcf7-acceptance")||e.classList.contains("wpcf7-acceptance-as-validation"))return;const t=()=>{let t=!0;e.querySelectorAll(".wpcf7-acceptance").forEach((e=>{if(!t||e.classList.contains("optional"))return;const a=e.querySelector('input[type="checkbox"]');(e.classList.contains("invert")&&a.checked||!e.classList.contains("invert")&&!a.checked)&&(t=!1)})),e.querySelectorAll(".wpcf7-submit").forEach((e=>{e.disabled=!t}))};t(),e.addEventListener("change",(e=>{t()})),e.addEventListener("wpcf7reset",(e=>{t()}))})(e),(e=>{const a=(e,a)=>{const n=t(e.getAttribute("data-starting-value")),r=t(e.getAttribute("data-maximum-value")),c=t(e.getAttribute("data-minimum-value")),o=e.classList.contains("down")?n-a.value.trim().length:a.value.trim().length;e.setAttribute("data-current-value",o),e.innerText=o,r&&r<a.value.length?e.classList.add("too-long"):e.classList.remove("too-long"),c&&a.value.length<c?e.classList.add("too-short"):e.classList.remove("too-short")},n=t=>{t={init:!1,...t},e.querySelectorAll(".wpcf7-character-count").forEach((n=>{const r=n.getAttribute("data-target-name"),c=e.querySelector(`[name="${r}"]`);c&&(c.value=c.defaultValue,a(n,c),t.init&&c.addEventListener("keyup",(e=>{a(n,c)})))}))};n({init:!0}),e.addEventListener("wpcf7reset",(e=>{n()}))})(e),window.addEventListener("load",(t=>{wpcf7.cached&&e.reset()})),e.addEventListener("reset",(t=>{wpcf7.reset(e)})),e.addEventListener("submit",(t=>{wpcf7.submit(e,{submitter:t.submitter}),t.preventDefault()})),e.addEventListener("wpcf7submit",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("wpcf7reset",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("change",(t=>{t.target.closest(".wpcf7-form-control")&&wpcf7.validate(e,{target:t.target})})),e.addEventListener("wpcf7statuschanged",(t=>{const a=t.detail.status;e.querySelectorAll(".active-on-any").forEach((e=>{e.removeAttribute("inert"),e.classList.remove("active-on-any")})),e.querySelectorAll(`.inert-on-${a}`).forEach((e=>{e.setAttribute("inert","inert"),e.classList.add("active-on-any")}))}))}document.addEventListener("DOMContentLoaded",(t=>{var a;if("undefined"!=typeof wpcf7)if(void 0!==wpcf7.api)if("function"==typeof window.fetch)if("function"==typeof window.FormData)if("function"==typeof NodeList.prototype.forEach)if("function"==typeof String.prototype.replaceAll){wpcf7={init:w,submit:p,reset:f,validate:o,schemas:new Map,...null!==(a=wpcf7)&&void 0!==a?a:{}},document.querySelectorAll("form .wpcf7[data-wpcf7-id]").forEach((t=>{const a=document.createElement("p");a.setAttribute("class","wpcf7-form-in-wrong-place");const n=document.createElement("strong");n.append((0,e.__)("Error:","contact-form-7"));const r=(0,e.__)("This contact form is placed in the wrong place.","contact-form-7");a.append(n," ",r),t.replaceWith(a)})),document.querySelectorAll(".wpcf7 > form").forEach((e=>{wpcf7.init(e),e.closest(".wpcf7").classList.replace("no-js","js")}));for(const e of wpcf7.schemas.keys())r({endpoint:`contact-forms/${e}/feedback/schema`,method:"GET"}).then((t=>{wpcf7.schemas.set(e,t)}))}else console.error("Your browser does not support String.replaceAll().");else console.error("Your browser does not support NodeList.forEach().");else console.error("Your browser does not support window.FormData().");else console.error("Your browser does not support window.fetch().");else console.error("wpcf7.api is not defined.");else console.error("wpcf7 is not defined.")}))})();
function ncore_getElementsByClass(searchClass, domNode, tagName){
if(domNode==null) domNode=document;
if(tagName==null) tagName='*';
var el=new Array();
var tags=domNode.getElementsByTagName(tagName);
var tcl=" "+searchClass+" ";
for(i=0,j=0; i<tags.length; i++){
var test=" " + tags[i].className + " ";
if(test.indexOf(tcl)!=-1)
el[j++]=tags[i];
}
return el;
}
function ncore_setupJsForAllInputTypes(){
ncore_initCheckbox();
ncore_initCheckboxList();
ncore_initTimeSelector();
ncore_initSelectableImageList();
}
function ncore_setupJsInputColorPicker(){
var obj=ncoreJQ('input[data-ncore-colorpicker]');
if(typeof obj.wpColorPicker!='undefined'){
obj.wpColorPicker();
}}
function ncore_initSelectableImageList(){
ncoreJQ('.ncore-selectable-image-list .list-item[data-tooltip]').each(function(){
var $this=ncoreJQ(this);
var tt=$this.attr('data-tooltip');
$this.tooltip({
items: '.ncore-selectable-image-list .list-item',
content: function(){ return tt; },
tooltipClass: 'ncore_jquery-ui-tooltip'
});
});
ncoreJQ('.ncore-selectable-image-list .list-row .list-item').on('click.ncore',function(){
var $this=ncoreJQ(this);
var name=$this.attr('data-name');
var value=$this.attr('data-value');
ncoreJQ('input[name="' + name + '"]').val(value).change();
$this.parent().parent().find('.list-item').removeClass('selected');
$this.addClass('selected');
});
ncoreJQ('.ncore-selectable-image-list .list-item.selected').click();
}
function ncore_initTimeSelector(){
ncoreJQ('select[data-time-select]').on('change.ncore',function(){
var $this=ncoreJQ(this);
var name=$this.attr('data-name');
var $hidden=ncoreJQ('input[data-name="' + name + '"]');
var hours=ncoreJQ('select[data-time-select="hours"][data-name="' + name + '"]').val();
var minutes=ncoreJQ('select[data-time-select="minutes"][data-name="' + name + '"]').val();
var seconds=ncoreJQ('select[data-time-select="seconds"][data-name="' + name + '"]').val();
var str='';
if($hidden.attr('data-time-hours')==='1'){
hours=(parseInt(hours) < 10) ? '0' + hours:hours;
str +=hours;
if($hidden.attr('data-time-seconds')==='1'||$hidden.attr('data-time-minutes')==='1'){
str +=':';
}}
if($hidden.attr('data-time-minutes')==='1'){
minutes=(parseInt(minutes) < 10) ? '0' + minutes:minutes;
str +=minutes;
if($hidden.attr('data-time-seconds')==='1'){
str +=':';
}}
if($hidden.attr('data-time-seconds')==='1'){
seconds=(parseInt(seconds) < 10) ? '0' + seconds:seconds;
str +=seconds;
}
ncoreJQ('input[name="' + name + '"]').val(str);
});
ncoreJQ('input[data-time-select]').on('change.ncore',function(){
var $this=ncoreJQ(this);
var name=$this.attr('data-name');
var value=$this.val();
var hours=$this.attr('data-time-hours');
var minutes=$this.attr('data-time-minutes');
var seconds=$this.attr('data-time-seconds');
var spl=value.split(':');
if(hours==='1'&&minutes==='1'&&seconds==='1'){
ncoreJQ('select[data-time-select="hours"][data-name="' + name + '"]').val(ncore.helpers.string.ltrim(spl[0],'0'));
ncoreJQ('select[data-time-select="minutes"][data-name="' + name + '"]').val(ncore.helpers.string.ltrim(spl[1],'0'));
ncoreJQ('select[data-time-select="seconds"][data-name="' + name + '"]').val(ncore.helpers.string.ltrim(spl[2],'0'));
}
else if(hours==='1'&&minutes==='1'&&seconds==='0'){
ncoreJQ('select[data-time-select="hours"][data-name="' + name + '"]').val(ncore.helpers.string.ltrim(spl[0],'0'));
ncoreJQ('select[data-time-select="minutes"][data-name="' + name + '"]').val(ncore.helpers.string.ltrim(spl[1],'0'));
}
else if(hours==='0'&&minutes==='1'&&seconds==='1'){
ncoreJQ('select[data-time-select="minutes"][data-name="' + name + '"]').val(ncore.helpers.string.ltrim(spl[0],'0'));
ncoreJQ('select[data-time-select="seconds"][data-name="' + name + '"]').val(ncore.helpers.string.ltrim(spl[1],'0'));
}
else if(hours==='1'&&minutes==='0'&&seconds==='0'){
ncoreJQ('select[data-time-select="seconds"][data-name="' + name + '"]').val(ncore.helpers.string.ltrim(spl[0],'0'));
}
else if(hours==='0'&&minutes==='1'&&seconds==='0'){
ncoreJQ('select[data-time-select="minutes"][data-name="' + name + '"]').val(ncore.helpers.string.ltrim(spl[0],'0'));
}
else if(hours==='0'&&minutes==='0'&&seconds==='1'){
ncoreJQ('select[data-time-select="seconds"][data-name="' + name + '"]').val(ncore.helpers.string.ltrim(spl[0],'0'));
}});
ncoreJQ('select[data-time-select]').change();
}
function ncore_initCheckbox(){
ncoreJQ('input.ncore_checkbox').off('change').on('change', function(){
var checkbox_postname=ncoreJQ(this).attr('name');
var postname=checkbox_postname.substring(9);
var checked=this.checked;
var value;
if(checked){
value=ncoreJQ(this).attr('data-value-checked');
if(!value){
value=1;
}}else{
value=ncoreJQ(this).attr('data-value-unchecked');
if(!value){
value=0;
}}
var obj=ncoreJQ(this).parent('span.ncore_checkbox').find('input[name="' + postname + '"]');
obj.val(value);
obj.trigger('change');
});
}
function ncore_initCheckboxList(){
ncoreJQ('input.ncore_checkbox_list').off('change').on('change', function(){
var checkbox_postname=ncoreJQ(this).attr('name');
var postname=checkbox_postname.substring(9);
var all_checked=false;
var father=ncoreJQ(this).parentsUntil('div.ncore_checkbox_list').parent();
var checkboxes=father.find('input.ncore_checkbox_list[name="' + checkbox_postname + '"]');
checkboxes.each(function(index, obj){
if(obj.checked&&obj.value=='all'){
all_checked=true;
}});
var value='';
checkboxes.each(function(index, obj){
if(obj.checked){
if(value) value +=',';
value +=obj.value;
}
var css_checked=obj.checked||all_checked;
if(css_checked){
ncoreJQ(obj).parent().removeClass('ncore_unchecked');
ncoreJQ(obj).parent().addClass('ncore_checked');
}else{
ncoreJQ(obj).parent().removeClass('ncore_checked');
ncoreJQ(obj).parent().addClass('ncore_unchecked');
}});
var obj=father.find('input[name="' + postname + '"]');
obj.val(value);
obj.trigger('change');
});
ncoreJQ('div.ncore_checkbox_list input[type="hidden"]').off('change').on('change',function(){
var $this=ncoreJQ(this);
var value=$this.val();
var spl=value.split(',');
$this.parent().find('input[type="checkbox"]').prop('checked',false).parent().addClass('ncore_unchecked').removeClass('ncore_checked');
for (var i in spl){
$this.parent().find('input[type="checkbox"][value="' + spl[i] + '"]').prop('checked',true).parent().addClass('ncore_checked').removeClass('ncore_unchecked');
}});
}
function ncore_windowOpenPosition(width, height){
var specs='height=' + height + ',width=' + width;
var w=window,
d=document,
e=d.documentElement,
g=d.getElementsByTagName('body')[0],
x=w.innerWidth||e.clientWidth||g.clientWidth,
y=w.innerHeight||e.clientHeight||g.clientHeight,
l=w.screenLeft||w.screenX,
t=w.screenTop||w.screenY;
var left=l + Math.round((x-width)/2);
var top=t + Math.round((y-height)/2);
specs +=',left=' + left + ',top=' + top;
return specs;
}
function ncore_urlBase64ToUint8Array(base64String){
const padding='='.repeat((4 - base64String.length % 4) % 4);
const base64=(base64String + padding)
.replace(/\-/g, '+')
.replace(/_/g, '/');
const rawData=window.atob(base64);
const outputArray=new Uint8Array(rawData.length);
for (var i=0; i < rawData.length; ++i){
outputArray[i]=rawData.charCodeAt(i);
}
return outputArray;
}
function ncore_canShowByCookieCount(basename, max_count, max_days, do_increase_counter){
var is_initialized=parseInt(ncore_readCookie('dm_' + basename + '_initialized') );
var counts_so_far=parseInt(ncore_readCookie('dm_' + basename + '_count') );
if(isNaN(is_initialized)){
is_initialized=0;
}
if(isNaN(counts_so_far)){
counts_so_far=0;
}
var must_reset = !is_initialized;
if(must_reset){
ncore_createCookie('dm_' + basename + '_initialized', 1, max_days);
ncore_createCookie('dm_' + basename + '_count',       0, max_days+1);
return true;
}
var can_show=counts_so_far < max_count;
if(can_show&&typeof do_increase_counter!='undefined'&&do_increase_counter){
ncore_createCookie('dm_' + basename + '_count', counts_so_far+1, max_days+1);
}
return can_show;
}
function ncore_createCookie(name,value,days){
if(days){
var date=new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires="; expires="+date.toGMTString();
}
else var expires="";
document.cookie=name+"="+value+expires+"; path=/";
}
function ncore_readCookie(name){
var nameEQ=name + "=";
var ca=document.cookie.split(';');
for(var i=0;i < ca.length;i++){
var c=ca[i];
while (c.charAt(0)==' ') c=c.substring(1,c.length);
if(c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function ncore_eraseCookie(name){
createCookie(name,"",-1);
}
function ncore_copyShortcodeToClipboard(type, id){
var shortcode='[ds_'+type+' id="'+id+'"]';
if(!navigator.clipboard){
ncore_fallbackCopyTextToClipboard(shortcode, id);
return;
}
navigator.clipboard.writeText(shortcode).then(function(){}, function(err){});
}
function ncore_fallbackCopyTextToClipboard(text, id){
var textArea=document.createElement("textarea");
textArea.value=text;
textArea.style.top="0";
textArea.style.left="0";
textArea.style.position="fixed";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand ('copy');
} catch (err){}
document.body.removeChild(textArea);
}
function ncore_fallbackCopyValueToClipboard(text){
var textArea=document.createElement("textarea");
textArea.value=text;
textArea.style.top="0";
textArea.style.left="0";
textArea.style.position="fixed";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand ('copy');
} catch (err){}
document.body.removeChild(textArea);
}
function ncore_copyTooltipInputToClipboard(e, linkElement){
e.preventDefault();
var elementValue=linkElement.firstChild.value;
if(!navigator.clipboard){
ncore_fallbackCopyValueToClipboard(elementValue);
return;
}
navigator.clipboard.writeText(elementValue).then(function(){}, function(err){});
}
function ncore_switchElementAttribute(element, attribute, change, back=false, timer=false){
element.setAttribute(attribute, change);
if(back&&timer){
setTimeout(()=> {
element.setAttribute(attribute, back);
}, timer);
}}
function ncore_switchElementTooltip(element, attribute, change, back=false, timer=false){
element.setAttribute(attribute, change);
if(back&&timer){
setTimeout(()=> {
element.setAttribute(attribute, back);
}, timer);
}};
!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=915)}({185:function(t,e,n){"use strict";var o,r,a,i=n(436),s="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";function d(){a=!1}function l(t){if(t){if(t!==o){if(t.length!==s.length)throw new Error("Custom alphabet for shortid must be "+s.length+" unique characters. You submitted "+t.length+" characters: "+t);var e=t.split("").filter((function(t,e,n){return e!==n.lastIndexOf(t)}));if(e.length)throw new Error("Custom alphabet for shortid must be "+s.length+" unique characters. These characters were not unique: "+e.join(", "));o=t,d()}}else o!==s&&(o=s,d())}function c(){return a||(a=function(){o||l(s);for(var t,e=o.split(""),n=[],r=i.nextValue();e.length>0;)r=i.nextValue(),t=Math.floor(r*e.length),n.push(e.splice(t,1)[0]);return n.join("")}())}t.exports={get:function(){return o||s},characters:function(t){return l(t),o},seed:function(t){i.seed(t),r!==t&&(d(),r=t)},lookup:function(t){return c()[t]},shuffled:c}},228:function(t,e,n){"use strict";n.d(e,"b",(function(){return r}));var o=function(t,e){t.append('<div class="dm-tooltip-bubble">\n        <div class="dm-tooltip-triangle"></div>\n        <div class="dm-tooltip-content">\n            '+e.attr("data-title")+"\n        </div>\n    </div>");var n=t.children(".dm-tooltip-bubble"),o=n.children(".dm-tooltip-content");e.hover((function(){var e,r,a=t.parents(".dm-dialog");if(a.length){var i=a.find(".dm-dialog-content").get(0).getBoundingClientRect();e=i.top+i.height,r=i.left+i.width}else e=window.innerHeight,r=window.innerWidth;var s=n.show().get(0).getBoundingClientRect(),d=s.top+s.height-e;d>0&&o.css({"max-height":s.height-d-60});var l=s.left+s.width-r;l>0&&o.css({"max-width":s.width-l-60,"overflow-x":"scroll"})}),(function(){}))},r=function(t){t.addClass("dm-icon icon-help-circled").wrap('<span class="dm-tooltip-container"></span>');var e=t.parent();o(e,t)};e.a=function(t){t(".dm-tooltip").each((function(){r(t(this))})),t(".dm-btn-icon[data-title]").each((function(){o(t(this),t(this))}))}},229:function(t,e,n){"use strict";t.exports=n(435)},435:function(t,e,n){"use strict";var o=n(185),r=n(437),a=n(441),i=n(442)||0;function s(){return r(i)}t.exports=s,t.exports.generate=s,t.exports.seed=function(e){return o.seed(e),t.exports},t.exports.worker=function(e){return i=e,t.exports},t.exports.characters=function(t){return void 0!==t&&o.characters(t),o.shuffled()},t.exports.isValid=a},436:function(t,e,n){"use strict";var o=1;t.exports={nextValue:function(){return(o=(9301*o+49297)%233280)/233280},seed:function(t){o=t}}},437:function(t,e,n){"use strict";var o,r,a=n(438),i=(n(185),1567752802062),s=7;t.exports=function(t){var e="",n=Math.floor(.001*(Date.now()-i));return n===r?o++:(o=0,r=n),e+=a(s),e+=a(t),o>0&&(e+=a(o)),e+=a(n)}},438:function(t,e,n){"use strict";var o=n(185),r=n(439),a=n(440);t.exports=function(t){for(var e,n=0,i="";!e;)i+=a(r,o.get(),1),e=t<Math.pow(16,n+1),n++;return i}},439:function(t,e,n){"use strict";var o,r="object"==typeof window&&(window.crypto||window.msCrypto);o=r&&r.getRandomValues?function(t){return r.getRandomValues(new Uint8Array(t))}:function(t){for(var e=[],n=0;n<t;n++)e.push(Math.floor(256*Math.random()));return e},t.exports=o},440:function(t,e){t.exports=function(t,e,n){for(var o=(2<<Math.log(e.length-1)/Math.LN2)-1,r=Math.ceil(1.6*o*n/e.length),a="";;)for(var i=r,s=t(i);i--;)if((a+=e[s[i]&o]||"").length===+n)return a}},441:function(t,e,n){"use strict";var o=n(185);t.exports=function(t){return!(!t||"string"!=typeof t||t.length<6)&&!new RegExp("[^"+o.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]").test(t)}},442:function(t,e,n){"use strict";t.exports=0},55:function(t,e){t.exports="undefined"==typeof ncoreJQ?jQuery:ncoreJQ},828:function(module,__webpack_exports__,__webpack_require__){"use strict";var jquery__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(55),jquery__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__),dmDialogAjax_Stop=function(t){void 0!==t?jquery__WEBPACK_IMPORTED_MODULE_0___default()("#"+t).removeClass("ncore_waiting"):jquery__WEBPACK_IMPORTED_MODULE_0___default()("#ncore_ajax_wait").removeClass("ncore_waiting")};window.dmDialogAjax_Stop=dmDialogAjax_Stop;var dmDialogAjax_Start=function(t){void 0!==t?jquery__WEBPACK_IMPORTED_MODULE_0___default()("#"+t).addClass("ncore_waiting"):jquery__WEBPACK_IMPORTED_MODULE_0___default()("#ncore_ajax_wait").addClass("ncore_waiting")};window.dmDialogAjax_Start=dmDialogAjax_Start;var dmDialogAjax_AddUrlArgs=function(t,e){var n,o,r=t.indexOf("?"),a=r>=0?"&":"?";return(r=t.indexOf("#"))>=0?(n=t.substring(0,r),o=t.substring(r)):(n=t,o=""),t=n+a+e+o};window.dmDialogAjax_AddUrlArgs=dmDialogAjax_AddUrlArgs;var dmDialogAjax_FetchUrl=function(t,e){void 0!==e&&e||dmDialogAjax_Start();var n=(new Date).getTime();return t=dmDialogAjax_AddUrlArgs(t,n),jquery__WEBPACK_IMPORTED_MODULE_0___default.a.getJSON(t,dmDialogAjax_Callback),!1};window.dmDialogAjax_FetchUrl=dmDialogAjax_FetchUrl;var dmDialogAjax_Callback=function(response){if("string"==typeof response&&(response=JSON.parse(response)),response.redirect||response.must_reload||dmDialogAjax_Stop(),response.error&&alert(response.error),response.success&&alert(response.success),response.html&&response.target_div_id)switch(response.target_div_id){case"body_prepend":dmDialogAjax_Stop(),jquery__WEBPACK_IMPORTED_MODULE_0___default()("body").prepend(response.html);break;case"body_append":dmDialogAjax_Stop(),jquery__WEBPACK_IMPORTED_MODULE_0___default()("body").append(response.html);break;default:dmDialogAjax_Stop(response.target_div_id),jquery__WEBPACK_IMPORTED_MODULE_0___default()("#"+response.target_div_id).html(response.html)}return response.js&&eval(response.js),response.must_reload&&location.reload(!0),response.redirect&&(window.location.href=response.redirect),!1};window.dmDialogAjax_Callback=dmDialogAjax_Callback},915:function(t,e,n){"use strict";n.r(e);var o,r=n(55),a=n.n(r),i=n(229),s=n.n(i),d=function(t){var e=this;switch(t){case"close":var n=this;this.data("parent-id")&&(n=a()('[data-parent="'+this.data("parent-id")+'"]')),function(t){var e=document.getElementById(t.data("parent"));e&&(a()(e).hide(),a()("body").css({overflow:"auto"}))}(n);var o=n.data("onclose");void 0!==o&&o&&o();break;case"open":var r=this;this.data("parent-id")&&(r=a()('[data-parent="'+this.data("parent-id")+'"]')),function(t){var e=document.getElementById(t.data("parent"));e&&(t.show(),a()(e).show(),a()("body").css({overflow:"hidden"}))}(r);var i=r.data("onopen");void 0!==i&&i&&i();break;case"instance":var d=this;return this.data("parent-id")&&(d=a()('[data-parent="'+this.data("parent-id")+'"]')),d;default:if(this.data("parent"))return this;var l=s()();this.appendTo("body"),void 0!==t.dialogClass&&this.addClass(t.dialogClass);var c=void 0===t.titleHtml?this.attr("title"):t.titleHtml,u=a()('<div id="'+l+'" class="dm-dialog-container dm-dialog-'+(this.hasClass("ncore_admin")?"admin":"user")+'">\n\t\t\t\t\t<div class="dm-dialog">\n\t\t\t\t\t\t'+(c?'<div class="dm-dialog-header">'+c+"</div>":"")+'\n\t\t\t\t\t\t<div class="dm-dialog-content"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>').hide();this.attr("data-parent",l),this.data("onclose",t.close||null),this.data("onopen",t.open||null),u.appendTo("body");var p=u.children(".dm-dialog"),_=a()(window).width();void 0!==t.width&&void 0!==_&&_>parseInt(t.width.replace("px",""))&&p.css("max-width",t.width||0);var f=a()(window).height();void 0!==t.height&&void 0!==f&&f>parseInt(t.height.replace("px",""))&&p.css("max-height",t.height||0),p.append(function(t,e){var n=a()('<div class="dm-dialog-buttonpane"></div>'),o=Object.keys(e);if(!o.length)return n.css({padding:0,"max-height":"10px"});var r=o.map((function(n){var o=a()('<button class="dm-dialog-button" data-parent-id="'+t+'">'+n+"</button>");return o.on("click",e[n]),o}));return n.append(r),n}(l,t.buttons)).append(function(t,e){var n=a()('<a class="dm-close-button" title="'+e+'" data-parent-id="'+t+'"></a>');return n.on("click",(function(t){t.preventDefault(),t.stopPropagation(),a()(this).dmDialog("close")})),n}(l,t.closeText)),p.children(".dm-dialog-content").append(this),t.modal||u.on("click",(function(t){t.target==u.get(0)&&e.dmDialog("close")})),t.autoOpen&&this.dmDialog("open")}return this},l=n(228),c=function(t){this.each((function(){var e=a()(this);switch(typeof t.content){case"string":e.attr("data-title",t.content);break;case"function":e.attr("data-title",t.content.bind(this)())}if(void 0!==t.tooltipClass&&e.addClass(t.tooltipClass),Object(l.b)(e),void 0!==t.hide){var n=e.parents(".dm-tooltip-container");e.hover((function(){n.find(".dm-tooltip-bubble").css({opacity:1,pointerevents:"all",width:"auto",overflow:"visible",transition:"opacity 0.2s ease-in"}),setTimeout((function(){n.find(".dm-tooltip-bubble").attr("style","")}),t.hide)}),(function(){}))}}))};!function(t){t.None="none",t.Mismatch="mismatch",t.Bad="bad",t.Weak="weak",t.Good="good",t.Strong="strong"}(o||(o={}));window.dmCalculatePasswordStrength=function(t,e,n){var r=void 0!==t&&""!==t,a=void 0!==n&&""!==n;if(!r&&!a)return o.None;if(r&&a&&n!==t)return o.Mismatch;a&&!r&&(t=n);var i=function(t){for(var e={},n=0,o=t.length;n<o;n++)e[t[n]]=e[t[n]]+1||1;return Object.keys(e).length}(t);if(i<4)return o.Bad;if(e&&t.toLowerCase().indexOf(e.toLowerCase())>=0)return o.Bad;var s=0;return t.match(/[0-9]/)&&s++,t.match(/[a-z]/)&&s++,t.match(/[A-Z]/)&&s++,t.match(/[^a-zA-Z0-9]/)&&s++,s<=1?o.Weak:i>=10?o.Strong:s>=4&&i>=4&&t.length>=8?o.Strong:s>=2&&i>=5&&t.length>=8?o.Good:o.Weak};n(828);a.a.fn.extend({dmDialog:d,dmTooltip:c})}});
/* Swipe Box
(function(w){ var ua=navigator.userAgent; if(!(/iPhone|iPad|iPod/.test(navigator.platform)&&/OS [1-5]_[0-9_]* like Mac OS X/i.test(ua)&&ua.indexOf("AppleWebKit") > -1) ){ return; } var doc=w.document; if(!doc.querySelector){ return; } var meta=doc.querySelector("meta[name=viewport]"), initialContent=meta&&meta.getAttribute("content"), disabledZoom=initialContent + ",maximum-scale=1", enabledZoom=initialContent + ",maximum-scale=10", enabled=true, x, y, z, aig; if(!meta){ return; } function restoreZoom(){ meta.setAttribute("content", enabledZoom); enabled=true; } function disableZoom(){ meta.setAttribute("content", disabledZoom); enabled=false; } function checkTilt(e){ aig=e.accelerationIncludingGravity; x=Math.abs(aig.x); y=Math.abs(aig.y); z=Math.abs(aig.z); if((!w.orientation||w.orientation===180)&&(x > 7||(( z > 6&&y < 8||z < 8&&y > 6)&&x > 5) )){ if(enabled){ disableZoom(); }}else if(!enabled){ restoreZoom(); }} w.addEventListener("orientationchange", restoreZoom, false); w.addEventListener("devicemotion", checkTilt, false); })(this); ;(function(window, document, $, undefined){ $.swipebox=function(elem, options){ var ui, defaults={ useCSS:true, useSVG:true, initialIndexOnArray:0, removeBarsOnMobile:false, hideCloseButtonOnMobile:false, hideBarsDelay:3000, videoMaxWidth:1140, vimeoColor:'cccccc', beforeOpen: null, afterOpen: null, afterClose: null, afterMedia: null, nextSlide: null, prevSlide: null, loopAtEnd: false, autoplayVideos: false, queryStringData: {}, toggleClassOnLoad: '' },  plugin=this, elements=[], $elem, selector=elem.selector, isMobile=navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i), isTouch=isMobile!==null||document.createTouch!==undefined||('ontouchstart' in window)||('onmsgesturechange' in window)||navigator.msMaxTouchPoints, supportSVG = !! document.createElementNS&&!! document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect, winWidth=window.innerWidth ? window.innerWidth:$(window).width(), winHeight=window.innerHeight ? window.innerHeight:$(window).height(), currentX=0, html='<div id="swipebox-overlay">\ <div id="swipebox-container">\ <div id="swipebox-slider"></div>\ <div id="swipebox-top-bar">\ <div id="swipebox-title"></div>\ </div>\ <div id="swipebox-bottom-bar">\ <div id="swipebox-arrows">\ <a id="swipebox-prev"></a>\ <a id="swipebox-next"></a>\ </div>\ </div>\ <a id="swipebox-close"></a>\ </div>\ </div>'; plugin.settings={}; $.swipebox.close=function (){ ui.closeSlide(); }; $.swipebox.extend=function (){ return ui; }; plugin.init=function(){ plugin.settings=$.extend({}, defaults, options); if($.isArray(elem) ){ elements=elem; ui.target=$(window); ui.init(plugin.settings.initialIndexOnArray); }else{ $(document).on('click', selector, function(event){ if(event.target.parentNode.className==='slide current'){ return false; } if(! $.isArray(elem) ){ ui.destroy(); $elem=$(selector); ui.actions(); } elements=[]; var index, relType, relVal; if(! relVal){ relType='data-rel'; relVal=$(this).attr(relType); } if(! relVal){ relType='rel'; relVal=$(this).attr(relType); } if(relVal&&relVal!==''&&relVal!=='nofollow'){ $elem=$(selector).filter('[' + relType + '="' + relVal + '"]'); }else{ $elem=$(selector); } $elem.each(function(){ var title=null, href=null; data=null; if($(this).attr('title') ){ title=$(this).attr('title'); } if($(this).attr('href') ){ href=$(this).attr('href'); } if($(this).attr('data') ){ data=$(this).attr('data'); } elements.push({ href: href, title: title, data: data }); }); index=$elem.index($(this) ); event.preventDefault(); event.stopPropagation(); ui.target=$(event.target); ui.init(index); }); }}; ui={ init:function(index){ if(plugin.settings.beforeOpen){ plugin.settings.beforeOpen(); } this.target.trigger('swipebox-start'); $.swipebox.isOpen=true; this.build(); this.openSlide(index); this.openMedia(index); this.preloadMedia(index+1); this.preloadMedia(index-1); if(plugin.settings.afterOpen){ plugin.settings.afterOpen(index); }}, build:function (){ var $this=this, bg; $('body').append(html); if(supportSVG&&plugin.settings.useSVG===true){ bg=$('#swipebox-close').css('background-image'); bg=bg.replace('png', 'svg'); $('#swipebox-prev, #swipebox-next, #swipebox-close').css({ 'background-image':bg }); } if(isMobile&&plugin.settings.removeBarsOnMobile){ $('#swipebox-bottom-bar, #swipebox-top-bar').remove(); } $.each(elements, function(){ $('#swipebox-slider').append('<div class="slide"></div>'); }); $this.setDim(); $this.actions(); if(isTouch){ $this.gesture(); } $this.keyboard(); $this.animBars(); $this.resize(); }, setDim:function (){ var width, height, sliderCss={}; if('onorientationchange' in window){ window.addEventListener('orientationchange', function(){ if(window.orientation===0){ width=winWidth; height=winHeight; }else if(window.orientation===90||window.orientation===-90){ width=winHeight; height=winWidth; }}, false); }else{ width=window.innerWidth ? window.innerWidth:$(window).width(); height=window.innerHeight ? window.innerHeight:$(window).height(); } sliderCss={ width:width, height:height }; $('#swipebox-overlay').css(sliderCss); }, resize:function (){ var $this=this; $(window).resize(function(){ $this.setDim(); }).resize(); }, supportTransition:function (){ var prefixes='transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition'.split(' '), i; for(i=0; i < prefixes.length; i++){ if(document.createElement('div').style[ prefixes[i] ]!==undefined){ return prefixes[i]; }} return false; }, doCssTrans:function (){ if(plugin.settings.useCSS&&this.supportTransition()){ return true; }}, gesture:function (){ var $this=this, index, hDistance, vDistance, hDistanceLast, vDistanceLast, hDistancePercent, vSwipe=false, hSwipe=false, hSwipMinDistance=10, vSwipMinDistance=50, startCoords={}, endCoords={}, bars=$('#swipebox-top-bar, #swipebox-bottom-bar'), slider=$('#swipebox-slider'); bars.addClass('visible-bars'); $this.setTimeout(); $('body').bind('touchstart', function(event){ $(this).addClass('touching'); index=$('#swipebox-slider .slide').index($('#swipebox-slider .slide.current') ); endCoords=event.originalEvent.targetTouches[0]; startCoords.pageX=event.originalEvent.targetTouches[0].pageX; startCoords.pageY=event.originalEvent.targetTouches[0].pageY; $('#swipebox-slider').css({ '-webkit-transform':'translate3d(' + currentX +'%, 0, 0)', 'transform':'translate3d(' + currentX + '%, 0, 0)' }); $('.touching').bind('touchmove',function(event){ event.preventDefault(); event.stopPropagation(); endCoords=event.originalEvent.targetTouches[0]; if(! hSwipe){ vDistanceLast=vDistance; vDistance=endCoords.pageY - startCoords.pageY; if(Math.abs(vDistance) >=vSwipMinDistance||vSwipe){ var opacity=0.75 - Math.abs(vDistance) / slider.height(); slider.css({ 'top': vDistance + 'px' }); slider.css({ 'opacity': opacity }); vSwipe=true; }} hDistanceLast=hDistance; hDistance=endCoords.pageX - startCoords.pageX; hDistancePercent=hDistance * 100 / winWidth; if(! hSwipe&&! vSwipe&&Math.abs(hDistance) >=hSwipMinDistance){ $('#swipebox-slider').css({ '-webkit-transition':'', 'transition':'' }); hSwipe=true; } if(hSwipe){ if(0 < hDistance){ if(0===index){     $('#swipebox-overlay').addClass('leftSpringTouch'); }else{ $('#swipebox-overlay').removeClass('leftSpringTouch').removeClass('rightSpringTouch');   $('#swipebox-slider').css({    '-webkit-transform':'translate3d(' +(currentX + hDistancePercent) +'%, 0, 0)',     'transform':'translate3d(' +(currentX + hDistancePercent) + '%, 0, 0)'   }); }}else if(0 > hDistance){ if(elements.length===index +1){  $('#swipebox-overlay').addClass('rightSpringTouch'); }else{   $('#swipebox-overlay').removeClass('leftSpringTouch').removeClass('rightSpringTouch');  $('#swipebox-slider').css({    '-webkit-transform':'translate3d(' +(currentX + hDistancePercent) +'%, 0, 0)',     'transform':'translate3d(' +(currentX + hDistancePercent) + '%, 0, 0)'   }); }} }}); return false; }).bind('touchend',function(event){ event.preventDefault(); event.stopPropagation(); $('#swipebox-slider').css({ '-webkit-transition':'-webkit-transform 0.4s ease', 'transition':'transform 0.4s ease' }); vDistance=endCoords.pageY - startCoords.pageY; hDistance=endCoords.pageX - startCoords.pageX; hDistancePercent=hDistance*100/winWidth; if(vSwipe){ vSwipe=false; if(Math.abs(vDistance) >=2 * vSwipMinDistance&&Math.abs(vDistance) > Math.abs(vDistanceLast) ){ var vOffset=vDistance > 0 ? slider.height():- slider.height(); slider.animate({ top: vOffset + 'px', 'opacity': 0 }, 300, function (){  $this.closeSlide(); }); }else{ slider.animate({ top: 0, 'opacity': 1 }, 300); }}else if(hSwipe){ hSwipe=false; if(hDistance >=hSwipMinDistance&&hDistance >=hDistanceLast){ $this.getPrev(); }else if(hDistance <=-hSwipMinDistance&&hDistance <=hDistanceLast){ $this.getNext(); }}else{ if(! bars.hasClass('visible-bars') ){ $this.showBars(); $this.setTimeout(); }else{ $this.clearTimeout(); $this.hideBars(); }} $('#swipebox-slider').css({ '-webkit-transform':'translate3d(' + currentX + '%, 0, 0)', 'transform':'translate3d(' + currentX + '%, 0, 0)' }); $('#swipebox-overlay').removeClass('leftSpringTouch').removeClass('rightSpringTouch'); $('.touching').off('touchmove').removeClass('touching'); }); }, setTimeout: function (){ if(plugin.settings.hideBarsDelay > 0){ var $this=this; $this.clearTimeout(); $this.timeout=window.setTimeout(function(){ $this.hideBars(); }, plugin.settings.hideBarsDelay); }}, clearTimeout: function (){ window.clearTimeout(this.timeout); this.timeout=null; }, showBars:function (){ var bars=$('#swipebox-top-bar, #swipebox-bottom-bar'); if(this.doCssTrans()){ bars.addClass('visible-bars'); }else{ $('#swipebox-top-bar').animate({ top:0 }, 500); $('#swipebox-bottom-bar').animate({ bottom:0 }, 500); setTimeout(function(){ bars.addClass('visible-bars'); }, 1000); }}, hideBars:function (){ var bars=$('#swipebox-top-bar, #swipebox-bottom-bar'); if(this.doCssTrans()){ bars.removeClass('visible-bars'); }else{ $('#swipebox-top-bar').animate({ top:'-50px' }, 500); $('#swipebox-bottom-bar').animate({ bottom:'-50px' }, 500); setTimeout(function(){ bars.removeClass('visible-bars'); }, 1000); }}, animBars:function (){ var $this=this, bars=$('#swipebox-top-bar, #swipebox-bottom-bar'); bars.addClass('visible-bars'); $this.setTimeout(); $('#swipebox-slider').click(function(){ if(! bars.hasClass('visible-bars') ){ $this.showBars(); $this.setTimeout(); }}); $('#swipebox-bottom-bar').hover(function(){ $this.showBars(); bars.addClass('visible-bars'); $this.clearTimeout(); }, function(){ if(plugin.settings.hideBarsDelay > 0){ bars.removeClass('visible-bars'); $this.setTimeout(); }}); }, keyboard:function (){ var $this=this; $(window).bind('keyup', function(event){ event.preventDefault(); event.stopPropagation(); if(event.keyCode===37){ $this.getPrev(); }else if(event.keyCode===39){ $this.getNext(); }else if(event.keyCode===27){ $this.closeSlide(); }}); }, actions:function (){ var $this=this, action='touchend click'; if(elements.length < 2){ $('#swipebox-bottom-bar').hide(); if(undefined===elements[ 1 ]){ $('#swipebox-top-bar').hide(); }}else{ $('#swipebox-prev').bind(action, function(event){ event.preventDefault(); event.stopPropagation(); $this.getPrev(); $this.setTimeout(); }); $('#swipebox-next').bind(action, function(event){ event.preventDefault(); event.stopPropagation(); $this.getNext(); $this.setTimeout(); }); } $('#swipebox-close').bind(action, function(){ $this.closeSlide(); }); }, setSlide:function(index, isFirst){ isFirst=isFirst||false; var slider=$('#swipebox-slider'); currentX=-index*100; if(this.doCssTrans()){ slider.css({ '-webkit-transform':'translate3d(' + (-index*100)+'%, 0, 0)', 'transform':'translate3d(' + (-index*100)+'%, 0, 0)' }); }else{ slider.animate({ left:(-index*100)+'%' }); } $('#swipebox-slider .slide').removeClass('current'); $('#swipebox-slider .slide').eq(index).addClass('current'); this.setTitle(index); if(isFirst){ slider.fadeIn(); } $('#swipebox-prev, #swipebox-next').removeClass('disabled'); if(index===0){ $('#swipebox-prev').addClass('disabled'); }else if(index===elements.length - 1&&plugin.settings.loopAtEnd!==true){ $('#swipebox-next').addClass('disabled'); }}, openSlide:function(index){ $('html').addClass('swipebox-html'); if(isTouch){ $('html').addClass('swipebox-touch'); if(plugin.settings.hideCloseButtonOnMobile){ $('html').addClass('swipebox-no-close-button'); }}else{ $('html').addClass('swipebox-no-touch'); } $(window).trigger('resize'); this.setSlide(index, true); }, preloadMedia:function(index){ var $this=this, src=null; if(elements[ index ]!==undefined){ src=elements[ index ].href; } if(! $this.isVideo(src) ){ setTimeout(function(){ $this.openMedia(index); }, 1000); }else{ $this.openMedia(index); }}, openMedia:function(index){ var $this=this, src, slide; if(elements[ index ]!==undefined){ src=elements[ index ].href; } if(index < 0||index >=elements.length){ return false; } slide=$('#swipebox-slider .slide').eq(index); if(! $this.isVideo(src) ){ slide.addClass('slide-loading'); $this.loadMedia(src, function(){ slide.removeClass('slide-loading'); slide.html(this); if(plugin.settings.afterMedia){ plugin.settings.afterMedia(index); }}); }else{ slide.html($this.getVideo(src) ); if(plugin.settings.afterMedia){ plugin.settings.afterMedia(index); }} }, setTitle:function(index){ var title=null; var data=null; $('#swipebox-title').empty(); if(elements[ index ]!==undefined){ title=elements[ index ].title; data=elements[ index ].data; } if(title){ $('#swipebox-top-bar').show(); if(data){ $('#swipebox-title').html('<a href="' + data +'">' + title + '</a>'); }else{ $('#swipebox-title').append(title); }}else{ $('#swipebox-top-bar').hide(); }}, isVideo:function(src){ if(src){ if(src.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||src.match(/vimeo\.com\/([0-9]*)/)||src.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) ){ return true; } if(src.toLowerCase().indexOf('swipeboxvideo=1') >=0){ return true; }} }, parseUri:function (uri, customData){ var a=document.createElement('a'), qs={}; a.href=decodeURIComponent(uri); if(a.search){ qs=JSON.parse('{"' + a.search.toLowerCase().replace('?','').replace(/&/g,'","').replace(/=/g,'":"') + '"}'); } if($.isPlainObject(customData) ){ qs=$.extend(qs, customData, plugin.settings.queryStringData); } return $ .map(qs, function (val, key){ if(val&&val > ''){ return encodeURIComponent(key) + '=' + encodeURIComponent(val); }}) .join('&'); }, getVideo:function(url){ var iframe='', youtubeUrl=url.match(/((?:www\.)?youtube\.com|(?:www\.)?youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/), youtubeShortUrl=url.match(/(?:www\.)?youtu\.be\/([a-zA-Z0-9\-_]+)/), vimeoUrl=url.match(/(?:www\.)?vimeo\.com\/([0-9]*)/), qs=''; if(youtubeUrl||youtubeShortUrl){ if(youtubeShortUrl){ youtubeUrl=youtubeShortUrl; } qs=ui.parseUri(url, { 'autoplay':(plugin.settings.autoplayVideos ? '1':'0'), 'v':'' });iframe='<iframe width="560" height="315" src="//' + youtubeUrl[1] + '/embed/' + youtubeUrl[2] + '?' + qs + '" frameborder="0" allowfullscreen></iframe>'; }else if(vimeoUrl){ qs=ui.parseUri(url, { 'autoplay':(plugin.settings.autoplayVideos ? '1':'0'), 'byline':'0', 'portrait':'0', 'color': plugin.settings.vimeoColor });iframe='<iframe width="560" height="315" src="//player.vimeo.com/video/' + vimeoUrl[1] + '?' + qs + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'; }else{ iframe='<iframe width="560" height="315" src="' + url + '" frameborder="0" allowfullscreen></iframe>'; } return '<div class="swipebox-video-container" style="max-width:' + plugin.settings.videoMaxWidth + 'px"><div class="swipebox-video">' + iframe + '</div></div>'; }, loadMedia:function(src, callback){ if(src.trim().indexOf('#')===0){ callback.call($('<div>', { 'class':'swipebox-inline-container' }) .append($(src) .clone() .toggleClass(plugin.settings.toggleClassOnLoad) )); }else{ if(! this.isVideo(src) ){ var img=$('<img>').on('load', function(){ callback.call(img); }); img.attr('src', src); }} }, getNext:function (){ var $this=this, src, index=$('#swipebox-slider .slide').index($('#swipebox-slider .slide.current') ); if(index + 1 < elements.length){ src=$('#swipebox-slider .slide').eq(index).contents().find('iframe').attr('src'); $('#swipebox-slider .slide').eq(index).contents().find('iframe').attr('src', src); index++; $this.setSlide(index); $this.preloadMedia(index+1); if(plugin.settings.nextSlide){ plugin.settings.nextSlide(index); }}else{ if(plugin.settings.loopAtEnd===true){ src=$('#swipebox-slider .slide').eq(index).contents().find('iframe').attr('src'); $('#swipebox-slider .slide').eq(index).contents().find('iframe').attr('src', src); index=0; $this.preloadMedia(index); $this.setSlide(index); $this.preloadMedia(index + 1); if(plugin.settings.nextSlide){ plugin.settings.nextSlide(index); }}else{ $('#swipebox-overlay').addClass('rightSpring'); setTimeout(function(){ $('#swipebox-overlay').removeClass('rightSpring'); }, 500); }} }, getPrev:function (){ var index=$('#swipebox-slider .slide').index($('#swipebox-slider .slide.current') ), src; if(index > 0){ src=$('#swipebox-slider .slide').eq(index).contents().find('iframe').attr('src'); $('#swipebox-slider .slide').eq(index).contents().find('iframe').attr('src', src); index--; this.setSlide(index); this.preloadMedia(index-1); if(plugin.settings.prevSlide){ plugin.settings.prevSlide(index); }}else{ $('#swipebox-overlay').addClass('leftSpring'); setTimeout(function(){ $('#swipebox-overlay').removeClass('leftSpring'); }, 500); }}, nextSlide:function(index){ }, prevSlide:function(index){ }, closeSlide:function (){ $('html').removeClass('swipebox-html'); $('html').removeClass('swipebox-touch'); $(window).trigger('resize'); this.destroy(); }, destroy:function (){ $(window).unbind('keyup'); $('body').unbind('touchstart'); $('body').unbind('touchmove'); $('body').unbind('touchend'); $('#swipebox-slider').unbind(); $('#swipebox-overlay').remove(); if(! $.isArray(elem) ){ elem.removeData('_swipebox'); } if(this.target){ this.target.trigger('swipebox-destroy'); } $.swipebox.isOpen=false; if(plugin.settings.afterClose){ plugin.settings.afterClose(); }} }; plugin.init(); }; $.fn.swipebox=function(options){ if(! $.data(this, '_swipebox') ){ var swipebox=new $.swipebox(this, options); this.data('_swipebox', swipebox); } return this.data('_swipebox'); };}(window, document, jQuery) ); */
(function (root, factory){
if(typeof define==='function'&&define.amd){
define(['jquery'], factory);
}else if(typeof exports==='object'){
module.exports=factory(require('jquery'));
}else{
root.lightbox=factory(root.jQuery);
}}(this, function ($){
function Lightbox(options){
this.album=[];
this.currentImageIndex=void 0;
this.init();
this.options=$.extend({}, this.constructor.defaults);
this.option(options);
}
Lightbox.defaults={
albumLabel: 'Image %1 of %2',
alwaysShowNavOnTouchDevices: false,
fadeDuration: 600,
fitImagesInViewport: true,
imageFadeDuration: 600,
positionFromTop: 50,
resizeDuration: 700,
showImageNumberLabel: true,
wrapAround: false,
disableScrolling: false,
sanitizeTitle: false
};
Lightbox.prototype.option=function(options){
$.extend(this.options, options);
};
Lightbox.prototype.imageCountLabel=function(currentImageNum, totalImages){
return this.options.albumLabel.replace(/%1/g, currentImageNum).replace(/%2/g, totalImages);
};
Lightbox.prototype.init=function(){
var self=this;
$(document).ready(function(){
self.enable();
self.build();
});
};
Lightbox.prototype.enable=function(){
var self=this;
$('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]', function(event){
self.start($(event.currentTarget));
return false;
});
};
Lightbox.prototype.build=function(){
if($('#lightbox').length > 0){
return;
}
var self=this;
$('<div id="lightboxOverlay" tabindex="-1" class="lightboxOverlay"></div><div id="lightbox" tabindex="-1" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt=""/><div class="lb-nav"><a class="lb-prev" aria-label="Previous image" href="" ></a><a class="lb-next" aria-label="Next image" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo($('body'));
this.$lightbox=$('#lightbox');
this.$overlay=$('#lightboxOverlay');
this.$outerContainer=this.$lightbox.find('.lb-outerContainer');
this.$container=this.$lightbox.find('.lb-container');
this.$image=this.$lightbox.find('.lb-image');
this.$nav=this.$lightbox.find('.lb-nav');
this.containerPadding={
top: parseInt(this.$container.css('padding-top'), 10),
right: parseInt(this.$container.css('padding-right'), 10),
bottom: parseInt(this.$container.css('padding-bottom'), 10),
left: parseInt(this.$container.css('padding-left'), 10)
};
this.imageBorderWidth={
top: parseInt(this.$image.css('border-top-width'), 10),
right: parseInt(this.$image.css('border-right-width'), 10),
bottom: parseInt(this.$image.css('border-bottom-width'), 10),
left: parseInt(this.$image.css('border-left-width'), 10)
};
this.$overlay.hide().on('click', function(){
self.end();
return false;
});
this.$lightbox.hide().on('click', function(event){
if($(event.target).attr('id')==='lightbox'){
self.end();
}});
this.$outerContainer.on('click', function(event){
if($(event.target).attr('id')==='lightbox'){
self.end();
}
return false;
});
this.$lightbox.find('.lb-prev').on('click', function(){
if(self.currentImageIndex===0){
self.changeImage(self.album.length - 1);
}else{
self.changeImage(self.currentImageIndex - 1);
}
return false;
});
this.$lightbox.find('.lb-next').on('click', function(){
if(self.currentImageIndex===self.album.length - 1){
self.changeImage(0);
}else{
self.changeImage(self.currentImageIndex + 1);
}
return false;
});
this.$nav.on('mousedown', function(event){
if(event.which===3){
self.$nav.css('pointer-events', 'none');
self.$lightbox.one('contextmenu', function(){
setTimeout(function(){
this.$nav.css('pointer-events', 'auto');
}.bind(self), 0);
});
}});
this.$lightbox.find('.lb-loader, .lb-close').on('click', function(){
self.end();
return false;
});
};
Lightbox.prototype.start=function($link){
var self=this;
var $window=$(window);
$window.on('resize', $.proxy(this.sizeOverlay, this));
this.sizeOverlay();
this.album=[];
var imageNumber=0;
function addToAlbum($link){
self.album.push({
alt: $link.attr('data-alt'),
link: $link.attr('href'),
title: $link.attr('data-title')||$link.attr('title')
});
}
var dataLightboxValue=$link.attr('data-lightbox');
var $links;
if(dataLightboxValue){
$links=$($link.prop('tagName') + '[data-lightbox="' + dataLightboxValue + '"]');
for (var i=0; i < $links.length; i=++i){
addToAlbum($($links[i]));
if($links[i]===$link[0]){
imageNumber=i;
}}
}else{
if($link.attr('rel')==='lightbox'){
addToAlbum($link);
}else{
$links=$($link.prop('tagName') + '[rel="' + $link.attr('rel') + '"]');
for (var j=0; j < $links.length; j=++j){
addToAlbum($($links[j]));
if($links[j]===$link[0]){
imageNumber=j;
}}
}}
var top=$window.scrollTop() + this.options.positionFromTop;
var left=$window.scrollLeft();
this.$lightbox.css({
top: top + 'px',
left: left + 'px'
}).fadeIn(this.options.fadeDuration);
if(this.options.disableScrolling){
$('body').addClass('lb-disable-scrolling');
}
this.changeImage(imageNumber);
};
Lightbox.prototype.changeImage=function(imageNumber){
var self=this;
var filename=this.album[imageNumber].link;
var filetype=filename.split('.').slice(-1)[0];
var $image=this.$lightbox.find('.lb-image');
this.disableKeyboardNav();
this.$overlay.fadeIn(this.options.fadeDuration);
$('.lb-loader').fadeIn('slow');
this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();
this.$outerContainer.addClass('animating');
var preloader=new Image();
preloader.onload=function(){
var $preloader;
var imageHeight;
var imageWidth;
var maxImageHeight;
var maxImageWidth;
var windowHeight;
var windowWidth;
$image.attr({
'alt': self.album[imageNumber].alt,
'src': filename
});
$preloader=$(preloader);
$image.width(preloader.width);
$image.height(preloader.height);
windowWidth=$(window).width();
windowHeight=$(window).height();
maxImageWidth=windowWidth - self.containerPadding.left - self.containerPadding.right - self.imageBorderWidth.left - self.imageBorderWidth.right - 20;
maxImageHeight=windowHeight - self.containerPadding.top - self.containerPadding.bottom - self.imageBorderWidth.top - self.imageBorderWidth.bottom - self.options.positionFromTop - 70;
if(filetype==='svg'){
if((preloader.width===0)||preloader.height===0){
$image.width(maxImageWidth);
$image.height(maxImageHeight);
}}
if(self.options.fitImagesInViewport){
if(self.options.maxWidth&&self.options.maxWidth < maxImageWidth){
maxImageWidth=self.options.maxWidth;
}
if(self.options.maxHeight&&self.options.maxHeight < maxImageHeight){
maxImageHeight=self.options.maxHeight;
}}else{
maxImageWidth=self.options.maxWidth||preloader.width||maxImageWidth;
maxImageHeight=self.options.maxHeight||preloader.height||maxImageHeight;
}
if((preloader.width > maxImageWidth)||(preloader.height > maxImageHeight)){
if((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)){
imageWidth=maxImageWidth;
imageHeight=parseInt(preloader.height / (preloader.width / imageWidth), 10);
$image.width(imageWidth);
$image.height(imageHeight);
}else{
imageHeight=maxImageHeight;
imageWidth=parseInt(preloader.width / (preloader.height / imageHeight), 10);
$image.width(imageWidth);
$image.height(imageHeight);
}}
self.sizeContainer($image.width(), $image.height());
};
preloader.src=this.album[imageNumber].link;
this.currentImageIndex=imageNumber;
};
Lightbox.prototype.sizeOverlay=function(){
var self=this;
setTimeout(function(){
self.$overlay
.width($(document).width())
.height($(document).height());
}, 0);
};
Lightbox.prototype.sizeContainer=function(imageWidth, imageHeight){
var self=this;
var oldWidth=this.$outerContainer.outerWidth();
var oldHeight=this.$outerContainer.outerHeight();
var newWidth=imageWidth + this.containerPadding.left + this.containerPadding.right + this.imageBorderWidth.left + this.imageBorderWidth.right;
var newHeight=imageHeight + this.containerPadding.top + this.containerPadding.bottom + this.imageBorderWidth.top + this.imageBorderWidth.bottom;
function postResize(){
self.$lightbox.find('.lb-dataContainer').width(newWidth);
self.$lightbox.find('.lb-prevLink').height(newHeight);
self.$lightbox.find('.lb-nextLink').height(newHeight);
self.$overlay.focus();
self.showImage();
}
if(oldWidth!==newWidth||oldHeight!==newHeight){
this.$outerContainer.animate({
width: newWidth,
height: newHeight
}, this.options.resizeDuration, 'swing', function(){
postResize();
});
}else{
postResize();
}};
Lightbox.prototype.showImage=function(){
this.$lightbox.find('.lb-loader').stop(true).hide();
this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration);
this.updateNav();
this.updateDetails();
this.preloadNeighboringImages();
this.enableKeyboardNav();
};
Lightbox.prototype.updateNav=function(){
var alwaysShowNav=false;
try {
document.createEvent('TouchEvent');
alwaysShowNav=(this.options.alwaysShowNavOnTouchDevices) ? true:false;
} catch (e){}
this.$lightbox.find('.lb-nav').show();
if(this.album.length > 1){
if(this.options.wrapAround){
if(alwaysShowNav){
this.$lightbox.find('.lb-prev, .lb-next').css('opacity', '1');
}
this.$lightbox.find('.lb-prev, .lb-next').show();
}else{
if(this.currentImageIndex > 0){
this.$lightbox.find('.lb-prev').show();
if(alwaysShowNav){
this.$lightbox.find('.lb-prev').css('opacity', '1');
}}
if(this.currentImageIndex < this.album.length - 1){
this.$lightbox.find('.lb-next').show();
if(alwaysShowNav){
this.$lightbox.find('.lb-next').css('opacity', '1');
}}
}}
};
Lightbox.prototype.updateDetails=function(){
var self=this;
if(typeof this.album[this.currentImageIndex].title!=='undefined' &&
this.album[this.currentImageIndex].title!==''){
var $caption=this.$lightbox.find('.lb-caption');
if(this.options.sanitizeTitle){
$caption.text(this.album[this.currentImageIndex].title);
}else{
$caption.html(this.album[this.currentImageIndex].title);
}
$caption.fadeIn('fast');
}
if(this.album.length > 1&&this.options.showImageNumberLabel){
var labelText=this.imageCountLabel(this.currentImageIndex + 1, this.album.length);
this.$lightbox.find('.lb-number').text(labelText).fadeIn('fast');
}else{
this.$lightbox.find('.lb-number').hide();
}
this.$outerContainer.removeClass('animating');
this.$lightbox.find('.lb-dataContainer').fadeIn(this.options.resizeDuration, function(){
return self.sizeOverlay();
});
};
Lightbox.prototype.preloadNeighboringImages=function(){
if(this.album.length > this.currentImageIndex + 1){
var preloadNext=new Image();
preloadNext.src=this.album[this.currentImageIndex + 1].link;
}
if(this.currentImageIndex > 0){
var preloadPrev=new Image();
preloadPrev.src=this.album[this.currentImageIndex - 1].link;
}};
Lightbox.prototype.enableKeyboardNav=function(){
this.$lightbox.on('keyup.keyboard', $.proxy(this.keyboardAction, this));
this.$overlay.on('keyup.keyboard', $.proxy(this.keyboardAction, this));
};
Lightbox.prototype.disableKeyboardNav=function(){
this.$lightbox.off('.keyboard');
this.$overlay.off('.keyboard');
};
Lightbox.prototype.keyboardAction=function(event){
var KEYCODE_ESC=27;
var KEYCODE_LEFTARROW=37;
var KEYCODE_RIGHTARROW=39;
var keycode=event.keyCode;
if(keycode===KEYCODE_ESC){
event.stopPropagation();
this.end();
}else if(keycode===KEYCODE_LEFTARROW){
if(this.currentImageIndex!==0){
this.changeImage(this.currentImageIndex - 1);
}else if(this.options.wrapAround&&this.album.length > 1){
this.changeImage(this.album.length - 1);
}}else if(keycode===KEYCODE_RIGHTARROW){
if(this.currentImageIndex!==this.album.length - 1){
this.changeImage(this.currentImageIndex + 1);
}else if(this.options.wrapAround&&this.album.length > 1){
this.changeImage(0);
}}
};
Lightbox.prototype.end=function(){
this.disableKeyboardNav();
$(window).off('resize', this.sizeOverlay);
this.$lightbox.fadeOut(this.options.fadeDuration);
this.$overlay.fadeOut(this.options.fadeDuration);
if(this.options.disableScrolling){
$('body').removeClass('lb-disable-scrolling');
}};
return new Lightbox();
}));
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){var b="waitForImages",c=function(a){return a.srcset&&a.sizes}(new Image);a.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage","cursor"],hasImageAttributes:["srcset"]},a.expr[":"]["has-src"]=function(b){return a(b).is('img[src][src!=""]')},a.expr[":"].uncached=function(b){return!!a(b).is(":has-src")&&!b.complete},a.fn.waitForImages=function(){var d,e,f,g=0,h=0,i=a.Deferred(),j=this,k=[],l=a.waitForImages.hasImageProperties||[],m=a.waitForImages.hasImageAttributes||[],n=/url\(\s*(['"]?)(.*?)\1\s*\)/g;if(a.isPlainObject(arguments[0])?(f=arguments[0].waitForAll,e=arguments[0].each,d=arguments[0].finished):1===arguments.length&&"boolean"===a.type(arguments[0])?f=arguments[0]:(d=arguments[0],e=arguments[1],f=arguments[2]),d=d||a.noop,e=e||a.noop,f=!!f,!a.isFunction(d)||!a.isFunction(e))throw new TypeError("An invalid callback was supplied.");return this.each(function(){var b=a(this);f?b.find("*").addBack().each(function(){var b=a(this);b.is("img:has-src")&&!b.is("[srcset]")&&k.push({src:b.attr("src"),element:b[0]}),a.each(l,function(a,c){var d,e=b.css(c);if(!e)return!0;for(;d=n.exec(e);)k.push({src:d[2],element:b[0]})}),a.each(m,function(a,c){var d=b.attr(c);return!d||void k.push({src:b.attr("src"),srcset:b.attr("srcset"),element:b[0]})})}):b.find("img:has-src").each(function(){k.push({src:this.src,element:this})})}),g=k.length,h=0,0===g&&(d.call(j),i.resolveWith(j)),a.each(k,function(f,k){var l=new Image,m="load."+b+" error."+b;a(l).one(m,function b(c){var f=[h,g,"load"==c.type];if(h++,e.apply(k.element,f),i.notifyWith(k.element,f),a(this).off(m,b),h==g)return d.call(j[0]),i.resolveWith(j[0]),!1}),c&&k.srcset&&(l.srcset=k.srcset,l.sizes=k.sizes),l.src=k.src}),i.promise()}});
(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k));
if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("<div />"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q,
u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0)-1,height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,c=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),
h.detach()),b={position:"",width:"",top:""},a.css(b).removeClass(t).trigger("sticky_kit:unstick")),B&&(b=f.height(),u+q>b&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"initial"}),
a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize",
y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n<K;n++)d=this[n],J(b(d));return this}}).call(this);
var $=jQuery.noConflict();
jQuery(function ($){ 'use strict';
if(jQuery(".gusta-sticky-column").length > 0){
jQuery(".gusta-sticky-column").stick_in_parent();
}
if(jQuery('body').hasClass('admin-bar')){
jQuery(window).on('load resize scroll',function(){
var admBar=0;
var scwidth=jQuery(window).width();
if(scwidth<782){ admBar=46; }else{ admBar=32; }
var scrolled=jQuery(this).scrollTop();;
if(scrolled<admBar){
if(scwidth<600){
var toppos=admBar - scrolled;
jQuery('.admin-bar div[class*="sticky-top"]').css('top', toppos + 'px');
}else{
jQuery('.admin-bar div[class*="sticky-top"]').css('top', admBar + 'px');
}}else{
if(scwidth<600){ jQuery('.admin-bar div[class*="sticky-top"]').css('top', '0px'); }}
});
}
$('.gusta-product-reviews .comment-form-rating #rating, .gusta-product-reviews .gusta_wc_rate_wrapper input').change(gustaupdateElements);
function gustaupdateElements(e){
var valueAttribute='[value="' + e.target.value + '"]';
$('.gusta-product-reviews .comment-form-rating #rating option' + valueAttribute).prop('selected', true);
$('.gusta-product-reviews .gusta_wc_rate_wrapper input' + valueAttribute).prop('checked', true);
}
(function (){ $(".dropdown-menu") .mouseenter(function (){ $(this).parent('li').addClass('active'); }) .mouseleave(function (){ $(this).parent('li').removeClass('active'); });}());
(function (){ if(navigator.userAgent.match(/(iPod|iPhone|iPad)/)){ $('*').css('cursor', 'pointer'); }}());
jQuery(function(){ jQuery('.gusta-full-width').each(function(){ jQuery(this).addClass('vc_row-full-width').attr('data-vc-full-width', 'true'); jQuery(this).find('div').first().css('position','initial'); });});
(function (){ jQuery(".gusta-section-toggle:not(.gusta-toggle-on-hover)").on("click", function(){
var data_toggle=jQuery(this).data("toggle");
if(jQuery(this).hasClass('active')){
jQuery(".gusta-section-toggle").removeClass("active");
}else{
jQuery(".gusta-section-toggle").removeClass("active");
jQuery("[data-toggle='" + data_toggle + "']").addClass("active");
}
if(jQuery("#" + data_toggle + "").hasClass("section-vertical")){
jQuery('body[class*="gusta-vertical-header"]').toggleClass('gusta-body-zero-margin');
}
window.dispatchEvent(new Event('resize'));
});
$(".gusta-section-toggle.gusta-toggle-on-hover").mouseover(function(){
var data_toggle=jQuery(this).data("toggle");
var disable_scroll=jQuery(this).data('disable-scroll');
jQuery('.hide-by-default, .gusta-show-section').addClass('gusta-hide-section').removeClass('gusta-show-section gusta-higher');
jQuery("#" + data_toggle + "").removeClass('gusta-hide-section').addClass('gusta-show-section gusta-higher');
if(disable_scroll){
jQuery('html,body').addClass('disable-scroll');
}else{
jQuery('html,body').removeClass('disable-scroll');
}
if(jQuery("#" + data_toggle + "").hasClass("section-vertical")){
jQuery('body[class*="gusta-vertical-header"]').addClass('gusta-body-zero-margin');
}
jQuery(".gusta-section-toggle").removeClass("active");
jQuery("[data-toggle='" + data_toggle + "']").addClass("active");
gusta_fix_vc_full_width();
})
.mouseout(function(){});
}());
jQuery('.gusta-section-toggle:not(.gusta-toggle-on-hover)').click(function(){
var section='#' + jQuery(this).data('toggle');
var disable_scroll=jQuery(this).data('disable-scroll');
jQuery('.hide-by-default:not('+section+')').addClass('gusta-hide-section').removeClass('gusta-show-section gusta-higher');
jQuery(section).toggleClass('gusta-hide-section').toggleClass('gusta-show-section gusta-higher');
if(disable_scroll){
jQuery('html,body').toggleClass('disable-scroll');
}else{
jQuery('html,body').removeClass('disable-scroll');
}
gusta_fix_vc_full_width();
});
/*$(document).click(function(e){
$(".gusta-show-section").each(function(){
var section_id=$(this).attr('id');
if($('[data-toggle="'+section_id+'"]').hasClass('.gusta-toggle-on-hover')){
if(!section_id.is(e.target)&&section_id.has(e.target).length===0){
jQuery(".gusta-section-toggle").removeClass("active");
section_id.removeClass('gusta-show-section gusta-higher').addClass('gusta-hide-section hide-by-default');
jQuery('body, html').removeClass('disable-scroll');
if(jQuery(section_id).hasClass("section-vertical")){
jQuery('body[class*="gusta-vertical-header"]').toggleClass('gusta-body-zero-margin');
}}
}});
});*/
jQuery('.gusta-close-button').on('click', function(){
var container=jQuery(this).closest('.gusta-section');
jQuery(".gusta-section-toggle").removeClass("active");
container.removeClass('gusta-show-section gusta-higher').addClass('gusta-hide-section hide-by-default');
jQuery('body, html').removeClass('disable-scroll');
if(jQuery(container).hasClass("section-vertical")){
jQuery('body[class*="gusta-vertical-header"]').toggleClass('gusta-body-zero-margin');
}});
jQuery('.gusta-nav').find('select').on('change', function(){ var selected=jQuery(this).find(':selected').val(); if(selected!=''){ window.location.href=selected; }});
jQuery.fn.element_cover=function(){
jQuery('.gusta-cover-row').each(function(){
jQuery(this).parentsUntil('.wpb_row').css('position','initial');
jQuery(this).closest('.wpb_row').css({'position':'relative', 'z-index':'0'});
});
jQuery('.gusta-cover-column').each(function(){
jQuery(this).parentsUntil('.wpb_column').css('position','initial');
jQuery(this).closest('.wpb_column').css({'position':'relative', 'z-index':'0'});
});
};
jQuery(function(){ jQuery('body').element_cover(); });
jQuery ('.gusta-mega-menu, .gusta-dropdown-menu').closest('.wpb_row').css({'position':'relative', 'overflow':'initial'});
(function (){ jQuery(document).ready(function(){
jQuery('.post-listing-container').addClass('show-container'); });}());
(function (){ $(".smooth-scroll:not(body),.smooth-scroll:not(body) a").click(function(event){ event.preventDefault(); var dest=0; var hash=this.hash; if(hash=='undefined'){ var offs=$(hash).offset(); var offtop=offs.top; if(offtop > $(document).height()-$(window).height()){ dest=$(document).height()-$(window).height(); }else{ dest=offs.top; } $('html,body').animate({scrollTop:dest}, 1000,'swing'); }});}());
(function (){ $('.gusta-mega-menu-item').hover(function(e){ gusta_fix_vc_full_width() });}());
(function(){
$('.gusta-nav.horizontal:not(.no-child)').hover(function(){
$(this).gusta_higher();
});
$('.gusta-search-form').hover(function(){
$(this).gusta_higher();
});
$('.vertical .gusta-dropdown i').click(function(){
$(this).parent().toggleClass('gusta-children-open');
$(this).toggleClass('fa-minus fa-plus');
});
$(window).on('load resize scroll',function(){
if($(window).width() < 751){
$('.gusta-nav.gusta-nav-responsive').addClass('select').removeClass('horizontal');
}else{
$('.gusta-nav.gusta-nav-responsive').removeClass('select').addClass('horizontal');
}});
}());
/* Mega Menu On Click
(function (){ jQuery(".gusta-mega-menu-on-click a").on("click", function(){ if(jQuery(this).parent().hasClass('gusta-mega-menu-active')){ jQuery(this).parent().removeClass('gusta-mega-menu-active'); }else{ jQuery(this).parent().addClass('gusta-mega-menu-active'); gusta_fix_vc_full_width(); }});}());*/
$('li[class*="gusta-menu-item"]').each(function(){
$(this).addClass('menu-item');
});
$('.menu-item').click(function (){
if($(this).parent().parent().find(".gusta-mega-menu").length > 0){
var menu_item_id=$(this).attr('class');
var mega_menu_id='';
var splitString=menu_item_id.split(" ");
$.each(splitString, function(index, value){
if(value.indexOf("menu-item-") >=0){
mega_menu_id=value.replace('gusta-','');
mega_menu_id=mega_menu_id.replace('menu-item-','gusta-mega-menu-');
}});
if($('#' + mega_menu_id).length){
if($('#' + mega_menu_id).hasClass('gusta-trigger-on-click')){
$('#' + mega_menu_id).toggleClass('gusta-mega-menu-active');
$(this).toggleClass('current-menu-item');
}}
}});
$('.menu-item').hover(function (){
if($(this).parent().parent().find(".gusta-mega-menu").length > 0){
var menu_item_id=$(this).attr('class');
var mega_menu_id='';
var splitString=menu_item_id.split(" ");
$.each(splitString, function(index, value){
if(value.indexOf("menu-item-") >=0){
mega_menu_id=value.replace('gusta-','');
mega_menu_id=mega_menu_id.replace('menu-item-','gusta-mega-menu-');
}});
if($('#' + mega_menu_id).length){
if($(this).parent().parent().find('#' + mega_menu_id).hasClass('gusta-trigger-on-hover')){
$(this).parent().parent().find('#' + mega_menu_id).addClass('gusta-mega-menu-active');
$(this).addClass('current-menu-item');
gusta_fix_vc_full_width();
}}
}}, function(){
if($(this).parent().parent().find(".gusta-mega-menu").length > 0){
if($('.gusta-mega-menu.gusta-trigger-on-hover:hover').length===0){
$('.gusta-trigger-on-hover').removeClass("gusta-mega-menu-active");
var menu_item_id=$(this).attr('class');
var mega_menu_id='';
var splitString=menu_item_id.split(" ");
$.each(splitString, function(index, value){
if(value.indexOf("menu-item-") >=0){
mega_menu_id=value.replace('gusta-','');
mega_menu_id=mega_menu_id.replace('menu-item-','gusta-mega-menu-');
}});
if($('#' + mega_menu_id).length > 0){
$(this).removeClass('current-menu-item');
}}
}});
$('.gusta-mega-menu.gusta-trigger-on-hover').hover(function (){
var mega_menu_id=$(this).attr('id');
var menu_item_id=mega_menu_id.replace('gusta-mega-menu-','menu-item-');
$(this).addClass('gusta-mega-menu-active');
$('#' + menu_item_id).addClass('current-menu-item');
}, function (){
if(!$('input').is(':focus')){
var mega_menu_id=$(this).attr('id');
var menu_item_id=mega_menu_id.replace('gusta-mega-menu-','menu-item-');
$(this).removeClass('gusta-mega-menu-active');
$('#' + menu_item_id).removeClass('current-menu-item');
$('#gusta-' + menu_item_id+', .gusta-' + menu_item_id).removeClass('current-menu-item');
}});
});
jQuery(window).on('load resize', function(event){
setTimeout(
function(){
jQuery('.owl-carousel').each(function(){
var $this=jQuery(this);
var theight=$this.find('.owl-item.active').height();
$this.find('.owl-height').css('height', theight);
});
}, 100);
});
jQuery.fn.gusta_higher=function(){
jQuery('.ss-element').removeClass('gusta-higher');
jQuery('.vc_row').removeClass('gusta-higher');
jQuery('.gusta-section').removeClass('gusta-higher');
jQuery(this).addClass('gusta-higher');
jQuery(this).closest('.vc_row').addClass('gusta-higher');
jQuery(this).closest('.gusta-section').addClass('gusta-higher');
jQuery(this).parent().parent().parent().parent().parent().closest('.vc_row').addClass('gusta-higher');
};
jQuery.fn.auto_suggest=function(options){
var results=jQuery(this).find('.results');
var search_term=jQuery(this).find('input').val();
var post_types=jQuery(this).find('input').data('posttypes');
var curr=0;
var auto_suggest=function(){
jQuery.ajax({
type:'post',
data:{
search_term: search_term,
post_types: post_types,
action: 'gusta_auto_suggest'
},
dataType:'html',
url:smart_sections.ajaxurl,
success:function(response){
if(response){
var newItems=jQuery(response);
results.html(newItems);
}else{
results.html('');
}},
error:function(jqXHR, textStatus, errorThrown){
console.log(jqXHR + ' :: ' + textStatus + ' :: ' + errorThrown);
}});
};
auto_suggest();
jQuery(document).mouseup(function(e){
if(!jQuery('.results').parent().is(e.target)&&jQuery('.results').parent().has(e.target).length===0){
jQuery('.results').html('');
}});
};
jQuery.fn.update_cart=function(options){
var results=jQuery(this);
var current_cart_count=jQuery(this).find('.gusta-cart-count').html();
var cart_type=jQuery(this).data('.cart-type');
var update_cart=function(){
jQuery.ajax({
type:'post',
data:{
current_cart_count: current_cart_count,
cart_type: cart_type,
action: 'gusta_update_cart'
},
dataType:'html',
url:smart_sections.ajaxurl,
success:function(response){
if(response){
var newItems=jQuery(response);
results.html(newItems);
}},
error:function(jqXHR, textStatus, errorThrown){
console.log(jqXHR + ' :: ' + textStatus + ' :: ' + errorThrown);
}});
};
update_cart();
};
jQuery.fn.update_cart_count=function(options){
var results=jQuery(this);
var update_cart_count=function(){
jQuery.ajax({
type:'post',
data:{
action: 'gusta_update_cart_count'
},
dataType:'html',
url:smart_sections.ajaxurl,
success:function(response){
if(response){
results.html(response);
}},
error:function(jqXHR, textStatus, errorThrown){
console.log(jqXHR + ' :: ' + textStatus + ' :: ' + errorThrown);
}});
};
update_cart_count();
};
window.setInterval(function(){
jQuery('.gusta-cart-icon').each(function(){
jQuery(this).find('.gusta-cart-count').update_cart_count();
jQuery(this).find('.gusta-shopping-cart').update_cart();
});
}, 10000);