<commit_before>import { $, fastdom, isVoidElement, promise } from '../util/index';

var svgs = {}, parser = new DOMParser();

export default function (UIkit) {

    UIkit.component('svg', {

        attrs: true,

        props: {
            id: String,
            icon: String,
            src: String,
            class: String,
            style: String,
            width: Number,
            height: Number,
            ratio: Number
        },

        defaults: {
            ratio: 1,
            id: false,
            class: '',
            exclude: ['src']
        },

        init() {
            this.class += ' uk-svg';
        },

        connected() {

            if (!this.icon && this.src && ~this.src.indexOf('#')) {

                var parts = this.src.split('#');

                if (parts.length > 1) {
                    this.src = parts[0];
                    this.icon = parts[1];
                }
            }

            this.width = this.$props.width;
            this.height = this.$props.height;

            this.svg = this.getSvg().then(doc => promise((resolve, reject) => fastdom.mutate(() => {

                var svg, el;

                if (!doc) {
                    reject('SVG not found.');
                    return;
                }
<commit_msg>fix reserved keyword in component properties; resolves #2547<commit_after>import { $, fastdom, isVoidElement, promise } from '../util/index';

var svgs = {}, parser = new DOMParser();

export default function (UIkit) {

    UIkit.component('svg', {

        attrs: true,

        props: {
            id: String,
            icon: String,
            src: String,
            style: String,
            width: Number,
            height: Number,
            ratio: Number,
            'class': String
        },

        defaults: {
            ratio: 1,
            id: false,
            exclude: ['src'],
            'class': ''
        },

        init() {
            this.class += ' uk-svg';
        },

        connected() {

            if (!this.icon && this.src && ~this.src.indexOf('#')) {

                var parts = this.src.split('#');

                if (parts.length > 1) {
                    this.src = parts[0];
                    this.icon = parts[1];
                }
            }

            this.width = this.$props.width;
            this.height = this.$props.height;

            this.svg = this.getSvg().then(doc => promise((resolve, reject) => fastdom.mutate(() => {

                var svg, el;

                if (!doc) {
                    reject('SVG not found.');
                    return;
                }

{'fraction_non_alphanumeric': 0.13655224443606187, 'fraction_numerical': 0.004526593738211996, 'mean_word_length': 1.1318327974276527, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2532882', 'n_tokens_mistral': 736, 'n_tokens_neox': 683, 'n_words': 165}