PageSourceSearch

https://oktagonmma.com/_next/static/chunks/pages/fantasy/discord-callback-b0eec2f0bfe5f475.js

js oktagonmma.com collected 2026-09-24 22:54:37 UTC 11,047 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4c577590-04e3-4930-94a9-5a19697131d3",e._sentryDebugIdIdentifier="sentry-dbid-4c577590-04e3-4930-94a9-5a19697131d3")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7337],{24433:(e,t,a)=>{"use strict";a.d(t,{Ao:()=>h,BW:()=>u,C8:()=>c,Eu:()=>y,GK:()=>o,Gh:()=>g,Jw:()=>x,My:()=>d,P4:()=>A,V:()=>f,W$:()=>i,j8:()=>m,kJ:()=>v,nA:()=>l,ov:()=>n,rz:()=>b,tk:()=>k,ub:()=>w,wi:()=>p});var s=a(60336),r=a(91799);let i=async e=>{try{return(await r.oktApiAxiosClient.get("/fantasy-league/profile",e)).data}catch(e){if((0,s.F0)(e)&&e?.response?.status===404)return null;throw e}},n=async(e,t)=>(await r.oktApiAxiosClient.post("/fantasy-league/profile",e,t)).data,u=async(e,t)=>(await r.oktApiAxiosClient.patch("/fantasy-league/profile",e,t)).data,o=async(e,t)=>{let a=new FormData;return a.append("cs",e),(await r.oktApiAxiosClient.post("/fantasy-league/profile/avatar",a,{...t,headers:{"Content-Type":"multipart/form-data"}})).data},l=async e=>(await r.oktApiAxiosClient.get("/fantasy-league/leagues",e)).data,c=async(e,t={},a)=>{await r.oktApiAxiosClient.post(`/fantasy-league/leagues/${e}/join`,t,a)},d=async(e,t,a)=>{if(t){if(!e)throw Error("leagueId is required");try{return(await r.oktApiAxiosClient.get(`/fantasy-league/events/${t}/vote`,{...a,params:{leagueId:e}})).data}catch(e){if((0,s.F0)(e)&&e?.response?.status===404)return null;throw e}}},y=async(e,t,a,s)=>{if(!e)throw Error("leagueId is required");return(await r.oktApiAxiosClient.patch(`/fantasy-league/events/${t}/vote`,a,{...s,params:{leagueId:e}})).data},h=async(e,t)=>(await r.oktApiAxiosClient.get("/fantasy-league/votes",{...t,params:e})).data,p=async(e,t)=>{if(!e)throw Error("leagueId is required");return(await r.oktApiAxiosClient.get("/fantasy-league/user-votes/evaluated",{...t,params:{leagueId:e}})).data},f=async(e,t)=>(await r.oktApiAxiosClient.get("/fantasy-league/leaderboard",{...t,params:e})).data,g=async e=>(await r.oktApiAxiosClient.get("/fantasy-league/leaderboard/available",e)).data,v=async(e,t)=>{if(!e)throw Error("leagueId is required");return(await r.oktApiAxiosClient.get("/fantasy-league/state",{...t,params:{leagueId:e}})).data},b=async(e,t)=>(await r.oktApiAxiosClient.get("/fantasy-league/achievements",{...t,params:e})).data,m="https://discord.gg/AJSyjqJMN6",A=async(e,t)=>(await r.oktApiAxiosClient.get("/fantasy-league/admin/profiles",{...t,params:e})).data,w=async(e,t)=>{let a=e?.leagueId===null?{...e,leagueId:"null"}:e;return(await r.oktApiAxiosClient.get("/fantasy-league/admin/achievements",{...t,params:a})).data},k=async(e,t)=>(await r.oktApiAxiosClient.get("/fantasy-league/admin/leagues",{...t,params:e})).data,x=async(e,t)=>(await r.oktApiAxiosClient.get(`/fantasy-league/admin/leagues/${e}/events`,t)).data},42947:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/fantasy/discord-callback",function(){return a(76531)}])},48938:(e,t,a)=>{"use strict";a.d(t,{n:()=>y});var s=a(53239),r=a(54713),i=a(61677),n=a(4994),u=a(53787);class o extends u.Q{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let a=this.options;this.options=this.client.defaultMutationOptions(e),(0,r.f8)(a,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(t=this.currentMutation)||t.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.currentMutation)||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:(0,i.$)(),t={...e,isLoading:"loading"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){n.j.batch(()=>
1{if(this.mutateOptions&&this.hasListeners()){var t,a,s,r,i,n,u,o;e.onSuccess?(null==(t=(a=this.mutateOptions).onSuccess)||t.call(a,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(s=(r=this.mutateOptions).onSettled)||s.call(r,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(i=(n=this.mutateOptions).onError)||i.call(n,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(u=(o=this.mutateOptions).onSettled)||u.call(o,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)})})}}var l=a(65981),c=a(13435),d=a(99734);function y(e,t,a){let i=(0,r.GR)(e,t,a),u=(0,c.jE)({context:i.context}),[y]=s.useState(()=>new o(u,i));s.useEffect(()=>{y.setOptions(i)},[y,i]);let p=(0,l.r)(s.useCallback(e=>y.subscribe(n.j.batchCalls(e)),[y]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),f=s.useCallback((e,t)=>{y.mutate(e,t).catch(h)},[y]);if(p.error&&(0,d.G)(y.options.useErrorBoundary,[p.error]))throw p.error;return{...p,mutate:f,mutateAsync:p.mutate}}function h(){}},68285:(e,t,a)=>{"use strict";a.d(t,{S:()=>o});var s=a(93182),r=a(11901),i=a(85756),n=a(53239);let u=new Set(["cs","en","de","pl"]);function o(){let e,t=(0,i.a)(),{login:a,logout:o}=t,l=(e=(0,s.useRouter)().locale,u.has(e??"")?e:"en"),c=`${window.location.pathname}${window.location.search}`,d=(0,n.useCallback)(e=>{var t;let s;return a({returnPath:(t=e?.returnPath??c,(s=(0,r.d1)(t,"/"))===`/${l}`||s.startsWith(`/${l}/`)?s:"/"===s?`/${l}`:`/${l}${s}`),uiLocale:l})},[c,l,a]),y=(0,n.useCallback)(()=>o({uiLocale:l}),[l,o]);return{...t,login:d,logout:y}}},76531:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSG:()=>b,default:()=>m});var s=a(80263),r=a(77995),i=a(6102),n=a(66329),u=a(13435),o=a(48938),l=a(60336),c=a(93182),d=a(88293),y=a(91799),h=a(53239),p=a(81322),f=a(80193),g=a(68285);let v=["fantasy-league"];var b=!0;let m=()=>{let e=(0,c.useRouter)(),[t,a]=(0,h.useState)(null),b=(0,g.S)(),m=(0,h.useRef)(!1),A=(0,u.jE)(),{t:w}=(0,p.Bd)(v),k=(0,o.n)(e=>y.oktApiAxiosClient.post(`/fantasy-league/discord/link?dc-oauth-token=${e}`),{onSuccess:()=>{A.resetQueries(d.Aj.profile()),setTimeout(()=>{e.push("/fantasy/profile")},1e3)},onError:t=>{if((0,l.F0)(t)&&t.response?.data?.message){let e=t.response.data.message;a(Array.isArray(e)?e.join(", "):e)}else a(t instanceof Error?t.message:"Unknown error occurred");setTimeout(()=>{e.push("/fantasy/profile")},3e3)}});return(0,h.useEffect)(()=>{if(!m.current&&b.initialized&&b.authenticated){m.current=!0;{let t=new URLSearchParams(window.location.hash.substring(1)).get("access_token");t?k.mutate(t):(a("No access token found in URL"),setTimeout(()=>{e.push("/fantasy/profile")},2e3))}}},[e,b.initialized,b.authenticated]),(0,s.jsx)(f.A,{metaTitle:"Discord Authentication",disableAnnouncementBar:!0,disablePopup:!0,mainBgColor:"white","data-sentry-element":"OktLayout","data-sentry-component":"DiscordCallbackPage","data-sentry-source-file":"discord-callback.tsx",children:(0,s.jsxs)(r.A,{sx:{minHeight:"calc(100vh - 64px)"},className:"flex flex-col items-center justify-center","data-sentry-element":"Box","data-sentry-source-file":"discord-callback.tsx",children:[(0,s.jsx)(i.A,{color:"inherit",className:"my-8","data-sentry-element":"CircularProgress","data-sentry-source-file":"discord-callback.tsx"}),k.isLoading&&(0,s.jsx)(n.A,{variant:"h6",className:"mt-4",children:w("fantasy-league:profile.discord.callbackInProgress")}),!k.isLoading&&t&&(0,s.jsxs)(n.A,{variant:"h6",color:"error",className:"text-center",children:["Error: ",t]}),!k.isLoading&&k.isSuccess&&(0,s.jsx)(n.A,{variant:"h6",className:"mt-4 text-center",children:w("fantasy-league:profile.discord.callbackSuccess")})]})})}},88293:(e,t,a)=>{"use strict";a.d(t,{Aj:()=>o,OP:()=>p,QJ:()=>y,Tz:()=>g,UJ:()=>d,ay:()=>v,fJ:()=>h,n2:()=>b,ng:()=>f,pN:()=>l,wT:()=>c});var s=a(98580),r=a(13435),i=a(94090),n=a(24433),u=a(48938);let o=(0,s.DY)("fantasy-league",{profile:()=>({queryKey:["profile"],queryFn:({signal:e})=>(0,n.W$)({signal:e})}),leagues:()=>({queryKey:["leagues"],queryFn:({signal:e})=>(0,n.nA)({signal:e})}),eventVote:(e,t)=>
1({queryKey:[e,t??""],queryFn:({signal:a})=>(0,n.My)(e,t,{signal:a})}),votes:e=>({queryKey:[e??{}],queryFn:({signal:t})=>(0,n.Ao)(e,{signal:t})}),userEvaluatedVotes:e=>({queryKey:[e],queryFn:({signal:t})=>(0,n.wi)(e,{signal:t})}),leaderboard:e=>({queryKey:[e],queryFn:({signal:t})=>(0,n.V)(e,{signal:t})}),leaderboardAvailableLeaguesAndEvents:()=>({queryKey:["available-leagues-and-events"],queryFn:({signal:e})=>(0,n.Gh)({signal:e})}),state:e=>({queryKey:[e],queryFn:({signal:t})=>(0,n.kJ)(e,{signal:t})}),userAchievements:e=>({queryKey:[e],queryFn:({signal:t})=>(0,n.rz)(e,{signal:t})})}),l=e=>{e.invalidateQueries({queryKey:o.eventVote._def}),e.invalidateQueries({queryKey:o.votes._def}),e.invalidateQueries({queryKey:o.userAchievements._def})},c=e=>{let t=(0,r.jE)();return(0,u.n)(e=>{let{leagueId:t,joinPassword:a}="string"==typeof e?{leagueId:e,joinPassword:void 0}:e;return(0,n.C8)(t,{joinPassword:a})},{onSuccess:()=>{t.invalidateQueries(o.profile().queryKey),t.invalidateQueries(o.leagues().queryKey),e?.onSuccess?.()},onError:t=>{e?.onError?.(t)}})},d=e=>(0,i.I)({...o.profile(),...e}),y=e=>(0,i.I)({...o.leagues(),...e}),h=(e,t,a)=>(0,i.I)({...o.eventVote(e??"",t),...a,enabled:!!e&&!!t&&(a?.enabled??!0)}),p=(e,t)=>(0,i.I)({...o.leaderboard(e??{leagueId:""}),...t,enabled:!!e?.leagueId&&(t?.enabled??!0),keepPreviousData:!0}),f=e=>(0,i.I)({...o.leaderboardAvailableLeaguesAndEvents(),refetchOnMount:"always",...e}),g=(e,t)=>(0,i.I)({...o.userEvaluatedVotes(e??""),...t,enabled:!!e&&(t?.enabled??!0)}),v=(e,t)=>(0,i.I)({...o.state(e??""),...t,enabled:!!e&&(t?.enabled??!0)}),b=(e,t)=>(0,i.I)({...o.userAchievements(e??{showUnowned:!0}),...t,enabled:!!e&&(t?.enabled??!0)});(0,s.DY)("fantasy-league-admin",{profiles:e=>({queryKey:[e??{}],queryFn:({signal:t})=>(0,n.P4)(e,{signal:t})}),leagues:e=>({queryKey:[e??{}],queryFn:({signal:t})=>(0,n.tk)(e,{signal:t})}),leagueEvents:e=>({queryKey:[e],queryFn:({signal:t})=>(0,n.Jw)(e,{signal:t})}),achievements:e=>({queryKey:["achievements",e??{}],queryFn:({signal:t})=>(0,n.ub)(e,{signal:t})})})}},e=>{e.O(0,[332,8533,8808,4878,4619,7940,6632,597,2996,5963,5469,193,636,6593,8792],()=>e(e.s=42947)),_N_E=e.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.