{"remainingRequest":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[0].use[1]!C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\resources\\assets\\scripts\\blocks\\Testimonials.js","dependencies":[{"path":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\resources\\assets\\scripts\\blocks\\Testimonials.js","mtime":1726762144428},{"path":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1726651497274},{"path":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\node_modules\\babel-loader\\lib\\index.js","mtime":1726651482652}],"contextDependencies":[],"result":["import Block from './Block';\nimport gsap from 'gsap';\nexport default class Testimonials extends Block {\n  getElems() {\n    this.listContainers = Array.from(this.el.querySelectorAll('.b-testimonials__line'));\n  }\n  init() {\n    if (this.listContainers) {\n      this.listContainers.forEach((container, index) => {\n        this._cloneItems(container);\n        this._gsap(container, index === 0 ? 'left' : 'right');\n      });\n    }\n  }\n  _cloneItems(container) {\n    const list = container.querySelector('.b-testimonials__list');\n    const items = Array.from(list.querySelectorAll('.b-testimonials__item'));\n    const containerWidth = container.offsetWidth;\n\n    // Calculate the total width of all children\n    const itemsWidth = items.reduce((totalWidth, item) => totalWidth + item.offsetWidth, 0);\n\n    // Determine how many times we need to clone the children\n    const cloneCount = Math.ceil(containerWidth / itemsWidth);\n\n    // Clone the items and append them to the container\n    for (let i = 0; i < cloneCount; i++) {\n      items.forEach(item => {\n        const clone = item.cloneNode(true);\n        list.appendChild(clone);\n      });\n    }\n  }\n  _gsap(container, direction) {\n    const list = container.querySelector('.b-testimonials__list');\n    const listWidth = list.offsetWidth;\n    const containerWidth = container.offsetWidth;\n    const offset = listWidth - containerWidth;\n    const tl = gsap.timeline({\n      scrollTrigger: {\n        trigger: this.el,\n        start: 'top bottom',\n        end: 'bottom top',\n        scrub: true\n      }\n    });\n    gsap.set(list, {\n      x: direction === 'left' ? 0 : -offset + 'px'\n    });\n    tl.to(list, {\n      x: direction === 'left' ? -offset + 'px' : 0,\n      ease: 'none'\n    });\n  }\n}",{"version":3,"names":["Block","gsap","Testimonials","getElems","listContainers","Array","from","el","querySelectorAll","init","forEach","container","index","_cloneItems","_gsap","list","querySelector","items","containerWidth","offsetWidth","itemsWidth","reduce","totalWidth","item","cloneCount","Math","ceil","i","clone","cloneNode","appendChild","direction","listWidth","offset","tl","timeline","scrollTrigger","trigger","start","end","scrub","set","x","to","ease"],"sources":["C:/wamp64/www/free-energie/wp-content/themes/digitalcover/resources/assets/scripts/blocks/Testimonials.js"],"sourcesContent":["import Block from './Block'\nimport gsap from 'gsap'\n\nexport default class Testimonials extends Block {\n  getElems() {\n    this.listContainers = Array.from(this.el.querySelectorAll('.b-testimonials__line'))\n  }\n\n  init() {\n    if (this.listContainers) {\n      this.listContainers.forEach((container, index) => {\n        this._cloneItems(container)\n        this._gsap(container, index === 0 ? 'left' : 'right')\n      })\n    }\n  }\n\n  _cloneItems(container) {\n    const list = container.querySelector('.b-testimonials__list')\n    const items = Array.from(list.querySelectorAll('.b-testimonials__item'))\n    const containerWidth = container.offsetWidth\n\n    // Calculate the total width of all children\n    const itemsWidth = items.reduce((totalWidth, item) => totalWidth + item.offsetWidth, 0)\n\n    // Determine how many times we need to clone the children\n    const cloneCount = Math.ceil(containerWidth / itemsWidth)\n\n    // Clone the items and append them to the container\n    for (let i = 0; i < cloneCount; i++) {\n      items.forEach((item) => {\n        const clone = item.cloneNode(true)\n\n        list.appendChild(clone)\n      })\n    }\n  }\n\n\n  _gsap(container, direction) {\n    const list = container.querySelector('.b-testimonials__list')\n    const listWidth = list.offsetWidth\n    const containerWidth = container.offsetWidth\n    const offset = listWidth - containerWidth\n\n    const tl = gsap.timeline({\n      scrollTrigger: {\n        trigger: this.el,\n        start: 'top bottom',\n        end: 'bottom top',\n        scrub: true\n      }\n    })\n\n    gsap.set(list, {\n      x: direction === 'left' ? 0 : -offset + 'px'\n    })\n\n    tl.to(list, {\n      x: direction === 'left' ? -offset + 'px' : 0,\n      ease: 'none'\n    })\n  }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,SAAS;AAC3B,OAAOC,IAAI,MAAM,MAAM;AAEvB,eAAe,MAAMC,YAAY,SAASF,KAAK,CAAC;EAC9CG,QAAQ,GAAG;IACT,IAAI,CAACC,cAAc,GAAGC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACC,EAAE,CAACC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;EACrF;EAEAC,IAAI,GAAG;IACL,IAAI,IAAI,CAACL,cAAc,EAAE;MACvB,IAAI,CAACA,cAAc,CAACM,OAAO,CAAC,CAACC,SAAS,EAAEC,KAAK,KAAK;QAChD,IAAI,CAACC,WAAW,CAACF,SAAS,CAAC;QAC3B,IAAI,CAACG,KAAK,CAACH,SAAS,EAAEC,KAAK,KAAK,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC;MACvD,CAAC,CAAC;IACJ;EACF;EAEAC,WAAW,CAACF,SAAS,EAAE;IACrB,MAAMI,IAAI,GAAGJ,SAAS,CAACK,aAAa,CAAC,uBAAuB,CAAC;IAC7D,MAAMC,KAAK,GAAGZ,KAAK,CAACC,IAAI,CAACS,IAAI,CAACP,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;IACxE,MAAMU,cAAc,GAAGP,SAAS,CAACQ,WAAW;;IAE5C;IACA,MAAMC,UAAU,GAAGH,KAAK,CAACI,MAAM,CAAC,CAACC,UAAU,EAAEC,IAAI,KAAKD,UAAU,GAAGC,IAAI,CAACJ,WAAW,EAAE,CAAC,CAAC;;IAEvF;IACA,MAAMK,UAAU,GAAGC,IAAI,CAACC,IAAI,CAACR,cAAc,GAAGE,UAAU,CAAC;;IAEzD;IACA,KAAK,IAAIO,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,UAAU,EAAEG,CAAC,EAAE,EAAE;MACnCV,K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