PageSourceSearch

https://cdn.wisgate.ai/wisgate/_nuxt/DGIuarxB.js

js wisgate.ai collected 2026-10-04 13:26:13 UTC 106,870 bytes, 238 lines download raw bytes

1import{d as Ce,u as je,r as f,bW as xt,a as w,j as i,o as a,s as B,l as e,q as ee,p as o,F as Z,k as r,m as M,an as _e,y as xe,br as Se,x as ue,E as Y,c as pe,h as et,aT as yt,w as Fe,v as tt,G as ft,Q as we,ed as Ye,ap as Ve,W as ot,g as bt,aS as ht,bF as $t,bG as wt,U as kt,a5 as We,b as Ct,K as ye,cr as jt,bN as Mt,n as Vt,J as St,bH as Tt,bI as Pt,d$ as Nt,ae as Ut,aM as At}from"./DZ7mik94.js";import{_ as lt}from"./56p-yg89.js";import{_ as Ot}from"./BhD-TDn5.js";import{_ as Bt}from"./BqOP2l2w.js";import{C as Qe,r as It}from"./B8EWEgfi.js";import{_ as D}from"./BDcM2FMb.js";import{a as Xe,e as Rt}from"./C_HCVPZZ.js";import{g as Ze}from"./DXDH8whQ.js";import{L as Ft}from"./BSinQJD4.js";import{M as zt}from"./D-7PkliZ.js";import Ht from"./M164V7hc.js";import Te from"./COJFURLF.js";import he from"./CfI3uaTg.js";import ke from"./B1Rf_HE1.js";import $e from"./Cm9Imrzp.js";import{f as Kt}from"./y0XJ1xRd.js";import{u as qt}from"./Bupw4VqN.js";import"./iik6CYzq.js";import"./DShxcv2m.js";import"./Ci2gcBr-.js";import"./ltAwTrAJ.js";import"./B3Th_mgj.js";import"./CqkleIqs.js";import"./CFmxRTIl.js";import"./Cu8igjOL.js";import"./Du7nxuHz.js";import"./CnnAWtRi.js";import"./rSTlLCgx.js";import"./BZKu3Cxi.js";import"./B6bz1XqG.js";import"./Cky70c8k.js";import"./B-T_MQ6L.js";import"./v22BJWT9.js";import"./DGpUZ0d1.js";import"./CDAiuzJL.js";import"./lugWVUni.js";const Jt={class:"flex flex-col gap-5"},Et={key:0,class:"flex rounded-lg border border-gray-200 overflow-hidden w-fit"},Lt={class:"block text-sm font-medium text-gray-700 mb-0.5"},Dt={class:"text-xs text-gray-400 mb-2"},Gt={class:"block text-sm font-medium text-gray-700 mb-1.5"},Yt={class:"group rounded-lg border border-gray-100 bg-gray-50/50"},Wt={class:"cursor-pointer px-4 py-3 text-sm font-medium text-gray-600 list-none flex items-center gap-2 select-none"},Qt={class:"px-4 pb-4 space-y-5"},Xt={class:"flex items-center justify-between mb-0.5"},Zt={class:"text-sm font-medium text-gray-700"},eo={class:"text-xs font-mono text-gray-400"},to={class:"text-xs text-gray-400 mb-2"},oo={class:"block text-sm font-medium text-gray-700 mb-0.5"},lo={class:"text-xs text-gray-400 mb-2"},so={class:"flex items-center justify-between mb-0.5"},ao={class:"text-sm font-medium text-gray-700"},no={class:"text-xs font-mono text-gray-400"},io={class:"text-xs text-gray-400 mb-2"},ro={class:"flex items-center justify-between mb-0.5"},uo={class:"text-sm font-medium text-gray-700"},co={class:"text-xs font-mono text-gray-400"},mo={class:"text-xs text-gray-400 mb-2"},po={class:"flex items-center justify-between mb-0.5"},go={class:"text-sm font-medium text-gray-700"},vo={class:"text-xs font-mono text-gray-400"},_o={class:"text-xs text-gray-400 mb-2"},xo={class:"block text-sm font-medium text-gray-700 mb-0.5"},yo={class:"text-xs text-gray-400 mb-2"},fo={class:"block text-sm font-medium text-gray-700 mb-1.5"},bo={class:"group rounded-lg border border-gray-100 bg-gray-50/50"},ho={class:"cursor-pointer px-4 py-3 text-sm font-medium text-gray-600 list-none flex items-center gap-2 select-none"},$o={class:"px-4 pb-4 space-y-5"},wo={class:"flex items-center justify-between mb-0.5"},ko={class:"text-sm font-medium text-gray-700"},Co={class:"text-xs font-mono text-gray-400"},jo={class:"text-xs text-gray-400 mb-2"},Mo={class:"block text-sm font-medium text-gray-700 mb-0.5"},Vo={class:"text-xs text-gray-400 mb-2"},So=Ce({__name:"PlaygroundFormOpenAIChat",props:{modelName:{},resolvedKey:{},baseUrl:{},endpointChat:{type:Boolean},endpointCompletion:{type:Boolean}},emits:["submit-start","response","error"],setup(se,{expose:ce,emit:ie}){const n=se,H=ie,{t:G}=je(),h=f("chat");xt(()=>{n.endpointChat&&!n.endpointCompletion&&(h.value="chat"),!n.endpointChat&&n.endpointCompletion&&(h.value="responses")});const P=f(""),V=f(""),C=f(.7),U=f(1024),T=f(1),I=f(0),S=f(0),A=f(""),K=f(""),N=f(1024),E=f(.7),d=w(()=>n.resolvedKey?n.resolvedKey.slice(0,8)+"...":"YOUR_API_KEY"),m=async()=>{if(h.value==="chat"&&!V.value.trim()){H("error",G("playground.message_required"));return}if(h.value==="responses"&&!K.value.trim()){H("error",G("playground.input_required"));return}H("submit-start");try{h.value==="chat"?await O():await p()}catch(y){H("error",y?.message||String(y))}}
1,O=async()=>{const y=[];P.value.trim()&&y.push({role:"system",content:P.value.trim()}),y.push({role:"user",content:V.value.trim()});const _={model:n.modelName,messages:y,temperature:C.value,max_tokens:U.value,top_p:T.value,stream:!1};I.value!==0&&(_.frequency_penalty=I.value),S.value!==0&&(_.presence_penalty=S.value);const z=await fetch(`${n.baseUrl}/v1/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.resolvedKey}`},body:JSON.stringify(_)}),j=await z.json();if(!z.ok)throw new Error(j?.error?.message||`HTTP ${z.status}`);const c=j?.choices?.[0],x=c?.message?.content||c?.text||"";H("response",{type:"text",text:x,rawJson:j})},p=async()=>{const y={model:n.modelName,input:K.value.trim(),temperature:E.value,max_output_tokens:N.value};A.value.trim()&&(y.instructions=A.value.trim());const _=await fetch(`${n.baseUrl}/v1/responses`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.resolvedKey}`},body:JSON.stringify(y)}),z=await _.json();if(!_.ok)throw new Error(z?.error?.message||`HTTP ${_.status}`);const j=z?.output_text||z?.output?.[0]?.content?.[0]?.text||z?.output?.[0]?.text||(typeof z?.output=="string"?z.output:"")||"";H("response",{type:"text",text:j,rawJson:z})},ne=w(()=>{const y=n.baseUrl,_=d.value;if(h.value==="chat"){const c=[];P.value.trim()&&c.push({role:"system",content:P.value.trim()}),c.push({role:"user",content:V.value.trim()||"Hello"});const x=c.map($=>`    {"role": "${$.role}", "content": ${JSON.stringify($.content)}}`).join(`,
2`);let F="";return I.value!==0&&(F+=`
3    frequency_penalty=${I.value},`),S.value!==0&&(F+=`
4    presence_penalty=${S.value},`),`from openai import OpenAI
5
6client = OpenAI(
7    api_key="${_}",
8    base_url="${y}/v1",
9)
10
11response = client.chat.completions.create(
12    model="${n.modelName}",
13    messages=[
14${x}
15    ],
16    temperature=${C.value},
17    max_tokens=${U.value},
18    top_p=${T.value},${F}
19    stream=False,
20)
21
22print(response.choices[0].message.content)`}const z=K.value.trim()||"Hello";let j=`from openai import OpenAI
23
24client = OpenAI(
25    api_key="${_}",
26    base_url="${y}/v1",
27)
28
29response = client.responses.create(
30    model="${n.modelName}",
31    input=${JSON.stringify(z)},`;return A.value.trim()&&(j+=`
32    instructions=${JSON.stringify(A.value.trim())},`),j+=`
33    temperature=${E.value},
34    max_output_tokens=${N.value},
35)
36
37print(response.output_text)`,j}),l=w(()=>{const y=n.baseUrl,_=d.value;if(h.value==="chat"){const c=[];P.value.trim()&&c.push({role:"system",content:P.value.trim()}),c.push({role:"user",content:V.value.trim()||"Hello"});const x=c.map($=>`      { role: "${$.role}", content: ${JSON.stringify($.content)} }`).join(`,
38`);let F="";return I.value!==0&&(F+=`
39  frequency_penalty: ${I.value},`),S.value!==0&&(F+=`
40  presence_penalty: ${S.value},`),`import OpenAI from "openai";
41
42const client = new OpenAI({
43  apiKey: "${_}",
44  baseURL: "${y}/v1",
45});
46
47const response = await client.chat.completions.create({
48  model: "${n.modelName}",
49  messages: [
50${x}
51  ],
52  temperature: ${C.value},
53  max_tokens: ${U.value},
54  top_p: ${T.value},${F}
55  stream: false,
56});
57
58console.log(response.choices[0].message.content);`}const z=K.value.trim()||"Hello";let j=`import OpenAI from "openai";
59
60const client = new OpenAI({
61  apiKey: "${_}",
62  baseURL: "${y}/v1",
63});
64
65const response = await client.responses.create({
66  model: "${n.modelName}",
67  input: ${JSON.stringify(z)},`;return A.value.trim()&&(j+=`
68  instructions: ${JSON.stringify(A.value.trim())},`),j+=`
69  temperature: ${E.value},
70  max_output_tokens: ${N.value},
71});
72
73console.log(response.output_text);`,j}),X=w(()=>{if(h.value==="chat"){const _=[];P.value.trim()&&_.push({role:"system",content:P.value.trim()}),_.push({role:"user",content:V.value.trim()||"Hello"});const z={model:n.modelName,messages:_,temperature:C.value,max_tokens:U.value,top_p:T.value,stream:!1};return I.value!==0&&(z.frequency_penalty=I.value),S.value!==0&&(z.presence_penalty=S.value),JSON.stringify(z,null,2)}const y={model:n.modelName,input:K.value.trim()||"Hello",temperature:E.value,max_output_tokens:N.value};return A.value.trim()&&(y.instructions=A.value.trim()),JSON.stringify(y,null,2)}),oe=w(()=>{const y=n.baseUrl,_=d.value,z=h.value==="chat"?"/v1/chat/completions":"/v1/responses",j=X.value.split(`
74`).map((c,x)=>x===0?c:"  "+c).join(`
75`);return`curl ${y}${z} \\
76  -H "Content-Type: application/json" \\
77  -H "Authorization: Bearer ${_}" \\
78  -d '${j}'`});
78return ce({submit:m,codePython:ne,codeNodejs:l,codeJson:X,codeHttp:oe}),(y,_)=>{const z=Se;return a(),i("div",Jt,[se.endpointChat&&se.endpointCompletion?(a(),i("div",Et,[e("button",{onClick:_[0]||(_[0]=j=>h.value="chat"),class:ee(["px-3 py-1.5 text-xs font-medium transition-colors cursor-pointer",h.value==="chat"?"bg-blue-600 text-white":"bg-white text-gray-600 hover:bg-gray-50"])},o(y.$t("playground.toggle_chat_completions")),3),e("button",{onClick:_[1]||(_[1]=j=>h.value="responses"),class:ee(["px-3 py-1.5 text-xs font-medium transition-colors cursor-pointer border-l border-gray-200",h.value==="responses"?"bg-blue-600 text-white":"bg-white text-gray-600 hover:bg-gray-50"])},o(y.$t("playground.toggle_responses")),3)])):B("",!0),h.value==="chat"?(a(),i(Z,{key:1},[e("div",null,[e("label",Lt,o(y.$t("playground.system_prompt_label")),1),e("p",Dt,o(y.$t("playground.openai_desc_system_prompt")),1),r(M(he),{modelValue:P.value,"onUpdate:modelValue":_[2]||(_[2]=j=>P.value=j),placeholder:y.$t("playground.system_prompt_placeholder"),autoResize:"",rows:2,class:"w-full text-sm"},null,8,["modelValue","placeholder"])]),e("div",null,[e("label",Gt,o(y.$t("playground.user_message_placeholder")),1),r(M(he),{modelValue:V.value,"onUpdate:modelValue":_[3]||(_[3]=j=>V.value=j),placeholder:y.$t("playground.user_message_placeholder"),autoResize:"",rows:5,class:"w-full",onKeydown:[_e(xe(m,["ctrl"]),["enter"]),_e(xe(m,["meta"]),["enter"])]},null,8,["modelValue","placeholder","onKeydown"])]),e("details",Yt,[e("summary",Wt,[r(z,{name:"i-lucide-chevron-right",class:"w-4 h-4 transition-transform group-open:rotate-90"}),e("span",null,o(y.$t("playground.temperature_label"))+": "+o(C.value.toFixed(1)),1),_[13]||(_[13]=e("span",{class:"text-gray-300"},"·",-1)),e("span",null,o(y.$t("playground.max_tokens_label"))+": "+o(U.value),1),_[14]||(_[14]=e("span",{class:"text-gray-300"},"·",-1)),e("span",null,o(y.$t("playground.top_p_label"))+": "+o(T.value.toFixed(2)),1)]),e("div",Qt,[e("div",null,[e("div",Xt,[e("label",Zt,o(y.$t("playground.temperature_label")),1),e("span",eo,o(C.value.toFixed(1)),1)]),e("p",to,o(y.$t("playground.openai_desc_temperature")),1),r(M($e),{modelValue:C.value,"onUpdate:modelValue":_[4]||(_[4]=j=>C.value=j),min:0,max:2,step:.1},null,8,["modelValue"])]),e("div",null,[e("label",oo,o(y.$t("playground.max_tokens_label")),1),e("p",lo,o(y.$t("playground.openai_desc_max_tokens")),1),r(M(ke),{modelValue:U.value,"onUpdate:modelValue":_[5]||(_[5]=j=>U.value=j),min:1,max:32768,step:256,showButtons:"",class:"w-full"},null,8,["modelValue"])]),e("div",null,[e("div",so,[e("label",ao,o(y.$t("playground.top_p_label")),1),e("span",no,o(T.value.toFixed(2)),1)]),e("p",io,o(y.$t("playground.openai_desc_top_p")),1),r(M($e),{modelValue:T.value,"onUpdate:modelValue":_[6]||(_[6]=j=>T.value=j),min:0,max:1,step:.05},null,8,["modelValue"])]),e("div",null,[e("div",ro,[e("label",uo,o(y.$t("playground.openai_frequency_penalty_label")),1),e("span",co,o(I.value.toFixed(1)),1)]),e("p",mo,o(y.$t("playground.openai_desc_frequency_penalty")),1),r(M($e),{modelValue:I.value,"onUpdate:modelValue":_[7]||(_[7]=j=>I.value=j),min:0,max:2,step:.1},null,8,["modelValue"])]),e("div",null,[e("div",po,[e("label",go,o(y.$t("playground.openai_presence_penalty_label")),1),e("span",vo,o(S.value.toFixed(1)),1)]),e("p",_o,o(y.$t("playground.openai_desc_presence_penalty")),1),r(M($e),{modelValue:S.value,"onUpdate:modelValue":_[8]||(_[8]=j=>S.value=j),min:0,max:2,step:.1},null,8,["modelValue"])])])])],64)):(a(),i(Z,{key:2},[e("div",null,[e("label",xo,o(y.$t("playground.responses_instructions_label")),1),e("p",yo,o(y.$t("playground.responses_desc_instructions")),1),r(M(he),{modelValue:A.value,"onUpdate:modelValue":_[9]||(_[9]=j=>A.value=j),placeholder:y.$t("playground.responses_instructions_placeholder"),autoResize:"",rows:2,class:"w-full text-sm"},null,8,["modelValue","placeholder"])]),e("div",null,[e("label",fo,o(y.$t("playground.responses_input_label")),1),r(M(he),{modelValue:K.value,"onUpdate:modelValue":_[10]||(_[10]=j=>K.value=j),placeholder:y.$t("playground.responses_input_placeholder"),autoResize:"",rows:5,class:"w-full",onKeydown:[_e(xe(m,["ctrl"]),["enter"]),_e(xe(m,["meta"]),["enter"])]},null,8,["modelValue","placeholder","onKeydown"])]),e("details",bo,[e("summary",ho,[r(z,{name:"i-lucide-chevron-right",class:"w-4 h-4 transition-transform group-open:rotate-90"}),e("span",null,o(y.$t("playground.temperature_label"))+": "+o(E.value.toFixed(1)),1),_[15]||(_[15]=e("span",{class:"text-gray-300"},"·",-1)),e("span",null,o(y.$t("playground.max_output_tokens_label"))+": "+o(N.value),1)]),e("div",$o,[e("div",null,[e("div",w
78o,[e("label",ko,o(y.$t("playground.temperature_label")),1),e("span",Co,o(E.value.toFixed(1)),1)]),e("p",jo,o(y.$t("playground.responses_desc_temperature")),1),r(M($e),{modelValue:E.value,"onUpdate:modelValue":_[11]||(_[11]=j=>E.value=j),min:0,max:2,step:.1},null,8,["modelValue"])]),e("div",null,[e("label",Mo,o(y.$t("playground.max_output_tokens_label")),1),e("p",Vo,o(y.$t("playground.responses_desc_max_output_tokens")),1),r(M(ke),{modelValue:N.value,"onUpdate:modelValue":_[12]||(_[12]=j=>N.value=j),min:1,max:32768,step:256,showButtons:"",class:"w-full"},null,8,["modelValue"])])])])],64))])}}}),To=Object.assign(So,{__name:"PagesModelsPlaygroundFormOpenAIChat"}),Po={class:"flex flex-col gap-5"},No={class:"text-xs text-gray-400 mb-2"},Uo={class:"group rounded-lg border border-gray-100 bg-gray-50/50"},Ao={class:"cursor-pointer px-4 py-3 text-sm font-medium text-gray-600 list-none flex items-center gap-2 select-none"},Oo={class:"px-4 pb-4 space-y-5"},Bo={class:"block text-sm font-medium text-gray-700 mb-0.5"},Io={class:"text-xs text-gray-400 mb-2"},Ro={class:"block text-sm font-medium text-gray-700 mb-0.5"},Fo={class:"text-xs text-gray-400 mb-2"},zo={class:"block text-sm font-medium text-gray-700 mb-0.5"},Ho={class:"text-xs text-gray-400 mb-2"},Ko=Ce({__name:"PlaygroundFormOpenAIImage",props:{modelName:{},resolvedKey:{},baseUrl:{}},emits:["submit-start","response","error"],setup(se,{expose:ce,emit:ie}){const n=se,H=ie,{t:G}=je(),h=f(""),P=f("1024x1024"),V=f("standard"),C=f(1),U=[{label:"1024x1024",value:"1024x1024"},{label:"1792x1024",value:"1792x1024"},{label:"1024x1792",value:"1024x1792"}],T=w(()=>[{label:G("playground.image_quality_standard"),value:"standard"},{label:G("playground.image_quality_hd"),value:"hd"}]),I=w(()=>n.resolvedKey?n.resolvedKey.slice(0,8)+"...":"YOUR_API_KEY"),S=async()=>{if(!h.value.trim()){H("error",G("playground.prompt_required"));return}H("submit-start");try{const d={model:n.modelName,prompt:h.value.trim(),n:C.value,size:P.value};V.value!=="standard"&&(d.quality=V.value);const m=await fetch(`${n.baseUrl}/v1/images/generations`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.resolvedKey}`},body:JSON.stringify(d)}),O=await m.json();if(!m.ok)throw new Error(O?.error?.message||`HTTP ${m.status}`);const ne=(O?.data||[]).map(l=>l.url?l.url:l.b64_json?`data:image/png;base64,${l.b64_json}`:null).filter(Boolean);H("response",{type:"image",images:ne,rawJson:O})}catch(d){H("error",d?.message||String(d))}},A=w(()=>{const d=I.value,m=n.baseUrl,O=h.value.trim()||"A beautiful sunset";let p="";return V.value!=="standard"&&(p+=`
79    quality="${V.value}",`),`from openai import OpenAI
80
81client = OpenAI(
82    api_key="${d}",
83    base_url="${m}/v1",
84)
85
86response = client.images.generate(
87    model="${n.modelName}",
88    prompt=${JSON.stringify(O)},
89    n=${C.value},
90    size="${P.value}",${p}
91)
92
93print(response.data[0].url)`}),K=w(()=>{const d=I.value,m=n.baseUrl,O=h.value.trim()||"A beautiful sunset";let p="";return V.value!=="standard"&&(p+=`
94  quality: "${V.value}",`),`import OpenAI from "openai";
95
96const client = new OpenAI({
97  apiKey: "${d}",
98  baseURL: "${m}/v1",
99});
100
101const response = await client.images.generate({
102  model: "${n.modelName}",
103  prompt: ${JSON.stringify(O)},
104  n: ${C.value},
105  size: "${P.value}",${p}
106});
107
108console.log(response.data[0].url);`}),N=w(()=>{const d={model:n.modelName,prompt:h.value.trim()||"A beautiful sunset",n:C.value,size:P.value};return V.value!=="standard"&&(d.quality=V.value),JSON.stringify(d,null,2)}),E=w(()=>{const d=I.value,m=n.baseUrl,O=N.value.split(`
109`).map((p,ne)=>ne===0?p:"  "+p).join(`
110`);return`curl ${m}/v1/images/generations \\
111  -H "Content-Type: application/json" \\
112  -H "Authorization: Bearer ${d}" \\
113  -d '${O}'`});return ce({submit:S,codePython:A,codeNodejs:K,codeJson:N,codeHttp:E}),(d,m)=>{const O=Se;return a(),i("div",Po,[e("div",null,[m[4]||(m[4]=e("label",{class:"block text-sm font-medium text-gray-700 mb-0.5"},"Prompt",-1)),e("p",No,o(d.$t("playground.image_desc_prompt")),1),r(M(he),{modelValue:h.value,"onUpdate:modelValue":m[0]||(m[0]=p=>h.value=p),placeholder:d.$t("playground.prompt_placeholder"),autoResize:"",rows:5,class:"w-full",onKeydown:[_e(xe(S,["ctrl"]),["enter"]),_e(xe(S,["meta"]),["enter"])]},null,8,["modelValue","placeholder","onKeydown"])]),e("details",Uo,[e("summary",Ao,[r(O,{name:"i-lucide-chevron-right",class:"w-4 h-4 transition-transform group-open:rotate-90"}),e("span",null,o(d.$t("playground.image_size_label"))+": "+o(P.value),1),m[5]||(m[5]=e("span",{class:"text-gray-300"},"·",-1)),e("span",null,o(d.$t("playground.image_quality_label"))+": "+o(V.value),1),m[6]||(m[6]=e("span",{class:"text-gray-300"},"·",-1)),e("span",null,o(d.$t("playground.image_n_label"))+": "+o(C.value),1)]),e("div",Oo,[e("div",null,[e("label",Bo,o(d.$t("playground.image_size_label")),1),e("p",Io,o(d.$t("playground.image_desc_size")),1),r(M(Te),{modelValue:P.value,"onUpdate:modelValue":m[1]||(m[1]=p=>P.value=p),options:U,optionLabel:"label",optionValue:"value",class:"w-full"},null,8,["modelValue"])]),e("div",null,[e("label",Ro,o(d.$t("playground.image_quality_label")),1),e("p",Fo,o(d.$t("playground.image_desc_quality")),1),r(M(Te),{modelValue:V.value,"onUpdate:modelValue":m[2]||(m[2]=p=>V.value=p),options:T.value,optionLabel:"label",optionValue:"value",class:"w-full"},null,8,["modelValue","options"])]),e("div",null,[e("label",zo,o(d.$t("playground.image_n_label")),1),e("p",Ho,o(d.$t("playground.image_desc_n")),1),r(M(ke),{modelValue:C.value,"onUpdate:modelValue":m[3]||(m[3]=p=>C.value=p),min:1,max:4,step:1,showButtons:"",class:"w-full"},null,8,["modelValue"])])])])])}}}),qo=Object.assign(Ko,{__name:"PagesModelsPlaygroundFormOpenAIImage"}),Jo={class:"flex flex-col gap-5"},Eo={class:"text-xs text-gray-400 mb-2"},Lo=Ce({__name:"PlaygroundFormOpenAIVideo",props:{modelName:{},resolvedKey:{},baseUrl:{}},emits:["submit-start","response","error"],setup(se,{expose:ce,emit:ie}){const n=se,H=ie,{t:G}=je(),h=f(""),P=w(()=>n.resolvedKey?n.resolvedKey.slice(0,8)+"...":"YOUR_API_KEY"),V=async()=>
113{if(!h.value.trim()){H("error",G("playground.prompt_required"));return}H("submit-start");try{const S={model:n.modelName,prompt:h.value.trim()},A=await fetch(`${n.baseUrl}/v1/videos`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.resolvedKey}`},body:JSON.stringify(S)}),K=await A.json();if(!A.ok)throw new Error(K?.error?.message||`HTTP ${A.status}`);const N=K?.url||K?.data?.[0]?.url||K?.data?.url||K?.output?.url||"";H("response",{type:"video",videoUrl:N,rawJson:K})}catch(S){H("error",S?.message||String(S))}},C=w(()=>{const S=P.value,A=n.baseUrl,K=h.value.trim()||"A cat playing piano";return`import requests
114
115response = requests.post(
116    "${A}/v1/videos",
117    headers={
118        "Content-Type": "application/json",
119        "Authorization": f"Bearer ${S}",
120    },
121    json={
122        "model": "${n.modelName}",
123        "prompt": ${JSON.stringify(K)},
124    },
125)
126
127print(response.json())`}),U=w(()=>{const S=P.value,A=n.baseUrl,K=h.value.trim()||"A cat playing piano";return`const response = await fetch("${A}/v1/videos", {
128  method: "POST",
129  headers: {
130    "Content-Type": "application/json",
131    Authorization: \`Bearer ${S}\`,
132  },
133  body: JSON.stringify({
134    model: "${n.modelName}",
135    prompt: ${JSON.stringify(K)},
136  }),
137});
138
139const data = await response.json();
140console.log(data);`}),T=w(()=>JSON.stringify({model:n.modelName,prompt:h.value.trim()||"A cat playing piano"},null,2)),I=w(()=>{const S=P.value,A=n.baseUrl,K=T.value.split(`
141`).map((N,E)=>E===0?N:"  "+N).join(`
142`);return`curl ${A}/v1/videos \\
143  -H "Content-Type: application/json" \\
144  -H "Authorization: Bearer ${S}" \\
145  -d '${K}'`});return ce({submit:V,codePython:C,codeNodejs:U,codeJson:T,codeHttp:I}),(S,A)=>(a(),i("div",Jo,[e("div",null,[A[1]||(A[1]=e("label",{class:"block text-sm font-medium text-gray-700 mb-0.5"},"Prompt",-1)),e("p",Eo,o(S.$t("playground.video_desc_prompt")),1),r(M(he),{modelValue:h.value,"onUpdate:modelValue":A[0]||(A[0]=K=>h.value=K),placeholder:S.$t("playground.prompt_placeholder"),autoResize:"",rows:5,class:"w-full",onKeydown:[_e(xe(V,["ctrl"]),["enter"]),_e(xe(V,["meta"]),["enter"])]},null,8,["modelValue","placeholder","onKeydown"])])]))}}),Do=Object.assign(Lo,{__name:"PagesModelsPlaygroundFormOpenAIVideo"}),Go={class:"flex flex-col gap-5"},Yo={class:"block text-sm font-medium text-gray-700 mb-0.5"},Wo={class:"text-xs text-gray-400 mb-2"},Qo={class:"block text-sm font-medium text-gray-700 mb-1.5"},Xo={class:"group rounded-lg border border-gray-100 bg-gray-50/50"},Zo={class:"cursor-pointer px-4 py-3 text-sm font-medium text-gray-600 list-none flex items-center gap-2 select-none"},el={class:"px-4 pb-4 space-y-5"},tl={class:"block text-sm font-medium text-gray-700 mb-0.5"},ol={class:"text-xs text-gray-400 mb-2"},ll={class:"flex items-center justify-between mb-0.5"},sl={class:"text-sm font-medium text-gray-700"},al={class:"text-xs font-mono text-gray-400"},nl={class:"text-xs text-gray-400 mb-2"},il={class:"block text-sm font-medium text-gray-700 mb-0.5"},rl={class:"text-xs text-gray-400 mb-2"},dl={class:"block text-sm font-medium text-gray-700 mb-0.5"},ul={class:"text-xs text-gray-400 mb-2"},cl=Ce({__name:"PlaygroundFormClaude",props:{modelName:{},resolvedKey:{},baseUrl:{}},emits:["submit-start","response","error"],setup(se,{expose:ce,emit:ie}){const n=se,H=ie,{t:G}=je(),h=f(""),P=f(""),V=f(1024),C=f(1),U=f(null),T=f(null),I=w(()=>n.resolvedKey?n.resolvedKey.slice(0,8)+"...":"YOUR_API_KEY"),S=async()=>{if(!P.value.trim()){H("error",G("playground.message_required"));return}H("submit-start");try{const d={model:n.modelName,max_tokens:V.value,messages:[{role:"user",content:P.value.trim()}],stream:!1};h.value.trim()&&(d.system=h.value.trim()),C.value!==1&&(d.temperature=C.value),U.value!==null&&(d.top_p=U.value),T.value!==null&&T.value>0&&(d.top_k=T.value);const m=await fetch(`${n.baseUrl}/v1/messages`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.resolvedKey}`},body:JSON.stringify(d)}),O=await m.json();if(!m.ok)throw new Error(O?.error?.message||`HTTP ${m.status}`);const p=O?.content?.[0]?.text||(typeof O?.content=="string"?O.content:"")||"";H("response",{type:"text",text:p,rawJson:O})}catch(d){H("error",d?.message||String(d))}},A=w(()=>{const d=I.value,m=n.baseUrl,O=P.value.trim()||"Hello";let p=`from anthropic import Anthropic
146
147client = Anthropic(
148    api_key="${d}",
149    base_url="${m}/v1",
150)
151
152message = client.messages.create(
153    model="${n.modelName}",
154    max_tokens=${V.value},`;return h.value.trim()&&(p+=`
155    system=${JSON.stringify(h.value.trim())},`),p+=`
156    messages=[
157        {"role": "user", "content": ${JSON.stringify(O)}}
158    ],`,C.value!==1&&(p+=`
159    temperature=${C.value},`),U.value!==null&&(p+=`
160    top_p=${U.value},`),T.value!==null&&T.value>0&&(p+=`
161    top_k=${T.value},`),p+=`
162)
163
164print(message.content[0].text)`,p}),K=w(()=>{const d=I.value,m=n.baseUrl,O=P.value.trim()||"Hello";let p=`import Anthropic from "@anthropic-ai/sdk";
165
166const client = new Anthropic({
167  apiKey: "${d}",
168  baseURL: "${m}/v1",
169});
170
171const message = await client.messages.create({
172  model: "${n.modelName}",
173  max_tokens: ${V.value},`;return h.value.trim()&&(p+=`
174  system: ${JSON.stringify(h.value.trim())},`),p+=`
175  messages: [
176    { role: "user", content: ${JSON.stringify(O)} }
177  ],`,C.value!==1&&(p+=`
178  temperature: ${C.value},`),U.value!==null&&(p+=`
179  top_p: ${U.value},`),T.value!==null&&T.value>0&&(p+=`
180  top_k: ${T.value},`),p+=`
181});
182
183console.log(message.content[0].text);`,p}),N=w(()=>{const d={model:n.modelName,max_tokens:V.value,messages:[{role:"user",content:P.value.trim()||"Hello"}],stream:!1};return h.value.trim()&&(d.system=h.value.trim()),C.value!==1&&(d.temperature=C.value),U.value!==null&&(d.top_p=U.value),T.value!==null&&T.value>0&&(d.top_k=T.value),JSON.stringify(d,null,2)}),E=w(()=>{const d=I.value,m=n.baseUrl,O=N.value.split(`
184`).map((p,ne)=>ne===0?p:"  "+p).join(`
185`);return`curl ${m}/v1/messages \\
186  -H "Content-Type: application/json" \\
187  -H "Authorization: Bearer ${d}" \\
188  -d '${O}'`});return ce({submit:S,codePython:A,codeNodejs:K,codeJson:N,codeHttp:E}),(d,m)=>{const O=Se;return a(),i("div",Go,[e("div",null,[e("label",Yo,o(d.$t("playground.claude_system_label")),1),e("p",Wo,o(d.$t("playground.claude_desc_system")),1),r(M(he),{modelValue:h.value,"onUpdate:modelValue":m[0]||(m[0]=p=>h.value=p),placeholder:d.$t("playground.claude_system_placeholder"),autoResize:"",rows:2,class:"w-full text-sm"},null,8,["modelValue","placeholder"])]),e("div",null,[e("label",Qo,o(d.$t("playground.user_message_placeholder")),1),r(M(he),{modelValue:P.value,"onUpdate:modelValue":m[1]||(m[1]=p=>P.value=p),placeholder:d.$t("playground.user_message_placeholder"),autoResize:"",rows:5,class:"w-full",onKeydown:[_e(xe(S,["ctrl"]),["enter"]),_e(xe(S,["meta"]),["enter"])]},null,8,["modelValue","placeholder","onKeydown"])]),e("details",Xo,[e("summary",Zo,[r(O,{name:"i-lucide-chevron-right",class:"w-4 h-4 transition-transform group-open:rotate-90"}),e("span",null,o(d.$t("playground.max_tokens_label"))+": "+o(V.value),1),m[6]||(m[6]=e("span",{class:"text-gray-300"},"·",-1)),e("span",null,o(d.$t("playground.temperature_label"))+": "+o(C.value.toFixed(1)),1)]),e("div",el,[e("div",null,[e("label",tl,o(d.$t("playground.max_tokens_label")),1),e("p",ol,o(d.$t("playground.claude_desc_max_tokens")),1),r(M(ke),{modelValue:V.value,"onUpdate:modelValue":m[2]||(m[2]=p=>V.value=p),min:1,max:32768,step:256,showButtons:"",class:"w-full"},null,8,["modelValue"])]),e("div",null,[e("div",ll,[e("label",sl,o(d.$t("playground.temperature_label")),1),e("span",al,o(C.value.toFixed(1)),1)]),e("p",nl,o(d.$t("playground.claude_desc_temperature")),1),r(M($e),{modelValue:C.value,"onUpdate:modelValue":m[3]||(m[3]=p=>C.value=p),min:0,max:1,step:.1},null,8,["modelValue"])]),e("div",null,[e("label",il,o(d.$t("playground.claude_top_p_label")),1),e("p",rl,o(d.$t("playground.claude_desc_top_p")),1),r(M(ke),{modelValue:U.value,"onUpdate:modelValue":m[4]||(m[4]=p=>
188U.value=p),min:0,max:1,step:.05,minFractionDigits:2,maxFractionDigits:2,showButtons:"",class:"w-full",placeholder:"Not set"},null,8,["modelValue"])]),e("div",null,[e("label",dl,o(d.$t("playground.claude_top_k_label")),1),e("p",ul,o(d.$t("playground.claude_desc_top_k")),1),r(M(ke),{modelValue:T.value,"onUpdate:modelValue":m[5]||(m[5]=p=>T.value=p),min:1,max:500,step:1,showButtons:"",class:"w-full",placeholder:"Not set"},null,8,["modelValue"])])])])])}}}),ml=Object.assign(cl,{__name:"PagesModelsPlaygroundFormClaude"}),pl={class:"flex flex-col gap-5"},gl={class:"block text-sm font-medium text-gray-700 mb-0.5"},vl={class:"text-xs text-gray-400 mb-2"},_l={key:0,class:"flex flex-col gap-2 mb-2"},xl=["src","alt"],yl={class:"flex-1 min-w-0 text-sm text-gray-700 truncate"},fl=["onClick"],bl={class:"block text-sm font-medium text-gray-700 mb-1.5"},hl={class:"block text-sm font-medium text-gray-700 mb-0.5"},$l={class:"text-xs text-gray-400 mb-2"},wl={class:"flex gap-3"},kl={key:1,class:"space-y-5"},Cl={class:"block text-sm font-medium text-gray-700 mb-0.5"},jl={class:"text-xs text-gray-400 mb-2"},Ml={class:"block text-sm font-medium text-gray-700 mb-0.5"},Vl={class:"text-xs text-gray-400 mb-2"},Sl={class:"group rounded-lg border border-gray-100 bg-gray-50/50"},Tl={class:"cursor-pointer px-4 py-3 text-sm font-medium text-gray-600 list-none flex items-center gap-2 select-none"},Pl={class:"px-4 pb-4 space-y-5"},Nl={class:"flex items-center justify-between mb-0.5"},Ul={class:"text-sm font-medium text-gray-700"},Al={class:"text-xs font-mono text-gray-400"},Ol={class:"text-xs text-gray-400 mb-2"},Bl={class:"block text-sm font-medium text-gray-700 mb-0.5"},Il={class:"text-xs text-gray-400 mb-2"},Rl={class:"flex items-center justify-between mb-0.5"},Fl={class:"text-sm font-medium text-gray-700"},zl={class:"text-xs font-mono text-gray-400"},Hl={class:"text-xs text-gray-400 mb-2"},Kl={class:"block text-sm font-medium text-gray-700 mb-0.5"},ql={class:"text-xs text-gray-400 mb-2"},Jl=Ce({__name:"PlaygroundFormGemini",props:{modelName:{},resolvedKey:{},baseUrl:{}},emits:["submit-start","response","error"],setup(se,{expose:ce,emit:ie}){const n=se,H=ie,{t:G}=je(),h=f(""),P=f(""),V=f(1),C=f(1024),U=f(1),T=f(null),I=f([]),S=f(null),A=c=>{const x=c.target,F=x.files;if(!F||F.length===0)return;const $=["image/png","image/jpeg","image/webp","image/heic","image/heif"];for(const W of Array.from(F)){if(!$.includes(W.type)){H("error",`Unsupported image format: ${W.name}. Use PNG, JPEG, WebP, HEIC, or HEIF.`);continue}if(W.size>20*1024*1024){H("error",`Image too large: ${W.name}. Max 20MB per request.`);continue}const Q=new FileReader;Q.onload=()=>{const ge=Q.result.split(",")[1];I.value.push({base64:`${ge}`,mimeType:W.type,name:W.name})},Q.readAsDataURL(W)}x.value=""},K=c=>{I.value.splice(c,1)},N=f("text"),E=f("1:1"),d=f("1K"),m=[{label:"1:1",value:"1:1"},{label:"16:9",value:"16:9"},{label:"9:16",value:"9:16"},{label:"4:3",value:"4:3"},{label:"3:4",value:"3:4"},{label:"21:9",value:"21:9"}],O=w(()=>{const c=[{label:"1K",value:"1K"},{label:"2K",value:"2K"},{label:"4K",value:"4K"}];return n.modelName.includes("3.1-flash-image-preview")&&c.unshift({label:"0.5K",value:"512"}),c}),p=w(()=>n.resolvedKey?n.resolvedKey.slice(0,8)+"...":"YOUR_API_KEY"),ne=c=>{const x=[];for(const F of I.value)x.push({inlineData:{mimeType:F.mimeType,data:F.base64}});return x.push({text:c}),x},l=()=>{const c={temperature:V.value,maxOutputTokens:C.value,topP:U.value};return T.value!==null&&T.value>0&&(c.topK=T.value),N.value==="text-image"&&(c.responseModalities=["TEXT","IMAGE"],c.imageConfig={aspectRatio:E.value,imageSize:d.value}),c},X=async()=>{if(!P.value.trim()&&I.value.length===0){H("error",G("playground.message_required"));return}H("submit-start");try{const c=P.value.trim()||(I.value.length>0?"Describe this image":""),x={contents:[{role:"user",parts:ne(c)}],generationConfig:l()};h.value.trim()&&(x.systemInstruction={parts:[{text:h.value.trim()}]});const F=`${n.baseUrl}/v1beta/models/${n.modelName}:generateContent`,$=await fetch(F,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.resolvedKey}`},body:JSON.stringify(x)}),W=await $.json();if(!$.ok)throw new Error(W?.error?.message||`HTTP ${$.status}`);const Q=W?.candidates?.[0]?.content?.parts||[],ae=[],ge=[];for(const me of Q)if(me.text&&ae.push(me.text),me.inlineData||me.inline_data){const g=me.inlineData||me.inline_data,u=g.mimeType||g.mime_type||"image/png";ge.push(`data:${u};base64,${g.data}`)}if(ge.length>0)H("response",{type:"image",images:ge,text:ae.join(""),rawJson:W});else{const me=ae.join("")||"";H("response",{type:"text",text:me,rawJson:W})}}catch(c){H("error",c?.message||String(c))}},oe=w(()=>{const c=P.value.trim()||"Hello",x=[];for(let $=0;$<I.value.length;$++)x.push({inlineData:{mimeType:I?.value?.[$]?.mimeType,data:`<BASE64_IMAGE_DATA_${$+1}>`}});x.push({text:c});const F={contents:[{role:"user",parts:x}],generationConfig:l()};return h.value.trim()&&(F.systemInstruction={parts:[{text:h.value.trim()}]}),F}),y=w(()=>{const c=p.value,x=n.baseUrl,F=JSON.stringify(oe.value,null,4).split(`
189`).map((W,Q)=>Q===0?W:"    "+W).join(`
190`),$=N.value==="text-image"?`import base64
191
192data = response.json()
193for part in data["candidates"][0]["content"]["parts"]:
194    if "text" in part:
195        print(part["text"])
196    elif "inlineData" in part:
197        img_data = base64.b64decode(part["inlineData"]["data"])
198        with open("output.png", "wb") as f:
199            f.write(img_data)
200        print("Image saved to output.png")`:`data = response.json()
201print(data["candidates"][0]["content"]["parts"][0]["text"])`;return`import requests
202
203response = requests.post(
204    "${x}/v1beta/models/${n.modelName}:generateContent",
205    headers={
206        "Content-Type": "application/json",
207        "Authorization": f"Bearer ${c}",
208    },
209    json=${F},
210)
211
212${$}`}),_=w(()=>{const c=p.value,x=n.baseUrl,F=JSON.stringify(oe.value,null,2).split(`
213`).map((W,Q)=>Q===0?W:"  "+W).join(`
214`),$=N.value==="text-image"?`const data = await response.json();
215const parts = data.candidates[0].content.parts;
216for (const part of parts) {
217  if (part.text) console.log(part.text);
218  if (part.inlineData) {
219    const fs = await import("fs");
220    fs.writeFileSync("output.png", Buffer.from(part.inlineData.data, "base64"));
221    console.log("Image saved to output.png");
222  }
223}`:`const data = await response.json();
224console.log(data.candidates[0].content.parts[0].text);`;return`const response = await fetch("${x}/v1beta/models/${n.modelName}:generateContent", {
225  method: "POST",
226  headers: {
227    "Content-Type": "application/json",
228    Authorization: \`Bearer ${c}\`,
229  },
230  body: JSON.stringify(${F}),
231});
232
233${$}`}),z=w(()=>JSON.stringify(oe.value,null,2)),j=w(()=>{const c=p.value,x=n.baseUrl,F=z.value.split(`
234`).map(($,W)=>W===0?$:"  "+$).join(`
235`);return`curl ${x}/v1beta/models/${n.modelName}:generateContent \\
236  -H "Content-Type: application/json" \\
237  -H "Authorization: Bearer ${c}" \\
238  -d '${F}'`});return ce({submit:X,codePython:y,codeNodejs:_,codeJson:z,codeHttp:j}),(c,x)=>{const F=Se;return a(),i("div",pl,[B("",!0),e("div",null,[e("label",gl,o(c.$t("playground.gemini_upload_image")),1),e("p",vl,o(c.$t("playground.gemini_upload_image_hint")),1),I.value.length?(a(),i("div",_l,[(a(!0),i(Z,null,ue(I.value,($,W)=>(a(),i("div",{key:W,class:"flex items-center gap-3 p-2 bg-gray-50 rounded-lg border border-gray-200"},[e("img",{src:`data:${$.mimeType};base64,${$.base64}`,class:"w-12 h-12 object-cover rounded-md shrink-0",alt:$.name},null,8,xl),e("p",yl,o($.name),1),e("button",{onClick:Q=>K(W),class:"flex cursor-pointer p-1 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors shrink-0"},[r(F,{name:"i-lucide-x",class:"w-4 h-4"})],8,fl)]))),128))])):B("",!0),e("input",{ref_key:"fileInputRef",ref:S,type:"file",accept:"image/png,image/jpeg,image/webp,image/heic,image/heif",multiple:"",class:"hidden",onChange:A},null,544),e("button",{onClick:x[1]||(x[1]=$=>S.value?.click()),class:"cursor-pointer w-full flex items-center justify-center gap-2 px-4 py-2.5 border-2 border-dashed border-gray-300 rounded-lg text-sm text-gray-500 hover:border-blue-400 hover:text-blue-600 transition-colors"},[r(F,{name:"i-lucide-image-plus",class:"w-4 h-4"}),Y(" "+o(I.value.length?c.$t("playground.gemini_add_more_images"):c.$t("playground.gemini_upload_image")),1)])]),e("div",null,[e("label",bl,o(c.$t("playground.user_message_placeholder")),1),r(M(he),{modelValue:P.value,"onUpdate:modelValue":x[2]||(x[2]=$=>P.value=$),placeholder:c.$t("playground.user_message_placeholder"),autoResize:"",rows:5,class:"w-full",onKeydown:[_e(xe(X,["ctrl"]),["enter"]),_e(xe(X,["meta"]),["enter"])]},null,8,["modelValue","placeholder","onKeydown"])]),e("div",null,[e("label",hl,o(c.$t("playground.gemini_output_mode_label")),1),e("p",$l,o(c.$t("playground.gemini_de
238sc_output_mode")),1),e("div",wl,[e("button",{onClick:x[3]||(x[3]=$=>N.value="text"),class:ee(["flex items-center gap-2 px-3.5 py-2 rounded-lg border text-sm font-medium transition-all cursor-pointer",N.value==="text"?"border-blue-500 bg-blue-50 text-blue-700 ring-1 ring-blue-500/30":"border-gray-200 bg-white text-gray-600 hover:border-gray-300 hover:bg-gray-50"])},[e("span",{class:ee(["flex items-center justify-center w-4 h-4 rounded-full border-2 shrink-0 transition-colors",N.value==="text"?"border-blue-500 bg-blue-500":"border-gray-300"])},[N.value==="text"?(a(),pe(F,{key:0,name:"i-lucide-check",class:"w-2.5 h-2.5 text-white"})):B("",!0)],2),r(F,{name:"i-lucide-type",class:"w-3.5 h-3.5"}),Y(" "+o(c.$t("playground.gemini_output_text")),1)],2),e("button",{onClick:x[4]||(x[4]=$=>N.value="text-image"),class:ee(["flex items-center gap-2 px-3.5 py-2 rounded-lg border text-sm font-medium transition-all cursor-pointer",N.value==="text-image"?"border-blue-500 bg-blue-50 text-blue-700 ring-1 ring-blue-500/30":"border-gray-200 bg-white text-gray-600 hover:border-gray-300 hover:bg-gray-50"])},[e("span",{class:ee(["flex items-center justify-center w-4 h-4 rounded-full border-2 shrink-0 transition-colors",N.value==="text-image"?"border-blue-500 bg-blue-500":"border-gray-300"])},[N.value==="text-image"?(a(),pe(F,{key:0,name:"i-lucide-check",class:"w-2.5 h-2.5 text-white"})):B("",!0)],2),r(F,{name:"i-lucide-image",class:"w-3.5 h-3.5"}),Y(" "+o(c.$t("playground.gemini_output_text_image")),1)],2)])]),N.value==="text-image"?(a(),i("div",kl,[e("div",null,[e("label",Cl,o(c.$t("playground.gemini_aspect_ratio_label")),1),e("p",jl,o(c.$t("playground.gemini_desc_aspect_ratio")),1),r(M(Te),{modelValue:E.value,"onUpdate:modelValue":x[5]||(x[5]=$=>E.value=$),options:m,optionLabel:"label",optionValue:"value",class:"w-full"},null,8,["modelValue"])]),e("div",null,[e("label",Ml,o(c.$t("playground.gemini_image_size_label")),1),e("p",Vl,o(c.$t("playground.gemini_desc_image_size")),1),r(M(Te),{modelValue:d.value,"onUpdate:modelValue":x[6]||(x[6]=$=>d.value=$),options:O.value,optionLabel:"label",optionValue:"value",class:"w-full"},null,8,["modelValue","options"])])])):B("",!0),e("details",Sl,[e("summary",Tl,[r(F,{name:"i-lucide-chevron-right",class:"w-4 h-4 transition-transform group-open:rotate-90"}),e("span",null,o(c.$t("playground.temperature_label"))+": "+o(V.value.toFixed(1)),1),x[11]||(x[11]=e("span",{class:"text-gray-300"},"·",-1)),e("span",null,o(c.$t("playground.gemini_max_output_tokens_label"))+": "+o(C.value),1),x[12]||(x[12]=e("span",{class:"text-gray-300"},"·",-1)),e("span",null,o(c.$t("playground.top_p_label"))+": "+o(U.value.toFixed(2)),1)]),e("div",Pl,[e("div",null,[e("div",Nl,[e("label",Ul,o(c.$t("playground.temperature_label")),1),e("span",Al,o(V.value.toFixed(1)),1)]),e("p",Ol,o(c.$t("playground.gemini_desc_temperature")),1),r(M($e),{modelValue:V.value,"onUpdate:modelValue":x[7]||(x[7]=$=>V.value=$),min:0,max:2,step:.1},null,8,["modelValue"])]),e("div",null,[e("label",Bl,o(c.$t("playground.gemini_max_output_tokens_label")),1),e("p",Il,o(c.$t("playground.gemini_desc_max_output_tokens")),1),r(M(ke),{modelValue:C.value,"onUpdate:modelValue":x[8]||(x[8]=$=>C.value=$),min:1,max:65536,step:256,showButtons:"",class:"w-full"},null,8,["modelValue"])]),e("div",null,[e("div",Rl,[e("label",Fl,o(c.$t("playground.top_p_label")),1),e("span",zl,o(U.value.toFixed(2)),1)]),e("p",Hl,o(c.$t("playground.gemini_desc_top_p")),1),r(M($e),{modelValue:U.value,"onUpdate:modelValue":x[9]||(x[9]=$=>U.value=$),min:0,max:1,step:.05},null,8,["modelValue"])]),e("div",null,[e("label",Kl,o(c.$t("playground.gemini_top_k_label")),1),e("p",ql,o(c.$t("playground.gemini_desc_top_k")),1),r(M(ke),{modelValue:T.value,"onUpdate:modelValue":x[10]||(x[10]=$=>T.value=$),min:1,max:100,step:1,showButtons:"",class:"w-full",placeholder:"Auto"},null,8,["modelValue"])])])])])}}}),El=Object.assign(Jl,{__name:"PagesModelsPlaygroundFormGemini"}),Ll={class:"flex flex-col gap-4 py-6"},Dl={key:0,class:"flex items-center gap-2 flex-wrap"},Gl=["onClick"],Yl={class:"flex flex-col lg:flex-row gap-5"},Wl={class:"flex-1 flex flex-col gap-0 min-w-0 rounded-xl border border-gray-200 overflow-hidden"},Ql={class:"flex items-center bg-gray-50 border-b border-gray-200 overflow-x-auto"},Xl=["onClick"],Zl={class:"p-4 flex flex-col gap-4"},es={class:"rounded-lg border border-gray-100 bg-gray-50/50 p-3 flex flex-col gap-2.5"},ts={class:"text-xs font-semibold text-gray-600 flex items-center gap-1.5 uppercase tracking-wider"},os={class:"flex gap-4"},ls={key:0,class:"flex items-center gap-2 cursor-pointer text-sm"},ss={class:"flex items-center gap-2 cursor-pointer text-sm"},as={key:0},ns={key:0,class:"text-xs text-gray-400 mt-1"},is={key:1},rs={class:"flex items-center gap-2 flex-wrap"},ds={class:"text-xs text-gray-500"},us=["onClick"],cs={key:0,class:"ml-1 opacity-75"},ms={class:"flex items-center justify-between"},ps=["disabled"],gs={class:"relative flex flex-col flex-1"},vs={class:"flex-1 m-0 p-4 text-xs font-mono leading-relaxed text-gray-800 bg-gray-50 overflow-auto max-h-[600px] whitespace-pre-wrap break-all"},_s={class:"flex-1 min-w-0"},xs={class:"rounded-xl border border-gray-100 bg-white p-4 min-h-[300px] lg:min-h-full flex flex-col"},ys={key:0,class:"flex-1 flex items-center justify-center gap-2 text-gray-400"},fs={class:"text-sm"},bs={key:1,class:"flex items-start gap-3 text-sm text-red-700 bg-red-50 border border-red-200 rounded-lg p-3"},hs={class:"break-all"},$s={key:2,class:"flex-1 overflow-y-auto"},ws={class:"prose prose-slate max-w-none text-sm"},ks={key:3,class:"grid grid-cols-1 gap-3"},Cs=["src","alt"],js={key:4},Ms=["src"],Vs={key:5,class:"flex-1 flex items-center justify-center text-sm text-gray-400"},Ss={key:6,class:"mt-4 border-t border-gray-100 pt-3 flex items-center justify-between"},Ts={key:7,class:"mt-2 text-xs bg-gray-50 border border-gray-200 rounded-lg p-3 overflow-x-auto max-h-80 overflow-y-auto font-mono text-gray-700 whitespace-pre-wrap"},Ps=Ce({__name:"ModelPlayground",props:{model:{},modelName:{}},setup(se){const ce=se,{t:ie}=je(),n=et(),{triggerFirstCall:H}=yt(),G=f(null),h=w(()=>{const g=ce.model?.playground_types;return g?new Set(g.split(",").map(u=>
238u.trim()).filter(Boolean)):new Set}),P=[{value:"gemini",label:()=>ie("playground.mode_gemini"),icon:"i-lucide-sparkles"},{value:"openai-chat",label:()=>ie("playground.mode_openai_chat"),icon:"i-lucide-message-square"},{value:"openai-image",label:()=>ie("playground.mode_image"),icon:"i-lucide-image"},{value:"openai-video",label:()=>ie("playground.mode_video"),icon:"i-lucide-video"},{value:"claude",label:()=>ie("playground.mode_claude"),icon:"i-lucide-message-circle"}],V=w(()=>P.filter(g=>h.value.has(g.value)).map(g=>({value:g.value,label:g.label(),icon:g.icon}))),C=f("");Fe(V,g=>{g.length&&!g.find(u=>u.value===C.value)&&(C.value=g[0].value)},{immediate:!0});const U=f("custom"),T=f(null),I=f(""),S=f([]),A=f(!1),K=w(()=>S.value.map(g=>({label:g.name||`Token #${g.id}`,value:g.id}))),N=w(()=>U.value==="custom"?I.value.trim():S.value.find(u=>u.id===T.value)?.key??""),E=f(0),d=w(()=>Xe[E.value].url),m=f(!1),O=f(""),p=f([]),ne=f(""),l=f(null),X=f(!1),oe=f(""),y=w(()=>O.value||p.value.length>0||ne.value||oe.value);tt(async()=>{U.value="token",A.value=!0;try{const g=await ft({page_size:50});S.value=(g.items||[]).map(u=>(u.key=`sk-${u.key}`,u)),S.value.length>0?T.value=S.value[0].id:U.value="custom"}catch{U.value="custom"}finally{A.value=!1}});const _=()=>{O.value="",p.value=[],ne.value="",l.value=null,oe.value="",X.value=!1},z=()=>{_(),m.value=!0},j=g=>{m.value=!1,l.value=g.rawJson,g.type==="text"?O.value=g.text??"":g.type==="image"?p.value=g.images??[]:g.type==="video"&&(ne.value=g.videoUrl??""),H()},c=g=>{m.value=!1,oe.value=g},x=w(()=>["openai-image","openai-video"].includes(C.value)),F=()=>{G.value?.submit()},$=f("form"),W=w(()=>{if(!G.value)return"";switch($.value){case"python":return G.value.codePython;case"nodejs":return G.value.codeNodejs;case"json":return G.value.codeJson;case"http":return G.value.codeHttp;default:return""}}),Q=f(!1),ae=async g=>{try{await navigator.clipboard.writeText(g)}catch{const u=document.createElement("textarea");u.value=g,u.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u)}Q.value=!0,setTimeout(()=>{Q.value=!1},2e3)},ge=f(!1),me=async()=>{const g=O.value||JSON.stringify(l.value,null,2);try{await navigator.clipboard.writeText(g)}catch{const u=document.createElement("textarea");u.value=g,u.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u)}ge.value=!0,setTimeout(()=>{ge.value=!1},2e3)};return(g,u)=>{const re=Se,Ue=lt;return a(),i("div",Ll,[V.value.length>1?(a(),i("div",Dl,[(a(!0),i(Z,null,ue(V.value,L=>(a(),i("button",{key:L.value,onClick:fe=>{C.value=L.value,_()},class:ee(["flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg border transition-colors cursor-pointer",C.value===L.value?"bg-blue-50 text-blue-700 border-blue-200":"bg-white text-gray-600 border-gray-200 hover:border-gray-300 hover:text-gray-800"])},[r(re,{name:L.icon,class:"w-4 h-4"},null,8,["name"]),Y(" "+o(L.label),1)],10,Gl))),128))])):B("",!0),e("div",Yl,[e("div",Wl,[e("div",Ql,[(a(!0),i(Z,null,ue([{key:"form",label:g.$t("playground.tab_form"),icon:"i-lucide-text-cursor-input"},{key:"python",label:g.$t("playground.tab_python"),icon:"i-lucide-code"},{key:"nodejs",label:g.$t("playground.tab_nodejs"),icon:"i-lucide-code"},{key:"json",label:g.$t("playground.tab_json"),icon:"i-lucide-braces"},{key:"http",label:g.$t("playground.tab_http"),icon:"i-lucide-terminal"}],L=>(a(),i("button",{key:L.key,onClick:fe=>$.value=L.key,class:ee(["flex items-center gap-1.5 px-3 py-2.5 text-xs font-medium whitespace-nowrap transition-colors border-b-2 -mb-px cursor-pointer bg-transparent",$.value===L.key?"text-blue-600 border-blue-600":"text-gray-500 border-transparent hover:text-gray-700"])},[r(re,{name:L.icon,class:"w-3.5 h-3.5"},null,8,["name"]),Y(" "+o(L.label),1)],10,Xl))),128))]),we(e("div",Zl,[e("div",es,[e("h3",ts,[r(re,{name:"i-lucide-key-round",class:"w-3.5 h-3.5"}),Y(" "+o(g.$t("playground.api_key_section")),1)]),e("div",os,[M(n).isLogin?(a(),i("label",ls,[we(e("input",{type:"radio","onUpdate:modelValue":u[0]||(u[0]=L=>U.value=L),value:"token",class:"accent-blue-600"},null,512),[[Ye,U.value]]),Y(" "+o(g.$t("playground.use_saved_token")),1)])):B("",!0),e("label",ss,[we(e("input",{type:"radio","onUpdate:modelValue":u[1]||(u[1]=L=>U.value=L),value:"custom",class:"accent-blue-600"},null,512),[[Ye,U.value]]),Y(" "+o(g.$t("playground.enter_custom_key")),1)])]),U.value==="token"&&M(n).isLogin?(a(),i("div",as,[r(M(Te),{modelValue:T.value,"onUpdate:modelValue":u[2]||(u[2]=L=>T.value=L),options:K.value,optionLabel:"label",optionValue:"value",placeholder:g.$t("playground.select_token_placeholder"),loading:A.value,class:"w-full"},null,8,["modelValue","options","placeholder","loading"]),!A.value&&S.value.length===0?(a(),i("p",ns,o(g.$t("playground.no_tokens")),1)):B("",!0)])):(a(),i("div",is,[r(M(Ht),{modelValue:I.value,"onUpdate:modelValue":u[3]||(u[3]=L=>I.value=L),placeholder:g.$t("playground.custom_key_placeholder"),class:"w-full font-mono text-sm",type:"password"},null,8,["modelValue","placeholder"])])),e("div",rs,[e("span",ds,o(g.$t("playground.api_host_label"))+":",1),(a(!0),i(Z,null,ue(M(Xe),(L,fe)=>(a(),i("button",{key:L.id,onClick:de=>E.value=fe,class:ee(["px-2.5 py-1 text-xs rounded-lg border transition-colors cursor-pointer",E.value===fe?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-600 border-gray-300 hover:border-blue-400"])},[Y(o(L.url.replace("https://",""))+" ",1),L.recommended?(a(),i("span",cs,"★")):B("",!0)],10,us))),128))])]),C.value==="openai-chat"?(a(),pe(To,{key:0,ref_key:"formRef",ref:G,"model-name":se.modelName,"resolved-key":N.value,"base-url":d.value,"endpoint-chat":!!se.model?.endpoint_chat,"endpoint-completion":!!se.model?.endpoint_completion,onSubmitStart:z,onResponse:j,onError:c},null,8,["model-name","resolved-key","base-url","endpoint-chat","endpoint-completion"])):C.value==="openai-image"?(a(),pe(qo,{key:1,ref_key:"formRef",ref:G,"model-name":se.modelName,"resolved-key":N.value,"base-url":d.value,onSubmitStart:z,onResponse:j,onError:c},null,8,["model-name","resolved-key","base-url"])):C.value==="openai-video"?(a(),pe(Do,{key:2,ref_key:"formRef",ref:G,"model-name":se.modelName,"resolved-key":N.value,"base-url":d.value,onSubmitStart:z,onResponse:j,onError:c},null,8,["model-name","resolved-key","base-url"])):C.value==="claude"?(a(),pe(ml,{key:3,ref_key:"formRef",ref:G,"model-name":se.modelName,"resolved-key":N.value,"base-url":d.value,onSubmitStart:z,onResponse:j,onError:c},null,8,["model-name","resolved-key","base-url"])):C.value==="gemini"?(a(),pe(El,{key:4,ref_key:"formRef",ref:G,"model-name":se.modelName,"resolved-key":N.value,"base-url":d.value,onSubmitStart:z,onResponse:j,onError:c},null,8,["model-name","resolved-key","base-url"])):B("",!0),e("div",ms,[e("div",null,[y.value?(a(),i("button",{key:0,onClick:_,class:"cursor-pointer px-4 py-2 text-sm text-gray-600 rounded-xl border border-gray-200 hover:bg-gray-50 transition-colors"},o(g.$t("playground.clear")),1)):B("",!0)]),e("button",{onClick:F,disabled:!N.value||m.value,class:"cursor-pointer px-5 py-2 bg-blue-600 text-white text-sm font-semibold rounded-xl hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors flex items-center gap-2"},[m.value?(a(),pe(re,{key:0,name:"i-lucide-loader-2",class:"w-4 h-4 animate-spin"})):(a(),pe(re,{key:1,name:x.value?"i-lucide-sparkles":"i-lucide-send",class:"w-4 h-4"},null,8,["name"])),Y(" "+o(m.value?g.$t("playground.loading"):x.value?g.$t("playground.generate"):g.$t("playground.send")),1)],8,ps)])],512),[[Ve,$.value==="form"]]),we(e("div",gs,[e("button",{onClick:u[4]||(u[4]=L=>ae(W.value)),class:"absolute top-2 right-2 z-10 cursor-pointer flex items-center gap-1 px-2 py-1 text-xs rounded-md bg-white/80 backdrop-blur border border-gray-200 text-gray-600 hover:text-gray-900 hover:bg-white transition-colors"},[r(re,{name:Q.value?"i-lucide-check":"i-lucide-copy",class:"w-3.5 h-3.5"},null,8,["name"]),Y(" "+o(Q.value?g.$t("playground.code_copied"):g.$t("playground.copy_code")),1)]),e("pre",vs,[e("code",null,o(W.value),1)])],512),[[Ve,$.value!=="form"]])]),e("div",_s,[e("div",xs,[m.value?(a(),i("div",ys,[r(re,{name:"i-lucide-loader-2",class:"w-5 h-5 animate-spin"}),e("span",fs,o(g.$t("playground.loading")),1)])):oe.value?(a(),i("div",bs,[r(re,{name:"i-lucide-alert-circle",class:"w-4 h-4 mt-0.5 shrink-0"}),e("span",hs,o(g.$t("playground.error_prefix"))+": "+o(oe.value),1)])):O.value?(a(),i("div",$s,[e("div",ws,[r(Ue,{value:O.value},null,8,["value"])])])):p.value.length?(a(),i("div",ks,[(a(!0),i(Z,null,ue(p.value,(L,fe)=>(a(),i("div",{key:fe,class:"rounded-lg overflow-hidden border border-gray-100"},[e("img",{src:L,class:"w-full object-cover",alt:`Generated image ${fe+1}`,loading:"lazy"},null,8,Cs)]))),128))])):ne.value?(a(),i("div",js,[e("video",{src:ne.value,controls:"",class:"w-full rounded-lg shadow-sm max-h-[500px]"},null,8,Ms)])):m.value?B("",!0):(a(),i("div",Vs,o(g.$t("playground.no_response_yet")),1)),l.value&&!m.value?(a(),i("div",Ss,[e("button",{onClick:u[5]||(u[5]=L=>
238X.value=!X.value),class:"cursor-pointer text-xs text-gray-500 hover:text-gray-700 flex items-center gap-1 bg-transparent border-none"},[r(re,{name:"i-lucide-code-2",class:"w-3.5 h-3.5"}),Y(" "+o(X.value?g.$t("playground.hide_raw_json"):g.$t("playground.show_raw_json")),1)]),e("button",{onClick:me,class:"cursor-pointer text-xs text-gray-500 hover:text-gray-700 flex items-center gap-1 bg-transparent border-none"},[r(re,{name:ge.value?"i-lucide-check":"i-lucide-copy",class:"w-3.5 h-3.5"},null,8,["name"]),Y(" "+o(ge.value?g.$t("playground.copied"):g.$t("playground.copy_response")),1)])])):B("",!0),X.value&&l.value?(a(),i("pre",Ts,o(JSON.stringify(l.value,null,2)),1)):B("",!0)])])])])}}}),Ns=Object.assign(ot(Ps,[["__scopeId","data-v-772af1ef"]]),{__name:"PagesModelsModelPlayground"}),Us={class:"min-h-dvh bg-white pt-[80px]"},As={key:0,class:"flex items-center justify-center min-h-[60vh]"},Os={key:1,class:"flex flex-col items-center justify-center min-h-[60vh] px-4"},Bs={class:"text-2xl font-bold text-gray-800 mb-4"},Is={class:"text-gray-600 mb-6"},Rs={key:2,class:"relative mx-auto flex max-w-6xl flex-col gap-8 overflow-hidden px-4 py-10 md:px-12",style:{"padding-bottom":"120px"}},Fs={class:"flex flex-col justify-between gap-4 lg:flex-row"},zs={class:"flex flex-row items-center gap-4"},Hs={class:"flex flex-row items-center gap-2"},Ks={class:"flex shrink-0 overflow-hidden rounded-lg w-16 h-16"},qs={key:1,class:"w-full h-full bg-gray-100 flex items-center justify-center text-2xl text-gray-600"},Js={class:"flex flex-1 flex-col"},Es={class:"flex flex-row flex-wrap items-center gap-2"},Ls={class:"text-2xl font-semibold whitespace-nowrap"},Ds=["title"],Gs={class:"text-xs font-mono text-gray-500"},Ys={key:0,class:"w-3 h-3 text-gray-400 group-hover:text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ws={key:1,class:"w-3 h-3 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Qs=["title"],Xs={class:"hidden text-gray-600 sm:flex"},Zs={class:"flex text-gray-600 sm:hidden"},ea={class:"flex flex-col items-center lg:flex-row lg:rounded-lg lg:border lg:border-solid lg:border-gray-200"},ta={key:0,class:"flex w-full flex-1 flex-row items-center justify-between gap-2 border-0 border-t border-solid border-gray-200 py-3 lg:w-auto lg:flex-col lg:rounded-lg lg:border-none lg:px-2 lg:py-5"},oa={class:"text-sm font-semibold lg:text-xs lg:text-gray-400 lg:uppercase"},la={class:"flex flex-row items-center gap-2 text-lg font-bold lg:text-2xl"},sa={class:"flex flex-row gap-1"},aa={class:"hidden text-sm lg:block"},na={key:1,class:"hidden h-12 w-px bg-gray-200 lg:block"},ia={key:2,class:"flex w-full flex-1 flex-row items-center justify-between gap-2 border-0 border-t border-solid border-gray-200 py-3 lg:w-auto lg:flex-col lg:rounded-lg lg:border-none lg:px-2 lg:py-5"},ra={class:"text-sm font-semibold lg:text-xs lg:text-gray-400 lg:uppercase"},da={class:"flex flex-row items-center gap-2 text-lg font-bold lg:text-2xl"},ua={class:"flex flex-row gap-1"},ca={class:"hidden text-sm lg:block"},ma={key:3,class:"hidden h-12 w-px bg-gray-200 lg:block"},pa={class:"flex w-full flex-1 flex-row items-center justify-between gap-2 border-0 border-t border-solid border-gray-200 py-3 lg:w-auto lg:flex-col lg:rounded-lg lg:border-none lg:px-2 lg:py-5"},ga={class:"text-sm font-semibold lg:text-xs lg:text-gray-400 lg:uppercase"},va={class:"flex flex-row items-center gap-2 text-lg font-bold lg:text-2xl"},_a={class:"text-lg md:text-xl"},xa={key:0,class:"text-blue-500"},ya={key:1,class:"text-amber-500"},fa={key:2,class:"flex flex-col items-center leading-tight"},ba={class:"mt-1 text-[11px] font-medium uppercase tracking-wide text-slate-400"},ha={class:"hidden text-sm lg:block"},$a={key:0,class:"hidden h-12 w-px bg-gray-200 lg:block"},wa={key:1,class:"flex w-full flex-1 flex-row items-center justify-between gap-2 border-0 border-t border-solid border-gray-200 py-3 lg:w-auto lg:flex-col lg:rounded-lg lg:border-none lg:px-2 lg:py-5"},ka={class:"text-sm font-semibold lg:text-xs lg:text-gray-400 lg:uppercase"},Ca={class:"flex flex-row items-center gap-2 text-lg font-bold lg:text-2xl"},ja={class:"flex flex-row items-baseline gap-2 text-lg md:text-xl"},Ma={class:"hidden text-sm lg:block"},Va={class:"flex w-full flex-1 flex-row items-center justify-between gap-2 border-0 border-t border-solid border-gray-200 py-3 lg:w-auto lg:flex-col lg:rou
238nded-lg lg:border-none lg:px-2 lg:py-5"},Sa={class:"text-sm font-semibold lg:text-xs lg:text-gray-400 lg:uppercase"},Ta={class:"flex flex-row items-center gap-2 text-lg font-bold lg:text-2xl"},Pa={key:0,class:"flex items-center text-lg md:text-xl"},Na={key:1,class:"flex items-center text-lg md:text-xl"},Ua={key:2,class:"flex items-center text-lg md:text-xl text-gray-400"},Aa={key:3,class:"flex items-center text-lg md:text-xl"},Oa={key:4,class:"flex items-center text-lg md:text-xl text-gray-400"},Ba={key:5,class:"flex items-center text-lg md:text-xl"},Ia={key:6,class:"flex items-center text-lg md:text-xl text-gray-400"},Ra={class:"hidden text-sm lg:block"},Fa={class:"flex w-full flex-1 flex-row items-center justify-between gap-2 border-0 border-t border-solid border-gray-200 py-3 lg:w-auto lg:flex-col lg:rounded-lg lg:border-none lg:px-2 lg:py-5"},za={class:"text-sm font-semibold lg:text-xs lg:text-gray-400 lg:uppercase"},Ha={class:"flex flex-row items-center gap-2 text-lg font-bold lg:text-2xl"},Ka={key:0,class:"flex items-center text-lg md:text-xl"},qa={key:1,class:"flex items-center text-lg md:text-xl text-gray-400"},Ja={key:2,class:"flex items-center text-lg md:text-xl"},Ea={key:3,class:"flex items-center text-lg md:text-xl text-gray-400"},La={key:4,class:"flex items-center text-lg md:text-xl"},Da={key:5,class:"flex items-center text-lg md:text-xl text-gray-400"},Ga={key:6,class:"flex items-center text-lg md:text-xl"},Ya={key:7,class:"flex items-center text-lg md:text-xl text-gray-400"},Wa={class:"hidden text-sm lg:block"},Qa={key:0,class:"rounded-xl border border-gray-200 bg-white p-4 sm:p-5"},Xa={key:1,class:"overflow-hidden rounded-xl border border-gray-200 bg-white"},Za={class:"flex flex-col gap-3 border-b border-gray-100 bg-gray-50/60 px-4 py-4 sm:px-5 lg:flex-row lg:items-center lg:justify-between"},en={class:"min-w-0"},tn={class:"mb-1 flex items-center gap-2"},on={class:"text-sm font-semibold text-slate-900"},ln={class:"text-xs leading-5 text-slate-500"},sn={class:"overflow-x-auto"},an={class:"min-w-[640px] divide-y divide-gray-100"},nn={class:"flex items-center gap-3"},rn={class:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-slate-100 text-[11px] font-semibold text-slate-500"},dn={class:"font-medium text-slate-800"},un={class:"font-mono font-semibold tabular-nums text-slate-900"},cn={class:"leading-6 text-slate-500"},mn={class:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-slate-900 via-slate-800 to-indigo-900 p-6 md:p-8 border border-white/10"},pn={class:"relative z-10 flex flex-col md:flex-row items-start md:items-center justify-between gap-6"},gn={class:"flex-1"},vn={class:"flex items-center gap-2.5 mb-2"},_n={class:"text-lg md:text-xl font-bold text-white"},xn={class:"text-slate-300 text-sm md:text-base leading-relaxed"},yn={class:"flex items-center gap-3 shrink-0"},fn={class:"flex items-center gap-8 border-b border-gray-100 relative"},bn=["onClick"],hn={class:"animate-fade-in"},$n={class:"flex flex-col gap-8 py-6"},wn={class:"prose prose-slate max-w-none dark:prose-invert"},kn={class:"animate-fade-in"},Cn={class:"flex flex-col gap-8 py-6"},jn={class:"flex flex-col gap-4 lg:flex-row"},Mn={class:"flex w-[200px] text-lg font-semibold"},Vn={class:"flex-1 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 text-sm text-gray-600"},Sn={key:0,class:"flex flex-col gap-1"},Tn={class:"text-xs text-gray-400 uppercase tracking-wider"},Pn={class:"flex items-center gap-2"},Nn={class:"font-medium"},Un={key:1,class:"flex flex-col gap-1"},An={class:"text-xs text-gray-400 uppercase tracking-wider"},On={class:"flex items-center gap-2"},Bn={class:"font-medium"},In={key:2,class:"flex flex-col gap-1"},Rn={class:"text-xs text-gray-400 uppercase tracking-wider"},Fn={class:"flex items-center gap-2"},zn={class:"font-medium"},Hn={key:3,class:"flex flex-col gap-1"},Kn={class:"text-xs text-gray-400 uppercase tracking-wider"},qn={class:"flex items-center gap-2"},Jn={class:"font-medium"},En={key:4,class:"flex flex-col gap-1"},Ln={class:"text-xs text-gray-400 uppercase tracking-wider"},Dn={class:"flex items-center gap-2"},Gn={class:"font-medium"},Yn={key:5,class:"flex flex-col gap-1"},Wn={class:"text-xs text-gray-400 uppercase tracking-wider"},Qn={class:"flex items-center gap-2"},Xn={class:"flex flex-col gap-4 lg:flex-row"},Zn={class:"flex w-[200px] text-lg font-semibold"},ei={class:"flex flex-1 flex-col gap-4"},ti={class:"grid w-full grid-cols-1 gap-4 md:grid-cols-2"},oi={class:"flex flex-row gap-2"},li={class:"relative flex flex-col items-center justify-center text-xl"},si={class:"flex flex-col justify-center"},ai={class:"text-xs text-gray-500"},ni={class:"flex flex-row gap-2"},ii={class:"relative flex flex-col items-center justify-center text-xl"},ri={class:"flex flex-col justify-center"},di={class:"text-xs text-gray-500"},ui={class:"flex flex-row gap-2"},ci={class:"relative flex flex-col items-center justify-center text-xl"},mi={class:"flex flex-col justify-center"},pi={class:"text-xs text-gray-500"},gi={class:"flex flex-row gap-2"},vi={class:"relative flex flex-col items-center justify-center text-xl"},_i={class:"flex flex-col justify-center"},xi={class:"text-xs text-gray-500"},yi={class:"flex flex-col gap-4 lg:flex-row"},fi={class:"flex w-[200px] text-lg font-semibold"},bi={class:"flex flex-1 flex-col gap-5"},hi={class:"flex items-center gap-2 px-4 py-2.5"},$i={class:"text-xs font-medium text-gray-500 uppercase tracking-wide"},wi={class:"min-w-0 flex-1"},ki={class:"text-sm font-medium text-gray-900 truncate"},Ci={class:"text-xs text-gray-500 font-mono truncate"},ji=["href"],Mi={class:"animate-fade-in"},Vi={class:"flex flex-col gap-6 py-6"},Si={class:"flex items-center justify-between"},Ti={class:"text-xl font-bold text-gray-900"},Pi={key:0,class:"text-center py-12 text-gray-500"},Ni={key:1,class:"flex flex-col gap-6"},Ui={class:"flex items-center gap-2 mb-3"},Ai={class:"text-sm font-bold text-slate-700 uppercase tracking-wide"},Oi={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Bi={key:0,class:"bg-white border border-gray-200 rounded-xl overflow-hidden shadow-sm"},Ii={class:"px-4 py-3 border-b border-gray-100 bg-gray-50/50"},Ri={class:"flex items-center justify-between"},Fi={class:"font-semibold text-gray-900"},zi={class:"p-4"},Hi={class:"space-y-2"},Ki={class:"absolute inset-0 bg-gray-100 rounded-lg overflow-hidden"},qi={class:"absolute inset-0 flex items-center justify-between px-2"},Ji={class:"flex items-center gap-1.5 min-w-0"},Ei={class:"border-t border-gray-100"},Li={class:"w-6 text-center"},Di={key:0,class:"text-yellow-500"},Gi={key:1,class:"text-gray-400"},Yi={key:2,class:"text-amber-600"},Wi={key:3,class:"text-xs text-gray-400 font-mono"},Qi={class:"flex items-center gap-2 flex-1 min-w-0"},Xi={key:0,class:"text-xs bg-blue-100 text-blue-600 px-1.5 py-0.5 rounded"},Zi={class:"font-mono text-xs tabular-nums text-gray-600"},er={class:"mt-16 max-w-4xl pl-2"},tr={class:"text-lg font-semibold text-slate-800 mb-8 pb-2 border-b border-slate-200"},or={class:"space-y-10"}
238,lr={class:"text-xs font-bold text-slate-400 uppercase tracking-widest mb-4"},sr={class:"space-y-3"},ar={class:"text-sm font-medium text-slate-700 sm:min-w-[140px] shrink-0"},nr={class:"text-sm text-slate-500 leading-relaxed"},ir={class:"animate-fade-in"},rr={class:"relative overflow-hidden rounded-2xl bg-slate-800 p-8 md:p-12"},dr={class:"relative z-10 flex flex-col items-center text-center"},ur={class:"text-2xl md:text-3xl font-bold text-white mb-3"},cr={class:"text-slate-300 text-base md:text-lg mb-8 max-w-2xl"},mr={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-10 w-full max-w-4xl"},pr={class:"flex flex-col items-center justify-center p-4 rounded-xl bg-slate-700/50 border border-slate-600/50"},gr={class:"text-sm font-medium text-slate-200"},vr={class:"flex flex-col items-center justify-center p-4 rounded-xl bg-slate-700/50 border border-slate-600/50"},_r={class:"text-sm font-medium text-slate-200"},xr={class:"flex flex-col items-center justify-center p-4 rounded-xl bg-slate-700/50 border border-slate-600/50"},yr={class:"text-sm font-medium text-slate-200"},fr={class:"flex flex-col items-center justify-center p-4 rounded-xl bg-slate-700/50 border border-slate-600/50"},br={class:"text-sm font-medium text-slate-200"},hr={class:"flex flex-col sm:flex-row items-center gap-4"},$r={key:0,class:"fixed bottom-0 left-0 right-0 z-50 bg-white/80 backdrop-blur-xl border-t border-gray-200/60 shadow-[0_-4px_20px_rgba(0,0,0,0.08)]"},wr={class:"max-w-6xl mx-auto px-4 py-3 flex items-center justify-between gap-4"},kr={class:"flex items-center gap-3 min-w-0"},Cr={class:"flex shrink-0 overflow-hidden rounded-lg w-8 h-8"},jr={class:"min-w-0"},Mr={class:"text-sm font-semibold text-gray-900 truncate"},Vr={class:"text-xs text-gray-500 hidden sm:block"},Sr={key:0,class:"font-medium text-blue-500"},Tr={key:1,class:"font-medium text-amber-500"},Pr={key:2,class:"font-medium text-green-600"},Nr={key:3},Ur={key:4},Ar={class:"flex items-center gap-2 shrink-0"},Or=Ce({__name:"[id]",async setup(se){let ce,ie;const{t:n}=je(),H=At(),G=w(()=>H.params.id),h=bt(),P=et(),V=ht(),C=$t(),U=w(()=>C.isAvailabilityGridEnabled),T=w(()=>{const t=l.value?.name;return t?V.chatModels.some(s=>s.value===t)?"chat":V.imageModels.some(s=>s.value===t)?"image":V.videoModels.some(s=>s.value===t)?"video":null:null}),I=w(()=>!!T.value),S=w(()=>T.value?`/studio/${T.value}`:"/studio/chat"),A=f(!1),K=f(!0),N=()=>{A.value=window.scrollY>300};Qe.register(...It),w(()=>[{label:n("model_detail.tabs.overview"),icon:"i-lucide-book-open",slot:"overview",value:"overview"},{label:n("model_detail.tabs.parameters"),icon:"i-lucide-settings",slot:"parameters",value:"parameters"},{label:n("model_detail.tabs.performance"),icon:"i-lucide-bar-chart-3",slot:"performance",value:"performance"}]);const E=f("parameters"),{data:d,pending:m,error:O}=([ce,ie]=wt(()=>Nt(`model-page-${G.value}`,()=>Promise.all([$fetch(`/webapi/public-models-data/${G.value}`),$fetch(`/webapi/blogs/model/${G.value}`).catch(()=>null)]))),ce=await ce,ie(),ce),p=w(()=>{const t=d.value?.[0];if(!t?.success)return null;const s=t.model||{};return s.pricing=t.pricing||{},{model:s,score:t.score,rank_context:t.rank_context}}),ne=w(()=>d.value?.[1]||null),l=w(()=>p.value?.model||{}),X=w(()=>{if(!p.value)return null;const t=p.value.score;return t?(!t["code-arena"]&&t.dataviz!==void 0&&(t["code-arena"]=(t.dataviz+(t["p5-animation"]||0)+(t["text-to-game"]||0)+(t["text-to-svg"]||0)+(t["text-to-website"]||0)+(t.threejs||0)+(t.tonejs||0))/7),t):null}),oe=w(()=>p.value?.rank_context||null),{data:y}=qt("/webapi/public-models/scores",{key:"all-scores",lazy:!0,transform:t=>{if(!t.success)return[];const s=t.data;return s&&Array.isArray(s.data)?s.data:Array.isArray(s)?s:[]}},"$RsC1okvs6W"),_=w(()=>y.value||[]),z=w(()=>{const t=[];return ne.value&&t.push({label:n("model_detail.tabs.overview"),icon:"i-lucide-book-open",slot:"overview",value:"overview"}),t.push({label:n("model_detail.tabs.parameters"),icon:"i-lucide-settings",slot:"parameters",value:"parameters"},{label:n("model_detail.tabs.performance"),icon:"i-lucide-bar-chart-3",slot:"performance",value:"performance"}
238),l.value?.playground_types&&t.push({label:n("model_detail.tabs.playground"),icon:"i-lucide-flask-conical",slot:"playground",value:"playground"}),t});Fe(ne,t=>{t&&(E.value="overview")},{immediate:!0});const j=[{id:"llm",name:"LLM"},{id:"image",name:"Image"},{id:"video",name:"Video"},{id:"tts",name:"TTS"},{id:"stt",name:"STT"}],c={llm:[{key:"gpqa_score",label:"GPQA",tooltip:"Graduate-level science questions requiring expert knowledge.",group:"Reasoning"},{key:"arc_agi_v2_score",label:"ARC-AGI v2",tooltip:"Abstract reasoning problems.",group:"Reasoning"},{key:"hle_score",label:"HLE",tooltip:"Humanity's Last Exam — extremely hard expert questions.",group:"Reasoning"},{key:"mmmlu_score",label:"MMMLU",tooltip:"Massive Multi-discipline Multilingual Understanding.",group:"Reasoning"},{key:"aime_2025_score",label:"AIME 2025",tooltip:"Recent math competition problems.",group:"Math"},{key:"frontiermath_score",label:"FrontierMath",tooltip:"Frontier-level mathematics.",group:"Math"},{key:"swe_bench_verified_score",label:"SWE-Bench",tooltip:"Real GitHub issues requiring code changes.",group:"Code"},{key:"terminal_bench_score",label:"TerminalBench",tooltip:"Terminal-based coding tasks.",group:"Code"},{key:"osworld_score",label:"OSWorld",tooltip:"Computer-use tasks in real OS environments.",group:"Tools & Agents"},{key:"browsecomp_score",label:"BrowseComp",tooltip:"Web browsing comprehension tasks.",group:"Tools & Agents"},{key:"toolathlon_score",label:"ToolAthlon",tooltip:"Multi-tool agent benchmarks.",group:"Tools & Agents"},{key:"tau_bench_retail_score",label:"TauBench Retail",tooltip:"Tool-agent-user interaction in retail.",group:"Tools & Agents"},{key:"mcp_atlas_score",label:"MCP Atlas",tooltip:"Model Context Protocol tasks.",group:"Tools & Agents"},{key:"simpleqa_score",label:"SimpleQA",tooltip:"Short-form fact-seeking questions.",group:"Knowledge"},{key:"mmmu_score",label:"MMMU",tooltip:"Massive Multi-discipline Multimodal Understanding.",group:"Multimodal"},{key:"mmmu_pro_score",label:"MMMU Pro",tooltip:"Enhanced multimodal understanding.",group:"Multimodal"},{key:"charxiv_r_score",label:"Charxiv R",tooltip:"Chart understanding from arXiv papers.",group:"Multimodal"},{key:"screenspot_pro_score",label:"ScreenSpot Pro",tooltip:"Screen grounding for GUI agents.",group:"Multimodal"}],image:[{key:"text-to-image",label:"IMAGE GEN",tooltip:"Human preference score for text-to-image generation.",group:"Image"},{key:"image-to-image",label:"IMAGE EDIT",tooltip:"Human preference score for image editing and transformation.",group:"Image"}],video:[{key:"text-to-video",label:"Text to Video",tooltip:"Human preference score for text-to-video generation.",group:"Video"},{key:"image-to-video",label:"Image to Video",tooltip:"Human preference score for image-to-video generation.",group:"Video"},{key:"video-to-video",label:"Video to Video",tooltip:"Human preference score for video editing capabilities.",group:"Video"}],tts:[{key:"text-to-speech",label:"TTS",tooltip:"Human preference score for text-to-speech quality.",group:"Audio"}],stt:[{key:"speech-to-text",label:"STT",tooltip:"Human preference score for transcription accuracy.",group:"Audio"}]},x=w(()=>
238{if(!X.value)return[];const t=X.value.model_type||"llm";return c[t]||c.llm}),F=w(()=>{const t={};for(const s of x.value||[]){const k=s.group||"Other";t[k]||(t[k]=[]),t[k].push(s)}return Object.entries(t).map(([s,k])=>({name:s,cols:k}))}),$=t=>t==null?"-":Math.round(Number(t)*100).toLocaleString(),W=(t,s=!1)=>t==null?"-":s?(Number(t)*100).toFixed(1)+"%":Number(t).toLocaleString();kt({title:w(()=>l.value?.name?n("seo.model_detail.title_template",{name:l.value.display_name}):n("seo.model_detail.default_title")),meta:w(()=>l.value?.name?[{name:"description",content:l.value.description||""},{name:"keywords",content:`${l.value.display_name}${n("seo.model_detail.keywords_suffix")}`},{property:"og:title",content:n("seo.model_detail.og_title_template",{name:l.value.display_name})},{property:"og:description",content:l.value.description||""},{property:"og:type",content:"website"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:n("seo.model_detail.og_title_template",{name:l.value.display_name})},{name:"twitter:description",content:l.value.description||""}]:[])});const Q=t=>Kt(t,{currency:"$",freeLabel:n("model_detail.pricing.free"),naLabel:"N/A"}),ae=t=>t.pricing?.input_price||t.input_price||0,ge=t=>t.pricing?.output_price||t.output_price||0,me=t=>t.pricing?.cache_price||0,g=t=>t.pricing?.cache_create_price||0,u={perToken:"per-token",perRequest:"per-request",perSecond:"per-second",imageBaseRatio:"image-base-ratio",imageFixed:"image-fixed",videoBaseRatio:"video-base-ratio",videoFixed:"video-fixed",videoTokenTier:"video-token-tier"},re=t=>{const s=t.pricing?.pricing_mode||t.pricing_mode;return s||(t.pricing?.quota_type===0?u.perToken:(t.pricing?.unit||"").toLowerCase().includes("second")?u.perSecond:u.perRequest)},Ue=t=>{const s=re(t);return s!==u.perToken&&s!==u.perRequest},L=t=>!!t&&t.status!==1&&t.status!==2&&!qe.value&&Ue(t),fe=t=>{const k={[u.perToken]:"model_detail.pricing.modes.per_token",[u.perRequest]:"model_detail.pricing.modes.per_request",[u.perSecond]:"model_detail.pricing.modes.per_second",[u.imageBaseRatio]:"model_detail.pricing.modes.image_base_ratio",[u.imageFixed]:"model_detail.pricing.modes.image_fixed",[u.videoBaseRatio]:"model_detail.pricing.modes.video_base_ratio",[u.videoFixed]:"model_detail.pricing.modes.video_fixed",[u.videoTokenTier]:"model_detail.pricing.modes.video_token_tier"}[t]||"model_detail.pricing.modes.custom",R=n(k);return R===k?t:R},de=t=>Q(t),st=t=>t?t>=1e6?`${parseFloat((t/1e6).toFixed(2))} MP`:t>=1e3?`${Math.round(t/1e3)} KP`:`${t} px`:n("model_detail.pricing.no_limit"),ve=t=>typeof t=="number"&&Number.isFinite(t)&&t>0,ze=t=>ve(t)?`x ${parseFloat(Number(t).toFixed(4))}`:"-",Ae=(t,s)=>t.name||n("model_detail.pricing.tier_name",{index:s+1}),Oe=t=>t.max_pixels?n("model_detail.pricing.up_to_pixels",{pixels:st(t.max_pixels)}):n("model_detail.pricing.no_limit"),He=t=>{const s=re(t),k=t.media_pricing_config||{};if(s===u.perSecond)return`${de(ae(t))} ${t.pricing?.unit||n("model_detail.pricing.per_second")}`;if(s===u.imageBaseRatio)return`${de(k.base_price||ae(t))} ${n("model_detail.pricing.base_image")}`;if(s===u.imageFixed)return de(k.default_price||k.pixel_tiers?.find(R=>ve(R.price))?.price||ae(t));if(s===u.videoBaseRatio)return`${de(k.base_second_price||ae(t))} ${n("model_detail.pricing.base_second")}`;if(s===u.videoFixed){const R=k.default_second_price||k.default_price||k.pixel_tiers?.find(v=>ve(v.second_price)||ve(v.price))?.second_price||k.pixel_tiers?.find(v=>ve(v.price))?.price;return de(R||ae(t))}if(s===u.videoTokenTier){const R=k.video_token_tiers?.find(v=>ve(v.price_per_million_tokens))?.price_per_million_tokens;return`${de(R||ae(t))} ${n("model_detail.pricing.per_million_video_tokens")}`}return t.pricing?.media_price||de(ae(t))},Ke=t=>{const s=re(t);return s===u.perSecond?n("model_detail.pricing.per_second"):s===u.imageBaseRatio||s===u.imageFixed?n("model_detail.pricing.per_image"):s===u.videoBaseRatio?n("model_detail.pricing.per_video_second"):s===u.videoFixed?n("model_detail.pricing.per_video"):s===u.videoTokenTier?n("model_detail.pricing.per_million_video_tokens"):t.pricing?.unit||""},at=t=>{const s={[u.perSecond]:"model_detail.pricing.formulas.per_second",[u.imageBaseRatio]:"model_detail.pricing.formulas.image_base_ratio",[u.imageFixed]:"model_detail.pricing.formulas.image_fixed",[u.videoBaseRatio]:"model_detail.pricing.formulas.video_base_ratio",[u.videoFixed]:"model_detail.pricing.formulas.video_fixed",[u.videoTokenTier]:"model_detail.pricing.formulas.video_token_tier"};return n(s[t]||"model_detail.pricing.formulas.custom")},nt=t=>{const s=re(t),k=t.media_pricing_config||{},R=k.pixel_tiers||[],v=[];
238if(s===u.perSecond)return v.push({label:n("model_detail.pricing.rows.base_second_price"),value:de(ae(t)),detail:n("model_detail.pricing.rows.per_second_detail")}),v;if(s===u.videoTokenTier)return(k.video_token_tiers||[]).forEach((b,le)=>{const be=de(b.price_per_million_tokens),Me=de(b.video_input_price_per_million_tokens);v.push({label:Ae(b,le),value:`${be} / 1M tokens`,detail:`${Oe(b)} · ${n("model_detail.pricing.rows.without_video_input")}: ${be} / 1M · ${n("model_detail.pricing.rows.with_video_input")}: ${Me} / 1M`,tone:"tier"})}),v;if(s===u.imageBaseRatio||s===u.videoBaseRatio){const b=s===u.imageBaseRatio?k.base_price:k.base_second_price;return v.push({label:s===u.imageBaseRatio?n("model_detail.pricing.rows.base_image_price"):n("model_detail.pricing.rows.base_second_price"),value:de(b||ae(t)),detail:s===u.imageBaseRatio?n("model_detail.pricing.rows.base_image_detail"):n("model_detail.pricing.rows.base_video_detail")}),ve(k.default_ratio)&&v.push({label:n("model_detail.pricing.rows.default_ratio"),value:ze(k.default_ratio),detail:n("model_detail.pricing.rows.fallback_detail")}),R.forEach((le,be)=>{const Me=ve(b)&&ve(le.ratio)?Number(b)*Number(le.ratio):null;v.push({label:Ae(le,be),value:ze(le.ratio),detail:`${Oe(le)}${Me?` · ${de(Me)} ${s===u.imageBaseRatio?n("model_detail.pricing.per_image"):n("model_detail.pricing.per_second")}`:""}`,tone:"tier"})}),v}return s===u.imageFixed||s===u.videoFixed?(ve(k.default_price)&&v.push({label:n("model_detail.pricing.rows.default_price"),value:de(k.default_price),detail:n("model_detail.pricing.rows.fallback_detail")}),ve(k.default_second_price)&&v.push({label:n("model_detail.pricing.rows.default_second_price"),value:de(k.default_second_price),detail:n("model_detail.pricing.rows.fallback_detail")}),R.forEach((b,le)=>{const be=ve(b.second_price);v.push({label:Ae(b,le),value:de(be?b.second_price:b.price),detail:`${Oe(b)} · ${n(be?"model_detail.pricing.per_second":"model_detail.pricing.per_image")}`,tone:"tier"})}),v):(v.push({label:n("model_detail.pricing.rows.price"),value:t.pricing?.media_price||de(ae(t)),detail:t.pricing?.unit||""}),v)},qe=w(()=>{if(!l.value)return!1;const t=l.value.pricing;return t?t.input_price==="0"||t.input_price==="0.0"||t.input_price==="Free"||Number(t.input_price)===0:l.value.input_price===0}),it=(t,s)=>s&&(Ze(t)?.svg||s.toLowerCase())||"openai",Je=(t,s)=>n(s==="reasoning"?`model_detail.levels.${["none","lowest","lower","medium","higher","highest"][t]||"none"}`:s==="speed"?`model_detail.levels.${["none","slowest","slow","medium","fast","fastest"][t]||"none"}`:"model_detail.levels.none"),Ee=t=>Array.from({length:Math.max(0,Math.min(5,t))},(s,k)=>k),Le=t=>t?t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?Math.round(t/1e3)+"K":t.toString():"0",rt=async t=>{try{await navigator.clipboard.writeText(String(t)),De()}catch{const s=document.createElement("textarea");s.value=String(t),s.style.cssText="position:fixed;top:0;left:0",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s),De()}},Be=f(!1),De=()=>{Be.value=!0,setTimeout(()=>{Be.value=!1},2e3);const t=new CustomEvent("model-id-copied");window.dispatchEvent(t)},dt=f({}),Pe={},Ie=t=>{if(!X.value)return[];const s=X.value.id,k=X.value[t],R=[];if(_.value&&_.value.length>0)for(const v of _.value){let b=v[t];t==="code-arena"&&!b&&v.dataviz!==void 0&&(b=(v.dataviz+(v["p5-animation"]||0)+(v["text-to-game"]||0)+(v["text-to-svg"]||0)+(v["text-to-website"]||0)+(v.threejs||0)+(v.tonejs||0))/7),b!=null&&b>0&&R.push({model:v,score:b,isCurrent:v.id===s})}if(R.length===0&&oe.value){if(oe.value.top3?.forEach((v,b)=>{const le=v[t];le!=null&&R.push({model:v,score:le,isCurrent:v.id===s,rank:b+1})}),oe.value.prev){const v=oe.value.prev[t];v!=null&&!R.find(b=>b.model.id===oe.value.prev?.id)&&R.push({model:oe.value.prev,score:v,isCurrent:!1})}if(oe.value.next){const v=oe.value.next[t];v!=null&&!R.find(b=>b.model.id===oe.value.next?.id)&&R.push({model:oe.value.next,score:v,isCurrent:!1})}}return k!=null&&!R.find(v=>v.model.id===s)&&R.push({model:{...X.value,display_name:l.value?.display_name||X.value.name},score:k,isCurrent:!0}),R.sort((v,b)=>b.score-v.score),R.forEach((v,b)=>{v.rank=b+1}),R},Re=t=>Ie(t).slice(0,5),ut=t=>{const s=Ie(t),k=s.findIndex(b=>b.isCurrent);if(k===-1)return[];const R=Math.max(0,k-2),v=Math.min(s.length,k+3);return s.slice(R,v)},ct=(t,s)=>{const k=Ie(t);if(!k.length)return 0;const R=Math.max(...k.map(v=>v.score));if(R===0)return 0;if(!t.includes("_score")){const v=Math.min(...k.map(le=>le.score)),b=R-v;return b===0?100:Math.round((s-v)/b*60+40)}return Math.min(s*100,100)},mt=t=>{const s=dt.value[t];if(!s)return;const k=s.getContext("2d");if(!k)return;Pe[t]&&Pe[t]?.destroy();const R=Re(t);if(R.length===0)return;const v=t.includes("arena");Pe[t]=new Qe(k,{type:"bar",data:{labels:R.map(b=>b.model.display_name||b.model.name||"Unknown"),datasets:[{data:R.map(b=>b.score),backgroundColor:R.map(b=>
238b.isCurrent?"rgba(59, 130, 246, 0.6)":"rgba(148, 163, 184, 0.3)"),borderColor:R.map(b=>b.isCurrent?"rgba(59, 130, 246, 1)":"rgba(148, 163, 184, 0.5)"),borderWidth:1,borderRadius:4}]},options:{indexAxis:"y",responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:b=>{const le=b.parsed.x;return le==null?"":v?Math.round(le*100).toLocaleString():(le*100).toFixed(1)+"%"}}}},scales:{x:{beginAtZero:!0,grid:{color:"rgba(0,0,0,0.05)"},ticks:{callback:b=>v?Math.round(Number(b)*100).toString():(Number(b)*100).toFixed(0)+"%"}},y:{grid:{display:!1},ticks:{font:{size:11}}}}}})},Ge=()=>{x.value&&x.value.forEach(t=>{mt(t.key)})};Fe(E,t=>{t==="performance"&&We(()=>Ge())}),tt(()=>{E.value==="performance"&&We(()=>Ge()),window.addEventListener("scroll",N,{passive:!0})}),Ct(()=>{Object.values(Pe).forEach(t=>t?.destroy()),window.removeEventListener("scroll",N)});const Ne=f(!1);function pt(){Ne.value=!0}function gt(t){if(!l.value)return;const s=l.value.name||String(l.value.id||"");Ne.value=!1,Pt(h(`/models/compare/${s}-vs-${t}`))}return(t,s)=>{const k=jt("router-link"),R=Mt,v=Vt,b=St,le=Se,be=lt,Me=Ot,vt=Bt;return a(),i("div",Us,[M(m)?(a(),i("div",As,[...s[5]||(s[5]=[e("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"},null,-1)])])):M(O)?(a(),i("div",Os,[e("h1",Bs,o(M(O)),1),e("p",Is,o(t.$t("model_detail.not_found_desc")),1),r(k,{to:"/models",class:"px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700"},{default:ye(()=>[Y(o(t.$t("model_detail.browse_all")),1)]),_:1})])):p.value?(a(),i("main",Rs,[e("div",Fs,[e("div",zs,[e("div",Hs,[e("div",Ks,[l.value.provider?(a(),pe(D,{key:0,name:`${l.value.provider.toLowerCase()}`},null,8,["name"])):(a(),i("div",qs,o((l.value.provider||l.value.display_name||"AI").slice(0,1).toUpperCase()),1))])]),e("div",Js,[e("div",Es,[e("h1",Ls,o(l.value.display_name||l.value.name),1),e("div",{onClick:s[0]||(s[0]=q=>rt(l.value.name)),class:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-gray-100 hover:bg-gray-200 transition-colors cursor-pointer group relative select-none",title:t.$t("model_detail.copy_id")},[e("span",Gs,o(l.value.name),1),Be.value?(a(),i("svg",Ws,[...s[7]||(s[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):(a(),i("svg",Ys,[...s[6]||(s[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"},null,-1)])]))],8,Ds),e("button",{type:"button",onClick:pt,class:"flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-blue-50 hover:bg-blue-100 text-blue-700 text-xs font-medium transition-colors",title:t.$t("model_detail.compare_with_others")},[s[8]||(s[8]=e("i",{class:"pi pi-arrows-left-right text-[10px]"},null,-1)),Y(" "+o(t.$t("model_detail.compare")),1)],8,Qs)]),e("div",Xs,o(l.value.description),1)])]),e("div",Zs,o(l.value.description),1)]),e("div",ea,[l.value.reasoning_level?(a(),i("div",ta,[e("div",oa,o(l.value.reasoning_tokens?t.$t("model_detail.metrics.reasoning"):t.$t("model_detail.metrics.intelligence")),1),e("div",la,[e("div",sa,[(a(!0),i(Z,null,ue(Ee(l.value.reasoning_level),q=>(a(),pe(D,{name:l.value.reasoning_tokens?"reasoning":"dot",key:`reasoning-${q}`,class:"w-5 h-5 text-slate-700"},null,8,["name"]))),128))])]),e("div",aa,o(Je(l.value.reasoning_level,"reasoning")),1)])):B("",!0),l.value.reasoning_level&&l.value.speed_level?(a(),i("div",na)):B("",!0),l.value.speed_level?(a(),i("div",ia,[e("div",ra,o(t.$t("model_detail.metrics.speed")),1),e("div",da,[e("div",ua,[(a(!0),i(Z,null,ue(Ee(l.value.speed_level),q=>(a(),pe(D,{name:"speed",key:`speed-${q}`,class:"w-5 h-5 text-slate-700"}))),128))])]),e("div",ca,o(Je(l.value.speed_level,"speed")),1)])):B("",!0),l.value.reasoning_level||l.value.speed_level?(a(),i("div",ma)):B("",!0),e("div",pa,[e("div",ga,o(t.$t("model_detail.metrics.price")),1),e("div",va,[e("div",_a,[l.value.status===1?(a(),i("span",xa,o(t.$t("model_detail.status.coming_soon")),1)):l.value.status===2?(a(),i("span",ya,o(t.$t("model_detail.status.delisted")),1)):L(l.value)?(a(),i("div",fa,[e("span",null,o(He(l.value)),1),e("span",ba,o(fe(re(l.value))),1)])):l.value.pricing?.quota_type===1?(a(),i(Z,{key:3},[Y(o(Q(ae(l.value))),1)],64)):(a(),i(Z,{key:4},[Y(o(Q(ae(l.value)))+" • "+o(Q(ge(l.value))),1)],64))])]),e("div",ha,[l.value.status===1||l.value.status===2?(a(),i(Z,{key:0},[Y(" - ")],64)):(a(),i(Z,{key:1},[Y(o(L(l.value)?Ke(l.value):l.value.pricing?.quota_type===1?l.value.unit||l.value.pricing?.unit||t.$t("model_detail.pricing.per_request"):`${t.$t("model_detail.metrics.input")} • ${t.$t("model_detail.metrics.output")}`),1)],64))])]),l.value.status!==1&&l.value.status!==2?(a(),i(Z,{key:4},[Q(me(l.value))!=="N/A"&&Q(me(l.value))!==M(n)("model_detail.pricing.free")?(a(),i("div",$a)):B("",!0),Q(me(l.value))!=="N/A"&&Q(me(l.value))!==M(n)("model_detail.pricing.free")?(a(),i("div",wa,[e("div",ka,o(t.$t("model_detail.metrics.cache_price")),1),e("div",Ca,[e("div",ja,o(Q(me(l.value)))+" • "+o(Q(g(l.value))),1)]),e("div",Ma,o(t.$t("model_detail.metrics.cache_read"))+" • "+o(t.$t("model_detail.metrics.cache_write")),1)])):B("",!0)],64)):B("",!0),s[9]||(s[9]=e("div",{class:"hidden h-12 w-px bg-gray-200 lg:block"},null,-1)),e("div",Va,[e("div",Sa,o(t.$t("model_detail.metrics.input")),1),e("div",Ta,[l.value.support_text?(a(),i("div",Pa,[r(D,{name:"text",class:"w-5 h-5 text-slate-700"})])):B("",!0),l.value.support_image?(a(),i("div",Na,[r(D,{name:"image",class:"w-5 h-5 text-slate-700"})])):(a(),i("div",Ua,[r(D,{name:"image",class:"w-5 h-5"})])),l.value.support_audio?(a(),i("div",Aa,[r(D,{name:"audio",class:"w-5 h-5 text-slate-700"}
238)])):(a(),i("div",Oa,[r(D,{name:"audio",class:"w-5 h-5"})])),l.value.support_video?(a(),i("div",Ba,[r(D,{name:"video",class:"w-5 h-5 text-slate-700"})])):(a(),i("div",Ia,[r(D,{name:"video",class:"w-5 h-5"})]))]),e("div",Ra,o([l.value.support_text?t.$t("model_detail.modalities.text"):null,l.value.support_image?t.$t("model_detail.modalities.image"):null,l.value.support_audio?t.$t("model_detail.modalities.audio"):null,l.value.support_video?t.$t("model_detail.modalities.video"):null].filter(Boolean).join(", ")||t.$t("model_detail.levels.none")),1)]),s[10]||(s[10]=e("div",{class:"hidden h-12 w-px bg-gray-200 lg:block"},null,-1)),e("div",Fa,[e("div",za,o(t.$t("model_detail.metrics.output")),1),e("div",Ha,[l.value.modality_text?(a(),i("div",Ka,[r(D,{name:"text",class:"w-5 h-5 text-slate-700"})])):(a(),i("div",qa,[r(D,{name:"text",class:"w-5 h-5"})])),l.value.modality_image?(a(),i("div",Ja,[r(D,{name:"image",class:"w-5 h-5 text-slate-700"})])):(a(),i("div",Ea,[r(D,{name:"image",class:"w-5 h-5"})])),l.value.modality_audio?(a(),i("div",La,[r(D,{name:"audio",class:"w-5 h-5 text-slate-700"})])):(a(),i("div",Da,[r(D,{name:"audio",class:"w-5 h-5"})])),l.value.modality_video?(a(),i("div",Ga,[r(D,{name:"video",class:"w-5 h-5 text-slate-700"})])):(a(),i("div",Ya,[r(D,{name:"video",class:"w-5 h-5"})]))]),e("div",Wa,o([l.value.modality_text?t.$t("model_detail.modalities.text"):null,l.value.modality_image?t.$t("model_detail.modalities.image"):null,l.value.modality_audio?t.$t("model_detail.modalities.audio"):null,l.value.modality_video?t.$t("model_detail.modalities.video"):null].filter(Boolean).join(", ")||t.$t("model_detail.levels.none")),1)])]),U.value?(a(),i("section",Qa,[r(R,null,{default:ye(()=>[r(zt,{"model-id":String(l.value.id||G.value),"model-name":l.value.name||G.value,"model-status":l.value.status,"availability-hidden":!!l.value.availability_hidden},null,8,["model-id","model-name","model-status","availability-hidden"])]),_:1})])):B("",!0),L(l.value)?(a(),i("section",Xa,[e("div",Za,[e("div",en,[e("div",tn,[r(v,{name:"lucide:receipt-text",class:"h-4 w-4 text-slate-500"}),e("h2",on,o(t.$t("model_detail.pricing.detail_title")),1)]),e("p",ln,o(at(re(l.value))),1)]),B("",!0)]),e("div",sn,[e("div",an,[(a(!0),i(Z,null,ue(nt(l.value),(q,te)=>(a(),i("div",{key:`${q.label}-${te}`,class:"grid grid-cols-[minmax(180px,1fr)_minmax(120px,0.55fr)_minmax(260px,1.25fr)] items-center gap-4 px-4 py-3 text-sm transition-colors hover:bg-gray-50 sm:px-5"},[e("div",nn,[e("span",rn,o(String(te+1).padStart(2,"0")),1),e("span",dn,o(q.label),1)]),e("div",un,o(q.value),1),e("div",cn,o(q.detail),1)]))),128))])])])):B("",!0),s[27]||(s[27]=e("div",{class:"h-px w-full bg-gray-200"},null,-1)),e("div",mn,[s[13]||(s[13]=e("div",{class:"absolute inset-0 opacity-20"},[e("div",{class:"absolute -top-20 -right-20 w-64 h-64 bg-indigo-500 rounded-full blur-3xl"}),e("div",{class:"absolute bottom-[-10%] -left-10 w-40 h-40 bg-blue-500 rounded-full blur-3xl"})],-1)),e("div",pn,[e("div",gn,[e("div",vn,[s[11]||(s[11]=e("div",{class:"p-1.5 bg-white/10 rounded-lg shrink-0"},[e("svg",{class:"w-5 h-5 text-indigo-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})])],-1)),e("h3",_n,o(t.$t("model_detail.cta.inline_title",{name:l.value.display_name||l.value.name})),1)]),e("p",xn,o(t.$t("model_detail.cta.inline_subtitle")),1)]),e("div",yn,[e("button",{onClick:s[1]||(s[1]=q=>M(P).login(t.$localePath("/hall/tokens"))),class:"cursor-pointer px-6 py-2.5 bg-indigo-500 text-white font-semibold text-sm rounded-xl hover:bg-indigo-600 transition-all duration-200 shadow-md hover:shadow-indigo-500/25 active:scale-95 border border-indigo-400/50"},o(t.$t("model_detail.cta.start_free")),1),r(b,{to:M(h)("/pricing"),class:"text-slate-300 hover:text-white text-sm font-medium transition-colors flex items-center gap-1.5 px-3 py-2.5 rounded-xl hover:bg-white/5"},{default:ye(()=>[Y(o(t.$t("model_detail.cta.view_pricing"))+" ",1),s[12]||(s[12]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))]),_:1},8,["to"])])])]),e("div",null,[e("div",fn,[(a(!0),i(Z,null,ue(z.value,q=>(a(),i("button",{key:q.value,onClick:te=>E.value=q.value,class:ee(["flex items-center gap-2 pb-3 px-1 text-sm font-medium transition-colors relative",E.value===q.value?"text-blue-600 border-b-2 border-blue-600":"text-gray-500 hover:text-gray-800 border-b-2 border-transparent"])},[r(le,{name:q.icon,class:"w-4 h-4"},null,8,["name"]),Y(" "+o(q.label),1)],10,bn))),128))]),we(e("div",hn,[e("div",$n,[e("div",wn,[r(be,{value:ne.value?.content||""},null,8,["value"])])])],512),[[Ve,E.value==="overview"]]),we(e("div",kn,[e("div",Cn,[e("div",jn,[e("h2",Mn,o(t.$t("model_detail.sections.specifications")||"Specifications"),1),e("div",Vn,[l.value.context_window||l.value.context_length?(a(),i("div",Sn,[e("span",Tn,o(t.$t("model_detail.metrics.context_window")),1),e("div",Pn,[r(D,{name:"text",class:"w-4 h-4 text-slate-500"}),e("span",Nn,o(Le(l.value.context_window||l.value.context_length)),1)])])):B("",!0),l.value.max_output_tokens?(a(),i("div",Un,[e("span",An,o(t.$t("model_detail.metrics.max_output_tokens")),1),e("div",On,[r(D,{name:"text",class:"w-4 h-4 text-slate-500"}),e("span",Bn,o(Le(l.value.max_output_tokens)),1)])])):B("",!0),X.value?.announcement_date?(a(),i("div",In,[e("span",Rn,o(t.$t("model_detail.metrics.announced_date")),1),e("div",Fn,[r(
238D,{name:"date",class:"w-4 h-4 text-slate-500"}),e("span",zn,o(X.value.announcement_date),1)])])):B("",!0),X.value?.release_date?(a(),i("div",Hn,[e("span",Kn,o(t.$t("model_detail.metrics.released_date")),1),e("div",qn,[r(D,{name:"date",class:"w-4 h-4 text-slate-500"}),e("span",Jn,o(X.value.release_date),1)])])):B("",!0),X.value?.knowledge_cutoff||l.value.knowledge_cutoff?(a(),i("div",En,[e("span",Ln,o(t.$t("model_detail.metrics.knowledge_cutoff")),1),e("div",Dn,[r(D,{name:"date",class:"w-4 h-4 text-slate-500"}),e("span",Gn,o(X.value?.knowledge_cutoff||l.value.knowledge_cutoff),1)])])):B("",!0),l.value.reasoning_tokens?(a(),i("div",Yn,[e("span",Wn,o(t.$t("model_detail.metrics.reasoning_token_support")),1),e("div",Qn,[r(D,{name:"reasoning",class:"w-4 h-4 text-slate-500"}),s[14]||(s[14]=e("span",{class:"font-medium text-green-600"},"✓",-1))])])):B("",!0)])]),e("div",Xn,[e("h2",Zn,o(t.$t("model_detail.sections.modalities")),1),e("div",ei,[e("div",ti,[e("div",oi,[e("div",li,[e("div",{class:ee(["flex h-8 w-8 flex-row items-center justify-center gap-2 rounded-lg p-1",l.value.modality_text||l.value.support_text?"bg-gray-100":"text-gray-400"])},[r(D,{name:"text",class:"w-5 h-5"})],2)]),e("div",si,[e("h3",{class:ee(["text-sm font-semibold",l.value.modality_text||l.value.support_text?"":"text-gray-400"])},o(t.$t("model_detail.modalities.text")),3),e("div",ai,o(l.value.support_text&&l.value.modality_text?t.$t("model_detail.modalities.input_output"):l.value.support_text?t.$t("model_detail.modalities.input_only"):l.value.modality_text?t.$t("model_detail.modalities.output_only"):t.$t("model_detail.modalities.not_supported")),1)])]),e("div",ni,[e("div",ii,[e("div",{class:ee(["flex h-8 w-8 flex-row items-center justify-center gap-2 rounded-lg p-1",l.value.modality_image||l.value.support_image?"bg-gray-100":"text-gray-400"])},[r(D,{name:"image",class:"w-5 h-5"})],2)]),e("div",ri,[e("h3",{class:ee(["text-sm font-semibold",l.value.modality_image||l.value.support_image?"":"text-gray-400"])},o(t.$t("model_detail.modalities.image")),3),e("div",di,o(l.value.support_image&&l.value.modality_image?t.$t("model_detail.modalities.input_output"):l.value.support_image?t.$t("model_detail.modalities.input_only"):l.value.modality_image?t.$t("model_detail.modalities.output_only"):t.$t("model_detail.modalities.not_supported")),1)])]),e("div",ui,[e("div",ci,[e("div",{class:ee(["flex h-8 w-8 flex-row items-center justify-center gap-2 rounded-lg p-1",l.value.modality_audio||l.value.support_audio?"bg-gray-100":"text-gray-400"])},[r(D,{name:"audio",class:"w-5 h-5"})],2)]),e("div",mi,[e("h3",{class:ee(["text-sm font-semibold",l.value.modality_audio||l.value.support_audio?"":"text-gray-400"])},o(t.$t("model_detail.modalities.audio")),3),e("div",pi,o(l.value.support_audio&&l.value.modality_audio?t.$t("model_detail.modalities.input_output"):l.value.support_audio?t.$t("model_detail.modalities.input_only"):l.value.modality_audio?t.$t("model_detail.modalities.output_only"):t.$t("model_detail.modalities.not_supported")),1)])]),e("div",gi,[e("div",vi,[e("div",{class:ee(["flex h-8 w-8 flex-row items-center justify-center gap-2 rounded-lg p-1",l.value.modality_video||l.value.support_video?"bg-gray-100":"text-gray-400"])},[r(D,{name:"video",class:"w-5 h-5"})],2)]),e("div",_i,[e("h3",{class:ee(["text-sm font-semibold",l.value.modality_video||l.value.support_video?"":"text-gray-400"])},o(t.$t("model_detail.modalities.video")),3),e("div",xi,o(l.value.support_video&&l.value.modality_video?t.$t("model_detail.modalities.input_output"):l.value.support_video?t.$t("model_detail.modalities.input_only"):l.value.modality_video?t.$t("model_detail.modalities.output_only"):t.$t("model_detail.modalities.not_supported")),1)])])])])]),s[16]||(s[16]=e("div",{class:"h-px w-full bg-gray-200"},null,-1)),e("div",yi,[e("h2",fi,o(t.$t("model_detail.sections.endpoints")),1),e("div",bi,[(a(!0),i(Z,null,ue(M(Rt),q=>(a(),i("div",{key:q.id,class:"rounded-xl border border-gray-200 overflow-hidden"},[e("div",hi,[r(D,{class:"size-4",name:`${q.logo.toLowerCase()}`},null,8,["name"]),e("span",$i,o(q.name),1)]),e("div",{class:ee(["grid gap-px bg-gray-100",q.endpoints.length===1?"grid-cols-1":"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"])},[(a(!0),i(Z,null,ue(q.endpoints,te=>(a(),i("div",{key:te.key,class:ee(["flex items-center gap-3 px-4 py-3 bg-white",l.value[te.key]?"":"opacity-40"])},[e("div",{class:ee(["w-2 h-2 rounded-full shrink-0",l.value[te.key]?q.color:"bg-gray-300"])},null,2),e("div",wi,[e("div",ki,o(te.name),1),e("div",Ci,o(te.path),1)]),te.docsUrl?(a(),i("a",{key:0,href:te.docsUrl,target:"_blank",rel:"noopener",class:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",title:"View Documentation"},[...s[15]||(s[15]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],8,ji)):B("",!0)],2))),128))],2)]))),128))])])])],512),[[Ve,E.value==="parameters"]]),we(e("div",Mi,[e("div",Vi,[e("div",Si,[e("h2",Ti,o(t.$t("model_detail.performance_rankings")),1),r(b,{to:"/rank",class:"text-sm text-blue-600 hover:text-blue-700 flex items-center gap-1"},{default:ye(()=>[Y(o(t.$t("model_detail.view_leaderboard"))+" ",1),s[17]||(s[17]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))]),_:1})]),!X.value||!x.value?.length?(a(),i("div",Pi,[s[18]||(s[18]=e("svg",{class:"w-12 h-12 mx-auto mb-4 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})],-1)),e("p",null,o(t.$t("model_detail.no_benchmark_data")),1)])):(a(),i("div",Ni,[(a(!0),i(Z,null,ue(F.value,q=>(a(),i("div",{key:q.name},[e("div",Ui,[e("h3",Ai,o(q.name),1),s[19]||(s[19]=e("div",{class:"flex-1 h-px bg-slate-200"},null,-1))]),e("div",Oi,[(a(!0),i(Z,null,ue(q.cols,te=>(a(),i(Z,{key:te.key},[Re(te.key).length>0?(a(),i("div",Bi,[e("div",Ii,[e("div",Ri,[e("h3",Fi,o(te.label),1),r(Me,{text:te.tooltip},{default:ye(()=>[...s[20]||(s[20]=[e("svg",{class:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])]),_:1},8,["text"])])]),e("div",zi,[e("div",Hi,[(a(!0),i(Z,null,ue(Re(te.key),J=>(a(),i("div",{key:`bar-${J.model.id}`,class:"relative h-8"},[e("div",Ki,[e("div",{class:ee(["h-full rounded-lg transition-all duration-300",J.isCurrent?"bg-blue-500":"bg-gray-300"]),style:Ut({width:`${ct(te.key,J.score)}%`})},null,6)]),e("div",qi,[e("div",Ji,[r(D,{name:it(J.model.id,J.model.organization||J.model.provider),class:"w-4 h-4 shrink-0"},null,8,["name"]),e("span",{class:ee(["text-xs font-medium truncate",J.isCurrent?"text-white":"text-gray-700"])},o(J.model.name?.split("/").pop()||J.model.name||J.model.id),3)]),e("div",{class:ee(["text-xs font-mono font-semibold shrink-0 px-1.5 py-0.5 rounded","text-gray-600 bg-slate-50"])}
238,o(te.key.includes("_score")?W(J.score,!0):$(J.score)),1)])]))),128))])]),e("div",Ei,[(a(!0),i(Z,null,ue(ut(te.key),(J,_t)=>(a(),i("div",{key:J.model.id,class:ee(["flex items-center gap-3 px-4 py-2 text-sm",J.isCurrent?"bg-blue-50 border-l-2 border-blue-500":_t%2===0?"bg-white":"bg-gray-50/50"])},[e("div",Li,[J.rank===1?(a(),i("span",Di,"🥇")):J.rank===2?(a(),i("span",Gi,"🥈")):J.rank===3?(a(),i("span",Yi,"🥉")):(a(),i("span",Wi,o(J.rank),1))]),e("div",Qi,[r(D,{name:M(Ze)(J.model.name)?.svg||J.model.organization?.toLowerCase(),class:"w-4 h-4 shrink-0"},null,8,["name"]),e("span",{class:ee(["truncate",J.isCurrent?"font-semibold text-blue-700":"text-gray-700"])},o(J.model.display_name||J.model.name),3),J.isCurrent?(a(),i("span",Xi,o(t.$t("model_detail.this_model")),1)):B("",!0)]),e("div",Zi,o(te.key.includes("_score")?W(J.score,!0):$(J.score)),1)],2))),128))])])):B("",!0)],64))),128))])]))),128))])),e("div",er,[e("h2",tr,o(t.$t("rank.definitions_title")||"Metric Definitions"),1),e("div",or,[(a(),i(Z,null,ue(c,(q,te)=>e("div",{key:te},[e("h3",lr,o(j.find(J=>J.id===te)?.name||te),1),e("dl",sr,[(a(!0),i(Z,null,ue(q,J=>(a(),i("div",{key:J.key,class:"flex flex-col sm:flex-row sm:gap-4 py-2 border-b border-slate-100 last:border-0"},[e("dt",ar,o(J.label),1),e("dd",nr,o(J.tooltip),1)]))),128))])])),64))])])])],512),[[Ve,E.value==="performance"]]),we(e("div",ir,[r(R,null,{default:ye(()=>[r(Ns,{model:l.value,"model-name":G.value},null,8,["model","model-name"])]),_:1})],512),[[Ve,E.value==="playground"]])]),e("div",rr,[s[26]||(s[26]=e("div",{class:"absolute inset-0 opacity-20"},[e("div",{class:"absolute top-1/3 left-1/3 w-64 h-64 bg-slate-600 rounded-full blur-3xl"}),e("div",{class:"absolute bottom-1/3 right-1/3 w-48 h-48 bg-slate-700 rounded-full blur-3xl"})],-1)),e("div",dr,[e("h2",ur,o(t.$t("model_detail.cta.bottom_title",{name:l.value.display_name||l.value.name})),1),e("p",cr,o(t.$t("model_detail.cta.bottom_subtitle",{name:l.value.display_name||l.value.name})),1),e("div",mr,[e("div",pr,[s[21]||(s[21]=e("div",{class:"mb-2 p-2 bg-indigo-500/20 rounded-lg text-indigo-400"},[e("svg",{class:"w-5 h-5 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})])],-1)),e("span",gr,o(t.$t("model_detail.cta.benefit_free_credits")),1)]),e("div",vr,[s[22]||(s[22]=e("div",{class:"mb-2 p-2 bg-emerald-500/20 rounded-lg text-emerald-400"},[e("svg",{class:"w-5 h-5 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})])],-1)),e("span",_r,o(t.$t("model_detail.cta.benefit_no_commitment")),1)]),e("div",xr,[s[23]||(s[23]=e("div",{class:"mb-2 p-2 bg-blue-500/20 rounded-lg text-blue-400"},[e("svg",{class:"w-5 h-5 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})])],-1)),e("span",yr,o(t.$t("model_detail.cta.benefit_openai_compatible")),1)]),e("div",fr,[s[24]||(s[24]=e("div",{class:"mb-2 p-2 bg-purple-500/20 rounded-lg text-purple-400"},[e("svg",{class:"w-5 h-5 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})])],-1)),e("span",br,o(t.$t("model_detail.cta.benefit_transparent_billing")),1)])]),e("div",hr,[e("button",{onClick:s[2]||(s[2]=q=>M(P).login(t.$localePath("/hall/tokens"))),class:"cursor-pointer px-8 py-3 bg-indigo-500 text-white font-bold text-base rounded-xl hover:bg-indigo-600 transition-all duration-200 shadow-lg hover:shadow-indigo-500/25 active:scale-95 border border-indigo-400/50"},o(t.$t("model_detail.cta.start_free")),1),r(b,{to:M(h)("/pricing"),class:"text-slate-300 hover:text-white text-sm font-medium transition-colors flex items-center gap-1.5 px-4 py-3 rounded-xl hover:bg-white/5"},{default:ye(()=>
238[Y(o(t.$t("model_detail.cta.view_pricing"))+" ",1),s[25]||(s[25]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))]),_:1},8,["to"])])])]),s[28]||(s[28]=e("div",{class:"h-px w-full bg-gray-200"},null,-1)),r(Ft)])):B("",!0),r(Tt,{"enter-active-class":"transition duration-300 ease-out","enter-from-class":"transform translate-y-full opacity-0","enter-to-class":"transform translate-y-0 opacity-100","leave-active-class":"transition duration-200 ease-in","leave-from-class":"transform translate-y-0 opacity-100","leave-to-class":"transform translate-y-full opacity-0"},{default:ye(()=>[K.value&&A.value?(a(),i("div",$r,[e("div",wr,[e("div",kr,[e("div",Cr,[l.value.provider?(a(),pe(D,{key:0,name:`${l.value.provider.toLowerCase()}`},null,8,["name"])):B("",!0)]),e("div",jr,[e("div",Mr,o(t.$t("model_detail.cta.sticky_use_model",{name:l.value.display_name||l.value.name})),1),e("div",Vr,[l.value.status===1?(a(),i("span",Sr,o(t.$t("model_detail.status.coming_soon")),1)):l.value.status===2?(a(),i("span",Tr,o(t.$t("model_detail.status.delisted")),1)):qe.value?(a(),i("span",Pr,"Free")):L(l.value)?(a(),i("span",Nr,[e("b",null,o(He(l.value)),1),Y(" "+o(Ke(l.value)),1)])):l.value.pricing?.quota_type===1?(a(),i("span",Ur,[e("b",null,o(Q(l.value.pricing?.input_price)),1),Y(" "+o(l.value.pricing?.unit||"/req"),1)])):(a(),i(Z,{key:5},[s[29]||(s[29]=Y(" Input: ",-1)),e("b",null,o(Q(ae(l.value))),1),Y(" "+o(l.value.pricing?.unit||"/ 1M")+" ",1),s[30]||(s[30]=e("span",{class:"mx-1"},"·",-1)),s[31]||(s[31]=Y(" Output: ",-1)),e("b",null,o(Q(ge(l.value))),1),Y(" "+o(l.value.pricing?.unit||"/ 1M"),1)],64))])])]),e("div",Ar,[I.value?(a(),pe(b,{key:0,to:M(h)(S.value),class:"cursor-pointer px-4 py-2 bg-emerald-600 text-white font-semibold text-sm rounded-lg hover:bg-emerald-700 transition-all duration-200 active:scale-95 border-none hidden sm:flex items-center gap-1.5 no-underline"},{default:ye(()=>[s[32]||(s[32]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Y(" "+o(t.$t("model_detail.cta.sticky_try_studio")),1)]),_:1},8,["to"])):B("",!0),r(b,{to:M(h)("/hall/tokens"),class:"cursor-pointer px-4 py-2 bg-blue-600 text-white font-semibold text-sm rounded-lg hover:bg-blue-700 transition-all duration-200 active:scale-95 border-none flex items-center gap-1.5 no-underline"},{default:ye(()=>[s[33]||(s[33]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),Y(" "+o(t.$t("model_detail.cta.sticky_get_key")),1)]),_:1},8,["to"]),e("button",{onClick:s[3]||(s[3]=q=>K.value=!1),class:"cursor-pointer p-1.5 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-100 transition-colors border-none bg-transparent"},[...s[34]||(s[34]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])])])):B("",!0)]),_:1}),r(vt,{modelValue:Ne.value,"onUpdate:modelValue":s[4]||(s[4]=q=>Ne.value=q),"source-name":l.value?.name,"source-display-name":l.value?.display_name||l.value?.name,onSelect:gt},null,8,["modelValue","source-name","source-display-name"])])}}}),yd=ot(Or,[["__scopeId","data-v-755d41f8"]]);export{yd as default};

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.