https://vmaproyectos.es/wp-content/plugins/visual-portfolio/assets/js/popup-gallery.min.js?ver=3.1.3
1!function(){function e(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function t(t){for(var i=1;i<arguments.length;i++){var l=null!=arguments[i]?arguments[i]:{};i%2?e(Object(l),!0).forEach((function(e){o(t,e,l[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(l)):e(Object(l)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(l,e))}))}return t}function o(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const i=window.jQuery,{VPData:l}=window,{settingsPopupGallery:n}=l,r="content"in document.createElement("template"),a={vendor:!1,vendors:[{vendor:"youtube",embedUrl:"https://www.youtube.com/embed/{{video_id}}?{{params}}",pattern:/(https?:\/\/)?(www.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(?:embed\/|shorts\/|v\/|watch\?v=|watch\?list=(.*)&v=|watch\?(.*[^&]&)v=)?((\w|-){11})(&list=(\w+)&?)?(.*)/,patternIndex:6,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramsIndex:10,embedCallback(e,o){let i=!1;const l=this,n=!(!o||!o[l.patternIndex])&&o[l.patternIndex];if(n){const r=/\/shorts\//.test(e),p=r?476:1920,c=r?847:1080;i=a.embedCallback(t(t({},l),{},{width:p,height:c}),n,e,o)}return i}},{vendor:"vimeo",embedUrl:"https://player.vimeo.com/video/{{video_id}}?{{params}}",pattern:/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(.*)/,patternIndex:3,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramsIndex:4}],init(){},open(){},close(){},getQueryStringParams:e=>e?(/^[?#]/.test(e)?e.slice(1):e).split("&").reduce(((e,t)=>{const[o,i]=t.split("=");return e[o]=i?decodeURIComponent(i.replace(/\+/g," ")):"",e}),{}):{},prepareParams(e,t){let o="";const i=t.params||{};if(t.paramsIndex&&e&&e[t.paramsIndex]){const o=a.getQueryStringParams(e[t.paramsIndex]);o&&"object"==typeof o&&Object.keys(o).forEach((e=>{e&&o[e]&&(i[e]=o[e])}))}
1return i&&Object.keys(i).length&&Object.keys(i).forEach((e=>{e&&i[e]&&(o&&(o+="&"),o+="".concat(e,"=").concat(i[e]))})),o},embedCallback(e,t,o){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],{embedUrl:l}=e;l=l.replace(/{{video_id}}/g,t),l=l.replace(/{{video_url}}/g,o),l=l.replace(/{{video_url_encoded}}/g,encodeURIComponent(o)),l=l.replace(/{{params}}/g,i?a.prepareParams(i,e):"");const n=e.width||1920,r=e.height||1080;return{vendor:e.vendor,id:t,embed:'<iframe width="'.concat(n,'" height="').concat(r,'" src="').concat(l,'" scrolling="no" frameborder="0" allowTransparency="true" allow="accelerometer; autoplay; clipboard-write; fullscreen; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'),embedUrl:l,url:o,width:n,height:r}},parseVideo(e,t){let o=!1;return a.vendors.forEach((i=>{if(!o){const l=e.match(i.pattern),n=!(!l||!l[i.patternIndex])&&l[i.patternIndex];n&&(o=i.embedCallback?i.embedCallback(e,l,t):a.embedCallback(i,n,e,l))}})),o||(o=a.embedCallback({vendor:"unknown",embedUrl:e},e,e,!1)),o},parseItem(e){let t=!1;const o=e&&e.querySelector(".vp-portfolio__item-popup");var i,l,n,a;return o&&(t={$dataElement:o,$content:o,data:o.dataset},r&&"TEMPLATE"===o.nodeName&&o.content&&(t.$content=o.content),t.$title=null===(i=t)||void 0===i||null===(l=i.$content)||void 0===l?void 0:l.querySelector(".vp-portfolio__item-popup-title"),t.$description=null===(n=t)||void 0===n||null===(a=n.$content)||void 0===a?void 0:a.querySelector(".vp-portfolio__item-popup-description")),t},parseGallery(e){const t=[];let o,i,l,n;return e.find(".vp-portfolio__item-wrap:not(.swiper-slide-duplicate)").each((function(){const e=a.parseItem(this);if(e){var r,p,c,s,d;if(o=((null==e||null===(r=e.data)||void 0===r?void 0:r.vpPopupImgSize)||"1920x1080").split("x"),l=null==e||null===(p=e.data)||void 0===p?void 0:p.vpPopupVideo,n=!1,l&&(n=a.parseVideo(l,null==e||null===(c=e.data)||void 0===c?void 0:c.vpPopupPoster)),n)i={type:"embed",el:this,poster:n.poster,src:n.embedUrl,embed:n.embed,width:n.width||1920,height:n.height||1080};else{var u,m,v,f;i={type:"image",el:this,src:null==e||null===(u=e.data)||void 0===u?void 0:u.vpPopupImg,srcset:null==e||null===(m=e.data)||void 0===m?void 0:m.vpPopupImgSrcset,width:parseInt(o[0],10),height:parseInt(o[1],10)};const t=(null==e||null===(v=e.data)||void 0===v?void 0:v.vpPopupSmImg)||i.src;if(t){var h,g;const o=((null==e||null===(h=e.data)||void 0===h?void 0:h.vpPopupSmImgSize)||(null==e||null===(g=e.data)||void 0===g?void 0:g.vpPopupImgSize)||"1920x1080").split("x");i.srcSmall=t,i.srcSmallWidth=parseInt(o[0],10),i.srcSmallHeight=parseInt(o[1],10)}const l=(null==e||null===(f=e.data)||void 0===f?void 0:f.vpPopupMdImg)||i.src;if(l){var b,y;const t=((null==e||null===(b=e.data)||void 0===b?void 0:b.vpPopupMdImgSize)||(null==e||null===(y=e.data)||void 0===y?void 0:y.vpPopupImgSize)||"1920x1080").split("x");i.srcMedium=l,i.srcMediumWidth=parseInt(t[0],10),i.srcMediumHeight=parseInt(t[1],10)}}(null!=e&&e.$title||null!=e&&e.$description)&&(i.caption=((null==e||null===(s=e.$title)||void 0===s?void 0:s.outerHTML)||"")+((null==e||null===(d=e.$description)||void 0===d?void 0:d.outerHTML)||"")),t.push(i)}})),t},maybeFocusGalleryItem(e){n.restore_focus&&(e.linkEl?i(e.linkEl).focus():e.el&&i(e.el).find(".vp-portfolio__item-img > a").focus())}};function p(e){return/(.png|.jpg|.jpeg|.gif|.tiff|.tif|.jfif|.jpe|.svg|.bmp|.webp)$/.test(e.href.toLowerCase().split("?")[0].split("#")[0])}function c(e){const t=i(e);let o=e.childNodes[0],l=t.next("figcaption");return"NOSCRIPT"===o.nodeName&&e.childNodes[1]&&(o=e.childNodes[1]),!l.length&&t.parent(".gallery-icon").length&&(l=t.parent(".gallery-icon").next("figcaption")),l=l.html(),l&&(l='<div class="vp-portfolio__item-popup-description">'.concat(l,"</div>")),{type:"image",el:o,linkEl:e,src:e.href,caption:l}}window.VPPopupAPI=a,i(document).on("extendClass.vpf",((e,t)=>{"vpf"===e.namespace&&(t.prototype.initPopupGallery=function(){const e=this;e.options.itemsClickAction&&"url"!==e.options.itemsClickAction&&(e.isPreview()||e.$item.on("click.vpf-uid-".concat(e.uid),"\n .vp-portfolio__item a.vp-portfolio__item-meta,\n .vp-portfolio__item .vp-portfolio__item-img > a,\n .vp-portfolio__item .vp-portfolio__item-meta-title > a,\n .vp-portfolio__item a.vp-portfolio__item-overlay\n ",(function(t){if(t.isDefaultPrevented())return;let o=i(this).closest(".vp-portfolio__item-wrap");if(o.hasClass("swiper-slide-duplicate")&&o.attr("data-swiper-slide-index")&&(o=e.$item.find('[data-swiper-slide-index="'.concat(o.attr("data-swiper-slide-index"),'"].swiper-slide:not(.swiper-slide-duplicate)'))),!o.find(".vp-portfolio__item-popup").length)return;const l=a.parseGallery(e.$item);let n=-1;l.forEach(((e,t)=>{e.el===o[0]&&(n=t)})),-1!==n&&(t.preventDefault(),a.open(l,n,e))})))},t.prototype.destroyPopupGallery=function(){const e=this;e.options.itemsClickAction&&"url"!==e.options.itemsClickAction&&(e.$item.off("click.vpf-uid-".concat(e.uid)),e.emitEvent("destroyPopupGallery"))})})),i(document).on("init.vpf",((e,t)=>
1{"vpf"===e.namespace&&t.initPopupGallery()})),i(document).on("destroy.vpf",((e,t)=>{"vpf"===e.namespace&&t.destroyPopupGallery()})),n.enable_on_wordpress_images&&i(document).on("click","\n .wp-block-image > a,\n .wp-block-image > figure > a,\n .wp-block-gallery .blocks-gallery-item > figure > a,\n .wp-block-gallery .wp-block-image > a,\n .wp-block-media-text > figure > a,\n .gallery .gallery-icon > a,\n figure.wp-caption > a,\n figure.tiled-gallery__item > a,\n p > a\n ",(function(e){if(e.isDefaultPrevented())return;if(!this.childNodes.length)return;let t=this.childNodes[0];if("NOSCRIPT"===t.nodeName&&this.childNodes[1]&&(t=this.childNodes[1]),"IMG"!==t.nodeName&&"PICTURE"!==t.nodeName)return;if(!p(this))return;e.preventDefault();const o=i(this),l=[],n=c(this),r=o.closest(".wp-block-gallery, .gallery, .tiled-gallery__gallery");let s=0;if(r.length){const e=r.find(".blocks-gallery-item > figure > a, .wp-block-image > a, .gallery-icon > a, figure.tiled-gallery__item > a");let t=0;e.each((function(){p(this)&&(this===n.linkEl&&(s=t),l.push(c(this)),t+=1)}))}else l.push(n);a.open(l,s)}))}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.