PageSourceSearch

https://www.tate.org.uk/static/js/TateSchoolSearch.30ec4e2da58ca4862044.chunk.js

js tate.org.uk collected 2026-09-24 08:25:25 UTC 3,737 bytes, 1 lines download raw bytes

1(self.webpackChunktate=self.webpackChunktate||[]).push([[675],{21426:function(e,t,n){"use strict";n.r(t);var o=n(34963),l=n(44828),c=n.n(l),r=n(66512),s=n.n(r),a=n(11393),d=n.n(a);t.default=function(){if(document.querySelector(".container__teacher-signup")){var e=document.getElementById("tessitura_ref"),t=document.querySelector(".school_postcode_search"),n=document.querySelector(".results_select_container"),l=document.querySelector(".school_address_details"),r=0,a=function(e,t){t.innerHTML="";var n=document.createElement("span");n.textContent=e,t.appendChild(n)},u=function(e){var t=e.replace(/\s+/g,"");return/^[A-Z](?:[A-HK-Y])?\d[A-Z\d]?\d[A-Z]{2}$/i.test(t)},i=function(e){return e.replace(/\s+/g,"").toUpperCase().replace(/^(.+?)([0-9][A-Z]{2})$/,"$1 $2")},p=function(){var e=(0,o.A)(c().mark(function e(t){var o,l,d;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r++,o=r,u(t)){e.next=1;break}return a("Please enter a valid UK postcode",n),v(!1),e.abrupt("return");case 1:return l=i(t),e.prev=2,e.next=3,fetch("/schools/newsletter/postcode-search?"+new(s())({postcode:l})).then(function(e){return e.json()});case 3:d=e.sent,o===r&&(m(d),v(!1)),e.next=5;break;case 4:e.prev=4,e.catch(2),a("Error loading schools data",n),v(!1);case 5:case"end":return e.stop()}},e,null,[[2,4]])}));return function(t){return e.apply(this,arguments)}}(),m=function(e){n.innerHTML="";var t=document.createElement("select");t.setAttribute("name","results-select"),t.setAttribute("id","results-select"),t.style.paddingTop="0px";var o=document.createElement("option");o.setAttribute("value","placeholder"),o.setAttribute("disabled",""),o.setAttribute("selected",""),o.setAttribute("hidden",""),o.textContent="Select your school",t.appendChild(o),e.data.length>
10&&e.data.forEach(function(e){var n,o,l=document.createElement("option");l.setAttribute("value",e.Id);var c=i(e.PostalCode);l.textContent=d()(n=d()(o="".concat(e.DisplayName," - ")).call(o,e.City," ")).call(n,c),t.appendChild(l)});var l=document.createElement("option");l.setAttribute("value","none-selected"),l.setAttribute("id","none-selected"),l.textContent="My school is not on this list",t.appendChild(l),n.appendChild(t)},h=function(){var e=document.getElementById("results-select");e&&"none-selected"===e.value?l.style.display="block":l.style.display="none"},v=function(e){document.getElementById("schools_loader").style.display=e?"block":"none"};n&&(n.addEventListener("change",function(t){if(e.setAttribute("value",t.target.value),!document.getElementById("school-select-label")){var o=document.createElement("label");o.setAttribute("id","school-select-label"),o.innerText="Your school",n.appendChild(o)}document.getElementById("results-select").style.paddingTop="20px",document.getElementById("school_postcode_btn").disabled=!1}),n.addEventListener("change",h),window.addEventListener("DOMContentLoaded",h)),t&&t.addEventListener("keyup",function(e){var t=e.target.value;t.length<3?n.innerHTML="":(v(!0),p(t))}),window.addEventListener("DOMContentLoaded",function(){var e;if(document.querySelector(".errorlist")&&(document.querySelector(".contact-details").style.display="block",null===(e=document.getElementById("contact-toggle-text"))||void 0===e||e.remove(),n)){var t=document.createElement("label");t.setAttribute("id","school-select-label"),t.innerText="Your school",n.appendChild(t)}}),document.getElementById("school_postcode_btn")&&(document.getElementById("school_postcode_btn").disabled=!0);var b=document.getElementById("results-select");b&&"none-selected"===b.value&&(document.getElementById("school_postcode_btn").disabled=!1)}}},66512:function(e,t,n){e.exports=n(48348)},48348:function(e,t,n){"use strict";var o=n(59076);n(12560),e.exports=o}}]);

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.