я косяк, поправил веб. Капитан, работайте!

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
влад
2026-07-16 11:06:47 +03:00
co-authored by Cursor
parent 148d645760
commit 2c294424ef
85 changed files with 17410 additions and 110 deletions
@@ -0,0 +1,40 @@
/**
* Видимость Lab-элементов на zootech-страницах (components и др.).
*/
(function (global) {
const HIDDEN_CLASS = "wesp-lab-access-hidden";
function ensureStyle() {
if (document.getElementById("wespLabAccessStyle")) return;
const style = document.createElement("style");
style.id = "wespLabAccessStyle";
style.textContent = `.${HIDDEN_CLASS}{display:none !important;}`;
document.head.appendChild(style);
}
function setHidden(el, hidden) {
if (!el) return;
el.classList.toggle(HIDDEN_CLASS, hidden);
if (hidden) {
el.setAttribute("aria-hidden", "true");
} else {
el.removeAttribute("aria-hidden");
}
}
function apply(canLab) {
ensureStyle();
global.WESP_CAN_LAB = Boolean(canLab);
document.documentElement.classList.toggle("wesp-no-lab", !canLab);
document.querySelectorAll("[data-wesp-lab-gated]").forEach((el) => {
setHidden(el, !canLab);
});
if (canLab) {
global.WespLabComponentsNutrients?.init?.();
}
}
global.WespLabAccess = { apply };
})(window);