/*! Static Override Utilities */ (()=>{window.SOUtil=window.SOUtil||{addStylesheet:(cssStyles,overrideId)=>{const style=document.createElement("style");if(overrideId){style.id="static-override-"+overrideId}style.appendChild(document.createTextNode(cssStyles));document.head.appendChild(style)},pageIsInScope:pageScope=>{const host=location.hostname.toLowerCase();const path=location.pathname.toLowerCase();const locale=document.documentElement.lang.toLowerCase();const getMarket=marketAware=>{const locale=document.documentElement.lang.toLowerCase();const langCode=locale.split("-")[0];const market=new URLSearchParams(location.search).get("market")?.toLowerCase();if(market&&marketAware!==false){return`${langCode}-${market}`}return locale};const langLocs={"sr-rs":["sr-rs","sr-latn-rs","sr-cyrl-rs"],default:[locale]};const possibleLangLocs=langLocs[locale]||langLocs.default;const pathLocale=possibleLangLocs.find(loc=>path.indexOf(loc)!==-1);const pathNoLocale=path.replace(`/${pathLocale}`,"").replace(/\/$/,"");const previewHosts=["sites-author.adobeprod.microsoft.com","sites-author.adobeppe.microsoft.com","sites-author.adobestg.microsoft.com","sites-author.adobedev.microsoft.com","author-p147723-e1510601.adobeaemcloud.com","golf-author.adobeprod.microsoft.com","author-p147723-e1510635.adobeaemcloud.com","golf-author.adobestg.microsoft.com","author-p147723-e1520828.adobeaemcloud.com","golf-author.adobeppe.microsoft.com","author-p147723-e1510634.adobeaemcloud.com","golf-author.adobedev.microsoft.com","echo-author.adobeprod.microsoft.com","echo-author.adobeppe.microsoft.com","echo-author.adobestg.microsoft.com"];const isPreview=pageScope.previews&&previewHosts.includes(host);const previewPathStarts={"/content/microsoft/bade":"www.microsoft.com","/content/azure/acom":"azure.microsoft.com"};const nonprodHost={"wwwppe.microsoft.com":"www.microsoft.com","wwwqa.microsoft.com":"www.microsoft.com","origin.azureppe.microsoft.com":"azure.microsoft.com","origin.azureprod.microsoft.com":"azure.microsoft.com"};if(pageScope.editorOnly&&!window.frameElement?.baseURI.includes("/editor.html")){return false}let checkHost=host;let checkMarket=getMarket(pageScope.marketAware);let checkPath=pathNoLocale;if(pageScope.editorOnly||isPreview){const pathWithoutLaunch=path.replace(/\/content\/launches(\/[^\/]+){4}/g,"");const previewPathStart=Object.keys(previewPathStarts).find(key=>pathWithoutLaunch.startsWith(key));checkHost=previewPathStarts[previewPathStart];if(!previewPathStart||!checkHost){return false}checkPath=pathWithoutLaunch.replace(previewPathStart,"").replace(`/${pathLocale}`,"").replace(".html","")}if(nonprodHost[host]){checkHost=nonprodHost[host]}const hostScope=pageScope[checkHost];if(!hostScope){return false}if(hostScope.markets&&!hostScope.markets.includes(checkMarket)){return false}if(hostScope.paths&&!hostScope.paths.includes(checkPath)&&!(hostScope.allSubpaths&&startsWithPath())){return false}function startsWithPath(){return hostScope.paths.some(path=>checkPath.startsWith(path))}return true},runOnPageLoad:callback=>{if(document.readyState!=="loading"){callback()}else{document.addEventListener("DOMContentLoaded",callback)}},elementPromise:function(props){function addElementMarking(el,attr,value){if(hasElementMarking(el,attr,value))return;const markings=getElementMarkings(el,attr);markings.push(value);el.setAttribute(attr,markings)}function hasElementMarking(el,attr,value){return getElementMarkings(el,attr).includes(value)}function getElementMarkings(el,attr){let ret=el.getAttribute(attr);return ret?ret.split(","):[]}const querySelector=props.selector;const callbackName=props.callback.name;const rejectTime=props.rejectTime?props.rejectTime:0;const foundForDataAttr="data-so-found-for";return new Promise((resolve,reject)=>{if(!querySelector){return reject("No element or no query selector provided")}let wasFound=false;if(document.querySelector(querySelector)){wasFound=true;if(props.multiple){document.querySelectorAll(querySelector).forEach(e=>addElementMarking(e,foundForDataAttr,callbackName))}}if(!wasFound||props.multiple){const observerConfig={attributes:true,childList:true,characterData:true,subtree:true};const observer=new MutationObserver(mutations=>{const instancesFound=document.querySelectorAll(querySelector);const newInstancesFound=[...instancesFound].filter(e=>{if(hasElementMarking(e,foundForDataAttr,callbackName)){return false}addElementMarking(e,foundForDataAttr,callbackName);return true});if(newInstancesFound.length>0){wasFound=true;if(!props.multiple){observer.disconnect()}props.callback(props)}});if(rejectTime>0){window.setTimeout(()=>{observer.disconnect();if(!wasFound){reject(querySelector)}},rejectTime*100)}observer.observe(document,observerConfig)}if(wasFound){return resolve(document.querySelector(querySelector))}})},getElements:function(props){function getElement(props){const selector=props.selector;const baseElement=props.selectElement??document;if(!selector){return null}const element=baseElement.querySelector(selector);return element}function getElementMarkings(el,attr){let ret=el.getAttribute(attr);return ret?ret.split(","):[]}function addElementMarking(el,attr,value){if(hasElementMarking(el,attr,value))return;const markings=getElementMarkings(el,attr);markings.push(value);el.setAttribute(attr,markings)}function hasElementMarking(el,attr,value){return getElementMarkings(el,attr).includes(value)}const modifiedForDataAttr="data-so-modified-for";const callbackName=props.callback.name;if(props.multiple!==true){const el=getElement(props);return el?[el]:[]}const baseElement=props.selectElement??document;var elements=Array.from(baseElement.querySelectorAll(props.selector));if(props.selectorFilter&&typeof props.selectorFilter==="function"){elements=elements.filter(props.selectorFilter)}elements=elements.filter(e=>{if(hasElementMarking(e,modifiedForDataAttr,callbackName)){return false}addElementMarking(e,modifiedForDataAttr,callbackName);return true});return elements},hasTheme:themeName=>{const links=document.querySelectorAll(`link[rel="stylesheet"][href*="themes/${themeName}"]`);return Array.from(links).some(link=>{const url=new URL(link.href,document.baseURI);const segment=url.pathname.split("/themes/")[1];return segment===themeName||segment?.startsWith(`${themeName}.`)||segment?.startsWith(`${themeName}/`)})}}})(); /*! 1079427, 1081549 - Store Homepage style issues */ (()=>{function storeUpdates(){let overrideId="1079427";const styleText=` reimagine-logo-footer reimagine-badge { padding-inline: 8px; padding-block: 8px; width: 48px; max-width: 48px; height: 48px; max-height: 48px; cursor: pointer !important; } reimagine-featured reimagine-card-feature::part(card-feature__content-body) { margin-block-end: var( --ds-card-feature-content-body-margin-block-end, var(--ds-spacing-2xl) ); } reimagine-carousel reimagine-card-banner { margin-block-end: 0; } reimagine-secondary-nav-item { --ds-secondary-nav-quicklinks-link-font-size: var(--ds-label-l-font-size); } `;window.SOUtil.addStylesheet(styleText,overrideId);const announcementBanner=document.querySelector("reimagine-announcement");if(announcementBanner){announcementBanner.setAttribute("role","alert");announcementBanner.setAttribute("aria-label","Announcement banner")}const featured=document.querySelectorAll('reimagine-featured[configuration="4-col-even-1"]');if(featured.length>0){featured.forEach(el=>el.setAttribute("configuration","4-col-even-2"))}const logoFooter=document.querySelector("reimagine-logo-footer");if(logoFooter){logoFooter.setAttribute("role","navigation");logoFooter.setAttribute("aria-label","Follow Microsoft")}}window.SOUtil.runOnPageLoad(storeUpdates)})(); /*! 1082330 - Multiple overrides for consumer/stores deals page */ (async()=>{let overrideId="1082330";const styleText=` reimagine-tabs[alignment="center"] { --ds-scrollslider-justify-content: center; } @media (max-width: 859.98px) { reimagine-card-banner.so-1082330 { height: 100%; --ds-card-banner-top-flex: 0; } reimagine-card-banner::part(card-banner__content-footer) { margin-top: auto; } } `;window.SOUtil.addStylesheet(styleText,overrideId);const cardPromosMedias=document.querySelectorAll("reimagine-card-promo reimagine-media");cardPromosMedias.forEach(media=>{media.setAttribute("object-fit","cover");media.style.setProperty("--ds-media-height","100%")});await customElements.whenDefined("reimagine-featured");const featured=document.querySelectorAll("reimagine-featured");if(featured){featured.forEach(item=>{if(!item)return;const cardFeature=item.querySelectorAll("reimagine-card-feature");if(cardFeature){cardFeature.forEach(card=>{const videoMedia=card.querySelector("reimagine-media[video]");if(videoMedia){videoMedia.style.setProperty("--ds-media-border-end-end-radius","var(--ds-radii-m)");videoMedia.style.setProperty("--ds-media-border-start-end-radius","var(--ds-radii-m)");videoMedia.style.setProperty("--ds-media-border-start-start-radius","var(--ds-radii-m)");videoMedia.style.setProperty("--ds-media-border-end-start-radius","var(--ds-radii-m)")}})}})}await customElements.whenDefined("reimagine-tabs");const tabs=document.querySelectorAll("reimagine-tabs");if(tabs){tabs.forEach(item=>{if(!item)return;function hideDropdownLabel(dropdown){if(!dropdown)return;const dropdownLabel=dropdown.querySelector('span[slot="dropdown-trigger__input-label"]');if(dropdownLabel){dropdownLabel.style.setProperty("display","none")}}const initialDropdown=item.shadowRoot?.querySelector("reimagine-dropdown");hideDropdownLabel(initialDropdown);if(item.shadowRoot){const observer=new MutationObserver(()=>{const dropdown=item.shadowRoot.querySelector("reimagine-dropdown");hideDropdownLabel(dropdown)});observer.observe(item.shadowRoot,{childList:true,subtree:true})}})} /*! 1092267 - Fix placeholder text issue for pill tabs dropdown */const pillTabs=document.querySelectorAll('reimagine-tabs[configuration="pill"], reimagine-tabs[configuration="selector"]');pillTabs.forEach(pillTab=>{const tabItems=pillTab.querySelectorAll("reimagine-tab");tabItems.forEach(tabItem=>{const correspondingMenuItem=tabItem.parentElement.parentElement.parentElement;if(correspondingMenuItem&&correspondingMenuItem.tagName==="REIMAGINE-MENU-LIST-ITEM"){correspondingMenuItem.appendChild(tabItem)}});const activePillTab=pillTab.querySelector("reimagine-menu-list-item[active]")?.querySelector("reimagine-pill");const dropdownTrigger=pillTab.shadowRoot?.querySelector("reimagine-dropdown-trigger");if(!dropdownTrigger)return;if(activePillTab){const pillTabText=activePillTab.textContent.trim();dropdownTrigger.textContent=pillTabText}const dropdownItems=pillTab.querySelectorAll("reimagine-tab");dropdownItems.forEach(dropdownItem=>{dropdownItem.addEventListener("click",function(e){const pillTabText=dropdownItem.textContent.trim();dropdownTrigger.textContent=pillTabText})})});await customElements.whenDefined("reimagine-carousel-card-grid");const carouselCardGrid=document.querySelectorAll("reimagine-carousel-card-grid");if(carouselCardGrid){carouselCardGrid.forEach(item=>{if(!item)return;const cardBanner=item.querySelectorAll("reimagine-card-banner");if(cardBanner){cardBanner.forEach(card=>{card.classList.add("so-1082330")})}})}})();(()=>{let TAG="reimagine-secondary-nav-item";function queryDeep(root,selector,out){out=out||[];if(!root)return out;if(root.querySelectorAll){root.querySelectorAll(selector).forEach(function(el){out.push(el)})}let walker=root.querySelectorAll?root.querySelectorAll("*"):[];walker.forEach(function(el){if(el.shadowRoot)queryDeep(el.shadowRoot,selector,out)});return out}function processItem(item){if(!item||item.dataset.biCnPatched==="1")return;let localized=(item.textContent||"").trim();let enLabel=item.getAttribute("enLabelText")||item.getAttribute("enlabeltext")||"";if(localized)item.setAttribute("data-bi-cn",localized);if(enLabel)item.setAttribute("data-bi-ecn",enLabel);let anchor=queryDeep(item,"a")[0];if(anchor){if(localized)anchor.setAttribute("data-bi-cn",localized);if(enLabel)anchor.setAttribute("data-bi-ecn",enLabel)}}function processAll(){queryDeep(document.body||document,TAG).forEach(processItem)}function init(){if(window.customElements&&customElements.whenDefined){customElements.whenDefined(TAG).then(function(){processAll();let mo=new MutationObserver(function(){processAll()});mo.observe(document.body,{childList:true,subtree:true})})}else{processAll()}}if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",init,{once:true})}else{init()}})();(()=>{const OLD_PREFIX="/apps";const getEnv=()=>{const meta=document.querySelector("meta[reimagine-env]");const isAcom=document.location.host.includes("azure");if(isAcom)return"acom";return meta?(meta.getAttribute("reimagine-env")||"").trim():""};const rewrite=()=>{const isEditMode=(()=>{try{return window.top.location.pathname.includes("/editor.html/")}catch(e){return false}})();if(!isEditMode&&new URLSearchParams(window.location.search).has("wcmmode")){return}const env=getEnv();if(!isEditMode&&!env){return}const newPrefix="/"+env+"/etc.clientlibs";const links=document.querySelectorAll("link[href]");Array.prototype.forEach.call(links,link=>{const href=link.getAttribute("href")||"";if(!href.includes("themes/critical")&&!href.includes("themes/deferred")){return}if(!href.startsWith(OLD_PREFIX)){return}const newHref=isEditMode?"/etc.clientlibs"+href.slice(OLD_PREFIX.length):newPrefix+href.slice(OLD_PREFIX.length);link.setAttribute("href",newHref);console.log(`replacing ${href} with ${newHref}`)})};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",rewrite)}else{rewrite()}})();