1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9127],{9127:function(e,a,l){l.r(a),l.d(a,{default:function(){return w},useDisclosure:function(){return d.q}});var s=l(57437),i=l(2265),t=l(9015),n=l(90766),r=l(20831),d=l(25686),c=l(96562),o=l(5538),m=l(82960),u=l(14714),f=l(33714),h=l(72717),x=l(59373),p=l(60229),j=l(95327),g=l(60303),N=l(98837),v=l(63657),b=l(46166);function w(e){let{session:a}=(0,f.kP)(),[l,d]=(0,o.VI)(),[w,y]=(0,i.useState)(!1),[k,C]=(0,i.useState)(""),[S,P]=(0,i.useState)(""),[I,E]=(0,i.useState)(""),[Z,O]=(0,i.useState)(""),[V,R]=(0,i.useState)(""),[z,A]=(0,i.useState)(""),[F,M]=(0,i.useState)(""),[T,Y]=(0,i.useState)(""),[D,J]=(0,i.useState)(""),[L,Q]=(0,i.useState)(!1);async function _(s){if("inactive"==a.user.status){l(v.lQ.NoPermission,"Inactive users cannot generate new prospects");return}if(!L&&!I.trim()){l(v.lQ.MissingArguments,"You must specify a company name when using Magic Mode");return}y(!0);try{let i;if(!L){C("Researching "+I+"...");let e=await N.Z.post("/api/gen/research",{companyName:I,magicMode:!0,jobTitle:S});if(!(i=function(e){var a,l,s;if(!e||e.status<200||e.status>=300||e.error||(null===(a=e.json)||void 0===a?void 0:a.error))return;let i=null===(l=e.json)||void 0===l?void 0:l.personas;if(Array.isArray(i))return null===(s=i.find(e=>"string"==typeof e&&e.trim().length>0&&"unknown"!==e.trim().toLowerCase()))||void 0===s?void 0:s.trim()}(e))){l(v.lQ.FetchFailed,"Company research did not return a usable persona. Please try again, or use Precision mode to enter the details yourself.");return}}let t=await (0,p.hJ)({jobTitle:S,industry:Z,companySize:V,yearsOfExperience:z,nationality:F,ethnicity:T,additionalInfo:D,difficulty:(0,m.C0)("difficulty"),prompt:i},a.user,!1,C);if(t.error&&(l(t.error,t.errorMessage),!t.id))return;e.refreshState&&await e.refreshState(t),s()}catch(e){l(v.lQ.GenerationFailed,"Unable to complete prospect creation. Please try again.")}finally{y(!1),C("")}}return(0,i.useEffect)(()=>{e.isOpen&&(C(""),y(!1),P(""),E(""),O(""),R(""),A(""),M(""),J(""))},[e.isOpen]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d,{}),(0,s.jsx)(b.ZP,{isOpen:e.isOpen,onClose:()=>e.onOpenChange(!1),size:"2xl",children:(0,s.jsx)(t.A,{children:e=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.b9,{helpSlug:"new-prospects",description:"Create a realistic conversation partner for the skills you want to practice.",children:"Create a prospect"}),(0,s.jsxs)(n.I,{children:[(0,s.jsx)("div",{role:"group","aria-label":"Prospect creation mode",className:"grid grid-cols-2 gap-2 rounded-2xl bg-slate-100 p-1.5 dark:bg-white/5",children:[!1,!0].map(e=>(0,s.jsxs)("button",{type:"button",disabled:w,"aria-pressed":L===e,onClick:()=>Q(e),className:"rounded-xl border p-3 text-left transition-colors ".concat(L===e?"border-blue-200 bg-white shadow-sm dark:border-blue-500/30 dark:bg-blue-500/10":"border-transparent text-slate-500 hover:bg-white/50 dark:text-slate-400 dark:hover:bg-white/5"),children:[(0,s.jsx)("span",{className:"block text-sm font-semibold",children:e?"Precision mode":"Magic mode"}),(0,s.jsx)("span",{className:"mt-1 block text-xs font-normal leading-relaxed",children:e?"Customize the background and details":"Start with a role and target company"})]},String(e)))}),(0,s.jsxs)("div",{className:"grid gap-5 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:"modal-field",children:[(0,s.jsx)("div",{className:"modal-field-label",children:"Job Title:"}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 w-full",children:[(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(x.y,{name:"jobTitle",placeholder:"Pick Randomly",className:"w-full",items:p.Nt,inputValue:S,onInputChange:P})}),(0,s.jsx)("div",{className:"hidden sm:block",children:(0,s.jsx)(j.Z,{text:"You can type any value into the Job Title field"})})]})]}),L&&(0,s.jsxs)("div",{className:"modal-field",children:[(0,s.jsx)("div",{className:"modal-field-label",children:"Industry:"}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 w-full",children:[(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(x.y,{name:"industry",placeholder:"Pick Randomly",className:"w-full",items:p.n$,inputValue:Z,onInputChange:O})}),(0,s.jsx)("div",{className:"hidden sm:block",children:(0,s.jsx)(j.Z,{text:"You can type any value into the Industry field"})})]})]}),L&&(0,s.jsxs)("div",{className:"modal-field",children:[(0,s.jsx)("div",{className:"modal-field-label",children:"Company Size:"}),(0,s.jsx)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 w-full",children:(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(h.S,{name:"companySize",placeholder:"Pick Randomly",className:"w-full",items:p.ZJ,setValue:e=>R(null!=e?e:"")}
1)})})]}),L&&(0,s.jsxs)("div",{className:"modal-field",children:[(0,s.jsx)("div",{className:"modal-field-label",children:"Years of Experience:"}),(0,s.jsx)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 w-full",children:(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(h.S,{name:"yearsOfExperience",placeholder:"Pick Randomly",className:"w-full",items:p.c5,setValue:e=>A(null!=e?e:"")})})})]}),L&&(0,s.jsxs)("div",{className:"modal-field",children:[(0,s.jsx)("div",{className:"modal-field-label",children:"Nationality:"}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 w-full",children:[(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(x.y,{name:"nationality",placeholder:"Pick Randomly",className:"w-full",items:p.fP,inputValue:F,onInputChange:M})}),(0,s.jsx)("div",{className:"hidden sm:block",children:(0,s.jsx)(j.Z,{text:"You can type any value into the Nationality field"})})]})]}),L&&(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4",children:[(0,s.jsx)("label",{htmlFor:"ethnicity",className:"text-sm sm:text-right sm:min-w-40",children:"Ethnicity / heritage:"}),(0,s.jsx)("div",{className:"w-full sm:w-80",children:(0,s.jsx)(g.Z,{name:"ethnicity",id:"ethnicity",value:T,onChange:e=>Y(e.target.value),placeholder:"Optional; separate from nationality"})})]}),(0,s.jsxs)("div",{className:"modal-field",children:[(0,s.jsx)("div",{className:"modal-field-label",children:"Difficulty Level:"}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 w-full",children:[(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(h.S,{name:"difficulty",placeholder:"Difficulty Level",className:"w-full",selected:"Normal",items:p.Db,disallowEmptySelection:!0})}),(0,s.jsx)("div",{className:"hidden sm:block",children:(0,s.jsx)(j.Z,{text:["Easy prospects are more collaborative and helpful","whereas hard prospects are more terse and skeptical"]})})]})]}),!L&&(0,s.jsxs)("div",{className:"modal-field",children:[(0,s.jsx)("div",{className:"modal-field-label",children:"Company Name:"}),(0,s.jsx)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 w-full",children:(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(g.Z,{id:"companyName",name:"companyName","aria-label":"Company Name",disabled:w,placeholder:"Enter a company name",className:"w-full",value:I,onChange:e=>E(e.target.value)})})})]}),L&&(0,s.jsxs)("div",{className:"modal-field sm:col-span-2",children:[(0,s.jsx)("div",{className:"modal-field-label",children:"Additional Information:"}),(0,s.jsx)("div",{className:"w-full sm:max-w-2xl",children:(0,s.jsx)(u.Z,{id:"additionalInfo",name:"additionalInfo","aria-label":"Additional Info",rows:2,disabled:w,placeholder:"Optional further background",className:"w-full",value:D,onChange:e=>J(e.target.value)})})]})]})]}),(0,s.jsxs)(r.R,{className:"flex items-center mt-4",children:[(0,s.jsx)("div",{role:"status","aria-live":"polite",className:"grow text-xs text-slate-500 dark:text-slate-400",children:k}),(0,s.jsx)(c.Lw,{onPress:e,disabled:w,title:"Cancel"}),(0,s.jsx)(c.Kk,{disabled:w,onPress:async()=>await _(e),title:"Generate",className:"sm:hidden",icon:"adduser"}),(0,s.jsx)(c.Kk,{disabled:w,onPress:async()=>await _(e),title:"Generate Prospect",className:"hidden sm:flex",icon:"adduser"})]})]})})})]})}},59373:function(e,a,l){l.d(a,{y:function(){return n}});var s=l(57437),i=l(52724),t=l(62126);function n(e){return(0,s.jsx)(i.d,{name:e.name,"aria-label":e.name,inputProps:{classNames:{inputWrapper:"bg-magic-100 border-1 border-magic-300 dark:bg-magic-800 dark:border-magic-700 rounded-xl min-h-11",input:"border-0 pl-0 ring-0 focus-within:ring-0 focus-within:border-0"}},classNames:{base:["min-w-0 w-full",e.className],popoverContent:"dark:bg-magic-900 rounded-lg"},size:"sm",inputValue:e.inputValue,onInputChange:e.onInputChange,allowsCustomValue:!0,placeholder:e.placeholder,children:e.items.map(e=>(0,s.jsx)(t.R,{children:e},e))})}}}]);
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.