{"version":3,"names":[],"mappings":"","sources":["app.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i -1 ? 'Synactif' : 'null',\n productType: window.productCache.master ? 'master' : window.productCache.variant ? 'variant' : window.productCache.bundle ? 'bundle' : window.productCache.productSet ? 'productSet' : 'product'\n });\n } else {\n imageChangedFlag = true;\n }\n } else {\n initializationFlag = true;\n }\n observer.observe(targetNode, config);\n};\n\n// Function to confirm that slick.js has been loaded\nvar isSlickLoaded = function isSlickLoaded(mutationsList, observer) {\n observer.disconnect();\n\n var element = document.querySelector(\".slick-slide.slick-current.slick-active\");\n if (element) {\n // Activate tag submission observer as slick.js is completed\n observer = new MutationObserver(pushChangeImageDatalayer);\n config = { attributes: true, childList: false, subtree: false };\n targetNode = document.getElementsByClassName('slick-slide slick-current slick-active')[0];\n observer.observe(targetNode, config);\n } else {\n // Resume monitoring because slick.js is not finished\n observer.observe(targetNode, config);\n }\n};\n\n// Re-detect slick when color and variation changes are made\nfunction initObserver() {\n initializationFlag = false;\n imageChangedFlag = true;\n observer.disconnect();\n observer = new MutationObserver(isSlickLoaded);\n config = { attributes: true, childList: true, subtree: true };\n targetNode = document.getElementsByClassName('js-product-top-content')[0];\n observer.observe(targetNode, config);\n}\n\nvar observer = new MutationObserver(isSlickLoaded);\n\nfunction getPageCategory() {\n //return window.pageContext.title || \"Content\"; ###### this throws product name\n switch (window.Resources.PAGE_CATEGORY) {\n case 'product-showincategory':\n return 'Product Page';\n break;\n case 'product-show':\n return 'Product Page';\n break;\n case 'search-show':\n return 'Category Page';\n break;\n case 'home-show':\n return 'Home Page';\n break;\n case 'cart-show':\n return 'Cart Page';\n break;\n case 'cart-addtowishlist':\n return 'Cart Page';\n break;\n case 'customerservice-contactus':\n return 'Contact Customer Care';\n break;\n case 'customerservice-concierge':\n return 'Ask An Expert';\n break;\n case 'account-startregister':\n return 'Account Creation';\n break;\n case 'account-editprofile':\n return 'My Account';\n break;\n case 'address-list':\n return 'My Account';\n break;\n case 'paymentinstruments-list':\n return 'My Account';\n break;\n case 'wishlist-show':\n return 'My Account';\n break;\n case 'order-history':\n return 'My Account';\n break;\n case 'orderreplenishment-show':\n return 'My Account';\n break;\n case 'login-show':\n return 'Account Registration';\n break;\n case 'coshipping-start':\n return 'Checkout';\n break;\n case 'coshipping-singleshipping':\n return 'Checkout';\n break;\n case 'cobilling-start':\n return 'Checkout';\n break;\n case 'cobilling-billing':\n return 'Checkout';\n break;\n case 'search-showcontent':\n return 'Site Search';\n break;\n case 'giftcert-purchase':\n return 'Gift Card Page';\n break;\n case 'cocustomer-loginform':\n return 'Customer Login';\n break;\n case 'default-start':\n return 'Home Page';\n break;\n case 'search-brandify':\n return 'Store Locator Page';\n break;\n default:\n return 'Content';\n break;\n }\n}\n// Specific for checkout and cart page only\nfunction couponsubcategory() {\n switch (window.Resources.PAGE_CATEGORY) {\n case 'cart-show':\n return 'Cart';\n break;\n case 'coshipping-start':\n return 'Shipping';\n break;\n case 'coshipping-singleshipping':\n return 'Payment';\n break;\n case 'cobilling-start':\n return 'Payment';\n break;\n case 'cobilling-removegiftcertificate':\n return 'Payment';\n break;\n case 'cobilling-billing':\n return 'Review';\n break;\n case 'account-editprofile':\n return 'Profile';\n break;\n case 'address-list':\n return 'Addresses';\n break;\n case 'paymentinstruments-list':\n return 'Payment Methods';\n break;\n case 'wishlist-show':\n return 'Saved For Later';\n break;\n case 'order-history':\n return 'Order History';\n break;\n case 'orderreplenishment-show':\n return 'Replenishment';\n break;\n default:\n break;\n }\n}\n\nfunction isMobile() {\n return $(window).width() <= 640;\n}\n//Specific for PDP\nfunction getProductName() {\n return $('.product-detail .product-name').text().trim();\n}\n//Specific for PDP\nfunction getProductBrand() {\n return 'Shiseido'; //$(\".product-detail .product-brand\").text();\n}\n//Specific for PDP\nfunction getProductID() {\n return $('#pid').val();\n}\n//Specific for PDP\nfunction getProductCategory() {\n return $('.breadcrumb').find('.breadcrumb-element:eq(1)').text().trim();\n}\n//Specific for PDP\nfunction getProductsubCategory() {\n return $('.breadcrumb').find('.breadcrumb-element:eq(2)').text().trim();\n}\n// Specific for PDP\nfunction getProductsubsubCategory() {\n return $('.breadcrumb').find('.breadcrumb-element:eq(3)').text().trim();\n}\n// Specific for PDP\nfunction getProductOrederType() {\n var replen = $('.replenishmentCycle').val();\n if (replen > 0) {\n return 'Replenishment';\n } else {\n return 'Regular';\n }\n}\n\nfunction getPageSubcategory() {\n return window.pageContext.title || 'Content';\n}\n\nfunction getLanguage() {\n if (window.User.locale.indexOf('en') >= 0) {\n return 'English';\n } else if (window.User.locale.indexOf('cn') >= 0) {\n return 'Chinese';\n } else if (window.User.locale.indexOf('es') >= 0) {\n return 'Spanish';\n } else {\n return window.User.locale;\n }\n}\n\n// page-specific: Cart, Checkout\nfunction getPageError() {\n var $errorMsg = $('.error-form');\n if ($errorMsg.length === 0) {\n return '';\n }\n\n return $errorMsg.html().trim();\n}\n\nfunction getActiveSortingRule() {\n var httpParams = util.getQueryStringParams(window.location.href);\n var sortParam = httpParams['srule'];\n\n if (!sortParam) {\n return null;\n }\n\n return sortParam.split('-').map(function (w) {\n return w[0].toUpperCase() + w.substr(1);\n }).join(' ');\n}\n\nfunction pushToDataLayer(o) {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push(util.filterObj(o));\n //alert(JSON.stringify(util.filterObj(o)));\n}\n\nfunction isScrolledIntoView(elem) {\n var docViewTop = $(window).scrollTop();\n var docViewBottom = docViewTop + $(window).height() - 150;\n var elemTop = $(elem).offset().top;\n return elemTop <= docViewBottom && elemTop >= docViewTop;\n}\n\nfunction getpage() {\n var url = window.location.href;\n var splittedurl = url.split('?');\n var page = splittedurl[0].split('/');\n return page[page.length - 1];\n}\n//page-specific: PLP\nfunction getRefinementsFromURL() {\n var str = '';\n if (window.location.href.split('?').length > 1) {\n var urlparam;\n if (window.location.href.split('?')[1].indexOf('&') > -1) {\n urlparam = window.location.href.split('?')[1].split('&');\n var length = urlparam.length;\n var prefnval, prefnkey, prefvval, prefvkey;\n for (var i = 0; i < length; i++) {\n var prefn = urlparam[i].indexOf('prefn');\n if (prefn > -1) {\n prefnkey = urlparam[i].split('=')[0];\n prefnval = urlparam[i].split('=')[1];\n console.log(prefnkey);\n var num = prefnkey.charAt(5);\n for (var a = 0; a < length; a++) {\n var prefv = urlparam[a].indexOf('prefv');\n prefvkey = urlparam[a].split('=')[0];\n if (prefvkey == 'prefv' + num) {\n prefvval = urlparam[a].split('=')[1];\n str += '[' + prefnval + ':' + prefvval + ']';\n }\n }\n }\n }\n }\n }\n return str;\n}\n\nfunction trackConsultationEvent(data) {\n var TOOL_TYPES = {\n skincareConsultation: 'Skincare Consultation'\n };\n\n pushToDataLayer({\n event: 'consultation' + data.element[0].toUpperCase() + data.element.substr(1),\n pageCategory: 'Consultation Tool',\n consultationToolType: TOOL_TYPES[data.toolname] || data.toolname,\n consultationQuestion: data.question,\n consultationResponse: data.answers[0]\n });\n}\n\nfunction trackConsultationPageview(data) {\n pushToDataLayer({\n event: 'consultationSteps',\n pageCategory: 'Consultation Tool',\n consultationToolType: data.toolname,\n consultationStep: data.pagename\n });\n}\n\nfunction trackInternalPromotionEvent(data) {\n var promotionURL = data.pageName;\n\n pushToDataLayer({\n event: 'eePromoClick',\n pageSubCategory: data.pageSubCategory,\n pageCategory: data.pageCategory,\n promotions: [{\n position: data.position,\n id: data.id,\n creative: data.creative,\n name: data.name\n }]\n }), function () {\n setTimeout(function () {\n if (promotionURL != undefined) {\n document.location = promotionURL;\n }\n }, 1000);\n }();\n}\n\nfunction trackInternalPromotionPageView(data) {\n pushToDataLayer({\n eeAction: 'eePromoView',\n event: 'eePromoView',\n pageSubCategory: data.pageSubCategory,\n pageCategory: data.pageCategory,\n promotions: [{\n position: data.position,\n id: data.id,\n creative: data.creative,\n name: data.name\n }]\n });\n}\n\nfunction initializeGlobalEvents() {\n var navctr = true;\n var gtmNavData = '';\n\n $(document)\n // add to wishlist in pdp and quickview\n .on('click', '#save-for-later', function (e) {\n var data = $(this).data('catid');\n var productCategory = data.length > 0 ? data[0] : '';\n var productSubCategory = data.length > 1 ? data[1] : '';\n pushToDataLayer({\n event: 'clickSaveForLater',\n productCategory: productCategory,\n productSubCategory: productSubCategory,\n productName: window.productCache.name,\n productId: getProductID(),\n pageCategory: getPageCategory(),\n productOutOfStock: window.productCache.productOutOfStock,\n productAutoReplen: window.productCache.productautoreplenish,\n productColor: window.productCache.color ? window.productCache.color : 'null',\n collectionName: window.productCache.catid.toLowerCase().search('シナクティフ') > -1 ? 'Synactif' : 'null',\n productType: 'Product'\n });\n })\n\n // add to wishlist in cart\n .on('click', '.add-to-wishlist', function (e) {\n var index = $(this).parents('.cart-row').index();\n pushToDataLayer({\n event: 'clickSaveForLater',\n productCategory: basketConfirmation.productLineItems[index].category,\n productSubCategory: basketConfirmation.productLineItems[index].subCategory,\n productName: basketConfirmation.productLineItems[index].name,\n productId: basketConfirmation.productLineItems[index].id,\n pageCategory: getPageCategory(),\n productOutOfStock: $(this).data('instock'),\n productAutoReplen: $(this).data('replenishable'),\n productColor: $(this).parents('.c-list-products-full-item-text').first().find(\".c-dlist_03-item[data-attribute='color']\").length > 0 ? $(this).parents('.c-list-products-full-item-text').first().find(\".c-dlist_03-item[data-attribute='color'] dd\").text().trim() : 'null',\n collectionName: basketConfirmation.productLineItems[index].category.toLowerCase().search('synactif') > -1 ? 'Synactif' : 'null',\n productType: 'Product'\n });\n })\n\n // remove to wishlist PDP\n .on('click', '.remove-from-wishlist', function (e) {\n var data = $(this).data('catid');\n var productCategory = data.length > 0 ? data[0] : '';\n var productSubCategory = data.length > 1 ? data[1] : '';\n pushToDataLayer({\n event: 'removeFromWishlist',\n productCategory: productCategory,\n productSubCategory: productSubCategory,\n productName: window.productCache.name,\n productId: getProductID(),\n pageCategory: getPageCategory(),\n productOutOfStock: window.productCache.productOutOfStock,\n productAutoReplen: window.productCache.productautoreplenish,\n productColor: window.productCache.color ? window.productCache.color : 'null',\n collectionName: window.productCache.catid.toLowerCase().search('シナクティフ') > -1 ? 'Synactif' : 'null',\n productType: 'Product'\n });\n })\n\n // remove to wishlist from my account\n .on('click', '.c-list-products-full-item .delete-item', function (e) {\n var $target = $(this);\n var data = $target.data('catid');\n var productCategory = data.length > 0 ? data[0] : '';\n var productSubCategory = data.length > 1 ? data[1] : '';\n var productName = $target.data('productname');\n var productId = $target.data('productid');\n var productOutOfStock = $target.data('instock');\n var productAutoReplen = $target.data('replenishable');\n var productColor = $target.data('productcolor');\n\n pushToDataLayer({\n event: 'removeFromWishlist',\n productCategory: productCategory,\n productSubCategory: productSubCategory,\n productName: productName,\n productId: productId,\n pageCategory: getPageCategory(),\n productOutOfStock: productOutOfStock,\n productAutoReplen: productAutoReplen,\n productColor: productColor ? productColor : 'null',\n collectionName: productCategory.toLowerCase().search('シナクティフ') > -1 ? 'Synactif' : 'null',\n productType: 'Product'\n });\n })\n\n // newsletter in navigation;\n .on('clicknewsletter', function (e, data) {\n pushToDataLayer({\n event: 'newsletterSubscription',\n siteLocation: data.siteloc\n });\n })\n\n // click ask question in pdp\n .on('click', '.bv-ask-question', function (e) {\n pushToDataLayer({\n page: getpage(),\n event: 'askQuestion',\n productCategory: getProductCategory(),\n pageSubCategory: 'Ask a Question',\n productName: getProductName(),\n pageCategory: 'Product Page'\n });\n })\n\n // Scroll on reviews in pdp\n .scroll(function () {\n if ($('.bv-section-summary').length) {\n if (isScrolledIntoView('.bv-section-summary') && unbind < 1) {\n unbind = 1;\n pushToDataLayer({\n event: 'productReviewsView',\n page: getpage(),\n pageCategory: 'Product Page',\n productColor: window.productCache.productColor,\n productType: 'Product',\n collectionName: window.productCache.catid.toLowerCase().search('synactif') > -1 ? 'Synactif' : 'null'\n });\n }\n }\n\n // for recommendation in pdp and cart, Best Seller and Recently Viewed in Homepage\n if ($('.pi .carousel-recommendations').length > 0 || $('.cross-sell .carousel-recommendations').length > 0) {\n if (isScrolledIntoView('.carousel-recommendations') && unbindcarousel < 1) {\n unbindcarousel = 1;\n pushToDataLayer({\n currencyCode: window.User.currencyCode,\n eeAction: 'eeListView',\n event: 'eeListView',\n pageCategory: getPageCategory(),\n products: window.forpageload.product\n });\n }\n }\n })\n\n // Click on Reviews in PDP\n .on('click', '.bv-inline-histogram-ratings-star-container', function () {\n pushToDataLayer({\n event: 'productReviewsView',\n page: getpage(),\n pageCategory: 'Product Page',\n productColor: window.productCache.productColor,\n productType: 'Product',\n collectionName: window.productCache.catid.toLowerCase().search('synactif') > -1 ? 'Synactif' : 'null'\n });\n })\n\n // Check balance giftcard in gift card page\n .on('click', '#CheckBalanceButton', function () {\n if ($('#dwfrm_giftcert_balance_giftCertID').val() != '' && $('#dwfrm_giftcert_balance_giftCertPIN').val() != '') {\n pushToDataLayer({\n event: 'checkBalance',\n giftCardNumber: $('#dwfrm_giftcert_balance_giftCertID').val()\n //\t\t\t\t\t\"pageSubCategory\": \"Gift Card\",\n //\t\t\t\t\t\"pageCategory\": \"My Account\"\n });\n }\n })\n\n // Check balance giftcard in checkout modal\n .on('click', '#check-giftcert-modal', function (e) {\n if ($('#giftcardbalancemodal #dwfrm_billing_giftCertCode').val() != '' && $('#giftcardbalancemodal #dwfrm_giftcert_balance_giftCertPIN').val() != '') {\n pushToDataLayer({\n event: 'checkBalance',\n giftCardNumber: $('#giftcardbalancemodal #dwfrm_billing_giftCertCode').val()\n //\t\t\t\t\t\"pageSubCategory\": \"Payment\",\n //\t\t\t\t\t\"pageCategory\": \"Checkout\"\n });\n }\n })\n\n // Redeem gift card in checkout page\n .on('click', '.pt_checkout #add-giftcert', function () {\n if ($('.gift-card-form #dwfrm_billing_giftCertCode').val() != '' && $('.gift-card-form #dwfrm_giftcert_balance_giftCertPIN').val() != '') {\n pushToDataLayer({\n event: 'redeemGiftCard',\n giftCardNumber: $('.gift-card-form #dwfrm_billing_giftCertCode').val()\n });\n }\n })\n\n // Redeem gift card in checkout modal\n .on('click', '#add-giftcert-modal', function () {\n if ($('#giftcardbalancemodal #dwfrm_billing_giftCertCode').val() != '' && $('#giftcardbalancemodal #dwfrm_giftcert_balance_giftCertPIN').val() != '') {\n pushToDataLayer({\n event: 'redeemGiftCard',\n giftCardNumber: $('#giftcardbalancemodal #dwfrm_billing_giftCertCode').val()\n });\n }\n })\n\n // add to cart from PDP\n .on('click', '#add-to-cart', function (e) {\n if (getPageCategory() == 'Cart Page') {\n if (sessionStorage.getItem('cartupdate')) {\n sessionStorage.setItem('productUpdate', '1');\n }\n } else {\n window.productCache = window.productCache || {};\n pushToDataLayer({\n event: 'addToCart',\n //\"productOrderType\": getProductOrederType(),\n currencyCode: window.Resources.CURRENCY,\n addToCartType: $(this).parents('.quick-view').length ? 'Quick Shop' : 'Product Page',\n //\"pageCategory\": getPageCategory(),\n products: [{\n name: getProductName(),\n id: getProductID(),\n price: Number($('#add-to-cart').data('price')),\n brand: getProductBrand(),\n category: window.productCache.category,\n variant: $('.c-block-shopingmodal-side-size .c-tileradio-input:checked').parent().find('.c-tileradio-label-text').first().text().trim(),\n quantity: Number($('.c-quantitySelection .c-select-current').text().trim()),\n productAutoReplen: $('#add-to-cart').data('replenishable'),\n productColor: $('.c-list-color .c-list-color-panel.is-current').data('description'),\n productOutOfStock: $('#add-to-cart').data('instock'),\n collectionName: window.productCache.catid.toLowerCase().search('synactif') > -1 ? 'Synactif' : 'null',\n productType: 'Product',\n productStarRating: '',\n productVariantID: $('.c-block-shopingmodal-side-size .c-tileradio-input:checked').parent().find('.c-tileradio-label-text').first().text().trim() != '' && $('.c-list-color .c-list-color-panel.is-current').data('description') != '' ? getProductID() : 'null',\n numberOfProductReview: ''\n //\"subCategory\" : window.productCache.subcategory,\n //\"subSubCategory\" : window.productCache.subsubcategory,\n //\"productNumReviews\":\"\",\n }]\n });\n }\n })\n\n //Click at '+' on cart page\n .on('click', '.c-list-products-full-item--cart .c-quantitySelection-btn-plus', function () {\n sessionStorage.setItem('productUpdate', '1');\n var index = $(this).parents('.cart-row').index();\n var product = basketConfirmation.productLineItems[index];\n\n pushToDataLayer({\n event: 'addToCart',\n addToCartType: 'Cart Page',\n currencyCode: basketConfirmation.currencyCode,\n products: [{\n name: product.name,\n id: product.id,\n price: product.price,\n brand: product.brand,\n category: product.category,\n variant: product.size,\n quantity: 1,\n productAutoReplen: product.productAutoReplen,\n productColor: product.color,\n productOutOfStock: product.productOutOfStock,\n collectionName: product.collectionName,\n productType: product.productType,\n productStarRating: product.productStarRating,\n productVariantID: product.productVariantID,\n numberOfProductReview: product.numberOfProductReview\n }]\n });\n })\n\n //Click at '-' on cart page\n .on('click', '.c-list-products-full-item--cart .c-quantitySelection-btn-minus', function () {\n sessionStorage.setItem('productUpdate', '1');\n var index = $(this).parents('.cart-row').index();\n var product = basketConfirmation.productLineItems[index];\n if (product.quantity > 1) {\n pushToDataLayer({\n event: 'removeFromCart',\n addToCartType: 'Cart Page',\n currencyCode: basketConfirmation.currencyCode,\n products: [{\n name: product.name,\n id: product.id,\n price: product.price,\n brand: product.brand,\n category: product.category,\n variant: product.size,\n quantity: 1,\n productAutoReplen: product.productAutoReplen,\n productColor: product.color,\n productOutOfStock: product.productOutOfStock,\n collectionName: product.collectionName,\n productType: product.productType,\n productStarRating: product.productStarRating,\n productVariantID: product.productVariantID,\n numberOfProductReview: product.numberOfProductReview\n }]\n });\n }\n })\n\n //Click change quantity on cart page\n .on('click', '.c-list-products-full-item--cart .c-quantitySelection .c-quantitySelection-num .c-select-list a', function () {\n sessionStorage.setItem('productUpdate', '1');\n var index = $(this).parents('.cart-row').index();\n var product = basketConfirmation.productLineItems[index];\n if ($(this).text() != '') {\n pushToDataLayer({\n event: Number($(this).text().trim()) - product.quantity > 0 ? 'addToCart' : 'removeFromCart',\n addToCartType: 'Cart Page',\n currencyCode: basketConfirmation.currencyCode,\n products: [{\n name: product.name,\n id: product.id,\n price: product.price,\n brand: product.brand,\n category: product.category,\n variant: product.size,\n quantity: Math.abs(Number($(this).text().trim()) - product.quantity),\n productAutoReplen: product.productAutoReplen,\n productColor: product.color,\n productOutOfStock: product.productOutOfStock,\n collectionName: product.collectionName,\n productType: product.productType,\n productStarRating: product.productStarRating,\n productVariantID: product.productVariantID,\n numberOfProductReview: product.numberOfProductReview\n }]\n });\n }\n })\n\n // Submit ask a question\n .on('click', \".bv-submission-section button:contains('Post Question')\", function (e) {\n pushToDataLayer({\n //\"page\": getpage(),\n event: 'submitQuestion',\n //\"productCategory\": getProductCategory(),\n question: $('#bv-textarea-field-questionsummary').val(),\n //\"productName\": getProductName(),\n //\"pageSubCategory\": \"Ask a Question\",\n pageCategory: getPageCategory()\n });\n })\n\n // remove from cart\n .on('click', '.c-list-products-full-remove a', function (e) {\n var index = $(this).parents('.cart-row').index();\n pushToDataLayer({\n event: 'removeFromCart',\n currencyCode: window.Resources.CURRENCY,\n addToCartType: getPageCategory(),\n //\"productOrderType\": ($(this).parents(\".cart-row\").find(\".replenishment .replenishmentDays\").length > 0) ? \"Replenishment\" : \"Regular\",\n //\"pageCategory\": getPageCategory(),\n products: [{\n name: basketConfirmation.productLineItems[index].name,\n id: basketConfirmation.productLineItems[index].id,\n price: basketConfirmation.productLineItems[index].price,\n brand: getProductBrand(),\n category: basketConfirmation.productLineItems[index].category,\n variant: basketConfirmation.productLineItems[index].size,\n quantity: basketConfirmation.productLineItems[index].quantity,\n productAutoReplen: basketConfirmation.productLineItems[index].productAutoReplen,\n productColor: basketConfirmation.productLineItems[index].productColor,\n productType: basketConfirmation.productLineItems[index].productType,\n productOutOfStock: basketConfirmation.productLineItems[index].productAutoReplen.productOutOfStock,\n collectionName: basketConfirmation.productLineItems[index].category == 'Synactif' ? 'Synactif' : 'null',\n productStarRating: '',\n productVariantID: '',\n numberOfProductReview: basketConfirmation.productLineItems[index].size != '' && basketConfirmation.productLineItems[index].productColor != '' ? basketConfirmation.productLineItems[index].id : 'null'\n }]\n });\n })\n // click zoom in pdp\n .on('click', '.c-block-shopingmodal-main-image .c-modal-img', function (e) {\n pushToDataLayer({\n event: 'productInteraction',\n interactionType: 'Zoom',\n productCategory: window.productCache.catid,\n productSubCategory: window.productCache.subcategory,\n productName: window.productCache.name,\n productId: window.productCache.ID,\n pageCategory: getPageCategory(),\n productOutOfStock: window.productCache.productOutOfStock,\n productAutoReplen: window.productCache.productautoreplenish,\n productColor: window.productCache.productColor,\n collectionName: window.productCache.catid.toLowerCase().search('シナクティフ') > -1 ? 'Synactif' : 'null',\n productType: window.productCache.master ? 'master' : window.productCache.variant ? 'variant' : window.productCache.bundle ? 'bundle' : window.productCache.productSet ? 'productSet' : 'product'\n });\n })\n\n // click full ingredients in pdp\n .on('click', '.cpb-products-summary_cover .cpb-products-summary_tab_list a', function (e) {\n var interactionType = $(this).data('tab-target');\n switch (interactionType) {\n case 'content1':\n interactionType = 'About The Product';\n break;\n case 'content2':\n interactionType = 'Features';\n break;\n case 'content3':\n interactionType = 'How To Use';\n break;\n case 'content4':\n interactionType = 'View Full Product Ingredients';\n break;\n default:\n interactionType = 'Other Content';\n break;\n }\n pushToDataLayer({\n event: 'productInteraction',\n interactionType: interactionType,\n productCategory: window.productCache.catid,\n productSubCategory: window.productCache.subcategory,\n productName: window.productCache.name,\n productId: window.productCache.ID,\n pageCategory: getPageCategory(),\n productOutOfStock: window.productCache.productOutOfStock,\n productAutoReplen: window.productCache.productautoreplenish,\n productColor: window.productCache.productColor,\n collectionName: window.productCache.catid.toLowerCase().search('シナクティフ') > -1 ? 'Synactif' : 'null',\n productType: window.productCache.master ? 'master' : window.productCache.variant ? 'variant' : window.productCache.bundle ? 'bundle' : window.productCache.productSet ? 'productSet' : 'product'\n });\n }).on('click', '.cart-promo-approaching', function () {\n pushToDataLayer({\n event: 'eePromoClick',\n pageSubCategory: 'Internal marketing',\n pageCategory: 'Cart Page',\n promotions: [{\n position: 'Cart',\n id: $('.cart-promo-approaching').data('promoid'),\n creative: 'Cart-Banner',\n name: $('.cart-promo-approaching').data('promoname')\n }]\n });\n }).on('click', '.cart-coupon-code #add-coupon', function () {\n localStorage.removeItem('couponvalidation');\n })\n\n // track share button on PDP\n .on('click', '.social-sharing-container .share-icon', function () {\n pushToDataLayer({\n socialAction: 'Share',\n event: 'socialShare',\n siteLocation: 'product page',\n pageCategory: getPageCategory(),\n socialNetwork: $(this).data('share')\n });\n })\n\n // Track Follow button on Footer\n .on('click', '.ge-footer-connectWithUs-icon li a', function () {\n pushToDataLayer({\n event: 'socialClick',\n socialNetwork: $(this).find('title').length > 0 ? $(this).find('title').text().trim() : 'null',\n socialAction: 'Follow',\n siteLocation: 'footer',\n pageCategory: getPageCategory()\n });\n })\n\n // Add to Cart in Save for later\n .on('click', '.wishlist-item .add-to-cart', function () {\n var index = $(this).parents('form').index();\n pushToDataLayer({\n currencyCode: window.Resources.CURRENCY,\n event: 'addToCart',\n //\"productOrderType\": getProductOrederType(),\n addToCartType: getPageCategory(),\n pageSubCategory: getProductsubCategory(),\n pageCategory: getPageCategory(),\n products: [{\n id: wishlistItem.product[index].id,\n category: wishlistItem.product[index].category,\n price: wishlistItem.product[index].price,\n name: wishlistItem.product[index].name,\n brand: wishlistItem.product[index].brand,\n quantity: wishlistItem.product[index].quantity,\n size: wishlistItem.product[index].size,\n subCategory: wishlistItem.product[index].subcategory,\n subSubCategory: wishlistItem.product[index].subcategory,\n productAutoReplen: wishlistItem.product[index].productAutoReplen,\n productOutOfStock: wishlistItem.product[index].productOutOfStock,\n productColor: wishlistItem.product[index].color,\n productType: 'Product',\n productNumReviews: '',\n productStarRating: ''\n }]\n });\n })\n\n // Add to all to Cart\n .on('click', '.add-all-to-cart', function () {\n pushToDataLayer({\n currencyCode: window.Resources.CURRENCY,\n event: 'addToCart',\n //\"productOrderType\": getProductOrederType(),\n addToCartType: getPageCategory(),\n pageSubCategory: getProductsubCategory(),\n pageCategory: getPageCategory(),\n products: wishlistItem.product\n });\n })\n\n // click email hyper link in navigation\n .on('click', '#header .emailcsr-nav', function () {\n if (window.Resources.PAGE_CATEGORY == 'page-show') {\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Email',\n siteLocation: 'Header',\n //\t\t\t\t\t\"pageSubCategory\": couponsubcategory(),\n pageCategory: getProductCategory()\n });\n } else {\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Email',\n siteLocation: 'Header',\n pageSubCategory: window.Resources.PAGE_CATEGORY == 'cart-show' ? '' : couponsubcategory(),\n pageCategory: getPageCategory()\n });\n }\n })\n // Click email link in the customer care\n //\t\t.on(\"click\",\".content-asset a:contains('customercare@cledepeaubeaute.com')\",function(){\n //\t\t\tpushToDataLayer({\n //\t\t\t\t\"event\": \"contactRequest\",\n //\t\t\t\t\"contactType\": \"Email\",\n //\t\t\t\t\"siteLocation\": window.Resources.PAGE_CATEGORY==\"cart-show\" ? \"Right Nav\":\"Body\",\n ////\t\t\t\t\"pageSubCategory\": couponsubcategory(),\n //\t\t\t\t\"pageCategory\": window.Resources.PAGE_CATEGORY==\"cart-show\" ? getPageCategory(): getProductCategory()\n //\t\t\t});\n //\t\t})\n\n .on('gtmcontactus', function () {\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Contact Customer Care Submission',\n siteLocation: 'Body',\n pageCategory: getPageCategory()\n });\n }).on('askanexpert', function () {\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Ask An Expert Submission',\n siteLocation: 'Body',\n pageSubCategory: couponsubcategory(),\n pageCategory: 'Ask An Expert'\n });\n }).on('click', '#header .live-chat', function () {\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Live Chat',\n siteLocation: 'Header',\n pageSubCategory: couponsubcategory(),\n pageCategory: getPageCategory()\n });\n }).on('click', '#header .call-us', function () {\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Call Us',\n siteLocation: 'Header',\n pageSubCategory: couponsubcategory(),\n pageCategory: getPageCategory()\n });\n }).on('click', '.LPMimage', function () {\n var id = $(this).attr('id');\n var chk = id.charAt(id.length - 1);\n if (chk == 1) {\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Live Chat',\n siteLocation: 'Pop-up',\n pageSubCategory: couponsubcategory(),\n pageCategory: getPageCategory()\n });\n }\n }).on('click', '.footer-container .products ul li:nth-child(4)', function () {\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Phone',\n siteLocation: 'Footer',\n pageSubCategory: window.Resources.PAGE_CATEGORY == 'cart-show' ? '' : couponsubcategory(),\n pageCategory: getPageCategory()\n });\n })\n\n // click on recommendation\n .on('click', '.recommendation-item', function () {\n if (getPageCategory() == 'Product Page') {\n sessionStorage.setItem('listType', 'Recommended Product List');\n sessionStorage.setItem('listName', 'Product Page');\n } else if (getPageCategory() == 'Home Page') {\n sessionStorage.setItem('listType', 'Recently Viewed List');\n sessionStorage.setItem('listName', 'Home Page');\n }\n }).on('click', '.catalog-link', function (e) {\n if (navctr == true) {\n gtmNavData = $(this).text().trim();\n sessionStorage.setItem('navlink', gtmNavData);\n sessionStorage.setItem('menuloc', 'topmenu');\n util.setCookie('navdata', gtmNavData, 0.2);\n navctr = false;\n }\n }).on('click', '.cmd-cross-nav_list a', function (e) {\n if (navctr == true) {\n gtmNavData = $(this).text().trim();\n sessionStorage.setItem('navlink', gtmNavData);\n sessionStorage.setItem('menuloc', 'topmenu');\n util.setCookie('navdata', gtmNavData, 0.2);\n navctr = false;\n }\n }).on('click', '.cpb-gnav_container .cpb-gnav_list a', function (e) {\n gtmNavData = $(this).text().trim();\n sessionStorage.setItem('navlink', gtmNavData);\n sessionStorage.setItem('menuloc', 'leftmenu');\n util.setCookie('navdata', gtmNavData, 0.2);\n }).on('click', '.cpb-gnav_container .cpb-gnav-utility_list a', function (e) {\n gtmNavData = $(this).text().trim();\n sessionStorage.setItem('navlink', gtmNavData);\n sessionStorage.setItem('menuloc', 'leftmenu');\n util.setCookie('navdata', gtmNavData, 0.2);\n }).on('click', '.cpb-modal_account .cpb-account_area a', function (e) {\n gtmNavData = $(this).text().trim();\n sessionStorage.setItem('navlink', gtmNavData);\n sessionStorage.setItem('menuloc', 'myacountmenu');\n util.setCookie('navdata', gtmNavData, 0.2);\n }).on('click', '.refinement-header', function (e) {\n gtmNavData = $(this).text().trim();\n sessionStorage.setItem('navlink', gtmNavData);\n sessionStorage.setItem('menuloc', 'leftmenu');\n }).on('click', '.refinement-link', function (e) {\n gtmNavData = $(this).text().trim();\n sessionStorage.setItem('navlink', gtmNavData);\n sessionStorage.setItem('menuloc', 'leftmenu');\n }).on('click', '.breadcrumb-element', function (e) {\n gtmNavData = $(this).text().trim();\n sessionStorage.setItem('breadcrumbs', gtmNavData);\n sessionStorage.setItem('menuloc', 'leftmenu');\n }).on('change', '#quantity', function (e) {\n if (getPageCategory() == 'Cart Page') {\n if ($('.edit-modal').length > 0) {\n sessionStorage.setItem('cartupdate', '1');\n } else {\n sessionStorage.setItem('productUpdate', '1');\n }\n }\n }).on('change', '.quantity-select', function (e) {\n if (window.Resources.PAGE_CATEGORY == 'wishlist-show') {\n sessionStorage.setItem('productUpdate', '1');\n }\n }).on('click', '.c-list-sideNavi li', function (e) {\n gtmNavData = $(this).text().trim();\n sessionStorage.setItem('navlink', gtmNavData);\n sessionStorage.setItem('menuloc', 'leftmenu');\n })\n\n // Remove uservalidation attribute for userlogin validation and product update\n .on('click', '.user-logout', function (e) {\n localStorage.removeItem('uservalidation');\n sessionStorage.removeItem('productUpdate');\n }).on('click', '#pdp-swatches.c-block-shopingmodal-side-color a, .c-block-shopingmodal-side-colorSelect .c-select-list-item', function () {\n if (getPageCategory() == 'Cart Page') {\n sessionStorage.setItem('cartupdate', '1');\n }\n }).on('click', '.mfp-close', function () {\n if (getPageCategory() == 'Cart Page') {\n sessionStorage.setItem('cartupdate', '');\n }\n }).on('click', '#save-for-later', function () {\n if (getPageCategory() == 'Cart Page') {\n sessionStorage.setItem('cartupdate', '');\n }\n }).on('click', '#pdp-swatches .selectable', function () {\n if (getPageCategory() == 'Cart Page') {\n if (!$(this).hasClass('selected')) {\n sessionStorage.setItem('cartupdate', '1');\n }\n }\n }).on('click', '.search-suggestion-wrapper .hit', function () {\n gtmNavData = $(this).text().trim();\n sessionStorage.setItem('navlink', gtmNavData.replace(/\\s\\s+/g, ' '));\n sessionStorage.setItem('menuloc', 'site search pop-in');\n }).on('click', '.search-suggestion-wrapper .product-suggestion', function () {\n gtmNavData = $(this).text().trim();\n var rep = gtmNavData.replace(/\\n/g, ' ');\n sessionStorage.setItem('navlink', rep.replace(/ +/g, ' '));\n sessionStorage.setItem('menuloc', 'site search pop-in');\n })\n\n // PLP click in list\n .on('click', '.c-product-cards-list .c-product-cards-list-item a.c-product-cards-photo-img', function () {\n var index = $(this).parents('.c-product-cards-list-item').index('.c-product-cards-list-item');\n var url = $(this).attr('href');\n if (index >= 0) {\n if (productData.page >= 1) {\n pushToDataLayer({\n event: 'eeListClick',\n eeAction: 'eeListClick',\n pageCategory: searchItems.search ? 'Site Search' : 'Product List Page',\n page: url ? url : 'null',\n products: [prodholder[index]]\n }), function () {\n setTimeout(function () {\n if (url != undefined && url != null) {\n document.location = url;\n }\n }, 1000);\n }();\n sessionStorage.setItem('listType', prodholder[index].listType);\n sessionStorage.setItem('listName', prodholder[index].listName);\n } else {\n pushToDataLayer({\n event: 'eeListClick',\n eeAction: 'eeListClick',\n pageCategory: searchItems.search ? 'Site Search' : 'Product List Page',\n page: url ? url : 'null',\n products: [prodholder[0][index]]\n }), function () {\n setTimeout(function () {\n if (url != undefined && url != null) {\n document.location = url;\n }\n }, 1000);\n }();\n sessionStorage.setItem('listType', prodholder[0][index].listType);\n sessionStorage.setItem('listName', prodholder[0][index].listName);\n }\n }\n })\n\n // PLP click in list\n .on('click', '.c-product-cards-list .c-product-cards-list-item .c-product-cards-text a', function () {\n var index = $(this).parents('.c-product-cards-list-item').index('.c-product-cards-list-item');\n var url = $(this).attr('href');\n if (index >= 0) {\n if (productData.page > 0) {\n pushToDataLayer({\n event: 'eeListClick',\n eeAction: 'eeListClick',\n pageCategory: searchItems.search ? 'Site Search' : 'Product List Page',\n page: url ? url : 'null',\n products: [prodholder[index]]\n }), function () {\n setTimeout(function () {\n if (url != undefined && url != null) {\n document.location = url;\n }\n }, 1000);\n }();\n sessionStorage.setItem('listType', prodholder[index].listType);\n sessionStorage.setItem('listName', prodholder[index].listName);\n } else {\n pushToDataLayer({\n event: 'eeListClick',\n eeAction: 'eeListClick',\n pageCategory: searchItems.search ? 'Site Search' : 'Product List Page',\n page: url ? url : 'null',\n products: [prodholder[0][index]]\n }), function () {\n setTimeout(function () {\n if (url != undefined && url != null) {\n document.location = url;\n }\n }, 1000);\n }();\n sessionStorage.setItem('listType', prodholder[0][index].listType);\n sessionStorage.setItem('listName', prodholder[0][index].listName);\n }\n }\n })\n\n // Recommendation, bestseller eelistclick in homepage,pdp,cart\n .on('click', '.pi .carousel-recommendations .recommendation-item', function (e) {\n var index = $(this).index() - 3;\n if (_typeof(prodData.product[index]) != undefined && prodData.product[index] != null) {\n pushToDataLayer({\n event: 'eeListClick',\n pageSubCategory: '',\n pageCategory: getPageCategory(),\n filterChoice: '',\n dropDown: '',\n products: [{\n listType: prodData.product[index].listType,\n listName: prodData.product[index].listName,\n position: prodData.product[index].position,\n id: prodData.product[index].id,\n category: getProductCategory(),\n price: prodData.product[index].price,\n name: prodData.product[index].name,\n brand: getProductBrand(),\n quantity: prodData.product[index].quantity,\n size: prodData.product[index].size,\n subCategory: prodData.product[index].subCategory,\n subSubCategory: prodData.product[index].subSubCategory,\n productAutoReplen: prodData.product[index].productAutoReplen,\n productOutOfStock: prodData.product[index].productOutOfStock,\n productColor: prodData.product[index].productColor,\n productType: prodData.product[index].productType,\n productNumReviews: '',\n productStarRating: ''\n }]\n });\n sessionStorage.setItem('listType', prodData.product[index].listType);\n sessionStorage.setItem('listName', prodData.product[index].listName);\n }\n })\n\n // Recently viewed eelistclick in homepage\n .on('click', '.cross-sell .carousel-recommendations ul .recommendation-item', function (e) {\n var index = $(this).index() - 3;\n if (_typeof(prodData.product[index]) != undefined && prodData.product[index] != null) {\n pushToDataLayer({\n event: 'eeListClick',\n pageSubCategory: '',\n pageCategory: getPageCategory(),\n filterChoice: '',\n dropDown: '',\n products: [{\n listType: prodData.product[index].listType,\n listName: prodData.product[index].listName,\n position: prodData.product[index].position,\n id: prodData.product[index].id,\n category: getProductCategory(),\n price: prodData.product[index].price,\n name: prodData.product[index].name,\n brand: getProductBrand(),\n quantity: prodData.product[index].quantity,\n size: prodData.product[index].size,\n subCategory: prodData.product[index].subCategory,\n subSubCategory: prodData.product[index].subSubCategory,\n productAutoReplen: prodData.product[index].productAutoReplen,\n productOutOfStock: prodData.product[index].productOutOfStock,\n productColor: prodData.product[index].productColor,\n productType: prodData.product[index].productType,\n productNumReviews: '',\n productStarRating: ''\n }]\n });\n sessionStorage.setItem('listType', prodData.product[index].listType);\n sessionStorage.setItem('listName', prodData.product[index].listName);\n }\n })\n\n // click on viewmore button\n .on('plpviewmore', function (e) {\n if (getPageCategory() == 'Category Page') {\n if (prodholder && _typeof(productData.product) != undefined) {\n if (productData.page > 1) {\n prodholder = prodholder.concat(productData.product);\n } else {\n prodholder = prodholder[0].concat(productData.product);\n }\n\n for (var i = 0; i < prodholder.length; i++) {\n prodholder[i].position = i + 1;\n }\n for (var a = 0; a < productData.product.length; a++) {\n var diff = productData.product.length - a;\n productData.product[a].position = prodholder.length - diff + 1;\n }\n pushDtLayer({\n event: 'eeListView',\n eeAction: 'eeListView',\n pageCategory: searchItems.search ? 'Site Search' : 'Product List Page',\n dropDown: '',\n filterChoice: '',\n currencyCode: window.User.currencyCode,\n products: productData.product || new Array()\n });\n }\n }\n }).on('click', '.c-block-shopingmodal-main-thumbnail .slick-slide', function () {\n $(document).trigger('clickproductthumbnail');\n })\n // change color\n .on('click', '.cpb-products-color_list li a', function (e) {\n pushToDataLayer({\n event: 'productInteraction',\n interactionType: 'Color Change',\n productCategory: window.productCache.catid,\n productSubCategory: window.productCache.subcategory,\n productName: window.productCache.name,\n productId: window.productCache.ID,\n pageCategory: getPageCategory(),\n productOutOfStock: window.productCache.productOutOfStock,\n productAutoReplen: window.productCache.productautoreplenish,\n productColor: window.productCache.productColor,\n collectionName: window.productCache.catid.toLowerCase().search('シナクティフ') > -1 ? 'Synactif' : 'null',\n productType: window.productCache.master ? 'master' : window.productCache.variant ? 'variant' : window.productCache.bundle ? 'bundle' : window.productCache.productSet ? 'productSet' : 'product'\n });\n initObserver();\n })\n // change variation\n .on('click', '.c-tileradio-list .c-tileradio-list-item label', function (e) {\n pushToDataLayer({\n event: 'productInteraction',\n interactionType: 'Variant Change',\n productCategory: window.productCache.catid,\n productSubCategory: window.productCache.subcategory,\n productName: window.productCache.name,\n productId: window.productCache.ID,\n pageCategory: getPageCategory(),\n productOutOfStock: window.productCache.productOutOfStock,\n productAutoReplen: window.productCache.productautoreplenish,\n productColor: window.productCache.productColor,\n collectionName: window.productCache.catid.toLowerCase().search('シナクティフ') > -1 ? 'Synactif' : 'null',\n productType: window.productCache.master ? 'master' : window.productCache.variant ? 'variant' : window.productCache.bundle ? 'bundle' : window.productCache.productSet ? 'productSet' : 'product'\n });\n initObserver();\n })\n // click on next arrow recommendation carousel and best seller\n .on('click', '.pi .carousel-recommendations .slick-next', function (e) {\n if ((typeof prodData === 'undefined' ? 'undefined' : _typeof(prodData)) != undefined && prodData != null) {\n var array = new Array();\n var listholder = new Array();\n var listchecker = false;\n var listctr = 0;\n $('.recommendation-item').each(function (index) {\n if ($('.recommendation-item').filter('.slick-active').length == 3) {\n if (index > 2 && $(this).hasClass('slick-active')) {\n array.push(index - 3);\n }\n } else {\n if (index > 2 && ($(this).hasClass('slick-active') || $(this).hasClass('slick-current'))) {\n listctr = 2;\n if (prodData.product.length > 3) {\n listchecker = true;\n listctr = 0;\n }\n array.push(index - 3);\n } else {\n if (listchecker && listctr < 2 && index > 2 && array.length <= 3) {\n if (array[array.length] != index - 3) {\n listctr += 1;\n array.push(index - 3);\n }\n } else {\n listchecker = false;\n }\n }\n }\n });\n for (var i = 0; i < prodData.product.length; i++) {\n for (var a = 0; a < array.length; a++) {\n if (i == array[a]) {\n listholder.push(prodData.product[i]);\n }\n }\n }\n pushToDataLayer({\n currencyCode: window.User.currencyCode,\n eeAction: 'eeListView',\n event: 'eeListView',\n pageCategory: getPageCategory(),\n products: listholder\n });\n }\n })\n\n // click on next arrow recommendation carousel and best seller\n .on('click', '.pi .carousel-recommendations .slick-prev', function (e) {\n if ((typeof prodData === 'undefined' ? 'undefined' : _typeof(prodData)) != undefined && prodData != null) {\n var array = new Array();\n var listholder = new Array();\n var listchecker = false;\n var listctr = 0;\n $('.recommendation-item').each(function (index) {\n if ($('.recommendation-item').filter('.slick-active').length == 3) {\n if (index > 2 && $(this).hasClass('slick-active')) {\n array.push(index - 3);\n }\n } else {\n if (index > 2 && ($(this).hasClass('slick-active') || $(this).hasClass('slick-current'))) {\n listctr = 2;\n if (prodData.product.length > 3) {\n listchecker = true;\n listctr = 0;\n }\n array.push(index - 3);\n } else {\n if (listchecker && listctr < 2 && index > 2 && array.length <= 3) {\n if (array[array.length] != index - 3) {\n listctr += 1;\n array.push(index - 3);\n }\n } else {\n listchecker = false;\n }\n }\n }\n });\n for (var i = 0; i < prodData.product.length; i++) {\n for (var a = 0; a < array.length; a++) {\n if (i == array[a]) {\n listholder.push(prodData.product[i]);\n }\n }\n }\n pushToDataLayer({\n currencyCode: window.User.currencyCode,\n eeAction: 'eeListView',\n event: 'eeListView',\n pageCategory: getPageCategory(),\n products: listholder\n });\n }\n })\n\n // click on next arrow recently viewed\n .on('click', '.cross-sell .carousel-recommendations .slick-next', function (e) {\n if ((typeof prodData === 'undefined' ? 'undefined' : _typeof(prodData)) != undefined && prodData != null) {\n var array = new Array();\n var listholder = new Array();\n $('.recommendation-item').each(function (index) {\n if (index > 2 && $(this).hasClass('slick-active')) {\n array.push(index - 3);\n }\n });\n for (var i = 0; i < prodData.product.length; i++) {\n for (var a = 0; a < array.length; a++) {\n if (i == array[a]) {\n listholder.push(prodData.product[i]);\n }\n }\n }\n pushToDataLayer({\n currencyCode: window.User.currencyCode,\n eeAction: 'eeListView',\n event: 'eeListView',\n pageCategory: getPageCategory(),\n products: listholder\n });\n }\n })\n\n // click on next arrow recently viewed\n .on('click', '.cross-sell .carousel-recommendations .slick-prev', function (e) {\n if ((typeof prodData === 'undefined' ? 'undefined' : _typeof(prodData)) != undefined && prodData != null) {\n var array = new Array();\n var listholder = new Array();\n $('.recommendation-item').each(function (index) {\n if (index > 2 && $(this).hasClass('slick-active')) {\n array.push(index - 3);\n }\n });\n for (var i = 0; i < prodData.product.length; i++) {\n for (var a = 0; a < array.length; a++) {\n if (i == array[a]) {\n listholder.push(prodData.product[i]);\n }\n }\n }\n pushToDataLayer({\n currencyCode: window.User.currencyCode,\n eeAction: 'eeListView',\n event: 'eeListView',\n pageCategory: getPageCategory(),\n products: listholder\n });\n }\n })\n\n // pdp fire when variation was change\n .on('gtvariationchange', function (e) {\n if (getPageCategory() == 'Product Page') {\n pushToDataLayer({\n eeAction: 'eeProductDetail',\n event: 'eeProductDetail',\n pageCategory: 'Product Page',\n products: [{\n listType: sessionStorage.getItem('listType'),\n listName: sessionStorage.getItem('listName'),\n id: pdpdata.defalutvariant ? pdpdata.defalutvariant : pdpdata.ID,\n category: pdpdata.category,\n price: pdpdata.pricing.sale ? pdpdata.pricing.sale : pdpdata.pricing.minprice,\n name: pdpdata.name,\n brand: pdpdata.brand,\n quantity: pdpdata.quantity,\n size: pdpdata.size,\n subCategory: pdpdata.subcategory,\n subSubCategory: pdpdata.subsubcategory,\n productAutoReplen: pdpdata.productautoreplenish,\n productOutOfStock: pdpdata.productOutOfStock,\n productColor: pdpdata.productColor,\n productType: 'Product',\n productNumReviews: '',\n productStarRating: ''\n }]\n });\n }\n })\n\n // quickview action\n .on('click', '.c-product-cards-quickshop-toggle', function () {\n var index = $(this).parents('.c-product-cards-list-item').index('.c-product-cards-list-item');\n if (productData.product.length > 0 && prodholder[0].length > index) {\n pushToDataLayer({\n eeAction: 'eeProductDetail',\n event: 'eeProductDetail',\n pageCategory: 'Category Page',\n products: [prodholder[0][index]]\n });\n }\n })\n\n // filter\n .on('click', '.c-block-products-search-panel--filter .c-select .c-select-list-item a', function () {\n pushToDataLayer({\n event: 'dropDownChoice',\n dropDownType: 'Filter',\n listType: 'product category list',\n listName: $('.c-title-pageHeading-title').length > 0 ? $('.c-title-pageHeading-title').text().trim() : 'null',\n filterChoice: $(this).length > 0 ? $(this).text().trim() : 'null'\n });\n })\n\n // sort\n .on('click', '.c-block-products-search-panel--sort .c-select .c-select-list-item a', function () {\n pushToDataLayer({\n event: 'dropDownChoice',\n dropDownType: 'Sort',\n listType: 'product category list',\n listName: $('.c-title-pageHeading-title').length > 0 ? $('.c-title-pageHeading-title').text().trim() : 'null',\n filterChoice: $(this).length > 0 ? $(this).text().trim() : 'null'\n });\n })\n\n // Transaction funnel steps - shipping to payment\n .on('click', 'button[name=\"dwfrm_singleshipping_shippingAddress_save\"]', function () {\n pushToDataLayer({\n event: 'eeCheckoutOption',\n checkoutStep: '1',\n checkoutOption: sessionStorage.getItem('productUpdate') != '' ? sessionStorage.getItem('productUpdate') : '0'\n });\n })\n\n // Transaction funnel step - payment to review\n .on('click', 'button[name=\"dwfrm_billing_save\"]', function () {\n pushToDataLayer({\n event: 'eeCheckoutOption',\n checkoutStep: '2',\n checkoutOption: basketConfirmation.defaultShipping\n });\n })\n\n // Transaction funnel step - review to confirmation\n .on('click', '.pt_checkout #summary-place-order', function () {\n pushToDataLayer({\n event: 'eeCheckoutOption',\n checkoutStep: '3',\n checkoutOption: basketConfirmation.paymentMethod\n });\n\n sessionStorage.setItem('productUpdate', '');\n })\n\n // subscription on account registration page\n .on('click', '.pt_account #register-new-account', function () {\n if ($('input[name=\"dwfrm_profile_customer_addtoemaillist\"]').prop('checked')) {\n $(document).trigger('clicknewsletter', {\n siteloc: 'account registration page'\n });\n sessionStorage.setItem('subscription', true);\n } else {\n sessionStorage.setItem('subscription', false);\n }\n })\n\n // subscription on profile page\n .on('click', '.pt_account #profile-save-changes', function () {\n if ($('input[name=\"dwfrm_profile_customer_addtoemaillist\"]').prop('checked') && sessionStorage.getItem('subscription') == 'false') {\n $(document).trigger('clicknewsletter', { siteloc: 'profile page' });\n sessionStorage.setItem('subscription', true);\n }\n }).on('click', '.c-block-languagselection li a', function () {\n pushToDataLayer({\n event: 'changeLanguage',\n language: $(this).length > 0 ? $(this).text().trim() : 'null'\n });\n })\n\n // Store locator interaction rate. click header\n .on('click', '.header-shop_btn a', function () {\n pushToDataLayer({\n event: 'storeLocator',\n pageCategory: getPageCategory()\n });\n })\n\n // Store locator interaction rate in pdp\n .on('click', '.cpb-products-shop .cpb-products-cart_submit:first-child', function () {\n pushToDataLayer({\n event: 'storeLocator',\n pageCategory: getPageCategory()\n });\n })\n\n // Store locator interaction rate in toppage header navigation\n .on('click', '.cmd-cross-nav_list li:nth-child(6)', function () {\n pushToDataLayer({\n event: 'storeLocator',\n pageCategory: getPageCategory()\n });\n })\n\n // Contact form submission rate in footer\n .on('click', '.cpb-footer-nav_container .cpb-footer-nav_list .contactus', function () {\n var socialNetwork = $(this).text().trim();\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Email',\n siteLocation: 'Body',\n pageCategory: getPageCategory()\n });\n })\n // Contact form submission rate in contact us page\n .on('click', '.cmd-button_box .contactus', function () {\n var socialNetwork = $(this).text().trim();\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Email',\n siteLocation: 'Body',\n pageCategory: getPageCategory()\n });\n })\n // Contact form submission rate in global account menu\n .on('click', '.account-menu_list .contactus', function () {\n var socialNetwork = $(this).text().trim();\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Email',\n siteLocation: 'Body',\n pageCategory: getPageCategory()\n });\n })\n // Contact form submission rate account page menu\n .on('click', '.c-list-sideNavi .contactus', function () {\n var socialNetwork = $(this).text().trim();\n pushToDataLayer({\n event: 'contactRequest',\n contactType: 'Email',\n siteLocation: 'Body',\n pageCategory: getPageCategory()\n });\n })\n\n // Social attractivity(PDP)\n .on('click', '.item-link_sns_box .item-link_sns_list li a', function () {\n var socialNetwork = $(this).text().trim();\n pushToDataLayer({\n event: 'socialClick',\n socialNetwork: socialNetwork,\n socialAction: 'shere',\n siteLocation: 'product page',\n pageCategory: getPageCategory()\n });\n })\n\n // Social attractivity(footer)\n .on('click', '.cpb-footer-sns_wrapper .cpb-footer-sns_list .list-item:not(.cpb-app) a', function () {\n var socialNetwork = $(this).text().trim();\n pushToDataLayer({\n event: 'socialClick',\n socialNetwork: socialNetwork,\n socialAction: 'shere',\n siteLocation: 'footer',\n pageCategory: getPageCategory()\n });\n })\n\n // change product shade\n .on('click', '#ymk-modal_right a.swatchanchor', function () {\n var childThatHasColorText = $(this).find('.c-list-color-panel');\n if (childThatHasColorText == null) return;\n\n pushToDataLayer({\n event: \"youCamTryOnInteraction\",\n tryOnInteraction: \"change product shade\",\n productName: productCache.name,\n productColor: childThatHasColorText.attr('data-description')\n });\n });\n\n if (targetNode) {\n observer.observe(targetNode, config);\n }\n}\n\nswitch (gtCurPage) {\n case 'page-show':\n var contentsAssetID = window.location.href.split('/').pop().split('.')[0];\n if (contentsAssetID == 'synactif-top') {\n var products = [];\n $(document).find('.cmd-section_products .cmd-col-card_link').each(function (index) {\n products.push({\n name: $(this).data('name'),\n id: $(this).data('id'),\n price: $(this).data('price'),\n brand: getProductBrand(),\n category: 'Synactif',\n variant: $(this).data('variant'),\n list: 'product category list > Synactif',\n position: index + 1,\n collectionName: 'Synactif'\n });\n });\n }\n pushDtLayer({\n event: 'eeListView',\n eeAction: 'eeListView',\n currencyCode: window.User.currencyCode,\n pageCategory: 'Product List Page',\n pageSubCategory: 'Product Search Results',\n products: products\n });\n break;\n}\n\nmodule.exports = {\n init: function init() {\n initializeGlobalEvents();\n },\n tagmanager: {\n click: function click(data) {\n return trackConsultationEvent(data);\n },\n\n pageview: function pageview(data) {\n return trackConsultationPageview(data);\n }\n },\n gtmInternalPromotion: {\n click: function click(data) {\n return trackInternalPromotionEvent(data);\n },\n\n pageview: function pageview(data) {\n return trackInternalPromotionPageView(data);\n }\n }\n};\n\n},{\"./util\":78}],3:[function(require,module,exports){\n'use strict';\n\nvar analytics = require('./analytics'),\n countries = require('./countries'),\n dialog = require('./dialog'),\n quickview = require('./quickview'),\n minicart = require('./minicart'),\n page = require('./page'),\n rating = require('./rating'),\n searchplaceholder = require('./searchplaceholder'),\n searchsuggest = require('./searchsuggest'),\n tooltip = require('./tooltip'),\n util = require('./util'),\n validator = require('./validator'),\n slick = require('./slick'),\n tls = require('./tls'),\n video = require('./video'),\n headerMenu = require('./header-menu'),\n footerSelector = require('./footer-selector'),\n newsletter = require('./newsletter'),\n orderreplenishment = require('./order-replenishment'),\n inputEntry = require('./input-entry'),\n producttile = require('./product-tile'),\n design = require('./design'),\n newDesign = require('./new-design'),\n login = require('./login'),\n hanatsubaki_club_member_id_edit = require('./hanatsubaki_club_member_id_edit'),\n loading = require('./loading'),\n ajax = require('./ajax'),\n dd = require('./dd');\n\n//if jQuery has not been loaded, load from google cdn\nif (!window.jQuery) {\n var s = document.createElement('script');\n\n s.setAttribute('src', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js');\n s.setAttribute('type', 'text/javascript');\n\n document.getElementsByTagName('head')[0].appendChild(s);\n}\n\nrequire('./jquery-ext')();\nrequire('./cookieprivacy')();\n//require('./captcha')();\n\nfunction initializeEvents() {\n var controlKeys = ['8', '13', '46', '45', '36', '35', '38', '37', '40', '39'];\n\n $('body').on('keydown', 'textarea[data-character-limit]', function (e) {\n var text = $.trim($(this).val()),\n charsLimit = $(this).data('character-limit'),\n charsUsed = text.length;\n\n if (charsUsed >= charsLimit && controlKeys.indexOf(e.which.toString()) < 0) {\n e.preventDefault();\n }\n }).on('change keyup mouseup', 'textarea[data-character-limit]', function () {\n var text = $(this).val(),\n charsLimit = $(this).data('character-limit'),\n charsUsed = text.length,\n charsRemain = charsLimit - charsUsed;\n\n if (charsRemain < 0) {\n $(this).val(text.slice(0, charsRemain));\n charsRemain = 0;\n }\n\n $(this).closest('.field-wrapper').find('.char-remain-count').html(charsRemain);\n });\n\n /**\r\n * initialize search suggestions, pending the value of the site preference(enhancedSearchSuggestions)\r\n * this will either init the legacy(false) or the beta versions(true) of the the search suggest feature.\r\n * */\n var $searchContainer = $('.utility-nav .header-search');\n\n searchsuggest.init($searchContainer, Resources.SIMPLE_SEARCH);\n\n // add show/hide navigation elements\n $('.secondary-navigation .toggle').click(function () {\n $(this).toggleClass('expanded').next('ul').toggle();\n });\n\n // add generic toggle functionality\n $('.toggle').next('.toggle-content').hide();\n $('.toggle').click(function () {\n $(this).toggleClass('expanded').next('.toggle-content').toggle();\n });\n\n // subscribe email box\n var $subscribeEmail = $('.subscribe-email');\n\n if ($subscribeEmail.length > 0) {\n $subscribeEmail.focus(function () {\n var val = $(this.val());\n\n if (val.length > 0 && val !== Resources.SUBSCRIBE_EMAIL_DEFAULT) {\n return; // do not animate when contains non-default value\n }\n\n $(this).animate({\n color: '#999999'\n }, 500, 'linear', function () {\n $(this).val('').css('color', '#333333');\n });\n }).blur(function () {\n var val = $.trim($(this.val()));\n\n if (val.length > 0) {\n return; // do not animate when contains value\n }\n\n $(this).val(Resources.SUBSCRIBE_EMAIL_DEFAULT).css('color', '#999999').animate({\n color: '#333333'\n }, 500, 'linear');\n });\n }\n\n if (SitePreferences.MOTIONPOINT_ENABLED) {\n $('#chooseLanguage').on('click', function (e) {\n e.preventDefault();\n\n var script = document.createElement('script');\n\n //MP.SrcUrl = unescape('mp_js_orgin_url'); - commented out per MotionPoint\n MP.UrlLang = 'mp_js_current_lang';\n MP.oSite = decodeURIComponent('mp_js_origin_baseUrl');\n MP.tSite = decodeURIComponent('mp_js_translated_baseUrl');\n\n MP.init();\n\n script.src = 'https://shiseidoamericas.mpeasylink.com/mpel/mpel_chooser.js';\n\n document.body.appendChild(script);\n\n return false;\n });\n }\n\n $('.privacy-policy').on('click', function (e) {\n e.preventDefault();\n\n dialog.open({\n url: $(e.target).attr('href'),\n options: {\n height: 600\n }\n });\n });\n\n if ($('.order-confirmation-details').length) {\n sessionStorage.removeItem('isGift');\n sessionStorage.removeItem('giftMessage');\n }\n\n var url = Urls.passwordReset;\n\n if ($('.reset-password-link').length) {\n if (location.protocol === 'https:') {\n url = Urls.securePasswordReset;\n }\n\n $('.reset-password-link').each(function () {\n $(this).find('a').attr('href', url);\n });\n }\n\n if ($('.user-recognized').length) {\n if (location.protocol === 'https:') {\n url = Urls.securePasswordReset;\n }\n\n $('.user-recognized').find('a').attr('href', url);\n }\n\n // checkout checkout minicart on right side event handling\n addSummaryScrollbar();\n //quick view\n producttile.initQuickViewButtons();\n producttile.initColorChange();\n\n $(document).on('click', '.js-modal-c_close, .js-modal-c_overlay', function (e) {\n var skinCheckModal = $(this).parents('#skin-trouble-check-modal');\n if (skinCheckModal.length === 0) {\n return;\n }\n //クイックビュー用一時確保formを削除する。\n $('.quickview-form').remove();\n });\n\n // For product set\n if ($('#product-set').length > 0) {\n setTotalPrice();\n }\n}\n\n/**\r\n * @private\r\n * @function\r\n * @description Adds class ('js') to html for css targeting and loads js specific styles.\r\n */\nfunction initializeDom() {\n // add class to html for css targeting\n $('html').addClass('js');\n\n if (SitePreferences.LISTING_INFINITE_SCROLL) {\n $('html').addClass('infinite-scroll');\n }\n\n // load js specific styles\n util.limitCharacters();\n}\n\nfunction backToTopHandler() {\n $(document).on('scroll', function () {\n if ($(window).scrollTop() > 100) {\n $('.scroll-top-wrapper').addClass('show');\n } else {\n $('.scroll-top-wrapper').removeClass('show');\n }\n });\n\n $('.scroll-top-wrapper').on('click', scrollToTop);\n}\n\nfunction scrollToTop(e) {\n e.preventDefault();\n var verticalOffset = typeof verticalOffset != 'undefined' ? verticalOffset : 0;\n var element = $('body');\n var offset = element.offset();\n var offsetTop = offset.top;\n\n $('html, body').animate({\n scrollTop: offsetTop\n }, 500, 'linear');\n}\n\n// Minimize header and make it stick to the top\nfunction minimizedHeaderHandler() {\n checkScrolledDown();\n\n $(window).scroll(function () {\n checkScrolledDown();\n });\n}\n\nfunction checkScrolledDown() {\n var $stickyHeader = $('#minimized-header-container');\n var $headerScrollOffset = $('.header-banner').outerHeight();\n var $wrapper = $('#wrapper');\n\n if ($('body').hasClass('is-reveal-open')) {\n return false;\n }\n\n if ($(window).scrollTop() > $headerScrollOffset) {\n $stickyHeader.addClass('sticky-header');\n $wrapper.css('padding-top', $stickyHeader.outerHeight());\n } else {\n $stickyHeader.removeClass('sticky-header');\n $wrapper.css('padding-top', 0);\n }\n}\n\nfunction responsiveMegaMenu() {\n var $dropdowns = $('.level-1 li.has-sub-menu');\n\n $dropdowns.on('keydown', function (e) {\n var $this = $(this);\n\n if (e.keyCode === 13) {\n if (!$this.hasClass('hover')) {\n e.preventDefault();\n\n $dropdowns.removeClass('hover');\n $this.addClass('hover');\n }\n }\n\n if (e.keyCode === 32) {\n e.preventDefault();\n $dropdowns.removeClass('hover');\n }\n });\n\n $dropdowns.hover(function () {\n var $this = $(this);\n if ($this.prop('hoverTimeout')) {\n $this.prop('hoverTimeout', clearTimeout($this.prop('hoverTimeout')));\n }\n $this.prop('hoverIntent', setTimeout(function () {\n $this.addClass('hover');\n }, 200));\n }, function () {\n var $this = $(this);\n if ($this.prop('hoverIntent')) {\n $this.prop('hoverIntent', clearTimeout($this.prop('hoverIntent')));\n }\n $this.prop('hoverTimeout', setTimeout(function () {\n $this.removeClass('hover');\n }, 200));\n });\n\n if ('ontouchstart' in document.documentElement && window.innerWidth >= 640) {\n $dropdowns.each(function () {\n var $this = $(this);\n\n this.addEventListener('touchstart', function (e) {\n if (e.touches.length === 1) {\n e.stopPropagation();\n\n if (!$this.hasClass('hover')) {\n if (e.target === this || e.target.parentNode === this) {\n e.preventDefault();\n }\n\n $dropdowns.removeClass('hover');\n $this.addClass('hover');\n\n document.addEventListener('touchstart', function closeDropdown(e) {\n e.stopPropagation();\n\n $this.removeClass('hover');\n document.removeEventListener('touchstart', closeDropdown);\n });\n }\n }\n }, false);\n });\n }\n\n $('a.no-link, span.category-header').on('click', function (e) {\n if (window.innerWidth < 640) {\n $(this).next($('.menu-item-toggle')).trigger('click');\n } else {\n e.preventDefault();\n }\n });\n\n var ogMenuHeight = $('ul.level-1').height();\n // main menu toggle\n $('.menu-toggle').on('click', function () {\n $('#wrapper').toggleClass('menu-active');\n ogMenuHeight = $('ul.level-1').height();\n });\n\n $('.main-nav li .menu-item-toggle').on('click', function (e) {\n e.preventDefault();\n\n var $parentLi = $(e.target).closest('li');\n var menuHeight = $parentLi.find('.sub-level-wrapper').height();\n\n if (ogMenuHeight <= menuHeight) {\n $('ul.level-1').css('height', menuHeight);\n }\n\n $parentLi.siblings('li').removeClass('active').find('.menu-item-toggle');\n $parentLi.toggleClass('active');\n\n $(e.target).toggleClass('active');\n });\n\n $('.mobile-menu-back').on('click', function () {\n var $closestActiveMenu = $(this).closest('.active');\n var prevMenuHeight = $closestActiveMenu.parent().parent().height();\n\n $closestActiveMenu.removeClass('active');\n\n if (ogMenuHeight <= prevMenuHeight) {\n $('ul.level-1').css('height', prevMenuHeight);\n }\n });\n\n $('.user-account').on('click', function (e) {\n e.preventDefault();\n\n $(this).parent('.user-info').toggleClass('active');\n });\n}\n\nfunction searchMenuEvent() {\n // Search for mobile view\n $('.quick-access-menu [title=\"Search\"]').on('click', function (e) {\n e.preventDefault();\n\n $('.header-search').slideToggle(200);\n });\n\n // show the search button when the user switches to desktop view\n $(window).on('resize', function (e) {\n if (window.innerWidth > 639) {\n $('.header-search').show();\n }\n });\n}\n\n//add class for scrollbar on miniline summary\nfunction addSummaryScrollbar() {\n var itemCount = $('.pt_checkout .checkout-mini-cart .accordion-content .mini-cart-product').length;\n\n if (itemCount > 4) {\n $('.checkout-mini-cart .accordion-content').addClass('scroll-items');\n }\n}\n\nfunction playVideoHandler() {\n var MAIN_VIDEO_SELECTOR = '.main-video';\n var CAROUSEL_VIDEO_SELECTOR = '.modal-video';\n $(document)\n // main video (inline)\n .on('click', MAIN_VIDEO_SELECTOR, function () {\n var $this = $(this);\n\n var $inlineEle = $this.parent('div'),\n videoId = $this.data('video-id');\n\n video.playInline($inlineEle, videoId);\n })\n\n // carousel videos (launched in modal)\n .on('click', CAROUSEL_VIDEO_SELECTOR, function () {\n var videoId = $(this).data('video-id');\n\n video.playInModal(videoId);\n });\n}\n\nfunction resetFooterError() {\n $('.store-locator-form input[type=\"text\"]').val('');\n\n if ($('.store-locator-form .field-button-container div').hasClass('error')) {\n $('.store-locator-form .field-button-container div').removeClass('error');\n $('.store-locator-form .field-button-container .error-message').remove();\n }\n}\n\n/**\r\n * Dropdown event for quantity change\r\n * @returns\r\n */\nfunction dropDownEvents() {\n $(document).on('click', '.js-num-drop_up', function (e) {\n e.preventDefault();\n var $box = $(this).closest('.js-num-drop_container');\n var limit = $box.find('.js-num-drop_select').children().length;\n var currentNum = $box.find('.js-num-drop_cnt').html();\n\n if (currentNum < limit - 1) {\n currentNum++;\n $box.find('.js-num-drop_cnt').html(currentNum);\n $box.find('.js-num-drop_select').children().find('a').removeClass('is-current');\n if ($(this).closest('#product-set').length > 0) {\n $box.find('.js-num-drop_select').children().eq(currentNum).find('a').addClass('is-current');\n } else {\n $box.find('.js-num-drop_select').children().eq(currentNum - 1).find('a').addClass('is-current');\n }\n $box.find('.js-num-drop_input').val(currentNum);\n }\n\n if ($(this).parents('.cpb-products_list_box').length > 0) {\n $(this).trigger('dropUpMinicart');\n } else if ($(this).parents('.cpb-cart-bag_box').length > 0) {\n $(this).trigger('dropUpCart');\n } else if ($(this).parents('.cpb-products-conut').length > 0) {\n $(this).trigger('dropUpProduct');\n }\n\n // For product set\n if ($('#product-set').length > 0) {\n updateAddToCartButton();\n setTotalPrice();\n }\n });\n $(document).on('click', '.js-num-drop_down', function (e) {\n e.preventDefault();\n var $box = $(this).closest('.js-num-drop_container');\n var limit = $box.find('.js-num-drop_select').children().length;\n var currentNum = $box.find('.js-num-drop_cnt').html();\n var isMiniCart = function (element) {\n if ($(element).closest('.cpb-modal_minicart').length > 0) {\n return true;\n } else {\n return false;\n }\n }(this);\n // ミニカートはカウントが0にならないようにする\n var minNum = isMiniCart ? 1 : 0;\n if (currentNum > minNum) {\n currentNum--;\n $box.find('.js-num-drop_cnt').html(currentNum);\n $box.find('.js-num-drop_select').children().find('a').removeClass('is-current');\n if ($(this).closest('#product-set').length > 0) {\n $box.find('.js-num-drop_select').children().eq(currentNum).find('a').addClass('is-current');\n } else {\n $box.find('.js-num-drop_select').children().eq(currentNum - 1).find('a').addClass('is-current');\n }\n $box.find('.js-num-drop_input').val(currentNum);\n }\n\n if ($(this).parents('.cpb-products_list_box').length > 0) {\n $(this).trigger('dropDownMinicart');\n } else if ($(this).parents('.cpb-cart-bag_box').length > 0) {\n $(this).trigger('dropDownCart');\n } else if ($(this).parents('.cpb-products-conut').length > 0) {\n $(this).trigger('dropDownProduct');\n }\n\n // For product set\n if ($('#product-set').length > 0) {\n // all check product count\n var products = $('.cpb-products-conut .js-num-drop_input');\n var count = 0;\n for (var i = 0; i < products.length; i++) {\n if ($(products).eq(i).val() == 0) count++;\n }\n if (count == products.length) {\n $('#add-all-to-cart').prop('disabled', 'disabled');\n }\n updateAddToCartButton();\n setTotalPrice();\n }\n });\n $(document).on('click', '.js-num-drop_select a', function (e) {\n e.preventDefault();\n var $box = $(this).closest('.js-num-drop_container');\n var num = $(this).html();\n $box.find('.js-num-drop_cnt').html(num);\n $box.find('.js-num-drop_select').children().find('a').removeClass('is-current');\n if ($(this).closest('#product-set').length > 0) {\n $box.find('.js-num-drop_select').children().eq(num).find('a').addClass('is-current');\n } else {\n $box.find('.js-num-drop_select').children().eq(num - 1).find('a').addClass('is-current');\n }\n $box.find('.js-num-drop_input').val(num);\n $box.find('.js-num-drop_select').removeClass('is-active');\n\n if ($(this).parents('.cpb-products_list_box').length > 0) {\n $(this).trigger('dropSelectMinicart');\n } else if ($(this).parents('.cpb-cart-bag_box').length > 0) {\n $(this).trigger('dropSelectCart');\n } else if ($(this).parents('.cpb-products-conut').length > 0) {\n $(this).trigger('dropSelectProduct');\n }\n\n // For product set\n if ($('#product-set').length > 0) {\n // all check product count\n var products = $('.cpb-products-conut .js-num-drop_input');\n var count = 0;\n for (var i = 0; i < products.length; i++) {\n if ($(products).eq(i).val() == 0) count++;\n }\n if (count == products.length) {\n $('#add-all-to-cart').prop('disabled', 'disabled');\n } else {\n $('#add-all-to-cart').prop('disabled', '');\n }\n updateAddToCartButton();\n setTotalPrice();\n }\n });\n $(document).on('click', '.js-num-drop_drop', function (e) {\n e.preventDefault();\n var $box = $(this).closest('.js-num-drop_container');\n var eventName = '.event' + new Date().getTime();\n\n if ($box.find('.js-num-drop_select').hasClass('is-active')) {\n $box.find('.js-num-drop_select').removeClass('is-active');\n $(document).off(eventName);\n } else {\n var offset = $(this).offset();\n var posY = offset.top - $(window).scrollTop();\n var height = $(window).height();\n if (posY * 2 > height) {\n $box.find('.js-num-drop_select').addClass('is-up');\n } else {\n $box.find('.js-num-drop_select').removeClass('is-up');\n }\n\n $box.find('.js-num-drop_select').addClass('is-active');\n\n $(document).on('click' + eventName + ' touchend' + eventName, function (e) {\n if (!$.contains($box[0], e.target)) {\n $box.find('.js-num-drop_select').removeClass('is-active');\n $(document).off(eventName);\n }\n });\n }\n\n if ($(this).parents('.cpb-products_list_box').length > 0) {\n $(this).trigger('dropDropMinicart');\n } else if ($(this).parents('.cpb-cart-bag_box').length > 0) {\n $(this).trigger('dropDropCart');\n } else if ($(this).parents('.cpb-products-conut').length > 0) {\n $(this).trigger('dropDropProduct');\n }\n });\n}\n\nfunction setTotalPrice() {\n $('.cpb-products-variety_area').siblings('.cpb-products-conut').find('.item-price span').text(productSetCalcPrice().toString().replace(/(\\d)(?=(\\d{3})+$)/g, '$1,'));\n}\n\nfunction productSetCalcPrice() {\n return $('.cpb-products-variety_area .cpb-products-variety_box').toArray().reduce(function (totalPrice, currentValue) {\n var count = Number($(currentValue).find('.cpb-products-conut .js-num-drop_input').val()) || 0;\n var price = Number($(currentValue).find('.item-price .num').data().value) || 0;\n return totalPrice + count * price;\n }, 0);\n}\n\nfunction updateAddToCartButton() {\n var elementList = $('.cpb-products-variety_area .cpb-products-variety_box').toArray();\n // 一つでも在庫切れ、オフライン、店舗限定の商品が有った場合、true\n var checkProduct = function checkProduct() {\n return elementList.some(function (element) {\n return 'none' === $(element).find('.cmd-num_set').css('display');\n });\n };\n // すべての商品の購入個数が「0」の場合、true\n var checkNum = function checkNum() {\n return elementList.every(function (element) {\n return 0 < $(element).find('.cpb-products-conut .js-num-drop_input').length && 0 === Number($(element).find('.cpb-products-conut .js-num-drop_input').val());\n });\n };\n if (checkProduct() || checkNum()) {\n $('#add-all-to-cart').prop('disabled', 'disabled');\n } else {\n $('#add-all-to-cart').prop('disabled', '');\n }\n}\n\nvar pages = {\n account: require('./pages/account'),\n cart: require('./pages/cart'),\n checkout: require('./pages/checkout'),\n compare: require('./pages/compare'),\n product: require('./pages/product'),\n registry: require('./pages/registry'),\n orderconfirmation: require('./pages/order-confirm'),\n search: require('./pages/search'),\n tutorial: require('./pages/tutorial'),\n storefront: require('./pages/storefront'),\n wishlist: require('./pages/wishlist'),\n storelocator: require('./pages/storelocator'),\n checkorder: require('./pages/checkorder'),\n content: require('./pages/content'),\n promotionlanding: require('./pages/promotionlanding'),\n stocknotification: require('./pages/stocknotification')\n};\n\nvar app = {\n init: function init() {\n $(document).foundation();\n\n // 「ajax」通信はパラメータに「isSkipOnHistory」を設定\n $.ajaxPrefilter(function (options) {\n var URI = require('urijs');\n var url = new URI(options.url);\n url.addQuery('isSkipOnHistory', true);\n options.url = url.toString();\n });\n\n if (document.cookie.length === 0) {\n $('
').addClass('browser-compatibility-alert').append($('

').addClass('browser-error').html(Resources.COOKIES_DISABLED)).appendTo('#browser-check');\n }\n\n initializeDom();\n // init events for design\n design.init();\n initializeEvents();\n backToTopHandler();\n minimizedHeaderHandler();\n resetFooterError();\n responsiveMegaMenu();\n searchMenuEvent();\n\n // init specific global components\n analytics.init();\n countries.init();\n tooltip.init();\n minicart.init();\n validator.init();\n orderreplenishment.init();\n rating.init();\n slick.init();\n searchplaceholder.init();\n headerMenu.init();\n video.init();\n //checkoutLogin.init();\n footerSelector.countrySelector();\n newsletter.newsletterHeader();\n newsletter.isNewsletterEnabled();\n inputEntry.entry();\n playVideoHandler();\n login.init();\n quickview.init();\n dropDownEvents();\n loading.init();\n dd.init();\n // execute page specific initializations\n $.extend(page, window.pageContext);\n\n var ns = page.ns;\n\n if (ns && pages[ns] && pages[ns].init) {\n pages[ns].init();\n }\n\n // Check TLS status if indicated by site preference\n if (SitePreferences.CHECK_TLS === true) {\n tls.getUserAgent();\n }\n }\n};\n\n//general extension functions\n(function () {\n String.format = function () {\n var s = arguments[0];\n var i,\n len = arguments.length - 1;\n\n for (i = 0; i < len; i++) {\n var reg = new RegExp('\\\\{' + i + '\\\\}', 'gm');\n\n s = s.replace(reg, arguments[i + 1]);\n }\n\n return s;\n };\n})();\n\n// initialize app\n$(document).ready(function () {\n app.init();\n // fixed button cart\n $('.cpb-cart-checkout_fixed .cpb-cart_submit .button').off('click.checkout_fixed').on('click.checkout_fixed', function (e) {\n e.preventDefault();\n $('.cpb-cart-side_submit .button').trigger('click');\n });\n});\n\n// expose global app obj for 3rd party integrations\nwindow.app = {\n quickView: quickview,\n minicart: minicart,\n user: window.User,\n SCemailUrl: window.Urls.SCemailUrl,\n Product: {},\n tagmanager: analytics.tagmanager,\n gtmInternalPromotion: analytics.gtmInternalPromotion\n};\n\n// expose global saveURL to support legacy Composed integration\nwindow.saveURL = window.Urls.saveConsultationURL;\n// summary scroll bar global scope\nwindow.addSummaryScrollbar = addSummaryScrollbar;\nwindow.scrollToTop = scrollToTop;\n\n},{\"./ajax\":1,\"./analytics\":2,\"./cookieprivacy\":6,\"./countries\":7,\"./dd\":10,\"./design\":11,\"./dialog\":12,\"./footer-selector\":13,\"./hanatsubaki_club_member_id_edit\":17,\"./header-menu\":18,\"./input-entry\":19,\"./jquery-ext\":20,\"./loading\":21,\"./login\":22,\"./minicart\":23,\"./new-design\":25,\"./newsletter\":26,\"./order-replenishment\":27,\"./page\":28,\"./pages/account\":29,\"./pages/cart\":30,\"./pages/checkorder\":31,\"./pages/checkout\":37,\"./pages/compare\":41,\"./pages/content\":42,\"./pages/order-confirm\":43,\"./pages/product\":48,\"./pages/promotionlanding\":55,\"./pages/registry\":56,\"./pages/search\":57,\"./pages/stocknotification\":58,\"./pages/storefront\":59,\"./pages/storelocator\":60,\"./pages/tutorial\":61,\"./pages/wishlist\":62,\"./product-tile\":63,\"./quickview\":66,\"./rating\":67,\"./searchplaceholder\":70,\"./searchsuggest\":71,\"./slick\":72,\"./tls\":76,\"./tooltip\":77,\"./util\":78,\"./validator\":79,\"./video\":80,\"urijs\":105}],4:[function(require,module,exports){\n'use strict';\n\nvar dialog = require('./dialog'),\n page = require('./page'),\n util = require('./util'),\n modal = require('./modal').global;\n\nvar selectedList = [];\nvar maxItems = 1;\nvar bliUUID = '';\n\n/**\r\n * @private\r\n * @function\r\n * description Gets a list of bonus products related to a promoted product\r\n */\nfunction getBonusProducts() {\n var bonusproducts = [];\n\n var i, len;\n for (i = 0, len = selectedList.length; i < len; i++) {\n var p = {\n pid: selectedList[i].pid,\n qty: selectedList[i].qty,\n options: {}\n };\n var a,\n alen,\n bp = selectedList[i];\n if (bp.options) {\n for (a = 0, alen = bp.options.length; a < alen; a++) {\n var opt = bp.options[a];\n p.options = { optionName: opt.name, optionValue: opt.value };\n }\n }\n bonusproducts.push({ product: p });\n }\n return { bonusproducts: bonusproducts };\n}\n\nvar selectedItemTemplate = function selectedItemTemplate(data) {\n var attributes = '';\n for (var attrID in data.attributes) {\n var attr = data.attributes[attrID];\n attributes += '

  • \\n';\n attributes += '' + attr.displayName + ': ';\n attributes += '' + attr.displayValue + '\\n';\n attributes += '
  • ';\n }\n attributes += '
  • \\n';\n attributes += 'Qty: ';\n attributes += '' + data.qty + '';\n return ['
  • ', '', '
    ' + data.name + '
    ', '
      ', attributes, '
        ', '
      • '].join('\\n');\n};\n\n// hide swatches that are not selected or not part of a Product Variation Group\nvar hideSwatches = function hideSwatches() {\n $('.bonus-product-item:not([data-producttype=\"master\"]) .swatches li').not('.selected').not('.variation-group-value').hide();\n // prevent unselecting the selected variant\n $('.bonus-product-item .swatches .selected').on('click', function () {\n return false;\n });\n};\n\n/**\r\n * @private\r\n * @function\r\n * @description Updates the summary page with the selected bonus product\r\n */\nfunction updateSummary() {\n var $bonusProductList = $('#bonus-product-list');\n if (!selectedList.length) {\n $bonusProductList.find('li.selected-bonus-item').remove();\n } else {\n var ulList = $bonusProductList.find('ul.selected-bonus-items').first();\n var i, len;\n for (i = 0, len = selectedList.length; i < len; i++) {\n var item = selectedList[i];\n var li = selectedItemTemplate(item);\n $(li).appendTo(ulList);\n }\n }\n\n // get remaining item count\n var remain = maxItems - selectedList.length;\n $bonusProductList.find('.bonus-items-available').text(remain);\n if (remain <= 0) {\n $bonusProductList.find('.select-bonus-item').attr('disabled', 'disabled');\n } else {\n $bonusProductList.find('.select-bonus-item').removeAttr('disabled');\n }\n}\n\nfunction initializeGrid() {\n var $bonusProduct = $('#bonus-product-dialog'),\n $bonusProductList = $('#bonus-product-list'),\n bliData = $bonusProductList.data('line-item-detail');\n maxItems = bliData.maxItems;\n bliUUID = bliData.uuid;\n\n if (bliData.itemCount >= maxItems) {\n $bonusProductList.find('.select-bonus-item').attr('disabled', 'disabled');\n }\n\n var cartItems = $bonusProductList.find('.selected-bonus-item');\n cartItems.each(function () {\n var ci = $(this);\n var product = {\n uuid: ci.data('uuid'),\n pid: ci.data('pid'),\n qty: ci.find('.item-qty').text(),\n name: ci.find('.item-name').html(),\n attributes: {}\n };\n var attributes = ci.find('ul.item-attributes li');\n attributes.each(function () {\n var li = $(this);\n product.attributes[li.data('attributeId')] = {\n displayName: li.children('.display-name').html(),\n displayValue: li.children('.display-value').html()\n };\n });\n selectedList.push(product);\n });\n\n $bonusProductList.on('click', '.bonus-product-item a[href].swatchanchor', function (e) {\n e.preventDefault();\n var url = this.href,\n $this = $(this);\n url = util.appendParamsToUrl(url, {\n source: 'bonus',\n format: 'ajax'\n });\n $.ajax({\n url: url,\n success: function success(response) {\n $this.closest('.bonus-product-item').empty().html(response);\n hideSwatches();\n }\n });\n }).on('change', '.input-text', function () {\n $bonusProductList.find('.select-bonus-item').removeAttr('disabled');\n $(this).closest('.bonus-product-form').find('.quantity-error').text('');\n }).on('click', '.select-bonus-item', function (e) {\n e.preventDefault();\n if (selectedList.length >= maxItems) {\n $bonusProductList.find('.select-bonus-item').attr('disabled', 'disabled');\n $bonusProductList.find('.bonus-items-available').text('0');\n return;\n }\n\n var form = $(this).closest('.bonus-product-form'),\n detail = $(this).closest('.product-detail'),\n uuid = form.find('input[name=\"productUUID\"]').val(),\n qtyVal = form.find('input[name=\"Quantity\"]').val(),\n qty = isNaN(qtyVal) ? 1 : +qtyVal;\n\n if (qty > maxItems) {\n $bonusProductList.find('.select-bonus-item').attr('disabled', 'disabled');\n form.find('.quantity-error').text(Resources.BONUS_PRODUCT_TOOMANY);\n return;\n }\n\n var product = {\n uuid: uuid,\n pid: form.find('input[name=\"pid\"]').val(),\n qty: qty,\n name: detail.find('.product-name').text(),\n attributes: detail.find('.product-variations').data('attributes'),\n options: []\n };\n\n var optionSelects = form.find('.product-option');\n\n optionSelects.each(function () {\n product.options.push({\n name: this.name,\n value: $(this).val(),\n display: $(this).children(':selected').first().html()\n });\n });\n selectedList.push(product);\n updateSummary();\n }).on('click', '.remove-link', function (e) {\n e.preventDefault();\n var container = $(this).closest('.selected-bonus-item');\n if (!container.data('uuid')) {\n return;\n }\n\n var uuid = container.data('uuid');\n var i,\n len = selectedList.length;\n for (i = 0; i < len; i++) {\n if (selectedList[i].uuid === uuid) {\n selectedList.splice(i, 1);\n break;\n }\n }\n updateSummary();\n }).on('click', '.add-to-cart-bonus', function (e) {\n e.preventDefault();\n var url = util.appendParamsToUrl(Urls.addBonusProduct, {\n bonusDiscountLineItemUUID: bliUUID\n });\n var bonusProducts = getBonusProducts();\n if (bonusProducts.bonusproducts[0].product.qty > maxItems) {\n bonusProducts.bonusproducts[0].product.qty = maxItems;\n }\n // make the server call\n $.ajax({\n type: 'POST',\n dataType: 'json',\n cache: false,\n contentType: 'application/json',\n url: url,\n data: JSON.stringify(bonusProducts)\n }).done(function () {\n // success\n page.refresh();\n }).fail(function (xhr, textStatus) {\n // failed\n if (textStatus === 'parsererror') {\n window.alert(Resources.BAD_RESPONSE);\n } else {\n window.alert(Resources.SERVER_CONNECTION_ERROR);\n }\n }).always(function () {\n $bonusProduct.dialog('close');\n });\n }).on('click', '#more-bonus-products', function (e) {\n e.preventDefault();\n var uuid = $('#bonus-product-list').data().lineItemDetail.uuid;\n\n //get the next page of choice of bonus products\n var lineItemDetail = JSON.parse($('#bonus-product-list').attr('data-line-item-detail'));\n lineItemDetail.pageStart = lineItemDetail.pageStart + lineItemDetail.pageSize;\n $('#bonus-product-list').attr('data-line-item-detail', JSON.stringify(lineItemDetail));\n\n var url = util.appendParamsToUrl(Urls.getBonusProducts, {\n bonusDiscountLineItemUUID: uuid,\n format: 'ajax',\n lazyLoad: 'true',\n pageStart: lineItemDetail.pageStart,\n pageSize: $('#bonus-product-list').data().lineItemDetail.pageSize,\n bonusProductsTotal: $('#bonus-product-list').data().lineItemDetail.bpTotal\n });\n\n $.ajax({\n type: 'GET',\n cache: false,\n contentType: 'application/json',\n url: url\n }).done(function (data) {\n //add the new page to DOM and remove 'More' link if it is the last page of results\n $('#more-bonus-products').before(data);\n if (lineItemDetail.pageStart + lineItemDetail.pageSize >= $('#bonus-product-list').data().lineItemDetail.bpTotal) {\n $('#more-bonus-products').remove();\n }\n }).fail(function (xhr, textStatus) {\n if (textStatus === 'parsererror') {\n window.alert(Resources.BAD_RESPONSE);\n } else {\n window.alert(Resources.SERVER_CONNECTION_ERROR);\n }\n });\n });\n}\n\nvar bonusProductsView = {\n /**\r\n * @function\r\n * @description Open the list of bonus products selection dialog\r\n */\n show: function show(url) {\n var $bonusProduct = $('#bonus-product-dialog');\n // create the dialog\n dialog.open({\n target: $bonusProduct,\n url: url,\n options: {\n width: 795,\n title: Resources.BONUS_PRODUCTS\n },\n callback: function callback() {\n initializeGrid();\n hideSwatches();\n }\n });\n },\n /**\r\n * @function\r\n * @description Open bonus product promo prompt dialog\r\n */\n loadBonusOption: function loadBonusOption() {\n var self = this,\n bonusDiscountContainer = document.querySelector('.bonus-discount-container');\n if (!bonusDiscountContainer) {\n return;\n }\n\n // get the html from minicart, then trash it\n var bonusDiscountContainerHtml = bonusDiscountContainer.outerHTML;\n bonusDiscountContainer.parentNode.removeChild(bonusDiscountContainer);\n\n dialog.open({\n html: bonusDiscountContainerHtml,\n options: {\n width: 'auto',\n title: Resources.BONUS_PRODUCT,\n dialogClass: 'bonus-eligibility-modal',\n buttons: [{\n text: Resources.SELECT_BONUS_PRODUCTS,\n click: function click() {\n var uuid = $('.bonus-product-promo').data('lineitemid'),\n url = util.appendParamsToUrl(Urls.showBonusProducts, {\n bonusDiscountLineItemUUID: uuid,\n source: 'bonus',\n format: 'ajax',\n lazyLoad: 'false',\n pageStart: 0,\n pageSize: 0,\n bonusProductsTotal: -1\n });\n $(this).dialog('close');\n //self.show(url);\n modal.addCustomClass('bonus-item-modal');\n modal.renderByUrl(url);\n }\n }, {\n text: Resources.NO_THANKS,\n click: function click() {\n $(this).dialog('close');\n }\n }]\n },\n callback: function callback() {\n // show hide promo details\n $('.show-promo-details').on('click', function () {\n $('.promo-details').toggleClass('visible');\n });\n }\n });\n },\n\n hasBonusOptions: function hasBonusOptions() {\n return $('.bonus-discount-container').length > 0;\n }\n};\n\nmodule.exports = bonusProductsView;\n\n},{\"./dialog\":12,\"./modal\":24,\"./page\":28,\"./util\":78}],5:[function(require,module,exports){\n'use strict';\n\nvar page = require('./page'),\n util = require('./util'),\n TPromise = require('promise');\n\nvar _currentCategory = '',\n MAX_ACTIVE = 6;\n\n/**\r\n * @private\r\n * @function\r\n * @description Verifies the number of elements in the compare container and updates it with sequential classes for ui targeting\r\n */\nfunction refreshContainer() {\n var $compareContainer = $('.compare-items');\n var $compareItems = $compareContainer.find('.compare-item');\n var numActive = $compareItems.filter('.active').length;\n\n if (numActive < 2) {\n $('#compare-items-button').attr('disabled', 'disabled');\n } else {\n $('#compare-items-button').removeAttr('disabled');\n }\n\n $compareContainer.toggle(numActive > 0);\n}\n/**\r\n * @private\r\n * @function\r\n * @description Adds an item to the compare container and refreshes it\r\n */\nfunction addToList(data) {\n // get the first compare-item not currently active\n var $item = $('.compare-items .compare-item').not('.active').first(),\n $productTile = $('#' + data.uuid);\n\n if ($item.length === 0) {\n if ($productTile.length > 0) {\n $productTile.find('.compare-check')[0].checked = false;\n }\n window.alert(Resources.COMPARE_ADD_FAIL);\n return;\n }\n\n // if already added somehow, return\n if ($('[data-uuid=\"' + data.uuid + '\"]').length > 0) {\n return;\n }\n // set as active item\n $item.addClass('active').attr('data-uuid', data.uuid).attr('data-itemid', data.itemid).data('uuid', data.uuid).data('itemid', data.itemid).append($(data.img).clone().addClass('compare-item-image'));\n}\n/**\r\n * @private\r\n * @function\r\n * description Removes an item from the compare container and refreshes it\r\n */\nfunction removeFromList($item) {\n if ($item.length === 0) {\n return;\n }\n // remove class, data and id from item\n $item.removeClass('active').removeAttr('data-uuid').removeAttr('data-itemid').data('uuid', '').data('itemid', '')\n // remove the image\n .find('.compare-item-image').remove();\n}\n\nfunction addProductAjax(args) {\n var promise = new TPromise(function (resolve, reject) {\n $.ajax({\n url: Urls.compareAdd,\n data: {\n pid: args.itemid,\n category: _currentCategory\n },\n dataType: 'json'\n }).done(function (response) {\n if (!response || !response.success) {\n reject(new Error(Resources.COMPARE_ADD_FAIL));\n } else {\n resolve(response);\n }\n }).fail(function (jqxhr, status, err) {\n reject(new Error(err));\n });\n });\n return promise;\n}\n\nfunction removeProductAjax(args) {\n var promise = new TPromise(function (resolve, reject) {\n $.ajax({\n url: Urls.compareRemove,\n data: {\n pid: args.itemid,\n category: _currentCategory\n },\n dataType: 'json'\n }).done(function (response) {\n if (!response || !response.success) {\n reject(new Error(Resources.COMPARE_REMOVE_FAIL));\n } else {\n resolve(response);\n }\n }).fail(function (jqxhr, status, err) {\n reject(new Error(err));\n });\n });\n return promise;\n}\n\nfunction shiftImages() {\n return new TPromise(function (resolve) {\n var $items = $('.compare-items .compare-item');\n $items.each(function (i, item) {\n var $item = $(item);\n // last item\n if (i === $items.length - 1) {\n return removeFromList($item);\n }\n var $next = $items.eq(i + 1);\n if ($next.hasClass('active')) {\n // remove its own image\n $next.find('.compare-item-image').detach().appendTo($item);\n $item.addClass('active').attr('data-uuid', $next.data('uuid')).attr('data-itemid', $next.data('itemid')).data('uuid', $next.data('uuid')).data('itemid', $next.data('itemid'));\n }\n });\n resolve();\n });\n}\n\n/**\r\n * @function\r\n * @description Adds product to the compare table\r\n */\nfunction addProduct(args) {\n var promise;\n var $items = $('.compare-items .compare-item');\n var $cb = $(args.cb);\n var numActive = $items.filter('.active').length;\n if (numActive === MAX_ACTIVE) {\n if (!window.confirm(Resources.COMPARE_CONFIRMATION)) {\n $cb[0].checked = false;\n return;\n }\n\n // remove product using id\n var $firstItem = $items.first();\n promise = removeItem($firstItem).then(function () {\n return shiftImages();\n });\n } else {\n promise = TPromise.resolve(0);\n }\n return promise.then(function () {\n return addProductAjax(args).then(function () {\n addToList(args);\n if ($cb && $cb.length > 0) {\n $cb[0].checked = true;\n }\n refreshContainer();\n });\n }).then(null, function () {\n if ($cb && $cb.length > 0) {\n $cb[0].checked = false;\n }\n });\n}\n\n/**\r\n * @function\r\n * @description Removes product from the compare table\r\n * @param {object} args - the arguments object should have the following properties: itemid, uuid and cb (checkbox)\r\n */\nfunction removeProduct(args) {\n var $cb = args.cb ? $(args.cb) : null;\n return removeProductAjax(args).then(function () {\n var $item = $('[data-uuid=\"' + args.uuid + '\"]');\n removeFromList($item);\n if ($cb && $cb.length > 0) {\n $cb[0].checked = false;\n }\n refreshContainer();\n }, function () {\n if ($cb && $cb.length > 0) {\n $cb[0].checked = true;\n }\n });\n}\n\nfunction removeItem($item) {\n var uuid = $item.data('uuid'),\n $productTile = $('#' + uuid);\n return removeProduct({\n itemid: $item.data('itemid'),\n uuid: uuid,\n cb: $productTile.length === 0 ? null : $productTile.find('.compare-check')\n });\n}\n\n/**\r\n * @private\r\n * @function\r\n * @description Initializes the DOM-Object of the compare container\r\n */\nfunction initializeDom() {\n var $compareContainer = $('.compare-items');\n _currentCategory = $compareContainer.data('category') || '';\n var $active = $compareContainer.find('.compare-item').filter('.active');\n $active.each(function () {\n var $productTile = $('#' + $(this).data('uuid'));\n if ($productTile.length === 0) {\n return;\n }\n $productTile.find('.compare-check')[0].checked = true;\n });\n // set container state\n refreshContainer();\n}\n\n/**\r\n * @private\r\n * @function\r\n * @description Initializes the events on the compare container\r\n */\nfunction initializeEvents() {\n // add event to buttons to remove products\n $('.compare-item').on('click', '.compare-item-remove', function () {\n removeItem($(this).closest('.compare-item'));\n });\n\n // Button to go to compare page\n $('#compare-items-button').on('click', function () {\n page.redirect(util.appendParamToURL(Urls.compareShow, 'category', _currentCategory));\n });\n\n // Button to clear all compared items\n // rely on refreshContainer to take care of hiding the container\n $('#clear-compared-items').on('click', function () {\n $('.compare-items .active').each(function () {\n removeItem($(this));\n });\n });\n}\n\nexports.init = function () {\n initializeDom();\n initializeEvents();\n};\n\nexports.addProduct = addProduct;\nexports.removeProduct = removeProduct;\n\n},{\"./page\":28,\"./util\":78,\"promise\":86}],6:[function(require,module,exports){\n'use strict';\n\nvar dialog = require('./dialog');\n\n/**\r\n * @function cookieprivacy Used to display/control the scrim containing the cookie privacy code\r\n **/\nmodule.exports = function () {\n /**\r\n * If we have not accepted cookies AND we're not on the Privacy Policy page, then show the notification\r\n * NOTE: You will probably want to adjust the Privacy Page test to match your site's specific privacy / cookie page\r\n */\n if (SitePreferences.COOKIE_HINT === true && document.cookie.indexOf('dw_cookies_accepted') < 0) {\n // check for privacy policy page\n if ($('.privacy-policy').length === 0) {\n dialog.open({\n url: Urls.cookieHint,\n options: {\n closeOnEscape: false,\n dialogClass: 'no-close',\n buttons: [{\n text: Resources.I_AGREE,\n click: function click() {\n $(this).dialog('close');\n enableCookies();\n }\n }]\n }\n });\n }\n } else {\n // Otherwise, we don't need to show the asset, just enable the cookies\n enableCookies();\n }\n\n function enableCookies() {\n if (document.cookie.indexOf('dw=1') < 0) {\n document.cookie = 'dw=1; path=/';\n }\n if (document.cookie.indexOf('dw_cookies_accepted') < 0) {\n document.cookie = 'dw_cookies_accepted=1; path=/';\n }\n }\n};\n\n},{\"./dialog\":12}],7:[function(require,module,exports){\n'use strict';\n\nexports.init = function init() {\n $('.country-selector .current-country').on('click', function () {\n $('.country-selector .selector').toggleClass('active');\n $(this).toggleClass('selector-active');\n });\n // set currency first before reload\n $('.country-selector .selector .locale').on('click', function (e) {\n e.preventDefault();\n var url = this.href;\n var currency = this.getAttribute('data-currency');\n $.ajax({\n dataType: 'json',\n url: Urls.setSessionCurrency,\n data: {\n format: 'ajax',\n currencyMnemonic: currency\n }\n }).done(function (response) {\n if (!response.success) {\n throw new Error('Unable to set currency');\n }\n window.location.href = url;\n });\n });\n};\n\n},{}],8:[function(require,module,exports){\n'use strict';\n\nmodule.exports = {\n init: function init() {\n $(function () {\n $('.c-modal-iframe-radiance-point').on('mfpOpen', function (e) {\n $('.mfp-content').addClass('iframe-radiance-point');\n });\n $('.c-modal-iframe-radiance-point').on('mfpAfterClose', function (e) {\n if ($('body').hasClass('is-noscroll')) {\n $('body').removeClass('is-noscroll');\n $('body').removeAttr('style');\n $('html, body').prop({ scrollTop: $('body').attr('data-scroll') });\n }\n });\n });\n }\n};\n\n},{}],9:[function(require,module,exports){\n'use strict';\n\nmodule.exports.init = function () {\n $(function () {\n $('.c-modal-inline-radiance-point').on('mfpOpen', function (e) {\n $('.mfp-content').addClass('inline-radiance-point');\n });\n });\n};\n\n},{}],10:[function(require,module,exports){\n'use strict';\n\nmodule.exports = {\n init: function init() {\n require('./app_diff-20200219').init();\n require('./app_diff-20200319').init();\n }\n};\n\n},{\"./app_diff-20200219\":8,\"./app_diff-20200319\":9}],11:[function(require,module,exports){\n'use strict';\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar design = {\n init: function init() {\n //product search\n this.productSearchInit();\n\n //product list\n this.plpInit();\n\n //PDP\n this.pdpInit();\n\n //tmp_video\n this.tmpVideoInit();\n\n //tmp_recently\n this.tmpRecentlyInit();\n\n //tmp_image\n this.tmpImageInit();\n\n this.commonInit();\n\n this.clockInit();\n },\n tmpImageInit: function tmpImageInit() {\n $(function () {\n $('.c-block-template_02-slider-main').slick({\n asNavFor: '.c-block-template_02-slider-thumbnail',\n arrows: false,\n responsive: [{\n breakpoint: 991,\n settings: {\n arrows: false,\n dots: true\n }\n }, {\n breakpoint: 768,\n settings: {\n arrows: false,\n dots: false\n }\n }]\n });\n $('.c-block-template_02-slider-thumbnail').slick({\n asNavFor: '.c-block-template_02-slider-main',\n slidesToShow: 4,\n slidesToScroll: 1,\n focusOnSelect: true\n });\n });\n },\n plpInit: function plpInit() {\n $(function () {\n $('.c-product-cards-color-more>a').off('click').on('click', function () {\n $(this).closest('.c-product-cards-color').addClass('is-active');\n $(this).closest('.c-product-cards-color').find('.c-list-color.is-hidden').removeClass('is-hidden');\n $(this).parent().addClass('is-hidden');\n // use library jquery.matchHeight.js\n $.fn.matchHeight._maintainScroll = true;\n matchHeightProducts();\n return false;\n });\n\n $(document).off('click.plp.swatch, mousehover.plp.swatch').on('click.plp.swatch, mousehover.plp.swatch', '.c-list-color li > a', function () {\n if (window.innerWidth > 767) {\n var thumbIndex = $(this).closest('.c-product-cards-color-list').find('a').index(this);\n $(this).closest('.c-product-cards').find('.c-product-cards-photo-img > img').stop().hide();\n $(this).closest('.c-product-cards').find('.c-list-color-panel').removeClass('is-current');\n if ($(this).closest('.c-product-cards').find('.c-product-cards-photo-img > img').eq(thumbIndex).is(':hidden')) {\n $(this).closest('.c-product-cards').find('.c-product-cards-photo-img > img').eq(thumbIndex).fadeIn('slow');\n $(this).children('.c-list-color-panel').addClass('is-current');\n }\n return false;\n }\n });\n\n // SP size When there is nothing to display on Filter \"Filter\" itself is not displayed.\n if (window.innerWidth < 991 && $('.c-block-products-search-panel--filter li').length == 0) {\n $('.c-block-products-search-tabs--filter').remove();\n $('.c-block-products-search-panel--filter').remove();\n }\n\n // $('.c-list-color li > a').hover(function(){\n // \tif(window.innerWidth>991) {\n // \t\t$(this).trigger('mousehover');\n // \t}\n // });\n });\n },\n selectGiftInit: function selectGiftInit() {\n $(function () {\n $('.c-block-shopingmodal .c-list-color a').on('colorSelect', function () {\n var element = $(this).closest('.c-list-color').find('a').index(this);\n $(this).closest('.c-block-shopingmodal').find('.c-block-shopingmodal-change-image').each(function () {\n $(this).children().stop().hide(), $(this).children().eq(element).fadeIn();\n });\n $(this).closest('.c-block-shopingmodal').find('.c-block-shopingmodal-side-colorSelect .c-select-list-item a').removeClass('is-selected');\n $(this).closest('.c-block-shopingmodal').find('.c-block-shopingmodal-side-colorSelect .c-select-list-item a').eq(element).addClass('is-selected');\n var text = $(this).closest('.c-block-shopingmodal').find('.c-select-list-item>a.is-selected .c-select-list-item-text').html();\n $(this).closest('.c-block-shopingmodal').find('.c-block-shopingmodal-side-colorSelect .c-select-current').html(text);\n $(this).closest('.c-list-color').find('.c-list-color-panel').removeClass('is-current');\n $(this).children('.c-list-color-panel').addClass('is-current');\n });\n\n $('.c-block-shopingmodal .c-list-color a').on('click', function () {\n if (767 < window.innerWidth) {\n var element = $(this).closest('.c-list-color').find('a').index(this);\n $('.c-block-shopingmodal .c-list-color a').eq(element).trigger('colorSelect');\n }\n });\n\n $('.c-block-shopingmodal-side-colorSelect .c-select-list-item a').on('click', function () {\n var element = $(this).closest('.c-select-list').find('a').index(this);\n $('.c-block-shopingmodal .c-list-color a').eq(element).trigger('colorSelect');\n return false;\n });\n });\n },\n selectQuantityInit: function selectQuantityInit() {\n $(function () {\n //countup\n $('.c-quantitySelection-btn-plus').off('click').on('click', function () {\n var current = $(this).closest('.c-quantitySelection').find('.c-select-current');\n var currentNum = current.html();\n var limit = $(this).closest('.c-quantitySelection').find('.c-select-list-item').length;\n var index = $(this).closest('.c-quantitySelection').find('.c-select-list-item').index();\n currentNum++;\n var qtyReal = limit;\n if (currentNum <= limit) {\n current.html(currentNum);\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').eq(currentNum - 1).children('a').addClass('is-selected');\n qtyReal = currentNum;\n }\n\n $(this).closest('.c-quantitySelection-btn-gather').prev().val(qtyReal);\n\n var isWishList = $('form[name^=\"dwfrm_wishlist_items\"]').length > 0;\n var isStockNotification = $('main').data('pageName') === 'stocknotification';\n if (isWishList || isStockNotification) {\n var defaultPrice = $(this).closest('.quantity-column').find('input[name=\"default-price\"]').val();\n\n var calcPrice = Number(defaultPrice) * qtyReal;\n var str = calcPrice.toLocaleString() + '円';\n\n if (isStockNotification) {\n $(this).closest('.c-list-products-full-item-text-parts').find('.c-dlist_03-item dd.c-text_06').text(str);\n } else {\n $(this).closest('.c-list-products-full-item-text-parts').find('.c-text-price').text(str);\n }\n }\n return false;\n });\n\n //countdown\n $('.c-quantitySelection-btn-minus').off('click').on('click', function () {\n var current = $(this).closest('.c-quantitySelection').find('.c-select-current');\n var currentNum = current.html();\n var limit = $(this).closest('.c-quantitySelection').find('.c-select-list-item').length;\n var index = $(this).closest('.c-quantitySelection').find('.c-select-list-item').index();\n\n var qtyReal = 1;\n if (currentNum > 1) {\n currentNum--;\n current.html(currentNum);\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').eq(currentNum - 1).children('a').addClass('is-selected');\n qtyReal = currentNum;\n } else if (currentNum == 0) {\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n }\n\n $(this).closest('.c-quantitySelection-btn-gather').prev().val(qtyReal);\n\n var isWishList = $('form[name^=\"dwfrm_wishlist_items\"]').length > 0;\n var isStockNotification = $('main').data('pageName') === 'stocknotification';\n if (isWishList || isStockNotification) {\n var defaultPrice = $(this).closest('.quantity-column').find('input[name=\"default-price\"]').val();\n\n var calcPrice = Number(defaultPrice) * qtyReal;\n var str = calcPrice.toLocaleString() + '円';\n\n if (isStockNotification) {\n $(this).closest('.c-list-products-full-item-text-parts').find('.c-dlist_03-item dd.c-text_06').text(str);\n } else {\n $(this).closest('.c-list-products-full-item-text-parts').find('.c-text-price').text(str);\n }\n }\n return false;\n });\n\n // Change quantity on cart\n $('.c-list-products-full-item--cart .c-quantitySelection-btn-plus').off('click').on('click', function () {\n var current = $(this).closest('.c-quantitySelection').find('.c-select-current');\n var currentNum = current.html();\n var limit = $(this).closest('.c-quantitySelection').find('.c-select-list-item').length;\n var index = $(this).closest('.c-quantitySelection').find('.c-select-list-item').index();\n currentNum++;\n var qtyReal = limit;\n if (currentNum <= limit) {\n current.html(currentNum);\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').eq(currentNum - 1).children('a').addClass('is-selected');\n qtyReal = currentNum;\n }\n\n $(this).closest('.c-quantitySelection-btn-gather').prev().val(qtyReal);\n $(this).parents('.c-quantitySelection').find('input[type=\"hidden\"]').val(qtyReal);\n $('input[name$=_deleteGiftCertificate]').remove();\n $('input[name$=_deleteProduct]').remove();\n $(this).closest('form').submit();\n });\n\n $('.c-list-products-full-item--cart .c-quantitySelection-btn-minus').off('click').on('click', function () {\n var current = $(this).closest('.c-quantitySelection').find('.c-select-current');\n var currentNum = current.html();\n var limit = $(this).closest('.c-quantitySelection').find('.c-select-list-item').length;\n var index = $(this).closest('.c-quantitySelection').find('.c-select-list-item').index();\n\n var qtyReal = 1;\n if (currentNum > 1) {\n currentNum--;\n current.html(currentNum);\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').eq(currentNum - 1).children('a').addClass('is-selected');\n qtyReal = currentNum;\n } else if (currentNum == 0) {\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n }\n\n $(this).closest('.c-quantitySelection-btn-gather').prev().val(qtyReal);\n $(this).parents('.c-quantitySelection').find('input[type=\"hidden\"]').val(qtyReal);\n $('input[name$=_deleteGiftCertificate]').remove();\n $('input[name$=_deleteProduct]').remove();\n $(this).closest('form').submit();\n });\n });\n },\n toggleSelectInit: function toggleSelectInit(eventContinue) {\n $(function () {\n // select open\n $('.c-dropdown-toggle').off('click').on('click', function () {\n if (!$(this).parents('.c-block-review').length) {\n if ($(this).parents('.c-dropdown').find('.c-select-list').is(':hidden')) {\n $('.c-select-list').hide();\n $(this).parents('.c-dropdown').find('.c-select-list').show();\n } else {\n $(this).parents('.c-dropdown').find('.c-select-list').hide();\n }\n return false;\n }\n });\n });\n\n $(function () {\n eventContinue = eventContinue || false;\n $('.c-input-3column li').first().removeClass('is-half');\n // select\n $('.c-select-toggle').off('click').on('click', function () {\n if ($(this).next('.c-select-list').is(':hidden') && !$(this).hasClass('is-noselect')) {\n $('.c-select-list').hide();\n $(this).next('.c-select-list').show();\n\n // Auto up down display\n var offset = $(this).offset();\n var posY = offset.top - $(window).scrollTop();\n var heightS = $(window).height();\n } else {\n $(this).next('.c-select-list').hide();\n }\n });\n\n $('.c-select-list-item a').off('click').on('click', function (e) {\n e.preventDefault();\n var current = $(this).closest('.c-select').find('.c-select-current');\n var value = $(this).data('v') || $(this).find('span').data('num'); // form field and quantity selector\n var displayValue = $(this).children('.c-select-list-item-text').html();\n $(this).closest('.c-select-list').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).addClass('is-selected');\n current.html(displayValue);\n $(this).closest('.c-select-list').hide();\n $(this).closest('.c-select').next().val(value);\n $(this).closest('.c-select').next().change();\n\n if ($(this).closest('.c-block-shopingmodal-side-colorSelect').length > 0 || $(this).closest('.c-block-shoppingDock').length > 0) {\n var index = $(this).closest('.c-select-list').find('a').index(this);\n if ($(this).closest('.c-block-shopingmodal-set-item').length > 0) {\n $(this).closest('.c-block-shopingmodal-set-item').find('.c-list-color a').eq(index).trigger('colorSelect');\n }\n\n if ($(this).closest('.product-variations').length > 0) {\n $(this).closest('.product-variations').find('.c-list-color a').eq(index).trigger('colorSelect');\n }\n\n if ($(this).closest('.c-block-shoppingDock').length > 0) {\n $('.product-variations').find('.c-list-color a').eq(index).trigger('colorSelect');\n }\n }\n\n var isWishList = $('form[name^=\"dwfrm_wishlist_items\"]').length > 0;\n var isStockNotification = $('main').data('pageName') === 'stocknotification';\n if (isWishList || isStockNotification) {\n var defaultPrice = $(this).closest('.quantity-column').find('input[name=\"default-price\"]').val();\n\n var calcPrice = Number(defaultPrice) * Number(displayValue);\n var str = calcPrice.toLocaleString() + '円';\n\n if (isStockNotification) {\n $(this).closest('.c-list-products-full-item-text-parts').find('.c-dlist_03-item dd.c-text_06').text(str);\n } else {\n $(this).closest('.c-list-products-full-item-text-parts').find('.c-text-price').text(str);\n }\n }\n return eventContinue;\n });\n\n $('.c-list-products-full-item--cart .c-select-list-item a').off('click').on('click', function (e) {\n e.preventDefault();\n var current = $(this).closest('.c-select').find('.c-select-current');\n var value = $(this).data('v') || $(this).find('span').data('num'); // form field and quantity selector\n var displayValue = $(this).children('.c-select-list-item-text').html();\n $(this).closest('.c-select-list').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).addClass('is-selected');\n current.html(displayValue);\n $(this).closest('.c-select-list').hide();\n $(this).closest('.c-select').next().val(value);\n $(this).closest('.c-select').next().change();\n\n if ($(this).closest('.c-block-shopingmodal-side-colorSelect')) {\n var index = $(this).closest('.c-select-list').find('a').index(this);\n if ($(this).closest('.c-block-shopingmodal-set-item')) {\n $(this).closest('.c-block-shopingmodal-set-item').find('.c-list-color a').eq(index).trigger('colorSelect');\n }\n\n if ($(this).closest('.product-variations')) {\n $(this).closest('.product-variations').find('.c-list-color a').eq(index).trigger('colorSelect');\n }\n }\n var quantity = $(this).closest('.c-quantitySelection').find('.c-select-current').text();\n $(this).closest('.c-quantitySelection').find('input[type=\"hidden\"]').val(quantity);\n $('input[name$=_deleteGiftCertificate]').remove();\n $('input[name$=_deleteProduct]').remove();\n $(this).closest('form').submit();\n });\n\n $(document).on('touchstart click', function (e) {\n if (!$(e.target).closest('.c-select').length && !$(e.target).closest('.c-dropdown').length) {\n $('.c-select-list').hide();\n }\n });\n });\n },\n productSearchInit: function productSearchInit() {\n $(window).on('load resize', function () {\n if (window.innerWidth > 767) {\n setTimeout(function () {\n matchHeightProducts();\n }, 50);\n }\n });\n\n $(function () {\n $('.c-block-products-search-tabs .tab').off('click').on('click', function () {\n if (window.innerWidth < 991) {\n var num = $(this).closest('.c-block-products-search-tabs').find('.tab').index(this);\n if ($(this).closest('.c-block-products-search-tabs').next('.c-block-products-search-panels').find('.c-block-products-search-panel').eq(num).is(':hidden')) {\n $(this).closest('.c-block-products-search-tabs').next('.c-block-products-search-panels').find('.c-block-products-search-panel').removeClass('is-active');\n $('.c-block-products-search-tabs .tab').removeClass('is-active');\n $(this).closest('.c-block-products-search-tabs').next('.c-block-products-search-panels').find('.c-block-products-search-panel').eq(num).addClass('is-active');\n $(this).addClass('is-active');\n } else {\n $(this).closest('.c-block-products-search-tabs').next('.c-block-products-search-panels').find('.c-block-products-search-panel').eq(num).removeClass('is-active');\n $(this).removeClass('is-active');\n }\n return false;\n }\n });\n });\n },\n modalInit: function modalInit() {\n $.extend(true, $.magnificPopup.defaults, {\n tClose: Resources.POPUP_CLOSE,\n tLoading: Resources.POPUP_LOADING,\n gallery: {\n tPrev: Resources.POPUP_PREVIOUS,\n tNext: Resources.POPUP_NEXT,\n tCounter: Resources.POPUP_COUNTER\n },\n image: {\n tError: Resources.POPUP_ERROR\n }\n });\n\n $('.c-modal-img').magnificPopup({\n type: 'image',\n removalDelay: 500,\n fixedContentPos: true,\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row');\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n\n $('.c-modal-video').each(function () {\n var link = $(this).attr('href');\n $(this).magnificPopup({\n type: 'iframe',\n removalDelay: 600,\n fixedContentPos: true,\n iframe: {\n patterns: {\n youtube: {\n src: link\n }\n }\n },\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row');\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n });\n\n $('.c-modal-video-fullscreen').each(function () {\n var link = $(this).attr('href');\n $(this).magnificPopup({\n type: 'iframe',\n removalDelay: 600,\n fixedContentPos: true,\n iframe: {\n patterns: {\n youtube: {\n src: link\n }\n }\n },\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row mfp-iframe-holder-fullscreen');\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n });\n\n $('.c-modal-inline').magnificPopup({\n type: 'inline',\n removalDelay: 500,\n preloader: false,\n fixedContentPos: true,\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row');\n $('.mfp-content > div').addClass('row');\n $('.slick-slider').slick('setPosition');\n $('.c-slider-products-landscape').slick('setPosition');\n $('.c-slider-products-vertical').slick('setPosition');\n matchHeightProducts();\n if ($('.c-block-sampleselection-body').length) {\n $('.c-block-sampleselection-body').getNiceScroll().resize();\n }\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n\n $('.c-modal-autoreplenishment').on('click', function (e) {\n if ($.magnificPopup.instance.st !== undefined) {\n e.stopPropagation();\n $.magnificPopup.instance.st.callbacks = {\n afterClose: function afterClose() {\n if ($('#shopingmodal').length > 0) {\n e.stopPropagation();\n $.magnificPopup.open({\n items: {\n src: '#shopingmodal',\n type: 'inline',\n removalDelay: 500\n }\n });\n }\n }\n };\n }\n\n $.magnificPopup.open({\n items: {\n src: '#autoreplenishmentmodal',\n type: 'inline',\n removalDelay: 500\n }\n });\n });\n\n $(document).on('click', '.c-block-share-toggle.c-modal', function (e) {\n if ($.magnificPopup.instance.st !== undefined) {\n e.stopPropagation();\n $.magnificPopup.instance.st.callbacks = {\n afterClose: function afterClose() {\n if ($('#shopingmodal').length > 0) {\n e.stopPropagation();\n $.magnificPopup.open({\n items: {\n src: '#shopingmodal',\n type: 'inline',\n removalDelay: 500\n }\n });\n }\n }\n };\n }\n\n $.magnificPopup.open({\n items: {\n src: '#sharemodal',\n type: 'inline',\n removalDelay: 500\n }\n });\n });\n\n $('.c-modal-inline--noclose').magnificPopup({\n type: 'inline',\n removalDelay: 500,\n preloader: false,\n fixedContentPos: true,\n showCloseBtn: false,\n closeOnBgClick: false,\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row');\n $('.mfp-content > div').addClass('row');\n matchHeightProducts();\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n\n $('.c-modal-finish').click(function (e) {\n $.magnificPopup.open({\n items: {\n src: $('#finishmodal')\n },\n type: 'inline',\n removalDelay: 500,\n preloader: false,\n fixedContentPos: true,\n showCloseBtn: false,\n closeOnBgClick: false,\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row');\n $('.mfp-content > div').addClass('row');\n matchHeightProducts();\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n return e.preventDefault();\n });\n\n $('.c-modal-gallery').magnificPopup({\n delegate: 'a',\n type: 'image',\n removalDelay: 500,\n fixedContentPos: true,\n gallery: {\n enabled: true\n },\n image: {\n titleSrc: function titleSrc(item) {\n return item.el.attr('title') || item.el.find('img').attr('alt');\n }\n },\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row');\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n\n $('.c-modal-iframe').magnificPopup({\n type: 'iframe',\n removalDelay: 500,\n fixedContentPos: true,\n preloader: false\n });\n\n $('.c-modal-cart-alert').magnificPopup({\n type: 'inline',\n removalDelay: 500,\n fixedContentPos: true,\n preloader: false\n });\n\n $(document).off('click', '.c-modal').on('click', '.c-modal', function (e) {\n if (window.innerWidth < 992) {\n var scrollpos = $(window).scrollTop();\n $('body').attr('data-scroll', scrollpos);\n $('body').addClass('is-noscroll').css({ top: -scrollpos });\n }\n });\n $('.c-modal-close').off('click').on('click', function (e) {\n e.preventDefault();\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n var magnificPopup = $.magnificPopup.instance;\n magnificPopup.close();\n });\n $('.c-modal-cart-alert-close').off('click').on('click', function (e) {\n e.preventDefault();\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n });\n },\n footerInit: function footerInit() {\n $(function () {\n $('.ge-changeregion-toggle').off('click').on('click', function () {\n var scrollpos;\n if ($('.ge-changeregion').is(':hidden')) {\n var scroll_bar = window.innerWidth - $(window).width();\n if ($('.ge-navi-list').is(':visible') || window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('body').attr('data-scroll', scrollpos);\n $('body').addClass('is-noscroll').css({ top: -scrollpos });\n } else {\n var scrollpos = $(window).scrollTop();\n $('body').attr('data-scroll', scrollpos);\n $('body').addClass('is-noscroll').css({ top: -scrollpos });\n }\n\n $('.ge-changeregion').fadeIn();\n $('.slick-slider').slick('setPosition');\n $('.ge-changeregion-close').css('padding-right', scroll_bar);\n if ($('.ge-changeregion-results-list').length) {\n $('.ge-changeregion').addClass('is-result');\n } else {\n $('.ge-changeregion').removeClass('is-result');\n }\n if (window.innerWidth < 992) {\n $('.ge-naviSpToggle').removeClass('is-active');\n $('.ge-header').removeClass('is-active');\n $('.ge-navi').fadeOut();\n }\n }\n return false;\n });\n $('.ge-changeregion-close a').off('click').on('click', function () {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n $('.ge-changeregion').fadeOut();\n $('.ge-changeregion').removeClass('is-result');\n return false;\n });\n });\n },\n headerInit: function headerInit() {\n $(function () {\n $('.js-navi-toggle a').off('click').on('click', function (e) {\n $('.ge-header').toggleClass('is-naviOpen');\n $(this).parent().toggleClass('is-active');\n $('.js-navi-list').slideToggle();\n return false;\n });\n\n //PC MEGA MENU item hover\n $('.ge-navi-list-first-text > a').hover(function () {\n if (window.innerWidth > 992) {\n $('.ge-navi-list-first-panel').not(this).stop().fadeOut();\n $('.ge-navi-list-first-text > a').not(this).removeClass('is-active');\n $(this).addClass('is-active');\n $(this).parent('.ge-navi-list-first-text ').next('.ge-navi-list-first-panel').stop().fadeIn();\n }\n });\n\n //TABLET, MOBILE Navi open\n $('.ge-naviSpToggle > a').off('click').on('click', function () {\n var scrollpos = 0;\n if ($('.ge-navi').is(':hidden')) {\n $('.ge-navi').fadeIn();\n $('.ge-header').addClass('is-active');\n if (window.innerWidth < 992 || $('body').hasClass('is-noscroll')) {\n var scrollpos = $(window).scrollTop();\n $('body').attr('data-scroll', scrollpos);\n $(this).parent().addClass('is-active');\n $('body').addClass('is-noscroll').css({ top: -scrollpos });\n }\n } else {\n $('.ge-navi').fadeOut();\n $('.ge-header').removeClass('is-active');\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $(this).parent().removeClass('is-active');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n }\n return false;\n });\n\n $(document).on('click', function (e) {\n if (!$(e.target).closest('.ge-header').length) {\n $('.js-navi-toggle').removeClass('is-active');\n $('.ge-header').removeClass('is-naviOpen');\n $('.ge-navi-gather>li').removeClass('is-active');\n $('.ge-naviSpToggle').removeClass('is-active');\n if (window.innerWidth > 992) {\n $('.js-navi-list').slideUp();\n } else {\n $('.ge-navi').slideUp();\n }\n }\n });\n });\n\n this.dropdownToggleInit();\n\n $(function () {\n $('.ge-navi-list-dropdown-toggle,.ge-navi-list-dropdown-toggleText').off('click').on('click', function () {\n if (window.innerWidth < 992) {\n if ($(this).parent().next('.ge-navi-list-dropdown-panel').is(':hidden')) {\n $(this).parent().next('.ge-navi-list-dropdown-panel').slideDown();\n $(this).parent().addClass('is-active');\n } else {\n $(this).parent().next('.ge-navi-list-dropdown-panel').slideUp();\n $(this).parent().removeClass('is-active');\n }\n }\n });\n //TABLET, MOBILE Navi item open\n $('.ge-naviSp-dropdown-toggle').off('click').on('click', function () {\n if ($(this).next('.ge-naviSp-dropdown-panel').is(':hidden')) {\n $(this).next('.ge-naviSp-dropdown-panel').slideDown();\n $(this).parent().addClass('is-active');\n } else {\n $(this).next('.ge-naviSp-dropdown-panel').slideUp();\n $(this).parent().removeClass('is-active');\n }\n });\n\n //public header scroll\n geHeaderScroll();\n $(document).on('scroll', function () {\n geHeaderScroll();\n });\n function geHeaderScroll() {\n var scroll = $(window).scrollTop();\n if (scroll >= 1) {\n $('.ge-header').addClass('is-scroll');\n } else {\n if (!$('body').hasClass('is-noscroll')) {\n $('.ge-header').removeClass('is-scroll');\n }\n }\n }\n });\n },\n dropdownToggleInit: function dropdownToggleInit() {\n function headerNavScroll() {\n $('.ge-dropdown-cart-list').niceScroll({\n cursorcolor: '#D7D7D7',\n cursoropacitymin: 0.3,\n cursorwidth: 6,\n autohidemode: false\n });\n $(document).ready(function () {\n setTimeout(function () {\n if ($('.c-block-sampleselection-body').length) {\n $('.c-block-sampleselection-body').niceScroll('ul', {\n cursorcolor: '#D7D7D7',\n cursoropacitymin: 0.3,\n cursorwidth: 6,\n autohidemode: false\n });\n }\n }, 50);\n });\n }\n headerNavScroll();\n $(window).on('resize', function () {\n headerNavScroll();\n });\n $(function () {\n $('.ge-dropdown:not(.ge-dropdown--cart) > a').off('click').on('click', function () {\n if (window.innerWidth > 767) {\n if ($(this).next('.ge-dropdown-box').is(':hidden')) {\n $('.ge-dropdown').removeClass('is-active');\n $('.ge-dropdown-box').fadeOut();\n $(this).next('.ge-dropdown-box').fadeIn();\n $(this).parent().addClass('is-active');\n if ($(this).closest('.ge-dropdown').find('.ge-dropdown-cart-list').length) {\n $('.ge-dropdown-cart-list').getNiceScroll().resize();\n }\n } else {\n $(this).next('.ge-dropdown-box').fadeOut(0);\n $(this).parent().removeClass('is-active');\n }\n return false;\n } else {\n if ($(this).parent()[0].id === 'mini-cart') {\n location.href = $(this).next('div').children('.ge-dropdown-cart-button').children('ul').children('li').children('a')[0].href;\n }\n }\n });\n var getDevice = function () {\n var ua = navigator.userAgent;\n if (ua.indexOf('iPhone') > 0 || ua.indexOf('iPod') > 0 || ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0) {\n return 'sp';\n } else if (ua.indexOf('iPad') > 0 || ua.indexOf('Android') > 0) {\n return 'tab';\n } else {\n return 'other';\n }\n }();\n $('.ge-dropdown--cart').mouseenter(function () {\n if (window.innerWidth > 992 && getDevice == 'other') {\n if ($(this).find('.ge-dropdown-box').is(':hidden')) {\n $('.ge-dropdown').stop().removeClass('is-active');\n $('.ge-dropdown-box').stop().fadeOut();\n $(this).stop().addClass('is-active');\n $(this).find('.ge-dropdown-box').stop().fadeIn(0);\n $('.ge-dropdown-cart-list').niceScroll({\n cursorcolor: '#D7D7D7',\n cursoropacitymin: 0.3,\n cursorwidth: 6,\n autohidemode: false\n });\n $('.ge-dropdown-cart-list').getNiceScroll().resize();\n headerNavScroll();\n }\n }\n });\n $('.ge-dropdown--cart').mouseleave(function () {\n if (window.innerWidth > 992 && getDevice == 'other') {\n if (!$(this).find('.ge-dropdown-box').is(':hidden')) {\n $(this).find('.ge-dropdown-box').stop('true', 'true').fadeOut(0);\n $(this).stop().removeClass('is-active');\n headerNavScroll();\n }\n }\n });\n $(document).on('click', function (e) {\n if (!$(e.target).closest('.ge-dropdown').length && !$(e.target).closest('.ge-search').length && !$(e.target).hasClass('.c-modal') && !$(e.target).closest('.mfp-wrap').length) {\n if (window.innerWidth > 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $('.ge-dropdown').removeClass('is-active');\n $('.ge-dropdown-box').fadeOut();\n }\n });\n });\n },\n searchInit: function searchInit() {\n $(function () {\n //search open\n $('.ge-search-toggle').off('click').on('click', function () {\n var scrollpos;\n if ($('.ge-search').is(':hidden')) {\n var scrollpos = $(window).scrollTop();\n var scroll_bar = window.innerWidth - $(window).width();\n $('body').attr('data-scroll', scrollpos);\n $('body').addClass('is-noscroll').css({ top: -scrollpos });\n $('.ge-search').fadeIn();\n $('.slick-slider').slick('setPosition');\n $('.ge-search-close').css('padding-right', scroll_bar);\n if ($('.ge-search-results-list').length) {\n $('.ge-search').addClass('is-result');\n } else {\n $('.ge-search').removeClass('is-result');\n }\n }\n return false;\n });\n\n //search close\n $('.ge-search-close a').off('click').on('click', function () {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n $('.ge-search').fadeOut();\n $('.ge-search').removeClass('is-result');\n return false;\n });\n\n //search reset\n $('.ge-search-input .c-input-btn-reset').off('click').on('click', function () {\n $(this).closest('.ge-search-input').find('.c-input-box').attr('value', '');\n $(this).closest('.ge-search-input').find('.c-input-btn-search').prop('disabled', true);\n $(this).fadeOut();\n $(this).closest('.ge-search-input').find('.c-input-btn-search').fadeIn();\n return false;\n });\n\n $(window).on('load', function () {\n $('.ge-search-input').each(function () {\n var value = $(this).find('.c-input-box').val();\n if (value == '' && value != value) {\n $(this).find('.c-input-btn-reset').fadeOut();\n $(this).find('.c-input-btn-search').fadeIn();\n }\n });\n });\n $('.ge-search-input .c-input-box').on('change keypress keyup', function () {\n $('.ge-search-input').each(function () {\n var value = $(this).find('.c-input-box').val();\n $(this).find('.c-input-btn-reset').fadeOut();\n $(this).find('.c-input-btn-search').fadeIn();\n });\n });\n //search disabled\n $('input[type=\"search\"]').on('change keypress keyup', function () {\n if ($(this).val() == '') {\n $(this).parent().find('.c-input-btn-search').prop('disabled', true);\n } else {\n $(this).parent().find('.c-input-btn-search').prop('disabled', false);\n }\n });\n matchHeightProducts();\n });\n },\n tmpRecentlyInit: function tmpRecentlyInit() {\n $(function () {\n $('.c-slider-recently').on('init', function () {\n $('.c-modal-inline').magnificPopup({\n type: 'inline',\n removalDelay: 500,\n preloader: false,\n fixedContentPos: true,\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row');\n $('.mfp-content > div').addClass('row');\n $('.slick-slider').slick('setPosition');\n $('.c-slider-products-landscape').slick('setPosition');\n $('.c-slider-products-vertical').slick('setPosition');\n matchHeightProducts();\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n });\n\n $('.c-slider-recently').slick({\n slidesToShow: 4,\n slidesToScroll: 4,\n dots: true,\n responsive: [{\n breakpoint: 991,\n settings: {\n slidesToShow: 3,\n slidesToScroll: 3,\n arrows: false,\n dots: true\n }\n }, {\n breakpoint: 768,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n dots: true\n }\n }]\n });\n });\n },\n tmpVideoInit: function tmpVideoInit() {\n $(function () {\n $('.c-slider-videocarousel').on('init', function () {\n $('.c-modal-video-fullscreen').each(function () {\n var link = $(this).attr('href');\n $(this).magnificPopup({\n type: 'iframe',\n removalDelay: 600,\n fixedContentPos: true,\n iframe: {\n patterns: {\n youtube: {\n src: link\n }\n }\n },\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row mfp-iframe-holder-fullscreen');\n }\n }\n });\n });\n });\n $('.c-slider-videocarousel').slick({\n slidesToShow: 4,\n slidesToScroll: 4,\n dots: true,\n pauseOnHover: false,\n responsive: [{\n breakpoint: 991,\n settings: {\n slidesToShow: 3,\n slidesToScroll: 3,\n arrows: false,\n dots: true\n }\n }, {\n breakpoint: 768,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n dots: true\n }\n }]\n });\n });\n },\n\n //WOW init\n wowInit: function wowInit() {\n $('template').each(function () {\n var $t = $(this),\n toId = $t.attr('data-forid'),\n inHtml = $t.html(),\n $box = $('#' + toId);\n\n if ($box.length) {\n $box.html(inHtml);\n }\n });\n\n $(function () {\n function wowstart() {\n if (window.innerWidth > 992) {\n new WOW().init();\n }\n }\n wowstart();\n var timer = false;\n var windowW = window.innerWidth;\n $(window).on('resize', function (e) {\n if (windowW != window.innerWidth) {\n if (timer !== false) {\n clearTimeout(timer);\n }\n timer = setTimeout(function () {\n wowstart();\n }, 200);\n windowW = window.innerWidth;\n }\n });\n });\n },\n\n commonInit: function commonInit() {\n //search\n this.searchInit();\n\n //header\n this.headerInit();\n\n //footer\n this.footerInit();\n\n //modal\n this.modalInit();\n\n //toggle select\n this.toggleSelectInit();\n\n //WOW init\n this.wowInit();\n\n if ($('.c-list-instagram01').length) {\n var accessToken = '2680730803.d5ced9a.da86b2583a87427e8818b35ad0b3af39';\n var count = 7; // 取得件数\n\n $.ajax({\n url: 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' + accessToken + '&count=' + count,\n dataType: 'jsonp',\n success: function success(data) {\n var insert = '';\n for (var i = 0; i < data['data'].length; i++) {\n insert += \"
      • \";\n insert += '';\n insert += '';\n insert += '';\n\n insert += '
      • ';\n }\n $('.c-list-instagram01').append(insert);\n }\n });\n }\n if ($('.c-list-instagram02').length) {\n var accessToken = '2680730803.d5ced9a.da86b2583a87427e8818b35ad0b3af39';\n var count = 3; // 取得件数\n\n $.ajax({\n url: 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' + accessToken + '&count=' + count,\n dataType: 'jsonp',\n success: function success(data) {\n var insert = '';\n for (var i = 0; i < data['data'].length; i++) {\n insert += \"
      • \";\n insert += '';\n insert += '';\n insert += '';\n\n insert += '
      • ';\n }\n $('.c-list-instagram02').append(insert);\n }\n });\n }\n\n $(function () {\n $('.c-underColumn-toggle >a ').off('click').on('click', function () {\n var main = $(this).closest('.c-underColumn').find('.c-underColumn-main'),\n side = $(this).closest('.c-underColumn').find('.c-underColumn-side');\n if (window.innerWidth < 767 || side.is(':hidden')) {\n main.hide();\n side.show();\n } else {\n main.show();\n side.hide();\n }\n return false;\n });\n });\n\n $(function () {\n //textarea count\n $('.c-textarea').keyup(function () {\n var txtcount = $(this).val().length,\n txtlimit = $(this).maxlength;\n $(this).closest('.c-textarea-box').find('.c-textarea-count .countnow').text(txtcount);\n if (txtcount == 0) {\n $(this).closest('.c-textarea-box').find('.c-textarea-count .countnow').text('0');\n }\n if (txtcount >= txtlimit) {\n $(this).closest('.c-textarea-box').find('.c-textarea-count .countnow').text(txtlimit);\n }\n });\n\n $('.c-dlist-dropdown-link-toggle').off('click').on('click', function () {\n if ($(this).parent().next('dd').is(':hidden')) {\n $(this).parent().addClass('is-active');\n $(this).parent().next('dd').slideDown();\n } else {\n $(this).parent().removeClass('is-active');\n $(this).parent().next('dd').slideUp();\n }\n return false;\n });\n $('.c-dlist-dropdown > dt').off('click').on('click', function () {\n if ($(this).next('dd').is(':hidden')) {\n $(this).addClass('is-active');\n $(this).next('dd').slideDown();\n if ($(this).next('dd').find('.ge-dropdown-cart-list').length) {\n $('.ge-dropdown-cart-list').getNiceScroll().resize();\n $('.ge-dropdown-cart-list').niceScroll({\n cursorcolor: '#D7D7D7',\n cursoropacitymin: 0.3,\n cursorwidth: 6,\n autohidemode: false\n });\n }\n } else {\n $(this).removeClass('is-active');\n $(this).next('dd').slideUp();\n if ($(this).next('dd').find('.ge-dropdown-cart-list').length) {\n $('.ge-dropdown-cart-list').getNiceScroll().remove();\n }\n }\n return false;\n });\n });\n\n this.selectQuantityInit();\n\n // JavaScript Document\n var getDevice = function () {\n var ua = navigator.userAgent;\n if (ua.indexOf('iPhone') > 0 || ua.indexOf('iPod') > 0 || ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0) {\n return 'sp';\n } else if (ua.indexOf('iPad') > 0 || ua.indexOf('Android') > 0) {\n return 'tab';\n } else {\n return 'other';\n }\n }();\n $(function () {\n $(document).on('click', \"[href^='#']:not(.c-modal)\" + \"[href!='#']\", scroll_func);\n $(document).on('click', '#pageTop', function () {\n scroll_func('top');\n });\n\n $('form').submit(function () {\n loading_func('on');\n });\n });\n\n $(function () {\n $(\"[href^='#']:not(.c-modal)\" + \"[href!='#']\").off('click').on('click', function () {\n var headerH = $('.ge-header').height();\n var messageH = $('.ge-header-fixedMessage').height();\n var headerHight = headerH + messageH;\n var href = $(this).attr('href');\n var target = $(href == '#' || href == '' ? 'html' : href);\n var position = target.offset().top - headerHight;\n $('html, body').animate({ scrollTop: position }, 550, 'swing');\n return false;\n });\n });\n\n /* ページTOPへスクロール */\n var scroll_func = function scroll_func(top) {\n if (top == 'top') {\n $('html,body').scrollTop(800).stop().animate({ scrollTop: 0 }, 'slow', 'easeOutQuart');\n } else {\n $('html,body').animate({ scrollTop: $($(this).attr('href')).offset().top }, 'slow', 'easeOutQuart');\n }\n return false;\n };\n /* /ページTOPへスクロール */\n\n var loading_func = function loading_func(mode) {\n if (mode == 'on') {\n $('.modLoading').remove();\n $('body').append('
        ');\n }\n if (mode == 'off') {\n $('.modLoading').fadeOut(function () {\n $(this).remove();\n });\n }\n };\n\n //modLoadingに対するBack Forward Cache 対策\n window.onpageshow = function (event) {\n if (event.persisted) {\n var elements = document.getElementsByClassName('modLoading');\n var length = elements.length;\n if (length) {\n window.location.reload();\n }\n }\n };\n\n $(function () {\n $(window).on('load resize', function () {\n matchHeightAction();\n });\n });\n function matchHeightAction() {\n $('.js-height_01').matchHeight();\n $('.js-height_02').matchHeight();\n $('.js-height_03').matchHeight();\n $('.js-height_04').matchHeight();\n $('.js-height_05').matchHeight();\n $('.js-height_06').matchHeight();\n $('.js-height_07').matchHeight();\n $('.js-height_08').matchHeight();\n $('.js-height_09').matchHeight();\n $('.js-height_10').matchHeight();\n }\n\n $(function () {\n if ($('.js-top-carousel')[0]) {\n var isPC = function isPC() {\n return matchMediaPC.matches;\n };\n\n // sliderInit\n // YouTubeの埋め込み\n var onPlayerReady = function onPlayerReady(event) {\n event.target.mute();\n event.target.getPlaybackQuality('highres');\n sliderReady(event);\n };\n\n var onPlayerStateChange = function onPlayerStateChange(event) {\n if (event.data === YT.PlayerState.ENDED) {\n // $('.js-top-carousel').slick('slickNext');\n }\n };\n\n var onYouTubeIframeAPIReady = function onYouTubeIframeAPIReady() {\n $('.js-top-carousel').find('.c-topCarousel-item').each(function (index) {\n var $el = $(this).find('.c-topCarousel-iframe-wrap');\n if ($el[0]) {\n $('.js-top-carousel').removeClass('is-loading');\n $el.attr('id', 'c-topCarousel-movieid' + index);\n movieList.push({\n index: index,\n videoId: $el.attr('data-yt-id')\n });\n ytPlayers.push('');\n }\n });\n\n if (movieList.length) {\n for (var i = 0; i < movieList.length; i++) {\n var playerVars = {\n // 'autoplay': 1,\n controls: 0,\n // 'loop': 1,\n // 'playlist': movieList[i].videoId,\n disablekb: 1,\n rel: 0,\n playsinline: 1\n };\n\n isSingleAndMovie = $('.js-top-carousel').find('.c-topCarousel-item').length === 1;\n\n if (isSingleAndMovie) {\n playerVars.playlist = movieList[i].videoId;\n playerVars.loop = 1;\n }\n\n var ytPlayer = new YT.Player('c-topCarousel-movieid' + movieList[i].index, {\n width: 640,\n height: 480,\n videoId: movieList[i].videoId,\n playerVars: playerVars,\n events: {\n onReady: onPlayerReady,\n onStateChange: onPlayerStateChange\n }\n });\n ytPlayers[movieList[i].index] = ytPlayer;\n }\n } else {\n sliderReady();\n }\n };\n\n var sliderReady = function sliderReady(event) {\n if (event && $(event.target.getIframe()).attr('id') === 'c-topCarousel-movieid0') {\n if (isPC() && ytPlayers[0] && ytPlayers[0].playVideo) {\n ytPlayers[0].playVideo();\n\n setTimeout(function () {\n $('.js-top-carousel').removeClass('is-loading');\n $('.js-top-carousel').addClass('is-loaded');\n }, 100);\n }\n } else {\n setTimeout(function () {\n $('.js-top-carousel').removeClass('is-loading');\n\n setTimeout(function () {\n $('.js-top-carousel').addClass('is-loaded');\n }, 2500);\n }, 500);\n }\n slideStart(null, 0);\n };\n\n var getBgMovieSize = function getBgMovieSize() {\n var aspectW = 16;\n var aspectH = 9;\n var videoRatio = (aspectW / aspectH).toFixed(2);\n var minWidth = window.innerWidth ? window.innerWidth : $(window).width();\n var minHeight = $(window).height() + 100;\n var widthRatio = minWidth / aspectW;\n var heightRatio = minHeight / aspectH;\n var size = {};\n if (widthRatio > heightRatio) {\n size.width = minWidth;\n size.height = Math.ceil(minWidth / videoRatio);\n } else {\n size.height = minHeight;\n size.width = Math.ceil(minHeight * videoRatio);\n }\n return size;\n };\n\n var sliderInit = function sliderInit() {\n $('.js-top-carousel').on('init', function (event, slick) {\n if (!$(slick.$slides[0]).find('.type-video')[0]) {\n $('.js-top-carousel').removeClass('is-loading');\n }\n if ($(slick.$slides[0]).find('.type-video')[0]) {\n $(slick.$slides[0]).addClass('is-wait');\n }\n\n matchMediaPC.addListener(function (e) {\n if (e.matches) {\n var index = $('.js-top-carousel').find('.slick-active').attr('data-slick-index');\n if (ytPlayers[index] && ytPlayers[index].playVideo) {\n ytPlayers[index].playVideo();\n }\n } else {\n for (var i = 0; i < ytPlayers.length; i++) {\n if (ytPlayers[i].stopVideo) {\n ytPlayers[i].stopVideo();\n }\n }\n }\n });\n });\n\n $('.js-top-carousel').slick({\n fade: true,\n infinite: true,\n dots: true,\n arrows: false\n });\n\n $('.js-top-carousel').find('.slick-dots').find('button').append('');\n\n $('.js-top-carousel').on('beforeChange', function (event, slick, currentSlide, nextSlide) {});\n\n $('.js-top-carousel').on('afterChange', function (event, slick, currentSlide) {\n slideStart(slick, currentSlide);\n });\n };\n\n var slideStart = function slideStart(slick, currentSlide) {\n clearTimeout(nextTimer);\n clearInterval(seekbarTimer);\n clearTimeout(loadingTimer);\n\n for (var i = 0; i < ytPlayers.length; i++) {\n if (ytPlayers[i].stopVideo) {\n ytPlayers[i].stopVideo();\n }\n }\n\n var $currentSlide = $('.js-top-carousel').find('.slick-slide[data-slick-index=\"' + currentSlide + '\"]');\n\n // 動画コンテンツはすべてwait\n $('.js-top-carousel').find('.slick-slide').each(function () {\n if ($(this).find('.type-video')[0]) {\n if (isPC()) {\n $(this).addClass('is-wait');\n }\n }\n });\n\n // 動画が再生開始したらwait解除\n var loop = function loop() {\n if (ytPlayers[currentSlide] && ytPlayers[currentSlide].getPlayerState() === YT.PlayerState.PLAYING) {\n clearTimeout(loadingTimer);\n $currentSlide.removeClass('is-wait');\n }\n loadingTimer = setTimeout(loop, 50);\n };\n if (isPC()) {\n loop();\n } else {\n $currentSlide.removeClass('is-wait');\n }\n\n $('.js-top-carousel').find('.slick-dots').find('.bar').css('width', 0);\n\n if (ytPlayers[currentSlide] && isPC()) {\n ytPlayers[currentSlide].playVideo();\n }\n\n seekbarPlay($currentSlide, currentSlide);\n };\n\n var seekbarPlay = function seekbarPlay($currentSlide, currentSlide) {\n var cnt = 0;\n var step = 10;\n var subtract = 500;\n var $dotsBar = $('.js-top-carousel').find('.slick-dots').find('li').eq(currentSlide).find('.bar');\n\n seekbarTimer = setInterval(function () {\n var duration = carouselDuration;\n\n if (!$currentSlide.find('.type-video')[0] || !isPC()) {\n cnt += 10;\n } else {\n var movieDuration = ytPlayers[currentSlide].getDuration() * 1000 - subtract;\n duration = carouselDuration > movieDuration ? movieDuration : carouselDuration;\n cnt = ytPlayers[currentSlide].getCurrentTime() * 1000;\n }\n\n $dotsBar.css('width', cnt / duration * 100 + '%');\n\n if (duration > 0 && duration < cnt) {\n // 再生終了0.5秒前に次ぎスライドへ移動\n // 関連動画表示対処\n clearInterval(seekbarTimer);\n\n if (isSingleAndMovie) {\n slideStart(null, 0);\n } else {\n $('.js-top-carousel').slick('slickNext');\n }\n }\n }, 10);\n };\n\n var carouselDuration = 15000;\n var movieList = [];\n var ytPlayers = [];\n var nextTimer;\n var seekbarTimer;\n var loadingTimer;\n var isSingleAndMovie = false;\n window.ytPlayers = ytPlayers;\n\n var matchMediaPC = window.matchMedia('screen and (min-width: 1025px)');\n\n if (!isPC()) {\n $('.js-top-carousel').removeClass('is-loading');\n }\n\n var tag = document.createElement('script');\n tag.src = 'https://www.youtube.com/iframe_api';\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n\n window.onYouTubeIframeAPIReady = onYouTubeIframeAPIReady;\n\n $(function () {\n var movieSize = getBgMovieSize();\n $('.type-video').each(function () {\n $(this).css(movieSize);\n });\n $(window).on('resize', function (e) {\n var movieSize = getBgMovieSize();\n $('.type-video').each(function () {\n $(this).css(movieSize);\n });\n });\n\n sliderInit();\n });\n }\n\n /*\r\n if ($('.js-fullscreen')[0] && $('.js-top-carousel')[0]) {\r\n \tvar interval = 200;\r\n \tvar last_time = 0;\r\n \tvar mousewheelevent = 'onwheel' in document ? 'wheel' : 'onmousewheel' in document ? 'mousewheel' : 'DOMMouseScroll';\r\n \tvar isMoving = false;\r\n \t\t\t$('.js-fullscreen').on(mousewheelevent, function(e) {\r\n \t\tif (isMoving) {\r\n \t\t\treturn false;\r\n }\r\n \t\t\t\tif(window.innerWidth > 1024 && $('.ge-search').is(':hidden')) {\r\n \t\t\tvar now = new Date().getTime();\r\n \t\t\tif (now - last_time < interval) return;\r\n \t\t\t\t\tvar delta = e.originalEvent.deltaY ? -(e.originalEvent.deltaY) : e.originalEvent.wheelDelta ? e.originalEvent.wheelDelta : -(e.originalEvent.detail);\r\n \t\t\tvar scrollTop = $(window).scrollTop();\r\n \t\t\tvar mvHeight = $('.js-top-carousel').innerHeight();\r\n \t\t\tvar hHeight = $('#header').innerHeight();\r\n \t\t\tvar mHeight = 0;\r\n \t\t\tvar fixHeight = mvHeight - hHeight;\r\n \t\t\tif($('.ge-header-fixedMessage')[0]) {\r\n \t\t\t\tmHeight = $('.ge-header-fixedMessage').innerHeight();\r\n }\r\n \t\t\t\t\tfixHeight = fixHeight - mHeight;\r\n \t\t\t\t\tif (delta < 0){\r\n \t\t\t\tif (scrollTop + 10 < fixHeight) {\r\n \t\t\t\t\tisMoving = true;\r\n \t\t\t\t\tif (scrollTop >= 5) { \r\n \t\t\t\t\t\t$('html, body').stop().animate({scrollTop: fixHeight}, 1000, 'easeOutQuad', function() {\r\n \t\t\t\t\t\t\tisMoving = false;\r\n \t\t\t});\r\n \t\t} else { \r\n \t\t\t$('html, body').stop().animate({scrollTop: 5}, 450, 'easeOutQuad', function() {\r\n \t\t\t\thHeight = $('#header').innerHeight();\r\n \t\t\t\tfixHeight = mvHeight - hHeight - mHeight;\r\n \t\t\t\t$('html, body').stop().animate({scrollTop: fixHeight}, 1000, 'easeOutQuad', function() {\r\n \t\t\t\t\tisMoving = false;\r\n \t\t\t\t});\r\n \t\t\t});\r\n \t\t}\r\n \t\tlast_time = now;\r\n \t\treturn false;\r\n \t}\r\n } else {\r\n \tif (scrollTop <= fixHeight) {\r\n \t\tisMoving = true;\r\n \t\t$('html, body').stop().animate({scrollTop: 0}, 1000, 'easeOutQuad', function() {\r\n \t\t\tisMoving = false;\r\n \t\t});\r\n \t\tlast_time = now;\r\n \t\treturn false;\r\n \t}\r\n }\r\n }\r\n });\r\n }\r\n */\n });\n\n $(function () {\n $('.c-block-fullscreenModules--overlay .img source').each(function () {\n var srcset = $(this).attr('srcset');\n $(this).closest('.img').css('background-image', 'url(' + srcset + ')').addClass('isFinish');\n });\n\n if ($('.js-fullscreen')[0] && $('.c-block-fullscreenModules--overlay')[0] && $('.c-block-fullscreenModules--overlay-blanc-block')[0]) {\n var timer;\n var index = 0;\n var interval = 200;\n var last_time = 0;\n var mousewheelevent = 'onwheel' in document ? 'wheel' : 'onmousewheel' in document ? 'mousewheel' : 'DOMMouseScroll';\n var isMoving = false;\n\n $('.js-fullscreen').on(mousewheelevent, function (e) {\n if (isMoving) {\n return;\n }\n\n if (window.innerWidth > 992 && $('.ge-search').is(':hidden')) {\n var now = new Date().getTime();\n if (now - last_time > interval) {\n var delta = e.originalEvent.deltaY ? -e.originalEvent.deltaY : e.originalEvent.wheelDelta ? e.originalEvent.wheelDelta : -e.originalEvent.detail;\n var scrollTop = $(window).scrollTop();\n var wHeight = window.innerHeight;\n var vHeight = $('.c-block-fullscreenModules--overlay').innerHeight();\n var hHeight = $('#header').innerHeight();\n var vTop = $('.c-block-fullscreenModules--overlay').offset().top;\n var nTop = $('.c-block-fullscreenModules--overlay-blanc-block').next().offset().top;\n if ($('.ge-header-fixedMessage').length) {\n var mHeight = $('.ge-header-fixedMessage').innerHeight();\n var pos = nTop + hHeight + mHeight;\n } else {\n var pos = nTop + hHeight;\n }\n\n /*\r\n if (delta < 0){\r\n if(scrollTop < nTop ) {\r\n isMoving = true;\r\n $(\"html,body\").stop().animate({scrollTop:nTop + 5},1000,\"easeOutQuad\", function() {\r\n isMoving = false;\r\n });\r\n return false;\r\n }\r\n } else {\r\n if(1 < scrollTop && scrollTop < pos ) {\r\n isMoving = true;\r\n $(\"html,body\").stop().animate({scrollTop:0},1000,\"easeOutQuad\", function() {\r\n isMoving = false;\r\n });\r\n return false;\r\n }\r\n }\r\n */\n if (scrollTop > nTop) {\n $('.c-block-fullscreenModules--overlay').css({\n 'z-index': -2,\n opacity: 0,\n display: 'none'\n }).addClass('is-hidden');\n } else {\n $('.c-block-fullscreenModules--overlay').css({\n 'z-index': 0,\n opacity: 1,\n display: 'block'\n }).removeClass('is-hidden');\n }\n }\n last_time = now;\n }\n });\n\n $(window).on('load scroll resize', function (e) {\n if ($('.js-fullscreen').length) {\n if (window.innerWidth > 992) {\n var scrollTop = $(window).scrollTop();\n var wHeight = window.innerHeight;\n var vHeight = $('.c-block-fullscreenModules--overlay').innerHeight();\n var hHeight = $('#header').innerHeight();\n var vTop = $('.c-block-fullscreenModules--overlay').offset().top;\n var nTop = $('.c-block-fullscreenModules--overlay-blanc-block').next().offset().top;\n if ($('.ge-header-fixedMessage').length) {\n var mHeight = $('.ge-header-fixedMessage').innerHeight();\n var pos = nTop + hHeight + mHeight;\n } else {\n var pos = nTop + hHeight;\n }\n if (scrollTop > nTop) {\n $('.c-block-fullscreenModules--overlay').css({\n 'z-index': -2,\n opacity: 0,\n display: 'none'\n }).addClass('is-hidden');\n } else {\n $('.c-block-fullscreenModules--overlay').css({\n 'z-index': 0,\n opacity: 1,\n display: 'block'\n }).removeClass('is-hidden');\n }\n }\n }\n });\n }\n });\n\n $(function () {\n var targetList, list, visiblelist;\n\n function btnCheck() {\n list = $('.js-order-list .js-order-list-item').length, visiblelist = $('.js-order-list .js-order-list-item:visible').length;\n if (visiblelist >= list) {\n $('.js-order-btn').hide();\n }\n }\n $('.js-order-btn-more').off('click').on('click', function () {\n var i = 0,\n list = $('.js-order-list .js-order-list-item').length,\n visiblelist = $('.js-order-list .js-order-list-item:visible').length,\n btnT = $('.js-order-btn').offset().top,\n winT = $(window).scrollTop();\n console.log(winT);\n $('.js-order-list .js-order-list-item:hidden').eq(i).fadeIn();\n i++;\n btnCheck();\n $('html, body').animate({ scrollTop: winT }, 0, 'swing');\n return false;\n });\n\n $('.js-order-btn-all').off('click').on('click', function () {\n var i = 0,\n list = $('.js-order-list .js-order-list-item').length,\n visiblelist = $('.js-order-list .js-order-list-item:visible').length,\n btnT = $('.js-order-btn').offset().top,\n winT = $(window).scrollTop();\n $('.js-order-list .js-order-list-item:hidden').fadeIn();\n btnCheck();\n var listH = $('.js-order-list'),\n position = btnT + listH;\n if (window.innerWidth > 767) {\n $('html, body').animate({ scrollTop: position }, 0, 'swing');\n }\n $('html, body').animate({ scrollTop: winT }, 0, 'swing');\n return false;\n });\n });\n\n $(function () {\n function scrollbarStyleChange() {\n $(document).ready(function () {\n if (getDevice == 'other') {\n setTimeout(function () {\n $('.c-textarea--smartScroll').niceScroll({\n cursorcolor: '#D7D7D7',\n cursoropacitymin: 0.3,\n cursorwidth: 6,\n autohidemode: false\n });\n }, 50);\n } else {\n $('.c-textarea--smartScroll').attr('style', 'overflow-y: auto;');\n }\n });\n }\n\n scrollbarStyleChange();\n $(window).on('resize', function () {\n if (getDevice == 'other') {\n scrollbarStyleChange();\n }\n });\n });\n },\n pdpInit: function pdpInit() {\n $(function () {\n //AUTO-REPLENISHMENT\n $('.js-autoreplenishment').change(function () {\n if ($(this).is(':checked')) {\n $(this).closest('li').find('.js-autoreplenishment-text').fadeIn();\n } else {\n $(this).closest('li').find('.js-autoreplenishment-text').fadeOut();\n }\n });\n });\n\n $(function () {\n function videoControl(action, target) {\n if ($('.c-slider-rich-video').find('iframe').length) {\n var currentSlide = target.find('.slick-current');\n var iframe = $('iframe', currentSlide);\n var $playerWindow = iframe[0].contentWindow;\n $playerWindow.postMessage('{\"event\":\"command\",\"func\":\"' + action + '\",\"args\":\"\"}', '*');\n }\n }\n\n $('.c-slider-rich-video').on('afterChange', function (event, slick, currentSlide, nextSlide) {\n slick = $(slick.$slider);\n videoControl('playVideo', slick);\n });\n\n $('.c-slider-rich-video').on('beforeChange', function (event, slick, currentSlide, nextSlide) {\n slick = $(slick.$slider);\n videoControl('stopVideo', slick);\n });\n\n $('.c-slider-rich-video').each(function (i) {\n $(this).addClass('c-slider-rich-video' + i);\n $('.c-slider-rich-video' + i).on('init', function () {\n $(this).find('.c-modal-video').each(function () {\n var link = $(this).attr('href');\n console.log(link);\n $(this).find('.c-modal-video').magnificPopup({\n type: 'iframe',\n removalDelay: 600,\n fixedContentPos: true,\n iframe: {\n patterns: {\n youtube: {\n src: link\n }\n }\n },\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row');\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n });\n });\n $('.c-slider-rich-video' + i).not('.slick-initialized').slick({\n centerMode: true,\n centerPadding: '17.5%',\n arrows: false,\n slidesToShow: 1,\n asNavFor: '.c-slider-rich-description' + i,\n variableWidth: true,\n responsive: [{\n breakpoint: 992,\n settings: {\n centerPadding: '20%',\n variableWidth: false\n }\n }, {\n breakpoint: 767,\n settings: {\n centerPadding: '10%',\n variableWidth: false\n }\n }]\n });\n });\n $('.c-slider-rich-description').each(function (i) {\n $(this).addClass('c-slider-rich-description' + i);\n $('.c-slider-rich-description' + i).not('.slick-initialized').slick({\n asNavFor: '.c-slider-rich-video' + i,\n touchMove: false\n });\n });\n });\n\n $(function () {\n if ($('.c-block-shoppingDock').length) {\n var shoppingDockHide = function shoppingDockHide() {\n $('.c-block-shoppingDock').hide();\n };\n\n var shoppingDockShow = function shoppingDockShow() {\n $('.c-block-shoppingDock').fadeIn();\n };\n\n shoppingDockHide();\n $(window).scroll(function () {\n var winT = $(window).scrollTop();\n var winH = $(window).height();\n var varH = $('.c-block-shoppingDock').innerHeight();\n var varTop = $('.c-block-shoppingDock').offset().top;\n var varPos = varH + varTop;\n var footT = $('#footer').offset().top;\n if (winT > 100) {\n shoppingDockShow();\n } else {\n shoppingDockHide();\n }\n if (varPos >= footT) {\n $('.c-block-shoppingDock').addClass('nofixed');\n } else {\n $('.c-block-shoppingDock').removeClass('nofixed');\n }\n });\n }\n });\n\n $(function () {\n function sliderMobile() {\n var width = window.innerWidth;\n if (width <= 767) {\n $('.c-slider-mobile').not('.slick-initialized').slick({\n arrows: false,\n dots: true\n });\n } else {\n $('.c-slider-mobile.slick-initialized').slick('unslick');\n }\n }\n sliderMobile();\n $(window).resize(function () {\n sliderMobile();\n });\n\n var timer;\n function sliderMobileArrow() {\n var width = window.innerWidth;\n if (width <= 767) {\n $('.c-block-richcontent01-content-list').not('.slick-initialized').slick({\n arrows: true\n });\n sliderArrowPositionSet();\n } else {\n $('.c-block-richcontent01-content-list.slick-initialized').slick('unslick');\n }\n }\n function sliderArrowPositionSet() {\n clearTimeout(timer);\n timer = setTimeout(function () {\n $('.c-block-richcontent01-content-list').each(function () {\n var $_t = $(this);\n var $photo = $_t.find('.slick-active').find('.c-block-richcontent01-content-list-item').find('.photo');\n var $arrow = $_t.find('.slick-arrow');\n if ($arrow[0] && $photo[0]) {\n var top = $photo.position().top;\n var height = $photo.height();\n var center = top + height / 2;\n $arrow.css({\n top: center\n });\n }\n });\n }, 100);\n }\n sliderMobileArrow();\n $(window).on('load', function () {\n if (window.innerWidth <= 767) {\n sliderArrowPositionSet();\n }\n });\n $(window).on('resize', function () {\n sliderMobileArrow();\n });\n });\n $(function () {\n $('.c-slider-fullscreenModulesImage').not('.slick-initialized').slick({\n asNavFor: '.c-slider-fullscreenModulesList',\n arrows: false\n });\n $('.c-slider-fullscreenModulesList').not('.slick-initialized').slick({\n asNavFor: '.c-slider-fullscreenModulesImage'\n });\n\n if ($('.c-slider-products-vertical').length > 0) {\n $('.c-slider-products-landscape').not('.slick-initialized').slick({\n asNavFor: '.c-slider-products-vertical',\n arrows: false,\n responsive: [{\n breakpoint: 991,\n settings: {\n dots: true\n }\n }]\n });\n } else {\n $('.c-slider-products-landscape').not('.slick-initialized').slick();\n }\n });\n $(function () {\n $('.c-slider-products-vertical').on('init', function () {\n $('.c-modal-img').magnificPopup({\n type: 'image',\n removalDelay: 500,\n fixedContentPos: true,\n callbacks: {\n open: function open() {\n $('.mfp-container').addClass('row');\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ top: 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n if ($(this).find('.c-block-shopingmodal-change-image').length < 5) {\n $(this).addClass('is-nobutton');\n }\n });\n if ($('.c-slider-products-vertical').hasClass('is-standard')) {\n var thumbnail = 3;\n } else {\n var thumbnail = 5;\n }\n $('.c-slider-products-vertical').not('.slick-initialized').slick({\n asNavFor: '.c-slider-products-landscape',\n vertical: true,\n verticalSwiping: true,\n slidesToShow: thumbnail,\n focusOnSelect: true\n });\n $('.c-slider-products-landscape').on('afterChange', function (event, slick, currentSlide) {\n $('.c-slider-products-vertical').find('.slick-current').removeClass('slick-current');\n $('.c-slider-products-vertical').find('.slick-slide').eq(currentSlide).addClass('slick-current');\n });\n });\n\n $(function () {\n //SHARE\n $('.c-block-share-toggle').off('click').on('click', function () {\n if ($(this).closest('.c-block-share').find('.c-block-share-box').is(':hidden')) {\n $(this).closest('.c-block-share').find('.c-block-share-box').fadeIn().removeClass('mfp-hide');\n } else {\n $(this).closest('.c-block-share').find('.c-block-share-box').fadeOut(function () {\n $(this).addClass('mfp-hide');\n });\n }\n if (window.innerWidth >= 767) {\n return false;\n }\n });\n $('.c-block-share-close').off('click').on('click', function () {\n $(this).closest('.c-block-share').find('.c-block-share-box').fadeOut(function () {\n $(this).addClass('mfp-hide');\n });\n return false;\n });\n $(document).on('click touchstart', function (e) {\n if (!$(e.target).closest('.c-block-share-box').length) {\n if (window.innerWidth >= 767) {\n if ($('.c-block-share-box').is(':visible')) {\n $('.c-block-share-box').fadeOut(function () {\n $(this).addClass('mfp-hide');\n });\n }\n }\n }\n });\n //textarea count\n $('.c-textarea').keyup(function () {\n var txtcount = $(this).val().length,\n txtlimit = $(this).attr('maxlength'),\n txtDown = txtlimit - txtcount;\n $(this).closest('.c-textarea-box').find('.c-textarea-count:not(.js-countDown) .countnow').text(txtcount);\n $(this).closest('.c-textarea-box').find('.c-textarea-count.js-countDown .countlimit').text(txtDown);\n if (txtcount == 0) {\n $(this).closest('.c-textarea-box').find('.c-textarea-count .countnow').text('0');\n }\n if (txtcount >= txtlimit) {\n $(this).closest('.c-textarea-box').find('.c-textarea-count .countnow').text(txtlimit);\n }\n });\n // Cut out character string of textarea when above limitting text is submited.\n $('button#sendBtn').on('mousedown', function () {\n var textareaElm = $('.c-textarea');\n if (textareaElm.length > 0 && textareaElm.val().length > textareaElm[0].dataset.characterLimit) {\n textareaElm.val(textareaElm.val().substr(0, textareaElm[0].dataset.characterLimit));\n }\n });\n\n //AUTO-REPLENISHMENT\n $('.js-autoreplenishment').change(function () {\n if ($(this).is(':checked')) {\n $(this).closest('li').find('.js-autoreplenishment-text').fadeIn();\n } else {\n $(this).closest('li').find('.js-autoreplenishment-text').fadeOut();\n }\n });\n });\n $(function () {\n $('.c-underColumn-toggle >a ').on('click', function () {\n var main = $(this).closest('.c-underColumn').find('.c-underColumn-main'),\n side = $(this).closest('.c-underColumn').find('.c-underColumn-side');\n if (window.innerWidth < 767 || side.is(':hidden')) {\n main.hide();\n side.show();\n } else {\n main.show();\n side.hide();\n }\n return false;\n });\n });\n $(function () {\n $('.c-dlist_01 dt').off('click').on('click', function () {\n if (window.innerWidth < 991) {\n if ($(this).next('dd').is(':hidden')) {\n $(this).addClass('is-active');\n $(this).next('dd').slideDown();\n } else {\n $(this).removeClass('is-active');\n $(this).next('dd').slideUp();\n }\n }\n return false;\n });\n $('.c-dlist-dropdown-link-toggle').on('click', function () {\n if ($(this).parent().next('dd').is(':hidden')) {\n $(this).parent().addClass('is-active');\n $(this).parent().next('dd').slideDown();\n } else {\n $(this).parent().removeClass('is-active');\n $(this).parent().next('dd').slideUp();\n }\n return false;\n });\n $('.c-dlist-dropdown > dt').on('click', function () {\n if ($(this).next('dd').is(':hidden')) {\n $(this).addClass('is-active');\n $(this).next('dd').slideDown();\n } else {\n $(this).removeClass('is-active');\n $(this).next('dd').slideUp();\n }\n return false;\n });\n });\n $(function () {\n if ($('.c-block-shoppingDock').length) {\n var shoppingDockHide = function shoppingDockHide() {\n $('.c-block-shoppingDock').hide();\n };\n\n var shoppingDockShow = function shoppingDockShow() {\n $('.c-block-shoppingDock').fadeIn();\n };\n\n shoppingDockHide();\n $(window).scroll(function () {\n var winT = $(window).scrollTop();\n var winH = $(window).height();\n var varH = $('.c-block-shoppingDock').innerHeight();\n var varTop = $('.c-block-shoppingDock').offset().top;\n var varPos = varH + varTop;\n var footT = $('#footer').offset().top;\n if (winT > 100) {\n shoppingDockShow();\n } else {\n shoppingDockHide();\n }\n if (varPos >= footT) {\n $('.c-block-shoppingDock').addClass('nofixed');\n } else {\n $('.c-block-shoppingDock').removeClass('nofixed');\n }\n });\n }\n });\n\n $(function () {\n if ($('.c-block-lineBox').length) {\n var t = function t() {\n $('.c-block-lineBox-wrapper').find('.c-block-lineBox').each(function (e) {\n var t = $(this).offset().top,\n i = ($(this).index(), $(this).children('.c-block-lineBox-circle').offset().top);\n o.push(t), n.push(i);\n }), $('.c-block-lineBox-circleMove').css('top', n[0] + 'px');\n };\n\n var e,\n o = [],\n n = [],\n s = $(window).scrollTop(),\n r = 0;\n\n t(), $(window).on('load resize', function () {\n t();\n }), $(window).on('scroll', function () {\n i();\n });\n var i = function i() {\n clearTimeout(e), e = setTimeout(function () {\n var e = $(window).scrollTop(),\n t = $(window).height(),\n i = ($('#header').innerHeight(), []);\n $('.c-block-lineBox').each(function (e) {\n var t = $(this);\n i[e] = t.find('.c-block-lineBox-circle').offset().top;\n }), e < s ? i[r - 1] >= e && ($('.c-block-lineBox-circleMove').stop().css('top', i[r - 1] + 'px'), $('.c-block-lineBox').children('.c-block-lineBox-circle').removeClass('is-active is-first'), $('.c-block-lineBox').eq(r - 1).children('.c-block-lineBox-circle').addClass('is-active'), 0 != r && r--) : i[r + 1] < e + t - t / 5 && ($('.c-block-lineBox-circleMove').stop().css('top', i[r + 1] + 'px'), $('.c-block-lineBox').children('.c-block-lineBox-circle').removeClass('is-active is-first'), $('.c-block-lineBox').eq(r + 1).children('.c-block-lineBox-circle').addClass('is-active'), r++), s = e;\n }, 30);\n };\n }\n }), $(function () {\n $('.js-giftcardbalancemodal-send').on('click', function () {\n if ($('.c-block-giftcardbalance-block-send').length) {\n $('.c-block-giftcardbalance-block-send').hide();\n $('.c-block-giftcardbalance-block-receive').show();\n }\n return false;\n });\n });\n\n // JavaScript Document\n $(function () {\n $(document).on('click', \"[href^='#']:not(.c-modal)\" + \"[href!='#']\", scroll_func);\n $(document).on('click', '#pageTop', function () {\n scroll_func('top');\n });\n\n $('form').submit(function () {\n loading_func('on');\n });\n });\n\n $(function () {\n $(\"[href^='#']:not(.c-modal)\" + \"[href!='#']\").on('click', function () {\n var headerH = $('.ge-header').height();\n var messageH = $('.ge-header-fixedMessage').height();\n var headerHight = headerH + messageH;\n var href = $(this).attr('href');\n var target = $(href == '#' || href == '' ? 'html' : href);\n if (target[0]) {\n var position = target.offset().top - headerHight;\n $('html, body').animate({ scrollTop: position }, 550, 'swing');\n return false;\n }\n });\n });\n\n /* ページTOPへスクロール */\n var scroll_func = function scroll_func(top) {\n if (top == 'top') {\n $('html,body').scrollTop(800).stop().animate({ scrollTop: 0 }, 'slow', 'easeOutQuart');\n } else {\n var $target = $($(this).attr('href'));\n if ($target[0]) {\n $('html,body').animate({ scrollTop: $target.offset().top }, 'slow', 'easeOutQuart');\n }\n }\n return false;\n };\n /* /ページTOPへスクロール */\n\n var loading_func = function loading_func(mode) {\n if (mode == 'on') {\n $('.modLoading').remove();\n $('body').append('
        ');\n }\n if (mode == 'off') {\n $('.modLoading').fadeOut(function () {\n $(this).remove();\n });\n }\n };\n\n //modLoadingに対するBack Forward Cache 対策\n window.onpageshow = function (event) {\n if (event.persisted) {\n var elements = document.getElementsByClassName('modLoading');\n var length = elements.length;\n if (length) {\n window.location.reload();\n }\n }\n };\n\n $(function () {\n function btnCheck() {\n list = $('.js-order-list .js-order-list-item').length, visiblelist = $('.js-order-list .js-order-list-item:visible').length;\n if (visiblelist >= list) {\n $('.js-order-btn').hide();\n }\n }\n $('.js-order-btn-more').on('click', function () {\n var i = 0,\n list = $('.js-order-list .js-order-list-item').length,\n visiblelist = $('.js-order-list .js-order-list-item:visible').length;\n $('.js-order-list .js-order-list-item:hidden').eq(i).fadeIn();\n i++;\n btnCheck();\n return false;\n });\n\n $('.js-order-btn-all').on('click', function () {\n var i = 0,\n list = $('.js-order-list .js-order-list-item').length,\n visiblelist = $('.js-order-list .js-order-list-item:visible').length;\n $('.js-order-list .js-order-list-item:hidden').fadeIn();\n btnCheck();\n return false;\n });\n });\n $(function () {\n if ($('#topics-video').length) {\n var resizeMovie = function resizeMovie() {\n var adjustWidth = $(window).width();\n var adjustHeight = $(window).height();\n if (adjustHeight > adjustWidth / movieRatio) {\n adjustWidth = adjustHeight * movieRatio;\n }\n $('#topics-video').css({\n width: adjustWidth * 1.4,\n height: adjustWidth / movieRatio * 1.4\n });\n // console.log(w, h, mw, mh);\n };\n\n var onPlayerReady = function onPlayerReady(event) {\n $('#topics-video').fadeIn(1000);\n player.setVolume(0);\n };\n\n var onPlayerStateChange = function onPlayerStateChange(event) {\n if (event.data == YT.PlayerState.ENDED) {\n player.playVideo();\n player.setVolume(0);\n }\n };\n\n $('body').append('