/* Elfsight (c) elfsight.com */ !function e(t,o,n){function i(r,s){if(!o[r]){if(!t[r]){var l="function"==typeof require&&require;if(!s&&l)return l(r,!0);if(a)return a(r,!0);throw new Error("Cannot find module '"+r+"'")}var p=o[r]={exports:{}};t[r][0].call(p.exports,function(e){var o=t[r][1][e];return i(o?o:e)},p,p.exports,e,t,o,n)}return o[r].exports}for(var a="function"==typeof require&&require,r=0;r0&&(e.enabled=!0,e.duration=parseInt(t,10),e.hoverPause=e.gallery.options.autoHoverPause,e.start(),e.watch())},start:function(){var e=this;e.enabled&&(e.pause=!1,e.rotate())},stop:function(){var e=this;e.enabled&&(clearInterval(e.timer),e.pause=!0)},rotate:function(){var e=this;e.timer=setTimeout(function(){e.enabled&&!e.pause&&e.gallery.hasNextView()&&e.gallery.moveToNextView().always(function(){e.rotate()})},e.duration)},watch:function(){var e=this;e.gallery.$root.on("mouseenter.instaShow",function(){e.hoverPause&&e.stop()}),e.gallery.$root.on("mouseleave.instaShow",function(){e.hoverPause&&e.start()})}}),t.exports=i},{"./jquery":20}],3:[function(e,t,o){"use strict";var n=e("./jquery"),i=e("./u"),a=e("./defaults"),r=e("./instapi"),s=e("./gallery"),l=e("./popup"),p=e("./views"),u=e("./lang"),c=function(e,t,o){var i=this;i.$element=e,i.$style=null,i.options=n.extend(!0,{},a,t),i.instapi=null,i.gallery=null,i.popup=null,i.lang=null,i.id=o,i.initialize()};n.extend(c,{VERSION:"2.0.5 June",TPL_OPTIONS_ALIASES:{tplError:"error",tplGalleryArrows:"gallery.arrows",tplGalleryCounter:"gallery.counter",tplGalleryCover:"gallery.cover",tplGalleryInfo:"gallery.info",tplGalleryLoader:"gallery.loader",tplGalleryMedia:"gallery.media",tplGalleryScroll:"gallery.scroll",tplGalleryView:"gallery.view",tplGalleryWrapper:"gallery.wrapper",tplPopupMedia:"popup.media",tplPopupRoot:"popup.root",tplPopupTwilight:"popup.twilight",tplStyle:"style"}}),c.prototype=function(){},n.extend(c.prototype,{initialize:function(){var e=this;e.instapi=new r(e,e.options,e.id);var t;if(t=e.instapi.isSandbox()?["@self"]:i.unifyMultipleOption(e.options.source),!t||!t.length)return void e.showError('Please set option "source". See details in docs.');var o={only:e.options.filterOnly?i.unifyMultipleOption(e.options.filterOnly):null,except:e.options.filterExcept?i.unifyMultipleOption(e.options.filterExcept):null};return e.mediaFetcher=e.instapi.createMediaFetcher(t,o,e.options.filter),e.mediaFetcher?(e.gallery=new s(e),e.popup=new l(e),e.lang=new u(e,e.options.lang),e.$style=n(p.style(n.extend({},e.options,{id:e.id}))),e.$style.insertBefore(e.$element),void(Handlebars&&Handlebars.compile&&n.each(c.TPL_OPTIONS_ALIASES,function(t,o){var a=e.options[t];if(a){var r=n('[data-is-tpl="'+a+'"]').html();r&&i.setProperty(p,o,Handlebars.compile(r))}}))):void e.showError('Option "source" is invalid. See details in docs.')},showError:function(e){var t=this;t.options.debug||n("#instaShowGallery_"+t.id).css("display","none");var o=n(p.error({message:e}));t.gallery?(t.gallery.puzzle(),o.appendTo(t.gallery.$root)):o.insertBefore(t.$element)}}),t.exports=c},{"./defaults":4,"./gallery":6,"./instapi":8,"./jquery":20,"./lang":21,"./popup":24,"./u":27,"./views":28}],4:[function(e,t,o){"use strict";t.exports={api:null,clientId:null,accessToken:null,debug:!1,source:null,filterOnly:null,filterExcept:null,filter:null,limit:0,width:"auto",height:"auto",columns:4,rows:2,gutter:0,responsive:null,loop:!0,arrowsControl:!0,scrollControl:!1,dragControl:!0,direction:"horizontal",freeMode:!1,scrollbar:!0,effect:"slide",speed:600,easing:"ease",auto:0,autoHoverPause:!0,popupSpeed:400,popupEasing:"ease",lang:"en",cacheMediaTime:0,mode:"popup",info:"likesCounter commentsCounter description",popupInfo:"username instagramLink likesCounter commentsCounter location passedTime description comments",popupDeepLinking:!1,popupHrImages:!1,colorGalleryBg:"rgba(0, 0, 0, 0)",colorGalleryCounters:"rgb(255, 255, 255)",colorGalleryDescription:"rgb(255, 255, 255)",colorGalleryOverlay:"rgba(33, 150, 243, 0.9)",colorGalleryArrows:"rgb(0, 142, 255)",colorGalleryArrowsHover:"rgb(37, 181, 255)",colorGalleryArrowsBg:"rgba(255, 255, 255, 0.9)",colorGalleryArrowsBgHover:"rgb(255, 255, 255)",colorGalleryScrollbar:"rgba(255, 255, 255, 0.5)",colorGalleryScrollbarSlider:"rgb(68, 68, 68)",colorPopupOverlay:"rgba(43, 43, 43, 0.9)",colorPopupBg:"rgb(255, 255, 255)",colorPopupUsername:"rgb(0, 142, 255)",colorPopupUsernameHover:"rgb(37, 181, 255)",colorPopupInstagramLink:"rgb(0, 142, 255)",colorPopupInstagramLinkHover:"rgb(37, 181, 255)",colorPopupCounters:"rgb(0, 0, 0)",colorPopupPassedTime:"rgb(152, 152, 152)",colorPopupAnchor:"rgb(0, 142, 255)",colorPopupAnchorHover:"rgb(37, 181, 255)",colorPopupText:"rgb(0, 0, 0)",colorPopupControls:"rgb(103, 103, 103)",colorPopupControlsHover:"rgb(255, 255, 255)",colorPopupMobileControls:"rgb(103, 103, 103)",colorPopupMobileControlsBg:"rgba(255, 255, 255, .8)",tplError:null,tplGalleryArrows:null,tplGalleryCounter:null,tplGalleryCover:null,tplGalleryInfo:null,tplGalleryLoader:null,tplGalleryMedia:null,tplGalleryScroll:null,tplGalleryView:null,tplGalleryWrapper:null,tplPopupMedia:null,tplPopupRoot:null,tplPopupTwilight:null,tplStyle:null}},{}],5:[function(e,t,o){"use strict";var n=e("./jquery"),i=(e("./instashow"),e("./core")),a=e("./api"),r=e("./defaults"),s=0,l=function(e,t){var o=new i(n(e),t,(++s));n.data(e,"instaShow",new a(o))};n.fn.instaShow=function(e){return this.each(function(t,o){var i=n.data(o,"instaShow");i||n.data(o,"instaShow",l(o,e))}),this},n.instaShow=function(e){n("[data-is]",e).each(function(e,t){var o=n(t),i={};n.each(r,function(e){var t="data-is-"+e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}),a=o.attr(t);"undefined"!==n.type(a)&&""!==a&&("true"===a?a=!0:"false"===a&&(a=!1),i[e]=a)}),o.instaShow(n.extend(!1,{},r,i))})},n(function(){var e=window.onInstaShowReady;e&&"function"===n.type(e)&&e(),n(window).trigger("instaShowReady"),n.instaShow(window.document.body)})},{"./api":1,"./core":3,"./defaults":4,"./instashow":19,"./jquery":20}],6:[function(e,t,o){"use strict";var n=e("./jquery"),i=e("./u"),a=e("./views"),r=e("./grid"),s=e("./translations"),l=e("./move-control"),p=e("./scrollbar"),u=e("./loader"),c=e("./auto-rotator"),d=n(window),h=function(e){var t=this;t.core=e,t.options=e.options,t.translations=s,t.mediaList=[],t.classes={},t.storage={},t.infoTypes=null,t.grid=null,t.scrollbar=null,t.loader=null,t.autoRotator=null,t.breakpoints=[],t.prevBreakpoint=null,t.defaultBreakpoing=null,t.currentBreakpoint=null,t.limit=null,t.$mediaList=n(),t.$viewsList=n(),t.$root=e.$element,t.$wrapper=null,t.$container=null,t.busy=!1,t.drag=!1,t.activeViewId=-1,t.translationPrevProgress=0,t.progress=0,t.isTranslating=!1,t.viewsCastled=!1,t.initialize()};h.prototype=function(){},n.extend(h,{INFO_TYPES:["description","commentsCounter","likesCounter"]}),n.extend(h.prototype,{constructor:h,initialize:function(){var e=this;e.limit=Math.abs(parseInt(e.options.limit,10)),e.$wrapper=n(a.gallery.wrapper()),e.$container=e.$wrapper.children().first(),e.$root.append(e.$wrapper),e.defaultBreakpoing={columns:e.options.columns,rows:e.options.rows,gutter:e.options.gutter},e.options.responsive&&("string"===n.type(e.options.responsive)&&(e.options.responsive=JSON.parse(decodeURIComponent(e.options.responsive))),n.isPlainObject(e.options.responsive)&&(n.each(e.options.responsive,function(t,o){t=parseInt(t,10),e.breakpoints.push(n.extend(!1,{},o,{minWidth:t}))}),e.breakpoints=e.breakpoints.sort(function(e,t){return e.minWidtht.minWidth?1:0}))),e.grid=new r(e.$root,{width:e.options.width,height:e.options.height,columns:e.options.columns,rows:e.options.rows,gutter:e.options.gutter}),e.updateBreakpoint(),e.$root.width(e.options.width).height(e.options.height),e.scrollbar=new p(e),e.options.arrowsControl&&(e.$root.append(a.gallery.arrows()),e.$arrowPrevious=e.$root.find(".instashow-gallery-control-arrow-previous"),e.$arrowNext=e.$root.find(".instashow-gallery-control-arrow-next")),e.$root.attr("id","instaShowGallery_"+e.core.id),e.loader=new u(e.$root,n(a.gallery.loader())),e.defineClasses(),e.watch(),e.fit(),e.addView().done(function(t){e.setActiveView(t),e.$root.trigger("initialized.instaShow",[e.$root])}),e.autoRotator=new c(e)},getMediaIdByNativeId:function(e){var t=this,o=-1;return n.each(t.mediaList,function(t,n){o===-1&&n.id===e&&(o=t)}),o},setProgress:function(e){var t=this;t.progress=e,t.$root.trigger("progressChanged.instaShow",[e])},getProgressByOffset:function(e){var t=this;return e/t.getGlobalThreshold()},puzzle:function(){var e=this;e.busy=!0},free:function(){var e=this;e.busy=!1},isBusy:function(){var e=this;return e.busy},isHorizontal:function(){var e=this;return e.options.direction&&"horizontal"===e.options.direction.toLowerCase()},isFreeMode:function(){var e=this;return!!e.options.freeMode&&"slide"===e.options.effect},hasView:function(e){var t=this;return e>=0&&e<=t.$viewsList.length-1},hasNextView:function(){var e=this;return e.hasView(e.activeViewId+1)||(!e.limit||e.mediaList.length14&&(t=14),e.$wrapper.width(e.grid.width).height(e.grid.height),e.$viewsList.css({width:e.grid.viewWidth,height:e.grid.viewHeight,margin:e.grid.viewMoatVertical+"px "+e.grid.viewMoatHorizontal+"px",padding:e.grid.gutter/2}),e.$mediaList.css({width:e.grid.cellSize,height:e.grid.cellSize,padding:e.grid.gutter/2,fontSize:t}),"slide"===e.options.effect&&(e.isHorizontal()?e.$container.width(e.$viewsList.length*e.grid.width):e.$container.height(e.$viewsList.length*e.grid.height)),e.fitDescription(e.activeViewId),e.updateClasses()},rebuildViews:function(e){var t=this;t.$container.empty(),t.$viewsList=n();for(var o=t.grid.countCells(),i=Math.ceil(t.$mediaList.length/o),r=0;rp&&(o.css({maxHeight:p}),o.parent().addClass("instashow-gallery-media-info-cropped"))})}}},fitImages:function(e){var t=this;e=e||t.$viewsList;var o=e.find("img");o.each(function(e,o){var i=n(o),a=i.closest(".instashow-gallery-media"),r=a.attr("data-is-media-id"),s=t.storage["instaShow#"+t.core.id+"_media#"+r];i.attr("src",t.grid.cellSize>210?s.images.standard_resolution.url:s.images.low_resolution.url),i.one("load",function(){a.addClass("instashow-gallery-media-loaded")})})},addView:function(e){var t=this;return e=e||n.Deferred(),t.core.mediaFetcher.hasNext()?(t.puzzle(),t.loader.show(400),t.core.mediaFetcher.fetch(t.grid.countCells()).done(function(o){if(t.free(),t.loader.hide(),!o||!o.length)return void e.reject();var i=n(a.gallery.view());n.each(o,function(e,o){if(!t.limit||t.mediaList.length!==t.limit){var r=n(a.gallery.media(o)),s=r.children().first();t.setMediaInfo(s,o)&&t.setMediaCover(s),r.attr("data-is-media-id",o.id),t.storage["instaShow#"+t.core.id+"_media#"+o.id]=o,r.addClass("instashow-gallery-media-"+o.getImageOrientation()),"video"===o.type&&r.addClass("instashow-gallery-media-video"),t.mediaList.push(o),t.$mediaList=t.$mediaList.add(r.appendTo(i))}}),t.$viewsList=t.$viewsList.add(i.appendTo(t.$container));var r=t.$viewsList.length-1;t.$root.trigger("viewAdded.instaShow",[r,i]),setTimeout(function(){e.resolve(r,i)})})):e.reject(),e.promise()},setMediaCover:function(e){var t=n(a.gallery.cover({type:"plain"}));t.prependTo(e)},setMediaInfo:function(e,t){var o=this,i=o.getInfoTypes();if(!i||!i.length)return!1;var r,s={options:{},info:{likesCount:t.getLikesCount(),commentsCount:t.getCommentsCount(),description:t.caption?t.caption.text:null}};if(n.each(i,function(e,t){s.options[t]=!0}),s.options.hasDescription=s.options.description&&t.caption,i.length>1||s.options.description){if(1===i.length&&!s.options.hasDescription)return!1;r=n("
"),r.html(a.gallery.info(s)),r=r.unwrap()}else{switch(i[0]){case"likesCounter":s.icon="like",s.value=s.info.likesCount;break;case"commentsCounter":s.icon="comment",s.value=s.info.commentsCount}r=n(a.gallery.counter(s))}return r.prependTo(e),!0},getViewStartProgress:function(e){var t=this,o=t.$viewsList.index(e);return~o?0===o?0:1/(t.$viewsList.length-1)*o:-1},getViewIdByProgress:function(e){var t=this,o=t.$viewsList.length-1;return e<=0?0:e>=1?o:Math.round(o*e)},getActiveView:function(){var e=this;return e.$viewsList.eq(e.activeViewId)},getGlobalThreshold:function(){var e=this;return(e.$viewsList.length-1)*e.getThreshold()},getThreshold:function(){var e=this;return e.isHorizontal()?e.grid.width:e.grid.height},translate:function(e,t,o,i){var a=this;t=!!t,o=o||1,i=i||n.Deferred();var r=a.options.effect?a.options.effect.toLowerCase():"sharp",s=a.translations[r]||a.translations.sharp;return s?(a.isTranslating=!0,s.call(a,e,t,o,i),i.done(function(){a.isTranslating=!1,a.$root.trigger("translationEnded.instaShow")}),i.promise()):void a.core.showError('Translating effect "'+r+'" is undefined.')},getAdjustedProgress:function(e,t){var o=this;if(0===t)return 0;var n,i;return"slide"===o.options.effect?(n=t*e*o.getThreshold(),i=n/o.getGlobalThreshold()):i=t*e/(o.$viewsList.length-1),i},moveToNextView:function(){var e=this,t=n.Deferred(),o=e.activeViewId+1;return e.isBusy()?t.reject():!e.hasView(o)&&e.hasNextView(o)?e.addView().done(function(){e.moveToView(o,t)}).fail(function(){t.reject()}):e.moveToView(o,t),t.always(function(){e.updateArrows()}),t.promise()},moveToPreviousView:function(){var e=this;return e.moveToView(e.activeViewId-1)},moveToView:function(e,t){var o,i=this,t=t||n.Deferred();return i.isBusy()||!i.hasView(e)?t.reject():(o=i.getViewStartProgress(i.$viewsList.eq(e)),i.puzzle(),i.translate(o,!0).done(function(){i.free(),t.resolve()}),i.setProgress(o),i.setActiveView(e)),t.promise()},watchScroll:function(){var e,t=this;t.$root.on("wheel",function(o){if(o=o.originalEvent||o,o.preventDefault(),o.stopPropagation(),!e&&!t.isBusy()){var n,i,a,r=o.wheelDelta/40||-(Math.abs(o.deltaX)>Math.abs(o.deltaY)?o.deltaX:o.deltaY),s=r>0?-1:1;if(1===s&&!t.hasView(t.activeViewId+1)&&t.hasNextView())return void t.addView().done(function(){t.isFreeMode()||t.moveToNextView()});if(t.isFreeMode())n=-r*t.getThreshold()*.02,i=t.progress+n/t.getGlobalThreshold(),t.setActiveView(t.getViewIdByProgress(i)),i=t.progress+n/t.getGlobalThreshold(),i>1?i=1:i<0&&(i=0),t.translate(i),t.setProgress(i);else{if(Math.abs(r)<.75)return;if(e=!0,a=1===s?t.activeViewId+1:t.activeViewId-1,!t.hasView(a))return void(e=!1);t.moveToView(a).done(function(){e=!1})}}})},castleViews:function(){var e=this;e.viewsCastled||(e.viewsCastled=!0,e.$root.on("translationEnded.instaShow.castleViews",function(){if(1===e.progress){e.$root.off("translationEnded.instaShow.castleViews");var t=e.$viewsList.last().clone(),o=e.$viewsList.first().clone();n().add(t).add(o).addClass("instashow-gallery-view-diplicate"),e.$viewsList=n().add(t.prependTo(e.$container)).add(e.$viewsList).add(o.appendTo(e.$container));var i=e.getViewStartProgress(e.$viewsList.eq(e.activeViewId+1));e.setActiveView(e.activeViewId+1),e.setProgress(i),e.translate(i,!1),e.fitImages(t),e.fitImages(o),e.fit(),e.$root.on("translationEnded.instaShow.castleViews",function(){var t,o;if(0===e.progress)t=e.$viewsList.length-2;else{if(1!==e.progress)return;t=1}o=e.getViewStartProgress(e.$viewsList.eq(t)),e.setActiveView(t),e.setProgress(o),"fade"===e.core.options.effect&&e.$viewsList.css("opacity",0),e.translate(o,!1)})}}))},updateArrows:function(){var e=this;e.options.arrowsControl&&(e.$arrowNext.toggleClass("instashow-gallery-control-arrow-disabled",!e.viewsCastled&&!e.hasNextView()),e.$arrowPrevious.toggleClass("instashow-gallery-control-arrow-disabled",!e.viewsCastled&&!e.hasPreviousView()))},watch:function(){var e=this;e.$root.on("initialized.instaShow",function(){e.fit()}).on("activeViewChanged.instaShow",function(t,o){!e.core.options.loop||e.isFreeMode()||e.viewsCastled||!(e.limit&&e.mediaList.length>=e.limit)&&e.core.mediaFetcher.hasNext()||e.castleViews(),e.updateArrows()}).on("viewAdded.instaShow",function(t,o,n){1!==e.$viewsList.length&&e.$viewsList.length-1===o&&e.$viewsList.eq(o).addClass("instashow-gallery-view-active-next"),e.viewsRebuilded&&e.rebuildViews(),e.translationPrevProgress=e.getAdjustedProgress(o-1,e.translationPrevProgress);var i=e.getAdjustedProgress(o-1,e.progress);"slide"!==e.options.effect&&0!=o||e.translate(i,!1),e.setProgress(i),e.fit(),e.fitImages(n),e.fitDescription(o)}),d.resize(function(){e.fit(),e.fitImages(),e.translate(e.progress,!1)}),e.options.scrollControl&&e.watchScroll(),l(e).watch(),e.options.arrowsControl&&(e.$arrowPrevious.on("click touchend",function(){e.drag||e.moveToPreviousView()}),e.$arrowNext.on("click touchend",function(){e.drag||e.moveToNextView()})),"popup"===e.options.mode&&e.$root.on("click",".instashow-gallery-media",function(t){if(!e.drag){t.preventDefault(),t.stopPropagation();var o=n(this).attr("data-is-media-id"),i=e.storage["instaShow#"+e.core.id+"_media#"+o];e.core.popup.open(i)}})}}),t.exports=h},{"./auto-rotator":2,"./grid":7,"./jquery":20,"./loader":22,"./move-control":23,"./scrollbar":25,"./translations":26,"./u":27,"./views":28}],7:[function(e,t,o){"use strict";var n=e("./jquery"),i=function(e,t){var o=this;o.$element=e,o.options=t,o.width=null,o.height=null,o.columns=Math.floor(o.options.columns)||0,o.rows=Math.floor(o.options.rows)||0,o.gutter=Math.floor(o.options.gutter)||0,o.ratio=null,o.viewWidth=null,o.viewRatio=null,o.cellSize=null,o.viewMoatHorizontal=null,o.viewMoatVertical=null,o.initialize()};i.prototype=function(){},n.extend(i.prototype,{initialize:function(){var e=this;e.autoHeight=!e.options.height||"auto"===e.options.height},calculate:function(){var e=this;e.width=e.$element.width(),e.viewRatio=e.columns/e.rows,e.autoHeight?(e.height=e.width/e.viewRatio,e.ratio=e.viewRatio):(e.height=e.$element.height(),e.ratio=e.width/e.height),e.ratio>1?e.viewRatio<=1||e.viewRatio=1||e.viewRatio>e.ratio?(e.viewWidth=e.width,e.viewHeight=Math.floor(e.viewWidth/e.viewRatio)):(e.viewHeight=e.height,e.viewWidth=Math.floor(e.viewHeight*e.viewRatio)),e.autoHeight?(e.cellSize=(e.viewWidth-e.gutter)/e.columns,e.height=e.viewHeight=e.cellSize*e.rows+e.gutter,e.viewWidth=e.cellSize*e.columns+e.gutter):(e.viewRatio>1?e.cellSize=(e.viewHeight-e.gutter)/e.rows:e.cellSize=(e.viewWidth-e.gutter)/e.columns,e.viewWidth=e.cellSize*e.columns+e.gutter,e.viewHeight=e.cellSize*e.rows+e.gutter),e.viewMoatHorizontal=(e.width-e.viewWidth)/2,e.viewMoatVertical=(e.height-e.viewHeight)/2},countCells:function(){var e=this;return e.columns*e.rows}}),t.exports=i},{"./jquery":20}],8:[function(e,t,o){"use strict";var n=e("./jquery"),i=e("./instapi/client"),a=e("./instapi/cache-provider"),r=e("./instapi/user-media-fetcher"),s=e("./instapi/tag-media-fetcher"),l=e("./instapi/complex-media-fetcher"),p=e("./instapi/specific-media-fetcher"),u=function(e,t,o){var n=this;n.core=e,n.options=t,n.id=o,n.client=null,n.cacheProvider=null,n.initialize()};n.extend(u,{SOURCE_DETERMINANTS:[{type:"user",regex:/^@([^$]+)$/,index:1},{type:"tag",regex:/^#([^$]+)$/,index:1},{type:"specific_media_id",regex:/^\$(\d+_\d+)$/,index:1},{type:"specific_media_shortcode",regex:/^\$([^$]+)$/i,index:1},{type:"user",regex:/^https?\:\/\/(www\.)?instagram.com\/([^\/]+)\/?(\?[^\$]+)?$/,index:2},{type:"tag",regex:/^https?\:\/\/(www\.)?instagram.com\/explore\/tags\/([^\/]+)\/?(\?[^\$]+)?$/,index:2},{type:"specific_media_shortcode",regex:/^https?\:\/\/(www\.)?instagram.com\/p\/([^\/]+)\/?(\?[^\$]+)?$/,index:2}],createScheme:function(e){var t=[];return"array"===n.type(e)&&e.length?(n.each(e,function(e,o){if("string"===n.type(o)){var i,a;n.each(u.SOURCE_DETERMINANTS,function(e,t){if(!i){var n=o.match(t.regex);n&&n[t.index]&&(i=t.type,a=n[t.index])}}),i&&("specific_media_shortcode"!==i&&(a=a.toLowerCase()),t.push({type:i,name:a}))}}),t):t},parseAnchors:function(e){return e=e.replace(/(https?\:\/\/[^$\s]+)/g,function(e){return''+e+""}),e=e.replace(/(@|#)([^\s#@]+)/g,function(e,t,o){var n="";switch(t){case"@":n="https://instagram.com/"+o+"/";break;case"#":n="https://instagram.com/explore/tags/"+o+"/";break;default:return e}return''+e+""})}}),u.prototype=function(){},n.extend(u.prototype,{initialize:function(){var e=this;e.cacheProvider=new a(e.id),e.client=new i(e,e.options,e.cacheProvider)},isSandbox:function(){var e=this;return!e.client.isAlternativeApi()&&e.options.accessToken&&!e.options.source},createMediaFetcher:function(e,t,o){var i=this;if("array"===n.type(e)&&e.length){"string"===n.type(o)&&"function"===n.type(window[o])&&(o=window[o]);var a=u.createScheme(e);if(a&&a.length){var c=[];t&&n.isPlainObject(t)&&n.each(t,function(e,t){if(t&&t.length){var o=u.createScheme(t);n.each(o,function(t,o){o.logic=e}),Array.prototype.push.apply(c,o)}});var d=[];return n.each(a,function(e,t){var n;switch(t.type){default:break;case"tag":n=new s(i.client,t.name,c,o);break;case"user":n=new r(i.client,t.name,c,o);break;case"specific_media_id":case"specific_media_shortcode":n=new p(i.client,t.type,t.name,c,o)}d.push(n)}),d.length>1?new l(d):d[0]}}}}),t.exports=u},{"./instapi/cache-provider":9,"./instapi/client":10,"./instapi/complex-media-fetcher":11,"./instapi/specific-media-fetcher":15,"./instapi/tag-media-fetcher":16,"./instapi/user-media-fetcher":17,"./jquery":20}],9:[function(e,t,o){"use strict";var n=e("../jquery"),i=function(e){var t=this;t.id=e,t.supports=!!window.localStorage};i.prototype=function(){},n.extend(i.prototype,{set:function(e,t,o){var n=this;if(!n.supports)return!1;try{return localStorage.setItem(e,JSON.stringify({cacheTime:t,expired:Date.now()/1e3+t,value:o})),!0}catch(i){return localStorage.clear(),!1}},get:function(e,t){var o=this;if(!o.supports)return!1;var n=localStorage.getItem(e);return n=n?JSON.parse(n):null,n&&t===n.cacheTime&&n.expired>Date.now()/1e3?n.value:(localStorage.removeItem(e),null)},has:function(e,t){var o=this;return!!o.get(e,t)}}),t.exports=i},{"../jquery":20}],10:[function(e,t,o){"use strict";var n=e("../jquery"),i=e("../u"),a=function(e,t,o){var n=this;n.instapi=e,n.options=t,n.cacheProvider=o,n.authorized=!1,n.clientId=t.clientId,n.accessToken=t.accessToken,n.displayErrors=!0,n.lastErrorMessage=null,n.initialize()};n.extend(a,{API_URI:"https://api.instagram.com/v1"}),a.prototype=function(){},n.extend(a.prototype,{initialize:function(){var e=this;e.accessToken?e.authorized=!0:!e.clientId},getApiUrl:function(){var e=this;return e.options.api?e.options.api.replace(/\/+$/,"")+"/":a.API_URI},isAlternativeApi:function(){var e=this;return e.getApiUrl()!=a.API_URI},send:function(e,t,o,a){var r=this;t=t||{},o=o||{},a="undefined"===n.type(a)?0:parseInt(a,10)||0;var s=n.Deferred(),l=i.parseQuery(e);t=n.extend(!1,{},l,t),e=e.replace(r.getApiUrl(),"").replace(/\?.+$/,""),r.isAlternativeApi()||(r.accessToken&&(t.access_token=r.accessToken),r.clientId&&(t.client_id=r.clientId)),t.callback&&(t.callback=null);var p;return r.isAlternativeApi()?(t.path="/v1"+e.replace("/v1",""),p=r.getApiUrl()+"?"+n.param(t)):p=r.getApiUrl()+e+"?"+n.param(t),o=n.extend(!1,{},o,{url:p,dataType:"jsonp",type:o.type||"get"}),"get"===o.type&&a&&r.cacheProvider.has(p,a)?s.resolve(r.cacheProvider.get(p,a)):n.ajax(o).done(function(e){200!==e.meta.code?(r.lastErrorMessage=e.meta.error_message,r.displayErrors&&r.instapi.core.showError(e.meta.error_message),s.reject()):(r.cacheProvider.set(p,a,e),s.resolve(e))}),s.promise()},get:function(e,t,o,i){var a=this;return o=n.extend(!1,o,{type:"get"}),a.send(e,t,o,i)},setDisplayErrors:function(e){var t=this;t.displayErrors=!!e}}),t.exports=a},{"../jquery":20,"../u":27}],11:[function(e,t,o){"use strict";var n=e("../jquery"),i=function(e){var t=this;t.fetchers=e};i.prototype=function(){},n.extend(i.prototype,{fetch:function(e,t){var o=this;t=t||n.Deferred();var i,a=0,r=[],s=o.fetchers.length,l=function(){var o=[],a=[];n.each(r,function(e,t){Array.prototype.push.apply(o,t)}),n.each(o,function(e,t){var o=a.some(function(e){return e.id===t.id});o||a.push(t)}),a.sort(function(e,t){return t.created_time-e.created_time}),i=a.slice(0,e),n.each(a.slice(e).reverse(),function(e,t){t.fetcher.refund(t)}),t.resolve(i)},p=o.fetchers[0].client;return p.setDisplayErrors(!1),n.each(o.fetchers,function(t,n){var i=n.fetch(e);i.always(function(e){if("resolved"===i.state())r.push(e);else{if(s<2)return;o.fetchers=o.fetchers.filter(function(e,o){return t!==o})}++a==s&&(p.setDisplayErrors(!0),o.fetchers.length?l():p.instapi.core.showError(p.lastErrorMessage))})}),t.promise()},hasNext:function(){var e=this;return e.fetchers.some(function(e){return e.hasNext()})}}),t.exports=i},{"../jquery":20}],12:[function(e,t,o){"use strict";var n=e("../jquery"),i=e("./media"),a=function(e,t,o,n){var i=this;i.client=e,i.sourceName=t,i.filters=o,i.postFilter=n,i.stack=[],i.hasNextMedia=!0,i.nextPaginationUri=null,i.basePath=null,i.initialize()};a.prototype=function(){},n.extend(a.prototype,{initialize:function(){},fetch:function(e,t){var o=this;t=t||n.Deferred();var i;return!o.hasNextMedia||e<=o.stack.length?(i=o.stack.slice(0,e),o.stack=o.stack.slice(e),t.resolve(o.processData(i))):o.load().done(function(i){var a=i.data;"array"!==n.type(a)&&(a=[a]),Array.prototype.push.apply(o.stack,a),o.fetch(e,t)}).fail(function(n){n===-1?t.reject():o.fetch(e,t)}),t.promise()},load:function(){var e,t,o=this,i=n.Deferred();return o.hasNextMedia?(t={count:33},e=o.nextPaginationUri?o.nextPaginationUri:o.basePath,o.client.get(e,t,null,o.client.instapi.core.options.cacheMediaTime).done(function(e){e.pagination&&e.pagination.next_url?(o.nextPaginationUri=e.pagination.next_url,o.hasNextMedia=!0):(o.nextPaginationUri=null,o.hasNextMedia=!1),e.data=o.filterData(e.data),i.resolve(e)}).fail(function(){i.reject(-1)})):i.reject(),i.promise()},processData:function(e){var t=this,o=[];return n.each(e,function(e,n){o.push(i.create(t.client,n,t))}),o},filterData:function(e){var t=this;return n.isArray(e)||(e=[e]),e.filter(function(e){var o=!0;return n.each(t.filters,function(t,n){if(o)switch(e.tags||(e.tags=[]),n.logic){case"only":"user"===n.type?o=e.user.username===n.name:"tag"===n.type?o=!!~e.tags.map(function(e){return e.toLowerCase?e.toLowerCase():e}).indexOf(n.name):"specific_media_shortcode"===n.type?o=!!~e.link.indexOf(n.name):"specific_media_id"===n.type&&(o=e.id===n.name);break;case"except":"user"===n.type?o=e.user.username!==n.name:"tag"===n.type?o=!~e.tags.map(function(e){return e.toLowerCase?e.toLowerCase():e}).indexOf(n.name):"specific_media_shortcode"===n.type?o=!~e.link.indexOf(n.name):"specific_media_id"===n.type&&(o=e.id!==n.name)}}),o&&"function"===n.type(t.postFilter)&&(o=!!t.postFilter(e)),o})},refund:function(e){var t=this;Array.prototype.unshift.call(t.stack,e.original)},hasNext:function(){var e=this;return e.stack.length||e.hasNextMedia}}),t.exports=a},{"../jquery":20,"./media":13}],13:[function(e,t,o){"use strict";var n=e("../jquery"),i=e("./model"),a=e("../u"),r=function(e,t){var o=this;i.call(o,e,t)};n.extend(r,i,{findById:function(e,t,o){return o=o||n.Deferred(),e.get("/media/"+t).done(function(t){var n=r.create(e,t.data);o.resolve(n)}),o.promise()},findByCode:function(e,t,o){return o=o||n.Deferred(),e.get("/media/shortcode/"+t+"/").done(function(t){var n=r.create(e,t.data);o.resolve(n)}),o.promise()}}),n.extend(r.prototype,i.prototype,{constructor:r,getLikesCount:function(){var e=this;return a.formatNumber(e.likes.count)},getCommentsCount:function(){var e=this;return a.formatNumber(e.comments.count)},getImageOrientation:function(){var e=this,t=e.getImageRatio();return t>1?"album":t<1?"portrait":"square"},getImageRatio:function(){var e=this,t=e.images.standard_resolution.width,o=e.images.standard_resolution.height;return t/o}}),t.exports=r},{"../jquery":20,"../u":27,"./model":14}],14:[function(e,t,o){"use strict";var n=e("../jquery"),i=function(e,t){var o=this;o.fetcher=t,o.client=e};n.extend(i,{create:function(e,t,o){var n=new this(e,o);return n.fill(t),n}}),i.prototype=function(){},n.extend(i.prototype,{fill:function(e){var t=this;t.original=e,n.extend(t,e)}}),t.exports=i},{"../jquery":20}],15:[function(e,t,o){"use strict";var n=e("../jquery"),i=e("./media-fetcher"),a=function(e,t,o,n,a){var r=this;r.idType=t,i.call(r,e,o,n,a)};n.extend(a,i),a.prototype=function(){},n.extend(a.prototype,i.prototype,{initialize:function(){var e=this;"specific_media_shortcode"===e.idType?e.basePath="/media/shortcode/"+e.sourceName+"/":"specific_media_id"===e.idType&&(e.basePath="/media/"+e.sourceName+"/")}}),t.exports=a},{"../jquery":20,"./media-fetcher":12}],16:[function(e,t,o){"use strict";var n=e("../jquery"),i=e("./media-fetcher"),a=function(e,t,o,n){var a=this;i.call(a,e,t,o,n)};n.extend(a,i),a.prototype=function(){},n.extend(a.prototype,i.prototype,{initialize:function(){var e=this;e.basePath="/tags/"+e.sourceName+"/media/recent/"; }}),t.exports=a},{"../jquery":20,"./media-fetcher":12}],17:[function(e,t,o){"use strict";var n=e("../jquery"),i=e("./media-fetcher"),a=e("./user"),r=function(e,t,o,n){var a=this;i.call(a,e,t,o,n),a.userId=null};n.extend(r,i),r.prototype=function(){},n.extend(r.prototype,i.prototype,{initialize:function(){},fetch:function(e,t){var o=this;t=t||n.Deferred();var r=n.Deferred();return o.userId?r.resolve():a.findId(o.client,o.sourceName).done(function(e){o.userId=e,o.basePath="/users/"+e+"/media/recent/",r.resolve()}).fail(function(){o.client.instapi.core.showError("Sorry, user @"+o.sourceName+" can`t be found.")}),r.done(function(){i.prototype.fetch.call(o,e,t)}),t.promise()}}),t.exports=r},{"../jquery":20,"./media-fetcher":12,"./user":18}],18:[function(e,t,o){"use strict";var n=e("../jquery"),i=e("./model"),a=function(e){var t=this;i.call(t,e)};n.extend(a,i,{constructor:a,findId:function(e,t){var o=n.Deferred();return e.isAlternativeApi()||e.instapi.isSandbox()?o.resolve(t):e.get("/users/search/",{q:t},null,604800).done(function(e){var i;n.each(e.data,function(e,o){i||o.username===t&&(i=o.id)}),i?o.resolve(i):o.reject()}),o.promise()}}),n.extend(a.prototype,i.prototype,{constructor:a}),t.exports=a},{"../jquery":20,"./model":14}],19:[function(e,t,o){"use strict";var n=e("./jquery"),i=function(){};i.prototype=function(){},n.extend(i.prototype,{}),t.exports=i},{"./jquery":20}],20:[function(e,t,o){"use strict";t.exports=window.jQuery},{}],21:[function(e,t,o){"use strict";var n=e("./jquery"),i={en:{},de:{"View in Instagram":"Folgen",w:"Wo.",d:"Tag",h:"Std.",m:"min",s:"Sek"},es:{"View in Instagram":"Seguir",w:"sem",d:"día",h:"h",m:"min",s:"s"},fr:{"View in Instagram":"S`abonner",w:"sem",d:"j",h:"h",m:"min",s:"s"},it:{"View in Instagram":"Segui",w:"sett.",d:"g",h:"h",m:"m",s:"s"},nl:{"View in Instagram":"Volgen",w:"w.",d:"d.",h:"u.",m:"m.",s:"s."},no:{"View in Instagram":"F©ªlg",w:"u",d:"d",h:"t",m:"m",s:"s"},pl:{"View in Instagram":"Obserwuj",w:"w",d:"dzień",h:"godz.",m:"min",s:"s"},"pt-BR":{"View in Instagram":"Seguir",w:"sem",d:"d",h:"h",m:"min",s:"s"},sv:{"View in Instagram":"F?lj",w:"v",d:"d",h:"h",m:"min",s:"sek"},tr:{"View in Instagram":"Takip et",w:"h",d:"g",h:"s",m:"d",s:"sn"},ru:{"View in Instagram":"¬±¬à¬ã¬Þ¬à¬ä¬â¬Ö¬ä¬î ¬Ó Instagram",w:"¬ß¬Ö¬Õ.",d:"¬Õ¬ß.",h:"¬é",m:"¬Þ¬Ú¬ß",s:"¬ã"},hi:{"View in Instagram":"फ़ॉलो करें",w:"सप्ताह",d:"दिन",h:"घंटे",m:"मिनट",s:"सेकंड"},ko:{"View in Instagram":"Æȷοì",w:"ÁÖ",d:"ÀÏ",h:"½Ã°£",m:"ºÐ",s:"ÃÊ"},"zh-HK":{"View in Instagram":"ô¸ñ¼",w:"ñ²",d:"ô¸",h:"á³时",m:"ÝÂ钟",s:"õ©"},ja:{"View in Instagram":"«Õ«©«íーª¹ªë",w:"ñÎÊàîñ",d:"ìíîñ",h:"ãÁÊàîñ",m:"ÝÂîñ",s:"õ©îñ"}},a=function(e,t){var o=this;o.core=e,o.id=t,o.currentLib=null,o.initialize()};a.prototype=function(){},n.extend(a.prototype,{initialize:function(){var e=this;if(e.currentLib=i[e.id],!e.currentLib)return void e.core.showError('Sorry, language "'+e.id+'" is undefined. See details in docs.')},t:function(e){var t=this;return t.currentLib[e]||e}}),t.exports=a},{"./jquery":20}],22:[function(e,t,o){"use strict";var n=e("./jquery"),i=function(e,t){var o=this;o.$root=e,o.$element=t,o.timer=null,o.initialize()};i.prototype=function(){},n.extend(i.prototype,{initialize:function(){var e=this;e.$element.prependTo(e.$root)},show:function(e){var t=this;t.timer=setTimeout(function(){t.toggle(!0)},e)},hide:function(){var e=this;e.timer&&(clearTimeout(e.timer),e.timer=null),e.toggle(!1)},toggle:function(e){var t=this;t.$element.toggleClass("instashow-show",e)}}),t.exports=i},{"./jquery":20}],23:[function(e,t,o){"use strict";var n=e("./jquery"),i=n(window);t.exports=function(e){var t=!1,o=0,n=0,a=!1,r=function(e){return/^touch/.test(e.type)},s=function(i){var a=r(i);a||(i.preventDefault(),i.stopPropagation()),e.isBusy()||(t=!0,n=e.progress,o=a?e.isHorizontal()?i.originalEvent.touches[0].clientX:i.originalEvent.touches[0].clientY:e.isHorizontal()?i.originalEvent.clientX:i.originalEvent.clientY)},l=function(i){if(!t||e.isBusy())return void(t=!1);i.preventDefault(),i.stopPropagation(),p=r(i)?e.isHorizontal()?i.originalEvent.changedTouches[0].clientX:i.originalEvent.changedTouches[0].clientY:e.isHorizontal()?i.originalEvent.clientX:i.originalEvent.clientY;var s,l,p,u=e.hasView(e.activeViewId+1),c=e.hasView(e.activeViewId-1);!u&&!a&&p1&&!u||s<0&&!c?.2:1;e.setProgress(s),e.translate(s,!1,h)},p=function(o){if(t=!1,e.drag){a=!1,setTimeout(function(){e.drag=!1},0);var n,i,r=e.progress>1|0;if(e.puzzle(),e.progress<0||r)i=e.translate(r,!0),e.setProgress(r);else{if(e.isFreeMode())return void e.free();n=e.getViewStartProgress(e.getActiveView()),i=e.translate(n,!0),e.setProgress(n)}i.done(function(){e.free()})}};return{watch:function(){e.$root.on("viewAdded.instaShow",function(t,o){n=e.getAdjustedProgress(o-1,n)}),e.options.dragControl&&(e.$root.on("mousedown",s),i.on("mousemove",l),i.on("mouseup",p),e.$root.on("click",function(t){e.drag&&(t.preventDefault(),t.stopPropagation())})),(e.options.scrollControl||e.options.dragControl)&&(e.$root.on("touchstart",s),i.on("touchmove",l),i.on("touchend",p))}}}},{"./jquery":20}],24:[function(e,t,o){"use strict";var n=e("./jquery"),i=e("./views"),a=e("./u"),r=e("./instapi"),s=e("./instapi/media"),l=e("./instapi/specific-media-fetcher"),p=n(window),u=function(e){var t=this;t.core=e,t.options=t.core.options,t.showing=!1,t.$body=null,t.$root=null,t.$twilight=null,t.$wrapper=null,t.$container=null,t.$controlClose=null,t.$controlPrevious=null,t.$controlNext=null,t.$media=null,t.video=null,t.currentMedia=null,t.optionInfo=null,t.optionControl=null,t.initialize(),t.watch()};n.extend(u,{AVAILABLE_INFO:["username","instagramLink","passedTime","likesCounter","commentsCounter","description","comments","location"]}),u.prototype=function(){},n.extend(u.prototype,{initialize:function(){var e=this;e.optionInfo=a.unifyMultipleOption(e.options.popupInfo),e.moveDuration=parseInt(e.options.popupSpeed,10),e.easing=e.options.popupEasing,e.optionInfo&&(e.optionInfo=e.optionInfo.filter(function(e){return!!~u.AVAILABLE_INFO.indexOf(e)})),e.$body=n("body"),e.$root=n(i.popup.root()),e.$wrapper=e.$root.find(".instashow-popup-wrapper"),e.$container=e.$root.find(".instashow-popup-container"),e.$twilight=n(i.popup.twilight()),e.$controlClose=e.$container.find(".instashow-popup-control-close"),e.$controlNext=e.$container.find(".instashow-popup-control-arrow-next"),e.$controlPrevious=e.$container.find(".instashow-popup-control-arrow-previous"),e.$root.attr("id","instaShowPopup_"+e.core.id),e.$twilight.prependTo(e.$root),e.$root.appendTo(document.body)},open:function(e){var t=this;return!t.showing&&!t.busy&&(t.$body.css("overflow","hidden"),t.busy=!0,t.findMediaId(e).done(function(e){t.currentMedia=e,t.busy=!1,t.$root.trigger("popupMediaOpened.instaShow")}),t.$root.css("display",""),t.showMedia(e),t.showing=!0,t.core.options.popupDeepLinking&&(window.location.hash="#!is"+t.core.id+"/$"+e.code),void setTimeout(function(){t.$root.addClass("instashow-show")}))},close:function(){var e=this;e.showing=!1,e.$root.removeClass("instashow-show"),setTimeout(function(){e.$root.css("display","none")},500),e.$body.css("overflow",""),e.video&&e.video.pause(),e.core.options.popupDeepLinking&&(window.location.hash="!")},createMedia:function(e){var t=this;t.core.options.popupHrImages&&(e.images.standard_resolution.url=e.images.standard_resolution.url.replace("s640x640","s1080x1080"));var o=e.getCommentsCount(),s={media:e,options:{},info:{viewOnInstagram:t.core.lang.t("View in Instagram"),likesCount:e.getLikesCount(),commentsCount:o,description:e.caption?a.nl2br(r.parseAnchors(e.caption.text)):null,location:e.location?e.location.name:null,passedTime:a.pretifyDate(e.created_time,t.core.lang)}};t.optionInfo&&n.each(t.optionInfo,function(e,o){t.core.instapi.isSandbox()&&"comments"===o||(s.options[o]=!0)}),s.options.hasDescription=s.options.description&&e.caption,s.options.hasLocation=s.options.location&&e.location,s.options.hasComments=s.options.comments&&e.comments.data,s.options.hasProperties=s.options.hasLocation||s.options.likesCounter||s.options.commentsCounter,s.options.isVideo="video"===e.type,s.options.hasOrigin=s.options.username||s.options.instagramLink,s.options.hasMeta=s.options.hasProperties||s.options.passedTime,s.options.hasContent=s.options.hasDescription||s.options.hasComments,s.options.hasInfo=s.options.hasOrigin||s.options.hasMeta||s.options.hasContent;var p=n.extend(!0,[],e.comments.data||[]);p.map(function(e){return e.text=a.nl2br(r.parseAnchors(e.text)),e}),p&&(s.info.comments=i.popup.mediaComments({list:p}));var u=n(i.popup.media(s));s.options.isVideo&&(t.video=u.find("video").get(0),u.find(".instashow-popup-media-video").click(function(){u.toggleClass("instashow-playing",t.video.paused),t.video.paused?t.video.play():t.video.pause()})),u.addClass("instashow-popup-media-"+e.getImageOrientation());var c=new Image;c.src=e.images.standard_resolution.url,c.onload=function(){u.find(".instashow-popup-media-picture").addClass("instashow-popup-media-picture-loaded"),u.css("transition-duration","0s").toggleClass("instashow-popup-media-hr",c.width>=1080),u.width(),u.css("transition-duration",""),t.adjust()};var d,h;return t.core.instapi.client.isAlternativeApi()&&!p.length&&o&&u.hasClass("instashow-popup-media-has-comments")&&(d=u.find(".instashow-popup-media-info-content"),d.length||(d=n('
'),d.appendTo(u.find(".instashow-popup-media-info"))),h=new l(t.core.instapi.client,"specific_media_shortcode",e.code,[]),t.core.instapi.client.setDisplayErrors(!1),h.fetch().done(function(o){var s=o[0];e.comments.data=s.comments.data;var l=n.extend(!0,[],e.comments.data||[]);l.map(function(e){return e.text=a.nl2br(r.parseAnchors(e.text)),e});var p=n(i.popup.mediaComments({list:l}));d.append(p),t.core.instapi.client.setDisplayErrors(!0)})),u},showMedia:function(e){var t=this;t.preloadImage(e.images.standard_resolution.url).done(function(){var o=t.createMedia(e);t.$media?t.$media.replaceWith(o):o.appendTo(t.$container),t.$media=o,t.adjust()})},moveToMedia:function(e,t,o){var i=this;o=o||n.Deferred(),e=parseInt(e,10)||0;var r,s,l=t?0:i.moveDuration||0,p=e>i.currentMedia,u=i.$media,c=i.getMedia(e);return i.isBusy()||!c?o.reject():(i.busy=!0,i.core.options.popupDeepLinking&&(window.location.hash="#!is"+i.core.id+"/$"+c.code),i.preloadImage(c.images.standard_resolution.url).done(function(){r=i.createMedia(c),s=n().add(u).add(r),r.toggleClass("instashow-popup-media-hr",u.hasClass("instashow-popup-media-hr")),s.css({transitionDuration:l+"ms",transitionTimingFunction:i.easing}),r.addClass("instashow-popup-media-appearing"),p?r.addClass("instashow-popup-media-next").appendTo(i.$container):r.addClass("instashow-popup-media-previous").prependTo(i.$container),s.width(),r.removeClass("instashow-popup-media-next instashow-popup-media-previous"),p?u.addClass("instashow-popup-media-previous"):u.addClass("instashow-popup-media-next"),i.$media=r,setTimeout(function(){u.detach(),s.removeClass("instashow-popup-media-appearing instashow-popup-media-next instashow-popup-media-previous").css({transitionDuration:"",transitionTimingFunction:""}),o.resolve()},l+(a.isMobileDevice()?300:0))})),o.done(function(){i.busy=!1,i.currentMedia=e,i.$root.trigger("popupMediaChanged.instaShow")}),o.promise()},preloadImage:function(e,t){t=t||n.Deferred();var o=new Image;return o.src=e,o.onload=function(){t.resolve()},t.promise()},followHash:function(){var e=this,t=window.location.hash,o=t.match(new RegExp("#!is"+e.core.id+"/\\$(.+)$"));if(!e.isBusy()&&o&&o[1]){var n=o[1];s.findByCode(e.core.instapi.client,n).done(function(t){e.open(t)})}},hasMedia:function(e){var t=this;return!!t.getMedia(e)},hasNextMedia:function(){var e=this;return e.hasMedia(e.currentMedia+1)||(!e.core.gallery.limit||e.core.gallery.mediaList.length=e.core.gallery.limit||!e.core.mediaFetcher.hasNext())},moveToNextMedia:function(){var e=this,t=n.Deferred(),o=e.currentMedia+1;return e.getMedia(o)?e.moveToMedia(o,!1,t):(!e.core.gallery.limit||e.core.gallery.mediaList.lengtht?e.moveToPreviousMedia():i1&&(t=1);var n=e.gallery.isHorizontal()?e.$element.width():e.$element.height(),i=n/o,a=(n-i)*t;if(i&&isFinite(i)){var r;r=e.gallery.isHorizontal()?{transform:"translate3d("+a+"px, 0, 0)",width:i}:{transform:"translate3d(0, "+a+"px, 0)",height:i},e.$slider.css(r)}},watch:function(){var e=this;e.gallery.$root.on("progressChanged.instaShow",function(){e.fit()})}}),t.exports=a},{"./jquery":20,"./views":28}],26:[function(e,t,o){"use strict";var n,i=e("./jquery");t.exports={slide:function(e,t,o,i){var a=this;o=o||1;var r=0,s="";t?(r=a.options.speed,s=a.options.easing,n=setTimeout(function(){a.$container.css({transitionDuration:"",transitionTimingFunction:""}),i.resolve()},r)):i.resolve(),a.$container.css({transitionDuration:r+"ms",transitionTimingFunction:s});var l,p,u=a.getGlobalThreshold();p=e<=1?-e*o*u:-u+(1-e)*o*u,l=a.isHorizontal()?"translate3d("+p+"px, 0, 0)":"translate3d(0, "+p+"px, 0)",a.$container.css("transform",l),a.translationPrevProgress=e},fade:function(e,t,o,a){var r=this;o=o||1,o*=.5;var s=0,l="";t?(s=r.options.speed,l=r.options.easing,n=setTimeout(function(){g.css({transitionDuration:"",transitionTimingFunction:""}),a.resolve()},s)):a.resolve();var p,u,c,d,h=r.getViewIdByProgress(e),f=r.$viewsList.eq(h),m=r.getViewStartProgress(f);e==m?(u=0,d=0,p=e>r.translationPrevProgress?r.$viewsList.eq(h-1):em?(u=1,p=r.$viewsList.eq(h+1),c=m+r.getThreshold()/r.getGlobalThreshold()/2):(u=-1,p=r.$viewsList.eq(h-1),c=m-r.getThreshold()/r.getGlobalThreshold()/2),d=(e-m)/(c-m)*o);var g=i().add(f).add(p);g.css({transitionDuration:s?s+"ms":"",transitionTimingFunction:l}),g.width(),f.css("opacity",1-d),p.css("opacity",d),r.translationPrevProgress=e}}},{"./jquery":20}],27:[function(e,t,o){"use strict";var n=e("./jquery");t.exports={MOBILE_DEVICE_REGEX:/android|webos|iphone|ipad|ipod|blackberry|windows\sphone/i,unifyMultipleOption:function(e){var t=n.type(e);return"array"===t?e:"string"===t?e.split(/[\s,;\|]+/).filter(function(e){return!!e}):[]},parseQuery:function(e){var t=e.match(/\?([^#]+)/);if(!t||!t[1])return null;var o={},n=function(e){var t=e.split("=");o[t[0]]=t[1]||""};return t[1].split("&").map(n),o},formatNumber:function(e,t){if(e=parseFloat(e),t=t||0,"number"!==n.type(e))return NaN;var o,i,a;return e>=1e6?(o=(e/1e6).toFixed(t),a="m"):e>=1e3?(o=(e/1e3).toFixed(t),a="k"):(o=e,a=""),i=parseInt(o,10),o-i===0&&(o=i),o+a},pretifyDate:function(e,t){var o,n,i=Math.round((new Date).getTime()/1e3),a=Math.abs(i-e);return a>=604800?(o=a/604800,n=t.t("w")):a>=86400?(o=a/86400,n=t.t("d")):a>=3600?(o=a/3600,n=t.t("h")):a>=60?(o=a/60,n=t.t("m")):(o=a,n=t.t("s")),o=Math.round(o),o+" "+n},isTouchDevice:function(){return"ontouchstart"in document.documentElement},isMobileDevice:function(){return this.MOBILE_DEVICE_REGEX.test(navigator.userAgent)},nl2br:function(e){return e.replace(/\n+/,"
")},getProperty:function(e,t,o){var i=this;if(e&&t&&"string"===n.type(t)){var a=e;return n.each(t.split("."),function(e,t){if(a=a[t],!a)return!1}),a&&o&&(a=i.applyModifier(a,o)),a}},setProperty:function(e,t,o){if(e&&t&&"string"===n.type(t)){var i=e,a=t.split(".");return n.each(a,function(e,t){e==a.length-1?i[t]=o:"undefined"===n.type(i[t])&&(i[t]={}),i=i[t]}),e}},applyModifier:function(e,t){return"array"!==n.type(t)&&(t=[t]),n.each(t,function(t,o){"function"===n.type(o)&&(e=o.call(o,e))}),e}}},{"./jquery":20}],28:[function(e,t,o){"use strict";var n={};n.error=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){var i,a;return'
Unfortunately, an error occurred
'+(null!=(a=null!=(a=t.message||(null!=e?e.message:e))?a:t.helperMissing,i="function"==typeof a?a.call(e,{name:"message",hash:{},data:n}):a)?i:"")+"
"},useData:!0}),n.gallery=n.gallery||{},n.gallery.arrows=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){return''},useData:!0}),n.gallery.counter=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){var i,a=t.helperMissing,r="function",s=this.escapeExpression;return' '+s((i=null!=(i=t.value||(null!=e?e.value:e))?i:a,typeof i===r?i.call(e,{name:"value",hash:{},data:n}):i))+""},useData:!0}),n.gallery.cover=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){return''},useData:!0}),n.gallery.info=Handlebars.template({1:function(e,t,o,n){return" instashow-gallery-media-info-no-description"},3:function(e,t,o,n){var i;return' '+this.escapeExpression(this.lambda(null!=(i=null!=e?e.info:e)?i.likesCount:i,e))+" "},5:function(e,t,o,n){var i;return' '+this.escapeExpression(this.lambda(null!=(i=null!=e?e.info:e)?i.commentsCount:i,e))+" "},7:function(e,t,o,n){var i;return' '+this.escapeExpression(this.lambda(null!=(i=null!=e?e.info:e)?i.description:i,e))+" "},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){var i;return' '+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.likesCounter:i,{name:"if",hash:{},fn:this.program(3,n,0),inverse:this.noop,data:n}))?i:"")+" "+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.commentsCounter:i,{name:"if",hash:{},fn:this.program(5,n,0),inverse:this.noop,data:n}))?i:"")+" "+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.hasDescription:i,{name:"if",hash:{},fn:this.program(7,n,0),inverse:this.noop,data:n}))?i:"")+""},useData:!0}),n.gallery.loader=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){return''},useData:!0}),n.gallery.media=Handlebars.template({1:function(e,t,o,n){var i;return this.escapeExpression(this.lambda(null!=(i=null!=e?e.caption:e)?i.text:i,e))},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){var i,a;return''},useData:!0}),n.gallery.scroll=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){return''},useData:!0}),n.gallery.view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){return''},useData:!0}),n.gallery.wrapper=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){return''},useData:!0}),n.popup=n.popup||{},n.popup.media=Handlebars.template({1:function(e,t,o,n){return" instashow-popup-media-has-comments"},3:function(e,t,o,n){return" instashow-popup-media-video"},5:function(e,t,o,n){var i;return' '},7:function(e,t,o,n){var i,a=this.lambda,r=this.escapeExpression;return''},9:function(e,t,o,n){var i;return'
'+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.hasOrigin:i,{name:"if",hash:{},fn:this.program(10,n,0),inverse:this.noop,data:n}))?i:"")+" "+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.hasMeta:i,{name:"if",hash:{},fn:this.program(15,n,0),inverse:this.noop,data:n}))?i:"")+" "+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.hasContent:i,{name:"if",hash:{},fn:this.program(25,n,0),inverse:this.noop,data:n}))?i:"")+"
"},10:function(e,t,o,n){var i;return'
'+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.username:i,{name:"if",hash:{},fn:this.program(11,n,0),inverse:this.noop,data:n}))?i:"")+" "+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.instagramLink:i,{name:"if",hash:{},fn:this.program(13,n,0),inverse:this.noop,data:n}))?i:"")+"
"},11:function(e,t,o,n){var i,a=this.lambda,r=this.escapeExpression;return' '+r(a(null!=(i=null!=(i=null!=e?e.media:e)?i.user:i)?i.username:i,e))+" "},13:function(e,t,o,n){var i,a=this.lambda,r=this.escapeExpression;return' '+r(a(null!=(i=null!=e?e.info:e)?i.viewOnInstagram:i,e))+" "},15:function(e,t,o,n){var i;return'
'+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.hasProperties:i,{name:"if",hash:{},fn:this.program(16,n,0),inverse:this.noop,data:n}))?i:"")+" "+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.passedTime:i,{name:"if",hash:{},fn:this.program(23,n,0),inverse:this.noop,data:n}))?i:"")+"
"},16:function(e,t,o,n){var i;return'
'+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.likesCounter:i,{name:"if",hash:{},fn:this.program(17,n,0),inverse:this.noop,data:n}))?i:"")+" "+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.commentsCounter:i,{name:"if",hash:{},fn:this.program(19,n,0),inverse:this.noop,data:n}))?i:"")+" "+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.hasLocation:i,{name:"if",hash:{},fn:this.program(21,n,0),inverse:this.noop,data:n}))?i:"")+"
"},17:function(e,t,o,n){var i;return' '+this.escapeExpression(this.lambda(null!=(i=null!=e?e.info:e)?i.likesCount:i,e))+" "},19:function(e,t,o,n){var i;return' '+this.escapeExpression(this.lambda(null!=(i=null!=e?e.info:e)?i.commentsCount:i,e))+" "},21:function(e,t,o,n){var i;return' '+this.escapeExpression(this.lambda(null!=(i=null!=e?e.info:e)?i.location:i,e))+" "},23:function(e,t,o,n){var i;return'
'+this.escapeExpression(this.lambda(null!=(i=null!=e?e.info:e)?i.passedTime:i,e))+"
"},25:function(e,t,o,n){var i;return'
'+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.hasDescription:i,{name:"if",hash:{},fn:this.program(26,n,0),inverse:this.noop,data:n}))?i:"")+" "+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.hasComments:i,{name:"if",hash:{},fn:this.program(28,n,0),inverse:this.noop,data:n}))?i:"")+"
"},26:function(e,t,o,n){var i,a=this.lambda,r=this.escapeExpression;return'
'+r(a(null!=(i=null!=(i=null!=e?e.media:e)?i.user:i)?i.username:i,e))+" "+(null!=(i=a(null!=(i=null!=e?e.info:e)?i.description:i,e))?i:"")+"
"},28:function(e,t,o,n){var i;return" "+(null!=(i=this.lambda(null!=(i=null!=e?e.info:e)?i.comments:i,e))?i:"")+" "},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){var i;return'
'+(null!=(i=t.unless.call(e,null!=(i=null!=e?e.options:e)?i.isVideo:i,{name:"unless",hash:{},fn:this.program(5,n,0),inverse:this.noop,data:n}))?i:"")+" "+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.isVideo:i,{name:"if",hash:{},fn:this.program(7,n,0),inverse:this.noop,data:n}))?i:"")+"
"+(null!=(i=t["if"].call(e,null!=(i=null!=e?e.options:e)?i.hasInfo:i,{name:"if",hash:{},fn:this.program(9,n,0),inverse:this.noop,data:n}))?i:"")+"
"},useData:!0}),n.popup.mediaComments=Handlebars.template({1:function(e,t,o,n){var i,a,r=this.lambda,s=this.escapeExpression;return'
'+s(r(null!=(i=null!=e?e.from:e)?i.username:i,e))+" "+(null!=(a=null!=(a=t.text||(null!=e?e.text:e))?a:t.helperMissing,i="function"==typeof a?a.call(e,{name:"text",hash:{},data:n}):a)?i:"")+"
"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){var i;return'
'+(null!=(i=t.each.call(e,null!=e?e.list:e,{name:"each",hash:{},fn:this.program(1,n,0),inverse:this.noop,data:n}))?i:"")+"
"},useData:!0}),n.popup.root=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){return'
'},useData:!0}),n.popup.twilight=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){return'
'},useData:!0}),n.style=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,o,n){var i,a=t.helperMissing,r="function",s=this.escapeExpression;return'"},useData:!0}),t.exports=n},{}]},{},[5]);