!function(){function t(t){return navigator.userAgent.toLowerCase().search(t.toLowerCase())>-1}function e(){return(!!window.ApplePaySetupFeature||!!window.safari)&&t("Safari")&&!t("Chrome")&&!t("CriOS")}function o(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function n(t,e){let o="",n="",s="";t.link_to_instagram_enabled?(o=`${e.username}`,n=`${e.username}`,s=`${e.username}`):(o=`${e.username}`,n=`${e.username}`,s=`${e.username}`);const l=document.getElementById("slpht-mobile-username");l&&(l.innerHTML=o);const i=document.getElementById("slpht-tablet-username");i&&(i.innerHTML=n);const a=document.getElementById("slpht-desktop-username");a&&(a.innerHTML=s)}function s(t,e){const o=document.getElementById("slpht-mobile-modal-sharing");o&&(t.show_share_buttons||(o.style.display="none"));const n=document.getElementById("slpht-tablet-modal-sharing");n&&(t.show_share_buttons||(n.style.display="none"));const s=document.getElementById("slpht-desktop-modal-sharing");s&&(t.show_share_buttons||(s.style.display="none"));const l="https://www.facebook.com/sharer/sharer.php?u="+z(t,e,"facebook"),i="https://twitter.com/intent/tweet?url="+`${z(t,e,"twitter")}&via=Socialphotosapp`,a=`https://pinterest.com/pin/create/button/?media=${encodeURIComponent(e.media_thumbnail_url)}&url=`+z(t,e,"pinterest")+`&description=${e.caption}`,d={},c=t.gallery_id,p=e.id,r=e.user_id;d.gallery_id=c,d.submission_id=p,d.user_id=r;let h="";t.show_share_facebook&&(h+=''),t.show_share_twitter&&(h+=''),t.show_share_pinterest&&(h+='');const m=document.getElementById("slpht-mobile-modal-sharing");if(m){m.innerHTML=h;const t=document.getElementById("slpht-mobile-share-fb");t&&t.addEventListener("click",function(){window.open(l,"_blank","resizable=1,scrollbars=1,width=500,height=550"),fetch("https://socialphotosapp.com/widget/track_share_facebook",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))});const e=document.getElementById("slpht-mobile-share-twitter");e&&e.addEventListener("click",function(){window.open(i,"_blank","resizable=1,scrollbars=1,width=500,height=550"),fetch("https://socialphotosapp.com/widget/track_share_twitter",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))});const o=document.getElementById("slpht-mobile-share-pinterest");o&&o.addEventListener("click",function(){window.open(a,"_blank","resizable=1,scrollbars=1,width=500,height=550"),fetch("https://socialphotosapp.com/widget/track_share_pinterest",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))})}let u="";t.show_share_facebook&&(u+=''),t.show_share_twitter&&(u+=''),t.show_share_pinterest&&(u+='');const f=document.getElementById("slpht-tablet-modal-sharing");if(f){f.innerHTML=u;const t=document.getElementById("slpht-tablet-share-fb");t&&t.addEventListener("click",function(){window.open(l,"_blank","resizable=1,scrollbars=1,width=500,height=550"),fetch("https://socialphotosapp.com/widget/track_share_facebook",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))});const e=document.getElementById("slpht-tablet-share-twitter");e&&e.addEventListener("click",function(){window.open(i,"_blank","resizable=1,scrollbars=1,width=500,height=550"),fetch("https://socialphotosapp.com/widget/track_share_twitter",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))});const o=document.getElementById("slpht-tablet-share-pinterest");o&&o.addEventListener("click",function(){window.open(a,"_blank","resizable=1,scrollbars=1,width=500,height=550"),fetch("https://socialphotosapp.com/widget/track_share_pinterest",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))})}let g="";t.show_share_facebook&&(g+=''),t.show_share_twitter&&(g+=''),t.show_share_pinterest&&(g+='');const y=document.getElementById("slpht-desktop-modal-sharing");if(y){y.innerHTML=g;const t=document.getElementById("slpht-desktop-share-fb");t&&t.addEventListener("click",function(){window.open(l,"_blank","resizable=1,scrollbars=1,width=500,height=550"),fetch("https://socialphotosapp.com/widget/track_share_facebook",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))});const e=document.getElementById("slpht-desktop-share-twitter");e&&e.addEventListener("click",function(){window.open(i,"_blank","resizable=1,scrollbars=1,width=500,height=550"),fetch("https://socialphotosapp.com/widget/track_share_twitter",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))});const o=document.getElementById("slpht-desktop-share-pinterest");o&&o.addEventListener("click",function(){window.open(a,"_blank","resizable=1,scrollbars=1,width=500,height=550"),fetch("https://socialphotosapp.com/widget/track_share_pinterest",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))})}}function l(t,e,o){if("instagram_post_gallery"==e.gallery_type)return;if("instagram_hashtag_gallery"==e.gallery_type)return;const n=new URL(window.location),s={},l=t.currentTarget.dataset.productId;s.product_id=l,s.submission_id=o.id,s.user_id=o.user_id,s.gallery_id=e.gallery_id,s.path=n.pathname,fetch("/cart.json",{keepalive:!0}).then(t=>t.json()).then(t=>{if(t.token){const e=t.token;s.customer_id=__st.cid,s.cart_token=e,fetch("https://socialphotosapp.com/widget/track_product_clicks",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))}})}function i(t,e){if("instagram_post_gallery"===t.gallery_type)return;if("instagram_hashtag_gallery"==t.gallery_type)return;const o=new URL(window.location),n={};n.submission_id=e.id,n.user_id=e.user_id,n.gallery_id=t.gallery_id,n.path=o.pathname,fetch("/cart.json",{keepalive:!0}).then(t=>t.json()).then(t=>{if(t.token){const e=t.token;n.customer_id=__st.cid,n.cart_token=e,fetch("https://socialphotosapp.com/widget/track_photo_clicks",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))}})["catch"](()=>{fetch("https://socialphotosapp.com/widget/track_photo_clicks",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))})}function a(t,e){if("instagram_post_gallery"===t.gallery_type)return;if("instagram_hashtag_gallery"==t.gallery_type)return;const o=new URL(window.location),n={};n.submission_id=parseInt(e.id),n.user_id=parseInt(e.user_id),n.gallery_id=t.gallery_id,n.path=o.pathname,fetch("/cart.json",{keepalive:!0}).then(t=>t.json()).then(t=>{if(t.token){const e=t.token;n.customer_id=__st.cid,n.cart_token=e,fetch("https://socialphotosapp.com/widget/track_photo_views",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))}})["catch"](()=>{fetch("https://socialphotosapp.com/widget/track_photo_views",{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error",t))})}function d(t){D(t),document.body.classList.add("slpht-modal-open");const e=document.getElementById("slpht-mobile-modal-upload-button");e&&e.addEventListener("click",function(){k(t)},!1);const o=document.getElementById("slpht-mobile-modal-next"),n=document.getElementById("slpht-mobile-modal-prev");o&&o.addEventListener("click",function(){const e=o.dataset.id;_(t,e)}),n&&n.addEventListener("click",function(){const e=n.dataset.id;_(t,e)});const s=document.getElementById("slpht-tablet-modal-upload-button");s&&s.addEventListener("click",function(){k(t)},!1);const l=document.getElementById("slpht-tablet-modal-next"),i=document.getElementById("slpht-tablet-modal-prev");l&&l.addEventListener("click",function(){const e=l.dataset.id;_(t,e)}),i&&i.addEventListener("click",function(){const e=i.dataset.id;_(t,e)});const a=document.getElementById("slpht-desktop-modal-upload-button");a&&a.addEventListener("click",function(){k(t)},!1);const d=document.getElementById("slpht-desktop-modal-next"),c=document.getElementById("slpht-desktop-modal-prev");d&&d.addEventListener("click",function(){const e=d.dataset.id;_(t,e)}),c&&c.addEventListener("click",function(){const e=c.dataset.id;_(t,e)}),p(),Y&&(document.getElementById("slpht-mobile-poweredby").remove(),document.getElementById("slpht-tablet-poweredby").remove(),document.getElementById("slpht-desktop-poweredby").remove())}function c(t){D(t),document.body.classList.add("slpht-modal-open");const e=document.getElementById("slpht-mobile-modal-upload-button");e&&e.addEventListener("click",function(){k(t)},!1);const o=document.getElementById("slpht-mobile-modal-next"),n=document.getElementById("slpht-mobile-modal-prev");o&&o.addEventListener("click",function(){const e=o.dataset.id;y(t,e)}),n&&n.addEventListener("click",function(){const e=n.dataset.id;y(t,e)});const s=document.getElementById("slpht-tablet-modal-upload-button");s&&s.addEventListener("click",function(){k(t)},!1);const l=document.getElementById("slpht-tablet-modal-next"),i=document.getElementById("slpht-tablet-modal-prev");l&&l.addEventListener("click",function(){const e=l.dataset.id;y(t,e)}),i&&i.addEventListener("click",function(){const e=i.dataset.id;y(t,e)});const a=document.getElementById("slpht-desktop-modal-upload-button");a&&a.addEventListener("click",function(){k(t)},!1);const d=document.getElementById("slpht-desktop-modal-next"),c=document.getElementById("slpht-desktop-modal-prev");d&&d.addEventListener("click",function(){const e=d.dataset.id;y(t,e)}),c&&c.addEventListener("click",function(){const e=c.dataset.id;y(t,e)}),p(),Y&&(document.getElementById("slpht-mobile-poweredby").remove(),document.getElementById("slpht-tablet-poweredby").remove(),document.getElementById("slpht-desktop-poweredby").remove())}function p(){const t=document.getElementById("slpht-mobile-close");t&&t.addEventListener("click",function(){v()});const e=document.getElementById("slpht-tablet-close");e&&e.addEventListener("click",function(){v()});const o=document.getElementById("slpht-desktop-close");o&&o.addEventListener("click",function(){v()})}function r(t,e){const o=t.products[e.permalink];let n="";if(t.show_shoppable_products&&o&&o.length>0){let e="";for(const t of o){e+=`\n
\n \n ${t.title}\n \n ${t.title}\n
\n `}n=`\n

\n ${t.look_text}\n

\n ${e}\n `}return n}function h(t,e){const o=t.products[e.permalink];let n="";if(t.show_shoppable_products&&o&&o.length>0){let e="";for(const t of o){e+=`\n
\n \n ${t.title}\n \n ${t.title}\n
\n `}n=`\n

\n ${t.look_text}\n

\n ${e}\n `}return n}function m(t,e){const o=t.products[e.permalink];let n="";if(t.show_shoppable_products&&o&&o.length>0){let e="";for(const t of o){e+=`\n
\n \n ${t.title}\n \n ${t.title}\n
\n `}n=`\n

\n ${t.look_text}\n

\n ${e}\n `}return n}function u(t,o){let n="";n="IMAGE"==o.media_type?t.link_to_instagram_enabled?``:``:`\n
\n
\n `;const s=document.getElementById("slpht-mobile-photo");if(s){s.innerHTML=n;const e=s.getElementsByClassName("slpht-modal-content");for(const n of e)n.addEventListener("click",function(){i(t,o)})}const l=document.getElementById("slpht-tablet-photo");if(l){l.innerHTML=n;const e=l.getElementsByClassName("slpht-modal-content");for(const n of e)n.addEventListener("click",function(){i(t,o)})}const a=document.getElementById("slpht-desktop-modal-photo");if(a){a.innerHTML=n;const s=a.getElementsByClassName("slpht-modal-content");for(const e of s)e.addEventListener("click",function(){i(t,o)});e()&&console.log("safari")}}function f(t,e){let o="";o=t.show_caption&&e.caption&&e.caption.length>0?`${e.caption}`:"";const n=document.getElementById("slpht-mobile-caption");n&&(n.innerHTML=o);const s=document.getElementById("slpht-tablet-caption");s&&(s.innerHTML=o);const l=document.getElementById("slpht-desktop-caption");l&&(l.innerHTML=o)}function g(t,e){const o=document.getElementById("slpht-mobile-products");o&&(o.innerHTML=r(t,e));const n=document.getElementById("slpht-tablet-products");n&&(n.innerHTML=h(t,e));const s=document.getElementById("slpht-desktop-products");s&&(s.innerHTML=m(t,e));const i=document.getElementsByClassName("slpht-mobile-product");for(const o of i)o.addEventListener("click",function(o){l(o,t,e)},!1);const a=document.getElementsByClassName("slpht-tablet-product");for(const o of a)o.addEventListener("click",function(o){l(o,t,e)},!1);const d=document.getElementsByClassName("slpht-product");for(const o of d)o.addEventListener("click",function(o){l(o,t,e)},!1)}function y(t,e){const o=parseInt(e),l=t.empty_photos[o],i=t.empty_photos.length;n(t,l),b(t),s(t,l),u(t,l),f(t,l);let a=o-1;a<0&&(a=i-1);let d=o+1;d>=i&&(d=0);const c=document.getElementById("slpht-mobile-modal-prev"),p=document.getElementById("slpht-mobile-modal-next");c&&c.setAttribute("data-id",a.toString()),p&&p.setAttribute("data-id",d.toString());const r=document.getElementById("slpht-tablet-modal-prev"),h=document.getElementById("slpht-tablet-modal-next");r&&r.setAttribute("data-id",a.toString()),h&&h.setAttribute("data-id",d.toString());const m=document.getElementById("slpht-desktop-modal-prev"),g=document.getElementById("slpht-desktop-modal-next");m&&m.setAttribute("data-id",a.toString()),g&&g.setAttribute("data-id",d.toString())}function b(t){if(t.show_modal_submit_button);else{const t=document.getElementById("slpht-mobile-modal-upload");t&&(t.style.display="none");const e=document.getElementById("slpht-tablet-modal-upload");e&&(e.style.display="none");const o=document.getElementById("slpht-desktop-modal-upload");o&&(o.style.display="none")}}function _(t,e){const o=parseInt(e),l=t.pics[o],i=t.pics.length;n(t,l),b(t),s(t,l),u(t,l),f(t,l),g(t,l);let d=o-1;d<0&&(d=i-1);let c=o+1;c>=i&&(c=0);const p=document.getElementById("slpht-mobile-modal-prev"),r=document.getElementById("slpht-mobile-modal-next");p&&p.setAttribute("data-id",d.toString()),r&&r.setAttribute("data-id",c.toString());const h=document.getElementById("slpht-tablet-modal-prev"),m=document.getElementById("slpht-tablet-modal-next");h&&h.setAttribute("data-id",d.toString()),m&&m.setAttribute("data-id",c.toString());const y=document.getElementById("slpht-desktop-modal-prev"),_=document.getElementById("slpht-desktop-modal-next");y&&y.setAttribute("data-id",d.toString()),_&&_.setAttribute("data-id",c.toString()),a(t,l)}function v(){document.body.classList.remove("slpht-modal-open");const t=document.getElementById("slpht-mobile-modal");t&&t.remove();const e=document.getElementById("slpht-tablet-modal");e&&e.remove();const o=document.getElementById("slpht-desktop-modal");o&&o.remove()}function k(t){const e=document.getElementById("socialphotos-root"),o=Q(t);e.insertAdjacentHTML("afterbegin",o),v(),document.body.classList.add("slpht-modal-open"),document.getElementById("socialphotos-upload-modal").classList.add("in"),document.getElementById("slpht-close").addEventListener("click",function(){w()}),window.addEventListener?window.addEventListener("message",function(t){"queuecomplete"==t.data.status&&w()},!1):window.attachEvent("onmessage",function(t){"queuecomplete"==t.data.status&&w()});const n=document.getElementById("upload-iframe").contentWindow;setInterval(function(){n.postMessage("messageFromSocialphotos","https://socialphotosapp.com")},1e3)}function w(){document.body.classList.remove("slpht-modal-open");const t=document.getElementById("socialphotos-upload-modal");t&&t.remove()}function E(t,e){fetch("/cart.json",{keepalive:!0}).then(t=>t.json()).then(o=>{if(null!=o.token){const n=o.token;return t.cart_token=n,I(t,e)}})}function I(t,e){let o;switch(e){case 1:o="https://socialphotosapp.com/widget/track_product_views";break;case 2:case 3:o="https://socialphotosapp.com/widget/track_gallery_views";break;case"instagram-post-gallery":case"instagram-hashtag-gallery":return}fetch(o,{method:"POST",mode:"cors",credentials:"omit",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(t=>t.json()).then(()=>{})["catch"](t=>console.error("error:",t))}function $(t,e){let o=X[t];if(o.use_empty_state&&o.pics.lengtho.mobile_offset_total)return;const s=o.mobile_offset*o.mobile_limit-o.mobile_limit,l=o.mobile_offset*o.mobile_limit-1,i=o.pics.slice(s,+l+1||undefined);let a="";const c="https://media-prod.slpht.net/image-loading-gif.gif";for(const e of i){a+=`\n
\n
\n
\n `}const p=document.getElementById(`slpht-mobile-thumbnails-${t}`);p.insertAdjacentHTML("beforeend",a);const r=p.querySelectorAll(".slpht-thumbnail");for(const t of r){const e=t.querySelector(".socialphotos-view").dataset.id,n=o.pics.findIndex(t=>t.id==e),s=o.pics[n];!0!==s.clickMobileBounded&&(t.addEventListener("click",function(){d(o),_(o,n)},!1),s.clickMobileBounded=!0)}}function B(t,e){let o=X[t];if(o.use_empty_state&&o.pics.lengtho.tablet_offset_total)return;const s=o.tablet_offset*o.tablet_limit-o.tablet_limit,l=o.tablet_offset*o.tablet_limit-1,i=o.pics.slice(s,+l+1||undefined);let a="";const c="https://media-prod.slpht.net/image-loading-gif.gif";for(const e of i){a+=`\n
\n
\n
\n `}const p=document.getElementById(`slpht-tablet-thumbnails-${t}`);p.insertAdjacentHTML("beforeend",a);const r=p.querySelectorAll(".slpht-thumbnail");for(const t of r){const e=t.querySelector(".socialphotos-view").dataset.id,n=o.pics.findIndex(t=>t.id==e),s=o.pics[n];0==s.clickTabletBounded&&(t.addEventListener("click",function(){d(o),_(o,n)},!1),s.clickTabletBounded=!0)}}function L(t,e){const o=t.empty_photos.slice(0,t.photos_per_row_mobile);let n="";const s=document.getElementById(`slpht-mobile-load-more-${e}`);s&&(s.style.display="none");const l=document.getElementById(`slpht-mobile-prev-${e}`);l&&(l.style.display="none");const i=document.getElementById(`slpht-mobile-next-${e}`);i&&(i.style.display="none");for(const t of o){n+=`\n
\n
\n
\n
\n `}const a=document.getElementById(`slpht-mobile-thumbnails-${e}`);a.innerHTML=n;const d=a.querySelectorAll(".slpht-thumbnail");for(const e of d){const o=e.querySelector(".socialphotos-view").dataset.id,n=t.empty_photos.findIndex(t=>t.id==o);e.addEventListener("click",function(){c(t),y(t,n)},!1)}}function S(t,e){const o=t.empty_photos.slice(0,t.photos_per_row_tablet);let n="";const s=document.getElementById(`slpht-tablet-load-more-${e}`);s&&(s.style.display="none");const l=document.getElementById(`slpht-tablet-prev-${e}`);l&&(l.style.display="none");const i=document.getElementById(`slpht-tablet-next-${e}`);i&&(i.style.display="none");for(const t of o){n+=`\n
\n
\n
\n
\n `}const a=document.getElementById(`slpht-tablet-thumbnails-${e}`);a.innerHTML=n;const d=a.querySelectorAll(".slpht-thumbnail");for(const e of d){const o=e.querySelector(".socialphotos-view").dataset.id,n=t.empty_photos.findIndex(t=>t.id==o);e.addEventListener("click",function(){c(t),y(t,n)},!1)}}function x(t,e){const o=t.empty_photos.slice(0,t.photos_per_row_desktop);let n="";const s=document.getElementById(`slpht-desktop-load-more-${e}`);s&&(s.style.display="none");const l=document.getElementById(`slpht-desktop-prev-${e}`);l&&(l.style.display="none");const i=document.getElementById(`slpht-desktop-next-${e}`);i&&(i.style.display="none");for(const t of o){n+=`\n
\n
\n
\n
\n `}const a=document.getElementById(`slpht-desktop-thumbnails-${e}`);a.innerHTML=n;const d=a.querySelectorAll(".slpht-thumbnail");for(const e of d){const o=e.querySelector(".socialphotos-view").dataset.id,n=t.empty_photos.findIndex(t=>t.id==o);e.addEventListener("click",function(){c(t),y(t,n)},!1)}}function T(t,e){const o=X[t];if(o.use_empty_state&&o.pics.lengtho.desktop_offset_total)return;const s=o.desktop_offset*o.desktop_limit-o.desktop_limit,l=o.desktop_offset*o.desktop_limit-1,i=o.pics.slice(s,+l+1||undefined);let a="";for(const e of i){a+=`\n
\n
\n
\n `}const c=document.getElementById(`slpht-desktop-thumbnails-${t}`);if(null==c)return;c.insertAdjacentHTML("beforeend",a);const p=c.querySelectorAll(".slpht-thumbnail");for(const t of p){const e=t.querySelector(".socialphotos-view").dataset.id,n=o.pics.findIndex(t=>t.id==e),s=o.pics[n];if(0==s.clickDesktopBounded&&(t.addEventListener("click",function(){d(o),_(o,n)},!1),s.clickDesktopBounded=!0),t.querySelector(".spw-thumbnail-overlay"));else{const e='
';t.insertAdjacentHTML("afterbegin",e);const n=`\n
\n ${o.action}\n
\n `;null!=o.products[s.permalink]&&o.action.length>0&&t.insertAdjacentHTML("afterbegin",n)}}}function j(t,e){let o=X[t];const n=o.pics.length,s=o.mobile_limit;if(o.use_empty_state&&n1&&(o.mobile_offset-=1),"timer"===e&&(o.mobile_offset+1<=o.mobile_offset_total?o.mobile_offset+=1:o.mobile_offset=1);const l=document.getElementById(`slpht-mobile-prev-${t}`),i=document.getElementById(`slpht-mobile-next-${t}`);if(0==(0|o.mobile_offset_total)?(l.style.display="none",i.style.display="none"):(1==(0|o.mobile_offset)?l.style.display="none":l.style.display="block",(0|o.mobile_offset)==(0|o.mobile_offset_total)?i.style.display="none":i.style.display="block"),o.mobile_offset>o.mobile_offset_total)return;const a=o.mobile_offset*s-s,c=o.mobile_offset*s;let p=o.pics.slice(a,c);p.length\n
\n \n `}const h=document.getElementById(`slpht-mobile-thumbnails-${t}`);h.innerHTML=r;const m=h.querySelectorAll(".slpht-thumbnail");for(const t of m){const e=t.querySelector(".socialphotos-view").dataset.id,n=o.pics.findIndex(t=>t.id==e);t.addEventListener("click",function(){clearInterval(o.mobileTimer),d(o),_(o,n)},!1)}}function C(t,e){let o=X[t];const n=o.pics.length,s=o.tablet_limit;if(o.use_empty_state&&n1&&(o.tablet_offset-=1),"timer"===e&&(o.tablet_offset+1<=o.tablet_offset_total?o.tablet_offset+=1:o.tablet_offset=1);const l=document.getElementById(`slpht-tablet-prev-${t}`),i=document.getElementById(`slpht-tablet-next-${t}`);if(0==(0|o.tablet_offset_total)?(l.style.display="none",i.style.display="none"):(1==(0|o.tablet_offset)?l.style.display="none":l.style.display="block",(0|o.tablet_offset)==(0|o.tablet_offset_total)?i.style.display="none":i.style.display="block"),o.tablet_offset>o.tablet_offset_total)return;const a=o.tablet_offset*s-s,c=o.tablet_offset*s;let p=o.pics.slice(a,c);p.length\n
\n \n `}const h=document.getElementById(`slpht-tablet-thumbnails-${t}`);h.innerHTML=r;const m=h.querySelectorAll(".slpht-thumbnail");for(const t of m){const e=t.querySelector(".socialphotos-view").dataset.id,n=o.pics.findIndex(t=>t.id==e);t.addEventListener("click",function(){clearInterval(o.tabletTimer),d(o),_(o,n)},!1)}}function A(t,e){let o=X[t];const n=o.pics.length,s=o.desktop_limit;if(o.use_empty_state&&n1&&(o.desktop_offset-=1),"timer"===e&&(o.desktop_offset+1<=o.desktop_offset_total?o.desktop_offset+=1:o.desktop_offset=1);const l=document.getElementById(`slpht-desktop-prev-${t}`),i=document.getElementById(`slpht-desktop-next-${t}`);if(0==(0|o.desktop_offset_total)?(l.style.display="none",i.style.display="none"):(1==(0|o.desktop_offset)?l.style.display="none":l.style.display="block",(0|o.desktop_offset)==(0|o.desktop_offset_total)?i.style.display="none":i.style.display="block"),o.desktop_offset>o.desktop_offset_total)return;const a=o.desktop_offset*s-s,c=o.desktop_offset*s;let p=o.pics.slice(a,c);p.length\n
\n \n `}const h=document.getElementById(`slpht-desktop-thumbnails-${t}`);h.innerHTML=r;const m=h.querySelectorAll(".slpht-thumbnail");for(const t of m){const e=t.querySelector(".socialphotos-view").dataset.id,n=o.pics.findIndex(t=>t.id==e),s=o.pics[n];if(t.addEventListener("click",function(){clearInterval(o.desktopTimer),d(o),_(o,n)},!1),t.querySelector(".spw-thumbnail-overlay"));else{const e='
';t.insertAdjacentHTML("afterbegin",e);const n=`\n
\n ${o.action}\n
\n `;null!=o.products[s.permalink]&&o.action.length>0&&t.insertAdjacentHTML("afterbegin",n)}}}function M(t){const e=document.getElementById(`slpht-mobile-load-more-${t}`);o(e)&&(e.querySelector(".slpht-load-more-icon span").style.display="none",$(t,"asc"))}function H(t){const e=document.getElementById(`slpht-mobile-load-more-${t}`),o=X[t];e.addEventListener("click",function(){if(o.auto_scroll){const e=150;window.addEventListener("scroll",tt(M,e,t),!0)}$(t,"asc")},!1)}function q(t){ const e=document.getElementById(`slpht-tablet-load-more-${t}`);o(e)&&(e.querySelector(".slpht-load-more-icon span").style.display="none",B(t,"asc"))}function O(t){const e=document.getElementById(`slpht-tablet-load-more-${t}`),o=X[t];e.addEventListener("click",function(){if(o.auto_scroll){const e=150;window.addEventListener("scroll",tt(q,e,t),!0)}B(t,"asc")},!1)}function P(t){const e=document.getElementById(`slpht-desktop-load-more-${t}`);o(e)&&(e.querySelector(".slpht-load-more-icon span").style.display="none",T(t,"asc"))}function N(t){const e=document.getElementById(`slpht-desktop-load-more-${t}`);if(e){const o=X[t];e.addEventListener("click",function(){if(o.auto_scroll){const e=150;window.addEventListener("scroll",tt(P,e,t),!0)}T(t,"asc")},!1)}}function J(t,e){const o=X[t];document.getElementById(`slpht-mobile-prev-${t}`).addEventListener("click",function(){j(t,"desc")},!1),document.getElementById(`slpht-mobile-next-${t}`).addEventListener("click",function(){j(t,"asc")},!1),e>0&&(o.mobileTimer=setInterval(()=>j(t,"timer"),1e3*e))}function U(t,e){const o=X[t];document.getElementById(`slpht-tablet-prev-${t}`).addEventListener("click",function(){C(t,"desc")},!1),document.getElementById(`slpht-tablet-next-${t}`).addEventListener("click",function(){C(t,"asc")},!1),e>0&&(o.tabletTimer=setInterval(()=>C(t,"timer"),1e3*e))}function R(t,e){const o=X[t];document.getElementById(`slpht-desktop-prev-${t}`).addEventListener("click",function(){A(t,"desc")},!1),document.getElementById(`slpht-desktop-next-${t}`).addEventListener("click",function(){A(t,"asc")},!1),e>0&&(o.desktopTimer=setInterval(()=>A(t,"timer"),1e3*e))}function z(t,e,o){const n=`g=>${t.gallery_id};p=>${e.id};u=>${document.location.href.match(/(^[^#]*)/)[0]};`;return encodeURIComponent(`https://socialphotosapp.com/p/${btoa(n)}?utm_source=${o}_share&utm_medium=widget_modal&utm_campaign=visitors&ver=1`)}function D(t){const e=document.getElementById("socialphotos-root"),o=K(t);e.insertAdjacentHTML("afterbegin",o)}function G(t){if("hide"===t.html)return;const e=t.containerID,o=t.gallery_id,n=t.css,s=t.timer,l=t.product_widget_id;if(Y=t.white,X[e]=t,t.mobile_offset=1,t.tablet_offset=1,t.desktop_offset=1,t.offset=1,t.hide_when_empty&&0==t.pics.length)return;for(const e of t.pics)e.clickTabletBounded=!1,e.clickMobileBounded=!1,e.clickDesktopBounded=!1,e.clickBounded=!1;let i=document.getElementById(`socialphotos-widget-${e}`);i.classList.add(`slpht-template-${l}`),i.insertAdjacentHTML("beforeend",t.gallery_html);const a=document.createElement("style");if(a.setAttribute("type","text/css"),a.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(a),t.use_empty_state&&t.pics.lengtht.id==parseInt(f));d(t),_(t,e)}}function W(){const t=document.querySelectorAll(".socialphotos-com-gallery");for(const[e,o]of t.entries()){let t=null,n=null,s=null;const l=e+1,i=o.dataset.uid;o.setAttribute("id",`socialphotos-widget-${l}`),o.classList.add("socialphotos-widget-root"),o.classList.add("slpht-clearfix"),"instagram-post-gallery"===o.dataset.galleryType?t="instagram-post-gallery":"instagram-hashtag-gallery"===o.dataset.galleryType?(t="instagram-hashtag-gallery",s=o.dataset.hashtagId):"all"===o.dataset.type?(t=3,n=o.dataset.id):o.dataset.id?(t=2,n=o.dataset.id):(t=1,n=__st.rid);const a={productID:n,uid:i,type:t,containerID:l,hashtag_id:s};E(a,t);let d="";switch(t){case 1:d="https://socialphotosapp.com/widget/product_gallery?"+new URLSearchParams(a);break;case 2:d="https://socialphotosapp.com/widget/page_gallery?"+new URLSearchParams(a);break;case 3:d="https://socialphotosapp.com/widget/all_gallery?"+new URLSearchParams(a);break;case"instagram-post-gallery":d="https://socialphotosapp.com/widget/instagram_gallery?"+new URLSearchParams(a);break;case"instagram-hashtag-gallery":d="https://socialphotosapp.com/widget/instagram_hashtag_gallery?"+new URLSearchParams(a);break;default:return}fetch(d,{keepalive:!0}).then(t=>t.json()).then(e=>{G(e,null,null,t)})}}function F(){document.dispatchEvent(new Event("extensionSocialphotos"));const t=document.createElement("div");t.setAttribute("id","socialphotos-root"),document.getElementsByTagName("body")[0].appendChild(t),V("socialphotosStylesheet","link","text/css","https://cdn.slpht.com/widget/stylesheets/slpht_45c0afa3ec962142450c7c2738b41c4b.css","stylesheet"),W()}function K(t){const e=t.product_widget_id;return`\n \n `+`\n \n `+`\n \n `}function Q(t){let e=384;const o=83,n=84,s=170;t.show_upload_username&&(e+=o),t.show_upload_email&&(e+=n),t.show_upload_caption&&(e+=s);const l=`${e}px`;return`\n \n `}console.log("Create Social Proof from UGC (User-generated Content)! Get Socialphotos app at https://apps.shopify.com/social-photos");const V=function(t,e,o,n,s){const l=document.createElement(e);return l.setAttribute("type",o),l.setAttribute("id",t),l.setAttribute("rel",s),l.setAttribute("href",n),document.getElementsByTagName("head")[0].appendChild(l),l};const X={};let Y=0;const Z="https://media-prod.slpht.net/image-loading-gif.gif",tt=function(t,e,o){let n=null;return function(){return clearTimeout(n),n=setTimeout(()=>t(o),e)}};(function(){"loading"!==document.readyState?F():document.addEventListener("DOMContentLoaded",function(){F()})})()}();