/*! 2024. 7. 2. 오전 10:10:06 */ /******/ (() => { // webpackBootstrap var __webpack_exports__ = {}; const { EventManager, utils } = ShopbySkin; const slideMenuEL = document.querySelector('slide-menu'); const slideMenuClickActionMap = { CLOSE_SLIDE_MENU: () => { EventManager.fire('TOGGLE_HEADER_SLIDE_MENU', { type: 'close' }); }, TOGGLE_SLIDE_MENU_CHILD_CATEGORY: (e) => { const categoryWrapEl = e?.target?.closest('[shopby-category-no]'); EventManager.fire('TOGGLE_SLIDE_MENU_CHILD_CATEGORY', { wrapEl: categoryWrapEl, }); }, SIGN_OUT: () => { deleteCookie('ONE_SCAN'); EventManager.fire('SIGN_OUT'); }, GO_MY_MENU: (e) => { if (!utils.isSignedIn()) { e.preventDefault(); const from = e.target.href; const nextUrl = `${location.origin}/pages/sign-in/sign-in.html`; location.href = `${nextUrl}?from=${encodeURIComponent(from)}`; } }, // [Aaron] 카테고리 클릭 시 Category Content SDK 데이터 전송 CATEGORY_SDK: (e) => { const categoryDepth = $(e.target).data('category-depth'); let depth = 3; let clickedCateName = $(e.target).text().trim(); let parentCateName = $(e.target) .parents('.category-depth__2') .find('div > a') .text() .trim(); if (clickedCateName.includes('비교하기')){ const extractedName = clickedCateName.split("비교하기")[0].trim(); const result = extractedName === "Music" ? "AirPods" : extractedName; location.href = `/pages/compare/${result}/index.html`; return } // 2차 카테고리일 경우 if (categoryDepth === 2) { depth = 1; clickedCateName = null; parentCateName = $(e.target).text().trim(); } const categoryNo = $(e.target).closest('li').data('category-no'); const contentSdkScript = document.getElementById('contentSdk'); loadScript( 'https://cdn.c360a.salesforce.com/beacon/c360a/1280bbc3-f4db-4304-ac65-62d4dffa0242/scripts/c360a.min.js', contentSdkScript, async () => { const oneScanData = getOneScanData(); let vipId = null; if (utils.isSignIn()) vipId = await getVipId(); const params = { contentType: '', contentName: 'Category', vipId, ...oneScanData, Online_LOB: parentCateName, Online_SUBLOB: clickedCateName, }; //await sendCommonContentSdk(params); // 2024.11.18 LSG: Modifications to Category SDK // 바로 페이지 이동 시 SDK 전송이 제대로 안되는 현상으로 setTimeout 설정 setTimeout(() => { if (categoryNo === 819283) { // 멤버십 location.href = `/pages/board/post-detail.html?boardNo=279431&articleNo=881819`; } else if (categoryNo === 824048) { // EVENT location.href = `/pages/board/event-list.html`; } else if (categoryNo === 819161){ // 기업구매 location.href = `/pages/board/event-detail.html?boardNo=279431&articleNo=881818`; } else if (categoryNo === 1084232) { // 매장안내 location.href = `/pages/service/store.html`; } else if (categoryNo === 1084452) { // 주말 특가 할인 location.href = `/pages/event/event-detail.html?event=WeekSales`; } else { location.href = `/pages/product/product-list.html?categoryNo=${categoryNo}&depth=${depth}`; } }, 700); }, ); }, }; /** * [Aaron] Category Content SDK cdn 실행 후 SDK 전송 콜백함수 * [Aaron] + 카테고리 content SDK Script el이 이미 있는 페이지의 경우 중복 전송되어 스크립트 존재여부에 따라 분기처리 - 2024.09.30 update * @param url // script src * @param contentSdkScriptFl // contentSdk 스크립트 존재 여부 * @param callback // 콜백함수 */ function loadScript(url, contentSdkScriptFl, callback) { if (!contentSdkScriptFl) { const script = document.createElement('script'); script.src = url; script.onload = () => { if (callback) callback(); }; document.head.appendChild(script); } else { callback(); } } const clickEventListener = (e) => { const action = e?.target ?.closest('[shopby-action]') ?.getAttribute('shopby-action'); slideMenuClickActionMap[action]?.(e); }; slideMenuEL?.addEventListener('click', clickEventListener); // 2024.12.19 LSG: MD 추천 상단 카테고리 제거 // 2025.1.6 LSG: 이벤트 카테고리 중복 제거, 원스캔 프로모션 게시판 제거 setTimeout(() => { const mdPick = document.querySelector('[data-category-no="844928"]'); if (mdPick) { mdPick.style.display = 'none'; } const event = document.querySelectorAll('a[href="/pages/board/post-list.html?boardNo=279431"]'); if (event.length > 1) { event[1].parentElement.style.display = 'none'; } const promotion = document.querySelector('a[href="/pages/board/post-list.html?boardNo=279451"]'); if (promotion) { promotion.parentElement.style.display = 'none'; } }, 700); async function initMdPickSwiper() { try { await loadSwiperIfNeeded(); // 1) 기획전 API 호출 const { result, statusCode } = await callShopApi( '/display/events/', 'GET', utils.isSignIn() ? 'member' : null, ); if (statusCode !== 200) return; const items = (Array.isArray(result) ? result : (result?.items ?? [])) .filter((item) => item.id !== 'newProduct'); if (!items.length) return; const wrapper = document.querySelector('.slide-menu__mdpick-list'); if (!wrapper) return; const slidesHtml = items.reverse().map((item) => `