/* domucgiare - Menu "San pham dich vu" ban 2 (12/10/2026) Khung tha xuong moi tren may tinh (>= 992px): tieu de + mo ta + "Xem tat ca", nhom Theo hang / Danh muc / Khu vuc, the anh + nut Goi/Zalo. Giu nguyen moi link goc (href) va menu tren dien thoai. Thay cho menu-v1. */ (function () { var LOC = /\s+(?:tại|ở)\s+(?:nhà\s+)?(?:ở\s+)?(?:khu\s+)?((?:quận|huyện|q\.)?\s*(?:Ba Đình|Hoàn Kiếm|Hai Bà Trưng|Đống Đa|Cầu Giấy|Thanh Xuân|Hoàng Mai|Long Biên|Tây Hồ|Bắc Từ Liêm|Nam Từ Liêm|Từ Liêm|Hà Đông|Gia Lâm|Đông Anh|Thanh Trì|Hoài Đức|Linh Đàm|Mỹ Đình|Sóc Sơn|Mê Linh|Chương Mỹ|Thanh Oai|Đan Phượng|Phú Diễn))(?:\s+Hà Nội)?\s*$/i; var BR = /^(canon|epson|brother|hp|samsung|ricoh|xerox|toshiba|sharp|konica minolta|konica|kyocera|fuji xerox|fujitsu|panasonic|lexmark|dell|lenovo|asus|acer|macbook)$/i; var OBJ = /^(?:máy\s+(?:in|photocopy|tính|scan|fax)(?:\s+(?:phun\s+màu|màu|laser|cũ|đen\s+trắng|nội\s+địa))*)\s+/i; var VERB = /^(sửa chữa|sửa|bán|đổ mực|thu mua|thay)\s+/i; var ICON = { tag: 'M21.4 11.6 12.4 2.6A2 2 0 0 0 11 2H4a2 2 0 0 0-2 2v7c0 .5.2 1 .6 1.4l9 9a2 2 0 0 0 2.8 0l7-7a2 2 0 0 0 0-2.8zM6.5 8a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z', grid: 'M3 3h8v8H3V3zm10 0h8v8h-8V3zM3 13h8v8H3v-8zm10 0h8v8h-8v-8z', pin: 'M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z', phone: 'M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 0 1 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1z', chk: 'M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z' }; function svg(k, s) { return '\x3csvg viewBox="0 0 24 24" width="' + (s || 14) + '" height="' + (s || 14) + '" aria-hidden="true">\x3cpath fill="currentColor" d="' + ICON[k] + '"/>\x3c/svg>'; } function esc(t) { return String(t || '').replace(/&/g, '&').replace(/"/g, '"').replace(/\x3c/g, '<'); } function tc(s) { return s.toLowerCase().replace(/(^|\s)(\S)/g, function (m, a, b) { return a + b.toUpperCase(); }); } function cap(s) { s = s.trim(); return s.charAt(0).toUpperCase() + s.slice(1); } function verbOf(s) { var m = s.match(VERB); return m ? m[1].toLowerCase().replace('sửa chữa', 'sửa') : ''; } function desc(p) { if (/^đào tạo|khóa học/i.test(p)) return 'Học thực hành trên máy thật tại Thần Vũ, học xong làm được việc.'; if (/thu mua/i.test(p)) return 'Định giá nhanh qua Zalo, thu mua tận nơi tại Hà Nội.'; if (/linh kiện/i.test(p)) return 'Linh kiện bóc máy và chính hãng, test kỹ trước khi giao.'; if (/văn phòng phẩm/i.test(p)) return 'Văn phòng phẩm giá tốt, giao nhanh trong nội thành.'; if (/^bán|cũ/i.test(p)) return 'Máy đã kiểm tra kỹ, test trước khi giao, có bảo hành.'; if (/đổ mực/i.test(p)) return 'Đổ mực tận nơi, bản in đẹp, có mặt nhanh trong nội thành.'; if (/^sửa|sửa/i.test(p)) return 'Kỹ thuật viên đến tận nơi, báo giá trước khi sửa, bảo hành rõ ràng.'; return 'Phục vụ tận nơi tại Hà Nội, tư vấn miễn phí qua điện thoại và Zalo.'; } function core(t) { var m = t.match(LOC); if (m) t = t.slice(0, m.index); t = t.replace(/\s+(?:tại|ở)\s+(?:nhà\s+)?(?:ở\s+)?Hà Nội\s*$/i, '').replace(/\s+tại nhà\s*$/i, '') .replace(/\s+(?:uy tín|chạy ổn định|giá rẻ|giá cao|đẹp)(?=\s|$)/ig, '').trim(); return t; } function norm(t) { return t.toLowerCase().replace(/\s*chữa\s*/g, ' ').replace(VERB, '').replace(/\s+/g, ' ').trim(); } function txt(a) { var c = a.cloneNode(true); [].forEach.call(c.querySelectorAll('i,svg,[class*=tvdm],[class*=badge]'), function (e) { e.remove(); }); return (c.textContent || a.textContent).trim().replace(/\s+/g, ' '); } function classify(parent, a) { var full = txt(a); var m = full.match(LOC), area = null; if (m) area = tc(m[1].trim().replace(/^q\.\s*/i, 'Quận ')); var s = core(full); var pv = verbOf(parent), cv = verbOf(s); if (cv && (cv === pv || cv === 'bán' && /linh kiện|bán/i.test(parent))) s = s.replace(VERB, ''); var rest = s.replace(OBJ, '').trim(); if (BR.test(rest) || BR.test(s.trim())) return { k: 'brand', t: tc(BR.test(rest) ? rest : s.trim()).replace(/^Hp$/, 'HP'), full: full, o: cap(((s.match(OBJ) || [''])[0]).trim().replace(/\s+(?:cũ|nội địa)$/i, '')) }; if (area) { var pc = norm(core(parent)), sc = norm(s); if (!sc || sc === pc || pc.indexOf(sc) === 0) return { k: 'area', t: area, full: full }; } return { k: 'item', t: cap(s.length >= 4 ? s : full), full: full }; } var css = '@media (min-width:992px){' + '.tvm-on > ul.dropdown-menu,.tvm-on > .title-parent,.tvm-on > .white-bg,.tvm-on > img{display:none!important}' + '.tvm-on > .tvm-p{display:none;position:absolute;top:0;left:calc(100% + 2px);width:820px;min-height:100%;box-sizing:border-box;background:#fff;border-radius:0 12px 12px 0;box-shadow:0 18px 40px rgba(16,34,66,.2);border-top:3px solid #d62828;z-index:1040;padding:16px 18px 14px;grid-template-columns:minmax(0,1fr) 210px;gap:18px;text-align:left;font-family:Arial,Helvetica,sans-serif;text-transform:none;line-height:1.35;cursor:default}' + '.tvm-on:hover > .tvm-p,.tvm-on.open > .tvm-p,.tvm-on:focus-within > .tvm-p{display:grid}' + '.tvm-on:hover > a,.tvm-on:focus-within > a{background:#f1f4f9!important;color:#d62828!important}' + '.tvm-p a{text-decoration:none!important;float:none!important;height:auto!important;background:none;white-space:normal!important;text-transform:none!important;margin:0!important;display:inline}' + '.tvm-hd{grid-column:1/-1;display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding-bottom:12px;border-bottom:1px solid #edf0f5}' + '.tvm-p a.tvm-tt{display:block!important;padding:0!important;font-size:18px!important;font-weight:700!important;color:#14284b!important;line-height:1.25!important}' + '.tvm-p a.tvm-tt:hover{color:#d62828!important}' + '.tvm-ds{margin:4px 0 0;font-size:13px;color:#5c6b80}' + '.tvm-p a.tvm-all{display:inline-flex!important;align-items:center;gap:6px;flex:0 0 auto;padding:7px 13px!important;border-radius:20px;background:#14284b!important;color:#fff!important;font-size:13px!important;font-weight:700!important;line-height:1.2!important}' + '.tvm-p a.tvm-all:hover{background:#d62828!important}' + '.tvm-mn{min-width:0;display:flex;flex-direction:column;gap:12px}' + '.tvm-gh{display:flex;align-items:center;gap:6px;margin:0 0 7px;font-size:11.5px;font-weight:700;letter-spacing:.7px;text-transform:uppercase;color:#5c6b80}' + '.tvm-gh svg{color:#d62828}' + '.tvm-ls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 14px}' + '.tvm-p a.tvm-l{display:flex!important;align-items:flex-start;gap:7px;padding:6px 8px!important;border-radius:7px;color:#14284b!important;font-size:13.5px!important;font-weight:400!important;line-height:1.35!important}' + '.tvm-p a.tvm-l:before{content:"";flex:0 0 6px;height:6px;margin-top:6px;border-radius:50%;background:#d62828;opacity:.75}' + '.tvm-p a.tvm-l:hover{background:#f1f4f9!important;color:#d62828!important}' + '.tvm-cs{display:flex;flex-wrap:wrap;gap:6px}' + '.tvm-p a.tvm-c{display:inline-block!important;padding:5px 11px!important;border:1px solid #dfe4ec;border-radius:16px;color:#14284b!important;font-size:13px!important;font-weight:400!important;line-height:1.3!important;background:#fff!important}' + '.tvm-p a.tvm-c:hover{border-color:#d62828;color:#d62828!important;background:#fff5f4!important}' + '.tvm-p a.tvm-c.b{font-weight:700!important;background:#f4f6fa!important}' + '.tvm-tr{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:auto;padding-top:10px;border-top:1px dashed #e3e7ee;font-size:12.5px;color:#1b7f3b;font-weight:700}' + '.tvm-tr span{display:inline-flex;align-items:center;gap:4px}' + '.tvm-cd{display:flex;flex-direction:column;gap:8px;min-width:0}' + '.tvm-p a.tvm-im{display:block!important;padding:0!important;border-radius:10px;overflow:hidden;background:#f4f6fa;line-height:0!important}' + '.tvm-p .tvm-im img{display:block!important;position:static!important;left:auto!important;top:auto!important;width:100%!important;height:auto!important;max-width:none!important;max-height:none!important;opacity:1!important;visibility:visible!important;transform:none!important}' + '.tvm-p a.tvm-bt{display:flex!important;align-items:center;justify-content:center;gap:6px;padding:9px 10px!important;border-radius:8px;font-size:13.5px!important;font-weight:700!important;line-height:1.2!important;color:#fff!important}' + '.tvm-p a.tvm-bt.c{background:#d62828!important}.tvm-p a.tvm-bt.c:hover{background:#b51f1f!important}' + '.tvm-p a.tvm-bt.z{background:#0068ff!important}.tvm-p a.tvm-bt.z:hover{background:#0052cc!important}' + '.tvm-p li.tvdm-cta{display:none!important}' + '}' + '@media (min-width:992px) and (max-width:1199px){.tvm-on > .tvm-p{width:680px;grid-template-columns:minmax(0,1fr) 170px}}'; function build(li) { if (li.getAttribute('data-tvm')) return; var a0 = li.querySelector(':scope > a'), ul = li.querySelector(':scope > ul'); if (!a0 || !ul) return; var links = [].slice.call(ul.querySelectorAll('a[href]')).filter(function (a) { return !/tvmg-all|tvdm/.test(a.className) && !a.closest('.tvdm-cta') && a.getAttribute('href') && a.getAttribute('href') !== '#'; }); if (!links.length) return; li.setAttribute('data-tvm', '1'); var parent = txt(a0); var href = a0.getAttribute('href'); var seen = {}, G = { brand: [], item: [], area: [] }; links.forEach(function (a) { var u = a.getAttribute('href'); if (seen[u]) return; seen[u] = 1; var c = classify(parent, a); c.u = u; G[c.k].push(c); }); var bl = G.brand.map(function (x) { return x.t; }); if (/văn phòng/i.test(parent) || bl.some(function (t, i) { return bl.indexOf(t) !== i; })) G.brand.forEach(function (x) { if (x.o) x.t = x.o + ' ' + x.t; }); if (G.brand.length === 1) { G.item.unshift({ k: 'item', t: G.brand[0].full, full: G.brand[0].full, u: G.brand[0].u }); G.brand = []; } var n = G.brand.length + G.item.length + G.area.length; var img = li.querySelector(':scope > img'); var h = '\x3cdiv class="tvm-hd">\x3cdiv>\x3ca class="tvm-tt" href="' + esc(href) + '">' + esc(parent) + '\x3c/a>\x3cp class="tvm-ds">' + desc(parent) + '\x3c/p>\x3c/div>' + '\x3ca class="tvm-all" href="' + esc(href) + '">Xem tất cả (' + n + ') →\x3c/a>\x3c/div>\x3cdiv class="tvm-mn">'; function chips(arr, b) { return '\x3cdiv class="tvm-cs">' + arr.map(function (x) { return '\x3ca class="tvm-c' + (b ? ' b' : '') + '" href="' + esc(x.u) + '" title="' + esc(x.full) + '">' + esc(x.t) + '\x3c/a>'; }).join('') + '\x3c/div>'; } if (G.brand.length) h += '\x3cdiv>\x3cp class="tvm-gh">' + svg('tag') + 'Theo hãng máy\x3c/p>' + chips(G.brand, 1) + '\x3c/div>'; if (G.item.length) h += '\x3cdiv>\x3cp class="tvm-gh">' + svg('grid') + (G.brand.length || G.area.length ? 'Theo loại máy, dịch vụ' : 'Danh mục') + '\x3c/p>\x3cdiv class="tvm-ls">' + G.item.map(function (x) { return '\x3ca class="tvm-l" href="' + esc(x.u) + '" title="' + esc(x.full) + '">' + esc(x.t) + '\x3c/a>'; }).join('') + '\x3c/div>\x3c/div>'; if (G.area.length) h += '\x3cdiv>\x3cp class="tvm-gh">' + svg('pin') + 'Khu vực phục vụ tại Hà Nội\x3c/p>' + chips(G.area) + '\x3c/div>'; if (/sửa|đổ mực/i.test(parent)) h += '\x3cdiv class="tvm-tr">\x3cspan>' + svg('chk') + 'Báo giá trước\x3c/span>\x3cspan>' + svg('chk') + 'Có mặt nhanh\x3c/span>\x3cspan>' + svg('chk') + 'Bảo hành rõ ràng\x3c/span>\x3c/div>'; h += '\x3c/div>\x3cdiv class="tvm-cd">'; if (img && img.getAttribute('src')) h += '\x3ca class="tvm-im" href="' + esc(href) + '" tabindex="-1">\x3cimg data-src="' + esc(img.getAttribute('src')) + '" alt="' + esc(img.getAttribute('alt') || parent) + '" width="400" height="502">\x3c/a>'; h += '\x3ca class="tvm-bt c" href="tel:0965305158">' + svg('phone') + '0965.305.158\x3c/a>' + '\x3ca class="tvm-bt z" href="https://zalo.me/0983504555" target="_blank" rel="noopener">Zalo báo giá nhanh\x3c/a>\x3c/div>'; var p = document.createElement('div'); p.className = 'tvm-p'; p.innerHTML = h; li.appendChild(p); li.classList.add('tvm-on'); var load = function () { var im = p.querySelector('img[data-src]'); if (im) { im.src = im.getAttribute('data-src'); im.removeAttribute('data-src'); } }; li.addEventListener('mouseenter', load); li.addEventListener('focusin', load); } function run() { if (!document.getElementById('tvm-css')) { var st = document.createElement('style'); st.id = 'tvm-css'; st.textContent = css; document.head.appendChild(st); } [].forEach.call(document.querySelectorAll('#product-nav-tree li.auto_dropdown, #product-nav-tree-slideshow li.auto_dropdown'), function (li) { try { build(li); } catch (e) {} }); } run(); window.addEventListener('load', run); })();