1const STORAGE_KEY="stspCustomerType",SHOW_CLASS="_show",BODY_MODAL_CLASS="_has-modal";function getBaseUrl(){return window.BASE_URL||"/"}function pushOrganisationType(e){window.dataLayer=window.dataLayer||[],window.dataLayer.push({organisationType:e,event:"organisation_type"})}function getOverlay(){let e=document.querySelector(".modals-overlay");return e||(e=document.createElement("div"),e.className="modals-overlay",document.body.appendChild(e)),e}function openModal(e){e.hidden=!1,e.classList.add("_show"),e.setAttribute("aria-hidden","false"),e.style.zIndex="902",document.body.classList.add("_has-modal"),getOverlay().style.display="block"}function closeModal(e){e.hidden=!0,e.classList.remove("_show"),e.setAttribute("aria-hidden","true"),e.style.zIndex="",document.body.classList.remove("_has-modal");const t=document.querySelector(".modals-overlay");t&&(t.style.display="none")}function toggleVatMode(e){window.dispatchEvent(new CustomEvent("wwl:set-vat-mode",{detail:{type:e?"including":"excluding"}}))}async function persistOrganisationType(e,t){const o=t.dataset.endpoint||getBaseUrl()+"rest/V1/wwl/organisation-type",n=t.dataset.switchUrl||getBaseUrl()+"switch";let a=await fetch(o,{method:"POST",credentials:"include",headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/json"},body:JSON.stringify({organisationType:e})});a=await a.json(),"string"==typeof a&&(a=JSON.parse(a)),a.shouldRefresh&&(window.location.href=n)}function notifyCelebrus(e){window.celebrusSendJsonData&&window.celebrusSendJsonData({events:[{eventType:"CustomerTypePopup",eventGroup:"Datalayer",CustomEventName:"CustomerTypePopup",CustomerTypeClick:e}]},2)}function initOrganisationTypePopup(){const e=document.getElementById("organisation-type-popup-modal");if(!e)return;document.body.appendChild(e);const t=window.localStorage.getItem(STORAGE_KEY);function o(){window.localStorage.getItem(STORAGE_KEY)||openModal(e)}t&&pushOrganisationType(t),window.addEventListener("wwl-organisation-type-popup-set",async t=>{const o=t.detail?.organisation_type;
1if(o){window.localStorage.setItem(STORAGE_KEY,o),toggleVatMode("P"===o),pushOrganisationType(o),notifyCelebrus(o),closeModal(e);try{await persistOrganisationType(o,e)}catch(e){console.error(e)}}}),t||o(),window.addEventListener("UC_UI_VIEW_CHANGED",e=>{"NONE"===e.detail?.view&&o()})}initOrganisationTypePopup();
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.