(function () { 'use strict'; if (window.__DBC_SHARED_SHELL_V7301__) return; window.__DBC_SHARED_SHELL_V7301__ = true; const identity = Object.freeze({ company: [ '世界杯竞猜官网新材料技术(上海)有限公司', 'DBC New Materials Technology (Shanghai) Co., Ltd.' ], phone: '+86 400 677 9978', phoneHref: 'tel:+864006779978', email: 'Bioten@dbc.cn', emailHref: 'mailto:Bioten@dbc.cn', siteUrl: '/', siteLabel: 'www.dbc.cn', icpUrl: 'https://beian.miit.gov.cn/', icpLabel: [ '沪ICP备2022003654号-1', 'ICP Registration No. 2022003654-1' ], logo: 'assets/images/brand/dbc-footer-lockup.png', logoWidth: 2214, logoHeight: 592, address: [ '中国 · 上海市闵行区朱建路158弄15号楼', 'Shanghai · Bldg. 15, Lane 158 Zhujian Rd., Minhang' ] }); const pathName = decodeURIComponent(window.location.pathname.split('/').pop() || 'index.html').toLowerCase(); const isHomepage = pathName === 'index.html' || pathName === '' || document.body.classList.contains('home-v23') || Boolean(document.querySelector('footer.v410-home-footer')); const pageIsEnglishReady = document.body.dataset.enReady === 'true' || document.documentElement.dataset.enReady === 'true'; function setLocalizedContent(element, pair) { if (!element) return; element.dataset.v7301Zh = pair[0]; element.dataset.v7301En = pair[1]; element.textContent = pair[0]; } function makeElement(tag, className) { const element = document.createElement(tag); if (className) element.className = className; return element; } function makeLink(className, href, text) { const link = makeElement('a', className); link.href = href; link.textContent = text; return link; } function buildIdentityBlock(existingEmail, tone) { const lightTone = tone === 'light'; const block = makeElement('div', 'v7301-footer-identity'); block.dataset.v7301FooterIdentity = 'standard'; block.dataset.v7301FooterTone = lightTone ? 'light' : 'dark'; const brand = makeLink('v7301-footer-identity__mark', 'index.html', ''); brand.setAttribute('aria-label', 'DBC 世界杯竞猜官网首页'); const logo = document.createElement('img'); logo.src = identity.logo; logo.alt = 'DBC 世界杯竞猜官网'; logo.width = identity.logoWidth; logo.height = identity.logoHeight; logo.loading = 'eager'; logo.decoding = 'async'; brand.appendChild(logo); const copy = makeElement('div', 'v7301-footer-identity__copy'); const company = makeElement('strong', 'v7301-footer-company'); setLocalizedContent(company, identity.company); const phone = makeLink('v7301-footer-phone', identity.phoneHref, identity.phone); const email = existingEmail || makeLink('v7301-footer-email', identity.emailHref, identity.email); email.classList.add('v7301-footer-email'); copy.append(company, phone, email); const companyColor = lightTone ? '#10283f' : '#fff'; const contactColor = lightTone ? '#587084' : 'rgba(255, 255, 255, .62)'; company.style.setProperty('color', companyColor, 'important'); company.style.setProperty('-webkit-text-fill-color', companyColor, 'important'); [phone, email].forEach(function (element) { element.style.setProperty('color', contactColor, 'important'); element.style.setProperty('-webkit-text-fill-color', contactColor, 'important'); }); block.append(brand, copy); return block; } function enhanceFormalFooter(footer) { const directory = footer.querySelector('.footer-directory'); if (directory) { directory.style.setProperty('grid-template-columns', 'var(--v7301-formal-footer-grid)', 'important'); directory.style.setProperty('gap', 'var(--v7301-formal-gap)', 'important'); directory.dataset.v7301FooterColumns = String(directory.querySelectorAll(':scope > .footer-column').length); directory.querySelectorAll(':scope > .v7301-footer-disclosure').forEach(function (details) { details.style.setProperty('display', 'block', 'important'); }); } const bottom = footer.querySelector('.footer-bottom'); if (!bottom || bottom.querySelector('[data-v7301-footer-identity]')) return; const legacyIdentity = bottom.querySelector(':scope > strong'); const existingEmail = footer.querySelector('.footer-legal a[href^="mailto:"]'); const lightTone = document.body.classList.contains('dv22-page') && footer.id !== 'dv22-dark-footer'; const block = buildIdentityBlock(existingEmail, lightTone ? 'light' : 'dark'); if (legacyIdentity) legacyIdentity.replaceWith(block); else bottom.prepend(block); } function enhanceBiotenFooter(footer) { const contact = footer.querySelector('.btf716-footer__contact'); if (!contact) return; contact.dataset.v7301FooterIdentity = 'standard'; } function normalizeFooterLogo(footer) { const logo = footer.querySelector([ '.v7301-footer-identity__mark img', '.btf716-footer__brandmark img', '.dev740-footer__identity img', '.observer-footer__mark img', '.bp7140-footer__brand > img', '.fs7301-footer__brand > img' ].join(',')); if (!logo) return; logo.src = identity.logo; logo.width = identity.logoWidth; logo.height = identity.logoHeight; logo.loading = 'eager'; logo.decoding = 'async'; logo.dataset.v7301FooterLogo = 'official-horizontal-lockup'; } function enhancePackagingFooter(footer) { const brand = footer.querySelector('.bp7140-footer__brand'); if (!brand || brand.querySelector('[data-v7301-footer-identity]')) return; const contact = makeElement('div', 'v7301-footer-contact'); contact.dataset.v7301FooterIdentity = 'standard'; const company = makeElement('strong', 'v7301-footer-company'); setLocalizedContent(company, identity.company); const phone = makeLink('v7301-footer-phone', identity.phoneHref, identity.phone); const existingEmail = footer.querySelector('.bp7140-footer__legal a[href^="mailto:"]'); const email = existingEmail || makeLink('v7301-footer-email', identity.emailHref, identity.email); email.classList.add('v7301-footer-email'); contact.append(company, phone, email); brand.appendChild(contact); } function enhanceDeveloperFooter(footer) { const contact = footer.querySelector('.dev740-footer__identity > div'); if (!contact) return; contact.dataset.v7301FooterIdentity = 'standard'; } function enhanceObserverFooter(footer) { const contact = footer.querySelector('.observer-footer__identity > div'); if (contact) contact.dataset.v7301FooterIdentity = 'standard'; const address = footer.querySelector('.observer-footer__bottom > :nth-child(3)'); if (address) { address.dataset.v7301IdentityAddress = 'true'; setLocalizedContent(address, identity.address); } } function enhanceFoodserviceFooter(footer) { const brand = footer.querySelector('.fs7301-footer__brand'); if (!brand || brand.querySelector('[data-v7301-footer-identity]')) return; const contact = makeElement('div', 'v7301-footer-contact'); contact.dataset.v7301FooterIdentity = 'standard'; const company = makeElement('strong', 'v7301-footer-company'); setLocalizedContent(company, identity.company); const phone = makeLink('v7301-footer-phone', identity.phoneHref, identity.phone); const email = makeLink('v7301-footer-email', identity.emailHref, identity.email); contact.append(company, phone, email); brand.appendChild(contact); } function ensureFooterCoreLinks(footer) { const legal = footer.querySelector([ '.footer-legal', '.btf716-footer__legal', '.bp7140-footer__legal', '.dev740-footer__legal', '.observer-footer__legal', '.fs7301-footer__inner > nav' ].join(',')); if (!legal) return; if (!footer.querySelector('a[href="/"], a[href=""]')) { const domain = makeLink('v7301-footer-core-link v7301-footer-domain', identity.siteUrl, identity.siteLabel); domain.target = '_blank'; domain.rel = 'noopener noreferrer'; legal.appendChild(domain); } if (!footer.querySelector('a[href^="sitemap.html"]')) { const sitemap = makeLink('v7301-footer-core-link v7301-footer-sitemap', 'sitemap.html', '网站地图'); setLocalizedContent(sitemap, ['网站地图', 'Sitemap']); legal.appendChild(sitemap); } if (!footer.querySelector('a[href^="privacy.html"]')) { const privacy = makeLink('v7301-footer-core-link v7301-footer-privacy', 'privacy.html', '隐私说明'); setLocalizedContent(privacy, ['隐私说明', 'Privacy']); legal.appendChild(privacy); } } function ensureFooterIcpLink(footer) { const legal = footer.querySelector([ '.v410-home-footer__legal', '.footer-legal', '.btf716-footer__legal', '.bp7140-footer__legal', '.dev740-footer__legal', '.observer-footer__legal', '.fs7301-footer__inner > nav' ].join(',')); if (!legal) return; let registration = Array.from(footer.querySelectorAll('a[href]')).find(function (link) { return link.href.indexOf('beian.miit.gov.cn') !== -1 || link.textContent.indexOf('沪ICP备2022003654号-1') !== -1; }); if (!registration) { registration = makeLink('v7301-footer-core-link v7301-footer-icp', identity.icpUrl, identity.icpLabel[0]); const reference = Array.from(legal.children).find(function (element) { if (element.tagName === 'A') { const href = element.getAttribute('href') || ''; return href.indexOf('sitemap.html') === 0 || href.indexOf('privacy.html') === 0 || href.charAt(0) === '#'; } return element.textContent.indexOf('©') !== -1; }); legal.insertBefore(registration, reference || null); } registration.classList.add('v7301-footer-core-link', 'v7301-footer-icp'); registration.href = identity.icpUrl; registration.target = '_blank'; registration.rel = 'noopener noreferrer'; setLocalizedContent(registration, identity.icpLabel); } function removeSingleLineClipping(footer) { const containers = footer.querySelectorAll([ '.footer-legal', '.btf716-footer__bottom', '.btf716-footer__legal', '.bp7140-footer__bottom', '.bp7140-footer__legal', '.dev740-footer__legal', '.observer-footer__bottom', '.fs7301-footer__inner > nav' ].join(',')); containers.forEach(function (container) { container.style.setProperty('overflow-x', 'visible', 'important'); container.style.setProperty('white-space', 'normal', 'important'); container.style.setProperty('text-overflow', 'clip', 'important'); Array.from(container.children).forEach(function (child) { child.style.setProperty('min-width', '0', 'important'); child.style.setProperty('max-width', '100%', 'important'); child.style.setProperty('overflow', 'visible', 'important'); child.style.setProperty('white-space', 'normal', 'important'); child.style.setProperty('text-overflow', 'clip', 'important'); child.style.setProperty('overflow-wrap', 'anywhere', 'important'); }); }); } function syncFormalDisclosures() { const mobile = window.matchMedia('(max-width: 33.75rem)').matches; document.querySelectorAll('.formal-site-footer .v7301-footer-disclosure').forEach(function (details) { if (mobile) { details.open = false; } else { details.open = true; } details.dataset.v7301DisclosureInitialized = 'true'; }); } function bindFormalDisclosures() { const footer = document.querySelector('.formal-site-footer'); if (!footer || footer.dataset.v7301DisclosureBound) return; footer.dataset.v7301DisclosureBound = 'true'; footer.addEventListener('toggle', function (event) { const details = event.target; if (!details.matches?.('.v7301-footer-disclosure') || !details.open) return; if (!window.matchMedia('(max-width: 33.75rem)').matches) return; footer.querySelectorAll('.v7301-footer-disclosure[open]').forEach(function (other) { if (other !== details) other.open = false; }); }, true); const query = window.matchMedia('(max-width: 33.75rem)'); if (typeof query.addEventListener === 'function') query.addEventListener('change', syncFormalDisclosures); else if (typeof query.addListener === 'function') query.addListener(syncFormalDisclosures); } function syncMobileTouchTargets() { const mobile = window.matchMedia('(max-width: 33.75rem)').matches; document.querySelectorAll('footer[data-v7301-shared-footer="true"] :is(a[href], summary, button)').forEach(function (element) { if (mobile) { element.style.setProperty('min-height', '44px', 'important'); element.style.setProperty('align-items', 'center', 'important'); if (element.tagName === 'A') element.style.setProperty('display', 'inline-flex', 'important'); element.dataset.v7301TouchTarget = '44'; } else if (element.dataset.v7301TouchTarget === '44') { element.style.removeProperty('min-height'); element.style.removeProperty('align-items'); element.style.removeProperty('display'); delete element.dataset.v7301TouchTarget; } }); } function bindMobileTouchTargets() { const query = window.matchMedia('(max-width: 33.75rem)'); if (typeof query.addEventListener === 'function') query.addEventListener('change', syncMobileTouchTargets); else if (typeof query.addListener === 'function') query.addListener(syncMobileTouchTargets); syncMobileTouchTargets(); } function applyIdentityLanguage() { const language = document.documentElement.dataset.lang === 'en' && pageIsEnglishReady ? 'en' : 'zh'; document.querySelectorAll('[data-v7301-zh]').forEach(function (element) { element.textContent = language === 'en' ? element.dataset.v7301En : element.dataset.v7301Zh; }); } let enforcingLanguage = false; function enforceCurrentPageLanguage() { if (pageIsEnglishReady || enforcingLanguage) return; if (document.documentElement.dataset.lang === 'zh' && document.documentElement.lang === 'zh-CN') return; enforcingLanguage = true; document.documentElement.dataset.lang = 'zh'; document.documentElement.lang = 'zh-CN'; document.documentElement.dataset.languageAvailability = 'zh-only'; applyIdentityLanguage(); document.dispatchEvent(new CustomEvent('dbc:languagechange', { detail: { language: 'zh', source: 'v7301-language-gate' } })); enforcingLanguage = false; } function init() { document.documentElement.dataset.v7301SharedShell = isHomepage ? 'homepage-excluded' : 'active'; document.body.dataset.v7301SharedShell = isHomepage ? 'homepage-excluded' : 'active'; document.body.dataset.v7301EffectiveLanguage = pageIsEnglishReady ? 'bilingual' : 'zh-only'; const footer = document.querySelector([ 'footer.v410-home-footer', 'footer.formal-site-footer', 'footer.btf716-footer', 'footer.dev740-footer', 'footer.bp7140-footer', 'footer.observer-footer', 'footer.fs7301-footer' ].join(',')); if (footer) ensureFooterIcpLink(footer); if (isHomepage) { applyIdentityLanguage(); return; } if (footer) { footer.dataset.v7301SharedFooter = 'true'; if (footer.classList.contains('formal-site-footer')) enhanceFormalFooter(footer); else if (footer.classList.contains('btf716-footer')) enhanceBiotenFooter(footer); else if (footer.classList.contains('dev740-footer')) enhanceDeveloperFooter(footer); else if (footer.classList.contains('bp7140-footer')) enhancePackagingFooter(footer); else if (footer.classList.contains('observer-footer')) enhanceObserverFooter(footer); else if (footer.classList.contains('fs7301-footer')) enhanceFoodserviceFooter(footer); ensureFooterCoreLinks(footer); ensureFooterIcpLink(footer); normalizeFooterLogo(footer); removeSingleLineClipping(footer); } bindFormalDisclosures(); syncFormalDisclosures(); bindMobileTouchTargets(); enforceCurrentPageLanguage(); applyIdentityLanguage(); const languageObserver = new MutationObserver(function () { enforceCurrentPageLanguage(); applyIdentityLanguage(); }); languageObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-lang', 'lang'] }); document.addEventListener('dbc:languagechange', function () { window.requestAnimationFrame(function () { enforceCurrentPageLanguage(); applyIdentityLanguage(); }); }); } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true }); else init(); })();