/*************************************************************************
Copyright (c) 2011. Adobe Systems Incorporated. All rights reserved.

You may distribute this file in source code or object code, solely in
unmodified form, and in all cases only as incorporated into your own
application created with the Adobe software.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

**************************************************************************/
/*************************************************************************
 AdobePatentID="B1316"
 AdobePatentID="B1318"
 edge.authoring.0.0.1.min.js - version 0.1.1
**************************************************************************/
 (function(g, i) {
    function o(a) {
        return i.compositionDefns[a]
    }
    var u = i.triggerDict = {
        element: function(a, b, c) {
            a && (b == "document" ? this.$(document).bind(c, a) : this.$(b).bind(c, a))
        },
        timeline: function(a, b, c) { / ^on[A - Z] / .test(b) && (b = b.charAt(2).toLowerCase() + timeline.subStr(3));
            if (a && b) {
                var d = this.getTimelineData(b),
                v = d.toState,
                d = d.fromState,
                f = {};
                f[c] = a;
                this._getTimeline(b, v, d).addObserver(f)
            }
        }
    },
    m = i.Symbol = function(a, b) {
        i.Notifier.call(this);
        this.widgetEventPrefix = "edgeSym_";
        this.element = null;
        this.options = {
            data: null,
            initialState: null
        };
        this.states = {};
        this.timelines = {};
        this.timelineCache = {};
        this.timelineStateMap = {};
        this.defaultBaseState = "Base State";
        this.baseState = null;
        this._init(a, b)
    };
    i.symbol = m;
    var t = i.PropertyTween,
    r = t.substituteParameters;
    m._substituteParameters = r;
    var p,
    s = i.symbolDefns = {};
    i.baseDataName = "edgeBaseData";
    g.extend(m.prototype, i.Notifier.prototype, {
        constructor: m,
        _init: function(a, b) {
            if (b && (g.extend(this.options, b), g.isArray(b.observers) && b.observers.length)) for (var c = b.observers.length, d = 0; d < c; d++) this.addObserver(b.observers[d]);
            if (!this.options.data) return null;
            this.element = a;
            this.composition = this.options.composition;
            d = this._createEvent();
            this.notifyObservers("onPreSymbolInit", d);
            c = this._createEvent();
            if (d.performDefaultAction) {
                d = g(a);
                d.data("edgeSymbol", this);
                if (!d.get(0).id) d.get(0).id = m._makeUniqueID();
                var v = this,
                f = this.options.data;
                this.parameterValues = this._makeDefaultParameters();
                g.extend(this.parameterValues, this.options.parameters);
                var e = this._getSymbolParams();
                this.setParameter("_stage", e.symbolSelector);
                this.setParameter("_" +
                d[0].id, e.symbolSelector);
                d.find("*").each(function(a, b) {
                    b.id && v.setParameter("_" + b.id, "#" + b.id)
                });
                f.content && this._injectMarkup();
                f.actions && this._addActionsFromData(f.actions);
                f.timelines && this._createTimelineSetFromData(f.timelines, f.states);
                f.bindings && f.bindings.length && this._addBindingsFromData(f.bindings);
                e = d[0].nodeName == "BODY";
                f.content && f.content.dom && !e && (f = d.css("position"), f != "absolute" && f != "relative" && d.css("position", "relative"));
                this._goToInitialState();
                // if (d[0].style && (typeof d[0].style.webkitTransform ==
                // "undefined" || d[0].style.webkitTransform === "" || d[0].style.webkitTransform == "none")) d[0].style.webkitTransform = "translateZ(0)";
                this.notifyObservers("onPostSymbolInit", c);
                return this
            } else this.notifyObservers("onPostSymbolInit", c)
        },
        _createEvent: function(a) {
            var b = {
                Symbol: this,
                element: this.element,
                performDefaultAction: !0
            };
            g.extend(b, a);
            return b
        },
        _makeDefaultParameters: function() {
            var a = {},
            b = this.options.data.parameters;
            if (b) for (var c in b) if (b.hasOwnProperty(c)) a[c] = b[c].defaultValue;
            g.extend(a, this._getSymbolParams());
            return a
        },
        _injectMarkup: function(a) {
            var b = a,
            c = this._createEvent({
                markup: b
            });
            this.notifyObservers("onPreInjectMarkup", c);
            b = c.markup;
            a = this._createEvent({
                markup: b
            });
            if (c.performDefaultAction) {
                var d,
                c = this.parameterValues;
                d = this.options.data.content;
                if (!b && d) if (d.ref) b = "",
                g(d.ref).each(function(a, c) {
                    b += g(c).html()
                });
                else if (d.markup) b = d.markup;
                else if (d.dom) {
                    var e = i.DeclareMarkup;
                    if (e) {
                        var f = d.dom,
                        h = d.symbolInstances,
                        f = JSON.parse(JSON.stringify(d.dom)),
                        h = [];
                        d.symbolInstances && (h = JSON.parse(JSON.stringify(d.symbolInstances)));
                        var k = f.length;
                        for (d = 0; d < k; d++) this._reIdDOMElements(f[d], h);
                        e.renderDOM(f, g(this.element).get(0), c, this.getSymbolTypeName(), h, this.composition);
                        h && h.length > 0 && this._processNestedSymbolInstances(h);
                        if (this.idLookup) for (var j in this.idLookup) this.idLookup.hasOwnProperty(j) && (g(j).data("originalId", this.idLookup[j]), g(j).data("symParent", this))
                    }
                }
                if (b) {
                    if ((j = this._getParentSymbol()) && j.options.data.actors && j.options.data.actors.instance_parameters) {
                        e = j.options.data.actors.instance_parameters;
                        f = e.length;
                        for (d = 0; d < f; d++) h = t.substituteParameters(e[d].selector, j._getSymbolParams()),
                        g(h).filter(g(this.element)).length && g.extend(c, e[d].parameters)
                    }
                    b = r(b, c);
                    g(b).appendTo(this.element)
                }
            }
            this.notifyObservers("onPostInjectMarkup", a)
        },
        _processNestedSymbolInstances: function(a) {
            if (a) {
                this.aSymbolInstances = [];
                for (var b = a.length, c = 0; c < b; c++) {
                    var d = "#" + a[c].id;
                    g(d).get(0) && this.composition && (this.composition.convertElementToSymbolInstance(d, a[c].symbolName), this.aSymbolInstances.push(d))
                }
            }
        },
        _reIdDOMElements: function(a,
        b) {
            if (a) {
                var c = g(this.element).get(0).id,
                d = a.id;
                if (!d || d === "") d = m._makeUniqueID();
                for (var c = c + "_" + d, e = b.length, f = 0; f < e; f++) if (b[f].id == a.id) b[f].id = c;
                this.idLookup = this.idLookup || {};
                this.idLookup["#" + c] = d;
                this.setParameter("_" + d, "#" + c);
                a.oldId = a.id;
                a.id = c;
                if (a.c) {
                    d = a.c.length;
                    for (c = 0; c < d; c++) this._reIdDOMElements(a.c[c], b)
                }
            }
        },
        _getParentSymbol: function() {
            for (var a = g(this.element).parents(), b = a.length, c = 0; c < b; c++) {
                var d = m.get(a[c]);
                if (d) return d
            }
            return null
        },
        _createTimelineSetFromData: function(a, b) {
            this.states =
            b;
            this.timelines = a;
            this.baseState = this.options.data.baseState;
            if (!this.baseState) this.baseState = "Base State";
            return this
        },
        _addBindingFromData: function(a) {
            var b = a[0];
            if (b[0] == "element") {
                var c = r(b[1], this.parameterValues);
                c != b[1] && (b = i.cloneJSONObject(b), b[1] = c)
            }
            if (c = u[b[0]])(a = this._getActionCallbackFunc(b[0], b[1], a.slice(1))) && c.apply(this, [a].concat(b.slice(1)))
        },
        _addBindingsFromData: function(a) {
            for (var b = a.length, c = 0; c < b; c++) this._addBindingFromData(a[c])
        },
        _getActionCallbackFunc: function(a, b, c) {
            var d =
            this[c[0]],
            e = this;
            if (typeof d == "function") if (c.slice(1), a == "element") return function() {
                try {
                    var a = Array.prototype.slice.call(arguments);
                    return d.apply(e, a)
                } catch(b) {}
            };
            else if (a == "timeline") return function() {
                try {
                    var c = Array.prototype.slice.call(arguments),
                    h = g.Event(a);
                    c.splice(0, 0, h, b);
                    return d.apply(e, c)
                } catch(k) {}
            };
            return null
        },
        _addActionsFromData: function(a) {
            g.extend(this, a)
        },
        _getSymbolParams: function() {
            return {
                symbolSelector: "#" + g(this.element).get(0).id
            }
        },
        _flushCache: function() {
            var a = this.timelines,
            b;
            for (b in a) a.hasOwnProperty(b) && this._dirtyTimeline(b)
        },
        _goToInitialState: function() {
            var a = {
                parameters: this.parameterValues
            },
            b = this.options.data.initialState;
            if (!b) b = this.options.data.baseState;
            m.useCSSAnimation || (b ? this._applyRules(this._buildStateForCache(null, b, a)) : (this.options.data.autoPlay || this.getTimelineData("Default Timeline")) && this.seekTimeline("Default Timeline", 0))
        },
        _getDefltTL: function() {
            return "Default Timeline"
        },
        _preNotify: function(a, b, c) {
            var d = {};
            g.extend(d, c);
            c = this._createEvent({
                tlName: b,
                tlOptions: d
            });
            this.notifyObservers(a, c);
            if (c.performDefaultAction) return c.tlOptions;
            else d = c.tlOptions,
            b = {
                Symbol: this,
                timelineName: b,
                tlOptions: d,
                performDefaultAction: !0
            },
            a = a.replace(/onPre/, "onPost"),
            this.notifyObservers(a, b)
        },
        _posToNum: function(a, b) {
            if (typeof b === "string") {
                var c = this.getTimelineData(a);
                if (!c || !c.labels) return 0;
                return c.labels[b]
            }
            return b
        },
        play: function(a, b) {
            this._stop(this._getDefltTL());
            return this.playTimeline(this._getDefltTL(), a, b)
        },
        playTimeline: function(a, b, c) {
            var d = this;
            setTimeout(function() {
                var e = d._preNotify("onPreSymbolPlay", a, c);
                if (typeof e !== void 0) {
                    b = d._posToNum(a, b);
                    if (typeof a === "string") {
                        d._rememberBaseStateForTimeline(a);
                        var f = {
                            parameters: d.parameterValues,
                            startPos: b
                        };
                        g.extend(f, e);
                        if (d.timelines) {
                            var h = d._getTimeline(a);
                            if (h) h.currentDirection = "forward";
                            d._play(a, f)
                        }
                    }
                    e = d._createEvent({
                        timeline: a,
                        tlOptions: e
                    });
                    d.notifyObservers("onPostSymbolPlay", e)
                }
            },
            0);
            return this
        },
        playReverse: function(a, b) {
            this.stop(a, b);
            return this.playTimelineReverse(this._getDefltTL(),
            a, b)
        },
        playTimelineReverse: function(a, b, c) {
            var d = this;
            setTimeout(function() {
                var e = d._preNotify("onPreSymbolPlayReverse", a, c);
                if (typeof e !== void 0) {
                    b = d._posToNum(a, b);
                    var f = d._getTimeline(a);
                    if (typeof b === "undefined") b = f.currentPosition;
                    if (b == 0) d.stop(f.getDuration(), c),
                    d.playTimelineReverse(a, f.getDuration(), c);
                    else {
                        if (typeof a === "string") {
                            var h = {
                                parameters: d.parameterValues,
                                playDirection: "reverse",
                                startPos: b
                            };
                            g.extend(h, e);
                            h.noTriggers = !0;
                            f.currentDirection = "reverse";
                            f.play(h);
                            h.noTriggers = !1
                        }
                        e = d._createEvent({
                            timeline: a,
                            tlOptions: e
                        });
                        d.notifyObservers("onPostSymbolPlayReverse", e)
                    }
                }
            },
            0);
            return this
        },
        seek: function(a, b) {
            return this.seekTimeline(this._getDefltTL(), a, b)
        },
        seekTimeline: function(a, b, c) {
            c = this._preNotify("onPreSymbolSeek", a, c);
            if (typeof c === void 0) return null;
            b = this._posToNum(a, b);
            if (typeof a === "string") {
                this._rememberBaseStateForTimeline(a);
                var d = {
                    parameters: this.parameterValues
                };
                g.extend(d, c);
                this.timelines && this._seek(a, b, d)
            }
            this.notifyObservers("onPostSymbolSeek", this._createEvent({
                timeline: a,
                tlOptions: c
            }));
            return null
        },
        stop: function(a, b) {
            return this.stopTimeline(this._getDefltTL(), a, b)
        },
        stopTimeline: function(a, b, c) {
            var d = this;
            d._stop(a);
            setTimeout(function() {
                var e = d._preNotify("onPreSymbolStop", a, c);
                if (typeof e === void 0) return null;
                if (typeof a === "string") {
                    var f = {
                        parameters: d.parameterValues
                    };
                    g.extend(f, e);
                    d.timelines && (typeof b === "undefined" ? b = d.getTimelinePosition(a) : typeof b === "string" && (b = d._posToNum(a, b)), d._seek(a, b, f))
                }
            },
            0)
        },
        _stop: function(a) { (a = this._getTimeline(a)) && a.stop()
        },
        getPosition: function() {
            return this.getTimelinePosition(this._getDefltTL())
        },
        getTimelinePosition: function(a) {
            if (typeof a === "string" && (a = this._getTimelineWithOwnStates(a))) return a.getCurrentPosition()
        },
        getDuration: function() {
            return this.getTimelineDuration(this._getDefltTL())
        },
        getTimelineDuration: function(a) {
            if (typeof a === "string" && (a = this._getTimelineWithOwnStates(a))) return a.getDuration()
        },
        isPlaying: function() {
            return this.isTimelinePlaying(this._getDefltTL())
        },
        isTimelinePlaying: function(a) {
            if (typeof a === "string") {
                if (!this._getTimelineWithOwnStates(a).timer) return ! 1;
                return ! 0
            }
        },
        isPlayDirectionReverse: function() {
            return this.isTimelinePlayDirectionReverse(this._getDefltTL())
        },
        isTimelinePlayDirectionReverse: function(a) {
            if (typeof a === "string") {
                a = this._getTimelineWithOwnStates(a);
                if (a.currentContext) {
                    if (a.currentContext.playDirection == "reverse") return ! 0
                } else if (a.currentDirection == "reverse") return ! 0;
                return ! 1
            }
        },
        lookupSelector: function(a) {
            if (typeof a === "string") try {
                return r("${_" + a + "}", this.parameterValues)
            } catch(b) {}
        },
        getComposition: function() {
            return this.composition
        },
        getSymbolElementNode: function() {
            return g(this.element).get(0)
        },
        getSymbolTypeName: function() {
            return this.options.data.typeName
        },
        getParameter: function(a) {
            return this.parameterValues[a]
        },
        setParameter: function(a, b) {
            this.parameterValues[a] = b
        },
        destroy: function() {
            g(this.ele).removeData("edgeSymbol");
            return this
        },
        _addState: function(a, b) {
            this.states[a] = b
        },
        _addTimelineData: function(a, b) {
            this.timelines[a] = b;
            if (b.fromState && b.toState) this.timelineStateMap = {}
        },
        _getTimelineFromStates: function(a, b) {
            if (typeof this.timelineStateMap[a + "//" + b] == "undefined") {
                for (var c in this.timelines) if (this.timelines.hasOwnProperty(c)) {
                    var d =
                    this.timelines[c];
                    this.timelineStateMap[d.fromState + "//" + d.toState] = c
                }
                typeof this.timelineStateMap[a + "//" + b] == "undefined" && (this.timelineStateMap[a + "//" + b] = null);
                return this.timelineStateMap[a + "//" + b]
            }
        },
        _saveObservers: function(a) {
            var b = this.timelines[a],
            b = this._getTimeline(a, b.toState, b.fromState);
            if (!this.timelineObservers) this.timelineObservers = {};
            this.timelineObservers[a] = b.observers.slice(0)
        },
        _restoreObservers: function(a, b) {
            if (this.timelineObservers && this.timelineObservers[a]) {
                var c = this.timelineObservers[a];
                if (c) {
                    var d,
                    e = c.length;
                    for (d = 0; d < e; d++) b.addObserver(c[d])
                }
            }
        },
        _dirtyTimeline: function(a) {
            this._saveObservers(a);
            this.timelineCache[this._makeTimelineKey(a)] = null;
            this.timelineStateMap = {};
            this.toStateCache = this.fromStateCache = null
        },
        _isCacheDIrty: function(a) {
            return this.timelineCache[this._makeTimelineKey(a)] === null
        },
        _getStateData: function(a) {
            return this.states[a]
        },
        getTimelineData: function(a) {
            return this.timelines[a]
        },
        _makeTimelineKey: function(a, b, c) {
            var d = null;
            if (!b || !c) d = this.getTimelineData(a);
            if (d) {
                if (!b) b =
                d.toState;
                if (!c) c = d.fromState
            }
            return a + "-" + (b ? b: "") + "-" + (c ? c: "")
        },
        _getBaseStateData: function() {
            if (this.baseState) return this._getStateData(this.baseState);
            else for (var a in this.states) if (this.states[a].baseState) return this.baseState = a,
            this._getStateData(this.baseState);
            return this._getStateData(this.defaultBaseState)
        },
        _mergeBaseState: function(a) {
            var b = i.cloneJSONObject(this._getBaseStateData()),
            c;
            for (c in a) a.hasOwnProperty(c) && (b[c] || (b[c] = []), b[c] = b[c].concat(a[c]));
            return b
        },
        _getTimelineWithOwnStates: function(a) {
            var b =
            this.getTimelineData(a);
            if (!b) return null;
            return this._getTimeline(a, b.toState, b.fromState)
        },
        _getTimeline: function(a, b, c) {
            var d = this._makeTimelineKey(a, b, c);
            if (this.timelineCache[d]) return this.timelineCache[d];
            var e = this.getTimelineData(a).timeline;
            if (b || c) e = i.cloneJSONObject(e);
            for (var f = e.length, h = {},
            g = {},
            j, l, n = 0; n < f; n++) l = e[n],
            l.tween && (j = l.tween[1], h[j] || (h[j] = []), h[j].push(l), j = l.tween[0] + ":" + l.tween[1] + ":" + l.tween[2], g[j] || (g[j] = []), g[j].push(l));
            l = function(a, b) {
                return a.position - b.position
            };
            for (j in g) g.hasOwnProperty(j) && g[j].sort(l);
            var m,
            o,
            z,
            r,
            s,
            t,
            p,
            u;
            if (b) for (m in b = this._mergeBaseState(this._getStateData(b)), b) if (b.hasOwnProperty(j)) {
                n = b[m];
                o = h[m];
                z = n.length;
                for (p = 0; p < z; p++) {
                    l = n[p];
                    r = l[0];
                    s = l[1];
                    t = l[2];
                    var q = null,
                    w = -1,
                    f = o.length;
                    for (u = 0; o && u < f; u++) if (l = o[u], j = l.tween, j[0] == r && j[2] == s && (w == -1 || l.position + l.duration > w)) q = l,
                    w = l.position + l.duration;
                    q && q.tween.length > 4 && q.tween[4] && q.tween[4].copyToState && (q.tween[3] = t)
                }
            }
            b = {};
            if (c) for (m in c = this._getStateData(c), c) if (c.hasOwnProperty(m)) {
                n =
                c[m];
                o = h[m];
                z = n.length;
                for (p = 0; p < z; p++) {
                    l = n[p];
                    r = l[0];
                    s = l[1];
                    t = l[2];
                    b[r + ":" + m + ":" + s] = t;
                    q = null;
                    w = -1;
                    if (o) f = o.length;
                    for (u = 0; o && u < f; u++) if (l = o[u], j = l.tween, j[0] == r && j[2] == s && (w == -1 || l.position < w)) q = l,
                    w = l.position;
                    if (q && (l = q.tween.length > 4 && q.tween[4] && q.tween[4].copyFromState, q.tween.length < 4 || !q.tween[4] || typeof q.tween[4].fromValue == "undefined" || l)) q.tween[4] || (q.tween[4] = {}),
                    q.tween[4].fromValue = t
                }
            }
            if (c) for (j in g) if (g.hasOwnProperty(j) && g[j][0].position > 0 && (c = b[j], c !== void 0)) l = i.cloneJSONObject(g[j][0]),
            l.tween[3] = l.tween[4].fromValue = c,
            c = l.position,
            l.position = 0,
            l.duration = c,
            e.push(l);
            e = this._createTimelineFromData(e);
            this._restoreObservers(a, e);
            return this.timelineCache[d] = e
        },
        _createTimelineFromData: function(a) {
            for (var b = jQuery.Edge.Timeline.createTimeline(), c = a.length, d = 0; d < c; d++) {
                var e = a[d],
                f = null;
                e.timeline ? f = m.prototype._createTimelineFromData(e.timeline) : e.tween ? f = i.Timeline.createTween.apply(null, e.tween) : e.trigger && (f = e.trigger.slice(0, 2), f.push(this), f = i.Timeline.createTrigger.apply(null,
                f));
                f && b.add(f, e.position, e.duration, e.easing)
            }
            return b
        },
        _buildStateForCache: function(a, b) {
            var c = {};
            if (b) {
                var d = this.states[b];
                if (d) {
                    var e = {},
                    f,
                    h,
                    k;
                    if (a) {
                        var j = this.getTimelineData(a).timeline,
                        i = j.length;
                        for (f = 0; f < i; f++) k = j[f],
                        k.tween && (h = r(k.tween[1], this.parameterValues), h = k.tween[0] + ":" + h + ":" + k.tween[2], e[h] || (e[h] = []), e[h].push(k))
                    }
                    for (var n in d) if (n !== "prototype") {
                        e = d[n];
                        for (f = 0; f < e.length; f++) if (j = e[f], h = r(n, this.parameterValues), j[0] == "style" || j[0] == "transform" || j[0] == "color") {
                            c[h] || (c[h] =
                            []);
                            k = j[2];
                            if (j[3] && j[3].valueTemplate) if (i = t.prototype.parseTemplate.call(null, j[3].valueTemplate)) {
                                var m = i.length,
                                o = [],
                                p = j[2];
                                g.isArray(p) || (p = [p]);
                                for (var u = 0; u < m; u++) k = i[u],
                                k.isPlaceholder ? o.push(p[k.value]) : o.push(k.value);
                                k = o.join("")
                            } else k = j[2].join("");
                            c[h].push({
                                decl: j,
                                value: k
                            })
                        }
                    }
                    return c
                }
            }
        },
        _ensureState: function(a, b, c) {
            var d = b + "Cache";
            this[d] || (this[d] = {});
            var e = null;
            this[d][a] ? e = this[d][a] : (b = this.getTimelineData(a)[b], e = this._buildStateForCache(a, b, c), !this._isParameterizedActorTL(a) &&
            !this._isParameterizedActorState(b) && (this[d][a] = e));
            this._applyRules(e, c)
        },
        _applyRules: function(a, b) {
            var c = this,
            d,
            e = function() {
                var a = g(this),
                e = {},
                f = g.data(this, "edgeBaseData");
                f || (c._rememberBaseState(a), f = g.data(this, "edgeBaseData"));
                g.extend(e, f.transformData, d);
                g.data(this, i.TransformTween.dataName, e);
                f = !1;
                if (b) f = b.dontForceZ;
                i.TransformTween.applyTransform(a, e, void 0, {
                    dontForceZ: f
                }); (e = g.data(this, "ui_visibility")) && a.css("visibility", e)
            },
            f;
            for (f in a) if (a.hasOwnProperty(f)) {
                var h = a[f],
                k = h.length;
                d = null;
                for (var j = 0; j < k; j++) {
                    var l = h[j].decl,
                    n = l[1];
                    l[0] == "transform" ? (d || (d = {}), d[n] = h[j].value) : (l = h[j].decl, l = h[j].value, g(f).css(n, l))
                }
                d && i.TransformTween && g(f).each(e)
            }
        },
        _ensureFromState: function(a, b) {
            this._ensureState(a, "fromState", b)
        },
        _ensureToState: function(a, b) {
            this._ensureState(a, "toState", b)
        },
        _isParameterizedActorTL: function(a) {
            for (var a = this.getTimelineData(a).timeline, b = a.length, c = 0; c < b; c++) {
                var d = a[c];
                if (d.tween && typeof d.tween[1] == "string" && d.tween[1].search(/\$\{/) != -1) return ! 0
            }
            return ! 1
        },
        _isParameterizedActorState: function(a) {
            if (!a) return ! 1;
            a = this.states[a];
            if (!a) return ! 1;
            for (var b in a) if (b.search(/\$\{/) != -1) return ! 0;
            return ! 1
        },
        _isReverse: function(a) {
            return typeof a == "object" && typeof a.playDirection == "string" && a.playDirection == "reverse"
        },
        _play: function(a, b) {
            var c = this.getTimelineData(a);
            if (c) {
                var d = c.toState;
                if (a && (c = this._getTimeline(a, d, c.fromState))) {
                    if (d && !this._isReverse(b)) {
                        if (!this.tlPlayHandler) {
                            var e = this;
                            this.tlPlayHandler = {};
                            this.tlPlayHandler.onComplete = function() {
                                e._ensureToState(this.timelineName,
                                this.opts);
                                this.tl.removeObserver(e.tlPlayHandler)
                            }
                        }
                        g.extend(this.tlPlayHandler, {
                            tl: c,
                            timelineName: a,
                            opts: b
                        });
                        c.addObserver(this.tlPlayHandler)
                    }
                    c.play(b)
                }
            }
        },
        _seek: function(a, b, c) {
            var d = this._isCacheDIrty(a),
            e = this.getTimelineData(a);
            if (e) {
                var f = e.toState,
                e = e.fromState;
                c || (c = {}); ! d && c.skipFromState ? c.assumeStateUnchanged = !0: (this._ensureFromState(a, c), c.assumeStateUnchanged = !1);
                d = 0;
                if (a && (f = this._getTimeline(a, f, e))) d = f.getDuration(),
                f.seek(b, c);
                b >= d && this._ensureToState(a, c)
            }
        },
        _rememberBaseStateForTimeline: function(a) {
            if (a &&
            (a = this.getTimelineData(a))) for (var a = a.timeline, b = a.length, c = 0; c < b; c++) {
                var d = a[c];
                d.tween && this._rememberBaseState(r(d.tween[1], this.parameterValues))
            }
        },
        _rememberBaseState: function(a) {
            g(a).each(function() {
                var a = g(this),
                c = g.data(this, "edgeBaseData");
                if (!c) c = {},
                g.data(this, "edgeBaseData", c),
                c.inlineValue = a.attr("style"),
                c.transformData = i.TransformTween.prototype.buildTransformData.call(null, this)
            })
        },
        compute: function(a, b, c, d, e) {
            var f;
            if (a) {
                var h = this.getTimelineData(a); (a = this._getTimeline(a, h.toState,
                h.fromState)) && (f = a.compute(b, c, d, e))
            }
            return f
        },
        findNext: function(a, b, c, d, e, f, h) {
            if (a) {
                var g = this.getTimelineData(a),
                d = d.toString();
                if (a = this._getTimeline(a, g.toState, g.fromState)) {
                    var j,
                    g = a.getDuration() + 10,
                    d = parseFloat(d.replace(/[a-zA-Z%]+$/, "")),
                    i = f + 10;
                    j = a.compute(b, c, f, h);
                    for (var n = j[e], n = parseFloat(n.replace(/[a-zA-Z%]+$/, "")), i = f; i <= g; i += 10) if ((j = a.compute(b, c, i, h)) && j.length) {
                        f = j[e];
                        f = parseFloat(f.replace(/[a-zA-Z%]+$/, ""));
                        if (d >= Math.min(n, f) && d <= Math.max(n, f)) return i;
                        n = f
                    }
                }
            }
            return - 1
        },
        deleteInstance: function(a) {
            var a =
            a || {},
            b;
            this.composition && (b = this.composition.getSymbolInstances());
            if (b) {
                var c = this._createEvent({});
                this.notifyObservers("onPreRemove", c);
                if (c.performDefaultAction) {
                    var d;
                    if (this.aSymbolInstances) {
                        var e = this.aSymbolInstances.length;
                        for (d = 0; d < e; d++) this.composition.removeSymbolInstance(this.aSymbolInstances[d], a)
                    }
                    d = this.element;
                    g(d).removeData("edgeSymbol");
                    a._keepElement ? g(d).empty() : g(d).remove();
                    for (d = b.length; d >= 0; d--) b[d] == this && b.splice(d, 1);
                    this.element = null;
                    this.notifyObservers("onPostRemove",
                    c)
                }
            }
        },
        $: function(a) {
            var b = a;
            typeof a === "string" && (b = r(a, this.parameterValues));
            return g(b)
        }
    });
    m.get = function(a) {
        return g(a).data("edgeSymbol")
    };
    m.getDefaultEasing = function() {
        return i.TimelineObject.defaultEasing
    };
    m.bindTriggerAction = function(a, b, c, d, e) { (a = i.getCompositionSymbolDefns(a)[b]) ? (c = a.timelines[c].timeline) ? (d = {
            trigger: [e, null],
            position: d,
            duration: 0,
            id: i.Symbol._makeUniqueID()
        },
        c.push(d)) : i.logError("$.Edge.Symbol.bindTriggerAction: timeline not found") : i.logError("$.Edge.Symbol.bindTriggerAction: symbol not found")
    };
    var y = function(a, b, c, d, e, f, g) {
        var k = i.getCompositionSymbolDefns(a)[b];
        if (k) {
            if (!k.actions) k.actions = {};
            g = m._makeUniqueID();
            k.actions[g] = e;
            if (!k.bindings) k.bindings = [];
            c = [[f, c, d], g];
            k.bindings.push(c);
            if (null != i.compositions && (a = i.compositions[a], null != a && (a = a.getSymbolInstances(), null != a))) {
                k = a.length;
                for (f = 0; f < k; f++) {
                    var d = a[f],
                    j = d.getSymbolTypeName();
                    b == j && (j = {},
                    j[g] = e, d._addActionsFromData(j), d._addBindingFromData(c))
                }
            }
        } else i.logError("$.Edge.Symbol." + g + ": symbol not found")
    };
    m.bindElementAction =
    function(a, b, c, d, e) {
        y(a, b, c, d, e, "element", "bindElementAction")
    };
    m.bindTimelineAction = function(a, b, c, d, e) {
        y(a, b, c, d, e, "timeline", "bindTimelineAction")
    };
    var x = (new Date).getTime(),
    A = function() {
        for (var a = "eid_" + x++; g("#" + a).length > 0;) a = "eid_" + x++;
        return a
    };
    m._makeUniqueID = A;
    i.compositions = i.compositions || {};
    i.compositionDefns = i.compositionDefns || {};
    i.compositionReadyHandler = i.compositionReadyHandler || {};
    i.registerCompositionDefn = function(a, b) {
        if (a && a.length > 0 && !i.compositionDefns[a]) for (symbolName in i.compositionDefns[a] =
        b, b) b[symbolName].typeName = symbolName
    };
    i.getCompositionSymbolDefns = o;
    i.getComposition = function(a) {
        if (a) return i.compositions[a]
    };
    i.registerCompositionReadyHandler = function(a, b, c) {
        c = c || {};
        if ((!window.edge_authoring_mode || c._tool || window.edge_remote_authoring) && a && b) i.compositions[a] ? i.compositions.ready(b) : (i.compositionReadyHandler[a] = i.compositionReadyHandler[a] || [], i.compositionReadyHandler[a].push(b))
    };
    var B = i.Composition = function(a, b, c) {
        c = c || {};
        if (!window.edge_authoring_mode || c._tool || window.edge_remote_authoring) {
            i.Notifier.call(this);
            var d,
            v = !1;
            d = 0;
            var f,
            h,
            k = this,
            c = i.compositionReadyHandler[a],
            j = this.symbolDefns = o(a);
            this.symbolInstances = [];
            this.compId = a;
            this.imageRequestCount = 0;
            this.imageRequestList = [];
            this.readyList = [];
            this.$loadCalled = this.readyCalled = !1;
            i.compositions[a] = this;
            g(window).load(function() {
                k.$loadCalled = !0;
                k.imageRequestCount <= 0 && k.callReadyList()
            });
            e(s);
            for (f in b) if (d = g(b[f]), d.size() > 0) {
                v = !0;
                break
            }
            v || (v = g("body"), g(v).addClass(a));
            for (f in b) d = g(b[f]),
            d.each(function() {
                h = new m(this, {
                    data: j[f],
                    composition: k
                });
                k.symbolInstances.push(h)
            });
            if (c) for (d = 0; d < c.length; d++) this.ready(c[d])
        }
    };
    g.extend(B.prototype, i.Notifier.prototype, {
        play: function(a) {
            if (!window.edge_authoring_mode || a) if (typeof i.autoPlay == "undefined" || i.autoPlay) for (var a = this.symbolInstances.length, b = 0; b < a; b++) {
                var c = this.symbolInstances[b],
                d = c.options.data.autoPlay;
                typeof d == "string" && d != "true" ? c.playTimeline(d) : (typeof d == "undefined" || d === !0 || d == "true") && c.playTimeline("Default Timeline", 0, {
                    firstUpdate: !0
                })
            }
        },
        getSymbolInstances: function() {
            return this.symbolInstances
        },
        ready: function(a) {
            this.readyCalled ? a.call() : this.readyList && this.readyList.push(a)
        },
        getCompId: function() {
            return this.compId
        },
        requestImage: function(a) {
            this.imageRequestCount++;
            var b = this,
            c = new Image;
            this.imageRequestList.push(c);
            g(c).load(function() {
                b.imageRequestCount--;
                b.imageRequestCount <= 0 && b.$loadCalled && setTimeout(function() {
                    b.callReadyList()
                },
                0)
            });
            c.src = a;
            return null
        },
        callReadyList: function() {
            this.imageRequestList = [];
            for (this.readyCalled = !0; this.readyList.length > 0;) this.readyList.shift().call();
            var a = jQuery.Event("loaded");
            a.compId = this.getCompId();
            jQuery(document).trigger(a)
        },
        getStage: function() {
            return m.get(g("." + this.getCompId()))
        },
        createSymbolInstanceChild: function(a, b, c) {
            if (a && b && this.symbolInstances && this.symbolDefns[a]) {
                var d = [],
                e = this;
                g(b).each(function() {
                    var b = g(this),
                    h = document.createElement("div"); (c || c === 0) && b.children().eq(c).get(0) ? (b = b.children(), c < 0 ? b.eq(c).after(h) : b.eq(c).before(h)) : b.append(h);
                    if (h = new m(g(h), {
                        data: e.symbolDefns[a],
                        composition: e,
                        opts: {
                            regenerateID: !0
                        }
                    })) e.symbolInstances.push(h),
                    d.push(h)
                });
                return d
            }
        },
        convertElementToSymbolInstance: function(a, b) {
            if (a && g(a) && this.symbolInstances && this.symbolDefns[b]) {
                var c = new m(g(a), {
                    data: this.symbolDefns[b],
                    composition: this,
                    opts: {
                        regenerateID: !0
                    }
                });
                this.symbolInstances.push(c);
                return c
            }
        },
        getSymbolDefSymbolInstances: function(a) {
            var b = [];
            if (!this.symbolInstances) return b;
            if (this.symbolDefns.hasOwnProperty(a)) for (var c = this.symbolInstances.length, d = 0; d < c; d++) this.symbolInstances[d].getSymbolTypeName() === a && b.push(this.symbolInstances[d]);
            return b
        },
        removeSymbolInstance: function(a, b) {
            if (this.symbolInstances) {
                var c = m.get(a);
                c && c.deleteInstance(b)
            }
        }
    });
    var e;
    i.initialize = function(a, b, c) {
        if (!window.edge_authoring_mode || c || window.edge_remote_authoring) {
            if (typeof p == "undefined") p = i.symbolInstances = [];
            g.extend(s, a);
            e(s);
            var a = p,
            d;
            for (d in s) if (s.hasOwnProperty(d)) {
                s[d].typeName = d;
                var c = [],
                c = ".symbol_" + d,
                c = b ? g(b).find("*").andSelf().filter(c) : g(c),
                v = c.size(),
                f;
                for (f = 0; c && f < v; f++) {
                    var h = new m(g(c.get(f)), {
                        data: s[d]
                    });
                    p.push(h);
                    if (d == "stage") i.stage = h
                }
            }
            if (a.length ===
            0 || !i.stage) i.stage = new m(g("body"), {
                data: s.stage
            }),
            p.push(i.stage);
            window.runtimeReady && window.runtimeReady()
        }
    };
    e = function(a) {
        for (var b in a) if (a.hasOwnProperty(b) && a[b].timelines) for (var c in a[b].timelines) if (a[b].timelines.hasOwnProperty(c)) for (var d = a[b].timelines[c].timeline, e = d.length, f = 0; f < e; f++) {
            var g = d[f];
            if (!g.id) g.id = A()
        }
    };
    i.play = function(a) {
        if (!window.edge_authoring_mode || a) if (typeof i.autoPlay == "undefined" || i.autoPlay) for (var a = this.symbolInstances.length, b = 0; b < a; b++) {
            var c = p[b],
            d = c.options.data.autoPlay;
            typeof d == "string" && d != "true" ? c.play(d) : (typeof d == "undefined" || d === !0 || d == "true") && c.play("Default Timeline")
        }
    };
    i.logDebug = function() {};
    i.logInfo = function() {};
    i.logWarn = function() {};
    i.logError = function() {};
    i.logFatal = function() {};
    g.extend(i.TimelineObject.prototype, {
        compute: function(a, b, c, d) {
            if (!this.dDuration) {
                var e = this.duration,
                f = null;
                this.animation && this.animation.getDuration && (f = this.animation.getDuration());
                this.dScale = e != -1 && e !== 0 ? f / e: 1;
                this.dDuration = e != -1 ? e: f
            }
            e = this.dDuration;
            e = e === 0 ? 1:
            e;
            c >= e && (c = e);
            c <= 0 && (c = 0);
            if (this.animation) return e = g.easing[this.easing](c / e, c, 0, 1, e),
            this.animation.compute(a, b, c * this.dScale, e, d)
        }
    });
    g.extend(i.Timeline.prototype, {
        compute: function(a, b, c, d) {
            for (var e = this.objects, f = e.length, h = [], i = {
                obj: null,
                end: 0
            },
            j = {
                obj: null,
                start: this.getDuration()
            },
            l = 0; l < f; l++) {
                var n = e[l];
                if (!n.animation.isTrigger && b == n.animation.property && a == n.animation.elements) if (c >= n.position && c <= n.position + n.duration) {
                    if (n = n.compute(a, b, c - n.position, d)) g.isArray(n) || (n = [n]),
                    h = n
                } else if (c <
                n.position) {
                    if (n.position <= j.start) j.start = n.position,
                    j.obj = n
                } else if (c > n.position + n.duration && n.position + n.duration >= i.end) i.end = n.position,
                i.obj = n
            }
            if (!h || g.isArray(h) && h.length === 0) if (i.obj && i.obj.animation.toValue) h = i.obj.animation.toValue;
            else if (j.obj && j.obj.animation.fromValue) h = j.obj.animation.fromValue;
            g.isArray(h) || (h = [h]);
            return h
        }
    });
    g.extend(t.prototype, {
        compute: function(a, b, c, d) {
            c = this.property;
            if (a != this.elements || b != c) return null;
            for (var a = this.fromValues, b = this.toValues, c = this.filter,
            e = a.length, f = [], g = 0; g < e; g++) {
                var i = a[g],
                j = b[g];
                i += (j.value - i) * d;
                c && c[g] && (i = c[g](i));
                f.push(i + j.unit)
            }
            return f
        }
    });
    g.extend(i.TransformTween.prototype, {
        compute: t.prototype.compute
    })
})(jQuery, jQuery.Edge); (function(g, i) {
    if (typeof i.DeclareMarkup == "undefined") {
        var o = function() {
            function i(e, a, b, c, d, m) {
                var f = document.createElement(e);
                f.id = a;
                f.style.position = "absolute";
                $eleNew = g(f);
                $eleNew.addClass(a + "_id");
                if (b.className) f.className = b.className;
                g(f).css("left", b.rect[0] + "px");
                g(f).css("top", b.rect[1] + "px");
                b.rect[2] > 0 && g(f).css("width", b.rect[2] + "px");
                b.rect[3] > 0 && g(f).css("height", b.rect[3] + "px");
                b.overflow && (g(f).css("overflow", b.overflow), (b.overflow == "hidden" || b.overflow == "scroll") && g(f).css("text-overflow",
                "clip"));
                b.br && (b.br.length == 1 ? g(f).css("border-radius", b.br[0] + "px") : (g(f).css("border-top-left-radius", b.br[0]), g(f).css("border-top-right-radius", b.br[1]), g(f).css("border-bottom-right-radius", b.br[2]), g(f).css("border-bottom-left-radius", b.br[3])));
                if (b.tf) {
                    for (var a = [], h = [[3, 0], [3, 0], [2, 0], [3, 1], [2, "50%"]], k = 0; k < h.length; k++) {
                        a[k] = [];
                        b.tf[k] || (b.tf[k] = []);
                        for (var j = 0; j < h[k][0]; j++) b.tf[k][j] || (b.tf[k][j] = h[k][1]),
                        a[k][j] = b.tf[k][j]
                    }
                    h = typeof a[4][0] == "string" ? a[4][0] + " " + a[4][1] : a[4][0] + "px " +
                    a[4][1] + "px";
                    g(f).css("-webkit-transform-origin", h);
                    g(f).css("-moz-transform-origin", h);
                    g(f).css("-ms-transform-origin", h);
                    g(f).css("-o-transform-origin", h);
                    "webkitAppearance" in document.documentElement.style ? g(f).css("-webkit-transform", "translate3d(" + a[0][0] + "px," + a[0][1] + "px," + a[0][2] + "px) rotateZ(" + a[1][0] + "deg) rotateX(" + a[1][1] + "deg) rotateY(" + a[1][2] + "deg) skew(" + a[2][0] + "deg," + a[2][1] + "deg) scale3d(" + a[3][0] + "," + a[3][1] + "," + a[3][2] + ")") : (h = "translate(" + a[0][0] + "px," + a[0][1] + "px) rotate(" +
                    a[1][0] + "deg) skewX(" + a[2][0] + "deg) skewY(" + a[2][1] + "deg) scale(" + a[3][0] + "," + b.tf[3][1] + ")", g(f).css("-moz-transform", h), g(f).css("-ms-transform", h), g(f).css("-o-transform", h))
                } //else f.style.webkitTransform = "translateZ(0)";
                b.opacity && g(f).css("opacity", b.opacity);
                b.stroke && ((a = b.stroke[0]) || (a = 0), (h = b.stroke[1]) ? typeof h == "string" && (h = [h]) : h = ["rgba(0,0,0,0)"], (k = b.stroke[2]) || (k = "none"), g(f).css("border", "" + a + "px " + k + " " + h[0]));
                if (b.fill && (a = b.fill[0], typeof a == "string" && (a = [a]), (h = b.fill[1]) || (h =
                "solid"), h == "solid" && a && g(f).css("background-color", a[0]), b.fill[1])) if (a = b.fill[1], typeof a == "string" ? a = [a] : typeof a == "object" && ((h = a[window.EdgeScreenProfile.name]) || (h = a["default"]), a = h), b.tag && b.tag == "img") {
                    if (a[0]) f.src = a[0]
                } else {
                    if (a[0]) {
                        g(f).css("background-image", "url(" + a[0] + ")");
                        if (a[1] || a[2]) a[1] || (a[1] = "0px"),
                        a[2] || (a[2] = "0px"),
                        g(f).css("background-position", a[1] + " " + a[2]);
                        m.requestImage(a[0])
                    }
                    a[3] || g(f).css("background-repeat", "no-repeat");
                    a[4] && a[4] != "scroll" && g(f).css("background-attachment",
                    a[4])
                }
                b.source && (f.setAttribute("src", b.source), e == "video" && f.setAttribute("controls", "controls"), e == "audio" && f.setAttribute("autoplay", "autoplay"));
                if (c) {
                    if (!c.appendChild) return f;
                    c.firstChild && d >= 0 && c.children && d < c.children.length ? c.insertBefore(f, c.children[d]) : c.appendChild(f)
                }
                return f
            }
            function m(e, a, b, c, d, m, f) {
                var j;
                x(a, c);
                var h = null;
                b && b.nodeName && b.nodeName.toLowerCase() == "canvas" && (j = h = o.stageLookup[b.id], b = j);
                var k = null,
                h = "div";
                if (a.tag) h = a.tag;
                switch (a.t) {
                case "def":
                    break;
                case "rect":
                case "elipse":
                case "group":
                    k =
                    i(h, e, a, b, d, m, f);
                    break;
                case "image":
                    k = i(h, e, a, b, d, m, f);
                    break;
                case "video":
                    k = i("video", e, a, b, d, m, f);
                    break;
                case "audio":
                    k = i("audio", e, a, b, d, m, f);
                    break;
                case "text":
                    k = i(h, e, a, b, d, m, f);
                    a.font && (a.font[0] && a.font[0] !== "" && g(k).css("font-family", a.font[0]), typeof a.font[1] != "object" && (a.font[1] = [a.font[1]]), a.font[1][1] || (a.font[1][1] = "px"), a.font[1][0] && a.font[1][0] !== "" && g(k).css("font-size", a.font[1][0] + a.font[1][1]), a.font[2] && a.font[2] !== "" && g(k).css("color", a.font[2]), a.font[3] && a.font[3] !== "" && g(k).css("font-weight",
                    a.font[3]), a.font[4] && a.font[4] !== "" && g(k).css("text-decoration", a.font[4]), a.font[5] && a.font[5] !== "" && g(k).css("font-style", a.font[5]));
                    a.align && g(k).css("text-align", a.align);
                    if (a.position) k.style.position = a.position;
                    k.appendChild(document.createTextNode(a.text));
                    break;
                case "canvas":
                    k = i("canvas", e, a, b, d, m, f);
                    h = {
                        def: a,
                        params: c,
                        stage: new A(k),
                        children: {}
                    };
                    h.obj = h.stage;
                    h.obj.width = a.rect[2];
                    h.obj.height = a.rect[3];
                    o.stageLookup[e] = h;
                    break;
                case "line":
                    break;
                case "shape":
                    if (!b) break;
                    e = {
                        def: a,
                        params: c,
                        obj: new B,
                        stage: b.stage,
                        children: {}
                    };
                    e.obj.x = a.rect[0];
                    e.obj.y = a.rect[1];
                    e.obj.width = a.rect[2];
                    e.obj.height = a.rect[3];
                    b.children[a.id] = e;
                    b.obj.addChild(e.obj);
                    k = e;
                    break;
                default:
                    alert("unhandled type == " + a.t)
                }
                return k
            }
            function t(e, a, b, c, d, g, f) {
                g = g || 0;
                if (b = m(e, a, c, d, g, f)) {
                    o.DOMNodeStarted(b, c, a, o.nodeSymbolInstanceLookup[e]);
                    if (a.c) for (e = 0; e < a.c.length; e++) c = a.c[e],
                    t(c.id, c, a, b, d, g, f);
                    o.DOMNodeCompleted(b)
                }
                return b
            }
            function r(e, a) {
                var b = e,
                c;
                if (e.base) {
                    if (typeof e.base == "string") e.base = [e.base];
                    if (e.base.length >
                    0) {
                        b = {};
                        for (c = 0; c < e.base.length; c++) {
                            var d = o.nodeLookup[e.base[c]];
                            d && g.extend(!0, b, d)
                        }
                        g.extend(!0, b, e)
                    }
                }
                b.base = null;
                for (c = 0; b.c && c < b.c.length; c++) b.c[c] = r(b.c[c], a);
                return b
            }
            function p(e, a) {
                if (e) if (x(e, a), !e.id || e.id === "") alert("elements without ids are not yet supported");
                else {
                    o.nodeLookup[e.id] = e;
                    for (var b = 0; e.children && b < e.children.length; b++) p(e.children[b])
                }
            }
            function s(e, a) {
                if (!e) return a;
                if (typeof a == "string") {
                    var b = a.search(/\$\{/);
                    if (b >= 0) {
                        var c = a.search(/\}/);
                        if (c > b) return b = a.slice(b + 2,
                        c),
                        e[b]
                    }
                }
                return a
            }
            function y(e, a) {
                var b = e.obj.graphics,
                c = e.params;
                b.clear();
                var d = "rgba(0,0,0,0)";
                e.def.fill && typeof e.def.fill == "object" && (d = e.def.fill[0]);
                b.beginFill(d).drawRect(0, 0, s(c, e.def.rect[2]), s(c, e.def.rect[3]));
                for (var g in e.children) e.children.hasOwnProperty(g) && y(a.children[g])
            }
            var x,
            A,
            B;
            x = function(e, a) {
                if (e.type) e.t = e.type;
                if (e.t) e.t = e.t.toLowerCase();
                e.type = e.t;
                e.children ? e.c = e.children: e.children = e.c;
                e.rect ? e.r = e.rect: e.rect = e.r;
                if (!e.rect) e.rect = [];
                for (; e.rect.length < 4;) e.rect[e.rect.length] =
                0;
                e.borderRadius ? e.br = e.borderRadius: e.borderRadius = e.br;
                e.shape ? e.sh = e.shape: e.shape = e.sh;
                e.transform ? e.tf = e.transform: e.transform = e.tf;
                if (e.tf) {
                    for (; e.tf.length < 5;) e.tf[e.tf.length] = 0;
                    for (; e.transform.length < 8;) e.tf[e.tf.length] = 1
                }
                e.opacity ? e.o = e.opacity: e.opacity = e.o;
                if (e.stroke) e.s = e.stroke;
                e.stroke = e.s;
                if (e.fill) e.f = e.fill;
                if (e.f && a) {
                    var b = a[e.f];
                    if (b) e.f = b
                }
                e.fill = e.f
            };
            return {
                stageLookup: {},
                nodeLookup: {},
                nodeSymbolInstanceLookup: {},
                DOMNodeSeek: function() {},
                DOMNodeReset: function() {},
                DOMNodeStarted: function() {},
                DOMNodeCompleted: function() {},
                renderDOM: function(e, a, b, c, d, g) {
                    window.EdgeScreenProfile = {
                        name: "detected",
                        dim: [screen.width, screen.height]
                    };
                    o.nodeLookup = {};
                    var f;
                    for (f = 0; f < e.length; f++) p(e[f], b);
                    for (f = 0; f < e.length; f++) e[f] && (e[f] = r(e[f], b));
                    o.nodeSymbolInstanceLookup = {};
                    if (d) for (f = 0; f < d.length; f++) o.nodeSymbolInstanceLookup[d[f].id] = d[f].symbolName;
                    o.DOMNodeSeek(a, c);
                    for (f = 0; f < e.length; f++) e[f] && (c = e[f], (c = t(c.id, c, null, null, b, 0, g)) && a.appendChild(c));
                    o.DOMNodeReset()
                },
                buildSceneGraphNode: t,
                drawSceneGraph: function() {
                    for (var e in o.stageLookup) if (o.stageLookup.hasOwnProperty(e)) {
                        var a =
                        o.stageLookup[e],
                        b;
                        for (b in a.children) a.children.hasOwnProperty(b) && y(a.children[b], a);
                        a.stage.update()
                    }
                },
                createElement: m
            }
        } ();
        i.DeclareMarkup = o
    }
})(jQuery, jQuery.Edge);
