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,GAAGL,EAAS4C,MAAMzD,GAAgC,IAAxBmD,EAAgBnD,KAAa,CACtD,IAAIG,KAAYoD,EACZrD,EAAoB8B,EAAEuB,EAAapD,KACrCD,EAAoBQ,EAAEP,GAAYoD,EAAYpD,IAGhD,GAAGqD,EAAS,IAAI5C,EAAS4C,EAAQtD,EAClC,CAEA,IADGoD,GAA4BA,EAA2BnE,GACrD+B,EAAIL,EAASlB,OAAQuB,IACzBkC,EAAUvC,EAASK,GAChBhB,EAAoB8B,EAAEmB,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOlD,EAAoBS,EAAEC,EAAO,EAGjC8C,EAAqBV,KAA0B,oBAAIA,KAA0B,qBAAK,GACtFU,EAAmBxG,QAAQmG,EAAqBM,KAAK,KAAM,IAC3DD,EAAmBE,KAAOP,EAAqBM,KAAK,KAAMD,EAAmBE,KAAKD,KAAKD,G,KChDvFxD,EAAoB2D,QAAKxD,ECGzB,IAAIyD,EAAsB5D,EAAoBS,OAAEN,EAAW,CAAC,MAAM,IAAOH,EAAoB,QAC7F4D,EAAsB5D,EAAoBS,EAAEmD,E","sources":["webpack://electro/webpack/runtime/chunk loaded","webpack://electro/./js/src/pages/single-kfd_product.js","webpack://electro/./js/src/utils/bv.js","webpack://electro/webpack/bootstrap","webpack://electro/webpack/runtime/compat get default export","webpack://electro/webpack/runtime/define property getters","webpack://electro/webpack/runtime/global","webpack://electro/webpack/runtime/hasOwnProperty shorthand","webpack://electro/webpack/runtime/make namespace object","webpack://electro/webpack/runtime/runtimeId","webpack://electro/webpack/runtime/publicPath","webpack://electro/webpack/runtime/jsonp chunk loading","webpack://electro/webpack/runtime/nonce","webpack://electro/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","import Swiper from 'swiper/bundle';\nimport openBVModal from '../utils/bv';\n\n/**\n * init slider for product detail page\n */\nclass SingleKfd_product {\n constructor() {\n openBVModal();\n this.initializeSlider();\n }\n\n initializeSlider() {\n const swiper = new Swiper('.js-gallery-swiper', {\n slidesPerView: 1,\n });\n\n $('.js-view-image')\n .off('click')\n .on('click', (e) => {\n e.preventDefault();\n\n $('.js-view-image').removeClass('active');\n\n $(e.currentTarget).addClass('active');\n\n const slide = $(e.currentTarget).data('slide');\n swiper.slideTo(slide);\n });\n }\n}\n\n/**\n * Check if element is in viewport\n *\n * @param element\n */\nfunction elementInViewport(element) {\n let el = element;\n let top = el.offsetTop;\n let left = el.offsetLeft;\n const width = el.offsetWidth;\n const height = el.offsetHeight;\n\n while (el.offsetParent) {\n el = el.offsetParent;\n top += el.offsetTop;\n left += el.offsetLeft;\n }\n\n return (\n top < window.pageYOffset + window.innerHeight &&\n left < window.pageXOffset + window.innerWidth &&\n top + height > window.pageYOffset &&\n left + width > window.pageXOffset\n );\n}\n\n/**\n * Initialize Sticky Nav\n *\n */\nfunction stickyNav() {\n const steps = document.querySelectorAll('[data-step]');\n let currentStep = 0;\n\n // Add some extra padding to the Common Branding Footer\n const commonBrandingFooter = document.querySelector('.common-branding-banner--footer');\n commonBrandingFooter.classList.add('extra-padding');\n\n $('.js-previous-step').on('click', (e) => {\n e.preventDefault();\n\n if (currentStep > 0) {\n currentStep -= 1;\n steps[currentStep].scrollIntoView({ behavior: 'smooth' });\n }\n });\n\n $('.js-next-step').on('click', (e) => {\n e.preventDefault();\n\n if (currentStep < steps.length - 1) {\n currentStep += 1;\n steps[currentStep].scrollIntoView({ behavior: 'smooth' });\n }\n });\n\n $('.js-goto-step').on('click', (e) => {\n e.preventDefault();\n\n const goto = e.currentTarget.getAttribute('data-goto');\n\n steps.forEach((step, index) => {\n if (step.id === goto) {\n currentStep = index;\n steps[currentStep].scrollIntoView({ behavior: 'smooth' });\n }\n });\n });\n}\n\nfunction initializePage() {\n stickyNav();\n new SingleKfd_product();\n}\n\nwindow.addEventListener('DOMContentLoaded', initializePage);\n","export default function openBVModal() {\n // check get parameters.\n const bvReviewModal = window.KFD_Params.has('bveventid');\n if (bvReviewModal) {\n // Add mutation observer for when .bv-write-review is available\n // Create a MutationObserver instance\n const observer = new MutationObserver((mutationsList, observer) => {\n mutationsList.forEach((mutation) => {\n if (mutation.type === 'childList') {\n const bvWriteReview = document.querySelector('.bv-write-review') || document.querySelector('.bv-first-to-review');\n if (bvWriteReview) {\n // open the BV review populated with the BV ID info\n console.log(bvWriteReview)\n // scroll to the bvWriteReview\n bvWriteReview.scrollIntoView({\n behavior: \"smooth\",\n block: \"center\",\n inline: \"nearest\"\n });\n bvWriteReview.click();\n // Disconnect observer\n observer.disconnect();\n }\n }\n })\n });\n\n // Start observing changes in the DOM\n observer.observe(document, {childList: true, subtree: true});\n\n\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.j = 293;","__webpack_require__.p = \"/wp-content/themes/electro/js/build/\";","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t293: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkelectro\"] = self[\"webpackChunkelectro\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [121], () => (__webpack_require__(4507)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","SingleKfd_product","_classCallCheck","window","KFD_Params","has","MutationObserver","mutationsList","observer","forEach","mutation","type","bvWriteReview","document","querySelector","console","log","scrollIntoView","behavior","block","inline","click","disconnect","observe","childList","subtree","this","initializeSlider","key","value","swiper","Swiper","slidesPerView","$","off","on","e","preventDefault","removeClass","currentTarget","addClass","slide","data","slideTo","addEventListener","steps","currentStep","querySelectorAll","classList","add","length","_goto","getAttribute","step","index","id","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","call","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","Object","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","p","b","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","bind","push","nc","__webpack_exports__"],"sourceRoot":""}