import * as lit from 'lit';
import { LitElement } from 'lit';
import FroalaEditor, { FroalaOptions } from 'froala-editor';

/*!
 * froala_editor v4.3.0 (https://www.froala.com/wysiwyg-editor)
 * License https://froala.com/wysiwyg-editor/terms/
 * Copyright 2014-2024 Froala Labs
 */


/**
 * Norwegian
 */
FroalaEditor.LANGUAGE['no'] = {
  translation: {
    // Place holder
    'Type something': 'Skriv noe',
    // Basic formatting
    'Bold': 'Fet',
    'Italic': 'Kursiv',
    'Underline': 'Understreket',
    'Strikethrough': 'Gjennomstreket',
    // Main buttons
    'Insert': 'Sett inn',
    'Delete': 'Slett',
    'Cancel': 'Avbryt',
    'OK': 'OK',
    'Back': 'Tilbake',
    'Remove': 'Fjern',
    'More': 'Mer',
    'Update': 'Oppdater',
    'Style': 'Stil',
    // Font
    'Font Family': 'Skrifttype',
    'Font Size': 'Skriftst\xF8rrelse',
    // Colors
    'Colors': 'Farger',
    'Background': 'Bakgrunn',
    'Text': 'Tekst',
    'HEX Color': 'HEX-farge',
    // Paragraphs
    'Paragraph Format': 'Format',
    'Normal': 'Normal',
    'Code': 'Kode',
    'Heading 1': 'Overskrift 1',
    'Heading 2': 'Overskrift 2',
    'Heading 3': 'Overskrift 3',
    'Heading 4': 'Overskrift 4',
    // Style
    'Paragraph Style': 'Avsnittsstil',
    'Inline Style': 'Innebygd stil',
    // Alignment
    'Align': 'Juster',
    'Align Left': 'Venstrejuster',
    'Align Center': 'Sentrer',
    'Align Right': 'H\xF8yrejuster',
    'Align Justify': 'Blokkjuster',
    'None': 'Ingen',
    // Lists
    'Ordered List': 'Nummerert liste',
    'Unordered List': 'Punktliste',
    // Indent
    'Decrease Indent': 'Reduser innrykk',
    'Increase Indent': '\xD8k innrykk',
    // Links
    'Insert Link': 'Sett inn lenke',
    'Open in new tab': '\xC5pne i ny fane',
    'Open Link': '\xC5pne lenke',
    'Edit Link': 'Rediger lenke',
    'Unlink': 'Fjern lenke',
    'Choose Link': 'Velg lenke',
    // Images
    'Insert Image': 'Sett inn bilde',
    'Upload Image': 'Last opp bilde',
    'By URL': 'Fra URL',
    'Browse': 'Bla gjennom',
    'Drop image': 'Slipp bilde',
    'or click': 'eller klikk',
    'Manage Images': 'Behandle bilder',
    'Loading': 'Laster',
    'Deleting': 'Sletter',
    'Tags': 'Tagger',
    'Are you sure? Image will be deleted.': 'Er du sikker? Bildet vil bli slettet.',
    'Replace': 'Erstatt',
    'Uploading': 'Laster opp',
    'Loading image': 'Laster bilde',
    'Display': 'Visning',
    'Inline': 'Innebygd',
    'Break Text': 'Bryt tekst',
    'Alternative Text': 'Alternativ tekst',
    'Change Size': 'Endre st\xF8rrelse',
    'Width': 'Bredde',
    'Height': 'H\xF8yde',
    'Something went wrong. Please try again.': 'Noe gikk galt. Vennligst pr\xF8v igjen.',
    'Image Caption': 'Bildetekst',
    'Advanced Edit': 'Avansert redigering',
    // Video
    'Insert Video': 'Sett inn video',
    'Embedded Code': 'Innebygd kode',
    'Paste in a video URL': 'Lim inn en video-URL',
    'Drop video': 'Slipp video',
    'Your browser does not support HTML5 video.': 'Nettleseren din st\xF8tter ikke HTML5-video.',
    'Upload Video': 'Last opp video',
    // Tables
    'Insert Table': 'Sett inn tabell',
    'Table Header': 'Tabelloverskrift',
    'Remove Table': 'Fjern tabell',
    'Table Style': 'Tabellstil',
    'Horizontal Align': 'Horisontal justering',
    'Row': 'Rad',
    'Insert row above': 'Sett inn rad over',
    'Insert row below': 'Sett inn rad under',
    'Delete row': 'Slett rad',
    'Column': 'Kolonne',
    'Insert column before': 'Sett inn kolonne f\xF8r',
    'Insert column after': 'Sett inn kolonne etter',
    'Delete column': 'Slett kolonne',
    'Cell': 'Celle',
    'Merge cells': 'Sl\xE5 sammen celler',
    'Horizontal split': 'Del horisontalt',
    'Vertical split': 'Del vertikalt',
    'Cell Background': 'Cellebakgrunn',
    'Vertical Align': 'Vertikal justering',
    'Top': 'Topp',
    'Middle': 'Midten',
    'Bottom': 'Bunn',
    'Align Top': 'Juster topp',
    'Align Middle': 'Juster midten',
    'Align Bottom': 'Juster bunn',
    'Cell Style': 'Cellestil',
    // Files
    'Upload File': 'Last opp fil',
    'Drop file': 'Slipp fil',
    // Emoticons
    'Emoticons': 'Emojier',
    'Grinning face': 'Grinende ansikt',
    'Grinning face with smiling eyes': 'Grinende ansikt med smilende \xF8yne',
    'Face with tears of joy': 'Ansikt med gledesst\xE5rer',
    'Smiling face with open mouth': 'Smilende ansikt med \xE5pen munn',
    'Smiling face with open mouth and smiling eyes': 'Smilende ansikt med \xE5pen munn og smilende \xF8yne',
    'Smiling face with open mouth and cold sweat': 'Smilende ansikt med \xE5pen munn og kaldsvette',
    'Smiling face with open mouth and tightly-closed eyes': 'Smilende ansikt med \xE5pen munn og hardt lukkede \xF8yne',
    'Smiling face with halo': 'Smilende ansikt med glorie',
    'Smiling face with horns': 'Smilende ansikt med horn',
    'Winking face': 'Blunkende ansikt',
    'Smiling face with smiling eyes': 'Smilende ansikt med smilende \xF8yne',
    'Face savoring delicious food': 'Ansikt som nyter deilig mat',
    'Relieved face': 'Lettet ansikt',
    'Smiling face with heart-shaped eyes': 'Smilende ansikt med hjerteformede \xF8yne',
    'Smiling face with sunglasses': 'Smilende ansikt med solbriller',
    'Smirking face': 'Smilende ansikt',
    'Neutral face': 'N\xF8ytralt ansikt',
    'Expressionless face': 'Uttrykks\xF8st ansikt',
    'Unamused face': 'Uinteressert ansikt',
    'Face with cold sweat': 'Ansikt med kaldsvette',
    'Pensive face': 'Ettertenksomt ansikt',
    'Confused face': 'Forvirret ansikt',
    'Confounded face': 'Forvirret ansikt',
    'Kissing face': 'Kyssende ansikt',
    'Face throwing a kiss': 'Ansikt som sender et kyss',
    'Kissing face with smiling eyes': 'Kyssende ansikt med smilende \xF8yne',
    'Kissing face with closed eyes': 'Kyssende ansikt med lukkede \xF8yne',
    'Face with stuck out tongue': 'Ansikt med utstikkende tunge',
    'Face with stuck out tongue and winking eye': 'Ansikt med utstikkende tunge og blunkende \xF8ye',
    'Face with stuck out tongue and tightly-closed eyes': 'Ansikt med utstikkende tunge og hardt lukkede \xF8yne',
    'Disappointed face': 'Skuffet ansikt',
    'Worried face': 'Bekymret ansikt',
    'Angry face': 'Sint ansikt',
    'Pouting face': 'Furende ansikt',
    'Crying face': 'Gr\xE5tende ansikt',
    'Persevering face': 'Utholdende ansikt',
    'Face with look of triumph': 'Ansikt med triumferende uttrykk',
    'Disappointed but relieved face': 'Skuffet men lettet ansikt',
    'Frowning face with open mouth': 'Rynkende ansikt med \xE5pen munn',
    'Anguished face': 'Angstfylt ansikt',
    'Fearful face': 'Redd ansikt',
    'Weary face': 'Slitent ansikt',
    'Sleepy face': 'S\xF8vnig ansikt',
    'Tired face': 'Tr\xF8tt ansikt',
    'Grimacing face': 'Grimaserende ansikt',
    'Loudly crying face': 'H\xF8ylytt gr\xE5tende ansikt',
    'Face with open mouth': 'Ansikt med \xE5pen munn',
    'Hushed face': 'Dempet ansikt',
    'Face with open mouth and cold sweat': 'Ansikt med \xE5pen munn og kaldsvette',
    'Face screaming in fear': 'Ansikt som skriker i frykt',
    'Astonished face': 'Forbauset ansikt',
    'Flushed face': 'R\xF8dmende ansikt',
    'Sleeping face': 'Sovende ansikt',
    'Dizzy face': 'Svimmel ansikt',
    'Face without mouth': 'Ansikt uten munn',
    'Face with medical mask': 'Ansikt med medisinsk maske',
    // Line breaker
    'Break': 'Linjeskift',
    // Math
    'Subscript': 'Senket skrift',
    'Superscript': 'Hevet skrift',
    // Full screen
    'Fullscreen': 'Fullskjerm',
    // Horizontal line
    'Insert Horizontal Line': 'Sett inn horisontal linje',
    // Clear formatting
    'Clear Formatting': 'Fjern formatering',
    // Save
    'Save': 'Lagre',
    // Undo, redo
    'Undo': 'Angre',
    'Redo': 'Gj\xF8r om',
    // Select all
    'Select All': 'Velg alt',
    // Code view
    'Code View': 'Kodevisning',
    // Quote
    'Quote': 'Sitat',
    'Increase': '\xD8k',
    'Decrease': 'Reduser',
    // Quick Insert
    'Quick Insert': 'Hurtiginnsetting',
    // Spcial Characters
    'Special Characters': 'Spesialtegn',
    'Latin': 'Latin',
    'Greek': 'Gresk',
    'Cyrillic': 'Kyrillisk',
    'Punctuation': 'Tegnsetting',
    'Currency': 'Valuta',
    'Arrows': 'Piler',
    'Math': 'Matematikk',
    'Misc': 'Diverse',
    // Print
    'Print': 'Skriv ut',
    // Spell Checker
    'Spell Checker': 'Stavekontroll',
    // Help
    'Help': 'Hjelp',
    'Shortcuts': 'Snarveier',
    'Inline Editor': 'Innebygd editor',
    'Show the editor': 'Vis editoren',
    'Common actions': 'Vanlige handlinger',
    'Copy': 'Kopier',
    'Cut': 'Klipp ut',
    'Paste': 'Lim inn',
    'Basic Formatting': 'Grunnleggende formatering',
    'Increase quote level': '\xD8k sitatniv\xE5',
    'Decrease quote level': 'Reduser sitatniv\xE5',
    'Image / Video': 'Bilde / Video',
    'Resize larger': '\xD8k st\xF8rrelse',
    'Resize smaller': 'Reduser st\xF8rrelse',
    'Table': 'Tabell',
    'Select table cell': 'Velg tabellcelle',
    'Extend selection one cell': 'Utvid markering med \xE9n celle',
    'Extend selection one row': 'Utvid markering med \xE9n rad',
    'Navigation': 'Navigasjon',
    'Focus popup / toolbar': 'Fokuser popup / verkt\xF8ylinje',
    'Return focus to previous position': 'Returner fokus til forrige posisjon',
    // Embed.ly
    'Embed URL': 'Bygg inn URL',
    'Paste in a URL to embed': 'Lim inn en URL for \xE5 bygge inn',
    // Word Paste
    'The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?': 'Det innlimte innholdet kommer fra et Microsoft Word-dokument. Vil du beholde formateringen eller renske det opp?',
    'Keep': 'Behold',
    'Clean': 'Rensk opp',
    'Word Paste Detected': 'Word-innliming oppdaget',
    // Character Counter
    'Characters': 'Tegn',
    // More Buttons
    'More Text': 'Mer tekst',
    'More Paragraph': 'Mer avsnitt',
    'More Rich': 'Mer rik',
    'More Misc': 'Mer diverse'
  },
  direction: 'ltr'
};

declare enum EditorVariant {
    default = "default",
    meerkit = "meerkit"
}
declare enum EditorPreset {
    minimal = "minimal",
    media = "media",
    full = "full"
}
interface EditorAIOption {
    value: string;
    text: string;
}
type EditorAIOptions = EditorAIOption[];
/**
 * The Editor component is used to create rich text content.
 * @tag m-editor
 * @prop {EditorVariant} variant - The visual style of the editor
 * @prop {EditorPreset} preset - Predefined toolbar configuration preset
 * @prop {FroalaOptions} config - Froala editor configuration options
 * @prop {EditorAIOptions} AIOptions - AI options for the editor
 * @prop {string} imageUploadDescription - Description for the image upload popup
 * @fires {CustomEvent<FroalaEditor>} initialized - Emitted when the editor is initialized with the editor instance
 * @fires {CustomEvent<string>} change - Emitted when the editor content changes with the new HTML content
 * @fires {CustomEvent<void>} blur - Emitted when the editor loses focus
 * @fires {CustomEvent<EditorAIOption>} aiOptionSelected - Emitted when an AI option is selected
 * @slot default - Default content of the editor
 */
declare class Editor extends LitElement {
    get config(): Partial<FroalaOptions> | undefined;
    set config(value: Partial<FroalaOptions> | undefined);
    private _config?;
    preset: EditorPreset;
    variant: EditorVariant;
    AIOptions: EditorAIOption[];
    imageUploadDescription?: string;
    private isInitialized;
    private editor?;
    private editorContainer?;
    private readonly localConfig;
    private reformatPaste;
    private _t;
    firstUpdated(): void;
    connectedCallback(): void;
    disconnectedCallback(): void;
    updated(changedProperties: Map<string, unknown>): void;
    private reinitEditor;
    private initEditor;
    private mergeConfig;
    private destroyEditor;
    private emit;
    /**
     * Updates the editor content with the given content.
     * @param {string} content - The content to update the editor with.
     */
    updateContent(content: string): void;
    /**
     * Updates content at current cursor position. Overwrites existing content if selected.
     * @param {string} content - The content to insert.
     * @returns {boolean} - Returns true if content was inserted, false otherwise.
     */
    updateSelection(content: string): boolean;
    /**
     * Returns the current content of the editor.
     * @returns {string} - The current content of the editor.
     */
    get value(): string;
    set value(value: string);
    protected render(): lit.TemplateResult<1>;
    protected createRenderRoot(): this;
    /**
     * Method to handle the image upload description in the popup.
     */
    private handleImageUploadDescription;
    /**
     * Method to get or create the description element.
     * @param {HTMLElement} popupElement - The popup element.
     * @param {HTMLElement} dropImageArea - The drop image area element.
     * @returns {HTMLElement} - The description element.
     */
    private getOrCreateDescriptionElement;
    /**
     * Method to update the description text.
     * @param {HTMLElement} descriptionElement - The description element to update.
     */
    private updateDescriptionText;
    private registerAICommands;
    private registerSingleAICommand;
    private registerDropdownAICommand;
}

export { Editor, type EditorAIOption, type EditorAIOptions, EditorPreset, EditorVariant };
