PageSourceSearch

https://kopern.ai/_next/static/chunks/59e2ce71570a981f.js?dpl=dpl_5Fg45TmRWFQkKW9jZ15jgdRrEv9E

js kopern.ai collected 2026-10-05 12:23:57 UTC 33,455 bytes, 3 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,410944,e=>{"use strict";function t(e,t){switch(e){case"llm_judge":default:return{rubric:t||"Evaluate the quality, accuracy, and helpfulness of the agent's response.",scoreThreshold:.7};case"output_match":var s;if(t&&!((s=t).length<30)&&/\b(l'agent|the agent|agent should|doit|devrait|invite|signale|demande|responds?|produces?|returns?|outputs?|displays?|shows?|affiche|fournit|propose|génère|indique)\b/i.test(s))return{_fallbackToJudge:!0,rubric:t,scoreThreshold:.7};return{mode:"contains",pattern:t?function(e){if(e.length<50&&!e.includes(","))return[e.trim()];let t=e.split(/[,;]|\band\b|\bor\b|\bet\b|\bou\b/i).map(e=>e.trim()).filter(e=>e.length>2);return t.length>0?t:[e.trim()]}(t):[],caseSensitive:!1};case"tool_usage":return{expectedTools:t?function(e){let t,s=/(?:use|call|invoke|utiliser|appeler)\s+(\w+)/gi,a=[];for(;null!==(t=s.exec(e));)a.push(t[1]);return a}(t):[],ordered:!1,allowExtra:!0};case"schema_validation":return{jsonSchema:{type:"object"}};case"safety_check":return{forbiddenPatterns:[],scanToolCalls:!0};case"custom_script":return{code:`// Auto-generated: check expected behavior
2const output = events.assistantOutput;
3return { passed: output.length > 0, score: output.length > 0 ? 1 : 0, message: output.length > 0 ? "Output produced" : "No output" };`}}}e.s(["buildCriterionConfig",()=>t])},287181,e=>{"use strict";let t=(0,e.i(475254).default)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);e.s(["Pen",()=>t],287181)},788757,e=>{"use strict";var t=e.i(867466),s=e.i(662230),a=e.i(396361),r=e.i(676957),i=e.i(221507),n=e.i(27021),l=e.i(410944);async function o(e,o,c){let d=o.name||"New Agent",m=o.domain||"other",u=o.systemPrompt,p=o.modelProvider||"anthropic",x=o.modelId||"claude-sonnet-4-6",h=o.thinkingLevel||"off",g=o.builtinTools?.length?o.builtinTools:[],f=await (0,t.createAgent)(e,{name:d,description:c??o.rawSpec.slice(0,200),domain:m,systemPrompt:u,modelProvider:p,modelId:x,thinkingLevel:h,builtinTools:g}),j={};if(o.purposeGate&&(j.purposeGate=o.purposeGate),o.tillDone&&(j.tillDone=o.tillDone),o.branding&&(j.branding=o.branding),Object.keys(j).length>0&&await (0,t.updateAgent)(e,f,j),o.skills?.length&&await Promise.all(o.skills.map(t=>(0,s.createSkill)(e,f,{name:t.name,description:t.name,content:t.content}))),o.tools?.length&&await Promise.all(o.tools.map(t=>(0,a.createTool)(e,f,{name:t.name,label:t.name,description:t.description,parametersSchema:t.parametersSchema,executeCode:t.executeCode}))),o.extensions?.length&&await Promise.all(o.extensions.map(t=>(0,r.createExtension)(e,f,{name:t.name,description:t.description,code:t.code,events:t.events??[],blocking:t.blocking??!1}))),o.gradingCases?.length){let t=await (0,i.createGradingSuite)(e,f,{name:`Suite de tests — ${d}`,description:`Tests de qualit\xe9 pour ${d} (${m})`});await Promise.all(o.gradingCases.map((s,a)=>(0,n.createGradingCase)(e,f,t,{name:s.name,inputPrompt:s.input,expectedBehavior:s.expected,orderIndex:a,criteria:[{id:crypto.randomUUID(),type:s.criterionType,name:s.name,config:(0,l.buildCriterionConfig)(s.criterionType,s.expected),weight:1}]})))}return f}e.s(["createAgentFromSpec",()=>o])},846702,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(846932),r=e.i(88653),i=e.i(871689),n=e.i(972520),l=e.i(643531),o=e.i(664659),c=e.i(655900),d=e.i(531278),m=e.i(209912),u=e.i(555436),p=e.i(284765),x=e.i(283086),h=e.i(195116),g=e.i(810980),f=e.i(38982),j=e.i(287181),v=e.i(63209),y=e.i(776639),b=e.i(519455),N=e.i(793479),w=e.i(624687),C=e.i(110204),k=e.i(487486),A=e.i(168148),S=e.i(515288),T=e.i(759684),F=e.i(967489),P=e.i(975157),q=e.i(846696),z=e.i(393429),I=e.i(877787),L=e.i(498022),B=e.i(788757),$=e.i(754338),E=e.i(874394),D=e.i(807088);let R=["🤖","💼","🏠","🍽️","🛒","👥","✂️","💪","⚖️","🔧","📊","🎯","🧠","💡","🌟","🏗️","📱","🎨"],W=[{id:"telegram",label:"Telegram",icon:"✈️",desc:"Bot Telegram automatique",descEn:"Automatic Telegram bot"},{id:"whatsapp",label:"WhatsApp",icon:"💬",desc:"Via WhatsApp Business",descEn:"Via WhatsApp Business"},{id:"widget",label:"Website Widget",icon:"🌐",desc:"Chat sur votre site web",descEn:"Chat embedded on your website"}],O=[{id:"businessName",type:"text",label:"What is your business or brand name?",labelFr:"Quel est le nom de votre entreprise ou marque ?",placeholder:"e.g. Domaine Lafleur",placeholderFr:"ex. Domaine Lafleur",helperText:"This will be your assistant's identity.",helperTextFr:"Ce sera l'identite de votre assistant.",required:!0},{id:"mainTasks",type:"textarea",label:"What should your assistant do? Describe its main tasks.",labelFr:"Que doit faire votre assistant ? Decrivez ses missions principales.",placeholder:"e.g. Answer customer questions about our wines, recommend pairings, handle visit bookings...",placeholderFr:"ex. Repondre aux questions clients sur nos vins, recommander des accords mets-vins, gerer les reservations de visites...",helperText:"Be as specific as possible — this shapes the assistant's behavior.",helperTextFr:"Soyez aussi precis que possible — cela definit le comportement de l'assistant.",required:!0},{id:"targetAudience",type:"text",label:"Who will talk to your assistant?",labelFr:"Qui parlera avec votre assistant ?",placeholder:"e.g. Our clients, wine enthusiasts, tourists",placeholderFr:"ex. Nos clients, amateurs de vin, touristes",helperText:"This helps the assistant adapt its tone and vocabulary.",helperTextFr:"Cela aide l'assistant a adapter son ton et vocabulaire.",required:!0},{id:"tone",type:"select",label:"What tone should the assistant use?",labelFr:"Quel ton doit adopter l'assistant ?",placeholder:"Select a tone",placeholderFr:"Choisissez un ton",helperText:"The personality your customers will experience.",helperTextFr:"La personnalite que vos clients vont ressentir.",required:!0,options:[{value:"professional",label:"Professional & formal",labelFr:"Professionnel & formel"},{value:"friendly",label:"Friendly & approachable",labelFr:"Amical & accessible"},{value:"expert",label:"Expert & authoritative",labelFr:"Expert & autoritaire"},{value:"casual",label:"Casual & relaxed",labelFr:"Decontracte & detendu"},{value:"enthusiastic",label:"Enthusiastic & energetic",labelFr:"Enthousiaste & energique"}]},{id:"specialInstructions",type:"textarea",label:"Any special instructions or constraints?",labelFr:"Des instructions ou contraintes particulieres ?",placeholder:"e.g. Always mention we're organic certified, never discuss competitor prices...",placeholderFr:"ex. Toujours mentionner notre certification bio, ne jamais discuter des prix concurrents...",helperText:"Optional but useful to fine-tune behavior.",helperTextFr:"Optionnel mais utile pour affiner le comportement.",required:!1}],M={enter:{opacity:0,x:40},center:{opacity:1,x:0},exit:{opacity:0,x:-40}};function V({open:e,onOpenChange:w}){let{user:F}=(0,$.useAuth)(),V=(0,E.useLocale)(),Q=(0,D.useLocalizedRouter)(),K="fr"===V,[Y,U]=(0,s.use
3State)("welcome"),[J,H]=(0,s.useState)(null),[X,Z]=(0,s.useState)(!1),[ee,et]=(0,s.useState)(""),[es,ea]=(0,s.useState)({}),[er,ei]=(0,s.useState)(0),[en,el]=(0,s.useState)(""),[eo,ec]=(0,s.useState)("🤖"),[ed,em]=(0,s.useState)("telegram"),[eu,ep]=(0,s.useState)(!1),[ex,eh]=(0,s.useState)(!1),[eg,ef]=(0,s.useState)(""),[ej,ev]=(0,s.useState)(!1),[ey,eb]=(0,s.useState)(""),[eN,ew]=(0,s.useState)(0),[eC,ek]=(0,s.useState)(null),[eA,eS]=(0,s.useState)(null),eT=(0,s.useRef)(null),eF=(0,s.useRef)(null);(0,s.useEffect)(()=>{"generating"===Y&&eF.current&&eF.current.scrollIntoView({behavior:"smooth"})},[ey,Y]);let eP=(0,s.useMemo)(()=>{if(!eg.trim())return z.verticalTemplates;let e=eg.toLowerCase();return z.verticalTemplates.filter(t=>t.titleFr.toLowerCase().includes(e)||t.title.toLowerCase().includes(e)||t.verticalFr.toLowerCase().includes(e)||t.vertical.toLowerCase().includes(e)||t.taglineFr.toLowerCase().includes(e)||t.tagline.toLowerCase().includes(e))},[eg]),eq=X?O:J?.onboardingQuestions??[],ez=eq[er]??null,eI=eq.length,eL=eI>0?(er+1)/eI*100:0,eB=(0,s.useMemo)(()=>
3X?_(ee,es,en,K):J?(0,I.hydratePrompt)(J.systemPromptTemplate,es):"",[X,J,es,ee,en,K]),e$=(0,s.useMemo)(()=>en.trim()?en.trim():X?es.businessName?.trim()||ee.trim()||"":J?(0,I.extractAgentName)(J,es,V):"",[en,X,J,es,ee,V]),eE=(0,s.useMemo)(()=>{let e=["welcome","pick-template","questionnaire","personalize","channel","review"],t=e.indexOf(Y);return"generating"===Y?95:"deploying"===Y?100:t>=0?Math.round((t+1)/e.length*100):100},[Y]),eD=(0,s.useMemo)(()=>{if(!ez)return!1;let e=es[ez.id]?.trim();return!ez.required||!!e},[ez,es]);function eR(){H(null),Z(!0),ea({}),ei(0),el(""),et(eg.trim()),U("questionnaire")}function eW(){er<eI-1?ei(e=>e+1):U("personalize")}async function eO(){if(F&&J){U("deploying");try{let e={...es},t=J.onboardingQuestions.find(e=>"businessName"===e.id||"firmName"===e.id||"agencyName"===e.id||"shopName"===e.id||"companyName"===e.id||"salonName"===e.id||"coachName"===e.id)?.id;t&&en.trim()&&(e[t]=en.trim());let s=[];eu&&s.push("service_email"),ex&&s.push("service_calendar");let a=await (0,L.deployFromTemplate)(F.uid,J,e,V,s.length?s:void 0);q.toast.success(K?"Agent cree avec succes !":"Agent created successfully!"),w(!1),Q.push(`/agents/${a}/operator`)}catch{q.toast.error(K?"Erreur lors de la creation":"Failed to create agent"),U("review")}}}async function eM(){if(!F)return;U("generating"),eb(""),ew(0),ek(null),eS(null);let e=new AbortController;eT.current=e;try{let t=_(ee,es,en,K),s=await fetch("/api/agents/meta-create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,modelProvider:"anthropic",modelId:"claude-sonnet-4-6",userId:F.uid}),signal:e.signal});if(!s.ok){let e=await s.json().catch(()=>({error:"Request failed"}));throw Error(e.error||`HTTP ${s.status}`)}let a=s.body?.getReader();if(!a)throw Error("No response stream");let r=new TextDecoder,i="",n="",l="",o=0,c=null;for(;;){let{done:e,value:t}=await a.read();if(e)break;let s=(i+=r.decode(t,{stream:!0})).split("\n");for(let e of(i=s.pop()||"",s))if(e.startsWith("event: "))l=e.slice(7).trim();else if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6)),s=l;if(l="","token"===s)n+=t.text,o+=1,eb(n),ew(o);else if("spec"===s)c=t,ek(c);else if("done"===s)return void await eV(c,n);else if("error"===s)throw Error("API_KEY_REQUIRED"===t.message?K?"Cle API requise. Ajoutez une cle dans Parametres.":"API key required. Add a key in Settings.":t.message)}catch(e){if(e instanceof SyntaxError)continue;throw e}}n&&await eV(eC,n)}catch(e){if("AbortError"===e.name)return;eS(e.message),U("generating")}}async function eV(e,t){U("deploying");try{let s=e??eC??{name:e$||ee,domain:ee,systemPrompt:t,modelProvider:"anthropic",modelId:"claude-sonnet-4-6",thinkingLevel:"off",builtinTools:[],skills:[],tools:[],extensions:[],gradingCases:[],purposeGate:null,tillDone:null,branding:null,rawSpec:t};en.trim()&&(s.name=en.trim());let a=[];eu&&a.push("service_email"),ex&&a.push("service_calendar"),a.length&&(s.builtinTools=[...s.builtinTools||[],...a]);let r=await (0,B.createAgentFromSpec)(F.uid,s,K?`Assistant IA pour ${ee}`:`AI assistant for ${ee}`);q.toast.success(K?"Agent cree avec succes !":"Agent created successfully!"),w(!1),Q.push(`/agents/${r}/operator`)}catch{q.toast.error(K?"Erreur lors de la creation":"Failed to create agent"),U("review")}}return(0,t.jsx)(y.Dialog,{open:e,onOpenChange:e=>{!e&&eT.current&&eT.current.abort(),w(e)},children:(0,t.jsxs)(y.DialogContent,{className:"w-[calc(100%-2rem)] sm:max-w-2xl max-h-[90vh] overflow-hidden p-0 gap-0 [&>button]:hidden",children:[(0,t.jsx)(y.DialogTitle,{className:"sr-only",children:K?"Assistant de creation":"Creation wizard"}),"welcome"!==Y&&"deploying"!==Y&&(0,t.jsx)("div",{className:"px-6 pt-4",children:(0,t.jsx)(A.Progress,{value:eE,className:"h-1.5"})}),(0,t.jsx)("div",{className:"px-6 pb-6 pt-4 overflow-y-auto max-h-[85vh]",children:(0,t.jsxs)(r.AnimatePresence,{mode:"wait",children:["welcome"===Y&&(0,t.jsxs)(a.motion.div,{variants:M,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3},className:"flex flex-col items-center text-center py-8 space-y-6",children:[(0,t.jsx)(a.motion.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",delay:.2},className:"rounded-full bg-primary/10 p-6",children:(0,t.jsx)(x.Sparkles,{className:"h-12 w-12 text-primary"})}),(0,t.jsxs)(a.motion.div,{initial:{opacity:0,y:20}
3,animate:{opacity:1,y:0},transition:{delay:.4},children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:K?"Bienvenue sur Kopern !":"Welcome to Kopern!"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-2 max-w-md mx-auto",children:K?"Creez votre assistant IA personnalise en 2 minutes. Aucune competence technique requise.":"Create your custom AI assistant in 2 minutes. No technical skills required."})]}),(0,t.jsxs)(a.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.6},className:"flex gap-3",children:[(0,t.jsxs)(b.Button,{size:"lg",onClick:()=>U("pick-template"),children:[K?"C'est parti !":"Let's go!",(0,t.jsx)(n.ArrowRight,{className:"h-4 w-4 ml-2"})]}),(0,t.jsx)(b.Button,{variant:"ghost",size:"lg",onClick:()=>w(!1),children:K?"Plus tard":"Later"})]})]},"welcome"),"pick-template"===Y&&(0,t.jsxs)(a.motion.div,{variants:M,initial:"enter",animate:"center",exit:"exit",transition:{duration:.25},className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold",children:K?"Decrivez votre activite":"Describe your business"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:K?"Tapez votre metier ou choisissez un modele ci-dessous.":"Type your business or pick a template below."})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(u.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(N.Input,{value:eg,onChange:e=>ef(e.target.value),placeholder:K?"ex. Vigneron, Fleuriste, Coach sportif...":"e.g. Winemaker, Florist, Fitness coach...",className:"pl-9 text-base",autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&eg.trim()&&(e.preventDefault(),eR())}})]}),eg.trim()&&(0,t.jsx)(a.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:(0,t.jsxs)("button",{onClick:eR,className:"w-full flex items-center gap-3 rounded-xl border-2 border-dashed border-primary/40 bg-primary/5 p-4 hover:bg-primary/10 transition-all text-left",children:[(0,t.jsx)("div",{className:"rounded-lg p-2 bg-primary/10",children:(0,t.jsx)(j.Pen,{className:"h-5 w-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"font-medium text-sm",children:K?`Creer un assistant "${eg.trim()}"`:`Create a "${eg.trim()}" assistant`}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:K?"L'IA generera un agent complet sur mesure":"AI will generate a complete custom agent"})]}),(0,t.jsx)(n.ArrowRight,{className:"h-4 w-4 text-primary shrink-0"})]})}),(0,t.jsxs)(T.ScrollArea,{className:(0,P.cn)("pr-2",eg.trim()?"h-[300px]":"h-[400px]"),children:[eP.length>0&&eg.trim()&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-2 px-1",children:K?"Ou choisissez un modele :":"Or pick a template:"}),(0,t.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:eP.map((e,s)=>(0,t.jsx)(a.motion.button,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{delay:.05*s},onClick:()=>{H(e),Z(!1),ea({}),ei(0),el(""),em(e.suggestedChannel),U("questionnaire")},className:"group text-left rounded-xl border p-4 hover:border-primary/50 hover:shadow-md transition-all",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:(0,P.cn)("rounded-lg p-2",`bg-${e.color}-500/10`),children:(0,t.jsx)(e.icon,{className:(0,P.cn)("h-5 w-5",`text-${e.color}-500`)})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"font-medium text-sm",children:K?e.titleFr:e.title}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:K?e.taglineFr:e.tagline})]}),(0,t.jsx)(n.ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0 mt-1"})]})},e.slug))}),0===eP.length&&!eg.trim()&&(0,t.jsx)("p",{className:"text-center text-muted-foreground py-12",children:K?"Aucun resultat":"No results"})]}),(0,t.jsxs)(b.Button,{variant:"ghost",size:"sm",onClick:()=>U("welcome"),className:"-ml-2",children:[(0,t.jsx)(i.ArrowLeft,{className:"h-4 w-4 mr-1"}),K?"Retour":"Back"]})]},"pick-template"),"questionnaire"===Y&&ez&&(0,t.jsxs)(a.motion.div,{variants:M,initial:"enter",animate:"center",exit:"exit",transition:{duration:.25},className:"space-y-6",onKeyDown:function(e){"Enter"===e.key&&eD&&ez?.type!=="textarea"&&(e.preventDefault(),eW())},children:[X&&0===er&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-primary",children:[(0,t.jsx)(j.Pen,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"font-medium",children:K?`Assistant pour : ${ee}`:`Assistant for: ${ee}`})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{children:["Question ",er+1,"/",eI]}),(0,t.jsxs)("span",{children:[Math.round(eL),"%"]})]}),(0,t.jsx)(A.Progress,{value:eL,className:"h-2"})]}),(0,t.jsx)(r.AnimatePresence,{mode:"wait",children:(0,t.jsxs)(a.motion.div,{initial:{opacity:0,x:20}
3,animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(C.Label,{className:"text-lg font-medium",children:K?ez.labelFr:ez.label}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:K?ez.helperTextFr:ez.helperText})]}),(0,t.jsx)(G,{question:ez,value:es[ez.id]??"",locale:V,onChange:e=>ea(t=>({...t,[ez.id]:e}))})]},ez.id)}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(b.Button,{variant:"ghost",onClick:function(){er>0?ei(e=>e-1):U("pick-template")},children:[(0,t.jsx)(i.ArrowLeft,{className:"h-4 w-4 mr-1"}),K?"Precedent":"Previous"]}),(0,t.jsxs)(b.Button,{onClick:eW,disabled:!eD,children:[er===eI-1?K?"Continuer":"Continue":K?"Suivant":"Next",(0,t.jsx)(n.ArrowRight,{className:"h-4 w-4 ml-1"})]})]}),(0,t.jsx)("div",{className:"flex justify-center gap-1.5",children:eq.map((e,s)=>(0,t.jsx)("button",{onClick:()=>{(s<=er||es[e.id])&&ei(s)},className:(0,P.cn)("h-2 rounded-full transition-all duration-200",s===er?"w-6 bg-primary":es[e.id]?"w-2 bg-primary/40":"w-2 bg-muted-foreground/20")},e.id))})]},`questionnaire-${ez.id}`),"personalize"===Y&&(0,t.jsxs)(a.motion.div,{variants:M,initial:"enter",animate:"center",exit:"exit",transition:{duration:.25},className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold",children:K?"Personnalisez votre assistant":"Personalize your assistant"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:K?"Donnez-lui un nom et un avatar qui representent votre activite.":"Give it a name and avatar that represent your business."})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(C.Label,{children:K?"Nom de l'assistant":"Assistant name"}),(0,t.jsx)(N.Input,{value:en,onChange:e=>el(e.target.value),placeholder:e$||(K?"Mon Assistant":"My Assistant"),className:"text-base",autoFocus:!0}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:K?"Vos clients verront ce nom quand ils parleront a votre bot.":"Your clients will see this name when chatting with your bot."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(C.Label,{children:"Avatar"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:R.map(e=>(0,t.jsx)("button",{onClick:()=>ec(e),className:(0,P.cn)("h-10 w-10 rounded-lg text-xl flex items-center justify-center transition-all",eo===e?"bg-primary/15 ring-2 ring-primary scale-110":"bg-muted hover:bg-muted/80"),children:e},e))})]}),(0,t.jsx)(S.Card,{className:"bg-muted/50",children:(0,t.jsxs)(S.CardContent,{className:"p-4",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:K?"Apercu":"Preview"}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center text-xl",children:eo}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-sm",children:e$||"..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:X?ee:J?K?J.verticalFr:J.vertical:""})]})]})]})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(b.Button,{variant:"ghost",onClick:()=>{U("questionnaire"),ei(eI-1)},children:[(0,t.jsx)(i.ArrowLeft,{className:"h-4 w-4 mr-1"}),K?"Precedent":"Previous"]}),(0,t.jsxs)(b.Button,{onClick:()=>U("channel"),children:[K?"Choisir le canal":"Choose channel",(0,t.jsx)(n.ArrowRight,{className:"h-4 w-4 ml-1"})]})]})]},"personalize"),"channel"===Y&&(0,t.jsxs)(a.motion.div,{variants:M,initial:"enter",animate:"center",exit:"exit",transition:{duration:.25},className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold",children:K?"Ou deployer votre assistant ?":"Where to deploy your assistant?"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:K?"Vous pourrez en ajouter d'autres plus tard.":"You can add more channels later."})]}),(0,t.jsx)("div",{className:"space-y-3",children:W.map(e=>(0,t.jsxs)("button",{onClick:()=>em(e.id),className:(0,P.cn)("w-full flex items-center gap-4 roun
3ded-xl border p-4 transition-all text-left",ed===e.id?"border-primary bg-primary/5 ring-1 ring-primary":"hover:border-muted-foreground/30"),children:[(0,t.jsx)("span",{className:"text-2xl",children:e.icon}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-medium",children:e.label}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:K?e.desc:e.descEn})]}),ed===e.id&&(0,t.jsx)(l.Check,{className:"h-5 w-5 text-primary"})]},e.id))}),(0,t.jsxs)("div",{className:"space-y-2 pt-2 border-t",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:K?"Services connectes (optionnel)":"Connected services (optional)"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:K?"Vous pourrez les configurer plus tard dans les parametres.":"You can configure these later in settings."}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("button",{onClick:()=>ep(!eu),className:(0,P.cn)("flex items-center gap-2 rounded-lg border px-3 py-2 transition-all text-sm",eu?"border-primary bg-primary/5 ring-1 ring-primary":"hover:border-muted-foreground/30"),children:[(0,t.jsx)("span",{children:"📧"}),(0,t.jsx)("span",{children:"Email"}),eu&&(0,t.jsx)(l.Check,{className:"h-3.5 w-3.5 text-primary"})]}),(0,t.jsxs)("button",{onClick:()=>eh(!ex),className:(0,P.cn)("flex items-center gap-2 rounded-lg border px-3 py-2 transition-all text-sm",ex?"border-primary bg-primary/5 ring-1 ring-primary":"hover:border-muted-foreground/30"),children:[(0,t.jsx)("span",{children:"📅"}),(0,t.jsx)("span",{children:K?"Calendrier":"Calendar"}),ex&&(0,t.jsx)(l.Check,{className:"h-3.5 w-3.5 text-primary"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(b.Button,{variant:"ghost",onClick:()=>U("personalize"),children:[(0,t.jsx)(i.ArrowLeft,{className:"h-4 w-4 mr-1"}),K?"Precedent":"Previous"]}),(0,t.jsxs)(b.Button,{onClick:()=>U("review"),children:[K?"Voir le resume":"See summary",(0,t.jsx)(n.ArrowRight,{className:"h-4 w-4 ml-1"})]})]})]},"channel"),"review"===Y&&(0,t.jsxs)(a.motion.div,{variants:M,initial:"enter",animate:"center",exit:"exit",transition:{duration:.25},className:"space-y-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold",children:K?"Tout est pret !":"All set!"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:K?"Verifiez et lancez la creation de votre assistant.":"Review and launch your assistant creation."})]}),(0,t.jsx)(S.Card,{children:(0,t.jsx)(S.CardContent,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center text-2xl",children:eo}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-bold",children:e$}),(0,t.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,t.jsx)(k.Badge,{variant:"outline",className:"text-xs",children:X?ee:J?K?J.verticalFr:J.vertical:""}),(0,t.jsx)(k.Badge,{variant:"secondary",className:"text-xs",children:W.find(e=>e.id===ed)?.label}),X&&(0,t.jsx)(k.Badge,{variant:"secondary",className:"text-xs bg-primary/10 text-primary",children:K?"IA generee":"AI generated"})]})]})]})})}),J&&!X&&(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{className:"rounded-lg border p-3 text-center",children:[(0,t.jsx)(h.Wrench,{className:"h-4 w-4 mx-auto mb-1 text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm font-medium",children:J.tools.length}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Tools"})]}),(0,t.jsxs)("div",{className:"rounded-lg border p-3 text-center",children:[(0,t.jsx)(g.BookOpen,{className:"h-4 w-4 mx-auto mb-1 text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm font-medium",children:J.skills.length}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Skills"})]}),(0,t.jsxs)("div",{className:"rounded-lg border p-3 text-center",children:[(0,t.jsx)(f.FlaskConical,{className:"h-4 w-4 mx-auto mb-1 text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm font-medium",children:J.gradingSuite.length}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Tests"})]})]}),X&&(0,t.jsx)(S.Card,{className:"bg-primary/5 border-primary/20",children:(0,t.jsxs)(S.CardContent,{className:"p-4 text-sm space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 font-medium text-primary",children:[(0,t.jsx)(x.Sparkles,{className:"h-4 w-4"}),K?"Generation IA complete":"Full AI generation"]}),(0,t.jsx)("p",{className:"text-muted-foreground",children:K?"L'IA va generer un agent complet avec prompt, skills, tools et tests de qualite adaptes a votre activite.":"AI will generate a complete agent with prompt, skills, tools, and quality tests tailored to your business."})]})}),!X&&(0,t.jsxs)(S.Card,{children:[(0,t.jsxs)("button",{onClick:()=>ev(!ej),className:"w-full flex items-center justify-between p-3 text-sm font-medium",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(p.Settings2,{className:"h-4 w-4"}),K?"Prompt systeme":"System prompt"]}),ej?(0,t.jsx)(c.ChevronUp,{className:"h-4 w-4"}):(0,t.jsx)(o.ChevronDown,{className:"h-4 w-4"})]}),ej&&(0,t.jsx)(S.CardContent,{className:"px-3 pb-3 pt-0",children:(0,t.jsx)(T.ScrollArea,{className:"h-48 rounded border p-2",children:(0,t.jsx)("pre",{className:"text-xs whitespace-pre-wrap font-mono text-muted-foreground",children:eB}
3)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(b.Button,{variant:"ghost",onClick:()=>U("channel"),children:[(0,t.jsx)(i.ArrowLeft,{className:"h-4 w-4 mr-1"}),K?"Modifier":"Edit"]}),(0,t.jsxs)(b.Button,{size:"lg",onClick:function(){X?eM():eO()},children:[(0,t.jsx)(m.Rocket,{className:"h-5 w-5 mr-2"}),K?"Creer mon assistant":"Create my assistant"]})]})]},"review"),"generating"===Y&&(0,t.jsx)(a.motion.div,{variants:M,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3},className:"space-y-4",children:eA?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,t.jsx)(v.AlertCircle,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:eA})]}),(0,t.jsx)(b.Button,{variant:"outline",onClick:()=>{eS(null),U("review")},children:K?"Retour":"Back"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Loader2,{className:"h-4 w-4 animate-spin text-primary"}),(0,t.jsx)("span",{className:"shimmer-text text-sm font-medium",children:eN<100?K?"Generation du prompt systeme...":"Generating system prompt...":eN<500?K?"Creation des skills & tools...":"Creating skills & tools...":eN<1e3?K?"Generation des tests de qualite...":"Generating quality tests...":K?"Finalisation de l'agent...":"Finalizing agent..."})]}),(0,t.jsxs)(a.motion.div,{initial:{opacity:0}
3,animate:{opacity:1},transition:{delay:1},className:"flex items-center gap-2 text-xs text-muted-foreground/60",children:[(0,t.jsx)(d.Loader2,{className:"h-3 w-3 animate-spin"}),(0,t.jsxs)("span",{className:"tabular-nums",children:["~",Math.ceil(ey.length/4).toLocaleString()," tokens"]})]})]}),(0,t.jsxs)(T.ScrollArea,{className:"h-[330px] rounded-lg border bg-muted/30 p-4",children:[(0,t.jsxs)("pre",{className:"whitespace-pre-wrap text-xs font-mono leading-relaxed text-muted-foreground",children:[ey||(0,t.jsx)("span",{className:"shimmer-text",children:K?"Analyse de votre activite...":"Analyzing your business..."}),ey&&(0,t.jsx)("span",{className:"inline-block w-2 h-4 bg-primary/60 animate-pulse ml-0.5 align-text-bottom rounded-sm"})]}),(0,t.jsx)("div",{ref:eF})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,t.jsx)("div",{className:"flex gap-1.5",children:[0,100,500,1e3].map((e,s)=>(0,t.jsx)(a.motion.span,{initial:{scale:.8},animate:eN>e?{scale:1,backgroundColor:"var(--color-primary)"}:{},className:(0,P.cn)("h-2 w-2 rounded-full transition-colors duration-500",eN>e?"bg-primary":"bg-muted-foreground/20")},e))}),(0,t.jsx)("span",{className:"text-muted-foreground/50",children:["Prompt","Skills","Tools","Tests"].map((e,s)=>(0,t.jsx)("span",{className:(0,P.cn)("mr-2",eN>[0,100,500,1e3][s]?"text-foreground/70":""),children:e},e))})]}),(0,t.jsx)(b.Button,{variant:"ghost",size:"sm",onClick:()=>{eT.current?.abort(),U("review")},className:"self-start -ml-2",children:K?"Annuler":"Cancel"})]})},"generating"),"deploying"===Y&&(0,t.jsxs)(a.motion.div,{variants:M,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3},className:"flex flex-col items-center text-center py-16 space-y-6",children:[(0,t.jsx)(a.motion.div,{animate:{rotate:360},transition:{repeat:1/0,duration:2,ease:"linear"},children:(0,t.jsx)(d.Loader2,{className:"h-12 w-12 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold",children:K?"Creation en cours...":"Creating..."}),(0,t.jsx)("p",{className:"text-muted-foreground mt-2",children:K?"Sauvegarde de votre agent, skills, tools et tests...":"Saving your agent, skills, tools and tests..."}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-4",children:"telegram"===ed?K?"Vous pourrez connecter votre bot Telegram juste apres.":"You'll connect your Telegram bot right after.":"whatsapp"===ed?K?"Vous configurerez WhatsApp Business juste apres.":"You'll set up WhatsApp Business right after.":K?"Vous configurerez le widget de chat juste apres.":"You'll set up the chat widget right after."})]})]},"deploying")]})})]})})}function _(e,t,s,a){let r=s.trim()||t.businessName||e,i=t.mainTasks||"",n=t.targetAudience||"",l=t.tone||"professional",o=t.specialInstructions||"";return a?[`Cree un agent IA complet pour "${r}", un(e) ${e}.`,i&&`Missions principales : ${i}`,n&&`Public cible : ${n}`,`Ton souhaite : ${l}`,o&&`Instructions speciales : ${o}`,"L'agent doit etre entierement operationnel avec un prompt systeme detaille, des skills pertinents, des tools avec du vrai code JavaScript fonctionnel (pas de placeholders), et une suite de tests de qualite complete."].filter(Boolean).join("\n\n"):[`Create a complete AI agent for "${r}", a ${e} business.`,i&&`Main tasks: ${i}`,n&&`Target audience: ${n}`,`Desired tone: ${l}`,o&&`Special instructions: ${o}`,"The agent must be fully operational with a detailed system prompt, relevant skills, tools with real working JavaScript code (no placeholders), and a comprehensive quality test suite."].filter(Boolean).join("\n\n")}function G({question:e,value:s,locale:a,onChange:r}){let i="fr"===a,n=i?e.placeholderFr:e.placeholder;switch(e.type){case"text":return(0,t.jsx)(N.Input,{value:s,onChange:e=>r(e.target.value),placeholder:n,autoFocus:!0,className:"text-base"});case"textarea":return(0,t.jsx)(w.Textarea,{value:s,onChange:e=>r(e.target.value),placeholder:n,autoFocus:!0,rows:4,className:"text-base resize-none"});case"number":return(0,t.jsx)(N.Input,{type:"number",value:s,onChange:e=>r(e.target.value),placeholder:n,autoFocus:!0,className:"text-base"});case"select":return(0,t.jsxs)(F.Select,{value:s,onValueChange:r,children:[(0,t.jsx)(F.SelectTrigger,{className:"text-base",children:(0,t.jsx)(F.SelectValue,{placeholder:i?"Selectionnez...":"Select..."})}),(0,t.jsx)(F.SelectContent,{children:e.options?.map(e=>(0,t.jsx)(F.SelectItem,{value:e.value,children:i?e.labelFr:e.label},e.value))})]});default:return null}}e.s(["WelcomeWizard",()=>V])}]);

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.