1/*! 2 * Instafeed 3 */(function(){var e;e=(function(){function e2(e3,t){var n,r;if(this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"none",links:!0,mock:!1,useHttp:!1},typeof e3=="object")for(n in e3)r=e3[n],this.options[n]=r;this.context=t!=null?t:this,this.unique=this._genKey()}return e2.prototype.hasNext=function(){return typeof this.context.nextUrl=="string"&&this.context.nextUrl.length>0},e2.prototype.next=function(){return this.hasNext()?this.run(this.context.nextUrl):!1},e2.prototype.run=function(t){var n,r,i;if(typeof this.options.clientId!="string"&&typeof this.options.accessToken!="string")throw new Error("Missing clientId or accessToken.");if(typeof this.options.accessToken!="string"&&typeof this.options.clientId!="string")throw new Error("Missing clientId or accessToken.");return this.options.before!=null&&typeof this.options.before=="function"&&this.options.before.call(this),typeof document!="undefined"&&document!==null&&(i=document.createElement("script"),i.id="instafeed-fetcher",i.src=t||this._buildUrl(),n=document.getElementsByTagName("head"),n[0].appendChild(i),r="instafeedCache"+this.unique,window[r]=new e2(this.options,this),window[r].unique=this.unique),!0},e2.prototype.parse=function(e3){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D;if(typeof e3!="object"){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}if(e3.meta.code!==200){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,e3.meta.error_message),!1;throw new Error("Error from Instagram: "+e3.meta.error_message)}if(e3.data.length===0){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}if(this.options.success!=null&&typeof this.options.success=="function"&&this.options.success.call(this,e3),this.context.nextUrl="",e3.pagination!=null&&(this.context.nextUrl=e3.pagination.next_url),this.options.sortBy!=="none")switch(this.options.sortBy==="random"?M=["","random"]:M=this.options.sortBy.split("-"),O=M[0]==="least",M[1]){case"random":e3.data.sort(function(){return .5-Math.random()});break;case"recent":e3.data=this._sortBy(e3.data,"created_time",O);break;case"liked":e3.data=this._sortBy(e3.data,"likes.count",O);break;case"commented":e3.data=this._sortBy(e3.data,"comments.count",O);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}if(typeof document!="undefined"&&document!==null&&this.options.mock===!1){if(m=e3.data,A=parseInt(this.options.limit,10),this.options.limit!=null&&m.length>A&&(m=m.slice(0,A)),u=document.createDocumentFragment(),this.options.filter!=null&&typeof this.options.filter=="function"&&(m=this._filter(m,this.options.filter)),this.options.template!=null&&typeof this.options.template=="string"){for(f="",d="",w="",D=document.createElement("div"),c=0,N=m.length;c<N;c++){if(h=m[c],p=h.images[this.options.resolution],typeof p!="object")throw o="No image found for resolution: "+this.options.resolution+".",new Error(o);E=p.width,y=p.height,b="square",E>y&&(b="landscape"),E<y&&(b="portrait"),v=p.url,l=window.location.protocol.indexOf("http")>=0,l&&!this.options.useHttp&&(v=v.replace(/https?:\/\//,"//")),d=this._makeTemplate(this.options.template,{model:h,id:h.id,link:h.link,type:h.type,image:v,width:E,height:y,orientation:b,caption:this._getObjectProperty(h,"caption.text"),likes:h.likes.count,comments:h.comments.count,location:this._getObjectProperty(h,"location.name")}),f+=d}for(D.innerHTML=f,i=[],r=0,n=D.childNodes.length;r<n;)i.push(D.childNodes[r]),r+=1;for(x=0,C=i.length;x<C;x++)L=i[x],u.appendChild(L)}else for(T=0,k=m.length;T<k;T++){if(h=m[T],g=document.createElement("img"),p=h.images[this.options.resolution],typeof p!="object")throw o="No image found for resolution: "+this.options.resolution+".",new Error(o);v=p.url,l=window.location.protocol.indexOf("http")>=0,l&&!this.options.useHttp&&(v=v.replace(/https?:\/\//,"//")),g.src=v,this.options.links===!0?(t=document.createElement("a"),t.href=h.link,t.appendChild(g),u.appendChild(t)):u.appendChild(g)}if(_=this.options.target,typeof _=="string"&&(_=document.getElementById(_)),_==null)throw o='No element with id="'+this.options.target+'" on page.',new Error(o);_.appendChild(u),a=document.getElementsByTagName("head")[0],a.removeChild(document.getElementById("instafeed-fetcher")),S="instafeedCache"+this.unique,window[S]=void 0;try{delete window[S]}catch(P){s=P}}return this.options.after!=null&&typeof this.options.after=="function"&&this.options.after.call(this),!0},e2.prototype._buildUrl=function(){var e3,t,n;switch(e3="https://api.instagram.com/v1",this.options.get){case"popular":t="media/popular";break;case"tagged":if(!this.options.tagName)throw new Error("No tag name specified. Use the 'tagName' option.");t="tags/"+this.options.tagName+"/media/recent";break;case"location":if(!this.options.locationId)throw new Error("No location specified. Use the 'locationId' option.");t="locations/"+this.options.locationId+"/media/recent";break;case"user":if(!this.options.userId)throw new Error("No user specified. Use the 'userId' option.");t="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}return n=e3+"/"+t,this.options.accessToken!=null?n+="?access_token="+this.options.accessToken:n+="?client_id="+this.options.clientId,this.options.limit!=null&&(n+="&count="+this.options.limit),n+="&callback=instafeedCache"+this.unique+".parse",n},e2.prototype._genKey=function(){var e3;return e3=function(){return((1+Math.random())*65536|0).toString(16).substring(1)},""+e3()+e3()+e3()+e3()},e2.prototype._makeTemplate=function(e3,t){var n,r,i,s,o;for(r=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,n=e3;r.test(n);)s=n.match(r)[1],o=(i=this._getObjectProperty(t,s))!=null?i:"",n=n.replace(r,function(){return""+o});return n},e2.prototype._getObjectProperty=function(e3,t){var n,r;for(t=t.replace(/\[(\w+)\]/g,".$1"),r=t.split(".");r.length;){if(n=r.shift(),!(e3!=null&&n in e3))return null;e3=e3[n]}return e3},e2.prototype._sortBy=function(e3,t,n){var r;return r=function(e4,r2){var i,s;return i=this._getObjectProperty(e4,t),s=this._getObjectProperty(r2,t),n?i>s?1:-1:i<s?1:-1},e3.sort(r.bind(this)),e3},e2.prototype._filter=function(e3,t){var n,r,i,s,o;for(n=[],r=function(e4){if(t(e4))return n.push(e4)},i=0,o=e3.length;i<o;i++)s=e3[i],r(s);return n},e2})(),(function(e2,t){return typeof define=="function"&&define.amd?define([],t):typeof module=="object"&&module.exports?module.exports=t():e2.Instafeed=t()})(this,function(){return e})}).call(this);var INSTAGRAM_SELECTOR=".lush-instagram",INSTAGRAM_OPTIONS={get:"user",userId:"self",resolution:"low_resolution"},INSTAGRAM_TEMPLATE='<div class="item"><a href="{{link}}" target="_blank"><img class="size-info" width="320" height="320" src="{{image}}" alt="Instagram"></a><div class="info pa tc flex ts__03 center-xs middle-xs">
3<span class="likes"><i class="fa fa-heart-o"></i>{{likes}}</span><span class="comments"><i class="fa fa-comments-o"></i>{{comments}}</span></div></div>',instagrams={};function instagram_init(instagram_element){var section=instagram_element.dataset.id,token_input=document.querySelector("#token-"+section);if(token_input){for(var token=token_input.value,target=document.querySelector("#instafeed-"+section),rows=parseInt(target.dataset.rows),grid=parseInt(target.dataset.grid),sortBy=target.dataset.sortBy,options=$.extend({},{limit:4,target:target,accessToken:token,sortBy:sortBy,template:INSTAGRAM_TEMPLATE.replace("%grid%",grid),after:function(){$("#instafeed-"+section)},error:function(message){console.error("Unable to download Instagram data: "+message)}},INSTAGRAM_OPTIONS);target.firstChild;)target.removeChild(target.firstChild);var feed=new Instafeed(options);feed.run()}}function load_instagram(target){var instagram_elements=target.querySelectorAll(INSTAGRAM_SELECTOR);Array.prototype.forEach.call(instagram_elements,instagram_init)}function get_section_name(event){var section=null;if(event&&event.detail){var data={},dataset=event.target.dataset;for(var key in dataset)dataset.hasOwnProperty(key)&&key.indexOf("themeEditorSection-")===0&&(data=JSON.parse(dataset[key]));data.hasOwnProperty("type")&&(section=data.type)}return section}function onload(event){var section=get_section_name(event);(!section||section==="instagram")&&load_instagram(event.target)}document.addEventListener("shopify:section:load",onload),document.addEventListener("shopify:section:unload",onload),document.addEventListener("DOMContentLoaded",onload); 4//# sourceMappingURL=/cdn/shop/t/3/assets/instagram.js.map?v=39046506430872274381629231231
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.