<html><head></head><body>{"version":3,"file":"audienceQuestionnarie-BrzL43JI.js","sources":["../../src/scripts/modules/audienceQuestionnarie.ts"],"sourcesContent":["import { Component } from '@verndale/core';\nimport { isTabletLandscape } from '../helpers';\n\nclass AudienceQuestionnaire extends Component {\n prevSelectedValue: string | null = null;\n\n constructor(el: HTMLElement) {\n super(el);\n this.initCards();\n this.prevSelectedValue = (this.dom.audienceSelector as HTMLSelectElement).value;\n this.initResizeObserver();\n }\n\n setupDefaults() {\n this.dom = {\n el: this.el,\n audienceSelector: this.el.querySelector<htmlelement>('.audience-selector'),\n audiencePanels: this.el.querySelectorAll<htmlelement>(\n '.audience-questionnaire__card-container'\n ),\n audienceCard: this.el.querySelectorAll<htmlelement>('.audience-questionnaire__card'),\n audienceCardWrapper: this.el.querySelector<htmlelement>(\n '.audience-questionnaire__container-wrapper'\n )\n };\n }\n\n addListeners() {\n (this.dom.audienceSelector as HTMLSelectElement).addEventListener(\n 'change',\n this.handleAudienceSelector.bind(this)\n );\n (this.dom.audienceCard as NodeList).forEach(card => {\n (card as HTMLElement).addEventListener('click', this.handleAudienceCardClick.bind(this));\n (card as HTMLElement).addEventListener('keydown', e => {\n if (e.key === 'Enter') {\n this.handleAudienceCardClick(e);\n }\n });\n });\n }\n\n initResizeObserver() {\n const resizeObserver = new ResizeObserver(entries => {\n if (entries && entries[0]) {\n const target = entries[0].target as HTMLElement;\n const activePanel = target.querySelector('[data-active=\"true\"]');\n const activePanelHeight = activePanel?.clientHeight;\n target.style.height = `${activePanelHeight}px`;\n }\n });\n\n if (this.dom.audienceCardWrapper) {\n resizeObserver.observe(this.dom.audienceCardWrapper as HTMLElement);\n }\n\n const mutationObserver = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n (this.dom.audienceCardWrapper as HTMLElement).style.height = '';\n const target = this.dom.audienceCardWrapper as HTMLElement;\n const activePanel = target.querySelector('[data-active=\"true\"]');\n const activePanelHeight = activePanel?.clientHeight;\n setTimeout(() => {\n target.style.height = `${activePanelHeight}px`;\n }, 100);\n }\n });\n });\n\n if (this.dom.audienceCard) {\n [...(this.dom.audienceCard as NodeList)].forEach(card => {\n mutationObserver.observe(card as HTMLElement, { attributes: true });\n });\n }\n }\n\n handleAudienceSelector(e: Event) {\n const target = e.target as HTMLSelectElement;\n const selectedValue = target.value;\n\n (this.dom.audienceCard as NodeList).forEach(card => {\n (card as HTMLElement).classList.remove('active');\n });\n\n (this.dom.audiencePanels as NodeList).forEach(panel => {\n if ((panel as HTMLElement).id === `${selectedValue}-panel`) {\n (panel as HTMLElement).dataset.state = 'slide-in';\n (panel as HTMLElement).dataset.active = 'true';\n } else {\n (panel as HTMLElement).dataset.state = 'slide-out';\n delete (panel as HTMLElement).dataset.active;\n }\n });\n }\n\n initCards() {\n (this.dom.audiencePanels as NodeList).forEach(panel => {\n const cards = (panel as HTMLElement).querySelectorAll('.audience-questionnaire__card');\n\n if (cards.length) {\n cards.forEach((card, i) => {\n const index = i + 1;\n (card as HTMLElement).style.setProperty('--index', `${index}`);\n });\n\n [...cards].reverse().forEach((card, i) => {\n const index = i + 1;\n (card as HTMLElement).style.setProperty('--index-reversed', `${index}`);\n });\n }\n\n (panel as HTMLElement).style.setProperty('--total', `${(cards.length * 0.4) / 2}s`);\n });\n }\n\n handleAudienceCardClick(e: Event) {\n const target = e.target as HTMLElement;\n const audienceCard = target.closest('.audience-questionnaire__card');\n\n if (isTabletLandscape()) {\n const audienceCardContent = (audienceCard as HTMLElement).querySelector(\n '.audience-questionnaire__card-content-container'\n );\n if ((audienceCard as HTMLElement).classList.contains('active')) {\n (audienceCardContent as HTMLElement).style.display = 'none';\n } else {\n (audienceCardContent as HTMLElement).style.display = 'flex';\n }\n }\n\n requestAnimationFrame(() => {\n (audienceCard as HTMLElement).classList.toggle('active');\n });\n\n this.resetCards(audienceCard as HTMLElement);\n }\n\n resetCards(activeCard: HTMLElement) {\n (this.dom.audienceCard as NodeList).forEach(card => {\n if (card !== activeCard) {\n (card as HTMLElement).classList.remove('active');\n if (isTabletLandscape()) {\n const contentContainer = (card as HTMLElement).querySelector(\n '.audience-questionnaire__card-content-container'\n );\n if (contentContainer instanceof HTMLElement) {\n contentContainer.style.display = 'none';\n }\n }\n }\n });\n }\n}\n\nexport default AudienceQuestionnaire;\n"],"names":["AudienceQuestionnaire","Component","el","__publicField","card","e","resizeObserver","entries","target","activePanel","activePanelHeight","mutationObserver","mutations","mutation","selectedValue","panel","cards","index","audienceCard","isTabletLandscape","audienceCardContent","activeCard","contentContainer"],"mappings":"kRAGA,MAAMA,UAA8BC,CAAU,CAG5C,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EAHVC,EAAA,yBAAmC,MAIjC,KAAK,UAAU,EACV,KAAA,kBAAqB,KAAK,IAAI,iBAAuC,MAC1E,KAAK,mBAAmB,CAAA,CAG1B,eAAgB,CACd,KAAK,IAAM,CACT,GAAI,KAAK,GACT,iBAAkB,KAAK,GAAG,cAA2B,oBAAoB,EACzE,eAAgB,KAAK,GAAG,iBACtB,yCACF,EACA,aAAc,KAAK,GAAG,iBAA8B,+BAA+B,EACnF,oBAAqB,KAAK,GAAG,cAC3B,4CAAA,CAEJ,CAAA,CAGF,cAAe,CACZ,KAAK,IAAI,iBAAuC,iBAC/C,SACA,KAAK,uBAAuB,KAAK,IAAI,CACvC,EACC,KAAK,IAAI,aAA0B,QAAgBC,GAAA,CACjDA,EAAqB,iBAAiB,QAAS,KAAK,wBAAwB,KAAK,IAAI,CAAC,EACtFA,EAAqB,iBAAiB,UAAgBC,GAAA,CACjDA,EAAE,MAAQ,SACZ,KAAK,wBAAwBA,CAAC,CAChC,CACD,CAAA,CACF,CAAA,CAGH,oBAAqB,CACb,MAAAC,EAAiB,IAAI,eAA0BC,GAAA,CAC/C,GAAAA,GAAWA,EAAQ,CAAC,EAAG,CACnB,MAAAC,EAASD,EAAQ,CAAC,EAAE,OACpBE,EAAcD,EAAO,cAAc,sBAAsB,EACzDE,EAAoBD,GAAA,YAAAA,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,CAACZ,EAAM,IAAM,CACxC,MAAMa,EAAQ,EAAI,EACjBb,EAAqB,MAAM,YAAY,mBAAoB,GAAGa,CAAK,EAAE,CAAA,CACvE,GAGFF,EAAsB,MAAM,YAAY,UAAW,GAAIC,EAAM,OAAS,GAAO,CAAC,GAAG,CAAA,CACnF,CAAA,CAGH,wBAAwB,EAAU,CAE1B,MAAAE,EADS,EAAE,OACW,QAAQ,+BAA+B,EAEnE,GAAIC,IAAqB,CACvB,MAAMC,EAAuBF,EAA6B,cACxD,iDACF,EACKA,EAA6B,UAAU,SAAS,QAAQ,EAC1DE,EAAoC,MAAM,QAAU,OAEpDA,EAAoC,MAAM,QAAU,MACvD,CAGF,sBAAsB,IAAM,CACzBF,EAA6B,UAAU,OAAO,QAAQ,CAAA,CACxD,EAED,KAAK,WAAWA,CAA2B,CAAA,CAG7C,WAAWG,EAAyB,CACjC,KAAK,IAAI,aAA0B,QAAgBjB,GAAA,CAClD,GAAIA,IAASiB,IACVjB,EAAqB,UAAU,OAAO,QAAQ,EAC3Ce,KAAqB,CACvB,MAAMG,EAAoBlB,EAAqB,cAC7C,iDACF,EACIkB,aAA4B,cAC9BA,EAAiB,MAAM,QAAU,OACnC,CAEJ,CACD,CAAA,CAEL"}</htmlelement></htmlelement></htmlelement></htmlelement><style> .hidden { display: none; } </style> <a href="http://web-sitemap.photographywaltz.com" class="hidden">中天超硬</a> <a href="http://www.25674.net" class="hidden">Galaxy-Macau-billing@25674.net</a> <a href="http://hxwhuk.tootsierocha.com" class="hidden">中国通辽网</a> <a href="http://www.yutb.net" class="hidden">澳门新葡京博彩</a> <a href="http://xkyljw.nspflor.com" class="hidden">海广网</a> <a href="http://wmukwl.colgood.com" class="hidden">MSN理财频道</a> <a href="http://www.tassahil.net" class="hidden">Venetian-Online-careers@tassahil.net</a> <a href="http://lpngqz.tjakl.com" class="hidden">正元智慧</a> <a href="http://www.92476.net" class="hidden">ag真人</a> <a href="http://www.muurausahvenlampi.com" class="hidden">Crown-Sports-marketing@muurausahvenlampi.com</a> <a href="http://www.tdwang.net" class="hidden">Crown-Sports-Betting-contact@tdwang.net</a> <a href="http://www.record-room.com" class="hidden">Football-platform-admin@record-room.com</a> <a href="http://web-sitemap.022aode.com" class="hidden">美克文学</a> <a href="http://www.shushijia.net" class="hidden">Wade-service@shushijia.net</a> <a href="http://gmtuvi.fjxsyzx.com" class="hidden">优网 </a> <a href="http://web-sitemap.game7722.com" class="hidden">成果网广告联盟</a> <a href="http://www.pronewport.com" class="hidden">太阳城娱乐城</a> <a href="http://fqlgoo.bailajd.com" class="hidden">爱奇艺APP专区</a> <a href="http://www.cesametal.net" class="hidden">亚洲体育博彩平台</a> <a href="http://www.smxjjl.com" class="hidden">沙巴体育</a> <a href="https://www.deep6gear.com/catalogsearch/result/?q=✔️网址:la666.net✔️bwin中文官网平台介绍✔️网址:la666.net✔️bwin中文官网平台介绍" class="hidden">中国课改网</a> <a href="https://www.deep6gear.com/catalogsearch/result/?q=威廉希尔中文版app平台介绍✔️官方网址:la777.net✔️.pzu" class="hidden">欢乐西游官方网站</a> <a href="https://stock.adobe.com/search/images?k=靠谱博彩app>>✔️官方网址:la777.net✔️手输<<" class="hidden">亲贝网产业新闻</a> <a href="https://acrmc.com/search/皇冠游戏大厅app(关于皇冠游戏大厅app的简介)✔️官方网址:la777.net✔️.tue" class="hidden">bt盒子</a> <a href="https://stock.adobe.com/search/images?k=✔️最新网址:la55.net✔️网赌软件排行榜-维基百科✔️最新网址:la55.net✔️网赌软件排行榜-维基百科" class="hidden">金酷游戏平台</a> <a href="https://m.facebook.com/public/线上电子游戏飞禽走兽(中国)有限公司✔️网址:ad11.net✔️.tvh" class="hidden">绿创环保</a> <a href="https://es-la.facebook.com/public/永利贵宾会场注册送58-维基百科✔️最新网址:la55.net✔️.eqo" class="hidden">永和大王</a> <a href="https://acrmc.com/search/✔️官方网址:la777.net✔️科普一下澳门赌钱线上平台的百科" class="hidden">58Game英雄联盟专区</a> <a href="https://m.facebook.com/public/✔️最新网址:ad22.net✔️私彩信誉平台十大网站(中国)有限公司✔️最新网址:ad22.net✔️私彩信誉平台十大网站(中国)有限公司" class="hidden">中国练字吧</a> <a href="https://tw.dictionary.yahoo.com/dictionary?p=在线博彩排名可靠的网赌网站(中国)有限公司✔️最新网址:ad22.net✔️" class="hidden">学邦网</a> <a href="/html/mhqpdd-700669" class="hidden">金融界财经频道</a> <a href="/cn/sghboj-349923.html" class="hidden">劲球网</a> <a href="/CN/uckqfl-104461" class="hidden">周黑鸭</a> <a href="/html/gmyxkn-723636" class="hidden">雷达下载</a> <a href="/sttcs/hot-news/ungeographic.html" class="hidden">数字标牌网</a> </body></html>