1import{r as a,j as t,D as fe,l as _e,Q as dt,ay as at,m as we,o as U,P as C,A as be,f as ht,t as ut,y as me,n as Ce,b as qe,a0 as P,Y as V,$ as xt,I as gt,a9 as ft,q as pe,Z as Ue,u as _t,M as Ve,G as wt,d as xe}from"./index-DOEDGpFv.js";import{D as mt}from"./DataGrid-BA8QAoin.js";import{C as Ct}from"./CreateProject-B3ST0S4I.js";import{c as ve,b as ae,d as de,u as He,i as vt,j as bt}from"./index.esm-DaRz_fRj.js";import{C as We}from"./CustomDropdown-KMCu6Cw8.js";import{c as Z}from"./createProject.service-C6iPiW9V.js";import{i as jt}from"./info_circle-CPn1_Ob8.js";import{R as yt}from"./RemoveCircleTwoTone-DiiDLHIb.js";import{C as Nt}from"./ContentCopyTwoTone-DG5g0Th1.js";import{C as St}from"./Cancel-rtwU0jAA.js";import{P as kt,E as ge}from"./PeopleAltTwoTone-UGP_l4Uo.js";import{S as Ge}from"./SaveTwoTone-BeeFrSUG.js";import{P as Ft}from"./PersonSearchTwoTone-BIcspv41.js";import{h as Bt,a as Lt}from"./CustomSlider-DCr1sfo4.js";import{R as It}from"./RecruiterDashBroadHeader-JVQDnjTz.js";import{S as Tt,s as D,a as Pt,b as $t,c as zt}from"./Stepper-DIOmvNXx.js";import{S as At}from"./Stack-Wv7UNWCe.js";import"./toPropertyKey-DCwh5dYN.js";import"./Autocomplete-BiTc0fK0.js";import"./styled-Om9RrDqq.js";import"./ListItemText-Dml_I78M.js";import"./InputAdornment-CYJ-dB-y.js";import"./Checkbox-DKFnH0fc.js";import"./FormControlLabel-Cv1jetH4.js";import"./TablePagination-rbCf-VGH.js";import"./KeyboardArrowRight-K5Vapl4X.js";import"./LastPage-CTKFULy8.js";import"./Skeleton-H3a6dgVC.js";import"./useThemeProps-BeptFCZJ.js";import"./WorkTwoTone-BPRhA1qS.js";const Je=({openDialog:_,onClose:r,userid:L,refresh:g,handleSubmit:q,projectName:v})=>{const[h,B]=a.useState(!1);return a.useEffect(()=>{B(_)},[_]),t.jsx("div",{className:"createProjectPopup",children:t.jsxs(fe,{className:"controlthepadding",open:h,fullWidth:!0,maxWidth:"sm",id:"projectCreatedPopup",children:[t.jsx(_e,{align:"center",children:t.jsx("h2",{className:"title mt-4",children:"Project created"})}),t.jsx(dt,{children:t.jsxs(at,{className:"text-center",children:[t.jsxs("p",{className:"PopupContent",children:["New project ",t.jsx("span",{className:"title_projectName",children:v})," ",t.jsx("br",{}),"has been created."]}),t.jsxs("p",{className:"PopupContent",children:["Add character details ",t.jsx("br",{}),"to start shortlisting"]})]})}),t.jsx(we,{style:{padding:"15px 2.3rem 25px",justifyContent:"center"},children:t.jsx(U,{text:"Add Characters",onClick:q})})]})})};Je.propTypes={openDialog:C.bool.isRequired,onClose:C.func,userid:C.oneOfType([C.string,C.number]),refresh:C.func,handleSubmit:C.func.isRequired,projectName:C.string.isRequired};const je=({setisCreated:_,setProjectDetails:r,setCreatePopup:L,projectDetails:g,setGoForms:q,isCreatedFromMyproject:v})=>{const{dependencyData:h,user:B}=a.useContext(be),[X,y]=a.useState(),[k,$]=a.useState(!1),[H,T]=a.useState(null),[f,z]=a.useState(null),[N,A]=ht.useState(0),{openSnackbar:oe}=a.useContext(ut),ee=ve({project_type:de().required("Please select the project type"),project_title:ae().required("Please enter the title"),logline:ae().optional()}),c=He({initialValues:{project_type:(f==null?void 0:f.type_project)??"",project_title:(f==null?void 0:f.project_title)??"",logline:(f==null?void 0:f.project_description)??""},enableReinitialize:!0,validationSchema:ee,validateOnMount:!0,onSubmit:({project_type:S,project_title:F,logline:W},{setStatus:te,setSubmitting:O})=>{if($(!0),f!=null&&f.id){let b={project_title:F,type_project:S,project_description:W};return Z.handleUpdateProject(f==null?void 0:f.id,b).then(I=>{if((I==null?void 0:I.status)===400){$(!1),T(I==null?void 0:I.message),O(!1),c.setFieldValue("project_title",null);return}return r(I),z(I),$(!1),O(!0),setTimeout(()=>{q(1),window.scrollTo(0,0)},600),I})}const ie={project_title:F,type_project:S,project_description:W,project_status:1,recruiter_id:B==null?void 0:B.user_id};Z.createProject(ie).then(b=>{if((b==null?void 0:b.status)===400){$(!1),T(b==null?void 0:b.message),O(!1),c.setFieldValue("project_title",null);return}r(b),z(b),$(!1),O(!0),setTimeout(()=>{L(!0)},600)}).catch(b=>{var se,d;$(!1),O(!1);const I=((d=(se=b==null?void 0:b.response)==null?void 0:se.data)==null?void 0:d.message)||"Something went wrong";oe(I,"error"),oe(I,"error")})}});return a.useEffect(()=>{var S;h!=null&&h.project&&y((S=h==null?void 0:h.project)==null?void 0:S.map(F=>{var W,te;return!((W=F==null?void 0:F.projectname)!=null&&W.includes("Series"))&&((te=F==null?void 0:F.projectname)==null?void 0:te.slice(-1))==="s"?{...F,projectname:F==null?void 0:F.projectname.slice(0,-1)}:F}
1))},[h]),a.useEffect(()=>{g!=null&&g.id&&(g==null?void 0:g.id)!==(f==null?void 0:f.id)&&Z.getProjectDetailsById(g==null?void 0:g.id).then(S=>{z(S)})},[g]),t.jsxs("div",{className:"mt-7",children:[t.jsx("div",{className:"create_card p-5",children:t.jsxs("div",{className:"input_area",children:[t.jsxs("div",{className:"mt-7 border_bottom RemovepaddingNew",children:[t.jsx("h5",{className:"label_text",children:"Title"}),t.jsx(me,{id:"standard-basic",variant:"standard",placeholder:"Project title",slotProps:{htmlInput:{autoComplete:"new-password",maxLength:101}},name:"project_title",value:c.values.project_title,onChange:S=>{c.setFieldValue("project_title",S.target.value),T(null)},error:H||c.touched.project_title&&!!c.errors.project_title,helperText:H||c.touched.project_title&&c.errors.project_title,multiline:!0,className:`${c.values.project_title?"value":""}`})]}),t.jsxs("div",{className:`mt-7 RemovepaddingNew ${c.values.project_type?"value":""}`,children:[t.jsx("h5",{className:"label_text",children:t.jsx("span",{children:"Type of project"})}),t.jsx(We,{error:c.errors.project_type&&c.touched.project_type,data:X,autoComplete:!0,dropdownName:"projectname",handleChange:S=>{c.setFieldValue("project_type",S)},values:c.values.project_type}),c.errors.project_type&&c.touched.project_type?t.jsx("p",{className:"form_err",children:c.errors.project_type}):null]}),t.jsxs("div",{className:"mt-7 border_bottom mb-14 RemovepaddingNew",children:[t.jsx("h5",{className:"label_text",children:"Brief/Logline (Optional)"}),t.jsx(me,{id:"standard-basic",variant:"standard",placeholder:"Brief",name:"logline",value:c.values.logline,onChange:S=>c.setFieldValue("logline",S.target.value),error:c.touched.logline&&!!c.errors.logline,helperText:c.touched.logline&&c.errors.logline,multiline:!0,minRows:5,className:`${c.values.logline?"value":""}`,slotProps:{htmlInput:{maxLength:800}},onInput:S=>{A(S.target.value.length)}}),t.jsxs("p",{className:"text-right text-xs mt-2",children:[c.values.logline.length?c.values.logline.length:N," ","/ 800"]})]})]})}),t.jsxs("div",{className:"flex justify-between mt-8 saveNext button_outer_flex MobilePAdding",children:[t.jsx(Ce,{text:"Cancel",onClick:()=>{_(!1),window.scrollTo(0,0),v&&history.goBack()}}),t.jsx("div",{className:"butt_outer",children:t.jsx(U,{text:c.isSubmitting&&c.isValid&&!k?"Saved":"Save & Next",onClick:c.handleSubmit,isLoading:k,disabled:!k&&c.isSubmitting&&c.isValid,className:`${!k&&c.isSubmitting&&c.isValid||!c.isValid?"opacity-50":""}`,noHover:!k&&c.isSubmitting&&c.isValid||!c.isValid})})]})]})};je.propTypes={setisCreated:C.func.isRequired,setProjectDetails:C.func.isRequired,setCreatePopup:C.func.isRequired,setGoForms:C.func.isRequired,projectDetails:C.object,isCreatedFromMyproject:C.bool};je.defaultProps={projectDetails:null,isCreatedFromMyproject:!1};const Rt=({setGoForms:_,projectDetails:r,isNewCharacter:L=!0,isClosed:g})=>{var Be,Le,Ie,Te,Pe,$e,ze,Ae,Re;const[q,v]=a.useState(null),[h,B]=a.useState(null),[X,y]=a.useState(!1),[k,$]=a.useState({isOpen:!1,data:null}),[H,T]=a.useState(!1),[f,z]=a.useState(!1),[N,A]=a.useState(0),[oe,ee]=a.useState(97),[c,S]=a.useState(null),[F,W]=a.useState(null),[te,O]=a.useState(!0),ie=qe(),{isProfileFreezed:b}=a.useContext(be),I=[{id:0,value:"Female"},{id:1,value:"Male"},{id:2,value:"Neutral"}],se=ve().shape({characterList:vt().of(ve().shape({character_name:ae().required("Please enter the character name"),min_age:de().required("Please enter minimum age"),max_age:de().min(bt("min_age"),"Max Age must be greater than Min Age").required("Max Age must be greater than Min Age"),min_height:de(),gender:ae().required("Please select gender")}))}),d=He({initialValues:{characterList:q??[]},enableReinitialize:!0,validationSchema:se,onSubmit:({characterList:e},{setStatus:i,setSubmitting:n},l)=>{var o;if(r!=null&&r.id&&(h==null||h=="newCharacter")){T(!0);let s=(o=e.filter(x=>!x.id))==null?void 0:o.map(x=>(delete x.index,{...x,project_id:r==null?void 0:r.id,recruiter_id:r==null?void 0:r.recruiter_id,character_name:x.character_name.toLocaleUpperCase()}));s!=null&&s.length?Z.createCharacter(s).then(x=>{z(!0),r!=null&&r.id&&re(r==null?void 0:r.id,r==null?void 0:r.recruiter_id),T(!1)}):T(!1)}}}),Ye=e=>{var i;return(i=e.row)!=null&&i.id?d.values.characterList.findIndex(n=>{var l;return n.id===((l=e.row)==null?void 0:l.id)}):e.row.index_sno-1},ce=e=>{var o,s;const i=Ye(e),n=((o=d.errors.characterList)==null?void 0:o.length)&&d.errors.characterList[i]||{},l=F==e.row.index_sno-1?!0:((s=d.touched.characterList)==null?void 0:s.length)&&d.touched.characterList[i]||{};return{index:i,Errors:n,Tounched:l}},ne=(e,i)=>{let n=[...d.values.characterList];n[e]={...n[e],...i},d.setFieldValue("characterList",n)},ye=e=>{var i,n;return((i=d.values.characterList[e])==null?void 0:i.id)&&h==e||!((n=d.values.characterList[e])!=null&&n.id)},Ke=(e,i=Math.round(e/2.54))=>({feet:Math.floor(i/12),inches:i%12}),Qe=e=>{let i=Ke(e),n="";return i.feet==1?n=i.inches+1:n=(i.feet-1)*12+(i.inches+1),n},Ze=e=>{let i=he("in",e);i=i.split(" ").join(".");let n=i.match(/\d/g);n=(n==null?void 0:n.length)<3?n.join("."):(n==null?void 0:n.length)===3?`${n[0]}.${n[1]}${n[1]}`:null;let l=n.split(".");return i=l.length===2?l[0]*30.48+l[1]*2.54:l[0]*30.48,i.toFixed(1)};
1function he(e,i){if(e=="in"){let n="",l="";return i<=12?(n=i-1,n>0?n="1ft "+n+"in":n="1ft"):(n=i/12,Number.isInteger(n)?(n=n,l=11):(n=parseInt(i/12),l=i-12*n,l=l-1,n=n+1),l>0?n=n+"ft "+l+"in":n=n+"ft"),n}else return i+" cm"}const Ne=(e,i,n,l)=>{i==="in"&&l.height_size_type!=="in"?(ne(n,{height_size_type:"in",min_height:Qe(l.min_height)}),A(0),ee(97)):i==="cm"&&l.height_size_type!=="cm"&&(ne(n,{height_size_type:"cm",min_height:Ze(l.min_height)}),A(0),ee(274))},Se=()=>{var n,l,o;W(null);let e={character_name:"",min_age:"",max_age:"",min_height:0,height_size_type:"in",gender:"",index:(n=d.values.characterList)!=null&&n.length?((o=(l=d.values.characterList)==null?void 0:l.find(s=>s.id))==null?void 0:o.id)+10:2*Math.floor(Math.random()*10)};A(0),ee(97);const i=d.values.characterList?[...d.values.characterList]:[];B("newCharacter"),d.setFieldValue("characterList",[e,...i])},re=async(e,i,n)=>{let l=n>=0?d.values.characterList.filter((o,s)=>s!=n).filter(o=>!o.id):null;return await Z.getCharacterListById(e,i).then(o=>(o!=null&&o.characters&&(l!=null&&l.length?(v([...l,...o==null?void 0:o.characters]),B("newCharacter"),d.resetForm()):(v(o==null?void 0:o.characters),B(null))),o)).finally(()=>O(!1))},Xe=(e,i)=>{if(d.isValid){T(!0);let n={...i,character_name:i.character_name.toLocaleUpperCase()};Z.updateCharacterbyId(e,n).then(l=>{re(r==null?void 0:r.id,r==null?void 0:r.recruiter_id).then(o=>{T(!1)}),B(null)})}else d.handleSubmit()},ke=(e,i)=>{var n;if(e){y(!0),Z.deleteCharacterbyId(e).then(l=>{re(r==null?void 0:r.id,r==null?void 0:r.recruiter_id)}).finally(()=>{$({isOpen:!1,data:null}),y(!1)});return}if(i>=0){let l=((n=d.values.characterList)==null?void 0:n.filter((o,s)=>s!=i))??[];d.setFieldValue("characterList",l)}},Oe=e=>{navigator.clipboard.writeText(`${pe.client_url}/jobs/${e}`).then(function(){S(e),setTimeout(()=>S(null),9e3)})},Fe=e=>{if(e){T(!0),delete e.index;let i=[{...e,project_id:r==null?void 0:r.id,recruiter_id:r==null?void 0:r.recruiter_id,character_name:e.character_name.toLocaleUpperCase()}];i!=null&&i.length&&Z.createCharacter(i).then(n=>{z(!0),r!=null&&r.id?re(r==null?void 0:r.id,r==null?void 0:r.recruiter_id,(e==null?void 0:e.index_sno)-1):B(null),T(!1)}).finally(()=>{T(!1)})}};a.useEffect(()=>{r!=null&&r.id&&(r!=null&&r.recruiter_id)&&re(r==null?void 0:r.id,r==null?void 0:r.recruiter_id)},[r]);var De=new Date().toISOString().slice(0,10);const ue=(e,i,n="characterTableText")=>{var x,j,w;const{index:l,Errors:o,Tounched:s}=ce(e);return t.jsx("strong",{children:ye(l)?t.jsx(me,{id:"standard-search",variant:"standard",placeholder:"",slotProps:{input:{autoComplete:"new-password",form:{autoComplete:"off"}}},name:i,className:`${(x=e.row)!=null&&x[i]?"value":""}`,value:(j=e.row)==null?void 0:j[i],onChangeCapture:u=>{ne(l,{[i]:u.target.value})},error:(o==null?void 0:o[i])&&((s==null?void 0:s[i])||s===!0),onKeyDown:u=>u.stopPropagation()}):t.jsx("p",{className:i==="character_name"?"characterTableTextBold":n,children:(w=e.row)==null?void 0:w[i]})})},et=e=>{var o,s,x,j;const{index:i,Errors:n,Tounched:l}=ce(e);return t.jsx("strong",{className:`w-full ${typeof((o=e.row)==null?void 0:o.gender)=="number"?"value":""}`,children:(s=e.row)!=null&&s.id?t.jsx("p",{className:"characterTableText",children:((j=I.find(w=>{var u;return w.id==((u=e.row)==null?void 0:u.gender)}))==null?void 0:j.value)??""}):t.jsxs("div",{className:"flex w-full",children:[t.jsx("div",{style:{width:"90%"},children:t.jsx(We,{name:"gender",error:(n==null?void 0:n.gender)&&((l==null?void 0:l.gender)||l===!0),data:I,autoComplete:!0,dropdownName:"value",handleChange:w=>ne(i,{gender:w}),values:(x=e.row)==null?void 0:x.gender,onkeyDownForTable:w=>w.stopPropagation(),disablePortal:!1})}),t.jsx("div",{children:t.jsx(P,{title:"Cannot be changed later",arrow:!0,placement:"top-start",children:t.jsx("img",{src:jt,alt:""})})})]})})},tt=e=>{var n,l,o,s;const{index:i}=ce(e);return t.jsx(t.Fragment,{children:ye(i)?t.jsxs("div",{className:"sliderCharacter flex form_left w-full",children:[t.jsx(ft,{name:"min_height",valueLabelFormat:he(e.row.height_size_type,e.row.min_height),valueLabelDisplay:"on",marks:e.row.height_size_type==="in"?Bt:Lt,min:N,max:oe,onCh
1ange:(x,j)=>{ne(i,{min_height:j})},value:(n=e.row)==null?void 0:n.min_height,style:{width:"60%",marginLeft:"10px",marginRight:"20px"}}),t.jsxs("div",{className:"right_button flex",children:[t.jsx("button",{type:"button",className:e.row.height_size_type==="in"?"physical_button_active":"physical_button_inactive",onClick:()=>{Ne("height","in",i,e.row)},children:"ft/in"}),t.jsx("button",{type:"button",className:e.row.height_size_type==="cm"?"physical_button_active":"physical_button_inactive",onClick:()=>{Ne("height","cm",i,e.row)},children:"cm"})]})]}):t.jsx("p",{className:"characterTableText",children:((l=e.row)==null?void 0:l.min_height)>0?he((o=e.row)==null?void 0:o.height_size_type,(s=e.row)==null?void 0:s.min_height):"NA"})})},it=e=>{var i,n,l,o,s,x,j,w,u,R,M;return((i=e==null?void 0:e.row)==null?void 0:i.isDeleted)===!0?{text:"Character is Deleted",tooltip:"",className:"character_color"}:(l=(n=e==null?void 0:e.row)==null?void 0:n.auditionData)!=null&&l.isBanned?{text:"Closed",tooltip:"Click to view the Closed Job Posting"}:((s=(o=e==null?void 0:e.row)==null?void 0:o.auditionData)==null?void 0:s.job_expiry)<De?{text:"Expired",tooltip:"Click to view the Expired Job Posting"}:((j=(x=e==null?void 0:e.row)==null?void 0:x.auditionData)==null?void 0:j.is_open_audition_posted)===!0?{text:"Live",tooltip:"Click to edit the Job Posting"}:(u=(w=e==null?void 0:e.row)==null?void 0:w.auditionData)!=null&&u.isSubmitted?{text:"Under review",tooltip:"Cannot edit when Under Review"}:(M=(R=e==null?void 0:e.row)==null?void 0:R.auditionData)!=null&&M.id?{text:"In Draft",tooltip:"Your audition is in draft. Click to edit/submit"}:{text:"Post",tooltip:"Post to receive applications from talents"}},nt=e=>{var l,o,s,x,j,w,u,R,M,G,J,Y,K;if(!((l=e==null?void 0:e.row)!=null&&l.id)||g)return t.jsx("p",{className:"characterTableText",children:"---"});const i=it(e),n=!b&&((o=e==null?void 0:e.row)==null?void 0:o.isDeleted)===!1&&!(((x=(s=e==null?void 0:e.row)==null?void 0:s.auditionData)==null?void 0:x.isSubmitted)===!0&&!((w=(j=e==null?void 0:e.row)==null?void 0:j.auditionData)!=null&&w.is_open_audition_posted)&&!((R=(u=e==null?void 0:e.row)==null?void 0:u.auditionData)!=null&&R.isBanned));return t.jsxs("p",{className:b?"freeze_text_color flex gap-2 justify-center items-center":"flex gap-2 justify-center items-center",children:[t.jsx("span",{className:"character_link font-semibold cursor-pointer",onClick:n?()=>{var E,m,p,Q;ie("/app/audition",{state:(m=(E=e==null?void 0:e.row)==null?void 0:E.auditionData)!=null&&m.id?{poster_id:(Q=(p=e==null?void 0:e.row)==null?void 0:p.auditionData)==null?void 0:Q.id}:e==null?void 0:e.row})}:void 0,children:t.jsx(P,{title:i.tooltip,placement:"top",children:t.jsx("span",{className:`flex flex-col ${i.className||""}`,children:i.text})})}),((G=(M=e==null?void 0:e.row)==null?void 0:M.auditionData)==null?void 0:G.is_open_audition_posted)===!0&&((Y=(J=e==null?void 0:e.row)==null?void 0:J.auditionData)==null?void 0:Y.jobUniqueId)&&t.jsxs(t.Fragment,{children:[t.jsx(P,{title:(c==null?void 0:c.length)>2?"Copied":"Copy link",placement:"top",children:t.jsx(V,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:()=>{var E,m;return Oe((m=(E=e==null?void 0:e.row)==null?void 0:E.auditionData)==null?void 0:m.jobUniqueId)},children:t.jsx(Nt,{fontSize:"inherit",sx:{color:"#9B26B6"}})})}),((K=e==null?void 0:e.row)==null?void 0:K.isDeleted)===!1&&t.jsx(P,{title:"View Applicants",placement:"top",children:t.jsx(V,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:()=>{var E,m;window.open(`/app/my-job-postings#project_id${(E=e.row)==null?void 0:E.project_id}#character_id#${(m=e.row)==null?void 0:m.id}`,"_blank")},children:t.jsx(kt,{fontSize:"inherit",sx:{color:"#9B26B6"}})})})]})]})},rt=e=>{var j,w,u,R,M,G,J,Y,K,E;const{index:i,Errors:n,Tounched:l}=ce(e),o=((j=e==null?void 0:e.row)==null?void 0:j.isDeleted)===!0,s=!b&&!o,x=((u=(w=e==null?void 0:e.row)==null?void 0:w.auditionData)==null?void 0:u.isBanned)===!1&&((M=(R=e==null?void 0:e.row)==null?void 0:R.auditionData)==null?void 0:M.isSubmitted)===!0&&!((J=(G=e==null?void 0:e.row)==null?void 0:G.auditionData)!=null&&J.is_open_audition_posted);return t.jsxs("strong",{className:"w-full flex justify-center",children:[((Y=e==null?void 0:e.row)==null?void 0:Y.id)&&!g&&t.jsx(P,{title:o?"Character is deleted":"Find Talents",placement:"top",children:t.jsx(V,{"aria-label":"favorite",style:{padding:2,fontSize:"1.6em"},color:"#FFFFFF",onClick:()=>{var m,p,Q,le,Me,Ee;o||window.open(`${pe.client_url}/find-talents?character_id=${(m=e==null?void 0:e.row)==null?void 0:m.id}&gender=${(p=e==null?void 0:e.row)==null?void 0:p.gender}&min_age=${(Q=e==null?void 0:e.row)==null?void 0:Q.min_age}&max_age=${(le=e==null?void 0:e.row)==null?void 0:le.max_age}&min_height=${(Me=e==null?void 0:e.row)==null?void 0:Me.min_height}&height_size_type=${(Ee=e==null?void 0:e.row)==null?void 0:Ee.height_size_type}`,"_blank")},children:t.jsx(Ft,{fontSize:"inherit",sx:{color:o?"#9f9f9f":"#9B26B6"}})})}),((K=e.row)==null?void 0:K.id)&&!g&&!o&&t.jsx(t.Fragment,{children:x?t.jsx(P,{title:"Cannot edit when Under Review",placement:"top",children:t.jsx(V,{style:{padding:2,fontSize:"1.5em"},children:t.jsx(ge,{fontSize:"inherit",sx:{color:s?"#9B26B6":"#9f9f9f"}})})}):h==null||h!=i?h==="newCharacter"?t.jsx(P,{title:"Only one character can be edited at a time",placement:"top",children:t.jsx(V,{style:{padding:2,fontSize:"1.5em"},children:t.jsx(ge,{fontSize:"inherit",sx:{color:s?"#9B26B6":"#9f9f9f"}})})}):t.jsx(P,{title:"Edit character",placement:"top",children:t.jsx(V,{style:{padding:2,fontSize:"1.5em"},onClick:s?()=>B(i):void 0,children:t.jsx(ge,{fontSize:"inherit",sx:{color:s?"#9B26B6":"#9f9f9f"}})})}):t.jsxs("div",{className:"flex",children:[t.jsx(P,{title:"Save",placement:"top",children:t.jsx(V,{style:{padding:2,fontSize:"1.5em"},onClick:s?()=>{var m;return Xe((m=e.row)==null?void 0:m.id,e.row)}:void 0,children:H?t.jsx("div",{style:{minWidth:25},children:t.jsx(Ue,{size:"70%",sx:{color:"#9B26B6"}})}):t.jsx(Ge,{fontSize:"inherit",sx:{color:s?"#9B26B6":"#9f9f9f"}})})}),t.jsx(P,{title:"Cancel",placement:"top",children:t.jsx(V,{style:{padding:2,fontSize:"1.5em"},onClick:s?()=>{B(null),d.resetForm()}:void 0,children:t.jsx(St,{sx:{color:s?"#9B26B6":"#9f9f9f"},className:"cursor-pointer"})})})]})}),!((E=e.row)!=null&&E.id)&&t.jsx("div",{children:t.jsx(Mt,{isLoading:F===e.row.index_sno-1&&H,onClick:s?()=>{var m,p,Q,le;if(W(e.row.index_sno-1),((m=Object.keys(n))==null?void 0:m.length)===0&&((p=Object.keys(l))==null?void 0:p.length)===0){if(((Q=e.row)==null?void 0:Q.character_name)===""){d.submitForm(
1);return}Fe(e.row)}else((le=Object.keys(n))==null?void 0:le.length)===0&&Fe(e.row)}:void 0})}),(h==null||h!=i)&&!g&&t.jsx(P,{title:o?"Character is deleted":"Delete character",placement:"top",children:t.jsx(V,{style:{padding:2,fontSize:"1.5em"},onClick:s?()=>{var m,p;if(!o){if((m=e.row)!=null&&m.id){$({isOpen:!0,data:{character:e.row,index:indexedDB}});return}ke(null,((p=e.row)==null?void 0:p.index_sno)-1),B(null)}}:void 0,children:t.jsx(yt,{sx:{color:s?"#9B26B6":"#9f9f9f",fontSize:20}})})})]})},lt=[{field:"index_sno",headerName:"Row",width:40,align:"center",headerAlign:"center"},{field:"character_name",headerName:"Character name",width:250,align:"left",headerAlign:"left",renderCell:e=>ue(e,"character_name")},{field:"gender",headerName:"Gender",width:120,align:"center",headerAlign:"center",renderCell:et},{field:"min_age",headerName:"Min age",width:70,align:"center",headerAlign:"center",renderCell:e=>ue(e,"min_age")},{field:"max_age",headerName:"Max age",width:85,align:"center",headerAlign:"center",renderCell:e=>ue(e,"max_age")},{field:"min_height",headerName:"Min height",align:"center",headerAlign:"center",width:h!==null&&h>=0||h=="newCharacter"||(Le=(Be=d.values.characterList)==null?void 0:Be.filter(e=>!e.id))!=null&&Le.length?260:90,renderCell:tt},{field:"lock",headerName:"Locked talent",width:150,align:"center",headerAlign:"center",renderCell:e=>{var i,n,l,o,s,x,j,w;return(i=e==null?void 0:e.row)!=null&&i.offeredTalent&&((l=(n=e==null?void 0:e.row)==null?void 0:n.offeredTalent)==null?void 0:l.length)!==0?t.jsx("div",{className:"flex gap-2 flex-wrap py-2 w-full ",children:(s=(o=e==null?void 0:e.row)==null?void 0:o.offeredTalent)==null?void 0:s.map(u=>{var R,M,G,J,Y;return t.jsxs("div",{className:"flex justify-center items-center gap-2 w-full",children:[t.jsx("div",{className:"w-1/4",style:{height:50,width:50},children:t.jsx("img",{src:(M=(R=u==null?void 0:u.userData)==null?void 0:R.gallaryData)==null?void 0:M.file_url,alt:`${(G=u==null?void 0:u.userData)==null?void 0:G.first_name}-image`,style:{width:"100%",height:"100%",objectFit:"contain"},className:"cursor-pointer",onClick:()=>{var K;window.open(`/talent/${(K=u==null?void 0:u.userData)==null?void 0:K.userUniqueId}`,"_blank")}})}),t.jsx("p",{className:"w-3/4 whitespace-nowrap overflow-hidden overflow-ellipsis lockedText",children:(J=u==null?void 0:u.userData)==null?void 0:J.first_name})]},(Y=u==null?void 0:u.userData)==null?void 0:Y.userUniqueId)})}):t.jsx("div",{className:"flex justify-center items-center gap-4",children:(x=e.row)!=null&&x.character_name?t.jsx(P,{title:"Locked talent will show up here",placement:"top",children:t.jsx("div",{className:"LockedTalentCard",children:(w=(j=e.row)==null?void 0:j.character_name)==null?void 0:w.slice(0,1)})}):t.jsx("p",{className:"characterTableText text-center",children:"---"})})}},{field:"audition",headerName:"Job Posting",width:135,align:"center",headerAlign:"center",renderCell:nt},{field:"find",headerName:"Shortlisted",width:90,align:"center",headerAlign:"center",renderCell:e=>{var i,n,l,o;return t.jsx("strong",{className:"w-full flex justify-center",children:(i=e==null?void 0:e.row)!=null&&i.id&&!g&&((n=e==null?void 0:e.row)==null?void 0:n.isDeleted)===!1?t.jsx(P,{title:"View Shortlist",placement:"top",children:t.jsx(V,{"aria-label":"favorite",style:{padding:2,fontSize:"1.6em"},color:"#FFFFFF",onClick:()=>{ie("/app/short-list",{state:e.row.id}),window.scrollTo(0,0)},children:t.jsx("p",{style:{color:"#9B26B6",fontSize:16,fontWeight:600},children:((o=(l=e==null?void 0:e.row)==null?void 0:l.recruiterShortlist)==null?void 0:o.length)??0})})}):t.jsx("p",{className:"characterTableText",children:"---"})})}},{field:"action",headerName:"Actions",width:80,align:"center",headerAlign:"center",renderCell:rt}],ot=e=>{var i,n;return((n=(i=e==null?void 0:e.model)==null?void 0:i.offeredTalent)==null?void 0:n.length)>0?"auto":70},st=()=>g?null:h=="newCharacter"?t.jsx(P,{title:"Only one character can be edited at a time",placement:"top",style:{width:"fit-content"},children:t.jsx("div",{className:"disable_pattern",children:t.jsx(U,{text:"Add a character",disableBtn:!0})})}):b?t.jsx(U,{text:"Add a character",disableBtn:!0}):t.jsx(U,{text:"Add a character",onClick:Se,white:!0,style:{height:"fit-content"},disabled:h!==null&&h>=0}),ct=()=>{var n;const e=(n=d.values.characterList.filter(l=>!l.id))==null?void 0:n.length,i=h!==null&&h>=0;return t.jsx(U,{text:"Save",onClick:d.handleSubmit,className:!e||!d.isValid?"opacity-50":"",disabled:!e||i,isLoading:H})};return console.log("formik.errors",d.errors),te===!1?t.jsxs("div",{className:"mt-7 mt_8",children:[t.jsxs("div",{className:"create_card p-10 paddingreduce1 ",children:[t.jsxs("div",{className:"w-full flex justify-between with100p justify_content",children:[t.jsxs("div",{className:"justify_content_tags",children:[L&&t.jsx("p",{className:"character_title",children:r==null?void 0:r.project_title}),L&&t.jsx("p",{className:"character_sub_title",children:"Character Library"}),!L&&!g&&t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"character_sub_title",children:["Character Library for project ",r==null?void 0:r.project_title]}),t.jsx("p",{className:"character_sub_toolText mt-1",children:"Add/view characters in the project"})]})]}),t.jsx("div",{className:"flex gap-4",children:st()})]}),t.jsx("div",{style:{height:((Ie=d.values.characterList)==null?void 0:Ie.length)>5?`${((Te=d.values.characterList)==null?void 0:Te.length)*80}px`:((Pe=d.values.characterList)==null?void 0:Pe.length)>2?`${(($e=d.values.characterList)==null?void 0:$e.length)*80+100}px`:"50vh",width:"100%",maxHeight:"400px"},className:"mt-6 characterTable_dropdown",id:"Character_table",children:t.jsx(mt,{className:"form_scroll",hideFooter:!0,hideFooterPagination:!0,paginationMode:"server",rows:(ze=d.values.characterList)==null?void 0:ze.map((e,i)=>
1({...e,index_sno:i+1})),columns:lt,rowHeight:70,getRowHeight:ot,autoWidth:!0,getRowId:e=>e.id?e.id:e.index_sno?e.index_sno:e.index?e.index:0,disableColumnMenu:!0,localeText:{noRowsLabel:'Click on "Add a Character" above to start populating the Character Library.'}})})]}),!g&&t.jsxs("div",{className:"flex justify-between mt-8 saveNext",children:[L?t.jsx(Ce,{text:"Back",onClick:()=>{_&&_(0),window.scrollTo(0,0)},disabled:h!==null&&h>=0}):t.jsx("p",{}),t.jsx("div",{className:"flex gap-4 Save_vx",children:ct()})]}),t.jsxs(fe,{open:k==null?void 0:k.isOpen,fullWidth:!0,maxWidth:"sm",id:"characterDelete",onClose:()=>$(e=>({...e,isOpen:!1})),children:[t.jsxs(_e,{align:"center",children:[t.jsx("h2",{className:"title mt-4",children:"Are your sure?"}),t.jsxs("p",{className:"instruction mt-3",children:["Are you sure you want to remove"," ",t.jsxs("b",{children:[(Re=(Ae=k==null?void 0:k.data)==null?void 0:Ae.character)==null?void 0:Re.character_name," character "]}),"from the Character Library"]})]}),t.jsxs(we,{className:"gap-2",style:{padding:"15px 2.3rem 25px"},children:[t.jsx(Ce,{text:"Cancel",onClick:()=>{$(e=>({...e,isOpen:!1}))},disabled:X}),t.jsx(U,{text:"Yes, Remove",deleteBtn:!0,onClick:()=>{var e,i;ke((i=(e=k==null?void 0:k.data)==null?void 0:e.character)==null?void 0:i.id)},isLoading:X})]})]}),t.jsxs(fe,{className:"NewPopupClassClose",open:f,fullWidth:!0,maxWidth:"xs",id:"characterDelete",onClose:()=>z(!1),children:[t.jsxs(_e,{align:"center",children:[t.jsx("h2",{className:"title mt-4",children:"Confirmation"}),t.jsx("p",{className:"instruction mt-3",children:"Details have been saved."})]}),t.jsxs(we,{className:"gap-3",style:{padding:"15px 2.3rem 25px",justifyContent:"center"},children:[t.jsx(U,{gray:!0,text:"Add more",onClick:e=>{Se(),z(!1)},style:{width:"140px"}}),t.jsx(U,{text:"Find talents",onClick:()=>{ie("/find-talents"),window.scrollTo(0,0),z(!1)}})]}),t.jsx("span",{className:"phot_close__icon",onClick:()=>z(!1),children:t.jsx(xt,{})})]})]}):t.jsx(gt,{})},Mt=({isLoading:_,onClick:r})=>t.jsxs("div",{className:"relative",children:[t.jsx(V,{onClick:r,disabled:_,children:!_&&t.jsx(Ge,{fontSize:"inherit",sx:{color:"#9B26B6"}})}),_&&t.jsx(Ue,{size:18,sx:{color:"#9B26B6"}})]}),gi=()=>{const{user:_}=a.useContext(be),r=qe(),{state:L}=_t(),[g,q]=a.useState(!1),[v,h]=a.useState(0),[B,X]=a.useState(!1),[y,k]=a.useState(null),$=["Create project","Add character"];Ve("div")(({theme:N,ownerState:A})=>({backgroundColor:N.palette.mode==="dark"?N.palette.grey[700]:"#C97FD8",zIndex:1,color:"#fff",width:50,height:50,display:"flex",borderRadius:"50%",justifyContent:"center",alignItems:"center",...A.active&&{backgroundColor:"#9B26B6",boxShadow:"0 4px 10px 0 rgba(0,0,0,.25)"},...A.completed&&{backgroundColor:"#9B26B6"}}));const H=Ve(Tt)(({theme:N})=>({[`&.${D.alternativeLabel}`]:{top:12},[`&.${D.active}`]:{[`& .${D.line}`]:{backgroundColor:"#9B26B6"}},[`&.${D.completed}`]:{[`& .${D.line}`]:{backgroundColor:"#9B26B6"}},[`& .${D.line}`]:{height:3,border:0,backgroundColor:N.palette.mode==="dark"?N.palette.grey[800]:"#C97FD8",borderRadius:1,margin:"0 13px"}}));C.bool,C.bool,C.string,C.oneOfType([C.string,C.number]).isRequired,a.useEffect(()=>{var N;_&&!((N=_==null?void 0:_.recruiter)!=null&&N.is_profile_creation_completed)&&r(`/app/recruiter-form/${_==null?void 0:_.userUniqueId}`)},[_,r]),a.useEffect(()=>{L!=null&&L.isCreated&&q(!0)},[L]),a.useEffect(()=>{window.scrollTo(0,0)},[v]);const{setGlobalValue:T}=a.useContext(wt),f=()=>{T(`${v===1?"Add character details":"Create new project"}`)};a.useEffect(()=>{f()},[v]);const z=N=>{r("/app/my-projects",{state:{project_id:N,isNewProject:!0}}),window.scrollTo(0,0)};return a.useEffect(()=>{v===1&&(y!=null&&y.id)&&window.innerWidth<=768&&z(y.id)},[v,y]),t.jsxs(t.Fragment,{children:[!g&&t.jsx(Ct,{setisCreated:q}),g&&t.jsxs("div",{children:[t.jsx("section",{className:"top_profile_section",style:{backgroundColor:"#E5E5E5"},children:t.jsx("div",{className:"container mx-auto px-6",children:t.jsxs(xe.Row,{className:"flex flex-row",children:[t.jsx(xe.Col,{lg:6,md:6,xs:12,sm:6,className:"header_left mobilemenuhidden",children:t.jsx("div",{className:"top_title",children:t.jsx("h2",{children:v===1?"Add character details":"Create new project"})})}),t.jsx(xe.Col,{lg:6,md:6,xs:12,sm:6,children:t.jsx(It,{})})]})})}),t.jsx("section",{className:"middle_section",children:t.jsxs("div",{className:"container mx-auto",children:[t.jsx("div",{className:"flex justify-center",children:t.jsx(At,{sx:{width:"50%"}
1,spacing:4,className:"stepper__icon__contianer createProject",children:t.jsx(Pt,{alternativeLabel:!0,activeStep:v,connector:t.jsx(H,{}),children:$.map((N,A)=>t.jsx($t,{children:t.jsx(zt,{StepIconProps:{sx:{color:"#C97FD8","&.Mui-active":{color:"#9B26B6"},"&.Mui-completed":{color:"#9B26B6"}}},children:t.jsx("p",{className:`character_label ${v===A?"character_label_active":v>A?"character_label_completed":"character_label_inactive"}`,children:N})})},N))})})}),t.jsx("div",{className:"md:px-24",children:v===0&&t.jsx(je,{setCreatePopup:X,setProjectDetails:k,setisCreated:q,projectDetails:v===0&&(y!=null&&y.id)?y:null,setGoForms:h,isCreatedFromMyproject:(L==null?void 0:L.isCreated)??!1})}),v===1&&t.jsx("div",{className:"DisplayNone",children:t.jsx(Rt,{projectDetails:y,setGoForms:h})})]})}),t.jsx(Je,{openDialog:B,projectName:y==null?void 0:y.project_title,handleSubmit:()=>{h(1),X(!1)}})]})]})};export{gi as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.