{"version":3,"file":"blocks/repeating-split-hero.js","mappings":"8gBAwFAA,OAAOC,8BArDP,SAAuCC,EAAIC,GACvC,IACI,IAAMC,EAAUC,SAASC,eAAeJ,IAQ/B,SAACE,EAASG,GACPH,EAAQI,cAAc,0DAC9BC,UAAYF,CACxB,EAVQG,CAASN,EAASD,EAAKQ,OAwCf,SAACP,EAASQ,GACtB,IAAMC,EAAYT,EAAQI,cAAc,0CACxCK,EAAUJ,UAAY,GAEtBG,EAAKE,SAAQ,SAACC,EAAKC,GACf,IAAMC,EAjCI,SAACF,EAAKG,GACpB,IAAMD,EAAaZ,SAASc,cAAc,OAwB1C,OAvBAF,EAAWG,UAAUC,IAAI,4BAA6B,8BAAFC,OAAgCJ,IAEpFD,EAAWR,UAAY,8LAAHa,OAGJP,EAAIQ,UAAS,mLAAAD,OAKvBP,EAAIS,aAAe,oCAAHF,OAAuCP,EAAIS,aAAY,UAAW,GAAE,4CAAAF,OACtDP,EAAIU,aAAY,yEAAAH,OAERP,EAAIJ,MAAK,iEAAAW,OACDP,EAAIW,KAAI,6GAAAJ,OAEtDP,EAAIY,SAAQ,4DAAAL,OAEiBP,EAAIa,SAAQ,uCAKxCX,CACX,CAO2BY,CAAUd,EAAKC,EAAQ,GAAM,EAAI,OAAS,SAC7DH,EAAUiB,YAAYb,EAC1B,GACJ,CA/CQc,CAAQ3B,EAASD,EAAKS,KAC1B,CAAE,MAAOoB,GACLC,QAAQD,MAAMA,EAClB,CACJ","sources":["webpack://electro/./js/src/blocks/repeating-split-hero.js"],"sourcesContent":["/*\nreplaceRepeatingSplitHeroData('repeating-split-hero--default', {\n title: 'title',\n rows: [\n {\n image_url: 'https://www.kingsford.com/wp-content/uploads/2022/01/KFD_PtP22_siteTile_TheGuys_raw.png',\n eyebrow_icon: 'fas fa-user',\n eyebrow_text: 'eyebrow_text #1',\n title: 'title #1',\n text: 'text #1',\n cta_link: 'https://google.com/1',\n cta_text: 'cta text #1',\n },\n {\n image_url: 'https://www.kingsford.com/wp-content/uploads/2022/01/KFD_PtP22_siteTile_TheGuys_raw.png',\n eyebrow_icon: 'fas fa-user',\n eyebrow_text: 'eyebrow_text #2',\n title: 'title #2',\n text: 'text #2',\n cta_link: 'https://google.com/2',\n cta_text: 'cta text #2',\n },\n {\n image_url: 'https://www.kingsford.com/wp-content/uploads/2022/01/KFD_PtP22_siteTile_TheGuys_raw.png',\n eyebrow_icon: 'fas fa-user',\n eyebrow_text: 'eyebrow_text #3',\n title: 'title #3',\n text: 'text #3',\n cta_link: 'https://google.com/3',\n cta_text: 'cta text #3',\n },\n ]\n});\n*/\n\nfunction replaceRepeatingSplitHeroData(id, data) {\n try {\n const section = document.getElementById(id);\n setTitle(section, data.title);\n setRows(section, data.rows);\n } catch (error) {\n console.error(error);\n }\n}\n\nconst setTitle = (section, value) => {\n const element = section.querySelector('.b-alternating-panels__title .e-decorated-title__title');\n element.innerHTML = value;\n};\n\nconst createRow = (row, position) => {\n const createdRow = document.createElement('div');\n createdRow.classList.add('b-alternating-panels__row', `b-alternating-panels__row--${position}`);\n\n createdRow.innerHTML = `\n
\n \n \"\"\n \n
\n
\n
\n ${row.eyebrow_icon ? `` : ''}\n ${row.eyebrow_text}\n
\n

${row.title}

\n
${row.text}
\n \n ${row.cta_text}\n \n
\n `;\n\n return createdRow;\n};\n\nconst setRows = (section, rows) => {\n const container = section.querySelector('.b-alternating-panels__content-wrapper');\n container.innerHTML = '';\n\n rows.forEach((row, index) => {\n const createdRow = createRow(row, index % 2 === 0 ? 'left' : 'right');\n container.appendChild(createdRow);\n });\n};\n\nwindow.replaceRepeatingSplitHeroData = replaceRepeatingSplitHeroData;\n"],"names":["window","replaceRepeatingSplitHeroData","id","data","section","document","getElementById","value","querySelector","innerHTML","setTitle","title","rows","container","forEach","row","index","createdRow","position","createElement","classList","add","concat","image_url","eyebrow_icon","eyebrow_text","text","cta_link","cta_text","createRow","appendChild","setRows","error","console"],"sourceRoot":""}