@tombcato/ai-selector-vue 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +522 -1230
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +3 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +39 -39
- package/dist/index.umd.cjs +0 -3
- package/dist/index.umd.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,897 +1,189 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
selectProvider: "选择 Provider...",
|
|
9
|
-
customBaseUrl: "自定义 Base URL",
|
|
10
|
-
apiKeyLabel: "API Key",
|
|
11
|
-
apiKeyPlaceholder: "输入 API Key...",
|
|
12
|
-
testConnection: "测试模型连接",
|
|
13
|
-
testing: "测试中...",
|
|
14
|
-
testSuccess: "连接成功",
|
|
15
|
-
testFailed: "测试连通性失败",
|
|
16
|
-
selectModel: "选择 Model...",
|
|
17
|
-
searchModel: "搜索或自定义模型...",
|
|
18
|
-
useCustom: "使用自定义",
|
|
19
|
-
noModels: "暂无模型数据",
|
|
20
|
-
apiKeyTip: "输入 API Key 后可获取完整模型列表",
|
|
21
|
-
fetchModelsFailed: "拉取模型列表失败,已使用离线模型列表",
|
|
22
|
-
refreshingModels: "列表刷新中...",
|
|
23
|
-
modelListUpdated: "模型列表已刷新",
|
|
24
|
-
preview: "配置预览",
|
|
25
|
-
unselected: "(未选择)"
|
|
26
|
-
},
|
|
27
|
-
en: {
|
|
28
|
-
save: "Save Config",
|
|
29
|
-
saved: "Saved",
|
|
30
|
-
providerLabel: "Provider",
|
|
31
|
-
modelLabel: "Model",
|
|
32
|
-
selectProvider: "Select Provider...",
|
|
33
|
-
customBaseUrl: "Custom Base URL",
|
|
34
|
-
apiKeyLabel: "API Key",
|
|
35
|
-
apiKeyPlaceholder: "Enter API Key...",
|
|
36
|
-
testConnection: "Test Model Connection",
|
|
37
|
-
testing: "Testing...",
|
|
38
|
-
testSuccess: "Connection Successful",
|
|
39
|
-
testFailed: "Connection Failed",
|
|
40
|
-
selectModel: "Select Model...",
|
|
41
|
-
searchModel: "Search or custom models...",
|
|
42
|
-
useCustom: "Use custom",
|
|
43
|
-
noModels: "No models found",
|
|
44
|
-
apiKeyTip: "Enter API Key to fetch full model list",
|
|
45
|
-
fetchModelsFailed: "Failed to fetch model list, using offline models",
|
|
46
|
-
refreshingModels: "Refreshing models...",
|
|
47
|
-
modelListUpdated: "Model list updated",
|
|
48
|
-
preview: "Config Preview",
|
|
49
|
-
unselected: "(Unselected)"
|
|
50
|
-
}
|
|
51
|
-
}, O = "https://registry.npmmirror.com/@lobehub/icons-static-svg/1.77.0/files/icons", o = {
|
|
52
|
-
OPENAI: "openai",
|
|
53
|
-
ANTHROPIC: "anthropic",
|
|
54
|
-
GEMINI: "gemini",
|
|
55
|
-
DEEPSEEK: "deepseek",
|
|
56
|
-
OPENROUTER: "openrouter",
|
|
57
|
-
GROQ: "groq",
|
|
58
|
-
MISTRAL: "mistral",
|
|
59
|
-
MOONSHOT: "moonshot",
|
|
60
|
-
QWEN: "qwen",
|
|
61
|
-
ZHIPU: "zhipu",
|
|
62
|
-
SILICONFLOW: "siliconflow",
|
|
63
|
-
XAI: "xai",
|
|
64
|
-
TOGETHER: "together",
|
|
65
|
-
FIREWORKS: "fireworks",
|
|
66
|
-
DEEPINFRA: "deepinfra",
|
|
67
|
-
PERPLEXITY: "perplexity",
|
|
68
|
-
COHERE: "cohere",
|
|
69
|
-
OLLAMA: "ollama",
|
|
70
|
-
DOUBAO: "doubao",
|
|
71
|
-
MINIMAX: "minimax"
|
|
72
|
-
}, pe = {
|
|
73
|
-
[o.OPENAI]: {
|
|
74
|
-
id: o.OPENAI,
|
|
75
|
-
name: "OpenAI",
|
|
76
|
-
baseUrl: "https://api.openai.com/v1",
|
|
77
|
-
needsApiKey: !0,
|
|
78
|
-
apiFormat: "openai",
|
|
79
|
-
supportsModelsApi: !0,
|
|
80
|
-
icon: `${O}/openai.svg`
|
|
81
|
-
},
|
|
82
|
-
[o.ANTHROPIC]: {
|
|
83
|
-
id: o.ANTHROPIC,
|
|
84
|
-
name: "Anthropic (Claude)",
|
|
85
|
-
baseUrl: "https://api.anthropic.com/v1",
|
|
86
|
-
needsApiKey: !0,
|
|
87
|
-
apiFormat: "anthropic",
|
|
88
|
-
supportsModelsApi: !1,
|
|
89
|
-
icon: `${O}/anthropic.svg`
|
|
90
|
-
},
|
|
91
|
-
[o.GEMINI]: {
|
|
92
|
-
id: o.GEMINI,
|
|
93
|
-
name: "Google Gemini",
|
|
94
|
-
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
|
|
95
|
-
needsApiKey: !0,
|
|
96
|
-
apiFormat: "gemini",
|
|
97
|
-
supportsModelsApi: !0,
|
|
98
|
-
icon: `${O}/gemini.svg`
|
|
99
|
-
},
|
|
100
|
-
[o.OPENROUTER]: {
|
|
101
|
-
id: o.OPENROUTER,
|
|
102
|
-
name: "OpenRouter",
|
|
103
|
-
baseUrl: "https://openrouter.ai/api/v1",
|
|
104
|
-
needsApiKey: !0,
|
|
105
|
-
apiFormat: "openai",
|
|
106
|
-
supportsModelsApi: !0,
|
|
107
|
-
icon: `${O}/openrouter.svg`
|
|
108
|
-
},
|
|
109
|
-
[o.DEEPSEEK]: {
|
|
110
|
-
id: o.DEEPSEEK,
|
|
111
|
-
name: "DeepSeek",
|
|
112
|
-
baseUrl: "https://api.deepseek.com",
|
|
113
|
-
needsApiKey: !0,
|
|
114
|
-
apiFormat: "openai",
|
|
115
|
-
supportsModelsApi: !0,
|
|
116
|
-
icon: `${O}/deepseek.svg`
|
|
117
|
-
},
|
|
118
|
-
[o.MOONSHOT]: {
|
|
119
|
-
id: o.MOONSHOT,
|
|
120
|
-
name: "Moonshot (Kimi)",
|
|
121
|
-
baseUrl: "https://api.moonshot.cn/v1",
|
|
122
|
-
needsApiKey: !0,
|
|
123
|
-
apiFormat: "openai",
|
|
124
|
-
supportsModelsApi: !0,
|
|
125
|
-
icon: `${O}/moonshot.svg`
|
|
126
|
-
},
|
|
127
|
-
[o.QWEN]: {
|
|
128
|
-
id: o.QWEN,
|
|
129
|
-
name: "通义千问 (Qwen)",
|
|
130
|
-
baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
131
|
-
needsApiKey: !0,
|
|
132
|
-
apiFormat: "openai",
|
|
133
|
-
supportsModelsApi: !0,
|
|
134
|
-
icon: `${O}/qwen.svg`
|
|
135
|
-
},
|
|
136
|
-
[o.ZHIPU]: {
|
|
137
|
-
id: o.ZHIPU,
|
|
138
|
-
name: "智谱 AI (GLM)",
|
|
139
|
-
baseUrl: "https://open.bigmodel.cn/api/paas/v4",
|
|
140
|
-
needsApiKey: !0,
|
|
141
|
-
apiFormat: "openai",
|
|
142
|
-
supportsModelsApi: !0,
|
|
143
|
-
icon: `${O}/zhipu.svg`
|
|
144
|
-
},
|
|
145
|
-
[o.SILICONFLOW]: {
|
|
146
|
-
id: o.SILICONFLOW,
|
|
147
|
-
name: "硅基流动 (siliconflow)",
|
|
148
|
-
baseUrl: "https://api.siliconflow.cn/v1",
|
|
149
|
-
needsApiKey: !0,
|
|
150
|
-
apiFormat: "openai",
|
|
151
|
-
supportsModelsApi: !0,
|
|
152
|
-
icon: `${O}/siliconcloud.svg`
|
|
153
|
-
},
|
|
154
|
-
[o.DOUBAO]: {
|
|
155
|
-
id: o.DOUBAO,
|
|
156
|
-
name: "火山方舟 (Doubao)",
|
|
157
|
-
baseUrl: "https://ark.cn-beijing.volces.com/api/v3",
|
|
158
|
-
needsApiKey: !0,
|
|
159
|
-
apiFormat: "openai",
|
|
160
|
-
supportsModelsApi: !0,
|
|
161
|
-
icon: `${O}/doubao.svg`
|
|
162
|
-
},
|
|
163
|
-
[o.MINIMAX]: {
|
|
164
|
-
id: o.MINIMAX,
|
|
165
|
-
name: "MiniMax",
|
|
166
|
-
baseUrl: "https://api.minimax.io/v1",
|
|
167
|
-
needsApiKey: !0,
|
|
168
|
-
apiFormat: "openai",
|
|
169
|
-
supportsModelsApi: !1,
|
|
170
|
-
icon: `${O}/minimax.svg`
|
|
171
|
-
},
|
|
172
|
-
[o.XAI]: {
|
|
173
|
-
id: o.XAI,
|
|
174
|
-
name: "xAI (Grok)",
|
|
175
|
-
baseUrl: "https://api.x.ai/v1",
|
|
176
|
-
needsApiKey: !0,
|
|
177
|
-
apiFormat: "openai",
|
|
178
|
-
supportsModelsApi: !0,
|
|
179
|
-
icon: `${O}/grok.svg`
|
|
180
|
-
},
|
|
181
|
-
[o.GROQ]: {
|
|
182
|
-
id: o.GROQ,
|
|
183
|
-
name: "Groq",
|
|
184
|
-
baseUrl: "https://api.groq.com/openai/v1",
|
|
185
|
-
needsApiKey: !0,
|
|
186
|
-
apiFormat: "openai",
|
|
187
|
-
supportsModelsApi: !0,
|
|
188
|
-
icon: `${O}/groq.svg`
|
|
189
|
-
},
|
|
190
|
-
[o.MISTRAL]: {
|
|
191
|
-
id: o.MISTRAL,
|
|
192
|
-
name: "Mistral AI",
|
|
193
|
-
baseUrl: "https://api.mistral.ai/v1",
|
|
194
|
-
needsApiKey: !0,
|
|
195
|
-
apiFormat: "openai",
|
|
196
|
-
supportsModelsApi: !0,
|
|
197
|
-
icon: `${O}/mistral.svg`
|
|
198
|
-
},
|
|
199
|
-
[o.TOGETHER]: {
|
|
200
|
-
id: o.TOGETHER,
|
|
201
|
-
name: "Together AI",
|
|
202
|
-
baseUrl: "https://api.together.xyz/v1",
|
|
203
|
-
needsApiKey: !0,
|
|
204
|
-
apiFormat: "openai",
|
|
205
|
-
supportsModelsApi: !0,
|
|
206
|
-
icon: `${O}/together.svg`
|
|
207
|
-
},
|
|
208
|
-
[o.FIREWORKS]: {
|
|
209
|
-
id: o.FIREWORKS,
|
|
210
|
-
name: "Fireworks AI",
|
|
211
|
-
baseUrl: "https://api.fireworks.ai/inference/v1",
|
|
212
|
-
needsApiKey: !0,
|
|
213
|
-
apiFormat: "openai",
|
|
214
|
-
supportsModelsApi: !0,
|
|
215
|
-
icon: `${O}/fireworks.svg`
|
|
216
|
-
},
|
|
217
|
-
[o.DEEPINFRA]: {
|
|
218
|
-
id: o.DEEPINFRA,
|
|
219
|
-
name: "DeepInfra",
|
|
220
|
-
baseUrl: "https://api.deepinfra.com/v1/openai",
|
|
221
|
-
needsApiKey: !0,
|
|
222
|
-
apiFormat: "openai",
|
|
223
|
-
supportsModelsApi: !0,
|
|
224
|
-
icon: `${O}/deepinfra.svg`
|
|
225
|
-
},
|
|
226
|
-
[o.PERPLEXITY]: {
|
|
227
|
-
id: o.PERPLEXITY,
|
|
228
|
-
name: "Perplexity",
|
|
229
|
-
baseUrl: "https://api.perplexity.ai",
|
|
230
|
-
needsApiKey: !0,
|
|
231
|
-
apiFormat: "openai",
|
|
232
|
-
supportsModelsApi: !1,
|
|
233
|
-
icon: `${O}/perplexity.svg`
|
|
234
|
-
},
|
|
235
|
-
[o.COHERE]: {
|
|
236
|
-
id: o.COHERE,
|
|
237
|
-
name: "Cohere",
|
|
238
|
-
baseUrl: "https://api.cohere.com/v2",
|
|
239
|
-
needsApiKey: !0,
|
|
240
|
-
apiFormat: "cohere",
|
|
241
|
-
supportsModelsApi: !0,
|
|
242
|
-
icon: `${O}/cohere.svg`
|
|
243
|
-
},
|
|
244
|
-
[o.OLLAMA]: {
|
|
245
|
-
id: o.OLLAMA,
|
|
246
|
-
name: "Ollama (Local)",
|
|
247
|
-
baseUrl: "http://localhost:11434/v1",
|
|
248
|
-
needsApiKey: !1,
|
|
249
|
-
apiFormat: "openai",
|
|
250
|
-
supportsModelsApi: !0,
|
|
251
|
-
icon: `${O}/ollama.svg`
|
|
252
|
-
}
|
|
253
|
-
}, Me = {
|
|
254
|
-
[o.OPENAI]: [
|
|
255
|
-
{ id: "gpt-5.2-pro", name: "GPT-5.2 Pro" },
|
|
256
|
-
{ id: "gpt-5.2", name: "GPT-5.2" },
|
|
257
|
-
{ id: "gpt-5", name: "GPT-5" },
|
|
258
|
-
{ id: "gpt-5-mini", name: "GPT-5 Mini" },
|
|
259
|
-
{ id: "gpt-5-nano", name: "GPT-5 Nano" },
|
|
260
|
-
{ id: "gpt-4.1", name: "GPT-4.1" }
|
|
261
|
-
],
|
|
262
|
-
[o.ANTHROPIC]: [
|
|
263
|
-
{ id: "claude-opus-4.5-20251101", name: "Claude Opus 4.5" },
|
|
264
|
-
{ id: "claude-opus-4.5-20251101-thinking", name: "Claude Opus 4.5 Thinking" },
|
|
265
|
-
{ id: "claude-sonnet-4.5-20250929", name: "Claude Sonnet 4.5" },
|
|
266
|
-
{ id: "claude-sonnet-4.5-20250929-thinking", name: "Claude Sonnet 4.5 Thinking" },
|
|
267
|
-
{ id: "claude-haiku-4.5-20251001", name: "Claude Haiku 4.5" },
|
|
268
|
-
{ id: "claude-haiku-4.5-20251001-thinking", name: "Claude Haiku 4.5 Thinking" },
|
|
269
|
-
{ id: "claude-opus-4.1-20250805", name: "Claude Opus 4.1" },
|
|
270
|
-
{ id: "claude-opus-4.1-20250805-thinking", name: "Claude Opus 4.1 Thinking" }
|
|
271
|
-
],
|
|
272
|
-
[o.GEMINI]: [
|
|
273
|
-
{ id: "gemini-3-flash-preview", name: "Gemini 3 Flash Preview" },
|
|
274
|
-
{ id: "gemini-3-pro-preview", name: "Gemini 3 Pro Preview" },
|
|
275
|
-
{ id: "gemini-2.5-pro", name: "Gemini 2.5 Pro" },
|
|
276
|
-
{ id: "gemini-2.5-flash", name: "Gemini 2.5 Flash" },
|
|
277
|
-
{ id: "gemini-2.5-flash-lite", name: "Gemini 2.5 Flash-Lite" }
|
|
278
|
-
],
|
|
279
|
-
[o.DEEPSEEK]: [
|
|
280
|
-
{ id: "deepseek-chat", name: "Deepseek Chat" },
|
|
281
|
-
{ id: "deepseek-reasoner", name: "Deepseek Reasoner" }
|
|
282
|
-
],
|
|
283
|
-
[o.MISTRAL]: [
|
|
284
|
-
{ id: "mistral-large-latest", name: "Mistral Large" },
|
|
285
|
-
{ id: "mistral-medium-latest", name: "Mistral Medium" },
|
|
286
|
-
{ id: "mistral-small-latest", name: "Mistral Small" },
|
|
287
|
-
{ id: "codestral-latest", name: "Codestral" },
|
|
288
|
-
{ id: "devstral-latest", name: "Devstral" },
|
|
289
|
-
{ id: "magistral-medium-latest", name: "Magistral Medium" },
|
|
290
|
-
{ id: "pixtral-large-latest", name: "Pixtral Large" },
|
|
291
|
-
{ id: "pixtral-12b-latest", name: "Pixtral 12B" },
|
|
292
|
-
{ id: "ministral-8b-latest", name: "Ministral 8B" },
|
|
293
|
-
{ id: "ministral-3b-latest", name: "Ministral 3B" }
|
|
294
|
-
],
|
|
295
|
-
[o.GROQ]: [
|
|
296
|
-
{ id: "canopylabs/orpheus-v1-english", name: "Orpheus V1 English" },
|
|
297
|
-
{ id: "canopylabs/orpheus-arabic-saudi", name: "Orpheus Arabic Saudi" },
|
|
298
|
-
{ id: "moonshotai/kimi-k2-instruct", name: "Kimi K2 Instruct" },
|
|
299
|
-
{ id: "groq/compound-mini", name: "Compound Mini" },
|
|
300
|
-
{ id: "llama-3.3-70b-versatile", name: "Llama 3.3 70B Versatile" },
|
|
301
|
-
{ id: "openai/gpt-oss-120b", name: "Gpt Oss 120B" },
|
|
302
|
-
{ id: "qwen/qwen3-32b", name: "Qwen3 32B" },
|
|
303
|
-
{ id: "groq/compound", name: "Compound" },
|
|
304
|
-
{ id: "meta-llama/llama-4-maverick-17b-128e-instruct", name: "Llama 4 Maverick 17B 128E Instruct" }
|
|
305
|
-
],
|
|
306
|
-
[o.XAI]: [
|
|
307
|
-
{ id: "grok-4", name: "Grok 4" },
|
|
308
|
-
{ id: "grok-4-fast", name: "Grok 4 Fast" },
|
|
309
|
-
{ id: "grok-3-latest", name: "Grok 3" },
|
|
310
|
-
{ id: "grok-3-fast", name: "Grok 3 Fast" },
|
|
311
|
-
{ id: "grok-3-mini-latest", name: "Grok 3 Mini" },
|
|
312
|
-
{ id: "grok-3-mini-fast", name: "Grok 3 Mini Fast" },
|
|
313
|
-
{ id: "grok-vision-beta", name: "Grok Vision (Beta)" }
|
|
314
|
-
],
|
|
315
|
-
[o.TOGETHER]: [
|
|
316
|
-
{ id: "Qwen/Qwen2.5-72B-Instruct-Turbo", name: "Qwen2.5 72B Instruct Turbo" },
|
|
317
|
-
{ id: "Qwen/Qwen3-235B-A22B-Thinking-2507", name: "Qwen3 235B A22B Thinking 2507" },
|
|
318
|
-
{ id: "deepseek-ai/DeepSeek-R1", name: "Deepseek R1" },
|
|
319
|
-
{ id: "deepseek-ai/DeepSeek-V3.1", name: "Deepseek V3.1" },
|
|
320
|
-
{ id: "meta-llama/Llama-3.2-3B-Instruct-Turbo", name: "Llama 3.2 3B Instruct Turbo" },
|
|
321
|
-
{ id: "meta-llama/Llama-3.3-70B-Instruct-Turbo", name: "Llama 3.3 70B Instruct Turbo" },
|
|
322
|
-
{ id: "meta-llama/Llama-3.3-70B-Instruct-Turbo-Free", name: "Llama 3.3 70B Instruct Turbo Free" }
|
|
323
|
-
],
|
|
324
|
-
[o.FIREWORKS]: [
|
|
325
|
-
{ id: "accounts/fireworks/models/llama4-scout-instruct-basic", name: "Llama4 Scout Instruct Basic" },
|
|
326
|
-
{ id: "accounts/fireworks/models/qwen3-vl-235b-a22b-thinking", name: "Qwen3 Vl 235B A22B Thinking" },
|
|
327
|
-
{ id: "accounts/fireworks/models/deepseek-v3p2", name: "Deepseek V3P2" },
|
|
328
|
-
{ id: "accounts/fireworks/models/qwen3-vl-30b-a3b-thinking", name: "Qwen3 Vl 30B A3B Thinking" },
|
|
329
|
-
{ id: "accounts/fireworks/models/qwen3-8b", name: "Qwen3 8B" },
|
|
330
|
-
{ id: "accounts/fireworks/models/qwen3-vl-30b-a3b-instruct", name: "Qwen3 Vl 30B A3B Instruct" },
|
|
331
|
-
{ id: "accounts/fireworks/models/qwen2p5-vl-32b-instruct", name: "Qwen2P5 Vl 32B Instruct" },
|
|
332
|
-
{ id: "accounts/fireworks/models/llama4-maverick-instruct-basic", name: "Llama4 Maverick Instruct Basic" },
|
|
333
|
-
{ id: "accounts/fireworks/models/qwen3-235b-a22b-thinking-2507", name: "Qwen3 235B A22B Thinking 2507" },
|
|
334
|
-
{ id: "accounts/fireworks/models/qwen3-coder-480b-a35b-instruct", name: "Qwen3 Coder 480B A35B Instruct" }
|
|
335
|
-
],
|
|
336
|
-
[o.DEEPINFRA]: [
|
|
337
|
-
{ id: "meta-llama/Llama-3.2-11B-Vision-Instruct", name: "Llama 3.2 11B Vision Instruct" },
|
|
338
|
-
{ id: "Qwen/Qwen3-32B", name: "Qwen3 32B" },
|
|
339
|
-
{ id: "NousResearch/Hermes-3-Llama-3.1-70B", name: "Hermes 3 Llama 3.1 70B" },
|
|
340
|
-
{ id: "Qwen/Qwen2.5-72B-Instruct", name: "Qwen2.5 72B Instruct" },
|
|
341
|
-
{ id: "deepseek-ai/DeepSeek-V3-0324", name: "Deepseek V3 0324" },
|
|
342
|
-
{ id: "Qwen/Qwen3-VL-235B-A22B-Instruct", name: "Qwen3 Vl 235B A22B Instruct" },
|
|
343
|
-
{ id: "meta-llama/Llama-3.2-3B-Instruct", name: "Llama 3.2 3B Instruct" },
|
|
344
|
-
{ id: "Qwen/Qwen2.5-VL-32B-Instruct", name: "Qwen2.5 Vl 32B Instruct" },
|
|
345
|
-
{ id: "meta-llama/Meta-Llama-3.1-8B-Instruct", name: "Meta Llama 3.1 8B Instruct" },
|
|
346
|
-
{ id: "Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo", name: "Qwen3 Coder 480B A35B Instruct Turbo" }
|
|
347
|
-
],
|
|
348
|
-
[o.OPENROUTER]: [
|
|
349
|
-
{ id: "google/gemini-3-flash-preview", name: "Gemini 3 Flash Preview" },
|
|
350
|
-
{ id: "mistralai/mistral-small-creative", name: "Mistral Small Creative" },
|
|
351
|
-
{ id: "openai/gpt-5.2-chat", name: "Gpt 5.2 Chat" },
|
|
352
|
-
{ id: "openai/gpt-5.2-pro", name: "Gpt 5.2 Pro" },
|
|
353
|
-
{ id: "openai/gpt-5.2", name: "Gpt 5.2" },
|
|
354
|
-
{ id: "mistralai/devstral-2512", name: "Devstral 2512" },
|
|
355
|
-
{ id: "openai/gpt-5.1-codex-max", name: "Gpt 5.1 Codex Max" },
|
|
356
|
-
{ id: "mistralai/ministral-14b-2512", name: "Ministral 14B 2512" },
|
|
357
|
-
{ id: "mistralai/ministral-8b-2512", name: "Ministral 8B 2512" },
|
|
358
|
-
{ id: "mistralai/ministral-3b-2512", name: "Ministral 3B 2512" },
|
|
359
|
-
{ id: "mistralai/mistral-large-2512", name: "Mistral Large 2512" },
|
|
360
|
-
{ id: "deepseek/deepseek-v3.2-speciale", name: "Deepseek V3.2 Speciale" }
|
|
361
|
-
],
|
|
362
|
-
[o.PERPLEXITY]: [
|
|
363
|
-
{ id: "codellama-34b-instruct", name: "Codellama 34B Instruct" },
|
|
364
|
-
{ id: "codellama-70b-instruct", name: "Codellama 70B Instruct" },
|
|
365
|
-
{ id: "llama-2-70b-chat", name: "Llama 2 70B Chat" },
|
|
366
|
-
{ id: "llama-3.1-70b-instruct", name: "Llama 3.1 70B Instruct" },
|
|
367
|
-
{ id: "llama-3.1-8b-instruct", name: "Llama 3.1 8B Instruct" },
|
|
368
|
-
{ id: "llama-3.1-sonar-huge-128k-online", name: "Llama 3.1 Sonar Huge 128K Online" },
|
|
369
|
-
{ id: "llama-3.1-sonar-large-128k-chat", name: "Llama 3.1 Sonar Large 128K Chat" },
|
|
370
|
-
{ id: "llama-3.1-sonar-large-128k-online", name: "Llama 3.1 Sonar Large 128K Online" },
|
|
371
|
-
{ id: "llama-3.1-sonar-small-128k-chat", name: "Llama 3.1 Sonar Small 128K Chat" }
|
|
372
|
-
],
|
|
373
|
-
[o.COHERE]: [
|
|
374
|
-
{ id: "command-a-vision-07-2025", name: "Command A Vision 07 2025" },
|
|
375
|
-
{ id: "command-a-reasoning-08-2025", name: "Command A Reasoning 08 2025" },
|
|
376
|
-
{ id: "command-r-08-2024", name: "Command R 08 2024" },
|
|
377
|
-
{ id: "command-r7b-arabic-02-2025", name: "Command R7B Arabic 02 2025" },
|
|
378
|
-
{ id: "command-r7b-12-2024", name: "Command R7B 12 2024" }
|
|
379
|
-
],
|
|
380
|
-
[o.MOONSHOT]: [
|
|
381
|
-
{ id: "moonshot-v1-128k", name: "Moonshot 128K" },
|
|
382
|
-
{ id: "moonshot-v1-32k", name: "Moonshot 32K" },
|
|
383
|
-
{ id: "moonshot-v1-8k", name: "Moonshot 8K" },
|
|
384
|
-
{ id: "kimi-k2-0711-chat", name: "Kimi K2 Chat" },
|
|
385
|
-
{ id: "moonshot-v1-auto", name: "Moonshot Auto" }
|
|
386
|
-
],
|
|
387
|
-
[o.QWEN]: [
|
|
388
|
-
{ id: "qwen-flash", name: "Qwen Flash" },
|
|
389
|
-
{ id: "qwen3-vl-plus-2025-12-19", name: "Qwen3 Vl Plus 2025 12 19" },
|
|
390
|
-
{ id: "qwen3-tts-vd-realtime-2025-12-16", name: "Qwen3 Tts Vd Realtime 2025 12 16" },
|
|
391
|
-
{ id: "qwen-image-edit-plus-2025-12-15", name: "Qwen Image Edit Plus 2025 12 15" },
|
|
392
|
-
{ id: "qwen3-omni-flash-2025-12-01", name: "Qwen3 Omni Flash 2025 12 01" },
|
|
393
|
-
{ id: "qwen3-omni-flash-realtime-2025-12-01", name: "Qwen3 Omni Flash Realtime 2025 12 01" },
|
|
394
|
-
{ id: "qwen3-livetranslate-flash-2025-12-01", name: "Qwen3 Livetranslate Flash 2025 12 01" },
|
|
395
|
-
{ id: "qwen3-livetranslate-flash", name: "Qwen3 Livetranslate Flash" },
|
|
396
|
-
{ id: "qwen-plus-2025-12-01", name: "Qwen Plus 2025 12 01" },
|
|
397
|
-
{ id: "qwen3-tts-vc-realtime-2025-11-27", name: "Qwen3 Tts Vc Realtime 2025 11 27" }
|
|
398
|
-
],
|
|
399
|
-
[o.ZHIPU]: [
|
|
400
|
-
{ id: "glm-4.5", name: "Glm 4.5" },
|
|
401
|
-
{ id: "glm-4.5-air", name: "Glm 4.5 Air" },
|
|
402
|
-
{ id: "glm-4.6", name: "Glm 4.6" },
|
|
403
|
-
{ id: "glm-4.7", name: "Glm 4.7" }
|
|
404
|
-
],
|
|
405
|
-
[o.SILICONFLOW]: [
|
|
406
|
-
{ id: "deepseek-ai/DeepSeek-V3.2", name: "Deepseek V3.2" },
|
|
407
|
-
{ id: "deepseek-ai/DeepSeek-V3.1-Terminus", name: "Deepseek V3.1 Terminus" },
|
|
408
|
-
{ id: "deepseek-ai/DeepSeek-R1", name: "Deepseek R1" },
|
|
409
|
-
{ id: "deepseek-ai/DeepSeek-V3", name: "Deepseek V3" },
|
|
410
|
-
{ id: "zai-org/GLM-4.6V", name: "Glm 4.6V" },
|
|
411
|
-
{ id: "zai-org/GLM-4.6", name: "Glm 4.6" },
|
|
412
|
-
{ id: "Pro/zai-org/GLM-4.7", name: "Glm 4.7" },
|
|
413
|
-
{ id: "Qwen/Qwen3-VL-32B-Instruct", name: "Qwen3 Vl 32B Instruct" }
|
|
414
|
-
],
|
|
415
|
-
[o.OLLAMA]: [
|
|
416
|
-
{ id: "llama3.3", name: "Llama 3.3" },
|
|
417
|
-
{ id: "llama3.2", name: "Llama 3.2" },
|
|
418
|
-
{ id: "qwq", name: "QwQ (推理)" },
|
|
419
|
-
{ id: "qwen3:32b", name: "Qwen3 32B" },
|
|
420
|
-
{ id: "deepseek-r1:32b", name: "DeepSeek R1 32B" },
|
|
421
|
-
{ id: "deepseek-coder-v2", name: "DeepSeek Coder V2" },
|
|
422
|
-
{ id: "gemma3:27b", name: "Gemma 3 27B" },
|
|
423
|
-
{ id: "mistral:7b", name: "Mistral 7B" },
|
|
424
|
-
{ id: "phi4", name: "Phi 4" },
|
|
425
|
-
{ id: "codellama", name: "Code Llama" }
|
|
426
|
-
],
|
|
427
|
-
[o.DOUBAO]: [
|
|
428
|
-
{ id: "doubao-seed-1-8-251215", name: "Doubao 1.8" },
|
|
429
|
-
{ id: "doubao-seed-1-6-251015", name: "Doubao 1.6" },
|
|
430
|
-
{ id: "doubao-seed-1-6-lite-251015", name: "Doubao 1.6 Lite" },
|
|
431
|
-
{ id: "doubao-seed-1-6-flash-250828", name: "Doubao 1.6 Flash" },
|
|
432
|
-
{ id: "doubao-seed-1-6-thinking-250615", name: "Doubao 1.6 Thinking" }
|
|
433
|
-
],
|
|
434
|
-
[o.MINIMAX]: [
|
|
435
|
-
{ id: "MiniMax-M2.1", name: "MiniMax M2.1" },
|
|
436
|
-
{ id: "MiniMax-M2.1-lightning", name: "MiniMax M2.1 Lightning" },
|
|
437
|
-
{ id: "MiniMax-M2", name: "MiniMax M2" }
|
|
438
|
-
]
|
|
439
|
-
};
|
|
440
|
-
function de(e) {
|
|
441
|
-
return Me[e] || [];
|
|
442
|
-
}
|
|
443
|
-
const we = (e) => Array.isArray(e == null ? void 0 : e.data) ? e.data.filter((a) => a.id).map((a) => {
|
|
444
|
-
const s = a.name || (a.id.split("/").pop() ?? "").replace(/[-_]/g, " ").replace(/\b\w/g, (i) => i.toUpperCase());
|
|
445
|
-
return {
|
|
446
|
-
id: a.id,
|
|
447
|
-
name: s,
|
|
448
|
-
created: a.created || 0
|
|
449
|
-
};
|
|
450
|
-
}).sort((a, s) => (s.created || 0) - (a.created || 0)) : [], he = {
|
|
451
|
-
format: "openai",
|
|
452
|
-
getModelsEndpoint: (e) => `${e}/models`,
|
|
453
|
-
getChatEndpoint: (e) => `${e}/chat/completions`,
|
|
454
|
-
buildHeaders: (e) => ({
|
|
455
|
-
"Content-Type": "application/json",
|
|
456
|
-
Authorization: `Bearer ${e}`
|
|
457
|
-
}),
|
|
458
|
-
buildChatPayload: (e, a, s) => ({
|
|
459
|
-
model: e,
|
|
460
|
-
messages: a,
|
|
461
|
-
max_tokens: s
|
|
462
|
-
}),
|
|
463
|
-
parseChatResponse: (e) => {
|
|
464
|
-
var a, s, i;
|
|
465
|
-
return ((i = (s = (a = e.choices) == null ? void 0 : a[0]) == null ? void 0 : s.message) == null ? void 0 : i.content) || "";
|
|
466
|
-
}
|
|
467
|
-
}, Ce = {
|
|
468
|
-
format: "anthropic",
|
|
469
|
-
getChatEndpoint: (e) => `${e}/messages`,
|
|
470
|
-
buildHeaders: (e) => ({
|
|
471
|
-
"Content-Type": "application/json",
|
|
472
|
-
"x-api-key": e,
|
|
473
|
-
"anthropic-version": "2023-06-01"
|
|
474
|
-
}),
|
|
475
|
-
buildChatPayload: (e, a, s) => ({
|
|
476
|
-
model: e,
|
|
477
|
-
messages: a,
|
|
478
|
-
max_tokens: s
|
|
479
|
-
}),
|
|
480
|
-
parseChatResponse: (e) => {
|
|
481
|
-
var a, s;
|
|
482
|
-
return ((s = (a = e.content) == null ? void 0 : a[0]) == null ? void 0 : s.text) || "";
|
|
483
|
-
}
|
|
484
|
-
}, Ie = {
|
|
485
|
-
format: "gemini",
|
|
486
|
-
getModelsEndpoint: (e, a) => `${e}/models?key=${a}`,
|
|
487
|
-
getChatEndpoint: (e, a, s) => `${e}/models/${s}:generateContent?key=${a}`,
|
|
488
|
-
buildHeaders: () => ({
|
|
489
|
-
"Content-Type": "application/json"
|
|
490
|
-
}),
|
|
491
|
-
buildChatPayload: (e, a, s) => ({
|
|
492
|
-
contents: a.map((t) => ({
|
|
493
|
-
role: t.role === "assistant" ? "model" : "user",
|
|
494
|
-
parts: [{ text: t.content }]
|
|
495
|
-
})),
|
|
496
|
-
generationConfig: { maxOutputTokens: s }
|
|
497
|
-
}),
|
|
498
|
-
parseChatResponse: (e) => {
|
|
499
|
-
var a, s, i, t, n;
|
|
500
|
-
return ((n = (t = (i = (s = (a = e.candidates) == null ? void 0 : a[0]) == null ? void 0 : s.content) == null ? void 0 : i.parts) == null ? void 0 : t[0]) == null ? void 0 : n.text) || "";
|
|
501
|
-
},
|
|
502
|
-
// Gemini 返回格式: { models: [{ name: "models/gemini-pro", ... }] }
|
|
503
|
-
parseModelsResponse: (e) => Array.isArray(e.models) ? e.models.filter((a) => {
|
|
504
|
-
var s;
|
|
505
|
-
return (s = a.supportedGenerationMethods) == null ? void 0 : s.includes("generateContent");
|
|
506
|
-
}).map((a) => ({
|
|
507
|
-
id: a.name.replace("models/", ""),
|
|
508
|
-
// "models/gemini-pro" -> "gemini-pro"
|
|
509
|
-
name: a.displayName || a.name.replace("models/", ""),
|
|
510
|
-
created: a.created || 0
|
|
511
|
-
})).sort((a, s) => (s.created || 0) - (a.created || 0)) : []
|
|
512
|
-
}, xe = {
|
|
513
|
-
format: "cohere",
|
|
514
|
-
getModelsEndpoint: (e) => `${e}/models`,
|
|
515
|
-
getChatEndpoint: (e) => `${e}/chat`,
|
|
516
|
-
buildHeaders: (e) => ({
|
|
517
|
-
"Content-Type": "application/json",
|
|
518
|
-
Authorization: `Bearer ${e}`
|
|
519
|
-
}),
|
|
520
|
-
buildChatPayload: (e, a, s) => {
|
|
521
|
-
const i = a[a.length - 1], t = a.slice(0, -1).map((n) => ({
|
|
522
|
-
role: n.role === "assistant" ? "CHATBOT" : "USER",
|
|
523
|
-
message: n.content
|
|
524
|
-
}));
|
|
525
|
-
return {
|
|
526
|
-
model: e,
|
|
527
|
-
message: i.content,
|
|
528
|
-
chat_history: t,
|
|
529
|
-
max_tokens: s
|
|
530
|
-
};
|
|
531
|
-
},
|
|
532
|
-
parseChatResponse: (e) => e.text || ""
|
|
533
|
-
}, Ae = {
|
|
534
|
-
openai: he,
|
|
535
|
-
anthropic: Ce,
|
|
536
|
-
gemini: Ie,
|
|
537
|
-
cohere: xe
|
|
538
|
-
};
|
|
539
|
-
function fe(e) {
|
|
540
|
-
return Ae[e] || he;
|
|
541
|
-
}
|
|
542
|
-
async function Ee(e) {
|
|
543
|
-
const { provider: a, apiKey: s, model: i, baseUrl: t, proxyUrl: n } = e, v = t || a.baseUrl, l = Date.now();
|
|
544
|
-
try {
|
|
545
|
-
if (n) {
|
|
546
|
-
const k = await (await fetch(`${n}/test`, {
|
|
547
|
-
method: "POST",
|
|
548
|
-
headers: { "Content-Type": "application/json" },
|
|
549
|
-
body: JSON.stringify({
|
|
550
|
-
provider_id: a.id,
|
|
551
|
-
api_key: s,
|
|
552
|
-
model: i || "",
|
|
553
|
-
base_url: t || a.baseUrl,
|
|
554
|
-
api_format: a.apiFormat
|
|
555
|
-
})
|
|
556
|
-
})).json();
|
|
557
|
-
return {
|
|
558
|
-
success: k.success,
|
|
559
|
-
latencyMs: k.latency_ms || Date.now() - l,
|
|
560
|
-
message: k.message
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
const r = fe(a.apiFormat), u = i || "";
|
|
564
|
-
if (!u)
|
|
565
|
-
return {
|
|
566
|
-
success: !1,
|
|
567
|
-
latencyMs: 0,
|
|
568
|
-
message: "请先选择模型 (Please select a model)"
|
|
569
|
-
};
|
|
570
|
-
const c = r.buildHeaders(s), f = r.buildChatPayload(u, [{ role: "user", content: "Hi" }], 5), p = r.getChatEndpoint(v, s, u), h = await fetch(p, {
|
|
571
|
-
method: "POST",
|
|
572
|
-
headers: c,
|
|
573
|
-
body: JSON.stringify(f)
|
|
574
|
-
}), I = Date.now() - l;
|
|
575
|
-
if (h.ok)
|
|
576
|
-
return { success: !0, latencyMs: I, message: "连接成功" };
|
|
577
|
-
{
|
|
578
|
-
const A = await h.text();
|
|
579
|
-
return {
|
|
580
|
-
success: !1,
|
|
581
|
-
latencyMs: I,
|
|
582
|
-
message: `HTTP ${h.status}: ${A.slice(0, 200)}`
|
|
583
|
-
};
|
|
584
|
-
}
|
|
585
|
-
} catch (r) {
|
|
586
|
-
return {
|
|
587
|
-
success: !1,
|
|
588
|
-
latencyMs: Date.now() - l,
|
|
589
|
-
message: r instanceof Error ? r.message : String(r)
|
|
590
|
-
};
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
async function Le(e) {
|
|
594
|
-
var v;
|
|
595
|
-
const { provider: a, apiKey: s, baseUrl: i, proxyUrl: t, fallbackToStatic: n = !0 } = e;
|
|
596
|
-
if (t)
|
|
597
|
-
try {
|
|
598
|
-
const r = await (await fetch(`${t}/models`, {
|
|
599
|
-
method: "POST",
|
|
600
|
-
headers: { "Content-Type": "application/json" },
|
|
601
|
-
body: JSON.stringify({
|
|
602
|
-
provider_id: a.id,
|
|
603
|
-
api_key: s || void 0,
|
|
604
|
-
base_url: i || a.baseUrl
|
|
605
|
-
})
|
|
606
|
-
})).json();
|
|
607
|
-
if (r.success && ((v = r.models) == null ? void 0 : v.length) > 0)
|
|
608
|
-
return r.models;
|
|
609
|
-
} catch (l) {
|
|
610
|
-
if (console.warn("Failed to fetch models via proxy:", l), !n)
|
|
611
|
-
throw l;
|
|
612
|
-
}
|
|
613
|
-
if (!t && a.supportsModelsApi)
|
|
614
|
-
try {
|
|
615
|
-
const l = fe(a.apiFormat);
|
|
616
|
-
if (l.getModelsEndpoint) {
|
|
617
|
-
const r = l.getModelsEndpoint(i || a.baseUrl, s || ""), u = l.buildHeaders(s || ""), c = await fetch(r, {
|
|
618
|
-
method: "GET",
|
|
619
|
-
headers: u
|
|
620
|
-
});
|
|
621
|
-
if (c.ok) {
|
|
622
|
-
const f = await c.json();
|
|
623
|
-
return (l.parseModelsResponse || we)(f);
|
|
624
|
-
} else if (!n)
|
|
625
|
-
throw new Error(`HTTP ${c.status}`);
|
|
626
|
-
}
|
|
627
|
-
} catch (l) {
|
|
628
|
-
if (console.warn("Failed to fetch models directly:", l), !n)
|
|
629
|
-
throw l;
|
|
630
|
-
}
|
|
631
|
-
if (!n && a.supportsModelsApi)
|
|
632
|
-
throw new Error("Failed to fetch models");
|
|
633
|
-
return de(a.id);
|
|
634
|
-
}
|
|
635
|
-
const se = "ai_provider_config", Oe = {
|
|
636
|
-
get: (e) => typeof window > "u" ? null : localStorage.getItem(e),
|
|
637
|
-
set: (e, a) => {
|
|
638
|
-
typeof window > "u" || localStorage.setItem(e, a);
|
|
639
|
-
},
|
|
640
|
-
remove: (e) => {
|
|
641
|
-
typeof window > "u" || localStorage.removeItem(e);
|
|
642
|
-
}
|
|
643
|
-
};
|
|
644
|
-
function Se(e = Oe, a = {}) {
|
|
645
|
-
const s = a.serialize || JSON.stringify, i = a.deserialize || JSON.parse;
|
|
646
|
-
return {
|
|
647
|
-
/**
|
|
648
|
-
* Save AI config
|
|
649
|
-
*/
|
|
650
|
-
save(t) {
|
|
651
|
-
try {
|
|
652
|
-
const n = s(t);
|
|
653
|
-
e.set(se, n);
|
|
654
|
-
} catch (n) {
|
|
655
|
-
console.error("Failed to save config:", n);
|
|
656
|
-
}
|
|
657
|
-
},
|
|
658
|
-
/**
|
|
659
|
-
* Load AI config
|
|
660
|
-
*/
|
|
661
|
-
load() {
|
|
662
|
-
const t = e.get(se);
|
|
663
|
-
if (!t)
|
|
664
|
-
return null;
|
|
665
|
-
try {
|
|
666
|
-
return i(t);
|
|
667
|
-
} catch (n) {
|
|
668
|
-
return console.error("Failed to load config:", n), null;
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
/**
|
|
672
|
-
* Clear AI config
|
|
673
|
-
*/
|
|
674
|
-
clear() {
|
|
675
|
-
e.remove(se);
|
|
676
|
-
}
|
|
677
|
-
};
|
|
678
|
-
}
|
|
679
|
-
function Te(e) {
|
|
680
|
-
if (!e)
|
|
681
|
-
return {
|
|
682
|
-
providers: Object.values(pe),
|
|
683
|
-
getModels: (r) => de(r)
|
|
684
|
-
};
|
|
685
|
-
const { mode: a, include: s, exclude: i, custom: t } = e;
|
|
686
|
-
let n = [];
|
|
687
|
-
if (a === "default") {
|
|
688
|
-
let r = Object.values(pe);
|
|
689
|
-
s && s.length > 0 && (r = r.filter((u) => s.includes(u.id))), i && i.length > 0 && (r = r.filter((u) => !i.includes(u.id))), n = [...r];
|
|
690
|
-
}
|
|
691
|
-
const v = {};
|
|
692
|
-
if (t)
|
|
693
|
-
for (const [r, u] of Object.entries(t)) {
|
|
694
|
-
const c = {
|
|
695
|
-
id: r,
|
|
696
|
-
name: u.name,
|
|
697
|
-
baseUrl: u.baseUrl,
|
|
698
|
-
needsApiKey: u.needsApiKey,
|
|
699
|
-
apiFormat: u.apiFormat,
|
|
700
|
-
supportsModelsApi: u.supportsModelsApi ?? !1,
|
|
701
|
-
icon: u.icon
|
|
702
|
-
}, f = n.findIndex((p) => p.id === r);
|
|
703
|
-
f >= 0 ? n[f] = {
|
|
704
|
-
...n[f],
|
|
705
|
-
...c,
|
|
706
|
-
icon: c.icon || n[f].icon
|
|
707
|
-
} : n.push(c), u.models && u.models.length > 0 && (v[r] = u.models);
|
|
708
|
-
}
|
|
709
|
-
return { providers: n, getModels: (r) => v[r] ? v[r] : de(r) };
|
|
710
|
-
}
|
|
711
|
-
function Be(e = {}) {
|
|
712
|
-
var F, D, X, q, G;
|
|
713
|
-
const a = E(((F = e.initialConfig) == null ? void 0 : F.providerId) || ""), s = E(((D = e.initialConfig) == null ? void 0 : D.apiKey) || ""), i = E(((X = e.initialConfig) == null ? void 0 : X.model) || ""), t = E(((q = e.initialConfig) == null ? void 0 : q.modelName) || ""), n = E(((G = e.initialConfig) == null ? void 0 : G.baseUrl) || ""), v = E([]), l = E("idle"), r = E(null), u = E(!1), c = E(null), f = T(() => Te(e.providerConfig)), p = T(() => f.value.providers), h = T(
|
|
714
|
-
() => p.value.find((m) => m.id === a.value) || null
|
|
715
|
-
), I = Se(void 0, {
|
|
1
|
+
import { ref as $, computed as A, onMounted as ne, watch as q, defineComponent as V, onUnmounted as ie, createElementBlock as p, openBlock as m, normalizeClass as z, Fragment as R, renderList as ee, normalizeStyle as G, toDisplayString as w, unref as v, createCommentVNode as W, createVNode as j, createElementVNode as n, withDirectives as ve, vModelText as he, createTextVNode as D } from "vue";
|
|
2
|
+
import { resolveProviderConfig as fe, createConfigStorage as pe, fetchModels as me, testConnection as ge, I18N as Q } from "@tombcato/ai-selector-core";
|
|
3
|
+
function ye(e = {}) {
|
|
4
|
+
var N, E, H, Y, O;
|
|
5
|
+
const r = $(((N = e.initialConfig) == null ? void 0 : N.providerId) || ""), l = $(((E = e.initialConfig) == null ? void 0 : E.apiKey) || ""), a = $(((H = e.initialConfig) == null ? void 0 : H.model) || ""), t = $(((Y = e.initialConfig) == null ? void 0 : Y.modelName) || ""), s = $(((O = e.initialConfig) == null ? void 0 : O.baseUrl) || ""), f = $([]), u = $("idle"), i = $(null), y = $(!1), c = $(null), g = A(() => fe(e.providerConfig)), d = A(() => g.value.providers), h = A(
|
|
6
|
+
() => d.value.find((o) => o.id === r.value) || null
|
|
7
|
+
), M = pe(void 0, {
|
|
716
8
|
serialize: e.onSerialize,
|
|
717
9
|
deserialize: e.onDeserialize
|
|
718
|
-
}),
|
|
719
|
-
|
|
720
|
-
const
|
|
721
|
-
|
|
722
|
-
|
|
10
|
+
}), I = $(!1);
|
|
11
|
+
ne(() => {
|
|
12
|
+
const o = M.load();
|
|
13
|
+
o && o.providerId && d.value.some((b) => b.id === o.providerId) && (r.value = o.providerId, o.apiKey && (l.value = o.apiKey), o.model && (a.value = o.model), o.modelName && (t.value = o.modelName), o.baseUrl && (s.value = o.baseUrl)), setTimeout(() => {
|
|
14
|
+
I.value = !0;
|
|
723
15
|
}, 0);
|
|
724
|
-
}),
|
|
725
|
-
|
|
16
|
+
}), q(r, () => {
|
|
17
|
+
I.value && (l.value = "", a.value = "", t.value = "", s.value = "", u.value = "idle", i.value = null);
|
|
726
18
|
});
|
|
727
|
-
let
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
-
if (
|
|
731
|
-
|
|
19
|
+
let x = null;
|
|
20
|
+
const U = /* @__PURE__ */ new Map();
|
|
21
|
+
q([r, l, s], () => {
|
|
22
|
+
if (x && clearTimeout(x), !r.value || !h.value) {
|
|
23
|
+
f.value = [], c.value = null, y.value = !1;
|
|
732
24
|
return;
|
|
733
25
|
}
|
|
734
|
-
const
|
|
735
|
-
if (
|
|
736
|
-
|
|
26
|
+
const o = h.value.supportsModelsApi && (!h.value.needsApiKey || !!l.value), b = s.value || h.value.baseUrl, F = `${r.value}|${b}|${l.value}`, P = U.get(F);
|
|
27
|
+
if (P) {
|
|
28
|
+
f.value = P, c.value = null, y.value = !1;
|
|
737
29
|
return;
|
|
738
30
|
}
|
|
739
|
-
if (!
|
|
740
|
-
const
|
|
741
|
-
|
|
31
|
+
if (!o) {
|
|
32
|
+
const _ = g.value.getModels(r.value);
|
|
33
|
+
f.value = _, U.set(F, _), c.value = null, y.value = !1;
|
|
742
34
|
return;
|
|
743
35
|
}
|
|
744
|
-
|
|
36
|
+
y.value = !0, c.value = null, f.value.length === 0 && (f.value = g.value.getModels(r.value)), x = setTimeout(async () => {
|
|
745
37
|
try {
|
|
746
|
-
let
|
|
747
|
-
e.modelFetcher ?
|
|
38
|
+
let _;
|
|
39
|
+
e.modelFetcher ? _ = await e.modelFetcher({
|
|
748
40
|
type: "fetchModels",
|
|
749
41
|
providerId: h.value.id,
|
|
750
|
-
baseUrl:
|
|
751
|
-
apiKey:
|
|
752
|
-
}) :
|
|
42
|
+
baseUrl: b,
|
|
43
|
+
apiKey: l.value
|
|
44
|
+
}) : _ = await me({
|
|
753
45
|
provider: h.value,
|
|
754
|
-
apiKey:
|
|
755
|
-
baseUrl:
|
|
46
|
+
apiKey: l.value,
|
|
47
|
+
baseUrl: b,
|
|
756
48
|
proxyUrl: e.proxyUrl,
|
|
757
49
|
fallbackToStatic: !1
|
|
758
|
-
}),
|
|
759
|
-
} catch (
|
|
760
|
-
console.warn("Model fetch failed:",
|
|
50
|
+
}), f.value = _, U.set(F, _);
|
|
51
|
+
} catch (_) {
|
|
52
|
+
console.warn("Model fetch failed:", _), c.value = "fetchModelsFailed", f.value = g.value.getModels(r.value);
|
|
761
53
|
} finally {
|
|
762
|
-
|
|
54
|
+
y.value = !1;
|
|
763
55
|
}
|
|
764
56
|
}, 500);
|
|
765
|
-
}, { immediate: !0 }),
|
|
766
|
-
(
|
|
57
|
+
}, { immediate: !0 }), q([l, s], () => {
|
|
58
|
+
(u.value === "error" || u.value === "success") && (u.value = "idle", i.value = null);
|
|
767
59
|
});
|
|
768
|
-
async function
|
|
769
|
-
if (!h.value || h.value.needsApiKey && !
|
|
770
|
-
|
|
771
|
-
let
|
|
60
|
+
async function k() {
|
|
61
|
+
if (!h.value || h.value.needsApiKey && !l.value) return;
|
|
62
|
+
u.value = "testing", i.value = null;
|
|
63
|
+
let o;
|
|
772
64
|
if (e.modelFetcher)
|
|
773
65
|
try {
|
|
774
|
-
const
|
|
66
|
+
const b = await e.modelFetcher({
|
|
775
67
|
type: "checkConnection",
|
|
776
68
|
providerId: h.value.id,
|
|
777
|
-
baseUrl:
|
|
778
|
-
apiKey:
|
|
779
|
-
modelId:
|
|
69
|
+
baseUrl: s.value || h.value.baseUrl,
|
|
70
|
+
apiKey: l.value,
|
|
71
|
+
modelId: a.value
|
|
780
72
|
});
|
|
781
|
-
|
|
782
|
-
success:
|
|
783
|
-
latencyMs:
|
|
784
|
-
message:
|
|
73
|
+
o = {
|
|
74
|
+
success: b.success,
|
|
75
|
+
latencyMs: b.latency || b.latencyMs,
|
|
76
|
+
message: b.message
|
|
785
77
|
};
|
|
786
|
-
} catch (
|
|
787
|
-
|
|
78
|
+
} catch (b) {
|
|
79
|
+
o = { success: !1, message: b.message || "Unknown error" };
|
|
788
80
|
}
|
|
789
81
|
else
|
|
790
|
-
|
|
82
|
+
o = await ge({
|
|
791
83
|
provider: h.value,
|
|
792
|
-
apiKey:
|
|
793
|
-
baseUrl:
|
|
794
|
-
model:
|
|
84
|
+
apiKey: l.value,
|
|
85
|
+
baseUrl: s.value,
|
|
86
|
+
model: a.value,
|
|
795
87
|
proxyUrl: e.proxyUrl
|
|
796
88
|
});
|
|
797
|
-
return
|
|
798
|
-
|
|
799
|
-
}, 2e3),
|
|
89
|
+
return i.value = o, u.value = o.success ? "success" : "error", setTimeout(() => {
|
|
90
|
+
u.value = "idle";
|
|
91
|
+
}, 2e3), o;
|
|
800
92
|
}
|
|
801
93
|
function S() {
|
|
802
|
-
const
|
|
803
|
-
|
|
804
|
-
providerId:
|
|
805
|
-
apiKey:
|
|
806
|
-
model:
|
|
807
|
-
modelName:
|
|
808
|
-
baseUrl:
|
|
94
|
+
const o = f.value.find((F) => F.id === a.value), b = (o == null ? void 0 : o.name) || t.value || a.value;
|
|
95
|
+
o != null && o.name && o.name !== t.value && (t.value = o.name), M.save({
|
|
96
|
+
providerId: r.value,
|
|
97
|
+
apiKey: l.value,
|
|
98
|
+
model: a.value,
|
|
99
|
+
modelName: b,
|
|
100
|
+
baseUrl: s.value
|
|
809
101
|
});
|
|
810
102
|
}
|
|
811
|
-
function
|
|
812
|
-
|
|
103
|
+
function K() {
|
|
104
|
+
M.clear(), r.value = "", l.value = "", a.value = "", t.value = "", s.value = "";
|
|
813
105
|
}
|
|
814
|
-
function
|
|
815
|
-
if (
|
|
816
|
-
t.value =
|
|
106
|
+
function L(o, b) {
|
|
107
|
+
if (a.value = o, b)
|
|
108
|
+
t.value = b;
|
|
817
109
|
else {
|
|
818
|
-
const
|
|
819
|
-
t.value = (
|
|
110
|
+
const F = f.value.find((P) => P.id === o);
|
|
111
|
+
t.value = (F == null ? void 0 : F.name) || o;
|
|
820
112
|
}
|
|
821
113
|
}
|
|
822
|
-
const
|
|
823
|
-
var
|
|
824
|
-
return !(!
|
|
825
|
-
}), C =
|
|
826
|
-
var
|
|
114
|
+
const T = A(() => {
|
|
115
|
+
var o;
|
|
116
|
+
return !(!r.value || !a.value || (o = h.value) != null && o.needsApiKey && !l.value);
|
|
117
|
+
}), C = A(() => {
|
|
118
|
+
var o;
|
|
827
119
|
return {
|
|
828
|
-
providerId:
|
|
829
|
-
apiKey:
|
|
830
|
-
model:
|
|
120
|
+
providerId: r.value,
|
|
121
|
+
apiKey: l.value,
|
|
122
|
+
model: a.value,
|
|
831
123
|
modelName: t.value,
|
|
832
|
-
baseUrl:
|
|
124
|
+
baseUrl: s.value || ((o = h.value) == null ? void 0 : o.baseUrl) || ""
|
|
833
125
|
};
|
|
834
126
|
});
|
|
835
127
|
return {
|
|
836
128
|
// State (Refs)
|
|
837
|
-
providerId:
|
|
838
|
-
apiKey:
|
|
839
|
-
model:
|
|
129
|
+
providerId: r,
|
|
130
|
+
apiKey: l,
|
|
131
|
+
model: a,
|
|
840
132
|
modelName: t,
|
|
841
|
-
baseUrl:
|
|
842
|
-
models:
|
|
843
|
-
testStatus:
|
|
844
|
-
testResult:
|
|
845
|
-
isFetchingModels:
|
|
133
|
+
baseUrl: s,
|
|
134
|
+
models: f,
|
|
135
|
+
testStatus: u,
|
|
136
|
+
testResult: i,
|
|
137
|
+
isFetchingModels: y,
|
|
846
138
|
fetchModelError: c,
|
|
847
139
|
// Computed
|
|
848
140
|
provider: h,
|
|
849
|
-
providers:
|
|
850
|
-
isValid:
|
|
141
|
+
providers: d,
|
|
142
|
+
isValid: T,
|
|
851
143
|
config: C,
|
|
852
144
|
// Actions
|
|
853
|
-
runTest:
|
|
145
|
+
runTest: k,
|
|
854
146
|
save: S,
|
|
855
|
-
clear:
|
|
856
|
-
selectModel:
|
|
147
|
+
clear: K,
|
|
148
|
+
selectModel: L
|
|
857
149
|
};
|
|
858
150
|
}
|
|
859
|
-
var
|
|
860
|
-
const
|
|
861
|
-
class
|
|
862
|
-
constructor(
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
this.numOriginalCharacters =
|
|
866
|
-
for (let t = 0; t <
|
|
867
|
-
this.characterIndicesMap.set(
|
|
868
|
-
this.characterList = new Array(
|
|
869
|
-
for (let t = 0; t <
|
|
870
|
-
this.characterList[1 + t] =
|
|
151
|
+
var be = Object.defineProperty, xe = (e, r, l) => r in e ? be(e, r, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[r] = l, te = (e, r, l) => xe(e, typeof r != "symbol" ? r + "" : r, l);
|
|
152
|
+
const B = "\0";
|
|
153
|
+
class ke {
|
|
154
|
+
constructor(r) {
|
|
155
|
+
te(this, "numOriginalCharacters"), te(this, "characterList"), te(this, "characterIndicesMap");
|
|
156
|
+
const l = [...r], a = l.length;
|
|
157
|
+
this.numOriginalCharacters = a, this.characterIndicesMap = /* @__PURE__ */ new Map();
|
|
158
|
+
for (let t = 0; t < a; t++)
|
|
159
|
+
this.characterIndicesMap.set(l[t], t);
|
|
160
|
+
this.characterList = new Array(a * 2 + 1), this.characterList[0] = B;
|
|
161
|
+
for (let t = 0; t < a; t++)
|
|
162
|
+
this.characterList[1 + t] = l[t], this.characterList[1 + a + t] = l[t];
|
|
871
163
|
}
|
|
872
|
-
getCharacterIndices(
|
|
873
|
-
let t = this.getIndexOfChar(
|
|
874
|
-
if (t < 0 ||
|
|
875
|
-
switch (
|
|
164
|
+
getCharacterIndices(r, l, a) {
|
|
165
|
+
let t = this.getIndexOfChar(r), s = this.getIndexOfChar(l);
|
|
166
|
+
if (t < 0 || s < 0) return null;
|
|
167
|
+
switch (a) {
|
|
876
168
|
case "DOWN":
|
|
877
|
-
|
|
169
|
+
l === B ? s = this.characterList.length : s < t && (s += this.numOriginalCharacters);
|
|
878
170
|
break;
|
|
879
171
|
case "UP":
|
|
880
|
-
t <
|
|
172
|
+
t < s && (t += this.numOriginalCharacters);
|
|
881
173
|
break;
|
|
882
174
|
case "ANY":
|
|
883
|
-
if (
|
|
884
|
-
if (
|
|
885
|
-
const
|
|
886
|
-
this.numOriginalCharacters - t +
|
|
887
|
-
} else if (t <
|
|
888
|
-
const
|
|
889
|
-
this.numOriginalCharacters -
|
|
175
|
+
if (r !== B && l !== B) {
|
|
176
|
+
if (s < t) {
|
|
177
|
+
const f = t - s;
|
|
178
|
+
this.numOriginalCharacters - t + s < f && (s += this.numOriginalCharacters);
|
|
179
|
+
} else if (t < s) {
|
|
180
|
+
const f = s - t;
|
|
181
|
+
this.numOriginalCharacters - s + t < f && (t += this.numOriginalCharacters);
|
|
890
182
|
}
|
|
891
183
|
}
|
|
892
184
|
break;
|
|
893
185
|
}
|
|
894
|
-
return { startIndex: t, endIndex:
|
|
186
|
+
return { startIndex: t, endIndex: s };
|
|
895
187
|
}
|
|
896
188
|
getSupportedCharacters() {
|
|
897
189
|
return new Set(this.characterIndicesMap.keys());
|
|
@@ -899,64 +191,64 @@ class Fe {
|
|
|
899
191
|
getCharacterList() {
|
|
900
192
|
return this.characterList;
|
|
901
193
|
}
|
|
902
|
-
getIndexOfChar(
|
|
903
|
-
return
|
|
194
|
+
getIndexOfChar(r) {
|
|
195
|
+
return r === B ? 0 : this.characterIndicesMap.has(r) ? this.characterIndicesMap.get(r) + 1 : -1;
|
|
904
196
|
}
|
|
905
197
|
}
|
|
906
|
-
const
|
|
907
|
-
function
|
|
908
|
-
let
|
|
909
|
-
const
|
|
198
|
+
const Z = 0, J = 1, X = 2;
|
|
199
|
+
function Ce(e, r, l) {
|
|
200
|
+
let a = 0, t = 0;
|
|
201
|
+
const s = [];
|
|
910
202
|
for (; ; ) {
|
|
911
|
-
const
|
|
912
|
-
if (
|
|
913
|
-
if (
|
|
914
|
-
for (; t <
|
|
203
|
+
const f = a === e.length, u = t === r.length;
|
|
204
|
+
if (f && u) break;
|
|
205
|
+
if (f) {
|
|
206
|
+
for (; t < r.length; t++) s.push(J);
|
|
915
207
|
break;
|
|
916
208
|
}
|
|
917
|
-
if (
|
|
918
|
-
for (;
|
|
209
|
+
if (u) {
|
|
210
|
+
for (; a < e.length; a++) s.push(X);
|
|
919
211
|
break;
|
|
920
212
|
}
|
|
921
|
-
const
|
|
922
|
-
if (
|
|
923
|
-
let c =
|
|
924
|
-
for (; c < e.length &&
|
|
925
|
-
for (;
|
|
926
|
-
const
|
|
927
|
-
if (
|
|
928
|
-
for (let
|
|
213
|
+
const i = l.has(e[a]), y = l.has(r[t]);
|
|
214
|
+
if (i && y) {
|
|
215
|
+
let c = a + 1, g = t + 1;
|
|
216
|
+
for (; c < e.length && l.has(e[c]); ) c++;
|
|
217
|
+
for (; g < r.length && l.has(r[g]); ) g++;
|
|
218
|
+
const d = c - a, h = g - t;
|
|
219
|
+
if (d === h)
|
|
220
|
+
for (let M = 0; M < d; M++) s.push(Z);
|
|
929
221
|
else {
|
|
930
|
-
const
|
|
931
|
-
for (let
|
|
932
|
-
for (let
|
|
933
|
-
for (let
|
|
222
|
+
const M = Array(d + 1).fill(null).map(() => Array(h + 1).fill(0));
|
|
223
|
+
for (let k = 0; k <= d; k++) M[k][0] = k;
|
|
224
|
+
for (let k = 0; k <= h; k++) M[0][k] = k;
|
|
225
|
+
for (let k = 1; k <= d; k++)
|
|
934
226
|
for (let S = 1; S <= h; S++) {
|
|
935
|
-
const
|
|
936
|
-
|
|
227
|
+
const K = e[a + k - 1] === r[t + S - 1] ? 0 : 1;
|
|
228
|
+
M[k][S] = Math.min(M[k - 1][S] + 1, M[k][S - 1] + 1, M[k - 1][S - 1] + K);
|
|
937
229
|
}
|
|
938
|
-
const
|
|
939
|
-
let
|
|
940
|
-
for (;
|
|
941
|
-
if (
|
|
942
|
-
|
|
943
|
-
else if (
|
|
944
|
-
|
|
230
|
+
const I = [];
|
|
231
|
+
let x = d, U = h;
|
|
232
|
+
for (; x > 0 || U > 0; )
|
|
233
|
+
if (x === 0)
|
|
234
|
+
I.push(J), U--;
|
|
235
|
+
else if (U === 0)
|
|
236
|
+
I.push(X), x--;
|
|
945
237
|
else {
|
|
946
|
-
const
|
|
947
|
-
|
|
238
|
+
const k = M[x][U - 1], S = M[x - 1][U], K = M[x - 1][U - 1];
|
|
239
|
+
k < S && k < K ? (I.push(J), U--) : S < K ? (I.push(X), x--) : (I.push(Z), x--, U--);
|
|
948
240
|
}
|
|
949
|
-
for (let
|
|
241
|
+
for (let k = I.length - 1; k >= 0; k--) s.push(I[k]);
|
|
950
242
|
}
|
|
951
|
-
|
|
952
|
-
} else
|
|
243
|
+
a = c, t = g;
|
|
244
|
+
} else i ? (s.push(J), t++) : y ? (s.push(X), a++) : (s.push(Z), a++, t++);
|
|
953
245
|
}
|
|
954
|
-
return
|
|
246
|
+
return s;
|
|
955
247
|
}
|
|
956
|
-
function
|
|
248
|
+
function ae() {
|
|
957
249
|
return {
|
|
958
|
-
currentChar:
|
|
959
|
-
targetChar:
|
|
250
|
+
currentChar: B,
|
|
251
|
+
targetChar: B,
|
|
960
252
|
charList: null,
|
|
961
253
|
startIndex: 0,
|
|
962
254
|
endIndex: 0,
|
|
@@ -968,30 +260,30 @@ function ie() {
|
|
|
968
260
|
currDelta: 0
|
|
969
261
|
};
|
|
970
262
|
}
|
|
971
|
-
function
|
|
263
|
+
function se(e, r, l, a) {
|
|
972
264
|
const t = { ...e };
|
|
973
|
-
t.targetChar =
|
|
974
|
-
let
|
|
975
|
-
for (const
|
|
976
|
-
const
|
|
977
|
-
if (
|
|
978
|
-
t.charList =
|
|
265
|
+
t.targetChar = r, t.sourceWidth = t.currentWidth, t.targetWidth = r === B ? 0 : 1;
|
|
266
|
+
let s = !1;
|
|
267
|
+
for (const f of l) {
|
|
268
|
+
const u = f.getCharacterIndices(t.currentChar, r, a);
|
|
269
|
+
if (u) {
|
|
270
|
+
t.charList = f.getCharacterList(), t.startIndex = u.startIndex, t.endIndex = u.endIndex, s = !0;
|
|
979
271
|
break;
|
|
980
272
|
}
|
|
981
273
|
}
|
|
982
|
-
return
|
|
274
|
+
return s || (t.charList = t.currentChar === r ? [t.currentChar] : [t.currentChar, r], t.startIndex = 0, t.endIndex = t.currentChar === r ? 0 : 1), t.directionAdj = t.endIndex >= t.startIndex ? 1 : -1, t.prevDelta = t.currDelta, t.currDelta = 0, t;
|
|
983
275
|
}
|
|
984
|
-
function le(e,
|
|
985
|
-
const
|
|
986
|
-
return
|
|
276
|
+
function le(e, r, l = !1) {
|
|
277
|
+
const a = { ...e }, t = Math.abs(a.endIndex - a.startIndex), s = r * t, f = s - Math.floor(s), u = a.prevDelta * (1 - r), i = f * a.directionAdj + u, y = a.startIndex + Math.floor(s) * a.directionAdj;
|
|
278
|
+
return r >= 1 ? (a.currentChar = a.targetChar, a.currDelta = 0, a.prevDelta = 0) : l && a.charList && y >= 0 && y < a.charList.length && (a.currentChar = a.charList[y], a.currDelta = i), a.currentWidth = a.sourceWidth + (a.targetWidth - a.sourceWidth) * r, { col: a, charIdx: y, delta: i };
|
|
987
279
|
}
|
|
988
|
-
const
|
|
280
|
+
const de = {
|
|
989
281
|
linear: (e) => e,
|
|
990
282
|
easeIn: (e) => e * e,
|
|
991
283
|
easeOut: (e) => 1 - (1 - e) * (1 - e),
|
|
992
284
|
easeInOut: (e) => e < 0.5 ? 2 * e * e : 1 - Math.pow(-2 * e + 2, 2) / 2,
|
|
993
285
|
bounce: (e) => e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + 0.75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + 0.9375 : 7.5625 * (e -= 2.625 / 2.75) * e + 0.984375
|
|
994
|
-
},
|
|
286
|
+
}, re = 1.2, we = /* @__PURE__ */ V({
|
|
995
287
|
__name: "Ticker",
|
|
996
288
|
props: {
|
|
997
289
|
value: { type: String, required: !0 },
|
|
@@ -1003,82 +295,82 @@ const ve = {
|
|
|
1003
295
|
charWidth: { type: Number, default: 1 }
|
|
1004
296
|
},
|
|
1005
297
|
setup(e) {
|
|
1006
|
-
const
|
|
298
|
+
const r = e, l = $([]), a = $(1);
|
|
1007
299
|
let t;
|
|
1008
|
-
const
|
|
1009
|
-
const
|
|
1010
|
-
return
|
|
300
|
+
const s = A(() => r.characterLists.map((i) => new ke(i))), f = A(() => {
|
|
301
|
+
const i = /* @__PURE__ */ new Set();
|
|
302
|
+
return s.value.forEach((y) => y.getSupportedCharacters().forEach((c) => i.add(c))), i;
|
|
1011
303
|
});
|
|
1012
|
-
|
|
1013
|
-
if (
|
|
304
|
+
q(() => r.value, (i, y) => {
|
|
305
|
+
if (i === y) return;
|
|
1014
306
|
t && (cancelAnimationFrame(t), t = void 0);
|
|
1015
|
-
let c =
|
|
1016
|
-
|
|
1017
|
-
const
|
|
1018
|
-
let
|
|
1019
|
-
const
|
|
307
|
+
let c = l.value;
|
|
308
|
+
a.value < 1 && a.value > 0 && (c = c.map((C) => le(C, a.value, !0).col));
|
|
309
|
+
const g = [...i], d = c.map((C) => C.currentChar), h = Ce(d, g, f.value);
|
|
310
|
+
let M = 0, I = 0;
|
|
311
|
+
const x = [], U = c.filter((C) => C.currentWidth > 0);
|
|
1020
312
|
for (const C of h)
|
|
1021
|
-
if (C ===
|
|
1022
|
-
|
|
1023
|
-
else if (C ===
|
|
1024
|
-
const
|
|
1025
|
-
|
|
313
|
+
if (C === J)
|
|
314
|
+
x.push(se(ae(), g[I++], s.value, r.direction));
|
|
315
|
+
else if (C === Z) {
|
|
316
|
+
const N = U[M++] || ae();
|
|
317
|
+
x.push(se(N, g[I++], s.value, r.direction));
|
|
1026
318
|
} else {
|
|
1027
|
-
const
|
|
1028
|
-
|
|
319
|
+
const N = U[M++] || ae();
|
|
320
|
+
x.push(se(N, B, s.value, r.direction));
|
|
1029
321
|
}
|
|
1030
|
-
|
|
1031
|
-
const
|
|
1032
|
-
let
|
|
1033
|
-
const
|
|
1034
|
-
const
|
|
1035
|
-
if ((C -
|
|
1036
|
-
t = requestAnimationFrame(
|
|
322
|
+
l.value = x, a.value = 0;
|
|
323
|
+
const k = performance.now(), S = r.duration, K = de[r.easing] || de.linear;
|
|
324
|
+
let L = 0;
|
|
325
|
+
const T = (C) => {
|
|
326
|
+
const N = Math.min((C - k) / S, 1), E = K(N);
|
|
327
|
+
if ((C - L >= 16 || N >= 1) && (L = C, a.value = E), N < 1)
|
|
328
|
+
t = requestAnimationFrame(T);
|
|
1037
329
|
else {
|
|
1038
|
-
const
|
|
1039
|
-
|
|
330
|
+
const Y = l.value.map((O) => le(O, 1).col).filter((O) => O.currentWidth > 0);
|
|
331
|
+
l.value = Y, a.value = 1, t = void 0;
|
|
1040
332
|
}
|
|
1041
333
|
};
|
|
1042
|
-
t = requestAnimationFrame(
|
|
1043
|
-
}, { immediate: !0 }),
|
|
334
|
+
t = requestAnimationFrame(T);
|
|
335
|
+
}, { immediate: !0 }), ie(() => {
|
|
1044
336
|
t && cancelAnimationFrame(t);
|
|
1045
337
|
});
|
|
1046
|
-
const
|
|
1047
|
-
const { charIdx:
|
|
1048
|
-
if (
|
|
1049
|
-
const
|
|
1050
|
-
C >= 0 && C < h.length &&
|
|
1051
|
-
key: `${
|
|
338
|
+
const u = A(() => l.value.map((i) => {
|
|
339
|
+
const { charIdx: y, delta: c } = le(i, a.value), g = i.sourceWidth + (i.targetWidth - i.sourceWidth) * a.value;
|
|
340
|
+
if (g <= 0) return { width: g, chars: [] };
|
|
341
|
+
const d = [], h = i.charList || [], M = c * re, I = (C, N, E) => {
|
|
342
|
+
C >= 0 && C < h.length && d.push({
|
|
343
|
+
key: `${E}-${C}`,
|
|
1052
344
|
char: h[C],
|
|
1053
|
-
offset:
|
|
345
|
+
offset: M + N
|
|
1054
346
|
});
|
|
1055
347
|
};
|
|
1056
|
-
|
|
1057
|
-
const
|
|
1058
|
-
return { width:
|
|
1059
|
-
}).filter((
|
|
1060
|
-
return (
|
|
1061
|
-
class:
|
|
348
|
+
I(y, 0, "c"), I(y + 1, -re, "n"), I(y - 1, re, "p");
|
|
349
|
+
const x = (C) => C && C.length > 0 && C.charCodeAt(0) > 255, U = (C) => x(C) ? 1.25 : 0.8, k = h[i.startIndex] || "", S = h[i.endIndex] || "", K = U(k), L = U(S), T = K + (L - K) * a.value;
|
|
350
|
+
return { width: g, chars: d, baseW: T };
|
|
351
|
+
}).filter((i) => i.width > 0));
|
|
352
|
+
return (i, y) => (m(), p("div", {
|
|
353
|
+
class: z(["ticker", e.className])
|
|
1062
354
|
}, [
|
|
1063
|
-
(
|
|
1064
|
-
key:
|
|
355
|
+
(m(!0), p(R, null, ee(u.value, (c, g) => (m(), p("div", {
|
|
356
|
+
key: g,
|
|
1065
357
|
class: "ticker-column",
|
|
1066
|
-
style:
|
|
358
|
+
style: G({ width: `${c.width * (c.baseW || 0.8) * e.charWidth}em` })
|
|
1067
359
|
}, [
|
|
1068
|
-
(
|
|
1069
|
-
key:
|
|
360
|
+
(m(!0), p(R, null, ee(c.chars, (d) => (m(), p("div", {
|
|
361
|
+
key: d.key,
|
|
1070
362
|
class: "ticker-char",
|
|
1071
|
-
style:
|
|
1072
|
-
},
|
|
363
|
+
style: G({ transform: `translateY(${d.offset}em)` })
|
|
364
|
+
}, w(d.char === v(B) ? " " : d.char), 5))), 128))
|
|
1073
365
|
], 4))), 128))
|
|
1074
366
|
], 2));
|
|
1075
367
|
}
|
|
1076
|
-
}),
|
|
1077
|
-
const
|
|
1078
|
-
for (const [
|
|
1079
|
-
|
|
1080
|
-
return
|
|
1081
|
-
},
|
|
368
|
+
}), Me = (e, r) => {
|
|
369
|
+
const l = e.__vccOpts || e;
|
|
370
|
+
for (const [a, t] of r)
|
|
371
|
+
l[a] = t;
|
|
372
|
+
return l;
|
|
373
|
+
}, Ie = /* @__PURE__ */ Me(we, [["__scopeId", "data-v-7e47ac69"]]), ue = /* @__PURE__ */ V({
|
|
1082
374
|
__name: "SmartText",
|
|
1083
375
|
props: {
|
|
1084
376
|
text: {},
|
|
@@ -1086,27 +378,27 @@ const ve = {
|
|
|
1086
378
|
placeholder: {}
|
|
1087
379
|
},
|
|
1088
380
|
setup(e) {
|
|
1089
|
-
return (
|
|
381
|
+
return (r, l) => !e.text && e.placeholder ? (m(), p("span", {
|
|
1090
382
|
key: 0,
|
|
1091
|
-
class:
|
|
1092
|
-
},
|
|
383
|
+
class: z(["apmsu-placeholder", e.className])
|
|
384
|
+
}, w(e.placeholder), 3)) : e.text ? (m(), p("span", {
|
|
1093
385
|
key: 1,
|
|
1094
|
-
class:
|
|
386
|
+
class: z(["inline-flex min-w-0", e.className])
|
|
1095
387
|
}, [
|
|
1096
|
-
|
|
388
|
+
j(v(Ie), {
|
|
1097
389
|
value: e.text,
|
|
1098
390
|
"char-width": 0.8,
|
|
1099
391
|
duration: 300
|
|
1100
392
|
}, null, 8, ["value"])
|
|
1101
|
-
], 2)) :
|
|
393
|
+
], 2)) : W("", !0);
|
|
1102
394
|
}
|
|
1103
|
-
}),
|
|
395
|
+
}), $e = { class: "apmsu-label" }, Ue = { class: "relative" }, Se = ["disabled"], Ae = {
|
|
1104
396
|
key: 0,
|
|
1105
397
|
class: "flex items-center gap-2 min-w-0"
|
|
1106
|
-
},
|
|
398
|
+
}, Le = ["src", "alt"], ze = {
|
|
1107
399
|
key: 1,
|
|
1108
400
|
class: "apmsu-placeholder"
|
|
1109
|
-
},
|
|
401
|
+
}, Ke = ["onClick"], Ne = { class: "flex items-center gap-2 flex-shrink-0" }, Fe = ["src", "alt"], _e = { class: "font-medium whitespace-nowrap" }, Te = { class: "apmsu-hint-text ml-auto text-right truncate flex-1 min-w-0" }, Be = /* @__PURE__ */ V({
|
|
1110
402
|
__name: "ProviderSelect",
|
|
1111
403
|
props: {
|
|
1112
404
|
providers: {},
|
|
@@ -1115,95 +407,95 @@ const ve = {
|
|
|
1115
407
|
language: { default: "zh" }
|
|
1116
408
|
},
|
|
1117
409
|
emits: ["select"],
|
|
1118
|
-
setup(e, { emit:
|
|
1119
|
-
const
|
|
1120
|
-
function
|
|
1121
|
-
|
|
410
|
+
setup(e, { emit: r }) {
|
|
411
|
+
const l = e, a = r, t = $(!1), s = $(null), f = A(() => Q[l.language]), u = A(() => l.providers.find((c) => c.id === l.selectedProviderId));
|
|
412
|
+
function i(c) {
|
|
413
|
+
s.value && !s.value.contains(c.target) && (t.value = !1);
|
|
1122
414
|
}
|
|
1123
|
-
|
|
1124
|
-
document.addEventListener("mousedown",
|
|
1125
|
-
}),
|
|
1126
|
-
document.removeEventListener("mousedown",
|
|
415
|
+
ne(() => {
|
|
416
|
+
document.addEventListener("mousedown", i);
|
|
417
|
+
}), ie(() => {
|
|
418
|
+
document.removeEventListener("mousedown", i);
|
|
1127
419
|
});
|
|
1128
|
-
function
|
|
1129
|
-
|
|
420
|
+
function y(c) {
|
|
421
|
+
a("select", c), t.value = !1;
|
|
1130
422
|
}
|
|
1131
|
-
return (c,
|
|
423
|
+
return (c, g) => (m(), p("div", {
|
|
1132
424
|
class: "apmsu-field",
|
|
1133
425
|
ref_key: "triggerRef",
|
|
1134
|
-
ref:
|
|
426
|
+
ref: s
|
|
1135
427
|
}, [
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
428
|
+
n("label", $e, w(f.value.providerLabel), 1),
|
|
429
|
+
n("div", Ue, [
|
|
430
|
+
n("button", {
|
|
1139
431
|
type: "button",
|
|
1140
|
-
onClick:
|
|
432
|
+
onClick: g[0] || (g[0] = (d) => !e.disabled && (t.value = !t.value)),
|
|
1141
433
|
disabled: e.disabled,
|
|
1142
434
|
class: "apmsu-select-trigger"
|
|
1143
435
|
}, [
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
src:
|
|
1147
|
-
alt:
|
|
436
|
+
u.value ? (m(), p("div", Ae, [
|
|
437
|
+
n("img", {
|
|
438
|
+
src: u.value.icon,
|
|
439
|
+
alt: u.value.name,
|
|
1148
440
|
class: "apmsu-provider-icon"
|
|
1149
|
-
}, null, 8,
|
|
1150
|
-
|
|
1151
|
-
text:
|
|
441
|
+
}, null, 8, Le),
|
|
442
|
+
j(ue, {
|
|
443
|
+
text: u.value.name
|
|
1152
444
|
}, null, 8, ["text"])
|
|
1153
|
-
])) : (
|
|
1154
|
-
(
|
|
1155
|
-
class:
|
|
445
|
+
])) : (m(), p("span", ze, w(f.value.selectProvider), 1)),
|
|
446
|
+
(m(), p("svg", {
|
|
447
|
+
class: z(["apmsu-chevron", t.value ? "rotate-180" : ""]),
|
|
1156
448
|
fill: "none",
|
|
1157
449
|
stroke: "currentColor",
|
|
1158
450
|
viewBox: "0 0 24 24"
|
|
1159
|
-
}, [...
|
|
1160
|
-
|
|
451
|
+
}, [...g[1] || (g[1] = [
|
|
452
|
+
n("path", {
|
|
1161
453
|
"stroke-linecap": "round",
|
|
1162
454
|
"stroke-linejoin": "round",
|
|
1163
455
|
"stroke-width": "2",
|
|
1164
456
|
d: "M19 9l-7 7-7-7"
|
|
1165
457
|
}, null, -1)
|
|
1166
458
|
])], 2))
|
|
1167
|
-
], 8,
|
|
1168
|
-
|
|
1169
|
-
class:
|
|
459
|
+
], 8, Se),
|
|
460
|
+
n("div", {
|
|
461
|
+
class: z(["apmsu-dropdown max-h-[300px] overflow-auto p-1 origin-top", t.value ? "apmsu-dropdown-open" : ""])
|
|
1170
462
|
}, [
|
|
1171
|
-
(
|
|
1172
|
-
key:
|
|
463
|
+
(m(!0), p(R, null, ee(e.providers, (d) => (m(), p("button", {
|
|
464
|
+
key: d.id,
|
|
1173
465
|
type: "button",
|
|
1174
|
-
onClick: (h) =>
|
|
1175
|
-
class:
|
|
466
|
+
onClick: (h) => y(d.id),
|
|
467
|
+
class: z(["apmsu-dropdown-item rounded-sm", e.selectedProviderId === d.id && "apmsu-dropdown-item-active"])
|
|
1176
468
|
}, [
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
src:
|
|
1180
|
-
alt:
|
|
469
|
+
n("div", Ne, [
|
|
470
|
+
n("img", {
|
|
471
|
+
src: d.icon,
|
|
472
|
+
alt: d.name,
|
|
1181
473
|
class: "apmsu-provider-icon"
|
|
1182
|
-
}, null, 8,
|
|
1183
|
-
|
|
474
|
+
}, null, 8, Fe),
|
|
475
|
+
n("span", _e, w(d.name), 1)
|
|
1184
476
|
]),
|
|
1185
|
-
|
|
1186
|
-
], 10,
|
|
477
|
+
n("span", Te, w(d.baseUrl.replace("https://", "")), 1)
|
|
478
|
+
], 10, Ke))), 128))
|
|
1187
479
|
], 2)
|
|
1188
480
|
])
|
|
1189
481
|
], 512));
|
|
1190
482
|
}
|
|
1191
|
-
}),
|
|
483
|
+
}), Ee = {
|
|
1192
484
|
key: 0,
|
|
1193
485
|
class: "apmsu-field"
|
|
1194
|
-
},
|
|
486
|
+
}, Oe = { class: "apmsu-label" }, We = { class: "relative" }, Pe = ["type", "value", "placeholder", "disabled"], De = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center" }, je = {
|
|
1195
487
|
key: 0,
|
|
1196
488
|
class: "w-4 h-4 text-gray-400",
|
|
1197
489
|
fill: "none",
|
|
1198
490
|
stroke: "currentColor",
|
|
1199
491
|
viewBox: "0 0 24 24"
|
|
1200
|
-
},
|
|
492
|
+
}, Re = {
|
|
1201
493
|
key: 1,
|
|
1202
494
|
class: "w-4 h-4 text-gray-400",
|
|
1203
495
|
fill: "none",
|
|
1204
496
|
stroke: "currentColor",
|
|
1205
497
|
viewBox: "0 0 24 24"
|
|
1206
|
-
},
|
|
498
|
+
}, Ve = /* @__PURE__ */ V({
|
|
1207
499
|
__name: "AuthInput",
|
|
1208
500
|
props: {
|
|
1209
501
|
provider: {},
|
|
@@ -1213,37 +505,37 @@ const ve = {
|
|
|
1213
505
|
language: { default: "zh" }
|
|
1214
506
|
},
|
|
1215
507
|
emits: ["update:apiKey"],
|
|
1216
|
-
setup(e, { emit:
|
|
1217
|
-
const
|
|
1218
|
-
return (
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
508
|
+
setup(e, { emit: r }) {
|
|
509
|
+
const l = e, a = r, t = $(!1), s = A(() => Q[l.language]), f = A(() => l.testStatus === "success" ? "apmsu-input apmsu-input-success" : "apmsu-input apmsu-input-default");
|
|
510
|
+
return (u, i) => e.provider && e.provider.needsApiKey ? (m(), p("div", Ee, [
|
|
511
|
+
n("label", Oe, w(s.value.apiKeyLabel), 1),
|
|
512
|
+
n("div", We, [
|
|
513
|
+
n("input", {
|
|
1222
514
|
type: t.value ? "text" : "password",
|
|
1223
515
|
value: e.apiKey,
|
|
1224
|
-
onInput:
|
|
1225
|
-
onFocus:
|
|
1226
|
-
onBlur:
|
|
1227
|
-
placeholder:
|
|
516
|
+
onInput: i[0] || (i[0] = (y) => a("update:apiKey", y.target.value)),
|
|
517
|
+
onFocus: i[1] || (i[1] = (y) => t.value = !0),
|
|
518
|
+
onBlur: i[2] || (i[2] = (y) => t.value = !1),
|
|
519
|
+
placeholder: s.value.apiKeyPlaceholder,
|
|
1228
520
|
disabled: e.disabled,
|
|
1229
|
-
class:
|
|
1230
|
-
}, null, 42,
|
|
1231
|
-
|
|
1232
|
-
t.value ? (
|
|
1233
|
-
|
|
521
|
+
class: z([f.value, "pr-10"])
|
|
522
|
+
}, null, 42, Pe),
|
|
523
|
+
n("span", De, [
|
|
524
|
+
t.value ? (m(), p("svg", je, [...i[3] || (i[3] = [
|
|
525
|
+
n("path", {
|
|
1234
526
|
"stroke-linecap": "round",
|
|
1235
527
|
"stroke-linejoin": "round",
|
|
1236
528
|
"stroke-width": "2",
|
|
1237
529
|
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
1238
530
|
}, null, -1),
|
|
1239
|
-
|
|
531
|
+
n("path", {
|
|
1240
532
|
"stroke-linecap": "round",
|
|
1241
533
|
"stroke-linejoin": "round",
|
|
1242
534
|
"stroke-width": "2",
|
|
1243
535
|
d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
|
|
1244
536
|
}, null, -1)
|
|
1245
|
-
])])) : (
|
|
1246
|
-
|
|
537
|
+
])])) : (m(), p("svg", Re, [...i[4] || (i[4] = [
|
|
538
|
+
n("path", {
|
|
1247
539
|
"stroke-linecap": "round",
|
|
1248
540
|
"stroke-linejoin": "round",
|
|
1249
541
|
"stroke-width": "2",
|
|
@@ -1252,27 +544,27 @@ const ve = {
|
|
|
1252
544
|
])]))
|
|
1253
545
|
])
|
|
1254
546
|
])
|
|
1255
|
-
])) :
|
|
547
|
+
])) : W("", !0);
|
|
1256
548
|
}
|
|
1257
|
-
}),
|
|
549
|
+
}), Ye = { class: "apmsu-label flex items-center justify-between" }, qe = { class: "relative" }, He = ["disabled"], Je = { class: "p-1.5 border-b border-gray-100 dark:border-zinc-800" }, Ge = ["placeholder", "autofocus"], Qe = { class: "max-h-60 overflow-auto" }, Xe = { class: "text-blue-500" }, Ze = ["onClick"], et = {
|
|
1258
550
|
key: 1,
|
|
1259
551
|
class: "p-4 text-center apmsu-hint-text"
|
|
1260
|
-
},
|
|
552
|
+
}, tt = {
|
|
1261
553
|
key: 0,
|
|
1262
554
|
class: "min-h-[20px] flex items-center"
|
|
1263
|
-
},
|
|
555
|
+
}, at = {
|
|
1264
556
|
key: 0,
|
|
1265
557
|
class: "apmsu-hint-text animate-pulse"
|
|
1266
|
-
},
|
|
558
|
+
}, st = {
|
|
1267
559
|
key: 1,
|
|
1268
560
|
class: "apmsu-hint-text dark:text-zinc-500"
|
|
1269
|
-
},
|
|
561
|
+
}, lt = {
|
|
1270
562
|
key: 2,
|
|
1271
563
|
class: "apmsu-hint-text"
|
|
1272
|
-
},
|
|
564
|
+
}, rt = {
|
|
1273
565
|
key: 3,
|
|
1274
566
|
class: "apmsu-hint-text"
|
|
1275
|
-
},
|
|
567
|
+
}, nt = /* @__PURE__ */ V({
|
|
1276
568
|
__name: "ModelSelect",
|
|
1277
569
|
props: {
|
|
1278
570
|
provider: {},
|
|
@@ -1286,105 +578,105 @@ const ve = {
|
|
|
1286
578
|
selectedModelName: {}
|
|
1287
579
|
},
|
|
1288
580
|
emits: ["select"],
|
|
1289
|
-
setup(e, { emit:
|
|
1290
|
-
const
|
|
1291
|
-
() =>
|
|
1292
|
-
(
|
|
581
|
+
setup(e, { emit: r }) {
|
|
582
|
+
const l = e, a = r, t = $(!1), s = $(""), f = $(null), u = A(() => Q[l.language]), i = A(
|
|
583
|
+
() => l.models.filter(
|
|
584
|
+
(d) => d.name.toLowerCase().includes(s.value.toLowerCase()) || d.id.toLowerCase().includes(s.value.toLowerCase())
|
|
1293
585
|
)
|
|
1294
|
-
),
|
|
586
|
+
), y = A(
|
|
1295
587
|
() => {
|
|
1296
|
-
var
|
|
1297
|
-
return ((
|
|
588
|
+
var d;
|
|
589
|
+
return ((d = l.models.find((h) => h.id === l.selectedModelId)) == null ? void 0 : d.name) || l.selectedModelName || l.selectedModelId;
|
|
1298
590
|
}
|
|
1299
591
|
);
|
|
1300
|
-
function c(
|
|
1301
|
-
|
|
592
|
+
function c(d) {
|
|
593
|
+
f.value && !f.value.contains(d.target) && (t.value = !1, s.value = "");
|
|
1302
594
|
}
|
|
1303
|
-
|
|
595
|
+
ne(() => {
|
|
1304
596
|
document.addEventListener("mousedown", c);
|
|
1305
|
-
}),
|
|
597
|
+
}), ie(() => {
|
|
1306
598
|
document.removeEventListener("mousedown", c);
|
|
1307
599
|
});
|
|
1308
|
-
function
|
|
1309
|
-
|
|
600
|
+
function g(d, h) {
|
|
601
|
+
a("select", d, h), t.value = !1, s.value = "";
|
|
1310
602
|
}
|
|
1311
|
-
return (
|
|
1312
|
-
var
|
|
1313
|
-
return
|
|
603
|
+
return (d, h) => {
|
|
604
|
+
var M, I;
|
|
605
|
+
return m(), p("div", {
|
|
1314
606
|
class: "apmsu-field",
|
|
1315
607
|
ref_key: "triggerRef",
|
|
1316
|
-
ref:
|
|
608
|
+
ref: f
|
|
1317
609
|
}, [
|
|
1318
|
-
|
|
1319
|
-
|
|
610
|
+
n("label", Ye, [
|
|
611
|
+
n("span", null, w(u.value.modelLabel), 1)
|
|
1320
612
|
]),
|
|
1321
|
-
|
|
1322
|
-
|
|
613
|
+
n("div", qe, [
|
|
614
|
+
n("button", {
|
|
1323
615
|
type: "button",
|
|
1324
|
-
onClick: h[0] || (h[0] = (
|
|
616
|
+
onClick: h[0] || (h[0] = (x) => !e.disabled && e.provider && (t.value = !t.value)),
|
|
1325
617
|
disabled: e.disabled || !e.provider,
|
|
1326
618
|
class: "apmsu-select-trigger"
|
|
1327
619
|
}, [
|
|
1328
|
-
|
|
1329
|
-
text:
|
|
1330
|
-
placeholder:
|
|
620
|
+
j(ue, {
|
|
621
|
+
text: y.value ? y.value : "",
|
|
622
|
+
placeholder: u.value.selectModel
|
|
1331
623
|
}, null, 8, ["text", "placeholder"]),
|
|
1332
|
-
(
|
|
1333
|
-
class:
|
|
624
|
+
(m(), p("svg", {
|
|
625
|
+
class: z(["apmsu-chevron", t.value ? "rotate-180" : ""]),
|
|
1334
626
|
fill: "none",
|
|
1335
627
|
stroke: "currentColor",
|
|
1336
628
|
viewBox: "0 0 24 24"
|
|
1337
629
|
}, [...h[3] || (h[3] = [
|
|
1338
|
-
|
|
630
|
+
n("path", {
|
|
1339
631
|
"stroke-linecap": "round",
|
|
1340
632
|
"stroke-linejoin": "round",
|
|
1341
633
|
"stroke-width": "2",
|
|
1342
634
|
d: "M19 9l-7 7-7-7"
|
|
1343
635
|
}, null, -1)
|
|
1344
636
|
])], 2))
|
|
1345
|
-
], 8,
|
|
1346
|
-
|
|
1347
|
-
class:
|
|
637
|
+
], 8, He),
|
|
638
|
+
n("div", {
|
|
639
|
+
class: z(["apmsu-dropdown origin-top", t.value ? "apmsu-dropdown-open" : ""])
|
|
1348
640
|
}, [
|
|
1349
|
-
|
|
1350
|
-
|
|
641
|
+
n("div", Je, [
|
|
642
|
+
ve(n("input", {
|
|
1351
643
|
type: "text",
|
|
1352
|
-
"onUpdate:modelValue": h[1] || (h[1] = (
|
|
1353
|
-
placeholder:
|
|
644
|
+
"onUpdate:modelValue": h[1] || (h[1] = (x) => s.value = x),
|
|
645
|
+
placeholder: u.value.searchModel,
|
|
1354
646
|
class: "apmsu-select-trigger",
|
|
1355
647
|
autofocus: t.value
|
|
1356
|
-
}, null, 8,
|
|
1357
|
-
[
|
|
648
|
+
}, null, 8, Ge), [
|
|
649
|
+
[he, s.value]
|
|
1358
650
|
])
|
|
1359
651
|
]),
|
|
1360
|
-
|
|
1361
|
-
|
|
652
|
+
n("div", Qe, [
|
|
653
|
+
s.value && !i.value.some((x) => x.id === s.value) ? (m(), p("button", {
|
|
1362
654
|
key: 0,
|
|
1363
655
|
type: "button",
|
|
1364
|
-
onClick: h[2] || (h[2] = (
|
|
656
|
+
onClick: h[2] || (h[2] = (x) => g(s.value)),
|
|
1365
657
|
class: "apmsu-dropdown-item bg-blue-50 dark:bg-blue-900/20 border-b"
|
|
1366
658
|
}, [
|
|
1367
|
-
|
|
1368
|
-
])) :
|
|
1369
|
-
(
|
|
1370
|
-
key:
|
|
659
|
+
n("span", Xe, w(u.value.useCustom) + ": " + w(s.value), 1)
|
|
660
|
+
])) : W("", !0),
|
|
661
|
+
(m(!0), p(R, null, ee(i.value, (x) => (m(), p("button", {
|
|
662
|
+
key: x.id,
|
|
1371
663
|
type: "button",
|
|
1372
|
-
onClick: (
|
|
1373
|
-
class:
|
|
664
|
+
onClick: (U) => g(x.id, x.name),
|
|
665
|
+
class: z(["apmsu-dropdown-item", e.selectedModelId === x.id && "apmsu-dropdown-item-active"])
|
|
1374
666
|
}, [
|
|
1375
|
-
|
|
1376
|
-
], 10,
|
|
1377
|
-
|
|
667
|
+
n("span", null, w(x.name), 1)
|
|
668
|
+
], 10, Ze))), 128)),
|
|
669
|
+
i.value.length === 0 && !s.value ? (m(), p("div", et, w(u.value.noModels), 1)) : W("", !0)
|
|
1378
670
|
])
|
|
1379
671
|
], 2)
|
|
1380
672
|
]),
|
|
1381
|
-
(
|
|
1382
|
-
e.isFetchingModels ? (
|
|
1383
|
-
])) :
|
|
673
|
+
(M = e.provider) != null && M.supportsModelsApi ? (m(), p("div", tt, [
|
|
674
|
+
e.isFetchingModels ? (m(), p("p", at, w(u.value.refreshingModels), 1)) : e.fetchModelError ? (m(), p("p", st, w(u.value[e.fetchModelError] || e.fetchModelError), 1)) : (I = e.provider) != null && I.needsApiKey && !e.hasApiKey ? (m(), p("p", lt, w(u.value.apiKeyTip), 1)) : (m(), p("p", rt, w(u.value.modelListUpdated), 1))
|
|
675
|
+
])) : W("", !0)
|
|
1384
676
|
], 512);
|
|
1385
677
|
};
|
|
1386
678
|
}
|
|
1387
|
-
}),
|
|
679
|
+
}), it = { class: "overflow-hidden" }, ot = ["value", "placeholder", "disabled"], dt = /* @__PURE__ */ V({
|
|
1388
680
|
__name: "BaseUrlInput",
|
|
1389
681
|
props: {
|
|
1390
682
|
provider: {},
|
|
@@ -1393,65 +685,65 @@ const ve = {
|
|
|
1393
685
|
language: { default: "zh" }
|
|
1394
686
|
},
|
|
1395
687
|
emits: ["update:baseUrl"],
|
|
1396
|
-
setup(e, { emit:
|
|
1397
|
-
const
|
|
1398
|
-
return (
|
|
1399
|
-
|
|
688
|
+
setup(e, { emit: r }) {
|
|
689
|
+
const l = e, a = r, t = $(!1), s = A(() => Q[l.language]);
|
|
690
|
+
return (f, u) => e.provider ? (m(), p(R, { key: 0 }, [
|
|
691
|
+
n("button", {
|
|
1400
692
|
type: "button",
|
|
1401
|
-
onClick:
|
|
693
|
+
onClick: u[0] || (u[0] = (i) => t.value = !t.value),
|
|
1402
694
|
class: "text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 flex items-center gap-1 transition-colors"
|
|
1403
695
|
}, [
|
|
1404
|
-
(
|
|
1405
|
-
class:
|
|
696
|
+
(m(), p("svg", {
|
|
697
|
+
class: z(["w-3 h-3 transition-transform", t.value && "rotate-90"]),
|
|
1406
698
|
fill: "none",
|
|
1407
699
|
stroke: "currentColor",
|
|
1408
700
|
viewBox: "0 0 24 24"
|
|
1409
|
-
}, [...
|
|
1410
|
-
|
|
701
|
+
}, [...u[2] || (u[2] = [
|
|
702
|
+
n("path", {
|
|
1411
703
|
"stroke-linecap": "round",
|
|
1412
704
|
"stroke-linejoin": "round",
|
|
1413
705
|
"stroke-width": "2",
|
|
1414
706
|
d: "M9 5l7 7-7 7"
|
|
1415
707
|
}, null, -1)
|
|
1416
708
|
])], 2)),
|
|
1417
|
-
|
|
709
|
+
D(" " + w(s.value.customBaseUrl), 1)
|
|
1418
710
|
]),
|
|
1419
|
-
|
|
711
|
+
n("div", {
|
|
1420
712
|
class: "grid transition-all duration-200 ease-out",
|
|
1421
|
-
style:
|
|
713
|
+
style: G({ gridTemplateRows: t.value ? "1fr" : "0fr" })
|
|
1422
714
|
}, [
|
|
1423
|
-
|
|
1424
|
-
|
|
715
|
+
n("div", it, [
|
|
716
|
+
n("input", {
|
|
1425
717
|
type: "text",
|
|
1426
718
|
value: e.baseUrl,
|
|
1427
|
-
onInput:
|
|
719
|
+
onInput: u[1] || (u[1] = (i) => a("update:baseUrl", i.target.value)),
|
|
1428
720
|
placeholder: e.provider.baseUrl,
|
|
1429
721
|
disabled: e.disabled,
|
|
1430
722
|
class: "apmsu-input apmsu-input-default"
|
|
1431
|
-
}, null, 40,
|
|
723
|
+
}, null, 40, ot)
|
|
1432
724
|
])
|
|
1433
725
|
], 4)
|
|
1434
|
-
], 64)) :
|
|
726
|
+
], 64)) : W("", !0);
|
|
1435
727
|
}
|
|
1436
|
-
}),
|
|
728
|
+
}), ut = { class: "apmsu-card" }, ct = {
|
|
1437
729
|
key: 0,
|
|
1438
730
|
class: "text-lg font-semibold mb-4"
|
|
1439
|
-
},
|
|
731
|
+
}, vt = { class: "space-y-3" }, ht = { class: "space-y-4" }, ft = { class: "pt-2 space-y-2" }, pt = { class: "flex gap-2" }, mt = ["disabled"], gt = {
|
|
1440
732
|
key: 0,
|
|
1441
733
|
class: "flex items-center justify-center gap-2"
|
|
1442
|
-
},
|
|
734
|
+
}, yt = {
|
|
1443
735
|
key: 1,
|
|
1444
736
|
class: "flex items-center justify-center gap-2"
|
|
1445
|
-
},
|
|
737
|
+
}, bt = {
|
|
1446
738
|
key: 2,
|
|
1447
739
|
class: "flex items-center justify-center gap-2"
|
|
1448
|
-
},
|
|
740
|
+
}, xt = ["disabled"], kt = {
|
|
1449
741
|
key: 0,
|
|
1450
742
|
class: "flex items-center justify-center gap-2"
|
|
1451
|
-
},
|
|
743
|
+
}, Ct = { class: "overflow-hidden" }, wt = { class: "p-2 rounded-md bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800" }, Mt = { class: "text-xs text-red-600 dark:text-red-400 line-clamp-3 text-left" }, It = {
|
|
1452
744
|
key: 1,
|
|
1453
745
|
class: "mt-6 border border-gray-200/50 dark:border-zinc-800 rounded-lg overflow-hidden"
|
|
1454
|
-
},
|
|
746
|
+
}, $t = { class: "text-xs font-medium text-gray-500 dark:text-zinc-500 uppercase tracking-wider" }, Ut = { class: "overflow-hidden" }, St = { class: "text-xs text-gray-600 dark:text-zinc-400 font-mono overflow-x-auto leading-relaxed p-4 bg-zinc-50 dark:bg-zinc-900/50" }, zt = /* @__PURE__ */ V({
|
|
1455
747
|
__name: "AIConfigForm",
|
|
1456
748
|
props: {
|
|
1457
749
|
proxyUrl: {},
|
|
@@ -1467,125 +759,125 @@ const ve = {
|
|
|
1467
759
|
modelFetcher: {}
|
|
1468
760
|
},
|
|
1469
761
|
emits: ["save", "testResult", "change"],
|
|
1470
|
-
setup(e, { emit:
|
|
1471
|
-
const
|
|
762
|
+
setup(e, { emit: r }) {
|
|
763
|
+
const l = e, a = r, {
|
|
1472
764
|
providerId: t,
|
|
1473
|
-
apiKey:
|
|
1474
|
-
model:
|
|
1475
|
-
modelName:
|
|
1476
|
-
baseUrl:
|
|
1477
|
-
models:
|
|
765
|
+
apiKey: s,
|
|
766
|
+
model: f,
|
|
767
|
+
modelName: u,
|
|
768
|
+
baseUrl: i,
|
|
769
|
+
models: y,
|
|
1478
770
|
testStatus: c,
|
|
1479
|
-
testResult:
|
|
1480
|
-
provider:
|
|
771
|
+
testResult: g,
|
|
772
|
+
provider: d,
|
|
1481
773
|
providers: h,
|
|
1482
|
-
isValid:
|
|
1483
|
-
config:
|
|
1484
|
-
runTest:
|
|
1485
|
-
save:
|
|
1486
|
-
selectModel:
|
|
774
|
+
isValid: M,
|
|
775
|
+
config: I,
|
|
776
|
+
runTest: x,
|
|
777
|
+
save: U,
|
|
778
|
+
selectModel: k,
|
|
1487
779
|
isFetchingModels: S,
|
|
1488
|
-
fetchModelError:
|
|
1489
|
-
} =
|
|
1490
|
-
proxyUrl:
|
|
1491
|
-
providerConfig:
|
|
1492
|
-
initialConfig:
|
|
1493
|
-
onSerialize:
|
|
1494
|
-
onDeserialize:
|
|
1495
|
-
modelFetcher:
|
|
1496
|
-
}),
|
|
1497
|
-
|
|
1498
|
-
|
|
780
|
+
fetchModelError: K
|
|
781
|
+
} = ye({
|
|
782
|
+
proxyUrl: l.proxyUrl,
|
|
783
|
+
providerConfig: l.config,
|
|
784
|
+
initialConfig: l.initialConfig,
|
|
785
|
+
onSerialize: l.onSerialize,
|
|
786
|
+
onDeserialize: l.onDeserialize,
|
|
787
|
+
modelFetcher: l.modelFetcher
|
|
788
|
+
}), L = A(() => Q[l.language]), T = $("idle"), C = $(!1);
|
|
789
|
+
q([t, s, f, i], () => {
|
|
790
|
+
a("change", {
|
|
1499
791
|
providerId: t.value,
|
|
1500
|
-
apiKey:
|
|
1501
|
-
model:
|
|
1502
|
-
baseUrl:
|
|
792
|
+
apiKey: s.value,
|
|
793
|
+
model: f.value,
|
|
794
|
+
baseUrl: i.value
|
|
1503
795
|
});
|
|
1504
|
-
}),
|
|
1505
|
-
|
|
796
|
+
}), q(g, (o) => {
|
|
797
|
+
o && a("testResult", o);
|
|
1506
798
|
});
|
|
1507
|
-
function
|
|
1508
|
-
|
|
1509
|
-
|
|
799
|
+
function N() {
|
|
800
|
+
U(), T.value = "saved", a("save", I.value), setTimeout(() => {
|
|
801
|
+
T.value = "idle";
|
|
1510
802
|
}, 2e3);
|
|
1511
803
|
}
|
|
1512
|
-
function
|
|
1513
|
-
t.value =
|
|
804
|
+
function E(o) {
|
|
805
|
+
t.value = o;
|
|
1514
806
|
}
|
|
1515
|
-
function
|
|
1516
|
-
|
|
807
|
+
function H(o) {
|
|
808
|
+
s.value = o;
|
|
1517
809
|
}
|
|
1518
|
-
function
|
|
1519
|
-
|
|
810
|
+
function Y(o, b) {
|
|
811
|
+
k(o, b);
|
|
1520
812
|
}
|
|
1521
|
-
function
|
|
1522
|
-
|
|
813
|
+
function O(o) {
|
|
814
|
+
i.value = o;
|
|
1523
815
|
}
|
|
1524
|
-
return (
|
|
1525
|
-
var
|
|
1526
|
-
return
|
|
1527
|
-
e.title ? (
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
providers:
|
|
1531
|
-
selectedProviderId:
|
|
1532
|
-
onSelect:
|
|
816
|
+
return (o, b) => {
|
|
817
|
+
var F, P, _, oe;
|
|
818
|
+
return m(), p("div", ut, [
|
|
819
|
+
e.title ? (m(), p("h2", ct, w(e.title), 1)) : W("", !0),
|
|
820
|
+
n("div", vt, [
|
|
821
|
+
j(Be, {
|
|
822
|
+
providers: v(h),
|
|
823
|
+
selectedProviderId: v(t),
|
|
824
|
+
onSelect: E,
|
|
1533
825
|
disabled: e.disabled,
|
|
1534
826
|
language: e.language
|
|
1535
827
|
}, null, 8, ["providers", "selectedProviderId", "disabled", "language"]),
|
|
1536
|
-
|
|
1537
|
-
provider:
|
|
1538
|
-
baseUrl:
|
|
1539
|
-
"onUpdate:baseUrl":
|
|
828
|
+
j(dt, {
|
|
829
|
+
provider: v(d),
|
|
830
|
+
baseUrl: v(i),
|
|
831
|
+
"onUpdate:baseUrl": O,
|
|
1540
832
|
disabled: e.disabled,
|
|
1541
833
|
language: e.language
|
|
1542
834
|
}, null, 8, ["provider", "baseUrl", "disabled", "language"]),
|
|
1543
|
-
|
|
1544
|
-
class:
|
|
835
|
+
n("div", {
|
|
836
|
+
class: z(["transition-all duration-500 ease-in-out", v(t) ? "max-h-[1000px] opacity-100 overflow-visible" : "max-h-0 opacity-0 overflow-hidden"])
|
|
1545
837
|
}, [
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
provider:
|
|
1549
|
-
apiKey:
|
|
1550
|
-
"onUpdate:apiKey":
|
|
1551
|
-
testStatus:
|
|
838
|
+
n("div", ht, [
|
|
839
|
+
j(Ve, {
|
|
840
|
+
provider: v(d),
|
|
841
|
+
apiKey: v(s),
|
|
842
|
+
"onUpdate:apiKey": H,
|
|
843
|
+
testStatus: v(c),
|
|
1552
844
|
disabled: e.disabled,
|
|
1553
845
|
language: e.language,
|
|
1554
|
-
isFetchingModels:
|
|
1555
|
-
fetchModelError:
|
|
846
|
+
isFetchingModels: v(S),
|
|
847
|
+
fetchModelError: v(K)
|
|
1556
848
|
}, null, 8, ["provider", "apiKey", "testStatus", "disabled", "language", "isFetchingModels", "fetchModelError"]),
|
|
1557
|
-
|
|
1558
|
-
provider:
|
|
1559
|
-
models:
|
|
1560
|
-
selectedModelId:
|
|
1561
|
-
onSelect:
|
|
1562
|
-
hasApiKey: !!
|
|
849
|
+
j(nt, {
|
|
850
|
+
provider: v(d),
|
|
851
|
+
models: v(y),
|
|
852
|
+
selectedModelId: v(f),
|
|
853
|
+
onSelect: Y,
|
|
854
|
+
hasApiKey: !!v(s),
|
|
1563
855
|
disabled: e.disabled,
|
|
1564
856
|
language: e.language,
|
|
1565
|
-
isFetchingModels:
|
|
1566
|
-
fetchModelError:
|
|
1567
|
-
selectedModelName:
|
|
857
|
+
isFetchingModels: v(S),
|
|
858
|
+
fetchModelError: v(K),
|
|
859
|
+
selectedModelName: v(u)
|
|
1568
860
|
}, null, 8, ["provider", "models", "selectedModelId", "hasApiKey", "disabled", "language", "isFetchingModels", "fetchModelError", "selectedModelName"])
|
|
1569
861
|
])
|
|
1570
862
|
], 2),
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
863
|
+
n("div", ft, [
|
|
864
|
+
n("div", pt, [
|
|
865
|
+
n("button", {
|
|
1574
866
|
type: "button",
|
|
1575
|
-
onClick:
|
|
1576
|
-
disabled: !
|
|
1577
|
-
class:
|
|
867
|
+
onClick: b[0] || (b[0] = (ce) => v(x)()),
|
|
868
|
+
disabled: !v(t) || !v(s) || !v(f) || e.disabled || v(c) === "testing",
|
|
869
|
+
class: z([
|
|
1578
870
|
"apmsu-btn flex-1",
|
|
1579
|
-
|
|
871
|
+
v(c) === "success" ? "apmsu-btn-success" : v(c) === "error" ? "bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-900/40" : "apmsu-btn-ghost border border-gray-200 dark:border-zinc-700"
|
|
1580
872
|
])
|
|
1581
873
|
}, [
|
|
1582
|
-
|
|
1583
|
-
|
|
874
|
+
v(c) === "testing" ? (m(), p("span", gt, [
|
|
875
|
+
b[2] || (b[2] = n("svg", {
|
|
1584
876
|
class: "apmsu-icon-spin",
|
|
1585
877
|
viewBox: "0 0 24 24",
|
|
1586
878
|
fill: "none"
|
|
1587
879
|
}, [
|
|
1588
|
-
|
|
880
|
+
n("circle", {
|
|
1589
881
|
class: "opacity-25",
|
|
1590
882
|
cx: "12",
|
|
1591
883
|
cy: "12",
|
|
@@ -1593,86 +885,86 @@ const ve = {
|
|
|
1593
885
|
stroke: "currentColor",
|
|
1594
886
|
"stroke-width": "4"
|
|
1595
887
|
}),
|
|
1596
|
-
|
|
888
|
+
n("path", {
|
|
1597
889
|
class: "opacity-75",
|
|
1598
890
|
fill: "currentColor",
|
|
1599
891
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
1600
892
|
})
|
|
1601
893
|
], -1)),
|
|
1602
|
-
|
|
1603
|
-
])) :
|
|
1604
|
-
|
|
894
|
+
D(" " + w(L.value.testing), 1)
|
|
895
|
+
])) : v(c) === "success" ? (m(), p("span", yt, [
|
|
896
|
+
b[3] || (b[3] = n("svg", {
|
|
1605
897
|
class: "apmsu-icon-success",
|
|
1606
898
|
fill: "currentColor",
|
|
1607
899
|
viewBox: "0 0 24 24"
|
|
1608
900
|
}, [
|
|
1609
|
-
|
|
901
|
+
n("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" })
|
|
1610
902
|
], -1)),
|
|
1611
|
-
|
|
1612
|
-
])) :
|
|
1613
|
-
|
|
903
|
+
D(" " + w(L.value.testSuccess) + " " + w((F = v(g)) != null && F.latencyMs ? `${v(g).latencyMs}ms` : ""), 1)
|
|
904
|
+
])) : v(c) === "error" ? (m(), p("span", bt, [
|
|
905
|
+
b[4] || (b[4] = n("svg", {
|
|
1614
906
|
class: "apmsu-icon-error",
|
|
1615
907
|
fill: "currentColor",
|
|
1616
908
|
viewBox: "0 0 24 24"
|
|
1617
909
|
}, [
|
|
1618
|
-
|
|
910
|
+
n("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" })
|
|
1619
911
|
], -1)),
|
|
1620
|
-
|
|
1621
|
-
])) : (
|
|
1622
|
-
|
|
912
|
+
D(" " + w(L.value.testFailed), 1)
|
|
913
|
+
])) : (m(), p(R, { key: 3 }, [
|
|
914
|
+
D(w(L.value.testConnection), 1)
|
|
1623
915
|
], 64))
|
|
1624
|
-
], 10,
|
|
1625
|
-
|
|
1626
|
-
onClick:
|
|
1627
|
-
disabled: !
|
|
1628
|
-
class:
|
|
916
|
+
], 10, mt),
|
|
917
|
+
n("button", {
|
|
918
|
+
onClick: N,
|
|
919
|
+
disabled: !v(M) || e.disabled,
|
|
920
|
+
class: z(["apmsu-btn flex-1", T.value === "saved" ? "apmsu-btn-success" : "apmsu-btn-primary"])
|
|
1629
921
|
}, [
|
|
1630
|
-
|
|
1631
|
-
|
|
922
|
+
T.value === "saved" ? (m(), p("span", kt, [
|
|
923
|
+
b[5] || (b[5] = n("svg", {
|
|
1632
924
|
class: "w-4 h-4",
|
|
1633
925
|
fill: "none",
|
|
1634
926
|
stroke: "currentColor",
|
|
1635
927
|
viewBox: "0 0 24 24"
|
|
1636
928
|
}, [
|
|
1637
|
-
|
|
929
|
+
n("path", {
|
|
1638
930
|
"stroke-linecap": "round",
|
|
1639
931
|
"stroke-linejoin": "round",
|
|
1640
932
|
"stroke-width": "2.5",
|
|
1641
933
|
d: "M5 13l4 4L19 7"
|
|
1642
934
|
})
|
|
1643
935
|
], -1)),
|
|
1644
|
-
|
|
1645
|
-
])) : (
|
|
1646
|
-
|
|
936
|
+
D(" " + w(L.value.saved), 1)
|
|
937
|
+
])) : (m(), p(R, { key: 1 }, [
|
|
938
|
+
D(w(e.saveButtonText || L.value.save), 1)
|
|
1647
939
|
], 64))
|
|
1648
|
-
], 10,
|
|
940
|
+
], 10, xt)
|
|
1649
941
|
]),
|
|
1650
|
-
|
|
942
|
+
n("div", {
|
|
1651
943
|
class: "grid transition-all duration-200 ease-out",
|
|
1652
|
-
style:
|
|
944
|
+
style: G({ gridTemplateRows: !((P = v(g)) != null && P.success) && ((_ = v(g)) != null && _.message) && v(c) !== "testing" && v(c) !== "success" ? "1fr" : "0fr" })
|
|
1653
945
|
}, [
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
946
|
+
n("div", Ct, [
|
|
947
|
+
n("div", wt, [
|
|
948
|
+
n("p", Mt, w((oe = v(g)) == null ? void 0 : oe.message), 1)
|
|
1657
949
|
])
|
|
1658
950
|
])
|
|
1659
951
|
], 4)
|
|
1660
952
|
])
|
|
1661
953
|
]),
|
|
1662
|
-
e.showPreview &&
|
|
1663
|
-
|
|
954
|
+
e.showPreview && v(d) ? (m(), p("div", It, [
|
|
955
|
+
n("button", {
|
|
1664
956
|
type: "button",
|
|
1665
|
-
onClick:
|
|
957
|
+
onClick: b[1] || (b[1] = (ce) => C.value = !C.value),
|
|
1666
958
|
class: "w-full flex items-center justify-between px-4 py-3 bg-zinc-50 dark:bg-zinc-900/50 hover:bg-zinc-100 dark:hover:bg-zinc-800/50 transition-colors"
|
|
1667
959
|
}, [
|
|
1668
|
-
|
|
1669
|
-
(
|
|
1670
|
-
class:
|
|
960
|
+
n("h3", $t, w(L.value.preview), 1),
|
|
961
|
+
(m(), p("svg", {
|
|
962
|
+
class: z(["w-4 h-4 text-gray-400 transition-transform duration-200", C.value ? "rotate-180" : ""]),
|
|
1671
963
|
fill: "none",
|
|
1672
964
|
stroke: "currentColor",
|
|
1673
965
|
viewBox: "0 0 24 24"
|
|
1674
|
-
}, [...
|
|
1675
|
-
|
|
966
|
+
}, [...b[6] || (b[6] = [
|
|
967
|
+
n("path", {
|
|
1676
968
|
"stroke-linecap": "round",
|
|
1677
969
|
"stroke-linejoin": "round",
|
|
1678
970
|
"stroke-width": "2",
|
|
@@ -1680,28 +972,28 @@ const ve = {
|
|
|
1680
972
|
}, null, -1)
|
|
1681
973
|
])], 2))
|
|
1682
974
|
]),
|
|
1683
|
-
|
|
975
|
+
n("div", {
|
|
1684
976
|
class: "grid transition-all duration-200 ease-out",
|
|
1685
|
-
style:
|
|
977
|
+
style: G({ gridTemplateRows: C.value ? "1fr" : "0fr" })
|
|
1686
978
|
}, [
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
provider:
|
|
1690
|
-
apiFormat:
|
|
1691
|
-
baseUrl:
|
|
1692
|
-
model:
|
|
1693
|
-
hasApiKey: !!
|
|
979
|
+
n("div", Ut, [
|
|
980
|
+
n("pre", St, "" + w(JSON.stringify({
|
|
981
|
+
provider: v(d).name,
|
|
982
|
+
apiFormat: v(d).apiFormat,
|
|
983
|
+
baseUrl: v(i) || v(d).baseUrl,
|
|
984
|
+
model: v(f) || L.value.unselected,
|
|
985
|
+
hasApiKey: !!v(s)
|
|
1694
986
|
}, null, 2)) + `
|
|
1695
987
|
`, 1)
|
|
1696
988
|
])
|
|
1697
989
|
], 4)
|
|
1698
|
-
])) :
|
|
990
|
+
])) : W("", !0)
|
|
1699
991
|
]);
|
|
1700
992
|
};
|
|
1701
993
|
}
|
|
1702
994
|
});
|
|
1703
995
|
export {
|
|
1704
996
|
zt as AIConfigForm,
|
|
1705
|
-
|
|
997
|
+
ye as useAIConfig
|
|
1706
998
|
};
|
|
1707
999
|
//# sourceMappingURL=index.js.map
|