{"version":3,"sources":["webpack:///./src/js/components/Component.js","webpack:///./src/js/components/FeatureSlider.js"],"names":["domTree","WeakMap","configuration","Component","el","config","arguments","length","undefined","_classCallCheck","this","Error","$el","jQuery","$","set","hasOwnProperty","dom","setupDefaults","addListeners","get","elements","_component","__webpack_require__","FeatureSlider","_this","_possibleConstructorReturn","__proto__","Object","getPrototypeOf","call","initSlick","$slider","find","slick","infinite","dots","prevArrow","nextArrow","slidesToShow","waitForAnimate"],"mappings":"ohBAAA,IAAMA,EAAU,IAAIC,QACdC,EAAgB,IAAID,QA4BpBE,aAOJ,SAAAA,EAAYC,GAAgB,IAAZC,EAAYC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,MAC1B,+FAD0BG,CAAAC,KAAAP,QACR,IAAPC,EACT,MAAM,IAAIO,MAAM,wEASlBD,KAAKE,IAAMR,aAAcS,EAAST,EAAKU,EAAEV,GAEjB,IAApBM,KAAKE,IAAIL,SAEbP,EAAQe,IAAIL,SACZR,EAAca,IAAIL,KAAML,GAEpBK,KAAKL,OAAOW,eAAe,SAC7BN,KAAKO,IAAMP,KAAKL,OAAOY,KAGzBP,KAAKQ,gBACLR,KAAKS,0IAuCL,OAAOjB,EAAckB,IAAIV,gCA6BnBW,GACNA,OACKX,KAAKO,IACLI,GAGLrB,EAAQe,IAAIL,KAAMW,mBAYlB,OAAOrB,EAAQoB,IAAIV,yBAIRP,sWCrJfmB,EAAAC,EAAA,6CAEMC,cACJ,SAAAA,EAAYpB,gGAAIK,CAAAC,KAAAc,GAAA,IAAAC,mKAAAC,CAAAhB,MAAAc,EAAAG,WAAAC,OAAAC,eAAAL,IAAAM,KAAApB,KACRN,IADQ,OAEdqB,EAAKM,YAFSN,qUADUtB,sDAOxBO,KAAKO,KACHe,QAAStB,KAAKE,IAAIqB,KAAK,gEAKzBvB,KAAKO,IAAIe,QAAQE,OACfC,UAAU,EACVC,MAAM,EACNC,UACE,sHACFC,UACE,uHACFC,aAAc,EACdC,gBAAgB,uBAKPhB","file":"34.676dd43e4a8a5b717e82.js","sourcesContent":["const domTree = new WeakMap();\r\nconst configuration = new WeakMap();\r\n\r\n/**\r\n * Component is a class that should be extended for every component that's being made. It\r\n * is a helper class to keep the code uniform.\r\n *\r\n * __PLEASE NOTE__: This is only to be extended, not instantiated.\r\n *\r\n * @example\r\n * import Component from 'component';\r\n *\r\n * class Foo extends Component {\r\n *   construction(el){\r\n *     super(el);\r\n *   }\r\n *\r\n *   setupDefaults(){\r\n *     // ...defaults go here\r\n *   }\r\n *\r\n *   addListeners(){\r\n *     // ...listeners go here\r\n *   }\r\n * }\r\n *\r\n * // Create a new Foo component\r\n * new Foo('.foo');\r\n */\r\nclass Component {\r\n  /**\r\n   * Component constructor - see {@link config} on how to pass in additional configuration to the constructor\r\n   *\r\n   * @param {string|Object} el - Main DOM element, you can pass a string such as `'.foo'` __or__ a jQuery object such as `$('.foo')`\r\n   * @param {Object} [config={ }] - Additional component configuration; reachable with `this.config`\r\n   */\r\n  constructor(el, config = {}){\r\n    if (typeof el === 'undefined') {\r\n      throw new Error('You must provide an element as a String type or a jQuery object type');\r\n    }\r\n\r\n    /**\r\n     * Main class element, this will be a jQuery instance\r\n     * This can be reachable at any time in your superclass with `this.$el`\r\n     *\r\n     * @type {Object}\r\n     */\r\n    this.$el = el instanceof jQuery ? el : $(el);\r\n\r\n    if (this.$el.length === 0) return;\r\n\r\n    domTree.set(this, {});\r\n    configuration.set(this, config);\r\n\r\n    if (this.config.hasOwnProperty('dom')) {\r\n      this.dom = this.config.dom;\r\n    }\r\n\r\n    this.setupDefaults();\r\n    this.addListeners();\r\n  }\r\n\r\n  /**\r\n   * This method is used for override;\r\n   * It's called directly after the element and configuration have been set up\r\n   * @abstract\r\n   */\r\n  setupDefaults(){}\r\n\r\n  /**\r\n   * This method is used for override;\r\n   * It's called directly after `setupDefaults()`, so everything is ready and setup at this point.\r\n   * @abstract\r\n   */\r\n  addListeners(){}\r\n\r\n  /**\r\n   * Get component configuration\r\n   *\r\n   * @example\r\n   * class Foo extends Component {\r\n   *   construction(el, config){\r\n   *     super(el, config);\r\n   *   }\r\n   *\r\n   *   setupDefaults(){\r\n   *     console.log(this.config.name); // Outputs \"Foo\"\r\n   *   }\r\n   * }\r\n   *\r\n   * // Create a new Foo component with some configuration\r\n   * new Foo('.foo', {\r\n   *   name: 'Foo'\r\n   * });\r\n   *\r\n   * @type {Object}\r\n   */\r\n  get config(){\r\n    return configuration.get(this);\r\n  }\r\n\r\n  /**\r\n   * Set DOM object\r\n   *\r\n   * @example\r\n   * class Foo extends Component {\r\n   *   construction(el){\r\n   *     super(el);\r\n   *   }\r\n   *\r\n   *   setupDefaults(){\r\n   *     this.dom = {\r\n   *       $container: this.$el.find('.container')\r\n   *     }\r\n   *   }\r\n   *\r\n   *   addListeners(){\r\n   *     //DOM object is available\r\n   *     console.log(this.dom.$container);\r\n   *   }\r\n   * }\r\n   *\r\n   * // Create a new Foo component\r\n   * new Foo('.foo');\r\n   *\r\n   * @type {Object}\r\n   */\r\n  set dom(elements){\r\n    elements = {\r\n      ...this.dom,\r\n      ...elements\r\n    };\r\n\r\n    domTree.set(this, elements);\r\n  }\r\n\r\n  /**\r\n   * Get DOM object\r\n   *\r\n   * @example\r\n   * this.dom\r\n   *\r\n   * @type {Object}\r\n   */\r\n  get dom(){\r\n    return domTree.get(this);\r\n  }\r\n}\r\n\r\nexport default Component;\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/components/Component.js","import Component from 'component';\r\n\r\nclass FeatureSlider extends Component {\r\n  constructor(el) {\r\n    super(el);\r\n    this.initSlick();\r\n  }\r\n\r\n  setupDefaults() {\r\n    this.dom = {\r\n      $slider: this.$el.find('.feature-slider__slider')\r\n    };\r\n  }\r\n\r\n  initSlick() {\r\n    this.dom.$slider.slick({\r\n      infinite: false,\r\n      dots: true,\r\n      prevArrow:\r\n        '<img class=\"slick-prev slick-arrow\" src=\"/images/contentManaged/icons/icon-arrow-left-shadow.svg\" alt=\"prev slide\">',\r\n      nextArrow:\r\n        '<img class=\"slick-next slick-arrow\" src=\"/images/contentManaged/icons/icon-arrow-right-shadow.svg\" alt=\"next slide\">',\r\n      slidesToShow: 1,\r\n      waitForAnimate: false\r\n    });\r\n  }\r\n}\r\n\r\nexport default FeatureSlider;\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/components/FeatureSlider.js"],"sourceRoot":""}