{"version":3,"file":"mediaMasthead-CWpJoToN.js","sources":["../../src/scripts/modules/mediaMasthead.ts"],"sourcesContent":["import { Component } from '@verndale/core';\r\nimport { debounce } from '../helpers';\r\n\r\nclass MediaMasthead extends Component {\r\n resizeObserver: ResizeObserver;\r\n isProgramMasthead: boolean;\r\n\r\n constructor(el: HTMLElement) {\r\n super(el);\r\n\r\n this.resizeObserver = new ResizeObserver(this.updateVWProperty);\r\n this.resizeObserver.observe(document.documentElement);\r\n\r\n this.isProgramMasthead = this.el.classList.contains('program-masthead');\r\n this.dom = {\r\n programFeaturesRowInner: this.el.querySelector('.program-features-row__inner') as HTMLElement,\r\n programFeaturesRowCard: this.el.querySelectorAll(\r\n '.program-features-row__card'\r\n ) as NodeListOf,\r\n mediaMastheadInner: this.el.querySelector('.media-masthead__inner') as HTMLElement\r\n };\r\n\r\n //this.programInnerResize();\r\n }\r\n\r\n setupDefaults() {\r\n this.dom = {\r\n el: this.el\r\n };\r\n }\r\n\r\n addListeners() {\r\n //window.addEventListener('resize', debounce(this.programInnerResize.bind(this), 250));\r\n }\r\n\r\n updateVWProperty = debounce(() => {\r\n document.documentElement.style.setProperty(\r\n '--vw',\r\n `${document.documentElement.clientWidth / 100}px`\r\n );\r\n }, 250);\r\n\r\n programInnerResize() {\r\n if (this.isProgramMasthead) {\r\n const cardsLength = (this.dom.programFeaturesRowCard as NodeListOf)?.length || 0;\r\n let programFeaturesRowWidth = (this.dom.programFeaturesRowInner as HTMLElement).offsetWidth;\r\n\r\n if (programFeaturesRowWidth < 1439) {\r\n programFeaturesRowWidth = document.documentElement.clientWidth - 82;\r\n }\r\n\r\n if (cardsLength > 4) {\r\n // we need the width of the programFeaturesRow minus the last 2 cards if there are more than 5 cards\r\n const lastCardWidth = (this.dom.programFeaturesRowCard as NodeListOf)[\r\n cardsLength - 1\r\n ].offsetWidth;\r\n const secondLastCardWidth = (this.dom.programFeaturesRowCard as NodeListOf)[\r\n cardsLength - 2\r\n ].offsetWidth;\r\n\r\n const newWidth = `${programFeaturesRowWidth - lastCardWidth - secondLastCardWidth + 1}px`;\r\n (this.dom.mediaMastheadInner as HTMLElement).style.maxWidth = newWidth;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport default MediaMasthead;\r\n"],"names":["MediaMasthead","Component","el","__publicField","debounce","cardsLength","_a","programFeaturesRowWidth","lastCardWidth","secondLastCardWidth","newWidth"],"mappings":"kRAGA,MAAMA,UAAsBC,CAAU,CAIpC,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EAJVC,EAAA,uBACAA,EAAA,0BA8BAA,EAAA,wBAAmBC,EAAS,IAAM,CAChC,SAAS,gBAAgB,MAAM,YAC7B,OACA,GAAG,SAAS,gBAAgB,YAAc,GAAG,IAC/C,GACC,GAAG,GA9BJ,KAAK,eAAiB,IAAI,eAAe,KAAK,gBAAgB,EACzD,KAAA,eAAe,QAAQ,SAAS,eAAe,EAEpD,KAAK,kBAAoB,KAAK,GAAG,UAAU,SAAS,kBAAkB,EACtE,KAAK,IAAM,CACT,wBAAyB,KAAK,GAAG,cAAc,8BAA8B,EAC7E,uBAAwB,KAAK,GAAG,iBAC9B,6BACF,EACA,mBAAoB,KAAK,GAAG,cAAc,wBAAwB,CACpE,CAAA,CAKF,eAAgB,CACd,KAAK,IAAM,CACT,GAAI,KAAK,EACX,CAAA,CAGF,cAAe,CAAA,CAWf,oBAAqB,OACnB,GAAI,KAAK,kBAAmB,CAC1B,MAAMC,IAAeC,EAAA,KAAK,IAAI,yBAAT,YAAAA,EAA6D,SAAU,EACxF,IAAAC,EAA2B,KAAK,IAAI,wBAAwC,YAMhF,GAJIA,EAA0B,OACFA,EAAA,SAAS,gBAAgB,YAAc,IAG/DF,EAAc,EAAG,CAEnB,MAAMG,EAAiB,KAAK,IAAI,uBAC9BH,EAAc,CAChB,EAAE,YACII,EAAuB,KAAK,IAAI,uBACpCJ,EAAc,CAChB,EAAE,YAEIK,EAAW,GAAGH,EAA0BC,EAAgBC,EAAsB,CAAC,KACpF,KAAK,IAAI,mBAAmC,MAAM,SAAWC,CAAA,CAChE,CACF,CAEJ"}
无锡搜房网-新房
365体育
51766旅游网
博彩平台
买球app
Sun-City-Entertainment-admin@xyschool.net
皇冠博彩
太阳城
搜房网无锡租房网
Asian-gaming-info@cesametal.net
博彩app
mg-electron-admin@zhengzongliangcha.com
Crown-official-website-contactus@wislab.net
扬州教育考试院
极限时间
酷我音乐手机下载网站
西安电子科技大学本科招生信息网
迈视网
Gambling-website-admin@kongtiao11.com
European-Cup-buying-entrance-careers@babyfeedingshop.com
皮阿诺
TV购物|电视购物-东方购物,东方CJ
苏州美罗商城
德阳房产网
徐州美团网
北京小升初论坛
电信易通
戒色吧
杭州易登网
河洛网
站点地图
阿里妈妈客服中心
金坛旅游网
安徽网络电视台
泉州广播电视台