1import"../chunks/CWj6FrbW.js";import"../chunks/CN51-NxK.js";import{g as b,o as N,d as O,e as k,a as m,p as V,b as y,i as T,j as r,m as U,c as p,r as u,f as q,n as B}from"../chunks/Cq_rWCdd.js";import{i as W}from"../chunks/DlYoNXTi.js";import{i as x}from"../chunks/8kT0SYrj.js";import{s as P,a as g}from"../chunks/DYhThC2r.js";import{g as d}from"../chunks/h2Rvv4mb.js";import{p as j}from"../chunks/R-NxJ-cG.js";import{a as D,b as Q,g as z}from"../chunks/CgJDESWy.js";import{S as C}from"../chunks/Bzdt8knV.js";import{T as F}from"../chunks/D8FC3GU1.js";import{W as f}from"../chunks/B3MYfAKp.js";import{t as G}from"../chunks/DhmcPlHV.js";import{e as H,c as M}from"../chunks/Dgru7VC7.js";import{t as a}from"../chunks/D9TDmrZ0.js";var Y=q('<div class="flex items-center justify-center h-full"><div class=" pb-16"><!></div></div>');function le(_,v){y(v,!1);const n=()=>g(h,"$i18n",c),E=()=>g(j,"$page",c),[c,I]=P(),h=b("i18n");let t=U(null);const S=async e=>{const o=H(e.content);if(M((o==null?void 0:o.required_open_webui_version)??"0.0.0",f)){a.error(n().t("Open WebUI version (v{{OPEN_WEBUI_VERSION}}) is lower than required version (v{{REQUIRED_VERSION}})",{OPEN_WEBUI_VERSION:f,REQUIRED_VERSION:(o==null?void 0:o.required_open_webui_version)??"0.0.0"}));return}await Q(localStorage.token,r(t).id,{id:e.id,name:e.name,meta:e.meta,content:e.content,access_grants:e.access_grants}).catch(i=>(a.error(`${i}`),null))&&(a.success(n().t("Tool updated successfully")),G.set(await z(localStorage.token)))};N(async()=>{const e=E().url.searchParams.get("id");if(e){const o=await D(localStorage.token,e).catch(s=>(a.error(`${s}`),d("/workspace/tools"),null));if(o&&!o.write_access){a.error(n().t("You do not have permission to edit this tool")),d("/workspace/tools");return}o&&(T(t,o),r(t))}}),x();var l=O(),w=k(l);{var R=e=>{{let o=B(()=>r(t).access_grants??[]);F(e,{edit:!0,get id(){return r(t).id},get name(){return r(t).name},get meta(){return r(t).meta},get content(){return r(t).content},get accessGrants(){return r(o)},onSave:s=>{S(s)}})}},$=e=>{var o=Y(),s=p(o),i=p(s);C(i,{className:"size-5"}),u(s),u(o),m(e,o)};W(w,e=>{r(t)?e(R):e($,!1)})}m(_,l),V(),I()}export{le as component}; 2//# sourceMappingURL=46.DKtHdYr3.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.