Inicio Cultura Noticias de Derbyshire: Padres furiosos después de que se les dijo a...

Noticias de Derbyshire: Padres furiosos después de que se les dijo a los niños que se les prohibiría usar disfraces británicos en el Día de la Cultura

4
0

<head prefix&equals;»og&colon; https&colon;&sol;&sol;ogp&period;me&sol;ns&num; article&colon; https&colon;&sol;&sol;ogp&period;me&sol;ns&sol;article&num;»><script type&equals;»application&sol;ld&plus;json»><&excl;&lbrack;CDATA&lbrack;&lbrace;»&commat;context»&colon;»https&colon;&sol;&sol;schema&period;org»&comma;»&commat;id»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;news&sol;derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»&comma;»&commat;type»&colon;»NewsArticle»&comma;»articleSection»&colon;»News»&comma;»author»&colon;&lbrace;»&commat;type»&colon;»Person»&comma;»description»&colon;»George is a News Reporter who joined GB News from Stoke-on-TrentLive in November 2023&period; He has substantial experience in digital journalism&comma; having previously worked for Sky News&comma; British Forces Broadcasting Service and The Burton Mail&period; He is passionate about local news&comma; live music and international politics&period; Contact&colon; george&period;bunn&commat;gbnews&period;uk»&comma;»identifier»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;authors&sol;george-bunn»&comma;»image»&colon;&lbrace;»&commat;type»&colon;»ImageObject»&comma;»height»&colon;512&comma;»url»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9&period;eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy82MTYzMDY4Mi9vcmlnaW4uanBnIiwiZXhwaXJlc19hdCI6MTgwNzMyMzQxOH0&period;88t9GjQk6KyTz4Rqw2foQ7lRNZhwZXMBbz3zri9D6QE&sol;image&period;jpg&quest;width&equals;210″&comma;»width»&colon;512&rcub;&comma;»name»&colon;»George Bunn»&comma;»url»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;authors&sol;george-bunn»&rcub;&comma;»dateModified»&colon;»2026-04-18T17&colon;42&colon;56Z»&comma;»datePublished»&colon;»2026-04-18T17&colon;40&colon;34Z»&comma;»description»&colon;»Parents at a Derbyshire secondary school have expressed fury over claims their children were informed that British attire would be prohibited during a special cultural celebration event&period;Anthony Meakin&comma; whose daughter attends Noel-Baker Academy in Alvaston&comma; said he was outraged after learning of the &period;&period;&period;»&comma;»headline»&colon;»Derbyshire news&colon; Parents fuming after children told they would be sent home on ‘Culture Day’ for wearing British costumes – but school hits back»&comma;»image»&colon;&lbrace;»&commat;type»&colon;»ImageObject»&comma;»height»&colon;600&comma;»url»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;noel-baker-academy&period;png&quest;id&equals;65570751&width&equals;1200&height&equals;600&coordinates&equals;0&percnt;2C184&percnt;2C0&percnt;2C184″&comma;»width»&colon;1200&rcub;&comma;»inLanguage»&colon;»en-GB»&comma;»keywords»&colon;&lbrack;»News»&comma;»SGG»&comma;»East Midlands»&comma;»Across the UK»&rsqb;&comma;»mainEntityOfPage»&colon;&lbrace;»&commat;id»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;news&sol;derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»&comma;»&commat;type»&colon;»WebPage»&rcub;&comma;»publisher»&colon;&lbrace;»&commat;type»&colon;»NewsMediaOrganization»&comma;»logo»&colon;&lbrace;»&commat;type»&colon;»ImageObject»&comma;»url»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9&period;eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8zMzEwMDg4MS9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTc5NzY2ODQ5OX0&period;yPkj1VxfBk72KU9hNSQwXmOcRlz79vywCKtwhL4rbwA&sol;image&period;png&quest;width&equals;210″&rcub;&comma;»name»&colon;»GB News»&comma;»sameAs»&colon;&lbrack;»https&colon;&sol;&sol;www&period;facebook&period;com&sol;GBNewsOnline»&comma;»https&colon;&sol;&sol;x&period;com&sol;GBNEWS»&comma;»https&colon;&sol;&sol;www&period;instagram&period;com&sol;gbnews&sol;»&comma;»https&colon;&sol;&sol;www&period;linkedin&period;com&sol;company&sol;gb-news&sol;»&comma;»https&colon;&sol;&sol;www&period;youtube&period;com&sol;channel&sol;UC0vn8ISa4LKMunLbzaXLnOQ»&comma;»https&colon;&sol;&sol;www&period;tiktok&period;com&sol;&commat;gbnews»&comma;»https&colon;&sol;&sol;bsky&period;app&sol;profile&sol;gbnewsonline&period;bsky&period;social»&comma;»https&colon;&sol;&sol;www&period;threads&period;net&sol;&commat;gbnews»&rsqb;&rcub;&comma;»thumbnailUrl»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;noel-baker-academy&period;png&quest;id&equals;65570751&width&equals;1200&height&equals;600&coordinates&equals;0&percnt;2C184&percnt;2C0&percnt;2C184″&comma;»url»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;news&sol;derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»&rcub;&rsqb;&rsqb;><&sol;script><script type&equals;»application&sol;ld&plus;json»><&excl;&lbrack;CDATA&lbrack;&lbrace;»&commat;context»&colon;»https&colon;&sol;&sol;schema&period;org»&comma;»&commat;type»&colon;»VideoObject»&comma;»contentUrl»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;res&sol;scraper&sol;embed&sol;&quest;video&lowbar;url&equals;https&percnt;3A&percnt;2F&percnt;2Fmm-v2&period;simplestream&period;com&percnt;2Fiframe&percnt;2Fplayer&period;php&percnt;3Fkey&percnt;3D3Li3Nt2Qs8Ct3Xq9Fi5Uy0Mb2Bj0Qs&percnt;26player&percnt;3DGB003&percnt;26uvid&percnt;3D53285822&percnt;26type&percnt;3Dvod&percnt;26viously&lowbar;id&percnt;3D»&comma;»description»&colon;»Noel-Baker Academy in Alvaston has strongly denied the claims»&comma;»embedUrl»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;res&sol;scraper&sol;embed&sol;&quest;video&lowbar;url&equals;https&percnt;3A&percnt;2F&percnt;2Fmm-v2&period;simplestream&period;com&percnt;2Fiframe&percnt;2Fplayer&period;php&percnt;3Fkey&percnt;3D3Li3Nt2Qs8Ct3Xq9Fi5Uy0Mb2Bj0Qs&percnt;26player&percnt;3DGB003&percnt;26uvid&percnt;3D53285822&percnt;26type&percnt;3Dvod&percnt;26viously&lowbar;id&percnt;3D»&comma;»keywords»&colon;&lbrack;»News»&comma;»SGG»&comma;»East Midlands»&comma;»Across the UK»&rsqb;&comma;»name»&colon;»Derbyshire news&colon; Parents fuming after children told they would be sent home on ‘Culture Day’ for wearing British costumes – but school hits back»&comma;»publisher»&colon;&lbrace;»&commat;type»&colon;»Organization»&comma;»logo»&colon;&lbrace;»&commat;type»&colon;»ImageObject»&comma;»url»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9&period;eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8zMzEwMDg4MS9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTc5NzY2ODQ5OX0&period;yPkj1VxfBk72KU9hNSQwXmOcRlz79vywCKtwhL4rbwA&sol;image&period;png&quest;width&equals;210″&rcub;&comma;»name»&colon;»GB News»&comma;»sameAs»&colon;&lbrack;»https&colon;&sol;&sol;www&period;facebook&period;com&sol;GBNewsOnline»&comma;»https&colon;&sol;&sol;x&period;com&sol;GBNEWS»&comma;»https&colon;&sol;&sol;www&period;instagram&period;com&sol;gbnews&sol;»&comma;»https&colon;&sol;&sol;www&period;linkedin&period;com&sol;company&sol;gb-news&sol;»&comma;»https&colon;&sol;&sol;www&period;youtube&period;com&sol;channel&sol;UC0vn8ISa4LKMunLbzaXLnOQ»&comma;»https&colon;&sol;&sol;www&period;tiktok&period;com&sol;&commat;gbnews»&comma;»https&colon;&sol;&sol;bsky&period;app&sol;profile&sol;gbnewsonline&period;bsky&period;social»&comma;»https&colon;&sol;&sol;www&period;threads&period;net&sol;&commat;gbnews»&rsqb;&rcub;&comma;»thumbnailUrl»&colon;&lbrack;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;noel-baker-academy&period;png&quest;id&equals;65570751&width&equals;980″&rsqb;&comma;»uploadDate»&colon;»2026-04-18T17&colon;40&colon;34Z»&comma;»url»&colon;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;news&sol;derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»&rcub;&rsqb;&rsqb;><&sol;script><meta charset&equals;»utf-8″&sol;><link rel&equals;»preload» as&equals;»font» href&equals;»https&colon;&sol;&sol;fonts&period;gstatic&period;com&sol;s&sol;montserrat&sol;v25&sol;JTUSjIg1&lowbar;i6t8kCHKm459WlhyyTh89Y&period;woff2″ type&equals;»font&sol;woff2″ crossorigin&equals;»»&sol;><meta name&equals;»robots» content&equals;»max-image-preview&colon;large»&sol;><link rel&equals;»preload» imagesrcset&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;uniforms-create-sameness-commentator-weighs-in-on-restrictive-school-dress-after-gb-news-report-gb-news&period;jpg&quest;id&equals;65570750&amp&semi;width&equals;1245&amp&semi;height&equals;700&amp&semi;quality&equals;85&amp&semi;coordinates&equals;0&percnt;2C0&percnt;2C1&percnt;2C0 3x&comma; https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;uniforms-create-sameness-commentator-weighs-in-on-restrictive-school-dress-after-gb-news-report-gb-news&period;jpg&quest;id&equals;65570750&amp&semi;width&equals;1245&amp&semi;height&equals;700&amp&semi;quality&equals;85&amp&semi;coordinates&equals;0&percnt;2C0&percnt;2C1&percnt;2C0 2x&comma; https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;uniforms-create-sameness-commentator-weighs-in-on-restrictive-school-dress-after-gb-news-report-gb-news&period;jpg&quest;id&equals;65570750&amp&semi;width&equals;1245&amp&semi;height&equals;700&amp&semi;quality&equals;85&amp&semi;coordinates&equals;0&percnt;2C0&percnt;2C1&percnt;2C0 1x» as&equals;»image» fetchpriority&equals;»high»&sol;><link rel&equals;»canonical» href&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;news&sol;derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»&sol;><meta property&equals;»fb&colon;app&lowbar;id» content&equals;»3642″&sol;><meta name&equals;»twitter&colon;site» content&equals;»&commat;GBNews»&sol;><meta name&equals;»twitter&colon;site&colon;id» content&equals;»1339166129110065152″&sol;><meta property&equals;»og&colon;type» content&equals;»article»&sol;><meta property&equals;»article&colon;section» content&equals;»News»&sol;><meta property&equals;»og&colon;url» content&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;news&sol;derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»&sol;><meta property&equals;»og&colon;site&lowbar;name» content&equals;»GB News»&sol;><meta property&equals;»og&colon;image» content&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;noel-baker-academy&period;png&quest;id&equals;65570751&amp&semi;width&equals;1200&amp&semi;height&equals;600&amp&semi;coordinates&equals;0&percnt;2C302&percnt;2C0&percnt;2C66″&sol;><meta property&equals;»og&colon;image&colon;width» content&equals;»1200″&sol;><meta property&equals;»og&colon;image&colon;height» content&equals;»600″&sol;><meta property&equals;»og&colon;title» content&equals;»Derbyshire news&colon; Parents fuming after children told they would be banned from wearing British costumes on ‘Culture Day’ – but school hits back»&sol;><meta property&equals;»og&colon;description» content&equals;»Noel-Baker Academy in Alvaston has strongly denied the claims»&sol;><meta name&equals;»description» content&equals;»Parents at a Derbyshire secondary school have expressed fury over claims their children were informed that British attire would be prohibited during a special cultural celebration event»&sol;><meta name&equals;»referrer» content&equals;»always»&sol;><meta name&equals;»twitter&colon;card» content&equals;»summary&lowbar;large&lowbar;image»&sol;><meta name&equals;»twitter&colon;image» content&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;noel-baker-academy&period;png&quest;id&equals;65570751&amp&semi;width&equals;1200&amp&semi;height&equals;600&amp&semi;coordinates&equals;0&percnt;2C302&percnt;2C0&percnt;2C66″&sol;><link rel&equals;»preconnect» href&equals;»https&colon;&sol;&sol;assets&period;rebelmouse&period;io&sol;» crossorigin&equals;»anonymous»&sol;><link rel&equals;»preconnect» href&equals;»https&colon;&sol;&sol;user-stats&period;rbl&period;ms&sol;» crossorigin&equals;»anonymous»&sol;><link rel&equals;»preconnect» href&equals;»https&colon;&sol;&sol;pages-stats&period;rbl&period;ms&sol;» crossorigin&equals;»anonymous»&sol;><&excl;–link rel&equals;»preload» href&equals;»https&colon;&sol;&sol;static&period;rbl&period;ms&sol;static&sol;fonts&sol;fontawesome&sol;fontawesome-mini&period;woff» as&equals;»font» type&equals;»font&sol;woff2″ crossorigin–><script class&equals;»rm-i-script»><&excl;&lbrack;CDATA&lbrack;window&period;REBELMOUSE&lowbar;BOOTSTRAP&lowbar;DATA &equals; &lbrace;»isUserLoggedIn»&colon; false&comma; «site»&colon; &lbrace;»id»&colon; 25354495&comma; «isCommunitySite»&colon; false&rcub;&comma; «runner»&colon; &lbrace;»id»&colon; 25354495&rcub;&comma; «post»&colon; &lbrace;»id»&colon; 2676762030&comma; «sections»&colon; &lbrack;0&comma; 584086272&comma; 2262988002&comma; 588563272&comma; 586304622&comma; 2260688433&comma; 590311187&comma; 586304181&comma; 586311833&comma; 588563322&rsqb;&comma; «shareUrl»&colon; «https&percnt;3A&percnt;2F&percnt;2Fwww&period;gbnews&period;com&percnt;2Fnews&percnt;2Fderbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»&comma; «status»&colon; 0&comma; «tags»&colon; &lbrack;&rsqb;&rcub;&comma; «path»&colon; «&sol;news&sol;derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»&comma; «pathParams»&colon; &lbrace;»sections»&colon; «news&sol;»&comma; «slug»&colon; «derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»&rcub;&comma; «resourceId»&colon; «pp&lowbar;2676762030″&comma; «fbId»&colon; «3642»&comma; «fbAppVersion»&colon; «v2&period;5″&comma; «clientGaId»&colon; «»&comma; «messageBusUri»&colon; «wss&colon;&sol;&sol;messages&period;rebelmouse&period;io»&comma; «section»&colon; &lbrace;»id»&colon; null&rcub;&comma; «tag»&colon; &lbrace;»slug»&colon; null&comma; «isSection»&colon; false&rcub;&comma; «fullBootstrapUrl»&colon; «&sol;res&sol;bootstrap&sol;data&period;js&quest;site&lowbar;id&equals;25354495&bsol;u0026resource&lowbar;id&equals;pp&lowbar;2676762030&bsol;u0026path&lowbar;params&equals;&percnt;7B&percnt;22sections&percnt;22&percnt;3A&percnt;22news&percnt;2F&percnt;22&percnt;2C&percnt;22slug&percnt;22&percnt;3A&percnt;22derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home&percnt;22&percnt;7D&bsol;u0026override&lowbar;device&equals;desktop&bsol;u0026post&lowbar;id&equals;2676762030″&comma; «whitelabel&lowbar;menu»&colon; &lbrace;&rcub;&comma; «useRiver»&colon; true&comma; «engine»&colon; &lbrace;»recaptchaSiteKey»&colon; null&comma; «lazyLoadShortcodeImages»&colon; true&comma; «backButtonGoToPage»&colon; true&comma; «changeParticleUrlScroll»&colon; false&comma; «countKeepReadingAsPageview»&colon; true&comma; «defaultVideoPlayer»&colon; «»&comma; «theoPlayerLibraryLocation»&colon; «»&comma; «trackPageViewOnParticleUrlScroll»&colon; false&comma; «webVitalsSampleRate»&colon; 100&comma; «overrideDevicePixelRatio»&colon; null&comma; «image&lowbar;quality&lowbar;level»&colon; 85&comma; «sendEventsToCurrentDomain»&colon; false&comma; «enableLoggedOutUserTracking»&colon; false&comma; «useSmartLinks2″&colon; true&comma; «enableRunnerCss»&colon; true&rcub;&rcub;&semi;&NewLine; &rsqb;&rsqb;><&sol;script><script class&equals;»rm-i-script»><&excl;&lbrack;CDATA&lbrack;window&period;REBELMOUSE&lowbar;BASE&lowbar;ASSETS&lowbar;URL &equals; «https&colon;&sol;&sol;www&period;gbnews&period;com&sol;static&sol;dist&sol;social-ux&sol;»&semi;&NewLine; window&period;REBELMOUSE&lowbar;BASE&lowbar;SSL&lowbar;DOMAIN &equals; «https&colon;&sol;&sol;www&period;gbnews&period;com»&semi;&NewLine; window&period;REBELMOUSE&lowbar;TASKS&lowbar;QUEUE &equals; &lbrack;&rsqb;&semi;&NewLine; window&period;REBELMOUSE&lowbar;LOW&lowbar;TASKS&lowbar;QUEUE &equals; &lbrack;&rsqb;&semi;&NewLine; window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE &equals; &lbrack;&rsqb;&semi;&NewLine; window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE &equals; &lbrack;&rsqb;&semi;&NewLine; window&period;REBELMOUSE&lowbar;STDLIB &equals; &lbrace;&rcub;&semi;&NewLine; window&period;RM&lowbar;OVERRIDES &equals; &lbrace;&rcub;&semi;&NewLine; window&period;RM&lowbar;AD&lowbar;LOADER &equals; &lbrack;&rsqb;&semi;&NewLine; &rsqb;&rsqb;><&sol;script><script src&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;static&sol;dist&sol;social-ux&sol;main&period;e904fda0cc1755b4dd4c&period;bundle&period;mjs» class&equals;»rm-i-script» type&equals;»module» async&equals;»async» data-js-app&equals;»true» data-src-host&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com» data-src-file&equals;»main&period;mjs»&sol;><script src&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;static&sol;dist&sol;social-ux&sol;main&period;667462a920874f59f5f4&period;bundle&period;js» class&equals;»rm-i-script» nomodule&equals;»nomodule» defer&equals;»defer» data-js-app&equals;»true» data-src-host&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com» data-src-file&equals;»main&period;js»&sol;><script src&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;static&sol;dist&sol;social-ux&sol;runtime&period;a0845c2239181f89813b&period;bundle&period;mjs» class&equals;»rm-i-script» type&equals;»module» async&equals;»async» data-js-app&equals;»true» data-src-host&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com» data-src-file&equals;»runtime&period;mjs»&sol;><script src&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;static&sol;dist&sol;social-ux&sol;runtime&period;38cb9714fb6f2dc3afb0&period;bundle&period;js» class&equals;»rm-i-script» nomodule&equals;»nomodule» defer&equals;»defer» data-js-app&equals;»true» data-src-host&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com» data-src-file&equals;»runtime&period;js»&sol;><&excl;– we collected enough need to fix it first before turn in back on–><&excl;–script src&equals;»&sol;&sol;cdn&period;ravenjs&period;com&sol;3&period;16&period;0&sol;raven&period;min&period;js» crossorigin&equals;»anonymous»><&sol;script–><&excl;–script type&equals;»text&sol;javascript»>&NewLine; Raven&period;config&lpar;’https&colon;&sol;&sol;6b64f5cc8af542cbb920e0238864390a&commat;sentry&period;io&sol;147999’&rpar;&period;install&lpar;&rpar;&semi;&NewLine; <&sol;script–><link rel&equals;»manifest» href&equals;»&sol;manifest&period;json»&sol;><meta name&equals;»theme-color» content&equals;»&num;647187″&sol;><script class&equals;»rm-i-script»><&excl;&lbrack;CDATA&lbrack;&NewLine; if &lpar;’serviceWorker’ in navigator&rpar; &lbrace;&NewLine; window&period;addEventListener&lpar;’load’&comma; function&lpar;&rpar; &lbrace;&NewLine; navigator&period;serviceWorker&period;register&lpar;’&sol;sw&period;js’&rpar;&period;then&lpar;function&lpar;registration&rpar; &lbrace;&NewLine; console&period;log&lpar;’ServiceWorker registration successful with scope&colon; ‘&comma; registration&period;scope&rpar;&semi;&NewLine; &rcub;&comma; function&lpar;err&rpar; &lbrace;&NewLine; console&period;log&lpar;’ServiceWorker registration failed&colon; ‘&comma; err&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;log&lpar;’ServiceWorker not enabled’&rpar;&semi;&NewLine; &rcub;&NewLine; &rsqb;&rsqb;><&sol;script><script class&equals;»rm-i-script»><&excl;&lbrack;CDATA&lbrack;&NewLine; &sol;&sol; fallback error prone google tag setup&NewLine; var googletag &equals; googletag &vert;&vert; &lbrace;&rcub;&semi;&NewLine; googletag&period;cmd &equals; googletag&period;cmd &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; &rsqb;&rsqb;><&sol;script><meta http-equiv&equals;»X-UA-Compatible» content&equals;»IE&equals;edge»&sol;><link rel&equals;»alternate» type&equals;»application&sol;rss&plus;xml» title&equals;»GB News» href&equals;»&sol;feeds&sol;news&period;rss»&sol;><meta name&equals;»viewport» content&equals;»width&equals;device-width&comma;initial-scale&equals;1&comma;minimum-scale&equals;1&period;0″&sol;><&excl;– TODO&colon; move the default value from here –><title>Derbyshire news&colon; Parents fuming after children told they would be sent home on ‘Culture Day’ for wearing British costumes – but school hits back<&sol;title><script class&equals;»rm-i-script»><&excl;&lbrack;CDATA&lbrack;&NewLine; window&period;REBELMOUSE&lowbar;LOW&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar; &lbrace;&NewLine; if&lpar;window&period;REBELMOUSE&lowbar;BOOTSTRAP&lowbar;DATA&period;engine&period;enableRunnerCss&rpar;&lbrace;&NewLine; window&period;REBELMOUSE&lowbar;STDLIB&period;loadExternalStylesheet&lpar;»&sol;static&sol;css-build&sol;roar&sol;runner&sol;social-ux-non-critical&period;css&quest;v&equals;rmxassets9f85b614d0482c26a5f33e04e87319ff»&comma; function&lpar;&rpar;&lbrace;&NewLine; document&period;body&period;classList&period;add&lpar;»rm-non-critical-loaded»&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rsqb;&rsqb;><&sol;script><script class&equals;»rm-i-script»><&excl;&lbrack;CDATA&lbrack;&NewLine; var &lowbar;&lowbar;RUNNER&lowbar;PUBLIC&lowbar;&lowbar; &equals; &lbrace;&NewLine; root&colon; ‘&num;runner-root’&comma;&NewLine; events&colon; &lbrace;&NewLine; PAGE&lowbar;VIEW&colon; ‘page&lowbar;view&period;url&lowbar;change&period;listicle&lowbar;switch&lowbar;page’&comma;&NewLine; URL&lowbar;CHANGE&lowbar;PAGE&lowbar;VIEW&colon; ‘page&lowbar;view&period;url&lowbar;change’&comma;&NewLine; LISTICLE&lowbar;CHANGE&lowbar;PAGE&lowbar;VIEW&colon; ‘page&lowbar;view&period;listicle&lowbar;switch&lowbar;page’&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rsqb;&rsqb;><&sol;script><script class&equals;»rm-i-script»><&excl;&lbrack;CDATA&lbrack;&NewLine; window&period;&lowbar;&lowbar;rebelmouseJsBaseUrl &equals; «&sol;static&sol;js-build&sol;»&semi;&NewLine; &NewLine; window&period;&lowbar;&lowbar;rebelmousePrimaryColor &equals; «&num;000F55″&semi;&NewLine; &NewLine; &rsqb;&rsqb;><&sol;script><link rel&equals;»apple-touch-icon» href&equals;»https&colon;&sol;&sol;assets&period;rebelmouse&period;io&sol;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9&period;eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8zMjYyMTMwMy9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTgxNDg2NzYyOX0&period;IYprghyeE3T3jw0kNaO7OI15smHQyaNF8bdZyegluY8&sol;img&period;png&quest;width&equals;192&amp&semi;height&equals;192″ sizes&equals;»192×192″&sol;><link rel&equals;»icon» type&equals;»image&sol;png» href&equals;»https&colon;&sol;&sol;assets&period;rebelmouse&period;io&sol;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9&period;eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8zMjYyMTMwMy9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTgxNDg2NzYyOX0&period;IYprghyeE3T3jw0kNaO7OI15smHQyaNF8bdZyegluY8&sol;img&period;png&quest;width&equals;48&amp&semi;height&equals;48″ sizes&equals;»48×48″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»socialux» data-abtest-value&equals;»1″&sol;><meta property&equals;»article&colon;published&lowbar;time» content&equals;»2026-04-18T17&colon;40&colon;34&plus;00&colon;00″&sol;><meta property&equals;»article&colon;modified&lowbar;time» content&equals;»2026-04-18T17&colon;42&colon;56&plus;00&colon;00″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»empty» data-abtest-value&equals;»css»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»schema» data-abtest-value&equals;»2028″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»16″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4690″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4591″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4645-2″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4655″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4617″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4615″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4600″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»vod-inder»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»primis» data-abtest-value&equals;»dedicated»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»ce» data-abtest-value&equals;»2″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4238″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»test» data-abtest-value&equals;»1″&sol;><script><&excl;&lbrack;CDATA&lbrack;&NewLine;&NewLine;&rsqb;&rsqb;><&sol;script><meta name&equals;»apple-itunes-app» content&equals;»app-id&equals;1566365113&comma; app-argument&equals;gbnews&colon;&sol;&sol;articles&sol;2676762030″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4709″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4645″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4605-2″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»GBN» data-abtest-value&equals;»2117″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»GBN» data-abtest-value&equals;»2116″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4605″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4689″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»FA» data-abtest-value&equals;»709″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4645-1″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4627″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»anchoring»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4606″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»cmps»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»48″&sol;><script><&excl;&lbrack;CDATA&lbrack;&NewLine; «use strict»&semi;function &lowbar;typeof&lpar;t&rpar;&lbrace;return&lpar;&lowbar;typeof&equals;»function»&equals;&equals;typeof Symbol&&»symbol»&equals;&equals;typeof Symbol&period;iterator&quest;function&lpar;t&rpar;&lbrace;return typeof t&rcub;&colon;function&lpar;t&rpar;&lbrace;return t&&»function»&equals;&equals;typeof Symbol&&t&period;constructor&equals;&equals;&equals;Symbol&&t&excl;&equals;&equals;Symbol&period;prototype&quest;»symbol»&colon;typeof t&rcub;&rpar;&lpar;t&rpar;&rcub;&excl;function&lpar;&rpar;&lbrace;var t&equals;function&lpar;&rpar;&lbrace;var t&comma;e&comma;o&equals;&lbrack;&rsqb;&comma;n&equals;window&comma;r&equals;n&semi;for&lpar;&semi;r&semi;&rpar;&lbrace;try&lbrace;if&lpar;r&period;frames&period;&lowbar;&lowbar;tcfapiLocator&rpar;&lbrace;t&equals;r&semi;break&rcub;&rcub;catch&lpar;t&rpar;&lbrace;&rcub;if&lpar;r&equals;&equals;&equals;n&period;top&rpar;break&semi;r&equals;r&period;parent&rcub;t&vert;&vert;&lpar;&excl;function t&lpar;&rpar;&lbrace;var e&equals;n&period;document&comma;o&equals;&excl;&excl;n&period;frames&period;&lowbar;&lowbar;tcfapiLocator&semi;if&lpar;&excl;o&rpar;if&lpar;e&period;body&rpar;&lbrace;var r&equals;e&period;createElement&lpar;»iframe»&rpar;&semi;r&period;style&period;cssText&equals;»display&colon;none»&comma;r&period;name&equals;»&lowbar;&lowbar;tcfapiLocator»&comma;e&period;body&period;appendChild&lpar;r&rpar;&rcub;else setTimeout&lpar;t&comma;5&rpar;&semi;return&excl;o&rcub;&lpar;&rpar;&comma;n&period;&lowbar;&lowbar;tcfapi&equals;function&lpar;&rpar;&lbrace;for&lpar;var t&equals;arguments&period;length&comma;n&equals;new Array&lpar;t&rpar;&comma;r&equals;0&semi;r<t&semi;r&plus;&plus;&rpar;n&lbrack;r&rsqb;&equals;arguments&lbrack;r&rsqb;&semi;if&lpar;&excl;n&period;length&rpar;return o&semi;»setGdprApplies»&equals;&equals;&equals;n&lbrack;0&rsqb;&quest;n&period;length>3&&2&equals;&equals;&equals;parseInt&lpar;n&lbrack;1&rsqb;&comma;10&rpar;&&»boolean»&equals;&equals;typeof n&lbrack;3&rsqb;&&&lpar;e&equals;n&lbrack;3&rsqb;&comma;»function»&equals;&equals;typeof n&lbrack;2&rsqb;&&n&lbrack;2&rsqb;&lpar;»set»&comma;&excl;0&rpar;&rpar;&colon;»ping»&equals;&equals;&equals;n&lbrack;0&rsqb;&quest;»function»&equals;&equals;typeof n&lbrack;2&rsqb;&&n&lbrack;2&rsqb;&lpar;&lbrace;gdprApplies&colon;e&comma;cmpLoaded&colon;&excl;1&comma;cmpStatus&colon;»stub»&rcub;&rpar;&colon;o&period;push&lpar;n&rpar;&rcub;&comma;n&period;addEventListener&lpar;»message»&comma;&lpar;function&lpar;t&rpar;&lbrace;var e&equals;»string»&equals;&equals;typeof t&period;data&comma;o&equals;&lbrace;&rcub;&semi;if&lpar;e&rpar;try&lbrace;o&equals;JSON&period;parse&lpar;t&period;data&rpar;&rcub;catch&lpar;t&rpar;&lbrace;&rcub;else o&equals;t&period;data&semi;var n&equals;»object»&equals;&equals;&equals;&lowbar;typeof&lpar;o&rpar;&&null&excl;&equals;&equals;o&quest;o&period;&lowbar;&lowbar;tcfapiCall&colon;null&semi;n&&window&period;&lowbar;&lowbar;tcfapi&lpar;n&period;command&comma;n&period;version&comma;&lpar;function&lpar;o&comma;r&rpar;&lbrace;var a&equals;&lbrace;&lowbar;&lowbar;tcfapiReturn&colon;&lbrace;returnValue&colon;o&comma;success&colon;r&comma;callId&colon;n&period;callId&rcub;&rcub;&semi;t&&t&period;source&&t&period;source&period;postMessage&&t&period;source&period;postMessage&lpar;e&quest;JSON&period;stringify&lpar;a&rpar;&colon;a&comma;»&ast;»&rpar;&rcub;&rpar;&comma;n&period;parameter&rpar;&rcub;&rpar;&comma;&excl;1&rpar;&rpar;&rcub;&semi;»undefined»&excl;&equals;typeof module&quest;module&period;exports&equals;t&colon;t&lpar;&rpar;&rcub;&lpar;&rpar;&semi;&NewLine;&rsqb;&rsqb;><&sol;script><script><&excl;&lbrack;CDATA&lbrack;&NewLine;window&period;&lowbar;consentCallbacks &equals; window&period;&lowbar;consentCallbacks &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;window&period;&lowbar;consentReady &equals; false&semi;&NewLine;&NewLine;window&period;runWhenConsentIsReady &equals; function&lpar;callback&rpar; &lbrace;&NewLine; if &lpar;window&period;&lowbar;consentReady && window&period;&lowbar;sp&lowbar;&quest;&period;consentUUID&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;runWhenConsentIsReady&rsqb; Executing immediately – consent already ready’&rpar;&semi;&NewLine; callback&lpar;window&period;&lowbar;sp&lowbar;&period;consentUUID&comma; window&period;&lowbar;sp&lowbar;&period;euconsent&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine;&NewLine; window&period;&lowbar;consentCallbacks&period;push&lpar;callback&rpar;&semi;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;runWhenConsentIsReady&rsqb; Callback queued&period; Total&colon;’&comma; window&period;&lowbar;consentCallbacks&period;length&rpar;&semi;&NewLine; &NewLine; &sol;&sol; Add persistent event listener for consent changes&NewLine; if &lpar;typeof &lowbar;&lowbar;tcfapi &excl;&equals;&equals; ‘undefined’ && &excl;window&period;&lowbar;consentListenerAdded&rpar; &lbrace;&NewLine; window&period;&lowbar;consentListenerAdded &equals; true&semi;&NewLine; &NewLine; &lowbar;&lowbar;tcfapi&lpar;’addEventListener’&comma; 2&comma; function&lpar;tcData&comma; success&rpar; &lbrace;&NewLine; if &lpar;success && &lpar;tcData&period;eventStatus &equals;&equals;&equals; ‘tcloaded’ &vert;&vert; tcData&period;eventStatus &equals;&equals;&equals; ‘useractioncomplete’&rpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;runWhenConsentIsReady&rsqb; TCF consent event received&colon;’&comma; tcData&period;eventStatus&rpar;&semi;&NewLine; &NewLine; if &lpar;&excl;window&period;&lowbar;consentReady&rpar; &lbrace;&NewLine; window&period;&lowbar;consentReady &equals; true&semi;&NewLine; &NewLine; if &lpar;window&period;&lowbar;sp&lowbar;&rpar; &lbrace;&NewLine; window&period;&lowbar;sp&lowbar;&period;consentUUID &equals; tcData&period;tcString&semi;&NewLine; window&period;&lowbar;sp&lowbar;&period;euconsent &equals; tcData&semi;&NewLine; &rcub;&NewLine; &NewLine; const callbacks &equals; window&period;&lowbar;consentCallbacks&period;slice&lpar;&rpar;&semi;&NewLine; window&period;&lowbar;consentCallbacks &equals; &lbrack;&rsqb;&semi;&NewLine; &NewLine; callbacks&period;forEach&lpar;function&lpar;cb&comma; index&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;runWhenConsentIsReady&rsqb; Executing callback’&comma; index &plus; 1&rpar;&semi;&NewLine; cb&lpar;tcData&period;tcString&comma; tcData&rpar;&semi;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;’&lbrack;runWhenConsentIsReady&rsqb; Error in callback’&comma; index &plus; 1&comma; error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Also check immediately in case consent is already available&NewLine; setTimeout&lpar;function&lpar;&rpar; &lbrace;&NewLine; if &lpar;typeof &lowbar;&lowbar;tcfapi &excl;&equals;&equals; ‘undefined’ && &excl;window&period;&lowbar;consentReady&rpar; &lbrace;&NewLine; &lowbar;&lowbar;tcfapi&lpar;’getTCData’&comma; 2&comma; function&lpar;tcData&comma; success&rpar; &lbrace;&NewLine; if &lpar;success && &lpar;tcData&period;eventStatus &equals;&equals;&equals; ‘tcloaded’ &vert;&vert; tcData&period;eventStatus &equals;&equals;&equals; ‘useractioncomplete’&rpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;runWhenConsentIsReady&rsqb; TCF data already available&comma; executing all callbacks now’&rpar;&semi;&NewLine; window&period;&lowbar;consentReady &equals; true&semi;&NewLine; &NewLine; if &lpar;window&period;&lowbar;sp&lowbar;&rpar; &lbrace;&NewLine; window&period;&lowbar;sp&lowbar;&period;consentUUID &equals; tcData&period;tcString&semi;&NewLine; window&period;&lowbar;sp&lowbar;&period;euconsent &equals; tcData&semi;&NewLine; &rcub;&NewLine; &NewLine; const callbacks &equals; window&period;&lowbar;consentCallbacks&period;slice&lpar;&rpar;&semi;&NewLine; window&period;&lowbar;consentCallbacks &equals; &lbrack;&rsqb;&semi;&NewLine; &NewLine; callbacks&period;forEach&lpar;function&lpar;cb&comma; index&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;runWhenConsentIsReady&rsqb; Executing callback’&comma; index &plus; 1&rpar;&semi;&NewLine; cb&lpar;tcData&period;tcString&comma; tcData&rpar;&semi;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;’&lbrack;runWhenConsentIsReady&rsqb; Error in callback’&comma; index &plus; 1&comma; error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma; 50&rpar;&semi;&NewLine;&rcub;&semi;&NewLine;&NewLine;&sol;&sol; Helper function to execute callbacks&NewLine;function executeConsentCallbacks&lpar;consentUUID&comma; euconsent&rpar; &lbrace;&NewLine; if &lpar;&excl;window&period;&lowbar;consentReady&rpar; &lbrace;&NewLine; window&period;&lowbar;consentReady &equals; true&semi;&NewLine; &NewLine; const callbacks &equals; window&period;&lowbar;consentCallbacks&period;slice&lpar;&rpar;&semi;&NewLine; window&period;&lowbar;consentCallbacks &equals; &lbrack;&rsqb;&semi;&NewLine; &NewLine; callbacks&period;forEach&lpar;function&lpar;cb&comma; index&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;executeConsentCallbacks&rsqb; Executing callback’&comma; index &plus; 1&rpar;&semi;&NewLine; cb&lpar;consentUUID&comma; euconsent&rpar;&semi;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;’&lbrack;executeConsentCallbacks&rsqb; Error in callback’&comma; index &plus; 1&comma; error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;if &lpar;window&period;navigator&period;brave &excl;&equals; undefined&rpar; &lbrace; &NewLine; if &lpar;window&period;navigator&period;brave&period;isBrave&period;name &equals;&equals; «isBrave»&rpar; &lbrace; &NewLine; &sol;&sol; console&period;log&lpar;»THIS IS THE BRAVE BROWSER»&rpar;&semi;&NewLine; &rcub; &NewLine;&rcub; else &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;»sp&lowbar;subscribed&lowbar;status&colon;»&comma; document&period;cookie&period;split&lpar;’&semi; ‘&rpar;&period;find&lpar;row &equals;> row&period;startsWith&lpar;’sp&lowbar;subscribed&lowbar;status&equals;’&rpar;&rpar;&quest;&period;split&lpar;’&equals;’&rpar;&lbrack;1&rsqb; &vert;&vert; «false»&rpar;&semi;&NewLine;&NewLine; window&period;&lowbar;sp&lowbar;queue &equals; &lbrack;&rsqb;&semi;&NewLine; window&period;&lowbar;sp&lowbar; &equals; &lbrace;&NewLine; config&colon; &lbrace;&NewLine; accountId&colon; 1836&comma;&NewLine; baseEndpoint&colon; ‘https&colon;&sol;&sol;cdn&period;privacy-mgmt&period;com’&comma;&NewLine; gdpr&colon; &lbrace; &rcub;&comma;&NewLine; targetingParams&colon;&lbrace; &NewLine; subscribed&colon; document&period;cookie&period;split&lpar;’&semi; ‘&rpar;&period;find&lpar;row &equals;> row&period;startsWith&lpar;’sp&lowbar;subscribed&lowbar;status&equals;’&rpar;&rpar;&quest;&period;split&lpar;’&equals;’&rpar;&lbrack;1&rsqb; &vert;&vert; «false» &NewLine; &rcub;&comma;&NewLine; events&colon; &lbrace;&NewLine; onMessageReady&colon; function&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;event&rsqb; onMessageReady’&comma; arguments&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; onMessageReceiveData&colon; function&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;event&rsqb; onMessageReceiveData’&comma; arguments&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; onSPPMObjectReady&colon; function&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;event&rsqb; onSPPMObjectReady’&comma; arguments&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; onSPReady&colon; function&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;event&rsqb; onSPReady’&comma; arguments&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; onError&colon; function&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;event&rsqb; onError’&comma; arguments&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; onMessageChoiceSelect&colon; function&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;event&rsqb; onMessageChoiceSelect’&comma; arguments&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; onConsentReady&colon; function&lpar;consentUUID&comma; euconsent&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;event&rsqb; onConsentReady’&comma; arguments&rpar;&semi;&NewLine; &sol;&sol; Execute queued callbacks when consent is ready&NewLine; executeConsentCallbacks&lpar;consentUUID&comma; euconsent&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; onPrivacyManagerAction&colon; function&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;event&rsqb; onPrivacyManagerAction’&comma; arguments&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; onPMCancel&colon; function&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’&lbrack;event&rsqb; onPMCancel’&comma; arguments&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; let script&semi;&NewLine; script &equals; document&period;createElement&lpar;»script»&rpar;&semi;&NewLine; script&period;src&equals;»https&colon;&sol;&sol;cdn&period;privacy-mgmt&period;com&sol;unified&sol;wrapperMessagingWithoutDetection&period;js»&NewLine; script&period;async &equals; true&semi;&NewLine; document&period;head&period;appendChild&lpar;script&rpar;&semi;&NewLine;&rcub;&NewLine; &NewLine;&rsqb;&rsqb;><&sol;script><&excl;– <script src&equals;»https&colon;&sol;&sol;cdn&period;privacy-mgmt&period;com&sol;unified&sol;wrapperMessagingWithoutDetection&period;js» async><&sol;script> –><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4380″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4619″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4589″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4445″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4120-merge»&sol;><script><&excl;&lbrack;CDATA&lbrack;&NewLine; window&period;dataLayer &equals; window&period;dataLayer &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; window&period;gbnConfig &equals; &lbrace;&NewLine; «dataLayer»&colon; &lbrace;&NewLine; «cd30″&colon; «default»&comma;&NewLine; «cd35″&colon; «mv&lowbar;test&lowbar;5″&comma;&NewLine; «cd36″&colon; 1&NewLine; &rcub;&NewLine; &rcub;&NewLine; &sol;&sol; 1&period; Update OB&lowbar;ContextKeyValue&NewLine; window&period;OB&lowbar;ContextKeyValue &equals; window&period;gbnConfig&period;dataLayer&period;cd30&semi;&NewLine;&NewLine; function injectOBScript&lpar;&rpar; &lbrace;&NewLine; const ob&lowbar;script &equals; document&period;createElement&lpar;’script’&rpar;&semi;&NewLine; ob&lowbar;script&period;innerHTML &equals; «window&period;OB&lowbar;ContextKeyValue&equals;'» &plus; window&period;gbnConfig&period;dataLayer&period;cd30 &plus; «‘»&semi;&NewLine; document&period;body&period;appendChild&lpar;ob&lowbar;script&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; if &lpar;document&period;readyState &equals;&equals;&equals; ‘loading’&rpar; &lbrace;&NewLine; document&period;addEventListener&lpar;’DOMContentLoaded’&comma; injectOBScript&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; injectOBScript&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine;&NewLine; &sol;&sol; 2&period; Update testVariant&NewLine; window&period;testVariant &equals; window&period;gbnConfig&period;dataLayer&period;cd30&semi;&NewLine;&NewLine;&NewLine; function getUserStatusCookieValue&lpar;name&rpar; &lbrace;&NewLine; const cookies &equals; document&period;cookie&period;split&lpar;’&semi; ‘&rpar;&semi;&NewLine; for &lpar;const cookie of cookies&rpar; &lbrace;&NewLine; const &lbrack;key&comma; value&rsqb; &equals; cookie&period;split&lpar;’&equals;’&rpar;&semi;&NewLine; if &lpar;key &equals;&equals;&equals; name&rpar; &lbrace;&NewLine; return decodeURIComponent&lpar;value&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; return null&semi;&NewLine; &rcub;&NewLine;&NewLine; &NewLine; window&period;userStatus &equals; getUserStatusCookieValue&lpar;’access&lowbar;status&lowbar;gbn’&rpar;&semi;&NewLine; &NewLine;&rsqb;&rsqb;><&sol;script><script type&equals;»application&sol;json» data-abtest-name&equals;»test» data-abtest-value&equals;»14″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»sponsored»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4673″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»GBN» data-abtest-value&equals;»1814″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4417″&sol;><link rel&equals;»manifest» href&equals;»&sol;manifest&period;json»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»ce» data-abtest-value&equals;»1″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»gbn» data-abtest-value&equals;»2079″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4342″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4254″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»2380″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»3569-rep»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4715″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4662″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4620″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4538″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»gbn» data-abtest-value&equals;»2046″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»2853″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»7″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4475″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4577″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4426″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4342-old»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»v» data-abtest-value&equals;»milosalert»&sol;><script><&excl;&lbrack;CDATA&lbrack;&NewLine; window&period;dataLayer &equals; window&period;dataLayer &vert;&vert; &lbrack;&rsqb;&semi;var contentType &equals; «article»&semi;contentType &equals; «article»&semi;let displayMode &equals; ‘ ‘&semi;&NewLine; &NewLine;if &lpar;window&period;matchMedia&lpar;’&lpar;display-mode&colon; standalone&rpar;’&rpar;&period;matches&rpar; &lbrace;&NewLine; displayMode &equals; ‘pwa’&semi;&NewLine;&rcub; else &lbrace;&NewLine; displayMode &equals; ‘web’&semi;&NewLine;&rcub;&NewLine; &NewLine;console&period;log&lpar;’display mode – ‘&comma; &grave;»&dollar;&lbrace;displayMode&rcub;»&grave;&rpar;&semi;window&period;dataLayer&period;push&lpar;&lbrace;&NewLine; «cd1″&colon; «06»&comma;&NewLine; «cd2″&colon; «06»&comma;&NewLine; «cd9″&colon; «news»&comma;&NewLine; «cd10″&colon; «article»&comma;&NewLine; «cd11″&colon; displayMode&comma; &NewLine; «cd12″&colon; «2676762030»&comma;&NewLine; «cd13″&colon; «parents fuming after children told they would be banned from wearing british costumes on ‘culture day’ – but school hits back»&comma;&NewLine; «cd14″&colon; «george bunn»&comma;&NewLine; «cd15″&colon; «2026-04-18″&comma;&NewLine; «cd16″&colon; «18&colon;40″&comma;&NewLine; «cd17″&colon; «2026-04-18″&comma;&NewLine; «cd18″&colon; «news&vert;sgg&vert;article&vert;east midlands&vert;homepage top20&vert;content type&vert;don’t miss – articles&vert;across the uk»&comma;&NewLine; «cd19″&colon; document&period;referrer&period;split&lpar;»&sol;»&rpar;&lbrack;2&rsqb;&vert;&vert;»not set»&comma;&NewLine; «cd23″&colon; «not set»&comma;&NewLine; «cd30″&colon; window&period;gbnConfig&period;dataLayer&period;cd30&comma;&NewLine; «cd31″&colon; userStatus &equals;&equals;&equals; null &quest; «» &colon; userStatus&comma;&NewLine; ‘cd35’&colon; window&period;gbnConfig&period;dataLayer&period;cd35&comma;&NewLine; ‘cd36’&colon; window&period;gbnConfig&period;dataLayer&period;cd36&comma;&NewLine; ‘cd37’&colon; «post discovery layout»&comma;&NewLine; ‘cd40’&colon; false&NewLine;&rcub;&rpar;&NewLine;&rsqb;&rsqb;><&sol;script><&excl;– User Code –><&excl;– Google Tag Manager –><script><&excl;&lbrack;CDATA&lbrack;&NewLine;&NewLine;&NewLine; &sol;&sol;MOVED TO delayedCmpScript shared element&NewLine;&NewLine;&NewLine;&NewLine;&NewLine; &sol;&sol; window&period;runWhenConsentIsReady&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’Consent is ready&comma; loading GTM Primary&period;&period;&period;’&rpar;&semi;&NewLine; &sol;&sol; &lpar;function&lpar;w&comma;d&comma;s&comma;l&comma;i&rpar;&lbrace;w&lbrack;l&rsqb;&equals;w&lbrack;l&rsqb;&vert;&vert;&lbrack;&rsqb;&semi;w&lbrack;l&rsqb;&period;push&lpar;&lbrace;’gtm&period;start’&colon;&NewLine; &sol;&sol; new Date&lpar;&rpar;&period;getTime&lpar;&rpar;&comma;event&colon;’gtm&period;js’&rcub;&rpar;&semi;var f&equals;d&period;getElementsByTagName&lpar;s&rpar;&lbrack;0&rsqb;&comma;&NewLine; &sol;&sol; j&equals;d&period;createElement&lpar;s&rpar;&comma;dl&equals;l&excl;&equals;’dataLayer’&quest;’&l&equals;’&plus;l&colon;»&semi;j&period;async&equals;true&semi;j&period;src&equals;&NewLine; &sol;&sol; ‘https&colon;&sol;&sol;www&period;googletagmanager&period;com&sol;gtm&period;js&quest;id&equals;’&plus;i&plus;dl&semi;f&period;parentNode&period;insertBefore&lpar;j&comma;f&rpar;&semi;&NewLine; &sol;&sol; &rcub;&rpar;&lpar;window&comma;document&comma;’script’&comma;’dataLayer’&comma;’GTM-MFGM96D7’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; console&period;log&lpar;’Consent is ready&comma; injecting GTM Primary iframe’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; const iframe &equals; document&period;createElement&lpar;’iframe’&rpar;&semi;&NewLine; &sol;&sol; iframe&period;src &equals; «https&colon;&sol;&sol;www&period;googletagmanager&period;com&sol;ns&period;html&quest;id&equals;GTM-MFGM96D7″&semi;&NewLine; &sol;&sol; iframe&period;height &equals; «0»&semi;&NewLine; &sol;&sol; iframe&period;width &equals; «0»&semi;&NewLine; &sol;&sol; iframe&period;style&period;display &equals; «none»&semi;&NewLine; &sol;&sol; iframe&period;style&period;visibility &equals; «hidden»&semi;&NewLine; &sol;&sol; document&period;body&period;appendChild&lpar;iframe&rpar;&semi;&NewLine;&NewLine;&NewLine; &sol;&sol; &rcub;&rpar;&semi;&NewLine;&rsqb;&rsqb;><&sol;script><&excl;– End Google Tag Manager –><&excl;– Google Tag Manager &lpar;noscript&rpar; –><noscript><&excl;– <iframe&NewLine; src&equals;»https&colon;&sol;&sol;www&period;googletagmanager&period;com&sol;ns&period;html&quest;id&equals;GTM-MFGM96D7″&NewLine; height&equals;»0″&NewLine; width&equals;»0″&NewLine; style&equals;»display&colon;none&semi;visibility&colon;hidden»><&sol;iframe> –><&sol;noscript><&excl;– End Google Tag Manager &lpar;noscript&rpar; –><&excl;– End User Code –><link rel&equals;»preload» href&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9&period;eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8zMzAyMTkwOS9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTY3Njk2OTY2Mn0&period;Zvn26EqsfixGMQPCZnuayrrW9mG&lowbar;7kGjNuXRc3mRrBk&sol;image&period;png&quest;width&equals;284&amp&semi;height&equals;102″ as&equals;»image»&sol;><&excl;—–post——-><link href&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;news&sol;derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home» hreflang&equals;»en» rel&equals;»alternate»&sol;><link href&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;news&sol;derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home» hreflang&equals;»x-default» rel&equals;»alternate»&sol;><&excl;————><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4384″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»3771-fix»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4108″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»13″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4198″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»3877″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»3569″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»2456″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4591-old»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4182″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»4645-old»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»9″&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»dp» data-abtest-value&equals;»telegraph»&sol;><script type&equals;»application&sol;json» data-abtest-name&equals;»short» data-abtest-value&equals;»trend»&sol;><script class&equals;»rm-i-script»><&excl;&lbrack;CDATA&lbrack;&NewLine; &NewLine; &lpar;function&lpar;&rpar; &lbrace;&NewLine; var cookie &equals; ‘rebelmouse&lowbar;abtests&equals;’&semi;&NewLine; cookie &plus;&equals; ‘&semi; Max-Age&equals;0’&semi;&NewLine; document&period;cookie &equals; cookie &plus; ‘&semi; Path&equals;&sol;&semi; SameSite&equals;None&semi; Secure’&semi;&NewLine;&rcub;&rpar;&lpar;&rpar;&semi;&NewLine; &NewLine; &rsqb;&rsqb;><&sol;script><&excl;–&lbrack;if IE&rsqb;>&NewLine; <script type&equals;»text&sol;javascript» src&equals;»&sol;static&sol;js-build&sol;libs&sol;html5shiv&sol;html5shiv&period;js»><&sol;script>&NewLine; <&excl;&lbrack;endif&rsqb;–><&sol;head><body class&equals;»logged-out-user section-news» id&equals;»WPAuto&lowbar;Base&lowbar;ReadabilityBody»><p&sol;><p&sol;><p&sol;><div class&equals;»all-content-wrapper»><div class&equals;»main v-sep»><script><&excl;&lbrack;CDATA&lbrack;&NewLine;&NewLine; &sol;&sol; GBN Wrapper&NewLine; const loadAds &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine;&NewLine; &sol;&sol; Teal&NewLine; const jBids &equals; document&period;createElement&lpar;’script’&rpar;&semi;&NewLine; jBids&period;src &equals; ‘https&colon;&sol;&sol;j&period;bids&period;ws&sol;gbnews&sol;gam’&semi;&NewLine; jBids&period;async &equals; true&semi;&NewLine; document&period;head&period;appendChild&lpar;jBids&rpar;&semi;&NewLine; &NewLine; &sol;&sol; console&period;log&lpar;’Consent is ready&comma; loading Teal&period;&period;&period;’&rpar;&semi;&NewLine;&NewLine; &rcub;&NewLine; const loadGTM &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol;GTM Primary&NewLine; &sol;&sol; console&period;log&lpar;’Consent is ready&comma; loading GTM Primary&period;&period;&period;’&rpar;&semi;&NewLine; &lpar;function &lpar;w&comma; d&comma; s&comma; l&comma; i&rpar; &lbrace;&NewLine; w&lbrack;l&rsqb; &equals; w&lbrack;l&rsqb; &vert;&vert; &lbrack;&rsqb;&semi; w&lbrack;l&rsqb;&period;push&lpar;&lbrace;&NewLine; ‘gtm&period;start’&colon;&NewLine; new Date&lpar;&rpar;&period;getTime&lpar;&rpar;&comma; event&colon; ‘gtm&period;js’&NewLine; &rcub;&rpar;&semi; var f &equals; d&period;getElementsByTagName&lpar;s&rpar;&lbrack;0&rsqb;&comma;&NewLine; j &equals; d&period;createElement&lpar;s&rpar;&comma; dl &equals; l &excl;&equals; ‘dataLayer’ &quest; ‘&l&equals;’ &plus; l &colon; »&semi; j&period;async &equals; true&semi; j&period;src &equals;&NewLine; ‘https&colon;&sol;&sol;www&period;googletagmanager&period;com&sol;gtm&period;js&quest;id&equals;’ &plus; i &plus; dl&semi; f&period;parentNode&period;insertBefore&lpar;j&comma; f&rpar;&semi;&NewLine; &rcub;&rpar;&lpar;window&comma; document&comma; ‘script’&comma; ‘dataLayer’&comma; ‘GTM-MFGM96D7’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; console&period;log&lpar;’Consent is ready&comma; injecting GTM Primary iframe’&rpar;&semi;&NewLine;&NewLine; const iframe &equals; document&period;createElement&lpar;’iframe’&rpar;&semi;&NewLine; iframe&period;src &equals; «https&colon;&sol;&sol;www&period;googletagmanager&period;com&sol;ns&period;html&quest;id&equals;GTM-MFGM96D7″&semi;&NewLine; iframe&period;height &equals; «0»&semi;&NewLine; iframe&period;width &equals; «0»&semi;&NewLine; iframe&period;style&period;display &equals; «none»&semi;&NewLine; iframe&period;style&period;visibility &equals; «hidden»&semi;&NewLine; document&period;body&period;appendChild&lpar;iframe&rpar;&semi;&NewLine;&NewLine; &sol;&sol;GTM Secondary&NewLine; &sol;&sol; console&period;log&lpar;’Consent is ready&comma; loading GTM Secondary&period;&period;&period;’&rpar;&semi;&NewLine; &lpar;function &lpar;w&comma; d&comma; s&comma; l&comma; i&rpar; &lbrace;&NewLine; w&lbrack;l&rsqb; &equals; w&lbrack;l&rsqb; &vert;&vert; &lbrack;&rsqb;&semi; w&lbrack;l&rsqb;&period;push&lpar;&lbrace;&NewLine; ‘gtm&period;start’&colon;&NewLine; new Date&lpar;&rpar;&period;getTime&lpar;&rpar;&comma; event&colon; ‘gtm&period;js’&NewLine; &rcub;&rpar;&semi; var f &equals; d&period;getElementsByTagName&lpar;s&rpar;&lbrack;0&rsqb;&comma;&NewLine; j &equals; d&period;createElement&lpar;s&rpar;&comma; dl &equals; l &excl;&equals; ‘dataLayer’ &quest; ‘&l&equals;’ &plus; l &colon; »&semi; j&period;async &equals; true&semi; j&period;src &equals;&NewLine; ‘https&colon;&sol;&sol;www&period;googletagmanager&period;com&sol;gtm&period;js&quest;id&equals;’ &plus; i &plus; dl&semi; f&period;parentNode&period;insertBefore&lpar;j&comma; f&rpar;&semi;&NewLine; &rcub;&rpar;&lpar;window&comma; document&comma; ‘script’&comma; ‘dataLayer’&comma; ‘GTM-PCG4W7Z’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; console&period;log&lpar;’Consent is ready&comma; injecting GTM secondary iframe’&rpar;&semi;&NewLine;&NewLine; const iframeSec &equals; document&period;createElement&lpar;’iframe’&rpar;&semi;&NewLine; iframeSec&period;src &equals; «https&colon;&sol;&sol;www&period;googletagmanager&period;com&sol;ns&period;html&quest;id&equals;GTM-PCG4W7Z»&semi;&NewLine; iframeSec&period;height &equals; «0»&semi;&NewLine; iframeSec&period;width &equals; «0»&semi;&NewLine; iframeSec&period;style&period;display &equals; «none»&semi;&NewLine; iframeSec&period;style&period;visibility &equals; «hidden»&semi;&NewLine; document&period;body&period;appendChild&lpar;iframeSec&rpar;&semi;&NewLine; &rcub;&NewLine; const loadCxense &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; CXENSE&NewLine; &sol;&sol; console&period;log&lpar;’Consent is ready&comma; loading Cxense&period;&period;&period;’&rpar;&semi;&NewLine; var cX &equals; cX &vert;&vert; &lbrace;&rcub;&semi; cX&period;callQueue &equals; cX&period;callQueue &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; cX&period;callQueue&period;push&lpar;&lbrack;’invoke’&comma; function&lpar;&rpar; &lbrace;&NewLine; cX&period;getUserSegmentIds&lpar;&lbrace;persistedQueryId&colon;’66b7f784a39745589e36e7fbc9d213f800d309f3’&comma; callback&colon; function&lpar;response&rpar; &lbrace;&NewLine; window&period;cXsegmentIds &equals; response&semi;&NewLine; &rcub;&rcub;&rpar;&semi;&NewLine; &rcub;&rsqb;&rpar;&semi;&NewLine;&NewLine; &lpar;function&lpar;d&comma;s&comma;e&comma;t&rpar;&lbrace;e&equals;d&period;createElement&lpar;s&rpar;&semi;e&period;type&equals;’text&sol;java’&plus;s&semi;e&period;async&equals;’async’&semi;&NewLine; e&period;src&equals;’http’&plus;&lpar;’https&colon;’&equals;&equals;&equals;location&period;protocol&quest;’s&colon;&sol;&sol;s’&colon;’&colon;&sol;&sol;’&rpar;&plus;’cdn&period;cxense&period;com&sol;cx&period;js’&semi;&NewLine; t&equals;d&period;getElementsByTagName&lpar;s&rpar;&lbrack;0&rsqb;&semi;t&period;parentNode&period;insertBefore&lpar;e&comma;t&rpar;&semi;&rcub;&rpar;&lpar;document&comma;’script’&rpar;&semi;&NewLine; tp&period;push&lpar;&lbrack;»setCxenseSiteId»&comma; «5858448894304938394»&rsqb;&rpar;&semi;&NewLine; &rcub;&NewLine; const loadWunderkind &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; &NewLine; let accessStatusFromWindowObj14 &equals; window&period;userStatus&semi;&NewLine; if &lpar;accessStatusFromWindowObj14 &excl;&equals; ‘member’&rpar; &lbrace;&NewLine; console&period;log&lpar;»user is not a member»&rpar;&semi;&NewLine; &lpar;function&lpar;d&rpar; &lbrace; var e &equals; d&period;createElement&lpar;’script’&rpar;&semi; e&period;src &equals; d&period;location&period;protocol &plus; ‘&sol;&sol;tag&period;wknd&period;ai&sol;7129&sol;i&period;js’&semi; e&period;async &equals; true&semi; d&period;getElementsByTagName&lpar;»head»&rpar;&lbrack;0&rsqb;&period;appendChild&lpar;e&rpar;&semi; &rcub;&lpar;document&rpar;&rpar;&semi;&NewLine; console&period;log&lpar;»wunderkind loaded»&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;log&lpar;»user is a member&comma; don’t load wunderkind»&rpar;&NewLine; &rcub;&NewLine; &NewLine; &rcub;&NewLine; const loadTaboola &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; A &ast;global&ast; property for queuing &ast;all&ast; Taboola commands on this page&colon;&NewLine; window&period;&lowbar;taboola &equals; window&period;&lowbar;taboola &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine; &sol;&sol; Fill in the page type&comma; as provided by Taboola&colon;&NewLine; &lowbar;taboola&period;push&lpar;&lbrace; article&colon; ‘auto’ &rcub;&rpar;&semi;&NewLine;&NewLine; &excl;&lpar;function &lpar;e&comma; f&comma; u&comma; i&rpar; &lbrace;&NewLine; if &lpar;&excl;document&period;getElementById&lpar;i&rpar;&rpar; &lbrace;&NewLine; e&period;async &equals; 1&semi;&NewLine; e&period;src &equals; u&semi;&NewLine; e&period;id &equals; i&semi;&NewLine; f&period;parentNode&period;insertBefore&lpar;e&comma; f&rpar;&semi;&NewLine; &rcub;&NewLine; &sol;&sol; Fill in your Publisher ID &lpar;an alphabetic string&comma; as provided by Taboola&rpar;&colon;&NewLine; &rcub;&rpar;&lpar;&NewLine; document&period;createElement&lpar;’script’&rpar;&comma;&NewLine; document&period;getElementsByTagName&lpar;’script’&rpar;&lbrack;0&rsqb;&comma;&NewLine; ‘&sol;&sol;cdn&period;taboola&period;com&sol;libtrc&sol;gbnews-website&sol;loader&period;js’&comma;&NewLine; ‘tb&lowbar;loader&lowbar;script’&comma;&NewLine; &rpar;&semi;&NewLine;&NewLine; if &lpar;window&period;performance && typeof window&period;performance&period;mark &equals;&equals; ‘function’&rpar; &lbrace;&NewLine; window&period;performance&period;mark&lpar;’tbl&lowbar;ic’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&semi;&NewLine;&NewLine; const loadLiveramp &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; console&period;log&lpar;»loadLiveramp function has been called»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Create preload link&NewLine; const preload &equals; document&period;createElement&lpar;»link»&rpar;&semi;&NewLine; preload&period;rel &equals; «preload»&semi;&NewLine; preload&period;href &equals; «https&colon;&sol;&sol;launchpad&period;privacymanager&period;io&sol;latest&sol;launchpad&period;bundle&period;js»&semi;&NewLine; preload&period;as &equals; «script»&semi;&NewLine; document&period;head&period;appendChild&lpar;preload&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Create script tag&NewLine; const script &equals; document&period;createElement&lpar;»script»&rpar;&semi;&NewLine; script&period;src &equals; «https&colon;&sol;&sol;launchpad-wrapper&period;privacymanager&period;io&sol;d2917174-06d1-4538-afd7-ffac883147d8&sol;launchpad-liveramp&period;js»&semi;&NewLine; script&period;async &equals; true&semi;&NewLine; script&period;defer &equals; true&semi;&NewLine;&NewLine; document&period;head&period;appendChild&lpar;script&rpar;&semi;&NewLine; &rcub;&semi;&NewLine;&NewLine; const requestPushwooshNotificationPopup &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; var Pushwoosh &equals; window&period;Pushwoosh &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine; function requestNotificationPermission&lpar;&rpar; &lbrace;&NewLine; Pushwoosh&period;push&lpar;&lbrack;’init’&comma; &lbrace;&NewLine; serviceWorkerUrl&colon; ‘https&colon;&sol;&sol;www&period;gbnews&period;com&sol;sw&period;js’&comma;&NewLine; logLevel&colon; ‘error’&comma;&NewLine; applicationCode&colon; ‘AB023-DEB30’&comma;&NewLine; safariWebsitePushID&colon; ‘web&period;com&period;gbnews’&comma;&NewLine; defaultNotificationTitle&colon; ‘GB News’&comma;&NewLine; defaultNotificationImage&colon; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;34215656&sol;origin&period;jpg’&comma;&NewLine; autoSubscribe&colon; false&comma;&NewLine; subscribeWidget&colon; &lbrace;&NewLine; enable&colon; false&comma;&NewLine; &rcub;&comma;&NewLine; subscribePopup&colon; &lbrace;&NewLine; enable&colon; true&comma;&NewLine; text&colon; ‘<b>GB News<p>Get free breaking news alerts&quest;’&comma;&NewLine; askLaterButtonText&colon; ‘Maybe later’&comma;&NewLine; confirmSubscriptionButtonText&colon; ‘Sign up now&excl;’&comma;&NewLine; iconUrl&colon; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;34215656&sol;origin&period;jpg’&comma;&NewLine; delay&colon; 2&comma;&NewLine; retryOffset&colon; 604800&comma;&NewLine; overlay&colon; true&comma;&NewLine; position&colon; ‘top’&comma;&NewLine; bgColor&colon; ‘&num;fff’&comma;&NewLine; borderColor&colon; ‘&num;0032aa’&comma;&NewLine; boxShadow&colon; ‘0 3px 6px rgba&lpar;0&comma;0&comma;0&comma;0&period;16&rpar;’&comma;&NewLine; textColor&colon; ‘&num;0032AA’&comma;&NewLine; textSize&colon; ‘inherit’&comma;&NewLine; fontFamily&colon; ‘inherit’&comma;&NewLine; subscribeBtnBgColor&colon; ‘&num;0032aa’&comma;&NewLine; subscribeBtnTextColor&colon; ‘&num;fff’&comma;&NewLine; askLaterBtnBgColor&colon; ‘&num;fff’&comma;&NewLine; askLaterBtnTextColor&colon; ‘&num;0032aa’&comma;&NewLine; theme&colon; ‘material’&comma;&NewLine; iconAlt&colon; «gbn image»&comma;&NewLine; &rcub;&comma;&NewLine; userId&colon; ‘user&lowbar;id’&comma;&NewLine; tags&colon; &lbrace;&NewLine; ‘Name’&colon; ‘John Smith’&NewLine; &rcub;&NewLine; &rcub;&rsqb;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Analytics&NewLine; Pushwoosh&period;push&lpar;function&lpar;api&rpar; &lbrace;&NewLine; api&period;setTags&lpar;&lbrace;&NewLine; ‘Piano Visitor ID’&colon; pa&period;getVisitorId&lpar;&rpar;&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; requestNotificationPermission&lpar;&rpar;&semi;&NewLine; &rcub;&semi;&NewLine;&NewLine;&NewLine; &NewLine; window&period;runWhenConsentIsReady&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine;&NewLine; &lowbar;&lowbar;tcfapi&lpar;’getTCData’&comma; 2&comma; function &lpar;tcData&comma; success&rpar; &lbrace;&NewLine; if &lpar;success&rpar; &lbrace;&NewLine; if &lpar;window&period;location&period;href&period;includes&lpar;»&sol;app-term-«&rpar;&rpar; &lbrace;&NewLine; return&semi;&NewLine; &rcub;&NewLine; &NewLine; const notNeeded &equals; tcData&period;gdprApplies &equals;&equals;&equals; false&semi;&NewLine; const hasConsentData &equals; tcData&quest;&period;purpose&quest;&period;consents && Object&period;keys&lpar;tcData&period;purpose&period;consents&rpar;&period;length > 0&semi;&NewLine; const hasAcceptedConsents &equals; hasConsentData && Object&period;values&lpar;tcData&period;purpose&period;consents&rpar;&period;some&lpar;consent &equals;> consent &equals;&equals;&equals; true&rpar;&semi;&NewLine;&NewLine;&NewLine; if &lpar;notNeeded &vert;&vert; hasAcceptedConsents&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;»Consent not required OR user accepted some consents – loading scripts»&rpar;&semi;&NewLine; &NewLine; loadAds&lpar;&rpar;&semi;&NewLine;&NewLine; loadGTM&lpar;&rpar;&semi;&NewLine;&NewLine; loadWunderkind&lpar;&rpar;&semi;&NewLine;&NewLine; loadCxense&lpar;&rpar;&semi;&NewLine;&NewLine; loadTaboola&lpar;&rpar;&semi;&NewLine;&NewLine; loadLiveramp&lpar;&rpar;&semi;&NewLine;&NewLine; requestPushwooshNotificationPopup&lpar;&rpar;&semi;&NewLine; &NewLine;&NewLine; &rcub; else if &lpar;hasConsentData && &excl;hasAcceptedConsents&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;»User has rejected all consents – NOT loading tracking scripts»&rpar;&semi;&NewLine; &rcub; else if &lpar;hasAcceptedConsents&rpar; &lbrace;&NewLine; &NewLine; loadAds&lpar;&rpar;&semi;&NewLine; loadGTM&lpar;&rpar;&semi;&NewLine; loadWunderkind&lpar;&rpar;&semi;&NewLine; loadCxense&lpar;&rpar;&semi;&NewLine; loadTaboola&lpar;&rpar;&semi;&NewLine; loadLiveramp&lpar;&rpar;&semi;&NewLine; requestPushwooshNotificationPopup&lpar;&rpar;&semi;&NewLine; &NewLine; &rcub; else if &lpar;notNeeded&rpar; &lbrace;&NewLine; loadAds&lpar;&rpar;&semi;&NewLine; loadTaboola&lpar;&rpar;&semi;&NewLine; loadGTM&lpar;&rpar;&semi;&NewLine; loadLiveramp&lpar;&rpar;&semi;&NewLine; requestPushwooshNotificationPopup&lpar;&rpar;&semi;&NewLine; setTimeout&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; &NewLine; loadWunderkind&lpar;&rpar;&semi;&NewLine; loadCxense&lpar;&rpar;&semi;&NewLine; &rcub;&comma; 2000&rpar;&NewLine;&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;»No consent data available yet – waiting for user interaction»&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’Failed to get TC data’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;&rsqb;&rsqb;><&sol;script><&excl;– User Code –><p&sol;><&excl;– End User Code –><script><&excl;&lbrack;CDATA&lbrack;&NewLine; &NewLine;&NewLine;&NewLine; window&period;addEventListener&lpar;’primisPlayerInit’&comma; function &lpar;e&rpar; &lbrace;&NewLine; console&period;log&lpar;»event»&comma; e&rpar;&NewLine; &NewLine; window&period;article&lowbar;id &equals; «2676762030»&NewLine; if &lpar;e&period;detail&period;playerApiId &equals;&equals; «GB&lowbar;News&lowbar;Primis»&rpar;&NewLine; &lbrace;&NewLine; window&period;primisPlayer &equals; e&period;detail&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’videoStart’&comma; function &lpar;val&rpar;&lbrace;&NewLine; window&period;video&lowbar;title &equals; val&period;title &vert;&vert; «Unknown Video»&semi;&NewLine; window&period;video&lowbar;duration &equals; val&period;duration &vert;&vert; 0&semi;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «videoStart»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’videoEnd’&comma; function &lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «videoEnd»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; &NewLine; primisPlayer&period;addEventListener&lpar;’videoSkip’&comma; function&lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «videoSkip»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; primisPlayer&period;addEventListener&lpar;’videoClickthrough’&comma; function&lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «videoClickthrough»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; primisPlayer&period;addEventListener&lpar;’videoPause’&comma; function&lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «videoPause»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’videoAutoSkipped’&comma; function&lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «videoAutoSkipped»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’videoClickSeekForward’&comma; function&lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «videoClickSeekForward»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’videoClickSeekBack’&comma; function&lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «videoClickSeekBack»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; ads&NewLine; primisPlayer&period;addEventListener&lpar;’adStarted’&comma; function &lpar;val&rpar;&lbrace;&NewLine; window&period;ad&lowbar;details &equals; val&semi;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «videoAdStarted»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; «ad&lowbar;details»&colon; ad&lowbar;details&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’adCompleted’&comma; function &lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «adCompleted»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; «ad&lowbar;details»&colon; ad&lowbar;details&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’adFirstQuartile’&comma; function &lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «adFirstQuartile»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; «ad&lowbar;details»&colon; ad&lowbar;details&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’adMidQuartile’&comma; function &lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «adMidQuartile»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; «ad&lowbar;details»&colon; ad&lowbar;details&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’adThirdQuartile’&comma; function &lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «adThirdQuartile»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; «ad&lowbar;details»&colon; ad&lowbar;details&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’adClickthrough’&comma; function &lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «adClickthrough»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; «ad&lowbar;details»&colon; ad&lowbar;details&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’adPause’&comma; function &lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «adPause»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; «ad&lowbar;details»&colon; ad&lowbar;details&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’adPlay’&comma; function &lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «adPlay»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; «ad&lowbar;details»&colon; ad&lowbar;details&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; primisPlayer&period;addEventListener&lpar;’adSkip’&comma; function &lpar;&rpar;&lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; «event»&colon; «primis&lowbar;player»&comma;&NewLine; «data»&colon; &lbrace;&NewLine; «event»&colon; «adSkip»&comma;&NewLine; «article&lowbar;id»&colon; article&lowbar;id&comma;&NewLine; «video&lowbar;title»&colon; video&lowbar;title&comma;&NewLine; «video&lowbar;duration»&colon; video&lowbar;duration&comma;&NewLine; «ad&lowbar;details»&colon; ad&lowbar;details&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &rcub;&NewLine; &NewLine; &rcub;&rpar;&semi;&NewLine;&rsqb;&rsqb;><&sol;script><span class&equals;»viewport-css-anchor»&sol;><&excl;– User Code –><p&sol;><&excl;– End User Code –><script><&excl;&lbrack;CDATA&lbrack;&NewLine; &NewLine; let accessStatusFromWindowObj11 &equals; window&period;userStatus&semi;&NewLine; &NewLine;&NewLine; if &lpar;accessStatusFromWindowObj11 &excl;&equals;&equals; ‘member’&rpar; &lbrace;&NewLine; const adSlotHtmlSkyLeft &equals; &grave;<div class&equals;»sticky-wrapper»><div class&equals;»stiky&lowbar;sky left»><ad-slot position&equals;»sky&lowbar;left&lowbar;top» no-watermark justify&equals;»right»>&rsqb;&rsqb;><&sol;script><&sol;div><&sol;div>&grave;&semi;&NewLine; const adSlotHtmlSkyRight &equals; &grave;<div class&equals;»sticky-wrapper»><div class&equals;»stiky&lowbar;sky right»><ad-slot position&equals;»sky&lowbar;right&lowbar;top» no-watermark&equals;»» justify&equals;»left»&sol;><&sol;div><&sol;div>&grave;&semi;&NewLine; const targetParentSky &equals; document&period;querySelector&lpar;’&period;sky–ad&lowbar;&lowbar;container’&rpar;&semi;&NewLine; if &lpar;targetParentSky&rpar; &lbrace;&NewLine; targetParentSky&period;insertAdjacentHTML&lpar;’beforeend’&comma; adSlotHtmlSkyLeft&rpar;&semi;&NewLine; targetParentSky&period;insertAdjacentHTML&lpar;’beforeend’&comma; adSlotHtmlSkyRight&rpar;&semi;&NewLine; &NewLine; &rcub;&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;»Inder 3 – skys not showing because user is member»&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; <div class&equals;»sticky-banner-wrapper» id&equals;»sTop&lowbar;Bar&lowbar;0&lowbar;0&lowbar;26&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;19&lowbar;1&lowbar;3″><script><&excl;&lbrack;CDATA&lbrack;&NewLine;&NewLine; &NewLine;&NewLine; &sol;&sol; &NewLine; if &lpar;window&period;userStatus &equals;&equals;&equals; ‘member’&rpar; &lbrace;&NewLine; const style &equals; document&period;createElement&lpar;’style’&rpar;&semi;&NewLine; style&period;textContent &equals; &grave;&NewLine; &period;sticky-banner-wrapper &lbrace;&NewLine; min-height&colon; 0&semi;&NewLine; display&colon; none&semi;&NewLine; &rcub;&NewLine; &period;sticky-banner-wrapper&colon;&colon;before &lbrace; display&colon; none&semi; &rcub;&NewLine; &grave;&semi;&NewLine; document&period;head&period;appendChild&lpar;style&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; document&period;addEventListener&lpar;’DOMContentLoaded’&comma; function&lpar;&rpar; &lbrace;&NewLine; const targetParentBillboard &equals; document&period;querySelector&lpar;’&period;sticky-banner-wrapper’&rpar;&semi;&NewLine; if &lpar;targetParentBillboard&rpar; &lbrace;&NewLine; const adBillboard &equals; &grave;<div class&equals;»ad–billboard»><ad-slot position&equals;»billboard» align&equals;»center»>&rsqb;&rsqb;><&sol;script><&sol;div>&grave;&semi;&NewLine; targetParentBillboard&period;insertAdjacentHTML&lpar;’beforeend’&comma; adBillboard&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &NewLine;&NewLine;<p&sol;><div class&equals;»topbar» id&equals;»sElement&lowbar;Topbar&lowbar;HTML&lowbar;0&lowbar;0&lowbar;8&lowbar;0&lowbar;0&lowbar;2&lowbar;1&lowbar;0″><div class&equals;»site-logo» id&equals;»sElement&lowbar;Topbar&lowbar;HTML&lowbar;0&lowbar;0&lowbar;8&lowbar;0&lowbar;0&lowbar;2&lowbar;1&lowbar;0&lowbar;0″><a href&equals;»&sol;&quest;ico&equals;header&lowbar;logo&lowbar;button»><img src&equals;»https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61228189&sol;origin&period;png» title&equals;»GBN Britain’s News Channel» alt&equals;»logo»&sol;><&sol;a><&sol;div><div class&equals;»topbar–right» id&equals;»sElement&lowbar;Topbar&lowbar;HTML&lowbar;0&lowbar;0&lowbar;8&lowbar;0&lowbar;0&lowbar;2&lowbar;1&lowbar;0&lowbar;1″><&excl;– User Code –><link rel&equals;»preconnect» href&equals;»https&colon;&sol;&sol;fonts&period;googleapis&period;com»&sol;><link rel&equals;»preconnect» href&equals;»https&colon;&sol;&sol;fonts&period;gstatic&period;com» crossorigin&equals;»crossorigin»&sol;><link href&equals;»https&colon;&sol;&sol;fonts&period;googleapis&period;com&sol;css2&quest;family&equals;Montserrat&colon;wght&commat;100&semi;200&semi;300&semi;400&semi;500&semi;600&semi;700&semi;800&semi;900&amp&semi;display&equals;swap» rel&equals;»stylesheet»&sol;><a id&equals;»support» class&equals;»subscribe-link» href&equals;»&sol;support&quest;ico&equals;header&lowbar;support&lowbar;button»>Support<&sol;a><&excl;– End User Code –><div class&equals;»login-link-wrapper» aria-label&equals;»login-link-wrapper» id&equals;»sElement&lowbar;Topbar&lowbar;HTML&lowbar;0&lowbar;0&lowbar;8&lowbar;0&lowbar;0&lowbar;2&lowbar;1&lowbar;0&lowbar;1&lowbar;2″><&excl;– User Code –><div class&equals;»loyalty-wrapper»><a class&equals;»loyalty-button» aria-label&equals;»points» href&equals;»&num;» id&equals;»loyalty-button»&sol;><&sol;div><&excl;– End User Code –><&excl;– User Code –><a class&equals;»piano-login-link disabled» aria-label&equals;»My Account» href&equals;»&sol;my-account» id&equals;»login-link-text»>Login<&sol;a><&excl;– End User Code –><&excl;– User Code –><a class&equals;»login-link piano-login-link» aria-label&equals;»My Account» href&equals;»&sol;my-account» id&equals;»accountToggleLink»&sol;><&excl;– Menu dropdown –><p&sol;><&excl;– End User Code –><&sol;div><&sol;div><&sol;div><div class&equals;»navbar» id&equals;»sElement&lowbar;Topbar&lowbar;HTML&lowbar;0&lowbar;0&lowbar;8&lowbar;0&lowbar;0&lowbar;3″><div class&equals;»nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0″><&excl;– User Code –><div class&equals;»sticky-left sticky-left-click»><p&sol;><a class&equals;»nav–item live–channel&lowbar;&lowbar;active watch-live-button live-cta&lowbar;&lowbar;button» href&equals;»&sol;watch&sol;live&quest;ico&equals;header&lowbar;live&lowbar;button» title&equals;»Watch Live Now»><img class&equals;»watch-live-icon» src&equals;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;media-library&sol;logo&period;png&quest;id&equals;61109318″ alt&equals;»live-player-icon»&sol;><&sol;a><p&sol;><&sol;div><&excl;– End User Code –><&excl;– User Code –><&excl;– <a&NewLine; class&equals;»nav–item home–channel&lowbar;&lowbar;active watch-live-button live-cta&lowbar;&lowbar;button»&NewLine; href&equals;»&sol;watch&sol;live&quest;ico&equals;header&lowbar;live&lowbar;button»&NewLine; title&equals;»Watch Live Now»>&NewLine; <img class&equals;»watch-live-icon» src&equals;»https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61079499&sol;origin&period;png» alt&equals;»live-player-icon» &sol;>&NewLine;<&sol;a> –><&excl;– End User Code –><div class&equals;»nav–item home–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;7″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;7&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;» target&equals;»» aria-label&equals;»Home»>Home<&sol;a><&sol;div><div class&equals;»secondary–nav regular–secondary&lowbar;&lowbar;nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;7&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;7&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»https&colon;&sol;&sol;gbnews&period;shop&sol;» target&equals;»&lowbar;blank» rel&equals;»Shop» aria-label&equals;»Shop»>GBN Shop<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;watch&sol;live&num;comments» target&equals;»&lowbar;self» rel&equals;»YourSay» aria-label&equals;»YourSay»>YourSay<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;youdecide» target&equals;»&lowbar;self» rel&equals;»YouDecide» aria-label&equals;»YouDecide»>YouDecide<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;support» target&equals;»&lowbar;self» rel&equals;»Support Us» aria-label&equals;»Support Us»>Support Us<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;alerts» target&equals;»&lowbar;self» rel&equals;»News Alerts» aria-label&equals;»News Alerts»>News Alerts<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;latest» target&equals;»&lowbar;self» aria-label&equals;»Latest»>Latest<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;puzzles&sol;» target&equals;»&lowbar;self» aria-label&equals;»Puzzles»>Puzzles<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;terms&sol;competition-terms&sol;» target&equals;»&lowbar;self» aria-label&equals;»Win»>Win<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;shows&sol;gb-news-live-show-join-our-live-studio-audience» target&equals;»&lowbar;self» aria-label&equals;»Tickets»>Tickets<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item news–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;8″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;8&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;news&sol;» target&equals;»» aria-label&equals;»News»>News<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;8&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;8&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;uk&sol;» target&equals;»&lowbar;self» aria-label&equals;»UK News»>UK News<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;us&sol;» target&equals;»&lowbar;self» aria-label&equals;»US News»>US News<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;world&sol;» target&equals;»&lowbar;self» aria-label&equals;»World News»>World News<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;weather&sol;» target&equals;»&lowbar;self» aria-label&equals;»Weather»>Weather<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;migrant-crisis&sol;» target&equals;»&lowbar;self» aria-label&equals;»Migrant Crisis»>Migrant Crisis<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;cancel-culture&sol;» target&equals;»&lowbar;self» aria-label&equals;»Migrant Crisis»>Cancel Culture<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;best-of-britain&sol;» target&equals;»&lowbar;self» aria-label&equals;»best-of-britain»>Best of Britain<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;crime&sol;» target&equals;»&lowbar;self» aria-label&equals;»Crime»>Crime<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;science&sol;» target&equals;»&lowbar;self» aria-label&equals;»Science»>Science<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item politics–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;9″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;9&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;politics&sol;» target&equals;»» aria-label&equals;»Politics»>Politics<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;9&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;9&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;uk&sol;» target&equals;»&lowbar;self» aria-label&equals;»UK Politics»>UK Politics<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;uk&sol;kemi-badenoch&sol;» target&equals;»&lowbar;self» aria-label&equals;»Kemi Badenoch»>Kemi Badenoch<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;uk&sol;keir-starmer&sol;» target&equals;»&lowbar;self» aria-label&equals;»Keir Starmer»>Keir Starmer<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;uk&sol;conservative-party&sol;» target&equals;»&lowbar;self» aria-label&equals;»Conservatives»>Conservatives<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;uk&sol;labour-party&sol;» target&equals;»&lowbar;self» aria-label&equals;»Labour»>Labour<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;uk&sol;snp&sol;» target&equals;»&lowbar;self» aria-label&equals;»SNP»>SNP<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;uk&sol;reform-uk&sol;» target&equals;»&lowbar;self» aria-label&equals;»Reform UK»>Reform UK<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;uk&sol;liberal-democrats&sol;» target&equals;»&lowbar;self» aria-label&equals;»Lib Dems»>Lib Dems<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;us&sol;» target&equals;»&lowbar;self» aria-label&equals;»US Politics»>US Politics<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item opinion–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;10″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;10&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;opinion&sol;» target&equals;»» aria-label&equals;»Opinion»>Opinion<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;10&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;10&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;nigel-farage&sol;&quest;opinion» target&equals;»&lowbar;self» aria-label&equals;»Nigel Farage»>Nigel Farage<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;jacob-rees-mogg&sol;&quest;opinion» target&equals;»&lowbar;self» aria-label&equals;»Jacob Rees-Mogg»>Jacob Rees-Mogg<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;patrick-christys&sol;&quest;opinion» target&equals;»&lowbar;self» aria-label&equals;»Patrick Christys»>Patrick Christys<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;beverley-turner&sol;&quest;opinion» target&equals;»&lowbar;self» aria-label&equals;»Bev Turner»>Bev Turner<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;michelle-dewberry&sol;&quest;opinion» target&equals;»&lowbar;self» aria-label&equals;»Michelle Dewberry»>Michelle Dewberry<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;neil-oliver&sol;&quest;opinion» target&equals;»&lowbar;self» aria-label&equals;»Neil Oliver»>Neil Oliver<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;nana-akua&sol;&quest;opinion» target&equals;»&lowbar;self» aria-label&equals;»Nana Akua»>Nana Akua<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;stephen-dixon&sol;&quest;opinion» target&equals;»&lowbar;self» aria-label&equals;»Stephen Dixon»>Stephen Dixon<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;tom-harwood&sol;&quest;opinion» target&equals;»&lowbar;self» aria-label&equals;»Tom Harwood»>Tom Harwood<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item membership–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;11″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;11&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;membership&sol;» target&equals;»» aria-label&equals;»Membership»>Membership<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;11&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;11&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;watch&sol;originals&sol;» target&equals;»&lowbar;self» aria-label&equals;»GB News Uncut»>Originals<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;membership&sol;polls&sol;» target&equals;»&lowbar;self» aria-label&equals;»Polls»>Polls<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;puzzles&sol;» target&equals;»&lowbar;self» aria-label&equals;»Puzzles»>Puzzles<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;membership&sol;rewards&sol;» target&equals;»&lowbar;self» aria-label&equals;»Rewards»>Rewards<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;membership&sol;events&sol;» target&equals;»&lowbar;self» aria-label&equals;»Events»>Events<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;membership&sol;guides&sol;» target&equals;»&lowbar;self» aria-label&equals;»Guides»>Guides<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item advent–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;12″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;12&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;reflections» target&equals;»» aria-label&equals;»reflections»>Reflections<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;12&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;12&lowbar;1&lowbar;0&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»https&colon;&sol;&sol;gbnews&period;shop&sol;» target&equals;»&lowbar;blank» rel&equals;»Shop» aria-label&equals;»Shop»>GBN Shop<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;watch&sol;live&num;comments» target&equals;»&lowbar;self» rel&equals;»Your Say» aria-label&equals;»Your Say»>Your Say<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;support» target&equals;»&lowbar;self» rel&equals;»Support Us» aria-label&equals;»Support Us»>Support Us<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;alerts» target&equals;»&lowbar;self» rel&equals;»News Alerts» aria-label&equals;»News Alerts»>News Alerts<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;latest» target&equals;»&lowbar;self» aria-label&equals;»Latest»>Latest<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;puzzles&sol;» target&equals;»&lowbar;self» aria-label&equals;»Puzzles»>Puzzles<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;terms&sol;competition-terms&sol;» target&equals;»&lowbar;self» aria-label&equals;»Win»>Win<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item royal–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;13″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;13&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;royal&sol;» target&equals;»» aria-label&equals;»Royal»>Royal<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;13&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;13&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;royal&sol;king-charles&sol;» target&equals;»&lowbar;self» aria-label&equals;»King Charles»>King Charles<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;royal&sol;meghan-markle&sol;» target&equals;»&lowbar;self» aria-label&equals;»Meghan Markle»>Meghan Markle<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;royal&sol;prince-harry&sol;» target&equals;»&lowbar;self» aria-label&equals;»Prince Harry»>Prince Harry<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;royal&sol;kate-middleton&sol;» target&equals;»&lowbar;self» aria-label&equals;»Princess of Wales»>Princess of Wales<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;royal&sol;prince-william&sol;» target&equals;»&lowbar;self» aria-label&equals;»Prince William»>Prince William<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;royal&sol;prince-andrew&sol;» target&equals;»&lowbar;self» aria-label&equals;»Andrew»>Andrew<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;royal&sol;princess-eugenie&sol;» target&equals;»&lowbar;self» aria-label&equals;»Princess Eugenie»>Princess Eugenie<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item money–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;14″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;14&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;money&sol;» target&equals;»» aria-label&equals;»Money»>Money<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;14&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;14&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;uk&sol;rachel-reeves&sol;» target&equals;»&lowbar;self» rel&equals;»» aria-label&equals;»Rachel Reeves»>Rachel Reeves<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;money&sol;savings&sol;» target&equals;»&lowbar;self» aria-label&equals;»Savings»>Savings<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;money&sol;pensions&sol;» target&equals;»&lowbar;self» aria-label&equals;»Pensions»>Pensions<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;money&sol;tax&sol;» target&equals;»&lowbar;self» aria-label&equals;»Tax»>Tax<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;money&sol;cost-of-living&sol;» target&equals;»&lowbar;self» aria-label&equals;»Cost of Living»>Cost of Living<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;money&sol;energy-bills&sol;» target&equals;»&lowbar;self» aria-label&equals;»Energy Bills»>Energy Bills<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;money&sol;bank-branch-closures&sol;» target&equals;»&lowbar;self» aria-label&equals;»Bank Closures»>Bank Closures<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;money&sol;bank-of-england&sol;» target&equals;»&lowbar;self» aria-label&equals;»Bank of England»>Bank of England<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;money&sol;economy&sol;» target&equals;»&lowbar;self» aria-label&equals;»Economy»>Economy<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;money&sol;inflation&sol;» target&equals;»&lowbar;self» aria-label&equals;»Inflation»>Inflation<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item travel–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;15″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;15&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;travel&sol;» target&equals;»» aria-label&equals;»Travel»>Travel<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;15&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;15&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;travel&sol;staycation&sol;» target&equals;»&lowbar;self» aria-label&equals;»staycation»>Staycation<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;travel&sol;deals&sol;» target&equals;»&lowbar;self» aria-label&equals;»deals»>Deals<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;travel&sol;cruise&sol;» target&equals;»&lowbar;self» aria-label&equals;»cruise»>Cruise<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;travel&sol;eurostar&sol;» target&equals;»&lowbar;self» aria-label&equals;»eurostar»>Eurostar<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item celebrity–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;16″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;16&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;celebrity&sol;» target&equals;»» aria-label&equals;»Celebrity»>Celebrity<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;16&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;16&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;music&sol;» target&equals;»&lowbar;self» aria-label&equals;»Music»>Music<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;film&sol;» target&equals;»&lowbar;self» aria-label&equals;»Film»>Film<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;tv&sol;» target&equals;»&lowbar;self» aria-label&equals;»TV»>TV<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;bbc&sol;» target&equals;»&lowbar;self» aria-label&equals;»BBC»>BBC<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;itv&sol;» target&equals;»&lowbar;self» aria-label&equals;»ITV»>ITV<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;channel-4&sol;» target&equals;»&lowbar;self» aria-label&equals;»Channel 4″>Channel 4<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;channel-5&sol;» target&equals;»&lowbar;self» aria-label&equals;»Channel 5″>Channel 5<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;james-bond&sol;» target&equals;»&lowbar;self» aria-label&equals;»James Bond»>James Bond<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;im-a-celebrity-get-me-out-of-here&sol;» target&equals;»&lowbar;self» rel&equals;»» aria-label&equals;»I’m A Celeb&excl;»>I’m A Celeb&excl;<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;strictly-come-dancing&sol;» target&equals;»&lowbar;self» aria-label&equals;»Strictly Come Dancing»>Strictly Come Dancing<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item sport–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;17″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;17&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;sport&sol;» target&equals;»» aria-label&equals;»Sport»>Sport<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;17&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;17&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;football&sol;» target&equals;»&lowbar;self» aria-label&equals;»Football»>Football<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;football&sol;world-cup&sol;» target&equals;»&lowbar;self» aria-label&equals;»Olympics»>World Cup<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;f1&sol;» target&equals;»&lowbar;self» aria-label&equals;»F1″>  F1  <&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;tennis&sol;» target&equals;»&lowbar;self» aria-label&equals;»Tennis»>Tennis<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;cricket&sol;» target&equals;»&lowbar;self» aria-label&equals;»Cricket»>Cricket<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;boxing&sol;» target&equals;»&lowbar;self» aria-label&equals;»Boxing»>Boxing<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;rugby&sol;» target&equals;»&lowbar;self» aria-label&equals;»Rugby»>Rugby<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;golf&sol;» target&equals;»&lowbar;self» aria-label&equals;»Golf»>Golf<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;darts&sol;» target&equals;»&lowbar;self» aria-label&equals;»Darts»>Darts<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;snooker&sol;» target&equals;»&lowbar;self» aria-label&equals;»Snooker»>Snooker<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;nfl&sol;» target&equals;»&lowbar;self» aria-label&equals;»NFL»>NFL<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;other-sport&sol;» target&equals;»&lowbar;self» aria-label&equals;»Other Sport»>Other Sport<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item lifestyle–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;18″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;18&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;lifestyle&sol;» target&equals;»» aria-label&equals;»Lifestyle»>Lifestyle<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;18&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;18&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;health&sol;» target&equals;»&lowbar;self» aria-label&equals;»Health»>Health<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;lifestyle&sol;food&sol;» target&equals;»&lowbar;self» aria-label&equals;»Food»>Food<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;lifestyle&sol;gardening&sol;» target&equals;»&lowbar;self» aria-label&equals;»Gardening»>Gardening<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;lifestyle&sol;cars&sol;» target&equals;»&lowbar;self» aria-label&equals;»Cars»>Cars<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;lifestyle&sol;diet&sol;» target&equals;»&lowbar;self» aria-label&equals;»Diet»>Diet<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;lifestyle&sol;property&sol;» target&equals;»&lowbar;self» aria-label&equals;»Property»>Property<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item tech–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;19″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;19&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;tech&sol;» target&equals;»» aria-label&equals;»Tech»>Tech<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;19&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;19&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;deals&sol; » target&equals;»&lowbar;self» aria-label&equals;»Deals»>Deals<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;reviews&sol;» target&equals;»&lowbar;self» aria-label&equals;»Reviews «>Reviews<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;google&sol;» target&equals;»&lowbar;self» aria-label&equals;»Google»>Google<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;apple&sol;» target&equals;»&lowbar;self» aria-label&equals;»Apple»>Apple<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;samsung&sol;» target&equals;»&lowbar;self» aria-label&equals;»Samsung»>Samsung<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;microsoft&sol;» target&equals;»&lowbar;self» aria-label&equals;»Miscosoft»>Microsoft <&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;vpn&sol;» target&equals;»&lowbar;self» aria-label&equals;»VPN»>VPN<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;streaming&sol;» target&equals;»&lowbar;self» aria-label&equals;»Streaming»>Streaming<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;ai&sol;» target&equals;»&lowbar;self» aria-label&equals;»AI»>AI<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;privacy&sol;» target&equals;»&lowbar;self» aria-label&equals;»Privacy «>Privacy <&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item privacy–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;20″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;20&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;tech&sol;privacy&sol;» target&equals;»» aria-label&equals;»Privacy»>Privacy<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;20&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;20&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;deals&sol; » target&equals;»&lowbar;self» aria-label&equals;»Deals»>Deals<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;reviews&sol;» target&equals;»&lowbar;self» aria-label&equals;»Reviews «>Reviews<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;google&sol;» target&equals;»&lowbar;self» aria-label&equals;»Google»>Google<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;apple&sol;» target&equals;»&lowbar;self» aria-label&equals;»Apple»>Apple<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;samsung&sol;» target&equals;»&lowbar;self» aria-label&equals;»Samsung»>Samsung<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;microsoft&sol;» target&equals;»&lowbar;self» aria-label&equals;»Miscosoft»>Microsoft <&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;vpn&sol;» target&equals;»&lowbar;self» aria-label&equals;»VPN»>VPN<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;streaming&sol;» target&equals;»&lowbar;self» aria-label&equals;»Streaming»>Streaming<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;ai&sol;» target&equals;»&lowbar;self» aria-label&equals;»AI»>AI<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;tech&sol;privacy&sol;» target&equals;»&lowbar;self» aria-label&equals;»Privacy «>Privacy <&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item america–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;21″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;21&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;us&sol;» target&equals;»&lowbar;self» aria-label&equals;»America»>America<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;21&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;21&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;us&sol;» target&equals;»&lowbar;self» aria-label&equals;»US News»>US News<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;us&sol;» target&equals;»&lowbar;self» aria-label&equals;»US Politics»>US Politics<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;us&sol;joe-biden&sol;» target&equals;»&lowbar;self» aria-label&equals;»Joe Biden»>Joe Biden<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;politics&sol;us&sol;donald-trump&sol;» target&equals;»&lowbar;self» aria-label&equals;»Donald Trump»>Donald Trump<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;us&sol;elon-musk&sol;» target&equals;»&lowbar;self» aria-label&equals;»Elon Musk»>Elon Musk<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;us&sol;new-york&sol;» target&equals;»&lowbar;self» aria-label&equals;»New york»>New York<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;news&sol;world&sol;justin-trudeau&sol;» target&equals;»&lowbar;self» aria-label&equals;»Justin Trudeau»>Justin Trudeau<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;celebrity&sol;will-smith&sol;» target&equals;»&lowbar;self» aria-label&equals;»Will Smith»>Will Smith<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;sport&sol;tennis&sol;» target&equals;»&lowbar;self» aria-label&equals;»Tennis»>Tennis<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item watch–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;22″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;22&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;watch&sol;live» target&equals;»» aria-label&equals;»Watch»>Watch<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;22&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;22&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;watch&sol;live» target&equals;»&lowbar;self» aria-label&equals;»Live»>Live<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;watch&sol;videos» target&equals;»&lowbar;self» aria-label&equals;»Videos»>Videos<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;watch&sol;catch-up» target&equals;»&lowbar;self» aria-label&equals;»Catch Up»>Catch Up<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;watch&sol;schedule» target&equals;»&lowbar;self» aria-label&equals;»Schedule»>Schedule<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;watch&sol;originals&sol;» target&equals;»&lowbar;self» aria-label&equals;»originals»>Originals<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;watch&sol;how-to-watch» target&equals;»&lowbar;self» aria-label&equals;»How to watch»>How to watch<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item shows–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;23″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;23&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;shows&sol;» target&equals;»» aria-label&equals;»Shows»>Shows<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;23&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;23&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;» &sol;watch&sol;catch-up&sol;» target&equals;»&lowbar;self» aria-label&equals;»Catch Up»>Catch Up<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;shows&sol;farage&sol;» target&equals;»&lowbar;self» aria-label&equals;»Farage»>Farage<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;shows&sol;dewbs-co&sol;» target&equals;»&lowbar;self» aria-label&equals;»Dewbs &amp&semi; Co»>Dewbs &amp&semi; Co<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;shows&sol;patrick-christys-tonight&sol;» target&equals;»&lowbar;self» aria-label&equals;»Patrick Christys Tonight»>Patrick Christys Tonight<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;shows&sol;nana-akua&sol;» target&equals;»&lowbar;self» aria-label&equals;»Nana Akua»>Nana Akua<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;shows&sol;breakfast-with-stephen-and-anne&sol;» target&equals;»&lowbar;self» aria-label&equals;»Breakfast with Stephen &amp&semi; Anne»>Breakfast with Stephen and Anne<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;shows&sol;the-camilla-tominey-show&sol;» target&equals;»&lowbar;self» aria-label&equals;»Camilla Tominey Show»>Camilla Tominey Show<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;shows&sol;sunday-with-michael-portillo&sol;» target&equals;»&lowbar;self» aria-label&equals;»Sunday with Michael Portillo»>Sunday with Michael Portillo<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;shows&sol;free-speech-nation&sol;» target&equals;»&lowbar;self» aria-label&equals;»Free Speech Nation»>Free Speech Nation<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»secondary–nav regular–secondary&lowbar;&lowbar;nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;24&lowbar;1&lowbar;0&lowbar;0″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;24&lowbar;1&lowbar;0&lowbar;0&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»https&colon;&sol;&sol;gbnews&period;shop&sol;» target&equals;»&lowbar;blank» rel&equals;»Shop» aria-label&equals;»Shop»>GBN Shop<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;watch&sol;live&num;comments» target&equals;»&lowbar;self» rel&equals;»YourSay» aria-label&equals;»YourSay»>YourSay<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;youdecide» target&equals;»&lowbar;self» rel&equals;»YouDecide» aria-label&equals;»YouDecide»>YouDecide<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;support» target&equals;»&lowbar;self» rel&equals;»Support Us» aria-label&equals;»Support Us»>Support Us<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;alerts» target&equals;»&lowbar;self» rel&equals;»News Alerts» aria-label&equals;»News Alerts»>News Alerts<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;latest» target&equals;»&lowbar;self» aria-label&equals;»Latest»>Latest<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;puzzles&sol;» target&equals;»&lowbar;self» aria-label&equals;»Puzzles»>Puzzles<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;terms&sol;competition-terms&sol;» target&equals;»&lowbar;self» aria-label&equals;»Win»>Win<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;shows&sol;gb-news-live-show-join-our-live-studio-audience» target&equals;»&lowbar;self» aria-label&equals;»Tickets»>Tickets<&sol;a><&sol;div><&sol;div><div class&equals;»nav–item presenters–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;25″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;25&lowbar;0″><a class&equals;»color-inherit» href&equals;»&sol;presenters&sol;» target&equals;»» aria-label&equals;»Presenters»>Presenters<&sol;a><&sol;div><div class&equals;»secondary–nav» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;25&lowbar;1″><div class&equals;»list» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;25&lowbar;1&lowbar;0″><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;eamonn-holmes&sol;» target&equals;»&lowbar;self» aria-label&equals;»Eamonn Holmes»>Eamonn Holmes<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;nigel-farage&sol;» target&equals;»&lowbar;self» aria-label&equals;»Nigel Farage»>Nigel Farage<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;michelle-dewberry&sol;» target&equals;»&lowbar;self» aria-label&equals;»Michelle Dewberry»>Michelle Dewberry<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;patrick-christys&sol;» target&equals;»&lowbar;self» aria-label&equals;»Patrick Christys»>Patrick Christys<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;nana-akua&sol;» target&equals;»&lowbar;self» aria-label&equals;»Nana Akua»>Nana Akua<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;stephen-dixon&sol;» target&equals;»&lowbar;self» aria-label&equals;»Stephen Dixon»>Stephen Dixon<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;anne-diamond&sol;» target&equals;»&lowbar;self» aria-label&equals;»Anne Diamond»>Anne Diamond<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;andrew-pierce&sol;» target&equals;»&lowbar;self» aria-label&equals;»Andrew Pierce»>Andrew Pierce<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;beverley-turner&sol;» target&equals;»&lowbar;self» aria-label&equals;»Beverley Turner»>Beverley Turner<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;camilla-tominey&sol;» target&equals;»&lowbar;self» aria-label&equals;»Camilla Tominey»>Camilla Tominey<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;michael-portillo&sol;» target&equals;»&lowbar;self» aria-label&equals;»Michael Portillo»>Michael Portillo<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;gloria-de-piero&sol;» target&equals;»&lowbar;self» aria-label&equals;»Gloria De Piero»>Gloria De Piero<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;neil-oliver&sol;» target&equals;»&lowbar;self» aria-label&equals;»Neil Oliver»>Neil Oliver<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;tom-harwood&sol;» target&equals;»&lowbar;self» aria-label&equals;»Tom Harwood»>Tom Harwood<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;emily-carver&sol;» target&equals;»&lowbar;self» aria-label&equals;»Emily Carver»>Emily Carver<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;simon-evans&sol;» target&equals;»&lowbar;self» aria-label&equals;»Simon Evans»>Simon Evans<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;olivia-utley&sol;» target&equals;»&lowbar;self» aria-label&equals;»Olivia Utley»>Olivia Utley<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;ellie-costello&sol;» target&equals;»&lowbar;self» aria-label&equals;»Olivia Utley»>Ellie Costello<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;mark-white&sol;» target&equals;»&lowbar;self» aria-label&equals;»Mark White»>Mark White<&sol;a><a class&equals;»list&lowbar;&lowbar;item» href&equals;»&sol;presenters&sol;cameron-walker&sol;» target&equals;»&lowbar;self» aria-label&equals;»Cameron Walker»>Cameron Walker<&sol;a><&sol;div><&sol;div><&sol;div><div class&equals;»nav–item shop–channel&lowbar;&lowbar;active» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;26″><div class&equals;»text-element» id&equals;»sNavigation&lowbar;Items&lowbar;0&lowbar;0&lowbar;14&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;0&lowbar;26&lowbar;0″><a class&equals;»color-inherit» href&equals;»https&colon;&sol;&sol;gbnews&period;shop&sol;» target&equals;»&lowbar;blank» aria-label&equals;»Shop»>Shop<&sol;a><&sol;div><&sol;div><&sol;div><&excl;– User Code –><div class&equals;»nav–arrows primary–nav&lowbar;&lowbar;arrow left hidden hide-mobile»><svg xmlns&equals;»http&colon;&sol;&sol;www&period;w3&period;org&sol;2000&sol;svg» width&equals;»20″ height&equals;»20″ viewbox&equals;»0 0 20 20″ fill&equals;»none»><circle cx&equals;»10″ cy&equals;»10″ r&equals;»10″ transform&equals;»rotate&lpar;-90 10 10&rpar;» fill&equals;»&num;000F55″ fill-opacity&equals;»0&period;8″&sol;><path d&equals;»M8&period;71921 9&period;98389C9&period;42955 10&period;699 10&period;1005 11&period;3748 10&period;7714 12&period;0506C11&period;116 12&period;3972 11&period;4613 12&period;7423 11&period;8052 13&period;0897C12&period;0512 13&period;3374 12&period;0621 13&period;5813 11&period;8402 13&period;8289C11&period;6343 14&period;0585 11&period;3598 14&period;0593 11&period;1182 13&period;8176C10&period;3224 13&period;0217 9&period;52957 12&period;2228 8&period;736 11&period;4247C8&period;37827 11&period;0652 8&period;01982 10&period;7065 7&period;66428 10&period;3448C7&period;44745 10&period;1251 7&period;44526 9&period;88648 7&period;65771 9&period;67127C8&period;80536 8&period;51066 9&period;95373 7&period;34929 11&period;1028 6&period;18943C11&period;4073 5&period;88285 11&period;7964 5&period;95685 11&period;9577 6&period;35027C12&period;0242 6&period;51262 12&period;0191 6&period;66893 11&period;8935 6&period;80485C11&period;8431 6&period;85922 11&period;7935 6&period;9151 11&period;7416 6&period;96795C10&period;786 7&period;93677 9&period;83035 8&period;90483 8&period;87325 9&period;87213C8&period;83456 9&period;9114 8&period;78418 9&period;93783 8&period;71921 9&period;98464L8&period;71921 9&period;98389Z» fill&equals;»white»&sol;><&sol;svg><&sol;div><div class&equals;»nav–arrows primary–nav&lowbar;&lowbar;arrow right hidden hide-mobile»><svg xmlns&equals;»http&colon;&sol;&sol;www&period;w3&period;org&sol;2000&sol;svg» width&equals;»20″ height&equals;»20″ viewbox&equals;»0 0 20 20″ fill&equals;»none»><circle cx&equals;»10″ cy&equals;»10″ r&equals;»10″ transform&equals;»rotate&lpar;90 10 10&rpar;» fill&equals;»&num;000F55″ fill-opacity&equals;»0&period;8″&sol;><path d&equals;»M11&period;2808 10&period;0161C10&period;5704 9&period;30102 9&period;89953 8&period;62519 9&period;22861 7&period;94936C8&period;88402 7&period;60276 8&period;5387 7&period;25767 8&period;19485 6&period;91032C7&period;94882 6&period;66264 7&period;93787 6&period;41873 8&period;15981 6&period;17106C8&period;36568 5&period;9415 8&period;64018 5&period;94075 8&period;88183 6&period;18238C9&period;67759 6&period;97828 10&period;4704 7&period;77719 11&period;264 8&period;57535C11&period;6217 8&period;93478 11&period;9802 9&period;29346 12&period;3357 9&period;65517C12&period;5525 9&period;8749 12&period;5547 10&period;1135 12&period;3423 10&period;3287C11&period;1946 11&period;4893 10&period;0463 12&period;6507 8&period;89716 13&period;8106C8&period;59273 14&period;1171 8&period;20361 14&period;0431 8&period;04227 13&period;6497C7&period;97583 13&period;4874 7&period;98094 13&period;3311 8&period;10651 13&period;1952C8&period;15688 13&period;1408 8&period;20653 13&period;0849 8&period;25836 13&period;032C9&period;214 12&period;0632 10&period;1696 11&period;0952 11&period;1267 10&period;1279C11&period;1654 10&period;0886 11&period;2158 10&period;0622 11&period;2808 10&period;0154L11&period;2808 10&period;0161Z» fill&equals;»white»&sol;><&sol;svg><&sol;div><&excl;– End User Code –><&excl;– User Code –><div class&equals;»nav–arrows secondary–nav&lowbar;&lowbar;arrow left hidden hide-mobile»><svg xmlns&equals;»http&colon;&sol;&sol;www&period;w3&period;org&sol;2000&sol;svg» width&equals;»20″ height&equals;»20″ viewbox&equals;»0 0 20 20″ fill&equals;»none»><circle cx&equals;»10″ cy&equals;»10″ r&equals;»10″ transform&equals;»rotate&lpar;-90 10 10&rpar;» fill&equals;»white»&sol;><path d&equals;»M8&period;71921 9&period;98389C9&period;42955 10&period;699 10&period;1005 11&period;3748 10&period;7714 12&period;0506C11&period;116 12&period;3972 11&period;4613 12&period;7423 11&period;8052 13&period;0897C12&period;0512 13&period;3374 12&period;0621 13&period;5813 11&period;8402 13&period;8289C11&period;6343 14&period;0585 11&period;3598 14&period;0593 11&period;1182 13&period;8176C10&period;3224 13&period;0217 9&period;52957 12&period;2228 8&period;736 11&period;4247C8&period;37827 11&period;0652 8&period;01982 10&period;7065 7&period;66428 10&period;3448C7&period;44745 10&period;1251 7&period;44526 9&period;88648 7&period;65771 9&period;67127C8&period;80536 8&period;51066 9&period;95373 7&period;34929 11&period;1028 6&period;18943C11&period;4073 5&period;88285 11&period;7964 5&period;95685 11&period;9577 6&period;35027C12&period;0242 6&period;51262 12&period;0191 6&period;66893 11&period;8935 6&period;80485C11&period;8431 6&period;85922 11&period;7935 6&period;9151 11&period;7416 6&period;96795C10&period;786 7&period;93677 9&period;83035 8&period;90483 8&period;87325 9&period;87213C8&period;83456 9&period;9114 8&period;78418 9&period;93783 8&period;71921 9&period;98464L8&period;71921 9&period;98389Z» fill&equals;»&num;0032AA»&sol;><&sol;svg><&sol;div><div class&equals;»nav–arrows secondary–nav&lowbar;&lowbar;arrow right hidden hide-mobile»><svg xmlns&equals;»http&colon;&sol;&sol;www&period;w3&period;org&sol;2000&sol;svg» width&equals;»20″ height&equals;»20″ viewbox&equals;»0 0 20 20″ fill&equals;»none»><circle cx&equals;»10″ cy&equals;»10″ r&equals;»10″ transform&equals;»rotate&lpar;90 10 10&rpar;» fill&equals;»white»&sol;><path d&equals;»M11&period;2808 10&period;0161C10&period;5704 9&period;30102 9&period;89953 8&period;62519 9&period;22861 7&period;94936C8&period;88402 7&period;60276 8&period;5387 7&period;25767 8&period;19485 6&period;91032C7&period;94882 6&period;66264 7&period;93787 6&period;41873 8&period;15981 6&period;17106C8&period;36568 5&period;9415 8&period;64018 5&period;94075 8&period;88183 6&period;18238C9&period;67759 6&period;97828 10&period;4704 7&period;77719 11&period;264 8&period;57535C11&period;6217 8&period;93478 11&period;9802 9&period;29346 12&period;3357 9&period;65517C12&period;5525 9&period;8749 12&period;5547 10&period;1135 12&period;3423 10&period;3287C11&period;1946 11&period;4893 10&period;0463 12&period;6507 8&period;89716 13&period;8106C8&period;59273 14&period;1171 8&period;20361 14&period;0431 8&period;04227 13&period;6497C7&period;97583 13&period;4874 7&period;98094 13&period;3311 8&period;10651 13&period;1952C8&period;15688 13&period;1408 8&period;20653 13&period;0849 8&period;25836 13&period;032C9&period;214 12&period;0632 10&period;1696 11&period;0952 11&period;1267 10&period;1279C11&period;1654 10&period;0886 11&period;2158 10&period;0622 11&period;2808 10&period;0154L11&period;2808 10&period;0161Z» fill&equals;»&num;0032AA»&sol;><&sol;svg><&sol;div><&excl;– End User Code –><&sol;div><span class&equals;»viewport-css-anchor»&sol;><&excl;– User Code –><p><vf-tray&sol;><&sol;p><&excl;– End User Code –><div class&equals;»breaking-banner&lowbar;&lowbar;wrapper show-only-if-post-present hidden» id&equals;»sElement&lowbar;Breaking&lowbar;News&lowbar;Banner&lowbar;0&lowbar;0&lowbar;7&lowbar;0&lowbar;0&lowbar;0″><&excl;– User Code –><button class&equals;»breaking-banner&lowbar;&lowbar;close-btn» type&equals;»button» aria-label&equals;»close»><svg width&equals;»16″ height&equals;»16″ viewbox&equals;»0 0 16 16″ fill&equals;»none» xmlns&equals;»http&colon;&sol;&sol;www&period;w3&period;org&sol;2000&sol;svg»><path d&equals;»M8&period;86889 8&period;00015L15&period;8175 1&period;0503C16&period;0575 0&period;810263 16&period;0575 0&period;420056 15&period;8175 0&period;180024C15&period;5776 -0&period;0600081 15&period;1874 -0&period;0600081 14&period;9474 0&period;180024L7&period;99877 7&period;12988L1&period;05011 0&period;180024C0&period;810123 -0&period;0600081 0&period;419984 -0&period;0600081 0&period;179993 0&period;180024C-0&period;0599977 0&period;420056 -0&period;0599977 0&period;810263 0&period;179993 1&period;0503L7&period;12865 8&period;00015L0&period;179993 14&period;95C-0&period;0599977 15&period;19 -0&period;0599977 15&period;5802 0&period;179993 15&period;8203C0&period;300604 15&period;9409 0&period;458136 16 0&period;615669 16C0&period;773201 16 0&period;930733 15&period;9397 1&period;05134 15&period;8203L8 8&period;87042L14&period;9487 15&period;8203C15&period;0693 15&period;9409 15&period;2268 16 15&period;3843 16C15&period;5419 16 15&period;6994 15&period;9397 15&period;82 15&period;8203C16&period;06 15&period;5802 16&period;06 15&period;19 15&period;82 14&period;95L8&period;87135 8&period;00015H8&period;86889Z» fill&equals;»white»&sol;><&sol;svg><&sol;button><&excl;– End User Code –><p&sol;><script><&excl;&lbrack;CDATA&lbrack;&NewLine; &NewLine; window&period;addEventListener&lpar;’DOMContentLoaded’&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’loaded’&rpar;&semi;&NewLine; &NewLine; let unpublish &equals; document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;wrapper &period;unpublish-time’&rpar; &quest; document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;wrapper &period;unpublish-time’&rpar;&period;textContent &colon; 0&semi;&NewLine; let currentTime &equals; parseInt&lpar;Date&period;now&lpar;&rpar;&sol;1000&rpar;&semi;&NewLine;&Tab;&sol;&sol; console&period;log&lpar;unpublish&comma; currentTime&comma; unpublish > currentTime&rpar;&semi;&NewLine; &NewLine; &NewLine; if &lpar;document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;post’&rpar;&period;childNodes&period;length &excl;&equals; 0 && unpublish >&equals; currentTime&rpar;&lbrace;&NewLine; let hasCookie &equals; getCookie&lpar;’hideAlert’&rpar;&comma;&NewLine; original &equals; window&period;location&period;href&period;split&lpar;’&quest;’&rpar;&lbrack;0&rsqb;&comma;&NewLine; postURL &equals; document&period;querySelector&lpar;»&period;banner&lowbar;&lowbar;url»&rpar;&period;getAttribute&lpar;’href’&rpar;&period;split&lpar;’&quest;’&rpar;&lbrack;0&rsqb;&comma;&NewLine; hasSidebar &equals; document&period;querySelectorAll&lpar;’&period;content–with–sidebar’&rpar;&period;length&comma;&NewLine; postId &equals; document&period;querySelector&lpar;»&period;breaking-banner&lowbar;&lowbar;post &period;widget»&rpar;&period;getAttribute&lpar;’elid’&rpar;&semi;&NewLine; &NewLine; document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;close-btn’&rpar;&period;addEventListener&lpar;’click’&comma; &lpar;&rpar;&equals;>&lbrace;&NewLine; document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;wrapper’&rpar;&period;classList&period;add&lpar;’hidden’&rpar;&semi;&NewLine;&Tab; setCookie&lpar;’hideAlert’&comma; postId&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;post &period;widget&lowbar;&lowbar;headline-text’&rpar;&period;addEventListener&lpar;’click’&comma; &lpar;&rpar;&equals;>&lbrace;&NewLine;&Tab; setCookie&lpar;’hideAlert’&comma; postId&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;post &period;widget&lowbar;&lowbar;subheadline-text’&rpar;&period;addEventListener&lpar;’click’&comma; &lpar;&rpar;&equals;>&lbrace;&NewLine;&Tab; setCookie&lpar;’hideAlert’&comma; postId&rpar;&semi;&NewLine; &rcub;&rpar;&semi; &NewLine; if &lpar;hasSidebar <&equals; 0&rpar; &lbrace;&NewLine; document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;wrapper’&rpar;&period;classList&period;add&lpar;’no-sidebar’&rpar;&semi;&NewLine; &rcub;&NewLine; if &lpar;&excl;hasCookie &vert;&vert; hasCookie &excl;&equals; postId &rpar;&lbrace;&NewLine; document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;wrapper’&rpar;&period;classList&period;remove&lpar;’hidden’&rpar;&semi;&NewLine; &rcub;&NewLine; if &lpar;original &equals;&equals; postURL&rpar;&lbrace;&NewLine; document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;wrapper’&rpar;&period;classList&period;add&lpar;’hidden’&rpar;&semi;&NewLine; &rcub;&NewLine; if &lpar;window&period;location&period;href&period;includes&lpar;’lab&lowbar;viewport&equals;embed&lab&lowbar;content&equals;full’&rpar;&rpar;&lbrace;&NewLine; let originalId &equals; document&period;querySelector&lpar;»&period;main-post&lowbar;&lowbar;top article»&rpar;&period;getAttribute&lpar;’elid’&rpar;&comma;&NewLine; bannerId &equals; document&period;querySelector&lpar;»&period;banner&lowbar;&lowbar;url»&rpar;&period;getAttribute&lpar;’href’&rpar;&period;split&lpar;’&sol;’&rpar;&lbrack;3&rsqb;&semi;&NewLine; if &lpar;originalId &equals;&equals; bannerId&rpar;&lbrace;&NewLine; document&period;querySelector&lpar;’&period;breaking-banner&lowbar;&lowbar;wrapper’&rpar;&period;classList&period;add&lpar;’hidden’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&rcub;&rcub;&rpar; &NewLine;&NewLine;&NewLine;function getCookie&lpar;c&lowbar;name&rpar; &lbrace;&NewLine; if &lpar;document&period;cookie&period;length > 0&rpar; &lbrace;&NewLine; c&lowbar;start &equals; document&period;cookie&period;indexOf&lpar;c&lowbar;name &plus; «&equals;»&rpar;&semi;&NewLine; if &lpar;c&lowbar;start &excl;&equals; -1&rpar; &lbrace;&NewLine; c&lowbar;start &equals; c&lowbar;start &plus; c&lowbar;name&period;length &plus; 1&semi;&NewLine; c&lowbar;end &equals; document&period;cookie&period;indexOf&lpar;»&semi;»&comma; c&lowbar;start&rpar;&semi;&NewLine; if &lpar;c&lowbar;end &equals;&equals; -1&rpar; &lbrace;&NewLine; c&lowbar;end &equals; document&period;cookie&period;length&semi;&NewLine; &rcub;&NewLine; return unescape&lpar;document&period;cookie&period;substring&lpar;c&lowbar;start&comma; c&lowbar;end&rpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; return «»&semi;&NewLine;&rcub;&NewLine; &NewLine;function setCookie&lpar;cname&comma; cvalue&rpar; &lbrace;&NewLine; document&period;cookie &equals; cname &plus; «&equals;» &plus; cvalue &plus; «&semi; path&equals;&sol;»&semi;&NewLine;&rcub;&NewLine;&NewLine;&rsqb;&rsqb;><&sol;script><&sol;div><meta name&equals;»vf&colon;container&lowbar;id» content&equals;»2676762030″&sol;><&excl;– User Code –><&excl;– Google Tag Manager –><script><&excl;&lbrack;CDATA&lbrack;&NewLine;&NewLine; &sol;&sol;MOVED TO delayedCmpScript shared element&NewLine;&NewLine;&NewLine;&NewLine; &sol;&sol; window&period;runWhenConsentIsReady&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’Consent is ready&comma; loading GTM Secondary&period;&period;&period;’&rpar;&semi;&NewLine; &sol;&sol; &lpar;function&lpar;w&comma;d&comma;s&comma;l&comma;i&rpar;&lbrace;w&lbrack;l&rsqb;&equals;w&lbrack;l&rsqb;&vert;&vert;&lbrack;&rsqb;&semi;w&lbrack;l&rsqb;&period;push&lpar;&lbrace;’gtm&period;start’&colon;&NewLine; &sol;&sol; new Date&lpar;&rpar;&period;getTime&lpar;&rpar;&comma;event&colon;’gtm&period;js’&rcub;&rpar;&semi;var f&equals;d&period;getElementsByTagName&lpar;s&rpar;&lbrack;0&rsqb;&comma;&NewLine; &sol;&sol; j&equals;d&period;createElement&lpar;s&rpar;&comma;dl&equals;l&excl;&equals;’dataLayer’&quest;’&l&equals;’&plus;l&colon;»&semi;j&period;async&equals;true&semi;j&period;src&equals;&NewLine; &sol;&sol; ‘https&colon;&sol;&sol;www&period;googletagmanager&period;com&sol;gtm&period;js&quest;id&equals;’&plus;i&plus;dl&semi;f&period;parentNode&period;insertBefore&lpar;j&comma;f&rpar;&semi;&NewLine; &sol;&sol; &rcub;&rpar;&lpar;window&comma;document&comma;’script’&comma;’dataLayer’&comma;’GTM-PCG4W7Z’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; console&period;log&lpar;’Consent is ready&comma; injecting GTM secondary iframe’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; const iframe &equals; document&period;createElement&lpar;’iframe’&rpar;&semi;&NewLine; &sol;&sol; iframe&period;src &equals; «https&colon;&sol;&sol;www&period;googletagmanager&period;com&sol;ns&period;html&quest;id&equals;GTM-PCG4W7Z»&semi;&NewLine; &sol;&sol; iframe&period;height &equals; «0»&semi;&NewLine; &sol;&sol; iframe&period;width &equals; «0»&semi;&NewLine; &sol;&sol; iframe&period;style&period;display &equals; «none»&semi;&NewLine; &sol;&sol; iframe&period;style&period;visibility &equals; «hidden»&semi;&NewLine; &sol;&sol; document&period;body&period;appendChild&lpar;iframe&rpar;&semi;&NewLine;&NewLine;&NewLine; &sol;&sol; &rcub;&rpar;&semi;&NewLine;&rsqb;&rsqb;><&sol;script><&excl;– End Google Tag Manager –><&excl;– Google Tag Manager &lpar;noscript&rpar; –><&excl;– <noscript>&NewLine; <iframe&NewLine; src&equals;»https&colon;&sol;&sol;www&period;googletagmanager&period;com&sol;ns&period;html&quest;id&equals;GTM-PCG4W7Z»&NewLine; height&equals;»0″&NewLine; width&equals;»0″&NewLine; style&equals;»display&colon;none&semi;visibility&colon;hidden»><&sol;iframe>&NewLine;<&sol;noscript> –><&excl;– End Google Tag Manager &lpar;noscript&rpar; –><&excl;– End User Code –><span class&equals;»viewport-css-anchor»&sol;><p&sol;><div class&equals;»credit-caption-wrapper» id&equals;»sPost&lowbar;Default&lowbar;0&lowbar;0&lowbar;18&lowbar;0&lowbar;0&lowbar;2&lowbar;0&lowbar;10″><div class&equals;»mb-2 » id&equals;»sPost&lowbar;Default&lowbar;0&lowbar;0&lowbar;18&lowbar;0&lowbar;0&lowbar;2&lowbar;0&lowbar;10&lowbar;0″><div class&equals;»posts-custom posts-custom-section section-holder clearfix» data-block&equals;»None» data-format&equals;»posts-custom» data-source&equals;»current&lowbar;post» data-source-type&equals;»current&lowbar;post» data-source-unique&equals;»true» data-section-id&equals;»» data-is-reordable&equals;»false» data-using-stickers&equals;»false» data-has-more&equals;»false» data-attr-format&equals;»posts-custom» data-attr-posts&lowbar;id&equals;»sPost&lowbar;Default&lowbar;0&lowbar;0&lowbar;18&lowbar;0&lowbar;0&lowbar;2&lowbar;0&lowbar;10&lowbar;0″ data-attr-layout&lowbar;quality&equals;»1″ data-attr-node&lowbar;id&equals;»&sol;root&sol;blocks&sol;block&lbrack;post&lowbar;default&rsqb;&sol;abtests&sol;abtest&lbrack;1&rsqb;&sol;rm&lowbar;tabs&sol;rm&lowbar;wrapper&lbrack;1&rsqb;&sol;element&lowbar;wrapper&lbrack;1&rsqb;&sol;current&lowbar;post-» data-attr-layout&lowbar;all&lowbar;headline&lowbar;tag&equals;»h1″ data-attr-layout&lowbar;all&lowbar;subheadline&lowbar;tag&equals;»h2″ data-attr-layout&lowbar;remove&lowbar;image&equals;»true» data-attr-all&lowbar;element&lowbar;order&equals;»» data-attr-filters&equals;»» data-attr-section&lowbar;url&equals;»» data-attr-source&equals;»» data-attr-is&lowbar;current&lowbar;post&equals;»true» data-attr-use&lowbar;smart&lowbar;keep&lowbar;reading&equals;»true»><div class&equals;»posts-wrapper clearfix»><div class&equals;»widget post-partial post-section–news» data-category&equals;»News»><article elid&equals;»2676762030″ data-frozen-sections&equals;»&lbrack;&rsqb;» class&equals;»clearfix video-article sm-mb-1 quality-HD post-2676762030″ data-category&equals;»News»><div class&equals;»row px10″><div class&equals;»rm-col-center col sm-mb-1″ style&equals;»width&colon;100&period;0&percnt;&semi;»><p&sol;><&sol;div><&sol;div><script type&equals;»application&sol;json» id&equals;»post-context-2676762030″ class&equals;»post-context post-context-2676762030″><&excl;&lbrack;CDATA&lbrack;&NewLine; &lbrace;»customDimensions»&colon; &lbrace;»1″&colon;»George Bunn»&comma;»7″&colon;2676762030&comma;»3″&colon;»»&comma;»2″&colon;»news»&comma;»4″&colon;»04&sol;18&sol;2026″&rcub;&comma; «post»&colon; &lbrace;»id»&colon; 2676762030&comma; «providerId»&colon; 0&comma; «sections»&colon; &lbrack;0&comma; 584086272&comma; 2262988002&comma; 588563272&comma; 586304622&comma; 2260688433&comma; 590311187&comma; 586304181&comma; 586311833&comma; 588563322&rsqb;&comma; «authors»&colon; &lbrack;26410785&rsqb;&comma; «tags»&colon; &lbrack;&rsqb;&comma; «streams»&colon; &lbrack;&lbrace;»family&lpar;67bf1ec4027babe3b08d4d5e&comma;0&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «7&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;68d2d34ab1265c0e0fa22efe&comma;588563272&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «1&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;68d2d34ab1265c0e0fa22efe&comma;584086272&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «1&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;67bf1ec4027babe3b08d4d5e&comma;2260688433&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «7&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;68d2d34ab1265c0e0fa22efe&comma;588563322&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «1&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;67bf1ec4027babe3b08d4d5e&comma;586304622&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «7&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;67bf1ec4027babe3b08d4d5e&comma;2262988002&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «7&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;68d2d34ab1265c0e0fa22efe&comma;586311833&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «1&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;68d2d34ab1265c0e0fa22efe&comma;0&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «1&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;67bf1ec4027babe3b08d4d5e&comma;590311187&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «7&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;68d2d34ab1265c0e0fa22efe&comma;586304622&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «1&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;68d2d34ab1265c0e0fa22efe&comma;586304181&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «1&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;67bf1ec4027babe3b08d4d5e&comma;588563322&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «7&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;67bf1ec4027babe3b08d4d5e&comma;588563272&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «7&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;67bf1ec4027babe3b08d4d5e&comma;586311833&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «7&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;67bf1ec4027babe3b08d4d5e&comma;586304181&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «7&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;68d2d34ab1265c0e0fa22efe&comma;2260688433&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «1&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;68d2d34ab1265c0e0fa22efe&comma;590311187&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «1&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;67bf1ec4027babe3b08d4d5e&comma;584086272&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «7&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&comma; &lbrace;»family&lpar;68d2d34ab1265c0e0fa22efe&comma;2262988002&rpar;»&colon; &lbrace;»period»&colon; &lbrace;»window»&colon; «1&ast;1d»&rcub;&comma; «events»&colon; &lbrace;»post-page-view»&colon; 1&period;0&rcub;&rcub;&rcub;&rsqb;&comma; «split&lowbar;testing»&colon; &lbrace;&rcub;&rcub; &rcub;&NewLine;&rsqb;&rsqb;><&sol;script><&sol;article><&sol;div><&sol;div><&sol;div><&sol;div><&sol;div><span class&equals;»viewport-css-anchor»&sol;><div class&equals;»content» id&equals;»sPost&lowbar;Default&lowbar;0&lowbar;0&lowbar;18&lowbar;0&lowbar;0&lowbar;2&lowbar;0&lowbar;14″&sol;><div class&equals;»sidebar–column» id&equals;»sPost&lowbar;Default&lowbar;0&lowbar;0&lowbar;18&lowbar;0&lowbar;0&lowbar;2&lowbar;0&lowbar;14&lowbar;0&lowbar;1&lowbar;1&lowbar;0″&sol;><div class&equals;»» id&equals;»strending&lowbar;module&lowbar;0&lowbar;0&lowbar;31&lowbar;0&lowbar;0&lowbar;0″><&excl;– User Code –><script><&excl;&lbrack;CDATA&lbrack;&NewLine; insertTrending&lpar;&rpar;&semi;&NewLine;&NewLine; function insertTrending&lpar;&rpar; &lbrace;&NewLine; const haveTrending &equals; document&period;querySelector&lpar;’&period;trending-wrapper’&rpar;&NewLine; if &lpar;haveTrending&rpar;&lbrace;&NewLine; return&semi;&NewLine; &rcub;&NewLine; &sol;&sol; let body &equals; document&period;querySelector&lpar;»&period;body»&rpar;&semi;&NewLine; &sol;&sol;const video2 &equals; document&period;querySelectorAll&lpar;’&period;body-description p&colon;not&lpar;small p&comma; &period;evergreen-particle p&comma; &period;rebellt-ecommerce p&comma; &period;gbn-offer-card p&rpar;’&rpar;&lbrack;4&rsqb;&semi;&NewLine; &sol;&sol;let createDiv &equals; insertTrendingDiv&lpar;&rpar;&semi;&NewLine; &sol;&sol; if the team changes it’s mind and wants us to account for empty p tags&NewLine; &sol;&sol; const allP &equals; document&period;querySelectorAll&lpar;’&period;body-description p&colon;not&lpar;small p&comma; &period;evergreen-particle p&comma; &period;rebellt-ecommerce p&rpar;’&rpar;&semi;&NewLine; &sol;&sol; const filtered &equals; Array&period;from&lpar;allP&rpar;&period;filter&lpar;p &equals;> p&period;textContent&period;trim&lpar;&rpar; &excl;&equals;&equals; »&rpar;&semi;&NewLine; &sol;&sol;video2&period;after&lpar;createDiv&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; function insertTrendingDiv&lpar;&rpar; &lbrace;&NewLine; let trendingDiv &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine; trendingDiv&period;classList&period;add&lpar;»trending-wrapper»&rpar;&semi;&NewLine; trendingDiv&period;innerHTML &equals; &grave;&NewLine; <div class&equals;»trending-header»>TRENDING&rsqb;&rsqb;><&sol;script><&sol;div>&NewLine; <div class&equals;»tabs»><p style&equals;»display&colon; inline&semi;» class&equals;»WPAuto&lowbar;Base&lowbar;Readability-styled»>&NewLine; <&sol;p><p>Stories<&sol;p><p style&equals;»display&colon; inline&semi;» class&equals;»WPAuto&lowbar;Base&lowbar;Readability-styled»>&NewLine; <&sol;p><p>Videos<&sol;p><p style&equals;»display&colon; inline&semi;» class&equals;»WPAuto&lowbar;Base&lowbar;Readability-styled»>&NewLine; <&sol;p><p>Your Say<&sol;p><p style&equals;»display&colon; inline&semi;» class&equals;»WPAuto&lowbar;Base&lowbar;Readability-styled»>&NewLine; <&sol;p><&sol;div>&NewLine; <p&sol;>&NewLine; <p&sol;>&NewLine; <p&sol;>&NewLine; &grave;&semi;&NewLine; return trendingDiv&semi;&NewLine; &rcub;&NewLine;<&excl;– End User Code –><&excl;– User Code –><script><&excl;&lbrack;CDATA&lbrack;&NewLine;&NewLine; var &Tab;embeddontmiss&equals;document&period;querySelector&lpar;’&period;embed-dontmiss’&rpar;&semi;&NewLine; if&lpar;embeddontmiss&rpar;&lbrace;&NewLine; &sol;&sol; let dontMiss &equals; document&period;querySelector&lpar;’&period;embed-dontmiss&lowbar;&lowbar;posts’&rpar;&semi;&NewLine; &sol;&sol; var dontmissclone &equals; dontMiss&period;cloneNode&lpar;true&rpar;&semi;&NewLine; &sol;&sol; dontmissclone&period;classList&period;remove&lpar;’hidden’&rpar;&semi;&NewLine; &sol;&sol; embeddontmiss&period;appendChild&lpar;dontmissclone&rpar;&semi;&NewLine; &sol;&sol; const modSlot &equals; document&period;querySelectorAll&lpar;’&period;body-description p&colon;not&lpar;small p&comma; &period;evergreen-particle p&rpar;’&rpar;&lbrack;12&rsqb;&semi;&NewLine; &sol;&sol; modSlot&period;appendChild&lpar;embeddontmiss&rpar;&semi;&NewLine; &sol;&sol; if&lpar;embeddontmiss&period;querySelectorAll&lpar;’&period;widget’&rpar;&period;length < 3 &rpar;&lbrace;&NewLine; &sol;&sol; embeddontmiss&period;classList&period;add&lpar;’hidden’&rpar;&semi;&NewLine; &sol;&sol; &rcub;&NewLine; &rcub;&NewLine;&NewLine; var mostreadElement&equals; document&period;querySelector&lpar;’&period;embed-mostread’&rpar;&semi;&NewLine; if&lpar;mostreadElement&rpar;&lbrace;&NewLine; let mostRead &equals; document&period;querySelector&lpar;’&period;embed-mostread&lowbar;&lowbar;posts’&rpar;&semi;&NewLine; let mostreadclone &equals; mostRead&period;cloneNode&lpar;true&rpar;&semi;&NewLine; mostreadclone&period;classList&period;remove&lpar;’hidden’&rpar;&semi;&NewLine; &sol;&sol; console&period;log&lpar;mostreadElement&rpar;&semi;&NewLine; mostreadElement&period;appendChild&lpar;mostreadclone&rpar;&semi;&NewLine;&NewLine; if&lpar;mostreadElement&period;querySelectorAll&lpar;’&period;widget’&rpar;&period;length < 3&rpar;&lbrace;&NewLine; mostreadElement&period;classList&period;add&lpar;’hidden’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine;&NewLine;&NewLine; &sol;&sol; handle for you&NewLine; &sol;&sol; const modSlot &equals; document&period;querySelectorAll&lpar;’&period;body-description p&colon;not&lpar;small p&comma; &period;evergreen-particle p&rpar;’&rpar;&lbrack;6&rsqb;&semi;&NewLine; &sol;&sol; var embedForYou&equals;document&period;querySelector&lpar;’&period;embed-latest’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; if &lpar;embedForYou&rpar; &lbrace;&NewLine; &sol;&sol; let foryou &equals; document&period;querySelector&lpar;’&period;embed-foryou&lowbar;&lowbar;posts’&rpar;&semi;&NewLine; &sol;&sol; var foryouclone &equals; foryou&period;cloneNode&lpar;true&rpar;&semi;&NewLine; &sol;&sol; foryouclone&period;classList&period;remove&lpar;’hidden’&rpar;&semi;&NewLine; &sol;&sol; console&period;log&lpar;embedForYou&rpar;&semi;&NewLine; &sol;&sol; modSlot&period;appendChild&lpar;foryouclone&rpar;&semi;&NewLine;&NewLine; &sol;&sol; if&lpar;embedForYou&period;querySelectorAll&lpar;’&period;widget’&rpar;&period;length < 3 &rpar;&lbrace;&NewLine; &sol;&sol; embedForYou&period;classList&period;add&lpar;’hidden’&rpar;&semi;&NewLine; &sol;&sol; &rcub;&NewLine; &sol;&sol; &rcub;&NewLine;&NewLine; &sol;&sol; insert newsletter signup after fourth paragraph&sol;div&NewLine; &sol;&sol; insertNewsletterAfter&lpar;4&rpar;&semi;&NewLine;&NewLine; &sol;&sol; function insertNewsletterAfter&lpar;n&rpar; &lbrace;&NewLine; &sol;&sol; for &lpar;let i &equals; 0&semi; i < divs&period;length-2&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; &sol;&sol; if &lpar;&lpar;i &plus; 1&rpar; &percnt; n &equals;&equals;&equals; 0&rpar; &lbrace;&NewLine; &sol;&sol; const div &equals; insertNewsletterSignup&lpar;&rpar;&semi;&NewLine; &sol;&sol; divs&lbrack;i&rsqb;&period;after&lpar;div&rpar;&semi;&NewLine; &sol;&sol; break&semi;&NewLine; &sol;&sol; &rcub;&NewLine; &sol;&sol; &rcub;&NewLine; &sol;&sol; &rcub;&NewLine;&NewLine; &sol;&sol; returns newly created div for the newsletters&NewLine; &sol;&sol; function insertNewsletterSignup&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; let newsLetter &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine; &sol;&sol; newsLetter&period;id &equals; «newsletter-signup»&semi;&NewLine; &sol;&sol; newsLetter&period;style&period;marginBottom &equals; «20px»&semi;&NewLine; &sol;&sol; return newsLetter&semi;&NewLine; &sol;&sol; &rcub;&NewLine;&rsqb;&rsqb;><&sol;script><&excl;– End User Code –><script><&excl;&lbrack;CDATA&lbrack;&NewLine;&NewLine;&NewLine;window&period;&lowbar;taboola &equals; window&period;&lowbar;taboola &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine;&NewLine;&NewLine;let accessStatusFromWindowObj5 &equals; window&period;userStatus&semi;&NewLine;&NewLine;&sol;&sol; ONLY inject Outbrain if accessStatus is NOT member&NewLine;if &lpar;accessStatusFromWindowObj5 &excl;&equals;&equals; ‘member’&rpar; &lbrace;&NewLine; &sol;&sol; Fill in &ast;your&ast; param values&comma; as provided by Taboola&colon;&NewLine; &sol;&sol; &ast;Global&ast; command queue for the page&NewLine; window&period;&lowbar;taboola &equals; window&period;&lowbar;taboola &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine; console&period;log&lpar;»user is not a member tab stage one»&rpar;&NewLine; const paragraphs &equals; document&period;querySelectorAll&lpar;’&period;body-description p&colon;not&lpar;small p&comma; &period;evergreen-particle p&rpar;’&rpar;&semi;&NewLine; if &lpar;paragraphs&period;length > 7&rpar; &lbrace;&NewLine; console&period;log&lpar;»2nd para found&comma; tab stage 2″&rpar;&NewLine; const adPos &equals; paragraphs&lbrack;7&rsqb;&semi;&NewLine; const div &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine; div&period;innerHTML &equals; &grave;<div id&equals;»taboola-mid-article-thumbnails»>&grave;&semi;&NewLine; adPos&period;after&lpar;div&rpar;&semi;&NewLine; console&period;log&lpar;»tab id inserted»&rpar;&NewLine; &lowbar;taboola&period;push&lpar;&lbrace;&NewLine; mode&colon; ‘alternating-thumbnails-stream-rmp’&comma;&NewLine; container&colon; ‘taboola-mid-article-thumbnails’&comma;&NewLine; placement&colon; ‘Mid Article Thumbnails’&comma;&NewLine; target&lowbar;type&colon; ‘mix’&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &sol;&sol; &lowbar;taboola&period;push&lpar;&lbrace;flush&colon; true&rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; console&period;log&lpar;»show ads»&rpar;&NewLine; &NewLine; &lowbar;taboola&period;push&lpar;&lbrace; flush&colon; true &rcub;&rpar;&semi;&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;&rsqb;&rsqb;><&sol;script><p&sol;><&excl;– User Code –><p id&equals;»widgetLoaded» style&equals;»width&colon;0px&semi;height&colon;0px&semi;»&sol;><script><&excl;&lbrack;CDATA&lbrack;&NewLine; &lpar;function &lpar;d&comma; s&comma; b&rpar; &lbrace; var mElmt&comma; primisElmt &equals; d&period;createElement&lpar;’script’&rpar;&semi; primisElmt&period;setAttribute&lpar;’type’&comma; ‘text&sol;javascript’&rpar;&semi; primisElmt&period;setAttribute&lpar;’async’&comma;’async’&rpar;&semi; primisElmt&period;setAttribute&lpar;’src’&comma; s&rpar;&semi; var elmtInterval &equals; setInterval&lpar;function&lpar;&rpar; &lbrace; mElmt &equals; d&period;getElementById&lpar;b&rpar;&semi; if &lpar;mElmt&rpar; &lbrace; mElmt&period;parentNode&period;insertBefore&lpar;primisElmt&comma; mElmt&period;nextSibling&rpar;&semi; mElmt&period;parentNode&period;removeChild&lpar;mElmt&rpar;&semi; return clearInterval&lpar;elmtInterval&rpar;&semi; &rcub; &rcub;&comma; 3500&rpar;&semi; &rcub;&rpar;&lpar;document&comma; ‘https&colon;&sol;&sol;live&period;primis&period;tech&sol;live&sol;liveView&period;php&quest;s&equals;121157&cbuster&equals;&percnt;&percnt;CACHEBUSTER&percnt;&percnt;’&comma; ‘widgetLoaded’&rpar;&semi;&NewLine;&rsqb;&rsqb;><&sol;script><&excl;– End User Code –><script class&equals;»lazy-style» type&equals;»css»><&excl;&lbrack;CDATA&lbrack;&NewLine; &NewLine; body&period;tp-modal-open &period;pushwoosh-subscribe-widget&lowbar;&lowbar;bell-button&lbrace;display&colon;none&rcub;h1&period;vf-client-settings-form-profile-header&lbrace;display&colon;none&excl;important&rcub;&period;viafoura &period;vf-flex-container&lbrace;display&colon;none&excl;important&rcub;&commat;media &lpar;min-width&colon;1280px&rpar;&lbrace;&period;sticky-banner-wrapper&lbrace;position&colon;relative&rcub;&period;ad–billboard&lbrace;position&colon;sticky&semi;top&colon;0&semi;z-index&colon;10&semi;background-color&colon;white&rcub;ad-slot&lbrack;position&Hat;&equals;»billboard»&rsqb;&lbrace;position&colon;sticky&semi;top&colon;0&semi;z-index&colon;10&semi;display&colon;block&semi;background-color&colon;white&rcub;&rcub;&commat;media &lpar;min-width&colon;767px&rpar;&lbrace;&period;more-from-gbn&lbrace;position&colon;relative&semi;font-size&colon;24px&semi;font-weight&colon;700&semi;line-height&colon;24px&semi;margin-top&colon;20px&semi;padding&colon;15px 20px&semi;color&colon;&num;000f55&semi;background-color&colon;&num;F5F5F5&rcub;&period;more-from-gbn&colon;after&lbrace;content&colon;»»&semi;position&colon;absolute&semi;bottom&colon;0&semi;max-width&colon;96&percnt;&semi;height&colon;1px&semi;background&colon;&num;000f55&semi;left&colon;16px&semi;right&colon;16px&rcub;&rcub;&commat;media &lpar;max-width&colon;767px&rpar;&lbrace;&period;more-from-gbn&lbrace;position&colon;relative&semi;font-size&colon;24px&semi;font-weight&colon;700&semi;line-height&colon;24px&semi;margin-top&colon;20px&semi;color&colon;&num;000f55&semi;background-color&colon;&num;F5F5F5&semi;padding-top&colon;40px&semi;padding-left&colon;10px&semi;padding-bottom&colon;20px&rcub;&period;more-from-gbn&colon;before&lbrace;content&colon;»»&semi;position&colon;absolute&semi;height&colon;1px&semi;background&colon;&num;000f55&semi;max-width&colon;96&percnt;&semi;left&colon;10px&semi;margin-bottom&colon;15px&semi;bottom&colon;40px&semi;right&colon;10px&rcub;&rcub;&NewLine;&NewLine; &rsqb;&rsqb;><&sol;script><script class&equals;»rm-i-script» id&equals;»user-javascript-medium-normal»><&excl;&lbrack;CDATA&lbrack;&NewLine; window&period;REBELMOUSE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function loadFonts&lpar;&rpar;&lbrace;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; 1&period; Update OB&lowbar;ContextKeyValue&NewLine;&sol;&sol; window&period;OB&lowbar;ContextKeyValue &equals; window&period;gbnConfig&period;dataLayer&period;cd30&semi;&NewLine;&sol;&sol; let ob&lowbar;script &equals; document&period;createElement&lpar;’script’&rpar;&NewLine;&sol;&sol; ob&lowbar;script&period;innerHTML &equals; «window&period;OB&lowbar;ContextKeyValue&equals;»&plus;window&period;gbnConfig&period;dataLayer&period;cd30&semi;&NewLine;&sol;&sol; document&period;body&period;appendChild&lpar;ob&lowbar;script&rpar;&NewLine;&NewLine;&NewLine;&sol;&sol; &sol;&sol; 2&period; Update testVariant&NewLine;&sol;&sol; window&period;testVariant &equals; window&period;gbnConfig&period;dataLayer&period;cd30&semi;&NewLine;&NewLine;&NewLine;&NewLine;&sol;&sol; 3&period; Update contentType&NewLine;function getContentType&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; Ensure dataLayer exists&NewLine; window&period;dataLayer &equals; window&period;dataLayer &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine; &sol;&sol; Find the last object in dataLayer that has a cd10 property&NewLine; for &lpar;let i &equals; window&period;dataLayer&period;length – 1&semi; i >&equals; 0&semi; i–&rpar; &lbrace;&NewLine; if &lpar;window&period;dataLayer&lbrack;i&rsqb;&period;cd10&rpar; &lbrace;&NewLine; return window&period;dataLayer&lbrack;i&rsqb;&period;cd10&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; return ‘not set’&semi;&NewLine;&rcub;&NewLine;window&period;contentType &equals; getContentType&lpar;&rpar;&semi;&NewLine;&NewLine;&NewLine;&NewLine;&sol;&sol; 4&period; Update contentSection&NewLine;function getContentSection&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; Ensure dataLayer exists&NewLine; window&period;dataLayer &equals; window&period;dataLayer &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine; &sol;&sol; Find the last object in dataLayer that has a cd9 property&NewLine; for &lpar;let i &equals; window&period;dataLayer&period;length – 1&semi; i >&equals; 0&semi; i–&rpar; &lbrace;&NewLine; if &lpar;window&period;dataLayer&lbrack;i&rsqb;&period;cd9&rpar; &lbrace;&NewLine; return window&period;dataLayer&lbrack;i&rsqb;&period;cd9&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; return ‘not set’&semi;&NewLine;&rcub;&NewLine;window&period;contentSection &equals; getContentSection&lpar;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; function getEventDescription&lpar;event&rpar; &lbrace;&NewLine; switch &lpar;event&rpar; &lbrace;&NewLine; case «GBN&lowbar;MEM&lowbar;005&lowbar;M»&colon;&NewLine; return &lbrace; description&colon; «GBN Membership &pound&semi;5 Monthly»&comma; price&colon; 5&period;00 &rcub;&semi;&NewLine; case «GBN&lowbar;MEM&lowbar;010&lowbar;M»&colon;&NewLine; return &lbrace; description&colon; «GBN Membership &pound&semi;10 Monthly»&comma; price&colon; 10&period;00 &rcub;&semi;&NewLine; case «GBN&lowbar;MEM&lowbar;020&lowbar;M»&colon;&NewLine; return &lbrace; description&colon; «GBN Membership &pound&semi;20 Monthly»&comma; price&colon; 20&period;00 &rcub;&semi;&NewLine; case «GBN&lowbar;MEM&lowbar;054&lowbar;Y»&colon;&NewLine; return &lbrace; description&colon; «GBN Membership &pound&semi;54 Yearly»&comma; price&colon; 54&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;MEM&lowbar;108&lowbar;Y»&colon;&NewLine; return &lbrace; description&colon; «GBN Membership &pound&semi;108 Yearly»&comma; price&colon; 108&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;MEM&lowbar;216&lowbar;Y»&colon;&NewLine; return &lbrace; description&colon; «GBN Membership &pound&semi;216 Yearly»&comma; price&colon; 216&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;DON&lowbar;020&lowbar;O»&colon;&NewLine; return &lbrace; description&colon; «GBN Donation &pound&semi;20 – one off»&comma; price&colon; 20&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;DON&lowbar;050&lowbar;O»&colon;&NewLine; return &lbrace; description&colon; «GBN Donation &pound&semi;50 – one off»&comma; price&colon; 50&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;DON&lowbar;OTHER»&colon;&NewLine; return &lbrace; description&colon; «GBN Donation &ndash&semi; Other &lpar;custom amount&rpar;»&comma; price&colon; 0&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;GIFT&lowbar;MEM&lowbar;005&lowbar;M»&colon;&NewLine; return &lbrace; description&colon; «Gift Subscription for GBN Membership &pound&semi;5 Monthly»&comma; price&colon; 10&period;00 &rcub;&semi;&NewLine; case «GBN&lowbar;GIFT&lowbar;MEM&lowbar;010&lowbar;M»&colon;&NewLine; return &lbrace; description&colon; «Gift Subscription for GBN Membership &pound&semi;10 Monthly»&comma; price&colon; 10&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;GIFT&lowbar;MEM&lowbar;108&lowbar;Y»&colon;&NewLine; return &lbrace; description&colon; «Gift subscription for GBN Membership &pound&semi;108 Yearly»&comma; price&colon; 108&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;GIFT&lowbar;MEM&lowbar;120&lowbar;6M»&colon;&NewLine; return &lbrace; description&colon; «Gift subscription for GBN Membership &pound&semi;120 &lpar;6 months&rpar;»&comma; price&colon; 120&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;GIFT&lowbar;MEM&lowbar;020&lowbar;M»&colon;&NewLine; return &lbrace; description&colon; «Gift Subscription for GBN Membership &pound&semi;20 Monthly»&comma; price&colon; 20&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;GIFT&lowbar;MEM&lowbar;216&lowbar;Y»&colon;&NewLine; return &lbrace; description&colon; «Gift subscription for GBN Membership &pound&semi;216 Yearly»&comma; price&colon; 216&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;GIFT&lowbar;MEM&lowbar;030&lowbar;6M»&colon;&NewLine; return &lbrace; description&colon; «Gift subscription for GBN Membership &pound&semi;30 &lpar;6 months&rpar;»&comma; price&colon; 30&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;GIFT&lowbar;MEM&lowbar;054&lowbar;Y»&colon;&NewLine; return &lbrace; description&colon; «Gift subscription for GBN Membership &pound&semi;54 Yearly»&comma; price&colon; 54&period;00 &rcub;&semi;&semi;&NewLine; case «GBN&lowbar;GIFT&lowbar;MEM&lowbar;060&lowbar;6M»&colon;&NewLine; return &lbrace; description&colon; «Gift subscription for GBN Membership &pound&semi;60 &lpar;6 months&rpar;»&comma; price&colon; 60&period;00 &rcub;&semi;&semi;&NewLine; &rcub;&NewLine; return «Unknown event&period;»&semi;&NewLine;&rcub;&NewLine;&NewLine;&NewLine;window&period;tp &equals; window&period;tp &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&sol;&sol; AddToBasket event&NewLine;tp&period;push&lpar;&lbrack;»addHandler»&comma; «registrationSuccess»&comma; function &lpar;data&rpar; &lbrace;&NewLine; console&period;log&lpar;’registrationSuccess fired’&rpar;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; event&colon; «AddToCart»&comma;&NewLine; value&colon; 5&period;00&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&rsqb;&rpar;&semi;&NewLine;&NewLine;&sol;&sol; Show offer event&NewLine;let showOfferShown &equals; 0&semi;&NewLine;tp&period;push&lpar;&lbrack;»addHandler»&comma; «showOffer»&comma; function &lpar;data&rpar; &lbrace;&NewLine; if &lpar;showOfferShown &equals;&equals; 0&rpar; &lbrace;&NewLine; console&period;log&lpar;’showOffer fired’&rpar;&NewLine; const page &equals; window&period;location&period;pathname&semi;&NewLine; if &lpar;page &equals;&equals;&equals; ‘&sol;support’&rpar; &lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; event&colon; «fb&period;event»&comma;&NewLine; fb&lowbar;event&lowbar;type&colon; «viewContent»&comma;&NewLine; fb&lowbar;content&lowbar;name&colon; «GB News Membership Options»&comma;&NewLine; fb&lowbar;currency&colon; «GBP»&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; else if &lpar;page &equals;&equals;&equals; ‘&sol;gifting’&rpar; &lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; event&colon; «fb&period;event»&comma;&NewLine; fb&lowbar;event&lowbar;type&colon; «viewContent»&comma;&NewLine; fb&lowbar;content&lowbar;name&colon; «GB News Gifting Options»&comma;&NewLine; fb&lowbar;currency&colon; «GBP»&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; else if &lpar;page &equals;&equals;&equals; ‘&sol;donate’&rpar; &lbrace;&NewLine;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; event&colon; «fb&period;event»&comma;&NewLine; fb&lowbar;event&lowbar;type&colon; «viewContent»&comma;&NewLine; fb&lowbar;content&lowbar;name&colon; «GB News Donation Options»&comma;&NewLine; fb&lowbar;currency&colon; «GBP»&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; handle other pages&NewLine; &rcub;&NewLine;&NewLine; showOfferShown &equals; 1&semi;&NewLine; &rcub;&NewLine;&rcub;&rsqb;&rpar;&semi;&NewLine;&NewLine;&sol;&sol;offer button clicks&NewLine;tp&period;push&lpar;&lbrack;’addHandler’&comma; ‘customEvent’&comma; function&lpar;event&rpar;&NewLine; &lbrace;&NewLine; if &lpar;event&period;experienceActionId&period;includes&lpar;»showOffer»&rpar;&rpar; &lbrace;&NewLine; console&period;log&lpar;’milos’&comma; event&rpar;&semi;&NewLine; let eventName &equals; event&period;eventName&semi;&NewLine; let eventDescription &equals; getEventDescription&lpar;eventName&rpar;&semi;&NewLine; if&lpar;eventDescription&period;description &excl;&equals;&equals; «Unknown event&period;»&rpar; &lbrace;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; event&colon; «fb&period;event»&comma;&NewLine; fb&lowbar;event&lowbar;type&colon; «initiateCheckout»&comma;&NewLine; fb&lowbar;content&lowbar;name&colon; eventDescription&period;description&comma;&NewLine; fb&lowbar;content&lowbar;ids&colon; &lbrack;eventName&rsqb;&comma;&NewLine; fb&lowbar;currency&colon; «GBP»&comma;&NewLine; fb&lowbar;value&colon; eventDescription&period;price&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&rsqb;&rpar;&semi;&NewLine;&NewLine;&sol;&sol; Checkout event&NewLine;&sol;&sol; tp&period;push&lpar;&lbrack;»addHandler»&comma; «startCheckout»&comma; function &lpar;&rpar; &lbrace;&NewLine;&sol;&sol; console&period;log&lpar;’startCheckout fired’&rpar;&NewLine;&NewLine;&sol;&sol; dataLayer&period;push&lpar;&lbrace;&NewLine;&sol;&sol; event&colon; «InitiateCheckout»&comma;&NewLine;&sol;&sol; value&colon; 5&period;00&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rsqb;&rpar;&semi;&NewLine;&NewLine;&sol;&sol; Purchase event&NewLine;tp&period;push&lpar;&lbrack;»addHandler»&comma; «checkoutComplete»&comma; function &lpar;conversion&rpar; &lbrace;&NewLine; console&period;log&lpar;’checkoutComplete fired’&rpar;&NewLine; let eventDescription &equals; getEventDescription&lpar;conversion&period;termId&rpar;&semi;&NewLine; dataLayer&period;push&lpar;&lbrace;&NewLine; event&colon; «fb&period;event»&comma;&NewLine; fb&lowbar;event&lowbar;type&colon; «purchase»&comma;&NewLine; fb&lowbar;content&lowbar;name&colon; eventDescription&period;description&comma;&NewLine; fb&lowbar;content&lowbar;ids&colon; &lbrack;conversion&period;termId&rsqb;&comma;&NewLine; fb&lowbar;currency&colon; «GBP»&comma;&NewLine; fb&lowbar;value&colon; conversion&period;chargeAmount&comma;&NewLine; fb&lowbar;transaction&lowbar;id&colon; conversion&period;paymentId&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&rsqb;&rpar;&semi;&NewLine;&NewLine;console&period;log&lpar;»tp handlers registered&period;»&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; console&period;log&lpar;»POST PAGE &equals; TRUE OR PAGE&period;SECTION AND PAGE&period;SECTION&period;URL»&rpar;&NewLine;&NewLine;&NewLine;&NewLine;&NewLine; console&period;log&lpar;»context&period;page&period;section»&rpar;&NewLine; &sol;&sol; &NewLine; &sol;&sol; var sectionv2 &equals; «news»&NewLine; &sol;&sol; console&period;log&lpar;sectionv2&rpar;&NewLine; &sol;&sol; console&period;log&lpar;»»&rpar;&NewLine; var pri&lowbar;nav&lowbar;items&equals;document&period;querySelectorAll&lpar;’&period;navbar &period;nav &period;text-element a’&rpar;&semi;&NewLine; var sec&lowbar;nav&lowbar;items&equals;document&period;querySelectorAll&lpar;’&period;navbar &period;secondary–nav &period;list a’&rpar;&semi;&NewLine;&NewLine; &NewLine;&NewLine; &sol;&sol;&sol;aaa ssss&NewLine; &NewLine; &NewLine; &NewLine; console&period;log&lpar;»3″&rpar;&NewLine;&Tab; &NewLine; &NewLine; &NewLine; var sections&lowbar;list&equals;&lbrack;’news’&rsqb;&semi;&NewLine; var is&lowbar;pri&lowbar;act&lowbar;set &equals; false&semi;&NewLine; var is&lowbar;sec&lowbar;act&lowbar;set &equals; false&semi;&NewLine; var is&lowbar;section&lowbar;page&equals;false&semi;&NewLine; &NewLine;&NewLine;for &lpar;var el of pri&lowbar;nav&lowbar;items&rpar; &lbrace;&NewLine; &sol;&sol;console&period;log&lpar;»this is test» &plus; is&lowbar;pri&lowbar;act&lowbar;set&rpar;&semi;&NewLine; &sol;&sol;console&period;log&lpar;»this is test» &plus; is&lowbar;section&lowbar;page&rpar;&semi;&NewLine; &sol;&sol;is&lowbar;pri&lowbar;act&lowbar;set && &NewLine; const domainName &equals; &grave;https&colon;&sol;&sol;&dollar;&lbrace;window&period;location&period;host&rcub;&grave;&semi;&NewLine;&NewLine; if &lpar;el&period;href&period;replace&lpar;domainName&comma;»&rpar;&period;toLowerCase&lpar;&rpar;&period;indexOf&lpar;sections&lowbar;list&lbrack;0&rsqb;&period;toLowerCase&lpar;&rpar;&rpar; &excl;&equals; -1&rpar; &lbrace;&NewLine; &NewLine;&NewLine; is&lowbar;pri&lowbar;act&lowbar;set &equals; true&semi;&NewLine; el&period;closest&lpar;’&period;nav–item’&rpar;&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; break&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;if &lpar;&excl;is&lowbar;pri&lowbar;act&lowbar;set&rpar; &lbrace;&NewLine; &NewLine; for &lpar;var el of sec&lowbar;nav&lowbar;items&rpar; &lbrace;&NewLine; &NewLine; if &lpar;el&period;href&period;toLowerCase&lpar;&rpar;&period;indexOf&lpar;sections&lowbar;list&lbrack;0&rsqb;&period;toLowerCase&lpar;&rpar;&rpar; &excl;&equals; -1&rpar; &lbrace;&NewLine;&NewLine; is&lowbar;sec&lowbar;act&lowbar;set &equals; true&semi;&NewLine; is&lowbar;pri&lowbar;act&lowbar;set &equals; true&semi;&NewLine; el&period;closest&lpar;’&period;nav–item’&rpar;&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; el&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; break&semi;&NewLine; &rcub;&NewLine; &NewLine; var el&lowbar;href&equals;el&period;href&period;replace&lpar;window&period;location&period;origin&comma;»»&rpar;&semi;&NewLine; var win&lowbar;href&equals;window&period;location&period;pathname&semi;&NewLine; if&lpar;el&lowbar;href&lbrack;el&lowbar;href&period;length-1&rsqb;&equals;&equals;»&sol;»&rpar;&lbrace;&NewLine; el&lowbar;href&equals;el&lowbar;href&period;slice&lpar;0&comma;-1&rpar;&semi;&NewLine; &rcub;&NewLine; if&lpar;win&lowbar;href&lbrack;win&lowbar;href&period;length-1&rsqb;&equals;&equals;»&sol;»&rpar;&lbrace;&NewLine; win&lowbar;href&equals;win&lowbar;href&period;slice&lpar;0&comma;-1&rpar;&semi;&NewLine; &rcub;&NewLine; &Tab; if &lpar;el&lowbar;href&period;toLowerCase&lpar;&rpar;&equals;&equals;win&lowbar;href&period;toLowerCase&lpar;&rpar;&rpar; &lbrace;&NewLine; &sol;&sol;debugger&semi;&NewLine; is&lowbar;sec&lowbar;act&lowbar;set &equals; true&semi;&NewLine; is&lowbar;sec&lowbar;act&lowbar;set &equals; true&semi;&NewLine; el&period;closest&lpar;’&period;nav–item’&rpar;&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; el&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; break&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&rcub;&NewLine;else if &lpar;is&lowbar;pri&lowbar;act&lowbar;set && is&lowbar;section&lowbar;page&rpar;&lbrace;&NewLine; &NewLine; &NewLine; &NewLine; sec&lowbar;nav&lowbar;items &equals; document&period;querySelectorAll&lpar;’&period;nav–item&period;active &period;secondary–nav &period;list a’&rpar;&semi;&NewLine; for &lpar;var el of sec&lowbar;nav&lowbar;items&rpar; &lbrace;&NewLine; var el&lowbar;href&equals;el&period;href&period;replace&lpar;window&period;location&period;origin&comma;»»&rpar;&semi;&NewLine; var win&lowbar;href&equals;window&period;location&period;pathname&semi;&NewLine; if&lpar;el&lowbar;href&lbrack;el&lowbar;href&period;length-1&rsqb;&equals;&equals;»&sol;»&rpar;&lbrace;&NewLine; el&lowbar;href&equals;el&lowbar;href&period;slice&lpar;0&comma;-1&rpar;&semi;&NewLine; &rcub;&NewLine; if&lpar;win&lowbar;href&lbrack;win&lowbar;href&period;length-1&rsqb;&equals;&equals;»&sol;»&rpar;&lbrace;&NewLine; win&lowbar;href&equals;win&lowbar;href&period;slice&lpar;0&comma;-1&rpar;&semi;&NewLine; &rcub;&NewLine; &Tab; if &lpar;el&lowbar;href&period;toLowerCase&lpar;&rpar;&equals;&equals;win&lowbar;href&period;toLowerCase&lpar;&rpar;&rpar; &lbrace;&NewLine; is&lowbar;sec&lowbar;act&lowbar;set &equals; true&semi;&NewLine; el&period;closest&lpar;’&period;nav–item’&rpar;&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; el&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; break&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;&NewLine;if&lpar;is&lowbar;pri&lowbar;act&lowbar;set && is&lowbar;sec&lowbar;act&lowbar;set&rpar; return&semi;&NewLine;&NewLine;&NewLine;&NewLine;var active&lowbar;channel &equals; document&period;querySelector&lpar;’&period;navbar &period;nav–item&period;active’&rpar;&semi;&NewLine;var post&lowbar;sections&equals;»news&comma;news&sol;sgg&comma;content-type&sol;article&comma;news&sol;uk&sol;east-midlands&comma;editorial&sol;homepage-top20&comma;content-type&comma;editorial&sol;dont-miss-articles&comma;news&sol;uk»&period;split&lpar;’&comma;’&rpar;&semi; &NewLine;if &lpar;active&lowbar;channel&rpar; &lbrace;&NewLine; var breaker&equals;false&NewLine; sec&lowbar;nav&lowbar;items &equals; active&lowbar;channel&period;querySelectorAll&lpar;’&period;secondary–nav &period;list a’&rpar;&semi;&NewLine; &NewLine; for &lpar;el of sec&lowbar;nav&lowbar;items&rpar; &lbrace;&NewLine; let windowHrf&equals;window&period;location&period;href&semi;&NewLine; if&lpar;el&period;href&period;toLowerCase&lpar;&rpar;&equals;&equals;windowHrf&period;split&lpar;’&quest;’&rpar;&lbrack;0&rsqb;&period;toLowerCase&lpar;&rpar;&rpar;&lbrace;&NewLine; el&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; breaker&equals;true&semi;&NewLine; break&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; if &lpar;breaker&rpar; return&semi;&NewLine; &NewLine; if &lpar;breaker&rpar; return&semi;&NewLine;&NewLine; &sol;&sol; var topic &equals; post&lowbar;sections&period;find&lpar;a &equals;> a&period;includes&lpar;sections&lowbar;list&lbrack;0&rsqb; &plus; «&sol;»&rpar;&rpar;&semi;&NewLine;&Tab;&NewLine; &NewLine; for &lpar;el of sec&lowbar;nav&lowbar;items&rpar; &lbrace;&NewLine; &sol;&sol;debugger&semi;&NewLine; breaker&equals;false&NewLine; var hrf &equals; el&period;href&semi;&NewLine; post&lowbar;sections&period;forEach&lpar;function&lpar;sec&lowbar;url&rpar; &lbrace;&NewLine; if &lpar;hrf&period;toLowerCase&lpar;&rpar;&period;indexOf&lpar;sec&lowbar;url&period;toLowerCase&lpar;&rpar;&rpar; &excl;&equals; -1 && sec&lowbar;url&period;toLowerCase&lpar;&rpar;&period;includes&lpar;post&lowbar;sections&lbrack;0&rsqb;&period;toLowerCase&lpar;&rpar;&plus;»&sol;»&rpar;&rpar; &lbrace;&NewLine; el&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; breaker&equals;true&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine;&Tab;if &lpar;breaker&rpar; break&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine; else &lbrace;&NewLine; for &lpar;el of sec&lowbar;nav&lowbar;items&rpar; &lbrace;&NewLine; let windowHrf&equals;window&period;location&period;href&semi;&NewLine; if&lpar;el&period;href&period;toLowerCase&lpar;&rpar;&equals;&equals;windowHrf&period;split&lpar;’&quest;’&rpar;&lbrack;0&rsqb;&period;toLowerCase&lpar;&rpar;&rpar;&lbrace;&NewLine; el&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; el&period;closest&lpar;’nav–item’&rpar;&quest;l&period;closest&lpar;’nav–item’&rpar;&period;classList&period;add&lpar;’active’&rpar;&colon;»»&semi;&NewLine; breaker&equals;true&semi;&NewLine; break&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; &sol;&sol; Scroll position for primary navigation&NewLine;&sol;&sol; const isMobile &equals; window&period;innerWidth <&equals; 768&semi;&NewLine;&NewLine;&sol;&sol; let menuButtonSize &equals; 0&semi;&NewLine;&sol;&sol; const menuButton &equals; document&period;querySelector&lpar;’&period;navbar &period;nav &period;sticky-left-click’&rpar;&semi;&NewLine;&NewLine;&sol;&sol; if &lpar;menuButton&rpar; &lbrace;&NewLine;&sol;&sol; menuButtonSize &equals; menuButton&period;getBoundingClientRect&lpar;&rpar;&period;width&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; var doc&lowbar;body &equals; document&period;body&semi;&NewLine;&sol;&sol; var pri&lowbar;nav &equals; document&period;querySelector&lpar;’&period;navbar &period;nav’&rpar;&semi;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Checking active primary menu item and calculating left scroll for the navigation&NewLine;&sol;&sol; if &lpar;isMobile&rpar; &lbrace;&NewLine;&sol;&sol; const activeMenuItem &equals; document&period;querySelector&lpar;’&period;navbar &period;nav &period;nav–item&period;active’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;activeMenuItem&rpar; &lbrace;&NewLine;&sol;&sol; const activeMenuItemLeftPosition &equals; activeMenuItem&period;offsetLeft&semi;&NewLine;&NewLine;&sol;&sol; const navigation &equals; document&period;querySelector&lpar;’&period;navbar &period;nav’&rpar;&semi;&NewLine;&sol;&sol; const navigationComputedStyles &equals; window&period;getComputedStyle&lpar;navigation&rpar;&semi;&NewLine;&sol;&sol; const marginLeft &equals; parseInt&lpar;navigationComputedStyles&period;getPropertyValue&lpar;’margin-left’&rpar;&rpar;&semi;&NewLine; &NewLine;&sol;&sol; pri&lowbar;nav&period;scrollLeft &equals; activeMenuItemLeftPosition – marginLeft – menuButtonSize&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub; else if &lpar;window&period;sessionStorage&period;getItem&lpar;»pri&lowbar;nav&lowbar;pos»&rpar;&rpar; &lbrace;&NewLine;&sol;&sol; pri&lowbar;nav&period;scrollLeft &equals; window&period;sessionStorage&period;getItem&lpar;»pri&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; The logic for the secondary menu wasn’t changed&NewLine;&sol;&sol; if &lpar;window&period;sessionStorage&period;getItem&lpar;»sec&lowbar;nav&lowbar;pos»&rpar; && window&period;sessionStorage&period;getItem&lpar;»sec&lowbar;nav&lowbar;wrap»&rpar;&rpar; &lbrace;&NewLine;&sol;&sol; var scrolli&lowbar;&lowbar;item &equals; document&period;querySelector&lpar;’&period;’&plus;window&period;sessionStorage&period;getItem&lpar;»sec&lowbar;nav&lowbar;wrap»&rpar;&plus;’ &period;list’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;scrolli&lowbar;&lowbar;item&rpar; &lbrace;&NewLine;&sol;&sol; scrolli&lowbar;&lowbar;item&period;scrollLeft &equals; window&period;sessionStorage&period;getItem&lpar;»sec&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; var pri&lowbar;nav&lowbar;items &equals; pri&lowbar;nav&period;querySelectorAll&lpar;’a’&rpar;&semi;&NewLine;&sol;&sol; var sec&lowbar;nav&lowbar;items &equals; document&period;querySelectorAll&lpar;’&period;navbar &period;secondary–nav a’&rpar;&semi;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Function to restore active navigation states after page reload&NewLine;&sol;&sol; function restoreActiveNavigation&lpar;&rpar; &lbrace;&NewLine;&sol;&sol; &sol;&sol; Restore active primary nav item&NewLine;&sol;&sol; const activePriNavItem &equals; sessionStorage&period;getItem&lpar;’active&lowbar;pri&lowbar;nav&lowbar;item’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;activePriNavItem&rpar; &lbrace;&NewLine;&sol;&sol; const priElement &equals; document&period;querySelector&lpar;&grave;&lbrack;data-pri-nav-id&equals;»&dollar;&lbrace;activePriNavItem&rcub;»&rsqb;&grave;&rpar;&semi;&NewLine;&sol;&sol; if &lpar;priElement&rpar; &lbrace;&NewLine;&sol;&sol; &sol;&sol; Remove active class from all primary nav items first&NewLine;&sol;&sol; document&period;querySelectorAll&lpar;’&period;navbar &period;nav &period;nav–item’&rpar;&period;forEach&lpar;el &equals;> &lbrace;&NewLine;&sol;&sol; el&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; priElement&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; console&period;log&lpar;’Restored active class to primary nav&colon;’&comma; priElement&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Restore active secondary nav item&NewLine;&sol;&sol; const activeSecNavItem &equals; sessionStorage&period;getItem&lpar;’active&lowbar;sec&lowbar;nav&lowbar;item’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;activeSecNavItem&rpar; &lbrace;&NewLine;&sol;&sol; const secElement &equals; document&period;querySelector&lpar;&grave;&lbrack;data-sec-nav-id&equals;»&dollar;&lbrace;activeSecNavItem&rcub;»&rsqb;&grave;&rpar;&semi;&NewLine;&sol;&sol; if &lpar;secElement&rpar; &lbrace;&NewLine;&sol;&sol; &sol;&sol; Remove active class from all secondary nav items first&NewLine;&sol;&sol; document&period;querySelectorAll&lpar;’&period;navbar &period;secondary–nav &period;list&lowbar;&lowbar;item’&rpar;&period;forEach&lpar;el &equals;> &lbrace;&NewLine;&sol;&sol; el&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; secElement&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; console&period;log&lpar;’Restored active class to secondary nav&colon;’&comma; secElement&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Add unique identifiers to navigation items&NewLine;&sol;&sol; function initializeNavigationIds&lpar;&rpar; &lbrace;&NewLine;&sol;&sol; &sol;&sol; Add IDs to primary nav items&NewLine;&sol;&sol; pri&lowbar;nav&lowbar;items&period;forEach&lpar;function&lpar;item&comma; index&rpar; &lbrace;&NewLine;&sol;&sol; const navItem &equals; item&period;closest&lpar;’&period;nav–item’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;navItem && &excl;navItem&period;hasAttribute&lpar;’data-pri-nav-id’&rpar;&rpar; &lbrace;&NewLine;&sol;&sol; navItem&period;setAttribute&lpar;’data-pri-nav-id’&comma; &grave;pri-nav-&dollar;&lbrace;index&rcub;&grave;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Add IDs to secondary nav items&NewLine;&sol;&sol; sec&lowbar;nav&lowbar;items&period;forEach&lpar;function&lpar;item&comma; index&rpar; &lbrace;&NewLine;&sol;&sol; if &lpar;&excl;item&period;hasAttribute&lpar;’data-sec-nav-id’&rpar;&rpar; &lbrace;&NewLine;&sol;&sol; item&period;setAttribute&lpar;’data-sec-nav-id’&comma; &grave;sec-nav-&dollar;&lbrace;index&rcub;&grave;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Primary navigation click handlers&NewLine;&sol;&sol; pri&lowbar;nav&lowbar;items&period;forEach&lpar;function&lpar;item&rpar; &lbrace;&NewLine;&sol;&sol; item&period;onclick &equals; function&lpar;event&rpar; &lbrace;&NewLine;&sol;&sol; console&period;log&lpar;’Primary nav clicked&colon;’&comma; event&period;target&rpar;&semi;&NewLine; &NewLine;&sol;&sol; const navItem &equals; event&period;target&period;closest&lpar;’&period;nav–item’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;navItem&rpar; &lbrace;&NewLine;&sol;&sol; &sol;&sol; Remove active class from all primary nav items&NewLine;&sol;&sol; document&period;querySelectorAll&lpar;’&period;navbar &period;nav &period;nav–item’&rpar;&period;forEach&lpar;el &equals;> &lbrace;&NewLine;&sol;&sol; el&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Add active class to clicked primary nav item&NewLine;&sol;&sol; navItem&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Save active primary nav item to sessionStorage&NewLine;&sol;&sol; const priNavId &equals; navItem&period;getAttribute&lpar;’data-pri-nav-id’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;priNavId&rpar; &lbrace;&NewLine;&sol;&sol; sessionStorage&period;setItem&lpar;’active&lowbar;pri&lowbar;nav&lowbar;item’&comma; priNavId&rpar;&semi;&NewLine;&sol;&sol; console&period;log&lpar;’Saved active primary nav item&colon;’&comma; priNavId&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Clear secondary nav active state when primary nav changes&NewLine;&sol;&sol; sessionStorage&period;removeItem&lpar;’active&lowbar;sec&lowbar;nav&lowbar;item’&rpar;&semi;&NewLine;&sol;&sol; document&period;querySelectorAll&lpar;’&period;navbar &period;secondary–nav &period;list&lowbar;&lowbar;item’&rpar;&period;forEach&lpar;el &equals;> &lbrace;&NewLine;&sol;&sol; el&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Original sessionStorage handling&NewLine;&sol;&sol; sessionStorage&period;removeItem&lpar;»pri&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine;&sol;&sol; sessionStorage&period;removeItem&lpar;»sec&lowbar;nav&lowbar;wrap»&rpar;&semi;&NewLine;&sol;&sol; sessionStorage&period;removeItem&lpar;»sec&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine;&sol;&sol; window&period;sessionStorage&period;setItem&lpar;»pri&lowbar;nav&lowbar;pos»&comma; pri&lowbar;nav&period;scrollLeft&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Secondary navigation click handlers &lpar;your existing code with modifications&rpar;&NewLine;&sol;&sol; sec&lowbar;nav&lowbar;items&period;forEach&lpar;function&lpar;item&rpar; &lbrace;&NewLine;&sol;&sol; item&period;onclick &equals; function&lpar;event&rpar; &lbrace;&NewLine;&sol;&sol; const target &equals; event&period;target&semi;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Remove active class from all secondary nav items in current menu&NewLine;&sol;&sol; const currentSecondaryNav &equals; target&period;closest&lpar;’&period;secondary–nav’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;currentSecondaryNav&rpar; &lbrace;&NewLine;&sol;&sol; currentSecondaryNav&period;querySelectorAll&lpar;’&period;list&lowbar;&lowbar;item’&rpar;&period;forEach&lpar;el &equals;> &lbrace;&NewLine;&sol;&sol; el&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Add active class to clicked secondary nav item&NewLine;&sol;&sol; target&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Save active secondary nav item to sessionStorage&NewLine;&sol;&sol; const secNavId &equals; target&period;getAttribute&lpar;’data-sec-nav-id’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;secNavId&rpar; &lbrace;&NewLine;&sol;&sol; sessionStorage&period;setItem&lpar;’active&lowbar;sec&lowbar;nav&lowbar;item’&comma; secNavId&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Reset primary nav active state &lpar;optional&comma; depending on your logic&rpar;&NewLine;&sol;&sol; document&period;querySelectorAll&lpar;’&period;navbar &period;nav &period;nav–item’&rpar;&period;forEach&lpar;el &equals;> &lbrace;&NewLine;&sol;&sol; el&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; sessionStorage&period;removeItem&lpar;’active&lowbar;pri&lowbar;nav&lowbar;item’&rpar;&semi;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Store scroll positions&NewLine;&sol;&sol; sessionStorage&period;removeItem&lpar;»sec&lowbar;nav&lowbar;wrap»&rpar;&semi;&NewLine;&sol;&sol; sessionStorage&period;removeItem&lpar;»sec&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine;&NewLine;&sol;&sol; const sec&lowbar;nav&lowbar;wrap &equals; target&period;closest&lpar;’&period;list’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;sec&lowbar;nav&lowbar;wrap&rpar; &lbrace;&NewLine;&sol;&sol; sessionStorage&period;setItem&lpar;»sec&lowbar;nav&lowbar;pos»&comma; sec&lowbar;nav&lowbar;wrap&period;scrollLeft&rpar;&semi;&NewLine;&NewLine;&sol;&sol; const navItem &equals; sec&lowbar;nav&lowbar;wrap&period;closest&lpar;’&period;nav–item’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;navItem && navItem&period;classList&lbrack;1&rsqb;&rpar; &lbrace;&NewLine;&sol;&sol; sessionStorage&period;setItem&lpar;»sec&lowbar;nav&lowbar;wrap»&comma; navItem&period;classList&lbrack;1&rsqb;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; sessionStorage&period;setItem&lpar;»pri&lowbar;nav&lowbar;pos»&comma; pri&lowbar;nav&period;scrollLeft&rpar;&semi;&NewLine;&sol;&sol; &rcub;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Hover effects for nav items&NewLine;&sol;&sol; document&period;querySelectorAll&lpar;’&period;nav–item’&rpar;&period;forEach&lpar;function&lpar;item&rpar; &lbrace;&NewLine;&sol;&sol; var timeout &equals; null&semi;&NewLine;&sol;&sol; var timeout2 &equals; null&semi;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Uncomment if you want hover effects&NewLine;&sol;&sol; &sol;&sol; item&period;onmouseover &equals; function&lpar;&rpar; &lbrace;&NewLine;&sol;&sol; &sol;&sol; timeout &equals; setTimeout&lpar;function&lpar;&rpar;&lbrace;&NewLine;&sol;&sol; &sol;&sol; item&period;classList&period;add&lpar;’hover&lowbar;active’&rpar;&NewLine;&sol;&sol; &sol;&sol; &rcub;&comma; 300&rpar;&semi;&NewLine;&sol;&sol; &sol;&sol; clearTimeout&lpar;timeout2&rpar;&semi;&NewLine;&sol;&sol; &sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; item&period;onmouseout &equals; function&lpar;&rpar; &lbrace;&NewLine;&sol;&sol; &sol;&sol; timeout2 &equals; setTimeout&lpar;function&lpar;&rpar;&lbrace;&NewLine;&sol;&sol; &sol;&sol; item&period;classList&period;remove&lpar;’hover&lowbar;active’&rpar;&NewLine;&sol;&sol; &sol;&sol; &rcub;&comma; 300&rpar;&semi;&NewLine;&sol;&sol; &sol;&sol; clearTimeout&lpar;timeout&rpar;&semi;&NewLine;&sol;&sol; &sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Initialize navigation system&NewLine;&sol;&sol; function initializeNavigation&lpar;&rpar; &lbrace;&NewLine;&sol;&sol; initializeNavigationIds&lpar;&rpar;&semi;&NewLine;&sol;&sol; restoreActiveNavigation&lpar;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Initialize when DOM is ready&NewLine;&sol;&sol; if &lpar;document&period;readyState &equals;&equals;&equals; ‘loading’&rpar; &lbrace;&NewLine;&sol;&sol; document&period;addEventListener&lpar;’DOMContentLoaded’&comma; initializeNavigation&rpar;&semi;&NewLine;&sol;&sol; &rcub; else &lbrace;&NewLine;&sol;&sol; initializeNavigation&lpar;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Opinion section scroll handling&NewLine;&sol;&sol; if &lpar;window&period;location&period;search&equals;&equals;»&quest;opinion»&rpar; &lbrace;&NewLine;&sol;&sol; const opinionWidget &equals; document&period;querySelector&lpar;’&period;opinion-wrapper &period;widget’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;opinionWidget&rpar; &lbrace;&NewLine;&sol;&sol; if &lpar;&sol;constructor&sol;i&period;test&lpar;window&period;HTMLElement&rpar; &vert;&vert; &lpar;function &lpar;p&rpar; &lbrace; return p&period;toString&lpar;&rpar; &equals;&equals;&equals; «&lbrack;object SafariRemoteNotification&rsqb;»&semi; &rcub;&rpar;&lpar;&excl;window&lbrack;’safari’&rsqb; &vert;&vert; &lpar;typeof safari &excl;&equals;&equals; ‘undefined’ && window&lbrack;’safari’&rsqb;&period;pushNotification&rpar;&rpar;&rpar; &lbrace;&NewLine;&sol;&sol; opinionWidget&period;scrollIntoView&lpar;true&rpar;&semi;&NewLine;&sol;&sol; &rcub; else if&lpar;typeof InstallTrigger &excl;&equals;&equals; ‘undefined’&rpar; &lbrace;&NewLine;&sol;&sol; opinionWidget&period;scrollIntoView&lpar;true&rpar;&semi;&NewLine;&sol;&sol; &rcub; else &lbrace;&NewLine;&sol;&sol; opinionWidget&period;scrollIntoView&lpar;&lbrace;&NewLine;&sol;&sol; block&colon; ‘nearest’&comma;&NewLine;&sol;&sol; behavior&colon; ‘smooth’&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Delay function for mouse interactions&NewLine;&sol;&sol; var delay &equals; function &lpar;elem&comma; callback&rpar; &lbrace;&NewLine;&sol;&sol; var timeout &equals; null&semi;&NewLine;&NewLine;&sol;&sol; elem&period;onmouseover &equals; function&lpar;&rpar; &lbrace;&NewLine;&sol;&sol; elem&period;classList&period;add&lpar;’shit’&rpar;&NewLine;&sol;&sol; &sol;&sol; Set timeout to be a timer which will invoke callback after 1s&NewLine;&sol;&sol; timeout &equals; setTimeout&lpar;callback&comma; 1000&rpar;&semi;&NewLine;&sol;&sol; &rcub;&semi;&NewLine;&NewLine;&sol;&sol; elem&period;onmouseout &equals; function&lpar;&rpar; &lbrace;&NewLine;&sol;&sol; doc&lowbar;body&period;classList&period;remove&lpar;’hide-sec&lowbar;nav’&rpar;&semi;&NewLine;&sol;&sol; clearTimeout&lpar;timeout&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; Scroll position for primary navigation&NewLine;&NewLine;function init&lpar;&rpar; &lbrace;&NewLine; const isMobile &equals; window&period;innerWidth <&equals; 768&semi; &NewLine; &NewLine; let menuButtonSize &equals; 0&semi;&NewLine; const menuButton &equals; document&period;querySelector&lpar;»&period;navbar &period;nav &period;sticky-left-click»&rpar;&semi;&NewLine;&NewLine; if &lpar;menuButton&rpar; &lbrace;&NewLine; menuButtonSize &equals; menuButton&period;getBoundingClientRect&lpar;&rpar;&period;width&semi;&NewLine; &rcub;&NewLine;&NewLine; var pri&lowbar;nav &equals; document&period;querySelector&lpar;»&period;navbar &period;nav»&rpar;&semi;&NewLine; var hamb&lowbar;nav &equals; document&period;querySelector&lpar;»&period;hamburger &period;nav»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Checking active primary menu item and calculating left scroll for the navigation&NewLine; const activeMenuItem &equals; document&period;querySelector&lpar;&NewLine; «&period;navbar &period;nav &period;nav–item&period;active»&NewLine; &rpar;&semi;&NewLine; &NewLine; if &lpar;activeMenuItem&rpar; &lbrace;&NewLine; const activeMenuItemLeftPosition &equals; activeMenuItem&period;offsetLeft&semi;&NewLine;&NewLine; const navigation &equals; document&period;querySelector&lpar;»&period;navbar &period;nav»&rpar;&semi;&NewLine; const navigationComputedStyles &equals; window&period;getComputedStyle&lpar;navigation&rpar;&semi;&NewLine; const marginLeft &equals; parseInt&lpar;&NewLine; navigationComputedStyles&period;getPropertyValue&lpar;»margin-left»&rpar;&NewLine; &rpar;&semi;&NewLine;&NewLine; pri&lowbar;nav&period;scrollLeft &equals;&NewLine; activeMenuItemLeftPosition – marginLeft – menuButtonSize&semi;&NewLine; &rcub;&NewLine;&NewLine; &NewLine; if &lpar;&excl;isMobile && window&period;sessionStorage&period;getItem&lpar;»pri&lowbar;nav&lowbar;pos»&rpar;&rpar; &lbrace;&NewLine; pri&lowbar;nav&period;scrollLeft &equals; window&period;sessionStorage&period;getItem&lpar;»pri&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; The logic for the secondary menu wasn’t changed&NewLine; if &lpar;&NewLine; window&period;sessionStorage&period;getItem&lpar;»sec&lowbar;nav&lowbar;pos»&rpar; &&&NewLine; window&period;sessionStorage&period;getItem&lpar;»sec&lowbar;nav&lowbar;wrap»&rpar;&NewLine; &rpar; &lbrace;&NewLine; var scrolli&lowbar;&lowbar;item &equals; document&period;querySelector&lpar;&NewLine; «&period;» &plus; window&period;sessionStorage&period;getItem&lpar;»sec&lowbar;nav&lowbar;wrap»&rpar; &plus; » &period;list»&NewLine; &rpar;&semi;&NewLine; if &lpar;scrolli&lowbar;&lowbar;item&rpar; &lbrace;&NewLine; scrolli&lowbar;&lowbar;item&period;scrollLeft &equals; window&period;sessionStorage&period;getItem&lpar;»sec&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; window&period;pri&lowbar;nav&lowbar;items &equals; pri&lowbar;nav&period;querySelectorAll&lpar;»a»&rpar;&semi;&NewLine; window&period;sec&lowbar;nav&lowbar;items &equals; document&period;querySelectorAll&lpar;»&period;navbar &period;secondary–nav a»&rpar;&semi;&NewLine; window&period;hamb&lowbar;nav&lowbar;items &equals; hamb&lowbar;nav&period;querySelectorAll&lpar;»a»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Primary navigation click handlers&NewLine; pri&lowbar;nav&lowbar;items&period;forEach&lpar;function &lpar;item&rpar; &lbrace;&NewLine; item&period;onclick &equals; function &lpar;event&rpar; &lbrace;&NewLine; console&period;log&lpar;»Primary nav clicked&colon;»&comma; event&period;target&rpar;&semi;&NewLine;&NewLine; const watchLive &equals; event&period;target&quest;&period;classList&period;contains&lpar;’watch-live-button’&rpar;&semi;&NewLine;&NewLine; const navItem &equals; event&period;target&period;closest&lpar;»&period;nav–item»&rpar;&semi;&NewLine; if &lpar;navItem&rpar; &lbrace;&NewLine; &sol;&sol; Remove active class from all primary nav items &lpar;both navbar and hamburger&rpar;&NewLine; document&period;querySelectorAll&lpar;»&period;navbar &period;nav &period;nav–item»&rpar;&period;forEach&lpar;&lpar;el&rpar; &equals;> &lbrace;&NewLine; el&period;classList&period;remove&lpar;»active»&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; document&NewLine; &period;querySelectorAll&lpar;»&period;hamburger &period;nav &period;nav–item»&rpar;&NewLine; &period;forEach&lpar;&lpar;el&rpar; &equals;> &lbrace;&NewLine; el&period;classList&period;remove&lpar;»active»&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Add active class to clicked primary nav item&NewLine; navItem&period;classList&period;add&lpar;»active»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Find corresponding item in hamburger menu and activate it&NewLine; const href &equals; item&period;getAttribute&lpar;»href»&rpar;&semi;&NewLine; const correspondingHamb &equals; Array&period;from&lpar;hamb&lowbar;nav&lowbar;items&rpar;&period;find&lpar;&NewLine; &lpar;a&rpar; &equals;> a&period;getAttribute&lpar;»href»&rpar; &equals;&equals;&equals; href&NewLine; &rpar;&semi;&NewLine;&NewLine; if &lpar;correspondingHamb&rpar; &lbrace;&NewLine; const corrHambNavItem &equals; correspondingHamb&period;closest&lpar;»&period;nav–item»&rpar;&semi;&NewLine; if &lpar;corrHambNavItem&rpar; &lbrace;&NewLine; corrHambNavItem&period;classList&period;add&lpar;»active»&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Save active primary nav item to sessionStorage&NewLine; const priNavId &equals; navItem&period;getAttribute&lpar;»data-pri-nav-id»&rpar;&semi;&NewLine; if &lpar;priNavId&rpar; &lbrace;&NewLine; if&lpar;watchLive&rpar;&lbrace;&NewLine; let watchChannelActive &equals; document&period;querySelector&lpar;’&period;nav–item&period;watch–channel&lowbar;&lowbar;active’&rpar;&semi;&NewLine; let activeMenuItemLeftPosition &equals; watchChannelActive&period;offsetLeft&semi;&NewLine; let navigation &equals; document&period;querySelector&lpar;»&period;navbar &period;nav»&rpar;&semi;&NewLine; let navigationComputedStyles &equals; window&period;getComputedStyle&lpar;navigation&rpar;&semi;&NewLine; let marginLeft &equals; parseInt&lpar;navigationComputedStyles&period;getPropertyValue&lpar;»margin-left»&rpar;&rpar;&semi;&NewLine;&NewLine; let targetScrollPosition &equals; activeMenuItemLeftPosition – marginLeft – menuButtonSize&semi;&NewLine; watchLiveLink &equals; document&period;querySelector&lpar;’&period;navbar &period;nav–item&period;watch–channel&lowbar;&lowbar;active’&rpar;&NewLine; watchLive&lowbar;navId &equals; watchLiveLink&period;getAttribute&lpar;»data-pri-nav-id»&rpar;&NewLine; watchLive&lowbar;secId &equals; watchLiveLink&period;querySelector&lpar;’&lbrack;aria-label&equals;»Live»&rsqb;’&rpar;&period;getAttribute&lpar;»data-sec-nav-id»&rpar;&NewLine; sessionStorage&period;setItem&lpar;»active&lowbar;pri&lowbar;nav&lowbar;item»&comma; watchLive&lowbar;navId&rpar;&semi;&NewLine; sessionStorage&period;setItem&lpar;»active&lowbar;sec&lowbar;nav&lowbar;item»&comma; watchLive&lowbar;secId&rpar;&semi;&NewLine; window&period;sessionStorage&period;setItem&lpar;»pri&lowbar;nav&lowbar;pos»&comma; targetScrollPosition&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; sessionStorage&period;setItem&lpar;»active&lowbar;pri&lowbar;nav&lowbar;item»&comma; priNavId&rpar;&semi;&NewLine; console&period;log&lpar;»Saved active primary nav item&colon;»&comma; priNavId&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Clear secondary nav active state when primary nav changes&NewLine; if&lpar;&excl;watchLive&rpar;&lbrace;&NewLine; sessionStorage&period;removeItem&lpar;»active&lowbar;sec&lowbar;nav&lowbar;item»&rpar;&semi;&NewLine; &rcub;&NewLine; document&NewLine; &period;querySelectorAll&lpar;»&period;navbar &period;secondary–nav &period;list&lowbar;&lowbar;item»&rpar;&NewLine; &period;forEach&lpar;&lpar;el&rpar; &equals;> &lbrace;&NewLine; el&period;classList&period;remove&lpar;»active»&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Original sessionStorage handling&NewLine; sessionStorage&period;removeItem&lpar;»pri&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine; sessionStorage&period;removeItem&lpar;»sec&lowbar;nav&lowbar;wrap»&rpar;&semi;&NewLine; sessionStorage&period;removeItem&lpar;»sec&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine; if&lpar;&excl;watchLive&rpar;&lbrace;&NewLine; window&period;sessionStorage&period;setItem&lpar;»pri&lowbar;nav&lowbar;pos»&comma; pri&lowbar;nav&period;scrollLeft&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Secondary navigation click handlers&NewLine; sec&lowbar;nav&lowbar;items&period;forEach&lpar;function &lpar;item&rpar; &lbrace;&NewLine; item&period;onclick &equals; function &lpar;event&rpar; &lbrace;&NewLine; const target &equals; event&period;target&semi;&NewLine;&NewLine; &sol;&sol; Remove active class from all secondary nav list&lowbar;&lowbar;items&NewLine; document&NewLine; &period;querySelectorAll&lpar;»&period;navbar &period;secondary–nav &period;list&lowbar;&lowbar;item»&rpar;&NewLine; &period;forEach&lpar;&lpar;el&rpar; &equals;> &lbrace;&NewLine; el&period;classList&period;remove&lpar;»active»&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Add active class to the closest &period;list&lowbar;&lowbar;item&NewLine; const listItem &equals; target&period;closest&lpar;»&period;list&lowbar;&lowbar;item»&rpar;&semi;&NewLine; if &lpar;listItem&rpar; &lbrace;&NewLine; listItem&period;classList&period;add&lpar;»active»&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Save active secondary nav item to sessionStorage&NewLine; const secNavId &equals; target&period;getAttribute&lpar;»data-sec-nav-id»&rpar;&semi;&NewLine; if &lpar;secNavId&rpar; &lbrace;&NewLine; sessionStorage&period;setItem&lpar;»active&lowbar;sec&lowbar;nav&lowbar;item»&comma; secNavId&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; KEEP primary nav active and save it &lpar;if it’s a sub-menu&rpar;&NewLine; const navItem &equals; target&period;closest&lpar;»&period;nav–item»&rpar;&semi;&NewLine; if &lpar;navItem&rpar; &lbrace;&NewLine; const priNavId &equals; navItem&period;getAttribute&lpar;»data-pri-nav-id»&rpar;&semi;&NewLine; if &lpar;priNavId&rpar; &lbrace;&NewLine; sessionStorage&period;setItem&lpar;»active&lowbar;pri&lowbar;nav&lowbar;item»&comma; priNavId&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Store scroll positions&NewLine; sessionStorage&period;removeItem&lpar;»sec&lowbar;nav&lowbar;wrap»&rpar;&semi;&NewLine; sessionStorage&period;removeItem&lpar;»sec&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine;&NewLine; const sec&lowbar;nav&lowbar;wrap &equals; target&period;closest&lpar;»&period;list»&rpar;&semi;&NewLine; if &lpar;sec&lowbar;nav&lowbar;wrap&rpar; &lbrace;&NewLine; sessionStorage&period;setItem&lpar;»sec&lowbar;nav&lowbar;pos»&comma; sec&lowbar;nav&lowbar;wrap&period;scrollLeft&rpar;&semi;&NewLine;&NewLine; const navItem &equals; sec&lowbar;nav&lowbar;wrap&period;closest&lpar;»&period;nav–item»&rpar;&semi;&NewLine; if &lpar;navItem && navItem&period;classList&lbrack;1&rsqb;&rpar; &lbrace;&NewLine; sessionStorage&period;setItem&lpar;»sec&lowbar;nav&lowbar;wrap»&comma; navItem&period;classList&lbrack;1&rsqb;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; sessionStorage&period;setItem&lpar;»pri&lowbar;nav&lowbar;pos»&comma; pri&lowbar;nav&period;scrollLeft&rpar;&semi;&NewLine; &rcub;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Watch Live button click handler &NewLine; const watchLiveButton &equals; document&period;querySelector&lpar;’&period;sticky-left &period;watch-live-button’&rpar;&semi;&NewLine; if &lpar;watchLiveButton&rpar; &lbrace;&NewLine; watchLiveButton&period;onclick &equals; function&lpar;event&rpar; &lbrace;&NewLine; console&period;log&lpar;’Watch Live button clicked&colon;’&comma; event&period;target&rpar;&semi;&NewLine; &NewLine; &sol;&sol; Find the nav–item with watch–channel&lowbar;&lowbar;active active classes&NewLine; const watchChannelActive &equals; document&period;querySelector&lpar;’&period;nav–item&period;watch–channel&lowbar;&lowbar;active&period;active’&rpar;&semi;&NewLine; if &lpar;watchChannelActive&rpar; &lbrace;&NewLine; &sol;&sol; Get the secondary navigation from this element&NewLine; const secondaryNav &equals; watchChannelActive&period;querySelector&lpar;’&period;secondary–nav’&rpar;&semi;&NewLine; if &lpar;secondaryNav&rpar; &lbrace;&NewLine; &sol;&sol; Find the active secondary nav item &lpar;Live&rpar;&NewLine; const activeSecondaryItem &equals; secondaryNav&period;querySelector&lpar;’&period;list&lowbar;&lowbar;item&period;active’&rpar;&semi;&NewLine; if &lpar;activeSecondaryItem&rpar; &lbrace;&NewLine; const secNavId &equals; activeSecondaryItem&period;getAttribute&lpar;’data-sec-nav-id’&rpar;&semi;&NewLine; if &lpar;secNavId&rpar; &lbrace;&NewLine; sessionStorage&period;setItem&lpar;’active&lowbar;sec&lowbar;nav&lowbar;item’&comma; secNavId&rpar;&semi;&NewLine; console&period;log&lpar;’Saved active secondary nav item from watch channel&colon;’&comma; secNavId&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Save the watch channel primary nav as active&NewLine; const priNavId &equals; watchChannelActive&period;getAttribute&lpar;’data-pri-nav-id’&rpar;&semi;&NewLine; if &lpar;priNavId&rpar; &lbrace;&NewLine; sessionStorage&period;setItem&lpar;’active&lowbar;pri&lowbar;nav&lowbar;item’&comma; priNavId&rpar;&semi;&NewLine; console&period;log&lpar;’Saved active primary nav item from watch channel&colon;’&comma; priNavId&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Store scroll positions for secondary nav&NewLine; const secNavList &equals; secondaryNav&period;querySelector&lpar;’&period;list’&rpar;&semi;&NewLine; if &lpar;secNavList&rpar; &lbrace;&NewLine; sessionStorage&period;setItem&lpar;»sec&lowbar;nav&lowbar;pos»&comma; secNavList&period;scrollLeft&rpar;&semi;&NewLine; &NewLine; if &lpar;watchChannelActive&period;classList&lbrack;1&rsqb;&rpar; &lbrace;&NewLine; sessionStorage&period;setItem&lpar;»sec&lowbar;nav&lowbar;wrap»&comma; watchChannelActive&period;classList&lbrack;1&rsqb;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Store primary nav scroll position&NewLine; sessionStorage&period;setItem&lpar;»pri&lowbar;nav&lowbar;pos»&comma; pri&lowbar;nav&period;scrollLeft&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Hamburger navigation click handlers&NewLine; hamb&lowbar;nav&lowbar;items&period;forEach&lpar;function &lpar;item&rpar; &lbrace;&NewLine; item&period;onclick &equals; function &lpar;event&rpar; &lbrace;&NewLine; console&period;log&lpar;»Hamburger nav clicked&colon;»&comma; event&period;target&rpar;&semi;&NewLine;&NewLine; const navItem &equals; event&period;target&period;closest&lpar;»&period;nav–item»&rpar;&semi;&NewLine; if &lpar;navItem&rpar; &lbrace;&NewLine; &sol;&sol; Remove active class from all primary nav items&NewLine; document&period;querySelectorAll&lpar;»&period;navbar &period;nav &period;nav–item»&rpar;&period;forEach&lpar;&lpar;el&rpar; &equals;> &lbrace;&NewLine; el&period;classList&period;remove&lpar;»active»&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; document&NewLine; &period;querySelectorAll&lpar;»&period;hamburger &period;nav &period;nav–item»&rpar;&NewLine; &period;forEach&lpar;&lpar;el&rpar; &equals;> &lbrace;&NewLine; el&period;classList&period;remove&lpar;»active»&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Add active class to clicked hamburger nav item&NewLine; navItem&period;classList&period;add&lpar;»active»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Find corresponding item in primary nav and activate it&NewLine; const href &equals; item&period;getAttribute&lpar;»href»&rpar;&semi;&NewLine; const corresponding &equals; Array&period;from&lpar;&NewLine; document&period;querySelectorAll&lpar;»&period;navbar &period;nav &period;nav–item a»&rpar;&NewLine; &rpar;&period;find&lpar;&lpar;a&rpar; &equals;> a&period;getAttribute&lpar;»href»&rpar; &equals;&equals;&equals; href&rpar;&semi;&NewLine;&NewLine; if &lpar;corresponding&rpar; &lbrace;&NewLine; const corrNavItem &equals; corresponding&period;closest&lpar;»&period;nav–item»&rpar;&semi;&NewLine; if &lpar;corrNavItem&rpar; &lbrace;&NewLine; corrNavItem&period;classList&period;add&lpar;»active»&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Save active primary nav item to sessionStorage&NewLine; const priNavId &equals; navItem&period;getAttribute&lpar;»data-pri-nav-id»&rpar;&semi;&NewLine; if &lpar;priNavId&rpar; &lbrace;&NewLine; sessionStorage&period;setItem&lpar;»active&lowbar;pri&lowbar;nav&lowbar;item»&comma; priNavId&rpar;&semi;&NewLine; console&period;log&lpar;»Saved active primary nav item&colon;»&comma; priNavId&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Clear secondary nav active state when primary nav changes&NewLine; sessionStorage&period;removeItem&lpar;»active&lowbar;sec&lowbar;nav&lowbar;item»&rpar;&semi;&NewLine; document&NewLine; &period;querySelectorAll&lpar;»&period;navbar &period;secondary–nav &period;list&lowbar;&lowbar;item»&rpar;&NewLine; &period;forEach&lpar;&lpar;el&rpar; &equals;> &lbrace;&NewLine; el&period;classList&period;remove&lpar;»active»&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Original sessionStorage handling&NewLine; sessionStorage&period;removeItem&lpar;»pri&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine; sessionStorage&period;removeItem&lpar;»sec&lowbar;nav&lowbar;wrap»&rpar;&semi;&NewLine; sessionStorage&period;removeItem&lpar;»sec&lowbar;nav&lowbar;pos»&rpar;&semi;&NewLine; window&period;sessionStorage&period;setItem&lpar;»pri&lowbar;nav&lowbar;pos»&comma; pri&lowbar;nav&period;scrollLeft&rpar;&semi;&NewLine; &rcub;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;&NewLine;function restoreActiveNavigation&lpar;&rpar; &lbrace;&NewLine; const isMobile &equals; window&period;innerWidth <&equals; 768&semi;&NewLine; &NewLine;&NewLine; if &lpar;isMobile&rpar; &lbrace;&NewLine; console&period;log&lpar;»Mobile detected – skipping sessionStorage restore»&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine;&NewLine; const activePriNavItem &equals; sessionStorage&period;getItem&lpar;»active&lowbar;pri&lowbar;nav&lowbar;item»&rpar;&semi;&NewLine; const activeSecNavItem &equals; sessionStorage&period;getItem&lpar;»active&lowbar;sec&lowbar;nav&lowbar;item»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Always restore primary nav first &lpar;if it exists&rpar;&NewLine; if &lpar;activePriNavItem&rpar; &lbrace;&NewLine; const priElement &equals; document&period;querySelector&lpar;&NewLine; &grave;&period;navbar &lbrack;data-pri-nav-id&equals;»&dollar;&lbrace;activePriNavItem&rcub;»&rsqb;&grave;&NewLine; &rpar;&semi;&NewLine; if &lpar;priElement&rpar; &lbrace;&NewLine; &sol;&sol; Clear all primary nav items&NewLine; document&NewLine; &period;querySelectorAll&lpar;»&period;navbar &period;nav &period;nav–item»&rpar;&NewLine; &period;forEach&lpar;&lpar;el&rpar; &equals;> el&period;classList&period;remove&lpar;»active»&rpar;&rpar;&semi;&NewLine; document&NewLine; &period;querySelectorAll&lpar;»&period;hamburger &period;nav &period;nav–item»&rpar;&NewLine; &period;forEach&lpar;&lpar;el&rpar; &equals;> el&period;classList&period;remove&lpar;»active»&rpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Set primary nav as active&NewLine; priElement&period;classList&period;add&lpar;»active»&rpar;&semi;&NewLine; console&period;log&lpar;»Restored active class to primary nav&colon;»&comma; priElement&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Activate corresponding hamburger item&NewLine; const priLink &equals; priElement&period;querySelector&lpar;»a»&rpar;&semi;&NewLine; if &lpar;priLink&rpar; &lbrace;&NewLine; const href &equals; priLink&period;getAttribute&lpar;»href»&rpar;&semi;&NewLine; const correspondingHamb &equals; Array&period;from&lpar;window&period;hamb&lowbar;nav&lowbar;items&rpar;&period;find&lpar;&NewLine; &lpar;a&rpar; &equals;> a&period;getAttribute&lpar;»href»&rpar; &equals;&equals;&equals; href&NewLine; &rpar;&semi;&NewLine;&NewLine; if &lpar;correspondingHamb&rpar; &lbrace;&NewLine; const corrHambNavItem &equals; correspondingHamb&period;closest&lpar;»&period;nav–item»&rpar;&semi;&NewLine; if &lpar;corrHambNavItem&rpar; &lbrace;&NewLine; corrHambNavItem&period;classList&period;add&lpar;»active»&rpar;&semi;&NewLine; console&period;log&lpar;&NewLine; «Restored active class to hamburger nav&colon;»&comma;&NewLine; corrHambNavItem&NewLine; &rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Then restore secondary nav &lpar;if it exists&rpar;&NewLine; if &lpar;activeSecNavItem&rpar; &lbrace;&NewLine; const secElement &equals; document&period;querySelector&lpar;&NewLine; &grave;&lbrack;data-sec-nav-id&equals;»&dollar;&lbrace;activeSecNavItem&rcub;»&rsqb;&grave;&NewLine; &rpar;&semi;&NewLine; if &lpar;secElement&rpar; &lbrace;&NewLine; document&NewLine; &period;querySelectorAll&lpar;»&period;navbar &period;secondary–nav &period;list&lowbar;&lowbar;item»&rpar;&NewLine; &period;forEach&lpar;&lpar;el&rpar; &equals;> el&period;classList&period;remove&lpar;»active»&rpar;&rpar;&semi;&NewLine; const listItem &equals; secElement&period;closest&lpar;»&period;list&lowbar;&lowbar;item»&rpar;&semi;&NewLine; if &lpar;listItem&rpar; &lbrace;&NewLine; listItem&period;classList&period;add&lpar;»active»&rpar;&semi;&NewLine; console&period;log&lpar;»Restored active secondary nav&colon;»&comma; listItem&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; Add unique identifiers to navigation items&NewLine;function initializeNavigationIds&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; Add IDs to primary nav items&NewLine; pri&lowbar;nav&lowbar;items&period;forEach&lpar;function &lpar;item&comma; index&rpar; &lbrace;&NewLine; const navItem &equals; item&period;closest&lpar;»&period;nav–item»&rpar;&semi;&NewLine; if &lpar;navItem && &excl;navItem&period;hasAttribute&lpar;»data-pri-nav-id»&rpar;&rpar; &lbrace;&NewLine; navItem&period;setAttribute&lpar;»data-pri-nav-id»&comma; &grave;pri-nav-&dollar;&lbrace;index&rcub;&grave;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Add IDs to hamburger nav items&NewLine; hamb&lowbar;nav&lowbar;items&period;forEach&lpar;function &lpar;item&comma; index&rpar; &lbrace;&NewLine; const navItem &equals; item&period;closest&lpar;»&period;nav–item»&rpar;&semi;&NewLine; if &lpar;navItem && &excl;navItem&period;hasAttribute&lpar;»data-pri-nav-id»&rpar;&rpar; &lbrace;&NewLine; navItem&period;setAttribute&lpar;»data-pri-nav-id»&comma; &grave;pri-nav-&dollar;&lbrace;index&rcub;&grave;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Add IDs to secondary nav items&NewLine; sec&lowbar;nav&lowbar;items&period;forEach&lpar;function &lpar;item&comma; index&rpar; &lbrace;&NewLine; if &lpar;&excl;item&period;hasAttribute&lpar;»data-sec-nav-id»&rpar;&rpar; &lbrace;&NewLine; item&period;setAttribute&lpar;»data-sec-nav-id»&comma; &grave;sec-nav-&dollar;&lbrace;index&rcub;&grave;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; Initialize navigation system&NewLine;function initializeNavigation&lpar;&rpar; &lbrace;&NewLine; init&lpar;&rpar;&semi;&NewLine; initializeNavigationIds&lpar;&rpar;&semi;&NewLine; &NewLine; &NewLine;&NewLine; if&lpar;window&period;location&period;pathname &equals;&equals;&equals; «&sol;watch&sol;live»&rpar;&lbrace;&NewLine; restoreActiveNavigation&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; Initialize when DOM is ready&NewLine;&sol;&sol; if &lpar;document&period;readyState &equals;&equals;&equals; ‘loading’&rpar; &lbrace;&NewLine;&sol;&sol; document&period;addEventListener&lpar;’DOMContentLoaded’&comma; initializeNavigation&rpar;&semi;&NewLine;&sol;&sol; &rcub; else &lbrace;&NewLine;&sol;&sol; initializeNavigation&lpar;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;»&period;hamburger»&comma; function &lpar;&rpar; &lbrace;&NewLine; initializeNavigation&lpar;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;&sol;&sol; Opinion section scroll handling&NewLine;if &lpar;window&period;location&period;search &equals;&equals; «&quest;opinion»&rpar; &lbrace;&NewLine; const opinionWidget &equals; document&period;querySelector&lpar;»&period;opinion-wrapper &period;widget»&rpar;&semi;&NewLine; if &lpar;opinionWidget&rpar; &lbrace;&NewLine; if &lpar;&NewLine; &sol;constructor&sol;i&period;test&lpar;window&period;HTMLElement&rpar; &vert;&vert;&NewLine; &lpar;function &lpar;p&rpar; &lbrace;&NewLine; return p&period;toString&lpar;&rpar; &equals;&equals;&equals; «&lbrack;object SafariRemoteNotification&rsqb;»&semi;&NewLine; &rcub;&rpar;&lpar;&NewLine; &excl;window&lbrack;»safari»&rsqb; &vert;&vert;&NewLine; &lpar;typeof safari &excl;&equals;&equals; «undefined» && window&lbrack;»safari»&rsqb;&period;pushNotification&rpar;&NewLine; &rpar;&NewLine; &rpar; &lbrace;&NewLine; opinionWidget&period;scrollIntoView&lpar;true&rpar;&semi;&NewLine; &rcub; else if &lpar;typeof InstallTrigger &excl;&equals;&equals; «undefined»&rpar; &lbrace;&NewLine; opinionWidget&period;scrollIntoView&lpar;true&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; opinionWidget&period;scrollIntoView&lpar;&lbrace;&NewLine; block&colon; «nearest»&comma;&NewLine; behavior&colon; «smooth»&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;’&period;show-only-if-post-present’&comma; function &lpar;item&rpar; &lbrace;&NewLine; if &lpar;&excl;item&period;querySelector&lpar;’&period;widget’&rpar;&rpar; &lbrace;&NewLine; item&period;classList&period;add&lpar;’hidden’&rpar;&semi;&NewLine; if&lpar;item&period;nextSibling&period;classList&period;contains&lpar;’ad–placeholder’&rpar;&rpar;&lbrace;&NewLine; item&period;nextSibling&period;remove&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;’&period;show-only-if-four-post-present’&comma; function &lpar;item&rpar; &lbrace;&NewLine; if &lpar;item&period;querySelectorAll&lpar;’&period;widget’&rpar;&period;length <&equals; 3&rpar; &lbrace;&NewLine; item&period;classList&period;add&lpar;’hidden’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine;&NewLine; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;’&period;rebellt-ecommerce–price’&comma; function &lpar;item&rpar; &lbrace;&NewLine; item&period;innerHTML &equals; item&period;innerHTML&period;replace&lpar;&sol;&bsol;&dollar;&sol;g&comma; ‘&pound&semi;’&rpar;&semi;&NewLine; &rcub;&rpar;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; Piano object&NewLine;tp &equals; window&lbrack;’tp’&rsqb; &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine;const addInfoToTP &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; const preDefinedInfo &equals; document&period;querySelector&lpar;’&period;js-all-tags’&rpar;&semi;&NewLine; let allTags &equals; &grave;&dollar;&lbrace;preDefinedInfo&period;dataset&period;tags&period;replace&lpar;&sol;&lbrack;&bsol;&lbrack;&bsol;&rsqb;’&rsqb;&plus;&sol;g&comma;»&rpar;&rcub;&grave;&semi;&NewLine; let primarySectionTitle &equals; preDefinedInfo&period;dataset&period;contentSection&semi;&NewLine; let postAuthor &equals; preDefinedInfo&period;dataset&period;author&semi;&NewLine; let postType &equals; preDefinedInfo&period;dataset&period;contentType&semi;&NewLine; let cd1 &equals; preDefinedInfo&period;dataset&period;cd1&semi;&NewLine; let cd2 &equals; preDefinedInfo&period;dataset&period;cd2&semi;&NewLine; let cd9 &equals; preDefinedInfo&period;dataset&period;cd9&semi;&NewLine; let cd11 &equals; window&period;matchMedia&lpar;’&lpar;display-mode&colon; standalone&rpar;’&rpar;&period;matches &quest; ‘pwa’ &colon; ‘web’&semi;&NewLine; &sol;&sol; console&period;log&lpar;cd11&rpar;&semi;&NewLine; let cd12 &equals; preDefinedInfo&period;dataset&period;cd12&semi;&NewLine; let cd13 &equals; preDefinedInfo&period;dataset&period;cd13&semi;&NewLine; let cd14 &equals; preDefinedInfo&period;dataset&period;cd14&semi;&NewLine; let cd15 &equals; preDefinedInfo&period;dataset&period;cd15&semi;&NewLine; let cd16 &equals; preDefinedInfo&period;dataset&period;cd16&semi;&NewLine; let cd17 &equals; preDefinedInfo&period;dataset&period;cd17&semi;&NewLine; let cd18 &equals; preDefinedInfo&period;dataset&period;cd18&semi;&NewLine; let cd19 &equals; document&period;referrer&period;split&lpar;»&sol;»&rpar;&lbrack;2&rsqb; &vert;&vert; ‘not set’&semi;&NewLine; let cd23 &equals; ‘not set’&semi;&NewLine; let cd25 &equals; window&period;navigator&period;userAgent&semi;&NewLine;&NewLine; const getInfo &equals; &lpar;string&rpar; &equals;> string&period;split&lpar;’&bsol;’&colon;’&rpar;&lbrack;1&rsqb;&period;replace&lpar;&sol;&lbrack;&&num;&comma;&plus;&lpar;&rpar;&dollar;~&percnt;&period;'»&ast;&quest;<>&lbrace;&rcub;&rsqb;&sol;g&comma; »&rpar;&period;trim&lpar;&rpar;&semi;&NewLine; const passDataToTp &equals; &lpar;type&comma; data&rpar; &equals;> tp&period;push&lpar;&lbrack;type&comma; data&rsqb;&rpar;&semi;&NewLine; const passCustomDataToTp &equals; &lpar;name&comma; data&rpar; &equals;> tp&period;push&lpar;&lbrack;’setCustomVariable’&comma; name&comma; data&rsqb;&rpar;&semi;&NewLine; &NewLine; primarySectionTitle &equals; getInfo&lpar;primarySectionTitle&rpar;&semi;&NewLine; passDataToTp&lpar;’setContentSection’&comma; primarySectionTitle&rpar;&semi;&NewLine;&NewLine; postAuthor &equals; getInfo&lpar;postAuthor&rpar;&semi;&NewLine; passDataToTp&lpar;’setContentAuthor’&comma; postAuthor&rpar;&semi;&NewLine;&NewLine; postType &equals; getInfo&lpar;postType&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’content&lowbar;type’&comma; postType&rpar;&semi;&NewLine;&NewLine; cd1 &equals; getInfo&lpar;cd1&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd1’&comma; cd1&rpar;&semi;&NewLine; cd2 &equals; getInfo&lpar;cd2&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd2’&comma; cd2&rpar;&semi;&NewLine; cd9 &equals; getInfo&lpar;cd9&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd9’&comma; cd9&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd11’&comma; cd11&rpar;&semi;&NewLine; cd12 &equals; getInfo&lpar;cd12&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd12’&comma; cd12&rpar;&semi;&NewLine; cd13 &equals; getInfo&lpar;cd13&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd13’&comma; cd13&rpar;&semi;&NewLine; cd14 &equals; getInfo&lpar;cd14&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd14’&comma; cd14&rpar;&semi;&NewLine; cd15 &equals; getInfo&lpar;cd15&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd15’&comma; cd15&rpar;&semi;&NewLine; cd16 &equals; getInfo&lpar;cd16&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd16’&comma; cd16&rpar;&semi;&NewLine; cd17 &equals; getInfo&lpar;cd17&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd17’&comma; cd17&rpar;&semi;&NewLine; cd18 &equals; getInfo&lpar;cd18&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd18’&comma; cd18&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd19’&comma; cd19&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd23’&comma; cd23&rpar;&semi;&NewLine; passCustomDataToTp&lpar;’cd25’&comma; cd25&rpar;&semi;&NewLine;&NewLine; return allTags&period;length &quest; passDataToTp&lpar;’setTags’&comma; allTags&rpar; &colon; false&semi;&NewLine;&rcub;&NewLine;&NewLine;addInfoToTP&lpar;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOW&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; window&period;gbnCE &equals; window&period;gbnCE &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&sol;&sol; window&period;gbnCE&period;push&lpar;&lbrack;&NewLine;&sol;&sol; ‘init’&comma;&NewLine;&sol;&sol; function &lpar;gbnCE&rpar; &lbrace;&NewLine;&sol;&sol; gbnCE&period;auth&period;updateHeaderElement&lpar;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&comma;&NewLine;&sol;&sol; &rsqb;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&rsqb;&rsqb;><&sol;script><script class&equals;»rm-i-script» id&equals;»user-javascript-active» type&equals;»text»><&excl;&lbrack;CDATA&lbrack;&NewLine; window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function bootRpm&lpar;&rpar;&lbrace;&NewLine; const INTERNAL&lowbar;CLASS&lowbar;PREFIXES &equals; &lbrack;»tag-«&comma; «post-section-«&comma; «rm-fl-«&rsqb;&semi;&NewLine;&NewLine; function filterOutNoisyClassNames&lpar;className&rpar; &lbrace;&NewLine; function doesClassNameStartWithPrefix&lpar;badPrefix&rpar; &lbrace;&NewLine; return className&period;indexOf&lpar;badPrefix&rpar; &equals;&equals;&equals; 0&semi;&NewLine; &rcub;&NewLine; &NewLine; return &excl;INTERNAL&lowbar;CLASS&lowbar;PREFIXES&period;some&lpar;doesClassNameStartWithPrefix&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; function signatureMaker&lpar;id&comma; tagName&comma; classList&rpar; &lbrace;&NewLine; const cleanClassList &equals; classList&period;filter&lpar;filterOutNoisyClassNames&rpar;&period;sort&lpar;&rpar;&semi;&NewLine; return &lbrack;id&comma; tagName&comma; cleanClassList&rsqb;&semi;&NewLine; &rcub;&NewLine; &NewLine; window&period;&lowbar;&lowbar;rpmOptions &equals; window&period;&lowbar;&lowbar;rpmOptions &vert;&vert; &lbrace;&NewLine; lcpTrackerOptions&colon; &lbrace;&NewLine; signatureMaker&colon; signatureMaker&comma;&NewLine; &rcub;&comma;&NewLine; clsTrackerOptions&colon; &lbrace;&NewLine; signatureMaker&colon; signatureMaker&comma;&NewLine; &rcub;&comma;&NewLine; &rcub;&semi;&NewLine; &NewLine; &NewLine; window&period;REBELMOUSE&lowbar;STDLIB&period;loadExternalScript&lpar;»https&colon;&sol;&sol;www&period;rebelmouse&period;com&sol;pharos&sol;client&sol;v1&sol;mjs&sol;web&period;mjs»&comma; function&lpar;&rpar;&lbrace;&rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; const INTERNAL&lowbar;CLASS&lowbar;PREFIXES &equals; &lbrack;»tag-«&comma; «post-section-«&comma; «rm-fl-«&rsqb;&semi;&NewLine;&NewLine;function filterOutNoisyClassNames&lpar;className&rpar; &lbrace;&NewLine; function doesClassNameStartWithPrefix&lpar;badPrefix&rpar; &lbrace;&NewLine; return className&period;indexOf&lpar;badPrefix&rpar; &equals;&equals;&equals; 0&semi;&NewLine; &rcub;&NewLine;&NewLine; return &excl;INTERNAL&lowbar;CLASS&lowbar;PREFIXES&period;some&lpar;doesClassNameStartWithPrefix&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function signatureMaker&lpar;id&comma; tagName&comma; classList&rpar; &lbrace;&NewLine; const cleanClassList &equals; classList&period;filter&lpar;filterOutNoisyClassNames&rpar;&period;sort&lpar;&rpar;&semi;&NewLine; return &lbrack;id&comma; tagName&comma; cleanClassList&rsqb;&semi;&NewLine;&rcub;&NewLine;&NewLine;window&period;&lowbar;&lowbar;rpmOptions &equals; &lbrace;&NewLine; lcpTrackerOptions&colon; &lbrace;&NewLine; signatureMaker&colon; signatureMaker&comma;&NewLine; &rcub;&comma;&NewLine;&rcub;&semi;&NewLine;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;STDLIB&period;loadExternalScript&lpar;»https&colon;&sol;&sol;www&period;rebelmouse&period;com&sol;pharos&sol;client&sol;v1&sol;mjs&sol;web&period;mjs»&comma; function&lpar;&rpar;&lbrace;&rcub;&rpar;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; const DEBUGGING &equals; false&semi;&NewLine;const PA&lowbar;WAIT&lowbar;INTERVAL &equals; 100&semi; &sol;&sol; time in ms to wait for Piano Analytics&NewLine;const PA&lowbar;WAIT&lowbar;ATTEMPTS &equals; 5&semi; &sol;&sol; number of times to try looking for Piano Analytics&NewLine;&sol;&sol; const PLAYER&lowbar;URL &equals; «https&colon;&sol;&sol;mm-dev&period;simplestream&period;com&sol;ssmp&sol;gbnews&period;js»&semi;&NewLine;const PLAYER&lowbar;URL &equals; «https&colon;&sol;&sol;mm-dev&period;simplestream&period;com&sol;ssmp&sol;gbnewsv2&period;js»&semi; &sol;&sol; testing endpoint&excl;&NewLine;&NewLine;var pa&lowbar;attempts &equals; 0&semi;&NewLine;&NewLine;&sol;&sol; Only load player when Piano Analytics is ready&NewLine;waitForPianoAnalytics&lpar;&rpar;&semi;&NewLine;&NewLine;function waitForPianoAnalytics&lpar;&rpar;&lbrace;&NewLine; debug&lpar;’Checking for Piano Analytics&period;&period;&period;’&rpar;&semi;&NewLine; if &lpar;typeof pa &excl;&equals;&equals; «undefined» &vert;&vert; pa&lowbar;attempts >&equals; PA&lowbar;WAIT&lowbar;ATTEMPTS&rpar;&lbrace;&NewLine; debug&lpar;’Piano Analytics is loaded so loading video player’&rpar;&semi;&NewLine; loadVideoPlayer&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; else&lbrace;&NewLine; debug&lpar;’Piano Analytics not yet loaded’&rpar;&semi;&NewLine; pa&lowbar;attempts&plus;&plus;&semi;&NewLine; setTimeout&lpar;waitForPianoAnalytics&comma; PA&lowbar;WAIT&lowbar;INTERVAL&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;function loadVideoPlayer&lpar;&rpar; &lbrace;&NewLine; debug&lpar;’creating listener’&rpar;&semi;&NewLine; window&period;REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;&NewLine; «&period;simplestream-holder&period;rm-shortcode &period;simplestream»&comma;&NewLine; function &lpar;&lowbar;element&rpar; &lbrace;&NewLine; debug&lpar;’loading external JS’&rpar;&semi;&NewLine; window&period;REBELMOUSE&lowbar;STDLIB&period;loadExternalScript&lpar;&NewLine; PLAYER&lowbar;URL&comma;&NewLine; function &lpar;&rpar; &lbrace;&NewLine; debug&lpar;’simplestream staging JS loaded’&rpar;&semi;&NewLine; loadScript&lpar;&rpar;&semi;&NewLine; function loadScript&lpar;&rpar;&lbrace;&NewLine; let sidebar &equals; document&period;querySelector&lpar;’&period;sidebar-wrapper’&rpar;&semi;&NewLine; let noSidebar &equals; sidebar &quest; window&period;getComputedStyle&lpar;sidebar&rpar;&period;display &equals;&equals;&equals; ‘none’ &colon; false&semi;&NewLine;&NewLine; if &lpar;&lowbar;element&period;classList&period;contains&lpar;’sidebar’&rpar; && noSidebar&rpar;&lbrace;&NewLine; debug&lpar;’Preventing initialization of hidden sidebar live player’&rpar;&NewLine; &rcub;&NewLine; else&lbrace;&NewLine; var getId&equals;’&num;’&plus;&lowbar;element&period;getAttribute&lpar;’data-id’&rpar;&semi;&NewLine; debug&lpar;’initializing video ‘ &plus; getId&rpar;&semi;&NewLine; window&period;simplestream&period;initApp&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rpar;&semi;&NewLine; &rcub;&NewLine; &rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function debug&lpar;message&rpar; &lbrace;&NewLine; if &lpar;DEBUGGING&rpar;&NewLine; console&period;log&lpar;’&lbrack;Video Player&rsqb;&colon; ‘&plus;message&rpar;&semi;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; function asyncScriptLoading&lpar;src&rpar; &lbrace;&NewLine; return new Promise&lpar;function &lpar;resolve&comma; reject&rpar; &lbrace;&NewLine; let s&semi;&NewLine; s &equals; document&period;createElement&lpar;’script’&rpar;&semi;&NewLine; s&period;type &equals; ‘text&sol;javascript’&semi;&NewLine; s&period;async &equals; true&semi;&NewLine; s&period;src &equals; src&semi;&NewLine; s&period;onload &equals; resolve&semi;&NewLine; s&period;onerror &equals; reject&semi;&NewLine; document&period;head&period;appendChild&lpar;s&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;const src &equals; ‘&sol;&sol;cdn&period;pushwoosh&period;com&sol;webpush&sol;v3&sol;pushwoosh-web-notifications&period;js’&semi;&NewLine;&NewLine;asyncScriptLoading&lpar;src&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;»&num;pwSubscribePopup&period;pw-show»&comma; function&lpar;element&rpar;&lbrace;&NewLine; console&period;log&lpar;element&rpar;&semi;&NewLine; setTimeout&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; element&period;classList&period;add&lpar;»delay-display»&rpar;&semi;&NewLine; &rcub;&comma; 1000&rpar;&NewLine;&rcub;&rpar;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;’&period;carousel–wrapper’&comma; function&lpar;carousel&rpar;&lbrace;&NewLine; carousel&lowbar;post&equals;carousel&period;querySelector&lpar;’&period;widget’&rpar;&semi;&NewLine; var scrolling&lowbar;item&equals;carousel&period;querySelector&lpar;’&period;posts-wrapper’&rpar;&semi;&NewLine; if&lpar;&excl;scrolling&lowbar;item&rpar; return&semi;&NewLine;&sol;&sol; console&period;log&lpar;carousel&rpar;&semi;&NewLine;&NewLine;function car&lowbar;distance&lowbar;calc&lpar;&rpar;&lbrace;&NewLine;&NewLine; var multiplier&equals;parseInt&lpar;scrolling&lowbar;item&period;clientWidth&sol;carousel&lowbar;post&period;clientWidth&rpar;&semi;&NewLine; if&lpar;carousel&period;classList&period;contains&lpar;’scroll–one’&rpar;&rpar;&lbrace;&NewLine; multiplier&equals;1&semi;&NewLine; &rcub;&NewLine;&sol;&sol; console&period;log&lpar;multiplier &plus; «—«&plus;scrolling&lowbar;item&period;clientWidth&plus;»—» &plus;carousel&lowbar;post&period;clientWidth &rpar;&NewLine;return multiplier&ast;&lpar;carousel&lowbar;post&period;clientWidth&plus;20&rpar;&semi;&NewLine;&rcub;&NewLine;let carousel&lowbar;&lowbar;arrows&equals;carousel&period;querySelectorAll&lpar;’&period;carousel–arrow’&rpar;&semi;&NewLine;&NewLine;var carousel&lowbar;distance &equals; car&lowbar;distance&lowbar;calc&lpar;&rpar;&semi;&NewLine;&NewLine;carousel&lowbar;&lowbar;arrows&period;forEach&lpar;function&lpar;item&rpar;&lbrace;&NewLine; buttonNextPrevVisiblity&lpar;700&comma;item&period;closest&lpar;’&period;carousel–wrapper’&rpar;&rpar;&semi;&NewLine; item&period;onclick&equals;function&lpar;&rpar;&lbrace;&NewLine; scrolling&lowbar;item&period;scrollBy&lpar;&lbrace;&NewLine; left&colon; item&period;classList&period;contains&lpar;’prev’&rpar;&quest; -carousel&lowbar;distance&colon;carousel&lowbar;distance&comma;&NewLine; behavior&colon; ‘smooth’&NewLine; &rcub;&rpar;&semi;&NewLine; buttonNextPrevVisiblity&lpar;700&comma;item&period;closest&lpar;’&period;carousel–wrapper’&rpar;&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&rpar;&NewLine; window&period;addEventListener&lpar;»resize»&comma;debounce&lpar;function&lpar;e&rpar;&lbrace;&NewLine; carousel&lowbar;distance&equals;car&lowbar;distance&lowbar;calc&lpar;&rpar;&semi;&NewLine; carousel&lowbar;&lowbar;arrow&lowbar;pos&lpar;&rpar;&semi;&NewLine;&rcub;&rpar;&rpar;&semi;&NewLine;function carousel&lowbar;&lowbar;arrow&lowbar;pos&lpar;&rpar;&lbrace;&NewLine;carousel&lowbar;&lowbar;arrows&period;forEach&lpar;function&lpar;item&rpar;&lbrace;&NewLine;item&period;style&period;top&equals;&lpar;carousel&lowbar;post&period;clientWidth&ast;&period;5625-53&rpar;&sol;2 &plus; ‘px’&NewLine;&rcub;&rpar;&NewLine;&rcub;&NewLine;carousel&lowbar;&lowbar;arrow&lowbar;pos&lpar;&rpar;&semi;&NewLine;&NewLine;function buttonNextPrevVisiblity&lpar;timeOffset&comma;carousel&rpar; &lbrace;&NewLine;var btn&lowbar;prev&equals;carousel&period;querySelector&lpar;’&period;carousel–arrow&period;prev’&rpar;&semi;&NewLine; var btn&lowbar;next&equals;carousel&period;querySelector&lpar;’&period;carousel–arrow&period;next’&rpar;&semi;&NewLine; &NewLine;&NewLine; if&lpar;scrolling&lowbar;item&period;scrollWidth <&equals; scrolling&lowbar;item&period;clientWidth&plus;20&rpar;&lbrace;&NewLine; btn&lowbar;next&period;classList&period;add&lpar;»hidden»&rpar;&semi;&NewLine; btn&lowbar;prev&period;classList&period;add&lpar;»hidden»&rpar;&NewLine; &rcub;&NewLine; setTimeout&lpar;sccc &equals;> &lbrace;&NewLine; if &lpar;scrolling&lowbar;item&period;scrollLeft > 0&rpar; &lbrace;&NewLine; btn&lowbar;prev&period;classList&period;remove&lpar;»hidden»&rpar;&NewLine; &rcub; else &lbrace;&NewLine; btn&lowbar;prev&period;classList&period;add&lpar;»hidden»&rpar;&NewLine; &rcub;&NewLine; if &lpar;scrolling&lowbar;item&period;scrollWidth <&equals; &lpar;scrolling&lowbar;item&period;clientWidth &plus; scrolling&lowbar;item&period;scrollLeft&plus; 20&rpar; &rpar; &lbrace;&NewLine; btn&lowbar;next&period;classList&period;add&lpar;»hidden»&rpar;&NewLine; &rcub; else &lbrace;&NewLine; btn&lowbar;next&period;classList&period;remove&lpar;»hidden»&rpar;&NewLine; &rcub;&NewLine; &rcub;&comma; timeOffset&rpar;&NewLine; &rcub;&NewLine;&NewLine;&rcub;&rpar;&NewLine;function debounce&lpar;func&rpar;&lbrace;&NewLine; var timer&semi;&NewLine; return function&lpar;event&rpar;&lbrace;&NewLine; if&lpar;timer&rpar; clearTimeout&lpar;timer&rpar;&semi;&NewLine; timer &equals; setTimeout&lpar;func&comma;250&comma;event&rpar;&semi;&NewLine; &rcub;&semi;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; const DEBUGGING &equals; false&semi;&NewLine;const PIANO&lowbar;SCRIPT &equals; ‘https&colon;&sol;&sol;experience-eu&period;piano&period;io&sol;xbuilder&sol;experience&sol;load&quest;aid&equals;6N1iEZE6pe’&semi;&NewLine;const PIANO&lowbar;ENDPOINT &equals; ‘https&colon;&sol;&sol;buy-eu&period;piano&period;io&sol;api&sol;v3’&semi;&NewLine;const COOKIE &equals; ‘loggedinCookie&lowbar;sid’&semi;&NewLine;&sol;&sol; const SOURCEPOINT&lowbar;COOKIE &equals; ‘sp&lowbar;subscribed&lowbar;status’&semi;&NewLine;const OLD&lowbar;DATE &equals; ‘Thu&comma; 18 Dec 2013 12&colon;00&colon;00 UTC’&semi;&NewLine;&NewLine;&sol;&sol; initialise Piano&NewLine;tp &equals; window&period;tp &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;tp&period;push&lpar;&lbrack;’setUsePianoIdUserProvider’&comma; true&rsqb;&rpar;&semi;&NewLine;tp&period;push&lpar;&lbrack;’setApplePayMerchantId’&comma; ‘https&colon;&sol;&sol;www&period;gbnews&period;com&sol;&period;well-known&sol;apple-developer-merchantid-domain-association’&rsqb;&rpar;&semi;&NewLine;tp&period;push&lpar;&lbrack;’setPianoIdUrl’&comma; ‘https&colon;&sol;&sol;auth&period;gbnews&period;com’&rsqb;&rpar;&semi;&NewLine;tp&period;push&lpar;&lbrack;’setEndpoint’&comma; PIANO&lowbar;ENDPOINT&rsqb;&rpar;&semi;&NewLine;&NewLine;&sol;&sol; declare login icons&NewLine;var loginLink &equals; document&period;querySelector&lpar;’&period;login-link’&rpar;&semi;&NewLine;var loginLinkText &equals; document&period;getElementById&lpar;’login-link-text’&rpar;&semi;&NewLine;&NewLine;&sol;&sol; on initialisation&NewLine;tp&period;push&lpar;&lbrack;&NewLine; ‘init’&comma;&NewLine; function &lpar;&rpar; &lbrace;&NewLine; debug&lpar;’Piano init&period;&period;&period;’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; handle user logging in and out from Piano&NewLine; tp&period;pianoId&period;init&lpar;&lbrace;&NewLine; loggedIn&colon; function &lpar;data&rpar; &lbrace;&NewLine; setUser&lpar;data&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; loggedOut&colon; function &lpar;&rpar; &lbrace;&NewLine; debug&lpar;’User is logged out’&rpar;&semi;&NewLine; loggedOut&lpar;&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;tp&period;pianoId&period;isUserValid&lpar;&rpar;&rpar; &lbrace;&NewLine; debug&lpar;’Not logged into Piano&period;&period;&period;’&rpar;&semi;&NewLine; attachLoginLink&lpar;&rpar;&semi;&NewLine; enableLoginLink&lpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; 1 Sourcepoint New – remove pre-existing cookies&NewLine; &sol;&sol; deleteSourcepointCookie&lpar;&rpar;&semi;&NewLine;&NewLine; window&period;vfQ&period;push&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; Viafoura is loaded and window&period;vf is available&NewLine; &sol;&sol; are they logged into Viafoura&quest;&NewLine; window&period;vf&period;context&period;get&lpar;’user’&rpar;&period;then&lpar;&lpar;user&rpar; &equals;> &lbrace;&NewLine; if &lpar;user&period;email&rpar; &lbrace;&NewLine; debug&lpar;’Logged out from Viafoura as not logged into Piano’&rpar;&semi;&NewLine; window&period;vf&period;session&period;logout&lpar;&rpar;&semi;&NewLine; deleteCookie&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Viafoura&NewLine; &sol;&sol; Make vfQ available or use existing one if already loaded&NewLine; window&period;vfQ &equals; window&period;vfQ &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; window&period;vfQ&period;push&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; Viafoura is loaded and window&period;vf is available&NewLine; debug&lpar;’Viafoura loaded’&rpar;&semi;&NewLine;&NewLine; window&period;vf&period;&dollar;prepublish&lpar;&lpar;channel&comma; event&comma; &period;&period;&period;args&rpar; &equals;> &lbrace;&NewLine; if &lpar;channel &equals;&equals;&equals; ‘authentication’ && event &equals;&equals;&equals; ‘required’&rpar; &lbrace;&NewLine; debug&lpar;’Viafoura login flow trigger’&rpar;&semi;&NewLine; window&period;vf&period;&dollar;publish&lpar;’tray’&comma; ‘close’&rpar;&semi;&NewLine;&NewLine; if &lpar;args&lbrack;0&rsqb;&period;method &equals;&equals;&equals; ‘signup’&rpar; &lbrace;&NewLine; &sol;&sol; Registration modal&NewLine; showRegistrationModal&lpar;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; Login modal&NewLine; showLoginModal&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; return false&semi;&NewLine; &rcub; else &lbrace;&NewLine; return &lbrace; channel&comma; event&comma; args &rcub;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; handle logout from Viafoura&NewLine; window&period;vf&period;&dollar;subscribe&lpar;’authentication’&comma; ‘logout’&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; User logging out&NewLine; tp&period;pianoId&period;logout&lpar;&rpar;&semi;&NewLine; debug&lpar;’Viafoura logout intercept’&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; functions&NewLine;&NewLine; function loggedIn&lpar;&rpar; &lbrace;&NewLine; debug&lpar;’User has logged into Piano’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; function registered&lpar;&rpar; &lbrace;&NewLine; debug&lpar;’User has registered with Piano’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; function loggedOut&lpar;&rpar; &lbrace;&NewLine; debug&lpar;’User has logged out of Piano’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Gamification logout&NewLine; window&period;gbnCE &equals; window&period;gbnCE &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; window&period;gbnCE&period;push&lpar;&lbrack;’logout’&rsqb;&rpar;&semi;&NewLine; window&period;gbnCE&period;push&lpar;&lbrack;’logoutHeader’&rsqb;&rpar;&semi;&NewLine;&NewLine; window&period;vfQ&period;push&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; Viafoura is loaded and window&period;vf is available&NewLine; &sol;&sol; Viafoura logout&NewLine; debug&lpar;’Logging out of Viafoura’&rpar;&semi;&NewLine; window&period;vf&period;session&period;logout&lpar;&rpar;&semi;&NewLine; loginLink&period;href &equals; ‘javascript&colon;void&lpar;0&rpar;’&semi;&NewLine; deleteCookie&lpar;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; loginLink&period;classList&period;remove&lpar;’loggedin’&rpar;&semi;&NewLine; loginLink&period;innerText &equals; »&semi;&NewLine;&NewLine; if &lpar;loginLinkText&rpar; &lbrace;&NewLine; loginLinkText&period;textContent &equals; ‘Log in’&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; attach login link&NewLine; attachLoginLink&lpar;&rpar;&semi;&NewLine; enableLoginLink&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; function showLoginModal&lpar;&rpar; &lbrace;&NewLine; debug&lpar;’Login modal’&rpar;&semi;&NewLine; tp&period;pianoId&period;show&lpar;&lbrace;&NewLine; loggedIn&colon; loggedIn&comma;&NewLine; loggedOut&colon; loggedOut&comma;&NewLine; registrationSuccess&colon; registered&comma;&NewLine; stage&colon; ‘web’&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; function showRegistrationModal&lpar;&rpar; &lbrace;&NewLine; debug&lpar;’Registration modal’&rpar;&semi;&NewLine; tp&period;pianoId&period;show&lpar;&lbrace;&NewLine; screen&colon; ‘register’&comma;&NewLine; loggedIn&colon; loggedIn&comma;&NewLine; loggedOut&colon; loggedOut&comma;&NewLine; registrationSuccess&colon; registered&comma;&NewLine; stage&colon; ‘web’&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; function setUser&lpar;data&rpar; &lbrace;&NewLine; debug&lpar;’Setting up logged in user’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Gamification login&NewLine; if &lpar;data&period;token&rpar; &lbrace;&NewLine; debug&lpar;’Logging into coin economy system’&rpar;&semi;&NewLine; window&period;gbnCE &equals; window&period;gbnCE &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; window&period;gbnCE&period;push&lpar;&lbrack;’login’&comma; data&period;token&rsqb;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Load profile&NewLine; window&period;gbnCE&period;push&lpar;&lbrack;’profile’&rsqb;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; update header on login&NewLine; window&period;gbnCE&period;push&lpar;&lbrack;&NewLine; ‘init’&comma;&NewLine; function &lpar;gbnCE&rpar; &lbrace;&NewLine; gbnCE&period;auth&period;updateHeaderElement&lpar;&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; &rsqb;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Now send daily&lowbar;visit event&NewLine; &sol;&sol; window&period;gbnCE&period;push&lpar;&lbrack;’event’&comma; ‘daily&lowbar;visit’&comma; ‘platform’&rsqb;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; if &lpar;data&period;user&rpar; &lbrace;&NewLine; var user&lowbar;id &equals; data&period;user&period;uid&semi;&NewLine; var user&lowbar;email &equals; data&period;user&period;email&semi;&NewLine;&NewLine; if &lpar;user&lowbar;id&rpar; &lbrace;&NewLine; &sol;&sol; initials in avatar&NewLine; setAvatar&lpar;data&period;user&rpar;&semi;&NewLine; addLoginLinkText&lpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; call CI passSignalFunction&NewLine; setTimeout&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; passSignalDataFtn&lpar;user&lowbar;email&rpar;&semi;&NewLine; &rcub;&comma; 2000&rpar;&semi;&NewLine;&NewLine; &sol;&sol; detach login link&NewLine; detachLoginLink&lpar;&rpar;&semi;&NewLine; enableLoginLink&lpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; set cookie&NewLine; setCookie&lpar;user&lowbar;id&rpar;&semi;&NewLine;&NewLine; window&period;vfQ&period;push&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; let commentsParent &equals; document&period;getElementById&lpar;’comments’&rpar;&semi;&NewLine; &sol;&sol; Viafoura is loaded and window&period;vf is available&NewLine; &sol;&sol; manually invoke the login flow&NewLine; &sol;&sol; rather than waiting for Viafoura to&NewLine; &sol;&sol; listen for the cookie&NewLine; window&period;vf&period;session&period;login&NewLine; &period;cookie&lpar;user&lowbar;id&rpar;&NewLine; &period;then&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; debug&lpar;’Invoked login to Viafoura’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; if vfErrorDiv exists&comma; remove from the page because VF has loaded&NewLine; &sol;&sol; console&period;log&lpar;»remove the Error Div if it exists on the page»&rpar;&semi;&NewLine; &sol;&sol; let errorDiv &equals; document&period;getElementById&lpar;»vfErrorDiv»&rpar;&semi;&NewLine; &sol;&sol; if &lpar;errorDiv&rpar; &lbrace;&NewLine; &sol;&sol; errorDiv&period;remove&lpar;&rpar;&semi;&NewLine; &sol;&sol; &rcub;&NewLine; &rcub;&rpar;&NewLine; &period;catch&lpar;&lpar;error&rpar; &equals;> &lbrace;&NewLine; debug&lpar;’Failed to log user id ‘ &plus; user&lowbar;id &plus; ‘ into Viafoura&colon; ‘ &plus; error&period;message&rpar;&semi;&NewLine; &sol;&sol; log them out of Piano&NewLine; &sol;&sol; tp&period;pianoId&period;logout&lpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; check and remove vfErrorDiv if it is already there&NewLine; &sol;&sol; let errorDiv &equals; document&period;getElementById&lpar;»vfErrorDiv»&rpar;&semi;&NewLine; &sol;&sol; if &lpar;errorDiv&rpar; &lbrace;&NewLine; &sol;&sol; errorDiv&period;remove&lpar;&rpar;&semi;&NewLine; &sol;&sol; &rcub;&NewLine;&NewLine; &sol;&sol; create vfErrorDiv in the page&NewLine; &sol;&sol; console&period;log&lpar;»create the Error DIV»&rpar;&semi;&NewLine; &sol;&sol; let vfErrorDiv &equals; document&period;createElement&lpar;»div»&rpar;&semi;&NewLine; &sol;&sol; vfErrorDiv&period;id &equals; «vfErrorDiv»&semi;&NewLine; &sol;&sol; vfErrorDiv&period;classList&period;add&lpar;»vfErrorDiv»&rpar;&semi;&NewLine; &sol;&sol; vfErrorDiv&period;textContent &equals; «There is an issue with commenting currently&comma; please try again later&period;»&NewLine; &sol;&sol; commentsParent&period;insertBefore&lpar;vfErrorDiv&comma; commentsParent&period;firstChild&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; function attachLoginLink&lpar;&rpar; &lbrace;&NewLine; debug&lpar;’Attach login link’&rpar;&semi;&NewLine; loginLink&period;addEventListener&lpar;’click’&comma; openLoginModal&rpar;&semi;&NewLine;&NewLine; if &lpar;loginLinkText&rpar; &lbrace;&NewLine; loginLinkText&period;addEventListener&lpar;’click’&comma; openLoginModal&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; function detachLoginLink&lpar;&rpar; &lbrace;&NewLine; debug&lpar;’Detach login link’&rpar;&semi;&NewLine; loginLink&period;removeEventListener&lpar;’click’&comma; openLoginModal&rpar;&semi;&NewLine; if &lpar;loginLinkText&rpar; &lbrace;&NewLine; loginLinkText&period;removeEventListener&lpar;’click’&comma; openLoginModal&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; function openLoginModal&lpar;e&rpar; &lbrace;&NewLine; debug&lpar;’Login link clicked’&rpar;&semi;&NewLine; e&period;preventDefault&lpar;&rpar;&semi;&NewLine; showLoginModal&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; window&period;openLoginModalGlobal &equals; function &lpar;&rpar; &lbrace;&NewLine; debug&lpar;’Follow link clicked’&rpar;&semi;&NewLine; showLoginModal&lpar;&rpar;&semi;&NewLine; &rcub;&semi;&NewLine;&NewLine; function enableLoginLink&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; enable the login link&NewLine; loginLink&period;classList&period;remove&lpar;’disabled’&rpar;&semi;&NewLine; if &lpar;loginLinkText&rpar; &lbrace;&NewLine; loginLinkText&period;classList&period;remove&lpar;’disabled’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; function setAvatar&lpar;user&rpar; &lbrace;&NewLine; debug&lpar;’User is logged in so setting initials in icon’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; set initials for avatar&NewLine; &sol;&sol; this assumes we have an email&comma; but we may not have first or last names&NewLine; &sol;&sol; so then we take the first two letters of their first name&NewLine; &sol;&sol; or&comma; if no first name&comma; the first two letters of their email&NewLine; var init1 &equals; user&period;firstName &quest; user&period;firstName&lbrack;0&rsqb; &colon; user&period;email&lbrack;0&rsqb;&semi;&NewLine; var init2 &equals; user&period;lastName &quest; user&period;lastName&lbrack;0&rsqb; &colon; user&period;firstName &quest; user&period;firstName&lbrack;1&rsqb; &colon; user&period;email&lbrack;1&rsqb;&semi;&NewLine; var inits &equals; init1 &plus; init2&semi;&NewLine; &sol;&sol; loginLink&period;innerText &equals; inits&semi;&NewLine;&NewLine; loginLink&period;classList&period;add&lpar;’loggedin’&rpar;&semi;&NewLine; debug&lpar;’Logged in as ‘ &plus; inits&rpar;&semi;&NewLine; loginLink&period;href &equals; ‘&num;’&semi;&NewLine; &rcub;&NewLine;&NewLine; function addLoginLinkText&lpar;&rpar; &lbrace;&NewLine; if &lpar;loginLinkText&rpar; &lbrace;&NewLine; loginLinkText&period;textContent &equals; ‘My Account’&semi;&NewLine; loginLinkText&period;href &equals; ‘&num;’&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; async function passSignalDataFtn&lpar;email&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;»hashed email for liveramp called»&rpar;&semi;&NewLine; const EMAIL&lowbar;VALIDATION&lowbar;REGEX &equals; &sol;&lpar;&lpar;&lpar;&lbrack;&Hat;<>&lpar;&rpar;&bsol;&lbrack;&bsol;&rsqb;&period;&comma;&semi;&colon;&bsol;s&commat;»&rsqb;&plus;&lpar;&bsol;&period;&lbrack;&Hat;<>&lpar;&rpar;&bsol;&lbrack;&bsol;&rsqb;&period;&comma;&semi;&colon;&bsol;s&commat;»&rsqb;&plus;&rpar;&ast;&rpar;&vert;&lpar;»&period;&plus;»&rpar;&rpar;&commat;&lpar;&lpar;&lbrack;&Hat;<>&lpar;&rpar;&lbrack;&bsol;&rsqb;&period;&comma;&semi;&colon;&bsol;s&commat;»&rsqb;&plus;&bsol;&period;&rpar;&plus;&lbrack;&Hat;<>&lpar;&rpar;&lbrack;&bsol;&rsqb;&period;&comma;&semi;&colon;&bsol;s&commat;»&rsqb;&lbrace;2&comma;&rcub;&rpar;&rpar;&sol;i&semi;&NewLine; if &lpar;&excl;email &vert;&vert; &excl;EMAIL&lowbar;VALIDATION&lowbar;REGEX&period;test&lpar;email&rpar;&rpar; &lbrace;&NewLine; console&period;warn&lpar;»Invalid email provided&comma; escape»&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine; const normalizedEmail &equals; email&period;trim&lpar;&rpar;&period;toLowerCase&lpar;&rpar;&semi;&NewLine; const encoder &equals; new TextEncoder&lpar;&rpar;&semi;&NewLine; const data &equals; encoder&period;encode&lpar;normalizedEmail&rpar;&semi;&NewLine; const hashBuffer &equals; await crypto&period;subtle&period;digest&lpar;»SHA-256″&comma; data&rpar;&semi;&NewLine; const sha256 &equals; Array&period;from&lpar;new Uint8Array&lpar;hashBuffer&rpar;&rpar;&NewLine; &period;map&lpar;b &equals;> b&period;toString&lpar;16&rpar;&period;padStart&lpar;2&comma; «0»&rpar;&rpar;&NewLine; &period;join&lpar;»»&rpar;&semi;&NewLine; &NewLine; ats&period;setAdditionalData&lpar;&lbrace;&NewLine; ‘type’&colon; ‘emailHashes’&comma;&NewLine; ‘id’&colon; &lbrack;&grave;&dollar;&lbrace;sha256&rcub;&grave;&rsqb;&NewLine; &rcub;&rpar;&NewLine; &rcub;&NewLine;&NewLine; function setCookie&lpar;token&rpar; &lbrace;&NewLine; &sol;&sol; set cookie&NewLine; const date &equals; new Date&lpar;&rpar;&semi;&NewLine; date&period;setMonth&lpar;date&period;getMonth&lpar;&rpar; &plus; 1&rpar;&semi;&NewLine; const expires &equals; ‘expires&equals;’ &plus; date&period;toUTCString&lpar;&rpar;&semi;&NewLine; document&period;cookie &equals; COOKIE &plus; ‘&equals;’ &plus; token &plus; ‘&semi; ‘ &plus; expires &plus; ‘&semi; path&equals;&sol;&semi;’&semi;&NewLine; &rcub;&NewLine;&NewLine; function deleteCookie&lpar;&rpar; &lbrace;&NewLine; &sol;&sol; delete cookie&NewLine; document&period;cookie &equals; COOKIE &plus; ‘&equals;&semi; expires&equals;’ &plus; OLD&lowbar;DATE &plus; ‘&semi; path&equals;&sol;’&semi;&NewLine; &rcub;&NewLine; &rcub;&comma;&NewLine;&rsqb;&rpar;&semi;&NewLine;&sol;&sol; end of initialisation &lpar;init&rpar;&NewLine;&NewLine;&sol;&sol; debugging function&NewLine;function debug&lpar;message&rpar; &lbrace;&NewLine; if &lpar;DEBUGGING&rpar; console&period;log&lpar;’&lbrack;Login link javascript&rsqb;&colon; ‘ &plus; message&rpar;&semi;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;»&period;widget&lowbar;&lowbar;shares»&comma; function&lpar;sharesElement&rpar;&lbrace;&NewLine; let currentUrl &equals; window&period;location&period;href&semi;&NewLine; console&period;log&lpar;sharesElement&rpar;&semi;&NewLine; let wppShareUrl &equals; «https&colon;&sol;&sol;web&period;whatsapp&period;com&colon;&sol;&sol;send&quest;text&equals;» &plus; currentUrl&semi;&NewLine; let wppBtn &equals; document&period;createElement&lpar;»a»&rpar;&semi;&NewLine; wppBtn&period;innerHTML &equals; &grave;<i aria-hidden&equals;»true» class&equals;»icons-share whatsapp fa fa-whatsapp»>&grave;&NewLine; wppBtn&period;setAttribute&lpar;»href»&comma; wppShareUrl&rpar;&semi;&NewLine; wppBtn&period;setAttribute&lpar;»data-track-share»&comma; «WhatsApp»&rpar;&semi;&NewLine; wppBtn&period;setAttribute&lpar;»class»&comma; «share share-whatsapp-desktop show-buttons»&rpar;&semi;&NewLine; wppBtn&period;setAttribute&lpar;»rel»&comma; «noopener noreferrer»&rpar;&semi;&NewLine; wppBtn&period;setAttribute&lpar;»aria-label»&comma; «Share on WhatsApp»&rpar;&semi;&NewLine;&NewLine; &sol;&ast; let fbShareUrl &equals; «fb-messenger&colon;&sol;&sol;share&sol;&quest;link&equals;» &plus; currentUrl&semi;&NewLine; let fbBtn &equals; document&period;createElement&lpar;»a»&rpar;&semi;&NewLine; fbBtn&period;innerHTML &equals; &grave;<i aria-hidden&equals;»true» class&equals;»icons-share messenger fa fa-facebook-messenger»>&grave;&NewLine; fbBtn&period;setAttribute&lpar;»href»&comma; fbShareUrl&rpar;&semi;&NewLine; fbBtn&period;setAttribute&lpar;»data-track-share»&comma; «Facebook Messenger»&rpar;&semi;&NewLine; fbBtn&period;setAttribute&lpar;»class»&comma; «share share-facebook-messenger show-buttons»&rpar;&semi;&NewLine; fbBtn&period;setAttribute&lpar;»rel»&comma; «noopener noreferrer»&rpar;&semi;&NewLine; fbBtn&period;setAttribute&lpar;»aria-label»&comma; «Share on Facebook Messenger»&rpar;&semi;&NewLine;&NewLine; sharesElement&period;insertBefore&lpar;wppBtn&comma; sharesElement&period;children&lbrack;2&rsqb;&rpar;&semi;&NewLine; sharesElement&period;insertBefore&lpar;fbBtn&comma; sharesElement&period;children&lbrack;-1&rsqb;&rpar;&semi; &ast;&sol;&NewLine;&rcub;&rpar;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; if &lpar;&excl;CSS&period;supports&lpar;’selector&lpar;&colon;has&lpar;&ast;&rpar;&rpar;’&rpar;&rpar; &lbrace;&NewLine; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;»&period;widget»&comma; function&lpar;post&rpar;&lbrace;&NewLine; const isMemberPost &equals; Boolean&lpar;post&period;querySelector&lpar;’&period;member-post-label’&rpar;&rpar;&semi;&NewLine;&NewLine; if &lpar;isMemberPost&rpar; &lbrace;&NewLine; const label &equals; post&period;querySelector&lpar;’&period;member-post-label’&rpar;&semi;&NewLine; const postContainer &equals; label&period;closest&lpar;’&period;widget’&rpar;&semi;&NewLine;&NewLine; return postContainer&period;classList&period;add&lpar;’member’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; return false&semi;&NewLine;&NewLine; &sol;&sol;return isMemberPost &quest; post&period;classList&period;add&lpar;’member’&rpar; &colon; false&semi;&NewLine; &rcub;&rpar;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; window&period;REBELMOUSE&lowbar;STDLIB&period;loadExternalScript&lpar;»&sol;&sol;scripts&period;loyaltypoints&period;gbnews&period;com&sol;index&period;js&quest;v&equals;1″&comma; function&lpar;&rpar; &lbrace;&NewLine; &NewLine; console&period;log&lpar;»&lbrack;gbnCE&rsqb; Script loaded»&rpar;&semi;&NewLine; &NewLine; &rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; var comments &equals; document&period;getElementById&lpar;’comments’&rpar;&semi;&NewLine;var comments&lowbar;buttons5 &equals; document&period;getElementsByClassName&lpar;»comments&lowbar;&lowbar;button»&rpar;&semi;&NewLine;var attempts &equals; 0&semi;&NewLine;var engbar &equals; document&period;querySelector&lpar;’&period;engbar’&rpar;&semi;&NewLine;var comments&lowbar;loaded &equals; false&semi;&NewLine;const max&lowbar;attempts &equals; 15&semi;&NewLine;const wait&lowbar;interval &equals; 120&semi;&NewLine;const engbar&lowbar;h &equals; 80&semi;&NewLine;const margin &equals; 35&semi;&NewLine;const timeout &equals; 2500&semi;&NewLine;const conversation&lowbar;starter&lowbar;active &equals; false&semi;&NewLine;const debugging &equals; false&semi;&NewLine;&NewLine;var isUserScrollingUp &equals; false&semi;&NewLine;var lastScrollY &equals; window&period;scrollY&semi;&NewLine;var scrollingActive &equals; false&semi;&NewLine;&NewLine;&sol;&sol; new bit&NewLine;var scrollUpThreshold &equals; 5&semi;&NewLine;&NewLine;&NewLine; &NewLine;debug&lpar;»Hash &equals; «&plus;location&period;hash&rpar;&NewLine;if &lpar;location&period;hash &equals;&equals;&equals; «&num;comments» &vert;&vert; location&period;hash &equals;&equals;&equals; «&num;viafoura-conversations-id»&rpar; &lbrace;&NewLine;&Tab;debug&lpar;»Scrolling to comments due to hash &equals; «&plus;location&period;hash&rpar;&semi; &Tab;&NewLine;&Tab;scrollToComments&lpar;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;if &lpar;comments&lowbar;buttons5&period;length&rpar; &lbrace;&NewLine; for&lpar;var i &equals; 0&semi; i<comments&lowbar;buttons5&period;length&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; comments&lowbar;buttons5&lbrack;i&rsqb;&period;onclick&equals;function&lpar;&rpar; &lbrace;&NewLine; debug&lpar;»Comments link clicked»&rpar;&semi;&NewLine; scrollToComments&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&sol;&sol; function 1&NewLine;&sol;&sol; set scrollingActive to true &lpar;indicating scrolling is happening&rpar;&NewLine;&sol;&sol; call smoothScroll&lpar;&rpar; to scroll to the comments section&NewLine;&sol;&sol; checks if isUserScrollingUp is true – if yes then aborts and prevents further action happening&NewLine;function scrollToComments&lpar;&rpar; &lbrace;&NewLine; debug&lpar;attempts &plus; ‘ scrollToComments’&rpar;&semi;&NewLine;&NewLine; var offset &equals; &lpar;engbar &quest; engbar&period;offsetHeight &colon; engbar&lowbar;h&rpar; &plus; margin&semi;&NewLine;&NewLine; var OB &equals; document&period;querySelector&lpar;’&period;OUTBRAIN’&rpar;&semi;&NewLine; var adBlock &equals; false&semi;&NewLine;&NewLine; scrollingActive &equals; true&semi;&NewLine; smoothScroll&lpar;comments&comma; offset&rpar;&period;then&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; if &lpar;isUserScrollingUp&rpar; &lbrace;&NewLine; debug&lpar;»Scrolling up detected&comma; canceling scrollToComments»&rpar;&semi;&NewLine; scrollingActive &equals; false&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; check for ad blockers&NewLine; if &lpar;OB&rpar; &lbrace;&NewLine; adBlock &equals; window&period;getComputedStyle&lpar;OB&rpar;&quest;&period;display &equals;&equals;&equals; «none»&semi;&NewLine; debug&lpar;’ad blocker ‘ &plus; &lpar;adBlock &quest; ‘detected’ &colon; ‘not detected’&rpar;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; if Viafoura not yet inserted into Outbrain try again&NewLine; if &lpar;&excl;comments&lowbar;loaded && &excl;comments&period;closest&lpar;’&period;OUTBRAIN’&rpar; && attempts < max&lowbar;attempts && &excl;adBlock&rpar; &lbrace;&NewLine; &sol;&sol; wait and then try scrolling again&NewLine; debug&lpar;»Trying again&period;&period;&period;»&rpar;&semi;&NewLine; attempts&plus;&plus;&semi;&NewLine; setTimeout&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; if &lpar;&excl;isUserScrollingUp&rpar; &lbrace;&NewLine; scrollToComments&lpar;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; scrollingActive &equals; false&semi;&NewLine; &rcub;&NewLine; &rcub;&comma; Math&period;floor&lpar;wait&lowbar;interval &ast; &lpar;attempts &plus; 1&rpar;&rpar;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; the final attempt&NewLine; debug&lpar;»The final attempt»&rpar;&semi;&NewLine; smoothScroll&lpar;comments&comma; offset&rpar;&period;then&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; if &lpar;document&period;querySelector&lpar;’&period;OUTBRAIN &period;comments-wrapper’&rpar; &equals;&equals;&equals; null&rpar; &lbrace;&NewLine; debug&lpar;’failed to insert comments into Outbrain’&rpar;&semi;&NewLine; if &lpar;document&period;querySelector&lpar;’&period;comments-wrapper &period;viafoura’&rpar;&rpar; &lbrace;&NewLine; document&period;querySelector&lpar;’&period;comments-wrapper &period;viafoura’&rpar;&period;style&period;display &equals; «block»&semi;&NewLine; &rcub;&NewLine;&NewLine; if &lpar;typeof window&period;OB&lowbar;loaded &equals;&equals;&equals; ‘undefined’ &vert;&vert; &excl;window&period;OB&lowbar;loaded&rpar; &lbrace;&NewLine; debug&lpar;’Outbrain did not load’&rpar;&semi;&NewLine; document&period;querySelector&lpar;’&period;you-may-like&lowbar;&lowbar;wrapper’&rpar;&period;style&period;display &equals; «none»&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; debug&lpar;’Comments should now be in view’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; set loaded flag&NewLine; comments&lowbar;loaded &equals; true&semi;&NewLine; scrollingActive &equals; false&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&period;catch&lpar;err &equals;> &lbrace;&NewLine; scrollingActive &equals; false&semi;&NewLine; debug&lpar;err&period;message&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; function 2&NewLine;&sol;&sol; handling of the scroll to comments action&NewLine;&sol;&sol; promise is resolved when the target is reached&NewLine;function smoothScroll&lpar;elem&comma; offset &equals; 0&rpar; &lbrace;&NewLine; debug&lpar;»smoothScroll with offset &equals; » &plus; offset&rpar;&semi;&NewLine;&NewLine; const rect &equals; elem&period;getBoundingClientRect&lpar;&rpar;&semi;&NewLine; let targetPosition &equals; Math&period;floor&lpar;rect&period;top &plus; window&period;pageYOffset – offset&rpar;&semi;&NewLine; window&period;scrollTo&lpar;&lbrace;&NewLine; top&colon; targetPosition&comma;&NewLine; behavior&colon; ‘smooth’&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; let p &equals; new Promise&lpar;&lpar;resolve&comma; reject&rpar; &equals;> &lbrace;&NewLine; const failed &equals; setTimeout&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; reject&lpar;new Error&lpar;»Scroll to comments timed out»&rpar;&rpar;&semi;&NewLine; &rcub;&comma; timeout&rpar;&semi;&NewLine;&NewLine; const scrollHandler &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; if &lpar;Math&period;abs&lpar;window&period;pageYOffset – targetPosition&rpar; < 10&rpar; &lbrace;&NewLine; window&period;removeEventListener&lpar;»scroll»&comma; scrollHandler&rpar;&semi;&NewLine; clearTimeout&lpar;failed&rpar;&semi;&NewLine; resolve&lpar;»Target reached&comma; disabling scroll listener»&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; if &lpar;window&period;scrollY < lastScrollY&rpar; &lbrace;&NewLine; isUserScrollingUp &equals; true&semi;&NewLine; debug&lpar;»Scroll up detected»&rpar;&semi;&NewLine; window&period;removeEventListener&lpar;»scroll»&comma; scrollHandler&rpar;&semi;&NewLine; clearTimeout&lpar;failed&rpar;&semi;&NewLine; resolve&lpar;»User is scrolling up&comma; disabling scroll listener»&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&semi;&NewLine;&NewLine; if &lpar;Math&period;abs&lpar;window&period;pageYOffset – targetPosition&rpar; < 10&rpar; &lbrace;&NewLine; clearTimeout&lpar;failed&rpar;&semi;&NewLine; resolve&lpar;»Scrolled to target position»&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; window&period;addEventListener&lpar;»scroll»&comma; scrollHandler&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; p&period;then&lpar;value &equals;> &lbrace;&NewLine; debug&lpar;value&rpar;&semi;&NewLine; &rcub;&rpar;&period;catch&lpar;err &equals;> &lbrace;&NewLine; debug&lpar;err&period;message&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; return p&semi;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; Add a scroll event listener to detect scroll direction&NewLine;&sol;&sol; Detects the scroll direction&NewLine;&sol;&sol; If the user starts to scroll up WHILE the script is running &lpar;more than the threshold set&rpar;&comma; set scrollingActive to false and ABORT scroll action&NewLine;window&period;addEventListener&lpar;’scroll’&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine;&NewLine; &sol;&sol; if &lpar;window&period;scrollY < lastScrollY&rpar; &lbrace;&NewLine; if &lpar;lastScrollY – window&period;scrollY > scrollUpThreshold&rpar; &lbrace;&NewLine; isUserScrollingUp &equals; true&semi;&NewLine; if &lpar;scrollingActive&rpar; &lbrace;&NewLine; debug&lpar;»User started scrolling up during scroll&comma; aborting»&rpar;&semi;&NewLine; scrollingActive &equals; false&semi;&NewLine; &rcub;&NewLine; &rcub; else &lbrace;&NewLine; isUserScrollingUp &equals; false&semi;&NewLine; &rcub;&NewLine; lastScrollY &equals; window&period;scrollY&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;&NewLine;function debug&lpar;message&rpar; &lbrace;&NewLine; if &lpar;debugging&rpar;&NewLine; console&period;log&lpar;’DEBUG &lbrack;Scroll to comments&rsqb;&colon; ‘ &plus; message&rpar;&semi;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; let shareButton &equals; document&period;querySelector&lpar;’&period;share&lowbar;&lowbar;button’&rpar;&semi;&NewLine;let copyText &equals; document&period;querySelector&lpar;’&period;share-copy-link’&rpar;&semi;&NewLine;const shareDialog &equals; document&period;querySelector&lpar;’&period;share-background’&rpar;&semi;&NewLine;const url &equals; document&period;querySelector&lpar;’link&lbrack;rel&equals;canonical&rsqb;’&rpar;&NewLine; &quest; document&period;querySelector&lpar;’link&lbrack;rel&equals;canonical&rsqb;’&rpar;&period;href&NewLine; &colon; document&period;location&period;href&semi;&NewLine;const closeButton &equals; document&period;querySelector&lpar;’&period;close-button’&rpar;&semi;&NewLine;const title &equals; document&period;title&semi;&NewLine;&NewLine;&sol;&sol; const article &equals; document&period;querySelector&lpar;’article&lbrack;elid&rsqb;’&rpar;&semi;&NewLine;&sol;&sol; const articleId &equals; article &quest; article&period;getAttribute&lpar;’elid’&rpar; &colon; null&semi;&NewLine;&NewLine;let pageLink &equals; window&period;location&period;href&semi;&NewLine;&NewLine;&sol;&sol; initialise Gamification window object&NewLine;window&period;gbnCE &equals; window&period;gbnCE &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine;closeButton&period;addEventListener&lpar;’click’&comma; &lpar;event&rpar; &equals;> &lbrace;&NewLine; shareDialog&period;classList&period;remove&lpar;’is-open’&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;shareButton&period;addEventListener&lpar;’click’&comma; &lpar;event&rpar; &equals;> &lbrace;&NewLine; if &lpar;navigator&period;share&rpar; &lbrace;&NewLine; navigator&NewLine; &period;share&lpar;&lbrace;&NewLine; title&colon; title&comma;&NewLine; url&colon; url&comma;&NewLine; &rcub;&rpar;&NewLine; &period;then&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’Thanks for sharing&excl;’&comma; title&rpar;&semi;&NewLine; &sol;&sol; console&period;log&lpar;»article id is – «&comma; articleId&rpar;&semi;&NewLine; window&period;gbnCE&period;push&lpar;&lbrack;’event’&comma; ‘share’&comma; ‘article’&comma; pageLink&rsqb;&rpar;&semi;&NewLine; console&period;log&lpar;’gbnCE push’&comma; window&period;gbnCE&rpar;&semi;&NewLine; &rcub;&rpar;&NewLine; &period;catch&lpar;console&period;error&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; shareDialog&period;classList&period;add&lpar;’is-open’&rpar;&semi;&NewLine; window&period;gbnCE&period;push&lpar;&lbrack;’event’&comma; ‘share’&comma; ‘article’&comma; articleId&rsqb;&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;copyText&period;addEventListener&lpar;’click’&comma; &lpar;event&rpar; &equals;> &lbrace;&NewLine; navigator&period;clipboard&period;writeText&lpar;window&period;location&period;href&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; let lastScrollTop &equals; 0&comma;&NewLine; engBar &equals; document&period;querySelector&lpar;’&period;article-shares-el’&rpar;&semi;&NewLine;&NewLine;window&period;addEventListener&lpar;»scroll»&comma; function&lpar;&rpar;&lbrace; &NewLine; &NewLine; let st &equals; window&period;pageYOffset &vert;&vert; document&period;documentElement&period;scrollTop&semi; &NewLine; showCommentsBtn&lpar;&rpar;&NewLine; if &lpar;st > lastScrollTop&rpar; &lbrace;&NewLine; if &lpar;document&period;body&period;scrollTop > 900 &vert;&vert; document&period;documentElement&period;scrollTop > 900&rpar; &lbrace;&NewLine; engBar&period;style&period;opacity &equals; 100&semi;&NewLine; &sol;&sol; z-index was set to 999&semi;&NewLine; engBar&period;style&period;zIndex &equals; 98&semi; &NewLine; engBar&period;style&period;display &equals; «flex»&semi;&NewLine;&NewLine; &rcub; &NewLine; &rcub; &NewLine; &sol;&sol; else if &lpar;st < lastScrollTop&rpar; &lbrace;&NewLine; &sol;&sol; showCommentsBtn&lpar;&rpar;&NewLine; &sol;&sol; if &lpar;document&period;body&period;scrollTop > 1100 &vert;&vert; document&period;documentElement&period;scrollTop > 1100&rpar; &lbrace;&NewLine; &sol;&sol; engBar&period;style&period;opacity &equals; 100&semi;&NewLine; &sol;&sol; engBar&period;style&period;zIndex &equals; 999&semi;&NewLine;&NewLine; &NewLine; &sol;&sol; &rcub;&NewLine; &sol;&sol; else&lbrace;&NewLine; &sol;&sol; showCommentsBtn&lpar;&rpar;&NewLine; &sol;&sol; engBar&period;style&period;opacity &equals; 0&semi; &NewLine; &sol;&sol; engBar&period;style&period;zIndex &equals; -1&semi;&NewLine; &sol;&sol; engBar&period;style&period;display &equals; «none»&semi;&NewLine;&NewLine; &sol;&sol; &rcub;&NewLine; &sol;&sol; &rcub;&NewLine; lastScrollTop &equals; st <&equals; 0 &quest; 0 &colon; st&semi; &sol;&sol; For Mobile or negative scrolling&NewLine;&rcub;&comma; false&rpar;&semi;&NewLine;&NewLine;function showCommentsBtn&lpar;&rpar;&lbrace;&NewLine; if&lpar;document&period;getElementById&lpar;’comments’&rpar;&rpar;&lbrace;&NewLine; let commentsElement &equals; document&period;getElementById&lpar;’comments’&rpar;&comma;&NewLine; bounding &equals; commentsElement&period;getBoundingClientRect&lpar;&rpar;&comma;&NewLine; commentsBtn &equals; document&period;querySelector&lpar;’&period;commentIcon’&rpar;&comma;&NewLine; commentsHeight &equals; commentsElement&period;offsetHeight&semi;&NewLine;&NewLine;&NewLine; if &lpar;commentsElement && bounding&period;top >&equals; -&lpar;commentsHeight&rpar; && bounding&period;left >&equals; 0 && bounding&period;right <&equals; window&period;innerWidth && bounding&period;bottom <&equals; window&period;innerHeight – 230&rpar; &lbrace;&NewLine; commentsBtn&period;style&period;opacity &equals; 0&semi;&NewLine; commentsBtn&period;style&period;cursor &equals; ‘default’&semi; &NewLine; commentsBtn&period;style&period;pointerEvents &equals; «none»&semi;&NewLine; &sol;&sol;console&period;log&lpar;’Element is in the viewport&excl;’&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; commentsBtn&period;style&period;opacity &equals; 100&semi;&NewLine; commentsBtn&period;style&period;cursor &equals; ‘pointer’&semi; &NewLine; commentsBtn&period;style&period;pointerEvents &equals; «auto»&semi;&NewLine;&NewLine; &sol;&sol;console&period;log&lpar;’Element is NOT in the viewport&excl;’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;else&lbrace;&NewLine; document&period;querySelector&lpar;’&period;commentIcon’&rpar;&period;style&period;display &equals; ‘none’&semi;&NewLine;&NewLine; &rcub;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; console&period;log&lpar;’&equals;&equals;&equals; CONTENT LOCK SCRIPT LOADED &equals;&equals;&equals;’&rpar;&semi;&NewLine;&NewLine;const article &equals; document&period;querySelector&lpar;’&period;body-description’&rpar;&semi;&NewLine;const rebel1 &equals; null&semi; &sol;&sol; force paragraph counting instead of rebelltitem1&NewLine;let lock&semi;&NewLine;let ith &equals; 0&semi;&NewLine;let pCount &equals; 0&semi;&NewLine;&NewLine;let removedContent &equals; &lbrack;&rsqb;&semi;&NewLine;let removedRebel1Content &equals; &lbrack;&rsqb;&semi;&NewLine;let removedPuzzle &equals; null&semi;&NewLine;&NewLine;let contentShouldBeLocked &equals; false&semi;&NewLine;&NewLine;&sol;&sol; Store current offer&sol;term IDs in memory for potential localStorage save&NewLine;let currentOfferId &equals; null&semi;&NewLine;let currentTermId &equals; null&semi;&NewLine;&NewLine;const DEBUGGING &equals; false&semi;&NewLine;&NewLine;debug&lpar;’Content lock script started’&rpar;&semi;&NewLine;&NewLine;&sol;&sol; Ensure &num;piano-lock element exists in the DOM&NewLine;function ensureLockExists&lpar;&rpar; &lbrace;&NewLine; lock &equals; document&period;querySelector&lpar;’&num;piano-lock’&rpar;&semi;&NewLine; if &lpar;&excl;lock&rpar; &lbrace;&NewLine; debug&lpar;’Creating new &num;piano-lock element’&rpar;&semi;&NewLine; lock &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine; lock&period;id &equals; ‘piano-lock’&semi;&NewLine; document&period;body&period;appendChild&lpar;lock&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; debug&lpar;’&num;piano-lock already exists’&rpar;&semi;&NewLine; &rcub;&NewLine; return lock&semi;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; Move lock element inside article and make it visible&NewLine;const addLockStyles &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; if &lpar;&excl;lock&period;parentElement &vert;&vert; lock&period;parentElement &excl;&equals;&equals; article&rpar; &lbrace;&NewLine; article&period;appendChild&lpar;lock&rpar;&semi;&NewLine; &rcub;&NewLine; lock&period;classList&period;add&lpar;’locked’&rpar;&semi;&NewLine; lock&period;style&period;display &equals; ‘block’&semi;&NewLine;&rcub;&semi;&NewLine;&NewLine;&sol;&sol; Remove article content after 2nd paragraph and show the lock&NewLine;function hide&lowbar;article&lpar;&rpar; &lbrace;&NewLine; debug&lpar;’hide&lowbar;article called’&rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;article&rpar; &lbrace;&NewLine; debug&lpar;’ERROR&colon; &period;body-description not found’&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine;&NewLine; removedContent &equals; &lbrack;&rsqb;&semi;&NewLine; removedRebel1Content &equals; &lbrack;&rsqb;&semi;&NewLine; pCount &equals; 0&semi;&NewLine; ith &equals; 0&semi;&NewLine;&NewLine; &sol;&sol; Find the index of the 2nd paragraph&NewLine; for &lpar;let i &equals; 0&semi; i < article&period;children&period;length&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; if &lpar;article&period;children&lbrack;i&rsqb;&period;tagName &equals;&equals; ‘P’&rpar; &lbrace;&NewLine; pCount&plus;&plus;&semi;&NewLine; &rcub;&NewLine; if &lpar;pCount &equals;&equals; 2&rpar; &lbrace;&NewLine; ith &equals; i&semi;&NewLine; break&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; debug&lpar;’P count&colon; ‘ &plus; pCount &plus; ‘&comma; ith&colon; ‘ &plus; ith&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Move one position past the 2nd paragraph&NewLine; ith &plus;&equals; 1&semi;&NewLine;&NewLine; &sol;&sol; Remove all elements after the 2nd paragraph and store them&NewLine; for &lpar;let i &equals; article&period;children&period;length – 1&semi; i >&equals; ith&semi; i–&rpar; &lbrace;&NewLine; removedContent&period;unshift&lpar;&lbrace;&NewLine; element&colon; article&period;children&lbrack;i&rsqb;&comma;&NewLine; index&colon; i&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; article&period;children&lbrack;i&rsqb;&period;remove&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; addLockStyles&lpar;&rpar;&semi;&NewLine; debug&lpar;’Content removed from DOM&period; Items removed&colon; ‘ &plus; removedContent&period;length&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; Restore all removed article content and hide the lock&NewLine;function show&lowbar;article&lpar;&rpar; &lbrace;&NewLine; debug&lpar;’show&lowbar;article called’&rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;article&rpar; return&semi;&NewLine;&NewLine; &sol;&sol; Remove and hide the lock element&NewLine; if &lpar;lock && lock&period;parentElement&rpar; &lbrace;&NewLine; lock&period;remove&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; if &lpar;lock&rpar; &lbrace;&NewLine; lock&period;classList&period;remove&lpar;’locked’&rpar;&semi;&NewLine; lock&period;style&period;display &equals; ‘none’&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Restore article content&NewLine; if &lpar;removedContent&period;length > 0&rpar; &lbrace;&NewLine; debug&lpar;’Restoring article content&colon; ‘ &plus; removedContent&period;length &plus; ‘ items’&rpar;&semi;&NewLine; removedContent&period;forEach&lpar;&lpar;item&rpar; &equals;> &lbrace;&NewLine; article&period;appendChild&lpar;item&period;element&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; removedContent &equals; &lbrack;&rsqb;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Restore puzzle container if it was removed&NewLine; if &lpar;removedPuzzle&rpar; &lbrace;&NewLine; removedPuzzle&period;parent&period;appendChild&lpar;removedPuzzle&period;element&rpar;&semi;&NewLine; removedPuzzle &equals; null&semi;&NewLine; &rcub;&NewLine;&NewLine; debug&lpar;’Content restored to DOM’&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; Piano integration&NewLine;tp &equals; window&period;tp &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine;ensureLockExists&lpar;&rpar;&semi;&NewLine;&NewLine;tp&period;push&lpar;&lbrack;&NewLine; ‘init’&comma;&NewLine; function &lpar;&rpar; &lbrace;&NewLine; debug&lpar;’Piano initialized’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Set Piano ID to show registration screen by default&NewLine; tp&period;pianoId&period;init&lpar;&lbrace;&NewLine; screen&colon; ‘register’&comma;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; ——————————————————-&NewLine; &sol;&sol; RESUME CHECKOUT AFTER RELOAD &lpar;localStorage fallback&rpar;&NewLine; &sol;&sol; ——————————————————-&NewLine; var pendingOfferId &equals; localStorage&period;getItem&lpar;’piano&lowbar;pending&lowbar;offerId’&rpar;&semi;&NewLine; var pendingTermId &equals; localStorage&period;getItem&lpar;’piano&lowbar;pending&lowbar;termId’&rpar;&semi;&NewLine;&NewLine; if &lpar;pendingOfferId && pendingTermId&rpar; &lbrace;&NewLine; debug&lpar;’Found pending checkout after reload – resuming&colon; ‘ &plus; pendingTermId&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Clear localStorage before resuming to avoid infinite loop&NewLine; localStorage&period;removeItem&lpar;’piano&lowbar;pending&lowbar;offerId’&rpar;&semi;&NewLine; localStorage&period;removeItem&lpar;’piano&lowbar;pending&lowbar;termId’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Small delay to allow Piano to fully initialise before resuming checkout&NewLine; setTimeout&lpar;function &lpar;&rpar; &lbrace;&NewLine; debug&lpar;’Calling tp&period;offer&period;startCheckout with offerId&colon; ‘ &plus; pendingOfferId &plus; ‘&comma; termId&colon; ‘ &plus; pendingTermId&rpar;&semi;&NewLine; tp&period;offer&period;startCheckout&lpar;&lbrace;&NewLine; offerId&colon; pendingOfferId&comma;&NewLine; termId&colon; pendingTermId&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&comma; 800&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; ——————————————————-&NewLine; &sol;&sol; SHOW OFFER HANDLER&NewLine; &sol;&sol; ——————————————————-&NewLine; tp&period;push&lpar;&lbrack;&NewLine; ‘addHandler’&comma;&NewLine; ‘showOffer’&comma;&NewLine; function &lpar;offerParams&rpar; &lbrace;&NewLine; debug&lpar;’showOffer triggered’&rpar;&semi;&NewLine; debug&lpar;’Container selector&colon; ‘ &plus; offerParams&period;containerSelector&rpar;&semi;&NewLine; debug&lpar;’Display mode&colon; ‘ &plus; offerParams&period;displayMode&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Store in memory &lpar;NOT localStorage&rpar; for potential use later&NewLine; &sol;&sol; Only saved to localStorage if a reload becomes unavoidable&NewLine; currentOfferId &equals; offerParams&period;offerId &vert;&vert; null&semi;&NewLine; currentTermId &equals; offerParams&period;termId &vert;&vert; null&semi;&NewLine; debug&lpar;’Stored in memory – offerId&colon; ‘ &plus; currentOfferId &plus; ‘&comma; termId&colon; ‘ &plus; currentTermId&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Only hide article when the inline offer is shown inside &num;piano-lock&NewLine; if &lpar;offerParams&period;containerSelector &equals;&equals; ‘&num;piano-lock’&rpar; &lbrace;&NewLine; debug&lpar;’Inline offer – hiding article’&rpar;&semi;&NewLine; contentShouldBeLocked &equals; true&semi;&NewLine; hide&lowbar;article&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma;&NewLine; &rsqb;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; ——————————————————-&NewLine; &sol;&sol; CHECKOUT COMPLETE HANDLER&NewLine; &sol;&sol; ——————————————————-&NewLine; tp&period;push&lpar;&lbrack;&NewLine; ‘addHandler’&comma;&NewLine; ‘checkoutComplete’&comma;&NewLine; function &lpar;conversionData&rpar; &lbrace;&NewLine; debug&lpar;’Checkout complete – showing article’&rpar;&semi;&NewLine; debug&lpar;’Conversion data&colon; ‘ &plus; JSON&period;stringify&lpar;conversionData&rpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Clear any pending checkout data&NewLine; localStorage&period;removeItem&lpar;’piano&lowbar;pending&lowbar;offerId’&rpar;&semi;&NewLine; localStorage&period;removeItem&lpar;’piano&lowbar;pending&lowbar;termId’&rpar;&semi;&NewLine; currentOfferId &equals; null&semi;&NewLine; currentTermId &equals; null&semi;&NewLine;&NewLine; contentShouldBeLocked &equals; false&semi;&NewLine; show&lowbar;article&lpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Delay reload to allow Piano to finalize conversion tracking&NewLine; setTimeout&lpar;function &lpar;&rpar; &lbrace;&NewLine; location&period;reload&lpar;&rpar;&semi;&NewLine; &rcub;&comma; 2000&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; &rsqb;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; ——————————————————-&NewLine; &sol;&sol; LOGIN SUCCESS HANDLER&NewLine; &sol;&sol; ——————————————————-&NewLine; tp&period;push&lpar;&lbrack;&NewLine; ‘addHandler’&comma;&NewLine; ‘loginSuccess’&comma;&NewLine; function &lpar;data&rpar; &lbrace;&NewLine; debug&lpar;’Login success – source&colon; ‘ &plus; data&period;source&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Login happened inside the offer template &lpar;inline or modal&rpar; &mdash&semi;&NewLine; &sol;&sol; do NOT reload&comma; let Piano continue to the checkout&sol;payment step&NewLine; if &lpar;data&period;source &equals;&equals;&equals; ‘OFFER’&rpar; &lbrace;&NewLine; debug&lpar;’Login during checkout – skipping reload’&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Standalone login &mdash&semi; check access and reload&NewLine; tp&period;api&period;callApi&lpar;’&sol;access&sol;list’&comma; &lbrace;&rcub;&comma; function &lpar;accessData&rpar; &lbrace;&NewLine; if &lpar;typeof accessData&period;data &excl;&equals; ‘undefined’&rpar; &lbrace;&NewLine; for &lpar;var i in accessData&period;data&rpar; &lbrace;&NewLine; if &lpar;accessData&period;data&lbrack;i&rsqb;&period;granted&rpar; &lbrace;&NewLine; debug&lpar;’User has access – clearing data and reloading’&rpar;&semi;&NewLine; localStorage&period;removeItem&lpar;’piano&lowbar;pending&lowbar;offerId’&rpar;&semi;&NewLine; localStorage&period;removeItem&lpar;’piano&lowbar;pending&lowbar;termId’&rpar;&semi;&NewLine; currentOfferId &equals; null&semi;&NewLine; currentTermId &equals; null&semi;&NewLine; contentShouldBeLocked &equals; false&semi;&NewLine; tp&period;offer&period;close&lpar;&rpar;&semi;&NewLine; location&period;reload&lpar;&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; No access after standalone login &mdash&semi;&NewLine; &sol;&sol; save checkout data to localStorage before reload so it can resume&NewLine; if &lpar;currentOfferId && currentTermId&rpar; &lbrace;&NewLine; debug&lpar;’Saving checkout data to localStorage before reload’&rpar;&semi;&NewLine; debug&lpar;’offerId&colon; ‘ &plus; currentOfferId &plus; ‘&comma; termId&colon; ‘ &plus; currentTermId&rpar;&semi;&NewLine; localStorage&period;setItem&lpar;’piano&lowbar;pending&lowbar;offerId’&comma; currentOfferId&rpar;&semi;&NewLine; localStorage&period;setItem&lpar;’piano&lowbar;pending&lowbar;termId’&comma; currentTermId&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; debug&lpar;’No access after standalone login – reloading’&rpar;&semi;&NewLine; location&period;reload&lpar;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; &rsqb;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; ——————————————————-&NewLine; &sol;&sol; CLOSE HANDLER&NewLine; &sol;&sol; ——————————————————-&NewLine; tp&period;push&lpar;&lbrack;&NewLine; ‘addHandler’&comma;&NewLine; ‘close’&comma;&NewLine; function &lpar;&rpar; &lbrace;&NewLine; debug&lpar;’Offer closed’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; If content was locked and user closes the modal without purchasing&comma;&NewLine; &sol;&sol; re-hide the article to ensure content remains locked&NewLine; if &lpar;contentShouldBeLocked&rpar; &lbrace;&NewLine; hide&lowbar;article&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma;&NewLine; &rsqb;&rpar;&semi;&NewLine; &rcub;&comma;&NewLine;&rsqb;&rpar;&semi;&NewLine;&NewLine;function debug&lpar;message&rpar; &lbrace;&NewLine; if &lpar;DEBUGGING&rpar; &lbrace;&NewLine; console&period;log&lpar;’&lbrack;Content Lock&rsqb;&colon; ‘ &plus; message&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; let postsToDisplay &equals; &lbrack;&rsqb;&semi;&NewLine;let fetchedPosts &equals; &lbrack;&rsqb;&semi;&NewLine;const fetchCount &equals; 25&semi;&NewLine;let preferencesData &equals; &lbrack;&rsqb;&semi;&NewLine;let currentPostSections &equals; &lbrack;&rsqb;&semi;&NewLine;let currentPostAllSections &equals; &lbrack;&rsqb;&semi;&NewLine;let sectionsToManuallyExcludeFromFetch &equals; &lbrack;&rsqb;&semi;&NewLine;let followedSectionsSet&comma; currentPostPrimarySection&comma; currentPostPrimarySectionParent &semi;&NewLine;&NewLine;const today &equals; new Date&lpar;&rpar;&semi;&NewLine;const newExpiryDate &equals; &lpar;daysFromNow &equals; 7&rpar; &equals;> &lpar;new Date&lpar;&rpar;&period;setDate&lpar;today&period;getDate&lpar;&rpar; &plus; daysFromNow&rpar; &rpar;&semi;&NewLine;const localPreferenceData &equals; JSON&period;parse&lpar;localStorage&period;hp&lowbar;data &vert;&vert; ‘&lbrace;&rcub;’&rpar;&semi;&NewLine;let visitedPostsSections &equals; localPreferenceData&period;visited&lowbar;posts&lowbar;sections &vert;&vert; &lbrace;&rcub;&semi;&NewLine;const systemSections &equals; localStorage&period;all&lowbar;sections &quest; JSON&period;parse&lpar;localStorage&period;all&lowbar;sections&rpar; &colon; null&NewLine;let allSectionsObj &equals; systemSections&quest;&period;sections&semi; &sol;&sol; using an object not array for efficiency&NewLine;let allSectionsIdMap &equals; systemSections&quest;&period;sectionsIdMap&semi; &sol;&sol; using an object not array for efficiency&NewLine;let sectionsToExclude &equals; systemSections&quest;&period;privateSections &vert;&vert; &lbrace;0&colon;’home’&rcub;&semi;&NewLine;let likedPostSectionsObj &equals; &lbrace;&rcub;&semi;&NewLine;window&period;trackedImpression &equals; false&semi;&NewLine;&NewLine;const sectionsToRunPersonalizedContent &equals; &lbrack;&NewLine; 588563276 &sol;&sol;sport&NewLine;&rsqb;&NewLine;&NewLine;const getAllSections &equals; async&lpar;&rpar; &equals;> &lbrace;&NewLine; try &lbrace;&NewLine; const req &equals; await fetch&lpar;&grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;get-sections&grave;&comma; &lbrace;&NewLine; method&colon; «GET»&comma;&NewLine; credentials&colon; «omit»&NewLine; &rcub;&rpar;&semi;&NewLine; const res &equals; await req&period;json&lpar;&rpar;&semi;&NewLine; allSectionsObj &equals; &lbrace;&rcub;&semi;&NewLine; allSectionsIdMap &equals; &lbrace;&rcub;&semi;&NewLine; sectionsToExclude &equals; &lbrace;&rcub;&semi;&NewLine; &sol;&sol; encode the section name to match the encoding of the followed topics and update the cache&NewLine; res&period;map&lpar;section &equals;> &lbrace;&NewLine; section&period;encodedTitle &equals; section&period;title&quest;&period;replace&lpar;&sol;&bsol;s&plus;&sol;g&comma; »&rpar;&semi; &NewLine; allSectionsObj&lbrack;section&period;encodedTitle&rsqb; &equals; section&semi; &NewLine; allSectionsIdMap&lbrack;section&period;id&rsqb; &equals; section&semi; &NewLine; if&lpar;section&period;status &excl;&equals;&equals; 2&rpar;&lbrace; &sol;&sol; not a public section&NewLine; sectionsToExclude&lbrack;section&period;id&rsqb; &equals; section&period;slug&semi;&NewLine; &rcub;&NewLine; return section&semi;&NewLine; &rcub;&rpar;&NewLine; sectionsToExclude&lbrack;0&rsqb; &equals; ‘home’&semi; &sol;&sol; manually excude the home section since it’s not returned from the endpoint&NewLine;&NewLine; localStorage&period;all&lowbar;sections &equals; JSON&period;stringify&lpar;&lbrace;&NewLine; sections&colon; allSectionsObj&comma;&NewLine; sectionsIdMap&colon; allSectionsIdMap&comma;&NewLine; privateSections&colon; sectionsToExclude&comma;&NewLine; expiry&colon; newExpiryDate&lpar;3&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; return res&semi;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;log&lpar;error&rpar;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;function manuallyExcludeSections&lpar;&rpar;&lbrace;&NewLine; const sectionsToManuallyExclude &equals; &lbrace;&NewLine; 2151427851 &colon; ‘alerts’&comma;&NewLine; 586688191 &colon; ‘non-content’&NewLine; &rcub;&semi;&NewLine;&NewLine; for &lpar;const &lbrack;key&comma; value&rsqb; of Object&period;entries&lpar;sectionsToManuallyExclude&rpar;&rpar; &lbrace;&NewLine; sectionsToExclude&lbrack;key&rsqb; &equals; value&semi;&NewLine; sectionsToManuallyExcludeFromFetch&period;push&lpar;key&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;function decodeSection&lpar;encodedTitle&rpar; &lbrace;&NewLine; return allSectionsObj&quest;&period;&lbrack;encodedTitle&rsqb;&quest;&period;id &vert;&vert; ‘section&lowbar;deprecated’ &semi;&NewLine;&rcub; &NewLine;&NewLine;const getUserPreferenceData &equals; async &lpar;&rpar; &equals;> &lbrace;&NewLine; if &lpar;&excl;tp &vert;&vert; &excl;tp&period;pianoId&rpar; return &lbrack;&rsqb;&semi;&NewLine;&NewLine; return new Promise&lpar;&lpar;resolve&comma; reject&rpar; &equals;> &lbrace;&NewLine; tp&period;pianoId&period;loadExtendedUser&lpar;&lbrace;&NewLine; formName&colon; ‘hyperpersonalisation&lowbar;fields’&comma;&NewLine; extendedUserLoaded&colon; function &lpar;data&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; preferencesData &equals; data&period;custom&lowbar;field&lowbar;values &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; resolve&lpar;preferencesData&rpar;&semi;&NewLine; &rcub; catch &lpar;parseError&rpar; &lbrace;&NewLine; reject&lpar;parseError&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma;&NewLine; extendedUserLoadFailed&colon; function &lpar;err&rpar; &lbrace;&NewLine; reject&lpar;err&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&semi;&NewLine;&NewLine;&NewLine;function validateLocalPreferenceData&lpar;&rpar; &lbrace;&NewLine; &sol;&sol;this removes visited posts that are over 7 days old from the localstorage to allow them be recommended again&NewLine; localPreferenceData&period;visited&lowbar;posts &equals; &lpar;localPreferenceData&period;visited&lowbar;posts &vert;&vert; &lbrack;&rsqb;&rpar;&period;filter&lpar;post &equals;> today < post&period;expiry&rpar;&semi;&NewLine; &sol;&sol;validate the viewed hp posts&NewLine; localPreferenceData&period;viewed&lowbar;hp&lowbar;posts &equals; &lpar;localPreferenceData&period;viewed&lowbar;hp&lowbar;posts &vert;&vert; &lbrack;&rsqb;&rpar;&period;filter&lpar;post &equals;> today < post&period;expiry&rpar;&semi;&NewLine; localStorage&period;hp&lowbar;data &equals; JSON&period;stringify&lpar;localPreferenceData&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function addCurrentPostToVisitedStore&lpar;&lowbar;id&comma; postSections&rpar; &lbrace;&NewLine; &sol;&sol;check if the post is already there&NewLine; const visitedPosts &equals; localPreferenceData&period;visited&lowbar;posts &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; const existingPost &equals; visitedPosts&quest;&period;find&lpar;post &equals;> post&period;id &equals;&equals; &lowbar;id&rpar;&semi;&NewLine; visitedPostsSections &equals; localPreferenceData&period;visited&lowbar;posts&lowbar;sections &vert;&vert; &lbrace;&rcub;&semi;&NewLine;&NewLine; &sol;&sol; check if the post was already visited in this browser in the last 7 days and update accordingly&NewLine; if &lpar;&excl;existingPost&rpar; &lbrace;&NewLine; console&period;log&lpar;’post added locally’&comma; &lowbar;id&rpar;&semi;&NewLine; visitedPosts&period;push&lpar;&lbrace; id&colon; &lowbar;id&comma; expiry&colon; newExpiryDate&lpar;&rpar; &rcub;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;log&lpar;’post already exists locally&period; Expiry time updated’&comma; &lowbar;id&rpar;&semi;&NewLine; existingPost&period;expiry &equals; newExpiryDate&lpar;&rpar;&semi; &sol;&sol; update the existing post by reference&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol;update the section visit count for the current post or for views post sections&NewLine; if &lpar;currentPostSections&period;length &vert;&vert; postSections&rpar; &lbrace;&NewLine; &lpar;postSections &quest; postSections &colon; currentPostSections&rpar;&period;map&lpar;section &equals;> &lbrace;&NewLine; if&lpar;sectionsToExclude&lbrack;section&rsqb;&rpar; return false&semi;&NewLine;&NewLine; const scoreToBeAdded &equals; &lpar;section &equals;&equals;&equals; currentPostPrimarySection&rpar; &quest; 2 &colon; 1&semi;&NewLine; visitedPostsSections&lbrack;section&rsqb; &equals; &lpar;visitedPostsSections&lbrack;section&rsqb; &vert;&vert; 0&rpar; &plus; scoreToBeAdded&semi;&NewLine; &rcub;&rpar;&NewLine; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine; localPreferenceData&period;visited&lowbar;posts &equals; visitedPosts&semi;&NewLine; localPreferenceData&period;visited&lowbar;posts&lowbar;sections &equals; visitedPostsSections&semi;&NewLine; localStorage&period;hp&lowbar;data &equals; JSON&period;stringify&lpar;localPreferenceData&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;&NewLine;function addViewedPersonalizedPostToStore&lpar;&lowbar;id&rpar; &lbrace;&NewLine; const viewedPersonalizedPosts &equals; localPreferenceData&period;viewed&lowbar;hp&lowbar;posts &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; const viewedHPPost &equals; postsToDisplay&period;find&lpar;post &equals;> post&period;id &equals;&equals; &lowbar;id&rpar;&semi;&NewLine; const existingPost &equals; viewedPersonalizedPosts&quest;&period;find&lpar;post &equals;> post&period;id &equals;&equals; viewedHPPost&period;id&rpar;&semi;&NewLine;&NewLine; if&lpar;existingPost&rpar;&lbrace;&NewLine; existingPost&period;expiry &equals; newExpiryDate&lpar;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; viewedPersonalizedPosts&period;push&lpar;&lbrace; &period;&period;&period;viewedHPPost&comma; expiry&colon; newExpiryDate&lpar;&rpar; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; localPreferenceData&period;viewed&lowbar;hp&lowbar;posts &equals; viewedPersonalizedPosts&semi;&NewLine; localStorage&period;hp&lowbar;data &equals; JSON&period;stringify&lpar;localPreferenceData&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function generateExclusionQuery&lpar;&rpar;&lbrace;&NewLine; const sectionsToFetchSet &equals; new Set&lpar;&lbrack;&period;&period;&period;followedSectionsSet&comma; &period;&period;&period;Object&period;keys&lpar;likedPostSectionsObj&rpar;&rsqb;&rpar;&semi; &NewLine; const sectionsToFetch &equals; &lbrack;&period;&period;&period;sectionsToFetchSet&rsqb;&period;filter&lpar;section &equals;> &excl;sectionsToExclude&lbrack;section&rsqb; &rpar;&semi; &sol;&sol; exclude private and unlisted sections&NewLine; const postsToExclude &equals; localPreferenceData&quest;&period;visited&lowbar;posts&quest;&period;map&lpar;post &equals;> post&period;id&rpar;&quest;&period;length &quest; localPreferenceData&quest;&period;visited&lowbar;posts&quest;&period;map&lpar;post &equals;> post&period;id&rpar; &colon; &lbrack;0&rsqb;&semi;&NewLine;&NewLine; const query &equals; &lbrace;&NewLine; «&dollar;and»&colon; &lbrack;&NewLine; &lbrace;&NewLine; «id»&colon; &lbrace; «notEqualsAny»&colon;postsToExclude &rcub;&NewLine; &rcub;&NewLine; &rsqb;&NewLine; &rcub;&NewLine;&NewLine; if&lpar;sectionsToManuallyExcludeFromFetch&quest;&period;length&rpar; &lbrace; &NewLine; sectionsToManuallyExcludeFromFetch&period;forEach&lpar;section &equals;> &lbrace;&NewLine; query&lbrack;»&dollar;and»&rsqb;&period;push&lpar;&lbrace;»sections»&colon; &lbrace; «arrayNotContains»&colon; section &rcub;&rcub;&rpar;&NewLine; &rcub;&rpar;&NewLine; &rcub;&NewLine; if&lpar;sectionsToFetch&quest;&period;length&rpar; &lbrace;&NewLine; query&lbrack;»&dollar;and»&rsqb;&period;push&lpar;&lbrace;»sections»&colon; &lbrace; «arrayAny»&colon; sectionsToFetch &rcub;&rcub;&rpar;&NewLine; &rcub;&NewLine; if&lpar;currentPostAllSections&quest;&period;length&rpar; &lbrace;&NewLine; query&lbrack;»&dollar;and»&rsqb;&period;push&lpar;&lbrace;»sections»&colon; &lbrace; «arrayAny»&colon; currentPostAllSections&period;filter&lpar;section &equals;> &excl;sectionsToExclude&lbrack;section&rsqb; &rpar; &rcub;&rcub;&rpar;&NewLine; &rcub;&NewLine; console&period;log&lpar;’the query’&comma; query&rpar;&semi;&NewLine; return query&semi;&NewLine;&rcub;&NewLine;&NewLine;&NewLine;async function fetchPosts&lpar;&rpar;&lbrace;&NewLine; const url &equals; ‘https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;content-delivery-api&sol;api&sol;v2&sol;posts&quest;apiKey&equals;YbEGjDsxUlUlUhOI7P6uzXerJclIlyFRouDptO9VlynjlfqbPmKyBX0YRcU1gl8k&now&equals;’&plus;Date&period;now&lpar;&rpar;&semi;&NewLine; &sol;&sol; TODO&colon; we need to remove this API key from the frontend&NewLine; &sol;&sol; What about custom page endpoint where we’ll send a list of ids we want to exclude and in the called SE we use mashup that’s call the CDapi &comma; on the front we’ll get&NewLine; &NewLine; const excludeQuery &equals; JSON&period;stringify&lpar;generateExclusionQuery&lpar;&rpar;&rpar;&semi;&NewLine; const options &equals; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace; ‘content-type’&colon; ‘application&sol;json’ &rcub;&comma;&NewLine; body&colon; &grave;&lbrace;»uniqueIdentifier»&colon;»root»&comma;»includeFields»&colon;&lbrack;»id»&comma;»headline»&comma;»sections»&comma;»post&lowbar;url»&comma;»teaser&lowbar;image»&rsqb;&comma;»filterQuery»&colon; &dollar;&lbrace;excludeQuery&rcub;&comma;»sort»&colon; &lbrace;»created&lowbar;ts»&colon; -1&rcub;&comma;»clusterName»&colon;»AllContentTypesWithoutNonContent»&comma;»limit»&colon;&dollar;&lbrace;fetchCount&rcub;&comma;»offset»&colon;0&comma;»useV1″&colon;»true»&rcub;&grave;&NewLine; &rcub;&semi;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;url&comma; options&rpar;&semi;&NewLine; const data &equals; await response&period;json&lpar;&rpar;&semi;&NewLine; &sol;&sol; fliter out visited posts&NewLine; const visitedPostsToBeRemoved &equals; new Set&lpar;&lpar;localPreferenceData&period;visited&lowbar;posts &vert;&vert; &lbrack;&rsqb;&rpar;&period;map&lpar;item &equals;> JSON&period;parse&lpar;item&period;id&rpar;&rpar;&rpar;&semi;&NewLine; fetchedPosts &equals; &lpar;data&quest;&period;data &vert;&vert; &lbrack;&rsqb;&rpar;&period;filter&lpar;post &equals;> &excl;visitedPostsToBeRemoved&period;has&lpar;post&period;id&rpar; &rpar;&semi;&NewLine; &sol;&sol; console&period;log&lpar;data&rpar;&semi;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;error&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;function assignWeightToPosts&lpar;&rpar; &lbrace;&NewLine; fetchedPosts&period;forEach&lpar;post &equals;> &lbrace;&NewLine; post&period;sections&quest;&period;map&lpar;section &equals;> &lbrace;&NewLine; if&lpar;sectionsToExclude&lbrack;section&period;id&rsqb;&rpar; return&semi;&NewLine; &sol;&sol; check if in followed sections&NewLine; &sol;&sol; console&period;log&lpar;’ADDITION POINT 0 FOR’&comma; section&period;title&comma; post&period;weight&rpar;&semi;&NewLine; if &lpar;followedSectionsSet&period;has&lpar;section&period;id&rpar;&rpar; &lbrace;&NewLine; post&period;weight &equals; &lpar;post&period;weight &vert;&vert; 0&rpar; &plus; 10&semi;&NewLine; &sol;&sol; console&period;log&lpar;’ADDITION POINT 1 Followed sections FOR’&comma; section&period;title&comma; post&period;weight&rpar;&semi;&NewLine;&NewLine; &sol;&sol; track the section metrics&NewLine; section&period;followed&lowbar;weight &equals; 10&semi;&NewLine; &rcub;&NewLine; &sol;&sol; check if in liked sections&NewLine; if &lpar;likedPostSectionsObj&lbrack;section&period;id&rsqb;&rpar; &lbrace;&NewLine; post&period;weight &equals; &lpar;post&period;weight &vert;&vert; 0&rpar; &plus; &lpar;likedPostSectionsObj&lbrack;section&period;id&rsqb; &plus; 5&rpar;&semi;&NewLine; &sol;&sol; console&period;log&lpar;’ADDITION POINT 2 liked post section FOR’&comma; section&period;title&comma; post&period;weight&rpar;&semi;&NewLine;&NewLine; &sol;&sol; track the section metrics&NewLine; section&period;liked&lowbar;weight &equals; &lpar;likedPostSectionsObj&lbrack;section&period;id&rsqb; &plus; 5&rpar;&semi;&NewLine; &rcub;&NewLine; &sol;&sol; check if in visited sections&NewLine; if &lpar;localPreferenceData&period;visited&lowbar;posts&lowbar;sections&quest;&period;&lbrack;section&period;id&rsqb; &excl;&equals; undefined&rpar; &lbrace;&NewLine; post&period;weight &equals; &lpar;post&period;weight &vert;&vert; 0&rpar; &plus; localPreferenceData&period;visited&lowbar;posts&lowbar;sections&lbrack;section&period;id&rsqb; &plus; 1&semi;&NewLine; &sol;&sol; console&period;log&lpar;’ADDITION POINT 3 visited sections FOR’&comma; section&period;title&comma; post&period;weight&rpar;&semi;&NewLine;&NewLine; &sol;&sol; track the section metrics&NewLine; section&period;visited&lowbar;weight &equals; localPreferenceData&period;visited&lowbar;posts&lowbar;sections&lbrack;section&period;id&rsqb; &plus; 1&semi;&NewLine; &rcub;&NewLine;&NewLine; post&period;trackedSections &quest; post&period;trackedSections&period;push&lpar;section&rpar; &colon; &lpar;post&period;trackedSections &equals; &lbrack;section&rsqb;&rpar;&NewLine; &rcub;&rpar;&NewLine; &sol;&sol; console&period;log&lpar;’END ADDITION FOR this post ————————>’&comma; post&period;headline&comma; post&period;weight&rpar;&semi;&NewLine; &rcub;&rpar;&NewLine; &sol;&sol; sort the posts based on descending order of weight&NewLine; fetchedPosts&period;sort&lpar;&lpar;a&comma; b&rpar; &equals;> &lpar;b&period;weight &vert;&vert; 0&rpar; – &lpar;a&period;weight &vert;&vert; 0&rpar;&rpar;&semi;&NewLine; postsToDisplay &equals; fetchedPosts&period;slice&lpar;0&comma; 3&rpar;&semi;&NewLine;&NewLine; console&period;log&lpar;’the sorted weighted posts –>’&comma; fetchedPosts&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function toggleSidebarContentVisibility&lpar;show&rpar;&lbrace;&NewLine; &sol;&sol; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;’&period;sidebar–column &period;carousels&period;shared–posts&lowbar;&lowbar;module’&comma; function&lpar;item&rpar;&lbrace;&NewLine; &sol;&sol; show &quest; item&quest;&period;classList&quest;&period;add&lpar;’show-content’&rpar; &colon; item&quest;&period;classList&quest;&period;remove&lpar;’show-content’&rpar;&semi;&NewLine; &sol;&sol; &rcub;&rpar;&NewLine;&rcub;&NewLine;function handleAnalytics&lpar;link&comma; analyticKey &equals; «dontmiss»&rpar; &lbrace;&NewLine; console&period;log&lpar;»handle analytics click fired –> «&comma; analyticKey&rpar;&semi; &NewLine; try &lbrace;&NewLine; &sol;&sol; handle clicks&NewLine; link&period;addEventListener&lpar;»click»&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; pa&period;sendEvent&lpar;&grave;&dollar;&lbrace;analyticKey&rcub;&period;click&grave;&comma; &lbrace;&NewLine; post&lowbar;headline&colon; link&period;ariaLabel&comma;&NewLine; post&lowbar;url&colon; link&period;href&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;»Piano Analytics error&colon;»&comma; error&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;function handleAnalyticsImpressions&lpar;analyticKey &equals; «dontmiss»&rpar; &lbrace;&NewLine; function waitForPa&lpar;callback&comma; maxAttempts &equals; 50&rpar; &lbrace;&NewLine; let attempts &equals; 0&semi;&NewLine;&NewLine; const checkPa &equals; setInterval&lpar;function &lpar;&rpar; &lbrace;&NewLine; attempts&plus;&plus;&semi;&NewLine;&NewLine; if &lpar;typeof pa &excl;&equals;&equals; ‘undefined’ && pa&period;sendEvent&rpar; &lbrace;&NewLine; clearInterval&lpar;checkPa&rpar;&semi;&NewLine; console&period;log&lpar;’&lbrack;waitForPa&rsqb; pa is available after’&comma; attempts &ast; 100&comma; ‘ms’&rpar;&semi;&NewLine; callback&lpar;&rpar;&semi;&NewLine; &rcub; else if &lpar;attempts >&equals; maxAttempts&rpar; &lbrace;&NewLine; clearInterval&lpar;checkPa&rpar;&semi;&NewLine; console&period;warn&lpar;’&lbrack;waitForPa&rsqb; pa not available after’&comma; maxAttempts &ast; 100&comma; ‘ms – giving up’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma; 100&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; waitForPa&lpar;function &lpar;&rpar; &lbrace;&NewLine; console&period;log&lpar;&grave;event &dollar;&lbrace;analyticKey&rcub; impression sent&grave;&comma; pa&rpar;&semi;&NewLine; pa&period;sendEvent&lpar;&grave;&dollar;&lbrace;analyticKey&rcub;&period;impression&grave;&comma; &lbrace;&rcub;&rpar;&semi;&NewLine;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function generatDemoMarkup&lpar;&rpar;&lbrace;&NewLine; if&lpar;&excl;postsToDisplay&quest;&period;length&rpar; &lbrace;&NewLine; document&period;querySelector&lpar;’&period;hp&lowbar;container&lowbar;placeholder’&rpar;&quest;&period;classList&quest;&period;add&lpar;’hidden’&rpar;&semi;&NewLine; showDefaultRecirculationUnit&lpar;&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine; const parentDiv &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine; parentDiv&period;className &equals; ‘hp&lowbar;container’&semi;&NewLine; parentDiv&period;classList&period;add&lpar;’embed-foryou&lowbar;posts’&rpar;&NewLine; parentDiv&period;classList&period;add&lpar;’embed-foryou’&rpar;&NewLine;&NewLine; const h3 &equals; document&period;createElement&lpar;’h3’&rpar;&semi;&NewLine; h3&period;classList&period;add&lpar;»module-headline&lowbar;&lowbar;text»&rpar;&semi;&NewLine; h3&period;classList&period;add&lpar;»h2″&rpar;&NewLine; h3&period;textContent &equals; «For You»&semi;&NewLine; parentDiv&period;appendChild&lpar;h3&rpar;&semi;&NewLine;&NewLine; const contentDiv &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine; contentDiv&period;classList&period;add&lpar;’hp&lowbar;container&lowbar;posts’&rpar;&semi;&NewLine; contentDiv&period;setAttribute&lpar;’data-attr-source&lowbar;id’&comma; ‘embed-foryou’&rpar;&semi;&NewLine; let contentHTML &equals; »&semi;&NewLine;&NewLine; postsToDisplay&period;forEach&lpar;post &equals;> &lbrace;&NewLine; contentHTML &plus;&equals; &grave;&NewLine; <div class&equals;»hp&lowbar;content» post-data-id&equals;»&dollar;&lbrace;post&period;id&rcub;»>&NewLine; <a class&equals;»widget&lowbar;&lowbar;headline-text custom-post-headline» aria-label&equals;»&dollar;&lbrace;post&period;headline&rcub;» href&equals;»&dollar;&lbrace;post&period;post&lowbar;url&rcub;»>&NewLine; <img &NewLine; src&equals;»&dollar;&lbrace;post&period;teaser&lowbar;image&quest;&period;images&quest;&period;&lbrack;’1000×750’&rsqb; &vert;&vert; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61228189&sol;origin&period;png’&rcub;» &NewLine; alt&equals;»Image for &dollar;&lbrace;post&period;headline&rcub;» &NewLine; &sol;>&NewLine; &NewLine; <h2 class&equals;»widget&lowbar;&lowbar;headline h2″ aria-label&equals;»&dollar;&lbrace;post&period;headline&rcub;»>&NewLine; &dollar;&lbrace;post&period;headline&rcub;&NewLine; &NewLine; &NewLine; &grave;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; contentDiv&period;innerHTML &equals; contentHTML&semi;&NewLine; parentDiv&period;appendChild&lpar;contentDiv&rpar;&semi;&NewLine;&NewLine; console&period;log&lpar;’Waiting for Personalized content to be added’&rpar;&NewLine; var &Tab;embeddontmiss&equals;document&period;querySelector&lpar;’&period;embed-dontmiss’&rpar;&semi;&NewLine; document&period;querySelector&lpar;’&period;fordont’&rpar;&period;innerHTML&equals;»For You»&semi;&NewLine; embeddontmiss&quest;&period;classList&quest;&period;remove&lpar;’embed-dontmiss’&rpar;&semi;&NewLine; embeddontmiss&quest;&period;classList&quest;&period;add&lpar;’embed-foryou’&rpar;&semi;&NewLine; embeddontmiss&quest;&period;appendChild&lpar;parentDiv&rpar;&semi;&NewLine; &NewLine; const modSlot &equals; document&period;querySelector&lpar;’&period;hp&lowbar;container&lowbar;placeholder’&rpar;&semi;&NewLine; if&lpar;embeddontmiss &excl;&equals; null&rpar;&lbrace;&NewLine; modSlot&quest;&period;replaceWith&lpar;embeddontmiss&rpar;&semi;&NewLine; &NewLine; &sol;&sol; handle tracking and analytics&NewLine; handleAnalyticsImpressions&lpar;’foryou’&rpar;&semi;&NewLine; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;»&period;hp&lowbar;content a»&comma;&NewLine; function &lpar;link&rpar; &lbrace;&NewLine; handleAnalytics&lpar;link&comma; «foryou»&rpar;&semi;&NewLine; &rcub;&NewLine; &rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; modSlot&period;classList&quest;&period;add&lpar;’hidden’&rpar;&NewLine; &rcub;&NewLine; &sol;&sol; if&lpar;embeddontmiss&period;querySelectorAll&lpar;’&period;widget’&rpar;&period;length < 3 &rpar;&lbrace;&NewLine; &sol;&sol; embeddontmiss&period;classList&period;add&lpar;’hidden’&rpar;&semi;&NewLine; &sol;&sol; let dontmiss &equals; document&period;querySelector&lpar;’&period;embed-dontmiss’&rpar;&NewLine; &sol;&sol; dontmiss&period;appendChild&lpar;parentDiv&rpar;&NewLine; &sol;&sol; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;’&period;sidebar–column &period;carousels&period;shared–posts&lowbar;&lowbar;module &period;section-holder’&comma; function&lpar;item&rpar;&lbrace;&NewLine; &sol;&sol; const side &equals; item&period;parentElement&semi;&NewLine; &sol;&sol; side&period;innerHTML &equals; »&semi;&NewLine; &sol;&sol; side&period;appendChild&lpar;parentDiv&rpar;&semi;&NewLine; &sol;&sol; toggleSidebarContentVisibility&lpar;true&rpar;&semi;&NewLine; &sol;&sol; console&period;log&lpar;’Personalized content added to sidebar’&rpar;&NewLine; &sol;&sol; &rcub;&rpar;&NewLine; &sol;&sol; const sidebar &equals; document&period;querySelector&lpar;’&period;sidebar–column &period;carousels&period;shared–posts&lowbar;&lowbar;module’&rpar;&semi;&NewLine; &sol;&sol; sidebar && &lpar;sidebar&period;innerHTML &equals; »&rpar;&semi;&NewLine; &sol;&sol; sidebar&quest;&period;appendChild&lpar;parentDiv&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function generatePersonalizationReport&lpar;&rpar;&lbrace;&NewLine; console&period;group&lpar;»&percnt;cHYPERPERSONALIZED CONTENT»&comma; ‘color&colon; blue&semi; padding&colon; 4px&semi;’&rpar;&semi;&NewLine; console&period;group&lpar;»&percnt;cPERSONALIZED CONTENT –> Summary of user data»&comma; ‘color&colon; yellow&semi; padding&colon; 4px&semi;’&rpar;&semi;&NewLine;&NewLine; console&period;groupCollapsed&lpar;»Parameters used for filtering the fetch call»&rpar;&semi;&NewLine;&NewLine; console&period;log&lpar;»PERSONALIZED CONTENT –> Sections of the current post –> «&comma; currentPostAllSections&quest;&period;map&lpar;section &equals;> &grave;&dollar;&lbrace;allSectionsIdMap&lbrack;section&rsqb;&quest;&period;title &vert;&vert; ‘Home’&rcub;&grave;&rpar; &rpar;&semi;&NewLine;&NewLine; &sol;&sol; followed sections&NewLine; console&period;log&lpar;»PERSONALIZED CONTENT –> List of followed Topics –>»&comma; &lbrack;&period;&period;&period;followedSectionsSet&rsqb;&quest;&period;map&lpar;section &equals;> &grave;&dollar;&lbrace;allSectionsIdMap&lbrack;section&rsqb;&quest;&period;title&rcub;&grave;&rpar;&rpar;&semi;&NewLine; &NewLine; &sol;&sol; liked sections&NewLine; console&period;log&lpar;»PERSONALIZED CONTENT –> List of Liked Topics –> «&comma; Object&period;keys&lpar;likedPostSectionsObj&rpar;&quest;&period;map&lpar;section &equals;> &grave;&dollar;&lbrace;allSectionsIdMap&lbrack;section&rsqb;&quest;&period;title&rcub;&colon; &dollar;&lbrace;likedPostSectionsObj&lbrack;section&rsqb;&rcub;&grave;&rpar; &rpar;&semi;&NewLine; &NewLine; &sol;&sol; Visited sections&NewLine; console&period;log&lpar;»PERSONALIZED CONTENT –> List of Visited Topics –> «&comma; Object&period;keys&lpar;visitedPostsSections&rpar;&quest;&period;map&lpar;section &equals;> &grave;&dollar;&lbrace;allSectionsIdMap&lbrack;section&rsqb;&quest;&period;title&rcub;&colon; &dollar;&lbrace;visitedPostsSections&lbrack;section&rsqb;&rcub;&grave;&rpar;&rpar;&semi;&NewLine;&NewLine; console&period;groupEnd&lpar;&rpar;&semi;&NewLine;&NewLine; console&period;groupCollapsed&lpar;»Excluded posts that won’t be fetched»&rpar;&semi;&NewLine; &sol;&sol; Visited posts&NewLine; console&period;log&lpar;»PERSONALIZED CONTENT –> List of Visited Posts –>»&comma; localPreferenceData&quest;&period;visited&lowbar;posts&quest;&period;map&lpar;post &equals;> post&period;id&rpar; &rpar;&semi;&NewLine; &NewLine; &sol;&sol; Viewed HP posts&NewLine; console&period;log&lpar;»PERSONALIZED CONTENT –> List of Viewed Personalized Posts –>»&comma; localPreferenceData&quest;&period;viewed&lowbar;hp&lowbar;posts&quest;&period;map&lpar;post &equals;> post&period;headline&rpar; &rpar;&semi;&NewLine; &NewLine; console&period;groupEnd&lpar;&rpar;&semi;&NewLine; console&period;groupEnd&lpar;&rpar;&semi;&NewLine;&NewLine; &NewLine; console&period;group&lpar;»&percnt;cPERSONALIZED CONTENT –> Summary of personalized posts data»&comma; ‘color&colon; green&semi; padding&colon; 4px&semi;’&rpar;&semi;&NewLine; fetchedPosts&quest;&period;forEach&lpar;post &equals;> &lbrace;&NewLine;&NewLine; &sol;&sol; console&period;group&lpar;&grave;&dollar;&lbrace;post &period;headline&rcub; – &dollar;&lbrace;post&period;weight &vert;&vert; 0&rcub;&grave;&rpar;&semi;&NewLine; console&period;groupCollapsed&lpar;&grave;&dollar;&lbrace;post &period;headline&rcub; – Score&colon; &dollar;&lbrace;post&period;weight &vert;&vert; 0&rcub;&grave;&rpar;&semi;&NewLine; &NewLine; post&period;trackedSections&quest;&period;forEach&lpar; section &equals;> &lbrace;&NewLine; console&period;log&lpar;&grave;&dollar;&lbrace;section&period;title&rcub;&colon; &lpar;Followed&colon; &dollar;&lbrace;section&period;followed&lowbar;weight &vert;&vert; 0&rcub;&rpar; &plus; &lpar;Liked&colon; &dollar;&lbrace;section&period;liked&lowbar;weight &vert;&vert; 0&rcub;&rpar; &plus; &lpar;visited&colon; &dollar;&lbrace;section&period;visited&lowbar;weight &vert;&vert; 0&rcub;&rpar; &equals; &dollar;&lbrace;&lpar;section&period;followed&lowbar;weight &vert;&vert; 0&rpar; &plus; &lpar;section&period;liked&lowbar;weight &vert;&vert; 0&rpar; &plus; &lpar;section&period;visited&lowbar;weight &vert;&vert; 0&rpar;&rcub;&grave;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; console&period;groupEnd&lpar;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; console&period;groupEnd&lpar;&rpar;&semi;&NewLine;&NewLine; console&period;groupEnd&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;»PERSONALIZED CONTENT END–> «&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function addDontMissPlaceholder&lpar;&rpar;&lbrace;&NewLine; const placeholder &equals; &grave;&NewLine; <div class&equals;»hp&lowbar;container embed-foryou&lowbar;posts embed-foryou «>&NewLine; <h3 class&equals;»module-headline&lowbar;&lowbar;text h2»>For You&NewLine; <div class&equals;’plaeholder&lowbar;spinner’&sol;>&&num;32&semi;&NewLine; &NewLine; &grave;&NewLine; const placeholderDiv &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine; placeholderDiv&period;classList&period;add&lpar;’hp&lowbar;container&lowbar;placeholder’&rpar;&NewLine; placeholderDiv&period;innerHTML &equals; placeholder&semi;&NewLine; const modSlot &equals; document&period;querySelectorAll&lpar;’&period;body-description p&colon;not&lpar;small p&comma; &period;evergreen-particle p&comma; &period;trending-item&rpar;’&rpar;&lbrack;12&rsqb;&semi;&NewLine; console&period;log&lpar;’the plaeholder code’&comma; placeholderDiv&rpar;&semi;&NewLine; console&period;log&lpar;’the plaeholder code 2 ‘&comma; placeholderDiv&rpar;&semi;&NewLine; if&lpar;placeholderDiv &excl;&equals; null&rpar;&lbrace;&NewLine; modSlot&quest;&period;appendChild&lpar;placeholderDiv&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;function showDefaultRecirculationUnit&lpar;&rpar;&lbrace;&NewLine; var embeddontmiss&equals;document&period;querySelector&lpar;’&period;embed-dontmiss’&rpar;&semi;&NewLine; if&lpar;embeddontmiss&rpar;&lbrace;&NewLine; let dontMiss &equals; document&period;querySelector&lpar;’&period;embed-dontmiss&lowbar;&lowbar;posts’&rpar;&semi;&NewLine; var dontmissclone &equals; dontMiss&period;cloneNode&lpar;true&rpar;&semi;&NewLine; dontmissclone&period;classList&period;remove&lpar;’hidden’&rpar;&semi;&NewLine; embeddontmiss&period;appendChild&lpar;dontmissclone&rpar;&semi;&NewLine; const modSlot &equals; document&period;querySelectorAll&lpar;’&period;body-description p&colon;not&lpar;small p&comma; &period;evergreen-particle p&comma; &period;trending-item&rpar;’&rpar;&lbrack;12&rsqb;&semi;&NewLine; modSlot&period;appendChild&lpar;embeddontmiss&rpar;&semi;&NewLine; &NewLine; if&lpar;embeddontmiss&period;querySelectorAll&lpar;’&period;widget’&rpar;&period;length < 3 &rpar;&lbrace;&NewLine; embeddontmiss&period;classList&period;add&lpar;’hidden’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; handle tracking and analytics&NewLine; handleAnalyticsImpressions&lpar;’dontmiss’&rpar;&semi;&NewLine; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;»&period;embed-dontmiss&lowbar;&lowbar;posts&colon;not&lpar;&period;hidden&rpar; a&period;widget&lowbar;&lowbar;headline-text&comma; &period;embed-dontmiss&colon;not&lpar;&period;hidden&rpar; &period;widget&lowbar;&lowbar;head > a»&comma;&NewLine; function &lpar;link&rpar; &lbrace;&NewLine; console&period;log&lpar;’The logged out analytics’&rpar;&semi;&NewLine; handleAnalytics&lpar;link&comma; ‘dontmiss’&rpar;&semi;&NewLine; &rcub;&NewLine; &rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function checkIfPersonalizedContentShouldRun&lpar;&rpar;&lbrace;&NewLine; &sol;&sol; check if the hyper personalized content module should run &NewLine; console&period;log&lpar;’the post sections’&comma; JSON&period;parse&lpar;’&lbrack;0&comma; 584086272&comma; 2262988002&comma; 588563272&comma; 586304622&comma; 2260688433&comma; 590311187&comma; 586304181&comma; 586311833&comma; 588563322&rsqb;’ &vert;&vert; ‘&lbrack;&rsqb;’&rpar; &rpar;&NewLine; if&lpar;window&period;tp&quest;&period;pianoId&quest;&period;isUserValid&lpar;&rpar;&NewLine;&sol;&sol; && &lpar; ‘True’ && JSON&period;parse&lpar;’&lbrack;0&comma; 584086272&comma; 2262988002&comma; 588563272&comma; 586304622&comma; 2260688433&comma; 590311187&comma; 586304181&comma; 586311833&comma; 588563322&rsqb;’ &vert;&vert; ‘&lbrack;&rsqb;’&rpar;&quest;&period;find&lpar;section &equals;> sectionsToRunPersonalizedContent&period;includes&lpar;section&rpar; &rpar; &rpar; &NewLine; &rpar; &lbrace;&NewLine; return true&semi;&NewLine; &rcub;&NewLine; return false&semi;&NewLine;&rcub;&NewLine;&NewLine;async function init&lpar;&rpar;&lbrace;&NewLine; if&lpar;&excl;checkIfPersonalizedContentShouldRun&lpar;&rpar; &rpar; &lbrace;&NewLine; showDefaultRecirculationUnit&lpar;&rpar;&semi;&NewLine; return console&period;log&lpar;’milos&colon; user not logged in &sol; Not sports section&comma; loading dont miss’&rpar;&NewLine; &rcub;&NewLine; &NewLine; addDontMissPlaceholder&lpar;&rpar;&semi; &sol;&sol; add a placeholder to that will reserve space for the HP content&NewLine; console&period;log&lpar;’milos&colon; user logged in&comma; loading for you’&rpar;&NewLine; &sol;&sol; return toggleSidebarContentVisibility&lpar;true&rpar;&semi; &sol;&sol; user not logged in&NewLine; &NewLine; if&lpar;&excl;systemSections &vert;&vert; &excl;systemSections&period;allSectionsIdMap&rpar;&lbrace; &NewLine; await getAllSections&lpar;&rpar;&semi;&NewLine; &rcub; else if&lpar;systemSections&period;expiry < today&rpar; localStorage&period;removeItem&lpar;’all&lowbar;sections’&rpar;&semi; &sol;&sol;refresh the cached section data after 3 days to save API calls&NewLine; manuallyExcludeSections&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;’the manually excluded sections ‘&comma; sectionsToExclude&rpar;&semi;&NewLine;&NewLine; await getUserPreferenceData&lpar;&rpar;&semi;&NewLine; validateLocalPreferenceData&lpar;&rpar;&semi;&NewLine;&NewLine;&NewLine; if &lpar;’True’ && ‘&lbrack;0&comma; 584086272&comma; 2262988002&comma; 588563272&comma; 586304622&comma; 2260688433&comma; 590311187&comma; 586304181&comma; 586311833&comma; 588563322&rsqb;’&rpar; &lbrace;&NewLine; currentPostAllSections &equals; JSON&period;parse&lpar;’&lbrack;0&comma; 584086272&comma; 2262988002&comma; 588563272&comma; 586304622&comma; 2260688433&comma; 590311187&comma; 586304181&comma; 586311833&comma; 588563322&rsqb;’ &vert;&vert; ‘&lbrack;&rsqb;’&rpar;&semi;&NewLine; currentPostPrimarySection &equals; &excl;&excl;’588563272’ &quest; ‘588563272’ &colon; null&semi; &sol;&sol; checks the post’s primary section &NewLine; currentPostPrimarySectionParent &equals; currentPostPrimarySection && ‘0’&semi; &sol;&sol;check the primary section’s parent section&NewLine; currentPostPrimarySection && currentPostSections&period;push&lpar;currentPostPrimarySection&rpar;&sol;&sol; checks the post’s primary section &NewLine; currentPostPrimarySectionParent && currentPostSections&period;push&lpar;currentPostPrimarySectionParent&rpar;&semi;&NewLine;&NewLine; addCurrentPostToVisitedStore&lpar;’2676762030’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine;&NewLine; console&period;log&lpar;’the piano user data –>’&comma; preferencesData&rpar;&semi;&NewLine; &sol;&sol; followed sections&NewLine; let followedSections &equals; preferencesData&quest;&period;find&lpar;data &equals;> data&period;field&lowbar;name&quest;&period;toLowerCase&lpar;&rpar; &equals;&equals; ‘follow-topics-and-sections’&rpar;&quest;&period;value&semi;&NewLine; followedSections &equals; &lpar;followedSections &quest; JSON&period;parse&lpar;followedSections&rpar; &colon; &lbrack;&rsqb;&rpar;&period;map&lpar;decodeSection&rpar;&quest;&period;filter&lpar;section &equals;> section &excl;&equals; ‘section&lowbar;deprecated’&rpar;&semi;&NewLine; followedSectionsSet &equals; new Set&lpar;followedSections&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Liked sections&NewLine; likedPostSectionsObj &equals; JSON&period;parse&lpar;preferencesData&quest;&period;find&lpar;data &equals;> data&period;field&lowbar;name&quest;&period;toLowerCase&lpar;&rpar; &equals;&equals; ‘liked&lowbar;posts&lowbar;topics’&rpar;&quest;&period;value &vert;&vert; ‘&lbrace;&rcub;’&rpar;&semi;&NewLine;&NewLine; await fetchPosts&lpar;&rpar;&semi;&NewLine; assignWeightToPosts&lpar;&rpar;&semi;&NewLine; &sol;&sol; at this point the recentPosts variable is sorted based on weight&NewLine; generatDemoMarkup&lpar;&rpar;&semi;&NewLine; generatePersonalizationReport&lpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol;If a personalized post is on the page for 2&period;5 seconds&comma; add it to the visited posts&NewLine; const visibilityTimers &equals; new Map&lpar;&rpar;&semi;&NewLine; const viewedHPPosts &equals; new Set&lpar;&rpar;&semi;&NewLine;&NewLine; function addViewedHPPostToLocalStore&lpar;id&rpar;&lbrace;&NewLine; if&lpar;viewedHPPosts&period;has&lpar;id&rpar;&rpar; console&period;log&lpar;’this post has already been updated in this session’&comma; id&rpar;&semi;&NewLine; if&lpar;&excl;id &vert;&vert; viewedHPPosts&period;has&lpar;id&rpar;&rpar; return&semi;&NewLine; let postSections &equals; postsToDisplay&period;find&lpar;post &equals;> post&period;id &equals;&equals; &plus;id &rpar;&quest;&period;sections&semi;&NewLine; postSections && &lpar;postSections &equals; postSections&period;map&lpar;section &equals;> section&period;id&rpar;&rpar;&semi;&NewLine; console&period;log&lpar;’visibility timer activated –> ‘&comma; id&comma; postSections&rpar;&semi;&NewLine; addCurrentPostToVisitedStore&lpar;id&comma; postSections&rpar;&semi; &NewLine; addViewedPersonalizedPostToStore&lpar;id&rpar;&semi;&NewLine; &rcub;&NewLine; function cancelVisibilityTimer&lpar;id&rpar;&lbrace;&NewLine; &sol;&sol; If the element goes out of view before 2&period;5s&comma; cancel the timer&NewLine; if &lpar;&excl;id&rpar; return&semi;&NewLine; console&period;log&lpar;’visibility timer cancelled for –> ‘&comma; id&rpar;&semi;&NewLine; const timer &equals; visibilityTimers&period;get&lpar;id&rpar;&semi;&NewLine; if &lpar;timer&rpar; &lbrace;&NewLine; clearTimeout&lpar;timer&rpar;&semi;&NewLine; visibilityTimers&period;delete&lpar;id&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &NewLine; window&period;REBELMOUSE&lowbar;STDLIB&period;onElementInViewport&lpar;&lbrace;&NewLine; selector&colon; «&period;hp&lowbar;container &period;hp&lowbar;content»&comma;&NewLine; threshold&colon; 1&comma;&NewLine; onBellowViewport&colon; &lpar;element&rpar; &equals;> cancelVisibilityTimer&lpar;element&quest;&period;getAttribute&lpar;’post-data-id’&rpar;&rpar;&comma;&NewLine;&Tab;onAboveViewport&colon; &lpar;element&rpar; &equals;> cancelVisibilityTimer&lpar;element&quest;&period;getAttribute&lpar;’post-data-id’&rpar;&rpar;&comma; &NewLine; onIntersect&colon; function &lpar;entry&rpar; &lbrace;&NewLine; const id &equals; entry&quest;&period;target&quest;&period;getAttribute&lpar;’post-data-id’&rpar;&semi;&NewLine; &sol;&sol;skip if timer is already active&NewLine; if &lpar;&excl;id &vert;&vert; visibilityTimers&period;has&lpar;id&rpar;&rpar; return&semi;&NewLine;&NewLine; const timer &equals; setTimeout&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; console&period;log&lpar;’element in view –> ‘&comma; entry&period;target&rpar;&semi;&NewLine; addViewedHPPostToLocalStore&lpar;id&rpar;&semi;&NewLine; viewedHPPosts&period;add&lpar;id&rpar;&semi; &sol;&sol; add the post to the list of processed post to prevent duplication of stats&NewLine; visibilityTimers&period;delete&lpar;id&rpar;&semi; &sol;&sol; remove timer after it’s fired&NewLine; &rcub;&comma; 2500&rpar;&semi;&NewLine; visibilityTimers&period;set&lpar;id&comma; timer&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; run the operation when piano is initialized&NewLine;tp&period;push&lpar;&lbrack;’init’&comma; function&lpar;&rpar; &lbrace;&NewLine; init&lpar;&rpar;&semi;&NewLine;&rcub;&rsqb;&rpar;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;ACTIVE&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; let toTopBtn &equals; document&period;querySelector&lpar;»&period;to-top»&rpar;&semi;&NewLine;var content&equals; document&period;querySelector&lpar;»&period;content»&rpar;&semi;&NewLine;&NewLine;&sol;&sol;toTopBtn&period;style&period;right&equals;&lpar;window&period;innerWidth-content&period;clientWidth&rpar;&sol;2-20&plus;»px»&semi;&NewLine;window&period;onscroll &equals; function&lpar;&rpar; &lbrace;scrollFunction&lpar;&rpar;&rcub;&semi;&NewLine;&NewLine;function scrollFunction&lpar;&rpar; &lbrace;&NewLine; if &lpar;document&period;body&period;scrollTop > 20 &vert;&vert; document&period;documentElement&period;scrollTop > 20&rpar; &lbrace;&NewLine; toTopBtn&period;style&period;display &equals; «block»&semi;&NewLine; &rcub; else &lbrace;&NewLine; toTopBtn&period;style&period;display &equals; «none»&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;toTopBtn&period;addEventListener&lpar;»click»&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; window&period;scrollTo&lpar;&lbrace;top&colon; 0&comma; behavior&colon; ‘smooth’&rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&rsqb;&rsqb;><&sol;script><script class&equals;»rm-i-script» id&equals;»user-javascript-components» type&equals;»text»&sol;><script class&equals;»rm-i-script» id&equals;»user-javascript-lowest» type&equals;»text»><&excl;&lbrack;CDATA&lbrack;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; async function getToken&lpar;timeout &equals; 5000&rpar; &lbrace;&NewLine; const controller &equals; new AbortController&lpar;&rpar;&semi;&NewLine; const &lbrace; signal &rcub; &equals; controller&semi;&NewLine;&NewLine; const timeoutId &equals; setTimeout&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; controller&period;abort&lpar;new Error&lpar;’Piano token initialization timed out’&rpar;&rpar;&semi;&NewLine; &rcub;&comma; timeout&rpar;&semi;&NewLine;&NewLine; const cleanup &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; clearTimeout&lpar;timeoutId&rpar;&semi;&NewLine; &rcub;&semi;&NewLine;&NewLine; const tryGetToken &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; const token &equals; window&period;tp&quest;&period;pianoId&quest;&period;getToken&quest;&period;&lpar;&rpar;&semi;&NewLine; return token &vert;&vert; null&semi;&NewLine; &rcub;&semi;&NewLine;&NewLine; return new Promise&lpar;&lpar;resolve&comma; reject&rpar; &equals;> &lbrace;&NewLine; if &lpar;signal&period;aborted&rpar; &lbrace;&NewLine; cleanup&lpar;&rpar;&semi;&NewLine; return reject&lpar;signal&period;reason&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; signal&period;addEventListener&lpar;’abort’&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; cleanup&lpar;&rpar;&semi;&NewLine; reject&lpar;signal&period;reason&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; 1&period; Try immediately&NewLine; try &lbrace;&NewLine; const immediateToken &equals; tryGetToken&lpar;&rpar;&semi;&NewLine; if &lpar;immediateToken&rpar; &lbrace;&NewLine; cleanup&lpar;&rpar;&semi;&NewLine; return resolve&lpar;immediateToken&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub; catch &lpar;err&rpar; &lbrace;&NewLine; cleanup&lpar;&rpar;&semi;&NewLine; return reject&lpar;err&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; 2&period; Wait for tp init&NewLine; window&period;tp &equals; window&period;tp &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; window&period;tp&period;push&lpar;&lbrack;&NewLine; ‘init’&comma;&NewLine; function &lpar;&rpar; &lbrace;&NewLine; if &lpar;signal&period;aborted&rpar; return&semi;&NewLine;&NewLine; try &lbrace;&NewLine; const token &equals; tryGetToken&lpar;&rpar;&semi;&NewLine; cleanup&lpar;&rpar;&semi;&NewLine;&NewLine; if &lpar;token&rpar; &lbrace;&NewLine; resolve&lpar;token&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; reject&lpar;new Error&lpar;’Piano token not available’&rpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub; catch &lpar;err&rpar; &lbrace;&NewLine; reject&lpar;err&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma;&NewLine; &rsqb;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function checkAccessLevel&lpar;&rpar; &lbrace;&NewLine; tp&period;api&period;callApi&lpar;’&sol;access&sol;list’&comma; &lbrace;&rcub;&comma; function &lpar;response&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’checkAccessLevel response’&comma; response&period;data&rpar;&semi;&NewLine;&NewLine; let excludedRids &equals; new Set&lpar;&lbrack;’RUK2FBE’&comma; ‘RMXO6VF’&comma; ‘RTEANTC’&comma; ‘RFCEL9J’&comma; ‘R5NMHWH’&comma; ‘RWY51ZC’&rsqb;&rpar;&semi;&NewLine;&NewLine; let isMember &equals; response&period;data&period;some&lpar;&NewLine; &lpar;access&rpar; &equals;> access&period;granted &equals;&equals;&equals; true && access&period;resource&quest;&period;rid && &excl;excludedRids&period;has&lpar;access&period;resource&period;rid&rpar;&comma;&NewLine; &rpar;&semi;&NewLine;&NewLine; &sol;&sol; console&period;log&lpar;’checkAccessLevel – isMember’&comma; isMember&rpar;&semi;&NewLine;&NewLine; if &lpar;isMember &equals;&equals;&equals; true&rpar; &lbrace;&NewLine; console&period;log&lpar;’User is a Member’&rpar;&semi;&NewLine; setWindowObj&lpar;’member’&rpar;&semi;&NewLine; setCookieMemStatus&lpar;’member’&rpar;&semi;&NewLine; updateSubscribeLink&lpar;’member’&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;log&lpar;’User is NOT a Member’&rpar;&semi;&NewLine; setWindowObj&lpar;’registered’&rpar;&semi;&NewLine; setCookieMemStatus&lpar;’registered’&rpar;&semi;&NewLine; updateSubscribeLink&lpar;’registered’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function setWindowObj&lpar;status&rpar; &lbrace;&NewLine; window&period;userStatus &equals; status&semi;&NewLine; &sol;&sol; console&period;log&lpar;&grave;userStatus&colon; &dollar;&lbrace;status&rcub;&grave;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function setCookieMemStatus&lpar;status&rpar; &lbrace;&NewLine; const COOKIE &equals; ‘access&lowbar;status&lowbar;gbn’&semi;&NewLine; document&period;cookie &equals; COOKIE &plus; &grave;&equals;&dollar;&lbrace;status&rcub;&semi; path&equals;&sol;&semi; max-age&equals;&grave; &plus; 30 &ast; 24 &ast; 60 &ast; 60 &plus; &grave;&semi;&grave;&semi;&NewLine; &sol;&sol; console&period;log&lpar;’statusCookie has been set’&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;function updateSubscribeLink&lpar;status&rpar; &lbrace;&NewLine; const link &equals; document&period;querySelector&lpar;’a&period;subscribe-link’&rpar;&semi;&NewLine; if &lpar;&excl;link&rpar; return&semi;&NewLine;&NewLine; if &lpar;status &equals;&equals;&equals; ‘member’&rpar; &lbrace;&NewLine; link&period;textContent &equals; ‘Membership’&semi;&NewLine; link&period;href &equals; ‘https&colon;&sol;&sol;www&period;gbnews&period;com&sol;membership&sol;’&semi;&NewLine; link&period;setAttribute&lpar;’data-og-href’&comma; ‘https&colon;&sol;&sol;www&period;gbnews&period;com&sol;membership&sol;’&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; link&period;textContent &equals; ‘Support’&semi;&NewLine; link&period;href &equals; ‘https&colon;&sol;&sol;www&period;gbnews&period;com&sol;support&quest;ico&equals;header&lowbar;support&lowbar;button’&semi;&NewLine; link&period;setAttribute&lpar;’data-og-href’&comma; ‘https&colon;&sol;&sol;www&period;gbnews&period;com&sol;support&quest;ico&equals;header&lowbar;support&lowbar;button’&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; Start the logic&NewLine;&lpar;async &lpar;&rpar; &equals;> &lbrace;&NewLine; try &lbrace;&NewLine; let token &equals; await getToken&lpar;&rpar;&semi; &sol;&sol; If getToken resolves&comma; call checkAccessLevel&NewLine; checkAccessLevel&lpar;&rpar;&semi;&NewLine; &rcub; catch &lpar;err&rpar; &lbrace;&NewLine; &sol;&sol; If getToken rejects&comma; handle anonymous user&NewLine; console&period;log&lpar;’User is NOT Logged in’&rpar;&semi;&NewLine; setWindowObj&lpar;’anonymous’&rpar;&semi;&NewLine; setCookieMemStatus&lpar;’anonymous’&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&rpar;&lpar;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; function isSamsungBrowser&lpar;&rpar; &lbrace;&NewLine; const userAgent &equals; navigator&period;userAgent&period;toLowerCase&lpar;&rpar;&semi;&NewLine; return userAgent&period;includes&lpar;’samsungbrowser’&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;if &lpar;isSamsungBrowser&lpar;&rpar;&rpar; &lbrace;&NewLine; &NewLine; document&period;querySelector&lpar;’&period;engbar-content’&rpar;&period;style&period;display &equals; «none»&semi;&NewLine; document&period;querySelector&lpar;’&period;engbar’&rpar;&period;style&period;paddingTop &equals; «0px»&semi;&NewLine; document&period;querySelector&lpar;’&period;engbar’&rpar;&period;style&period;paddingBottom &equals; «0px»&semi;&NewLine; document&period;querySelector&lpar;’&num;support-banner’&rpar;&period;style&period;fontSize &equals; «10px»&semi;&NewLine;&sol;&sol; console&period;log&lpar;»Samsung Internet browser detected»&rpar;&semi;&NewLine;&rcub; else &lbrace;&NewLine;&sol;&sol; console&period;log&lpar;»Not Samsung Internet browser»&rpar;&semi;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; Wait for element&NewLine;function waitForElement&lpar;selector&comma; callback&rpar; &lbrace;&NewLine; const element &equals; document&period;querySelector&lpar;selector&rpar;&semi;&NewLine; if &lpar;element&rpar; &lbrace;&NewLine; callback&lpar;element&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine; &NewLine; const observer &equals; new MutationObserver&lpar;function&lpar;&rpar; &lbrace;&NewLine; const element &equals; document&period;querySelector&lpar;selector&rpar;&semi;&NewLine; if &lpar;element&rpar; &lbrace;&NewLine; callback&lpar;element&rpar;&semi;&NewLine; observer&period;disconnect&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &NewLine; observer&period;observe&lpar;document&period;body&comma; &lbrace; childList&colon; true&comma; subtree&colon; true &rcub;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;console&period;log&lpar;»MENU INITIALIZATION»&rpar;&semi;&NewLine;&NewLine;&sol;&sol; Search my account wrapper&NewLine;waitForElement&lpar;’&period;login-link-wrapper’&comma; function&lpar;loginWrapper&rpar; &lbrace;&NewLine; console&period;log&lpar;»Found login wrapper&colon;»&comma; loginWrapper&rpar;&semi;&NewLine; &NewLine; waitForElement&lpar;’&num;myAccountMenu’&comma; function&lpar;myAccountMenu&rpar; &lbrace;&NewLine; console&period;log&lpar;»Found My Account menu&colon;»&comma; myAccountMenu&rpar;&semi;&NewLine; &NewLine; const textLink &equals; loginWrapper&period;querySelector&lpar;’&num;login-link-text’&rpar;&semi; &sol;&sol; Link with text «My Account»&NewLine; const avatarLink &equals; loginWrapper&period;querySelector&lpar;’&num;accountToggleLink’&rpar;&semi; &sol;&sol; Link with avatar&NewLine; &NewLine; console&period;log&lpar;»Text link&colon;»&comma; textLink&rpar;&semi;&NewLine; console&period;log&lpar;»Avatar link&colon;»&comma; avatarLink&rpar;&semi;&NewLine; &NewLine; const overlay &equals; document&period;getElementById&lpar;’overlay’&rpar;&semi;&NewLine; console&period;log&lpar;»Overlay&colon;»&comma; overlay&rpar;&semi;&NewLine; &NewLine; &sol;&sol; is user logged in &quest;&NewLine; function isUserLoggedIn&lpar;&rpar; &lbrace;&NewLine; return avatarLink && avatarLink&period;classList&period;contains&lpar;’loggedin’&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Function to toggle avatar visibility&NewLine; function toggleAvatar&lpar;show&rpar; &lbrace;&NewLine; if &lpar;avatarLink&rpar; &lbrace;&NewLine; avatarLink&period;style&period;visibility &equals; show &quest; ‘visible’ &colon; ‘hidden’&semi;&NewLine; console&period;log&lpar;»Avatar»&comma; show &quest; «shown» &colon; «hidden»&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Create close button as sibling to avatar link&NewLine; function createCloseButton&lpar;&rpar; &lbrace;&NewLine; if &lpar;&excl;avatarLink&rpar; return null&semi;&NewLine; &NewLine; &sol;&sol; close exists&quest;&NewLine; const existingCloseBtn &equals; loginWrapper&period;querySelector&lpar;’&period;custom-close-button’&rpar;&semi;&NewLine; if &lpar;existingCloseBtn&rpar; &lbrace;&NewLine; return existingCloseBtn&semi;&NewLine; &rcub;&NewLine; &NewLine; const closeButton &equals; document&period;createElement&lpar;’img’&rpar;&semi;&NewLine; closeButton&period;src &equals; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61170200&sol;origin&period;png’&semi;&NewLine; closeButton&period;alt &equals; ‘Close’&semi;&NewLine; closeButton&period;classList&period;add&lpar;’custom-close-button’&rpar;&semi;&NewLine; closeButton&period;style&period;display &equals; ‘none’&semi;&NewLine;&NewLine; &sol;&sol; Add event to close menu&NewLine; closeButton&period;addEventListener&lpar;’click’&comma; function &lpar;e&rpar; &lbrace;&NewLine; e&period;stopPropagation&lpar;&rpar;&semi;&NewLine; hideMenu&lpar;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Insert close button as sibling after avatar link&NewLine; avatarLink&period;parentNode&period;insertBefore&lpar;closeButton&comma; avatarLink&period;nextSibling&rpar;&semi;&NewLine; return closeButton&semi;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Menu functions&NewLine; function showMenu&lpar;&rpar; &lbrace;&NewLine; if &lpar;&excl;isUserLoggedIn&lpar;&rpar;&rpar; &lbrace;&NewLine; console&period;log&lpar;»User not logged in&comma; menu won’t open»&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine; &NewLine; myAccountMenu&period;removeAttribute&lpar;’hidden’&rpar;&semi;&NewLine; myAccountMenu&period;classList&period;add&lpar;’show’&rpar;&semi;&NewLine; &NewLine; const closeButton &equals; createCloseButton&lpar;&rpar;&semi;&NewLine; if &lpar;closeButton&rpar; &lbrace;&NewLine; closeButton&period;style&period;display &equals; ‘block’&semi;&NewLine; &sol;&sol; Hide avatar when close button is shown&NewLine; toggleAvatar&lpar;false&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; if &lpar;overlay&rpar; overlay&period;classList&period;add&lpar;’show’&rpar;&semi;&NewLine; &NewLine; console&period;log&lpar;»Menu opened»&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; function hideMenu&lpar;&rpar; &lbrace;&NewLine; myAccountMenu&period;classList&period;remove&lpar;’show’&rpar;&semi;&NewLine; if &lpar;overlay&rpar; overlay&period;classList&period;remove&lpar;’show’&rpar;&semi;&NewLine; &NewLine; const closeButton &equals; loginWrapper&period;querySelector&lpar;’&period;custom-close-button’&rpar;&semi;&NewLine; if &lpar;closeButton&rpar; &lbrace;&NewLine; closeButton&period;style&period;display &equals; ‘none’&semi;&NewLine; &sol;&sol; Show avatar when close button is hidden&NewLine; toggleAvatar&lpar;true&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; setTimeout&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; myAccountMenu&period;setAttribute&lpar;’hidden’&comma; »&rpar;&semi;&NewLine; &rcub;&comma; 200&rpar;&semi;&NewLine; &NewLine; console&period;log&lpar;»Menu closed»&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Event listener for link with text «My Account»&NewLine; if &lpar;textLink&rpar; &lbrace;&NewLine; textLink&period;addEventListener&lpar;’click’&comma; function&lpar;e&rpar; &lbrace;&NewLine; e&period;preventDefault&lpar;&rpar;&semi;&NewLine; e&period;stopPropagation&lpar;&rpar;&semi;&NewLine; &NewLine; console&period;log&lpar;»Text link clicked»&rpar;&semi;&NewLine; &NewLine; if &lpar;&excl;isUserLoggedIn&lpar;&rpar;&rpar; &lbrace;&NewLine; console&period;log&lpar;»User not logged in&comma; menu won’t open»&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Toggle menu&NewLine; if &lpar;myAccountMenu&period;classList&period;contains&lpar;’show’&rpar;&rpar; &lbrace;&NewLine; hideMenu&lpar;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; showMenu&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Event listener for avatar&NewLine; if &lpar;avatarLink&rpar; &lbrace;&NewLine; avatarLink&period;addEventListener&lpar;’click’&comma; function&lpar;e&rpar; &lbrace;&NewLine; e&period;preventDefault&lpar;&rpar;&semi;&NewLine; e&period;stopPropagation&lpar;&rpar;&semi;&NewLine; &NewLine; console&period;log&lpar;»Avatar link clicked»&rpar;&semi;&NewLine; &NewLine; if &lpar;&excl;isUserLoggedIn&lpar;&rpar;&rpar; &lbrace;&NewLine; console&period;log&lpar;»User not logged in&comma; menu won’t open»&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Toggle menu&NewLine; if &lpar;myAccountMenu&period;classList&period;contains&lpar;’show’&rpar;&rpar; &lbrace;&NewLine; hideMenu&lpar;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; showMenu&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Close menu when clicking overlay&NewLine; if &lpar;overlay&rpar; &lbrace;&NewLine; overlay&period;addEventListener&lpar;’click’&comma; hideMenu&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Close menu when Piano modal appears&NewLine; waitForElement&lpar;’&period;piano-id-modal’&comma; function&lpar;pianoModal&rpar; &lbrace;&NewLine; console&period;log&lpar;»Piano modal appeared&colon;»&comma; pianoModal&rpar;&semi;&NewLine; hideMenu&lpar;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Close menu on ESC key&NewLine; document&period;addEventListener&lpar;’keydown’&comma; function&lpar;e&rpar; &lbrace;&NewLine; if &lpar;e&period;key &equals;&equals;&equals; ‘Escape’ && myAccountMenu&period;classList&period;contains&lpar;’show’&rpar;&rpar; &lbrace;&NewLine; hideMenu&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Prevent menu from closing when clicking inside it&NewLine; myAccountMenu&period;addEventListener&lpar;’click’&comma; function&lpar;e&rpar; &lbrace;&NewLine; e&period;stopPropagation&lpar;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Close menu when clicking menu links&NewLine; const menuLinks &equals; myAccountMenu&period;querySelectorAll&lpar;’a’&rpar;&semi;&NewLine; menuLinks&period;forEach&lpar;link &equals;> &lbrace;&NewLine; link&period;addEventListener&lpar;’click’&comma; function&lpar;&rpar; &lbrace;&NewLine; hideMenu&lpar;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Logout logic&NewLine; const logoutLink &equals; Array&period;from&lpar;menuLinks&rpar;&period;find&lpar;link &equals;> &lbrace;&NewLine; return link&period;textContent&period;trim&lpar;&rpar;&period;toLowerCase&lpar;&rpar;&period;includes&lpar;’log out’&rpar; &vert;&vert; &NewLine; link&period;getAttribute&lpar;’aria-label’&rpar; &equals;&equals;&equals; ‘Log Out’&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; if &lpar;logoutLink&rpar; &lbrace;&NewLine; logoutLink&period;addEventListener&lpar;’click’&comma; function&lpar;e&rpar; &lbrace;&NewLine; e&period;preventDefault&lpar;&rpar;&semi; &NewLine;&NewLine; &sol;&sol; Log out from Piano&NewLine; if &lpar;window&period;tp && tp&period;pianoId&rpar; &lbrace;&NewLine; tp&period;pianoId&period;logout&lpar;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;warn&lpar;’Piano not ready’&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Hide menu after logout&NewLine; hideMenu&lpar;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; «Notifications» &lpar;Viafoura bell&rpar; in menu&NewLine; const vfBellLink &equals; myAccountMenu&period;querySelector&lpar;’&num;viafoura-bell-link’&rpar;&semi;&NewLine; if &lpar;vfBellLink&rpar; &lbrace;&NewLine; vfBellLink&period;addEventListener&lpar;’click’&comma; function&lpar;e&rpar; &lbrace;&NewLine; e&period;preventDefault&lpar;&rpar;&semi;&NewLine; e&period;stopPropagation&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;’Kamila clicked&excl;’&rpar;&semi;&NewLine; &NewLine; if &lpar;window&period;vf && window&period;vf&period;&dollar;publish&rpar; &lbrace;&NewLine; console&period;log&lpar;’Opening Viafoura tray&period;&period;&period;’&rpar;&semi;&NewLine; window&period;vf&period;&dollar;publish&lpar;’tray’&comma; ‘open’&comma; ‘args’&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;warn&lpar;’Viafoura is not ready yet&period;’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;warn&lpar;’&num;viafoura-bell-link not found in menu&period;’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine;&NewLine; &sol;&sol; Observer to check the classes changes&NewLine; if &lpar;avatarLink&rpar; &lbrace;&NewLine; const classObserver &equals; new MutationObserver&lpar;function&lpar;mutations&rpar; &lbrace;&NewLine; mutations&period;forEach&lpar;function&lpar;mutation&rpar; &lbrace;&NewLine; if &lpar;mutation&period;type &equals;&equals;&equals; ‘attributes’ && mutation&period;attributeName &equals;&equals;&equals; ‘class’&rpar; &lbrace;&NewLine; const isLoggedIn &equals; avatarLink&period;classList&period;contains&lpar;’loggedin’&rpar;&semi;&NewLine; console&period;log&lpar;»Login status changed&colon;»&comma; isLoggedIn&rpar;&semi;&NewLine; &NewLine; if &lpar;&excl;isLoggedIn&rpar; &lbrace;&NewLine; &sol;&sol; hide menu if logged out&NewLine; hideMenu&lpar;&rpar;&semi;&NewLine; &NewLine; const closeButton &equals; loginWrapper&period;querySelector&lpar;’&period;custom-close-button’&rpar;&semi;&NewLine; if &lpar;closeButton&rpar; &lbrace;&NewLine; closeButton&period;remove&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Show avatar when user logs out&NewLine; toggleAvatar&lpar;true&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; classObserver&period;observe&lpar;avatarLink&comma; &lbrace; &NewLine; attributes&colon; true&comma; &NewLine; attributeFilter&colon; &lbrack;’class’&rsqb; &NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &NewLine; var url &equals; decodeURIComponent&lpar;decodeURIComponent&lpar;document&period;location&period;href&rpar;&rpar;&semi;&NewLine; var params &equals; url&period;match&lpar;new RegExp&lpar;’tab’ &plus; ‘&equals;&lpar;&lbrack;&Hat;&&equals;&rsqb;&plus;&rpar;’&rpar;&rpar;&semi;&NewLine; var accountTab &equals; params &quest; params&lbrack;1&rsqb; &colon; false&semi;&NewLine;&NewLine; setTimeout&lpar;function&lpar;&rpar; &lbrace;&NewLine; if &lpar;accountTab&rpar; &lbrace;&NewLine; var scope &equals; angular&period;element&lpar;»&num;ng-app»&rpar;&period;scope&lpar;&rpar;&semi;&NewLine; scope&period;current &equals; accountTab&semi;&NewLine; scope&period;&dollar;apply&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma; 100&rpar;&semi;&NewLine;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; var pri&lowbar;nav &equals; document&period;querySelector&lpar;’&period;navbar &period;nav’&rpar;&period;cloneNode&lpar;true&rpar;&semi;&NewLine;var hamburger &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine;const searchNavItem &equals; &grave;<a class&equals;»hamburger search-item nav–item» href&equals;»&sol;search&sol;»>Search&grave;&semi;&NewLine;const searchForMenu &equals; &grave;&NewLine;<form method&equals;»get» class&equals;»quick–search&lowbar;&lowbar;form» action&equals;»&sol;search&sol;»><input&NewLine; type&equals;»text»&NewLine; required&equals;»»&NewLine; placeholder&equals;»Search&period;&period;»&NewLine; value&equals;»»&NewLine; name&equals;»q»&NewLine; class&equals;»quick–search&lowbar;&lowbar;form–input»&NewLine; onfocus&equals;»if &lpar;this&period;value &equals;&equals; »&rpar; &lbrace;this&period;value &equals; »&semi;&rcub;»&NewLine; onblur&equals;»if &lpar;this&period;value &equals;&equals; »&rpar; &lbrace;this&period;value &equals; »&semi;&rcub;»&NewLine; &sol;><button type&equals;»submit» class&equals;»quick–search&lowbar;&lowbar;form–submit» value&equals;»Search»><svg xmlns&equals;»http&colon;&sol;&sol;www&period;w3&period;org&sol;2000&sol;svg» width&equals;»20″ height&equals;»20″ viewBox&equals;»0 0 40 40″ fill&equals;»none»><path&NewLine; d&equals;»M39&period;7217 38&period;324L27&period;2102 25&period;356C30&period;0291 22&period;554 31&period;5786 18&period;89 31&period;5786 15C31&period;5786 10&period;994 29&period;9365 7&period;226 26&period;9534 4&period;394C23&period;9703 1&period;562 20&period;0061 0 15&period;7893 0C11&period;5725 0 7&period;60623 1&period;56 4&period;62521 4&period;394C1&period;64419 7&period;228 0 10&period;994 0 15C0 19&period;006 1&period;64209 22&period;774 4&period;62521 25&period;606C7&period;60834 28&period;438 11&period;5725 30 15&period;7893 30C19&period;4229 30 22&period;8671 28&period;842 25&period;6587 26&period;71L38&period;1701 39&period;676C38&period;3785 39&period;892 38&period;6606 40 38&period;9469 40C39&period;2017 40 39&period;4564 39&period;914 39&period;6585 39&period;738C40&period;088 39&period;364 40&period;1153 38&period;732 39&period;7238 38&period;326L39&period;7217 38&period;324ZM2&period;10313 15C2&period;10313 7&period;832 8&period;24201 2 15&period;7872 2C23&period;3324 2 29&period;4712 7&period;832 29&period;4712 15C29&period;4712 22&period;168 23&period;3324 28 15&period;7872 28C8&period;24201 28 2&period;10313 22&period;168 2&period;10313 15Z»&NewLine; fill&equals;»&num;0032AA»&NewLine; fill-opacity&equals;»0&period;8″&NewLine; >&NewLine;&grave;&semi;&NewLine;hamburger&period;className &equals; ‘hamburger’&semi;&NewLine;hamburger&period;append&lpar;pri&lowbar;nav&rpar;&semi;&NewLine;hamburger&period;querySelector&lpar;’&period;nav’&rpar;&period;insertAdjacentHTML&lpar;’afterBegin’&comma; searchForMenu&rpar;&semi;&NewLine;document&period;querySelector&lpar;’&period;topbar’&rpar;&period;append&lpar;hamburger&rpar;&semi;&NewLine;document&period;querySelector&lpar;’&period;menu&lowbar;&lowbar;toggle’&rpar;&period;onclick &equals; function &lpar;event&rpar; &lbrace;&NewLine; event&period;stopPropagation&lpar;&rpar;&semi; &sol;&sol; Prevent click event from bubbling up to document&NewLine; document&period;body&period;classList&period;toggle&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&semi;&NewLine;&rcub;&semi;&NewLine;&NewLine;var nav&lowbar;&lowbar;item &equals; document&period;querySelectorAll&lpar;’&period;hamburger &period;nav–item’&rpar;&semi;&NewLine;nav&lowbar;&lowbar;item&period;forEach&lpar;function &lpar;item&rpar; &lbrace;&NewLine; var button &equals; document&period;createElement&lpar;’button’&rpar;&semi;&NewLine; button&period;className &equals; «sub&lowbar;nav&lowbar;toggle»&semi;&NewLine; item&period;append&lpar;button&rpar;&semi;&NewLine; button&period;onclick &equals; function &lpar;&rpar; &lbrace;&NewLine; nav&lowbar;&lowbar;item&period;forEach&lpar;function &lpar;sni&rpar; &lbrace;&NewLine; if &lpar;item &equals;&equals; sni&rpar; &lbrace;&NewLine; &rcub; else &lbrace;&NewLine; sni&period;classList&period;remove&lpar;’expand’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; item&period;classList&period;toggle&lpar;’expand’&rpar;&semi;&NewLine; &rcub;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;&sol;&sol; display the hamburger menu&NewLine;let toggleMenus &equals; document&period;querySelectorAll&lpar;»&period;menu&lowbar;&lowbar;toggle»&rpar;&semi;&NewLine;let toggleMenu &equals; toggleMenus&lbrack;1&rsqb;&semi;&NewLine;let toggleMenu2 &equals; toggleMenus&lbrack;0&rsqb;&semi; &sol;&sol; to hide the unwanted one in the hamburger menu&NewLine;toggleMenu&period;addEventListener&lpar;»click»&comma; toggleHamburger&rpar;&semi;&NewLine;let hideWatchLive &equals; document&period;querySelector&lpar;’&period;watch-live-button’&rpar;&semi; &sol;&sol;added&NewLine;let hideVerticalLine &equals; document&period;querySelector&lpar;’&period;vertical-line’&rpar;&semi; &sol;&sol;added&NewLine;let lastVerticalLine &equals; document&period;querySelector&lpar;’&period;sticky-left &period;vertical-line&colon;last-of-type’&rpar;&semi;&sol;&sol;added&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;function toggleHamburger&lpar;event&rpar; &lbrace;&NewLine; event&period;stopPropagation&lpar;&rpar;&semi; &sol;&sol; Prevent click event from bubbling up to document&NewLine; console&period;log&lpar;»YES THIS LOGS»&rpar;&semi;&NewLine; document&period;body&period;classList&period;toggle&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&semi;&NewLine; toggleMenu2&period;style&period;display &equals; «none»&semi;&NewLine; hideWatchLive&period;style&period;display &equals;»none»&semi; &sol;&sol;added&NewLine; hideVerticalLine&period;style&period;display &equals;»none»&semi; &sol;&sol;added&NewLine; lastVerticalLine&period;style&period;display &equals;»none»&semi; &sol;&sol;added&NewLine;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol;this is hiding both lines&NewLine;&sol;&sol; function toggleHamburger&lpar;event&rpar; &lbrace;&NewLine;&sol;&sol; event&period;stopPropagation&lpar;&rpar;&semi; &sol;&sol; Prevent click event from bubbling up to document&NewLine;&sol;&sol; document&period;body&period;classList&period;toggle&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&semi;&NewLine;&sol;&sol; toggleMenu2&period;style&period;display &equals; «none»&semi;&NewLine;&sol;&sol; hideWatchLive&period;style&period;display &equals; «none»&semi;&NewLine;&NewLine;&sol;&sol; if &lpar;document&period;body&period;classList&period;contains&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&rpar; &lbrace;&NewLine; &NewLine;&sol;&sol; hideVerticalLine&period;forEach&lpar;el &equals;> &lbrace;&NewLine;&sol;&sol; el&period;style&period;display &equals; «none»&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; &rcub; else &lbrace;&NewLine; &NewLine;&sol;&sol; hideVerticalLine&period;forEach&lpar;el &equals;> &lbrace;&NewLine;&sol;&sol; el&period;style&period;display &equals; «»&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine; &NewLine;&sol;&sol; hideWatchLive&period;style&period;display &equals; «»&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;&sol;&sol; Close hamburger when clicking outside&NewLine;document&period;addEventListener&lpar;’click’&comma; function &lpar;event&rpar; &lbrace;&NewLine; &sol;&sol; Check if click is outside the hamburger and menu&lowbar;&lowbar;toggle button&NewLine; if &lpar;&excl;hamburger&period;contains&lpar;event&period;target&rpar; && &excl;document&period;querySelector&lpar;’&period;menu&lowbar;&lowbar;toggle’&rpar;&period;contains&lpar;event&period;target&rpar;&rpar; &lbrace;&NewLine; document&period;body&period;classList&period;remove&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; var pri&lowbar;nav &equals; document&period;querySelector&lpar;’&period;navbar &period;nav’&rpar;&period;cloneNode&lpar;true&rpar;&semi;&NewLine;&sol;&sol; var hamburger &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine;&sol;&sol; const searchNavItem &equals; &grave;<a class&equals;»hamburger search-item nav–item» href&equals;»&sol;search&sol;»>Search&grave;&semi;&NewLine;&sol;&sol; const searchForMenu &equals; &grave;&NewLine;&sol;&sol; <form method&equals;»get» class&equals;»quick–search&lowbar;&lowbar;form» action&equals;»&sol;search&sol;»><input&NewLine;&sol;&sol; type&equals;»text»&NewLine;&sol;&sol; required&equals;»»&NewLine;&sol;&sol; placeholder&equals;»Search&period;&period;»&NewLine;&sol;&sol; value&equals;»»&NewLine;&sol;&sol; name&equals;»q»&NewLine;&sol;&sol; class&equals;»quick–search&lowbar;&lowbar;form–input»&NewLine;&sol;&sol; onfocus&equals;»if &lpar;this&period;value &equals;&equals; »&rpar; &lbrace;this&period;value &equals; »&semi;&rcub;»&NewLine;&sol;&sol; onblur&equals;»if &lpar;this&period;value &equals;&equals; »&rpar; &lbrace;this&period;value &equals; »&semi;&rcub;»&NewLine;&sol;&sol; &sol;><button type&equals;»submit» class&equals;»quick–search&lowbar;&lowbar;form–submit» value&equals;»Search»><svg xmlns&equals;»http&colon;&sol;&sol;www&period;w3&period;org&sol;2000&sol;svg» width&equals;»20″ height&equals;»20″ viewBox&equals;»0 0 40 40″ fill&equals;»none»><path&NewLine;&sol;&sol; d&equals;»M39&period;7217 38&period;324L27&period;2102 25&period;356C30&period;0291 22&period;554 31&period;5786 18&period;89 31&period;5786 15C31&period;5786 10&period;994 29&period;9365 7&period;226 26&period;9534 4&period;394C23&period;9703 1&period;562 20&period;0061 0 15&period;7893 0C11&period;5725 0 7&period;60623 1&period;56 4&period;62521 4&period;394C1&period;64419 7&period;228 0 10&period;994 0 15C0 19&period;006 1&period;64209 22&period;774 4&period;62521 25&period;606C7&period;60834 28&period;438 11&period;5725 30 15&period;7893 30C19&period;4229 30 22&period;8671 28&period;842 25&period;6587 26&period;71L38&period;1701 39&period;676C38&period;3785 39&period;892 38&period;6606 40 38&period;9469 40C39&period;2017 40 39&period;4564 39&period;914 39&period;6585 39&period;738C40&period;088 39&period;364 40&period;1153 38&period;732 39&period;7238 38&period;326L39&period;7217 38&period;324ZM2&period;10313 15C2&period;10313 7&period;832 8&period;24201 2 15&period;7872 2C23&period;3324 2 29&period;4712 7&period;832 29&period;4712 15C29&period;4712 22&period;168 23&period;3324 28 15&period;7872 28C8&period;24201 28 2&period;10313 22&period;168 2&period;10313 15Z»&NewLine;&sol;&sol; fill&equals;»&num;0032AA»&NewLine;&sol;&sol; fill-opacity&equals;»0&period;8″&NewLine;&sol;&sol; >&NewLine;&sol;&sol; &grave;&semi;&NewLine;&sol;&sol; hamburger&period;className &equals; ‘hamburger’&semi;&NewLine;&sol;&sol; hamburger&period;append&lpar;pri&lowbar;nav&rpar;&semi;&NewLine;&sol;&sol; hamburger&period;querySelector&lpar;’&period;nav’&rpar;&period;insertAdjacentHTML&lpar;’afterBegin’&comma; searchForMenu&rpar;&semi;&NewLine;&sol;&sol; document&period;querySelector&lpar;’&period;topbar’&rpar;&period;append&lpar;hamburger&rpar;&semi;&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;&sol;&sol; var nav&lowbar;&lowbar;item &equals; document&period;querySelectorAll&lpar;’&period;hamburger &period;nav–item’&rpar;&semi;&NewLine;&sol;&sol; nav&lowbar;&lowbar;item&period;forEach&lpar;function &lpar;item&rpar; &lbrace;&NewLine;&sol;&sol; var button &equals; document&period;createElement&lpar;’button’&rpar;&semi;&NewLine;&sol;&sol; button&period;className &equals; «sub&lowbar;nav&lowbar;toggle»&semi;&NewLine;&sol;&sol; item&period;append&lpar;button&rpar;&semi;&NewLine;&sol;&sol; button&period;onclick &equals; function &lpar;&rpar; &lbrace;&NewLine;&sol;&sol; nav&lowbar;&lowbar;item&period;forEach&lpar;function &lpar;sni&rpar; &lbrace;&NewLine;&sol;&sol; if &lpar;item &equals;&equals; sni&rpar; &lbrace;&NewLine;&sol;&sol; &rcub; else &lbrace;&NewLine;&sol;&sol; sni&period;classList&period;remove&lpar;’expand’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; item&period;classList&period;toggle&lpar;’expand’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&NewLine;&NewLine;&NewLine;&sol;&sol; function toggleHamburger&lpar;event&rpar; &lbrace;&NewLine;&sol;&sol; event&period;stopPropagation&lpar;&rpar;&semi;&NewLine; &NewLine;&sol;&sol; const isCurrentlyOpen &equals; document&period;body&period;classList&period;contains&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Close account menu if it’s open&NewLine;&sol;&sol; const accountMenu &equals; document&period;getElementById&lpar;’myAccountMenu’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;accountMenu&rpar; &lbrace;&NewLine;&sol;&sol; accountMenu&period;style&period;display &equals; ‘none’&semi;&NewLine;&sol;&sol; accountMenu&period;hidden &equals; true&semi;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Reset account toggle button state&NewLine;&sol;&sol; const accountToggle &equals; document&period;getElementById&lpar;’accountToggleLink’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;accountToggle&rpar; &lbrace;&NewLine;&sol;&sol; accountToggle&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; accountToggle&period;setAttribute&lpar;’aria-expanded’&comma; ‘false’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Toggle hamburger menu&NewLine;&sol;&sol; if &lpar;&excl;isCurrentlyOpen&rpar; &lbrace;&NewLine;&sol;&sol; console&period;log&lpar;»Opening hamburger menu»&rpar;&semi;&NewLine;&sol;&sol; document&period;body&period;classList&period;add&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Hide elements&NewLine;&sol;&sol; let toggleMenus &equals; document&period;querySelectorAll&lpar;»&period;menu&lowbar;&lowbar;toggle»&rpar;&semi;&NewLine;&sol;&sol; let toggleMenu2 &equals; toggleMenus&lbrack;0&rsqb;&semi;&NewLine;&sol;&sol; let hideWatchLive &equals; document&period;querySelector&lpar;’&period;watch-live-button’&rpar;&semi;&NewLine;&sol;&sol; let hideVerticalLine &equals; document&period;querySelector&lpar;’&period;vertical-line’&rpar;&semi;&NewLine;&sol;&sol; let lastVerticalLine &equals; document&period;querySelector&lpar;’&period;sticky-left &period;vertical-line&colon;last-of-type’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; if &lpar;toggleMenu2&rpar; toggleMenu2&period;style&period;display &equals; «none»&semi;&NewLine;&sol;&sol; if &lpar;hideWatchLive&rpar; hideWatchLive&period;style&period;display &equals; «none»&semi;&NewLine;&sol;&sol; if &lpar;hideVerticalLine&rpar; hideVerticalLine&period;style&period;display &equals; «none»&semi;&NewLine;&sol;&sol; if &lpar;lastVerticalLine&rpar; lastVerticalLine&period;style&period;display &equals; «none»&semi;&NewLine;&sol;&sol; &rcub; else &lbrace;&NewLine;&sol;&sol; console&period;log&lpar;»Closing hamburger menu»&rpar;&semi;&NewLine;&sol;&sol; document&period;body&period;classList&period;remove&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Function for account menu&NewLine;&sol;&sol; function toggleAccountMenu&lpar;event&rpar; &lbrace;&NewLine;&sol;&sol; event&period;preventDefault&lpar;&rpar;&semi;&NewLine;&sol;&sol; event&period;stopPropagation&lpar;&rpar;&semi;&NewLine; &NewLine;&sol;&sol; const accountMenu &equals; document&period;getElementById&lpar;’myAccountMenu’&rpar;&semi;&NewLine;&sol;&sol; const isCurrentlyOpen &equals; accountMenu && &excl;accountMenu&period;hidden && accountMenu&period;style&period;display &excl;&equals;&equals; ‘none’&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Close hamburger menu if it’s open&NewLine;&sol;&sol; document&period;body&period;classList&period;remove&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Close account menu first&NewLine;&sol;&sol; if &lpar;accountMenu&rpar; &lbrace;&NewLine;&sol;&sol; accountMenu&period;style&period;display &equals; ‘none’&semi;&NewLine;&sol;&sol; accountMenu&period;hidden &equals; true&semi;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Reset account toggle button state&NewLine;&sol;&sol; const accountToggle &equals; document&period;getElementById&lpar;’accountToggleLink’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;accountToggle&rpar; &lbrace;&NewLine;&sol;&sol; accountToggle&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; accountToggle&period;setAttribute&lpar;’aria-expanded’&comma; ‘false’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; If the account menu wasn’t open&comma; open it&NewLine;&sol;&sol; if &lpar;&excl;isCurrentlyOpen && accountMenu&rpar; &lbrace;&NewLine;&sol;&sol; accountMenu&period;style&period;display &equals; ‘block’&semi;&NewLine;&sol;&sol; accountMenu&period;hidden &equals; false&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Set button state&NewLine;&sol;&sol; if &lpar;accountToggle&rpar; &lbrace;&NewLine;&sol;&sol; accountToggle&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; accountToggle&period;setAttribute&lpar;’aria-expanded’&comma; ‘true’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; DODAJ tylko jeden event listener dla ka&&num;380&semi;dego menu&colon;&NewLine;&sol;&sol; document&period;addEventListener&lpar;’DOMContentLoaded’&comma; function&lpar;&rpar; &lbrace;&NewLine;&sol;&sol; &sol;&sol; Hamburger menu – znajd&&num;378&semi; w&&num;322&semi;a&&num;347&semi;ciwy przycisk&NewLine;&sol;&sol; let toggleMenus &equals; document&period;querySelectorAll&lpar;»&period;menu&lowbar;&lowbar;toggle»&rpar;&semi;&NewLine;&sol;&sol; let toggleMenu &equals; toggleMenus&lbrack;1&rsqb;&semi; &sol;&sol; lub &lbrack;0&rsqb; – sprawd&&num;378&semi; kt&oacute&semi;ry to w&&num;322&semi;a&&num;347&semi;ciwy&NewLine; &NewLine;&sol;&sol; if &lpar;toggleMenu&rpar; &lbrace;&NewLine;&sol;&sol; &sol;&sol; Usu&&num;324&semi; wszystkie poprzednie event listenery&NewLine;&sol;&sol; toggleMenu&period;removeEventListener&lpar;»click»&comma; toggleHamburger&rpar;&semi;&NewLine;&sol;&sol; toggleMenu&period;onclick &equals; null&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Dodaj nowy event listener&NewLine;&sol;&sol; toggleMenu&period;addEventListener&lpar;»click»&comma; toggleHamburger&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Account menu toggle&NewLine;&sol;&sol; const accountToggle &equals; document&period;getElementById&lpar;’accountToggleLink’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;accountToggle&rpar; &lbrace;&NewLine;&sol;&sol; accountToggle&period;addEventListener&lpar;’click’&comma; toggleAccountMenu&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Zamykanie menu po klikni&&num;281&semi;ciu poza nimi&NewLine;&sol;&sol; document&period;addEventListener&lpar;’click’&comma; function&lpar;event&rpar; &lbrace;&NewLine;&sol;&sol; const accountMenu &equals; document&period;getElementById&lpar;’myAccountMenu’&rpar;&semi;&NewLine;&sol;&sol; const hamburgerMenu &equals; document&period;querySelector&lpar;’&period;hamburger’&rpar;&semi;&NewLine;&sol;&sol; const accountToggle &equals; document&period;getElementById&lpar;’accountToggleLink’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Sprawd&&num;378&semi; wszystkie przyciski hamburger&NewLine;&sol;&sol; let isClickOnHamburgerButton &equals; false&semi;&NewLine;&sol;&sol; document&period;querySelectorAll&lpar;’&period;menu&lowbar;&lowbar;toggle’&rpar;&period;forEach&lpar;btn &equals;> &lbrace;&NewLine;&sol;&sol; if &lpar;btn&period;contains&lpar;event&period;target&rpar;&rpar; &lbrace;&NewLine;&sol;&sol; isClickOnHamburgerButton &equals; true&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Je&&num;347&semi;li klikni&&num;281&semi;cie jest poza menu i przyciskami&NewLine;&sol;&sol; if &lpar;&excl;accountMenu&quest;&period;contains&lpar;event&period;target&rpar; && &NewLine;&sol;&sol; &excl;accountToggle&quest;&period;contains&lpar;event&period;target&rpar; &&&NewLine;&sol;&sol; &excl;hamburgerMenu&quest;&period;contains&lpar;event&period;target&rpar; && &NewLine;&sol;&sol; &excl;isClickOnHamburgerButton&rpar; &lbrace;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Zamknij oba menu&NewLine;&sol;&sol; document&period;body&period;classList&period;remove&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;accountMenu&rpar; &lbrace;&NewLine;&sol;&sol; accountMenu&period;style&period;display &equals; ‘none’&semi;&NewLine;&sol;&sol; accountMenu&period;hidden &equals; true&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; if &lpar;accountToggle&rpar; &lbrace;&NewLine;&sol;&sol; accountToggle&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; accountToggle&period;setAttribute&lpar;’aria-expanded’&comma; ‘false’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Added&NewLine;&sol;&sol; function toggleAccountMenu&lpar;event&rpar; &lbrace;&NewLine;&sol;&sol; event&period;preventDefault&lpar;&rpar;&semi;&NewLine;&sol;&sol; event&period;stopPropagation&lpar;&rpar;&semi;&NewLine; &NewLine;&sol;&sol; const accountMenu &equals; document&period;getElementById&lpar;’myAccountMenu’&rpar;&semi;&NewLine;&sol;&sol; const isCurrentlyOpen &equals; accountMenu && &excl;accountMenu&period;hidden && accountMenu&period;style&period;display &excl;&equals;&equals; ‘none’&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Close hamburger menu if it’s open&NewLine;&sol;&sol; document&period;body&period;classList&period;remove&lpar;’hamburger&lowbar;&lowbar;open’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Close account menu first&NewLine;&sol;&sol; if &lpar;accountMenu&rpar; &lbrace;&NewLine;&sol;&sol; accountMenu&period;style&period;display &equals; ‘none’&semi;&NewLine;&sol;&sol; accountMenu&period;hidden &equals; true&semi;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Reset account toggle button state&NewLine;&sol;&sol; const accountToggle &equals; document&period;getElementById&lpar;’accountToggleLink’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;accountToggle&rpar; &lbrace;&NewLine;&sol;&sol; accountToggle&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; accountToggle&period;setAttribute&lpar;’aria-expanded’&comma; ‘false’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&sol;&sol; &sol;&sol; If the account menu wasn’t open&comma; open it&NewLine;&sol;&sol; if &lpar;&excl;isCurrentlyOpen && accountMenu&rpar; &lbrace;&NewLine;&sol;&sol; accountMenu&period;style&period;display &equals; ‘block’&semi;&NewLine;&sol;&sol; accountMenu&period;hidden &equals; false&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol; Set button state&NewLine;&sol;&sol; if &lpar;accountToggle&rpar; &lbrace;&NewLine;&sol;&sol; accountToggle&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine;&sol;&sol; accountToggle&period;setAttribute&lpar;’aria-expanded’&comma; ‘true’&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; Event listener for account menu&NewLine;&sol;&sol; document&period;addEventListener&lpar;’DOMContentLoaded’&comma; function&lpar;&rpar; &lbrace;&NewLine;&sol;&sol; const accountToggle &equals; document&period;getElementById&lpar;’accountToggleLink’&rpar;&semi;&NewLine;&sol;&sol; if &lpar;accountToggle&rpar; &lbrace;&NewLine;&sol;&sol; accountToggle&period;addEventListener&lpar;’click’&comma; toggleAccountMenu&rpar;&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; document&period;addEventListener&lpar;’DOMContentLoaded’&comma; function&lpar;&rpar; &lbrace;&NewLine;&sol;&sol; console&period;log&lpar;’DOM loaded’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &sol;&sol;search element&NewLine;&sol;&sol; const button &equals; document&period;querySelector&lpar;’&period;live-cta&lowbar;&lowbar;button’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; if &lpar;button&rpar; &lbrace;&NewLine;&sol;&sol; console&period;log&lpar;’Element found’&rpar;&semi;&NewLine;&sol;&sol; console&period;log&lpar;’Element&colon;’&comma; button&rpar;&semi;&NewLine;&sol;&sol; console&period;log&lpar;’Class&colon;’&comma; button&period;className&rpar;&semi;&NewLine; &NewLine;&sol;&sol; button&period;addEventListener&lpar;’click’&comma; function&lpar;e&rpar; &lbrace;&NewLine;&sol;&sol; e&period;preventDefault&lpar;&rpar;&semi; &NewLine; &NewLine;&sol;&sol; console&period;log&lpar;’clicked Watch Live&excl;’&rpar;&semi;&NewLine; &NewLine; &NewLine;&sol;&sol; &sol;&sol; Toggle class active&NewLine;&sol;&sol; this&period;classList&period;toggle&lpar;’active’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; console&period;log&lpar;’class after toggle&colon;’&comma; this&period;className&rpar;&semi;&NewLine;&sol;&sol; console&period;log&lpar;’class active&quest;’&comma; this&period;classList&period;contains&lpar;’active’&rpar;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine;&sol;&sol; &rcub; else &lbrace;&NewLine;&sol;&sol; console&period;error&lpar;’no button &period;live-cta&lowbar;&lowbar;button’&rpar;&semi;&NewLine; &NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; PRIMARY NAV&NewLine;let primary&lowbar;nav &equals; document&period;querySelector&lpar;’&period;topbar ~ &period;navbar &period;nav’&rpar; &vert;&vert; document&period;querySelector&lpar;’&period;topbar-wrapper ~ &period;navbar &period;nav’&rpar;&semi;&NewLine;let primary&lowbar;leftArrow &equals; document&period;querySelector&lpar;’&period;nav–arrows&period;primary–nav&lowbar;&lowbar;arrow&period;left’&rpar;&semi;&NewLine;let primary&lowbar;rightArrow &equals; document&period;querySelector&lpar;’&period;nav–arrows&period;primary–nav&lowbar;&lowbar;arrow&period;right’&rpar;&semi;&NewLine;let primary&lowbar;navItems &equals; window&period;innerWidth > 768 &quest; document&period;querySelectorAll&lpar;’&period;topbar ~ &period;navbar &period;nav &period;nav–item’&rpar; &colon; document&period;querySelectorAll&lpar;’&period;topbar-wrapper ~ &period;navbar &period;nav &period;nav–item’&rpar;&semi;&NewLine;&NewLine;&sol;&sol; SECONDARY NAV&NewLine;let secondary&lowbar;nav &equals; document&period;querySelector&lpar;’&period;topbar ~ &period;navbar &period;nav &period;nav–item&period;active &period;secondary–nav &period;list’&rpar;&semi;&NewLine;let secondary&lowbar;leftArrow &equals; document&period;querySelector&lpar;’&period;nav–arrows&period;secondary–nav&lowbar;&lowbar;arrow&period;left’&rpar;&semi;&NewLine;let secondary&lowbar;rightArrow &equals; document&period;querySelector&lpar;’&period;nav–arrows&period;secondary–nav&lowbar;&lowbar;arrow&period;right’&rpar;&semi;&NewLine;let secondary&lowbar;navItems &equals; window&period;innerWidth > 768 &quest; secondary&lowbar;nav&period;querySelectorAll&lpar;’&period;list&lowbar;&lowbar;item’&rpar; &colon; null&NewLine;&NewLine;function scrollToItem&lpar;item&comma; nav&comma; rightArrow&comma; leftArrow&rpar; &lbrace;&NewLine; if &lpar;item&rpar; &lbrace;&NewLine; const navRect &equals; nav&period;getBoundingClientRect&lpar;&rpar;&semi;&NewLine; const itemRect &equals; item&period;getBoundingClientRect&lpar;&rpar;&semi;&NewLine; &NewLine; const scrollLeft &equals; nav&period;scrollLeft &plus; &lpar;itemRect&period;left – navRect&period;left&rpar;&semi;&NewLine; const maxScroll &equals; nav&period;scrollWidth – nav&period;clientWidth&semi;&NewLine; const targetScroll &equals; Math&period;min&lpar;scrollLeft&comma; maxScroll&rpar;&semi;&NewLine; &NewLine; nav&period;scrollTo&lpar;&lbrace;&NewLine; left&colon; targetScroll&comma;&NewLine; behavior&colon; ‘smooth’&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; ONLY DESKTOP&NewLine; if &lpar;window&period;innerWidth > 768&rpar; &lbrace;&NewLine; if &lpar;targetScroll &equals;&equals;&equals; 0&rpar; &lbrace;&NewLine; rightArrow&period;classList&period;remove&lpar;»hidden»&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; leftArrow&period;classList&period;remove&lpar;»hidden»&rpar;&semi;&NewLine; rightArrow&period;classList&period;remove&lpar;»hidden»&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;function scrollToActiveItem&lpar;&rpar; &lbrace;&NewLine; const primary&lowbar;activeItem &equals; document&period;querySelector&lpar;’&period;topbar ~ &period;navbar &period;nav &period;nav–item&period;active’&rpar; &vert;&vert; document&period;querySelector&lpar;’&period;topbar-wrapper ~ &period;navbar &period;nav &period;nav–item&period;active’&rpar;&semi;&NewLine; const secondary&lowbar;activeItem &equals; window&period;innerWidth > 768 &quest; secondary&lowbar;nav&period;querySelector&lpar;’&period;list&lowbar;&lowbar;item&period;active’&rpar; &colon; null&semi;&NewLine;&NewLine; if &lpar;primary&lowbar;activeItem&rpar; &lbrace;&NewLine; scrollToItem&lpar;primary&lowbar;activeItem&comma; primary&lowbar;nav&comma; primary&lowbar;rightArrow&comma; primary&lowbar;leftArrow&rpar;&semi;&NewLine; &rcub;&NewLine; if &lpar;secondary&lowbar;activeItem&rpar; &lbrace;&NewLine; scrollToItem&lpar;secondary&lowbar;activeItem&comma; secondary&lowbar;nav&comma; secondary&lowbar;rightArrow&comma; secondary&lowbar;leftArrow&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;function updateArrows&lpar;nav&comma; leftArrow&comma; rightArrow&rpar; &lbrace;&NewLine; const scrollLeft &equals; nav&period;scrollLeft&semi;&NewLine; const maxScroll &equals; nav&period;scrollWidth – nav&period;clientWidth&semi;&NewLine; &NewLine; &sol;&sol; Hide left arrow if at the start &lpar;with small threshold&rpar;&NewLine; if &lpar;leftArrow&rpar; &lbrace;&NewLine; if &lpar;scrollLeft <&equals; 1&rpar; &lbrace;&NewLine; leftArrow&period;classList&period;add&lpar;»hidden»&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; leftArrow&period;classList&period;remove&lpar;»hidden»&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; Hide right arrow if at the end &lpar;with small threshold&rpar;&NewLine; if &lpar;rightArrow&rpar; &lbrace;&NewLine; if &lpar;scrollLeft >&equals; maxScroll – 1&rpar; &lbrace;&NewLine; rightArrow&period;classList&period;add&lpar;»hidden»&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; rightArrow&period;classList&period;remove&lpar;»hidden»&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;function initScroll&lpar;&rpar; &lbrace;&NewLine; &NewLine; if &lpar;&excl;primary&lowbar;nav&rpar; return&semi;&NewLine; &NewLine; &sol;&sol; Scroll to active item on load&NewLine; scrollToActiveItem&lpar;&rpar;&semi;&NewLine; &NewLine; &sol;&sol; Add click listeners to nav items&NewLine; primary&lowbar;navItems&period;forEach&lpar;function&lpar;item&rpar; &lbrace;&NewLine; item&period;addEventListener&lpar;’click’&comma; function&lpar;e&rpar; &lbrace;&NewLine; primary&lowbar;navItems&period;forEach&lpar;function&lpar;i&rpar; &lbrace;&NewLine; i&period;classList&period;remove&lpar;’active’&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; item&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; scrollToItem&lpar;item&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &NewLine; &sol;&sol; Add scroll listener to update arrows &vert; ONLY DESKTOP&NewLine; if &lpar;window&period;innerWidth > 768&rpar; &lbrace;&NewLine; primary&lowbar;nav&period;addEventListener&lpar;’scroll’&comma; function&lpar;&rpar; &lbrace;&NewLine; updateArrows&lpar;primary&lowbar;nav&comma; primary&lowbar;leftArrow&comma; primary&lowbar;rightArrow&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; secondary&lowbar;nav&period;addEventListener&lpar;’scroll’&comma; function&lpar;&rpar; &lbrace;&NewLine; updateArrows&lpar;secondary&lowbar;nav&comma; secondary&lowbar;leftArrow&comma; secondary&lowbar;rightArrow&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &NewLine; &sol;&sol; Add click listeners to arrows&NewLine; if &lpar;primary&lowbar;leftArrow&rpar; &lbrace;&NewLine; primary&lowbar;leftArrow&period;addEventListener&lpar;’click’&comma; function&lpar;&rpar; &lbrace;&NewLine; primary&lowbar;nav&period;scrollBy&lpar;&lbrace; left&colon; -&lpar;primary&lowbar;nav&period;clientWidth&rpar;&comma; behavior&colon; ‘smooth’ &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; if &lpar;primary&lowbar;rightArrow&rpar; &lbrace;&NewLine; primary&lowbar;rightArrow&period;addEventListener&lpar;’click’&comma; function&lpar;&rpar; &lbrace;&NewLine; primary&lowbar;nav&period;scrollBy&lpar;&lbrace; left&colon; primary&lowbar;nav&period;clientWidth&comma; behavior&colon; ‘smooth’ &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; if &lpar;secondary&lowbar;leftArrow&rpar; &lbrace;&NewLine; secondary&lowbar;leftArrow&period;addEventListener&lpar;’click’&comma; function&lpar;&rpar; &lbrace;&NewLine; secondary&lowbar;nav&period;scrollBy&lpar;&lbrace; left&colon; -&lpar;secondary&lowbar;nav&period;clientWidth&rpar;&comma; behavior&colon; ‘smooth’ &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; if &lpar;secondary&lowbar;rightArrow&rpar; &lbrace;&NewLine; secondary&lowbar;rightArrow&period;addEventListener&lpar;’click’&comma; function&lpar;&rpar; &lbrace;&NewLine; secondary&lowbar;nav&period;scrollBy&lpar;&lbrace; left&colon; secondary&lowbar;nav&period;clientWidth&comma; behavior&colon; ‘smooth’ &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; updateArrows&lpar;primary&lowbar;nav&comma; primary&lowbar;leftArrow&comma; primary&lowbar;rightArrow&rpar;&semi;&NewLine; updateArrows&lpar;secondary&lowbar;nav&comma; secondary&lowbar;leftArrow&comma; secondary&lowbar;rightArrow&rpar;&semi;&NewLine; &NewLine; window&period;addEventListener&lpar;’resize’&comma; function&lpar;&rpar; &lbrace;&NewLine; updateArrows&lpar;primary&lowbar;nav&comma; primary&lowbar;leftArrow&comma; primary&lowbar;rightArrow&rpar;&NewLine; updateArrows&lpar;secondary&lowbar;nav&comma; secondary&lowbar;leftArrow&comma; secondary&lowbar;rightArrow&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; &NewLine;&rcub;&NewLine;&NewLine;setTimeout&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; initScroll&lpar;&rpar;&semi;&NewLine;&rcub;&comma; 700&rpar;&NewLine;&NewLine;&sol;&sol; reset active to HOME when clicking in LOGO&NewLine;REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;»&period;site-logo a»&comma; function&lpar;button&rpar;&lbrace;&NewLine;&Tab;button&period;addEventListener&lpar;»click»&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; sessionStorage&period;setItem&lpar;»active&lowbar;pri&lowbar;nav&lowbar;item»&comma; «pri-nav-1″&rpar;&NewLine; sessionStorage&period;setItem&lpar;»active&lowbar;sec&lowbar;nav&lowbar;item»&comma; «pri-nav-1″&rpar;&NewLine; &rcub;&rpar;&NewLine;&rcub;&rpar;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol;MOVED TO delayedCmpScripts shared element&excl;&excl;&excl;&NewLine;&NewLine;const PIANO&lowbar;SCRIPT &equals; «https&colon;&sol;&sol;experience-eu&period;piano&period;io&sol;xbuilder&sol;experience&sol;load&quest;aid&equals;6N1iEZE6pe»&semi;&NewLine;&NewLine;&sol;&sol; load Piano script&NewLine;&NewLine;&NewLine;&sol;&sol; console&period;log&lpar;’Consent is ready&comma; loading Piano&period;&period;&period;’&rpar;&semi;&NewLine;&NewLine; &lpar;function&lpar;src&rpar;&lbrace;var a&equals;document&period;createElement&lpar;»script»&rpar;&semi;a&period;type&equals;»text&sol;javascript»&semi;a&period;async&equals;true&semi;a&period;src&equals;src&semi;var b&equals;document&period;getElementsByTagName&lpar;»script»&rpar;&lbrack;0&rsqb;&semi;b&period;parentNode&period;insertBefore&lpar;a&comma;b&rpar;&rcub;&rpar;&lpar;PIANO&lowbar;SCRIPT&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; Handles both normal logins AND logins after registration&excl;&NewLine;&NewLine;&sol;&sol; Make tp available or use existing one if already loaded&NewLine;tp &equals; window&period;tp &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine;tp&period;push&lpar;&lbrack;&NewLine; ‘addHandler’&comma;&NewLine; ‘loginSuccess’&comma;&NewLine; function &lpar;data&rpar; &lbrace;&NewLine; console&period;log&lpar;’loginSuccess – callback envoked’&comma; data&rpar;&semi;&NewLine; let userEmail &equals; data&period;params&period;email&semi;&NewLine; let userUId &equals; data&period;params&period;uid&semi;&NewLine;&NewLine; &sol;&sol; establish the type of login&NewLine; let registrationLogin &equals; data&period;registration&semi; &sol;&sol; if false&comma; it is a STANDARD LOGIN&NewLine;&NewLine; if &lpar;&excl;registrationLogin&rpar; &lbrace;&NewLine; &sol;&sol; &equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals; HANDLE NORMAL LOGIN &equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&NewLine;&NewLine; &sol;&sol; 1&period; Update membership and consent status in PushWoosh&NewLine; tp&period;api&period;callApi&lpar;’&sol;access&sol;list’&comma; &lbrace;&rcub;&comma; function &lpar;data&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;»&sol;access&sol;list «&comma; data&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Declare variables&NewLine; let userFirstName &equals; data&period;data&lbrack;0&rsqb;&period;user&period;first&lowbar;name&semi;&NewLine; let userLastName &equals; data&period;data&lbrack;0&rsqb;&period;user&period;last&lowbar;name&semi;&NewLine; let ridArray &equals; &lbrack;&rsqb;&semi;&NewLine; let resourceName &equals; &lbrack;&rsqb;&semi;&NewLine; let userAccessStatus &equals; »&semi;&NewLine; let userIsMember &equals; »&semi;&NewLine; let marketingComsValue &equals; null&semi;&NewLine;&NewLine; for &lpar;const item of data&period;data&rpar; &lbrace;&NewLine; ridArray&period;push&lpar;item&period;resource&period;rid&rpar;&semi;&NewLine; resourceName&period;push&lpar;item&period;resource&period;name&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; remove «R5NMHWH» AND «RWY51ZC» from ridArray&NewLine; &sol;&sol; remove Donate RIDs «RUK2FBE»&comma; «RFCEL9J»&comma; «RMXO6VF»&comma; «RTEANTC» from ridArray&NewLine; for &lpar;let i &equals; 0&semi; i < ridArray&period;length&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; ridArray &equals; ridArray&period;filter&lpar;&lpar;item&rpar; &equals;> item &excl;&equals;&equals; ‘R5NMHWH’ && item &excl;&equals;&equals; ‘RWY51ZC’&rpar;&semi;&NewLine; ridArray &equals; ridArray&period;filter&lpar;&NewLine; &lpar;item&rpar; &equals;> item &excl;&equals;&equals; ‘RUK2FBE’ && item &excl;&equals;&equals; ‘RFCEL9J’ && item &excl;&equals;&equals; ‘RMXO6VF’ && item &excl;&equals;&equals; ‘RTEANTC’&comma;&NewLine; &rpar;&semi;&NewLine; &rcub;&NewLine; console&period;log&lpar;’ridArray after removing R5NMHWH and RWY51ZC and Donation RIDs ‘&comma; ridArray&rpar;&semi;&NewLine;&NewLine; &sol;&sol; remove «Registration» AND «Privacy Plus» from resourceName&NewLine; for &lpar;let i &equals; 0&semi; i < resourceName&period;length&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; resourceName &equals; resourceName&period;filter&lpar;&NewLine; &lpar;item&rpar; &equals;> item &excl;&equals;&equals; ‘Registration’ && item &excl;&equals;&equals; ‘Privacy Plus’ && &excl;item&period;toLowerCase&lpar;&rpar;&period;includes&lpar;’donation’&rpar;&comma;&NewLine; &rpar;&semi;&NewLine; &rcub;&NewLine; resourceName &equals; resourceName&period;toString&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;’resourceName after removing Registration and Privacy Plus and Donation ‘&comma; resourceName&rpar;&semi;&NewLine;&NewLine; &sol;&sol; If the ridArray still has an item – user has membership access&NewLine; if &lpar;ridArray&period;length > 0&rpar; &lbrace;&NewLine; console&period;log&lpar;’User is a member’&rpar;&semi;&NewLine; userAccessStatus &equals; ‘member’&semi;&NewLine; userIsMember &equals; ‘true’&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;log&lpar;’User has either churned or never been a member’&rpar;&semi;&NewLine; userAccessStatus &equals; ‘registered’&semi;&NewLine; userIsMember &equals; ‘false’&semi;&NewLine; &rcub;&NewLine;&NewLine; tp&period;pianoId&period;loadExtendedUser&lpar;&lbrace;&NewLine; formName&colon; ‘RegistrationFields’&comma;&NewLine; extendedUserLoaded&colon; function &lpar;data&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; console&period;log&lpar;’form data from loginSuccess’&comma; data&rpar;&semi;&NewLine; let customFieldArray &equals; data&period;custom&lowbar;field&lowbar;values&semi;&NewLine;&NewLine; for &lpar;let item of customFieldArray&rpar; &lbrace;&NewLine; if &lpar;item&period;field&lowbar;name &equals;&equals;&equals; ‘marketingcoms’&rpar; &lbrace;&NewLine; marketingComsValue &equals; item&period;value&semi;&NewLine; break&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; let userPayload &equals; &lbrace;&NewLine; userFirstName&colon; userFirstName&comma;&NewLine; userLastName&colon; userLastName&comma;&NewLine; userEmail&colon; userEmail&comma;&NewLine; userUId&colon; userUId&comma;&NewLine; userAccessStatus&colon; userAccessStatus&comma;&NewLine; userIsMember&colon; userIsMember&comma;&NewLine; userMarketingConsent&colon; marketingComsValue&comma;&NewLine; resourceName&colon; resourceName&comma;&NewLine; &rcub;&semi;&NewLine;&NewLine; async function pushwooshTagsCB&lpar;userPayload&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&NewLine; &grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;STAGING&lowbar;pushwoosh&lowbar;update&lowbar;tags&quest;cache&equals;&dollar;&lbrace;Date&period;now&lpar;&rpar;&rcub;&grave;&comma;&NewLine; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace;&NewLine; ‘Content-Type’&colon; ‘application&sol;json’&comma;&NewLine; &rcub;&comma;&NewLine; credentials&colon; ‘omit’&comma;&NewLine; body&colon; JSON&period;stringify&lpar;userPayload&rpar;&comma;&NewLine; &rcub;&comma;&NewLine; &rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;response&period;ok&rpar; &lbrace;&NewLine; throw new Error&lpar;’loginSuccess – pushwoosh&lowbar;update&lowbar;tags request failed’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; const data &equals; await response&period;json&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;data&rpar;&semi;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &sol;&sol; call client backend here&NewLine; pushwooshTagsCB&lpar;userPayload&rpar;&semi;&NewLine; &rcub; catch &lpar;parseError&rpar; &lbrace;&NewLine; console&period;log&lpar;parseError&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma;&NewLine; extendedUserLoadFailed&colon; function &lpar;err&rpar; &lbrace;&NewLine; console&period;log&lpar;err&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; &equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals; HANDLE REGISTRATION &equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&equals;&NewLine;&NewLine; &sol;&sol; 1&period; Give registration term to all users on registrationSuccess&NewLine; function addRegisterTerm&lpar;&rpar; &lbrace;&NewLine; let registrationTermId &equals; ‘TMW0NH7F6XUM’&semi;&NewLine; tp&period;api&period;callApi&lpar;’&sol;conversion&sol;registration&sol;create’&comma; &lbrace; term&lowbar;id&colon; registrationTermId &rcub;&comma; function &lpar;conversionData&rpar; &lbrace;&NewLine; console&period;log&lpar;’registration term conversion’&comma; conversionData&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; addRegisterTerm&lpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; 2&period; Create user in Pushwoosh and assign to Mailing Lists&NewLine; let marketingComsValue &equals; null&semi;&NewLine; let MAILING&lowbar;LISTS &equals; »&semi;&NewLine;&NewLine; tp&period;pianoId&period;loadExtendedUser&lpar;&lbrace;&NewLine; formName&colon; ‘RegistrationFields’&comma;&NewLine; extendedUserLoaded&colon; function &lpar;data&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; console&period;log&lpar;’form data from registration’&comma; data&rpar;&semi;&NewLine; let customFieldArray &equals; data&period;custom&lowbar;field&lowbar;values&semi;&NewLine;&NewLine; for &lpar;let item of customFieldArray&rpar; &lbrace;&NewLine; if &lpar;item&period;field&lowbar;name &equals;&equals;&equals; ‘marketingcoms’&rpar; &lbrace;&NewLine; marketingComsValue &equals; item&period;value&semi;&NewLine; break&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; 6723 &equals; news &sol; 8457 &equals; for you &sol; 8255 &equals; promotions&NewLine; MAILING&lowbar;LISTS &equals; marketingComsValue &equals;&equals; ‘true’ &quest; ‘&lbrack;6723&comma; 8457&comma; 8255&rsqb;’ &colon; ‘&lbrack;6723&comma; 8457&rsqb;’&semi;&NewLine;&NewLine; let userPayloadForPushwoosh &equals; &lbrace;&NewLine; userEmail&colon; userEmail&comma; &sol;&sol; data&period;email&NewLine; userFirstName&colon; data&period;first&lowbar;name&comma;&NewLine; userLastName&colon; data&period;last&lowbar;name&comma;&NewLine; userUId&colon; userUId&comma;&NewLine; userAccessStatus&colon; ‘registered’&comma;&NewLine; userIsMember&colon; ‘false’&comma;&NewLine; userMarketingConsent&colon; marketingComsValue&comma;&NewLine; isRegistration&colon; ‘true’&comma;&NewLine; &rcub;&semi;&NewLine; console&period;log&lpar;userPayloadForPushwoosh&rpar;&semi;&NewLine;&NewLine; let userPayloadForML &equals; &lbrace;&NewLine; email&colon; data&period;email&comma;&NewLine; sqids&colon; MAILING&lowbar;LISTS&comma;&NewLine; &rcub;&semi;&NewLine; console&period;log&lpar;userPayloadForML&rpar;&semi;&NewLine;&NewLine; &sol;&sol; A&period; Create User in Pushwoosh&NewLine; async function pushwooshTagsCB&lpar;userPayloadForPushwoosh&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&NewLine; &grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;STAGING&lowbar;pushwoosh&lowbar;update&lowbar;tags&quest;cache&equals;&dollar;&lbrace;Date&period;now&lpar;&rpar;&rcub;&grave;&comma;&NewLine; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace;&NewLine; ‘Content-Type’&colon; ‘application&sol;json’&comma;&NewLine; &rcub;&comma;&NewLine; credentials&colon; ‘omit’&comma;&NewLine; body&colon; JSON&period;stringify&lpar;userPayloadForPushwoosh&rpar;&comma;&NewLine; &rcub;&comma;&NewLine; &rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;response&period;ok&rpar; &lbrace;&NewLine; throw new Error&lpar;’pushwoosh&lowbar;email&lowbar;reg request failed’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; const data &equals; await response&period;json&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;data&rpar;&semi;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &sol;&sol; call client backend here&NewLine; pushwooshTagsCB&lpar;userPayloadForPushwoosh&rpar;&semi;&NewLine;&NewLine; &sol;&sol; B&period; Assign user to mailing lists&NewLine; async function assignMailingList&lpar;userPayloadForML&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&NewLine; &grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;piano&lowbar;assign&lowbar;user&lowbar;mailingList&quest;cache&equals;&dollar;&lbrace;Date&period;now&lpar;&rpar;&rcub;&grave;&comma;&NewLine; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace;&NewLine; ‘Content-Type’&colon; ‘application&sol;json’&comma;&NewLine; &rcub;&comma;&NewLine; credentials&colon; ‘omit’&comma;&NewLine; body&colon; JSON&period;stringify&lpar;userPayloadForML&rpar;&comma;&NewLine; &rcub;&comma;&NewLine; &rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;response&period;ok&rpar; &lbrace;&NewLine; throw new Error&lpar;’piano&lowbar;assign&lowbar;user&lowbar;mailingList request failed’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; const data &equals; await response&period;json&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;data&rpar;&semi;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &sol;&sol; call client backend here&NewLine; assignMailingList&lpar;userPayloadForML&rpar;&semi;&NewLine; &rcub; catch &lpar;parseError&rpar; &lbrace;&NewLine; console&period;log&lpar;parseError&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma;&NewLine; extendedUserLoadFailed&colon; function &lpar;err&rpar; &lbrace;&NewLine; console&period;log&lpar;err&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma;&NewLine;&rsqb;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; Make tp available or use existing one if already loaded&NewLine;tp &equals; window&period;tp &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine;&sol;&sol; Hook to execute when register was successful&NewLine;tp&period;push&lpar;&lbrack;»addHandler»&comma; «checkoutComplete»&comma; function&lpar;data&rpar;&lbrace;&NewLine;&NewLine;&sol;&sol; 1&period; Update user in PushWoosh – create them if they don’t exist&NewLine; tp&period;api&period;callApi&lpar;’&sol;access&sol;list’&comma; &lbrace;&rcub;&comma; function&lpar;data&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;»&sol;access&sol;list «&comma; data&rpar;&semi;&NewLine;&NewLine; let userFirstName &equals; data&period;data&lbrack;0&rsqb;&period;user&period;first&lowbar;name&semi;&NewLine; let userLastName &equals; data&period;data&lbrack;0&rsqb;&period;user&period;last&lowbar;name&semi;&NewLine; let userId &equals; data&period;data&lbrack;0&rsqb;&period;user&period;uid&semi;&NewLine; let userEmail &equals; data&period;data&lbrack;0&rsqb;&period;user&period;email&semi;&NewLine; let resourceName &equals; &lbrack;&rsqb;&semi;&NewLine; let ridArray &equals; &lbrack;&rsqb;&semi;&NewLine; let userAccessStatus &equals; «»&semi;&NewLine; let userIsMember &equals; «»&semi;&NewLine; let marketingComsValue &equals; null&semi;&NewLine; let MAILING&lowbar;LISTS &equals; «&lbrack;8261&rsqb;»&semi; &sol;&sol; members only mailing list id&NewLine;&NewLine; for &lpar;const item of data&period;data&rpar; &lbrace;&NewLine; ridArray&period;push&lpar;item&period;resource&period;rid&rpar;&semi;&NewLine; resourceName&period;push&lpar;item&period;resource&period;name&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; remove «R5NMHWH» AND «RWY51ZC» from ridArray&NewLine; &sol;&sol; remove Donate RIDs «RUK2FBE»&comma; «RFCEL9J»&comma; «RMXO6VF»&comma; «RTEANTC» from ridArray&NewLine; for &lpar;let i &equals; 0&semi; i < ridArray&period;length&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; ridArray &equals; ridArray&period;filter&lpar;item &equals;> item &excl;&equals;&equals; «R5NMHWH» && item &excl;&equals;&equals; «RWY51ZC»&rpar;&semi;&NewLine; ridArray &equals; ridArray&period;filter&lpar;item &equals;> item &excl;&equals;&equals; «RUK2FBE» && item &excl;&equals;&equals; «RFCEL9J» && item &excl;&equals;&equals; «RMXO6VF» && item &excl;&equals;&equals; «RTEANTC»&rpar;&semi;&NewLine; &rcub;&NewLine; console&period;log&lpar;»ridArray after removing R5NMHWH and RWY51ZC and Donation RIDs «&comma; ridArray&rpar;&semi;&NewLine;&NewLine; &sol;&sol; remove «Registration» AND «Privacy Plus» AND if rid contains the word «Donation» from resourceName&NewLine; for &lpar;let i &equals; 0&semi; i < resourceName&period;length&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; resourceName &equals; resourceName&period;filter&lpar;item &equals;> item &excl;&equals;&equals; «Registration» && item &excl;&equals;&equals; «Privacy Plus»&NewLine; && &excl;item&period;toLowerCase&lpar;&rpar;&period;includes&lpar;»donation»&rpar;&rpar;&semi;&NewLine; &rcub;&NewLine; resourceName &equals; resourceName&period;toString&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;»resourceName after removing Registration and Privacy Plus and Donation «&comma; resourceName&rpar;&semi;&NewLine; &NewLine;&NewLine; &sol;&sol; If the ridArray still has an item – user has membership access&NewLine; if &lpar;ridArray&period;length > 0&rpar; &lbrace;&NewLine; console&period;log&lpar;»User is a member»&rpar;&semi;&NewLine; userAccessStatus &equals; «member»&semi;&NewLine; userIsMember &equals; «true»&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;log&lpar;»User has either churned or never been a member»&rpar;&NewLine; userAccessStatus &equals; «registered»&semi;&NewLine; userIsMember &equals; «false»&semi;&NewLine; &rcub;&NewLine;&NewLine; tp&period;pianoId&period;loadExtendedUser&lpar;&lbrace;&NewLine; formName&colon; ‘RegistrationFields’&comma;&NewLine; extendedUserLoaded&colon; function &lpar;data&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; console&period;log&lpar;»form data from checkoutComplete»&comma; data&rpar;&semi;&NewLine; let customFieldArray &equals; data&period;custom&lowbar;field&lowbar;values&semi;&NewLine;&NewLine; for &lpar;let item of customFieldArray&rpar; &lbrace;&NewLine; if &lpar;item&period;field&lowbar;name &equals;&equals;&equals; «marketingcoms»&rpar; &lbrace;&NewLine; marketingComsValue &equals; item&period;value&semi;&NewLine; break&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; A&period; PW create or update call&NewLine; async function pushwooshCheckoutCompleteCB&lpar;&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;STAGING&lowbar;pushwoosh&lowbar;checkoutComplete&quest;cache&equals;&dollar;&lbrace;Date&period;now&lpar;&rpar;&rcub;&grave;&comma; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace;&NewLine; ‘Content-Type’&colon; ‘application&sol;json’&NewLine; &rcub;&comma;&NewLine; credentials&colon; «omit»&comma;&NewLine; body&colon; JSON&period;stringify&lpar;&lbrace;&NewLine; userAccessStatus&colon; userAccessStatus&comma;&NewLine; userIsMember&colon; userIsMember&comma;&NewLine; userMarketingConsent&colon; marketingComsValue&comma;&NewLine; userFirstName&colon; userFirstName&comma;&NewLine; userLastName&colon; userLastName&comma;&NewLine; userId&colon; userId&comma;&NewLine; userEmail&colon; userEmail&comma;&NewLine; resourceName&colon; resourceName&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;response&period;ok&rpar; &lbrace;&NewLine; throw new Error&lpar;’checkoutComplete – pushwooshCheckoutCompleteCB request failed’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; const data &equals; await response&period;json&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;data&rpar;&semi;&NewLine; &NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub; &NewLine; pushwooshCheckoutCompleteCB&lpar;&rpar;&semi;&NewLine;&NewLine;&NewLine; &sol;&sol; B&period; Assign user to Members Only mailing list IN PIANO&NewLine; async function assignMailingList&lpar;&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;piano&lowbar;assign&lowbar;user&lowbar;mailingList&quest;cache&equals;&dollar;&lbrace;Date&period;now&lpar;&rpar;&rcub;&grave;&comma; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace;&NewLine; ‘Content-Type’&colon; ‘application&sol;json’&NewLine; &rcub;&comma;&NewLine; credentials&colon; «omit»&comma;&NewLine; body&colon; JSON&period;stringify&lpar;&lbrace;&NewLine; email&colon; userEmail&comma;&NewLine; sqids&colon; MAILING&lowbar;LISTS&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;response&period;ok&rpar; &lbrace;&NewLine; throw new Error&lpar;’piano&lowbar;assign&lowbar;user&lowbar;mailingList request failed’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; const data &equals; await response&period;json&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;data&rpar;&semi;&NewLine; &NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub; &NewLine; &sol;&sol; call ONLY if user is a member&NewLine; if &lpar;userIsMember &equals;&equals; «true»&rpar; &lbrace;&NewLine; assignMailingList&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine;&NewLine; &sol;&sol; C&period; Set Members only newsletter Tag in PW&NewLine; async function setMembersOnlyNewsletterTag&lpar;&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;STAGING&lowbar;pushwoosh&lowbar;setNewsletter&quest;cache&equals;&dollar;&lbrace;Date&period;now&lpar;&rpar;&rcub;&grave;&comma; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace;&NewLine; ‘Content-Type’&colon; ‘application&sol;json’&NewLine; &rcub;&comma;&NewLine; credentials&colon; «omit»&comma;&NewLine; body&colon; JSON&period;stringify&lpar;&lbrace;&NewLine; userEmail&colon; userEmail&comma;&NewLine; newsletter&colon; «members&lowbar;only»&NewLine; &rcub;&rpar;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;response&period;ok&rpar; &lbrace;&NewLine; throw new Error&lpar;’piano&lowbar;assign&lowbar;user&lowbar;mailingList request failed’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; const data &equals; await response&period;json&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;data&rpar;&semi;&NewLine; &NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub; &NewLine; &sol;&sol; call ONLY if user is a member&NewLine; if &lpar;userIsMember &equals;&equals; «true»&rpar; &lbrace;&NewLine; setMembersOnlyNewsletterTag&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &rcub; catch &lpar;parseError&rpar; &lbrace;&NewLine; console&period;log&lpar;parseError&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma;&NewLine; extendedUserLoadFailed&colon; function &lpar;err&rpar; &lbrace;&NewLine; console&period;log&lpar;err&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine;&rcub;&rsqb;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; initialise Piano&NewLine;tp &equals; window&period;tp &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine;&sol;&sol; Hook to execute when register was successful&NewLine;tp&period;push&lpar;&lbrack;&NewLine; ‘addHandler’&comma;&NewLine; ‘checkoutComplete’&comma;&NewLine; function &lpar;data&rpar; &lbrace;&NewLine; console&period;log&lpar;’checkoutComplete&colon; ‘&comma; data&rpar;&semi;&NewLine;&NewLine; const uid &equals; data&period;uid&semi;&NewLine; const termId &equals; data&period;termId&semi;&NewLine; const chargeAmount &equals; data&period;chargeAmount&semi;&NewLine; const termConversionId &equals; data&period;termConversionId&semi;&NewLine; const paymentId &equals; data&period;paymentId&semi;&NewLine;&NewLine; &sol;&sol; Helper Function&NewLine; const callVaultEndpoint &equals; async &lpar;uid&comma; action&comma; entity&comma; chargeAmount&comma; termConversionId&rpar; &equals;> &lbrace;&NewLine; const options &equals; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace;&NewLine; ‘Content-Type’&colon; ‘application&sol;json’&comma;&NewLine; &rcub;&comma;&NewLine; credentials&colon; ‘omit’&comma;&NewLine; body&colon; JSON&period;stringify&lpar;&lbrace;&NewLine; gbnUserId&colon; uid&comma;&NewLine; action&comma;&NewLine; entity&colon; entity&comma;&NewLine; value&colon; chargeAmount&comma;&NewLine; entityId&colon; termConversionId&comma;&NewLine; &rcub;&rpar;&comma;&NewLine; &rcub;&semi;&NewLine;&NewLine; try &lbrace;&NewLine; const request &equals; await fetch&lpar;’https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;loyaltypoints&lowbar;ingest’&comma; options&rpar;&semi;&NewLine; const response &equals; await request&period;json&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;JSON&period;stringify&lpar;response&rpar;&rpar;&semi;&NewLine; return response&semi;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;log&lpar;’loyaltypoints CB error’&comma; error&rpar;&semi;&NewLine; return error&semi;&NewLine; &rcub;&NewLine; &rcub;&semi;&NewLine;&NewLine; &sol;&sol; &lbrack;Donate&rsqb;&NewLine; const donationTerms &equals; &lbrack;&NewLine; ‘TMZVKHCK78F8’&comma;&NewLine; ‘TMVATI3WXNBD’&comma;&NewLine; ‘TMHHDSINJATO’&comma;&NewLine; ‘TMB4RK0P12MI’&comma;&NewLine; ‘TMJEJO3K37LC’&comma;&NewLine; ‘TMLA2HEB5LSJ’&comma;&NewLine; &rsqb;&semi;&NewLine; if &lpar;donationTerms&period;includes&lpar;termId&rpar;&rpar; &lbrace;&NewLine; callVaultEndpoint&lpar;uid&comma; ‘donate’&comma; ‘money’&comma; chargeAmount&comma; paymentId&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; &lbrack;Membership Terms&rsqb;&NewLine; const membershipTerms &equals; &lbrack;&NewLine; ‘TMTHQ91OZXCH’&comma;&NewLine; ‘TMC2ONGWE6AE’&comma;&NewLine; ‘TM3LE8FGH5UL’&comma;&NewLine; ‘TMEQ9N8GPZOS’&comma;&NewLine; ‘TMIY81AFCJHJ’&comma;&NewLine; ‘TMZ6PMRF2CX3’&comma;&NewLine; ‘TMLTNHI729NI’&comma;&NewLine; ‘TMKZ7EP6QFFK’&comma;&NewLine; ‘TMJ57K3C8MXX’&comma;&NewLine; ‘TMV4JAKD26MZ’&comma;&NewLine; &rsqb;&semi;&NewLine; if &lpar;membershipTerms&period;includes&lpar;termId&rpar;&rpar; &lbrace;&NewLine; callVaultEndpoint&lpar;uid&comma; ‘purchase’&comma; ‘membership’&comma; chargeAmount&comma; termConversionId&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma;&NewLine;&rsqb;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; Make tp available or use existing one if already loaded&NewLine;tp &equals; window&period;tp &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine;tp&period;push&lpar;&lbrack;’addHandler’&comma; ‘customEvent’&comma; function&lpar;e&rpar; &lbrace;&NewLine; &NewLine; &sol;&sol; 1&period; refresh page on ad-blocker Done button&NewLine; if &lpar;e&period;customEventName &equals;&equals; «offer-close-modal-done»&rpar; &lbrace;&NewLine; location&period;reload&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &NewLine; &sol;&sol; 2&period; reload page on «already has access modal» Reload button&NewLine; if &lpar;e&period;customEventName &equals;&equals; «custom-reload»&rpar; &lbrace;&NewLine; location&period;reload&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; 3&period; take the user back to Homepage on «non-personalised advertising»&NewLine; if &lpar;e&period;customEventName &equals;&equals; «return-home»&rpar; &lbrace;&NewLine; &NewLine; &sol;&sol; drop browser cookie&NewLine; const COOKIE &equals; ‘sp&lowbar;subscribed&lowbar;status’&semi;&NewLine; document&period;cookie &equals; COOKIE &plus; ‘&equals;true&semi; path&equals;&sol;&semi;’&semi;&NewLine; console&period;log&lpar;»cookie has been set»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; rejectAll&NewLine; &lpar;function&lpar;&rpar; &lbrace;&NewLine; &lowbar;&lowbar;tcfapi&lpar;’postRejectAll’&comma; 2&comma; function &lpar;postRejectAllResponse&comma; success&rpar; &lbrace;&NewLine; &sol;&sol; Custom callback code can be included here&NewLine; console&period;log&lpar;»postRejectAllResponse&colon; «&comma; postRejectAllResponse&rpar;&semi;&NewLine; console&period;log&lpar;’postRejectAllResponse was successful&colon; ‘ &plus; success&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;»rejectAll from TCF API»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; return home&NewLine; document&period;location &equals; «&sol;»&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; 4&period; abandon and take user back to Homepage on «non-personalised advertising»&NewLine; if &lpar;e&period;customEventName &equals;&equals; «abandon-purchase»&rpar; &lbrace;&NewLine; &sol;&sol; return home&NewLine; document&period;location &equals; «&sol;»&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; 5&period; navigate user to my-account&NewLine; if &lpar;e&period;customEventName &equals;&equals; «go-to-my-account»&rpar; &lbrace;&NewLine; console&period;log&lpar;»go-to-my-account custom event occured»&rpar;&semi;&NewLine; document&period;location &equals; «&sol;my-account»&semi;&NewLine; &rcub;&NewLine;&NewLine;&rcub;&rsqb;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; Make tp available or use existing one if already loaded&NewLine;tp &equals; window&period;tp &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine;tp&period;push&lpar;&lbrack;’addHandler’&comma; ‘customEvent’&comma; function&lpar;e&rpar; &lbrace;&NewLine;&NewLine; const customEventName &equals; e&quest;&period;customEventName&semi;&NewLine; if &lpar;&excl;customEventName&rpar; return&semi;&NewLine;&NewLine; &sol;&sol; Handling Non Newsletter Custom Events&NewLine; switch &lpar;customEventName&rpar; &lbrace;&NewLine; case «piano-google-follow»&colon;&NewLine; pa&period;sendEvent&lpar;»goal&period;completed»&comma; &lbrace; goal&lowbar;type&colon; customEventName &rcub;&rpar;&semi;&NewLine; console&period;log&lpar;»Google Follow Goal Set»&rpar;&semi;&NewLine; return&semi;&NewLine;&NewLine; case «ios-app-promo»&colon;&NewLine; pa&period;sendEvent&lpar;»goal&period;completed»&comma; &lbrace; goal&lowbar;type&colon; customEventName &rcub;&rpar;&semi;&NewLine; console&period;log&lpar;»Download iOS App Goal Set»&rpar;&semi;&NewLine; return&semi;&NewLine;&NewLine; case «android-app-promo»&colon;&NewLine; pa&period;sendEvent&lpar;»goal&period;completed»&comma; &lbrace; goal&lowbar;type&colon; customEventName &rcub;&rpar;&semi;&NewLine; console&period;log&lpar;»Download Android App Goal Set»&rpar;&semi;&NewLine; return&semi;&NewLine;&NewLine; case «desktop-app-promo»&colon;&NewLine; pa&period;sendEvent&lpar;»goal&period;completed»&comma; &lbrace; goal&lowbar;type&colon; customEventName &rcub;&rpar;&semi;&NewLine; console&period;log&lpar;»Download Desktop Goal Set»&rpar;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; Ensure it is a Newsletter Custom Event&colon;&NewLine; &sol;&sol; Newsletter must end with «newsletter-signup-submit»&NewLine; if &lpar;&excl;customEventName&period;endsWith&lpar;’newsletter-signup-submit’&rpar;&rpar; return&semi;&NewLine;&NewLine; &sol;&sol; Newsletter must match format&colon; «&lbrace;section&rcub;-newsletter-signup-submit»&NewLine; if &lpar;&excl;&sol;&Hat;&lbrack;a-z&rsqb;&plus;-newsletter-signup-submit&dollar;&sol;&period;test&lpar;customEventName&rpar;&rpar; return&semi;&NewLine;&NewLine; &sol;&sol; Section comes from the first part of the Custom Event&NewLine; let section &equals; customEventName&period;split&lpar;’-‘&rpar;&lbrack;0&rsqb;&semi;&NewLine; if &lpar;&excl;section&rpar; return&semi;&NewLine;&NewLine;&NewLine; &sol;&sol; 1&period; Set goal&period;completed for newsletter signup&NewLine; pa&period;sendEvent&lpar;’goal&period;completed’&comma; &lbrace; goal&lowbar;type&colon; &grave;&dollar;&lbrace;section&rcub;-newsletter-signup&grave; &rcub;&rpar;&semi;&NewLine; console&period;log&lpar;&grave;Goal set&colon; &dollar;&lbrace;section&rcub;-newsletter-signup&grave;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; 2&period; Is user logged in&quest;&NewLine; const isUserLoggedIn &equals; tp&period;pianoId&period;getUser&lpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; If YES – First assign to correct Mailing List&NewLine; const mailing&lowbar;lists &equals; &lbrace;&NewLine; royal&colon; «&lbrack;6722&rsqb;»&comma; news&colon; «&lbrack;6723&rsqb;»&comma; finance&colon; «&lbrack;6724&rsqb;»&comma;&NewLine; motoring&colon; «&lbrack;6725&rsqb;»&comma; politics&colon; «&lbrack;6726&rsqb;»&comma; celebrity&colon; «&lbrack;6728&rsqb;»&comma;&NewLine; opinion&colon; «&lbrack;6730&rsqb;»&comma; diet&colon; «&lbrack;7290&rsqb;»&comma; food&colon; «&lbrack;7291&rsqb;»&comma;&NewLine; gardening&colon; «&lbrack;7292&rsqb;»&comma; health&colon; «&lbrack;7293&rsqb;»&comma; property&colon; «&lbrack;7294&rsqb;»&comma;&NewLine; tech&colon; «&lbrack;7295&rsqb;»&comma; travel&colon; «&lbrack;7296&rsqb;»&comma; sport&colon; «&lbrack;10761&rsqb;»&NewLine; &rcub;&semi;&NewLine;&NewLine; const sqids &equals; mailing&lowbar;lists&lbrack;section&rsqb;&semi;&NewLine; let userEmail &equals; «»&semi;&NewLine; &NewLine; &sol;&sol; Logged in users – assign to mailing list&NewLine; if &lpar;isUserLoggedIn&rpar; &lbrace;&NewLine; &sol;&sol; Get user email directly from tp&NewLine; tp&period;pianoId&period;loadExtendedUser&lpar;&lbrace;&NewLine; formName&colon; »&comma;&NewLine; extendedUserLoaded&colon; function&lpar;data&rpar; &lbrace;&NewLine; userEmail &equals; data&period;email&semi;&NewLine; &NewLine; &sol;&sol; 3&period; Assign user to mailing list &lpar;logged in users ONLY&rpar;&NewLine; assignMailingList&lpar;userEmail&comma; sqids&rpar;&semi;&NewLine;&NewLine; &sol;&sol; 4&period; setNewsletter in Pushwoosh &lpar;for all users&rpar;&NewLine; setNewsletterTagInPw&lpar;userEmail&comma; section&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; Get user email from Newsletter form&NewLine; userEmail &equals; e&period;params&period;email&semi;&NewLine;&NewLine; &sol;&sol; 4&period; setNewsletter in Pushwoosh &lpar;for all users&rpar;&NewLine; setNewsletterTagInPw&lpar;userEmail&comma; section&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; &NewLine; &sol;&sol; HELPER FUNCTIONS&NewLine; &sol;&sol; Assign user to mailing list &NewLine; async function assignMailingList&lpar;userEmail&comma; sqids&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&NewLine; &grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;piano&lowbar;assign&lowbar;user&lowbar;mailingList&quest;cache&equals;&dollar;&lbrace;Date&period;now&lpar;&rpar;&rcub;&grave;&comma;&NewLine; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace; ‘Content-Type’&colon; ‘application&sol;json’ &rcub;&comma;&NewLine; credentials&colon; «omit»&comma;&NewLine; body&colon; JSON&period;stringify&lpar;&lbrace;&NewLine; email&colon; userEmail&comma;&NewLine; sqids&colon; sqids&NewLine; &rcub;&rpar;&NewLine; &rcub;&NewLine; &rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;response&period;ok&rpar; &lbrace;&NewLine; throw new Error&lpar;’piano&lowbar;assign&lowbar;user&lowbar;mailingList request failed’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; const data &equals; await response&period;json&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;»assignMailingList»&comma; data&rpar;&semi;&NewLine;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; update Newsletter tags in Pushwoosh&NewLine; async function setNewsletterTagInPw&lpar;userEmail&comma; section&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&NewLine; &grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;STAGING&lowbar;pushwoosh&lowbar;setNewsletter&quest;cache&equals;&dollar;&lbrace;Date&period;now&lpar;&rpar;&rcub;&grave;&comma;&NewLine; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace; ‘Content-Type’&colon; ‘application&sol;json’ &rcub;&comma;&NewLine; credentials&colon; «omit»&comma;&NewLine; body&colon; JSON&period;stringify&lpar;&lbrace; userEmail&comma; newsletter&colon; section &rcub;&rpar;&NewLine; &rcub;&NewLine; &rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;response&period;ok&rpar; &lbrace;&NewLine; throw new Error&lpar;’setNewsletterTagInPw request failed’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; const data &equals; await response&period;json&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;»setNewsletterTagInPw»&comma; data&rpar;&semi;&NewLine;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;error&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine;&NewLine;&rcub;&rsqb;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; window&period;REBELMOUSE&lowbar;STDLIB&period;loadExternalScript&lpar;»&sol;&sol;cdn&period;viafoura&period;net&sol;entry&sol;index&period;js»&comma; function&lpar;&rpar; &lbrace;&NewLine; &NewLine; const COMMENTS&lowbar;HEADING &equals; «Have Your Say»&semi;&NewLine;const FEATURED&lowbar;COMMENTS &equals; «Member Comments»&semi;&NewLine;const COMMENTS&lowbar;TERMS&lowbar;HTML &equals; ‘By commenting you agree to <a href&equals;»&sol;terms&sol;community-rule-book»>our community rules&period;’&semi;&NewLine;&NewLine;&sol;&sol; Viafoura&NewLine;&sol;&sol; Make vfQ available or use existing one if already loaded&NewLine;window&period;vfQ &equals; window&period;vfQ &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;window&period;vfQ&period;push&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine;&NewLine; &sol;&sol; Viafoura is loaded and window&period;vf is available&NewLine; window&period;vf&period;&dollar;subscribe&lpar;’commenting’&comma; ‘loaded’&comma; function&lpar;el&rpar; &lbrace;&NewLine; &NewLine; &sol;&sol; change «Comments» to «Have Your Say»&NewLine; var headings &equals; el&period;getElementsByClassName&lpar;»vf-comment-header&lowbar;&lowbar;heading»&rpar;&NewLine; if &lpar;headings&period;length&rpar; &lbrace;&NewLine; headings&lbrack;0&rsqb;&period;innerHTML &equals; COMMENTS&lowbar;HEADING&semi;&NewLine; &rcub;&NewLine;&NewLine; &sol;&sol; change «Featured Comments» to «Member Comments» on watch&sol;live&NewLine; if &lpar;window&period;location&period;href&period;includes&lpar;»https&colon;&sol;&sol;www&period;gbnews&period;com&sol;watch&sol;live»&rpar;&rpar; &lbrace;&NewLine; let featComments &equals; el&period;getElementsByClassName&lpar;»vf-label-text vf-nav-tab-button&lowbar;&lowbar;text»&rpar;&semi;&NewLine; if &lpar;featComments&period;length&rpar; &lbrace;&NewLine; featComments&lbrack;0&rsqb;&period;innerHTML &equals; FEATURED&lowbar;COMMENTS&semi;&NewLine; &rcub;&NewLine;&NewLine; &rcub; &NewLine; &NewLine; &sol;&sol; Add the terms&conditions to the bottom of all commenting widgets&NewLine; var forms &equals; el&period;getElementsByClassName&lpar;»vf-post-form»&rpar;&semi;&NewLine; if &lpar;forms&period;length&rpar; &lbrace;&NewLine; var form &equals; forms&lbrack;0&rsqb;&semi;&NewLine; let terms &equals; document&period;createElement&lpar;’p’&rpar;&semi;&NewLine; terms&period;classList&period;add&lpar;’gbn-terms’&rpar;&semi;&NewLine; terms&period;innerHTML &equals; COMMENTS&lowbar;TERMS&lowbar;HTML&semi;&NewLine; form&period;after&lpar;terms&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine; &NewLine; &rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; Just here to ensure that the code isn’t loaded on every page&period;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; window&period;addEventListener&lpar;’appinstalled’&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; window&period;dataLayer&period;push&lpar;&lbrace;&NewLine; ‘event’&colon; ‘pwa&lowbar;app&lowbar;install’&comma;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;addEventListener&lpar;’beforeinstallprompt’&comma; &lpar;e&rpar; &equals;> &lbrace;&NewLine; window&period;dataLayer&period;push&lpar;&lbrace;&NewLine; ‘event’&colon; ‘pwa&lowbar;app&lowbar;prompt’&comma;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; Prevent scroll position on reload&NewLine;&sol;&sol; more info – https&colon;&sol;&sol;stackoverflow&period;com&sol;questions&sol;70188241&sol;history-scrollrestoration-manual-doesnt-prevent-safari-from-restoring-scrol&NewLine;&NewLine;window&period;addEventListener&lpar;»pageshow»&comma; &lpar;e&rpar; &equals;> &lbrace;&NewLine; if &lpar;e&period;persisted&rpar; &lbrace;&NewLine; window&period;scrollTo&lpar;0&comma; 0&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;if &lpar;’scrollRestoration’ in history&rpar; &lbrace;&NewLine; history&period;scrollRestoration &equals; ‘manual’&semi;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; const supportBanner &equals; document&period;getElementById&lpar;’support-banner’&rpar;&semi;&NewLine;const fixedBanner &equals; supportBanner&period;cloneNode&lpar;true&rpar;&semi;&NewLine;&NewLine;fixedBanner&period;setAttribute&lpar;’id’&comma; ‘support-banner-fixed’&rpar;&semi;&NewLine;&NewLine;if &lpar;document&period;querySelector&lpar;’&period;main–column&comma; &period;main &period;content’&rpar;&rpar; &lbrace;&NewLine; document&period;querySelector&lpar;’&period;main–column&comma; &period;main &period;content’&rpar;&period;appendChild&lpar;fixedBanner&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;window&period;addEventListener&lpar;’scroll’&comma; showBanner&rpar;&semi;&NewLine;&NewLine;&NewLine;function showBanner&lpar;&rpar; &lbrace;&NewLine; if &lpar;supportBanner && fixedBanner&rpar; &lbrace;&NewLine; if &lpar;window&period;scrollY > supportBanner&period;offsetTop &plus; supportBanner&period;offsetHeight&rpar; &lbrace;&NewLine; if &lpar;&excl;fixedBanner&period;classList&period;contains&lpar;’show-banner’&rpar;&rpar;&NewLine; fixedBanner&period;classList&period;add&lpar;’show-banner’&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; if &lpar;fixedBanner&period;classList&period;contains&lpar;’show-banner’&rpar;&rpar;&NewLine; fixedBanner&period;classList&period;remove&lpar;’show-banner’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;showBanner&lpar;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol;set variables&NewLine;tp &equals; window&period;tp &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;let articleId &equals; window&period;dataLayer&lbrack;0&rsqb;&period;cd12&semi;&NewLine;&NewLine;const pageLink &equals; window&period;location&period;href&semi;&NewLine;&NewLine;let uid&semi;&NewLine;let getCustomFieldResp&semi;&NewLine;let idArray&semi;&NewLine;let myResp&semi;&NewLine;let newArray &equals; &lbrack;&rsqb;&semi;&NewLine;let encodedData&semi;&NewLine;const likeIcon &equals; document&period;querySelector&lpar;’&num;article-like-button’&rpar;&semi;&NewLine;const likeIconImg &equals; document&period;querySelector&lpar;’&num;article-like-button img’&rpar;&semi;&NewLine;let likedPostSections &equals; &lbrace;&rcub;&semi;&NewLine;const currentPostPrimarySection &equals; &excl;&excl;’588563272’&NewLine; &quest; JSON&period;parse&lpar;’588563272’&rpar;&NewLine; &colon; null&semi; &sol;&sol; checks the post’s primary section&NewLine;const currentPostPrimarySectionParent &equals;&NewLine; currentPostPrimarySection && JSON&period;parse&lpar;’0’&rpar;&semi; &sol;&sol;check the primary section’s parent section&NewLine;const currentPostSections &equals; &excl;&excl;currentPostPrimarySection &quest; &lbrack;currentPostPrimarySection&rsqb; &colon; null&semi;&NewLine;currentPostPrimarySectionParent && currentPostSections&period;push&lpar;currentPostPrimarySectionParent&rpar;&semi;&NewLine;&NewLine;&sol;&sol; initialise Gamification window object&NewLine;window&period;gbnCE &equals; window&period;gbnCE &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;let readEventPushed &equals; false&semi;&NewLine;&NewLine;&sol;&sol; Helper function for Likes&NewLine;const addPush &equals; &lpar;eventType&comma; contentType&rpar; &equals;> &lbrace;&NewLine; window&period;gbnCE&period;push&lpar;&lbrack;’event’&comma; eventType&comma; contentType&comma; pageLink&rsqb;&rpar;&semi;&NewLine; return&semi;&NewLine;&rcub;&semi;&NewLine;&NewLine;const removeLoop &equals; &lpar;arr&rpar; &equals;> &lbrace;&NewLine; for &lpar;let i &equals; 0&semi; i < arr&period;length&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; if &lpar;arr&lbrack;i&rsqb; &equals;&equals; articleId&rpar; &lbrace;&NewLine; arr&period;splice&lpar;arr&period;indexOf&lpar;i&rpar;&comma; 1&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&rcub;&semi;&NewLine;&NewLine;async function getCustomField&lpar;id&rpar; &lbrace;&NewLine; if &lpar;&excl;id&rpar; return null&semi;&NewLine;&NewLine; return new Promise&lpar;&lpar;resolve&rpar; &equals;> &lbrace;&NewLine; tp&period;push&lpar;&lbrack;&NewLine; ‘init’&comma;&NewLine; function &lpar;&rpar; &lbrace;&NewLine; tp&period;pianoId&period;loadExtendedUser&lpar;&lbrace;&NewLine; formName&colon; ‘hyperpersonalisation&lowbar;fields’&comma;&NewLine; extendedUserLoaded&colon; function &lpar;data&rpar; &lbrace;&NewLine; const resp &equals; data&period;custom&lowbar;field&lowbar;values &vert;&vert; &lbrack;&rsqb;&semi;&NewLine; let existingLikedArticles &equals; &lbrack;&rsqb;&semi;&NewLine;&NewLine; for &lpar;const item of resp&rpar; &lbrace;&NewLine; if &lpar;item&period;field&lowbar;name &equals;&equals;&equals; ‘Liked&lowbar;Posts’&rpar; &lbrace;&NewLine; existingLikedArticles &equals; item&period;value &quest; JSON&period;parse&lpar;item&period;value&rpar; &colon; &lbrack;&rsqb;&semi;&NewLine; &rcub;&NewLine;&NewLine; if &lpar;item&period;field&lowbar;name &equals;&equals;&equals; ‘Liked&lowbar;Posts&lowbar;Topics’&rpar; &lbrace;&NewLine; likedPostSections &equals; item&period;value &quest; JSON&period;parse&lpar;item&period;value&rpar; &colon; &lbrace;&rcub;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; console&period;log&lpar;’existingLikedArticles’&comma; existingLikedArticles&rpar;&semi;&NewLine; console&period;log&lpar;’existingLikedPostSections’&comma; likedPostSections&rpar;&semi;&NewLine; resolve&lpar;existingLikedArticles&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; &rsqb;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;const updateLikedTopics &equals; &lpar;isLiked &equals; true&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; FIX&colon; if the object is empty it will show an ampty object and never return null&NewLine; if &lpar;&excl;likedPostSections &vert;&vert; typeof likedPostSections &excl;&equals;&equals; ‘object’&rpar; &lbrace;&NewLine; likedPostSections &equals; &lbrace;&rcub;&semi;&NewLine; &rcub;&NewLine;&NewLine; console&period;log&lpar;’ updateLikedTopics called&colon;’&comma; &lbrace;&NewLine; isLiked&comma;&NewLine; currentPostSections&comma;&NewLine; likedPostSections&colon; JSON&period;stringify&lpar;likedPostSections&rpar;&comma;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;currentPostSections&rpar; return &lbrace;&rcub;&semi;&NewLine;&NewLine; const sectionsToExclude &equals; &lpar;localStorage&period;all&lowbar;sections && JSON&period;parse&lpar;localStorage&period;all&lowbar;sections&rpar;&period;privateSections&rpar; &vert;&vert; &lbrace;&NewLine; 0&colon; ‘home’&comma;&NewLine; &rcub;&semi;&NewLine;&NewLine; currentPostSections&period;forEach&lpar;&lpar;id&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; change from &period;map &lpar;because map created a new array&rpar; to &period;forEach&NewLine; console&period;log&lpar;’Processing section&colon;’&comma; id&comma; ‘current value&colon;’&comma; likedPostSections&lbrack;id&rsqb;&rpar;&semi;&NewLine;&NewLine; if &lpar;sectionsToExclude&lbrack;id&rsqb;&rpar; &lbrace;&NewLine; console&period;log&lpar;’Excluding section&colon;’&comma; id&rpar;&semi;&NewLine; delete likedPostSections&lbrack;id&rsqb;&semi;&NewLine; return&semi;&NewLine; &rcub;&NewLine;&NewLine; const scoreToBeAdded &equals; id &equals;&equals;&equals; currentPostPrimarySection &quest; 2 &colon; 1&semi;&NewLine; const currentScore &equals; likedPostSections&lbrack;id&rsqb; &vert;&vert; 0&semi;&NewLine; likedPostSections&lbrack;id&rsqb; &equals; isLiked &quest; currentScore &plus; scoreToBeAdded &colon; Math&period;max&lpar;0&comma; currentScore – scoreToBeAdded&rpar;&semi;&NewLine;&NewLine; console&period;log&lpar;’Updated section&colon;’&comma; id&comma; ‘new value&colon;’&comma; likedPostSections&lbrack;id&rsqb;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; delete sections that have Zero or negative likes&NewLine; for &lpar;const key in likedPostSections&rpar; &lbrace;&NewLine; if &lpar;likedPostSections&lbrack;key&rsqb; <&equals; 0&rpar; &lbrace;&NewLine; delete likedPostSections&lbrack;key&rsqb;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; const dataToSave &equals; &lbrace; Liked&lowbar;Posts&lowbar;Topics&colon; JSON&period;stringify&lpar;likedPostSections&rpar; &rcub;&semi;&NewLine; console&period;log&lpar;’ Data to save&colon;’&comma; dataToSave&rpar;&semi;&NewLine; return dataToSave&semi;&NewLine;&rcub;&semi;&NewLine;&NewLine;const checkLikes &equals; &lpar;resp&rpar; &equals;> &lbrace;&NewLine; let liked &equals; false&semi;&NewLine; try &lbrace;&NewLine; if &lpar;resp &excl;&equals; undefined&rpar; &lbrace;&NewLine; if &lpar;typeof resp &equals;&equals; ‘string’&rpar; &lbrace;&NewLine; resp &equals; resp&period;split&lpar;’&comma;’&rpar;&semi;&NewLine; if &lpar;&excl;resp&period;includes&lpar;articleId&rpar;&rpar; &lbrace;&NewLine; liked &equals; false&semi;&NewLine; &rcub;&NewLine;&NewLine; resp &equals; &lbrack;&period;&period;&period;new Set&lpar;resp&rpar;&rsqb;&semi;&NewLine; &rcub;&NewLine; let tempArr &equals; resp&semi;&NewLine; for &lpar;let i &equals; 0&semi; i < tempArr&period;length&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; if &lpar;tempArr&lbrack;i&rsqb; &equals;&equals; articleId&rpar; &lbrace;&NewLine; liked &equals; true&semi;&NewLine; return liked&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;log&lpar;’error&colon; ‘&comma; error&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; return liked&semi;&NewLine;&rcub;&semi;&NewLine;&NewLine;async function updateCustomFieldThankYou&lpar;userUID&comma; cleanData&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&NewLine; &grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;piano&lowbar;update&lowbar;follow&lowbar;topics&lowbar;cf&quest;cache&equals;&dollar;&lbrace;Date&period;now&lpar;&rpar;&rcub;&grave;&comma;&NewLine; &lbrace;&NewLine; method&colon; ‘POST’&comma;&NewLine; headers&colon; &lbrace;&NewLine; ‘Content-Type’&colon; ‘application&sol;json’&comma;&NewLine; &rcub;&comma;&NewLine; credentials&colon; ‘omit’&comma;&NewLine; body&colon; JSON&period;stringify&lpar;&lbrace;&NewLine; uid&colon; userUID&comma;&NewLine; custom&lowbar;fields&colon; cleanData&comma;&NewLine; &rcub;&rpar;&comma;&NewLine; &rcub;&comma;&NewLine; &rpar;&semi;&NewLine;&NewLine; if &lpar;&excl;response&period;ok&rpar; &lbrace;&NewLine; const errorData &equals; await response&period;text&lpar;&rpar;&semi;&NewLine; console&period;log&lpar;’error’&comma; errorData&rpar;&semi;&NewLine; throw new Error&lpar;’updateCustomFieldThankYou request failed’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub; catch &lpar;error&rpar; &lbrace;&NewLine; console&period;error&lpar;error&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;const encodeCustomField &equals; &lpar;respArray&comma; isLiked &equals; true&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; ensure array is stringified&NewLine; encodedData &equals; &lbrace; Liked&lowbar;Posts&colon; JSON&period;stringify&lpar;respArray&rpar;&comma; &period;&period;&period;updateLikedTopics&lpar;isLiked&rpar; &rcub;&semi;&NewLine; return encodeURIComponent&lpar;JSON&period;stringify&lpar;encodedData&rpar;&rpar;&semi;&NewLine;&rcub;&semi;&NewLine;&NewLine;tp&period;push&lpar;&lbrack;&NewLine; ‘init’&comma;&NewLine; function &lpar;&rpar; &lbrace;&NewLine; &lpar;async function &lpar;&rpar; &lbrace;&NewLine; if &lpar;tp&period;pianoId&period;isUserValid&lpar;&rpar;&rpar; &lbrace;&NewLine; uid &equals; tp&period;pianoId&period;getUser&lpar;&rpar;&period;uid&semi;&NewLine; getCustomFieldResp &equals; await getCustomField&lpar;uid&rpar;&semi;&NewLine; likeIconImg&period;setAttribute&lpar;’src’&comma; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61112480&sol;origin&period;png’&rpar;&semi;&NewLine;&NewLine; if &lpar;checkLikes&lpar;getCustomFieldResp&rpar;&rpar; &lbrace;&NewLine; likeIconImg&period;setAttribute&lpar;’src’&comma; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61112481&sol;origin&period;png’&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; likeIconImg&period;setAttribute&lpar;’src’&comma; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61112480&sol;origin&period;png’&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; let articleRm &equals; false&semi;&NewLine;&NewLine; const cleanArr &equals; &lpar;arr&rpar; &equals;> &lbrace;&NewLine; for &lpar;let i &equals; 0&semi; i < arr&period;length&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; if &lpar;articleId &equals;&equals; arr&lbrack;i&rsqb;&rpar; &lbrace;&NewLine; arr&period;splice&lpar;arr&period;indexOf&lpar;i&rpar;&comma; 1&rpar;&semi;&NewLine; articleRm &equals; true&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&semi;&NewLine;&NewLine; likeIcon&period;addEventListener&lpar;’click’&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; handle logged out user&NewLine; if &lpar;&excl;tp&period;pianoId&period;isUserValid&lpar;&rpar;&rpar; &lbrace;&NewLine; tp&period;pianoId&period;show&lpar;&lbrace;&NewLine; screen&colon; ‘login’&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; if resp is an array&NewLine; if &lpar;Array&period;isArray&lpar;getCustomFieldResp&rpar;&rpar; &lbrace;&NewLine; getCustomFieldResp &equals; &lbrack;&period;&period;&period;new Set&lpar;getCustomFieldResp&rpar;&rsqb;&semi;&NewLine;&NewLine; &sol;&sol; remove article ID from custom fields&NewLine; cleanArr&lpar;getCustomFieldResp&rpar;&semi;&NewLine;&NewLine; &sol;&sol; update custom field in piano and update like icon img&NewLine; if &lpar;articleRm&rpar; &lbrace;&NewLine; console&period;log&lpar;’This post was disliked ‘&comma; getCustomFieldResp&rpar;&semi;&NewLine; updateCustomFieldThankYou&lpar;uid&comma; encodeCustomField&lpar;getCustomFieldResp&comma; false&rpar;&rpar;&semi;&NewLine; likeIconImg&period;setAttribute&lpar;’src’&comma; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61112480&sol;origin&period;png’&rpar;&semi;&NewLine; articleRm &equals; false&semi;&NewLine;&NewLine; &sol;&sol; Push Dislike to Gamification&NewLine; addPush&lpar;’dislike’&comma; ‘article’&rpar;&semi;&NewLine; console&period;log&lpar;’gbnCE push’&comma; window&period;gbnCE&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;log&lpar;’This post was liked ‘&comma; getCustomFieldResp&rpar;&semi;&NewLine; getCustomFieldResp&period;push&lpar;articleId&rpar;&semi;&NewLine; updateCustomFieldThankYou&lpar;uid&comma; encodeCustomField&lpar;getCustomFieldResp&comma; true&rpar;&rpar;&semi;&NewLine; likeIconImg&period;setAttribute&lpar;’src’&comma; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61112481&sol;origin&period;png’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Push Like to Gamification&NewLine; addPush&lpar;’like’&comma; ‘article’&rpar;&semi;&NewLine; console&period;log&lpar;’gbnCE push’&comma; window&period;gbnCE&rpar;&semi;&NewLine; &rcub;&NewLine; &sol;&sol; if resp is string or undefined&NewLine; &rcub; else if &lpar;typeof getCustomFieldResp &equals;&equals; ‘string’&rpar; &lbrace;&NewLine; getCustomFieldResp &equals; getCustomFieldResp&period;split&lpar;’&comma;’&rpar;&semi;&NewLine; getCustomFieldResp &equals; &lbrack;&period;&period;&period;new Set&lpar;getCustomFieldResp&rpar;&rsqb;&semi;&NewLine;&NewLine; for &lpar;let i &equals; 0&semi; i < getCustomFieldResp&period;length&semi; i&plus;&plus;&rpar; &lbrace;&NewLine; if &lpar;articleId &equals;&equals; getCustomFieldResp&lbrack;i&rsqb;&rpar; &lbrace;&NewLine; getCustomFieldResp&period;splice&lpar;getCustomFieldResp&period;indexOf&lpar;i&rpar;&comma; 1&rpar;&semi;&NewLine; articleRm &equals; true&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; cleanArr&lpar;getCustomFieldResp&rpar;&semi;&NewLine;&NewLine; if &lpar;articleRm&rpar; &lbrace;&NewLine; console&period;log&lpar;’This post was disliked 2’&comma; currentPostSections&rpar;&semi;&NewLine; updateCustomFieldThankYou&lpar;uid&comma; encodeCustomField&lpar;getCustomFieldResp&comma; false&rpar;&rpar;&semi;&NewLine; likeIconImg&period;setAttribute&lpar;’src’&comma; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61112480&sol;origin&period;png’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Push Dislike to Gamification&NewLine; addPush&lpar;’dislike’&comma; ‘article’&rpar;&semi;&NewLine; console&period;log&lpar;’gbnCE push’&comma; window&period;gbnCE&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; console&period;log&lpar;’This post was liked 2’&comma; currentPostSections&rpar;&semi;&NewLine; getCustomFieldResp&period;push&lpar;articleId&rpar;&semi;&NewLine; updateCustomFieldThankYou&lpar;uid&comma; encodeCustomField&lpar;getCustomFieldResp&comma; true&rpar;&rpar;&semi;&NewLine; likeIconImg&period;setAttribute&lpar;’src’&comma; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61112481&sol;origin&period;png’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Push Like to Gamification&NewLine; addPush&lpar;’like’&comma; ‘article’&rpar;&semi;&NewLine; console&period;log&lpar;’gbnCE push’&comma; window&period;gbnCE&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub; else &lbrace;&NewLine; getCustomFieldResp &equals; &lbrack;&rsqb;&semi;&NewLine; getCustomFieldResp&period;push&lpar;articleId&rpar;&semi;&NewLine; updateCustomFieldThankYou&lpar;uid&comma; encodeCustomField&lpar;getCustomFieldResp&comma; true&rpar;&rpar;&semi;&NewLine; likeIconImg&period;setAttribute&lpar;’src’&comma; ‘https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;61112481&sol;origin&period;png’&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Push Like to Gamification&NewLine; addPush&lpar;’like’&comma; ‘article’&rpar;&semi;&NewLine; console&period;log&lpar;’gbnCE push’&comma; window&period;gbnCE&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; likeIcon&period;addEventListener&lpar;’click’&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; tp&period;pianoId&period;show&lpar;&lbrace;&NewLine; screen&colon; ‘login’&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&lpar;&rpar;&semi;&NewLine; &rcub;&comma;&NewLine;&rsqb;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; &sol;&sol; initialise Gamification window object&NewLine;&sol;&sol; window&period;gbnCE &equals; window&period;gbnCE &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&sol;&sol; let readEventPushed &equals; false&semi;&NewLine;&NewLine;&sol;&sol; const article &equals; document&period;querySelector&lpar;’article&lbrack;elid&rsqb;’&rpar;&semi;&NewLine;&sol;&sol; const articleId &equals; article &quest; article&period;getAttribute&lpar;’elid’&rpar; &colon; null&semi;&NewLine;&NewLine;&sol;&sol; window&period;addEventListener&lpar;’scroll’&comma; &lpar;e&rpar; &equals;> &lbrace;&NewLine;&sol;&sol; if &lpar;&excl;readEventPushed&rpar; &lbrace;&NewLine;&sol;&sol; const scrollTop &equals; window&period;pageYOffset &vert;&vert; document&period;documentElement&period;scrollTop&semi;&NewLine;&sol;&sol; const windowHeight &equals; window&period;innerHeight&semi;&NewLine;&sol;&sol; const docHeight &equals; document&period;documentElement&period;scrollHeight&semi;&NewLine;&sol;&sol; const scrollPercent &equals; &lpar;scrollTop &sol; &lpar;docHeight – windowHeight&rpar;&rpar; &ast; 100&semi;&NewLine;&NewLine;&sol;&sol; if &lpar;scrollPercent >&equals; 50&rpar; &lbrace;&NewLine;&sol;&sol; window&period;gbnCE&period;push&lpar;&lbrack;’event’&comma; ‘read’&comma; ‘article’&comma; articleId&rsqb;&rpar;&semi;&NewLine;&sol;&sol; console&period;log&lpar;’gbnCE push’&comma; window&period;gbnCE&rpar;&semi;&NewLine;&sol;&sol; readEventPushed &equals; true&semi;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&NewLine;&sol;&sol; &rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; initialise Gamification window object&NewLine;window&period;gbnCE &equals; window&period;gbnCE &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;let readEventPushed &equals; false&semi;&NewLine;&NewLine;&sol;&sol; const article &equals; document&period;querySelector&lpar;’article&lbrack;elid&rsqb;’&rpar;&semi;&NewLine;&sol;&sol; const articleId &equals; article &quest; article&period;getAttribute&lpar;’elid’&rpar; &colon; null&semi;&NewLine;&NewLine;const pageLink &equals; window&period;location&period;href&semi;&NewLine;&NewLine;const targetEl &equals; document&period;querySelector&lpar;’&period;posts-custom &period;all-related-sections’&rpar;&semi;&NewLine;&NewLine;if &lpar;targetEl&rpar; &lbrace;&NewLine; const observer &equals; new IntersectionObserver&lpar;&NewLine; &lpar;entries&rpar; &equals;> &lbrace;&NewLine; entries&period;forEach&lpar;&lpar;entry&rpar; &equals;> &lbrace;&NewLine; if &lpar;entry&period;isIntersecting && &excl;readEventPushed&rpar; &lbrace;&NewLine; window&period;gbnCE&period;push&lpar;&lbrack;’event’&comma; ‘read’&comma; ‘article’&comma; pageLink&rsqb;&rpar;&semi;&NewLine; console&period;log&lpar;’gbnCE push’&comma; window&period;gbnCE&rpar;&semi;&NewLine;&NewLine; readEventPushed &equals; true&semi;&NewLine; observer&period;disconnect&lpar;&rpar;&semi; &sol;&sol; stop observing after first trigger&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine; &rcub;&comma;&NewLine; &lbrace;&NewLine; threshold&colon; 0&period;1&comma; &sol;&sol; trigger when ~10&percnt; of the element is visible&NewLine; &rcub;&comma;&NewLine; &rpar;&semi;&NewLine;&NewLine; observer&period;observe&lpar;targetEl&rpar;&semi;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; function createAndInsertCommentsIcon&lpar;num&rpar; &lbrace;&NewLine;&NewLine; const social&lowbar;wrappers &equals; document&period;querySelectorAll&lpar;»&period;shares-container»&rpar;&semi;&NewLine; const social&lowbar;wrapper &equals; social&lowbar;wrappers&lbrack;num&rsqb;&semi;&NewLine;&NewLine; if &lpar;document&period;querySelector&lpar;»&period;commentIcon»&rpar;&rpar; &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;»YOU HAVE YOUR COMMENTS ICON SLOT»&rpar;&NewLine; let commentIcon &equals; document&period;querySelector&lpar;»&period;commentIcon»&rpar;&semi;&NewLine; commentIcon&period;id &equals; «commentIcon-» &plus; num&semi;&NewLine;&NewLine; &sol;&sol; Creating comment count span element&NewLine; &sol;&sol; console&period;log&lpar;»first span element»&rpar;&NewLine; let spanElement &equals; document&period;createElement&lpar;»span»&rpar;&semi;&NewLine; spanElement&period;id &equals; «comment-count-» &plus; num&semi;&NewLine; commentIcon&period;appendChild&lpar;spanElement&rpar;&semi;&NewLine; &sol;&sol; console&period;log&lpar;»span el added»&rpar;&NewLine;&NewLine; &sol;&sol; Create «Comment» span&NewLine; let commentSpan &equals; document&period;createElement&lpar;»span»&rpar;&semi;&NewLine; commentSpan&period;id &equals; «comment-span-» &plus; num&semi;&NewLine; commentSpan&period;innerText &equals; «Comment»&semi;&NewLine; commentIcon&period;appendChild&lpar;commentSpan&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Create «Comments» &lpar;with an S&rpar; span&NewLine; let commentsSpan &equals; document&period;createElement&lpar;»span»&rpar;&semi;&NewLine; commentsSpan&period;id &equals; «comments-span-» &plus; num&semi;&NewLine; commentsSpan&period;innerText &equals; «Comments»&semi;&NewLine; commentIcon&period;appendChild&lpar;commentsSpan&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Appending commentIcon button to social&lowbar;wrapper&NewLine; &sol;&sol; console&period;log&lpar;»social wrapper»&comma; social&lowbar;wrapper&rpar;&semi;&NewLine; &sol;&sol; console&period;log&lpar;»commentIcon»&comma; commentIcon&rpar;&semi;&NewLine; social&lowbar;wrapper&period;appendChild&lpar;commentIcon&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;»YOU DO NOT HAVE YOUR COMMENT SSLOT»&rpar;&NewLine; &rcub;&NewLine;&NewLine;&NewLine;&rcub;&NewLine;&NewLine;createAndInsertCommentsIcon&lpar;0&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; let commentsWidget &equals; document&period;getElementById&lpar;’comments’&rpar;&semi;&NewLine;let scrollToCommentsIcon &equals; document&period;querySelectorAll&lpar;»&period;commentIcon»&rpar;&semi;&NewLine;let youMayLike &equals; document&period;querySelector&lpar;»&period;you-may-like&lowbar;&lowbar;wrapper»&rpar;&semi;&NewLine;&NewLine;let firstClick &equals; true&semi; &sol;&sol; flag to track first click&NewLine;&NewLine;function scrollToElementWithOffset&lpar;element&comma; offset &equals; 0&comma; duration &equals; 800&rpar; &lbrace;&NewLine; let start &equals; window&period;scrollY&semi;&NewLine; let end &equals; element&period;getBoundingClientRect&lpar;&rpar;&period;top &plus; start – offset&semi;&NewLine; let distance &equals; end – start&semi;&NewLine; let startTime &equals; performance&period;now&lpar;&rpar;&semi;&NewLine;&NewLine; function animateScroll&lpar;currentTime&rpar; &lbrace;&NewLine; let elapsed &equals; currentTime – startTime&semi;&NewLine; let progress &equals; Math&period;min&lpar;elapsed &sol; duration&comma; 1&rpar;&semi;&NewLine; window&period;scrollTo&lpar;0&comma; start &plus; distance &ast; progress&rpar;&semi;&NewLine; if &lpar;progress < 1&rpar; requestAnimationFrame&lpar;animateScroll&rpar;&semi;&NewLine; &rcub;&NewLine;&NewLine; requestAnimationFrame&lpar;animateScroll&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;scrollToCommentsIcon&period;forEach&lpar;icon &equals;> &lbrace;&NewLine; icon&period;addEventListener&lpar;’click’&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; if &lpar;firstClick && youMayLike&rpar; &lbrace;&NewLine; &sol;&sol; First click and «You may like» exists&NewLine; youMayLike&period;scrollIntoView&lpar;&lbrace; behavior&colon; ‘smooth’ &rcub;&rpar;&semi;&NewLine;&NewLine; setTimeout&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; scrollToElementWithOffset&lpar;commentsWidget&comma; 50&comma; 300&rpar;&semi;&NewLine; &rcub;&comma; 4000&rpar;&semi;&NewLine;&NewLine; firstClick &equals; false&semi; &sol;&sol; subsequent clicks skip «You may like»&NewLine; &rcub; else &lbrace;&NewLine; &sol;&sol; Directly scroll to comments with offset&NewLine; scrollToElementWithOffset&lpar;commentsWidget&comma; 50&comma; 300&rpar;&semi;&NewLine; firstClick &equals; false&semi; &sol;&sol; ensure firstClick is false even if youMayLike doesn’t exist&NewLine; &rcub;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; function getCommentCount &lpar;value&rpar; &lbrace;&NewLine; const roundedTime &equals; 1721838910000&semi;&NewLine; &NewLine; fetch&lpar;&grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;new&lowbar;comment&lowbar;count&lowbar;PROD&quest;name&equals;&dollar;&lbrace;value&rcub;&cache&equals;&dollar;&lbrace;roundedTime&rcub;&grave;&comma; &lbrace;&NewLine; method&colon; ‘GET’&comma;&NewLine; credentials&colon; «omit»&NewLine; &rcub;&rpar;&NewLine;&NewLine; &period;then&lpar;response &equals;> &lbrace;&NewLine; if&lpar;response&period;ok&rpar; &lbrace;&NewLine; return response&period;json&lpar;&rpar;&semi;&NewLine; &rcub; else &lbrace;&NewLine; throw new Error&lpar;’API request failed’&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&rpar;&NewLine; &period;then&lpar;data &equals;> &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;&grave;comment count is &dollar;&lbrace;data&rcub;&grave;&rpar;&semi; &sol;&sol; data is a number&NewLine;&NewLine; const isMobile &equals; window&period;innerWidth <&equals; 768&semi;&NewLine;&NewLine; &sol;&sol; TOP OF THE PAGE&NewLine; let commentsDesktop &equals; document&period;getElementById&lpar;»comment-count-0″&rpar;&semi;&NewLine; let commentSpanDesktop &equals; document&period;getElementById&lpar;»comment-span-0″&rpar;&semi;&NewLine; let commentsSpanDesktop &equals; document&period;getElementById&lpar;»comments-span-0″&rpar;&semi;&NewLine; let nowDesktop &equals; document&period;getElementById&lpar;»now-0″&rpar;&semi;&NewLine;&NewLine; console&period;log&lpar;»your data «&comma; data&rpar;&NewLine; if &lpar;data &equals;&equals; 0&rpar; &lbrace;&NewLine; &sol;&sol; display «Comment» and «Now&excl;» and hide «Comments»&NewLine; if &lpar;isMobile&rpar; &lbrace;&NewLine; commentSpanDesktop&period;style&period;display &equals; «none»&semi;&NewLine; commentsSpanDesktop&period;style&period;display &equals; «none»&semi;&NewLine; &rcub; else &lbrace;&NewLine; commentSpanDesktop&period;style&period;display &equals; «block»&semi;&NewLine; commentsSpanDesktop&period;style&period;display &equals; «none»&semi;&NewLine; &rcub;&NewLine;&NewLine; nowDesktop&period;style&period;display &equals; «block»&semi;&NewLine; commentsSpanDesktop&period;style&period;display &equals; «none»&semi;&NewLine;&NewLine; commentSpanDesktopBottom&period;style&period;display &equals; «block»&semi;&NewLine; nowDesktopBottom&period;style&period;display &equals; «block»&semi;&NewLine; commentsSpanDesktopBottom&period;style&period;display &equals; «none»&semi;&NewLine; &rcub;&NewLine;&NewLine; if &lpar;data &equals;&equals; 1&rpar; &lbrace;&NewLine; &sol;&sol; display «Count» and «Comment» and hide «Comments»&NewLine; commentsDesktop&period;style&period;display &equals; «block»&semi;&NewLine; commentSpanDesktop&period;style&period;display &equals; «block»&semi;&NewLine; commentsSpanDesktop&period;style&period;display &equals; «none»&semi;&NewLine; &rcub;&NewLine;&NewLine; if &lpar;data > 1&rpar; &lbrace;&NewLine; &sol;&sol; display «count» and «Comments»&NewLine; commentsDesktop&period;style&period;display &equals; «block»&semi;&NewLine; commentSpanDesktop&period;style&period;display &equals; «none»&semi;&NewLine; &rcub;&NewLine;&NewLine; if &lpar;data >&equals; 1 && data < 100&rpar; &lbrace;&NewLine; commentsDesktop&period;style&period;padding &equals; «0 0 0 0px»&semi;&NewLine; &rcub;&NewLine; if &lpar;data >&equals; 100 && data < 1000&rpar; &lbrace;&NewLine; commentsDesktop&period;style&period;padding &equals; «0 0 0 0px»&semi;&NewLine; &rcub;&NewLine;&NewLine; if &lpar;data >&equals; 1000&rpar; &lbrace;&NewLine; &sol;&sol; Round count to the nearest 100&NewLine; data &equals; Math&period;round&lpar;data &sol; 100&rpar; &ast; 100&semi;&NewLine; data &equals; &lpar;data &sol; 1000&rpar;&period;toFixed&lpar;1&rpar; &plus; «K»&semi;&NewLine; &rcub; &NewLine; &NewLine; &sol;&sol; update the icon’s with the above&NewLine; if &lpar;commentsDesktop&rpar; &lbrace;&NewLine; commentsDesktop&period;innerHTML &equals; data&semi;&NewLine; commentsDesktop&period;textContent &equals; data&semi;&NewLine; commentsDesktop&period;value &equals; data&semi;&NewLine; &rcub;&NewLine; &NewLine; &rcub;&rpar;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; look up Meta element for the container&lowbar;id&NewLine;const metaElement &equals; document&period;querySelector&lpar;’meta&lbrack;name&equals;»vf&colon;container&lowbar;id»&rsqb;’&rpar;&semi;&NewLine;if &lpar;metaElement&rpar; &lbrace;&NewLine; const contentValue &equals; metaElement&period;getAttribute&lpar;’content’&rpar;&semi;&NewLine; &sol;&sol; call comment&lowbar;count API&NewLine; getCommentCount&lpar;contentValue&rpar;&semi;&NewLine; &sol;&sol; console&period;log&lpar;getCommentCount&rpar;&semi;&NewLine;&rcub; else &lbrace;&NewLine; &sol;&sol; console&period;log&lpar;’Meta element not found’&rpar;&semi;&NewLine;&rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; var embedScript &equals; document&period;createElement&lpar;’script’&rpar;&semi;&NewLine;embedScript&period;src &equals; ‘https&colon;&sol;&sol;widgets&period;opinary&period;com&sol;embed&period;js’&semi;&NewLine;if &lpar;embedScript&rpar; &lbrace;&NewLine; embedScript&period;onerror &equals; &lpar;&rpar; &equals;> &lbrace;&NewLine; const w &equals; document&period;querySelector&lpar;’&period;opinary-widget-embed’&rpar;&semi;&NewLine; if &lpar;&excl;w&rpar; &lbrace;&NewLine; return&NewLine; &rcub;&NewLine; const link &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine; link&period;id &equals; «opinary-link-container»&semi;&NewLine; link&period;classList&period;add&lpar;»opinary-link-container»&rpar;&semi;&NewLine; link&period;innerHTML &equals; &grave;<img class&equals;»opinary-icon» src&equals;»https&colon;&sol;&sol;assets&period;rbl&period;ms&sol;55730280&sol;origin&period;png» alt&equals;»opinary link icon»><a class&equals;»opinary-link-text» target&equals;»&lowbar;blank» href&equals;»https&colon;&sol;&sol;compass&period;opinary&period;com&sol;compasses&sol;&dollar;&lbrace;w&period;dataset&period;customer&rcub;&sol;&dollar;&lbrace;w&period;dataset&period;poll&rcub;&quest;adblocker&equals;true»>It looks like your browser is blocking the Poll&colon; <u>Please open here instead&grave;&semi;&NewLine; w&period;parentNode&period;replaceChild&lpar;link&comma; w&rpar;&semi;&NewLine; &rcub;&semi;&NewLine;&rcub;&NewLine;document&period;head&period;appendChild&lpar;embedScript&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; &sol;&sol; const captions &equals; document&period;querySelectorAll&lpar;»&period;image-media&period;media-caption»&rpar;&semi;&NewLine;&sol;&sol; const credits &equals; document&period;querySelectorAll&lpar;»&period;image-media&period;media-photo-credit»&rpar;&semi;&NewLine;&NewLine;&NewLine;&NewLine;&sol;&sol; captions&period;forEach&lpar;&lpar;caption&rpar; &equals;> &lbrace;&NewLine;&sol;&sol; const captionsWrapper &equals; document&period;createElement&lpar;»div»&rpar;&semi;&NewLine;&sol;&sol; captionsWrapper&period;classList&period;add&lpar;»captions-wrapper»&rpar;&semi;&NewLine;&sol;&sol; captionsWrapper&period;appendChild&lpar;caption&rpar;&semi;&NewLine;&sol;&sol; caption&period;parentElement&period;prepend&lpar;captionsWrapper&rpar;&semi;&NewLine;&sol;&sol; caption&period;remove&lpar;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&NewLine;&NewLine;&NewLine;&NewLine;&sol;&sol; if &lpar;document&period;querySelector&lpar;»&period;captions-wrapper»&rpar;&rpar; &lbrace;&NewLine;&sol;&sol; captionsWrappers &equals; document&period;querySelectorAll&lpar;»&period;captions-wrapper»&rpar;&semi;&NewLine;&sol;&sol; credits&period;forEach&lpar;&lpar;credit&comma; i&rpar; &equals;> &lbrace;&NewLine;&sol;&sol; captionsWrappers&lbrack;i&rsqb;&period;appendChild&lpar;credit&rpar;&semi;&NewLine;&sol;&sol; credit&period;remove&lpar;&rpar;&semi;&NewLine;&sol;&sol; &rcub;&rpar;&NewLine;&sol;&sol; &rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; const tabs &equals; document&period;querySelectorAll&lpar;’&period;tab’&rpar;&semi;&NewLine; const contents &equals; document&period;querySelectorAll&lpar;’&period;tab-content’&rpar;&semi;&NewLine;&NewLine; tabs&period;forEach&lpar;tab &equals;> &lbrace;&NewLine; tab&period;addEventListener&lpar;’click’&comma; &lpar;&rpar; &equals;> &lbrace;&NewLine; &sol;&sol; Remove active class from all tabs and contents&NewLine; tabs&period;forEach&lpar;t &equals;> t&period;classList&period;remove&lpar;’active’&rpar;&rpar;&semi;&NewLine; contents&period;forEach&lpar;c &equals;> c&period;classList&period;remove&lpar;’active’&rpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Add active to current tab and related content&NewLine; tab&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; document&period;getElementById&lpar;tab&period;dataset&period;tab&rpar;&period;classList&period;add&lpar;’active’&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; async function loadTrendingMostRead&lpar;&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&NewLine; &grave;&sol;res&sol;custom&lowbar;page&sol;data&period;js&quest;resource&lowbar;id&equals;generic&layout&lowbar;name&equals;MostRead&grave;&NewLine; &rpar;&semi;&NewLine; const posts &equals; await response&period;json&lpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Parse the HTML string&NewLine; const parser &equals; new DOMParser&lpar;&rpar;&semi;&NewLine; const doc &equals; parser&period;parseFromString&lpar;posts&period;html&comma; «text&sol;html»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Select all headline <a> elements&NewLine; const headlineElements &equals; doc&period;querySelectorAll&lpar;»&period;widget&lowbar;&lowbar;headline-text»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Select or create a container in your HTML to append these&NewLine; const container &equals; document&period;getElementById&lpar;»stories»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Loop and create <p> with number and link&NewLine; Array&period;from&lpar;headlineElements&rpar;&period;forEach&lpar;&lpar;el&comma; index&rpar; &equals;> &lbrace;&NewLine; const headlineText &equals; el&period;textContent&period;trim&lpar;&rpar;&semi;&NewLine; const href &equals; el&period;getAttribute&lpar;»href»&rpar;&semi;&NewLine;&NewLine; const p &equals; document&period;createElement&lpar;»p»&rpar;&semi;&NewLine; p&period;className &equals; «trending-item»&semi;&NewLine;&NewLine; &sol;&sol; Create number span&NewLine; const span &equals; document&period;createElement&lpar;»span»&rpar;&semi;&NewLine; span&period;className &equals; «trending-article-number»&semi;&NewLine; span&period;textContent &equals; &grave;&dollar;&lbrace;index &plus; 1&rcub;&grave;&semi;&NewLine;&NewLine; &sol;&sol; Create anchor&NewLine; const a &equals; document&period;createElement&lpar;»a»&rpar;&semi;&NewLine; a&period;href &equals; href&semi;&NewLine; a&period;textContent &equals; headlineText&semi;&NewLine; a&period;className &equals; «trending-body-text»&semi;&NewLine;&NewLine; &sol;&sol; Append span and anchor to paragraph&NewLine; p&period;appendChild&lpar;span&rpar;&semi;&NewLine; p&period;appendChild&lpar;a&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Append paragraph to container&NewLine; container&period;appendChild&lpar;p&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &rcub; catch &lpar;e&rpar; &lbrace;&NewLine; console&period;error&lpar;’Failed to load’&comma; e&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;loadTrendingMostRead&lpar;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; async function loadTrendingMostWatched&lpar;&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&NewLine; &grave;&sol;res&sol;custom&lowbar;page&sol;data&period;js&quest;resource&lowbar;id&equals;generic&layout&lowbar;name&equals;MostWatched&grave;&NewLine; &rpar;&semi;&NewLine; const posts &equals; await response&period;json&lpar;&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Parse the HTML string&NewLine; const parser &equals; new DOMParser&lpar;&rpar;&semi;&NewLine; const doc &equals; parser&period;parseFromString&lpar;posts&period;html&comma; «text&sol;html»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Select all headline <a> elements&NewLine; const headlineElements &equals; doc&period;querySelectorAll&lpar;»&period;widget&lowbar;&lowbar;headline-text»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Select or create a container in your HTML to append these&NewLine; const container &equals; document&period;getElementById&lpar;»videos»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Loop and create <p> with number and link&NewLine; Array&period;from&lpar;headlineElements&rpar;&period;forEach&lpar;&lpar;el&comma; index&rpar; &equals;> &lbrace;&NewLine; const headlineText &equals; el&period;textContent&period;trim&lpar;&rpar;&semi;&NewLine; const href &equals; el&period;getAttribute&lpar;»href»&rpar;&semi;&NewLine;&NewLine; const p &equals; document&period;createElement&lpar;»p»&rpar;&semi;&NewLine; p&period;className &equals; «trending-item»&semi;&NewLine;&NewLine; &sol;&sol; Create number span&NewLine; const span &equals; document&period;createElement&lpar;»span»&rpar;&semi;&NewLine; span&period;className &equals; «trending-article-number»&semi;&NewLine; span&period;textContent &equals; &grave;&dollar;&lbrace;index &plus; 1&rcub;&grave;&semi;&NewLine;&NewLine; &sol;&sol; Create anchor&NewLine; const a &equals; document&period;createElement&lpar;»a»&rpar;&semi;&NewLine; a&period;href &equals; href&semi;&NewLine; a&period;textContent &equals; headlineText&semi;&NewLine; a&period;className &equals; «trending-body-text»&semi;&NewLine;&NewLine; &sol;&sol; Append span and anchor to paragraph&NewLine; p&period;appendChild&lpar;span&rpar;&semi;&NewLine; p&period;appendChild&lpar;a&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Append paragraph to container&NewLine; container&period;appendChild&lpar;p&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine; &rcub; catch &lpar;e&rpar; &lbrace;&NewLine; console&period;error&lpar;’Failed to load’&comma; e&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;loadTrendingMostWatched&lpar;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; async function loadYourSay&lpar;&rpar; &lbrace;&NewLine; try &lbrace;&NewLine; const response &equals; await fetch&lpar;&grave;https&colon;&sol;&sol;www&period;gbnews&period;com&sol;r&sol;kappa&sol;api&sol;v2&sol;reader&sol;module&lowbar;yoursay&grave;&comma; &lbrace;&NewLine; method&colon; ‘GET’&comma;&NewLine; credentials&colon; «omit»&NewLine; &rcub;&rpar;&semi;&NewLine; const posts &equals; await response&period;json&lpar;&rpar;&semi;&NewLine; let yourSayArticles &equals; posts&period;trending&semi; &sol;&sol; array&NewLine; &sol;&sol; console&period;log&lpar;yourSayArticles&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Select the container in your HTML to append these&NewLine; const container &equals; document&period;getElementById&lpar;»your-say»&rpar;&semi;&NewLine;&NewLine; &sol;&sol; Loop through each article&NewLine; yourSayArticles&period;forEach&lpar;&lpar;article&comma; index&rpar; &equals;> &lbrace;&NewLine; const headlineText &equals; article&period;origin&lowbar;title&semi;&NewLine; const href &equals; article&period;origin&lowbar;url&semi;&NewLine;&NewLine; &sol;&sol; Create <p> wrapper&NewLine; const p &equals; document&period;createElement&lpar;»p»&rpar;&semi;&NewLine; p&period;className &equals; «trending-item»&semi;&NewLine;&NewLine; &sol;&sol; Create number <span>&NewLine; const span &equals; document&period;createElement&lpar;»span»&rpar;&semi;&NewLine; span&period;className &equals; «trending-article-number»&semi;&NewLine; span&period;textContent &equals; &grave;&dollar;&lbrace;index &plus; 1&rcub;&grave;&semi;&NewLine;&NewLine; &sol;&sol; Create <a> tag&NewLine; const a &equals; document&period;createElement&lpar;»a»&rpar;&semi;&NewLine; a&period;href &equals; href&semi;&NewLine; a&period;textContent &equals; headlineText&semi;&NewLine; a&period;className &equals; «trending-body-text»&semi;&NewLine;&NewLine; &sol;&sol; Append to container&NewLine; p&period;appendChild&lpar;span&rpar;&semi;&NewLine; p&period;appendChild&lpar;a&rpar;&semi;&NewLine; container&period;appendChild&lpar;p&rpar;&semi;&NewLine; &rcub;&rpar;&semi;&NewLine;&NewLine;&NewLine; &rcub; catch &lpar;e&rpar; &lbrace;&NewLine; console&period;error&lpar;’Failed to load’&comma; e&rpar;&semi;&NewLine; &rcub;&NewLine;&rcub;&NewLine;&NewLine;loadYourSay&lpar;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; const articleId &equals; window&period;dataLayer&lbrack;0&rsqb;&period;cd12&semi;&NewLine;&sol;&sol; Fill in &ast;your&ast; param values&comma; as provided by Taboola&colon;&NewLine;&sol;&sol; &ast;Global&ast; command queue for the page&NewLine;window&period;&lowbar;taboola &equals; window&period;&lowbar;taboola &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&NewLine;const taboolaPush &equals; &lpar;mode&comma; container&comma; placement&comma; target&lowbar;type&rpar; &equals;> &lbrace;&NewLine; &lowbar;taboola&period;push&lpar;&lbrace;&NewLine; mode&colon; mode&comma;&NewLine; container&colon; container &sol;&ast; The ID of the <div> container &lpar;e&period;g&period; »&rpar; &ast;&sol;&comma;&NewLine; placement&colon; placement&comma;&NewLine; target&lowbar;type&colon; target&lowbar;type&comma;&NewLine; &rcub;&rpar;&semi;&NewLine; return&semi;&NewLine;&rcub;&semi;&NewLine;&NewLine;let accessStatusFromWindowObj5 &equals; window&period;userStatus&semi;&NewLine;&NewLine;if &lpar;accessStatusFromWindowObj5 &excl;&equals;&equals; ‘member’&rpar; &lbrace;&NewLine; taboolaPush&lpar;’alternating-thumbnails-stream-rmp’&comma; ‘taboola-mid-article-thumbnails’&comma; ‘Mid Article Thumbnails’&comma; ‘mix’&rpar;&semi;&NewLine;&NewLine; taboolaPush&lpar;’alternating-thumbnails-a’&comma; ‘taboola-below-article-thumbnails’&comma; ‘Below Article Thumbnails’&comma; ‘mix’&rpar;&semi;&NewLine;&rcub;&NewLine;&NewLine;&sol;&sol; &sol;&sol; window&period;&lowbar;taboola &equals; window&period;&lowbar;taboola &vert;&vert; &lbrack;&rsqb;&semi;&NewLine;&sol;&sol; &sol;&sol; &lowbar;taboola&period;push&lpar;&lbrace;&NewLine;&sol;&sol; &sol;&sol; mode&colon; ‘alternating-thumbnails-a’&comma;&NewLine;&sol;&sol; &sol;&sol; container&colon; ‘taboola-below-article-thumbnails’&comma;&NewLine;&sol;&sol; &sol;&sol; placement&colon; ‘Below Article Thumbnails’&comma;&NewLine;&sol;&sol; &sol;&sol; target&lowbar;type&colon; ‘mix’&comma;&NewLine;&sol;&sol; &sol;&sol; &rcub;&rpar;&semi;&NewLine;&NewLine;&sol;&sol; &sol;&sol; const paragraphs &equals; document&period;querySelectorAll&lpar;’&period;body-description p&colon;not&lpar;small p&comma; &period;evergreen-particle p&rpar;’&rpar;&semi;&NewLine;&sol;&sol; &sol;&sol; if &lpar;paragraphs&period;length > 2&rpar; &lbrace;&NewLine;&sol;&sol; &sol;&sol; const video &equals; paragraphs&lbrack;2&rsqb;&semi;&NewLine;&sol;&sol; &sol;&sol; const div &equals; document&period;createElement&lpar;’div’&rpar;&semi;&NewLine;&sol;&sol; &sol;&sol; div&period;innerHTML &equals; &grave;<div id&equals;»taboola-mid-article-thumbnails»>&grave;&semi;&NewLine;&sol;&sol; &sol;&sol; video&period;after&lpar;div&rpar;&semi;&NewLine;&sol;&sol; &sol;&sol; &rcub;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&NewLine;&NewLine;window&period;REBELMOUSE&lowbar;LOWEST&lowbar;TASKS&lowbar;QUEUE&period;push&lpar;function&lpar;&rpar;&lbrace;&NewLine;&NewLine; &NewLine; REBELMOUSE&lowbar;STDLIB&period;createElementChangeListener&lpar;»&period;ssmp-content»&comma; function&lpar;poster&rpar; &lbrace;&NewLine; const videoPlayer &equals; document&period;querySelector&lpar;’&period;simplestream-holder video’&rpar;&semi;&NewLine; let isVideoStarted &equals; false&semi;&NewLine; let playVideoInterval&semi;&NewLine;&NewLine; const handler &equals; function&lpar;&rpar; &lbrace;&NewLine; if &lpar;&excl;isVideoStarted&rpar; &lbrace;&NewLine; playVideoInterval &equals; setInterval&lpar;&lpar;&rpar; &equals;> &lbrace;&NewLine; if &lpar;videoPlayer&period;readyState &equals;&equals;&equals; 4&rpar; &lbrace;&NewLine; isVideoStarted &equals; true&semi;&NewLine; poster&period;removeEventListener&lpar;’click’&comma; handler&comma; true&rpar;&semi;&NewLine; clearInterval&lpar;playVideoInterval&rpar;&semi;&NewLine; return videoPlayer&period;play&lpar;&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&comma; 100&rpar;&semi;&NewLine; &rcub;&NewLine; &rcub;&NewLine;&NewLine; return poster&period;addEventListener&lpar;’click’&comma; handler&comma; true&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine; &NewLine;&NewLine;&rcub;&rpar;&semi;&rsqb;&rsqb;><&sol;script><&sol;body>