openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
19 lines • 1.79 kB
JavaScript
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{K as t,X as n,q as r}from"./lit-runtime-CV_MH99K.js";import{Sa as i,Ta as a}from"./control-ui-boot-shared-DfZ39Yj9.js";import{n as o,t as s}from"./select-picker-BNhpItgu.js";function c(e){let t=`__openclaw_custom_model__`,i=new Set([e.value,...e.options.map(e=>e.value)]);for(;i.has(t);)t+=`_`;let s=e.options.some(t=>t.value===e.value),c=[...e.options.map(e=>({...e,description:e.detail})),...e.custom?[{value:t,label:e.custom.label}]:[]];return n`
<div class="model-picker">
${o({id:e.id,label:e.label,value:e.value,options:c,disabled:e.disabled,title:e.title,placement:e.placement,className:`model-picker__select ${e.className??``}`,onOpen:e.onOpen,renderLeading:e=>e.provider?a(e.provider,{className:`model-picker__provider-icon`}):r,onChange:e.onChange,onChangeTarget:(n,r)=>{let i=r.closest(`.model-picker`)?.querySelector(`.model-picker__custom`);if(n===t&&i){i.hidden=!1,queueMicrotask(()=>i.focus());return}i&&(i.hidden=!0),e.onChange(n)}})}
${e.custom?n`<input
id=${e.custom.id??r}
class="settings-input model-picker__custom"
aria-label=${e.custom.label}
aria-invalid=${e.custom.invalid?`true`:`false`}
aria-describedby=${e.custom.describedBy??r}
placeholder=${e.custom.placeholder??``}
.value=${e.value}
?hidden=${s}
?disabled=${e.disabled}
@input=${t=>{e.custom?.commit!==`change`&&e.onChange(t.currentTarget.value)}}
@change=${t=>{e.custom?.commit===`change`&&e.onChange(t.currentTarget.value)}}
/>`:r}
</div>
`}function l(){return(l=e((()=>{t(),i(),s()})))()}export{c as n,l as t};
//# sourceMappingURL=model-picker-CB45-l8O.js.map