PageSourceSearch

https://portal.ingemeinschaft.org/assets/index-gldDrzm5.js

js ingemeinschaft.org collected 2026-10-07 16:37:42 UTC 32,412 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DxyaykXf.js","assets/index-N0BqjmzG.js","assets/vendor-antd-D6_R94_L.js","assets/vendor-map-93e-Jyro.js","assets/index-DoyVpU3-.js","assets/styles-30HuEUzt.js","assets/index-FsEJsbPT.js","assets/scheduler-BfgJbc6d.js","assets/scheduling-3srRzUt2.js","assets/index-DlHUR1so.js"])))=>i.map(i=>d[i]);
2import{y as we,g as rt,cy as Bt,cz as Gt,x as Tt,u as Je,j as e,c1 as M,cA as q,bQ as ze,cB as Le,b3 as x,aC as je,ba as xe,cC as st,cD as Oe,cE as ft,p as j,aZ as nt,cF as Ke,J as Vt,cG as Wt,cH as bt,cI as Yt,cJ as Qt,cK as Jt,c as St,w as Xt,cL as Kt,P as Zt,cM as qt,bP as ke,z as ye,ca as es,U as ts,b7 as ae,cN as at,M as Me,al as ss,a4 as gt,aT as ns,h as as,cO as rs,bJ as xt,cP as is,$ as ge,cQ as G,cR as Ze,cS as Ve,b8 as qe,cT as os,cU as cs,b9 as et,cV as yt,aw as S,c6 as jt,av as ds,a_ as wt,cW as K,b2 as ce,cX as Et,cY as ls,cZ as Ne,o as us,c_ as hs,aQ as Xe,c$ as ps,an as _s,d0 as ms,F as fs}from"./index-N0BqjmzG.js";import{r as c,I as gs,P as Z}from"./vendor-antd-D6_R94_L.js";import{P as xs}from"./index.esm-CSKfLqDN.js";import{c as Ue,u as ys,E as js,n as ws,d as Ct,e as Es,s as Cs,f as Ds,S as Is,H as Dt,g as vs,h as Ts,i as Re,j as Ae,k as We,l as bs,D as Ss,m as Ps,o as ks}from"./styles-30HuEUzt.js";import{t as tt}from"./toNumber-stoG3ObE.js";import{B as $e}from"./Generic-r-mg_Hpx.js";import{p as Ns}from"./pollUntilReady-Cc8N8Ltb.js";import{S as It}from"./star-Cvdtmj6B.js";import"./index-CBj4nqzw.js";import"./index-BJtf8mr9.js";import{i as Rs,d as As}from"./index-qreVcNiv.js";import{C as Ye}from"./circle-check-DsOlmrrl.js";import"./vendor-map-93e-Jyro.js";import"./contractApiQueries-DxUDDHy9.js";const $s=we.button.withConfig({displayName:"styles__RateButton",componentId:"sc-knu9dw-0"})(["cursor:pointer;border:none;background:transparent;display:inline-flex;align-items:center;justify-content:center;svg{color:",";}"],({theme:s})=>s.colors.text),Ms=({hostId:s,houseId:O,closeSections:C,reviewData:re})=>{const{rating:r,review_text:h,created_at:W}=re,[T,E]=c.useState(r),[u,z]=c.useState(r),[f,P]=c.useState(h),{currentUserId:L}=rt(),{mutate:k,isLoading:de}=Bt(),{mutate:ie,isLoading:w}=Gt(),N=Tt(),{t:y,i18n:U}=Je("matches"),l=c.useMemo(()=>!!h&&(typeof f=="string"&&f.trim().length===0||!T)||!h&&!r&&typeof f=="string"&&f.trim().length===0,[U.language,T,f]),D=async()=>{if(!r&&!h)k({payload:{rating:T,review_text:f,house_id:O},hostId:s},{onError:R=>{R?.response?.data?.message==="Only one review allowed for the student"&&N.error({message:y("student.review.oneAllowedError")})}});else if(W&&(r&&r!==T||h?.length&&f?.trim().length&&h!==f.trim())){const R={created_at:W},b=f?.trim();b&&h!==b&&(R.review_text=b),T&&r!==T&&(R.rating=T),ie({payload:R,hostId:s,houseId:O,userId:L})}};return e.jsxs(Ue,{children:[e.jsxs(M,{$justify:"space-between",$gap:"0 1em",children:[e.jsx(q,{children:y(h?"student.review.edit":"student.review.create")}),e.jsx(ze,{onClick:C,icon:e.jsx(Le,{size:"0.875rem"}),size:"small",type:"text",$color:"midGrey",className:"backButton",children:y("back")})]}),e.jsx(x,{children:y("student.review.subTitle")}),e.jsx(M,{$justify:"flex-start",wrap:"nowrap",$gap:"0 8px",children:Array.from({length:5},(R,b)=>e.jsx($s,{"aria-label":y("student.review.rate",{rating:b+1}),onClick:()=>{E(b+1)},onMouseEnter:()=>z(b+1),onMouseLeave:()=>z(T),children:u&&b+1<=u?e.jsx(It,{size:20,fill:"currentColor"}):e.jsx(It,{size:20})},b))}),e.jsx(gs.TextArea,{size:"middle",autoSize:{minRows:3},placeholder:y("student.review.placeholder"),maxLength:800,value:f,disabled:de||w,onChange:R=>{P(R.target.value)}}),e.jsx(je,{type:"primary",disabled:l||!T||!f||de||w,onClick:D,loading:de||w,size:"large",children:y("student.review.button")})]})},zs=we.div.withConfig({displayName:"styles__ContainerView",componentId:"sc-1h5llpg-0"})(["margin:0 auto;padding:5.75em 0 5em;max-width:",";transition:0.3s all ease;.tenantMatchesPopup section{background-color:white;max-height:calc(var(--app-height) - 10%);}@media (max-width:","){padding:1.5em 20px 5em;}@media ","{.tenantMatchesPopup section{top:calc( 50% - "," / 2 );max-height:calc( var(--app-height) - "," - 4% );}.widePopup section{min-width:440px;}}@media ","{.oneTimeModal section,.widePopup section{min-width:calc(100% - 40px);}.tenantMatchesPopup section{top:calc( 50% - "," / 2 );max-height:calc( var(--app-height) - "," - 4% );}}"],({theme:s})=>s.sizes.maxWidthMainWindow,({theme:s})=>s.sizes.maxWidthMainWindow,({theme:s})=>s.media.tablet,({theme:s})=>s.sizes.mobileStickyNavbarHeight,({theme:s})=>s.sizes.mobileStickyNavbarHeight,({theme:s})=>s.media.phone,({theme:s})=>s.sizes.mobileStickyNavbarHeight,({theme:s})=>s.sizes.mobileStickyNavbarHeight),Ls=we.div.withConfig({displayName:"styles__CategoryButtonsContainer",componentId:"sc-1h5llpg-1"})(["display:flex;align-items:center;gap:1em;flex-wrap:wrap;@media ","{justify-content:flex-start;}"],({theme:s})=>s.media.phone),Os=we.ul.withConfig({displayName:"styles__SupportList",componentId:"sc-1h5llpg-2"})(["padding-left:1.5em;"]),Us=we.li.withConfig({displayName:"styles__SupportListItem",componentId:"sc-1h5llpg-3"})(["padding-left:0.5em;color:",";@media ","{font-size:",";}"],({theme:s})=>s.colors.hardGray,({theme:s})=>s.media.phone,({theme:s})=>s.font.sizeMinimum),vt=we.div.withConfig({displayName:"styles__StaticSupportContact",componentId:"sc-1h5llpg-4"})(["display:flex;flex-direction:column;gap:0.25em;width:100%;a{color:",";text-decoration:underline;}"],({theme:s})=>s.colors.primary),Hs=({stayStatus:s,intakeData:O,supportBooking:C,setSupportBooking:re,validSupportMeetDate:r,todayDate:h,language:W,onCloseSection:T,onOpenSupportModal:E})=>{const{t:u,i18n:z}=Je("matches"),f=j.features.tenantSchedulingEnabled;return e.jsxs(Ue,{children:[e.jsxs(M,{$justify:"space-between",$gap:"0 1em",children:[e.jsx(q,{children:u("student.supp
2ort.title")}),e.jsx(ze,{onClick:T,icon:e.jsx(Le,{size:"0.875rem"}),size:"small",type:"text",$color:"midGrey",className:"backButton",children:u("back")})]}),s!=="future"?e.jsxs(e.Fragment,{children:[!!r&&xe(r,h)&&e.jsx(x,{children:u("student.support.callPlannedInfo",{meetDate:Oe(r,ft,W),meetTime:st(r,"HH:mm")})}),e.jsx(x,{children:u("student.support.info1")}),e.jsx(x,{children:u("student.support.info2")}),e.jsxs(Ls,{children:[e.jsx(nt,{size:"middle",href:j.faqUrl,target:"_blank",rel:"noopener noreferrer",children:u("student.support.goToFAQ")}),j.supportContact?e.jsxs(vt,{children:[e.jsx(x,{children:e.jsx("strong",{children:u("student.support.contactHeading")})}),e.jsxs(x,{children:[u("student.support.emailLabel"),":"," ",e.jsx("a",{href:`mailto:${j.supportContact.email}`,children:j.supportContact.email})]}),e.jsxs(x,{children:[u("student.support.phoneLabel"),":"," ",e.jsx("a",{href:`tel:${j.supportContact.phone.replace(/\s+/g,"")}`,children:j.supportContact.phone})]})]}):f,f]})]}):j.supportContact?e.jsxs(vt,{children:[e.jsx(x,{children:u("student.support.igPostContractHeading")}),e.jsx(x,{children:e.jsx("strong",{children:u("student.support.contactHeading")})}),e.jsxs(x,{children:[u("student.support.emailLabel"),":"," ",e.jsx("a",{href:`mailto:${j.supportContact.email}`,children:j.supportContact.email})]}),e.jsxs(x,{children:[u("student.support.phoneLabel"),":"," ",e.jsx("a",{href:`tel:${j.supportContact.phone.replace(/\s+/g,"")}`,children:j.supportContact.phone})]})]}):e.jsxs(e.Fragment,{children:[O?e.jsx(x,{children:u("student.support.introCallPlanned",{meetDate:r?Oe(r,ft,W):"",meetTime:r?st(r,"HH:mm"):""})}):e.jsx(x,{children:u("student.support.introCallInfo1")}),Array.isArray(u("student.support.introCallTopics",{returnObjects:!0}))?e.jsx(Os,{children:u("student.support.introCallTopics",{returnObjects:!0}).map((P,L)=>e.jsx(Us,{children:P},`introCallTopic${L}`))}):null,e.jsx(x,{children:u("student.support.introCallInfo2")}),!O&&!C&&e.jsx(Ke,{size:"middle",onClick:E,children:u("student.support.planIntroCall")}),C&&e.jsxs(e.Fragment,{children:[e.jsx(x,{style:{marginBottom:8},children:e.jsx("strong",{children:new Intl.DateTimeFormat(z.language,{weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"Europe/Amsterdam"}).format(new Date(C.start_time))})}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx(Ke,{size:"middle",onClick:E,children:u("student.support.reschedule","Reschedule")}),e.jsx(Ke,{size:"middle",onClick:()=>{window.confirm(u("student.support.cancelConfirm","Are you sure you want to cancel this call?"))&&Vt.cancelBooking(C.booking_id,"Cancelled by student").then(()=>{re(null)})},children:u("student.support.cancelCall","Cancel call")})]})]})]})]})},Pt=c.lazy(()=>Xe(()=>import("./index-DxyaykXf.js"),__vite__mapDeps([0,1,2,3]))),Fs=c.lazy(()=>Xe(()=>import("./index-DoyVpU3-.js"),__vite__mapDeps([4,1,2,3,5])));c.lazy(()=>Xe(()=>import("./index-FsEJsbPT.js"),__vite__mapDeps([6,1,2,3,7,8,5])));const Bs=c.lazy(()=>Xe(()=>import("./index-DlHUR1so.js"),__vite__mapDeps([9,1,2,3,5]))),dn=()=>{const[s,O]=c.useState(),[C,re]=c.useState(!1),{currentUserId:r,userProfile:h}=rt(),{resetUnseenMatchCount:W}=Wt();c.useEffect(()=>{W()},[]);const{state:{chats:T,isLoadingChats:E}}=bt(),{fetchNextPage:u,hasNextPage:z,data:f,isFetching:P,isRefetching:L,isError:k,refetch:de}=Yt(!!r?.length,n=>n.filter(m=>!!m.house)),{data:ie,isFetching:w,isRefetching:N}=Qt(r,j.features.reviewsEnabled),{data:y,isFetching:U,isRefetching:l}=Jt(void 0,void 0,!!h?.recurrent_payments_enabled),{t:D,i18n:R}=Je("matches"),b=St(),{isOneTimeInfoShown:Ee,closeOneTimeModal:o}=ys(f?.pages),le=new Date;c.useEffect(()=>{z&&!P&&!L&&!k&&u()},[z,P,k,L]);const Y=async n=>{try{re(!0);const m=n.reduce((d,_)=>[...d,..._.data],[]);let A=new Map,ee=new Set;if(m.forEach(d=>{const _=T.find(Q=>Q.conversation_partner_short?.user_id===d.match.host_id);_?A.set(d.match.host_id,_.conversation_partner_short):ee.add(d.match.host_id)}),ee.size>0){const{users_short_description:d}=await ts.getShortDescription(Array.from(ee));d.forEach(_=>{A.set(_.user_id,_)})}const De=new Map;if(y)for(const d of y){const _=`${d.host_id}:${d.house_id}`,Q=De.get(_);Q?Q.push(d):De.set(_,[d])}let pe=[];m.forEach(d=>{if(A.get(d.match.host_id)){const _=d.match.check_in_date,Q=d.match.check_out_date;pe.push({...d,deposit:d.deposit||{},host:A.get(d.match.host_id),match:{...d.match,check_in_date:_?.length&&at(new Date(_))?_:null,check_out_date:Q?.length&&at(new Date(Q))?Q:null,checkout_date_actor:d.match.checkout_date_actor??null},payments:De.get(`${d.match.host_id}:${d.match.house_id}`),review:ie?.length&&_?.length&&le>ae(new Date(_))?ie.find(Ie=>Ie.host_id===d.match.host_id&&Ie.house_id===d.match.house_id):null})}}),O(pe)}catch{O([])}finally{re(!1)}};c.useEffect(()=>{!P&&!E&&!L&&!w&&!N&&!U&&!l&&f&&(k||!z)&&(f.pages.reduce((n,m)=>n+m.data.length,0)>0?Y(f.pages):O([]))},[f?.pages,ie,L,P,E,w,N,k,z,U,l]);const Ce=n=>(n.match.contract_status==="host_signed"||n.match.contract_status==="tenant_signed")&&n.match.match_status!==Me.ARCHIVED&&(!n.match.check_out_date||new Date(n.match.check_out_date)>=ae(le)),it=n=>{if(!n.match.check_in_date)return!1;const m=ae(new Date(n.match.check_in_date)),A=n.match.check_out_date?ae(new Date(n.match.check_out_date)):null,ee=ae(le);return m<=ee&&(A===null||A>=ee)&&n.match.match_status!==Me.ARCHIVED&&n.match.contract_status==="finished"&&!Ce(n)},He=n=>{if(!n.match.check_in_date)return!1;const m=ae(new Date(n.match.check_in_date)),A=ae(le);return m>A&&n.match.match_status!==Me.ARCHIVED&&n.match.contract_status==="finished"&&!Ce(n)},Fe=n=>{const m=n.match.check_out_date?new Date(n.match.check_out_date)<ae(le):!1,A=!!n.match.closed_at&&n.match.contract_status!=="finished";return m&&!A||n.match.match_status===Me.ARCHIVED},I=c.useMemo(()=>s?{invited:s.filter(Ce),current:s.filter(it),future:s.filter(He),past:s.filter(Fe)}:null,[s]),Be=!I||I.invited.length+I.current.length+I.future.length+I.past.length===0;return e.jsxs(zs,{children:[e.jsx(Xt,{children:e.jsx(xs,{onRefresh:async()=>{await de()},children:e.jsxs(Kt,{children:[e.jsx(Zt,{children:D("student.title")}),e.jsx(x,{children:D("student.overviewSubtitle")}),(!C&&!s||C||P||w||N||E||L||U||l)&&e.jsx(qt,{}),!C&&!E&&!P&&!w&&!N&&!L&&!U&&!l&&Array.isArray(s)&&e.jsx(e.Fragment,{children:Be?e.jsxs(e.Fragment,{children:[e.jsx(ke,{children:D("student.livingHere")}),e.jsxs(js,{children:[e.jsx("img",{src:ws,alt:"",loading:"lazy"}),e.jsx("p",{children:D("student.noMatches.text")})]}),e.jsx(je,{type:"primary",size:"large",onClick:()=>b(ye(es,{lng:R.language})),children:D("student.noMatches.btnText")})]}):I?e.jsxs(e.Fragment,{children:[I.invited.length>0&&e.jsxs(M,{width:"100%",$justify:"flex-start",$align:"flex-start",$gap:"1rem",children:[e.jsx(ke,{children:D("student.contractsToSign",{defaultValue:"Contracts to sign"})}),I.invited.map((n,m)=>c.createElement(Qe,{...n,key:`invitedStay${m}`,stayStatus:"future"}))]}),I.current.length>0&&e.jsxs(M,{width:"100%",$justify:"flex-start",$align:"flex-start",$gap:"1rem",children:[e.jsx(ke,{children:D("student.livingHere")}),I.current.map((n,m)=>c.createElement(Qe,{...n,key:`currentStay${m}`,stayStatus:"current"}))]}),I.future.length>0&&e.jsxs(M,{width:"100%",$justify:"flex-start",$align:"flex-start",$gap:"1rem",children:[e.jsx(ke,{children:D("student.futureLiving")}),I.future.map((n,m)=>c.createElement(Qe,{...n,key:`futureStay${m}`,stayStatus:"future"}))]}),I.past.length>0&&e.jsxs(M,{width:"100%",$justify:"flex-start",$align:"flex-start",$gap:"1rem",children:[e.jsx(ke,{children:D("student.pastLiving")}),I.past.map((n,m)=>c.createElement(Qe,{...n,key:`pastStay${m}`,stayStatus:"past"}))]})]}):null})]})})}),Ee&&!!h?.recurrent_payments_enabled&&e.jsx(Pt,{isShow:Ee,handleClose:o,className:"tenantMatchesPopup oneTimeModal",children:e.jsx(Bs,{closeModal:o})})]})};function Gs(s){return Object.fromEntries(s.map(O=>[O,!1]))}const Qe=c.memo(({host:s,match:O,review:C,deposit:re,stayStatus:r,contract:h,house:W,payments:T})=>{const[E,u]=c.useState(null),[z,f]=c.useState(Gs(ps)),[P,L]=c.useState(null),[k,de]=c.useState(null),ie=j.features.tenantSchedulingEnabled;c.useEffect(()=>{},[ie]);const{house_id:w,check_in_date:N,check_out_date:y,checkout_date_actor:U,contract_status:l,contract_id:D,deposit_id:R,match_status:b,premature_archive_date:Ee,student_action_extras:o,action_feature_enabled:le,
2intake_data:Y,payment_status:Ce,payment_link:it}=O,{price:He,additional_expenses:Fe,service_costs:I,deposit:Be}=W,{currentUserId:n,currentUserRole:m,userProfile:A}=rt();ss(),gt();const{isLoading:ee,watchPromise:De}=gt(),{mutate:pe}=ns(),d=St(),_=as(),Q=c.useMemo(()=>({prevPath:`${_.pathname}${_.search}${_.hash}`}),[_.hash,_.pathname,_.search]),Ie=new URLSearchParams(window.location.search).get("host_id"),ot=new URLSearchParams(window.location.search).get("house_id"),_e=new URLSearchParams(window.location.search).get("category"),kt=Tt(),{t,i18n:Nt}=Je("matches"),{language:H}=Nt;c.useEffect(()=>{Ie===s.user_id&&ot===w&&_e&&!(_e==="review"&&r==="future")&&!(_e==="review"&&s.is_deleted)&&!(_e==="contract"&&!me)?u(_e):u(null)},[Ie,ot,_e,D,b,N,y]);const{state:{chats:ct}}=bt(),ve=c.useMemo(()=>ct.find(i=>i.house_id===w&&i.host_id===s.user_id),[ct]),Rt=`${s.first_name??""} ${s.last_name??""}`.trim(),dt=C?.created_at?t("student.review.given"):t(r!=="future"?"student.review.give":"student.review.notGiven"),lt=r!=="future"?t("student.status.support"):Y||k?k?new Intl.DateTimeFormat(H,{weekday:"long",day:"numeric",month:"long",hour:"2-digit",minute:"2-digit",timeZone:"Europe/Amsterdam"}).format(new Date(k.start_time)):t("student.status.plannedIntroCall"):t("student.status.planIntroCall"),B=new Date,g=!!y&&new Date(y),te=!!N&&new Date(N),At=!!Y?.start_time&&at(new Date(Y.start_time))&&new Date(Y.start_time),se=!!g&&st(g,rs),Te=!!te&&xt(ae(te),B),me=(l==="host_signed"||l==="tenant_signed"||l==="finished")&&!!D,ut=t(l==="finished"?"contractSigned":!D||r==="past"?"contractNotSigned":l==="host_signed"?"signContract":l==="draft"?"contractNotSigned":"student.status.waitingContractSigning"),F=c.useMemo(()=>({price:h?h.contract_data.rental_price:He,additional_expenses:h?h.contract_data.additional_expenses??null:Fe,service_costs:h?h.contract_data.service_cost??null:I,deposit:h?h.contract_data.deposit:Be}),[Be,He,Fe,I,h?.contract_data.additional_expenses,h?.contract_data.rental_price,h?.contract_data.service_cost,h?.contract_data.deposit]),Ge=c.useMemo(()=>(tt(F.price)||0)+(tt(F.additional_expenses)||0)+(tt(F.service_costs)||0),[F.price,F.additional_expenses,F.service_costs]),$=c.useMemo(()=>[...T??[]].sort((i,a)=>i.payment_rent_period_start>a.payment_rent_period_start?1:i.payment_rent_period_start<a.payment_rent_period_start?-1:0),[T]);A?.recurrent_payments_enabled||t(Ce==="PAID"?"student.payment.paid":"student.payment.pay"),c.useMemo(()=>{let i={isInfo:!0,isInfoIcon:!1,isEvent:!1,isWarning:!1,isCaution:!1,text:`${(Math.round((Ge+is)*100)/100).toFixed(2)} p/m ${t("totalAmount")}`};if(!A?.recurrent_payments_enabled)return i;if(l==="finished"){const a=$?.length?$[$.length-1]:null;if(a&&g&&!ge(g)&&Rs(new Date(a.payment_rent_period_start),g)&&(a.recurrent_payment_status===G.STUDENT_PENDING||Ze("student",a.recurrent_payment_status))&&$.every(p=>p.recurrent_payment_status===G.STUDENT_PENDING||Ze("student",p.recurrent_payment_status)))i.text=t("payments.monthPaid",{month:Oe(new Date(a.payment_rent_period_start),"MMMM",H)}),i.isInfoIcon=!0;else if(!$?.find(p=>p.payment_type!==Ve.ONE_TIME)&&$?.find(p=>Ze("student",p.recurrent_payment_status))&&!(g&&!ge(g)&&xe(Ct(qe(B,1)),g)&&!$?.every(p=>os(p.recurrent_payment_status))))i={...i,text:t("student.payments.configure"),isEvent:!0,isInfo:!1};else{let p,V;if(!$?.length)i={...i,text:t("student.payments.payMonth",{month:Oe(te||B,"MMMM",H)}),isEvent:!0,isInfo:!1},p=Ct(te||B);else{const X=$.findLastIndex(ne=>ne.recurrent_payment_status===G.STUDENT_COMPLETED||ne.recurrent_payment_status===G.STUDENT_PENDING||ne.recurrent_payment_status===G.HOST_FAILED||ne.recurrent_payment_status===G.HOST_COMPLETED||ne.recurrent_payment_status===G.HOST_PENDING),fe=$.find(ne=>ne.recurrent_payment_status===G.INIT||ne.recurrent_payment_status===G.PAYMENT_FLOW_STARTED||ne.recurrent_payment_status===G.STUDENT_FAILED);V=fe||(X===-1?null:$[X]),p=fe||X===-1?new Date(fe?.payment_rent_period_start||$[0].payment_rent_period_start):qe(new Date($[X].payment_rent_period_start),1),i={...i,text:t(`student.payments.${V?.payment_type===Ve.AUTOMATIC&&(!fe||V?.recurrent_payment_status!==G.STUDENT_FAILED)||V?.payment_type===Ve.ONE_TIME_FA
2LLBACK&&!fe?"upcomingMonth":"payMonth"}`,{month:Oe(p,"MMMM",H)}),isEvent:!0,isInfo:!1}}const J=$?.length&&V?.payment_type===Ve.AUTOMATIC&&V?.recurrent_payment_status!==G.STUDENT_FAILED?Es(Cs(p,1),cs):p,he=xt(J,B);he<=15&&xe(J,B)&&(i.isWarning=!0),(he<=5&&xe(J,B)||xe(B,J))&&(i.isWarning=!1,i.isCaution=!0)}}return i},[l,Ge,H,g,te,$,A?.recurrent_payments_enabled]);const{withhold_data:$t,payment_succeeded_ts:ht,refund_succeeded_ts:Mt,refund_data:Vs,deposit_status:v,bank_transfer_amount:Ws,bank_transfer_succeeded_ts:Ys}=re,oe=(l==="host_signed"||l==="tenant_signed"||l==="finished")&&r!=="past";Ee?et(new Date(Ee),yt):g&&et(g,yt);const pt=v===S.DISPUTE_INITIATED||v===S.DISPUTE_REJECTED,ue=!R||v===S.FAILED||v===S.PENDING,zt=v===S.REFUNDED||v===S.PARTIALLY_REFUNDED;ht&&y&&et(new Date(ht),180)<Ds(new Date(y),15);const be=F.deposit?.length&&!isNaN(Number(F.deposit))?Number(F.deposit):0;oe&&ue&&o?.is_pay_deposit_checked,c.useMemo(()=>{if(r!=="past"&&b!==Me.ARCHIVED){if(be<jt)return null;const i=v===S.PAYED?t("deposit.paid"):t(oe&&ue?"student.deposit.pay":"deposit.infoStatus"),a=oe&&ue&&Te!==!1&&Te<=7&&Te>=1,p=t(`student.deposit.status.day${Te===1?"":"s"}LeftToPay`,{days:Te||""}),V=e.jsx(Z,{content:a?p:i,trigger:"hover",placement:"bottom",rootClassName:"mobile-horizontal-margin-popover",destroyOnHidden:!0,children:e.jsxs(K,{$isInfo:!ue||!oe||a,$isEvent:oe&&!a,$isCaution:a,children:[ue?oe?a?e.jsx(ks,{size:"1rem"}):e.jsx($e,{className:oe?void 0:"nonActive"}):e.jsx(ce,{size:"1rem"}):e.jsx(Ye,{size:"1.25rem"}),e.jsx("span",{children:a?p:i})]})});return{category:V,categoryOpen:ue?e.jsxs(e.Fragment,{children:[a&&V,oe?e.jsx(je,{type:"primary",size:"large",disabled:ee,loading:ee,onClick:()=>{if(v===S.PENDING)De(ds.getStripeClientSecret(R).then(({client_secret:J})=>{window.dataLayer.push({event:"Pending_deposit_match_activation",user_id:n,deposit_id:R??void 0,user_type:m});const he=new URLSearchParams({host_id:s.user_id,house_id:w,amount:be.toString(),payment_intent_client_secret:J});d({pathname:ye(wt,{lng:H,type:"deposit"}),search:"?"+he.toString()})}));else{window.dataLayer.push({event:"Deposit_match_activation",user_id:n,host_id:s.user_id,house_id:w,user_type:m});const J=new URLSearchParams({host_id:s.user_id,house_id:w,amount:be.toString()});d({pathname:ye(wt,{lng:H,type:"deposit"}),search:"?"+J.toString()})}},children:t("student.deposit.pay")}):e.jsx(Z,{content:t("student.deposit.signContractInfo"),trigger:"hover",placement:"bottom",rootClassName:"mobile-horizontal-margin-popover",destroyOnHidden:!0,children:e.jsx(je,{type:"primary",size:"large",disabled:!0,icon:e.jsx(Is,{style:{transform:"rotateY(180deg)"}}),children:t("student.deposit.pay")})})]}):V}}else if(ue||be<jt){const i=t("student.deposit.status.settledDirectly"),a=e.jsx(Z,{content:i,trigger:"hover",placement:"bottom",rootClassName:"mobile-horizontal-margin-popover",destroyOnHidden:!0,children:e.jsxs(K,{$isInfo:!0,children:[e.jsx(ce,{size:"1rem"}),e.jsx("span",{children:i})]})});return{category:a,categoryOpen:a}}else if(zt){if(v===S.PARTIALLY_REFUNDED&&$t?.amount?.length&&!Mt)return null;const i=t("deposit.refunded"),a=e.jsx(Z,{content:i,trigger:"hover",placement:"bottom",rootClassName:"mobile-horizontal-margin-popover",destroyOnHidden:!0,children:e.jsxs(K,{$isInfo:!0,$isEvent:!0,children:[e.jsx(Ye,{size:"1.25rem"}),e.jsx("span",{children:i})]})});return{categoryOpen:a,category:a}}else if(v===S.FULLY_WITHHELD){const i=t("student.deposit.fullyWithheld"),a=e.jsx(Z,{content:i,trigger:"hover",placement:"bottom",rootClassName:"mobile-horizontal-margin-popover",destroyOnHidden:!0,children:e.jsxs(K,{$isInfo:!0,children:[e.jsx(ce,{size:"1rem"}),e.jsx("span",{children:i})]})});return{categoryOpen:a,category:a}}else{const i=v===S.DISPUTE_REJECTED?t("student.deposit.status.rejectedProposal"):v===S.DISPUTE_INITIATED?t("student.deposit.checkDispute"):t("student.deposit.status.waitingRefund"),a=e.jsx(Z,{content:i,trigger:"hover",placement:"bottom",rootClassName:"mobile-horizontal-margin-popover",destroyOnHidden:!0,children:e.jsxs(K,{$isInfo:v!==S.DISPUTE_INITIATED,$isEvent:v===S.DISPUTE_INITIATED,children:[pt?v===S.DISPUTE_INITIATED?e.jsx($e,{}):e.jsx(ce,{size:"1rem"}):e.jsx(Dt,{size:"1rem"}),e.jsx("span",{children:i})]})});return{category:a,categoryOpen:pt?ve?e.jsx(e.Fragment,{children:v===S.DISPUTE_REJECTED?e.jsx(nt,{size:"large",onClick:()=>{d(ye(Et,{lng:H,id:ve.chat_id}))},children:t("goToChat")}):e.jsx(je,{type:"primary",size:"large",onClick:()=>{d(ye(Et,{lng:H,id:ve.chat_id}))},children:i})}):null:a}}},[H,l,v,R,be,ve?.chat_id,y,b,N]);const Lt=l==="finished"&&r!=="past"&&(!U||U==="host")&&!!g&&!!te&&xe(qe(new Date(B.getFullYear(),B.getMonth(),B.getDate()-1,0,0,1,0),3),te),Ot=!g||!se||g&&ge(g)?t("noEndDate"):r==="past"?t("rentEndedBy",{endDate:se}):t("rentEndsOn",{endDate:se}),Ut=!g||!se||g&&ge(g)?t("noEndDateHover"):r==="past"?t("rentEndedByHover",{endDate:se}):t("rentEndsOnHover",{endDate:se}),Ht=c.useMemo(()=>U==="host"?t("student.status.hostEndedRental",{endDate:se||"",hostName:s.first_name??"Host"}):r==="past"?g&&ge(g)?t("student.status.endedRentalNoEndDate"):t("student.status.endedRental",{endDate:se||""}):g&&(ge(g)||te&&As(g,te))?t("student.status.noEndDate"):t("student.status.isEndDate",{endDate:se||""}),[y,N,H,b,U,s.first_name]),Ft=async(i,a)=>{f(p=>({...p,[a]:!0}));try{const p=await Ns({fetchFn:()=>_s.downloadUrl(i,a)}),J=await(await fetch(p)).blob(),he=window.URL.createObjectURL(J),X=document.createElement("a");X.href=he,X.download=`${a==="de"?"vertrag":"contract"}_${a}.pdf`,document.body.appendChild(X),X.click(),document.body.removeChild(X),window.URL.revokeObjectURL(he)}catch(p){kt.error({message:t("contractDownloadError")}),ms(p)}finally{f(p=>({...p,[a]:!1}))}},_t=()=>{d(ye(fs,{lng:H,contractId:D}),{state:{prevPath:Q.prevPath}})},mt=c.useCallback(()=>L(null),[]),Se=i=>{const a=new URLSearchParams({host_id:s.user_id,house_id:w,category:i});d({pathname:_.pathname,search:"?"+a.toString()})},Pe=()=>{d({pathname:_.pathname})};return e.jsxs(e.Fragment,{children:[e.jsxs(ls,{children:[e.jsx(vs,{name:Rt,house:W,avatar:{thumbnailUrl:s.thumbnail_url,firstName:s.first_name,lastName:s.last_name},chatId:ve?.chat_id,check_in_date:N,check_out_date:y,isCounterpartDeleted:s.is_deleted,areCategories:me}),me&&!E?e.jsxs(Ts,{children:[e.jsxs(Re,{"aria-label":"Open contract section",$notPointed:!me,onClick:()=>
2{me&&Se("contract")},children:[e.jsxs(Ae,{children:[e.jsxs(q,{children:[t("contract"),l==="host_signed"&&e.jsx(We,{})]}),e.jsx(Ne,{size:"0.875rem"})]}),e.jsx(Z,{content:ut,trigger:"hover",placement:"bottom",rootClassName:"mobile-horizontal-margin-popover",destroyOnHidden:!0,children:e.jsxs(K,{$isInfo:l!=="host_signed",$isEvent:l==="finished",children:[l==="finished"&&e.jsx(Ye,{size:"1.25rem"}),l==="host_signed"&&e.jsx($e,{}),l!=="host_signed"&&l!=="finished"&&e.jsx(ce,{size:"1rem"}),e.jsx("span",{children:ut})]})})]}),j.features.depositsEnabled,j.features.paymentsEnabled,l==="finished"&&e.jsxs(Re,{"aria-label":"Open rent info section",onClick:()=>Se("rentInfo"),children:[e.jsxs(Ae,{children:[e.jsx(q,{children:t("student.rentInfo.title")}),e.jsx(Ne,{size:"0.875rem"})]}),e.jsxs(K,{$isInfo:!0,children:[e.jsx(bs,{size:"1rem"}),e.jsxs("span",{children:[Ge.toFixed(2)," €/m"]})]})]}),e.jsxs(Re,{"aria-label":"Open rental period section",onClick:()=>{U==="host"&&!o?.is_host_ended_rental_period_checked&&pe({payload:{host_id:s.user_id,house_id:w,student_id:n,data:{is_pay_deposit_checked:o?o.is_pay_deposit_checked:!1,is_withhold_deposit_proposal_checked:o?o.is_withhold_deposit_proposal_checked:!1,is_create_review_checked:o?o.is_create_review_checked:!1,is_plan_intro_call_checked:o?o.is_plan_intro_call_checked:!1,is_host_ended_rental_period_checked:!0}}}),Se("rentalPeriod")},children:[e.jsxs(Ae,{children:[e.jsxs(q,{children:[t("rentalPeriod"),U==="host"&&!o?.is_host_ended_rental_period_checked&&e.jsx(We,{})]}),e.jsx(Ne,{size:"0.875rem"})]}),e.jsx(Z,{content:Ut,trigger:"hover",placement:"bottom",rootClassName:"mobile-horizontal-margin-popover",destroyOnHidden:!0,children:e.jsxs(K,{$isInfo:!0,$isEvent:r==="past",children:[e.jsx(ce,{size:"1rem"}),e.jsx("span",{children:Ot})]})})]}),e.jsxs(Re,{"aria-label":"Open support section",onClick:()=>{r==="future"&&!o?.is_plan_intro_call_checked&&pe({payload:{host_id:s.user_id,house_id:w,student_id:n,data:{is_pay_deposit_checked:o?o.is_pay_deposit_checked:!1,is_withhold_deposit_proposal_checked:o?o.is_withhold_deposit_proposal_checked:!1,is_create_review_checked:o?o.is_create_review_checked:!1,is_host_ended_rental_period_checked:o?o.is_host_ended_rental_period_checked:!1,is_plan_intro_call_checked:!0}}}),Se("support")},children:[e.jsxs(Ae,{children:[e.jsxs(q,{children:[t("student.support.title"),r==="future"&&!o?.is_plan_intro_call_checked&&!k&&e.jsx(We,{})]}),e.jsx(Ne,{size:"0.875rem"})]}),e.jsx(Z,{content:lt,trigger:"hover",placement:"bottom",rootClassName:"mobile-horizontal-margin-popover",destroyOnHidden:!0,children:e.jsxs(K,{$isInfo:r!=="future"||!!Y||!!k,$isEvent:!(r==="future"&&(Y||k)),children:[r!=="future"?e.jsx(ce,{size:"1rem"}):e.jsx(e.Fragment,{children:!Y&&!k?e.jsx($e,{}):e.jsx(Dt,{size:"1rem"})}),e.jsx("span",{children:lt})]})})]}),!s.is_deleted&&e.jsxs(Re,{"aria-label":"Open review section",$notPointed:r==="future",onClick:()=>{r!=="future"&&(!C&&!o?.is_create_review_checked&&pe({payload:{host_id:s.user_id,house_id:w,student_id:n,data:{is_pay_deposit_checked:o?o.is_pay_deposit_checked:!1,is_host_ended_rental_period_checked:o?o.is_host_ended_rental_period_checked:!1,is_withhold_deposit_proposal_checked:o?o.is_withhold_deposit_proposal_checked:!1,is_plan_intro_call_checked:o?o.is_plan_intro_call_checked:!1,is_create_review_checked:!0}}}),Se("review"))},children:[e.jsxs(Ae,{children:[e.jsxs(q,{children:[t("student.review.title"),r!=="future"&&!C&&!o?.is_create_review_checked&&e.jsx(We,{})]}),r!=="future"&&e.jsx(Ne,{size:"0.875rem"})]}),e.jsx(Z,{content:dt,trigger:"hover",placement:"bottom",rootClassName:"mobile-horizontal-margin-popover",destroyOnHidden:!0,children:e.jsxs(K,{$isInfo:!!C?.created_at||r==="future",$isEvent:r!=="future",children:[C?.created_at?e.jsx(Ye,{size:"1.25rem"}):r!=="future"?e.jsx($e,{}):e.jsx(ce,{size:"1rem"}),e.jsx("span",{children:dt})]})})]})]}):null,E==="deposit"&&j.features.depositsEnabled,E==="review"&&j.features.reviewsEnabled&&!s.is_deleted&&e.jsx(Ms,{hostId:s.user_id,houseId:w,reviewData:C||{},closeSections:Pe}),E==="rentalPeriod"&&e.jsxs(Ue,{children:[e.jsxs(M,{$justify:"space-between",$gap:"0 1em",children:[e.jsx(q,{children:t("rentalPeriod")}),e.jsx(ze,{onClick:Pe,icon:e.jsx(Le,{size:"0.875rem"}),size:"small",type:"text",$color:"midGrey",className:"backButton",children:t("back")})]}),e.jsx(Ss,{start:N??"",end:y??"",c:"hardGray",isShortYear:!0,context:"profileOverview",className:"dateLine"}),e.jsx(x,{children:Ht}),Lt&&e.jsx(us,{fontSize:"1rem",$outline:!0,lineHeight:"1.5",height:40,$p:"6px 1em",style:{borderRadius:"0.5em",alignSelf:"flex-start"},onClick:()=>{L("endRental")},children:t("student.rentalPeriod.buttonEnd")}
2)]}),E==="contract"&&me&&e.jsxs(Ue,{children:[e.jsxs(M,{$justify:"space-between",$gap:"0 1em",children:[e.jsx(q,{children:t("contract")}),e.jsx(ze,{onClick:Pe,icon:e.jsx(Le,{size:"0.875rem"}),size:"small",type:"text",$color:"midGrey",className:"backButton",children:t("back")})]}),l==="finished"?e.jsxs(e.Fragment,{children:[e.jsx(x,{children:t("student.contract.finishedInfo")}),e.jsx(x,{children:t("student.contract.endRentalInfo")}),e.jsx(M,{$gap:"1rem",direction:"column",$align:"flex-start",$justify:"flex-start",children:(j.supportedLanguages??["de","gb"]).map(i=>{const a=i==="gb"?"en":i;return e.jsxs(hs,{type:"text",size:"middle",disabled:z[a],loading:z[a],onClick:()=>{Ft(D,a)},children:[e.jsx("span",{children:z[a]?t("documentGenerating"):`${a.toUpperCase()}: ${a==="de"?"vertrag":"contract"}.pdf`}),!z[a]&&e.jsx(Ps,{height:12,width:12})]},a)})})]}):l==="tenant_signed"?e.jsx(x,{children:t("student.contract.tenantSignedInfo_2party")}):l==="host_signed"?e.jsxs(e.Fragment,{children:[e.jsx(x,{children:t("student.contract.hostSignedInfo")}),e.jsx(je,{type:"primary",size:"middle",onClick:_t,children:t("student.signButton")})]}):e.jsxs(e.Fragment,{children:[e.jsx(x,{children:t("student.contract.draftInfo")}),e.jsx(nt,{size:"middle",onClick:_t,children:t("student.readContract")})]})]}),E==="payments"&&j.features.paymentsEnabled,E==="payments"&&j.features.paymentsEnabled,E==="rentInfo"&&!0&&l==="finished"&&e.jsxs(Ue,{children:[e.jsxs(M,{$justify:"space-between",$gap:"0 1em",children:[e.jsx(q,{children:t("student.rentInfo.title")}),e.jsx(ze,{onClick:Pe,icon:e.jsx(Le,{size:"0.875rem"}),size:"small",type:"text",$color:"midGrey",className:"backButton",children:t("back")})]}),e.jsx(x,{children:t("student.rentInfo.breakdown")}),e.jsxs("div",{children:[e.jsxs(M,{$justify:"space-between",children:[e.jsx("span",{children:t("student.rentInfo.baseRent")}),e.jsxs("span",{children:["€",F.price]})]}),e.jsxs(M,{$justify:"space-between",children:[e.jsx("span",{children:t("student.rentInfo.serviceCosts")}),e.jsxs("span",{children:["€",F.service_costs]})]}),Number(F.additional_expenses)>0&&e.jsxs(M,{$justify:"space-between",children:[e.jsx("span",{children:t("student.rentInfo.additionalCosts")}),e.jsxs("span",{children:["€",F.additional_expenses]})]}),e.jsxs(M,{$justify:"space-between",style:{fontWeight:"bold",borderTop:"1px solid #eee",paddingTop:"0.5em",marginTop:"0.5em"},children:[e.jsx("span",{children:t("student.rentInfo.total")}),e.jsxs("span",{children:["€",Ge.toFixed(2)]})]})]})]}),E==="support"&&e.jsx(Hs,{stayStatus:r,intakeData:Y,supportBooking:k,setSupportBooking:de,validSupportMeetDate:At||null,todayDate:B,language:H,onCloseSection:Pe,onOpenSupportModal:()=>L("support")})]}),!!P&&e.jsxs(Pt,{isShow:!!P,handleClose:mt,className:`tenantMatchesPopup${P==="support"?" widePopup":""}`,children:[P==="endRental"&&e.jsx(Fs,{houseId:w,hostId:s.user_id,serverCheckInDate:N,closeModal:mt}),ie]})]})});export{dn as default};

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.