1import{j as e}from"./vendor-ui-Hsg1kGQw.js";import{g as E,f as R,r as o}from"./vendor-router-QNN5nd0Y.js";import{u as O}from"./vendor-redux-ziYH1vSe.js";import{u as W,C as d,o as M,n as b,s as l,a as X}from"./vendor-forms-Da2lDe12.js";import{U as c}from"./index.module-Cgj_rIfB.js";import{a as z,S as G}from"./zod-D3yZk1Dc.js";import{B as g}from"./button-kytu7P-0.js";import{I as f}from"./input-u0QlJlCt.js";import{T as u}from"./textarea-D3MsJ_Ly.js";import{S as j,a as w,b as v,c as N,d as y}from"./select-lYgwlQYL.js";import{L as Y}from"./LocationSelector-DAiCA_90.js";import{u as H,p as J,q as K,b as Q,d as Z,t as S}from"./index-y0_2tu7B.js";import{u as _,C as I}from"./command-DZe_mn0H.js";import{B as ee}from"./badge-BkvR1cpg.js";import{m as se,X as te,F as ae,u as re,L as ie,v as le}from"./vendor-utils-C78z1f8K.js";import"./vendor-react-Cgg2GOmP.js";import"./dialog-CFKtZWC_.js";import"./hooks-Bn33xhEY.js";const oe=M({name:l().min(1,"Business Name is required"),website:l().min(1,"Website is required").url("Invalid URL"),industries:X(l()).min(1,"At least one industry is required"),foundedAt:l().optional(),description:l().optional(),twitter:l().optional(),linkedIn:l().optional(),instagram:l().optional(),facebook:l().optional(),valueProposition:l().optional(),targetAudience:l().optional(),problemSolved:l().optional(),businessDetails:l().optional(),additionalInfo:l().optional(),businessType:l().optional(),countryId:b().nullable().optional(),stateId:b().nullable().optional()}),ke=()=>{const{id:n}=E(),x=R(),k=O(),{isDark:a}=H(),{categories:$}=_(),[m,h]=o.useState(!1),[A,C]=o.useState([]),[p,B]=o.useState(null),[V,T]=o.useState(null),[D,F]=o.useState(null),[L,P]=o.useState(!1),t=W({resolver:z(oe),defaultValues:{name:"",website:"",industries:[],foundedAt:new Date().toISOString().split("T")[0],description:"",twitter:"",linkedIn:"",instagram:"",facebook:"",valueProposition:"",targetAudience:"",problemSolved:"",businessDetails:"",additionalInfo:"",businessType:"",countryId:null,stateId:null}});o.useEffect(()=>{(async()=>{if(n)try{const i=await J();C(i);const r=await K(n);P(r.name==="New Startup"),t.reset({name:r.name||"",website:r.website||"",industries:r.industries||[],description:r.description||"",foundedAt:r.foundedAt?r.foundedAt.split("T")[0]:new Date().toISOString().split("T")[0],twitter:r.twitter||"",linkedIn:r.linkedIn||"",instagram:r.instagram||"",facebook:r.facebook||"",valueProposition:r.valueProposition||"",targetAudience:r.targetAudience||"",problemSolved:r.problemSolved||"",businessDetails:r.businessDetails||"",additionalInfo:r.additionalInfo||"",businessType:r.businessType||"",countryId:r.countryId||null,stateId:r.stateId||null}),r.logoUrl&&F(r.logoUrl)}catch(i){console.error("Failed to load data",i)}})()},[n,t]);const U=s=>{B(s);const i=new FileReader;i.onloadend=()=>{T(i.result)},i.readAsDataURL(s)},q=async s=>{if(n){h(!0);try{const i=new Date(s.foundedAt||new Date).toISOString();await k(Q({id:n,data:{name:s.name,description:s.description||"",industries:s.industries,website:s.website,foundedAt:i,businessType:s.businessType,twitter:s.twitter?.trim()||null,linkedIn:s.linkedIn?.trim()||null,instagram:s.instagram?.trim()||null,facebook:s.facebook?.trim()||null,valueProposition:s.valueProposition?.trim()||null,targetAudience:s.targetAudience?.trim()||null,problemSolved:s.problemSolved?.trim()||null,businessDetails:s.businessDetails?.trim()||null,additionalInfo:s.additionalInfo?.trim()||null,countryId:s.countryId,stateId:s.stateId}})).unwrap(),p&&await Z(n,p),S.success("Business updated successfully!"),x("/dashboard/my-startups")}catch(i){S.error(typeof i=="string"?i:"Failed to update"),console.error(i)}finally{h(!1)}}};return e.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-8",children:[e.jsx("h1",{className:"text-xl font-bold mb-2",children:"Complete Your Business Profile"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:"Please provide additional details about your business."}),e.jsx("div",{className:`p-6 rounded-2xl border ${a?"bg-card border-border/50":"bg-white border-slate-200"}`,children:e.jsxs("form",{onSubmit:t.handleSubmit(q),className:"space-y-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-2 border-b border-dashed border-gray-200 dark:border-white/10",children:[e.jsx("div",{className:`p-1.5 rounded-lg ${a?"bg-blue-500/20 text-blue-400":"bg-blue-50 text-blue-600"}`,children:e.jsx(se,{className:"h-4 w-4"})}),e.jsx("h3",{className:`text-sm font-bold ${a?"text-gray-200":"text-slate-700"}`,children:"General Information"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col items-center sm:items-start gap-4",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Logo"}),e.jsx(G,{onFileSelect:U,previewUrl:V,currentLogoUrl:D})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:["Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx(f,{...t.register("name"),disabled:!L,placeholder:"e.g. Acme Corp",className:`h-11 rounded-xl focus-visible:ring-0 focus-visible:ring-offset-0 ${a?"bg-white/5 border-white/10":"bg-white"} ${t.formState.errors.name?"border-red-500":""}`}),t.formState.errors.name&&e.jsx("p",{className:"text-xs text-red-500 font-medium",children:t.formState.errors.name.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:["Website ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx(d,{name:"website",control:t.control,render:({field:s})=>e.jsx(c,{...s,placeholder:"yourbusiness.com"})}),t.formState.errors.website&&e.jsx("p",{className:"text-xs text-red-500 font-medium",children:t.formState.errors.website.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:["Industries ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs(j,{value:"",onValueChange:s=>{const i=t.getValues("industries")||[];i.includes(s)||t.setValue("industries",[...i,s],{shouldValidate:!0})},children:[e.jsx(w,{className:`h-11 rounded-xl shadow-none focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0 ${a?"bg-white/5 border-white/10 text-white":"bg-white border-slate-200"} ${t.formState.errors.industries?"border-red-500":""}`,children:e.jsx(v,{placeholder:"Add industry..."})}),e.jsx(N,{children:A.filter(s=>!t.watch("industries")?.includes(s)).map(s=>e.jsx(y,{value:s,children:s},s))})]}),e.jsx("div",{className:`flex flex-wrap gap-2 mb-2 p-2 rounded-xl border min-h-[44px] ${a?"bg-white/5 border-white/10":"bg-slate-50 border-slate-200"}`,children:t.watch("industries")?.length>0?t.watch("industries").map(s=>e.jsxs(ee,{variant:"secondary",className:"gap-1 h-7 rounded-lg",children:[s,e.jsx(te,{className:"h-3 w-3 cursor-pointer hover:text-red-500 transition-colors",onClick:()=>{const i=t.getValues("industries");t.setValue("industries",i.filter(r=>r!==s),{shouldValidate:!0})}})]},s)):e.jsx("span",{className:"text-xs text-muted-foreground self-center px-1",children:"No industries selected"})}),t.formState.errors.industries&&e.jsx("p",{className:"text-xs text-red-500 font-medium",children:t.formState.errors.industries.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Founded Date"}),e.jsx(f,{...t.register("foundedAt"),type:"date",className:`h-11 rounded-xl focus-visible:ring-0 focus-visible:ring-offset-0 ${a?"bg-white/5 border-white/10":"bg-white"}`})]})]}),e.jsx("div",{className:"space-y-2",children:e.jsx(Y,{selectedCountryId:t.watch("countryId"),selectedStateId:t.watch("stateId"),onCountryChange:s=>{t.setValue("countryId",s.id),t.setValue("stateId",null)},onStateChange:s=>{t.setValue("stateId",s.id)}})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-2 border-b border-dashed border-gray-200 dark:border-white/10",children:[e.jsx("div",{className:`p-1.5 rounded-lg ${a?"bg-purple-500/20 text-purple-400":"bg-purple-50 text-purple-600"}`,children:e.jsx(ae,{className:"h-4 w-4"})}),e.jsx("h3",{className:`text-sm font-bold ${a?"text-gray-200":"text-slate-700"}`,children:"Business Details"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Description"}),e.jsx(u,{...t.register("description"),placeholder:"Tell us about your business...",className:`flex w-full rounded-xl border bg-transparent px-3 py-2 text-sm shadow-none placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 min-h-[120px] resize-none ${a?"bg-white/5 border-white/10 text-white":"bg-white border-slate-200"} ${t.formState.errors.description?"border-red-500":""}`})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t.watch("businessType")!=="eCommerce"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Business Type"}),e.jsx(d,{control:t.control,name:"businessType",render:({field:s})=>e.jsxs(j,{value:s.value||void 0,onValueChange:s.onChange,children:[e.jsx(w,{className:`h-11 rounded-xl shadow-none focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0 ${a?"bg-white/5 border-white/10 text-white":"bg-white border-slate-200"}`,children:e.jsx(v,{placeholder:"Select Type..."})}),e.jsx(N,{children:$.map(i=>e.jsx(y,{value:i.name,children:i.name},i.id))})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Target Audience"}),e.jsxs("div",{className:"flex gap-6 h-11 items-center px-1",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(I,{id:"audience-b2b",checked:t.watch("targetAudience")==="B2B",onCheckedChange:s=>{s?t.setValue("targetAudience","B2B",{shouldValidate:!0}):t.getValues("targetAudience")==="B2B"&&t.setValue("targetAudience","",{shouldValidate:!0})},className:a?"border-white/20 data-[state=checked]:bg-indigo-500 data-[state=checked]:border-indigo-500":"border-slate-300 data-[state=checked]:bg-indigo-600 data-[state=checked]:border-indigo-600"}),e.jsx("label",{htmlFor:"audience-b2b",className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 ${a?"text-white":"text-slate-700"}`,children:"B2B"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(I,{id:"audience-b2c",checked:t.watch("targetAudience")==="B2C",onCheckedChange:s=>{s?t.setValue("targetAudience","B2C",{shouldValidate:!0}):t.getValues("targetAudience")==="B2C"&&t.setValue("targetAudience","",{shouldValidate:!0})},className:a?"border-white/20 data-[state=checked]:bg-indigo-500 data-[state=checked]:border-indigo-500":"border-slate-300 data-[state=checked]:bg-indigo-600 data-[state=checked]:border-indigo-600"}),e.jsx("label",{htmlFor:"audience-b2c",className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 ${a?"text-white":"text-slate-700"}`,children:"B2C"})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Value Proposition"}),e.jsx(u,{...t.register("valueProposition"),placeholder:"What unique value do you offer?",className:`min-h-[120px] rounded-xl focus-visible:ring-0 focus-visible:ring-offset-0 ${a?"bg-white/5 border-white/10 text-white":"bg-white"}`})]}),t.watch("businessType")!=="Shopify Store"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Problem Solved"}),e.jsx(u,{...t.register("problemSolved"),placeholder:"What problem do you solve?",className:`min-h-[120px] rounded-xl focus-visible:ring-0 focus-visible:ring-offset-0 ${a?"bg-white/5 border-white/10 text-white":"bg-white"}`})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t.watch("businessType")!=="Shopify Store"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Business Model Details"}
1),e.jsx(u,{...t.register("businessDetails"),placeholder:"Business model, pricing, revenue streams, etc.",className:`min-h-[120px] rounded-xl focus-visible:ring-0 focus-visible:ring-offset-0 ${a?"bg-white/5 border-white/10 text-white":"bg-white"}`})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Additional Info"}),e.jsx(u,{...t.register("additionalInfo"),placeholder:"Any other relevant information (e.g. press coverage, awards)",className:`min-h-[120px] rounded-xl focus-visible:ring-0 focus-visible:ring-offset-0 ${a?"bg-white/5 border-white/10 text-white":"bg-white"}`})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-2 border-b border-dashed border-gray-200 dark:border-white/10",children:[e.jsx("div",{className:`p-1.5 rounded-lg ${a?"bg-pink-500/20 text-pink-400":"bg-pink-50 text-pink-600"}`,children:e.jsx(re,{className:"h-4 w-4"})}),e.jsx("h3",{className:`text-sm font-bold ${a?"text-gray-200":"text-slate-700"}`,children:"Social Media"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Twitter / X"}),e.jsx(d,{name:"twitter",control:t.control,render:({field:s})=>e.jsx(c,{...s,placeholder:"twitter.com/..."})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"LinkedIn"}),e.jsx(d,{name:"linkedIn",control:t.control,render:({field:s})=>e.jsx(c,{...s,placeholder:"linkedin.com/on/..."})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Instagram"}),e.jsx(d,{name:"instagram",control:t.control,render:({field:s})=>e.jsx(c,{...s,placeholder:"instagram.com/..."})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:`text-xs font-medium ${a?"text-gray-400":"text-slate-500"}`,children:"Facebook"}),e.jsx(d,{name:"facebook",control:t.control,render:({field:s})=>e.jsx(c,{...s,placeholder:"facebook.com/..."})})]})]})]}),e.jsxs("div",{className:"pt-4 flex justify-end gap-4",children:[e.jsx(g,{type:"button",variant:"secondary",onClick:()=>x("/dashboard/my-startups"),disabled:m,className:"border border-slate-200 dark:border-slate-700 shadow-none",children:"Skip"}),e.jsx(g,{type:"submit",disabled:m,className:"bg-indigo-600 hover:bg-indigo-700 text-white min-w-[150px]",children:m?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:["Complete Setup",e.jsx(le,{className:"ml-2 h-4 w-4"})]})})]})]})})]})};export{ke 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.