"use strict";function wyp_visible_function(k,x,t,e){var y=window;if(!(1>k.length)){var i=1<k.length?k[0]:k,r=i,n=window.innerWidth,f=window.innerHeight,e=e?e:"both",h=!0!==t||r.offsetWidth*r.offsetHeight;if("function"==typeof r.getBoundingClientRect){var l=r.getBoundingClientRect(),g=0<=l.top&&l.top<f,u=0<l.bottom&&l.bottom<=f,s=0<=l.left&&l.left<n,c=0<l.right&&l.right<=n,a=x?g||u:g&&u,v=x?s||c:s&&c;if("both"===e)return h&&a&&v;if("vertical"===e)return h&&a;if("horizontal"===e)return h&&v}else{var b=y.scrollTop,d=b+f,p=y.scrollLeft,w=p+n,m=i.offsetTop,z=m+parseFloat(getComputedStyle(i,null).height.replace("px","")),A=i.offsetLeft,B=A+parseFloat(getComputedStyle(i,null).width.replace("px","")),C=!0===x?z:m,j=!0===x?m:z,q=!0===x?B:A,D=!0===x?A:B;if("both"===e)return!!h&&d>=j&&C>=b&&w>=D&&q>=p;if("vertical"===e)return!!h&&d>=j&&C>=b;if("horizontal"===e)return!!h&&w>=D&&q>=p}}}function get_all_selectors(a){if(""==a)return!1;if(a=a.replace(/\}\}/g,"}"),a.split("{").length!=a.split("}").length)return!1;a=a.toString().replace(/\}\,/g,"}");var b=array_cleaner(a.replace(/\{(.*?)\}/g,"|BREAK|").split("|BREAK|"));return b}function get_minimized_css(a,b){return!1==a||!0==a?"":(a=a.replace(/(\r\n|\n|\r)/g,"").replace(/\t/g,""),a=a.replace(/\/\*(.*?)\*\//g,""),a=a.replace(/\}\s+\}/g,"}}").replace(/\s+\{/g,"{"),a=a.replace(/\s+\}/g,"}").replace(/\{\s+/g,"{"),a=filter_bad_queries(a),!0===b&&(a=a.replace(/@media(.*?)\}\}/g,"").replace(/@?([a-zA-Z0-9_-]+)?keyframes(.*?)\}\}/g,"").replace(/@font-face(.*?)\}\}/g,"").replace(/@import(.*?)\;/g,"").replace(/@charset(.*?)\;/g,"")),a)}function filter_bad_queries(a){return a.replace(/[\u2018\u2019\u201A\u201B\u2032\u2035\u201C\u201D]/g,"")}function array_cleaner(a){var b,c,d=[];for(b=0;b<a.length;b++)c=a[b],-1===d.indexOf(c)&&d.push(c);return d}function get_css_data(){if(null==document.querySelectorAll("style#yellow-pencil,style#wyp-live-preview,link#wyp-custom-css"))return!1;var a="";return null==document.querySelector("link#wyp-custom-css")?(null!=document.querySelector("style#yellow-pencil")&&(a+=document.querySelector("style#yellow-pencil").innerHTML),null!=document.querySelector("style#wyp-live-preview")&&(a+=document.querySelector("style#wyp-live-preview").innerHTML)):(a=get_custom_CSS(),null!=document.querySelector("style#wyp-live-preview")&&(a+=document.querySelector("style#wyp-live-preview").innerHTML)),a}window.cachedNormalSelectors=!1,!1==window.cachedMediaSelectors;function get_matches_selectors(d){var e="";(!1==window.cachedNormalSelectors||!1==window.cachedMediaSelectors)&&(e=get_css_data()),!1==window.cachedNormalSelectors&&(window.cachedNormalSelectors=get_all_selectors(get_minimized_css(e,!0)));var f,g,h=window.cachedNormalSelectors,i=[];for(f=0;f<h.length;f++)(g=h[f],!g.match(/\}|\{|\;/))&&0<=g.indexOf(d)&&""!=g&&i.push(g.replace(d,""));!1==window.cachedMediaSelectors&&(window.cachedMediaSelectors=get_minimized_css(e,!1).match(/@media(.*?){(.*?)}}/g));var j=window.cachedMediaSelectors;if(null!=j)for(var k,l="",m="",n="",o=0;o<j.length;o++){k=j[o],m=k.match(/@media(.*?){/g).toString().replace(/\{/g,"").replace(/@media /g,"").replace(/@media/g,""),l=k.toString().replace(/@media(.*?){/g,""),n=get_all_selectors(l);for(var g,p=0;p<n.length;p++)(g=n[p],!g.match(/\}|\{|\;/))&&window.matchMedia(m).matches&&0<=g.indexOf(d)&&""!=g&&i.push(g.replace(d,""))}return i.toString()}function click_detect(){var a,b;if(""==get_matches_selectors(".yp_click"))return!1;b=document.querySelectorAll(get_matches_selectors(".yp_click"));for(var c=0;c<b.length;c++){a=b[c];var d=getComputedStyle(a).getPropertyValue("--animation-trigger-repeat"),e=0,f=0,g=0;"infinite"==d&&(d=9e3),d=parseInt(d),isNaN(d)&&(d=1),a.addEventListener("click",function(){f=g,e>g&&(f=e),f!=d&&this.classList.add("yp_click")}),a.addEventListener("webkitAnimationEnd",function(){this.classList.contains("yp_click")&&(e++,this.classList.remove("yp_click"))}),a.addEventListener("animationEnd",function(){this.classList.contains("yp_click")&&(g++,this.classList.remove("yp_click"))})}}function hover_detect(){var a,b;if(""==get_matches_selectors(".yp_hover"))return!1;b=document.querySelectorAll(get_matches_selectors(".yp_hover"));for(var c=0;c<b.length;c++){a=b[c];var d=getComputedStyle(a).getPropertyValue("--animation-trigger-repeat"),e=0,f=0,g=0;"infinite"==d&&(d=9e3),d=parseInt(d),isNaN(d)&&(d=1),a.addEventListener("mouseenter",function(){f=g,e>g&&(f=e),f!=d&&this.classList.add("yp_hover")}),a.addEventListener("webkitAnimationEnd",function(){this.classList.contains("yp_hover")&&(e++,this.classList.remove("yp_hover"))}),a.addEventListener("animationEnd",function(){this.classList.contains("yp_hover")&&(g++,this.classList.remove("yp_hover"))})}}function focus_detect(){var a,b;if(""==get_matches_selectors(".yp_focus"))return!1;b=document.querySelectorAll(get_matches_selectors(".yp_focus"));for(var c=0;c<b.length;c++){a=b[c];var d=getComputedStyle(a).getPropertyValue("--animation-trigger-repeat"),e=0,f=0,g=0;"infinite"==d&&(d=9e3),d=parseInt(d),isNaN(d)&&(d=1),a.addEventListener("focus",function(){f=g,e>g&&(f=e),f!=d&&this.classList.add("yp_focus")}),a.addEventListener("webkitAnimationEnd",function(){this.classList.contains("yp_focus")&&(e++,this.classList.remove("yp_focus"))}),a.addEventListener("animationEnd",function(){this.classList.contains("yp_focus")&&(g++,this.classList.remove("yp_focus"))})}}function onscreen_detect(){var a,b;if(""==get_matches_selectors(".yp_onscreen"))return!1;b=document.querySelectorAll(get_matches_selectors(".yp_onscreen"));for(var c=0;c<b.length;c++)a=b[c],wyp_visible_function(a,!0)&&a.classList.add("yp_onscreen")}function setAnimTriggers(){document.addEventListener("DOMContentLoaded",function(){onscreen_detect(),click_detect(),hover_detect(),focus_detect()}),window.onresize=function(){onscreen_detect()},window.onscroll=function(){onscreen_detect()}}function get_custom_CSS(){var a,b,d,e,f="";for(d=0;d<document.styleSheets.length;d++)if(a=document.styleSheets[d],null!=a.href&&(b=a.ownerNode.outerHTML,-1!=b.indexOf("wyp-custom-css")))for(e=0;e<a.cssRules.length;e++)f+=a.cssRules[e].cssText;return f}setAnimTriggers()
;