1"use strict";(self.webpackChunkuniversity_of_glasgow=self.webpackChunkuniversity_of_glasgow||[]).push([[1902],{36623:function(t,e,a){a.r(e),a.d(e,{default:function(){return RelatedByTag}});var n=a(55498),i=a(7103);class RelatedByTag{constructor(t){this.el=t,this.category=this.el.dataset.tagCategory,this.tagPage=this.el.dataset.tagPage,window.tagconf&&(console.log(window.tagconf),this.tagPage=window.tagconf.tag_page),this.feedurl=`/feeds/tags/index.html/category/${this.category}/filter/`,this.currenturi=window.location.pathname,this.numberofitems=100,this.tagsarray=this.el.dataset.tagsByValue?this.el.dataset.tagsByValue.includes("|")?this.el.dataset.tagsByValue.split("|"):this.el.dataset.tagsByValue.split(","):[],this.tags=this.tagsarray.join("/"),this.taglinks=[],this.tags&&this.outputtags()}outputtags(){let t=[];this.tagsarray.forEach((e=>{if(e&&""!=e){if(e.includes(">")){const t=e.split(">");e=t[t.length-1]}t.push(`<a class="button reltag" href="${this.tagPage}?category=${encodeURIComponent(this.category.trim())}&tags=${encodeURIComponent(e.trim())}">${e.trim()}</a>`)}}));const e=n.A.tile({heading:"Tags",content:t.join(""),span:"12",backgroundclass:"TileBackgroundAlt2",extraclasses:"related-by-tag-container no-bullet",fullwidthtext:!0});this.el.insertAdjacentHTML("afterend",e),function getTiles(){return a.e(9715).then(a.bind(a,14168)).then((({default:t})=>t)).catch((t=>"An error occurred while loading the component"))}().then((t=>{new t(".related-by-tag-container");let e=0,a=!1;i.A.lazyloadimages(),window.addEventListener("scroll",(function(t){e=window.pageYOffset,a||(window.requestAnimationFrame((function(){i.A.lazyloadimages(),a=!1})),a=!0)}))}))}getrelated(){this.tagsarray.forEach((t=>{fetch(`${this.feedurl}${t}/${this.numberofitems}`).then((t=>t.json())).then((e=>{e.length>0&&this.insertrelated(e,t)}))}))}insertrelated(t,e){let s=[];t.results.forEach((t=>{t.url!==this.currenturi&&s.push(`<a class="button tag" href="${t.url}">${t.section_name}</a>`)}));const r=n.A.accordion({heading:e,headingtype:"h3",content:s.join("")}),o=n.A.tile({heading:"Related content",content:r,span:"12",backgroundclass:"TileBackgroundAlt2",extraclasses:"related-by-tag-container",fullwidthtext:!0});this.el.insertAdjacentHTML("afterend",o),document.querySelector(".related-by-tag-container")&&function getTiles(){return a.e(9715).then(a.bind(a,14168)).then((({default:t})=>t)).catch((t=>"An error occurred while loading the component"))}().then((t=>{new t(".related-by-tag-container");let e=0,a=!1;i.A.lazyloadimages(),window.addEventListener("scroll",(function(t){e=window.pageYOffset,a||(window.requestAnimationFrame((function(){i.A.lazyloadimages(),a=!1})),a=!0)}))})),document.querySelector(".racc")&&function getAccordion(){return Promise.resolve().then(a.bind(a,6756)).then((({default:t})=>t)).catch((t=>"An error occurred while loading the component"))}().then((t=>{new t("racc")}))}}}}]); 2//# sourceMappingURL=gu-relatedbytag.d1694f8e.js.map
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.