­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ !function(e){"use strict";function t(t,o,n,i=75,a){var s,d=document.querySelector(t),l=document.querySelector(o),c=l.width,r=l.height,p=l.getContext("2d"),u=new Image,f=!1;function h(e,t){return{x:(e.pageX||e.touches[0].clientX)-0,y:(e.pageY||e.touches[0].clientY)-0}}function w(e){(e=e||0)>i&&n&&n.call(l)}function m(e){f=!0,s=h(e)}function v(e){var t,o,n=(t=l.getBoundingClientRect(),o=document.documentElement,{top:t.top,scrollTop:o.scrollTop}),i=0;if(a.top!=n.top&&(i=n.top+n.scrollTop-a),f){e.preventDefault();for(var d,m,v=h(e),b=(d=s,m=v,Math.sqrt(Math.pow(m.x-d.x,2)+Math.pow(m.y-d.y,2))),g=function(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}(s,v),C=0,x=0,k=navigator.userAgent||navigator.vendor||window.opera,y=/iPad|iPhone|iPod/.test(k)&&!window.MSStream,A=JetElementsTools.mobileAndTabletcheck()&&!y?window.scrollY:0,E=0;E=0&&(t.position.left=0);break;case"right":o.left<=0&&(t.position.left=0);break;case"top":o.top>=0&&(t.position.top=0);break;case"bottom":o.top<=0&&(t.position.top=0)}}}),r.on("focus",function(){n.draggable("disable"),n.hide()})}function p(){"ontouchend"in window||"ontouchstart"in window?(a.on("touchstart",function(t){d=e(window).scrollTop()}),a.on("touchend",function(t){if(d!==e(window).scrollTop())return!1;var o=e(this);o.hasClass("flipped-stop")||setTimeout(function(){o.toggleClass("flipped")},10)}),e(document).on("touchend",function(t){e(t.target).closest(a).length||a.hasClass("flipped-stop")||a.hasClass("flipped")&&a.removeClass("flipped")})):(a.on("click",function(e){a.hasClass("flipped-stop")||a.toggleClass("flipped")}),r.on("focus",function(){a.hasClass("flipped-stop")||a.addClass("flipped")}),r.on("focusout",function(){a.removeClass("flipped")}))}function u(){var o=document.querySelector("#jet-animated-box-"+s.widgetId).getBoundingClientRect().top;if(c)return!1;var n=e(window).width();e("html, body").scrollTop(0),html2canvas(document.querySelector("#jet-animated-box__front-"+s.widgetId),{allowTaint:!0,backgroundColor:null,windowWidth:e(window).width(),windowHeight:e(window).height(),scrollX:0,scrollY:-window.scrollY}).then(function(i){i.setAttribute("id","jet-animated-box-canvas-"+s.widgetId),a.prepend(i),e(".jet-animated-box__front",a).fadeOut(300,function(){e(this).remove()}),e(window).one("resize.jetScratch",function(t){e(window).width()!==n&&(n=e(window).width(),e(i).fadeOut(250,function(){e(this).remove()}))}),new t("#jet-animated-box-"+s.widgetId,"#jet-animated-box-canvas-"+s.widgetId,function(){e(i).fadeOut(300,function(){e(this).remove(),a.removeClass("back-events-inactive")})},s.scratchFillPercent,o)})}}}(jQuery);