{"version":3,"sources":["webpack:///./src/client/default/js/components/carouselGComponent.js","webpack:///./node_modules/js-cookie/src/js.cookie.js"],"names":["CarouselGComponent","element","lazyMount","checkWidth","this","CUSTOM_MESSAGES","TABS_EVENTS","CAROUSEL_REMOUNT","inTabRemount","option","$options","cookie","startAt","Cookies","get","remove","$slides","length","alwaysmountable","carouselBreakpoint","window","mqObj","innerWidth","mount","$el","classList","add","savePosition","data","contains","EMIT","CAROUSEL_EVENTS","RECOMMENDER_MOUNTED","getElements","destroy","setRightArrow","glide","on","index","setTimeout","slide","querySelector","track","offsetWidth","position","querySelectorAll","forEach","el","$on","set","BaseCarousel","factory","module","exports","OldCookies","api","noConflict","extend","i","result","arguments","attributes","key","decode","s","replace","decodeURIComponent","init","converter","value","document","path","defaults","expires","Date","toUTCString","JSON","stringify","test","e","write","encodeURIComponent","String","escape","stringifiedAttributes","attributeName","split","json","jar","cookies","parts","slice","join","charAt","name","read","parse","getJSON","withConverter"],"mappings":";w5BAEqBA,E,gCACnB,WAAYC,GAAS,0BACnB,cAAMA,IACDC,YACL,EAAKC,aAHc,E,kCAMrB,WACE,cACGC,KAAKC,gBAAgBC,YAAYC,iBAAmBH,KAAKI,gB,uBAK9D,WACE,IAAIC,E,iWAAS,CAAH,GAAQL,KAAKM,UAEvB,GAAIN,KAAKM,SAASC,OAAQ,CACxB,IAAIC,EAAUC,IAAQC,IAAIV,KAAKM,SAASC,QACpCC,IACFH,EAAOG,QAAUA,EACjBC,IAAQE,OAAOX,KAAKM,SAASC,UAG7BP,KAAKY,QAAQC,OAAS,GAAKb,KAAKM,SAASQ,mBACvCd,KAAKM,SAASS,mBACZC,OAAOC,MAAMjB,KAAKM,SAASS,qBAAuBC,OAAOE,WAAaF,OAAOC,MAAMjB,KAAKM,SAASS,oBACnGf,KAAKmB,MAAMnB,KAAKoB,IAAKf,GAErBL,KAAKoB,IAAIC,UAAUC,IAAI,aAGzBtB,KAAKmB,MAAMnB,KAAKoB,IAAKf,IAGrBL,KAAK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AAO,KAC1BlF,EAASA,EAAOgF,MAAM,GAAI,IAG3B,IACC,IAAIG,EAAO/B,EAAO2B,EAAM,IAIxB,GAHA/E,GAAUyD,EAAU2B,MAAQ3B,GAAWzD,EAAQmF,IAC9C/B,EAAOpD,GAEJ4E,EACH,IACC5E,EAASiE,KAAKoB,MAAMrF,GACnB,MAAOoE,IAKV,GAFAS,EAAIM,GAAQnF,EAERmD,IAAQgC,EACX,MAEA,MAAOf,KAGV,OAAOjB,EAAM0B,EAAI1B,GAAO0B,GAoBzB,OAjBAjC,EAAIN,IAAMA,EACVM,EAAIzC,IAAM,SAAUgD,GACnB,OAAOhD,EAAIgD,GAAK,IAEjBP,EAAI0C,QAAU,SAAUnC,GACvB,OAAOhD,EAAIgD,GAAK,IAEjBP,EAAIxC,OAAS,SAAU+C,EAAKD,GAC3BZ,EAAIa,EAAK,GAAIL,EAAOI,EAAY,CAC/BY,SAAU,MAIZlB,EAAIiB,SAAW,GAEfjB,EAAI2C,cAAgB/B,EAEbZ,EAGDY,EAAK","file":"js/component-carouselGComponent-js.chunks.js","sourcesContent":["import BaseCarousel from '../base/baseGlideCarousel';\nimport Cookies from 'js-cookie';\nexport default class CarouselGComponent extends BaseCarousel {\n constructor(element) {\n super(element);\n this.lazyMount();\n this.checkWidth();\n }\n\n get Messages() {\n return {\n [this.CUSTOM_MESSAGES.TABS_EVENTS.CAROUSEL_REMOUNT]: this.inTabRemount\n // [this.CUSTOM_MESSAGES.CAROUSEL_EVENTS.GENERAL_MOUNTED]: this.emitMounted\n };\n }\n\n lazyMount() {\n let option = { ...this.$options };\n\n if (this.$options.cookie) {\n let startAt = Cookies.get(this.$options.cookie);\n if (startAt) {\n option.startAt = startAt;\n Cookies.remove(this.$options.cookie);\n }\n }\n if (this.$slides.length > 1 || this.$options.alwaysmountable) {\n if (this.$options.carouselBreakpoint) {\n if (window.mqObj[this.$options.carouselBreakpoint] && window.innerWidth < window.mqObj[this.$options.carouselBreakpoint]) {\n this.mount(this.$el, option);\n } else {\n this.$el.classList.add('unmounted');\n }\n } else {\n this.mount(this.$el, option);\n }\n }\n if (this.$options.cookie) {\n this.savePosition();\n }\n }\n\n emitMounted(data) {\n let isSlotRecommenderCarousel = data.element.classList.contains('slot-recommender-carousel');\n if (isSlotRecommenderCarousel) {\n this.EMIT(this.CUSTOM_MESSAGES.CAROUSEL_EVENTS.RECOMMENDER_MOUNTED);\n }\n }\n\n inTabRemount() {\n this.getElements();\n if (this.$options.destroy) {\n this.destroy();\n }\n this.mount(this.$el, this.$options);\n }\n checkWidth() {\n if (this.$options.checkWidth) {\n this.setRightArrow();\n this.glide.on('move.after', () => {\n if (this.glide.index === 0) {\n this.setRightArrow();\n }\n });\n }\n }\n\n setRightArrow() {\n setTimeout(() => {\n let slide = this.$el.querySelector('.glide__slides');\n let track = this.$el.querySelector('.glide__track');\n if (slide.offsetWidth > track.offsetWidth) {\n this.$el.querySelector('.glide__arrows').classList.remove('disable-right');\n }\n }, 500);\n }\n\n savePosition() {\n this.position = this.glide.index ? this.glide.index : 0;\n this.glide.on('run', () => {\n this.position = this.glide.index;\n });\n\n let menuItem = this.$el.querySelectorAll('a');\n menuItem.forEach((el) => {\n this.$on(\n 'click',\n () => {\n Cookies.set(this.$options.cookie, this.position);\n },\n el\n );\n });\n }\n}\n","/*!\n * JavaScript Cookie v2.2.1\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction decode (s) {\n\t\treturn s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api() {}\n\n\t\tfunction set (key, value, attributes) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tattributes = extend({\n\t\t\t\tpath: '/'\n\t\t\t}, api.defaults, attributes);\n\n\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\tattributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);\n\t\t\t}\n\n\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\ttry {\n\t\t\t\tvar result = JSON.stringify(value);\n\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\tvalue = result;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\n\t\t\tvalue = converter.write ?\n\t\t\t\tconverter.write(value, key) :\n\t\t\t\tencodeURIComponent(String(value))\n\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\n\t\t\tkey = encodeURIComponent(String(key))\n\t\t\t\t.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)\n\t\t\t\t.replace(/[\\(\\)]/g, escape);\n\n\t\t\tvar stringifiedAttributes = '';\n\t\t\tfor (var attributeName in attributes) {\n\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Considers RFC 6265 section 5.2:\n\t\t\t\t// ...\n\t\t\t\t// 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n\t\t\t\t// character:\n\t\t\t\t// Consume the characters of the unparsed-attributes up to,\n\t\t\t\t// not including, the first %x3B (\";\") character.\n\t\t\t\t// ...\n\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n\t\t\t}\n\n\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t}\n\n\t\tfunction get (key, json) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar jar = {};\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all.\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = decode(parts[0]);\n\t\t\t\t\tcookie = (converter.read || converter)(cookie, name) ||\n\t\t\t\t\t\tdecode(cookie);\n\n\t\t\t\t\tif (json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tjar[name] = cookie;\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn key ? jar[key] : jar;\n\t\t}\n\n\t\tapi.set = set;\n\t\tapi.get = function (key) {\n\t\t\treturn get(key, false /* read as raw */);\n\t\t};\n\t\tapi.getJSON = function (key) {\n\t\t\treturn get(key, true /* read as json */);\n\t\t};\n\t\tapi.remove = function (key, attributes) {\n\t\t\tset(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.defaults = {};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n"],"sourceRoot":""}