summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js')
-rw-r--r--plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js b/plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js
index 837eac34..974810f7 100644
--- a/plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js
+++ b/plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js
@@ -1,3 +1 @@
-/* Do not modify this file directly. It is compiled from other files. */
-/* global jetpackCarouselStrings, DocumentTouch */
-jQuery(document).ready(function(e){var t,a,i,o,s,r,n,l,c,d,p,u,m,h,f,g,j,v,w,_=110,x=e("body").css("overflow"),b=e("html").css("overflow"),y="";window.innerWidth<=760&&(_=Math.round(window.innerWidth/760*110))<40&&("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(_=0),void 0===Date.now&&(Date.now=function(){return(new Date).getTime()});var k=function(e){switch(e.which){case 38:e.preventDefault(),o.scrollTop(o.scrollTop()-100);break;case 40:e.preventDefault(),o.scrollTop(o.scrollTop()+100);break;case 39:e.preventDefault(),i.jp_carousel("next");break;case 37:case 8:e.preventDefault(),i.jp_carousel("previous");break;case 27:e.preventDefault(),o.jp_carousel("close")}},S=function(){clearTimeout(d),d=setTimeout(function(){i.jp_carousel("slides").jp_carousel("fitSlide",!0),i.jp_carousel("updateSlidePositions",!0),i.jp_carousel("fitMeta",!0)},200)},C=function(){e("a img[data-attachment-id]").each(function(){var t=e(this).parent();if(!t.parent(".gallery-icon").length&&void 0!==e(t).attr("href")){var a=!1;e(t).attr("href").split("?")[0]===e(this).attr("data-orig-file").split("?")[0]&&1===Number(jetpackCarouselStrings.single_image_gallery_media_file)&&(a=!0),e(t).attr("href")===e(this).attr("data-permalink")&&(a=!0),a&&(e(t).addClass("single-image-gallery"),e(t).data("carousel-extra",{blog_id:Number(jetpackCarouselStrings.blog_id)}))}})},I={testForData:function(t){return!(!(t=e(t)).length||!t.data("carousel-extra"))},testIfOpened:function(){return!(void 0===i||void 0===i.opened||!i.opened)},openOrSelectSlide:function(t){e(this).jp_carousel("testIfOpened")?i.jp_carousel("selectSlideAtIndex",t):e(this).jp_carousel("open",{start_index:t})},open:function(d){var m={items_selector:".gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id], img[data-attachment-id]",start_index:0},h=e(this).data("carousel-extra");if(h&&(function(){if(!t){t=e("<div></div>").addClass("jp-carousel-overlay").css({position:"fixed",top:0,right:0,bottom:0,left:0});var d='<a class="jp-carousel-commentlink" href="#">'+jetpackCarouselStrings.comment+"</a>";Number(jetpackCarouselStrings.is_logged_in),d=e('<div class="jp-carousel-buttons">'+d+"</div>"),c=e('<h2 itemprop="caption description"></h2>'),p=e('<div class="jp-carousel-photo-info"></div>').append(c),(f=e("<div></div>").addClass("jp-carousel-image-meta").css({float:"right","margin-top":"20px",width:"250px"})).append(d).append("<ul class='jp-carousel-image-exif' style='display:none;'></ul>").append("<a class='jp-carousel-image-download' style='display:none;'></a>").append("<div class='jp-carousel-image-map' style='display:none;'></div>"),g=e("<div></div>").addClass("jp-carousel-titleanddesc").css({width:"100%","margin-top":f.css("margin-top")});var m='<div id="jp-carousel-comment-form-container">';jetpackCarouselStrings.local_comments_commenting_as&&jetpackCarouselStrings.local_comments_commenting_as.length&&(1!==Number(jetpackCarouselStrings.is_logged_in)&&1===Number(jetpackCarouselStrings.comment_registration)?m+='<div id="jp-carousel-comment-form-commenting-as">'+jetpackCarouselStrings.local_comments_commenting_as+"</div>":(m+='<form id="jp-carousel-comment-form">',m+='<textarea name="comment" class="jp-carousel-comment-form-field jp-carousel-comment-form-textarea" id="jp-carousel-comment-form-comment-field" placeholder="'+jetpackCarouselStrings.write_comment+'"></textarea>',m+='<div id="jp-carousel-comment-form-submit-and-info-wrapper">',m+='<div id="jp-carousel-comment-form-commenting-as">'+jetpackCarouselStrings.local_comments_commenting_as+"</div>",m+='<input type="submit" name="submit" class="jp-carousel-comment-form-button" id="jp-carousel-comment-form-button-submit" value="'+jetpackCarouselStrings.post_comment+'" />',m+='<span id="jp-carousel-comment-form-spinner">&nbsp;</span>',m+='<div id="jp-carousel-comment-post-results"></div>',m+="</div>",m+="</form>")),j=e(m+="</div>").css({width:"100%","margin-top":"20px",color:"#999"}),a=e("<div></div>").addClass("jp-carousel-comments").css({width:"100%",bottom:"10px","margin-top":"20px"});var h=e('<div id="jp-carousel-comments-loading"><span>'+jetpackCarouselStrings.loading_comments+"</span></div>").css({width:"100%",bottom:"10px","margin-top":"20px"}),w=e(window).width()-2*_-(f.width()+40);w+="px",v=e("<div></div>").addClass("jp-carousel-left-column-wrapper").css({width:Math.floor(w)}).append(g).append(j).append(a).append(h);var x=e("<div></div>").addClass("jp-carousel-fadeaway");n=e("<div></div>").addClass("jp-carousel-info").css({top:Math.floor(e(window).height()/100*85),left:_,right:_}).append(p).append(f),window.innerWidth<=760?(p.remove().insertAfter(g),n.prepend(v)):n.append(v);var b=e(window).height()-parseInt(n.css("top"),10)+"px";s=e("<div><span></span></div>").addClass("jp-carousel-next-button").css({right:"15px"}).hide(),r=e("<div><span></span></div>").addClass("jp-carousel-previous-button").css({left:0}).hide(),s.add(r).css({position:"fixed",top:"40px",bottom:b,width:_}),i=e("<div></div>").addClass("jp-carousel").css({position:"absolute",top:0,bottom:b,left:0,right:0}),u=e('<div class="jp-carousel-close-hint"><span>&times;</span></div>').css({position:"fixed"}),o=e("<div></div>").addClass("jp-carousel-wrap").addClass("jp-carousel-transitions"),"white"===jetpackCarouselStrings.background_color&&o.addClass("jp-carousel-light"),o.attr("itemscope",""),o.attr("itemtype","https://schema.org/ImageGallery"),o.css({position:"fixed",top:0,right:0,bottom:0,left:0,"z-index":2147483647,"overflow-x":"hidden","overflow-y":"auto",direction:"ltr"}).hide().append(t).append(i).append(x).append(n).append(s).append(r).append(u).appendTo(e("body")).click(function(t){var a=e(t.target),s=a.parents("div.jp-carousel-wrap"),r=s.data("carousel-extra"),l=s.find("div.selected").data("attachment-id");if(r=r||[],a.is(i)||a.parents().add(a).is(u))o.jp_carousel("close");else if(a.hasClass("jp-carousel-commentlink"))t.preventDefault(),t.stopPropagation(),e(window).unbind("keydown",k),o.animate({scrollTop:parseInt(n.position().top,10)},"fast"),e("#jp-carousel-comment-form-submit-and-info-wrapper").slideDown("fast"),e("#jp-carousel-comment-form-comment-field").focus();else if(a.hasClass("jp-carousel-comment-login")){var c=jetpackCarouselStrings.login_url+"%23jp-carousel-"+l;window.location.href=c}else if(a.parents("#jp-carousel-comment-form-container").length){var d=e("#jp-carousel-comment-form-comment-field").blur(function(){e(window).bind("keydown",k)}).focus(function(){e(window).unbind("keydown",k)}),p=e("#jp-carousel-comment-form-email-field").blur(function(){e(window).bind("keydown",k)}).focus(function(){e(window).unbind("keydown",k)}),m=e("#jp-carousel-comment-form-author-field").blur(function(){e(window).bind("keydown",k)}).focus(function(){e(window).unbind("keydown",k)}),h=e("#jp-carousel-comment-form-url-field").blur(function(){e(window).bind("keydown",k)}).focus(function(){e(window).unbind("keydown",k)});if(d&&d.attr("id")===a.attr("id"))e(window).unbind("keydown",k),e("#jp-carousel-comment-form-submit-and-info-wrapper").slideDown("fast");else if(a.is('input[type="submit"]')){t.preventDefault(),t.stopPropagation(),e("#jp-carousel-comment-form-spinner").spin("small","white");var f={action:"post_attachment_comment",nonce:jetpackCarouselStrings.nonce,blog_id:r.blog_id,id:l,comment:d.val()};if(!f.comment.length)return void i.jp_carousel("postCommentError",{field:"jp-carousel-comment-form-comment-field",error:jetpackCarouselStrings.no_comment_text});if(1!==Number(jetpackCarouselStrings.is_logged_in)&&(f.email=p.val(),f.author=m.val(),f.url=h.val(),1===Number(jetpackCarouselStrings.require_name_email))){if(!f.email.length||!f.email.match("@"))return void i.jp_carousel("postCommentError",{field:"jp-carousel-comment-form-email-field",error:jetpackCarouselStrings.no_comment_email});if(!f.author.length)return void i.jp_carousel("postCommentError",{field:"jp-carousel-comment-form-author-field",error:jetpackCarouselStrings.no_comment_author})}e.ajax({type:"POST",url:jetpackCarouselStrings.ajaxurl,data:f,dataType:"json",success:function(t){"approved"===t.comment_status?e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-success">'+jetpackCarouselStrings.comment_approved+"</span>").slideDown("fast"):"unapproved"===t.comment_status?e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-success">'+jetpackCarouselStrings.comment_unapproved+"</span>").slideDown("fast"):e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-error">'+jetpackCarouselStrings.comment_post_error+"</span>").slideDown("fast"),i.jp_carousel("clearCommentTextAreaValue"),i.jp_carousel("getComments",{attachment_id:l,offset:0,clear:!0}),e("#jp-carousel-comment-form-button-submit").val(jetpackCarouselStrings.post_comment),e("#jp-carousel-comment-form-spinner").spin(!1)},error:function(){i.jp_carousel("postCommentError",{field:"jp-carousel-comment-form-comment-field",error:jetpackCarouselStrings.comment_post_error})}})}}else a.parents(".jp-carousel-info").length||o.jp_carousel("next")}).bind("jp_carousel.afterOpen",function(){e(window).bind("keydown",k),e(window).bind("resize",S),i.opened=!0,S()}).bind("jp_carousel.beforeClose",function(){var t=e(window).scrollTop();e(window).unbind("keydown",k),e(window).unbind("resize",S),e(window).scrollTop(t),e(".jp-carousel-previous-button").hide(),e(".jp-carousel-next-button").hide(),e("html").css("height","")}).bind("jp_carousel.afterClose",function(){window.location.hash&&history.back&&history.back(),y="",i.opened=!1}).on("transitionend.jp-carousel ",".jp-carousel-slide",function(t){if("transform"===t.originalEvent.propertyName){var a=(Date.now()-l)/1e3/t.originalEvent.elapsedTime;o.off("transitionend.jp-carousel"),a>=2&&e(".jp-carousel-transitions").removeClass("jp-carousel-transitions")}}),e(".jp-carousel-wrap").touchwipe({wipeLeft:function(e){e.preventDefault(),i.jp_carousel("next")},wipeRight:function(e){e.preventDefault(),i.jp_carousel("previous")},preventDefaultEvents:!1}),s.add(r).click(function(e){e.preventDefault(),e.stopPropagation(),s.is(this)?i.jp_carousel("next"):i.jp_carousel("previous")})}}(),!i.jp_carousel("testIfOpened")))return x=e("body").css("overflow"),e("body").css("overflow","hidden"),b=e("html").css("overflow"),e("html").css("overflow","hidden"),w=e(window).scrollTop(),o.data("carousel-extra",h),this.each(function(){var t=e(this);d&&e.extend(m,d),-1===m.start_index&&(m.start_index=0),o.trigger("jp_carousel.beforeOpen").fadeIn("fast",function(){o.trigger("jp_carousel.afterOpen"),i.jp_carousel("initSlides",t.find(m.items_selector),m.start_index).jp_carousel("selectSlideAtIndex",m.start_index)}),i.html("")})},selectSlideAtIndex:function(e){var t=this.jp_carousel("slides"),a=t.eq(e);return 0===a.length&&(a=t.eq(0)),i.jp_carousel("selectSlide",a,!1),this},close:function(){return e("body").css("overflow",x),e("html").css("overflow",b),this.jp_carousel("clearCommentTextAreaValue"),o.trigger("jp_carousel.beforeClose").fadeOut("fast",function(){o.trigger("jp_carousel.afterClose"),e(window).scrollTop(w)})},next:function(){this.jp_carousel("previousOrNext","nextSlide")},previous:function(){this.jp_carousel("previousOrNext","prevSlide")},previousOrNext:function(e){if(!this.jp_carousel("hasMultipleImages"))return!1;var t=i.jp_carousel(e);t&&(o.animate({scrollTop:0},"fast"),this.jp_carousel("clearCommentTextAreaValue"),this.jp_carousel("selectSlide",t))},selectedSlide:function(){return this.find(".selected")},setSlidePosition:function(e){return l=Date.now(),this.css({"-webkit-transform":"translate3d("+e+"px,0,0)","-moz-transform":"translate3d("+e+"px,0,0)","-ms-transform":"translate("+e+"px,0)","-o-transform":"translate("+e+"px,0)",transform:"translate3d("+e+"px,0,0)"})},updateSlidePositions:function(e){var t=this.jp_carousel("selectedSlide"),a=i.width(),o=t.width(),s=i.jp_carousel("prevSlide"),r=i.jp_carousel("nextSlide"),n=s.prev(),l=r.next(),c=Math.floor(.5*(a-o));t.jp_carousel("setSlidePosition",c).show(),i.jp_carousel("fitInfo",e),1===(h.is(t.prevAll())?1:-1)?(l.is(s)||l.jp_carousel("setSlidePosition",a+r.width()).show(),n.is(r)||n.jp_carousel("setSlidePosition",-n.width()-o).show()):l.is(s)||l.jp_carousel("setSlidePosition",a+o).show(),s.jp_carousel("setSlidePosition",Math.floor(-s.width()+.75*_)).show(),r.jp_carousel("setSlidePosition",Math.ceil(a-.75*_)).show()},selectSlide:function(t,a){h=this.find(".selected").removeClass("selected");var s,r,n=i.jp_carousel("slides").css({position:"fixed"}),l=e(t).addClass("selected").css({position:"relative"}),d=l.data("attachment-id"),p=i.jp_carousel("prevSlide"),u=i.jp_carousel("nextSlide"),m=p.prev(),f=u.next();i.jp_carousel("loadFullImage",l),c.hide(),0===u.length&&n.length<=2?e(".jp-carousel-next-button").hide():e(".jp-carousel-next-button").show(),0===p.length&&n.length<=2?e(".jp-carousel-previous-button").hide():e(".jp-carousel-previous-button").show(),s=l.add(p).add(m).add(u).add(f).jp_carousel("loadSlide"),n.not(s).hide(),i.jp_carousel("updateSlidePositions",a),o.trigger("jp_carousel.selectSlide",[l]),i.jp_carousel("getTitleDesc",{title:l.data("title"),desc:l.data("desc")});var g=l.data("image-meta");i.jp_carousel("updateExif",g),i.jp_carousel("updateFullSizeLink",l),i.jp_carousel("updateMap",g),i.jp_carousel("testCommentsOpened",l.data("comments-opened")),i.jp_carousel("getComments",{attachment_id:d,offset:0,clear:!0}),e("#jp-carousel-comment-post-results").slideUp(),l.data("caption")?((r=e("<div />").text(l.data("caption")).html())===e("<div />").text(l.data("title")).html()&&e(".jp-carousel-titleanddesc-title").fadeOut("fast").empty(),r===e("<div />").text(l.data("desc")).html()&&e(".jp-carousel-titleanddesc-desc").fadeOut("fast").empty(),c.html(l.data("caption")).fadeIn("slow")):c.fadeOut("fast").empty(),jetpackCarouselStrings.stats&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?"+jetpackCarouselStrings.stats+"&post="+encodeURIComponent(d)+"&rand="+Math.random()),e(u).add(p).each(function(){i.jp_carousel("loadFullImage",e(this))}),window.location.hash=y="#jp-carousel-"+d},slides:function(){return this.find(".jp-carousel-slide")},slideDimensions:function(){return{width:e(window).width()-2*_,height:Math.floor(e(window).height()/100*85-60)}},loadSlide:function(){return this.each(function(){var t=e(this);t.find("img").one("load",function(){t.jp_carousel("fitSlide",!1)})})},bestFit:function(){var e,t,a=i.jp_carousel("slideDimensions"),o=this.jp_carousel("originalDimensions"),s=o.width/o.height,r=1,n=1;return o.width>a.width&&(r=a.width/o.width),o.height>a.height&&(n=a.height/o.height),r<n?(e=a.width,t=Math.floor(e/s)):n<r?(t=a.height,e=Math.floor(t*s)):(e=o.width,t=o.height),{width:e,height:t}},fitInfo:function(){var e=this.jp_carousel("selectedSlide").jp_carousel("bestFit");return p.css({left:Math.floor(.5*(n.width()-e.width)),width:Math.floor(e.width)}),this},fitMeta:function(t){var a={top:Math.floor(e(window).height()/100*85+5)+"px"},i={width:n.width()-(f.width()+80)+"px"};t?(n.animate(a),v.animate(i)):(n.animate(a),v.css(i))},fitSlide:function(){return this.each(function(){var t=e(this),a=t.jp_carousel("bestFit"),o=i.jp_carousel("slideDimensions");a.left=0,a.top=Math.floor(.5*(o.height-a.height))+40,t.css(a)})},texturize:function(t){return t=(t=(t=(t=""+t).replace(/'/g,"&#8217;").replace(/&#039;/g,"&#8217;").replace(/[\u2019]/g,"&#8217;")).replace(/"/g,"&#8221;").replace(/&#034;/g,"&#8221;").replace(/&quot;/g,"&#8221;").replace(/[\u201D]/g,"&#8221;")).replace(/([\w]+)=&#[\d]+;(.+?)&#[\d]+;/g,'$1="$2"'),e.trim(t)},initSlides:function(t,a){t.length<2?e(".jp-carousel-next-button, .jp-carousel-previous-button").hide():e(".jp-carousel-next-button, .jp-carousel-previous-button").show(),t.each(function(){var t,a=e(this),o=a.data("orig-size")||"",s=i.jp_carousel("slideDimensions"),r=o.split(","),n=a.data("medium-file")||"",l=a.data("large-file")||"";o={width:parseInt(r[0],10),height:parseInt(r[1],10)},t=a.data("orig-file"),t=i.jp_carousel("selectBestImageSize",{orig_file:t,orig_width:o.width,orig_height:o.height,max_width:s.width,max_height:s.height,medium_file:n,large_file:l}),e(this).data("gallery-src",t)}),0!==a&&(e("<img/>")[0].src=e(t[a]).data("gallery-src"));var o=t.first().closest(".tiled-gallery.type-rectangular").length>0;return t.each(function(t){var s=e(this),r=s.data("attachment-id")||0,n=s.data("comments-opened")||0,l=s.data("image-meta")||{},c=s.data("orig-size")||"",d={width:s[0].naturalWidth,height:s[0].naturalHeight},p=s.data("image-title")||"",u=s.data("image-description")||"",m=s.parents(".gallery-item").find(".gallery-caption").html()||"",h=s.data("gallery-src")||"",f=s.data("medium-file")||"",g=s.data("large-file")||"",j=s.data("orig-file")||"",v=s.parents("div.tiled-gallery-item").find("div.tiled-gallery-caption").html();if(v&&(m=v),r&&c.length){p=i.jp_carousel("texturize",p),u=i.jp_carousel("texturize",u),m=i.jp_carousel("texturize",m);var w=e("<img/>").attr("src","data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7").css("width","100%").css("height","100%"),_=e('<div class="jp-carousel-slide" itemprop="associatedMedia" itemscope itemtype="https://schema.org/ImageObject"></div>').hide().css({left:t<a?-1e3:i.width()}).append(w).appendTo(i).data("src",h).data("title",p).data("desc",u).data("caption",m).data("attachment-id",r).data("permalink",s.parents("a").attr("href")).data("orig-size",c).data("comments-opened",n).data("image-meta",l).data("medium-file",f).data("large-file",g).data("orig-file",j).data("thumb-size",d);o&&_.data("preview-image",s.attr("src")).css({"background-image":'url("'+s.attr("src")+'")',"background-size":"100% 100%","background-position":"center center"}),_.jp_carousel("fitSlide",!1)}}),this},selectBestImageSize:function(e){if("object"!=typeof e&&(e={}),void 0===e.orig_file)return"";if(void 0===e.orig_width||void 0===e.max_width)return e.orig_file;if(void 0===e.medium_file||void 0===e.large_file)return e.orig_file;var t=document.createElement("a");t.href=e.large_file;var a=/^i[0-2].wp.com$/i.test(t.hostname),o=i.jp_carousel("getImageSizeParts",e.medium_file,e.orig_width,a),s=i.jp_carousel("getImageSizeParts",e.large_file,e.orig_width,a),r=parseInt(s[0],10),n=parseInt(s[1],10),l=parseInt(o[0],10),c=parseInt(o[1],10);if(e.orig_max_width=e.max_width,e.orig_max_height=e.max_height,void 0!==window.devicePixelRatio&&window.devicePixelRatio>1&&(e.max_width=e.max_width*window.devicePixelRatio,e.max_height=e.max_height*window.devicePixelRatio),r>=e.max_width||n>=e.max_height)return e.large_file;if(l>=e.max_width||c>=e.max_height)return e.medium_file;if(a){var d=e.large_file.lastIndexOf("?"),p=e.large_file;return-1!==d&&(p=e.large_file.substring(0,d),(e.orig_width>e.max_width||e.orig_height>e.max_height)&&(p+="?fit="+e.orig_max_width+"%2C"+e.orig_max_height)),p}return e.orig_file},getImageSizeParts:function(e,t,a){var i=a?e.replace(/.*=([\d]+%2C[\d]+).*$/,"$1"):e.replace(/.*-([\d]+x[\d]+)\..+$/,"$1"),o=i!==e?a?i.split("%2C"):i.split("x"):[t,0];return"9999"===o[0]&&(o[0]="0"),"9999"===o[1]&&(o[1]="0"),o},originalDimensions:function(){var t=e(this).data("orig-size").split(",");return{width:parseInt(t[0],10),height:parseInt(t[1],10)}},format:function(e){if("object"!=typeof e&&(e={}),e.text&&void 0!==e.text)return e.replacements&&void 0!==e.replacements?e.text.replace(/{(\d+)}/g,function(t,a){return void 0!==e.replacements[a]?e.replacements[a]:t}):e.text},shutterSpeed:function(e){return e>=1?Math.round(10*e)/10+"s":"1/"+Math.round(1/e)+"s"},parseTitleDesc:function(e){return!e.match(" ")&&e.match("_")?"":e},getTitleDesc:function(t){var a,o,s="",r="";(o=e("div.jp-carousel-titleanddesc","div.jp-carousel-wrap")).hide(),s=i.jp_carousel("parseTitleDesc",t.title)||"",a=i.jp_carousel("parseTitleDesc",t.desc)||"",(s.length||a.length)&&(e("<div />").html(s).text()===e("<div />").html(a).text()&&(s=""),r=s.length?'<div class="jp-carousel-titleanddesc-title">'+s+"</div>":"",r+=a.length?'<div class="jp-carousel-titleanddesc-desc">'+a+"</div>":"",o.html(r).fadeIn("slow")),e("div#jp-carousel-comment-form-container").css("margin-top","20px"),e("div#jp-carousel-comments-loading").css("margin-top","20px")},updateExif:function(t){if(!t||1!==Number(jetpackCarouselStrings.display_exif))return!1;var a=e("<ul class='jp-carousel-image-exif'></ul>");e.each(t,function(t,o){if(0!==parseFloat(o)&&o.length&&-1!==e.inArray(t,e.makeArray(jetpackCarouselStrings.meta_data))){switch(t){case"focal_length":o+="mm";break;case"shutter_speed":o=i.jp_carousel("shutterSpeed",o);break;case"aperture":o="f/"+o}a.append("<li><h5>"+jetpackCarouselStrings[t]+"</h5>"+o+"</li>")}}),e("div.jp-carousel-image-meta ul.jp-carousel-image-exif").replaceWith(a)},updateFullSizeLink:function(t){if(!t||!t.data)return!1;var a,o=t.data("orig-size").split(","),s=document.createElement("a");s.href=t.data("src").replace(/\?.+$/,""),a=null!==s.hostname.match(/^i[\d]{1}.wp.com$/i)?s.href:t.data("orig-file").replace(/\?.+$/,"");var r=e("<a>"+i.jp_carousel("format",{text:jetpackCarouselStrings.download_original,replacements:o})+"</a>").addClass("jp-carousel-image-download").attr("href",a).attr("target","_blank");e("div.jp-carousel-image-meta a.jp-carousel-image-download").replaceWith(r)},updateMap:function(t){if(t.latitude&&t.longitude&&1===Number(jetpackCarouselStrings.display_geo)){var a=t.latitude,i=t.longitude,o=e("div.jp-carousel-image-meta","div.jp-carousel-wrap"),s="&scale=2&style=feature:all|element:all|invert_lightness:true|hue:0x0077FF|saturation:-50|lightness:-5|gamma:0.91";e("<div></div>").addClass("jp-carousel-image-map").html('<img width="154" height="154" src="https://maps.googleapis.com/maps/api/staticmap?\t\t\t\t\t\t\tcenter='+a+","+i+"&\t\t\t\t\t\t\tzoom=8&\t\t\t\t\t\t\tsize=154x154&\t\t\t\t\t\t\tsensor=false&\t\t\t\t\t\t\tmarkers=size:medium%7Ccolor:blue%7C"+a+","+i+s+'" class="gmap-main" />\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="gmap-topright"><div class="imgclip"><img width="175" height="154" src="https://maps.googleapis.com/maps/api/staticmap?\t\t\t\t\t\t\tcenter='+a+","+i+"&\t\t\t\t\t\t\tzoom=3&\t\t\t\t\t\t\tsize=175x154&\t\t\t\t\t\t\tsensor=false&\t\t\t\t\t\t\tmarkers=size:small%7Ccolor:blue%7C"+a+","+i+s+'"c /></div></div>\t\t\t\t\t\t\t\t\t\t\t\t\t').prependTo(o)}},testCommentsOpened:function(t){1===parseInt(t,10)?(e(".jp-carousel-buttons").fadeIn("fast"),j.fadeIn("fast")):(e(".jp-carousel-buttons").fadeOut("fast"),j.fadeOut("fast"))},getComments:function(t){if(clearInterval(m),"object"==typeof t&&void 0!==t.attachment_id&&t.attachment_id){(!t.offset||void 0===t.offset||t.offset<1)&&(t.offset=0);var a=e(".jp-carousel-comments"),o=e("#jp-carousel-comments-loading").show();t.clear&&a.hide().empty(),e.ajax({type:"GET",url:jetpackCarouselStrings.ajaxurl,dataType:"json",data:{action:"get_attachment_comments",nonce:jetpackCarouselStrings.nonce,id:t.attachment_id,offset:t.offset},success:function(s){t.clear&&a.fadeOut("fast").empty(),e(s).each(function(){var o=e("<div></div>").addClass("jp-carousel-comment").attr("id","jp-carousel-comment-"+this.id).html('<div class="comment-gravatar">'+this.gravatar_markup+'</div><div class="comment-author">'+this.author_markup+'</div><div class="comment-date">'+this.date_gmt+'</div><div class="comment-content">'+this.content+"</div>");a.append(o),clearInterval(m),m=setInterval(function(){e(".jp-carousel-overlay").height()-150<e(".jp-carousel-wrap").scrollTop()+e(window).height()&&(i.jp_carousel("getComments",{attachment_id:t.attachment_id,offset:t.offset+10,clear:!1}),clearInterval(m))},300)});var r=e(".jp-carousel div.selected");if(r&&r.data&&r.data("attachment-id")!=t.attachment_id)return a.fadeOut("fast"),void a.empty();e(".jp-carousel-overlay").height(e(window).height()+g.height()+j.height()+(a.height()>0?a.height():f.height())+200),a.show(),o.hide()},error:function(e,t,i){console.log("Comment get fail...",e,t,i),a.fadeIn("fast"),o.fadeOut("fast")}})}},postCommentError:function(t){"object"!=typeof t&&(t={}),t.field&&void 0!==t.field&&t.error&&void 0!==t.error&&(e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-error">'+t.error+"</span>").slideDown("fast"),e("#jp-carousel-comment-form-spinner").spin(!1))},setCommentIframeSrc:function(t){var a=e("#jp-carousel-comment-iframe");a&&a.length&&(a.attr("src",a.attr("src").replace(/(postid=)\d+/,"$1"+t)),a.attr("src",a.attr("src").replace(/(%23.+)?$/,"%23jp-carousel-"+t)))},clearCommentTextAreaValue:function(){var t=e("#jp-carousel-comment-form-comment-field");t&&t.val("")},nextSlide:function(){var e=this.jp_carousel("slides"),t=this.jp_carousel("selectedSlide");return 0===t.length||e.length>2&&t.is(e.last())?e.first():t.next()},prevSlide:function(){var e=this.jp_carousel("slides"),t=this.jp_carousel("selectedSlide");return 0===t.length||e.length>2&&t.is(e.first())?e.last():t.prev()},loadFullImage:function(t){var a=t.find("img:first");a.data("loaded")||(a.on("load.jetpack",function(){a.off("load.jetpack"),e(this).closest(".jp-carousel-slide").css("background-image","")}),!t.data("preview-image")||t.data("thumb-size")&&t.width()>t.data("thumb-size").width?a.attr("src",a.closest(".jp-carousel-slide").data("src")).attr("itemprop","image"):a.attr("src",t.data("preview-image")).attr("itemprop","image"),a.data("loaded",1))},hasMultipleImages:function(){return i.jp_carousel("slides").length>1}};e.fn.jp_carousel=function(t){return I[t]?I[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.jp_carousel"):I.open.apply(this,arguments)},e(document.body).on("click.jp-carousel","div.gallery, div.tiled-gallery, ul.wp-block-gallery, ul.blocks-gallery-grid, div.wp-block-jetpack-tiled-gallery, a.single-image-gallery",function(t){e(this).jp_carousel("testForData",t.currentTarget)&&(e(t.target).parent().hasClass("gallery-caption")||e(t.target).parent().is("figcaption")||(e("html").css("height","auto"),t.preventDefault(),t.stopPropagation(),e(this).jp_carousel("open",{start_index:e(this).find(".gallery-item, .tiled-gallery-item, .blocks-gallery-item, .tiled-gallery__item").index(e(t.target).parents(".gallery-item, .tiled-gallery-item, .blocks-gallery-item, .tiled-gallery__item"))})))}),1===Number(jetpackCarouselStrings.single_image_gallery)&&(C(),e(document.body).on("post-load",function(){C()})),e(window).on("hashchange.jp-carousel",function(){var t,a,s,r=/jp-carousel-(\d+)/;window.location.hash&&r.test(window.location.hash)?window.location.hash===y&&i.opened||(window.location.hash&&i&&!i.opened&&history.back?history.back():(y=window.location.hash,t=window.location.hash.match(r),a=parseInt(t[1],10),e("div.gallery, div.tiled-gallery, a.single-image-gallery, ul.wp-block-gallery, div.wp-block-jetpack-tiled-gallery").each(function(t,i){if(e(i).find("img").each(function(t,o){if(e(o).data("attachment-id")===parseInt(a,10))return s={index:t,gallery:i},!1}),s)return e(s.gallery).jp_carousel("openOrSelectSlide",s.index),!1}))):i&&i.opened&&o.jp_carousel("close")}),window.location.hash&&e(window).trigger("hashchange")}),function(e){e.fn.touchwipe=function(t){var a={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:!0};return t&&e.extend(a,t),this.each(function(){var e,t,i=!1;function o(){this.removeEventListener("touchmove",s),e=null,i=!1}function s(s){if(a.preventDefaultEvents&&s.preventDefault(),i){var r=s.touches[0].pageX,n=s.touches[0].pageY,l=e-r,c=t-n;Math.abs(l)>=a.min_move_x?(o(),l>0?a.wipeLeft(s):a.wipeRight(s)):Math.abs(c)>=a.min_move_y&&(o(),c>0?a.wipeDown(s):a.wipeUp(s))}}"ontouchstart"in document.documentElement&&this.addEventListener("touchstart",function(a){1===a.touches.length&&(e=a.touches[0].pageX,t=a.touches[0].pageY,i=!0,this.addEventListener("touchmove",s,!1))},!1)}),this}}(jQuery); \ No newline at end of file
+!function(){"use strict";var e,t={noop:function(){},texturize:function(e){return(e=(e=(e=(e+="").replace(/'/g,"&#8217;").replace(/&#039;/g,"&#8217;")).replace(/"/g,"&#8221;").replace(/&#034;/g,"&#8221;").replace(/&quot;/g,"&#8221;").replace(/[\u201D]/g,"&#8221;")).replace(/([\w]+)=&#[\d]+;(.+?)&#[\d]+;/g,'$1="$2"')).trim()},applyReplacements:function(e,t){if(e)return t?e.replace(/{(\d+)}/g,(function(e,r){return void 0!==t[r]?t[r]:e})):e},getBackgroundImage:function(e){var t=document.createElement("canvas"),r=t.getContext&&t.getContext("2d");if(e){r.filter="blur(20px) ",r.drawImage(e,0,0);var o=t.toDataURL("image/png");return t=null,o}}},r=function(){function e(e,t){return Element.prototype.matches?e.matches(t):Element.prototype.msMatchesSelector?e.msMatchesSelector(t):void 0}function r(e,t,r,o){if(!e)return o();e.style.removeProperty("display"),e.style.opacity=t,e.style.transition="opacity 0.2s",e.style.pointerEvents="none";var a=function(t){t.target===e&&"opacity"===t.propertyName&&(e.style.removeProperty("transition"),e.style.removeProperty("opacity"),e.style.removeProperty("pointer-events"),e.removeEventListener("transitionend",a),e.removeEventListener("transitioncancel",a),o())};requestAnimationFrame((function(){requestAnimationFrame((function(){e.addEventListener("transitionend",a),e.addEventListener("transitioncancel",a),e.style.opacity=r}))}))}return{closest:function(t,r){if(t.closest)return t.closest(r);var o=t;do{if(e(o,r))return o;o=o.parentElement||o.parentNode}while(null!==o&&1===o.nodeType);return null},matches:e,hide:function(e){e&&(e.style.display="none")},show:function(e){e&&(e.style.display="block")},fadeIn:function(e,o){r(e,"0","1",o=o||t.noop)},fadeOut:function(e,o){o=o||t.noop,r(e,"1","0",(function(){e&&(e.style.display="none"),o()}))},scrollToElement:function(e,t,r){if(!e||!t)return r?r():void 0;var o=t.querySelector(".jp-carousel-info-extra");o&&(o.style.minHeight=window.innerHeight-64+"px");var a=!0,i=Date.now(),n=t.scrollTop,l=Math.max(0,e.offsetTop-Math.max(0,window.innerHeight-function(e){var t=e.querySelector(".jp-carousel-info-footer"),r=e.querySelector(".jp-carousel-info-extra"),o=e.querySelector(".jp-carousel-info-content-wrapper");if(t&&r&&o){var a=window.getComputedStyle(r),i=parseInt(a.paddingTop,10)+parseInt(a.paddingBottom,10);return i=isNaN(i)?0:i,o.offsetHeight+t.offsetHeight+i}return 0}(t))),s=l-t.scrollTop;function c(){a=!1}s=Math.min(s,t.scrollHeight-window.innerHeight),t.addEventListener("wheel",c),function e(){var l,u=Date.now(),d=(l=(u-i)/300)<.5?2*l*l:1-Math.pow(-2*l+2,2)/2,p=(d=d>1?1:d)*s;if(t.scrollTop=n+p,u<=i+300&&a)return requestAnimationFrame(e);r&&r(),o&&(o.style.minHeight=""),a=!1,t.removeEventListener("wheel",c)}()},getJSONAttribute:function(e,t){if(e&&e.hasAttribute(t))try{return JSON.parse(e.getAttribute(t))}catch(e){return}},convertToPlainText:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML},stripHTML:function(e){return e.replace(/<[^>]*>?/gm,"")},emitEvent:function(e,t,r){var o;try{o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r||null})}catch(e){(o=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,r||null)}e.dispatchEvent(o)},isTouch:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch}}}();function o(){var o,a,i,n,l="",s=!1,c="div.gallery, div.tiled-gallery, ul.wp-block-gallery, ul.blocks-gallery-grid, figure.wp-block-gallery.has-nested-images, div.wp-block-jetpack-tiled-gallery, a.single-image-gallery",u=".gallery-item, .tiled-gallery-item, .blocks-gallery-item, .tiled-gallery__item",d=u+", .wp-block-image",p={},m="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.stat?wpcom.carousel.stat:t.noop,g="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.pageview?wpcom.carousel.pageview:t.noop;function h(t){if(!s)switch(t.which){case 38:t.preventDefault(),p.overlay.scrollTop-=100;break;case 40:t.preventDefault(),p.overlay.scrollTop+=100;break;case 39:t.preventDefault(),e.slideNext();break;case 37:case 8:t.preventDefault(),e.slidePrev();break;case 27:t.preventDefault(),b()}}function f(){s=!0}function v(){s=!1}function y(){p.overlay||(p.overlay=document.querySelector(".jp-carousel-overlay"),p.container=p.overlay.querySelector(".jp-carousel-wrap"),p.gallery=p.container.querySelector(".jp-carousel"),p.info=p.overlay.querySelector(".jp-carousel-info"),p.caption=p.info.querySelector(".jp-carousel-caption"),p.commentField=p.overlay.querySelector("#jp-carousel-comment-form-comment-field"),p.emailField=p.overlay.querySelector("#jp-carousel-comment-form-email-field"),p.authorField=p.overlay.querySelector("#jp-carousel-comment-form-author-field"),p.urlField=p.overlay.querySelector("#jp-carousel-comment-form-url-field"),window.innerWidth<=760&&Math.round(window.innerWidth/760*110)<40&&r.isTouch(),[p.commentField,p.emailField,p.authorField,p.urlField].forEach((function(e){e&&(e.addEventListener("focus",f),e.addEventListener("blur",v))})),p.overlay.addEventListener("click",(function(e){var t,o,a=e.target,i=!!r.closest(a,".jp-carousel-close-hint"),n=!!window.matchMedia("(max-device-width: 760px)").matches;if(a===p.overlay){if(n)return;b()}else if(i)b();else if(a.classList.contains("jp-carousel-image-download"))m("download_original_click");else if(a.classList.contains("jp-carousel-comment-login"))t=p.currentSlide,o=t?t.attrs.attachmentId:"0",window.location.href=jetpackCarouselStrings.login_url+"%23jp-carousel-"+o;else if(r.closest(a,"#jp-carousel-comment-form-container"))!function(e){var t=e.target,o=r.getJSONAttribute(p.container,"data-carousel-extra")||{},a=p.currentSlide.attrs.attachmentId,i=document.querySelector("#jp-carousel-comment-form-submit-and-info-wrapper"),n=document.querySelector("#jp-carousel-comment-form-spinner"),l=document.querySelector("#jp-carousel-comment-form-button-submit"),s=document.querySelector("#jp-carousel-comment-form");if(p.commentField&&p.commentField.getAttribute("id")===t.getAttribute("id"))f(),r.show(i);else if(r.matches(t,'input[type="submit"]')){e.preventDefault(),e.stopPropagation(),r.show(n),s.classList.add("jp-carousel-is-disabled");var c={action:"post_attachment_comment",nonce:jetpackCarouselStrings.nonce,blog_id:o.blog_id,id:a,comment:p.commentField.value};if(!c.comment.length)return void w(jetpackCarouselStrings.no_comment_text,!1);if(1!==Number(jetpackCarouselStrings.is_logged_in)&&(c.email=p.emailField.value,c.author=p.authorField.value,c.url=p.urlField.value,1===Number(jetpackCarouselStrings.require_name_email))){if(!c.email.length||!c.email.match("@"))return void w(jetpackCarouselStrings.no_comment_email,!1);if(!c.author.length)return void w(jetpackCarouselStrings.no_comment_author,!1)}var u=new XMLHttpRequest;u.open("POST",jetpackCarouselStrings.ajaxurl,!0),u.setRequestHeader("X-Requested-With","XMLHttpRequest"),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),u.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&this.status>=200&&this.status<300){var e;try{e=JSON.parse(this.response)}catch(e){return void w(jetpackCarouselStrings.comment_post_error,!1)}"approved"===e.comment_status?w(jetpackCarouselStrings.comment_approved,!0):"unapproved"===e.comment_status?w(jetpackCarouselStrings.comment_unapproved,!0):w(jetpackCarouselStrings.comment_post_error,!1),T(),q(a),l.value=jetpackCarouselStrings.post_comment,r.hide(n),s.classList.remove("jp-carousel-is-disabled")}else w(jetpackCarouselStrings.comment_post_error,!1)};var d=[];for(var m in c)if(m){var g=encodeURIComponent(m)+"="+encodeURIComponent(c[m]);d.push(g.replace(/%20/g,"+"))}var h=d.join("&");u.send(h)}}(e);else if(r.closest(a,".jp-carousel-photo-icons-container")||a.classList.contains("jp-carousel-photo-title"))!function(e){e.preventDefault();var t=e.target,o=p.info.querySelector(".jp-carousel-info-extra"),a=p.info.querySelector(".jp-carousel-image-meta"),i=p.info.querySelector(".jp-carousel-comments-wrapper"),n=p.info.querySelector(".jp-carousel-icon-info"),l=p.info.querySelector(".jp-carousel-icon-comments");function s(){l&&l.classList.remove("jp-carousel-selected"),n.classList.toggle("jp-carousel-selected"),i&&i.classList.remove("jp-carousel-show"),a&&(a.classList.toggle("jp-carousel-show"),a.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}function c(){n&&n.classList.remove("jp-carousel-selected"),l.classList.toggle("jp-carousel-selected"),a&&a.classList.remove("jp-carousel-show"),i&&(i.classList.toggle("jp-carousel-show"),i.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}(r.closest(t,".jp-carousel-icon-info")||t.classList.contains("jp-carousel-photo-title"))&&(a&&a.classList.contains("jp-carousel-show")?r.scrollToElement(p.overlay,p.overlay,s):(s(),r.scrollToElement(p.info,p.overlay))),r.closest(t,".jp-carousel-icon-comments")&&(i&&i.classList.contains("jp-carousel-show")?r.scrollToElement(p.overlay,p.overlay,c):(c(),r.scrollToElement(p.info,p.overlay)))}(e);else if(!r.closest(a,".jp-carousel-info"))return})),window.addEventListener("keydown",h),p.overlay.addEventListener("jp_carousel.afterOpen",(function(){v(),p.slides.length<=1||(p.slides.length<=5?r.show(p.info.querySelector(".jp-swiper-pagination")):r.show(p.info.querySelector(".jp-carousel-pagination")))})),p.overlay.addEventListener("jp_carousel.beforeClose",(function(){f(),document.documentElement.style.removeProperty("height"),e&&e.enable(),r.hide(p.info.querySelector(".jp-swiper-pagination")),r.hide(p.info.querySelector(".jp-carousel-pagination"))})),p.overlay.addEventListener("jp_carousel.afterClose",(function(){window.history.pushState?history.pushState("",document.title,window.location.pathname+window.location.search):window.location.href="",l="",p.isOpen=!1})),p.overlay.addEventListener("touchstart",(function(e){e.touches.length>1&&e.preventDefault()})))}function w(e,t){var o=p.overlay.querySelector("#jp-carousel-comment-post-results"),a="jp-carousel-comment-post-"+(t?"success":"error");o.innerHTML='<span class="'+a+'">'+e+"</span>",r.hide(p.overlay.querySelector("#jp-carousel-comment-form-spinner")),p.overlay.querySelector("#jp-carousel-comment-form").classList.remove("jp-carousel-is-disabled"),r.show(o)}function j(){var e=document.querySelectorAll("a img[data-attachment-id]");Array.prototype.forEach.call(e,(function(e){var t=e.parentElement,o=t.parentElement;if(!o.classList.contains("gallery-icon")&&!r.closest(o,u)&&t.hasAttribute("href")){var a=!1;t.getAttribute("href").split("?")[0]===e.getAttribute("data-orig-file").split("?")[0]&&1===Number(jetpackCarouselStrings.single_image_gallery_media_file)&&(a=!0),t.getAttribute("href")===e.getAttribute("data-permalink")&&(a=!0),a&&(t.classList.add("single-image-gallery"),t.setAttribute("data-carousel-extra",JSON.stringify({blog_id:Number(jetpackCarouselStrings.blog_id)})))}}))}function S(o){(!o||o<0||o>p.slides.length)&&(o=0),p.currentSlide=p.slides[o];var a,i,n=p.currentSlide,s=n.attrs.attachmentId,c=p.info.querySelector(".jp-carousel-icon-info"),u=p.info.querySelector(".jp-carousel-icon-comments");(c&&c.classList.contains("jp-carousel-selected")||u&&u.classList.contains("jp-carousel-selected"))&&0!==p.overlay.scrollTop&&r.scrollToElement(p.overlay,p.overlay),function(e){var t=e.el,r=e.attrs,o=t.querySelector("img");if(!o.hasAttribute("data-loaded")){var a=!!r.previewImage,i=r.thumbSize;!a||i&&t.offsetWidth>i.width?o.src=r.src:o.src=r.previewImage,o.setAttribute("itemprop","image"),o.setAttribute("data-loaded",1)}}(p.slides[o]),1!==Number(jetpackCarouselStrings.display_background_image)||p.slides[o].backgroundImage||function(t){var r=t.el;e&&e.slides&&(r=e.slides[e.activeIndex]);var o=t.attrs.originalElement;o.complete&&0!==o.naturalHeight?E(t,r,o):o.onload=function(){E(t,r,o)}}(p.slides[o]),r.hide(p.caption),function(e){var t,o,a,i,n="",l="",s="";if(t=p.overlay.querySelector(".jp-carousel-photo-caption"),o=p.overlay.querySelector(".jp-carousel-caption"),a=p.overlay.querySelector(".jp-carousel-photo-title"),i=p.overlay.querySelector(".jp-carousel-photo-description"),r.hide(t),r.hide(o),r.hide(a),r.hide(i),n=k(e.caption)||"",l=k(e.title)||"",s=k(e.desc)||"",(n||l||s)&&(n&&(t.innerHTML=n,o.innerHTML=n,r.show(t),r.show(o)),r.stripHTML(n)===r.stripHTML(l)&&(l=""),r.stripHTML(n)===r.stripHTML(s)&&(s=""),r.stripHTML(l)===r.stripHTML(s)&&(s=""),s&&(i.innerHTML=s,r.show(i),l||n||(t.innerHTML=r.stripHTML(s),r.show(t))),l)){var c=r.stripHTML(l);a.innerHTML=c,n||(t.innerHTML=c,o.innerHTML=c,r.show(t)),r.show(a)}}({caption:n.attrs.caption,title:n.attrs.title,desc:n.attrs.desc}),function(e){if(!e||1!==Number(jetpackCarouselStrings.display_exif))return!1;var t=p.info.querySelector(".jp-carousel-image-meta ul.jp-carousel-image-exif"),r="";for(var o in e){var a=e[o],i=jetpackCarouselStrings.meta_data||[];if(0!==parseFloat(a)&&a.length&&-1!==i.indexOf(o)){switch(o){case"focal_length":a+="mm";break;case"shutter_speed":a=x(a);break;case"aperture":a="f/"+a}r+="<li><h5>"+jetpackCarouselStrings[o]+"</h5>"+a+"</li>"}}t.innerHTML=r,t.style.removeProperty("display")}(p.slides[o].attrs.imageMeta),function(e){if(!e)return!1;var r,o=[e.attrs.origWidth,e.attrs.origHeight],a=document.createElement("a");a.href=e.attrs.src.replace(/\?.+$/,""),r=null!==a.hostname.match(/^i[\d]{1}\.wp\.com$/i)?a.href:e.attrs.origFile.replace(/\?.+$/,"");var i=p.info.querySelector(".jp-carousel-download-text"),n=p.info.querySelector(".jp-carousel-image-download");i.innerHTML=t.applyReplacements(jetpackCarouselStrings.download_original,o),n.setAttribute("href",r),n.style.removeProperty("display")}(n),1===Number(jetpackCarouselStrings.display_comments)&&(a=p.slides[o].attrs.commentsOpened,i=p.container.querySelector(".jp-carousel-comment-form-container"),1===parseInt(a,10)?r.fadeIn(i):r.fadeOut(i),q(s),r.hide(p.info.querySelector("#jp-carousel-comment-post-results")));var d=p.info.querySelector(".jp-carousel-pagination");if(d&&p.slides.length>5){var m=o+1;d.innerHTML="<span>"+m+" / "+p.slides.length+"</span>"}jetpackCarouselStrings.stats&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?"+jetpackCarouselStrings.stats+"&post="+encodeURIComponent(s)+"&rand="+Math.random()),g(s),window.location.hash=l="#jp-carousel-"+s}function b(){document.body.style.overflow=a,document.documentElement.style.overflow=i,T(),f(),r.emitEvent(p.overlay,"jp_carousel.beforeClose"),window.scrollTo(window.scrollX||window.pageXOffset||0,n||0),e.destroy(),p.isOpen=!1,p.slides=[],p.currentSlide=void 0,p.gallery.innerHTML="",r.fadeOut(p.overlay,(function(){r.emitEvent(p.overlay,"jp_carousel.afterClose")}))}function L(e,t,r){var o=r?e.replace(/.*=([\d]+%2C[\d]+).*$/,"$1"):e.replace(/.*-([\d]+x[\d]+)\..+$/,"$1"),a=o!==e?r?o.split("%2C"):o.split("x"):[t,0];return"9999"===a[0]&&(a[0]="0"),"9999"===a[1]&&(a[1]="0"),a}function x(e){return e>=1?Math.round(10*e)/10+"s":"1/"+Math.round(1/e)+"s"}function k(e){return!e.match(" ")&&e.match("_")?"":e}function q(e,t){var a=void 0===t,i=p.info.querySelector(".jp-carousel-icon-comments .jp-carousel-has-comments-indicator");if(i.classList.remove("jp-carousel-show"),clearInterval(o),e){(!t||t<1)&&(t=0);var n=p.info.querySelector(".jp-carousel-comments"),l=p.info.querySelector("#jp-carousel-comments-loading");r.show(l),a&&(r.hide(n),n.innerHTML="");var s=new XMLHttpRequest,c=jetpackCarouselStrings.ajaxurl+"?action=get_attachment_comments&nonce="+jetpackCarouselStrings.nonce+"&id="+e+"&offset="+t;s.open("GET",c),s.setRequestHeader("X-Requested-With","XMLHttpRequest");var u=function(){r.fadeIn(n),r.fadeOut(l)};s.onload=function(){if(p.currentSlide&&p.currentSlide.attrs.attachmentId===e){var c,d=s.status>=200&&s.status<300;try{c=JSON.parse(s.responseText)}catch(e){}if(!d||!c||!Array.isArray(c))return u();a&&(n.innerHTML="");for(var m=0;m<c.length;m++){var g=c[m],h=document.createElement("div");h.classList.add("jp-carousel-comment"),h.setAttribute("id","jp-carousel-comment-"+g.id),h.innerHTML='<div class="comment-gravatar">'+g.gravatar_markup+'</div><div class="comment-content"><div class="comment-author">'+g.author_markup+'</div><div class="comment-date">'+g.date_gmt+"</div>"+g.content+"</div>",n.appendChild(h),clearInterval(o),o=setInterval((function(){p.container.scrollTop+150>window.innerHeight&&(q(e,t+10),clearInterval(o))}),300)}c.length>0&&(r.show(n),i.innerText=c.length,i.classList.add("jp-carousel-show")),r.hide(l)}},s.onerror=u,s.send()}}function E(e,r,o){var a=t.getBackgroundImage(o);e.backgroundImage=a,r.style.backgroundImage="url("+a+")",r.style.backgroundSize="cover"}function T(){p.commentField&&(p.commentField.value="")}function A(e,o){p.slides=[];var a={width:window.innerWidth,height:window.innerHeight-64};0!==o&&((new Image).src=e[o].getAttribute("data-gallery-src"));var i=!!r.closest(e[0],".tiled-gallery.type-rectangular");Array.prototype.forEach.call(e,(function(e,o){var n=r.closest(e,"a"),l=e.getAttribute("data-orig-file")||e.getAttribute("src-orig"),s=e.getAttribute("data-attachment-id")||e.getAttribute("data-id")||"0",c=document.querySelector('img[data-attachment-id="'+s+'"] + figcaption');c=c?c.innerHTML:e.getAttribute("data-image-caption");var u={originalElement:e,attachmentId:s,commentsOpened:e.getAttribute("data-comments-opened")||"0",imageMeta:r.getJSONAttribute(e,"data-image-meta")||{},title:e.getAttribute("data-image-title")||"",desc:e.getAttribute("data-image-description")||"",mediumFile:e.getAttribute("data-medium-file")||"",largeFile:e.getAttribute("data-large-file")||"",origFile:l||"",thumbSize:{width:e.naturalWidth,height:e.naturalHeight},caption:c||"",permalink:n&&n.getAttribute("href"),src:l||e.getAttribute("src")||""},d=r.closest(e,".tiled-gallery-item"),m=d&&d.querySelector(".tiled-gallery-caption"),g=m&&m.innerHTML;g&&(u.caption=g);var h=function(e){var t=e.getAttribute("data-orig-size")||"";if(t){var r=t.split(",");return{width:parseInt(r[0],10),height:parseInt(r[1],10)}}return{width:e.getAttribute("data-original-width")||e.getAttribute("width")||void 0,height:e.getAttribute("data-original-height")||e.getAttribute("height")||void 0}}(e);if(u.origWidth=h.width||u.thumbSize.width,u.origHeight=h.height||u.thumbSize.height,"undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.generateImgSrc?u.src=wpcom.carousel.generateImgSrc(e,a):u.src=function(e){if("object"!=typeof e&&(e={}),void 0===e.origFile)return"";if(void 0===e.origWidth||void 0===e.maxWidth)return e.origFile;if(void 0===e.mediumFile||void 0===e.largeFile)return e.origFile;var t=document.createElement("a");t.href=e.largeFile;var r=/^i[0-2]\.wp\.com$/i.test(t.hostname),o=L(e.mediumFile,e.origWidth,r),a=L(e.largeFile,e.origWidth,r),i=parseInt(a[0],10),n=parseInt(a[1],10),l=parseInt(o[0],10),s=parseInt(o[1],10);if(e.origMaxWidth=e.maxWidth,e.origMaxHeight=e.maxHeight,void 0!==window.devicePixelRatio&&window.devicePixelRatio>1&&(e.maxWidth=e.maxWidth*window.devicePixelRatio,e.maxHeight=e.maxHeight*window.devicePixelRatio),i>=e.maxWidth||n>=e.maxHeight)return e.largeFile;if(l>=e.maxWidth||s>=e.maxHeight)return e.mediumFile;if(r){var c=e.largeFile.lastIndexOf("?"),u=e.largeFile;return-1!==c&&(u=e.largeFile.substring(0,c),(e.origWidth>e.maxWidth||e.origHeight>e.maxHeight)&&(e.origMaxWidth=2*e.maxWidth,e.origMaxHeight=2*e.maxHeight,u+="?fit="+e.origMaxWidth+"%2C"+e.origMaxHeight)),u}return e.origFile}({origFile:u.src,origWidth:u.origWidth,origHeight:u.origHeight,maxWidth:a.width,maxHeight:a.height,mediumFile:u.mediumFile,largeFile:u.largeFile}),e.setAttribute("data-gallery-src",u.src),"0"!==u.attachmentId){u.title=t.texturize(u.title),u.desc=t.texturize(u.desc),u.caption=t.texturize(u.caption);var f=new Image;f.src=u.src;var v=document.createElement("div");v.classList.add("swiper-slide"),v.setAttribute("itemprop","associatedMedia"),v.setAttribute("itemscope",""),v.setAttribute("itemtype","https://schema.org/ImageObject");var y=document.createElement("div");y.classList.add("swiper-zoom-container"),p.gallery.appendChild(v),v.appendChild(y),y.appendChild(f),v.setAttribute("data-attachment-id",u.attachmentId),v.setAttribute("data-permalink",u.permalink),v.setAttribute("data-orig-file",u.origFile),i&&(u.previewImage=u.src);var w={el:v,attrs:u,index:o};p.slides.push(w)}}))}function H(e,t){if(!window.Swiper670){var o=document.querySelector("#jp-carousel-loading-overlay");r.show(o);var a=document.createElement("script");return a.id="jetpack-carousel-swiper-js",a.src=window.jetpackSwiperLibraryPath.url,a.async=!0,a.onload=function(){r.hide(o),C(e,t)},a.onerror=function(){r.hide(o)},void document.head.appendChild(a)}C(e,t)}function C(t,o){var l,s={imgSelector:".gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id], img[data-attachment-id], img[data-id]",startIndex:0},c=r.getJSONAttribute(t,"data-carousel-extra");if(c&&(y(),!p.isOpen)){for(var u in p.isOpen=!0,a=getComputedStyle(document.body).overflow,document.body.style.overflow="hidden",i=getComputedStyle(document.documentElement).overflow,document.documentElement.style.overflow="hidden",n=window.scrollY||window.pageYOffset||0,p.container.setAttribute("data-carousel-extra",JSON.stringify(c)),m(["open","view_image"]),o||{})s[u]=o[u];-1===s.startIndex&&(s.startIndex=0),r.emitEvent(p.overlay,"jp_carousel.beforeOpen"),p.gallery.innerHTML="",p.overlay.style.opacity=1,p.overlay.style.display="block",A(t.querySelectorAll(s.imgSelector),s.startIndex),(e=new window.Swiper670(".jp-carousel-swiper-container",{centeredSlides:!0,zoom:!0,loop:p.slides.length>1,enabled:p.slides.length>1,pagination:{el:".jp-swiper-pagination",clickable:!0},navigation:{nextEl:".jp-swiper-button-next",prevEl:".jp-swiper-button-prev"},initialSlide:s.startIndex,on:{init:function(){S(s.startIndex)}},preventClicks:!1,preventClicksPropagation:!1,preventInteractionOnTransition:!r.isTouch(),threshold:5})).on("slideChange",(function(e){S(0===e.activeIndex?p.slides.length-1:e.activeIndex===p.slides.length+1?0:e.activeIndex-1),p.overlay.classList.remove("jp-carousel-hide-controls")})),e.on("zoomChange",(function(e,t){t>1&&p.overlay.classList.add("jp-carousel-hide-controls"),1===t&&p.overlay.classList.remove("jp-carousel-hide-controls")})),e.on("doubleTap",(function(e){if(clearTimeout(l),1===e.zoom.scale)var t=setTimeout((function(){p.overlay.classList.remove("jp-carousel-hide-controls"),clearTimeout(t)}),150)})),e.on("tap",(function(){e.zoom.scale>1&&(l=setTimeout((function(){p.overlay.classList.toggle("jp-carousel-hide-controls")}),150))})),r.fadeIn(p.overlay,(function(){r.emitEvent(p.overlay,"jp_carousel.afterOpen")}))}}document.body.addEventListener("click",(function(e){if(window.CSS&&window.CSS.supports&&window.CSS.supports("display","grid")){var t,o=e.target,a=r.closest(o,c);if(a){if(!(t=a)||!t.getAttribute("data-carousel-extra"))return;var i=o.parentElement,n=i.parentElement;if(n&&n.classList.contains("wp-block-image")){var l=i.getAttribute("href");if(l.split("?")[0]!==o.getAttribute("data-orig-file").split("?")[0]&&l!==o.getAttribute("data-permalink"))return}if(i.classList.contains("gallery-caption"))return;if(r.matches(i,"figcaption"))return;document.documentElement.style.height="auto",e.preventDefault(),e.stopPropagation();var s=r.closest(o,d),u=Array.prototype.indexOf.call(a.querySelectorAll(d),s);H(a,{startIndex:u})}}})),1===Number(jetpackCarouselStrings.single_image_gallery)&&(j(),document.body.addEventListener("is.post-load",(function(){j()}))),window.addEventListener("hashchange",(function(){var t=/jp-carousel-(\d+)/;if(window.location.hash&&t.test(window.location.hash)){if(window.location.hash!==l||!p.isOpen)if(window.location.hash&&p.gallery&&!p.isOpen&&history.back)history.back();else{l=window.location.hash;for(var r,o,a=window.location.hash.match(t),i=parseInt(a[1],10),n=document.querySelectorAll(c),s=0;s<n.length;s++){for(var u,d=n[s],m=d.querySelectorAll("img"),g=0;g<m.length;g++)if(parseInt(m[g].getAttribute("data-attachment-id"),10)===i||parseInt(m[g].getAttribute("data-id"),10)===i){u=g;break}if(void 0!==u){r=d,o=u,p.isOpen?(S(o),e.slideTo(o+1)):H(r,{startIndex:o});break}}}}else p.isOpen&&b()})),window.location.hash&&r.emitEvent(window,"hashchange")}"loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o)}(); \ No newline at end of file