/** * Fresco - A Beautiful Responsive Lightbox - v2.3.0 * (c) 2012-2019 Nick Stakenburg * * https://www.frescojs.com * * @license: https://creativecommons.org/licenses/by/4.0 */ !function(i,e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):i.Fresco=e(jQuery)}(this,function($){var Fresco={};$.extend(Fresco,{version:"2.3.0"}),Fresco.Skins={fresco:{}};var Bounds={viewport:function(){var i={width:$(window).width()};if(Browser.MobileSafari||Browser.Android&&Browser.Gecko){var e=document.documentElement.clientWidth/window.innerWidth;i.height=window.innerHeight*e}else i.height=$(window).height();return i}},Browser=(e=navigator.userAgent,{IE:!(!window.attachEvent||-1!==e.indexOf("Opera"))&&f("MSIE "),Opera:-1i.width||h&&s.height>i.height);){var r=1,d=1;a&&s.width>i.width&&(r=i.width/s.width),h&&s.height>i.height&&(d=i.height/s.height),n=Math.min(r,d),s={width:e.width*n,height:e.height*n},o--}return s.width=Math.max(s.width,0),s.height=Math.max(s.height,0),s}};$.extend($.easing,{frescoEaseInCubic:function(i,e,t,s,n){return s*(e/=n)*e*e+t},frescoEaseInSine:function(i,e,t,s,n){return-s*Math.cos(e/n*(Math.PI/2))+s+t},frescoEaseOutSine:function(i,e,t,s,n){return s*Math.sin(e/n*(Math.PI/2))+t}});var Support=(O=document.createElement("div"),P="Webkit Moz O ms Khtml".split(" "),{canvas:(ba=document.createElement("canvas"),!(!ba.getContext||!ba.getContext("2d"))),css:{animation:S("animation"),transform:S("transform"),prefixed:function(i){return S(i,"prefix")}},svg:!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,touch:function(){try{return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}catch(i){return!1}}()}),ba,O,P;function S(i,e){var t=i.charAt(0).toUpperCase()+i.substr(1);return function(i,e){for(var t in i)if(void 0!==O.style[i[t]])return"prefix"!==e||i[t];return!1}((i+" "+P.join(t+" ")+t).split(" "),e)}Support.detectMobileTouch=function(){Support.mobileTouch=Support.touch&&(Browser.MobileSafari||Browser.Android||Browser.IEMobile||Browser.ChromeMobile||!/^(Win|Mac|Linux)/.test(navigator.platform))},Support.detectMobileTouch();var ImageReady=function(){return this.initialize.apply(this,Array.prototype.slice.call(arguments))};function Timers(){return this.initialize.apply(this,_slice.call(arguments))}function getURIData(s){var n={type:"image"};return $.each(Types,function(i,e){var t=e.data(s);t&&((n=t).type=i,n.url=s)}),n}function detectExtension(i){var e=(i||"").replace(/\?.*/g,"").match(/\.([^.]{3,4})$/);return e?e[1].toLowerCase():null}$.extend(ImageReady.prototype,{supports:{naturalWidth:"naturalWidth"in new Image},initialize:function(i,e,t){this.img=$(i)[0],this.successCallback=e,this.errorCallback=t,this.isLoaded=!1,this.options=$.extend({method:"naturalWidth",pollFallbackAfter:1e3},arguments[3]||{}),this.supports.naturalWidth&&"onload"!==this.options.method?this.img.complete&&"undefined"!==$.type(this.img.naturalWidth)?setTimeout($.proxy(function(){0=this.options.pollFallbackAfter&&!this._usedPollFallback&&(this._usedPollFallback=!0,this.fallback()),this._time>this.intervals[this._ipos][0]){if(!this.intervals[this._ipos+1])return void this.error();this._ipos++,this._delay=this.intervals[this._ipos][1]}this.poll()}},this),this._delay)},fallback:function(){var i=new Image;(this._fallbackImg=i).onload=$.proxy(function(){i.onload=function(){},this.supports.naturalWidth||(this.img.naturalWidth=i.width,this.img.naturalHeight=i.height),this.success()},this),i.onerror=$.proxy(this.error,this),i.src=this.img.src},abort:function(){this._fallbackImg&&(this._fallbackImg.onload=function(){}),this._polling&&(clearTimeout(this._polling),this._polling=null)},success:function(){this._calledSuccess||(this._calledSuccess=!0,this.isLoaded=!0,this.successCallback(this))},error:function(){this._calledError||(this._calledError=!0,this.abort(),this.errorCallback&&this.errorCallback(this))}}),$.extend(Timers.prototype,{initialize:function(){this._timers={}},set:function(i,e,t){this._timers[i]=setTimeout(e,t)},get:function(i){return this._timers[i]},clear:function(i){i?this._timers[i]&&(clearTimeout(this._timers[i]),delete this._timers[i]):this.clearAll()},clearAll:function(){$.each(this._timers,function(i,e){clearTimeout(e)}),this._timers={}}});var Type={isVideo:function(i){return/^(youtube|vimeo)$/.test(i)}},Types={image:{extensions:"bmp gif jpeg jpg png webp",detect:function(i){return-1<$.inArray(detectExtension(i),this.extensions.split(" "))},data:function(i){return!!this.detect()&&{extension:detectExtension(i)}}},vimeo:{detect:function(i){var e=/(vimeo\.com)\/([a-zA-Z0-9-_]+)(?:\S+)?$/i.exec(i);return!(!e||!e[2])&&e[2]},data:function(i){var e=this.detect(i);return!!e&&{id:e}}},youtube:{detect:function(i){var e=/(youtube\.com|youtu\.be)\/watch\?(?=.*vi?=([a-zA-Z0-9-_]+))(?:\S+)?$/.exec(i);return e&&e[2]?e[2]:!(!(e=/(youtube\.com|youtu\.be)\/(vi?\/|u\/|embed\/)?([a-zA-Z0-9-_]+)(?:\S+)?$/i.exec(i))||!e[3])&&e[3]},data:function(i){var e=this.detect(i);return!!e&&{id:e}}}},VimeoThumbnail=function(){function i(){return this.initialize.apply(this,_slice.call(arguments))}$.extend(i.prototype,{initialize:function(i,e,t){this.url=i,this.successCallback=e,this.errorCallback=t,this.load()},load:function(){var i=s.get(this.url);if(i)return this.successCallback(i.data.url);var e="http"+(window.location&&"https:"===window.location.protocol?"s":"")+":",t=getURIData(this.url).id;this._xhr=$.getJSON(e+"//vimeo.com/api/oembed.json?url="+e+"//vimeo.com/"+t+"&callback=?",$.proxy(function(i){if(i&&i.thumbnail_url){var e={url:i.thumbnail_url};s.set(this.url,e),this.successCallback(e.url)}else this.errorCallback()},this))},abort:function(){this._xhr&&(this._xhr.abort(),this._xhr=null)}});var s={cache:[],get:function(i){for(var e=null,t=0;t").addClass("fr-overlay").hide().append($("
").addClass("fr-overlay-background")),this.element.on("click",$.proxy(function(){var i=Pages.page;i&&i.view&&i.view.options.overlay&&!i.view.options.overlay.close||Window.hide()},this)),Support.mobileTouch&&this.element.addClass("fr-mobile-touch"),this.element.on("fresco:mousewheel",function(i){i.preventDefault()})},setSkin:function(i){this.skin&&this.element.removeClass("fr-overlay-skin-"+this.skin),this.element.addClass("fr-overlay-skin-"+i),this.skin=i},attach:function(){$(document.body).append(this.element)},detach:function(){this.element.detach()},show:function(i,e){if(this.visible)i&&i();else{this.visible=!0,this.attach(),this.max();var t=Pages.page&&Pages.page.view.options.effects.window.show||0,s=("number"===$.type(e)?e:t)||0;this.element.stop(!0).fadeTo(s,1,i)}},hide:function(i,e){if(this.visible){var t=Pages.page&&Pages.page.view.options.effects.window.hide||0,s=("number"===$.type(e)?e:t)||0;this.element.stop(!0).fadeOut(s||0,$.proxy(function(){this.detach(),this.visible=!1,i&&i()},this))}else i&&i()},getScrollDimensions:function(){var n={};return $.each(["width","height"],function(i,e){var t=e.substr(0,1).toUpperCase()+e.substr(1),s=document.documentElement;n[e]=(Browser.IE?Math.max(s["offset"+t],s["scroll"+t]):Browser.WebKit?document.body["scroll"+t]:s["scroll"+t])||0}),n},max:function(){var i;if(Browser.MobileSafari&&Browser.WebKit&&Browser.WebKit<533.18&&(i=this.getScrollDimensions(),this.element.css(i)),Browser.IE&&Browser.IE<9){var e=Bounds.viewport();this.element.css({height:e.height,width:e.width})}Support.mobileTouch&&!i&&this.element.css({height:this.getScrollDimensions().height})}},Window={initialize:function(){this.queues=[],this.queues.hide=$({}),this.pages=[],this._tracking=[],this._first=!0,this.timers=new Timers,this.build(),this.setSkin(Options.defaults.skin)},build:function(){if(this.element=$("
").addClass("fr-window fr-measured").hide().append(this._box=$("
").addClass("fr-box").append(this._pages=$("
").addClass("fr-pages"))).append(this._thumbnails=$("
").addClass("fr-thumbnails")),Overlay.initialize(),Pages.initialize(this._pages),Thumbnails.initialize(this._thumbnails),Spinner.initialize(),UI.initialize(),this.element.addClass("fr"+(Support.mobileTouch?"":"-no")+"-mobile-touch"),this.element.addClass("fr"+(Support.svg?"":"-no")+"-svg"),Browser.IE)for(var i=7;i<=9;i++)Browser.IE").addClass("fr-stroke fr-stroke-top fr-stroke-horizontal").append($("
").addClass("fr-stroke-color")).add($("
").addClass("fr-stroke fr-stroke-bottom fr-stroke-horizontal").append($("
").addClass("fr-stroke-color"))).add($("
").addClass("fr-stroke fr-stroke-left fr-stroke-vertical").append($("
").addClass("fr-stroke-color"))).add($("
").addClass("fr-stroke fr-stroke-right fr-stroke-vertical").append($("
").addClass("fr-stroke-color"))),$.extend(Oc.prototype,{initialize:function(i,e,t){this.view=i,this.dimensions={width:0,height:0},this.uid=Lc++,this._position=e,this._total=t,this._fullClick=!1,this._visible=!1,this.queues={},this.queues.showhide=$({})},create:function(){if(!this._created){Pages.element.append(this.element=$("
").addClass("fr-page").append(this.container=$("
").addClass("fr-container")).css({opacity:0}).hide());var i=this.view.options.position&&1").addClass("fr-info").append($("
").addClass("fr-info-background")).append(Nc.clone(!0)).append(this.infoPadder=$("
").addClass("fr-info-padder"))),i&&(this.element.addClass("fr-has-position"),this.infoPadder.append(this.pos=$("
").addClass("fr-position").append($("").addClass("fr-position-text").html(this._position+" / "+this._total)))),this.view.caption&&this.infoPadder.append(this.caption=$("
").addClass("fr-caption").html(this.view.caption))),this.container.append(this.background=$("
").addClass("fr-content-background")).append(this.content=$("
").addClass("fr-content")),"image"==this.view.type&&(this.content.append(this.image=$("").addClass("fr-content-element").attr({src:this.view.url})),this.content.append(Nc.clone(!0))),i&&"outside"==this.view.options.ui&&this.container.append(this.positionOutside=$("
").addClass("fr-position-outside").append($("
").addClass("fr-position-background")).append($("").addClass("fr-position-text").html(this._position+" / "+this._total))),"inside"==this.view.options.ui){this.content.append(this.previousInside=$("
").addClass("fr-side fr-side-previous fr-toggle-ui").append($("
").addClass("fr-side-button").append($("
").addClass("fr-side-button-background")).append($("
").addClass("fr-side-button-icon")))).append(this.nextInside=$("
").addClass("fr-side fr-side-next fr-toggle-ui").append($("
").addClass("fr-side-button").append($("
").addClass("fr-side-button-background")).append($("
").addClass("fr-side-button-icon")))).append(this.closeInside=$("
").addClass("fr-close fr-toggle-ui").append($("
").addClass("fr-close-background")).append($("
").addClass("fr-close-icon"))),(this.view.caption||i&&this.view.grouped.caption)&&(this.content.append(this.infoInside=$("
").addClass("fr-info fr-toggle-ui").append($("
").addClass("fr-info-background")).append(Nc.clone(!0)).append(this.infoPadderInside=$("
").addClass("fr-info-padder"))),i&&this.infoPadderInside.append(this.posInside=$("
").addClass("fr-position").append($("").addClass("fr-position-text").html(this._position+" / "+this._total))),this.view.caption&&this.infoPadderInside.append(this.captionInside=$("
").addClass("fr-caption").html(this.view.caption))),this.view.caption||!i||this.view.grouped.caption||this.content.append(this.positionInside=$("
").addClass("fr-position-inside fr-toggle-ui").append($("
").addClass("fr-position-background")).append($("").addClass("fr-position-text").html(this._position+" / "+this._total)));var e=this.view.options.loop&&1").addClass("fr-error fr-content-element").append($("
").addClass("fr-error-icon"))),this.element.addClass("fr-has-error"),this.setDimensions({width:this.error.outerWidth(),height:this.error.outerHeight()}),this.error.css({width:"100%",height:"100%"}),e&&e()},this),{method:this.view.options.loadedMethod});break;case"vimeo":this.vimeoReady=new VimeoReady(this.view.url,$.proxy(function(i){this._markAsLoaded(),this.setDimensions({width:i.dimensions.width,height:i.dimensions.height}),e&&e()},this));break;case"youtube":this._markAsLoaded(),this.setDimensions({width:this.view.options.width,height:this.view.options.height}),e&&e()}},setDimensions:function(i){if(this.dimensions=i,this.view.options.maxWidth||this.view.options.maxHeight){var e=this.view.options,t={width:e.maxWidth?e.maxWidth:this.dimensions.width,height:e.maxHeight?e.maxHeight:this.dimensions.height};this.dimensions=Fit.within(t,this.dimensions)}},_markAsLoaded:function(){this._abortSpinnerDelay(),this.loading=!1,this.loaded=!0,Mc[this.view.url]=!0,Spinner.hide(null,null,this._position)},isVideo:function(){return Type.isVideo(this.view.type)},insertVideo:function(i){if(!this.playerIframe&&this.isVideo()){var e="http"+(window.location&&"https:"===window.location.protocol?"s":"")+":",t=$.extend({},this.view.options[this.view.type]||{}),s=$.param(t),n={vimeo:e+"//player.vimeo.com/video/{id}?{queryString}",youtube:e+"//www.youtube.com/embed/{id}?{queryString}"}[this.view.type].replace("{id}",this.view._data.id).replace("{queryString}",s);this.content.prepend(this.playerIframe=$("