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