{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/helpers/index.ts","webpack://@verndale/toolkit/./src/js/modules/footer.ts"],"names":["debounce","callback","wait","timerId","args","darkColorPalette","lightColorPalette","getRandomColor","background","Footer","Component","el","randomColor","_a","main"],"mappings":"2JAIO,MAAMA,EAAW,CAACC,EAAmCC,IAAiB,CAC3E,IAAIC,EAEJ,MAAO,IAAIC,IAAoB,CAC7B,aAAaD,CAAO,EACpBA,EAAU,WAAW,IAAM,CACzBF,EAAS,GAAGG,CAAI,CAClB,EAAGF,CAAI,CACT,CACF,EAOaG,EAAyC,CACpD,CAAE,KAAM,SAAU,KAAM,SAAU,EAClC,CAAE,KAAM,SAAU,KAAM,SAAU,EAClC,CAAE,KAAM,QAAS,KAAM,SAAU,EACjC,CAAE,KAAM,aAAc,KAAM,SAAU,CACxC,EAEaC,EAA0C,CACrD,CAAE,KAAM,MAAO,KAAM,SAAU,EAC/B,CAAE,KAAM,SAAU,KAAM,SAAU,EAClC,CAAE,KAAM,OAAQ,KAAM,SAAU,EAChC,CAAE,KAAM,SAAU,KAAM,SAAU,EAClC,CAAE,KAAM,SAAU,KAAM,SAAU,EAClC,CAAE,KAAM,QAAS,KAAM,SAAU,EACjC,CAAE,KAAM,aAAc,KAAM,SAAU,CACxC,EAEaC,EAAiB,CAC5BC,EAA+B,UAE3BA,IAAe,QAEfF,EAAkB,KAAK,MAAM,KAAK,OAAO,EAAIA,EAAkB,MAAM,GAKvED,EAAiB,KAAK,MAAM,KAAK,OAAO,EAAIA,EAAiB,MAAM,E,mFC5CvE,MAAMI,UAAeC,WAAU,CAC7B,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EAER,KAAK,oBAAoB,EACzB,KAAK,cAAc,CACrB,CAEA,eAAgB,CACd,KAAK,IAAM,CACT,KAAM,SAAS,cAA2B,MAAM,CAClD,CACF,CAEA,qBAAsB,CACpB,MAAMC,G,EAAcL,MAAe,EACnC,KAAK,GAAG,UAAU,IAAI,WAAWK,EAAY,MAAM,CACrD,CAEA,eAAgB,CAtBlB,IAAAC,EAuBI,MAAMC,EAAO,KAAK,IAAI,KAGpBA,KACAD,EAAAC,EAAK,mBAAL,YAAAD,EAAuB,UAAU,SAAS,4BAE1C,KAAK,GAAG,UAAU,IAAI,cAAc,CAExC,CACF,CAEA,QAAeJ,C","file":"scripts/8590.610bb13774254c087cda.js","sourcesContent":["// /**\n// * debounce function\n// * Delays the processing of the event\n// */\nexport const debounce = (callback: (args: unknown) => void, wait: number) => {\n let timerId: ReturnType;\n\n return (...args: [unknown]) => {\n clearTimeout(timerId);\n timerId = setTimeout(() => {\n callback(...args);\n }, wait);\n };\n};\n\ninterface IColorPalette {\n name: string;\n code: string;\n}\n\nexport const darkColorPalette: Array = [\n { name: 'orange', code: '#f47920' },\n { name: 'yellow', code: '#f4b450' },\n { name: 'green', code: '#0f9d58' },\n { name: 'light-blue', code: '#009cde' }\n];\n\nexport const lightColorPalette: Array = [\n { name: 'red', code: '#da291c' },\n { name: 'purple', code: '#492d8c' },\n { name: 'blue', code: '#2e67b2' },\n { name: 'orange', code: '#f47920' },\n { name: 'yellow', code: '#f4b450' },\n { name: 'green', code: '#0f9d58' },\n { name: 'light-blue', code: '#009cde' }\n];\n\nexport const getRandomColor = (\n background: 'light' | 'dark' = 'light'\n): IColorPalette => {\n if (background === 'light') {\n const lightRandomColor =\n lightColorPalette[Math.floor(Math.random() * lightColorPalette.length)];\n return lightRandomColor;\n }\n\n const darkRandomColor =\n darkColorPalette[Math.floor(Math.random() * darkColorPalette.length)];\n return darkRandomColor;\n};\n","import { Component } from '@verndale/core';\nimport { getRandomColor } from '../helpers';\n\nclass Footer extends Component {\n constructor(el: HTMLElement) {\n super(el);\n\n this.generateRandomColor();\n this.setBackground();\n }\n\n setupDefaults() {\n this.dom = {\n main: document.querySelector('main')\n };\n }\n\n generateRandomColor() {\n const randomColor = getRandomColor();\n this.el.classList.add(`footer--${randomColor.name}`);\n }\n\n setBackground() {\n const main = this.dom.main as HTMLDivElement;\n\n if (\n main &&\n main.lastElementChild?.classList.contains('dark-background-module')\n ) {\n this.el.classList.add('footer--dark');\n }\n }\n}\n\nexport default Footer;\n"],"sourceRoot":""}