import{_ as z}from"./AbstraButton.vue_vue_type_script_setup_true_lang-C9nnml8T.js";import{e as B,U as C,H as S,r as c,Z as T,G as k,f as d,g as u,k as h,w as s,B as f,Q as _,p as e,R as p,l as t,C as D,$ as V,T as E,aT as N,V as P,j as R,a_ as $,aq as F}from"./jwt-decode.esm-cMnpfgdw.js";import{G as M}from"./PhArrowLeft.vue-Bqqv8k1Q.js";import"./router-D_ihKcxX.js";import{M as j,i as G}from"./member-D47PSkeG.js";import{a as U}from"./organization-CT9gfwyx.js";import"./tables-D4FFTMCL.js";import"./LoadingOutlined-BD61iDZs.js";import"./ts.worker-T_DnATf9.js";import"./string-pgLwzgmr.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},l=new Error().stack;l&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[l]="718e7ec3-c14c-4dff-9a74-ebd8b16edcdd",i._sentryDebugIdIdentifier="sentry-dbid-718e7ec3-c14c-4dff-9a74-ebd8b16edcdd")}catch{}})();const q={class:"ai-skills-page"},H={class:"ai-skills-header"},O={class:"header-left"},Q={key:0,class:"loading-container"},Z={key:0,class:"ai-skills-footer"},J=B({__name:"AiSkills",setup(i){const l=C(),g=S(),n=l.params.organizationId,y=new U,w=new j,b=c(!0),m=c(!1),o=c(""),v=c(!1);T(async()=>{try{const[a,r]=await Promise.all([y.listSkills(n),w.me(n).catch(()=>null)]);a.length>0&&(o.value=a[0].content),v.value=G(r)}catch(a){k.error(a instanceof Error?a.message:"Failed to load skill")}finally{b.value=!1}});async function I(){m.value=!0;try{await y.upsertSkill(n,{content:o.value}),k.success(t.translate("i18n_aiskills_saved"))}catch(a){k.error(a instanceof Error?a.message:"Failed to save")}finally{m.value=!1}}function A(){g.push({name:"projects",params:{organizationId:n}})}return(a,r)=>(u(),d("div",q,[h("div",H,[h("div",O,[s(e(D),{type:"text",class:"back-button",onClick:A},{default:f(()=>[s(e(M),{size:16}),_(" "+p(e(t).translate("i18n_billing_back")),1)]),_:1}),s(e(V),{level:2,style:{margin:"0"}},{default:f(()=>[_(p(e(t).translate("i18n_aiskills_title")),1)]),_:1}),s(e(E),{type:"secondary"},{default:f(()=>[_(p(e(t).translate("i18n_aiskills_subtitle")),1)]),_:1})])]),b.value?(u(),d("div",Q,[s(e(N),{size:"large"})])):(u(),d(P,{key:1},[s(e($),{value:o.value,"onUpdate:value":r[0]||(r[0]=x=>o.value=x),placeholder:e(t).translate("i18n_aiskills_placeholder"),"auto-size":{minRows:20},disabled:!v.value,class:"ai-skills-editor"},null,8,["value","placeholder","disabled"]),v.value?(u(),d("div",Z,[s(z,{type:"primary",loading:m.value,onClick:I},{default:f(()=>[_(p(e(t).translate("i18n_aiskills_save")),1)]),_:1},8,["loading"])])):R("",!0)],64))]))}}),le=F(J,[["__scopeId","data-v-90157cc8"]]);export{le as default};
//# sourceMappingURL=AiSkills-DGRPeKJD.js.map
