import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{n as t}from"./posthogErrorCapture-CLTfRKFa.js";import{$g as n,$m as r,Am as i,B_ as a,Bm as o,Ea as s,Fn as c,Fy as l,Gy as u,Hp as d,Hy as f,Ja as p,Kp as m,Lm as h,Ly as g,Mg as _,Pc as v,Pn as y,Pp as b,Qg as ee,Ql as te,Rp as x,Sm as ne,T_ as S,Um as re,Vp as ie,Zv as C,_g as ae,ap as w,bg as T,ci as oe,dg as E,di as D,dn as se,dv as ce,e_ as le,eh as ue,fm as O,hg as k,hl as A,ii as de,im as fe,jg as j,kp as M,lg as pe,lh as N,lm as me,m_ as P,mv as F,n as he,nm as ge,pl as I,pv as _e,rv as ve,s_ as L,sh as ye,si as R,sn as be,th as xe,ty as z,vg as Se,vm as Ce}from"./index-DDwwBb9e.js";import{t as we}from"./getSafeReturnToPath-DXG7mGxC.js";import{a as Te,c as Ee,d as B,i as De,l as Oe,n as ke,o as Ae,r as V,s as je,t as H,u as U}from"./mesh-gradient-B44UBZJo.js";var W={maxColorCount:7},Me=`#version 300 es
precision lowp float;

uniform mediump float u_time;
uniform mediump vec2 u_resolution;
uniform mediump float u_pixelRatio;

uniform sampler2D u_noiseTexture;

uniform vec4 u_colorBack;
uniform vec4 u_colors[${W.maxColorCount}];
uniform float u_colorsCount;
uniform float u_softness;
uniform float u_intensity;
uniform float u_noise;
uniform float u_shape;

uniform mediump float u_originX;
uniform mediump float u_originY;
uniform mediump float u_worldWidth;
uniform mediump float u_worldHeight;
uniform mediump float u_fit;

uniform mediump float u_scale;
uniform mediump float u_rotation;
uniform mediump float u_offsetX;
uniform mediump float u_offsetY;

in vec2 v_objectUV;
in vec2 v_patternUV;
in vec2 v_objectBoxSize;
in vec2 v_patternBoxSize;

out vec4 fragColor;

${De}
${je}
${Ae}
${Ee}

float valueNoiseR(vec2 st) {
  vec2 i = floor(st);
  vec2 f = fract(st);
  float a = randomR(i);
  float b = randomR(i + vec2(1.0, 0.0));
  float c = randomR(i + vec2(0.0, 1.0));
  float d = randomR(i + vec2(1.0, 1.0));
  vec2 u = f * f * (3.0 - 2.0 * f);
  float x1 = mix(a, b, u.x);
  float x2 = mix(c, d, u.x);
  return mix(x1, x2, u.y);
}
vec4 fbmR(vec2 n0, vec2 n1, vec2 n2, vec2 n3) {
  float amplitude = 0.2;
  vec4 total = vec4(0.);
  for (int i = 0; i < 3; i++) {
    n0 = rotate(n0, 0.3);
    n1 = rotate(n1, 0.3);
    n2 = rotate(n2, 0.3);
    n3 = rotate(n3, 0.3);
    total.x += valueNoiseR(n0) * amplitude;
    total.y += valueNoiseR(n1) * amplitude;
    total.z += valueNoiseR(n2) * amplitude;
    total.z += valueNoiseR(n3) * amplitude;
    n0 *= 1.99;
    n1 *= 1.99;
    n2 *= 1.99;
    n3 *= 1.99;
    amplitude *= 0.6;
  }
  return total;
}

${Te}

vec2 truchet(vec2 uv, float idx){
  idx = fract(((idx - .5) * 2.));
  if (idx > 0.75) {
    uv = vec2(1.0) - uv;
  } else if (idx > 0.5) {
    uv = vec2(1.0 - uv.x, uv.y);
  } else if (idx > 0.25) {
    uv = 1.0 - vec2(1.0 - uv.x, uv.y);
  }
  return uv;
}

void main() {

  const float firstFrameOffset = 7.;
  float t = .1 * (u_time + firstFrameOffset);

  vec2 shape_uv = vec2(0.);
  vec2 grain_uv = vec2(0.);

  float r = u_rotation * PI / 180.;
  float cr = cos(r);
  float sr = sin(r);
  mat2 graphicRotation = mat2(cr, sr, -sr, cr);
  vec2 graphicOffset = vec2(-u_offsetX, u_offsetY);

  if (u_shape > 3.5) {
    shape_uv = v_objectUV;
    grain_uv = shape_uv;

    // apply inverse transform to grain_uv so it respects the originXY
    grain_uv = transpose(graphicRotation) * grain_uv;
    grain_uv *= u_scale;
    grain_uv -= graphicOffset;
    grain_uv *= v_objectBoxSize;
    grain_uv *= .7;
  } else {
    shape_uv = .5 * v_patternUV;
    grain_uv = 100. * v_patternUV;

    // apply inverse transform to grain_uv so it respects the originXY
    grain_uv = transpose(graphicRotation) * grain_uv;
    grain_uv *= u_scale;
    if (u_fit > 0.) {
      vec2 givenBoxSize = vec2(u_worldWidth, u_worldHeight);
      givenBoxSize = max(givenBoxSize, vec2(1.)) * u_pixelRatio;
      float patternBoxRatio = givenBoxSize.x / givenBoxSize.y;
      vec2 patternBoxGivenSize = vec2(
      (u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x,
      (u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y
      );
      patternBoxRatio = patternBoxGivenSize.x / patternBoxGivenSize.y;
      float patternBoxNoFitBoxWidth = patternBoxRatio * min(patternBoxGivenSize.x / patternBoxRatio, patternBoxGivenSize.y);
      grain_uv /= (patternBoxNoFitBoxWidth / v_patternBoxSize.x);
    }
    vec2 patternBoxScale = u_resolution.xy / v_patternBoxSize;
    grain_uv -= graphicOffset / patternBoxScale;
    grain_uv *= 1.6;
  }


  float shape = 0.;

  if (u_shape < 1.5) {
    // Sine wave

    float wave = cos(.5 * shape_uv.x - 4. * t) * sin(1.5 * shape_uv.x + 2. * t) * (.75 + .25 * cos(6. * t));
    shape = 1. - smoothstep(-1., 1., shape_uv.y + wave);

  } else if (u_shape < 2.5) {
    // Grid (dots)

    float stripeIdx = floor(2. * shape_uv.x / TWO_PI);
    float rand = hash11(stripeIdx * 100.);
    rand = sign(rand - .5) * pow(4. * abs(rand), .3);
    shape = sin(shape_uv.x) * cos(shape_uv.y - 5. * rand * t);
    shape = pow(abs(shape), 4.);

  } else if (u_shape < 3.5) {
    // Truchet pattern

    float n2 = valueNoiseR(shape_uv * .4 - 3.75 * t);
    shape_uv.x += 10.;
    shape_uv *= .6;

    vec2 tile = truchet(fract(shape_uv), randomR(floor(shape_uv)));

    float distance1 = length(tile);
    float distance2 = length(tile - vec2(1.));

    n2 -= .5;
    n2 *= .1;
    shape = smoothstep(.2, .55, distance1 + n2) * (1. - smoothstep(.45, .8, distance1 - n2));
    shape += smoothstep(.2, .55, distance2 + n2) * (1. - smoothstep(.45, .8, distance2 - n2));

    shape = pow(shape, 1.5);

  } else if (u_shape < 4.5) {
    // Corners

    shape_uv *= .6;
    vec2 outer = vec2(.5);

    vec2 bl = smoothstep(vec2(0.), outer, shape_uv + vec2(.1 + .1 * sin(3. * t), .2 - .1 * sin(5.25 * t)));
    vec2 tr = smoothstep(vec2(0.), outer, 1. - shape_uv);
    shape = 1. - bl.x * bl.y * tr.x * tr.y;

    shape_uv = -shape_uv;
    bl = smoothstep(vec2(0.), outer, shape_uv + vec2(.1 + .1 * sin(3. * t), .2 - .1 * cos(5.25 * t)));
    tr = smoothstep(vec2(0.), outer, 1. - shape_uv);
    shape -= bl.x * bl.y * tr.x * tr.y;

    shape = 1. - smoothstep(0., 1., shape);

  } else if (u_shape < 5.5) {
    // Ripple

    shape_uv *= 2.;
    float dist = length(.4 * shape_uv);
    float waves = sin(pow(dist, 1.2) * 5. - 3. * t) * .5 + .5;
    shape = waves;

  } else if (u_shape < 6.5) {
    // Blob

    t *= 2.;

    vec2 f1_traj = .25 * vec2(1.3 * sin(t), .2 + 1.3 * cos(.6 * t + 4.));
    vec2 f2_traj = .2 * vec2(1.2 * sin(-t), 1.3 * sin(1.6 * t));
    vec2 f3_traj = .25 * vec2(1.7 * cos(-.6 * t), cos(-1.6 * t));
    vec2 f4_traj = .3 * vec2(1.4 * cos(.8 * t), 1.2 * sin(-.6 * t - 3.));

    shape = .5 * pow(1. - clamp(0., 1., length(shape_uv + f1_traj)), 5.);
    shape += .5 * pow(1. - clamp(0., 1., length(shape_uv + f2_traj)), 5.);
    shape += .5 * pow(1. - clamp(0., 1., length(shape_uv + f3_traj)), 5.);
    shape += .5 * pow(1. - clamp(0., 1., length(shape_uv + f4_traj)), 5.);

    shape = smoothstep(.0, .9, shape);
    float edge = smoothstep(.25, .3, shape);
    shape = mix(.0, shape, edge);

  } else {
    // Sphere

    shape_uv *= 2.;
    float d = 1. - pow(length(shape_uv), 2.);
    vec3 pos = vec3(shape_uv, sqrt(max(d, 0.)));
    vec3 lightPos = normalize(vec3(cos(1.5 * t), .8, sin(1.25 * t)));
    shape = .5 + .5 * dot(lightPos, pos);
    shape *= step(0., d);
  }

  float baseNoise = snoise(grain_uv * .5);
  vec4 fbmVals = fbmR(
  .002 * grain_uv + 10.,
  .003 * grain_uv,
  .001 * grain_uv,
  rotate(.4 * grain_uv, 2.)
  );
  float grainDist = baseNoise * snoise(grain_uv * .2) - fbmVals.x - fbmVals.y;
  float rawNoise = .75 * baseNoise - fbmVals.w - fbmVals.z;
  float noise = clamp(rawNoise, 0., 1.);

  shape += u_intensity * 2. / u_colorsCount * (grainDist + .5);
  shape += u_noise * 10. / u_colorsCount * noise;

  float aa = fwidth(shape);

  shape = clamp(shape - .5 / u_colorsCount, 0., 1.);
  float totalShape = smoothstep(0., u_softness + 2. * aa, clamp(shape * u_colorsCount, 0., 1.));
  float mixer = shape * (u_colorsCount - 1.);

  int cntStop = int(u_colorsCount) - 1;
  vec4 gradient = u_colors[0];
  gradient.rgb *= gradient.a;
  for (int i = 1; i < ${W.maxColorCount}; i++) {
    if (i > cntStop) break;

    float localT = clamp(mixer - float(i - 1), 0., 1.);
    localT = smoothstep(.5 - .5 * u_softness - aa, .5 + .5 * u_softness + aa, localT);

    vec4 c = u_colors[i];
    c.rgb *= c.a;
    gradient = mix(gradient, c, localT);
  }

  vec3 color = gradient.rgb * totalShape;
  float opacity = gradient.a * totalShape;

  vec3 bgColor = u_colorBack.rgb * u_colorBack.a;
  color = color + bgColor * (1.0 - opacity);
  opacity = opacity + u_colorBack.a * (1.0 - opacity);

  fragColor = vec4(color, opacity);
}
`,Ne={wave:1,dots:2,truchet:3,corners:4,ripple:5,blob:6,sphere:7};function Pe(){if(typeof window>`u`)return;let e=new Image;return e.src=Fe,e}var Fe=`data:image/png;base64, `,G=e(u(),1),K=f(),q={name:`Default`,params:{...U,speed:1,frame:0,colorBack:`#000000`,colors:[`#7300ff`,`#eba8ff`,`#00bfff`,`#2a00ff`],softness:.5,intensity:.5,noise:.25,shape:`corners`}};({...B}),{...B},{...B},{...U},{...U};var Ie=(0,G.memo)(function({speed:e=q.params.speed,frame:t=q.params.frame,colorBack:n=q.params.colorBack,colors:r=q.params.colors,softness:i=q.params.softness,intensity:a=q.params.intensity,noise:o=q.params.noise,shape:s=q.params.shape,fit:c=q.params.fit,scale:l=q.params.scale,rotation:u=q.params.rotation,originX:d=q.params.originX,originY:f=q.params.originY,offsetX:p=q.params.offsetX,offsetY:m=q.params.offsetY,worldWidth:h=q.params.worldWidth,worldHeight:g=q.params.worldHeight,..._}){let v={u_colorBack:V(n),u_colors:r.map(V),u_colorsCount:r.length,u_softness:i,u_intensity:a,u_noise:o,u_shape:Ne[s],u_noiseTexture:Pe(),u_fit:Oe[c],u_scale:l,u_rotation:u,u_offsetX:p,u_offsetY:m,u_originX:d,u_originY:f,u_worldWidth:h,u_worldHeight:g};return(0,K.jsx)(ke,{..._,speed:e,frame:t,fragmentShader:Me,uniforms:v})}),Le=[{title:`Documentation`,description:`Learn how to integrate and use LangWatch effectively`,icon:(0,K.jsx)(d,{size:18}),shader:{kind:`mesh`,colors:[`#0c1c3d`,`#1e3a8a`,`#3b82f6`,`#67e8f9`,`#a5f3fc`],colorsDark:[`#0c1c3d`,`#1e3a8a`,`#2563eb`,`#06b6d4`,`#22d3ee`],distortion:1,swirl:1,speed:.85,scale:.6,grainMixer:.32,grainOverlay:.4,offsetX:-.7,offsetY:.6},href:`https://docs.langwatch.ai`,cta:`View documentation`},{title:`Video Tutorials`,description:`Watch step-by-step guides and feature walkthroughs`,icon:(0,K.jsx)(ge,{size:22}),shader:{kind:`mesh`,colors:[`#7f1d1d`,`#b91c1c`,`#ef4444`,`#fb923c`,`#fde68a`],colorsDark:[`#3d0c0c`,`#7f1d1d`,`#dc2626`,`#f97316`,`#fbbf24`],distortion:1,swirl:1,speed:.85,scale:.6,grainMixer:.32,grainOverlay:.4,offsetX:.7,offsetY:-.6},href:`https://www.youtube.com/@LangWatch/videos`,cta:`Watch videos`}];function Re({resource:e}){let t=R(),n=b(e.shader.colors,e.shader.colorsDark),r=b(e.shader.kind===`grain`?e.shader.colorBack:``,e.shader.kind===`grain`?e.shader.colorBackDark:``),i=b(`linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 100%)`,`linear-gradient(135deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.5) 100%)`);return(0,K.jsx)(L,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,_hover:{textDecoration:`none`},height:`full`,width:`full`,children:(0,K.jsxs)(g,{position:`relative`,borderRadius:`xl`,overflow:`hidden`,height:`full`,width:`full`,boxShadow:`0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.12)`,transition:`all 0.2s ease-in-out`,_hover:{opacity:.92,boxShadow:`0 2px 4px rgba(0,0,0,0.08), 0 12px 32px rgba(0,0,0,0.16)`},children:[(0,K.jsx)(g,{position:`absolute`,inset:0,pointerEvents:`none`,children:e.shader.kind===`mesh`?(0,K.jsx)(H,{colors:n,distortion:e.shader.distortion,swirl:e.shader.swirl,grainMixer:e.shader.grainMixer,grainOverlay:e.shader.grainOverlay,speed:t?0:e.shader.speed,scale:e.shader.scale,offsetX:e.shader.offsetX,offsetY:e.shader.offsetY,style:{width:`100%`,height:`100%`}}):(0,K.jsx)(Ie,{colors:n,colorBack:r,shape:e.shader.shape,softness:e.shader.softness,intensity:e.shader.intensity,noise:e.shader.noise,speed:t?0:e.shader.speed,scale:e.shader.scale,offsetX:e.shader.offsetX,offsetY:e.shader.offsetY,style:{width:`100%`,height:`100%`}})}),(0,K.jsx)(g,{position:`absolute`,inset:0,pointerEvents:`none`,backgroundImage:i}),(0,K.jsx)(E,{position:`relative`,align:`start`,padding:4,gap:3,height:`full`,width:`full`,color:`white`,children:(0,K.jsxs)(P,{gap:3,align:`start`,children:[(0,K.jsx)(g,{padding:2,borderRadius:`lg`,color:`white`,opacity:.95,children:e.icon}),(0,K.jsxs)(E,{align:`start`,gap:1,flex:1,children:[(0,K.jsx)(C,{fontWeight:`semibold`,fontSize:`sm`,children:e.title}),(0,K.jsx)(C,{fontSize:`xs`,color:`white/80`,children:e.description}),(0,K.jsxs)(P,{color:`white`,fontSize:`xs`,fontWeight:`medium`,children:[(0,K.jsx)(C,{children:e.cta}),(0,K.jsx)(O,{size:12})]})]})]})})]})})}function ze(){return(0,K.jsxs)(E,{align:`stretch`,gap:3,width:`full`,children:[(0,K.jsx)(z,{children:`Learning resources`}),(0,K.jsx)(l,{templateColumns:{base:`1fr`,md:`repeat(2, 1fr)`},gap:3,width:`full`,children:Le.map(e=>(0,K.jsx)(Re,{resource:e},e.title))}),(0,K.jsxs)(C,{fontSize:`13px`,color:`fg.muted`,paddingTop:2,children:[`Considering LangWatch for your team?`,` `,(0,K.jsx)(I,{href:`https://langwatch.ai/get-a-demo`,isExternal:!0,color:`fg.muted`,textDecoration:`underline`,_hover:{color:`orange.500`},children:`Request a demo`})]})]})}function J(e){return(0,K.jsx)(_e,{_hover:{boxShadow:`0 0 0 0 #000, 0 0 0 0 #000, 0px 2px 4px 0px rgba(0, 0, 0, 0.1)`},...e,children:(0,K.jsx)(ce,{padding:0,gap:2,children:e.children})})}var Be=e=>{switch(e){case`createProject`:return(0,K.jsx)(m,{size:12});case`syncFirstMessage`:return(0,K.jsx)(i,{size:12});case`inviteTeamMembers`:return(0,K.jsx)(r,{size:12});case`setupModelProviders`:return(0,K.jsx)(ne,{size:12});case`createPrompt`:return(0,K.jsx)(o,{size:12});case`createWorkflow`:return(0,K.jsx)(ue,{size:12});case`createSimulation`:return(0,K.jsx)(h,{size:12});case`setupEvaluation`:return(0,K.jsx)(Ce,{size:12});case`createDataset`:return(0,K.jsx)(me,{size:12});default:return(0,K.jsx)(m,{size:12})}},Y=(e,t)=>[{key:`createProject`,title:`Create your new project`,href:`/settings/teams`,complete:!0},{key:`syncFirstMessage`,title:`Sync your first message`,href:`/${t}/messages`,complete:e.firstMessage},{key:`inviteTeamMembers`,title:`Invite team members`,href:`/settings/members`,complete:(e.teamMembers??0)>1},{key:`setupModelProviders`,title:`Setup your model providers`,href:`/settings/model-providers`,complete:(e.modelProviders??0)>0},{key:`createPrompt`,title:`Create your first versioned prompt`,href:`/${t}/prompts`,complete:(e.prompts??0)>0},{key:`createSimulation`,title:`Create your first agent simulation`,href:`/${t}/simulations`,complete:(e.simulations??0)>0},{key:`setupEvaluation`,title:`Set up your first evaluation`,href:`/${t}/evaluations`,complete:(e.evaluations??0)>0},{key:`createWorkflow`,title:`Create your first workflow`,href:`/${t}/workflows`,complete:(e.workflows??0)>0},{key:`createDataset`,title:`Create a dataset from the messages`,href:`/${t}/datasets`,complete:(e.datasets??0)>0}],X=e=>{let t=e.filter(e=>e.complete).length;return Math.round(t/e.length*100)};function Ve({step:e,onClick:t}){return(0,K.jsxs)(P,{gap:2,paddingY:1,paddingX:1,borderRadius:`md`,cursor:e.complete?`default`:`pointer`,onClick:e.complete?void 0:t,_hover:e.complete?{}:{background:`bg.muted`},transition:`all 0.15s`,children:[(0,K.jsx)(g,{padding:1,borderRadius:`full`,background:e.complete?`green.subtle`:`bg.muted`,color:e.complete?`green.solid`:`fg.muted`,children:e.complete?(0,K.jsx)(m,{size:10}):Be(e.key)}),(0,K.jsx)(C,{fontSize:`13px`,color:e.complete?`fg.muted`:`fg`,textDecoration:e.complete?`line-through`:`none`,children:e.title})]})}function He(){let e=M(),{project:t}=w(),{emit:r}=pe(),{data:i,isLoading:a}=N.integrationsChecks.getCheckStatus.useQuery({projectId:t?.id??``},{enabled:!!t?.id});if((0,G.useEffect)(()=>{if(a||!i||!t?.id)return;let e=Y(i,t.slug),n=e.filter(e=>e.complete),o=X(e);r(`viewed`,`onboarding_progress`,{project_id:t.id,completion_percentage:o,completed_tasks_count:n.length,total_tasks_count:e.length,all_complete:o===100,has_first_message:i.firstMessage,has_team_members:(i.teamMembers??0)>1,has_model_providers:(i.modelProviders??0)>0,has_prompts:(i.prompts??0)>0,has_simulations:(i.simulations??0)>0,has_evaluations:(i.evaluations??0)>0,has_workflows:(i.workflows??0)>0,has_datasets:(i.datasets??0)>0,count_team_members:i.teamMembers??0,count_model_providers:i.modelProviders??0,count_prompts:i.prompts??0,count_simulations:i.simulations??0,count_evaluations:i.evaluations??0,count_workflows:i.workflows??0,count_datasets:i.datasets??0})},[a]),a||!i||!t)return null;let o=Y(i,t.slug),s=X(o);if(s===100)return null;let c=n=>{r(`clicked`,`onboarding_step`,{project_id:t.id,step_key:n.key,step_title:n.title,step_complete:n.complete}),e.push(n.href)},u=[];for(let e=0;e<o.length;e+=3)u.push(o.slice(e,e+3));return(0,K.jsxs)(J,{cursor:`default`,width:`full`,padding:3,gap:2,_hover:{boxShadow:`xs`},children:[(0,K.jsxs)(P,{justify:`space-between`,align:`center`,width:`full`,children:[(0,K.jsx)(P,{gap:3,children:(0,K.jsx)(C,{fontSize:`sm`,fontWeight:`medium`,color:`fg`,children:`Get started with LangWatch`})}),(0,K.jsx)(j,{}),(0,K.jsxs)(C,{fontSize:`xs`,color:`fg.muted`,children:[s,`% completed`]}),(0,K.jsx)(g,{width:`80px`,children:(0,K.jsx)(n,{value:s,colorPalette:`orange`,size:`sm`,children:(0,K.jsx)(le,{borderRadius:`full`,children:(0,K.jsx)(ee,{})})})})]}),(0,K.jsx)(l,{templateColumns:{base:`1fr`,md:`repeat(${u.length}, 1fr)`},gap:2,width:`full`,children:u.map((e,t)=>(0,K.jsx)(E,{align:`stretch`,gap:0,children:e.map(e=>(0,K.jsx)(Ve,{step:e,onClick:()=>c(e)},e.key))},t))})]})}var Ue=(e,t)=>{let n=y.traces,r=y.simulations,i=y.prompts,a=y.evaluations;return[{title:`Observability`,description:t?`View your traces and monitor performance`:`Set up tracing for your AI application`,icon:(0,K.jsx)(S,{as:n.icon,width:`16px`,height:`16px`,display:`block`}),color:n.color.split(`.`)[0]??`blue`,href:`/${e}/messages`,docsHref:`https://langwatch.ai/docs/integration/quick-start`},{title:`Agent Simulations`,description:`Test your AI agents with simulated conversations`,icon:(0,K.jsx)(S,{as:r.icon,width:`16px`,height:`16px`,display:`block`}),color:r.color.split(`.`)[0]??`pink`,href:`/${e}/simulations`,docsHref:`https://langwatch.ai/docs/agent-simulations/getting-started`},{title:`Prompt Management`,description:`Version and manage your prompts`,icon:(0,K.jsx)(S,{as:i.icon,width:`16px`,height:`16px`,display:`block`}),color:i.color.split(`.`)[0]??`purple`,href:`/${e}/prompts`,docsHref:`https://langwatch.ai/docs/prompt-management/overview`},{title:`Evaluations`,description:`Evaluate your agent or set up real-time evaluations`,icon:(0,K.jsx)(S,{as:a.icon,width:`16px`,height:`16px`,display:`block`}),color:a.color.split(`.`)[0]??`orange`,href:`/${e}/evaluations`,docsHref:`https://langwatch.ai/docs/llm-evaluation`}]};function We({card:e}){return(0,K.jsx)(L,{asChild:!0,_hover:{textDecoration:`none`},height:`full`,children:(0,K.jsx)(A,{href:e.href,children:(0,K.jsxs)(J,{height:`full`,width:`full`,padding:3,children:[(0,K.jsx)(P,{width:`full`,children:(0,K.jsx)(g,{padding:1.5,borderRadius:`md`,background:`${e.color}.subtle`,color:`${e.color}.solid`,children:e.icon})}),(0,K.jsxs)(E,{align:`start`,gap:1,flex:1,children:[(0,K.jsx)(C,{fontWeight:`medium`,fontSize:`sm`,children:e.title}),(0,K.jsx)(C,{fontSize:`xs`,color:`fg.muted`,lineClamp:2,children:e.description})]}),(0,K.jsx)(I,{href:e.docsHref,isExternal:!0,fontSize:`xs`,color:`fg.subtle`,_hover:{color:`${e.color}.500`},onClick:e=>e.stopPropagation(),children:(0,K.jsxs)(P,{gap:1,children:[(0,K.jsx)(C,{children:`Docs`}),(0,K.jsx)(O,{size:10})]})})]})})})}function Ge(){let{project:e}=w(),{data:t}=N.integrationsChecks.getCheckStatus.useQuery({projectId:e?.id??``},{enabled:!!e?.id});if(!e)return null;let n=t?.firstMessage??!1,r=Ue(e.slug,n);return(0,K.jsxs)(E,{align:`stretch`,gap:3,width:`full`,children:[(0,K.jsx)(z,{children:`What would you like to work on today?`}),(0,K.jsx)(l,{templateColumns:{base:`1fr`,sm:`repeat(2, 1fr)`,lg:`repeat(4, 1fr)`},gap:3,children:r.map(e=>(0,K.jsx)(We,{card:e},e.title))})]})}var Z=e=>{let t=c[e],n=t?y[t]:null;return n?(0,K.jsx)(S,{as:n.icon,width:`14px`,height:`14px`,display:`block`}):(0,K.jsx)(S,{as:y.home.icon,width:`14px`,height:`14px`,display:`block`})},Q=e=>{let t=c[e];return(t?y[t]:null)?.color??`gray.500`},Ke=e=>{let t=c[e],n=(t?y[t]:null)?.label??`Item`;return n.endsWith(`s`)?n.slice(0,-1):n},qe=e=>{let t=new Map;for(let n of e){let e=t.get(n.type)??[];t.set(n.type,[...e,n])}return t};function Je({item:e}){let t=v(e.updatedAt.getTime()),n=Q(e.type),r=Z(e.type);return(0,K.jsx)(L,{asChild:!0,_hover:{textDecoration:`none`},height:`full`,width:`full`,display:`block`,children:(0,K.jsx)(A,{href:e.href,children:(0,K.jsx)(J,{padding:3,height:`full`,children:(0,K.jsxs)(P,{gap:2,align:`start`,width:`full`,children:[(0,K.jsx)(g,{padding:1.5,borderRadius:`md`,background:`${n.split(`.`)[0]}.subtle`,color:`${n.split(`.`)[0]}.solid`,children:r}),(0,K.jsxs)(E,{align:`start`,gap:0,flex:1,minWidth:0,children:[(0,K.jsx)(C,{fontSize:`sm`,lineClamp:1,title:e.name,children:e.name}),(0,K.jsxs)(P,{gap:2,children:[(0,K.jsx)(C,{fontSize:`xs`,color:`fg.muted`,children:Ke(e.type)}),t&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(C,{fontSize:`xs`,color:`fg.subtle`,children:`•`}),(0,K.jsx)(C,{fontSize:`xs`,color:`fg.muted`,children:t})]})]})]})]})})})})}function Ye(){return(0,K.jsx)(l,{templateColumns:{base:`1fr`,md:`repeat(2, 1fr)`,lg:`repeat(3, 1fr)`},gap:3,children:Array.from({length:6}).map((e,t)=>(0,K.jsx)(J,{cursor:`default`,padding:3,children:(0,K.jsxs)(P,{gap:2,children:[(0,K.jsx)(_,{width:`32px`,height:`32px`,borderRadius:`md`}),(0,K.jsxs)(E,{align:`start`,gap:1,flex:1,children:[(0,K.jsx)(_,{height:`14px`,width:`80%`}),(0,K.jsx)(_,{height:`12px`,width:`50%`})]})]})},t))})}function Xe({items:e}){return(0,K.jsx)(l,{templateColumns:{base:`1fr`,md:`repeat(2, 1fr)`,lg:`repeat(3, 1fr)`},gap:3,children:e.map(e=>(0,K.jsx)(Je,{item:e},`${e.type}-${e.id}`))})}function Ze({items:e}){let t=qe(e);return(0,K.jsx)(E,{gap:4,align:`stretch`,children:Array.from(t.entries()).map(([e,t])=>(0,K.jsxs)(E,{align:`stretch`,gap:2,children:[(0,K.jsxs)(P,{children:[(0,K.jsx)(g,{color:Q(e),children:Z(e)}),(0,K.jsxs)(C,{fontSize:`sm`,color:`fg`,children:[Ke(e),`s`]}),(0,K.jsxs)(C,{fontSize:`xs`,color:`fg.muted`,children:[`(`,t.length,`)`]})]}),(0,K.jsx)(l,{templateColumns:{base:`1fr`,md:`repeat(2, 1fr)`,lg:`repeat(3, 1fr)`},gap:3,children:t.map(e=>(0,K.jsx)(Je,{item:e},`${e.type}-${e.id}`))})]},e))})}function Qe(){let{project:e}=w(),{data:t,isLoading:n,error:r,refetch:i}=N.home.getRecentItems.useQuery({projectId:e?.id??``,limit:12},{enabled:!!e?.id});return!n&&!r&&t?.length===0?null:(0,K.jsx)(E,{align:`stretch`,gap:3,width:`full`,children:(0,K.jsxs)(Se,{defaultValue:`recents`,variant:`enclosed`,size:`sm`,border:`none`,width:`full`,gap:3,display:`flex`,flexDirection:`column`,children:[(0,K.jsxs)(P,{width:`full`,children:[(0,K.jsx)(z,{children:`Jump right back`}),(0,K.jsx)(j,{}),(0,K.jsxs)(ae,{border:`none`,children:[(0,K.jsx)(T,{value:`recents`,fontSize:`xs`,paddingX:2,paddingY:.5,children:`Recents`}),(0,K.jsx)(T,{value:`by-type`,whiteSpace:`nowrap`,fontSize:`xs`,paddingX:2,paddingY:.5,children:`By type`})]})]}),n&&(0,K.jsx)(Ye,{}),r&&(0,K.jsx)(J,{cursor:`default`,padding:6,children:(0,K.jsxs)(E,{gap:2,width:`full`,children:[(0,K.jsx)(g,{color:`red.500`,children:(0,K.jsx)(fe,{size:24})}),(0,K.jsx)(C,{fontSize:`sm`,color:`fg.muted`,children:`Failed to load recent items`}),(0,K.jsx)(C,{fontSize:`xs`,color:`blue.500`,cursor:`pointer`,_hover:{textDecoration:`underline`},onClick:()=>void i(),children:`Retry`})]})}),!n&&!r&&t&&t.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(k,{value:`recents`,paddingTop:0,children:(0,K.jsx)(Xe,{items:t})}),(0,K.jsx)(k,{value:`by-type`,paddingTop:0,children:(0,K.jsx)(Ze,{items:t})})]})]})})}var $e=e(s());function et(){let{project:e,organization:t}=w({redirectToOnboarding:!1,redirectToProjectOnboarding:!1}),{isSnoozed:n,snooze:r}=se(e?.id),{openDrawer:i}=he(),{enabled:a}=de(`release_ui_sdk_radar_banner_card_enabled`,{organizationId:t?.id}),o=N.sdkRadar.getVersionStats.useQuery({projectId:e?.id??``},{enabled:!!e?.id&&a});if(!a||!e||!o.data||!o.data.hasOutdated||n)return null;let s=o.data.sdks.reduce((e,t)=>e+t.versions.filter(e=>e.isOutdated).reduce((e,t)=>e+t.count,0),0),c=o.data.sdks.filter(e=>e.versions.some(e=>e.isOutdated)).map(e=>e.displayName);return(0,K.jsxs)(J,{width:`full`,padding:4,borderColor:`yellow.300`,borderWidth:1,children:[(0,K.jsxs)(P,{width:`full`,gap:2,marginBottom:2,children:[(0,K.jsx)(z,{size:`sm`,color:`orange.500`,children:`SDK Radar: Update Recommended`}),(0,K.jsx)(j,{}),(0,K.jsxs)(F,{size:`xs`,variant:`ghost`,color:`fg.muted`,onClick:r,children:[(0,K.jsx)(ie,{size:14}),`Snooze 30 days`]})]}),(0,K.jsxs)(P,{width:`full`,gap:4,children:[(0,K.jsxs)(C,{fontSize:`sm`,color:`fg.muted`,children:[(0,$e.default)(s).format(`0,0`),` events in the last 7 days were sent from an outdated`,` `,(0,K.jsx)(C,{as:`span`,fontWeight:`bold`,color:`fg`,children:c.join(`, `)}),` `,`SDK.`]}),(0,K.jsx)(j,{}),(0,K.jsxs)(F,{size:`sm`,variant:`outline`,colorPalette:`orange`,onClick:()=>i(`sdkRadar`,{},{resetStack:!0}),children:[`View details `,(0,K.jsx)(x,{size:12})]})]})]})}function tt(){let{project:e,hasPermission:t}=w(),n=t(`cost:view`),r={graphId:`tracesOverview`,graphType:`summary`,series:[{name:`Traces`,metric:`metadata.trace_id`,aggregation:`cardinality`,colorSet:D.metadata.trace_id.colorSet},{name:`Threads`,metric:`metadata.thread_id`,aggregation:`cardinality`,colorSet:D.metadata.thread_id.colorSet},{name:`Users`,metric:`metadata.user_id`,aggregation:`cardinality`,colorSet:D.metadata.user_id.colorSet},{name:`Total Tokens`,metric:`performance.total_tokens`,aggregation:`sum`,colorSet:D.performance.total_tokens.colorSet},...n?[{name:`LLM Cost`,metric:`performance.total_cost`,aggregation:`sum`,colorSet:D.performance.total_cost.colorSet}]:[],{name:`Mean Completion Time`,metric:`performance.completion_time`,aggregation:`avg`,colorSet:D.performance.completion_time.colorSet}],includePrevious:!0,timeScale:`full`};return e?(0,K.jsxs)(J,{width:`full`,padding:4,_hover:{boxShadow:`2xs`},children:[(0,K.jsxs)(P,{width:`full`,gap:2,marginBottom:2,children:[(0,K.jsx)(z,{size:`sm`,color:`fg`,children:`Traces Overview`}),(0,K.jsx)(j,{}),(0,K.jsxs)(I,{href:`/${e.slug}/analytics`,fontSize:`xs`,color:`fg.muted`,_hover:{color:`orange.500`},children:[`View dashboards `,(0,K.jsx)(x,{size:12})]})]}),(0,K.jsx)(oe,{input:r})]}):null}var $=7,nt=$*24*60*60*1e3,rt=`langwatch:tracesV2-home-banner-dismissed:v2:try:`,it=e=>`${rt}${e}`;function at(e){if(typeof window>`u`)return!1;try{let t=localStorage.getItem(it(e));if(!t)return!1;let n=Number(t);return Number.isFinite(n)?n>Date.now():!1}catch{return!1}}function ot(e){if(!(typeof window>`u`))try{localStorage.setItem(it(e),String(Date.now()+nt))}catch{}}var st=[`#6b21a8`,`#a855f7`,`#ec4899`,`#fdf2f8`],ct=[`#581c87`,`#9333ea`,`#db2777`,`#1f0a2e`];function lt(){let{project:e}=w({redirectToOnboarding:!1,redirectToProjectOnboarding:!1}),n=e?.id,r=e?.slug,i=R(),a=b(st,ct),[o,s]=(0,G.useState)(!1),[c,l]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{l(!0)},[]),(0,G.useEffect)(()=>{n&&s(at(n))},[n]),!c||!r||o)return null;let u=()=>{n&&ot(n),s(!0)},d=()=>{p(!0),t.capture(`traces_v2_opt_in`,{surface:`home_banner`,projectId:n}),n&&ot(n)},f=`/${r}/traces`;return(0,K.jsxs)(g,{position:`relative`,width:`full`,borderRadius:`xl`,overflow:`hidden`,color:`white`,boxShadow:`0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.18)`,minHeight:{base:`160px`,md:`172px`},children:[(0,K.jsx)(g,{position:`absolute`,inset:0,pointerEvents:`none`,children:(0,K.jsx)(H,{colors:a,distortion:.85,swirl:.6,grainMixer:.15,grainOverlay:.18,speed:i?0:.45,scale:1.2,style:{width:`100%`,height:`100%`}})}),(0,K.jsx)(g,{position:`absolute`,inset:0,pointerEvents:`none`,backgroundImage:`linear-gradient(120deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.05) 55%, rgba(0,0,0,0) 100%)`}),(0,K.jsxs)(P,{position:`relative`,zIndex:1,align:`center`,gap:{base:4,md:6},paddingLeft:{base:5,md:7},paddingRight:{base:5,md:7},paddingY:{base:5,md:6},width:`full`,children:[(0,K.jsx)(g,{flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,boxSize:`44px`,borderRadius:`full`,bg:`white/20`,boxShadow:`inset 0 0 0 1px rgba(255,255,255,0.35)`,children:(0,K.jsx)(S,{as:re,boxSize:5,color:`white`})}),(0,K.jsxs)(E,{align:`start`,gap:1.5,flex:1,minWidth:0,children:[(0,K.jsxs)(P,{gap:2,minWidth:0,children:[(0,K.jsx)(z,{as:`h2`,size:`md`,color:`white`,letterSpacing:`-0.01em`,lineHeight:1.2,children:`The new Trace Explorer is here`}),(0,K.jsx)(g,{paddingX:2,paddingY:`2px`,borderRadius:`full`,bg:`white/30`,flexShrink:0,children:(0,K.jsx)(C,{textStyle:`2xs`,fontWeight:`700`,color:`white`,letterSpacing:`0.08em`,textTransform:`uppercase`,lineHeight:1.2,children:`Beta`})})]}),(0,K.jsx)(C,{textStyle:`sm`,color:`white/90`,lineHeight:1.5,maxWidth:{base:`full`,md:`520px`},children:`A faster, friendlier tracing experience, built on everything we learned from v1. Take it for a spin and tell us what you think.`}),(0,K.jsx)(P,{gap:2,marginTop:1.5,children:(0,K.jsx)(I,{href:f,onClick:d,"aria-label":`Open new Trace Explorer`,children:(0,K.jsxs)(F,{size:`sm`,bg:`white`,color:`purple.700`,fontWeight:`600`,paddingX:4,boxShadow:`0 1px 2px rgba(0,0,0,0.12)`,_hover:{bg:`white/90`,transform:`translateY(-1px)`},_active:{bg:`white/80`,transform:`translateY(0)`},transition:`background-color 0.12s ease, transform 0.12s ease`,children:[`Try the new Trace Explorer`,(0,K.jsx)(S,{as:x,boxSize:3.5,marginLeft:1})]})})})]})]}),(0,K.jsx)(te,{content:`Hide for ${$} days`,positioning:{placement:`top`},children:(0,K.jsx)(ve,{size:`sm`,variant:`ghost`,color:`white/80`,position:`absolute`,top:2,right:2,zIndex:2,_hover:{bg:`white/20`,color:`white`},_active:{bg:`white/30`},onClick:u,"aria-label":`Dismiss`,children:(0,K.jsx)(xe,{})})})]})}var ut=e=>{if(!e||!e.trim())return null;let t=e.trim();return t.includes(`@`)?null:t.split(` `)[0]??null},dt=e=>e<12?`morning`:e<18?`afternoon`:`evening`,ft={morning:{named:`Good morning, `,anonymous:`Good morning`},afternoon:{named:`Good afternoon, `,anonymous:`Good afternoon`},evening:{named:`Good evening, `,anonymous:`Good evening`}},pt=({timeOfDay:e,name:t})=>{let{named:n,anonymous:r}=ft[e];return t?`${n}${t}`:r};function mt(){let{data:e}=ye(),t=ut(e?.user?.name),[n,r]=(0,G.useState)(`morning`);return(0,G.useEffect)(()=>{r(dt(new Date().getHours()))},[]),(0,K.jsx)(z,{as:`h1`,size:`lg`,children:pt({timeOfDay:n,name:t})})}function ht(){return(0,K.jsx)(be,{children:(0,K.jsx)(a,{maxW:`5xl`,padding:6,children:(0,K.jsxs)(E,{gap:6,width:`full`,align:`start`,children:[(0,K.jsx)(mt,{}),(0,K.jsx)(lt,{}),(0,K.jsx)(et,{}),(0,K.jsx)(He,{}),(0,K.jsx)(tt,{}),(0,K.jsx)(Qe,{}),(0,K.jsx)(Ge,{}),(0,K.jsx)(ze,{})]})})})}function gt(){return(0,K.jsx)(_t,{})}function _t(){let e=M(),t=e.query.return_to,n=we(t),r=!!(n&&typeof window<`u`);return(0,G.useEffect)(()=>{r&&n&&e.push(n)},[e,n,r]),r?null:(0,K.jsx)(ht,{})}export{gt as default};
//# sourceMappingURL=_project_-Bqn0rKGJ.js.map