1import"../chunks/CWj6FrbW.js";import"../chunks/69_IOA4Y.js";import{p as ne,g as ve,t as ce,q as E,l as r,a as F,b as ue,s as me,n as v,c as e,d as _,k as c,f as T,e as I,m as w,r as t,aX as fe,u as z}from"../chunks/Djt4fO9t.js";import{i as ge}from"../chunks/DresXHHc.js";import{a as J,s as pe,r as _e}from"../chunks/C22PTw-J.js";import{b as O}from"../chunks/DTAaEhCL.js";import{p as xe}from"../chunks/Bfc47y5P.js";import{i as be}from"../chunks/BqaakOp7.js";import{t as D}from"../chunks/CDvT-V1T.js";import{g as Q}from"../chunks/OMlSDQnC.js";import{u as we}from"../chunks/DwPtBZWH.js";import{c as ye}from"../chunks/vLQJrirC.js";import{A as he}from"../chunks/BAlmVbyh.js";import{S as ke}from"../chunks/B8AXWb8I.js";var $e=T('<div class="ml-1.5 self-center"><!></div>'),Ce=T('<div class="w-full max-h-full"><button class="flex space-x-1"><div class=" self-center"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path fill-rule="evenodd" d="M17 10a.75.75 0 01-.75.75H5.612l4.158 3.96a.75.75 0 11-1.04 1.08l-5.5-5.25a.75.75 0 010-1.08l5.5-5.25a.75.75 0 111.04 1.08L5.612 9.25H16.25A.75.75 0 0117 10z" clip-rule="evenodd"></path></svg></div> <div class=" self-center font-medium text-sm"> </div></button> <form class="flex flex-col max-w-lg mx-auto mt-10 mb-10"><div class=" w-full flex flex-col justify-center"><div class=" text-2xl font-medium font-primary mb-2.5"> </div> <div class="w-full flex flex-col gap-2.5"><div class="w-full"><div class=" text-sm mb-2"> </div> <div class="w-full mt-1"><input class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden" type="text" required=""/></div></div> <div><div class="text-sm mb-2"> </div> <div class=" w-full mt-1"><textarea class="w-full resize-none rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden" rows="4" required=""></textarea></div></div></div></div> <div class="mt-2"><!></div> <div class="flex justify-end mt-2"><div><button type="submit"><div class=" self-center font-medium"> </div> <!></button></div></div></form></div>');function qe(y,V){ne(V,!1);const d=()=>I(Z,"$i18n",N),u=()=>I(we,"$user",N),[N,Y]=me(),Z=ve("i18n");let m=w(!1),f=w(""),g=w(""),h=w([]);const ee=async()=>{if(c(m,!0),r(f).trim()===""||r(g).trim()===""){D.error(d().t("Please fill in all fields.")),c(f,""),c(g,""),c(m,!1);return}const a=await ye(localStorage.token,r(f),r(g),r(h)).catch(n=>{D.error(`${n}`)});a&&(D.success(d().t("Knowledge created successfully.")),Q(`/workspace/knowledge/${a.id}`)),c(m,!1)};be();var k=Ce(),x=e(k),P=v(e(x),2),te=e(P,!0);t(P),t(x);var $=v(x,2),C=e($),q=e(C),ae=e(q,!0);t(q);var W=v(q,2),K=e(W),j=e(K),re=e(j,!0);t(j);var L=v(j,2),A=e(L);_e(A),t(L),t(K);var M=v(K,2),B=e(M),se=e(B,!0);t(B);var R=v(B,2),G=e(R);fe(G),t(R),t(M),t(W),t(C);var H=v(C,2),ie=e(H);{let a=z(()=>{var s,i,l,o;return((l=(i=(s=u())==null?void 0:s.permissions)==null?void 0:i.sharing)==null?void 0:l.knowledge)||((o=u())==null?void 0:o.role)==="admin"}),n=z(()=>{var s,i,l,o;return((l=(i=(s=u())==null?void 0:s.permissions)==null?void 0:i.sharing)==null?void 0:l.public_knowledge)||((o=u())==null?void 0:o.role)==="admin"}),p=z(()=>{var s,i,l,o;return(((l=(i=(s=u())==null?void 0:s.permissions)==null?void 0:i.access_grants)==null?void 0:l.allow_users)??!0)||((o=u())==null?void 0:o.role)==="admin"});he(ie,{accessRoles:["read","write"],get share(){return r(a)},get sharePublic(){return r(n)},get shareUsers(){return r(p)},get accessGrants(){return r(h)},set accessGrants(s){c(h,s)},$$legacy:!0})}t(H);var U=v(H,2),X=e(U),b=e(X),S=e(b),le=e(S,!0);t(S);var oe=v(S,2);{var de=a=>{var n=$e(),p=e(n);ke(p,{}),t(n),F(a,n)};ge(oe,a=>{r(m)&&a(de)})}t(b),t(X),t(U),t($),t(k),ce((a,n,p,s,i,l,o)=>{_(te,a),_(ae,n),_(re,p),J(A,"placeholder",s),_(se,i),J(G,"placeholder",l),pe(b,1,` text-sm px-4 py-2 transition rounded-lg ${r(m)?" cursor-not-allowed bg-gray-100 dark:bg-gray-800":" bg-gray-50 hover:bg-gray-100 dark:bg-gray-850 dark:hover:bg-gray-800"} flex`),b.disabled=r(m),_(le,o)},[()=>d().t("Back"),()=>d().t("Create a knowledge base"),()=>d().t("What are you working on?"),()=>d().t("Name your knowledge base"),()=>d().t("What are you trying to achieve?"),()=>d().t("Describe your knowledge base and objectives"),()=>d().t("Create Knowledge")]),E("click",x,()=>{Q("/workspace/knowledge")}),O(A,()=>r(f),a=>c(f,a)),O(G,()=>r(g),a=>c(g,a)),E("submit",$,xe(()=>{ee()})),F(y,k),ue(),Y()}function Re(y){qe(y,{})}export{Re as component}; 2//# sourceMappingURL=37.DPT9Rcnl.js.map
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.