DuyTa's picture
Upload folder using huggingface_hub
bc20498 verified
import{s as V,l as d,i as $,d as f,j as g,p as N,q as O,e as h,c as v,a as k,f as E,g as q,n as T}from"../chunks/scheduler.DB3Sqaa-.js";import{S as U,i as B,a as p,c as D,t as _,g as P,b as I,d as S,m as w,e as y}from"../chunks/index.CidI1d1E.js";import{g as W}from"../chunks/entry.JtQ7vg2d.js";import{p as j}from"../chunks/stores.m3IJIQGn.js";import{u as C,g as Q,a as F}from"../chunks/index.DPxQAFah.js";import{S as H}from"../chunks/Spinner.zSvxKTtJ.js";import{T as M}from"../chunks/ToolkitEditor.Dt1ppRXF.js";import{c as b,t as z}from"../chunks/index.DPWiq6NR.js";import{e as A,c as G}from"../chunks/index.DYGdzELC.js";import{t as u}from"../chunks/Toaster.svelte_svelte_type_style_lang.C-7zrEBl.js";function J(l){let e,o,t,s;return t=new H({}),{c(){e=h("div"),o=h("div"),I(t.$$.fragment),this.h()},l(r){e=v(r,"DIV",{class:!0});var a=k(e);o=v(a,"DIV",{class:!0});var m=k(o);S(t.$$.fragment,m),m.forEach(f),a.forEach(f),this.h()},h(){E(o,"class","pb-16"),E(e,"class","flex items-center justify-center h-full")},m(r,a){$(r,e,a),q(e,o),w(t,o,null),s=!0},p:T,i(r){s||(_(t.$$.fragment,r),s=!0)},o(r){p(t.$$.fragment,r),s=!1},d(r){r&&f(e),y(t)}}}function K(l){let e,o;return e=new M({props:{edit:!0,id:l[0].id,name:l[0].name,meta:l[0].meta,content:l[0].content}}),e.$on("save",l[3]),{c(){I(e.$$.fragment)},l(t){S(e.$$.fragment,t)},m(t,s){w(e,t,s),o=!0},p(t,s){const r={};s&1&&(r.id=t[0].id),s&1&&(r.name=t[0].name),s&1&&(r.meta=t[0].meta),s&1&&(r.content=t[0].content),e.$set(r)},i(t){o||(_(e.$$.fragment,t),o=!0)},o(t){p(e.$$.fragment,t),o=!1},d(t){y(e,t)}}}function L(l){let e,o,t,s;const r=[K,J],a=[];function m(i,n){return i[0]?0:1}return e=m(l),o=a[e]=r[e](l),{c(){o.c(),t=d()},l(i){o.l(i),t=d()},m(i,n){a[e].m(i,n),$(i,t,n),s=!0},p(i,[n]){let c=e;e=m(i),e===c?a[e].p(i,n):(P(),p(a[c],1,1,()=>{a[c]=null}),D(),o=a[e],o?o.p(i,n):(o=a[e]=r[e](i),o.c()),_(o,1),o.m(t.parentNode,t))},i(i){s||(_(o),s=!0)},o(i){p(o),s=!1},d(i){i&&f(t),a[e].d(i)}}}function X(l,e,o){let t,s;g(l,j,n=>o(4,t=n));const r=N("i18n");g(l,r,n=>o(5,s=n));let a=null;const m=async n=>{console.log(n);const c=A(n.content);if(G((c==null?void 0:c.required_open_webui_version)??"0.0.0",b)){console.log("Version is lower than required"),u.error(s.t("Open WebUI version (v{{OPEN_WEBUI_VERSION}}) is lower than required version (v{{REQUIRED_VERSION}})",{OPEN_WEBUI_VERSION:b,REQUIRED_VERSION:(c==null?void 0:c.required_open_webui_version)??"0.0.0"}));return}await C(localStorage.token,a.id,{id:n.id,name:n.name,meta:n.meta,content:n.content}).catch(R=>(u.error(R),null))&&(u.success(s.t("Tool updated successfully")),z.set(await Q(localStorage.token)))};return O(async()=>{console.log("mounted");const n=t.url.searchParams.get("id");n&&(o(0,a=await F(localStorage.token,n).catch(c=>(u.error(c),W("/workspace/tools"),null))),console.log(a))}),[a,r,m,n=>{m(n.detail)}]}class le extends U{constructor(e){super(),B(this,e,X,L,V,{})}}export{le as component};
//# sourceMappingURL=24.DFtZOAw_.js.map