{"version":3,"sources":["webpack:///./node_modules/@bluekiri/alexandria/helpers/domHelpers.js","webpack:///./polyfills/index.js","webpack:///./.tmp/layout-myaccount-unsubscribe-logitravel.main.scss","webpack:///./components/layout-myaccount-unsubscribe-logitravel/client/js/index.js","webpack:///./template/js/index.js","webpack:///./template/js/components.js"],"names":["module","exports","elementExist","element","document","querySelector","toNode","html","DOMParser","parseFromString","body","childNodes","require","MyaccountUnsubscribe","LayoutTemplate","_require2","resolveComponents","getHeader","mainFunction","selector","arguments","length","undefined","config","_objectSpread","dataset","result","JSON","parse","__webpack_public_path__","publicPath","components","map","component","loader","concat","name","filter","then","default","mainComponent","observer","IntersectionObserver","entries","forEach","entry","intersectionRatio","target","reduce","acc","setTimeout","window","dispatchEvent","Event","unobserve","root","rootMargin","threshold","observe","COMPONENTS"],"mappings":";yIAQAA,EAAOC,QAAU,CACbC,aALiB,SAAAC,GAAO,QAAMC,SAASC,cAAcF,IAMrDG,OAJW,SAAAC,GAAI,OAAI,IAAIC,WAAYC,gBAAgBF,EAAM,aAAaG,KAAKC,c,qBCF/EC,EAAQ,QACRA,EAAQ,QACRA,EAAQ,QAERA,EAAQ,QACRA,EAAQ,S,kCCTR,Q,uECAA,IAAMC,EAAuB,WAAH,OACtB,mEAKmBD,EAAQ,OAGpBE,CAAeD,EAAsB,4D,wsBCJhDD,EAAQ,QAER,IAAQV,EAAiBU,EAAQ,QAAzBV,aAERa,EAAyCH,EAAQ,QAAzCI,EAAiBD,EAAjBC,kBAAmBC,EAASF,EAATE,UAE3BjB,EAAOC,QAAU,SAAwBiB,GAA8D,IAAhDC,EAAQC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,oCAC9D,GAAIlB,EAAaiB,GAAW,CACxB,IAAMhB,EAAUC,SAASC,cAAcc,GAEjCI,EAAMC,EAAA,GACJ,WACA,IAAKrB,EAAQsB,QAAQF,OAAQ,MAAO,GAEpC,IAAMG,EAASC,KAAKC,MAAMzB,EAAQsB,QAAQF,QAE1C,OADApB,EAAQsB,QAAQF,OAAS,GAClBG,EALP,IAaRG,IAA0BN,EAAOO,WAGjC,IAAMC,EAAaf,IACdgB,KAAI,SAAAC,GAAS,MAAK,CACfC,OAAQD,EAAUC,OAClB/B,QAASC,SAASC,cAAc,oBAAD8B,OAAqBF,EAAUG,KAAI,WAErEC,QAAO,SAAAJ,GAAS,OAAIA,EAAU9B,WAKnCe,IAAeoB,MAAK,SAAAtC,GAAM,OAAIA,EAAOuC,QAAQ,oBAADJ,OAAqBZ,EAAOiB,cAAa,UAMrF,IAAMC,EAAW,IAAIC,sBACjB,SAAAC,GACIA,EAAQC,SAAQ,SAAAC,GACRA,EAAMC,kBAAoB,IAW1BZ,EAVmBH,EACdM,QAAO,SAAAJ,GAAS,OAAIA,EAAU9B,UAAY0C,EAAME,UAChDC,QAAO,SAAAC,GAAG,OAAIA,KAFXf,UAUCI,MAAK,SAAAtC,GACVA,EAAOuC,UAEPW,YAAW,kBAAMC,OAAOC,cAAc,IAAIC,MAAM,aAAY,KAE5DZ,EAASa,UAAUT,EAAME,gBAKzC,CACIQ,KAAM,KACNC,WAAY,MACZC,UAAW,MAInB1B,EAAWa,SAAQ,SAAAX,GACfQ,EAASiB,QAAQzB,EAAU9B,YAI/Bc,IAAYqB,MAAK,SAAAtC,GAAM,OAAIA,EAAOuC,c,uEC7E1C,IAkBMoB,EAAa,CACf,CACIzB,OAXU,WAAH,OACX,4DAWIE,KAAM,WAYdpC,EAAOC,QAAU,CACbgB,UAlCc,WAAH,OACX,mEAkCAD,kBAPJ,WACI,OAAO2C,M","file":"index.48deb779b856e89683e8.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 Polyfills\n ========================================================================== */\n\nrequire('element-closest-polyfill');\nrequire('whatwg-fetch');\nrequire('abortcontroller-polyfill/dist/polyfill-patch-fetch');\n\nrequire('core-js/stable');\nrequire('regenerator-runtime/runtime');\n","// extracted by mini-css-extract-plugin\nexport {};","const MyaccountUnsubscribe = () =>\n import(\n /* webpackChunkName: \"myaccount-unsubscribe\" */\n '@myaccount/alex-comp-myaccount/components/myaccount-unsubscribe/client/js'\n );\n\nconst LayoutTemplate = require('../../../../template/js');\n\n(function InitLayout() {\n return LayoutTemplate(MyaccountUnsubscribe, '[data-component=\"LayoutMyaccountUnsubscribeLogitravel\"]');\n})();\n","/* ==========================================================================\n LayoutTemplate > Client\n ========================================================================== */\n\n/* Modules */\nrequire('intersection-observer');\n\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst { resolveComponents, getHeader } = require('./components');\n\nmodule.exports = function LayoutTemplate(mainFunction, selector = '[data-component=\"LayoutTemplate\"]') {\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 .map(component => ({\n loader: component.loader,\n element: document.querySelector(`[data-component=\"${component.name}\"]`)\n }))\n .filter(component => component.element);\n\n /**\n * Execute main function\n */\n mainFunction().then(module => module.default(`[data-component=\"${config.mainComponent}\"]`));\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 module.default();\n\n setTimeout(() => window.dispatchEvent(new Event('resize')), 1000);\n\n observer.unobserve(entry.target);\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 /* Header */\n getHeader().then(module => module.default);\n }\n};\n","/* ==========================================================================\n LayoutTemplate > Client > Components\n ========================================================================== */\n\n/**\n * Header\n */\nconst getHeader = () =>\n import(\n /* webpackChunkName: \"header\" */\n '@bluekiri/alexandria-logitravel/components/header/client/js'\n );\n\n/**\n * Footer\n */\nconst getFooter = () =>\n import(\n /* webpackChunkName: \"footer\" */\n '@bluekiri/alexandria-logitravel/components/footer/client/js'\n );\n\n/**\n * Components\n */\nconst COMPONENTS = [\n {\n loader: getFooter,\n name: 'Footer'\n }\n];\n\n/**\n * Resolver components\n */\nfunction resolveComponents() {\n return COMPONENTS;\n}\n\n/* Exports */\nmodule.exports = {\n getHeader,\n resolveComponents\n};\n"],"sourceRoot":""}