1"use strict";(()=>{(()=>{let l=!1;[{event:"spot-im-login-start",handler:a},{event:"spot-im-renew-sso",handler:a,options:!1},{event:"spot-im-api-ready",handler:p,options:!1},{event:"spot-im-user-logout",handler:f,options:!1},{event:"spot-im-clicked-settings",handler:I,options:!1}].forEach(({event:e,handler:n,options:o})=>{document.addEventListener(e,n,o)});async function p(){if(l||!window.SPOTIM)return;l=!0;let e=c(),n=h(),o=await u(),t=new URLSearchParams(window.location.search);if(t.get("u")==="1"){a(),t.delete("u");let v=`${window.location.origin}${window.location.pathname}?${t.toString()}`;return window.history.replaceState({},"",v)}let i=o?.openWebInfo?.success,r=o?.openWebInfo?.user,d=n?.data,s=d?.isRegistered,S=d?.id,m=d?.displayName,g=e.spotim_user_logout==="true",P=!o&&s,O=!r&&s,U=!s&&!g,R=S!==r?.spotim_user_id,L=m!==r?.display_name,B=U||R||L;if(P||O)return _();if(i)B&&a();else return}function f(){document.cookie="spotim_user_logout=true; path=/",window.user=null}function _(){window.SPOTIM.logout(),document.cookie="spotim_page_logout=true; path=/",window.user=null}function c(){return document.cookie.split(";").reduce((e,n)=>{let[o,t]=n.split("=").map(i=>i.trim());return e[o]=t,e},{})}function E(){return Object.fromEntries(Object.entries(localStorage))}function h(){let e=E();try{return e.SPOTIM_CURRENT_USER?JSON.parse(e.SPOTIM_CURRENT_USER):null}catch(n){return console.error("Failed to parse SPOTIM_CURRENT_USER",n),null}}function I(e){e?.preventDefault?.();let n=c();return window.location.href=`${n.OPEN_WEB_API_BASE_URL||window.location.origin}/settings/openweb?xurl=${encodeURIComponent(window.location.href)}`}async function u(){let e=c();if(w(e)){if(window.user)return window.user;try{let n=c(),o=new URL(`${n.OPEN_WEB_API_BASE_URL||window.location.origin}/api/authex/openweb/user`);n.OPEN_WEB_API_BASE_URL&&o.searchParams.append("pid",n.pid);let t=await fetch(o,{method:"GET",...!n.OPEN_WEB_API_BASE_URL&&{credentials:"include",mode:"cors"}});if(!t.ok)throw new Error(`Network response was not ok: ${t.status}`);let i=await t.json();return window.user=i,i}catch(n){console.error("Error fetching user info:",n);return}}}function w(e){return e?.pid?e.pid[0]==="L":!1}function a(){let e=c();if(document.cookie="spotim_user_logout=false; path=/",!w(e))return window.location.href=`${e.OPEN_WEB_API_BASE_URL||window.location.origin}/login?mpid=40842&xurl=${encodeURIComponent(window.location.href)}`;let n=async(o,t)=>{try{let i=await u();if(!i?.custId)return window.location.href=`${e.OPEN_WEB_API_BASE_URL||window.location.origin}/login?mpid=40842&xurl=${encodeURIComponent(window.location.href)}`;if(!i?.openWebInfo?.success)return window.location.href=`${e.OPEN_WEB_API_BASE_URL||window.location.origin}/settings/openweb?xurl=${encodeURIComponent(window.location.href)}`;let r=new URL(`${e.OPEN_WEB_API_BASE_URL||window.location.origin}/api/authex/openweb`);e.OPEN_WEB_API_BASE_URL&&r.searchParams.append("pid",e.pid);let s=await(await fetch(r,{method:"POST",body:JSON.stringify({codeA:o}),...!e.OPEN_WEB_API_BASE_URL&&{credentials:"include",mode:"cors"}})).json();"codeB"in s&&t(s.codeB)}catch(i){console.error("Error in SSO callback:",i),t(null,i)}};window.SPOTIM.startSSO&&window.SPOTIM.startSSO({callback:n,userId:e.pid}).then(o=>{document.dispatchEvent(new CustomEvent("openweb-login-success",{detail:o}))}).catch(o=>{document.dispatchEvent(new CustomEvent("openweb-login-error",{detail:o})),console.error({error:o})})}(()=>{let e=0;if(window.SPOTIM)document.dispatchEvent(new Event("spot-im-api-ready"));else{let n=setInterval(()=>{window.SPOTIM&&(clearInterval(n),document.dispatchEvent(new Event("spot-im-api-ready"))),e+=1,e>40&&(clearInterval(n),console.warn("SPOTIM not available after 10 seconds"))},250)}})()})();})();
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.