1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3449],{33449:(e,r,t)=>{t.r(r),t.d(r,{default:()=>N});var a=t(95155),l=t(12115),o=t(65229),i=t(87133),s=t(33789),n=t(90235),d=t(47507),c=t(806),u=t(69048),m=t(34530),p=t(44193),f=t(18720),x=t(40099);let g=[{value:"male",label:"Male"},{value:"female",label:"Female"},{value:"other",label:"Other"}],h=[{value:"18-25",label:"18-25"},{value:"26-30",label:"26-30"},{value:"31-35",label:"31-35"},{value:"36-40",label:"36-40"},{value:"41-45",label:"41-45"},{value:"46-50",label:"46-50"},{value:"51-55",label:"51-55"},{value:"55+",label:"55+"}];function N(e){let{data:r}=e,t=null!==r&&"object"==typeof r&&"profile"in r&&"contact"in r?r:void 0,N=null==t?void 0:t.profile,v=null==t?void 0:t.contact,y=null==t?void 0:t.updateCandidate,b=null==t?void 0:t.updateProfilePicture,j=null==t?void 0:t.updateProfilePictureError,C=null==t?void 0:t.refetchCandidateDetails,w=null==r?void 0:r.showLoading,[k,P]=(0,l.useState)({firstName:(null==N?void 0:N.firstName)||"",middleName:(null==N?void 0:N.middleName)||"",lastName:(null==N?void 0:N.lastName)||"",gender:(null==N?void 0:N.gender)||"",ageBracket:(null==N?void 0:N.ageRange)||"",companyName:(null==N?void 0:N.currentCompany)||"",role:(null==N?void 0:N.currentRole)||"",email:(null==v?void 0:v.email)||"",contactNo:(null==v?void 0:v.phone)||"",countryCode:(null==v?void 0:v.country_code)||"",linkedinProfile:(null==v?void 0:v.linkedin)||"",location:(null==v?void 0:v.location)||"",profilePicture:(null==N?void 0:N.avatarUrl)||""}),[E,S]=(0,l.useState)("");l.useEffect(()=>{if(null==v?void 0:v.phone){let{countryCode:e}=(0,c.xp)(v.phone);S(e)}},[null==v?void 0:v.phone]);let{countryCode:L,detectCountry:I}=(0,x.h)();l.useEffect(()=>{k.location&&k.location.trim()&&!k.contactNo&&I(k.location)},[]),l.useEffect(()=>{L&&!E&&S("+".concat(L))},[L,E]);let[F,M]=(0,l.useState)({}),[T,_]=(0,l.useState)(!1),[G,R]=(0,l.useState)(null),[B,A]=(0,l.useState)(!1),[V,D]=(0,l.useState)(""),U=(0,l.useRef)(null),O=(null==v?void 0:v.email)||"",X=(e,r)=>{P(t=>({...t,[e]:r})),F[e]&&M(r=>({...r,[e]:""}))},z=()=>{if(U.current&&1){let e=U.current.querySelector('[data-error="true"]');e&&e.scrollIntoView&&e.scrollIntoView({behavior:"smooth",block:"center"})}},H=async()=>{if(_(!0),!(()=>{try{c.Bc.parse(k);let e={};if(k.contactNo&&k.contactNo.trim()&&!E&&(e.countryCode="Please select a country code for the phone number"),F.contactNo&&(e.contactNo=F.contactNo),G){let e=(0,u.nJ)(G,["IMAGES"]);if(!e.isValid)return D(e.errorMessage||"Invalid file"),!1}if(V)return!1;if(Object.keys(e).length>0)return M(e),!1;return M({}),!0}catch(e){if(e instanceof p.G){let r={};e.errors.forEach(e=>{r[e.path[0]]=e.message}),M(r)}return!1}})()){_(!1),setTimeout(z,100);return}if(!y){M({general:"Update function not available. Please try again."}),_(!1);return}null==w||w(!0,"Updating profile...");try{var e;if(B&&G&&b)try{null==w||w(!0,"Updating profile..."),await b(G)}catch(r){let e=r instanceof Error?r.message:"Failed to upload profile picture";f.oR.error("Profile Picture Upload Failed",{description:e}),M({general:"Failed to upload profile picture. Please try again."}),_(!1),null==w||w(!1);return}let t={};k.firstName!==(null==N?void 0:N.firstName)&&(t.first_name=k.firstName),k.middleName!==(null==N?void 0:N.middleName)&&(t.middle_name=k.middleName||""),k.lastName!==(null==N?void 0:N.lastName)&&(t.last_name=k.lastName),k.email!==(null==v?void 0:v.email)&&k.email&&""!==k.email.trim()&&(t.email=k.email),k.contactNo!==(null==v?void 0:v.phone)&&(E&&""!==E.trim()&&k.contactNo&&""!==k.contactNo.trim()?(t.phone_number=(0,c.lD)(k.contactNo||"",E),t.country_code=E):k.contactNo&&""!==k.contactNo.trim()||(t.phone_number="",t.country_code="")),k.role!==(null==N?void 0:N.currentRole)&&(t.current_title=k.role||""),k.companyName!==(null==N?void 0:N.currentCompany)&&(t.current_organisation=k.companyName||""),k.location!==(null==v?void 0:v.location)&&(t.location=k.location||""),k.gender!==(null==N?void 0:N.gender)&&""!==k.gender&&(t.gender=k.gender||""),k.ageBracket!==(null==N?void 0:N.ageRange)&&""!==k.ageBracket&&(t.age_range=k.ageBracket||""),Object.keys(t).length>0&&(await y(t),C&&await C()),f.oR.success("Profile Updated",{description:"Profile has been updated successfully"}),null==w||w(!1),null==r||null==(e=r.closeModal)||e.call(r)}catch(r){let e=r instanceof Error?r.message:"Failed to update profile";f.oR.error("Update Failed",{description:e}),M({general:"Failed to update profile. Please try again."}),null==w||w(!1)}finally{_(!1)}},q=()=>{var e;null==r||null==(e=r.closeModal)||e.call(r)};return N&&v?(0,a.jsxs)("div",{className:"h-full flex flex-col relative",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between py-3 bg-white px-3",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-card-foreground","data-testid":"edit-profile-title",children:"Edit Profile"}),(0,a.jsx)("button",{onClick:q,className:"p-2 rounded-lg cursor-pointer","data-testid":"close-edit-profile-modal",children:(0,a.jsx)(o.A,{className:"h-4 w-4 text-icon-primary"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto py-3 px-3",children:(0,a.jsxs)("div",{ref:U,className:"space-y-6 px-0",children:[F.general&&(0,a.jsx)("div",{className:"p-3 bg-error-bg border border-error-solid rounded-lg",children:(0,a.jsx)("p",{className:"text-sm text-error-solid",children:F.general})}),j&&(0,a.jsx)("div",{className:"p-3 bg-error-bg border border-error-solid rounded-lg",children:(0,a.jsxs)("p",{className:"text-sm text-error-solid",children:["Profile Picture Error: ",j]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(n.Label,{className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"profile-picture-label",children:"Profile Picture"}),(0,a.jsx)("div",{className:"flex items-center gap-4",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"w-16 h-16 bg-gray-200 rounded-full flex items-center justify-center text-black font-bold text-lg overflow-hidden","data-testid":"profile-picture-display",children:k.profilePicture?(0,a.jsx)("img",{src:k.profilePicture,alt:"Profile",className:"w-full h-full object-cover"}):(null==N?void 0:N.avatarUrl)?(0,a.jsx)("img",{src:N.avatarUrl,alt:"Profile",className:"w-full h-full object-cover"}):(0,a.jsx)("span",{"data-testid":"profile-initials",children:N.initials})}),(0,a.jsx)("div",{className:"absolute -bottom-1 -right-1 w-8 h-8 bg-white rounded-full shadow-sm border border-gray-200 cursor-pointer flex items-center justify-center",onClick:()=>{var e;
1return null==(e=document.getElementById("profile-picture-input"))?void 0:e.click()},"data-testid":"edit-profile-picture-button",children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-text-primary",children:(0,a.jsx)("path",{d:"M11.333 2.00006C11.5081 1.82494 11.7169 1.68605 11.9457 1.59129C12.1745 1.49653 12.4187 1.44775 12.6663 1.44775C12.914 1.44775 13.1582 1.49653 13.387 1.59129C13.6158 1.68605 13.8246 1.82494 13.9997 2.00006C14.1748 2.17517 14.3137 2.384 14.4084 2.61281C14.5032 2.84162 14.552 3.08577 14.552 3.33339C14.552 3.58101 14.5032 3.82516 14.4084 4.05397C14.3137 4.28278 14.1748 4.49161 13.9997 4.66673L4.99967 13.6667L1.33301 14.6667L2.33301 11.0001L11.333 2.00006Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),(0,a.jsx)("input",{id:"profile-picture-input",type:"file",accept:u.YP.IMAGES,onChange:e=>{var r;let t=null==(r=e.target.files)?void 0:r[0];if(D(""),t){let r=(0,u.nJ)(t,["IMAGES"]);if(!r.isValid){e.target&&(e.target.value=""),f.oR.error("Invalid File",{description:r.errorMessage}),D(r.errorMessage||"Invalid file");return}R(t),A(!0);let a=new FileReader;a.onload=e=>{var r;X("profilePicture",null==(r=e.target)?void 0:r.result)},a.readAsDataURL(t)}},className:"hidden","data-testid":"profile-picture-input"})]}),V&&(0,a.jsx)("p",{className:"text-xs text-error-solid mt-1","data-testid":"profile-picture-error",children:V}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.firstName,children:[(0,a.jsx)(n.Label,{htmlFor:"firstName",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"firstName-label",children:"First Name *"}),(0,a.jsx)(s.Input,{id:"firstName",value:k.firstName,onChange:e=>X("firstName",e.target.value),placeholder:"Enter Here",className:"text-body bg-white border-radius-md p-2.5 ".concat(F.firstName?"border-error-solid focus:ring-error":"border-[var(--color-stroke-light)]"),style:{padding:"10px"},"data-testid":"firstName-input"}),F.firstName&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"firstName-error",children:F.firstName})]}),(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.middleName,children:[(0,a.jsx)(n.Label,{htmlFor:"middleName",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"middleName-label",children:"Middle Name"}),(0,a.jsx)(s.Input,{id:"middleName",value:k.middleName,onChange:e=>X("middleName",e.target.value),placeholder:"Enter Here",className:"text-body bg-white border-radius-md p-2.5 ".concat(F.middleName?"border-error-solid focus:ring-error":"border-[var(--color-stroke-light)]"),style:{padding:"10px"},"data-testid":"middleName-input"}),F.middleName&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"middleName-error",children:F.middleName})]}),(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.lastName,children:[(0,a.jsx)(n.Label,{htmlFor:"lastName",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"lastName-label",children:"Last Name *"}),(0,a.jsx)(s.Input,{id:"lastName",value:k.lastName,onChange:e=>X("lastName",e.target.value),placeholder:"Enter Here",className:"text-body bg-white border-radius-md p-2.5 ".concat(F.lastName?"border-error-solid focus:ring-error":"border-[var(--color-stroke-light)]"),style:{padding:"10px"},"data-testid":"lastName-input"}),F.lastName&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"lastName-error",children:F.lastName})]}),(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.gender,children:[(0,a.jsx)(n.Label,{htmlFor:"gender",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"gender-label",children:"Gender"}),(0,a.jsxs)(d.Select,{value:k.gender||"",onValueChange:e=>X("gender",e),children:[(0,a.jsx)(d.SelectTrigger,{className:"text-body bg-white border-radius-md p-2.5 w-full ".concat(F.gender?"border-error-solid focus:ring-error":"border-[var(--color-stroke-light)]"),style:{padding:"10px"},"data-testid":"gender-select",children:(0,a.jsx)(d.SelectValue,{placeholder:"Select"})}),(0,a.jsx)(d.SelectContent,{className:"z-[9999]",children:g.map(e=>(0,a.jsx)(d.SelectItem,{value:e.value,children:e.label},e.value))})]}),F.gender&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"gender-error",children:F.gender})]}),(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.ageBracket,children:[(0,a.jsx)(n.Label,{htmlFor:"ageBracket",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"age-bracket-label",children:"Age Bracket"}),(0,a.jsxs)(d.Select,{value:k.ageBracket||"",onValueChange:e=>X("ageBracket",e),children:[(0,a.jsx)(d.SelectTrigger,{className:"text-body bg-white border-radius-md p-2.5 w-full ".concat(F.ageBracket?"border-error-solid focus:ring-error":"border-[var(--color-stroke-light)]"),style:{padding:"10px"},"data-testid":"age-bracket-select",children:(0,a.jsx)(d.SelectValue,{placeholder:"Select"})}),(0,a.jsx)(d.SelectContent,{className:"z-[9999]",children:h.map(e=>(0,a.jsx)(d.SelectItem,{value:e.value,children:e.label},e.value))})]}),F.ageBracket&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"age-bracket-error",children:F.ageBracket})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.companyName,children:[(0,a.jsx)(n.Label,{htmlFor:"companyName",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"companyName-label",children:"Company Name *"}),(0,a.jsx)(s.Input,{id:"companyName",value:k.companyName,onChange:e=>X("companyName",e.target.value),placeholder:"Enter Here",className:"text-body bg-white border-radius-md p-2.5 ".concat(F.companyName?"border-error-solid focus:ring-error":"border-[var(--color-stroke-light)]"),style:{padding:"10px"},"data-testid":"companyName-input"}),F.companyName&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"companyName-error",children:F.companyName})]}),(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.role,children:[(0,a.jsx)(n.Label,{htmlFor:"role",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"role-label",children:"Role *"}),(0,a.jsx)(s.Input,{id:"role",value:k.role,onChange:e=>X("role",e.target.value),placeholder:"Enter Here",className:"text-body bg-white border-radius-md p-2.5 ".concat(F.role?"border-error-solid focus:ring-error":"border-[var(--color-stroke-light)]"),style:{padding:"10px"},"data-testid":"role-input"}),F.role&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"role-error",children:F.role})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.email,children:[(0,a.jsx)(n.Label,{htmlFor:"email",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"email-label",children:"Email"}),(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(s.Input,{disabled:!!O,id:"email",type:"email",value:k.email,onChange:e=>X("email",e.target.value),placeholder:"Enter Here",className:"text-body bg-white border-radius-md p-2.5 pr-20 ".concat(F.email?"border-error-solid focus:ring-error":"border-[var(--color-stroke-light)]"," ").concat(O?"bg-gray-50 cursor-not-allowed":""),style:{padding:"10px"},"data-testid":"email-input"})}),F.email&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"email-error",children:F.email})]}),(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.location,children:[(0,a.jsx)(n.Label,{htmlFor:"location",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"location-label",children:"Location"}),(0,a.jsx)(s.Input,{id:"location",value:k.location,onChange:e=>{var r;X("location",r=e.target.value),r&&r.trim()&&I(r)},placeholder:"Enter city or address",className:"text-body bg-white border-radius-md p-2.5 ".concat(F.location?"border-error-solid focus:ring-error":"border-[var(--color-stroke-light)]"),style:{padding:"10px"},"data-testid":"location-input"}),F.location&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"location-error",children:F.location})]}),(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.contactNo,children:[(0,a.jsx)(n.Label,{htmlFor:"contactNo",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"contactNo-label",children:"Contact No."}),(0,a.jsx)(i.LR,{...(!k.contactNo||""===k.contactNo.trim())&&L?{country:L}:(null==v?void 0:v.phone)&&k.countryCode?{country:(e=>{var r;let t=(0,m.n8)(e);return t.length>0&&(null==(r=t[0])?void 0:r.iso2.toLowerCase())||""})(k.countryCode)}:{},value:k.contactNo?"".concat(E).concat(k.contactNo):E||"",onChangeWithParts:(e,r)=>{X("contactNo",e),S(r),r!==k.countryCode&&X("countryCode",r),e&&""!==e.trim()||M(e=>{let r={...e};return delete r.contactNo,delete r.countryCode,r})},placeholder:"Enter Here",errorMessage:F.contactNo||F.countryCode||void 0,requireCountrySelection:!L&&(!k.contactNo||""===k.contactNo.trim()),onCountrySelectionRequired:e=>{k.contactNo&&f.oR.warning("Country Code Required",{description:e})},onValidationChange:(e,r)=>{e?M(e=>{let r={...e};return delete r.contactNo,delete r.countryCode,r}):!e&&r&&M(e=>({...e,contactNo:r}))},inputProps:{className:"focus-visible:border-brand-primary focus-visible:ring-brand-primary focus-visible:ring-[1px]"}}),F.countryCode&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"countryCode-error",children:F.countryCode})]}),(0,a.jsxs)("div",{className:"space-y-2","data-error":!!F.linkedinProfile,children:[(0,a.jsx)(n.Label,{htmlFor:"linkedinProfile",className:"text-s font-semibold",style:{color:"var(--color-foreground)"},"data-testid":"linkedinProfile-label",children:"LinkedIn Profile"}),(0,a.jsx)(s.Input,{id:"linkedinProfile",value:k.linkedinProfile,onChange:e=>X("linkedinProfile",e.target.value),placeholder:"Enter Here",className:"text-body bg-gray-50 border-radius-md p-2.5 border-[var(--color-stroke-light)] cursor-not-allowed",style:{padding:"10px"},"data-testid":"linkedinProfile-input",disabled:!0,readOnly:!0}),F.linkedinProfile&&(0,a.jsx)("p",{className:"text-xs text-error-solid","data-testid":"linkedinProfile-error",children:F.linkedinProfile})]})]})]})}),(0,a.jsx)("div",{className:"py-3 px-3",children:(0,a.jsxs)("div",{className:"flex gap-3 justify-start",children:[(0,a.jsx)(i.$n,{onClick:H,variant:"primary",size:"md",dataTestId:"save-edit-profile",disabled:T,children:T?"Saving...":"Save"}),(0,a.jsx)(i.$n,{onClick:q,variant:"outline",size:"md",dataTestId:"cancel-edit-profile",children:"Cancel"})]})})]}):(0,a.jsx)("div",{className:"p-6 text-center",children:(0,a.jsx)("p",{className:"text-text-secondary","data-testid":"no-profile-data-message",children:"No profile data available."})})}},40099:(e,r,t)=>{t.d(r,{h:()=>d});var a=t(12115),l=t(73977);let o=0;async function i(){let e=Date.now()-o;if(e<1e3){let r=1e3-e;await new Promise(e=>setTimeout(e,r))}o=Date.now()}async function s(e){try{var r;if(!e||"string"!=typeof e||""===e.trim())return(0,l.yG)("warn","Invalid address provided to getLocationData",{address:e}),null;let t=e.trim();await i();let a=new URLSearchParams({q:t,format:"json",addressdetails:"1",limit:"1"});(0,l.yG)("info","Fetching location data from Nominatim API",{address:t});let o=await fetch("".concat("https://nominatim.openstreetmap.org/search","?").concat(a),{headers:{"User-Agent":"XQTIVFrontend/1.0 (Recruitment Platform)"}});if(!o.ok)return(0,l.yG)("error","Nominatim API request failed",{status:o.status,statusText:o.statusText,address:t}),null;let s=await o.json();if(!s||0===s.length)return(0,l.yG)("info","No results found for address",{address:t}),null;let n=s[0];if(!n||!n.address)return(0,l.yG)("warn","No address data in result",{address:t}),null;let d={country:n.address.country||"",countryCode:(null==(r=n.address.country_code)?void 0:r.toLowerCase())||"",city:n.address.city||n.address.town||n.address.village||void 0,state:n.address.state||n.address.county||void 0,displayName:n.display_name};if(!d.countryCode)return(0,l.yG)("warn","No country code found in location data",{address:t,result:n.address}),null;return(0,l.yG)("info","Location data retrieved successfully",{address:t,country:d.country,countryCode:d.countryCode}),d}catch(r){return(0,l.yG)("error","Error fetching location data from Nominatim",{address:e,error:r instanceof Error?r.message:String(r)}),null}}async function n(e){let r=await s(e);return(null==r?void 0:r.countryCode)||null}function d(e){let[r,t]=(0,a.useState)(null),[o,i]=(0,a.useState)(!1),[s,d]=(0,a.useState)(null),c=(0,a.useRef)(null),u=(0,a.useCallback)(async e=>{if(!e||""===e.trim()){t(null),d(null),i(!1);return}i(!0),d(null);try{(0,l.yG)("info","Detecting country from location",{location:e});let r=await n(e);r?(t(r),(0,l.yG)("info","Country detected successfully",{location:e,countryCode:r})):(d("Could not detect country from location"),(0,l.yG)("warn","Failed to detect country from location",{location:e}))}catch(t){let r=t instanceof Error?t.message:"Failed to detect country";d(r),(0,l.yG)("error","Error detecting country from location",{location:e,error:r})}finally{i(!1)}},[]),m=(0,a.useCallback)(e=>{if(c.current&&clearTimeout(c.current),!e||""===e.trim()){t(null),d(null),i(!1);return}i(!0),c.current=setTimeout(()=>{u(e)},800)},[u]),p=(0,a.useCallback)(()=>{c.current&&clearTimeout(c.current),t(null),d(null),i(!1)},[]);return(0,a.useEffect)(()=>{e&&m(e)},[e,m]),(0,a.useEffect)(()=>()=>{c.current&&clearTimeout(c.current)},[]),{countryCode:r,isLoading:o,error:s,detectCountry:m,clearCountry:p}}},69048:(e,r,t)=>{t.d(r,{E5:()=>N,Gg:()=>g,YP:()=>x,nJ:()=>h});var a=t(38511);let l=1024*a.F.FILE_UPLOAD.MAX_SIZE_MB*1024,o=["application/pdf","application/x-pdf"],i=["application/msword"],s=["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],n=["image/jpeg","image/jpg","image/pjpeg"],d=["image/png","image/x-png"],c=["application/vnd.ms-excel","application/msexcel","application/x-msexcel","application/x-ms-excel"],u=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],m=["text/plain"],p={DOCUMENTS:{extensions:[".pdf",".doc",".docx"],mimeTypes:[...o,...i,...s],label:"PDF, DOC, DOCX"},IMAGES:{extensions:[".jpg",".jpeg",".png"],mimeTypes:[...n,...d],label:"JPG, JPEG, PNG"}
1,EXCEL:{extensions:[".xlsx",".xls"],mimeTypes:[...u,...c],label:"XLSX, XLS"},TRANSCRIPTS:{extensions:[".pdf",".docx",".txt"],mimeTypes:[...o,...s,...m],label:"PDF, DOCX, TXT"}},f=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.flat().join(",")},x={DOCUMENTS:f(o,i,s),IMAGES:f(n,d),EXCEL:f(u,c),TRANSCRIPTS:f(o,s,m)},g=e=>{if(!e)return{isValid:!1,errorMessage:"No file selected"};let r=e.size/1048576;return e.size>l?{isValid:!1,errorMessage:"File size exceeds the maximum limit of ".concat(a.F.FILE_UPLOAD.MAX_SIZE_MB,"MB. Current size: ").concat(r.toFixed(2),"MB"),fileSizeInMB:r}:{isValid:!0,fileSizeInMB:r}},h=(e,r)=>{if(!e)return{isValid:!1,errorMessage:"No file selected"};let t=((e,r)=>{if(!e)return{isValid:!1,errorMessage:"No file selected"};let t=[],a=[];return(r.forEach(e=>{let r=p[e];t.push(...r.mimeTypes),a.push(r.label)}),t.includes(e.type))?{isValid:!0}:{isValid:!1,errorMessage:"Invalid file format. Only ".concat(a.join(", ")," files are allowed. Selected file type: ").concat(e.type||"unknown")}})(e,r);if(!t.isValid)return t;let a=g(e);return!a.isValid,a},N=()=>"".concat(a.F.FILE_UPLOAD.MAX_SIZE_MB," MB")}}]);
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.