!function(){window.dataLayer=window.dataLayer||[];var e=window.AsusAPIConfig?window.AsusAPIConfig:{system:"asus",websitePath:"global"},t={css:"https://dlcdnimgs.asus.com",webapi:"https://csapi.asus.com",cmsapi:"https://consoleapi.asus.com",cookiekey:"ASUS-JWT"},o=!1,n={},i={},a={},s={},r=null,l=function(){o||(o=!0,c(),location.search.slice(1).split("&").map((function(e){i[e.split("=")[0]]=e.split("=")[1]})),document.cookie.split(";").map((function(e){a[e.split("=")[0].trim()]=e.split("=")[1]})),d(),u(),"rog"==e.system&&window.__INITIAL_STATE__&&window.__INITIAL_STATE__.Cookie&&setInterval((function(){if(window.__INITIAL_STATE__.Cookie.routeInfo.ConfigValue&&window.__INITIAL_STATE__.Cookie.routeInfo.ConfigValue.ComponentsPageKey!=e.pageKey){for(var t in e.pageKey=window.__INITIAL_STATE__.Cookie.routeInfo.ConfigValue.ComponentsPageKey,n)n[t]._element.remove();n={},u()}}),1e3))},c=function(){var o=window.location.host;-1!=o.indexOf("dev")?t={css:"https://stage-asgard.asus.com",webapi:"https://dev-csapi.asus.com",cmsapi:"https://dev-consoleapi.asus.com",cookiekey:"ASUS-JWT-DEV"}:-1!=o.indexOf("stage")?t={css:"https://stage-asgard.asus.com",webapi:"https://stage-csapi.asus.com",cmsapi:"https://stage-consoleapi.asus.com",cookiekey:"ASUS-JWT-STAGE"}:-1!=o.indexOf("rogmars")||-1!=o.indexOf("odinview")?t={css:"https://dlcdnimgs.asus.com",webapi:"https://csviewapi.asus.com",cmsapi:"https://consoleapi.asus.com",cookiekey:"ASUS-JWT"}:"cn"===e.websitePath&&(t.webapi=t.webapi+".cn")},d=function(){var o=document.getElementsByTagName("head")[0],n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.media="all";let i="";"asus"!==e.system&&"commercial"!==e.system&&(i="_"+e.system),"cn"!==e.websitePath?n.href=`${t.css}/vendor/promotion-banner/css/promotionbanner${i}.css`:n.href=`https://www.asus.com.cn/vendor/promotion-banner/css/promotionbanner${i}.css`,o.appendChild(n)},u=async function(){var o=function(){let o=e.system;if(-1!=window.location.href.toLowerCase().indexOf("account.asus")?o="oneportal":"commercial"===e.system&&(o="asus"),i.promotionId)return e.pageKey=i.pageKey||"",t.cmsapi+"/promotion/api/v2/marketingAds/"+i.promotionId+"/"+o+"/"+e.websitePath+"/preview?pageKey="+e.pageKey;var n=e.customSiteId?e.customSiteId:encodeURI(window.location.hostname).split(".")[0];return t.webapi+"/promotion/api/v2/marketingAds/content/"+o+"/"+e.websitePath+"?pageKey="+e.pageKey+"&siteId="+n}();if(e.pageKey){var n=await fetch(o,i.promotionId?{headers:{"X-Request-ID":"preview",Authorization:"Bearer "+a[t.cookiekey]}}:{});s=await n.json(),p()}},p=function(){var e=parseInt((new Date).getTime()/1e3);function t(){if(s.result.overlay||s.result.lowerRightCorner){if(s.result.overlay||s.result.lowerRightCorner){function t(t){return!(t.startDate&&t.startDate>e||t.endDate&&t.endDate0?!t(s.result.overlay)&&Object.values(s.result.lowerRightCorner).length>0&&t(s.result.lowerRightCorner):Object.values(s.result.lowerRightCorner).length>0&&t(s.result.lowerRightCorner)}}else v(s.result)}window.asusCookieBanner?window.addEventListener("cookieBannerClose",(function(e){t()})):t()},_=function(e){window.innerWidth<=1023?setTimeout((()=>{dataLayer.push(e)}),200):dataLayer.push(e)},v=function(t){var o=f(t);o.id="PB_id_"+t.promotionId,o.className="PB_type_"+t.positionKey,o.querySelector(".PB_title").innerText=t.title;let i=t.templateKey;"video"===i&&"textLink"===t.buttonSettings.buttonStyle?i="video_text":"video"===i&&(i="video_btn"),dataLayer.push({event:"promotionView",ecommerce:{promoView:{promotions:[{id:t.title,name:i+"/"+t.positionKey+"/"+e.pageKey,position:"ads_dialog"}]}}}),r=document.activeElement;const a=document.querySelector(".PB_promotionBanner");function s(){if(document.querySelector(".PB_container")){const e=document.querySelector(".PB_container"),o=e.scrollHeight>e.clientHeight;document.querySelector(".PB_container").classList.remove("PB_containerStickyScroll"),document.querySelector(".PB_container").classList.remove("PB_containerScroll"),document.querySelector(".PB_center")&&o&&"promotion"===t.templateKey?document.querySelector(".PB_container").classList.add("PB_containerStickyScroll"):o&&"video"!==t.templateKey&&document.querySelector(".PB_container").classList.add("PB_containerScroll")}}a&&a.focus(),"notice"===t.templateKey&&"lowerRightCorner"===t.positionKey&&0===t.description.length&&0===t.note.length&&document.querySelector(".PB_container").remove(),window.AsusAPIConfig&&window.AsusAPIConfig.brandAssistantSystemCode&&"lowerRightCorner"===t.positionKey&&window.innerWidth>731&&document.querySelector(".PB_corner").classList.add("PB_hasAi");var l=t.templateKey,c=!!t.imgSettings&&t.imgSettings.displayFlag,d=!!t.videoSettings&&t.videoSettings.displayFlag,u=!t.offersStyle||t.offersStyle.offersTypeKey;if(o.querySelector(".PB_description")&&(!o.querySelector(".PB_couponDescription")||"noImage"!==u)&&t.description.length>0?o.querySelector(".PB_description").innerText=t.description:o.querySelector(".PB_description")&&o.querySelector(".PB_description").remove(),c?(o.querySelector(".PB_picture").appendChild(m(l,t.imgSettings)),d&&(o.querySelector(".PB_picture").innerHTML+=B(t.title))):o.querySelector(".PB_picture")&&o.querySelector(".PB_picture").remove(),t.buttonSettings&&t.buttonSettings.displayFlag&&"textLink"===t.buttonSettings.buttonStyle&&o.querySelector(".PB_link")){var p="promotion"===l?"Shop now - ":"Learn more - ";o.querySelector(".PB_link span").innerText=t.buttonSettings.buttonText,o.querySelector(".PB_link").href=t.buttonSettings.buttonUrl,o.querySelector(".PB_link").target=t.buttonSettings.urlTarget;const n="_self"===t.buttonSettings.urlTarget?"":"Open a new window";o.querySelector(".PB_link").ariaLabel=p+" "+t.title+" "+n;let i=l;"video"===i&&(i="video_text"),o.querySelector(".PB_link").addEventListener("click",(function(){_({event:"data_layer_event",event_name_ga4:"ads_dialog_"+e.pageKey,event_category_DL:i+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_action_DL:"clicked",event_label_DL:"text_link/"+t.title+"/"+i+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_value_DL:0}),_({event:"promotionClick",ecommerce:{promoClick:{promotions:[{id:t.title,name:i+"/"+t.positionKey+"/"+e.pageKey,position:"ads_dialog"}]}}})}))}else o.querySelector(".PB_link")&&o.querySelector(".PB_link").remove();if(t.buttonSettings&&t.buttonSettings.displayFlag&&"primaryButton"===t.buttonSettings.buttonStyle&&o.querySelector(".PB_button")){o.querySelector(".PB_button").innerText=t.buttonSettings.buttonText,o.querySelector(".PB_button").href=t.buttonSettings.buttonUrl,o.querySelector(".PB_button").target=t.buttonSettings.urlTarget;const n="_self"===t.buttonSettings.urlTarget?"":"Open a new window";o.querySelector(".PB_button").ariaLabel=t.buttonSettings.buttonText+" "+t.title+" "+n;let i=l;"video"===i&&(i="video_btn"),o.querySelector(".PB_button").addEventListener("click",(function(){_({event:"data_layer_event",event_name_ga4:"ads_dialog_"+e.pageKey,event_category_DL:i+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_action_DL:"clicked",event_label_DL:"button/"+t.title+"/"+i+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_value_DL:0}),_({event:"promotionClick",ecommerce:{promoClick:{promotions:[{id:t.title,name:i+"/"+t.positionKey+"/"+e.pageKey,position:"ads_dialog"}]}}})}))}else"offers"===l&&o.querySelector(".PB_button")?o.querySelector(".PB_button").innerText=t.copyWording||"Copy":o.querySelector(".PB_button")&&o.querySelector(".PB_button").remove();if(t.couponSettings&&t.couponSettings.colorCode&&o.querySelector(".PB_body")&&"offers"===l&&""!==t.couponSettings.colorCode&&(o.querySelector(".PB_body").style.backgroundColor=t.couponSettings.colorCode),t.couponSettings&&t.couponSettings.displayFlag&&o.querySelector(".PB_couponDescription")){if(o.querySelector(".PB_couponDescription").innerText="offers"===l&&"noImage"===u?t.description:t.couponSettings.couponDescription,o.querySelector(".PB_couponDescription").clientHeight>57){o.querySelector(".PB_couponDescriptionBox").classList.add("PB_hideDetail");var v=`\n \n `;o.querySelector(".PB_couponDescriptionBox").innerHTML+=v,o.querySelector(".PB_detailButton").ariaLabel="Show details of coupon info",o.querySelector(".PB_detailButton").ariaExpanded=!1}}else o.querySelector(".PB_couponDescriptionBox")&&o.querySelector(".PB_couponDescriptionBox").remove();function h(){if("overlay"===t.positionKey)o.querySelector(".PB_videoMode .PB_picture").innerHTML=`
${g(t.videoSettings.videoUrl,t.videoSettings.videoSource)}
`;else{const e=``;var n=document.createElement("div");n.innerHTML=e,document.querySelector("body").appendChild(n),document.querySelector("html").classList.add("PB_fixed"),document.querySelector("body").classList.add("PB_fixed"),document.querySelector(".PB_popup").focus(),document.querySelector(".PB_popup_close").addEventListener("click",(function(){document.querySelector(".PB_popup").remove(),document.querySelector("html").classList.remove("PB_fixed"),document.querySelector("body").classList.remove("PB_fixed")}))}let i="video_btn";"textLink"===t.buttonSettings.buttonStyle&&(i="video_text"),_({event:"data_layer_event",event_name_ga4:"ads_dialog_"+e.pageKey,event_category_DL:i+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_action_DL:"clicked",event_label_DL:"play/"+t.title+"/"+i+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_value_DL:0})}if(o.querySelector(".PB_close").addEventListener("click",(function(){y(o,t.positionKey,t.delayDuration);let n=t.templateKey;"video"===n&&"textLink"===t.buttonSettings.buttonStyle?n="video_text":"video"===n&&(n="video_btn"),_({event:"data_layer_event",event_name_ga4:"ads_dialog_"+e.pageKey,event_category_DL:n+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_action_DL:"clicked",event_label_DL:"close/"+t.title+"/"+n+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_value_DL:0})})),o.querySelector(".PB_playButton")){const e=o.querySelector(".PB_playButton");e.addEventListener("click",h),e.addEventListener("keydown",(function(e){"Enter"===e.key&&h()}))}function P(){let n="view_detail";this.parentNode.classList.contains("PB_showDetail")?(this.querySelector(".PB_detailButton span").innerText=t.viewDetailsWording,this.parentNode.classList.remove("PB_showDetail"),this.parentNode.classList.add("PB_hideDetail"),o.querySelector(".PB_detailButton").ariaLabel="Show details of coupon info",o.querySelector(".PB_detailButton").ariaExpanded=!1,n="hide_detail"):(this.querySelector(".PB_detailButton span").innerText=t.hideDetailsWording,this.parentNode.classList.add("PB_showDetail"),this.parentNode.classList.remove("PB_hideDetail"),o.querySelector(".PB_detailButton").ariaLabel="Hide details of coupon info",o.querySelector(".PB_detailButton").ariaExpanded=!0),_({event:"data_layer_event",event_name_ga4:"ads_dialog_"+e.pageKey,event_category_DL:t.templateKey+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_action_DL:"clicked",event_label_DL:n+"/"+t.title+"/"+t.templateKey+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_value_DL:0}),s()}if(o.querySelector(".PB_detailButton")){const e=o.querySelector(".PB_detailButton");e.addEventListener("click",P),e.addEventListener("keydown",(function(e){"Enter"===e.key&&P()}))}o.querySelector(".PB_buttonBox")&&o.querySelector(".PB_copyButton")&&o.querySelector(".PB_copyButton").addEventListener("click",(function(){o.querySelector(".PB_toastNotification").classList.add("PB_showToastNotification"),setTimeout((()=>{o.querySelector(".PB_toastNotification").classList.remove("PB_showToastNotification")}),3e3);var n=this.dataset.coupon;navigator.clipboard.writeText(n),_({event:"data_layer_event",event_name_ga4:"ads_dialog_"+e.pageKey,event_category_DL:t.templateKey+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_action_DL:"clicked",event_label_DL:"button/"+t.title+"/"+t.templateKey+"/"+t.positionKey+"/ads_dialog/"+e.pageKey,event_value_DL:0}),_({event:"promotionClick",ecommerce:{promoClick:{promotions:[{id:t.title,name:t.templateKey+"/"+t.positionKey+"/"+e.pageKey,position:"ads_dialog"}]}}})})),window.onload=s,n[t.promotionId]._element=o},y=function(e,t,o){r&&r.focus(),"overlay"===t&&setTimeout((()=>{p()}),1e3*o),e.remove(),document.querySelector("html").classList.remove("PB_fixed"),document.querySelector("body").classList.remove("PB_fixed")},m=function(e,t){var o=document.createElement("picture");if("offers"===e&&t.mobileImgPath){var n=document.createElement("source");n.media="(max-width: 731px)",n.srcset=`${t.mobileImgPath}fwebp 1x, ${t.mobileImgPath}fwebp 2x`,o.appendChild(n)}var i=document.createElement("img");return i.srcset=`${t.imgPath}fwebp 1x, ${t.imgPath}fwebp 2x`,i.src=`${t.imgPath}fwebp`,i.alt=t.imgAlt,o.appendChild(i),o},g=function(e,t){var o=e,n=t,i="";if(o.includes("youtube.com")||o.includes("youtu.be")){let e=/(?:youtube\.com\/.*v=|youtu\.be\/)([^&?/]+)/;o.includes("live/")&&(e=/(?:youtube\.com\/.*live\/)([^?&]+)/);const t=o.match(e);t&&(videoHash=t[1])}else if(o.includes("twitch.tv")){const e=/(?:twitch\.tv\/videos\/|player\.twitch\.tv\/\?video=)([^&?/]+)/,t=o.match(e);t&&(videoHash=t[1])}else if(o.includes("bilibili.com")||o.includes("b23.tv")){const e=/(?:bilibili\.com\/video\/|b23\.tv\/)(BV[^&?/]+)/,t=o.match(e);t&&(videoHash=t[1])}else if(o.includes("facebook.com")){const e=/facebook\.com\/.*\/videos\/([0-9]+)/,t=o.match(e);t&&(videoHash=t[1])}else if(o.includes("v.qq.com")){const e=/v\.qq\.com\/x\/page\/([a-zA-Z0-9]+)/,t=o.match(e);t&&(videoHash=t[1])}return"youtube"===n?i=``:"twitch"===n?i=``:"bilibili"===n?i=``:"facebook"===n?i=``:"qq"===n&&(i=``),i},B=function(t){var o=`\n \n \n \n \n \n \n \n \n \n \n \n \n `;return"rog"===e.system&&(o=`\n \n \n `),o},f=function(t){document.querySelector("html").classList.remove("PB_fixed"),document.querySelector("body").classList.remove("PB_fixed");var o="",n="",i="",a='\n \n \n \n \n \n \n \n \n \n \n \n \n \n ',s='\n
\n \n ',r='\n \n Learn more\n \n \n \n \n \n \n \n \n \n \n \n
\n ',l='\n \n ',c=t.templateKey,d=t.positionKey;if("video"===c)o="PB_videoMode";else if("promotion"===c)o="PB_promotionMode";else if("notice"===c)o="PB_noticeMode ","overlay"===d&&(o+="PB_leftMode"),i=`\n

${t.note}

\n `;else if("offers"===c&&"noImage"===t.offersStyle.offersTypeKey){var u=t.couponCode,p=t.copyWording||"Copy",_=t.copiedWording||"Copied";o="PB_exitIntentMode",rogLineSVG='\n \n \n ',l="",r=(a='\n
\n

\n
\n ')+r+(s=`\n
\n
\n
20% Off Discount
\n
Discount on your next purchase !
\n ${"rog"==e.system?rogLineSVG:""}\n
\n
\n
\n
Coupon Code
\n
${u}
\n
\n
\n ${_}\n
\n
${p}
\n
\n
\n
\n `)}else if("offers"===c&&"embedImage"===t.offersStyle.offersTypeKey||"image"===t.offersStyle.offersTypeKey)u=t.couponCode,p=t.copyWording||"Copy",o="PB_exitIntentImgMode",a=`\n
${u}
\n
\n

\n
\n
\n
\n ${_=t.copiedWording||"Copied"}\n
\n
${p}
\n
\n `,l=`\n
\n
\n ${_}\n
\n
${p}
\n
\n `,r=(s='
')+`\n
${u}
\n
\n

\n
\n `;else if("offers"===c){var v=t.offersStyle.offersTypeKey,y=t.offersStyle.offersTheme;u=t.couponCode,p=t.copyWording||"Copy",_=t.copiedWording||"Copied",o="PB_offersMode","backgroundImageContentLeft"===v&&(o+=" PB_offersLeftMode"),"rog"!==e.system&&"dark"===y?o+=" PB_blackMode":"rog"===e.system&&"light"===y&&(o+=" PB_lightMode"),s="",n='
',a=`\n
${u}
\n
\n

\n
\n
\n
\n ${_}\n
\n
${p}
\n
\n `}var m="";"lowerRightCorner"===d?m=`\n \n `:"overlay"===d&&(m=`\n \n `,document.querySelector("html").classList.add("PB_fixed"),document.querySelector("body").classList.add("PB_fixed"));var g=document.createElement("div");return g.innerHTML=m,document.querySelector("body").appendChild(g),g};document.querySelector("body")?l():document.addEventListener("DOMContentLoaded",l)}();