const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-connect-provider-DdYA-iVa.js","assets/index-Cl9Gy4vs.js","assets/index-b2zsFxHN.css","assets/list-CbLd2QpP.js","assets/tag-CzzNjHnn.js","assets/dialog-select-provider-B1pJlMg-.js"])))=>i.map(i=>d[i]);
import{ab as k,c as S,ac as E,f as I,m as t,l as r,S as c,Z as L,n as T,ad as g,B as M,G as O,t as u,_ as w,v as A}from"./index-Cl9Gy4vs.js";import{L as $}from"./list-CbLd2QpP.js";import{T as m,P as B}from"./tag-CzzNjHnn.js";import{M as R}from"./session-C1WGvWnQ.js";import"./select-yT_m8Opa.js";import"./transform-BwXaE9hv.js";var G=u('<div class="flex flex-col gap-3 px-2.5"><div class="text-14-medium text-text-base px-2.5">'),K=u('<div class="px-1.5 pb-1.5"><div class="w-full rounded-sm border border-border-weak-base bg-surface-raised-base"><div class="w-full flex flex-col items-start gap-4 px-1.5 pt-4 pb-4"><div class="px-2 text-14-medium text-text-base"></div><div class=w-full>'),V=u('<div class="w-full flex items-center gap-x-2.5"><span>'),h=u('<div class="text-14-regular text-text-weak">'),j=u('<div class="w-full flex items-center gap-x-3"><span>');const H=b=>{const v=b.model??k().model,f=S(),y=E(),i=I(),D=l=>{w(()=>import("./dialog-connect-provider-DdYA-iVa.js").then(s=>s.d),__vite__mapDeps([0,1,2,3,4])).then(s=>{f.show(()=>t(s.DialogConnectProvider,{provider:l}))})},C=()=>{w(()=>import("./dialog-select-provider-B1pJlMg-.js").then(l=>l.d),__vite__mapDeps([5,1,2,3,4,0])).then(l=>{f.show(()=>t(l.DialogSelectProvider,{}))})};let _;const P=l=>{l.key!=="Escape"&&_?.onKeyDown(l)};return t(O,{get title(){return i.t("dialog.model.select.title")},class:"overflow-y-auto [&_[data-slot=dialog-body]]:overflow-visible [&_[data-slot=dialog-body]]:flex-none",get children(){return[(()=>{var l=G(),s=l.firstChild;return l.$$keydown=P,r(s,()=>i.t("dialog.model.unpaid.freeModels.title")),r(l,t($,{class:"[&_[data-slot=list-scroll]]:overflow-visible",ref:e=>_=e,get items(){return v.list},get current(){return v.current()},key:e=>`${e.provider.id}:${e.id}`,itemWrapper:(e,n)=>t(L,{class:"w-full",placement:"right-start",gutter:12,get value(){return t(R,{model:e,get latest(){return e.latest},get free(){return T(()=>e.provider.id==="opencode")()&&(!e.cost||e.cost.input===0)}})},children:n}),onSelect:e=>{v.set(e?{modelID:e.id,providerID:e.provider.id}:void 0,{recent:!0}),f.close()},children:e=>(()=>{var n=V(),p=n.firstChild;return r(p,()=>e.name),r(n,t(m,{get children(){return i.t("model.tag.free")}}),null),r(n,t(c,{get when(){return e.latest},get children(){return t(m,{get children(){return i.t("model.tag.latest")}})}}),null),n})()}),null),l})(),(()=>{var l=K(),s=l.firstChild,e=s.firstChild,n=e.firstChild,p=n.nextSibling;return r(n,()=>i.t("dialog.model.unpaid.addMore.title")),r(p,t($,{class:"w-full px-0",key:o=>o?.id,get items(){return y.popular},activeIcon:"plus-small",sortBy:(o,d)=>g.includes(o.id)&&g.includes(d.id)?g.indexOf(o.id)-g.indexOf(d.id):o.name.localeCompare(d.name),onSelect:o=>{o&&D(o.id)},children:o=>(()=>{var d=j(),x=d.firstChild;return r(d,t(B,{"data-slot":"list-item-extra-icon",get id(){return o.id}}),x),r(x,()=>o.name),r(d,t(c,{get when(){return o.id==="opencode"},get children(){var a=h();return r(a,()=>i.t("dialog.provider.opencode.tagline")),a}}),null),r(d,t(c,{get when(){return o.id==="opencode"},get children(){return t(m,{get children(){return i.t("dialog.provider.tag.recommended")}})}}),null),r(d,t(c,{get when(){return o.id==="opencode-go"},get children(){return[(()=>{var a=h();return r(a,()=>i.t("dialog.provider.opencodeGo.tagline")),a})(),t(m,{get children(){return i.t("dialog.provider.tag.recommended")}})]}}),null),r(d,t(c,{get when(){return o.id==="anthropic"},get children(){var a=h();return r(a,()=>i.t("dialog.provider.anthropic.note")),a}}),null),d})()}),null),r(p,t(M,{variant:"ghost",class:"w-full justify-start px-[11px] py-3.5 gap-4.5 text-14-medium",icon:"dot-grid",onClick:C,get children(){return i.t("dialog.provider.viewAll")}}),null),l})()]}})};A(["keydown"]);export{H as DialogSelectModelUnpaid};
