PageSourceSearch

https://starrycbz-newapi.hf.space/static/js/async/4250.cf4b13a1bf.js

js starrycbz-newapi.hf.space collected 2026-10-04 17:26:56 UTC 76,580 bytes, 185 lines download raw bytes

1"use strict";(self.rspackChunknewapi_web=self.rspackChunknewapi_web||[]).push([[4250],{92170(e,t,n){n.d(t,{i:()=>m});var r=n(72361),s=n(67834),i=n(99893),a=n(6702),o=n(81204),l=n(52606),d=n(46775),c=n(34126);function m(e){let{value:t,children:n,className:m,iconClassName:u,variant:p="ghost",size:x="icon",tooltip:g,successTooltip:h,"aria-label":f}=e,{t:b}=(0,a.Bd)(),{copiedText:y,copyToClipboard:j}=(0,l.C)({notify:!1}),v=y===t,N=g??b("Copy to clipboard"),_=h??b("Copied!"),k=b("Copied"),w=(0,r.jsxs)(d.$,{variant:p,size:x,className:(0,o.cn)("shrink-0",m),onClick:()=>j(t),"aria-label":v?k:f??N,children:[v?(0,r.jsx)(s.A,{className:(0,o.cn)("text-success",u)}):(0,r.jsx)(i.A,{className:(0,o.cn)(u)}),n]});return g||h?(0,r.jsxs)(c.m_,{children:[(0,r.jsx)(c.k$,{render:w}),(0,r.jsx)(c.ZI,{children:(0,r.jsx)("p",{children:v?_:N})})]}):w}},38525(e,t,n){n.d(t,{d:()=>o});var r=n(72361),s=n(6702),i=n(81204),a=n(3088);function o(e){var t;let{t:n}=(0,s.Bd)(),{group:o,label:l,ratio:d,copyable:c=!1,showDot:m,...u}=e,p=o?.trim(),x="auto"===p,g=!p,h=x||g,f=(t={labelOverride:l,groupName:p,isAutoGroup:x,isEmptyGroup:g,t:n}).labelOverride?t.labelOverride:t.isEmptyGroup?t.t("User Group"):t.isAutoGroup?t.t("Auto"):t.groupName??"",b=(0,r.jsx)(a.Wh,{...u,copyable:c,label:f,showDot:m??(!h&&void 0),variant:h?"neutral":void 0,autoColor:h?void 0:p});return null==d?b:(0,r.jsxs)("span",{className:"inline-flex items-center gap-2 text-xs",children:[b,(0,r.jsx)("span",{className:(0,i.cn)("inline-flex h-5 items-center rounded-full px-1.5 font-mono text-xs leading-none font-medium tabular-nums",d>1?"bg-warning/10 text-warning":d<1?"bg-info/10 text-info":"bg-muted text-muted-foreground"),children:(0,r.jsxs)("span",{children:[d,"x"]})})]})}},4860(e,t,n){n.d(t,{J:()=>i,R:()=>s});var r=n(64577);async function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:24;return(await r.FH.get("/api/perf-metrics/summary",{params:{hours:e}})).data}async function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;return(await r.FH.get("/api/perf-metrics",{params:{model:e,hours:t}})).data}},87621(e,t,n){function r(e){return!Number.isFinite(e)||e<=0?"—":e>=1e3?`${(e/1e3).toFixed(1)}K t/s`:`${e.toFixed(e<10?2:1)} t/s`}function s(e){return!Number.isFinite(e)||e<=0?"—":e>=1e3?`${(e/1e3).toFixed(2)}s`:`${Math.round(e)}ms`}function i(e){return Number.isFinite(e)?`${e.toFixed(2)}%`:"—"}n.d(t,{Fm:()=>i,Y5:()=>r,YL:()=>s})},15873(e,t,n){n.d(t,{Gm:()=>tj,n$:()=>ty});var r=n(72361),s=n(68413),i=n(53540),a=n(17034),o=n(45064),l=n(82799),d=n(60665),c=n(93966),m=n(86094),u=n(1417),p=n(7621),x=n(6702),g=n(38417),h=n(81204),f=n(46775),b=n(10998),y=n(18434),j=n(32999),v=n(34151),N=n(92170),_=n(5304),k=n(38525),w=n(86368),A=n(4860),$=n(87621),E=n(54909),R=n(84473),P=n(55621),S=n(27303),K=n(71773);function M(e){let t=5381;for(let n=0;n<e.length;n++)t=33*t^e.charCodeAt(n);return Math.abs(0|t)}function T(e){let t=(e||1)>>>0;return()=>(t=1664525*t+0x3c6ef35f>>>0)/0x100000000}let O=new Set(["openai","openai-response","anthropic","gemini","embeddings","jina-rerank"]),I=new Set(["image-generation"]),L=new Set(["openai-video"]),C=new Set(["embeddings","jina-rerank"]),z=[/^o[1-4](?:[-:_].+)?$/i,/reasoning/i,/thinking/i,/qwq/i,/deepseek-r\d/i,/grok.*-(?:thinking|reasoning)/i],B=[/vision/i,/vl(?:[-_]|$)/i,/multimodal/i,/-omni/i],U=[/audio/i,/whisper/i,/tts/i,/voice/i,/-realtime/i],F=[/video/i,/sora/i,/veo/i,/kling/i,/pika/i],G=[/code/i,/-coder/i],q=[/web[-_ ]?search/i,/-online/i,/perplexity/i],H=["2023-04","2023-10","2023-12","2024-04","2024-06","2024-08","2024-10","2024-12","2025-02","2025-04","2025-08"],D=["1.5B","3B","7B","8B","14B","32B","70B","120B","405B"],V=[8192,16384,32768,65536,128e3,2e5,1e6],Y=[2048,4096,8192,16384,32768,65536],J={vision:"vision",multimodal:"vision",reasoning:"reasoning",thinking:"reasoning",tools:"tools",function:"function_calling","function-calling":"function_calling",streaming:"streaming",json:"json_mode",structured:"structured_output",search:"web_search",code:"code_interpreter",embedding:"embeddings"},W={text:"text",image:"image",audio:"audio",video:"video",file:"file",document:"file",pdf:"file"};function Q(e,t){return e[Math.floor(t()*e.length)]}function X(e,t){return t.some(t=>t.test(e))}function Z(e){return["text","image","audio","video","file"].filter(t=>e.has(t))}let ee=new Intl.NumberFormat(void 0,{maximumFractionDigits:1});function et(e){return!Number.isFinite(e)||e<=0?"—":e>=1e6?`${ee.format(e/1e6)}M`:e>=1e3?`${ee.format(e/1e3)}K`:ee.format(e)}function en(e){if(!e)return"—";let[t,n]=e.split("-"),r=Number(t),s=Number(n);return Number.isFinite(r)&&Number.isFinite(s)?new Date(Date.UTC(r,s-1,1)).toLocaleStr
1ing(void 0,{year:"numeric",month:"short"}):e}let er={openai:"OpenAI",anthropic:"Anthropic",google:"Google",meta:"Meta",mistral:"Mistral AI",qwen:"Alibaba (Qwen)",deepseek:"DeepSeek",xai:"xAI",cohere:"Cohere",baidu:"Baidu",zhipu:"Zhipu AI",moonshot:"Moonshot AI",minimax:"MiniMax",tencent:"Tencent",bytedance:"ByteDance",midjourney:"Midjourney",stability:"Stability AI",unknown:"Unknown"},es={openai:"o200k_base",anthropic:"Anthropic Claude tokenizer",google:"SentencePiece (Gemini)",meta:"Llama 3 tokenizer",mistral:"Mistral tokenizer (BPE)",qwen:"Qwen tokenizer (tiktoken-compat)",deepseek:"DeepSeek tokenizer (BPE)",xai:"Grok tokenizer (BPE)",cohere:"Cohere tokenizer",baidu:"Ernie tokenizer",zhipu:"GLM tokenizer",moonshot:"Kimi tokenizer",minimax:"ABAB tokenizer",tencent:"Hunyuan tokenizer",bytedance:"Doubao tokenizer"},ei={openai:{license:"Proprietary (commercial)",kind:"proprietary"},anthropic:{license:"Proprietary (commercial)",kind:"proprietary"},google:{license:"Proprietary (commercial)",kind:"proprietary"},meta:{license:"Llama Community License",kind:"open-weight"},mistral:{license:"Apache 2.0 / Commercial",kind:"open-weight"},qwen:{license:"Tongyi Qianwen License",kind:"open-weight"},deepseek:{license:"DeepSeek License",kind:"open-weight"},xai:{license:"Proprietary (commercial)",kind:"proprietary"},cohere:{license:"Proprietary (commercial)",kind:"proprietary"},baidu:{license:"Proprietary (commercial)",kind:"proprietary"},zhipu:{license:"GLM-4 License",kind:"open-weight"},moonshot:{license:"Proprietary (commercial)",kind:"proprietary"},minimax:{license:"Proprietary (commercial)",kind:"proprietary"},tencent:{license:"Hunyuan License",kind:"open-weight"},bytedance:{license:"Proprietary (commercial)",kind:"proprietary"},midjourney:{license:"Proprietary (commercial)",kind:"proprietary"},stability:{license:"Stability AI Community License",kind:"open-weight"},unknown:{license:"Provider-specific",kind:"unknown"}},ea={openai:"https://platform.openai.com/docs/models",anthropic:"https://docs.anthropic.com/claude/docs/models-overview",google:"https://ai.google.dev/models",meta:"https://llama.meta.com/",mistral:"https://docs.mistral.ai/getting-started/models/",qwen:"https://qwenlm.github.io/",deepseek:"https://api-docs.deepseek.com/",xai:"https://x.ai/api",cohere:"https://docs.cohere.com/docs/models",baidu:"https://cloud.baidu.com/product/wenxinworkshop",zhipu:"https://open.bigmodel.cn/dev/api",moonshot:"https://platform.moonshot.cn/docs",minimax:"https://platform.minimaxi.com/document/notice",tencent:"https://cloud.tencent.com/document/product/1729",bytedance:"https://www.volcengine.com/docs/82379",midjourney:"https://www.midjourney.com/",stability:"https://platform.stability.ai/"};var eo=n(17257),el=n(95799),ed=n(95307),ec=n(60027),em=n(98307),eu=n(73606),ep=n(66552),ex=n(47296),eg=n(63162),eh=n(30464),ef=n(63742),eb=n(67834),ey=n(99893),ej=n(93294);let ev=(0,s.createContext)({code:""}),eN={name:"line-numbers",line(e,t){e.children.unshift({type:"element",tagName:"span",properties:{className:["inline-block","min-w-10","mr-4","text-right","select-none","text-muted-foreground"]},children:[{type:"text",value:String(t)}]})}};async function e_(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,ej.Yz)(e,{lang:t,themes:{light:"one-light",dark:"one-dark-pro"},transformers:n?[eN]:[]})}let ek=e=>{let{code:t,language:n,showLineNumbers:i=!1,className:a,children:o,...l}=e,[d,c]=(0,s.useState)("");return(0,s.useEffect)(()=>{let e=!1;return e_(t,n,i).then(t=>{e||c(t)}),()=>{e=!0}},[t,n,i]),(0,r.jsx)(ev.Provider,{value:{code:t},children:(0,r.jsx)("div",{className:(0,h.cn)("group bg-background text-foreground relative w-full overflow-hidden rounded-md border",a),...l,children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"[&>pre]:bg-background! [&>pre]:text-foreground! overflow-hidden [&_code]:font-mono [&_code]:text-sm [&>pre]:m-0 [&>pre]:p-4 [&>pre]:text-sm",dangerouslySetInnerHTML:{__html:d}}),o&&(0,r.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:o})]})})})},ew=e=>{let{onCopy:t,onError:n,timeout:i=2e3,children:a,className:o,...l}
1=e,[d,c]=(0,s.useState)(!1),{code:m}=(0,s.useContext)(ev),u=async()=>{if("u"<typeof window||!navigator?.clipboard?.writeText)return void n?.(Error("Clipboard API not available"));try{await navigator.clipboard.writeText(m),c(!0),t?.(),setTimeout(()=>c(!1),i)}catch(e){n?.(e)}},p=d?eb.A:ey.A;return(0,r.jsx)(f.$,{className:(0,h.cn)("shrink-0",o),onClick:u,size:"icon",variant:"ghost",...l,children:a??(0,r.jsx)(p,{size:14})})},eA=[{name:"temperature",type:"number",defaultValue:1,range:"0 ~ 2",descriptionKey:"Sampling temperature; lower is more deterministic"},{name:"top_p",type:"number",defaultValue:1,range:"0 ~ 1",descriptionKey:"Nucleus sampling probability mass"},{name:"max_tokens",type:"integer",range:">= 1",descriptionKey:"Maximum number of tokens in the response"},{name:"frequency_penalty",type:"number",defaultValue:0,range:"-2 ~ 2",descriptionKey:"Penalises repetition of frequent tokens"},{name:"presence_penalty",type:"number",defaultValue:0,range:"-2 ~ 2",descriptionKey:"Encourages introducing new topics"},{name:"stop",type:"array",descriptionKey:"Up to 4 strings that stop generation"},{name:"seed",type:"integer",descriptionKey:"Deterministic sampling seed (best-effort)"},{name:"n",type:"integer",defaultValue:1,range:">= 1",descriptionKey:"Number of completions to generate"},{name:"stream",type:"boolean",defaultValue:!1,descriptionKey:"Stream tokens via Server-Sent Events"},{name:"response_format",type:"object",descriptionKey:"Force JSON object or schema-conforming output"},{name:"tools",type:"array",descriptionKey:"Tool / function declarations the model may call"},{name:"tool_choice",type:"string",enumValues:["auto","none","required"],descriptionKey:"Tool-choice policy or specific tool name"},{name:"logprobs",type:"boolean",defaultValue:!1,descriptionKey:"Return per-token log probabilities"},{name:"top_logprobs",type:"integer",range:"0 ~ 20",descriptionKey:"Number of top log probabilities returned per token"},{name:"logit_bias",type:"object",descriptionKey:"Per-token logit bias map"},{name:"user",type:"string",descriptionKey:"End-user identifier for abuse monitoring"}],e$=[{name:"reasoning_effort",type:"enum",enumValues:["low","medium","high"],defaultValue:"medium",descriptionKey:"Controls how much the model thinks before answering"},{name:"max_completion_tokens",type:"integer",range:">= 1",descriptionKey:"Maximum tokens including hidden reasoning tokens"},{name:"stop",type:"array",descriptionKey:"Up to 4 strings that stop generation"},{name:"seed",type:"integer",descriptionKey:"Deterministic sampling seed (best-effort)"},{name:"stream",type:"boolean",defaultValue:!1,descriptionKey:"Stream tokens via Server-Sent Events"},{name:"response_format",type:"object",descriptionKey:"Force JSON object or schema-conforming output"},{name:"tools",type:"array",descriptionKey:"Tool / function declarations the model may call"},{name:"tool_choice",type:"string",enumValues:["auto","none","required"],descriptionKey:"Tool-choice policy or specific tool name"},{name:"user",type:"string",descriptionKey:"End-user identifier for abuse monitoring"}],eE=[{name:"input",type:"string",required:!0,descriptionKey:"Text or array of texts to embed"},{name:"dimensions",type:"integer",range:">= 1",descriptionKey:"Truncate embeddings to this many dimensions"},{name:"encoding_format",type:"enum",enumValues:["float","base64"],defaultValue:"float",descriptionKey:"Wire encoding for the embedding vectors"},{name:"user",type:"string",descriptionKey:"End-user identifier for abuse monitoring"}],eR=[{name:"prompt",type:"string",required:!0,descriptionKey:"Text description of the desired image"},{name:"size",type:"enum",enumValues:["256x256","512x512","1024x1024","1024x1792","1792x1024"],defaultValue:"1024x1024",descriptionKey:"Output image size"},{name:"quality",type:"enum",enumValues:["standard","hd"],defaultValue:"standard",descriptionKey:"Generation quality preset"},{name:"style",type:"enum",enumValues:["vivid","natural"],defaultValue:"vivid",descriptionKey:"Aesthetic style"},{name:"n",type:"integer",defaultValue:1,range:"1 ~ 10",descriptionKey:"Number of images to generate"},{name:"response_format",type:"enum",enumValues:["url","b64_json"],defaultValue:"url",descriptionKey:"How to deliver the resulting image"}],eP=[{name:"prompt",type:"string",required:!0,descriptionKey:"Text description of the desired video"},{name:"duration",type:"integer",range:"1 ~ 60",descriptionKey:"Video length in seconds"},{name:"aspect_ratio",type:"enum",enumValues:["16:9","9:16","1:1"],defaultValue:"16:9",descriptionKey:"Output aspect ratio"},{name:"fps",type:"integer",range:"8 ~ 60",defaultValue:24,descriptionKey:"Frames per second"}];function eS(e){let t,n=(t=e.model_name.toLowerCase(),/embed|rerank/.test(t)?"embedding":/image|sora|veo|kling|pika|jimeng|dalle|imagen/.test(t)?"image":/whisper|tts|voice|audio/.test(t)?"audio":/o1|o3|o4|reasoning|thinking|deepseek-r/.test(t)?"reasoning":/flash|haiku|mini|small|nano|fast/.test(t)?"fast":/gpt-5|opus|ultra|405|70b/.test(t)?"large":"standard");return"embedding"===n||"reasoning"===n?n:"image"===n?/sora|veo|kling|pika|video|wan-|hunyuanvideo/i.test(e.model_name)?"video":"image":"chat"}function eK(e){return e<=0?"—":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}
1K`:e.toLocaleString()}let eM={curl:"cURL",python:"Python",typescript:"TypeScript",javascript:"JavaScript"},eT={curl:"bash",python:"python",typescript:"typescript",javascript:"javascript"};function eO(e){let{t}=(0,x.Bd)(),{status:n}=(0,eh.s)(),i=(0,s.useMemo)(()=>{let e=n?.server_address??n?.serverAddress??n?.data?.server_address??n?.data?.serverAddress;return e&&"string"==typeof e?e.replace(/\/$/,""):"u">typeof window?window.location.origin:"https://api.example.com"},[n]),a=(0,s.useMemo)(()=>(e.model.supported_endpoint_types||[]).map(t=>{let n=e.endpointMap[t]||{},r=n.path||"";return r&&r.includes("{model}")&&(r=(0,K.Oi)(r,e.model.model_name||"")),{type:t,path:r,method:n.method||"POST"}}).filter(e=>!!e.path),[e.model,e.endpointMap]),[o,l]=(0,s.useState)(a[0]?.type??""),[d,c]=(0,s.useState)("curl"),m=(0,s.useMemo)(()=>a.find(e=>e.type===o)??a[0],[o,a]);if(0===a.length||!m)return null;let u=function(e,t,n){let r,s,i,a,o,l;if("anthropic"===t){let t=`${n.baseUrl}${n.endpointPath}`,r="Explain quantum entanglement in one paragraph.";if("curl"===e){let e=JSON.stringify({model:n.modelName,max_tokens:1024,messages:[{role:"user",content:r}]},null,2);return`curl ${t} \\
2  -H "x-api-key: $${n.apiKeyEnv}" \\
3  -H "anthropic-version: 2023-06-01" \\
4  -H "Content-Type: application/json" \\
5  -d '${e.replace(/\n/g,"\n     ")}'`}return"python"===e?`import anthropic
6
7client = anthropic.Anthropic(
8    base_url="${n.baseUrl}",
9    api_key="<YOUR_API_KEY>",
10)
11
12message = client.messages.create(
13    model="${n.modelName}",
14    max_tokens=1024,
15    messages=[{"role": "user", "content": "${r}"}],
16)
17
18print(message.content[0].text)`:"typescript"===e?`import Anthropic from '@anthropic-ai/sdk'
19
20const client = new Anthropic({
21  baseURL: '${n.baseUrl}',
22  apiKey: process.env.${n.apiKeyEnv},
23})
24
25const message = await client.messages.create({
26  model: '${n.modelName}',
27  max_tokens: 1024,
28  messages: [{ role: 'user', content: '${r}' }],
29})
30
31console.log(message.content[0].text)`:`const response = await fetch('${t}', {
32  method: 'POST',
33  headers: {
34    'x-api-key': process.env.${n.apiKeyEnv},
35    'anthropic-version': '2023-06-01',
36    'Content-Type': 'application/json',
37  },
38  body: JSON.stringify({
39    model: '${n.modelName}',
40    max_tokens: 1024,
41    messages: [{ role: 'user', content: '${r}' }],
42  }),
43})
44
45const data = await response.json()
46console.log(data.content[0].text)`}if("gemini"===t){let t=`${n.baseUrl}${n.endpointPath}?key=$${n.apiKeyEnv}`,r="Explain quantum entanglement in one paragraph.";if("curl"===e){let e=JSON.stringify({contents:[{parts:[{text:r}]}]},null,2);return`curl '${t}' \\
47  -H 'Content-Type: application/json' \\
48  -d '${e.replace(/\n/g,"\n     ")}'`}return"python"===e?`import google.generativeai as genai
49
50genai.configure(api_key="<YOUR_API_KEY>")
51
52model = genai.GenerativeModel("${n.modelName}")
53response = model.generate_content("${r}")
54
55print(response.text)`:"typescript"===e?`import { GoogleGenerativeAI } from '@google/generative-ai'
56
57const genAI = new GoogleGenerativeAI(process.env.${n.apiKeyEnv}!)
58const model = genAI.getGenerativeModel({ model: '${n.modelName}' })
59
60const result = await model.generateContent('${r}')
61console.log(result.response.text())`:`const response = await fetch('${t}', {
62  method: 'POST',
63  headers: { 'Content-Type': 'application/json' },
64  body: JSON.stringify({
65    contents: [{ parts: [{ text: '${r}' }] }],
66  }),
67})
68
69const data = await response.json()
70console.log(data.candidates[0].content.parts[0].text)`}if("embeddings"===t||"jina-rerank"===t){let t=`${n.baseUrl}${n.endpointPath}`,r="The food was delicious and the waiter…";if("curl"===e){let e=JSON.stringify({model:n.modelName,input:r},null,2);return`curl ${t} \\
71  -H "Authorization: Bearer $${n.apiKeyEnv}" \\
72  -H "Content-Type: application/json" \\
73  -d '${e.replace(/\n/g,"\n     ")}'`}return"python"===e?`from openai import OpenAI
74
75client = OpenAI(base_url="${n.baseUrl}/v1", api_key="<YOUR_API_KEY>")
76
77response = client.embeddings.create(
78    model="${n.modelName}",
79    input="${r}",
80)
81
82print(response.data[0].embedding[:8])`:"typescript"===e?`import OpenAI from 'openai'
83
84const client = new OpenAI({
85  baseURL: '${n.baseUrl}/v1',
86  apiKey: process.env.${n.apiKeyEnv},
87})
88
89const response = await client.embeddings.create({
90  model: '${n.modelName}',
91  input: '${r}',
92})
93
94console.log(response.data[0].embedding.slice(0, 8))`:`const response = await fetch('${t}', {
95  method: 'POST',
96  headers: {
97    Authorization: \`Bearer \${process.env.${n.apiKeyEnv}}\`,
98    'Content-Type': 'application/json',
99  },
100  body: JSON.stringify({
101    model: '${n.modelName}',
102    input: '${r}',
103  }),
104})
105
106const data = await response.json()
107console.log(data.data[0].embedding.slice(0, 8))`}if("image-generation"===t){let t=`${n.baseUrl}${n.endpointPath}`,r="A serene koi pond at sunset, ukiyo-e style.";if("curl"===e){let e=JSON.stringify({model:n.modelName,prompt:r,size:"1024x1024",n:1},null,2);return`curl ${t} \\
108  -H "Authorization: Bearer $${n.apiKeyEnv}" \\
109  -H "Content-Type: application/json" \\
110  -d '${e.replace(/\n/g,"\n     ")}'`}return"python"===e?`from openai import OpenAI
111
112client = OpenAI(base_url="${n.baseUrl}/v1", api_key="<YOUR_API_KEY>")
113
114response = client.images.generate(
115    model="${n.modelName}",
116    prompt="${r}",
117    size="1024x1024",
118    n=1,
119)
120
121print(response.data[0].url)`:"typescript"===e?`import OpenAI from 'openai'
122
123const client = new OpenAI({
124  baseURL: '${n.baseUrl}/v1',
125  apiKey: process.env.${n.apiKeyEnv},
126})
127
128const response = await client.images.generate({
129  model: '${n.modelName}',
130  prompt: '${r}',
131  size: '1024x1024',
132  n: 1,
133})
134
135console.log(response.data[0].url)`:`const response = await fetch('${t}', {
136  method: 'POST',
137  headers: {
138    Authorization: \`Bearer \${process.env.${n.apiKeyEnv}}\`,
139    'Content-Type': 'application/json',
140  },
141  body: JSON.stringify({
142    model: '${n.modelName}',
143    prompt: '${r}',
144    size: '1024x1024',
145    n: 1,
146  }),
147})
148
149const data = await response.json()
150console.log(data.data[0].url)`}return r=`${n.baseUrl}${n.endpointPath}`,s="openai-response"===n.endpointType,i=/^o[1-4]|reasoning|thinking|deepseek-r/i.test(n.modelName),a="Explain quantum entanglement in one paragraph.",o=s?JSON.stringify({model:n.modelName,input:a},null,2):JSON.stringify({model:n.modelName,messages:[{role:"user",content:a}],...i?{}:{temperature:.7}}
150,null,2),l=s?"responses.create":"chat.completions.create","curl"===e?`curl ${r} \\
151  -H "Authorization: Bearer $${n.apiKeyEnv}" \\
152  -H "Content-Type: application/json" \\
153  -d '${o.replace(/\n/g,"\n     ")}'`:"python"===e?["from openai import OpenAI\n\nclient = OpenAI(",`    base_url="${n.baseUrl}/v1",`,'    api_key="<YOUR_API_KEY>",\n)\n',s?`response = client.${l}(
154    model="${n.modelName}",
155    input="${a}",
156)
157
158print(response.output_text)`:`completion = client.${l}(
159    model="${n.modelName}",
160    messages=[
161        {"role": "user", "content": "${a}"}
162    ],
163)
164
165print(completion.choices[0].message.content)`].join("\n"):"typescript"===e?["import OpenAI from 'openai'\n\nconst client = new OpenAI({",`  baseURL: '${n.baseUrl}/v1',`,`  apiKey: process.env.${n.apiKeyEnv},`,"})\n",s?`const response = await client.${l}({
166  model: '${n.modelName}',
167  input: '${a}',
168})
169
170console.log(response.output_text)`:`const completion = await client.${l}({
171  model: '${n.modelName}',
172  messages: [{ role: 'user', content: '${a}' }],
173})
174
175console.log(completion.choices[0].message.content)`].join("\n"):`const response = await fetch('${r}', {
176  method: 'POST',
177  headers: {
178    Authorization: \`Bearer \${process.env.${n.apiKeyEnv}}\`,
179    'Content-Type': 'application/json',
180  },
181  body: JSON.stringify(${o}),
182})
183
184const data = await response.json()
185console.log(data)`}(d,m.type,{baseUrl:i,apiKeyEnv:"NEW_API_KEY",modelName:e.model.model_name||"",endpointType:m.type,endpointPath:m.path});return(0,r.jsxs)("section",{children:[(0,r.jsx)(eG,{icon:ed.A,children:t("Code samples")}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a.length>1&&(0,r.jsx)(v.tU,{value:o,onValueChange:l,children:(0,r.jsx)(v.j7,{className:"bg-muted/40 h-8 p-0.5",children:a.map(e=>(0,r.jsx)(v.Xi,{value:e.type,className:"h-7 px-2.5 text-xs",children:e.type},e.type))})}),(0,r.jsx)(v.tU,{value:d,onValueChange:e=>c(e),className:"ml-auto",children:(0,r.jsx)(v.j7,{className:"bg-muted/40 h-8 p-0.5",children:Object.keys(eM).map(e=>(0,r.jsx)(v.Xi,{value:e,className:"h-7 px-2.5 text-xs",children:eM[e]},e))})})]}),(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)(ek,{code:u,language:eT[d],children:(0,r.jsx)(ew,{})})}),(0,r.jsxs)("p",{className:"text-muted-foreground mt-2 text-xs",children:[t("Replace")," ",(0,r.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[11px]",children:"<YOUR_API_KEY>"})," ",t("with the API key from your token settings.")]})]})}function eI(e){let{t}=(0,x.Bd)(),n=(0,s.useMemo)(()=>{let t;return"reasoning"===(t=eS(e.model))?e$:"embedding"===t?eE:"image"===t?eR:"video"===t?eP:eA},[e.model]);return 0===n.length?null:(0,r.jsxs)("section",{children:[(0,r.jsx)(eG,{icon:ec.A,children:t("Supported parameters")}),(0,r.jsx)("div",{className:"border-border/60 overflow-hidden rounded-lg border",children:(0,r.jsxs)(j.XI,{children:[(0,r.jsx)(j.A0,{children:(0,r.jsxs)(j.Hj,{className:"bg-muted/30 hover:bg-muted/30",children:[(0,r.jsx)(j.nd,{className:"h-9 w-44",children:t("Parameter")}),(0,r.jsx)(j.nd,{className:"h-9 w-24",children:t("Type")}),(0,r.jsx)(j.nd,{className:"h-9 w-32",children:t("Default / range")}),(0,r.jsx)(j.nd,{className:"h-9",children:t("Description")})]})}),(0,r.jsx)(j.BF,{children:n.map(e=>(0,r.jsxs)(j.Hj,{className:"hover:bg-muted/20",children:[(0,r.jsx)(j.nA,{className:"py-2 align-top",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("code",{className:"font-mono text-sm font-medium",children:e.name}),e.required&&(0,r.jsx)(ef.E,{variant:"outline",className:"h-6 border-rose-500/40 px-2 text-sm text-rose-600 dar
185k:text-rose-400",children:t("required")})]})}),(0,r.jsx)(j.nA,{className:"py-2 align-top",children:(0,r.jsx)(ef.E,{variant:"secondary",className:"h-7 rounded-full px-2.5 font-mono text-sm font-normal",children:e.type})}),(0,r.jsx)(j.nA,{className:"py-2 align-top",children:(0,r.jsx)(eL,{param:e})}),(0,r.jsx)(j.nA,{className:"text-muted-foreground py-2 align-top",children:t(e.descriptionKey)})]},e.name))})]})})]})}function eL(e){let{defaultValue:t,range:n,enumValues:s}=e.param;return void 0!==t?(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,r.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),(0,r.jsx)("code",{className:"bg-muted rounded px-1.5 py-0.5 font-mono text-sm",children:String(t)}),n&&(0,r.jsx)("span",{className:"text-muted-foreground text-sm",children:n})]}):n?(0,r.jsx)("span",{className:"text-muted-foreground font-mono text-sm",children:n}):s&&s.length>0?(0,r.jsx)("div",{className:"flex flex-wrap gap-0.5",children:s.map(e=>(0,r.jsx)("code",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-sm",children:e},e))}):(0,r.jsx)("span",{className:"text-muted-foreground/60 text-sm",children:"—"})}function eC(e){let{t}=(0,x.Bd)(),n=(0,s.useMemo)(()=>{var t;let n,r,s,i,a,o,l,d,c;return r=(n=((t=e.model).enable_groups??[]).filter(e=>e&&"auto"!==e)).length>0?n:["default"],s=eS(t),i=M(`${t.model_name}:rl`),a="image"===s||"video"===s,o="embedding"===s,l=a?60:o?5e3:500,d=a?0:o?1e6:2e5,c=a?1e3:o?1e5:1e4,r.slice().sort((e,t)=>e.localeCompare(t)).map(e=>{let t=.6+1.4*T(i^M(e))();return{group:e,rpm:10*Math.round(l*t/10),tpm:0===d?0:1e3*Math.round(d*t/1e3),rpd:100*Math.round(c*t/100)}})},[e.model]);return 0===n.length?null:(0,r.jsxs)("section",{children:[(0,r.jsx)(eG,{icon:em.A,children:t("Rate limits")}),(0,r.jsx)("div",{className:"border-border/60 overflow-hidden rounded-lg border",children:(0,r.jsxs)(j.XI,{children:[(0,r.jsx)(j.A0,{children:(0,r.jsxs)(j.Hj,{className:"bg-muted/30 hover:bg-muted/30",children:[(0,r.jsx)(j.nd,{className:"h-9",children:t("Group")}),(0,r.jsx)(j.nd,{className:"h-9 text-right",children:"RPM"}),(0,r.jsx)(j.nd,{className:"h-9 text-right",children:"TPM"}),(0,r.jsx)(j.nd,{className:"h-9 text-right",children:"RPD"})]})}),(0,r.jsx)(j.BF,{children:n.map(e=>(0,r.jsxs)(j.Hj,{className:"hover:bg-muted/20",children:[(0,r.jsx)(j.nA,{className:"py-2 font-mono",children:e.group}),(0,r.jsx)(j.nA,{className:"py-2 text-right font-mono",children:eK(e.rpm)}),(0,r.jsx)(j.nA,{className:"py-2 text-right font-mono",children:eK(e.tpm)}),(0,r.jsx)(j.nA,{className:"py-2 text-right font-mono",children:eK(e.rpd)})]},e.group))})]})}),(0,r.jsx)("p",{className:"text-muted-foreground mt-2 text-[11px] leading-relaxed",children:t("RPM = requests per minute, TPM = tokens per minute, RPD = requests per day. Limits apply per token group.")})]})}function ez(e){let{t}=(0,x.Bd)(),n=(0,s.useMemo)(()=>{var t,n,r;let s,i,a,o,l,d,c;return a=(i=((t=e.model).model_name||"").toLowerCase(),/^gpt|^o[1-4]|davinci|babbage|whisper|tts|dall.?e|sora|^omni/.test(i)?"openai":/claude/.test(i)?"anthropic":/gemini|gemma|imagen|veo|palm/.test(i)?"google":/llama|^codellama/.test(i)?"meta":/mistral|mixtral|codestral|magistral|pixtral/.test(i)?"mistral":/qwen|qwq|qvq/.test(i)?"qwen":/deepseek/.test(i)?"deepseek":/grok/.test(i)?"xai":/command|cohere|aya/.test(i)?"cohere":/ernie|wenxin/.test(i)?"baidu":/glm|chatglm|cogview|cogvideo/.test(i)?"zhipu":/kimi|moonshot/.test(i)?"moonshot":/abab|minimax|hailuo/.test(i)?"minimax":/hunyuan/.test(i)?"tencent":/doubao|seed|jimeng/.test(i)?"bytedance":/midjourney|niji/.test(i)?"midjourney":/^sd-|stable[-_]?diffusion|sdxl/.test(i)?"stability":"unknown"),o=(n=t,r=a,s=n.model_name.toLowerCase(),"openai"===r?/gpt-3|davinci|babbage|whisper|tts/.test(s)?{tokenizer:"cl100k_base",note:"Older GPT-3.5 fam
185ily"}:{tokenizer:"o200k_base"}:{tokenizer:es[r]??"BPE (vendor-specific)"}),l=ei[a],d=T(M(`${t.model_name}:api`)),c="openai"===a?30:Math.round(90*d()),{vendor:a,vendor_label:er[a],tokenizer:o.tokenizer,tokenizer_note:o.note,license:l.license,license_kind:l.kind,data_retention_days:c,training_opt_out:!0,homepage:ea[a]}},[e.model]);return(0,r.jsxs)("section",{children:[(0,r.jsx)(eG,{icon:eu.A,children:t("Provider & data privacy")}),(0,r.jsxs)("div",{className:"border-border/60 bg-border/60 grid grid-cols-1 gap-px overflow-hidden rounded-lg border sm:grid-cols-2",children:[(0,r.jsx)(eB,{label:t("Provider"),children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-sm font-medium",children:n.vendor_label}),n.homepage&&(0,r.jsxs)("a",{href:n.homepage,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-0.5 text-[11px]",children:[t("Docs"),(0,r.jsx)(ep.A,{className:"size-3"})]})]})}),(0,r.jsx)(eB,{label:t("Tokenizer"),children:(0,r.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,r.jsx)("code",{className:"font-mono text-xs",children:n.tokenizer}),n.tokenizer_note&&(0,r.jsx)("span",{className:"text-muted-foreground text-[10px]",children:n.tokenizer_note})]})}),(0,r.jsx)(eB,{label:t("License"),children:(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-sm",children:n.license}),(0,r.jsx)(ef.E,{variant:"outline",className:(0,h.cn)("h-4 w-fit px-1.5 text-[9px] font-medium","open"===n.license_kind&&"border-emerald-500/40 text-emerald-600 dark:text-emerald-400","open-weight"===n.license_kind&&"border-sky-500/40 text-sky-600 dark:text-sky-400","proprietary"===n.license_kind&&"border-amber-500/40 text-amber-600 dark:text-amber-400"),children:t("open"===n.license_kind?"Open source":"open-weight"===n.license_kind?"Open weights":"proprietary"===n.license_kind?"Proprietary":"Unknown")})]})}),(0,r.jsxs)(eB,{label:t("Data retention"),children:[(0,r.jsx)("span",{className:"text-sm",children:0===n.data_retention_days?t("Zero retention"):`${n.data_retention_days} ${t("days")}`}),(0,r.jsx)("span",{className:"text-muted-foreground text-[10px]",children:t(n.training_opt_out?"Not used for upstream training by default":"May be used for training by upstream provider")})]})]})]})}function eB(e){return(0,r.jsxs)("div",{className:"bg-card flex flex-col gap-1 px-3 py-2.5",children:[(0,r.jsx)("span",{className:"text-muted-foreground text-[10px] font-medium tracking-wider uppercase",children:e.label}),e.children]})}function eU(){let{t:e}=(0,x.Bd)();return(0,r.jsxs)("section",{children:[(0,r.jsx)(eG,{icon:ex.A,children:e("Authentication")}),(0,r.jsxs)("div",{className:"border-border/60 bg-muted/20 flex items-start gap-2 rounded-lg border p-3",children:[(0,r.jsx)(eg.A,{className:"text-muted-foreground mt-0.5 size-3.5 shrink-0"}),(0,r.jsxs)("div",{className:"space-y-1.5 text-xs leading-relaxed",children:[(0,r.jsxs)("p",{children:[e("All requests must include")," ",(0,r.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[11px]",children:"Authorization: Bearer <TOKEN>"})," ",e("header. Anthropic-formatted endpoints accept the")," ",(0,r.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[11px]",children:"x-api-key"})," ",e("header instead.")]}),(0,r.jsx)("p",{className:"text-muted-foreground",children:e("Generate tokens from the Tokens page; you can scope them to specific models, groups, IPs, and rate-limits.")})]})]})]})}function eF(e){return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(eO,{model:e.model,endpointMap:e.endpointMap}),(0,r.jsx)(eU,{}),(0,r.jsx)(eI,{model:e.model}),(0,r.jsx)(eC,{model:e.model})]})}function eG(e){let t=e.icon;return(0,r.jsxs)("h3",{className:"text-foreground mb-3 flex items-center gap-1.5 text-sm font-semibold",children:[(0,r.jsx)(t,{className:"text-muted-foreground/70 size-3.5"}),e.children]})}var eq=n(96474),eH=n(66701),eD=n(51499),eV=n(59587),eY=n(13236),eJ=n(34126);let eW={text:{icon:eq.A,labelKey:"Text"},image:{icon:eH.A,labelKey:"Image"},audio:{icon:eD.A,labelKey:"Audio"},video:{icon:eV.A,labelKey:"Video"},file:{icon:eY.A,labelKey:"File"}};function eQ(e){let{t}=(0,x.Bd)();return 0===e.modalities.length?(0,r.jsx)("span",{className:"text-muted-foreground text-xs",children:"—"}):(0,r.jsx)("span",{className:"inline-flex items-center gap-1",children:e.modalities.map(n=>{let s=eW[n],i=s.icon;return(0,r.jsxs)(eJ.m_,{children:[(0,r.jsx)(eJ.k$,{render:(0,r.jsx)("span",{"aria-label":t(s.labelKey),className:"text-foreground
185/80 inline-flex"}),children:(0,r.jsx)(i,{className:(0,h.cn)("size-3.5",e.className)})}),(0,r.jsx)(eJ.ZI,{side:"top",className:"text-xs",children:t(s.labelKey)})]},n)})})}var eX=n(96855),eZ=n(58246);n(86119);var e0=n(96087),e1=n(77935);function e2(e){return{textColor:"dark"===e?"rgba(255, 255, 255, 0.68)":"rgba(15, 23, 42, 0.58)",gridColor:"dark"===e?"rgba(255, 255, 255, 0.12)":"rgba(15, 23, 42, 0.12)"}}function e4(e){let{t}=(0,x.Bd)(),{resolvedTheme:n,themeReady:i}=(0,e0.R)(),{textColor:a,gridColor:o}=e2(n),l=(0,s.useMemo)(()=>0===e.series.length?null:{type:"line",data:[{id:"latency",values:e.series.map(e=>{let t;return{time:(t=new Date(e.timestamp).getHours(),`${String(t).padStart(2,"0")}:00`),group:e.group,ttft:e.ttft_ms}})}],xField:"time",yField:"ttft",seriesField:"group",smooth:!0,point:{visible:!0,style:{size:5,stroke:"#ffffff",lineWidth:1.5}},line:{style:{lineWidth:2}},legends:{visible:!1},tooltip:{mark:{title:{value:e=>e.time},content:[{key:t("Average TTFT"),value:e=>`${Math.round(e.ttft)} ms`}]}},axes:[{orient:"bottom",label:{style:{fill:a,fontSize:10}},tick:{visible:!1}},{orient:"left",label:{formatMethod:e=>`${e} ms`,style:{fill:a,fontSize:10}},grid:{visible:!0,style:{lineDash:[3,3],stroke:o}}}]},[o,e.series,t,a]);return 0===e.series.length?(0,r.jsx)("div",{className:(0,h.cn)("text-muted-foreground flex h-48 items-center justify-center rounded-lg border text-xs",e.className),children:t("No latency data available")}):(0,r.jsx)("div",{className:(0,h.cn)("h-64 sm:h-72",e.className),children:i&&l&&(0,r.jsx)(eZ.F,{spec:{...l,theme:"dark"===n?"dark":"light",background:"transparent"},option:e1.X},`latency-${n}`)})}function e5(e){let{t}=(0,x.Bd)(),{resolvedTheme:n,themeReady:i}=(0,e0.R)(),{textColor:a,gridColor:o}=e2(n),l=(0,s.useMemo)(()=>0===e.series.length?null:{type:"line",data:[{id:"uptime",values:e.series.map(e=>{var t;let n;return{date:(n=new Date(t=e.date),t.includes("T")?n.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric"})),uptime:e.uptime_pct,incidents:e.incidents,outage:e.outage_minutes}})}],xField:"date",yField:"uptime",smooth:!0,line:{style:{stroke:"#10b981",lineWidth:2}},point:{visible:!0,style:{size:5,stroke:"#ffffff",lineWidth:1.5,fill:e=>e.uptime>=99.9?"#10b981":e.uptime>=99?"#f59e0b":"#ef4444"}},tooltip:{mark:{title:{value:e=>e.date},content:[{key:t("Uptime"),value:e=>`${e.uptime.toFixed(2)}%`},{key:t("Incidents"),value:e=>`${e.incidents}`},{key:t("Outage"),value:e=>`${e.outage} ${t("minutes")}`}]}},axes:[{orient:"bottom",label:{style:{fill:a,fontSize:10},autoLimit:!0},tick:{visible:!1}},{orient:"left",min:95,max:100,label:{formatMethod:e=>`${e}%`,style:{fill:a,fontSize:10}},grid:{visible:!0,style:{lineDash:[3,3],stroke:o}}}]},[o,e.series,t,a]);return 0===e.series.length?(0,r.jsx)("div",{className:(0,h.cn)("text-muted-foreground flex h-48 items-center justify-center rounded-lg border text-xs",e.className),children:t("No uptime data available")}):(0,r.jsx)("div",{className:(0,h.cn)("h-56 sm:h-64",e.className),children:i&&l&&(0,r.jsx)(eZ.F,{spec:{...l,theme:"dark"===n?"dark":"light",background:"transparent"},option:e1.X},`uptime-trend-${n}`)})}function e3(e){let t=e.size??"md",n=e.showOverall??!0;if(0===e.series.length)return(0,r.jsx)("span",{className:(0,h.cn)("text-muted-foreground text-xs",e.className),children:e.emptyLabel??"—"});let s=e.series.reduce((e,t)=>e+t.uptime_pct,0)/e.series.length,i="sm"===t?"h-3.5":"h-5",a="sm"===t?"w-[3px]":"w-1";return(0,r.jsxs)("div",{className:(0,h.cn)("flex items-center gap-2",e.className),children:[(0,r.jsx)("div",{className:(0,h.cn)("flex items-end",i,"sm"===t?"gap-px":"gap-[2px]"),role:"img","aria-label":`30 day uptime ${s.toFixed(2)}%`,children:e.series.map(e=>{var t,n;return(0,r.jsxs)(eJ.m_,{children:[(0,r.jsx)(eJ.k$,{render:(0,r.jsx)("div",{className:(0,h.cn)("rounded-sm transition-opacity hover:opacity-80",a,i,"flex items-end")}),children:(0,r.jsx)("div",{className:(0,h.cn)("w-full rounded-sm",(t=e.uptime_pct)>=99.9?"bg-emerald-500":t>=99?"bg-emerald-400":t>=95?"bg-amber-500":t>=90?"bg-amber-600":"bg-rose-500",(n=e.uptime_pct)>=99.9?"h-full":n>=99?"h-[88%]":n>=95?"h-[72%]":n>=90?"h-[55%]":"h-[40%]"),"aria-hidden":!0})}),(0,r.jsxs)(eJ.ZI,{side:"top",className:"font-mono text-xs",children:[(0,r.jsx)("div",{className:"font-medium",children:e.date}),(0,r.jsxs)("div",{children:[e.uptime_pct.toFixed(2),"%"]}),e.outage_minutes>0&&(0,r.jsxs)("div",{className:"text-muted-foreground",children:[e.outage_minutes," min outage"]})]})]},e.date)})}),n&&(0,r.jsxs)("span",{className:(0,h.cn)("font-mono text-sm font-semibold tabular-nums",s>=99.9||s>=99?"text-emerald-600 dark:text-emerald-400":s>
185=95?"text-amber-600 dark:text-amber-400":"text-rose-600 dark:text-rose-400"),children:[s.toFixed(1),"%"]})]})}function e6(e){let t=e.icon,n=e.intent??"default";return(0,r.jsxs)("div",{className:"bg-background flex flex-col gap-1 rounded-lg border p-3",children:[(0,r.jsxs)("span",{className:"text-muted-foreground inline-flex items-center gap-1.5 text-[10px] font-medium tracking-wider uppercase",children:[(0,r.jsx)(t,{className:"size-3"}),e.label]}),(0,r.jsx)("span",{className:(0,h.cn)("text-foreground font-mono text-lg font-semibold tabular-nums","warning"===n&&"text-amber-600 dark:text-amber-400","success"===n&&"text-emerald-600 dark:text-emerald-400"),children:e.value}),e.hint&&(0,r.jsx)("span",{className:"text-muted-foreground/70 text-[11px]",children:e.hint})]})}function e9(e){let t,{t:n}=(0,x.Bd)(),a=(0,i.I)({queryKey:["perf-metrics",e.model.model_name],queryFn:()=>(0,A.J)(e.model.model_name,24),staleTime:6e4}),o=(0,s.useMemo)(()=>a.data?.data.groups??[],[a.data]),l=(0,s.useMemo)(()=>o.map(e=>({group:e.group,avg_ttft_ms:e.avg_ttft_ms,avg_latency_ms:e.avg_latency_ms,success_rate:e.success_rate,avg_tps:e.avg_tps})),[o]),m=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let n of e)for(let e of n.series){if(e.avg_ttft_ms<=0)continue;let n=t.get(e.ts)??[];n.push(e.avg_ttft_ms),t.set(e.ts,n)}return Array.from(t.entries()).sort((e,t)=>{let[n]=e,[r]=t;return n-r}).map(e=>{let[t,n]=e;return{timestamp:new Date(1e3*t).toISOString(),group:"latency",ttft_ms:Math.round(n.reduce((e,t)=>e+t,0)/n.length)}})})(o),[o]),u=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let n of e)for(let e of n.series){let n=t.get(e.ts)??{rates:[],incidents:0};Number.isFinite(e.success_rate)&&(n.rates.push(e.success_rate),e.success_rate<100&&(n.incidents+=1)),t.set(e.ts,n)}return Array.from(t.entries()).sort((e,t)=>{let[n]=e,[r]=t;return n-r}).map(e=>{let[t,n]=e,r=n.rates.length>0?n.rates.reduce((e,t)=>e+t,0)/n.rates.length:0;return{date:new Date(1e3*t).toISOString(),uptime_pct:Math.round(100*r)/100,incidents:n.incidents,outage_minutes:0}})})(o),[o]),p=(0,s.useMemo)(()=>{let e={};for(let t of o)e[t.group]=t.series.map(e=>({date:new Date(1e3*e.ts).toISOString(),uptime_pct:Math.round(100*e.success_rate)/100,incidents:+(e.success_rate<100),outage_minutes:0}));return e},[o]);if(a.isLoading||0===l.length)return(0,r.jsx)("div",{className:"text-muted-foreground rounded-lg border p-6 text-center text-sm",children:n("Performance data is not yet available for this model.")});let g=l.map(e=>e.avg_tps).filter(e=>e>0),h=g.length>0?g.reduce((e,t)=>e+t,0)/g.length:0,f=0===(t=l.map(e=>e.avg_latency_ms).filter(e=>e>0)).length?0:Math.round(t.reduce((e,t)=>e+t,0)/t.length),b=l.map(e=>e.success_rate).filter(e=>Number.isFinite(e)),y=b.length>0?b.reduce((e,t)=>e+t,0)/b.length:0,v=u.reduce((e,t)=>e+t.incidents,0),N="warning";y>=99.9?N="success":y>=99&&(N="default");let _="text-muted-foreground py-2 text-[10px] font-medium tracking-wider uppercase";return(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:[(0,r.jsx)(e6,{icon:d.A,label:"TPS",value:(0,$.Y5)(h),hint:n("Sustained tokens per second")}),(0,r.jsx)(e6,{icon:d.A,label:n("Average latency"),value:(0,$.YL)(f)}),(0,r.jsx)(e6,{icon:c.A,label:n("Success rate"),value:(0,$.Fm)(y),hint:v>0?n("{{count}} incidents in the last 24 hours",{count:v}):n("No incidents in the last 24 hours"),intent:N})]}),(0,r.jsxs)("section",{children:[(0,r.jsx)(e7,{icon:c.A,title:n("Per-group performance"),description:n("Average latency, TTFT, TPS, and success rate")}),(0,r.jsx)("div",{className:"overflow-x-auto rounded-lg border",children:(0,r.jsxs)(j.XI,{className:"text-sm",children:[(0,r.jsx)(j.A0,{children:(0,r.jsxs)(j.Hj,{className:"hover:bg-transparent",children:[(0,r.jsx)(j.nd,{className:_,children:n("Group")}),(0,r.jsx)(j.nd,{className:`${_} text-right`,children:"TPS"}),(0,r.jsx)(j.nd,{className:`${_} text-right`,children:n("Average TTFT")}),(0,r.jsx)(j.nd,{className:`${_} text-right`,children:n("Average latency")}),(0,r.jsx)(j.nd,{className:`${_} min-w-[180px] text-left`,children:n("Success rate")})]})}),(0,r.jsx)(j.BF,{children:l.map(e=>(0,r.jsxs)(j.Hj,{children:[(0,r.jsx)(j.nA,{className:"py-2.5",children:(0,r.jsx)(k.d,{group:e.group,size:"sm"})}),(0,r.jsx)(j.nA,{className:"py-2.5 text-right font-mono",children:(0,$.Y5)(e.avg_tps)}),(0,r.jsx)(j.nA,{className:"py-2.5 text-right font-mono",children:(0,$.YL)(e.avg_ttft_ms)}),(0,r.jsx)(j.nA,{className:"text-muted-foreground py-2.5 text-right font-mono",children:(0,$.YL)(e.avg_latency_ms)}),(0,r.jsx)(j.nA,{className:"py-2.5",children:(0,r.jsx)(e3,{size:"sm",series:p[e.group]??[]})})]},e.group))})]})})]}),(0,r.jsxs)("section",{children:[(0,r.jsx)(e7,{icon:d.A,title:n("Latency trend (last 24h)"),description:n("Average TTFT")}),(0,r.jsx)(e4,{series:m})]}),(0,r.jsxs)("section",{children:[(0,r.jsx)(e7,{icon:c.A,title:n("Availability (last 24h)"),description:v>0?n("Request success rate; {{incidents}} incident buckets in the last 24 hours",{incidents:v}):n("Request success rate sampled over the last 24 hours"),accent:v>0?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-amber-600 dar
185k:text-amber-400",children:[(0,r.jsx)(eX.A,{className:"size-3.5"}),n("{{count}} incidents",{count:v})]}):null}),(0,r.jsx)(e5,{series:u})]})]})}function e7(e){let t=e.icon;return(0,r.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,r.jsx)(t,{className:"text-muted-foreground/70 size-3.5 shrink-0"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"text-foreground text-sm font-semibold",children:e.title}),e.description&&(0,r.jsx)("p",{className:"text-muted-foreground/80 text-xs",children:e.description})]})]}),e.accent&&(0,r.jsx)("div",{className:"shrink-0 text-xs font-medium",children:e.accent})]})}n(78108);var e8=n(20468),te=n(95397),tt=n(40315),tn=n(92865);function tr(e){return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 align-middle",children:[(0,r.jsx)(eQ,{modalities:e.input,className:"size-3.5"}),(0,r.jsx)("span",{className:"text-muted-foreground/40",children:"→"}),(0,r.jsx)(eQ,{modalities:e.output,className:"size-3.5"})]})}function ts(e){var t;let n,{t:s}=(0,x.Bd)(),i=(t=e.metadata,n=[{key:"context",icon:e8.A,label:s("Context"),value:et(t.context_length),hint:s("Maximum input window")}],t.max_output_tokens>0&&n.push({key:"max-output",icon:te.A,label:s("Max output"),value:et(t.max_output_tokens),hint:s("Maximum tokens per response")}),n.push({key:"modalities",icon:eY.A,label:s("Modalities"),value:(0,r.jsx)(tr,{input:t.input_modalities,output:t.output_modalities})}),t.knowledge_cutoff&&n.push({key:"knowledge",icon:tt.A,label:s("Knowledge cutoff"),value:en(t.knowledge_cutoff)}),t.release_date&&n.push({key:"release",icon:tn.A,label:s("Released"),value:en(t.release_date)}),n);return(0,r.jsx)("div",{className:"bg-muted/20 grid grid-cols-2 gap-px overflow-hidden rounded-lg border @md/details:grid-cols-3 @2xl/details:grid-cols-5",children:i.map(e=>{let t=e.icon;return(0,r.jsxs)("div",{className:(0,h.cn)("bg-background flex min-w-0 flex-col gap-0.5 px-3 py-2.5"),children:[(0,r.jsxs)("span",{className:"text-muted-foreground inline-flex min-w-0 items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,r.jsx)(t,{className:"size-3 shrink-0"}),(0,r.jsx)("span",{className:"truncate",children:e.label})]}),(0,r.jsx)("span",{className:"text-foreground truncate text-sm font-semibold tabular-nums",children:e.value}),e.hint&&(0,r.jsx)("span",{className:"text-muted-foreground/60 truncate text-[10px]",children:e.hint})]},e.key)})})}function ti(e){return(0,r.jsx)("h2",{className:"text-muted-foreground mb-3 text-xs font-semibold tracking-wider uppercase",children:e.children})}let ta={function_calling:"Function calling",streaming:"Streaming",vision:"Vision",json_mode:"JSON mode",structured_output:"Structured output",reasoning:"Reasoning",tools:"Tools",system_prompt:"System prompt",web_search:"Web search",code_interpreter:"Code interpreter",caching:"Prompt caching",embeddings:"Embeddings"};function to(e){let{t}=(0,x.Bd)();return 0===e.capabilities.length?(0,r.jsx)("span",{className:"text-muted-foreground text-xs",children:t("No capabilities reported for this model.")}):(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.capabilities.map(e=>(0,r.jsx)("span",{className:"bg-muted text-muted-foreground rounded-md px-2 py-1 text-xs font-medium",children:t(ta[e]??e)},e))})}function tl(e){let{t}=(0,x.Bd)();return(0,r.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border px-3 py-2",children:[(0,r.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:t("Input")}),(0,r.jsx)(eQ,{modalities:e.input})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border px-3 py-2",children:[(0,r.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:t("Output")}),(0,r.jsx)(eQ,{modalities:e.output})]})]})}function td(e){let{t}=(0,x.Bd)();return(0,r.jsxs)("section",{children:[(0,r.jsxs)(ti,{children:[t("Capabilities")," / ",t("Supported modalities")]}),(0,r.jsxs)("div",{className:"grid gap-3 rounded-xl border p-3 @2xl/detail
185s:grid-cols-[minmax(0,1.5fr)_minmax(260px,1fr)]",children:[(0,r.jsx)(to,{capabilities:e.capabilities}),(0,r.jsx)(tl,{input:e.input,output:e.output})]})]})}function tc(e){let t=e.icon,n=e.intent??"default";return(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2 px-3 py-2",children:[(0,r.jsx)(t,{className:"text-muted-foreground/70 size-3.5 shrink-0"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-muted-foreground truncate text-[10px] font-medium tracking-wider uppercase",children:e.label}),(0,r.jsx)("div",{className:(0,h.cn)("text-foreground truncate font-mono text-sm font-semibold tabular-nums","warning"===n&&"text-amber-600 dark:text-amber-400","success"===n&&"text-emerald-600 dark:text-emerald-400"),children:e.value})]})]})}function tm(e){let{t}=(0,x.Bd)(),n=(0,i.I)({queryKey:["perf-metrics",e.model.model_name],queryFn:()=>(0,A.J)(e.model.model_name,24),staleTime:6e4}),s=n.data?.data.groups??[],a=s.map(e=>e.success_rate).filter(e=>Number.isFinite(e)),o=a.length>0?a.reduce((e,t)=>e+t,0)/a.length:NaN,l="warning";o>=99.9?l="success":o>=99&&(l="default");let m=s.map(e=>e.avg_tps).filter(e=>e>0),u=m.length>0?m.reduce((e,t)=>e+t,0)/m.length:0,p=s.map(e=>e.avg_latency_ms).filter(e=>e>0),g=p.length>0?Math.round(p.reduce((e,t)=>e+t,0)/p.length):0;return(0,r.jsxs)("div",{className:"bg-muted/20 grid overflow-hidden rounded-lg border sm:grid-cols-3 sm:divide-x",children:[(0,r.jsx)(tc,{icon:d.A,label:"TPS",value:(0,$.Y5)(u)}),(0,r.jsx)(tc,{icon:d.A,label:t("Average latency"),value:(0,$.YL)(g)}),(0,r.jsx)(tc,{icon:c.A,label:t("Success rate"),value:(0,$.Fm)(o),intent:l})]})}function tu(e){let{t}=(0,x.Bd)(),n=e.model,s=n.vendor_icon?(0,g.Y)(n.vendor_icon,20):null,i=n.description||n.vendor_description||null,a=(0,S.rL)(n.tags),o="tiered_expr"===n.billing_mode&&!!n.billing_expr&&0===(0,P.ZP)(n).length;return(0,r.jsxs)("header",{className:"pb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[s,(0,r.jsx)("h1",{className:"font-mono text-xl font-bold tracking-tight sm:text-2xl",children:n.model_name}),(0,r.jsx)(N.i,{value:n.model_name||"",className:"size-6",iconClassName:"size-3",tooltip:t("Copy model name"),successTooltip:t("Copied!"),"aria-label":t("Copy model name")})]}),(0,r.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-xs",children:[n.vendor_name&&(0,r.jsx)("span",{className:"text-muted-foreground",children:n.vendor_name}),(0,r.jsx)("span",{className:"text-muted-foreground/30",children:"·"}),(0,r.jsx)("span",{className:"text-muted-foreground/70",children:t(n.quota_type===E.LW.TOKEN?"Token-based":"Per Request")}),"tiered_expr"===n.billing_mode&&n.billing_expr&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-muted-foreground/30",children:"·"}),(0,r.jsx)("span",{className:"rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-500/20 dark:text-amber-300",children:t(o?"Special billing expression":"Dynamic Pricing")})]})]}),i&&(0,r.jsx)("p",{className:"text-muted-foreground mt-2 text-sm leading-relaxed",children:i}),a.length>0&&(0,r.jsx)("div",{className:"mt-2.5 flex flex-wrap gap-1",children:a.map(e=>(0,r.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-2 py-0.5 text-[11px] font-medium",children:e},e))})]})}function tp(e){let{t}=(0,x.Bd)(),n=(0,K.ow)(e.model),s="K"===e.tokenUnit?"1K":"1M",i="_base",a={[i]:1},o=(0,P.kK)(e.model,{tokenUnit:e.tokenUnit,showRechargePrice:e.showRechargePrice,priceRate:e.priceRate,usdExchangeRate:e.usdExchangeRate,groupRatioMultiplier:1}),l=[{label:t("Input"),type:"input"},{label:t("Output"),type:"output"}],d=[{label:t("Cached input"),type:"cache",available:null!=e.model.cache_ratio},{label:t("Cache write"),type:"create_cache",available:null!=e.model.create_cache_ratio},{label:t("Image input"),type:"image",available:null!=e.model.image_ratio},{label:t("Audio input"),type:"audio_input",available:null!=e.model.audio_ratio},{label:t("Audio output"),type:"audio_output",available:null!=e.model.audio_ratio&&null!=e.model.audio_completion_ratio}];if(o)return o.isSpecialExpression?(0,r.jsxs)("section",{children:[(0,r.jsx)(ti,{children:t("Base Price")}),(0,r.jsxs)("div",{className:"rounded-lg border border-amber-200/70 bg-amber-50/70 p-3 dark:border-amber-500/20 dark:bg-amber-500/10",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:t("Special billing expression")}),(0,r.jsx)("p",{className:"text-muted-foreground mt-1 text-xs",children:t("Unable to parse structured pricing")}),(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("div",{className:"text-muted-foreground mb-1 text-[10px] font-medium tracking-wider up
185percase",children:t("Raw expression")}),(0,r.jsx)("code",{className:"text-muted-foreground bg-background/80 block max-h-28 overflow-auto rounded-md border px-2 py-1.5 font-mono text-xs break-all",children:o.rawExpression})]})]})]}):(0,r.jsxs)("section",{children:[(0,r.jsx)(ti,{children:t("Base Price")}),o.primaryEntries.length>0?(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.primaryEntries.map(e=>(0,r.jsxs)("div",{className:"bg-muted/20 rounded-lg border p-3",children:[(0,r.jsx)("div",{className:"text-muted-foreground text-xs",children:t(e.shortLabel)}),(0,r.jsxs)("div",{className:"text-foreground mt-1 font-mono text-base font-semibold tabular-nums",children:[e.formatted,(0,r.jsxs)("span",{className:"text-muted-foreground/40 ml-1 text-xs font-normal",children:["/ ",s]})]})]},e.key))}):(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:t("Dynamic Pricing")}),o.secondaryEntries.length>0&&(0,r.jsx)("div",{className:"bg-muted/20 mt-3 rounded-lg border px-3 py-2.5",children:(0,r.jsx)("div",{className:"space-y-1.5",children:o.secondaryEntries.map(e=>(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-4",children:[(0,r.jsx)("span",{className:"text-muted-foreground/70 text-sm",children:t(e.shortLabel)}),(0,r.jsxs)("span",{className:"text-muted-foreground font-mono text-sm tabular-nums",children:[e.formatted,(0,r.jsxs)("span",{className:"text-muted-foreground/40 ml-1 text-xs font-normal",children:["/ ",s]})]})]},e.key))})})]});if(!n)return(0,r.jsxs)("section",{children:[(0,r.jsx)(ti,{children:t("Base Price")}),(0,r.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,r.jsx)("span",{className:"text-muted-foreground text-sm",children:t("Per request")}),(0,r.jsx)("span",{className:"text-foreground font-mono text-sm font-semibold tabular-nums",children:(0,eo.PB)(e.model,i,e.showRechargePrice,e.priceRate,e.usdExchangeRate,a)})]})]});let c=d.filter(e=>e.available),m=t=>(0,r.jsxs)(r.Fragment,{children:[(0,eo.e$)(e.model,i,t,e.tokenUnit,e.showRechargePrice,e.priceRate,e.usdExchangeRate,a),(0,r.jsxs)("span",{className:"text-muted-foreground/40 ml-1 text-xs font-normal",children:["/ ",s]})]});return(0,r.jsxs)("section",{children:[(0,r.jsx)(ti,{children:t("Base Price")}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2",children:l.map(e=>(0,r.jsxs)("div",{className:"bg-muted/20 rounded-lg border p-3",children:[(0,r.jsx)("div",{className:"text-muted-foreground text-xs",children:e.label}),(0,r.jsx)("div",{className:"text-foreground mt-1 font-mono text-base font-semibold tabular-nums",children:m(e.type)})]},e.type))}),c.length>0&&(0,r.jsx)("div",{className:"bg-muted/20 mt-3 rounded-lg border px-3 py-2.5",children:(0,r.jsx)("div",{className:"space-y-1.5",children:c.map(e=>(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-4",children:[(0,r.jsx)("span",{className:"text-muted-foreground/70 text-sm",children:e.label}),(0,r.jsx)("span",{className:"text-muted-foreground font-mono text-sm tabular-nums",children:m(e.type)})]},e.type))})})]})}function tx(e){let{t}=(0,x.Bd)(),n=Array.isArray(e.model.enable_groups)?e.model.enable_groups:[],s=e.autoGroups.filter(e=>n.includes(e));return 0===s.length?null:(0,r.jsxs)("div",{className:"text-muted-foreground mb-3 flex flex-wrap items-center gap-1 text-xs",children:[(0,r.jsx)("span",{className:"font-medium",children:t("Auto Group Chain")}),(0,r.jsx)("span",{className:"text-muted-foreground/40",children:"→"}),s.map((e,t)=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(k.d,{group:e,size:"sm"}),t<s.length-1&&(0,r.jsx)("span",{className:"text-muted-foreground/40",children:"→"})]},e))]})}function tg(e){let{t}=(0,x.Bd)(),n=e.showRechargePrice??!1,i=(0,s.useMemo)(()=>(0,K.sK)(e.model,e.usableGroup||{}),[e.model,e.usableGroup]),a=(0,K.ow)(e.model),o="K"===e.tokenUnit?"1K":"1M",l=(0,s.useMemo)(()=>{let n=[];return null!=e.model.cache_ratio&&n.push({label:t("Cache"),type:"cache"}),null!=e.model.create_cache_ratio&&n.push({label:t("Cache Write"),type:"create_cache"}),null!=e.model.image_ratio&&n.push({label:t("Image"),type:"image"}),null!=e.model.audio_ratio&&n.push({label:t("Audio In"),type:"audio_input"}),null!=e.model.audio_ratio&&null!=e.model.audio_completion_ratio&&n.push({label:t("Audio Out"),type:"audio_output"}),n},[e.model,t]);if(0===i.length)return(0,r.jsxs)("section",{children:[(0,r.jsx)(ti,{children:t("Pricing by Group")}),(0,r.jsx)(tx,{model:e.model,autoGroups:e.autoGroups}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:t("This model is not available in any group, or no group pricing information is configured.")})]});let d="text-muted-foreground py-2 text-[10px] font-medium tracking-wider up
185percase";if((0,P.h8)(e.model)){let s=(0,P.ZP)(e.model);if(0===s.length)return(0,r.jsxs)("section",{children:[(0,r.jsx)(ti,{children:t("Pricing by Group")}),(0,r.jsx)(tx,{model:e.model,autoGroups:e.autoGroups}),(0,r.jsxs)("div",{className:"rounded-lg border border-amber-200/70 bg-amber-50/70 p-3 dark:border-amber-500/20 dark:bg-amber-500/10",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:t("Special billing expression")}),(0,r.jsx)("p",{className:"text-muted-foreground mt-1 text-xs",children:t("Group prices cannot be expanded because this expression is not a standard tiered pricing expression.")}),(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("div",{className:"text-muted-foreground mb-1 text-[10px] font-medium tracking-wider uppercase",children:t("Raw expression")}),(0,r.jsx)("code",{className:"text-muted-foreground bg-background/80 block max-h-28 overflow-auto rounded-md border px-2 py-1.5 font-mono text-xs break-all",children:e.model.billing_expr})]})]})]});let a=Array.from(new Map(s.flatMap(t=>(0,P.XY)(t,{tokenUnit:e.tokenUnit,showRechargePrice:n,priceRate:e.priceRate,usdExchangeRate:e.usdExchangeRate,groupRatioMultiplier:1})).map(e=>[e.field,e])).values());return(0,r.jsxs)("section",{children:[(0,r.jsx)(ti,{children:t("Pricing by Group")}),(0,r.jsx)(tx,{model:e.model,autoGroups:e.autoGroups}),(0,r.jsxs)("div",{className:"space-y-3",children:[i.map(i=>{let o=e.groupRatio[i]||1;return(0,r.jsxs)("div",{className:"overflow-hidden rounded-lg border",children:[(0,r.jsxs)("div",{className:"bg-muted/20 flex items-center justify-between gap-3 border-b px-3 py-2",children:[(0,r.jsx)(k.d,{group:i,size:"sm"}),(0,r.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:[o,"x"]})]}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)(j.XI,{className:"text-sm",children:[(0,r.jsx)(j.A0,{children:(0,r.jsxs)(j.Hj,{className:"hover:bg-transparent",children:[(0,r.jsx)(j.nd,{className:d,children:t("Tier")}),a.map(e=>(0,r.jsx)(j.nd,{className:`${d} text-right`,children:t(e.shortLabel)},e.field))]})}),(0,r.jsx)(j.BF,{children:s.map((s,l)=>{let d=new Map((0,P.XY)(s,{tokenUnit:e.tokenUnit,showRechargePrice:n,priceRate:e.priceRate,usdExchangeRate:e.usdExchangeRate,groupRatioMultiplier:o}).map(e=>[e.field,e]));return(0,r.jsxs)(j.Hj,{children:[(0,r.jsx)(j.nA,{className:"text-muted-foreground py-2.5",children:s.label||t("Default")}),a.map(e=>{let t=d.get(e.field);return(0,r.jsx)(j.nA,{className:"py-2.5 text-right font-mono",children:t?.formatted??"-"},e.field)})]},`${i}-${s.label||l}`)})})]})})]},i)}),(0,r.jsxs)("p",{className:"text-muted-foreground/40 mt-1.5 text-[10px]",children:[t("Prices shown per")," ",o," tokens"]})]})]})}return(0,r.jsxs)("section",{children:[(0,r.jsx)(ti,{children:t("Pricing by Group")}),(0,r.jsx)(tx,{model:e.model,autoGroups:e.autoGroups}),(0,r.jsxs)("div",{className:"-mx-4 overflow-x-auto sm:mx-0",children:[(0,r.jsxs)(j.XI,{className:"text-sm",children:[(0,r.jsx)(j.A0,{children:(0,r.jsxs)(j.Hj,{className:"hover:bg-transparent",children:[(0,r.jsx)(j.nd,{className:d,children:t("Group")}),(0,r.jsx)(j.nd,{className:d,children:t("Ratio")}),a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.nd,{className:`${d} text-right`,children:t("Input")}),(0,r.jsx)(j.nd,{className:`${d} text-right`,children:t("Output")}),l.map(e=>(0,r.jsx)(j.nd,{className:`${d} text-right`,children:e.label},e.type))]}):(0,r.jsx)(j.nd,{className:`${d} text-right`,children:t("Price")})]})}),(0,r.jsx)(j.BF,{children:i.map(t=>{let s=e.groupRatio[t]||1;return(0,r.jsxs)(j.Hj,{children:[(0,r.jsx)(j.nA,{className:"py-2.5",children:(0,r.jsx)(k.d,{group:t,size:"sm"})}),(0,r.jsxs)(j.nA,{className:"text-muted-foreground py-2.5 font-mono",children:[s,"x"]}),a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.nA,{className:"py-2.5 text-right font-mono",children:(0,eo.e$)(e.model,t,"input",e.tokenUnit,n,e.priceRate,e.usdExchangeRate,e.groupRatio)}),(0,r.jsx)(j.nA,{className:"py-2.5 text-right font-mono",children:(0,eo.e$)(e.model,t,"output",e.tokenUnit,n,e.priceRate,e.usdExchangeRate,e.groupRatio)}),l.map(s=>(0,r.jsx)(j.nA,{className:"py-2.5 text-right font-mono",children:(0,eo.e$)(e.model,t,s.type,e.tokenUnit,n,e.priceRate,e.usdExchangeRate,e.groupRatio)},s.type))]}):(0,r.jsx)(j.nA,{className:"py-2.5 text-right font-mono",children:(0,eo.PB)(e.model,t,n,e.priceRate,e.usdExchangeRate,e.groupRatio)})]},t)})})]}
185),a&&(0,r.jsxs)("p",{className:"text-muted-foreground/40 mt-1.5 px-4 text-[10px] sm:px-0",children:[t("Prices shown per")," ",o," tokens"]})]})]})}let th=["overview","performance","api"],tf={overview:{icon:m.A,labelKey:"Overview"},performance:{icon:c.A,labelKey:"Performance"},api:{icon:u.A,labelKey:"API"}};function tb(e){let{t}=(0,x.Bd)(),n=e.showRechargePrice??!1,i=(0,s.useMemo)(()=>{var t,n;let r,s,i,a,o,l,d,c,m,u;return s=T(M(r=(t=e.model).model_name||"")),i=(n=t.tags)?n.split(/[,;|\s]+/).map(e=>e.trim().toLowerCase()).filter(Boolean):[],a=t.supported_endpoint_types||[],o=t.input_modalities??function(e,t,n,r){let s=new Set;for(let i of((0===n.length||n.some(e=>O.has(e)))&&s.add("text"),(null!=e.image_ratio||X(r,B))&&s.add("image"),(null!=e.audio_ratio||X(r,U))&&s.add("audio"),X(r,F)&&s.add("video"),t)){let e=W[i];e&&s.add(e)}return 0===s.size&&s.add("text"),Z(s)}(t,i,a,r),d=t.output_modalities??(l=new Set,a.some(e=>I.has(e))&&l.add("image"),a.some(e=>L.has(e))&&l.add("video"),a.some(e=>C.has(e))&&l.add("text"),(null!=t.audio_completion_ratio||/tts|voice|audio-out/i.test(r))&&l.add("audio"),0===l.size&&l.add("text"),Z(l)),c=t.capabilities??function(e,t,n,r,s,i){let a=new Set;for(let o of(s.includes("text")&&!n.includes("image-generation")&&(a.add("streaming"),a.add("system_prompt")),n.includes("image-generation")||n.includes("embeddings")||n.includes("jina-rerank")||(a.add("function_calling"),a.add("tools"),a.add("json_mode"),a.add("structured_output")),i.includes("image")&&a.add("vision"),null!=e.cache_ratio&&a.add("caching"),n.some(e=>C.has(e))&&a.add("embeddings"),X(r,z)&&a.add("reasoning"),X(r,G)&&a.add("code_interpreter"),X(r,q)&&a.add("web_search"),t)){let e=J[o];e&&a.add(e)}return Array.from(a)}(t,i,a,r,d,o),m=function(e,t,n){if(n.includes("embeddings")||n.includes("jina-rerank"))return{context:8192,maxOutput:0};if(n.includes("image-generation")||n.includes("openai-video"))return{context:4096,maxOutput:0};let r=e.toLowerCase();if(r.includes("1m")||r.includes("-long")||/claude.*(?:4|opus|sonnet)/.test(r))return{context:1e6,maxOutput:65536};if(r.includes("200k")||r.includes("claude-3")||r.includes("claude-4"))return{context:2e5,maxOutput:16384};if(r.includes("128k")||/gpt-4o|gpt-4\.1|gpt-5|o1|o3|o4/.test(r))return{context:128e3,maxOutput:16384};if(/gemini.*-2|gemini.*pro|gemini.*flash/.test(r))return{context:1e6,maxOutput:8192};if(/gpt-3\.5|claude-2/.test(r))return{context:16384,maxOutput:4096};let s=Q(V,t),i=Math.min(s,Q(Y,t));return{context:s,maxOutput:i}}(r,s,a),u=function(e){let t=Q(H,e),[n,r]=t.split("-").map(Number),s=r+(4+Math.floor(6*e())),i=n+Math.floor((s-1)/12);return{release:`${i}-${String((s-1)%12+1).padStart(2,"0")}-15`,cutoff:t}}(s),{context_length:t.context_length??m.context,max_output_tokens:t.max_output_tokens??m.maxOutput,knowledge_cutoff:t.knowledge_cutoff??u.cutoff,release_date:t.release_date??u.release,parameter_count:t.parameter_count??Q(D,s),input_modalities:o,output_modalities:d,capabilities:c}},[e.model]),a="tiered_expr"===e.model.billing_mode&&!!e.model.billing_expr;return(0,r.jsxs)("div",{className:"@container/details space-y-4",children:[(0,r.jsx)(tu,{model:e.model}),(0,r.jsxs)(v.tU,{defaultValue:"overview",className:"gap-4",children:[(0,r.jsx)(v.j7,{className:"bg-muted/60 grid w-full grid-cols-3 gap-1 rounded-lg p-1 group-data-horizontal/tabs:h-auto",children:th.map(e=>{let n=tf[e].icon;return(0,r.jsxs)(v.Xi,{value:e,className:"h-8 min-w-0 gap-1.5 rounded-md px-3 text-xs sm:text-sm",children:[(0,r.jsx)(n,{className:"size-3.5"}),(0,r.jsx)("span",{className:"truncate",children:t(tf[e].labelKey)})]},e)})}),(0,r.jsxs)(v.av,{value:"overview",className:"space-y-6 outline-none",children:[(0,r.jsx)(tm,{model:e.model}),(0,r.jsxs)("section",{className:"bg-card/60 space-y-5 rounded-xl border p-4 shadow-sm",children:[(0,r.jsx)(ti,{children:t("Pricing")}),(0,r.jsx)(tp,{model:e.model,priceRate:e.priceRate,usdExchangeRate:e.usdExchangeRate,tokenUnit:e.tokenUnit,showRechargePrice:n}),a&&(0,r.jsx)(el.N,{billingExpr:e.model.billing_expr}),(0,r.jsx)(tg,{model:e.model,groupRatio:e.groupRatio,usableGroup:e.usableGroup,autoGroups:e.autoGroups,priceRate:e.priceRate,usdExchangeRate:e.usdExchangeRate,tokenUnit:e.tokenUnit,showRechargePrice:n})]}),(0,r.jsx)(ts,{metadata:i}
185),(0,r.jsx)(td,{capabilities:i.capabilities,input:i.input_modalities,output:i.output_modalities}),(0,r.jsx)(ez,{model:e.model})]}),(0,r.jsx)(v.av,{value:"performance",className:"outline-none",children:(0,r.jsx)(e9,{model:e.model})}),(0,r.jsx)(v.av,{value:"api",className:"outline-none",children:(0,r.jsx)(eF,{model:e.model,endpointMap:e.endpointMap})})]})]})}function ty(e){let{t}=(0,x.Bd)(),{open:n,onOpenChange:s,...i}=e;return(0,r.jsx)(b.cj,{open:n,onOpenChange:s,children:(0,r.jsxs)(b.h,{side:"right",className:(0,_.jW)("sm:max-w-2xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-5xl"),children:[(0,r.jsxs)(b.Fm,{className:"sr-only",children:[(0,r.jsx)(b.qp,{children:e.model.model_name}),(0,r.jsx)(b.Qs,{children:t("Model details")})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto px-4 pt-11 pb-5 sm:px-6 sm:pt-12 sm:pb-6",children:(0,r.jsx)(tb,{...i})})]})})}function tj(){let{t:e}=(0,x.Bd)(),{modelId:t}=(0,a.g)({from:"/pricing/$modelId/"}),n=(0,o.S)({from:"/pricing/$modelId/"}),i=(0,l.Z)(),{models:d,groupRatio:c,usableGroup:m,endpointMap:u,autoGroups:g,isLoading:h,priceRate:b,usdExchangeRate:j}=(0,R.y)(),v="K"===n.tokenUnit?"K":"M",N=(0,s.useMemo)(()=>d&&t&&d.find(e=>e.model_name===t)||null,[d,t]),_=()=>{i({to:"/pricing",search:n})};return h?(0,r.jsx)(w.si,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-5xl px-4 sm:px-6",children:[(0,r.jsx)(y.E,{className:"mb-4 h-5 w-16"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(y.E,{className:"h-7 w-64"}),(0,r.jsx)(y.E,{className:"h-4 w-40"}),(0,r.jsx)(y.E,{className:"h-4 w-full max-w-md"})]}),(0,r.jsx)("div",{className:"mt-6 grid grid-cols-2 gap-2 sm:grid-cols-4",children:Array.from({length:4}).map((e,t)=>(0,r.jsx)(y.E,{className:"h-16 w-full"},t))}),(0,r.jsx)("div",{className:"mt-6 space-y-3",children:Array.from({length:4}).map((e,t)=>(0,r.jsx)(y.E,{className:"h-24 w-full"},t))})]})}):N?(0,r.jsx)(w.si,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-5xl px-4 sm:px-6",children:[(0,r.jsxs)(f.$,{variant:"ghost",size:"sm",onClick:_,className:"text-muted-foreground hover:text-foreground mb-4 h-auto gap-1 px-0 py-1 text-xs",children:[(0,r.jsx)(p.A,{className:"size-3.5"}),e("Back")]}),(0,r.jsx)(tb,{model:N,groupRatio:c||{},usableGroup:m||{},autoGroups:g||[],priceRate:b??1,usdExchangeRate:j??1,tokenUnit:v,showRechargePrice:n.rechargePrice??!1,endpointMap:u||{}})]})}):(0,r.jsx)(w.si,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-2xl px-4 text-center sm:px-6",children:[(0,r.jsx)("h2",{className:"mb-1 text-base font-semibold",children:e("Model not found")}),(0,r.jsx)("p",{className:"text-muted-foreground mb-4 text-sm",children:e("The model you're looking for doesn't exist.")}),(0,r.jsx)(f.$,{onClick:_,variant:"outline",size:"sm",children:e("Back to Models")})]})})}},54909(e,t,n){n.d(t,{$P:()=>m,An:()=>d,LW:()=>c,QB:()=>r,SZ:()=>a,WU:()=>s,fb:()=>l,pV:()=>u,s4:()=>o,zH:()=>i});let r={NAME:"name",PRICE_LOW:"price-low",PRICE_HIGH:"price-high"};function s(e){return{[r.NAME]:e("Name"),[r.PRICE_LOW]:e("Price: Low to High"),[r.PRICE_HIGH]:e("Price: High to Low")}}let i={ALL:"all",TOKEN:"token",REQUEST:"request"};function a(e){return{[i.ALL]:e("All Models"),[i.TOKEN]:e("Token-based"),[i.REQUEST]:e("Per Request")}}let o={ALL:"all",OPENAI:"openai",OPENAI_RESPONSE:"openai-response",ANTHROPIC:"anthropic",GEMINI:"gemini",JINA_RERANK:"jina-rerank",IMAGE_GENERATION:"image-generation",EMBEDDINGS:"embeddings",OPENAI_VIDEO:"openai-video"};function l(e){return{[o.ALL]:e("All Types"),[o.OPENAI]:"Chat",[o.OPENAI_RESPONSE]:"Response",[o.ANTHROPIC]:"Anthropic",[o.GEMINI]:"Gemini",[o.JINA_RERANK]:"Rerank",[o.IMAGE_GENERATION]:e("Image"),[o.EMBEDDINGS]:e("Embeddings"),[o.OPENAI_VIDEO]:e("Video")}}let d=["","auto"],c={TOKEN:0,REQUEST:1},m={M:1,K:1e3},u={CARD:"card",TABLE:"table"}},84473(e,t,n){n.d(t,{y:()=>l});var r=n(68413),s=n(53540),i=n(30464),a=n(64577);async function o(){return(await a.FH.get("/api/pricing")).data}function l(){let{status:e}=(0,i.s)(),{data:t,isLoading:n,error:a,refetch:l}=(0,s.I)({queryKey:["pricing"],queryFn:o,staleTime:3e5}),d=(0,r.useMemo)(()=>Math.max(e?.price??1,.001),[e?.price]),c=(0,r.useMemo)(()=>Math.max(e?.usd_exchange_rate??d,.001),[e?.usd_exchange_rate,d]);return{models:(0,r.useMemo)(()=>
185{if(!t?.data||!t?.vendors)return[];let e=new Map(t.vendors.map(e=>[e.id,e]));return t.data.map(n=>{let r=n.vendor_id?e.get(n.vendor_id):void 0;return{...n,key:n.model_name,vendor_name:r?.name,vendor_icon:r?.icon,vendor_description:r?.description,group_ratio:t.group_ratio}})},[t]),vendors:t?.vendors??[],groupRatio:t?.group_ratio??{},usableGroup:t?.usable_group??{},endpointMap:t?.supported_endpoint??{},autoGroups:t?.auto_groups??[],isLoading:n,error:a,refetch:l,priceRate:d,usdExchangeRate:c}}},55621(e,t,n){n.d(t,{XY:()=>c,ZP:()=>d,h8:()=>o,kK:()=>m,kt:()=>l});var r=n(52946),s=n(54909),i=n(97723);let a=new Set(["inputPrice","outputPrice"]);function o(e){return"tiered_expr"===e.billing_mode&&!!e.billing_expr}function l(e){let t=Array.isArray(e.enable_groups)?e.enable_groups:[],n=e.group_ratio||{};if(0===t.length)return 1;let r=1/0;for(let e of t){let t=n[e];void 0!==t&&t<r&&(r=t)}return r===1/0?1:r}function d(e){if(!o(e))return[];let{billingExpr:t}=(0,i.U8)(e.billing_expr||"");return(0,i.oK)(t)}function c(e,t){return e?i.mq.flatMap(n=>{var i,a;let o,l,d,c;if(!n.field)return[];let m=Number(e[n.field]);return!Number.isFinite(m)||m<=0?[]:[{key:n.key,field:n.field,label:n.label,shortLabel:n.shortLabel,value:m,formatted:(o=t.groupRatioMultiplier??1,l=t.priceRate??1,d=t.usdExchangeRate??1,i=m*o/s.$P[t.tokenUnit],a=t.showRechargePrice??!1,c=a?i*l/d:i,(0,r.AM)(c,{digitsLarge:4,digitsSmall:6,abbreviate:!1})),variable:n}]}).sort((e,t)=>{let n=a.has(e.field);return n!==a.has(t.field)?n?-1:1:0}):[]}function m(e,t){if(!o(e))return null;let n=d(e),r=n[0]||null,s=c(r,t),l=e.billing_expr||"";return{tiers:n,tier:r,tierCount:n.length,hasRequestRules:function(e){if(!o(e))return!1;let{requestRuleExpr:t}=(0,i.U8)(e.billing_expr||"");return!!(0,i.TS)(t||"")?.length}(e),isSpecialExpression:l.trim().length>0&&0===n.length,rawExpression:l,entries:s,primaryEntries:s.filter(e=>a.has(e.field)),secondaryEntries:s.filter(e=>!a.has(e.field))}}},27303(e,t,n){n.d(t,{Mt:()=>o,mv:()=>i,rL:()=>a});var r=n(54909);function s(e){return 0===e.quota_type?e.model_ratio:e.model_price||0}function i(e,t){var n,i,o,l,d,c;let m=function(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.model_name?.toLowerCase().includes(n)||e.description?.toLowerCase().includes(n)||e.tags?.toLowerCase().includes(n)||e.vendor_name?.toLowerCase().includes(n))}(e,t.search);return n=m,o=m="all"===(i=t.vendor)?n:n.filter(e=>e.vendor_name===i),d=m=function(e,t){if(t===r.zH.ALL)return e;let n=t===r.zH.TOKEN?r.LW.TOKEN:r.LW.REQUEST;return e.filter(e=>e.quota_type===n)}(m="all"===(l=t.group)?o:o.filter(e=>e.enable_groups?.includes(l)),t.quotaType),m=function(e,t){let n=[...e];switch(t){case r.QB.NAME:n.sort((e,t)=>(e.model_name||"").localeCompare(t.model_name||""));break;case r.QB.PRICE_LOW:n.sort((e,t)=>s(e)-s(t));break;case r.QB.PRICE_HIGH:n.sort((e,t)=>s(t)-s(e))}return n}(m=function(e,t){if("all"===t)return e;let n=t.toLowerCase();return e.filter(e=>!!e.tags&&a(e.tags).map(e=>e.toLowerCase()).includes(n))}(m=(c=t.endpointType)===r.s4.ALL?d:d.filter(e=>e.supported_endpoint_types?.includes(c)),t.tag),t.sortBy)}function a(e){return e?e.split(/[,;|\s]+/).map(e=>e.trim()).filter(Boolean):[]}function o(e){let t=new Set;return e.forEach(e=>{e.tags&&a(e.tags).forEach(e=>{t.add(e.toLowerCase())})}),Array.from(t).sort((e,t)=>e.localeCompare(t))}},71773(e,t,n){n.d(t,{Oi:()=>i,ow:()=>a,sK:()=>s});var r=n(54909);function s(e,t){let n=Array.isArray(e.enable_groups)?e.enable_groups:[];return Object.keys(t).filter(e=>!r.An.includes(e)).filter(e=>n.includes(e))}function i(e,t){return e.replace(/\{model\}/g,t)}function a(e){return e.quota_type===r.LW.TOKEN}},17257(e,t,n){n.d(t,{$g:()=>d,CG:()=>i,PB:()=>m,Yj:()=>u,e$:()=>c});var r=n(52946),s=n(54909);function i(e){let t=e.match(/^([^\d-]*)([-\d,]+\.?\d*)(k?)$/);if(!t)return e;let[,n,r,s]=t,i=parseFloat(r.replace(/,/g,""));if(isNaN(i))return e;let a=i.toString();return a.includes("e")&&(a=i.toFixed(20).replace(/\.?0+$/,"")),`${n}${a}${s}`}function a(e,t){if(0===e.length)return 1;let n=1/0;for(let r of e){let e=t[r];void 0!==e&&e<n&&(n=e)}return n===1/0?1:n}function o(e,t,n){let r=2*e.model_ratio*n;switch(t){case"input":return r;case"output":return r*e.completion_ratio;
185case"cache":return l(e.cache_ratio)?r*Number(e.cache_ratio):NaN;case"create_cache":return l(e.create_cache_ratio)?r*Number(e.create_cache_ratio):NaN;case"image":return l(e.image_ratio)?r*Number(e.image_ratio):NaN;case"audio_input":return l(e.audio_ratio)?r*Number(e.audio_ratio):NaN;case"audio_output":return l(e.audio_ratio)&&l(e.audio_completion_ratio)?r*Number(e.audio_ratio)*Number(e.audio_completion_ratio):NaN}}function l(e){return null!=e&&Number.isFinite(Number(e))}function d(e,t,n){var i,l,d,c;let m=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,p=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;if(e.quota_type===s.LW.REQUEST)return"-";let x=a(Array.isArray(e.enable_groups)?e.enable_groups:[],e.group_ratio||{}),g=o(e,t,x),h=(i=g,l=m,d=u,c=p,(g=l?i*d/c:i)/s.$P[n]);return(0,r.J5)(h,{digitsLarge:4,digitsSmall:6,abbreviate:!1})}function c(e,t,n,i){var a,l,d,c;let m=arguments.length>4&&void 0!==arguments[4]&&arguments[4],u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,p=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,x=arguments.length>7?arguments[7]:void 0;if(e.quota_type===s.LW.REQUEST)return"-";let g=o(e,n,x[t]||1),h=(a=g,l=m,d=u,c=p,(g=l?a*d/c:a)/s.$P[i]);return(0,r.J5)(h,{digitsLarge:4,digitsSmall:6,abbreviate:!1})}function m(e,t){var n,i,a,o;let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,m=arguments.length>5?arguments[5]:void 0;if(e.quota_type!==s.LW.REQUEST)return"-";let u=m[t]||1,p=(e.model_price||0)*u;return n=p,i=l,a=d,o=c,p=i?n*a/o:n,(0,r.J5)(p,{digitsLarge:4,digitsSmall:4,abbreviate:!1})}function u(e){var t,n,i,o;let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e.quota_type!==s.LW.REQUEST)return"-";let m=a(Array.isArray(e.enable_groups)?e.enable_groups:[],e.group_ratio||{}),u=(e.model_price||0)*m;return t=u,n=l,i=d,o=c,u=n?t*i/o:t,(0,r.J5)(u,{digitsLarge:4,digitsSmall:4,abbreviate:!1})}},86119(e,t,n){n.d(t,{P:()=>s});var r=n(68413);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"--radius-md",t=arguments.length>1?arguments[1]:void 0,[n,s]=(0,r.useState)();return(0,r.useEffect)(()=>{s(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"--radius-md";if("u"<typeof document)return;let t=document.createElement("div");t.style.borderRadius=`var(${e})`,t.style.pointerEvents="none",t.style.position="absolute",t.style.visibility="hidden",document.documentElement.appendChild(t);let n=getComputedStyle(t).borderTopLeftRadius;t.remove();let r=Number.parseFloat(n);return Number.isFinite(r)?r:void 0}(e))},[e,t]),n}},96087(e,t,n){n.d(t,{R:()=>a});var r=n(68413),s=n(4288);let i=null;function a(){let{resolvedTheme:e}=(0,s.D)(),[t,a]=(0,r.useState)(!1),o=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let t=!1;return(async()=>{a(!1),i||(i=Promise.resolve().then(n.bind(n,59668)).then(e=>e.ThemeManager));let r=await i;t||(o.current=r,r.setCurrentTheme("dark"===e?"dark":"light"),a(!0))})(),()=>{t=!0}},[e]),{resolvedTheme:e,themeReady:t}}},77935(e,t,n){n.d(t,{X:()=>r});let r={mode:"desktop-browser"}}}]);

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.