<?php
/**
 * File: app/Admin/Wizard/config.php
 *
 * @package KimaAI
 * @since 1.4.0
 */

defined('ABSPATH') || exit;

return [
  'version' => 1,

  'steps' => [
    [
      'id' => 'welcome',
      'title' => __('Welcome to KimaAI Wizard', 'kimaai'),
      'icon' => 'PNGKimaAIIconTwo',
      'description' => __('This wizard will guide you through the initial setup of KimaAI plugin.', 'kimaai'),
      'canSkip' => true,
      'blocks' => [
        ['type' => 'info'],
      ],
    ],

    [
      'id' => 'ai-env',
      'title' => __('Configure AI Provider', 'kimaai'),
      'description' => __('Choose an AI provider and set up your API key to enable AI functionalities, we recommend OpenAI for the best experience.', 'kimaai'),
      'canSkip' => false,
      'blocks' => [
        [
          'type' => 'repeatable',
          'path' => 'aiServices.aiEnvs',
          'repeatable' => [
            // "single" means: show exactly one entry in wizard (no add/remove)
            'mode' => 'single',
            // for repeatable objects: only show these fields in wizard
            'fields' => ['provider', 'apiKey'],
          ],
          // gate continue until test-connection is OK
          'requires' => [
            'testConnection' => true,
            // action key is read from schema: aiEnvs.actions['test-connection']
            'actionKey' => 'test-connection',
          ],
        ],
      ],
    ],

    [
      'id' => 'chat-llm',
      'title' => __('Set Chatbot AI Provider and Model', 'kimaai'),
      'description' => __('Choose the AI provider and model for the chatbot functionality.', 'kimaai'),
      'canSkip' => false,
      'blocks' => [
        [
          'type' => 'fields',
          'paths' => [
            'chatbot.settings.chatAiProvider',
            'chatbot.settings.chatAiModel',
          ],
        ],
      ],
    ],

    [
      'id' => 'chat-preview',
      'title' => __('Nice Work!', 'kimaai'),
      'description' => __('Try the chatbot preview and send your first message to test it out.', 'kimaai'),
      'icon' => 'PNGKimaAIIconFour',
      'canSkip' => true,
      'preview' => 'chatbot',
      'blocks' => [
        ['type' => 'info'],
      ],
    ],

    [
      'id' => 'appearance',
      'title' => __('Chatbot Appearance', 'kimaai'),
      'description' => __("Customize the appearance to match your website's style.", 'kimaai'),
      'canSkip' => true,
      'preview' => 'chatbot',
      'blocks' => [
        [
          'type' => 'fields',
          'paths' => [
            'chatbot.appearance.icon',
            'chatbot.appearance.customIconUrl',
            'chatbot.appearance.bodyBgColor',
            'chatbot.appearance.bodyTextColor',
            'chatbot.appearance.userMessageBgColor',
            'chatbot.appearance.userMessageTextColor',
            'chatbot.appearance.aiMessageBgColor',
            'chatbot.appearance.aiMessageTextColor',
          ],
        ],
      ],
    ],

    [
      'id' => 'done',
      'title' => __('All Done!', 'kimaai'),
      'description' => __('You have completed the KimaAI setup wizard. You can revisit settings anytime.', 'kimaai'),
      'icon' => 'PNGKimaAIIconThree',
      'canSkip' => true,
      'blocks' => [
        ['type' => 'done'],
      ],
    ],
  ],
];
