<div data-domain-search-ai class="domain-search-advanced search-group search-group-lg {if $templatefile == 'domainregister' || $templatefile == 'homepage'}domain-search-input{/if} {if $templatefile == 'domainregister' && $RSThemes['pages']['domainregister']['name'] == 'modern' || $templatefile == 'homepage'}search-group-combined{/if} {if isset($smarty.get.query) || ($RSThemes.addonSettings.domain_search_default_classic  == 'enabled' && !isset($smarty.get.message))}hidden{/if}">
    <div class="search-field w-100 d-flex flex-nowrap">
        {if ($RSThemes['pages'][$templatefile]['config']['SearchPrefix'] || $RSThemes['pages'][$templatefile]['config']['SearchPrefix'] == "1")}
            <div class="inline-form-prefix">
                <span>{$LANG.orderForm.www}</span>
            </div>
        {/if}
        <label for="message" class="sr-only">
            {$rslang->trans('domains.ai_search.input_placeholder')}
        </label>
        <input {if isset($smarty.get.query) || ($RSThemes.addonSettings.domain_search_default_classic  == 'enabled' && !isset($smarty.get.message))}disabled{/if} {if !isset($smarty.get.query) && ($RSThemes.addonSettings.domain_search_default_classic  != 'enabled' || isset($smarty.get.message))}data-ai-advanced-search{/if} type="text" name="message" id="message" class="form-control input-lg" title="{lang key='domainSearch.domainOrAiPrompt'}" data-trigger="manual" value="{$message}" placeholder="{$rslang->trans('domains.ai_search.input_placeholder')}">
        <div class="search-field-icon">
            {include file="$template/assets/img/aisearch-icon.svg"}
        </div>
    </div>
    <div class="dropdown dropdown-multi-level pull-right" data-multi-level-dropdown>
        <div tabindex="0" role="button" aria-expanded="false" class="form-control input-lg dropdown-toggle mt-0" data-toggle="dropdown">
            <span>{$rslang->trans('generals.filters')}</span>
            <i class="ls ls-caret"></i>
        </div>
        <div class="dropdown-menu">
            <div class="dropdown" data-dropdown-select data-dropdown-select-search-only data-dropdown-counter>
                <a tabindex="0" href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <span class="flex align-items-center">
                        {if isset($selectedTlds) && is_array($selectedTlds) && !empty($selectedTlds)}
                            <span class="badge badge-primary-faded mr-2" data-tld-count>{$selectedTlds|count}</span>
                            <span class="">{lang key='domainSearch.tlds'}</span>
                        {/if}
                    </span>
                    <span class="ls ls-right"></span>
                    <span class="ls ls-down"></span>
                </a>
                <div class="dropdown-menu dropdown-menu-search mt-0" data-dropdown-multiselect>
                    <div class="dropdown-header input-group align-center">
                        <i class="input-group-icon lm lm-search"></i>
                        <input class="form-control" placeholder="Search..." type="text" data-dropdown-select-search>
                    </div>
                    <div class="dropdown-menu-items has-scroll" data-dropdown-select-list>
                        {foreach $tlds as $tld}
                            <div class="dropdown-menu-item dropdown-menu-item-checkbox {if in_array($tld, $selectedTlds)}active{/if}" data-value="{$tld}">
                                <label class="w-full flex w-100 tld-option" data-value="{$tld}">
                                    <span type="checkbox" class="checkbox-styled {if in_array($tld, $selectedTlds)}checked{/if}"></span>
                                    <span>{$tld}</span>
                                </label>
                            </div>
                        {/foreach}
                    </div>
                    <div class="dropdown-menu-item dropdown-menu-no-data" style="display: none;">
                        <span class="text-info">{$LANG.norecordsfound}</span>
                    </div>
                </div>
            </div>
            <div class="dropdown" data-dropdown-counter>
                <a tabindex="0" href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <span class="">{lang key='domainSearch.maxLength'}</span>
                    <span class="ls ls-right"></span>
                    <span class="ls ls-down"></span>
                </a>
                <ul class="dropdown-menu">
                    <li class="dropdown-menu-items has-scroll">
                        {foreach $searchLengths as $len}
                            <a tabindex="0" class="dropdown-menu-item length-option {if $maxLength === $len}active{/if}" data-value="{$len}">{$len}</a>
                        {/foreach}
                    </li>
                </ul>
            </div>
            <div class="dropdown-divider"></div>
            <div class="dropdown-menu-item dropdown-menu-item-checkbox">
                <label class="w-full flex w-100 ">
                    <input type="checkbox" name="filter" class="icheck-control" {if $safeSearchSelected}checked{/if}>
                    <span>{lang key="domainSearch.safeSearch"}</span>
                </label>
            </div>
        </div>
        <select class="hidden" name="tlds[]" data-advanced-tld-select class="multiselect multiselect-filter" multiple="multiple" data-placeholder="{lang key='domainSearch.tlds'}" data-min-selection="1">
            {foreach $tlds as $tld}
                <option{if in_array($tld, $selectedTlds)} selected {if count($selectedTlds) <= 1}disabled="disabled"{/if}{/if} value="{$tld}">{$tld}</option>
            {/foreach}
        </select>
        <select class="hidden" name="maxLength" data-advanced-lenght-select class="multiselect" data-placeholder="{lang key='domainSearch.maxLength'}">
            {foreach $searchLengths as $len}
                <option value="{$len}" {if $maxLength === $len}selected{/if}>{$len}</option>
            {/foreach}
        </select>
    </div>
    <div class="search-group-btn">
        <button tabindex="0" {if $templatefile == 'homepage'}id="btnDomainSearch"{else}id="btnCheckAvailability"{/if} class="btn btn-lg btn-primary{if $searchBoxStyle == 'primary' &&  (empty($RSThemes.pages.domainregister.name) || $RSThemes.pages.domainregister.name != 'modern')}-faded{/if} mt-0" type="submit" {if $templatefile == 'domainregister'} {if $captcha}{$captcha->getButtonClass($captchaForm)}{/if}{/if}>
            <span>{$rslang->trans('generals.generate')}</span>
            <div class="loader loader-button">
                {if $searchBoxStyle == 'primary'}
                    {include file="$template/includes/common/loader.tpl" classes="spinner-sm"}
                {else}
                    {include file="$template/includes/common/loader.tpl" classes="spinner-sm spinner-light"}
                {/if}
            </div>
        </button>
    </div>
</div>
