import{f as g,a as h}from"../chunks/bmn8XlW7.js";import{o as w}from"../chunks/CJbqisBi.js";import{p as v,a as b,d as x,e as $,c as y,s as _,g as P,r as S}from"../chunks/DpkolLiq.js";import{k as C}from"../chunks/B3p6J_mX.js";import{a as M,b as k}from"../chunks/TXeUdaq1.js";import{g as r}from"../chunks/C2ETuzsT.js";import{r as s}from"../chunks/CiPTfhJW.js";import{p as I}from"../chunks/CNEWdp3h.js";import{m as D,p as F}from"../chunks/DxBGAPM1.js";import{a as j}from"../chunks/MqDOSMkA.js";var q=g('<div class="max-w-2xl mx-auto"><h1 class="text-2xl font-bold mb-6">Create Server Profile</h1> <!></div>');function Q(i,n){v(n,!0);const m=()=>k(I,"$page",l),[l,d]=M();let e=_(void 0);w(async()=>{const o=m().url.searchParams.get("model");if(o)try{const t=(await D.listDownloaded()).find(u=>u.repo_id===o);t&&y(e,t.id,!0)}catch{}});async function p(o){await F.create(o),await r(s("/profiles"))}async function f(){await r(s("/profiles"))}var a=q(),c=x($(a),2);C(c,()=>"new-profile",o=>{j(o,{get initialModelId(){return P(e)},onSubmit:p,onCancel:f})}),S(a),h(i,a),b(),d()}export{Q as component};
