PageSourceSearch

https://www.travafa.com/_next/static/chunks/85826-d57277273b8f6464.js

js travafa.com collected 2026-10-09 04:48:23 UTC 63,733 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[85826],{85826:(e,n,s)=>{"use strict";s.d(n,{A:()=>U});var t=s(95155),a=s(12115),i=s(52619),r=s.n(i),c=s(15239),l=s(1213),o=s(19740),d=s(38581),u=s(74744),_=s(73754),m=s(24229),p=s(93847),h=s(82538),v=s(92137),x=s(19610),f=s(66313),j=s(82112),N=s(73880),y=s(90721),g=s(35401),b=s(77557);let k=e=>{var n;return(0,b.J3)(null==e?void 0:e.phoneCountryCode)||(0,b.Tl)(null==e||null==(n=e.currentLocation)?void 0:n.country_code)||(0,b.dq)()},w=e=>{let{isOpen:n,onClose:s}=e,{profile:i}=(0,l.d4)(e=>e.userProfile),[r,c]=(0,a.useState)(()=>k(i)),[_,p]=(0,a.useState)(!0),[h,v]=(0,a.useState)(""),[x,f]=(0,a.useState)(""),[j,N]=(0,a.useState)(!1),[w,I]=(0,a.useState)(""),C=(0,l.wA)(),{addFriendLoading:P,addFriendSuccess:F,addFriendError:S}=(0,l.d4)(e=>e.friends),R=async()=>h.trim()?x?void((0,y.u4)("friend_invited",{method:"phone",country_code:r.code}),C((0,m.PG)({name_on_phone:h.trim(),phone_number:x,phone_country_code:r.code,phone_iso_code:r.country}))):void u.oR.error("Please enter a phone number"):void u.oR.error("Please enter a name");(0,a.useEffect)(()=>{F&&(u.oR.success("Friend request sent successfully!"),v(""),f(""),s(),C((0,m.iG)())),S&&(u.oR.error("string"==typeof S?S:"Failed to send invitation"),C((0,m.iG)()))},[F,S,h,x,C,s]),(0,a.useEffect)(()=>{if(!_)return;let e=k(i);e&&e.country!==r.country&&c(e)},[i,_,r.country]);let A=b.qo.filter(e=>e.name.toLowerCase().includes(w.toLowerCase())||e.code.includes(w)||e.country.toLowerCase().includes(w.toLowerCase()));return n?(0,t.jsx)("div",{className:"invite-modal-overlay",onClick:s,children:(0,t.jsxs)("div",{className:"invite-modal",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"invite-modal__header",children:[(0,t.jsxs)("div",{className:"invite-modal__header-main",children:[(0,t.jsx)("div",{className:"invite-modal__header-icon",children:(0,t.jsx)(o.gc,{icon:d.nWR})}),(0,t.jsxs)("div",{className:"invite-modal__header-text",children:[(0,t.jsx)("h2",{className:"invite-modal__title",children:"Invite a Friend"}),(0,t.jsx)("p",{className:"invite-modal__subtitle",children:"We'll send them an invite by mobile number."})]})]}),(0,t.jsx)("button",{className:"invite-modal__close",onClick:s,"aria-label":"Close",children:(0,t.jsx)(o.gc,{icon:d.GRI})})]}),(0,t.jsxs)("div",{className:"invite-modal__content",children:[(0,t.jsxs)("div",{className:"invite-modal__phone-form",children:[(0,t.jsxs)("div",{className:"invite-modal__field",children:[(0,t.jsx)("label",{className:"invite-modal__label",children:"Name"}),(0,t.jsxs)("div",{className:"invite-modal__input-wrap",children:[(0,t.jsx)(o.gc,{icon:d.X46,className:"invite-modal__input-icon"}),(0,t.jsx)("input",{type:"text",placeholder:"Enter friend's name",value:h,onChange:e=>v(e.target.value),className:"invite-modal__input invite-modal__input--icon"})]})]}),(0,t.jsxs)("div",{className:"invite-modal__field-group",children:[(0,t.jsxs)("div",{className:"invite-modal__field",children:[(0,t.jsx)("label",{className:"invite-modal__label",children:"Country"}),(0,t.jsxs)("div",{className:"invite-modal__country-select",children:[(0,t.jsxs)("button",{className:"invite-modal__country-btn",title:"".concat(r.name," (").concat(r.code,")"),"aria-label":"Country: ".concat(r.name,", ").concat(r.code),onClick:()=>N(!j),children:[(0,t.jsx)("span",{className:"invite-modal__flag",children:(0,t.jsx)(g.default,{code:r.country,size:20})}),(0,t.jsx)("span",{className:"invite-modal__code",children:r.code}),(0,t.jsx)(o.gc,{icon:d.Jt$,className:"invite-modal__arrow"})]}),j&&(0,t.jsxs)("div",{className:"invite-modal__country-dropdown",children:[(0,t.jsxs)("div",{className:"invite-modal__country-search",children:[(0,t.jsx)(o.gc,{icon:d.MjD,className:"invite-modal__country-search-icon"}),(0,t.jsx)("input",{type:"text",placeholder:"Search country...",value:w,onChange:e=>I(e.target.value),className:"invite-modal__country-search-input",onClick:e=>e.stopPropagation()})]}),A.map(e=>(0,t.jsxs)("button",{className:"invite-modal__country-option",onClick:()=>{p(!1),c(e),N(!1),I("")},children:[(0,t.jsx)("span",{className:"invite-modal__flag",children:(0,t.jsx)(g.default,{code:e.country,size:20})}),(0,t.jsx)("span",{className:"invite-modal__country-name",children:e.name}),(0,t.jsx)("span",{className:"invite-modal__code",children:e.code})]},e.country))]})]})]}),(0,t.jsxs)("div",{className:"invite-modal__field invite-modal__field--grow",children:[(0,t.jsx)("label",{className:"invite-modal__label",children:"Phone Number"}),(0,t.jsxs)("div",{className:"invite-modal__input-wrap",children:[(0,t.jsx)(o.gc,{icon:d.KKr,className:"invite-modal__input-icon"}),(0,t.jsx)("input",{type:"tel",placeholder:"Enter mobile number",value:x,onChange:e=>f(e.target.value),className:"invite-modal__input invite-modal__input--icon"})]})]})]})]}),(0,t.jsx)("button",{className:"invite-modal__send-btn",onClick:R,disabled:P,children:P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.gc,{icon:d.z1G,spin:!0}),(0,t.jsx)("span",{children:"Sending…"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.gc,{icon:d.isI}),(0,t.jsx)("span",{children:"Send Invitation"})]})})]})]})}):null};var I=s(91334);let C=e=>{let{isOpen:n,onClose:s}=e,i=(0,l.wA)(),{blockedUsersList:r,blockedUsersLoading:_,blockedUsersError:p}=(0,l.d4)(e=>e.friends),[h,v]=(0,a.useState)(()=>new Set),x=(e,n)=>v(s=>{let t=new Set(s);return n?t.add(e):t.delete(e),t});(0,a.useEffect)(()=>{n&&i((0,m.zw)())},[n,i]);let f=async e=>
1{if(!h.has(e.user_id)){(0,y.u4)("friends_unblock_clicked",{user_id:e.user_id}),x(e.user_id,!0);try{await i((0,m.kV)({user_id_to_unblock:e.user_id,send_friend_request:!0})).unwrap(),u.oR.success("Unblocked ".concat(e.user_display_name)),i((0,m.M7)())}catch(n){u.oR.error("Couldn't unblock ".concat(e.user_display_name))}finally{x(e.user_id,!1),i((0,m.CU)())}}},j=Array.isArray(r)?r:[];return n?(0,t.jsx)("div",{className:"blocked-modal-overlay",onClick:s,children:(0,t.jsxs)("div",{className:"blocked-modal",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"blocked-modal__header",children:[(0,t.jsx)("h2",{className:"blocked-modal__title",children:"Blocked Users"}),(0,t.jsx)("button",{className:"blocked-modal__close",onClick:s,children:(0,t.jsx)(o.gc,{icon:d.GRI})})]}),(0,t.jsx)("div",{className:"blocked-modal__content",children:_?(0,t.jsx)("div",{className:"blocked-modal__loading",children:(0,t.jsx)(I.default,{context:"generic",size:64,message:"Loading blocked users"})}):p?(0,t.jsxs)("div",{className:"blocked-modal__error",children:[(0,t.jsx)("p",{children:"Failed to load blocked users. Please try again."}),(0,t.jsx)("button",{className:"blocked-modal__retry-btn",onClick:()=>{(0,y.u4)("friends_blocked_retry_clicked"),i((0,m.zw)())},children:"Retry"})]}):0===j.length?(0,t.jsxs)("div",{className:"blocked-modal__empty",children:[(0,t.jsx)(c.default,{src:"/images/friends_empty.png",alt:"No blocked users",width:120,height:120,className:"blocked-modal__empty-image"}),(0,t.jsx)("p",{children:"You haven't blocked anyone"}),(0,t.jsx)("span",{children:"Users you block will appear here"})]}):(0,t.jsx)("div",{className:"blocked-modal__list",children:j.map(e=>{let n=h.has(e.user_id);return(0,t.jsxs)("div",{className:"blocked-modal__user-card",children:[(0,t.jsxs)("div",{className:"blocked-modal__user-info",children:[(0,t.jsx)(c.default,{src:e.user_signed_image||"/avatars/7.png",alt:e.user_display_name||"User",width:48,height:48,className:"blocked-modal__user-avatar",unoptimized:!0}),(0,t.jsxs)("div",{className:"blocked-modal__user-details",children:[(0,t.jsx)("span",{className:"blocked-modal__user-name",children:e.user_display_name}),e.user_handle&&(0,t.jsxs)("span",{className:"blocked-modal__user-handle",children:["@",e.user_handle]})]})]}),(0,t.jsxs)("button",{className:"blocked-modal__unblock-btn",onClick:()=>f(e),disabled:n,children:[(0,t.jsx)(o.gc,{icon:n?d.z1G:d.pCJ,spin:n}),(0,t.jsx)("span",{children:"Unblock"})]})]},e.user_id)})})})]})}):null};var P=s(92331),F=s(87746),S=s(83284);function R(e){if(!e)return{key:"unknown",label:"Unknown",tone:"neutral"};if(e.isExpired||"EXPIRED"===e.status)return{key:"expired",label:"Expired",tone:"danger"};switch(e.status){case"USED":case"ACCEPTED":return{key:"accepted",label:"Accepted",tone:"success"};case"PENDING":return{key:"pending",label:"Pending",tone:"warning"};case"CANCELLED":return{key:"cancelled",label:"Cancelled",tone:"neutral"};default:return{key:"unknown",label:e.status||"Unknown",tone:"neutral"}}}let A=e=>{var n,s,i;let{isOpen:r,onClose:c}=e,_=(0,l.wA)(),{list:m,stats:p,loading:h,error:v,creating:x,createError:f,lastCreated:j,cancellingCode:N}=(0,l.d4)(e=>e.invites),k=(0,F.J)(),[w,C]=(0,a.useState)(!1),[A,B]=(0,a.useState)(""),[q,M]=(0,a.useState)(null),[T,D]=(0,a.useState)(!1),[E,G]=(0,a.useState)(""),[L,z]=(0,a.useState)(""),U=(0,a.useMemo)(()=>{if(!k)return b.qo;let e=new Set(k),n=b.qo.filter(n=>e.has(n.country));return n.length?n:b.qo},[k]);if((0,a.useEffect)(()=>{r&&_((0,S.v$)())},[r,_]),(0,a.useEffect)(()=>{U.length&&M(e=>e&&U.some(n=>n.country===e.country)?e:U[0])},[U]),(0,a.useEffect)(()=>{f&&(u.oR.error(f),_((0,S.hh)()))},[f,_]),(0,a.useEffect)(()=>{j&&(C(!1),B(""),_((0,S.v$)()))},[j,_]),!r)return null;let O="".concat(null!=(n=null==q?void 0:q.code)?n:"").concat(A.replace(/\D/g,"")),W=!!q&&A.replace(/\D/g,"").length>=6,J=async e=>{try{await navigator.clipboard.writeText(e),z(e),setTimeout(()=>z(""),1800),u.oR.success("Invite code copied")}catch(n){u.oR.info("Invite code: ".concat(e))}},K=async e=>{let n=(0,P.xq)({inviteCode:e.code});if((0,y.u4)("invite_code_share_clicked"),navigator.share)try{await navigator.share({text:n});return}catch(e){}await J(e.code)},H=U.filter(e=>e.name.toLowerCase().includes(E.toLowerCase())||e.code.includes(E)||e.country.toLowerCase().includes(E.toLowerCase())),Q=function(e){let n=Number(null==e?void 0:e.maxInvitesAllowed)||0;if(n<=0)return 0;let s=Math.min(Math.max(Number(null==e?void 0:e.invitesRemaining)||0,0),n);return Math.round((n-s)/n*100)}(p);return(0,t.jsx)("div",{className:"invite-modal-overlay",onClick:c,children:(0,t.jsxs)("div",{className:"invite-modal your-invites",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"invite-modal__header",children:[(0,t.jsxs)("div",{className:"invite-modal__header-main",children:[(0,t.jsx)("div",{className:"invite-modal__header-icon",children:(0,t.jsx)(o.gc,{icon:d.y_8})}),(0,t.jsxs)("div",{className:"invite-modal__header-text",children:[(0,t.jsx)("h2",{className:"invite-modal__title",children:"Your Invites"}),(0,t.jsx)("p",{className:"invite-modal__subtitle",children:"Invite codes for friends in countries Travafa isn't open in yet."})]})]}),(0,t.jsx)("button",{className:"invite-modal__close",onClick:c,"aria-label":"Close",children:(0,t.jsx)(o.gc,{icon:d.GRI})})]}),(0,t.jsxs)("div",{className:"invite-modal__content your-invites__content",children:[(0,t.jsxs)("div",{className:"your-invites__quota",children:[(0,t.jsxs)("div",{className:"your-invites__quota-top",children:[(0,t.jsx)("span",{className:"your-invites__quota-icon",children:(0,t.jsx)(o.gc,{icon:d.C97})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"your-invites__quota-count",children:[p.invitesRemaining,(0,t.jsxs)("span",{className:"your-invites__quota-max",children:[" ","/ ",p.maxInvitesAllowed||100]})]}),(0,t.jsx)("p",{className:"your-invites__quota-label",children:"invites remaining"})]})]}),(0,t.jsx)("div",{className:"your-invites__bar",children:(0,t.jsx)("span",{className:"your-invites__bar-fill",style:{width:"".concat(Q,"%")}})}),(0,t.jsxs)("div",{className:"your-invites__figures",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"your-invites__figure",children:p.invitesPending}),(0,t.jsx)("p",{className:"your-invites__figure-label",children:"Pending"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"your-invites__figure",children:p.invitesUsed}),(0,t.jsx)("p",{className:"your-invites__figure-label",children:"Accepted"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"your-invites__figure",children:p.totalInvitesSent}),(0,t.jsx)("p",{className:"your-invites__figure-label",children:"Total Sent"})]})]})]}),w?(0,t.jsxs)("div",{className:"your-invites__compose",children:[(0,t.jsx)("p",{className:"your-invites__compose-title",children:"Send an invite"}),(0,t.jsx)("p",{className:"your-invites__compose-help",children:"Enter your friend's phone number. We'll generate a code for you to send them."}),(0,t.jsxs)("div",{className:"invite-modal__field-group",children:[(0,t.jsxs)("div",{className:"invite-modal__field",children:[(0,t.jsx)("label",{className:"invite-modal__label",children:"Country"}),(0,t.jsxs)("div",{className:"invite-modal__country-select",children:[(0,t.jsxs)("button",{className:"invite-modal__country-btn",title:q?"".concat(q.name," (").concat(q.code,")"):"Country",onClick:()=>D(e=>!e),children:[(0,t.jsx)("span",{className:"invite-modal__flag",children:(0,t.jsx)(g.default,{code:null!=(s=null==q?void 0:q.country)?s:"US",size:20})}),(0,t.jsx)("span",{className:"invite-modal__code",children:null!=(i=null==q?void 0:q.code)?i:""}),(0,t.jsx)(o.gc,{icon:d.Jt$,className:"invite-modal__arrow"})]}),T&&(0,t.jsxs)("div",{className:"invite-modal__country-dropdown",children:[(0,t.jsxs)("div",{className:"invite-modal__country-search",children:[(0,t.jsx)(o.gc,{icon:d.MjD,className:"invite-modal__country-search-icon"}),(0,t.jsx)("input",{type:"text",placeholder:"Search country...",value:E,onChange:e=>G(e.target.value),className:"invite-modal__country-search-input",onClick:e=>e.stopPropagation()})]}),H.map(e=>(0,t.jsxs)("button",{className:"invite-modal__country-option",onClick:()=>{M(e),D(!1),G("")},children:[(0,t.jsx)("span",{className:"invite-modal__flag",children:(0,t.jsx)(g.default,{code:e.country,size:20})}),(0,t.jsx)("span",{className:"invite-modal__country-name",children:e.name}),(0,t.jsx)("span",{className:"invite-modal__code",children:e.code})]},e.country))]})]})]}),(0,t.jsxs)("div",{className:"invite-modal__field invite-modal__field--grow",children:[(0,t.jsx)("label",{className:"invite-modal__label",children:"Phone Number"}),(0,t.jsxs)("div",{className:"invite-modal__input-wrap",children:[(0,t.jsx)(o.gc,{icon:d.KKr,className:"invite-modal__input-icon"}),(0,t.jsx)("input",{type:"tel",placeholder:"Enter mobile number",value:A,onChange:e=>B(e.target.value),className:"invite-modal__input invite-modal__input--icon"})]})]})]}),(0,t.jsxs)("div",{className:"your-invites__compose-actions",children:[(0,t.jsx)("button",{type:"button",className:"your-invites__ghost",onClick:()=>C(!1),children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"your-invites__primary",disabled:!W||x,onClick:()=>{W&&!x&&((0,y.u4)("invite_code_send_clicked",{iso:q.country}),_((0,S.wt)({invited_phone_number:O,invited_phone_country_code:q.code,invited_phone_iso_code:q.country})))},children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.gc,{icon:d.z1G,spin:!0})," Sending"]}):"Send Invite"})]})]}):(0,t.jsxs)("button",{type:"button",className:"your-invites__new",disabled:p.invitesRemaining<=0,onClick:()=>{(0,y.u4)("invite_code_new_clicked"),C(!0)},children:[(0,t.jsx)(o.gc,{icon:d.QLR})," ",p.invitesRemaining<=0?"No invites left":"New Invite"]}),(0,t.jsxs)("div",{className:"your-invites__list",children:[(0,t.jsxs)("p",{className:"your-invites__list-head",children:["Invites sent ",(0,t.jsx)("span",{children:m.length})]}),h&&0===m.length?(0,t.jsx)("div",{className:"your-invites__note",children:(0,t.jsx)(I.default,{context:"generic",size:56,message:"Loading your invites"})}):v?(0,t.jsx)("p",{className:"your-invites__note",children:String(v)}
1):0===m.length?(0,t.jsxs)("div",{className:"your-invites__empty",children:[(0,t.jsx)("span",{className:"your-invites__empty-icon",children:(0,t.jsx)(o.gc,{icon:d.y_8})}),(0,t.jsx)("p",{className:"your-invites__empty-title",children:"No invites yet"}),(0,t.jsx)("p",{className:"your-invites__note",children:"Send one to a friend who can't sign up on their own yet."})]}):m.map(e=>{var n;let s=R(e);return(0,t.jsxs)("div",{className:"your-invites__row",children:[(0,t.jsxs)("div",{className:"your-invites__row-top",children:[(0,t.jsx)("span",{className:"your-invites__row-icon",children:(0,t.jsx)(o.gc,{icon:d.KKr})}),(0,t.jsxs)("div",{className:"your-invites__row-text",children:[(0,t.jsx)("p",{className:"your-invites__row-phone",children:e.phone}),(0,t.jsxs)("p",{className:"your-invites__row-meta",children:["Sent ",function(e){if(!e)return"";let n=new Date(e);return Number.isNaN(n.getTime())?"":n.toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}(e.createdAt),"accepted"===s.key&&(null==(n=e.usedBy)?void 0:n.name)?" \xb7 joined as ".concat(e.usedBy.name):""]})]}),(0,t.jsx)("span",{className:"your-invites__chip your-invites__chip--".concat(s.tone),children:s.label})]}),(0,t.jsxs)("div",{className:"your-invites__code",children:[(0,t.jsx)("span",{className:"your-invites__code-label",children:"CODE"}),(0,t.jsx)("span",{className:"your-invites__code-value",children:e.code}),(0,t.jsx)("button",{type:"button",className:"your-invites__icon-btn",onClick:()=>J(e.code),title:"Copy code","aria-label":"Copy invite code ".concat(e.code),children:(0,t.jsx)(o.gc,{icon:d.jPR})}),"pending"===R(e).key&&(0,t.jsx)("button",{type:"button",className:"your-invites__icon-btn",onClick:()=>K(e),title:"Share invite","aria-label":"Share invite code ".concat(e.code),children:(0,t.jsx)(o.gc,{icon:d.y_8})}),"pending"===R(e).key&&(0,t.jsx)("button",{type:"button",className:"your-invites__icon-btn your-invites__icon-btn--danger",disabled:N===e.code,onClick:()=>_((0,S.cW)(e.code)),title:"Cancel invite","aria-label":"Cancel invite to ".concat(e.phone),children:(0,t.jsx)(o.gc,{icon:N===e.code?d.z1G:d.sjs,spin:N===e.code})})]}),L===e.code&&(0,t.jsx)("p",{className:"your-invites__copied",children:"Copied"})]},e.inviteId||e.code)})]})]})]})})};var B=s(27786);let q=e=>{let{isOpen:n,onClose:s,initialQuery:i="",onInviteByPhone:r}=e,c=(0,l.wA)(),{userId:p}=(0,_.i)(),h=(0,f.Jh)({enabled:n,keepInvited:!0,dropFriendNamesakes:!1}),{onTravafa:v,notOnTravafa:x,status:N,query:g,hasMore:b,loadingMore:k,loadMore:w,search:C}=h,[F,S]=(0,a.useState)(""),[R,A]=(0,a.useState)(""),q=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(n)return C(i),()=>C("")},[n,i,C]);let M=(0,a.useCallback)(()=>{let e=q.current;e&&e.scrollTop+e.clientHeight>=e.scrollHeight-120&&w()},[w]);if(!n)return null;let T=0===v.length&&0===x.length,D=async e=>{let n=(0,P.xq)({name:e.savedName});try{await navigator.clipboard.writeText(n),A(e.id),setTimeout(()=>A(""),1800),u.oR.success("Invite message copied")}catch(e){u.oR.info("Could not copy — select the message and copy it manually")}};return(0,t.jsx)("div",{className:"invite-modal-overlay",onClick:s,children:(0,t.jsxs)("div",{className:"invite-modal invite-contacts",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"invite-modal__header",children:[(0,t.jsxs)("div",{className:"invite-modal__header-main",children:[(0,t.jsx)("div",{className:"invite-modal__header-icon",children:(0,t.jsx)(o.gc,{icon:d.vlp})}),(0,t.jsxs)("div",{className:"invite-modal__header-text",children:[(0,t.jsx)("h2",{className:"invite-modal__title",children:"From your contacts"}),(0,t.jsx)("p",{className:"invite-modal__subtitle",children:"The contacts you synced from the Travafa app."})]})]}),(0,t.jsx)("button",{className:"invite-modal__close",onClick:s,"aria-label":"Close",children:(0,t.jsx)(o.gc,{icon:d.GRI})})]}),(0,t.jsxs)("div",{className:"invite-contacts__search",children:[(0,t.jsx)(o.gc,{icon:d.MjD,className:"invite-contacts__search-icon"}),(0,t.jsx)("input",{type:"text",placeholder:"Search contacts…",value:g,onChange:e=>C(e.target.value),"aria-label":"Search your contacts",className:"invite-contacts__search-input"})]}),(0,t.jsx)("div",{className:"invite-modal__content invite-contacts__body",ref:q,onScroll:M,children:T&&("loading"===N||h.searching)?[1,2,3,4].map(e=>(0,t.jsxs)("div",{className:"invite-contacts__skeleton",children:[(0,t.jsx)("span",{className:"invite-contacts__skeleton-circle"}),(0,t.jsx)("span",{className:"invite-contacts__skeleton-line"})]},e)):T&&"error"===N?(0,t.jsxs)("div",{className:"invite-contacts__note",children:[(0,t.jsx)("p",{children:"We couldn't load your contacts."}),(0,t.jsx)("button",{type:"button",className:"invite-contacts__retry",onClick:()=>h.refresh({force:!0}),children:"Try again"})]}):T?(0,t.jsxs)("div",{className:"invite-contacts__empty",children:[(0,t.jsx)("span",{className:"invite-contacts__empty-icon",children:(0,t.jsx)(o.gc,{icon:d.kWV})}),(0,t.jsx)("p",{className:"invite-contacts__empty-title",children:g.trim()?"No matching contacts":"needs-sync"===N?"Your contacts aren't here yet":"No contacts to add"}),(0,t.jsx)("p",{className:"invite-contacts__note-text",children:g.trim()?"Try a different name or number.":"empty"===N?j.OQ:j.CF}),r&&(0,t.jsx)("button",{type:"button",className:"invite-contacts__retry",onClick:r,children:"Invite by phone number"})]}):(0,t.jsxs)(t.Fragment,{children:[v.length>0&&(0,t.jsxs)("p",{className:"invite-contacts__group",children:["On Travafa \xb7 ",v.length]}),v.map(e=>{let n=F===e.id;return(0,t.jsxs)("div",{className:"invite-contacts__row",children:[(0,t.jsx)("span",{className:"invite-contacts__avatar",children:(e.name||"?").trim().charAt(0).toUpperCase()}),(0,t.jsxs)("div",{className:"invite-contacts__text",children:[(0,t.jsx)("p",{className:"invite-contacts__name",children:e.name}),(0,t.jsx)("p",{className:"invite-contacts__phone",children:e.handle?"@".concat(e.handle):"O
1n Travafa"})]}),(0,t.jsx)("div",{className:"invite-contacts__actions",children:(0,t.jsx)("button",{type:"button",className:"invite-contacts__invite",disabled:n,onClick:()=>(e=>{p&&!F&&((0,y.u4)("friends_add_clicked",{user_id:e.id,source:"contacts"}),S(e.id),c((0,m.UP)({user_id_main:p,user_id_friend:e.id,friendship_status:"requested",relationship_strength:null,time_stamp:new Date().toISOString()})).finally(()=>S("")))})(e),"aria-label":"Add ".concat(e.name," as a friend"),children:n?(0,t.jsx)(o.gc,{icon:d.z1G,spin:!0}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.gc,{icon:d.nWR})," Add"]})})})]},e.id)}),v.length>0&&x.length>0&&(0,t.jsx)("p",{className:"invite-contacts__group",children:"Not on Travafa yet"}),x.map(e=>{let n=e.invited,s=F===e.id;return(0,t.jsxs)("div",{className:"invite-contacts__row",children:[(0,t.jsx)("span",{className:"invite-contacts__avatar",children:(e.name||"?").trim().charAt(0).toUpperCase()}),(0,t.jsxs)("div",{className:"invite-contacts__text",children:[(0,t.jsx)("p",{className:"invite-contacts__name",children:e.name}),(0,t.jsxs)("p",{className:"invite-contacts__phone",children:[e.phone,n?(0,t.jsxs)("span",{className:"invite-contacts__invited",children:[" ","Invited"]}):null]})]}),(0,t.jsxs)("div",{className:"invite-contacts__actions",children:[(0,t.jsx)("button",{type:"button",className:"invite-contacts__icon-btn",onClick:()=>(e=>{let n=(0,P.xq)({name:e.savedName}),s=(0,P.ng)(e.phone,n);if(!s)return void u.oR.error("That contact has no usable phone number");(0,y.u4)("friends_invite_whatsapp_clicked",{source:"contacts_invite"}),window.open(s,"_blank","noopener,noreferrer")})(e),title:"Invite on WhatsApp","aria-label":"Invite ".concat(e.name," on WhatsApp"),children:(0,t.jsx)(o.gc,{icon:B.EYA})}),(0,t.jsx)("button",{type:"button",className:"invite-contacts__icon-btn",onClick:()=>D(e),title:"Copy invite message","aria-label":"Copy invite message for ".concat(e.name),children:(0,t.jsx)(o.gc,{icon:R===e.id?d.e68:d.jPR})}),(0,t.jsx)("button",{type:"button",className:"invite-contacts__invite ".concat(n?"invite-contacts__invite--done":""),disabled:n||s,onClick:()=>(e=>{p&&!F&&((0,y.u4)("friends_invite_contact_clicked",{target_user_id:e.id}),S(e.id),c((0,m.UP)({user_id_main:p,user_id_friend:e.id,friendship_status:"requested",relationship_strength:null,time_stamp:new Date().toISOString()})).finally(()=>S("")))})(e),"aria-label":n?"".concat(e.name," is invited"):"Invite ".concat(e.name),children:s?(0,t.jsx)(o.gc,{icon:d.z1G,spin:!0}):n?"Invited":(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.gc,{icon:d.isI})," Invite"]})})]})]},e.id)}),k&&(0,t.jsx)("div",{className:"invite-contacts__note-text invite-contacts__loading-more",children:(0,t.jsx)(I.default,{context:"generic",size:28,compact:!0})}),b&&!k&&(0,t.jsx)("div",{className:"invite-contacts__loading-more",children:(0,t.jsx)("button",{type:"button",className:"invite-contacts__link",onClick:w,children:"Show more contacts"})}),!b&&!k&&!h.searching&&(0,t.jsx)("p",{className:"invite-contacts__note-text invite-contacts__loading-more",children:"That's everyone."})]})}),r&&!T&&(0,t.jsx)("div",{className:"invite-contacts__footer",children:(0,t.jsx)("button",{type:"button",className:"invite-contacts__link",onClick:r,children:"Not in your contacts? Invite by phone number"})})]})})};var M=s(39882);let T=e=>{let{people:n=[],loading:s=!1,error:i=null,contactsSynced:l=null,styles:u,onAdd:_,onRetry:m,onInvite:p,isAdding:h,onNavigate:v}=e,[x,f]=(0,a.useState)(!1),j=(0,M.mH)({contactsSynced:l,loading:s,error:i,count:n.length});if(!(0,M.CZ)(j))return null;let N=(0,t.jsxs)("p",{className:u.sectionLabel,children:["People you may know","list"===j?" (".concat(n.length,")"):""]});return"loading"===j?(0,t.jsxs)(t.Fragment,{children:[N,[1,2].map(e=>(0,t.jsxs)("div",{className:u.skeletonRow,children:[(0,t.jsx)("span",{className:u.skeletonCircle}),(0,t.jsx)("span",{className:u.skeletonLine,style:{width:"50%"}})]},e))]}):"error"===j?(0,t.jsxs)(t.Fragment,{children:[N,(0,t.jsxs)("div",{className:u.contactsNote,children:[(0,t.jsx)("p",{className:u.contactsNoteText,children:"We could not load people from your contacts."}),(0,t.jsx)("button",{type:"button",className:u.contactsNoteAction,onClick:m,children:"Try again"})]})]}):"needs-sync"===j?(0,t.jsxs)(t.Fragment,{children:[N,(0,t.jsxs)("div",{className:u.contactsNote,children:[(0,t.jsx)("span",{className:u.contactsNoteIcon,children:(0,t.jsx)(o.gc,{icon:d.kWV})}),(0,t.jsxs)("div",{className:u.contactsNoteBody,children:[(0,t.jsx)("p",{className:u.contactsNoteTitle,children:"Find friends from your contacts"}),(0,t.jsx)("p",{className:u.contactsNoteText,children:"Sync your contacts once in the Travafa app and the people you already know will show up here. Until then you can invite someone by phone number."})]}),(0,t.jsxs)("button",{type:"button",className:u.contactsNoteAction,onClick:p,children:[(0,t.jsx)(o.gc,{icon:d.nWR})," Invite"]})]})]}):"empty"===j?(0,t.jsxs)(t.Fragment,{children:[N,(0,t.jsxs)("div",{className:u.contactsNote,children:[(0,t.jsx)("span",{className:u.contactsNoteIcon,children:(0,t.jsx)(o.gc,{icon:d.vlp})}),(0,t.jsx)("div",{className:u.contactsNoteBody,children:(0,t.jsx)("p",{className:u.contactsNoteText,children:"Everyone from your contacts who is on Travafa is already your friend."})})]})]}):(0,t.jsxs)(t.Fragment,{children:[N,(0,M.Qo)(n,x).map(e=>{var n;let s=null!=(n=null==h?void 0:h(e))&&n;
1return(0,t.jsxs)("div",{className:u.row,children:[(0,t.jsxs)(r(),{href:"/friends/".concat(e.id),className:u.rowLink,onClick:v,children:[(0,t.jsx)(c.default,{src:e.avatar,alt:e.name,width:42,height:42,className:u.avatar,unoptimized:!0}),(0,t.jsxs)("div",{className:u.rowInfo,children:[(0,t.jsx)("p",{className:u.rowName,children:e.name}),e.meta?(0,t.jsx)("p",{className:u.rowMeta,children:e.meta}):null]})]}),(0,t.jsx)("div",{className:u.rowActions,children:(0,t.jsx)("button",{type:"button",className:"".concat(u.btn," ").concat(u.btnPrimary),disabled:s,onClick:()=>null==_?void 0:_(e),"aria-label":"Add ".concat(e.name),children:s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.gc,{icon:d.z1G,spin:!0})," Adding"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.gc,{icon:d.nWR})," Add"]})})})]},e.id)}),(0,M.bp)(n)&&(0,t.jsxs)("button",{type:"button",className:u.showMore,onClick:()=>f(e=>!e),"aria-expanded":x,children:[x?"Show less":"Show all ".concat(n.length),(0,t.jsx)(o.gc,{icon:x?d.w2A:d.Jt$,className:u.showMoreIcon})]})]})};var D=s(81613);s(90843);var E=s(93923),G=s.n(E);let L=e=>{var n;return e.user_display_name||"".concat(e.user_first_name||""," ").concat(null!=(n=e.user_second_name)?n:"").trim()||e.user_handle||"User"},z="travafa.friends.partnerPromptDismissed",U=e=>{var n,s,i,g,b;let{active:k=!0,onNavigate:I}=e,P=(0,l.wA)(),{userId:F}=(0,_.i)(),{profile:S,loading:R}=(0,l.d4)(e=>e.userProfile),B=[null==S?void 0:S.firstName,null==S?void 0:S.lastName].filter(Boolean).join(" ").trim(),{contactsNotFriendsList:M,contactsNotFriendsLoading:E,contactsNotFriendsError:U,friendsList:O,friendsLoading:W,searchResults:J,searchLoading:K,friendRequestSuccess:H,friendRequestError:Q,updateFriendSuccess:Y,updateFriendError:Z,deleteFriendSuccess:$,deleteFriendError:V,partnerRequestSuccess:X,partnerRequestError:ee,acceptPartnerSuccess:en,acceptPartnerError:es,removePartnerSuccess:et,removePartnerError:ea,deletePartnerSuccess:ei,deletePartnerError:er}=(0,l.d4)(e=>e.friends),[ec,el]=(0,a.useState)(""),[eo,ed]=(0,a.useState)(null),[eu,e_]=(0,a.useState)(null),em=(e,n)=>(null==eu?void 0:eu.type)===e&&(null==eu?void 0:eu.id)===n,[ep,eh]=(0,a.useState)(null),[ev,ex]=(0,a.useState)(null),[ef,ej]=(0,a.useState)(null),[eN,ey]=(0,a.useState)(!1),[eg,eb]=(0,a.useState)(!1),[ek,ew]=(0,a.useState)(!1),[eI,eC]=(0,a.useState)(!1),[eP,eF]=(0,a.useState)(""),[eS,eR]=(0,a.useState)(!1),[eA,eB]=(0,a.useState)(!1),[eq,eM]=(0,a.useState)(!1),[eT,eD]=(0,a.useState)(!0);(0,a.useEffect)(()=>{try{eD("1"===window.localStorage.getItem(z))}catch(e){eD(!1)}},[]);let eE=(0,a.useCallback)(()=>{(0,y.u4)("friends_partner_prompt_dismissed"),eD(!0);try{window.localStorage.setItem(z,"1")}catch(e){}},[]),eG=(0,f.Jh)({enabled:!1,keepInvited:!0,dropFriendNamesakes:!1}),eL=eG.refresh,ez=eG.search;(0,a.useEffect)(()=>{k&&(P((0,m.M7)()),eL())},[k,P,eL]),(0,a.useEffect)(()=>{k&&F&&!S&&!R&&P((0,h.fetchUserProfile)())},[k,F,S,R,P]);let eU=null!=(g=null==S?void 0:S.contactsSynced)?g:null,eO=(0,a.useCallback)(function(){let{force:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};F&&(P((0,m.M7)()),eL({force:e}),e&&!0!==eU&&P((0,h.fetchUserProfile)()))},[P,F,eL,eU]);!function(e,n){let s=(0,a.useRef)(n);s.current=n,(0,a.useEffect)(()=>{let n;if(!e)return;let t=function(e){let s=function(e){var n;if(!Array.isArray(e))return null;let s=e.find(e=>x.aY.has(String((null==e?void 0:e.type)||"")));return null!=(n=null==s?void 0:s.id)?n:null}(e);return void 0===n?(n=s,!1):!!s&&s!==n&&(n=s,!0)},a=(0,v._J)(e,e=>{var n;t(e)&&(null==(n=s.current)||n.call(s))});return()=>{"function"==typeof a&&a()}},[e])}(k?F:null,eO);let eW=(0,a.useRef)(0),eJ=(0,a.useCallback)(()=>{let e=Date.now();e-eW.current<15e3||(eW.current=e,eO())},[eO]);(0,a.useEffect)(()=>{if(!k)return;let e=()=>{"visible"===document.visibilityState&&eJ()};return document.addEventListener("visibilitychange",e),window.addEventListener("focus",eJ),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",eJ)}},[k,eJ]);let[eK,eH]=(0,a.useState)(!1),eQ=(0,a.useCallback)(()=>{eK||((0,y.u4)("friends_manual_refresh_clicked"),eH(!0),eO({force:!0}),setTimeout(()=>eH(!1),600))},[eK,eO]);(0,a.useEffect)(()=>{let e=ec.trim();if(!e)return;let n=setTimeout(()=>{P((0,m.uL)({keyword:e}))},400);return()=>clearTimeout(n)},[ec,P]),(0,a.useEffect)(()=>{Y&&(u.oR.success("Friend request updated!"),P((0,m.M7)()),P((0,m.cI)()),e_(null)),Z&&(u.oR.error("Failed to update friend request"),P((0,m.cI)()),e_(null))},[Y,Z,P]),(0,a.useEffect)(()=>{H&&(u.oR.success("Friend request sent!"),P((0,m.M7)()),P((0,m.Wn)()),e_(null)),Q&&(u.oR.error("Failed to send friend request"),P((0,m.Wn)()),e_(null))},[H,Q,P]),(0,a.useEffect)(()=>{$&&(u.oR.success("Done"),P((0,m.M7)()),P((0,m._s)()),e_(null)),V&&(u.oR.error("Action failed"),P((0,m._s)()),e_(null))},[$,V,P]),(0,a.useEffect)(()=>{X&&(u.oR.success("Partner request sent!"),P((0,m.M7)()),P((0,m.Ss)())),ee&&(u.oR.error("Failed to send partner request"),P((0,m.Ss)()))},[X,ee,P]),(0,a.useEffect)(()=>{en&&(u.oR.success("Partner request accepted \uD83D\uDC9A"),P((0,m.M7)()),P((0,m.D8)()),e_(null)),es&&(u.oR.error("Failed to accept partner request"),P((0,m.D8)()),e_(null))},[en,es,P]),(0,a.useEffect)(()=>{et&&(u.oR.success("Partner request removed"),P((0,m.M7)()),P((0,m.zA)()),e_(null)),ea&&(u.oR.error("Failed to remove partner request"),P((0,m.zA)()),e_(null))},[et,ea,P]),(0,a.useEffect)(()=>{ei&&(u.oR.success("Partner removed"),P((0,m.M7)()),P((0,m.IT)()),e_(null)),er&&(u.oR.error("Failed to remove partner"),P((0,m.IT)()),e_(null))},[ei,er,P]);let eY=(0,a.useMemo)(()=>Array.isArray(O)?O:Array.isArray(null==O?void 0:O.data)?O.data:[],[O]),eZ=(0,a.useMemo)(()=>eY.filter(e=>{var n,s;return(null==(n=e.user_friends)?void 0:n.friendship_status)==="requested"&&(null==(s=e.user_friends)?void 0:s.user_id_friend)===F}).map(e=>({friendshipId:e.user_friends.friendship_id,userIdMain:e.user_friends.user_id_main,userIdFriend:e.user_friends.user_id_friend,userId:e.user.user_id,name:L(e.user),avatar:e.user.user_signed_image||"/avatars/7.png"})),[eY,F]),e$=(0,a.useMemo)(()=>eY.filter(e=>{var n,s;return(null==(n=e.user_friends)?void 0:n.friendship_status)==="requested"&&(null==(s=e.user_friends)?void 0:s.user_id_main)===F}).map(e=>({friendshipId:e.user_friends.friendship_id,userIdMain:e.user_friends.user_id_main,userIdFriend:e.user_friends.user_id_friend,userId:e.user.user_id,name:L(e.user),avatar:e.user.user_signed_image||"/avatars/7.png"})),[eY,F]),eV=(0,a.useMemo)(()=>{let e=eY.find(e=>{var n,s;return(null==(n=e.user_friends)?void 0:n.friendship_status)==="accepted"&&(null==(s=e.user_friends)?void 0:s.partner_request_status)==="accepted"});return e?{id:e.user.user_id,friendshipId:e.user_friends.friendship_id,userIdMain:e.user_friends.user_id_main,userIdFriend:e.user_friends.user_id_friend,name:L(e.user),handle:e.user.user_handle||"",avatar:e.user.user_signed_image||"/avatars/7.png"}:null},[eY]),eX=(0,a.useMemo)(()=>eY.filter(e=>{var n,s;return(null==(n=e.user_friends)?void 0:n.friendship_status)==="accepted"&&(null==(s=e.user_friends)?void 0:s.partner_request_status)!=="accepted"}).map(e=>{let n=e.user_friends.partner_request_status||"";return{id:e.user.user_id,name:L(e.user),avatar:e.user.user_signed_image||"/avatars/7.png",online:"Active"===e.user.user_status,partnerRequested:"requested"===n}}),[eY]),e0=(0,a.useMemo)(()=>!!eV||eX.some(e=>e.partnerRequested),[eV,eX]),e1=(0,a.useMemo)(()=>{let e=new Set([...eX,...eZ,...e$].map(e=>{var n,s;return String(null!=(s=null!=(n=null==e?void 0:e.id)?n:null==e?void 0:e.userId)?s:"")}
1).filter(Boolean));return(M||[]).map(e=>{var n;let s=String(null!=(n=null==e?void 0:e.user_id)?n:"");return s&&s!==String(F)?{id:s,name:(e.user_display_name||"").trim()||"".concat(e.user_first_name||""," ").concat(e.user_second_name||"").trim()||"Traveller",avatar:e.user_signed_image||"/avatars/7.png",meta:e.user_handle?"@".concat(e.user_handle):""}:null}).filter(Boolean).filter(n=>!e.has(n.id))},[M,eX,eZ,e$,F]);(0,a.useEffect)(()=>{e0&&eM(!1)},[e0]);let e4=!eT&&!eq&&!e0&&eX.length>0,e2=(0,a.useMemo)(()=>eY.filter(e=>{var n;return(null==(n=e.user_friends)?void 0:n.partner_request_status)==="requested"}).map(e=>({friendshipId:e.user_friends.friendship_id,userId:e.user.user_id,requestedByMe:e.user_friends.couple_requested_by===F,name:L(e.user),handle:e.user.user_handle||"",avatar:e.user.user_signed_image||"/avatars/7.png"})),[eY,F]),e8=(0,a.useMemo)(()=>e2.filter(e=>!e.requestedByMe),[e2]),e7=(0,a.useMemo)(()=>e2.filter(e=>e.requestedByMe),[e2]),e3=(0,a.useMemo)(()=>Array.isArray(J)?J.filter(e=>(null==e?void 0:e.user_id)&&String(e.user_id)!==String(F)).map(e=>{var n;let s=null==(n=eY.find(n=>{var s;return(null==n||null==(s=n.user)?void 0:s.user_id)===e.user_id}))?void 0:n.user_friends,t=null,a=null;return s&&(a=s,t="accepted"===s.friendship_status?"accepted":"requested"===s.friendship_status?s.user_id_main===F?"requested_by_me":"requested_to_me":s.friendship_status),{id:e.user_id,name:L(e),avatar:e.user_signed_image||"/avatars/7.png",handle:e.user_handle||"",status:t,raw:a}}):[],[J,eY,F]),e5=(e,n)=>((0,y.u4)("accepted"===n?"friends_accept_clicked":"friends_decline_clicked",{user_id:e.userId}),e_({type:"accepted"===n?"accept":"reject",id:e.friendshipId}),P((0,m.GB)({friendship_id:e.friendshipId,user_id_main:e.userIdMain,user_id_friend:e.userIdFriend,friendship_status:n,time_stamp:new Date().toISOString()}))),e6=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,y.u4)("friends_invite_contacts_clicked",{source:e}),eF(n),eC(!0)},e9=e=>{if(eG.total>0)return void e6(e);(0,y.u4)("friends_invite_clicked",{source:e}),ey(!0)},ne=e=>{if(!F)return void u.oR.error("User not logged in");String(e.id)!==String(F)&&((0,y.u4)("friends_add_clicked",{user_id:e.id}),e_({type:"add",id:e.id}),P((0,m.UP)({user_id_main:F,user_id_friend:e.id,friendship_status:"requested",relationship_strength:null,time_stamp:new Date().toISOString()})))},nn=!!B,ns=async e=>{if(e.id){if(!nn){u.oR.info("One moment — loading your profile"),R||P((0,h.fetchUserProfile)());return}(0,y.u4)("friends_nudge_clicked",{user_id:e.id}),ed(e.id);try{await (0,p.Mx)({friendUserId:e.id,fromUserId:F,fromName:B}),u.oR.success("Nudged ".concat(e.name," \uD83D\uDC4B"))}catch(e){(0,N.N)(e,{event:"caught_error",level:"warning",tags:{kind:"swallowed",module:"social/friends"}}),u.oR.error((null==e?void 0:e.name)==="MissingSenderNameError"?"We could not read your name — reload and try again":"Failed to send nudge")}finally{ed(null)}}},nt=(e,n)=>{n.stopPropagation();let s=n.currentTarget.getBoundingClientRect();eh({friend:e,top:s.bottom+6,right:Math.max(8,window.innerWidth-s.right)})},na=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"menu";(0,y.u4)("friends_request_partner_clicked",{user_id:e.id,source:n}),eh(null),eM(!1),P((0,m.Os)({user_id_friend:e.id}))},ni=e=>{(0,y.u4)("friends_remove_partner_request_clicked",{user_id:e.userId}),e_({type:"pRemove",id:e.friendshipId}),P((0,m.aJ)({friendship_id:e.friendshipId}))},nr=(e,n)=>{(0,y.u4)("friends_remove_partner_clicked",{user_id:e.id,delete_friendship:n}),e_({type:"pDelete",id:e.friendshipId}),P((0,m.wH)({user_id_first:e.userIdMain,user_id_second:e.userIdFriend,delete_friendship:n}))},nc=ec.trim().length>0,nl=new Set(e3.map(e=>String(e.id))),no=nc?eG.onTravafa.filter(e=>!nl.has(e.id)):[],nd=nc?eG.notOnTravafa:[],nu=no.length+nd.length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:G().searchWrap,children:[(0,t.jsx)("input",{className:G().searchInput,type:"text",placeholder:"Search people or your contacts…","aria-label":"Search people by name, email or handle, or your contacts by s
1aved name",value:ec,onChange:e=>{el(e.target.value),ez(e.target.value)}}),(0,t.jsx)("button",{type:"button",className:G().refreshBtn,onClick:eQ,disabled:eK,title:"Refresh","aria-label":"Refresh friends list",children:(0,t.jsx)(o.gc,{icon:d.$3Z,spin:eK})})]}),(0,t.jsx)("div",{className:G().body,onScroll:()=>{ep&&eh(null),ev&&ex(null)},children:nc?(K||eG.searching)&&0===e3.length&&0===nu?[1,2,3].map(e=>(0,t.jsxs)("div",{className:G().skeletonRow,children:[(0,t.jsx)("span",{className:G().skeletonCircle}),(0,t.jsx)("span",{className:G().skeletonLine,style:{width:"55%"}})]},e)):0===e3.length&&0===nu?(0,t.jsxs)("div",{className:G().empty,children:[(0,t.jsx)("p",{className:G().emptyText,children:"No people found."}),!1===eG.contactsSynced&&(0,t.jsx)("p",{className:G().emptyText,children:j.CF})]}):(0,t.jsxs)(t.Fragment,{children:[nu>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:G().sectionLabel,children:"From your contacts"}),no.map(e=>(0,t.jsxs)("div",{className:G().row,children:[(0,t.jsxs)(r(),{href:"/friends/".concat(e.id),className:G().rowLink,onClick:n=>{(0,y.u4)("friends_view_profile_clicked",{user_id:e.id,source:"contacts_search"}),null==I||I(n)},children:[(0,t.jsx)(c.default,{src:e.avatar||"/avatars/7.png",alt:e.name,width:42,he
1ight:42,className:G().avatar,unoptimized:!0}),(0,t.jsxs)("div",{className:G().rowInfo,children:[(0,t.jsx)("p",{className:G().rowName,children:e.name}),(0,t.jsx)("p",{className:G().rowMeta,children:e.handle?"@".concat(e.handle):"On Travafa"})]})]}),(0,t.jsx)("div",{className:G().rowActions,children:(0,t.jsxs)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnPrimary),onClick:()=>ne(e),disabled:em("add",e.id),"aria-label":"Add ".concat(e.name),children:[(0,t.jsx)(o.gc,{icon:em("add",e.id)?d.z1G:d.nWR,spin:em("add",e.id)})," ","Add"]})})]},e.id)),nd.slice(0,5).map(e=>(0,t.jsxs)("div",{className:G().row,children:[(0,t.jsx)(c.default,{src:"/avatars/7.png",alt:"",width:42,height:42,className:G().avatar,unoptimized:!0}),(0,t.jsxs)("div",{className:G().rowInfo,children:[(0,t.jsx)("p",{className:G().rowName,children:e.name}),(0,t.jsx)("p",{className:G().rowMeta,children:"Not on Travafa yet"})]}),(0,t.jsx)("div",{className:G().rowActions,children:e.invited?(0,t.jsxs)("span",{className:"".concat(G().btn," ").concat(G().btnGhost),children:[(0,t.jsx)(o.gc,{icon:d.a$})," Invited"]}):(0,t.jsxs)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnPrimary),onClick:()=>(e=>{if(!F)return void u.oR.error("User not logged in");(0,y.u4)("friends_invite_contact_clicked",{target_user_id:e.id,source:"search"}),e_({type:"add",id:e.id}),P((0,m.UP)({user_id_main:F,user_id_friend:e.id,friendship_status:"requested",relationship_strength:null,time_stamp:new Date().toISOString()}))})(e),disabled:em("add",e.id),"aria-label":"Invite ".concat(e.name),children:[(0,t.jsx)(o.gc,{icon:em("add",e.id)?d.z1G:d.isI,spin:em("add",e.id)})," ","Invite"]})})]},e.id)),nd.length>0&&(0,t.jsxs)("button",{type:"button",className:G().showMore,onClick:()=>e6("search",ec.trim()),children:[nd.length>5||eG.hasMore?"See all matching contacts":"Open in your contacts",(0,t.jsx)(o.gc,{icon:d.XkK,className:G().showMoreIcon})]}),e3.length>0&&(0,t.jsx)("p",{className:G().sectionLabel,children:"On Travafa"})]}),e3.map(e=>(0,t.jsxs)("div",{className:G().row,children:[(0,t.jsx)(c.default,{src:e.avatar,alt:e.name,width:42,he
1ight:42,className:G().avatar,unoptimized:!0}),(0,t.jsxs)("div",{className:G().rowInfo,children:[(0,t.jsx)("p",{className:G().rowName,children:e.name}),e.handle?(0,t.jsxs)("p",{className:G().rowMeta,children:["@",e.handle]}):null]}),(0,t.jsx)("div",{className:G().rowActions,children:"accepted"===e.status?(0,t.jsxs)(r(),{href:"/friends/".concat(e.id),className:"".concat(G().btn," ").concat(G().btnGhost),onClick:n=>{(0,y.u4)("friends_view_profile_clicked",{user_id:e.id}),null==I||I(n)},children:[(0,t.jsx)(o.gc,{icon:d.X46})," View"]}):"requested_by_me"===e.status?(0,t.jsxs)("span",{className:"".concat(G().btn," ").concat(G().btnGhost),children:[(0,t.jsx)(o.gc,{icon:d.a$})," Sent"]}):"requested_to_me"===e.status?(0,t.jsxs)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnAccept),disabled:em("accept",e.raw.friendship_id),onClick:()=>e5({friendshipId:e.raw.friendship_id,userId:e.id,userIdMain:e.raw.user_id_main,userIdFriend:e.raw.user_id_friend},"accepted"),children:[(0,t.jsx)(o.gc,{icon:em("accept",e.raw.friendship_id)?d.z1G:d.e68,spin:em("accept",e.raw.friendship_id)})," ","Accept"]}):"blocked"===e.status?(0,t.jsxs)("span",{className:"".concat(G().btn," ").concat(G().btnGhost),children:[(0,t.jsx)(o.gc,{icon:d.Dfk})," Blocked"]}):(0,t.jsxs)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnPrimary),onClick:()=>ne(e),disabled:em("add",e.id),children:[(0,t.jsx)(o.gc,{icon:em("add",e.id)?d.z1G:d.nWR,spin:em("add",e.id)})," ","Add"]})})]},e.id))]}):(0,t.jsxs)(t.Fragment,{children:[eV&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:G().sectionLabel,children:"Your Partner"}),(0,t.jsxs)("div",{className:G().row,children:[(0,t.jsxs)(r(),{href:"/friends/".concat(eV.id),className:G().rowLink,onClick:e=>{(0,y.u4)("friends_view_profile_clicked",{user_id:eV.id,source:"partner"}),null==I||I(e)},children:[(0,t.jsx)(c.default,{src:eV.avatar,alt:eV.name,width:42,he
1ight:42,className:G().avatar,unoptimized:!0}),(0,t.jsxs)("div",{className:G().rowInfo,children:[(0,t.jsxs)("p",{className:G().rowName,children:[eV.name," ",(0,t.jsx)(o.gc,{icon:d.qcK,style:{color:"#e11d48"}})]}),eV.handle?(0,t.jsxs)("p",{className:G().rowMeta,children:["@",eV.handle]}):(0,t.jsx)("p",{className:G().rowMeta,children:"Your partner"})]})]}),(0,t.jsx)("div",{className:G().rowActions,children:(0,t.jsx)("button",{type:"button",className:G().moreBtn,disabled:em("pDelete",eV.friendshipId),onClick:e=>nt({...eV,isPartnerCard:!0},e),"aria-label":"More actions for ".concat(eV.name),children:(0,t.jsx)(o.gc,{icon:em("pDelete",eV.friendshipId)?d.z1G:d.vaG,spin:em("pDelete",eV.friendshipId)})})})]})]}),eZ.length+e$.length>0&&(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("button",{type:"button",className:G().collapseHeader,onClick:()=>{(0,y.u4)("friends_toggle_friend_requests_clicked",{expanded:!eS}),eR(e=>!e)},"aria-expanded":eS,children:[(0,t.jsx)("span",{className:G().collapseTitle,children:"Friend Requests"}),(0,t.jsx)("span",{className:G().collapseCount,children:eZ.length+e$.length}),(0,t.jsx)(o.gc,{icon:eS?d.w2A:d.Jt$,className:G().collapseChevron})]})}),eS&&eZ.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:G().sectionLabel,children:["Requests (",eZ.length,")"]}),eZ.map(e=>(0,t.jsxs)("div",{className:G().row,children:[(0,t.jsx)(c.default,{src:e.avatar,alt:e.name,width:42,he
1ight:42,className:G().avatar,unoptimized:!0}),(0,t.jsxs)("div",{className:G().rowInfo,children:[(0,t.jsx)("p",{className:G().rowName,children:e.name}),(0,t.jsx)("p",{className:G().rowMeta,children:"wants to connect"})]}),(0,t.jsxs)("div",{className:G().rowActions,children:[(0,t.jsx)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnIcon," ").concat(G().btnAccept),disabled:em("accept",e.friendshipId)||em("reject",e.friendshipId),onClick:()=>e5(e,"accepted"),"aria-label":"Accept ".concat(e.name),children:(0,t.jsx)(o.gc,{icon:em("accept",e.friendshipId)?d.z1G:d.e68,spin:em("accept",e.friendshipId)})}),(0,t.jsx)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnIcon," ").concat(G().btnDecline),disabled:em("accept",e.friendshipId)||em("reject",e.friendshipId),onClick:()=>e5(e,"rejected"),"aria-label":"Decline ".concat(e.name),children:(0,t.jsx)(o.gc,{icon:em("reject",e.friendshipId)?d.z1G:d.GRI,spin:em("reject",e.friendshipId)})})]})]},e.friendshipId))]}),eS&&e$.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:G().sectionLabel,children:["Sent (",e$.length,")"]}),e$.map(e=>(0,t.jsxs)("div",{className:G().row,children:[(0,t.jsx)(c.default,{src:e.avatar,alt:e.name,width:42,he
1ight:42,className:G().avatar,unoptimized:!0}),(0,t.jsxs)("div",{className:G().rowInfo,children:[(0,t.jsx)("p",{className:G().rowName,children:e.name}),(0,t.jsx)("p",{className:G().rowMeta,children:"Pending approval"})]}),(0,t.jsxs)("div",{className:G().rowActions,children:[(0,t.jsxs)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnCancel),disabled:em("cancel",e.friendshipId),onClick:()=>(e=>((0,y.u4)("friends_cancel_request_clicked",{user_id:e.userId}),e_({type:"cancel",id:e.friendshipId}),P((0,m.aE)({friendship_id:e.friendshipId,user_id_main:e.userIdMain,user_id_friend:e.userIdFriend}))))(e),children:[(0,t.jsx)(o.gc,{icon:em("cancel",e.friendshipId)?d.z1G:d.GRI,spin:em("cancel",e.friendshipId)})," ","Cancel"]}),(0,t.jsx)("button",{type:"button",className:G().moreBtn,onClick:n=>((e,n)=>{n.stopPropagation();let s=n.currentTarget.getBoundingClientRect();ex({req:e,top:s.bottom+6,right:Math.max(8,window.innerWidth-s.right)})})(e,n),"aria-label":"More actions for ".concat(e.name),children:(0,t.jsx)(o.gc,{icon:d.vaG})})]})]},e.friendshipId))]}),e8.length+e7.length>0&&(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("button",{type:"button",className:G().collapseHeader,onClick:()=>{(0,y.u4)("friends_toggle_partner_requests_clicked",{expanded:!eA}),eB(e=>!e)},"aria-expanded":eA,children:[(0,t.jsx)("span",{className:G().collapseTitle,children:"Partner Requests"}),(0,t.jsx)("span",{className:G().collapseCount,children:e8.length+e7.length}),(0,t.jsx)(o.gc,{icon:eA?d.w2A:d.Jt$,className:G().collapseChevron})]})}),eA&&e8.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:G().sectionLabel,children:["Received (",e8.length,")"]}),e8.map(e=>(0,t.jsxs)("div",{className:G().row,children:[(0,t.jsx)(c.default,{src:e.avatar,alt:e.name,width:42,he
1ight:42,className:G().avatar,unoptimized:!0}),(0,t.jsxs)("div",{className:G().rowInfo,children:[(0,t.jsx)("p",{className:G().rowName,children:e.name}),(0,t.jsxs)("p",{className:G().rowMeta,children:[(0,t.jsx)(o.gc,{icon:d.qcK,style:{color:"#e11d48"}})," ","wants to be your partner"]})]}),(0,t.jsxs)("div",{className:G().rowActions,children:[(0,t.jsx)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnIcon," ").concat(G().btnAccept),disabled:em("pAccept",e.friendshipId)||em("pRemove",e.friendshipId),onClick:()=>(e=>{(0,y.u4)("friends_accept_partner_request_clicked",{user_id:e.userId}),e_({type:"pAccept",id:e.friendshipId}),P((0,m.Or)({friendship_id:e.friendshipId}))})(e),"aria-label":"Accept partner request from ".concat(e.name),children:(0,t.jsx)(o.gc,{icon:em("pAccept",e.friendshipId)?d.z1G:d.e68,spin:em("pAccept",e.friendshipId)})}),(0,t.jsx)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnIcon," ").concat(G().btnDecline),disabled:em("pAccept",e.friendshipId)||em("pRemove",e.friendshipId),onClick:()=>ni(e),"aria-label":"Decline partner request from ".concat(e.name),children:(0,t.jsx)(o.gc,{icon:em("pRemove",e.friendshipId)?d.z1G:d.GRI,spin:em("pRemove",e.friendshipId)})})]})]},e.friendshipId))]}),eA&&e7.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:G().sectionLabel,children:"Sent"}),e7.map(e=>(0,t.jsxs)("div",{className:G().row,children:[(0,t.jsx)(c.default,{src:e.avatar,alt:e.name,width:42,he
1ight:42,className:G().avatar,unoptimized:!0}),(0,t.jsxs)("div",{className:G().rowInfo,children:[(0,t.jsxs)("p",{className:G().rowName,children:[e.name," ",(0,t.jsx)(o.gc,{icon:d.qcK,style:{color:"#e11d48"}})]}),(0,t.jsx)("p",{className:G().rowMeta,children:"Awaiting response"})]}),(0,t.jsx)("div",{className:G().rowActions,children:(0,t.jsxs)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnCancel),disabled:em("pRemove",e.friendshipId),onClick:()=>ni(e),children:[(0,t.jsx)(o.gc,{icon:em("pRemove",e.friendshipId)?d.z1G:d.GRI,spin:em("pRemove",e.friendshipId)})," ","Cancel"]})})]},e.friendshipId))]}),eG.total>0&&(0,t.jsxs)("button",{type:"button",className:G().collapseHeader,onClick:()=>e6("entry"),children:[(0,t.jsx)(o.gc,{icon:d.vlp}),(0,t.jsx)("span",{className:G().collapseTitle,children:"From your contacts"}),(0,t.jsx)("span",{className:G().collapseCount,children:eG.total}),(0,t.jsx)(o.gc,{icon:d.XkK,className:G().collapseChevron})]}),(0,t.jsx)(T,{people:e1,loading:E,error:U,contactsSynced:null!=(b=null==S?void 0:S.contactsSynced)?b:null,styles:G(),onNavigate:I,onAdd:ne,onInvite:()=>e9("contacts_empty"),onRetry:()=>eL({force:!0}),isAdding:e=>em("add",e.id)}),e4&&(0,t.jsxs)("div",{className:G().partnerPrompt,children:[(0,t.jsx)("span",{className:G().partnerPromptIcon,children:(0,t.jsx)(o.gc,{icon:d.qcK})}),(0,t.jsxs)("div",{className:G().partnerPromptText,children:[(0,t.jsx)("p",{className:G().partnerPromptTitle,children:"Add your travel partner"}
1),(0,t.jsx)("p",{className:G().partnerPromptBody,children:"Pick one person to pin above your friends list."})]}),(0,t.jsxs)("div",{className:G().partnerPromptActions,children:[(0,t.jsx)("button",{type:"button",className:G().partnerPromptPrimary,onClick:()=>{(0,y.u4)("friends_partner_prompt_started"),eM(!0)},children:"Choose"}),(0,t.jsx)("button",{type:"button",className:G().partnerPromptDismiss,onClick:eE,"aria-label":"Dismiss partner suggestion",children:(0,t.jsx)(o.gc,{icon:d.GRI})})]})]}),eq&&(0,t.jsxs)("div",{className:G().pickingBar,children:[(0,t.jsx)("span",{children:"Choose your partner from the list below"}),(0,t.jsx)("button",{type:"button",className:G().pickingCancel,onClick:()=>eM(!1),children:"Cancel"})]}),(0,t.jsxs)("p",{className:G().sectionLabel,children:["All Friends (",eX.length,")"]}),W&&0===eX.length?[1,2,3,4].map(e=>(0,t.jsxs)("div",{className:G().skeletonRow,children:[(0,t.jsx)("span",{className:G().skeletonCircle}),(0,t.jsx)("span",{className:G().skeletonLine,style:{width:"60%"}})]},e)):0===eX.length?(0,t.jsxs)("div",{className:G().empty,children:[(0,t.jsx)(o.gc,{icon:d.USd,size:"2x",color:"#cbd2dc"}),(0,t.jsx)("p",{className:G().emptyTitle,children:"No friends yet"}),(0,t.jsx)("p",{className:G().emptyText,children:"Search above to find and add people."})]}):eX.map(e=>(0,t.jsxs)("div",{className:G().row,children:[(0,t.jsxs)(r(),{href:"/friends/".concat(e.id),className:G().rowLink,onClick:n=>{(0,y.u4)("friends_view_profile_clicked",{user_id:e.id}),null==I||I(n)},children:[(0,t.jsx)(c.default,{src:e.avatar,alt:e.name,width:42,he
1ight:42,className:G().avatar,unoptimized:!0}),(0,t.jsx)("div",{className:G().rowInfo,children:(0,t.jsx)("p",{className:G().rowName,children:e.name})})]}),(0,t.jsxs)("div",{className:G().rowActions,children:[eq?(0,t.jsxs)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnPartner),onClick:()=>na(e,"picker"),"aria-label":"Make ".concat(e.name," your partner"),children:[(0,t.jsx)(o.gc,{icon:d.qcK})," Partner"]}):(0,t.jsxs)("button",{type:"button",className:"".concat(G().btn," ").concat(G().btnNudge),onClick:()=>ns(e),disabled:eo===e.id||!nn,title:nn?"Nudge ".concat(e.name):"Loading your profile…","aria-label":"Nudge ".concat(e.name),children:[(0,t.jsx)(o.gc,{icon:d.jr8}),eo===e.id?"…":"Nudge"]}),(0,t.jsx)("button",{type:"button",className:G().moreBtn,onClick:n=>nt(e,n),"aria-label":"More actions for ".concat(e.name),children:(0,t.jsx)(o.gc,{icon:d.vaG})})]})]},e.id))]})}),(0,t.jsxs)("div",{className:G().footer,children:[(0,t.jsxs)("button",{type:"button",className:"".concat(G().footerBtn," ").concat(G().footerBtnInvite),onClick:()=>e9("footer"),children:[(0,t.jsx)(o.gc,{icon:d.nWR})," Invite"]}),(0,t.jsxs)("button",{type:"button",className:"".concat(G().footerBtn," ").concat(G().footerBtnCodes),onClick:()=>{(0,y.u4)("friends_invite_codes_clicked"),ew(!0)},children:[(0,t.jsx)(o.gc,{icon:d.y_8})," Invite codes"]}),(0,t.jsxs)("button",{type:"button",className:"".concat(G().footerBtn," ").concat(G().footerBtnBlocked),onClick:()=>{(0,y.u4)("friends_view_blocked_clicked"),eb(!0)},children:[(0,t.jsx)(o.gc,{icon:d.c7y})," Blocked"]})]}),ep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:G().menuBackdrop,onClick:()=>eh(null)}),(0,t.jsx)("div",{className:G().menu,style:{top:ep.top,right:ep.right},children:ep.friend.isPartnerCard?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:G().menuItem,onClick:()=>{nr(ep.friend,!1),eh(null)},children:[(0,t.jsx)(o.gc,{icon:d.bB2})," Remove partner (stay friends)"]}),(0,t.jsxs)("button",{type:"button",className:"".concat(G().menuItem," ").concat(G().menuItemDanger),onClick:()=>{ej({type:"unfriendPartner",friend:ep.friend}),eh(null)},children:[(0,t.jsx)(o.gc,{icon:d.c7y})," Remove partner & unfriend"]})]}):(0,t.jsxs)(t.Fragment,{children:[(ep.friend.partnerRequested||!e0)&&(0,t.jsxs)("button",{type:"button",className:G().menuItem,disabled:ep.friend.partnerRequested,onClick:()=>na(ep.friend,"menu"),children:[(0,t.jsx)(o.gc,{icon:d.qcK,style:{color:"#e11d48"}}),ep.friend.partnerRequested?"Partner Requested":"Request as Partner"]}),(0,t.jsxs)("button",{type:"button",className:"".concat(G().menuItem," ").concat(G().menuItemDanger),onClick:()=>{ej({type:"block",friend:ep.friend}),eh(null)},children:[(0,t.jsx)(o.gc,{icon:d.Dfk})," Block User"]}),(0,t.jsxs)("button",{type:"button",className:"".concat(G().menuItem," ").concat(G().menuItemDanger),onClick:()=>{ej({type:"remove",friend:ep.friend}),eh(null)},children:[(0,t.jsx)(o.gc,{icon:d.bB2})," Remove Friend"]})]})})]}),ev&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:G().menuBackdrop,onClick:()=>ex(null)}),(0,t.jsx)("div",{className:G().menu,style:{top:ev.top,right:ev.right},children:(0,t.jsxs)("button",{type:"button",className:G().menuItem,disabled:eo===ev.req.userId||!nn,onClick:()=>{ns({id:ev.req.userId,name:ev.req.name}),ex(null)},children:[(0,t.jsx)(o.gc,{icon:d.jr8,style:{color:"#0f766e"}}),eo===ev.req.userId?"Nudging…":"Nudge"]})})]}),(0,t.jsx)(w,{isOpen:eN,onClose:()=>ey(!1)}),(0,t.jsx)(q,{isOpen:eI,onClose:()=>eC(!1),initialQuery:eP,onInviteByPhone:()=>{(0,y.u4)("friends_invite_clicked",{source:"contacts_list"}),eC(!1),ey(!0)}}),(0,t.jsx)(A,{isOpen:ek,onClose:()=>ew(!1)}),(0,t.jsx)(C,{isOpen:eg,onClose:()=>eb(!1)}),(0,t.jsx)(D.A,{isOpen:null!==ef,title:(null==ef?void 0:ef.type)==="block"?"Block user?":(null==ef?void 0:ef.type)==="unfriendPartner"?"Remove partner & unfriend?":"Remove friend?",message:(null==ef?void 0:ef.type)==="block"?"Block ".concat(null==ef||null==(n=ef.friend)?void 0:n.name,"? They won't be able to see your profile or send you requests."):(null==ef?void 0:ef.type)==="unfriendPartner"?"Remove ".concat(null==ef||null==(s=ef.friend)?void 0:s.name," as your partner and unfriend them? This cannot be undone."):"Remove ".concat(null==ef||null==(i=ef.friend)?void 0:i.name," from your friends list? This cannot be undone."),confirmText:(null==ef?void 0:ef.type)==="block"?"Block":"Remove",cancelText:"Cancel",confirmVariant:"danger",onConfirm:()=>{if(!ef)return;let{type:e,friend:n}=ef;if("unfriendPartner"===e){nr(n,!0),ej(null);return}if((0,y.u4)("block"===e?"friends_block_confirm_clicked":"friends_remove_confirm_clicked",{user_id:n.id}),"block"===e)P((0,m.rn)({user_id_to_be_blocked:n.id})).unwrap().then(()=>{u.oR.success("Blocked ".concat(n.name)),P((0,m.M7)())}).catch(()=>u.oR.error("Couldn't block ".concat(n.name))).finally(()=>P((0,m.Bv)()));else if("remove"===e){let e=eY.find(e=>e.user.user_id===n.id&&"accepted"===e.user_friends.friendship_status);e&&P((0,m.aE)({friendship_id:e.user_friends.friendship_id,user_id_main:e.user_friends.user_id_main,user_id_friend:e.user_friends.user_id_friend}))}ej(null)},onCancel:()=>ej(null)})]})}},90843:()=>{},92137:(e,n,s)=>{"use strict";s.d(n,{_J:()=>d,bA:()=>u,he:()=>_});var t=s(39390),a=s(65669);let i="user-notifications",r="notifications";function c(e){let n=(0,t.aU)(a.app);return(0,t.rJ)(n,i,e,r)}let l=new Set(["title","body","type","read","created_at","auth_id","data"]);function o(e){var n,s,t,a,i;let r=e.data()||{},c=r.data&&"object"==typeof r.data?r.data:{},o={...c};for(let[e,n]of Object.entries(r))l.has(e)||(o[e]=n);return{id:e.id,title:r.title||"",body:r.body||"",type:r.type||"",tripId:r.trip_id||c.trip_id||"",authId:r.auth_id||"",read:!0===r.read,data:o,createdAt:"string"==typeof r.created_at?r.created_at:null!=(i=null==(a=r.created_at)||null==(t=a.toDate)||null==(s=t.call(a))||null==(n=s.toISOString)?void 0:n.call(s))?i:null}}function d(e,n){if(!e)return()=>{};let s=(0,t.P)(c(e),(0,t.My)("created_at","desc"),(0,t.AB)(50));return(0,t.aQ)(s,e=>{n(e.docs.map(o))},s=>(console.error("notifications subscribe error:",s),(0,t.aQ)((0,t.P)(c(e),(0,t.AB)(50)),e=>{let s=e.docs.map(o);s.sort((e,n)=>String(n.createdAt).localeCompare(String(e.createdAt))),n(s)})))}async function u(e,n){e&&n&&await (0,t.mZ)(function(e,n){let s=(0,t.aU)(a.app);return(0,t.H9)(s,i,e,r,n)}(e,n),{read:!0})}async function _(e){if(!e)return;let n=(0,t.P)(c(e),(0,t._M)("read","==",!1)),s=await (0,t.GG)(n);if(s.empty)return;let i=(0,t.aU)(a.app),r=(0,t.wP)(i);
1s.docs.forEach(e=>r.update(e.ref,{read:!0})),await r.commit()}},93847:(e,n,s)=>{"use strict";s.d(n,{I8:()=>c,Mx:()=>r});var t=s(43302);let a=e=>(e||"").trim();class i extends Error{constructor(){super("Cannot send a nudge without the sender's name"),this.name="MissingSenderNameError"}}let r=e=>{let{friendUserId:n,fromUserId:s,fromName:r}=e,c=a(r);if(!c)throw new i;return(0,t.f)({user_id:n,title:"".concat(c," has nudged you \uD83D\uDC4B"),body:"".concat(c," is thinking of you on Travafa. Plan your next trip together!"),type:"userFriends",primary_related_id:s||"",secondary_related_id:"",trip_id:"",action:""})},c=e=>{let{memberUserId:n,fromName:s,missing:r=[],tripId:c=""}=e,l=a(s);if(!l)throw new i;let o=r.filter(Boolean),d=o.length?"".concat(l," needs your ").concat(o.join(", ")," to add you to a booking. Add it to your profile once and it fills in automatically next time."):"".concat(l," needs a few profile details to add you to a booking.");return(0,t.f)({user_id:n,title:"".concat(l," needs your travel details"),body:d,type:"trip",image_link:"",primary_related_id:c,secondary_related_id:"",trip_id:c,action:""})}},93923:e=>{e.exports={overlay:"FriendsPanel_overlay__5g12D",overlayOpen:"FriendsPanel_overlayOpen__w7_PI",panel:"FriendsPanel_panel__gRtOF",panelOpen:"FriendsPanel_panelOpen__zhOvl",panelHeader:"FriendsPanel_panelHeader__npP_N",panelTitle:"FriendsPanel_panelTitle__NznFy",closeBtn:"FriendsPanel_closeBtn__5odSb",searchWrap:"FriendsPanel_searchWrap__aDSZn",searchInput:"FriendsPanel_searchInput___nETB",refreshBtn:"FriendsPanel_refreshBtn__R0UKs",body:"FriendsPanel_body__biKPc",sectionLabel:"FriendsPanel_sectionLabel__aNxYn",collapseHeader:"FriendsPanel_collapseHeader__2y1SZ",collapseTitle:"FriendsPanel_collapseTitle__2O_QV",collapseCount:"FriendsPanel_collapseCount__WsQTO",collapseChevron:"FriendsPanel_collapseChevron__0YPA_",row:"FriendsPanel_row__BgXiB",rowLink:"FriendsPanel_rowLink__4oiRD",avatar:"FriendsPanel_avatar__ktFGI",rowInfo:"FriendsPanel_rowInfo__fvYRb",rowName:"FriendsPanel_rowName__XQ00t",rowMeta:"FriendsPanel_rowMeta__rl6ne",rowActions:"FriendsPanel_rowActions__cdn0S",btn:"FriendsPanel_btn__Zj7S4",btnGhost:"FriendsPanel_btnGhost__L_ZpD",btnNudge:"FriendsPanel_btnNudge__MQKGj",btnPrimary:"FriendsPanel_btnPrimary__B_5lW",btnIcon:"FriendsPanel_btnIcon__ILB8M",btnAccept:"FriendsPanel_btnAccept__CJ5df",btnDecline:"FriendsPanel_btnDecline__Z2g1k",empty:"FriendsPanel_empty__Z1hoI",emptyTitle:"FriendsPanel_emptyTitle__EP77G",emptyText:"FriendsPanel_emptyText__b70Cm",skeletonRow:"FriendsPanel_skeletonRow__IaKM8",skeletonCircle:"FriendsPanel_skeletonCircle__cWEQc",friendsPulse:"FriendsPanel_friendsPulse__fBVrw",skeletonLine:"FriendsPanel_skeletonLine__P4iTF",btnCancel:"FriendsPanel_btnCancel__BsxpY",moreBtn:"FriendsPanel_moreBtn__O80Ja",menuBackdrop:"FriendsPanel_menuBackdrop__JxGHJ",menu:"FriendsPanel_menu__5JmJu",menuItem:"FriendsPanel_menuItem__4Qa7m",menuItemDanger:"FriendsPanel_menuItemDanger__LWt8d",footer:"FriendsPanel_footer__h4Cqk",footerBtn:"FriendsPanel_footerBtn__f9BUE",footerBtnInvite:"FriendsPanel_footerBtnInvite__ZVtEF",footerBtnBlocked:"FriendsPanel_footerBtnBlocked__uKujB",footerBtnCodes:"FriendsPanel_footerBtnCodes__Tjo_L",partnerPrompt:"FriendsPanel_partnerPrompt__pj4AC",partnerPromptIcon:"FriendsPanel_partnerPromptIcon__G_bTy",partnerPromptText:"FriendsPanel_partnerPromptText__JMAbA",partnerPromptTitle:"FriendsPanel_partnerPromptTitle__9YIBb",partnerPromptBody:"FriendsPanel_partnerPromptBody__ouODp",partnerPromptActions:"FriendsPanel_partnerPromptActions__xUUpt",partnerPromptPrimary:"FriendsPanel_partnerPromptPrimary__Tpgdi",partnerPromptDismiss:"FriendsPanel_partnerPromptDismiss__q0dMe",pickingBar:"FriendsPanel_pickingBar__z_KSF",pickingCancel:"FriendsPanel_pickingCancel__5dCBZ",btnPartner:"FriendsPanel_btnPartner__4hDtm",contactsNote:"FriendsPanel_contactsNote__lMeaG",contactsNoteIcon:"FriendsPanel_contactsNoteIcon__ocK0n",contactsNoteBody:"FriendsPanel_contactsNoteBody__GEBp8",contactsNoteTitle:"FriendsPanel_contactsNoteTitle___E9Dn",contactsNoteText:"FriendsPanel_contactsNoteText__RTzHJ",contactsNoteAction:"FriendsPanel_contactsNoteAction__yPFMj",showMore:"FriendsPanel_showMore___HDiw",showMoreIcon:"FriendsPanel_showMoreIcon__Gq30G"}}}]);

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.