"use strict"; class Searchable_Select extends Component { on_ready() { this.selected_value = this.args.value || null; this.all_options = this.args.options || []; if (this.all_options.length > 0) { this.render_options(this.all_options); } // Search functionality const $search = this.$sid('search'); $search.on('input', e => { this.filter_options(e.target.value); }); // Prevent dropdown close when clicking search input $search.on('click', e => { e.stopPropagation(); }); // Update selected text if initial value provided if (this.selected_value) { const selected_option = this.all_options.find(opt => opt.value == this.selected_value); if (selected_option) { this.$sid('selected_text').text(selected_option.label); } } } render_options(options) { const $container = this.$sid('options'); $container.empty(); if (options.length === 0) { $container.append($('