PageSourceSearch

https://www.classicalcalifornia.org/_next/static/chunks/6903.57116a660aeaf74e.js

js classicalcalifornia.org collected 2026-10-02 14:42:36 UTC 12,886 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]="cc7bfe1b-4d1a-4792-8a07-684cdd97500b",e._sentryDebugIdIdentifier="sentry-dbid-cc7bfe1b-4d1a-4792-8a07-684cdd97500b")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6903],{28702:(e,t,a)=>{a.d(t,{C:()=>C,K:()=>E});var n=a(95155),o=a(99505),s=a(12115),i=a(67884),r=a(97873);let u="https://usc-radio-group.firebaseio.com",l="G-LPQPVR4MQP",c={apiKey:"AIzaSyDQCV1J_eLr6CPrVixC-XAwlcKSYJEWC5s",authDomain:"usc-radio-group.firebaseapp.com",projectId:"usc-radio-group",storageBucket:"usc-radio-group.firebasestorage.app",messagingSenderId:"606705284432",appId:"1:606705284432:web:c6694fa6fcae48eda56855"};u&&(c.databaseURL=u),l&&(c.measurementId=l);let d=0===(0,r.Dk)().length?(0,r.Wp)(c):(0,r.Sx)(),p=async()=>await (0,o.TT)()?(0,o.dG)(d):null,h=async()=>{try{let e=await p();if(e)return(0,o.gf)(e,{vapidKey:"BBBxntZLvXnmLw0uroNiqpJAHEBvurTFHVw9KExN8zvRddaAt1ZigrN4M2hFfmX9bPHaG8nsmKQd7R2QcSieSEE"});return null}catch(e){return console.error("An error occurred while fetching the token:",e),null}};async function m(){return"Notification"in window?"granted"===Notification.permission?"granted":(console.warn("Notification permission not granted."),null):(console.warn("This browser does not support desktop notification"),null)}var f=a(99765),g=a(90729),y=a(19506),b=a(85219),w=a(37662),_=a(66195);let v=(0,s.createContext)(null),C=({children:e})=>{let t=(0,w.j)(),{setNotificationHistory:r,clearNotificationHistory:u,setNotificationCategories:l}=_.GM.actions,{notificationHistory:c,notificationFilter:d}=(0,w.G)(e=>e.globalReducer),[C,E]=(0,s.useState)(null),[I,S]=(0,s.useState)(null),[k,T]=(0,s.useState)(!1),[A,D]=(0,s.use
1State)(!1),N=(0,s.useRef)(!1),[x,L]=(0,s.useState)({allowPush:!0,allowNotificationCenter:!0}),{user:R,snapshot:P}=(0,w.G)(e=>e.authReducer),B=R?.hubspotId||P?.hubspotId||null,z=(0,b.x)(),{push:G}=(0,y.I)(),j=async(e,t)=>{try{return await z({apiEndpoint:"https://api.classicalcalifornia.org/firebase/update-user",body:{token:e,hubspotId:t},method:"POST",headers:{Authorization:`Bearer ${e}`}}),e}catch(e){return console.error("An error occurred while saving to firestore:",e),null}},$=async(e,t,a,n)=>{try{let o=(0,g.R5)("accessToken");return await z({apiEndpoint:"https://api.classicalcalifornia.org/firebase/update-notifications-status",body:{hubspotId:e,notificationIds:t,status:a,hubspotTrackData:n},method:"POST",headers:{Authorization:`Bearer ${o}`}}),o}catch(e){return console.error("An error occurred while saving to firestore:",e),null}},O=async e=>{E(e),(e||B)&&(await j(e,B),T(!0))},K=async e=>{await j(C,e.hubspotId),T(!0)},U=(e,n)=>B?$(B,e,n,{userAgent:a.g.window.navigator.userAgent,pageUrl:a.g.window.location.href,type:"browser"}).then(()=>{"CLICKED"===n&&t(r(c.map(t=>e.includes(t.id)?{...t,status:"CLICKED"}:t)))}):Promise.resolve(),M=(0,s.useCallback)(({hubspotId:e=null,filter:a})=>{let n=(0,g.R5)("accessToken");n&&e&&!N.current&&(N.current=!0,D(!0),z({apiEndpoint:(0,f.pq)(e,100,0,a),method:"GET",headers:{Authorization:`Bearer ${n}`}}).then(({data:e})=>{a||t(l(["All",...e.map(e=>e.category).filter((e,t,a)=>e&&a.indexOf(e)===t).sort((e,t)=>e.localeCompare(t))])),t(r(e))}).finally(()=>{N.current=!1,D(!1)}))},[t,z]),J=(0,s.useCallback)(e=>{M({hubspotId:B,filter:e})},[M,B]),F=(0,s.useCallback)(async()=>{if(!B)return;let e=(0,g.R5)("accessToken");z({apiEndpoint:`https://api.classicalcalifornia.org/firebase/user-permissions?hubspotId=${B}`,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}).then(({data:e})=>{L({allowPush:e?.allowPush,allowNotificationCenter:e?.allowNotificationCenter})}).catch(()=>{L({allowPush:!1,allowNotificationCenter:!1})})},[z,B]),H=(0,s.useCallback)(async e=>{if(!B)return;let t=(0,g.R5)("accessToken");L({...x,...e}),z({apiEndpoint:"https://api.classicalcalifornia.org/firebase/update-user-permissions",method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:{hubspotId:B,status:{...x,...e}}}).then(()=>{x?.allowNotificationCenter!==e?.allowNotificationCenter&&M({hubspotId:B})}).catch(()=>{L({allowPush:!1,allowNotificationCenter:!1})})},[z,M,B,x]);(0,s.useEffect)(()=>{if(!B){t(u()),T(!1),L({allowPush:!1,allowNotificationCenter:!0});return}(k||!C)&&(F().then(),M({hubspotId:B}),k&&T(!1))},[u,t,C,k,M,F,B]),(0,s.useEffect)(()=>{let e=e=>{"navigate"===e.data.action&&e.data.url&&G(e.data.url)};return navigator?.serviceWorker?.addEventListener("message",e),()=>{navigator?.serviceWorker?.removeEventListener("message",e)}},[G]),(0,s.useEffect)(()=>{let e=()=>{"visible"===a.g.window.document.visibilityState&&B&&M({hubspotId:B,filter:d})};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[M,d,B]),(0,s.useEffect)(()=>{let e=null;return(async()=>{if(!C)return;let e=await p();if(e)return(0,o.xD)(e,e=>{"granted"===Notification.permission&&(console.warn("Foreground push notification received:",e),M({hubspotId:B}))})})().then(t=>{t&&(e=t)}),()=>e?.()},[C,M,B]),(0,s.useEffect)(()=>{"Notification"in window||i.Fr||i.v1?"granted"===I&&h().then(e=>O(e)):console.warn("This browser does not support desktop notification")},[I]),(0,s.useEffect)(()=>{m().then(e=>{S(e)})},[]);let Q=(0,s.useMemo)(()=>({fcmToken:C,setHubspotIdToFirebase:K,changeNotificationStatus:U,updateUserPermissions:H,userPermissions:x,setUserPermissions:L,permission:I,setPermission:S,loadHistoryWithCategory:J,isLoadingHistory:A}),[C,K,H,x,L,I,S,J,A]);return(0,n.jsx)(v.Provider,{value:Q,children:e})},E=()=>{let e=(0,s.useContext)(v);if(!e)throw Error("useFirebaseContext must be within a FirebaseContext");return e}},54032:(e,t,a)=>{a.d(t,{A:()=>o,R:()=>n});let n=(0,a(37620).Z0)({name:"auth",initialState:{user:null,snapshot:null,status:"unknown"},reducers:{setLoggedIn(e,t){e.user={...t.payload},e.status="authenticated"},setLoggedOut(e){e.user=null,e.snapshot=null,e.status="guest"},updateUser(e,t){e.user={...e.user,...t.payload}},setAuthSnapshot(e,t){e.snapshot=t.payload},clearAuthSnapshot(e){e.snapshot=null},setAuthStatus(e,t){e.status=t.payload}}}),o=n.reducer},56903:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var n=a(95155),o=a(12115),s=a(6716),i=a(82332),r=a(64939),u=a(67117),l=a(57403),c=a(65067);let d=(0,o.memo)(()=>{let{removeLoginData:e}=(0,l.A)(),{toggleModalBaseWithName:t}=(0,u.A)(),a=(0,r.L)(),{menuRef:o}=(0,i.Vm)({isOpen:!0});return(0,n.jsx)("div",{ref:a,children:(0,n.jsxs)("div",{ref:o,className:"menu-popup",role:"menu",id:"profile-menu","aria-hidden":!1,children:[(0,n.jsx)("button",{type:"button",className:"menu-popup__action menu-popup__action--hidden",onClick:()=>t({name:s.gM.EDIT_PROFILE}),role:"menuitem",children:"Edit profile"}),(0,n.jsx)("button",{type:"button",className:"menu-popup__action menu-popup__action--round-top",onClick:e,role:"menuitem",children:"Log out"}),(0,n.jsx)(c.A,{title:"Contact Us",className:"menu-popup__action menu-popup__action--hidden sm:block"}),(0,n.jsx)("button",{type:"button",className:"menu-popup__action",onClick:()=>t({name:s.gM.DELETE_ACCOUNT}),role:"menuitem",children:"Delete my account"})]})})})},57403:(e,t,a)=>{a.d(t,{A:()=>b});var n=a(73321),o=a(12115),s=a(90903),i=a(6716),r=a(28702),u=a(89658),l=a(85135),c=a(90729),d=a(85219),p=a(44846),h=a(37662),m=a(54032),f=a(66195),g=a(67117);let y={login:"internal_auth_login_success",sign_up:"internal_auth_sign_up_success"},b=e=>{let t,a=(0,h.j)(),{toggleModalBaseWithName:b}=(0,g.A)(),w=(0,n.useRouter)(),{identifyUser:_,trackEvent:v}=(0,p.u)(),C=(0,d.x)(),{isLoading:E}=(0,h.G)(e=>e.globalReducer),{closePopup:I,clearData:S,setIsLoading:k,setGlobalNotification:T}=f.GM.actions,{setLoggedIn:A,setLoggedOut:D,updateUser:N}=m.R.actions,{clearNotificationHistory:x}=f.GM.actions,[L,R]=(0,o.useState)(""),{setHubspotIdToFirebase:P}=(0,r.K)(),{getUser:B}=(t=(0,d.x)(),{getUser:async e=>{let{data:a}=await t({apiEndpoint:"https://auth.classicalcalifornia.org/userinfo",method:"GET",headers:{Authorization:`Bearer ${e}`}}),n=a["https://usc_radio.parametrs.com/hubSpotContactID"],{data:o}=await t({apiEndpoint:`https://www.classicalcalifornia.org/api/hubspot?hubspotId=${n}&properties=lifecycle_stage,expiration_date,member_since,hs_email_optout,email`,method:"GET",headers:{Authorization:`Bearer ${e}`}});return((e,t)=>{let{id:a,...n}=t;return{providerId:e["https://usc_radio.parametrs.com/providerID"],dynamoID:e["https://usc_radio.parametrs.com/dynamoID"],email:e.email,family_name:e.family_name,given_name:e.given_name,display_name:e["https://usc_radio.parametrs.com/display_name"],hs_email_optout:t?.properties?.hs_email_optout||null,...e,hubspotId:a,...n}})(a,o)}}),z=({label:t,action:a,eventName:n,HubSpot_id:o})=>{(0,u.U)({event:y[n],auth_event_name:n,action:a,login_method:t.toLowerCase(),login_path:e??"",HubSpot_id:o})},G=(0,o.useCallback)(({access_token:e,refresh_token:t,expires_in:n},o)=>{a(k(!0)),B(e).then(s=>{a(A(s)),a(k(!1)),_({email:s.email,id:s.dynamoID});let i={sameSite:"strict",secure:!0,path:"/"},r=Date.now()+1e3*n;(0,c.D8)("accessToken",e,i),(0,c.D8)("refreshToken",t,i),(0,c.D8)("dynamoID",s.dynamoID,i),(0,c.D8)("expiredAt",r,i),(0,c.D8)("authSnapshot",(0,l.K)(s),i),z({label:o,action:"Sign In",eventName:"login",HubSpot_id:s?.hubspotId}),v({event:"login",properties:{auth_type:o},userEmail:s.email}),P(s)}).catch(()=>{a(T({status:!0,type:"WARNING",title:"Oops!",text:"Something went wrong"})),j(),a(D()),setTimeout(()=>{a(T({status:!1}))},5e3)}).finally(()=>{a(k(!1))})},[C,a,A,D,k,v]),j=(0,o.useCallback)(()=>{(0,c.J0)("accessToken"),(0,c.J0)("refreshToken"),(0,c.J0)("expiredAt"),(0,c.J0)("dynamoID"),(0,c.J0)("authSnapshot"),a(D()),a(S()),a(x())},[a,D,S,w]),$=(0,o.useCallback)(e=>
1{a(T({status:!0,type:"SUCCESS",title:"Thank you for registering!",text:`To complete your profile, please click the verification link sent to ${e??"your email"}`,isShowCloseButton:!0})),b({status:!1}),z({label:"email",action:"Sign Up",eventName:"sign_up",HubSpot_id:""}),setTimeout(()=>{a(T({status:!1}))},1e4)},[a,T,b]),O=(0,o.useCallback)(e=>{a(T({status:!0,type:"INFO",title:"Almost there!",text:`An email has been sent at ${e} with a link to reset your password.`,isShowCloseButton:!0})),b({}),setTimeout(()=>{a(T({status:!1}))},5e3)},[a,T,b]),K=(0,o.useCallback)(e=>{a(k(!0)),C({apiEndpoint:"https://vis5figyh8.execute-api.us-east-1.amazonaws.com/prod/user/send-email-verification",method:"POST",headers:{"Content-Type":"application/json"},body:{email:e}}).then(()=>{R("verification_sent")}).catch(()=>{R("unverified")}).finally(()=>a(k(!1)))},[C,a,k]),U=(0,o.useCallback)((e,t,n)=>{a(k(!0));let o=(0,c.R5)("accessToken"),i=(0,c.R5)("refreshToken");return C({apiEndpoint:"https://vis5figyh8.execute-api.us-east-1.amazonaws.com/prod/user",method:"PATCH",body:{given_name:e,family_name:t,display_name:n},headers:{Authorization:`Bearer ${o}`}}).then(()=>(a(N({given_name:e,family_name:t,display_name:n})),a(T({status:!0,type:"SUCCESS",title:"Success!",text:"Your name has been updated!",isShowCloseButton:!0})),b({}),setTimeout(()=>{a(T({status:!1}))},5e3),(0,s.J)(i),null)).catch(e=>{let t=e.response?.data;return t?.error==="display_name_taken"?"This display name is already taken. Please choose another one.":t?.message??t?.description??t?.error_description??"Something went wrong. Please try again later."}).finally(()=>a(k(!1)))},[C,a,k,b,T,N]),M=(0,o.useCallback)(()=>{a(k(!0));let e=(0,c.R5)("accessToken");C({apiEndpoint:"https://vis5figyh8.execute-api.us-east-1.amazonaws.com/prod/user",method:"DELETE",headers:{Authorization:`Bearer ${e}`}}).then(()=>{b({status:!0,name:i.gM.SUCCESS_DELETE}),j(),a(D()),a(I()),a(S()),k(!1)}).catch(e=>e).finally(()=>a(k(!1)))},[C,a,D,k,I,b,S]);return{setLoginData:G,removeLoginData:j,registration:$,changePassword:O,sendVerificationEmail:K,loginNotify:L,setLoginNotify:R,deleteAccount:M,editAccount:U,isLoading:E,setLoading:e=>a(k(e))}}},64939:(e,t,a)=>{a.d(t,{L:()=>i});var n=a(12115),o=a(37662),s=a(66195);let i=()=>{let e=(0,n.useRef)(null),t=(0,o.j)(),{closePopup:a}=s.GM.actions,{activePopupName:i}=(0,o.G)(e=>e.globalReducer);return(0,n.useEffect)(()=>{let n=n=>{let o=!!i&&!!n.target?.closest(`#${i}, [data-id="${i}"]`);!e.current||e?.current?.contains(n.target)||o||t(a())};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[t,e,i,a]),e}},85135:(e,t,a)=>{a.d(t,{K:()=>o,T:()=>s});let n=e=>"string"==typeof e&&e.trim().length>0,o=e=>({isAuthorized:!0,name:e.name??"",picture:e.picture??"",hubspotId:e.hubspotId??"",dynamoID:e.dynamoID??"",updatedAt:e.updated_at??new Date().toISOString(),givenName:e.given_name,familyName:e.family_name}),s=e=>!!e&&"object"==typeof e&&!0===e.isAuthorized&&n(e.name)&&n(e.hubspotId)&&n(e.dynamoID)}}]);

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.