import { IgrRingSeriesBase } from "./igr-ring-series-base";
import { Ring as Ring_internal } from "./Ring";
import { toSize, fromSize, fromPoint, toPoint } from "igniteui-react-core";
/**
 * Represents data for
 * Ring.RingControl element.
*/
var IgrRing = /** @class */ /*@__PURE__*/ (function () {
    function IgrRing() {
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
        if (this._initializeAdapters) {
            this._initializeAdapters();
        }
    }
    IgrRing.prototype.createImplementation = function () {
        return new Ring_internal();
    };
    Object.defineProperty(IgrRing.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    IgrRing.prototype.onImplementationCreated = function () {
    };
    IgrRing.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
        if (this._initializeAdapters) {
            this._initializeAdapters();
        }
    };
    Object.defineProperty(IgrRing.prototype, "index", {
        /**
         * Gets the index of ring in the chart.
        */
        get: function () {
            return this.i.j;
        },
        set: function (v) {
            this.i.j = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrRing.prototype, "innerExtend", {
        /**
         * Gets the inner extend of the ring in percentage.
        */
        get: function () {
            return this.i.h;
        },
        set: function (v) {
            this.i.h = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrRing.prototype, "controlSize", {
        /**
         * Gets the size of the ring.
        */
        get: function () {
            return fromSize(this.i.q);
        },
        set: function (v) {
            this.i.q = toSize(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrRing.prototype, "center", {
        /**
         * Gets the center point of the ring.
        */
        get: function () {
            return fromPoint(this.i.p);
        },
        set: function (v) {
            this.i.p = toPoint(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrRing.prototype, "ringSeries", {
        /**
         * Gets reference to ring series.
        */
        get: function () {
            var r = this.i.c;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgrRingSeriesBase._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        },
        set: function (v) {
            v == null ? this.i.c = null : this.i.c = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrRing.prototype, "ringBreadth", {
        /**
         * Gets the ring breadth.
        */
        get: function () {
            return this.i.i;
        },
        set: function (v) {
            this.i.i = +v;
        },
        enumerable: false,
        configurable: true
    });
    IgrRing.prototype.findByName = function (name) {
        if (this.findEphemera) {
            if (name && name.indexOf("@@e:") == 0) {
                return this.findEphemera(name);
            }
        }
        if (this.ringSeries && this.ringSeries.name && this.ringSeries.name == name) {
            return this.ringSeries;
        }
        return null;
    };
    /**
     * Renders the arcs.
    
    */
    IgrRing.prototype.renderArcs = function () {
        var iv = this.i.f();
        return (iv);
    };
    /**
     * Prepares data needed to create
     * Arcs.
    
    */
    IgrRing.prototype.prepareArcs = function () {
        this.i.o();
    };
    return IgrRing;
}());
export { IgrRing };
