1System.register(["react/jsx-runtime","react","@vp/tracking","@vp/swan"],(function(I){"use strict";var P,m,g,E,f,w,k,C,S;return{setters:[function(c){P=c.jsxs,m=c.jsx},function(c){g=c.useRef,E=c.useState,f=c.useCallback,w=c.useEffect},function(c){k=c.getTracking},function(c){C=c.IconButton,S=c.Icon}],execute:(function(){const c=t=>{window.olapic.prepareWidget(t,{renderNow:!0,force:!0})},_=t=>{typeof window<"u"&&window.olapic&&c({id:t.widget.instanceId,tags:t.source.tag,wrapper:"olapic_specific_widget"})},L=t=>{let r=-1,u=10;for(;t&&t.tagName.toLowerCase()!=="li";)t=t.parentElement;if(t&&t.tagName.toLowerCase()==="li"){const i=t.parentElement;i&&i.tagName.toLowerCase()==="ul"&&(u=i.children.length,r=Array.from(i.children).indexOf(t))}return{selectedPhotoIndex:r,totalPhotoElements:u}},q=(t,r,u)=>{let i=t.target;for(;i&&!i.hasAttribute("data-olapic-photo-id");)i=i.parentElement;const p=L(i);if(p){const{selectedPhotoIndex:h,totalPhotoElements:v}=p,d={category:"Social Native Feed",label:`${(i&&i.querySelector(".olapic-user-name")?.textContent)??""}:${h}_${v}`,...r};u("Carousel Clicked",d)}},A=(t,r,u)=>{const i={...r,category:"Social Native Feed",label:t==="next"?"Right Arrow":"Left Arrow"};u("Carousel Clicked",i)},$=(t,r)=>{r("Carousel Viewed",{...t,category:"Social Native Feed",label:"Carousel Viewed"})},F=I("SocialNative",({widgetData:t,analyticsData:r,locale:u})=>{const i="https://photorankstatics-a.akamaihd.net/743d2e78a76dedeb07e0745158547931/static/frontend/latest/build.min.js",p=g(null),h=g(!1),v=g(!1),[x,N]=E(!1),d=f((e,o)=>new Promise((a,s)=>{try{const l=k();if(l)l.track(e,o);else{const n={once:!0};window.addEventListener("trackingReady",()=>{k()?.track(e,o)},n)}a()}catch(l){s(l)}}),[]),T=f(()=>{const e=document.querySelector("#olapic-report-form");if(e){const o=e.getAttribute("action")?.match(/\/media\/(\d+)\/reports/);if(o)return o[1]}return null},[]),b=f(()=>{const e=document.querySelector(".olapic-viewer-overlay");return!!(e&&!e.classList.contains("olapic-hidden"))},[]),y=f(()=>{if(!v.current||!b())return!1;const e=T();if(!e||p.current===e)return!1;p.current=e;const o=document.querySelector(".olapic-viewer-overlay .olapic-products-list"),a=document.querySelector(".olapic-viewer-overlay .author-username")?.textContent?.trim()??"",s=o?Array.from(o.querySelectorAll("[data-product-id]")).map((l,n)=>({product_id:l.getAttribute("data-product-id")??"",name:l.textContent?.trim()??"",position:n,list_section_id:a})):[];return d("Product List Viewed",{label:"Social Native Feed Carousel",list_id:"Social Native Feed Carousel",products:JSON.stringify(s)}),!0},[T,d,b]);w(()=>{const e=document.createElement("style");return e.innerHTML=` 2 .olapic-slider-wrapper { 3 margin: 0 !important; 4 width: auto !important; 5 } 6 7 .instagram_graph{ 8 height: 390px !important; 9 width: 390px !important; 10 } 11 12 #social-curated-content .olapic-nav-button { 13 display: none !important; 14 } 15 16 #social-curated-content .olapic-slider-footer{ 17 display: none !important; 18 } 19 20 #social-curated-content .instagram_graph { 21 background-color: var(--swan-sem-color-bg-container); 22 border-color: var(--swan-sem-color-border-container); 23 border-radius: var(--swan-sem-border-radius-container); 24 border-style: solid; 25 border-width: var(--swan-sem-border-width-none); 26 } 27 28 #social-curated-content .social-curation-nav-prev { 29 position: absolute; 30 top: 50%; 31 left: 0; 32 z-index: 99; 33 transform: translate(-50%, -50%); 34 } 35 36 #social-curated-content .social-curation-nav-next{ 37 position: absolute; 38 top: 50%; 39 right: 0; 40 z-index: 99; 41 transform: translate(50%, -50%); 42 } 43 44 @media (max-width: 1024px) { 45 #social-curated-content .social-curation-nav-prev, 46 #social-curated-content .social-curation-nav-next { 47 transform: translate(0%, -50%); 48 } 49 } 50 `,document.head.appendChild(e),()=>{document.head.removeChild(e)}},[]),w(()=>{const e=document.querySelector("[data-olapic='olapic_specific_widget']");if(typeof window<"u"&&!e){const n=document.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("src",i),n.setAttribute("data-olapic","olapic_specific_widget"),n.setAttribute("data-instance",t.widget.instanceId),n.setAttribute("data-apikey",t.apiKey),n.setAttribute("data-tags",t.source.tag),n.setAttribute("async","async"),n.onerror=O=>{console.error(`Error: SN script is not loaded. Page: ${r.pageName}, Page Url: ${window.location.href}, Error: ${JSON.stringify(O)}`,{contextData:t})},document.head.appendChild(n)}typeof window<"u"&&!window.olapic&&(window.onOlapicLoad=()=>{try{window.OlapicSDK.conf.set("apikey",t?.apiKey),window.olapic=window.olapic||new window.OlapicSDK.Olapic(()=>_(t))}catch(n){console.error(`Error: Setting SN object to window object. Page: ${r.pageName}, Page Url: ${window.location.href}, Error: ${n}`,{contextData:t})}});const o=document.querySelector("#olapic_specific_widget"),a=()=>
50!!o?.querySelector(".olapic-slider-wrapper, [data-olapic-photo-id]"),s=new MutationObserver(()=>{a()&&(N(!0),s.disconnect())});o&&s.observe(o,{childList:!0,subtree:!0});const l=setTimeout(()=>{a()||console.error(`Error: SN widget returned no data. Likely blocked by CORS or an empty API response. Page: ${r.pageName}, Page Url: ${window.location.href}`,{contextData:t})},8e3);return()=>{s.disconnect(),clearTimeout(l),e&&document.head.removeChild(e)}},[t,r.pageName]),w(()=>{const e=()=>{h.current||($(r,d),h.current=!0)},o=document.querySelector("#social-curated-content");if(!o||h.current)return;if(typeof IntersectionObserver>"u"){e();return}const a=new IntersectionObserver(([s])=>{s.isIntersecting&&(e(),a.disconnect())},{threshold:.1});return a.observe(o),()=>{a.disconnect()}},[r,d]),w(()=>{let e;const o=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{if(!b()){v.current=!1,p.current=null;return}y()},50)});return document.body&&o.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class","data-olapic-photo-id"]}),y(),()=>{clearTimeout(e),o.disconnect(),p.current=null}},[b,y,t]);const j=e=>{let o=e.target;for(;o&&!o.hasAttribute("data-olapic-photo-id");)o=o.parentElement;return o};return t&&r&&u?P("div",{"data-testid":"olapic_product_feed",id:"social-curated-content",style:{position:"relative"},children:[x&&m(C,{tooltip:"Previous",onClick:()=>{const e=document.querySelector(".olapic-nav-prev");e&&e.click(),A("prev",r,d)},className:"social-curation-nav-prev",children:m(S,{alt:"image",iconType:"chevronLeft"})}),m("div",{id:"olapic_specific_widget",onClick:e=>{const o=j(e.nativeEvent);if(q(e.nativeEvent,r,d),!o)return;v.current=!0,p.current=null;let a=0;const s=10,l=window.setInterval(()=>{const n=y();a+=1,(n||a>=s)&&window.clearInterval(l)},150)}}),x&&m(C,{tooltip:"Next",onClick:()=>{const e=document.querySelector(".olapic-nav-next");e&&e.click(),A("next",r,d)},className:"social-curation-nav-next",children:m(S,{alt:"image",iconType:"chevronRight"})})]}):null})})}})); 51//# sourceMappingURL=social-native-component-B1YZcdMn.js.map
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.