window.getData=async function(){try{const t=await fetch("https://tiktok.nfcube.com/index/whois");if(!t.ok)throw new Error(`Error fetching country data: ${t.status}`);const e=(await t.json()).country||"US",o=`https://tiktok.nfcube.com/api/v6?fu=0&limit=${tiktokFeedConfig.limit}&account=${tiktokFeedConfig.storeDomain}&fid=${tiktokFeedConfig.feedId}&extension=2&country=${e}`,i=await fetch(o);if(!i.ok)throw new Error(`Error fetching data: ${i.status}`);const n=(await i.json()).data.map((t=>function(t,e){let o=t;o=o.replace(/([?&])(autoplay|controls)=\d/g,"$1").replace(/&&/g,"&").replace(/[?&]$/,"");const i=o.includes("?")?"&":"?";return`${o}${i}autoplay=${e}&controls=1`}(t.videos.standard_resolution.url,tiktokFeedConfig.autoplayValue))),r=document.getElementById("juniper-tiktok-feed");r.style.display="grid",r.style.gridTemplateColumns=`repeat(${tiktokFeedConfig.columns}, 1fr)`,r.style.gridAutoRows="minmax(0, auto)",r.style.gap="10px",function(t,e,o){t.slice(0,o).forEach((t=>{const o=document.createElement("iframe");o.title="TikTok Video",o.loading="lazy",o.setAttribute("data-juniper-iframe-src",t),o.classList.add("juniper-tiktok-iframe"),e.appendChild(o)}))}(n,r,tiktokFeedConfig.maxVideos),function(t){const e=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){const o=t.target;o.src=o.getAttribute("data-juniper-iframe-src"),e.unobserve(o)}}))}),{rootMargin:"100px"});t.querySelectorAll(".juniper-tiktok-iframe").forEach((t=>e.observe(t)))}(r)}catch(t){console.error("Error:",t.message)}},window.isMobileDevice=function(){return window.matchMedia("(max-width: 768px)").matches},window.dispatchEvent(new Event("juniperAutoplayReady"));