🏠 Root
/
home
/
artorgp
/
www
/
wp-content
/
plugins
/
visual-portfolio
/
build
/
assets
/
js
/
Editing: plugin-photoswipe.js
(()=>{"use strict";var t={1929(t){t.exports=function(t){return"number"==typeof t?t-t===0:"string"==typeof t&&""!==t.trim()&&(Number.isFinite?Number.isFinite(+t):isFinite(+t))}}},e={};function o(n){var i=e[n];if(void 0!==i)return i.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,o),r.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n=o(1929),i=o.n(n);const r=window.jQuery;var s=o.n(r);function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function a(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function l(t,e,o){return(e=function(t){var e=function(t){if("object"!=p(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,"string");if("object"!=p(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==p(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var c=window,u=c.Image,d=c.VPData,w=c.VPPopupAPI,v=c.PhotoSwipe,_=c.PhotoSwipeUI_Default,__=d.__,h=d.settingsPopupGallery;function m(t,e){if(void 0!==e){var o,n=t.viewportSize.x,i=t.viewportSize.y,r=e.vw/e.vh,p=s()(e.container),a=t.options.barsSize,l=0,c=0;a&&(l=a.top&&"auto"!==a.top?a.top:0,c=a.bottom&&"auto"!==a.bottom?a.bottom:0),o=r>n/(i-=l+c)?n:i*r;var u=p.find(".vp-pswp-video");u.css("max-width",o),u.children().css({paddingBottom:"".concat(e.vh/e.vw*100,"%")}),p.css({top:l,bottom:c})}else t&&t.itemHolders.length&&t.itemHolders.forEach(function(e){e.item&&e.item.html&&m(t,e.item)})}if(v&&w){var f;if(!s()(".vp-pswp").length){var b='\n <div class="pswp vp-pswp'.concat(h.click_to_zoom?"":" vp-pswp-no-zoom",'" tabindex="-1" role="dialog" aria-hidden="true">\n <div class="pswp__bg"></div>\n <div class="pswp__scroll-wrap">\n <div class="pswp__container">\n <div class="pswp__item"></div>\n <div class="pswp__item"></div>\n <div class="pswp__item"></div>\n </div>\n <div class="pswp__ui pswp__ui--hidden">\n <div class="pswp__top-bar">\n <div class="pswp__counter"></div>\n <button class="pswp__button pswp__button--close" title="').concat(__.pswp_close,'"></button>\n <a href="#" class="pswp__button pswp__button--download').concat(h.show_download_button?"":" pswp__element--disabled",'" title="').concat(__.pswp_download,'" download>\n\t\t\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"></path></svg>\n\t\t\t\t\t\t</a>\n <button class="pswp__button pswp__button--share" title="').concat(__.pswp_share,'"></button>\n <button class="pswp__button pswp__button--fs" title="').concat(__.pswp_fs,'"></button>\n <button class="pswp__button pswp__button--zoom" title="').concat(__.pswp_zoom,'"></button>\n </div>\n <div class="pswp__preloader">\n <div class="pswp__preloader__icn">\n <div class="pswp__preloader__cut">\n <div class="pswp__preloader__donut"></div>\n </div>\n </div>\n </div>\n <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">\n <div class="pswp__share-tooltip"></div>\n </div>\n <button class="pswp__button pswp__button--arrow--left" title="').concat(__.pswp_prev,'"></button>\n <button class="pswp__button pswp__button--arrow--right" title="').concat(__.pswp_next,'"></button>\n <div class="pswp__caption">\n <div class="pswp__caption__center"></div>\n </div>\n </div>\n </div>\n </div>\n ');s()("body").append(b)}w.vendor="photoswipe",w.open=function(t,e,o){var n=[];t.forEach(function(t){"embed"===t.type?n.push({html:'<div class="vp-pswp-video"><div>'.concat(t.embed,"</div></div>"),vw:t.width||0,vh:t.height||0,title:t.caption}):n.push(function(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?a(Object(o),!0).forEach(function(e){l(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}({src:t.src,el:t.el,w:t.width||0,h:t.height||0,title:t.caption,o:{src:t.src,w:t.width||0,h:t.height||0}},t.srcMedium?{m:{src:t.srcMedium,w:t.srcMediumWidth||0,h:t.srcMediumHeight||0},msrc:t.srcMedium}:{}))});var r=s()(".vp-pswp"),p=r[0],c={captionAndToolbarShowEmptyCaptions:!1,closeEl:h.show_close_button,captionEl:!0,fullscreenEl:h.show_fullscreen_button,zoomEl:h.show_zoom_button,shareEl:h.show_share_button,counterEl:h.show_counter,arrowEl:h.show_arrows,shareButtons:[{id:"facebook",label:__.pswp_share_fb,url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"x",label:__.pswp_share_x,url:"https://x.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:__.pswp_share_pin,url:"https://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"}],getImageURLForShare:function(){var e=t[f.getCurrentIndex()];return"image"===e.type&&e.src?e.src:f.currItem.src||""},getPageURLForShare:function(){var e=t[f.getCurrentIndex()];return"image"===e.type&&e.src?e.src:window.location.href},getTextForShare:function(){var e=t[f.getCurrentIndex()];if(e.caption){var o=s()(e.caption);if(o.filter(".vp-portfolio__item-popup-title").length)return o.filter(".vp-portfolio__item-popup-title").text();if(o.filter(".vp-portfolio__item-popup-description").length)return o.filter(".vp-portfolio__item-popup-description").text()}return""},bgOpacity:1,tapToClose:!1,tapToToggleControls:!0,showHideOpacity:!0,history:!1,getThumbBoundsFn:function(t){if(!n[t]||!n[t].el)return!1;var e=s()(n[t].el).find("img")[0];if(!e)return!1;var o=e.getBoundingClientRect(),i=window.pageYOffset||document.documentElement.scrollTop,p=parseFloat(r.css("top"))||0;return{x:o.left,y:o.top+i-p,w:o.width,h:o.height}},getDoubleTapZoom:function(t,e){return t?h.click_to_zoom?e.w>window.innerWidth&&e.w*e.initialZoomLevel/window.innerWidth<.25?window.innerWidth/e.w:1:e.initialZoomLevel:e.initialZoomLevel<.7?1:1.5}};if(c.index=parseInt(e,10),i()(c.index)){var d;f=new v(p,_,n,c);var b,g=!1,y=!0;f.listen("beforeResize",function(){d=f.viewportSize.x*window.devicePixelRatio,g&&d<1e3?(g=!1,b=!0):!g&&d>=1e3&&(g=!0,b=!0),b&&!y&&f.invalidateCurrItems(),y&&(y=!1),b=!1}),f.listen("gettingData",function(t,e){e.html?e.html=e.html.replace(/autoplay=1/,"autoplay=0"):g&&e.o?(e.o.src&&(e.src=e.o.src),e.o.w&&(e.w=e.o.w),e.o.h&&(e.h=e.o.h)):e.m&&(e.m.src&&(e.src=e.m.src),e.m.w&&(e.w=e.m.w),e.m.h&&(e.h=e.m.h))}),f.listen("imageLoadComplete",function(t,e){if(e.h<1||e.w<1){var o=new u;o.onload=function(){e.w=o.width,e.h=o.height,f.invalidateCurrItems(),f.updateSize(!0)},o.src=e.src}}),f.listen("resize",function(){m(this)}),f.listen("afterChange",function(){var t,e,n=!!h.show_download_button&&this.template.querySelector(".pswp__button--download");n&&(this.currItem.html?n.classList.add("pswp__element--disabled"):(n.classList.remove("pswp__element--disabled"),n.setAttribute("href",(null===(t=this.currItem)||void 0===t||null===(t=t.o)||void 0===t?void 0:t.src)||(null===(e=this.currItem)||void 0===e||null===(e=e.m)||void 0===e?void 0:e.src)))),m(this),w.emitEvent("afterChangePhotoSwipe",[this,f],o)}),f.listen("beforeChange",function(){var t=this;if(t&&t.itemHolders.length){var e=t.getCurrentIndex();t.itemHolders.forEach(function(t){var o=!!t.el&&s()(t.el).find(".vp-pswp-video iframe");o&&o.length&&(t.index===e?o.attr("src",o.attr("src").replace(/autoplay=0/,"autoplay=1")):o.attr("src",o.attr("src").replace(/autoplay=1/,"autoplay=0")))})}w.emitEvent("beforeChangePhotoSwipe",[t,f],o)}),f.listen("destroy",function(){var e=this;if(e){e.itemHolders.length&&e.itemHolders.forEach(function(t){t.el&&s()(t.el).find(".vp-pswp-video").remove()});var n=t[e.getCurrentIndex()];n&&w.maybeFocusGalleryItem(n),w.emitEvent("beforeClosePhotoSwipe",[c,t,f],o)}f=!1}),w.emitEvent("beforeInitPhotoSwipe",[c,n,e,f],o),f.init(),w.emitEvent("initPhotoSwipe",[c,n,e,f],o)}},w.close=function(){f&&(f.close(),f=!1)}}})();
Save
Cancel