<?php

namespace DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Form\Fields;

use DropshippingExportFreeVendor\WPDesk\Forms\Field\NoOnceField;
use DropshippingExportFreeVendor\WPDesk\Forms\Field\SelectField;
use DropshippingExportFreeVendor\WPDesk\Forms\Field\SubmitField;
use DropshippingExportFreeVendor\WPDesk\Forms\FieldProvider;
/**
 * Class ImportManagerFormFields, import manager form fields.
 *
 * @package WPDesk\Library\DropshippingExport\Form\Fields
 */
class ExportManagerFormFields implements FieldProvider
{
    const SELECT_MANAGE = 'manage';
    const SELECT_MANAGE_BOTTOM = 'manage2';
    const SELECT_MANAGE_OPTION_BULK = 'none';
    const SELECT_MANAGE_OPTION_REMOVE = 'remove';
    const SUBMIT_MANAGE_APPLY = 'apply';
    const SUBMIT_MANAGE_APPLY_BOTTOM = 'apply2';
    const NONCE_ACTION = 'import_manager_action';
    const NONCE_NAME = 'import_manager_nonce';
    /**
     * @see FieldProvider::get_fields()
     */
    public function get_fields()
    {
        $beacon = $this->get_beacon_translations();
        return [(new SelectField())->set_name(self::SELECT_MANAGE)->add_class('hs-beacon-search')->set_attribute('data-beacon_search', $beacon['import'])->set_options($this->get_manage_select_options()), (new SubmitField())->set_name(self::SUBMIT_MANAGE_APPLY)->set_label(__('Apply', 'dropshipping-export-free'))->add_class('button action')->set_attribute('id', self::SUBMIT_MANAGE_APPLY), (new SelectField())->set_name(self::SELECT_MANAGE_BOTTOM)->add_class('hs-beacon-search')->set_attribute('data-beacon_search', $beacon['import'])->set_options($this->get_manage_select_options()), (new SubmitField())->set_name(self::SUBMIT_MANAGE_APPLY_BOTTOM)->set_label(__('Apply', 'dropshipping-export-free'))->add_class('button action')->set_attribute('id', self::SUBMIT_MANAGE_APPLY_BOTTOM), (new NoOnceField(self::NONCE_ACTION))->set_name(self::NONCE_NAME)];
    }
    private function get_manage_select_options(): array
    {
        return [self::SELECT_MANAGE_OPTION_BULK => __('Bulk', 'dropshipping-export-free'), self::SELECT_MANAGE_OPTION_REMOVE => __('Remove', 'dropshipping-export-free')];
    }
    private function get_beacon_translations(): array
    {
        return ['import' => __('Import manager', 'dropshipping-export-free')];
    }
}
