dsh-model-think-level 1.1.8 → 2.0.0
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/README.md +38 -0
- package/lib/client/ComposerSlider.d.ts +9 -9
- package/lib/client/EffortEditor.d.ts +9 -6
- package/lib/client/KeyManager.d.ts +36 -10
- package/lib/client/ProtocolMenu.d.ts +51 -0
- package/lib/client/events.d.ts +26 -0
- package/lib/client/injection/add-card.d.ts +4 -0
- package/lib/client/injection/create-card-pane.d.ts +15 -0
- package/lib/client/injection/create-key-seat.d.ts +54 -0
- package/lib/client/injection/create-keys-pane.d.ts +46 -0
- package/lib/client/injection/key-reveal.d.ts +12 -0
- package/lib/client/injection/models-page-editor.d.ts +83 -0
- package/lib/client/injection/provider-endpoints.d.ts +70 -0
- package/lib/client/injection/staged-keys.d.ts +169 -0
- package/lib/client/key-manager-client.d.ts +89 -12
- package/lib/client/locales.d.ts +48 -6
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/types.d.ts +35 -2
- package/lib/client.js +1773 -256
- package/lib/client.js.map +4 -4
- package/lib/discovery-merge.d.ts +35 -0
- package/lib/headers-fetch.d.ts +53 -3
- package/lib/headers-pi-ai.d.ts +31 -1
- package/lib/index.d.ts +3 -19
- package/lib/index.js +1462 -139
- package/lib/index.js.map +4 -4
- package/lib/key-index.d.ts +58 -1
- package/lib/key-probe.d.ts +126 -0
- package/lib/key-refs.d.ts +106 -0
- package/lib/key-route-core.d.ts +415 -0
- package/lib/knowledge.d.ts +6 -5
- package/lib/listing.d.ts +118 -0
- package/lib/multi-key-listing.d.ts +101 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -4,14 +4,88 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
|
|
7
|
-
"use strict";var Qt=Object.defineProperty;var Fd=Object.getOwnPropertyDescriptor;var qd=Object.getOwnPropertyNames;var Wd=Object.prototype.hasOwnProperty;var Kd=(e,t,n)=>t in e?Qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Bd=(e,t)=>{for(var n in t)Qt(e,n,{get:t[n],enumerable:!0})},Ud=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of qd(t))!Wd.call(e,o)&&o!==n&&Qt(e,o,{get:()=>t[o],enumerable:!(r=Fd(t,o))||r.enumerable});return e};var Gd=e=>Ud(Qt({},"__esModule",{value:!0}),e);var Io=(e,t,n)=>Kd(e,typeof t!="symbol"?t+"":t,n);var Ec={};Bd(Ec,{EffortEditor:()=>kn,apply:()=>xc,baselineModelsOf:()=>Ei,compatOf:()=>gn,createEditorApi:()=>yn,defaultEffortOf:()=>bn,describeNamespace:()=>te,effortsOf:()=>pn,findModelMenu:()=>Dr,findModelTrigger:()=>Cr,inject:()=>vc,inputOf:()=>mn,name:()=>wc,nameOf:()=>hn,providerHeadersOf:()=>Lr,providersOf:()=>ce,routeIsDeclared:()=>Ye,userProvidersOf:()=>Mr,writeModelRows:()=>Ht,writeProviderHeaders:()=>Ot});module.exports=Gd(Ec);var Hd=require("react");var re="dsh-model-think-level",No="/dsh-model-think-level/raw-models";var Zt="/dsh-model-think-level/provider-key",Do="/dsh-model-think-level/key-index",Co="/dsh-model-think-level/autofill-config",Po="/dsh-model-think-level/headers-config",fe="llm-pi-ai",ge="reasoningEffortsUnset",_e="inputUnset",st="reasoningEffortsAutofilled",at="defaultEffort",ar=re;var Lt=require("react");function Fo(e){let{locale:t}=e,n=(0,Lt.useCallback)(o=>t.subscribe(o),[t]),r=(0,Lt.useCallback)(()=>t.getSnapshot().revision??0,[t]);return(0,Lt.useSyncExternalStore)(n,r),e.children()}var qo={reasoningEffort:"Reasoning effort",thinkingMode:"Thinking",thinkingModeOff:"Off \u2014 this model is declared as not reasoning.",autoAdapt:"Auto-adapt",autoAdaptAll:"Auto-detect thinking levels",autoAdaptWorking:"Detecting\u2026",autoAdaptDone:"Adapted {count} \xB7 save to write",autoAdaptEmpty:"All already configured",autoAdaptUnsuggested:"No suggestion available",autoAdaptBlocked:"No models to adapt yet",autoAdaptFailed:"Detection failed: {message}",autoAdaptDoneHint:"Held for {count} model(s): they land when this card is saved.",autoAdaptEmptyHint:"Every model of this provider already declares its thinking levels.",autoAdaptUnsuggestedHint:"The models that still need a declaration have no knowledge-base match \u2014 adapt them one by one.",autoAdaptBlockedHint:"Nothing to adapt yet: the card has no models, is not saved, or the settings document is read-only.",apply:"Apply",reset:"Reset",pendingSave:"Modified \u2014 it will be written when you save this card.",pendingHint:"Cancel or reload discards it, exactly like the card's own fields.",appliedHint:"Applied suggestion from {source} \xB7 confidence: {confidence}",inputHintEndpoint:"Modality advice comes from the endpoint listing.",inputHintKnowledge:"Modality advice comes from the knowledge base.",inputHintHeuristic:"Modality guessed from the name alone (low confidence) \u2014 verify.",referenceTitle:"Reference capacities (hints only, never auto-filled)",contextWindowLabel:"Context window",maxTokensLabel:"Max output",inputModality:"Input modalities",modalityImage:"Image input",modalityInherit:"Not declared \u2014 the provider default applies (usually text-only).",clearDeclaration:"Clear declaration",confidence_high:"high",confidence_medium:"medium",confidence_low:"low \u2014 verify before relying on it",noSuggestion:"No suggestion is available for this model.",writeError:"Failed: {message}",renderFailed:"Reasoning-effort editor failed to render",wirePlaceholder:"Wire value",wireValue:"value",reasoningDisabled:"No reasoning-effort control declared for this model (false) \u2014 do not arm thinking levels.",bareHint:"Clearing every level removes the declaration \u2014 requests go out bare (provider default), which some relays require.",defaultRiskDisabled:"No off level: Default and provider tests send thinking: disabled, which this model rejects (e.g. 1210).",defaultRiskQwen:"No off level: Default sends enable_thinking: false \u2014 only fails where the upstream requires thinking on.",stagedHint:"Not saved yet. Staged settings are applied automatically once the model is saved.",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"Model and reasoning-effort rows",sliderToggleDescription:"Show the model row and the reasoning-level chips in the model menu; the levels follow the current model.",sliderToggleAria:"Enable the model and reasoning-effort rows",settingOn:"On",settingOff:"Off",sliderNoLevels:"The current model exposes no reasoning-effort levels.",triggerFallback:"Select model",effortDefault:"Default",modelRowLabel:"Model",effortRowLabel:"Reasoning level",tagVision:"Image input",tagThinking:"Sends thinking levels",sliderNoCurrent:"No model selected.",defaultEffortLabel:"Default effort",defaultEffortUnset:"Follow memory",defaultEffortHint:"The level every new session starts this model at \u2014 it outranks the remembered levels. Within a session, a level you pick by hand always wins. Empty follows the memory chain.",clearDefaultEffort:"Clear pick",modelSearchPlaceholder:"Search models\u2026",modelSearchNoMatches:"No matching models",modelSearchClear:"Clear search",modelSearchFailed:"Model search failed to render",editorTabsLabel:"Editor sections",editorTabProvider:"Provider",editorTabModels:"Models",editorTabAdvanced:"Advanced",keyRevealShow:"Show key",keyRevealHide:"Hide key",keyRevealFailed:"Stored key unavailable",keysLoading:"Loading keys\u2026",keysAdd:"Add another key",keysAddConfirm:"Add",keysEnable:"Use {name}",keysEnabled:"Enabled",keysMissing:"Not stored",keysEdit:"Edit",keysRemove:"Delete",keysConfirmRemove:"Confirm delete",keysCancel:"Cancel",keysSave:"Save",keysAlias:"Label",keysAliasPlaceholder:"Name (optional), e.g. Team",keysValue:"Key",keysValuePlaceholder:"Paste the API key",keysNewValuePlaceholder:"Paste the new API key",keysAddIllegal:"A key is printable ASCII without spaces.",keysAdded:"Key stored.",keysRenamed:"Label saved.",keysReplaced:"Key replaced.",keysRemoved:"Key removed.",keysEnabledNote:"{name} is now in use.",keysUnreachable:"The plugin\u2019s key route did not answer.",keysPanelFailed:"Key manager failed to render",headersTitle:"Request headers",headersHint:"Sent on every request of this route.",headersEmpty:"No extra request headers are configured.",headersAdd:"Add header",headersName:"Name",headersNamePlaceholder:"e.g. x-company",headersValue:"Value",headersEdit:"Edit",headersSave:"Save",headersCancel:"Cancel",headersClear:"Clear all",headersSaved:"Saved.",headersCleared:"Cleared \u2014 this route sends no extra request headers.",headersReadOnly:"The settings document is not writable.",headersUserAgentTitle:"User-Agent (taken over at the fetch layer)",headersUserAgentHint:"The official adapter discards a configured user-agent \u2014 the name is reserved for client attribution \u2014 so this plugin adds it at the request layer. Filling it in really does replace the outgoing User-Agent.",headersUserAgentClear:"Do not override",headersUserAgentPlaceholder:"e.g. claude-cli/2.1.161 (external, cli)",headersConflictOrigin:"Routes sharing one endpoint declare different request-header values: when the model in a request body does not identify exactly one of them, that request falls back to the first route.",headersConflictPatched:"The installed dsh-llm-pi-ai already carries a request-header patch: enter values in the headers above and this plugin need not take the request layer over.",headersConflictSiblings:"A plugin rewriting the same layer is installed: {names}. Only one user-agent rewrite should be active at a time, or the last writer on the wire wins.",headersError:"Save failed: {error}",headersNoRoute:"This route is no longer in the settings document \u2014 save the official card once first.",providerReorderAria:"Reorder {provider}",providerReorderHint:"Drag to set the provider order \u2014 the model switcher follows it.",providerToggleAria:"Enable {provider}",providerToggleHint:"A disabled provider is not listed by the model switcher.",providerDisabledGroupShow:"Show {count} switched-off provider(s)",providerDisabledGroupHide:"Hide {count} switched-off provider(s)",providerDisabledGroupHint:"A switched-off provider keeps its configuration and folds away here \u2014 unfold it to switch it back on.",providerRemoveDisabled:"Delete",providerRemoveLocked:"A built-in provider cannot be deleted.",modelReorderAria:"Reorder {model}",modelReorderHint:"Drag to set the order of this provider\u2019s models \u2014 the model switcher follows it."},Wo={reasoningEffort:"\u601D\u8003\u5F3A\u5EA6",thinkingMode:"\u601D\u8003",thinkingModeOff:"\u5DF2\u5173\u95ED\u2014\u2014\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u4E0D\u601D\u8003\u3002",autoAdapt:"\u81EA\u52A8\u9002\u914D",autoAdaptAll:"\u81EA\u52A8\u83B7\u53D6\u601D\u8003\u7B49\u7EA7",autoAdaptWorking:"\u83B7\u53D6\u4E2D\u2026",autoAdaptDone:"\u5DF2\u9002\u914D {count} \u4E2A\xB7\u4FDD\u5B58\u540E\u5199\u5165",autoAdaptEmpty:"\u5DF2\u5168\u90E8\u914D\u7F6E",autoAdaptUnsuggested:"\u6CA1\u6709\u53EF\u7528\u5EFA\u8BAE",autoAdaptBlocked:"\u6682\u65E0\u53EF\u9002\u914D\u6A21\u578B",autoAdaptFailed:"\u83B7\u53D6\u5931\u8D25\uFF1A{message}",autoAdaptDoneHint:"\u5DF2\u6682\u5B58 {count} \u4E2A\u6A21\u578B\u7684\u9002\u914D\u7ED3\u679C\uFF1A\u70B9\u8BE5\u5361\u7247\u7684\u300C\u4FDD\u5B58\u300D\u540E\u5199\u5165\u3002",autoAdaptEmptyHint:"\u8BE5\u4F9B\u5E94\u5546\u4E0B\u6240\u6709\u6A21\u578B\u90FD\u5DF2\u58F0\u660E\u601D\u8003\u7B49\u7EA7\u3002",autoAdaptUnsuggestedHint:"\u4ECD\u9700\u58F0\u660E\u7684\u6A21\u578B\u6CA1\u6709\u77E5\u8BC6\u5E93\u5339\u914D\u2014\u2014\u8BF7\u9010\u4E2A\u6253\u5F00\u6A21\u578B\u884C\u624B\u52A8\u9002\u914D\u3002",autoAdaptBlockedHint:"\u6682\u65E0\u53EF\u9002\u914D\u5185\u5BB9\uFF1A\u8BE5\u5361\u7247\u8FD8\u6CA1\u6709\u6A21\u578B\u3001\u5C1A\u672A\u4FDD\u5B58\uFF0C\u6216\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",apply:"\u5E94\u7528",reset:"\u653E\u5F03\u4FEE\u6539",pendingSave:"\u5DF2\u4FEE\u6539\u2014\u2014\u70B9\u5361\u7247\u300C\u4FDD\u5B58\u300D\u65F6\u4E00\u8D77\u5199\u5165\u3002",pendingHint:"\u70B9\u300C\u53D6\u6D88\u300D\u6216\u5237\u65B0\u9875\u9762\u4F1A\u4E00\u5E76\u4E22\u5F03\uFF0C\u4E0E\u5361\u7247\u81EA\u8EAB\u7684\u5B57\u6BB5\u4E00\u81F4\u3002",appliedHint:"\u5DF2\u6309 {source} \u5E94\u7528\u5EFA\u8BAE \xB7 \u7F6E\u4FE1\u5EA6\uFF1A{confidence}",inputHintEndpoint:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u7AEF\u70B9\u5217\u8868\u3002",inputHintKnowledge:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u77E5\u8BC6\u5E93\u3002",inputHintHeuristic:"\u6A21\u6001\u5EFA\u8BAE\u4EC5\u6309\u547D\u540D\u63A8\u65AD\uFF08\u4F4E\u7F6E\u4FE1\u5EA6\uFF09\uFF0C\u8BF7\u6838\u5BF9\u3002",referenceTitle:"\u53C2\u8003\u5BB9\u91CF\uFF08\u4EC5\u63D0\u793A\uFF0C\u4E0D\u81EA\u52A8\u586B\u5145\uFF09",contextWindowLabel:"\u4E0A\u4E0B\u6587\u7A97\u53E3",maxTokensLabel:"\u6700\u5927\u8F93\u51FA",inputModality:"\u8F93\u5165\u6A21\u6001",modalityImage:"\u56FE\u7247\u8F93\u5165",modalityInherit:"\u672A\u58F0\u660E\u2014\u2014\u7EE7\u627F\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF08\u901A\u5E38\u4EC5\u6587\u672C\uFF09\u3002",clearDeclaration:"\u6E05\u9664\u58F0\u660E",confidence_high:"\u9AD8",confidence_medium:"\u4E2D",confidence_low:"\u4F4E\uFF08\u5EFA\u8BAE\u6838\u5BF9\uFF09",noSuggestion:"\u6CA1\u6709\u9002\u7528\u4E8E\u8BE5\u6A21\u578B\u7684\u5EFA\u8BAE\u3002",writeError:"\u5199\u5165\u5931\u8D25\uFF1A{message}",renderFailed:"\u601D\u8003\u5F3A\u5EA6\u7F16\u8F91\u5668\u6E32\u67D3\u5931\u8D25",wirePlaceholder:"\u7EBF\u4E0A\u53D6\u503C",wireValue:"\u53D6\u503C",reasoningDisabled:"\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u65E0 reasoning-effort \u63A7\u5236\uFF08false\uFF09\u2014\u2014\u8BF7\u52FF\u52FE\u9009\u601D\u8003\u6863\u3002",bareHint:"\u5168\u90E8\u53D6\u6D88\u5E76\u4FDD\u5B58\u5C06\u6E05\u9664\u58F0\u660E\u2014\u2014\u8BF7\u6C42\u4EE5\u88F8\u683C\u5F0F\u53D1\u51FA\uFF08\u8D70\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF09\uFF0C\u90E8\u5206\u4E2D\u8F6C\u7AD9\u9700\u8981\u8FD9\u6837\u3002",defaultRiskDisabled:"\u65E0 off \u6863\uFF1ADefault \u4E0E\u63D0\u4F9B\u5546\u6D4B\u8BD5\u4F1A\u53D1\u9001 thinking: disabled\uFF0C\u8BE5\u6A21\u578B\u4F1A\u62A5\u9519\uFF08\u5982 1210\uFF09\u3002",defaultRiskQwen:"\u65E0 off \u6863\uFF1ADefault \u4F1A\u53D1\u9001 enable_thinking: false\u2014\u2014\u4EC5\u5728\u4E0A\u6E38\u8981\u6C42\u5F00\u542F\u601D\u8003\u65F6\u624D\u4F1A\u5931\u8D25\u3002",stagedHint:"\u5C1A\u672A\u4FDD\u5B58\u3002\u6682\u5B58\u7684\u914D\u7F6E\u5C06\u5728\u8BE5\u6A21\u578B\u4FDD\u5B58\u540E\u81EA\u52A8\u5E94\u7528\u3002",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",sliderToggleDescription:"\u5728\u6A21\u578B\u83DC\u5355\u4E2D\u663E\u793A\u6A21\u578B\u884C\u4E0E\u601D\u8003\u7B49\u7EA7\u6807\u7B7E\uFF0C\u6863\u4F4D\u968F\u5F53\u524D\u6A21\u578B\u81EA\u52A8\u9002\u914D",sliderToggleAria:"\u542F\u7528\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",settingOn:"\u542F\u7528",settingOff:"\u505C\u7528",sliderNoLevels:"\u5F53\u524D\u6A21\u578B\u672A\u63D0\u4F9B\u601D\u8003\u5F3A\u5EA6\u6863\u4F4D",triggerFallback:"\u9009\u62E9\u6A21\u578B",effortDefault:"\u9ED8\u8BA4",modelRowLabel:"\u6A21\u578B",effortRowLabel:"\u601D\u8003\u7B49\u7EA7",tagVision:"\u652F\u6301\u56FE\u7247\u8F93\u5165",tagThinking:"\u652F\u6301\u601D\u8003\u7B49\u7EA7",sliderNoCurrent:"\u5F53\u524D\u65E0\u9009\u62E9\u4E2D\u7684\u6A21\u578B\u3002",defaultEffortLabel:"\u9ED8\u8BA4\u601D\u8003\u5F3A\u5EA6",defaultEffortUnset:"\u8DDF\u968F\u8BB0\u5FC6",defaultEffortHint:"\u6BCF\u4E2A\u65B0\u4F1A\u8BDD\u6253\u5F00\u8BE5\u6A21\u578B\u65F6\u4F7F\u7528\u7684\u6863\u4F4D\u2014\u2014\u4F18\u5148\u4E8E\u8BB0\u4F4F\u7684\u4E0A\u6B21\u6863\u4F4D\u3002\u4F1A\u8BDD\u5185\u624B\u52A8\u9009\u62E9\u7684\u6863\u4F4D\u59CB\u7EC8\u6700\u9AD8\u3002\u7559\u7A7A\u5219\u8DDF\u968F\u8BB0\u5FC6\u94FE\u3002",clearDefaultEffort:"\u6E05\u9664\u9009\u62E9",modelSearchPlaceholder:"\u641C\u7D22\u6A21\u578B\u2026",modelSearchNoMatches:"\u672A\u627E\u5230\u5339\u914D\u6A21\u578B",modelSearchClear:"\u6E05\u7A7A\u641C\u7D22",modelSearchFailed:"\u6A21\u578B\u641C\u7D22\u6E32\u67D3\u5931\u8D25",editorTabsLabel:"\u7F16\u8F91\u5668\u5206\u533A",editorTabProvider:"\u4F9B\u5E94\u5546\u914D\u7F6E",editorTabModels:"\u6A21\u578B\u914D\u7F6E",editorTabAdvanced:"\u9AD8\u7EA7\u914D\u7F6E",keyRevealShow:"\u663E\u793A\u5BC6\u94A5",keyRevealHide:"\u9690\u85CF\u5BC6\u94A5",keyRevealFailed:"\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u4FDD\u5B58\u7684\u5BC6\u94A5",keysLoading:"\u6B63\u5728\u8BFB\u53D6\u5BC6\u94A5\u2026",keysAdd:"\u6DFB\u52A0\u53E6\u4E00\u4E2A\u5BC6\u94A5",keysAddConfirm:"\u6DFB\u52A0",keysEnable:"\u542F\u7528 {name}",keysEnabled:"\u542F\u7528",keysMissing:"\u672A\u5B58\u50A8",keysEdit:"\u4FEE\u6539",keysRemove:"\u5220\u9664",keysConfirmRemove:"\u786E\u8BA4\u5220\u9664",keysCancel:"\u53D6\u6D88",keysSave:"\u4FDD\u5B58",keysAlias:"\u522B\u540D",keysAliasPlaceholder:"\u540D\u79F0\uFF08\u53EF\u9009\uFF09\uFF0C\u4F8B\u5982 \u56E2\u961F",keysValue:"\u5BC6\u94A5",keysValuePlaceholder:"\u7C98\u8D34 API \u5BC6\u94A5",keysNewValuePlaceholder:"\u7C98\u8D34\u65B0\u7684 API \u5BC6\u94A5",keysAddIllegal:"\u5BC6\u94A5\u53EA\u80FD\u662F\u53EF\u6253\u5370 ASCII \u5B57\u7B26\uFF0C\u4E14\u4E0D\u80FD\u5305\u542B\u7A7A\u683C\u3002",keysAdded:"\u5DF2\u4FDD\u5B58\u5BC6\u94A5\u3002",keysRenamed:"\u5DF2\u4FDD\u5B58\u522B\u540D\u3002",keysReplaced:"\u5DF2\u66FF\u6362\u5BC6\u94A5\u3002",keysRemoved:"\u5DF2\u5220\u9664\u5BC6\u94A5\u3002",keysEnabledNote:"\u5DF2\u542F\u7528 {name}\u3002",keysUnreachable:"\u63D2\u4EF6\u7684\u5BC6\u94A5\u63A5\u53E3\u6CA1\u6709\u54CD\u5E94\u3002",keysPanelFailed:"\u5BC6\u94A5\u7BA1\u7406\u9762\u677F\u6E32\u67D3\u5931\u8D25",headersTitle:"\u8BF7\u6C42\u5934",headersHint:"\u8BE5\u8DEF\u7531\u7684\u6BCF\u4E2A\u8BF7\u6C42\u90FD\u4F1A\u643A\u5E26\u81EA\u5B9A\u4E49\u8BF7\u6C42\u5934\u3002",headersEmpty:"\u5C1A\u672A\u914D\u7F6E\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersAdd:"\u6DFB\u52A0\u8BF7\u6C42\u5934",headersName:"\u540D\u79F0",headersNamePlaceholder:"\u4F8B\u5982 x-company",headersValue:"\u503C",headersEdit:"\u7F16\u8F91",headersSave:"\u4FDD\u5B58",headersCancel:"\u53D6\u6D88",headersClear:"\u5168\u90E8\u6E05\u7A7A",headersSaved:"\u5DF2\u4FDD\u5B58\u3002",headersCleared:"\u5DF2\u6E05\u7A7A\u2014\u2014\u8BE5\u8DEF\u7531\u4E0D\u518D\u643A\u5E26\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersReadOnly:"\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",headersUserAgentTitle:"User-Agent\uFF08\u7531\u63D2\u4EF6\u5728\u8BF7\u6C42\u5C42\u63A5\u7BA1\uFF09",headersUserAgentHint:"\u5B98\u65B9\u9002\u914D\u5668\u4F1A\u4E22\u5F03\u914D\u7F6E\u7684 user-agent\uFF08\u8BE5\u540D\u79F0\u4FDD\u7559\u7ED9\u5BA2\u6237\u7AEF\u5F52\u5C5E\u6807\u8BC6\uFF09\uFF0C\u6240\u4EE5\u7531\u63D2\u4EF6\u5728\u8BF7\u6C42\u5C42\u8865\u4E0A\u3002\u586B\u4E86\u5C31\u4F1A\u771F\u6B63\u66FF\u6362\u4E0A\u884C\u8BF7\u6C42\u5934\u91CC\u7684 User-Agent\u3002",headersUserAgentClear:"\u4E0D\u8986\u76D6",headersUserAgentPlaceholder:"\u4F8B\u5982 claude-cli/2.1.161 (external, cli)",headersConflictOrigin:"\u540C\u4E00\u4E2A endpoint \u4E0A\u6709\u591A\u4E2A\u8DEF\u7531\u914D\u7F6E\u4E86\u4E0D\u540C\u7684\u8BF7\u6C42\u5934\u503C\uFF1A\u5F53\u8BF7\u6C42\u4F53\u91CC\u7684\u6A21\u578B\u65E0\u6CD5\u552F\u4E00\u5B9A\u4F4D\u5176\u4E2D\u4E00\u4E2A\u8DEF\u7531\u65F6\uFF0C\u8BE5\u8BF7\u6C42\u56DE\u9000\u5230\u7B2C\u4E00\u4E2A\u8DEF\u7531\u7684\u914D\u7F6E\u3002",headersConflictPatched:"\u68C0\u6D4B\u5230\u5B98\u65B9 dsh-llm-pi-ai \u5DF2\u5728\u8BF7\u6C42\u5C42\u5904\u7406\u8BF7\u6C42\u5934\uFF1A\u628A\u503C\u586B\u5728\u4E0A\u65B9\u8BF7\u6C42\u5934\u914D\u7F6E\u4E2D\u5373\u53EF\uFF0C\u65E0\u9700\u91CD\u590D\u63A5\u7BA1\u3002",headersConflictSiblings:"\u68C0\u6D4B\u5230\u4F1A\u6539\u5199\u540C\u4E00\u5C42\u7684\u540C\u7C7B\u63D2\u4EF6\uFF1A{names}\u3002\u540C\u4E00\u65F6\u95F4\u53EA\u5E94\u542F\u7528\u4E00\u79CD\u8BF7\u6C42\u5934\u6539\u5199\uFF0C\u5426\u5219\u7EBF\u4E0A\u751F\u6548\u7684\u662F\u6700\u540E\u5199\u5165\u8005\u3002",headersError:"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}",headersNoRoute:"\u8BE5\u8DEF\u7531\u5DF2\u4E0D\u5728\u8BBE\u7F6E\u6587\u6863\u4E2D\u2014\u2014\u8BF7\u5148\u4FDD\u5B58\u4E00\u6B21\u5B98\u65B9\u5361\u7247\u3002",providerReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{provider}",providerReorderHint:"\u62D6\u52A8\u8C03\u6574\u4F9B\u5E94\u5546\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002",providerToggleAria:"\u542F\u7528 {provider}",providerToggleHint:"\u7981\u7528\u540E\u8BE5\u4F9B\u5E94\u5546\u4E0D\u5728\u6A21\u578B\u5207\u6362\u5217\u8868\u4E2D\u663E\u793A\u3002",providerDisabledGroupShow:"\u5C55\u5F00 {count} \u4E2A\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546",providerDisabledGroupHide:"\u6536\u8D77 {count} \u4E2A\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546",providerDisabledGroupHint:"\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546\u914D\u7F6E\u4ECD\u5728\uFF0C\u53EA\u662F\u6298\u53E0\u5728\u8FD9\u91CC\u2014\u2014\u5C55\u5F00\u540E\u53EF\u4EE5\u91CD\u65B0\u542F\u7528\u3002",providerRemoveDisabled:"\u5220\u9664",providerRemoveLocked:"\u5185\u7F6E\u4F9B\u5E94\u5546\u4E0D\u53EF\u5220\u9664\u3002",modelReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{model}",modelReorderHint:"\u62D6\u52A8\u8C03\u6574\u8BE5\u4F9B\u5E94\u5546\u5185\u6A21\u578B\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002"};var en="dsh-model-think-level.slider.enabled",jd=["dsh-reasoning-effort.enabled","@dsh-external/dsh-reasoning-effort.enabled"],St=zd();function zd(){try{let e=window.localStorage.getItem(en),t=e===null?jd.map(n=>window.localStorage.getItem(n)).find(n=>n!==null):null;return(e??t??null)!=="false"}catch{return!0}}var dr=new Set;function Ko(){for(let e of[...dr])e()}function we(){return St}function Bo(e){if(St!==e){St=e;try{window.localStorage.setItem(en,String(e))}catch{}Ko()}}function Uo(e){St!==e&&(St=e,Ko())}function tn(e){return dr.add(e),()=>{dr.delete(e)}}var nn="dsh-model-think-level.provider-order",Go=["deepseek-account","deepseek-official"];function lt(e){if(e===null)return[];try{let t=JSON.parse(e);return Array.isArray(t)?ur(t.filter(n=>typeof n=="string")):[]}catch{return[]}}function ur(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var dt=(()=>{try{return lt(window.localStorage.getItem(nn))}catch{return[]}})(),lr=new Set;function jo(){for(let e of[...lr])e()}function zo(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function fr(){return dt}function $o(e){let t=ur(e);if(!zo(dt,t)){dt=t;try{window.localStorage.setItem(nn,JSON.stringify(dt))}catch{}jo()}}function Vo(e){let t=ur(e);zo(dt,t)||(dt=t,jo())}function rn(e){return lr.add(e),()=>{lr.delete(e)}}function cr(e){let t=n=>{let r=Go.indexOf(n);return r<0?Go.length:r};return e.map((n,r)=>({id:n,index:r,rank:t(n)})).sort((n,r)=>n.rank-r.rank||n.index-r.index).map(n=>n.id)}function ut(e,t){let n=new Map;for(let s of t)n.has(s)||n.set(s,n.size);let r=[],o=[];e.forEach((s,a)=>{n.has(s)&&(r.push(a),o.push(s))}),o.sort((s,a)=>n.get(s)-n.get(a));let i=[...e];return r.forEach((s,a)=>{i[s]=o[a]}),i}function Yo(e){return ut(cr(e),fr())}function pr(e,t,n){let r=e.indexOf(t);if(r<0)return[...e];let o=[...e];o.splice(r,1);let i=Math.max(0,Math.min(o.length,n));return o.splice(i,0,t),o}var on="dsh-model-think-level.providers.disabled",mr=new Set,We=$d();function $d(){try{return lt(window.localStorage.getItem(on))}catch{return[]}}function Xo(e){return lt(e)}function Jo(){return We}function ft(e){return!We.includes(e)}function Qo(e,t){let n=!We.includes(e);t!==n&&ei(t?We.filter(r=>r!==e):[...We,e],!0)}function Zo(e){ei(e,!1)}function sn(e){return mr.add(e),()=>{mr.delete(e)}}function Vd(e,t){return e.length!==t.length?!1:e.every(n=>t.includes(n))}function ei(e,t){if(!Vd(We,e)){if(We=[...new Set(e)],t)try{window.localStorage.setItem(on,JSON.stringify(We))}catch{}for(let n of[...mr])n()}}var an="dsh-model-think-level.model-order";function hr(e){if(e===null)return{};try{let t=JSON.parse(e);if(t===null||typeof t!="object"||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t)){if(r.length===0||!Array.isArray(o))continue;let i=ti(o.filter(s=>typeof s=="string"));i.length>0&&(n[r]=i)}return n}catch{return{}}}function ti(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var ze=(()=>{try{return hr(window.localStorage.getItem(an))}catch{return{}}})(),gr=new Set;function ni(){for(let e of[...gr])e()}function Yd(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Xd(){try{window.localStorage.setItem(an,JSON.stringify(ze))}catch{}}function ri(){return ze}function oi(e){return ze[e]??Jd}var Jd=[];function ii(e,t){if(e.length===0)return;let n=ti(t),r=oi(e);if(Yd(r,n)&&(n.length>0||!(e in ze)))return;let o={...ze};n.length===0?delete o[e]:o[e]=n,ze=o,Xd(),ni()}function si(e){ze=e,ni()}function dn(e){return gr.add(e),()=>{gr.delete(e)}}function Qd(e,t){return ut(e,t)}function ai(e,t){return ut(t,oi(e))}function di(e,t){if(e.length===0||t.length===0)return e;let n=new Map(e.map(r=>[r.id,r]));return Qd(e.map(r=>r.id),t).map(r=>n.get(r))}var li=`
|
|
7
|
+
"use strict";var Fn=Object.defineProperty;var Dc=Object.getOwnPropertyDescriptor;var Pc=Object.getOwnPropertyNames;var Ic=Object.prototype.hasOwnProperty;var Nc=(e,t,n)=>t in e?Fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _c=(e,t)=>{for(var n in t)Fn(e,n,{get:t[n],enumerable:!0})},Fc=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Pc(t))!Ic.call(e,o)&&o!==n&&Fn(e,o,{get:()=>t[o],enumerable:!(r=Dc(t,o))||r.enumerable});return e};var Kc=e=>Fc(Fn({},"__esModule",{value:!0}),e);var zi=(e,t,n)=>Nc(e,typeof t!="symbol"?t+"":t,n);var oh={};_c(oh,{EffortEditor:()=>cr,apply:()=>rh,baselineModelsOf:()=>Pa,compatOf:()=>er,createEditorApi:()=>rr,defaultEffortOf:()=>nr,describeNamespace:()=>te,effortsOf:()=>Qn,findModelMenu:()=>Fo,findModelTrigger:()=>Ko,inject:()=>nh,inputOf:()=>Zn,name:()=>th,nameOf:()=>tr,providerHeadersOf:()=>Oo,providersOf:()=>ye,routeIsDeclared:()=>Le,userProvidersOf:()=>Ro,writeModelRows:()=>rn,writeProviderHeaders:()=>on});module.exports=Kc(oh);var Hc=require("react");var ue="dsh-model-think-level",$i="/dsh-model-think-level/raw-models";var Kn="/dsh-model-think-level/provider-key",Vi="/dsh-model-think-level/key-index",Yi="/dsh-model-think-level/autofill-config",Xi="/dsh-model-think-level/headers-config",be="llm-pi-ai",Te="reasoningEffortsUnset",Ye="inputUnset",Ht="reasoningEffortsAutofilled",Rt="defaultEffort",uo=ue;var Zt=require("react");function Ji(e){let{locale:t}=e,n=(0,Zt.useCallback)(o=>t.subscribe(o),[t]),r=(0,Zt.useCallback)(()=>t.getSnapshot().revision??0,[t]);return(0,Zt.useSyncExternalStore)(n,r),e.children()}var Qi={reasoningEffort:"Reasoning effort",thinkingMode:"Thinking",thinkingModeOff:"Off \u2014 this model is declared as not reasoning.",levelsLabel:"Declared levels",levelsHint:"Click to declare; clear every level to declare nothing \u2014 requests follow the provider default.",stateDeclared:"{count} declared \xB7 default {default}",stateUndeclared:"Nothing declared \u2014 requests follow the provider default.",modalityText:"Text",autoAdapt:"Auto-adapt",autoAdaptAll:"Auto-detect thinking levels",autoAdaptWorking:"Detecting\u2026",autoAdaptDone:"Adapted {count} \xB7 save to write",autoAdaptEmpty:"All already configured",autoAdaptUnsuggested:"No suggestion available",autoAdaptBlocked:"No models to adapt yet",autoAdaptFailed:"Detection failed: {message}",autoAdaptDoneHint:"Held for {count} model(s): they land when this card is saved.",autoAdaptEmptyHint:"Every model of this provider already declares its thinking levels.",autoAdaptUnsuggestedHint:"The models that still need a declaration have no knowledge-base match \u2014 adapt them one by one.",autoAdaptBlockedHint:"Nothing to adapt yet: the card has no models, is not saved, or the settings document is read-only.",apply:"Apply",reset:"Reset",pendingSave:"Modified \u2014 it will be written when you save this card.",pendingHint:"Cancel or reload discards it, exactly like the card's own fields.",appliedHint:"Applied suggestion from {source} \xB7 confidence: {confidence}",inputHintEndpoint:"Modality advice comes from the endpoint listing.",inputHintKnowledge:"Modality advice comes from the knowledge base.",inputHintHeuristic:"Modality guessed from the name alone (low confidence) \u2014 verify.",referenceTitle:"Reference capacities",contextWindowLabel:"Context window",maxTokensLabel:"Max output",capacityBlank:"Catalogue value",capacityRule:"Max output above the window is refused upstream; this check is local only.",tokensUnit:"tokens",inputModality:"Input modalities",modalityImage:"Image",modalityInherit:"Not declared \u2014 the provider default applies (usually text-only).",clearDeclaration:"Clear declaration",confidence_high:"high",confidence_medium:"medium",confidence_low:"low \u2014 verify before relying on it",noSuggestion:"No suggestion is available for this model.",writeError:"Failed: {message}",renderFailed:"Reasoning-effort editor failed to render",wirePlaceholder:"Wire value",wireValue:"value",wireShow:"Edit wire values",wireHide:"Hide wire values",reasoningDisabled:"No reasoning-effort control declared for this model (false) \u2014 do not arm thinking levels.",bareHint:"Clearing every level removes the declaration \u2014 requests go out bare (provider default), which some relays require.",defaultRiskDisabled:"No off level: Default and provider tests send thinking: disabled, which this model rejects (e.g. 1210).",defaultRiskQwen:"No off level: Default sends enable_thinking: false \u2014 only fails where the upstream requires thinking on.",stagedHint:"Not saved yet. Staged settings are applied automatically once the model is saved.",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"Model and reasoning-effort rows",sliderToggleDescription:"Show the model row and the reasoning-level chips in the model menu; the levels follow the current model.",sliderToggleAria:"Enable the model and reasoning-effort rows",settingOn:"On",settingOff:"Off",sliderNoLevels:"The current model exposes no reasoning-effort levels.",triggerFallback:"Select model",effortDefault:"Default",modelRowLabel:"Model",effortRowLabel:"Reasoning level",tagVision:"Image input",tagThinking:"Sends thinking levels",sliderNoCurrent:"No model selected.",defaultEffortLabel:"Default effort",defaultEffortUnset:"Follow memory",defaultEffortHint:"The level new sessions start at; a level you pick by hand always wins. Empty follows memory.",followMemory:"Follow memory",clearDefaultEffort:"Clear pick",modelSearchPlaceholder:"Search models\u2026",modelSearchNoMatches:"No matching models",modelSearchClear:"Clear search",modelSearchFailed:"Model search failed to render",editorTabsLabel:"Editor sections",editorTabProvider:"Provider",editorTabModels:"Models",editorTabAdvanced:"Advanced",keyRevealShow:"Show key",keyRevealHide:"Hide key",keyRevealFailed:"Stored key unavailable",keysLoading:"Loading keys\u2026",keysAdd:"Add another key",keysAddConfirm:"Add",keysEnable:"Enable {name}",keysDisable:"Disable {name}",keysMissing:"Not stored",keysEdit:"Edit",keysRemove:"Delete",keysConfirmRemove:"Confirm delete",keysCancel:"Cancel",keysSave:"Save",keysAlias:"Label",keysAliasPlaceholder:"Name (optional), e.g. Team",keysValue:"Key",keysValuePlaceholder:"Paste the API key",keysNewValuePlaceholder:"Paste the new API key",keysAddIllegal:"A key is printable ASCII without spaces.",keysAdded:"Key stored.",keysRenamed:"Label saved.",keysReplaced:"Key replaced.",keysRemoved:"Key removed.",keysScope:"Models served by {name}",keysModels:"Models",keysScopeAll:"All models",keysScopeNone:"No models found",keysScopeCount:"{count} models",keysScopeSaved:"Model scope saved.",keysScopeHint:"Only the ticked models use this key; the rest go to the provider's other keys.",keysScopeEmpty:"This provider has no models yet. Add models first, then pick them here.",keysMergedOffer:"{count} more models are served by your keys but not added to this provider: {models}.",keysMergedApply:"Add them",keysMergedApplied:"Models added to the provider.",keysProtocolLabel:"Protocol for {name}",keysProtocolCreate:"Protocol",keysProtocolCreateHint:"The wire this key signs with; the addresses the provider has configured decide which families are offered.",keysProtocolDefault:"Auto (per model)",keysProtocolDefaultHint:"Picks each model\u2019s own wire: claude models use the Anthropic address, gemini models the Gemini one, the rest the provider\u2019s protocol (where that address is configured).",keysProtocolAnthropic:"Anthropic",keysProtocolAnthropicHint:"Anthropic API \xB7 Claude models",keysProtocolOpenAI:"Chat Completions",keysProtocolOpenAIHint:"OpenAI API \xB7 GPT models, most agents",keysProtocolResponses:"Responses",keysProtocolResponsesHint:"OpenAI API \xB7 Codex",keysProtocolGemini:"Gemini",keysProtocolGeminiHint:"Google Gemini API \xB7 gemini / gemma models",keysProtocolShortChat:"Chat",keysProtocolShortResponses:"Responses",keysProtocolShortAnthropic:"Anthropic",keysProtocolSaved:"Protocol saved.",keysEndpointOpenAI:"OpenAI",keysEndpointAnthropic:"Anthropic",keysEndpointGemini:"Gemini",keysMoreEndpoints:"More endpoints",keysEndpointsCount:"{count} more",keysEndpointInvalid:"The address must start with http:// or https://",keysUnreachable:"The plugin\u2019s key route did not answer.",keysPanelFailed:"Key manager failed to render",keysDraftHint:"Held by this page and stored when the provider is created \u2014 a reload discards them, exactly like the card\u2019s own fields.",keysLastEnabledOff:"The last enabled key cannot be switched off.",headersTitle:"Request headers",headersHint:"Sent on every request of this route.",headersEmpty:"No extra request headers are configured.",headersAdd:"Add header",headersName:"Name",headersNamePlaceholder:"e.g. x-company",headersValue:"Value",headersEdit:"Edit",headersSave:"Save",headersCancel:"Cancel",headersClear:"Clear all",headersSaved:"Saved.",headersCleared:"Cleared \u2014 this route sends no extra request headers.",headersReadOnly:"The settings document is not writable.",headersConflictOrigin:"Routes sharing one endpoint declare different request-header values: when the model in a request body does not identify exactly one of them, that request falls back to the first route.",headersConflictPatched:"The installed dsh-llm-pi-ai already carries a request-header patch: enter values in the headers above and this plugin need not take the request layer over.",headersConflictSiblings:"A plugin rewriting the same layer is installed: {names}. Only one user-agent rewrite should be active at a time, or the last writer on the wire wins.",headersError:"Save failed: {error}",headersNoRoute:"This route is no longer in the settings document \u2014 save the official card once first.",providerReorderAria:"Reorder {provider}",providerReorderHint:"Drag to set the provider order \u2014 the model switcher follows it.",providerToggleAria:"Enable {provider}",providerToggleHint:"A disabled provider is not listed by the model switcher.",providerDisabledGroupShow:"Show {count} switched-off provider(s)",providerDisabledGroupHide:"Hide {count} switched-off provider(s)",providerDisabledGroupHint:"A switched-off provider keeps its configuration and folds away here \u2014 unfold it to switch it back on.",providerRemoveDisabled:"Delete",providerRemoveLocked:"A built-in provider cannot be deleted.",modelReorderAria:"Reorder {model}",modelReorderHint:"Drag to set the order of this provider\u2019s models \u2014 the model switcher follows it."},Zi={reasoningEffort:"\u601D\u8003\u5F3A\u5EA6",thinkingMode:"\u601D\u8003",thinkingModeOff:"\u5DF2\u5173\u95ED\u2014\u2014\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u4E0D\u601D\u8003\u3002",levelsLabel:"\u652F\u6301\u6863\u4F4D",levelsHint:"\u70B9\u9009\u5373\u58F0\u660E\uFF1B\u5168\u90E8\u53D6\u6D88\u5219\u4E0D\u58F0\u660E\uFF0C\u8BF7\u6C42\u6309\u4F9B\u5E94\u5546\u9ED8\u8BA4\u53D1\u9001\u3002",stateDeclared:"\u5DF2\u58F0\u660E {count} \u6863 \xB7 \u9ED8\u8BA4 {default}",stateUndeclared:"\u672A\u58F0\u660E\u2014\u2014\u8BF7\u6C42\u6309\u4F9B\u5E94\u5546\u9ED8\u8BA4\u53D1\u9001\u3002",modalityText:"\u6587\u672C",autoAdapt:"\u81EA\u52A8\u9002\u914D",autoAdaptAll:"\u81EA\u52A8\u83B7\u53D6\u601D\u8003\u7B49\u7EA7",autoAdaptWorking:"\u83B7\u53D6\u4E2D\u2026",autoAdaptDone:"\u5DF2\u9002\u914D {count} \u4E2A\xB7\u4FDD\u5B58\u540E\u5199\u5165",autoAdaptEmpty:"\u5DF2\u5168\u90E8\u914D\u7F6E",autoAdaptUnsuggested:"\u6CA1\u6709\u53EF\u7528\u5EFA\u8BAE",autoAdaptBlocked:"\u6682\u65E0\u53EF\u9002\u914D\u6A21\u578B",autoAdaptFailed:"\u83B7\u53D6\u5931\u8D25\uFF1A{message}",autoAdaptDoneHint:"\u5DF2\u6682\u5B58 {count} \u4E2A\u6A21\u578B\u7684\u9002\u914D\u7ED3\u679C\uFF1A\u70B9\u8BE5\u5361\u7247\u7684\u300C\u4FDD\u5B58\u300D\u540E\u5199\u5165\u3002",autoAdaptEmptyHint:"\u8BE5\u4F9B\u5E94\u5546\u4E0B\u6240\u6709\u6A21\u578B\u90FD\u5DF2\u58F0\u660E\u601D\u8003\u7B49\u7EA7\u3002",autoAdaptUnsuggestedHint:"\u4ECD\u9700\u58F0\u660E\u7684\u6A21\u578B\u6CA1\u6709\u77E5\u8BC6\u5E93\u5339\u914D\u2014\u2014\u8BF7\u9010\u4E2A\u6253\u5F00\u6A21\u578B\u884C\u624B\u52A8\u9002\u914D\u3002",autoAdaptBlockedHint:"\u6682\u65E0\u53EF\u9002\u914D\u5185\u5BB9\uFF1A\u8BE5\u5361\u7247\u8FD8\u6CA1\u6709\u6A21\u578B\u3001\u5C1A\u672A\u4FDD\u5B58\uFF0C\u6216\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",apply:"\u5E94\u7528",reset:"\u653E\u5F03\u4FEE\u6539",pendingSave:"\u5DF2\u4FEE\u6539\u2014\u2014\u70B9\u5361\u7247\u300C\u4FDD\u5B58\u300D\u65F6\u4E00\u8D77\u5199\u5165\u3002",pendingHint:"\u70B9\u300C\u53D6\u6D88\u300D\u6216\u5237\u65B0\u9875\u9762\u4F1A\u4E00\u5E76\u4E22\u5F03\uFF0C\u4E0E\u5361\u7247\u81EA\u8EAB\u7684\u5B57\u6BB5\u4E00\u81F4\u3002",appliedHint:"\u5DF2\u6309 {source} \u5E94\u7528\u5EFA\u8BAE \xB7 \u7F6E\u4FE1\u5EA6\uFF1A{confidence}",inputHintEndpoint:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u7AEF\u70B9\u5217\u8868\u3002",inputHintKnowledge:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u77E5\u8BC6\u5E93\u3002",inputHintHeuristic:"\u6A21\u6001\u5EFA\u8BAE\u4EC5\u6309\u547D\u540D\u63A8\u65AD\uFF08\u4F4E\u7F6E\u4FE1\u5EA6\uFF09\uFF0C\u8BF7\u6838\u5BF9\u3002",referenceTitle:"\u53C2\u8003\u5BB9\u91CF",contextWindowLabel:"\u4E0A\u4E0B\u6587\u7A97\u53E3",maxTokensLabel:"\u6700\u5927\u8F93\u51FA",capacityBlank:"\u6CBF\u7528\u76EE\u5F55\u503C",capacityRule:"\u6700\u5927\u8F93\u51FA\u8D85\u8FC7\u7A97\u53E3\u4F1A\u88AB\u4E0A\u6E38\u62D2\u7EDD\uFF0C\u8FD9\u91CC\u53EA\u505A\u672C\u5730\u6821\u9A8C\u3002",tokensUnit:"tokens",inputModality:"\u8F93\u5165\u6A21\u6001",modalityImage:"\u56FE\u7247",modalityInherit:"\u672A\u58F0\u660E\u2014\u2014\u7EE7\u627F\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF08\u901A\u5E38\u4EC5\u6587\u672C\uFF09\u3002",clearDeclaration:"\u6E05\u9664\u58F0\u660E",confidence_high:"\u9AD8",confidence_medium:"\u4E2D",confidence_low:"\u4F4E\uFF08\u5EFA\u8BAE\u6838\u5BF9\uFF09",noSuggestion:"\u6CA1\u6709\u9002\u7528\u4E8E\u8BE5\u6A21\u578B\u7684\u5EFA\u8BAE\u3002",writeError:"\u5199\u5165\u5931\u8D25\uFF1A{message}",renderFailed:"\u601D\u8003\u5F3A\u5EA6\u7F16\u8F91\u5668\u6E32\u67D3\u5931\u8D25",wirePlaceholder:"\u7EBF\u4E0A\u53D6\u503C",wireValue:"\u53D6\u503C",wireShow:"\u7F16\u8F91\u7EBF\u4E0A\u53D6\u503C",wireHide:"\u6536\u8D77\u7EBF\u4E0A\u53D6\u503C",reasoningDisabled:"\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u65E0 reasoning-effort \u63A7\u5236\uFF08false\uFF09\u2014\u2014\u8BF7\u52FF\u52FE\u9009\u601D\u8003\u6863\u3002",bareHint:"\u5168\u90E8\u53D6\u6D88\u5E76\u4FDD\u5B58\u5C06\u6E05\u9664\u58F0\u660E\u2014\u2014\u8BF7\u6C42\u4EE5\u88F8\u683C\u5F0F\u53D1\u51FA\uFF08\u8D70\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF09\uFF0C\u90E8\u5206\u4E2D\u8F6C\u7AD9\u9700\u8981\u8FD9\u6837\u3002",defaultRiskDisabled:"\u65E0 off \u6863\uFF1ADefault \u4E0E\u63D0\u4F9B\u5546\u6D4B\u8BD5\u4F1A\u53D1\u9001 thinking: disabled\uFF0C\u8BE5\u6A21\u578B\u4F1A\u62A5\u9519\uFF08\u5982 1210\uFF09\u3002",defaultRiskQwen:"\u65E0 off \u6863\uFF1ADefault \u4F1A\u53D1\u9001 enable_thinking: false\u2014\u2014\u4EC5\u5728\u4E0A\u6E38\u8981\u6C42\u5F00\u542F\u601D\u8003\u65F6\u624D\u4F1A\u5931\u8D25\u3002",stagedHint:"\u5C1A\u672A\u4FDD\u5B58\u3002\u6682\u5B58\u7684\u914D\u7F6E\u5C06\u5728\u8BE5\u6A21\u578B\u4FDD\u5B58\u540E\u81EA\u52A8\u5E94\u7528\u3002",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",sliderToggleDescription:"\u5728\u6A21\u578B\u83DC\u5355\u4E2D\u663E\u793A\u6A21\u578B\u884C\u4E0E\u601D\u8003\u7B49\u7EA7\u6807\u7B7E\uFF0C\u6863\u4F4D\u968F\u5F53\u524D\u6A21\u578B\u81EA\u52A8\u9002\u914D",sliderToggleAria:"\u542F\u7528\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",settingOn:"\u542F\u7528",settingOff:"\u505C\u7528",sliderNoLevels:"\u5F53\u524D\u6A21\u578B\u672A\u63D0\u4F9B\u601D\u8003\u5F3A\u5EA6\u6863\u4F4D",triggerFallback:"\u9009\u62E9\u6A21\u578B",effortDefault:"\u9ED8\u8BA4",modelRowLabel:"\u6A21\u578B",effortRowLabel:"\u601D\u8003\u7B49\u7EA7",tagVision:"\u652F\u6301\u56FE\u7247\u8F93\u5165",tagThinking:"\u652F\u6301\u601D\u8003\u7B49\u7EA7",sliderNoCurrent:"\u5F53\u524D\u65E0\u9009\u62E9\u4E2D\u7684\u6A21\u578B\u3002",defaultEffortLabel:"\u9ED8\u8BA4\u601D\u8003\u5F3A\u5EA6",defaultEffortUnset:"\u8DDF\u968F\u8BB0\u5FC6",defaultEffortHint:"\u65B0\u4F1A\u8BDD\u7684\u8D77\u59CB\u6863\u4F4D\uFF1B\u4F1A\u8BDD\u5185\u624B\u52A8\u9009\u62E9\u59CB\u7EC8\u4F18\u5148\u3002\u7559\u7A7A\u5219\u8DDF\u968F\u8BB0\u5FC6\u94FE\u3002",followMemory:"\u8DDF\u968F\u8BB0\u5FC6",clearDefaultEffort:"\u6E05\u9664\u9009\u62E9",modelSearchPlaceholder:"\u641C\u7D22\u6A21\u578B\u2026",modelSearchNoMatches:"\u672A\u627E\u5230\u5339\u914D\u6A21\u578B",modelSearchClear:"\u6E05\u7A7A\u641C\u7D22",modelSearchFailed:"\u6A21\u578B\u641C\u7D22\u6E32\u67D3\u5931\u8D25",editorTabsLabel:"\u7F16\u8F91\u5668\u5206\u533A",editorTabProvider:"\u4F9B\u5E94\u5546\u914D\u7F6E",editorTabModels:"\u6A21\u578B\u914D\u7F6E",editorTabAdvanced:"\u9AD8\u7EA7\u914D\u7F6E",keyRevealShow:"\u663E\u793A\u5BC6\u94A5",keyRevealHide:"\u9690\u85CF\u5BC6\u94A5",keyRevealFailed:"\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u4FDD\u5B58\u7684\u5BC6\u94A5",keysLoading:"\u6B63\u5728\u8BFB\u53D6\u5BC6\u94A5\u2026",keysAdd:"\u6DFB\u52A0\u53E6\u4E00\u4E2A\u5BC6\u94A5",keysAddConfirm:"\u6DFB\u52A0",keysEnable:"\u542F\u7528 {name}",keysDisable:"\u505C\u7528 {name}",keysMissing:"\u672A\u5B58\u50A8",keysEdit:"\u4FEE\u6539",keysRemove:"\u5220\u9664",keysConfirmRemove:"\u786E\u8BA4\u5220\u9664",keysCancel:"\u53D6\u6D88",keysSave:"\u4FDD\u5B58",keysAlias:"\u522B\u540D",keysAliasPlaceholder:"\u540D\u79F0\uFF08\u53EF\u9009\uFF09\uFF0C\u4F8B\u5982 \u56E2\u961F",keysValue:"\u5BC6\u94A5",keysValuePlaceholder:"\u7C98\u8D34 API \u5BC6\u94A5",keysNewValuePlaceholder:"\u7C98\u8D34\u65B0\u7684 API \u5BC6\u94A5",keysAddIllegal:"\u5BC6\u94A5\u53EA\u80FD\u662F\u53EF\u6253\u5370 ASCII \u5B57\u7B26\uFF0C\u4E14\u4E0D\u80FD\u5305\u542B\u7A7A\u683C\u3002",keysAdded:"\u5DF2\u4FDD\u5B58\u5BC6\u94A5\u3002",keysRenamed:"\u5DF2\u4FDD\u5B58\u522B\u540D\u3002",keysReplaced:"\u5DF2\u66FF\u6362\u5BC6\u94A5\u3002",keysRemoved:"\u5DF2\u5220\u9664\u5BC6\u94A5\u3002",keysScope:"{name} \u63D0\u4F9B\u670D\u52A1\u7684\u6A21\u578B",keysModels:"\u6A21\u578B",keysScopeAll:"\u5168\u90E8\u6A21\u578B",keysScopeNone:"\u672A\u53D1\u73B0\u6A21\u578B",keysScopeCount:"{count} \u4E2A\u6A21\u578B",keysScopeSaved:"\u5DF2\u4FDD\u5B58\u6A21\u578B\u8303\u56F4\u3002",keysScopeHint:"\u53EA\u6709\u9009\u4E2D\u7684\u6A21\u578B\u4F1A\u7528\u8FD9\u4E2A Key\uFF0C\u5176\u4ED6\u6A21\u578B\u4EA4\u7ED9\u8BE5\u4F9B\u5E94\u5546\u7684\u5176\u4ED6 Key\u3002",keysScopeEmpty:"\u8BE5\u4F9B\u5E94\u5546\u8FD8\u6CA1\u6709\u6A21\u578B\u3002\u8BF7\u5148\u6DFB\u52A0\u6A21\u578B\uFF0C\u518D\u6765\u8FD9\u91CC\u9009\u62E9\u3002",keysMergedOffer:"\u5BC6\u94A5\u8FD8\u63D0\u4F9B\u670D\u52A1\u5546\u5C1A\u672A\u6DFB\u52A0\u7684 {count} \u4E2A\u6A21\u578B\uFF1A{models}\u3002",keysMergedApply:"\u6DFB\u52A0",keysMergedApplied:"\u5DF2\u628A\u6A21\u578B\u6DFB\u52A0\u5230\u8BE5\u4F9B\u5E94\u5546\u3002",keysProtocolLabel:"{name} \u4F7F\u7528\u7684\u534F\u8BAE",keysProtocolCreate:"\u534F\u8BAE",keysProtocolCreateHint:"\u8FD9\u628A\u5BC6\u94A5\u8981\u8D70\u7684\u534F\u8BAE\uFF1B\u53EF\u9009\u54EA\u4E9B\u53D6\u51B3\u4E8E\u4F9B\u5E94\u5546\u5DF2\u914D\u7F6E\u7684\u7AEF\u70B9\u5730\u5740\u3002",keysProtocolDefault:"\u81EA\u52A8\uFF08\u6309\u6A21\u578B\uFF09",keysProtocolDefaultHint:"\u6309\u6A21\u578B\u81EA\u52A8\u9009\u62E9\u534F\u8BAE\uFF1Aclaude \u7CFB\u6A21\u578B\u8D70 Anthropic \u5730\u5740\uFF0Cgemini \u7CFB\u8D70 Gemini \u5730\u5740\uFF0C\u5176\u4F59\u6CBF\u7528\u8BE5\u4F9B\u5E94\u5546\u81EA\u5E26\u7684\u534F\u8BAE\uFF08\u9700\u5DF2\u914D\u7F6E\u5BF9\u5E94\u5730\u5740\uFF09",keysProtocolAnthropic:"Anthropic",keysProtocolAnthropicHint:"Anthropic API \xB7 Claude \u6A21\u578B",keysProtocolOpenAI:"Chat Completions",keysProtocolOpenAIHint:"OpenAI API \xB7 GPT \u6A21\u578B\u3001\u5927\u591A\u6570 agent",keysProtocolResponses:"Responses",keysProtocolResponsesHint:"OpenAI API \xB7 Codex",keysProtocolGemini:"Gemini",keysProtocolGeminiHint:"Google Gemini API \xB7 gemini / gemma \u6A21\u578B",keysProtocolShortChat:"Chat",keysProtocolShortResponses:"Responses",keysProtocolShortAnthropic:"Anthropic",keysProtocolSaved:"\u5DF2\u4FDD\u5B58\u534F\u8BAE\u3002",keysEndpointOpenAI:"OpenAI",keysEndpointAnthropic:"Anthropic",keysEndpointGemini:"Gemini",keysMoreEndpoints:"\u66F4\u591A\u7AEF\u70B9",keysEndpointsCount:"\u53E6\u6709 {count} \u4E2A",keysEndpointInvalid:"\u5730\u5740\u9700\u4EE5 http:// \u6216 https:// \u5F00\u5934",keysUnreachable:"\u63D2\u4EF6\u7684\u5BC6\u94A5\u63A5\u53E3\u6CA1\u6709\u54CD\u5E94\u3002",keysPanelFailed:"\u5BC6\u94A5\u7BA1\u7406\u9762\u677F\u6E32\u67D3\u5931\u8D25",keysDraftHint:"\u5BC6\u94A5\u6682\u5B58\u5728\u672C\u9875\uFF0C\u521B\u5EFA\u4F9B\u5E94\u5546\u540E\u81EA\u52A8\u4FDD\u5B58\uFF1B\u5237\u65B0\u9875\u9762\u4F1A\u4E22\u5F03\uFF0C\u4E0E\u5361\u7247\u81EA\u8EAB\u8868\u5355\u4E00\u81F4\u3002",keysLastEnabledOff:"\u4E0D\u80FD\u505C\u7528\u6700\u540E\u4E00\u628A\u542F\u7528\u4E2D\u7684\u5BC6\u94A5\u3002",headersTitle:"\u8BF7\u6C42\u5934",headersHint:"\u8BE5\u8DEF\u7531\u7684\u6BCF\u4E2A\u8BF7\u6C42\u90FD\u4F1A\u643A\u5E26\u81EA\u5B9A\u4E49\u8BF7\u6C42\u5934\u3002",headersEmpty:"\u5C1A\u672A\u914D\u7F6E\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersAdd:"\u6DFB\u52A0\u8BF7\u6C42\u5934",headersName:"\u540D\u79F0",headersNamePlaceholder:"\u4F8B\u5982 x-company",headersValue:"\u503C",headersEdit:"\u7F16\u8F91",headersSave:"\u4FDD\u5B58",headersCancel:"\u53D6\u6D88",headersClear:"\u5168\u90E8\u6E05\u7A7A",headersSaved:"\u5DF2\u4FDD\u5B58\u3002",headersCleared:"\u5DF2\u6E05\u7A7A\u2014\u2014\u8BE5\u8DEF\u7531\u4E0D\u518D\u643A\u5E26\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersReadOnly:"\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",headersConflictOrigin:"\u540C\u4E00\u4E2A endpoint \u4E0A\u6709\u591A\u4E2A\u8DEF\u7531\u914D\u7F6E\u4E86\u4E0D\u540C\u7684\u8BF7\u6C42\u5934\u503C\uFF1A\u5F53\u8BF7\u6C42\u4F53\u91CC\u7684\u6A21\u578B\u65E0\u6CD5\u552F\u4E00\u5B9A\u4F4D\u5176\u4E2D\u4E00\u4E2A\u8DEF\u7531\u65F6\uFF0C\u8BE5\u8BF7\u6C42\u56DE\u9000\u5230\u7B2C\u4E00\u4E2A\u8DEF\u7531\u7684\u914D\u7F6E\u3002",headersConflictPatched:"\u68C0\u6D4B\u5230\u5B98\u65B9 dsh-llm-pi-ai \u5DF2\u5728\u8BF7\u6C42\u5C42\u5904\u7406\u8BF7\u6C42\u5934\uFF1A\u628A\u503C\u586B\u5728\u4E0A\u65B9\u8BF7\u6C42\u5934\u914D\u7F6E\u4E2D\u5373\u53EF\uFF0C\u65E0\u9700\u91CD\u590D\u63A5\u7BA1\u3002",headersConflictSiblings:"\u68C0\u6D4B\u5230\u4F1A\u6539\u5199\u540C\u4E00\u5C42\u7684\u540C\u7C7B\u63D2\u4EF6\uFF1A{names}\u3002\u540C\u4E00\u65F6\u95F4\u53EA\u5E94\u542F\u7528\u4E00\u79CD\u8BF7\u6C42\u5934\u6539\u5199\uFF0C\u5426\u5219\u7EBF\u4E0A\u751F\u6548\u7684\u662F\u6700\u540E\u5199\u5165\u8005\u3002",headersError:"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}",headersNoRoute:"\u8BE5\u8DEF\u7531\u5DF2\u4E0D\u5728\u8BBE\u7F6E\u6587\u6863\u4E2D\u2014\u2014\u8BF7\u5148\u4FDD\u5B58\u4E00\u6B21\u5B98\u65B9\u5361\u7247\u3002",providerReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{provider}",providerReorderHint:"\u62D6\u52A8\u8C03\u6574\u4F9B\u5E94\u5546\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002",providerToggleAria:"\u542F\u7528 {provider}",providerToggleHint:"\u7981\u7528\u540E\u8BE5\u4F9B\u5E94\u5546\u4E0D\u5728\u6A21\u578B\u5207\u6362\u5217\u8868\u4E2D\u663E\u793A\u3002",providerDisabledGroupShow:"\u5C55\u5F00 {count} \u4E2A\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546",providerDisabledGroupHide:"\u6536\u8D77 {count} \u4E2A\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546",providerDisabledGroupHint:"\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546\u914D\u7F6E\u4ECD\u5728\uFF0C\u53EA\u662F\u6298\u53E0\u5728\u8FD9\u91CC\u2014\u2014\u5C55\u5F00\u540E\u53EF\u4EE5\u91CD\u65B0\u542F\u7528\u3002",providerRemoveDisabled:"\u5220\u9664",providerRemoveLocked:"\u5185\u7F6E\u4F9B\u5E94\u5546\u4E0D\u53EF\u5220\u9664\u3002",modelReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{model}",modelReorderHint:"\u62D6\u52A8\u8C03\u6574\u8BE5\u4F9B\u5E94\u5546\u5185\u6A21\u578B\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002"};var qn="dsh-model-think-level.slider.enabled",qc=["dsh-reasoning-effort.enabled","@dsh-external/dsh-reasoning-effort.enabled"],en=Wc();function Wc(){try{let e=window.localStorage.getItem(qn),t=e===null?qc.map(n=>window.localStorage.getItem(n)).find(n=>n!==null):null;return(e??t??null)!=="false"}catch{return!0}}var fo=new Set;function ea(){for(let e of[...fo])e()}function Pe(){return en}function ta(e){if(en!==e){en=e;try{window.localStorage.setItem(qn,String(e))}catch{}ea()}}function na(e){en!==e&&(en=e,ea())}function Wn(e){return fo.add(e),()=>{fo.delete(e)}}var Bn="dsh-model-think-level.provider-order",ra=["deepseek-account","deepseek-official"];function Ct(e){if(e===null)return[];try{let t=JSON.parse(e);return Array.isArray(t)?mo(t.filter(n=>typeof n=="string")):[]}catch{return[]}}function mo(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var Ot=(()=>{try{return Ct(window.localStorage.getItem(Bn))}catch{return[]}})(),po=new Set;function oa(){for(let e of[...po])e()}function ia(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function ho(){return Ot}function aa(e){let t=mo(e);if(!ia(Ot,t)){Ot=t;try{window.localStorage.setItem(Bn,JSON.stringify(Ot))}catch{}oa()}}function sa(e){let t=mo(e);ia(Ot,t)||(Ot=t,oa())}function Gn(e){return po.add(e),()=>{po.delete(e)}}function go(e){let t=n=>{let r=ra.indexOf(n);return r<0?ra.length:r};return e.map((n,r)=>({id:n,index:r,rank:t(n)})).sort((n,r)=>n.rank-r.rank||n.index-r.index).map(n=>n.id)}function Dt(e,t){let n=new Map;for(let a of t)n.has(a)||n.set(a,n.size);let r=[],o=[];e.forEach((a,s)=>{n.has(a)&&(r.push(s),o.push(a))}),o.sort((a,s)=>n.get(a)-n.get(s));let i=[...e];return r.forEach((a,s)=>{i[a]=o[s]}),i}function da(e){return Dt(go(e),ho())}function bo(e,t,n){let r=e.indexOf(t);if(r<0)return[...e];let o=[...e];o.splice(r,1);let i=Math.max(0,Math.min(o.length,n));return o.splice(i,0,t),o}var Un="dsh-model-think-level.providers.disabled",yo=new Set,ot=Bc();function Bc(){try{return Ct(window.localStorage.getItem(Un))}catch{return[]}}function la(e){return Ct(e)}function ca(){return ot}function Pt(e){return!ot.includes(e)}function ua(e,t){let n=!ot.includes(e);t!==n&&pa(t?ot.filter(r=>r!==e):[...ot,e],!0)}function fa(e){pa(e,!1)}function jn(e){return yo.add(e),()=>{yo.delete(e)}}function Gc(e,t){return e.length!==t.length?!1:e.every(n=>t.includes(n))}function pa(e,t){if(!Gc(ot,e)){if(ot=[...new Set(e)],t)try{window.localStorage.setItem(Un,JSON.stringify(ot))}catch{}for(let n of[...yo])n()}}var zn="dsh-model-think-level.model-order";function vo(e){if(e===null)return{};try{let t=JSON.parse(e);if(t===null||typeof t!="object"||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t)){if(r.length===0||!Array.isArray(o))continue;let i=ma(o.filter(a=>typeof a=="string"));i.length>0&&(n[r]=i)}return n}catch{return{}}}function ma(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var gt=(()=>{try{return vo(window.localStorage.getItem(zn))}catch{return{}}})(),wo=new Set;function ha(){for(let e of[...wo])e()}function Uc(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function jc(){try{window.localStorage.setItem(zn,JSON.stringify(gt))}catch{}}function ga(){return gt}function ba(e){return gt[e]??zc}var zc=[];function ya(e,t){if(e.length===0)return;let n=ma(t),r=ba(e);if(Uc(r,n)&&(n.length>0||!(e in gt)))return;let o={...gt};n.length===0?delete o[e]:o[e]=n,gt=o,jc(),ha()}function wa(e){gt=e,ha()}function $n(e){return wo.add(e),()=>{wo.delete(e)}}function $c(e,t){return Dt(e,t)}function va(e,t){return Dt(t,ba(e))}function xo(e,t){if(e.length===0||t.length===0)return e;let n=new Map(e.map(r=>[r.id,r]));return $c(e.map(r=>r.id),t).map(r=>n.get(r))}var xa=`
|
|
8
|
+
/* ---- Quiet Precision: the plugin's own token layer ----
|
|
9
|
+
Every value below is a HOST design-platform token (--dsw-*) with the light
|
|
10
|
+
theme's literal as the fallback, so the plugin inherits a theme switch for
|
|
11
|
+
free instead of carrying a second palette. The few values the platform has no
|
|
12
|
+
name for (a 10% accent tint, the slider's track grey) are declared here once
|
|
13
|
+
and re-declared under the host's dark attribute \u2014 the plugin never hard-codes
|
|
14
|
+
a colour in a component rule.
|
|
15
|
+
|
|
16
|
+
The layer is declared on BOTH :root and body on purpose. A custom property
|
|
17
|
+
resolves var() where it is DECLARED, not where it is used: declared on :root
|
|
18
|
+
alone, --bre-ink would read the alias chain as the <html> element sees it, and
|
|
19
|
+
the host republishes its dark aliases on body[data-ds-dark-theme] \u2014 a
|
|
20
|
+
descendant \u2014 so every value here would stay frozen at the light fallback.
|
|
21
|
+
Declaring it again on body makes each var() resolve against the element that
|
|
22
|
+
actually carries the theme. */
|
|
23
|
+
:root,
|
|
24
|
+
body {
|
|
25
|
+
--bre-ink: var(--dsw-alias-label-primary, #0f1115);
|
|
26
|
+
--bre-ink-2: var(--dsw-alias-label-secondary, #61666b);
|
|
27
|
+
--bre-ink-3: var(--dsw-alias-label-tertiary, #81858c);
|
|
28
|
+
/* label-dimmed is the host's disabled/skeleton tone \u2014 bluish-200 #e1e5ee on
|
|
29
|
+
white, bluish-750 #43454a on #292929. Invisible as body copy, and it was what
|
|
30
|
+
every placeholder and muted value inherited. Dimmed now stops at tertiary, and
|
|
31
|
+
hint copy gets its own token a step darker so descriptions read without
|
|
32
|
+
competing with real values. */
|
|
33
|
+
--bre-ink-4: var(--dsw-alias-label-tertiary, #81858c);
|
|
34
|
+
--bre-ink-hint: var(--dsw-alias-label-secondary, #61666b);
|
|
35
|
+
--bre-surface: var(--dsw-alias-bg-base, #ffffff);
|
|
36
|
+
--bre-sunken: var(--dsw-alias-bg-module-platform, #f5f6f7);
|
|
37
|
+
--bre-sunken-2: var(--dsw-alias-fill-tertiary, #f1f3f5);
|
|
38
|
+
--bre-track: #e9ecf2;
|
|
39
|
+
--bre-hover: var(--dsw-alias-interactive-bg-hover, #2631480f);
|
|
40
|
+
--bre-active: var(--dsw-alias-interactive-bg-active, #2631481a);
|
|
41
|
+
--bre-line-1: var(--dsw-alias-border-l1, #0000000a);
|
|
42
|
+
--bre-line-2: var(--dsw-alias-border-l2, #0000001a);
|
|
43
|
+
--bre-line-3: var(--dsw-alias-border-l3, #0000001f);
|
|
44
|
+
--bre-line-4: var(--dsw-alias-border-l4, #00000029);
|
|
45
|
+
--bre-accent: var(--dsw-alias-link, #4176e6);
|
|
46
|
+
--bre-accent-ink: #2f4c8f;
|
|
47
|
+
--bre-accent-weak: #edf3fe;
|
|
48
|
+
--bre-accent-line: #4176e640;
|
|
49
|
+
--bre-accent-glow: #4176e61f;
|
|
50
|
+
--bre-ok: var(--dsw-alias-state-success-primary, #22c55e);
|
|
51
|
+
--bre-warn: var(--dsw-alias-state-warn-label, #dd8629);
|
|
52
|
+
--bre-danger: var(--dsw-alias-state-error-primary, #ec1313);
|
|
53
|
+
--bre-danger-weak: #fef2f2;
|
|
54
|
+
--bre-r-xs: 4px;
|
|
55
|
+
--bre-r-sm: 8px;
|
|
56
|
+
--bre-r-md: 12px;
|
|
57
|
+
--bre-r-pill: 999px;
|
|
58
|
+
--bre-switch-track: #cfd3d6;
|
|
59
|
+
--bre-switch-knob: #ffffff;
|
|
60
|
+
--bre-ease: cubic-bezier(.4, 0, .2, 1);
|
|
61
|
+
--bre-t: .16s;
|
|
62
|
+
--bre-shadow-pop: 0 2px 5px #00000009, 0 12px 32px -8px #0f11151f;
|
|
63
|
+
}
|
|
64
|
+
body[data-ds-dark-theme] {
|
|
65
|
+
--bre-ink-4: var(--dsw-alias-label-tertiary, #adb2b8);
|
|
66
|
+
--bre-surface: #292929;
|
|
67
|
+
--bre-sunken: #353638;
|
|
68
|
+
--bre-sunken-2: #3d3e40;
|
|
69
|
+
--bre-track: #434446;
|
|
70
|
+
--bre-accent-ink: #d3e2ff;
|
|
71
|
+
--bre-accent-weak: #1e335c;
|
|
72
|
+
--bre-accent-line: #7aaaff40;
|
|
73
|
+
--bre-accent-glow: #7aaaff26;
|
|
74
|
+
--bre-danger-weak: #3a1b18;
|
|
75
|
+
--bre-switch-track: #4a4b4d;
|
|
76
|
+
--bre-shadow-pop: 0 2px 5px #00000059, 0 12px 32px -8px #000000a6;
|
|
77
|
+
}
|
|
78
|
+
|
|
8
79
|
/* The injector's mount wrapper. It \u2014 not the editor inside it \u2014 is the item
|
|
9
80
|
placed into the official row disclosure's repeat(auto-fit, minmax(160px,1fr))
|
|
10
81
|
grid (context window and max tokens take two cells), so the span belongs
|
|
11
82
|
here: on the editor itself it would target the wrapper's block box and be
|
|
12
|
-
ignored, squeezing the block into one cell.
|
|
83
|
+
ignored, squeezing the block into one cell. The min-width floors the grid
|
|
84
|
+
item's auto minimum at 0 for the same reason: a one-line hint inside must
|
|
85
|
+
clip at the disclosure's edge, not price the host grid wider than it is. */
|
|
13
86
|
.bre-effort-slot {
|
|
14
87
|
grid-column: 1 / -1;
|
|
88
|
+
min-width: 0;
|
|
15
89
|
}
|
|
16
90
|
/* The slot wrapper is a plain column: the master thinking switch sits in it,
|
|
17
91
|
directly above the card it gates. */
|
|
@@ -21,28 +95,40 @@ window.__ModuleLoader__.load({
|
|
|
21
95
|
gap: 8px;
|
|
22
96
|
margin: 8px 0 4px;
|
|
23
97
|
}
|
|
24
|
-
/* The \u601D\u8003\u5F3A\u5EA6 card proper \u2014 rendered only while the master switch is on.
|
|
98
|
+
/* The \u601D\u8003\u5F3A\u5EA6 card proper \u2014 rendered only while the master switch is on.
|
|
99
|
+
The redesign's \u53BB\u88C5\u9970 rule for a nested card: one hairline on the card's own
|
|
100
|
+
stroke, no fill of its own \u2014 grouping is the border's job, not a second
|
|
101
|
+
grey panel stacked inside the host card. */
|
|
25
102
|
.bre-effort-card {
|
|
26
103
|
display: flex;
|
|
27
104
|
flex-direction: column;
|
|
28
105
|
gap: 8px;
|
|
29
106
|
padding: 10px 12px;
|
|
30
107
|
border: 0.5px solid var(--dsw-alias-border-l2);
|
|
31
|
-
border-radius:
|
|
32
|
-
background:
|
|
108
|
+
border-radius: var(--dsw-radius-md, 12px);
|
|
109
|
+
background: transparent;
|
|
33
110
|
box-sizing: border-box;
|
|
34
111
|
}
|
|
35
|
-
|
|
112
|
+
/* The editor's one-line head: switch + title, the declared state, and the
|
|
113
|
+
applied suggestion's provenance pill. */
|
|
114
|
+
.bre-effort-top {
|
|
36
115
|
display: flex;
|
|
37
116
|
align-items: center;
|
|
38
|
-
|
|
39
|
-
gap:
|
|
117
|
+
flex-wrap: wrap;
|
|
118
|
+
gap: 4px 10px;
|
|
40
119
|
}
|
|
41
|
-
.bre-effort-
|
|
120
|
+
.bre-effort-state {
|
|
42
121
|
font-size: 12px;
|
|
43
|
-
font-weight: 600;
|
|
44
122
|
color: var(--dsw-alias-label-secondary);
|
|
45
123
|
}
|
|
124
|
+
.bre-effort-title {
|
|
125
|
+
/* The section title reads as the card's own heading: primary ink at the
|
|
126
|
+
design's 13/500, not a grey caption \u2014 it names the row, the hints under
|
|
127
|
+
it carry the explanation. */
|
|
128
|
+
font-size: 13px;
|
|
129
|
+
font-weight: 500;
|
|
130
|
+
color: var(--dsw-alias-label-primary);
|
|
131
|
+
}
|
|
46
132
|
.bre-link-button {
|
|
47
133
|
background: none;
|
|
48
134
|
border: none;
|
|
@@ -81,31 +167,231 @@ window.__ModuleLoader__.load({
|
|
|
81
167
|
background: var(--dsw-alias-interactive-bg-hover, #2631480f);
|
|
82
168
|
color: var(--dsw-alias-label-secondary, #374151);
|
|
83
169
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
170
|
+
/* The level ladder is a row of toggle pills: the armed ones carry the accent
|
|
171
|
+
tint alone (\u9009\u4E2D\u7684\u6863\u4F4D\u9AD8\u4EAE\u5373\u53EF\uFF0C\u65E0\u9700\u5BF9\u52FE), the rest stay quiet outlines. One
|
|
172
|
+
click is one declaration. The pills are TIGHT \u2014 seven levels must sit on one
|
|
173
|
+
line in the row disclosure (a wrapped ladder with an orphaned last pill reads
|
|
174
|
+
as two ladders); the wire spellings live folded behind the link beneath. */
|
|
175
|
+
.bre-pillrow {
|
|
176
|
+
display: flex;
|
|
177
|
+
flex-wrap: wrap;
|
|
178
|
+
gap: 5px;
|
|
179
|
+
}
|
|
180
|
+
/* The level ladder and the modality pair share one pill face: 28px, an
|
|
181
|
+
8px corner and a hairline stroke, so a row of them reads as one control. The
|
|
182
|
+
armed pill is the DESIGN's selection \u2014 accent tint, accent edge, accent ink,
|
|
183
|
+
and NO tick (\u9009\u4E2D\u7684\u6863\u4F4D\u9AD8\u4EAE\u5373\u53EF\uFF0C\u65E0\u9700\u5BF9\u52FE: a second glyph would also shift the
|
|
184
|
+
row's width every time a level is clicked). */
|
|
185
|
+
.bre-lvl {
|
|
186
|
+
appearance: none;
|
|
187
|
+
display: inline-flex;
|
|
95
188
|
align-items: center;
|
|
96
189
|
gap: 6px;
|
|
190
|
+
height: 28px;
|
|
191
|
+
padding: 0 11px;
|
|
192
|
+
border-radius: var(--bre-r-sm);
|
|
193
|
+
border: 1px solid var(--bre-line-3);
|
|
194
|
+
background: transparent;
|
|
195
|
+
color: var(--bre-ink);
|
|
196
|
+
font: inherit;
|
|
97
197
|
font-size: 12px;
|
|
198
|
+
line-height: 1;
|
|
199
|
+
white-space: nowrap;
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
transition: background var(--bre-t) var(--bre-ease), border-color var(--bre-t) var(--bre-ease), color var(--bre-t) var(--bre-ease);
|
|
98
202
|
}
|
|
99
|
-
.bre-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
203
|
+
.bre-lvl:hover:not(:disabled) {
|
|
204
|
+
background: var(--bre-hover);
|
|
205
|
+
}
|
|
206
|
+
.bre-lvl:focus-visible {
|
|
207
|
+
outline: none;
|
|
208
|
+
border-color: var(--bre-accent);
|
|
209
|
+
box-shadow: 0 0 0 3px var(--bre-accent-glow);
|
|
210
|
+
}
|
|
211
|
+
.bre-lvl:disabled { opacity: 0.55; cursor: default; }
|
|
212
|
+
.bre-lvl.is-on {
|
|
213
|
+
border-color: var(--bre-accent-line);
|
|
214
|
+
background: var(--bre-accent-weak);
|
|
215
|
+
color: var(--bre-accent-ink);
|
|
216
|
+
font-weight: 500;
|
|
217
|
+
}
|
|
218
|
+
/* The modality pill's glyph follows its name's state: quiet ink when the
|
|
219
|
+
declaration does not carry it, the accent when it does. */
|
|
220
|
+
.bre-lvl svg { flex: none; opacity: 0.75; }
|
|
221
|
+
.bre-lvl.is-on svg { opacity: 1; }
|
|
222
|
+
/* The slider's head, written above the track (\u8FDB\u5EA6\u6761\u4E0A\u65B9\uFF1A\u601D\u8003\u7B49\u7EA7 + \u5F53\u524D\u7B49\u7EA7):
|
|
223
|
+
the section name on the left, the level under the thumb on the right. One
|
|
224
|
+
accent, so the value reads as "this is the current setting", not as a rank. */
|
|
225
|
+
.bre-effort-slider-head {
|
|
226
|
+
display: flex;
|
|
227
|
+
align-items: baseline;
|
|
228
|
+
justify-content: space-between;
|
|
229
|
+
gap: 8px;
|
|
230
|
+
margin-bottom: 6px;
|
|
231
|
+
}
|
|
232
|
+
.bre-effort-slider-head-label {
|
|
233
|
+
font-size: 11.5px;
|
|
234
|
+
line-height: 18px;
|
|
235
|
+
color: var(--bre-ink-3);
|
|
236
|
+
}
|
|
237
|
+
.bre-effort-slider-head-value {
|
|
238
|
+
font-size: 12.5px;
|
|
239
|
+
line-height: 18px;
|
|
240
|
+
font-weight: 600;
|
|
241
|
+
letter-spacing: -.005em;
|
|
242
|
+
color: var(--bre-accent-ink);
|
|
243
|
+
}
|
|
244
|
+
/* The level slider: the composer menu's reasoning-level footer. A long ladder
|
|
245
|
+
wrapped its capsule row inside the popover (\u601D\u8003\u7B49\u7EA7\u9009\u62E9\u6362\u6210\u8FDB\u5EA6\u6761\u6837\u5F0F); a
|
|
246
|
+
track is fixed-length whatever the ladder's size, the stop names written
|
|
247
|
+
below it.
|
|
248
|
+
|
|
249
|
+
The rainbow ramp is GONE: a red stop read as "danger" where the interface
|
|
250
|
+
meant "more", and the seven-hue scale was the one place the plugin spoke a
|
|
251
|
+
colour language the host never uses. What is left is the host's own accent
|
|
252
|
+
for "where the thumb is" and tick marks for "how many stops there are". */
|
|
253
|
+
.bre-effort-slider {
|
|
254
|
+
position: relative;
|
|
103
255
|
height: 18px;
|
|
104
|
-
margin: 0;
|
|
105
|
-
accent-color: var(--dsw-alias-brand-primary);
|
|
106
256
|
cursor: pointer;
|
|
257
|
+
touch-action: none;
|
|
258
|
+
}
|
|
259
|
+
.bre-effort-slider::before {
|
|
260
|
+
content: '';
|
|
261
|
+
position: absolute;
|
|
262
|
+
left: 0;
|
|
263
|
+
right: 0;
|
|
264
|
+
top: 50%;
|
|
265
|
+
height: 6px;
|
|
266
|
+
transform: translateY(-50%);
|
|
267
|
+
border-radius: 999px;
|
|
268
|
+
background: var(--bre-track);
|
|
269
|
+
}
|
|
270
|
+
.bre-effort-slider:focus-visible {
|
|
271
|
+
outline: none;
|
|
272
|
+
border-radius: 999px;
|
|
273
|
+
box-shadow: 0 0 0 3px var(--bre-accent-glow);
|
|
274
|
+
}
|
|
275
|
+
.bre-effort-slider-fill {
|
|
276
|
+
position: absolute;
|
|
277
|
+
left: 0;
|
|
278
|
+
right: 0;
|
|
279
|
+
top: 50%;
|
|
280
|
+
height: 6px;
|
|
281
|
+
transform: translateY(-50%);
|
|
282
|
+
border-radius: 999px;
|
|
283
|
+
background: var(--bre-accent);
|
|
284
|
+
pointer-events: none;
|
|
285
|
+
}
|
|
286
|
+
/* The remaining stops, sunk into the track as 2px holes. Painted white on the
|
|
287
|
+
light theme and near-black on the dark one: they are holes, not dots, so they
|
|
288
|
+
take the surface colour rather than an ink colour. */
|
|
289
|
+
.bre-effort-slider-tick {
|
|
290
|
+
position: absolute;
|
|
291
|
+
top: 50%;
|
|
292
|
+
width: 2px;
|
|
293
|
+
height: 2px;
|
|
294
|
+
margin-left: -1px;
|
|
295
|
+
margin-top: -1px;
|
|
296
|
+
border-radius: 50%;
|
|
297
|
+
background: var(--bre-surface);
|
|
298
|
+
opacity: .9;
|
|
299
|
+
pointer-events: none;
|
|
300
|
+
}
|
|
301
|
+
.bre-effort-slider-thumb {
|
|
302
|
+
position: absolute;
|
|
303
|
+
top: 50%;
|
|
304
|
+
width: 14px;
|
|
305
|
+
height: 14px;
|
|
306
|
+
border-radius: 999px;
|
|
307
|
+
transform: translate(-50%, -50%);
|
|
308
|
+
background: var(--bre-surface);
|
|
309
|
+
box-shadow: 0 0 0 1px var(--bre-accent-line), 0 1px 3px #0f11152e;
|
|
310
|
+
pointer-events: none;
|
|
311
|
+
}
|
|
312
|
+
/* The stops, written under the track: first left-aligned, last right-aligned,
|
|
313
|
+
the middle ones centred on their stop, so the row never wraps. */
|
|
314
|
+
.bre-effort-slider-labels {
|
|
315
|
+
position: relative;
|
|
316
|
+
height: 14px;
|
|
317
|
+
margin: 5px 2px 0;
|
|
318
|
+
}
|
|
319
|
+
.bre-effort-slider-label {
|
|
320
|
+
position: absolute;
|
|
321
|
+
transform: translateX(-50%);
|
|
322
|
+
font-size: 9.5px;
|
|
323
|
+
line-height: 14px;
|
|
324
|
+
letter-spacing: -.02em;
|
|
325
|
+
color: var(--bre-ink-hint);
|
|
326
|
+
white-space: nowrap;
|
|
327
|
+
}
|
|
328
|
+
.bre-effort-slider-label.is-first { transform: none; }
|
|
329
|
+
.bre-effort-slider-label.is-last { transform: translateX(-100%); }
|
|
330
|
+
.bre-effort-slider-label.is-on {
|
|
331
|
+
color: var(--bre-accent-ink);
|
|
332
|
+
font-weight: 600;
|
|
333
|
+
}
|
|
334
|
+
/* A section: its label row (label, hint, trailing action) and its body. */
|
|
335
|
+
.bre-effort-sec { display: flex; flex-direction: column; }
|
|
336
|
+
.bre-effort-labelrow {
|
|
337
|
+
display: flex;
|
|
338
|
+
align-items: baseline;
|
|
339
|
+
gap: 8px;
|
|
340
|
+
margin-bottom: 8px;
|
|
341
|
+
}
|
|
342
|
+
.bre-effort-label {
|
|
343
|
+
font-size: 12px;
|
|
344
|
+
color: var(--dsw-alias-label-secondary);
|
|
345
|
+
}
|
|
346
|
+
.bre-effort-labelhint {
|
|
347
|
+
font-style: normal;
|
|
348
|
+
font-size: 11px;
|
|
349
|
+
color: var(--dsw-alias-label-tertiary);
|
|
350
|
+
min-width: 0;
|
|
351
|
+
overflow: hidden;
|
|
352
|
+
text-overflow: ellipsis;
|
|
353
|
+
white-space: nowrap;
|
|
354
|
+
}
|
|
355
|
+
.bre-effort-adapt { margin-left: auto; flex: none; }
|
|
356
|
+
/* The quiet link that unfolds the armed levels' wire spellings. It sits right
|
|
357
|
+
under the decision pills, sized like the label hints \u2014 the spelling row is
|
|
358
|
+
an editor's aside, not a form row of its own. */
|
|
359
|
+
.bre-effort-wiretoggle {
|
|
360
|
+
align-self: flex-start;
|
|
361
|
+
margin: 2px 0 0 -6px;
|
|
362
|
+
padding: 2px 6px;
|
|
363
|
+
font-size: 11px;
|
|
364
|
+
color: var(--dsw-alias-label-secondary);
|
|
365
|
+
}
|
|
366
|
+
/* The wire spellings, compact: label + small input pairs that
|
|
367
|
+
read as the bytes row under the decision row. */
|
|
368
|
+
.bre-wire-row {
|
|
369
|
+
display: flex;
|
|
370
|
+
flex-wrap: wrap;
|
|
371
|
+
gap: 6px 14px;
|
|
372
|
+
margin-top: 4px;
|
|
373
|
+
}
|
|
374
|
+
.bre-wire-item {
|
|
375
|
+
display: inline-flex;
|
|
376
|
+
align-items: center;
|
|
377
|
+
gap: 6px;
|
|
378
|
+
}
|
|
379
|
+
.bre-wire-name {
|
|
380
|
+
font-size: 11px;
|
|
381
|
+
color: var(--dsw-alias-label-tertiary);
|
|
382
|
+
white-space: nowrap;
|
|
383
|
+
}
|
|
384
|
+
/* The sections BELOW the ladder stack full-width: the default-effort slider
|
|
385
|
+
needs the whole row's length (a squeezed half-column is what wrapped its
|
|
386
|
+
pills and its hint), and the modality pills read fine on their own line. */
|
|
387
|
+
.bre-effort-cols {
|
|
388
|
+
display: grid;
|
|
389
|
+
/* The 0 floor stands the track's auto minimum down: the default-effort hint
|
|
390
|
+
is one nowrap line whose min-content width would otherwise price the track
|
|
391
|
+
past the disclosure's width \u2014 overflow, with the ellipsis never engaged. */
|
|
392
|
+
grid-template-columns: minmax(0, 1fr);
|
|
393
|
+
gap: 14px;
|
|
107
394
|
}
|
|
108
|
-
.bre-effort-level { color: var(--dsw-alias-label-tertiary); }
|
|
109
395
|
.bre-effort-wire {
|
|
110
396
|
box-sizing: border-box;
|
|
111
397
|
min-width: 0;
|
|
@@ -121,6 +407,7 @@ window.__ModuleLoader__.load({
|
|
|
121
407
|
.bre-effort-wire:focus {
|
|
122
408
|
outline: none;
|
|
123
409
|
border-color: var(--dsw-alias-brand-primary);
|
|
410
|
+
box-shadow: 0 0 0 3px var(--dsw-alias-brand-primary-muted, rgba(77, 112, 255, .14));
|
|
124
411
|
}
|
|
125
412
|
.bre-effort-empty { min-height: 24px; }
|
|
126
413
|
.bre-effort-actions {
|
|
@@ -142,30 +429,53 @@ window.__ModuleLoader__.load({
|
|
|
142
429
|
.bre-effort-message.bre-error { color: #c62828; }
|
|
143
430
|
.bre-effort-message.bre-info { color: var(--dsw-alias-link); }
|
|
144
431
|
.bre-effort-note { font-size: 11px; margin: 0; color: var(--dsw-alias-label-tertiary); }
|
|
145
|
-
/*
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
432
|
+
/* The one-line variant: the default-effort hint under the pick's form row. The
|
|
433
|
+
row disclosure is narrow, and a wrapped explanation read as a broken layout
|
|
434
|
+
(\u8BF4\u660E\u6587\u5B57\u4E5F\u6362\u884C\u4E86); the headers pane keeps its own wrapping notes. */
|
|
435
|
+
.bre-effort-note-oneline {
|
|
436
|
+
white-space: nowrap;
|
|
437
|
+
overflow: hidden;
|
|
438
|
+
text-overflow: ellipsis;
|
|
150
439
|
}
|
|
151
|
-
|
|
152
|
-
|
|
440
|
+
/* The default-effort dropdown: sized by its longest option, matching the wire
|
|
441
|
+
inputs' quiet box. It sits BESIDE the row's label (\u9009\u62E9\u6846\u8D34\u8FD1\u201C\u9ED8\u8BA4\u601D\u8003\u5F3A\u5EA6\u201D) \u2014
|
|
442
|
+
the row is a form row, not a two-ended header, so no auto margin pushes the
|
|
443
|
+
pick to the disclosure's far edge. */
|
|
444
|
+
.bre-effort-select {
|
|
445
|
+
flex: none;
|
|
446
|
+
height: 28px;
|
|
447
|
+
min-width: 128px;
|
|
448
|
+
padding: 0 8px;
|
|
449
|
+
border: 1px solid var(--dsw-alias-border-l3, #0000001f);
|
|
450
|
+
border-radius: 8px;
|
|
451
|
+
background: var(--dsw-alias-bg-primary, #fff);
|
|
452
|
+
color: var(--dsw-alias-label-primary, #0f1115);
|
|
453
|
+
font: inherit;
|
|
454
|
+
font-size: 12px;
|
|
455
|
+
cursor: pointer;
|
|
456
|
+
}
|
|
457
|
+
.bre-effort-select:focus-visible {
|
|
458
|
+
outline: none;
|
|
459
|
+
border-color: var(--dsw-alias-brand-primary, #4d6bfe);
|
|
460
|
+
box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #4d6bfe);
|
|
461
|
+
}
|
|
462
|
+
.bre-effort-select:disabled { opacity: 0.55; cursor: default; }
|
|
463
|
+
/* The master thinking switch, which lives OUTSIDE the card it gates: with it
|
|
464
|
+
off that card is not rendered at all, so nothing here has to be hidden. */
|
|
465
|
+
.bre-thinking-switch {
|
|
466
|
+
display: inline-flex;
|
|
153
467
|
align-items: center;
|
|
154
468
|
gap: 6px;
|
|
155
|
-
|
|
469
|
+
margin: 0;
|
|
470
|
+
cursor: pointer;
|
|
156
471
|
}
|
|
157
|
-
.bre-
|
|
158
|
-
width:
|
|
159
|
-
height:
|
|
472
|
+
.bre-thinking-switch input[type='checkbox'] {
|
|
473
|
+
width: 16px;
|
|
474
|
+
height: 16px;
|
|
160
475
|
margin: 0;
|
|
161
476
|
accent-color: var(--dsw-alias-brand-primary);
|
|
162
477
|
cursor: pointer;
|
|
163
478
|
}
|
|
164
|
-
.bre-modality-clear { margin-left: auto; }
|
|
165
|
-
.bre-modality-note { font-size: 11px; margin: 0; color: var(--dsw-alias-label-tertiary); }
|
|
166
|
-
/* The master thinking switch, which lives OUTSIDE the card it gates: with it
|
|
167
|
-
off that card is not rendered at all, so nothing here has to be hidden. */
|
|
168
|
-
.bre-thinking-switch { margin: 0; }
|
|
169
479
|
.bre-select, .bre-text-input {
|
|
170
480
|
box-sizing: border-box;
|
|
171
481
|
width: 100%;
|
|
@@ -180,10 +490,15 @@ window.__ModuleLoader__.load({
|
|
|
180
490
|
font-size: 14px;
|
|
181
491
|
line-height: 22px;
|
|
182
492
|
}
|
|
183
|
-
|
|
493
|
+
/* Dimmed directly would be the host's skeleton tone (#e1e5ee) \u2014 the same trap the
|
|
494
|
+
ink tokens now route around; placeholders read at tertiary like every other one. */
|
|
495
|
+
.bre-text-input::placeholder { color: var(--bre-ink-4); }
|
|
184
496
|
.bre-select:focus, .bre-text-input:focus {
|
|
185
497
|
outline: none;
|
|
186
498
|
border-color: var(--dsw-alias-brand-primary);
|
|
499
|
+
/* The redesign's focus token: brand border over a soft brand halo, so the
|
|
500
|
+
focused field reads at a glance without a hard outline. */
|
|
501
|
+
box-shadow: 0 0 0 3px var(--dsw-alias-brand-primary-muted, rgba(77, 112, 255, .14));
|
|
187
502
|
}
|
|
188
503
|
.bre-select:disabled, .bre-text-input:disabled { opacity: 0.6; cursor: default; }
|
|
189
504
|
.bre-select {
|
|
@@ -206,19 +521,64 @@ window.__ModuleLoader__.load({
|
|
|
206
521
|
flex-direction: column;
|
|
207
522
|
gap: 3px;
|
|
208
523
|
}
|
|
209
|
-
|
|
524
|
+
/* The two capacities are EDITABLE fields, not a footnote (user request: \u4E0A\u4E0B\u6587
|
|
525
|
+
\u53C2\u6570/\u6700\u5927\u957F\u5EA6\u8FD9\u4E24\u4E2A\u53C2\u6570\u9700\u8981\u53EF\u4EE5\u914D\u7F6E): each is the row's own official input,
|
|
526
|
+
mirrored here, so the label sits above a sunken field with the unit inside it.
|
|
527
|
+
Blank is a value \u2014 \u6CBF\u7528\u76EE\u5F55\u503C \u2014 which is why the placeholder says so. */
|
|
528
|
+
.bre-effort-caps {
|
|
529
|
+
display: grid;
|
|
530
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
531
|
+
gap: 10px 18px;
|
|
532
|
+
}
|
|
533
|
+
.bre-cap {
|
|
210
534
|
display: flex;
|
|
211
|
-
flex-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
535
|
+
flex-direction: column;
|
|
536
|
+
gap: 5px;
|
|
537
|
+
min-width: 0;
|
|
538
|
+
}
|
|
539
|
+
.bre-cap-box {
|
|
540
|
+
display: flex;
|
|
541
|
+
align-items: center;
|
|
542
|
+
gap: 6px;
|
|
543
|
+
height: 30px;
|
|
544
|
+
padding: 0 9px;
|
|
545
|
+
border-radius: var(--bre-r-sm);
|
|
546
|
+
border: 1px solid transparent;
|
|
547
|
+
background: var(--bre-sunken);
|
|
548
|
+
transition: background var(--bre-t) var(--bre-ease), border-color var(--bre-t) var(--bre-ease), box-shadow var(--bre-t) var(--bre-ease);
|
|
549
|
+
}
|
|
550
|
+
.bre-cap-box:hover { background: var(--bre-sunken-2); }
|
|
551
|
+
.bre-cap-box:focus-within {
|
|
552
|
+
background: var(--bre-surface);
|
|
553
|
+
border-color: var(--bre-accent);
|
|
554
|
+
box-shadow: 0 0 0 3px var(--bre-accent-glow);
|
|
555
|
+
}
|
|
556
|
+
.bre-cap-input {
|
|
557
|
+
flex: 1 1 auto;
|
|
558
|
+
min-width: 0;
|
|
559
|
+
border: none;
|
|
560
|
+
background: none;
|
|
561
|
+
outline: none;
|
|
562
|
+
padding: 0;
|
|
563
|
+
font: inherit;
|
|
564
|
+
font-size: 12.5px;
|
|
565
|
+
font-variant-numeric: tabular-nums;
|
|
566
|
+
color: var(--bre-ink);
|
|
567
|
+
}
|
|
568
|
+
.bre-cap-input::placeholder { color: var(--bre-ink-4); }
|
|
569
|
+
.bre-cap-input:disabled { color: var(--bre-ink-4); cursor: default; }
|
|
570
|
+
.bre-cap-unit {
|
|
571
|
+
flex: none;
|
|
572
|
+
font-size: 10.5px;
|
|
573
|
+
color: var(--bre-ink-hint);
|
|
574
|
+
}
|
|
575
|
+
.bre-effort-note.bre-warn {
|
|
576
|
+
display: flex;
|
|
577
|
+
align-items: center;
|
|
578
|
+
gap: 5px;
|
|
579
|
+
color: var(--bre-warn);
|
|
219
580
|
}
|
|
220
|
-
.bre-
|
|
221
|
-
.bre-reference-values { display: inline-flex; gap: 14px; }
|
|
581
|
+
.bre-effort-note.bre-warn svg { flex: none; }
|
|
222
582
|
/* ---- Composer model menu (mounted inside the OFFICIAL menu) ----
|
|
223
583
|
The body and host sizing follow HanaAyane's dsh-reasoning-effort (MIT).
|
|
224
584
|
The model and reasoning-level rows below use the current row/list UI. */
|
|
@@ -261,148 +621,269 @@ window.__ModuleLoader__.load({
|
|
|
261
621
|
white-space: nowrap;
|
|
262
622
|
}
|
|
263
623
|
|
|
264
|
-
/* ---- Model
|
|
265
|
-
|
|
266
|
-
(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
--dsw-specific-menu, under backdrop-filter: var(--dsw-menu-backdrop-filter),
|
|
275
|
-
rounded by --dsw-radius-lg and outlined by --dsw-elevation-prominent).
|
|
276
|
-
A second opaque card in here shows that official surface as a grey frame
|
|
277
|
-
around it \u2014 two stacked surfaces where every other menu in the app has one. */
|
|
624
|
+
/* ---- Model switcher body ----
|
|
625
|
+
One quiet head names the current model; the provider and model columns are
|
|
626
|
+
ALWAYS visible (no drill-in row); a resident search box sits above them; the
|
|
627
|
+
reasoning level is switched in place on a single-accent track. No panel ever
|
|
628
|
+
opens or closes, so the body's height is settled at mount and the commit paths
|
|
629
|
+
carry no re-measure dance.
|
|
630
|
+
|
|
631
|
+
The redesign's two rules on this surface: no boxed-in-box (the only strokes
|
|
632
|
+
are the search's focus ring and one hairline between the columns), and one
|
|
633
|
+
accent, spent only on "this is the selection". */
|
|
278
634
|
.bre-card {
|
|
279
635
|
display: flex;
|
|
280
636
|
flex-direction: column;
|
|
637
|
+
gap: 6px;
|
|
281
638
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
639
|
+
/* The head: a small caps-free label on the left, the current model pushed right
|
|
640
|
+
with its provider muted behind it. The level used to be repeated here as a
|
|
641
|
+
pill; it now lives once, in the footer, where it is also editable. */
|
|
642
|
+
.bre-menu-head {
|
|
285
643
|
display: flex;
|
|
286
644
|
align-items: center;
|
|
287
645
|
gap: 8px;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
padding: 0 10px;
|
|
291
|
-
border: 0;
|
|
292
|
-
/* Matches the official menu cells (.u91W7W_cell / .u91W7W_option use
|
|
293
|
-
--dsw-radius-md, 8px here) and the .bre-option rows below, now that the
|
|
294
|
-
surface behind the rows is the menu's own and hover is no longer clipped
|
|
295
|
-
by a card. */
|
|
296
|
-
border-radius: 8px;
|
|
297
|
-
background: transparent;
|
|
298
|
-
color: inherit;
|
|
299
|
-
font: inherit;
|
|
300
|
-
text-align: left;
|
|
301
|
-
cursor: pointer;
|
|
302
|
-
transition: background 120ms ease;
|
|
646
|
+
height: 30px;
|
|
647
|
+
padding: 0 2px;
|
|
303
648
|
}
|
|
304
|
-
.bre-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
.bre-row-control:disabled { cursor: default; opacity: .6; }
|
|
309
|
-
.bre-row-control:focus-visible {
|
|
310
|
-
outline: none;
|
|
311
|
-
box-shadow: inset 0 0 0 2px var(--dsw-alias-border-l3);
|
|
312
|
-
}
|
|
313
|
-
.bre-row-label {
|
|
314
|
-
flex: none;
|
|
315
|
-
font-size: 13px;
|
|
316
|
-
line-height: 20px;
|
|
317
|
-
color: var(--dsw-alias-label-secondary);
|
|
318
|
-
}
|
|
319
|
-
.bre-row-value {
|
|
320
|
-
flex: 1 1 auto;
|
|
649
|
+
.bre-menu-cur {
|
|
650
|
+
display: inline-flex;
|
|
651
|
+
align-items: baseline;
|
|
652
|
+
gap: 6px;
|
|
321
653
|
min-width: 0;
|
|
654
|
+
margin-left: auto;
|
|
655
|
+
}
|
|
656
|
+
.bre-menu-name {
|
|
322
657
|
overflow: hidden;
|
|
323
658
|
text-overflow: ellipsis;
|
|
324
659
|
white-space: nowrap;
|
|
325
|
-
|
|
660
|
+
max-width: 150px;
|
|
326
661
|
font-size: 13px;
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
color: var(--
|
|
330
|
-
}
|
|
331
|
-
.bre-row-value.is-muted { font-weight: 400; color: var(--dsw-alias-label-tertiary); }
|
|
332
|
-
.bre-divider { height: 1px; margin: 0 10px; background: var(--dsw-alias-border-l4); }
|
|
333
|
-
.bre-panel {
|
|
334
|
-
display: flex;
|
|
335
|
-
flex-direction: column;
|
|
336
|
-
gap: 2px;
|
|
337
|
-
max-height: 220px;
|
|
338
|
-
overflow-y: auto;
|
|
339
|
-
padding: 2px 6px 8px;
|
|
340
|
-
}
|
|
341
|
-
/* Provider column + model column of the model list, side by side. The height is
|
|
342
|
-
FIXED: switching provider must not resize the card, or every click would need
|
|
343
|
-
another same-frame re-place and any missed one shows as a jump. */
|
|
344
|
-
.bre-panel-models {
|
|
345
|
-
flex-direction: row;
|
|
346
|
-
align-items: stretch;
|
|
347
|
-
gap: 0;
|
|
348
|
-
height: 240px;
|
|
349
|
-
max-height: none;
|
|
350
|
-
overflow: hidden;
|
|
351
|
-
padding: 4px 6px 8px;
|
|
662
|
+
font-weight: 600;
|
|
663
|
+
letter-spacing: -.005em;
|
|
664
|
+
color: var(--bre-ink);
|
|
352
665
|
}
|
|
353
|
-
.bre-
|
|
666
|
+
.bre-menu-prov {
|
|
354
667
|
flex: none;
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
width: 112px;
|
|
359
|
-
overflow-y: auto;
|
|
360
|
-
padding-right: 2px;
|
|
668
|
+
font-size: 10.5px;
|
|
669
|
+
color: var(--bre-ink-hint);
|
|
670
|
+
white-space: nowrap;
|
|
361
671
|
}
|
|
362
|
-
.
|
|
363
|
-
|
|
364
|
-
|
|
672
|
+
/* The resident search. Deliberately its OWN class family (not the official
|
|
673
|
+
pane's .bre-search-input-*): the replica and the official search box share a
|
|
674
|
+
menu, and every probe that looks for the official box must not find the
|
|
675
|
+
replica's. The box is a sunken well, not an outlined field: the field's stroke
|
|
676
|
+
would be the second rectangle on a surface that already has the card's edge. */
|
|
677
|
+
.bre-menu-search { padding: 0; }
|
|
678
|
+
.bre-menu-search-box {
|
|
365
679
|
display: flex;
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
padding
|
|
371
|
-
border-left: 1px solid var(--dsw-alias-border-l4);
|
|
372
|
-
}
|
|
373
|
-
.bre-option,
|
|
374
|
-
.bre-provider {
|
|
375
|
-
appearance: none;
|
|
680
|
+
align-items: center;
|
|
681
|
+
position: relative;
|
|
682
|
+
width: 100%;
|
|
683
|
+
height: 30px;
|
|
684
|
+
padding: 0 4px 0 8px;
|
|
376
685
|
box-sizing: border-box;
|
|
686
|
+
border-radius: var(--bre-r-sm);
|
|
687
|
+
background: var(--bre-sunken);
|
|
688
|
+
border: 1px solid transparent;
|
|
689
|
+
color: var(--bre-ink-4);
|
|
690
|
+
transition: background var(--bre-t) var(--bre-ease), border-color var(--bre-t) var(--bre-ease),
|
|
691
|
+
box-shadow var(--bre-t) var(--bre-ease);
|
|
692
|
+
}
|
|
693
|
+
.bre-menu-search-box:focus-within {
|
|
694
|
+
background: var(--bre-surface);
|
|
695
|
+
border-color: var(--bre-accent);
|
|
696
|
+
box-shadow: 0 0 0 3px var(--bre-accent-glow);
|
|
697
|
+
}
|
|
698
|
+
.bre-menu-search-icon {
|
|
377
699
|
display: flex;
|
|
378
700
|
align-items: center;
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
701
|
+
justify-content: center;
|
|
702
|
+
flex: 0 0 16px;
|
|
703
|
+
width: 16px;
|
|
704
|
+
height: 16px;
|
|
705
|
+
margin-right: 6px;
|
|
706
|
+
color: inherit;
|
|
707
|
+
pointer-events: none;
|
|
708
|
+
}
|
|
709
|
+
.bre-menu-search-icon svg { width: 13px; height: 13px; }
|
|
710
|
+
.bre-menu-search-input {
|
|
711
|
+
flex: 1 1 auto;
|
|
712
|
+
min-width: 0;
|
|
713
|
+
height: 100%;
|
|
714
|
+
padding: 0;
|
|
715
|
+
border: none;
|
|
716
|
+
outline: none;
|
|
717
|
+
background: transparent;
|
|
718
|
+
color: var(--bre-ink);
|
|
719
|
+
font: inherit;
|
|
720
|
+
font-size: 12.5px;
|
|
721
|
+
line-height: 18px;
|
|
722
|
+
}
|
|
723
|
+
.bre-menu-search-input::placeholder {
|
|
724
|
+
color: var(--bre-ink-4);
|
|
725
|
+
opacity: 1;
|
|
726
|
+
}
|
|
727
|
+
.bre-menu-search-clear {
|
|
728
|
+
display: flex;
|
|
729
|
+
align-items: center;
|
|
730
|
+
justify-content: center;
|
|
731
|
+
flex: 0 0 20px;
|
|
732
|
+
width: 20px;
|
|
733
|
+
height: 20px;
|
|
734
|
+
margin-left: 4px;
|
|
735
|
+
padding: 0;
|
|
736
|
+
border: none;
|
|
737
|
+
border-radius: 5px;
|
|
738
|
+
background: var(--bre-sunken-2);
|
|
739
|
+
color: var(--bre-ink-3);
|
|
740
|
+
cursor: pointer;
|
|
741
|
+
transition: background var(--bre-t) var(--bre-ease), color var(--bre-t) var(--bre-ease);
|
|
742
|
+
}
|
|
743
|
+
.bre-menu-search-clear:hover {
|
|
744
|
+
background: var(--bre-active);
|
|
745
|
+
color: var(--bre-ink);
|
|
746
|
+
}
|
|
747
|
+
.bre-menu-search-clear svg { width: 12px; height: 12px; }
|
|
748
|
+
/* The provider cell's model count, where the drill chevron used to sit: the
|
|
749
|
+
columns are always open, so the number is the only fact a chevron added. */
|
|
750
|
+
.bre-provider-count {
|
|
751
|
+
flex: none;
|
|
752
|
+
margin-left: auto;
|
|
753
|
+
font-size: 10px;
|
|
754
|
+
font-variant-numeric: tabular-nums;
|
|
755
|
+
color: var(--bre-ink-hint);
|
|
756
|
+
}
|
|
757
|
+
/* While the search holds a query the model column lists matches across every
|
|
758
|
+
provider; the muted prefix says which one each row belongs to. */
|
|
759
|
+
.bre-option-origin { color: var(--bre-ink-hint); }
|
|
760
|
+
/* The footer: the reasoning level switched IN PLACE \u2014 its name on the left and
|
|
761
|
+
the level under the thumb on the right, above a 6px track whose stops are
|
|
762
|
+
tick marks and whose names are written under it. The track spans the full
|
|
763
|
+
width, so each name sits under its own stop whatever the ladder's size. */
|
|
764
|
+
.bre-menu-foot {
|
|
765
|
+
display: flex;
|
|
766
|
+
flex-direction: column;
|
|
767
|
+
padding-top: 8px;
|
|
768
|
+
border-top: 1px solid var(--bre-line-1);
|
|
769
|
+
}
|
|
770
|
+
.bre-menu-slider {
|
|
771
|
+
display: flex;
|
|
772
|
+
flex-direction: column;
|
|
773
|
+
min-width: 0;
|
|
774
|
+
}
|
|
775
|
+
.bre-menu-slider:focus-within { outline: none; }
|
|
776
|
+
/* Layout only \u2014 it deliberately paints NO background, border, radius or
|
|
777
|
+
overflow clip. The replica is mounted inside the OFFICIAL menu, and that
|
|
778
|
+
shell already draws its own surface (MenuSurface: a [data-menu-material]
|
|
779
|
+
panel whose .material child paints --dsw-menu-surface-fill, i.e.
|
|
780
|
+
--dsw-specific-menu, under backdrop-filter: var(--dsw-menu-backdrop-filter),
|
|
781
|
+
rounded by --dsw-radius-lg and outlined by --dsw-elevation-prominent).
|
|
782
|
+
A second opaque card in here shows that official surface as a grey frame
|
|
783
|
+
around it \u2014 two stacked surfaces where every other menu in the app has one. */
|
|
784
|
+
.bre-row-label {
|
|
785
|
+
flex: none;
|
|
786
|
+
font-size: 11.5px;
|
|
787
|
+
line-height: 18px;
|
|
788
|
+
font-weight: 500;
|
|
789
|
+
letter-spacing: .02em;
|
|
790
|
+
color: var(--bre-ink-hint);
|
|
791
|
+
}
|
|
792
|
+
.bre-row-value {
|
|
793
|
+
flex: 1 1 auto;
|
|
794
|
+
min-width: 0;
|
|
795
|
+
overflow: hidden;
|
|
796
|
+
text-overflow: ellipsis;
|
|
797
|
+
white-space: nowrap;
|
|
798
|
+
text-align: right;
|
|
799
|
+
font-size: 12.5px;
|
|
800
|
+
line-height: 18px;
|
|
801
|
+
font-weight: 600;
|
|
802
|
+
letter-spacing: -.005em;
|
|
803
|
+
color: var(--bre-accent-ink);
|
|
804
|
+
}
|
|
805
|
+
.bre-row-value.is-muted { font-weight: 400; color: var(--bre-ink-hint); }
|
|
806
|
+
.bre-panel {
|
|
807
|
+
display: flex;
|
|
808
|
+
flex-direction: column;
|
|
809
|
+
gap: 1px;
|
|
810
|
+
max-height: 220px;
|
|
811
|
+
overflow-y: auto;
|
|
812
|
+
padding: 2px 6px 8px;
|
|
813
|
+
}
|
|
814
|
+
/* Provider column + model column of the model list, side by side. The height is
|
|
815
|
+
FIXED: switching provider must not resize the card, or every click would need
|
|
816
|
+
another same-frame re-place and any missed one shows as a jump. It is also
|
|
817
|
+
BUDGETED: head + search + panel + footer must not exceed the height the
|
|
818
|
+
official popover measured for the old two-row body, or the popover clips the
|
|
819
|
+
footer's last line (\u5207\u6362\u6A21\u578B\u4E0B\u65B9\u88AB\u622A\u65AD). The slider head above the track
|
|
820
|
+
(.bre-effort-slider-head: 18px of text + 6px of margin) is paid for OUT of
|
|
821
|
+
this height, so the card's total is unchanged. */
|
|
822
|
+
.bre-panel-models {
|
|
823
|
+
flex-direction: row;
|
|
824
|
+
align-items: stretch;
|
|
825
|
+
gap: 0;
|
|
826
|
+
height: 196px;
|
|
827
|
+
max-height: none;
|
|
828
|
+
overflow: hidden;
|
|
829
|
+
padding: 0;
|
|
830
|
+
}
|
|
831
|
+
.bre-providers {
|
|
832
|
+
flex: none;
|
|
833
|
+
display: flex;
|
|
834
|
+
flex-direction: column;
|
|
835
|
+
gap: 1px;
|
|
836
|
+
width: 104px;
|
|
837
|
+
overflow-y: auto;
|
|
838
|
+
padding-right: 4px;
|
|
839
|
+
}
|
|
840
|
+
.bre-provider-models {
|
|
841
|
+
flex: 1 1 auto;
|
|
842
|
+
min-width: 0;
|
|
843
|
+
display: flex;
|
|
844
|
+
flex-direction: column;
|
|
845
|
+
gap: 1px;
|
|
846
|
+
overflow-y: auto;
|
|
847
|
+
margin-left: 6px;
|
|
848
|
+
padding-left: 6px;
|
|
849
|
+
border-left: 1px solid var(--bre-line-1);
|
|
850
|
+
}
|
|
851
|
+
.bre-option,
|
|
852
|
+
.bre-provider {
|
|
853
|
+
appearance: none;
|
|
854
|
+
box-sizing: border-box;
|
|
855
|
+
position: relative;
|
|
856
|
+
display: flex;
|
|
857
|
+
align-items: center;
|
|
858
|
+
gap: 6px;
|
|
859
|
+
width: 100%;
|
|
860
|
+
min-height: 30px;
|
|
861
|
+
flex: none;
|
|
862
|
+
padding: 0 6px 0 8px;
|
|
383
863
|
border: 0;
|
|
384
|
-
border-radius:
|
|
864
|
+
border-radius: 7px;
|
|
385
865
|
background: transparent;
|
|
386
|
-
color:
|
|
866
|
+
color: var(--bre-ink);
|
|
387
867
|
font: inherit;
|
|
388
|
-
font-size:
|
|
389
|
-
line-height:
|
|
868
|
+
font-size: 12.5px;
|
|
869
|
+
line-height: 18px;
|
|
390
870
|
text-align: left;
|
|
391
871
|
cursor: pointer;
|
|
392
|
-
transition: background
|
|
872
|
+
transition: background var(--bre-t) var(--bre-ease), color var(--bre-t) var(--bre-ease);
|
|
393
873
|
}
|
|
394
|
-
/* The provider cell
|
|
395
|
-
|
|
874
|
+
/* The provider cell reads one step quieter than its models: it is the index, the
|
|
875
|
+
models are the content. */
|
|
876
|
+
.bre-provider { gap: 4px; color: var(--bre-ink-2); }
|
|
396
877
|
.bre-option:hover:not(:disabled),
|
|
397
878
|
.bre-provider:hover:not(:disabled) {
|
|
398
|
-
background: var(--
|
|
879
|
+
background: var(--bre-hover);
|
|
399
880
|
}
|
|
400
881
|
.bre-option:disabled,
|
|
401
|
-
.bre-provider:disabled { cursor: default; opacity: .
|
|
882
|
+
.bre-provider:disabled { cursor: default; opacity: .55; }
|
|
402
883
|
.bre-option:focus-visible,
|
|
403
884
|
.bre-provider:focus-visible {
|
|
404
|
-
outline:
|
|
405
|
-
|
|
885
|
+
outline: 2px solid var(--bre-accent);
|
|
886
|
+
outline-offset: -2px;
|
|
406
887
|
}
|
|
407
888
|
.bre-option-name {
|
|
408
889
|
flex: 1 1 auto;
|
|
@@ -411,33 +892,48 @@ window.__ModuleLoader__.load({
|
|
|
411
892
|
text-overflow: ellipsis;
|
|
412
893
|
white-space: nowrap;
|
|
413
894
|
}
|
|
895
|
+
/* The selection: one accent tint, accent ink, and a 2px bar on the column's own
|
|
896
|
+
edge \u2014 the bar is what keeps "open provider" readable once the row is tinted
|
|
897
|
+
(a tint alone at 10% is a whisper in a 104px column). */
|
|
414
898
|
.bre-option.is-active {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
899
|
+
background: var(--bre-accent-weak);
|
|
900
|
+
color: var(--bre-accent-ink);
|
|
901
|
+
font-weight: 600;
|
|
418
902
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
903
|
+
.bre-provider.is-open {
|
|
904
|
+
background: var(--bre-accent-weak);
|
|
905
|
+
color: var(--bre-accent-ink);
|
|
906
|
+
}
|
|
907
|
+
.bre-provider.is-open::before {
|
|
908
|
+
content: "";
|
|
909
|
+
position: absolute;
|
|
910
|
+
left: -4px;
|
|
911
|
+
top: 7px;
|
|
912
|
+
bottom: 7px;
|
|
913
|
+
width: 2px;
|
|
914
|
+
border-radius: 2px;
|
|
915
|
+
background: var(--bre-accent);
|
|
425
916
|
}
|
|
426
|
-
.bre-provider .bre-
|
|
917
|
+
.bre-provider.is-open .bre-provider-count { color: var(--bre-accent); opacity: .7; }
|
|
918
|
+
/* The provider of the CURRENT model keeps its name at full weight, so the column
|
|
919
|
+
says where the selection lives even when another provider is open. */
|
|
920
|
+
.bre-provider.is-current .bre-option-name { font-weight: 600; color: var(--bre-ink); }
|
|
921
|
+
.bre-provider.is-open.is-current .bre-option-name { color: var(--bre-accent-ink); }
|
|
427
922
|
/* Capability badges on a model row (image input / thinking). Muted so the name
|
|
428
923
|
stays the brightest thing in the row; the badge's own title carries the copy. */
|
|
429
924
|
.bre-option-tags {
|
|
430
925
|
flex: none;
|
|
431
926
|
display: inline-flex;
|
|
432
927
|
align-items: center;
|
|
433
|
-
gap:
|
|
434
|
-
color: var(--
|
|
928
|
+
gap: 5px;
|
|
929
|
+
color: var(--bre-ink-3);
|
|
930
|
+
opacity: .78;
|
|
435
931
|
}
|
|
436
|
-
.bre-option.is-active .bre-option-tags { color: var(--
|
|
932
|
+
.bre-option.is-active .bre-option-tags { color: var(--bre-accent); opacity: .9; }
|
|
437
933
|
.bre-tag { display: inline-flex; align-items: center; }
|
|
438
934
|
.bre-tag-icon { display: block; width: 13px; height: 13px; }
|
|
439
|
-
.bre-
|
|
440
|
-
|
|
935
|
+
.bre-empty { padding: 8px; font-size: 12px; color: var(--bre-ink-hint); }
|
|
936
|
+
|
|
441
937
|
/* ---- Truncated-label tooltip (custom, replaces the native title) ----
|
|
442
938
|
A self-drawn bubble instead of the OS tooltip, which the page cannot style
|
|
443
939
|
and which reads harsh next to the menu. Fixed-positioned on <body> so the
|
|
@@ -491,20 +987,6 @@ body:not([data-ds-dark-theme]) .bre-tip {
|
|
|
491
987
|
background: var(--dsw-alias-state-error-tertiary, rgba(220,55,70,.08));
|
|
492
988
|
font-size: 11px;
|
|
493
989
|
}
|
|
494
|
-
.bre-row-chevron {
|
|
495
|
-
flex: none;
|
|
496
|
-
display: inline-flex;
|
|
497
|
-
align-items: center;
|
|
498
|
-
justify-content: center;
|
|
499
|
-
width: 16px;
|
|
500
|
-
height: 16px;
|
|
501
|
-
font-size: 18px;
|
|
502
|
-
line-height: 1;
|
|
503
|
-
color: var(--dsw-alias-label-tertiary);
|
|
504
|
-
transform: rotate(0deg);
|
|
505
|
-
transition: transform 120ms ease;
|
|
506
|
-
}
|
|
507
|
-
.bre-row-chevron.is-open { transform: rotate(90deg); }
|
|
508
990
|
/* ---- Models-page slider toggle (boxed setting item) ----
|
|
509
991
|
Item form ported VERBATIM from upstream .re-setting-row; the surrounding
|
|
510
992
|
box is the requested container (border only, transparent background). */
|
|
@@ -557,7 +1039,7 @@ body:not([data-ds-dark-theme]) .bre-tip {
|
|
|
557
1039
|
outline: 2px solid var(--dsw-static-blue-400, #5d83ff);
|
|
558
1040
|
outline-offset: 2px;
|
|
559
1041
|
}
|
|
560
|
-
.bre-slider-setting-switch.is-on { background: var(--dsw-alias-
|
|
1042
|
+
.bre-slider-setting-switch.is-on { background: var(--dsw-alias-brand-primary, #4d6bfe); }
|
|
561
1043
|
.bre-slider-setting-switch-knob {
|
|
562
1044
|
position: absolute;
|
|
563
1045
|
top: 2px;
|
|
@@ -932,7 +1414,8 @@ body:not([data-ds-dark-theme]) .bre-tip {
|
|
|
932
1414
|
box-sizing: border-box;
|
|
933
1415
|
}
|
|
934
1416
|
.bre-headers-edit input.bre-text-input:focus {
|
|
935
|
-
border-color: var(--dsw-alias-
|
|
1417
|
+
border-color: var(--dsw-alias-brand-primary, #4d6bfe);
|
|
1418
|
+
box-shadow: 0 0 0 3px var(--dsw-alias-brand-primary-muted, rgba(77, 112, 255, .14));
|
|
936
1419
|
outline: none;
|
|
937
1420
|
}
|
|
938
1421
|
.bre-headers-edit input.bre-text-input:disabled { opacity: 0.6; cursor: default; }
|
|
@@ -1265,12 +1748,17 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
|
|
|
1265
1748
|
marks the card: a card the pass could not take over (the DeepSeek account
|
|
1266
1749
|
editor) keeps that mount visible for its request-header section, and must not
|
|
1267
1750
|
grow a bar that switches nothing. */
|
|
1751
|
+
/* The tab bar. The old segmented track (grey rail + lifted white pill) is
|
|
1752
|
+
retired for the underline form the redesign settles on: a quiet text row over
|
|
1753
|
+
one hairline, the active tab named by a brand bar under its own text \u2014 one
|
|
1754
|
+
emphasis, no second surface to stack on the card's. */
|
|
1268
1755
|
.bre-editor-tabs {
|
|
1269
1756
|
display: none;
|
|
1270
|
-
gap:
|
|
1271
|
-
padding:
|
|
1272
|
-
border-radius:
|
|
1273
|
-
background:
|
|
1757
|
+
gap: 20px;
|
|
1758
|
+
padding: 0;
|
|
1759
|
+
border-radius: 0;
|
|
1760
|
+
background: transparent;
|
|
1761
|
+
border-bottom: 1px solid var(--dsw-alias-border-l2, #0000001a);
|
|
1274
1762
|
}
|
|
1275
1763
|
|
|
1276
1764
|
/* Only a taken-over card shows the bar. */
|
|
@@ -1309,35 +1797,54 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
|
|
|
1309
1797
|
}
|
|
1310
1798
|
|
|
1311
1799
|
.bre-editor-tab {
|
|
1312
|
-
flex:
|
|
1800
|
+
flex: 0 1 auto;
|
|
1313
1801
|
min-width: 0;
|
|
1314
|
-
height:
|
|
1315
|
-
padding: 0
|
|
1802
|
+
height: 32px;
|
|
1803
|
+
padding: 0 2px;
|
|
1316
1804
|
border: none;
|
|
1317
|
-
border-radius:
|
|
1805
|
+
border-radius: 0;
|
|
1318
1806
|
background: transparent;
|
|
1319
1807
|
color: var(--dsw-alias-label-secondary, #61666b);
|
|
1320
1808
|
font: inherit;
|
|
1321
|
-
font-size:
|
|
1322
|
-
font-weight:
|
|
1809
|
+
font-size: 13px;
|
|
1810
|
+
font-weight: 400;
|
|
1323
1811
|
line-height: 1;
|
|
1324
1812
|
white-space: nowrap;
|
|
1325
1813
|
overflow: hidden;
|
|
1326
1814
|
text-overflow: ellipsis;
|
|
1327
1815
|
cursor: pointer;
|
|
1328
|
-
|
|
1816
|
+
position: relative;
|
|
1817
|
+
transition: color 140ms ease;
|
|
1329
1818
|
}
|
|
1330
1819
|
|
|
1331
1820
|
.bre-editor-tab:hover { color: var(--dsw-alias-label-primary, #0f1115); }
|
|
1332
1821
|
|
|
1333
|
-
/* The selected
|
|
1334
|
-
|
|
1335
|
-
|
|
1822
|
+
/* The selected tab is named by the bar under its own text, not by a filled
|
|
1823
|
+
pill: the indicator occupies the bar's own hairline, so no second surface
|
|
1824
|
+
and no extra height. Hover on a selected tab stays put \u2014 it is already
|
|
1825
|
+
where you are. */
|
|
1826
|
+
.bre-editor-tab::after {
|
|
1827
|
+
content: '';
|
|
1828
|
+
position: absolute;
|
|
1829
|
+
left: 0;
|
|
1830
|
+
right: 0;
|
|
1831
|
+
bottom: -1px;
|
|
1832
|
+
height: 2px;
|
|
1833
|
+
border-radius: 2px;
|
|
1834
|
+
background: transparent;
|
|
1835
|
+
transition: background 140ms ease;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1336
1838
|
.bre-editor-tab[aria-selected='true'],
|
|
1337
1839
|
.bre-editor-tab[aria-selected='true']:hover {
|
|
1338
|
-
background:
|
|
1840
|
+
background: transparent;
|
|
1339
1841
|
color: var(--dsw-alias-label-primary, #0f1115);
|
|
1340
|
-
|
|
1842
|
+
font-weight: 500;
|
|
1843
|
+
box-shadow: none;
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
.bre-editor-tab[aria-selected='true']::after {
|
|
1847
|
+
background: var(--dsw-alias-brand-primary, #4d6bfe);
|
|
1341
1848
|
}
|
|
1342
1849
|
|
|
1343
1850
|
.bre-editor-tab:focus-visible {
|
|
@@ -1359,6 +1866,44 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
|
|
|
1359
1866
|
display: none !important;
|
|
1360
1867
|
}
|
|
1361
1868
|
|
|
1869
|
+
/* The provider pane's form reads as the redesign's two-column grid: the label
|
|
1870
|
+
takes a fixed leading column, the control fills the rest. Promoting the
|
|
1871
|
+
host label's children with display:contents keeps the label-input
|
|
1872
|
+
association (the label element stays the control's parent in the DOM) while
|
|
1873
|
+
letting the span and the control land in their own columns. Scoped to the
|
|
1874
|
+
taken-over provider pane and the host's measured field shape, so a kernel
|
|
1875
|
+
that changed its markup simply keeps its own stacked layout. The endpoint
|
|
1876
|
+
field opts out: its family chip + title row is its own shape (the design's
|
|
1877
|
+
endpoint row), and its title carries the \u66F4\u591A\u7AEF\u70B9 toggle besides. */
|
|
1878
|
+
.bre-tabbed[data-bre-tab='provider'] [data-bre-editor-body] .field:not([data-bre-endpoint-field]) {
|
|
1879
|
+
display: grid;
|
|
1880
|
+
grid-template-columns: 96px minmax(0, 1fr);
|
|
1881
|
+
align-items: center;
|
|
1882
|
+
column-gap: 8px;
|
|
1883
|
+
}
|
|
1884
|
+
.bre-tabbed[data-bre-tab='provider'] [data-bre-editor-body] .field:not([data-bre-endpoint-field]) > label {
|
|
1885
|
+
display: contents;
|
|
1886
|
+
}
|
|
1887
|
+
/* The input sits BESIDE its label \u2014 the same two-column shape on every card,
|
|
1888
|
+
create or edit (\u65B0\u589E\u4F9B\u5E94\u5546\u7684 api \u5BC6\u94A5\u5B57\u6BB5\u4E0E\u4FEE\u6539\u5361\u4E0D\u4E00\u81F4). A field with no
|
|
1889
|
+
label of its own (the provider id on the create card) spans the form instead
|
|
1890
|
+
of squeezing into the label column. The endpoint field's input keeps its own
|
|
1891
|
+
grid's second column \u2014 the same specificity race, won back explicitly. */
|
|
1892
|
+
.bre-tabbed[data-bre-tab='provider'] [data-bre-editor-body] .field > input { grid-column: 2; }
|
|
1893
|
+
.bre-tabbed[data-bre-tab='provider'] [data-bre-editor-body] .field:not(:has(> label)) > input { grid-column: 1 / -1; }
|
|
1894
|
+
.bre-tabbed[data-bre-tab='provider'] [data-bre-editor-body] [data-bre-endpoint-field] > input { grid-column: 2; }
|
|
1895
|
+
/* The extra address rows need no indent of their own: their chip is the same
|
|
1896
|
+
fixed 96px prefix the field's chip takes, so the row's input already sits in
|
|
1897
|
+
the field input's column (see .bre-endpoint-family above). */
|
|
1898
|
+
/* The card's commit row reads as the footer the design gives every card: one
|
|
1899
|
+
hairline above, the pair right-aligned beneath it, on every tab that shows
|
|
1900
|
+
the card's own fields. */
|
|
1901
|
+
.bre-tabbed [data-bre-editor-body] [class*='editorActions'] {
|
|
1902
|
+
margin-top: 6px;
|
|
1903
|
+
padding-top: 12px;
|
|
1904
|
+
border-top: 1px solid var(--dsw-alias-border-l2, #0000001a);
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1362
1907
|
/* The advanced tab: the official body \u2014 fields, model list \u2014 steps aside for the
|
|
1363
1908
|
request-header section, which is a complete form with its own save/cancel and
|
|
1364
1909
|
becomes the pane under the very same bar. What does NOT step aside is the
|
|
@@ -1670,7 +2215,7 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
|
|
|
1670
2215
|
margin: 0;
|
|
1671
2216
|
padding: 0;
|
|
1672
2217
|
border: 0.5px solid var(--dsw-alias-border-l2, #d5d7dd);
|
|
1673
|
-
border-radius:
|
|
2218
|
+
border-radius: var(--dsw-radius-md, 12px);
|
|
1674
2219
|
list-style: none;
|
|
1675
2220
|
overflow: hidden;
|
|
1676
2221
|
}
|
|
@@ -1683,67 +2228,86 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
|
|
|
1683
2228
|
gap: 8px;
|
|
1684
2229
|
min-width: 0;
|
|
1685
2230
|
padding: 9px 10px;
|
|
2231
|
+
/* The hovered row lifts a shade, the way the redesign's list rows do \u2014 the
|
|
2232
|
+
container clips the corners, so the fill stays inside the ruled box. */
|
|
2233
|
+
transition: background 120ms ease;
|
|
1686
2234
|
}
|
|
1687
2235
|
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
.
|
|
1693
|
-
|
|
2236
|
+
.bre-keys-row:hover { background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .07)); }
|
|
2237
|
+
|
|
2238
|
+
/* The switch at the head of every key row: a ring with a check inside it. While
|
|
2239
|
+
the key is switched into use the WHOLE icon is the brand blue \u2014 ring and glyph
|
|
2240
|
+
together; while it is benched it is a bare grey ring with nothing drawn in it.
|
|
2241
|
+
Off is a pause, not a deletion \u2014 the label, scope and protocol stay. With
|
|
2242
|
+
several keys coexisting there is no "default" badge: which key signs a model
|
|
2243
|
+
is the scope's decision. The one state that cannot be clicked is the last
|
|
2244
|
+
enabled key: the host would refuse the switch-off, so the control stands down
|
|
2245
|
+
instead (the disabled shell keeps the lit look \u2014 the key IS selected). */
|
|
2246
|
+
.bre-keys-toggle {
|
|
1694
2247
|
flex: 0 0 auto;
|
|
2248
|
+
display: inline-flex;
|
|
1695
2249
|
align-items: center;
|
|
1696
|
-
|
|
2250
|
+
justify-content: center;
|
|
2251
|
+
width: 20px;
|
|
2252
|
+
height: 20px;
|
|
2253
|
+
padding: 0;
|
|
2254
|
+
border: 0;
|
|
2255
|
+
border-radius: 999px;
|
|
2256
|
+
background: transparent;
|
|
1697
2257
|
cursor: pointer;
|
|
2258
|
+
-webkit-appearance: none;
|
|
2259
|
+
appearance: none;
|
|
2260
|
+
transition: opacity 140ms ease;
|
|
1698
2261
|
}
|
|
1699
2262
|
|
|
1700
|
-
.bre-keys-
|
|
1701
|
-
|
|
1702
|
-
line-height: 1.5;
|
|
1703
|
-
color: var(--dsw-alias-label-secondary, #6b7280);
|
|
1704
|
-
}
|
|
2263
|
+
.bre-keys-toggle:hover:not(:disabled),
|
|
2264
|
+
.bre-keys-toggle:focus-visible { opacity: 0.8; }
|
|
1705
2265
|
|
|
1706
|
-
.bre-keys-
|
|
1707
|
-
|
|
2266
|
+
.bre-keys-toggle:focus-visible {
|
|
2267
|
+
outline: none;
|
|
2268
|
+
box-shadow: inset 0 0 0 2px var(--dsw-alias-border-l3);
|
|
2269
|
+
border-radius: 999px;
|
|
1708
2270
|
}
|
|
1709
2271
|
|
|
1710
|
-
.bre-keys-
|
|
1711
|
-
position: absolute;
|
|
1712
|
-
width: 1px;
|
|
1713
|
-
height: 1px;
|
|
1714
|
-
margin: -1px;
|
|
1715
|
-
padding: 0;
|
|
1716
|
-
border: 0;
|
|
1717
|
-
overflow: hidden;
|
|
1718
|
-
white-space: nowrap;
|
|
1719
|
-
clip-path: inset(50%);
|
|
1720
|
-
}
|
|
2272
|
+
.bre-keys-toggle:disabled { cursor: default; }
|
|
1721
2273
|
|
|
1722
|
-
.bre-keys-mark {
|
|
2274
|
+
.bre-keys-toggle-mark {
|
|
1723
2275
|
display: inline-flex;
|
|
1724
2276
|
align-items: center;
|
|
1725
2277
|
justify-content: center;
|
|
1726
2278
|
width: 16px;
|
|
1727
2279
|
height: 16px;
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
color:
|
|
1732
|
-
transition:
|
|
2280
|
+
border-radius: 999px;
|
|
2281
|
+
background: transparent;
|
|
2282
|
+
box-shadow: inset 0 0 0 1.5px var(--dsw-alias-label-tertiary, #9aa1ab);
|
|
2283
|
+
color: transparent;
|
|
2284
|
+
transition: box-shadow 140ms ease, color 140ms ease;
|
|
1733
2285
|
}
|
|
1734
2286
|
|
|
1735
|
-
.bre-keys-mark
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
background: var(--dsw-alias-label-primary, #0f1115);
|
|
2287
|
+
.bre-keys-toggle-mark svg {
|
|
2288
|
+
width: 10px;
|
|
2289
|
+
height: 10px;
|
|
2290
|
+
display: none;
|
|
1740
2291
|
}
|
|
1741
2292
|
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
2293
|
+
/* The lit check is PINNED to the plugin's own blue rather than the host's brand
|
|
2294
|
+
token: on the settings surface --dsw-alias-brand-primary can resolve dark \u2014
|
|
2295
|
+
and a var() fallback only covers a token that is unset, so a token defined
|
|
2296
|
+
with a broken value leaves the tick inheriting the body's near-black ink. A
|
|
2297
|
+
checked key must read blue wherever the list is painted, so the blue is not
|
|
2298
|
+
negotiable with the surface. */
|
|
2299
|
+
.bre-keys-toggle.is-on .bre-keys-toggle-mark {
|
|
2300
|
+
box-shadow: inset 0 0 0 1.5px #4d6bfe;
|
|
2301
|
+
color: #4d6bfe;
|
|
1745
2302
|
}
|
|
1746
2303
|
|
|
2304
|
+
.bre-keys-toggle.is-on .bre-keys-toggle-mark svg { display: block; }
|
|
2305
|
+
|
|
2306
|
+
/* A switched-off key stays listed but reads as idle: its name and preview dim,
|
|
2307
|
+
while the actions keep their full strength so the row stays workable. */
|
|
2308
|
+
.bre-keys-row.is-off .bre-keys-alias,
|
|
2309
|
+
.bre-keys-row.is-off .bre-keys-mask { opacity: 0.45; }
|
|
2310
|
+
|
|
1747
2311
|
/* With an alias the alias is the row's name and the masked key follows it as a
|
|
1748
2312
|
quiet code pill; without one the masked key is the name and takes the row's
|
|
1749
2313
|
measure, so a key is always readable as itself. */
|
|
@@ -1784,7 +2348,11 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
|
|
|
1784
2348
|
/* The row's three actions, revealed on hover or keyboard focus rather than
|
|
1785
2349
|
removed, so the row keeps its width and nothing shifts under the pointer.
|
|
1786
2350
|
Revealing is opacity alone; a pointer that cannot hover simply always sees
|
|
1787
|
-
them, because a hidden action there would be an unreachable one.
|
|
2351
|
+
them, because a hidden action there would be an unreachable one. The model
|
|
2352
|
+
scope rides on its own button here (its label is the count), so there is no
|
|
2353
|
+
separate summary text beside the key any more. The tray parks at the right
|
|
2354
|
+
edge: no status word is painted on a row any more (\u72B6\u6001\u90FD\u79FB\u9664\u2014\u2014\u4E1C\u897F\u591A\u4E86\uFF0C
|
|
2355
|
+
\u522B\u540D\u88AB\u7701\u7565), so the right edge is the tray's alone. */
|
|
1788
2356
|
.bre-keys-actions {
|
|
1789
2357
|
display: inline-flex;
|
|
1790
2358
|
flex: 0 0 auto;
|
|
@@ -1898,6 +2466,65 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
|
|
|
1898
2466
|
|
|
1899
2467
|
.bre-keys-add:disabled { opacity: 0.55; cursor: default; }
|
|
1900
2468
|
|
|
2469
|
+
/* The scope field spans the row like the secret field does. */
|
|
2470
|
+
.bre-keys-scope { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
|
2471
|
+
|
|
2472
|
+
.bre-keys-hint {
|
|
2473
|
+
margin: 0;
|
|
2474
|
+
font-size: 11px;
|
|
2475
|
+
line-height: 1.5;
|
|
2476
|
+
color: var(--dsw-alias-label-secondary, #6b7280);
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
/* The discover action sits below the ruled list because it acts on every key at
|
|
2480
|
+
once, not on the row it would otherwise live in. */
|
|
2481
|
+
.bre-keys-footer { display: flex; justify-content: flex-end; }
|
|
2482
|
+
|
|
2483
|
+
/* The offer to add the models the keys advertise but the provider does not
|
|
2484
|
+
declare: one sentence and one link, never a silent write. */
|
|
2485
|
+
.bre-keys-note {
|
|
2486
|
+
margin: 6px 0 0;
|
|
2487
|
+
font-size: 11px;
|
|
2488
|
+
line-height: 1.6;
|
|
2489
|
+
color: var(--dsw-alias-label-secondary, #6b7280);
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
.bre-keys-discover {
|
|
2493
|
+
display: inline-flex;
|
|
2494
|
+
align-items: center;
|
|
2495
|
+
gap: 6px;
|
|
2496
|
+
padding: 0;
|
|
2497
|
+
border: 0;
|
|
2498
|
+
background: transparent;
|
|
2499
|
+
color: var(--dsw-alias-label-secondary, #6b7280);
|
|
2500
|
+
font: inherit;
|
|
2501
|
+
font-size: 11px;
|
|
2502
|
+
cursor: pointer;
|
|
2503
|
+
-webkit-appearance: none;
|
|
2504
|
+
appearance: none;
|
|
2505
|
+
transition: color 120ms ease;
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
.bre-keys-discover:hover { color: var(--dsw-alias-label-primary, #0f1115); }
|
|
2509
|
+
|
|
2510
|
+
.bre-keys-discover:focus-visible {
|
|
2511
|
+
outline: none;
|
|
2512
|
+
box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
|
|
2513
|
+
border-radius: 4px;
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
.bre-keys-discover:disabled { opacity: 0.55; cursor: default; }
|
|
2517
|
+
|
|
2518
|
+
.bre-keys-discover-mark {
|
|
2519
|
+
display: inline-flex;
|
|
2520
|
+
align-items: center;
|
|
2521
|
+
justify-content: center;
|
|
2522
|
+
width: 14px;
|
|
2523
|
+
height: 14px;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
.bre-keys-discover-mark > svg { width: 13px; height: 13px; }
|
|
2527
|
+
|
|
1901
2528
|
.bre-keys-add-mark {
|
|
1902
2529
|
display: inline-flex;
|
|
1903
2530
|
flex: 0 0 auto;
|
|
@@ -1909,12 +2536,902 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
|
|
|
1909
2536
|
|
|
1910
2537
|
.bre-keys .bre-effort-message { font-size: 11px; }
|
|
1911
2538
|
|
|
2539
|
+
/* The per-key protocol picker. It lives inside .bre-keys-actions, so it must
|
|
2540
|
+
look like the plain buttons beside it \u2014 same size, same grey, no box of its
|
|
2541
|
+
own \u2014 or the hover tray reads as two different kinds of control. "Default
|
|
2542
|
+
protocol" (the empty value) follows the route's own API protocol.
|
|
2543
|
+
What you read is a LABEL, not a control: a native <select> is as wide as its
|
|
2544
|
+
widest OPTION, so a short value left the chevron floating a hundred pixels to
|
|
2545
|
+
its right (user item 2). The button is exactly as wide as the text and opens
|
|
2546
|
+
this module's own menu, which can explain each protocol (\u53C2\u8003\u56FE\u6837\u5F0F). */
|
|
2547
|
+
.bre-keys-protocol-wrap {
|
|
2548
|
+
position: relative;
|
|
2549
|
+
display: inline-flex;
|
|
2550
|
+
align-items: center;
|
|
2551
|
+
color: var(--dsw-alias-label-secondary, #61666b);
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
.bre-keys-protocol {
|
|
2555
|
+
display: inline-flex;
|
|
2556
|
+
align-items: center;
|
|
2557
|
+
gap: 2px;
|
|
2558
|
+
margin: 0;
|
|
2559
|
+
padding: 2px 6px;
|
|
2560
|
+
border: none;
|
|
2561
|
+
border-radius: 4px;
|
|
2562
|
+
background: none;
|
|
2563
|
+
color: inherit;
|
|
2564
|
+
font: inherit;
|
|
2565
|
+
font-size: 12px;
|
|
2566
|
+
line-height: 1;
|
|
2567
|
+
cursor: pointer;
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
.bre-keys-protocol-label {
|
|
2571
|
+
color: inherit;
|
|
2572
|
+
font: inherit;
|
|
2573
|
+
font-size: 12px;
|
|
2574
|
+
line-height: 1;
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
.bre-keys-protocol-caret {
|
|
2578
|
+
color: inherit;
|
|
2579
|
+
font-size: 12px;
|
|
2580
|
+
line-height: 1;
|
|
2581
|
+
pointer-events: none;
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
/* Hover is a shade, not an underline: the picker reads as a control (every
|
|
2585
|
+
other quiet control in the row lifts on hover), and an underline made it
|
|
2586
|
+
read as a link to somewhere else. */
|
|
2587
|
+
.bre-keys-protocol:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.08)); }
|
|
2588
|
+
|
|
2589
|
+
/* An open menu is a pressed control: while its list is up, the trigger keeps the
|
|
2590
|
+
tray's colour instead of going back to quiet grey. */
|
|
2591
|
+
.bre-keys-protocol[aria-expanded='true'] { color: var(--dsw-alias-label-primary, #0f1115); }
|
|
2592
|
+
|
|
2593
|
+
.bre-keys-protocol:focus-visible {
|
|
2594
|
+
outline: none;
|
|
2595
|
+
box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
.bre-keys-protocol:disabled { opacity: 0.5; cursor: default; }
|
|
2599
|
+
|
|
2600
|
+
/* ---- The protocol menu ----
|
|
2601
|
+
One entry per protocol, its name over the line that says what that wire is
|
|
2602
|
+
for: the names alone do not tell Chat Completions and Responses apart, and the
|
|
2603
|
+
choice is about the models behind the key (user request, \u53C2\u8003\u56FE\u6837\u5F0F). Portalled
|
|
2604
|
+
onto <body> because the key list clips its overflow; the panel wears the same
|
|
2605
|
+
surface, radius and hairline as the app's own menus. */
|
|
2606
|
+
.bre-protocol-menu {
|
|
2607
|
+
position: fixed;
|
|
2608
|
+
z-index: 2147483000;
|
|
2609
|
+
box-sizing: border-box;
|
|
2610
|
+
width: 292px;
|
|
2611
|
+
padding: 6px;
|
|
2612
|
+
border-radius: 12px;
|
|
2613
|
+
border: 0.5px solid var(--dsw-alias-border-l4, rgba(0, 0, 0, .1));
|
|
2614
|
+
background: var(--dsw-alias-bg-layer-1, #ffffff);
|
|
2615
|
+
box-shadow: 0 8px 28px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .08);
|
|
2616
|
+
animation: bre-protocol-menu-in 120ms ease-out;
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
@keyframes bre-protocol-menu-in {
|
|
2620
|
+
from { opacity: 0; transform: translateY(-2px); }
|
|
2621
|
+
to { opacity: 1; transform: translateY(0); }
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
.bre-protocol-menu-title {
|
|
2625
|
+
margin: 0;
|
|
2626
|
+
padding: 6px 10px 4px;
|
|
2627
|
+
color: var(--dsw-alias-label-secondary, #61666b);
|
|
2628
|
+
font-size: 12px;
|
|
2629
|
+
line-height: 18px;
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
.bre-protocol-menu-list {
|
|
2633
|
+
display: flex;
|
|
2634
|
+
flex-direction: column;
|
|
2635
|
+
gap: 2px;
|
|
2636
|
+
margin: 0;
|
|
2637
|
+
padding: 0;
|
|
2638
|
+
list-style: none;
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
.bre-protocol-option {
|
|
2642
|
+
display: flex;
|
|
2643
|
+
align-items: flex-start;
|
|
2644
|
+
gap: 6px;
|
|
2645
|
+
width: 100%;
|
|
2646
|
+
box-sizing: border-box;
|
|
2647
|
+
margin: 0;
|
|
2648
|
+
padding: 8px 10px;
|
|
2649
|
+
border: none;
|
|
2650
|
+
border-radius: 8px;
|
|
2651
|
+
background: none;
|
|
2652
|
+
color: var(--dsw-alias-label-primary, #0f1115);
|
|
2653
|
+
font: inherit;
|
|
2654
|
+
text-align: left;
|
|
2655
|
+
cursor: pointer;
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
.bre-protocol-option:hover { background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09)); }
|
|
2659
|
+
|
|
2660
|
+
.bre-protocol-option:focus-visible {
|
|
2661
|
+
outline: none;
|
|
2662
|
+
box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
/* The choice in force is named the way the redesign names every selection:
|
|
2666
|
+
the accent lives in the TITLE and the tick, and the row keeps the menu's
|
|
2667
|
+
own surface \u2014 the grey pillow made the answer look pressed rather than
|
|
2668
|
+
current. The tick rides the right edge (order + auto margin \u2014 the DOM
|
|
2669
|
+
keeps the mark before the text), so the text column starts flush. */
|
|
2670
|
+
.bre-protocol-option-mark {
|
|
2671
|
+
display: inline-flex;
|
|
2672
|
+
align-items: center;
|
|
2673
|
+
justify-content: center;
|
|
2674
|
+
flex: 0 0 auto;
|
|
2675
|
+
order: 2;
|
|
2676
|
+
width: 12px;
|
|
2677
|
+
height: 18px;
|
|
2678
|
+
margin-left: auto;
|
|
2679
|
+
margin-top: 2px;
|
|
2680
|
+
color: var(--dsw-alias-brand-primary, #4d6bfe);
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
.bre-protocol-option[aria-selected='true'] { background: transparent; }
|
|
2684
|
+
|
|
2685
|
+
.bre-protocol-option[aria-selected='true']:hover {
|
|
2686
|
+
background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09));
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
.bre-protocol-option-text {
|
|
2690
|
+
display: flex;
|
|
2691
|
+
flex-direction: column;
|
|
2692
|
+
gap: 2px;
|
|
2693
|
+
min-width: 0;
|
|
2694
|
+
}
|
|
2695
|
+
|
|
2696
|
+
/* One line each, always: a wrapped hint made one row taller than its neighbours
|
|
2697
|
+
and the column of ticks lost its rhythm. A hint too long for the panel is cut
|
|
2698
|
+
with an ellipsis rather than allowed to reflow the list. */
|
|
2699
|
+
.bre-protocol-option-title,
|
|
2700
|
+
.bre-protocol-option-hint {
|
|
2701
|
+
display: block;
|
|
2702
|
+
overflow: hidden;
|
|
2703
|
+
white-space: nowrap;
|
|
2704
|
+
text-overflow: ellipsis;
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
.bre-protocol-option-title {
|
|
2708
|
+
font-size: 13px;
|
|
2709
|
+
font-weight: 500;
|
|
2710
|
+
line-height: 18px;
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2713
|
+
.bre-protocol-option[aria-selected='true'] .bre-protocol-option-title {
|
|
2714
|
+
color: var(--dsw-alias-brand-primary, #4d6bfe);
|
|
2715
|
+
font-weight: 500;
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
.bre-protocol-option-hint {
|
|
2719
|
+
color: var(--dsw-alias-label-secondary, #61666b);
|
|
2720
|
+
font-size: 12px;
|
|
2721
|
+
line-height: 16px;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2725
|
+
.bre-protocol-menu { animation: none; }
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
/* The key list's own links read as plain grey text: a row can carry four of them
|
|
2729
|
+
and blue made them compete with the value they act on (user item 3). Danger
|
|
2730
|
+
keeps its hue, and the scope form's primary shortcuts stay untouched. */
|
|
2731
|
+
.bre-keys-actions .bre-link-button { color: var(--dsw-alias-label-secondary, #61666b); }
|
|
2732
|
+
.bre-keys-actions .bre-link-button:hover { color: var(--dsw-alias-label-primary, #0f1115); }
|
|
2733
|
+
.bre-keys-actions .bre-keys-danger { color: var(--dsw-alias-state-error-primary, #d33); }
|
|
2734
|
+
|
|
2735
|
+
/* The API protocol as ONE segmented bar: one segment per protocol, the one in
|
|
2736
|
+
force sitting in a white pill on a shared grey track, so the alternatives read
|
|
2737
|
+
as parts of a single choice instead of three loose buttons (user item 1). The
|
|
2738
|
+
host's own <select> stays in the DOM behind them \u2014 hidden by the module, not
|
|
2739
|
+
removed \u2014 because it is what the host saves and what this module reads the
|
|
2740
|
+
family from. */
|
|
2741
|
+
.bre-protocol-cards {
|
|
2742
|
+
display: inline-flex;
|
|
2743
|
+
flex-wrap: wrap;
|
|
2744
|
+
gap: 2px;
|
|
2745
|
+
padding: 2px;
|
|
2746
|
+
border-radius: 10px;
|
|
2747
|
+
background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09));
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
.bre-protocol-card {
|
|
2751
|
+
display: inline-flex;
|
|
2752
|
+
align-items: center;
|
|
2753
|
+
justify-content: center;
|
|
2754
|
+
flex: 1 1 0;
|
|
2755
|
+
min-width: max-content;
|
|
2756
|
+
height: 28px;
|
|
2757
|
+
padding: 0 12px;
|
|
2758
|
+
border: none;
|
|
2759
|
+
border-radius: 8px;
|
|
2760
|
+
background: transparent;
|
|
2761
|
+
color: var(--dsw-alias-label-secondary, #61666b);
|
|
2762
|
+
font: inherit;
|
|
2763
|
+
font-size: 12px;
|
|
2764
|
+
font-weight: 500;
|
|
2765
|
+
line-height: 1;
|
|
2766
|
+
white-space: nowrap;
|
|
2767
|
+
text-align: center;
|
|
2768
|
+
cursor: pointer;
|
|
2769
|
+
transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
.bre-protocol-card:hover { color: var(--dsw-alias-label-primary, #0f1115); }
|
|
2773
|
+
|
|
2774
|
+
.bre-protocol-card.is-selected {
|
|
2775
|
+
background: var(--dsw-alias-bg-layer-1, #fff);
|
|
2776
|
+
color: var(--dsw-alias-label-primary, #0f1115);
|
|
2777
|
+
box-shadow: 0 1px 2px #0000001a, 0 0 0 1px var(--dsw-alias-border-l2, #0000001a);
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2780
|
+
.bre-protocol-card:focus-visible {
|
|
2781
|
+
outline: none;
|
|
2782
|
+
box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
/* The provider card's address tag: the protocol family the base URL serves.
|
|
2786
|
+
A hairline pill, the redesign's quiet badge: centred text inside a 999
|
|
2787
|
+
capsule, never a control. The width is FIXED at the form's label column:
|
|
2788
|
+
OpenAI, Anthropic and Gemini chips then share one 96px prefix column, so
|
|
2789
|
+
the field's input and every \u66F4\u591A\u7AEF\u70B9 row's input start at the same x \u2014
|
|
2790
|
+
a min-width column would drift with each family's name length. */
|
|
2791
|
+
.bre-endpoint-family {
|
|
2792
|
+
flex: 0 0 auto;
|
|
2793
|
+
display: inline-flex;
|
|
2794
|
+
align-items: center;
|
|
2795
|
+
justify-content: center;
|
|
2796
|
+
box-sizing: border-box;
|
|
2797
|
+
width: 96px;
|
|
2798
|
+
height: 22px;
|
|
2799
|
+
border-radius: 999px;
|
|
2800
|
+
box-shadow: inset 0 0 0 1px var(--dsw-alias-border-l3, #0000001f);
|
|
2801
|
+
font-size: 11px;
|
|
2802
|
+
color: var(--dsw-alias-label-secondary, #6b7280);
|
|
2803
|
+
white-space: nowrap;
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
/* The tag sits BESIDE the address input, not stacked above it. The official
|
|
2807
|
+
field is a column flex box (title, then control), so a tag inserted before the
|
|
2808
|
+
control would get a line of its own; a marked field becomes a two-column grid
|
|
2809
|
+
instead \u2014 the title keeps the full width, the tag takes the first column and
|
|
2810
|
+
the input the second. The first column is the SAME 96px the rest of the form
|
|
2811
|
+
labels take, so every input on the card starts at one vertical line. */
|
|
2812
|
+
[data-bre-endpoint-field] {
|
|
2813
|
+
display: grid;
|
|
2814
|
+
grid-template-columns: 96px minmax(0, 1fr);
|
|
2815
|
+
align-items: center;
|
|
2816
|
+
column-gap: 8px;
|
|
2817
|
+
/* One rhythm for the whole address block: the field's own lines AND the
|
|
2818
|
+
\u66F4\u591A\u7AEF\u70B9 rows inside it sit a fixed 8px apart, so the three address
|
|
2819
|
+
inputs read as one evenly spaced stack (API \u5730\u5740\u4E09\u4E2A\u8F93\u5165\u6846\u95F4\u8DDD\u4E0D\u4E00\u6837). */
|
|
2820
|
+
row-gap: 8px;
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2823
|
+
[data-bre-endpoint-field] > [data-bre-endpoint-title] { grid-column: 1 / -1; }
|
|
2824
|
+
|
|
2825
|
+
[data-bre-endpoint-field] > .bre-endpoint-family { grid-column: 1; }
|
|
2826
|
+
|
|
2827
|
+
[data-bre-endpoint-field] > input {
|
|
2828
|
+
grid-column: 2;
|
|
2829
|
+
width: 100%;
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
/* The injected second address rows. They are GRID ITEMS of the address field
|
|
2833
|
+
(the container is transparent to layout), so each row spans both columns and
|
|
2834
|
+
inherits the field's own row-gap \u2014 the uniform spacing the three address
|
|
2835
|
+
lines share. Collapsed until \u66F4\u591A\u7AEF\u70B9 is pressed. The [hidden] rule is not
|
|
2836
|
+
redundant: the display rule below beats the user agent's [hidden] rule, so
|
|
2837
|
+
without this companion the rows would be on screen from the moment they are
|
|
2838
|
+
injected. */
|
|
2839
|
+
[data-bre-endpoint-rows] { display: contents; }
|
|
2840
|
+
|
|
2841
|
+
[data-bre-endpoint-rows][hidden] { display: none; }
|
|
2842
|
+
|
|
2843
|
+
.bre-endpoint-row {
|
|
2844
|
+
grid-column: 1 / -1;
|
|
2845
|
+
display: flex;
|
|
2846
|
+
align-items: center;
|
|
2847
|
+
gap: 8px;
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
.bre-endpoint-row[hidden] { display: none; }
|
|
2851
|
+
|
|
2852
|
+
/* The injected second row's own input. The shared input caps itself at 240px for
|
|
2853
|
+
the narrow panels it was written for; beside a full-width address box that cap
|
|
2854
|
+
showed up as a short field under a long one (user item 5), so the row's input
|
|
2855
|
+
takes the column the main input takes. */
|
|
2856
|
+
.bre-endpoint-url {
|
|
2857
|
+
flex: 1 1 auto;
|
|
2858
|
+
min-width: 0;
|
|
2859
|
+
max-width: none;
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
/* \u66F4\u591A\u7AEF\u70B9: a small grey link riding the API \u5730\u5740 label line itself, right after
|
|
2863
|
+
the label text (user item 4). The official label is an inline-flex box, so the
|
|
2864
|
+
link simply joins its children and the host's own 10px gap spaces it from the
|
|
2865
|
+
words; the row it reveals still opens directly under the field group. */
|
|
2866
|
+
.bre-endpoint-toggle {
|
|
2867
|
+
display: inline-flex;
|
|
2868
|
+
align-items: center;
|
|
2869
|
+
margin: 0 0 0 6px;
|
|
2870
|
+
padding: 0;
|
|
2871
|
+
border: none;
|
|
2872
|
+
background: none;
|
|
2873
|
+
color: var(--dsw-alias-label-secondary, #6b7280);
|
|
2874
|
+
font: inherit;
|
|
2875
|
+
font-size: 12px;
|
|
2876
|
+
font-weight: 400;
|
|
2877
|
+
line-height: 1;
|
|
2878
|
+
cursor: pointer;
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
.bre-endpoint-toggle:hover { color: var(--dsw-alias-label-primary, #0f1115); text-decoration: none; }
|
|
2882
|
+
|
|
2883
|
+
/* The disclosure mark is DRAWN, not typed: two 1.5px strokes make the thin
|
|
2884
|
+
chevron of the reference, and it turns over when the row opens instead of
|
|
2885
|
+
being swapped for a second glyph (user item 2). */
|
|
2886
|
+
.bre-endpoint-toggle::after {
|
|
2887
|
+
content: '';
|
|
2888
|
+
width: 5px;
|
|
2889
|
+
height: 5px;
|
|
2890
|
+
margin-left: 4px;
|
|
2891
|
+
margin-top: -2px;
|
|
2892
|
+
border-right: 1.5px solid currentColor;
|
|
2893
|
+
border-bottom: 1.5px solid currentColor;
|
|
2894
|
+
transform: rotate(45deg);
|
|
2895
|
+
transition: transform 140ms ease, margin-top 140ms ease;
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
.bre-endpoint-toggle[aria-expanded='true']::after {
|
|
2899
|
+
margin-top: 2px;
|
|
2900
|
+
transform: rotate(225deg);
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
.bre-endpoint-toggle:focus-visible {
|
|
2904
|
+
outline: none;
|
|
2905
|
+
box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
|
|
2906
|
+
border-radius: 4px;
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
/* The model-scope chips: the models the provider actually offers, each a toggle.
|
|
2910
|
+
A selected chip takes the brand tint and a tick, so a quick glance tells which
|
|
2911
|
+
models this key claims without reading a list of ids. */
|
|
2912
|
+
.bre-keys-chips {
|
|
2913
|
+
display: flex;
|
|
2914
|
+
flex-wrap: wrap;
|
|
2915
|
+
gap: 6px;
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
.bre-keys-chip {
|
|
2919
|
+
display: inline-flex;
|
|
2920
|
+
align-items: center;
|
|
2921
|
+
gap: 4px;
|
|
2922
|
+
padding: 4px 10px;
|
|
2923
|
+
border: 1px solid var(--dsw-alias-line-regular, #d8dbe2);
|
|
2924
|
+
border-radius: 999px;
|
|
2925
|
+
background: transparent;
|
|
2926
|
+
color: var(--dsw-alias-label-primary, #0f1115);
|
|
2927
|
+
font: inherit;
|
|
2928
|
+
font-size: 12px;
|
|
2929
|
+
cursor: pointer;
|
|
2930
|
+
transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
|
|
2931
|
+
}
|
|
2932
|
+
|
|
2933
|
+
.bre-keys-chip:hover { border-color: var(--dsw-alias-brand-primary, #3b82f6); }
|
|
2934
|
+
|
|
2935
|
+
.bre-keys-chip:focus-visible {
|
|
2936
|
+
outline: none;
|
|
2937
|
+
box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
.bre-keys-chip:disabled { opacity: 0.55; cursor: default; }
|
|
2941
|
+
|
|
2942
|
+
/* A selected chip takes the accent tint and a tick; the outline steps aside \u2014
|
|
2943
|
+
the tint IS the border, and a second one doubled the weight. */
|
|
2944
|
+
.bre-keys-chip.is-selected {
|
|
2945
|
+
border-color: transparent;
|
|
2946
|
+
background: var(--dsw-alias-brand-primary-muted, #eef2ff);
|
|
2947
|
+
color: var(--dsw-alias-brand-primary, #3b82f6);
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2950
|
+
.bre-keys-chip-mark {
|
|
2951
|
+
display: inline-flex;
|
|
2952
|
+
align-items: center;
|
|
2953
|
+
justify-content: center;
|
|
2954
|
+
width: 12px;
|
|
2955
|
+
height: 12px;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
.bre-keys-chip-mark > svg { width: 12px; height: 12px; }
|
|
2959
|
+
|
|
2960
|
+
/* "All models" is a quiet text action inside the scope form's action row. */
|
|
2961
|
+
.bre-keys-allmodels { margin-right: auto; }
|
|
2962
|
+
|
|
2963
|
+
/* The provider's two base URLs: one OpenAI-style, one Anthropic. Kept together
|
|
2964
|
+
below the key list because they belong to the route, not to any one key. */
|
|
2965
|
+
.bre-keys-endpoints {
|
|
2966
|
+
display: flex;
|
|
2967
|
+
flex-direction: column;
|
|
2968
|
+
gap: 6px;
|
|
2969
|
+
margin-top: 8px;
|
|
2970
|
+
padding-top: 8px;
|
|
2971
|
+
border-top: 1px solid var(--dsw-alias-line-faint, #eceef2);
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
.bre-keys-endpoint-row {
|
|
2975
|
+
display: flex;
|
|
2976
|
+
align-items: center;
|
|
2977
|
+
gap: 8px;
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
.bre-keys-endpoint-label {
|
|
2981
|
+
flex: 0 0 auto;
|
|
2982
|
+
width: 104px;
|
|
2983
|
+
font-size: 11px;
|
|
2984
|
+
color: var(--dsw-alias-label-secondary, #6b7280);
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
.bre-keys-endpoint {
|
|
2988
|
+
flex: 1 1 auto;
|
|
2989
|
+
min-width: 0;
|
|
2990
|
+
height: 26px;
|
|
2991
|
+
font-size: 12px;
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2994
|
+
.bre-keys-endpoint-actions { display: flex; justify-content: flex-end; }
|
|
2995
|
+
|
|
2996
|
+
/* ============================================================================
|
|
2997
|
+
Quiet Precision \u2014 the settings surfaces, stated once.
|
|
2998
|
+
|
|
2999
|
+
The blocks below re-describe the key list, the protocol picker, the address
|
|
3000
|
+
rows and the provider card's protocol strip in the redesign's language. They
|
|
3001
|
+
are APPENDED rather than woven into the rules above on purpose: those rules
|
|
3002
|
+
still say what each control IS (a toggle, a menu, a row), and this block only
|
|
3003
|
+
says how it should look, so the two can be diffed when the plugin is next
|
|
3004
|
+
touched. Later rules win, so nothing above needs deleting.
|
|
3005
|
+
|
|
3006
|
+
Three habits it enforces:
|
|
3007
|
+
1. Grouping is spacing and a heading's job. A box inside a box inside a box
|
|
3008
|
+
is what the old panels read as, so the key list loses its outer rule and
|
|
3009
|
+
keeps only the hairline between rows.
|
|
3010
|
+
2. One accent, and it only ever means "this one". Chosen states are a tint
|
|
3011
|
+
plus accent ink \u2014 never a solid fill, never a tick.
|
|
3012
|
+
3. Nothing moves when a state changes: no control grows a glyph on select,
|
|
3013
|
+
because a list that widens under the pointer is a list that misclicks.
|
|
3014
|
+
========================================================================= */
|
|
3015
|
+
|
|
3016
|
+
/* The provider card's protocol strip: four wires, each with a share of the row's
|
|
3017
|
+
whole width, so the chosen one reads as a segment of the field rather than a
|
|
3018
|
+
chip floating in it. */
|
|
3019
|
+
.bre-protocol-cards {
|
|
3020
|
+
display: flex;
|
|
3021
|
+
width: 100%;
|
|
3022
|
+
box-sizing: border-box;
|
|
3023
|
+
gap: 2px;
|
|
3024
|
+
padding: 2px;
|
|
3025
|
+
border-radius: var(--bre-r-sm);
|
|
3026
|
+
background: var(--bre-sunken);
|
|
3027
|
+
}
|
|
3028
|
+
|
|
3029
|
+
.bre-protocol-card {
|
|
3030
|
+
flex: 1 1 0;
|
|
3031
|
+
height: 28px;
|
|
3032
|
+
min-width: 0;
|
|
3033
|
+
padding: 0 6px;
|
|
3034
|
+
border-radius: 6px;
|
|
3035
|
+
color: var(--bre-ink-2);
|
|
3036
|
+
font-size: 12px;
|
|
3037
|
+
font-weight: 400;
|
|
3038
|
+
overflow: hidden;
|
|
3039
|
+
text-overflow: ellipsis;
|
|
3040
|
+
white-space: nowrap;
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
.bre-protocol-card:hover {
|
|
3044
|
+
color: var(--bre-ink);
|
|
3045
|
+
background: var(--bre-hover);
|
|
3046
|
+
}
|
|
3047
|
+
|
|
3048
|
+
.bre-protocol-card.is-selected {
|
|
3049
|
+
background: var(--bre-accent-weak);
|
|
3050
|
+
color: var(--bre-accent-ink);
|
|
3051
|
+
font-weight: 500;
|
|
3052
|
+
box-shadow: inset 0 0 0 1px var(--bre-accent-line);
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
.bre-protocol-card:focus-visible {
|
|
3056
|
+
outline: none;
|
|
3057
|
+
box-shadow: 0 0 0 3px var(--bre-accent-glow);
|
|
3058
|
+
}
|
|
3059
|
+
|
|
3060
|
+
/* The address field: the endpoint's name and its input on ONE line, the name
|
|
3061
|
+
column measured against the longest name it can hold (Anthropic) rather than
|
|
3062
|
+
padded out \u2014 a wider column only buys empty space between the two. */
|
|
3063
|
+
[data-bre-endpoint-field] {
|
|
3064
|
+
grid-template-columns: 76px minmax(0, 1fr);
|
|
3065
|
+
column-gap: 6px;
|
|
3066
|
+
row-gap: 6px;
|
|
3067
|
+
}
|
|
3068
|
+
|
|
3069
|
+
.bre-endpoint-family {
|
|
3070
|
+
width: 76px;
|
|
3071
|
+
height: 24px;
|
|
3072
|
+
justify-content: flex-start;
|
|
3073
|
+
gap: 6px;
|
|
3074
|
+
padding: 0;
|
|
3075
|
+
border-radius: 0;
|
|
3076
|
+
box-shadow: none;
|
|
3077
|
+
background: transparent;
|
|
3078
|
+
color: var(--bre-ink-3);
|
|
3079
|
+
font-size: 11.5px;
|
|
3080
|
+
font-weight: 400;
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
/* The dot names the endpoint's state without a second word: filled once that
|
|
3084
|
+
family has an address, hollow while it is still unset. */
|
|
3085
|
+
.bre-endpoint-family::before {
|
|
3086
|
+
content: '';
|
|
3087
|
+
flex: 0 0 auto;
|
|
3088
|
+
width: 5px;
|
|
3089
|
+
height: 5px;
|
|
3090
|
+
border-radius: 999px;
|
|
3091
|
+
background: var(--bre-line-4);
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3094
|
+
.bre-endpoint-family[data-bre-endpoint-filled='1']::before { background: var(--bre-ok); }
|
|
3095
|
+
|
|
3096
|
+
.bre-endpoint-row {
|
|
3097
|
+
display: grid;
|
|
3098
|
+
grid-template-columns: 76px minmax(0, 1fr);
|
|
3099
|
+
column-gap: 6px;
|
|
3100
|
+
align-items: center;
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
.bre-endpoint-url {
|
|
3104
|
+
height: 30px;
|
|
3105
|
+
border-radius: var(--bre-r-sm);
|
|
3106
|
+
}
|
|
3107
|
+
|
|
3108
|
+
/* \u66F4\u591A\u7AEF\u70B9 and the tally that rides beside it: two quiet words on the field's
|
|
3109
|
+
label line, never a control that looks like another field. */
|
|
3110
|
+
.bre-endpoint-toggle {
|
|
3111
|
+
height: 18px;
|
|
3112
|
+
margin: 0 0 0 4px;
|
|
3113
|
+
padding: 0 4px;
|
|
3114
|
+
border-radius: 5px;
|
|
3115
|
+
color: var(--bre-accent);
|
|
3116
|
+
font-size: 11.5px;
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
.bre-endpoint-toggle:hover {
|
|
3120
|
+
color: var(--bre-accent-ink);
|
|
3121
|
+
background: var(--bre-accent-weak);
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3124
|
+
/* The key list: rows on a quiet surface, separated by a hairline, with no rule
|
|
3125
|
+
drawn round the whole block. */
|
|
3126
|
+
.bre-keys-list {
|
|
3127
|
+
border: none;
|
|
3128
|
+
border-radius: 0;
|
|
3129
|
+
overflow: visible;
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
.bre-keys-list > li + li { border-top: 1px solid var(--bre-line-1); }
|
|
3133
|
+
|
|
3134
|
+
.bre-keys-row {
|
|
3135
|
+
gap: 8px;
|
|
3136
|
+
min-height: 40px;
|
|
3137
|
+
padding: 0 10px;
|
|
3138
|
+
border-radius: var(--bre-r-sm);
|
|
3139
|
+
transition: background var(--bre-t) var(--bre-ease);
|
|
3140
|
+
}
|
|
3141
|
+
|
|
3142
|
+
.bre-keys-row:hover { background: var(--bre-hover); }
|
|
3143
|
+
|
|
3144
|
+
/* The enable check: a ring that fills. Filled is accent with a white tick, empty
|
|
3145
|
+
is a grey ring with nothing in it \u2014 the two readings of a checkbox, drawn at
|
|
3146
|
+
the list's own scale. (The tick is the STATE of one control, which is why it
|
|
3147
|
+
survives the no-glyph-on-select rule above: it lives inside the switch, so
|
|
3148
|
+
lighting it cannot change the row's width.) */
|
|
3149
|
+
.bre-keys-toggle-mark {
|
|
3150
|
+
width: 18px;
|
|
3151
|
+
height: 18px;
|
|
3152
|
+
box-shadow: inset 0 0 0 1.5px var(--bre-line-4);
|
|
3153
|
+
transition: background var(--bre-t) var(--bre-ease), box-shadow var(--bre-t) var(--bre-ease);
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
.bre-keys-toggle-mark svg {
|
|
3157
|
+
width: 11px;
|
|
3158
|
+
height: 11px;
|
|
3159
|
+
}
|
|
3160
|
+
|
|
3161
|
+
.bre-keys-toggle.is-on .bre-keys-toggle-mark {
|
|
3162
|
+
background: var(--bre-accent);
|
|
3163
|
+
box-shadow: inset 0 0 0 1.5px var(--bre-accent);
|
|
3164
|
+
color: #ffffff;
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
.bre-keys-toggle:focus-visible {
|
|
3168
|
+
box-shadow: none;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
.bre-keys-toggle:focus-visible .bre-keys-toggle-mark {
|
|
3172
|
+
box-shadow: inset 0 0 0 1.5px var(--bre-line-4), 0 0 0 3px var(--bre-accent-glow);
|
|
3173
|
+
}
|
|
3174
|
+
|
|
3175
|
+
/* The last enabled key cannot be switched off; it stays lit but stands back, so
|
|
3176
|
+
the refusal is visible before the click rather than after it. */
|
|
3177
|
+
.bre-keys-toggle:disabled .bre-keys-toggle-mark { opacity: 0.45; }
|
|
3178
|
+
|
|
3179
|
+
/* A switched-off key stays listed but reads as idle through its ink alone: the
|
|
3180
|
+
row is still workable, so nothing about it is made fainter than text. */
|
|
3181
|
+
.bre-keys-row.is-off .bre-keys-alias,
|
|
3182
|
+
.bre-keys-row.is-off .bre-keys-mask {
|
|
3183
|
+
opacity: 1;
|
|
3184
|
+
color: var(--bre-ink-4);
|
|
3185
|
+
}
|
|
3186
|
+
|
|
3187
|
+
.bre-keys-alias {
|
|
3188
|
+
font-size: 12px;
|
|
3189
|
+
font-weight: 500;
|
|
3190
|
+
color: var(--bre-ink);
|
|
3191
|
+
}
|
|
3192
|
+
|
|
3193
|
+
.bre-keys-mask {
|
|
3194
|
+
padding: 1px 6px;
|
|
3195
|
+
border-radius: var(--bre-r-xs);
|
|
3196
|
+
background: var(--bre-sunken);
|
|
3197
|
+
color: var(--bre-ink-3);
|
|
3198
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
3199
|
+
font-size: 11px;
|
|
3200
|
+
}
|
|
3201
|
+
|
|
3202
|
+
.bre-keys-mask-plain {
|
|
3203
|
+
padding: 0;
|
|
3204
|
+
border-radius: 0;
|
|
3205
|
+
background: transparent;
|
|
3206
|
+
color: var(--bre-ink);
|
|
3207
|
+
font-family: inherit;
|
|
3208
|
+
font-size: 12px;
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
/* The row's tray: the protocol and the model scope are STATE and stay on the
|
|
3212
|
+
row; the verbs fade in on hover, so a resting list reads as names and nothing
|
|
3213
|
+
else. The split is made here rather than in the markup \u2014 the tray stays
|
|
3214
|
+
mounted (its width never changes, so hovering cannot shift the row), and only
|
|
3215
|
+
the VERBS inside it are painted away, picked out by :not(.bre-keys-scope):
|
|
3216
|
+
the scope is a <button> too, but its label is a count, not an action. */
|
|
3217
|
+
.bre-keys-actions {
|
|
3218
|
+
gap: 6px;
|
|
3219
|
+
opacity: 1;
|
|
3220
|
+
pointer-events: auto;
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
.bre-keys-actions .bre-link-button:not(.bre-keys-scope) {
|
|
3224
|
+
opacity: 0;
|
|
3225
|
+
pointer-events: none;
|
|
3226
|
+
transition: opacity 120ms ease;
|
|
3227
|
+
}
|
|
3228
|
+
|
|
3229
|
+
.bre-keys-row:hover .bre-keys-actions .bre-link-button:not(.bre-keys-scope),
|
|
3230
|
+
.bre-keys-row:focus-within .bre-keys-actions .bre-link-button:not(.bre-keys-scope) {
|
|
3231
|
+
opacity: 1;
|
|
3232
|
+
pointer-events: auto;
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
/* A row waiting on "confirm remove / cancel" must never hide its own question. */
|
|
3236
|
+
.bre-keys-actions.is-confirming .bre-link-button {
|
|
3237
|
+
opacity: 1;
|
|
3238
|
+
pointer-events: auto;
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
@media (hover: none) {
|
|
3242
|
+
.bre-keys-actions .bre-link-button:not(.bre-keys-scope) {
|
|
3243
|
+
opacity: 1;
|
|
3244
|
+
pointer-events: auto;
|
|
3245
|
+
}
|
|
3246
|
+
}
|
|
3247
|
+
|
|
3248
|
+
.bre-keys-protocol {
|
|
3249
|
+
height: 20px;
|
|
3250
|
+
padding: 0 5px;
|
|
3251
|
+
gap: 3px;
|
|
3252
|
+
border-radius: 5px;
|
|
3253
|
+
background: var(--bre-sunken);
|
|
3254
|
+
color: var(--bre-ink-2);
|
|
3255
|
+
font-size: 11px;
|
|
3256
|
+
line-height: 1;
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
.bre-keys-protocol:hover {
|
|
3260
|
+
background: var(--bre-sunken-2);
|
|
3261
|
+
color: var(--bre-ink);
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
.bre-keys-protocol[aria-expanded='true'] {
|
|
3265
|
+
background: var(--bre-accent-weak);
|
|
3266
|
+
color: var(--bre-accent-ink);
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3269
|
+
.bre-keys-protocol-caret { font-size: 11px; opacity: 0.6; }
|
|
3270
|
+
|
|
3271
|
+
.bre-keys-scope {
|
|
3272
|
+
color: var(--bre-ink-3);
|
|
3273
|
+
font-family: inherit;
|
|
3274
|
+
font-size: 11px;
|
|
3275
|
+
font-variant-numeric: tabular-nums;
|
|
3276
|
+
letter-spacing: 0;
|
|
3277
|
+
}
|
|
3278
|
+
|
|
3279
|
+
/* Verbs are quieter than state: ink-3 at rest, ink on hover, danger for the one
|
|
3280
|
+
that removes a key. */
|
|
3281
|
+
.bre-keys-actions .bre-link-button {
|
|
3282
|
+
color: var(--bre-ink-3);
|
|
3283
|
+
font-size: 11.5px;
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
.bre-keys-actions .bre-link-button:hover { color: var(--bre-ink); }
|
|
3287
|
+
|
|
3288
|
+
.bre-keys-actions .bre-keys-danger { color: var(--bre-danger); }
|
|
3289
|
+
|
|
3290
|
+
.bre-keys-actions .bre-keys-danger:hover { color: var(--bre-danger); }
|
|
3291
|
+
|
|
3292
|
+
/* The inline form: a sunken panel inside the list, never a dialog. */
|
|
3293
|
+
.bre-keys-form-row { padding: 0 0 8px; }
|
|
3294
|
+
|
|
3295
|
+
.bre-keys-form {
|
|
3296
|
+
gap: 8px;
|
|
3297
|
+
padding: 10px;
|
|
3298
|
+
border: none;
|
|
3299
|
+
border-radius: var(--bre-r-sm);
|
|
3300
|
+
background: var(--bre-sunken);
|
|
3301
|
+
}
|
|
3302
|
+
|
|
3303
|
+
.bre-keys-form-fields { gap: 6px; }
|
|
3304
|
+
|
|
3305
|
+
.bre-keys-hint,
|
|
3306
|
+
.bre-keys-note {
|
|
3307
|
+
margin: 0;
|
|
3308
|
+
color: var(--bre-ink-hint);
|
|
3309
|
+
font-size: 11px;
|
|
3310
|
+
line-height: 16px;
|
|
3311
|
+
}
|
|
3312
|
+
|
|
3313
|
+
.bre-keys-form-actions { gap: 6px; }
|
|
3314
|
+
|
|
3315
|
+
.bre-keys-form-actions .bre-primary-button {
|
|
3316
|
+
height: 26px;
|
|
3317
|
+
border-radius: 6px;
|
|
3318
|
+
font-size: 12px;
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3321
|
+
/* The chips \u2014 the models a key serves, and the wire a new key pins: one shape
|
|
3322
|
+
for every choice set in the settings. Selected is a tint, never a tick (see
|
|
3323
|
+
the no-movement rule at the top of this block). */
|
|
3324
|
+
.bre-keys-chips { gap: 6px; }
|
|
3325
|
+
|
|
3326
|
+
.bre-keys-chip {
|
|
3327
|
+
height: 26px;
|
|
3328
|
+
padding: 0 10px;
|
|
3329
|
+
border: 1px solid var(--bre-line-3);
|
|
3330
|
+
border-radius: 999px;
|
|
3331
|
+
background: transparent;
|
|
3332
|
+
color: var(--bre-ink-2);
|
|
3333
|
+
font-size: 11.5px;
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3336
|
+
.bre-keys-chip:hover {
|
|
3337
|
+
border-color: var(--bre-line-4);
|
|
3338
|
+
color: var(--bre-ink);
|
|
3339
|
+
}
|
|
3340
|
+
|
|
3341
|
+
.bre-keys-chip.is-selected {
|
|
3342
|
+
background: var(--bre-accent-weak);
|
|
3343
|
+
border-color: var(--bre-accent-line);
|
|
3344
|
+
color: var(--bre-accent-ink);
|
|
3345
|
+
font-weight: 500;
|
|
3346
|
+
}
|
|
3347
|
+
|
|
3348
|
+
.bre-keys-chip:focus-visible {
|
|
3349
|
+
outline: none;
|
|
3350
|
+
box-shadow: 0 0 0 3px var(--bre-accent-glow);
|
|
3351
|
+
}
|
|
3352
|
+
|
|
3353
|
+
/* Adding a key is the list's last line: a dashed invitation, not a button that
|
|
3354
|
+
competes with the row actions. */
|
|
3355
|
+
.bre-keys-add {
|
|
3356
|
+
height: 34px;
|
|
3357
|
+
border: 1px dashed var(--bre-line-3);
|
|
3358
|
+
border-radius: var(--bre-r-sm);
|
|
3359
|
+
color: var(--bre-ink-3);
|
|
3360
|
+
font-size: 12px;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3363
|
+
.bre-keys-add:hover {
|
|
3364
|
+
border-color: var(--bre-line-4);
|
|
3365
|
+
background: var(--bre-sunken);
|
|
3366
|
+
color: var(--bre-ink);
|
|
3367
|
+
}
|
|
3368
|
+
|
|
3369
|
+
/* The protocol menu: roomy rows, each naming a wire and saying what it signs.
|
|
3370
|
+
The one in force wears the accent tint; no tick, so the rows keep one width
|
|
3371
|
+
and the list cannot shuffle under the pointer. */
|
|
3372
|
+
.bre-protocol-menu {
|
|
3373
|
+
padding: 6px;
|
|
3374
|
+
border: 1px solid var(--bre-line-1);
|
|
3375
|
+
border-radius: var(--bre-r-md);
|
|
3376
|
+
background: var(--bre-surface);
|
|
3377
|
+
box-shadow: var(--bre-shadow-pop);
|
|
3378
|
+
}
|
|
3379
|
+
|
|
3380
|
+
.bre-protocol-menu-title {
|
|
3381
|
+
padding: 4px 8px 6px;
|
|
3382
|
+
color: var(--bre-ink-hint);
|
|
3383
|
+
font-size: 11.5px;
|
|
3384
|
+
font-weight: 500;
|
|
3385
|
+
letter-spacing: 0.02em;
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
.bre-protocol-option {
|
|
3389
|
+
gap: 8px;
|
|
3390
|
+
min-height: 52px;
|
|
3391
|
+
padding: 8px 10px;
|
|
3392
|
+
border-radius: var(--bre-r-sm);
|
|
3393
|
+
}
|
|
3394
|
+
|
|
3395
|
+
.bre-protocol-option:hover { background: var(--bre-hover); }
|
|
3396
|
+
|
|
3397
|
+
.bre-protocol-option[aria-selected='true'],
|
|
3398
|
+
.bre-protocol-option[aria-selected='true']:hover {
|
|
3399
|
+
background: var(--bre-accent-weak);
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
.bre-protocol-option-title {
|
|
3403
|
+
color: var(--bre-ink);
|
|
3404
|
+
font-size: 13px;
|
|
3405
|
+
font-weight: 500;
|
|
3406
|
+
line-height: 18px;
|
|
3407
|
+
}
|
|
3408
|
+
|
|
3409
|
+
.bre-protocol-option[aria-selected='true'] .bre-protocol-option-title {
|
|
3410
|
+
color: var(--bre-accent-ink);
|
|
3411
|
+
}
|
|
3412
|
+
|
|
3413
|
+
.bre-protocol-option-hint {
|
|
3414
|
+
color: var(--bre-ink-hint);
|
|
3415
|
+
font-size: 11.5px;
|
|
3416
|
+
line-height: 16px;
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
.bre-protocol-option[aria-selected='true'] .bre-protocol-option-hint {
|
|
3420
|
+
color: var(--bre-accent-ink);
|
|
3421
|
+
opacity: 0.78;
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
.bre-protocol-option:focus-visible {
|
|
3425
|
+
outline: none;
|
|
3426
|
+
box-shadow: 0 0 0 3px var(--bre-accent-glow);
|
|
3427
|
+
}
|
|
3428
|
+
|
|
1912
3429
|
@media (prefers-reduced-motion: reduce) {
|
|
1913
3430
|
.bre-editor-tab { transition: none; }
|
|
1914
3431
|
.bre-key-eye { transition: none; }
|
|
1915
|
-
.bre-keys-
|
|
3432
|
+
.bre-keys-actions, .bre-keys-add, .bre-keys-discover, .bre-keys-chip { transition: none; }
|
|
1916
3433
|
}
|
|
1917
|
-
`;var _t=require("react"),Wi=require("react-dom");var T=require("react"),Rr=require("react-dom"),Li=require("react-dom");var pi=["off","minimal","low","medium","high","xhigh","max"],Zd=["text","image"];var el=[{id:"deepseek-v4-vision",patterns:["deepseek-v4-flash-vision","deepseek-v4-vision"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:"DeepSeek \u89C6\u89C9\u5B9E\u9A8C\u7248 id\uFF08deepseek-v4-flash-vision-exp\uFF09\u3002\u5B98\u65B9\u76EE\u5F55\u5DF2\u6807\u6CE8\u8BE5\u6A21\u578B\u9000\u5F79\uFF0C\u540D\u5B57\u4ECD\u88AB\u63A5\u53D7\u3001\u7531\u73B0\u884C deepseek-flash \u63D0\u4F9B\u670D\u52A1\u2014\u2014\u56FE\u7247\u8F93\u5165\u73B0\u5DF2\u7531 deepseek-flash \u539F\u751F\u63D0\u4F9B\u3002"},{id:"deepseek-v4-1-flash",patterns:["deepseek-v4.1-flash","deepseek-flash"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek-V4.1-Flash\uFF082026-09-10 \u53D1\u5E03\u7684\u73B0\u884C\u5B98\u65B9\u6A21\u578B\uFF0C\u5B98\u65B9 id \u4E3A deepseek-flash\uFF1B25 \u4E07\u5E76\u53D1\u3001**\u539F\u751F\u56FE\u7247\u8F93\u5165**\uFF09\u3002V4.1 \u7684\u5404\u5199\u6CD5\uFF08deepseek-flash\u3001deepseek-v4.1-flash\u3001deepseek-v4-1-flash\uFF0C\u4EE5\u53CA\u5E26\u65E5\u671F\u540E\u7F00\u7684\u7B2C\u4E09\u65B9\u53D8\u4F53\uFF09\u90FD\u5F52\u6B64\u6761\u2014\u2014\u7EAF\u6587\u672C\u7684 deepseek-v4 \u4E3B\u5E72\u4E0D\u518D\u541E\u6389\u5B83\u4EEC\u3002\u5B98\u65B9\u679A\u4E3E\u540C V4 \u7CFB\uFF1AOff\uFF08thinking:"disabled"\uFF09/ Low / High / Max\uFF0C\u9ED8\u8BA4 High\uFF1B\u5BB9\u91CF 1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\u3002'},{id:"deepseek-v4",patterns:["deepseek-v4"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek \u5B98\u65B9\u679A\u4E3E Low / High / Max\uFF08\u9ED8\u8BA4 High\uFF1Bminimal\u3001medium\u3001xhigh \u517C\u5BB9\u6620\u5C04\uFF0Cultra\u2192max\uFF09\uFF0COff \u5373 thinking:"disabled"\uFF08Responses API \u4E0B off \u4EE5 reasoning.effort:"none" \u8868\u793A\uFF09\u3002\u672C\u6761\u76EE\u662F V4 \u5BB6\u65CF\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF1Adeepseek-v4-pro\uFF08= DeepSeek-V4-Pro-0813\uFF0C\u5B98\u65B9\u4E0D\u652F\u6301\u56FE\u7247\uFF09\u4E0E\u5DF2\u9000\u5F79\u6A21\u578B\u7684\u517C\u5BB9\u522B\u540D deepseek-v4-flash\uFF08deepseek-v4-flash-vision-exp \u53E6\u6709\u89C6\u89C9\u6761\u76EE\uFF09\u3002**\u6536\u56FE\u7684 V4.1-Flash\uFF08\u5B98\u65B9 id deepseek-flash\uFF09\u53E6\u6709\u4E13\u95E8\u6761\u76EE**\uFF0C\u5176 input \u542B image\u3002\u5BB9\u91CF\uFF1A1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\uFF08393,216\uFF1B\u9ED8\u8BA4\u975E\u601D\u8003 8K\u3001\u601D\u8003 64K\u3001effort=max \u65F6 128K\uFF09\u3002'},{id:"deepseek-v3",patterns:["deepseek-v3","deepseek-chat"],efforts:{off:"none",high:"high",max:"max"},compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:65536,note:"DeepSeek V3 \u6863\u4F4D\uFF1AOff / High / Max\u3002\u5B98\u65B9\u5DF2\u505C\u552E V3 \u4EE3\uFF08\u5B9A\u4EF7\u9875\u4EC5\u5269 V4 \u4E09\u578B\uFF09\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55\u73B0\u5F79\u503C\u3002"},{id:"deepseek-r1",patterns:["deepseek-r1","deepseek-reasoner"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:32768,note:"DeepSeek-R1 \u4E3A\u63A8\u7406\u6A21\u578B\uFF0C\u4EC5\u63D0\u4F9B High\u3002\u5B98\u65B9\u5DF2\u4E0B\u67B6 R1 \u4EE3\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55 r1-0528 \u503C\u3002"},{id:"openai-gpt-5-2",patterns:["gpt-5.2"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2 \u6863\u4F4D\uFF1ANone / Low / Medium / High / XHigh\uFF08\u9ED8\u8BA4 None\uFF09\u3002\u5B98\u65B9\u53E6\u652F\u6301 PDF \u8F93\u5165\uFF08\u6838\u5FC3\u8BCD\u8868\u6682\u4E0D\u542B\uFF09\u3002gpt-5.2-pro \u5B98\u65B9\u9875\u672A\u5355\u5217\u6863\u4F4D\u884C\uFF0C\u6309\u672C\u6761\u76EE\u540C\u6863\u5904\u7406\uFF1Bgpt-5.2-codex \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"openai-gpt-5-2-codex",patterns:["gpt-5.2-codex"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2-Codex \u6863\u4F4D\uFF1ALow / Medium / High / XHigh\uFF08\u65E0 None \u6863\uFF0C\u52FF\u52FE Off\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\u3002"},{id:"openai-gpt-5-6",patterns:["gpt-5.6"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.6\uFF08\u522B\u540D\u5373 sol\uFF09\u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh / Max\uFF1Bsol/luna/terra \u540C\u6863\uFF0C\u5E26\u56FE\u8F93\u5165\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-5",patterns:["gpt-5.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.5 \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF08\u65E0 Max \u6863\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 High(\u9ED8\u8BA4) / XHigh\u30011.05M \u4E0A\u4E0B\u6587\u4E14\u4EC5 Responses API\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-4",patterns:["gpt-5.4"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.4 \u6863\u4F4D\uFF1ANone(\u9ED8\u8BA4) / Low / Medium / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 Medium/High/XHigh\uFF081.05M\uFF09\uFF1Bmini/nano \u4E3A 400K \u4E0A\u4E0B\u6587\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-3",patterns:["gpt-5.3"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.3-Codex \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\uFF1B2026-10 \u6821\u51C6\uFF1ANone \u6863\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8865\u56DE\uFF08\u6B64\u524D\u6309\u65E7\u6A21\u578B\u9875\u8BB0\u4E3A\u65E0 None\uFF09\u3002gpt-5.3-chat \u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF08\u89C1 chat \u6761\u76EE\uFF09\u3002"},{id:"openai-gpt-5-1",patterns:["gpt-5.1"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1 \u6863\u4F4D\uFF1ANone / Low / Medium / High\uFF08\u9ED8\u8BA4 None\uFF09\u3002"},{id:"openai-gpt-5-1-codex",patterns:["gpt-5.1-codex"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1-Codex \u7CFB\u5217\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF0C\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High\uFF08\u65E0 None\uFF1Bxhigh \u672A\u8BC1\u5B9E\uFF09\u3002\u5982\u7AEF\u70B9\u652F\u6301 xhigh/none \u53EF\u624B\u8C03\u3002"},{id:"openai-gpt-5",patterns:["gpt-5"],efforts:{minimal:"minimal",low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5 \u521D\u4EE3\u6863\u4F4D\uFF1AMinimal / Low / Medium / High\uFF0C\u65E0\u5173\u95ED\u6863\u3002"},{id:"openai-gpt-5-2-chat",patterns:["gpt-5.2-chat"],efforts:{off:null,medium:"medium",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"GPT-5.2-Chat\uFF08\u5B98\u65B9 id gpt-5.2-chat-latest\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u8BB0\u4E3A\u63A8\u7406\u6A21\u578B\uFF0C\u4EC5 Medium / XHigh \u4E24\u6863\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF0C\u975E\u663E\u5F0F\u5173\u95ED\uFF09\uFF0C128K / 16,384 \u8F93\u51FA\u30022026-10 \u65B0\u589E\u6761\u76EE\u3002"},{id:"openai-chat",patterns:["gpt-5.1-chat-latest","gpt-5.3-chat-latest","gpt-5-chat-latest","gpt-chat-latest","gpt-5-chat","gpt-5.1-chat","gpt-5.3-chat"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"-chat \u7CFB\u5217\uFF08\u5B98\u65B9 id \u4E3A gpt-5.x-chat-latest\uFF09\u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 16,384 \u8F93\u51FA\u3002gpt-5-chat-latest \u5DF2\u4E8E 2026-07-23 \u4E0B\u67B6\u3001gpt-chat-latest \u5DF2\u65E0\u5B98\u65B9\u9875\u9762\uFF08\u4FDD\u7559\u6A21\u5F0F\u4F9B\u7F51\u5173\uFF09\u3002gpt-5.2-chat \u53E6\u6709\u63A8\u7406\u6761\u76EE\u3002"},{id:"openai-o",patterns:["o1","o3","o4"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:1e5,note:"OpenAI o \u7CFB\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u5B98\u65B9\u5DF2\u4E8E 2026-06 \u516C\u544A\u9000\u5F79\uFF08o1/o1-pro/o3-mini/o4-mini 2026-10-23 \u79FB\u9664\u3001o3/o3-pro 2026-12-11\uFF09\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1B\u591A\u6570 o \u7CFB\u7AEF\u70B9\u6536\u56FE\uFF08o3-mini \u4F8B\u5916\uFF09\u3002"},{id:"openai-gpt-oss",patterns:["gpt-oss"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:131072,maxTokens:131072,note:"GPT-OSS \u5F00\u6E90\u6743\u91CD\uFF08Ollama/vLLM \u5E38\u89C1\uFF09\uFF1Areasoning effort Low / Medium / High\uFF0C\u7EAF\u6587\u672C\uFF0C131K \u4E0A\u4E0B\u6587 / 131K \u8F93\u51FA\u30022026-09 \u590D\u6838\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u73B0\u5728\u5199 Chat Completions = Not supported\u3001\u65E0\u56FE\u7247\u8F93\u5165\uFF08\u9ED8\u8BA4 Low \u6765\u81EA\u5B98\u65B9 CLI\uFF0C\u4E0D\u662F API \u9875\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u4E0D\u518D\u58F0\u660E Off\u3002"},{id:"openai-gpt-6",patterns:["gpt-6-luna","gpt-6-sol","gpt-6-terra","gpt-6.1"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:'GPT-6 \u7CFB\uFF08luna/sol/terra\uFF0C2026-10 \u6821\u51C6\u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u5168\u6863 None / Low / Medium / High / XHigh / Max\uFF0C\u5E26\u56FE\u8F93\u5165\uFF0C272,000 \u4E0A\u4E0B\u6587 / 128,000 \u8F93\u51FA\u3002gpt-6-astra \u89C1\u5355\u72EC\u6761\u76EE\uFF08\u88F8 "gpt-6" \u4E0E 6.1-sol \u7531 astra \u6761\u76EE\u627F\u63A5\uFF0Coff \u4EE5\u7701\u7565\u8868\u8FBE\uFF0C"none" \u672A\u8BC1\u5B9E\u53EF\u624B\u8C03\uFF09\u3002'},{id:"openai-gpt-6-astra",patterns:["gpt-6-astra","gpt-6","gpt-6.1-sol"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:'GPT-6 Astra \u6863\u4F4D\uFF1ALow / Medium / High / XHigh / Max\u2014\u2014**\u6CA1\u6709 None \u6863**\uFF08\u5B98\u65B9\u539F\u6587\uFF1A\u8BBE\u4E3A none \u8FD4\u56DE HTTP 400\uFF09\uFF0C\u56E0\u6B64\u672C\u6761\u76EE\u4E0D\u58F0\u660E Off\u3002\u5E26\u56FE\u8F93\u5165\uFF1B2026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002\u5DE5\u5177\u8C03\u7528\u9700\u8D70 Responses API\u3002gpt-6 luna/sol/terra \u89C1\u5355\u72EC\u6761\u76EE\uFF1B\u88F8 "gpt-6" \u4E0E 6.1-sol\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\u7531\u672C\u6761\u76EE\u627F\u63A5\u3002'},{id:"openai-gpt-daybreak",patterns:["gpt-daybreak"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-Daybreak\uFF08blue-latest 1.05M / red-latest 400K\uFF0C2026-10 \u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u5168\u6863 None / Low / Medium / High / XHigh / Max\uFF0C\u5E26\u56FE\u8F93\u5165 / 128,000 \u8F93\u51FA\u3002"},{id:"openai-gpt-realtime",patterns:["gpt-realtime"],efforts:{minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:128e3,maxTokens:32e3,note:"GPT-Realtime 2.1\uFF082026-10 \u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u6863\u4F4D Minimal / Low / Medium / High / XHigh\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF0C128,000 \u4E0A\u4E0B\u6587 / 32,000 \u8F93\u51FA\u3002"},{id:"openai-gpt-5-6-cyber",patterns:["gpt-5.6-cyber"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.6-Cyber\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF08\u4E0D\u7B49\u4E8E\u4E0D\u652F\u6301\uFF09\uFF0C\u6545\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High / XHigh\uFF1B\u8BE5\u578B\u53F7\u4EC5 Responses API\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K \u4E0A\u4E0B\u6587\u3002\u5B98\u65B9\u652F\u6301\u7684\u5176\u4ED6\u6863\u4F4D\u53EF\u624B\u8C03\u540E\u5E94\u7528\u3002"},{id:"openai-gpt-4o",patterns:["gpt-4o"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"GPT-4o \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u56FE\u7247\u8F93\u5165\u5168\u7CFB\u6807\u914D\uFF0C128K / 16,384 \u8F93\u51FA\u3002"},{id:"openai-gpt-4-1",patterns:["gpt-4.1"],efforts:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,note:"GPT-4.1 \u5168\u7CFB\uFF08\u542B mini/nano\uFF09\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF1B\u5B98\u65B9 1,047,576 \u4E0A\u4E0B\u6587 / 32,768 \u8F93\u51FA\uFF0C\u5168\u7CFB\u5E26\u56FE\u8F93\u5165\u3002"},{id:"openai-gpt-4-turbo-preview",patterns:["gpt-4-turbo-preview"],efforts:!1,input:["text"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo Preview\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u7EAF\u6587\u672C\u8F93\u5165\uFF08\u6B63\u5F0F turbo \u5FEB\u7167\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u4E0B\u6761\uFF09\uFF0C128K\u3002"},{id:"openai-gpt-4-turbo",patterns:["gpt-4-turbo"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 4,096 \u8F93\u51FA\u3002"},{id:"openai-gpt",patterns:["gpt-4","gpt-3.5"],efforts:!1,input:["text"],note:"GPT-4/3.5 \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\u3002gpt-4-turbo/4.1 \u8D77\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\uFF1B\u65B0\u4EE3\u8BF7\u7528 GPT-5 \u7CFB\uFF08\u89C1 openai-chat/gpt-5.x \u6761\u76EE\uFF09\u3002"},{id:"anthropic-claude-5-5",patterns:["claude-haiku-5.5","claude-opus-5-5","claude-sonnet-5-5","haiku-5.5","claude-5-5"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 5.5 \u4EE3\uFF08Haiku 5.5 / Opus 5.5 / Sonnet 5.5\uFF09\uFF1Api-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u5168\u6863 Low / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF0C\u81EA\u9002\u5E94\u601D\u8003\uFF0C1M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\u3002off/minimal \u4EE5\u7701\u7565\u8868\u8FBE\uFF08\u76EE\u5F55\u5C06\u4E24\u952E\u8BB0\u4E3A null\uFF0C\u975E\u663E\u5F0F\u5173\u95ED\uFF09\u3002"},{id:"anthropic-claude-5",patterns:["claude-fable-5","claude-mythos-5","claude-opus-5","claude-sonnet-5"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 5 \u4EE3\uFF08Fable 5 / Mythos 5 / Opus 5 / Sonnet 5\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u5DF2\u6536\u7D27\u4E3A XHigh / Max\uFF08low/medium/high \u6863\u5DF2\u4ECE\u8BE5\u4EE3 effort \u76EE\u5F55\u79FB\u9664\uFF1BFable 5 \u4E0E Opus 5 \u53E6\u63A5\u53D7\u4EE5\u7701\u7565\u8868\u8FBE\u7684 off\uFF0CSonnet 5 \u65E0 off\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF08Batch 300K\uFF09\u3002\u5B98\u65B9\u652F\u6301 PDF \u8F93\u5165\u3002\u6CE8\u610F\uFF1AAnthropic \u5B98\u65B9 OpenAI \u517C\u5BB9\u5C42\u4F1A\u5FFD\u7565 effort \u53C2\u6570\uFF0C\u58F0\u660E\u5728\u7B2C\u4E09\u65B9\u7F51\u5173\u6620\u5C04\u65F6\u751F\u6548\u3002"},{id:"anthropic-claude-5-1",patterns:["claude-fable-5-1","claude-mythos-5-1"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Fable 5.1 / Mythos 5.1\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u76EE\u5F55\u6863\u4F4D XHigh / Max\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF0C\u81EA\u9002\u5E94\u601D\u8003\u5E38\u5F00\uFF08\u4E0D\u63A5\u53D7 enabled/disabled\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF1BFable 5.1 \u652F\u6301\u4F1A\u8BDD\u4E2D\u9014\u6539\u6863\uFF08\u9700 beta header\uFF0C\u672C\u63D2\u4EF6\u4E0D\u6D89\u53CA\uFF09\u3002"},{id:"anthropic-claude-mythos-preview",patterns:["claude-mythos-preview"],efforts:{low:"low",medium:"medium",high:"high",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Mythos Preview\uFF1A\u5B98\u65B9\u6863\u4F4D Low / Medium / High / Max\uFF08\u65E0 XHigh\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3002pi-ai 1.2.0 \u76EE\u5F55\u65E0 mythos \u6761\u76EE\uFF0C\u672C\u6863\u4F4D\u6CBF\u7528\u5B98\u65B9 effort \u77E9\u9635\u3002"},{id:"anthropic-claude-opus-4-high",patterns:["claude-opus-4-8","claude-opus-4-7"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Opus 4.7/4.8\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u6863\u4F4D\u4EC5 XHigh / Max\uFF08low/medium/high \u5DF2\u4ECE\u8BE5\u4EE3\u76EE\u5F55\u79FB\u9664\uFF1Bxhigh \u4E3A\u5B98\u65B9\u63A8\u8350\u7684\u7F16\u7801\u8D77\u6B65\u6863\uFF09\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-4-6",patterns:["claude-opus-4-6","claude-sonnet-4-6"],efforts:{max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 4.6 \u4EE3\uFF08Opus 4.6 / Sonnet 4.6\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u4EC5\u5269 Max \u4E00\u6863\uFF08low/medium/high/xhigh \u5747\u5DF2\u4ECE\u76EE\u5F55\u79FB\u9664\uFF09\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-opus-4-5",patterns:["claude-opus-4-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude Opus 4.5\uFF1A\u5B98\u65B9 effort \u652F\u6301\u5217\u8868\uFF0820251101 \u5FEB\u7167\uFF09\uFF0C\u6863\u4F4D Low / Medium / High\uFF08\u65E0 XHigh/Max\uFF09\uFF0C\u53EF\u4E0E budget_tokens \u5E76\u7528\uFF1B200K / 64K\u3002"},{id:"anthropic-claude",patterns:["claude"],efforts:!1,input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude 3.x \u4E0E Sonnet 4.5 / Haiku 4.5\uFF1A\u5B98\u65B9 effort \u53C2\u6570\u4E0D\u652F\u6301\uFF08\u4EC5 5.5/5/5.1 \u4EE3\u3001Opus 4.5/4.6/4.7/4.8\u3001Sonnet 4.6 \u652F\u6301\uFF09\uFF0C\u601D\u8003\u7531 thinking.type \u63A7\u5236\u2014\u2014\u52FF\u52FE\u601D\u8003\u6863\u3002\u53C2\u8003\u5BB9\u91CF 200K / 64K\uFF08Haiku 3.5 \u4E3A\u7EAF\u6587\u672C\uFF0C\u6309\u9700\u53D6\u6D88\u56FE\u7247\uFF09\u3002Haiku 5.5 \u53CA\u6574\u4E2A 5.5 \u4EE3\u89C1\u4E0A\u65B9 anthropic-claude-5-5 \u6761\u76EE\u3002"},{id:"google-gemini",patterns:["gemini"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:65536,note:"Gemini \u901A\u7528\u5B89\u5168\u6863\uFF1ALow / Medium / High\uFF08\u5B98\u65B9 OpenAI \u517C\u5BB9\u6620\u5C04\u8868\u53E6\u6536 minimal\uFF1A2.5 \u7CFB\u6620\u5C04\u4E3A 1,024 \u9884\u7B97\u30013.1 Flash-Lite/3 Flash \u539F\u751F minimal\u30013.1 Pro \u843D low\uFF09\u3002none \u4EC5\u80FD\u5173 2.5 \u975E Pro\uFF1B2.5 Pro \u4E0E 3 \u4EE3\u4E0D\u53EF\u5173\uFF1B\u5404\u578B\u9ED8\u8BA4\u4E0D\u4E00\uFF08flash-lite \u9ED8\u8BA4\u5173\uFF09\u3002\u5B98\u65B9\u53E6\u6536\u97F3\u9891/\u89C6\u9891/PDF\u3002Gemma-4 \u89C1\u4E0B\u6761\u3002"},{id:"google-gemma-4",patterns:["gemma-4"],efforts:{off:null,minimal:"MINIMAL",high:"HIGH"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,maxTokens:32768,note:"Gemma 4\uFF0826b/31b-it\uFF09\uFF1A\u4E09\u6863 Minimal / High\uFF08\u6863\u4F4D\u7EBF\u4E3A\u5B98\u65B9\u5927\u5199\u679A\u4E3E\u62FC\u5199\uFF09\uFF0Coff \u4EE5\u7701\u7565\u8868\u8FBE\uFF1BLow/Medium \u4E0D\u88AB\u63A5\u53D7\u3002\u5E26\u56FE\u8F93\u5165\uFF0C262,144 / 32,768\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"xai-grok-4-7",patterns:["grok-4.7"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,maxTokens:5e5,note:'Grok 4.7\uFF1A\u6863\u4F4D Low / Medium / High / XHigh\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF08off \u4EC5\u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C500K \u4E0A\u4E0B\u6587 / 500K \u8F93\u51FA\uFF082026-10 \u6821\u51C6\uFF1Api-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u786E\u8BA4\u6863\u4F4D\u4E0E\u5BB9\u91CF\uFF0C"\u4E0A\u6E38 404"\u4E0E"\u6863\u4F4D\u672A\u8BC1\u5B9E"\u4E24\u6761\u65E7\u8BB0\u5F55\u4F5C\u5E9F\uFF09\u3002grok-4.5 \u4F20 xhigh \u88AB\u9759\u9ED8\u6309 High \u5904\u7406\u7684\u8BF4\u660E\u89C1\u5176\u6761\u76EE\u3002'},{id:"xai-grok-high",patterns:["grok-4.6"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:'Grok 4.6 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3001500K \u4E0A\u4E0B\u6587\u3002Grok 4.7 \u89C1\u4E0A\u4E00\u6761\uFF08\u6B64\u524D\u8BB0\u4E3A"\u4E0D\u5B58\u5728"\uFF0C\u5DF2\u968F\u53D1\u5E03\u4F5C\u5E9F\uFF09\u3002'},{id:"xai-grok-4-5",patterns:["grok-4.5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:"Grok 4.5 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4)\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3002\u4F20\u5165 xhigh \u4F1A\u88AB\u5B98\u65B9\u9759\u9ED8\u6309 High \u5904\u7406\u3002"},{id:"xai-grok-4-3",patterns:["grok-4.3"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,maxTokens:3e4,note:"Grok 4.3\uFF1A\u5B98\u65B9\u56DB\u7EA7 reasoning effort\uFF08None / Low(\u9ED8\u8BA4) / Medium / High\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 30,000 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\uFF1AXHigh \u6863\u6309 pi-ai 1.2.0 \u76EE\u5F55\u79FB\u9664\u2014\u2014\u5B83\u81EA 4.6 \u8D77\u624D\u52A0\u5165\uFF1B\u5E26\u56FE\u8F93\u5165\uFF09\u3002grok-4-fast \u7B49\u65E7 slug 2026-05-15 \u8D77\u81EA\u52A8\u91CD\u5B9A\u5411\u5230\u672C\u578B\u53F7\u3002"},{id:"xai-grok",patterns:["grok"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"Grok \u901A\u7528\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u521D\u4EE3 grok-4\u3001grok-4.20 \u4E0E grok-build-0.1 \u4E0D\u63A5\u53D7\u8BE5\u53C2\u6570\uFF08grok-4 \u7CFB\u4E0E grok-3 \u5DF2\u4E8E 2026-05-15 \u9000\u5F79\u5E76\u91CD\u5B9A\u5411\u81F3 4.3\uFF09\uFF1Bgrok-4.20-multi-agent \u7684\u56DB\u6863\u63A7\u5236\u7684\u662F agent \u6570\u91CF\u800C\u975E\u601D\u8003\u6DF1\u5EA6\u3002\u65B0\u65E7\u4EE3\u9645\u8BF7\u4F18\u5148\u9009 4.5/4.6/4.3\uFF1B\u591A\u6A21\u6001\u53D8\u4F53\u6309\u9700\u52FE\u9009\u56FE\u7247\u3002"},{id:"mistral-magistral",patterns:["magistral"],efforts:{off:"none",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,maxTokens:16384,note:'Magistral\uFF08magistral-medium-latest\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u76EE\u5F55\u663E\u793A\u73B0\u5F79 magistral \u8D70 mistral-conversations \u534F\u8BAE\u5E76\u63A5\u53D7 effort\uFF08None / High \u4E24\u6863\uFF0C\u9ED8\u8BA4 None\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\uFF0C262,144 / 16,384\u3002\u65E9\u524D"\u8BE5\u7EBF\u65E0 effort \u53C2\u6570\u4E14\u5DF2\u5F03\u7528"\u7684\u8BB0\u5F55\u4F5C\u5E9F\u3002'},{id:"mistral-medium-3",patterns:["mistral-medium-3.5","mistral-large-4","mistral-medium-2604","mistral-medium-latest","mistral-small-latest","mistral-small-2603"],efforts:{off:"none",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"Mistral \u73B0\u5F79\u63A8\u7406\u6863\uFF082026-10 \u6269\u5145\uFF09\uFF1ANone / High \u4E24\u6863\uFF0C\u5B98\u65B9 reasoning_effort \u679A\u4E3E\u5373 none/high\uFF1B\u73B0\u5F79\u578B\u53F7 mistral-large-4\uFF081M\uFF09\u3001mistral-medium-3.5\uFF082604/latest\uFF09\u3001mistral-small-2603\uFF08Small 4\uFF09\u7ECF\u5B83\u63A7\u5236\uFF0C\u5747\u5E26\u89C6\u89C9\u3002\u5BB9\u91CF\uFF1Alarge-4 262,144 \u8F93\u51FA\u3001medium 262,144 \u8F93\u51FA\u3001small 256,000 \u8F93\u51FA\uFF08\u4E0A\u4E0B\u6587\u5747 262,144\uFF09\u3002\u975E\u63A8\u7406\u65E7\u6B3E\u89C1\u4E0B\u6761\u3002"},{id:"mistral-legacy",patterns:["mistral-large-2411","mistral-large-latest","mistral-large-2512","mistral-medium-2505","mistral-medium-2508","mistral-small-2506","mistral-nemo","devstral","ministral","codestral","pixtral","voxtral"],efforts:!1,input:["text","image"],note:"Mistral \u975E\u63A8\u7406\u7EBF\uFF082026-10 \u65B0\u589E\u6761\u76EE\uFF09\uFF1Alarge-2411/2512/latest\u3001medium-2505/2508\u3001small-2506\u3001nemo \u53CA devstral/ministral/codestral/pixtral/voxtral \u7B49\u4E13\u7528\u7EBF\u5747\u4E0D\u63A5\u53D7 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\u3002\u591A\u6570\u73B0\u5F79\u6B3E\u5E26\u89C6\u89C9\uFF08large-2411 \u4E3A\u7EAF\u6587\u672C\uFF09\u3002"},{id:"qwen-vision",patterns:["qwen-vl","qwen2-vl","qwen2-5-vl","qwen3-vl","qvq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text","image"],contextWindow:131072,maxTokens:8192,note:"\u901A\u4E49\u89C6\u89C9\u7EBF\uFF08Qwen-VL/QvQ\uFF09\uFF1Aenable_thinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002qwen3-vl \u5BB9\u91CF\u66F4\u5927\uFF0C\u6309\u9700\u4E0A\u8C03\u3002"},{id:"qwen-3-8",patterns:["qwen3.8"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,note:"Qwen 3.8 \u7CFB\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\u95ED\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08qwen3.8-max \u56FE\u50CF/\u89C6\u9891\u7406\u89E3\uFF0C\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u30021M \u6863\u4E0A\u4E0B\u6587\u300227B \u4E0E Flash-Next \u5F00\u6E90\u6B3E\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"qwen-3-8-27b",patterns:["qwen3.8-27b"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-27B\uFF08dense\uFF0C2026-08-14 \u5F00\u6E90\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\uFF1B\u539F\u751F\u56FE\u50CF+\u89C6\u9891\u7406\u89E3\uFF08\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u5B98\u65B9\u58F0\u660E\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF Qwen/Qwen3.8-27B \u6A21\u578B\u5361\u3002"},{id:"qwen-3-8-flash-next",patterns:["qwen3.8-flash-next"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-Flash-Next\uFF08125B-A6B \u5B9E\u9A8C\u67B6\u6784\uFF0CQwen4 \u524D\u8EAB\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low + enable_thinking \u5F00\u5173\uFF1B\u539F\u751F\u89C6\u89C9\uFF08Vision Encoder\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF \u6A21\u578B\u5361\u4E0E qwen.ai \u5B98\u65B9\u535A\u5BA2\u3002"},{id:"qwen",patterns:["qwen","qwq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text"],contextWindow:1e6,maxTokens:65536,note:"\u901A\u4E49\u5343\u95EE\uFF1Aenable_thinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1B\u73B0\u5F79\u65D7\u8230\u4E3A qwen3.8 \u7CFB\uFF081M \u6863\u4E0A\u4E0B\u6587\uFF0C\u89C1 qwen-3-8 \u6761\u76EE\uFF09\u30023.6/3.7 \u4EE3\u7684 Plus/Flash \u4EA6\u9ED8\u8BA4\u591A\u6A21\u6001\uFF08\u56FE\u7247/\u89C6\u9891\uFF09\uFF0C\u5982\u63A5\u5165\u8BF7\u6309\u9700\u52FE\u9009\u56FE\u7247\uFF1B\u89C6\u89C9\u7EBF\u89C1 qwen-vision \u6761\u76EE\u3002"},{id:"glm-vision",patterns:["glm-4v","glm-4-6v","glm-4-5v","glm-5v"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text","image"],contextWindow:131072,maxTokens:32768,note:"\u667A\u8C31\u89C6\u89C9\u7EBF\uFF08GLM-4V/4.5V/4.6V/5V\uFF09\uFF1Athinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF08\u4F20 disabled \u62A5\u9519\uFF0C\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002"},{id:"glm-5-3-flash",patterns:["glm-5.3-flash","glm-5.3-flashx"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3-Flash\uFF08320B\uFF0C\u5B98\u65B9\u6587\u6863 vlm \u5206\u7C7B\uFF09\uFF1A\u5F3A\u5236\u601D\u8003\uFF08thinking.type \u4EC5 enabled\uFF0C\u4E0D\u652F\u6301\u5173\u95ED\uFF09\uFF0C\u6587\u672C\u53C2\u6570\u4E0E GLM-5.3 \u4E00\u81F4\u2014\u2014\u6863\u4F4D Low / High / Max\u3002\u8F93\u5165\u6A21\u6001\uFF1A\u89C6\u9891\u3001\u56FE\u50CF\u3001\u6587\u672C\u3001\u6587\u4EF6\uFF08\u89C6\u9891/\u6587\u4EF6\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF0C\u56FE\u7247\u53EF\u52FE\uFF09\u3002\u5B98\u65B9 1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3002\u6765\u6E90\uFF1Adocs.bigmodel.cn \u6A21\u578B\u9875\u3002"},{id:"glm-5-3",patterns:["glm-5.3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3 \u6863\u4F4D\uFF1ALow / High / Max\uFF08\u5F3A\u5236\u601D\u8003\uFF0C\u5176\u4F59\u503C\u62A5\u9519\uFF09\u3002\u5B98\u65B9\u5BB9\u91CF 1M / 128K\u3002"},{id:"glm-5-2",patterns:["glm-5.2"],efforts:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.2 \u6863\u4F4D\uFF1ANone / Minimal / Low / Medium / High / XHigh / Max\uFF08\u5B98\u65B9\u6620\u5C04\uFF1ALow\xB7Medium\u2192High\u3001XHigh\u2192Max\u3001None\xB7Minimal=\u505C\u6B62\u601D\u8003\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"glm",patterns:["glm","zhipu","chatglm"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text"],note:"GLM \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1Beffort \u9636\u68AF\u4EC5 GLM-5.2+ \u652F\u6301\uFF08\u89C1\u4E0A\u4E24\u6761\u76EE\uFF09\u3002\u6CE8\u610F GLM-4.7/GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF0C\u4F20 disabled \u4F1A\u62A5\u9519\uFF08\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"kimi-k3",patterns:["kimi-k3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,note:"Kimi K3 \u6863\u4F4D\uFF1ALow / High / Max(\u9ED8\u8BA4 Max)\uFF0C\u8D70\u9876\u5C42 reasoning_effort\uFF1B\u59CB\u7EC8\u63A8\u7406\u3001\u52FF\u4F20 thinking \u5BF9\u8C61\u3002\u539F\u751F\u89C6\u89C9\u7406\u89E3\uFF0C1M \u4E0A\u4E0B\u6587\uFF08\u6700\u5927\u8F93\u51FA\u5B98\u65B9\u672A\u5355\u72EC\u5217\uFF0C\u4E0D\u63D0\u4F9B\uFF09\u3002"},{id:"kimi-k2-vision",patterns:["kimi-k2.6","kimi-k2.5"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.5/K2.6 \u89C6\u89C9\u4EE3\uFF1Athinking.type \u5F00\u5173\uFF08\u9ED8\u8BA4\u5F00\u3001\u53EF\u5173\uFF09\uFF0C\u5F00=High\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002K2.7 Code \u59CB\u7EC8\u601D\u8003\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"kimi-k27-code",patterns:["kimi-k2.7"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.7 Code\uFF08\u542B\u9AD8\u901F\u7248\uFF09\uFF1A\u59CB\u7EC8\u601D\u8003\u2014\u2014thinking.type \u4EC5\u63A5\u53D7 enabled\uFF08\u4F20 disabled \u62A5\u9519\uFF09\uFF0C\u65E0 Off \u6863\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002"},{id:"kimi-for-coding",patterns:["kimi-for-coding"],efforts:{low:"low",high:"high",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1048576,maxTokens:32768,note:"Kimi for Coding\uFF1AMoonshot \u7F16\u7801\u4E13\u7EBF\u8D70 anthropic-messages \u534F\u8BAE\u3001\u81EA\u9002\u5E94\u601D\u8003\uFF0C\u6863\u4F4D Low / High / Max\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C1M \u4E0A\u4E0B\u6587 / 32,768 \u8F93\u51FA\u3002\u9AD8\u901F\u7248\uFF08-highspeed\uFF09\u65E0 effort \u63A7\u4EF6\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"kimi-moonshot-v1-vision",patterns:["moonshot-v1-8k-vision","moonshot-v1-32k-vision","moonshot-v1-128k-vision"],efforts:!1,input:["text","image"],note:"Moonshot V1 \u89C6\u89C9\u65E7\u4EE3\uFF088k/32k/128k \u5404\u4E00\uFF09\uFF1A\u65E0\u601D\u8003\u63A7\u4EF6\uFF08\u751F\u6210\u6A21\u578B\uFF09\u3001\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF1B\u8BE5\u7EBF\u5DF2\u505C\u6B62\u5BF9\u65B0\u7528\u6237\u5F00\u653E\uFF082026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF09\u3002"},{id:"kimi",patterns:["kimi","moonshot"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text"],contextWindow:262144,note:"Kimi \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3002k2 \u7CFB\u5217 2026-05-25 \u4E0B\u7EBF\u3001kimi-latest 2026-01-28 \u4E0B\u7EBF\u3001moonshot-v1 \u7CFB 2026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF08\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1Bmoonshot-v1 \u672C\u8EAB\u975E\u601D\u8003\u6A21\u578B\uFF09\u3002\u89C6\u89C9\u4EE3\u4E0E K2.7 Code \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"hunyuan-hy3",patterns:["hy3"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u6DF7\u5143 hy3\uFF1A\u5F00\u6E90\u5951\u7EA6\u7ECF chat_template_kwargs.reasoning_effort = no_think(\u9ED8\u8BA4)/low/high\uFF1B\u5B98\u65B9\u6A21\u578B\u5361 256K \u4E0A\u4E0B\u6587\uFF08295B MoE\uFF0C2026 \u5F00\u6E90\uFF09\u3002"},{id:"hunyuan-hy4",patterns:["hy4-preview","hy-4-preview"],efforts:{off:"no_think",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},contextWindow:1e6,note:"\u6DF7\u5143 Hy4 preview\uFF1A\u5B98\u65B9 README\u2014\u2014reasoning \u9ED8\u8BA4 high\uFF08\u6DF1\u5EA6\u601D\u8003\uFF09\uFF0C\u5173\u95ED\u7ECF chat_template_kwargs.reasoning_effort=no_think\uFF1B\u5B98\u65B9\u89C4\u683C\u8868 1M \u4E0A\u4E0B\u6587\uFF08770B-A49B MoE\uFF0CGated DSA\uFF09\u3002low \u6863\u5B98\u65B9\u672A\u5217\uFF0C\u5982\u6709\u8BF7\u624B\u8C03\uFF1B\u89C6\u89C9\u672A\u58F0\u660E\uFF0C\u6309\u9700\u624B\u52FE\u3002\u6765\u6E90\uFF1ATencent-Hunyuan/Hy4-preview \u5B98\u65B9 README\u3002"},{id:"step-5-preview",patterns:["step-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,maxTokens:65536,note:'\u9636\u8DC3 Step-5-Preview\uFF08\u5B98\u65B9 id \u5373 step-5-preview\uFF0C\u65E0\u88F8 step-5\uFF1Bpattern \u53D6\u5BB6\u65CF\u4E3B\u5E72\u4EE5\u517C\u5BB9\u7F51\u5173\u5199\u6CD5\uFF09\uFF1A\u6863\u4F4D Low / Medium(\u5B98\u65B9\u6807"\u9ED8\u8BA4\u63A8\u8350") / High\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u539F\u751F\u56FE\u7247 + \u89C6\u9891\u8F93\u5165\uFF1B1M \u4E0A\u4E0B\u6587\u300164K \u6700\u5927\u8F93\u51FA\uFF08\u5B98\u65B9\u53E6\u6CE8 max_tokens \u9ED8\u8BA4 INF\u3001\u4E0E 64K \u4E0A\u9650\u5E76\u5B58\uFF0C\u4EE5\u7AEF\u70B9\u5B9E\u6D4B\u4E3A\u51C6\uFF09\u3002'},{id:"step-3-7",patterns:["step-3.7","step-3.6"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.6/3.7 \u6863\u4F4D\uFF1ALow / Medium(\u9ED8\u8BA4\u63A8\u8350) / High\uFF0C\u539F\u751F\u56FE\u7247+\u89C6\u9891\u7406\u89E3\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step-3-5",patterns:["step-3.5"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.5 Flash \u6863\u4F4D\uFF1ALow / High\uFF08\u7EAF\u6587\u672C\u63A8\u7406\u65D7\u8230\uFF09\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step",patterns:["step-3","step-2"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"\u9636\u8DC3 Step \u6863\u4F4D\uFF1ALow / Medium / High\uFF08\u9ED8\u8BA4 Medium\uFF0C\u4E0D\u53EF\u5173\u95ED\uFF09\u30023.6/3.7 \u89C6\u89C9\u4EE3\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"doubao",patterns:["doubao","seed"],efforts:{off:null,low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"\u8C46\u5305\u6863\u4F4D\uFF1AOff / Low / Medium / High\u2014\u2014effort \u9636\u68AF\u4ECD\u662F\u793E\u533A\u8BC1\u636E\u3001\u5B98\u65B9 Ark \u6587\u6863\u660E\u5217\u7684\u4E3A thinking.type \u5F00\u5173\uFF082026-08-24 \u590D\u6838\u4ECD\u672A\u89C1\u5230 effort \u5B98\u65B9\u660E\u6587\uFF09\u3002seed \u4EE3\u6536\u56FE\uFF081.5-pro \u4F8B\u5916\uFF09\u3002"},{id:"minimax-m2",patterns:["minimax-m2"],efforts:!1,input:["text"],contextWindow:204800,maxTokens:131072,note:"MiniMax-M2 / M2.5\uFF08\u542B -highspeed\uFF09\uFF1A\u65E0\u601D\u8003\u63A7\u4EF6\u3001\u65E0 effort \u53C2\u6570\uFF08M3 \u624D\u5F15\u5165 thinking \u53C2\u6570\uFF09\uFF0C\u7EAF\u6587\u672C\uFF0C204,800 / 131,072\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1BM3 \u89C1\u4E0B\u6761\uFF09\u3002"},{id:"minimax-m3",patterns:["minimax-m3"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:1048576,maxTokens:512e3,note:"MiniMax-M3\uFF1A\u5B98\u65B9 thinking \u53C2\u6570 enabled/adaptive/disabled\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3001\u5173=disabled\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08\u56FE/\u89C6\u9891\uFF0C\u6838\u5FC3\u8BCD\u8868\u4EC5\u542B\u56FE\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 512,000 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u8865\u5BB9\u91CF\uFF09\u3002"},{id:"mimo-v2-6",patterns:["mimo-v2.6","mimo-v2.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.6 \u7CFB\u5217\uFF08mimo-v2.6-pro / -flash / -pro-ultraspeed\uFF1B1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3001\u539F\u751F\u5168\u6A21\u6001\uFF09\u4E0E\u5176\u524D\u4EE3 mimo-v2.5\u3002\u5B98\u65B9\u6587\u6863\uFF1Athinking.type\uFF08enabled/disabled\uFF0C\u9ED8\u8BA4 enabled\uFF09+ reasoning.effort\uFF08none \u5173\u95ED\uFF1B\u5176\u4F59\u5408\u6CD5\u503C\u5747\u5F00\u542F\uFF0C\u4E14**\u73B0\u9636\u6BB5\u6682\u672A\u533A\u5206\u63A8\u7406\u5F3A\u5EA6**\u2014\u2014minimal \u5F52\u4E00\u4E3A low\u3001xhigh/max/ultra \u5F52\u4E00\u4E3A high\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u58F0\u660E\u7684\u662F\u7AEF\u70B9**\u63A5\u53D7**\u7684\u6863\u4F4D Off / Low / Medium / High\uFF08xhigh\u3001max \u4E0D\u58F0\u660E\uFF0C\u7AEF\u70B9\u53EA\u4F1A\u6298\u53E0\u4E3A high\uFF09\u3002\u601D\u8003\u6A21\u5F0F\u4E0B temperature / top_p \u4E0D\u53EF\u81EA\u5B9A\u4E49\uFF08\u5F3A\u5236 1.0 / 0.95\uFF09\uFF1B\u5E26\u5DE5\u5177\u8C03\u7528\u7684\u5386\u53F2\u8F6E\u5FC5\u987B\u5B8C\u6574\u56DE\u4F20 reasoning_content\uFF0C\u5426\u5219 400\u3002mimo-v2.5 \u4E0E v2.5-pro \u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"mimo-v2-5-pro",patterns:["mimo-v2.5-pro"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.5-Pro\uFF1A\u8BE5\u5BB6\u65CF\u552F\u4E00\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF08\u5B98\u65B9\u80FD\u529B\u8868\u672A\u5217\u5168\u6A21\u6001\u7406\u89E3\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\uFF0C\u63A8\u7406\u5951\u7EA6\u4E0E v2.6 \u7CFB\u5217\u76F8\u540C\uFF08thinking.type + reasoning.effort\uFF0Cnone \u5173\u95ED\u3001\u5176\u4F59\u6863\u4F4D\u6682\u4E0D\u533A\u5206\u5F3A\u5EA6\uFF09\u3002\u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"baidu-ernie",patterns:["ernie"],efforts:!1,input:["text"],contextWindow:131072,note:"\u767E\u5EA6\u5343\u5E06 ERNIE \u7CFB\uFF1A\u5B98\u65B9 OpenAI \u517C\u5BB9\u63A5\u53E3\u65E0 reasoning_effort \u53C2\u6570\u2014\u2014\u601D\u8003\u7531\u6A21\u578B\u53D8\u4F53\u51B3\u5B9A\uFF08-Thinking \u7CFB\u5217\u59CB\u7EC8\u601D\u8003\u3001\u666E\u901A\u7CFB\u5217\u4E0D\u601D\u8003\uFF09\uFF0C\u52FF\u52FE\u601D\u8003\u6863\u3002ERNIE 4.5 Turbo VL \u652F\u6301\u56FE\u7247\uFF0C\u6309\u9700\u624B\u52FE\uFF1B\u53C2\u8003\u5BB9\u91CF\u53D6 Turbo 128K \u6863\u3002"},{id:"fireworks-ember",patterns:["ember-1"],efforts:{off:"none",low:"low",medium:"medium",high:"high",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"Fireworks ember-1\uFF1Aanthropic-messages \u534F\u8BAE\u81EA\u9002\u5E94\u601D\u8003\uFF0C\u6863\u4F4D None(\u5173) / Low / Medium / High / Max\uFF08off \u663E\u5F0F none \u62FC\u5199\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C1M \u4E0A\u4E0B\u6587 / 131,072 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"thinkingmachines-inkling",patterns:["inkling"],efforts:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:524288,maxTokens:131072,note:"Thinking Machines Inkling\uFF1A\u5168\u6863 Minimal / Low / Medium(\u9ED8\u8BA4) / High / XHigh / Max\uFF0Coff \u663E\u5F0F none\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C512K \u4E0A\u4E0B\u6587 / 131,072 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1Btogether \u4E2D\u7EE7\u4FA7 effort \u53C2\u6570\u672A\u5F00\u653E\uFF0C\u9700\u652F\u6301\u65B9\u8F6C\u53D1\uFF09\u3002"},{id:"antling-ring",patterns:["ring-2.6"],efforts:{high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,maxTokens:65536,note:"\u8682\u8681 Ling Ring-2.6-1T\uFF1A\u6863\u4F4D High / XHigh\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B262,144 / 65,536\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"antling-ling",patterns:["ling-2.6"],efforts:!1,input:["text"],note:"\u8682\u8681 Ling-2.6\uFF08\u542B -flash\uFF09\uFF1A\u975E\u601D\u8003\u6A21\u578B\uFF0C\u65E0 effort \u63A7\u4EF6\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1BRing-2.6 \u601D\u8003\u7EBF\u89C1\u4E0A\u6761\uFF09\u3002"}],br={off:null,low:"low",medium:"medium",high:"high"},tl={"openai-completions":br,"openai-responses":br,"anthropic-messages":br,deepseek:{off:"none",low:"low",high:"high",max:"max"}},nl={low:"low",medium:"medium",high:"high"};function Rt(e){return(e??"").toLowerCase().trim()}function ui(e){return e!==void 0&&/[a-z0-9]/.test(e)}function At(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g," ")}function mi(e,t,n){let r=t===0?void 0:e[t-1],o=e[t+n];return!ui(r)&&!ui(o)}function wr(e,t){let n=At(e)+" "+At(t??""),r;for(let o of el)for(let i of o.patterns){let s=At(i),a=n.indexOf(s);for(;a>=0;){if(mi(n,a,s.length)){(r===void 0||s.length>r.length)&&(r={entry:o,length:s.length});break}a=n.indexOf(s,a+1)}}return r?.entry}var rl={"deepseek.com":"deepseek","anthropic.com":"anthropic-messages"};function ol(e){let t=Rt(e.api);if(t.length>0)return t;let n=e.baseURL;if(n!==void 0&&n.length>0)try{let o=new URL(n).hostname.toLowerCase().split(".");if(o.length>=2){let i=rl[o.slice(-2).join(".")];if(i!==void 0)return i}}catch{}return"openai-completions"}var ln="openai-completions",gi="anthropic-messages";function yr(e){if(e===void 0||e.length===0)return!1;let t="";try{t=new URL(e).hostname.toLowerCase()}catch{return!1}return t==="localhost"||t==="::1"||t.endsWith(".local")||t.endsWith(".internal")||/^(127\.|10\.|192\.168\.)/.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t)?!0:t.includes(":")}function il(e,t){let n=Rt(t),r={...e};if(delete r.supportsMidConvoEffort,delete r.allowedFallbackModels,n===gi){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"])delete r[o];return r.forceAdaptiveThinking===void 0?void 0:{forceAdaptiveThinking:r.forceAdaptiveThinking}}if(n===ln)return delete r.forceAdaptiveThinking,Object.keys(r).length===0?void 0:r}function sl(e,t){let n=Rt(t.api);if(n===ln){let r=e.compat;return r!==void 0&&(r=il(r,n)??void 0),r===void 0&&!yr(t.baseURL)?void 0:r===void 0?{thinkingTokenBudgetField:"thinking_token_budget"}:r.thinkingTokenBudgetField===void 0&&r.supportsThinkingTokenBudget!==!0&&yr(t.baseURL)?{...r,thinkingTokenBudgetField:"thinking_token_budget"}:r}if(n===gi&&e.anthropicAdaptive===!0)return{forceAdaptiveThinking:!0}}var al=["openai.com","openai.azure.com","deepseek.com","openrouter.ai","z.ai","bigmodel.cn","moonshot.ai","moonshot.cn","aliyuncs.com","anthropic.com","x.ai","together.ai","together.xyz","nvidia.com","cerebras.ai","cloudflare.com","chutes.ai","opencode.ai","ant-ling.com"];function vr(e){if(Rt(e.api)!==ln)return!1;let t=e.baseURL;if(t===void 0||t.length===0)return!1;try{let n=new URL(t).hostname.toLowerCase();return n.includes(".")?!al.some(r=>n===r||n.endsWith("."+r)):!1}catch{return!1}}function fi(e,t,n){return e===void 0||!n||e.supportsDeveloperRole!==void 0||!vr(t)?e:{...e,supportsDeveloperRole:!1}}var ci={off:null,low:"low",medium:"medium",high:"high"},dl=["vl","vision","omni","4o","pixtral","internvl"];function xr(e){let t=At(e);for(let n of dl){let r=At(n),o=t.indexOf(r);for(;o>=0;){if(mi(t,o,r.length))return["text","image"];o=t.indexOf(r,o+1)}}}function ll(e){if(e===void 0)return;let t=e.map(n=>n.toLowerCase());if(t.some(n=>Zd.includes(n)))return t.includes("image")?["text","image"]:["text"]}function ke(e,t,n){let r=wr(e,t.displayName),o,i,s,a;r?.input!==void 0&&(o=r.input,i="knowledge"),r?.contextWindow!==void 0&&(s=r.contextWindow),r?.maxTokens!==void 0&&(a=r.maxTokens);let d=ll(n?.input);if(d!==void 0&&(o=d,i="endpoint"),n?.contextLength!==void 0&&Number.isFinite(n.contextLength)&&n.contextLength>0&&(s=n.contextLength),o===void 0){let h=xr(e);h!==void 0&&(o=h,i="heuristic")}let l={...o===void 0?{}:{input:o},...i===void 0?{}:{inputSource:i},...s===void 0?{}:{contextWindow:s},...a===void 0?{}:{maxTokens:a}},p=n===void 0?{}:{endpoint:{reasoning:n.reasoning,source:n.source}};if(n?.reasoning===!1)return{efforts:!1,matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"high",...p,...l};if(r!==void 0){let h=fi(sl(r,t),t,r.efforts!==!1);return{efforts:r.efforts,...r.efforts!==!1&&r.defaultEffort!==void 0&&r.efforts[r.defaultEffort]!==void 0?{defaultEffort:r.defaultEffort}:{},...h===void 0?{}:{compat:h},matched:!0,entryId:r.id,source:r.id,confidence:"high",...p,...l}}let g=ol(t),c=tl[g]??nl,u=Rt(t.api)===ln?{thinkingFormat:"openai",supportsReasoningEffort:!0}:void 0,f=u!==void 0&&yr(t.baseURL)?{...u,thinkingTokenBudgetField:"thinking_token_budget"}:u,m=fi(f,t,!0);return n?.reasoning===!0?{efforts:{...ci},...ci.medium!==void 0?{defaultEffort:"medium"}:{},...m===void 0?{}:{compat:m},matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"medium",...p,...l}:{efforts:c,...c.medium!==void 0?{defaultEffort:"medium"}:{},...m===void 0?{}:{compat:m},matched:!1,source:"protocol:"+g,confidence:"low",...p,...l}}var bi="dsh-model-think-level.slider.efforts",Er="breSelectWired";function kr(e){return typeof e=="object"&&e!==null&&e.ok===!1}function Tr(e){if(!kr(e))return;let t=e.error,n=typeof t?.code=="string"?t.code:"settings/rejected",r=typeof t?.message=="string"?t.message:"";return r.length>0?`${n}: ${r}`:n}function $e(e,t){return`${e}/${t}`}function yi(){try{let e=window.localStorage.getItem(bi);if(e===null)return{};let t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t))r.length>0&&typeof o=="string"&&o.trim().length>0&&(n[r]=o);return n}catch{return{}}}function ul(e){try{window.localStorage.setItem(bi,JSON.stringify(e))}catch{}}function fl(e,t,n){let r=yi();r[$e(e,t)]=n,ul(r)}function cl(e,t){return yi()[$e(e,t)]}function un(e,t,n){let o=e.groups.find(i=>i.id===t)?.models.find(i=>i.id===n)?.reasoning?.efforts;return o===void 0?[]:o.map(i=>i.id)}function pl(e,t,n){return e.groups.find(o=>o.id===t)?.models.find(o=>o.id===n)?.reasoning?.defaultEffort}function ml(e){if(!(e.length<2))return e[Math.floor((e.length-1)/2)]}function gl(e,t){return e===null||e.provider!==t.provider||e.model!==t.model}async function hi(e,t,n,r,o){let i=un(e,t,n);if(i.length===0)return;let s=$e(t,n),a=r.get(s);if(a!==void 0&&i.includes(a))return a;let d=await o?.configuredEffort?.(t,n);if(d!==void 0&&i.includes(d))return d;let l=cl(t,n);if(l!==void 0&&i.includes(l))return l;let p=ke(n,{}).defaultEffort;if(p!==void 0&&i.includes(p))return p;let g=pl(e,t,n);return g!==void 0&&i.includes(g)?g:ml(i)}function wi(e,t){let n=e;if(n[Er]===!0)return()=>{};let r=Object.prototype.hasOwnProperty.call(n,"select"),o=e.select,i=new Map,s=new Set,a=new Map,d=3,l=0,p=async u=>{let f=++l;if(u.reasoningEffort!==void 0){let b=await o.call(e,u);return!kr(b)&&we()&&(i.set($e(u.provider,u.model),u.reasoningEffort),fl(u.provider,u.model,u.reasoningEffort)),b}let m=e.store.getSnapshot();if(!gl(m.current,u)){if(we()){let b=$e(u.provider,u.model);i.delete(b),s.add(b)}return o.call(e,u)}if(!we())return o.call(e,u);let h=await hi(m,u.provider,u.model,i,t),v=e.store.getSnapshot();if(!(l!==f||((b,A)=>b===null||A===null?b!==A:b.provider!==A.provider||b.model!==A.model||b.reasoningEffort!==A.reasoningEffort)(v.current,m.current)))return!we()||h===void 0||!un(v,u.provider,u.model).includes(h)?o.call(e,u):o.call(e,{...u,reasoningEffort:h})},g=()=>{let u=e.store.getSnapshot(),f=u.current;if(f===null||f.reasoningEffort!==void 0||!we())return;let m=$e(f.provider,f.model);if(s.has(m))return;if(un(u,f.provider,f.model).length===0){s.add(m);return}s.add(m);let h=l;hi(u,f.provider,f.model,i,t).then(async v=>{if(v===void 0){s.delete(m);return}if(!we()){s.delete(m);return}let x=e.store.getSnapshot(),b=x.current;if(l!==h||b===null||b.reasoningEffort!==void 0||$e(b.provider,b.model)!==m||!un(x,b.provider,b.model).includes(v))return;let A=await o.call(e,{provider:b.provider,model:b.model,reasoningEffort:v});if(kr(A))throw A}).catch(()=>{let v=(a.get(m)??0)+1;a.set(m,v),v<d&&(s.delete(m),g())})},c=e.store.subscribe(g);return g(),n[Er]=!0,e.select=p,()=>{delete n[Er],c(),r?e.select=o:delete n.select}}var C=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function vi(e){let t=e.toLowerCase();return t.includes("compat")||t.includes("thinkingtokenbudget")||t.includes("vllmpriority")||t.includes("supportsmaxoutput")}function fn(e,t){if(!C(e))return[];let n=e[t];return!C(n)||!Array.isArray(n.models)?[]:n.models.filter(C)}function Ve(e,t){if(!C(e))return{};let n=e[t];if(!C(n))return{};let r=typeof n.api=="string"?n.api:void 0,o=typeof n.baseURL=="string"?n.baseURL:void 0,i=typeof n.displayName=="string"?n.displayName:void 0;return{api:r,baseURL:o,displayName:i}}var Ke=(e,t)=>typeof e[t]=="boolean";function hl(e,t){if(Array.isArray(e)){for(let n of e)if(C(n)&&n.id===t)return n}}function bl(e){if(!C(e))return{reasoning:"unknown",source:null};let t=e.supported_features;if(Array.isArray(t)&&t.includes("reasoning"))return{...he(e),reasoning:!0,source:"supported_features"};let n=e.supported_parameters;if(Array.isArray(n)&&(n.includes("reasoning")||n.includes("include_reasoning")||n.includes("reasoning_effort")))return{...he(e),reasoning:!0,source:"supported_parameters"};if(Ke(e,"supports_reasoning"))return{...he(e),reasoning:e.supports_reasoning,source:"supports_reasoning"};if(Ke(e,"supportsReasoning"))return{...he(e),reasoning:e.supportsReasoning,source:"supportsReasoning"};if(Ke(e,"can_reason"))return{...he(e),reasoning:e.can_reason,source:"can_reason"};if(Ke(e,"reasoning"))return{...he(e),reasoning:e.reasoning,source:"reasoning"};let r=e.reasoning_effort;if(r!=null&&!(typeof r=="string"&&r.trim().length===0)||e.supports_reasoning_effort===!0)return{...he(e),reasoning:!0,source:"reasoning_effort"};let o=C(e.capabilities)?e.capabilities:void 0;if(o!==void 0){let i=o.thinking,s=C(i)&&typeof i.supported=="boolean"?i.supported:void 0,a=o.effort,d=C(a)&&typeof a.supported=="boolean"?a.supported:void 0;if(d===!0)return{...he(e),reasoning:!0,source:"capabilities.effort.supported"};if(s===!0)return{...he(e),reasoning:!0,source:"capabilities.thinking.supported"};if(s===!1)return{...he(e),reasoning:!1,source:"capabilities.thinking.supported"};if(d===!1)return{...he(e),reasoning:!1,source:"capabilities.effort.supported"}}return{...he(e),reasoning:"unknown",source:null}}function he(e){let t={},n=s=>{if(!Array.isArray(s))return;let a=s.filter(d=>typeof d=="string");return a.length>0?a.map(d=>d.toLowerCase()):[]},r=C(e.architecture)?e.architecture:void 0,o=n(r?.input_modalities);if(o===void 0&&(o=n(e.input_modalities)),o===void 0){let s=C(e.modalities)?e.modalities:void 0;o=n(s?.input)}if(o===void 0){let s=e.capabilities,a=d=>Array.isArray(d)&&d.some(l=>typeof l=="string"&&l.toLowerCase()==="vision");if(a(e.supported_features)||a(s))o=["image"];else if(C(s)){let d=[];for(let l of["image_input","video_input","pdf_input","file_input"]){let p=C(s[l])?s[l]:void 0;if(p===void 0||typeof p.supported!="boolean")continue;let g=l.replace(/_input$/,"");p.supported===!0?d.push(g):d.length===0&&d.push("text")}d.length>0&&(o=d)}}o===void 0&&(Ke(e,"supports_vision")?o=e.supports_vision===!0?["image"]:[]:Ke(e,"supportsVision")?o=e.supportsVision===!0?["image"]:[]:(Ke(e,"supports_images")||Ke(e,"supportsImages"))&&(o=e.supports_images===!0||e.supportsImages===!0?["image"]:[])),o!==void 0&&(t.input=o.length===0?["text"]:o);let i=e.context_length;if(typeof i=="number"&&Number.isFinite(i)&&i>0)t.contextLength=i;else{let a=(C(e.top_provider)?e.top_provider:void 0)?.context_length;if(typeof a=="number"&&Number.isFinite(a)&&a>0)t.contextLength=a;else{let d=e.max_input_tokens;if(typeof d=="number"&&Number.isFinite(d)&&d>0)t.contextLength=d;else{let p=(C(e.limit)?e.limit:void 0)?.context;typeof p=="number"&&Number.isFinite(p)&&p>0&&(t.contextLength=p)}}}return t}function xi(e,t){let n=hl(e,t);return n===void 0?{found:!1,signal:{reasoning:"unknown",source:null}}:{found:!0,signal:bl(n)}}function ce(e){let n=e?.value?.providers;return typeof n!="object"||n===null||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="object"&&r!==null&&!Array.isArray(r)))}function cn(e){if(!C(e))return;let t=e.providers;return C(t)?t:void 0}function Ei(e,t){for(let n of[e?.user,e?.base]){let r=cn(n)?.[t];if(C(r)&&r.models!==void 0)return r.models}}function Mr(e){return cn(e?.user)}function pn(e,t){let n=e.find(o=>o.id===t);if(n===void 0)return;let r=n.reasoningEfforts;if(r===!1)return!1;if(typeof r=="object"&&r!==null&&!Array.isArray(r))return r}function mn(e,t){let r=e.find(i=>i.id===t)?.input;if(!Array.isArray(r))return;let o=r.filter(i=>typeof i=="string");return o.length>0?o:void 0}function gn(e,t){let r=e.find(o=>o.id===t)?.compat;if(C(r))return{...r}}function hn(e,t){let r=e.find(o=>o.id===t)?.name;return typeof r=="string"&&r.length>0?r:void 0}function bn(e,t){let r=e.find(o=>o.id===t)?.[at];return typeof r=="string"&&r.length>0?r:void 0}async function yl(e,t){try{let n=await fetch(`${No}?route=${encodeURIComponent(e)}`,{method:"GET"});if(!n.ok)return{reasoning:"unknown",source:null};let r=await n.json();return r?.ok?xi(r.data,t).signal:{reasoning:"unknown",source:null}}catch{return{reasoning:"unknown",source:null}}}function yn(e,t=()=>te(e),n,r,o,i){return{async suggest(s,a,d,l){let p=ce((await t()).namespace),g=Ve(p,s),c={api:g.api??l?.api,baseURL:g.baseURL??l?.baseURL,displayName:d??g.displayName},u=p[s]===void 0?void 0:await yl(s,a),f=ke(a,c,u);return f.efforts===void 0?{ok:!1,error:"no-suggestion"}:{ok:!0,suggestion:{efforts:f.efforts,...f.compat===void 0?{}:{compat:f.compat},...f.defaultEffort===void 0?{}:{defaultEffort:f.defaultEffort},...f.defaultEffort===void 0?{}:{defaultEffort:f.defaultEffort},...f.input===void 0?{}:{input:f.input},...f.inputSource===void 0?{}:{inputSource:f.inputSource},...f.contextWindow===void 0?{}:{contextWindow:f.contextWindow},...f.maxTokens===void 0?{}:{maxTokens:f.maxTokens},matched:f.matched,source:f.source,confidence:f.confidence,...f.endpoint===void 0?{}:{endpoint:f.endpoint}}}},commit(s,a,d){if(i?.()===!0){n?.(s,a,d.efforts,d.compat,d.input,d.defaultEffort);return}r?.(s,a,{efforts:d.efforts,...d.compat===void 0?{}:{compat:d.compat},...d.input===void 0?{}:{input:d.input},...d.defaultEffort===void 0?{}:{defaultEffort:d.defaultEffort}})},withdraw(s,a){o?.(s,a)},stageEfforts(s,a,d,l,p,g){n?.(s,a,d,l,p,g)},async writeEfforts(s,a,d,l,p,g){if(r!==void 0)return r(s,a,{efforts:d,...l===void 0?{}:{compat:l},...p===void 0?{}:{input:p},...g===void 0?{}:{defaultEffort:g}}),{ok:!0,staged:!0};let u=(await Ht(e,s,[{modelId:a,efforts:d,...l===void 0?{}:{compat:l},...p===void 0?{}:{input:p},...g===void 0?{}:{defaultEffort:g}}],t))[0]??{ok:!1,error:"no-result"};return u.ok?{ok:!0}:u.modelNotFound===!0?{ok:!1,error:"model-not-found"}:{ok:!1,error:u.error??"conflict"}}}}async function Ht(e,t,n,r=()=>te(e),o){if(n.length===0)return[];let i=!1;for(let s=0;s<3;s++)try{let a=s===0?await r():await te(e,{fresh:!0});if(a.namespace===void 0)return n.map(()=>({ok:!1,error:"no-namespace"}));let d=Ei(a.namespace,t);if(!Array.isArray(d))return n.map(()=>({ok:!1,modelNotFound:!0}));if(!d.every(C))return n.map(()=>({ok:!1,error:"invalid-models"}));let p=d.map(u=>u),g=[];for(let u of n){let f=p.findIndex(m=>m.id===u.modelId);if(f<0){g.push(u.modelId);continue}p[f]=wl(p[f],u,i?void 0:u.compat)}if(g.length>0)return n.map(u=>g.includes(u.modelId)?{ok:!1,modelNotFound:!0}:{ok:!1,error:"model-not-found"});if(o?.()===!0)return n.map(()=>({ok:!1,aborted:!0}));let c=await e.settings.mutate(fe,[{op:"set",path:["providers",t,"models"],value:p}],a.namespace.revision);if(!c.ok){if(s===0&&c.error.code==="settings/conflict")continue;let u=c.error.code==="settings/rejected"&&vi(c.error.message);if(!i&&u&&n.some(f=>f.compat!==void 0)){i=!0;continue}return n.map(()=>({ok:!1,error:c.error.message}))}return n.map(()=>({ok:!0}))}catch(a){return n.map(()=>({ok:!1,error:a instanceof Error?a.message:String(a)}))}return n.map(()=>({ok:!1,error:"conflict"}))}function wl(e,t,n){let r={...e},o=t.efforts!=="keep",i=t.efforts==="keep"?void 0:t.efforts;if(o)if(i===void 0)delete r.reasoningEfforts,r[ge]=!0;else if(delete r[ge],delete r[st],i===!1)r.reasoningEfforts=!1;else{r.reasoningEfforts={...i};let a={...C(e.compat)?e.compat:{},...n??{}};Object.keys(a).length>0&&(r.compat=a)}return t.input!==void 0&&(t.input===null?(delete r.input,r[_e]=!0):(delete r[_e],r.input=[...t.input])),t.defaultEffort!==void 0&&(t.defaultEffort===null?delete r[at]:r[at]=t.defaultEffort),r}function Lr(e,t){for(let n of[e?.user,e?.base]){let r=cn(n)?.[t];if(!C(r))continue;let o=r.headers;if(o===void 0)continue;if(!C(o))return;let i={};for(let[s,a]of Object.entries(o))typeof a=="string"&&(i[s]=a);return i}}async function Ot(e,t,n){if(typeof t!="string"||t.length===0)return{ok:!1,error:"no-route"};let r=!1;for(let o=0;o<2;o+=1)try{let i=o===0?await te(e):await te(e,{fresh:!0});if(i.namespace===void 0)return{ok:!1,error:"no-namespace"};if(i.writable!==!0)return{ok:!1,error:"read-only"};if(!Ye(i.namespace,t)){r=!0;continue}let s=await e.settings.mutate(fe,[{op:"set",path:["providers",t,"headers"],value:{...n}}],i.namespace.revision);if(!s.ok){if(o===0&&s.error.code==="settings/conflict")continue;return{ok:!1,error:s.error.message}}return{ok:!0}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}return r?{ok:!1,error:"no-route"}:{ok:!1,error:"conflict"}}function Ye(e,t){if(Object.prototype.hasOwnProperty.call(ce(e),t))return!0;for(let n of[e?.user,e?.base]){let r=cn(n);if(r!==void 0&&Object.prototype.hasOwnProperty.call(r,t))return!0}return!1}async function te(e,t={}){let n=t.fresh===!0?void 0:vl(e);if(n!==void 0)return n;let r=await e.settings.describe();return r.ok?{namespace:r.value.namespaces.find(i=>i.ns===fe),writable:r.value.writable}:{namespace:void 0,writable:!1}}function vl(e){let t=e.scope?.getSnapshot();if(!(t===void 0||t.status!=="ready")&&typeof t.revision=="number")return{namespace:{ns:fe,schema:{},value:t.value,user:t.user,base:t.base,revision:t.revision,applies:"live",secrets:[]},writable:t.writable===!0}}var Sr=new Map;function ki(e){let t=Sr,n=!1,r,o=0,i=new Set,s=()=>{for(let d of[...i])d()},a=()=>{if(n)return Promise.resolve();if(r!==void 0)return r;let d=o;return r=te(e,{fresh:!0}).then(l=>{if(d!==o||l.namespace===void 0)return;let p=new Map;for(let[g,c]of Object.entries(ce(l.namespace))){let u=new Map,f=Array.isArray(c.models)?c.models:[];for(let m of f){if(!C(m)||typeof m.id!="string"||!Array.isArray(m.input))continue;let h=m.input.filter(v=>typeof v=="string");h.length>0&&u.set(m.id,h)}u.size>0&&p.set(g,u)}t=p,n=!0,s()}).catch(()=>{}).finally(()=>{d===o&&(r=void 0)}),r};return{getSnapshot:()=>t,subscribe(d){return i.add(d),()=>{i.delete(d)}},load:a,invalidate(){o+=1,n=!1,r=void 0,i.size>0&&a()}}}function xl(e){if(e.current===null)return[];let r=e.groups.find(o=>o.id===e.current?.provider)?.models.find(o=>o.id===e.current?.model)?.reasoning?.efforts;return r!==void 0&&r.length>=2?r:[]}function El(e){return e.current}function kl(e,t){let n=El(t),r=e.findIndex(a=>a.id===n?.reasoningEffort);if(r>=0)return r;let i=t.groups.find(a=>a.id===n?.provider)?.models.find(a=>a.id===n?.model)?.reasoning?.defaultEffort,s=i===void 0?-1:e.findIndex(a=>a.id===i);return s>=0?s:Math.floor((e.length-1)/2)}function Ti(e){return e.models??[]}function ct(e){let t=e;return t.name??t.label??t.title??e.id}function Ar(e){return(0,T.createElement)("span",{className:"bre-row-chevron"+(e?" is-open":""),"aria-hidden":!0},"\u203A")}function Tl(){let[e,t]=(0,T.useState)(null),n=(0,T.useRef)(0);(0,T.useEffect)(()=>()=>{window.clearTimeout(n.current)},[]);let r=(0,T.useCallback)(()=>{window.clearTimeout(n.current),t(null)},[]),o=(0,T.useCallback)((i,s)=>{window.clearTimeout(n.current);let a=i.currentTarget;a.scrollWidth<=a.clientWidth+1||(n.current=window.setTimeout(()=>{t({target:a,text:s})},300))},[]);return{tip:e,onEnter:o,onLeave:r}}function Ml({state:e}){if(typeof document>"u")return null;let t=e.target.getBoundingClientRect(),n=Math.max(12,Math.min(t.right,window.innerWidth-12));return(0,Li.createPortal)((0,T.createElement)("div",{className:"bre-tip",role:"tooltip",style:{top:Math.min(t.bottom+6,window.innerHeight-40),right:Math.max(12,window.innerWidth-n)}},e.text),document.body)}function Ll(){return(0,T.createElement)("svg",{className:"bre-option-check",width:14,height:14,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0},(0,T.createElement)("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"}))}var Mi=new Map;function Sl(e,t){let n=t??e.input;if(Array.isArray(n)&&n.length>0)return n.includes("image");let r=JSON.stringify([e.id,e.name]),o=Mi.get(r);if(o!==void 0)return o;let i=wr(e.id,e.name)?.input,s=i!==void 0?i.includes("image"):(xr(e.id)??[]).includes("image");return Mi.set(r,s),s}function Al(e){let t=e.reasoning?.efforts;return Array.isArray(t)&&t.length>0}function Rl(e){return(0,T.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,T.createElement)("path",{d:"M1.8 8s2.4-4.2 6.2-4.2S14.2 8 14.2 8s-2.4 4.2-6.2 4.2S1.8 8 1.8 8z",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round"}),(0,T.createElement)("circle",{cx:8,cy:8,r:1.8,fill:"currentColor"}))}function Hl(e){return(0,T.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,T.createElement)("path",{d:"M8 1.9l1.35 3.75L13.1 7l-3.75 1.35L8 12.1 6.65 8.35 2.9 7l3.75-1.35z",fill:"currentColor"}))}function Ol(e,t,n){let r=[];return Sl(e,n)&&r.push((0,T.createElement)("span",{key:"vision",className:"bre-tag",title:t("tagVision")},Rl(t("tagVision")))),Al(e)&&r.push((0,T.createElement)("span",{key:"thinking",className:"bre-tag",title:t("tagThinking")},Hl(t("tagThinking")))),r.length===0?null:(0,T.createElement)("span",{className:"bre-option-tags"},...r)}function Si(e){let{directory:t,t:n,configuredInputs:r}=e,o=e.onLayoutChange,i=(0,T.useSyncExternalStore)(k=>t.store.subscribe(k),()=>t.store.getSnapshot()),s=(0,T.useSyncExternalStore)(k=>r?.subscribe(k)??(()=>{}),()=>r?.getSnapshot()??Sr),a=xl(i),[d,l]=(0,T.useState)(""),[p,g]=(0,T.useState)(null),[c,u]=(0,T.useState)(null),[f,m]=(0,T.useState)(!1),[h,v]=(0,T.useState)(null),x=(0,T.useRef)(null),b=(0,T.useRef)(""),A=(0,T.useRef)(!1),R=i.current!==null&&a.length>=2,H=f||i.status==="selecting",O=h??i.error,L=t.select;(0,T.useEffect)(()=>{if(A.current)return;let k=kl(a,i),ne=a[k]?.id??"";b.current=ne,l(ne),v(null)},[R,a,i]),(0,T.useEffect)(()=>{t.load().catch(()=>{})},[t]),(0,T.useEffect)(()=>{r?.load().catch(()=>{})},[r]);let F=i.current,y=i.groups.find(k=>k.id===F?.provider),w=y?.models.find(k=>k.id===F?.model)?.name??(F===null?n("triggerFallback"):F.model),M=F===null?w:ct(y??{id:F.provider})+" \xB7 "+w,N=a.find(k=>k.id===d)?.name??n("effortDefault"),W=(0,T.useSyncExternalStore)(rn,fr),X=(0,T.useSyncExternalStore)(sn,Jo),oe=(0,T.useSyncExternalStore)(dn,ri),J=i.groups.filter(k=>Ti(k).length>0&&!X.includes(k.id)).map(k=>k.id),Q=ut(cr(J),W),Z=c!==null&&Q.includes(c)?c:F!==null&&Q.includes(F.provider)?F.provider:Q[0]??null,G=Z===null?[]:di(Ti(i.groups.find(k=>k.id===Z)),oe[Z]??[]),q=F===null?"":F.provider+"/"+F.model,B=(0,T.useCallback)(k=>{p!==k&&((0,Rr.flushSync)(()=>{g(k)}),o?.())},[o,p]),U=(0,T.useCallback)(()=>{p!==null&&((0,Rr.flushSync)(()=>{g(null)}),o?.())},[o,p]),S=(0,T.useCallback)(()=>{let k=x.current?.closest('[role="menu"], [role="group"]');k!=null&&(k.tabIndex=-1,k.focus({preventScroll:!0}))},[]),K=(0,T.useCallback)(async(k,ne)=>{if(A.current)return;let ie=t.store.getSnapshot().current;if(U(),!(ie!==null&&ie.provider===k&&ie.model===ne)){A.current=!0,S(),m(!0),v(null);try{let ue=await L({provider:k,model:ne}),Re=Tr(ue);if(Re!==void 0)throw new Error(Re)}catch(ue){v(ue instanceof Error?ue.message:String(ue))}finally{A.current=!1,m(!1)}}},[U,t,S,L]),Y=(0,T.useCallback)(async k=>{if(A.current||(U(),k===i.current?.reasoningEffort&&i.status!=="error"))return;A.current=!0;let ne=b.current;S(),m(!0),v(null),l(k);try{let ie=i.current;if(ie===null)throw new Error(n("sliderNoCurrent"));let ue=await L({provider:ie.provider,model:ie.model,reasoningEffort:k}),Re=Tr(ue);if(Re!==void 0)throw new Error(Re);let He=t.store.getSnapshot(),Jt=a.find(sr=>sr.id===He.current?.reasoningEffort)?.id??k;b.current=Jt,l(Jt)}catch(ie){b.current=ne,l(ne),v(ie instanceof Error?ie.message:String(ie))}finally{A.current=!1,m(!1)}},[U,t,S,a,L,i.current,i.status,n]),{tip:le,onEnter:ot,onLeave:it}=Tl(),Xt=[(0,T.createElement)("button",{key:"row:model",type:"button",role:"menuitem",className:"bre-row-control"+(p==="model"?" is-open":""),disabled:H,"aria-expanded":p==="model",onMouseLeave:it,onClick:()=>{B(p==="model"?null:"model")}},(0,T.createElement)("span",{className:"bre-row-label"},n("modelRowLabel")),(0,T.createElement)("span",{className:"bre-row-value","aria-label":M,onMouseEnter:k=>{ot(k,M)}},M),Ar(p==="model")),p==="model"?(0,T.createElement)("div",{key:"panel:model",className:"bre-panel bre-panel-models"},(0,T.createElement)("div",{className:"bre-providers",role:"group","aria-label":n("modelRowLabel")},...Q.map(k=>(0,T.createElement)("button",{key:k,type:"button",className:"bre-provider"+(k===Z?" is-open":"")+(k===F?.provider?" is-current":""),disabled:H,"aria-expanded":k===Z,onMouseLeave:it,onClick:()=>{u(k)}},(0,T.createElement)("span",{className:"bre-option-name","aria-label":ct(i.groups.find(ne=>ne.id===k)),onMouseEnter:ne=>{ot(ne,ct(i.groups.find(ie=>ie.id===k)))}},ct(i.groups.find(ne=>ne.id===k))),Ar(k===Z))),...Q.length===0?[(0,T.createElement)("div",{key:"no-providers",className:"bre-empty"},n("sliderNoCurrent"))]:[]),(0,T.createElement)("div",{className:"bre-provider-models",role:"group","aria-label":n("modelRowLabel")},...G.length===0?[(0,T.createElement)("div",{key:"no-models",className:"bre-empty"},n("sliderNoCurrent"))]:G.map(k=>{let ne=Z+"/"+k.id,ie=ne===q;return(0,T.createElement)("button",{key:ne,type:"button",className:"bre-option"+(ie?" is-active":""),disabled:H,"aria-pressed":ie,onMouseLeave:it,onClick:()=>{K(Z,k.id)}},(0,T.createElement)("span",{className:"bre-option-name","aria-label":k.name??k.id,onMouseEnter:ue=>{ot(ue,k.name??k.id)}},k.name??k.id),Ol(k,n,s.get(Z)?.get(k.id)))}))):null,(0,T.createElement)("div",{key:"divider",className:"bre-divider","aria-hidden":!0}),(0,T.createElement)("button",{key:"row:effort",type:"button",role:"menuitem",className:"bre-row-control"+(p==="effort"?" is-open":""),disabled:H||!R,"aria-expanded":R?p==="effort":void 0,onClick:()=>{B(p==="effort"?null:"effort")}},(0,T.createElement)("span",{className:"bre-row-label"},n("effortRowLabel")),(0,T.createElement)("span",{className:"bre-row-value"+(R?"":" is-muted")},R?N:n("sliderNoLevels")),R?Ar(p==="effort"):null),p==="effort"&&R?(0,T.createElement)("div",{key:"panel:effort",className:"bre-panel",role:"group","aria-label":n("effortRowLabel")},...a.map(k=>(0,T.createElement)("button",{key:k.id,type:"button",className:"bre-option"+(k.id===d?" is-active":""),disabled:H,"aria-pressed":k.id===d,onClick:()=>{Y(k.id)}},(0,T.createElement)("span",{className:"bre-option-name"},k.name),k.id===d?Ll():null))):null];return(0,T.createElement)("div",{className:"bre-slider-body",ref:x},(0,T.createElement)("div",{className:"bre-card"},...Xt),O===null?null:(0,T.createElement)("div",{className:"bre-model-error",role:"status"},O),le===null?null:(0,T.createElement)(Ml,{key:"tip",state:le}))}var V=require("react"),Ri='section[role="group"]',Or='button[role="menuitemradio"]';function Hi(e){return e.querySelector(Ri)!==null}function Hr(e){return Array.from(e.querySelectorAll(Or)).filter(t=>!t.disabled&&t.style.display!=="none")}function _l(e){let t=e.getAttribute("aria-labelledby");return(t===null?null:e.ownerDocument.getElementById(t))?.textContent?.toLowerCase()??""}function Ai(e,t,n=new Map){let r=d=>{n.has(d)||n.set(d,d.style.display),d.style.display="none"},o=d=>{let l=n.get(d);l!==void 0&&(d.style.display=l,n.delete(d))};for(let d of[...n.keys()])d.isConnected||n.delete(d);let i=t.trim().toLowerCase().split(/\s+/).filter(Boolean),s=Array.from(e.querySelectorAll(Ri)),a=0;if(i.length===0){for(let d of[...n.keys()])o(d);for(let d of s)a+=d.querySelectorAll(Or).length;return a}for(let d of s){let l=_l(d),p=Array.from(d.querySelectorAll(Or)),g=0;for(let c of p){let u=(c.getAttribute("title")??"").toLowerCase(),f=(c.textContent??"").toLowerCase(),m=`${l} ${u} ${f}`;i.every(h=>m.includes(h))?(o(c),g+=1):r(c)}g>0?(o(d),a+=g):r(d)}return a}function Oi({menu:e,t}){let[n,r]=(0,V.useState)(""),[o,i]=(0,V.useState)(0),s=(0,V.useRef)(null),a=(0,V.useRef)(""),d=(0,V.useRef)(new Map),l=(0,V.useCallback)(u=>{a.current=u;let f=Ai(e,u,d.current);i(f)},[e]);(0,V.useEffect)(()=>()=>{Ai(e,"",d.current)},[e]),(0,V.useEffect)(()=>{let u=new MutationObserver(()=>{a.current.trim().length!==0&&l(a.current)});return u.observe(e,{childList:!0,subtree:!0}),()=>{u.disconnect()}},[e,l]),(0,V.useEffect)(()=>{let u=f=>{if(a.current.trim().length===0)return;let m=f.key;if(!(m==="ArrowDown"||m==="ArrowUp")&&!(m==="Home"||m==="End"||m==="PageUp"||m==="PageDown")||f.target===s.current||f.target instanceof Node&&!e.contains(f.target))return;let x=Hr(e);if(x.length===0)return;let b=x.findIndex(R=>R===document.activeElement),A;m==="Home"||m==="PageUp"?A=0:m==="End"||m==="PageDown"?A=x.length-1:m==="ArrowDown"?A=b===-1?0:(b+1)%x.length:A=b===-1?x.length-1:(b-1+x.length)%x.length,f.preventDefault(),f.stopPropagation(),x[A]?.focus()};return e.addEventListener("keydown",u,!0),()=>{e.removeEventListener("keydown",u,!0)}},[e]);let p=u=>{let f=u.key;if(f==="ArrowDown"){u.preventDefault(),u.stopPropagation(),Hr(e)[0]?.focus();return}if(n.trim().length>0&&(f==="ArrowUp"||f==="Home"||f==="PageUp"||f==="End"||f==="PageDown")){let m=Hr(e);m.length>0&&(u.preventDefault(),u.stopPropagation(),m[f==="ArrowUp"||f==="End"||f==="PageDown"?m.length-1:0]?.focus());return}f==="Escape"&&n.length>0&&(u.preventDefault(),u.stopPropagation(),r(""),l(""))},g=()=>{r(""),l(""),s.current?.focus({preventScroll:!0})},c=o===0&&n.trim().length>0;return(0,V.createElement)("div",{className:"bre-model-search-box"+(c?" has-empty":""),"data-bre-search":"1"},(0,V.createElement)("div",{className:"bre-search-input-wrapper"},(0,V.createElement)("span",{className:"bre-search-icon","aria-hidden":"true"},(0,V.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,V.createElement)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,V.createElement)("path",{d:"M10.5 10.5L14 14",strokeLinecap:"round"}))),(0,V.createElement)("input",{ref:s,type:"text",className:"bre-search-input",role:"searchbox",placeholder:t("modelSearchPlaceholder"),"aria-label":t("modelSearchPlaceholder"),value:n,spellCheck:!1,autoComplete:"off",onChange:u=>{let f=u.currentTarget.value;r(f),l(f)},onKeyDown:p}),n.length>0?(0,V.createElement)("button",{type:"button",className:"bre-search-clear",title:t("modelSearchClear"),"aria-label":t("modelSearchClear"),onClick:g},(0,V.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,V.createElement)("path",{d:"M4 4L12 12M12 4L4 12",strokeLinecap:"round"}))):null),c?(0,V.createElement)("div",{className:"bre-search-empty",role:"status"},t("modelSearchNoMatches")):null)}var wn=require("react"),_i=require("react-dom"),Ii=require("react-dom/client");function Te(){return document.body}function Xe(e,t,n){let r=(0,Ii.createRoot)(e);return n?.sync===!0?(0,_i.flushSync)(()=>{r.render(t)}):r.render(t),{wrapper:e,root:r}}function Ne(e){e!==void 0&&(e.root.unmount(),e.wrapper.remove())}var Ie=class extends wn.Component{constructor(){super(...arguments);Io(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n instanceof Error?n.message:String(n)}}componentDidCatch(n,r){console.error("[bre] editor render failed:",n,r.componentStack)}render(){return this.state.error!==null?(0,wn.createElement)("div",{style:{color:"#c00",fontSize:"11px",whiteSpace:"pre-wrap",padding:"6px"}},`${this.props.fallbackText}: ${this.state.error}`):this.props.children}};var Il="conversation.input.model";function Ni(e){return e.querySelector("[data-composer-card]")??void 0}function _r(e){return e.querySelector(`[data-slot="${Il}"]`)??void 0}function Di(e){let t=_r(e)??e;return Array.from(t.querySelectorAll('button[aria-haspopup="menu"]'))}function Ir(e){if(e==null)return!1;let t=e.getAttribute("role");return t==="menu"||t==="group"}function Nr(e){return e.getAttribute("role")==="group"}function Ci(e,t){let n=e.getAttribute("aria-controls");if(n===null||n.length===0)return;let r=t.getElementById(n);return Ir(r)?r:void 0}function Dr(e=document){let t=Ni(e);if(t===void 0)return;for(let r of Di(t)){let o=Ci(r,e);if(o!==void 0)return o}let n=_r(t)??t;for(let r of Array.from(n.querySelectorAll('[role="menu"], [role="group"]')))if(r.previousElementSibling?.matches('button[aria-haspopup="menu"]')&&Ir(r)&&!(r.getAttribute("role")==="group"&&r.querySelector('[role="menuitemradio"], section[role="group"]')===null))return r}function Cr(e=document){let t=Ni(e);if(t===void 0)return;let n=_r(t),r=Di(t),o=r[0];if(o!==void 0){for(let i of r)if(Ci(i,e)!==void 0)return i;for(let i of r)if(Ir(i.nextElementSibling))return i;return n===void 0?r.at(-1):o}}function Pi(){return Dr()}function Fi(){return Cr()}var qi=()=>{(0,Wi.flushSync)(()=>{window.dispatchEvent(new Event("resize"))})};function Ki(e){let{menuOf:t,triggerOf:n,t:r,refreshed:o,sliderEnabled:i,directory:s}=e,a,d,l,p,g,c,u,f=()=>{u?.removeAttribute("data-bre-provider"),u=void 0},m=()=>{let y=n();u!==void 0&&u!==y&&f();let I=g?.store.getSnapshot(),w=I?.current;if(y===void 0||w===null||w===void 0){y===u&&f();return}let M=I?.groups.find(W=>W.id===w.provider),N=M===void 0?w.provider:ct(M);if(N.trim()===""){y===u&&f();return}y.dataset.breProvider=N,u=y},h=()=>{let y=s();y!==g&&(c?.(),c=void 0,g=y,y!==void 0&&(c=y.store.subscribe(m))),m()},v=()=>{Ne(d),d=void 0},x=new Map,b=()=>{for(let[y,I]of x)y.style.display=I;x.clear()},A=y=>y.getAttribute("aria-hidden")!=="true"||y.childElementCount>0?!1:(y.textContent??"").trim()==="",R=(y,I)=>{for(let N of Array.from(x.keys()))(!N.isConnected||N.parentElement!==y)&&x.delete(N);let w=[];for(let N of Array.from(y.children))N!==I&&(A(N)||w.push(N));let M=document.activeElement;M!==null&&M!==I&&!I.contains(M)&&w.some(N=>N.contains(M))&&(y.tabIndex=-1,y.focus({preventScroll:!0}));for(let N of w)x.has(N)||x.set(N,N.style.display),N.style.display!=="none"&&(N.style.display="none")},H=y=>{let I=y.querySelector('section[role="group"]'),w=I?.parentElement,M=w!=null&&w.parentElement===y?w:I;if(d===void 0){let N=document.createElement("div");N.dataset.plugin=re,N.dataset.breSearch="1",y.insertBefore(N,M),d=Xe(N,(0,_t.createElement)(Ie,{fallbackText:r("modelSearchFailed"),children:o(()=>(0,_t.createElement)(Oi,{menu:y,t:r}))}),{sync:!0});return}if(d.wrapper.parentElement!==y){y.insertBefore(d.wrapper,M);return}M!==null&&d.wrapper.nextSibling!==M&&y.insertBefore(d.wrapper,M)},O=y=>{if(!i()){Ne(a),a=void 0,y.classList.remove("bre-model-menu-host"),b();for(let W of Array.from(y.children))W.getAttribute("role")==="menuitem"&&(W.style.display="");return}let I=s();if(I===void 0)return;if(a===void 0){let W=document.createElement("div");W.dataset.plugin=re,W.dataset.breSlider="1",y.insertBefore(W,y.firstChild),a=Xe(W,(0,_t.createElement)(Ie,{fallbackText:r("renderFailed"),children:o(()=>(0,_t.createElement)(Si,{directory:I,configuredInputs:e.configuredInputs,t:r,onLayoutChange:qi}))}),{sync:!0})}else(a.wrapper.parentElement!==y||y.firstChild!==a.wrapper)&&y.insertBefore(a.wrapper,y.firstChild);y.classList.add("bre-model-menu-host");let w=Array.from(y.children).filter(W=>W.getAttribute("role")==="menuitem"),M=a.wrapper;if(Nr(y)){M.style.display="",R(y,M);return}if(b(),Array.from(y.querySelectorAll('[role="menuitemradio"]')).some(W=>!M.contains(W)))a.wrapper.contains(document.activeElement)&&(y.tabIndex=-1,y.focus({preventScroll:!0})),a.wrapper.style.display="none";else{a.wrapper.style.display="";for(let W of w)W.style.display="none"}};return{reconcile:()=>{h();let y=t();if(y===void 0){Ne(a),a=void 0,v(),l=void 0,p=void 0,b();return}let I=Nr(y),w=I&&i(),M=!I&&Hi(y);M?H(y):v(),O(y),(M!==l||w!==p)&&(l=M,p=w,(M||w||i())&&qi())},dispose:()=>{c?.(),c=void 0,g=void 0,f(),Ne(a),a=void 0,v(),b(),l=void 0,p=void 0}}}function Bi(e){let t,n,r=0,o=()=>{if(t!==void 0)return Promise.resolve();let a=r;return n??(n=te(e.api).then(d=>{if(d.namespace===void 0){n=void 0;return}let l=new Map;for(let[p,g]of Object.entries(ce(d.namespace))){let c=Array.isArray(g.models)?g.models:[];for(let u of c){if(typeof u!="object"||u===null||Array.isArray(u))continue;let f=u.id,m=u[at];typeof f=="string"&&typeof m=="string"&&m.length>0&&l.set(`${p}/${f}`,m)}}a===r?t=l:n=void 0}).catch(()=>{a===r&&(n=void 0)})),n};return{of:async(a,d)=>(await o(),t?.get(`${a}/${d}`)),invalidate:()=>{r+=1,t=void 0,n=void 0}}}function Nl(e){let t=e.input;return Array.isArray(t)&&t.length>0}function Ui(e,t=()=>!0,n={},r=0){let o=n.efforts!==!1,i=n.modalities!==!1;if(!C(e))return;let s={};for(let a of Object.keys(e)){if(!t(a))continue;let d=e[a],l=C(d)&&Array.isArray(d.models)?d.models:void 0;if(l===void 0||l.length===0||!l.every(C))continue;let p=l,g=[],c=!1;for(let u of p){let f=u.reasoningEfforts!==void 0||u[ge]===!0,m=Nl(u)||u[_e]===!0;if((f||!o)&&(m||!i)){let H=Dl(u,e,a);H!==void 0?(c=!0,g.push(H)):g.push(u);continue}let h=typeof u.id=="string"?u.id:"";if(h.length===0){g.push(u);continue}let v=Ve(e,a),x=typeof u.name=="string"?u.name:void 0,b=ke(h,{...v,displayName:x??v.displayName});if(b.efforts===void 0){g.push(u);continue}let A={...u},R=!1;if(!f&&o&&(R=!0,A.reasoningEfforts=b.efforts,A[st]=r,b.compat!==void 0)){let H=C(u.compat)?u.compat:{};A.compat={...H,...b.compat}}if(!m&&i&&b.input!==void 0&&(R=!0,A.input=[...b.input]),!R){g.push(u);continue}c=!0,g.push(A)}c&&(s[a]={models:g})}return Object.keys(s).length===0?void 0:{providers:s}}function Dl(e,t,n){if(!C(e.reasoningEfforts)||e[ge]===!0)return;let r=e.compat,o=C(r)?{...r}:{};if(o.supportsDeveloperRole===void 0&&vr(Ve(t,n)))return{...e,compat:{...o,supportsDeveloperRole:!1}}}function Gi(e){let t,n=0,r=()=>{if(t!==void 0)return t;let i=(async()=>{try{let s=await fetch(Co,{method:"GET"});if(!s.ok)return;let a=await s.json();return a?.ok!==!0?void 0:{autofill:a.data?.autofill!==!1,modalityAutofill:a.data?.modalityAutofill!==!1}}catch{return}})().then(s=>(s===void 0&&t===i&&(t=void 0),s??{autofill:!0,modalityAutofill:!0}));return t=i,i},o=async()=>{let i=n;try{let s=await r();if(i!==n||!s.autofill)return;let a=await te(e.api,{fresh:!0}),d=a.namespace;if(i!==n||d===void 0||a.writable!==!0)return;let l=Mr(d);if(l===void 0)return;let p=Ui(l,()=>!0,{modalities:s.modalityAutofill},d.revision);if(p===void 0)return;let g=p.providers,c=Object.entries(g).map(([f,m])=>({op:"set",path:["providers",f,"models"],value:m.models})),u=await e.api.settings.mutate(fe,c,d.revision);u.ok||console.error(`[bre] idle autofill refused: ${u.error.message}`)}catch(s){console.error(`[bre] idle autofill failed: ${s instanceof Error?s.message:String(s)}`)}};return{run:()=>{o()},invalidate:()=>{n+=1,t=void 0}}}var So=require("react"),kd=require("react-dom/client");var j=require("react");var Je=pi;function Qe(e){let t={};for(let n of Je){if(e===void 0){t[n]={on:!1,wire:""};continue}if(e===!1){t[n]=n==="off"?{on:!0,wire:""}:{on:!1,wire:""};continue}let r=e[n];t[n]={on:r!==void 0,wire:r===null?"":typeof r=="string"?r:""}}return t}function pt(e){let t=!1,n=!1,r={};for(let o of Je){let i=e[o];if(!i.on)continue;if(o==="off"){t=!0;let a=i.wire.trim();r.off=a.length===0?null:a;continue}n=!0;let s=i.wire.trim();r[o]=s.length===0?o:s}return n?r:t?!1:void 0}function It(e,t){if(e===t)return!0;if(e===!1||e===void 0||t===!1||t===void 0)return!1;let n=Je.filter(o=>e[o]!==void 0),r=Je.filter(o=>t[o]!==void 0);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}function ji(e,t){if(!(e===void 0||e===!1)&&!("off"in e)){if(t==="zai"||t==="deepseek")return"thinking-disabled";if(t==="qwen")return"enable-thinking-false"}}var Pr="bre:auto-effort",zi=Promise.resolve();function $i(e){zi=zi.then(e,e).then(()=>{},()=>{})}function Vi(e,t=document){t.dispatchEvent(new CustomEvent(Pr,{detail:{route:e}}))}function Yi(e,t=document){let n=r=>{let o=r.detail;typeof o?.route!="string"||o.route.length===0||e(o.route)};return t.addEventListener(Pr,n),()=>{t.removeEventListener(Pr,n)}}var _=require("react/jsx-runtime"),Xi=new Intl.NumberFormat("en-US");function Ze(e){return e===void 0||e.length===0?{declared:!1,image:!1}:{declared:!0,image:e.includes("image")}}function xn(e){return e.declared?e.image?["text","image"]:["text"]:null}function vn(e,t){return e.declared?t===void 0?!1:e.image?t.includes("image"):!t.includes("image"):t===void 0}function Fr(e,t,n){let r=e?t:!1;return e&&r===void 0&&n===void 0?"keep":r}function En(e){let t=e.appliedCompat;return e.initialCompat?.supportsThinkingTokenBudget===!0&&e.initialCompat?.thinkingTokenBudgetField===void 0&&t?.thinkingTokenBudgetField===void 0&&(e.routeApi??"").toLowerCase()==="openai-completions"&&(t={...t??{},thinkingTokenBudgetField:"thinking_token_budget"}),{efforts:e.efforts,...t===void 0?{}:{compat:t},...e.input===void 0?{}:{input:e.input},...e.defaultEffort===void 0?{}:{defaultEffort:e.defaultEffort}}}function kn({route:e,routeApi:t,routeBaseURL:n,modelId:r,modelName:o,efforts:i,effortsUnset:s=!1,input:a,compat:d,defaultEffort:l,index:p,staged:g=!1,officialInputTypes:c=!1,api:u,readOnly:f,t:m}){let[h,v]=(0,j.useState)(()=>Qe(i)),[x,b]=(0,j.useState)(()=>Ze(a)),[A,R]=(0,j.useState)(()=>i!==!1),[H,O]=(0,j.useState)(()=>l??""),[L,F]=(0,j.useState)(!1),[y,I]=(0,j.useState)(void 0),[w,M]=(0,j.useState)(void 0),[N,W]=(0,j.useState)(""),[X,oe]=(0,j.useState)("low"),J=(0,j.useRef)(void 0),[Q,Z]=(0,j.useState)(void 0),[G,q]=(0,j.useState)(void 0),[B,U]=(0,j.useState)(void 0),S=(0,j.useRef)(!1),K=(0,j.useRef)(i),Y=(0,j.useRef)(a),le=(0,j.useRef)(l),ot=(0,j.useRef)(void 0),it=(0,j.useRef)(i);it.current=i;let Xt=(0,j.useRef)(s);Xt.current=s,(0,j.useEffect)(()=>Yi(E=>{if(E!==e||it.current!==void 0||Xt.current)return;let $=ot.current;$!==void 0&&$i($)}),[e]),(0,j.useEffect)(()=>{It(K.current,i)||(K.current=i,S.current||(v(Qe(i)),R(i!==!1))),Y.current!==a&&(Y.current=a,S.current||b(Ze(a))),le.current!==l&&(le.current=l,S.current||O(l??""))},[i,a,l]);let k=Je.filter(E=>h[E].on),ne=H===(l??"")?void 0:H===""?null:H,ie=A?pt(h):!1,ue=!It(ie,i)||!vn(x,a)||ne!==void 0,Re=(0,j.useRef)(void 0),He=()=>{S.current=!0,M(void 0),W(""),oe("low"),Z(void 0)},qe=(E,$,ae,Ee=A)=>{let ye=Fr(Ee,pt(E),i),Pd=vn($,a)?void 0:xn($),Oo=En({efforts:ye,input:Pd,defaultEffort:ae===(l??"")?void 0:ae===""?null:ae,appliedCompat:J.current,routeApi:t,initialCompat:d}),_o=JSON.stringify(Oo);Re.current!==_o&&(Re.current=_o,u.commit(e,r,Oo))},Jt=(E,$)=>{He();let ae=!$&&H===E?"":H;ae!==H&&O(ae),v(Ee=>{let ye={...Ee,[E]:{...Ee[E],on:$}};return $&&E!=="off"&&ye[E].wire.trim().length===0&&(ye[E]={...ye[E],wire:E}),qe(ye,x,ae),ye}),I(void 0)},sr=E=>{He(),R(E);let $=E?H:"";$!==H&&O($),qe(h,x,$,E),I(void 0)},Od=(E,$)=>{He(),v(ae=>{let Ee={...ae,[E]:{...ae[E],wire:$}};return qe(Ee,x,H),Ee}),I(void 0)},_d=E=>{He();let $={declared:!0,image:E};b($),qe(h,$,H),I(void 0)},Id=()=>{He();let E={declared:!1,image:!1};b(E),qe(h,E,H),I(void 0)},Ao=E=>{He(),O(E),qe(h,x,E),I(void 0)},Nd=E=>{He();let $=E.efforts!==!1;R($);let ae=Qe(E.efforts);v(ae);let Ee=E.input===void 0?x:Ze(E.input);E.input!==void 0&&b(Ee);let ye=H===""&&E.defaultEffort!==void 0?E.defaultEffort:H;ye!==H&&O(ye),M(E.efforts),W(E.source),oe(E.confidence),J.current=E.compat,Z(E.inputSource),q(E.contextWindow),U(E.maxTokens),I({kind:"info",text:m("appliedHint",{source:E.source,confidence:m("confidence_"+E.confidence)})}),qe(ae,Ee,ye,$)},Ro=async()=>{if(!(f||L)){F(!0),I(void 0);try{let E=g?await u.suggest(e,r,o,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}):await u.suggest(e,r,o);if(!E.ok){I({kind:"error",text:E.error==="no-suggestion"?m("noSuggestion"):E.error});return}Nd(E.suggestion)}catch(E){I({kind:"error",text:m("writeError",{message:String(E)})})}finally{F(!1)}}};(0,j.useEffect)(()=>{ot.current=Ro});let Dd=()=>{S.current=!1,u.withdraw(e,r),v(Qe(i)),R(i!==!1),b(Ze(a)),O(l??""),M(void 0),W(""),oe("low"),J.current=void 0,Z(void 0),q(void 0),U(void 0),I(void 0),Re.current=void 0},Cd=J.current?.thinkingFormat??ke(r,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}).compat?.thinkingFormat,Ho=ji(i,Cd),Oe=f||L;return(0,_.jsxs)("div",{className:"bre-effort-editor","data-plugin":re,children:[(0,_.jsxs)("label",{className:"bre-modality-row bre-thinking-switch",children:[(0,_.jsx)("input",{type:"checkbox",checked:A,disabled:Oe,"aria-label":m("thinkingMode")+" "+String(p+1),onChange:E=>{sr(E.target.checked)}}),(0,_.jsx)("span",{className:"bre-effort-level",children:m("thinkingMode")}),A?null:(0,_.jsx)("span",{className:"bre-effort-note",children:m("thinkingModeOff")})]}),A?(0,_.jsxs)("div",{className:"bre-effort-card",children:[(0,_.jsxs)("div",{className:"bre-effort-head",children:[(0,_.jsx)("span",{className:"bre-effort-title",children:m("reasoningEffort")}),(0,_.jsx)("button",{type:"button",className:"bre-link-button",disabled:Oe,onClick:()=>{Ro()},children:m("autoAdapt")})]}),(0,_.jsx)("div",{className:"bre-effort-grid",children:Je.map(E=>{let $=h[E];return(0,_.jsxs)("label",{className:"bre-effort-row",children:[(0,_.jsx)("input",{type:"checkbox",checked:$.on,disabled:Oe,"aria-label":m("level_"+E)+" "+String(p+1),onChange:ae=>{Jt(E,ae.target.checked)}}),(0,_.jsx)("span",{className:"bre-effort-level",children:m("level_"+E)}),$.on?(0,_.jsx)("input",{type:"text",className:"bre-effort-wire",value:$.wire,disabled:Oe,placeholder:m("wirePlaceholder"),"aria-label":m("level_"+E)+" "+m("wireValue"),onChange:ae=>{Od(E,ae.target.value)}}):(0,_.jsx)("span",{className:"bre-effort-empty"})]},E)})}),k.length>0?(0,_.jsxs)("div",{className:"bre-modality",children:[(0,_.jsx)("span",{className:"bre-effort-title",children:m("defaultEffortLabel")}),(0,_.jsxs)("label",{className:"bre-modality-row",children:[(0,_.jsxs)("select",{className:"bre-select",disabled:Oe,"aria-label":m("defaultEffortLabel")+" "+String(p+1),value:H,onChange:E=>{Ao(E.target.value)},children:[(0,_.jsx)("option",{value:"",children:m("defaultEffortUnset")}),(H!==""&&!k.includes(H)?[...k,H]:k).map(E=>(0,_.jsx)("option",{value:E,children:m("level_"+E)},E))]}),H!==""?(0,_.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:Oe,onClick:()=>{Ao("")},children:m("clearDefaultEffort")}):null]}),(0,_.jsx)("p",{className:"bre-modality-note",children:m("defaultEffortHint")})]}):null,c?null:(0,_.jsxs)("div",{className:"bre-modality",children:[(0,_.jsx)("span",{className:"bre-effort-title",children:m("inputModality")}),(0,_.jsxs)("label",{className:"bre-modality-row",children:[(0,_.jsx)("input",{type:"checkbox",checked:x.declared&&x.image,disabled:Oe,"aria-label":m("modalityImage")+" "+String(p+1),onChange:E=>{_d(E.target.checked)}}),(0,_.jsx)("span",{className:"bre-effort-level",children:m("modalityImage")}),x.declared?(0,_.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:Oe,onClick:Id,children:m("clearDeclaration")}):null]}),x.declared?null:(0,_.jsx)("p",{className:"bre-modality-note",children:m("modalityInherit")})]}),g?(0,_.jsx)("p",{className:"bre-effort-note",children:m("stagedHint")}):null,i===!1?(0,_.jsx)("p",{className:"bre-effort-note",children:m("reasoningDisabled")}):null,Ho===void 0?null:(0,_.jsx)("p",{className:"bre-effort-note",children:m(Ho==="thinking-disabled"?"defaultRiskDisabled":"defaultRiskQwen")}),pt(h)===void 0&&i!==void 0?(0,_.jsx)("p",{className:"bre-effort-note",children:m("bareHint")}):null,w!==void 0?(0,_.jsxs)("div",{className:"bre-suggestion",children:[(0,_.jsx)("p",{className:"bre-effort-note",children:m("appliedHint",{source:N,confidence:m("confidence_"+X)})}),Q===void 0?null:(0,_.jsx)("p",{className:"bre-effort-note",children:m(Q==="endpoint"?"inputHintEndpoint":Q==="knowledge"?"inputHintKnowledge":"inputHintHeuristic")}),G===void 0&&B===void 0?null:(0,_.jsxs)("div",{className:"bre-reference",children:[(0,_.jsx)("span",{className:"bre-reference-title",children:m("referenceTitle")}),(0,_.jsxs)("span",{className:"bre-reference-values",children:[G===void 0?null:(0,_.jsxs)("span",{children:[m("contextWindowLabel")," ",(0,_.jsx)("b",{children:Xi.format(G)})]}),B===void 0?null:(0,_.jsxs)("span",{children:[m("maxTokensLabel")," ",(0,_.jsx)("b",{children:Xi.format(B)})]})]})]})]}):null,y===void 0?null:(0,_.jsx)("p",{className:"bre-effort-message bre-"+y.kind,role:y.kind==="error"?"alert":"status",children:y.text}),ue?(0,_.jsx)("p",{className:"bre-effort-message bre-info",role:"status",children:m("pendingSave")}):null,ue?(0,_.jsx)("p",{className:"bre-effort-note",children:m("pendingHint")}):null,(0,_.jsx)("div",{className:"bre-effort-actions",children:(0,_.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:Oe||!ue,onClick:Dd,children:m("reset")})})]}):null]})}var Be="data-bre-auto-effort",qr='[class*="modelCatalog"]',Cl='[class*="modelListHead"]',Pl='button[class*="linkButton"]',Fl="bre-auto-effort",ql="bre-auto-effort-note",Wl="data-bre-auto-effort-phase",Qi="bre-auto-effort-note-text",Zi="bre-auto-effort-note-detail",Kl=3e3;function Bl(e){return e.blocked==="busy"?null:e.failed!==void 0?{phase:"failed",count:0,missed:0,detail:e.failed}:e.blocked!==void 0?{phase:"blocked",count:0,missed:0,detail:""}:e.held>0?{phase:"done",count:e.held,missed:e.unsuggested,detail:""}:e.unsuggested>0?{phase:"unsuggested",count:0,missed:e.unsuggested,detail:""}:{phase:"empty",count:0,missed:0,detail:""}}function Wr(e){return Array.from(e.querySelectorAll(qr)).filter(t=>(t.parentElement?.closest(qr)??null)===null)}function Tn(e,t,n){let r=new Map;for(let a of t)a.route.length!==0&&a.catalogue.isConnected&&r.set(a.catalogue,a.route);let o=n.t("autoAdaptAll");for(let[a,d]of r){let l=a.querySelector(Cl)??a,p=l.querySelector(`[${Be}]`)??Gl();ts.set(p,n);let g=Ul(l);g!==null?g.nextElementSibling!==p&&g.after(p):l.lastElementChild!==p&&l.append(p),Vl(p,d,o)}let i=new Set,s=new Set(r.values());for(let a of Array.from(e.querySelectorAll(`[${Be}]`))){let d=a.closest(qr),l=a.getAttribute(Be)??"";if(d===null||!r.has(d)||i.has(d)){a.remove(),l.length>0&&!s.has(l)&&Kr(l);continue}i.add(d)}}function Kr(e){let t=et.get(e);t!==void 0&&(t.timer!==null&&clearTimeout(t.timer),t.note.remove(),et.delete(e))}function es(){for(let e of Array.from(document.querySelectorAll(`[${Be}]`)))e.remove();for(let e of et.values())e.timer!==null&&clearTimeout(e.timer),e.note.remove();et.clear()}function Ul(e){let t=Array.from(e.querySelectorAll(Pl));return t.length===0?null:t[t.length-1]}function Gl(){let e=document.createElement("button");return e.className=Fl,e.setAttribute("type","button"),e.setAttribute(Be,""),e.addEventListener("click",()=>{let t=e.getAttribute(Be)??"";if(t.length===0)return;let n=ts.get(e);n!==void 0&&(Vi(t),jl(t,n))}),e}async function jl(e,t){if(t.onRequest===void 0)return;Ji(e,{phase:"working",count:0,missed:0,detail:""},t,0);let n;try{n=await t.onRequest(e)}catch(o){n={held:0,unsuggested:0,failed:String(o)}}if(n===void 0){Kr(e);return}let r=Bl(n);r!==null&&Ji(e,r,t,Kl)}function Ji(e,t,n,r){let o=et.get(e);o!==void 0&&!o.note.isConnected&&(o.timer!==null&&clearTimeout(o.timer),et.delete(e),o=void 0),o!==void 0&&o.timer!==null&&clearTimeout(o.timer);let i=o?.note??zl();i.setAttribute(Wl,t.phase);let s=i.querySelector(`.${Qi}`),a=i.querySelector(`.${Zi}`),d=$l(t,n);s.textContent!==d.text&&(s.textContent=d.text),a.textContent!==d.detail&&(a.textContent=d.detail),a.hidden=d.detail.length===0,o===void 0&&document.body.append(i);let l=r>0?setTimeout(()=>{Kr(e)},r):null;i.style.setProperty("--bre-note-hold",`${r}ms`),et.set(e,{note:i,timer:l})}function zl(){let e=document.createElement("div");return e.className=ql,e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<span class="${Qi}"></span><span class="${Zi}"></span>`,e}var ts=new WeakMap,et=new Map;function $l(e,t){switch(e.phase){case"working":return{text:t.t("autoAdaptWorking"),detail:""};case"done":return{text:t.t("autoAdaptDone",{count:e.count}),detail:e.missed>0?`${t.t("autoAdaptDoneHint",{count:e.count})} ${t.t("autoAdaptUnsuggestedHint")}`:t.t("autoAdaptDoneHint",{count:e.count})};case"empty":return{text:t.t("autoAdaptEmpty"),detail:t.t("autoAdaptEmptyHint")};case"unsuggested":return{text:t.t("autoAdaptUnsuggested"),detail:t.t("autoAdaptUnsuggestedHint")};case"blocked":return{text:t.t("autoAdaptBlocked"),detail:t.t("autoAdaptBlockedHint")};case"failed":return{text:t.t("autoAdaptFailed",{message:e.detail}),detail:e.detail}}}function Vl(e,t,n){e.getAttribute(Be)!==t&&e.setAttribute(Be,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("title")!==null&&e.removeAttribute("title")}var Nt="data-bre-drag-handle",Br="data-bre-row-head",Ur="data-bre-drop-side",Mn="bre-row-dragging",Ln="bre-row-drop-target",as="bre-drag-ghost",ds="bre-drop-line",ns="http://www.w3.org/2000/svg",rs=8,os=28,is=12,Yl="transform 180ms cubic-bezier(0.2, 0.7, 0.3, 1)",Xl='button, a, input, textarea, select, [contenteditable], [role="button"], [role="switch"], [role="checkbox"], [role="textbox"], [role="combobox"]';function Sn(){return{sources:new WeakSet,lists:new WeakSet,line:void 0,sighted:new WeakMap,drag:void 0}}function de(e){return Array.from(e.children).filter(t=>t instanceof HTMLElement)}function Jl(e,t){let n=e.style.order;if(n==="")return t;let r=Number.parseInt(n,10);return Number.isNaN(r)?t:r}function tt(e){return de(e).map((t,n)=>({row:t,key:Jl(t,n),index:n})).sort((t,n)=>t.key-n.key||t.index-n.index).map(t=>t.row)}function ls(e,t){let n=e.filter(s=>t.includes(s)),r=n.map(s=>e.indexOf(s)),o=t.filter(s=>n.includes(s)),i=new Map;e.forEach((s,a)=>i.set(s,a)),r.forEach((s,a)=>{let d=o[a];d!==void 0&&i.set(d,s)});for(let[s,a]of i){let d=String(a);s.style.order!==d&&(s.style.order=d)}}function An(e,t){ls(tt(e),t)}function Gr(e,t){let n=de(e),r=n.map(o=>o.offsetTop);t(),n.forEach((o,i)=>{let s=r[i]-o.offsetTop;s!==0&&(o.style.transition="none",o.style.transform=`translateY(${s}px)`,o.offsetHeight,o.style.transition=Yl,o.style.transform="")})}function Dt(e,t){return tt(e).map(n=>t(n)).filter(n=>n!==void 0)}function Ql(e,t,n){let r=Dt(e,t);if(n===void 0||!Zl(e,n))return r;let o=new Map;return n.ids.forEach((i,s)=>{o.has(i)||o.set(i,s)}),r.map((i,s)=>({id:i,key:o.get(i)??n.ids.length+s})).sort((i,s)=>i.key-s.key).map(i=>i.id)}function Zl(e,t){return t.rows.some(n=>!e.contains(n))}function eu(e,t){let n=[];for(let o of tt(e)){let i=t(o);i!==void 0&&n.push(i)}let r=[];for(let o of de(e))t(o)!==void 0&&r.push(o);return{ids:n,rows:r}}function us(e,t,n){let r=new Map;for(let[a,d]of t.entries())r.has(d)||r.set(d,a);let o=de(e),s=[...o.filter(a=>n(a)!==void 0)].sort((a,d)=>{let l=r.get(n(a))??Number.MAX_SAFE_INTEGER,p=r.get(n(d))??Number.MAX_SAFE_INTEGER;return l-p});ls(o,s)}function Rn(e){for(let t of e)t.style.order="",t.style.transition="",t.style.transform=""}function fs(e,t,n,r){let i=e.filter(s=>s!==t).indexOf(n);return i<0?Math.max(0,e.indexOf(t)):r?i+1:i}function cs(e,t){let n,r=Number.POSITIVE_INFINITY;for(let o of e){let i=o.getBoundingClientRect(),s=t<i.top?i.top-t:t>i.bottom?t-i.bottom:0;s<r&&(r=s,n=o)}return n}function tu(e,t){let n=e.getBoundingClientRect();return n.height<=0?!0:t>n.top+n.height/2}function ps(e,t){let n=e.getBoundingClientRect();return t?n.bottom+rs/2-1:n.top-rs/2-1}function ms(){let e=document.createElementNS(ns,"svg");e.setAttribute("width","10"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 10 14"),e.setAttribute("fill","none"),e.setAttribute("aria-hidden","true");let t=[[2.5,3],[7.5,3],[2.5,7],[7.5,7],[2.5,11],[7.5,11]];for(let[n,r]of t){let o=document.createElementNS(ns,"circle");o.setAttribute("cx",String(n)),o.setAttribute("cy",String(r)),o.setAttribute("r","1.2"),o.setAttribute("fill","currentColor"),e.appendChild(o)}return e}function gs(e,t){let n=document.createElement("div");n.className=as,n.setAttribute("aria-hidden","true"),n.appendChild(ms());let r=document.createElement("span");r.className="bre-drag-ghost-name";let o=t??e.querySelector('[class*="rowName"]')?.textContent?.trim();return r.textContent=o===void 0?"":o,n.appendChild(r),n}function nu(e){return!(e instanceof Element)||e.closest(`[${Nt}]`)!==null?!1:e.closest(Xl)!==null}function hs(e){return e.parentElement??void 0}function bs(e){for(let t of de(e))t.classList.remove(Ln),t.removeAttribute(Ur)}function Hn(e){let t=e.parentElement;for(;t!==null;){if(ys(t))return t;t=t.parentElement}let n=document.scrollingElement;return n instanceof HTMLElement&&n.scrollHeight>n.clientHeight?n:void 0}function jr(e){let t=[],n=e.parentElement;for(;n!==null;)ys(n)&&t.push(n),n=n.parentElement;let r=document.scrollingElement;return r instanceof HTMLElement&&r.scrollHeight>r.clientHeight&&!t.includes(r)&&t.push(r),t}function ys(e){if(e.scrollHeight<=e.clientHeight)return!1;let t=e.style.overflowY,n=t.length>0?t:window.getComputedStyle(e).overflowY;return n==="auto"||n==="scroll"||n==="overlay"}function ws(e,t){let n=e.getBoundingClientRect();return n.height<=0?0:t<n.top+os?-is:t>n.bottom-os?is:0}function vs(e,t,n){if(t.scrollStep===n)return;if(t.scrollStep=n,n===0){t.frame!==void 0&&(window.cancelAnimationFrame(t.frame),t.frame=void 0);return}let r=t.scroller;if(r===void 0||t.frame!==void 0)return;let o=()=>{t.frame=void 0,!(e.drag!==t||t.scrollStep===0)&&(r.scrollTop+=t.scrollStep,t.frame=window.requestAnimationFrame(o))};t.frame=window.requestAnimationFrame(o)}function ru(e){let t=e.line;if(t!==void 0&&t.isConnected)return t;let n=document.createElement("div");return n.className=ds,n.setAttribute("aria-hidden","true"),document.body.appendChild(n),e.line=n,n}function ou(e,t,n){let r=ru(e),o=t.getBoundingClientRect();r.style.top=`${ps(t,n)}px`,r.style.left=`${o.left}px`,r.style.width=`${o.width}px`,r.style.display="block",r.setAttribute(Ur,n?"after":"before")}function iu(e){e.line!==void 0&&(e.line.style.display="none")}function su(e){let t=e.drag;e.drag=void 0,t!==void 0&&(vs(e,t,0),iu(e),t.row.classList.remove(Mn),bs(t.list),t.dropped||Gr(t.list,()=>{An(t.list,t.before)}))}function au(e,t,n,r){if(nu(t.target)){t.preventDefault();return}let o=hs(e),i=n.idOf(e);if(o===void 0||i===void 0){t.preventDefault();return}let s={row:e,list:o,before:tt(o),scroller:Hn(o),adapter:n,scrollStep:0,frame:void 0,dropped:!1};r.drag=s,e.classList.add(Mn);let a=gs(e,n.labelOf(e));Number.isFinite(t.clientX)&&Number.isFinite(t.clientY)&&(a.style.left=`${t.clientX}px`,a.style.top=`${t.clientY}px`),document.body.appendChild(a);let d=t.dataTransfer;if(d!=null)try{d.effectAllowed="move",d.setData("text/plain",i),d.setDragImage(a,Math.round(a.offsetWidth/2),Math.round(a.offsetHeight/2))}catch{}window.setTimeout(()=>{a.remove()},0)}function du(e,t,n){let r=n.drag;if(r===void 0||r.list!==e)return;let o=t.target,i=o instanceof Element?r.adapter.rowOf(o,e):void 0,s=tt(e),a=i!==void 0&&s.includes(i)?i:cs(s,t.clientY);if(a===void 0)return;t.preventDefault();let d=t.dataTransfer;d!=null&&(d.dropEffect="move");let l=tu(a,t.clientY),p=fs(s,r.row,a,l);p!==s.indexOf(r.row)&&Gr(e,()=>{An(e,pr(s,r.row,p))}),bs(e),a.classList.add(Ln),a.setAttribute(Ur,l?"after":"before"),ou(n,a,l),vs(n,r,r.scroller===void 0?0:ws(r.scroller,t.clientY))}function lu(e,t){t.lists.has(e)||(t.lists.add(e),e.addEventListener("dragover",n=>{du(e,n,t)}),e.addEventListener("drop",n=>{let r=t.drag;r===void 0||r.list!==e||(n.preventDefault(),r.dropped=!0,r.adapter.commit(e))}))}function uu(e,t,n,r){r.sources.has(e)||(r.sources.add(e),n.seatDrags&&(e.setAttribute(Br,"1"),e.setAttribute("draggable","true")),e.addEventListener("dragstart",o=>{au(t,o,n,r)}),e.addEventListener("dragend",()=>{su(r)}))}function fu(e,t,n,r){e.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation()}),e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let i=hs(t);if(i===void 0)return;let s=tt(i),a=s.indexOf(t);if(a<0)return;let d=a+(o.key==="ArrowUp"?-1:1);d<0||d>=s.length||(o.preventDefault(),Gr(i,()=>{An(i,pr(s,t,d))}),n.commit(i),e.focus())})}function ss(e,t,n,r){let o=r.gripLabel(t,n),i=r.gripHint();e.getAttribute(Nt)!==n&&e.setAttribute(Nt,n),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}function cu(e,t,n,r,o){let i=t.querySelector(`[${Nt}]`);if(i!==null){ss(i,e,n,r);return}r.decorate?.(e,t);let s=document.createElement("span");s.className="bre-drag-grip",s.setAttribute("role","button"),s.setAttribute("tabindex","0"),s.setAttribute("draggable","true"),s.appendChild(ms()),ss(s,e,n,r),fu(s,e,r,o),uu(r.seatDrags?t:s,e,r,o),t.insertBefore(s,t.firstChild)}function On(e,t,n,r){if(!e.isConnected)return;lu(t,r);for(let i of de(t)){let s=n.idOf(i);if(s===void 0)continue;let a=n.seatOf(i);a!==void 0&&cu(i,a,s,n,r)}if(r.drag!==void 0)return;let o=Ql(t,n.idOf,r.sighted.get(t));us(t,n.order(o),n.idOf),r.sighted.set(t,eu(t,n.idOf))}function _n(e){e.drag=void 0;for(let t of Array.from(document.querySelectorAll(`[${Nt}]`)))t.remove();for(let t of Array.from(document.querySelectorAll(`[${Br}]`)))t.removeAttribute(Br),t.removeAttribute("draggable");for(let t of Array.from(document.querySelectorAll(`.${Mn}, .${Ln}`)))t.classList.remove(Mn,Ln);for(let t of Array.from(document.querySelectorAll(`.${ds}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${as}`)))t.remove();e.line=void 0}function mt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var zr="__breLedgerDocument";function Ls(){let e=globalThis;return e[zr]??(e[zr]=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`)}var Nn="bre:held-writes:v1";function Qr(){try{return typeof sessionStorage>"u"?void 0:sessionStorage}catch{return}}function Me(e){let t=Qr();if(t!==void 0)try{if(e.pending.size===0&&e.queued.size===0){t.removeItem(Nn);return}let n={document:Ls(),committed:[...e.committing].filter(r=>e.queued.has(r)),pending:[...e.pending].map(([r,o])=>[r,[...o]]),queued:[...e.queued].map(([r,o])=>[r,[...o]])};t.setItem(Nn,JSON.stringify(n))}catch{}}function xs(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(!Array.isArray(r)||r.length!==2)return;let[o,i]=r;if(typeof o!="string"||!Array.isArray(i))return;let s=[];for(let a of i){if(!Array.isArray(a)||a.length!==2)return;let[d,l]=a;if(typeof d!="string"||!C(l)||t!==void 0&&!t(l))return;s.push([d,l])}n.push([o,s])}return n}function pu(e){let t=Qr();if(t!==void 0)try{let n=t.getItem(Nn);if(n===null)return;let r=JSON.parse(n);if(r.document!==Ls())return;let o=xs(r.pending),i=xs(r.queued,ku);if(o===void 0||i===void 0)return;let s=Array.isArray(r.committed)?r.committed.filter(a=>typeof a=="string"):[];for(let[a,d]of o)e.pending.set(a,new Map(d));for(let[a,d]of i)s.includes(a)&&(e.queued.set(a,new Map(d)),e.committing.add(a))}catch{}}function Ss(e,t){(async()=>{try{await Zr(t,e),await eo(t,e)}catch(n){console.error(`[bre] teardown flush failed: ${n instanceof Error?n.message:String(n)}`)}})()}function As(e,t){(async()=>{try{await Zr(t,e,!0),await eo(t,e,!0)}catch(n){console.error(`[bre] unload flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{try{Qr()?.removeItem(Nn)}catch{}}})()}function Rs(){let e={disposed:!1,mounted:new Map,describePromise:void 0,pending:new Map,missedScans:new Map,queued:new Map,editing:void 0,flushing:!1,flushFailures:0,nextFlushAt:0,committing:new Set,adapting:new Set,signalsUnavailable:!1,submitWired:new WeakSet,cancelWired:new WeakSet,disclosureWired:new WeakSet,editWired:new WeakSet};return pu(e),e}async function mu(e,t){if(!t.flushing){t.flushing=!0;try{let n=await Zr(e,t),r=await eo(e,t);n||r?Es(e,t):(t.flushFailures=0,t.nextFlushAt=0)}catch(n){Es(e,t),console.error(`[bre] idle flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{t.flushing=!1}try{e.onIdle?.()}catch(n){console.error(`[bre] idle hook failed: ${n instanceof Error?n.message:String(n)}`)}}}function Es(e,t){t.flushFailures+=1;let n=Math.min(2**t.flushFailures*500,3e4);t.nextFlushAt=Date.now()+n,e.onBackoff?.(n)}function gu(e){return e.queued.size>0||e.pending.size>0}function Pt(e,t,n,r,o,i,s){try{let a=e.pending.get(t);if(r===void 0){if(a===void 0)return;a.delete(n),a.size===0&&e.pending.delete(t);return}e.pending.set(t,(a??new Map).set(n,{efforts:r,...o===void 0?{}:{compat:o},...i===void 0?{}:{input:i},...s===void 0?{}:{defaultEffort:s}}))}finally{Me(e)}}function Hs(e,t,n,r){e.queued.set(t,(e.queued.get(t)??new Map).set(n,r)),Me(e)}function hu(e,t,n){let r=e.pending.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.pending.delete(t),Me(e))}function bu(e,t,n){let r=e.queued.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.queued.delete(t),Me(e))}function yu(e,t,n){hu(e,t,n),bu(e,t,n)}function wu(e,t){e.queued.delete(t),e.pending.delete(t),e.missedScans.delete(t),e.committing.delete(t),Me(e)}function vu(e,t,n){if(t===void 0)return null;let i=t[ge]!==!0&&t.reasoningEfforts!==void 0&&typeof t[st]=="number"||t[ge]!==!0&&n?.efforts!==void 0&&xu(t.reasoningEfforts,n.efforts)?!1:t.reasoningEfforts!==void 0||t[ge]===!0||e.efforts==="keep",a=t[_e]!==!0&&n?.input!==void 0&&Eu(t.input,n.input)?!1:Array.isArray(t.input)&&t.input.length>0||t[_e]===!0,d=i?"keep":e.efforts,l=a?void 0:e.input,p=e.defaultEffort;return d==="keep"&&l===void 0&&p===void 0?null:{efforts:d,...e.compat===void 0?{}:{compat:e.compat},...l===void 0?{}:{input:l},...p===void 0?{}:{defaultEffort:p}}}function xu(e,t){if(e===t)return!0;if(!C(e)||!C(t))return!1;let n=Object.keys(t);if(Object.keys(e).length!==n.length)return!1;let r=t;return n.every(o=>e[o]===r[o])}function Eu(e,t){if(!Array.isArray(e)||e.length!==t.length)return!1;let n=new Set(t);return e.every(r=>typeof r=="string"&&n.has(r))}function ku(e){if(!C(e))return!1;let t=e.efforts;return t===!1||t==="keep"||C(t)}async function Tu(e,t,n,r,o=!1){let i=await e.describeNamespace(),s=ce(i.namespace),a=[];for(let[g,c]of[...r]){let u=fn(s,n).find(x=>x.id===g);if(u===void 0||t.pending.get(n)?.get(g)!==c)continue;let f=Ve(s,n),m=typeof u.name=="string"?u.name:void 0,h=ke(g,m===void 0?f:{...f,displayName:m}),v=vu(c,u,{...h.efforts===void 0?{}:{efforts:h.efforts},...h.input===void 0?{}:{input:h.input}});if(v===null){Pt(t,n,g,void 0);continue}a.push({modelId:g,efforts:v.efforts,...v.compat===void 0?{}:{compat:v.compat},...v.input===void 0?{}:{input:v.input},...v.defaultEffort===void 0?{}:{defaultEffort:v.defaultEffort}})}if(a.length===0)return!1;let d=!1,l=await Ht(e.api,n,a,()=>d?e.describeNamespace():(d=!0,Promise.resolve(i)),o?void 0:Us),p=!1;return a.forEach((g,c)=>{let u=l[c];if(u?.aborted!==!0){if(u?.ok===!0||u?.modelNotFound===!0){Pt(t,n,g.modelId,void 0);return}p=!0,console.error(`[bre] staged flush write failed for "${n}"/"${g.modelId}": ${u?.error??"unknown"}`)}}),p}async function Zr(e,t,n=!1){for(let s of[...t.committing])t.queued.has(s)||t.committing.delete(s);if(![...t.queued.keys()].some(s=>t.committing.has(s)||t.signalsUnavailable)||(await e.describeNamespace()).writable!==!0)return Me(t),!1;let i=!1;for(let[s,a]of[...t.queued]){if(!t.committing.has(s)&&!t.signalsUnavailable)continue;let l=[...a].map(([c,u])=>({modelId:c,efforts:u.efforts,...u.compat===void 0?{}:{compat:u.compat},...u.input===void 0?{}:{input:u.input},...u.defaultEffort===void 0?{}:{defaultEffort:u.defaultEffort}})),p=await Ht(e.api,s,l,void 0,n?void 0:Us),g=!1;l.forEach((c,u)=>{let f=p[u];if(f?.aborted===!0){g=!0;return}if(f?.ok===!0||f?.modelNotFound===!0){a.delete(c.modelId);return}console.error(`[bre] held write failed for "${s}"/"${c.modelId}": ${f?.error??"unknown"}`)}),a.size===0?(t.queued.delete(s),t.committing.delete(s)):g||(i=!0)}return Me(t),i}async function eo(e,t,n=!1){if(t.pending.size===0)return!1;let r=await e.describeNamespace();if(r.writable!==!0)return!1;let o=ce(r.namespace),i=!1;for(let[s,a]of[...t.pending]){if(a.size===0){t.pending.delete(s);continue}mt(o,s)&&await Tu(e,t,s,a,n)&&(i=!0)}return Me(t),i}function pe(e,t){for(let n of t){let r=Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).find(o=>(o.getAttribute("aria-label")??"").startsWith(n));if(r!==void 0&&r.value.trim().length>0)return r.value.trim()}return""}function Ft(e){return e.closest('[class*="editor"], [class*="rowCard"], [class*="addCard"]')??void 0}function Mu(e){let t=e.closest('[class*="modelEntry"]');if(t===null){let r=Ft(e);if(r===void 0)return;let o=Array.from(r.querySelectorAll('[class*="modelAdvanced"]'));return o.find(i=>i.offsetParent!==null)??o[0]}let n=Array.from(t.querySelectorAll('[class*="modelAdvanced"]'));return n.find(r=>r.offsetParent!==null)??n[0]}function Lu(e,t){return Array.from(e.querySelectorAll("button[aria-label]")).find(n=>t.some(r=>(n.getAttribute("aria-label")??"").startsWith(r)))}function Su(){return new Promise(e=>{if(typeof window.requestAnimationFrame!="function"){e();return}let t,n=()=>{window.clearTimeout(r),t!==void 0&&window.cancelAnimationFrame(t),e()},r=window.setTimeout(n,100);t=window.requestAnimationFrame(n)})}function In(e){return e.querySelector('[class*="modelInputTypes"]')!==null}var Au="modelReasoning",Yr="data-bre-reasoning-hidden";function Os(e){return e.querySelector(`[class*="${Au}"]`)??void 0}function Ru(e){let t=Os(e);t!==void 0&&t.style.display!=="none"&&(t.setAttribute(Yr,"1"),t.style.display="none")}function $r(e){let t=Os(e);t!==void 0&&t.getAttribute(Yr)==="1"&&(t.removeAttribute(Yr),t.style.display==="none"&&(t.style.display=""))}function _s(e,t){let n=e.querySelector('[class*="modelInputTypes"]');if(n===null)return;let r=Array.from(n.querySelectorAll('input[type="checkbox"]')),o=r.find(i=>{let s=i.closest("label")?.textContent?.trim();return s!==void 0&&t.includes(s)});return o!==void 0?o:r.length===2?r[1]:void 0}function Dn(e,t,n){let r=_s(e,n);return r===void 0||r.disabled?!1:(r.checked!==t&&r.click(),!0)}function Xr(e,t,n){return t==null||e===void 0?t:Dn(e,t.includes("image"),n)?void 0:t}async function Hu(e,t,n){if(e===void 0)return!1;let r=t.inputImage;if(In(e))return Dn(e,!0,r);let o=e.closest('[class*="modelEntry"]')??e;if(o.querySelector('[class*="modelAdvanced"]')!==null)return!1;let i=Lu(o,t.capacity);if(i===void 0||i.disabled)return!1;i.click(),In(o)||await n();try{return In(o)&&Dn(o,!0,r)}finally{i.click()}}function Ou(e,t,n,r,o){n.disposed||!e.isConnected||no(e)===void 0||Array.from(e.querySelectorAll("button[aria-label]")).some(s=>o.capacity.some(a=>(s.getAttribute("aria-label")??"").startsWith(a)))||Tn(e,_u(e,ce(r.namespace),o),{t:t.t,onRequest:s=>Is(n,t,s)})}function _u(e,t,n){let r=[];for(let o of Wr(e)){let i=Ft(o);if(i===void 0)continue;let s=De(i,t,n);s===void 0||s.staged||r.push({catalogue:o,route:s.route})}return r}function Iu(e,t,n){let r=[],o=new Set;for(let i of e){if(o.has(i.card))continue;o.add(i.card);let s=De(i.card,t,n);if(s===void 0)continue;let[a]=Wr(i.card);a!==void 0&&r.push({catalogue:a,route:s.route})}return r}function Nu(e,t,n,r){let o=[],i=new Set;for(let s of r.capacity){let a=Array.from(e.querySelectorAll("button[aria-label]")).filter(d=>(d.getAttribute("aria-label")??"").startsWith(s));for(let d of a){let l=Ft(d);if(l===void 0)continue;let p=d.closest('[class*="modelEntry"]')??l,g=pe(p,r.modelId);g.length===0||i.has(g)||De(l,n,r)?.route===t&&(i.add(g),o.push({id:g,name:pe(p,r.modelName),row:p}))}}return o}async function Is(e,t,n,r=[]){if(n.length===0)return{held:0,unsuggested:0,blocked:"unknown-route"};if(e.adapting.has(n))return{held:0,unsuggested:0,blocked:"busy"};e.adapting.add(n);let o=0,i=0;try{let s,a=()=>s??(s=t.describeNamespace()),d=await a(),l=ce(d.namespace);if(d.writable!==!0)return{held:0,unsuggested:0,blocked:"unwritable"};if(!mt(l,n)&&r.length===0)return{held:0,unsuggested:0,blocked:"unknown-route"};let g=fn(l,n),c=new Set;for(let O of g){let L=typeof O.id=="string"?O.id:"";L.length>0&&c.add(L)}let u=g.slice();for(let O of r)O.id.length===0||c.has(O.id)||u.push({id:O.id,name:O.name});if(u.length===0)return{held:0,unsuggested:0,blocked:"no-models"};let f=l[n]??{},m=typeof f.api=="string"?f.api:void 0,h=new Set,v=new Map;for(let[O,L]of e.mounted)L.props.route===n&&(v.set(L.props.modelId,O),L.props.efforts!==void 0&&h.add(L.props.modelId));let x=new Map;for(let O of r)O.row!==void 0&&x.set(O.id,O.row);let b=!1,A=(O,L)=>Xr(v.get(O),L,t.labels().inputImage),R=async(O,L)=>{if(L.image!==!0)return!1;let F=v.get(O)??x.get(O);return F===void 0?!1:Hu(F,t.labels(),Su)},H=yn(t.api,a,(O,L,F,y,I,w)=>{Pt(e,O,L,F,y,A(L,I),w)},(O,L,F)=>{Hs(e,O,L,{...F,input:A(L,F.input)})},void 0,()=>b);for(let O of u){let L=typeof O.id=="string"?O.id:"";if(L.length===0)continue;let F=pn(u,L),y=mn(u,L),I=F!==void 0||O[ge]===!0,w=Array.isArray(y)&&y.length>0||O[_e]===!0;if(h.has(L)&&!I)continue;if(I&&w){let q=v.get(L)??x.get(L);if(Array.isArray(y)&&y.includes("image")&&q!==void 0){let B=t.labels().inputImage,U=_s(q,B);U!==void 0&&!U.disabled&&!U.checked&&Dn(q,!0,B)}continue}let M=gn(u,L),N=bn(u,L)??"",W=await H.suggest(n,L,hn(u,L));if(!W.ok){i+=1;continue}let X=W.suggestion,oe=X.efforts!==!1,J=X.input===void 0?Ze(y):Ze(X.input);if(I){if(!J.image||e.queued.get(n)?.has(L)===!0)continue;if(await R(L,J)){o+=1;continue}b=!c.has(L),H.commit(n,L,En({efforts:"keep",input:xn(J)})),b&&t.onPendingChanged?.(),b=!1,o+=1;continue}let Q=X.defaultEffort??N,Z=Q===N?void 0:Q===""?null:Q;b=!c.has(L);let G=await R(L,J);H.commit(n,L,En({efforts:Fr(oe,pt(Qe(X.efforts)),F),input:G||vn(J,y)?void 0:xn(J),defaultEffort:Z,appliedCompat:X.compat,routeApi:m,initialCompat:M})),b&&t.onPendingChanged?.(),b=!1,o+=1}return{held:o,unsuggested:i}}catch(s){return console.warn("[bre] provider-wide adapt failed:",s),{held:o,unsuggested:i,failed:s instanceof Error?s.message:String(s)}}finally{e.adapting.delete(n)}}function Du(e){return e.querySelector(`[data-plugin="${re}"]`)!==null}function Cu(e,t){return e.route===t.route&&e.routeDisplayName===t.routeDisplayName&&e.routeApi===t.routeApi&&e.routeBaseURL===t.routeBaseURL&&e.modelId===t.modelId&&e.modelName===t.modelName&&e.index===t.index&&e.readOnly===t.readOnly&&e.defaultEffort===t.defaultEffort&&e.staged===t.staged&&e.officialInputTypes===t.officialInputTypes&&e.effortsUnset===t.effortsUnset&&It(e.efforts,t.efforts)&&Fu(e.input,t.input)&&Pu(e.compat,t.compat)}function Pu(e,t){return e===t?!0:e===void 0||t===void 0?!1:JSON.stringify({...e},Object.keys({...e,...t}).sort())===JSON.stringify({...t},Object.keys({...e,...t}).sort())}function Fu(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=new Set(e);return e.length===t.length&&t.every(r=>n.has(r))}function qu(e,t){return Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).some(n=>t.some(r=>(n.getAttribute("aria-label")??"").startsWith(r)))}function De(e,t,n){let r=e.querySelector('[class*="editorRoute"]')?.textContent?.trim();if(r!==void 0&&r.length>0&&mt(t,r))return{route:r,staged:!1};if(qu(e,n.routeId)){let s=pe(e,n.routeId);return s.length>0&&!mt(t,s)?{route:s,staged:!0}:void 0}let o=e.querySelector('[class*="editorTitle"], [class*="rowName"]')?.textContent?.trim();if(o===void 0||o.length===0)return;let i=Object.entries(t).find(([,s])=>s.displayName===o);if(i!==void 0)return{route:i[0],staged:!1};if(mt(t,o))return{route:o,staged:!1}}function Wu(e,t){let n=e.querySelector('[class*="editorActions"]');if(n===null)return;let r=Array.from(n.querySelectorAll("button"));if(r.length<2)return;let o=(g,c)=>(g.textContent??"").trim()===c,i=n.querySelector('[class*="primaryButton"]'),s=n.querySelector('[class*="secondaryButton"]');if(i!==null&&s!==null)return{submit:i,cancel:s};let a=[...r].reverse().find(g=>t.apply.some(c=>o(g,c))),d=[...r].reverse().find(g=>t.cancel.some(c=>o(g,c)));if(a!==void 0&&d!==void 0)return{submit:a,cancel:d};let l=r[r.length-1],p=r[r.length-2];if(!(l===void 0||p===void 0))return{submit:l,cancel:p}}function Cn(e,t,n){t.has(e)||(t.add(e),e.addEventListener("click",n,{capture:!0}))}var Vr=new WeakMap,Jr=new Set;function Ns(){for(let e of Array.from(Jr))e.release()}var to=420,Ku=320,Bu=160,ks=2e3,Uu=150,Ds=new Set(["PageUp","PageDown","Home","End","ArrowUp","ArrowDown"," "]);function Fn(e,t){let n=jr(e),r=n[0];if(r===void 0||!e.isConnected)return;let o=performance.now(),i=Vr.get(r);if(i!==void 0){i.deadline=Math.min(Math.max(i.deadline,o+t),i.startedAt+ks);return}let s=e.getBoundingClientRect(),a=s.top,d=s.height,l=new Map,p=new Map;for(let x of n)l.set(x,x.scrollTop),p.set(x,x.style.overflowAnchor),x.style.overflowAnchor="none";let g=new Set(n),c={deadline:o+t,startedAt:o,frame:void 0,release:()=>{}},u=()=>{if(Jr.delete(c)){c.frame!==void 0&&(window.cancelAnimationFrame(c.frame),c.frame=void 0);for(let[x,b]of p)x.style.overflowAnchor=b;Vr.delete(r),document.removeEventListener("wheel",f,!0),document.removeEventListener("touchstart",f,!0),document.removeEventListener("pointerdown",f,!0),document.removeEventListener("keydown",m,!0)}};function f(){u()}function m(x){Ds.has(x.key)&&u()}c.release=u,Vr.set(r,c),Jr.add(c),document.addEventListener("wheel",f,{capture:!0,passive:!0}),document.addEventListener("touchstart",f,{capture:!0,passive:!0}),document.addEventListener("pointerdown",f,{capture:!0}),document.addEventListener("keydown",m,{capture:!0});let h=0,v=()=>{if(c.frame=void 0,h+=1,!e.isConnected||h>=Uu){u();return}let x=e.getBoundingClientRect(),b=Math.abs(x.height-d)>.5;if(!b&&[...g].some(H=>H.scrollTop!==l.get(H))){u();return}let A=x.top-a;A!==0&&Gu(n,g,l,A);let R=performance.now();if(b&&(d=x.height,c.deadline=Math.min(Math.max(c.deadline,R+Bu),c.startedAt+ks)),R>=c.deadline){u();return}c.frame=window.requestAnimationFrame(v)};c.frame=window.requestAnimationFrame(v)}function Gu(e,t,n,r){let o=r;for(let i of[...t,...e]){if(o===0)break;let s=i.scrollTop;if(s!==n.get(i))continue;i.scrollTop=s+o;let a=i.scrollTop;a!==s&&(n.set(i,a),t.add(i),o-=a-s)}}var Cs='[class*="modelList"]',ju="bre-list-slack",zu=3e3,qn,gt=new WeakMap,ht=new Set;function Ps(e){if(!(e instanceof Element))return;let t=e.closest(Cs);if(t===null)return;let n=jr(t).map(r=>({host:r,top:r.scrollTop}));n.length!==0&&(qn={targets:n,at:performance.now()})}function Ce(){qn=void 0}function Fs(e){Ps(e.target)}function qs(e){if(Ds.has(e.key)){Ce();return}Ps(e.target)}var Ct=0;function Ws(){Ct+=1,!(Ct>1)&&(document.addEventListener("click",Fs,!0),document.addEventListener("keydown",qs,!0),document.addEventListener("focusin",Ce,!0),document.addEventListener("pointerdown",Ce,!0),document.addEventListener("wheel",Ce,{capture:!0,passive:!0}),document.addEventListener("touchstart",Ce,{capture:!0,passive:!0}))}function Pn(e){let t=gt.get(e);t!==void 0&&(gt.delete(e),ht.delete(t),t.scrollTarget.removeEventListener("scroll",t.onScroll),t.spacer.remove())}function $u(e){return e===document.scrollingElement?document:e}function Vu(){if(ht.size!==0)for(let e of Array.from(ht)){let t=e.host;if(!e.spacer.isConnected){gt.delete(t),ht.delete(e),e.scrollTarget.removeEventListener("scroll",e.onScroll);continue}t.scrollTop<=t.scrollHeight-t.clientHeight-e.height&&Pn(t)}}function Ts(e,t){return e.scrollTop>e.scrollHeight-e.clientHeight-t}function Yu(e=performance.now()){let t=qn;if(!(t===void 0||e-t.at>zu))for(let n of t.targets){let r=n.host;if(!r.isConnected)continue;let o=gt.get(r),i=o===void 0?0:o.height,s=r.scrollHeight-r.clientHeight-i,a=n.top-s;if(a<=0){o!==void 0&&!Ts(r,o.height)&&Pn(r);continue}let d=o;if(d===void 0){let l=document.createElement("div");l.className=ju,l.dataset.plugin=re,l.setAttribute("aria-hidden","true"),l.style.height="0px",(r===document.scrollingElement?document.body??r:r).appendChild(l);let g=()=>{let c=gt.get(r);c!==void 0&&!Ts(r,c.height)&&Pn(r)};d={host:r,spacer:l,height:0,onScroll:g,scrollTarget:$u(r)},gt.set(r,d),ht.add(d),d.scrollTarget.addEventListener("scroll",g,{passive:!0})}d.height!==a&&(d.height=a,d.spacer.style.height=`${a}px`),r.scrollTop!==n.top&&(r.scrollTop=n.top)}}function Ks(){if(Ct=Math.max(0,Ct-1),!(Ct>0)){document.removeEventListener("click",Fs,!0),document.removeEventListener("keydown",qs,!0),document.removeEventListener("focusin",Ce,!0),document.removeEventListener("pointerdown",Ce,!0),document.removeEventListener("wheel",Ce,!0),document.removeEventListener("touchstart",Ce,!0),qn=void 0;for(let e of Array.from(ht))Pn(e.host)}}function Bs(e,t=to){Yu(),Vu();let n=new Set;for(let r of Array.from(e.querySelectorAll(Cs))){let o=r.closest('[class*="rowCard"], [class*="setupCard"], [class*="addCard"]');o===null||n.has(o)||(n.add(o),Fn(o,t))}}function Xu(e,t){Cn(e,t,()=>{let n=e.closest('[class*="modelEntry"]')??e.closest('[class*="rowCard"]');n!==null&&Fn(e.closest('[class*="rowCard"]')??n,to)})}var Ms="{provider}";function Ju(e,t){let n=t.editProvider.map(o=>{let i=o.indexOf(Ms);return i<0?void 0:{prefix:o.slice(0,i),suffix:o.slice(i+Ms.length)}}).filter(o=>o!==void 0);if(n.length===0)return[];let r=[];for(let o of Array.from(e.querySelectorAll("button[aria-label]"))){let i=o.getAttribute("aria-label")??"";n.some(s=>i.length>s.prefix.length+s.suffix.length&&i.startsWith(s.prefix)&&i.endsWith(s.suffix))&&o.closest("[data-plugin]")===null&&r.push(o)}return r}function Qu(e,t){Cn(e,t,()=>{let n=e.closest('[class*="rowCard"], [class*="setupCard"], [class*="addCard"]');n!==null&&Fn(n,to)})}function no(e){return e.querySelector('[class*="editorActions"]')??e.querySelector('[class*="modelEntry"]')??void 0}function Us(){return no(Te())!==void 0}function Gs(e,t,n){if(n.disposed||!e.isConnected)return;let r=t.labels(),o=no(e)!==void 0;for(let a of Array.from(e.querySelectorAll('[class*="rowCard"], [class*="setupCard"]')))for(let d of Ju(a,r))Qu(d,n.editWired);let i=Array.from(e.querySelectorAll("button[aria-label]")).some(a=>r.capacity.some(d=>(a.getAttribute("aria-label")??"").startsWith(d)));if(!o){if(Tn(e,[],{t:t.t}),n.mounted.size>0){for(let[d,l]of n.mounted)$r(d),l.editor.unmount();n.mounted.clear()}let a=n.editing;n.editing=!1,(a!==!1||gu(n)&&Date.now()>=n.nextFlushAt)&&mu(t,n).catch(d=>{console.error(`[bre] idle pass failed: ${d instanceof Error?d.message:String(d)}`)});return}if(n.editing=!0,!i){for(let[d,l]of n.mounted)$r(d),l.editor.unmount();n.mounted.clear(),n.describePromise??(n.describePromise=t.describeNamespace());let a=r;n.describePromise.then(d=>{Ou(e,t,n,d,a)}).catch(d=>{console.error(`[bre] empty-catalog seat failed: ${d instanceof Error?d.message:String(d)}`)});return}for(let a of r.capacity)for(let d of Array.from(e.querySelectorAll("button[aria-label]")))(d.getAttribute("aria-label")??"").startsWith(a)&&Xu(d,n.disclosureWired);n.describePromise??(n.describePromise=t.describeNamespace());let s=a=>{if(n.disposed||!e.isConnected)return;let d=a.namespace,l=ce(d),p=[];for(let c of r.capacity){let u=Array.from(e.querySelectorAll("button[aria-label]")).filter(f=>(f.getAttribute("aria-label")??"").startsWith(c));for(let f of u){let m=Ft(f);if(m===void 0)continue;let h=f.closest('[class*="modelEntry"]')??m,v=pe(h,r.modelId);v.length!==0&&p.push({container:Mu(f),row:h,modelId:v,card:m})}}Tn(e,Iu(p,l,r),{t:t.t,onRequest:c=>Is(n,t,c,Nu(e,c,l,r))});for(let[c,u]of n.mounted)p.some(f=>f.container===c)||($r(c),u.editor.unmount(),n.mounted.delete(c));if(n.pending.size>0){let c=new Map;for(let f of p){let m=De(f.card,l,r);if(m===void 0)continue;let h=c.get(m.route);h===void 0&&c.set(m.route,h=new Set),h.add(f.modelId)}let u=new Map;for(let[f,m]of n.pending){if(!mt(l,f))continue;let h=c.get(f),v=[...m.keys()].filter(x=>!h?.has(x));v.length>0&&u.set(f,new Set(v))}for(let[f,m]of u){let h=n.missedScans.get(f);if(h!==void 0)for(let v of m)h.has(v)&&(Pt(n,f,v,void 0),h.delete(v))}n.missedScans=u}let g=new Set(p.map(c=>c.card));for(let c of g){let u=De(c,l,r);if(u===void 0)continue;let f=u.route,m=Wu(c,r);m===void 0?n.signalsUnavailable=!0:(n.signalsUnavailable=!1,Cn(m.submit,n.submitWired,()=>{let h=De(c,l,r)?.route??f;n.committing.add(h),Me(n)}),Cn(m.cancel,n.cancelWired,()=>{let h=De(c,l,r)?.route??f;wu(n,h)}))}p.forEach((c,u)=>{let f=c.container;if(f===void 0)return;let m=De(c.card,l,r);if(m===void 0)return;let{route:h,staged:v}=m,x=l[h]??{},b=fn(l,h),A=new Set(b.map(G=>G.id)),R=v||!A.has(c.modelId),H=R?n.pending.get(h)?.get(c.modelId)?.efforts:void 0,O=R?H==="keep"?void 0:H:pn(b,c.modelId),L=!R&&b.some(G=>G.id===c.modelId&&G[ge]===!0),F=R?n.pending.get(h)?.get(c.modelId)?.input:mn(b,c.modelId),y=R?n.pending.get(h)?.get(c.modelId)?.compat:gn(b,c.modelId),I=R?n.pending.get(h)?.get(c.modelId)?.defaultEffort??void 0:bn(b,c.modelId),w=R?pe(c.row,r.modelName):"",M=R?w.length>0?w:void 0:hn(b,c.modelId),N=v?pe(c.card,r.apiProtocol):"",W=v?pe(c.card,r.baseUrl):"",X=v&&N.length>0?N:typeof x.api=="string"?x.api:void 0,oe=v&&W.length>0?W:typeof x.baseURL=="string"?x.baseURL:void 0,J={route:h,routeDisplayName:v?h:typeof x.displayName=="string"?x.displayName:h,...X===void 0?{}:{routeApi:X},...oe===void 0?{}:{routeBaseURL:oe},modelId:c.modelId,...M===void 0?{}:{modelName:M},...O===void 0?{}:{efforts:O},...L?{effortsUnset:L}:{},...F===void 0?{}:{input:F},...y===void 0?{}:{compat:y},...I===void 0?{}:{defaultEffort:I},index:u,staged:R,officialInputTypes:In(f),api:yn(t.api,void 0,(G,q,B,U,S,K)=>{Pt(n,G,q,B,U,Xr(f,S,r.inputImage),K)},(G,q,B)=>{Hs(n,G,q,{...B,input:Xr(f,B.input,r.inputImage)})},G=>{yu(n,G,c.modelId)},()=>(De(c.card,l,r)?.staged??v)||!A.has(c.modelId)),readOnly:a.writable!==!0,t:t.t};Ru(f);let Q=n.mounted.get(f);if(Q!==void 0){Cu(Q.props,J)||(Q.props=J,Q.editor.render(J));return}if(Du(f))return;Fn(Ft(f)??c.card,Ku);let Z=t.mount(f,J);n.mounted.set(f,{editor:Z,props:J})})};n.describePromise.then(s,()=>{n.describePromise=void 0})}function z(e,t,n){e.getAttribute(t)!==n&&e.setAttribute(t,n)}function qt(e,t){e!==void 0&&e.hidden!==t&&(e.hidden=t)}function ve(e,t,n){e.classList.contains(t)!==n&&(n?e.classList.add(t):e.classList.remove(t))}function Wn(e,t){e!==void 0&&e.textContent!==t&&(e.textContent=t)}var ro=require("react");var se=require("react");function js(e){if(typeof e!="string")return;let t="";for(let n of e){let r=n.codePointAt(0)??0;r<32||r===127||(t+=n)}if(t=t.trim(),t.length!==0)return t.slice(0,40)}function Kn(e){return typeof e=="string"&&/^[\x21-\x7E]+$/.test(e)}function Zu(e){for(let t of["error","message"]){let n=e[t];if(typeof n=="string"&&n.length>0)return n}}function ef(e){if(!C(e))return;let t=e.ref;if(typeof t!="string"||t.length===0)return;let n=e.alias,r=e.configured,o=e.masked;return{ref:t,...typeof n=="string"&&n.length>0?{alias:n}:{},enabled:e.enabled===!0,configured:typeof r=="boolean"?r:null,...typeof o=="string"&&o.length>0?{masked:o}:{}}}function tf(e){let t=e.entries;if(!Array.isArray(t))return;let n=[];for(let i of t){let s=ef(i);s!==void 0&&n.push(s)}let r=e.enabledRef,o=e.route;return{ok:!0,route:typeof o=="string"?o:"",enabledRef:typeof r=="string"&&r.length>0?r:null,entries:n}}async function nf(e){let t;try{t=await e.json()}catch{t=void 0}if(!C(t))return{ok:!1};if(t.ok===!0){let r=tf(t);if(r!==void 0)return r}let n=Zu(t);return n===void 0?{ok:!1}:{ok:!1,error:n}}async function bt(e,t){let n=`${Do}?route=${encodeURIComponent(e)}`;try{let r=await fetch(n,t===void 0?{method:"GET",cache:"no-store",credentials:"same-origin"}:{method:"POST",cache:"no-store",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)});return await nf(r)}catch{return{ok:!1}}}var zs={list:e=>bt(e),add:(e,t,n)=>bt(e,{op:"add",value:t,...n===void 0?{}:{alias:n}}),enable:(e,t)=>bt(e,{op:"enable",ref:t}),rename:(e,t,n)=>bt(e,{op:"rename",ref:t,...n===void 0?{}:{alias:n}}),remove:(e,t)=>bt(e,{op:"remove",ref:t}),replace:(e,t,n)=>bt(e,{op:"value",ref:t,value:n}),async reveal(e,t){try{let n=await fetch(`${Zt}?route=${encodeURIComponent(e)}&ref=${encodeURIComponent(t)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!n.ok)return;let r=await n.json();if(!C(r)||r.ok!==!0)return;let o=r.key;return typeof o=="string"&&o.length>0?o:void 0}catch{return}}};var P=require("react/jsx-runtime"),rf="M3.9 8.35 6.6 11.05 12.1 5.5",of=["M8 3.9v8.2","M3.9 8h8.2"];function $s({paths:e}){return(0,P.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e.map(t=>(0,P.jsx)("path",{d:t},t))})}function sf(e,t){return e.masked!==void 0?e.masked:e.configured===!1?t("keysMissing"):"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}function af(e){return e.alias??e.masked??e.ref}function Vs(e){let{route:t,t:n}=e,r=e.client??zs,o=(0,se.useId)(),[i,s]=(0,se.useState)(void 0),[a,d]=(0,se.useState)(null),[l,p]=(0,se.useState)(void 0),[g,c]=(0,se.useState)(!1),[u,f]=(0,se.useState)(void 0),[m,h]=(0,se.useState)(""),[v,x]=(0,se.useState)(""),[b,A]=(0,se.useState)(void 0),R=(0,se.useCallback)((w,M)=>{if(!w.ok){p({kind:"error",text:w.error??n("keysUnreachable")});return}s(w.entries),d(w.enabledRef),p(M===void 0?void 0:{kind:"status",text:M})},[n]);(0,se.useEffect)(()=>{let w=!0;return(async()=>{let M=await r.list(t);w&&R(M,void 0)})(),()=>{w=!1}},[R,r,t]);let H=(0,se.useCallback)(async(w,M)=>{c(!0),A(void 0),f(void 0);try{R(await w(),M)}finally{c(!1)}},[R]),O=()=>{f(void 0),h(""),x("")},L=(w,M)=>{f({kind:w,ref:M.ref}),h(w==="alias"?M.alias??"":""),x(""),A(void 0)},F=()=>{if(g||u===void 0)return;let w=u.kind,M=u.ref;if(w!=="alias"&&!Kn(v))return;let N=js(m);c(!0),(async()=>{try{if(w==="add"){let X=await r.add(t,v,N);R(X,n("keysAdded")),X.ok&&O();return}if(M===void 0)return;let W=w==="alias"?await r.rename(t,M,N):await r.replace(t,M,v);R(W,n(w==="alias"?"keysRenamed":"keysReplaced")),W.ok&&O()}finally{c(!1)}})()},y=()=>{if(u===void 0)return null;let w=u.kind,M=w!=="alias",N=M&&v.length>0&&!Kn(v);return(0,P.jsxs)("div",{className:"bre-keys-form",children:[(0,P.jsxs)("div",{className:"bre-keys-form-fields",children:[w==="value"?null:(0,P.jsx)("input",{className:"bre-text-input bre-keys-name",type:"text",value:m,placeholder:n("keysAliasPlaceholder"),"aria-label":n("keysAlias"),disabled:g,autoFocus:w==="alias",onChange:W=>h(W.target.value)}),M?(0,P.jsx)("input",{className:"bre-text-input bre-keys-secret",type:"password",autoComplete:"new-password",spellCheck:!1,value:v,placeholder:n(w==="add"?"keysValuePlaceholder":"keysNewValuePlaceholder"),"aria-label":n("keysValue"),"aria-invalid":N,disabled:g,autoFocus:!0,onChange:W=>x(W.target.value)}):null]}),N?(0,P.jsx)("p",{className:"bre-effort-message bre-error",role:"alert",children:n("keysAddIllegal")}):null,(0,P.jsxs)("div",{className:"bre-keys-form-actions",children:[(0,P.jsx)("button",{type:"button",className:"bre-link-button",disabled:g,onClick:O,children:n("keysCancel")}),(0,P.jsx)("button",{type:"button",className:"bre-primary-button",disabled:g||M&&!Kn(v),onClick:F,children:n(w==="add"?"keysAddConfirm":"keysSave")})]})]})},I=()=>u?.kind==="add"?(0,P.jsx)("li",{className:"bre-keys-form-row",children:y()}):(0,P.jsx)("li",{className:"bre-keys-add-row",children:(0,P.jsxs)("button",{type:"button",className:"bre-keys-add",disabled:g,onClick:()=>{f({kind:"add"}),h(""),x(""),A(void 0)},children:[(0,P.jsx)("span",{className:"bre-keys-add-mark","aria-hidden":"true",children:(0,P.jsx)($s,{paths:of})}),n("keysAdd")]})});return i===void 0?l===void 0?(0,P.jsx)("div",{className:"bre-keys"}):(0,P.jsxs)("div",{className:"bre-keys",children:[(0,P.jsx)("p",{className:"bre-effort-message bre-"+l.kind,role:l.kind==="error"?"alert":"status",children:l.text}),(0,P.jsx)("ul",{className:"bre-keys-list",children:I()})]}):(0,P.jsxs)("div",{className:"bre-keys",children:[(0,P.jsxs)("ul",{className:"bre-keys-list",children:[i.map(w=>{let M=af(w);return(0,P.jsxs)(se.Fragment,{children:[(0,P.jsxs)("li",{className:"bre-keys-row","data-state":w.configured===!1?"missing":"ready",children:[w.alias===void 0?null:(0,P.jsx)("span",{className:"bre-keys-alias",children:w.alias}),(0,P.jsx)("span",{className:w.alias===void 0?"bre-keys-mask bre-keys-mask-plain":"bre-keys-mask",children:sf(w,n)}),(0,P.jsx)("span",{className:"bre-keys-actions",children:b===w.ref?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("button",{type:"button",className:"bre-link-button bre-keys-danger",disabled:g,onClick:()=>{H(()=>r.remove(t,w.ref),n("keysRemoved"))},children:n("keysConfirmRemove")}),(0,P.jsx)("button",{type:"button",className:"bre-link-button",disabled:g,onClick:()=>A(void 0),children:n("keysCancel")})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("button",{type:"button",className:"bre-link-button",disabled:g,onClick:()=>{A(w.ref),f(void 0)},children:n("keysRemove")}),(0,P.jsx)("button",{type:"button",className:"bre-link-button",disabled:g,onClick:()=>L("alias",w),children:n("keysAlias")}),(0,P.jsx)("button",{type:"button",className:"bre-link-button",disabled:g,onClick:()=>L("value",w),children:n("keysEdit")})]})}),(0,P.jsxs)("label",{className:"bre-keys-enable",title:n("keysEnable",{name:M}),children:[(0,P.jsx)("input",{type:"radio",name:o,className:"bre-keys-enabled",checked:w.enabled,disabled:g,"aria-label":n("keysEnable",{name:M}),onChange:()=>{H(()=>r.enable(t,w.ref),n("keysEnabledNote",{name:M}))}}),(0,P.jsx)("span",{className:"bre-keys-mark","aria-hidden":"true",children:w.enabled?(0,P.jsx)($s,{paths:[rf]}):null}),(0,P.jsx)("span",{className:"bre-keys-enable-text",children:n("keysEnabled")})]})]}),u!==void 0&&u.ref===w.ref?(0,P.jsx)("li",{className:"bre-keys-form-row",children:y()}):null]},w.ref)}),I()]}),l===void 0?null:(0,P.jsx)("p",{className:"bre-effort-message bre-"+l.kind,role:l.kind==="error"?"alert":"status",children:l.text})]})}var Un="bre-key-managed",df="bre-keys-host",oo="data-bre-key-host",lf="data-bre-key-input",Bn="data-bre-region",Ue=new WeakMap;function uf(e){let t=e.querySelector(`input[${lf}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function Ys(e){let t=Ue.get(e)?.host;if(t!==void 0&&t.isConnected)return t;let n=e.nextElementSibling;return n instanceof HTMLElement&&n.hasAttribute(oo)?n:void 0}function Xs(e,t){let n=t.route;if(n===void 0||n.length===0||uf(e)===void 0||e.parentElement===null)return;ve(e,Un,!0);let r=Ue.get(e),o=Ys(e);o===void 0&&(r!==void 0&&Js(e,r),o=e.ownerDocument.createElement("div"),o.className=df,e.after(o)),z(o,oo,n);let i=e.getAttribute(Bn);i===null?o.hasAttribute(Bn)&&o.removeAttribute(Bn):z(o,Bn,i);let s=()=>(0,ro.createElement)(Ie,{fallbackText:t.t("keysPanelFailed")},(0,ro.createElement)(Vs,{route:n,t:t.t,client:t.client})),a=Ue.get(e);if(a!==void 0&&a.route===n){(a.t!==t.t||a.client!==t.client)&&(a.t=t.t,a.client=t.client,a.mount.root.render(s()));return}a!==void 0&&(Ue.delete(e),a.mount.root.unmount()),Ue.set(e,{route:n,host:o,mount:Xe(o,s(),{sync:!0}),t:t.t,client:t.client})}function Js(e,t){Ue.delete(e),Ne(t.mount)}function Gn(e){ve(e,Un,!1);let t=Ue.get(e);t!==void 0&&Js(e,t),Ys(e)?.remove()}function Qs(){for(let e of Array.from(document.querySelectorAll(`[${oo}]`))){let t=e.previousElementSibling;t instanceof HTMLElement&&Ue.has(t)?Gn(t):e.remove()}}var Zs="http://www.w3.org/2000/svg",ff="data-bre-icon";function cf(e){let t=document.createElementNS(Zs,"path");return t.setAttribute("d",e),t}function ea(e,t){let n=document.createElementNS(Zs,"svg");return n.setAttribute("viewBox","0 0 16 16"),n.setAttribute("width","16"),n.setAttribute("height","16"),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.5"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false"),n.setAttribute(ff,e),n.append(...t.map(cf)),n}var zn="bre-key-field",oa="bre-key-eye",jn="data-bre-key-input",ia="data-bre-eye-show",sa="data-bre-eye-hide",ta=["M1.5 8S4 3.75 8 3.75 14.5 8 14.5 8 12 12.25 8 12.25 1.5 8 1.5 8Z","M6.2 8a1.8 1.8 0 1 0 3.6 0 1.8 1.8 0 0 0-3.6 0Z"],ao=new WeakMap;function io(e){let t=e.querySelector(`input[${jn}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function aa(e){for(let t of Array.from(e.children))if(t instanceof HTMLButtonElement&&t.classList.contains(oa))return t}function da(e,t){let n=io(e);if(n===void 0){$n(e);return}ao.set(e,t),z(n,jn,""),ve(e,zn,!0);let r=aa(e)??mf(e);z(r,ia,t.t("keyRevealShow")),z(r,sa,t.t("keyRevealHide")),so(r,n)}function $n(e){let t=aa(e);t!==void 0&&t.remove(),ao.delete(e),ve(e,zn,!1);let n=e.querySelector(`input[${jn}]`);n instanceof HTMLInputElement&&(n.removeAttribute(jn),n.type="password")}async function pf(e){try{let t=await fetch(`${Zt}?route=${encodeURIComponent(e)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!t.ok)return;let n=await t.json();return n===null||typeof n!="object"||n.ok!==!0?void 0:typeof n.key=="string"&&n.key.length>0?n.key:void 0}catch{return}}function so(e,t){let n=t.type!=="password";z(e,"aria-pressed",n?"true":"false");let r=e.getAttribute(n?sa:ia);r!==null&&(z(e,"aria-label",r),z(e,"title",r)),qt(e,t.disabled)}function na(e,t){let n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");n?.set===void 0?e.value=t:n.set.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))}function mf(e){let t=document.createElement("button");t.type="button",t.className=oa,t.append(ra("eye"),ra("eye-off"));let n,r=async()=>{let o=io(e),i=ao.get(e);if(o===void 0||i===void 0)return;if(o.type!=="password"){n!==void 0&&o.value===n&&na(o,""),n=void 0,o.type="password",so(t,o);return}let s=i.route;if(s!==void 0&&n===void 0&&o.value.length===0){z(t,"aria-busy","true");let a;try{a=await(i.loadKey??pf)(s)}catch{a=void 0}if(t.hasAttribute("aria-busy")&&t.removeAttribute("aria-busy"),a===void 0){let d=i.t("keyRevealFailed");z(t,"aria-label",d),z(t,"title",d);return}io(e)===o&&o.value.length===0&&(n=a,na(o,a))}o.type="text",so(t,o)};return t.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),r()}),e.append(t),t}function ra(e){let t=e==="eye-off"?[...ta,"M2.5 13.5 13.5 2.5"]:ta;return ea(e,t)}var lo="bre-editor-tabs",gf="bre-editor-tab",Vn="data-bre-tab-id",Bt="bre-tabbed",je="data-bre-tab",la="data-bre-provider",xe="data-bre-region",Kt="data-bre-editor-body",vt="data-bre-footer",hf="row",bf="path",Ut="data-bre-details";var yf=".bre-headers",Ge="provider",yt="models",wt="advanced",wf=[Ge,yt,wt],vf="none",ua=wf,fa=lo,ca=gf,pa=Vn,Yn='[class*="editorActions"], [class*="modelList"], [class*="modelCatalog"], [class*="modelEntry"]',xf='[class*="modelCatalog"], [class*="modelList"], [class*="modelEntry"]',ma='[class*="rowCard"], [class*="addCard"], li',Ef='[class*="addPanel"]',kf=".bre-create-host";function ga(){return{warned:new WeakSet}}function Gt(e){return e===null?null:e.closest(ma)}function ha(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.matches(Ef)&&!t.hidden)return t;return e}function ba(e,t){let n=Hn(e),r=e.getBoundingClientRect().top,o=n?.scrollTop??0;n!==void 0&&(n.style.overflowAnchor="none"),z(e,je,t),va(e),n!==void 0&&requestAnimationFrame(()=>{if(n.style.overflowAnchor="",n.scrollTop!==o)return;let i=e.getBoundingClientRect().top-r;i!==0&&(n.scrollTop+=i)})}function uo(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(Yn))){let i=o.closest(ma);i!==null&&r.add(i)}for(let o of Array.from(e.querySelectorAll(`.${Bt}`)))r.has(o)||Xn(o);for(let o of r)try{Rf(o,t)}catch(i){n.warned.has(o)||(n.warned.add(o),console.warn("[bre] editor tabs: rolled a provider card back to the official layout:",i)),Xn(o)}}function ya(){for(let e of Array.from(document.querySelectorAll(`.${Bt}`))){e.classList.remove(Bt),e.removeAttribute(je),e.removeAttribute(Kt);for(let t of Array.from(e.querySelectorAll(`[${xe}]`)))t.removeAttribute(xe)}for(let e of Array.from(document.querySelectorAll(`[${je}]`)))e.removeAttribute(je);for(let e of Array.from(document.querySelectorAll(`[${xe}]`)))e.removeAttribute(xe);for(let e of Array.from(document.querySelectorAll(`[${Kt}]`)))e.removeAttribute(Kt);for(let e of Array.from(document.querySelectorAll(`[${vt}]`)))e.removeAttribute(vt);for(let e of Array.from(document.querySelectorAll(`details[${Ut}]`)))e.removeAttribute("open"),e.removeAttribute(Ut);for(let e of Array.from(document.querySelectorAll(`.${zn}`)))$n(e);for(let e of Array.from(document.querySelectorAll(`.${Un}`)))Gn(e);Qs()}function Tf(e){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&!n.matches('[class*="editorHeader"], [class*="editorTitle"], [class*="editorActions"], [class*="editorRoute"]')&&n.matches('[class*="editor"]')&&(n.querySelector(Yn)!==null||n.querySelector("input, select")!==null))return n;let t=e.querySelector(Yn);for(;t!==null&&t.parentElement!==e;)t=t.parentElement;return t!==null&&t!==e?t:void 0}function Mf(e){let t={header:void 0,models:void 0,actions:void 0,fields:[]};wa(e,t,0);let{actions:n,fields:r,header:o,models:i}=t;if(!(n===void 0||r.length===0)&&r.some(s=>s.querySelector("input, select, textarea")!==null))return{header:o,models:i,actions:n,fields:r}}var Lf=4;function wa(e,t,n){if(!(n>Lf)){for(let r of Array.from(e.children))if(r instanceof HTMLElement&&!r.matches('[class*="bre-"], [data-plugin]')){if(t.header===void 0&&r.matches('[class*="editorHeader"], [class*="editorTitle"]')){t.header=r;continue}if(r.matches('[class*="editorActions"]')){t.actions??(t.actions=r);continue}if(r.matches(xf)){t.models??(t.models=r);continue}if(r.querySelector(Yn)!==null){wa(r,t,n+1);continue}if(r.querySelector('[class*="editorActions"]')!==null){t.actions??(t.actions=r);continue}if(r.querySelector("input, select, textarea")!==null){t.fields.push(r);continue}(r.matches("p, small, em, i")||r.matches('[class*="Hint"], [class*="error"]'))&&t.fields.push(r)}}}function Sf(e,t){if(!t.contains(e))return;z(e,vt,hf);let n=e.parentElement;for(;n!==null&&(z(n,vt,bf),n!==t);)n=n.parentElement}function Af(e){let n=e.querySelector(`[${la}]`)?.getAttribute(la);return n==null||n===""?void 0:n}function Rf(e,t){let n=ha(e),r=Tf(n);if(r===void 0){Xn(e);return}let o=Mf(r);if(o===void 0){Xn(e);return}let i=n.querySelector(yf),s=Af(n);for(let l of o.fields)z(l,xe,Ge),da(l,{t:t.t,route:s}),Xs(l,{t:t.t,route:s});o.header!==void 0&&z(o.header,xe,vf),o.models!==void 0&&z(o.models,xe,yt),z(r,Kt,""),n.querySelector(kf)!==null&&Sf(o.actions,r),i!==null&&z(i,xe,wt),Of(r);let a=new Set([Ge]);o.models!==void 0&&a.add(yt),i!==null&&a.add(wt);let d=e.getAttribute(je)??Ge;z(e,je,a.has(d)?d:Ge),ve(e,Bt,!0),Hf(e,n,t,a)}function Hf(e,t,n,r){let o=t.querySelector(`.${lo}`);o!==null&&(z(o,"aria-label",n.t("editorTabsLabel")),Wn(Wt(o,Ge),n.t("editorTabProvider")),Wn(Wt(o,yt),n.t("editorTabModels")),Wn(Wt(o,wt),n.t("editorTabAdvanced")),qt(Wt(o,yt),!r.has(yt)),qt(Wt(o,wt),!r.has(wt)),va(e,o))}function va(e,t){let n=t??ha(e).querySelector(`.${lo}`);if(n===null)return;let r=e.getAttribute(je)??Ge;for(let o of Array.from(n.querySelectorAll(`[${Vn}]`)))z(o,"aria-selected",o.getAttribute(Vn)===r?"true":"false")}function Wt(e,t){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&n.getAttribute(Vn)===t)return n}function Xn(e){e.classList.remove(Bt),e.removeAttribute(je),e.removeAttribute(Kt);for(let t of Array.from(e.querySelectorAll(`[${xe}]`)))t.getAttribute(xe)===Ge&&($n(t),Gn(t)),t.removeAttribute(xe);for(let t of Array.from(e.querySelectorAll(`[${vt}]`)))t.removeAttribute(vt);_f(e)}function Of(e){for(let t of Array.from(e.querySelectorAll("details")))t.hasAttribute("open")||(z(t,Ut,"closed"),z(t,"open",""))}function _f(e){for(let t of Array.from(e.querySelectorAll(`details[${Ut}]`)))t.removeAttribute("open"),t.removeAttribute(Ut)}var $a=require("react");var me=require("react");var ee=require("react");var If='p[class*="savedNotice"]',ka="data-bre-saved-hidden",Nf="bre-auto-effort-note",Df="data-bre-auto-effort-phase",xa="bre-auto-effort-note-text",xt=new Map,Ea=new WeakMap,Et=null,Jn=null;function Ta(e){let t=Array.from(e.querySelectorAll(If));for(let n of t){let r=n.textContent?.trim()??"";Ea.get(n)!==r&&(Ea.set(n,r),r.length>0&&Aa(r)),!xt.has(n)&&(xt.set(n,n.style.display),n.setAttribute(ka,""),n.style.display="none")}for(let[n,r]of Array.from(xt))n.isConnected&&t.includes(n)||(La(n,r),xt.delete(n))}function Ma(){for(let[e,t]of Array.from(xt))La(e,t);xt.clear(),fo()}function La(e,t){e.style.display=t,e.removeAttribute(ka)}function Sa(e){Aa(e)}function Aa(e){if(Et!==null&&Et.isConnected&&Et.textContent===e)return;fo();let t=document.createElement("div");t.className=Nf,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute(Df,"done"),t.innerHTML=`<span class="${xa}"></span>`;let n=t.querySelector(`.${xa}`);n!==null&&(n.textContent=e),t.style.setProperty("--bre-note-hold","3000ms"),document.body.append(t),Et=t,Jn=setTimeout(()=>{fo()},3e3)}function fo(){Jn!==null&&(clearTimeout(Jn),Jn=null),Et?.remove(),Et=null}var nt="data-bre-settle",Ra='[class*="rowActions"] > button:not(.bre-provider-switch)';var Le=null,co=0,Qn=0,jt=!1,kt=null;function Ha(e){return e.className.includes("dangerButton")?"remove":"edit"}function po(e,t){return Array.from(e.querySelectorAll(Ra)).find(r=>Ha(r)===t)??null}function Cf(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Pf(e){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(e):clearTimeout(e)}function Oa(e=document){zt();let t=[];for(let n of Array.from(e.querySelectorAll(Ra))){if(n.disabled)continue;let r=n.closest("li")??n.parentElement;if(r===null)continue;let o=Ha(n);t.some(i=>i.row===r&&i.role===o)||t.push({row:r,role:o})}t.length!==0&&(Le=t,Qn=Date.now(),co=Qn+8e3,Ff(),_a())}function mo(){if(Le===null)return;let e=Date.now();if(e>co){zt();return}let t=0;if(Le=Le.filter(n=>{if(!n.row.isConnected)return!1;let r=po(n.row,n.role);return r===null||(r.disabled?(jt=!0,t+=1,r.hasAttribute(nt)||r.setAttribute(nt,"")):jt&&r.hasAttribute(nt)&&r.removeAttribute(nt)),!0}),jt&&t===0){zt();return}if(!jt&&e-Qn>1500){zt();return}_a()}function _a(){kt!==null||Le===null||(kt=Cf(()=>{kt=null,mo()}))}function Ff(){if(Le!==null)for(let e of Le){let t=po(e.row,e.role);t!==null&&!t.hasAttribute(nt)&&t.setAttribute(nt,"")}}function Ia(){zt()}function zt(){if(kt!==null&&(Pf(kt),kt=null),Le!==null)for(let e of Le){let t=po(e.row,e.role);t!==null&&t.removeAttribute(nt)}Le=null,jt=!1,co=0,Qn=0}var D=require("react/jsx-runtime"),qf=["claude-cli/2.1.161 (external, cli)","claude-code/1.0.0","Kilo-Code/1.0"];function Na(e,t){let n=()=>t.current+=1,r=Object.entries(e??{}).map(([o,i])=>({id:n(),name:o,value:i}));return r.length===0&&r.push({id:n(),name:"",value:""}),{rows:r}}function Da(e){let t={},n=!1;for(let o of e.rows){let i=o.name.trim();i.length!==0&&(t[i]=o.value,i.toLowerCase()==="user-agent"&&(n=!0))}let r=e.userAgent?.trim();return!n&&r!==void 0&&r.length>0&&(t["user-agent"]=r),t}function Zn({route:e,api:t,t:n,onDismiss:r,deferred:o}){let i=(0,ee.useId)(),[s,a]=(0,ee.useState)(void 0),[d,l]=(0,ee.useState)({rows:[]}),[p,g]=(0,ee.useState)(!1),[c,u]=(0,ee.useState)(!1),[f,m]=(0,ee.useState)(!0),[h,v]=(0,ee.useState)(!1),[x,b]=(0,ee.useState)(!1),[A,R]=(0,ee.useState)(void 0),[H,O]=(0,ee.useState)(void 0),[L,F]=(0,ee.useState)(!1),y=(0,ee.useRef)(0),I=(0,ee.useRef)(null),w=o!==void 0,M=o?.onDraft,N=(0,ee.useRef)(void 0);(0,ee.useEffect)(()=>{if(w&&N.current!==void 0)return;N.current=e;let S=!0;return(async()=>{try{let K=await te(t);if(!S)return;let Y=Lr(K.namespace,e);a(Y),l(Na(Y,y)),b(K.writable!==!0)}catch{S&&b(!0)}finally{S&&m(!1)}})(),()=>{S=!1}},[t,e,w]),(0,ee.useEffect)(()=>{M!==void 0&&M(Da(d))},[d,M]),(0,ee.useEffect)(()=>{let S=!0;return(async()=>{try{let Y=await(await fetch(Po,{method:"GET"})).json();S&&Y.ok===!0&&Y.data!==void 0&&O(Y.data)}catch{}})(),()=>{S=!1}},[]),(0,ee.useEffect)(()=>{let S=I.current;if(S===null)return;let K=()=>{F(S.dataset.breRegion==="advanced")};K();let Y=new MutationObserver(K);return Y.observe(S,{attributes:!0,attributeFilter:["data-bre-region"]}),()=>{Y.disconnect()}},[]);let W=()=>{l(S=>({...S,rows:[...S.rows,{id:y.current+=1,name:"",value:""}]})),R(void 0)},X=(S,K)=>{l(Y=>({...Y,rows:Y.rows.map(le=>le.id===S?{...le,...K}:le)})),R(void 0)},oe=S=>{l(K=>({...K,rows:K.rows.filter(Y=>Y.id!==S)})),R(void 0)},J=()=>{if(l(Na(s,y)),u(!1),R(void 0),o!==void 0){o.onCancel();return}L&&r?.()},Q=async S=>{v(!0),R(void 0),Oa();let K;try{K=await Ot(t,e,S)}catch(le){K={ok:!1,error:le instanceof Error?le.message:String(le)}}if(v(!1),!K.ok){R({kind:"error",text:K.error==="no-route"?n("headersNoRoute"):K.error==="read-only"?n("headersReadOnly"):n("headersError",{error:K.error})});return}a(S),u(!1);let Y=Object.keys(S).length===0?n("headersCleared"):n("headersSaved");if(L){Sa(Y),r?.();return}R({kind:"success",text:Y})},Z=Object.entries(s??{}),G=x||h,q=Z.length,B=L||w,U=p||c||B;return(0,D.jsxs)("div",{className:"bre-headers",ref:I,"data-plugin":re,"data-open":p?"1":"0",children:[(0,D.jsx)("div",{className:"bre-headers-head",children:c||B?(0,D.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}):(0,D.jsxs)("button",{type:"button",className:"bre-headers-disclosure","aria-expanded":p,"aria-label":`${n("headersTitle")} ${e}`,onClick:()=>{g(!p),R(void 0)},children:[(0,D.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}),f||q===0?null:(0,D.jsx)("span",{className:"bre-headers-count",children:q}),(0,D.jsx)("span",{className:"bre-headers-chevron","aria-hidden":"true",children:"\u203A"})]})}),U?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("p",{className:"bre-effort-note",children:n("headersHint")}),H===void 0?null:(0,D.jsxs)(D.Fragment,{children:[H.environment.preferOfficialLayer?(0,D.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictPatched")}):null,H.conflicts.length===0&&(H.headerConflicts?.length??0)===0?null:(0,D.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictOrigin")}),H.environment.siblings.length===0?null:(0,D.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictSiblings",{names:H.environment.siblings.map(S=>S.name).join(", ")})})]}),f?null:c||B?(0,D.jsxs)("div",{className:"bre-headers-edit",children:[(0,D.jsxs)("div",{className:"bre-headers-columns","aria-hidden":"true",children:[(0,D.jsx)("span",{children:n("headersName")}),(0,D.jsx)("span",{children:n("headersValue")}),(0,D.jsx)("span",{})]}),d.rows.map(S=>(0,D.jsxs)("div",{className:"bre-headers-row",children:[(0,D.jsx)("input",{type:"text",className:"bre-text-input bre-headers-name",value:S.name,disabled:G,placeholder:n("headersNamePlaceholder"),"aria-label":n("headersName"),onChange:K=>{X(S.id,{name:K.target.value})}}),(0,D.jsx)("input",{type:"text",className:"bre-text-input bre-headers-value",value:S.value,disabled:G,list:S.name.trim().toLowerCase()==="user-agent"?i:void 0,placeholder:n("headersValue"),"aria-label":n("headersValue"),onChange:K=>{X(S.id,{value:K.target.value})}}),(0,D.jsx)("button",{type:"button",className:"bre-link-button bre-headers-remove",disabled:G,"aria-label":`${n("headersClear")} ${S.name}`,onClick:()=>{oe(S.id)},children:"\xD7"})]},S.id)),(0,D.jsx)("button",{type:"button",className:"bre-link-button bre-headers-add",disabled:G,onClick:W,children:n("headersAdd")}),!1,(0,D.jsx)("datalist",{id:i,children:qf.map(S=>(0,D.jsx)("option",{value:S},S))}),(0,D.jsx)("p",{className:"bre-effort-note bre-headers-legacy",hidden:!0,children:n("headersUserAgentHint")}),w?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("p",{className:"bre-effort-note",children:n("pendingSave")}),(0,D.jsx)("p",{className:"bre-effort-note",children:n("pendingHint")})]}):null]}):(0,D.jsxs)("div",{className:"bre-headers-rows",children:[Z.length===0?(0,D.jsx)("p",{className:"bre-effort-note",children:n("headersEmpty")}):Z.map(([S,K])=>(0,D.jsxs)("div",{className:"bre-headers-row",children:[(0,D.jsx)("span",{className:"bre-headers-name",children:S}),(0,D.jsx)("span",{className:"bre-headers-value bre-headers-masked",children:"\u2022".repeat(Math.min(K.length,24))})]},S)),x?null:(0,D.jsx)("div",{className:"bre-effort-actions",children:(0,D.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:G,onClick:()=>{u(!0),R(void 0)},children:n("headersEdit")})})]})]}):null,!f&&(B||c)?(0,D.jsxs)("div",{className:"bre-effort-actions bre-headers-actions",children:[(0,D.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:h,onClick:J,children:n("headersCancel")}),w?null:(0,D.jsx)("button",{type:"button",className:"bre-primary-button",disabled:G,onClick:()=>{Q(Da(d))},children:n("headersSave")})]}):null,A===void 0?null:(0,D.jsx)("p",{className:"bre-effort-message bre-"+A.kind,role:A.kind==="error"?"alert":"status",children:A.text})]})}var go=require("react");var Wf={provider:"editorTabProvider",models:"editorTabModels",advanced:"editorTabAdvanced"};function er({host:e,t}){return(0,go.createElement)("div",{className:fa,role:"tablist","aria-label":t("editorTabsLabel")},...ua.map(n=>(0,go.createElement)("button",{key:n,type:"button",role:"tab",className:ca,[pa]:n,onClick:r=>{r.preventDefault(),r.stopPropagation();let o=Gt(e.current);o!==null&&ba(o,n)}},t(Wf[n]))))}var Kf=15e3;function Pa(){return{intents:new Map,baseline:new Map,flushing:!1}}function ho(e,t,n){if(t.length===0)return;let r={...n};if(Object.keys(r).length===0){e.intents.delete(t);return}let o=e.intents.get(t);if(o===void 0){e.intents.set(t,{headers:r,declaredBefore:e.baseline.get(t)});return}o.headers=r}function bo(e,t){e.intents.delete(t)}function Fa(e,t){let n=e.intents.get(t);n!==void 0&&(n.releasedAt=Date.now())}function qa(e,t,n){if(t.length===0)return;e.baseline.set(t,n);let r=e.intents.get(t);r!==void 0&&(r.declaredBefore=n)}function Wa(e,t){return t.length>0&&!e.baseline.has(t)}async function Ka(e,t){if(e.flushing)return Ca(e);if(e.intents.size===0)return 0;e.flushing=!0;try{let n=await te(t),r,o=async s=>Ye(n.namespace,s)?!0:(r??(r=await te(t,{fresh:!0})),Ye(r.namespace,s)),i=Date.now();for(let[s,a]of Array.from(e.intents)){if(a.declaredBefore===void 0){a.releasedAt!==void 0&&a.noted!==!0&&(a.noted=!0,console.warn("[bre] deferred request headers: nobody said whether this id existed before, so the draft is held:",s));continue}if(a.declaredBefore){e.intents.delete(s);continue}if(!await o(s)){a.releasedAt!==void 0&&i-a.releasedAt>Kf?(e.intents.delete(s),console.info("[bre] deferred request headers: gave up on a draft whose card closed first:",s)):a.releasedAt!==void 0&&console.info("[bre] deferred request headers: waiting for the closed card to declare",s);continue}console.info("[bre] deferred request headers: the route is declared, writing the held draft:",s);let d;try{d=await Ot(t,s,a.headers)}catch(l){d={ok:!1,error:l instanceof Error?l.message:String(l)}}if(d.ok){e.intents.delete(s),console.info("[bre] deferred request headers: saved",s,Object.keys(a.headers).length,"header(s)");continue}d.error!=="no-route"&&(e.intents.delete(s),console.error("[bre] deferred request headers: the write was refused:",d.error,s))}}catch(n){console.error("[bre] deferred request headers: could not read the settings document:",n)}finally{e.flushing=!1}return Ca(e)}function Ca(e){let t=0;for(let n of e.intents.values())n.releasedAt!==void 0&&(t+=1);return t}var rt=require("react/jsx-runtime");function Ga({host:e,api:t,t:n,routeIdLabels:r,staged:o}){let[i,s]=(0,me.useState)(()=>Ua(e.current,r)),a=(0,me.useRef)(i),d=(0,me.useRef)(void 0),l=(0,me.useRef)(new Set),p=(0,me.useRef)(!1),g=(0,me.useRef)(null);return g.current===null&&(g.current={onDraft:c=>{d.current=c;let u=a.current;if(u.length===0){!p.current&&Object.keys(c).length>0&&(p.current=!0,console.info("[bre] deferred request headers: holding a draft until the provider id is typed"));return}ho(o,u,c),Ba(t,o,u,l.current)},onCancel:()=>{d.current=void 0,bo(o,a.current)}}),(0,me.useEffect)(()=>{let c=ja(e.current);if(c===null)return;let u=()=>{s(Ua(e.current,r))};return c.addEventListener("input",u,!0),()=>{c.removeEventListener("input",u,!0)}},[e,r]),(0,me.useEffect)(()=>{i.length>0&&Ba(t,o,i,l.current)},[t,o,i]),(0,me.useEffect)(()=>{let c=a.current;if(c===i)return;bo(o,c),a.current=i;let u=d.current;u!==void 0&&i.length>0&&ho(o,i,u)},[i,o]),(0,me.useEffect)(()=>()=>{Fa(o,a.current)},[o]),(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsx)(er,{host:e,t:n}),(0,rt.jsx)(Zn,{route:i,api:t,t:n,deferred:g.current})]})}function Ba(e,t,n,r){!Wa(t,n)||r.has(n)||(r.add(n),(async()=>{try{let o=await te(e);qa(t,n,Ye(o.namespace,n))}catch(o){r.delete(n),console.warn("[bre] deferred request headers: could not read the settings document for this route:",o)}})())}function ja(e){let t=e?.parentElement;return t==null?null:t.parentElement?.closest('[class*="addCard"]')??t}function Ua(e,t){let n=e?.parentElement;if(n==null)return"";let r=t(),o=pe(n,r).trim();if(o.length>0)return o;let i=ja(e);return i===null||i===n?"":pe(i,r).trim()}var wo="bre-create-host",yo="bre-add-mode-picker",Bf='[class*="addCard"]',Uf='[class*="addPanel"]',Gf='[class*="addModes"]',jf="-custom-panel",zf="-custom";function Va(){return{hosts:new Map}}function vo(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(Bf)))if(o.isConnected)try{$f(o,t,n),r.add(o)}catch(i){tr(o,n),Ya(o,!1),console.warn("[bre] add provider card: left the official form in place:",i)}for(let o of Array.from(n.hosts.keys()))(!r.has(o)||!o.isConnected)&&tr(o,n)}function $f(e,t,n){let r=Vf(e,jf);if(r===void 0){za(e);return}if(r.hidden){za(e);return}Xf(e,r,t,n),Ya(e,!0)}function Ya(e,t){let n=Xa(e);n!==void 0&&ve(n,yo,t)}function Vf(e,t){for(let n of Array.from(e.querySelectorAll(Uf)))if(n.id.endsWith(t))return n}function Xa(e){let t=e.querySelector(Gf);if(t!==null){for(let n of Array.from(t.children))if(n instanceof HTMLElement&&n.getAttribute("role")==="tablist")return n}}function za(e){let t=Xa(e);if(t!==void 0){for(let n of Array.from(t.querySelectorAll('[role="tab"]')))if(n.id.endsWith(zf)){if(n.disabled)return;n.getAttribute("aria-selected")!=="true"&&n.click();return}}}function Yf(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.classList.contains(wo))return t}function Xf(e,t,n,r){let o=r.hosts.get(e),i=Yf(t);if(i!==void 0&&o!==void 0&&o.host===i)return;tr(e,r),i!==void 0&&i.remove();let s=e.ownerDocument.createElement("div");s.className=wo,t.insertBefore(s,t.firstChild);let a=Xe(s,n.refreshed(()=>(0,$a.createElement)(Ga,{host:{current:s},api:n.api,t:n.t,routeIdLabels:n.routeIdLabels,staged:n.staged})),{sync:!0});r.hosts.set(e,{host:s,mount:a})}function tr(e,t){let n=t.hosts.get(e);n!==void 0&&(t.hosts.delete(e),Ne(n.mount))}function Ja(e){for(let t of Array.from(e.hosts.keys()))tr(t,e);for(let t of Array.from(document.querySelectorAll(`.${wo}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${yo}`)))ve(t,yo,!1)}var $t="data-bre-row-provider",Qa="{provider}",Jf=["rowCard","setupCard"];function Za(){return Sn()}function Pe(e){for(let t of Jf)for(let n of Array.from(e.querySelectorAll(`[class*="${t}"]`))){let r=n.parentElement;if(!(r===null||r.tagName!=="UL")&&de(r).length!==0)return r}}function Vt(e){return e.querySelector('[class*="rowHead"]')??void 0}function Tt(e){let t=e.querySelector('[class*="rowName"]')?.textContent?.trim();return t!==void 0&&t.length>0?t:void 0}function Qf(e){let t=e.indexOf(Qa);if(!(t<0))return{prefix:e.slice(0,t),suffix:e.slice(t+Qa.length)}}function Zf(e){let t=e.trim();if(t.length===0)return;let n=/^(.*) \(([^()]*)\)$/.exec(t);if(n!==null){let r=n[2];return r.length===0?void 0:r}return/\s/.test(t)?void 0:t}var ec='[class*="rowCard"], [class*="setupCard"], [class*="addCard"]';function tc(e){let t=e.closest(ec);for(let n=e;n!==null&&n!==t;n=n.parentElement)if(n.matches('[data-plugin], [class*="bre-"]'))return!0;return!1}function Fe(e,t){let n=e.querySelector("[data-bre-provider]")?.getAttribute("data-bre-provider");if(typeof n=="string"&&n.length>0)return n;for(let r of t.editProvider){let o=Qf(r);if(o!==void 0)for(let i of Array.from(e.querySelectorAll("button[aria-label]"))){if(tc(i))continue;let s=i.getAttribute("aria-label")??"";if(s.length<=o.prefix.length+o.suffix.length||!s.startsWith(o.prefix)||!s.endsWith(o.suffix))continue;let a=Zf(s.slice(o.prefix.length,s.length-o.suffix.length));if(a!==void 0)return a}}}function xo(e){let t=e.getAttribute($t);return t===null||t.length===0?void 0:t}function nc(e){return Dt(e,xo)}function ed(e,t,n){if(!e.isConnected)return;let r=Pe(e);if(r===void 0)return;let o=t.labels();for(let i of de(r)){let s=Fe(i,o);if(s===void 0){i.removeAttribute($t);continue}xo(i)!==s&&i.setAttribute($t,s)}On(e,r,rc(t),n)}function rc(e){return{rowOf:t=>{let n=t.closest("li");return n instanceof HTMLElement?n:void 0},idOf:xo,labelOf:Tt,order:t=>Yo(t),commit:t=>{$o(nc(t))},seatOf:Vt,seatDrags:!0,gripLabel:(t,n)=>e.t("providerReorderAria",{provider:Tt(t)??n}),gripHint:()=>e.t("providerReorderHint")}}function td(e){_n(e);let t=Array.from(document.querySelectorAll(`[${$t}]`));Rn(t);for(let n of t)n.removeAttribute($t)}var Mt="data-bre-provider-switch",nr="bre-row-disabled";function rd(){return{switches:new WeakSet}}function od(e,t,n){if(!e.isConnected)return;let r=Pe(e);if(r===void 0)return;let o=t.labels();for(let i of Array.from(r.children)){if(!(i instanceof HTMLElement))continue;let s=Fe(i,o);if(s===void 0)continue;let a=Vt(i);a!==void 0&&(oc(i,a,s,t,n),i.classList.toggle(nr,!ft(s)))}}function id(){for(let e of Array.from(document.querySelectorAll(`[${Mt}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${nr}`)))e.classList.remove(nr)}function oc(e,t,n,r,o){let i=t.querySelector(`[${Mt}]`);if(i!==null){nd(i,e,n,r);return}let s=document.createElement("button");s.className="bre-provider-switch",s.setAttribute("type","button"),s.setAttribute("role","switch"),s.setAttribute(Mt,n),nd(s,e,n,r),ic(s,e,o);let a=t.querySelector('[class*="rowActions"]');a===null?t.appendChild(s):a.insertBefore(s,a.firstChild)}function nd(e,t,n,r){let o=r.t("providerToggleAria",{provider:Tt(t)??n}),i=r.t("providerToggleHint"),s=ft(n)?"true":"false";e.getAttribute(Mt)!==n&&e.setAttribute(Mt,n),e.getAttribute("aria-checked")!==s&&e.setAttribute("aria-checked",s),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}function ic(e,t,n){n.switches.has(e)||(n.switches.add(e),e.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let o=e.getAttribute(Mt);if(o===null)return;let i=!ft(o);Qo(o,i),e.setAttribute("aria-checked",i?"true":"false"),t.classList.toggle(nr,!i)}))}var rr="data-bre-provider-delete",sd='[class*="rowActions"]',ad='[class*="dangerButton"]',sc="bre-provider-delete";function dd(e,t){if(!e.isConnected)return;let n=Pe(e);if(n===void 0)return;let r=t.labels(),o=ac(n)??t.t("providerRemoveDisabled");for(let i of Array.from(n.children)){if(!(i instanceof HTMLElement))continue;let s=Fe(i,r);if(s===void 0)continue;let a=Vt(i);if(a===void 0)continue;let d=a.querySelector(sd);if(d===null)continue;let l=d.querySelector(`[${rr}]`);if(d.querySelector(ad)!==null){l!==null&&l.remove();continue}let p=l??dc();d.lastElementChild!==p&&d.appendChild(p),lc(p,s,o,t.t("providerRemoveLocked",{provider:Tt(i)??s}))}}function ld(){for(let e of Array.from(document.querySelectorAll(`[${rr}]`)))e.remove()}function ac(e){let n=e.querySelector(`${sd} ${ad}`)?.textContent?.trim()??"";return n.length>0?n:void 0}function dc(){let e=document.createElement("button");return e.className=sc,e.setAttribute("type","button"),e.setAttribute("disabled",""),e}function lc(e,t,n,r){e.getAttribute(rr)!==t&&e.setAttribute(rr,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("aria-label")!==r&&e.setAttribute("aria-label",r),e.getAttribute("title")!==r&&e.setAttribute("title",r)}var or="data-bre-provider-disabled-group",uc="bre-provider-disabled-seat",ud="bre-provider-disabled-group",Eo="bre-row-folded",ko="bre-row-hidden";function fd(){return{expanded:!1}}function cd(e,t,n){if(!e.isConnected)return;let r=Pe(e);if(r===void 0)return;let o=md(r,t.labels()),i=o.filter(l=>!l.enabled).length,s=gd(r);if(i===0){s!==void 0&&s.remove(),To(o,n);return}let a=s??fc(r,t,n);(a.parentElement!==r||r.lastElementChild!==a)&&r.append(a),To(o,n);let d=hd(a);d!==void 0&&bd(d,i,t,n)}function pd(){for(let e of Array.from(document.querySelectorAll(`[${or}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${ko}, .${Eo}`)))e.classList.remove(ko,Eo)}function md(e,t){let n=[];for(let r of Array.from(e.children)){if(!(r instanceof HTMLElement)||r.getAttribute(or)!==null)continue;let o=Fe(r,t);o!==void 0&&n.push({row:r,id:o,enabled:ft(o)})}return n}function To(e,t){for(let n of e){let r=!n.enabled;n.row.classList.toggle(Eo,r),n.row.classList.toggle(ko,r&&!t.expanded)}}function gd(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.getAttribute(or)!==null)return t}function hd(e){return e.querySelector(`button.${ud}`)??void 0}function fc(e,t,n){let r=document.createElement("li");r.className=uc,r.setAttribute(or,"");let o=document.createElement("button");return o.className=ud,o.setAttribute("type","button"),o.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),n.expanded=!n.expanded,cc(e,t,n)}),r.appendChild(o),e.append(r),r}function cc(e,t,n){let r=md(e,t.labels());To(r,n);let o=gd(e);if(o===void 0)return;let i=r.filter(a=>!a.enabled).length;if(i===0){o.remove();return}let s=hd(o);s!==void 0&&bd(s,i,t,n)}function bd(e,t,n,r){let o=n.t(r.expanded?"providerDisabledGroupHide":"providerDisabledGroupShow",{count:t}),i=n.t("providerDisabledGroupHint"),s=r.expanded?"true":"false";e.textContent!==o&&(e.textContent=o),e.getAttribute("aria-expanded")!==s&&e.setAttribute("aria-expanded",s),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}var Yt="data-bre-row-model",Mo="bre-model-grid";function wd(){return Sn()}function pc(e){let t=[];for(let n of Array.from(e.querySelectorAll('[class*="modelList"]')))de(n).filter(o=>o.matches('[class*="modelEntry"]')).length!==0&&t.push(n);return t}function vd(e){for(let t of e){if(t.type!=="childList")continue;let n=t.target;if(n instanceof HTMLElement&&n.matches('[class*="modelList"]')&&de(n).some(r=>r.matches('[class*="modelEntry"]')))return!0;for(let r of[t.addedNodes,t.removedNodes])for(let o of Array.from(r))if(o instanceof HTMLElement&&o.matches('[class*="modelEntry"]'))return!0}return!1}function ir(e){let t=e.getAttribute(Yt);return t===null||t.length===0?void 0:t}function Lo(e,t){let n=e.closest("li");if(n!==null)return Fe(n,t.labels())}function yd(e,t){let n=pe(e,t.labels().modelName);return n.length>0?n:ir(e)}function mc(e,t){return{rowOf:n=>{let r=n.closest('[class*="modelEntry"]');return r instanceof HTMLElement?r:void 0},idOf:ir,labelOf:n=>yd(n,t),order:n=>{let r=Lo(e,t);return r===void 0?n:ai(r,n)},commit:n=>{let r=Lo(n,t);r!==void 0&&ii(r,Dt(n,ir))},seatOf:n=>n.querySelector('[class*="modelRow"]')??void 0,seatDrags:!1,gripLabel:(n,r)=>t.t("modelReorderAria",{model:yd(n,t)??r}),gripHint:()=>t.t("modelReorderHint"),decorate:(n,r)=>{r.classList.add(Mo)}}}function xd(e,t,n){if(!e.isConnected)return;let r=t.labels();for(let o of pc(e))if(Lo(o,t)!==void 0){for(let i of de(o)){let s=pe(i,r.modelId);if(s.length===0){i.removeAttribute(Yt);continue}ir(i)!==s&&i.setAttribute(Yt,s)}On(e,o,mc(o,t),n)}}function Ed(e){_n(e);for(let n of Array.from(document.querySelectorAll(`.${Mo}`)))n.classList.remove(Mo);let t=Array.from(document.querySelectorAll(`[${Yt}]`));Rn(t);for(let n of t)n.removeAttribute(Yt)}var gc="settings.models",Se={capacity:["modelAdvanced","Model options","Capacities"],modelId:["modelId","Model ID"],modelName:["modelName","Display name"],routeId:["customRoute","Provider ID"],baseUrl:["baseUrl","Base URL"],apiProtocol:["customApi","API protocol"],apply:["apply","Apply"],cancel:["cancel","Cancel"],editProvider:["editProvider","Edit {provider}"],inputImage:["modelInputImage","Image"]};function Td(e){let{ctx:t,api:n,t:r,onIdle:o,refreshed:i}=e,s=()=>{let q=t.locale.bind(gc),B=([U,...S])=>{let K=q(U);return K===U||K.trim()===""?S:[K,...S]};return{capacity:B(Se.capacity),modelId:B(Se.modelId),modelName:B(Se.modelName),routeId:B(Se.routeId),baseUrl:B(Se.baseUrl),apiProtocol:B(Se.apiProtocol),apply:B(Se.apply),cancel:B(Se.cancel),editProvider:B(Se.editProvider),inputImage:B(Se.inputImage)}},a=120,d=1e3,l=Rs(),p=Za(),g={t:r,labels:s},c=rd(),u={t:r,labels:s},f={t:r,labels:s},m=fd(),h={t:r,labels:s},v=wd(),x={t:r,labels:s},b=ga(),A={t:r},R=Va(),H=Pa(),O={t:r,api:n,routeIdLabels:()=>s().routeId,staged:H,refreshed:i},L,F,y,I,w=!1,M={api:n,describeNamespace:()=>te(n),t:r,labels:s,onIdle:o,onBackoff:q=>{N(q)},onPendingChanged:()=>{oe()},mount(q,B){let U=document.createElement("div");U.className="bre-effort-slot",U.dataset.plugin=re,q.appendChild(U);let S=(0,kd.createRoot)(U),K=Y=>{S.render((0,So.createElement)(Ie,{fallbackText:r("renderFailed"),children:i(()=>(0,So.createElement)(kn,Y))}))};return K(B),{unmount:()=>{try{S.unmount()}finally{U.remove()}},render:K}}};function N(q){w||F!==void 0||(F=window.setTimeout(()=>{F=void 0,oe()},q))}let W=()=>{let q=Te();Pe(q)!==void 0&&(ed(q,g,p),od(q,u,c),dd(q,f),cd(q,h,m),xd(q,x,v),mo(),Ta(q))},X=(q,B)=>{try{B()}catch(U){console.error(`[bre] ${q} failed:`,U)}};function oe(){w||L!==void 0||(L=window.setTimeout(()=>{L=void 0,X("composer mutation",()=>{I?.()}),Gs(Te(),M,l),vo(Te(),O,R),uo(Te(),A,b),W(),Ka(H,n).then(q=>{q>0&&N(d)})},a))}let J=q=>{if(w||y!==void 0)return;I=q,X("models page startup",()=>{q(),W()}),Ws();let B=U=>{q(),vo(Te(),O,R),uo(Te(),A,b),W(),vd(U)&&Bs(Te())};y=new MutationObserver(U=>{X("models mutation",()=>{B(U)}),oe()}),y.observe(document.body,{childList:!0,subtree:!0}),oe()},Q=()=>{w=!0,L!==void 0&&(window.clearTimeout(L),L=void 0),F!==void 0&&(window.clearTimeout(F),F=void 0),y?.disconnect(),y=void 0};return{state:l,labels:s,start:J,stopObserver:Q,teardown:()=>{if(!l.disposed){Q(),l.disposed=!0,Ns(),Ss(l,M);for(let[,q]of l.mounted)q.editor.unmount();l.mounted.clear(),td(p),id(),ld(),pd(),es(),Ma(),Ia(),Ed(v),Ja(R),ya(),Ks()}},flushOnUnload:()=>{As(l,M)},schedule:oe}}function hc(e,t){let n=e?.list?.getSnapshot(),r=n?.current;if(typeof r=="string"&&r.length>0)return r;let o=t?.adapter?.current?.getSnapshot?.()?.key;if(typeof o=="string"&&o.length>0)return o;for(let[i,s]of Object.entries(n?.byId??{}))if(!(s===void 0||(s.retainedBy?.mainView??0)<=0))return typeof s.id=="string"&&s.id.length>0?s.id:i}function Md(e){let t,n=new Map,r=(s,a)=>{for(let[d,l]of n){if(d===a)continue;let p;try{p=s.directoryFor(l.sessionId)===d}catch{p=!1}p||(l.restore(),n.delete(d))}};return{ensure:()=>{let s=e.ctx,a=s.get?.("sessions"),d=s.get?.("uiSession"),l=s.get?.("modelDirectories"),p=hc(a,d);if(!(p===void 0||l===void 0))try{let g=l.directoryFor(p);return r(l,g),t!==void 0&&t.sessionId===p&&t.directory===g||(n.has(g)||n.set(g,{sessionId:p,restore:wi(g,{configuredEffort:e.configuredEffort})}),t={sessionId:p,directory:g}),g}catch{t=void 0;return}},dispose:()=>{for(let[,s]of n)s.restore();n.clear()}}}var Ae=require("react");var Ld="settings.models.provider-card";function bc(e){if(e===null)return;let t=e.querySelector('[class*="editorActions"]');if(t===null)return;let n=Array.from(t.querySelectorAll("button")),r=t.querySelector('button[class*="secondaryButton"]')??n.at(-2)??null;r!==null&&(r instanceof HTMLButtonElement&&r.disabled||r.click())}function yc({provider:e,api:t,t:n}){let r=(0,Ae.useRef)(null),o=e?.provider,i=(0,Ae.useCallback)(()=>{bc(Gt(r.current))},[]);return(0,Ae.useEffect)(()=>{let s=r.current,a=Gt(s);if(s===null||a===null)return;let d=a,l=()=>a.querySelector('[class*="_editor"]')!==null,p=()=>{let c=l()?"1":"0";s.dataset.edit!==c&&(s.dataset.edit=c)};p();let g=new MutationObserver(p);return g.observe(d,{childList:!0,subtree:!0}),()=>{g.disconnect()}},[o]),typeof o!="string"||o.length===0?null:(0,Ae.createElement)("div",{ref:r,className:"bre-headers-host","data-bre-provider":o},(0,Ae.createElement)(er,{host:r,t:n}),(0,Ae.createElement)(Zn,{route:o,api:t,t:n,onDismiss:i}))}function Sd(e,t,n){let r=e,o=r.slots?.inject(Ld,()=>{r.slots?.register({name:Ld,key:fe,inject:()=>({api:t,t:n})},yc)});return typeof o=="function"?o:()=>{}}var be=require("react");function Ad(e){let{t}=e,n=(0,be.useSyncExternalStore)(tn,we),r=()=>{Bo(!n)};return(0,be.createElement)("div",{className:"bre-slider-setting"},(0,be.createElement)("div",{className:"bre-slider-setting-row"},(0,be.createElement)("div",{className:"bre-slider-setting-copy"},(0,be.createElement)("div",{className:"bre-slider-setting-title"},t("sliderToggleTitle")),(0,be.createElement)("div",{className:"bre-slider-setting-description"},t("sliderToggleDescription"))),(0,be.createElement)("div",{className:"bre-slider-setting-control"},(0,be.createElement)("span",{className:"bre-slider-setting-state"},t(n?"settingOn":"settingOff")),(0,be.createElement)("button",{type:"button",role:"switch","aria-label":t("sliderToggleAria"),"aria-checked":n,className:"bre-slider-setting-switch"+(n?" is-on":""),onClick:r},(0,be.createElement)("span",{className:"bre-slider-setting-switch-knob","aria-hidden":!0})))))}function Rd(e,t){let n=e,r=n.slots?.inject("settings.models.footer",()=>{n.slots?.register({name:"settings.models.footer",id:re+"-slider-toggle",order:15,inject:()=>({t})},Ad)});return typeof r=="function"?r:()=>{}}var wc=re,vc=["slots","locale","connection","remote","remote.settings"];function xc(e){e.effect(()=>e.locale.register(ar,{zh:Wo,en:qo}),"dsh-model-think-level: dictionaries");let t=document.createElement("style");t.dataset.plugin=re,t.dataset.pluginStyles=re,t.textContent=li,document.head.appendChild(t),e.effect(()=>()=>t.remove(),"dsh-model-think-level: stylesheet");let n=(()=>{try{let f=e.get?.("configForms");try{let h=f?.get?.(fe);if(h!==void 0)return h}catch{}return e.get?.("settingsScope")?.bind?.({namespace:fe})}catch{return}})(),r=n===void 0?{settings:e.remote.settings}:{settings:e.remote.settings,scope:n},o=e.locale.bind(ar),i=()=>{let f=e.locale;return typeof f.subscribe=="function"&&typeof f.getSnapshot=="function"?f:void 0},s=f=>{let m=i();return m===void 0?f():(0,Hd.createElement)(Fo,{locale:m,children:f})},a=Bi({api:r}),d=ki(r),l=Md({ctx:e,configuredEffort:a.of}),p=Ki({menuOf:Pi,triggerOf:Fi,t:o,refreshed:s,sliderEnabled:we,directory:l.ensure,configuredInputs:d}),g=Gi({api:r}),c=Td({ctx:e,api:r,t:o,onIdle:g.run,refreshed:s}),u=()=>{l.ensure(),p.reconcile()};e.effect(()=>(c.start(u),()=>{c.teardown(),p.dispose(),l.dispose()}),"dsh-model-think-level: DOM injector"),e.effect(()=>{let f=()=>{c.flushOnUnload()};return window.addEventListener("pagehide",f),()=>{window.removeEventListener("pagehide",f)}},"dsh-model-think-level: ledger flush on unload"),e.effect(()=>{let f=()=>{c.state.describePromise=void 0,a.invalidate(),d.invalidate(),g.invalidate(),c.schedule()},m=[e.remote.$on("settings/document-updated",h=>{h===fe&&f()}),e.on("connection/reset",f)];return()=>{for(let h of m)h()}},"dsh-model-think-level: pushed invalidations"),e.effect(()=>{let f=b=>{b.key===en?Uo(b.newValue!=="false"):b.key===nn?Vo(lt(b.newValue)):b.key===on?Zo(Xo(b.newValue)):b.key===an&&si(hr(b.newValue))};window.addEventListener("storage",f);let m=tn(()=>{c.schedule()}),h=rn(()=>{c.schedule()}),v=sn(()=>{c.schedule()}),x=dn(()=>{c.schedule()});return()=>{window.removeEventListener("storage",f),m(),h(),v(),x()}},"dsh-model-think-level: client preferences"),e.effect(()=>Rd(e,o),"dsh-model-think-level: footer slot activation"),e.effect(()=>Sd(e,r,o),"dsh-model-think-level: provider-card slot activation")}
|
|
3434
|
+
`;var an=require("react"),Xa=require("react-dom");var T=require("react"),_a=require("react-dom");var Ma=["off","minimal","low","medium","high","xhigh","max"],Vc=["text","image"];var Yc=[{id:"deepseek-v4-vision",patterns:["deepseek-v4-flash-vision","deepseek-v4-vision"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:"DeepSeek \u89C6\u89C9\u5B9E\u9A8C\u7248 id\uFF08deepseek-v4-flash-vision-exp\uFF09\u3002\u5B98\u65B9\u76EE\u5F55\u5DF2\u6807\u6CE8\u8BE5\u6A21\u578B\u9000\u5F79\uFF0C\u540D\u5B57\u4ECD\u88AB\u63A5\u53D7\u3001\u7531\u73B0\u884C deepseek-flash \u63D0\u4F9B\u670D\u52A1\u2014\u2014\u56FE\u7247\u8F93\u5165\u73B0\u5DF2\u7531 deepseek-flash \u539F\u751F\u63D0\u4F9B\u3002"},{id:"deepseek-v4-1-flash",patterns:["deepseek-v4.1-flash","deepseek-flash"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek-V4.1-Flash\uFF082026-09-10 \u53D1\u5E03\u7684\u73B0\u884C\u5B98\u65B9\u6A21\u578B\uFF0C\u5B98\u65B9 id \u4E3A deepseek-flash\uFF1B25 \u4E07\u5E76\u53D1\u3001**\u539F\u751F\u56FE\u7247\u8F93\u5165**\uFF09\u3002V4.1 \u7684\u5404\u5199\u6CD5\uFF08deepseek-flash\u3001deepseek-v4.1-flash\u3001deepseek-v4-1-flash\uFF0C\u4EE5\u53CA\u5E26\u65E5\u671F\u540E\u7F00\u7684\u7B2C\u4E09\u65B9\u53D8\u4F53\uFF09\u90FD\u5F52\u6B64\u6761\u2014\u2014\u7EAF\u6587\u672C\u7684 deepseek-v4 \u4E3B\u5E72\u4E0D\u518D\u541E\u6389\u5B83\u4EEC\u3002\u5B98\u65B9\u679A\u4E3E\u540C V4 \u7CFB\uFF1AOff\uFF08thinking:"disabled"\uFF09/ Low / High / Max\uFF0C\u9ED8\u8BA4 High\uFF1B\u5BB9\u91CF 1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\u3002'},{id:"deepseek-v4",patterns:["deepseek-v4"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek \u5B98\u65B9\u679A\u4E3E Low / High / Max\uFF08\u9ED8\u8BA4 High\uFF1Bminimal\u3001medium\u3001xhigh \u517C\u5BB9\u6620\u5C04\uFF0Cultra\u2192max\uFF09\uFF0COff \u5373 thinking:"disabled"\uFF08Responses API \u4E0B off \u4EE5 reasoning.effort:"none" \u8868\u793A\uFF09\u3002\u672C\u6761\u76EE\u662F V4 \u5BB6\u65CF\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF1Adeepseek-v4-pro\uFF08= DeepSeek-V4-Pro-0813\uFF0C\u5B98\u65B9\u4E0D\u652F\u6301\u56FE\u7247\uFF09\u4E0E\u5DF2\u9000\u5F79\u6A21\u578B\u7684\u517C\u5BB9\u522B\u540D deepseek-v4-flash\uFF08deepseek-v4-flash-vision-exp \u53E6\u6709\u89C6\u89C9\u6761\u76EE\uFF09\u3002**\u6536\u56FE\u7684 V4.1-Flash\uFF08\u5B98\u65B9 id deepseek-flash\uFF09\u53E6\u6709\u4E13\u95E8\u6761\u76EE**\uFF0C\u5176 input \u542B image\u3002\u5BB9\u91CF\uFF1A1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\uFF08393,216\uFF1B\u9ED8\u8BA4\u975E\u601D\u8003 8K\u3001\u601D\u8003 64K\u3001effort=max \u65F6 128K\uFF09\u3002'},{id:"deepseek-v3",patterns:["deepseek-v3","deepseek-chat"],efforts:{off:"none",high:"high",max:"max"},compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:65536,note:"DeepSeek V3 \u6863\u4F4D\uFF1AOff / High / Max\u3002\u5B98\u65B9\u5DF2\u505C\u552E V3 \u4EE3\uFF08\u5B9A\u4EF7\u9875\u4EC5\u5269 V4 \u4E09\u578B\uFF09\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55\u73B0\u5F79\u503C\u3002"},{id:"deepseek-r1",patterns:["deepseek-r1","deepseek-reasoner"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:32768,note:"DeepSeek-R1 \u4E3A\u63A8\u7406\u6A21\u578B\uFF0C\u4EC5\u63D0\u4F9B High\u3002\u5B98\u65B9\u5DF2\u4E0B\u67B6 R1 \u4EE3\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55 r1-0528 \u503C\u3002"},{id:"openai-gpt-5-2",patterns:["gpt-5.2"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2 \u6863\u4F4D\uFF1ANone / Low / Medium / High / XHigh\uFF08\u9ED8\u8BA4 None\uFF09\u3002\u5B98\u65B9\u53E6\u652F\u6301 PDF \u8F93\u5165\uFF08\u6838\u5FC3\u8BCD\u8868\u6682\u4E0D\u542B\uFF09\u3002gpt-5.2-pro \u5B98\u65B9\u9875\u672A\u5355\u5217\u6863\u4F4D\u884C\uFF0C\u6309\u672C\u6761\u76EE\u540C\u6863\u5904\u7406\uFF1Bgpt-5.2-codex \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"openai-gpt-5-2-codex",patterns:["gpt-5.2-codex"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2-Codex \u6863\u4F4D\uFF1ALow / Medium / High / XHigh\uFF08\u65E0 None \u6863\uFF0C\u52FF\u52FE Off\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\u3002"},{id:"openai-gpt-5-6",patterns:["gpt-5.6"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.6\uFF08\u522B\u540D\u5373 sol\uFF09\u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh / Max\uFF1Bsol/luna/terra \u540C\u6863\uFF0C\u5E26\u56FE\u8F93\u5165\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-5",patterns:["gpt-5.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.5 \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF08\u65E0 Max \u6863\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 High(\u9ED8\u8BA4) / XHigh\u30011.05M \u4E0A\u4E0B\u6587\u4E14\u4EC5 Responses API\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-4",patterns:["gpt-5.4"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.4 \u6863\u4F4D\uFF1ANone(\u9ED8\u8BA4) / Low / Medium / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 Medium/High/XHigh\uFF081.05M\uFF09\uFF1Bmini/nano \u4E3A 400K \u4E0A\u4E0B\u6587\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-3",patterns:["gpt-5.3"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.3-Codex \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\uFF1B2026-10 \u6821\u51C6\uFF1ANone \u6863\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8865\u56DE\uFF08\u6B64\u524D\u6309\u65E7\u6A21\u578B\u9875\u8BB0\u4E3A\u65E0 None\uFF09\u3002gpt-5.3-chat \u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF08\u89C1 chat \u6761\u76EE\uFF09\u3002"},{id:"openai-gpt-5-1",patterns:["gpt-5.1"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1 \u6863\u4F4D\uFF1ANone / Low / Medium / High\uFF08\u9ED8\u8BA4 None\uFF09\u3002"},{id:"openai-gpt-5-1-codex",patterns:["gpt-5.1-codex"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1-Codex \u7CFB\u5217\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF0C\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High\uFF08\u65E0 None\uFF1Bxhigh \u672A\u8BC1\u5B9E\uFF09\u3002\u5982\u7AEF\u70B9\u652F\u6301 xhigh/none \u53EF\u624B\u8C03\u3002"},{id:"openai-gpt-5",patterns:["gpt-5"],efforts:{minimal:"minimal",low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5 \u521D\u4EE3\u6863\u4F4D\uFF1AMinimal / Low / Medium / High\uFF0C\u65E0\u5173\u95ED\u6863\u3002"},{id:"openai-gpt-5-2-chat",patterns:["gpt-5.2-chat"],efforts:{off:null,medium:"medium",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"GPT-5.2-Chat\uFF08\u5B98\u65B9 id gpt-5.2-chat-latest\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u8BB0\u4E3A\u63A8\u7406\u6A21\u578B\uFF0C\u4EC5 Medium / XHigh \u4E24\u6863\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF0C\u975E\u663E\u5F0F\u5173\u95ED\uFF09\uFF0C128K / 16,384 \u8F93\u51FA\u30022026-10 \u65B0\u589E\u6761\u76EE\u3002"},{id:"openai-chat",patterns:["gpt-5.1-chat-latest","gpt-5.3-chat-latest","gpt-5-chat-latest","gpt-chat-latest","gpt-5-chat","gpt-5.1-chat","gpt-5.3-chat"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"-chat \u7CFB\u5217\uFF08\u5B98\u65B9 id \u4E3A gpt-5.x-chat-latest\uFF09\u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 16,384 \u8F93\u51FA\u3002gpt-5-chat-latest \u5DF2\u4E8E 2026-07-23 \u4E0B\u67B6\u3001gpt-chat-latest \u5DF2\u65E0\u5B98\u65B9\u9875\u9762\uFF08\u4FDD\u7559\u6A21\u5F0F\u4F9B\u7F51\u5173\uFF09\u3002gpt-5.2-chat \u53E6\u6709\u63A8\u7406\u6761\u76EE\u3002"},{id:"openai-o",patterns:["o1","o3","o4"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:1e5,note:"OpenAI o \u7CFB\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u5B98\u65B9\u5DF2\u4E8E 2026-06 \u516C\u544A\u9000\u5F79\uFF08o1/o1-pro/o3-mini/o4-mini 2026-10-23 \u79FB\u9664\u3001o3/o3-pro 2026-12-11\uFF09\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1B\u591A\u6570 o \u7CFB\u7AEF\u70B9\u6536\u56FE\uFF08o3-mini \u4F8B\u5916\uFF09\u3002"},{id:"openai-gpt-oss",patterns:["gpt-oss"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:131072,maxTokens:131072,note:"GPT-OSS \u5F00\u6E90\u6743\u91CD\uFF08Ollama/vLLM \u5E38\u89C1\uFF09\uFF1Areasoning effort Low / Medium / High\uFF0C\u7EAF\u6587\u672C\uFF0C131K \u4E0A\u4E0B\u6587 / 131K \u8F93\u51FA\u30022026-09 \u590D\u6838\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u73B0\u5728\u5199 Chat Completions = Not supported\u3001\u65E0\u56FE\u7247\u8F93\u5165\uFF08\u9ED8\u8BA4 Low \u6765\u81EA\u5B98\u65B9 CLI\uFF0C\u4E0D\u662F API \u9875\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u4E0D\u518D\u58F0\u660E Off\u3002"},{id:"openai-gpt-6",patterns:["gpt-6-luna","gpt-6-sol","gpt-6-terra","gpt-6.1"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:'GPT-6 \u7CFB\uFF08luna/sol/terra\uFF0C2026-10 \u6821\u51C6\u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u5168\u6863 None / Low / Medium / High / XHigh / Max\uFF0C\u5E26\u56FE\u8F93\u5165\uFF0C272,000 \u4E0A\u4E0B\u6587 / 128,000 \u8F93\u51FA\u3002gpt-6-astra \u89C1\u5355\u72EC\u6761\u76EE\uFF08\u88F8 "gpt-6" \u4E0E 6.1-sol \u7531 astra \u6761\u76EE\u627F\u63A5\uFF0Coff \u4EE5\u7701\u7565\u8868\u8FBE\uFF0C"none" \u672A\u8BC1\u5B9E\u53EF\u624B\u8C03\uFF09\u3002'},{id:"openai-gpt-6-astra",patterns:["gpt-6-astra","gpt-6","gpt-6.1-sol"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:'GPT-6 Astra \u6863\u4F4D\uFF1ALow / Medium / High / XHigh / Max\u2014\u2014**\u6CA1\u6709 None \u6863**\uFF08\u5B98\u65B9\u539F\u6587\uFF1A\u8BBE\u4E3A none \u8FD4\u56DE HTTP 400\uFF09\uFF0C\u56E0\u6B64\u672C\u6761\u76EE\u4E0D\u58F0\u660E Off\u3002\u5E26\u56FE\u8F93\u5165\uFF1B2026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002\u5DE5\u5177\u8C03\u7528\u9700\u8D70 Responses API\u3002gpt-6 luna/sol/terra \u89C1\u5355\u72EC\u6761\u76EE\uFF1B\u88F8 "gpt-6" \u4E0E 6.1-sol\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\u7531\u672C\u6761\u76EE\u627F\u63A5\u3002'},{id:"openai-gpt-daybreak",patterns:["gpt-daybreak"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-Daybreak\uFF08blue-latest 1.05M / red-latest 400K\uFF0C2026-10 \u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u5168\u6863 None / Low / Medium / High / XHigh / Max\uFF0C\u5E26\u56FE\u8F93\u5165 / 128,000 \u8F93\u51FA\u3002"},{id:"openai-gpt-realtime",patterns:["gpt-realtime"],efforts:{minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:128e3,maxTokens:32e3,note:"GPT-Realtime 2.1\uFF082026-10 \u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u6863\u4F4D Minimal / Low / Medium / High / XHigh\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF0C128,000 \u4E0A\u4E0B\u6587 / 32,000 \u8F93\u51FA\u3002"},{id:"openai-gpt-5-6-cyber",patterns:["gpt-5.6-cyber"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.6-Cyber\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF08\u4E0D\u7B49\u4E8E\u4E0D\u652F\u6301\uFF09\uFF0C\u6545\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High / XHigh\uFF1B\u8BE5\u578B\u53F7\u4EC5 Responses API\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K \u4E0A\u4E0B\u6587\u3002\u5B98\u65B9\u652F\u6301\u7684\u5176\u4ED6\u6863\u4F4D\u53EF\u624B\u8C03\u540E\u5E94\u7528\u3002"},{id:"openai-gpt-4o",patterns:["gpt-4o"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"GPT-4o \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u56FE\u7247\u8F93\u5165\u5168\u7CFB\u6807\u914D\uFF0C128K / 16,384 \u8F93\u51FA\u3002"},{id:"openai-gpt-4-1",patterns:["gpt-4.1"],efforts:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,note:"GPT-4.1 \u5168\u7CFB\uFF08\u542B mini/nano\uFF09\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF1B\u5B98\u65B9 1,047,576 \u4E0A\u4E0B\u6587 / 32,768 \u8F93\u51FA\uFF0C\u5168\u7CFB\u5E26\u56FE\u8F93\u5165\u3002"},{id:"openai-gpt-4-turbo-preview",patterns:["gpt-4-turbo-preview"],efforts:!1,input:["text"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo Preview\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u7EAF\u6587\u672C\u8F93\u5165\uFF08\u6B63\u5F0F turbo \u5FEB\u7167\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u4E0B\u6761\uFF09\uFF0C128K\u3002"},{id:"openai-gpt-4-turbo",patterns:["gpt-4-turbo"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 4,096 \u8F93\u51FA\u3002"},{id:"openai-gpt",patterns:["gpt-4","gpt-3.5"],efforts:!1,input:["text"],note:"GPT-4/3.5 \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\u3002gpt-4-turbo/4.1 \u8D77\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\uFF1B\u65B0\u4EE3\u8BF7\u7528 GPT-5 \u7CFB\uFF08\u89C1 openai-chat/gpt-5.x \u6761\u76EE\uFF09\u3002"},{id:"anthropic-claude-5-5",patterns:["claude-haiku-5.5","claude-opus-5-5","claude-sonnet-5-5","haiku-5.5","claude-5-5"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 5.5 \u4EE3\uFF08Haiku 5.5 / Opus 5.5 / Sonnet 5.5\uFF09\uFF1Api-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u5168\u6863 Low / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF0C\u81EA\u9002\u5E94\u601D\u8003\uFF0C1M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\u3002off/minimal \u4EE5\u7701\u7565\u8868\u8FBE\uFF08\u76EE\u5F55\u5C06\u4E24\u952E\u8BB0\u4E3A null\uFF0C\u975E\u663E\u5F0F\u5173\u95ED\uFF09\u3002"},{id:"anthropic-claude-5",patterns:["claude-fable-5","claude-mythos-5","claude-opus-5","claude-sonnet-5"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 5 \u4EE3\uFF08Fable 5 / Mythos 5 / Opus 5 / Sonnet 5\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u5DF2\u6536\u7D27\u4E3A XHigh / Max\uFF08low/medium/high \u6863\u5DF2\u4ECE\u8BE5\u4EE3 effort \u76EE\u5F55\u79FB\u9664\uFF1BFable 5 \u4E0E Opus 5 \u53E6\u63A5\u53D7\u4EE5\u7701\u7565\u8868\u8FBE\u7684 off\uFF0CSonnet 5 \u65E0 off\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF08Batch 300K\uFF09\u3002\u5B98\u65B9\u652F\u6301 PDF \u8F93\u5165\u3002\u6CE8\u610F\uFF1AAnthropic \u5B98\u65B9 OpenAI \u517C\u5BB9\u5C42\u4F1A\u5FFD\u7565 effort \u53C2\u6570\uFF0C\u58F0\u660E\u5728\u7B2C\u4E09\u65B9\u7F51\u5173\u6620\u5C04\u65F6\u751F\u6548\u3002"},{id:"anthropic-claude-5-1",patterns:["claude-fable-5-1","claude-mythos-5-1"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Fable 5.1 / Mythos 5.1\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u76EE\u5F55\u6863\u4F4D XHigh / Max\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF0C\u81EA\u9002\u5E94\u601D\u8003\u5E38\u5F00\uFF08\u4E0D\u63A5\u53D7 enabled/disabled\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF1BFable 5.1 \u652F\u6301\u4F1A\u8BDD\u4E2D\u9014\u6539\u6863\uFF08\u9700 beta header\uFF0C\u672C\u63D2\u4EF6\u4E0D\u6D89\u53CA\uFF09\u3002"},{id:"anthropic-claude-mythos-preview",patterns:["claude-mythos-preview"],efforts:{low:"low",medium:"medium",high:"high",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Mythos Preview\uFF1A\u5B98\u65B9\u6863\u4F4D Low / Medium / High / Max\uFF08\u65E0 XHigh\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3002pi-ai 1.2.0 \u76EE\u5F55\u65E0 mythos \u6761\u76EE\uFF0C\u672C\u6863\u4F4D\u6CBF\u7528\u5B98\u65B9 effort \u77E9\u9635\u3002"},{id:"anthropic-claude-opus-4-high",patterns:["claude-opus-4-8","claude-opus-4-7"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Opus 4.7/4.8\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u6863\u4F4D\u4EC5 XHigh / Max\uFF08low/medium/high \u5DF2\u4ECE\u8BE5\u4EE3\u76EE\u5F55\u79FB\u9664\uFF1Bxhigh \u4E3A\u5B98\u65B9\u63A8\u8350\u7684\u7F16\u7801\u8D77\u6B65\u6863\uFF09\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-4-6",patterns:["claude-opus-4-6","claude-sonnet-4-6"],efforts:{max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 4.6 \u4EE3\uFF08Opus 4.6 / Sonnet 4.6\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u4EC5\u5269 Max \u4E00\u6863\uFF08low/medium/high/xhigh \u5747\u5DF2\u4ECE\u76EE\u5F55\u79FB\u9664\uFF09\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-opus-4-5",patterns:["claude-opus-4-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude Opus 4.5\uFF1A\u5B98\u65B9 effort \u652F\u6301\u5217\u8868\uFF0820251101 \u5FEB\u7167\uFF09\uFF0C\u6863\u4F4D Low / Medium / High\uFF08\u65E0 XHigh/Max\uFF09\uFF0C\u53EF\u4E0E budget_tokens \u5E76\u7528\uFF1B200K / 64K\u3002"},{id:"anthropic-claude",patterns:["claude"],efforts:!1,input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude 3.x \u4E0E Sonnet 4.5 / Haiku 4.5\uFF1A\u5B98\u65B9 effort \u53C2\u6570\u4E0D\u652F\u6301\uFF08\u4EC5 5.5/5/5.1 \u4EE3\u3001Opus 4.5/4.6/4.7/4.8\u3001Sonnet 4.6 \u652F\u6301\uFF09\uFF0C\u601D\u8003\u7531 thinking.type \u63A7\u5236\u2014\u2014\u52FF\u52FE\u601D\u8003\u6863\u3002\u53C2\u8003\u5BB9\u91CF 200K / 64K\uFF08Haiku 3.5 \u4E3A\u7EAF\u6587\u672C\uFF0C\u6309\u9700\u53D6\u6D88\u56FE\u7247\uFF09\u3002Haiku 5.5 \u53CA\u6574\u4E2A 5.5 \u4EE3\u89C1\u4E0A\u65B9 anthropic-claude-5-5 \u6761\u76EE\u3002"},{id:"google-gemini",patterns:["gemini"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:65536,note:"Gemini \u901A\u7528\u5B89\u5168\u6863\uFF1ALow / Medium / High\uFF08\u5B98\u65B9 OpenAI \u517C\u5BB9\u6620\u5C04\u8868\u53E6\u6536 minimal\uFF1A2.5 \u7CFB\u6620\u5C04\u4E3A 1,024 \u9884\u7B97\u30013.1 Flash-Lite/3 Flash \u539F\u751F minimal\u30013.1 Pro \u843D low\uFF09\u3002none \u4EC5\u80FD\u5173 2.5 \u975E Pro\uFF1B2.5 Pro \u4E0E 3 \u4EE3\u4E0D\u53EF\u5173\uFF1B\u5404\u578B\u9ED8\u8BA4\u4E0D\u4E00\uFF08flash-lite \u9ED8\u8BA4\u5173\uFF09\u3002\u5B98\u65B9\u53E6\u6536\u97F3\u9891/\u89C6\u9891/PDF\u3002Gemma-4 \u89C1\u4E0B\u6761\u3002"},{id:"google-gemma-4",patterns:["gemma-4"],efforts:{off:null,minimal:"MINIMAL",high:"HIGH"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,maxTokens:32768,note:"Gemma 4\uFF0826b/31b-it\uFF09\uFF1A\u4E09\u6863 Minimal / High\uFF08\u6863\u4F4D\u7EBF\u4E3A\u5B98\u65B9\u5927\u5199\u679A\u4E3E\u62FC\u5199\uFF09\uFF0Coff \u4EE5\u7701\u7565\u8868\u8FBE\uFF1BLow/Medium \u4E0D\u88AB\u63A5\u53D7\u3002\u5E26\u56FE\u8F93\u5165\uFF0C262,144 / 32,768\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"xai-grok-4-7",patterns:["grok-4.7"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,maxTokens:5e5,note:'Grok 4.7\uFF1A\u6863\u4F4D Low / Medium / High / XHigh\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF08off \u4EC5\u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C500K \u4E0A\u4E0B\u6587 / 500K \u8F93\u51FA\uFF082026-10 \u6821\u51C6\uFF1Api-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u786E\u8BA4\u6863\u4F4D\u4E0E\u5BB9\u91CF\uFF0C"\u4E0A\u6E38 404"\u4E0E"\u6863\u4F4D\u672A\u8BC1\u5B9E"\u4E24\u6761\u65E7\u8BB0\u5F55\u4F5C\u5E9F\uFF09\u3002grok-4.5 \u4F20 xhigh \u88AB\u9759\u9ED8\u6309 High \u5904\u7406\u7684\u8BF4\u660E\u89C1\u5176\u6761\u76EE\u3002'},{id:"xai-grok-high",patterns:["grok-4.6"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:'Grok 4.6 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3001500K \u4E0A\u4E0B\u6587\u3002Grok 4.7 \u89C1\u4E0A\u4E00\u6761\uFF08\u6B64\u524D\u8BB0\u4E3A"\u4E0D\u5B58\u5728"\uFF0C\u5DF2\u968F\u53D1\u5E03\u4F5C\u5E9F\uFF09\u3002'},{id:"xai-grok-4-5",patterns:["grok-4.5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:"Grok 4.5 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4)\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3002\u4F20\u5165 xhigh \u4F1A\u88AB\u5B98\u65B9\u9759\u9ED8\u6309 High \u5904\u7406\u3002"},{id:"xai-grok-4-3",patterns:["grok-4.3"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,maxTokens:3e4,note:"Grok 4.3\uFF1A\u5B98\u65B9\u56DB\u7EA7 reasoning effort\uFF08None / Low(\u9ED8\u8BA4) / Medium / High\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 30,000 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\uFF1AXHigh \u6863\u6309 pi-ai 1.2.0 \u76EE\u5F55\u79FB\u9664\u2014\u2014\u5B83\u81EA 4.6 \u8D77\u624D\u52A0\u5165\uFF1B\u5E26\u56FE\u8F93\u5165\uFF09\u3002grok-4-fast \u7B49\u65E7 slug 2026-05-15 \u8D77\u81EA\u52A8\u91CD\u5B9A\u5411\u5230\u672C\u578B\u53F7\u3002"},{id:"xai-grok",patterns:["grok"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"Grok \u901A\u7528\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u521D\u4EE3 grok-4\u3001grok-4.20 \u4E0E grok-build-0.1 \u4E0D\u63A5\u53D7\u8BE5\u53C2\u6570\uFF08grok-4 \u7CFB\u4E0E grok-3 \u5DF2\u4E8E 2026-05-15 \u9000\u5F79\u5E76\u91CD\u5B9A\u5411\u81F3 4.3\uFF09\uFF1Bgrok-4.20-multi-agent \u7684\u56DB\u6863\u63A7\u5236\u7684\u662F agent \u6570\u91CF\u800C\u975E\u601D\u8003\u6DF1\u5EA6\u3002\u65B0\u65E7\u4EE3\u9645\u8BF7\u4F18\u5148\u9009 4.5/4.6/4.3\uFF1B\u591A\u6A21\u6001\u53D8\u4F53\u6309\u9700\u52FE\u9009\u56FE\u7247\u3002"},{id:"mistral-magistral",patterns:["magistral"],efforts:{off:"none",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,maxTokens:16384,note:'Magistral\uFF08magistral-medium-latest\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u76EE\u5F55\u663E\u793A\u73B0\u5F79 magistral \u8D70 mistral-conversations \u534F\u8BAE\u5E76\u63A5\u53D7 effort\uFF08None / High \u4E24\u6863\uFF0C\u9ED8\u8BA4 None\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\uFF0C262,144 / 16,384\u3002\u65E9\u524D"\u8BE5\u7EBF\u65E0 effort \u53C2\u6570\u4E14\u5DF2\u5F03\u7528"\u7684\u8BB0\u5F55\u4F5C\u5E9F\u3002'},{id:"mistral-medium-3",patterns:["mistral-medium-3.5","mistral-large-4","mistral-medium-2604","mistral-medium-latest","mistral-small-latest","mistral-small-2603"],efforts:{off:"none",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"Mistral \u73B0\u5F79\u63A8\u7406\u6863\uFF082026-10 \u6269\u5145\uFF09\uFF1ANone / High \u4E24\u6863\uFF0C\u5B98\u65B9 reasoning_effort \u679A\u4E3E\u5373 none/high\uFF1B\u73B0\u5F79\u578B\u53F7 mistral-large-4\uFF081M\uFF09\u3001mistral-medium-3.5\uFF082604/latest\uFF09\u3001mistral-small-2603\uFF08Small 4\uFF09\u7ECF\u5B83\u63A7\u5236\uFF0C\u5747\u5E26\u89C6\u89C9\u3002\u5BB9\u91CF\uFF1Alarge-4 262,144 \u8F93\u51FA\u3001medium 262,144 \u8F93\u51FA\u3001small 256,000 \u8F93\u51FA\uFF08\u4E0A\u4E0B\u6587\u5747 262,144\uFF09\u3002\u975E\u63A8\u7406\u65E7\u6B3E\u89C1\u4E0B\u6761\u3002"},{id:"mistral-legacy",patterns:["mistral-large-2411","mistral-large-latest","mistral-large-2512","mistral-medium-2505","mistral-medium-2508","mistral-small-2506","mistral-nemo","devstral","ministral","codestral","pixtral","voxtral"],efforts:!1,input:["text","image"],note:"Mistral \u975E\u63A8\u7406\u7EBF\uFF082026-10 \u65B0\u589E\u6761\u76EE\uFF09\uFF1Alarge-2411/2512/latest\u3001medium-2505/2508\u3001small-2506\u3001nemo \u53CA devstral/ministral/codestral/pixtral/voxtral \u7B49\u4E13\u7528\u7EBF\u5747\u4E0D\u63A5\u53D7 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\u3002\u591A\u6570\u73B0\u5F79\u6B3E\u5E26\u89C6\u89C9\uFF08large-2411 \u4E3A\u7EAF\u6587\u672C\uFF09\u3002"},{id:"qwen-vision",patterns:["qwen-vl","qwen2-vl","qwen2-5-vl","qwen3-vl","qvq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text","image"],contextWindow:131072,maxTokens:8192,note:"\u901A\u4E49\u89C6\u89C9\u7EBF\uFF08Qwen-VL/QvQ\uFF09\uFF1Aenable_thinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002qwen3-vl \u5BB9\u91CF\u66F4\u5927\uFF0C\u6309\u9700\u4E0A\u8C03\u3002"},{id:"qwen-3-8",patterns:["qwen3.8"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,note:"Qwen 3.8 \u7CFB\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\u95ED\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08qwen3.8-max \u56FE\u50CF/\u89C6\u9891\u7406\u89E3\uFF0C\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u30021M \u6863\u4E0A\u4E0B\u6587\u300227B \u4E0E Flash-Next \u5F00\u6E90\u6B3E\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"qwen-3-8-27b",patterns:["qwen3.8-27b"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-27B\uFF08dense\uFF0C2026-08-14 \u5F00\u6E90\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\uFF1B\u539F\u751F\u56FE\u50CF+\u89C6\u9891\u7406\u89E3\uFF08\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u5B98\u65B9\u58F0\u660E\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF Qwen/Qwen3.8-27B \u6A21\u578B\u5361\u3002"},{id:"qwen-3-8-flash-next",patterns:["qwen3.8-flash-next"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-Flash-Next\uFF08125B-A6B \u5B9E\u9A8C\u67B6\u6784\uFF0CQwen4 \u524D\u8EAB\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low + enable_thinking \u5F00\u5173\uFF1B\u539F\u751F\u89C6\u89C9\uFF08Vision Encoder\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF \u6A21\u578B\u5361\u4E0E qwen.ai \u5B98\u65B9\u535A\u5BA2\u3002"},{id:"qwen",patterns:["qwen","qwq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text"],contextWindow:1e6,maxTokens:65536,note:"\u901A\u4E49\u5343\u95EE\uFF1Aenable_thinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1B\u73B0\u5F79\u65D7\u8230\u4E3A qwen3.8 \u7CFB\uFF081M \u6863\u4E0A\u4E0B\u6587\uFF0C\u89C1 qwen-3-8 \u6761\u76EE\uFF09\u30023.6/3.7 \u4EE3\u7684 Plus/Flash \u4EA6\u9ED8\u8BA4\u591A\u6A21\u6001\uFF08\u56FE\u7247/\u89C6\u9891\uFF09\uFF0C\u5982\u63A5\u5165\u8BF7\u6309\u9700\u52FE\u9009\u56FE\u7247\uFF1B\u89C6\u89C9\u7EBF\u89C1 qwen-vision \u6761\u76EE\u3002"},{id:"glm-vision",patterns:["glm-4v","glm-4-6v","glm-4-5v","glm-5v"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text","image"],contextWindow:131072,maxTokens:32768,note:"\u667A\u8C31\u89C6\u89C9\u7EBF\uFF08GLM-4V/4.5V/4.6V/5V\uFF09\uFF1Athinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF08\u4F20 disabled \u62A5\u9519\uFF0C\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002"},{id:"glm-5-3-flash",patterns:["glm-5.3-flash","glm-5.3-flashx"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3-Flash\uFF08320B\uFF0C\u5B98\u65B9\u6587\u6863 vlm \u5206\u7C7B\uFF09\uFF1A\u5F3A\u5236\u601D\u8003\uFF08thinking.type \u4EC5 enabled\uFF0C\u4E0D\u652F\u6301\u5173\u95ED\uFF09\uFF0C\u6587\u672C\u53C2\u6570\u4E0E GLM-5.3 \u4E00\u81F4\u2014\u2014\u6863\u4F4D Low / High / Max\u3002\u8F93\u5165\u6A21\u6001\uFF1A\u89C6\u9891\u3001\u56FE\u50CF\u3001\u6587\u672C\u3001\u6587\u4EF6\uFF08\u89C6\u9891/\u6587\u4EF6\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF0C\u56FE\u7247\u53EF\u52FE\uFF09\u3002\u5B98\u65B9 1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3002\u6765\u6E90\uFF1Adocs.bigmodel.cn \u6A21\u578B\u9875\u3002"},{id:"glm-5-3",patterns:["glm-5.3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3 \u6863\u4F4D\uFF1ALow / High / Max\uFF08\u5F3A\u5236\u601D\u8003\uFF0C\u5176\u4F59\u503C\u62A5\u9519\uFF09\u3002\u5B98\u65B9\u5BB9\u91CF 1M / 128K\u3002"},{id:"glm-5-2",patterns:["glm-5.2"],efforts:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.2 \u6863\u4F4D\uFF1ANone / Minimal / Low / Medium / High / XHigh / Max\uFF08\u5B98\u65B9\u6620\u5C04\uFF1ALow\xB7Medium\u2192High\u3001XHigh\u2192Max\u3001None\xB7Minimal=\u505C\u6B62\u601D\u8003\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"glm",patterns:["glm","zhipu","chatglm"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text"],note:"GLM \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1Beffort \u9636\u68AF\u4EC5 GLM-5.2+ \u652F\u6301\uFF08\u89C1\u4E0A\u4E24\u6761\u76EE\uFF09\u3002\u6CE8\u610F GLM-4.7/GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF0C\u4F20 disabled \u4F1A\u62A5\u9519\uFF08\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"kimi-k3",patterns:["kimi-k3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,note:"Kimi K3 \u6863\u4F4D\uFF1ALow / High / Max(\u9ED8\u8BA4 Max)\uFF0C\u8D70\u9876\u5C42 reasoning_effort\uFF1B\u59CB\u7EC8\u63A8\u7406\u3001\u52FF\u4F20 thinking \u5BF9\u8C61\u3002\u539F\u751F\u89C6\u89C9\u7406\u89E3\uFF0C1M \u4E0A\u4E0B\u6587\uFF08\u6700\u5927\u8F93\u51FA\u5B98\u65B9\u672A\u5355\u72EC\u5217\uFF0C\u4E0D\u63D0\u4F9B\uFF09\u3002"},{id:"kimi-k2-vision",patterns:["kimi-k2.6","kimi-k2.5"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.5/K2.6 \u89C6\u89C9\u4EE3\uFF1Athinking.type \u5F00\u5173\uFF08\u9ED8\u8BA4\u5F00\u3001\u53EF\u5173\uFF09\uFF0C\u5F00=High\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002K2.7 Code \u59CB\u7EC8\u601D\u8003\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"kimi-k27-code",patterns:["kimi-k2.7"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.7 Code\uFF08\u542B\u9AD8\u901F\u7248\uFF09\uFF1A\u59CB\u7EC8\u601D\u8003\u2014\u2014thinking.type \u4EC5\u63A5\u53D7 enabled\uFF08\u4F20 disabled \u62A5\u9519\uFF09\uFF0C\u65E0 Off \u6863\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002"},{id:"kimi-for-coding",patterns:["kimi-for-coding"],efforts:{low:"low",high:"high",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1048576,maxTokens:32768,note:"Kimi for Coding\uFF1AMoonshot \u7F16\u7801\u4E13\u7EBF\u8D70 anthropic-messages \u534F\u8BAE\u3001\u81EA\u9002\u5E94\u601D\u8003\uFF0C\u6863\u4F4D Low / High / Max\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C1M \u4E0A\u4E0B\u6587 / 32,768 \u8F93\u51FA\u3002\u9AD8\u901F\u7248\uFF08-highspeed\uFF09\u65E0 effort \u63A7\u4EF6\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"kimi-moonshot-v1-vision",patterns:["moonshot-v1-8k-vision","moonshot-v1-32k-vision","moonshot-v1-128k-vision"],efforts:!1,input:["text","image"],note:"Moonshot V1 \u89C6\u89C9\u65E7\u4EE3\uFF088k/32k/128k \u5404\u4E00\uFF09\uFF1A\u65E0\u601D\u8003\u63A7\u4EF6\uFF08\u751F\u6210\u6A21\u578B\uFF09\u3001\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF1B\u8BE5\u7EBF\u5DF2\u505C\u6B62\u5BF9\u65B0\u7528\u6237\u5F00\u653E\uFF082026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF09\u3002"},{id:"kimi",patterns:["kimi","moonshot"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text"],contextWindow:262144,note:"Kimi \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3002k2 \u7CFB\u5217 2026-05-25 \u4E0B\u7EBF\u3001kimi-latest 2026-01-28 \u4E0B\u7EBF\u3001moonshot-v1 \u7CFB 2026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF08\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1Bmoonshot-v1 \u672C\u8EAB\u975E\u601D\u8003\u6A21\u578B\uFF09\u3002\u89C6\u89C9\u4EE3\u4E0E K2.7 Code \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"hunyuan-hy3",patterns:["hy3"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u6DF7\u5143 hy3\uFF1A\u5F00\u6E90\u5951\u7EA6\u7ECF chat_template_kwargs.reasoning_effort = no_think(\u9ED8\u8BA4)/low/high\uFF1B\u5B98\u65B9\u6A21\u578B\u5361 256K \u4E0A\u4E0B\u6587\uFF08295B MoE\uFF0C2026 \u5F00\u6E90\uFF09\u3002"},{id:"hunyuan-hy4",patterns:["hy4-preview","hy-4-preview"],efforts:{off:"no_think",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},contextWindow:1e6,note:"\u6DF7\u5143 Hy4 preview\uFF1A\u5B98\u65B9 README\u2014\u2014reasoning \u9ED8\u8BA4 high\uFF08\u6DF1\u5EA6\u601D\u8003\uFF09\uFF0C\u5173\u95ED\u7ECF chat_template_kwargs.reasoning_effort=no_think\uFF1B\u5B98\u65B9\u89C4\u683C\u8868 1M \u4E0A\u4E0B\u6587\uFF08770B-A49B MoE\uFF0CGated DSA\uFF09\u3002low \u6863\u5B98\u65B9\u672A\u5217\uFF0C\u5982\u6709\u8BF7\u624B\u8C03\uFF1B\u89C6\u89C9\u672A\u58F0\u660E\uFF0C\u6309\u9700\u624B\u52FE\u3002\u6765\u6E90\uFF1ATencent-Hunyuan/Hy4-preview \u5B98\u65B9 README\u3002"},{id:"step-5-preview",patterns:["step-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,maxTokens:65536,note:'\u9636\u8DC3 Step-5-Preview\uFF08\u5B98\u65B9 id \u5373 step-5-preview\uFF0C\u65E0\u88F8 step-5\uFF1Bpattern \u53D6\u5BB6\u65CF\u4E3B\u5E72\u4EE5\u517C\u5BB9\u7F51\u5173\u5199\u6CD5\uFF09\uFF1A\u6863\u4F4D Low / Medium(\u5B98\u65B9\u6807"\u9ED8\u8BA4\u63A8\u8350") / High\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u539F\u751F\u56FE\u7247 + \u89C6\u9891\u8F93\u5165\uFF1B1M \u4E0A\u4E0B\u6587\u300164K \u6700\u5927\u8F93\u51FA\uFF08\u5B98\u65B9\u53E6\u6CE8 max_tokens \u9ED8\u8BA4 INF\u3001\u4E0E 64K \u4E0A\u9650\u5E76\u5B58\uFF0C\u4EE5\u7AEF\u70B9\u5B9E\u6D4B\u4E3A\u51C6\uFF09\u3002'},{id:"step-3-7",patterns:["step-3.7","step-3.6"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.6/3.7 \u6863\u4F4D\uFF1ALow / Medium(\u9ED8\u8BA4\u63A8\u8350) / High\uFF0C\u539F\u751F\u56FE\u7247+\u89C6\u9891\u7406\u89E3\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step-3-5",patterns:["step-3.5"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.5 Flash \u6863\u4F4D\uFF1ALow / High\uFF08\u7EAF\u6587\u672C\u63A8\u7406\u65D7\u8230\uFF09\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step",patterns:["step-3","step-2"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"\u9636\u8DC3 Step \u6863\u4F4D\uFF1ALow / Medium / High\uFF08\u9ED8\u8BA4 Medium\uFF0C\u4E0D\u53EF\u5173\u95ED\uFF09\u30023.6/3.7 \u89C6\u89C9\u4EE3\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"doubao",patterns:["doubao","seed"],efforts:{off:null,low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"\u8C46\u5305\u6863\u4F4D\uFF1AOff / Low / Medium / High\u2014\u2014effort \u9636\u68AF\u4ECD\u662F\u793E\u533A\u8BC1\u636E\u3001\u5B98\u65B9 Ark \u6587\u6863\u660E\u5217\u7684\u4E3A thinking.type \u5F00\u5173\uFF082026-08-24 \u590D\u6838\u4ECD\u672A\u89C1\u5230 effort \u5B98\u65B9\u660E\u6587\uFF09\u3002seed \u4EE3\u6536\u56FE\uFF081.5-pro \u4F8B\u5916\uFF09\u3002"},{id:"minimax-m2",patterns:["minimax-m2"],efforts:!1,input:["text"],contextWindow:204800,maxTokens:131072,note:"MiniMax-M2 / M2.5\uFF08\u542B -highspeed\uFF09\uFF1A\u65E0\u601D\u8003\u63A7\u4EF6\u3001\u65E0 effort \u53C2\u6570\uFF08M3 \u624D\u5F15\u5165 thinking \u53C2\u6570\uFF09\uFF0C\u7EAF\u6587\u672C\uFF0C204,800 / 131,072\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1BM3 \u89C1\u4E0B\u6761\uFF09\u3002"},{id:"minimax-m3",patterns:["minimax-m3"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:1048576,maxTokens:512e3,note:"MiniMax-M3\uFF1A\u5B98\u65B9 thinking \u53C2\u6570 enabled/adaptive/disabled\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3001\u5173=disabled\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08\u56FE/\u89C6\u9891\uFF0C\u6838\u5FC3\u8BCD\u8868\u4EC5\u542B\u56FE\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 512,000 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u8865\u5BB9\u91CF\uFF09\u3002"},{id:"mimo-v2-6",patterns:["mimo-v2.6","mimo-v2.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.6 \u7CFB\u5217\uFF08mimo-v2.6-pro / -flash / -pro-ultraspeed\uFF1B1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3001\u539F\u751F\u5168\u6A21\u6001\uFF09\u4E0E\u5176\u524D\u4EE3 mimo-v2.5\u3002\u5B98\u65B9\u6587\u6863\uFF1Athinking.type\uFF08enabled/disabled\uFF0C\u9ED8\u8BA4 enabled\uFF09+ reasoning.effort\uFF08none \u5173\u95ED\uFF1B\u5176\u4F59\u5408\u6CD5\u503C\u5747\u5F00\u542F\uFF0C\u4E14**\u73B0\u9636\u6BB5\u6682\u672A\u533A\u5206\u63A8\u7406\u5F3A\u5EA6**\u2014\u2014minimal \u5F52\u4E00\u4E3A low\u3001xhigh/max/ultra \u5F52\u4E00\u4E3A high\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u58F0\u660E\u7684\u662F\u7AEF\u70B9**\u63A5\u53D7**\u7684\u6863\u4F4D Off / Low / Medium / High\uFF08xhigh\u3001max \u4E0D\u58F0\u660E\uFF0C\u7AEF\u70B9\u53EA\u4F1A\u6298\u53E0\u4E3A high\uFF09\u3002\u601D\u8003\u6A21\u5F0F\u4E0B temperature / top_p \u4E0D\u53EF\u81EA\u5B9A\u4E49\uFF08\u5F3A\u5236 1.0 / 0.95\uFF09\uFF1B\u5E26\u5DE5\u5177\u8C03\u7528\u7684\u5386\u53F2\u8F6E\u5FC5\u987B\u5B8C\u6574\u56DE\u4F20 reasoning_content\uFF0C\u5426\u5219 400\u3002mimo-v2.5 \u4E0E v2.5-pro \u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"mimo-v2-5-pro",patterns:["mimo-v2.5-pro"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.5-Pro\uFF1A\u8BE5\u5BB6\u65CF\u552F\u4E00\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF08\u5B98\u65B9\u80FD\u529B\u8868\u672A\u5217\u5168\u6A21\u6001\u7406\u89E3\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\uFF0C\u63A8\u7406\u5951\u7EA6\u4E0E v2.6 \u7CFB\u5217\u76F8\u540C\uFF08thinking.type + reasoning.effort\uFF0Cnone \u5173\u95ED\u3001\u5176\u4F59\u6863\u4F4D\u6682\u4E0D\u533A\u5206\u5F3A\u5EA6\uFF09\u3002\u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"baidu-ernie",patterns:["ernie"],efforts:!1,input:["text"],contextWindow:131072,note:"\u767E\u5EA6\u5343\u5E06 ERNIE \u7CFB\uFF1A\u5B98\u65B9 OpenAI \u517C\u5BB9\u63A5\u53E3\u65E0 reasoning_effort \u53C2\u6570\u2014\u2014\u601D\u8003\u7531\u6A21\u578B\u53D8\u4F53\u51B3\u5B9A\uFF08-Thinking \u7CFB\u5217\u59CB\u7EC8\u601D\u8003\u3001\u666E\u901A\u7CFB\u5217\u4E0D\u601D\u8003\uFF09\uFF0C\u52FF\u52FE\u601D\u8003\u6863\u3002ERNIE 4.5 Turbo VL \u652F\u6301\u56FE\u7247\uFF0C\u6309\u9700\u624B\u52FE\uFF1B\u53C2\u8003\u5BB9\u91CF\u53D6 Turbo 128K \u6863\u3002"},{id:"fireworks-ember",patterns:["ember-1"],efforts:{off:"none",low:"low",medium:"medium",high:"high",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"Fireworks ember-1\uFF1Aanthropic-messages \u534F\u8BAE\u81EA\u9002\u5E94\u601D\u8003\uFF0C\u6863\u4F4D None(\u5173) / Low / Medium / High / Max\uFF08off \u663E\u5F0F none \u62FC\u5199\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C1M \u4E0A\u4E0B\u6587 / 131,072 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"thinkingmachines-inkling",patterns:["inkling"],efforts:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:524288,maxTokens:131072,note:"Thinking Machines Inkling\uFF1A\u5168\u6863 Minimal / Low / Medium(\u9ED8\u8BA4) / High / XHigh / Max\uFF0Coff \u663E\u5F0F none\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C512K \u4E0A\u4E0B\u6587 / 131,072 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1Btogether \u4E2D\u7EE7\u4FA7 effort \u53C2\u6570\u672A\u5F00\u653E\uFF0C\u9700\u652F\u6301\u65B9\u8F6C\u53D1\uFF09\u3002"},{id:"antling-ring",patterns:["ring-2.6"],efforts:{high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,maxTokens:65536,note:"\u8682\u8681 Ling Ring-2.6-1T\uFF1A\u6863\u4F4D High / XHigh\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B262,144 / 65,536\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"antling-ling",patterns:["ling-2.6"],efforts:!1,input:["text"],note:"\u8682\u8681 Ling-2.6\uFF08\u542B -flash\uFF09\uFF1A\u975E\u601D\u8003\u6A21\u578B\uFF0C\u65E0 effort \u63A7\u4EF6\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1BRing-2.6 \u601D\u8003\u7EBF\u89C1\u4E0A\u6761\uFF09\u3002"}],ko={off:null,low:"low",medium:"medium",high:"high"},Xc={"openai-completions":ko,"openai-responses":ko,"anthropic-messages":ko,deepseek:{off:"none",low:"low",high:"high",max:"max"}},Jc={low:"low",medium:"medium",high:"high"};function nn(e){return(e??"").toLowerCase().trim()}function ka(e){return e!==void 0&&/[a-z0-9]/.test(e)}function tn(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g," ")}function La(e,t,n){let r=t===0?void 0:e[t-1],o=e[t+n];return!ka(r)&&!ka(o)}function To(e,t){let n=tn(e)+" "+tn(t??""),r;for(let o of Yc)for(let i of o.patterns){let a=tn(i),s=n.indexOf(a);for(;s>=0;){if(La(n,s,a.length)){(r===void 0||a.length>r.length)&&(r={entry:o,length:a.length});break}s=n.indexOf(a,s+1)}}return r?.entry}var Qc={"deepseek.com":"deepseek","anthropic.com":"anthropic-messages"};function Zc(e){let t=nn(e.api);if(t.length>0)return t;let n=e.baseURL;if(n!==void 0&&n.length>0)try{let o=new URL(n).hostname.toLowerCase().split(".");if(o.length>=2){let i=Qc[o.slice(-2).join(".")];if(i!==void 0)return i}}catch{}return"openai-completions"}var Vn="openai-completions",Sa="anthropic-messages";function Eo(e){if(e===void 0||e.length===0)return!1;let t="";try{t=new URL(e).hostname.toLowerCase()}catch{return!1}return t==="localhost"||t==="::1"||t.endsWith(".local")||t.endsWith(".internal")||/^(127\.|10\.|192\.168\.)/.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t)?!0:t.includes(":")}function eu(e,t){let n=nn(t),r={...e};if(delete r.supportsMidConvoEffort,delete r.allowedFallbackModels,n===Sa){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"])delete r[o];return r.forceAdaptiveThinking===void 0?void 0:{forceAdaptiveThinking:r.forceAdaptiveThinking}}if(n===Vn)return delete r.forceAdaptiveThinking,Object.keys(r).length===0?void 0:r}function tu(e,t){let n=nn(t.api);if(n===Vn){let r=e.compat;return r!==void 0&&(r=eu(r,n)??void 0),r===void 0&&!Eo(t.baseURL)?void 0:r===void 0?{thinkingTokenBudgetField:"thinking_token_budget"}:r.thinkingTokenBudgetField===void 0&&r.supportsThinkingTokenBudget!==!0&&Eo(t.baseURL)?{...r,thinkingTokenBudgetField:"thinking_token_budget"}:r}if(n===Sa&&e.anthropicAdaptive===!0)return{forceAdaptiveThinking:!0}}var nu=["openai.com","openai.azure.com","deepseek.com","openrouter.ai","z.ai","bigmodel.cn","moonshot.ai","moonshot.cn","aliyuncs.com","anthropic.com","x.ai","together.ai","together.xyz","nvidia.com","cerebras.ai","cloudflare.com","chutes.ai","opencode.ai","ant-ling.com"];function Mo(e){if(nn(e.api)!==Vn)return!1;let t=e.baseURL;if(t===void 0||t.length===0)return!1;try{let n=new URL(t).hostname.toLowerCase();return n.includes(".")?!nu.some(r=>n===r||n.endsWith("."+r)):!1}catch{return!1}}function Ea(e,t,n){return e===void 0||!n||e.supportsDeveloperRole!==void 0||!Mo(t)?e:{...e,supportsDeveloperRole:!1}}var Ta={off:null,low:"low",medium:"medium",high:"high"},ru=["vl","vision","omni","4o","pixtral","internvl"];function Lo(e){let t=tn(e);for(let n of ru){let r=tn(n),o=t.indexOf(r);for(;o>=0;){if(La(t,o,r.length))return["text","image"];o=t.indexOf(r,o+1)}}}function ou(e){if(e===void 0)return;let t=e.map(n=>n.toLowerCase());if(t.some(n=>Vc.includes(n)))return t.includes("image")?["text","image"]:["text"]}function Fe(e,t,n){let r=To(e,t.displayName),o,i,a,s;r?.input!==void 0&&(o=r.input,i="knowledge"),r?.contextWindow!==void 0&&(a=r.contextWindow),r?.maxTokens!==void 0&&(s=r.maxTokens);let d=ou(n?.input);if(d!==void 0&&(o=d,i="endpoint"),n?.contextLength!==void 0&&Number.isFinite(n.contextLength)&&n.contextLength>0&&(a=n.contextLength),o===void 0){let b=Lo(e);b!==void 0&&(o=b,i="heuristic")}let l={...o===void 0?{}:{input:o},...i===void 0?{}:{inputSource:i},...a===void 0?{}:{contextWindow:a},...s===void 0?{}:{maxTokens:s}},u=n===void 0?{}:{endpoint:{reasoning:n.reasoning,source:n.source}};if(n?.reasoning===!1)return{efforts:!1,matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"high",...u,...l};if(r!==void 0){let b=Ea(tu(r,t),t,r.efforts!==!1);return{efforts:r.efforts,...r.efforts!==!1&&r.defaultEffort!==void 0&&r.efforts[r.defaultEffort]!==void 0?{defaultEffort:r.defaultEffort}:{},...b===void 0?{}:{compat:b},matched:!0,entryId:r.id,source:r.id,confidence:"high",...u,...l}}let h=Zc(t),f=Xc[h]??Jc,c=nn(t.api)===Vn?{thinkingFormat:"openai",supportsReasoningEffort:!0}:void 0,p=c!==void 0&&Eo(t.baseURL)?{...c,thinkingTokenBudgetField:"thinking_token_budget"}:c,m=Ea(p,t,!0);return n?.reasoning===!0?{efforts:{...Ta},...Ta.medium!==void 0?{defaultEffort:"medium"}:{},...m===void 0?{}:{compat:m},matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"medium",...u,...l}:{efforts:f,...f.medium!==void 0?{defaultEffort:"medium"}:{},...m===void 0?{}:{compat:m},matched:!1,source:"protocol:"+h,confidence:"low",...u,...l}}var Ha="dsh-model-think-level.slider.efforts",So="breSelectWired";function Ao(e){return typeof e=="object"&&e!==null&&e.ok===!1}function Ho(e){if(!Ao(e))return;let t=e.error,n=typeof t?.code=="string"?t.code:"settings/rejected",r=typeof t?.message=="string"?t.message:"";return r.length>0?`${n}: ${r}`:n}function bt(e,t){return`${e}/${t}`}function Ra(){try{let e=window.localStorage.getItem(Ha);if(e===null)return{};let t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t))r.length>0&&typeof o=="string"&&o.trim().length>0&&(n[r]=o);return n}catch{return{}}}function iu(e){try{window.localStorage.setItem(Ha,JSON.stringify(e))}catch{}}function au(e,t,n){let r=Ra();r[bt(e,t)]=n,iu(r)}function su(e,t){return Ra()[bt(e,t)]}function Yn(e,t,n){let o=e.groups.find(i=>i.id===t)?.models.find(i=>i.id===n)?.reasoning?.efforts;return o===void 0?[]:o.map(i=>i.id)}function du(e,t,n){return e.groups.find(o=>o.id===t)?.models.find(o=>o.id===n)?.reasoning?.defaultEffort}function lu(e){if(!(e.length<2))return e[Math.floor((e.length-1)/2)]}function cu(e,t){return e===null||e.provider!==t.provider||e.model!==t.model}async function Aa(e,t,n,r,o){let i=Yn(e,t,n);if(i.length===0)return;let a=bt(t,n),s=r.get(a);if(s!==void 0&&i.includes(s))return s;let d=await o?.configuredEffort?.(t,n);if(d!==void 0&&i.includes(d))return d;let l=su(t,n);if(l!==void 0&&i.includes(l))return l;let u=Fe(n,{}).defaultEffort;if(u!==void 0&&i.includes(u))return u;let h=du(e,t,n);return h!==void 0&&i.includes(h)?h:lu(i)}function Oa(e,t){let n=e;if(n[So]===!0)return()=>{};let r=Object.prototype.hasOwnProperty.call(n,"select"),o=e.select,i=new Map,a=new Set,s=new Map,d=3,l=0,u=async c=>{let p=++l;if(c.reasoningEffort!==void 0){let v=await o.call(e,c);return!Ao(v)&&Pe()&&(i.set(bt(c.provider,c.model),c.reasoningEffort),au(c.provider,c.model,c.reasoningEffort)),v}let m=e.store.getSnapshot();if(!cu(m.current,c)){if(Pe()){let v=bt(c.provider,c.model);i.delete(v),a.add(v)}return o.call(e,c)}if(!Pe())return o.call(e,c);let b=await Aa(m,c.provider,c.model,i,t),M=e.store.getSnapshot();if(!(l!==p||((v,D)=>v===null||D===null?v!==D:v.provider!==D.provider||v.model!==D.model||v.reasoningEffort!==D.reasoningEffort)(M.current,m.current)))return!Pe()||b===void 0||!Yn(M,c.provider,c.model).includes(b)?o.call(e,c):o.call(e,{...c,reasoningEffort:b})},h=()=>{let c=e.store.getSnapshot(),p=c.current;if(p===null||p.reasoningEffort!==void 0||!Pe())return;let m=bt(p.provider,p.model);if(a.has(m))return;if(Yn(c,p.provider,p.model).length===0){a.add(m);return}a.add(m);let b=l;Aa(c,p.provider,p.model,i,t).then(async M=>{if(M===void 0){a.delete(m);return}if(!Pe()){a.delete(m);return}let E=e.store.getSnapshot(),v=E.current;if(l!==b||v===null||v.reasoningEffort!==void 0||bt(v.provider,v.model)!==m||!Yn(E,v.provider,v.model).includes(M))return;let D=await o.call(e,{provider:v.provider,model:v.model,reasoningEffort:M});if(Ao(D))throw D}).catch(()=>{let M=(s.get(m)??0)+1;s.set(m,M),M<d&&(a.delete(m),h())})},f=e.store.subscribe(h);return h(),n[So]=!0,e.select=u,()=>{delete n[So],f(),r?e.select=o:delete n.select}}var F=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Ca(e){let t=e.toLowerCase();return t.includes("compat")||t.includes("thinkingtokenbudget")||t.includes("vllmpriority")||t.includes("supportsmaxoutput")}function Xn(e,t){if(!F(e))return[];let n=e[t];return!F(n)||!Array.isArray(n.models)?[]:n.models.filter(F)}function yt(e,t){if(!F(e))return{};let n=e[t];if(!F(n))return{};let r=typeof n.api=="string"?n.api:void 0,o=typeof n.baseURL=="string"?n.baseURL:void 0,i=typeof n.displayName=="string"?n.displayName:void 0;return{api:r,baseURL:o,displayName:i}}var it=(e,t)=>typeof e[t]=="boolean";function uu(e,t){if(Array.isArray(e)){for(let n of e)if(F(n)&&n.id===t)return n}}function fu(e){if(!F(e))return{reasoning:"unknown",source:null};let t=e.supported_features;if(Array.isArray(t)&&t.includes("reasoning"))return{...Me(e),reasoning:!0,source:"supported_features"};let n=e.supported_parameters;if(Array.isArray(n)&&(n.includes("reasoning")||n.includes("include_reasoning")||n.includes("reasoning_effort")))return{...Me(e),reasoning:!0,source:"supported_parameters"};if(it(e,"supports_reasoning"))return{...Me(e),reasoning:e.supports_reasoning,source:"supports_reasoning"};if(it(e,"supportsReasoning"))return{...Me(e),reasoning:e.supportsReasoning,source:"supportsReasoning"};if(it(e,"can_reason"))return{...Me(e),reasoning:e.can_reason,source:"can_reason"};if(it(e,"reasoning"))return{...Me(e),reasoning:e.reasoning,source:"reasoning"};let r=e.reasoning_effort;if(r!=null&&!(typeof r=="string"&&r.trim().length===0)||e.supports_reasoning_effort===!0)return{...Me(e),reasoning:!0,source:"reasoning_effort"};let o=F(e.capabilities)?e.capabilities:void 0;if(o!==void 0){let i=o.thinking,a=F(i)&&typeof i.supported=="boolean"?i.supported:void 0,s=o.effort,d=F(s)&&typeof s.supported=="boolean"?s.supported:void 0;if(d===!0)return{...Me(e),reasoning:!0,source:"capabilities.effort.supported"};if(a===!0)return{...Me(e),reasoning:!0,source:"capabilities.thinking.supported"};if(a===!1)return{...Me(e),reasoning:!1,source:"capabilities.thinking.supported"};if(d===!1)return{...Me(e),reasoning:!1,source:"capabilities.effort.supported"}}return{...Me(e),reasoning:"unknown",source:null}}function Me(e){let t={},n=a=>{if(!Array.isArray(a))return;let s=a.filter(d=>typeof d=="string");return s.length>0?s.map(d=>d.toLowerCase()):[]},r=F(e.architecture)?e.architecture:void 0,o=n(r?.input_modalities);if(o===void 0&&(o=n(e.input_modalities)),o===void 0){let a=F(e.modalities)?e.modalities:void 0;o=n(a?.input)}if(o===void 0){let a=e.capabilities,s=d=>Array.isArray(d)&&d.some(l=>typeof l=="string"&&l.toLowerCase()==="vision");if(s(e.supported_features)||s(a))o=["image"];else if(F(a)){let d=[];for(let l of["image_input","video_input","pdf_input","file_input"]){let u=F(a[l])?a[l]:void 0;if(u===void 0||typeof u.supported!="boolean")continue;let h=l.replace(/_input$/,"");u.supported===!0?d.push(h):d.length===0&&d.push("text")}d.length>0&&(o=d)}}o===void 0&&(it(e,"supports_vision")?o=e.supports_vision===!0?["image"]:[]:it(e,"supportsVision")?o=e.supportsVision===!0?["image"]:[]:(it(e,"supports_images")||it(e,"supportsImages"))&&(o=e.supports_images===!0||e.supportsImages===!0?["image"]:[])),o!==void 0&&(t.input=o.length===0?["text"]:o);let i=e.context_length;if(typeof i=="number"&&Number.isFinite(i)&&i>0)t.contextLength=i;else{let s=(F(e.top_provider)?e.top_provider:void 0)?.context_length;if(typeof s=="number"&&Number.isFinite(s)&&s>0)t.contextLength=s;else{let d=e.max_input_tokens;if(typeof d=="number"&&Number.isFinite(d)&&d>0)t.contextLength=d;else{let u=(F(e.limit)?e.limit:void 0)?.context;typeof u=="number"&&Number.isFinite(u)&&u>0&&(t.contextLength=u)}}}return t}function Da(e,t){let n=uu(e,t);return n===void 0?{found:!1,signal:{reasoning:"unknown",source:null}}:{found:!0,signal:fu(n)}}function ye(e){let n=e?.value?.providers;return typeof n!="object"||n===null||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="object"&&r!==null&&!Array.isArray(r)))}function Jn(e){if(!F(e))return;let t=e.providers;return F(t)?t:void 0}function Pa(e,t){for(let n of[e?.user,e?.base]){let r=Jn(n)?.[t];if(F(r)&&r.models!==void 0)return r.models}}function Ro(e){return Jn(e?.user)}function Qn(e,t){let n=e.find(o=>o.id===t);if(n===void 0)return;let r=n.reasoningEfforts;if(r===!1)return!1;if(typeof r=="object"&&r!==null&&!Array.isArray(r))return r}function Zn(e,t){let r=e.find(i=>i.id===t)?.input;if(!Array.isArray(r))return;let o=r.filter(i=>typeof i=="string");return o.length>0?o:void 0}function er(e,t){let r=e.find(o=>o.id===t)?.compat;if(F(r))return{...r}}function tr(e,t){let r=e.find(o=>o.id===t)?.name;return typeof r=="string"&&r.length>0?r:void 0}function nr(e,t){let r=e.find(o=>o.id===t)?.[Rt];return typeof r=="string"&&r.length>0?r:void 0}async function pu(e,t){try{let n=await fetch(`${$i}?route=${encodeURIComponent(e)}`,{method:"GET"});if(!n.ok)return{reasoning:"unknown",source:null};let r=await n.json();return r?.ok?Da(r.data,t).signal:{reasoning:"unknown",source:null}}catch{return{reasoning:"unknown",source:null}}}function rr(e,t=()=>te(e),n,r,o,i){return{async suggest(a,s,d,l){let u=ye((await t()).namespace),h=yt(u,a),f={api:h.api??l?.api,baseURL:h.baseURL??l?.baseURL,displayName:d??h.displayName},c=u[a]===void 0?void 0:await pu(a,s),p=Fe(s,f,c);return p.efforts===void 0?{ok:!1,error:"no-suggestion"}:{ok:!0,suggestion:{efforts:p.efforts,...p.compat===void 0?{}:{compat:p.compat},...p.defaultEffort===void 0?{}:{defaultEffort:p.defaultEffort},...p.input===void 0?{}:{input:p.input},...p.inputSource===void 0?{}:{inputSource:p.inputSource},...p.contextWindow===void 0?{}:{contextWindow:p.contextWindow},...p.maxTokens===void 0?{}:{maxTokens:p.maxTokens},matched:p.matched,source:p.source,confidence:p.confidence,...p.endpoint===void 0?{}:{endpoint:p.endpoint}}}},commit(a,s,d){if(i?.()===!0){n?.(a,s,d.efforts,d.compat,d.input,d.defaultEffort);return}r?.(a,s,{efforts:d.efforts,...d.compat===void 0?{}:{compat:d.compat},...d.input===void 0?{}:{input:d.input},...d.defaultEffort===void 0?{}:{defaultEffort:d.defaultEffort}})},withdraw(a,s){o?.(a,s)},stageEfforts(a,s,d,l,u,h){n?.(a,s,d,l,u,h)},async writeEfforts(a,s,d,l,u,h){if(r!==void 0)return r(a,s,{efforts:d,...l===void 0?{}:{compat:l},...u===void 0?{}:{input:u},...h===void 0?{}:{defaultEffort:h}}),{ok:!0,staged:!0};let c=(await rn(e,a,[{modelId:s,efforts:d,...l===void 0?{}:{compat:l},...u===void 0?{}:{input:u},...h===void 0?{}:{defaultEffort:h}}],t))[0]??{ok:!1,error:"no-result"};return c.ok?{ok:!0}:c.modelNotFound===!0?{ok:!1,error:"model-not-found"}:{ok:!1,error:c.error??"conflict"}}}}async function rn(e,t,n,r=()=>te(e),o){if(n.length===0)return[];let i=!1;for(let a=0;a<3;a++)try{let s=a===0?await r():await te(e,{fresh:!0});if(s.namespace===void 0)return n.map(()=>({ok:!1,error:"no-namespace"}));let d=Pa(s.namespace,t);if(!Array.isArray(d))return n.map(()=>({ok:!1,modelNotFound:!0}));if(!d.every(F))return n.map(()=>({ok:!1,error:"invalid-models"}));let u=d.map(c=>c),h=[];for(let c of n){let p=u.findIndex(m=>m.id===c.modelId);if(p<0){h.push(c.modelId);continue}u[p]=mu(u[p],c,i?void 0:c.compat)}if(h.length>0)return n.map(c=>h.includes(c.modelId)?{ok:!1,modelNotFound:!0}:{ok:!1,error:"model-not-found"});if(o?.()===!0)return n.map(()=>({ok:!1,aborted:!0}));let f=await e.settings.mutate(be,[{op:"set",path:["providers",t,"models"],value:u}],s.namespace.revision);if(!f.ok){if(a===0&&f.error.code==="settings/conflict")continue;let c=f.error.code==="settings/rejected"&&Ca(f.error.message);if(!i&&c&&n.some(p=>p.compat!==void 0)){i=!0;continue}return n.map(()=>({ok:!1,error:f.error.message}))}return n.map(()=>({ok:!0}))}catch(s){return n.map(()=>({ok:!1,error:s instanceof Error?s.message:String(s)}))}return n.map(()=>({ok:!1,error:"conflict"}))}function mu(e,t,n){let r={...e},o=t.efforts!=="keep",i=t.efforts==="keep"?void 0:t.efforts;if(o)if(i===void 0)delete r.reasoningEfforts,r[Te]=!0;else if(delete r[Te],delete r[Ht],i===!1)r.reasoningEfforts=!1;else{r.reasoningEfforts={...i};let s={...F(e.compat)?e.compat:{},...n??{}};Object.keys(s).length>0&&(r.compat=s)}return t.input!==void 0&&(t.input===null?(delete r.input,r[Ye]=!0):(delete r[Ye],r.input=[...t.input])),t.defaultEffort!==void 0&&(t.defaultEffort===null?delete r[Rt]:r[Rt]=t.defaultEffort),r}function Oo(e,t){for(let n of[e?.user,e?.base]){let r=Jn(n)?.[t];if(!F(r))continue;let o=r.headers;if(o===void 0)continue;if(!F(o))return;let i={};for(let[a,s]of Object.entries(o))typeof s=="string"&&(i[a]=s);return i}}async function on(e,t,n){if(typeof t!="string"||t.length===0)return{ok:!1,error:"no-route"};let r=!1;for(let o=0;o<2;o+=1)try{let i=o===0?await te(e):await te(e,{fresh:!0});if(i.namespace===void 0)return{ok:!1,error:"no-namespace"};if(i.writable!==!0)return{ok:!1,error:"read-only"};if(!Le(i.namespace,t)){r=!0;continue}let a=await e.settings.mutate(be,[{op:"set",path:["providers",t,"headers"],value:{...n}}],i.namespace.revision);if(!a.ok){if(o===0&&a.error.code==="settings/conflict")continue;return{ok:!1,error:a.error.message}}return{ok:!0}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}return r?{ok:!1,error:"no-route"}:{ok:!1,error:"conflict"}}function Le(e,t){if(Object.prototype.hasOwnProperty.call(ye(e),t))return!0;for(let n of[e?.user,e?.base]){let r=Jn(n);if(r!==void 0&&Object.prototype.hasOwnProperty.call(r,t))return!0}return!1}async function te(e,t={}){let n=t.fresh===!0?void 0:hu(e);if(n!==void 0)return n;let r=await e.settings.describe();return r.ok?{namespace:r.value.namespaces.find(i=>i.ns===be),writable:r.value.writable}:{namespace:void 0,writable:!1}}function hu(e){let t=e.scope?.getSnapshot();if(!(t===void 0||t.status!=="ready")&&typeof t.revision=="number")return{namespace:{ns:be,schema:{},value:t.value,user:t.user,base:t.base,revision:t.revision,applies:"live",secrets:[]},writable:t.writable===!0}}var Co=new Map;function Ia(e){let t=Co,n=!1,r,o=0,i=new Set,a=()=>{for(let d of[...i])d()},s=()=>{if(n)return Promise.resolve();if(r!==void 0)return r;let d=o;return r=te(e,{fresh:!0}).then(l=>{if(d!==o||l.namespace===void 0)return;let u=new Map;for(let[h,f]of Object.entries(ye(l.namespace))){let c=new Map,p=Array.isArray(f.models)?f.models:[];for(let m of p){if(!F(m)||typeof m.id!="string"||!Array.isArray(m.input))continue;let b=m.input.filter(M=>typeof M=="string");b.length>0&&c.set(m.id,b)}c.size>0&&u.set(h,c)}t=u,n=!0,a()}).catch(()=>{}).finally(()=>{d===o&&(r=void 0)}),r};return{getSnapshot:()=>t,subscribe(d){return i.add(d),()=>{i.delete(d)}},load:s,invalidate(){o+=1,n=!1,r=void 0,i.size>0&&s()}}}function gu(e){if(e.current===null)return[];let r=e.groups.find(o=>o.id===e.current?.provider)?.models.find(o=>o.id===e.current?.model)?.reasoning?.efforts;return r!==void 0&&r.length>=2?r:[]}function bu(e){return e.current}function yu(e,t){let n=bu(t),r=e.findIndex(s=>s.id===n?.reasoningEffort);if(r>=0)return r;let i=t.groups.find(s=>s.id===n?.provider)?.models.find(s=>s.id===n?.model)?.reasoning?.defaultEffort,a=i===void 0?-1:e.findIndex(s=>s.id===i);return a>=0?a:Math.floor((e.length-1)/2)}function or(e){return e.models??[]}function at(e){let t=e;return t.name??t.label??t.title??e.id}function wu(){let[e,t]=(0,T.useState)(null),n=(0,T.useRef)(0);(0,T.useEffect)(()=>()=>{window.clearTimeout(n.current)},[]);let r=(0,T.useCallback)(()=>{window.clearTimeout(n.current),t(null)},[]),o=(0,T.useCallback)((i,a)=>{window.clearTimeout(n.current);let s=i.currentTarget;s.scrollWidth<=s.clientWidth+1||(n.current=window.setTimeout(()=>{t({target:s,text:a})},300))},[]);return{tip:e,onEnter:o,onLeave:r}}function vu({state:e}){if(typeof document>"u")return null;let t=e.target.getBoundingClientRect(),n=Math.max(12,Math.min(t.right,window.innerWidth-12));return(0,_a.createPortal)((0,T.createElement)("div",{className:"bre-tip",role:"tooltip",style:{top:Math.min(t.bottom+6,window.innerHeight-40),right:Math.max(12,window.innerWidth-n)}},e.text),document.body)}var Na=new Map;function xu(e,t){let n=t??e.input;if(Array.isArray(n)&&n.length>0)return n.includes("image");let r=JSON.stringify([e.id,e.name]),o=Na.get(r);if(o!==void 0)return o;let i=To(e.id,e.name)?.input,a=i!==void 0?i.includes("image"):(Lo(e.id)??[]).includes("image");return Na.set(r,a),a}function ku(e){let t=e.reasoning?.efforts;return Array.isArray(t)&&t.length>0}function Eu(e){return(0,T.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,T.createElement)("path",{d:"M1.8 8s2.4-4.2 6.2-4.2S14.2 8 14.2 8s-2.4 4.2-6.2 4.2S1.8 8 1.8 8z",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round"}),(0,T.createElement)("circle",{cx:8,cy:8,r:1.8,fill:"currentColor"}))}function Tu(e){return(0,T.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,T.createElement)("path",{d:"M8 1.9l1.35 3.75L13.1 7l-3.75 1.35L8 12.1 6.65 8.35 2.9 7l3.75-1.35z",fill:"currentColor"}))}var Mu=["#22c55e","#a3e635","#eab308","#f97316","#ef4444"],Fh=Mu.map(e=>[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]);function Lu(e,t,n){let r=[];return xu(e,n)&&r.push((0,T.createElement)("span",{key:"vision",className:"bre-tag",title:t("tagVision")},Eu(t("tagVision")))),ku(e)&&r.push((0,T.createElement)("span",{key:"thinking",className:"bre-tag",title:t("tagThinking")},Tu(t("tagThinking")))),r.length===0?null:(0,T.createElement)("span",{className:"bre-option-tags"},...r)}function Fa(e){let{directory:t,t:n,configuredInputs:r}=e,o=(0,T.useSyncExternalStore)(k=>t.store.subscribe(k),()=>t.store.getSnapshot()),i=(0,T.useSyncExternalStore)(k=>r?.subscribe(k)??(()=>{}),()=>r?.getSnapshot()??Co),a=gu(o),[s,d]=(0,T.useState)(""),[l,u]=(0,T.useState)(""),[h,f]=(0,T.useState)(null),[c,p]=(0,T.useState)(!1),[m,b]=(0,T.useState)(null),M=(0,T.useRef)(null),E=(0,T.useRef)(""),v=(0,T.useRef)(!1),D=o.current!==null&&a.length>=2,I=c||o.status==="selecting",P=m??o.error,Z=t.select;(0,T.useEffect)(()=>{if(v.current)return;let k=yu(a,o),_=a[k]?.id??"";E.current=_,d(_),b(null)},[D,a,o]),(0,T.useEffect)(()=>{t.load().catch(()=>{})},[t]),(0,T.useEffect)(()=>{r?.load().catch(()=>{})},[r]);let L=o.current,H=o.groups.find(k=>k.id===L?.provider),R=H?.models.find(k=>k.id===L?.model)?.name??(L===null?n("triggerFallback"):L.model),N=L===null?"":at(H??{id:L.provider}),K=a.find(k=>k.id===s)?.name??n("effortDefault"),W=(0,T.useSyncExternalStore)(Gn,ho),q=(0,T.useSyncExternalStore)(jn,ca),oe=(0,T.useSyncExternalStore)($n,ga),j=o.groups.filter(k=>or(k).length>0&&!q.includes(k.id)).map(k=>k.id),X=Dt(go(j),W),z=h!==null&&X.includes(h)?h:L!==null&&X.includes(L.provider)?L.provider:X[0]??null,ee=l.trim().toLowerCase(),G=ee!=="",ie=G?X.flatMap(k=>xo(or(o.groups.find(_=>_.id===k)),oe[k]??[]).filter(_=>(_.name??_.id).toLowerCase().includes(ee)||_.id.toLowerCase().includes(ee)).map(_=>({provider:k,choice:_}))):[],ae=G?ie:z===null?[]:xo(or(o.groups.find(k=>k.id===z)),oe[z]??[]).map(k=>({provider:z,choice:k})),pe=L===null?"":L.provider+"/"+L.model,x=(0,T.useCallback)(()=>{let k=M.current?.closest('[role="menu"], [role="group"]');k!=null&&(k.tabIndex=-1,k.focus({preventScroll:!0}))},[]),A=(0,T.useCallback)(async(k,_)=>{if(v.current)return;let V=t.store.getSnapshot().current;if(G&&u(""),!(V!==null&&V.provider===k&&V.model===_)){v.current=!0,x(),p(!0),b(null);try{let me=await Z({provider:k,model:_}),ke=Ho(me);if(ke!==void 0)throw new Error(ke)}catch(me){b(me instanceof Error?me.message:String(me))}finally{v.current=!1,p(!1)}}},[t,x,G,Z]),g=(0,T.useCallback)(async k=>{if(v.current||k===o.current?.reasoningEffort&&o.status!=="error")return;v.current=!0;let _=E.current;x(),p(!0),b(null),d(k);try{let V=o.current;if(V===null)throw new Error(n("sliderNoCurrent"));let me=await Z({provider:V.provider,model:V.model,reasoningEffort:k}),ke=Ho(me);if(ke!==void 0)throw new Error(ke);let At=t.store.getSnapshot(),In=a.find(Nn=>Nn.id===At.current?.reasoningEffort)?.id??k;E.current=In,d(In)}catch(V){E.current=_,d(_),b(V instanceof Error?V.message:String(V))}finally{v.current=!1,p(!1)}},[t,x,a,Z,o.current,o.status,n]),O=(0,T.useRef)(null),U=(0,T.useRef)(!1),[ne,J]=(0,T.useState)(null),le=Math.max(0,a.findIndex(k=>k.id===s)),ce=ne??le,tt=a.length>1?ce/(a.length-1)*100:0,$e=k=>{let _=O.current;if(_===null||a.length===0)return le;let V=_.getBoundingClientRect();if(V.width<=0)return le;let me=Math.min(1,Math.max(0,(k-V.left)/V.width));return Math.round(me*(a.length-1))},nt=k=>{if(!(I||!D)){if(k.preventDefault(),U.current=!0,typeof k.currentTarget.setPointerCapture=="function")try{k.currentTarget.setPointerCapture(k.pointerId)}catch{}J($e(k.clientX))}},Oe=k=>{!U.current||I||J($e(k.clientX))},Dn=k=>{if(!U.current)return;if(U.current=!1,typeof k.currentTarget.releasePointerCapture=="function"&&k.currentTarget.hasPointerCapture?.(k.pointerId)===!0)try{k.currentTarget.releasePointerCapture(k.pointerId)}catch{}let _=$e(k.clientX);J(null);let V=a[_];V!==void 0&&g(V.id)},oo=k=>{if(I||!D)return;let _;if(k.key==="ArrowRight"||k.key==="ArrowUp"?_=Math.min(a.length-1,ce+1):k.key==="ArrowLeft"||k.key==="ArrowDown"?_=Math.max(0,ce-1):k.key==="Home"?_=0:k.key==="End"&&(_=a.length-1),_===void 0)return;k.preventDefault();let V=a[_];V!==void 0&&g(V.id)},{tip:St,onEnter:mt,onLeave:Ce}=wu(),Ve=(0,T.createElement)("div",{className:"bre-menu-head"},(0,T.createElement)("span",{className:"bre-row-label"},n("modelRowLabel")),(0,T.createElement)("span",{className:"bre-menu-cur"},(0,T.createElement)("span",{className:"bre-menu-name","aria-label":L===null?R:N+" \xB7 "+R,onMouseEnter:k=>{mt(k,L===null?R:N+" \xB7 "+R)},onMouseLeave:Ce},R),N===""?null:(0,T.createElement)("span",{className:"bre-menu-prov"},N))),io=(0,T.createElement)("div",{className:"bre-menu-search"},(0,T.createElement)("div",{className:"bre-menu-search-box"},(0,T.createElement)("span",{className:"bre-menu-search-icon","aria-hidden":!0},(0,T.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,T.createElement)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,T.createElement)("path",{d:"M10.5 10.5L14 14",strokeLinecap:"round"}))),(0,T.createElement)("input",{type:"text",className:"bre-menu-search-input",role:"searchbox",placeholder:n("modelSearchPlaceholder"),"aria-label":n("modelSearchPlaceholder"),value:l,spellCheck:!1,autoComplete:"off",onChange:k=>{u(k.currentTarget.value)}}),l===""?null:(0,T.createElement)("button",{type:"button",className:"bre-menu-search-clear",title:n("modelSearchClear"),"aria-label":n("modelSearchClear"),onClick:()=>{u("")}},(0,T.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,T.createElement)("path",{d:"M4 4L12 12M12 4L4 12",strokeLinecap:"round"}))))),ao=(0,T.createElement)("div",{className:"bre-providers",role:"group","aria-label":n("modelRowLabel")},...X.map(k=>{let _=o.groups.find(V=>V.id===k);return(0,T.createElement)("button",{key:k,type:"button",className:"bre-provider"+(k===z?" is-open":"")+(k===L?.provider?" is-current":""),disabled:I,"aria-expanded":k===z,onMouseLeave:Ce,onClick:()=>{f(k),u("")}},(0,T.createElement)("span",{className:"bre-option-name","aria-label":at(_),onMouseEnter:V=>{mt(V,at(_))}},at(_)),(0,T.createElement)("span",{className:"bre-provider-count"},String(or(_).length)))}),...X.length===0?[(0,T.createElement)("div",{key:"no-providers",className:"bre-empty"},n("sliderNoCurrent"))]:[]),so=(0,T.createElement)("div",{className:"bre-provider-models",role:"group","aria-label":n("modelRowLabel")},...ae.length===0?[(0,T.createElement)("div",{key:"no-models",className:"bre-empty"},n(G?"modelSearchNoMatches":"sliderNoCurrent"))]:ae.map(({provider:k,choice:_})=>{let V=k+"/"+_.id,me=V===pe,ke=_.name??_.id,At=G?at(o.groups.find(rt=>rt.id===k))+" \xB7 "+ke:ke;return(0,T.createElement)("button",{key:V,type:"button",className:"bre-option"+(me?" is-active":""),disabled:I,"aria-pressed":me,onMouseLeave:Ce,onClick:()=>{A(k,_.id)}},(0,T.createElement)("span",{className:"bre-option-name","aria-label":At,onMouseEnter:rt=>{mt(rt,At)}},G?(0,T.createElement)("span",{className:"bre-option-origin"},at(o.groups.find(rt=>rt.id===k))+" \xB7 "):null,ke),Lu(_,n,i.get(k)?.get(_.id)))})),Pn=(0,T.createElement)("div",{className:"bre-menu-foot"},D?(0,T.createElement)("div",{className:"bre-menu-slider"},(0,T.createElement)("div",{className:"bre-effort-slider-head","aria-hidden":!0},(0,T.createElement)("span",{className:"bre-effort-slider-head-label"},n("effortRowLabel")),(0,T.createElement)("span",{className:"bre-effort-slider-head-value"},a[ce]?.name??K)),(0,T.createElement)("div",{className:"bre-effort-slider",ref:O,role:"slider",tabIndex:0,"aria-label":n("effortRowLabel"),"aria-valuemin":0,"aria-valuemax":a.length-1,"aria-valuenow":ce,"aria-valuetext":a[ce]?.name,"aria-disabled":I||void 0,onPointerDown:nt,onPointerMove:Oe,onPointerUp:Dn,onPointerCancel:Dn,onKeyDown:oo},(0,T.createElement)("span",{className:"bre-effort-slider-fill",style:{clipPath:`inset(0 ${100-tt}% 0 0)`}}),...a.map((k,_)=>_===ce?null:(0,T.createElement)("span",{key:"tick-"+k.id,className:"bre-effort-slider-tick",style:{left:a.length>1?`${_/(a.length-1)*100}%`:"0%"}})),(0,T.createElement)("span",{className:"bre-effort-slider-thumb",style:{left:`${tt}%`}})),(0,T.createElement)("div",{className:"bre-effort-slider-labels","aria-hidden":!0},...a.map((k,_)=>(0,T.createElement)("span",{key:k.id,className:"bre-effort-slider-label"+(_===0?" is-first":"")+(_===a.length-1?" is-last":"")+(_===ce?" is-on":""),style:{left:a.length>1?`${_/(a.length-1)*100}%`:"0%"}},k.name)))):(0,T.createElement)("span",{className:"bre-row-value is-muted"},n("sliderNoLevels")));return(0,T.createElement)("div",{className:"bre-slider-body",ref:M},(0,T.createElement)("div",{className:"bre-card"},Ve,io,(0,T.createElement)("div",{className:"bre-panel bre-panel-models"},ao,so),Pn),P===null?null:(0,T.createElement)("div",{className:"bre-model-error",role:"status"},P),St===null?null:(0,T.createElement)(vu,{key:"tip",state:St}))}var re=require("react"),qa='section[role="group"]',Po='button[role="menuitemradio"]';function Wa(e){return e.querySelector(qa)!==null}function Do(e){return Array.from(e.querySelectorAll(Po)).filter(t=>!t.disabled&&t.style.display!=="none")}function Su(e){let t=e.getAttribute("aria-labelledby");return(t===null?null:e.ownerDocument.getElementById(t))?.textContent?.toLowerCase()??""}function Ka(e,t,n=new Map){let r=d=>{n.has(d)||n.set(d,d.style.display),d.style.display="none"},o=d=>{let l=n.get(d);l!==void 0&&(d.style.display=l,n.delete(d))};for(let d of[...n.keys()])d.isConnected||n.delete(d);let i=t.trim().toLowerCase().split(/\s+/).filter(Boolean),a=Array.from(e.querySelectorAll(qa)),s=0;if(i.length===0){for(let d of[...n.keys()])o(d);for(let d of a)s+=d.querySelectorAll(Po).length;return s}for(let d of a){let l=Su(d),u=Array.from(d.querySelectorAll(Po)),h=0;for(let f of u){let c=(f.getAttribute("title")??"").toLowerCase(),p=(f.textContent??"").toLowerCase(),m=`${l} ${c} ${p}`;i.every(b=>m.includes(b))?(o(f),h+=1):r(f)}h>0?(o(d),s+=h):r(d)}return s}function Ba({menu:e,t}){let[n,r]=(0,re.useState)(""),[o,i]=(0,re.useState)(0),a=(0,re.useRef)(null),s=(0,re.useRef)(""),d=(0,re.useRef)(new Map),l=(0,re.useCallback)(c=>{s.current=c;let p=Ka(e,c,d.current);i(p)},[e]);(0,re.useEffect)(()=>()=>{Ka(e,"",d.current)},[e]),(0,re.useEffect)(()=>{let c=new MutationObserver(()=>{s.current.trim().length!==0&&l(s.current)});return c.observe(e,{childList:!0,subtree:!0}),()=>{c.disconnect()}},[e,l]),(0,re.useEffect)(()=>{let c=p=>{if(s.current.trim().length===0)return;let m=p.key;if(!(m==="ArrowDown"||m==="ArrowUp")&&!(m==="Home"||m==="End"||m==="PageUp"||m==="PageDown")||p.target===a.current||p.target instanceof Node&&!e.contains(p.target))return;let E=Do(e);if(E.length===0)return;let v=E.findIndex(I=>I===document.activeElement),D;m==="Home"||m==="PageUp"?D=0:m==="End"||m==="PageDown"?D=E.length-1:m==="ArrowDown"?D=v===-1?0:(v+1)%E.length:D=v===-1?E.length-1:(v-1+E.length)%E.length,p.preventDefault(),p.stopPropagation(),E[D]?.focus()};return e.addEventListener("keydown",c,!0),()=>{e.removeEventListener("keydown",c,!0)}},[e]);let u=c=>{let p=c.key;if(p==="ArrowDown"){c.preventDefault(),c.stopPropagation(),Do(e)[0]?.focus();return}if(n.trim().length>0&&(p==="ArrowUp"||p==="Home"||p==="PageUp"||p==="End"||p==="PageDown")){let m=Do(e);m.length>0&&(c.preventDefault(),c.stopPropagation(),m[p==="ArrowUp"||p==="End"||p==="PageDown"?m.length-1:0]?.focus());return}p==="Escape"&&n.length>0&&(c.preventDefault(),c.stopPropagation(),r(""),l(""))},h=()=>{r(""),l(""),a.current?.focus({preventScroll:!0})},f=o===0&&n.trim().length>0;return(0,re.createElement)("div",{className:"bre-model-search-box"+(f?" has-empty":""),"data-bre-search":"1"},(0,re.createElement)("div",{className:"bre-search-input-wrapper"},(0,re.createElement)("span",{className:"bre-search-icon","aria-hidden":"true"},(0,re.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,re.createElement)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,re.createElement)("path",{d:"M10.5 10.5L14 14",strokeLinecap:"round"}))),(0,re.createElement)("input",{ref:a,type:"text",className:"bre-search-input",role:"searchbox",placeholder:t("modelSearchPlaceholder"),"aria-label":t("modelSearchPlaceholder"),value:n,spellCheck:!1,autoComplete:"off",onChange:c=>{let p=c.currentTarget.value;r(p),l(p)},onKeyDown:u}),n.length>0?(0,re.createElement)("button",{type:"button",className:"bre-search-clear",title:t("modelSearchClear"),"aria-label":t("modelSearchClear"),onClick:h},(0,re.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,re.createElement)("path",{d:"M4 4L12 12M12 4L4 12",strokeLinecap:"round"}))):null),f?(0,re.createElement)("div",{className:"bre-search-empty",role:"status"},t("modelSearchNoMatches")):null)}var ir=require("react"),Ga=require("react-dom"),Ua=require("react-dom/client");function Ke(){return document.body}function Xe(e,t,n){let r=(0,Ua.createRoot)(e);return n?.sync===!0?(0,Ga.flushSync)(()=>{r.render(t)}):r.render(t),{wrapper:e,root:r}}function Ne(e){e!==void 0&&(e.root.unmount(),e.wrapper.remove())}var Ie=class extends ir.Component{constructor(){super(...arguments);zi(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n instanceof Error?n.message:String(n)}}componentDidCatch(n,r){console.error("[bre] editor render failed:",n,r.componentStack)}render(){return this.state.error!==null?(0,ir.createElement)("div",{style:{color:"#c00",fontSize:"11px",whiteSpace:"pre-wrap",padding:"6px"}},`${this.props.fallbackText}: ${this.state.error}`):this.props.children}};var Au="conversation.input.model";function ja(e){return e.querySelector("[data-composer-card]")??void 0}function Io(e){return e.querySelector(`[data-slot="${Au}"]`)??void 0}function za(e){let t=Io(e)??e;return Array.from(t.querySelectorAll('button[aria-haspopup="menu"]'))}function No(e){if(e==null)return!1;let t=e.getAttribute("role");return t==="menu"||t==="group"}function _o(e){return e.getAttribute("role")==="group"}function $a(e,t){let n=e.getAttribute("aria-controls");if(n===null||n.length===0)return;let r=t.getElementById(n);return No(r)?r:void 0}function Fo(e=document){let t=ja(e);if(t===void 0)return;for(let r of za(t)){let o=$a(r,e);if(o!==void 0)return o}let n=Io(t)??t;for(let r of Array.from(n.querySelectorAll('[role="menu"], [role="group"]')))if(r.previousElementSibling?.matches('button[aria-haspopup="menu"]')&&No(r)&&!(r.getAttribute("role")==="group"&&r.querySelector('[role="menuitemradio"], section[role="group"]')===null))return r}function Ko(e=document){let t=ja(e);if(t===void 0)return;let n=Io(t),r=za(t),o=r[0];if(o!==void 0){for(let i of r)if($a(i,e)!==void 0)return i;for(let i of r)if(No(i.nextElementSibling))return i;return n===void 0?r.at(-1):o}}function Va(){return Fo()}function Ya(){return Ko()}var Hu=()=>{(0,Xa.flushSync)(()=>{window.dispatchEvent(new Event("resize"))})};function Ja(e){let{menuOf:t,triggerOf:n,t:r,refreshed:o,sliderEnabled:i,directory:a}=e,s,d,l,u,h,f,c,p=()=>{c?.removeAttribute("data-bre-provider"),c=void 0},m=()=>{let w=n();c!==void 0&&c!==w&&p();let R=h?.store.getSnapshot(),N=R?.current;if(w===void 0||N===null||N===void 0){w===c&&p();return}let K=R?.groups.find(q=>q.id===N.provider),W=K===void 0?N.provider:at(K);if(W.trim()===""){w===c&&p();return}w.dataset.breProvider=W,c=w},b=()=>{let w=a();w!==h&&(f?.(),f=void 0,h=w,w!==void 0&&(f=w.store.subscribe(m))),m()},M=()=>{Ne(d),d=void 0},E=new Map,v=()=>{for(let[w,R]of E)w.style.display=R;E.clear()},D=w=>w.getAttribute("aria-hidden")!=="true"||w.childElementCount>0?!1:(w.textContent??"").trim()==="",I=(w,R)=>{for(let W of Array.from(E.keys()))(!W.isConnected||W.parentElement!==w)&&E.delete(W);let N=[];for(let W of Array.from(w.children))W!==R&&(D(W)||N.push(W));let K=document.activeElement;K!==null&&K!==R&&!R.contains(K)&&N.some(W=>W.contains(K))&&(w.tabIndex=-1,w.focus({preventScroll:!0}));for(let W of N)E.has(W)||E.set(W,W.style.display),W.style.display!=="none"&&(W.style.display="none")},P=w=>{let R=w.querySelector('section[role="group"]'),N=R?.parentElement,K=N!=null&&N.parentElement===w?N:R;if(d===void 0){let W=document.createElement("div");W.dataset.plugin=ue,W.dataset.breSearch="1",w.insertBefore(W,K),d=Xe(W,(0,an.createElement)(Ie,{fallbackText:r("modelSearchFailed"),children:o(()=>(0,an.createElement)(Ba,{menu:w,t:r}))}),{sync:!0});return}if(d.wrapper.parentElement!==w){w.insertBefore(d.wrapper,K);return}K!==null&&d.wrapper.nextSibling!==K&&w.insertBefore(d.wrapper,K)},Z=w=>{if(!i()){Ne(s),s=void 0,w.classList.remove("bre-model-menu-host"),v();for(let q of Array.from(w.children))q.getAttribute("role")==="menuitem"&&(q.style.display="");return}let R=a();if(R===void 0)return;if(s===void 0){let q=document.createElement("div");q.dataset.plugin=ue,q.dataset.breSlider="1",w.insertBefore(q,w.firstChild),s=Xe(q,(0,an.createElement)(Ie,{fallbackText:r("renderFailed"),children:o(()=>(0,an.createElement)(Fa,{directory:R,configuredInputs:e.configuredInputs,t:r}))}),{sync:!0})}else(s.wrapper.parentElement!==w||w.firstChild!==s.wrapper)&&w.insertBefore(s.wrapper,w.firstChild);w.classList.add("bre-model-menu-host");let N=Array.from(w.children).filter(q=>q.getAttribute("role")==="menuitem"),K=s.wrapper;if(_o(w)){K.style.display="",I(w,K);return}if(v(),Array.from(w.querySelectorAll('[role="menuitemradio"]')).some(q=>!K.contains(q)))s.wrapper.contains(document.activeElement)&&(w.tabIndex=-1,w.focus({preventScroll:!0})),s.wrapper.style.display="none";else{s.wrapper.style.display="";for(let q of N)q.style.display="none"}};return{reconcile:()=>{b();let w=t();if(w===void 0){Ne(s),s=void 0,M(),l=void 0,u=void 0,v();return}let R=_o(w),N=R&&i(),K=!R&&Wa(w);K?P(w):M(),Z(w),(K!==l||N!==u)&&(l=K,u=N,(K||N||i())&&Hu())},dispose:()=>{f?.(),f=void 0,h=void 0,p(),Ne(s),s=void 0,M(),v(),l=void 0,u=void 0}}}function Qa(e){let t,n,r=0,o=()=>{if(t!==void 0)return Promise.resolve();let s=r;return n??(n=te(e.api).then(d=>{if(d.namespace===void 0){n=void 0;return}let l=new Map;for(let[u,h]of Object.entries(ye(d.namespace))){let f=Array.isArray(h.models)?h.models:[];for(let c of f){if(typeof c!="object"||c===null||Array.isArray(c))continue;let p=c.id,m=c[Rt];typeof p=="string"&&typeof m=="string"&&m.length>0&&l.set(`${u}/${p}`,m)}}s===r?t=l:n=void 0}).catch(()=>{s===r&&(n=void 0)})),n};return{of:async(s,d)=>(await o(),t?.get(`${s}/${d}`)),invalidate:()=>{r+=1,t=void 0,n=void 0}}}function Ru(e){let t=e.input;return Array.isArray(t)&&t.length>0}function Za(e,t=()=>!0,n={},r=0){let o=n.efforts!==!1,i=n.modalities!==!1;if(!F(e))return;let a={};for(let s of Object.keys(e)){if(!t(s))continue;let d=e[s],l=F(d)&&Array.isArray(d.models)?d.models:void 0;if(l===void 0||l.length===0||!l.every(F))continue;let u=l,h=[],f=!1;for(let c of u){let p=c.reasoningEfforts!==void 0||c[Te]===!0,m=Ru(c)||c[Ye]===!0;if((p||!o)&&(m||!i)){let P=Ou(c,e,s);P!==void 0?(f=!0,h.push(P)):h.push(c);continue}let b=typeof c.id=="string"?c.id:"";if(b.length===0){h.push(c);continue}let M=yt(e,s),E=typeof c.name=="string"?c.name:void 0,v=Fe(b,{...M,displayName:E??M.displayName});if(v.efforts===void 0){h.push(c);continue}let D={...c},I=!1;if(!p&&o&&(I=!0,D.reasoningEfforts=v.efforts,D[Ht]=r,v.compat!==void 0)){let P=F(c.compat)?c.compat:{};D.compat={...P,...v.compat}}if(!m&&i&&v.input!==void 0&&(I=!0,D.input=[...v.input]),!I){h.push(c);continue}f=!0,h.push(D)}f&&(a[s]={models:h})}return Object.keys(a).length===0?void 0:{providers:a}}function Ou(e,t,n){if(!F(e.reasoningEfforts)||e[Te]===!0)return;let r=e.compat,o=F(r)?{...r}:{};if(o.supportsDeveloperRole===void 0&&Mo(yt(t,n)))return{...e,compat:{...o,supportsDeveloperRole:!1}}}function es(e){let t,n=0,r=()=>{if(t!==void 0)return t;let i=(async()=>{try{let a=await fetch(Yi,{method:"GET"});if(!a.ok)return;let s=await a.json();return s?.ok!==!0?void 0:{autofill:s.data?.autofill!==!1,modalityAutofill:s.data?.modalityAutofill!==!1}}catch{return}})().then(a=>(a===void 0&&t===i&&(t=void 0),a??{autofill:!0,modalityAutofill:!0}));return t=i,i},o=async()=>{let i=n;try{let a=await r();if(i!==n||!a.autofill)return;let s=await te(e.api,{fresh:!0}),d=s.namespace;if(i!==n||d===void 0||s.writable!==!0)return;let l=Ro(d);if(l===void 0)return;let u=Za(l,()=>!0,{modalities:a.modalityAutofill},d.revision);if(u===void 0)return;let h=u.providers,f=Object.entries(h).map(([p,m])=>({op:"set",path:["providers",p,"models"],value:m.models})),c=await e.api.settings.mutate(be,f,d.revision);c.ok||console.error(`[bre] idle autofill refused: ${c.error.message}`)}catch(a){console.error(`[bre] idle autofill failed: ${a instanceof Error?a.message:String(a)}`)}};return{run:()=>{o()},invalidate:()=>{n+=1,t=void 0}}}var Gi=require("react"),xc=require("react-dom"),kc=require("react-dom/client");var $=require("react");var st=Ma;function wt(e){let t={};for(let n of st){if(e===void 0){t[n]={on:!1,wire:""};continue}if(e===!1){t[n]=n==="off"?{on:!0,wire:""}:{on:!1,wire:""};continue}let r=e[n];t[n]={on:r!==void 0,wire:r===null?"":typeof r=="string"?r:""}}return t}function It(e){let t=!1,n=!1,r={};for(let o of st){let i=e[o];if(!i.on)continue;if(o==="off"){t=!0;let s=i.wire.trim();r.off=s.length===0?null:s;continue}n=!0;let a=i.wire.trim();r[o]=a.length===0?o:a}return n?r:t?!1:void 0}function sn(e,t){if(e===t)return!0;if(e===!1||e===void 0||t===!1||t===void 0)return!1;let n=st.filter(o=>e[o]!==void 0),r=st.filter(o=>t[o]!==void 0);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}function ts(e,t){if(!(e===void 0||e===!1)&&!("off"in e)){if(t==="zai"||t==="deepseek")return"thinking-disabled";if(t==="qwen")return"enable-thinking-false"}}var qo="bre:auto-effort",ns=Promise.resolve();function rs(e){ns=ns.then(e,e).then(()=>{},()=>{})}function os(e,t=document){t.dispatchEvent(new CustomEvent(qo,{detail:{route:e}}))}function is(e,t=document){let n=r=>{let o=r.detail;typeof o?.route!="string"||o.route.length===0||e(o.route)};return t.addEventListener(qo,n),()=>{t.removeEventListener(qo,n)}}var S=require("react/jsx-runtime"),Cu=new Intl.NumberFormat("en-US"),Du=["M3.4 4.2h9.2","M8 4.2v8.2","M5.9 12.4h4.2"],Pu=["M4.4 3.4h7.2a1.9 1.9 0 0 1 1.9 1.9v5.4a1.9 1.9 0 0 1-1.9 1.9H4.4a1.9 1.9 0 0 1-1.9-1.9V5.3a1.9 1.9 0 0 1 1.9-1.9Z","M6.2 7.2a.9.9 0 1 0 0-1.8.9.9 0 0 0 0 1.8Z","M2.9 11.2 6.1 8.4l2.1 1.9 1.8-1.5 2.7 2.4"],Iu=["M8 3.2 13.6 12.8H2.4L8 3.2Z","M8 6.9v2.5","M8 11.3h.01"];function Wo({paths:e}){return(0,S.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e.map(t=>(0,S.jsx)("path",{d:t},t))})}function ar(e){let t=e.replace(/\D/g,"");if(t==="")return;let n=Number(t);return Number.isFinite(n)&&n>0?n:void 0}function dt(e){return e===void 0?"":Cu.format(e)}function vt(e){return e===void 0||e.length===0?{declared:!1,image:!1}:{declared:!0,image:e.includes("image")}}function dr(e){return e.declared?e.image?["text","image"]:["text"]:null}function sr(e,t){return e.declared?t===void 0?!1:e.image?t.includes("image"):!t.includes("image"):t===void 0}function Bo(e,t,n){let r=e?t:!1;return e&&r===void 0&&n===void 0?"keep":r}function lr(e){let t=e.appliedCompat;return e.initialCompat?.supportsThinkingTokenBudget===!0&&e.initialCompat?.thinkingTokenBudgetField===void 0&&t?.thinkingTokenBudgetField===void 0&&(e.routeApi??"").toLowerCase()==="openai-completions"&&(t={...t??{},thinkingTokenBudgetField:"thinking_token_budget"}),{efforts:e.efforts,...t===void 0?{}:{compat:t},...e.input===void 0?{}:{input:e.input},...e.defaultEffort===void 0?{}:{defaultEffort:e.defaultEffort}}}function cr({route:e,routeApi:t,routeBaseURL:n,modelId:r,modelName:o,efforts:i,effortsUnset:a=!1,input:s,compat:d,defaultEffort:l,index:u,staged:h=!1,officialInputTypes:f=!1,api:c,readOnly:p,t:m}){let[b,M]=(0,$.useState)(()=>wt(i)),[E,v]=(0,$.useState)(()=>vt(s)),[D,I]=(0,$.useState)(()=>i!==!1),[P,Z]=(0,$.useState)(()=>l??""),[L,H]=(0,$.useState)(!1),[w,R]=(0,$.useState)(void 0),[N,K]=(0,$.useState)(void 0),[W,q]=(0,$.useState)(""),[oe,j]=(0,$.useState)("low"),[X,z]=(0,$.useState)(()=>st.some(y=>b[y].on&&b[y].wire.trim()!==(y==="off"?"":y))),ee=(0,$.useRef)(void 0),[G,ie]=(0,$.useState)(void 0),ae=(0,$.useRef)(void 0);ae.current===void 0&&(ae.current=c.readCapacities?.()??{});let[pe,x]=(0,$.useState)(()=>dt(ae.current?.contextWindow)),[A,g]=(0,$.useState)(()=>dt(ae.current?.maxTokens)),[O,U]=(0,$.useState)(void 0),ne=(0,$.useRef)(!1),J=(0,$.useRef)(i),le=(0,$.useRef)(s),ce=(0,$.useRef)(l),tt=(0,$.useRef)(void 0),$e=(0,$.useRef)(i);$e.current=i;let nt=(0,$.useRef)(a);nt.current=a,(0,$.useEffect)(()=>is(y=>{if(y!==e||$e.current!==void 0||nt.current)return;let Q=tt.current;Q!==void 0&&rs(Q)}),[e]),(0,$.useEffect)(()=>{sn(J.current,i)||(J.current=i,ne.current||(M(wt(i)),I(i!==!1))),le.current!==s&&(le.current=s,ne.current||v(vt(s))),ce.current!==l&&(ce.current=l,ne.current||Z(l??""))},[i,s,l]);let Oe=st.filter(y=>b[y].on),Dn=P===(l??"")?void 0:P===""?null:P,oo=D?It(b):!1,St=!sn(oo,i)||!sr(E,s)||Dn!==void 0,mt=(0,$.useRef)(void 0),Ce=()=>{ne.current=!0,K(void 0),q(""),j("low"),ie(void 0)},Ve=(y,Q,fe,Ee=D)=>{let ht=Bo(Ee,It(y),i),_n=sr(Q,s)?void 0:dr(Q),Ui=lr({efforts:ht,input:_n,defaultEffort:fe===(l??"")?void 0:fe===""?null:fe,appliedCompat:ee.current,routeApi:t,initialCompat:d}),ji=JSON.stringify(Ui);mt.current!==ji&&(mt.current=ji,c.commit(e,r,Ui))},io=(y,Q)=>{Ce();let fe=!Q&&P===y?"":P;fe!==P&&Z(fe);let Ee={...b,[y]:{...b[y],on:Q}};Q&&y!=="off"&&Ee[y].wire.trim().length===0&&(Ee[y]={...Ee[y],wire:y}),M(Ee),Ve(Ee,E,fe),R(void 0)},ao=y=>{Ce(),I(y);let Q=y?P:"";Q!==P&&Z(Q),Ve(b,E,Q,y),R(void 0)},so=(y,Q)=>{Ce();let fe={...b,[y]:{...b[y],wire:Q}};M(fe),Ve(fe,E,P),R(void 0)},Pn=y=>{Ce();let Q={declared:!0,image:y};v(Q),Ve(b,Q,P),R(void 0)},k=()=>{Ce();let y={declared:!1,image:!1};v(y),Ve(b,y,P),R(void 0)},_=y=>{Ce(),Z(y),Ve(b,E,y),R(void 0)},V=(y,Q)=>{let fe=Q.replace(/\D/g,"").slice(0,12),Ee=y==="context"?fe:pe,ht=y==="output"?fe:A;U(y),y==="context"?x(fe):g(fe),c.setCapacities?.({contextWindow:ar(Ee),maxTokens:ar(ht)})},me=y=>{Ce();let Q=y.efforts!==!1;I(Q);let fe=wt(y.efforts);M(fe);let Ee=y.input===void 0?E:vt(y.input);y.input!==void 0&&v(Ee);let ht=P===""&&y.defaultEffort!==void 0?y.defaultEffort:P;if(ht!==P&&Z(ht),K(y.efforts),q(y.source),j(y.confidence),ee.current=y.compat,ie(y.inputSource),y.contextWindow!==void 0||y.maxTokens!==void 0){c.fillCapacities?.(y.contextWindow,y.maxTokens);let _n=c.readCapacities?.();x(dt(_n?.contextWindow)),g(dt(_n?.maxTokens))}R({kind:"info",text:m("appliedHint",{source:y.source,confidence:m("confidence_"+y.confidence)})}),Ve(fe,Ee,ht,Q)},ke=async()=>{if(!(p||L)){H(!0),R(void 0);try{let y=h?await c.suggest(e,r,o,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}):await c.suggest(e,r,o);if(!y.ok){R({kind:"error",text:y.error==="no-suggestion"?m("noSuggestion"):y.error});return}me(y.suggestion)}catch(y){R({kind:"error",text:m("writeError",{message:String(y)})})}finally{H(!1)}}};(0,$.useEffect)(()=>{tt.current=ke});let At=()=>{ne.current=!1,c.withdraw(e,r),M(wt(i)),I(i!==!1),v(vt(s)),Z(l??""),K(void 0),q(""),j("low"),ee.current=void 0,ie(void 0);let y=ae.current??{};x(dt(y.contextWindow)),g(dt(y.maxTokens)),U(void 0),c.setCapacities?.({contextWindow:y.contextWindow,maxTokens:y.maxTokens}),R(void 0),mt.current=void 0},rt=(0,$.useMemo)(()=>Fe(r,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}).compat?.thinkingFormat,[r,t,n]),In=ee.current?.thinkingFormat??rt,Nn=ts(i,In),De=p||L,Rc=D?Oe.length===0?m("stateUndeclared"):m("stateDeclared",{count:Oe.length,default:m(P===""?"defaultEffortUnset":"level_"+P)}):m("thinkingModeOff"),Oc=P!==""&&!Oe.includes(P)?[...Oe,P]:Oe,lo=ar(pe),co=ar(A),Cc=lo!==void 0&&co!==void 0&&co>lo;return(0,S.jsxs)("div",{className:"bre-effort-editor","data-plugin":ue,children:[(0,S.jsxs)("div",{className:"bre-effort-top",children:[(0,S.jsxs)("label",{className:"bre-thinking-switch",children:[(0,S.jsx)("input",{type:"checkbox",checked:D,disabled:De,"aria-label":m("thinkingMode")+" "+String(u+1),onChange:y=>{ao(y.target.checked)}}),(0,S.jsx)("span",{className:"bre-effort-title",children:m("thinkingMode")})]}),(0,S.jsx)("span",{className:"bre-effort-state",children:Rc}),N===void 0?null:(0,S.jsx)("span",{className:"bre-pill bre-effort-suggest",role:"status",children:m("appliedHint",{source:W,confidence:m("confidence_"+oe)})})]}),D?(0,S.jsxs)("div",{className:"bre-effort-card",children:[(0,S.jsxs)("div",{className:"bre-effort-sec",children:[(0,S.jsxs)("div",{className:"bre-effort-labelrow",children:[(0,S.jsx)("span",{className:"bre-effort-label",children:m("levelsLabel")}),(0,S.jsx)("em",{className:"bre-effort-labelhint",children:m("levelsHint")}),(0,S.jsx)("button",{type:"button",className:"bre-link-button bre-effort-adapt",disabled:De,onClick:()=>{ke()},children:m("autoAdapt")})]}),(0,S.jsx)("div",{className:"bre-pillrow",role:"group","aria-label":m("levelsLabel"),children:st.map(y=>{let Q=b[y];return(0,S.jsx)("button",{type:"button",className:Q.on?"bre-lvl is-on":"bre-lvl",disabled:De,"aria-pressed":Q.on,"aria-label":m("level_"+y)+" "+String(u+1),title:m("level_"+y),onClick:()=>{io(y,!Q.on)},children:m("level_"+y)},y)})}),Oe.length===0?null:(0,S.jsx)("button",{type:"button",className:"bre-link-button bre-effort-wiretoggle",disabled:De,"aria-expanded":X,onClick:()=>{z(!X)},children:m(X?"wireHide":"wireShow")}),Oe.length===0||!X?null:(0,S.jsx)("div",{className:"bre-wire-row",children:Oe.map(y=>(0,S.jsxs)("label",{className:"bre-wire-item",children:[(0,S.jsx)("span",{className:"bre-wire-name",children:m("level_"+y)}),(0,S.jsx)("input",{type:"text",className:"bre-effort-wire",value:b[y].wire,disabled:De,placeholder:m("wirePlaceholder"),"aria-label":m("level_"+y)+" "+m("wireValue"),onChange:Q=>{so(y,Q.target.value)}})]},y))})]}),(0,S.jsxs)("div",{className:"bre-effort-cols",children:[Oe.length===0?null:(0,S.jsxs)("div",{className:"bre-effort-sec",children:[(0,S.jsxs)("div",{className:"bre-effort-labelrow",children:[(0,S.jsx)("span",{className:"bre-effort-label",children:m("defaultEffortLabel")}),(0,S.jsxs)("select",{className:"bre-effort-select",value:P,disabled:De,"aria-label":m("defaultEffortLabel"),onChange:y=>{_(y.target.value)},children:[(0,S.jsx)("option",{value:"",children:m("followMemory")}),Oc.map(y=>(0,S.jsx)("option",{value:y,children:m("level_"+y)},y))]})]}),(0,S.jsx)("p",{className:"bre-effort-note bre-effort-note-oneline",children:m("defaultEffortHint")})]}),f?null:(0,S.jsxs)("div",{className:"bre-effort-sec",children:[(0,S.jsx)("div",{className:"bre-effort-labelrow",children:(0,S.jsx)("span",{className:"bre-effort-label",children:m("inputModality")})}),(0,S.jsxs)("div",{className:"bre-pillrow",role:"group","aria-label":m("inputModality"),children:[(0,S.jsxs)("button",{type:"button",className:E.declared?"bre-lvl is-on":"bre-lvl",disabled:De,"aria-pressed":E.declared,"aria-label":m("modalityText")+" "+String(u+1),title:m("modalityText"),onClick:()=>{E.declared?k():Pn(!1)},children:[(0,S.jsx)(Wo,{paths:Du}),m("modalityText")]})," ",(0,S.jsxs)("button",{type:"button",className:E.declared&&E.image?"bre-lvl is-on":"bre-lvl",disabled:De,"aria-pressed":E.declared&&E.image,"aria-label":m("modalityImage")+" "+String(u+1),title:m("modalityImage"),onClick:()=>{Pn(!(E.declared&&E.image))},children:[(0,S.jsx)(Wo,{paths:Pu}),m("modalityImage")]})]}),E.declared?null:(0,S.jsx)("p",{className:"bre-effort-note",children:m("modalityInherit")})]})]}),h?(0,S.jsx)("p",{className:"bre-effort-note",children:m("stagedHint")}):null,(0,S.jsxs)("div",{className:"bre-effort-caps",children:[(0,S.jsxs)("label",{className:"bre-cap",children:[(0,S.jsx)("span",{className:"bre-effort-label",children:m("contextWindowLabel")}),(0,S.jsxs)("span",{className:"bre-cap-box",children:[(0,S.jsx)("input",{type:"text",inputMode:"numeric",className:"bre-cap-input",value:O==="context"?pe:dt(lo),disabled:De,placeholder:m("capacityBlank"),"aria-label":m("contextWindowLabel")+" "+String(u+1),onFocus:()=>{U("context")},onBlur:()=>{U(void 0)},onChange:y=>{V("context",y.target.value)}}),(0,S.jsx)("span",{className:"bre-cap-unit",children:m("tokensUnit")})]})]}),(0,S.jsxs)("label",{className:"bre-cap",children:[(0,S.jsx)("span",{className:"bre-effort-label",children:m("maxTokensLabel")}),(0,S.jsxs)("span",{className:"bre-cap-box",children:[(0,S.jsx)("input",{type:"text",inputMode:"numeric",className:"bre-cap-input",value:O==="output"?A:dt(co),disabled:De,placeholder:m("capacityBlank"),"aria-label":m("maxTokensLabel")+" "+String(u+1),onFocus:()=>{U("output")},onBlur:()=>{U(void 0)},onChange:y=>{V("output",y.target.value)}}),(0,S.jsx)("span",{className:"bre-cap-unit",children:m("tokensUnit")})]})]})]}),Cc?(0,S.jsxs)("p",{className:"bre-effort-note bre-warn",children:[(0,S.jsx)(Wo,{paths:Iu}),m("capacityRule")]}):null,i===!1?(0,S.jsx)("p",{className:"bre-effort-note",children:m("reasoningDisabled")}):null,Nn===void 0?null:(0,S.jsx)("p",{className:"bre-effort-note",children:m(Nn==="thinking-disabled"?"defaultRiskDisabled":"defaultRiskQwen")}),It(b)===void 0&&i!==void 0?(0,S.jsx)("p",{className:"bre-effort-note",children:m("bareHint")}):null,N===void 0?null:(0,S.jsx)("div",{className:"bre-suggestion",children:G===void 0?null:(0,S.jsx)("p",{className:"bre-effort-note",children:m(G==="endpoint"?"inputHintEndpoint":G==="knowledge"?"inputHintKnowledge":"inputHintHeuristic")})}),w===void 0?null:(0,S.jsx)("p",{className:"bre-effort-message bre-"+w.kind,role:w.kind==="error"?"alert":"status",children:w.text}),St?(0,S.jsx)("p",{className:"bre-effort-message bre-info",role:"status",children:m("pendingSave")}):null,St?(0,S.jsx)("p",{className:"bre-effort-note",children:m("pendingHint")}):null,(0,S.jsx)("div",{className:"bre-effort-actions",children:(0,S.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:De||!St,onClick:At,children:m("reset")})})]}):null]})}var lt="data-bre-auto-effort",Go='[class*="modelCatalog"]',Nu='[class*="modelListHead"]',_u='button[class*="linkButton"]',Fu="bre-auto-effort",Ku="bre-auto-effort-note",qu="data-bre-auto-effort-phase",ss="bre-auto-effort-note-text",ds="bre-auto-effort-note-detail",Wu=3e3;function Bu(e){return e.blocked==="busy"?null:e.failed!==void 0?{phase:"failed",count:0,missed:0,detail:e.failed}:e.blocked!==void 0?{phase:"blocked",count:0,missed:0,detail:""}:e.held>0?{phase:"done",count:e.held,missed:e.unsuggested,detail:""}:e.unsuggested>0?{phase:"unsuggested",count:0,missed:e.unsuggested,detail:""}:{phase:"empty",count:0,missed:0,detail:""}}function Uo(e){return Array.from(e.querySelectorAll(Go)).filter(t=>(t.parentElement?.closest(Go)??null)===null)}function ur(e,t,n){let r=new Map;for(let s of t)s.route.length!==0&&s.catalogue.isConnected&&r.set(s.catalogue,s.route);let o=n.t("autoAdaptAll");for(let[s,d]of r){let l=s.querySelector(Nu)??s,u=l.querySelector(`[${lt}]`)??Uu();cs.set(u,n);let h=Gu(l);h!==null?h.nextElementSibling!==u&&h.after(u):l.lastElementChild!==u&&l.append(u),Vu(u,d,o)}let i=new Set,a=new Set(r.values());for(let s of Array.from(e.querySelectorAll(`[${lt}]`))){let d=s.closest(Go),l=s.getAttribute(lt)??"";if(d===null||!r.has(d)||i.has(d)){s.remove(),l.length>0&&!a.has(l)&&jo(l);continue}i.add(d)}}function jo(e){let t=xt.get(e);t!==void 0&&(t.timer!==null&&clearTimeout(t.timer),t.note.remove(),xt.delete(e))}function ls(){for(let e of Array.from(document.querySelectorAll(`[${lt}]`)))e.remove();for(let e of xt.values())e.timer!==null&&clearTimeout(e.timer),e.note.remove();xt.clear()}function Gu(e){let t=Array.from(e.querySelectorAll(_u));return t.length===0?null:t[t.length-1]}function Uu(){let e=document.createElement("button");return e.className=Fu,e.setAttribute("type","button"),e.setAttribute(lt,""),e.addEventListener("click",()=>{let t=e.getAttribute(lt)??"";if(t.length===0)return;let n=cs.get(e);n!==void 0&&(os(t),ju(t,n))}),e}async function ju(e,t){if(t.onRequest===void 0)return;as(e,{phase:"working",count:0,missed:0,detail:""},t,0);let n;try{n=await t.onRequest(e)}catch(o){n={held:0,unsuggested:0,failed:String(o)}}if(n===void 0){jo(e);return}let r=Bu(n);r!==null&&as(e,r,t,Wu)}function as(e,t,n,r){let o=xt.get(e);o!==void 0&&!o.note.isConnected&&(o.timer!==null&&clearTimeout(o.timer),xt.delete(e),o=void 0),o!==void 0&&o.timer!==null&&clearTimeout(o.timer);let i=o?.note??zu();i.setAttribute(qu,t.phase);let a=i.querySelector(`.${ss}`),s=i.querySelector(`.${ds}`),d=$u(t,n);a.textContent!==d.text&&(a.textContent=d.text),s.textContent!==d.detail&&(s.textContent=d.detail),s.hidden=d.detail.length===0,o===void 0&&document.body.append(i);let l=r>0?setTimeout(()=>{jo(e)},r):null;i.style.setProperty("--bre-note-hold",`${r}ms`),xt.set(e,{note:i,timer:l})}function zu(){let e=document.createElement("div");return e.className=Ku,e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<span class="${ss}"></span><span class="${ds}"></span>`,e}var cs=new WeakMap,xt=new Map;function $u(e,t){switch(e.phase){case"working":return{text:t.t("autoAdaptWorking"),detail:""};case"done":return{text:t.t("autoAdaptDone",{count:e.count}),detail:e.missed>0?`${t.t("autoAdaptDoneHint",{count:e.count})} ${t.t("autoAdaptUnsuggestedHint")}`:t.t("autoAdaptDoneHint",{count:e.count})};case"empty":return{text:t.t("autoAdaptEmpty"),detail:t.t("autoAdaptEmptyHint")};case"unsuggested":return{text:t.t("autoAdaptUnsuggested"),detail:t.t("autoAdaptUnsuggestedHint")};case"blocked":return{text:t.t("autoAdaptBlocked"),detail:t.t("autoAdaptBlockedHint")};case"failed":return{text:t.t("autoAdaptFailed",{message:e.detail}),detail:e.detail}}}function Vu(e,t,n){e.getAttribute(lt)!==t&&e.setAttribute(lt,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("title")!==null&&e.removeAttribute("title")}var dn="data-bre-drag-handle",zo="data-bre-row-head",$o="data-bre-drop-side",fr="bre-row-dragging",pr="bre-row-drop-target",gs="bre-drag-ghost",bs="bre-drop-line",us="http://www.w3.org/2000/svg",fs=8,ps=28,ms=12,Yu="transform 180ms cubic-bezier(0.2, 0.7, 0.3, 1)",Xu='button, a, input, textarea, select, [contenteditable], [role="button"], [role="switch"], [role="checkbox"], [role="textbox"], [role="combobox"]';function mr(){return{sources:new WeakSet,lists:new WeakSet,line:void 0,sighted:new WeakMap,drag:void 0}}function he(e){return Array.from(e.children).filter(t=>t instanceof HTMLElement)}function Ju(e,t){let n=e.style.order;if(n==="")return t;let r=Number.parseInt(n,10);return Number.isNaN(r)?t:r}function kt(e){return he(e).map((t,n)=>({row:t,key:Ju(t,n),index:n})).sort((t,n)=>t.key-n.key||t.index-n.index).map(t=>t.row)}function ys(e,t){let n=e.filter(a=>t.includes(a)),r=n.map(a=>e.indexOf(a)),o=t.filter(a=>n.includes(a)),i=new Map;e.forEach((a,s)=>i.set(a,s)),r.forEach((a,s)=>{let d=o[s];d!==void 0&&i.set(d,a)});for(let[a,s]of i){let d=String(s);a.style.order!==d&&(a.style.order=d)}}function hr(e,t){ys(kt(e),t)}function Vo(e,t){let n=he(e),r=n.map(o=>o.offsetTop);t(),n.forEach((o,i)=>{let a=r[i]-o.offsetTop;a!==0&&(o.style.transition="none",o.style.transform=`translateY(${a}px)`,o.offsetHeight,o.style.transition=Yu,o.style.transform="")})}function ln(e,t){return kt(e).map(n=>t(n)).filter(n=>n!==void 0)}function Qu(e,t,n){let r=ln(e,t);if(n===void 0||!Zu(e,n))return r;let o=new Map;return n.ids.forEach((i,a)=>{o.has(i)||o.set(i,a)}),r.map((i,a)=>({id:i,key:o.get(i)??n.ids.length+a})).sort((i,a)=>i.key-a.key).map(i=>i.id)}function Zu(e,t){return t.rows.some(n=>!e.contains(n))}function ef(e,t){let n=[];for(let o of kt(e)){let i=t(o);i!==void 0&&n.push(i)}let r=[];for(let o of he(e))t(o)!==void 0&&r.push(o);return{ids:n,rows:r}}function ws(e,t,n){let r=new Map;for(let[s,d]of t.entries())r.has(d)||r.set(d,s);let o=he(e),a=[...o.filter(s=>n(s)!==void 0)].sort((s,d)=>{let l=r.get(n(s))??Number.MAX_SAFE_INTEGER,u=r.get(n(d))??Number.MAX_SAFE_INTEGER;return l-u});ys(o,a)}function gr(e){for(let t of e)t.style.order="",t.style.transition="",t.style.transform=""}function vs(e,t,n,r){let i=e.filter(a=>a!==t).indexOf(n);return i<0?Math.max(0,e.indexOf(t)):r?i+1:i}function xs(e,t){let n,r=Number.POSITIVE_INFINITY;for(let o of e){let i=o.getBoundingClientRect(),a=t<i.top?i.top-t:t>i.bottom?t-i.bottom:0;a<r&&(r=a,n=o)}return n}function tf(e,t){let n=e.getBoundingClientRect();return n.height<=0?!0:t>n.top+n.height/2}function ks(e,t){let n=e.getBoundingClientRect();return t?n.bottom+fs/2-1:n.top-fs/2-1}function Es(){let e=document.createElementNS(us,"svg");e.setAttribute("width","10"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 10 14"),e.setAttribute("fill","none"),e.setAttribute("aria-hidden","true");let t=[[2.5,3],[7.5,3],[2.5,7],[7.5,7],[2.5,11],[7.5,11]];for(let[n,r]of t){let o=document.createElementNS(us,"circle");o.setAttribute("cx",String(n)),o.setAttribute("cy",String(r)),o.setAttribute("r","1.2"),o.setAttribute("fill","currentColor"),e.appendChild(o)}return e}function Ts(e,t){let n=document.createElement("div");n.className=gs,n.setAttribute("aria-hidden","true"),n.appendChild(Es());let r=document.createElement("span");r.className="bre-drag-ghost-name";let o=t??e.querySelector('[class*="rowName"]')?.textContent?.trim();return r.textContent=o===void 0?"":o,n.appendChild(r),n}function nf(e){return!(e instanceof Element)||e.closest(`[${dn}]`)!==null?!1:e.closest(Xu)!==null}function Ms(e){return e.parentElement??void 0}function Ls(e){for(let t of he(e))t.classList.remove(pr),t.removeAttribute($o)}function br(e){let t=e.parentElement;for(;t!==null;){if(Ss(t))return t;t=t.parentElement}let n=document.scrollingElement;return n instanceof HTMLElement&&n.scrollHeight>n.clientHeight?n:void 0}function Yo(e){let t=[],n=e.parentElement;for(;n!==null;)Ss(n)&&t.push(n),n=n.parentElement;let r=document.scrollingElement;return r instanceof HTMLElement&&r.scrollHeight>r.clientHeight&&!t.includes(r)&&t.push(r),t}function Ss(e){if(e.scrollHeight<=e.clientHeight)return!1;let t=e.style.overflowY,n=t.length>0?t:window.getComputedStyle(e).overflowY;return n==="auto"||n==="scroll"||n==="overlay"}function As(e,t){let n=e.getBoundingClientRect();return n.height<=0?0:t<n.top+ps?-ms:t>n.bottom-ps?ms:0}function Hs(e,t,n){if(t.scrollStep===n)return;if(t.scrollStep=n,n===0){t.frame!==void 0&&(window.cancelAnimationFrame(t.frame),t.frame=void 0);return}let r=t.scroller;if(r===void 0||t.frame!==void 0)return;let o=()=>{t.frame=void 0,!(e.drag!==t||t.scrollStep===0)&&(r.scrollTop+=t.scrollStep,t.frame=window.requestAnimationFrame(o))};t.frame=window.requestAnimationFrame(o)}function rf(e){let t=e.line;if(t!==void 0&&t.isConnected)return t;let n=document.createElement("div");return n.className=bs,n.setAttribute("aria-hidden","true"),document.body.appendChild(n),e.line=n,n}function of(e,t,n){let r=rf(e),o=t.getBoundingClientRect();r.style.top=`${ks(t,n)}px`,r.style.left=`${o.left}px`,r.style.width=`${o.width}px`,r.style.display="block",r.setAttribute($o,n?"after":"before")}function af(e){e.line!==void 0&&(e.line.style.display="none")}function sf(e){let t=e.drag;e.drag=void 0,t!==void 0&&(Hs(e,t,0),af(e),t.row.classList.remove(fr),Ls(t.list),t.dropped||Vo(t.list,()=>{hr(t.list,t.before)}))}function df(e,t,n,r){if(nf(t.target)){t.preventDefault();return}let o=Ms(e),i=n.idOf(e);if(o===void 0||i===void 0){t.preventDefault();return}let a={row:e,list:o,before:kt(o),scroller:br(o),adapter:n,scrollStep:0,frame:void 0,dropped:!1};r.drag=a,e.classList.add(fr);let s=Ts(e,n.labelOf(e));Number.isFinite(t.clientX)&&Number.isFinite(t.clientY)&&(s.style.left=`${t.clientX}px`,s.style.top=`${t.clientY}px`),document.body.appendChild(s);let d=t.dataTransfer;if(d!=null)try{d.effectAllowed="move",d.setData("text/plain",i),d.setDragImage(s,Math.round(s.offsetWidth/2),Math.round(s.offsetHeight/2))}catch{}window.setTimeout(()=>{s.remove()},0)}function lf(e,t,n){let r=n.drag;if(r===void 0||r.list!==e)return;let o=t.target,i=o instanceof Element?r.adapter.rowOf(o,e):void 0,a=kt(e),s=i!==void 0&&a.includes(i)?i:xs(a,t.clientY);if(s===void 0)return;t.preventDefault();let d=t.dataTransfer;d!=null&&(d.dropEffect="move");let l=tf(s,t.clientY),u=vs(a,r.row,s,l);u!==a.indexOf(r.row)&&Vo(e,()=>{hr(e,bo(a,r.row,u))}),Ls(e),s.classList.add(pr),s.setAttribute($o,l?"after":"before"),of(n,s,l),Hs(n,r,r.scroller===void 0?0:As(r.scroller,t.clientY))}function cf(e,t){t.lists.has(e)||(t.lists.add(e),e.addEventListener("dragover",n=>{lf(e,n,t)}),e.addEventListener("drop",n=>{let r=t.drag;r===void 0||r.list!==e||(n.preventDefault(),r.dropped=!0,r.adapter.commit(e))}))}function uf(e,t,n,r){r.sources.has(e)||(r.sources.add(e),n.seatDrags&&(e.setAttribute(zo,"1"),e.setAttribute("draggable","true")),e.addEventListener("dragstart",o=>{df(t,o,n,r)}),e.addEventListener("dragend",()=>{sf(r)}))}function ff(e,t,n,r){e.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation()}),e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let i=Ms(t);if(i===void 0)return;let a=kt(i),s=a.indexOf(t);if(s<0)return;let d=s+(o.key==="ArrowUp"?-1:1);d<0||d>=a.length||(o.preventDefault(),Vo(i,()=>{hr(i,bo(a,t,d))}),n.commit(i),e.focus())})}function hs(e,t,n,r){let o=r.gripLabel(t,n),i=r.gripHint();e.getAttribute(dn)!==n&&e.setAttribute(dn,n),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}function pf(e,t,n,r,o){let i=t.querySelector(`[${dn}]`);if(i!==null){hs(i,e,n,r);return}r.decorate?.(e,t);let a=document.createElement("span");a.className="bre-drag-grip",a.setAttribute("role","button"),a.setAttribute("tabindex","0"),a.setAttribute("draggable","true"),a.appendChild(Es()),hs(a,e,n,r),ff(a,e,r,o),uf(r.seatDrags?t:a,e,r,o),t.insertBefore(a,t.firstChild)}function yr(e,t,n,r){if(!e.isConnected)return;cf(t,r);for(let i of he(t)){let a=n.idOf(i);if(a===void 0)continue;let s=n.seatOf(i);s!==void 0&&pf(i,s,a,n,r)}if(r.drag!==void 0)return;let o=Qu(t,n.idOf,r.sighted.get(t));ws(t,n.order(o),n.idOf),r.sighted.set(t,ef(t,n.idOf))}function wr(e){e.drag=void 0;for(let t of Array.from(document.querySelectorAll(`[${dn}]`)))t.remove();for(let t of Array.from(document.querySelectorAll(`[${zo}]`)))t.removeAttribute(zo),t.removeAttribute("draggable");for(let t of Array.from(document.querySelectorAll(`.${fr}, .${pr}`)))t.classList.remove(fr,pr);for(let t of Array.from(document.querySelectorAll(`.${bs}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${gs}`)))t.remove();e.line=void 0}var Rs=["openai","anthropic","gemini"];function vr(e){return e==="anthropic-messages"?"anthropic":e==="google-generative-ai"?"gemini":"openai"}function Os(e){return e==="openai-completions"||e==="anthropic-messages"||e==="openai-responses"||e==="google-generative-ai"}var mf=40;function Cs(e){if(typeof e!="string")return;let t="";for(let n of e){let r=n.codePointAt(0)??0;r<32||r===127||(t+=n)}if(t=t.trim(),t.length!==0)return t.slice(0,mf)}function Et(e){return typeof e=="string"&&/^[\x21-\x7E]+$/.test(e)}var hf=12;function Ds(e){return e.length===0?"":e.length<hf?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":`${e.slice(0,4)}...${e.slice(-4)}`}var cn="bre:endpoints-changed";function gf(e){for(let t of["error","message"]){let n=e[t];if(typeof n=="string"&&n.length>0)return n}}function xr(e){if(!Array.isArray(e))return;let t=[];for(let n of e)typeof n=="string"&&n.length>0&&t.push(n);return t}function bf(e){if(!F(e))return;let t=e.ref;if(typeof t!="string"||t.length===0)return;let n=e.alias,r=e.configured,o=e.masked,i=xr(e.models),a=e.protocol,s=e.rest,d=F(s)&&typeof s.remainingMs=="number"?s.remainingMs:void 0,l=F(s)&&typeof s.failures=="number"?s.failures:void 0;return{ref:t,...typeof n=="string"&&n.length>0?{alias:n}:{},enabled:e.enabled!==!1,configured:typeof r=="boolean"?r:null,...typeof o=="string"&&o.length>0?{masked:o}:{},...i===void 0?{}:{models:i},...Os(a)?{protocol:a}:{},...d!==void 0&&d>=0&&l!==void 0?{rest:{remainingMs:d,failures:l}}:{}}}function yf(e){let t=e.entries;if(!Array.isArray(t))return;let n=[];for(let h of t){let f=bf(h);f!==void 0&&n.push(f)}let r=e.route,o=xr(e.models),i=xr(e.mergedModels),a=xr(e.unmergedModels),s=e.endpoints,d=F(s)&&typeof s.openai=="string"?s.openai:null,l=F(s)&&typeof s.anthropic=="string"?s.anthropic:null,u=F(s)&&typeof s.gemini=="string"?s.gemini:null;return{ok:!0,route:typeof r=="string"?r:"",entries:n,...o===void 0?{}:{models:o},...i===void 0?{}:{mergedModels:i},...a===void 0||a.length===0?{}:{unmergedModels:a},endpoints:{openai:d,anthropic:l,gemini:u}}}async function wf(e){let t;try{t=await e.json()}catch{t=void 0}if(!F(t))return{ok:!1};if(t.ok===!0){let r=yf(t);if(r!==void 0)return r}let n=gf(t);return n===void 0?{ok:!1}:{ok:!1,error:n}}async function qe(e,t){let n=`${Vi}?route=${encodeURIComponent(e)}`;try{let r=await fetch(n,t===void 0?{method:"GET",cache:"no-store",credentials:"same-origin"}:{method:"POST",cache:"no-store",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)});return await wf(r)}catch{return{ok:!1}}}var We={list:e=>qe(e),add:(e,t,n)=>qe(e,{op:"add",value:t,...n===void 0?{}:{alias:n}}),rename:(e,t,n)=>qe(e,{op:"rename",ref:t,...n===void 0?{}:{alias:n}}),remove:(e,t)=>qe(e,{op:"remove",ref:t}),replace:(e,t,n)=>qe(e,{op:"value",ref:t,value:n}),setScope:(e,t,n)=>qe(e,{op:"scope",ref:t,...n===void 0?{}:{models:n}}),setEnabled:(e,t,n)=>qe(e,{op:"enable",ref:t,enabled:n}),setProtocol:(e,t,n)=>qe(e,{op:"protocol",ref:t,...n===void 0?{}:{protocol:n}}),setEndpoints:(e,t,n,r)=>qe(e,{op:"endpoints",openai:t??"",anthropic:n??"",gemini:r??""}),applyMerged:e=>qe(e,{op:"applyMerged"}),async reveal(e,t){try{let n=await fetch(`${Kn}?route=${encodeURIComponent(e)}&ref=${encodeURIComponent(t)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!n.ok)return;let r=await n.json();if(!F(r)||r.ok!==!0)return;let o=r.key;return typeof o=="string"&&o.length>0?o:void 0}catch{return}}};var un="data-bre-endpoint-rows",ct="data-bre-endpoint-row",Er="data-bre-endpoint-family",Ps="data-bre-endpoint-filled",Tr="data-bre-endpoint-field",Mr="data-bre-endpoint-title",fn="data-bre-endpoint-toggle",qs="data-bre-endpoint-count",Lr="data-bre-field-order",pn="data-bre-endpoint-serving",Is="data-bre-protocol-watch",Ns=new WeakSet,_s="data-bre-row-provider",Qo="data-bre-protocol-cards",Nt="data-bre-protocol-value",Zo="data-bre-protocol-source";function Se(e,t){for(let n of t){let r=Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).find(o=>(o.getAttribute("aria-label")??"").startsWith(n));if(r!==void 0)return r}}function _t(e,t){let n=Se(e,t);if(n===void 0)return;let r=n.closest("label");return r!==null&&r.parentElement!==null?r:n.parentElement??void 0}function Xo(e,t){let n=e;for(;n!==null&&n.parentElement!==t;)n=n.parentElement;return n===null||n===t?void 0:n}function vf(e,t,n){for(let r=t.parentElement;r!==null;r=r.parentElement){if(!r.contains(n)||e!==void 0&&!r.contains(e))continue;let o=Xo(t,r),i=Xo(n,r);if(o===void 0||i===void 0||o===i)continue;let a=e===void 0?void 0:Xo(e,r);return{container:r,protocol:o,url:i,name:a}}}function Ws(e,t){let n=Se(e,t);return n instanceof HTMLSelectElement||n instanceof HTMLInputElement?n.value.trim():""}function xf(e,t){let n=Ws(e,t.apiProtocol);return n==="anthropic-messages"||n==="openai-completions"||n==="openai-responses"||n==="google-generative-ai"?n:void 0}function Be(e,t){let n=xf(e,t);return n===void 0?void 0:vr(n)}function mn(e,t){let n=Ws(e,t.routeId);return n.length>0?n:(e.closest(`[${_s}]`)?.getAttribute(_s)??"").trim()}function Bs(e,t){return e==="anthropic"?t("keysEndpointAnthropic"):e==="openai"?t("keysEndpointOpenAI"):e==="gemini"?t("keysEndpointGemini"):""}function kf(e,t){let n=Se(e,t.modelName),r=Se(e,t.apiProtocol),o=Se(e,t.baseUrl);if(r===void 0||o===void 0)return;let i=vf(n,r,o);if(i===void 0)return;let{container:a,protocol:s,url:d,name:l}=i,u=f=>Array.from(a.children).indexOf(f);if((l===void 0||u(l)<u(s))&&u(s)<u(d)){e.setAttribute(Lr,"1");return}a.insertBefore(s,d),l!==void 0&&a.insertBefore(l,s),e.setAttribute(Lr,"1")}function Gs(e,t){for(let n of Array.from(e.children))if(!(n===t||n.contains(t))&&!n.hasAttribute(Er)&&!n.hasAttribute(fn)&&n instanceof HTMLElement&&(n.textContent??"").trim().length>0)return n}function Sr(e,t){let n=t?"1":"0";e.getAttribute(Ps)!==n&&e.setAttribute(Ps,n)}function Ef(e,t,n){let r=Gs(e,t);if(!n){e.removeAttribute(Tr),r?.removeAttribute(Mr);return}e.setAttribute(Tr,"1"),r?.setAttribute(Mr,"1")}function Us(e,t,n){let r=Se(e,t.baseUrl);if(r===void 0)return;let o=_t(e,t.baseUrl);if(o===void 0)return;let i=Bs(Be(e,t),n),a=o.querySelector(`[${Er}]`);if(a===null&&i.length>0){a=document.createElement("span"),a.setAttribute(Er,"1"),a.className="bre-endpoint-family";let d=r.closest("label");d!==null&&d.contains(r)?d.insertBefore(a,r):o.insertBefore(a,r)}a!==null&&(a.textContent!==i&&(a.textContent=i),a.hidden=i.length===0,Sr(a,r instanceof HTMLInputElement&&r.value.trim().length>0)),Ef(o,r,a!==null&&i.length>0);let s=Be(e,t);s===void 0?o.removeAttribute(pn):o.setAttribute(pn,s)}function Tf(e,t){let n=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set;n===void 0?e.value=t:n.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function js(e,t){for(let n of Array.from(t.querySelectorAll(`[${Nt}]`))){let r=n.getAttribute(Nt)===e.value;n.classList.toggle("is-selected",r),n.setAttribute("aria-checked",r?"true":"false"),n.tabIndex=r?0:-1}}function Mf(e,t,n){let r=Array.from(t.querySelectorAll(`[${Nt}]`)),o=Array.from(e.options).filter(i=>i.value.length>0);return r.length!==o.length?!1:o.every((i,a)=>{let s=r[a];return s!==void 0&&s.getAttribute(Nt)===i.value&&(s.textContent??"")===zs(i.value,(i.textContent??i.value).trim(),n.t)})}var Lf="google-generative-ai",Fs="data-bre-protocol-option";function zs(e,t,n){return e==="openai-completions"?n("keysProtocolShortChat"):e==="openai-responses"?n("keysProtocolShortResponses"):e==="anthropic-messages"?n("keysProtocolShortAnthropic"):e==="google-generative-ai"?n("keysProtocolGemini"):t}function Ks(e,t,n){t.replaceChildren();for(let r of Array.from(e.options)){let o=r.value;if(o.length===0)continue;let i=document.createElement("button");i.type="button",i.className="bre-protocol-card",i.setAttribute("role","radio"),i.setAttribute(Nt,o),i.textContent=zs(o,(r.textContent??o).trim(),n.t),i.title=(r.textContent??o).trim(),i.addEventListener("click",()=>{e.value!==o&&(Tf(e,o),js(e,t))}),t.appendChild(i)}}function Sf(e,t,n){let r=Se(e,t.apiProtocol);if(!(r instanceof HTMLSelectElement))return;let o=_t(e,t.apiProtocol);if(o===void 0)return;let i=r.querySelector(`option[${Fs}]`);i===null&&(i=document.createElement("option"),i.setAttribute(Fs,"1"),i.value=Lf,r.appendChild(i));let a=n.t("keysProtocolGemini");i.textContent!==a&&(i.textContent=a);let s=o.querySelector(`[${Qo}]`);if(s===null){let d=document.createElement("div");s=d,d.setAttribute(Qo,"1"),d.className="bre-protocol-cards",d.setAttribute("role","radiogroup");let l=r.getAttribute("aria-label");l!==null&&d.setAttribute("aria-label",l),r.setAttribute(Zo,"1"),r.after(d),Ks(r,d,n),d.addEventListener("keydown",u=>{let h=u.key==="ArrowRight"||u.key==="ArrowDown"?1:u.key==="ArrowLeft"||u.key==="ArrowUp"?-1:0,f=Array.from(d.querySelectorAll(`[${Nt}]`));if(f.length===0)return;if(u.key==="Home"||u.key==="End"){u.preventDefault();let m=u.key==="Home"?f[0]:f[f.length-1];m?.click(),m?.focus();return}if(h===0)return;u.preventDefault();let c=f.findIndex(m=>m.classList.contains("is-selected")),p=f[(Math.max(c,0)+h+f.length)%f.length];p?.click(),p?.focus()})}else Mf(r,s,n)||Ks(r,s,n);r.hidden=!0,js(r,s)}function $s(e,t,n){let r=e===null?0:e.querySelectorAll(`[${ct}]`).length,o=r===0?"":n.t("keysEndpointsCount",{count:r});if(o.length===0){t.hasAttribute("title")&&t.removeAttribute("title");return}t.getAttribute("title")!==o&&t.setAttribute("title",o)}function Af(e,t,n){let r=e.querySelector(`[${fn}]`);if(_t(e,t.apiProtocol)===void 0){r?.remove(),e.querySelector(`[${qs}]`)?.remove();return}let o=_t(e,t.baseUrl);if(o===void 0)return;let i=Se(e,t.baseUrl);if(i===void 0)return;let a=Gs(o,i);if(a===void 0||a===r)return;let s=()=>e.querySelector(`[${un}]`),d=u=>{let h=n.t("keysMoreEndpoints");u.textContent!==h&&(u.textContent=h);let f=s();u.setAttribute("aria-expanded",f!==null&&!f.hidden?"true":"false"),$s(f,u,n)};if(r!==null){r.parentElement!==a&&a.append(r),d(r);return}let l=document.createElement("button");l.type="button",l.setAttribute(fn,"1"),l.className="bre-endpoint-toggle",l.textContent=n.t("keysMoreEndpoints"),l.addEventListener("click",()=>{let u=s();if(u!==null&&(u.hidden=!u.hidden,d(l),!u.hidden)){let h=mn(e,t);h.length>0&&Of(u,h,n,e,t)}}),a.append(l),d(l)}var Jo=new WeakMap,Hf=1e3,Vs=new WeakMap,ei=0,kr=new Map;function Rf(e,t){ei+=1,typeof CustomEvent=="function"&&document.dispatchEvent(new CustomEvent(cn,{detail:{route:e,openai:t.openai??"",anthropic:t.anthropic??"",gemini:t.gemini??""}}))}function Ar(e){let t=e.getAttribute(ct);return t==="openai"||t==="anthropic"||t==="gemini"?t:void 0}async function Of(e,t,n,r,o){for(let i of Array.from(e.querySelectorAll(`[${ct}]`)))await Ys(i,t,n,r,o)}async function Ys(e,t,n,r,o){let i=e.querySelector(".bre-endpoint-url"),a=Ar(e);if(i===null||a===void 0)return;let s=(Jo.get(e)??0)+1;Jo.set(e,s),Vs.set(e,{at:Date.now(),epoch:ei});let d=n.client??We,l=await Hr(t,d);if(l===void 0||Jo.get(e)!==s||Ar(e)!==a||document.activeElement===i)return;await Xs(r,o,n,t,Be(r,o),l);let u=l[a];i.value!==u&&(i.value=u);let h=e.querySelector(".bre-endpoint-family");h!==null&&Sr(h,u.length>0)}async function Xs(e,t,n,r,o,i,a=!1){if(o===void 0||!a&&i[o].length>0)return;let s=Se(e,t.baseUrl);if(!(s instanceof HTMLInputElement)||document.activeElement===s)return;let d=s.value.trim();if(d.length===0&&!a)return;let l=n.client??We;await ni(r,l,u=>{if(!(!a&&u[o].length>0)&&u[o]!==d)return{openai:o==="openai"?d:u.openai,anthropic:o==="anthropic"?d:u.anthropic,gemini:o==="gemini"?d:u.gemini}})}function ti(e,t,n){let r=_t(e,t.baseUrl);if(r===void 0||r.parentElement===null)return;let o=Be(e,t);if(o===void 0)return;let i=r.querySelector(`:scope > [${un}]`);i===null&&(i=e.querySelector(`[${un}]`),i!==null&&r.appendChild(i)),i===null&&(i=document.createElement("div"),i.setAttribute(un,"1"),i.hidden=!0,r.appendChild(i));for(let d of Rs){if(d===o)continue;let l=i.querySelector(`[${ct}="${d}"]`);l===null&&(l=Cf(e,t,n,d)),i.appendChild(l)}for(let d of Array.from(i.querySelectorAll(`[${ct}]`))){let l=Ar(d);l!==void 0&&l!==o||d.remove()}let a=e.querySelector(`[${fn}]`);a!==null&&(a.setAttribute("aria-expanded",i.hidden?"false":"true"),$s(i,a,n));let s=mn(e,t);if(s.length>0)for(let d of Array.from(i.querySelectorAll(`[${ct}]`))){let l=Vs.get(d);(l===void 0||l.epoch!==ei||Date.now()-l.at>=Hf)&&Ys(d,s,n,e,t)}}function Cf(e,t,n,r){let o=document.createElement("div");o.setAttribute(ct,r),o.className="bre-endpoint-row";let i=document.createElement("span");i.className="bre-endpoint-family",i.textContent=Bs(r,n.t),Sr(i,!1);let a=document.createElement("input");a.type="url",a.className="bre-text-input bre-endpoint-url",a.spellcheck=!1,a.placeholder="https://\u2026";let s=n.client??We;return a.addEventListener("change",()=>{let d=mn(e,t);if(d.length===0)return;let l=a.value.trim();if(l.length>0&&!/^https?:\/\//i.test(l)){a.setAttribute("aria-invalid","true"),a.title=n.t("keysEndpointInvalid");return}a.hasAttribute("aria-invalid")&&a.removeAttribute("aria-invalid"),a.hasAttribute("title")&&a.removeAttribute("title"),Sr(i,l.length>0),(async()=>await ni(d,s,u=>{let h=Ar(o);if(h!==void 0)return{openai:h==="openai"?l:u.openai,anthropic:h==="anthropic"?l:u.anthropic,gemini:h==="gemini"?l:u.gemini}}))()}),o.append(i,a),o}async function Df(e,t,n,r,o){let i=mn(e,t),a=Se(e,t.baseUrl);if(i.length===0||!(a instanceof HTMLInputElement))return;let s=n.client??We,d=await Hr(i,s);if(d===void 0||Be(e,t)!==o)return;let l=a.value.trim();if(l.length>0&&l!==d[r]){let f=await ni(i,s,c=>{if(Be(e,t)===o)return{openai:r==="openai"?l:c.openai,anthropic:r==="anthropic"?l:c.anthropic,gemini:r==="gemini"?l:c.gemini}});if(f===void 0||(d=f,Be(e,t)!==o))return}let u=d[o];if(a.value===u)return;let h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set;h===void 0?a.value=u:h.call(a,u),a.dispatchEvent(new Event("input",{bubbles:!0})),a.dispatchEvent(new Event("change",{bubbles:!0})),ti(e,t,n)}async function ni(e,t,n){let o=(kr.get(e)??Promise.resolve()).then(async()=>{let i=await Hr(e,t);if(i===void 0)return;let a=n(i);if(a===void 0)return;let s=await t.setEndpoints(e,a.openai,a.anthropic,a.gemini);if(!s.ok)return;let d={openai:s.endpoints.openai??"",anthropic:s.endpoints.anthropic??"",gemini:s.endpoints.gemini??""};return Rf(e,s.endpoints),d});kr.set(e,o);try{return await o}finally{kr.get(e)===o&&kr.delete(e)}}async function Hr(e,t){let n=await t.list(e);if(n.ok)return{openai:n.endpoints.openai??"",anthropic:n.endpoints.anthropic??"",gemini:n.endpoints.gemini??""}}function Pf(e,t,n){let r=_t(e,t.baseUrl),o=Be(e,t),i=r?.getAttribute(pn);Us(e,t,n.t),ti(e,t,n),!(r===void 0||i===void 0||o===void 0)&&i!==o&&(i!=="openai"&&i!=="anthropic"&&i!=="gemini"||Df(e,t,n,i,o))}function Js(e,t,n){kf(e,t),Sf(e,t,n),Us(e,t,n.t),Af(e,t,n),ti(e,t,n);let r=Se(e,t.apiProtocol);r instanceof HTMLSelectElement&&!r.hasAttribute(Is)&&(r.setAttribute(Is,"1"),r.addEventListener("change",()=>Pf(e,t,n)));let o=Se(e,t.baseUrl);o instanceof HTMLInputElement&&!Ns.has(o)&&(Ns.add(o),o.addEventListener("change",()=>{let i=mn(e,t),a=Be(e,t);if(i.length===0||a===void 0)return;let s=n.client??We;(async()=>{let d=await Hr(i,s);d!==void 0&&Be(e,t)===a&&await Xs(e,t,n,i,a,d,!0)})()}))}function If(){for(let e of Array.from(document.querySelectorAll(`select[${Zo}]`)))e.hidden=!1,e.removeAttribute(Zo)}function Qs(){If();for(let e of Array.from(document.querySelectorAll(`[${un}], [${ct}], [${fn}], [${qs}], [${Qo}], [${Er}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`[${Lr}], [${Tr}], [${Mr}], [${pn}]`)))e.removeAttribute(Lr),e.removeAttribute(Tr),e.removeAttribute(Mr),e.removeAttribute(pn)}function Ft(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ri="__breLedgerDocument";function ad(){let e=globalThis;return e[ri]??(e[ri]=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`)}var Rr="bre:held-writes:v1";function li(){try{return typeof sessionStorage>"u"?void 0:sessionStorage}catch{return}}function Ge(e){let t=li();if(t!==void 0)try{if(e.pending.size===0&&e.queued.size===0){t.removeItem(Rr);return}let n={document:ad(),committed:[...e.committing].filter(r=>e.queued.has(r)),pending:[...e.pending].map(([r,o])=>[r,[...o]]),queued:[...e.queued].map(([r,o])=>[r,[...o]])};t.setItem(Rr,JSON.stringify(n))}catch{}}function Zs(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(!Array.isArray(r)||r.length!==2)return;let[o,i]=r;if(typeof o!="string"||!Array.isArray(i))return;let a=[];for(let s of i){if(!Array.isArray(s)||s.length!==2)return;let[d,l]=s;if(typeof d!="string"||!F(l)||t!==void 0&&!t(l))return;a.push([d,l])}n.push([o,a])}return n}function Nf(e){let t=li();if(t!==void 0)try{let n=t.getItem(Rr);if(n===null)return;let r=JSON.parse(n);if(r.document!==ad())return;let o=Zs(r.pending),i=Zs(r.queued,zf);if(o===void 0||i===void 0)return;let a=Array.isArray(r.committed)?r.committed.filter(s=>typeof s=="string"):[];for(let[s,d]of o)e.pending.set(s,new Map(d));for(let[s,d]of i)a.includes(s)&&(e.queued.set(s,new Map(d)),e.committing.add(s))}catch{}}function sd(e,t){(async()=>{try{await ci(t,e),await ui(t,e)}catch(n){console.error(`[bre] teardown flush failed: ${n instanceof Error?n.message:String(n)}`)}})()}function dd(e,t){(async()=>{try{await ci(t,e,!0),await ui(t,e,!0)}catch(n){console.error(`[bre] unload flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{try{li()?.removeItem(Rr)}catch{}}})()}function ld(){let e={disposed:!1,mounted:new Map,describePromise:void 0,pending:new Map,missedScans:new Map,queued:new Map,editing:void 0,flushing:!1,flushFailures:0,nextFlushAt:0,committing:new Set,adapting:new Set,signalsUnavailable:!1,submitWired:new WeakSet,cancelWired:new WeakSet,disclosureWired:new WeakSet,editWired:new WeakSet};return Nf(e),e}async function _f(e,t){if(!t.flushing){t.flushing=!0;try{let n=await ci(e,t),r=await ui(e,t);n||r?ed(e,t):(t.flushFailures=0,t.nextFlushAt=0)}catch(n){ed(e,t),console.error(`[bre] idle flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{t.flushing=!1}try{e.onIdle?.()}catch(n){console.error(`[bre] idle hook failed: ${n instanceof Error?n.message:String(n)}`)}}}function ed(e,t){t.flushFailures+=1;let n=Math.min(2**t.flushFailures*500,3e4);t.nextFlushAt=Date.now()+n,e.onBackoff?.(n)}function Ff(e){return e.queued.size>0||e.pending.size>0}function yn(e,t,n,r,o,i,a){try{let s=e.pending.get(t);if(r===void 0){if(s===void 0)return;s.delete(n),s.size===0&&e.pending.delete(t);return}e.pending.set(t,(s??new Map).set(n,{efforts:r,...o===void 0?{}:{compat:o},...i===void 0?{}:{input:i},...a===void 0?{}:{defaultEffort:a}}))}finally{Ge(e)}}function cd(e,t,n,r){e.queued.set(t,(e.queued.get(t)??new Map).set(n,r)),Ge(e)}function Kf(e,t,n){let r=e.pending.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.pending.delete(t),Ge(e))}function qf(e,t,n){let r=e.queued.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.queued.delete(t),Ge(e))}function Wf(e,t,n){Kf(e,t,n),qf(e,t,n)}function Bf(e,t){e.queued.delete(t),e.pending.delete(t),e.missedScans.delete(t),e.committing.delete(t),Ge(e)}function Gf(e,t,n){if(t===void 0)return null;let i=t[Te]!==!0&&t.reasoningEfforts!==void 0&&typeof t[Ht]=="number"||t[Te]!==!0&&n?.efforts!==void 0&&Uf(t.reasoningEfforts,n.efforts)?!1:t.reasoningEfforts!==void 0||t[Te]===!0||e.efforts==="keep",s=t[Ye]!==!0&&n?.input!==void 0&&jf(t.input,n.input)?!1:Array.isArray(t.input)&&t.input.length>0||t[Ye]===!0,d=i?"keep":e.efforts,l=s?void 0:e.input,u=e.defaultEffort;return d==="keep"&&l===void 0&&u===void 0?null:{efforts:d,...e.compat===void 0?{}:{compat:e.compat},...l===void 0?{}:{input:l},...u===void 0?{}:{defaultEffort:u}}}function Uf(e,t){if(e===t)return!0;if(!F(e)||!F(t))return!1;let n=Object.keys(t);if(Object.keys(e).length!==n.length)return!1;let r=t;return n.every(o=>e[o]===r[o])}function jf(e,t){if(!Array.isArray(e)||e.length!==t.length)return!1;let n=new Set(t);return e.every(r=>typeof r=="string"&&n.has(r))}function zf(e){if(!F(e))return!1;let t=e.efforts;return t===!1||t==="keep"||F(t)}async function $f(e,t,n,r,o=!1){let i=await e.describeNamespace(),a=ye(i.namespace),s=[];for(let[h,f]of[...r]){let c=Xn(a,n).find(E=>E.id===h);if(c===void 0||t.pending.get(n)?.get(h)!==f)continue;let p=yt(a,n),m=typeof c.name=="string"?c.name:void 0,b=Fe(h,m===void 0?p:{...p,displayName:m}),M=Gf(f,c,{...b.efforts===void 0?{}:{efforts:b.efforts},...b.input===void 0?{}:{input:b.input}});if(M===null){yn(t,n,h,void 0);continue}s.push({modelId:h,efforts:M.efforts,...M.compat===void 0?{}:{compat:M.compat},...M.input===void 0?{}:{input:M.input},...M.defaultEffort===void 0?{}:{defaultEffort:M.defaultEffort}})}if(s.length===0)return!1;let d=!1,l=await rn(e.api,n,s,()=>d?e.describeNamespace():(d=!0,Promise.resolve(i)),o?void 0:Ld),u=!1;return s.forEach((h,f)=>{let c=l[f];if(c?.aborted!==!0){if(c?.ok===!0||c?.modelNotFound===!0){yn(t,n,h.modelId,void 0);return}u=!0,console.error(`[bre] staged flush write failed for "${n}"/"${h.modelId}": ${c?.error??"unknown"}`)}}),u}async function ci(e,t,n=!1){for(let a of[...t.committing])t.queued.has(a)||t.committing.delete(a);if(![...t.queued.keys()].some(a=>t.committing.has(a)||t.signalsUnavailable)||(await e.describeNamespace()).writable!==!0)return Ge(t),!1;let i=!1;for(let[a,s]of[...t.queued]){if(!t.committing.has(a)&&!t.signalsUnavailable)continue;let l=[...s].map(([f,c])=>({modelId:f,efforts:c.efforts,...c.compat===void 0?{}:{compat:c.compat},...c.input===void 0?{}:{input:c.input},...c.defaultEffort===void 0?{}:{defaultEffort:c.defaultEffort}})),u=await rn(e.api,a,l,void 0,n?void 0:Ld),h=!1;l.forEach((f,c)=>{let p=u[c];if(p?.aborted===!0){h=!0;return}if(p?.ok===!0||p?.modelNotFound===!0){s.delete(f.modelId);return}console.error(`[bre] held write failed for "${a}"/"${f.modelId}": ${p?.error??"unknown"}`)}),s.size===0?(t.queued.delete(a),t.committing.delete(a)):h||(i=!0)}return Ge(t),i}async function ui(e,t,n=!1){if(t.pending.size===0)return!1;let r=await e.describeNamespace();if(r.writable!==!0)return!1;let o=ye(r.namespace),i=!1;for(let[a,s]of[...t.pending]){if(s.size===0){t.pending.delete(a);continue}Ft(o,a)&&await $f(e,t,a,s,n)&&(i=!0)}return Ge(t),i}function we(e,t){for(let n of t){let r=Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).find(o=>(o.getAttribute("aria-label")??"").startsWith(n));if(r!==void 0&&r.value.trim().length>0)return r.value.trim()}return""}function wn(e){return e.closest('[class*="editor"], [class*="rowCard"], [class*="addCard"]')??void 0}function Vf(e){let t=e.closest('[class*="modelEntry"]');if(t===null){let r=wn(e);if(r===void 0)return;let o=Array.from(r.querySelectorAll('[class*="modelAdvanced"]'));return o.find(i=>i.offsetParent!==null)??o[0]}let n=Array.from(t.querySelectorAll('[class*="modelAdvanced"]'));return n.find(r=>r.offsetParent!==null)??n[0]}function ud(e,t){return Array.from(e.querySelectorAll("button[aria-label]")).find(n=>t.some(r=>(n.getAttribute("aria-label")??"").startsWith(r)))}function td(){return new Promise(e=>{if(typeof window.requestAnimationFrame!="function"){e();return}let t,n=()=>{window.clearTimeout(r),t!==void 0&&window.cancelAnimationFrame(t),e()},r=window.setTimeout(n,100);t=window.requestAnimationFrame(n)})}function hn(e){return e.querySelector('[class*="modelInputTypes"]')!==null}var Yf="modelReasoning",ii="data-bre-reasoning-hidden";function fd(e){return e.querySelector(`[class*="${Yf}"]`)??void 0}function fi(e){let t=fd(e);t!==void 0&&t.style.display!=="none"&&(t.setAttribute(ii,"1"),t.style.display="none")}function gn(e){let t=fd(e);t!==void 0&&t.getAttribute(ii)==="1"&&(t.removeAttribute(ii),t.style.display==="none"&&(t.style.display=""))}function pd(e,t){let n=e.querySelector('[class*="modelInputTypes"]');if(n===null)return;let r=Array.from(n.querySelectorAll('input[type="checkbox"]')),o=r.find(i=>{let a=i.closest("label")?.textContent?.trim();return a!==void 0&&t.includes(a)});return o!==void 0?o:r.length===2?r[1]:void 0}function vn(e,t,n){let r=pd(e,n);return r===void 0||r.disabled?!1:(r.checked!==t&&r.click(),!0)}function ai(e,t,n){return t==null||e===void 0?t:vn(e,t.includes("image"),n)?void 0:t}function nd(e,t){let n=e.getAttribute("aria-label")??"";if(t.some(o=>n.startsWith(o)))return!0;let r=e.closest("label")?.textContent?.trim()??"";return r.length>0&&t.some(o=>r.includes(o))}function pi(e,t){let n=[...t.modelId,...t.modelName],r=Array.from(e.querySelectorAll("input")).filter(s=>s.type!=="checkbox"&&s.type!=="radio").filter(s=>s.closest("[data-plugin]")===null).filter(s=>!n.some(d=>(s.getAttribute("aria-label")??"").startsWith(d))),o=r.find(s=>nd(s,t.contextWindow)),i=r.find(s=>nd(s,t.maxOutput));if(o!==void 0&&i!==void 0)return{contextWindow:o,maxOutput:i};let a=r.filter(s=>s!==o&&s!==i);return{contextWindow:o??a[0],maxOutput:i??(o!==void 0?a[0]:a[1])}}function md(e,t,n){let r=pi(e,t),o=(i,a)=>i===void 0||i.disabled||a===void 0||!Number.isFinite(a)||a<=0||Number(i.value)>0?!1:hd(i,String(a));return{contextWindow:o(r.contextWindow,n.contextWindow),maxOutput:o(r.maxOutput,n.maxTokens)}}function hd(e,t){return e.disabled?!1:(e.value===t||(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set?.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))),!0)}function Xf(e,t){let n=pi(e,t),r=a=>{if(a===void 0)return;let s=a.value.replace(/[^\d]/g,"");if(s==="")return;let d=Number(s);return Number.isFinite(d)&&d>0?d:void 0},o=r(n.contextWindow),i=r(n.maxOutput);return{...o===void 0?{}:{contextWindow:o},...i===void 0?{}:{maxTokens:i}}}function Jf(e,t,n){let r=pi(e,t),o=(i,a)=>i===void 0?!1:hd(i,a===void 0||!Number.isFinite(a)||a<=0?"":String(a));return{contextWindow:"contextWindow"in n?o(r.contextWindow,n.contextWindow):!1,maxOutput:"maxTokens"in n?o(r.maxOutput,n.maxTokens):!1}}async function Qf(e,t,n){if(e===void 0)return!1;let r=t.inputImage;if(hn(e))return vn(e,!0,r);let o=e.closest('[class*="modelEntry"]')??e;if(o.querySelector('[class*="modelAdvanced"]')!==null)return!1;let i=ud(o,t.capacity);if(i===void 0||i.disabled)return!1;i.click(),hn(o)||await n();try{return hn(o)&&vn(o,!0,r)}finally{i.click()}}async function Zf(e,t,n,r){if(e.matches('[class*="modelAdvanced"]'))return r(e);let o=e.closest('[class*="modelEntry"]')??e;if(o.querySelector('[class*="modelAdvanced"]')!==null)return r(o);let i=ud(o,t.capacity);if(i===void 0||i.disabled)return!1;i.click(),o.querySelector('[class*="modelAdvanced"]')===null&&await n();try{return o.querySelector('[class*="modelAdvanced"]')!==null?r(o):!1}finally{i.click()}}function ep(e,t,n,r,o){n.disposed||!e.isConnected||hi(e)===void 0||Array.from(e.querySelectorAll("button[aria-label]")).some(a=>o.capacity.some(s=>(a.getAttribute("aria-label")??"").startsWith(s)))||ur(e,tp(e,ye(r.namespace),o),{t:t.t,onRequest:a=>gd(n,t,a)})}function tp(e,t,n){let r=[];for(let o of Uo(e)){let i=wn(o);if(i===void 0)continue;let a=Je(i,t,n);a===void 0||a.staged||r.push({catalogue:o,route:a.route})}return r}function np(e,t,n){let r=[],o=new Set;for(let i of e){if(o.has(i.card))continue;o.add(i.card);let a=Je(i.card,t,n);if(a===void 0)continue;let[s]=Uo(i.card);s!==void 0&&r.push({catalogue:s,route:a.route})}return r}function rp(e,t,n,r){let o=[],i=new Set;for(let a of r.capacity){let s=Array.from(e.querySelectorAll("button[aria-label]")).filter(d=>(d.getAttribute("aria-label")??"").startsWith(a));for(let d of s){let l=wn(d);if(l===void 0)continue;let u=d.closest('[class*="modelEntry"]')??l,h=we(u,r.modelId);h.length===0||i.has(h)||Je(l,n,r)?.route===t&&(i.add(h),o.push({id:h,name:we(u,r.modelName),row:u}))}}return o}async function gd(e,t,n,r=[]){if(n.length===0)return{held:0,unsuggested:0,blocked:"unknown-route"};if(e.adapting.has(n))return{held:0,unsuggested:0,blocked:"busy"};e.adapting.add(n);let o=0,i=0;try{let a,s=()=>a??(a=t.describeNamespace()),d=await s(),l=ye(d.namespace);if(d.writable!==!0)return{held:0,unsuggested:0,blocked:"unwritable"};if(!Ft(l,n)&&r.length===0)return{held:0,unsuggested:0,blocked:"unknown-route"};let h=Xn(l,n),f=new Set;for(let L of h){let H=typeof L.id=="string"?L.id:"";H.length>0&&f.add(H)}let c=h.slice();for(let L of r)L.id.length===0||f.has(L.id)||c.push({id:L.id,name:L.name});if(c.length===0)return{held:0,unsuggested:0,blocked:"no-models"};let p=l[n]??{},m=typeof p.api=="string"?p.api:void 0,b=new Set,M=new Map;for(let[L,H]of e.mounted)H.props.route===n&&(M.set(H.props.modelId,L),H.props.efforts!==void 0&&b.add(H.props.modelId));let E=new Map;for(let L of r)L.row!==void 0&&E.set(L.id,L.row);let v=!1,D=(L,H)=>ai(M.get(L),H,t.labels().inputImage),I=async(L,H)=>{if(H.image!==!0)return!1;let w=M.get(L)??E.get(L);return w===void 0?!1:Qf(w,t.labels(),td)},P=async(L,H,w)=>{let R=H.image===!0,N=w.contextWindow!==void 0||w.maxTokens!==void 0;if(!R&&!N)return!1;let K=M.get(L)??E.get(L);if(K===void 0)return!1;let W=t.labels();return Zf(K,W,td,q=>{let oe=R&&hn(q)&&vn(q,!0,W.inputImage),j=N?md(q,W,w):{contextWindow:!1,maxOutput:!1};return{modality:oe,capacities:j.contextWindow||j.maxOutput}})},Z=rr(t.api,s,(L,H,w,R,N,K)=>{yn(e,L,H,w,R,D(H,N),K)},(L,H,w)=>{cd(e,L,H,{...w,input:D(H,w.input)})},void 0,()=>v);for(let L of c){let H=typeof L.id=="string"?L.id:"";if(H.length===0)continue;let w=Qn(c,H),R=Zn(c,H),N=w!==void 0||L[Te]===!0,K=Array.isArray(R)&&R.length>0||L[Ye]===!0;if(b.has(H)&&!N)continue;if(N&&K){let pe=M.get(H)??E.get(H);if(Array.isArray(R)&&R.includes("image")&&pe!==void 0){let x=t.labels().inputImage,A=pd(pe,x);A!==void 0&&!A.disabled&&!A.checked&&vn(pe,!0,x)}continue}let W=er(c,H),q=nr(c,H)??"",oe=await Z.suggest(n,H,tr(c,H));if(!oe.ok){i+=1;continue}let j=oe.suggestion,X=j.efforts!==!1,z=j.input===void 0?vt(R):vt(j.input);if(N){if(!z.image||e.queued.get(n)?.has(H)===!0)continue;if(await I(H,z)){o+=1;continue}v=!f.has(H),Z.commit(n,H,lr({efforts:"keep",input:dr(z)})),v&&t.onPendingChanged?.(),v=!1,o+=1;continue}let ee=j.defaultEffort??q,G=ee===q?void 0:ee===""?null:ee;v=!f.has(H);let ie=await P(H,z,{...j.contextWindow===void 0?{}:{contextWindow:j.contextWindow},...j.maxTokens===void 0?{}:{maxTokens:j.maxTokens}}),ae=ie!==!1&&ie.modality;Z.commit(n,H,lr({efforts:Bo(X,It(wt(j.efforts)),w),input:ae||sr(z,R)?void 0:dr(z),defaultEffort:G,appliedCompat:j.compat,routeApi:m,initialCompat:W})),v&&t.onPendingChanged?.(),v=!1,o+=1}return{held:o,unsuggested:i}}catch(a){return console.warn("[bre] provider-wide adapt failed:",a),{held:o,unsuggested:i,failed:a instanceof Error?a.message:String(a)}}finally{e.adapting.delete(n)}}function op(e){return e.querySelector(`[data-plugin="${ue}"]`)!==null}function ip(e,t){return e.route===t.route&&e.routeDisplayName===t.routeDisplayName&&e.routeApi===t.routeApi&&e.routeBaseURL===t.routeBaseURL&&e.modelId===t.modelId&&e.modelName===t.modelName&&e.index===t.index&&e.readOnly===t.readOnly&&e.defaultEffort===t.defaultEffort&&e.staged===t.staged&&e.officialInputTypes===t.officialInputTypes&&e.effortsUnset===t.effortsUnset&&sn(e.efforts,t.efforts)&&sp(e.input,t.input)&&ap(e.compat,t.compat)}function ap(e,t){return e===t?!0:e===void 0||t===void 0?!1:JSON.stringify({...e},Object.keys({...e,...t}).sort())===JSON.stringify({...t},Object.keys({...e,...t}).sort())}function sp(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=new Set(e);return e.length===t.length&&t.every(r=>n.has(r))}function si(e,t){return Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).some(n=>t.some(r=>(n.getAttribute("aria-label")??"").startsWith(r)))}function Je(e,t,n){let r=e.querySelector('[class*="editorRoute"]')?.textContent?.trim();if(r!==void 0&&r.length>0&&Ft(t,r))return{route:r,staged:!1};if(si(e,n.routeId)){let a=we(e,n.routeId);return a.length>0&&!Ft(t,a)?{route:a,staged:!0}:void 0}let o=e.querySelector('[class*="editorTitle"], [class*="rowName"]')?.textContent?.trim();if(o===void 0||o.length===0)return;let i=Object.entries(t).find(([,a])=>a.displayName===o);if(i!==void 0)return{route:i[0],staged:!1};if(Ft(t,o))return{route:o,staged:!1}}function dp(e,t){let n=e.querySelector('[class*="editorActions"]');if(n===null)return;let r=Array.from(n.querySelectorAll("button"));if(r.length<2)return;let o=(h,f)=>(h.textContent??"").trim()===f,i=n.querySelector('[class*="primaryButton"]'),a=n.querySelector('[class*="secondaryButton"]');if(i!==null&&a!==null)return{submit:i,cancel:a};let s=[...r].reverse().find(h=>t.apply.some(f=>o(h,f))),d=[...r].reverse().find(h=>t.cancel.some(f=>o(h,f)));if(s!==void 0&&d!==void 0)return{submit:s,cancel:d};let l=r[r.length-1],u=r[r.length-2];if(!(l===void 0||u===void 0))return{submit:l,cancel:u}}function Or(e,t,n){t.has(e)||(t.add(e),e.addEventListener("click",n,{capture:!0}))}var oi=new WeakMap,di=new Set;function bd(){for(let e of Array.from(di))e.release()}var mi=420,lp=320,cp=160,rd=2e3,up=150,yd=new Set(["PageUp","PageDown","Home","End","ArrowUp","ArrowDown"," "]);function Dr(e,t){let n=Yo(e),r=n[0];if(r===void 0||!e.isConnected)return;let o=performance.now(),i=oi.get(r);if(i!==void 0){i.deadline=Math.min(Math.max(i.deadline,o+t),i.startedAt+rd);return}let a=e.getBoundingClientRect(),s=a.top,d=a.height,l=new Map,u=new Map;for(let E of n)l.set(E,E.scrollTop),u.set(E,E.style.overflowAnchor),E.style.overflowAnchor="none";let h=new Set(n),f={deadline:o+t,startedAt:o,frame:void 0,release:()=>{}},c=()=>{if(di.delete(f)){f.frame!==void 0&&(window.cancelAnimationFrame(f.frame),f.frame=void 0);for(let[E,v]of u)E.style.overflowAnchor=v;oi.delete(r),document.removeEventListener("wheel",p,!0),document.removeEventListener("touchstart",p,!0),document.removeEventListener("pointerdown",p,!0),document.removeEventListener("keydown",m,!0)}};function p(){c()}function m(E){yd.has(E.key)&&c()}f.release=c,oi.set(r,f),di.add(f),document.addEventListener("wheel",p,{capture:!0,passive:!0}),document.addEventListener("touchstart",p,{capture:!0,passive:!0}),document.addEventListener("pointerdown",p,{capture:!0}),document.addEventListener("keydown",m,{capture:!0});let b=0,M=()=>{if(f.frame=void 0,b+=1,!e.isConnected||b>=up){c();return}let E=e.getBoundingClientRect(),v=Math.abs(E.height-d)>.5;if(!v&&[...h].some(P=>P.scrollTop!==l.get(P))){c();return}let D=E.top-s;D!==0&&fp(n,h,l,D);let I=performance.now();if(v&&(d=E.height,f.deadline=Math.min(Math.max(f.deadline,I+cp),f.startedAt+rd)),I>=f.deadline){c();return}f.frame=window.requestAnimationFrame(M)};f.frame=window.requestAnimationFrame(M)}function fp(e,t,n,r){let o=r;for(let i of[...t,...e]){if(o===0)break;let a=i.scrollTop;if(a!==n.get(i))continue;i.scrollTop=a+o;let s=i.scrollTop;s!==a&&(n.set(i,s),t.add(i),o-=s-a)}}var wd='[class*="modelList"]',pp="bre-list-slack",mp=3e3,Pr,Kt=new WeakMap,qt=new Set;function vd(e){if(!(e instanceof Element))return;let t=e.closest(wd);if(t===null)return;let n=Yo(t).map(r=>({host:r,top:r.scrollTop}));n.length!==0&&(Pr={targets:n,at:performance.now()})}function Qe(){Pr=void 0}function xd(e){vd(e.target)}function kd(e){if(yd.has(e.key)){Qe();return}vd(e.target)}var bn=0;function Ed(){bn+=1,!(bn>1)&&(document.addEventListener("click",xd,!0),document.addEventListener("keydown",kd,!0),document.addEventListener("focusin",Qe,!0),document.addEventListener("pointerdown",Qe,!0),document.addEventListener("wheel",Qe,{capture:!0,passive:!0}),document.addEventListener("touchstart",Qe,{capture:!0,passive:!0}))}function Cr(e){let t=Kt.get(e);t!==void 0&&(Kt.delete(e),qt.delete(t),t.scrollTarget.removeEventListener("scroll",t.onScroll),t.spacer.remove())}function hp(e){return e===document.scrollingElement?document:e}function gp(){if(qt.size!==0)for(let e of Array.from(qt)){let t=e.host;if(!e.spacer.isConnected){Kt.delete(t),qt.delete(e),e.scrollTarget.removeEventListener("scroll",e.onScroll);continue}t.scrollTop<=t.scrollHeight-t.clientHeight-e.height&&Cr(t)}}function od(e,t){return e.scrollTop>e.scrollHeight-e.clientHeight-t}function bp(e=performance.now()){let t=Pr;if(!(t===void 0||e-t.at>mp))for(let n of t.targets){let r=n.host;if(!r.isConnected)continue;let o=Kt.get(r),i=o===void 0?0:o.height,a=r.scrollHeight-r.clientHeight-i,s=n.top-a;if(s<=0){o!==void 0&&!od(r,o.height)&&Cr(r);continue}let d=o;if(d===void 0){let l=document.createElement("div");l.className=pp,l.dataset.plugin=ue,l.setAttribute("aria-hidden","true"),l.style.height="0px",(r===document.scrollingElement?document.body??r:r).appendChild(l);let h=()=>{let f=Kt.get(r);f!==void 0&&!od(r,f.height)&&Cr(r)};d={host:r,spacer:l,height:0,onScroll:h,scrollTarget:hp(r)},Kt.set(r,d),qt.add(d),d.scrollTarget.addEventListener("scroll",h,{passive:!0})}d.height!==s&&(d.height=s,d.spacer.style.height=`${s}px`),r.scrollTop!==n.top&&(r.scrollTop=n.top)}}function Td(){if(bn=Math.max(0,bn-1),!(bn>0)){document.removeEventListener("click",xd,!0),document.removeEventListener("keydown",kd,!0),document.removeEventListener("focusin",Qe,!0),document.removeEventListener("pointerdown",Qe,!0),document.removeEventListener("wheel",Qe,!0),document.removeEventListener("touchstart",Qe,!0),Pr=void 0;for(let e of Array.from(qt))Cr(e.host)}}function Md(e,t=mi){bp(),gp();let n=new Set;for(let r of Array.from(e.querySelectorAll(wd))){let o=r.closest('[class*="rowCard"], [class*="setupCard"], [class*="addCard"]');o===null||n.has(o)||(n.add(o),Dr(o,t))}}function yp(e,t){Or(e,t,()=>{let n=e.closest('[class*="modelEntry"]')??e.closest('[class*="rowCard"]');n!==null&&Dr(e.closest('[class*="rowCard"]')??n,mi)})}var id="{provider}";function wp(e,t){let n=t.editProvider.map(o=>{let i=o.indexOf(id);return i<0?void 0:{prefix:o.slice(0,i),suffix:o.slice(i+id.length)}}).filter(o=>o!==void 0);if(n.length===0)return[];let r=[];for(let o of Array.from(e.querySelectorAll("button[aria-label]"))){let i=o.getAttribute("aria-label")??"";n.some(a=>i.length>a.prefix.length+a.suffix.length&&i.startsWith(a.prefix)&&i.endsWith(a.suffix))&&o.closest("[data-plugin]")===null&&r.push(o)}return r}function vp(e,t){Or(e,t,()=>{let n=e.closest('[class*="rowCard"], [class*="setupCard"], [class*="addCard"]');n!==null&&Dr(n,mi)})}function hi(e){return e.querySelector('[class*="editorActions"]')??e.querySelector('[class*="modelEntry"]')??void 0}function Ld(){return hi(Ke())!==void 0}function xp(e,t,n){let r={routeId:t.routeId,modelName:t.modelName,baseUrl:t.baseUrl,apiProtocol:t.apiProtocol},o=new Set;for(let i of Array.from(e.querySelectorAll('[class*="editor"], [class*="addCard"], [class*="rowCard"]')))si(i,t.apiProtocol)&&si(i,t.baseUrl)&&o.add(i);for(let i of o)Js(i,r,{t:n})}function Sd(e,t,n){if(n.disposed||!e.isConnected)return;let r=t.labels(),o=hi(e)!==void 0;for(let s of Array.from(e.querySelectorAll('[class*="rowCard"], [class*="setupCard"]')))for(let d of wp(s,r))vp(d,n.editWired);xp(e,r,t.t);let i=Array.from(e.querySelectorAll("button[aria-label]")).some(s=>r.capacity.some(d=>(s.getAttribute("aria-label")??"").startsWith(d)));if(!o){if(ur(e,[],{t:t.t}),n.mounted.size>0){for(let[d,l]of n.mounted)gn(d),l.editor.unmount();n.mounted.clear()}let s=n.editing;n.editing=!1,(s!==!1||Ff(n)&&Date.now()>=n.nextFlushAt)&&_f(t,n).catch(d=>{console.error(`[bre] idle pass failed: ${d instanceof Error?d.message:String(d)}`)});return}if(n.editing=!0,!i){for(let[d,l]of n.mounted)gn(d),l.editor.unmount();n.mounted.clear(),n.describePromise??(n.describePromise=t.describeNamespace());let s=r;n.describePromise.then(d=>{ep(e,t,n,d,s)}).catch(d=>{n.describePromise=void 0,console.error(`[bre] empty-catalog seat failed: ${d instanceof Error?d.message:String(d)}`)});return}for(let s of r.capacity)for(let d of Array.from(e.querySelectorAll("button[aria-label]")))(d.getAttribute("aria-label")??"").startsWith(s)&&yp(d,n.disclosureWired);n.describePromise??(n.describePromise=t.describeNamespace());let a=s=>{if(n.disposed||!e.isConnected)return;let d=s.namespace,l=ye(d),u=[];for(let f of r.capacity){let c=Array.from(e.querySelectorAll("button[aria-label]")).filter(p=>(p.getAttribute("aria-label")??"").startsWith(f));for(let p of c){let m=wn(p);if(m===void 0)continue;let b=p.closest('[class*="modelEntry"]')??m,M=we(b,r.modelId);M.length!==0&&u.push({container:Vf(p),row:b,modelId:M,card:m})}}ur(e,np(u,l,r),{t:t.t,onRequest:f=>gd(n,t,f,rp(e,f,l,r))});for(let[f,c]of n.mounted)u.some(p=>p.container===f)||(gn(f),c.editor.unmount(),n.mounted.delete(f));if(n.pending.size>0){let f=new Map;for(let p of u){let m=Je(p.card,l,r);if(m===void 0)continue;let b=f.get(m.route);b===void 0&&f.set(m.route,b=new Set),b.add(p.modelId)}let c=new Map;for(let[p,m]of n.pending){if(!Ft(l,p))continue;let b=f.get(p),M=[...m.keys()].filter(E=>!b?.has(E));M.length>0&&c.set(p,new Set(M))}for(let[p,m]of c){let b=n.missedScans.get(p);if(b!==void 0)for(let M of m)b.has(M)&&(yn(n,p,M,void 0),b.delete(M),m.delete(M))}n.missedScans=c}else n.missedScans=new Map;let h=new Set(u.map(f=>f.card));for(let f of h){let c=Je(f,l,r);if(c===void 0)continue;let p=c.route,m=dp(f,r);m===void 0?n.signalsUnavailable=!0:(n.signalsUnavailable=!1,Or(m.submit,n.submitWired,()=>{let b=Je(f,l,r)?.route??p;n.committing.add(b),Ge(n)}),Or(m.cancel,n.cancelWired,()=>{let b=Je(f,l,r)?.route??p;Bf(n,b)}))}u.forEach((f,c)=>{let p=f.container;if(p===void 0)return;let m=Je(f.card,l,r);if(m===void 0)return;let{route:b,staged:M}=m,E=l[b]??{},v=Xn(l,b),D=new Set(v.map(G=>G.id)),I=M||!D.has(f.modelId),P=I?n.pending.get(b)?.get(f.modelId)?.efforts:void 0,Z=I?P==="keep"?void 0:P:Qn(v,f.modelId),L=!I&&v.some(G=>G.id===f.modelId&&G[Te]===!0),H=I?n.pending.get(b)?.get(f.modelId)?.input:Zn(v,f.modelId),w=I?n.pending.get(b)?.get(f.modelId)?.compat:er(v,f.modelId),R=I?n.pending.get(b)?.get(f.modelId)?.defaultEffort??void 0:nr(v,f.modelId),N=I?we(f.row,r.modelName):"",K=I?N.length>0?N:void 0:tr(v,f.modelId),W=M?we(f.card,r.apiProtocol):"",q=M?we(f.card,r.baseUrl):"",oe=M&&W.length>0?W:typeof E.api=="string"?E.api:void 0,j=M&&q.length>0?q:typeof E.baseURL=="string"?E.baseURL:void 0,X={route:b,routeDisplayName:M?b:typeof E.displayName=="string"?E.displayName:b,...oe===void 0?{}:{routeApi:oe},...j===void 0?{}:{routeBaseURL:j},modelId:f.modelId,...K===void 0?{}:{modelName:K},...Z===void 0?{}:{efforts:Z},...L?{effortsUnset:L}:{},...H===void 0?{}:{input:H},...w===void 0?{}:{compat:w},...R===void 0?{}:{defaultEffort:R},index:c,staged:I,officialInputTypes:hn(p),api:{...rr(t.api,void 0,(G,ie,ae,pe,x,A)=>{yn(n,G,ie,ae,pe,ai(p,x,r.inputImage),A)},(G,ie,ae)=>{cd(n,G,ie,{...ae,input:ai(p,ae.input,r.inputImage)})},G=>{Wf(n,G,f.modelId)},()=>(Je(f.card,l,r)?.staged??M)||!D.has(f.modelId)),fillCapacities:(G,ie)=>{md(p,r,{...G===void 0?{}:{contextWindow:G},...ie===void 0?{}:{maxTokens:ie}})},readCapacities:()=>Xf(p,r),setCapacities:G=>{Jf(p,r,G)}},readOnly:s.writable!==!0,t:t.t};fi(p);let z=n.mounted.get(p);if(z!==void 0){ip(z.props,X)||(z.props=X,z.editor.render(X));return}if(op(p))return;Dr(wn(p)??f.card,lp);let ee=t.mount(p,X);n.mounted.set(p,{editor:ee,props:X})})};n.describePromise.then(a,()=>{n.describePromise=void 0}).catch(s=>{console.error(`[bre] editor reconcile failed: ${s instanceof Error?s.message:String(s)}`)})}function Y(e,t,n){e.getAttribute(t)!==n&&e.setAttribute(t,n)}function xn(e,t){e!==void 0&&e.hidden!==t&&(e.hidden=t)}function ge(e,t,n){e.classList.contains(t)!==n&&(n?e.classList.add(t):e.classList.remove(t))}function Ir(e,t){e!==void 0&&e.textContent!==t&&(e.textContent=t)}var gi=require("react");var se=require("react");var Ae=require("react"),Rd=require("react-dom"),Ue=require("react/jsx-runtime"),Ad=6,kp=292,Nr=8,Ep=52;function Hd(e,t){let n=e.getBoundingClientRect(),r=t*Ep+46,o=window.innerWidth||0,i=window.innerHeight||0,a=Math.max(Nr,Math.min(n.left,o-kp-Nr)),s=n.bottom+Ad,d=n.top-Ad-r,l=i>0&&s+r>i-Nr&&d>Nr?d:s;return{left:a,top:l}}function Od(e){let{anchor:t,label:n,options:r,selected:o,onPick:i,onClose:a}=e,[s,d]=(0,Ae.useState)(()=>Hd(t,r.length)),l=(0,Ae.useRef)(null),u=(0,Ae.useRef)([]);(0,Ae.useLayoutEffect)(()=>{let c=()=>{d(Hd(t,r.length))};return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[t,r.length]),(0,Ae.useEffect)(()=>{let c=Math.max(0,r.findIndex(p=>p.value===o));u.current[c]?.focus()},[r,o]),(0,Ae.useEffect)(()=>{let c=p=>{let m=p.target;m instanceof Node&&l.current?.contains(m)!==!0&&(t.contains(m)||a())};return document.addEventListener("pointerdown",c,!0),()=>{document.removeEventListener("pointerdown",c,!0)}},[t,a]);let h=(0,Ae.useCallback)(c=>{if(r.length===0)return;let p=(c+r.length)%r.length;u.current[p]?.focus()},[r.length]),f=c=>{let p=u.current.findIndex(m=>m===document.activeElement);if(c.key==="Escape"){c.preventDefault(),c.stopPropagation(),a();return}if(c.key==="ArrowDown"){c.preventDefault(),h(p+1);return}if(c.key==="ArrowUp"){c.preventDefault(),h(p<0?r.length-1:p-1);return}if(c.key==="Home"){c.preventDefault(),h(0);return}c.key==="End"&&(c.preventDefault(),h(r.length-1))};return(0,Rd.createPortal)((0,Ue.jsxs)("div",{ref:l,className:"bre-protocol-menu",style:{left:s.left,top:s.top},onKeyDown:f,children:[(0,Ue.jsx)("p",{className:"bre-protocol-menu-title",children:n}),(0,Ue.jsx)("ul",{className:"bre-protocol-menu-list",role:"listbox","aria-label":n,children:r.map((c,p)=>{let m=c.value===o;return(0,Ue.jsx)("li",{children:(0,Ue.jsx)("button",{ref:b=>{u.current[p]=b},type:"button",role:"option","aria-selected":m,"aria-checked":m,"data-protocol-value":c.value,className:"bre-protocol-option",tabIndex:-1,onClick:()=>{i(c.value)},children:(0,Ue.jsxs)("span",{className:"bre-protocol-option-text",children:[(0,Ue.jsx)("span",{className:"bre-protocol-option-title",children:c.title}),(0,Ue.jsx)("span",{className:"bre-protocol-option-hint",children:c.hint})]})})},c.value)})})]}),document.body)}var C=require("react/jsx-runtime"),Tp=["M8 3.9v8.2","M3.9 8h8.2"],Mp="M3.9 8.35 6.6 11.05 12.1 5.5";function Cd({paths:e}){return(0,C.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e.map(t=>(0,C.jsx)("path",{d:t},t))})}function Lp(e,t){return e.masked!==void 0?e.masked:e.configured===!1?t("keysMissing"):"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}function Dd(e){return e.alias??e.masked??e.ref}function Sp(e,t){return e.models===void 0?t("keysScopeAll"):e.models.length===0?t("keysScopeNone"):t("keysScopeCount",{count:e.models.length})}var Nd=["openai-completions","openai-responses","anthropic-messages","google-generative-ai"],Ap={openai:null,anthropic:null,gemini:null},Pd=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function Hp(e,t){return Nd.filter(n=>n===t?!0:(e[vr(n)]??"").length>0)}function _d(e,t){return t(e==="anthropic-messages"?"keysProtocolAnthropic":e==="openai-responses"?"keysProtocolResponses":e==="openai-completions"?"keysProtocolOpenAI":e==="google-generative-ai"?"keysProtocolGemini":"keysProtocolDefault")}function Rp(e,t){return t(e==="anthropic-messages"?"keysProtocolAnthropicHint":e==="openai-responses"?"keysProtocolResponsesHint":e==="openai-completions"?"keysProtocolOpenAIHint":e==="google-generative-ai"?"keysProtocolGeminiHint":"keysProtocolDefaultHint")}function Id(e,t,n,r=!1){return[void 0,...r?Nd:Hp(e,t)].map(i=>({value:i??"",title:_d(i,n),hint:Rp(i,n)}))}function _r(e){let{route:t,t:n,draft:r}=e,o=e.client??We,[i,a]=(0,se.useState)(void 0),[s,d]=(0,se.useState)([]),[l,u]=(0,se.useState)(void 0),[h,f]=(0,se.useState)(!1),[c,p]=(0,se.useState)(void 0),[m,b]=(0,se.useState)(""),[M,E]=(0,se.useState)(""),[v,D]=(0,se.useState)([]),[I,P]=(0,se.useState)(void 0);(0,se.useEffect)(()=>{r===!0&&p({kind:"add"})},[r]);let[Z,L]=(0,se.useState)(void 0),[H,w]=(0,se.useState)(void 0),[R,N]=(0,se.useState)(Ap),[K,W]=(0,se.useState)([]),q=(0,se.useCallback)((g,O)=>{if(!g.ok){u({kind:"error",text:g.error??n("keysUnreachable")});return}a(g.entries),d(g.models??[]),W((g.unmergedModels??[]).slice().sort(Pd.compare)),N(g.endpoints),u(O===void 0?void 0:{kind:"status",text:O})},[n]);(0,se.useEffect)(()=>{let g=!0;return(async()=>{let O=await o.list(t);g&&q(O,void 0)})(),()=>{g=!1}},[q,o,t]),(0,se.useEffect)(()=>{let g=O=>{let ne=O.detail?.route;ne!==void 0&&ne!==t||(async()=>{let J=await o.list(t);J.ok&&q(J,void 0)})()};return document.addEventListener(cn,g),()=>{document.removeEventListener(cn,g)}},[q,o,t]);let oe=(0,se.useCallback)(async(g,O)=>{f(!0),L(void 0),p(void 0);try{q(await g(),O)}finally{f(!1)}},[q]),j=()=>{p(void 0),b(""),E(""),D([]),P(void 0)},X=(g,O)=>{p({kind:g,ref:O.ref}),b(g==="alias"?O.alias??"":""),E(""),D(O.models??[]),P(void 0),L(void 0)},z=()=>{if(h||c===void 0)return;let g=c.kind,O=c.ref;if(g!=="alias"&&g!=="scope"&&!Et(M))return;let U=Cs(m),ne=I;f(!0),(async()=>{try{if(g==="add"){let le=new Set((i??[]).map(nt=>nt.ref)),ce=await o.add(t,M,U);if(!ce.ok){q(ce,n("keysAdded"));return}let tt=ne===void 0?void 0:ce.entries.find(nt=>!le.has(nt.ref)),$e=tt===void 0?ce:await o.setProtocol(t,tt.ref,ne);q($e,n("keysAdded")),$e.ok&&j();return}if(O===void 0)return;if(g==="scope"){let le=await o.setScope(t,O,v.length===0?void 0:v);q(le,n("keysScopeSaved")),le.ok&&j();return}let J=g==="alias"?await o.rename(t,O,U):await o.replace(t,O,M);q(J,n(g==="alias"?"keysRenamed":"keysReplaced")),J.ok&&j()}finally{f(!1)}})()},ee=g=>{D(O=>O.includes(g)?O.filter(U=>U!==g):[...O,g])},G=[...s,...K].sort(Pd.compare),ie=()=>{if(c===void 0)return null;let g=c.kind,O=g==="add"||g==="value",U=g==="scope",ne=O&&M.length>0&&!Et(M);return(0,C.jsxs)("div",{className:"bre-keys-form",children:[U?(0,C.jsx)("div",{className:"bre-keys-chips",role:"group","aria-label":n("keysScope"),children:G.length===0?(0,C.jsx)("p",{className:"bre-keys-hint",children:n("keysScopeEmpty")}):G.map(J=>{let le=v.includes(J);return(0,C.jsx)("button",{type:"button",className:le?"bre-keys-chip is-selected":"bre-keys-chip","aria-pressed":le,disabled:h,onClick:()=>ee(J),children:J},J)})}):(0,C.jsxs)("div",{className:"bre-keys-form-fields",children:[g==="value"?null:(0,C.jsx)("input",{className:"bre-text-input bre-keys-name",type:"text",value:m,placeholder:n("keysAliasPlaceholder"),"aria-label":n("keysAlias"),disabled:h,autoFocus:g==="alias",onChange:J=>b(J.target.value)}),O?(0,C.jsx)("input",{className:"bre-text-input bre-keys-secret",type:"password",autoComplete:"new-password",spellCheck:!1,value:M,placeholder:n(g==="add"?"keysValuePlaceholder":"keysNewValuePlaceholder"),"aria-label":n("keysValue"),"aria-invalid":ne,disabled:h,autoFocus:!0,onChange:J=>E(J.target.value)}):null]}),g==="add"?(0,C.jsx)("div",{className:"bre-keys-chips",role:"group","aria-label":n("keysProtocolCreate"),children:Id(R,void 0,n,r===!0).map(J=>{let le=J.value===""?void 0:J.value,ce=I===le;return(0,C.jsx)("button",{type:"button",className:ce?"bre-keys-chip is-selected":"bre-keys-chip","aria-pressed":ce,title:J.hint,disabled:h,onClick:()=>P(le),children:J.title},J.value)})}):null,g==="add"?(0,C.jsx)("p",{className:"bre-keys-hint",children:n("keysProtocolCreateHint")}):null,U?(0,C.jsx)("p",{className:"bre-keys-hint",children:n("keysScopeHint")}):null,ne?(0,C.jsx)("p",{className:"bre-effort-message bre-error",role:"alert",children:n("keysAddIllegal")}):null,(0,C.jsxs)("div",{className:"bre-keys-form-actions",children:[U?(0,C.jsx)("button",{type:"button",className:"bre-link-button bre-keys-allmodels",disabled:h,onClick:()=>D([]),children:n("keysScopeAll")}):null,(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:h,onClick:j,children:n("keysCancel")}),(0,C.jsx)("button",{type:"button",className:"bre-primary-button",disabled:h||O&&!Et(M),onClick:z,children:n(g==="add"?"keysAddConfirm":"keysSave")})]})]})},ae=()=>c?.kind==="add"?(0,C.jsx)("li",{className:"bre-keys-form-row",children:ie()}):(0,C.jsx)("li",{className:"bre-keys-add-row",children:(0,C.jsxs)("button",{type:"button",className:"bre-keys-add",disabled:h,onClick:()=>{p({kind:"add"}),b(""),E(""),D([]),L(void 0)},children:[(0,C.jsx)("span",{className:"bre-keys-add-mark","aria-hidden":"true",children:(0,C.jsx)(Cd,{paths:Tp})}),n("keysAdd")]})}),pe=(g,O)=>{let U=O===""?void 0:O;w(void 0),oe(()=>o.setProtocol(t,g.ref,U),n("keysProtocolSaved"))},x=H===void 0?void 0:i?.find(g=>g.ref===H.ref);if(i===void 0)return l===void 0?(0,C.jsx)("div",{className:"bre-keys"}):(0,C.jsxs)("div",{className:"bre-keys",children:[(0,C.jsx)("p",{className:"bre-effort-message bre-"+l.kind,role:l.kind==="error"?"alert":"status",children:l.text}),(0,C.jsx)("ul",{className:"bre-keys-list",children:ae()})]});let A=i.reduce((g,O)=>O.enabled?g+1:g,0);return(0,C.jsxs)("div",{className:"bre-keys",children:[(0,C.jsxs)("ul",{className:"bre-keys-list",children:[i.map(g=>{let O=Dd(g),U=g.enabled&&A<=1;return(0,C.jsxs)(se.Fragment,{children:[(0,C.jsxs)("li",{className:g.enabled?"bre-keys-row":"bre-keys-row is-off","data-state":g.configured===!1?"missing":"ready",children:[(0,C.jsx)("button",{type:"button",className:g.enabled?"bre-keys-toggle is-on":"bre-keys-toggle","aria-pressed":g.enabled,"aria-label":n(g.enabled?"keysDisable":"keysEnable",{name:O}),title:n(g.enabled?"keysDisable":"keysEnable",{name:O}),disabled:h||U,onClick:()=>{oe(()=>o.setEnabled(t,g.ref,!g.enabled),void 0)},children:(0,C.jsx)("span",{className:"bre-keys-toggle-mark","aria-hidden":"true",children:(0,C.jsx)(Cd,{paths:[Mp]})})}),g.alias===void 0?null:(0,C.jsx)("span",{className:"bre-keys-alias",children:g.alias}),(0,C.jsx)("span",{className:g.alias===void 0?"bre-keys-mask bre-keys-mask-plain":"bre-keys-mask",children:Lp(g,n)}),(0,C.jsx)("span",{className:Z===g.ref?"bre-keys-actions is-confirming":"bre-keys-actions",children:Z===g.ref?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("button",{type:"button",className:"bre-link-button bre-keys-danger",disabled:h,onClick:()=>{oe(()=>o.remove(t,g.ref),n("keysRemoved"))},children:n("keysConfirmRemove")}),(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:h,onClick:()=>L(void 0),children:n("keysCancel")})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{className:"bre-keys-protocol-wrap",children:(0,C.jsxs)("button",{type:"button",className:"bre-keys-protocol","aria-haspopup":"listbox","aria-expanded":H?.ref===g.ref,"aria-label":n("keysProtocolLabel",{name:O}),title:n("keysProtocolLabel",{name:O}),disabled:h,onClick:ne=>{let J=ne.currentTarget;w(le=>le?.ref===g.ref?void 0:{ref:g.ref,anchor:J}),L(void 0)},children:[(0,C.jsx)("span",{className:"bre-keys-protocol-label",children:_d(g.protocol,n)}),(0,C.jsx)("span",{className:"bre-keys-protocol-caret","aria-hidden":"true",children:"\u203A"})]})}),(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:h,onClick:()=>{L(g.ref),p(void 0)},children:n("keysRemove")}),(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:h,onClick:()=>X("alias",g),children:n("keysAlias")}),r===!0?null:(0,C.jsx)("button",{type:"button",className:"bre-link-button bre-keys-scope",disabled:h,title:n("keysScope",{name:O}),onClick:()=>X("scope",g),children:Sp(g,n)}),(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:h,onClick:()=>X("value",g),children:n("keysEdit")})]})})]}),c!==void 0&&c.ref===g.ref?(0,C.jsx)("li",{className:"bre-keys-form-row",children:ie()}):null]},g.ref)}),ae()]}),r===!0?(0,C.jsx)("p",{className:"bre-keys-note",children:n("keysDraftHint")}):null,K.length===0?null:(0,C.jsxs)("p",{className:"bre-keys-note",children:[n("keysMergedOffer",{count:K.length,models:K.join(", ")})," ",(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:h,onClick:()=>{oe(()=>o.applyMerged(t),n("keysMergedApplied"))},children:n("keysMergedApply")})]}),l===void 0?null:(0,C.jsx)("p",{className:"bre-effort-message bre-"+l.kind,role:l.kind==="error"?"alert":"status",children:l.text}),H===void 0||x===void 0?null:(0,C.jsx)(Od,{anchor:H.anchor,label:n("keysProtocolLabel",{name:Dd(x)}),options:Id(R,x.protocol,n,r===!0),selected:x.protocol??"",onPick:g=>pe(x,g),onClose:()=>w(void 0)})]})}var Tt="bre-key-managed",Op="bre-keys-host",bi="data-bre-key-host",Cp="data-bre-key-input",Fr="data-bre-region",ut=new WeakMap;function Dp(e){let t=e.querySelector(`input[${Cp}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function Fd(e){let t=ut.get(e)?.host;if(t!==void 0&&t.isConnected)return t;let n=e.nextElementSibling;return n instanceof HTMLElement&&n.hasAttribute(bi)?n:void 0}function Kd(e,t){let n=t.route;if(n===void 0||n.length===0||Dp(e)===void 0||e.parentElement===null)return;ge(e,Tt,!0);let r=ut.get(e),o=Fd(e);o===void 0&&(r!==void 0&&qd(e,r),o=e.ownerDocument.createElement("div"),o.className=Op,e.after(o)),Y(o,bi,n);let i=e.getAttribute(Fr);i===null?o.hasAttribute(Fr)&&o.removeAttribute(Fr):Y(o,Fr,i);let a=()=>(0,gi.createElement)(Ie,{fallbackText:t.t("keysPanelFailed")},(0,gi.createElement)(_r,{route:n,t:t.t,client:t.client})),s=ut.get(e);if(s!==void 0&&s.route===n){(s.t!==t.t||s.client!==t.client)&&(s.t=t.t,s.client=t.client,s.mount.root.render(a()));return}s!==void 0&&(ut.delete(e),s.mount.root.unmount()),ut.set(e,{route:n,host:o,mount:Xe(o,a(),{sync:!0}),t:t.t,client:t.client})}function qd(e,t){ut.delete(e),Ne(t.mount)}function Kr(e){ge(e,Tt,!1);let t=ut.get(e);t!==void 0&&qd(e,t),Fd(e)?.remove()}function Wd(){for(let e of Array.from(document.querySelectorAll(`[${bi}]`))){let t=e.previousElementSibling;t instanceof HTMLElement&&ut.has(t)?Kr(t):e.remove()}}var Bd="http://www.w3.org/2000/svg",Pp="data-bre-icon";function Ip(e){let t=document.createElementNS(Bd,"path");return t.setAttribute("d",e),t}function Gd(e,t){let n=document.createElementNS(Bd,"svg");return n.setAttribute("viewBox","0 0 16 16"),n.setAttribute("width","16"),n.setAttribute("height","16"),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.5"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false"),n.setAttribute(Pp,e),n.append(...t.map(Ip)),n}var Wt="bre-key-field",zd="bre-key-eye",qr="data-bre-key-input",$d="data-bre-eye-show",Vd="data-bre-eye-hide",Ud=["M1.5 8S4 3.75 8 3.75 14.5 8 14.5 8 12 12.25 8 12.25 1.5 8 1.5 8Z","M6.2 8a1.8 1.8 0 1 0 3.6 0 1.8 1.8 0 0 0-3.6 0Z"],vi=new WeakMap;function yi(e){let t=e.querySelector(`input[${qr}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function Yd(e){for(let t of Array.from(e.children))if(t instanceof HTMLButtonElement&&t.classList.contains(zd))return t}function Br(e,t){let n=yi(e);if(n===void 0){Bt(e);return}vi.set(e,t),Y(n,qr,""),ge(e,Wt,!0);let r=Yd(e)??_p(e);Y(r,$d,t.t("keyRevealShow")),Y(r,Vd,t.t("keyRevealHide")),wi(r,n)}function Bt(e){let t=Yd(e);t!==void 0&&t.remove(),vi.delete(e),ge(e,Wt,!1);let n=e.querySelector(`input[${qr}]`);n instanceof HTMLInputElement&&(n.removeAttribute(qr),n.type="password")}async function Np(e){try{let t=await fetch(`${Kn}?route=${encodeURIComponent(e)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!t.ok)return;let n=await t.json();return n===null||typeof n!="object"||n.ok!==!0?void 0:typeof n.key=="string"&&n.key.length>0?n.key:void 0}catch{return}}function wi(e,t){let n=t.type!=="password";Y(e,"aria-pressed",n?"true":"false");let r=e.getAttribute(n?Vd:$d);r!==null&&(Y(e,"aria-label",r),Y(e,"title",r)),xn(e,t.disabled)}function Wr(e,t){let n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");n?.set===void 0?e.value=t:n.set.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))}function _p(e){let t=document.createElement("button");t.type="button",t.className=zd,t.append(jd("eye"),jd("eye-off"));let n,r=async()=>{let o=yi(e),i=vi.get(e);if(o===void 0||i===void 0)return;if(o.type!=="password"){n!==void 0&&o.value===n&&Wr(o,""),n=void 0,o.type="password",wi(t,o);return}let a=i.route;if(a!==void 0&&n===void 0&&o.value.length===0){Y(t,"aria-busy","true");let s;try{s=await(i.loadKey??Np)(a)}catch{s=void 0}if(t.hasAttribute("aria-busy")&&t.removeAttribute("aria-busy"),s===void 0){let d=i.t("keyRevealFailed");Y(t,"aria-label",d),Y(t,"title",d);return}yi(e)===o&&o.value.length===0&&(n=s,Wr(o,s))}o.type="text",wi(t,o)};return t.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),r()}),e.append(t),t}function jd(e){let t=e==="eye-off"?[...Ud,"M2.5 13.5 13.5 2.5"]:Ud;return Gd(e,t)}var xi="bre-editor-tabs",Fp="bre-editor-tab",Gr="data-bre-tab-id",Tn="bre-tabbed",pt="data-bre-tab",Xd="data-bre-provider",_e="data-bre-region",En="data-bre-editor-body",jt="data-bre-footer",Kp="row",qp="path",Mn="data-bre-details";var Wp=".bre-headers",ft="provider",Gt="models",Ut="advanced",Bp=[ft,Gt,Ut],Gp="none",Jd=Bp,Qd=xi,Zd=Fp,el=Gr,Ur='[class*="editorActions"], [class*="modelList"], [class*="modelCatalog"], [class*="modelEntry"]',Up='[class*="modelCatalog"], [class*="modelList"], [class*="modelEntry"]',tl='[class*="rowCard"], [class*="addCard"], li',jp='[class*="addPanel"]',zp=".bre-create-host";function nl(){return{warned:new WeakSet}}function Ln(e){return e===null?null:e.closest(tl)}function rl(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.matches(jp)&&!t.hidden)return t;return e}function ol(e,t){let n=br(e),r=e.getBoundingClientRect().top,o=n?.scrollTop??0;n!==void 0&&(n.style.overflowAnchor="none"),Y(e,pt,t),sl(e),n!==void 0&&requestAnimationFrame(()=>{if(n.style.overflowAnchor="",n.scrollTop!==o)return;let i=e.getBoundingClientRect().top-r;i!==0&&(n.scrollTop+=i)})}function ki(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(Ur))){let i=o.closest(tl);i!==null&&r.add(i)}for(let o of Array.from(e.querySelectorAll(`.${Tn}`)))r.has(o)||jr(o);for(let o of r)try{Qp(o,t)}catch(i){n.warned.has(o)||(n.warned.add(o),console.warn("[bre] editor tabs: rolled a provider card back to the official layout:",i)),jr(o)}}function il(){for(let e of Array.from(document.querySelectorAll(`.${Tn}`))){e.classList.remove(Tn),e.removeAttribute(pt),e.removeAttribute(En);for(let t of Array.from(e.querySelectorAll(`[${_e}]`)))t.removeAttribute(_e)}for(let e of Array.from(document.querySelectorAll(`[${pt}]`)))e.removeAttribute(pt);for(let e of Array.from(document.querySelectorAll(`[${_e}]`)))e.removeAttribute(_e);for(let e of Array.from(document.querySelectorAll(`[${En}]`)))e.removeAttribute(En);for(let e of Array.from(document.querySelectorAll(`[${jt}]`)))e.removeAttribute(jt);for(let e of Array.from(document.querySelectorAll(`details[${Mn}]`)))e.removeAttribute("open"),e.removeAttribute(Mn);for(let e of Array.from(document.querySelectorAll(`.${Wt}`)))Bt(e);for(let e of Array.from(document.querySelectorAll(`.${Tt}`)))Kr(e);Wd()}function $p(e){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&!n.matches('[class*="editorHeader"], [class*="editorTitle"], [class*="editorActions"], [class*="editorRoute"]')&&n.matches('[class*="editor"]')&&(n.querySelector(Ur)!==null||n.querySelector("input, select")!==null))return n;let t=e.querySelector(Ur);for(;t!==null&&t.parentElement!==e;)t=t.parentElement;return t!==null&&t!==e?t:void 0}function Vp(e){let t={header:void 0,models:void 0,actions:void 0,fields:[]};al(e,t,0);let{actions:n,fields:r,header:o,models:i}=t;if(!(n===void 0||r.length===0)&&r.some(a=>a.querySelector("input, select, textarea")!==null))return{header:o,models:i,actions:n,fields:r}}var Yp=4;function al(e,t,n){if(!(n>Yp)){for(let r of Array.from(e.children))if(r instanceof HTMLElement&&!r.matches('[class*="bre-"], [data-plugin]')){if(t.header===void 0&&r.matches('[class*="editorHeader"], [class*="editorTitle"]')){t.header=r;continue}if(r.matches('[class*="editorActions"]')){t.actions??(t.actions=r);continue}if(r.matches(Up)){t.models??(t.models=r);continue}if(r.querySelector(Ur)!==null){al(r,t,n+1);continue}if(r.querySelector('[class*="editorActions"]')!==null){t.actions??(t.actions=r);continue}if(r.querySelector("input, select, textarea")!==null){t.fields.push(r);continue}(r.matches("p, small, em, i")||r.matches('[class*="Hint"], [class*="error"]'))&&t.fields.push(r)}}}function Xp(e,t){if(!t.contains(e))return;Y(e,jt,Kp);let n=e.parentElement;for(;n!==null&&(Y(n,jt,qp),n!==t);)n=n.parentElement}function Jp(e){let n=e.querySelector(`[${Xd}]`)?.getAttribute(Xd);return n==null||n===""?void 0:n}function Qp(e,t){let n=rl(e),r=$p(n);if(r===void 0){jr(e);return}let o=Vp(r);if(o===void 0){jr(e);return}let i=n.querySelector(Wp),a=Jp(n);for(let l of o.fields)Y(l,_e,ft),Br(l,{t:t.t,route:a}),Kd(l,{t:t.t,route:a});o.header!==void 0&&Y(o.header,_e,Gp),o.models!==void 0&&Y(o.models,_e,Gt),Y(r,En,""),n.querySelector(zp)!==null&&Xp(o.actions,r),i!==null&&Y(i,_e,Ut),em(r);let s=new Set([ft]);o.models!==void 0&&s.add(Gt),i!==null&&s.add(Ut);let d=e.getAttribute(pt)??ft;Y(e,pt,s.has(d)?d:ft),ge(e,Tn,!0),Zp(e,n,t,s)}function Zp(e,t,n,r){let o=t.querySelector(`.${xi}`);o!==null&&(Y(o,"aria-label",n.t("editorTabsLabel")),Ir(kn(o,ft),n.t("editorTabProvider")),Ir(kn(o,Gt),n.t("editorTabModels")),Ir(kn(o,Ut),n.t("editorTabAdvanced")),xn(kn(o,Gt),!r.has(Gt)),xn(kn(o,Ut),!r.has(Ut)),sl(e,o))}function sl(e,t){let n=t??rl(e).querySelector(`.${xi}`);if(n===null)return;let r=e.getAttribute(pt)??ft;for(let o of Array.from(n.querySelectorAll(`[${Gr}]`)))Y(o,"aria-selected",o.getAttribute(Gr)===r?"true":"false")}function kn(e,t){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&n.getAttribute(Gr)===t)return n}function jr(e){e.classList.remove(Tn),e.removeAttribute(pt),e.removeAttribute(En);for(let t of Array.from(e.querySelectorAll(`[${_e}]`)))t.getAttribute(_e)===ft&&(Bt(t),Kr(t)),t.removeAttribute(_e);for(let t of Array.from(e.querySelectorAll(`[${jt}]`)))t.removeAttribute(jt);tm(e)}function em(e){for(let t of Array.from(e.querySelectorAll("details")))t.hasAttribute("open")||(Y(t,Mn,"closed"),Y(t,"open",""))}function tm(e){for(let t of Array.from(e.querySelectorAll(`details[${Mn}]`)))t.removeAttribute("open"),t.removeAttribute(Mn)}var jl=require("react");var ve=require("react");var de=require("react");var nm='p[class*="savedNotice"]',cl="data-bre-saved-hidden",rm="bre-auto-effort-note",om="data-bre-auto-effort-phase",dl="bre-auto-effort-note-text",zt=new Map,ll=new WeakMap,$t=null,zr=null;function ul(e){let t=Array.from(e.querySelectorAll(nm));for(let n of t){let r=n.textContent?.trim()??"";ll.get(n)!==r&&(ll.set(n,r),r.length>0&&hl(r)),!zt.has(n)&&(zt.set(n,n.style.display),n.setAttribute(cl,""),n.style.display="none")}for(let[n,r]of Array.from(zt))n.isConnected&&t.includes(n)||(pl(n,r),zt.delete(n))}function fl(){for(let[e,t]of Array.from(zt))pl(e,t);zt.clear(),Ei()}function pl(e,t){e.style.display=t,e.removeAttribute(cl)}function ml(e){hl(e)}function hl(e){if($t!==null&&$t.isConnected&&$t.textContent===e)return;Ei();let t=document.createElement("div");t.className=rm,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute(om,"done"),t.innerHTML=`<span class="${dl}"></span>`;let n=t.querySelector(`.${dl}`);n!==null&&(n.textContent=e),t.style.setProperty("--bre-note-hold","3000ms"),document.body.append(t),$t=t,zr=setTimeout(()=>{Ei()},3e3)}function Ei(){zr!==null&&(clearTimeout(zr),zr=null),$t?.remove(),$t=null}var Mt="data-bre-settle",gl='[class*="rowActions"] > button:not(.bre-provider-switch):not(.bre-provider-delete)';var je=null,Ti=0,$r=0,Sn=!1,Vt=null;function bl(e){return e.className.includes("dangerButton")?"remove":"edit"}function Mi(e,t){return Array.from(e.querySelectorAll(gl)).find(r=>bl(r)===t)??null}function im(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function am(e){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(e):clearTimeout(e)}function yl(e=document){An();let t=[];for(let n of Array.from(e.querySelectorAll(gl))){if(n.disabled)continue;let r=n.closest("li")??n.parentElement;if(r===null)continue;let o=bl(n);t.some(i=>i.row===r&&i.role===o)||t.push({row:r,role:o})}t.length!==0&&(je=t,$r=Date.now(),Ti=$r+8e3,sm(),wl())}function Li(){if(je===null)return;let e=Date.now();if(e>Ti){An();return}let t=0;if(je=je.filter(n=>{if(!n.row.isConnected)return!1;let r=Mi(n.row,n.role);return r===null||(r.disabled?(Sn=!0,t+=1,r.hasAttribute(Mt)||r.setAttribute(Mt,"")):Sn&&r.hasAttribute(Mt)&&r.removeAttribute(Mt)),!0}),Sn&&t===0){An();return}if(!Sn&&e-$r>1500){An();return}wl()}function wl(){Vt!==null||je===null||(Vt=im(()=>{Vt=null,Li()}))}function sm(){if(je!==null)for(let e of je){let t=Mi(e.row,e.role);t!==null&&!t.hasAttribute(Mt)&&t.setAttribute(Mt,"")}}function vl(){An()}function An(){if(Vt!==null&&(am(Vt),Vt=null),je!==null)for(let e of je){let t=Mi(e.row,e.role);t!==null&&t.removeAttribute(Mt)}je=null,Sn=!1,Ti=0,$r=0}var B=require("react/jsx-runtime"),dm=["claude-cli/2.1.161 (external, cli)","claude-code/1.0.0","Kilo-Code/1.0"];function xl(e,t){let n=()=>t.current+=1,r=Object.entries(e??{}).map(([o,i])=>({id:n(),name:o,value:i}));return r.length===0&&r.push({id:n(),name:"",value:""}),{rows:r}}function kl(e){let t={},n=!1;for(let o of e.rows){let i=o.name.trim();i.length!==0&&(t[i]=o.value,i.toLowerCase()==="user-agent"&&(n=!0))}let r=e.userAgent?.trim();return!n&&r!==void 0&&r.length>0&&(t["user-agent"]=r),t}function Vr({route:e,api:t,t:n,onDismiss:r,deferred:o}){let i=(0,de.useId)(),[a,s]=(0,de.useState)(void 0),[d,l]=(0,de.useState)({rows:[]}),[u,h]=(0,de.useState)(!1),[f,c]=(0,de.useState)(!1),[p,m]=(0,de.useState)(!0),[b,M]=(0,de.useState)(!1),[E,v]=(0,de.useState)(!1),[D,I]=(0,de.useState)(void 0),[P,Z]=(0,de.useState)(void 0),[L,H]=(0,de.useState)(!1),w=(0,de.useRef)(0),R=(0,de.useRef)(null),N=o!==void 0,K=o?.onDraft,W=(0,de.useRef)(void 0);(0,de.useEffect)(()=>{if(N&&W.current!==void 0)return;W.current=e;let x=!0;return(async()=>{try{let A=await te(t);if(!x)return;let g=Oo(A.namespace,e);s(g),l(xl(g,w)),v(A.writable!==!0)}catch{x&&v(!0)}finally{x&&m(!1)}})(),()=>{x=!1}},[t,e,N]),(0,de.useEffect)(()=>{K!==void 0&&K(kl(d))},[d,K]),(0,de.useEffect)(()=>{let x=!0;return(async()=>{try{let g=await(await fetch(Xi,{method:"GET"})).json();x&&g.ok===!0&&g.data!==void 0&&Z(g.data)}catch{}})(),()=>{x=!1}},[]),(0,de.useEffect)(()=>{let x=R.current;if(x===null)return;let A=()=>{H(x.dataset.breRegion==="advanced")};A();let g=new MutationObserver(A);return g.observe(x,{attributes:!0,attributeFilter:["data-bre-region"]}),()=>{g.disconnect()}},[]);let q=()=>{l(x=>({...x,rows:[...x.rows,{id:w.current+=1,name:"",value:""}]})),I(void 0)},oe=(x,A)=>{l(g=>({...g,rows:g.rows.map(O=>O.id===x?{...O,...A}:O)})),I(void 0)},j=x=>{l(A=>({...A,rows:A.rows.filter(g=>g.id!==x)})),I(void 0)},X=()=>{if(l(xl(a,w)),c(!1),I(void 0),o!==void 0){o.onCancel();return}L&&r?.()},z=async x=>{M(!0),I(void 0),yl();let A;try{A=await on(t,e,x)}catch(O){A={ok:!1,error:O instanceof Error?O.message:String(O)}}if(M(!1),!A.ok){I({kind:"error",text:A.error==="no-route"?n("headersNoRoute"):A.error==="read-only"?n("headersReadOnly"):n("headersError",{error:A.error})});return}s(x),c(!1);let g=Object.keys(x).length===0?n("headersCleared"):n("headersSaved");if(L){ml(g),r?.();return}I({kind:"success",text:g})},ee=Object.entries(a??{}),G=E||b,ie=ee.length,ae=L||N,pe=u||f||ae;return(0,B.jsxs)("div",{className:"bre-headers",ref:R,"data-plugin":ue,"data-open":u?"1":"0",children:[(0,B.jsx)("div",{className:"bre-headers-head",children:f||ae?(0,B.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}):(0,B.jsxs)("button",{type:"button",className:"bre-headers-disclosure","aria-expanded":u,"aria-label":`${n("headersTitle")} ${e}`,onClick:()=>{h(!u),I(void 0)},children:[(0,B.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}),p||ie===0?null:(0,B.jsx)("span",{className:"bre-headers-count",children:ie}),(0,B.jsx)("span",{className:"bre-headers-chevron","aria-hidden":"true",children:"\u203A"})]})}),pe?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("p",{className:"bre-effort-note",children:n("headersHint")}),P===void 0?null:(0,B.jsxs)(B.Fragment,{children:[P.environment.preferOfficialLayer?(0,B.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictPatched")}):null,P.conflicts.length===0&&(P.headerConflicts?.length??0)===0?null:(0,B.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictOrigin")}),P.environment.siblings.length===0?null:(0,B.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictSiblings",{names:P.environment.siblings.map(x=>x.name).join(", ")})})]}),p?null:f||ae?(0,B.jsxs)("div",{className:"bre-headers-edit",children:[(0,B.jsxs)("div",{className:"bre-headers-columns","aria-hidden":"true",children:[(0,B.jsx)("span",{children:n("headersName")}),(0,B.jsx)("span",{children:n("headersValue")}),(0,B.jsx)("span",{})]}),d.rows.map(x=>(0,B.jsxs)("div",{className:"bre-headers-row",children:[(0,B.jsx)("input",{type:"text",className:"bre-text-input bre-headers-name",value:x.name,disabled:G,placeholder:n("headersNamePlaceholder"),"aria-label":n("headersName"),onChange:A=>{oe(x.id,{name:A.target.value})}}),(0,B.jsx)("input",{type:"text",className:"bre-text-input bre-headers-value",value:x.value,disabled:G,list:x.name.trim().toLowerCase()==="user-agent"?i:void 0,placeholder:n("headersValue"),"aria-label":n("headersValue"),onChange:A=>{oe(x.id,{value:A.target.value})}}),(0,B.jsx)("button",{type:"button",className:"bre-link-button bre-headers-remove",disabled:G,"aria-label":`${n("headersClear")} ${x.name}`,onClick:()=>{j(x.id)},children:"\xD7"})]},x.id)),(0,B.jsx)("button",{type:"button",className:"bre-link-button bre-headers-add",disabled:G,onClick:q,children:n("headersAdd")}),(0,B.jsx)("datalist",{id:i,children:dm.map(x=>(0,B.jsx)("option",{value:x},x))}),N?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("p",{className:"bre-effort-note",children:n("pendingSave")}),(0,B.jsx)("p",{className:"bre-effort-note",children:n("pendingHint")})]}):null]}):(0,B.jsxs)("div",{className:"bre-headers-rows",children:[ee.length===0?(0,B.jsx)("p",{className:"bre-effort-note",children:n("headersEmpty")}):ee.map(([x,A])=>(0,B.jsxs)("div",{className:"bre-headers-row",children:[(0,B.jsx)("span",{className:"bre-headers-name",children:x}),(0,B.jsx)("span",{className:"bre-headers-value bre-headers-masked",children:"\u2022".repeat(Math.min(A.length,24))})]},x)),E?null:(0,B.jsx)("div",{className:"bre-effort-actions",children:(0,B.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:G,onClick:()=>{c(!0),I(void 0)},children:n("headersEdit")})})]})]}):null,!p&&(ae||f)?(0,B.jsxs)("div",{className:"bre-effort-actions bre-headers-actions",children:[(0,B.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:b,onClick:X,children:n("headersCancel")}),N?null:(0,B.jsx)("button",{type:"button",className:"bre-primary-button",disabled:G,onClick:()=>{z(kl(d))},children:n("headersSave")})]}):null,D===void 0?null:(0,B.jsx)("p",{className:"bre-effort-message bre-"+D.kind,role:D.kind==="error"?"alert":"status",children:D.text})]})}var Si=require("react");var lm={provider:"editorTabProvider",models:"editorTabModels",advanced:"editorTabAdvanced"};function Yr({host:e,t}){return(0,Si.createElement)("div",{className:Qd,role:"tablist","aria-label":t("editorTabsLabel")},...Jd.map(n=>(0,Si.createElement)("button",{key:n,type:"button",role:"tab",className:Zd,[el]:n,onClick:r=>{r.preventDefault(),r.stopPropagation();let o=Ln(e.current);o!==null&&ol(o,n)}},t(lm[n]))))}var cm=15e3;function Tl(){return{intents:new Map,baseline:new Map,flushing:!1}}function Ai(e,t,n){if(t.length===0)return;let r={...n};if(Object.keys(r).length===0){e.intents.delete(t);return}let o=e.intents.get(t);if(o===void 0){e.intents.set(t,{headers:r,declaredBefore:e.baseline.get(t)});return}o.headers=r}function Hi(e,t){e.intents.delete(t)}function Ml(e,t){let n=e.intents.get(t);n!==void 0&&(n.releasedAt=Date.now())}function Ll(e,t,n){if(t.length===0)return;e.baseline.set(t,n);let r=e.intents.get(t);r!==void 0&&(r.declaredBefore=n)}function Sl(e,t){return t.length>0&&!e.baseline.has(t)}async function Al(e,t){if(e.flushing)return El(e);if(e.intents.size===0)return 0;e.flushing=!0;try{let n=await te(t),r,o=async a=>Le(n.namespace,a)?!0:(r??(r=await te(t,{fresh:!0})),Le(r.namespace,a)),i=Date.now();for(let[a,s]of Array.from(e.intents)){if(s.declaredBefore===void 0){s.releasedAt!==void 0&&s.noted!==!0&&(s.noted=!0,console.warn("[bre] deferred request headers: nobody said whether this id existed before, so the draft is held:",a));continue}if(s.declaredBefore){e.intents.delete(a);continue}if(!await o(a)){s.releasedAt!==void 0&&i-s.releasedAt>cm?(e.intents.delete(a),console.info("[bre] deferred request headers: gave up on a draft whose card closed first:",a)):s.releasedAt!==void 0&&console.info("[bre] deferred request headers: waiting for the closed card to declare",a);continue}console.info("[bre] deferred request headers: the route is declared, writing the held draft:",a);let d;try{d=await on(t,a,s.headers)}catch(l){d={ok:!1,error:l instanceof Error?l.message:String(l)}}if(d.ok){e.intents.delete(a),console.info("[bre] deferred request headers: saved",a,Object.keys(s.headers).length,"header(s)");continue}d.error!=="no-route"&&(e.intents.delete(a),console.error("[bre] deferred request headers: the write was refused:",d.error,a))}}catch(n){console.error("[bre] deferred request headers: could not read the settings document:",n)}finally{e.flushing=!1}return El(e)}function El(e){let t=0;for(let n of e.intents.values())n.releasedAt!==void 0&&(t+=1);return t}var Lt=require("react/jsx-runtime");function Rl({host:e,api:t,t:n,routeIdLabels:r,staged:o}){let[i,a]=(0,ve.useState)(()=>Hn(e.current,r)),s=(0,ve.useRef)(i),d=(0,ve.useRef)(void 0),l=(0,ve.useRef)(new Set),u=(0,ve.useRef)(!1),h=(0,ve.useRef)(null);return h.current===null&&(h.current={onDraft:f=>{d.current=f;let c=s.current;if(c.length===0){!u.current&&Object.keys(f).length>0&&(u.current=!0,console.info("[bre] deferred request headers: holding a draft until the provider id is typed"));return}Ai(o,c,f),Hl(t,o,c,l.current)},onCancel:()=>{d.current=void 0,Hi(o,s.current)}}),(0,ve.useEffect)(()=>{let f=Xr(e.current);if(f===null)return;let c=()=>{a(Hn(e.current,r))};return f.addEventListener("input",c,!0),()=>{f.removeEventListener("input",c,!0)}},[e,r]),(0,ve.useEffect)(()=>{i.length>0&&Hl(t,o,i,l.current)},[t,o,i]),(0,ve.useEffect)(()=>{let f=s.current;if(f===i)return;Hi(o,f),s.current=i;let c=d.current;c!==void 0&&i.length>0&&Ai(o,i,c)},[i,o]),(0,ve.useEffect)(()=>()=>{Ml(o,s.current)},[o]),(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(Yr,{host:e,t:n}),(0,Lt.jsx)(Vr,{route:i,api:t,t:n,deferred:h.current})]})}function Hl(e,t,n,r){!Sl(t,n)||r.has(n)||(r.add(n),(async()=>{try{let o=await te(e);Ll(t,n,Le(o.namespace,n))}catch(o){r.delete(n),console.warn("[bre] deferred request headers: could not read the settings document for this route:",o)}})())}function Xr(e){let t=e?.parentElement;return t==null?null:t.parentElement?.closest('[class*="addCard"]')??t}function Hn(e,t){let n=e?.parentElement;if(n==null)return"";let r=t(),o=we(n,r).trim();if(o.length>0)return o;let i=Xr(e);return i===null||i===n?"":we(i,r).trim()}var Oi=require("react");var xe=require("react");var um=15e3,fm=3;function Cl(){return{intents:new Map,baseline:new Map,draining:!1}}function Ri(e,t,n){if(t.length===0)return;if(n.length===0){e.intents.delete(t);return}let r=e.intents.get(t);if(r===void 0){e.intents.set(t,{drafts:[...n],landed:[],declaredBefore:e.baseline.get(t),attempts:0});return}r.drafts=[...n]}function Dl(e,t){e.intents.delete(t)}function Pl(e,t){let n=e.intents.get(t);n!==void 0&&(n.releasedAt=Date.now())}function Il(e,t,n){if(t.length===0)return;e.baseline.set(t,n);let r=e.intents.get(t);r!==void 0&&(r.declaredBefore=n)}function Nl(e,t){return t.length>0&&!e.baseline.has(t)}async function _l(e,t,n){if(e.draining)return Ol(e);if(e.intents.size===0)return 0;e.draining=!0;try{let r=await te(t),o,i=async s=>Le(r.namespace,s)?!0:(o??(o=await te(t,{fresh:!0})),Le(o.namespace,s)),a=Date.now();for(let[s,d]of Array.from(e.intents)){if(d.declaredBefore===void 0){d.releasedAt!==void 0&&d.noted!==!0&&(d.noted=!0,console.warn("[bre] deferred api keys: nobody said whether this id existed before, so the drafts are held:",s));continue}if(d.declaredBefore){e.intents.delete(s);continue}if(!await i(s)){d.releasedAt!==void 0&&a-d.releasedAt>um&&(e.intents.delete(s),console.info("[bre] deferred api keys: gave up on drafts whose card closed first:",s));continue}await pm(s,d,n)&&(e.intents.delete(s),console.info("[bre] deferred api keys: the route is declared, saved the held key list:",s))}}catch(r){console.error("[bre] deferred api keys: could not read the settings document:",r)}finally{e.draining=!1}return Ol(e)}async function pm(e,t,n){let r=!1,o=!1,i=()=>{r=!0,t.attempts+=1};for(let a of t.drafts){if(t.landed.some(l=>l.ref===a.ref))continue;let s=await n.add(e,a.value,a.alias);if(!s.ok){i();break}let d=s.entries.map(l=>l.ref).find(l=>!t.landed.some(u=>u.hostRef===l));if(d===void 0){i();break}t.landed.push({ref:a.ref,hostRef:d,done:!1}),o=!0}if(!r)for(let a of t.drafts){let s=t.landed.find(d=>d.ref===a.ref);if(!(s===void 0||s.done)){if(a.protocol!==void 0){if(!(await n.setProtocol(e,s.hostRef,a.protocol)).ok){i();break}o=!0}if(!a.enabled){if(!(await n.setEnabled(e,s.hostRef,!1)).ok){i();break}o=!0}s.done=!0}}return r?(o&&(t.attempts=0),t.attempts>=fm?(console.error("[bre] deferred api keys: the write was refused; giving up on the held key list:",e),!0):!1):!0}function Ol(e){let t=0;for(let n of e.intents.values())n.releasedAt!==void 0&&(t+=1);return t}var mm={openai:null,anthropic:null,gemini:null};function hm(e){let t=new Set(e.map(n=>n.ref));for(let n=1;n<=999;n+=1){let r=`key-${n}`;if(!t.has(r))return r}return`key-${Date.now()}`}function Fl(e,t){let n=()=>({ok:!0,route:"",entries:e.drafts.map(a=>({ref:a.ref,...a.alias===void 0?{}:{alias:a.alias},enabled:a.enabled,configured:!0,masked:Ds(a.value),...a.protocol===void 0?{}:{protocol:a.protocol}})),endpoints:mm}),r=()=>(t.onChange(e.drafts),n()),o=a=>e.drafts.find(s=>s.ref===a),i=(a,s)=>(e.drafts=e.drafts.map(d=>d.ref===a?s:d),r());return{list:async()=>n(),add:async(a,s,d)=>Et(s)?(e.drafts=[...e.drafts,{ref:hm(e.drafts),value:s,enabled:!0,...d===void 0?{}:{alias:d}}],r()):{ok:!1,error:t.t("keysAddIllegal")},rename:async(a,s,d)=>{let l=o(s);if(l===void 0)return{ok:!1};let{alias:u,...h}=l;return i(s,{...h,...d===void 0?{}:{alias:d}})},replace:async(a,s,d)=>{let l=o(s);return l===void 0||!Et(d)?{ok:!1,error:t.t("keysAddIllegal")}:i(s,{...l,value:d})},remove:async(a,s)=>(e.drafts=e.drafts.filter(d=>d.ref!==s),r()),setScope:async()=>n(),setEnabled:async(a,s,d)=>{let l=o(s);return l===void 0?{ok:!1}:!d&&!e.drafts.some(u=>u.ref!==s&&u.enabled)?{ok:!1,error:t.t("keysLastEnabledOff")}:i(s,{...l,enabled:d})},setProtocol:async(a,s,d)=>{let l=o(s);if(l===void 0)return{ok:!1};let{protocol:u,...h}=l;return i(s,{...h,...d===void 0?{}:{protocol:d}})},setEndpoints:async()=>n(),applyMerged:async()=>n(),reveal:async(a,s)=>o(s)?.value}}var ql=require("react/jsx-runtime");function Kl({host:e,store:t,api:n,t:r,routeIdLabels:o,staged:i}){let[a,s]=(0,xe.useState)(()=>Hn(e.current,o)),d=(0,xe.useRef)(a),l=(0,xe.useRef)(new Set),u=(0,xe.useRef)(!1),h=(0,xe.useMemo)(()=>Fl(t,{t:r,onChange:f=>{let c=d.current;if(c.length===0){!u.current&&f.length>0&&(u.current=!0,console.info("[bre] deferred api keys: holding the list until the provider id is typed"));return}Ri(i,c,f)}}),[i,t,r]);return(0,xe.useEffect)(()=>{let f=Xr(e.current);if(f===null)return;let c=()=>{s(Hn(e.current,o))};return f.addEventListener("input",c,!0),()=>{f.removeEventListener("input",c,!0)}},[e,o]),(0,xe.useEffect)(()=>{a.length>0&&gm(n,i,a,l.current)},[n,i,a]),(0,xe.useEffect)(()=>{let f=d.current;f!==a&&(Dl(i,f),d.current=a,t.drafts.length>0&&a.length>0&&Ri(i,a,t.drafts))},[a,i,t]),(0,xe.useEffect)(()=>()=>{Pl(i,d.current)},[i]),(0,ql.jsx)(_r,{route:a,t:r,client:h,draft:!0})}function gm(e,t,n,r){!Nl(t,n)||r.has(n)||(r.add(n),(async()=>{try{let o=await te(e);Il(t,n,Le(o.namespace,n))}catch(o){r.delete(n),console.warn("[bre] deferred api keys: could not read the settings document for this route:",o)}})())}var Qr="data-bre-create-keys",bm="bre-keys-host",ym="data-bre-key-input",Jr="data-bre-region",Yt=new WeakMap;function wm(e){let t=e.querySelector(`input[${ym}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function Wl(e){let t=Yt.get(e)?.host;if(t!==void 0&&t.isConnected)return t;let n=e.nextElementSibling;return n instanceof HTMLDivElement&&n.hasAttribute(Qr)?n:void 0}function Bl(e,t){if(e.closest(`[${Qr}]`)!==null){Xt(e);return}let n=wm(e);if(n===void 0){Xt(e);return}if(e.parentElement===null)return;ge(e,Tt,!0);let r=Yt.get(e),o=Wl(e);o===void 0&&(r!==void 0&&Ci(e,r),o=e.ownerDocument.createElement("div"),o.className=bm,e.after(o)),Y(o,Qr,"");let i=e.getAttribute(Jr);if(i===null?o.hasAttribute(Jr)&&o.removeAttribute(Jr):Y(o,Jr,i),r!==void 0&&r.host===o)return;r!==void 0&&Ci(e,r);let a={drafts:[]};n.value.length>0&&(a.drafts=[{ref:"key-1",value:n.value,enabled:!0}],Wr(n,""),console.info("[bre] create card: moved the typed key into the draft list"));let s=o,d=Xe(o,t.refreshed(()=>(0,Oi.createElement)(Ie,{fallbackText:t.t("keysPanelFailed")},(0,Oi.createElement)(Kl,{host:{current:s},store:a,api:t.api,t:t.t,routeIdLabels:t.routeIdLabels,staged:t.staged}))),{sync:!0});Yt.set(e,{host:o,mount:d})}function Ci(e,t){Yt.delete(e),Ne(t.mount)}function Xt(e){ge(e,Tt,!1);let t=Yt.get(e);t!==void 0&&Ci(e,t),Wl(e)?.remove()}function Gl(){for(let e of Array.from(document.querySelectorAll(`[${Qr}]`))){let t=e.previousElementSibling;t instanceof HTMLElement&&Yt.has(t)?Xt(t):e.remove()}}var Pi="bre-create-host",Di="bre-add-mode-picker",vm='[class*="addCard"]',xm='[class*="addPanel"]',km='[class*="addModes"]',Em="-custom-panel",Tm="-custom";function zl(){return{hosts:new Map}}function Ii(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(vm)))if(o.isConnected)try{Mm(o,t,n),r.add(o)}catch(i){Zr(o,n);for(let a of Ni(o))try{Xt(a)}catch{}$l(o,!1),console.warn("[bre] add provider card: left the official form in place:",i)}for(let o of Array.from(n.hosts.keys()))(!r.has(o)||!o.isConnected)&&Zr(o,n)}function Mm(e,t,n){let r=Rm(e,Em);if(r===void 0){Ul(e);return}if(r.hidden){Ul(e);return}Cm(e,r,t,n),Am(e,t),Hm(r,t),$l(e,!0)}var Lm=".field, label",Sm=".bre-keys-host, .bre-keys, .bre-create-host";function Ni(e){let t=[],n=e.querySelectorAll('input[type="password"], input[data-bre-key-input]');for(let r of Array.from(n)){if(r.closest(Sm)!==null)continue;let o=r.closest(Lm)??r.parentElement;o!==null&&!t.includes(o)&&t.push(o)}return t}function Am(e,t){for(let n of Ni(e))try{Br(n,{t:t.t})}catch(r){console.warn("[bre] add provider card: could not dress a key field:",r)}}function Hm(e,t){for(let n of Ni(e))try{Bl(n,{t:t.t,api:t.api,routeIdLabels:t.routeIdLabels,staged:t.stagedKeys,refreshed:t.refreshed})}catch(r){Xt(n),console.warn("[bre] add provider card: could not mount the key list:",r)}}function $l(e,t){let n=Vl(e);n!==void 0&&ge(n,Di,t)}function Rm(e,t){for(let n of Array.from(e.querySelectorAll(xm)))if(n.id.endsWith(t))return n}function Vl(e){let t=e.querySelector(km);if(t!==null){for(let n of Array.from(t.children))if(n instanceof HTMLElement&&n.getAttribute("role")==="tablist")return n}}function Ul(e){let t=Vl(e);if(t!==void 0){for(let n of Array.from(t.querySelectorAll('[role="tab"]')))if(n.id.endsWith(Tm)){if(n.disabled)return;n.getAttribute("aria-selected")!=="true"&&n.click();return}}}function Om(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.classList.contains(Pi))return t}function Cm(e,t,n,r){let o=r.hosts.get(e),i=Om(t);if(i!==void 0&&o!==void 0&&o.host===i)return;Zr(e,r),i!==void 0&&i.remove();let a=e.ownerDocument.createElement("div");a.className=Pi,t.insertBefore(a,t.firstChild);let s=Xe(a,n.refreshed(()=>(0,jl.createElement)(Rl,{host:{current:a},api:n.api,t:n.t,routeIdLabels:n.routeIdLabels,staged:n.staged})),{sync:!0});r.hosts.set(e,{host:a,mount:s})}function Zr(e,t){let n=t.hosts.get(e);n!==void 0&&(t.hosts.delete(e),Ne(n.mount))}function Yl(e){for(let t of Array.from(e.hosts.keys()))Zr(t,e);for(let t of Array.from(document.querySelectorAll(`.${Pi}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${Di}`)))ge(t,Di,!1);for(let t of Array.from(document.querySelectorAll(`.${Wt}`)))Bt(t);Gl()}var Rn="data-bre-row-provider",Xl="{provider}",Dm=["rowCard","setupCard"];function Jl(){return mr()}function Ze(e){for(let t of Dm)for(let n of Array.from(e.querySelectorAll(`[class*="${t}"]`))){let r=n.parentElement;if(!(r===null||r.tagName!=="UL")&&he(r).length!==0)return r}}function On(e){return e.querySelector('[class*="rowHead"]')??void 0}function Jt(e){let t=e.querySelector('[class*="rowName"]')?.textContent?.trim();return t!==void 0&&t.length>0?t:void 0}function Pm(e){let t=e.indexOf(Xl);if(!(t<0))return{prefix:e.slice(0,t),suffix:e.slice(t+Xl.length)}}function Im(e){let t=e.trim();if(t.length===0)return;let n=/^(.*) \(([^()]*)\)$/.exec(t);if(n!==null){let r=n[2];return r.length===0?void 0:r}return/\s/.test(t)?void 0:t}var Nm='[class*="rowCard"], [class*="setupCard"], [class*="addCard"]';function _m(e){let t=e.closest(Nm);for(let n=e;n!==null&&n!==t;n=n.parentElement)if(n.matches('[data-plugin], [class*="bre-"]'))return!0;return!1}function et(e,t){let n=e.querySelector("[data-bre-provider]")?.getAttribute("data-bre-provider");if(typeof n=="string"&&n.length>0)return n;for(let r of t.editProvider){let o=Pm(r);if(o!==void 0)for(let i of Array.from(e.querySelectorAll("button[aria-label]"))){if(_m(i))continue;let a=i.getAttribute("aria-label")??"";if(a.length<=o.prefix.length+o.suffix.length||!a.startsWith(o.prefix)||!a.endsWith(o.suffix))continue;let s=Im(a.slice(o.prefix.length,a.length-o.suffix.length));if(s!==void 0)return s}}}function _i(e){let t=e.getAttribute(Rn);return t===null||t.length===0?void 0:t}function Fm(e){return ln(e,_i)}function Ql(e,t,n){if(!e.isConnected)return;let r=Ze(e);if(r===void 0)return;let o=t.labels();for(let i of he(r)){let a=et(i,o);if(a===void 0){i.removeAttribute(Rn);continue}_i(i)!==a&&i.setAttribute(Rn,a)}yr(e,r,Km(t),n)}function Km(e){return{rowOf:t=>{let n=t.closest("li");return n instanceof HTMLElement?n:void 0},idOf:_i,labelOf:Jt,order:t=>da(t),commit:t=>{aa(Fm(t))},seatOf:On,seatDrags:!0,gripLabel:(t,n)=>e.t("providerReorderAria",{provider:Jt(t)??n}),gripHint:()=>e.t("providerReorderHint")}}function Zl(e){wr(e);let t=Array.from(document.querySelectorAll(`[${Rn}]`));gr(t);for(let n of t)n.removeAttribute(Rn)}var Qt="data-bre-provider-switch",eo="bre-row-disabled";function tc(){return{switches:new WeakSet}}function nc(e,t,n){if(!e.isConnected)return;let r=Ze(e);if(r===void 0)return;let o=t.labels();for(let i of Array.from(r.children)){if(!(i instanceof HTMLElement))continue;let a=et(i,o);if(a===void 0)continue;let s=On(i);s!==void 0&&(qm(i,s,a,t,n),i.classList.toggle(eo,!Pt(a)))}}function rc(){for(let e of Array.from(document.querySelectorAll(`[${Qt}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${eo}`)))e.classList.remove(eo)}function qm(e,t,n,r,o){let i=t.querySelector(`[${Qt}]`);if(i!==null){ec(i,e,n,r);return}let a=document.createElement("button");a.className="bre-provider-switch",a.setAttribute("type","button"),a.setAttribute("role","switch"),a.setAttribute(Qt,n),ec(a,e,n,r),Wm(a,e,o);let s=t.querySelector('[class*="rowActions"]');s===null?t.appendChild(a):s.insertBefore(a,s.firstChild)}function ec(e,t,n,r){let o=r.t("providerToggleAria",{provider:Jt(t)??n}),i=r.t("providerToggleHint"),a=Pt(n)?"true":"false";e.getAttribute(Qt)!==n&&e.setAttribute(Qt,n),e.getAttribute("aria-checked")!==a&&e.setAttribute("aria-checked",a),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}function Wm(e,t,n){n.switches.has(e)||(n.switches.add(e),e.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let o=e.getAttribute(Qt);if(o===null)return;let i=!Pt(o);ua(o,i),e.setAttribute("aria-checked",i?"true":"false"),t.classList.toggle(eo,!i)}))}var to="data-bre-provider-delete",oc='[class*="rowActions"]',ic='[class*="dangerButton"]',Bm="bre-provider-delete";function ac(e,t){if(!e.isConnected)return;let n=Ze(e);if(n===void 0)return;let r=t.labels(),o=Gm(n)??t.t("providerRemoveDisabled");for(let i of Array.from(n.children)){if(!(i instanceof HTMLElement))continue;let a=et(i,r);if(a===void 0)continue;let s=On(i);if(s===void 0)continue;let d=s.querySelector(oc);if(d===null)continue;let l=d.querySelector(`[${to}]`);if(d.querySelector(ic)!==null){l!==null&&l.remove();continue}let u=l??Um();d.lastElementChild!==u&&d.appendChild(u),jm(u,a,o,t.t("providerRemoveLocked",{provider:Jt(i)??a}))}}function sc(){for(let e of Array.from(document.querySelectorAll(`[${to}]`)))e.remove()}function Gm(e){let n=e.querySelector(`${oc} ${ic}`)?.textContent?.trim()??"";return n.length>0?n:void 0}function Um(){let e=document.createElement("button");return e.className=Bm,e.setAttribute("type","button"),e.setAttribute("disabled",""),e}function jm(e,t,n,r){e.getAttribute(to)!==t&&e.setAttribute(to,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("aria-label")!==r&&e.setAttribute("aria-label",r),e.getAttribute("title")!==r&&e.setAttribute("title",r)}var no="data-bre-provider-disabled-group",zm="bre-provider-disabled-seat",dc="bre-provider-disabled-group",Fi="bre-row-folded",Ki="bre-row-hidden";function lc(){return{expanded:!1}}function cc(e,t,n){if(!e.isConnected)return;let r=Ze(e);if(r===void 0)return;let o=fc(r,t.labels()),i=o.filter(l=>!l.enabled).length,a=pc(r);if(i===0){a!==void 0&&a.remove(),qi(o,n);return}let s=a??$m(r,t,n);(s.parentElement!==r||r.lastElementChild!==s)&&r.append(s),qi(o,n);let d=mc(s);d!==void 0&&hc(d,i,t,n)}function uc(){for(let e of Array.from(document.querySelectorAll(`[${no}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${Ki}, .${Fi}`)))e.classList.remove(Ki,Fi)}function fc(e,t){let n=[];for(let r of Array.from(e.children)){if(!(r instanceof HTMLElement)||r.getAttribute(no)!==null)continue;let o=et(r,t);o!==void 0&&n.push({row:r,id:o,enabled:Pt(o)})}return n}function qi(e,t){for(let n of e){let r=!n.enabled;n.row.classList.toggle(Fi,r),n.row.classList.toggle(Ki,r&&!t.expanded)}}function pc(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.getAttribute(no)!==null)return t}function mc(e){return e.querySelector(`button.${dc}`)??void 0}function $m(e,t,n){let r=document.createElement("li");r.className=zm,r.setAttribute(no,"");let o=document.createElement("button");return o.className=dc,o.setAttribute("type","button"),o.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),n.expanded=!n.expanded,Vm(e,t,n)}),r.appendChild(o),e.append(r),r}function Vm(e,t,n){let r=fc(e,t.labels());qi(r,n);let o=pc(e);if(o===void 0)return;let i=r.filter(s=>!s.enabled).length;if(i===0){o.remove();return}let a=mc(o);a!==void 0&&hc(a,i,t,n)}function hc(e,t,n,r){let o=n.t(r.expanded?"providerDisabledGroupHide":"providerDisabledGroupShow",{count:t}),i=n.t("providerDisabledGroupHint"),a=r.expanded?"true":"false";e.textContent!==o&&(e.textContent=o),e.getAttribute("aria-expanded")!==a&&e.setAttribute("aria-expanded",a),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}var Cn="data-bre-row-model",Wi="bre-model-grid";function bc(){return mr()}function Ym(e){let t=[];for(let n of Array.from(e.querySelectorAll('[class*="modelList"]')))he(n).filter(o=>o.matches('[class*="modelEntry"]')).length!==0&&t.push(n);return t}function yc(e){for(let t of e){if(t.type!=="childList")continue;let n=t.target;if(n instanceof HTMLElement&&n.matches('[class*="modelList"]')&&he(n).some(r=>r.matches('[class*="modelEntry"]')))return!0;for(let r of[t.addedNodes,t.removedNodes])for(let o of Array.from(r))if(o instanceof HTMLElement&&o.matches('[class*="modelEntry"]'))return!0}return!1}function ro(e){let t=e.getAttribute(Cn);return t===null||t.length===0?void 0:t}function Bi(e,t){let n=e.closest("li");if(n!==null)return et(n,t.labels())}function gc(e,t){let n=we(e,t.labels().modelName);return n.length>0?n:ro(e)}function Xm(e,t){return{rowOf:n=>{let r=n.closest('[class*="modelEntry"]');return r instanceof HTMLElement?r:void 0},idOf:ro,labelOf:n=>gc(n,t),order:n=>{let r=Bi(e,t);return r===void 0?n:va(r,n)},commit:n=>{let r=Bi(n,t);r!==void 0&&ya(r,ln(n,ro))},seatOf:n=>n.querySelector('[class*="modelRow"]')??void 0,seatDrags:!1,gripLabel:(n,r)=>t.t("modelReorderAria",{model:gc(n,t)??r}),gripHint:()=>t.t("modelReorderHint"),decorate:(n,r)=>{r.classList.add(Wi)}}}function wc(e,t,n){if(!e.isConnected)return;let r=t.labels();for(let o of Ym(e))if(Bi(o,t)!==void 0){for(let i of he(o)){let a=we(i,r.modelId);if(a.length===0){i.removeAttribute(Cn);continue}ro(i)!==a&&i.setAttribute(Cn,a)}yr(e,o,Xm(o,t),n)}}function vc(e){wr(e);for(let n of Array.from(document.querySelectorAll(`.${Wi}`)))n.classList.remove(Wi);let t=Array.from(document.querySelectorAll(`[${Cn}]`));gr(t);for(let n of t)n.removeAttribute(Cn)}var Jm="settings.models",He={capacity:["modelAdvanced","Model options","Capacities"],modelId:["modelId","Model ID"],modelName:["modelName","Display name"],routeId:["customRoute","Provider ID"],baseUrl:["baseUrl","Base URL"],apiProtocol:["customApi","API protocol"],apply:["apply","Apply"],cancel:["cancel","Cancel"],editProvider:["editProvider","Edit {provider}"],inputImage:["modelInputImage","Image"],contextWindow:["modelContextWindow","contextWindow","Context window","\u4E0A\u4E0B\u6587\u7A97\u53E3"],maxOutput:["modelMaxOutput","maxOutput","maxTokens","Max output","\u6700\u5927\u8F93\u51FA"]};function Ec(e){let{ctx:t,api:n,t:r,onIdle:o,refreshed:i}=e,a=()=>{let x=t.locale.bind(Jm),A=g=>{let O=[];for(let U of g){let ne=x(U);ne!==U&&ne.trim()!==""&&!O.includes(ne)&&O.push(ne)}return O.length===0?g:[...O,...g.filter(U=>!O.includes(U))]};return{capacity:A(He.capacity),modelId:A(He.modelId),modelName:A(He.modelName),routeId:A(He.routeId),baseUrl:A(He.baseUrl),apiProtocol:A(He.apiProtocol),apply:A(He.apply),cancel:A(He.cancel),editProvider:A(He.editProvider),inputImage:A(He.inputImage),contextWindow:A(He.contextWindow),maxOutput:A(He.maxOutput)}},s=120,d=1e3,l=ld(),u=Jl(),h={t:r,labels:a},f=tc(),c={t:r,labels:a},p={t:r,labels:a},m=lc(),b={t:r,labels:a},M=bc(),E={t:r,labels:a},v=nl(),D={t:r},I=zl(),P=Tl(),Z=Cl(),L={t:r,api:n,routeIdLabels:()=>a().routeId,staged:P,stagedKeys:Z,refreshed:i},H,w,R,N,K=x=>{for(let A of x)for(let g of Array.from(A.addedNodes)){if(!(g instanceof HTMLElement))continue;let O=g.matches('[class*="modelAdvanced"]')?[g]:Array.from(g.querySelectorAll('[class*="modelAdvanced"]'));for(let U of O)fi(U)}},W=!1,q={api:n,describeNamespace:()=>te(n),t:r,labels:a,onIdle:o,onBackoff:x=>{j(x)},onPendingChanged:()=>{ee()},mount(x,A){let g=document.createElement("div");g.className="bre-effort-slot",g.dataset.plugin=ue,x.appendChild(g);let O=(0,kc.createRoot)(g),U=ne=>{O.render((0,Gi.createElement)(Ie,{fallbackText:r("renderFailed"),children:i(()=>(0,Gi.createElement)(cr,ne))}))};return(0,xc.flushSync)(()=>{U(A)}),{unmount:()=>{try{O.unmount()}finally{g.remove()}},render:U}}},oe=0;function j(x){if(W)return;let A=Date.now()+x;w!==void 0&&A>=oe||(w!==void 0&&window.clearTimeout(w),oe=A,w=window.setTimeout(()=>{w=void 0,oe=0,ee()},x))}let X=()=>{let x=Ke();Ze(x)!==void 0&&(Ql(x,h,u),nc(x,c,f),ac(x,p),cc(x,b,m),wc(x,E,M),Li(),ul(x))},z=(x,A)=>{try{A()}catch(g){console.error(`[bre] ${x} failed:`,g)}};function ee(){W||H!==void 0||(H=window.setTimeout(()=>{H=void 0,z("composer mutation",()=>{N?.()}),z("editor reconcile",()=>{Sd(Ke(),q,l)}),z("add-card reconcile",()=>{Ii(Ke(),L,I)}),z("editor tabs reconcile",()=>{ki(Ke(),D,v)}),z("dom decorations",()=>{X()}),Al(P,n).then(x=>{x>0&&j(d)}),_l(Z,n,We).then(x=>{x>0&&j(d)})},s))}let G=x=>{if(W||R!==void 0)return;N=x,z("models page startup",()=>{x(),X()}),Ed();let A=g=>{x(),Ii(Ke(),L,I),ki(Ke(),D,v),X(),yc(g)&&Md(Ke())};R=new MutationObserver(g=>{z("models mutation",()=>{A(g)}),z("early reasoning hide",()=>{K(g)}),ee()}),R.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["hidden"]}),ee()},ie=()=>{W=!0,H!==void 0&&(window.clearTimeout(H),H=void 0),w!==void 0&&(window.clearTimeout(w),w=void 0),R?.disconnect(),R=void 0};return{state:l,labels:a,start:G,stopObserver:ie,teardown:()=>{if(!l.disposed){ie(),l.disposed=!0,bd(),sd(l,q);for(let[x,A]of l.mounted)gn(x),A.editor.unmount();l.mounted.clear(),Zl(u),rc(),sc(),uc(),ls(),fl(),vl(),vc(M),Yl(I),il(),Qs(),Td()}},flushOnUnload:()=>{dd(l,q)},schedule:ee}}function Qm(e,t){let n=e?.list?.getSnapshot(),r=n?.current;if(typeof r=="string"&&r.length>0)return r;let o=t?.adapter?.current?.getSnapshot?.()?.key;if(typeof o=="string"&&o.length>0)return o;for(let[i,a]of Object.entries(n?.byId??{}))if(!(a===void 0||(a.retainedBy?.mainView??0)<=0))return typeof a.id=="string"&&a.id.length>0?a.id:i}function Tc(e){let t,n=new Map,r=(a,s)=>{for(let[d,l]of n){if(d===s)continue;let u;try{u=a.directoryFor(l.sessionId)===d}catch{u=!1}u||(l.restore(),n.delete(d))}};return{ensure:()=>{let a=e.ctx,s=a.get?.("sessions"),d=a.get?.("uiSession"),l=a.get?.("modelDirectories"),u=Qm(s,d);if(!(u===void 0||l===void 0))try{let h=l.directoryFor(u);return r(l,h),t!==void 0&&t.sessionId===u&&t.directory===h||(n.has(h)||n.set(h,{sessionId:u,restore:Oa(h,{configuredEffort:e.configuredEffort})}),t={sessionId:u,directory:h}),h}catch{t=void 0;return}},dispose:()=>{for(let[,a]of n)a.restore();n.clear()}}}var ze=require("react");var Mc="settings.models.provider-card";function Zm(e){if(e===null)return;let t=e.querySelector('[class*="editorActions"]');if(t===null)return;let n=Array.from(t.querySelectorAll("button")),r=t.querySelector('button[class*="secondaryButton"]')??n.at(-2)??null;r!==null&&(r instanceof HTMLButtonElement&&r.disabled||r.click())}function eh({provider:e,api:t,t:n}){let r=(0,ze.useRef)(null),o=e?.provider,i=(0,ze.useCallback)(()=>{Zm(Ln(r.current))},[]);return(0,ze.useEffect)(()=>{let a=r.current,s=Ln(a);if(a===null||s===null)return;let d=s,l=()=>s.querySelector('[class*="_editor"]')!==null,u=()=>{let f=l()?"1":"0";a.dataset.edit!==f&&(a.dataset.edit=f)};u();let h=new MutationObserver(u);return h.observe(d,{childList:!0,subtree:!0}),()=>{h.disconnect()}},[o]),typeof o!="string"||o.length===0?null:(0,ze.createElement)("div",{ref:r,className:"bre-headers-host","data-bre-provider":o},(0,ze.createElement)(Yr,{host:r,t:n}),(0,ze.createElement)(Vr,{route:o,api:t,t:n,onDismiss:i}))}function Lc(e,t,n){let r=e,o=r.slots?.inject(Mc,()=>{r.slots?.register({name:Mc,key:be,inject:()=>({api:t,t:n})},eh)});return typeof o=="function"?o:()=>{}}var Re=require("react");function Sc(e){let{t}=e,n=(0,Re.useSyncExternalStore)(Wn,Pe),r=()=>{ta(!n)};return(0,Re.createElement)("div",{className:"bre-slider-setting"},(0,Re.createElement)("div",{className:"bre-slider-setting-row"},(0,Re.createElement)("div",{className:"bre-slider-setting-copy"},(0,Re.createElement)("div",{className:"bre-slider-setting-title"},t("sliderToggleTitle")),(0,Re.createElement)("div",{className:"bre-slider-setting-description"},t("sliderToggleDescription"))),(0,Re.createElement)("div",{className:"bre-slider-setting-control"},(0,Re.createElement)("span",{className:"bre-slider-setting-state"},t(n?"settingOn":"settingOff")),(0,Re.createElement)("button",{type:"button",role:"switch","aria-label":t("sliderToggleAria"),"aria-checked":n,className:"bre-slider-setting-switch"+(n?" is-on":""),onClick:r},(0,Re.createElement)("span",{className:"bre-slider-setting-switch-knob","aria-hidden":!0})))))}function Ac(e,t){let n=e,r=n.slots?.inject("settings.models.footer",()=>{n.slots?.register({name:"settings.models.footer",id:ue+"-slider-toggle",order:15,inject:()=>({t})},Sc)});return typeof r=="function"?r:()=>{}}var th=ue,nh=["slots","locale","connection","remote","remote.settings"];function rh(e){e.effect(()=>e.locale.register(uo,{zh:Zi,en:Qi}),"dsh-model-think-level: dictionaries");let t=document.createElement("style");t.dataset.plugin=ue,t.dataset.pluginStyles=ue,t.textContent=xa,document.head.appendChild(t),e.effect(()=>()=>t.remove(),"dsh-model-think-level: stylesheet");let n=(()=>{try{let p=e.get?.("configForms");try{let b=p?.get?.(be);if(b!==void 0)return b}catch{}return e.get?.("settingsScope")?.bind?.({namespace:be})}catch{return}})(),r=n===void 0?{settings:e.remote.settings}:{settings:e.remote.settings,scope:n},o=e.locale.bind(uo),i=()=>{let p=e.locale;return typeof p.subscribe=="function"&&typeof p.getSnapshot=="function"?p:void 0},a=p=>{let m=i();return m===void 0?p():(0,Hc.createElement)(Ji,{locale:m,children:p})},s=Qa({api:r}),d=Ia(r),l=Tc({ctx:e,configuredEffort:s.of}),u=Ja({menuOf:Va,triggerOf:Ya,t:o,refreshed:a,sliderEnabled:Pe,directory:l.ensure,configuredInputs:d}),h=es({api:r}),f=Ec({ctx:e,api:r,t:o,onIdle:h.run,refreshed:a}),c=()=>{l.ensure(),u.reconcile()};e.effect(()=>(f.start(c),()=>{f.teardown(),u.dispose(),l.dispose()}),"dsh-model-think-level: DOM injector"),e.effect(()=>{let p=()=>{f.flushOnUnload()};return window.addEventListener("pagehide",p),()=>{window.removeEventListener("pagehide",p)}},"dsh-model-think-level: ledger flush on unload"),e.effect(()=>{let p=()=>{f.state.describePromise=void 0,s.invalidate(),d.invalidate(),h.invalidate(),f.schedule()},m=[e.remote.$on("settings/document-updated",b=>{b===be&&p()}),e.on("connection/reset",p)];return()=>{for(let b of m)b()}},"dsh-model-think-level: pushed invalidations"),e.effect(()=>{let p=v=>{v.key===qn?na(v.newValue!=="false"):v.key===Bn?sa(Ct(v.newValue)):v.key===Un?fa(la(v.newValue)):v.key===zn&&wa(vo(v.newValue))};window.addEventListener("storage",p);let m=Wn(()=>{f.schedule()}),b=Gn(()=>{f.schedule()}),M=jn(()=>{f.schedule()}),E=$n(()=>{f.schedule()});return()=>{window.removeEventListener("storage",p),m(),b(),M(),E()}},"dsh-model-think-level: client preferences"),e.effect(()=>Ac(e,o),"dsh-model-think-level: footer slot activation"),e.effect(()=>Lc(e,r,o),"dsh-model-think-level: provider-card slot activation")}
|
|
1918
3435
|
|
|
1919
3436
|
return module.exports;
|
|
1920
3437
|
}
|