Search Results
");const o=r.body.firstChild.content,i=r.createTreeWalker(o),c=new WeakMap([[o,e]]);let a,l=null,s=null,d=!1,m=null;return{write(t){r.write(t),l&&!m&&(c.get(l).data=l.data),function t(){let r;if(d){const t=i.currentNode;for(s&&(i.currentNode=s);r=i.nextNode();){const t=getPreloadLink(s=r);t&&(t.onload=t.onerror=(()=>e.removeChild(t)),e.insertBefore(t,n))}i.currentNode=t}else{for(;r=i.nextNode();){const o=document.importNode(r,!1),i=l;r.nodeType===Node.TEXT_NODE?l=r:(l=null,isBlocking(o)&&(d=!1,o.parentNode&&t()));const a=c.get(r.parentNode);if(c.set(r,o),isInlineHost(a)?m=a:(appendInlineTextIfNeeded(i,m),m=null,a===e?e.insertBefore(o,n):a.appendChild(o)),d)return t()}a&&a()}}()},abort(){d&&c.get(i.currentNode).remove()},close:()=>(appendInlineTextIfNeeded(l,m),d?new Promise(e=>a=e):Promise.resolve())}}function isBlocking(e){return e.nodeType===Node.ELEMENT_NODE&&("SCRIPT"===e.tagName&&e.src&&!(e.noModule||"module"===e.type||e.hasAttribute("async")||e.hasAttribute("defer"))||"LINK"===e.tagName&&"stylesheet"===e.rel&&(!e.media||matchMedia(e.media).matches))}function getPreloadLink(e){let t;if(e.nodeType===Node.ELEMENT_NODE){switch(e.tagName){case"SCRIPT":e.src&&!e.noModule&&((t=document.createElement("link")).href=e.src,"module"===e.getAttribute("type")?t.rel="modulepreload":(t.rel="preload",t.as="script"));break;case"LINK":"stylesheet"!==e.rel||e.media&&!matchMedia(e.media).matches||((t=document.createElement("link")).href=e.href,t.rel="preload",t.as="style");break;case"IMG":(t=document.createElement("link")).rel="preload",t.as="image",e.srcset?(t.imageSrcset=e.srcset,t.imageSizes=e.sizes):t.href=e.src}t&&(e.integrity&&(t.integrity=e.integrity),e.crossOrigin&&(t.crossOrigin=e.crossOrigin))}return t}function appendInlineTextIfNeeded(e,t){e&&t&&t.appendChild(e)}function isInlineHost(e){const{tagName:t}=e;return"SCRIPT"===t&&!e.src||"STYLE"===t}