!function(a){"use strict";a.fn.fusionImageCompare=function(){return this.each(function(){var b=a(this),c=void 0!==a(this).data("offset")?a(this).data("offset"):.5,d=void 0!==a(this).data("orientation")?a(this).data("orientation"):"horizontal",e=void 0!==a(this).data("move-slider-on-hover")&&a(this).data("move-slider-on-hover"),f=void 0===a(this).data("move-with-handle-only")||a(this).data("move-with-handle-only"),g=void 0!==a(this).data("click-to-move")&&a(this).data("click-to-move"),h=b.find("img:first"),i=b.find("img:last"),j=b.find(".fusion-image-compare-handle"),k=0,l=0,m=0,n=0,o="",p=function(a){var b=h.width(),c=h.height();return{w:b+"px",h:c+"px",cw:a*b+"px",ch:a*c+"px"}},q=function(a){"vertical"===d?(h.css("clip","rect(0,"+a.w+","+a.ch+",0)"),i.css("clip","rect("+a.ch+","+a.w+","+a.h+",0)")):(h.css("clip","rect(0,"+a.cw+","+a.h+",0)"),i.css("clip","rect(0,"+a.w+","+a.h+","+a.cw+")")),b.css("height",a.h)},r=function(a){var b=p(a);j.css("vertical"===d?"top":"left","vertical"===d?b.ch:b.cw),q(b)},s=function(a,b,c){return Math.max(b,Math.min(c,a))},t=function(a,b){return s("vertical"===d?(b-l)/n:(a-k)/m,0,1)},u=function(a){(a.distX>a.distY&&a.distX<-a.distY||a.distX<a.distY&&a.distX>-a.distY)&&"vertical"!==d?a.preventDefault():(a.distX<a.distY&&a.distX<-a.distY||a.distX>a.distY&&a.distX>-a.distY)&&"vertical"===d&&a.preventDefault(),b.addClass("active"),k=b.offset().left,l=b.offset().top,m=h.width(),n=h.height()},v=function(a){b.hasClass("active")&&(c=t(a.pageX,a.pageY),r(c))},w=function(){b.removeClass("active")},x=function(a){var e;k=b.offset().left,l=b.offset().top,m=h.width(),n=h.height(),c=t(a.pageX,a.pageY),e=p(c),b.addClass("active"),"vertical"===d?j.stop(!0,!0).animate({top:e.ch},{queue:!1,duration:300,easing:"easeOutCubic",step:function(a,b){var c=a/n,d=p(c);q(d)},complete:function(){b.removeClass("active")}}):j.stop(!0,!0).animate({left:e.cw},{queue:!1,duration:300,easing:"easeOutCubic",step:function(a,b){var c=a/m,d=p(c);q(d)},complete:function(){b.removeClass("active")}})};a(window).on("resize.fusion-image-compare",function(a){r(c)}),o=f?b:j,o.on("movestart",u),o.on("move",v),o.on("moveend",w),e&&(b.on("mouseenter",u),b.on("mousemove",v),b.on("mouseleave",w)),j.on("touchmove",function(a){a.preventDefault()}),b.find("img").on("mousedown",function(a){a.preventDefault()}),g&&b.on("click",x),a(window).trigger("resize.fusion-image-compare")})}}(jQuery),jQuery(window).load(function(){jQuery(".fusion-image-compare").fusionImageCompare()}),jQuery(document).on("fusion-element-render-fusion_image_compare",function(a,b){jQuery('div[data-cid="'+b+'"]').find(".fusion-image-compare").fusionImageCompare()});