{"version":3,"sources":["webpack://fair-labour/./assets/components/member-logos/js/member-logos.component.js","webpack://fair-labour/./assets/components/member-logos/index.js","webpack://fair-labour/./assets/config.js"],"names":["MemberLogos","_DcBaseComponent","_inherits","_super","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_assertThisInitialized","call","apply","concat","deviceObserver","isAnimate","_animateRows","_stopAnimate","rows","prototype","slice","refs","querySelectorAll","timeoutHolder","key","value","this","_unsubscrbeChange","_checking","clearTimeout","forEach","item","classList","remove","_this2","index","querySelector","add","setInterval","_getNextIndex","i","DcBaseComponent","dcFactory","module","exports","viewports","mobile","tablet","desktop","containerMaxWidth"],"mappings":"20CAE2D,IAEtCA,EAAW,SAAAC,I,qRAAAC,CAAAF,EAAAC,GAAA,I,UAAAE,G,EAAAH,E,6jBAC5B,SAAAA,IAAqB,IAAAI,E,mGAAAC,CAAA,KAAAL,GAAA,QAAAM,EAAAC,UAAAC,OAANC,EAAI,IAAAC,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAJF,EAAIE,GAAAJ,UAAAI,GAIQ,O,EAHRC,EAAfR,EAAAD,EAAAU,KAAAC,MAAAX,EAAA,OAAAY,OAASN,K,EAeD,WACJO,OAAkB,KAAM,UACnBZ,EAAKa,YACNb,EAAKa,WAAY,EACjBb,EAAKc,gBAGLd,EAAKa,YACLb,EAAKa,WAAY,EACjBb,EAAKe,eAGjB,G,MA3BmB,gB,wFACff,EAAKgB,KAAOV,MAAMW,UAAUC,MAAMT,KAAKT,EAAKmB,KAAKH,KAAKI,iBAAiB,uBACvEpB,EAAKqB,cAAgB,CAAC,EACtBrB,EAAKa,WAAY,EAAMb,CAC3B,CAIC,O,EAJAJ,E,EAsDA,EAAA0B,IAAA,eAAAC,MApDD,WACI,MAAO,cACX,K,EAJC,EAAAD,IAAA,SAAAC,MAMD,WACIC,KAAKC,kBAAoBb,sBAAiCY,KAAKE,WAC/DF,KAAKE,WACT,GAAC,CAAAJ,IAAA,eAAAC,MAgBD,WACII,aAAaH,KAAKH,eAClBG,KAAKR,KAAKY,SAAQ,SAACC,GAAWA,EAAKC,UAAUC,OAAO,aAAe,GACvE,GAAC,CAAAT,IAAA,eAAAC,MAED,WAAe,IAAAS,EAAA,KACPC,EAAQ,EAEIT,KAAKL,KAAKH,KAAKkB,cAAc,gBAEzCV,KAAKR,KAAK,GAAGc,UAAUK,IAAI,cAS/BX,KAAKH,cAAgBe,aANL,WACZJ,EAAKhB,KAAKiB,GAAOH,UAAUC,OAAO,cAClCE,EAAQD,EAAKK,cAAcJ,GAC3BD,EAAKhB,KAAKiB,GAAOH,UAAUK,IAAI,aACnC,GAViB,IAarB,GAAC,CAAAb,IAAA,gBAAAC,MAED,SAAcU,GACV,IAAMK,EAAIL,EAAQ,EAElB,OAAIK,GAAKd,KAAKR,KAAKZ,OACR,EAEJkC,CACX,M,8EAlDC1C,CAAA,CAV2B,CAAS2C,MCCzCC,cAAmB5C,E,oBCLnB6C,EAAOC,QAAU,CACbC,UAAW,CACPC,OAAQ,IACR,cAAe,IACfC,OAAQ,IACRC,QAAS,KACT,eAAgB,KAChB,gBAAiB,MAErBC,kBAAmB,K","file":"member_logos.c660739215eac1a35b1e.js","sourcesContent":["import React from 'react';\nimport { DcBaseComponent } from '@deleteagency/dc';\nimport { deviceObserver } from 'project/general/js/device';\n\nexport default class MemberLogos extends DcBaseComponent {\n constructor(...args) {\n super(...args);\n this.rows = Array.prototype.slice.call(this.refs.rows.querySelectorAll('.member-logos__row'));\n this.timeoutHolder = {};\n this.isAnimate = false;\n }\n\n static getNamespace() {\n return 'member-logos';\n }\n\n onInit() {\n this._unsubscrbeChange = deviceObserver.subscribeOnChange(this._checking);\n this._checking();\n }\n\n _checking = () => {\n if (deviceObserver.is('>=', 'tablet')) {\n if (!this.isAnimate) {\n this.isAnimate = true;\n this._animateRows();\n }\n } else {\n if (this.isAnimate) {\n this.isAnimate = false;\n this._stopAnimate();\n }\n }\n };\n\n _stopAnimate() {\n clearTimeout(this.timeoutHolder);\n this.rows.forEach((item) => { item.classList.remove('is-current'); });\n }\n\n _animateRows() {\n let index = 0;\n const interval = 5000;\n const current = this.refs.rows.querySelector('.is-current');\n if (!current) {\n this.rows[0].classList.add('is-current');\n }\n\n const animate = () => {\n this.rows[index].classList.remove('is-current');\n index = this._getNextIndex(index);\n this.rows[index].classList.add('is-current');\n };\n\n this.timeoutHolder = setInterval(animate, interval);\n }\n\n _getNextIndex(index) {\n const i = index + 1;\n\n if (i >= this.rows.length) {\n return 0;\n }\n return i;\n }\n}\n","import './scss/index.scss';\n\nimport { dcFactory } from '@deleteagency/dc';\nimport MemberLogos from './js/member-logos.component';\n\ndcFactory.register(MemberLogos);\n","module.exports = {\n viewports: {\n mobile: 375,\n 'mobile-wide': 580,\n tablet: 768,\n desktop: 1024,\n 'desktop-wide': 1280,\n 'desktop-ultra': 1440,\n },\n containerMaxWidth: 1160,\n};\n"],"sourceRoot":""}