1import"../chunks/CWj6FrbW.js";import"../chunks/69_IOA4Y.js";import{p as C,g as B,o as D,h as $,i as N,a as g,b as J,s as P,k as l,l as o,e as d,m as p,c as Q,r as G,u,f as H}from"../chunks/DtFjAPax.js";import{i as L}from"../chunks/BKqLVPYF.js";import{k as T}from"../chunks/zkWx44lg.js";import{i as Y}from"../chunks/CWPhcWBV.js";import{t as _}from"../chunks/B4BhJv0K.js";import{g as O}from"../chunks/pzP2z9pO.js";import{c as j,f as z,d as A,e as K}from"../chunks/BTPG6at6.js";import{c as X,g as Z}from"../chunks/B50inXCf.js";import{F as ee}from"../chunks/CPa9WeEH.js";import{g as te}from"../chunks/C2m0p6Eu.js";import{C as oe,e as ne,c as re,W as h}from"../chunks/B9lJIPPW.js";var se=H('<div class="px-[1rem] h-full min-w-0 overflow-x-hidden"><!></div>');function Ee(R,b){C(b,!1);const v=()=>d(V,"$i18n",m),w=()=>d(j,"$config",m),k=()=>d(K,"$settings",m),[m,U]=P(),V=B("i18n");let E=p(!1),S=p(!1),r=p(null);const F=async e=>{var s,a,c;const n=ne(e.content);if(re((n==null?void 0:n.required_open_webui_version)??"0.0.0",h)){_.error(v().t("Open WebUI version (v{{OPEN_WEBUI_VERSION}}) is lower than required version (v{{REQUIRED_VERSION}})",{OPEN_WEBUI_VERSION:h,REQUIRED_VERSION:(n==null?void 0:n.required_open_webui_version)??"0.0.0"}));return}await X(localStorage.token,{id:e.id,name:e.name,meta:e.meta,content:e.content}).catch(f=>(_.error(`${f}`),null))&&(_.success(v().t("Function created successfully")),z.set(await Z(localStorage.token)),A.set(await te(localStorage.token,((a=(s=w())==null?void 0:s.features)==null?void 0:a.enable_direct_connections)&&(((c=k())==null?void 0:c.directConnections)??null),!1,!0)),await O("/admin/functions"))};D(()=>{var e,n;if(!((n=(e=w())==null?void 0:e.features)!=null&&n.enable_plugins)){O("/admin",{replaceState:!0});return}window.addEventListener("message",async i=>{oe.includes(i.origin)&&(l(r,JSON.parse(i.data)),o(r))}),(window.opener??!1)&&window.opener.postMessage("loaded","*"),sessionStorage.function&&(l(r,JSON.parse(sessionStorage.function)),sessionStorage.removeItem("function"),o(r),l(S,!0)),l(E,!0)}),Y();var I=$(),q=N(I);{var x=e=>{var n=$(),i=N(n);T(i,()=>{var s;return(s=o(r))==null?void 0:s.content},s=>{var a=se(),c=Q(a);{let f=u(()=>{var t;return((t=o(r))==null?void 0:t.id)??""}),M=u(()=>{var t;return((t=o(r))==null?void 0:t.name)??""}),W=u(()=>{var t;return((t=o(r))==null?void 0:t.meta)??{description:""}}),y=u(()=>{var t;return((t=o(r))==null?void 0:t.content)??""});ee(c,{get id(){return o(f)},get name(){return o(M)},get meta(){return o(W)},get content(){return o(y)},get clone(){return o(S)},onSave:t=>{F(t)}})}G(a),g(s,a)}),g(e,n)};L(q,e=>{o(E)&&e(x)})}g(R,I),J(),U()}export{Ee as component}; 2//# sourceMappingURL=16.BjavHwAn.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.