import { BlockService } from '@blockeditor/block-std';
import { assertExists } from '@blockeditor/global/utils';
import { EmbedGithubStyles, githubUrlRegex, } from './embed-github-model.js';
import { queryEmbedGithubApiData, queryEmbedGithubData } from './utils.js';
export class EmbedGithubService extends BlockService {
    constructor() {
        super(...arguments);
        this.queryUrlData = (embedGithubModel) => {
            return queryEmbedGithubData(embedGithubModel);
        };
        this.queryApiData = (embedGithubModel) => {
            return queryEmbedGithubApiData(embedGithubModel);
        };
    }
    mounted() {
        super.mounted();
        const pageService = this.std.spec.getService('affine:page');
        assertExists(pageService);
        pageService.registerEmbedBlockOptions({
            flavour: this.flavour,
            urlRegex: githubUrlRegex,
            styles: EmbedGithubStyles,
            viewType: 'card',
        });
    }
}
//# sourceMappingURL=embed-github-service.js.map