PageSourceSearch

https://thekebabsshop.co.uk/js/home-auth.js?v=-fSk4MmDXI1uzWS4iES4YTpGYAJtEmUB49F112rPOM4

js thekebabsshop.co.uk collected 2026-10-02 02:09:43 UTC 5,967 bytes, 1 lines download raw bytes

1(function(){"use strict";var u=window.AW_AUTH||{};if(!u.issuer){delete document.documentElement.dataset.auth;return}var E="__&AccesToken&__",f="__&User&__",_="aw_auth_state",S="aw_auth_nonce",w=window.location.origin,x=window.parent!==window,k=/[#&](id_token|access_token|error)=/,m=u.scope||"";/(^|\s)openid(\s|$)/.test(m)||(m=("openid "+m).trim());var C=!1;function N(e,t){return e===t||e!=="in"}function J(e,t){var n=document.documentElement,o=n.dataset.auth||"out";return N(o,e)?(n.dataset.auth=e,window.AW_AUTH_STATE={state:e,user:t||null},document.dispatchEvent(new CustomEvent("aw:auth",{detail:window.AW_AUTH_STATE})),!0):!1}window.AW_AUTH_HELPERS={isAuthTransitionAllowed:N};function P(e){try{return JSON.parse(window.localStorage.getItem(e))}catch{return null}}function y(e,t){window.localStorage.setItem(e,JSON.stringify(t))}function R(){var e=new Uint8Array(16);return(window.crypto||window.msCrypto).getRandomValues(e),Array.prototype.map.call(e,function(t){return("0"+t.toString(16)).slice(-2)}).join("")}function j(e){try{var t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=Uint8Array.from(window.atob(t),function(o){return o.charCodeAt(0)});return JSON.parse(new TextDecoder().decode(n))}catch{return null}}function H(e){var t={};return(e||"").replace(/^#/,"").split("&").forEach(function(n){if(n){var o=n.indexOf("=");
1t[decodeURIComponent(n.slice(0,o))]=decodeURIComponent(n.slice(o+1))}}),t}function T(e){return Object.keys(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")}var h=null;function g(){return h||(h=fetch(u.issuer+"/.well-known/openid-configuration").then(function(e){return e.json()}),h)}function B(){try{return new URLSearchParams(window.location.search).get("logout")==="1"?!0:window.localStorage.getItem("aw_logout")==="1"}catch{return!1}}function K(){var e=null;try{e=window.localStorage.getItem("id_token"),window.localStorage.removeItem("aw_logout"),window.localStorage.removeItem(E),window.localStorage.removeItem(f),window.localStorage.removeItem("id_token"),window.localStorage.removeItem("__&StoreCommitment&__"),Object.keys(window.localStorage).forEach(function(n){n.indexOf("basket_")===0&&window.localStorage.removeItem(n)})}catch{}var t=u.issuer+"/connect/endsession?"+T({post_logout_redirect_uri:w});e&&(t+="&id_token_hint="+encodeURIComponent(e)),window.location.assign(t)}function M(e){var t=[];return e.FirstName&&t.push(e.FirstName),e.LastName&&t.push(e.LastName),!t.length&&e.Name&&(t=String(e.Name).split(" ")),t.slice(0,2).map(function(n){return n.charAt(0)}).join("").toUpperCase()}function d(e){if(J(e?"in":"out",e)){C=!0;var t=!!e;if(document.querySelectorAll("[data-auth-guest]").forEach(function(r){r.hidden=t}),document.querySelectorAll("[data-auth-user]").forEach(function(r){r.hidden=!t}),t){var n=e.FirstName||e.GivenName||"",o=n?"Hi "+n:e.Name||"Account";document.querySelectorAll("[data-auth-name]").forEach(function(r){r.textContent=o});var s=M(e);document.querySelectorAll("[data-auth-avatar]").forEach(function(r){r.textContent=s,r.hidden=!s}),document.querySelectorAll("[data-auth-avatar-fallback]").forEach(function(r){r.hidden=!!s})}else document.querySelectorAll("[data-auth-loyalty]").forEach(function(r){r.hidden=!0})}}function U(e){var t=H(e);if(t.error||!t.access_token||!t.id_token)return Promise.resolve(!1);var n=window.sessionStorage.getItem(_);if(!n||t.state!==n)return Promise.resolve(!1);var o=j(t.id_token),s=window.sessionStorage.getItem(S);if(!o||!s||o.nonce!==s)return Promise.resolve(!1);y(E,t.access_token);try{window.localStorage.setItem("id_token",t.id_token)}catch{}return window.sessionStorage.removeItem(_),window.sessionStorage.removeItem(S),g().then(function(r){return fetch(r.userinfo_endpoint,{headers:{Authorization:"Bearer "+t.access_token}}).then(function(c){return c.json()}).then(function(c){var p=c&&c.info;if(typeof p=="string")try{p=JSON.parse(p)}catch{}var v=p||c||{};return!v.Id&&o.sub&&(v.Id=o.sub),y(f,v),v}).catch(function(){var c={Id:o.sub,Name:o.name};return y(f,c),c})})}function I(){var e=R(),t=R();return window.sessionStorage.setItem(_,e),window.sessionStorage.setItem(S,t),{state:e,nonce:t}}function A(e,t,n){var o={client_id:u.clientId,redirect_uri:w,response_type:"id_token token",scope:m,state:t.state,nonce:t.nonce};return n&&(o.prompt="none"),e.authorization_endpoint+"?"+T(o)}function W(){(u.experience||"")==="Iframe"?Y():L()}function L(){var e=I();g().then(function(t){window.location.assign(A(t,e,!1))})}var a,l;function Y(){if(!a||!l){L();return}var e=I();g().then(function(t){l.src=A(t,e,!1),a.open||a.showModal()})}function q(){a&&a.open&&a.close(),l&&l.removeAttribute("src")}var i;function O(){i&&i.parentNode&&i.parentNode.removeChild(i),i=null}function z(){var e=I();g().then(function(t){i=document.createElement("iframe"),i.style.display="none",i.setAttribute("aria-hidden","true"),i.src=A(t,e,!0),document.body.appendChild(i),setTimeout(function(){O(),C||d(null)},6e3)}).catch(function(){d(null)})}function D(e){e.origin!==w||!e.data||e.data.type!=="aw-auth-silent"||U(e.data.hash).then(function(t){O(),q(),d(t||null)})}if(x&&(k.test(window.location.hash)||/[?&]error/i.test(window.location.search))){try{window.parent.postMessage({type:"aw-auth-silent",hash:window.location.hash},w)}catch{}return}function F(){document.querySelectorAll("[data-auth-login]").forEach(function(e){e.addEventListener("click",W)})}function b(){try{window.localStorage.setItem("aw_modern","1")}catch{}if(B()){K();return}if(a=document.getElementById("aw-login-dialog"),l=document.getElementById("aw-login-iframe"),a&&a.addEventListener("click",function(t){t.target===a&&q()}),window.addEventListener("message",D),F(),k.test(window.location.hash)){U(window.location.hash).then(function(t){history.replaceState(null,"",window.location.pathname+window.location.search),d(t||null)});return}var e=P(f);if(e){d(e);return}z()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",b):b()})();

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.