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KJ,EACxB,CACF,IAACnC,EAAA,yBAEkB,SAACwC,GAClB,IAAM9B,EAAe+B,SAASC,iBAAiB,qBAE1CF,EAAYG,UAAUC,SAAS,WAUlCJ,EAAYG,UAAUE,OAAO,UAC7BnC,EAAaR,SAAQ,SAAC4C,GAChBA,IAASN,GACXM,EAAKH,UAAUE,OAAO,aAE1B,KAdAnC,EAAaR,SAAQ,SAAC4C,GAChBA,IAASN,EACXM,EAAKH,UAAUI,IAAI,WAEnBD,EAAKH,UAAUE,OAAO,UACtBC,EAAKH,UAAUI,IAAI,cAEvB,GASJ,IAAC/C,EAAA,kBACW,WACWyC,SAASC,iBAAiB,qBAClCxC,SAAQ,SAAC4C,GACpBA,EAAKH,UAAUE,OAAO,UACtBC,EAAKH,UAAUE,OAAO,aACxB,GACF,IAjGEG,KAAKnD,GAAKA,EACVmD,KAAK/C,MAAQgD,MAAMC,KAAKrD,EAAG6C,iBAAiB,gBAC5CM,KAAKd,cAAgBrC,EAAG6B,aAAa,eACrCsB,KAAK1C,eAAiB0C,KAAKnD,GAAGmB,cAAc,qBAC5CgC,KAAKxC,YAAcwC,KAAKnD,GAAGmB,cAAc,6BACzCgC,KAAKtC,aAAe+B,SAASC,iBAAiB,8DAC3CM,KAAKtC,aAAaC,OAAS,GAAGqC,KAAKnC,uBACtCmC,KAAKG,cACP,G","sources":["webpack://@hero-digital/zoom/./src/components/foundation/PricingCard/PricingCard.js"],"sourcesContent":["class PricingCard {\r\n constructor(el) {\r\n this.el = el\r\n this.links = Array.from(el.querySelectorAll('.fdn-button'))\r\n this.dataAttribute = el.getAttribute('data-cmp-is')\r\n this.viewPricingCTA = this.el.querySelector('.view-pricing-cta')\r\n this.closeButton = this.el.querySelector('.fdn-pricing-card__header')\r\n this.pricingCards = document.querySelectorAll('.pricing-card-wrapper > .pricing-inner > .fdn-pricing-card') \r\n if(this.pricingCards.length > 0) this.standardPricingCards() \r\n this.addListeners()\r\n }\r\n\r\n addListeners = () => {\r\n this.links.forEach((link) => {\r\n link.addEventListener('click', this.handlePricingCardClick)\r\n })\r\n\r\n if(this.viewPricingCTA) {\r\n this.viewPricingCTA.addEventListener('click', () => {\r\n this.toggleActiveCard(this.el)\r\n })\r\n }\r\n\r\n if(this.closeButton) {\r\n this.closeButton.addEventListener('click', () => {\r\n this.closeCard()\r\n })\r\n }\r\n if(this.pricingCards.length > 0) {\r\n window.addEventListener('resize', this.standardPricingCards)\r\n window.addEventListener(\"orientationchange\", this.standardPricingCards)\r\n }\r\n }\r\n\r\n standardPricingCards = () => {\r\n if(this.pricingCards) {\r\n var maxHeight = 0;\r\n this.pricingCards.forEach((pricingCard) => {\r\n pricingCard.querySelector('.fdn-pricing-card__main-container').style.minHeight = 0 + 'px';\r\n })\r\n this.pricingCards.forEach((pricingCard) => {\r\n var height = pricingCard.querySelector('.fdn-pricing-card__main-container').clientHeight;\r\n maxHeight = Math.max(maxHeight, height);\r\n })\r\n this.pricingCards.forEach((pricingCard) => {\r\n pricingCard.querySelector('.fdn-pricing-card__main-container').style.minHeight = maxHeight + 'px';\r\n })\r\n }\r\n }\r\n\r\n handlePricingCardClick = (event) => {\r\n //event.preventDefault(); //For test purposes\r\n const linkType = event.target.getAttribute('data-link-type')\r\n if (\r\n linkType === 'buy-now' ||\r\n linkType === 'contact-sales' ||\r\n linkType === 'request-demo'\r\n ) {\r\n const linkText =\r\n event.target.getAttribute('data-en-text').toLowerCase() ||\r\n event.currentTarget.childNodes[0].textContent.trim().toLowerCase()\r\n const uiLocation = this.dataAttribute\r\n const eventData = {\r\n event: 'ctaClick',\r\n linkUrl: event.target.href,\r\n linkText,\r\n uiLocation\r\n }\r\n window.dataLayer.push(eventData)\r\n }\r\n }\r\n\r\n toggleActiveCard = (clickedCard) => {\r\n const pricingCards = document.querySelectorAll('.fdn-pricing-card')\r\n\r\n if (!clickedCard.classList.contains('active')) {\r\n pricingCards.forEach((card) => {\r\n if (card === clickedCard) {\r\n card.classList.add('active')\r\n } else {\r\n card.classList.remove('active')\r\n card.classList.add('not-active')\r\n }\r\n })\r\n } else {\r\n clickedCard.classList.remove('active')\r\n pricingCards.forEach((card) => {\r\n if (card !== clickedCard) {\r\n card.classList.remove('not-active')\r\n }\r\n })\r\n }\r\n }\r\n closeCard = () => {\r\n const pricingCards = document.querySelectorAll('.fdn-pricing-card')\r\n pricingCards.forEach((card) => {\r\n card.classList.remove('active')\r\n card.classList.remove('not-active')\r\n })\r\n }\r\n}\r\n\r\nexport default PricingCard\r\n"],"names":["_createClass","PricingCard","el","_this","_classCallCheck","_defineProperty","links","forEach","link","addEventListener","handlePricingCardClick","viewPricingCTA","toggleActiveCard","closeButton","closeCard","pricingCards","length","window","standardPricingCards","maxHeight","pricingCard","querySelector","style","minHeight","height","clientHeight","Math","max","event","linkType","target","getAttribute","linkText","toLowerCase","currentTarget","childNodes","textContent","trim","uiLocation","dataAttribute","eventData","linkUrl","href","dataLayer","push","clickedCard","document","querySelectorAll","classList","contains","remove","card","add","this","Array","from","addListeners"],"sourceRoot":""}