{"version":3,"sources":["webpack:///./node_modules/@bluekiri/alexandria-contrib-components/components/collapse-rxjs/client/js/prototype.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/itinerary-dyn/client/js/config.js","webpack:///./node_modules/@bluekiri/alexandria-contrib-components/components/collapse-rxjs/client/js/index.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/itinerary-dyn/client/js/index.js","webpack:///./node_modules/@bluekiri/alexandria-contrib-components/components/collapse-rxjs/client/js/store/reducer.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/itinerary-dyn/client/js/store/reducer.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/itinerary-dyn/client/js/store/actions.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/itinerary-dyn/client/js/collapse/index.js","webpack:///./node_modules/@bluekiri/alexandria-contrib-components/animations/collapse.js","webpack:///./node_modules/@bluekiri/alexandria-contrib-components/components/collapse-rxjs/client/js/config.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/itinerary-dyn/client/js/prototype.js","webpack:///./node_modules/@bluekiri/alexandria-contrib-components/components/collapse-rxjs/client/js/store/actions.js"],"names":["Store","require","_require2","collapse","expand","_require3","types","actions","reducer","prototype","setupStore","this","store","setupActions","_this","destroy","dispatch","display","hide","toggleCollapse","setCollapse","payload","setupReactions","_this2","reactions","subscribe","_","action","type","DESTROY","unsubscribe","_toConsumableArray","Object","keys","forEach","key","element","parentNode","removeChild","DISPLAY","css","config","requestAnimationFrame","classList","remove","hidden","HIDE","add","state","TOGGLE_COLLAPSE","icon","collapsed","hooks","body","collapsible","setIcon","plus","minus","_this3","subscriptions","events","click$","_this4","start","init","module","exports","component","map","image","mapConfig","width","height","imgConfig","elementExist","Button","selector","arguments","length","undefined","configuration","instance","create","document","querySelector","_objectSpread","dataset","result","JSON","parse","concat","Image","images","querySelectorAll","item","index","initialState","SET_COLLAPSE","Collapse","panel","collapses","reference","changedCollpase","_instance$config$lite","literals","_instance$config$lite2","readMoreLabel","_instance$config$lite3","readLessLabel","content","innerHTML","fromEvent","take","elem","sectionHeight","scrollHeight","elementTransition","style","transition","setAttribute","pipe","button","initCollapse","data"],"mappings":";+HAKA,IAAQA,EAAUC,EAAQ,QAAlBD,MAERE,EAA6BD,EAAQ,QAA7BE,EAAQD,EAARC,SAAUC,EAAMF,EAANE,OAElBC,EAA2BJ,EAAQ,QAA3BK,EAAKD,EAALC,MAAOC,EAAOF,EAAPE,QACPC,EAAYP,EAAQ,QAApBO,QAGFC,EAAY,CAEdC,WAAU,WACN,OAAIC,KAAKC,QAETD,KAAKC,MAAQ,IAAIZ,EAAM,CACnBG,SAAUK,KAHSG,MAS3BE,aAAY,WAAG,IAAAC,EAAA,KACX,OAAIH,KAAKJ,UAETI,KAAKJ,QAAU,CACXQ,QAAS,WAAF,OAAQD,EAAKF,MAAMI,SAAST,EAAQQ,YAC3CE,QAAS,WAAF,OAAQH,EAAKF,MAAMI,SAAST,EAAQU,YAC3CC,KAAM,WAAF,OAAQJ,EAAKF,MAAMI,SAAST,EAAQW,SACxCC,eAAgB,WAAF,OAAQL,EAAKF,MAAMI,SAAST,EAAQY,mBAClDC,YAAa,SAAAC,GAAO,OAAIP,EAAKF,MAAMI,SAAST,EAAQa,YAAYC,OAP3CV,MAa7BW,eAAc,WAAG,IAAAC,EAAA,KACb,OAAIZ,KAAKa,YAETb,KAAKa,UAAY,CACbT,QAASJ,KAAKC,MAAMa,WAAU,SAACC,EAAGC,GAC1BA,EAAOC,OAAStB,EAAMuB,UAG1BN,EAAKO,cACLC,EAAIC,OAAOC,KAAKV,EAAKC,YAAYU,SAAQ,SAAAC,GAAG,OAAIZ,EAAKC,UAAUW,GAAKL,iBAGpEP,EAAKa,QAAQC,WAAWC,YAAYf,EAAKa,SAGzCL,EAAIC,OAAOC,KAAKV,IAAOW,SAAQ,SAAAC,GAAG,cAAWZ,EAAKY,UAEtDlB,QAASN,KAAKC,MAAMa,WAAU,SAACC,EAAGC,GAC9B,GAAIA,EAAOC,OAAStB,EAA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AKW,iBAGLoG,EAAa/G,MAGbA,KAAKc,YAGLd,KAAKoD,QAEEpD,MApBuBA,OAyBtCsD,EAAOC,QAAUzD,G,mBCxGjB,IAEMqC,EAAO,iBAcbmB,EAAOC,QAAU,CACb5D,MAAO,CACHuB,QAlBQ,oBAmBRU,QAlBQ,oBAmBRO,OACAG,gBAjBgB,4BAkBhBgD,aAjBa,0BAmBjB1F,QAAS,CACLQ,QAjBQ,WAAH,MAAU,CAAEa,KART,sBA0BRX,QAjBQ,WAAH,MAAU,CAAEW,KART,sBA0BRV,KAjBK,WAAH,MAAU,CAAEU,KAAMkB,IAkBpB3B,eAhBe,WAAH,MAAU,CAAES,KARR,8BAyBhBR,YAhBY,SAAAC,GAAO,MAAK,CAAEO,KARb,yBAQiCP","file":"itinerary-dyn.12dc9ec10eb3ccec6cb4.bundle.js","sourcesContent":["/* ==========================================================================\n CollapseRxjs > Client > Prototype\n ========================================================================== */\n\n/* Modules */\nconst { Store } = require('@bluekiri/alexandria/helpers/state');\n\nconst { collapse, expand } = require('../../../../animations/collapse');\n\nconst { types, actions } = require('./store/actions');\nconst { reducer } = require('./store/reducer');\n\n/* Prototype */\nconst prototype = {\n /* Setup store */\n setupStore() {\n if (this.store) return this;\n\n this.store = new Store({\n collapse: reducer\n });\n\n return this;\n },\n /* Setup actions */\n setupActions() {\n if (this.actions) return this;\n\n this.actions = {\n destroy: () => this.store.dispatch(actions.destroy()),\n display: () => this.store.dispatch(actions.display()),\n hide: () => this.store.dispatch(actions.hide()),\n toggleCollapse: () => this.store.dispatch(actions.toggleCollapse()),\n setCollapse: payload => this.store.dispatch(actions.setCollapse(payload))\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((_, action) => {\n if (action.type !== types.DESTROY) return;\n\n /* Unsubscribe */\n this.unsubscribe();\n [...Object.keys(this.reactions)].forEach(key => this.reactions[key].unsubscribe());\n\n /* Delete from DOM */\n this.element.parentNode.removeChild(this.element);\n\n /* Clean references */\n [...Object.keys(this)].forEach(key => delete this[key]);\n }),\n display: this.store.subscribe((_, action) => {\n if (action.type !== types.DISPLAY) return;\n\n const { css } = this.config;\n\n requestAnimationFrame(() => {\n this.element.classList.remove(css.hidden);\n });\n }),\n hide: this.store.subscribe((_, action) => {\n if (action.type !== types.HIDE) return;\n\n const { css } = this.config;\n\n requestAnimationFrame(() => {\n this.element.classList.add(css.hidden);\n });\n }),\n toggleCollapse: this.store.subscribe((state, action) => {\n if (action.type !== types.TOGGLE_COLLAPSE) return;\n\n /* Data */\n const { icon } = this.config;\n const { collapsed } = state.collapse;\n\n if (collapsed) {\n requestAnimationFrame(() => {\n collapse(this.hooks.body);\n\n /* Dispatch collapsible action to change icon */\n this.collapsible.actions.setIcon(icon.plus);\n });\n\n return;\n }\n\n requestAnimationFrame(() => {\n expand(this.hooks.body);\n\n /* Dispatch collapsible action to change icon */\n this.collapsible.actions.setIcon(icon.minus);\n });\n })\n };\n\n return this;\n },\n /* Subscribe */\n subscribe() {\n if (this.subscriptions) this.unsubscribe();\n\n this.subscriptions = {\n collapse: this.collapsible.events.click$.subscribe(() => {\n /* Dispatch action */\n this.actions.toggleCollapse();\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 /* Start */\n start() {\n if (!this.config.start) return this;\n\n /* Collapsed */\n const { collapsed } = this.config;\n\n if (!collapsed) {\n return this;\n }\n\n this.actions.setCollapse(true);\n\n return this;\n },\n /* Init */\n init() {\n if (!this.config.init) return this;\n\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 /* Start */\n this.start();\n\n return this;\n }\n};\n\n/* Exports */\nmodule.exports = prototype;\n","/* ==========================================================================\n ItineraryDyn > Client > Config\n ========================================================================== */\n\n/* Import modules */\n\n/* Config */\nconst config = {\n component: 'ItineraryDyn',\n init: true,\n start: true,\n css: {\n map: 'itinerary-dyn__map'\n },\n type: {\n map: 'itinerary-dyn-map',\n collapse: 'itinerary-dyn-collapse',\n image: 'itinerary-dyn-image'\n },\n mapConfig: {\n width: 305,\n height: 214\n },\n imgConfig: {\n width: 220,\n height: 175\n }\n};\n\nmodule.exports = () => config;\n","/* ==========================================================================\n CollapseRxjs > Client\n ========================================================================== */\n\n/* Import modules */\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst Button = require('../../../button-rxjs/client/js');\n\nconst prototype = require('./prototype');\nconst config = require('./config');\n\n/**\n * CollapseRxjs component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function CollapseRxjs(selector = '[data-component=CollapseRxjs]', configuration = {}) {\n if (elementExist(selector)) {\n /* Instance */\n const instance = Object.create(prototype);\n\n /* Element */\n instance.element = document.querySelector(selector);\n\n /* Hooks */\n instance.hooks = {\n body: instance.element.querySelector('[data-collapse-body]')\n };\n\n /* Config */\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 return result;\n })()\n };\n\n /* Collapsible */\n instance.collapsible = Button(\n `${selector} [data-component=\"ButtonRxjs\"][data-type=\"${config().type.collapsible}\"]`\n );\n\n /* Init */\n instance.init();\n\n /* Return */\n return instance;\n }\n};\n","/* ==========================================================================\n ItineraryDyn > Client\n ========================================================================== */\n\n/* Import modules */\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst Image = require('@bluekiri/alexandria-contrib-components/components/image-rxjs/client/js');\n\nconst prototype = require('./prototype');\nconst config = require('./config');\n\n/**\n * ItineraryDyn component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function ItineraryDyn(selector = '[data-component=ItineraryDyn]', configuration = {}) {\n if (elementExist(selector)) {\n /* Instance */\n const instance = Object.create(prototype);\n\n /* Selector */\n instance.selector = selector;\n\n /* Element */\n instance.element = document.querySelector(selector);\n\n /* Config */\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 return result;\n })()\n };\n\n instance.map = Image(`${selector} [data-component=\"ImageRxjs\"][data-type=\"${config().type.map}\"]`);\n\n instance.images = [\n ...instance.element.querySelectorAll(\n `${selector} [data-component=\"ImageRxjs\"][data-type^=\"${config().type.image}\"]`\n )\n ].map((item, index) =>\n Image(`${selector} [data-component=\"ImageRxjs\"][data-type^=\"${config().type.image}-${index}\"]`)\n );\n\n /* Init */\n instance.init();\n\n /* Return */\n return instance;\n }\n};\n","/* ==========================================================================\n CollapseRxjs > Client > Store > Reducer\n ========================================================================== */\n\n/* Modules */\nconst { types } = require('./actions');\n\n/* Initial state */\nconst initialState = {\n collapsed: false,\n hidden: false\n};\n\n/* Reducer */\nfunction reducer(state = initialState, action) {\n switch (action.type) {\n case types.DESTROY:\n return state;\n case types.DISPLAY:\n return {\n ...state,\n hidden: false\n };\n case types.HIDE:\n return {\n ...state,\n hidden: true\n };\n case types.SET_COLLAPSE:\n return {\n ...state,\n collapsed: action.payload\n };\n case types.TOGGLE_COLLAPSE:\n return {\n ...state,\n collapsed: !state.collapsed\n };\n default:\n return state;\n }\n}\n\n/* Exports */\nmodule.exports = {\n reducer\n};\n","/* ==========================================================================\n ItineraryDyn > Client > Store > Reducer\n ========================================================================== */\n\n/* Modules */\nconst { types } = require('./actions');\n\n/* Initial state */\nconst initialState = {};\n\n/* Reducer */\nfunction reducer(state = initialState, action) {\n switch (action.type) {\n case types.DESTROY:\n default:\n return state;\n }\n}\n\n/* Exports */\nmodule.exports = {\n reducer\n};\n","/* ==========================================================================\n ItineraryDyn > Client > Store > Actions\n ========================================================================== */\n\n/* Types */\nconst DESTROY = 'ITINERARYDYN::DESTROY';\n\n/* Actions */\nconst destroy = () => ({ type: DESTROY });\n\n/* Exports */\nmodule.exports = {\n types: {\n DESTROY\n },\n actions: {\n destroy\n }\n};\n","/* Import modules */\nconst Collapse = require('@bluekiri/alexandria-contrib-components/components/collapse-rxjs/client/js');\nconst { types } = require('@bluekiri/alexandria-contrib-components/components/collapse-rxjs/client/js/store/actions');\n\n/* Config */\nconst config = require('../config');\n\nmodule.exports = function initCollapse(instance) {\n const panel = instance;\n\n const { selector } = instance;\n\n panel.collapses = [\n ...instance.element.querySelectorAll(\n `${selector} [data-component=\"CollapseRxjs\"][data-type^=\"${config().type.collapse}\"]`\n )\n ].map(item => {\n const reference = Collapse(`${selector} [data-component=\"CollapseRxjs\"][data-type^=\"${item.dataset.type}\"]`);\n\n reference.reactions = {\n ...reference.reactions,\n changedCollpase: reference.store.subscribe((state, action) => {\n if (action.type !== types.TOGGLE_COLLAPSE) return;\n\n /* Literals */\n const { readMoreLabel = '', readLessLabel = '' } = instance.config.literals;\n\n /* If collapsed is false */\n if (!state.collapse.collapsed) {\n reference.collapsible.hooks.content.innerHTML = readLessLabel;\n reference.element.classList.add('is-not-collapsed');\n return;\n }\n\n /* Then collapsed is true */\n reference.collapsible.hooks.content.innerHTML = readMoreLabel;\n reference.element.classList.remove('is-not-collapsed');\n })\n };\n\n return reference;\n });\n};\n","/* ==========================================================================\n Animations > Collapse\n ========================================================================== */\n\n/* Modules */\nconst { fromEvent } = require('rxjs');\nconst { take } = require('rxjs/operators');\n\n/**\n * Collapse\n * Passed a DOM element, it collapses\n * It needs some styling done in its css/scss\n * height: auto,\n overflow: hidden,\n transition: height 0.3s ease-out\n * @param {HTMLElement} Element\n */\nfunction collapse(element) {\n const elem = element;\n\n // get the height of the element's inner content, regardless of its actual size\n const sectionHeight = element.scrollHeight;\n\n // temporarily disable all css transitions\n const elementTransition = element.style.transition;\n elem.style.transition = '';\n\n // on the next frame (as soon as the previous style change has taken effect),\n // explicitly set the element's height to its current pixel height, so we\n // aren't transitioning out of 'auto'\n requestAnimationFrame(() => {\n elem.style.height = `${sectionHeight}px`;\n elem.style.transition = elementTransition;\n\n // on the next frame (as soon as the previous style change has taken effect),\n // have the element transition to height: 0\n requestAnimationFrame(() => {\n elem.style.height = `${0}px`;\n });\n });\n\n // mark the section as \"currently collapsed\"\n element.setAttribute('data-collapsed', 'true');\n}\n\n/**\n * Expand\n * Passed a DOM element, it expands\n * @param {HTMLElement} Element\n */\nfunction expand(element) {\n const elem = element;\n\n // get the height of the element's inner content, regardless of its actual size\n const sectionHeight = element.scrollHeight;\n\n // have the element transition to the height of its inner content\n elem.style.height = `${sectionHeight}px`;\n\n // when the next css transition finishes (which should be the one we just triggered)\n fromEvent(element, 'transitionend')\n .pipe(take(1))\n .subscribe(() => {\n // remove \"height\" from the element's inline styles, so it can return to its initial value\n elem.style.height = null;\n });\n\n // mark the section as \"currently not collapsed\"\n element.setAttribute('data-collapsed', 'false');\n}\n\n/* Exports */\nmodule.exports = {\n collapse,\n expand\n};\n","/* ==========================================================================\n CollapseRxjs > Client > Config\n ========================================================================== */\n\n/* Import modules */\n\n/* Config */\nconst config = {\n component: 'CollapseRxjs',\n init: true,\n start: true,\n type: {\n collapsible: 'collapse-rxjs-collapsible'\n },\n css: {\n button: 'collapse-rxjs__button',\n hidden: 'is-hidden'\n },\n icon: {\n plus: 'plus',\n minus: 'minus'\n }\n};\n\nmodule.exports = () => config;\n","/* ==========================================================================\n ItineraryDyn > Client > Prototype\n ========================================================================== */\n\n/* Import modules */\nconst { Store } = require('@bluekiri/alexandria/helpers/state');\n\nconst { actions, types } = require('./store/actions');\nconst { reducer } = require('./store/reducer');\n\nconst initCollapse = require('./collapse');\n\n/* Prototype */\nconst prototype = {\n /* Setup store */\n setupStore() {\n if (this.store) return this;\n\n this.store = new Store({\n data: 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 };\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 [...Object.keys(this.reactions)].forEach(key => this.reactions[key].unsubscribe());\n\n /* Clean DOM */\n this.element.parentNode.removeChild(this.element);\n\n /* Clean reference */\n [...Object.keys(this)].forEach(key => delete this[key]);\n })\n };\n\n return this;\n },\n /* Subscribe */\n subscribe() {\n if (this.subscriptions) this.unsubscribe();\n\n this.subscriptions = {};\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 /* Start */\n start() {\n if (!this.config.start) return this;\n\n /* Start logic */\n\n return this;\n },\n /* Init */\n init() {\n if (!this.config.init) return this;\n\n /* Setup store */\n this.setupStore();\n\n /* Setup actions */\n this.setupActions();\n\n /* Setup reactions */\n this.setupReactions();\n\n /* Init collapse */\n initCollapse(this);\n\n /* Subscribe */\n this.subscribe();\n\n /* Start */\n this.start();\n\n return this;\n }\n};\n\n/* Exports */\nmodule.exports = prototype;\n","/* ==========================================================================\n CollapseRxjs > Client > Store > Actions\n ========================================================================== */\n\n/* Types */\nconst DESTROY = 'COLLAPSE::DESTROY';\nconst DISPLAY = 'COLLAPSE::DISPLAY';\nconst HIDE = 'COLLAPSE::HIDE';\n\nconst TOGGLE_COLLAPSE = 'COLLAPSE::TOGGLE_COLLAPSE';\nconst SET_COLLAPSE = 'COLLAPSE::SET_COLLAPSE';\n\n/* Actions */\nconst destroy = () => ({ type: DESTROY });\nconst display = () => ({ type: DISPLAY });\nconst hide = () => ({ type: HIDE });\n\nconst toggleCollapse = () => ({ type: TOGGLE_COLLAPSE });\nconst setCollapse = payload => ({ type: SET_COLLAPSE, payload });\n\n/* Exports */\nmodule.exports = {\n types: {\n DESTROY,\n DISPLAY,\n HIDE,\n TOGGLE_COLLAPSE,\n SET_COLLAPSE\n },\n actions: {\n destroy,\n display,\n hide,\n toggleCollapse,\n setCollapse\n }\n};\n"],"sourceRoot":""}