PageSourceSearch

https://www.tech21.com/cdn/shop/t/164/assets/bao-section-renderer.js?v=44086128012842186331790241087

js tech21.com collected 2026-09-24 09:49:30 UTC 2,925 bytes, 2 lines download raw bytes

1window.BAO.sectionRenderer=new class{async fetch(sections,sectionsUrl=this.sectionsUrl){typeof sections=="string"&&(sections=[sections]);const[path,querystring=""]=sectionsUrl.split("?"),params=new URLSearchParams(querystring);return params.append("sections",sections.join(",")),(await fetch(`${path}?${params.toString()}`)).json()}async fetchSingle(section,sectionsUrl=window.location.pathname){const[path,querystring=""]=sectionsUrl.split("?"),params=new URLSearchParams(querystring);return params.set("section_id",section),(await fetch(`${path}?${params.toString()}`)).text()}render(section){if("dontRender"in section&&section.dontRender)return;this.validate(section);const elementToReplace=document.getElementById(section.id)?.querySelector(section.selector)||document.getElementById(section.id);if(!elementToReplace){console.info(`Can't find ${section.id} even though we are trying to render it`);return}const newHTML=this.getOuterHtml(section.html,{id:section.id,selector:section.selector}),oldHTML=elementToReplace.outerHTML;elementToReplace.outerHTML=typeof section.convertor=="function"?section.convertor(oldHTML,newHTML):newHTML}renderMultiple(sections){sections.forEach(section=>this.render(section))}getOuterHtml(html,{id="",selector=".shopify-section"}={}){const dom=this.convertToDOM(html);return(dom.getElementById(id)?.querySelector(selector)||dom.getElementById(id))?.outerHTML}getInnerHtml(html,selector=".shopify-section"){return this.convertToDOM(html).querySelector(selector).innerHTML}convertToDOM(html){return new DOMParser().parseFromString(html,"text/html")}validate(section){const isValid=this.expectedKeys.every(key=>key in section);if(!isValid)throw new Error(`section is missing these keys: "${this.expectedKeys.filter(k=>!(k in section)).join(", ")}"`);return isValid}get expectedKeys(){return["id","selector","html"]}get sectionsUrl(){return`${window.location.pathname}${window.location.search}`}get pushCartSections(){return[{id:"push-cart-shipping",section:"push-cart-shipping",selector:".shopify-section"},{id:"push-cart-items",section:"push-cart-items",selector:".shopify-section"},{id:"push-cart-footer",section:"push-cart-footer",selector:".shopify-section"},{id:"push-cart-count",section:"push-cart-count",selector:".shopify-section",dontRender:!0},{id:"push-cart-recommendations",section:"push-cart-recommendations",selector:".shopify-section"}]}get cartSections(){return[{id:"push-cart-count",section:"push-cart-count",selector:".shopify-section",dontRender:!0},{id:"template-cart-items",section:document.getElementById("template-cart-items").dataset.id,selector:".js-Contents"},{id:"template-cart-footer",section:document.getElementById("template-cart-footer").dataset.id,selector:".js-Contents"}]}get sectionsUrl(){return`${window.location.pathname}${window.location.search}`}};
2//# sourceMappingURL=/cdn/shop/t/164/assets/bao-section-renderer.js.map?v=44086128012842186331790241087

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.