1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9845],{4167:(e,t,r)=>{"use strict";r.d(t,{_:()=>i});var a=r(26514),n=r(97700);function i({children:e,hasError:t,hasWarning:r}){return(0,a.jsxs)("div",{className:"flex rounded-lg bg-tertiary-100 font-normal group-hover:bg-white dark:bg-night-700 dark:group-hover:bg-night-600",children:[(0,a.jsx)("div",{className:(0,n.cn)("w-1 rounded-l-lg",t?"bg-critical-red":r?"bg-warning-solid":"bg-tertiary-300 dark:bg-night-500")}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden p-4",children:e})]})}},7759:(e,t,r)=>{"use strict";r.d(t,{NG:()=>h,e1:()=>u,sM:()=>m});var a,n=r(26514),i=r(62687),s=r(6464),l=r(97925),o=r(24222),d=r(97700),c=r(75834),u=((a={}).Loading="loading",a.Pending="pending",a.Incomplete="incomplete",a.Complete="complete",a.Disabled="disabled",a.Invisible="invisible",a);function h({action:e,children:t,innerNav:r,status:a="incomplete",title:u}){let[m,f]=(0,c.useState)(!1);return((0,c.useEffect)(()=>{"complete"===a&&m?f(!1):"incomplete"!==a||m||f(!0)},[a]),"invisible"===a)?null:(0,n.jsxs)("div",{className:"flex gap-x-4",children:[(0,n.jsx)("div",{className:(0,d.cn)("flex h-6 w-6 items-center justify-center rounded-full bg-tertiary-200 dark:bg-night-700","complete"===a&&"bg-success-green","pending"===a&&"bg-tertiary-600"),children:(0,n.jsx)(s.I,{iconName:"pending"===a?s.$.Hourglass:s.$.Check,strokeWidth:"pending"===a?2:4,className:"text-white",size:15})}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col gap-x-2 gap-y-2 sm:flex-row sm:items-start",children:[(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsxs)("div",{className:"flex flex-1 gap-x-2",children:[(0,n.jsx)("div",{className:"flex-1",children:"complete"===a||"disabled"===a?(0,n.jsxs)("button",{type:"button",onClick:()=>f(!m),className:(0,d.cn)("inline-flex items-center gap-x-1 font-semibold text-tertiary-700 focus:outline-hidden dark:text-tertiary-300","complete"===a&&"opacity-80","disabled"===a&&"opacity-60"),children:[u," ",(0,n.jsx)(s.I,{iconName:m?s.$.Collapse:s.$.Expand,className:"text-tertiary-400 dark:text-tertiary-500",size:12})]}):(0,n.jsx)(o.E,{className:"font-semibold",children:u})}),(0,n.jsx)(i.e,{as:"div",show:m,enter:"transition duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:r})]}),(0,n.jsx)(i.e,{as:"div",show:m,enter:"transition-all duration-300",enterFrom:"opacity-0 max-h-0",enterTo:"opacity-100 max-h-[1000px]",leave:"transition-all duration-300",leaveFrom:"opacity-100 max-h-[1000px]",leaveTo:"opacity-0 max-h-0",className:"flex-1 text-sm text-tertiary-500 dark:text-tertiary-400",children:"loading"===a?(0,n.jsx)(l.R,{height:25}):t})]}),(0,n.jsx)(i.e,{as:"div",show:m,enter:"transition duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",className:"flex justify-end",children:e})]})]})}function m(e,t){return e===t?0:"complete"===e?-1:"complete"===t||"disabled"===e?1:"disabled"===t?-1:0}},8182:(e,t,r)=>{"use strict";r.d(t,{a:()=>u});var a=r(26514),n=r(8584),i=r(25453),s=r(6464),l=r(79230),o=r(37182),d=r(25203),c=r(46225);function u({project:e,customer:t}){let{push:r}=(0,c.useRouter)(),h=(0,d.YK)(),m=(0,o.v)(),f=h?.every(e=>e.status!==n.X.Filed&&e.status!==n.X.ApprovedBSFZ&&e.status!==n.X.RejectedBSFZ),x=null!==t&&null!==t.uploadedElsterCertificateAt;return m||x||!f||e?.status===n.X.Superseded?null:(0,a.jsx)("div",{className:"px-2 max-md:p-0",children:(0,a.jsx)(i.l,{icon:(0,a.jsx)(s.I,{iconName:s.$.FileBadge,size:24}),kind:"warning",title:"ELSTER Zertifikat ben\xf6tigt",details:"Damit wir euren Antrag einreichen k\xf6nnen, lade bitte euer ELSTER Zertifikat und Passwort f\xfcr ein vollwertiges Benutzerkonto hoch.",className:"max-md:rounded-none",actionBtn:{icon:(0,a.jsx)(s.I,{iconName:s.$.UploadFile,size:20}),label:"Hochladen",onClick:()=>r(`/company/general?showModal=${l.p.UploadElster}`)}})})}},19763:(e,t,r)=>{"use strict";r.d(t,{Ar:()=>m,Oq:()=>f,RE:()=>h,uA:()=>x});
1var a,n=r(76012),i=r(85203),s=r(13002),l=r(81054),o=r(80036),d=r(31972),c=r(43247),u=r(51193),h=((a=h||{}).Calculated="calculated",a.EstimatedFull="estimated",a.MissingData="missing_data",a);function m(e,t=!1){let r=f(e,t);return r.funding>0?r:x(e)}function f(e,t=!1){let r={funding:0,yearlyFunding:{},yearlyFundingInternal:{},missingData:[],yearlyFundingExternal:{},yearlyStaffCost:{},yearlyExternalContractorCost:{},yearlyAssessmentBasisInternal:{},yearlyAssessmentBasisExternal:{},kind:"calculated"};if(null===e.startDate)return r.missingData.push({kind:"startDate"}),r;if(null===e.endDate)return r.missingData.push({kind:"endDate"}),r;let a=(0,o.R)((0,c.pp)(e.startDate),(0,c.pp)(e.endDate)),n=(0,c.pp)(e.startDate),i=(0,c.pp)(e.endDate),l=(0,c.pp)("2024-03-28"),h=n>=(0,c.pp)("2026-01-01"),m=n>=l?u.K4:u.s1;for(let l of a){let a=`year_${l}`,o=u.vT,f=u.eT,x=parseInt(l);if(2024===x){if(f=i>(0,c.pp)("2024-03-27")?u.Y2:u.eT,!e.isNotSME){let e=(0,c.pp)("2024-01-01"),t=(0,c.pp)("2024-12-31"),r=n>e?n:e,a=i<t?i:t;o=p({initialFundingRate:u.vT,followingFundingRate:u.FH,startTimePeriod:r,endTimePeriod:a,firstDayOfNewRate:(0,c.pp)("2024-03-28")})}}else x>2024&&x<=2025?(f=u.Y2,e.isNotSME||(o=u.FH)):x>2025&&(f=u.EB,e.isNotSME||(o=u.FH));let g=e.internalStaffCostRnD[a];"number"!=typeof g&&(r.missingData.push({kind:"internalStaffCost"}),g=0);let y=e.fundingAssessmentBasisInternal[a];e.hasOtherFunding?"number"!=typeof y&&(r.missingData.push({kind:"fundingAssessmentBasisInternal"}),y=0):y=0;let j=Math.min(t?g:Math.max(g-y,0),f),b=h?Math.min(u.YQ*j,f-j):0,v=(j+b)*o,k=0;for(let t of e.companies)if(t.isContractor&&(t.id===s.O4||d.iq[t.country])){let e=t.yearlyCost[a];"number"!=typeof e?r.missingData.push({kind:"contractorYearlyCost"}):k+=e}let N=e.fundingAssessmentBasisExternal[a];e.hasOtherFunding?"number"!=typeof N&&(r.missingData.push({kind:"fundingAssessmentBasisExternal"}),N=0):N=0;let w=(f-(j+b))/m,C=Math.min(t?k:Math.max(k-N,0),w),M=h?Math.min(u.YQ*C,w-C):0,I=(C+M)*m*o,A=Math.round(v+I);r.yearlyFunding[`year_${l}`]=A,r.yearlyFundingInternal[`year_${l}`]=v,r.yearlyFundingExternal[`year_${l}`]=I,r.yearlyStaffCost[`year_${l}`]=g,r.yearlyExternalContractorCost[`year_${l}`]=k,r.yearlyAssessmentBasisInternal[`year_${l}`]=y,r.yearlyAssessmentBasisExternal[`year_${l}`]=N,r.funding+=A}return r}function x(e){let{isNotSME:t,estimatedRnDFTEs:r,estimatedAvgRnDSalary:a,estimatedContractors:i}=e;if("string"!=typeof e.startDate||"string"!=typeof e.endDate||r===l.I||a===l.I||i===l.I)return{funding:0,lower:0,upper:0,cost:0,kind:"missing_data"};let s=u.vT,o=(0,c.pp)(e.startDate),d=(0,c.pp)(e.endDate),h=(0,c.pp)("2024-03-28"),m=o>=h?u.K4:u.s1;!t&&d>=h&&(s=p({initialFundingRate:s,followingFundingRate:u.FH,startTimePeriod:o,endTimePeriod:d,firstDayOfNewRate:h}));let f=m*s,x=(0,n.m)(e.endDate,e.startDate)/365,g=r*a*1.21,y=5e4*i,j=Math.round(x*s*(g+y*f)),b=1e3*Math.round(.9*j/1e3),v=1e3*Math.round(1.1*j/1e3);return{funding:j,lower:b,upper:v,cost:x*(g+y),kind:"estimated"}}function p({initialFundingRate:e,followingFundingRate:t,startTimePeriod:r,endTimePeriod:a,firstDayOfNewRate:s}){if(r>=s)return t;if(a<s)return e;let l=(0,n.m)((0,i.f)(a,1),r);return e+(0,n.m)((0,i.f)(a,1),s)/l*(t-e)}},27921:(e,t,r)=>{"use strict";r.d(t,{J:()=>B});var a=r(26514),n=r(45964),i=r(48878),s=r(25453),l=r(75241),o=r(40229),d=r(6464),c=r(9826),u=r(28213),h=r(80036),m=r(43247),f=r(59783),x=r(54414),p=r(75337),g=r(49811),y=r(24222),j=r(80676),b=r(86725),v=r(11835),k=r(87470),N=r(92613),w=r(68003),C=r(21467),M=r(25203),I=r(75834);function A({customer:e,editIsDisabled:t,isSuperViewer:r,receipt:s}){let o=(0,M.N8)(),d=(0,M.YK)(),c=s.projectId,u=d?.find(e=>e.id===c)||null,S=(0,I.useMemo)(()=>u&&u.data.startDate&&u.data.endDate?(0,h.R)((0,m.pp)(u.data.startDate),(0,m.pp)(u.data.endDate)):[],[u]),{files:D}=(0,w.y)(e.id,{fileKind:i.Mk.Receipt,projectId:c,status:i.BM.Confirmed}),{files:_}=(0,w.y)(e.id,{fileKind:i.Mk.Invoice,projectId:c,status:i.BM.Confirmed}),{files:E}=(0,w.y)(e.id,{fileKind:i.Mk.Contract,projectId:c,status:i.BM.Confirmed}),F=(0,C.j7)(),B=(0,I.useId)(),K=null!==s&&(0,f.G)(s),$=(o||[]).filter(n.B$).map(e=>(0,m.H)(e.data.startFiscalYear)),z=""!==F.values.year&&$.includes(F.values.year)&&(!K||s.data.year!==F.values.year),P=F.values.contractorName,R=(0,I.useMemo)(()=>(0,k.F)(P,s&&"contractorId"in s?s.contractorId:void 0,o,d),[P,s,o,d]);return(0,a.jsx)("div",{className:"w-full px-1 lg:max-w-96",children:(0,a.jsxs)("div",{className:"flex flex-col gap-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,a.jsx)(g.J,{htmlFor:B,className:"text-sm font-semibold text-tertiary-900 dark:text-tertiary-100",children:"Auftragnehmer"}),(0,a.jsx)(p.d,{showSuggestion:!!R,suggestion:(0,a.jsxs)(y.E,{className:"text-sm",children:["Stattdessen"," ",(0,a.jsx)(l.tB.Link,{event:"receipt_contractor_name_suggestion_confirmed",className:"text-sm",onClick:()=>F.setFieldValue("contractorName",R),children:R})," ","nutzen?"]}
1),input:(0,a.jsx)(x.G,{id:B,placeholder:"Some Company GmbH",value:F.values.contractorName||"",options:(0,v.E)([...D.filter(f.G),..._,...E],u,o),handleChange:e=>{F.setFieldValue("contractorName",e)},onBlur:()=>{F.setFieldTouched("contractorName",!0)},hasError:F.touched.contractorName&&"string"==typeof F.errors.contractorName,disabled:t||F.isSubmitting||r,allowCustomValue:!0,customValueSuffix:"(neuer Auftragnehmer)"})}),(0,a.jsx)(N.I,{name:"contractorName"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,a.jsx)(g.J,{htmlFor:"year",className:"text-sm font-semibold text-tertiary-900 dark:text-tertiary-100",children:"Jahr"}),(0,a.jsx)(b.z,{years:S,selectedYear:F.values.year||void 0,handleChange:e=>{F.setFieldValue("year",e)},hasError:"year"in F.errors&&"year"in F.touched,onBlur:()=>F.setFieldTouched("year"),disabled:t||F.isSubmitting||r}),(0,a.jsx)(N.I,{name:"year"}),z&&(0,a.jsx)(j.A,{message:`Der Antrag auf Forschungszulage ${F.values.year} wurde schon finalisiert.`})]})]})})}var S=r(73061),D=r(25229),_=r(33208),E=r(4992),F=r(33066);function B({customer:e,editIsDisabled:t,handleDelete:r,isSuperViewer:h,onSuccess:m,receipt:f}){let{trackError:x}=(0,_.j)(),[p,g]=(0,I.useState)(!1);return(0,a.jsx)(C.l1,{initialValues:f.data?{...f.data}:{contractorName:"",year:""},onSubmit:async(t,r)=>{g(!0);try{let a=(0,E.xA)();await (0,E.c4)(async r=>{let s=await (0,D.GG)((0,D.P)((0,D.rJ)(a,"payoutApplications"),(0,D._M)("customerId","==",e.id))),l=(await Promise.all(s.docs.map(e=>r.get(e.ref)))).map(e=>e.data()).map(e=>(0,n.rk)(t.contractorName,t.year,e,f.projectId)).find(e=>null!==e),o=(0,D.H9)(a,"customers",e.id,"files",f.id),d={data:t,status:i.BM.Confirmed,...l||{payoutApplicationId:(0,D.CL)(),contractorId:(0,D.CL)()}};r.update(o,d)}),(0,S.o)("success","Die \xc4nderungen wurden gespeichert."),r.resetForm({values:t}),m?.()}catch(e){x("Error in `onSubmit` in EditReceiptModal",e),(0,S.o)("error","Etwas ist schiefgegangen. Die \xc4nderungen konnte nicht gespeichert werden.")}finally{g(!1)}},validationSchema:F.Ik().shape({contractorName:F.Yj().required("Bitte gib den Namen des Auftragnehmers an").max(100,"Der Name des Auftragnehmers darf maximal 100 Zeichen lang sein"),year:F.Yj().required("Bitte gib das Jahr an")}),validateOnMount:!0,children:n=>(0,a.jsxs)(C.lV,{className:"flex h-full flex-col gap-8 lg:w-80",children:[(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-6 overflow-scroll",children:[t&&(0,a.jsx)(s.l,{kind:"info",details:"Dieser Zahlungsnachweis ist Teil eines finalisierten Antrags auf FZul und kann daher nicht bearbeitet werden.",icon:(0,a.jsx)(d.I,{iconName:d.$.Info,size:20})}),(0,a.jsx)(A,{customer:e,editIsDisabled:t,isSuperViewer:h,receipt:f})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(u.X,{tooltip:(0,a.jsx)(c.g,{children:"Dieser Zahlungsnachweis ist Teil eines finalisierten Antrags auf FZul und kann daher nicht entfernt werden."}),disabled:!t,children:(0,a.jsx)(o.t,{buttonClassName:"w-10",onConfirm:r,disabled:t||p||h,triggerEvent:"receipt_deletion_started",confirmEvent:"receipt_deletion_confirmed",cancelEvent:"receipt_deletion_cancelled",children:(0,a.jsx)(d.I,{iconName:d.$.Delete,size:20})})}),(0,a.jsx)(l.tB.Primary,{event:"receipt_form_submitted",onClick:n.submitForm,disabled:t||!n.isValid||h||!n.dirty,processing:p,children:f.status===i.BM.Confirmed?"Aktualisieren":"Speichern"})]})]})})}},31208:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>tC});var a,n,i,s,l=r(26514),o=r(2041),d=r(43735),c=r(96777),u=r(8182),h=r(25451),m=r(46225),f=r(75834);function x({showArcade:e,setShowArcade:t}){let{query:r}=(0,m.useRouter)(),a=r?.open==="sesame";return((0,f.useLayoutEffect)(()=>{a?t(!0):t(!1)},[a]),e)?(0,l.jsx)(h.ArcadeModal,{showModal:e,setShowModal:t}):null}var p=r(76055),g=r(48878),y=r(25229),j=r(18389);function b({customerId:e,loggedInUserId:t,fileName:r}){let a=(0,j.Ak)(12);return{id:a,customerId:e,uploadedAt:y.Dc.now(),uploadedBy:t,name:r,filePath:(0,g.uZ)(e,a,r),fileKind:g.Mk.Unknown,status:g.BM.Processing,rawData:{},isSuperOnly:!1}}var v=r(75241),k=r(6464),N=r(99059),w=r(50658),C=r(24222),M=r(73061),I=r
1(57177),A=r(4992),S=r(20514),D=r(25203),_=r(49820);function E({setShowModal:e}){let t=(0,D.o)(),[r,a]=(0,f.useState)(!1),n=(0,D.Pq)(),i=(0,I.K)(),s=(n||[]).filter(e=>F(e,i(p.BR.SalaryData),t)),o=s.filter(e=>e.fileKind===g.Mk.Unknown);async function d(r){if(!t)return void(0,M.o)("error","Nicht eingeloggt");a(!0);let n=0;await Promise.all(r.map(e=>{let r=b({customerId:t.customerId,loggedInUserId:t.id,fileName:e.name});return(0,_.mO)(r.filePath,e).then(()=>(0,A.bX)(r)).then(()=>n++).catch(()=>{(0,M.o)("error",`Etwas ist schiefgegangen. Die Datei ${r.name} konnte nicht hochgeladen werden.`)})})),n>0&&(e(!0),(0,S.HZ)({kind:"unified_files_modal_opened"}),(0,M.o)("success",`${1===n?"Eine Datei":`${n} Dateien`} erfolgreich hochgeladen`))}return(0,l.jsx)(N.L,{maxNumberOfFiles:25,onFilesDropped:d,onFilesCompleted:()=>a(!1),className:"group h-full w-full rounded-xl border border-solid border-tertiary-300 hover:border-tertiary-400 max-md:rounded-none md:mx-0 dark:border-night-700 dark:hover:border-night-600",children:(0,l.jsxs)("div",{className:"flex h-full flex-col items-center gap-4 roun
1ded-xl bg-white p-6 text-left max-md:rounded-none dark:bg-night-900",children:[(0,l.jsx)("div",{className:"flex w-full flex-col gap-1",children:(0,l.jsx)(C.E,{className:"text-sm font-medium text-tertiary-400 uppercase dark:text-tertiary-500",children:"Dateien hochladen"})}),r?(0,l.jsx)("div",{className:"flex h-40 w-full items-center justify-center",children:(0,l.jsx)(w.y,{className:"h-6 text-primary-800 dark:text-primary-300"})}):(0,l.jsxs)("div",{className:"flex h-40 w-full flex-col items-center justify-center rounded-md border-2 border-dashed border-tertiary-300 bg-tertiary-50 py-4 transition-all group-hover:bg-tertiary-100 group-has-[input:focus-visible]:border-primary-800 has-[~_.button:hover]:bg-tertiary-50 dark:border-night-600 dark:bg-night-800 dark:group-hover:bg-night-700 dark:group-has-[input:focus-visible]:border-primary-400 dark:has-[~_.button:hover]:bg-night-800",children:[(0,l.jsx)(k.I,{iconName:k.$.Upload,size:48,className:"stroke-tertiary-300 dark:stroke-tertiary-400"}),(0,l.jsxs)(C.E,{className:"px-6 text-center text-xs text-tertiary-400 dark:text-tertiary-500",children:["Lade hier Lohnjournale, Rechnungen, Projektdokumentation etc. hoch",(0,l.jsx)("br",{}),".pdf max 4MB"]})]}),(s?.length||0)>0&&(0,l.jsxs)(v.tB.Outlined,{event:"unified_files_modal_opened",onClick:t=>{t.stopPropagation(),e(!0)},className:"button flex w-full shrink-0 items-center gap-2",leadingIcon:k.$.File,children:[(0,l.jsx)("span",{children:"Dateien verwalten"}),o.length>0&&(0,l.jsx)("div",{className:"z-10 flex h-3 w-4 items-center justify-center rounded-full bg-critical-red",children:(0,l.jsx)("span",{className:"text-[9px] text-white",children:o.length>9?"9+":o.length})})]})]})})}function F(e,t,r){if(t&&(e.fileKind===g.Mk.Lohnjournal||e.fileKind===g.Mk.AnnualRnDReport||e.fileKind===g.Mk.Unknown&&e.uploadedBy!==r?.id||e.fileKind===g.Mk.Other&&e.uploadedBy!==r?.id))return!1;return!0}var B=r(79230),K=r(66517),$=r(27355),z=r(54139),P=((a=P||{}).DATEV="datev",a.ADDISON="addison",a.PAYCHEX="paychex",a.Other="other",a.Unknown="unknown",a),R=r(25011),Z=r(25995),T=r(44803),O=r(40229),L=r(75337),Y=r(85924),X=r(9826),G=r(28213),U=r(89178),q=r(57677),V=r(90927),W=r(21467),H=r(33208),J=r(97700),Q=r(33066);function ee({file:e,handleDelete:t}){let{trackError:r}=(0,H.j)(),a=(0,D.o)(),n=(0,D.cN)(),i=(0,D.YK)();return(0,l.jsx)(W.l1,{initialValues:{fileKind:e.rawData.fileKind?.data?.fileKind||g.Mk.Unknown,projectId:i?.length===1?i[0].id:"string"==typeof e.projectId&&i?.some(t=>t.id===e.projectId)?e.projectId:"",comment:""},enableReinitialize:!0,onSubmit:async t=>{try{if(!n||!a)throw Error("Data not fully loaded");let r=(0,A.Ez)();if(t.fileKind===g.Mk.Lohnjournal?(0,A.p3)(n.id,e.id,{fileKind:t.fileKind,lohnjournalKind:P.Unknown,status:g.BM.Processing},r):t.fileKind===g.Mk.Contract||t.fileKind===g.Mk.Receipt?(0,A.p3)(n.id,e.id,{fileKind:t.fileKind,projectId:t.projectId,status:g.BM.Processed},r):t.fileKind===g.Mk.Invoice?(0,A.p3)(n.id,e.id,{fileKind:t.fileKind,projectId:t.projectId,status:g.BM.Processing},r):t.fileKind===g.Mk.Other&&(0,A.p3)(n.id,e.id,{fileKind:t.fileKind,comment:t.comment,status:g.BM.Confirmed},r),t.fileKind===g.Mk.Lohnjournal||t.fileKind===g.Mk.Invoice||t.fileKind===g.Mk.Contract||t.fileKind===g.Mk.Receipt){let i=(0,R.lh)({loggedInUser:a,kind:R.ZY.CategoriseUnknownFile,data:{customerId:n.id,fileId:e.id,fileKind:t.fileKind,userId:a.id}});(0,A.$n)(i,r)}await r.commit()}catch(e){r("Error categorizing file",e,{customerId:n?.id}),(0,M.o)("error","Etwas ist schief gegangen. Bitte probiere es erneut.")}},validationSchema:Q.Ik().shape({fileKind:Q.Yj().required("Notwendig").oneOf([g.Mk.Lohnjournal,g.Mk.Invoice,g.Mk.Receipt,g.Mk.Contract,g.Mk.Other]),projectId:Q.Yj().when("fileKind",{is:e=>e===g.Mk.Invoice||e===g.Mk.Receipt||e===g.Mk.Contract,then:e=>e.required("Ein Projekt muss ausgew\xe4hlt sein")}),comment:Q.Yj().when("fileKind",{is:e=>e===g.Mk.Other,then:e=>e.required('Kommentar f\xfcr "Andere Dateien" erforderlich')})}),validateOnMount:!0,children:(0,l.jsx)(et,{handleDelete:t,fileKindDetectedByAi:e.rawData.fileKind?.data?.fileKind})},e.id)}function et({handleDelete:e,fileKindDetectedByAi:t}){let r=(0,D.YK)(),{isSubmitting:a,isValid:n,setFieldValue:i,values:s,submitForm:o}=(0,W.j7)(),d=r&&(s.fileKind===g.Mk.Invoice||s.fileKind===g.Mk.Receipt||s.fileKind===g.Mk.Contract),c=s.fileKind===g.Mk.Other;return(0,l.jsxs)(W.lV,{className:"flex h-full flex-col gap-8 lg:w-80",children:[(0,l.jsxs)("div",{className:"flex flex-1 flex-col gap-6 overflow-scroll",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(C.E,{className:"font-medium text-tertiary-900 dark:text-tertiary-100",children:"Dateityp ausw\xe4hlen"}),(0,l.jsx)(Z.z6,{className:"grid grid-cols-2 gap-1.5",children:er.map((e,a)=>{let n=r?.length===0&&(e.fileKind===g.Mk.Invoice||e.fileKind===g.Mk.Receipt||e.fileKind===g.Mk.Contract);return(0,l.jsx)(L.d,{showSuggestion:t===e.fileKind,suggestion:(0,l.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,l.jsx)(C.E,{className:"text-xs",children:"KI Vorschlag"}),(0,l.jsx)(Y.m,{text:`Coup's KI h\xe4lt diese Datei f\xfcr ${t?ea[t]:"eine unbekannte Datei"}`})]}
1),input:(0,l.jsx)(G.X,{tooltip:(0,l.jsx)(X.g,{children:"Zuordnung erst m\xf6glich, nachdem ein Projekt erstellt wurde"}),className:4===a&&n?"col-span-2":"",disabled:!n,children:(0,l.jsxs)(Z.sx,{value:e.fileKind,className:(0,J.cn)("flex h-full cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border border-tertiary-200 bg-white px-3 py-4 hover:border-primary-100 hover:bg-primary-50 dark:border-night-700 dark:bg-night-800 dark:hover:border-night-600 dark:hover:bg-night-700",4===a&&"col-span-2 flex-row py-3",s.fileKind===e.fileKind&&"cursor-default border-primary-200 bg-primary-100 hover:border-primary-200 hover:bg-primary-100 dark:border-night-500 dark:bg-night-700 dark:hover:border-night-500 dark:hover:bg-night-700",n&&"cursor-not-allowed hover:border-tertiary-200 hover:bg-white dark:hover:border-night-700 dark:hover:bg-night-800"),onClick:()=>i("fileKind",e.fileKind),disabled:n,children:[(0,l.jsx)(k.I,{iconName:s.fileKind===e.fileKind?k.$.Check:e.icon,className:s.fileKind===e.fileKind?"rounded-full bg-primary-800 p-0.5 text-white":"stroke-tertiary-700 dark:stroke-tertiary-300",size:20}),(0,l.jsx)(T.JU,{className:"text-center text-sm text-tertiary-700 dark:text-tertiary-300",children:e.label})]})})},e.fileKind)})})]}),d&&(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(C.E,{className:"font-medium text-tertiary-900 dark:text-tertiary-100",children:"Zugeh\xf6riges Projekt"}),r.length>1&&(0,l.jsx)(C.E,{className:"pb-2 text-sm text-tertiary-500 dark:text-tertiary-400",children:"Dateien sind einem Projekt zugewiesen. Um dieselbe Datei mehreren Projekten zuzuweisen, lade Kopien hoch."}),(0,l.jsx)(Z.z6,{className:"flex flex-col gap-1",children:r.map(e=>(0,l.jsxs)(Z.sx,{value:e.id,className:(0,J.cn)("flex w-full cursor-pointer items-center gap-2 rounded-lg border border-tertiary-200 px-3 py-2 pb-1.5 hover:border-primary-100 hover:bg-primary-50 dark:border-night-700 dark:hover:border-night-600 dark:hover:bg-night-700",e.i
1d===s.projectId&&"cursor-default border-primary-200 bg-primary-100 hover:border-primary-200 hover:bg-primary-100 dark:border-night-500 dark:bg-night-700 dark:hover:border-night-500 dark:hover:bg-night-700"),onClick:()=>i("projectId",e.id),children:[(0,l.jsx)(k.I,{iconName:e.id===s.projectId?k.$.Check:k.$.Circle,className:e.id===s.projectId?"rounded-full bg-primary-800 p-0.5 text-white":"stroke-tertiary-700 dark:stroke-tertiary-300",size:16}),(0,l.jsxs)(T.JU,{className:"flex flex-col items-start",children:[(0,l.jsx)(C.E,{className:"text-sm text-tertiary-700 dark:text-tertiary-300",children:e.data.name}),(0,l.jsxs)(C.E,{className:"text-xs text-tertiary-500 dark:text-tertiary-400",children:[e.data.startDate?(0,l.jsx)("span",{children:(0,q.GP)(e.data.startDate,"MMM yyyy",{locale:V.de})}):(0,l.jsx)("span",{}),(0,l.jsx)("span",{children:" - "}),e.data.endDate?(0,l.jsx)("span",{children:(0,q.GP)(e.data.endDate,"MMM yyyy",{locale:V.de})}):(0,l.jsx)("span",{})]})]})]},e.id))})]}),c&&(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(C.E,{className:"font-medium text-tertiary-900 dark:text-tertiary-100",children:"Kommentar"}),(0,l.jsx)(C.E,{className:"pb-2 text-sm text-tertiary-500 dark:text-tertiary-400",children:"Bitte beschreibe kurz, worum es bei der Datei geht."}),(0,l.jsx)(U.f,{name:"comment",placeholder:"Es geht um...",className:"border border-tertiary-200 dark:border-night-700",containerClassName:"border-tertiary-200 dark:border-night-700 border"})]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(O.t,{buttonClassName:"w-10",onConfirm:e,triggerEvent:"unknown_file_deletion_started",confirmEvent:"unknown_file_deletion_confirmed",cancelEvent:"unknown_file_deletion_cancelled",children:(0,l.jsx)(k.I,{iconName:k.$.Delete,size:20})}),(0,l.jsx)(v.tB.Primary,{event:"unknown_file_categorisation_form_submitted",onClick:o,disabled:!n,processing:a,children:s.fileKind===g.Mk.Invoice||s.fileKind===g.Mk.Contract||s.fileKind===g.Mk.Receipt?"Weiter":"Speichern"})]})]})}let er=[{fileKind:g.Mk.Lohnjournal,label:"Lohnjournal",icon:k.$.PayrollData},{fileKind:g.Mk.Invoice,label:"Rechnung Auftragnehmer",icon:k.$.Invoice},{fileKind:g.Mk.Receipt,label:"Zahlungsbeleg Auftragnehmer",icon:k.$.PaymentMethod},{fileKind:g.Mk.Contract,label:"Vertrag Auftragnehmer",icon:k.$.FileBadge},{fileKind:g.Mk.Other,label:"Andere Datei",icon:k.$.SupportModal}],ea={[g.Mk.Contract]:"einen Vertrag",[g.Mk.Invoice]:"eine Rechnung",[g.Mk.Lohnjournal]:"ein Lohnjournal",[g.Mk.Receipt]:"einen Zahlungsbeleg"};var en=r(65669);function ei({files:e,selectedFile:t,setSelectedFileId:r}){return(0,l.jsx)("div",{className:"flex flex-col px-0.5",children:e.toSorted((e,t)=>t.uploadedAt.toMillis()-e.uploadedAt.toMillis()).map(e=>{var a;let n;return(0,l.jsxs)("button",{type:"button",className:(0,J.cn)("flex cursor-pointer items-center justify-stretch rounded-md px-3 py-2.5 hover:bg-primary-50 focus:ring-2 focus:ring-primary-800 focus:outline-hidden dark:hover:bg-night-700",e.i
1d===t?.id&&"cursor-default bg-primary-100 hover:bg-primary-100 dark:bg-night-700 dark:hover:bg-night-700"),onClick:()=>r(e.id),children:[(0,l.jsx)("div",{className:(0,J.cn)("mr-2.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",e.fileKind===g.Mk.Unknown?"bg-primary-800":"bg-tertiary-100 hover:bg-tertiary-200 dark:bg-night-700 dark:hover:bg-night-600"),children:(0,l.jsx)(k.I,{iconName:(a=e.fileKind,(n=er.find(e=>e.fileKind===a))?n.icon:a===g.Mk.ProjectTimesheets?k.$.TimeTracking:a===g.Mk.TaxOfficeNotice||a===g.Mk.AnnualRnDReport?k.$.PayoutApplication:a===g.Mk.BSFZNotice||a===g.Mk.BSFZSubmissionConfirmation?k.$.Project:k.$.SupportModal),size:20,className:e.fileKind===g.Mk.Unknown?"stroke-white":"stroke-tertiary-700 dark:stroke-tertiary-300"})}),(0,l.jsxs)("div",{className:"flex min-w-0 grow flex-col justify-stretch text-left",children:[(0,l.jsx)(C.E,{className:"truncate text-left text-sm text-tertiary-700 dark:text-tertiary-300",children:e.name}),(0,l.jsx)(C.E,{className:"text-sm text-tertiary-500 dark:text-tertiary-400",children:(0,en.B)(e.uploadedAt.toDate(),new Date,{addSuffix:!0,locale:V.de})})]}),e.fileKind===g.Mk.Unknown&&(0,l.jsx)("div",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-critical-red"}),(0,l.jsx)(k.I,{iconName:k.$.CaretRight,size:20,className:"shrink-0 stroke-primary-800 dark:stroke-primary-300"})]},e.id)})})}var es=r(45964),el=r(4468),eo=r(54823),ed=r(97925),ec=r(36690),eu=r(69991),eh=r(27921),em=r(37770);function ef({file:e,handleDelete:t}){let{trackError:r}=(0,H.j)(),[a,n]=(0,f.useState)(!1);return(0,l.jsx)(W.l1,{initialValues:{comment:e.comment},onSubmit:async(t,a)=>{n(!0);try{await (0,A.p3)(e.customerId,e.id,{comment:t.comment}),(0,M.o)("success","Die \xc4nderungen wurden gespeichert."),a.resetForm({values:t})}catch(e){r("Error in `onSubmit` in OtherFileForm",e),(0,M.o)("error","Etwas ist schiefgegangen. Die \xc4nderungen konnte nicht gespeichert werden.")}finally{n(!1)}},children:e=>(0,l.jsxs)(W.lV,{className:"flex h-full flex-col gap-8 lg:w-80",children:[(0,l.jsxs)("div",{className:"flex-1 overflow-scroll",children:[(0,l.jsx)(C.E,{className:"font-medium text-tertiary-900 dark:text-tertiary-100",children:"Kommentar"}),(0,l.jsx)(C.E,{className:"pb-2 text-sm text-tertiary-500 dark:text-tertiary-400",children:"Bitte beschreibe kurz, worum es bei der Datei geht."}),(0,l.jsx)(U.f,{name:"comment",placeholder:"Es geht um...",className:"border border-tertiary-200 dark:border-night-700",containerClassName:"border-tertiary-200 dark:border-night-700 border"})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)(v.tB.Ghost,{event:"other_file_deleted",className:"p-2.5 px-4 text-tertiary-700 hover:text-red-500 dark:text-tertiary-300 dark:hover:text-red-400",onClick:t,disabled:a,children:["L\xf6schen",(0,l.jsx)(k.I,{iconName:k.$.Delete,size:20,className:"ml-1"})]}),(0,l.jsx)(v.tB.Primary,{event:"other_file_form_submitted",onClick:e.submitForm,processing:a,disabled:!e.dirty,children:"Aktualisieren"})]})]})})}var ex=r(89035),ep=r(47439);function eg({file:e,handleDelete:t}){return e.fileKind===g.Mk.Unknown&&e.status===g.BM.Processing?(0,l.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-8 px-6 py-4",children:[(0,l.jsx)(el._,{}),(0,l.jsx)(C.E,{className:"animate-pulse text-center text-lg text-tertiary-400 dark:text-tertiary-500",children:"Die hochgeladene Datei wird verarbeitet..."})]}):e.missingPdfPassword?(0,l.jsx)(em.k,{file:e,handleDelete:e.fileKind===g.Mk.Unknown?t:void 0}):(0,l.jsx)(ey,{file:e,handleDelete:t},e.id)}function ey({file:e,handleDelete:t}){let r=null;return"status"in e&&e.status===g.BM.Processing&&e.fileKind!==g.Mk.Lohnjournal?r=(0,l.jsx)("div",{className:"lg:w-80",children:(0,l.jsx)(ed.R,{rows:3,height:80})}):e.fileKind===g.Mk.Unknown?r=(0,l.jsx)(ee,{file:e,handleDelete:t}):e.fileKind===g.Mk.Contract?r=(0,l.jsx)(ej,{file:e,handleDelete:t}):e.fileKind===g.Mk.Invoice?r=(0,l.jsx)(eb,{file:e,handleDelete:t}):e.fileKind===g.Mk.Receipt?r=(0,l.jsx)(ev,{file:e,handleDelete:t}):e.fileKind===g.Mk.Other&&(r=(0,l.jsx)(ef,{file:e,handleDelete:t})),(0,l.jsxs)("div",{className:"flex h-full flex-col gap-2 overflow-scroll px-6 py-4 lg:overflow-hidden",children:[(0,l.jsx)(ek,{file:e}),(0,l.jsxs)("div",{className:(0,J.cn)("flex flex-1 flex-col overflow-scroll lg:h-[calc(100%-28px)] lg:flex-row",r&&"gap-4"),children:[(0,l.jsx)(eo.d,{className:"min-h-100 flex-1 lg:min-h-max",file:e}),r]})]})}
1function ej({file:e,handleDelete:t}){let r=(0,D.cN)(),{isSuperUser:a}=(0,ep.q)(),n=(0,D.o)(),i=(0,ex.K)(),s=(0,D.N8)();if(!r)return(0,l.jsx)(ed.R,{});let o=(a||i)&&e.customerId!==n?.customerId,d=s?.some(t=>(0,es.B$)(t)&&"payoutApplicationId"in e&&e.payoutApplicationId===t.id)||!1;return(0,l.jsx)(ec.Z,{contract:e,customer:r,editIsDisabled:d,handleDelete:t,isSuperViewer:o})}function eb({file:e,handleDelete:t}){let r=(0,D.cN)(),{isSuperUser:a}=(0,ep.q)(),n=(0,D.o)(),i=(0,ex.K)(),s=(0,D.N8)();if(!r)return(0,l.jsx)(ed.R,{});let o=(a||i)&&e.customerId!==n?.customerId,d=s?.some(t=>(0,es.B$)(t)&&"payoutApplicationId"in e&&e.payoutApplicationId===t.id)||!1;return(0,l.jsx)(eu.Q,{customer:r,editIsDisabled:d,handleDelete:t,invoice:e,isSuperViewer:o})}function ev({file:e,handleDelete:t}){let r=(0,D.cN)(),{isSuperUser:a}=(0,ep.q)(),n=(0,D.o)(),i=(0,ex.K)(),s=(0,D.N8)();if(!r)return(0,l.jsx)(ed.R,{});let o=(a||i)&&e.customerId!==n?.customerId,d=s?.some(t=>(0,es.B$)(t)&&"payoutApplicationId"in e&&e.payoutApplicationId===t.id)||!1;return(0,l.jsx)(eh.J,{receipt:e,customer:r,editIsDisabled:d,handleDelete:t,isSuperViewer:o})}function ek({file:e}){let t=(0,D.YK)(),r=(0,D.N8)(),a="projectId"in e?t?.find(t=>t.id===e.projectId)?.data.name:"",n="payoutApplicationId"in e?r?.find(t=>t.id===e.payoutApplicationId):null,i=n?(0,es.aH)(n?.data,!0):"",s=(0,g.lt)(e.fileKind),o=e.fileKind===g.Mk.Lohnjournal&&e.status===g.BM.Error;return(0,l.jsxs)("div",{className:"flex gap-2",children:[s&&(o?(0,l.jsx)(G.X,{enableClickInteraction:!0,tooltip:(0,l.jsx)(X.g,{children:"Die hochgeladene Datei scheint kein Jahres-Lohnjournal zu enthalten."}),children:(0,l.jsx)("div",{className:"w-fit rounded-sm bg-red-100 px-1 py-0.5 text-xs text-red-700 dark:bg-red-950 dark:text-red-200",children:s})}):(0,l.jsx)("div",{className:"w-fit rounded-sm bg-tertiary-200 px-1 py-0.5 text-xs text-tertiary-700 dark:bg-night-700 dark:text-tertiary-300",children:s})),a&&(0,l.jsxs)("div",{className:"w-fit rounded-sm bg-tertiary-200 px-1 py-0.5 text-xs text-tertiary-700 dark:bg-night-700 dark:text-tertiary-300",children:["Projekt: ",(0,l.jsx)("span",{children:a})]}),i&&(0,l.jsx)("div",{className:"w-fit rounded-sm bg-tertiary-200 px-1 py-0.5 text-xs text-tertiary-700 dark:bg-night-700 dark:text-tertiary-300",children:i})]})}var eN=r(26630),ew=r(72878);let eC=ew.pt.PDF;function eM(){let{trackError:e,trackWarning:t}=(0,H.j)(),r=(0,f.useRef)(null),a=(0,D.o)(),[n,i]=(0,f.useState)(!1);async function s(r,n){if(!a)return void(0,M.o)("error","Nicht eingeloggt");try{if(i(!0),null===r||0===r.length)return void(0,M.o)("warning","Keine Dateien ausgew\xe4hlt");if(r.length>25){(0,M.o)("warning","Maximal 25 Dateien erlaubt"),t(`User ${a?.id} attempted to select ${r.length} files at once (allowed: 25)`);return}let e=[...r].filter(e=>{let r=(0,eN.RX)(4);return e.size>r?((0,M.o)("warning",`Maximale Dateigr\xf6\xdfe von ${(0,eN.pF)(r)} \xfcberschritten f\xfcr ${e.name}. Datei nicht hochgeladen.`),t(`User ${a?.id} attempted to select a ${(0,eN.pF)(e.size)} file (allowed: ${(0,eN.pF)(r)})`),!1):e.type===eC||((0,M.o)("warning",`Nur ${ew._N[eC]} Dateien erlaubt. ${e.name} wird nicht hochgelanden.`),!1)});(0,S.HZ)({kind:"unified_files_file_upload_completed"});let n=0;await Promise.all(e.map(e=>{let t=b({customerId:a.customerId,loggedInUserId:a.id,fileName:e.name});return(0,_.mO)(t.filePath,e).then(()=>(0,A.bX)(t)).then(()=>n++).catch(()=>{(0,M.o)("error",`Etwas ist schiefgegangen. Die Datei ${t.name} konnte nicht hochgeladen werden.`)})})),n>0&&(0,M.o)("success",`${1===n?"Eine Datei":`${n} Dateien`} erfolgreich hochgeladen`)}catch(t){e("Error uploading files in `MultiDropZone`",t)}finally{n&&(n.value=""),i(!1)}}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.tB.Ghost,{event:"unified_files_picker_opened",onClick:()=>{r.current&&r.current.click()},processing:n,leadingIcon:k.$.Plus,children:"Hochladen"}),(0,l.jsx)("input",{ref:r,name:"file",type:"file",accept:eC,onChange:e=>s(e.target.files,r.current),className:"sr-only",multiple:!0})]})}function eI({files:e}){let{trackError:t}=(0,H.j)(),r=(0,D.cN)(),[a,n]=(0,f.useState)(e[0].id),[i,s]=(0,f.useState)(""),[o,d]=(0,f.useState)(e.length),c=e.f
1ind(e=>e.id===a);async function u(){try{if(!r)throw Error("Missing customer");let t=e.filter(e=>e.id!==a);if(0===t.length)(0,M.o)("success","Dateien verarbeitet");else{let e=t.findIndex(e=>e.fileKind===g.Mk.Unknown);e>-1?n(t[e].id):n(t[0].id)}await (0,A.Ww)(r.id,a),(0,M.o)("success","Datei wurde gel\xf6scht.")}catch(e){(0,M.o)("error","Etwas ist schief gegangen. Bitte probiere es erneut."),t("Error deleting an unknown file from the categorise unknown files modal",e)}}return(0,f.useEffect)(()=>{e.length!==o&&n(e[0].id),d(e.length)},[e.length]),(0,l.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-scroll md:flex-row",children:[(0,l.jsxs)("div",{className:"relative hidden w-full flex-col md:max-w-80 xl:flex",children:[(0,l.jsxs)("div",{className:"flex w-80 items-center justify-between px-3 pt-2 pb-3",children:[(0,l.jsx)(C.E,{className:"text-xs font-semibold text-tertiary-500 dark:text-tertiary-400",children:"DATEIEN"}),(0,l.jsx)(eM,{})]}),(0,l.jsx)("div",{className:"pr-2.5 pl-0.5",children:(0,l.jsx)(K.N,{slim:!0,inputClassName:"h-9 border border-tertiary-200 dark:border-night-700 placeholder:text-tertiary-300 dark:placeholder:text-tertiary-600",placeholder:"Suchen",searchQuery:i,setSearchQuery:s})}),(0,l.jsx)($.t,{className:"flex flex-col pt-4 pr-2",startGradientClassName:"top-24",gradientColor:$.A.White,children:(0,l.jsx)(ei,{files:e.filter(e=>!i||(e.name+e.fileKind+(e.fileKind.includes("contract")?"vertrag":"")+(e.fileKind.includes("invoice")?"rechnung":"")+(e.fileKind.includes("receipt")?"zahlungsnachweis":"")).toLowerCase().includes(i.toLowerCase())),selectedFile:c,setSelectedFileId:n})})]}),c&&(0,l.jsxs)("div",{className:"relative z-10 flex h-full w-full flex-col rounded-lg border border-tertiary-300 dark:border-night-600",children:[(0,l.jsxs)("div",{className:"hidden items-center justify-between gap-8 rounded-t-lg bg-tertiary-100 px-4 py-3 xl:flex dark:bg-night-700",children:[(0,l.jsx)(C.E,{className:"line-clamp-1 text-sm",children:c.name}),(0,l.jsx)(C.E,{className:"text-sm whitespace-nowrap text-tertiary-500 dark:text-tertiary-400",children:(0,en.B)(c.uploadedAt.toDate(),new Date,{addSuffix:!0,locale:V.de})})]}),(0,l.jsx)("div",{className:"flex items-center justify-center rounded-t-lg bg-tertiary-100 px-4 py-3 xl:hidden dark:bg-night-700",children:(0,l.jsx)(z.l,{value:c.id,optionValues:e.map(e=>e.id),optionLabels:e.map(e=>e.name),handleChange:t=>{let r=e.find(e=>e.id===t);r&&n(r.id)},hideDefault:!0,className:"w-full border border-tertiary-200 text-sm text-tertiary-700 dark:border-night-700 dark:text-tertiary-300"})}),(0,l.jsx)(eg,{file:c,handleDelete:u})]})]})}function eA({showManageFilesModal:e,setShowManageFilesModal:t,setShowArcade:r}){let a=(0,D.Pq)(),n=(0,I.K)(),i=(0,D.o)(),s=(a||[]).filter(e=>F(e,n(p.BR.SalaryData),i));return(0,l.jsx)(B.a,{title:`Datei${a?.length===1?"":"en"} verwalten`,modalId:B.p.ManageFiles,extraWide:!0,fullHeight:!0,scrollable:!1,showModal:e,setShowModal:t,children:a&&0!==a.length?(0,l.jsx)(eI,{files:s}):(0,l.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-4",children:[(0,l.jsx)("div",{className:"flex h-32 w-32 items-center justify-center rounded-full bg-green-500/25",children:(0,l.jsx)(k.I,{iconName:k.$.Check,size:40,className:"stroke-secondary-600"})}),(0,l.jsx)(C.E,{className:"text-sm text-tertiary-400 dark:text-tertiary-500",children:"Alles erledigt!"}),(0,l.jsxs)(v.tB.Secondary,{className:"bg-linear-to-r from-smart-start-subtle to-smart-end-subtle",event:null,onClick:()=>r(!0),children:[(0,l.jsx)("img",{src:"arcade/coin.png",alt:"digital coin",className:"mr-2 h-6"}),"Coup Arcade \xf6ffnen"]})]})})}var eS=r(24092);let eD="ml-6 text-base font-semibold tracking-wide text-tertiary-500 uppercase dark:text-tertiary-400 max-md:text-sm";function e_({title:e,children:t,open:r=!1}){let[a,n]=(0,f.useState)(r);return(0,l.jsxs)("section",{className:"flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(C.E,{className:eD,children:e}),(0,l.jsxs)("button",{type:"button","aria-expanded":a,onClick:()=>n(!a),className:"flex items-center gap-2.5 hover:text-tertiary-800 dark:hover:text-tertiary-300 max-md:mr-4",children:[(0,l.jsx)("span",{className:"text-sm font-normal text-tertiary-500 max-sm:hidden",children:a?"Verstecken":"Zeigen"}),(0,l.jsx)(k.I,{iconName:k.$.CaretDown,size:16,className:(0,J.cn)("transition duration-300",a&&"rotate-180")}
1)]})]}),(0,l.jsx)("div",{className:(0,J.cn)("grid transition-[grid-template-rows] duration-300 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,l.jsx)("div",{className:"overflow-hidden",inert:!a,children:(0,l.jsx)("div",{className:"pt-4",children:t})})})]})}var eE=r(89276),eF=r(96456),eB=r.n(eF);function eK(){let e=(0,D.o)(),{authUser:t}=(0,D.ZY)(),r=(0,D.kp)(),a=function(e){let t=(0,D.cN)(),{trackError:r}=(0,H.j)(),[a,n]=(0,f.useState)(0),i=t?.id,s=!!t?.stripeCustomerId;return(0,f.useEffect)(()=>{i&&s&&e&&(0,eE.g)(eS.CF.FetchStripeInvoices,{customerId:i}).then(({invoices:e})=>n(e.filter(e=>"open"===e.status).length)).catch(e=>r("Error fetching invoices",e))},[i,s,e]),a}(t?.claims.role===p.gG.Admin);return(0,l.jsxs)("div",{className:"group flex flex-col gap-4",children:[(0,l.jsx)(C.E,{className:eD,children:"Quick Links"}),(0,l.jsxs)("div",{className:"h-full w-full rounded-xl border border-solid border-tertiary-300 bg-white max-md:rounded-none md:mx-0 dark:border-night-700 dark:bg-night-900",children:[(0,l.jsxs)(e$,{href:"/company/general",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(k.I,{iconName:k.$.Company,size:20,className:"min-w-5"}),(0,l.jsx)("span",{children:"Unternehmensdaten"})]}),(0,l.jsx)(ez,{})]}),(0,l.jsxs)(e$,{href:"/company/employees",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(k.I,{iconName:k.$.Users,size:20,className:"min-w-5"}),(0,l.jsx)("span",{children:"Mitarbeitende"})]}),(0,l.jsx)(ez,{children:r&&(0,l.jsx)("span",{className:"text-xs font-normal text-tertiary-400 dark:text-tertiary-300",children:r.length})})]}),(0,l.jsxs)(e$,{href:"/settings/billing",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(k.I,{iconName:k.$.Billing,size:20,className:"min-w-5"}),(0,l.jsx)("span",{children:"Billing"})]}),(0,l.jsx)(ez,{children:a>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-xs font-normal text-tertiary-400 dark:text-tertiary-300",children:"Unbezahlt"}),(0,l.jsx)("span",{className:"rounded-full bg-red-700 px-2 py-0.5 text-xs text-white",children:a})]})})]}),e&&!e.mfaEnrolledAt&&(0,l.jsxs)(e$,{href:{pathname:"/settings/profile",query:{showModal:B.p.SetupMfa}},children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(k.I,{iconName:k.$.Settings,size:20,className:"min-w-5"}),(0,l.jsx)("span",{children:"Zwei-Faktor-Authentifizierung"})]}),(0,l.jsx)(ez,{children:(0,l.jsx)("span",{className:"size-2 rounded-full bg-red-700"})})]})]})]})}function e$({href:e,children:t}){return(0,l.jsx)(eB(),{href:e,className:"flex h-14 cursor-pointer items-center justify-between border-b border-tertiary-300 px-6 py-2 text-sm font-medium text-primary-800 outline-0 transition-colors first:rounded-t-xl last:rounded-b-xl last:border-b-0 hover:bg-primary-50 focus:ring-2 focus:ring-primary-800 max-md:rounded-none dark:border-night-700 dark:text-primary-300 dark:hover:bg-night-700 dark:focus:ring-primary-400",children:t})}function ez({children:e}){return(0,l.jsxs)("span",{className:"flex items-center gap-2",children:[e,(0,l.jsx)(k.I,{iconName:k.$.CaretRight,size:16,className:"text-tertiary-400 dark:text-tertiary-500"})]})}var eP=r(68876),eR=r(6144),eZ=((n={}).Referral="referral",n.Community="community",n.Game="game",n);function eT({kind:e}){let{eyebrow:t,title:r,description:a,action:n,hoverDecoration:i,cardClassName:s,titleClassName:o}=eO[e];return(0,l.jsxs)("div",{className:(0,J.cn)("group relative isolate flex h-60 cursor-pointer flex-col justify-between overflow-hidden rounded-xl p-6 transition-colors duration-300 has-focus-visible:ring-2 has-focus-visible:ring-primary-800 max-md:rounded-none dark:has-focus-visible:ring-primary-400",s),children:[i&&(0,l.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 translate-y-4 scale-95 opacity-0 transition duration-300 ease-out group-hover:translate-y-0 group-hover:scale-100 group-hover:opacity-100",children:i}),(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(C.E,{className:"text-sm font-medium tracking-wide text-black/40 uppercase dark:text-white/40",children:t}),(0,l.jsx)("p",{className:(0,J.cn)("font-serif text-2xl font-light",o),children:r}),a&&(0,l.jsx)(C.E,{className:"text-sm font-normal text-tertiary-700 dark:text-tertiary-300",children:a})]}),(0,l.jsx)("div",{className:"flex",children:n})]})}let eO={referral:{eyebrow:"Empfehlung",title:"Coup empfehlen, 400 ⬠erhalten",action:(0,l.jsx)(function(){let[e,t]=(0,f.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.tB.Link,{event:"referral_modal_opened",size:v.Mp.Small,trailingIcon:k.$.ArrowRight,onClick:()=>t(!0),className:"text-pink-950 no-underline after:absolute after:inset-0 hover:text-pink-950 focus:shadow-none! dark:text-pink-100 dark:hover:text-pink-100",children:"Jetzt werben"}),(0,l.jsx)(eP.H,{showModal:e,setShowModal:t})]})},{}),hoverDecoration:(0,l.jsx)(function(){return eY.map(({position:e,delay:t})=>(0,l.jsx)("img",{src:"/arcade/coin.png",alt:"",className:(0,J.cn)("absolute w-10 [image-rendering:pixelated]",eX,e,t)},e))},{}),cardClassName:"bg-pink-100 hover:bg-pink-200 dark:bg-pink-900/70 dark:hover:bg-pink-900/90",titleClassName:"text-pink-950 dark:text-pink-100"},community:{eyebrow:"Community",title:"Lern andere R&D-Teams kennen",description:"Tausch dich bei unseren Events mit Unternehmen aus, die vor denselben Fragen stehen.",action:(0,l.jsx)(function(){return(0,l.jsxs)(eB(),{href:"https://luma.com/getcouped.com",target:"_blank",rel:"noreferrer",onClick:()=>
1(0,S.If)("community_events_navigated"),className:(0,v.uB)(v.Ak.Link,v.Mp.Small,"inline-flex h-fit gap-1 px-0.5 py-0.5","text-violet-950 no-underline after:absolute after:inset-0 hover:text-violet-950 focus:shadow-none! dark:text-violet-100 dark:hover:text-violet-100"),children:["Coup Events entdecken",(0,l.jsx)(k.I,{iconName:k.$.ArrowRight})]})},{}),hoverDecoration:(0,l.jsx)(function(){return eL.map(({src:e,position:t,delay:r})=>(0,l.jsx)("div",{className:(0,J.cn)("absolute w-20 rounded-sm bg-white p-1 pb-3 shadow-md",eX,t,r),children:(0,l.jsx)("img",{src:e,alt:"",className:"aspect-square w-full object-cover"})},e))},{}),cardClassName:"bg-violet-100 hover:bg-violet-200 dark:bg-violet-900/70 dark:hover:bg-violet-900/90",titleClassName:"text-violet-950 dark:text-violet-100"},game:{eyebrow:"Pause",title:"Lust auf ein Spiel?",action:(0,l.jsx)(function(){let e=(0,m.useRouter)();return(0,l.jsx)(v.tB.Link,{event:null,size:v.Mp.Small,trailingIcon:k.$.ArrowRight,onClick:()=>{let t=(0,eR.vA)(),r=(0,eR.OS)();e.replace({pathname:e.pathname,query:{...t,open:"sesame"},...r&&{hash:r}},void 0,{scroll:!1})},className:"cursor-[url(/arcade/joystick.png),pointer] text-teal-950 no-underline after:absolute after:inset-0 hover:text-teal-950 focus:shadow-none! dark:text-teal-100 dark:hover:text-teal-100",children:"Zur Coup Arcade"})},{}),hoverDecoration:(0,l.jsx)(function(){return(0,l.jsx)("img",{src:"/arcade/quick_link_screenshot.webp",alt:"",className:(0,J.cn)("absolute -right-6 -bottom-6 w-36 rotate-6 rounded-lg",eX)})},{}),cardClassName:"bg-teal-100 hover:bg-teal-200 dark:bg-teal-700/70 dark:hover:bg-teal-700/90",titleClassName:"text-teal-950 dark:text-teal-100"}},eL=[{src:"/about-us/beer.webp",position:"right-28 -bottom-8 -rotate-12",delay:"delay-0"},{src:"/about-us/meeting.webp",position:"right-14 -bottom-4 rotate-3",delay:"delay-75"},{src:"/about-us/dinner.webp",position:"right-0 -bottom-10 rotate-12",delay:"delay-150"}],eY=[{position:"right-24 bottom-5 -rotate-12",delay:"delay-0"},{position:"right-13 bottom-12 rotate-6",delay:"delay-75"},{position:"right-4 bottom-4 -rotate-3",delay:"delay-150"}],eX="translate-y-16 transition duration-500 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-hover:translate-y-0";function eG(){let[e,t]=(0,f.useState)(!1),[r,a]=(0,f.useState)(!1);return(0,l.jsxs)("div",{className:"flex flex-col gap-8 max-md:gap-6",children:[(0,l.jsx)("div",{className:"order-1 max-md:order-2",children:(0,l.jsx)(E,{setShowModal:a})}),(0,l.jsx)("div",{className:"order-2 max-md:order-1",children:(0,l.jsx)(eK,{})}),(0,l.jsxs)("div",{className:"order-3 flex flex-col gap-4",children:[(0,l.jsx)(eT,{kind:eZ.Referral}),(0,l.jsx)(eT,{kind:eZ.Community}),(0,l.jsx)(eT,{kind:eZ.Game})]}),(0,l.jsx)(eA,{showManageFilesModal:r,setShowManageFilesModal:a,setShowArcade:t}),(0,l.jsx)(x,{showArcade:e,setShowArcade:t})]})}var eU=r(93810),eq=r(8584),eV=r(7459),eW=r(73781),eH=((i={}).Blue="blue",i.Purple="purple",i.Grey="grey",i.Red="red",i);let eJ={blue:"bg-primary-800 text-white dark:bg-primary-700",purple:"bg-violet-950 text-white dark:bg-violet-800",grey:"border border-tertiary-300 text-tertiary-500 dark:border-night-600 dark:text-tertiary-400",red:"bg-critical-red text-white"};function eQ({kind:e,text:t}){return(0,l.jsx)(C.E,{className:(0,J.cn)("rounded-md px-2 py-1 text-xs font-medium",eJ[e]),children:t})}var e0=r(15727);function e2({payoutApplication:e}){var t;let r,{startFiscalYear:a,endFiscalYear:n}=e.data,i=(t=e,[{label:"Angelegt",date:(r=e=>t.statusHistory.find(t=>t.to===e)?.createdAt)(eV.Z.Created)??t.createdAt},{label:"Beim Finanzamt eingereicht",date:r(eV.Z.Filed)},{label:"Entscheidung des Finanzamts",date:r(eV.Z.ApprovedTaxOffice)},{label:"Zahlung eingegangen",date:r(eV.Z.PayoutReceived)}].flatMap(({label:e,date:t})=>void 0===t?[]:[{label:e,date:t}]));return(0,l.jsx)(G.X,{enableClickInteraction:!0,className:"relative z-10",tooltip:(0,l.jsx)(X.g,{wide:!0,children:(0,l.jsxs)("div",{className:"flex flex-col gap-4 p-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"tabular-nums",children:"Gesch\xe4ftsjahr"}),(0,l.jsxs)("div",{className:"text-tertiary-300",children:[(0,e0.Y)(a)," - ",(0,e0.Y)(n)]})]}),(0,l.jsx)("ol",{className:"ml-2 flex flex-col gap-2",children:i.map(({label:e,date:t},r)=>(0,l.jsxs)("li",{className:(0,J.cn)("relative pl-4 not-last:before:absolute not-last:before:top-2.5 not-last:before:-bottom-4.5 not-last:before:left-[3.5px] not-last:before:border-l not-last:before:border-tertiary-500 dark:not-last:before:border-night-400",i[r+1]?.date===null&&"before:border-dashed"),children:[(0,l.jsx)("span",{className:(0,J.cn)("absolute top-1.5 left-0 size-2 roun
1ded-full bg-tertiary-50",null===t&&"border border-tertiary-300 bg-tertiary-800 dark:bg-night-600")}),(0,l.jsx)("div",{className:(0,J.cn)(null===t&&"text-tertiary-300"),children:e}),null!==t&&(0,l.jsx)("div",{className:"text-tertiary-300 tabular-nums",children:(0,e0.Y)(t)})]},e))})]})}),children:(0,l.jsx)("button",{type:"button","aria-label":"Antragsdaten",className:(0,v.uB)(v.Ak.Ghost,v.Mp.XSmall,"inline-flex text-tertiary-800 dark:text-tertiary-300 [&_svg]:size-auto"),children:(0,l.jsx)(k.I,{iconName:k.$.CalendarClock,size:16})})})}var e1=((s={}).Blue="blue",s.Purple="purple",s);function e4({activeStep:e,isWaiting:t,steps:r,color:a="blue",completeText:n,rejectedText:i}){if(null===e)return(0,l.jsx)(G.X,{className:"w-full",tooltip:(0,l.jsx)(X.g,{children:n}),children:(0,l.jsx)("div",{className:"relative h-2.5 w-full rounded-full bg-emerald-600",children:(0,l.jsx)("div",{className:"absolute top-1/2 right-0 flex size-6 -translate-y-1/2 items-center justify-center rounded-full bg-emerald-600",children:(0,l.jsx)(k.I,{iconName:k.$.Check,size:14,className:"text-white"})})})});if(0===e&&i)return(0,l.jsx)(G.X,{className:"flex w-full flex-row gap-1",tooltip:(0,l.jsx)(X.g,{children:i}),children:(0,l.jsx)("div",{className:"relative h-2.5 w-full rounded-full bg-critical-red",children:(0,l.jsx)("div",{className:"absolute top-1/2 right-0 flex size-6 -translate-y-1/2 items-center justify-center rounded-full bg-critical-red",children:(0,l.jsx)(k.I,{iconName:k.$.Close,size:14,className:"text-white"})})})});let s="blue"===a?"bg-primary-300":"bg-violet-400",o="blue"===a?"bg-primary-700 dark:bg-primary-600":"bg-violet-800 dark:bg-violet-600";return(0,l.jsx)("div",{className:"flex flex-row gap-1",children:r.map((r,a)=>{let n=a+1;return(0,l.jsxs)(G.X,{className:"relative flex-1",tooltip:(0,l.jsx)(X.g,{children:r}),children:[(0,l.jsx)("div",{className:(0,J.cn)("h-2.5 w-full rounded-full",n<e&&o,n===e&&s,n>e&&"bg-tertiary-200 dark:bg-night-700")}),t&&n===e&&(0,l.jsx)("div",{className:(0,J.cn)("absolute top-1/2 left-1/2 flex size-6 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full",s),children:(0,l.jsx)(k.I,{iconName:k.$.Hourglass,size:14,className:"text-white"})})]},r)})})}let e5=["Antrag vorbereiten","Antrag komplettieren","Einreichung bei ELSTER","Bearbeitung durch Finanzamt","Warten auf Auszahlung"];function e7({payoutApplicationYear:{year:e,label:t,payoutApplication:r},isArchived:a=!1}){let n=r?`/payout-applications/${r.id}`:`/payout-applications/pending#${e}`,i=function(e){switch(e){case void 0:case eV.Z.Unselected:case eV.Z.InCreation:return{badge:{kind:eH.Purple,text:"Bereite den Antrag vor"},activeStep:1,isWaiting:!1};case eV.Z.Created:return{badge:{kind:eH.Purple,text:"Komplettiere den Antrag"},activeStep:2,isWaiting:!1};case eV.Z.InReview:return{badge:{kind:eH.Grey,text:"Coup pr\xfcft die Eingaben"},activeStep:2,isWaiting:!0};case eV.Z.RevisionRequested:return{badge:{kind:eH.Purple,text:"Adressiere Coups Kommentare"},activeStep:2,isWaiting:!1};case eV.Z.ReadyForFiling:return{badge:{kind:eH.Purple,text:"Reiche den Antrag ein"},activeStep:3,isWaiting:!1};case eV.Z.Filed:return{badge:{kind:eH.Purple,text:"Teile den Finanzamtbescheid"},activeStep:4,isWaiting:!1};case eV.Z.ApprovedTaxOffice:return{badge:{kind:eH.Purple,text:"Best\xe4tige die Auszahlung"},activeStep:5,isWaiting:!1};case eV.Z.PayoutReceived:return{badge:null,activeStep:null,isWaiting:!1}}}(r?.status),s=(0,D.YK)()||[],o=(0,es.ru)(r,s,e);return(0,l.jsxs)("div",{className:(0,J.cn)("relative flex h-full flex-col gap-4 roun
1ded-xl border border-tertiary-300 bg-white p-6 hover:border-tertiary-400 has-[[data-card-link]:focus-visible]:border-primary-800 has-[[data-card-link]:focus-visible]:ring-1 has-[[data-card-link]:focus-visible]:ring-primary-800 max-md:rounded-none dark:border-night-700 dark:bg-night-900 dark:hover:border-night-600 dark:has-[[data-card-link]:focus-visible]:border-primary-400 dark:has-[[data-card-link]:focus-visible]:ring-primary-400",!a&&"shadow-card"),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(eB(),{href:n,"data-card-link":!0,className:"text-base font-semibold text-tertiary-800 after:absolute after:inset-0 focus-visible:outline-hidden dark:text-tertiary-300",children:t}),r&&(0,l.jsx)(e2,{payoutApplication:r})]}),i.badge&&(0,l.jsx)(eQ,{...i.badge})]}),(0,l.jsx)("div",{className:(0,J.cn)("flex items-center gap-1",!r&&"flex-1"),children:o.length>0&&(0,l.jsx)(G.X,{className:"relative z-10",tooltip:(0,l.jsx)(X.g,{wide:!0,children:(0,l.jsx)("ul",{className:"list-disc pl-4",children:o.map(e=>(0,l.jsx)("li",{children:e.name},e.id))})}),children:(0,l.jsx)(C.E,{className:"text-base font-normal text-tertiary-800 dark:text-tertiary-300",children:`${o.length} ${1===o.length?"Projekt":"Projekte"}`})})}),(0,l.jsx)(e3,{year:e,payoutApplication:r,isArchived:a}),(0,l.jsx)(e4,{activeStep:i.activeStep,isWaiting:i.isWaiting,steps:e5,completeText:"Zahlung erhalten",color:e1.Purple})]})}function e3({year:e,payoutApplication:t,isArchived:r}){let a=(0,D.YK)()||[],n=(0,eW.cu)(t,a,e);return(0,l.jsxs)("div",{className:(0,J.cn)("flex items-baseline gap-1 font-serif font-normal",r?"text-green-900 dark:text-green-300":"text-violet-950 dark:text-violet-200"),children:[(0,l.jsx)("span",{className:"text-5xl",children:Math.round(n).toLocaleString("de-DE")}),(0,l.jsx)("span",{className:"text-2xl",children:"â¬"})]})}function e6({showArchived:e=!1}){let t=(0,D.YK)(),r=(0,D.N8)(),a=(0,D.cN)();if(null===t||null===r||null===a)return null;let n=(0,es.gD)(t).filter(e=>!(0,eU.iJ)(a,e.id)),i=new Set((0,es.gD)(t.filter(e=>e.status===eq.X.Filed||e.status===eq.X.ApprovedBSFZ)).map(e=>e.id)),s=n.map(e=>{let t=r.find(t=>(0,es.Ue)(t.data).year===e.id);return{year:e.id,label:t?(0,es.Ue)(t.data).displayYear:e.label,payoutApplication:t}}).filter(({year:e,payoutApplication:t})=>t||i.has(e));return 0===s.length?null:e?(0,l.jsx)(e9,{payoutApplicationYears:s}):(0,l.jsx)(e8,{payoutApplicationYears:s})}function e8({payoutApplicationYears:e}){let t=e.filter(e=>!tt(e));return 0===t.length?null:(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(C.E,{className:eD,children:"Antr\xe4ge auf Forschungszulage"}),(0,l.jsx)(te,{payoutApplicationYears:t})]})}function e9({payoutApplicationYears:e}){let t=e.filter(tt);return 0===t.length?null:(0,l.jsx)(e_,{title:`Antr\xe4ge auf Forschungszulage â Archiv (${t.length})`,children:(0,l.jsx)(te,{payoutApplicationYears:t,archived:!0})})}function te({payoutApplicationYears:e,archived:t=!1}){return(0,l.jsx)("div",{className:(0,J.cn)("grid auto-rows-fr gap-4",e.length>1&&"grid-cols-2 max-md:grid-cols-1"),children:e.map(e=>(0,l.jsx)(e7,{payoutApplicationYear:e,isArchived:t},e.year))})}function tt({payoutApplication:e}){return e?.status===eV.Z.PayoutReceived}var tr=r(43247),ta=r(68021),tn=r(13002),ti=r(14898),ts=r(98984),tl=r(83764);function to({project:e,iconOnly:t=!1}){let r=(0,D.YK)(),a=(0,tl.qd)(r,e.id),n=()=>(0,S.If)("cost_tracking_navigated");return t?(0,l.jsx)(G.X,{tooltip:(0,l.jsx)(X.g,{children:"Kostenerfassung"}),children:(0,l.jsx)(eB(),{href:a,onClick:n,"aria-label":"Kostenerfassung",className:(0,v.uB)(v.Ak.Ghost,v.Mp.Small,"inline-flex"),children:(0,l.jsx)(k.I,{iconName:k.$.CostTracking})})}):(0,l.jsxs)(eB(),{href:a,onClick:n,className:(0,v.uB)(v.Ak.Ghost,v.Mp.Small,"inline-flex gap-1.5"),children:[(0,l.jsx)(k.I,{iconName:k.$.CostTracking}),(0,l.jsx)("span",{children:"Kostenerfassung"})]})}function td({project:e}){var t;let r,{startDate:a,endDate:n}=e.data,i=(t=e,r=e=>t.statusHistory.find(t=>t.to===e)?.createdAt,[{label:"Angelegt",date:t.createdAt},{label:"Zur Begutachtung bei Coup eingereicht",date:r(eq.X.InReviewAll)},{label:"Eingereicht bei BSFZ",date:r(eq.X.Filed)},{label:"BSFZ-Beschluss",date:t.bsfzDecisionDate}].flatMap(({label:e,date:t})=>void 0===t?[]:[{label:e,date:t}]));return(0,l.jsx)(G.X,{enableClickInteraction:!0,className:"relative z-10",tooltip:(0,l.jsx)(X.g,{wide:!0,children:(0,l.jsxs)("div",{className:"flex flex-col gap-4 p-2",children:[a&&n&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"tabular-nums",children:"Projektzeitraum"}),(0,l.jsxs)("div",{className:"text-tertiary-300",children:[(0,q.GP)(a,"LLL yyyy",{locale:V.de})," -"," ",(0,q.GP)(n,"LLL yyyy",{locale:V.de})]})]}),(0,l.jsx)("ol",{className:"ml-2 flex flex-col gap-2",children:i.map(({label:e,date:t},r)=>(0,l.jsxs)("li",{className:(0,J.cn)("relative pl-4 not-last:before:absolute not-last:before:top-2.5 not-last:before:-bottom-4.5 not-last:before:left-[3.5px] not-last:before:border-l not-last:before:border-tertiary-500 dark:not-last:before:border-night-400",i[r+1]?.date===null&&"before:border-dashed"),children:[(0,l.jsx)("span",{className:(0,J.cn)("absolute top-1.5 left-0 size-2 roun
1ded-full bg-tertiary-50",null===t&&"border border-tertiary-300 bg-tertiary-800 dark:bg-night-600")}),(0,l.jsx)("div",{className:(0,J.cn)(null===t&&"text-tertiary-300"),children:e}),null!==t&&(0,l.jsx)("div",{className:"text-tertiary-300 tabular-nums",children:(0,e0.Y)(t)})]},e))})]})}),children:(0,l.jsx)("button",{type:"button","aria-label":"Projektdaten",className:(0,v.uB)(v.Ak.Ghost,v.Mp.XSmall,"inline-flex text-tertiary-400 dark:text-tertiary-500 [&_svg]:size-auto"),children:(0,l.jsx)(k.I,{iconName:k.$.CalendarClock,size:16})})})}function tc({project:e,iconOnly:t=!1}){let r=(0,D.YK)(),a=(0,tl.G3)(r,e.id),n=()=>(0,S.If)("time_tracking_navigated");return t?(0,l.jsx)(G.X,{tooltip:(0,l.jsx)(X.g,{children:"Zeiterfassung"}),children:(0,l.jsx)(eB(),{href:a,onClick:n,"aria-label":"Zeiterfassung",className:(0,v.uB)(v.Ak.Ghost,v.Mp.Small,"inline-flex"),children:(0,l.jsx)(k.I,{iconName:k.$.TimeTracking})})}):(0,l.jsxs)(eB(),{href:a,onClick:n,className:(0,v.uB)(v.Ak.Ghost,v.Mp.Small,"inline-flex gap-1.5"),children:[(0,l.jsx)(k.I,{iconName:k.$.TimeTracking}),(0,l.jsx)("span",{children:"Zeiterfassung"})]})}var tu=r(17731),th=r(32251),tm=r(81070);let tf=["Daten eingeben","F\xf6rderantrag vorbereiten","Einreichung bei der BSFZ","Bewertung durch die BSFZ"];function tx({project:e,isArchived:t=!1}){let{messages:r}=(0,tu.t)(),a=(0,D.o)(),n=e.status===eq.X.ApprovedBSFZ,i=(0,tn.Vo)(e.data)&&!(0,tm.l)(r,e.id,a?.id),s=function(e,t){switch(e){case eq.X.InDiscovery:return{badge:{kind:eH.Grey,text:"Coup pr\xfcft R&D-Fit"},activeStep:1,isWaiting:!0};case eq.X.Created:return{badge:{kind:eH.Blue,text:t?"Sichte die Storyline":"Beschreibe das Projekt"},activeStep:1,isWaiting:!1};case eq.X.InReviewAll:return{badge:{kind:eH.Grey,text:"Coup pr\xfcft Eingaben"},activeStep:1,isWaiting:!0};case eq.X.RevisionRequested:return{badge:{kind:eH.Blue,text:"Adressiere Coups Kommentare"},activeStep:1,isWaiting:!1};case eq.X.AcceptedCoup:return{badge:{kind:eH.Grey,text:"Coup bereitet den Antrag vor"},activeStep:2,isWaiting:!0};case eq.X.InReviewProposal:return{badge:{kind:eH.Blue,text:"Pr\xfcfe den Antrag"},activeStep:2,isWaiting:!1};case eq.X.ProposalRevisionRequested:return{badge:{kind:eH.Grey,text:"Coup \xfcberarbeitet den Antrag"},activeStep:2,isWaiting:!0};case eq.X.ReadyForFiling:return{badge:{kind:eH.Grey,text:"Coup reicht Antrag ein"},activeStep:3,isWaiting:!0};case eq.X.Filed:return{badge:{kind:eH.Grey,text:"BSFZ pr\xfcft Antrag"},activeStep:4,isWaiting:!0};case eq.X.ApprovedBSFZ:return{badge:null,activeStep:null,isWaiting:!1};case eq.X.RejectedCoup:case eq.X.RejectedBSFZ:return{badge:{kind:eH.Red,text:"Abgelehnt"},activeStep:0,isWaiting:!1};case eq.X.Unselected:case eq.X.Superseded:return{badge:null,activeStep:0,isWaiting:!1}}}(e.status,i),o=s.badge?.kind===eH.Blue;return(0,l.jsxs)("div",{className:(0,J.cn)("flex h-full flex-col rounded-xl border border-tertiary-300 bg-white ring-primary-200 hover:border-tertiary-400 has-[[data-card-link]:focus-visible]:border-primary-800 has-[[data-card-link]:focus-visible]:ring-1 has-[[data-card-link]:focus-visible]:ring-primary-800 max-md:rounded-none dark:border-night-700 dark:bg-night-900 dark:ring-primary-400 dark:hover:border-night-600 dark:has-[[data-card-link]:focus-visible]:border-primary-400 dark:has-[[data-card-link]:focus-visible]:ring-primary-400",!t&&"shadow-card"),children:[(0,l.jsxs)("div",{className:"relative flex flex-col gap-4 px-6 pt-6 pb-4",children:[(0,l.jsx)(eB(),{href:`/projects/${e.id}`,"data-card-link":!0,className:"text-md inline-flex font-medium text-tertiary-800 after:absolute after:inset-0 focus-visible:outline-hidden dark:text-tertiary-300",children:e.data.name}),(0,l.jsxs)("div",{className:"order-first flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(C.E,{className:"text-sm font-normal text-tertiary-400 uppercase dark:text-tertiary-500",children:"F\xf6rderantrag"}),(0,l.jsx)(td,{project:e})]}),s.badge&&(0,l.jsx)(eQ,{...s.badge})]}),(0,l.jsx)(ts.G,{project:e,className:"z-10 order-first"}),(0,l.jsx)(C.E,{className:(0,J.cn)("font-serif text-5xl font-medium text-primary-800 dark:text-primary-300",(t||null===s.activeStep)&&"text-green-900 dark:text-green-300",s.badge?.kind===eH.Red&&"text-rose-950 dar
1k:text-rose-700"),children:(0,l.jsx)("span",{className:n?"relative cursor-pointer":void 0,onClick:n?tp:void 0,children:(0,l.jsx)(th.e,{projectData:e.data,euroClassName:"text-2xl"})})}),(0,l.jsx)(e4,{activeStep:s.activeStep,isWaiting:s.isWaiting,steps:tf,completeText:"F\xf6rderantrag genehmigt",rejectedText:"F\xf6rderantrag abgelehnt"})]}),!t&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("hr",{className:"border-b border-tertiary-200 dark:border-night-700"}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-4 px-3 py-4",children:[(0,l.jsx)(tc,{project:e,iconOnly:o}),(0,l.jsx)(to,{project:e,iconOnly:o})]})]})]})}function tp(e){(0,ti.A)({particleCount:150,spread:75,startVelocity:35,ticks:200,origin:{x:e.clientX/window.innerWidth,y:e.clientY/window.innerHeight}})}function tg({showArchived:e=!1}){let t=(0,D.YK)(),r=(0,D.N8)(),a=(0,D.cN)();return null===t||null===r||null===a?null:e?(0,l.jsx)(tj,{projects:t,payoutApplications:r,customer:a}):(0,l.jsx)(ty,{projects:t,payoutApplications:r,customer:a})}function ty({projects:e,payoutApplications:t,customer:r}){let a=(0,m.useRouter)(),n=(0,tr.sq)(new Date),i=e.filter(e=>!tb(e,t,r,n));return 0===i.length?(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(C.E,{className:eD,children:"Projekte"}),(0,l.jsx)(ta.J,{iconName:k.$.ProjectCreate,title:"Neues Projekt anlegen",description:0===e.length?"Starte hier, um euer erstes Projekt anzulegen.":"Starte hier, um ein neues Projekt anzulegen.",buttonText:"Projekt anlegen",event:"project_creation_navigated",onClick:()=>a.push("/projects/create/funding-application")})]}):(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(C.E,{className:eD,children:"Projekte"}),(0,l.jsxs)(eB(),{href:"/projects/create/funding-application",className:(0,v.uB)(v.Ak.Ghost,v.Mp.Medium,"mr-6 flex gap-x-1"),children:[(0,l.jsx)(k.I,{iconName:k.$.Plus,size:18}),(0,l.jsx)("span",{children:"Hinzuf\xfcgen"})]})]}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:i.map(e=>(0,l.jsx)(tx,{project:e},e.id))})]})}function tj({projects:e,payoutApplications:t,customer:r}){let a=(0,tr.sq)(new Date),n=e.filter(e=>tb(e,t,r,a));return 0===n.length?null:(0,l.jsx)(e_,{title:`Projekte â Archiv (${n.length})`,children:(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4",children:n.map(e=>(0,l.jsx)(tx,{project:e,isArchived:!0},e.id))})})}function tb(e,t,r,a){switch(e.status){case eq.X.RejectedCoup:case eq.X.RejectedBSFZ:return!0;case eq.X.ApprovedBSFZ:{let{endDate:n}=e.data;if(!n||n>=a)return!1;return(0,es.gD)([e]).map(e=>e.id).filter(e=>!(0,eU.iJ)(r,e)).every(e=>{let r=t.find(t=>(0,es.Ue)(t.data).year===e);return r?.status===eV.Z.PayoutReceived})}default:return!1}}var tv=r(99683),tk=r(25453);function tN(){let{push:e}=(0,m.useRouter)(),t=(0,D.YK)(),r=(0,D.cN)(),a=null!==r&&!r.stripeSubscription,n=null!==t&&t.length<1,i=null!==r&&(r.stripeSubscription?.status===tv.Nz.Incomplete||r.stripeSubscription?.status===tv.Nz.IncompleteExpired||r.stripeSubscription?.status===tv.Nz.Unpaid);return a||n||!i?null:(0,l.jsx)("div",{className:"px-2 max-md:p-0",children:(0,l.jsx)(tk.l,{icon:(0,l.jsx)(k.I,{iconName:k.$.Euro,size:24}),kind:"warning",title:"Zahlungen einrichten",details:"Bitte begleiche offene Rechnungen. Um diesen Fall in der Zukunft zu vermeiden, richte automatische Zahlungen ein.",className:"max-md:rounded-none",actionBtn:{icon:(0,l.jsx)(k.I,{iconName:k.$.Billing,size:20}),label:"Einrichten",onClick:()=>e("/settings/billing")}})})}let tw=()=>{let e=(0,D.o)(),t=(0,D.cN)();return e&&t?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.p,{title:"Coup - Home"}),(0,l.jsxs)("div",{className:"mx-auto my-0 flex w-full flex-col items-center gap-8 pt-10",children:[(0,l.jsx)("div",{className:"bypass-rounded-parent flex w-full flex-col gap-10",children:(0,l.jsxs)(d.D.H4,{className:"pl-6",children:["Willkommen,"," ",e?.displayName?(0,l.jsx)("span",{children:e?.displayName}):(0,l.jsx)("span",{children:"Benutzer"})]})}),(0,l.jsxs)("div",{className:"grid w-full grid-cols-[66%_1fr] gap-8 max-md:grid-cols-1 max-md:gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(tN,{}),(0,l.jsx)(u.a,{customer:t}),(0,l.jsxs)("div",{className:"flex flex-col gap-12 max-md:gap-6",children:[(0,l.jsx)(tg,{}),(0,l.jsx)(e6,{}),(0,l.jsx)(tg,{showArchived:!0}),(0,l.jsx)(e6,{showArchived:!0})]})]}),(0,l.jsx)("aside",{children:(0,l.jsx)(eG,{})})]})]})]}):null};tw.getLayout=e=>(0,l.jsx)(c.Y,{footerInCenter:!0,children:e});let tC=tw},32251:(e,t,r)=>{"use strict";r.d(t,{e:()=>s});var a=r(26514),n=r(19763),i=r(75834);function s({projectData:e,euroClassName:t}){let r=(0,i.useMemo)(()=>(0,n.Ar)(e),[e]),l=(0,a.jsx)("span",{className:t,children:" â¬"});if(r.kind===n.RE.Calculated)return(0,a.jsxs)("span",{className:"whitespace-nowrap",children:[r.funding.toLocaleStr
1ing("de-DE"),l]});if(r.kind===n.RE.MissingData)return(0,a.jsx)("span",{children:"-"});let{funding:o,lower:d,upper:c}=r;return 0===o?(0,a.jsxs)("span",{className:"whitespace-nowrap",children:["0",l]}):(0,a.jsxs)("span",{className:"whitespace-nowrap",children:[d.toLocaleString("de-DE"),l," - ",c.toLocaleString("de-DE"),l]})}},36308:(e,t,r)=>{"use strict";r.d(t,{O:()=>u,g:()=>c});var a=r(26514),n=r(12308),i=r(8584),s=r(89980),l=r(89035),o=r(75834);let d=(0,o.createContext)({});function c({children:e,projectCustomerData:t,projectData:r,projectStatus:u,disabled:h}){let m=(0,l.K)(),[f,x]=(0,o.useState)(t.contactUser?.preferredLanguage||n.T.German),[p,g]=(0,o.useState)(m&&u!==i.X.InDiscovery),{data:y}=(0,s.L)("string"==typeof r.createdBySuperseding?"projects":null,r.createdBySuperseding||""),{data:j}=(0,s.L)(r.status===i.X.Superseded?"projects":null,r.statusHistory[r.statusHistory.length-1]?.supersededBy||"");return(0,a.jsx)(d.Provider,{value:{projectData:r,projectStatus:u,supersededProject:y,supersedingProject:j,disabled:h,questionsDisabled:p||h,setQuestionsDisabled:g,projectCustomerData:t,preferredLanguage:f,setPreferredLanguage:x},children:e})}let u=()=>{let e=(0,o.useContext)(d);if(void 0===e.projectData)throw Error("useProjectContext requires <ProjectContextProvider> higher in the component tree");return e}},36690:(e,t,r)=>{"use strict";r.d(t,{Z:()=>B});var a=r(26514),n=r(45964),i=r(48878),s=r(25453),l=r(75241),o=r(40229),d=r(6464),c=r(9826),u=r(28213),h=r(80036),m=r(43247),f=r(96725),x=r
1(54414),p=r(75337),g=r(49811),y=r(24222),j=r(80676),b=r(86725),v=r(11835),k=r(87470),N=r(92613),w=r(68003),C=r(21467),M=r(25203),I=r(75834);function A({contract:e,customer:t,editIsDisabled:r,isSuperViewer:s}){let o=(0,M.N8)(),d=(0,M.YK)(),c=e.projectId,u=d?.find(e=>e.id===c)||null,S=(0,I.useMemo)(()=>u&&u.data.startDate&&u.data.endDate?(0,h.R)((0,m.pp)(u.data.startDate),(0,m.pp)(u.data.endDate)):[],[u]),{files:D}=(0,w.y)(t.id,{fileKind:i.Mk.Contract,projectId:c,status:i.BM.Confirmed}),{files:_}=(0,w.y)(t.id,{fileKind:i.Mk.Invoice,projectId:c,status:i.BM.Confirmed}),{files:E}=(0,w.y)(t.id,{fileKind:i.Mk.Receipt,projectId:c,status:i.BM.Confirmed}),F=(0,C.j7)(),B=(0,I.useId)(),K=null!==e&&(0,f.YB)(e),$=(o||[]).filter(n.B$).map(e=>(0,m.H)(e.data.startFiscalYear)),z=""!==F.values.year&&$.includes(F.values.year)&&(!K||e.data.year!==F.values.year),P=F.values.contractorName,R=(0,I.useMemo)(()=>(0,k.F)(P,e&&"contractorId"in e?e.contractorId:void 0,o,d),[P,e,o,d]);return(0,a.jsx)("div",{className:"w-full px-1 lg:max-w-96",children:(0,a.jsxs)("div",{className:"flex flex-col gap-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,a.jsx)(g.J,{htmlFor:B,className:"text-sm font-semibold text-tertiary-900 dark:text-tertiary-100",children:"Auftragnehmer"}),(0,a.jsx)(p.d,{showSuggestion:!!R,suggestion:(0,a.jsxs)(y.E,{className:"text-sm",children:["Stattdessen"," ",(0,a.jsx)(l.tB.Link,{event:"contract_contractor_name_suggestion_confirmed",className:"text-sm",onClick:()=>F.setFieldValue("contractorName",R),children:R})," ","nutzen?"]}),input:(0,a.jsx)(x.G,{id:B,placeholder:"Some Company GmbH",value:F.values.contractorName||"",options:(0,v.E)([...D.filter(f.YB),..._,...E],u,o),handleChange:e=>{F.setFieldValue("contractorName",e)},onBlur:()=>{F.setFieldTouched("contractorName",!0)},hasError:F.touched.contractorName&&"string"==typeof F.errors.contractorName,disabled:r||F.isSubmitting||s,allowCustomValue:!0,customValueSuffix:"(neuer Auftragnehmer)"})}),(0,a.jsx)(N.I,{name:"contractorName"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,a.jsx)(g.J,{htmlFor:"year",className:"text-sm font-semibold text-tertiary-900 dark:text-tertiary-100",children:"Jahr"}),(0,a.jsx)(b.z,{years:S,selectedYear:F.values.year||void 0,handleChange:e=>{F.setFieldValue("year",e)},hasError:"year"in F.errors&&"year"in F.touched,onBlur:()=>F.setFieldTouched("year"),disabled:r||F.isSubmitting||s}),(0,a.jsx)(N.I,{name:"year"}),z&&(0,a.jsx)(j.A,{message:`Der Antrag auf Forschungszulage ${F.values.year} wurde schon finalisiert.`})]})]})})}var S=r(73061),D=r(25229),_=r(33208),E=r(4992),F=r(33066);function B({contract:e,customer:t,editIsDisabled:r,handleDelete:h,isSuperViewer:m,onSuccess:f}){let{trackError:x}=(0,_.j)(),[p,g]=(0,I.useState)(!1);return(0,a.jsx)(C.l1,{initialValues:e.data?{...e.data}:{contractorName:"rawData"in e&&e.rawData?.contractorInfo?.data.name||"",year:""},onSubmit:async(r,a)=>{g(!0);try{let s=(0,E.xA)();await (0,E.c4)(async a=>{let l=await (0,D.GG)((0,D.P)((0,D.rJ)(s,"payoutApplications"),(0,D._M)("customerId","==",t.id))),o=(await Promise.all(l.docs.map(e=>a.get(e.ref)))).map(e=>e.data()).map(t=>(0,n.rk)(r.contractorName,r.year,t,e.projectId)).find(e=>null!==e),d=(0,D.H9)(s,"customers",t.id,"files",e.id),c={data:r,status:i.BM.Confirmed,...o||{payoutApplicationId:(0,D.CL)(),contractorId:(0,D.CL)()}};a.update(d,c)}),(0,S.o)("success","Die \xc4nderungen wurden gespeichert."),a.resetForm({values:r}),f?.()}catch(e){x("Error in `onSubmit` in EditContractModal",e),(0,S.o)("error","Etwas ist schiefgegangen. Die \xc4nderungen konnte nicht gespeichert werden.")}finally{g(!1)}},validationSchema:F.Ik().shape({contractorName:F.Yj().required("Bitte gib den Namen des Auftragnehmers an").max(100,"Der Name des Auftragnehmers darf maximal 100 Zeichen lang sein"),year:F.Yj().required("Bitte gib das Jahr an")}),validateOnMount:!0,children:n=>(0,a.jsxs)(C.lV,{className:"flex h-full flex-col gap-8 lg:w-80",children:[(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-6 overflow-scroll",children:[r&&(0,a.jsx)(s.l,{kind:"info",details:"Dieser Vertrag ist Teil eines finalisierten Antrags auf FZul und kann daher nicht bearbeitet werden.",icon:(0,a.jsx)(d.I,{iconName:d.$.Info,size:20})}),(0,a.jsx)(A,{contract:e,customer:t,editIsDisabled:r,isSuperViewer:m})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(u.X,{tooltip:(0,a.jsx)(c.g,{children:"Dieser Vertrag ist Teil eines finalisierten Antrags auf FZul und kann daher nicht entfernt werden."}),disabled:!r,children:(0,a.jsx)(o.t,{buttonClassName:"w-10",onConfirm:h,disabled:r||p||m,triggerEvent:"contract_deleti
1on_started",confirmEvent:"contract_deletion_confirmed",cancelEvent:"contract_deletion_cancelled",children:(0,a.jsx)(d.I,{iconName:d.$.Delete,size:20})})}),(0,a.jsx)(l.tB.Primary,{event:"contract_form_submitted",onClick:n.submitForm,disabled:r||!n.isValid||m||!n.dirty,processing:p,children:e.status===i.BM.Confirmed?"Aktualisieren":"Speichern"})]})]})})}},48878:(e,t,r)=>{"use strict";r.d(t,{BM:()=>s,Mk:()=>i,lt:()=>l,uZ:()=>d});var a,n,i=((a=i||{}).AnnualRnDReport="annual_rnd_report",a.BSFZNotice="bsfz_notice",a.BSFZSubmissionConfirmation="bsfz_submission_confirmation",a.Contract="contract_contractor",a.Invoice="invoice_contractor",a.Lohnjournal="lohnjournal",a.Other="other",a.ProjectTimesheets="project_timesheets",a.Receipt="payment_receipt_contractor",a.TaxOfficeNotice="tax_office_notice",a.TaxOfficeInquiry="tax_office_inquiry",a.Unknown="unknown",a),s=((n=s||{}).Processing="processing",n.Processed="processed",n.Confirmed="confirmed",n.Error="error",n);function l(e){return o[e]}let o={annual_rnd_report:"F&E Report",bsfz_notice:"BSFZ Bescheid",bsfz_submission_confirmation:"BSFZ Best\xe4tigung der Einreichung",contract_contractor:"Vertrag",invoice_contractor:"Rechnung",lohnjournal:"Lohnjournal",other:"Andere",project_timesheets:"Stundenzettel",payment_receipt_contractor:"Zahlungsnachweis",tax_office_inquiry:"Nachfrage Finanzamt",tax_office_notice:"Finanzamtbescheid",unknown:"Unbekannt"};function d(e,t,r){return`customers/${e}/${t}/${r}`}},51193:(e,t,r)=>{"use strict";r.d(t,{EB:()=>i,FH:()=>l,K4:()=>d,Y2:()=>n,YQ:()=>c,eT:()=>a,s1:()=>o,vT:()=>s});let a=4e6,n=1e7,i=12e6,s=.25,l=.35,o=.6,d=.7,c=.2},54139:(e,t,r)=>{"use strict";r.d(t,{l:()=>i});var a=r(26514),n=r(81054);function i({value:e,optionValues:t,optionLabels:r,defaultLabel:s,hideDefault:l=!1,handleChange:o,className:d="",hasError:c=!1,...u}){let h="string"==typeof e&&""!==e?e:n.I;return(0,a.jsxs)("select",{onChange:function(e){o(e.target.value)},value:h,className:`${d} ${c?"border border-critical-red dark:border-red-400":""} ${e===n.I?"text-tertiary-300 dark:text-tertiary-500":""}`,...u,children:[(0,a.jsx)("option",{value:"unselected",hidden:l,children:s||"Bitte ausw\xe4hlen..."}),t.map((e,t)=>(0,a.jsx)("option",{value:e,children:r?r[t]:e},t))]})}},57177:(e,t,r)=>{"use strict";r.d(t,{K:()=>n});var a=r(25203);function n(){let e=(0,a.o)(),t=[];return e&&"viewConstraints"in e&&Array.isArray(e.viewConstraints)&&t.push(...e.viewConstraints),function(e){return t.includes(e)}}},68003:(e,t,r)=>{"use strict";r.d(t,{y:()=>c});var a=r(76055),n=r(25229),i=r(47578),s=r(33208),l=r(4992),o=r(25203),d=r(75834);function c(e,t={}){let{trackError:r}=(0,s.j)(),u=(0,o.o)(),[h,m]=(0,d.useState)({status:i.n.Idle,files:[]}),f=(0,o.Pq)(),x=u?.role===a.gG.Super,p=u&&e&&u.customerId!==e;function g(e,t){return e.filter(e=>(!t.fileKind||e.fileKind===t.fileKind)&&(!t.projectId||"projectId"in e&&e.projectId===t.projectId)&&(!t.payoutApplicationId||"payoutApplicationId"in e&&e.payoutApplicationId===t.payoutApplicationId)&&(!t.status||"status"in e&&e.status===t.status))}return(0,d.useEffect)(()=>{if(p){if(!x)return void m({status:i.n.Error,files:[]});m({status:i.n.Loading,files:[]});let s=[];t.fileKind&&t.fileKind.length>0&&s.push((0,n._M)("fileKind","==",t.fileKind)),t.projectId&&s.push((0,n._M)("projectId","==",t.projectId)),t.payoutApplicationId&&s.push((0,n._M)("payoutApplicationId","==",t.payoutApplicationId)),t.status&&s.push((0,n._M)("status","==",t.status));let o=(0,l.Q5)(`customers/${e}/files`,e=>{m({status:i.n.Success,files:g(e.toSorted((e,t)=>t.uploadedAt.seconds-e.uploadedAt.seconds),t)})},e=>{m({status:i.n.Error,files:[]}),"code"in e&&"permission-denied"===e.code&&u.role!==a.gG.Super||r("Error subscribing to files in useOrReuseFiles",e)},...s);return()=>{o()}}f?m({status:i.n.Success,files:g(f,t)}):m({status:i.n.Loading,files:[]})},[f,x,e,...Object.values(t)]),h}},68021:(e,t,r)=>{"use strict";r.d(t,{J:()=>o});var a=r(26514),n=r(75241),i=r(43735),s=r(6464),l=r(24222);function o({iconName:e,title:t,description:r,buttonText:d,onClick:c,event:u,fullHeight:h=!1}){return(0,a.jsxs)("div",{className:`bypass-rounded-child flex w-full flex-1 flex-col items-center justify-center gap-8 rounded-lg bg-tertiary-100 py-11 border-2 border-dashed border-tertiary-300 max-md:rounded-none dark:bg-night-800 dark:border-night-600 focus:border-primary-800 ${h?"h-full":""}`,children:[(0,a.jsx)(s.I,{iconName:e,size:64,className:"text-tertiary-300 dark:text-night-500"}),(0,a.jsxs)("div",{className:"flex flex-col items-center justify-between gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,a.jsx)(i.D.H6,{children:t}),(0,a.jsx)(l.E,{className:"text-sm max-md:px-1 max-md:text-center",children:r})]}),d&&(0,a.jsx)(n.tB.Primary,{event:u,onClick:c,children:d})]})]})}},69991:(e,t,r)=>{"use strict";r.d(t,{Q:()=>v});var a=r(26514),n=r(24194),i=r(45964),s=r(48878),l=r(25453),o=r(75241),d=r(40229),c=r(6464),u=r(9826),h=r(28213),m=r(11835),f=r(73061),x=r(25229),p=r(21467),g=r(33208),y=r(4992),j=r(75834),b=r(33066);function v({customer:e,editIsDisabled:t,handleDelete:r,isSuperViewer:k,invoice:N,onSuccess:w}){let{trackError:C}
1=(0,g.j)(),[M,I]=(0,j.useState)(!1);return(0,a.jsx)(p.l1,{initialValues:{...(0,n.r1)(N)||(0,n.gW)(N)?N.data:{invoiceNumber:"",issuerName:"",paymentYear:"",netAmount:""}},onSubmit:async(t,r)=>{I(!0);try{let a=(0,y.xA)();await (0,y.c4)(async r=>{let n=await (0,x.GG)((0,x.P)((0,x.rJ)(a,"payoutApplications"),(0,x._M)("customerId","==",e.id))),l=(await Promise.all(n.docs.map(e=>r.get(e.ref)))).map(e=>e.data()).map(e=>(0,i.rk)(t.issuerName,t.paymentYear,e,N.projectId)).find(e=>null!==e),o=(0,x.H9)(a,"customers",e.id,"files",N.id),d={data:t,status:s.BM.Confirmed,...l||{payoutApplicationId:(0,x.CL)(),contractorId:(0,x.CL)()}};r.update(o,d)}),(0,f.o)("success","Die \xc4nderungen wurden gespeichert."),r.resetForm({values:t}),w?.()}catch(e){C("Error in `onSubmit` in EditInvoiceModal",e),(0,f.o)("error","Etwas ist schiefgegangen. Die \xc4nderungen konnte nicht gespeichert werden.")}finally{I(!1)}},validationSchema:b.Ik().shape({invoiceNumber:b.Yj().required("Bitte gib eine Rechnungsnummer an").max(50,"Die Rechnungsnummer darf maximal 50 Zeichen lang sein"),issuerName:b.Yj().required("Bitte gib den Namen des Auftragnehmers an").max(100,"Der Name des Auftragnehmers darf maximal 100 Zeichen lang sein"),paymentYear:b.Yj().required("Bitte gib das Zahlungsjahr an"),netAmount:b.ai().required("Bitte gib den R&D Kosten an"),paidBeforeJuly2020:b.zM().when("paymentYear",{is:"2020",then:e=>e.required("Bitte w\xe4hlen")}),paidBeforeMarch28th2024:b.zM().when("paymentYear",{is:"2024",then:e=>e.required("Bitte w\xe4hlen")})}),validateOnMount:!0,children:n=>(0,a.jsxs)(p.lV,{className:"flex h-full flex-col gap-8 lg:w-80",children:[(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-6 overflow-scroll",children:[t&&(0,a.jsx)(l.l,{kind:"info",details:"Diese Rechnung ist Teil eines finalisierten Antrags auf FZul und kann daher nicht bearbeitet werden.",icon:(0,a.jsx)(c.I,{iconName:c.$.Info,size:20})}),(0,a.jsx)(m.u,{customer:e,editIsDisabled:t,invoice:N,isSuperViewer:k})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(h.X,{tooltip:(0,a.jsx)(u.g,{children:"Diese Rechnung ist Teil eines finalisierten Antrags auf FZul und kann daher nicht entfernt werden."}),disabled:!t,children:(0,a.jsx)(d.t,{buttonClassName:"w-10",onConfirm:r,disabled:t||M||k,triggerEvent:"invoice_deletion_started",confirmEvent:"invoice_deletion_confirmed",cancelEvent:"invoice_deletion_cancelled",children:(0,a.jsx)(c.I,{iconName:c.$.Delete,size:20})})}),(0,a.jsx)(o.tB.Primary,{event:"invoice_form_submitted",onClick:n.submitForm,disabled:t||!n.isValid||k||!n.dirty,processing:M,children:N.status===s.BM.Confirmed?"Aktualisieren":"Speichern"})]})]})})}},73781:(e,t,r)=>{"use strict";r.d(t,{L0:()=>u,Tk:()=>h,cu:()=>m,le:()=>d});var a=r(39655),n=r(99582),i=r(43247),s=r(19763),l=r(51193),o=r(45964);function d(e,t,r){let{actualFunding:a,hasOverCostLimit:i,isDataMissing:s,maxAssessmentBasis:l}=u(e),o=e.projects.map(e=>e.id),{expectedFunding:d,isDataMissing:h}=c(t.filter(e=>o.includes(e.id)),r),m={internal:{funding:(0,n.sq)(d.internal.funding,a.internal.funding),staffCost:(0,n.sq)(d.internal.staffCost,a.internal.staffCost),otherFunding:(0,n.sq)(d.internal.otherFunding,a.internal.otherFunding)},external:{funding:(0,n.sq)(d.external.funding,a.external.funding),externalContractorCost:(0,n.sq)(d.external.externalContractorCost,a.external.externalContractorCost),otherFunding:(0,n.sq)(d.external.otherFunding,a.external.otherFunding)},funding:(0,n.sq)(d.funding,a.funding)};return{actualFunding:a,expectedFunding:d,deviation:m,isDataMissing:h||s,hasOverCostLimit:i,maxAssessmentBasis:l}}function c(e,t){let r=!1,a={internal:{funding:0,staffCost:0,otherFunding:0},external:{funding:0,externalContractorCost:0,otherFunding:0},funding:0};return e.map(e=>({id:e.id,name:e.data.name,...(0,s.Oq)(e.data)})).forEach(e=>{a.internal.staffCost+=e.yearlyStaffCost?.[`year_${t}`]||0,a.internal.otherFunding+=e.yearlyAssessmentBasisInternal?.[`year_${t}`]||0,a.external.externalContractorCost+=e.yearlyExternalContractorCost?.[`year_${t}`]||0,a.external.otherFunding+=e.yearlyAssessmentBasisExternal?.[`year_${t}`]||0,a.internal.funding+=e.yearlyFundingInternal?.[`year_${t}`]||0,a.external.funding+=e.yearlyFundingExternal?.[`year_${t}`]||0,e.missingData.length>0&&(r=!0)}),a.funding=a.internal.funding+a.external.funding,{expectedFunding:a,isDataMissing:r}}function u(e){let t=!1,{year:r}=(0,o.Ue)(e),n=e.salaryExpenses.hasEmployeesAbroad,s={internal:{funding:0,staffCost:0,staffCostBeforeMarch28th2024:0,staffCostAfterMarch27th2024:0,otherFunding:0},external:{funding:0,externalContractorCost:0,externalContractorCostBeforeMarch28th2024:0,externalContractorCostAfterMarch27th2024OldShare:0,externalContractorCostAfterMarch27th2024NewShare:0,otherFunding:0},overhead:{staffCostApplicableForOverhead:0,contractorCostApplicableForOverhead:0},funding:0},d=0,c=0;
1e.projects.forEach(l=>{let o="string"==typeof l.startDate&&(0,i.pp)(l.startDate)>(0,i.pp)("2024-03-27"),u="string"==typeof l.startDate&&(0,i.pp)(l.startDate)>(0,i.pp)("2025-12-31"),m=(0,i.pp)(e.startFiscalYear)>(0,i.pp)("2024-03-27"),f=(l.salariesDomestic||0)+(n&&l.salariesAbroad||0)+(l.socialSecurityContributions||0);s.internal.staffCost+="external"===l.internalOrExternal?0:f,s.internal.staffCostBeforeMarch28th2024+="external"===l.internalOrExternal?0:(l.salariesDomesticBeforeMarch28th2024||0)+(n&&l.salariesAbroadBeforeMarch28th2024||0)+(l.socialSecurityContributionsBeforeMarch28th2024||0),s.internal.staffCostAfterMarch27th2024+="external"===l.internalOrExternal?0:(l.salariesDomesticAfterMarch27th2024||0)+(n&&l.salariesAbroadAfterMarch27th2024||0)+(l.socialSecurityContributionsAfterMarch27th2024||0),"2024"===r&&m&&(s.internal.staffCostAfterMarch27th2024=s.internal.staffCost);let x=l.additionalFunding.reduce((e,t)=>e+(t?.hasUsedFundingTowardsProjectsRnDCosts&&t?.fundingAssessmentBasisInternal?t?.fundingAssessmentBasisInternal:0),0);if(s.internal.otherFunding+=l.hasOtherFunding?x:0,parseInt(r)>=2026&&u&&"external"!==l.internalOrExternal){let e=l.hasOtherFunding?Math.max(f-x,0):f;s.overhead.staffCostApplicableForOverhead+=e}let p=l.externalContractors.reduce((e,t)=>e+(t?.paidInvoices||0),0);s.external.externalContractorCost+="internal"===l.internalOrExternal?0:p,s.external.externalContractorCostBeforeMarch28th2024+="internal"===l.internalOrExternal?0:l.externalContractors.reduce((e,t)=>e+(t?.paidInvoicesBeforeMarch28th2024||0),0),o?(s.external.externalContractorCostAfterMarch27th2024NewShare+="internal"===l.internalOrExternal?0:l.externalContractors.reduce((e,t)=>e+(t?.paidInvoicesAfterMarch27th2024||0),0),"2024"===r&&m&&(s.external.externalContractorCostAfterMarch27th2024NewShare=s.external.externalContractorCost),parseInt(r)>2024&&(s.external.externalContractorCostAfterMarch27th2024NewShare+="internal"===l.internalOrExternal?0:p)):(s.external.externalContractorCostAfterMarch27th2024OldShare+="internal"===l.internalOrExternal?0:l.externalContractors.reduce((e,t)=>e+(t?.paidInvoicesAfterMarch27th2024||0),0),"2024"===r&&m&&(s.external.externalContractorCostAfterMarch27th2024OldShare=s.external.externalContractorCost),parseInt(r)>2024&&(s.external.externalContractorCostAfterMarch27th2024OldShare+="internal"===l.internalOrExternal?0:p));let g=l.additionalFunding.reduce((e,t)=>e+h(t),0);if(s.external.otherFunding+=l.hasOtherFunding?g:0,o?c+=l.hasOtherFunding?g:0:d+=l.hasOtherFunding?g:0,parseInt(r)>=2026&&u&&"internal"!==l.internalOrExternal){let e=l.hasOtherFunding?Math.max(p-g,0):p;s.overhead.contractorCostApplicableForOverhead+=e}("number"!=typeof l.salariesDomestic||"number"!=typeof l.socialSecurityContributions||n&&"number"!=typeof l.salariesAbroad||"internal"!==l.internalOrExternal&&(0===l.externalContractors.length||l.externalContractors.some(e=>"number"!=typeof e.paidInvoices))||l.hasOtherFunding&&(0===l.additionalFunding.length||l.additionalFunding.some(e=>e.fundingStatus===a.gf.Approved&&e.hasUsedFundingTowardsProjectsRnDCosts&&("number"!=typeof e.fundingAssessmentBasisInternal||"object"!=typeof e.fundingAssessmentBasisExternal))))&&(t=!0)});let u=e.isSME?l.FH:l.vT;2024>parseInt(r)?(s.internal.staffCostBeforeMarch28th2024=s.internal.staffCost,s.external.externalContractorCostBeforeMarch28th2024=s.external.externalContractorCost):parseInt(r)>2024&&(s.internal.staffCostAfterMarch27th2024=s.internal.staffCost);let m=2025>=parseInt(r)?l.Y2:l.EB,f=s.internal.otherFunding,x=Math.max(0,f-s.internal.staffCostBeforeMarch28th2024),p=Math.max(0,s.internal.staffCostBeforeMarch28th2024-f),g=Math.max(0,s.internal.staffCostAfterMarch27th2024-x),y=Math.min(l.eT,p),j=Math.min(Math.max(0,m-y),g),b=l.vT*y;s.internal.funding=b+u*j;let v=0;if(parseInt(r)>=2026){let e=(v=Math.min(s.overhead.staffCostApplicableForOverhead*l.YQ,m-j))*u;s.internal.funding+=e}let k=Math.max(0,d-s.external.externalContractorCostBeforeMarch28th2024),N=Math.max(0,s.external.externalContractorCostBeforeMarch28th2024-d),w=Math.max(0,s.external.externalContractorCostAfterMarch27th2024OldShare-k),C=Math.max(0,s.external.externalContractorCostAfterMarch27th2024NewShare-c),M=Math.min(Math.max(0,l.eT-y),N*l.s1),I=Math.min(Math.max(0,m-(y+j+M+v)),w*l.s1+C*l.K4),A=l.vT*M;if(s.external.funding=A+u*I,parseInt(r)>=2026){let e=m-(j+v+I),t=Math.min(s.overhead.contractorCostApplicableForOverhead*l.K4*l.YQ,e);s.external.funding+=t*u}s.funding=s.internal.funding+s.external.funding;let S=p+N*l.s1,D=S>l.eT,_=g+(w*l.s1+C*l.K4)*u;return{actualFunding:s,maxAssessmentBasis:2024>parseInt(r)?l.eT:m,hasOverCostLimit:D||S+_>m,isDataMissing:t}}function h(e){return e.fundingStatus===a.gf.Approved&&e.hasUsedFundingTowardsProjectsRnDCosts&&"object"==typeof e.fundingAssessmentBasisExternal?Object.values(e.fundingAssessmentBasisExternal).reduce((e,t)=>
1e+t,0):0}function m(e,t,r){return"number"==typeof e?.fundingAmount?e.fundingAmount:e?d(e.data,t,r).actualFunding.funding:c(t,r).expectedFunding.funding}},75639:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/home",function(){return r(31208)}])},77005:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var a=r(26514),n=r(97700);let i=r(75834).forwardRef((e,t)=>{let{className:r="",children:i,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("bypass-rounded-child rounded-xl bg-white outline-1 outline-tertiary-200 dark:bg-night-900 dark:outline-night-700",r),...s,children:i})})},85275:(e,t,r)=>{"use strict";function a(e=[],t,r){let n=e.filter(e=>t&&r?e.from===t&&e.to===r:t?e.from===t:!r||e.to===r);return 0===n.length?null:n[n.length-1]}r.d(t,{e:()=>a})},89980:(e,t,r)=>{"use strict";r.d(t,{L:()=>o});var a=r(47578),n=r(33208),i=r(4992),s=r(25203),l=r(75834);function o(e,...t){let{trackError:r}=(0,n.j)(),{authUser:d,loading:c}=(0,s.ZY)(),[u,h]=(0,l.useState)({status:a.n.Idle,data:null});async function m(e){h({data:null,status:a.n.Loading});try{let t=await (0,i.YE)(e);h({data:t,status:a.n.Success})}catch(e){r("Error loading Firestore document",e),h({data:null,status:a.n.Error})}}let f="string"==typeof e?[e,...t].join("/"):null;return(0,l.useEffect)(()=>{c?u.status!==a.n.Loading&&h({status:a.n.Loading,data:null}):d?"string"==typeof f?m(f):null===f&&h({data:null,status:a.n.Idle}):h({status:a.n.LoggedOut,data:null})},[f,c,d]),u}},98984:(e,t,r)=>{"use strict";r.d(t,{G:()=>b});var a=r(26514),n=r(85275),i=r(8584),s=r(99869),l=r(19763),o=r(14898),d=r(75241),c=r(77005),u=r(6464),h=r(79230),m=r(52357),f=r(20514),x=r(75834);function p({showModal:e,setShowModal:t,fundingLabel:r,projectId:n}){let[i,s]=(0,x.useState)(()=>g(r));return(0,x.useEffect)(()=>{e&&s(g(r))},[e,r]),(0,a.jsx)(h.a,{title:"Auf LinkedIn teilen",explanation:"Teile euren Erfolg auf LinkedIn.",showModal:e,setShowModal:t,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(m.f,{value:i,onChange:e=>s(e.target.value)}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(d.tB.Primary,{event:null,onClick:function(){let e;window.open((e=encodeURIComponent(i).replace(/%26/g,"%2526").replace(/%0A/g,"%250A"),`https://www.linkedin.com/feed/?shareActive=true&text=${e}`),"_blank","noopener,noreferrer"),(0,f.HZ)({kind:"linkedin_share_redirect_started",data:{projectId:n}}),t(!1)},trailingIcon:u.$.ExternalLink,children:"Zu LinkedIn"})})]})})}function g(e){return`Eine Nachricht, die mich heute besonders gefreut hat: Unser F\xf6rderantrag f\xfcr die Forschungszulage wurde genehmigt. Uns wurden ${e} zugesprochen. 2 3Wir hatten das ehrlich gesagt lange vor uns hergeschoben. Forschungszulage klang nach viel Papierkram, der sich kaum lohnt. 4 5Coup hat uns vom Gegenteil \xfcberzeugt. 6 7Wenn ihr R&D-Kosten habt, es lohnt sich! Ich stelle gerne einen direkten Kontakt her. 8 9https://www.getcouped.com/ @Coup `}var y=r(24222),j=r(97700);function b({project:e,className:t,buttonVariant:r=d.Ak.Primary}){let[h,m]=(0,x.useState)(!1),g=(0,n.e)(e.statusHistory,void 0,i.X.ApprovedBSFZ)?.createdAt,v=!!g&&new Date().getTime()-g.toMillis()<=2592e6;if(e.status!==i.X.ApprovedBSFZ||!v)return null;let k=(0,s.v)((0,l.Ar)(e.data).funding),N=d.tB[r];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.Z,{className:(0,j.cn)("relative flex flex-row items-center justify-between gap-1 rounded-xl! bg-white p-4 pl-20 max-sm:flex-col max-sm:items-stretch max-sm:gap-4",t),children:[(0,a.jsx)("div",{className:"absolute top-0 left-0 min-h-24 w-20 overflow-hidden rounded-xl",children:(0,a.jsx)("img",{src:"/coup_trophy.svg",alt:"Coup Trophy",className:"absolute -top-2 left-0 size-26 max-w-none mask-[linear-gradient(to_right,rgb(0_0_0/0.72),transparent_77%)]"})}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(y.E,{className:"text-lg font-medium text-tertiary-900",children:"Gl\xfcckwunsch!"}),(0,a.jsx)(y.E,{className:"text-sm font-normal text-tertiary-700",children:"Eure F\xf6rderung wurde genehmigt. Teile euren Erfolg auf LinkedIn und inspiriere andere Gr\xfcnder:innen."})]}),(0,a.jsx)(N,{className:"shrink-0 cursor-[url(/champagne.png),pointer]",event:null,leadingIcon:u.$.Linkedin,onClick:t=>{var r;r=t,(0,o.A)({particleCount:150,spread:75,startVelocity:35,ticks:200,origin:{x:r.clientX/window.innerWidth,y:r.clientY/window.innerHeight}}
9),(0,f.HZ)({kind:"linkedin_share_modal_opened",data:{projectId:e.id}}),m(!0)},children:"Auf LinkedIn teilen"})]}),(0,a.jsx)(p,{showModal:h,setShowModal:m,fundingLabel:k,projectId:e.id})]})}},99683:(e,t,r)=>{"use strict";r.d(t,{$j:()=>o,Nz:()=>s,WA:()=>l,th:()=>d});var a,n,i,s=((a=s||{}).Incomplete="incomplete",a.IncompleteExpired="incomplete_expired",a.Trialing="trialing",a.Active="active",a.PastDue="past_due",a.Canceled="canceled",a.Unpaid="unpaid",a),l=((n=l||{}).ChargeAutomatically="charge_automatically",n.SendInvoice="send_invoice",n),o=((i=o||{}).Unknown="unknown",i.NoSubscription="no_subscription",i.PaymentInvoice="payment_invoice",i.PaymentCard="payment_card",i.PaymentSepa="payment_sepa",i.PaymentCardAutomatic="payment_card_automatic",i.PaymentSepaAutomatic="payment_sepa_automatic",i);function d(e){if(!e.stripeCustomerId||!e.stripeSubscription)return"no_subscription";if("incomplete_expired"===e.stripeSubscription.status)return"unknown";if("charge_automatically"===e.stripeSubscription.collectionMethod)if("card"===e.stripeSubscription.paymentMethodType)return"payment_card_automatic";else if("sepa_debit"===e.stripeSubscription.paymentMethodType)return"payment_sepa_automatic";else return"unknown";return"card"===e.stripeSubscription.paymentMethodType?"payment_card":"sepa_debit"===e.stripeSubscription.paymentMethodType?"payment_sepa":"payment_invoice"}}},e=>{e.O(0,[7061,1126,6412,6361,6031,5551,4284,5919,9714,6934,9774,4898,6126,7153,543,8505,6165,6777,6987,1299,8609,5451,636,6593,8792],()=>e(e.s=75639)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.