import{s as l,h as d}from"./utility.35c60188.js";import"./_commonjsHelpers.b8add541.js";const u=new ColorThief;function r(t){const e=u.getColor(t),o=`rgb(${e[0]}, ${e[1]}, ${e[2]})`;t.closest(".card").style.setProperty("--glow-color",o),t.closest(".card").classList.add("glow"),t.previousElementSibling.classList.add("d-none")}document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".card.style-6 img").forEach(function(e){e.setAttribute("crossorigin","anonymous"),e.complete?r(e):e.addEventListener("load",function(){r(e)})});const t=document.getElementById("skinPreviewModal");t.addEventListener("show.bs.modal",function(e){const o=e.relatedTarget,a=o.getAttribute("data-skin-image"),n=o.getAttribute("data-skin-name"),c=t.querySelector("#skinPreviewImage"),s=t.querySelector("#skinPreviewName");c.src=a,s.textContent=n}),document.querySelectorAll(".weapon-select-button").forEach(function(e){e.addEventListener("click",function(){const o=this.getAttribute("data-type"),a=document.querySelector("#weapon-"+o+"-pane"),n=a.querySelector('.lazy-content[data-type="'+o+'"]');l("skins_list_loader"),$(".tab-pane.active").hide(),fetch(weaponsLoadUrl+o).then(c=>c.text()).then(c=>{n.innerHTML=c,n.querySelectorAll("img").forEach(s=>{s.classList.add("lazy"),s.addEventListener("load",()=>{r(s),s.classList.add("loaded")})}),d("skins_list_loader"),$(".tab-pane.active").show(),i(a)})})})});function i(t){document.querySelector(".tab-pane.show.active").classList.remove("show","active"),t.classList.add("show","active");const o=document.querySelector(".nav-link.active");o&&o.classList.remove("active"),document.getElementById("weapon-dropdown-tab").classList.add("active")}y();function y(){l("skins_list_loader");const t="deagle",e=document.querySelector("#weapon-"+t+"-pane"),o=e.querySelector('.lazy-content[data-type="'+t+'"]');fetch(weaponsLoadUrl+t).then(a=>a.text()).then(a=>{o.innerHTML=a,o.querySelectorAll("img").forEach(n=>{n.classList.add("lazy"),n.addEventListener("load",()=>{r(n),n.classList.add("loaded")}),d("skins_list_loader")}),i(e)})}
