PageSourceSearch

https://web-assets.myfitnesspal.com/web-main/_next/static/chunks/pages/invitations-b67bcdf2aaf6545c.js

js myfitnesspal.com collected 2026-10-01 08:33:59 UTC 14,968 bytes, 38 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3668],{3952:(e,t,i)=>{"use strict";i.d(t,{A:()=>u});var n=i(64255),r=i(37124),s=i(79642),a=i(54698),o=i(73202),l=i(98416),d=i(59674),c=i(77856);let u=(0,a.A)(({children:e,loading:t,loadingSpinnerProps:i,ref:a,...o})=>(0,n.jsx)(r.A,{ref:a,LinkComponent:c.A,...o,children:t?(0,n.jsx)(s.A,{color:"inherit",thickness:4,size:24,...i}):e}))((0,o.A)(l.Ay,d.Ay))},13360:(e,t,i)=>{"use strict";i.d(t,{A:()=>b});var n=i(41695),r=i(3638),s=i(44841),a=i(23006),o=i(63894),l=i(67867),d=i(95675),c=i(47652),u=i(83188),h=i(83923),p=i(41999);function A(e){return(0,p.Ay)("MuiSkeleton",e)}(0,h.A)("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);var x=i(64255);let m=(0,o.i7)`
2  0% {
3    opacity: 1;
4  }
5
6  50% {
7    opacity: 0.4;
8  }
9
10  100% {
11    opacity: 1;
12  }
13`,g=(0,o.i7)`
14  0% {
15    transform: translateX(-100%);
16  }
17
18  50% {
19    /* +0.5s of delay between each loop */
20    transform: translateX(100%);
21  }
22
23  100% {
24    transform: translateX(100%);
25  }
26`,f="string"!=typeof m?(0,o.AH)`
27        animation: ${m} 2s ease-in-out 0.5s infinite;
28      `:null,y="string"!=typeof g?(0,o.AH)`
29        &::after {
30          animation: ${g} 2s linear 0.5s infinite;
31        }
32      `:null,v=(0,l.Ay)("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:i}=e;return[t.root,t[i.variant],!1!==i.animation&&t[i.animation],i.hasChildren&&t.withChildren,i.hasChildren&&!i.width&&t.fitContent,i.hasChildren&&!i.height&&t.heightAuto]}})((0,d.A)(({theme:e})=>{let t=(0,a.l_)(e.shape.borderRadius)||"px",i=(0,a.db)(e.shape.borderRadius),n=(0,u.z6)(e,{animation:"none"}),r=(0,u.z6)(e,{"&::after":{animation:"none",display:"none"}});return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:e.alpha(e.palette.text.primary,"light"===e.palette.mode?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${i}${t}/${Math.round(i/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:e})=>e.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:e})=>e.hasChildren&&!e.width,style:{maxWidth:"fit-content"}},{props:({ownerState:e})=>e.hasChildren&&!e.height,style:{height:"auto"}},{props:{animation:"pulse"},style:f||{animation:`${m} 2s ease-in-out 0.5s infinite`}},...n?[{props:{animation:"pulse"},style:n}]:[],{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient(
33                90deg,
34                transparent,
35                ${(e.vars||e).palette.action.hover},
36                transparent
37              )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:y||{"&::after":{animation:`${g} 2s linear 0.5s infinite`}}},...r?[{props:{animation:"wave"},style:r}]:[]]}})),b=n.forwardRef(function(e,t){let i=(0,c.b)({props:e,name:"MuiSkeleton"}),{animation:n="pulse",className:a,component:o="span",height:l,style:d,variant:u="text",width:h,...p}=i,m={...i,animation:n,component:o,variant:u,hasChildren:!!p.children},g=(e=>{let{classes:t,variant:i,animation:n,hasChildren:r,width:a,height:o}=e;return(0,s.A)({root:["root",i,n,r&&"withChildren",r&&!a&&"fitContent",r&&!o&&"heightAuto"]},A,t)})(m);return(0,x.jsx)(v,{as:o,ref:t,className:(0,r.A)(g.root,a),ownerState:m,...p,style:{width:h,height:l,...d}})})},16693:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});var n=i(64255),r=i(1179),s=i(68559),a=i(66448);let o={display:"flex",justifyContent:"center",m:5};function l({adUnitPath:e,uniqueID:t=e,size:i="160x600",sx:d=o,top:c=!1,bottom:u=!1,...h}){let p=(0,s.Vb)();return(0,n.jsx)(r.A,{sx:d,children:(0,n.jsx)(a.Ay,{size:i,adUnitPath:e,uniqueID:t,title:p(`adTitle${c?"Top":""}${u?"Bottom":""}Right`),...h})})}},31713:(e,t,i)=>{"use strict";i.r(t),i.d(t,{__N_SSP:()=>ee,default:()=>et});var n=i(64255),r=i(55714),s=i(1179),a=i(26081),o=i(50592),l=i(90110),d=i(44383),c=i(9243),u=i(82726);async function h({page:e,client:t=u.w}){let{data:i}=await t.get("/api/services/invitations",{params:{page:e}});return i}async function p({id:e,response:t,client:i=u.w}){await i.post(`/api/services/invitations/${e}`,{response:t})}var A=i(97787),x=i(87373),m=i(41695),g=i(64604),f=i(2879),y=i(90489),v=i(80163),b=i(25839),j=i(67594),w=i(69025),C=i(52127);let _=(0,i(27930).A)((0,n.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert");var k=i(18021),R=i.n(k),S=i(82603),M=i.n(S),B=i(68559),E=i(33552),z=i(68690),P=i(3952),I=i(99685),U=i(77856),$=i(13360);let D={width:85,height:24};function q({children:e,sx:t}){let[i,r]=(0,m.useState)(!0);return(0,m.useEffect)(()=>{r(!1)},[]),i?(0,n.jsx)($.A,{sx:[D,...Array.isArray(t)?t:[t]]}):e}
37let N={borderRadius:3,display:"flex",flexDirection:"column",height:"100%"},F={p:{xs:3,tb:4},height:"100%",justifyContent:"space-between"},V={typography:{xs:"Body/Bold/MD",tb:"Body/Bold/LG"},overflow:"hidden",textOverflow:"ellipsis",color:"common.neutrals.primary"},X={my:2},H={position:"absolute",top:8,left:8,bgcolor:"common.brand.premium",color:"common.neutrals.black",borderRadius:1,px:2},L={position:"absolute",top:8,right:8,color:"common.neutrals.inverse",opacity:.9,p:0,filter:"drop-shadow(0 0 1px rgb(0 0 0 / 0.4))"},T={bgcolor:"common.neutrals.inverse",borderRadius:2,p:3},K={color:"common.neutrals.primary",fontFamily:e=>e.typography.fontFamily},O={display:"block",textAlign:"left"},W=({invitation:e,isPremium:t})=>{let i=(0,B.Vb)(),r=(0,g.jE)(),o=(0,m.useRef)(null),{locale:d,push:u}=(0,c.useRouter)(),{sendAlert:h}=(0,E.d)(),{mutate:A}=(0,f.n)({mutationFn:p}),[x,k]=(0,m.useState)(!1),{from_user:{avatar_url:R,created_at:S,id:$,is_admin:D,username:W},id:Q}=e,G=(0,z.ox)(S,d),J=R.includes("no_photo_thumbnail.png")?I.A:R,Y={accept:i("invitations.acceptedInvitation",{username:W}),decline:i("invitations.declinedInvitation"),block:i("invitations.blockedInvitation",{username:W})},Z=(e,t)=>{A({id:e,response:t},{onSuccess:()=>{h("success",Y[t]),r.invalidateQueries({queryKey:["invitations"]}),"block"===t&&u("/blocked-users")},onError:()=>{h("error",i("premium.redeem.ohNoError"))}})},ee=()=>{k(e=>!e)};return(0,n.jsx)(a.A,{size:{xs:t?10:8,sm:t?6:5,tb:5,md:4},children:(0,n.jsxs)(y.A,{sx:N,children:[(0,n.jsxs)(s.A,{sx:{position:"relative",pb:"100%"},children:[(0,n.jsx)(M(),{src:J,alt:i("invitations.profilePhotoAlt",{username:W}),layout:"fill"}),D&&(0,n.jsx)(s.A,{component:"span",sx:H,children:(0,n.jsx)(l.A,{variant:"Body/Bold/XS",children:i("invitations.mfpStaff")})}),(0,n.jsx)(v.A,{ref:o,sx:L,onClick:ee,children:(0,n.jsx)(_,{})}),(0,n.jsx)(b.A,{anchorEl:o.current,open:x,placement:"bottom-end",children:(0,n.jsx)(j.x,{onClickAway:ee,children:(0,n.jsx)(y.A,{elevation:2,sx:T,children:(0,n.jsxs)(w.A,{spacing:1,children:[(0,n.jsx)(U.A,{href:`/profile/${W}`,children:(0,n.jsx)(l.A,{variant:"Body/Regular/MD",sx:{color:"common.neutrals.primary"},children:i("invitations.viewProfile")})}),(0,n.jsx)(U.A,{href:`/messages/new/${$}`,fullRefresh:!0,children:(0,n.jsx)(l.A,{variant:"Body/Regular/MD",sx:{color:"common.neutrals.primary"},children:i("invitations.sendMessage")})}),(0,n.jsx)(C.A,{onClick:()=>Z(Q,"block"),sx:O,children:(0,n.jsx)(l.A,{variant:"Body/Regular/MD",sx:K,children:i("invitations.blockUser")})})]})})})})]}),(0,n.jsxs)(w.A,{sx:F,children:[(0,n.jsxs)(w.A,{children:[(0,n.jsx)(U.A,{href:`/profile/${W}`,children:(0,n.jsx)(l.A,{sx:V,children:W})}),(0,n.jsx)(q,{children:(0,n.jsx)(l.A,{variant:"Body/Regular/SM",sx:{color:"common.neutrals.tertiary"},children:i("invitations.joined",{time:G})})})]}),(0,n.jsxs)(w.A,{children:[(0,n.jsx)(P.A,{size:"small",sx:X,onClick:()=>Z(Q,"accept"),children:i("acceptUppercase")}),(0,n.jsx)(P.A,{variant:"outlined",size:"small",onClick:()=>Z(Q,"decline"),children:i("declineUppercase")})]})]})]})})};W.propTypes={invitation:R().shape({id:R().number.isRequired,from_user:R().shape({avatar_url:R().string,created_at:R().string,id:R().number,is_admin:R().bool,username:R().string})}),isPremium:R().bool};var Q=i(82423),G=i(13621),J=i(67393),Y=i(48712);let Z=()=>{let e=(0,B.Vb)(),{locale:t,query:i,push:u}=(0,c.useRouter)(),p=(0,r.A)(e=>e.breakpoints.only("xs")),m=+i.page||1,{data:g,isPending:f}=(0,d.I)({queryKey:["user"],queryFn:()=>(0,x.wz)({})}),y=g?.location_preferences.country_code,{data:v,isPending:b}=(0,d.I)({queryKey:["subscription",y,t],queryFn:()=>(0,A.uV)({isoCode:y,locale:t}),enabled:!!y}),{data:j,isPending:w}=(0,d.I)({queryKey:["invitations",m],queryFn:()=>h({page:m})});if(b||w||f)return(0,n.jsx)(Q.a,{});let{invitations:C,pages:_}=j,{[G.m_]:k}=(0,G.zt)(v);return(0,n.jsxs)(s.A,{children:[(0,n.jsx)(Y.A,{children:e("invitations.friendRequests")}),C.length>0?(0,n.jsxs)(s.A,{children:[(0,n.jsx)(a.A,{container:!0,columns:k?20:16,spacing:3,children:C.map(e=>(0,n.jsx)(W,{invitation:e,isPremium:k},e.id))}),_>1&&(0,n.jsx)(o.A,{count:_,page:m,defaultPage:1,siblingCount:p?1:3,boundaryCount:1,hidePrevButton:!0,hideNextButton:!0,onChange:(e,t)=>
37u({pathname:"/invitations",query:{page:t}}),sx:{pt:6}})]}):(0,n.jsx)(l.A,{children:e("invitations.noFriendRequests")})]})};Z.Layout=function({children:e}){return(0,n.jsx)(J.A,{adUnitPath:"Community",children:e})};var ee=!0;let et=Z},38782:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});var n=i(64255),r=i(1179),s=i(79642),a=i(68559);let o={display:"flex","& > * + *":{marginLeft:2}};function l(e){let t=(0,a.Vb)();return(0,n.jsx)(r.A,{sx:o,children:(0,n.jsx)(s.A,{disableShrink:!0,title:t("circularProgressBarLabel"),...e})})}},42243:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var n=i(41695),r=i(13621),s=i(70617);function a(){let{data:e}=(0,s.R)();return(0,n.useMemo)(()=>(0,r.zt)(e),[e])}},48712:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var n=i(64255),r=i(90110);function s({children:e,...t}){return(0,n.jsx)(r.A,{variant:"Heading/Bold/LG",component:"h1",sx:{mb:4},...t,children:e})}},62455:(e,t,i)=>{"use strict";i.d(t,{A:()=>u});var n=i(64255),r=i(55714),s=i(1179),a=i(27034),o=i(67230),l=i(68559),d=i(66448);let c={display:"flex",justifyContent:"center"};function u({adUnitPath:e,bottom:t=!1,large:i=!1,uniqueID:h=e,sx:p={},...A}){let x,m,g,f=(0,l.Vb)(),{data:{client:y}}=(0,a.Pj)(o.M_),v=(0,l.al)(),b=(0,r.A)(e=>e.breakpoints.up("lg"),{defaultMatches:"Web"===y}),j=f(t?"adTitleBottom":"adTitleTop");return v?(x="320x50",m=e+"_1",g=h+"_1"):i&&b?(x="970x250",m=e+"_2",g=h+"_2"):(x="728x90",m=e+"_3",g=h+"_3"),(0,n.jsx)(s.A,{sx:[c,...Array.isArray(p)?p:[p??!1]],children:(0,n.jsx)(d.Ay,{adUnitPath:m,size:x,title:j,uniqueID:g,...A})})}},66448:(e,t,i)=>{"use strict";i.d(t,{Ay:()=>A});var n=i(64255),r=i(41695),s=i(1179),a=i(64604),o=i(9243),l=i(95863),d=i(50849),c=i(13621),u=i(61308);let h={bgcolor:"#E0E0E0",overflow:"hidden"},p=e=>Array.isArray(e[0]),A=({adUnitPath:e="",size:t,uniqueID:i,title:A,sx:x={}})=>{let{adsReady:m}=(0,u.g)(),g=l.O.googleAdKey.apiKey+e,f=d.x8[t],[y,v]=p(f)?f.reduce(([e,t],[i,n])=>[Math.max(e,i),Math.max(t,n)],[0,0]):f,{locale:b}=(0,o.useRouter)(),j=(0,a.jE)(),w=j.getQueryData(["user"]),C=w?.location_preferences.country_code,_=j.getQueryData(["subscription",C,b]),{[c.m_]:k}=(0,c.zt)(_);return((0,r.useEffect)(()=>{let e=()=>{},t=e=>{if(!e.getSizes)return void console.error("Unable to fetch ads: Slot does not have sizes");let t=e.getSizes()[0],i={slotID:e.getSlotElementId(),slotName:e.getAdUnitPath(),sizes:[t.width,t.height]};window.apstag?.fetchBids({slots:[i]},function(){window.googletag?.pubads().setForceSafeFrame(!0),window.apstag?.setDisplayBids(),window.googletag?.pubads().refresh([e])})},n=async()=>{window.googletag||Object.assign(window,{googletag:{cmd:[]}});let n=window.googletag;if(n)try{n.cmd.push(async()=>{let r=n.pubads().getSlots().find(e=>e.getSlotElementId()===i);(r&&n.pubadsReady&&t(r),!r)&&(r=n.defineSlot(g,p(f)?f.map(([e,t])=>[e,t]):[f[0],f[1]],i)??void 0)&&(r.addService(n.pubads()),n.pubads().disableInitialLoad(),n.enableServices(),n.display(i),t(r));e=()=>{n.cmd.push(()=>{r&&n.pubads().clear([r])})}})}catch(e){console.warn("Error loading Google Ad:",e)}};return!k&&m&&n(),e},[f,i,g,k,m]),k)?null:(0,n.jsx)(s.A,{title:A,sx:[h,{width:y+"px",height:v+"px"},...Array.isArray(x)?x:[x]],children:(0,n.jsx)(s.A,{id:i})})}},67393:(e,t,i)=>{"use strict";i.d(t,{A:()=>g});var n=i(64255),r=i(69025),s=i(98825),a=i(26081),o=i(13621),l=i(42243),d=i(68559),c=i(62455),u=i(16693),h=i(76095);let p={alignItems:"center",pt:{xs:0,tb:5},minHeight:"70vh"},A={display:"flex",justifyContent:"flex-end"},x={my:8},m={flexGrow:1,justifyContent:"flex-end"};function g({children:e,adUnitPath:t="Other",rightAd:i=!0,bottomAd:f=!0,sx:y}){let v=(0,d.al)(),{[o.m_]:b}=(0,l.A)(),j=i&&!v&&!b;return(0,n.jsx)(h.A,{sx:y,children:(0,n.jsxs)(r.A,{sx:p,children:[(0,n.jsx)(c.A,{adUnitPath:t}),(0,n.jsx)(s.A,{maxWidth:"lg",component:"main",sx:x,children:(0,n.jsxs)(a.A,{container:!0,spacing:5*!!j,children:[(0,n.jsx)(a.A,{size:{xs:12,tb:j?9:12},children:e}),j&&(0,n.jsx)(a.A,{size:{xs:12,tb:3},sx:A,children:(0,n.jsx)(u.A,{adUnitPath:`${t}_2`})})]})}),f&&v&&(0,n.jsx)(r.A,{sx:m,children:(0,n.jsx)(c.A,{adUnitPath:`${t}_3`,bottom:!0})})]})})}},82423:(e,t,i)=>{"use strict";i.d(t,{a:()=>o});var n=i(64255),r=i(1179);i(41695);var s=i(38782);let a={display:"flex",justifyContent:"center",alignItems:"center",minHeight:{xs:"c
37alc(100vh - 283px)",md:"calc(100vh - 240px)"}};function o({sx:e={},size:t=40}){return(0,n.jsx)(r.A,{sx:[a,...Array.isArray(e)?e:[e]],children:(0,n.jsx)(s.A,{size:t})})}},90489:(e,t,i)=>{"use strict";i.d(t,{A:()=>A});var n=i(41695),r=i(3638),s=i(44841),a=i(67867),o=i(47652),l=i(62260),d=i(83923),c=i(41999);function u(e){return(0,c.Ay)("MuiCard",e)}(0,d.A)("MuiCard",["root"]);var h=i(64255);let p=(0,a.Ay)(l.A,{name:"MuiCard",slot:"Root"})({overflow:"hidden"}),A=n.forwardRef(function(e,t){let i=(0,o.b)({props:e,name:"MuiCard"}),{className:n,raised:a=!1,...l}=i,d={...i,raised:a},c=(e=>{let{classes:t}=e;return(0,s.A)({root:["root"]},u,t)})(d);return(0,h.jsx)(p,{className:(0,r.A)(c.root,n),elevation:a?8:void 0,ref:t,ownerState:d,...l})})},99340:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/invitations",function(){return i(31713)}])},99685:(e,t,i)=>{"use strict";i.d(t,{A:()=>n});let n={src:"/_next/static/media/no_photo.4a61c1f4.png",height:200,width:200,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAADFBMVEXm5ubMzMze3t7Pz88aSmWHAAAACXBIWXMAAAsSAAALEgHS3X78AAAAKElEQVQImVWJsQ0AMACCQP//ubHpUhcJ4BvapBcC+aFwU2cqK2u4Jx4LDgBH/2vSTAAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}}},e=>{e.O(0,[7124,5839,592,5664,636,6593,8792],()=>e(e.s=99340)),_N_E=e.O()}]);
38//# sourceMappingURL=invitations-b67bcdf2aaf6545c.js.map

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.