(()=>{"use strict";const e={isDebug:function(){return new URLSearchParams(location.search).has("optml_debug")||null!==localStorage.getItem("optml_debug")},log:function(e,...t){this.isDebug()&&console[e]("[Optimole]",...t)},info:function(...e){this.log("info",...e)},warn:function(...e){this.log("warn",...e)},error:function(...e){this.log("error",...e)},table:function(e){this.isDebug()&&(console.log("[Optimole] Table:"),console.table(e))}},t={getKey:function(e,t){return`optml_pp_${e}_${t}`},isProcessed:function(t,n){try{const e=this.getKey(t,n),i=sessionStorage.getItem(e);return!!i&&(parseInt(i,10),Date.now(),!0)}catch(t){return e.error("Error checking sessionStorage:",t),!1}},markProcessed:function(t,n){try{const e=this.getKey(t,n);sessionStorage.setItem(e,Date.now().toString())}catch(t){e.error("Error setting sessionStorage:",t)}}},n={DEVICE_TYPES:{MOBILE:1,DESKTOP:2},MOBILE_BREAKPOINT:600,getDeviceType:function(){const t=window.innerWidth;return t<=this.MOBILE_BREAKPOINT?(e.info("Device detected as mobile based on width:",t),this.DEVICE_TYPES.MOBILE):(e.info("Device detected as desktop based on width:",t),this.DEVICE_TYPES.DESKTOP)},isMobile:function(){return this.getDeviceType()===this.DEVICE_TYPES.MOBILE},isDesktop:function(){return this.getDeviceType()===this.DEVICE_TYPES.DESKTOP}},i={sendToRestApi:function(n){const{restUrl:i}=window.optimoleDataOptimizer||{};if(!i)return void e.error("REST API URL not available");const o=i+"/optimizations",r=new Blob([JSON.stringify(n)],{type:"application/json"});navigator.sendBeacon(o,r)?(e.info("Data sent successfully using sendBeacon"),t.markProcessed(n.u,n.d)):(e.error("Failed to send data using sendBeacon"),this._sendWithFetch(o,n))},_sendWithFetch:function(n,i){fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}).then((e=>{if(!e.ok)throw new Error("Network response was not ok");return e.json()})).then((n=>{e.info("Data sent successfully using fetch fallback:",n),t.markProcessed(i.u,i.d)})).catch((t=>{e.error("Error sending data using fetch fallback:",t)}))}},o={debounce:function(e,t){let n;return function(){clearTimeout(n),n=setTimeout((()=>e.apply(this,arguments)),t)}},getUniqueSelector:function(e){if(!e||e===document.body)return"body";if(e.id)return`#${e.id}`;const t=e.tagName.toLowerCase();let n="";e.className&&"string"==typeof e.className&&(n=e.className.includes("optml-bg-lazyloaded")?"."+e.className.trim().split(/\s+/).filter((e=>"optml-bg-lazyloaded"!==e)).join("."):"."+e.className.trim().replace(/\s+/g,"."));const i=e.parentElement;if(!i||i===document.body)return`body > ${t}${n}`;let o="";const r=i.children;let s=0,a=0;for(let t=0;t<r.length;t++)r[t].tagName===e.tagName&&(s++,r[t]===e&&(a=s));return s>1&&(o=`:nth-of-type(${a})`),`${i.id?`#${i.id}`:this.getUniqueSelector(i)} > ${t}${n}${o}`},hasBackgroundImage:function(e,t=!1){const n=window.getComputedStyle(e).backgroundImage;return!(!n||"none"===n||!n.includes("url("))&&(!t||n)},extractUrlsFromBgImage:function(e){if(!e)return null;const t=[],n=/url\(['"]?(.*?)['"]?\)/g;let i;for(;null!==(i=n.exec(e));)i[1]&&t.push(i[1]);return t.length>0?t:null},checkPageConditions:function(){return{hasValidViewport:window.innerWidth>0&&window.innerHeight>0,isVisible:"hidden"!==document.visibilityState||document.prerendering,isComplete:"complete"===document.readyState}},waitForPageLoad:function(){return"complete"===document.readyState?Promise.resolve():new Promise((e=>{window.addEventListener("load",e,{once:!0})}))},waitForIdleTime:function(){return new Promise((e=>{"function"==typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e,200)}))},waitForViewportImages:function(e=1e3){return new Promise((t=>{"complete"!==document.readyState?window.addEventListener("load",(()=>{setTimeout(t,e)}),{once:!0}):setTimeout(t,e)}))}},r={setupBackgroundImageObservation:function(t,n,i,r){const s=new MutationObserver((t=>{for(const n of t)if("attributes"===n.type&&"class"===n.attributeName){const t=n.target;if(t.classList.contains("optml-bg-lazyloaded")&&o.hasBackgroundImage(t)){r.observe(t),s.disconnect(t);const n=t.getAttribute("data-optml-specific-selector");e.info(`Background element "${n}" is now observable`)}}})),a=[];return t.forEach((e=>{const t=o.getUniqueSelector(e);e.setAttribute("data-optml-bg-selector",n),e.setAttribute("data-optml-specific-selector",t),e.classList.contains("optml-bg-lazyloaded")&&o.hasBackgroundImage(e)?r.observe(e):a.push(e)})),a.length>0&&(a.forEach((e=>{s.observe(e,{attributes:!0,attributeFilter:["class"]})})),setTimeout((()=>{s.disconnect(),e.info(`Stopped waiting for lazyload on ${n} elements`)}),5e3)),a.length},extractBackgroundImageUrls:function(t){const n=new Map;return t&&Array.isArray(t)?(t.forEach((t=>{const i=new Map;n.set(t,i);try{document.querySelectorAll(t).forEach((t=>{if(t.classList.contains("optml-bg-lazyloaded")){const n=o.hasBackgroundImage(t,!0);if(!1===n)return;const r=o.getUniqueSelector(t);if(!r)return;const s=o.extractUrlsFromBgImage(n);s&&s.length>0&&(i.set(r,s),e.info(`Found background image URL(s) for "${r}":`,s))}}))}catch(n){e.error("Error extracting background URLs for selector:",t,n)}})),n):n},processBackgroundSelectors:function(t,n){const i=new Map;let o=0;return t&&Array.isArray(t)&&0!==t.length?(e.info("Processing background selectors:",t),t.forEach((t=>{try{const r=document.querySelectorAll(t);if(0===r.length)return void e.warn("No elements found for background selector:",t);i.set(t,[]),o+=this.setupBackgroundImageObservation(Array.from(r),t,i,n),e.info(`Processed ${r.length} elements for background selector: ${t}`)}catch(n){e.error("Error processing background selector:",t,n)}})),{selectorMap:i,pendingElements:o}):{selectorMap:i,pendingElements:o}}},s={detectLcpElement:async function(){const t={element:null,imageId:null,bgSelector:null,bgUrls:null};if(!PerformanceObserver.supportedEntryTypes.includes("largest-contentful-paint"))return e.info("LCP detection not supported in this browser"),t;const n=performance.getEntriesByType("largest-contentful-paint");if(n&&n.length>0){const i=n[n.length-1];i&&i.element&&(t.element=i.element,e.info("LCP element found from existing entries:",t.element),this._processLcpElement(i.element,t))}else e.info("Setting up LCP observer"),await new Promise((n=>{const i=new PerformanceObserver((o=>{const r=o.getEntries();if(0===r.length)return;const s=r[r.length-1];s&&s.element&&(t.element=s.element,e.info("LCP element detected:",t.element),this._processLcpElement(s.element,t)),i.disconnect(),n()}));i.observe({type:"largest-contentful-paint",buffered:!0}),setTimeout((()=>{i.disconnect(),n()}),1500)}));return t},_processLcpElement:function(t,n){if(t)if("IMG"===t.tagName){const i=t.getAttribute("data-opt-id");i&&(n.imageId=parseInt(i,10),e.info("LCP element is an Optimole image with ID:",n.imageId))}else{const i=o.hasBackgroundImage(t,!0);!1!==i&&(n.bgSelector=o.getUniqueSelector(t),n.bgUrls=o.extractUrlsFromBgImage(i),e.info("LCP element has background image:",n.bgSelector,n.bgUrls))}}},a={DEVICE_BREAKPOINTS:{MOBILE_SMALL:320,MOBILE_MEDIUM:375,MOBILE_LARGE:425,TABLET_SMALL:768,TABLET_LARGE:1024,DESKTOP_SMALL:1200,DESKTOP_MEDIUM:1440,DESKTOP_LARGE:1920,DESKTOP_XL:2560},DPR_MULTIPLIERS:[1,2],CONFIG:{MIN_SIZE:200,MAX_VARIATIONS:8,SIZE_TOLERANCE:50},configure:function(t){t.minSize&&(this.CONFIG.MIN_SIZE=t.minSize),t.maxVariations&&(this.CONFIG.MAX_VARIATIONS=t.maxVariations),t.sizeTolerance&&(this.CONFIG.SIZE_TOLERANCE=t.sizeTolerance),e.info("Srcset detector configured:",this.CONFIG)},_waitForImagesToLoad:function(t){const n=Array.from(t).map((t=>new Promise((n=>{if(t.complete&&t.naturalWidth>0)return void n(t);const i=()=>{t.removeEventListener("load",i),t.removeEventListener("error",o),n(t)},o=()=>{t.removeEventListener("load",i),t.removeEventListener("error",o),e.warn("Image failed to load:",t.src),n(t)};t.addEventListener("load",i),t.addEventListener("error",o),setTimeout((()=>{t.removeEventListener("load",i),t.removeEventListener("error",o),e.warn("Image load timeout:",t.src),n(t)}),5e3)}))));return Promise.all(n)},detectMissingSrcsets:async function(){const t={},n={},i=document.querySelectorAll("img[data-opt-id]");if(0===i.length)return e.info("No Optimole images found for srcset analysis"),{srcset:t,crop:n};e.info(`Found ${i.length} Optimole images, waiting for them to load...`);const o=await this._waitForImagesToLoad(i);return e.info(`Loaded ${o.length} images, analyzing srcset requirements...`),o.forEach((i=>{try{const o=parseInt(i.getAttribute("data-opt-id"),10);if(isNaN(o))return;const r=i.hasAttribute("data-opt-src"),s=i.hasAttribute("data-opt-lazy-loaded");if(!r||r&&s){const s=r?"lazyload completed (has data-opt-lazy-loaded)":"not using lazyload";e.info(`Image ${o} ${s}, analyzing srcset requirements`);const a=this._analyzeSrcsetRequirements(i,o);a&&a.srcset&&a.srcset.length>0&&(t[o]=a.srcset,n[o]=a.requiresCropping)}}catch(t){e.error("Error analyzing image for srcset:",i,t)}})),e.info("Images requiring srcset variations:",Object.keys(t).length),e.info("Images with crop status:",Object.keys(n).length),{srcset:t,crop:n}},_analyzeSrcsetRequirements:function(t,i){const o=t.offsetWidth||t.clientWidth,r=t.offsetHeight||t.clientHeight,s=t.naturalWidth||0,a=t.naturalHeight||0;if(!(o&&r&&s&&a))return e.warn(`Skipping image ${i}: insufficient dimension data`),null;e.info(`Analyzing image ${i}:`,{current:`${o}x${r}`,natural:`${s}x${a}`});const c=s/a,l=o/r,d=Math.abs(c-l),u=this._requiresCropping(t,d,c,l),g=n.getDeviceType(),m=u?l:c,f=this._calculateRequiredSizes(o,r,m,g,s,a),p=t.getAttribute("srcset"),h=this._parseExistingSrcset(p),w=this._findMissingSizes(f,h);return 0===w.length?(e.info(`Image ${i} already has adequate srcset coverage`),null):(e.info(`Image ${i} srcset analysis:`,{currentSize:{w:o,h:r},naturalSize:{w:s,h:a},requiredSizes:f,naturalAspectRatio:Math.round(1e3*c)/1e3,currentAspectRatio:Math.round(1e3*l)/1e3,aspectRatioDifference:Math.round(1e3*d)/1e3,requiresCropping:u,aspectRatioForSizing:Math.round(1e3*m)/1e3,deviceType:g,missingSizes:w,existingSrcset:p||null}),e.info(`[Optimole Debug] Image ${i} aspect ratio analysis:`,{natural:`${s}x${a} (${Math.round(1e3*c)/1e3}:1)`,current:`${o}x${r} (${Math.round(1e3*l)/1e3}:1)`,difference:Math.round(1e3*d)/1e3,requiresCropping:u,aspectRatioForSizing:Math.round(1e3*m)/1e3,reason:u?"Aspect ratio significantly different":"Aspect ratios match within tolerance"}),{srcset:w.map((e=>({w:e.w,h:e.h,d:e.dpr,s:e.descriptor,b:e.breakpoint}))),requiresCropping:u})},_requiresCropping:function(t,n,i,o){let r=!1;try{r="cover"===window.getComputedStyle(t).objectFit,r&&e.info("Image has object-fit: cover")}catch(t){e.warn("Could not get computed style for object-fit check:",t)}if(n<=.05)return!1;let s=!1;s=n>=.15||Math.abs(o-i)/i>.1;const a=r&&s;return a&&e.info(`Image requires cropping: object-fit cover=${r}, aspect ratio=${s}`),a},_calculateRequiredSizes:function(t,n,i,o,r,s){const a=[];this._generateResponsiveSizes(t,n,i,r,s).forEach((e=>{a.push(e)}));const c=this._removeDuplicateSizes(a).sort(((e,t)=>e.w-t.w));return c.length>this.CONFIG.MAX_VARIATIONS?(e.info(`Limiting srcset variations from ${c.length} to ${this.CONFIG.MAX_VARIATIONS}`),this._selectBestVariations(c,this.CONFIG.MAX_VARIATIONS)):c},_parseExistingSrcset:function(e){if(!e)return[];const t=[];return e.split(",").map((e=>e.trim())).forEach((e=>{const n=e.split(/\s+/);if(n.length>=2){const e=n[n.length-1];if(e.endsWith("w")){const i=parseInt(e.slice(0,-1),10);isNaN(i)||t.push({w:i,descriptor:e,url:n.slice(0,-1).join(" ")})}}})),t},_generateResponsiveSizes:function(t,n,i,o,r){const s=[],a=window.innerWidth,c=Math.min(t/a,1);return e.info(`Generating srcset for current ratio: ${Math.round(100*c)}% of viewport`),Object.entries(this.DEVICE_BREAKPOINTS).map((([e,t])=>({viewport:t,label:e.toLowerCase().replace("_","-"),dpr:this.DPR_MULTIPLIERS}))).forEach((e=>{const t=Math.round(e.viewport*c);t<this.CONFIG.MIN_SIZE||t>1.2*o||e.dpr.forEach((n=>{const a=Math.round(t*n),l=Math.round(a/i);1===n&&a>o||this._isValidSize(a,l,o,r)&&a>=this.CONFIG.MIN_SIZE&&s.push({w:a,h:l,dpr:n,breakpoint:e.viewport,descriptor:`${a}w`,source:"responsive",category:`${e.label}-${Math.round(100*c)}`,label:`${e.label}-${a}w${n>1?`-${n}x`:""}`})}))})),!s.some((e=>Math.abs(e.w-t)<=this.CONFIG.SIZE_TOLERANCE))&&this._isValidSize(t,n,o,r)&&s.push({w:t,h:n,dpr:1,breakpoint:window.innerWidth,descriptor:`${t}w`,source:"current",category:"current",label:"current-size"}),s},_isValidSize:function(e,t,n,i){return e>=this.CONFIG.MIN_SIZE&&t>=this.CONFIG.MIN_SIZE&&e<=n&&t<=i},_findMissingSizes:function(e,t){const n=new Set(t.map((e=>e.w))),i=this.CONFIG.SIZE_TOLERANCE;return e.filter((e=>!Array.from(n).some((t=>Math.abs(t-e.w)<=i))))},_selectBestVariations:function(e,t){if(e.length<=t)return e;const n=e.filter((e=>1===e.dpr)),i=e.filter((e=>2===e.dpr)),o=[],r=Math.min(n.length,Math.ceil(.75*t)),s=t-r;if(n.length>0)if(n.length<=r)o.push(...n);else{const e=(n.length-1)/(r-1);for(let t=0;t<r;t++){const i=Math.round(t*e);o.push(n[i])}}if(s>0&&i.length>0)if(i.length<=s)o.push(...i);else{const e=i.sort(((e,t)=>e.w-t.w)),t=Math.floor(e.length/4),n=Math.ceil(3*e.length/4),r=e.slice(t,n),a=Math.max(1,Math.floor(r.length/s));for(let e=0;e<s&&e*a<r.length;e++)o.push(r[e*a])}return o.filter(((e,t,n)=>n.findIndex((t=>t.w===e.w))===t)).sort(((e,t)=>e.w-t.w))},_removeDuplicateSizes:function(e){const t=new Set;return e.filter((e=>{const n=`${e.w}x${e.h}`;return!t.has(n)&&(t.add(n),!0)}))},getSrcsetAnalysisSummary:function(){const e=document.querySelectorAll("img[data-opt-id]");let t=0,i=0,o=0,r=0;return e.forEach((e=>{const n=e.hasAttribute("data-opt-src"),s=e.hasAttribute("data-opt-lazy-loaded");!n||n&&s?(t++,n?s&&o++:r++):i++})),{totalOptimoleImages:e.length,includedImages:t,skippedImages:i,nonLazyloadImages:r,lazyLoadedImages:o,currentDeviceType:n.getDeviceType(),viewportSize:{w:window.innerWidth,h:window.innerHeight}}}},c={runProfiling:async function(){const c=o.checkPageConditions();if(!c.hasValidViewport)return e.info("Window must have non-zero dimensions for image detection."),null;if(!c.isVisible)return e.info("Page opened in background tab so image detection is not performed."),null;const{pageProfileId:l,missingDevices:d,bgSelectors:u}=window.optimoleDataOptimizer||{},g=n.getDeviceType(),m=l,f=d?d.split(","):[];if(e.info("Device Type:",g),e.info("Missing Devices:",f),e.info("Profile ID:",l),e.info("Background Selectors:",u||"None provided"),!f.includes(g.toString()))return e.info("Skipping device type, data already exists:",g),null;if(t.isProcessed(m,g))return e.info("Skipping detection, already processed this device/URL combination"),null;if(0!==window.pageYOffset&&0!==document.documentElement.scrollTop)return e.info("User is not at the top of the page, skipping image detection"),null;!c.isComplete&&window.optmlDomUtils&&(e.info("Waiting for page to fully load..."),await o.waitForPageLoad(),e.info("Page fully loaded, proceeding with detection")),e.info("Waiting for viewport images to load..."),await o.waitForViewportImages(1500),e.info("Viewport images loaded, proceeding with detection"),await o.waitForIdleTime();const p=await s.detectLcpElement();let h="hidden"!==document.visibilityState,w=!1;const b=o.debounce((()=>{w=!0,e.info("Window resized during detection, results may be affected")}),100),I=()=>{h="hidden"!==document.visibilityState,e.info("Page visibility changed:",h?"visible":"hidden")};window.addEventListener("resize",b,{passive:!0}),document.addEventListener("visibilitychange",I);const E=[];let S=new Map;const y=function(t,n){return new IntersectionObserver((i=>{i.forEach((i=>{if(i.isIntersecting){const o=i.target;if("IMG"===o.tagName){const e=parseInt(o.getAttribute("data-opt-id"),10);isNaN(e)||t.includes(e)||t.push(e)}else if(o.hasAttribute("data-optml-bg-selector")){const t=o.getAttribute("data-optml-bg-selector"),i=o.getAttribute("data-optml-specific-selector");if(t&&i&&n.has(t)){const o=n.get(t);o.includes(i)||(o.push(i),e.info(`Element with selector "${i}" is above the fold`))}}}}))}),{threshold:.1})}(E,S),{allOptimoleImages:v}=function(t){const n=document.querySelectorAll("img[data-opt-id]"),i=new Map;return n.forEach((n=>{const o=parseInt(n.getAttribute("data-opt-id"),10);isNaN(o)?e.warn("Invalid data-opt-id:",n.getAttribute("data-opt-id")):(i.set(n,o),t.observe(n))})),{allOptimoleImages:n,observedElements:i}}(y),A=function(t){const n={};return t.forEach((t=>{try{const i=parseInt(t.getAttribute("data-opt-id"),10);if(isNaN(i))return;const o=t.hasAttribute("data-opt-src"),r=t.hasAttribute("data-opt-lazy-loaded");if(o&&r){const o=parseInt(t.getAttribute("data-opt-optimized-width"),10),r=parseInt(t.getAttribute("data-opt-optimized-height"),10);if(!isNaN(o)&&!isNaN(r)&&o>0&&r>0)return n[i]={w:o,h:r},void e.info(`Image ${i} using optimized dimensions:`,{optimizedDimensions:`${o}x${r}`})}const s=t.hasAttribute("width")&&""!==t.getAttribute("width"),a=t.hasAttribute("height")&&""!==t.getAttribute("height");if(!s||!a){const o=t.naturalWidth||0,r=t.naturalHeight||0;o>0&&r>0&&(n[i]={w:o,h:r},e.info(`Image ${i} missing dimensions:`,{missingWidth:!s,missingHeight:!a,naturalDimensions:`${o}x${r}`}))}}catch(n){e.error("Error detecting dimensions for image:",t,n)}})),n}(v);e.info("Images with missing dimensions found:",Object.keys(A).length);const O=await a.detectMissingSrcsets(),L=O.srcset,M=O.crop;e.info("Images requiring srcset variations found:",Object.keys(L).length),e.info("Images with crop status found:",Object.keys(M).length);let _=new Map,N=0;if(u&&Array.isArray(u)&&u.length>0){const t=r.processBackgroundSelectors(u,y);S=t.selectorMap,N=t.pendingElements,_=r.extractBackgroundImageUrls(u);const n=N>0?600:300;e.info(`Waiting ${n}ms for ${N} pending background elements`),await new Promise((e=>setTimeout(e,n)))}else await new Promise((e=>setTimeout(e,300)));if(y.disconnect(),window.removeEventListener("resize",b),document.removeEventListener("visibilitychange",I),document.querySelectorAll("[data-optml-bg-selector]").forEach((e=>{e.removeAttribute("data-optml-bg-selector"),e.removeAttribute("data-optml-specific-selector")})),w&&e.warn("Window was resized during detection, results may not be accurate"),h||e.warn("Page became hidden during detection, results may not be accurate"),e.info("Above the fold images with data-opt-id:",E),e.info("Background selectors:",S),E.length>0||S.size>0||p.imageId||p.bgSelector||Object.keys(A).length>0||Object.keys(L).length>0){const t=this._processBackgroundSelectors(S,_),n={d:g,a:E,b:t,u:m,t:window.optimoleDataOptimizer?window.optimoleDataOptimizer._t:null,h:window.optimoleDataOptimizer?window.optimoleDataOptimizer.hmac:null,pu:window.optimoleDataOptimizer?window.optimoleDataOptimizer.pageProfileUrl:null,l:{i:p.imageId,s:p.bgSelector,u:p.bgUrls},m:A,s:L,c:M};return e.info("Sending data with LCP information:",{lcpImageId:p.imageId,lcpBgSelector:p.bgSelector,lcpBgUrls:p.bgUrls}),e.info("Sending background selectors:",t),e.info("Sending dimension data for images:",A),e.info("Sending srcset data for images:",L),e.info("Sending crop status data for images:",M),i.sendToRestApi(n),n}return e.info("No above-the-fold images, background elements, LCP elements, dimension data, or srcset data found"),null},_processBackgroundSelectors:function(e,t){const n={};return e.forEach(((e,i)=>{n[i]={},e.forEach((e=>{n[i][e]=null,t.has(i)&&t.get(i).has(e)&&(n[i][e]=t.get(i).get(e))}))})),n}};!function(){function e(){c&&c.runProfiling?c.runProfiling():console.error("[Optimole] Main module not available")}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}()})();
var wpAjaxUrl='https://outsourcing-portugal.co.uk/wp-admin/admin-ajax.php';var flBuilderUrl='https://outsourcing-portugal.co.uk/wp-content/plugins/beaver-builder-lite-version/';var FLBuilderLayoutConfig={anchorLinkAnimations:{duration:1000,easing:'swing',offset:100},paths:{pluginUrl:'https://outsourcing-portugal.co.uk/wp-content/plugins/beaver-builder-lite-version/',wpAjaxUrl:'https://outsourcing-portugal.co.uk/wp-admin/admin-ajax.php'},breakpoints:{small:768,medium:992,large:1200},waypoint:{offset:80},emptyColWidth:'0%'};(function($){if(typeof FLBuilderLayout!='undefined'){return;}
FLBuilderLayout={init:function(){FLBuilderLayout._destroy();FLBuilderLayout._initClasses();FLBuilderLayout._initBackgrounds();FLBuilderLayout._initButtons();FLBuilderLayout._initRowShapeLayerHeight();if(0===$('.fl-builder-edit').length){FLBuilderLayout._initAnchorLinks();FLBuilderLayout._initHash();FLBuilderLayout._initForms();FLBuilderLayout._reorderMenu();}else{FLBuilderLayout._initNestedColsWidth();}
$('body').removeClass('fl-no-js');},refreshGalleries:function(element){var $element='undefined'==typeof element?$('body'):$(element),mfContent=$element.find('.fl-mosaicflow-content'),wmContent=$element.find('.fl-gallery'),mfObject=null;if(mfContent){mfObject=mfContent.data('mosaicflow');if(mfObject){mfObject.columns=$([]);mfObject.columnsHeights=[];mfContent.data('mosaicflow',mfObject);mfContent.mosaicflow('refill');}}
if(wmContent){wmContent.trigger('refreshWookmark');}},refreshGridLayout:function(element){var $element='undefined'==typeof element?$('body'):$(element),msnryContent=$element.find('.masonry');if(msnryContent.length){msnryContent.masonry('layout');}},reloadSlider:function(content){var $content='undefined'==typeof content?$('body'):$(content);if($content.find('.bx-viewport > div').length>0){$.each($content.find('.bx-viewport > div'),function(key,slider){setTimeout(function(){$(slider).data('bxSlider').reloadSlider();},100);});}},resizeAudio:function(element){var $element='undefined'==typeof element?$('body'):$(element),audioPlayers=$element.find('.wp-audio-shortcode.mejs-audio'),player=null,mejsPlayer=null,rail=null,railWidth=400;if(audioPlayers.length&&typeof mejs!=='undefined'){audioPlayers.each(function(){player=$(this);mejsPlayer=mejs.players[player.attr('id')];rail=player.find('.mejs-controls .mejs-time-rail');var innerMejs=player.find('.mejs-inner'),total=player.find('.mejs-controls .mejs-time-total');if(typeof mejsPlayer!=='undefined'){railWidth=Math.ceil(player.width()*0.8);if(innerMejs.length){rail.css('width',railWidth+'px!important');mejsPlayer.options.autosizeProgress=true;setTimeout(function(){mejsPlayer.setControlsSize();},50);player.find('.mejs-inner').css({visibility:'visible',height:'inherit'});}}});}},preloadAudio:function(element){var $element='undefined'==typeof element?$('body'):$(element),contentWrap=$element.closest('.fl-accordion-item'),audioPlayers=$element.find('.wp-audio-shortcode.mejs-audio');if(!contentWrap.hasClass('fl-accordion-item-active')&&audioPlayers.find('.mejs-inner').length){audioPlayers.find('.mejs-inner').css({visibility:'hidden',height:0});}},resizeSlideshow:function(){if(typeof YUI!=='undefined'){YUI().use('node-event-simulate',function(Y){Y.one(window).simulate("resize");});}},reloadGoogleMap:function(element){var $element='undefined'==typeof element?$('body'):$(element),googleMap=$element.find('iframe[src*="google.com/maps"]');if(googleMap.length){googleMap.attr('src',function(i,val){return val;});}},_destroy:function(){var win=$(window);win.off('scroll.fl-bg-parallax');win.off('resize.fl-bg-video');},_isTouch:function(){if(('ontouchstart'in window)||(window.DocumentTouch&&document instanceof DocumentTouch)){return true;}
return false;},_isMobile:function(){return/Mobile|Android|Silk\/|Kindle|BlackBerry|Opera Mini|Opera Mobi|webOS/i.test(navigator.userAgent);},_initClasses:function(){var body=$('body'),ua=navigator.userAgent;if(!body.hasClass('fl-builder-blocks-only')&&!body.hasClass('archive')&&$('.fl-builder-content-primary').length>0){body.addClass('fl-builder');}
if(FLBuilderLayout._isTouch()){body.addClass('fl-builder-touch');}
if(FLBuilderLayout._isMobile()){body.addClass('fl-builder-mobile');}
if($(window).width()<FLBuilderLayoutConfig.breakpoints.small){body.addClass('fl-builder-breakpoint-small');}
if($(window).width()>FLBuilderLayoutConfig.breakpoints.small&&$(window).width()<FLBuilderLayoutConfig.breakpoints.medium){body.addClass('fl-builder-breakpoint-medium');}
if($(window).width()>FLBuilderLayoutConfig.breakpoints.medium&&$(window).width()<FLBuilderLayoutConfig.breakpoints.large){body.addClass('fl-builder-breakpoint-large');}
if($(window).width()>FLBuilderLayoutConfig.breakpoints.large){body.addClass('fl-builder-breakpoint-default');}
if(ua.indexOf('Trident/7.0')>-1&&ua.indexOf('rv:11.0')>-1){body.addClass('fl-builder-ie-11');}},_initBackgrounds:function(){var win=$(window);if($('.fl-row-bg-parallax').length>0&&!FLBuilderLayout._isMobile()){FLBuilderLayout._scrollParallaxBackgrounds();FLBuilderLayout._initParallaxBackgrounds();win.on('resize.fl-bg-parallax',FLBuilderLayout._initParallaxBackgrounds);win.on('scroll.fl-bg-parallax',FLBuilderLayout._scrollParallaxBackgrounds);}
if($('.fl-bg-video').length>0){FLBuilderLayout._initBgVideos();FLBuilderLayout._resizeBgVideos();var resizeBGTimer=null;win.on('resize.fl-bg-video',function(e){clearTimeout(resizeBGTimer);resizeBGTimer=setTimeout(function(){FLBuilderLayout._resizeBgVideos(e);},100);});}},_initButtons:function(){$('a.fl-button[role="button"]').on('keydown',function(event){if(event.key==='Enter'||event.key===' '){event.preventDefault();$(this).trigger('click');}});},_initParallaxBackgrounds:function(){$('.fl-row-bg-parallax').each(FLBuilderLayout._initParallaxBackground);},_initParallaxBackground:function(){var row=$(this),content=row.find('> .fl-row-content-wrap'),winWidth=$(window).width(),screenSize='',imageSrc={default:'',medium:'',responsive:'',};imageSrc.default=row.data('parallax-image')||'';imageSrc.medium=row.data('parallax-image-medium')||imageSrc.default;imageSrc.responsive=row.data('parallax-image-responsive')||imageSrc.medium;if(winWidth>FLBuilderLayoutConfig.breakpoints.medium){screenSize='default';}else if(winWidth>FLBuilderLayoutConfig.breakpoints.small&&winWidth<=FLBuilderLayoutConfig.breakpoints.medium){screenSize='medium';}else if(winWidth<=FLBuilderLayoutConfig.breakpoints.small){screenSize='responsive';}
content.css('background-image','url('+imageSrc[screenSize]+')');row.data('current-image-loaded',screenSize);},_scrollParallaxBackgrounds:function(){$('.fl-row-bg-parallax').each(FLBuilderLayout._scrollParallaxBackground);},_scrollParallaxBackground:function(){var win=$(window),row=$(this),content=row.find('> .fl-row-content-wrap'),speed=row.data('parallax-speed'),offset=content.offset(),yPos=-((win.scrollTop()-offset.top)/ speed),initialOffset=(row.data('parallax-offset')!=null)?row.data('parallax-offset'):0,totalOffset=yPos-initialOffset;content.css('background-position','center '+totalOffset+'px');},_initBgVideos:function(){$('.fl-bg-video').each(FLBuilderLayout._initBgVideo);},_initBgVideo:function(){var wrap=$(this),width=wrap.data('width'),height=wrap.data('height'),mp4=wrap.data('mp4'),youtube=wrap.data('youtube'),vimeo=wrap.data('vimeo'),mp4Type=wrap.data('mp4-type'),webm=wrap.data('webm'),webmType=wrap.data('webm-type'),fallback=wrap.data('fallback'),loaded=wrap.data('loaded'),videoMobile=wrap.data('video-mobile'),playPauseButton=wrap.find('.fl-bg-video-play-pause-control'),fallbackTag='',videoTag=null,mp4Tag=null,webmTag=null;if(loaded){return;}
videoTag=$('<video autoplay loop muted playsinline></video>');if('undefined'!=typeof fallback&&''!=fallback){videoTag.attr('poster','data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7')
videoTag.css({backgroundImage:'url("'+fallback+'")',backgroundColor:'transparent',backgroundRepeat:'no-repeat',backgroundSize:'cover',backgroundPosition:'center center',})}
if('undefined'!=typeof mp4&&''!=mp4){mp4Tag=$('<source />');mp4Tag.attr('src',mp4);mp4Tag.attr('type',mp4Type);videoTag.append(mp4Tag);}
if('undefined'!=typeof webm&&''!=webm){webmTag=$('<source />');webmTag.attr('src',webm);webmTag.attr('type',webmType);videoTag.append(webmTag);}
if(!FLBuilderLayout._isMobile()||(FLBuilderLayout._isMobile()&&"yes"==videoMobile)){if('undefined'!=typeof youtube){FLBuilderLayout._initYoutubeBgVideo.apply(this);}
else if('undefined'!=typeof vimeo){FLBuilderLayout._initVimeoBgVideo.apply(this);}else{wrap.append(videoTag);if(playPauseButton.length>0){var video=videoTag[0];playPauseButton.on('click',{video:video},function(e){var video=e.data.video;if(video.paused){video.play();}else{video.pause();}});$(video).on('play playing',function(){playPauseButton.removeClass('fa-play').addClass('fa-pause');});$(video).on('pause ended waiting',function(){playPauseButton.removeClass('fa-pause').addClass('fa-play');});}}}else{videoTag.attr('src','')
wrap.append(videoTag);}
wrap.data('loaded',true);},_initYoutubeBgVideo:function(){var playerWrap=$(this),videoId=playerWrap.data('video-id'),videoPlayer=playerWrap.find('.fl-bg-video-player'),enableAudio=playerWrap.data('enable-audio'),audioButton=playerWrap.find('.fl-bg-video-audio'),playPauseButton=playerWrap.find('.fl-bg-video-play-pause-control'),startTime='undefined'!==typeof playerWrap.data('start')?playerWrap.data('start'):0,startTime='undefined'!==typeof playerWrap.data('t')&&startTime===0?playerWrap.data('t'):startTime,endTime='undefined'!==typeof playerWrap.data('end')?playerWrap.data('end'):0,loop='undefined'!==typeof playerWrap.data('loop')?playerWrap.data('loop'):1,stateCount=0,player,fallback_showing;if(videoId){fallback=playerWrap.data('fallback')||false
if(fallback){playerWrap.find('iframe').remove()
fallbackTag=$('<div></div>');fallbackTag.addClass('fl-bg-video-fallback');fallbackTag.css('background-image','url('+playerWrap.data('fallback')+')');fallbackTag.css('background-size','cover');fallbackTag.css('transition','background-image 1s')
playerWrap.append(fallbackTag);fallback_showing=true;}
FLBuilderLayout._onYoutubeApiReady(function(YT){setTimeout(function(){player=new YT.Player(videoPlayer[0],{videoId:videoId,events:{onReady:function(event){if("no"===enableAudio||FLBuilderLayout._isMobile()){event.target.mute();}
else if("yes"===enableAudio&&event.target.isMuted){event.target.unMute();}
playerWrap.data('YTPlayer',player);FLBuilderLayout._resizeYoutubeBgVideo.apply(playerWrap);event.target.playVideo();if(audioButton.length>0&&!FLBuilderLayout._isMobile()){audioButton.on('click',{button:audioButton,player:player},FLBuilderLayout._toggleBgVideoAudio);}
if(playPauseButton.length>0){playPauseButton.on('click',{player:player},function(e){var player=e.data.player;if(1===player.getPlayerState()){player.pauseVideo();}else{player.playVideo();}});}},onStateChange:function(event){if(event.data===1){if(fallback_showing){$('.fl-bg-video-fallback').css('background-image','url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)')}}
if(stateCount<4){stateCount++;}
if(stateCount>1&&-1===event.data&&"yes"===enableAudio){player.mute();player.playVideo();audioButton.show();}
if(event.data===YT.PlayerState.ENDED&&1===loop){if(startTime>0){player.seekTo(startTime);}else{player.playVideo();}}
if(event.data===YT.PlayerState.PLAYING){playPauseButton.removeClass('fa-play').addClass('fa-pause');}else if(event.data===YT.PlayerState.PAUSED){playPauseButton.removeClass('fa-pause').addClass('fa-play');}else if(event.data===YT.PlayerState.BUFFERING){playPauseButton.removeClass('fa-play').addClass('fa-pause');}else if(event.data===YT.PlayerState.CUED){playPauseButton.removeClass('fa-pause').addClass('fa-play');}else if(event.data===YT.PlayerState.ENDED){playPauseButton.removeClass('fa-pause').addClass('fa-play');}},onError:function(event){console.info('YT Error: '+event.data)
FLBuilderLayout._onErrorYoutubeVimeo(playerWrap)}},playerVars:{playsinline:FLBuilderLayout._isMobile()?1:0,controls:0,showinfo:0,rel:0,start:startTime,end:endTime,}});},1);});}},_onErrorYoutubeVimeo:function(playerWrap){fallback=playerWrap.data('fallback')||false
if(!fallback){return false;}
playerWrap.find('iframe').remove()
fallbackTag=$('<div></div>');fallbackTag.addClass('fl-bg-video-fallback');fallbackTag.css('background-image','url('+playerWrap.data('fallback')+')');playerWrap.append(fallbackTag);},_onYoutubeApiReady:function(callback){if(window.YT&&YT.loaded){callback(YT);}else{setTimeout(function(){FLBuilderLayout._onYoutubeApiReady(callback);},350);}},_initVimeoBgVideo:function(){var playerWrap=$(this),videoId=playerWrap.data('video-id'),videoHash=playerWrap.data('video-hash'),videoPlayer=playerWrap.find('.fl-bg-video-player'),enableAudio=playerWrap.data('enable-audio'),audioButton=playerWrap.find('.fl-bg-video-audio'),playPauseButton=playerWrap.find('.fl-bg-video-play-pause-control'),playerState='',player,width=playerWrap.outerWidth(),ua=navigator.userAgent;if(typeof Vimeo!=='undefined'&&videoId){const vimOptions={loop:true,title:false,portrait:false,background:true,autopause:false,muted:true,};if(videoHash.length){vimOptions.url=`https://player.vimeo.com/video/${ videoId }?h=${ videoHash }`;}else{vimOptions.id=videoId;}
player=new Vimeo.Player(videoPlayer[0],vimOptions);playerWrap.data('VMPlayer',player);if("no"===enableAudio){player.setVolume(0);}
else if("yes"===enableAudio){if(ua.indexOf("Safari")>-1||ua.indexOf("Chrome")>-1||ua.indexOf("Firefox")>-1){player.setVolume(0);audioButton.show();}else{player.setVolume(1);}}
player.play().catch(function(error){FLBuilderLayout._onErrorYoutubeVimeo(playerWrap)});if(audioButton.length>0){audioButton.on('click',{button:audioButton,player:player},FLBuilderLayout._toggleBgVideoAudio);}
player.on('play',function(){playerState='play';playPauseButton.removeClass('fa-play').addClass('fa-pause');});player.on('pause',function(){playerState='pause';playPauseButton.removeClass('fa-pause').addClass('fa-play');});player.on('ended',function(){playerState='ended';playPauseButton.removeClass('fa-pause').addClass('fa-play');});player.on('bufferstart',function(){playerState='bufferstart';playPauseButton.removeClass('fa-play').addClass('fa-pause');});if(playPauseButton.length>0){playPauseButton.on('click',{player:player},function(e){var player=e.data.player;if(playerState==='play'){player.pause();}else{player.play();}});}}},_toggleBgVideoAudio:function(e){var player=e.data.player,control=e.data.button.find('.fl-audio-control');if(control.hasClass('fa-volume-off')){control.removeClass('fa-volume-off').addClass('fa-volume-up');e.data.button.find('.fa-times').hide();if('function'===typeof player.unMute){player.unMute();}else{player.setVolume(1);}}else{control.removeClass('fa-volume-up').addClass('fa-volume-off');e.data.button.find('.fa-times').show();if('function'===typeof player.unMute){player.mute();}else{player.setVolume(0);}}},_videoBgSourceError:function(e){var source=$(e.target),wrap=source.closest('.fl-bg-video'),vid=wrap.find('video'),fallback=wrap.data('fallback'),fallbackTag='';source.remove();if(vid.find('source').length){return;}else if(''!==fallback){fallbackTag=$('<div></div>');fallbackTag.addClass('fl-bg-video-fallback');fallbackTag.css('background-image','url('+fallback+')');wrap.append(fallbackTag);vid.remove();}},_resizeBgVideos:function(){$('.fl-bg-video').each(function(){FLBuilderLayout._resizeBgVideo.apply(this);if($(this).parent().find('img').length>0){$(this).parent().imagesLoaded($.proxy(FLBuilderLayout._resizeBgVideo,this));}});},_resizeBgVideo:function(){if(0===$(this).find('video').length&&0===$(this).find('iframe').length){return;}
var wrap=$(this),wrapHeight=wrap.outerHeight(),wrapWidth=wrap.outerWidth(),vid=wrap.find('video'),vidHeight=wrap.data('height'),vidWidth=wrap.data('width'),newWidth=wrapWidth,newHeight=Math.round(vidHeight*wrapWidth/vidWidth),newLeft=0,newTop=0,iframe=wrap.find('iframe'),isRowFullHeight=$(this).closest('.fl-row-bg-video').hasClass('fl-row-full-height'),vidCSS={top:'50%',left:'50%',transform:'translate(-50%,-50%)',};if(vid.length){if(vidHeight===''||typeof vidHeight==='undefined'||vidWidth===''||typeof vidWidth==='undefined'){vid.css({'left':'0px','top':'0px','width':newWidth+'px'});vid.on('loadedmetadata',FLBuilderLayout._resizeOnLoadedMeta);return;}
if(!isRowFullHeight){if(newHeight<wrapHeight){newHeight=wrapHeight;newLeft=-((newWidth-wrapWidth)/ 2);newWidth=vidHeight?Math.round(vidWidth*wrapHeight/vidHeight):newWidth;}else{newTop=-((newHeight-wrapHeight)/2);}
vidCSS={left:newLeft+'px',top:newTop+'px',height:newHeight+'px',width:newWidth+'px',}}
vid.css(vidCSS);}
else if(iframe.length){if(typeof wrap.data('youtube')!=='undefined'){FLBuilderLayout._resizeYoutubeBgVideo.apply(this);}}},_resizeOnLoadedMeta:function(){var video=$(this),wrapHeight=video.parent().outerHeight(),wrapWidth=video.parent().outerWidth(),vidWidth=video[0].videoWidth,vidHeight=video[0].videoHeight,newHeight=Math.round(vidHeight*wrapWidth/vidWidth),newWidth=wrapWidth,newLeft=0,newTop=0;if(newHeight<wrapHeight){newHeight=wrapHeight;newWidth=Math.round(vidWidth*wrapHeight/vidHeight);newLeft=-((newWidth-wrapWidth)/2);}else{newTop=-((newHeight-wrapHeight)/2);}
video.parent().data('width',vidWidth);video.parent().data('height',vidHeight);video.css({'left':newLeft+'px','top':newTop+'px','width':newWidth+'px','height':newHeight+'px'});},_resizeYoutubeBgVideo:function(){var wrap=$(this),wrapWidth=wrap.outerWidth(),wrapHeight=wrap.outerHeight(),player=wrap.data('YTPlayer'),video=player?player.getIframe():null,aspectRatioSetting='16:9',aspectRatioArray=aspectRatioSetting.split(':'),aspectRatio=aspectRatioArray[0]/ aspectRatioArray[1],ratioWidth=wrapWidth / aspectRatio,ratioHeight=wrapHeight*aspectRatio,isWidthFixed=wrapWidth / wrapHeight>aspectRatio,width=isWidthFixed?wrapWidth:ratioHeight,height=isWidthFixed?ratioWidth:wrapHeight;if(video){$(video).width(width).height(height);}},_initHash:function(){var hash=window.location.hash.replace('#','').split('/').shift(),element=null,tabs=null,responsiveLabel=null,tabIndex=null,label=null;if(''!==hash){try{element=$('#'+hash);if(element.length>0){if(element.hasClass('fl-accordion-item')){setTimeout(function(){element.find('.fl-accordion-button').trigger('click');},100);}
if(element.hasClass('fl-tabs-panel')){setTimeout(function(){tabs=element.closest('.fl-tabs');responsiveLabel=element.find('.fl-tabs-panel-label');tabIndex=responsiveLabel.data('index');label=tabs.find('.fl-tabs-labels .fl-tabs-label[data-index='+tabIndex+']');label[0].click();FLBuilderLayout._scrollToElement(element);},100);}}}
catch(e){}}},_initAnchorLinks:function(){$('a, [role="link"]').each(FLBuilderLayout._initAnchorLink);},_initAnchorLink:function(){var link=$(this),href=link.data('url')?link.data('url'):link.attr('href'),target=link.data('url')?new URL(href,window.location.href):this,loc=window.location,id=null,element=null,flNode=false;if('undefined'!=typeof href&&href.indexOf('#')>-1&&link.closest('svg').length<1){if(loc.pathname.replace(/^\//,'')==target.pathname.replace(/^\//,'')&&loc.hostname==target.hostname){try{id=href.split('#').pop();if(!id){return;}
element=$('#'+id);if(element.length>0){flNode=element.hasClass('fl-row')||element.hasClass('fl-col')||element.hasClass('fl-module');if(!element.hasClass('fl-no-scroll')&&(link.hasClass('fl-scroll-link')||flNode)){$(link).on('click',FLBuilderLayout._scrollToElementOnLinkClick);}
if(element.hasClass('fl-accordion-item')){$(link).on('click',FLBuilderLayout._scrollToAccordionOnLinkClick);}
if(element.hasClass('fl-tabs-panel')){$(link).on('click',FLBuilderLayout._scrollToTabOnLinkClick);}}}
catch(e){}}}},_scrollToElementOnLinkClick:function(e,callback){var attribute=$(this).data('url')?$(this).data('url'):$(this).attr('href');var element=$('#'+attribute.split('#').pop());FLBuilderLayout._scrollToElement(element,callback);e.preventDefault();},_scrollToElement:function(element,callback){var config=FLBuilderLayoutConfig.anchorLinkAnimations,dest=0,win=$(window),doc=$(document);if(element.length>0){if('fixed'===element.css('position')||'fixed'===element.parent().css('position')){dest=element.position().top;}
else if(element.offset().top>doc.height()-win.height()){dest=doc.height()-win.height();}else{dest=element.offset().top-config.offset;}
$('html, body').stop(true).animate({scrollTop:dest},config.duration,config.easing,function(){if('undefined'!=typeof callback){callback();}
if(undefined!=element.attr('id')&&window.location.hash!=='#'+element.attr('id')){var firefox_version=window.navigator.userAgent.match(/Firefox\/(\d+)\./),firefox_version=firefox_version?parseInt(firefox_version[1],10):null;if(firefox_version!==null&&firefox_version<135){window.location.hash=element.attr('id');}else{if(history.pushState){history.pushState(null,null,'#'+element.attr('id'));}else{window.location.hash=element.attr('id');}}}});}},_scrollToAccordionOnLinkClick:function(e){var element=$('#'+$(this).attr('href').split('#').pop());if(element.length>0){var callback=function(){if(element){element.find('.fl-accordion-button').trigger('click');element=false;}};FLBuilderLayout._scrollToElementOnLinkClick.call(this,e,callback);}},_scrollToTabOnLinkClick:function(e){var element=$('#'+$(this).attr('href').split('#').pop()),tabs=null,label=null,responsiveLabel=null;if(element.length>0){tabs=element.closest('.fl-tabs');responsiveLabel=element.find('.fl-tabs-panel-label');tabIndex=responsiveLabel.data('index');label=tabs.find('.fl-tabs-labels .fl-tabs-label[data-index='+tabIndex+']');if(responsiveLabel.is(':visible')){var callback=function(){if(element){responsiveLabel.trigger($.Event('click',{which:1}));}};FLBuilderLayout._scrollToElementOnLinkClick.call(this,e,callback);}else{label[0].click();FLBuilderLayout._scrollToElement(element);}
e.preventDefault();}},_initForms:function(){if(!FLBuilderLayout._hasPlaceholderSupport){$('.fl-form-field input').each(FLBuilderLayout._initFormFieldPlaceholderFallback);}
$('.fl-form-field input').on('focus',FLBuilderLayout._clearFormFieldError);},_hasPlaceholderSupport:function(){var input=document.createElement('input');return'undefined'!=input.placeholder;},_initFormFieldPlaceholderFallback:function(){var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if('undefined'!=placeholder&&''===val){field.val(placeholder);field.on('focus',FLBuilderLayout._hideFormFieldPlaceholderFallback);field.on('blur',FLBuilderLayout._showFormFieldPlaceholderFallback);}},_hideFormFieldPlaceholderFallback:function(){var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if(val==placeholder){field.val('');}},_showFormFieldPlaceholderFallback:function(){var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if(''===val){field.val(placeholder);}},_clearFormFieldError:function(){var field=$(this);field.removeAttr('aria-invalid');field.removeClass('fl-form-error');const message=field.attr('aria-describedby');message?$('#'+message).hide():field.siblings('.fl-form-error-message').hide();},_initRowShapeLayerHeight:function(){FLBuilderLayout._adjustRowShapeLayerHeight();$(window).on('resize',FLBuilderLayout._adjustRowShapeLayerHeight);},_initNestedColsWidth:function(){var nestedCols=$('.fl-col-has-cols');if(nestedCols.length<=0){return;}
$(nestedCols).each(function(index,col){if($(col).width()<=0){$(col).css('width',FLBuilderLayoutConfig.emptyColWidth);}});},_adjustRowShapeLayerHeight:function(){var rowShapeLayers=$('.fl-builder-shape-layer');$(rowShapeLayers).each(function(index){var rowShapeLayer=$(this),shape=$(rowShapeLayer).find('svg'),height=shape.height(),excludeShapes='.fl-builder-shape-circle, .fl-builder-shape-dot-cluster, .fl-builder-shape-topography, .fl-builder-shape-rect';if(!rowShapeLayer.is(excludeShapes)){$(shape).css('height',Math.ceil(height));}});},_string_to_slug:function(str){str=str.replace(/^\s+|\s+$/g,'');if('undefined'==typeof window._fl_string_to_slug_regex){regex=new RegExp('[^a-zA-Z0-9\'":() !.,-_|]','g');}else{regex=new RegExp('[^'+window._fl_string_to_slug_regex+'\'":\(\) !.,-_|\\\p{Letter}]','ug');}
str=str.replace(regex,'').replace(/\s+/g,' ');return str;},_reorderMenu:function(){if($('#wp-admin-bar-fl-builder-frontend-edit-link-default li').length>1){$('#wp-admin-bar-fl-builder-frontend-duplicate-link').appendTo('#wp-admin-bar-fl-builder-frontend-edit-link-default').css('padding-top','5px').css('border-top','2px solid #1D2125').css('margin-top','5px')}}};$(function(){FLBuilderLayout.init();});})(jQuery);(function($){if(typeof FLBuilderLayoutModules!=='undefined'){return;}
FLBuilderLayoutModules={init:function(){if(0===$('.fl-builder-edit').length){FLBuilderLayoutModules._initModuleAnimations();}},_initModuleAnimations:function(){if(typeof jQuery.fn.waypoint!=='undefined'){$('.fl-animation').each(function(){var node=$(this),nodeTop=node.offset().top,winHeight=$(window).height(),bodyHeight=$('body').height(),waypoint=FLBuilderLayoutConfig.waypoint,offset='80%';if(typeof waypoint.offset!==undefined){offset=FLBuilderLayoutConfig.waypoint.offset+'%';}
if(bodyHeight-nodeTop<winHeight*0.2){offset='100%';}
node.waypoint({offset:offset,handler:FLBuilderLayoutModules._doModuleAnimation});});}},_doModuleAnimation:function(){var module='undefined'==typeof this.element?$(this):$(this.element),delay=parseFloat(module.data('animation-delay')),duration=parseFloat(module.data('animation-duration'));if(!isNaN(duration)){module.css('animation-duration',duration+'s');}
if(!isNaN(delay)&&delay>0){setTimeout(function(){module.addClass('fl-animated');},delay*1000);}else{setTimeout(function(){module.addClass('fl-animated');},1);}}};$(function(){FLBuilderLayoutModules.init();});})(jQuery);jQuery(function($){window._fl_string_to_slug_regex='a-zA-Z0-9';});(function($){})(jQuery);jQuery(function($){$(function(){$('.fl-node-348e1m2iszuf .fl-photo-img').on('mouseenter',function(e){$(this).data('title',$(this).attr('title')).removeAttr('title');}).on('mouseleave',function(e){$(this).attr('title',$(this).data('title')).data('title',null);});});window._fl_string_to_slug_regex='a-zA-Z0-9';});(function($){})(jQuery);
!function(t){"use strict";t.fn.fitVids=function(e){var i={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var r=document.head||document.getElementsByTagName("head")[0],a=".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}",d=document.createElement("div");d.innerHTML='<p>x</p><style id="fit-vids-style">'+a+"</style>",r.appendChild(d.childNodes[1])}return e&&t.extend(i,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];i.customSelector&&e.push(i.customSelector);var r=".fitvidsignore";i.ignore&&(r=r+", "+i.ignore);var a=t(this).find(e.join(","));a=a.not("object object"),a=a.not(r),a.each(function(){var e=t(this);if(!(e.parents(r).length>0||"embed"===this.tagName.toLowerCase()&&e.parent("object").length||e.parent(".fluid-width-video-wrapper").length)){e.css("height")||e.css("width")||!isNaN(e.attr("height"))&&!isNaN(e.attr("width"))||(e.attr("height",9),e.attr("width",16));var i="object"===this.tagName.toLowerCase()||e.attr("height")&&!isNaN(parseInt(e.attr("height"),10))?parseInt(e.attr("height"),10):e.height(),a=isNaN(parseInt(e.attr("width"),10))?e.width():parseInt(e.attr("width"),10),d=i/a;if(!e.attr("name")){var o="fitvid"+t.fn.fitVids._count;e.attr("name",o),t.fn.fitVids._count++}e.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*d+"%"),e.removeAttr("height").removeAttr("width")}})})},t.fn.fitVids._count=0}(window.jQuery||window.Zepto);