import{a as Ue}from"/build/_shared/chunk-CLDMIUQD.js";import"/build/_shared/chunk-XN75JBKL.js";import"/build/_shared/chunk-MCR6MI6B.js";import"/build/_shared/chunk-6KOIYUE5.js";import"/build/_shared/chunk-7AEHTRHU.js";import"/build/_shared/chunk-J63FG4GX.js";import"/build/_shared/chunk-YZRCWBSR.js";import{a as Fe}from"/build/_shared/chunk-NID5ZFDO.js";import"/build/_shared/chunk-JFXZ7I6K.js";import{a as Te,b as Pe,d as Ie,e as Le,f as Me,g as Ce}from"/build/_shared/chunk-6PPMLQ6Q.js";import"/build/_shared/chunk-WBRRPKPD.js";import{a as q}from"/build/_shared/chunk-NN3FAUXK.js";import{a as re}from"/build/_shared/chunk-WL3EVROT.js";import{a as Ae,c as xe,d as Re,e as Ne,f as We}from"/build/_shared/chunk-L52YSAPR.js";import"/build/_shared/chunk-QHVWWGVF.js";import"/build/_shared/chunk-YGINDR4A.js";import{a as Ve}from"/build/_shared/chunk-ANUO2FWR.js";import"/build/_shared/chunk-IXWAFOW5.js";import"/build/_shared/chunk-ICHCA3YF.js";import"/build/_shared/chunk-ZP4JMB7Y.js";import"/build/_shared/chunk-5G5YQZRT.js";import{a as Ee}from"/build/_shared/chunk-BPD542OA.js";import"/build/_shared/chunk-BKXSGWW3.js";import"/build/_shared/chunk-7Z6LVCRT.js";import"/build/_shared/chunk-FXRQ2H3S.js";import"/build/_shared/chunk-GYJW4R24.js";import"/build/_shared/chunk-VX2L2R2M.js";import{b as De}from"/build/_shared/chunk-JSLPGHFC.js";import"/build/_shared/chunk-NF7BQEED.js";import"/build/_shared/chunk-ZH5DBAIE.js";import{a as je}from"/build/_shared/chunk-PAEG26CW.js";import{a as Ot}from"/build/_shared/chunk-F4G4S474.js";import{B as te,C as x,a as P,e as J,u as Oe,w as we}from"/build/_shared/chunk-XIQ3C74K.js";import{a as St}from"/build/_shared/chunk-5TRFQBKG.js";import"/build/_shared/chunk-T6T2AEVA.js";import{a as U}from"/build/_shared/chunk-LR6G3KVW.js";import{d as p}from"/build/_shared/chunk-G5WX4PPA.js";var ht=p(St(),1);te();te();var fe=p(Ot(),1);te();var N=p(P(),1);function wt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function he(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ke(Object(r),!0).forEach(function(n){wt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ke(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dt(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Be(e,t){if(e==null)return{};var r=Dt(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function He(e,t){return jt(e)||Tt(e,t)||Pt(e,t)||It()}function jt(e){if(Array.isArray(e))return e}function Tt(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,o=!1,a=void 0;try{for(var i=e[Symbol.iterator](),s;!(n=(s=i.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){o=!0,a=l}finally{try{!n&&i.return!=null&&i.return()}finally{if(o)throw a}}return r}}function Pt(e,t){if(e){if(typeof e=="string")return ze(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ze(e,t)}}function ze(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function It(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function qe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Je(Object(r),!0).forEach(function(n){Lt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Je(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,a){return a(o)},n)}}function K(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return o.length>=e.length?e.apply(this,o):function(){for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t.apply(r,[].concat(o,s))}}}function oe(e){return{}.toString.call(e).includes("Object")}function Ct(e){return!Object.keys(e).length}function Y(e){return typeof e=="function"}function Et(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function At(e,t){return oe(t)||R("changeType"),Object.keys(t).some(function(r){return!Et(e,r)})&&R("changeField"),t}function xt(e){Y(e)||R("selectorType")}function Rt(e){Y(e)||oe(e)||R("handlerType"),oe(e)&&Object.values(e).some(function(t){return!Y(t)})&&R("handlersType")}function Nt(e){e||R("initialIsRequired"),oe(e)||R("initialType"),Ct(e)&&R("initialContent")}function Wt(e,t){throw new Error(e[t]||e.default)}var Vt={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},R=K(Wt)(Vt),ne={changes:At,selector:xt,handler:Rt,initial:Nt};function Ft(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ne.initial(e),ne.handler(t);var r={current:e},n=K(zt)(r,t),o=K(kt)(r),a=K(ne.changes)(e),i=K(Ut)(r);function s(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(M){return M};return ne.selector(h),h(r.current)}function l(h){Mt(n,o,a,i)(h)}return[s,l]}function Ut(e,t){return Y(t)?t(e.current):t}function kt(e,t){return e.current=qe(qe({},e.current),t),t}function zt(e,t,r){return Y(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var Bt={create:Ft},$e=Bt;var Ht={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}},_e=Ht;function Jt(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return o.length>=e.length?e.apply(this,o):function(){for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t.apply(r,[].concat(o,s))}}}var Ge=Jt;function qt(e){return{}.toString.call(e).includes("Object")}var Ke=qt;function $t(e){return e||Ye("configIsRequired"),Ke(e)||Ye("configType"),e.urls?(_t(),{paths:{vs:e.urls.monacoBase}}):e}function _t(){console.warn(Qe.deprecation)}function Gt(e,t){throw new Error(e[t]||e.default)}var Qe={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
    You are using deprecated way of configuration.

    Instead of using
      monaco.config({ urls: { monacoBase: '...' } })
    use
      monaco.config({ paths: { vs: '...' } })

    For more please check the link https://github.com/suren-atoyan/monaco-loader#config
  `},Ye=Ge(Gt)(Qe),Kt={config:$t},Xe=Kt;var Yt=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return function(o){return r.reduceRight(function(a,i){return i(a)},o)}},Ze=Yt;function et(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],et(e[r],t[r]))}),he(he({},e),t)}var tt=et;var Qt={type:"cancelation",msg:"operation is manually canceled"};function Xt(e){var t=!1,r=new Promise(function(n,o){e.then(function(a){return t?o(Qt):n(a)}),e.catch(o)});return r.cancel=function(){return t=!0},r}var ae=Xt;var Zt=$e.create({config:_e,isInitialized:!1,resolve:null,reject:null,monaco:null}),rt=He(Zt,2),Q=rt[0],ie=rt[1];function er(e){var t=Xe.config(e),r=t.monaco,n=Be(t,["monaco"]);ie(function(o){return{config:tt(o.config,n),monaco:r}})}function tr(){var e=Q(function(t){var r=t.monaco,n=t.isInitialized,o=t.resolve;return{monaco:r,isInitialized:n,resolve:o}});if(!e.isInitialized){if(ie({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),ae(ve);if(window.monaco&&window.monaco.editor)return nt(window.monaco),e.resolve(window.monaco),ae(ve);Ze(rr,or)(ar)}return ae(ve)}function rr(e){return document.body.appendChild(e)}function nr(e){var t=document.createElement("script");return e&&(t.src=e),t}function or(e){var t=Q(function(n){var o=n.config,a=n.reject;return{config:o,reject:a}}),r=nr("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function ar(){var e=Q(function(r){var n=r.config,o=r.resolve,a=r.reject;return{config:n,resolve:o,reject:a}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){nt(r),e.resolve(r)},function(r){e.reject(r)})}function nt(e){Q().monaco||ie({monaco:e})}function ir(){return Q(function(e){var t=e.monaco;return t})}var ve=new Promise(function(e,t){return ie({resolve:e,reject:t})}),cr={config:er,init:tr,__getMonacoInstance:ir},k=cr;var ot=p(P(),1),b=p(P(),1);var at=p(P(),1),ue=p(P(),1),it=p(P(),1),ut=p(P(),1),se=p(P(),1),wr=p(P(),1);var dt=p(P(),1),m=p(P(),1);var le=p(P(),1),ur={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},be=ur,sr={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},lr=sr;function dr({children:e}){return it.default.createElement("div",{style:lr.container},e)}var fr=dr,pr=fr;function mr({width:e,height:t,isEditorReady:r,loading:n,_ref:o,className:a,wrapperProps:i}){return ue.default.createElement("section",{style:{...be.wrapper,width:e,height:t},...i},!r&&ue.default.createElement(pr,null,n),ue.default.createElement("div",{ref:o,style:{...be.fullWidth,...!r&&be.hide},className:a}))}var gr=mr,ct=(0,at.memo)(gr);function hr(e){(0,ut.useEffect)(e,[])}var st=hr;function vr(e,t,r=!0){let n=(0,se.useRef)(!0);(0,se.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)}var I=vr;function X(){}function $(e,t,r,n){return br(e,n)||yr(e,t,r,n)}function br(e,t){return e.editor.getModel(lt(e,t))}function yr(e,t,r,n){return e.editor.createModel(t,r,n?lt(e,n):void 0)}function lt(e,t){return e.Uri.parse(t)}function Sr({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:a,modifiedModelPath:i,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:l=!1,theme:h="light",loading:M="Loading...",options:S={},height:L="100%",width:W="100%",className:C,wrapperProps:_={},beforeMount:V=X,onMount:B=X}){let[O,F]=(0,b.useState)(!1),[E,v]=(0,b.useState)(!0),c=(0,b.useRef)(null),d=(0,b.useRef)(null),T=(0,b.useRef)(null),g=(0,b.useRef)(B),u=(0,b.useRef)(V),H=(0,b.useRef)(!1);st(()=>{let f=k.init();return f.then(w=>(d.current=w)&&v(!1)).catch(w=>w?.type!=="cancelation"&&console.error("Monaco initialization: error:",w)),()=>c.current?G():f.cancel()}),I(()=>{if(c.current&&d.current){let f=c.current.getOriginalEditor(),w=$(d.current,e||"",n||r||"text",a||"");w!==f.getModel()&&f.setModel(w)}},[a],O),I(()=>{if(c.current&&d.current){let f=c.current.getModifiedEditor(),w=$(d.current,t||"",o||r||"text",i||"");w!==f.getModel()&&f.setModel(w)}},[i],O),I(()=>{let f=c.current.getModifiedEditor();f.getOption(d.current.editor.EditorOption.readOnly)?f.setValue(t||""):t!==f.getValue()&&(f.executeEdits("",[{range:f.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),f.pushUndoStop())},[t],O),I(()=>{c.current?.getModel()?.original.setValue(e||"")},[e],O),I(()=>{let{original:f,modified:w}=c.current.getModel();d.current.editor.setModelLanguage(f,n||r||"text"),d.current.editor.setModelLanguage(w,o||r||"text")},[r,n,o],O),I(()=>{d.current?.editor.setTheme(h)},[h],O),I(()=>{c.current?.updateOptions(S)},[S],O);let Z=(0,b.useCallback)(()=>{if(!d.current)return;u.current(d.current);let f=$(d.current,e||"",n||r||"text",a||""),w=$(d.current,t||"",o||r||"text",i||"");c.current?.setModel({original:f,modified:w})},[r,t,o,e,n,a,i]),ee=(0,b.useCallback)(()=>{!H.current&&T.current&&(c.current=d.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...S}),Z(),d.current?.editor.setTheme(h),F(!0),H.current=!0)},[S,h,Z]);(0,b.useEffect)(()=>{O&&g.current(c.current,d.current)},[O]),(0,b.useEffect)(()=>{!E&&!O&&ee()},[E,O,ee]);function G(){let f=c.current?.getModel();s||f?.original?.dispose(),l||f?.modified?.dispose(),c.current?.dispose()}return b.default.createElement(ct,{width:W,height:L,isEditorReady:O,loading:M,_ref:T,className:C,wrapperProps:_})}var Or=Sr,en=(0,ot.memo)(Or);function Dr(e){let t=(0,le.useRef)();return(0,le.useEffect)(()=>{t.current=e},[e]),t.current}var jr=Dr,ce=new Map;function Tr({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:o,path:a,theme:i="light",line:s,loading:l="Loading...",options:h={},overrideServices:M={},saveViewState:S=!0,keepCurrentModel:L=!1,width:W="100%",height:C="100%",className:_,wrapperProps:V={},beforeMount:B=X,onMount:O=X,onChange:F,onValidate:E=X}){let[v,c]=(0,m.useState)(!1),[d,T]=(0,m.useState)(!0),g=(0,m.useRef)(null),u=(0,m.useRef)(null),H=(0,m.useRef)(null),Z=(0,m.useRef)(O),ee=(0,m.useRef)(B),G=(0,m.useRef)(),f=(0,m.useRef)(n),w=jr(a),ye=(0,m.useRef)(!1),pe=(0,m.useRef)(!1);st(()=>{let j=k.init();return j.then(A=>(g.current=A)&&T(!1)).catch(A=>A?.type!=="cancelation"&&console.error("Monaco initialization: error:",A)),()=>u.current?yt():j.cancel()}),I(()=>{let j=$(g.current,e||n||"",t||o||"",a||r||"");j!==u.current?.getModel()&&(S&&ce.set(w,u.current?.saveViewState()),u.current?.setModel(j),S&&u.current?.restoreViewState(ce.get(a)))},[a],v),I(()=>{u.current?.updateOptions(h)},[h],v),I(()=>{!u.current||n===void 0||(u.current.getOption(g.current.editor.EditorOption.readOnly)?u.current.setValue(n):n!==u.current.getValue()&&(pe.current=!0,u.current.executeEdits("",[{range:u.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),u.current.pushUndoStop(),pe.current=!1))},[n],v),I(()=>{let j=u.current?.getModel();j&&o&&g.current?.editor.setModelLanguage(j,o)},[o],v),I(()=>{s!==void 0&&u.current?.revealLine(s)},[s],v),I(()=>{g.current?.editor.setTheme(i)},[i],v);let Se=(0,m.useCallback)(()=>{if(!(!H.current||!g.current)&&!ye.current){ee.current(g.current);let j=a||r,A=$(g.current,n||e||"",t||o||"",j||"");u.current=g.current?.editor.create(H.current,{model:A,automaticLayout:!0,...h},M),S&&u.current.restoreViewState(ce.get(j)),g.current.editor.setTheme(i),s!==void 0&&u.current.revealLine(s),c(!0),ye.current=!0}},[e,t,r,n,o,a,h,M,S,i,s]);(0,m.useEffect)(()=>{v&&Z.current(u.current,g.current)},[v]),(0,m.useEffect)(()=>{!d&&!v&&Se()},[d,v,Se]),f.current=n,(0,m.useEffect)(()=>{v&&F&&(G.current?.dispose(),G.current=u.current?.onDidChangeModelContent(j=>{pe.current||F(u.current.getValue(),j)}))},[v,F]),(0,m.useEffect)(()=>{if(v){let j=g.current.editor.onDidChangeMarkers(A=>{let me=u.current.getModel()?.uri;if(me&&A.find(ge=>ge.path===me.path)){let ge=g.current.editor.getModelMarkers({resource:me});E?.(ge)}});return()=>{j?.dispose()}}return()=>{}},[v,E]);function yt(){G.current?.dispose(),L?S&&ce.set(a,u.current.saveViewState()):u.current.getModel()?.dispose(),u.current.dispose()}return m.default.createElement(ct,{width:W,height:C,isEditorReady:v,loading:l,_ref:H,className:_,wrapperProps:V})}var Pr=Tr,Ir=(0,dt.memo)(Pr),de=Ir;te();var ft=p(P(),1);var y=p(x(),1),pt=({source:e,sourceId:t,logSchema:r,inputSchema:n,setInputSchema:o,outputSchema:a,setOutputSchema:i,canEdit:s,selectedDataset:l,handleDialogChange:h})=>{let M=J(),S=we(),L={minimap:{enabled:!1},scrollbar:{vertical:"hidden"},lineNumbers:"off",wordWrap:"on",tabSize:2},W=()=>{S.submit({datasetId:l?.id,input:JSON.parse(n),expectedOutput:JSON.parse(a),source:e,sourceId:t},{method:"POST",action:U.actions.datapoints.create({projectId:M.projectId}),encType:"application/json"})};return(0,ft.useEffect)(()=>{S.data&&h(!1)},[S.data]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)(q,{children:"Current Log"}),(0,y.jsx)(de,{height:"450px",defaultLanguage:"json",defaultValue:r,theme:"vs-dark",options:{...L,readOnly:!0}})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)(q,{children:"Input"}),(0,y.jsx)(de,{height:"450px",defaultLanguage:"json",defaultValue:n,value:n,onChange:C=>o(C||""),theme:"vs-dark",options:{...L,readOnly:!s}})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)(q,{children:"Expected Output"}),(0,y.jsx)(de,{height:"450px",defaultLanguage:"json",defaultValue:a,value:a,onChange:C=>i(C||""),theme:"vs-dark",options:{...L,readOnly:!s}})]})]}),(0,y.jsx)(Me,{children:(0,y.jsxs)(re,{disabled:!s,onClick:W,children:["Add ",l?`to ${l?.name}`:""]})})]})};var D=p(x(),1),mt=({trace:e})=>{let t=J(),r=De(),[n,o]=(0,N.useState)(!1),[a,i]=(0,N.useState)(fe.DatapointDtoSourceEnum.Trace),[s,l]=(0,N.useState)(""),[h,M]=(0,N.useState)(null),[S,L]=(0,N.useState)(""),[W,C]=(0,N.useState)(""),[_,V]=(0,N.useState)(""),B=r.data?.datasets.find(c=>c.id===h),O=!!B,F=()=>{if(r.data)return;r.load(U.app.project.env.datasets({projectId:t.projectId,envId:t.envId}));let c=window.location.href,T=new URLSearchParams(new URL(c).search).get("logId"),g=e.logs.find(u=>u.id===T);if(!T||!g){i(fe.DatapointDtoSourceEnum.Trace),l(e.id),V(JSON.stringify({...e.logs[0].input,...e.logs.at(-1)?.output},null,2));return}i(fe.DatapointDtoSourceEnum.Log),l(T),V(JSON.stringify({...g.input,...g.output},null,2))},E=c=>{c||(M(null),L(""),V(""),r.reset()),o(c)};return(0,D.jsxs)(Te,{open:n,onOpenChange:E,children:[(0,D.jsx)(Pe,{asChild:!0,children:(0,D.jsx)(re,{onMouseEnter:F,children:"Add to Dataset"})}),(0,D.jsxs)(Ie,{className:"min-h-[700px] max-w-[72rem] overflow-y-scroll",children:[(0,D.jsx)(Le,{children:(0,D.jsx)(Ce,{children:"Add to Dataset"})}),(0,D.jsxs)("div",{children:[(0,D.jsx)(q,{children:"Dataset"}),(0,D.jsxs)(Ae,{onValueChange:c=>{M(c);let d=r.data?.datasets.find(T=>T.id===c);if(d?.isFineTuning){let T={messages:[{role:"",content:""}]},g={messages:[{role:"assistant",content:""}]};L(JSON.stringify(T,null,2)),C(JSON.stringify(g,null,2));return}L(JSON.stringify(d?.inputSchema,null,2)),C(JSON.stringify(d?.outputSchema,null,2))},children:[(0,D.jsx)(Re,{className:"w-[180px]",children:(0,D.jsx)(xe,{placeholder:"Select a dataset"})}),(0,D.jsx)(Ne,{children:r.data?.datasets.map(c=>(0,D.jsx)(We,{value:c.id,children:c.name},c.id))})]})]}),(0,D.jsx)(pt,{source:a,sourceId:s,logSchema:_,inputSchema:S,setInputSchema:L,outputSchema:W,setOutputSchema:C,canEdit:O,selectedDataset:B,handleDialogChange:E})]})]})};var z=p(x(),1),gt=({trace:e})=>{let t=J(),r=[{label:"Traces",to:U.app.project.env.traces({projectId:t.projectId,envId:e.envId})},{label:e.name||"\u2014"}];return(0,z.jsx)(Ee,{breadcrumbs:r,subtitle:()=>(0,z.jsxs)(Ve,{children:["A trace can group LLM calls, vector database calls, and anything else."," ",(0,z.jsx)(Fe,{to:U.external.docs.traces,children:"Trace Docs."})]}),action:()=>(0,z.jsx)(mt,{trace:e}),children:(0,z.jsx)(Ue,{trace:e})})};var bt=p(x(),1),Fn=je(async({api:e,params:t})=>{let r=t.traceId,n=await e.trace.traceControllerGetTrace({traceId:r});return(0,ht.json)({trace:n})});function vt(){let{trace:e}=Oe();return(0,bt.jsx)(gt,{trace:e})}export{vt as default};
