var instafeedApp=(function instafeedLoad(){const appDomain="instafeed.nfcube.com",appCdn="cdn.nfcube.com",cssVer="7.4.1",debugMode=!1;var Instafeed=function(){function a(a){var b,c;for(b in this.options={target:"insta-feed",forceUpdate:!1,picturesLoaded:0,picturesNeeded:0,sliderPage:1,admin:window.location.hostname===appDomain},a)c=a[b],this.options[b]=c}return a.prototype.run=function(){var a=document.getElementById(this.options.target);if(0===a.clientWidth&&0Connect your Instagram account to see your feed`,this.options.error.call(this,"No connection"),!1;const b=this.options.admin?"
Hang on we are processing your feed \u2615":"";a.innerHTML=`loading bar${b}`;const c=this;return fetch(this._buildUrl()).then(a=>{if(!a.ok)throw new Error(`HTTP error: ${a.status} ${a.statusText}`);return a.json()}).then(a=>{c.parse(a)}).catch(a=>{console.log("Error:",a.message)}),!0},a.prototype.parse=function(a){var b,c,d,e,f,g,h,j,k,l,m;if(m=document.getElementById(this.options.target),"object"!=typeof a)throw new Error("Invalid JSON response");if(m.innerHTML="",204===parseInt(a.meta.code))return this.options.admin&&(m.innerHTML=a.meta.error_message),console.log("Error from API: "+a.meta.error_message),!1;if(200!==a.meta.code)return this.options.admin&&(m.innerHTML=" \u26A0\uFE0F Your Instagram account is not properly connected: "+a.meta.error_message+"

Reconnect your Instagram account and confirm you provide permissions",this.options.error.call(this,"No connection")),!1;if(null!==this.options.success&&"function"==typeof this.options.success&&this.options.success.call(this,a),"undefined"==typeof document||null===document)return!1;k=a.data,c="",d="",j="";var n=parseInt(100-this.options.space),o=0,p=0;o=0{{likes}}",r=" {{likes}} ");var s,t="
"+q+"
",u="
{{containerContent}}"+t+"
",v="",w="";for(1===parseInt(this.options.openIg)?u=""+u+"":3===parseInt(this.options.openIg)&&(this.options.admin&&(w="
"),u=""+u+"",v="
"),e=0,l=k.length;e{B?(z=""+a.title+"
Delete
",A="product image"):(z=""+a.title+"",A="product image"),x+="
"+A+"
"+z+"
"})}var E="";"video"===f.type&&f.hasOwnProperty("videos")?(E="instafeed-video",imageFullHtml=""):imageFullHtml="Instagram post with the caption: "+escapeHtml(this._getObjectProperty(f,"caption.text").substring(0,64))+"...",s="video"===f.type&&1===parseInt(this.options.autoplay)?"":"Instagram post with the caption: "+escapeHtml(this._getObjectProperty(f,"caption.text").substring(0,64))+"...";var F=1===this.options.picturesLoaded?this.options.picturesNeeded:this.options.picturesLoaded-1,G=this.options.picturesLoaded===this.options.picturesNeeded?1:this.options.picturesLoaded+1;if(h=this._makeTemplate(u,{model:f,id:this.options.picturesLoaded,fullId:f.id,minusId:F,plusId:G,link:f.link,image:g.url,video:E,username:f.user.username,fullName:f.user.full_name,userPicture:5===this.options.apiVersion?f.user.profile_picture:"https://instafeed.nfcube.com/assets/img/logo-instagram-transparent.png",imageFullHtml:imageFullHtml,taggedProduct:x,containerContent:s,date:timeConverter(f.created_time),caption:escapeHtml(this._getObjectProperty(f,"caption.text")),likes:shortenLargeNumber(f.likes.count,1),comments:shortenLargeNumber(f.comments.count,1),location:this._getObjectProperty(f,"location.name")}),j=this._makeTemplate(v,{model:f,id:this.options.picturesLoaded,fullId:f.id,minusId:F,plusId:G,link:f.link,image:g.url,video:E,username:f.user.username,fullName:f.user.full_name,userPicture:5===this.options.apiVersion?f.user.profile_picture:"https://instafeed.nfcube.com/assets/img/logo-instagram-transparent.png",imageFullHtml:imageFullHtml,taggedProduct:x,date:timeConverter(f.created_time),caption:escapeHtml(this._getObjectProperty(f,"caption.text")),likes:shortenLargeNumber(f.likes.count,1),comments:shortenLargeNumber(f.comments.count,1),location:this._getObjectProperty(f,"location.name")}),1===parseInt(this.options.layout)||3===parseInt(this.options.layout)){var H=0;H=0"),h=a+""+h+""}if(c+=h,d+=j,this.options.picturesLoaded>=this.options.picturesNeeded||a.data.length===this.options.picturesLoaded){(1===parseInt(this.options.layout)||3===parseInt(this.options.layout))&&a.data.length>H&&(c+="",c+="",c+=""),c+=d;break}}const J=document.createElement("div");J.innerHTML=c;const K=document.createDocumentFragment();Array.from(J.childNodes).forEach(a=>K.appendChild(a)),m.innerHTML="";var L="";if(validateCharge(this.options.charge)&&5===this.options.apiVersion&&0"+shortenLargeNumber(y)+" followers"),0a?2:768>a?3:1024>a?4:1200>=a?5:6}function escapeHtml(a){return a&&(a=a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")),a}function shortenLargeNumber(a,b){for(var c,d=["k","M","G","T","P","E","Z","Y"],e=d.length-1;0<=e;e--)if(c=Math.pow(1e3,e+1),a<=-c||a>=c)return+(a/c).toFixed(b)+d[e];return a}function timeConverter(b){var c=new Date(1e3*b),a=c.toLocaleDateString(navigator.language,{month:"long",day:"numeric"});return a}function isMobileDevice(){return window.matchMedia("only screen and (max-width: 760px)").matches}function checkClientWidth(a,b){0===b.clientWidth?setTimeout(function(){checkClientWidth(a,b)},100):a.run()}function loadCss(){if(document.currentScript&&!document.currentScript.src.includes(appCdn)&&!document.currentScript.src.includes(appDomain))return!1;const a=document.createElement("link");a.href=`https://${appDomain}/cdn/instafeed-${cssVer}.css`,a.type="text/css",a.rel="stylesheet",a.media="screen,print",document.head.appendChild(a)}function lazyLoading(){function a(a){return new Promise((b,c)=>{const d=new Image;d.src=a,d.onload=b,d.onerror=c})}function b(b){const c=b.dataset.src;return c.includes("https://")?a(c).then(()=>{d(b,c)}).catch(a=>{console.log(a)}):void 0}function c(a){0===g&&f.disconnect();for(let c,d=0;d{debugMode&&console.log("Video started playing: "+e),"#_"===e&&(debugMode&&console.log("Pausing video started late: "+e),g.pause())}),f&&(debugMode&&console.log("Pausing video closed"),f.pause()),d=e,"#_"===e||0===e.length)document.body.style.overflowY="visible",c&&(!0===b&&(c.style.webkitTransform="translate3d(0, 0, 0)"),c.style.overflowY="visible");else if(e.includes("-feed")){function a(a){let b="Tab"===a.key||9===a.keyCode;b&&(a.shiftKey?document.activeElement===f&&(i.focus(),a.preventDefault()):document.activeElement===i&&(f.focus(),a.preventDefault()))}const d=document.querySelector("[id='"+e.substring(1)+"']"),f=d.querySelectorAll("#close-button-url, .follow")[0],h=d.querySelectorAll("#close-button-url, .follow"),i=h[h.length-1];if(document.removeEventListener("keydown",a,!1),document.addEventListener("keydown",a,!1),g&&(console.log("Video force play: "+e),g.play()),c){const a=getComputedStyle(c);"none"!==a.webkitTransform&&(c.style.webkitTransform="initial",b=!0,document.getElementById("insta-feed").scrollIntoView()),c.style.overflowY="hidden"}document.body.style.overflowY="hidden"}}var b=!1,c=document.getElementById("PageContainer"),d="";window.instafeedSlidePage=1,window.instafeedSlide=function(a=0){instafeedSlidePage=parseInt(instafeedSlidePage)+parseInt(a);let b=document.body.querySelectorAll("#insta-feed");0===parseInt(b.length)&&(b=document.body.querySelectorAll(".instafeed-shopify")),b[0].style.padding="0 20px 0 20px";var c=document.body.querySelectorAll(".slide-page"),d=0;for(let b=0;b=instafeedSlidePage&&(instafeedSlidePage=d),instafeedSlidePage>d&&(instafeedSlidePage=1);let f=document.body.querySelectorAll("[data-slide-page=\""+instafeedSlidePage+"\"]");c.forEach(a=>{a.style.display="none"}),f.forEach(a=>{a.style.display="initial"})},loadCss(),window.addEventListener("hashchange",function(){a(d)},!1),window.addEventListener("keydown",function(a){const b=a.key;"Escape"===b&&location.hash.includes("-feed")&&(window.location.hash="#_")}),!function(b,f){"use strict";function e(b,c,d){for(;b&&b!==f.documentElement;){var a=b.getAttribute(c);if(a)return a;b=b.parentNode}return d}"function"!=typeof b.CustomEvent&&(b.CustomEvent=function(b,c){c=c||{bubbles:!1,cancelable:!1,detail:void 0};var d=f.createEvent("CustomEvent");return d.initCustomEvent(b,c.bubbles,c.cancelable,c.detail),d},b.CustomEvent.prototype=b.Event.prototype),f.addEventListener("touchstart",function(a){"true"===a.target.getAttribute("data-swipe-ignore")||(q=a.target,o=Date.now(),g=a.touches[0].clientX,j=a.touches[0].clientY,k=0,m=0)},!1),f.addEventListener("touchmove",function(a){if(g&&j){var b=a.touches[0].clientX,c=a.touches[0].clientY;k=g-b,m=j-c}},!1),f.addEventListener("touchend",function(a){if(q===a.target){var i=parseInt(e(q,"data-swipe-threshold","20"),10),l=e(q,"data-swipe-unit","px"),c=parseInt(e(q,"data-swipe-timeout","500"),10),d=Date.now()-o,n="",p=a.changedTouches||a.touches||[];if("vh"===l&&(i=Math.round(i/100*f.documentElement.clientHeight)),"vw"===l&&(i=Math.round(i/100*f.documentElement.clientWidth)),Math.abs(k)>Math.abs(m)?Math.abs(k)>i&&di&&d{instafeedApp()});