PageSourceSearch

https://sudantha123-my-stream.hf.space/_app/immutable/nodes/15.ilkHtdEt.js

js sudantha123-my-stream.hf.space collected 2026-10-04 17:26:03 UTC 26,668 bytes, 4 lines download raw bytes

1import"../chunks/CWj6FrbW.js";import"../chunks/69_IOA4Y.js";import{p as yt,g as Gt,c as r,i as me,l as e,n as i,r as a,t as L,z as s,d as w,q as F,a as _,aC as Vt,C as ga,B as rt,h as nt,u as E,b as bt,e as ge,s as $t,f as k,o as At,k as v,D as xt,A as _a,x as xa,y as wa,j as ha,$ as ya,m as C,aG as ba,b4 as $a}from"../chunks/DAutZaRy.js";import{i as W}from"../chunks/DTtvsU5y.js";import{i as kt}from"../chunks/DjewLkXc.js";import{W as ka,d as Ae,u as Sa,c as Jt,f as st,e as Ca}from"../chunks/C6Fb5Erg.js";import{g as Re}from"../chunks/D8-P3Sxj.js";import{b as jt,l as Da,c as Fa,g as ot,d as La,e as Ha,t as Ia,f as Na,a as wt}from"../chunks/Ba9DAdeb.js";import{e as Ea}from"../chunks/Bn968l-9.js";import{h as Ma}from"../chunks/CL05SSCs.js";import{r as Pa,a as Je}from"../chunks/Cui6wHWG.js";import{a as ja,b as za}from"../chunks/CFl6QLmk.js";import{p as ve,b as zt}from"../chunks/DxlqTe30.js";import{i as We,r as Ba,t as Bt}from"../chunks/d2906HEn.js";import{t as O}from"../chunks/CpYI-2uV.js";import{f as Ta}from"../chunks/BUyk60oV.js";import{T as ue}from"../chunks/Dj_Fi17x.js";import{C as Tt}from"../chunks/DwTisAtH.js";import{g as Ke}from"../chunks/VN9XkWF8.js";import{s as Oa}from"../chunks/DU8Bp34v.js";import{D as Ua}from"../chunks/Cu5iL7Zl.js";import{D as Ga}from"../chunks/EkZY6ji9.js";import{G as Wt}from"../chunks/Cn1XSdzS.js";import{S as Va}from"../chunks/ASXAQc8g.js";import{D as Aa}from"../chunks/CyBZMG9O.js";import{D as Ja}from"../chunks/XJXd9AGO.js";import{S as Kt}from"../chunks/BnkkLRSR.js";import{G as Wa}from"../chunks/CsV2xx_M.js";import{E as Ka}from"../chunks/CQv5PvPR.js";import{V as Ra,H as qa}from"../chunks/3Tp1gkaO.js";import{I as Xa,M as Ya}from"../chunks/DQFM0dxu.js";import{S as Za}from"../chunks/myOa2dL0.js";import{X as Qa}from"../chunks/fQv7DDzW.js";import{V as er}from"../chunks/Doa28WRB.js";import{T as tr}from"../chunks/CsT0pxvr.js";import{C as ar}from"../chunks/CCtZrbAU.js";import{S as rr}from"../chunks/BfvxFurb.js";import{S as or}from"../chunks/DN0Fmg9g.js";import{C as Ot}from"../chunks/DC-BnbfU.js";import{C as Ut}from"../chunks/CXfTv2WL.js";var nr=k('<div class="flex gap-2 justify-between items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer rounded-xl"><div class="flex gap-2 items-center"><!> <div class="flex items-center"> </div></div> <div><!></div></div> <hr class="border-gray-50 dark:border-gray-850/30 my-1"/>',1),sr=k('<!> <button class="select-none flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl w-full"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-3.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125"></path></svg> <div class="flex items-center"> </div></button> <button class="select-none flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl w-full"><!> <div class="flex items-center"> </div></button> <button class="select-none flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl w-full"><!> <div class="flex items-center"> </div></button> <button class="select-none flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl w-full"><!> <div class="flex items-center"> </div></button> <hr class="border-gray-50 dark:border-gray-850/30 my-1"/> <button class="select-none flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl w-full"><!> <div class="flex items-center"> </div></button>',1),lr=k('<div slot="content"><!></div>');function ir(Ne,M){yt(M,!1);const y=()=>ge(ne,"$i18n",t),[t,q]=$t(),ne=Gt("i18n");let ee=ve(M,"func",12),se=ve(M,"editHandler",8),Ee=ve(M,"shareHandler",8),Y=ve(M,"cloneHandler",8),ye=ve(M,"exportHandler",8),be=ve(M,"deleteHandler",8),fe=ve(M,"toggleGlobalHandler",8),pe=ve(M,"onClose",8),$e=ve(M,"show",12,!1);const U=()=>{$e(!1),pe()()};kt(),Ua(Ne,{onOpenChange:P=>{P===!1&&pe()()},get show(){return $e()},set show(P){$e(P)},children:(P,te)=>{{let Z=E(()=>(y(),s(()=>y().t("More"))));ue(P,{get content(){return e(Z)},children:(G,ke)=>{var ae=nt(),le=me(ae);Oa(le,M,"default",{},null),_(G,ae)},$$slots:{default:!0}})}},$$slots:{default:!0,content:(P,te)=>{var Z=lr(),G=r(Z);Ga(G,{className:"min-w-[180px]",children:(ke,ae)=>{var le=sr(),Se=me(le);{var Me=xe=>{var Fe=nr(),o=me(Fe),c=r(o),u=r(c);Wa(u,{});var h=i(u,2),H=r(h,!0);a(h),a(c);var $=i(c,2),Qe=r($);Kt(Qe,{get state(){return ee().is_global},set state(ie){ee(ee().is_global=ie,!0)},$$events:{change(...ie){var Le;(Le=fe())==null||Le.apply(this,ie)}},$$legacy:!0}),a($),a(o),Vt(2),L(ie=>w(H,ie),[()=>(y(),s(()=>y().t("Global")))]),_(xe,Fe)},Pe=ga(()=>(rt(ee()),s(()=>["filter","action"].includes(ee().type))));W(Se,xe=>{e(Pe)&&xe(Me)})}var j=i(Se,2),Ce=i(r(j),2),qe=r(Ce,!0);a(Ce),a(j);var V=i(j,2),re=r(V);Va(re,{});var je=i(re,2),lt=r(je,!0);a(je),a(V);var _e=i(V,2),ze=r(_e);Aa(ze,{});var Be=i(ze,2),it=r(Be,!0);a(Be),a(_e);var De=i(_e,2),Xe=r(De);Ja(Xe,{});var Ye=i(Xe,2),Ze=r(Ye,!0);a(Ye),a(De);var Te=i(De,4),Oe=r(Te);Wt(Oe,{strokeWidth:"2"});var Ue=i(Oe,2),dt=r(Ue,!0);a(Ue),a(Te),L((xe,Fe,o,c,u)=>{w(qe,xe),w(lt,Fe),w(it,o),w(Ze,c),w(dt,u)},[()=>(y(),s(()=>y().t("Edit"))),()=>(y(),s(()=>y().t("Share"))),()=>(y(),s(()=>y().t("Clone"))),()=>(y(),s(()=>y().t("Export"))),()=>(y(),s(()=>y().t("Delete")))]),F("click",j,()=>{se()(),U()}),F("click",V,()=>{Ee()(),U()}),F("click",_e,()=>{Y()(),U()}),F("click",De,()=>{ye()(),U()}),F("click",Te,()=>{be()(),U()}),_(ke,le)},$$slots:{default:!0}}),a(Z),_(P,Z)}},$$legacy:!0}),bt(),q()}
1var dr=k('<div class="self-center pl-1.5 translate-y-[0.5px] rounded-l-xl bg-transparent"><button class="p-0.5 rounded-full hover:bg-gray-100 dark:hover:bg-gray-900 transition"><!></button></div>'),cr=k('<div class="truncate text-[13px] leading-5 text-gray-800 group-hover:underline dark:text-gray-200"> </div>'),vr=k('<div class="min-w-0 max-w-[40%] shrink-0 truncate text-[11px] leading-5 text-gray-500"> </div>'),ur=k('<div class="shrink-0 truncate text-[11px] leading-5 text-gray-400 dark:text-gray-600"> </div>'),mr=k('<div class="mt-0.5 truncate text-[0.6875rem] leading-4 text-gray-400 dark:text-gray-600"> </div>'),fr=k('<div class="truncate"> </div>'),ht=k('<button class="flex size-6 items-center justify-center rounded-lg text-gray-400 transition dark:text-gray-500" type="button"><!></button>'),pr=k('<button class="flex size-6 items-center justify-center rounded-lg text-gray-400 transition dark:text-gray-500" type="button"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M9.594 3.94c.09-.542.56-.940 1.11-.940h2.593c.55 0 1.02.398 1.11.940l.213 1.281c.063.374.313.686.645.870.074.040.147.083.220.127.325.196.720.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.370.490l1.296 2.247a1.125 1.125 0 0 1-.260 1.431l-1.003.827c-.293.241-.438.613-.430.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.750.430.991l1.004.827c.424.350.534.955.260 1.430l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.750-.072-1.076.124a6.47 6.47 0 0 1-.220.128c-.331.183-.581.495-.644.869l-.213 1.281c-.090.543-.560.940-1.110.940h-2.594c-.550 0-1.019-.398-1.110-.940l-.213-1.281c-.062-.374-.312-.686-.644-.870a6.52 6.52 0 0 1-.220-.127c-.325-.196-.720-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.490l-1.297-2.247a1.125 1.125 0 0 1 .260-1.431l1.004-.827c.292-.240.437-.613.430-.991a6.932 6.932 0 0 1 0-.255c.007-.380-.138-.751-.430-.992l-1.004-.827a1.125 1.125 0 0 1-.260-1.430l1.297-2.247a1.125 1.125 0 0 1 1.370-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.220-.128.332-.183.582-.495.644-.869l.214-1.280Z"></path><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"></path></svg></button>'),gr=k('<!> <!> <!> <button class="flex h-6 items-center" type="button"><!></button>',1),_r=k('<div class="group flex min-h-8 w-full cursor-pointer items-center gap-2 overflow-hidden rounded-xl px-2 py-1 text-left" role="button" tabindex="0"><div class="flex min-w-0 flex-1 items-center gap-1 overflow-hidden"><div class="flex min-w-0 flex-1 flex-col overflow-hidden"><div class="flex min-w-0 items-center gap-2 overflow-hidden"><div class="flex min-w-0 flex-1 items-center gap-2 overflow-hidden"><div class="shrink-0 rounded-sm bg-gray-500/20 px-1 text-[10px] uppercase leading-4 text-gray-700 dark:text-gray-200"> </div> <!> <!> <!></div></div> <!></div></div> <div class="hidden max-w-44 shrink-0 self-center truncate text-right text-[11px] leading-5 text-gray-500 dark:text-gray-500 md:block"><!></div> <div class="ml-2 flex shrink-0 flex-row items-center gap-1.5 self-center"><!></div></div>'),xr=k('<div class="my-1"><div class="flex w-full items-center gap-2 px-1.5 pb-0.5 text-xs text-gray-400 dark:text-gray-600"><button class="flex min-w-0 flex-1 items-center gap-1 py-0.5 text-left" type="button"> <!></button> <div class="hidden w-44 shrink-0 md:block"></div> <button class="flex w-36 shrink-0 items-center justify-end gap-1 py-0.5 text-right" type="button"> <!></button></div> <div class="grid gap-y-0.5"></div></div>'),wr=k('<div class="flex w-full flex-col items-center justify-center py-16 pb-24"><div class="max-w-sm text-center text-gray-900 dark:text-gray-100"><div class="mb-1.5 text-sm"> </div> <div class="text-center text-xs leading-5 text-gray-500"> </div></div></div>'),hr=k('<div class=" text-sm text-gray-500 truncate"> <span class="  font-normal"> </span>.</div>'),yr=k('<div class="text-sm text-gray-500"><div class=" bg-yellow-500/20 text-yellow-700 dark:text-yellow-200 rounded-lg px-4 py-3"><div> </div> <ul class=" mt-1 list-disc pl-4 text-xs">
1<li> </li> <li> </li></ul></div> <div class="my-3"> </div></div>'),br=k('<div class="px-2.5 w-full"><div class="flex flex-col gap-1 px-1 mt-0.5"><div class="flex justify-between items-center mb-1 w-full"><input id="documents-import-input" type="file" accept=".json" hidden=""/> <div class="flex justify-between items-center w-full"><div class="flex items-center md:self-center text-sm font-normal px-0.5 gap-1.5 shrink-0"><div> </div> <div class="text-sm font-normal text-gray-500 dark:text-gray-500 opacity-60"> </div></div> <div class="flex w-full justify-end"><!></div></div></div></div> <div class="space-y-1"><div class="flex h-8 flex-1 items-center w-full gap-2"><div class="flex min-w-0 flex-1"><div class=" self-center ml-1 mr-3"><!></div> <input class=" w-full text-sm pr-4 py-1 rounded-r-xl outline-hidden bg-transparent"/> <!></div> <div class="flex max-w-[55%] shrink-0 overflow-x-auto scrollbar-none"><div class="flex w-fit gap-0.5 text-center text-sm rounded-full bg-transparent whitespace-nowrap"><!> <!></div></div></div> <!></div> <!></div> <!> <!> <!> <!>',1),$r=k('<div class="w-full h-full flex justify-center items-center"><!></div>'),kr=k("<!> <!>",1);function Sr(Ne,M){yt(M,!1);const y=()=>ge(Sa,"$user",se),t=()=>ge(ye,"$i18n",se),q=()=>ge(Jt,"$config",se),ne=()=>ge(Ca,"$settings",se),ee=()=>ge(ka,"$WEBUI_NAME",se),[se,Ee]=$t(),{saveAs:Y}=Ta;We.extend(Ba);const ye=Gt("i18n");let be=C(!1),fe=C(),pe=C(),$e=C(),U=C(""),P=C("updated_at"),te=C("desc"),Z=C(null),G=C(""),ke,ae=C(""),le=C(!1),Se=C(!1),Me=C(!1),Pe=C(!1),j=C(null),Ce=C(!1),qe=C(!1),V=C(null),re=C([]);const je=()=>{clearTimeout(ke),ke=setTimeout(()=>{_e()},300)},lt=async()=>{const o=await Ha(localStorage.token).catch(c=>(O.error(`${c}`),null));if(o){let c=new Blob([JSON.stringify(o)],{type:"application/json"});Y(c,`functions-export-${Date.now()}.json`)}},_e=()=>{v(re,(e(V)??[]).filter(o=>{var c,u,h,H,$;return(e(ae)!==""?o.type===e(ae):!0)&&(e(G)===""||o.name.toLowerCase().includes(e(G).toLowerCase())||o.id.toLowerCase().includes(e(G).toLowerCase())||(((c=o.user)==null?void 0:c.name)||"").toLowerCase().includes(e(G).toLowerCase())||(((u=o.user)==null?void 0:u.email)||"").toLowerCase().includes(e(G).toLowerCase())||(((h=o.user)==null?void 0:h.username)||"").toLowerCase().includes(e(G).toLowerCase()))&&(e(U)===""||e(U)==="created"&&o.user_id===((H=y())==null?void 0:H.id)||e(U)==="shared"&&o.user_id!==(($=y())==null?void 0:$.id))}).sort((o,c)=>{const u=e(te)==="asc"?1:-1;return e(P)==="name"?u*(o.name??"").localeCompare(c.name??""):u*((o.updated_at??0)-(c.updated_at??0))}))},ze=o=>{e(P)===o?v(te,e(te)==="asc"?"desc":"asc"):(v(P,o),v(te,o==="updated_at"?"desc":"asc"))},Be=o=>{Re(`/admin/functions/edit?id=${encodeURIComponent(o.id)}`)},it=o=>o instanceof Element&&!!o.closest('button, a, input, [role="menu"]'),De=async o=>{const c=await wt(localStorage.token,o.id).catch($=>(O.error(`${$}`),null));O.success(t().t("Redirecting you to Open WebUI Community"));const u="https://openwebui.com",h=await window.open(`${u}/functions/create`,"_blank"),H=$=>{$.origin===u&&$.data==="loaded"&&(h.postMessage(JSON.stringify(c),"*"),window.removeEventListener("message",H))};window.addEventListener("message",H,!1)},Xe=async o=>{const c=await wt(localStorage.token,o.id).catch(u=>(O.error(`${u}`),null));c&&(sessionStorage.function=JSON.stringify({...c,id:`${c.id}_clone`,name:`${c.name} (${t().t("Clone")})`}),Re("/admin/functions/create"))},Ye=async o=>{const c=await wt(localStorage.token,o.id).catch(u=>(O.error(`${u}`),null));if(c){let u=new Blob([JSON.stringify([c])],{type:"application/json"});Y(u,`function-${c.id}-export-${Date.now()}.json`)}},Ze=async o=>{var u,h,H;await La(localStorage.token,o.id).catch($=>(O.error(`${$}`),null))&&(O.success(t().t("Function deleted successfully")),v(V,e(V).filter($=>$.id!==o.id)),st.set(await ot(localStorage.token)),Ae.set(await Ke(localStorage.token,((h=(u=q())==null?void 0:u.features)==null?void 0:h.enable_direct_connections)&&(((H=ne())==null?void 0:H.directConnections)??null),!1,!0)))},Te=async o=>{var u,h,H;await Na(localStorage.token,o.id).catch($=>{O.error(`${$}`)})&&(o.is_global?o.type==="filter"?O.success(t().t("Filter is now globally enabled")):O.success(t().t("Function is now globally enabled")):o.type==="filter"?O.success(t().t("Filter is now globally disabled")):O.success(t().t("Function is now globally disabled")),st.set(await ot(localStorage.token)),Ae.set(await Ke(localStorage.token,((h=(u=q())==null?void 0:u.features)==null?void 0:h.enable_direct_connections)&&(((H=ne())==null?void 0:H.directConnections)??null),!1,!0)))};At(async()=>{v(U,(localStorage==null?void 0:localStorage.workspaceViewOption)||""),v(V,await jt(localStorage.token).catch(h=>(O.error(`${h}`),[]))),await xt(),v(qe,!0);const o=h=>{h.key==="Shift"&&v(be,!0)},c=h=>{h.key==="Shift"&&v(be,!1)},u=()=>{v(be,!1)};return window.addEventListener("keydown",o),window.addEventListener("keyup",c),window.addEventListener("blur",u),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",c),window.removeEventListener("blur",u)}}),_a(()=>{clearTimeout(ke)}),xa(()=>(e(V),e(ae),e(U),e(P),e(te)),()=>{e(V)&&e(ae)!==void 0&&e(U)!==void 0&&e(P)!==void 0&&e(te)!==void 0&&_e()}),wa(),kt();var Oe=kr();Ma("1hdw0md",o=>{ha(c=>{ya.title=`
2		${c??""} / ${ee()??""}
3	`},[()=>(t(),s(()=>t().t("Functions")))])});var Ue=me(Oe);Xa(Ue,{loadUrlHandler:async o=>await Da(localStorage.token,o),onImport:o=>{sessionStorage.function=JSON.stringify({...o}),Re("/admin/functions/create")},get show(){return e(le)},set show(o){v(le,o)},$$legacy:!0});var dt=i(Ue,2);{var xe=o=>{var c=br(),u=me(c),h=r(u),H=r(h),$=r(H);zt($,l=>v(fe,l),()=>e(fe));var Qe=i($,2),ie=r(Qe),Le=r(ie),Rt=r(Le,!0);a(Le);var St=i(Le,2),qt=r(St,!0);a(St),a(ie);var Ct=i(ie,2),Xt=r(Ct);{let l=E(()=>(t(),e(le),e(fe),y(),e(V),s(()=>{var d,m;return[{id:"functions-new",label:t().t("Create"),href:"/admin/functions/create"},{id:"functions-import-link",label:t().t("Import From Link"),onClick:()=>{v(le,!0)}},{id:"functions-import",label:t().t("Import JSON"),onClick:()=>{var p;return(p=e(fe))==null?void 0:p.click()},visible:((d=y())==null?void 0:d.role)==="admin"},{id:"functions-export",label:t().t("Export JSON"),onClick:lt,visible:((m=y())==null?void 0:m.role)==="admin"&&e(V).length>0}]})));or(Xt,{get actions(){return e(l)}})}a(Ct),a(Qe),a(H),a(h);var ct=i(h,2),vt=r(ct),ut=r(vt),mt=r(ut),Yt=r(mt);Za(Yt,{className:"size-3.5"}),a(mt);var Ge=i(mt,2);Pa(Ge);var Zt=i(Ge,2);{var Qt=l=>{var d=dr(),m=r(d),p=r(m);Qa(p,{className:"size-3",strokeWidth:"2"}),a(m),a(d),F("click",m,()=>{v(G,""),je()}),_(l,d)};W(Zt,l=>{e(G)&&l(Qt)})}a(ut);var et=i(ut,2),Dt=r(et),Ft=r(Dt);
3er(Ft,{align:"end",onChange:async l=>{localStorage.workspaceViewOption=l,await xt()},get value(){return e(U)},set value(l){v(U,l)},$$legacy:!0});var ea=i(Ft,2);{let l=E(()=>(t(),s(()=>[{value:"pipe",label:t().t("Pipe")},{value:"filter",label:t().t("Filter")},{value:"action",label:t().t("Action")},{value:"event",label:t().t("Event")}])));tr(ea,{align:"end",get items(){return e(l)},get value(){return e(ae)},set value(d){v(ae,d)},$$legacy:!0})}a(Dt),a(et),zt(et,l=>v($e,l),()=>e($e)),a(vt);var ta=i(vt,2);{var aa=l=>{var d=xr(),m=r(d),p=r(m),A=r(p),X=i(A);{var K=z=>{var n=nt(),Ie=me(n);{var Q=I=>{Ut(I,{className:"size-2"})},de=I=>{Ot(I,{className:"size-2"})};W(Ie,I=>{e(te)==="asc"?I(Q):I(de,-1)})}_(z,n)};W(X,z=>{e(P)==="name"&&z(K)})}a(p);var R=i(p,4),He=r(R),tt=i(He);{var ft=z=>{var n=nt(),Ie=me(n);{var Q=I=>{Ut(I,{className:"size-2"})},de=I=>{Ot(I,{className:"size-2"})};W(Ie,I=>{e(te)==="asc"?I(Q):I(de,-1)})}_(z,n)};W(tt,z=>{e(P)==="updated_at"&&z(ft)})}a(R),a(m);var Ve=i(m,2);Ea(Ve,5,()=>e(re),z=>z.id,(z,n,Ie)=>{var Q=_r(),de=r(Q),I=r(de),pt=r(I),Nt=r(pt),gt=r(Nt),la=r(gt,!0);a(gt);var Et=i(gt,2);ue(Et,{get content(){return e(n),s(()=>e(n).id)},className:"min-w-0",placement:"top-start",children:(f,x)=>{var g=cr(),b=r(g,!0);a(g),L(()=>w(b,(e(n),s(()=>e(n).name)))),_(f,g)},$$slots:{default:!0}});var Mt=i(Et,2);{var ia=f=>{var x=vr(),g=r(x);a(x),L(()=>w(g,`v${e(n),s(()=>{var b,S,N;return((N=(S=(b=e(n))==null?void 0:b.meta)==null?void 0:S.manifest)==null?void 0:N.version)??""})??""}`)),_(f,x)};W(Mt,f=>{e(n),s(()=>{var x,g,b;return(b=(g=(x=e(n))==null?void 0:x.meta)==null?void 0:g.manifest)==null?void 0:b.version})&&f(ia)})}var da=i(Mt,2);{let f=E(()=>(rt(We),e(n),s(()=>We(e(n).updated_at*1e3).format("LLLL"))));ue(da,{get content(){return e(f)},children:(x,g)=>{var b=ur(),S=r(b,!0);a(b),L(N=>w(S,N),[()=>(rt(We),e(n),s(()=>We(e(n).updated_at*1e3).fromNow()))]),_(x,b)},$$slots:{default:!0}})}a(Nt),a(pt);var ca=i(pt,2);{var va=f=>{{let x=E(()=>(e(n),s(()=>{var g,b;return(b=(g=e(n))==null?void 0:g.meta)==null?void 0:b.description})));ue(f,{get content(){return e(x)},className:"min-w-0",placement:"top-start",children:(g,b)=>{var S=mr(),N=r(S,!0);a(S),L(()=>w(N,(e(n),s(()=>{var J,we;return(we=(J=e(n))==null?void 0:J.meta)==null?void 0:we.description})))),_(g,S)},$$slots:{default:!0}})}};W(ca,f=>{e(n),s(()=>{var x,g;return(g=(x=e(n))==null?void 0:x.meta)==null?void 0:g.description})&&f(va)})}a(I),a(de);var _t=i(de,2),ua=r(_t);{let f=E(()=>(e(n),t(),s(()=>{var x,g;return((g=(x=e(n))==null?void 0:x.user)==null?void 0:g.email)??t().t("Deleted User")})));ue(ua,{get content(){return e(f)},className:"min-w-0",placement:"top-start",children:(x,g)=>{var b=fr(),S=r(b,!0);a(b),L(N=>w(S,N),[()=>(rt(Bt),e(n),t(),s(()=>{var N,J,we,B;return Bt(((J=(N=e(n))==null?void 0:N.user)==null?void 0:J.name)??((B=(we=e(n))==null?void 0:we.user)==null?void 0:B.email)??t().t("Deleted User"))}))]),_(x,b)},$$slots:{default:!0}})}a(_t);var Pt=i(_t,2),ma=r(Pt);{var fa=f=>{{let x=E(()=>(t(),s(()=>t().t("Delete"))));ue(f,{get content(){return e(x)},children:(g,b)=>{var S=ht(),N=r(S);Wt(N,{className:"size-4"}),a(S),L(J=>Je(S,"aria-label",J),[()=>(t(),s(()=>t().t("Delete")))]),F("click",S,J=>{J.preventDefault(),J.stopPropagation(),Ze(e(n))}),_(g,S)},$$slots:{default:!0}})}},pa=f=>{var x=gr(),g=me(x);{var b=B=>{{let oe=E(()=>(t(),s(()=>t().t("Support"))));ue(B,{get content(){return e(oe)},children:(he,D)=>{var T=ht(),ce=r(T);qa(ce,{className:"size-4"}),a(T),L(at=>Je(T,"aria-label",at),[()=>(t(),s(()=>t().t("Support")))]),F("click",T,at=>{at.preventDefault(),at.stopPropagation(),v(j,e(n)),v(Me,!0)}),_(he,T)},$$slots:{default:!0}})}};W(g,B=>{e(n),s(()=>{var oe,he,D;return((D=(he=(oe=e(n))==null?void 0:oe.meta)==null?void 0:he.manifest)==null?void 0:D.funding_url)??!1})&&B(b)})}var S=i(g,2);{let B=E(()=>(t(),s(()=>t().t("Valves"))));ue(S,{get content(){return e(B)},children:(oe,he)=>{var D=pr();L(T=>Je(D,"aria-label",T),[()=>(t(),s(()=>t().t("Valves")))]),F("click",D,T=>{T.preventDefault(),T.stopPropagation(),v(j,e(n)),v(Pe,!0)}),_(oe,D)},$$slots:{default:!0}})}var N=i(S,2);{let B=E(()=>(e(Z),e(n),s(()=>e(Z)===e(n).id)));ir(N,{get func(){return e(n)},get show(){return e(B)},editHandler:()=>{Re(`/admin/functions/edit?id=${encodeURIComponent(e(n).id)}`)},shareHandler:()=>{De(e(n))},cloneHandler:()=>{Xe(e(n))},exportHandler:()=>{Ye(e(n))},deleteHandler:async()=>{v(j,e(n)),v(Ce,!0)},toggleGlobalHandler:()=>{["filter","action"].includes(e(n).type)&&Te(e(n))},onClose:()=>
3{v(Z,null)},children:(oe,he)=>{var D=ht(),T=r(D);Ka(T,{className:"size-4"}),a(D),L(ce=>Je(D,"aria-label",ce),[()=>(t(),s(()=>t().t("Function Menu")))]),F("click",D,ce=>{ce.preventDefault(),ce.stopPropagation(),v(Z,e(Z)===e(n).id?null:e(n).id)}),_(oe,D)},$$slots:{default:!0}})}var J=i(N,2),we=r(J);{let B=E(()=>(e(n),t(),s(()=>e(n).is_active?t().t("Enabled"):t().t("Disabled"))));ue(we,{get content(){return e(B)},children:(oe,he)=>{Kt(oe,{get state(){return e(n).is_active},set state(D){e(n).is_active=D,$a(()=>e(re))},$$events:{change:async()=>{var D,T,ce;Ia(localStorage.token,e(n).id),Ae.set(await Ke(localStorage.token,((T=(D=q())==null?void 0:D.features)==null?void 0:T.enable_direct_connections)&&(((ce=ne())==null?void 0:ce.directConnections)??null),!1,!0))}},$$legacy:!0})},$$slots:{default:!0}})}a(J),F("click",J,B=>{B.stopPropagation(),B.preventDefault()}),_(f,x)};W(ma,f=>{e(be)?f(fa):f(pa,-1)})}a(Pt),a(Q),L(()=>w(la,(e(n),s(()=>e(n).type)))),F("click",Q,f=>{it(f.target)||Be(e(n))}),F("keydown",Q,f=>{f.currentTarget===f.target&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),Be(e(n)))}),_(z,Q)}),a(Ve),a(d),L((z,n)=>{w(A,`${z??""} `),w(He,`${n??""} `)},[()=>(t(),s(()=>t().t("Title"))),()=>(t(),s(()=>t().t("Updated at")))]),F("click",p,()=>ze("name")),F("click",R,()=>ze("updated_at")),_(l,d)},ra=l=>{var d=wr(),m=r(d),p=r(m),A=r(p,!0);a(p);var X=i(p,2),K=r(X,!0);a(X),a(m),a(d),L((R,He)=>{w(A,R),w(K,He)},[()=>(t(),s(()=>t().t("No functions found"))),()=>(t(),s(()=>t().t("Try adjusting your search or filter to find what you are looking for.")))]),_(l,d)};W(ta,l=>{e(re),s(()=>(e(re)??[]).length!==0)?l(aa):l(ra,-1)})}a(ct);var oa=i(ct,2);{var na=l=>{{let d=E(()=>(t(),s(()=>t().t("Discover a function")))),m=E(()=>(t(),s(()=>t().t("Discover, download, and explore custom functions"))));ar(l,{href:"https://openwebui.com/functions",get title(){return e(d)},get description(){return e(m)}})}};W(oa,l=>{q(),s(()=>{var d;return(d=q())==null?void 0:d.features.enable_community_sharing})&&l(na)})}a(u);var Lt=i(u,2);{let l=E(()=>(t(),s(()=>t().t("Delete function?"))));Tt(Lt,{get title(){return e(l)},get show(){return e(Ce)},set show(d){v(Ce,d)},$$events:{confirm:()=>{Ze(e(j))}},children:(d,m)=>{var p=hr(),A=r(p),X=i(A),K=r(X,!0);a(X),Vt(),a(p),L(R=>{w(A,`${R??""} `),w(K,(e(j),s(()=>e(j).name)))},[()=>(t(),s(()=>t().t("This will delete")))]),_(d,p)},$$slots:{default:!0},$$legacy:!0})}var Ht=i(Lt,2);{let l=E(()=>(e(j),s(()=>{var d,m;return((m=(d=e(j))==null?void 0:d.meta)==null?void 0:m.manifest)??{}})));Ya(Ht,{get manifest(){return e(l)},get show(){return e(Me)},set show(d){v(Me,d)},$$legacy:!0})}var It=i(Ht,2);{let l=E(()=>(e(j),s(()=>{var d;return((d=e(j))==null?void 0:d.id)??null})));Ra(It,{type:"function",get id(){return e(l)},get show(){return e(Pe)},set show(d){v(Pe,d)},$$events:{save:async()=>{var d,m,p;await xt(),Ae.set(await Ke(localStorage.token,((m=(d=q())==null?void 0:d.features)==null?void 0:m.enable_direct_connections)&&(((p=ne())==null?void 0:p.directConnections)??null),!1,!0))}},$$legacy:!0})}var sa=i(It,2);Tt(sa,{get show(){return e(Se)},set show(l){v(Se,l)},$$events:{confirm:()=>{const l=new FileReader;l.onload=async d=>{var p,A,X;const m=JSON.parse(d.target.result);for(let K of m)"function"in K&&(K=K.function),await Fa(localStorage.token,K).catch(R=>(O.error(`${R}`),null));O.success(t().t("Functions imported successfully")),v(V,await jt(localStorage.token)),m.set(await ot(localStorage.token)),Ae.set(await Ke(localStorage.token,((A=(p=q())==null?void 0:p.features)==null?void 0:A.enable_direct_connections)&&(((X=ne())==null?void 0:X.directConnections)??null),!1,!0)),v(pe,null),ba(fe,e(fe).value="")},l.readAsText(e(pe)[0])}},children:(l,d)=>{var m=yr(),p=r(m),A=r(p),X=r(A,!0);a(A);var K=i(A,2),R=r(K),He=r(R,!0);a(R);var tt=i(R,2),ft=r(tt,!0);a(tt),a(K),a(p);var Ve=i(p,2),z=r(Ve,!0);a(Ve),a(m),L((n,Ie,Q,de)=>{w(X,n),w(He,Ie),w(ft,Q),w(z,de)},[()=>(t(),s(()=>t().t("Please carefully review the following warnings:"))),()=>(t(),s(()=>t().t("Functions allow arbitrary code execution."))),()=>(t(),s(()=>t().t("Do not install functions from sources you do not fully trust."))),()=>(t(),s(()=>t().t("I acknowledge that I have read and I understand the implications of my action. I am aware of the risks associated with executing arbitrary code and I have verified the trustworthiness of the source.")))]),_(l,m)},$$slots:{default:!0},$$legacy:!0}),L((l,d)=>{w(Rt,l),w(qt,(e(re),s(()=>e(re).length))),Je(Ge,"placeholder",d)},[()=>(t(),s(()=>t().t("Functions"))),()=>(t(),s(()=>t().t("Search Functions")))]),ja($,()=>e(pe),l=>v(pe,l)),F("change",$,()=>{e(pe),v(Se,!0)}),za(Ge,()=>e(G),l=>v(G,l)),F("input",Ge,je),F("wheel",et,l=>{l.deltaY!==0&&(l.preventDefault(),l.currentTarget.scrollLeft+=l.deltaY)}),_(o,c)},Fe=o=>{var c=$r(),u=r(c);rr(u,{className:"size-5"}),a(c),_(o,c)};W(dt,o=>{e(qe)?o(xe):o(Fe,-1)})}_(Ne,Oe),bt(),Ee()}function mo(Ne,M){yt(M,!1);const y=()=>ge(Jt,"$config",q),t=()=>ge(st,"$functions",q),[q,ne]=$t();At(async()=>{var Y,ye;if(!((ye=(Y=y())==null?void 0:Y.features)!=null&&ye.enable_plugins)){await Re("/admin",{replaceState:!0});return}await Promise.all([(async()=>{st.set(await ot(localStorage.token))})()])}),kt();var ee=nt(),se=me(ee);{var Ee=Y=>{Sr(Y,{})};W(se,Y=>{t()!==null&&Y(Ee)})}_(Ne,ee),bt(),ne()}
3export{mo as component};
4//# sourceMappingURL=15.ilkHtdEt.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.