{"version":3,"sources":["webpack:///./node_modules/@logitravel/alex-comp-cru/components/info-media/client/js/config.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/media-rxjs/client/js/config.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/media-rxjs/client/js/store/actions.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/media-rxjs/client/js/store/reducer.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/media-rxjs/client/js/gallery/index.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/media-rxjs/client/js/index.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/info-media/client/js/index.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/media-rxjs/client/js/prototype.js"],"names":["config","component","type","video","image","css","gallery","imageMod","imgConfig","width","height","module","exports","init","DESTROY","types","DISPLAY_GALLERY","HIDE_GALLERY","actions","destroy","displayGallery","hideGallery","require","initialState","reducer","state","arguments","length","undefined","action","_objectSpread","html","toNode","GalActions","GalleryTempalte","Gallery","addGallery","instance","panel","node","context","items","galleryData","template","createGallery","element","appendChild","concat","selector","reactions","store","subscribe","elementExist","Image","prototype","configuration","Object","create","document","querySelector","hooks","dataset","result","JSON","parse","Media","RatingStars","media","ratingStars","Store","fromEvent","_require3","setupStore","this","card","setupActions","_this","dispatch","setupReactions","_this2","unsubscribe","parentNode","removeChild","_toConsumableArray","keys","forEach","key","_this3","subscriptions","clickImage","_this4"],"mappings":";+EAOA,IAAMA,EAAS,CACXC,UAAW,YACXC,KAAM,CACFC,MAAO,gBACPC,MAAO,oBAEXC,IAAK,CACDC,QAAS,sBACTF,MAAO,oBACPG,SAAU,4BAEdC,UAAW,CACPC,MAAO,IACPC,OAAQ,MAIhBC,EAAOC,QAAU,kBAAMZ,I,qBCjBvB,IAAMA,EAAS,CACXC,UAAW,YACXY,MAAM,EACNX,KAAM,CACFC,MAAO,gBACPC,MAAO,oBAEXC,IAAK,CACDC,QAAS,sBACTF,MAAO,oBACPG,SAAU,6BAIlBI,EAAOC,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AAC,GAAG,cAAWP,EAAKO,UAEtDlE,eAAgBqD,KAAKvB,MAAMC,WAAU,SAAC1B,EAAOI,GACrCA,EAAO3B,OAASa,EAAMC,iBAG1BoB,EAAW2C,QAnBQN,MA0B/BtB,UAAS,WAAG,IAAAoC,EAAA,KAWR,OAVId,KAAKe,eAAef,KAAKO,cAE7BP,KAAKe,cAAgB,GAEjBf,KAAKb,MAAMtD,UACXmE,KAAKe,cAAcC,WAAanB,EAAUG,KAAKb,MAAMtD,QAAS,SAAS6C,WAAU,WAC7EoC,EAAKrE,QAAQE,qBAIdqD,MAGXO,YAAW,WAAG,IAAAU,EAAA,KACV,OAAKjB,KAAKe,eAEVL,EAAI3B,OAAO4B,KAAKX,KAAKe,gBAAgBH,SAAQ,SAAAC,GAAG,OAAII,EAAKF,cAAcF,GAAKN,iBAErEP,MAJyBA,MAQpC5D,KAAI,WAEA4D,KAAKD,aAGLC,KAAKE,eAGLF,KAAKK,iBAGLL,KAAKtB,cAKbxC,EAAOC,QAAU0C","file":"info-media.521c9cbdc389b4ca0349.bundle.js","sourcesContent":["/* ==========================================================================\n InfoMedia > Client > Config\n ========================================================================== */\n\n/* Import modules */\n\n/* Config */\nconst config = {\n component: 'InfoMedia',\n type: {\n video: 'gallery-video',\n image: 'info-media-image'\n },\n css: {\n gallery: 'info-media__gallery',\n image: 'info-media__image',\n imageMod: 'info-media__image--video'\n },\n imgConfig: {\n width: 427,\n height: 240\n }\n};\n\nmodule.exports = () => config;\n","/* ==========================================================================\n MediaRxjs > Client > Config\n ========================================================================== */\n\n/* Import modules */\n\n/* Config */\nconst config = {\n component: 'MediaRxjs',\n init: true,\n type: {\n video: 'gallery-video',\n image: 'media-rxjs-image'\n },\n css: {\n gallery: 'media-rxjs__gallery',\n image: 'media-rxjs__image',\n imageMod: 'media-rxjs__image--video'\n }\n};\n\nmodule.exports = () => config;\n","/* ==========================================================================\n TextImageRxjs > Client > Store > Actions\n ========================================================================== */\n\n/* Types */\nconst DESTROY = 'TEXT_IMAGE_RXJS::DESTROY';\n\nconst DISPLAY_GALLERY = 'TEXT_IMAGE_RXJS::DISPLAY_GALLERY';\nconst HIDE_GALLERY = 'TEXT_IMAGE_RXJS::HIDE_GALLERY';\n\n/* Actions */\nconst destroy = () => ({ type: DESTROY });\nconst displayGallery = () => ({ type: DISPLAY_GALLERY });\nconst hideGallery = () => ({ type: HIDE_GALLERY });\n\n/* Exports */\nmodule.exports = {\n types: {\n DESTROY,\n DISPLAY_GALLERY,\n HIDE_GALLERY\n },\n actions: {\n destroy,\n displayGallery,\n hideGallery\n }\n};\n","/* ==========================================================================\n TextImageRxjs > Client > Store > Reducer\n ========================================================================== */\n\n/* Modules */\nconst { types } = require('./actions');\n\n/* Initial state */\nconst initialState = {\n gallery: false\n};\n\n/* Reducer */\nfunction reducer(state = initialState, action) {\n switch (action.type) {\n case types.DESTROY:\n return null;\n case types.DISPLAY_GALLERY:\n return {\n ...state,\n gallery: true\n };\n case types.HIDE_GALLERY:\n return {\n ...state,\n gallery: false\n };\n default:\n return state;\n }\n}\n\n/* Exports */\nmodule.exports = {\n reducer\n};\n","/* ==========================================================================\n CardShipSection > Client > Gallery\n ========================================================================== */\n\n/* Modules */\nconst { html } = require('common-tags');\nconst { toNode } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst GalActions = require('@bluekiri/alexandria-contrib-components/components/gallery-rxjs/client/js/store/actions');\nconst GalleryTempalte = require('@bluekiri/alexandria-contrib-components/components/gallery-rxjs/template');\nconst Gallery = require('@bluekiri/alexandria-contrib-components/components/gallery-rxjs/client/js');\n\n/* Create gallery */\nfunction createGallery(instance) {\n /* Data */\n const { context } = instance.config;\n const { items } = instance.config.galleryData;\n\n /* Template */\n const template = html(GalleryTempalte({ items }, context));\n\n /* Node */\n const node = toNode(template)[0];\n\n /* Return */\n return node;\n}\n\n/* Add gallery */\nfunction addGallery(instance) {\n const panel = instance;\n\n /* Node */\n const node = createGallery(instance);\n\n /* Add to DOM */\n panel.element.appendChild(node);\n\n /* Update reference */\n panel.gallery = Gallery(`${panel.selector} [data-component=\"GalleryRxjs\"]`);\n\n /* Update */\n panel.reactions = {\n ...panel.reactions,\n hideGallery: panel.gallery.store.subscribe((state, action) => {\n if (action.type !== GalActions.types.DESTROY) return;\n delete panel.gallery;\n instance.actions.hideGallery();\n })\n };\n}\n\n/* Exports */\nmodule.exports = {\n addGallery\n};\n","/* ==========================================================================\n TextMedia > Client\n ========================================================================== */\n\n/* Import modules */\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\nconst Image = require('@bluekiri/alexandria-contrib-components/components/image-rxjs/client/js');\nconst config = require('./config');\nconst prototype = require('./prototype');\n\n/**\n * TextMedia component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function TextMedia(selector = '[data-component=MediaRxjs]', configuration = {}) {\n if (elementExist(selector)) {\n const instance = Object.create(prototype);\n\n instance.element = document.querySelector(selector);\n\n instance.selector = selector;\n\n /* Hooks */\n instance.hooks = {\n gallery: instance.element.querySelector(`${selector} [data-type=\"gallery-image\"]`)\n };\n\n instance.config = {\n ...config(),\n ...configuration,\n ...(function getConfig() {\n if (!instance.element.dataset.config) return '';\n\n const result = JSON.parse(instance.element.dataset.config);\n instance.element.dataset.config = '';\n\n return result;\n })()\n };\n\n instance.image = Image(`${selector} [data-component=\"ImageRxjs\"]`);\n\n if (instance.config.init) instance.init();\n\n return instance;\n }\n};\n","/* ==========================================================================\n InfoMedia > Client\n ========================================================================== */\n\n/* Import modules */\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\nconst Image = require('@bluekiri/alexandria-contrib-components/components/image-rxjs/client/js');\nconst Media = require('../../../media-rxjs/client/js');\n\nconst RatingStars = require('../../../rating-stars/client/js');\n\nconst config = require('./config');\n\n/**\n * InfoMedia component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function InfoMedia(selector = '[data-component=InfoMedia]', configuration = {}) {\n if (elementExist(selector)) {\n const instance = {};\n\n instance.element = document.querySelector(selector);\n\n instance.config = { ...config(), ...configuration };\n\n instance.image = Image(`${selector} [data-component=\"ImageRxjs\"]`);\n\n instance.media = Media(`${selector} [data-component=\"MediaRxjs\"][data-type=\"${config().type.video}\"]`);\n\n instance.ratingStars = RatingStars(`${selector} [data-component='RatingStars']`);\n\n return instance;\n }\n};\n","/* ==========================================================================\n MediaRxjs > Client > Prototype\n ========================================================================= */\n\n/* Modules */\nconst { Store } = require('@bluekiri/alexandria/helpers/state');\n\nconst { fromEvent } = require('rxjs');\n\nconst { actions, types } = require('./store/actions');\nconst { reducer } = require('./store/reducer');\n\nconst { addGallery } = require('./gallery');\n\nconst prototype = {\n /* Setup store */\n setupStore() {\n if (this.store) return this;\n\n this.store = new Store({\n card: reducer\n });\n\n return this;\n },\n /* Setup actions */\n setupActions() {\n if (this.actions) return this;\n\n this.actions = {\n destroy: () => {\n return this.store.dispatch(actions.destroy());\n },\n displayGallery: () => {\n return this.store.dispatch(actions.displayGallery());\n },\n hideGallery: () => {\n return this.store.dispatch(actions.hideGallery());\n }\n };\n\n return this;\n },\n /* Setup reactions */\n setupReactions() {\n if (this.reactions) return this;\n\n this.reactions = {\n destroy: this.store.subscribe((state, action) => {\n if (action.type !== types.DESTROY) return;\n\n /* Unsubscribe */\n this.unsubscribe();\n\n /* Remove from DOM */\n this.element.parentNode.removeChild(this.element);\n\n /* Clean instance */\n [...Object.keys(this)].forEach(key => delete this[key]);\n }),\n displayGallery: this.store.subscribe((state, action) => {\n if (action.type !== types.DISPLAY_GALLERY) return;\n\n /* Add gallery */\n addGallery(this);\n })\n };\n\n return this;\n },\n /* Subscribe */\n subscribe() {\n if (this.subscriptions) this.unsubscribe();\n\n this.subscriptions = {};\n\n if (this.hooks.gallery) {\n this.subscriptions.clickImage = fromEvent(this.hooks.gallery, 'click').subscribe(() => {\n this.actions.displayGallery();\n });\n }\n\n return this;\n },\n /* Unsubscribe */\n unsubscribe() {\n if (!this.subscriptions) return this;\n\n [...Object.keys(this.subscriptions)].forEach(key => this.subscriptions[key].unsubscribe());\n\n return this;\n },\n\n /* Init */\n init() {\n /* Setup store */\n this.setupStore();\n\n /* Setup actions */\n this.setupActions();\n\n /* Setup reactions */\n this.setupReactions();\n\n /* Subscribe */\n this.subscribe();\n }\n};\n\n// Exports\nmodule.exports = prototype;\n"],"sourceRoot":""}