{"version":3,"sources":["../../../../dev/j/v2/pages/lp-aff-pcworld-a1.js"],"names":["checkIfApplyPopupLogicForCurrentPage","buttonSelector","$","isArray","configCurrentPage","each","i","val","length","getCurrentPlatform","jsClasses","js-pc","js-mac","js-android","js-ios","key","hasOwnProperty","hasClass","getKeyByValue","value","object","prop","applyBrandingStyle","$popup","$popupButton","find","$platformIcon","pageSupportedPlatform","removeClass","remove","supportedPlatformIcon","attr","replace","defaultIconName","supportedPlatforms","style","addClass","updateInsteadLinks","alternativeLinks","alternativeTracking","$targetLinks","detectedPlatform","detectOthers","_alternativeLinks","avm","require","$open","$close","$openComparison","$closeComparison","trialDownloadIDs","pc","mac","android","ios","avastGlobals","detect","os","name","toLowerCase","$document","document","pathnameSplitted","window","location","pathname","split","text","supported-platform","product-id","Vue","el","data","activeVal","methods","toggleActive","this","delimiters","on","parents","$target","parent","next","$openButton","prev","scrollTo","top","offset","innerHeight","left","behavior","scrolledTop","pageYOffset","stickyBar","comarisonTable","outerHeight","ready","$body","DSModal","$platformPlaceHolderHeader","$supportedPlatformPlaceHolder","$downloadButton","downloadButtonData","data-os","data-download-name","href","$popupDownloadButtons","oopsModal","BSN","Modal","event","clickedPlatform","preventDefault","stopPropagation","web","oopsShow","thisModal","modal","hide","filter","show","hash","bodyOverflow","css","target","is","trigger"],"mappings":"CAAA,WACC,YAmNA,SAASA,KAER,MADAC,MACO,EAIR,QAASA,KACJC,EAAEC,QAAQC,EAAkB,gBAC/BF,EAAEG,KAAKD,EAAkB,cAAe,SAASE,EAAGC,GAC/CL,EAAE,wBAA2BK,EAAM,MAAOC,OAAS,IACtDJ,EAAkB,cAAgBG,KAOtC,QAASE,KACR,GAAIC,IACHC,QAAS,KACTC,SAAU,MACVC,aAAc,UACdC,SAAU,MAEX,KAAK,GAAIC,KAAOL,GACf,GAAIA,EAAUM,eAAeD,IACxBb,EAAE,QAAQe,SAASF,GACtB,MAAOL,GAAUK,EAIpB,OAAO,KAGR,QAASG,GAAcC,EAAOC,G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BO,GAAkB0B,QAErEiD,EAAU3F,KAAK,sBAAsB6F,OAAOC,OAAO,mCAAmCC,OACtFJ,EAAU3F,KAAK,qBAAqB6F,OAAOC,OAAO,kCAAkCC,QAErFpB,EAA8BjC,KAAKjC,EAAmBP,GAAuBwC,MAC7EwC,EAAUa,OACVzD,OAAOC,SAASyD,KAAO,cAGnB,CAEN,GAAI1E,GAASxB,EAAOE,KAAK,aACxBiG,EAAezB,EAAM0B,IAAI,WAE1B5E,GAAO+B,GAAG,QAAS,WAClBvD,EAAOK,YAAY,cACnBmC,OAAOC,SAASyD,KAAO,IACvBxB,EAAM0B,IAAI,WAAYD,KAGvBnG,EAAOuD,GAAG,QAAS,SAASgC,GACvB5G,EAAE4G,EAAMc,QAAQC,GAAGtG,IACtBwB,EAAO+E,QAAQ,WAIjBzB,EAAgBvB,GAAG,QAAS,SAASgC,GAChCrE,IAAqBd,IACxBmF,EAAME,iBACNF,EAAMG,kBACN1F,EAAOa,SAAS,cAChB+D,EAA2BhC,KAAKjC,EAAmBO,GAAkB0B,MACrEiC,EAA8BjC,KAAKjC,EAAmBP,GAAuBwC,MAC7EJ,OAAOC,SAASyD,KAAO,OACvBxB,EAAM0B,IAAI,WAAY,aAMzBnG,EAAaO,KAAK,UAAWuE,EAAmB,YAChD9E,EAAaO,KAAK,qBAAsBuE,EAAmB,uBAC3D9E,EAAaO,KAAK,OAAQuE,EAAmBG,MAG7CC,EAAsB5B,GAAG,QAAS,eACZ,KAAd6B,EAA4BA,EAAUW,OAAS/F,EAAOK,YAAY,cACzEmC,OAAOC,SAASyD,KAAO,IACvBxB,EAAM0B,IAAI,WAAYD,KAGvBrF,EAAmBd,GACnBD,EAAmBC,GAGfmB,EAAanB,IAChBA,EAAOa,SAAS","file":"lp-aff-pcworld-a1.js","sourcesContent":["(function() {\n\t'use strict';\n\tvar $ = avm.require('jquery'),\n\t\t$open = $('.js-open'),\n\t\t$close = $('.js-close'),\n\t\t$openComparison = $('.js-open-comparison'),\n\t\t$closeComparison = $('.js-close-comparison'),\n\t\ttrialDownloadIDs = {\n\t\t\tpc: 'AVAST-ONE-FREE-WIN-PP',\n\t\t\tmac: 'AVAST-ONE-FREE-MAC-PP',\n\t\t\tandroid: 'AVAST-ONE-ANDROID-PP',\n\t\t\tios: 'AVAST-ONE-IOS-PP'\n\t\t},\n\t\tdetectedPlatform = avastGlobals.detect.os.name.toLowerCase(),\n\t\t$document = $(document),\n\t\tcurrentPageName = getCurrentPageName(),\n\t\tsupportedPlatforms = {\n\t\t\tandroid: {\n\t\t\t\ttext: 'Android',\n\t\t\t\tstyle: 'google-play.png'\n\t\t\t},\n\t\t\tios: {\n\t\t\t\ttext: 'iOS',\n\t\t\t\tstyle: 'app-store.png'\n\t\t\t},\n\t\t\tmac: {\n\t\t\t\ttext: 'Mac',\n\t\t\t\tstyle: 'logo-mac'\n\t\t\t},\n\t\t\tpc: {\n\t\t\t\ttext: 'Windows',\n\t\t\t\tstyle: 'logo-win'\n\t\t\t}\n\t\t},\n\t\tdefaultIconName = 'google-play.png',\n\t\tconfigCurrentPage = {\n\t\t\t'supported-platform': getCurrentPlatform(),\n\t\t\t'product-id': trialDownloadIDs[getCurrentPlatform()]\n\t\t},\n\t\tpageSupportedPlatform = configCurrentPage['supported-platform'].toLowerCase();\n\n\t// fix platform name\n\tif (detectedPlatform === 'windows') {\n\t\tdetectedPlatform = 'pc';\n\t}\n\n\tvar cardToggler = new Vue({\n\t el: '#card-toggler',\n\t data: {\n\t activeVal: 'individual'\n\t },\n\t methods: {\n\t toggleActive: function(name) {\n\t this.activeVal = name;\n\t }\n\t },\n\t delimiters: ['<%', '%>']\n\t});\n\n\t$open.on('click', function() {\n\t\tvar $target = $(this).parents('section').find('.js-features-content');\n\n\t\t$target.addClass('show');\n\t\t$(this).addClass('d-none');\n\t});\n\n\t$close.on('click', function() {\n\t\tvar $target = $(this).parents('.js-features-content'),\n\t\t\t$openButton = $target.parents('section').find('.js-open');\n\n\t\t$openButton.removeClass('d-none');\n\t\t$target.removeClass('show');\n\t});\n\n\t$openComparison.on('click', function() {\n\t\tvar $target = $(this).parent().next('.js-comparison-content');\n\n\t\t$target.addClass('show');\n\t\t$(this).addClass('d-none');\n\t});\n\n\t$closeComparison.on('click', function() {\n\t\tvar $target = $(this).parents('.js-comparison-content'),\n\t\t\t$openButton = $target.prev().find('.js-open-comparison');\n\n\t\t$openButton.removeClass('d-none');\n\t\t$target.removeClass('show');\n\n\t\t$('.sticky-bar').removeClass('hidden');\n\n\t\twindow.scrollTo({\n\t\t\ttop: $openButton.offset().top - window.innerHeight / 2,\n\t\t\tleft: 0,\n\t\t\tbehavior: 'smooth'\n\t\t});\n\t});\n\n\t$(window).on('scroll', function() {\n\t\tvar scrolledTop = window.pageYOffset;\n\t\tvar stickyBar = $('.sticky-bar');\n\t\tvar comarisonTable = $('.js-comparison-content.show');\n\t\tif (!comarisonTable.length) {\n\t\t\treturn;\n\t\t}\n\t\tif (scrolledTop > comarisonTable.offset().top && scrolledTop < comarisonTable.offset().top + comarisonTable.outerHeight()) {\n\t\t\tstickyBar.addClass('hidden');\n\t\t} else {\n\t\t\tstickyBar.removeClass('hidden');\n\t\t}\n\t});\n\n\t// custom edits for oops modal\n\t$document.ready(function() {\n\t\tif (checkIfApplyPopupLogicForCurrentPage()) {\n\t\t\tvar $body = $('body'),\n\t\t\t\t$popup = $('#modalOops').length ? $('#modalOops') : $('.js-notification-overlay-for-wrong-download'),\n\t\t\t\tDSModal = $('#modalOops').length,\n\t\t\t\t$platformPlaceHolderHeader = $popup.find('.detected-platform'),\n\t\t\t\t$supportedPlatformPlaceHolder = $popup.find('.supported-platform'),\n\t\t\t\t$downloadButton = $('a[href*=\"download-thank-you.php\"]:not(.popup-button)'),\n\t\t\t\tdownloadButtonData = {\n\t\t\t\t\t'data-os': $downloadButton.attr('data-os') || pageSupportedPlatform,\n\t\t\t\t\t'data-download-name': $downloadButton.attr('data-download-name') || configCurrentPage['product-id'],\n\t\t\t\t\thref: $downloadButton.attr('href') || null\n\t\t\t\t},\n\t\t\t\t$popupDownloadButtons = $popup.find('a'),\n\t\t\t\t$popupButton = $popup.find('.js-popup-button');\n\n\t\t\tif (DSModal) {\n\t\t\t\t// for DS version\n\t\t\t\tvar oopsModal = new BSN.Modal('#modalOops');\n\n\t\t\t\t$downloadButton.on('click', function(event) {\n\t\t\t\t\tvar clickedPlatform = getKeyByValue($(this).data('download-name'), trialDownloadIDs);\n\t\t\t\t\tconfigCurrentPage = {\n\t\t\t\t\t\t'supported-platform': clickedPlatform,\n\t\t\t\t\t\t'product-id': trialDownloadIDs[clickedPlatform]\n\t\t\t\t\t};\n\t\t\t\t\tpageSupportedPlatform = configCurrentPage['supported-platform'].toLowerCase();\n\t\t\t\t\tif ($(this).data('download-name') !== trialDownloadIDs[detectedPlatform]) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tavastGlobals.web.oopsShow = true;\n\t\t\t\t\t\tvar thisModal = $(oopsModal.modal);\n\t\t\t\t\t\tthisModal.find('.custom-platform-switch').attr('class', 'custom-platform-switch custom-platform-switch--' + clickedPlatform);\n\t\t\t\t\t\tif (detectedPlatform in supportedPlatforms) {\n\t\t\t\t\t\t\tthisModal.find('.modal-oops__title').hide().filter('.modal-oops__title--supported').show();\n\t\t\t\t\t\t\tthisModal.find('.modal-oops__desc').hide().filter('.modal-oops__desc--supported').show();\n\t\t\t\t\t\t\t$platformPlaceHolderHeader.text(supportedPlatforms[detectedPlatform].text);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthisModal.find('.modal-oops__title').hide().filter('.modal-oops__title--unsupported').show();\n\t\t\t\t\t\t\tthisModal.find('.modal-oops__desc').hide().filter('.modal-oops__desc--unsupported').show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$supportedPlatformPlaceHolder.text(supportedPlatforms[pageSupportedPlatform].text);\n\t\t\t\t\t\toopsModal.show();\n\t\t\t\t\t\twindow.location.hash = 'oops';\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// for old version\n\t\t\t\tvar\t$close = $popup.find('.js-close'),\n\t\t\t\t\tbodyOverflow = $body.css('overflow');\n\n\t\t\t\t$close.on('click', function() {\n\t\t\t\t\t$popup.removeClass('show-popup');\n\t\t\t\t\twindow.location.hash = '!';\n\t\t\t\t\t$body.css('overflow', bodyOverflow);\n\t\t\t\t});\n\n\t\t\t\t$popup.on('click', function(event) {\n\t\t\t\t\tif ($(event.target).is($popup)) {\n\t\t\t\t\t\t$close.trigger('click');\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t$downloadButton.on('click', function(event) {\n\t\t\t\t\tif (detectedPlatform !== pageSupportedPlatform) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t$popup.addClass('show-popup');\n\t\t\t\t\t\t$platformPlaceHolderHeader.text(supportedPlatforms[detectedPlatform].text);\n\t\t\t\t\t\t$supportedPlatformPlaceHolder.text(supportedPlatforms[pageSupportedPlatform].text);\n\t\t\t\t\t\twindow.location.hash = 'oops';\n\t\t\t\t\t\t$body.css('overflow', 'hidden');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Dynamicly update button for particular page\n\t\t\t$popupButton.attr('data-os', downloadButtonData['data-os']);\n\t\t\t$popupButton.attr('data-download-name', downloadButtonData['data-download-name']);\n\t\t\t$popupButton.attr('href', downloadButtonData.href);\n\n\t\t\t// download buttons in popup\n\t\t\t$popupDownloadButtons.on('click', function() {\n\t\t\t\ttypeof oopsModal !== 'undefined' ? oopsModal.hide() : $popup.removeClass('show-popup');\n\t\t\t\twindow.location.hash = '!';\n\t\t\t\t$body.css('overflow', bodyOverflow);\n\t\t\t});\n\n\t\t\tupdateInsteadLinks($popup);\n\t\t\tapplyBrandingStyle($popup);\n\n\t\t\t// If platform is known but alternative download is missing\n\t\t\tif (detectOthers($popup)) {\n\t\t\t\t$popup.addClass('detected-others');\n\t\t\t}\n\t\t}\n\t});\n\n\t// Checks whether current page name is listed in avastGlobals config. If not, skip popup logic\n\t// once localization is done to all instances , language condition can be removed\n\tfunction checkIfApplyPopupLogicForCurrentPage() {\n\t\tbuttonSelector();\n\t\treturn true;\n\t}\n\n\t// In case we are changing installers based on different locations\n\tfunction buttonSelector() {\n\t\tif ($.isArray(configCurrentPage['product-id'])) {\n\t\t\t$.each(configCurrentPage['product-id'], function(i, val) {\n\t\t\t\tif ($('[data-download-name=\\\"' + val + '\\\"]').length > 0) {\n\t\t\t\t\tconfigCurrentPage['product-id'] = val;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t// get current js-${platform} class\n\tfunction getCurrentPlatform() {\n\t\tvar jsClasses = {\n\t\t\t'js-pc': 'pc',\n\t\t\t'js-mac': 'mac',\n\t\t\t'js-android': 'android',\n\t\t\t'js-ios': 'ios'\n\t\t};\n\t\tfor (var key in jsClasses) {\n\t\t\tif (jsClasses.hasOwnProperty(key)) {\n\t\t\t\tif ($('html').hasClass(key)) {\n\t\t\t\t\treturn jsClasses[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 'pc';\n\t}\n\n\tfunction getKeyByValue(value, object) {\n\t\tfor (var prop in object) {\n\t\t\tif (object.hasOwnProperty(prop)) {\n\t\t\t\tif (object[prop] === value) {\n\t\t\t\t\treturn prop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// if android/ios device , display store button instead of icons\n\tfunction applyBrandingStyle($popup) {\n\t\tvar $popupButton = $popup.find('.js-popup-button'),\n\t\t\t$platformIcon = typeof $popupButton.find('img') !== 'undefined' ? $popupButton.find('img') : false;\n\n\t\tif ($platformIcon.length > 0) {\n\t\t\tif (pageSupportedPlatform === 'ios' || pageSupportedPlatform === 'android') {\n\t\t\t\t$popupButton.removeClass('white');\n\t\t\t\t$popupButton.find('span').remove();\n\t\t\t\tvar supportedPlatformIcon = $platformIcon.attr('src');\n\t\t\t\t$platformIcon.attr('src', supportedPlatformIcon.replace(defaultIconName, supportedPlatforms[pageSupportedPlatform].style));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t$popupButton.addClass(supportedPlatforms[pageSupportedPlatform].style);\n\t\t$platformIcon.remove();\n\t}\n\n\tfunction getCurrentPageName() {\n\t\tvar pathnameSplitted = window.location.pathname.split('/');\n\t\treturn pathnameSplitted[pathnameSplitted.length - 1];\n\t}\n\n\t/*\n\t\tpoupulate corresponding properties with data from avastGlobals\n\t\tshow .detected-{Detected OS}\n\t*/\n\tfunction updateInsteadLinks($popup) {\n\t\tvar alternativeLinks = configCurrentPage['alternative-links'],\n\t\t\talternativeTracking = configCurrentPage['alternative-tracking'],\n\t\t\t$targetLinks = $popup.find('.detected-' + detectedPlatform).find('.js-instead-link');\n\t\t$popup.find('.detected-' + detectedPlatform).addClass('show');\n\n\t\tif (typeof alternativeLinks !== 'undefined') {\n\t\t\t$targetLinks.attr('href', alternativeLinks[detectedPlatform]);\n\t\t}\n\n\t\tif (typeof alternativeTracking !== 'undefined') {\n\t\t\t$targetLinks.attr('data-download-name', alternativeTracking[detectedPlatform]);\n\t\t}\n\n\t\t$targetLinks.attr('data-os', detectedPlatform);\n\t}\n\n\t// This function returns true if platform is known (Windows, Mac etc.), but there is no altertnative download\n\tfunction detectOthers($popup) {\n\t\tvar _alternativeLinks = typeof configCurrentPage['alternative-links'] !== 'undefined' ? configCurrentPage['alternative-links'] : null;\n\n\t\tif (!$popup.hasClass('detected-unknown') && (_alternativeLinks === null || typeof _alternativeLinks[detectedPlatform] === 'undefined')) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n})();\n"]}