PageSourceSearch

https://www.stan.com.au/static/_home/immutable/chunks/CxSwRLoL.js

js stan.com.au collected 2026-09-24 08:45:16 UTC 8,461 bytes, 1 lines download raw bytes

1import{s as v,a as y,g as te,b as ne,i as A}from"./TTpzz7t7.js";import{p as K,g as re,s as f,i as oe,a as ie,b as se}from"./BdtLJM_u.js";import{b8 as ae}from"./BzUfqGd_.js";function E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)r!=="__proto__"&&(e[r]=n[r])}return e}var ce={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function O(e,t){function n(i,c,o){if(!(typeof document>"u")){o=E({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var s in o)o[s]&&(u+="; "+s,o[s]!==!0&&(u+="="+o[s].split(";")[0]));return document.cookie=i+"="+e.write(c,i)+u}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var c=document.cookie?document.cookie.split("; "):[],o={},u=0;u<c.length;u++){var s=c[u].split("="),g=s.slice(1).join("=");try{var d=decodeURIComponent(s[0]);if(d in o||(o[d]=e.read(g,d)),i===d)break}catch{}}return i?o[i]:o}}return Object.create({set:n,get:r,remove:function(i,c){n(i,"",E({},c,{expires:-1}))},withAttributes:function(i){return O(this.converter,E({},this.attributes,i))},withConverter:function(i){return O(E({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var l=O(ce,{path:"/"});const S="page:authentication";function C(e,t={}){const n=ne();switch(e){case"authentication_succeeded":{v(S,{...n,type:e}),y({event:"event",eventCategory:"authentications",eventAction:"succeeded",userId:t.userId,profileId:t.profileId});break}case"authentication_failed":{v(S,{...n,...te(t),type:e}),y({event:"event",eventCategory:"authentications",eventAction:"failed"});break}case"unauthenticated":{v(S,{...n,type:e}),y({event:"event",eventCategory:"unauthentications",eventAction:"succeeded"});break}}}async function G(){return await re("login","v1")}async function W(e,t){const n=await G(),r=new URL(e.recaptureToken?"sessions/web/account/recapture":"sessions/web/account",n);return await K(r,{params:e,isWithCredentials:!0})}async function ue(e){return W(e)}async function le(e){const t=await G(),n=new URL("sessions/guest",t);return await K(n,{params:e})}async function de(e,t){return W(e)}function j(e){let t;try{t=window[e];const n="__storage_test__";return t.setItem(n,n),t.removeItem(n),!0}catch(n){return n instanceof DOMException&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0}}const F=j("localStorage"),R=j("sessionStorage");function fe(e){return decodeURIComponent(atob(e).replace(/(.)/g,function(t,n){let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function ge(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return fe(t)}catch(n){return console.warn(n),atob(t)}}const Y="ngStorage-registerRequest",Ee="ngStorage-registerInterestRequest";function Ve(){let e="",t=!1;if(F)try{const n=localStorage.getItem(Ee);n&&(e=JSON.parse(n).emailAddress.trim(),t=!0);const r=localStorage.getItem(Y);r&&(e=JSON.parse(r).emailAddress.trim(),t=!1)}catch(n){console.warn(n)}return{emailAddress:e,isRegisterInterest:t}}function $e(e){if(F)try{const t=JSON.stringify({emailAddress:e});localStorage.setItem(Y,t)}catch(t){console.warn(t)}}const pe=/^[^@ ]*[^@., ]@[^@., ][^@ ]*\.[a-zA-Z]{2,}$/;function k(e){return typeof e=="string"&&pe.test(e)}function Je(e){try{if(k(e))return e;const t=ge(e);if(k(t))return t}catch(t){console.warn(t)}return""}async function me(e){}async function Ie(){}const _e="signup",x="email";function we(e){try{return window.sessionStorage.getItem(e)}catch(t){f(t)}return null}function he(e,t){try{return window.sessionStorage.setItem(e,t)}catch(n){f(n)}}function ve(e){try{window.sessionStorage.removeItem(e)}catch(t){f(t)}}function ye(e,t){if(R){const n=we(e);if(n!==null)try{return t?JSON.parse(n):n}catch(r){f(r)}}return null}function Se(e,t){R&&he(e,t)}function M(e){R&&ve(e)}function Oe(){M(_e)}function ze(e){Se(x,e)}function He(){return ye(x,!1)}function Xe(){M(x)}async function Ce(){}function Ae(e){return typeof e=="string"&&/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.\S+$/.test(e)}function q(e){try{if(!Ae(e))throw new Error("invalid token");const n=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(window.atob(n).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(r)}catch(t){return console.warn(t),{}}}const a=[];for(let e=0;e<256;++e)a.push((e+256).toString(16).slice(1));
1function Re(e,t=0){return(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase()}const xe=new Uint8Array(16);function Te(){return crypto.getRandomValues(xe)}function Ue(e,t,n){return crypto.randomUUID?crypto.randomUUID():be(e)}function be(e,t,n){e=e||{};const r=e.random??e.rng?.()??Te();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Re(r)}var Le={};const V="stan.com.au",$="/",Pe=90,T="streamco_uid",U="streamco_profileid",b="streamco_token",J="streamco_profile_expiry",z={path:$,domain:V,secure:!0,sameSite:"strict",expires:Pe},Ne={path:$,domain:V};function p(e,t){try{l.set(e,t,z)}catch(n){console.error(n)}}function m(e){try{l.remove(e,Ne)}catch(t){console.error(t)}}function ke(e){try{const t=l.get(T),n=l.get(U),r=l.get(b),i=Le.ENABLE_CONTENT_BEFORE_PAYWALL==="true"&&!n&&!t&&!!r&&q(r).role==="guest";if((n||t||i)&&r)return{userId:t||"",profileId:n||"",jwToken:r||""}}catch(t){console.error(t)}return!1}function De(e,t){p(T,e.userId),p(U,e.profileId),p(b,e.jwToken),t?.isSaveProfileExpiryCookie&&e.profileExpiry&&p(J,String(e.profileExpiry))}function Be(){m(T),m(U),m(b),m(J)}const Ke=365*10,D="streamco_device_id";function H(){try{let e=l.get(D);return e||(e=Ue(),l.set(D,e,{...z,expires:Ke})),e}catch(e){return console.error(e),""}}var I={};const Ge="https://www.stan.com.au";async function We({userId:e,jwToken:t,profileId:n,isKidsProfile:r}){A({userId:e,jwToken:t,profileId:n,isKidsProfile:r}),ie(e)}async function je(e){return null}async function Fe(){if(I.ENABLE_CONTENT_BEFORE_PAYWALL==="true")try{const{guestBrowsingAvailable:e}=await se();return e}catch(e){console.warn("Failed to load guest browsing status",e)}return!1}async function B(e,t,n,r,i){try{const c=!!e.email,o={clientId:H(),source:"www",stanName:"Stan-Web",appName:"Stan-Web",...e},u=await(c?ue({...o}):de({...o,...await je(),pin:i}));if(!u)throw new Error("Login request failed.");const{userId:s,profile:{id:g,expiry:d,isKidsProfile:L},jwToken:_,subscription:w,userCap:X}=u;De({userId:s,profileId:g,profileExpiry:d,jwToken:_},{isSaveProfileExpiryCookie:!!(c||t)}),await We({userId:s,jwToken:_,profileId:g,isKidsProfile:L}),C("authentication_succeeded",{userId:s,profileId:g});const P=I.ENABLE_CONTENT_BEFORE_PAYWALL==="true"&&q(_).role==="guest"&&await Fe(),h=w?.status,N=w?.active||h==="active",Z=!P&&h==="",Q=h!==""&&!N,ee=X?.includes("venues");return I.ENABLE_MOENGAGE==="true"&&await me(),{userLogin:u,isPending:Z,isVenues:ee,isCancelled:Q,isActive:N,isSport:w?.bundles?.includes("sport"),isGuest:P,isLoggedIn:!0}}catch(c){throw C("authentication_failed",{err:c}),c}}async function Ze(e,t){C("unauthenticated"),await Ie(),await Ce(),Be(),Oe(),A({}),window.location.assign(Ge)}async function Qe(e={}){const{profileId:t,isSaveProfileExpiryCookie:n,isResetSelectedProfile:r,pin:i,isThrowError:c}=e;let o=ke()||{};r&&(o.profileId=o.userId);const u=!1;if(t&&o.profileId!==t&&(o.profileId=t),A(o),oe(o.userId||""),o.jwToken)try{return await B(o,u,!1,n,i)}catch(s){if(f(s),c)throw s}else if(I.ENABLE_CONTENT_BEFORE_PAYWALL==="true")try{const{jwToken:s}=await le({clientId:H(),source:"www",stanName:"Stan-Web",appName:"Stan-Web"});return await B({userId:"",profileId:"",jwToken:s},u,!1,n,i)}catch(s){if(f(s),c)throw s}return{isLoggedIn:!1}}const et=(function(){const e={email:""},t=ae({...e});return t.reset=()=>t.set({...e}),t})();export{He as a,$e as b,Je as d,et as f,Ve as g,Ze as h,Qe as i,Xe as r,ze as s};

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.