{"version":3,"sources":["webpack:///./node_modules/@bluekiri/alexandria/helpers/domHelpers.js","webpack:///./components/layout-logitravel-gift-card/client/js/index.js","webpack:///./components/layout-logitravel-gift-card/client/js/components.js"],"names":["module","exports","elementExist","element","document","querySelector","toNode","html","DOMParser","parseFromString","body","childNodes","require","_require2","resolveComponents","getCookies","getTopButton","getHeader","selector","arguments","length","undefined","config","_objectSpread","dataset","result","JSON","parse","__webpack_public_path__","publicPath","components","filter","component","name","map","loader","concat","observer","IntersectionObserver","entries","forEach","entry","intersectionRatio","target","reduce","acc","then","unobserve","mod","default","root","rootMargin","threshold","observe","COMPONENTS"],"mappings":";2EAQAA,EAAOC,QAAU,CACbC,aALiB,SAAAC,GAAO,QAAMC,SAASC,cAAcF,IAMrDG,OAJW,SAAAC,GAAI,OAAI,IAAIC,WAAYC,gBAAgBF,EAAM,aAAaG,KAAKC,c,qwBCD/EC,EAAQ,KAER,IAAQV,EAAiBU,EAAQ,KAAzBV,aAERW,EAAmED,EAAQ,KAAnEE,EAAiBD,EAAjBC,kBAAmBC,EAAUF,EAAVE,WAAYC,EAAYH,EAAZG,aAAcC,EAASJ,EAATI,WAErD,WAA6F,IAA1DC,EAAQC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,8CAC1C,GAAIjB,EAAagB,GAAW,CACxB,IAAMf,EAAUC,SAASC,cAAca,GAEjCI,EAAMC,EAAA,GACJ,WACA,IAAKpB,EAAQqB,QAAQF,OAAQ,MAAO,GAEpC,IAAMG,EAASC,KAAKC,MAAMxB,EAAQqB,QAAQF,QAE1C,OADAnB,EAAQqB,QAAQF,OAAS,GAClBG,EALP,IAaRG,IAA0BN,EAAOO,WAGjC,IAAMC,EAAahB,IACdiB,QAAO,SAAAC,GAAS,MAAuB,WAAnBA,EAAUC,QAC9BC,KAAI,SAAAF,GAAS,MAAK,CACfG,OAAQH,EAAUG,OAClBhC,QAASC,SAASC,cAAc,oBAAD+B,OAAqBJ,EAAUC,KAAI,WAErEF,QAAO,SAAAC,GAAS,OAAIA,EAAU7B,WAM7BkC,EAAW,IAAIC,sBACjB,SAAAC,GACIA,EAAQC,SAAQ,SAAAC,GACRA,EAAMC,kBAAoB,IAW1BP,EAVmBL,EACdC,QAAO,SAAAC,GAAS,OAAIA,EAAU7B,UAAYsC,EAAME,UAChDC,QAAO,SAAAC,GAAG,OAAIA,KAFXV,UAUCW,MAAK,SAAA9C,GACVqC,EAASU,UAAUN,EAAME,QAEzB,IAAMK,EAAMhD,EAAOiD,QAEE,mBAARD,GAKbA,YAKhB,CACIE,KAAM,KACNC,WAAY,MACZC,UAAW,MAInBtB,EAAWU,SAAQ,SAAAR,GACfK,EAASgB,QAAQrB,EAAU7B,YAI/BY,IAAa+B,MAAK,SAAA9C,GAAM,OAAIA,EAAOiD,aAGnCjC,IAAe8B,MAAK,SAAA9C,GAAM,OAAIA,EAAOiD,aAGrChC,IAAY6B,MAAK,SAAA9C,GAAM,OAAIA,EAAOiD,YAhF1C,I,sDCJA,IAoGMK,EAAa,CACf,CACInB,OA5FU,WACd,OAAO,yDA4FHF,KAAM,UAEV,CACIE,OA5E2B,WAC/B,OAAO,yDA4EHF,KAAM,2BAEV,CACIE,OAlDgB,WACpB,OAAO,mCAkDHF,KAAM,gBAEV,CACIE,OA5CiB,WACrB,OAAO,iEA4CHF,KAAM,iBAEV,CACIE,OAtCe,WACnB,OAAO,yDAsCHF,KAAM,eAEV,CACIE,OAhCgB,WACpB,OAAO,iEAgCHF,KAAM,gBAEV,CACIE,OAtFe,WACnB,OAAO,mCAsFHF,KAAM,oBAYdjC,EAAOC,QAAU,CACbc,WA1Fe,WACf,OAAO,yDA0FPC,aAzHiB,WACjB,OAAO,yDAyHPC,UA9Ic,WACd,OAAO,iEA8IPH,kBATJ,WACI,OAAOwC,M","file":"index.bundle.js","sourcesContent":["/* ==========================================================================\n Dom helpers\n ========================================================================== */\n\nconst elementExist = element => !!document.querySelector(element);\n\nconst toNode = html => new DOMParser().parseFromString(html, 'text/html').body.childNodes;\n\nmodule.exports = {\n elementExist,\n toNode\n};\n","/* ==========================================================================\n LayoutLogitravelGiftCard > Client\n ========================================================================== */\n\n/* Modules */\nrequire('intersection-observer');\n\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst { resolveComponents, getCookies, getTopButton, getHeader } = require('./components');\n\n(function LayoutLogitravelGiftCard(selector = '[data-component=\"LayoutLogitravelGiftCard\"]') {\n if (elementExist(selector)) {\n const element = document.querySelector(selector);\n\n const config = {\n ...(function getConfig() {\n if (!element.dataset.config) return '';\n\n const result = JSON.parse(element.dataset.config);\n element.dataset.config = '';\n return result;\n })()\n };\n\n /**\n * Setting public path to the webpack exposed variable\n */\n /* eslint-disable */\n __webpack_public_path__ = config.publicPath;\n /* eslint-enable */\n\n const components = resolveComponents()\n .filter(component => component.name !== 'Header')\n .map(component => ({\n loader: component.loader,\n element: document.querySelector(`[data-component=\"${component.name}\"]`)\n }))\n .filter(component => component.element);\n\n /**\n * Observer to lazy load modules based on\n * currently viewed components in the viewport\n */\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n const { loader } = components\n .filter(component => component.element === entry.target)\n .reduce(acc => acc);\n\n /**\n * Init component with its loader and then\n * unobserve from this entry so we dont\n * call the init of the component more\n * than once\n */\n loader().then(module => {\n observer.unobserve(entry.target);\n\n const mod = module.default;\n\n if (!(typeof mod === 'function')) {\n return;\n }\n\n /* Execute module */\n mod();\n });\n }\n });\n },\n {\n root: null, // avoiding 'root' or setting it to 'null' sets it to default value: viewport\n rootMargin: '0px',\n threshold: 0.15\n }\n );\n\n components.forEach(component => {\n observer.observe(component.element);\n });\n\n /* Cookies */\n getCookies().then(module => module.default());\n\n /* TopButton */\n getTopButton().then(module => module.default());\n\n /* Header Logitravel INIT */\n getHeader().then(module => module.default);\n }\n})();\n","/* ==========================================================================\n LayoutLogitravelGiftCard > Client > Components\n ========================================================================== */\n\n/**\n * Header\n */\nconst getHeader = () => {\n return import(\n /* webpackChunkName: \"header\" */\n '@bluekiri/alexandria-logitravel/components/header/client/js'\n );\n};\n\n/**\n * Footer\n */\nconst getFooter = () => {\n return import(\n /* webpackChunkName: \"footer\" */\n '@bluekiri/alexandria-logitravel/components/footer/client/js'\n );\n};\n\n/**\n * TopButton\n */\nconst getTopButton = () => {\n return import(\n /* webpackChunkName: \"cookies\" */\n '@bluekiri/alexandria-contrib-components/components/top-button/client/js'\n );\n};\n\n/**\n * HeaderBannerDestination\n */\nconst getHeaderBannerDestination = () => {\n return import(\n /* webpackChunkName: \"header-banner-destination\" */\n '@logitravel/alex-comp-mar/components/header-banner-destination/client/js'\n );\n};\n\n/**\n * Breadcrumbs\n */\nconst getBreadcrumbs = () => {\n return import(\n /* webpackChunkName: \"breadcrumbs\" */\n '@bluekiri/alexandria-contrib-components/components/breadcrumbs-rxjs/client/js'\n );\n};\n\n/**\n * Cookies\n */\nconst getCookies = () => {\n return import(\n /* webpackChunkName: \"cookies\" */\n '@bluekiri/alexandria-contrib-components/components/cookies/client/js'\n );\n};\n\n/**\n * FeaturesRxjs\n */\nconst getFeaturesRxjs = () => {\n return import(\n /* webpackChunkName: \"features-rxjs\" */\n '@logitravel/alex-comp-mar/components/features-rxjs/client/js'\n );\n};\n\n/**\n * GiftCardMaker\n */\nconst getGiftCardMaker = () => {\n return import(\n /* webpackChunkName: \"gift-card-maker\" */\n '@logitravel/alex-comp-mar/components/gift-card-maker/client/js'\n );\n};\n\n/**\n * Faq2Columns\n */\nconst getFaq2Columns = () => {\n return import(\n /* webpackChunkName: \"faq-2-columns\" */\n '@logitravel/alex-comp-mar/components/faq-2-columns/client/js'\n );\n};\n\n/**\n * TrustedShops\n */\nconst getTrustedShops = () => {\n return import(\n /* webpackChunkName: \"trusted-shops\" */\n '@bluekiri/alexandria-contrib-components/components/trusted-shops/client/js'\n );\n};\n\n/**\n * Components\n */\nconst COMPONENTS = [\n {\n loader: getFooter,\n name: 'Footer'\n },\n {\n loader: getHeaderBannerDestination,\n name: 'HeaderBannerDestination'\n },\n {\n loader: getFeaturesRxjs,\n name: 'FeaturesRxjs'\n },\n {\n loader: getGiftCardMaker,\n name: 'GiftCardMaker'\n },\n {\n loader: getFaq2Columns,\n name: 'Faq2Columns'\n },\n {\n loader: getTrustedShops,\n name: 'TrustedShops'\n },\n {\n loader: getBreadcrumbs,\n name: 'BreadcrumbsRxjs'\n }\n];\n\n/**\n * Resolver components\n */\nfunction resolveComponents() {\n return COMPONENTS;\n}\n\n/* Exports */\nmodule.exports = {\n getCookies,\n getTopButton,\n getHeader,\n resolveComponents\n};\n"],"sourceRoot":""}