import{a as V,e as D}from"./api-DyiqpKJK.js";/* empty css                 */import{W as I}from"./WorkflowStudio-FCyhGD4y.js";import{v as g,c as w,x as o,y as a,B as n,J as d,G as m,O as i,u as N,U as u,r as v,aC as O,i as R,w as W,R as $,H as b,a9 as j,K as y,a2 as A}from"./vue-core-DL-LgTX0.js";import{_ as K}from"./FormattedCodeViewer.vue_vue_type_script_setup_true_lang-BNuI1NCs.js";import{f as L}from"./time-DKCKV6Ug.js";import{u as T,v as U,w as P,e as z,b as G,a as H}from"./element-ui-D3x2y3TA.js";import{_ as x}from"./index-BMvodlwc.js";import"./ui-components-DQ7-U3pr.js";import"./js-yaml-yTPt38rv.js";import"./elkjs-Dm5QV7uy.js";import"./highlightjs-D4ATuRwX.js";const J={class:"feedback-item-card"},M={class:"feedback-time"},S={key:1,class:"feedback-comment"},q={class:"feedback-comment-text full-comment"},Q={class:"feedback-comment-text collapsed-comment"},X={key:2,class:"feedback-meta"},Y=g({__name:"FeedbackItemCard",props:{feedback:{}},setup(_){const l=_,e=w(()=>l.feedback);return(p,t)=>{const c=T;return a(),o("div",J,[n("p",M,i(N(L)(e.value.created_at)),1),e.value.rating!==void 0&&e.value.rating!==null?(a(),d(c,{key:0,modelValue:e.value.rating,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value.rating=r),max:5,"show-text":!1,size:"small",disabled:""},null,8,["modelValue"])):m("",!0),e.value.comment?(a(),o("details",S,[t[1]||(t[1]=n("summary",{class:"detail-item-title"},"评论",-1)),n("p",q,i(e.value.comment),1)])):m("",!0),n("p",Q,i(e.value.comment),1),e.value.metadata&&Object.keys(e.value.metadata).length>0?(a(),o("details",X,[t[2]||(t[2]=n("summary",{class:"detail-item-title"},"元数据",-1)),u(K,{class:"feedback-meta-content",content:e.value.metadata,lang:"json"},null,8,["content"])])):m("",!0)])}}}),Z=x(Y,[["__scopeId","data-v-a25b1194"]]),ee={class:"trace-list-area"},ae={key:0,class:"trace-list"},te=g({__name:"FeedbackPanel",setup(_){const l=v(!1),e=v([]),p=O(),t=w(()=>p.params.id),c=R(I.WORKFLOW_DATA),r=async()=>{if(t.value){l.value=!0;try{const s=await V.get("/",{base:D(),params:c?.value?.name?{workflow_name:c?.value?.name}:void 0});e.value=s.feedbacks}catch(s){H.error(s?.message||"加载反馈失败"),console.error("Failed to load feedbacks:",s)}finally{l.value=!1}}};return W(t,s=>{s&&r()},{immediate:!0}),(s,f)=>{const h=P,F=z,E=G,B=U;return $((a(),o("div",ee,[e.value.length>0?(a(),o("div",ae,[(a(!0),o(b,null,j(e.value,(k,C)=>(a(),o(b,{key:k.feedback_id},[u(Z,{feedback:k},null,8,["feedback"]),C<e.value.length-1?(a(),d(h,{key:0,class:"trace-item-divider"})):m("",!0)],64))),128))])):(a(),d(E,{key:1,class:"empty-state"},{default:y(()=>[u(F,{type:"primary",onClick:r},{default:y(()=>[...f[0]||(f[0]=[A("重新加载",-1)])]),_:1})]),_:1}))])),[[B,l.value]])}}}),fe=x(te,[["__scopeId","data-v-4fb29a7e"]]);export{fe as default};
