{"version":3,"sources":["webpack:///./node_modules/@logitravel/alex-comp-cru/components/main-check-in-cru/client/js/components.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/main-check-in-cru/client/js/index.js"],"names":["COMPONENTS","loader","name","module","exports","resolveComponents","getClickToCall","require","elementExist","_require2","selector","arguments","length","undefined","element","document","querySelector","config","_objectSpread","dataset","result","JSON","parse","publicPath","__webpack_public_path__","components","map","component","concat","filter","observerConfig","root","rootMargin","threshold","observer","IntersectionObserver","entries","forEach","entry","intersectionRatio","target","reduce","acc","then","default","unobserve","observe"],"mappings":";mIAGA,IA0FMA,EAAa,CACf,CACIC,OAxEoB,WACxB,OAAO,6DAwEHC,KAAM,oBAEV,CACID,OAlEgB,WACpB,OAAO,4DAkEHC,KAAM,gBAEV,CACID,OA5DY,WAChB,OAAO,sCA4DHC,KAAM,YAEV,CACID,OAtDgB,WACpB,OAAO,6DAsDHC,KAAM,oBAEV,CACID,OAlGmB,WACvB,OAAO,6DAkGHC,KAAM,mBAEV,CACID,OApDgB,WACpB,OAAO,4DAoDHC,KAAM,gBAEV,CACID,OA9CmB,WACvB,OAAO,oEA8CHC,KAAM,mBAEV,CACID,OAxCmB,WACvB,OAAO,6DAwCHC,KAAM,oBAWdC,EAAOC,QAAU,CACbC,kBALJ,WACI,OAAOL,GAKPM,eAtImB,WACnB,OAAO,8D,0sBCCXC,EAAQ,QAER,IAAQC,EAAiBD,EAAQ,QAAzBC,aAERC,EAA8CF,EAAQ,QAA9CF,EAAiBI,EAAjBJ,kBAAmBC,EAAcG,EAAdH,eAM3BH,EAAOC,QAAU,WAAsE,IAA9CM,EAAQC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,kCAChD,GAAIH,EAAaE,GAAW,CACxB,IAAMI,EAAUC,SAASC,cAAcN,GAEjCO,EAAMC,EAAA,GACJ,WACA,IAAKJ,EAAQK,QAAQF,OAAQ,MAAO,GAEpC,IAAMG,EAASC,KAAKC,MAAMR,EAAQK,QAAQF,QAE1C,OADAH,EAAQK,QAAQF,OAAS,GAClBG,EALP,IAaJH,EAAOM,aAAYC,IAA0BP,EAAOM,YAGxD,IAAME,EAAapB,IACdqB,KAAI,SAAAC,GAAS,MAAK,CACf1B,OAAQ0B,EAAU1B,OAClBa,QAASC,SAASC,cAAc,oBAADY,OAAqBD,EAAUzB,KAAI,WAErE2B,QAAO,SAAAF,GAAS,OAAIA,EAAUb,WAG7BgB,EAAiB,CACnBC,KAAM,KACNC,WAAY,MACZC,UAAW,KAOTC,EAAW,IAAIC,sBAAqB,SAAAC,GACtCA,EAAQC,SAAQ,SAAAC,GACRA,EAAMC,kBAAoB,IAW1BtC,EAVmBwB,EACdI,QAAO,SAAAF,GAAS,OAAIA,EAAUb,UAAYwB,EAAME,UAChDC,QAAO,SAAAC,GAAG,OAAIA,KAFXzC,UAUC0C,MAAK,SAAAxC,GACVA,EAAOyC,UAEPV,EAASW,UAAUP,EAAME,gBAItCV,GAEHL,EAAWY,SAAQ,SAAAV,GACfO,EAASY,QAAQnB,EAAUb,YAI/BR,IAAiBqC,MAAK,SAAAxC,GAAM,OAAIA,EAAOyC","file":"main-check-in-cru.bfaebfd256dc5277a5e0.bundle.js","sourcesContent":["/**\n * ClickToCall\n */\nconst getClickToCall = () => {\n return import(\n /* webpackChunkName: \"click-to-call\" */\n '@bluekiri/alexandria-contrib-components/components/click-to-call/client/js'\n );\n};\n\n/**\n * MasonryCarousel\n */\nconst getMasonryCarousel = () => {\n return import(\n /* webpackChunkName: \"masonry-carousel\" */\n '@bluekiri/alexandria-contrib-components/components/masonry-carousel/client/js'\n );\n};\n\n/**\n * BreadcrumbsIdCru\n */\nconst getBreadcrumbsIdCru = () => {\n return import(\n /* webpackChunkName: \"breadcrumbs-id-cru\" */\n '../../../breadcrumbs-id-cru/client/js'\n );\n};\n\n/**\n * HeaderBanner\n */\nconst getHeaderBanner = () => {\n return import(\n /* webpackChunkName: \"header-banner\" */\n '../../../header-banner/client/js'\n );\n};\n\n/**\n * listInfo\n */\nconst getlistInfo = () => {\n return import(\n /* webpackChunkName: \"list-info\" */\n '../../../list-info/client/js'\n );\n};\n\n/**\n * ShippingLine\n */\nconst getShippingLine = () => {\n return import(\n /* webpackChunkName: \"shipping-line-rxjs\" */\n '../../../shipping-line-rxjs/client/js'\n );\n};\n\n/**\n * CardGridList\n */\nconst getCardGridList = () => {\n return import(\n /* webpackChunkName: \"card-grid-list\" */\n '../../../card-grid-list/client/js'\n );\n};\n\n/**\n * SearcherCruises\n */\nconst getSearcherCruises = () => {\n return import(\n /* webpackChunkName: \"searcher-section\" */\n '../../../searcher-section/client/js'\n );\n};\n\n/**\n * NewsletterAgent\n */\nconst getNewsletterAgent = () => {\n return import(\n /* webpackChunkName: \"newsletter-agent\" */\n '../../../newsletter-agent/client/js'\n );\n};\n\n/**\n * Components\n */\nconst COMPONENTS = [\n {\n loader: getBreadcrumbsIdCru,\n name: 'BreadcrumbsIdCru'\n },\n {\n loader: getHeaderBanner,\n name: 'HeaderBanner'\n },\n {\n loader: getlistInfo,\n name: 'listInfo'\n },\n {\n loader: getShippingLine,\n name: 'ShippingLineRxjs'\n },\n {\n loader: getMasonryCarousel,\n name: 'MasonryCarousel'\n },\n {\n loader: getCardGridList,\n name: 'CardGridList'\n },\n {\n loader: getSearcherCruises,\n name: 'SearcherSection'\n },\n {\n loader: getNewsletterAgent,\n name: 'NewsletterAgent'\n }\n];\n\n/**\n * Resolver components\n */\nfunction resolveComponents() {\n return COMPONENTS;\n}\n\nmodule.exports = {\n resolveComponents,\n getClickToCall\n};\n","/* ==========================================================================\n MainCheckInCru > Client\n ========================================================================== */\n\n/* Import modules */\nrequire('intersection-observer');\n\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst { resolveComponents, getClickToCall } = require('./components');\n\n/**\n * MainCheckInCru component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function MainCheckInCru(selector = '[data-component=MainCheckInCru]') {\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 if (config.publicPath) __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 /* Observer Config */\n const observerConfig = {\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 * Observer to lazy load modules based on\n * currently viewed components in the viewport\n */\n const observer = new IntersectionObserver(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 observer.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n components.forEach(component => {\n observer.observe(component.element);\n });\n\n /* ClickToCall */\n getClickToCall().then(module => module.default());\n }\n};\n"],"sourceRoot":""}