/**
 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
 */
/**
 * @module ai/aiconfig
 * @publicApi
 */
import { type AIAssistantConfig } from './aiassistant/aiassistant.js';
import { type AIChatConfig } from './aichat/aichat.js';
import { type AISuggestionActionName } from './aichat/ui/feed/aichatfeedsuggestionitemactionsview.js';
import { type AIQuickActionsConfig } from './aiquickactions/aiquickactions.js';
import { type AITranslateConfig } from './aitranslate/aitranslate.js';
import { type AIModelsConfig } from './aicore/model/aimodels.js';
import { type AIReviewModeConfig } from './aireviewmode/aireviewmode.js';
/**
 * The configuration for all AI-related functionalities.
 *
 * Provides configuration properties for both AI features and AI adapters (which connect to the external AI services),
 *
 * ```ts
 * ClassicEditor
 * 	.create( {
 * 		ai: {
 * 			// ...
 * 		}
 * 	} )
 * 	.then( ... )
 * 	.catch( ... );
 * ```
 *
 * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
 */
export interface AIConfig {
    /**
     * The URL of the AI service endpoint.
     *
     * This endpoint is used by AI features: AI Chat, AI Quick Actions, and AI Review Mode.
     * It does not affect the AI Assistant feature, which uses its own adapter configuration.
     *
     * **NOTE:** By default, the plugin uses the default AI service endpoint delivered by CKEditor Cloud Services.
     *
     * @default 'https://ai.cke-cs.com/v1'
     */
    serviceUrl?: string;
    /**
     * The configuration of the {@link module:ai/aiassistant/aiassistant~AIAssistant AI Assistant feature}.
     *
     * Read more in {@link module:ai/aiassistant/aiassistant~AIAssistantConfig}.
     */
    assistant?: AIAssistantConfig;
    /**
     * The configuration of the AI user interface provided by the {@link module:ai/aitabs/aitabs~AITabs} plugin.
     */
    container?: AIContainerConfig;
    /**
     * The configuration of the {@link module:ai/aichat/aichat~AIChat AI Chat feature}.
     *
     * Read more in {@link module:ai/aichat/aichat~AIChatConfig}.
     */
    chat?: AIChatConfig;
    /**
     * The configuration of the AI Quick Actions feature.
     *
     * Read more in {@link module:ai/aiquickactions/aiquickactions~AIQuickActionsConfig}.
     */
    quickActions?: AIQuickActionsConfig;
    /**
     * The configuration of the AI Review feature.
     *
     * Read more in {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig}.
     */
    review?: AIReviewModeConfig;
    /**
     * The configuration of the {@link module:ai/aitranslate/aitranslate~AITranslate AI Translate feature}.
     */
    translate?: AITranslateConfig;
    /**
     * The configuration for AI models used across all AI features (Chat and Review).
     *
     * ```ts
     * ClassicEditor.create( {
     * 	ai: {
     * 		models: {
     * 			defaultModelId: 'gpt-5',
     * 			displayedModels: [ 'gpt', 'claude' ],
     * 			showModelSelector: true
     * 		}
     * 	}
     * } )
     * .then( ... )
     * .catch( ... );
     * ```
     */
    models?: AIModelsConfig;
    /**
     * Defines what actions are available for the user when interacting with AI responses in AI Chat and AI Quick Actions features.
     *
     * Users can perform following two actions:
     *
     * * `'applySuggestion'` - applies the presented change directly into the editor content.
     * * `'insertSuggestion'` - applies the presented change as a suggestion, which can be later on accepted or rejected.
     *
     * This setting impacts:
     *
     * * The action buttons located below an AI reply in the chat feed.
     * * The buttons located in the header of each change preview in the chat feed.
     * * The buttons located in the balloon which shows the change preview.
     *
     * Through this configuration option, you can change how users use the AI replies. For example, if you want to force users to always
     * insert AI-proposed changes as suggestions, omit `'applySuggestion'` action.
     *
     * Please note other factors that impact the availability of these actions:
     *
     * * Buttons related to `'applySuggestion'` action are hidden if {@link module:track-changes/trackchanges~TrackChanges track changes}
     * feature is turned on.
     * * Buttons related to `'insertSuggestion'` action are hidden if {@link module:track-changes/trackchanges~TrackChanges track changes}
     * feature is not loaded in the editor.
     *
     * Please note, that due to these factors, it is possible to accidentally configure the editor in a way, that no UI elements are
     * presented to the user.
     *
     * @default [ 'applySuggestion', 'insertSuggestion' ]
     */
    availableReplyActions?: Array<AISuggestionActionName>;
}
export type AIContainerType = 'sidebar' | 'overlay' | 'custom';
export type AIContainerSide = 'left' | 'right';
export interface AIContainerBase {
    type: AIContainerType;
    /**
     * This option is used to show or hide the resize button in the AI user interface.
     *
     * Defaults to `true`.
     */
    showResizeButton?: boolean;
    /**
     * Whether the AI interface should be visible when the editor is created.
     */
    visibleByDefault?: boolean;
    /**
     * When `true`, clicking the active tab button collapses the panel and toggles the
     * `ck-ai-tabs_collapsed` CSS class on the AI tabs DOM element. Clicking the tab again expands
     * it back. When `false`, clicking the active tab button is a no-op.
     *
     * Defaults to `false`.
     */
    collapsible?: boolean;
}
/**
 * The configuration of the AI user interface container in the sidebar mode. Provide an existing DOM
 * element to use as the container the AI user interface will automatically render into that element.
 *
 * Additionally, the {@link module:ai/aitabs/aitabs~AITabs tab buttons} can be positioned on the preferred
 * side of the container.
 *
 * ```ts
 * ClassicEditor
 * 	.create( {
 * 		attachTo: document.querySelector( '#editor' ),
 * 		// ... Other configuration options ...
 * 		ai: {
 * 			container: {
 * 				type: 'sidebar',
 *
 * 				// Existing DOM element to use as the container for the AI user interface.
 * 				element: document.querySelector( '#ai-sidebar-container' ),
 *
 * 				// (Optional) The preferred side of the element to position the tab buttons.
 * 				side: 'right'
 * 			},
 * 		}
 * 	} )
 * 	.then( ... )
 * 	.catch( ... );
 * ```
 */
export interface AIContainerSidebar extends AIContainerBase {
    type: 'sidebar';
    element: HTMLElement;
    side?: AIContainerSide;
}
/**
 * The configuration of the AI user interface container in the overlay mode. In this mode, the AI user
 * interface is displayed on top of the web page on a preferred side. This mode is best suited
 * for integrations with limited space.
 *
 * ```ts
 * ClassicEditor
 * 	.create( {
 * 		attachTo: document.querySelector( '#editor' ),
 * 		// ... Other configuration options ...
 * 		ai: {
 * 			container: {
 * 				type: 'overlay',
 * 				side: 'right'
 * 			},
 * 		}
 * 	} )
 * 	.then( ... )
 * 	.catch( ... );
 * ```
 */
export interface AIContainerOverlay extends AIContainerBase {
    type: 'overlay';
    side?: AIContainerSide;
}
/**
 * The configuration of the AI user interface container in the custom mode.
 *
 * In this mode, integrator is responsible for rendering the AI user interface in the web page.
 *
 * * Use {@link module:ai/aitabs/aitabs~AITabs#view} to access the view of the AI user interface,
 * * Use {@link module:ai/aitabs/tabs/aitabsview~AITabsView#getTabIds} to read available IDs of individual tabs in the AI user interface,
 * * Use {@link module:ai/aitabs/tabs/aitabsview~AITabsView#getTab} to access individual tab views in the AI user interface,
 * * Use {@link module:ai/aitabs/tabs/aitabsview~AITabsView#addTab} to add a new tab to the AI user interface,
 * * Use {@link module:ai/aitabs/tabs/aitabsview~AITabsView#activateTab} to switch between tabs from the code.
 *
 * For example, to integrate the AI user interface with custom containers on the web page, use the following code:
 *
 * ```ts
 *	const tabsPlugin = editor.plugins.get( 'AITabs' );
 *
 *	for ( const id of tabsPlugin.view.getTabIds() ) {
 *		const tab = tabsPlugin.view.getTab( id );
 *
 *		// Display tab button and panel in a custom container.
 *		myButtonsContainer.appendChild( tab.button.element );
 *		myPanelContainer.appendChild( tab.panel.element );
 *	}
 * ```
 */
export interface AIContainerCustom extends AIContainerBase {
    type: 'custom';
}
/**
 * The configuration of the AI user interface provided by the {@link module:ai/aitabs/aitabs~AITabs} plugin.
 *
 * The AI user interface can operate in three different modes:
 *
 * * {@link module:ai/aiconfig~AIContainerSidebar} - the AI user interface is displayed in a specific DOM element,
 * * {@link module:ai/aiconfig~AIContainerOverlay} - the AI user interface is displayed on top of the web page,
 * * {@link module:ai/aiconfig~AIContainerCustom} - the AI user interface is displayed in a custom way.
 */
export type AIContainerConfig = AIContainerSidebar | AIContainerOverlay | AIContainerCustom;
