1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[70199],{14285:(e,a,l)=>{l.d(a,{A:()=>t});let t=(0,l(55129).A)("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]])},42516:(e,a,l)=>{l.d(a,{A:()=>t});let t=(0,l(55129).A)("FileCheck",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]])},70199:(e,a,l)=>{l.r(a),l.d(a,{SickLeaveTab:()=>b,default:()=>_});var t=l(95155),s=l(12115),r=l(6132),n=l(14285),i=l(35299),o=l(42516),c=l(65229),d=l(18085),u=l(93499),p=l(44954),m=l(18720),h=l(21745),v=l(47288),x=l(77855);let y={pending:{accent:"amber",labelKey:"absence_status_pending",labelDe:"Eingereicht"},approved:{accent:"emerald",labelKey:"absence_status_approved",labelDe:"Genehmigt"},rejected:{accent:"rose",labelKey:"absence_status_rejected",labelDe:"Abgelehnt"},cancelled:{accent:"slate",labelKey:"absence_status_cancelled",labelDe:"Storniert"},draft:{accent:"slate",labelKey:"absence_status_draft",labelDe:"Entwurf"}},g="w-full h-12 px-3 rounded-2xl text-base outline-none focus:ring-2 focus:ring-emerald-400/40";function b(e){let{token:a}=e,{t:l}=(0,p.Bd)(),b=(0,x.v)(a),_=(0,s.useRef)(null),[f,k]=(0,s.useState)(""),[j,w]=(0,s.useState)(""),[N,C]=(0,s.useState)(""),[R,A]=(0,s.useState)(null),[D,K]=(0,s.useState)(null),[S,q]=(0,s.useState)(!1),[E,M]=(0,s.useState)(!1),[B,z]=(0,s.useState)([]),[F,L]=(0,s.useState)(!1),P=async()=>{L(!0);try{z(await b.getSickLeaveHistory())}catch(l){var e,a;m.oR.error((null==l||null==(a=l.response)||null==(e=a.data)?void 0:e.Error)||(null==l?void 0:l.message))}finally{L(!1)}};(0,s.useEffect)(()=>{a&&P()},[a]);let U=async e=>{var t,s,r,n,i,o,c;let d=null==(t=e.target.files)?void 0:t[0];if(!d)return;if(d.size>0xa00000)return void m.oR.error(l("portal_sick_leave_file_too_large")||"Datei zu gro\xdf (max. 10 MB)");q(!0);let u=new FormData;u.append("file",d);try{let e=await h.api.post("/portal/sick-leave/attachment",u,{headers:{Authorization:`Bearer ${a}`,"Content-Type":"multipart/form-data"}});(null==(s=e.data)?void 0:s.Status)&&(null==(n=e.data)||null==(r=n.Result)?void 0:r.url)?(A(e.data.Result.url),K(d.name),m.oR.success(l("portal_sick_leave_file_uploaded")||"Krankenschein hochgeladen")):m.oR.error((null==(i=e.data)?void 0:i.Error)||"Upload fehlgeschlagen")}catch(e){m.oR.error((null==e||null==(c=e.response)||null==(o=c.data)?void 0:o.Error)||(null==e?void 0:e.message))}finally{q(!1),_.current&&(_.current.value="")}},$=async()=>{if(!f||!j)return void m.oR.error(l("portal_sick_leave_form_dates_required")||"Von- und Bis-Datum sind Pflicht");M(!0);try{await b.submitSickLeave({start_date:f,end_date:j,reason:N.trim()||void 0,attachment_url:R}),m.oR.success(l("portal_sick_leave_submitted")||"Krankmeldung eingereicht"),k(""),w(""),C(""),A(null),K(null),await P()}catch(l){var e,a;m.oR.error((null==l||null==(a=l.response)||null==(e=a.data)?void 0:e.Error)||(null==l?void 0:l.message))}finally{M(!1)}};return(0,t.jsxs)("div",{className:"px-4 pt-2 pb-4 space-y-5",children:[(0,t.jsxs)("header",{className:"flex items-start justify-between",children:[(0,t.jsx)("div",{children:(0,t.jsx)("h1",{className:"text-2xl font-bold",style:{color:v.fg},children:l("portal_sick_leave_title")||"Krankmeldung"})}),(0,t.jsx)("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center",style:(0,v.Kj)("rose",!0),children:(0,t.jsx)(r.A,{className:"w-4 h-4"})})]}),(0,t.jsxs)("div",{className:"p-4 rounded-3xl space-y-4",style:(0,v.vf)("default"),children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:v.Nq},children:l("portal_sick_leave_form_from")||"Von"}),(0,t.jsx)("input",{type:"date",value:f,onChange:e=>k(e.target.value),className:g,style:{background:"rgba(255,255,255,0.65)",color:v.fg,border:"1px solid rgba(200,210,240,0.4)"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:v.Nq},children:l("portal_sick_leave_form_to")||"Bis"}),(0,t.jsx)("input",{type:"date",value:j,onChange:e=>w(e.target.value),className:g,style:{background:"rgba(255,255,255,0.65)",color:v.fg,border:"1px solid rgba(200,210,240,0.4)"}})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:v.Nq},children:l("portal_sick_leave_form_reason")||"Grund (optional)"}),(0,t.jsx)("textarea",{value:N,onChange:e=>C(e.target.value),rows:2,className:"w-full px-3 py-2 rounded-2xl text-base outline-none focus:ring-2 focus:ring-emerald-400/40 resize-none",style:{background:"rgba(255,255,255,0.65)",color:v.fg,border:"1px solid rgba(200,210,240,0.4)"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1.5 flex items-center gap-1.5",style:{color:v.Nq},children:[(0,t.jsx)(n.A,{className:"w-3 h-3"}),l("portal_sick_leave_attachment")||"Krankenschein (optional)"]}),(0,t.jsx)("input",{ref:_,type:"file",className:"hidden",accept:".pdf,image/jpeg,image/png,image/heic,image/webp",capture:"environment",onChange:U}),R?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 h-12 rounded-2xl",style:{background:"rgba(22,163,74,0.10)",border:"1px solid rgba(22,163,74,0.25)"},children:[(0,t.jsx)(o.A,{className:"w-4 h-4 shrink-0",style:{color:"#16a34a"}}
1),(0,t.jsx)("span",{className:"flex-1 text-sm truncate",style:{color:v.fg},children:D||"Datei angeh\xe4ngt"}),(0,t.jsx)("button",{type:"button",onClick:()=>{A(null),K(null)},className:"w-7 h-7 rounded-full flex items-center justify-center",style:{background:"rgba(255,255,255,0.5)"},children:(0,t.jsx)(c.A,{className:"w-4 h-4",style:{color:v._U}})})]}):(0,t.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=_.current)?void 0:e.click()},disabled:S,className:"w-full h-12 rounded-2xl flex items-center justify-center gap-2 text-sm font-medium transition-all active:scale-[0.99] disabled:opacity-60",style:{...(0,v.vf)("soft"),borderStyle:"dashed",color:v.fg},children:S?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),l("portal_sick_leave_uploading")||"Wird hochgeladenâ¦"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),l("portal_sick_leave_upload_click")||"Foto/PDF ausw\xe4hlen"]})}),(0,t.jsx)("p",{className:"text-[11px] mt-1",style:{color:v.Nq},children:l("portal_sick_leave_attachment_formats")||"PDF, JPG, PNG (max. 10 MB)"})]}),(0,t.jsxs)("button",{onClick:$,disabled:E,className:"w-full h-14 rounded-2xl flex items-center justify-center gap-2 text-base font-semibold text-white transition-all active:scale-[0.99] disabled:opacity-60",style:{background:"#e11d48",boxShadow:"0 4px 14px rgba(225,29,72,0.30)"},children:[(0,t.jsx)(d.A,{className:"w-5 h-5"}),E?l("global_sending")||"Wird gesendetâ¦":l("portal_sick_leave_submit")||"Krankmeldung einreichen"]})]}),(0,t.jsxs)("section",{className:"space-y-2.5",children:[(0,t.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider px-1",style:{color:v.Nq},children:l("portal_sick_leave_history")||"Bisherige Krankmeldungen"}),F&&0===B.length?(0,t.jsx)("div",{className:"text-center py-8 rounded-3xl text-sm",style:{...(0,v.vf)("soft"),color:v._U},children:l("global_loading")||"Ladeâ¦"}):0===B.length?(0,t.jsxs)("div",{className:"text-center py-12 rounded-3xl",style:(0,v.vf)("soft"),children:[(0,t.jsx)("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mx-auto mb-3",style:(0,v.Kj)("rose"),children:(0,t.jsx)(r.A,{className:"w-6 h-6"})}),(0,t.jsx)("p",{className:"text-sm font-semibold",style:{color:v.fg},children:l("portal_sick_leave_no_history")||"Keine Krankmeldungen"})]}):(0,t.jsx)("div",{className:"rounded-3xl overflow-hidden",style:(0,v.vf)("default"),children:(0,t.jsx)("div",{className:"divide-y",style:{borderColor:"rgba(200,210,240,0.18)"},children:B.map(e=>{let a=y[e.status]||{accent:"slate",labelKey:"",labelDe:e.status};return(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:"text-sm font-semibold flex items-center gap-1.5",style:{color:v.fg},children:[new Date(e.start_date).toLocaleDateString("de-DE")," â ",new Date(e.end_date).toLocaleDateString("de-DE"),e.attachment_url&&(0,t.jsxs)("a",{href:e.attachment_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5",style:{color:"#16a34a"},title:l("portal_sick_leave_view_attachment")||"Krankenschein anzeigen",children:[(0,t.jsx)(n.A,{className:"w-3 h-3"}),(0,t.jsx)(u.A,{className:"w-2.5 h-2.5"})]})]}),e.reason&&(0,t.jsx)("p",{className:"text-xs mt-0.5",style:{color:v._U},children:e.reason}),e.approver_notes&&(0,t.jsxs)("p",{className:"text-xs mt-1 italic",style:{color:v.Nq},children:[l("portal_absence_approver_note")||"Anmerkung",": ",e.approver_notes]})]}),(0,t.jsx)("span",{className:"text-[11px] font-semibold px-2.5 py-1 rounded-full shrink-0",style:(0,v.Io)(a.accent),children:a.labelKey&&l(a.labelKey)||a.labelDe})]})},e.request_id)})})})]})]})}let _=b},77855:(e,a,l)=>{l.d(a,{v:()=>r});var t=l(12115),s=l(21745);function r(e){let a=(0,t.useMemo)(()=>e?{Authorization:`Bearer ${e}`}:void 0,[e]),l=(0,t.useCallback)(async()=>{var l;return e?(null==(l=(await s.api.get("/portal/time-tracking/today",{headers:a})).data)?void 0:l.Result)??null:null},[e]),r=(0,t.useCallback)(async e=>{var l;let t="string"==typeof e?{notes:e||null}:{notes:(null==e?void 0:e.notes)??null,construction_site_id:(null==e?void 0:e.construction_site_id)??null};return null==(l=(await s.api.post("/portal/time-tracking/clock-in",t,{headers:a})).data)?void 0:l.Result},[e]),n=(0,t.useCallback)(async e=>{var l;let t="string"==typeof e?{notes:e||null}:{notes:(null==e?void 0:e.notes)??null,daily_summary:(null==e?void 0:e.daily_summary)??null,daily_summary_voice:(null==e?void 0:e.daily_summary_voice)??null,hours_reported:(null==e?void 0:e.hours_reported)??null,construction_site_id:(null==e?void 0:e.construction_site_id)??null};return null==(l=(await s.api.put("/portal/time-tracking/clock-out",t,{headers:a})).data)?void 0:l.Result},[e]),i=(0,t.useCallback)(async()=>{var l,t;if(!e)return[];try{return(null==(l=(await s.api.get("/portal/construction/assigned-sites-today",{headers:a})).data)?void 0:l.Result)??[]}catch(e){if((null==e||null==(t=e.response)?void 0:t.status)===404)return[];throw e}},[e]),o=(0,t.useCallback)(async(e,l)=>{var t;return null==(t=(await s.api.post(`/portal/construction/sites/${encodeURIComponent(e)}/events`,l,{headers:a})).data)?void 0:t.Result},[e]),c=(0,t.useCallback)(async a=>{var l,t;if(!e)return null;let r=new FormData;r.append("audio",a,"voice.webm");try{return(null==(l=(await s.api.post("/portal/voice/transcribe",r,{headers:{Authorization:`Bearer ${e}`,"Content-Type":"multipart/form-data"}})).data)?void 0:l.Result)??null}catch(e){if((null==e||null==(t=e.response)?void 0:t.status)===404)return null;throw e}},[e]),d=(0,t.useCallback)(async function(){var e;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30;return(null==(e=(await s.api.get(`/portal/time-tracking/history?days=${l}`,{headers:a})).data)?void 0:e.Result)??{entries:[],total_minutes:0,total_hours:0}},[e]),u=(0,t.useCallback)(async()=>{var e;return(null==(e=(await s.api.get("/portal/absence/types",{headers:a})).data)?void 0:e.Result)??[]},[e]),p=(0,t.useCallback)(async e=>{var l;return null==(l=(await s.api.post("/portal/sick-leave",e,{headers:a})).data)?void 0:l.Result},[e]),m=(0,t.useCallback)(async()=>{var e;return(null==(e=(await s.api.get("/portal/sick-leave/history",{headers:a})).data)?void 0:e.Result)??[]},[e]),h=(0,t.useCallback)(async e=>{var l;return null==(l=(await s.api.post("/portal/vacation-request",e,{headers:a})).data)?void 0:l.Result},[e]),v=(0,t.useCallback)(async()=>{var e;return(null==(e=(await s.api.get("/portal/vacation-request/history",{headers:a})).data)?void 0:e.Result)??[]},[e]);return(0,t.useMemo)(()=>({getToday:l,clockIn:r,clockOut:n,getHistory:d,getAbsenceTypes:u,submitSickLeave:p,getSickLeaveHistory:m,submitVacationRequest:h,getVacationHistory:v,getAssignedSitesToday:i,logDailyEvent:o,transcribeVoice:c}),[l,r,n,d,u,p,m,h,v,i,o,c])}},93499:(e,a,l)=>{l.d(a,{A:()=>t});
1let t=(0,l(55129).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])}}]);
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.