import { BlockService } from '@blockeditor/block-std';
import { assertExists } from '@blockeditor/global/utils';
import { EmbedYoutubeStyles, youtubeUrlRegex, } from './embed-youtube-model.js';
import { queryEmbedYoutubeData } from './utils.js';
export class EmbedYoutubeService extends BlockService {
    constructor() {
        super(...arguments);
        this.queryUrlData = (embedYoutubeModel) => {
            return queryEmbedYoutubeData(embedYoutubeModel);
        };
    }
    mounted() {
        super.mounted();
        const pageService = this.std.spec.getService('affine:page');
        assertExists(pageService);
        pageService.registerEmbedBlockOptions({
            flavour: this.flavour,
            urlRegex: youtubeUrlRegex,
            styles: EmbedYoutubeStyles,
            viewType: 'embed',
        });
    }
}
//# sourceMappingURL=embed-youtube-service.js.map