

// include me only, if I haven't been included before
/*
    json2.js
    2014-02-04

    Public Domain.

    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

    See http://www.JSON.org/js.html


    This code should be minified before deployment.
    See http://javascript.crockford.com/jsmin.html

    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
    NOT CONTROL.


    This file creates a global JSON object containing two methods: stringify
    and parse.

        JSON.stringify(value, replacer, space)
            value       any JavaScript value, usually an object or array.

            replacer    an optional parameter that determines how object
                        values are stringified for objects. It can be a
                        function or an array of strings.

            space       an optional parameter that specifies the indentation
                        of nested structures. If it is omitted, the text will
                        be packed without extra whitespace. If it is a number,
                        it will specify the number of spaces to indent at each
                        level. If it is a string (such as '\t' or '&nbsp;'),
                        it contains the characters used to indent at each level.

            This method produces a JSON text from a JavaScript value.

            When an object value is found, if the object contains a toJSON
            method, its toJSON method will be called and the result will be
            stringified. A toJSON method does not serialize: it returns the
            value represented by the name/value pair that should be serialized,
            or undefined if nothing should be serialized. The toJSON method
            will be passed the key associated with the value, and this will be
            bound to the value

            For example, this would serialize Dates as ISO strings.

                Date.prototype.toJSON = function (key) {
                    function f(n) {
                        // Format integers to have at least two digits.
                        return n < 10 ? '0' + n : n;
                    }

                    return this.getUTCFullYear()   + '-' +
                         f(this.getUTCMonth() + 1) + '-' +
                         f(this.getUTCDate())      + 'T' +
                         f(this.getUTCHours())     + ':' +
                         f(this.getUTCMinutes())   + ':' +
                         f(this.getUTCSeconds())   + 'Z';
                };

            You can provide an optional replacer method. It will be passed the
            key and value of each member, with this bound to the containing
            object. The value that is returned from your method will be
            serialized. If your method returns undefined, then the member will
            be excluded from the serialization.

            If the replacer parameter is an array of strings, then it will be
            used to select the members to be serialized. It filters the results
            such that only members with keys listed in the replacer array are
            stringified.

            Values that do not have JSON representations, such as undefined or
            functions, will not be serialized. Such values in objects will be
            dropped; in arrays they will be replaced with null. You can use
            a replacer function to replace those with JSON values.
            JSON.stringify(undefined) returns undefined.

            The optional space parameter produces a stringification of the
            value that is filled with line breaks and indentation to make it
            easier to read.

            If the space parameter is a non-empty string, then that string will
            be used for indentation. If the space parameter is a number, then
            the indentation will be that many spaces.

            Example:

            text = JSON.stringify(['e', {pluribus: 'unum'}]);
            // text is '["e",{"pluribus":"unum"}]'


            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'

            text = JSON.stringify([new Date()], function (key, value) {
                return this[key] instanceof Date ?
                    'Date(' + this[key] + ')' : value;
            });
            // text is '["Date(---current time---)"]'


        JSON.parse(text, reviver)
            This method parses a JSON text to produce an object or array.
            It can throw a SyntaxError exception.

            The optional reviver parameter is a function that can filter and
            transform the results. It receives each of the keys and values,
            and its return value is used instead of the original value.
            If it returns what it received, then the structure is not modified.
            If it returns undefined then the member is deleted.

            Example:

            // Parse the text. Values that look like ISO date strings will
            // be converted to Date objects.

            myData = JSON.parse(text, function (key, value) {
                var a;
                if (typeof value === 'string') {
                    a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
                    if (a) {
                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
                            +a[5], +a[6]));
                    }
                }
                return value;
            });

            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
                var d;
                if (typeof value === 'string' &&
                        value.slice(0, 5) === 'Date(' &&
                        value.slice(-1) === ')') {
                    d = new Date(value.slice(5, -1));
                    if (d) {
                        return d;
                    }
                }
                return value;
            });


    This is a reference implementation. You are free to copy, modify, or
    redistribute.
*/

/*jslint evil: true, regexp: true */

/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
    lastIndex, length, parse, prototype, push, replace, slice, stringify,
    test, toJSON, toString, valueOf
*/


// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.

if (typeof JSON !== 'object') {
    JSON = {};
}

(function () {
    'use strict';

    function f(n) {
        // Format integers to have at least two digits.
        return n < 10 ? '0' + n : n;
    }

    if (typeof Date.prototype.toJSON !== 'function') {

        Date.prototype.toJSON = function () {

            return isFinite(this.valueOf())
                ? this.getUTCFullYear()     + '-' +
                    f(this.getUTCMonth() + 1) + '-' +
                    f(this.getUTCDate())      + 'T' +
                    f(this.getUTCHours())     + ':' +
                    f(this.getUTCMinutes())   + ':' +
                    f(this.getUTCSeconds())   + 'Z'
                : null;
        };

        String.prototype.toJSON      =
            Number.prototype.toJSON  =
            Boolean.prototype.toJSON = function () {
                return this.valueOf();
            };
    }

    var cx,
        escapable,
        gap,
        indent,
        meta,
        rep;


    function quote(string) {

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.

        escapable.lastIndex = 0;
        return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
            var c = meta[a];
            return typeof c === 'string'
                ? c
                : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
        }) + '"' : '"' + string + '"';
    }


    function str(key, holder) {

// Produce a string from holder[key].

        var i,          // The loop counter.
            k,          // The member key.
            v,          // The member value.
            length,
            mind = gap,
            partial,
            value = holder[key];

// If the value has a toJSON method, call it to obtain a replacement value.

        if (value && typeof value === 'object' &&
                typeof value.toJSON === 'function') {
            value = value.toJSON(key);
        }

// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.

        if (typeof rep === 'function') {
            value = rep.call(holder, key, value);
        }

// What happens next depends on the value's type.

        switch (typeof value) {
        case 'string':
            return quote(value);

        case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

            return isFinite(value) ? String(value) : 'null';

        case 'boolean':
        case 'null':

// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.

            return String(value);

// If the type is 'object', we might be dealing with an object or an array or
// null.

        case 'object':

// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.

            if (!value) {
                return 'null';
            }

// Make an array to hold the partial results of stringifying this object value.

            gap += indent;
            partial = [];

// Is the value an array?

            if (Object.prototype.toString.apply(value) === '[object Array]') {

// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.

                length = value.length;
                for (i = 0; i < length; i += 1) {
                    partial[i] = str(i, value) || 'null';
                }

// Join all of the elements together, separated with commas, and wrap them in
// brackets.

                v = partial.length === 0
                    ? '[]'
                    : gap
                    ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
                    : '[' + partial.join(',') + ']';
                gap = mind;
                return v;
            }

// If the replacer is an array, use it to select the members to be stringified.

            if (rep && typeof rep === 'object') {
                length = rep.length;
                for (i = 0; i < length; i += 1) {
                    if (typeof rep[i] === 'string') {
                        k = rep[i];
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            } else {

// Otherwise, iterate through all of the keys in the object.

                for (k in value) {
                    if (Object.prototype.hasOwnProperty.call(value, k)) {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            }

// Join all of the member texts together, separated with commas,
// and wrap them in braces.

            v = partial.length === 0
                ? '{}'
                : gap
                ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
                : '{' + partial.join(',') + '}';
            gap = mind;
            return v;
        }
    }

// If the JSON object does not yet have a stringify method, give it one.

    if (typeof JSON.stringify !== 'function') {
        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
        meta = {    // table of character substitutions
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        };
        JSON.stringify = function (value, replacer, space) {

// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.

            var i;
            gap = '';
            indent = '';

// If the space parameter is a number, make an indent string containing that
// many spaces.

            if (typeof space === 'number') {
                for (i = 0; i < space; i += 1) {
                    indent += ' ';
                }

// If the space parameter is a string, it will be used as the indent string.

            } else if (typeof space === 'string') {
                indent = space;
            }

// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.

            rep = replacer;
            if (replacer && typeof replacer !== 'function' &&
                    (typeof replacer !== 'object' ||
                    typeof replacer.length !== 'number')) {
                throw new Error('JSON.stringify');
            }

// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.

            return str('', {'': value});
        };
    }


// If the JSON object does not yet have a parse method, give it one.

    if (typeof JSON.parse !== 'function') {
        cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
        JSON.parse = function (text, reviver) {

// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.

            var j;

            function walk(holder, key) {

// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.

                var k, v, value = holder[key];
                if (value && typeof value === 'object') {
                    for (k in value) {
                        if (Object.prototype.hasOwnProperty.call(value, k)) {
                            v = walk(value, k);
                            if (v !== undefined) {
                                value[k] = v;
                            } else {
                                delete value[k];
                            }
                        }
                    }
                }
                return reviver.call(holder, key, value);
            }


// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.

            text = String(text);
            cx.lastIndex = 0;
            if (cx.test(text)) {
                text = text.replace(cx, function (a) {
                    return '\\u' +
                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
                });
            }

// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.

// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.

            if (/^[\],:{}\s]*$/
                    .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
                        .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
                        .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                j = eval('(' + text + ')');

// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.

                return typeof reviver === 'function'
                    ? walk({'': j}, '')
                    : j;
            }

// If the text is not JSON parseable, then a SyntaxError is thrown.

            throw new SyntaxError('JSON.parse');
        };
    }
}());


function BeatEditAPI(){function er(){var ev=parseFloat(app.version);if(ev!=10.5){ev=Math.floor(ev);}return ev;}function bV(){return er()>=15;}function db(){var ev=parseFloat(app.version);return ev;}function cG(){return $.os.indexOf("Windows")!=-1;}function cs(){return cG()&&($.os.indexOf("XP")!=-1);}function V(){return !cG();}function ce(ex){if(!cG()){throw new Error("getWindowsShellVariable is only available on Windows");}var ev=system.callSystem('cmd /c "echo mamoresultstart'+ex+'"mamoresultend');var ew=/mamoresultstart(.*)mamoresultend/.exec(ev);if(!ew){throw new Error("could not retrieve Win shell variable:"+ev);}return ew[1];}function s(ew){if(typeof(Globals_language)==="undefined"||Globals_language=="auto"){return localize(ew);}else{var ev=ew[Globals_language];if(ev==undefined){return localize(ew);}return ev;}}function dJ(ey,ex,ew){var ev=bq(ey,ex,ew);if(ew.hasError()){return false;}app.executeCommand(ev);return true;}function bq(eA,ez,ew){for(var ey=0;ey<eA.length;ey++){var ev=app.findMenuCommandId(eA[ey]);if(ev!=0){return ev;}}var ev=ez[new String(er())];if(ev==undefined){var ex=(eA.length==0)?("ID"+ev):(eA[0]);ew.add(s({en:'Could not execute command the AE menu command "'+ex+'".Please contact the support and provide them the information version of After Effects you are using and which language it is running in.',de:'Konnte den AE-Menü-Befehl "'+ex+'" nicht ausführen. Bitte kontaktiere den Support mit der Information, welche Version von After Effects Du verwendest und in welcher Sprache es läuft.'}));return 0;}return ev;}function c1(ex,ew){var ev=0;while(!ex()){$.sleep(200);ev+=200;if(ev>1000*ew){return false;}}return true;}function d9(ey,ex,ev){var ew=0;while(!ey()){$.sleep(200);ew+=200;if(ew>1000*ex){if(confirm(ev+"\n\n"+s({en:"Do you want to continue waiting?",de:"Willst Du weiter warten?"}))){ew=0;}else{return ey();}}}return true;}function dg(ew,ex){var ev=new Window("dialog",ex,undefined,{resizeable:false});var ey="group{orientation:'column',alignment:['fill','top'],margins:0,"+"myImage:Image{},"+"okBtn:Button{text:'OK',alignment:['center','bottom']}"+"}";ev.UI=ev.add(ey);ev.UI.myImage.image=ew;ev.UI.okBtn.onClick=function(){ev.close();};ev.layout.resize();ev.onResizing=ev.onResize=function(){this.layout.resize();};ev.show();}function aF(ey,ex){var ev=new Window("dialog",ex,undefined,{resizeable:true});var ew="group{orientation:'column',alignment:['fill','top'],margins:0,"+"mybox:EditText{readonly:true, properties:{multiline:true},text:'',preferredSize:[500,300],alignment:['fill','fill']},"+"okBtn:Button{text:'OK',alignment:['center','bottom']}"+"}";ev.UI=ev.add(ew);ev.UI.mybox.text=ey;ev.UI.okBtn.onClick=function(){ev.close();};ev.layout.resize();ev.onResizing=ev.onResize=function(){this.layout.resize();};ev.show();}function dr(ev){this.message=ev;}dr.prototype=new Error();function dn(ew,ev){this.message=ew;this.options=ev||{};}dn.prototype=new Error();function H(ew,ev){if(!ev){ev=function(){};}if(!ew){throw new Error("catchUserErrors needs a function as argument.\nDid you write catchUserErrors(foo()) instead of catchUserErrors(foo)?");}try{return ew();}catch(ex){if(ex instanceof dn){f(ex);}else{if(ex instanceof dr){}else{alert(ex.name+" at line "+ex.line+" of "+ex.fileName+":\n"+ex.message);throw ex;}}}finally{ev();}}function f(ew){var ev=ew.options||{};if(ev.imageFile!==undefined){dg(ev.imageFile,ew.message);}else{if(ev.detailedMessage!==undefined){aF(ew.message+":\n\n"+ev.detailedMessage,ew.message);}else{alert(ew.message);}}}function cZ(ew,ev){var ey=ew.property("ADBE Effect Parade");var ex=ey.addProperty(ev);return ex;}function R(ex,ev,ey){var ew=cZ(ex,"ADBE Slider Control");ew.name=ev;ew.property("ADBE Slider Control-0001").setValue(ey);return ew.property("ADBE Slider Control-0001");}function es(ev,ew,ey){var ex=cZ(ev,"ADBE Point Control");ex.name=ew;ex.property("ADBE Point Control-0001").setValue(ey);return ex.property("ADBE point Control-0001");}function el(ex,ev,ey){var ew=cZ(ex,"ADBE Checkbox Control");ew.name=ev;ew.property("ADBE Checkbox Control-0001").setValue(ey);return ew.property("ADBE Checkbox Control-0001");}function e(ey,eD,eE,ex,eC){var eA=ey.index;var ez=ey.containingComp;var eF=(ey.stretch<0)?ey.outPoint:ey.inPoint;var ev=(ey.stretch<0)?ey.inPoint:ey.outPoint;if(ev>ez.duration){ev=ez.duration;}if(eF<0){eF=0;}var eB=ev-eF;var ew=ez.layers.precompose([eA],eD,eE);ey=ez.layer(eA);if(!ex){ew.layer(1).startTime-=eF;ew.duration=eB;ey.startTime=eF;}if(eC){var ey=ew.layer(1);ew.width=ey.width;ew.height=ey.height;ey.property("ADBE Transform Group").property("ADBE Position").setValue(ey.property("ADBE Transform Group").property("ADBE Anchor Point").value);}ey.inPoint=eF;ey.outPoint=ev;return ew;}function I(ew){var ev=(ew instanceof AVLayer)&&ew.hasAudio;return ev;}function L(ey,ev){var ew=(ev.stretch<0)?ev.outPoint:ev.inPoint;var ex=(ev.stretch<0)?ev.inPoint:ev.outPoint;ey.inPoint=ew;ey.outPoint=ex;}function aK(ez,ey,ex){ex=ex||{};var ev=ey.inPoint;var ew=(ex.allowLayerEnd===false)?(ey.outPoint-ey.containingComp.frameDuration):ey.outPoint;if(ez<ev){return ev;}if(ez>ew){return ew;}return ez;}function ax(ex,ew){if(er()<=8){ex=ex.substr(0,27);}if(!dv(ex,ew)){return ex;}var ey=2;var ev=ex+" "+ey;while(dv(ev,ew)){ey++;ev=ex+" "+ey;}return ev;}function dv(ew,ev){return ev.layers.byName(ew)!=null;}function y(ev,ex){for(var ew=1;ew<=ev.layers.length;ew++){ex(ev.layers[ew]);}}function dC(ev,ex){for(var ew=ev.layers.length;ew>=1;ew--){ex(ev.layers[ew]);}}function c8(ev,ex){for(var ew=0;ew<ev.selectedLayers.length;ew++){ex(ev.selectedLayers[ew]);}}function dt(ev,ey,ex){if(ey.length==0){return;}for(var ew=0;ew<ey.length;ew++){ex(ev.layers[ey[ew]],ew);}}function cq(ew,ez,ev){var ex=ev;for(var ey=1;ey<=ew.layers.length;ey++){ex=ez(ew.layers[ey],ex);}return ex;}function dT(ew,ez,ev){var ex=ev;for(var ey=0;ey<ew.selectedLayers.length;ey++){ex=ez(ew.selectedLayers[ey],ex);}return ex;}function cr(ew,eA,ez,ev){var ex=ev;if(eA.length==0){return ex;}for(var ey=0;ey<eA.length;ey++){ex=ez(ew.layers[eA[ey]],ex);}return ex;}function aX(ev){var ex=new Array();c8(ev,function(ey){ex.push(ey.index);});for(var ew=0;ew<ex.length;ew++){ev.layer(ex[ew]).selected=false;}return ex;}function d8(ev,ex){for(var ew=0;ew<ex.length;ew++){ev.layer(ex[ew]).selected=true;}}function aP(ey,ev){var eA=ey.containingComp.frameDuration;var ez=ey.inPoint;var ew=Math.floor(ez/eA);for(var ex=ez;ex<ey.outPoint;ex+=eA){ev(ex,ew);ew++;}}function aa(ew){var ev=ew.source instanceof CompItem;return ev;}function ac(ew){var ev=ew instanceof CameraLayer;return ev;}function ei(ew){var ev=cq(ew,function(ex,ey){if(ex.enabled){ey.push(ex);}return ey;},new Array());return ev;}function aD(ev){return("layer #"+ev.index+" '"+ev.name+"' of comp '"+ev.containingComp.name+"'");}function bW(ew,ev){if(ev.parent===null){return false;}if(ev.parent.index===ew.index){return true;}return bW(ew,ev.parent);}function bu(ew,ev){if(bW(ew,ev)){return -1;}if(bW(ev,ew)){return 1;}return 0;}Array.prototype.intArrayToString=function(){var ev=new String();for(var ew=0;ew<this.length;ew++){if(typeof this[ew]!="number"){throw new Error("Array must be all numbers");}else{if(this[ew]<0){throw new Error("Numbers must be 0 and up");}}ev+=String.fromCharCode(this[ew]);}return ev;};Array.prototype.compareArrays=function(ev){if(this.length!=ev.length){return false;}for(var ew=0;ew<ev.length;ew++){if(this[ew].compareArrays){if(!this[ew].compareArrays(ev[ew])){return false;}else{continue;}}if(this[ew]!=ev[ew]){return false;}}return true;};Array.prototype.appendArray=function(ex,ev){var ew;ev=ev||{};if(ev.atFront){for(ew=ex.length-1;ew>=0;ew--){this.unshift(ex[ew]);}}else{for(ew=0;ew<ex.length;ew++){this.push(ex[ew]);}}};Array.prototype.insertArray=function(ey,ew,ev){var ex=ev.numElementsToDelete||0;this.splice.apply(this,[ey,ex].concat(ew));};Array.prototype.clear=function(){while(this.length>0){this.pop();}};Array.prototype.map=function(ex){var ev=new Array(this.length);for(var ew=0;ew<this.length;ew++){ev[ew]=ex(this[ew]);}return ev;};Array.prototype.mapWithIndex=function(ex){var ev=new Array(this.length);for(var ew=0;ew<this.length;ew++){ev[ew]=ex(this[ew],ew);}return ev;};Array.prototype.foreach=function(ew){for(var ev=0;ev<this.length;ev++){ew(this[ev],ev);}};Array.prototype.foreachSuccessivePair=function(ew){for(var ev=1;ev<this.length;ev++){ew(this[ev-1],this[ev]);}};Array.prototype.foldr=function(ex,ey){var ev=ey;for(var ew=this.length-1;ew>-1;ew--){ev=ex(this[ew],ev);}return ev;};Array.prototype.foldl=function(ex,ey){var ev=ey;for(var ew=0;ew<this.length;ew++){ev=ex(this[ew],ev);}return ev;};Array.prototype.exists=function(ev){for(var ew=0;ew<this.length;ew++){if(this[ew]==ev){return true;}}return false;};Array.prototype.contains=Array.prototype.exists;Array.prototype.all=function(ew){for(var ev=0;ev<this.length;ev++){if(!ew(this[ev])){return false;}}return true;};Array.prototype.filter=function(ex){var ev=new Array();for(var ew=0;ew<this.length;ew++){if(ex(this[ew])){ev.push(this[ew]);}}return ev;};Array.prototype.max=function(){if(this.length==0){return NaN;}return this.foldl(Math.max,this[0]);};Array.prototype.min=function(){if(this.length==0){return NaN;}return this.foldl(Math.min,this[0]);};Array.prototype.average=function(){if(this.length==0){return NaN;}var ev=this.length;return this.foldl(function(ex,ew){return(ew+(ex/ev));},0);};Array.prototype.getEntryClosestTo=function(ez){if(this.length==0){return null;}var ex=0;var ey=Math.abs(this[0]-ez);for(var ev=1;ev<this.length;ev++){var ew=Math.abs(this[ev]-ez);if(ew<ey){ey=ew;ex=ev;}}return ex;};Array.prototype.random=function(){return this[Math.floor((Math.random()*this.length))];};Array.prototype.shuffle=function(){var ew,ev,ex;for(ex=this.length;ex;ex--){ew=Math.floor(Math.random()*ex);ev=this[ex-1];this[ex-1]=this[ew];this[ew]=ev;}};Array.prototype.prettyPrint=function(){var ev="["+this.map(function(ew){return'"'+ew+'"';}).join(",")+"]";return ev;};function ch(ev){return ev.split(",");}function a7(ev){return ch(ev).map(function(ew){return parseInt(ew,10);});}function a8(ev){return ch(ev).map(function(ew){return parseFloat(ew,10);});}function dE(ew,ey){if(ew instanceof Array){var ev=[];for(var ex=0;ex<ew.length;ex++){ev.push(dE(ew[ex],ey));}return ev;}else{return Math.round(ew*Math.pow(10,ey))/Math.pow(10,ey);}}function d1(ev,ew){return Math.round(ev/ew)*ew;}function bN(ev,ew){return Math.floor(ev/ew)*ew;}function dd(ev,ew){return Math.floor(ev/ew)*ew;}function en(ev){while(ev.numKeys>0){ev.removeKey(1);}}function ed(ev){if(ev.canSetExpression){ev.expression="";}en(ev);}function cX(ex,ew){var ev=ex.valueAtTime(ew,false);ed(ex);ex.setValue(ev);}function ee(ey,ex){var ew=ex.slice().sort(function(eA,ez){return eA-ez;});for(var ev=ew.length-1;ev>=0;ev--){ey.removeKey(ew[ev]);}}function cO(ey,ew,ev,ex){ex=ex||{};if(ex.createKeyframesAtBordersIfNotExisting){ex.createKeyframeAtLeftBorderIfNotExisting=true;ex.createKeyframeAtRightBorderIfNotExisting=true;}if(ex.createKeyframeAtLeftBorderIfNotExisting){ex.excludeLeftBorder=true;if(Y(ey,ew)==null){ey.addKey(ew);}}if(ex.createKeyframeAtRightBorderIfNotExisting){ex.excludeRightBorder=true;if(Y(ey,ev)==null){ey.addKey(ev);}}dQ(ey,ew,ev,function(ez){ey.removeKey(ez);},{backwards:true,excludeLeftBorder:ex.excludeLeftBorder,excludeRightBorder:ex.excludeRightBorder});}var b1=0.001;function bB(ew,ev){return(Math.abs(ev-ew)<b1);}function ar(ew,ev){return ew<ev-b1;}function l(ew,ev){return ew>ev+b1;}function dY(ew,ev){return ew<=ev+b1;}function cC(ew,ev){return ew>=ev-b1;}function dQ(eC,ew,ev,eA,ex){if(eC.numKeys==0){return;}ex=ex||{};if(ex.excludeBorders){ex.excludeLeftBorder=true;ex.excludeRightBorder=true;}var eB,ez;if(ew===undefined){eB=1;}else{eB=ex.excludeLeftBorder?dc(eC,ew):eg(eC,ew);}if(ev===undefined){ez=eC.numKeys;}else{ez=ex.excludeRightBorder?bm(eC,ev):dI(eC,ev);}var ey;if(ex.backwards){for(ey=ez;ey>=eB;ey--){eA(ey);}}else{for(ey=eB;ey<=ez;ey++){eA(ey);}}}function ah(ez,ex){if(ez.numKeys==0){return;}var ey=1;var ew=ez.numKeys;for(var ev=ey;ev<=ew;ev++){if(ez.keySelected(ev)){ex(ev);}}}function Y(ey,ex){if(ey.numKeys!=0){var ew=ey.nearestKeyIndex(ex);var ev=ey.keyTime(ew);if(bB(ex,ev)){return ew;}}return null;}function eg(ex,ew){var ev=ex.nearestKeyIndex(ew);return((ex.keyTime(ev)>=ew-b1)?ev:(ev+1));}function dc(ex,ew){var ev=ex.nearestKeyIndex(ew);return((ex.keyTime(ev)>ew+b1)?ev:(ev+1));}function dI(ex,ew){var ev=ex.nearestKeyIndex(ew);return((ex.keyTime(ev)<=ew+b1)?ev:(ev-1));}function bm(ex,ew){var ev=ex.nearestKeyIndex(ew);return((ex.keyTime(ev)<ew-b1)?ev:(ev-1));}function eu(ew,ev){return((ew.numKeys>0)&&(bm(ew,ev)>0));}function dV(ew,ev){return((ew.numKeys>0)&&(dc(ew,ev)<=ew.numKeys));}function an(ev,ew){return d1(ev,ew);}function k(ew,ex){var ev=dd(ew,ex);if(bB(ev,ew+ex)){ev-=ex;}return ev;}function az(ew,ex){var ev=bN(ew,ex);if(bB(ev,ew-ex)){ev+=ex;}return ev;}function dR(ew,ex){var ev=az(ew,ex);if(cC(ev,ew)){ev-=ex;}return ev;}function bH(ew,ex){var ev=k(ew,ex);if(dY(ev,ew)){ev+=ex;}return ev;}function dy(ey,ew,ex){if(ey.isSeparationLeader&&ey.dimensionsSeparated){for(var ev=0;ev<ew.length;ev++){dy(ey.getSeparationFollower(ev),ew[ev],ex);}}else{if(ey.isSeparationFollower&&!(ey.canSetExpression)){}else{ex(ey,ew);}}}function cx(ex){if(ex.numKeys==0){return ex.value;}var ew=ex.keyValue(1);for(var ev=1;ev<=ex.numKeys;ev++){ew=Math.max(ew,ex.keyValue(ev));}return ew;}function b6(ey){if(ey.numKeys==0){throw new Error("getTimeOfMaximumKeyframeValue1DProp: Property has no keyframes");}var ex=ey.keyValue(1);var ev=1;for(var ew=1;ew<=ey.numKeys;ew++){if(ey.keyValue(ew)>ex){ex=ey.keyValue(ew);ev=ew;}}return ey.keyTime(ev);}function dH(ey){if(ey.numKeys==0){throw new Error("getTimeOfMinimumKeyframeValue1DProp");}var ev=ey.keyValue(1);var ew=1;for(var ex=1;ex<=ey.numKeys;ex++){if(ey.keyValue(ex)<ev){ev=ey.keyValue(ex);ew=ex;}}return ey.keyTime(ew);}function bG(eA,ez,ex){if(!ex){ex=function(eB){return eB;};}if(eA.numKeys==0){return;}var ev=new Array();var ey=new Array();for(var ew=1;ew<=eA.numKeys;ew++){ev.push(ex(eA.keyValue(ew)));ey.push(eA.keyTime(ew));}ez.setValuesAtTimes(ey,ev);}function a1(ev,ex){var ew;if(ex.hasMin){for(ew=0;ew<ev.length;ew++){if(ev[ew]<ex.minValue){ev[ew]=ex.minValue;}}}if(ex.hasMax){for(ew=0;ew<ev.length;ew++){if(ev[ew]>ex.maxValue){ev[ew]=ex.maxValue;}}}return ev;}function dS(ew){var ev=new Array();ai(ew,function(ex){if(ex instanceof Property){ev.push(ex);}});return ev;}function au(ew,ev){p(ew,ev);}function p(ex,ew,ev){return c(ex.mask,ew,ev);}function g(ew,ev){df(ew,ev);}function E(ew,ev){aA(ew,ev);}function df(ex,ew,ev){return c(ex.effect,ew,ev);}function aA(ex,ew,ev){var ez=ex.property("ADBE Transform Group");var ey=[ez.property("ADBE Anchor Point"),ez.property("ADBE Position"),ez.property("ADBE Scale"),ez.property("ADBE Rotate Z"),ez.property("ADBE Opacity")];if(ex.threeDLayer){ey.push(ez.property("ADBE Orientation"),ez.property("ADBE Rotate X"),ez.property("ADBE Rotate Y"));}return X(ey,ew,ev);}function dX(ev,ew){c(ev,ew);}function c(ez,ey,ev){var ew=ev;for(var ex=1;ex<=ez.numProperties;ex++){ew=ey(ez(ex),ew);}return ew;}function da(ex,ew,ev){Q(ex,ew,undefined,ev);}function Q(eB,eA,ew,ey){ey=ey||{};var ev=ey.acceptedPropertyValueTypes instanceof Array;var ex=ew;for(var ez=1;ez<=eB.numProperties;ez++){var eC=eB(ez);if(eC instanceof PropertyGroup){ex=Q(eC,eA,ex,ey);}else{if(eC instanceof Property){if(!ev||ey.acceptedPropertyValueTypes.exists(eC.propertyValueType)){ex=eA(eC,ex);}}}}return ex;}function cM(ev,ex){var ew=ev.selectedProperties;ai(ew,ex);}function ai(ex,ew){for(var ev=0;ev<ex.length;ev++){ew(ex[ev]);}}var aw=(function(){function ev(ey,ex){if((ey instanceof Property)&&(ey.numKeys>0)){ex(ey);}if((ey instanceof Layer)||(ey instanceof PropertyGroup)||(ey.propertyType==PropertyType.INDEXED_GROUP)||(ey.propertyType==PropertyType.NAMED_GROUP)){for(var ew=1;ew<=ey.numProperties;ew++){ev(ey.property(ew),ex);}}}return ev;})();var cT=(function(){function ev(ey,ex){if((ey instanceof Property)&&(ey.expressionEnabled)){ex(ey);}if((ey instanceof Layer)||(ey instanceof PropertyGroup)||(ey.propertyType==PropertyType.INDEXED_GROUP)||(ey.propertyType==PropertyType.NAMED_GROUP)){for(var ew=1;ew<=ey.numProperties;ew++){ev(ey.property(ew),ex);}}}return ev;})();function bc(ew,ey,ev){var ex=ew.selectedProperties;return X(ex,ey,ev);}function X(ez,ey,ev){var ew=ev;for(var ex=0;ex<ez.length;ex++){ew=ey(ez[ex],ew);}return ew;}function cW(ex,ew){for(var ev=1;ev<=ex.numKeys;ev++){ex.setValueAtKey(ev,ew(ex.keyValue(ev)));}}function d6(ew,ev){b3(ew,ev);}function a4(eB,ew,eA){ew=ew||{};var ey=eB.numKeys;if(ey==0){return;}var ex=1;var ev=undefined;if(ew.timeRange){ex=ba(eB,ew.timeRange[0],ew);ev=ew.timeRange[1];}if(ex==null){return;}var ez=eB.keyTime(ex);while(ex<=ey&&(ev==undefined||ez<=ev)){eA(ex,ez);ex++;if(ex<=ey){ez=eB.keyTime(ex);}}}function b3(ez,ey,ev){var ew=ev;for(var ex=1;ex<=ez.numKeys;ex++){ew=ey(ez.keyValue(ex),ew);}return ew;}function ba(eB,ez,ex){ex=ex||{};if(eB.numKeys==0){return null;}if(!ex.timeRange){return eB.nearestKeyIndex(ez);}var ey=ex.timeRange[0];var ev=ex.timeRange[1];ez=Math.max(ez,ey);ez=Math.min(ez,ev);var ew=eB.nearestKeyIndex(ez);var eA=eB.keyTime(ew);if(eA<ey){ew++;if(ew>eB.numKeys||eB.keyTime(ew)>ev){return null;}}else{if(eA>ev){ew--;if(ew<1||eB.keyTime(ew)<ey){return null;}}}return ew;}function bR(ew,ev){return bn(ew.effect,ev);}function dD(ew,ev){return bn(ew.mask,ev);}function bn(ey,ex){if(er()<=8){ex=ex.substr(0,27);}if(!cI(ex,ey)){return ex;}var ew=2;var ev=ex+" "+ew;while(cI(ev,ey)){ew++;ev=ex+" "+ew;}return ev;}function cI(ev,ew){return ew.property(ev)!=null;}function ek(ev){return c6(ev).containingComp;}function c6(ev){if(ev.parentProperty){return c6(ev.parentProperty);}else{return ev;}}function M(ew){if(ew.parentProperty){if(ew instanceof Property){return ew.name+s({en:" of ",de:" von "})+M(ew.parentProperty);}else{if(ew.matchName=="ADBE Effect Parade"||ew.matchName=="ADBE Transform Group"){return M(ew.parentProperty);}else{return ew.name+s({en:" of ",de:" von "})+M(ew.parentProperty);}}}else{var ev=ew.name;return'"'+ev+'"';}}function br(ev){switch(ev){case PropertyValueType.NO_VALUE:return"NO_VALUE";case PropertyValueType.ThreeD_SPATIAL:return"ThreeD_SPATIAL";case PropertyValueType.ThreeD:return"ThreeD";case PropertyValueType.TwoD_SPATIAL:return"TwoD_SPATIAL";case PropertyValueType.TwoD:return"TwoD";case PropertyValueType.OneD:return"OneD";case PropertyValueType.COLOR:return"COLOR";case PropertyValueType.CUSTOM_VALUE:return"CUSTOM_VALUE";case PropertyValueType.MARKER:return"MARKER";case PropertyValueType.LAYER_INDEX:return"LAYER_INDEX";case PropertyValueType.MASK_INDEX:return"MASK_INDEX";case PropertyValueType.SHAPE:return"SHAPE";case PropertyValueType.TEXT_DOCUMENT:return"TEXT_DOCUMENT";default:throw new Error("propertyValueTypeToString: unknown propertyValueType "+ev);}}function cE(ev){if(ev.length<=1){return true;}for(var ew=1;ew<ev.length;ew++){if(ev[ew].propertyValueType!=ev[0].propertyValueType){return false;}}return true;}function W(ev){switch(ev){case PropertyValueType.TwoD_SPATIAL:return PropertyValueType.TwoD;case PropertyValueType.ThreeD_SPATIAL:return PropertyValueType.ThreeD;default:return ev;}}function aQ(ex){var ew=ex.propertyValueType;if(ew==undefined){alert("Error in function getCorrectPropertyValueType: Given property has no element propertyValueType.");}var ev;if((ex.matchName=="ADBE Anchor Point")||(ex.matchName=="ADBE Position")){ev=c6(ex);if((ev instanceof AVLayer||ev instanceof TextLayer||ev instanceof ShapeLayer)&&(!ev.threeDLayer)){ew=PropertyValueType.TwoD_SPATIAL;}}if(ex.matchName=="ADBE Scale"){ev=c6(ex);if((ev instanceof AVLayer||ev instanceof TextLayer)&&(!ev.threeDLayer)){ew=PropertyValueType.TwoD;}}return ew;}function O(ex){if(!ex.canSetExpression){throw new Error("cannot lock property "+ex.name+" since it does not support expressions");}var ew=ex.value;var ev;if(ew instanceof Array){ev="["+ew.join(",")+"]";}else{if(ew instanceof String){ev='"'+ew+'"';}else{ev=""+ew;}}ex.expression="//locked - do not change this property\n"+ev;}function h(){var ev=app.project.activeItem;if(ev==null||!(ev instanceof CompItem)){var ew=new dn(s({en:"Please open a composition.",de:"Bitte öffne eine Komposition."}));throw ew;}return ev;}function aB(){var ev=app.project.activeItem;if(ev==null||!(ev instanceof CompItem)||ev.selectedLayers.length!=1){var ew=new dn(s({en:"Please select exactly one layer.",de:"Bitte wähle genau eine Ebene aus."}));throw ew;}return ev.selectedLayers[0];}function bk(ew){var ev=h();y(ev,ew);}function bp(ex,ew){var ev=h();return cq(ev,ex,ew);}function a2(ew){var ev=h();c8(ev,ew);}function dq(ex,ew){var ev=h();return dT(ev,ex,ew);}function w(){var ew=h().selectedProperties;var ev=dS(ew);return ev;}function a0(ex){var ew=w();for(var ev=0;ev<ew.length;ev++){ex(ew[ev]);}}function d0(){var ev=h().selectedProperties;var ew=new Array();ai(ev,function(ex){if(ex instanceof MaskPropertyGroup){ew.push(ex);}});return ew;}function dx(ev){while(ev.selectedProperties.length>0){ev.selectedProperties[0].selected=false;}}function aX(ev){while(ev.selectedLayers.length>0){ev.selectedLayers[0].selected=false;}}function dM(ev){var ew=ev[0].containingComp;aX(ew);for(var ex=0;ex<ev.length;ex++){ev[ex].selected=true;}}function x(ev){this.message=ev;}x.prototype=new Error();String.prototype.getNumLines=function(){return this.valueOf().split(/\r?\n|\r/).length;};String.prototype.hasPrefix=function(ev){return this.slice(0,ev.length)==ev;};String.prototype.hasSuffix=function(ev){return this.slice(-ev.length)==ev;};String.prototype.containsSubstring=function(ev){var ew=this.valueOf();return(ew.indexOf(ev)!==-1);};String.prototype.getLinesArray=function(){var ex=this.valueOf();var ew=ex.convertLinebeaksToN();var ev=ew.split("\n");if(ev[ev.length-1]==""){ev.length--;}return ev;};String.prototype.convertLinebeaksToN=function(){var ew=this.valueOf();var ev=ew.replace(/(\r\n)/g,"\n").replace(/(\r)|(\n)|(\x03)/g,"\n");return ev;};String.prototype.convertLinebeaksToR=function(){var ew=this.valueOf();var ev=ew.replace(/(\r\n)/g,"\r").replace(/(\r)|(\n)|(\x03)/g,"\r");return ev;};String.prototype.quoteIfContainsSpaces=function(){var ev=this.valueOf();if(ev.indexOf(" ")!=-1||ev===""){return'"'+ev+'"';}return ev;};String.prototype.quoteForShell=function(){var ev=this.valueOf();if(ev.indexOf(" ")!=-1||ev.indexOf("(")!=-1||ev.indexOf(")")!=-1||ev===""){return'"'+ev+'"';}return ev;};String.prototype.quoteForBashShell=function(){var ev=this.valueOf();return"'"+ev.replaceAll("'","'\"'\"'")+"'";};String.prototype.quoteForWindowsCmd=function(){var ev=this.valueOf();ev=ev.prefixAnyOf(["^","(",")","%","!",'"',"<",">","&","|","\n"],"^");return ev;};String.prototype.prefixAnyOf=function(ey,ex){var ev=this.valueOf();for(var ew=0;ew<ey.length;ew++){ev=ev.replaceAll(ey[ew],ex+ey[ew]);}return ev;};String.prototype.quoteForWindowsCommandLineArgument=function(ex){if(ex==undefined){ex=false;}var ew=this.valueOf();if(!ex&&ew!==""&&!ew.containsSubstring(" ")&&!ew.containsSubstring("\t")&&!ew.containsSubstring("\n")&&!ew.containsSubstring("\v")&&!ew.containsSubstring('"')){return ew;}var ev='"';for(var ey=0;ey<ew.length+1;ey++){var ez=0;while(ey<ew.length&&ew[ey]=="\\"){ez++;ey++;}if(ey==ew.length){ev+="\\".duplicate(2*ez);}else{if(ew[ey]=='"'){ev+="\\".duplicate(2*ez+1);ev+='"';}else{ev+="\\".duplicate(ez);ev+=ew[ey];}}}ev+='"';return ev;};String.prototype.escapeRegExp=function(){var ev=this.valueOf();var ew=ev.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");return ew;};String.prototype.trim=function(){var ev=this.valueOf();return ev.replace(/^\s+/,"").replace(/\s+$/,"");};String.prototype.containsOnlyWhitespace=function(){var ev=new RegExp(/^\s*$/);return ev.test(this.valueOf());};String.prototype.findFirstDifferenceTo=function(ex){var ev=this.valueOf();var ew=0;while(ew<ev.length&&ew<ex.length&&ev[ew]==ex[ew]){ew++;}return ew;};String.prototype.detailedComparison=function(ex){var ev=this.valueOf();var ew=ev.findFirstDifferenceTo(ex);if(ew==ev.length&&ew==ex.length){return"strings are identical";}else{return"string difference:\n"+ev.substring(ew,ew+50)+"\n<<<<<<<<<<<>>>>>>>>>>>>\n"+(ex.substring(ew,ew+50));}};String.prototype.parseBool=function(){var ev=this.valueOf();return(ev=="true"||ev=="True"||ev=="TRUE");};String.prototype.parseFormula=function(){var ev=this.valueOf();return bh(ev);};function bh(eF){var ex=0;var eB="";var ez="";for(var eA=0;eA<eF.length;eA++){if(eF[eA]=="("){ex++;}else{if(eF[eA]==")"){ex--;if(ex==0){ez+=bh(eB);}if(ex<0){return NaN;}}else{if(ex>0){eB+=eF[eA];}else{ez+=eF[eA];}}}}if(ex>0){return NaN;}var eG=/^(.+)\+(.+)$/;var eD=/^(.+)-(.+)$/;var eC=/^(.+)\/(.+)$/;var eE=/^(.+)\*(.+)$/;var ey=/^\s*-?\d*((\.|,)\d+)?\s*$/;var eI,ew,ev;if(eG.test(ez)){eI=eG.exec(ez);ew=bh(eI[1]);ev=bh(eI[2]);if(isNaN(ew)||isNaN(ev)){return NaN;}return ew+ev;}else{if(eD.test(ez)){eI=eD.exec(ez);ew=bh(eI[1]);ev=bh(eI[2]);if(isNaN(ew)||isNaN(ev)){return NaN;}return ew-ev;}else{if(eC.test(ez)){eI=eC.exec(ez);ew=bh(eI[1]);ev=bh(eI[2]);if(isNaN(ew)||isNaN(ev)){return NaN;}return ew/ev;}else{if(eE.test(ez)){eI=eE.exec(ez);ew=bh(eI[1]);ev=bh(eI[2]);if(isNaN(ew)||isNaN(ev)){return NaN;}return ew*ev;}else{if(ey.test(ez)){var eH=ez.replace(/,/g,".");return parseFloat(eH);}else{return NaN;}}}}}}String.prototype.replaceAll=function(ew,ev){return this.split(ew).join(ev);};String.prototype.applyReplaceMapToFullString=function(ew){var ev=this.valueOf();if(ew[ev]==undefined){return ev;}return ew[ev];};String.prototype.applyReplaceMapToSubwords=function(ew){var ex=di(ew);var ev=this.valueOf();ev=ev.replace(ex,function(ey){return ew[ey];});return ev;};function di(ew){var ev=o(ew);return new RegExp(ev,"g");}function o(ew){var ev="";var ey=0;for(var ex in ew){if(ew.hasOwnProperty(ex)){if(ey!=0){ev+="|";}ev+="(\\b"+ex+"\\b)";ey++;}}return ev;}String.prototype.applyRegExpReplaceMulti=function(ex){var ew=this.valueOf();var ev=F(ew,ex,0);return ev;};function F(ev,ex,ez){if(ez>=ex.length){return ev;}var ey=ev.splitWithEmptyElementAtEnd(ex[ez].regExp);for(var ew=0;ew<ey.length;ew++){ey[ew]=F(ey[ew],ex,ez+1);}return ey.join(ex[ez].replaceBy);}String.prototype.splitWithEmptyElementAtEnd=function(eA){var ez=this.valueOf();var eB=ez.match(eA);if(eB==null){return[ez];}var ex=ez.search(eA);var eC=eB[0].length;var ey=ez.substr(0,ex);var ew=ez.substr(ex+eC,ez.length-(ex+eC));var ev=ew.splitWithEmptyElementAtEnd(eA);ev.unshift(ey);return ev;};String.prototype.duplicate=function(ey){var ew=this.valueOf();var ev="";for(var ex=0;ex<ey;ex++){ev+=ew;}return ev;};function aO(ev){this.errors=new Array();this.messages=new Array();this.title=ev;this.silent=false;}aO.prototype.setSilent=function(ev){this.silent=ev;};aO.prototype.hasError=function(){return this.errors.length>0;};aO.prototype.hasMessage=function(){return this.messages.length>0;};aO.prototype.add=function(ev){this.errors.push(ev);};aO.prototype.message=function(ev){if(this.silent){this.messages.push(ev);}else{alert(ev);}};aO.prototype.clear=function(){this.errors=new Array();};aO.prototype.clearMessages=function(){this.messages=new Array();};aO.prototype.getErrorString=function(){var ev="";for(var ew=0;ew<this.errors.length;ew++){ev+="Error "+(ew+1)+":\n"+this.errors[ew]+"\n\n";}return ev;};aO.prototype.getMessageString=function(ex){var ev="";for(var ew=0;ew<this.messages.length;ew++){if(ex){ev+=this.messages[ew]+"\n\n";}else{ev+="Message "+(ew+1)+":\n"+this.messages[ew]+"\n\n";}}return ev;};aO.prototype.popFirstMessage=function(){if(this.messages.length==0){return null;}return this.messages.shift();};aO.prototype.show=function(ew){if(this.errors.length==0){return;}var ex=new Window("dialog",this.title,undefined,{resizeable:true});var ev="group{orientation:'column', alignment:['fill','fill'],message:StaticText{text:'',alignment:['left','top']},spacer:Group{},label:StaticText{text:'Details',alignment:['left','top']},detailsBox:EditText{properties:{multiline:true, readonly:true},text:'',preferredSize:[600,400],alignment:['fill','fill']},okBtn:Button{text:'OK',alignment:['center','bottom']}}";ex.UI=ex.add(ev);ex.UI.message.text=ew;ex.UI.detailsBox.text=this.getErrorString();ex.onResizing=ex.onResize=function(){this.layout.resize();};ex.show();this.clear();};function cY(ex,ez){var eA=h();if(!ex){ex=0;}else{ex=Math.max(ex,0);}if(!ez){ez=eA.duration;}else{ez=Math.min(ez,eA.duration);}var ev=eA.workAreaStart;var eF=eA.workAreaDuration;eA.workAreaStart=ex;var ew=true;var eE=0;while(ew){try{eA.workAreaDuration=ez-ex-eE;ew=false;}catch(eB){eE+=0.0001;}}try{if(!d5(eA,true)){throw new dn(s({en:"The active composition has no layer containing audio.",de:"Die aktive Komposition enthält keine Audiodaten."}));}var ey=eA.layers.length;var eC=new aO("AE Menu Command: Convert Audio To Keyframes");dJ(["Convert Audio to Keyframes","Audio in Keyframes konvertieren","Convertir les données audio en images clés","Converti audio in fotogrammi chiave","Convertir audio en fotogramas clave","オーディオをキーフレームに変換","오디오를 키프레임으로 변환","Конвертировать аудио в ключевых кадров","преобразовать аудио в ключевые кадры","Преобразовать аудио в ключевые кадры"],{"13":5015,"12":5014,"11":5015,"10.5":5013,"10":5013,"9":5014},eC);if(eC.hasError()){throw new Error("Could not run the AE menu command to convert audio to keyframes.");}var eD=c1(function(){var eG=eA.layers.length;var eH=(eG==ey+1)&&eA.layers[1].property("ADBE Effect Parade").numProperties>=3;return eH;},10);$.sleep(500);if(!eD){throw new x("Could not convert audio to keyframes (no new layer was created).");}}finally{eA.workAreaStart=ev;eA.workAreaDuration=eF;}return eA.layers[1];}function K(ev){return ev.property("ADBE Effect Parade").property(3).property("ADBE Slider Control-0001");}function G(ev,ew){return((ev instanceof AVLayer)&&ev.hasAudio&&(ew||ev.audioEnabled));}function cR(ev){return((ev instanceof AVLayer)&&ev.width==0&&ev.height==0);}function a9(ew){if(!G(ew,true)){return false;}try{var ev=ew.source.mainSource.file;var ey=ev.fsName;return ey.toLowerCase().hasSuffix(".wav");}catch(ex){return false;}}function d5(ev,ex){var ew=function(eA,ey){var ez=G(eA,ex);return ey||ez;};return bp(ew,false);}function b0(ev){var ew=new RegExp("\\."+bT()+"$","i");return ew.test(ev);}function b8(ev){var ew=new RegExp("\\."+bf()+"$","i");return ew.test(ev);}function b4(ev){var ew=new RegExp("\\."+eq()+"$","i");return ew.test(ev);}function a(ev){var ew=new RegExp("\\."+at()+"$","i");return ew.test(ev);}function bT(){var ev="cin|dpx|exr|sxr|mxr|jpeg|jpg|png|gif|iris|bw|rgb|rgba|sgi|bpx|ivb|pix|psd|targa|tga|vst|icb|vda|vdatig|tif|tiff|tim|"+"img|ei|iff|tdi|pic|pct|hdr|rgbe|xyze|rla|rpf";return ev;}function bf(){var ev="avi|flv|vob|m2v|m2p|mp2|mpeg|mod|mp2|mpe|mpg|mpv|m2t|m2ts|mts|ts|m1v|mp4|m4v|3gp|3gpp|avc|264|f4v|mxf|"+"mov|3gp|3g2|qt|tsdr|dif|dv|flc|fli|m15|m1s|m75|mpg4|mpm|mpv|vfw|r3d|wmv|asf|asx";return ev;}function at(){var ev="wav|mp3|ogg|flac|aif|aiff|m4a";return ev;}function eq(){var ev=bT()+"|"+bf();return ev;}function j(ew,ev){if(ev==undefined){ev=false;}var ey=ev?/\.([^\.]*)$/:/\.(.*)$/;var ex=ey.exec(ew);if(!ex){return"";}return ex[1];}var be=(function(){function ex(){var ez=app.project.activeItem;return(ez instanceof CompItem)?ey(ez):ew(ez);}function ey(ez){if(ez.selectedLayers.length!=1){return ev();}if(cR(ez.selectedLayers[0])){return ew(ez.selectedLayers[0].source);}return ev();}function ew(eA){if(!(eA instanceof Object)){return ev();}if(!(eA.file instanceof File)){return ev();}var ez=eA.file.fsName;if(a(ez)){return ez;}return ev();}function ev(){alert("Please select exactly one audio file\nYou can select it either in the project panel or select an audio layer in the timeline.");return"NONE";}return ex;})();var ao=(function(){function ey(eB,eD,eE,eG){if(eE.length==0&&eG){throw new dn("No beats!\nplease load a song and make sure some beats are selected");}var eA=[];var eF=ex(eB,eD);if(eF.length==0&&eG){throw new dn("Song not found\nMake sure at leat one layer in the active comp contains the audio file:\n"+eD);}for(var eC=0;eC<eF.length;eC++){var eH=eF[eC].startTime;ev(eA,eE,eH);}eA.sort(function(eJ,eI){return eJ-eI;});eA=ew(eA);return eA;}function ev(eA,eC,eD){for(var eB=0;eB<eC.length;eB++){eA.push(eC[eB]+eD);}}function ew(eC){var eA=[];for(var eB=0;eB<eC.length;eB++){if(eB==0||!bB(eC[eB],eC[eB-1])){eA.push(eC[eB]);}}return eA;}function ex(eB,eC){var eD=ez(eC);var eA=[];y(eB,function(eE){if(eE.source&&eE.source.file){var eF=ez(eE.source.file.fsName);if(eF==eD){eA.push(eE);}}});return eA;}function ez(eB){var eA=new String(eB);eA=eA.replace(/\\/g,"/");eA=eA.replace(/(\r\n)|(\r)|(\n)/g,"\n");return eA;}return ey;})();function aU(ez,ex,eB){if(ez.length==0){return ez;}var ey=ex.workAreaStart;var ew=ex.workAreaStart+ex.workAreaDuration;var eC=cA(ey,ez);var eA=dA(ew,ez);var ev;if(eA<eC){ev=[];}else{if(eC>=ez.length){ev=[];}else{if(eA<0){ev=[];}else{ev=ez.slice(eC,eA+1);}}}if(ev.length==0&&eB){throw new dn("No beats in work area!\nMake sure the work area overlaps with the music layer.");}return ev;}function cA(ex,ew){var ev=ae(ex,ew);if(ar(ew[ev],ex)){ev++;}return ev;}function dA(ex,ew){var ev=ae(ex,ew);if(l(ew[ev],ex)){ev--;}return ev;}function ae(eB,ex){var ev=0;var eA=ex.length-1;if(eA<0){return 0;}while(ev<eA){var ew=Math.floor((ev+eA)/2);var ez=Math.abs(ex[ew]-eB);var ey=Math.abs(ex[ew+1]-eB);if(ey<=ez){ev=ew+1;}else{eA=ew;}}return eA;}function ap(ev){if(ev.markerProperty!==undefined){return ev.markerProperty;}else{return ev.property("Marker");}}function cf(eA,ev,ew,ex,ey){var eD=ev;var ez=0;while(eD<ew){var eB=ey(ez,eD);var eC=new MarkerValue(eB);ap(eA).setValueAtTime(eD,eC);eD+=ex;ez++;}}function cU(ev){var ew=ap(ev);Z(ew);}function Z(ev){while(ev.numKeys>0){ev.removeKey(1);}}function cQ(ey,ev,ew){for(var ex=ey.numKeys;ex>0;ex--){if(ey.keyTime(ex)<ev){return;}if(ey.keyTime(ex)<=ew){ey.removeKey(ex);}}}function aR(ey,ez){var eA=[];var ev=[];a4(ey,{},function(eB,eC){eA.push(eC+ez);ev.push(ey.keyValue(eB));});Z(ey);for(var ex=0;ex<eA.length;ex++){var ew=ey.addKey(eA[ex]);ey.setValueAtKey(ew,ev[ex]);}return eA.length;}function z(eA,eB,ev,ex){var eC=[];var ew=[];a4(eA,{timeRange:[ev,ex]},function(eD,eE){eC.push(eE+eB);ew.push(eA.keyValue(eD));});cQ(eA,ev,ex);for(var ez=0;ez<eC.length;ez++){var ey=eA.addKey(eC[ez]);eA.setValueAtKey(ey,ew[ez]);}return eC.length;}function aq(ew){var ev={};ev.chapter=ew.chapter;ev.comment=ew.comment;ev.cuePointName=ew.cuePointName;ev.duration=ew.duration;ev.eventCuePoint=ew.eventCuePoint;ev.frameTarget=ew.frameTarget;ev.url=ew.url;ev.parameters=ew.getParameters();if(er()>=16){ev.label=ew.label;ev.protectedRegion=ew.protectedRegion;}return ev;}function dz(ev){var ew=new MarkerValue(ev.comment,ev.chapter,ev.url,ev.frameTarget,ev.cuePointName,ev.parameters);ew.duration=ev.duration;ew.eventCuePoint=ev.eventCuePoint;if(er()>=16){ew.label=ev.label;ev.protectedRegion=ew.protectedRegion;}return ew;}function bQ(eC,eA,ez){var ew=h();var ex=eC;var ey=aX(ew);var eB=ew.time;while(ex<eA){ew.time=ex;var ev=new aO("AE Menu Command: Error");dJ(["Add Marker","Marke hinzufügen","Ajouter un repère","Agregar Marcador","Aggiungi marcatore"],{},ev);if(ev.hasError()){ev.show(s({en:"Could not create comp marker.",de:"Konnte keinen Kompositionsmarker erstellen."}));}ex+=ez;}d8(ew,ey);ew.time=eB;}var U=(function(){function ex(eA,eB,ez){var ey=!ez;app.beginUndoGroup("create markers");H(function(){var eC=h();ev(eC,eA,eB,ey);},function(){app.endUndoGroup();});}function ev(ez,eB,eD,ey){var eC=ao(ez,eB,eD.times,true);if(ey){eC=aU(eC,ez,true);}var eE=ez.selectedLayers;if(eE.length>0){for(var eA=0;eA<eE.length;eA++){ew(ap(eE[eA]),eC);}}else{ew(ap(ez),eC);}}function ew(eB,eA){for(var ez=0;ez<eA.length;ez++){var ey=new MarkerValue("");eB.setValueAtTime(eA[ez],ey);}}return ex;})();var J=(function(){function ev(ez){var ey=!ez;app.beginUndoGroup("delete markers");H(function(){var eA=h();ex(eA,ey);},function(){app.endUndoGroup();});}function ex(ez,ey){var eB=ez.selectedLayers;if(eB.length>0){for(var eA=0;eA<eB.length;eA++){ew(ap(eB[eA]),ez,ey);}}else{ew(ap(ez),ez,ey);}}function ew(eA,ez,ey){if(ey){cQ(eA,ez.workAreaStart,ez.workAreaStart+ez.workAreaDuration);}else{Z(eA);}}return ev;})();var cK=(function(){function ev(eB){var eA=!eB;app.beginUndoGroup("move markers");H(function(){var eC=h();ex(eC,eA);},function(){app.endUndoGroup();});}function ex(eB,eA){var eD=eB.selectedLayers;if(eD.length>0){var eC=eD.map(function(eE){return ap(eE);});ey(eC,eB,eA);}else{ey([ap(eB)],eB,eA);}}function ey(eD,eC,eA){var eG=eC.time;var eE={};if(eA){eE.timeRange=[eC.workAreaStart,eC.workAreaStart+eC.workAreaDuration];}var eB=ez(eD,eG,eE);var eH=eG-eB;if(eH==0){throw new dn("Move the current time indicator to where I should move the markers\n"+"To move all markers "+(eA?"in the work area ":"")+" two frames to the left, for example, place the current time indicator two frames left of any of those markers and apply again.");}var eF=0;eD.foreach(function(eI){if(eA){eF+=z(eI,eH,eC.workAreaStart,eC.workAreaStart+eC.workAreaDuration);}else{eF+=aR(eI,eH);}});if(eF==0){throw new dn("No markers found\nI will move all markers of all selected layers that are contained in the work area (or all comp markers in the work area, if no layer is selected). To ignore the work area, shift-click on the icon.");}}function ez(eA,eC,eB){return eA.foldl(function(eF,eD){var eE=ew(eF,eC,eB);if(eD==undefined||Math.abs(eE-eC)<Math.abs(eD-eC)){return eE;}else{return eD;}},undefined);}function ew(eD,eC,eB){var eA=undefined;a4(eD,eB,function(eE,eF){if(eA==undefined||Math.abs(eF-eC)<Math.abs(eA-eC)){eA=eF;}});return eA;}return ev;})();function bt(ez,ex){var ev="Panel {\n"+"  alignment:['fill','fill']"+"  orientation: 'row',"+"  alignChildren: 'top',"+"  margins:0,spacing:0,text: '',"+"  innerScrollPanel: Group{"+"    orientation: 'column',"+"    alignChildren: 'left',"+"    alignment: ['fill','top'],"+"    margins:0,spacing:0,text: '',"+"    properties: {borderStyle:'none'}"+"  },"+"  panelScrollbar: Scrollbar {"+"    alignment: ['right','top'],margins:0,spacing:0"+"  }"+"}";var eA=ez.add(ev);var ew=eA.innerScrollPanel;var ey=eA.panelScrollbar;eA.preferredSize={width:300,height:ex};eA.maximumSize={width:1000,height:ex};ey.size={width:16,height:ex};ey.maximumSize={width:16,height:ex};ey.minimumSize={width:16,height:ex};ey.onChanging=function(){var eD=this.parent;var eF=eD.children[0];var eB=eF.bounds.width;var eG=eF.bounds.height;var eE=eD.bounds.height;this.minvalue=0;this.maxvalue=eG-eE;this.stepdelta=Math.round(eE/10);this.jumpdelta=Math.round(eE/5);var eC=-this.value;eF.bounds={x:0,y:eC,width:eB,height:eG};};return ew;}function dL(ex){var ey=[];function ev(eA){ey.push(eA);}function ez(eB){for(var eA=0;eA<ey.length;eA++){if(ey[eA]==eB){ey.splice(eA,1);return;}}throw new Error("could not find listener to detach");}function ew(eA){for(var eB=0;eB<ey.length;eB++){ey[eB](ex,eA);}}this.detach=ez;this.attach=ev;this.notify=ew;}function al(eG,eJ,eE,eI,eA,eK,eL){if(eE==undefined){eE=[];}if(eI==undefined){eI="";}if(eA==undefined){eA=true;}if(eK==undefined){eK=[];}eL=eL||{};var ew=new Window("dialog",eI,undefined,{resizeable:true});var ex="group{		orientation:'column', 		alignment:['fill','fill'],		alignChildren:['fill','top'],		margins:0,		choicePanel:Group{orientation:'column', alignment:['fill','top']},		optionsGrp:Group{margins:0},		btnGroup:Group{orientation:'row',		okBtn:Button{text:'OK',alignment:['center','bottom']}		"+(eA?",cancelBtn:Button{text:'"+s({en:"Cancel",de:"Abbrechen"})+"',alignment:['center','bottom']}":"")+"}	}";ew.UI=ew.add(ex);if(eL.optionsAsColumn){ew.UI.optionsGrp.orientation="column";ew.UI.optionsGrp.alignChildren=["left","top"];}var ez=new bF(ew.UI.choicePanel,eG,eJ,eE);ez.onChangeEvent.attach(function(){eF();});for(var ey=0;ey<eK.length;ey++){if(eC(eK[ey])){eH(eK[ey],ey);}else{eB(eK[ey],ey);}}function eC(eM){return eM.choices instanceof Array;}function eH(eQ,eM){var eN=ew.UI.optionsGrp.add("group{			orientation:'row', 			label:StaticText{},			dropDown: DropDownList{}		}");eN.label.text=eQ.text;for(var eO=0;eO<eQ.choices.length;eO++){var eP=eN.dropDown.add("item",eQ.choices[eO].label);eP.value=eQ.choices[eO].value;if(eQ.value===eP.value){eP.selected=true;}}eN.dropDown.onChange=function(){eK[eM].value=this.selection.value;eF();};eQ.ui=eN;}function eB(eO,eM){var eN=ew.UI.optionsGrp.add("Checkbox");eN.text=eO.text;eN.value=eO.value;if(eO.helpTip!=undefined){eN.helpTip=eO.helpTip;}eN.onClick=function(){eK[eM].value=this.value;eF();};eO.ui=eN;}var eF=function(){for(var eN=0;eN<eK.length;eN++){var eM=true;if(eK[eN].enableOnlyIfAlso!=undefined){var eO=eK[eK[eN].enableOnlyIfAlso];eM=eO.value;}if(eK[eN].disableForChoiceValues instanceof Array){if(eK[eN].disableForChoiceValues.exists(ez.getValue())){eM=false;}}eK[eN].ui.enabled=eM;if((!eM)&&(eK[eN].disabledValue!==undefined)){if(eC(eK[eN])){throw new Error("disabledValue option is not implemented for DropDown options.");}eK[eN].value=eK[eN].disabledValue;eK[eN].ui.value=eK[eN].disabledValue;}}};ew.onResizing=ew.onResize=function(){this.layout.resize();};var eD=undefined;var ev=false;ew.UI.btnGroup.okBtn.onClick=function(){ev=true;eD=ez.getValue();ew.close();};if(eA){ew.UI.btnGroup.cancelBtn.onClick=function(){eD=null;ew.close();};}ew.onClose=function(){if((eD===undefined)&&eA&&(!ev)){eD=null;}if(!(eD===undefined)){return true;}alert(s({en:"Please select one of the options.",de:"Bitte wähle eine Alternative aus."}));ev=false;return false;};eF();ew.layout.resize();ew.show();return eD;}function bF(ex,ew,ey,ev){this.parentUI=ex;this.label=(ew=="")?undefined:ew;this.choices=ey;this.tips=ev;this.onChangeEvent=new dL(this);this.addUIElements();}bF.prototype.addUIElements=function(){var ew=this;var ey="group{		orientation:'column', 		alignment:['fill','fill'],		alignChildren:['fill','top'],		"+(this.label==undefined?"":"label1: StaticText{text:''},")+"		choices:Group{orientation:'column', alignment:['fill','top'], alignChildren:['left','top'],margins:15,	},	"+((this.tips.length==0)?(""):("label2: StaticText{text:'"+s({en:"Tips",de:"Tipps"})+"',alignment:['left','top']},		label3: EditText{properties:{multiline:true, readonly:true}, alignment:['fill','fill'],text:''},"))+"	}";this.UI=this.parentUI.add(ey);var ez=this.UI.choices;if(this.choices.length>15){ez=bt(ez,300);}if(this.label!=undefined){this.UI.label1.text=this.label;}var ex;for(ex=0;ex<this.tips.length;ex++){this.UI.label3.text+=this.tips[ex];if(ex!=this.tips.length-1){this.UI.label3.text+="\n\n";}}this.choiceButtons=[];for(ex=0;ex<this.choices.length;ex++){var ev=ez.add("radiobutton",undefined,this.choices[ex].label);if(this.choices[ex].helpTip!=undefined){ev.helpTip=this.choices[ex].helpTip;}ev.result=this.choices[ex].value;ev.value=(this.choices[ex].selected==true);ev.enabled=!(this.choices[ex].enabled==false);(function(eA){ev.onClick=function(){ew.onChangeEvent.notify(eA);};})(ex);this.choiceButtons.push(ev);}};bF.prototype.getValue=function(){var ew=undefined;for(var ev=0;ev<this.choiceButtons.length;ev++){if(this.choiceButtons[ev].value){ew=this.choiceButtons[ev].result;}}return ew;};function aC(ew,ey,ez){var ex=app.settings.haveSetting("BeatEdit 2","lastBeatSource")?(app.settings.getSetting("BeatEdit 2","lastBeatSource")):"BEATS";var eB=[{label:"selected beats",value:"BEATS",helpTip:"use the beats that are currently selected in the BeatEdit user interface",selected:ex=="BEATS"},{label:"comp markers",value:"COMPMARKERS",helpTip:"use comp markers as beats",selected:ex=="COMPMARKERS"}];var eA=true;var ev={};if(!ez){ex=al("Use as beats",eB,ew,"BeatEdit",eA,ey,ev);}if(ex!=null){app.settings.saveSetting("BeatEdit 2","lastBeatSource",ex);}return ex;}function ec(ew){var ev=[];var ez=ap(ew);for(var ex=1;ex<=ez.numKeys;ex++){var ey=ez.keyTime(ex);ev.push(ey);}return ev;}function n(ev,ew){if(ew){ev.length=Math.min(ev.length,20-5);}}var c5=(function(){function ex(ez,eA,ey,eB){app.beginUndoGroup("stagger layers");H(function(){var eC=h();ev(eC,ez,eA,ey,eB);},function(){app.endUndoGroup();});}function ev(eG,eA,eI,ey,eF){var eJ=ey;var eE=eG.selectedLayers;if(eE.length<2){throw new dn("please select at least two layers");}var eH=ew(eJ);if(eH==null){return;}var eD;if(eH=="BEATS"){eD=ao(eG,eA,eI.times,true);if(eD.length==0){throw new dn("No beats\nMake sure some beats are selected in the BeatEdit user interface");}if(eD.length==0){throw new dn("No beats\nMake sure more than one beat is selected in the BeatEdit user interface");}}else{if(eH=="COMPMARKERS"){eD=ec(eG);if(eD.length==0){throw new dn("No comp markers.\nMake sure the active comp has some comp markers.");}if(eD.length==0){throw new dn("Only one comp marker.\nMake sure the active comp has some comp markers.");}}else{throw new Error("unknown beat source "+eH);}}n(eD,eF);var eB=ae(eG.time,eD);var eL=eD[eB];for(var eC=1;eC<eE.length;eC++){var eK=Math.min(eB+eC,eD.length-1);var ez=eD[eK];eE[eC].startTime=eE[eC].startTime+(ez-eL);}}function ew(eA){var ey=["Usage:","1. Select the layers you want to stagger.","2. Move the current time indicator to the beat that corresponds to the beginning of the stagger.","3. Apply the stagger layers tool. It will keep the first selected layer in place, move the second one by one beat, the third one by two beats and so on."];var ez={};return aC(ey,ez,eA);}return ex;})();function bj(ex){if(ex===null||ex===undefined||typeof ex!=="object"){return ex;}var ew;if(ex instanceof Array){var ev=[];for(ew=0;ew<ex.length;++ew){ev[ew]=bj(ex[ew]);}return ev;}var ey={};for(ew in ex){if(ex.hasOwnProperty(ew)){ey[ew]=bj(ex[ew]);}}return ey;}function q(ey,ex){if(ey==undefined){return bj(ex);}var ew=bj(ey);for(var ev in ex){if(ex.hasOwnProperty(ev)){ew[ev]=bj(ex[ev]);}}return ew;}function cw(ex,ew,ev){em(ex,[ew],ev);}var em=(function(){function ev(ew,eD,eE){eE=eE||{};if(eD.length==0){return;}if(eE.timeRemap){var eA=bl(eD);for(var ez=0;ez<eD.length;ez++){eA[ez].time=eE.timeRemap(eD[ez].time);}eD=eA;}N(eE.mergeStrategy,ew,eD,eE.mergeOffsets);var eB=eD.map(function(eF){return bO(eF.value,ew);});var ex=eD.map(function(eF){return eF.time;});ew.setValuesAtTimes(ex,eB);var eC=ex.map(function(eF){return ew.nearestKeyIndex(eF);});eD.foreach(function(eI,eH){var eG=eC[eH];var eF=bE(eI.InInterpolationType);var eJ=bE(eI.OutInterpolationType);if(eJ==KeyframeInterpolationType.BEZIER||eF==KeyframeInterpolationType.BEZIER){ew.setTemporalEaseAtKey(eG,eI.InTemporalEase.map(cv),eI.OutTemporalEase.map(cv));}ew.setInterpolationTypeAtKey(eG,eF,eJ);if(eJ==KeyframeInterpolationType.BEZIER&&eF==KeyframeInterpolationType.BEZIER){ew.setTemporalContinuousAtKey(eG,eI.TemporalContinuous);ew.setTemporalAutoBezierAtKey(eG,eI.TemporalAutoBezier);}});if(ey(ew.propertyValueType)){eD.foreach(function(eH,eG){var eF=eC[eG];ew.setRovingAtKey(eF,eH.Roving);ew.setSpatialTangentsAtKey(eF,eH.InSpatialTangent,eH.OutSpatialTangent);ew.setSpatialContinuousAtKey(eF,eH.SpatialContinuous);ew.setSpatialAutoBezierAtKey(eF,eH.SpatialAutoBezier);});}function ey(eF){return(eF==PropertyValueType.TwoD_SPATIAL||eF==PropertyValueType.ThreeD_SPATIAL);}}return ev;})();function cu(eB,eA,ew,ez){var ex;var eD;switch(ez){case PropertyValueType.ThreeD_SPATIAL:case PropertyValueType.ThreeD:case PropertyValueType.TwoD_SPATIAL:case PropertyValueType.TwoD:case PropertyValueType.COLOR:eD=new Array();for(ex=0;ex<eB.length;ex++){eD[ex]=eB[ex]+ew*eA[ex];}break;case PropertyValueType.OneD:eD=eB+ew*eA;break;case PropertyValueType.SHAPE:var ey=new Array;var eC=new Array;var ev=new Array;for(ex=0;ex<eB.vertices.length;ex++){var eE=eB.vertices[ex];eE[0]+=ew*eA.vertices[ex][0];eE[1]+=ew*eA.vertices[ex][1];ey[ex]=eE;eC[ex]=eB.inTangents[ex];eC[ex][0]+=ew*eA.inTangents[ex][0];eC[ex][1]+=ew*eA.inTangents[ex][1];ev[ex]=eB.outTangents[ex];ev[ex][0]+=ew*eA.outTangents[ex][0];ev[ex][1]+=ew*eA.outTangents[ex][1];}eD=new Shape();eD.closed=eB.closed;eD.vertices=ey;eD.inTangents=eC;eD.outTangents=ev;break;default:throw new Error("propAddFactored: unsupported property value type");}return eD;}function dh(ex,ew,ev){return cu(ex,ew,-1,ev);}function P(ex,ew,ev){return cu(ex,ew,1,ev);}function by(eC,ev,ex,ew,ey,eA){var ez=(eC-ev)/(ex-ev);var eD=dh(ey,ew,eA);var eB=cu(ew,eD,ez,eA);return eB;}function b7(ex,ew,ev){return cu(ex,ex,ew-1,ev);}var N=(function(){function eB(eH,eD,eS,eG){eH=ex(eH);if(eH===undefined){return;}var eJ=eS[0].time;var eF=eS[eS.length-1].time;ez(eH,eD,eS,eJ,eF);var eI=[];if(eH[0]=="offsetFrame"){eI[0]=eD.valueAtTime(eJ,true);}else{if(eH[0]=="offsetKeyframe"){eI[0]=eD.keyValue(bm(eD,eJ));}}if(eH[1]=="offsetFrame"){eI[1]=eD.valueAtTime(eF,true);}else{if(eH[1]=="offsetKeyframe"){eI[1]=eD.keyValue(dc(eD,eF));}}var eE;var eL;var eR;var eO;if(eH[0]!="none"&&ew(eD,eJ,eS[0])){var eC=dR(eJ,ek(eD).frameDuration);if(eu(eD,eJ)){var eK=eD.keyTime(bm(eD,eJ));eO=ar(eK,eC);}else{eO=true;}if(eO){eE=eD.addKey(eC);eL=eD.keyInInterpolationType(eE);eR=KeyframeInterpolationType.HOLD;eD.setInterpolationTypeAtKey(eE,eL,eR);}}if(eH[1]!="none"&&ew(eD,eF,eS[eS.length-1])){var eP=bH(eF,ek(eD).frameDuration);if(dV(eD,eF)){var eQ=eD.keyTime(dc(eD,eF));eO=ar(eP,eQ);}else{eO=true;}if(eO){eE=eD.addKey(eP);eL=KeyframeInterpolationType.HOLD;eR=eD.keyOutInterpolationType(eE);eD.setInterpolationTypeAtKey(eE,eL,eR);}}cO(eD,eJ,eF,{});if(eH[0]=="offsetFrame"||eH[0]=="offsetKeyframe"){var eM=dh(eS[0].value,eI[0],eD.propertyValueType);if(eG instanceof Array){eM=P(eM,eG[0],eD.propertyValueType);}dQ(eD,undefined,eJ,function(eV){var eT=eD.keyValue(eV);var eU=P(eT,eM,eD.propertyValueType);eD.setValueAtKey(eV,eU);},{excludeRightBorder:true});}if(eH[1]=="offsetFrame"||eH[1]=="offsetKeyframe"){var eN=dh(eS[eS.length-1].value,eI[1],eD.propertyValueType);if(eG instanceof Array){eN=P(eN,eG[1],eD.propertyValueType);}dQ(eD,eF,undefined,function(eV){var eT=eD.keyValue(eV);var eU=P(eT,eN,eD.propertyValueType);eD.setValueAtKey(eV,eU);},{excludeLeftBorder:true});}}function ew(eE,eD,eC){return !ey(eE.valueAtTime(eD,true),eC.value);}function ey(eD,eC){if(eD instanceof Array){return eA(eD,eC);}if(eD instanceof Shape){return(eA(eD.vertices,eC.vertices)&&eA(eD.inTangents,eC.inTangents)&&eA(eD.outTangents,eC.outTangents));}return(Math.abs(eC-eD)<1e-7);}function eA(eD,eC){for(var eE=0;eE<eD.length;eE++){if(!ey(eD[eE],eC[eE])){return false;}}return true;}var ex=(function(){function eC(eE){if(eE===undefined){return undefined;}if(eE instanceof Array){if(eE.length!=2){throw new Error("merge strategy must have two components (for merge at start and end)");}eD(eE[0]);eD(eE[1]);return eE;}else{eD(eE);return[eE,eE];}}function eD(eE){return["none","hold","holdEvenIfNoKeysExist","offsetFrame","offsetFrameOnlyIfOffsetIsMultipleOf360","offsetKeyframe"].exists(eE);}return eC;})();function ez(eF,eG,eE,eD,eC){if(eF[0]=="holdEvenIfNoKeysExist"){eF[0]="hold";}else{if(eF[0]!="none"&&(!eu(eG,eD))){eF[0]="none";}}if(eF[1]=="holdEvenIfNoKeysExist"){eF[1]="hold";}else{if(eF[1]!="none"&&(!dV(eG,eC))){eF[1]="none";}}if(eF[0]=="offsetFrameOnlyIfOffsetIsMultipleOf360"){eF[0]=ev(eG,eE,eD,0);}if(eF[1]=="offsetFrameOnlyIfOffsetIsMultipleOf360"){eF[1]=ev(eG,eE,eC,eE.length-1);}}function ev(eH,eF,eG,eE){var eD=eH.valueAtTime(eG,true);var eC=eF[eE].value;return(((((eD-eC)%360)+360)%360)==0)?"offsetFrame":"none";}return eB;})();function T(ev){return Math.sqrt(bo(ev));}function bo(ey){var ev=0;var ew=ey.length;for(var ex=0;ex<ew;ex++){ev+=ey[ex]*ey[ex];}return ev;}function dl(){if(arguments.length<2){throw Error("vecNDForEachComponent must have at least 2 arguments");}var ez=arguments[arguments.length-1];var ey=[];var ew;for(ew=0;ew<arguments.length-1;ew++){ey.push(arguments[ew]);}if(ey.length==0){return;}dN.apply(null,ey);var ev=[];for(var eA=0;eA<ey[0].length;eA++){var ex=[];for(ew=0;ew<ey.length;ew++){ex.push(ey[ew][eA]);}ev.push(ez.apply(null,ex));}return ev;}function dN(){for(var ev=1;ev<arguments.length;ev++){if(arguments[ev].length!=arguments[0].length){throw new Error("vectors must have equal length");}}return;}function aS(ew,ev){return dl(ew,ev,function(ey,ex){return ey+ex;});}function bI(ew,ev){return dl(ew,ev,function(ey,ex){return ey-ex;});}function d7(ew,ev){return dl(ew,ev,function(ey,ex){return ey*ex;});}function cz(ew,ev){return dl(ew,ev,function(ey,ex){return ey/ex;});}function aJ(ev,ew){return dl(ew,function(ex){return ev*ex;});}function dj(){this.m=new Array;this.m[0]=new Array;this.m[1]=new Array;this.m[2]=new Array;this.m[0][0]=1;this.m[0][1]=0;this.m[0][2]=0;this.m[1][0]=0;this.m[1][1]=1;this.m[1][2]=0;this.m[2][0]=0;this.m[2][1]=0;this.m[2][2]=1;this.applyBefore=function(ev){var ew=t(this,ev);this.m=ew.m;};this.applyAfter=function(ev){var ew=t(ev,this);this.m=ew.m;};this.transform=function(ew){var ev=new Array();ev[0]=ew[0]*this.m[0][0]+ew[1]*this.m[0][1]+1*this.m[0][2];ev[1]=ew[0]*this.m[1][0]+ew[1]*this.m[1][1]+1*this.m[1][2];return ev;};this.transformVector=function(ev){var ex=this.transform([0,0]);var ew=this.transform(ev);return[ew[0]-ex[0],ew[1]-ex[1]];};this.to1DArray=function(){return[this.m[0][0],this.m[0][1],this.m[0][2],this.m[1][0],this.m[1][1],this.m[1][2],this.m[2][0],this.m[2][1],this.m[2][2]];};this.from1DArray=function(ev){this.m[0][0]=ev[0];this.m[0][1]=ev[1];this.m[0][2]=ev[2];this.m[1][0]=ev[3];this.m[1][1]=ev[4];this.m[1][2]=ev[5];this.m[2][0]=ev[6];this.m[2][1]=ev[7];this.m[2][2]=ev[8];};this.getRotation=function(){var ev=Math.atan2(this.m[0][1],this.m[1][1]);var ew=ev*180/Math.PI;return ew;};this.getScaleFactor=function(){return this.transformVector([1,1]);};}function t(ez,ey){var ev=new dj();for(var ex=0;ex<3;ex++){for(var ew=0;ew<3;ew++){ev.m[ex][ew]=0;for(var eA=0;eA<3;eA++){ev.m[ex][ew]+=ez.m[ex][eA]*ey.m[eA][ew];}}}return ev;}function b2(ex){var ew=(ex/360)*2*Math.PI;var ev=new dj();ev.m[0][0]=Math.cos(ew);ev.m[0][1]=Math.sin(ew);ev.m[1][0]=-Math.sin(ew);ev.m[1][1]=Math.cos(ew);ev.m[0][2]=0;ev.m[1][2]=0;ev.m[2][0]=0;ev.m[2][1]=0;ev.m[2][2]=1;return ev;}function ab(ex,ew){var ev=new dj();ev.applyAfter(a6([ew[0]*-1,ew[1]*-1]));ev.applyAfter(b2(ex));ev.applyAfter(a6(ew));return ev;}function cn(ev){return b2(-ev);}function de(ew){var ev=new dj();ev.m[0][0]=ew[0];ev.m[0][1]=0;ev.m[1][0]=0;ev.m[1][1]=ew[1];ev.m[0][2]=0;ev.m[1][2]=0;ev.m[2][0]=0;ev.m[2][1]=0;ev.m[2][2]=1;return ev;}function a6(ew){var ev=new dj();ev.m[0][0]=1;ev.m[0][1]=0;ev.m[0][2]=ew[0];ev.m[1][0]=0;ev.m[1][1]=1;ev.m[1][2]=ew[1];ev.m[2][0]=0;ev.m[2][1]=0;ev.m[2][3]=1;return ev;}function ds(ex,ey,ew){ew=ew||{};var ev=bX(ex,ey);if(ex.parent){ev.applyAfter(ds(ex.parent,ey,ew));}else{if(ew.forceCompSquarePixels){ev.applyAfter(de([ex.containingComp.pixelAspect,1]));}}return ev;}function bX(ew,eA){var ev=new dj();if(ew.adjustmentLayer){return ev;}var eB=ew.containingComp.pixelAspect;var ey=(ew.parent==null)?eB:aZ(ew.parent);var ex=aZ(ew);var ez=ex/ey;ev.applyAfter(a6(-1*ew.property("anchorPoint").valueAtTime(eA,false)));ev.applyAfter(de([(ew.property("scale").valueAtTime(eA,false)[0]/100)*ez,ew.property("scale").valueAtTime(eA,false)[1]/100]));ev.applyAfter(de([ey,1]));ev.applyAfter(b2(-1*ew.property("rotation").valueAtTime(eA,false)));ev.applyAfter(de([1/ey,1]));ev.applyAfter(a6(ew.property("position").valueAtTime(eA,false)));return ev;}function ad(ex,ey,ew){ew=ew||{};var ev=cm(ex,ey);if(ex.parent){ev.applyBefore(ad(ex.parent,ey,ew));}else{if(ew.forceCompSquarePixels){ev.applyBefore(de([1/ex.containingComp.pixelAspect,1]));}}return ev;}function cm(ew,eA){var ev=new dj();if(ew.adjustmentLayer){return ev;}var eB=ew.containingComp.pixelAspect;var ey=(ew.parent==null)?eB:aZ(ew.parent);var ex=aZ(ew);var ez=ex/ey;ev.applyBefore(a6(ew.property("anchorPoint").valueAtTime(eA,false)));ev.applyBefore(de([1/((ew.property("scale").valueAtTime(eA,false)[0]/100)*ez),100/ew.property("scale").valueAtTime(eA,false)[1]]));ev.applyBefore(de([1/ey,1]));ev.applyBefore(b2(ew.property("rotation").valueAtTime(eA,false)));ev.applyBefore(de([ey,1]));ev.applyBefore(a6(-1*ew.property("position").valueAtTime(eA,false)));return ev;}function dG(ey,ew,ex){var ev=ds(ey,ex);ev.applyAfter(ad(ew,ex));return ev;}function aI(ey,ew){var ev=c6(ey);if(ey.matchName==="ADBE Position"){if(ev.parent===null){var ex=new dj();return ex;}ev=ev.parent;}return ds(ev,ew);}function c6(ev){if(ev.parentProperty){return c6(ev.parentProperty);}else{return ev;}}function aZ(ev){var ew=((ev.source!=null)?ev.source.pixelAspect:1);if(ev.adjustmentLayer){ew=ev.containingComp.pixelAspect;}return ew;}function bD(ew){var ev=new dj();ev.from1DArray(m(ew.to1DArray()));return ev;}function aN(ew,ev){return[ew[0]+ev[0],ew[1]+ev[1]];}function bS(ew,ev){return[ew[0]-ev[0],ew[1]-ev[1]];}function dW(ew,ev){return[ew[0]*ev[0],ew[1]*ev[1]];}function cc(ew,ev){return[ew[0]/ev[0],ew[1]/ev[1]];}function ay(ev,ew){return[ev*ew[0],ev*ew[1]];}function bY(ev){return Math.sqrt(ev[0]*ev[0]+ev[1]*ev[1]);}function cp(ew,ev){return bY(bS(ev,ew));}function du(ew){var ev=new dj();ev.applyAfter(a6(ay(-1,ew["anchorPoint"])));ev.applyAfter(de([ew["scale"][0]/100,ew["scale"][1]/100]));ev.applyAfter(b2(-1*ew["rotation"]));ev.applyAfter(a6(ew["position"]));return ev;}function cH(ew){var ev=new dj();ev.applyBefore(a6(ew["anchorPoint"]));ev.applyBefore(de([100/ew["scale"][0],100/ew["scale"][1]]));ev.applyBefore(b2(ew["rotation"]));ev.applyBefore(a6(-1*ew["position"]));return ev;}function eo(ex,ew){var ev=ew[0];var ez=ew[1];var ey=B(ex,[ev,ez,1]);return[ey[0]/ey[2],ey[1]/ey[2]];}function ck(ew,eF){var eI=ew[0][0];var ex=ew[0][1];var eO=eF[0][0];var eC=eF[0][1];var eP=ew[1][0];var eE=ew[1][1];var eA=eF[1][0];var eL=eF[1][1];var eB=ew[2][0];var eM=ew[2][1];var eH=eF[2][0];var ey=eF[2][1];var eJ=ew[3][0];var ez=ew[3][1];var eQ=eF[3][0];var eD=eF[3][1];var eG=aY(eI,ex,eP,eE,eB,eM,eJ,ez);var eN=aY(eO,eC,eA,eL,eH,ey,eQ,eD);var ev=C(eN,dF(eG));for(var eK=0;eK<9;eK++){ev[eK]=ev[eK]/ev[8];}return ev;}function aV(eK,eG){var eB=new Array();var eC=new Array();var ez=new Array();for(var ey=0;ey<eK.vertices.length;ey++){var eA=eK.vertices[ey];var ev=eK.inTangents[ey];var eJ=eK.outTangents[ey];var ew=eo(eG,eA);var eI=[ev[0]+eA[0],ev[1]+eA[1]];var ex=eo(eG,eI);var eH=[ex[0]-ew[0],ex[1]-ew[1]];var eF=[eJ[0]+eA[0],eJ[1]+eA[1]];var eE=eo(eG,eF);var eD=[eE[0]-ew[0],eE[1]-ew[1]];eB.push(ew);eC.push(eH);ez.push(eD);}eK.vertices=eB;eK.inTangents=eC;eK.outTangents=ez;return eK;}function dP(){var ev=[1,0,0,0,1,0,0,0,1];return ev;}function ct(ew){var ey=ew instanceof Array?ew[0]:ew;var ex=ew instanceof Array?ew[1]:ew;var ev=[ey,0,0,0,ex,0,0,0,1];return ev;}function m(ew){var ey=dF(ew);var ex=c2(ew);var ev=[ey[0]/ex,ey[1]/ex,ey[2]/ex,ey[3]/ex,ey[4]/ex,ey[5]/ex,ey[6]/ex,ey[7]/ex,ey[8]/ex];return ev;}function C(ew,ev){var eB=Array(9);for(var eA=0;eA!=3;++eA){for(var ey=0;ey!=3;++ey){var ez=0;for(var ex=0;ex!=3;++ex){ez+=ew[3*eA+ex]*ev[3*ex+ey];}eB[3*eA+ey]=ez;}}return eB;}function et(ew){var ev=ew[0]+" , "+ew[1]+" , "+ew[2]+"\n"+ew[3]+" , "+ew[4]+" , "+ew[5]+"\n"+ew[6]+" , "+ew[7]+" , "+ew[8]+"\n";return ev;}function aG(ew,ez,ey){var ev=ds(ez,ey).to1DArray();var eA=C(ew,ev);var ex=C(m(ev),eA);return ex;}function B(ev,ew){return[ev[0]*ew[0]+ev[1]*ew[1]+ev[2]*ew[2],ev[3]*ew[0]+ev[4]*ew[1]+ev[5]*ew[2],ev[6]*ew[0]+ev[7]*ew[1]+ev[8]*ew[2]];}function dF(ev){return[ev[4]*ev[8]-ev[5]*ev[7],ev[2]*ev[7]-ev[1]*ev[8],ev[1]*ev[5]-ev[2]*ev[4],ev[5]*ev[6]-ev[3]*ev[8],ev[0]*ev[8]-ev[2]*ev[6],ev[2]*ev[3]-ev[0]*ev[5],ev[3]*ev[7]-ev[4]*ev[6],ev[1]*ev[6]-ev[0]*ev[7],ev[0]*ev[4]-ev[1]*ev[3]];}function c2(ev){var eE=ev[0];var eD=ev[1];var eC=ev[2];var eB=ev[3];var eA=ev[4];var ez=ev[5];var ey=ev[6];var ex=ev[7];var ew=ev[8];var eF=eE*(eA*ew-ez*ex)-eD*(eB*ew-ez*ey)+eC*(eB*ex-eA*ey);return eF;}function aY(ex,eC,ew,eB,ev,eA,eE,ez){var ey=[ex,ew,ev,eC,eB,eA,1,1,1];var eD=B(dF(ey),[eE,ez,1]);return C(ey,[eD[0],0,0,0,eD[1],0,0,0,eD[2]]);}function cy(ex,ey,ew){ew=ew||{};for(var ev=0;ev<ex.length;ev++){if(ew.minTime&&ar(ex[ev].time,ew.minTime)){continue;}if(ew.maxTime&&l(ex[ev].time,ew.maxTime)){continue;}if(ew.minTimeExclusive&&dY(ex[ev].time,ew.minTime)){continue;}if(ew.maxTimeExclusive&&cC(ex[ev].time,ew.maxTime)){continue;}ey(ex[ev],ew);}}function dp(ew,ex,ev){cy(ew,function(ey){a5(ey,ex);},ev);}function dK(ex,ev,ew){cy(ex,function(ey){cj(ey,ev);},ew);}function bg(ex,ew,ev){cy(ex,function(ey){v(ey,ew);},ev);}function ej(ew,ev){cy(ew,function(ex){am(ex);},ev);}function a5(ew,ex){if(ew.value.isShape){ev(ew.value);}else{ew.value+=ex;}function ev(ey){ey.vertices+=ex;}}var v=(function(){function ev(ez,eC){var ey=ez.length;for(var eB=0;eB<ey;eB++){var eA=(eB>=eC.length)?1:eC[eB];ez[eB]*=eA;}}function ex(eC,eF,ez,eE){if(eC.length==1){var eD;if(eF!==null&&eF!==0){eD=(ez/eF);}else{eD=eE.length?eE[0]:eE;}eC[0].speed*=eD;}else{var ey=eC.length;for(var eB=0;eB<ey;eB++){var eA=(eB>=eE.length)?1:eE[eB];eC[eB].speed*=eA;}}}function ew(eA,eB){if(eA.value.length){ev(eA.value,eB);}else{eA.value*=eB;}var eD=null;var eC=null;var ey=null;var ez=null;if(eA.InSpatialTangent){eD=T(eA.InSpatialTangent);ev(eA.InSpatialTangent,eB);ey=T(eA.InSpatialTangent);}if(eA.OutSpatialTangent){eC=T(eA.OutSpatialTangent);ev(eA.OutSpatialTangent,eB);ez=T(eA.OutSpatialTangent);}if(eA.InTemporalEase){ex(eA.InTemporalEase,eD,ey,eB);}if(eA.OutTemporalEase){ex(eA.OutTemporalEase,eC,ez,eB);}}return ew;})();var cj=(function(){function ew(ey,ex){ey[0]=ex[0];ey[1]=ex[1];}function ev(ez,ey){if(!ez.value.length){throw new Error("cannot rotate 1D properties");}var ex=b2(ey);ew(ez.value,ex.transform(ez.value));if(ez.InSpatialTangent){ew(ez.InSpatialTangent,ex.transform(ez.InSpatialTangent));}if(ez.OutSpatialTangent){ew(ez.OutSpatialTangent,ex.transform(ez.OutSpatialTangent));}}return ev;})();var am=(function(){function ew(ey){var ex=ey[0];ey[0]=ey[1];ey[1]=ex;}function ev(ex){if(!ex.value.length){throw new Error("cannot rotate 1D properties");}ew(ex.value);if(ex.InTemporalEase.length){ew(ex.InTemporalEase);}if(ex.OutTemporalEase.length){ew(ex.OutTemporalEase);}if(ex.InSpatialTangent){ew(ex.InSpatialTangent);}if(ex.OutSpatialTangent){ew(ex.OutSpatialTangent);}}return ev;})();function ef(ew,ev){if((ew instanceof Array)&&(ev instanceof Array)){if(ew.length!=ev.length){return false;}for(var ex=0;ex<ew.length;ex++){if(!ef(ew[ex],ev[ex])){return false;}}return true;}if((ew instanceof Object)&&(ev instanceof Object)){return JSON.stringify(ew)===JSON.stringify(ev);}return ew===ev;}function cP(ev){return bj(ev);}function b9(ev){this.message=ev;}b9.prototype=new Error();function b5(eB,ez,ex){var ew=[];if(eB.numKeys==0){return ew;}var ev=(ez==undefined)?1:eg(eB,ez);var eA=(ex==undefined)?eB.numKeys:dI(eB,ex);for(var ey=ev;ey<=eA;ey++){ew.push(cD(eB,ey));}return ew;}function bL(ev){return bA(ev,ev.selectedKeys);}function bA(ey,ex){var ev=[];if(ex.length==0){return ev;}for(var ew=0;ew<ex.length;ew++){ev.push(cD(ey,ex[ew]));}return ev;}function bl(ew){var ev=ew.map(function(ex){return aW(ex);});return ev;}function eb(eA){if(eA.length==0){return bl(eA);}var ez=eA[0].time;var ew=eA[eA.length-1].time;var ev=[];for(var ey=eA.length-1;ey>=0;ey--){var ex=aW(eA[ey]);ex.time=ew-(ex.time-ez);ex=c4(ex);ev.push(ex);}return ev;}function cB(ey,ew,ex){ex=ex||{};if(!(ey instanceof Array)){throw new Error("keyframeRegionShift: keyRegion must be an array but is "+ey);}var ev=(ex.overwriteOriginal==true)?ey:bl(ey);ev=ev.map(function(ez){ez.time+=ew;return ez;});return ev;}function bZ(eB,ey){if(!(eB instanceof Array)){throw new Error("keyframeRegionTimeStretch: keyRegion must be an array but is "+eB);}var ev=bl(eB);if(eB.length<=1){return ev;}var eA=eB[0].time;var ex=eB[eB.length-1].time;var ez=ex-eA;var ew=ey/ez;ev=ev.map(function(eC){eC.time=eA+(eC.time-eA)*ew;return eC;});return ev;}function cS(ez,eB,ev,eC){eC=eC||{};var eD=bl(ez);var eA=bl(ez);var ey=eC.pingpong?eb(ez):eA;for(var ex=1;ex<eB;ex++){var ew=(ex%2==0)?eA:ey;eD=b(eD,ew,ev);}return eD;}function b(eB,eA,eC){eC=eC||0;if(eC<0){throw new b9("keyframeRegionAppend: distance may not be negative");}if(eB.length==0){return bl(eA);}if(eA.length==0){return bl(eB);}var ex=bl(eB);var ey=ex.pop();var ew=ey.time-eA[0].time+eC;var ev=cB(eA,ew);var ez=ev.shift();ex.appendArray(dU(ey,ez));ex.appendArray(ev);return ex;}function dU(ew,ev){if(!ci(ew,ev)){if(ew.time>ev.time){throw new b9("mergeKeyframesIfNecessaryAndPossible: keyA.time must be less or equal to keyB.time");}return[ew,ev];}else{if(ef(ew.value,ev.value)){var ex=aW(ew);dO(ex,ev,false);return[ex];}else{var ey=1/(25*100);ev.time=ew.time+ey;return[ew,ev];}}}function S(ew,ev){return ef(ew,ev);}function ci(ew,ev){return bB(ew.time,ev.time);}var aE=(function(){var eG=Math.abs,ey=Math.min,eC=Math.max,eB=Math.acos,eF=Math.sqrt,ez=Math.PI,eA={x:0,y:0,z:0};var eE=(function(){var eT=Math.abs,eR=Math.cos,eM=Math.sin,eL=Math.acos,eS=Math.atan2,eP=Math.sqrt,eK=Math.pow,eO=function(eU){return(eU<0)?-eK(-eU,1/3):eK(eU,1/3);},eJ=Math.PI,eI=2*eJ,eH=eJ/2,eQ=0.000001;var eN={Tvalues:[-0.06405689286260563,0.06405689286260563,-0.1911188674736163,0.1911188674736163,-0.3150426796961634,0.3150426796961634,-0.4337935076260451,0.4337935076260451,-0.5454214713888396,0.5454214713888396,-0.6480936519369755,0.6480936519369755,-0.7401241915785544,0.7401241915785544,-0.820001985973903,0.820001985973903,-0.8864155270044011,0.8864155270044011,-0.9382745520027328,0.9382745520027328,-0.9747285559713095,0.9747285559713095,-0.9951872199970213,0.9951872199970213],Cvalues:[0.12793819534675216,0.12793819534675216,0.1258374563468283,0.1258374563468283,0.12167047292780339,0.12167047292780339,0.1155056680537256,0.1155056680537256,0.10744427011596563,0.10744427011596563,0.09761865210411388,0.09761865210411388,0.08619016153195327,0.08619016153195327,0.0733464814110803,0.0733464814110803,0.05929858491543678,0.05929858491543678,0.04427743881741981,0.04427743881741981,0.028531388628933663,0.028531388628933663,0.0123412297999872,0.0123412297999872],arcfn:function(eV,eW){var eX=eW(eV);var eU=eX.x*eX.x+eX.y*eX.y;if(typeof eX.z!=="undefined"){eU+=eX.z*eX.z;}return eP(eU);},between:function(eV,eU,eW){return(eU<=eV&&eV<=eW)||eN.approximately(eV,eU)||eN.approximately(eV,eW);},approximately:function(eW,eU,eV){return eT(eW-eU)<=(eV||eQ);},length:function(eY){var eZ=0.5,eX=0,eU=eN.Tvalues.length,eW,eV;for(eW=0;eW<eU;eW++){eV=eZ*eN.Tvalues[eW]+eZ;eX+=eN.Cvalues[eW]*eN.arcfn(eV,eY);}return eZ*eX;},map:function(e2,eX,e1,eZ,eY){var eW=e1-eX,eV=eY-eZ,e0=e2-eX,eU=e0/eW;return eZ+eV*eU;},lerp:function(eV,eX,eW){var eU={x:eX.x+eV*(eW.x-eX.x),y:eX.y+eV*(eW.y-eX.y)};if(!!eX.z&&!!eW.z){eU.z=eX.z+eV*(eW.z-eX.z);}return eU;},pointToString:function(eV){var eU=eV.x+"/"+eV.y;if(typeof eV.z!=="undefined"){eU+="/"+eV.z;}return eU;},pointsToString:function(eU){return"["+eU.map(eN.pointToString).join(", ")+"]";},copy:function(eU){return JSON.parse(JSON.stringify(eU));},angle:function(eV,e0,eZ){var e2=e0.x-eV.x,eX=e0.y-eV.y,e1=eZ.x-eV.x,eW=eZ.y-eV.y,eY=e2*eW-eX*e1,e4=eP(e2*e2+eX*eX),e3=eP(e1*e1+eW*eW),eU;e2/=e4;eX/=e4;e1/=e3;eW/=e3;eU=e2*e1+eX*eW;return eS(eY,eU);},round:function(eU,eW){var eV=""+eU;var eX=eV.indexOf(".");return parseFloat(eV.substring(0,eX+1+eW));},dist:function(eX,eW){var eV=eX.x-eW.x,eU=eX.y-eW.y;return eP(eV*eV+eU*eU);},closest:function(eV,eU){var eX=eK(2,63),eW,eY;eV.forEach(function(e0,eZ){eY=eN.dist(eU,e0);if(eY<eX){eX=eY;eW=eZ;}});return{mdist:eX,mpos:eW};},abcratio:function(eV,eX){if(eX!==2&&eX!==3){return false;}if(typeof eV==="undefined"){eV=0.5;}else{if(eV===0||eV===1){return eV;}}var eU=eK(eV,eX)+eK(1-eV,eX),eW=eU-1;return eT(eW/eU);},projectionratio:function(eV,eX){if(eX!==2&&eX!==3){return false;}if(typeof eV==="undefined"){eV=0.5;}else{if(eV===0||eV===1){return eV;}}var eW=eK(1-eV,eX),eU=eK(eV,eX)+eW;return eW/eU;},lli8:function(eW,e3,eV,e2,eU,e1,e4,e0){var eY=(eW*e2-e3*eV)*(eU-e4)-(eW-eV)*(eU*e0-e1*e4),eX=(eW*e2-e3*eV)*(e1-e0)-(e3-e2)*(eU*e0-e1*e4),eZ=(eW-eV)*(e1-e0)-(e3-e2)*(eU-e4);if(eZ==0){return false;}return{x:eY/eZ,y:eX/eZ};},lli4:function(e4,e3,e2,e0){var eW=e4.x,e1=e4.y,eV=e3.x,eZ=e3.y,eU=e2.x,eY=e2.y,e5=e0.x,eX=e0.y;return eN.lli8(eW,e1,eV,eZ,eU,eY,e5,eX);},lli:function(eV,eU){return eN.lli4(eV,eV.c,eU,eU.c);},makeline:function(e1,e0){var eX=e1.x,eZ=e1.y,eW=e0.x,eY=e0.y,eV=(eW-eX)/3,eU=(eY-eZ)/3;return new ev(eX,eZ,eX+eV,eZ+eU,eX+2*eV,eZ+2*eU,eW,eY);},findbbox:function(eY){var eW=99999999,eU=eW,eX=-eW,eV=eX;eY.forEach(function(eZ){var e0=eZ.bbox();if(eW>e0.x.min){eW=e0.x.min;}if(eU>e0.y.min){eU=e0.y.min;}if(eX<e0.x.max){eX=e0.x.max;}if(eV<e0.y.max){eV=e0.y.max;}});return{x:{min:eW,mid:(eW+eX)/2,max:eX,size:eX-eW},y:{min:eU,mid:(eU+eV)/2,max:eV,size:eV-eU}};},shapeintersections:function(eY,e0,eX,eZ,eW){if(!eN.bboxoverlap(e0,eZ)){return[];}var e1=[];var eV=[eY.startcap,eY.forward,eY.back,eY.endcap];var eU=[eX.startcap,eX.forward,eX.back,eX.endcap];eV.forEach(function(e2){if(e2.virtual){return;}eU.forEach(function(e3){if(e3.virtual){return;}var e4=e2.intersects(e3,eW);if(e4.length>0){e4.c1=e2;e4.c2=e3;e4.s1=eY;e4.s2=eX;e1.push(e4);}});});return e1;},makeshape:function(eY,eX,eV){var e1=eX.points.length;var eZ=eY.points.length;var eU=eN.makeline(eX.points[e1-1],eY.points[0]);var eW=eN.makeline(eY.points[eZ-1],eX.points[0]);var e0={startcap:eU,forward:eY,back:eX,endcap:eW,bbox:eN.findbbox([eU,eY,eX,eW])};var e2=eN;e0.intersections=function(e3){return e2.shapeintersections(e0,e0.bbox,e3,e3.bbox,eV);};return e0;},getminmax:function(eU,eZ,eY){if(!eY){return{min:0,max:0};}var eV=18446744073709552000,e1=-eV,e2,e0;if(eY.indexOf(0)===-1){eY=[0].concat(eY);}if(eY.indexOf(1)===-1){eY.push(1);}for(var eW=0,eX=eY.length;eW<eX;eW++){e2=eY[eW];e0=eU.get(e2);if(e0[eZ]<eV){eV=e0[eZ];}if(e0[eZ]>e1){e1=e0[eZ];}}return{min:eV,mid:(eV+e1)/2,max:e1,size:e1-eV};},align:function(eY,eX){var eW=eX.p1.x,eU=eX.p1.y,eV=-eS(eX.p2.y-eU,eX.p2.x-eW),eZ=function(e0){return{x:(e0.x-eW)*eR(eV)-(e0.y-eU)*eM(eV),y:(e0.x-eW)*eM(eV)+(e0.y-eU)*eR(eV)};};return eY.map(eZ);},roots:function(fg,e8){e8=e8||{p1:{x:0,y:0},p2:{x:1,y:0}};var fe=fg.length-1;var fd=eN.align(fg,e8);var e9=function(fs){return 0<=fs&&fs<=1;};if(fe===2){var fq=fd[0].y,fp=fd[1].y,fo=fd[2].y,fm=fq-2*fp+fo;if(fm!==0){var eZ=-eP(fp*fp-fq*fo),eX=-fq+fp,e3=-(eZ+eX)/fm,e1=-(-eZ+eX)/fm;return[e3,e1].filter(e9);}else{if(fp!==fo&&fm===0){return[(2*fp-fo)/2*(fp-fo)].filter(e9);}}return[];}var e0=fd[0].y,eY=fd[1].y,eV=fd[2].y,fr=fd[3].y,fm=(-e0+3*eY-3*eV+fr),fq=(3*e0-6*eY+3*eV)/fm,fp=(-3*e0+3*eY)/fm,fo=e0/fm,fd=(3*fp-fq*fq)/3,eW=fd/3,fc=(2*fq*fq*fq-9*fq*fp+27*fo)/27,e5=fc/2,fn=e5*e5+eW*eW*eW,fi,e3,fj,fh,ff;if(fn<0){var e4=-fd/3,e7=e4*e4*e4,fb=eP(e7),fa=-fc/(2*fb),fk=fa<-1?-1:fa>1?1:fa,e2=eL(fk),fl=eO(fb),e6=2*fl;fj=e6*eR(e2/3)-fq/3;fh=e6*eR((e2+eI)/3)-fq/3;ff=e6*eR((e2+2*eI)/3)-fq/3;return[fj,fh,ff].filter(e9);}else{if(fn===0){fi=e5<0?eO(-e5):-eO(e5);fj=2*fi-fq/3;fh=-fi-fq/3;return[fj,fh].filter(e9);}else{var eU=eP(fn);fi=eO(-e5+eU);e3=eO(e5+eU);return[fi-e3-fq/3].filter(e9);}}},droots:function(eU){if(eU.length===3){var eZ=eU[0],eX=eU[1],eW=eU[2],eV=eZ-2*eX+eW;if(eV!==0){var e2=-eP(eX*eX-eZ*eW),e1=-eZ+eX,e0=-(e2+e1)/eV,eY=-(-e2+e1)/eV;return[e0,eY];}else{if(eX!==eW&&eV===0){return[(2*eX-eW)/(2*(eX-eW))];}}return[];}if(eU.length===2){var eZ=eU[0],eX=eU[1];if(eZ!==eX){return[eZ/(eZ-eX)];}return[];}},inflections:function(e4){if(e4.length<4){return[];}var eV=eN.align(e4,{p1:e4[0],p2:e4.slice(-1)[0]}),e1=eV[2].x*eV[1].y,eZ=eV[3].x*eV[1].y,eX=eV[1].x*eV[2].y,eW=eV[3].x*eV[2].y,e3=18*(-3*e1+2*eZ+3*eX-eW),e0=18*(3*e1-eZ-3*eX),eY=18*(eX-e1);if(eN.approximately(e3,0)){return[];}var e2=e0*e0-4*e3*eY,eU=Math.sqrt(e2),eW=2*e3;if(eN.approximately(eW,0)){return[];}return[(eU-e0)/eW,-(e0+eU)/eW].filter(function(e5){return(0<=e5&&e5<=1);});},bboxoverlap:function(e0,eZ){var e1=["x","y"],eX=e1.length,eV,eW,eU,e2,eY;for(eV=0;eV<eX;eV++){eW=e1[eV];eU=e0[eW].mid;e2=eZ[eW].mid;eY=(e0[eW].size+eZ[eW].size)/2;if(eT(eU-e2)>=eY){return false;}}return true;},expandbox:function(eV,eU){if(eU.x.min<eV.x.min){eV.x.min=eU.x.min;}if(eU.y.min<eV.y.min){eV.y.min=eU.y.min;}if(eU.z&&eU.z.min<eV.z.min){eV.z.min=eU.z.min;}if(eU.x.max>eV.x.max){eV.x.max=eU.x.max;}if(eU.y.max>eV.y.max){eV.y.max=eU.y.max;}if(eU.z&&eU.z.max>eV.z.max){eV.z.max=eU.z.max;}eV.x.mid=(eV.x.min+eV.x.max)/2;eV.y.mid=(eV.y.min+eV.y.max)/2;if(eV.z){eV.z.mid=(eV.z.min+eV.z.max)/2;}eV.x.size=eV.x.max-eV.x.min;eV.y.size=eV.y.max-eV.y.min;if(eV.z){eV.z.size=eV.z.max-eV.z.min;}},pairiteration:function(e0,eY,eW){var eX=e0.bbox(),e2=eY.bbox(),eU=100000,e1=eW||0.5;if(eX.x.size+eX.y.size<e1&&e2.x.size+e2.y.size<e1){return[((eU*(e0._t1+e0._t2)/2)|0)/eU+"/"+((eU*(eY._t1+eY._t2)/2)|0)/eU];}var e4=e0.split(0.5),e3=eY.split(0.5),eV=[{left:e4.left,right:e3.left},{left:e4.left,right:e3.right},{left:e4.right,right:e3.right},{left:e4.right,right:e3.left}];eV=eV.filter(function(e5){return eN.bboxoverlap(e5.left.bbox(),e5.right.bbox());});var eZ=[];if(eV.length===0){return eZ;}eV.forEach(function(e5){eZ=eZ.concat(eN.pairiteration(e5.left,e5.right,e1));});eZ=eZ.filter(function(e5,e6){return eZ.indexOf(e5)===e6;});return eZ;},getccenter:function(eW,eV,eU){var e0=(eV.x-eW.x),e8=(eV.y-eW.y),eY=(eU.x-eV.x),e5=(eU.y-eV.y);var fc=e0*eR(eH)-e8*eM(eH),e1=e0*eM(eH)+e8*eR(eH),fg=eY*eR(eH)-e5*eM(eH),e7=eY*eM(eH)+e5*eR(eH);var eZ=(eW.x+eV.x)/2,e6=(eW.y+eV.y)/2,eX=(eV.x+eU.x)/2,e4=(eV.y+eU.y)/2;var fh=eZ+fc,e9=e6+e1,e2=eX+fg,ff=e4+e7;var e3=eN.lli8(eZ,e6,fh,e9,eX,e4,e2,ff),fb=eN.dist(e3,eW),fa=eS(eW.y-e3.y,eW.x-e3.x),fd=eS(eV.y-e3.y,eV.x-e3.x),fe=eS(eU.y-e3.y,eU.x-e3.x),fi;if(fa<fe){if(fa>fd||fd>fe){fa+=eI;}if(fa>fe){fi=fe;fe=fa;fa=fi;}}else{if(fe<fd&&fd<fa){fi=fe;fe=fa;fa=fi;}else{fe+=eI;}}e3.s=fa;e3.e=fe;e3.r=fb;return e3;}};return eN;}());var ex=(function(){var eH=function(eI){this.curves=[];this._3d=false;if(eI){this.curves=eI;this._3d=this.curves[0]._3d;}};eH.prototype={valueOf:function(){return this.toString();},toString:function(){return eE.pointsToString(this.points);},addCurve:function(eI){this.curves.push(eI);this._3d=this._3d||eI._3d;},length:function(){return this.curves.map(function(eI){return eI.length();}).reduce(function(eJ,eI){return eJ+eI;});},curve:function(eI){return this.curves[eI];},bbox:function(){var eK=this.curves;var eJ=eK[0].bbox();for(var eI=1;eI<eK.length;eI++){eE.expandbox(eJ,eK[eI].bbox());}return eJ;},offset:function(eJ){var eI=[];this.curves.forEach(function(eK){eI=eI.concat(eK.offset(eJ));});return new eH(eI);}};return eH;}());var ev=function(eM){var eL=(eM&&eM.forEach)?eM:[].slice.call(arguments);var eS=false;if(typeof eL[0]==="object"){eS=eL.length;var eR=[];eL.forEach(function(eT){["x","y","z"].forEach(function(eU){if(typeof eT[eU]!=="undefined"){eR.push(eT[eU]);}});});eL=eR;}var eI=false;var eK=eL.length;if(eS){if(eS>4){if(arguments.length!==1){throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");}eI=true;}}else{if(eK!==6&&eK!==8&&eK!==9&&eK!==12){if(arguments.length!==1){throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");}}}var eJ=(!eI&&(eK===9||eK===12))||(eM&&eM[0]&&typeof eM[0].z!=="undefined");this._3d=eJ;var eQ=[];for(var eP=0,eH=(eJ?3:2);eP<eK;eP+=eH){var eO={x:eL[eP],y:eL[eP+1]};if(eJ){eO.z=eL[eP+2];}eQ.push(eO);}this.order=eQ.length-1;this.points=eQ;var eN=["x","y"];if(eJ){eN.push("z");}this.dims=eN;this.dimlen=eN.length;(function(eX){var eT=eX.order;var eW=eX.points;var eU=eE.align(eW,{p1:eW[0],p2:eW[eT]});for(var eV=0;eV<eU.length;eV++){if(eG(eU[eV].y)>0.0001){eX._linear=false;return;}}eX._linear=true;}(this));this._t1=0;this._t2=1;this.update();};ev.fromSVG=function(eH){var eJ=eH.match(/[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?/g).map(parseFloat);var eI=/[cq]/.test(eH);if(!eI){return new ev(eJ);}eJ=eJ.map(function(eK,eL){return eL<2?eK:eK+eJ[eL%2];});return new ev(eJ);};function eD(eK,eL,eI,eQ,eO){if(typeof eO==="undefined"){eO=0.5;}var eN=eE.projectionratio(eO,eK),eM=1-eN,eH={x:eN*eL.x+eM*eQ.x,y:eN*eL.y+eM*eQ.y},eP=eE.abcratio(eO,eK),eJ={x:eI.x+(eI.x-eH.x)/eP,y:eI.y+(eI.y-eH.y)/eP};return{A:eJ,B:eI,C:eH};}ev.quadraticFromPoints=function(eL,eK,eJ,eH){if(typeof eH==="undefined"){eH=0.5;}if(eH===0){return new ev(eK,eK,eJ);}if(eH===1){return new ev(eL,eK,eK);}var eI=eD(2,eL,eK,eJ,eH);return new ev(eL,eI.A,eJ);};ev.cubicFromPoints=function(eM,eV,eT,eU,e3){if(typeof eU==="undefined"){eU=0.5;}var eY=eD(3,eM,eV,eT,eU);if(typeof e3==="undefined"){e3=eE.dist(eV,eY.C);}var eZ=e3*(1-eU)/eU;var eX=eE.dist(eM,eT),eL=(eT.x-eM.x)/eX,eK=(eT.y-eM.y)/eX,eH=e3*eL,eQ=e3*eK,e0=eZ*eL,eP=eZ*eK;var eO={x:eV.x-eH,y:eV.y-eQ},eN={x:eV.x+e0,y:eV.y+eP},eW=eY.A,eJ={x:eW.x+(eO.x-eW.x)/(1-eU),y:eW.y+(eO.y-eW.y)/(1-eU)},eI={x:eW.x+(eN.x-eW.x)/(eU),y:eW.y+(eN.y-eW.y)/(eU)},eS={x:eM.x+(eJ.x-eM.x)/(eU),y:eM.y+(eJ.y-eM.y)/(eU)},eR={x:eT.x+(eI.x-eT.x)/(1-eU),y:eT.y+(eI.y-eT.y)/(1-eU)};return new ev(eM,eS,eR,eT);};var ew=function(){return eE;};ev.getUtils=ew;ev.prototype={getUtils:ew,valueOf:function(){return this.toString();},toString:function(){return eE.pointsToString(this.points);},toSVG:function(eL){if(this._3d){return false;}var eM=this.points,eH=eM[0].x,eN=eM[0].y,eJ=["M",eH,eN,(this.order===2?"Q":"C")];for(var eI=1,eK=eM.length;eI<eK;eI++){eJ.push(eM[eI].x);eJ.push(eM[eI].y);}return eJ.join(" ");},update:function(){this.dpoints=[];for(var eK=this.points,eL=eK.length,eM=eL-1;eL>1;eL--,eM--){var eJ=[];for(var eH=0,eI;eH<eM;eH++){eI={x:eM*(eK[eH+1].x-eK[eH].x),y:eM*(eK[eH+1].y-eK[eH].y)};if(this._3d){eI.z=eM*(eK[eH+1].z-eK[eH].z);}eJ.push(eI);}this.dpoints.push(eJ);eK=eJ;}this.computedirection();},computedirection:function(){var eH=this.points;var eI=eE.angle(eH[0],eH[this.order],eH[1]);this.clockwise=eI>0;},length:function(){return eE.length(this.derivative.bind(this));},_lut:[],getLUT:function(eH){eH=eH||100;if(this._lut.length===eH){return this._lut;}this._lut=[];for(var eI=0;eI<=eH;eI++){this._lut.push(this.compute(eI/eH));}return this._lut;},on:function(eI,eJ){eJ=eJ||5;var eM=this.getLUT(),eH=[],eN,eL=0;for(var eK=0;eK<eM.length;eK++){eN=eM[eK];if(eE.dist(eN,eI)<eJ){eH.push(eN);eL+=eK/eM.length;}}if(!eH.length){return false;}return eL/=eH.length;},project:function(eS){var eM=this.getLUT(),eN=eM.length-1,eI=eE.closest(eM,eS),eK=eI.mdist,eL=eI.mpos;if(eL===0||eL===eN){var eT=eL/eN,eU=this.compute(eT);eU.t=eT;eU.d=eK;return eU;}var eP,eT,eH,eR,eQ=(eL-1)/eN,eO=(eL+1)/eN,eJ=0.1/eN;eK+=1;for(eT=eQ,eP=eT;eT<eO+eJ;eT+=eJ){eH=this.compute(eT);eR=eE.dist(eS,eH);if(eR<eK){eK=eR;eP=eT;}}eH=this.compute(eP);eH.t=eP;eH.d=eK;return eH;},get:function(eH){return this.compute(eH);},point:function(eH){return this.points[eH];},compute:function(eS){if(eS===0){return this.points[0];}if(eS===1){return this.points[this.order];}var eI=this.points;var eH=1-eS;if(this.order===1){eM={x:eH*eI[0].x+eS*eI[1].x,y:eH*eI[0].y+eS*eI[1].y};if(this._3d){eM.z=eH*eI[0].z+eS*eI[1].z;}return eM;}if(this.order<4){var eJ=eH*eH,eL=eS*eS,eQ,eP,eO,eN=0;if(this.order===2){eI=[eI[0],eI[1],eI[2],eA];eQ=eJ;eP=eH*eS*2;eO=eL;}else{if(this.order===3){eQ=eJ*eH;eP=eJ*eS*3;eO=eH*eL*3;eN=eS*eL;}}var eM={x:eQ*eI[0].x+eP*eI[1].x+eO*eI[2].x+eN*eI[3].x,y:eQ*eI[0].y+eP*eI[1].y+eO*eI[2].y+eN*eI[3].y};if(this._3d){eM.z=eQ*eI[0].z+eP*eI[1].z+eO*eI[2].z+eN*eI[3].z;}return eM;}var eR=JSON.parse(JSON.stringify(this.points));while(eR.length>1){for(var eK=0;eK<eR.length-1;eK++){eR[eK]={x:eR[eK].x+(eR[eK+1].x-eR[eK].x)*eS,y:eR[eK].y+(eR[eK+1].y-eR[eK].y)*eS};if(typeof eR[eK].z!=="undefined"){eR[eK]=eR[eK].z+(eR[eK+1].z-eR[eK].z)*eS;}}eR.splice(eR.length-1,1);}return eR[0];},raise:function(){var eM=this.points,eL=[eM[0]],eJ,eH=eM.length,eK,eI;for(var eJ=1;eJ<eH;eJ++){eK=eM[eJ];eI=eM[eJ-1];eL[eJ]={x:(eH-eJ)/eH*eK.x+eJ/eH*eI.x,y:(eH-eJ)/eH*eK.y+eJ/eH*eI.y};}eL[eH]=eM[eH-1];return new ev(eL);},derivative:function(eL){var eJ=1-eL,eI,eH,eN=0,eM=this.dpoints[0];if(this.order===2){eM=[eM[0],eM[1],eA];eI=eJ;eH=eL;}if(this.order===3){eI=eJ*eJ;eH=eJ*eL*2;eN=eL*eL;}var eK={x:eI*eM[0].x+eH*eM[1].x+eN*eM[2].x,y:eI*eM[0].y+eH*eM[1].y+eN*eM[2].y};if(this._3d){eK.z=eI*eM[0].z+eH*eM[1].z+eN*eM[2].z;}return eK;},inflections:function(){return eE.inflections(this.points);},normal:function(eH){return this._3d?this.__normal3(eH):this.__normal2(eH);},__normal2:function(eH){var eJ=this.derivative(eH);var eI=eF(eJ.x*eJ.x+eJ.y*eJ.y);return{x:-eJ.y/eI,y:eJ.x/eI};},__normal3:function(eP){var eJ=this.derivative(eP),eH=this.derivative(eP+0.01),eN=eF(eJ.x*eJ.x+eJ.y*eJ.y+eJ.z*eJ.z),eM=eF(eH.x*eH.x+eH.y*eH.y+eH.z*eH.z);eJ.x/=eN;eJ.y/=eN;eJ.z/=eN;eH.x/=eM;eH.y/=eM;eH.z/=eM;var eO={x:eH.y*eJ.z-eH.z*eJ.y,y:eH.z*eJ.x-eH.x*eJ.z,z:eH.x*eJ.y-eH.y*eJ.x};var eK=eF(eO.x*eO.x+eO.y*eO.y+eO.z*eO.z);eO.x/=eK;eO.y/=eK;eO.z/=eK;var eL=[eO.x*eO.x,eO.x*eO.y-eO.z,eO.x*eO.z+eO.y,eO.x*eO.y+eO.z,eO.y*eO.y,eO.y*eO.z-eO.x,eO.x*eO.z-eO.y,eO.y*eO.z+eO.x,eO.z*eO.z];var eI={x:eL[0]*eJ.x+eL[1]*eJ.y+eL[2]*eJ.z,y:eL[3]*eJ.x+eL[4]*eJ.y+eL[5]*eJ.z,z:eL[6]*eJ.x+eL[7]*eJ.y+eL[8]*eJ.z};return eI;},hull:function(eL){var eO=this.points,eI=[],eN,eM=[],eH=0,eK=0,eJ=0;eM[eH++]=eO[0];eM[eH++]=eO[1];eM[eH++]=eO[2];if(this.order===3){eM[eH++]=eO[3];}while(eO.length>1){eI=[];for(eK=0,eJ=eO.length-1;eK<eJ;eK++){eN=eE.lerp(eL,eO[eK],eO[eK+1]);eM[eH++]=eN;eI.push(eN);}eO=eI;}return eM;},split:function(eJ,eI){if(eJ===0&&!!eI){return this.split(eI).left;}if(eI===1){return this.split(eJ).right;}var eK=this.hull(eJ);var eH={left:this.order===2?new ev([eK[0],eK[3],eK[5]]):new ev([eK[0],eK[4],eK[7],eK[9]]),right:this.order===2?new ev([eK[5],eK[4],eK[2]]):new ev([eK[9],eK[8],eK[6],eK[3]]),span:eK};eH.left._t1=eE.map(0,0,1,this._t1,this._t2);eH.left._t2=eE.map(eJ,0,1,this._t1,this._t2);eH.right._t1=eE.map(eJ,0,1,this._t1,this._t2);eH.right._t2=eE.map(1,0,1,this._t1,this._t2);if(!eI){return eH;}eI=eE.map(eI,eJ,1,0,1);var eL=eH.right.split(eI);return eL.left;},extrema:function(){var eL=this.dims,eH={},eI=[],eJ,eK;eL.forEach(function(eM){eK=function(eN){return eN[eM];};eJ=this.dpoints[0].map(eK);eH[eM]=eE.droots(eJ);if(this.order===3){eJ=this.dpoints[1].map(eK);eH[eM]=eH[eM].concat(eE.droots(eJ));}eH[eM]=eH[eM].filter(function(eN){return(eN>=0&&eN<=1);});eI=eI.concat(eH[eM].sort());}.bind(this));eI=eI.sort().filter(function(eN,eM){return(eI.indexOf(eN)===eM);});eH.values=eI;return eH;},bbox:function(){var eI=this.extrema(),eH={};this.dims.forEach(function(eJ){eH[eJ]=eE.getminmax(this,eJ,eI[eJ]);}.bind(this));return eH;},overlaps:function(eJ){var eI=this.bbox(),eH=eJ.bbox();return eE.bboxoverlap(eI,eH);},offset:function(eK,eM){if(typeof eM!=="undefined"){var eO=this.get(eK);var eN=this.normal(eK);var eJ={c:eO,n:eN,x:eO.x+eN.x*eM,y:eO.y+eN.y*eM};if(this._3d){eJ.z=eO.z+eN.z*eM;}return eJ;}if(this._linear){var eI=this.normal(0);var eL=this.points.map(function(eQ){var eP={x:eQ.x+eK*eI.x,y:eQ.y+eK*eI.y};if(eQ.z&&eN.z){eP.z=eQ.z+eK*eI.z;}return eP;});return[new ev(eL)];}var eH=this.reduce();return eH.map(function(eP){return eP.scale(eK);});},simple:function(){if(this.order===3){var eI=eE.angle(this.points[0],this.points[3],this.points[1]);var eH=eE.angle(this.points[0],this.points[3],this.points[2]);if(eI>0&&eH<0||eI<0&&eH>0){return false;}}var eL=this.normal(0);var eJ=this.normal(1);var eK=eL.x*eJ.x+eL.y*eJ.y;if(this._3d){eK+=eL.z*eJ.z;}var eM=eG(eB(eK));return eM<ez/3;},reduce:function(){var eJ,eN=0,eK=0,eM=0.01,eL,eI=[],eH=[];var eO=this.extrema().values;if(eO.indexOf(0)===-1){eO=[0].concat(eO);}if(eO.indexOf(1)===-1){eO.push(1);}for(eN=eO[0],eJ=1;eJ<eO.length;eJ++){eK=eO[eJ];eL=this.split(eN,eK);eL._t1=eN;eL._t2=eK;eI.push(eL);eN=eK;}eI.forEach(function(eP){eN=0;eK=0;while(eK<=1){for(eK=eN+eM;eK<=1+eM;eK+=eM){eL=eP.split(eN,eK);if(!eL.simple()){eK-=eM;if(eG(eN-eK)<eM){return[];}eL=eP.split(eN,eK);eL._t1=eE.map(eN,0,1,eP._t1,eP._t2);eL._t2=eE.map(eK,0,1,eP._t1,eP._t2);eH.push(eL);eN=eK;break;}}}if(eN<1){eL=eP.split(eN,1);eL._t1=eE.map(eN,0,1,eP._t1,eP._t2);eL._t2=eP._t2;eH.push(eL);}});return eH;},scale:function(eN){var eM=this.order;var eI=false;if(typeof eN==="function"){eI=eN;}if(eI&&eM===2){return this.raise().scale(eI);}var eH=this.clockwise;var eL=eI?eI(0):eN;var eK=eI?eI(1):eN;var eQ=[this.offset(0,10),this.offset(1,10)];var eJ=eE.lli4(eQ[0],eQ[0].c,eQ[1],eQ[1].c);if(!eJ){throw new Error("cannot scale this curve. Try reducing it first.");}var eP=this.points,eO=[];[0,1].forEach(function(eR){var eS=eO[eR*eM]=eE.copy(eP[eR*eM]);eS.x+=(eR?eK:eL)*eQ[eR].n.x;eS.y+=(eR?eK:eL)*eQ[eR].n.y;}.bind(this));if(!eI){[0,1].forEach(function(eR){if(this.order===2&&!!eR){return;}var eT=eO[eR*eM];var eU=this.derivative(eR);var eS={x:eT.x+eU.x,y:eT.y+eU.y};eO[eR+1]=eE.lli4(eT,eS,eJ,eP[eR+1]);}.bind(this));return new ev(eO);}[0,1].forEach(function(eT){if(this.order===2&&!!eT){return;}var eV=eP[eT+1];var eS={x:eV.x-eJ.x,y:eV.y-eJ.y};var eU=eI?eI((eT+1)/eM):eN;if(eI&&!eH){eU=-eU;}var eR=eF(eS.x*eS.x+eS.y*eS.y);eS.x/=eR;eS.y/=eR;eO[eT+1]={x:eV.x+eU*eS.x,y:eV.y+eU*eS.y};}.bind(this));return new ev(eO);},outline:function(e1,e0,eY,eX){e0=(typeof e0==="undefined")?e1:e0;var eR=this.reduce(),eT=eR.length,eU=[],eI=[],eQ,eK=0,eH=this.length();var eZ=(typeof eY!=="undefined"&&typeof eX!=="undefined");function eM(e3,e6,e2,e4,e5){return function(e8){var e7=e4/e2,fa=(e4+e5)/e2,e9=e6-e3;return eE.map(e8,0,1,e3+e7*e9,e3+fa*e9);};}eR.forEach(function(e2){eV=e2.length();if(eZ){eU.push(e2.scale(eM(e1,eY,eH,eK,eV)));eI.push(e2.scale(eM(-e0,-eX,eH,eK,eV)));}else{eU.push(e2.scale(e1));eI.push(e2.scale(-e0));}eK+=eV;});eI=eI.map(function(e2){eQ=e2.points;if(eQ[3]){e2.points=[eQ[3],eQ[2],eQ[1],eQ[0]];}else{e2.points=[eQ[2],eQ[1],eQ[0]];}return e2;}).reverse();var eL=eU[0].points[0],eO=eU[eT-1].points[eU[eT-1].points.length-1],eW=eI[eT-1].points[eI[eT-1].points.length-1],eJ=eI[0].points[0],eN=eE.makeline(eW,eL),eP=eE.makeline(eO,eJ),eS=[eN].concat(eU).concat([eP]).concat(eI),eV=eS.length;return new ex(eS);},outlineshapes:function(eO,eN,eK){eN=eN||eO;var eM=this.outline(eO,eN).curves;var eI=[];for(var eL=1,eH=eM.length;eL<eH/2;eL++){var eJ=eE.makeshape(eM[eL],eM[eH-eL],eK);eJ.startcap.virtual=(eL>1);eJ.endcap.virtual=(eL<eH/2-1);eI.push(eJ);}return eI;},intersects:function(eI,eH){if(!eI){return this.selfintersects(eH);}if(eI.p1&&eI.p2){return this.lineIntersects(eI);}if(eI instanceof ev){eI=eI.reduce();}return this.curveintersects(this.reduce(),eI,eH);},lineIntersects:function(eH){var eL=ey(eH.p1.x,eH.p2.x),eJ=ey(eH.p1.y,eH.p2.y),eM=eC(eH.p1.x,eH.p2.x),eK=eC(eH.p1.y,eH.p2.y),eI=this;return eE.roots(this.points,eH).filter(function(eN){var eO=eI.get(eN);return eE.between(eO.x,eL,eM)&&eE.between(eO.y,eJ,eK);});},infiniteLineIntersects:function(eH){self=this;return eE.roots(this.points,eH);},selfintersects:function(eK){var eJ=this.reduce();var eN,eI=eJ.length-2,eM=[],eH,eO,eL;for(eN=0;eN<eI;eN++){eO=eJ.slice(eN,eN+1);eL=eJ.slice(eN+2);eH=this.curveintersects(eO,eL,eK);eM=eM.concat(eH);}return eM;},curveintersects:function(eJ,eI,eH){var eK=[];eJ.forEach(function(eM){eI.forEach(function(eN){if(eM.overlaps(eN)){eK.push({left:eM,right:eN});}});});var eL=[];eK.forEach(function(eN){var eM=eE.pairiteration(eN.left,eN.right,eH);if(eM.length>0){eL=eL.concat(eM);}});return eL;},arcs:function(eH){eH=eH||0.5;var eI=[];return this._iterate(eH,eI);},_error:function(eO,eP,eQ,eN){var eJ=(eN-eQ)/4,eM=this.get(eQ+eJ),eL=this.get(eN-eJ),eK=eE.dist(eO,eP),eI=eE.dist(eO,eM),eH=eE.dist(eO,eL);return eG(eI-eK)+eG(eH-eK);},_iterate:function(eO,eL){var eW=0,eN=1,eM;do{eM=0;eN=1;var eU=this.get(eW),eS,eR,eH,eT;var eQ=false,eV=false,eK;var eI=eN,eJ=1;do{eV=eQ;eT=eH;eI=(eW+eN)/2;eS=this.get(eI);eR=this.get(eN);eH=eE.getccenter(eU,eS,eR);var eP=this._error(eH,eU,eW,eN);eQ=(eP<=eO);eK=eV&&!eQ;if(!eK){eJ=eN;}if(eQ){if(eN>=1){eJ=1;eT=eH;break;}eN=eN+(eN-eW)/2;}else{eN=eI;}}while(!eK&&eM++<100);if(eM>=100){console.error("arc abstraction somehow failed...");break;}eT=(eT?eT:eH);eL.push(eT);eW=eJ;}while(eN<1);return eL;}};return ev;}());if(!Function.prototype.bind){Function.prototype.bind=function(ev){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");}var ez=Array.prototype.slice.call(arguments,1),ey=this,ew=function(){},ex=function(){return ey.apply(this instanceof ew?this:ev,ez.concat(Array.prototype.slice.call(arguments)));};if(this.prototype){ew.prototype=this.prototype;}ex.prototype=new ew();return ex;};}if(!Array.prototype.forEach){Array.prototype.forEach=function(eB,ew){var ey,ex;if(this==null){throw new TypeError(" this is null or not defined");}var eA=Object(this);var ev=eA.length>>>0;if(typeof eB!=="function"){throw new TypeError(eB+" is not a function");}if(arguments.length>1){ey=ew;}ex=0;while(ex<ev){var ez;if(ex in eA){ez=eA[ex];eB.call(ey,ez,ex,eA);}ex++;}};}if(!String.prototype.endsWith){String.prototype.endsWith=function(ex,ew){var ev=this.toString();if(typeof ew!=="number"||!isFinite(ew)||Math.floor(ew)!==ew||ew>ev.length){ew=ev.length;}ew-=ex.length;var ey=ev.indexOf(ex,ew);return ey!==-1&&ey===ew;};}if(!Array.prototype.some){Array.prototype.some=function(ex){if(this==null){throw new TypeError("Array.prototype.some called on null or undefined");}if(typeof ex!=="function"){throw new TypeError();}var ez=Object(this);var ev=ez.length>>>0;var ew=arguments.length>=2?arguments[1]:void 0;for(var ey=0;ey<ev;ey++){if(ey in ez&&ex.call(ew,ez[ey],ey,ez)){return true;}}return false;};}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(ex,ey){var ew;if(this==null){throw new TypeError('"this" is null or not defined');}var ez=Object(this);var ev=ez.length>>>0;if(ev===0){return -1;}var eA=+ey||0;if(Math.abs(eA)===Infinity){eA=0;}if(eA>=ev){return -1;}ew=Math.max(eA>=0?eA:ev-Math.abs(eA),0);while(ew<ev){if(ew in ez&&ez[ew]===ex){return ew;}ew++;}return -1;};}if("function"!==typeof Array.prototype.reduceRight){Array.prototype.reduceRight=function(ez){if(null===this||"undefined"===typeof this){throw new TypeError("Array.prototype.reduce called on null or undefined");}if("function"!==typeof ez){throw new TypeError(ez+" is not a function");}var ex=Object(this),ev=ex.length>>>0,ew=ev-1,ey;if(arguments.length>=2){ey=arguments[1];}else{while(ew>=0&&!(ew in ex)){ew--;}if(ew<0){throw new TypeError("Reduce of empty array with no initial value");}ey=ex[ew--];}for(;ew>=0;ew--){if(ew in ex){ey=ez(ey,ex[ew],ew,ex);}}return ey;};}function bz(ev){var eA=[];for(var ew=0;ew<ev.vertices.length-1;ew++){var eB=ev.vertices[ew];var ex=ev.vertices[ew+1];var ez=ev.outTangents[ew]+eB;var ey=ev.inTangents[ew+1]+ex;eA.push(new aE(eB[0],eB[1],ez[0],ez[1],ey[0],ey[1],ex[0],ex[1]));}if(ev.closed){var eC=ev.vertices.length-1;var eB=ev.vertices[eC];var ex=ev.vertices[0];var ez=ev.outTangents[eC]+eB;var ey=ev.inTangents[0]+ex;eA.push(new aE(eB[0],eB[1],ez[0],ez[1],ey[0],ey[1],ex[0],ex[1]));}return eA;}var dk=(function(){var eD=4;var eE=0.001;var eF=1e-7;var ez=10;var eJ=11;var eH=1/(eJ-1);var ex=typeof Float32Array==="function";function eA(eL,eM){return 1-3*eM+3*eL;}function ew(eL,eM){return 3*eM-6*eL;}function ev(eL){return 3*eL;}function eC(eN,eL,eM){return((eA(eL,eM)*eN+ew(eL,eM))*eN+ev(eL))*eN;}function ey(eN,eL,eM){return 3*eA(eL,eM)*eN*eN+2*ew(eL,eM)*eN+ev(eL);}function eG(eP,eQ,eO,eS,eR){var eL,eN,eM=0;do{eN=eQ+(eO-eQ)/2;eL=eC(eN,eS,eR)-eP;if(eL>0){eO=eN;}else{eQ=eN;}}while(Math.abs(eL)>eF&&++eM<ez);return eN;}function eK(eO,eM,eR,eP){for(var eN=0;eN<eD;++eN){var eQ=ey(eM,eR,eP);if(eQ===0){return eM;}var eL=eC(eM,eR,eP)-eO;eM-=eL/eQ;}return eM;}var eI=function eB(eQ,eM,eP,eS){if(!(0<=eQ&&eQ<=1&&0<=eP&&eP<=1)){throw new Error("bezier x values must be in [0, 1] range");}var eR=ex?new Float32Array(eJ):new Array(eJ);if(eQ!==eM||eP!==eS){for(var eO=0;eO<eJ;++eO){eR[eO]=eC(eO*eH,eQ,eP);}}function eL(eX){var eY=0;var eW=1;var eT=eJ-1;for(;eW!==eT&&eR[eW]<=eX;++eW){eY+=eH;}--eW;var eZ=(eX-eR[eW])/(eR[eW+1]-eR[eW]);var eV=eY+eZ*eH;var eU=ey(eV,eQ,eP);if(eU>=eE){return eK(eX,eV,eQ,eP);}else{if(eU===0){return eV;}else{return eG(eX,eY,eY+eH,eQ,eP);}}}return function eN(eT){if(eQ===eM&&eP===eS){return eT;}if(eT===0){return 0;}if(eT===1){return 1;}return eC(eL(eT),eM,eS);};};return eI;}());var cV=(function(){function ez(eK,eH){var eL=eK.speed;var eG=eH.speed;var eM=eK.influence;var eF=eH.influence;var eO=eM/100;var eJ=eL*eO;var eN=(-0.01*eF)+1;var eI=(eG*(eN-1))+1;return[eO,eJ,eN,eI];}function ew(eH,eF){var eG=ez(eF,eH);var eJ=dk(eG[0],eG[1],eG[2],eG[3]);var eI=function(eM,eL,eK){return eA(eM,eL,eJ(eK));};return eI;}function eC(eF){return eF;}function ev(eG,eF){return eF;}function eA(eH,eG,eF){return eH+(eG-eH)*eF;}function eB(eI,eH,eG,eF){if(eI==KeyframeInterpolationType.HOLD){return eC;}else{if(eH==KeyframeInterpolationType.HOLD){return ev;}else{if(eI==KeyframeInterpolationType.LINEAR&&eH==KeyframeInterpolationType.LINEAR){return eA;}else{return ew(eG,eF);}}}}function ex(eI,eJ){var eG;var eH=0;var eF=eI.length-1;while(eF-eH>1){eG=Math.floor((eH+eF)/2);if(eI[eG].time<eJ){eH=eG;}else{eF=eG;}}if(eJ>=eI[eF].time){return[eI[eF]];}else{if(eJ<=eI[eH].time){return[eI[eH]];}else{return[eI[eH],eI[eF]];}}}function ey(eH,eG){if(!eH.isSpatial){throw"bezierCurveFromSpatialKeys: keys must be spatial";}var eF;if(eH.value.length==2){eF=new aE(eH.value[0],eH.value[1],eH.OutSpatialTangent[0],eH.OutSpatialTangent[1],eG.InSpatialTangent[0],eG.InSpatialTangent[1],eG.value[0],eG.value[1]);}else{eF=new aE(eH.value[0],eH.value[1],eH.value[2],eH.OutSpatialTangent[0],eH.OutSpatialTangent[1],eH.OutSpatialTangent[2],eG.InSpatialTangent[0],eG.InSpatialTangent[1],eG.InSpatialTangent[2],eG.value[0],eG.value[1],eG.value[2]);}return eF;}function eD(eK,eJ,eG){var eM;if(eK.isSpatial){eM=eB(eK.OutInterpolationType,eJ.InInterpolationType,eK.OutTemporalEase[0],eJ.InTemporalEase[0]);var eI=eM(0,1,eG);var eF=ey(eK,eJ);var eL=eF.compute(eI);return[eL.x,eL.y,0];}else{if(eK.value instanceof Array){var eN=[];for(var eH=0;eH<eK.value.length;eH++){eM=eB(eK.OutInterpolationType,eJ.InInterpolationType,eK.OutTemporalEase[eH],eJ.InTemporalEase[eH]);eN.push(eM(eK.value[eH],eJ.value[eH],eG));}return eN;}else{eM=eB(eK.OutInterpolationType,eJ.InInterpolationType,eK.OutTemporalEase[0],eJ.InTemporalEase[0]);return eM(eK.value,eJ.value,eG);}}}function eE(eH,eI){var eG=ex(eH,eI);if(eG.length==1){return eG[0].value;}else{if(eG.length==2){var eF=(eI-eG[0].time)/(eG[1].time-eG[0].time);return eD(eG[0],eG[1],eF);}}throw"keyframeRegionValueAtTime: could not find sourrounding keyframes";}return eE;})();var cJ=(function(){function ey(eA,ez){ew(["applyFill","applyStroke","font","fontSize","justification","tracking","leading"],eA,ez);if(eA.applyFill){ew(["fillColor"],eA,ez);}if(eA.applyStroke){ew(["strokeColor","strokeWidth"],eA,ez);}if(eA.applyStroke&&eA.applyFill){ew(["strokeOverFill"],eA,ez);}}function ew(eB,eC,ez){for(var eA=0;eA<eB.length;eA++){if(eC[eB[eA]]!==undefined){ez[eB[eA]]=eC[eB[eA]];}}}function ex(eA,ez){if(eA.isTextDocument!==true){throw new Error("jsonVal mut be a text doument JSON");}ez.text=eA.text;ey(eA,ez);return ez;}function ev(eA){if(!(eA instanceof TextDocument)){throw new Error("textDoc must be a TextDocument");}var ez={isTextDocument:true,text:eA.text};ey(eA,ez);return ez;}return{toJSON:ev,fromJSON:ex};})();var aj=(function(){function ex(eA,ez){ew(["closed","vertices","inTangents","outTangents","featherSegLocs","featherRelSegLocs","featherRadii","featherInterps","featherTensions","featherTypes","featherRelCornerAngles"],eA,ez);}function ew(eB,eC,ez){for(var eA=0;eA<eB.length;eA++){if(eC[eB[eA]]!==undefined){ez[eB[eA]]=eC[eB[eA]];}}}function ey(eA){var ez=new Shape();if(eA.isShape!==true){throw new Error("jsonVal mut be a Shape JSON");}ex(eA,ez);return ez;}function ev(eA){if(!(eA instanceof Shape)){throw new Error("shape must be a Shape");}var ez={isShape:true,};ex(eA,ez);return ez;}return{toJSON:ev,fromJSON:ey};})();function cD(ex,ew){var ev={};ev.value=co(ex.keyValue(ew));ev.time=ex.keyTime(ew);ev.InInterpolationType=c0(ex.keyInInterpolationType(ew));ev.OutInterpolationType=c0(ex.keyOutInterpolationType(ew));ev.InTemporalEase=ex.keyInTemporalEase(ew).map(d);ev.OutTemporalEase=ex.keyOutTemporalEase(ew).map(d);ev.TemporalContinuous=ex.keyTemporalContinuous(ew);ev.TemporalAutoBezier=ex.keyTemporalAutoBezier(ew);if(D(ex.propertyValueType)){ev.isSpatial=true;ev.Roving=ex.keyRoving(ew);ev.InSpatialTangent=ex.keyInSpatialTangent(ew);ev.OutSpatialTangent=ex.keyOutSpatialTangent(ew);ev.SpatialContinuous=ex.keySpatialContinuous(ew);ev.SpatialAutoBezier=ex.keySpatialAutoBezier(ew);}return ev;}function dZ(ew,ev){return bC(ev,ew.valueAtTime(ev,true),ew.propertyValueType);}function bC(eA,ez,ey){var ex={};ex.value=co(ez);ex.time=eA;ex.InInterpolationType=c0(KeyframeInterpolationType.HOLD);ex.OutInterpolationType=c0(KeyframeInterpolationType.HOLD);var ev=new KeyframeEase(0.5,50);var ew=[ev];if(ey==PropertyValueType.ThreeD){ew=[ev,ev,ev];}else{if(ey==PropertyValueType.TwoD){ew=[ev,ev];}}ex.InTemporalEase=ew;ex.OutTemporalEase=ew;ex.TemporalContinuous=false;ex.TemporalAutoBezier=false;if(D(ey)){ex.isSpatial=true;ex.Roving=false;ex.InSpatialTangent=ex.value.length==3?[0,0,0]:[0,0];ex.OutSpatialTangent=ex.value.length==3?[0,0,0]:[0,0];ex.SpatialContinuous=false;ex.SpatialAutoBezier=false;}return ex;}function co(ev){if(ev instanceof TextDocument){return cJ.toJSON(ev);}if(ev instanceof Shape){return aj.toJSON(ev);}else{return ev;}}function bO(ev,ew){if(ev.isTextDocument){return cJ.fromJSON(ev,ew.value);}else{if(ev.isShape){return aj.fromJSON(ev);}else{return ev;}}}function D(ev){return(ev==PropertyValueType.TwoD_SPATIAL||ev==PropertyValueType.ThreeD_SPATIAL);}function d(ew){var ev={influence:ew.influence,speed:ew.speed};return ev;}function cv(ew){var ev=ew.influence;ev=Math.min(ev,100);ev=Math.max(ev,0.1);var ex=new KeyframeEase(ew.speed,ev);return ex;}function c0(ew){for(var ev in KeyframeInterpolationType){if(KeyframeInterpolationType.hasOwnProperty(ev)){if(KeyframeInterpolationType[ev]==ew){return ev;}}}throw"invalid KeyframeInterpolationType:"+ew;}function bE(ev){return KeyframeInterpolationType[ev];}function aW(ev){return bj(ev);}function bw(ew,ev){ew.TemporalContinuous=false;ew.TemporalAutoBezier=false;if(ev){ew.OutInterpolationType=ew.InInterpolationType;ew.OutTemporalEase=ew.InTemporalEase;}else{ew.InInterpolationType=ew.OutInterpolationType;ew.InTemporalEase=ew.OutTemporalEase;}ew.Roving=false;if(ew.isSpatial){ew.SpatialContinuous=false;ew.SpatialAutoBezier=false;if(ev){ew.OutSpatialTangent=ew.InSpatialTangent;}else{ew.InSpatialTangent=ew.OutSpatialTangent;}}return ew;}function c4(ev){var ew;ew=ev.OutInterpolationType;ev.OutInterpolationType=ev.InInterpolationType;ev.InInterpolationType=ew;ew=ev.OutTemporalEase;ev.OutTemporalEase=ev.InTemporalEase;ev.InTemporalEase=ew;if(ev.isSpatial){ew=ev.OutSpatialTangent;ev.OutSpatialTangent=ev.InSpatialTangent;ev.InSpatialTangent=ew;}return ev;}function dO(ew,ev,ex){ew.TemporalContinuous=false;ew.TemporalAutoBezier=false;if(ex){ew.InInterpolationType=ev.InInterpolationType;ew.InTemporalEase=ev.InTemporalEase;}else{ew.OutInterpolationType=ev.OutInterpolationType;ew.OutTemporalEase=ev.OutTemporalEase;}if(ew.isSpatial){ew.SpatialContinuous=false;ew.SpatialAutoBezier=false;if(ex){ew.InSpatialTangent=ev.InSpatialTangent;}else{ew.OutSpatialTangent=ev.OutSpatialTangent;}}return ew;}var u=(function(){function eB(eD,eE,eC,eF){app.beginUndoGroup("stagger keyframes");H(function(){var eG=h();ev(eG,eD,eE,eC,eF);},function(){app.endUndoGroup();});}function ev(eU,eV,eO,eF,eN){var eE=eF;var eG=eU.selectedProperties;var eH=[];function eC(eX){var eZ=[];for(var eW=0;eW<eX.length;eW++){var eY=eX[eW];if(ez(eY)){eH.push(eY);}else{eZ.push(eY);}}return eZ;}var eP=ew(eC(eA(eG)));if(eP.length<2){if(eH.length>0){throw new dn("The selected keyframes have an unsupported type");}else{throw new dn("Please select keyframes on at least two layers");}}var eJ=ey(eE);if(eJ==null){return;}var eS;if(eJ=="BEATS"){eS=ao(eU,eV,eO.times,true);if(eS.length==0){throw new dn("No beats\nMake sure some beats are selected in the BeatEdit user interface");}if(eS.length==0){throw new dn("No beats\nMake sure more than one beat is selected in the BeatEdit user interface");}}else{if(eJ=="COMPMARKERS"){eS=ec(eU);if(eS.length==0){throw new dn("No comp markers.\nMake sure the active comp has some comp markers.");}if(eS.length==0){throw new dn("Only one comp marker.\nMake sure the active comp has some comp markers.");}}else{throw new Error("unknown beat source "+eJ);}}n(eS,eN);var eD=ae(eU.time,eS);var eQ=eS[eD];for(var eT=1;eT<eP.length;eT++){var eL=Math.min(eD+eT,eS.length-1);var eI=eS[eL];var eK=(eI-eQ);for(var eR=0;eR<eP[eT].length;eR++){ex(eP[eT][eR].prop,eP[eT][eR].selectedKeys,eK);}}if(eH.length>0){var eM=eH.map(M).join("\n");throw new dn("Skipped these properties due to unsupported property type:\n"+eM);}}function ez(eD){var eC=eD.propertyValueType;return(eC==PropertyValueType.NO_VALUE||eC==PropertyValueType.CUSTOM_VALUE||eC==PropertyValueType.MARKER);}function ey(eE){var eC=["Usage:","1. Select the keyframes you want to stagger (on several layers).","2. Move the current time indicator to the beat that corresponds to the beginning of the stagger.","3. Apply the stagger keyframes tool. It will keep the selected keyframes on the first selected layer in place, move the ones of the second layer by one beat, the ones of the third layer by two beats and so on."];var eD={};return aC(eC,eD,eE);}function ex(eF,eD,eC){var eE=bA(eF,eD);if(eE.length==0){return;}ee(eF,eD);em(eF,eE,{timeRemap:function(eG){return eG+eC;}});}function eA(eD){var eF=[];for(var eC=0;eC<eD.length;eC++){var eE=eD[eC];if(eE.canVaryOverTime&&eE.numKeys>0){eF.push(eE);}}return eF;}function ew(eF){var eI=[];var eC=[];for(var eE=0;eE<eF.length;eE++){var eH=eF[eE];var eD=c6(eH).index;var eG=eC[eD];if(eG===undefined){eG=eI.length;eC[eD]=eG;eI[eG]=[];}eI[eG].push({prop:eH,selectedKeys:eH.selectedKeys});}return eI;}return eB;})();var ak=(function(){function eA(eH,eI,eG,eJ){app.beginUndoGroup("repeat keyframes");H(function(){var eK=h();ew(eK,eH,eI,eG,eJ);},function(){app.endUndoGroup();});}function ew(eN,eH,eP,eG,eM){var eR=eN.selectedProperties.slice();if(!eF(eR)){throw new dn("Select some keyframes\nsuch that I can repeat those keyframes at each beat.");}var eQ=eG;var eU=ex(eQ);if(eU==null){return;}var eO=eU.beatSource;var eK;if(eO=="BEATS"){eK=ao(eN,eH,eP.times,true);if(eK.length==0){throw new dn("No beats\nMake sure some beats are selected in the BeatEdit user interface");}if(eK.length==0){throw new dn("No beats\nMake sure more than one beat is selected in the BeatEdit user interface");}}else{if(eO=="COMPMARKERS"){eK=ec(eN);if(eK.length==0){throw new dn("No comp markers.\nMake sure the active comp has some comp markers.");}if(eK.length==0){throw new dn("Only one comp marker.\nMake sure the active comp has some comp markers.");}}else{throw new Error("unknown beat source "+eO);}}n(eK,eM);var eI=ae(eN.time,eK);if(eU.workAreaOnly){eU.startTime=eN.workAreaStart;eU.endTime=eN.workAreaStart+eN.workAreaDuration;}var eT=[];var eS=[];for(var eJ=0;eJ<eR.length;eJ++){if(eC(eR[eJ])){eT.push(undefined);}else{if(eB(eR[eJ])){eS.push(eR[eJ]);eT.push(undefined);}else{eT.push(ey(eR[eJ]));}}}for(eJ=0;eJ<eR.length;eJ++){ev(eR[eJ],eT[eJ],eK,eI,eU);}if(eS.length>0){var eL=eS.map(M).join("\n");throw new dn("Skipped these properties due to unsupported property type:\n"+eL);}}function eB(eH){var eG=eH.propertyValueType;return(eG==PropertyValueType.NO_VALUE||eG==PropertyValueType.CUSTOM_VALUE||eG==PropertyValueType.MARKER);}function eC(eG){return((!(eG instanceof Property))||(!eG.canVaryOverTime)||(eG.numKeys==0));}function eF(eH){for(var eG=0;eG<eH.length;eG++){var eI=eH[eG];if(eI.selectedKeys&&eH[eG].selectedKeys.length>0){return true;}}return false;}function ey(eH){var eG=bL(eH);if(eG.length==0){return undefined;}return eG;}function ev(eH,eQ,eO,eM,eU){eU=eU||{};if(eQ==undefined){return;}var eN=eQ[0].time;var eS=eQ[eQ.length-1].time;var eT=eO[eM];var eP=eS;for(var eR=eM+1;eR<eO.length;eR++){var eI=eO[eR];var eL=eI-eT;var eK=eN+eL;var eJ=eS+eL;if(eU.startTime!=undefined&&eK<eU.startTime){continue;}if(eU.endTime!=undefined&&eJ>eU.endTime){break;}if(eK>=eP||eU.clip){if(eU.continuous&&eH.propertyValueType!==PropertyValueType.TEXT_DOCUMENT){eD(eH,eQ,eK);}var eG=["hold",eU.continuous?"offsetFrame":"hold"];if(eH.propertyValueType==PropertyValueType.TEXT_DOCUMENT){eG=["none","none"];}em(eH,eQ,{timeRemap:function(eV){return eV+eL;},mergeStrategy:eG});eP=eS+eL;}}}function eD(eN,eK,eH){var eL=eK[0].value;var eJ=eN.valueAtTime(eH,false);var eM=dh(eJ,eL,eN.propertyValueType);for(var eI=0;eI<eK.length;eI++){var eG=P(eK[eI].value,eM,eN.propertyValueType);if(eJ instanceof Shape){eK[eI].value.vertices=eG.vertices;eK[eI].value.inTangents=eG.inTangents;eK[eI].value.outTangents=eG.outTangents;}else{eK[eI].value=eG;}}}function ez(eG,eJ){var eI=eJ?"TRUE":"FALSE";var eH=app.settings.haveSetting("BeatEdit 2",eG)?(app.settings.getSetting("BeatEdit 2",eG)):eI;return(eH=="TRUE");}function eE(eH,eG){var eI=eG?"TRUE":"FALSE";app.settings.saveSetting("BeatEdit 2",eH,eI);}function ex(eK){var eH=["Usage:","1. Select the keyframes you want to repeat at each beat.","2. Move the current time indicator to the beat that corresponds to the keyframes.","3. Apply the repeat keyfreames tool. It will create one copy of the selected keyframes for each subsequent beat."];var eI={workAreaOnly:ez("repeatKeyframesWorkAreaOnly",false),clip:ez("repeatKeyframesClip",false),continuous:ez("repeatKeyframesContinuous",true)};var eJ=[{text:"work area only",value:eI.workAreaOnly,helpTip:"only repeat keyframes for beats in the work area"},{text:"clip",value:eI.clip,helpTip:"If the beats are so close that repeats of the keyframes overlap, the keyframe patterns are clipped where the next repeat starts (without this option, repeats are skipped when necessary to avoid overlaps) ",},{text:"continuous",value:eI.continuous,helpTip:"When the keyframes you repeat don't start and end at the same value, then this option shifts each copy to avoid abrupt jumps. If you keyframed something jumping forward, for example, with the coninuous option enabled, the next jump will start where the previous one ended.",}];var eG=aC(eH,eJ,eK);if(eG==null){return null;}eI.beatSource=eG;eI.workAreaOnly=eJ[0].value;eI.clip=eJ[1].value;eI.continuous=eJ[2].value;eE("repeatKeyframesWorkAreaOnly",eI.workAreaOnly);eE("repeatKeyframesClip",eI.clip);eE("repeatKeyframesContinuous",eI.continuous);return eI;}return eA;})();function cF(ez,ey,eF){eF=eF||{};var eB=ey.valueSystem;var ex=ez.times;var ew=ey.generate(ex);function eD(){var eG=eC(ex.length-1);return ex[ex.length-1]+eG.endTime;}function ev(eH,eI){if(eH>=ex.length){return eH;}var eG=eC(eH);while(ex[eH]+eG.startTime<=eI){eH++;}return eH;}function eC(eG){return ew[eG];}function eE(eG,eI,eH){return(ex[eI]+eG.endTime<eH);}function eA(){if(ex.length==0){return[];}var eG=eF.frameDuration||1/25;var eJ=eD();var eN=0;var eH=0;var eK=eB.zero;var eO=[];for(var eQ=0;eQ<eJ;eQ+=eG){var eP=eK;eH=ev(eH,eQ);for(var eM=eN;eM<eH;eM++){var eL=eC(eM);var eI=eL.valueAtTime(eQ-ex[eM]);eP=eB.add(eP,eI);if(eE(eL,eM,eQ)){if(eM==eN){eN++;eK=eB.add(eK,eI);}}}eO.push(eP);}return eO;}return eA();}function cl(eA,ez,ev,eC,eB,ex){ex=ex||{};if(ez>ev){var ew=ez;ez=ev;ev=ew;ew=eC;eC=eB;eB=ew;}if(ex.noClipping){if(ez==ev){throw new Error("linear(t, tMin, tMax, vMin, vMax): tMin and tMax may not have the same value");}}else{if(eA<=ez){return eC;}if(eA>=ev){return eB;}}var ey=(eA-ez)/(ev-ez);return eC+(eB-eC)*ey;}function bJ(ez,ey,ev,eB,eA){var ew=cl(ez,ey,ev,0,100);var ex=1-Math.pow(0.5,ew*(8/100));return eB+(eA-eB)*ex;}function cL(ez,ey,ev,eB,eA){var ew=cl(ez,ey,ev,100,0);var ex=Math.pow(0.5,ew*(8/100));return eB+(eA-eB)*ex;}function dB(ev){return function(eB,eA,ex,eC,ey){if(eC.length!=ey.length){throw new Error("can only interpolate between two arrays if their length is identical");}var ew=[];for(var ez=0;ez<eC.length;ez++){ew.push(ev(eB,eA,ex,eC[ez],ey[ez]));}return ew;};}function aM(ev){var ew=dB(ev);return function(eJ,ey,eD,eH,ez){if(eH.vertices.length!=ez.vertices.length){throw new Error("shapes can only be interpolated if they have the same number of vertices!");}var eF=[];var eA=[];var eG=[];for(var eB=0;eB<eH.vertices.length;eB++){var eC=ew(eJ,ey,eD,eH.vertices[eB],ez.vertices[eB]);var ex=bS(ew(eJ,ey,eD,aN(eH.vertices[eB],eH.inTangents[eB]),aN(ez.vertices[eB],ez.inTangents[eB])),eC);var eI=bS(ew(eJ,ey,eD,aN(eH.vertices[eB],eH.outTangents[eB]),aN(ez.vertices[eB],ez.outTangents[eB])),eC);eF.push(eC);eA.push(ex);eG.push(eI);}var eE=new Shape();eE.vertices=eF;eE.inTangents=eA;eE.outTangents=eG;eE.closed=eH.closed;return eE;};}var bP=(function(){var eH=(function(){return{dimensionality:1,zero:0,one:1,add:function(eK,eJ){return eK+eJ;},sub:function(eK,eJ){return eK-eJ;},mul:function(eK,eJ){return eK*eJ;},div:function(eK,eJ){return eK/eJ;},mod:function(eK,eJ){return eK%eJ;},mulScalar:function(eK,eJ){return eK*eJ;},forEachComponent:function(){if(arguments.length<2){throw Error("forEachComponent must have at least 2 arguments");}var eM=arguments[arguments.length-1];var eK=[];var eL;for(eL=0;eL<arguments.length-1;eL++){eK.push(arguments[eL]);}var eJ=eM.apply(null,eK);return eJ;}};})();var eC=(function(){return{dimensionality:2,zero:[0,0],one:[1,1],add:function(eK,eJ){return[eK[0]+eJ[0],eK[1]+eJ[1]];},sub:function(eK,eJ){return[eK[0]-eJ[0],eK[1]-eJ[1]];},mul:function(eK,eJ){return[eK[0]*eJ[0],eK[1]*eJ[1]];},div:function(eK,eJ){return[eK[0]/eJ[0],eK[1]/eJ[1]];},mod:function(eK,eJ){return[eK[0]%eJ[0],eK[1]%eJ[1]];},mulScalar:function(eK,eJ){return[eK*eJ[0],eK*eJ[1]];},forEachComponent:dl};})();var ex=(function(){return{dimensionality:3,zero:[0,0,0],one:[1,1,1],add:function(eK,eJ){return[eK[0]+eJ[0],eK[1]+eJ[1],eK[2]+eJ[2]];},sub:function(eK,eJ){return[eK[0]-eJ[0],eK[1]-eJ[1],eK[2]-eJ[2]];},mul:function(eK,eJ){return[eK[0]*eJ[0],eK[1]*eJ[1],eK[2]*eJ[2]];},div:function(eK,eJ){return[eK[0]/eJ[0],eK[1]/eJ[1],eK[2]/eJ[2]];},mod:function(eK,eJ){return[eK[0]%eJ[0],eK[1]%eJ[1],eK[2]%eJ[2]];},mulScalar:function(eK,eJ){return[eK*eJ[0],eK*eJ[1],eK*eJ[2]];},forEachComponent:dl};})();var eG=(function(){return{dimensionality:4,zero:[0,0,0,0],one:[1,1,1,1],add:function(eK,eJ){return[eK[0]+eJ[0],eK[1]+eJ[1],eK[2]+eJ[2],eK[3]+eJ[3]];},sub:function(eK,eJ){return[eK[0]-eJ[0],eK[1]-eJ[1],eK[2]-eJ[2],eK[3]-eJ[3]];},mul:function(eK,eJ){return[eK[0]*eJ[0],eK[1]*eJ[1],eK[2]*eJ[2],eK[3]*eJ[3]];},div:function(eK,eJ){return[eK[0]/eJ[0],eK[1]/eJ[1],eK[2]/eJ[2],eK[3]/eJ[3]];},mod:function(eK,eJ){return[eK[0]%eJ[0],eK[1]%eJ[1],eK[2]%eJ[2],eK[3]%eJ[3]];},mulScalar:function(eK,eJ){return[eK*eJ[0],eK*eJ[1],eK*eJ[2],eK*eJ[3]];},forEachComponent:dl};})();var ez=[eH,eC,ex,eG];var ey=[{name:"linear",fun:cl},{name:"exponentialInverseInterpolation",fun:cl},{name:"expoIn",fun:bJ},{name:"expoOut",fun:cL},];for(var eF=0;eF<ey.length;eF++){var eE=ey[eF];ez[0][eE.name]=eE.fun;for(var eB=1;eB<ez.length;eB++){ez[eB][eE.name]=eA(eE.fun);}}function eA(eJ){return function(eP,eO,eL,eR,eQ,eM){if(!(eR instanceof Array)){throw new Error("vMin must be an array");}if(!(eQ instanceof Array)){throw new Error("vMax must be an array");}if(eR.length!=eQ.length){throw new Error("vMax and vMin must have same length");}var eK=[];for(var eN=0;eN<Math.min(eR.length,eQ.length);eN++){eK.push(eJ(eP,eO,eL,eR[eN],eQ[eN],eM));}return eK;};}function ev(eK,eJ){return Math.random()*(eJ-eK)+eK;}ez[0].getRandomValueBetweenMinAndMax=ev;for(eB=1;eB<ez.length;eB++){ez[eB].getRandomValueBetweenMinAndMax=(function(eJ){function eK(eO,eM){var eL=[];for(var eN=0;eN<eJ;eN++){eL.push(ev(eO[eN],eM[eN]));}return eL;}return eK;})(eB+1);}function eI(eJ){if(typeof eJ==="string"||eJ instanceof String){eJ=ew[eJ];}return eJ;}function eD(eJ){if(eJ<=0||eJ>ez.length){throw new Error("unsupported number of dimensions "+eJ);}return ez[eJ-1];}var ew={_1D:eH,_2D:eC,_3D:ex,_4D:eG,byName:eI,byNumDimensions:eD};return ew;})();function bd(ev){if(ev=="BeatWiggleMoveGeneric"){return ep;}if(ev=="BeatWiggleMoveRandomDirection"){return d2;}throw new Error("unknown BeatWiggleMove class "+ev);}function ep(eA,eB,ev,eD,ex,eC,ez,ew){this.startTime=-eA;this.endTime=ev+eB;var ey=eD.linear(ew,0,1,ez,eD.zero);this.valueAtTime=function(eE){if(eE<=0){return eD[ex](eE,this.startTime,0,eD.zero,ez);}else{if(eE<=eB){return ez;}else{return eD[eC](eE,eB,this.endTime,ez,ey);}}};}function d2(eD,eF,ev,eH,ey,eG,ez,ex,eE){this.startTime=-eD;this.endTime=ev+eF;var ew=new LCGRandomNumberGenerator(eE.index);var eC=eB(ez,eH);function eB(eJ,eM){var eL=undefined;var eN=undefined;var eK=2;while(eK>1){eN=eM.forEachComponent(eM.zero,function(){return ew.randomFloat(0,1)*ez;});eK=0;eM.forEachComponent(eN,function(eO){eK+=eO*eO;});}eL=Math.sqrt(eK);var eI=eM.mulScalar(1/eL,eN);return eI;}var eA=eH.linear(ex,0,1,eC,eH.zero);this.valueAtTime=function(eI){if(eI<=0){return eH[ey](eI,this.startTime,0,eH.zero,eC);}else{if(eI<=eF){return eC;}else{return eH[eG](eI,eF,this.endTime,eC,eA);}}};}function af(){return new ca({valueSystem:bP._1D,goBackWeight:0,});}function ca(eJ){eJ=eJ||{};var eH=bP.byName(eC(eJ,"valueSystem",bP._1D));var ez=eC(eJ,"peakVal",45);var eA=eC(eJ,"inDuration",0.3);var ev=eC(eJ,"outDuration",0.1);var eB=eC(eJ,"holdDuration",0);var ex=eC(eJ,"easeIn","expoOut");var eD=eC(eJ,"easeout","linear");var ew=eC(eJ,"goBackWeight",0);var eG=eC(eJ,"BeatWiggleMoveClass","BeatWiggleMoveGeneric");function eC(eL,eK,eM){return(eL[eK]===undefined?eM:eL[eK]);}function eF(eL,eK){if(eL.choice=="random"){return eF(eI(eL.values),eK);}else{if(eL.choice=="sequential"){return eF(eL.values[eK%eL.values.length],eK);}else{if(eL.choice=="randomRange"){if(eL.min===undefined||eL.max===undefined){throw new Error("randomRange requires min and max to be defined");}return ey(eL.min,eL.max);}}}return eL;}function eI(eK){return eK[Math.floor(Math.random()*eK.length)];}function ey(eL,eK){var eM=(eL instanceof Array)?bP.byNumDimensions(eL.length):bP._1D;return eM.getRandomValueBetweenMinAndMax(eL,eK);}function eE(eL){var eM=[];for(var eK=0;eK<eL.length;eK++){eM.push(new (bd(eG))(eF(eA,eK),eF(eB,eK),eF(ev,eK),eF(eH,eK),eF(ex,eK),eF(eD,eK),eF(ez,eK),eF(ew,eK),{time:eL[eK],index:eK},eJ));}return eM;}this.valueSystem=eH;this.generate=eE;}function bx(ex,ew,ev){return{"limiterType":"valueLimiter","min":ew,"max":ev,"type":ex};}function c3(ex,ew,ev){return{"limiterType":"percentageLimiter","min":ew,"max":ev,"type":ex};}function dm(ev){if(ev.limiterType=="valueLimiter"){return new bK(ev);}else{if(ev.limiterType=="percentageLimiter"){return new aT(ev);}}throw new Error("unknown limiter type:"+ev.limiterType);}function aT(eB){if(eB.limiterType!="percentageLimiter"){throw new Error("argument must be percentageLimiter json data");}var ew=eB.min;var eC=eB.max;var eA=eB.type;var eD=(ew instanceof Array)?ew.length:1;var ev=bP.byNumDimensions(eD);function eE(eG){return ev.mul(eG,ew);}function ez(eG){return ev.mul(eG,eC);}function eF(eH,eI){var eG=eE(eI);var eK=ez(eI);var eJ=new bK(bx(eA,eG,eK));return eJ.apply(eH);}function ey(){return eA!=="none";}function ex(eI){if(eA=="none"){throw new Error("ValueLimiter type 'none' has no bounding box");}var eG=eE(eI);var eJ=ez(eI);var eH={min:eG,max:eJ};return eH;}this.apply=eF;this.hasBoundingBox=ey;this.getBoundingBox=ex;this.getMin=function(){return ew;};this.getMax=function(){return eC;};}function bK(eB){if(eB.limiterType!="valueLimiter"){throw new Error("argument must be valueLimiter json data");}var ex=eB.min;var eC=eB.max;var eA=eB.type;var eG=["none","loop","loop-upper","clip","pingpong"];var eD=(ex instanceof Array)?ex.length:1;var ev=bP.byNumDimensions(eD);eH();function eH(){if(eG.indexOf(eA)==-1){throw new Error("unsupported limiter type "+eA);}if(eD>1){if(ex.length!=eD){throw new Error("limiter min must have length "+eD);}if(eC.length!=eD){throw new Error("limiter max must have length "+eD);}}else{if(typeof ex!="number"){throw new Error("limiter min must be a number");}if(typeof eC!="number"){throw new Error("limiter max must be a number");}}}function eF(eK){var eI;if(eD==1){eI=eK;}else{eI=eK.slice(0,eD);}if(eA=="loop"){eI=ev.forEachComponent(eI,ex,eC,function(eO,eN,eM){var eL=eE(eO,eN,eM-eN);return eL;});}else{if(eA=="loop-upper"){eI=ev.forEachComponent(eI,ex,eC,function(eO,eN,eM){var eL=eE(eO,eN,eM-eN,true);return eL;});}else{if(eA=="pingpong"){eI=ev.forEachComponent(eI,ex,eC,function(eO,eN,eM){var eL=eE(eO,eN,2*(eM-eN));if(eL>eM){eL=eM-(eL-eM);}return eL;});}else{if(eA=="clip"){eI=ev.forEachComponent(eI,ex,eC,function(eO,eN,eM){var eL=Math.max(eN,Math.min(eM,eO));return eL;});}else{if(eA=="none"){eI=ev.forEachComponent(eI,ex,eC,function(eM){var eL=eM;return eL;});}else{throw new Error("unknown limiter type");}}}}}if(eK.length!=undefined){for(var eJ=eD;eJ<eK.length;eJ++){eI.push(eK[eJ]);}}return eI;}function eE(eM,eK,eI,eL){if(eI==0){return eK;}var eJ=eM-eK;var eN=ew(eJ,eI);if(eL&&eN==0){if(eJ>=eI){eN=eI;}if(eJ<=eI*-1){eN=eI;}}return eN+eK;}function ew(eJ,eI){return((eJ%eI)+eI)%eI;}function ez(){return eA!=="none";}function ey(){if(eA=="none"){throw new Error("ValueLimiter type 'none' has no bounding box");}var eI={min:ex,max:eC};return eI;}this.apply=eF;this.hasBoundingBox=ez;this.getBoundingBox=ey;this.getMin=function(){return ex;};this.getMax=function(){return eC;};}var cN=(function(){function eB(eK){app.beginUndoGroup("beat wiggle");H(function(){var eL=h();eA(eL,eK);},function(){app.endUndoGroup();});}function eA(eK,eN){var eL=ao(eK,eN.file,eN.beatData.times,true);eL=aU(eL,eK,true);var eM=eN.parameterData.activeRenderer;if(eM=="2D"||eM=="3D"){eJ(eK,eN.parameterData,eL);}else{if(eM=="1D"){eF(eK,eN.parameterData,eL);}else{throw new Error("unknown renderer"+eM);}}}function eJ(eK,eN,eM){var eO=0;c8(eK,function(eP){if(eH(eP,eM,eN)){eO++;}});if(eO==0){if(confirm("Should I create a new Null for you?\nYou didn't select any "+eN.activeRenderer+" layer that I could apply the data to.")){var eL=eK.layers.addNull();eL.name="BeatEdit Null";if(eN.activeRenderer=="3D"){eL.threeDLayer=true;}eH(eL,eM,eN);}}}function eH(eP,eM,eL){var eT=(eP.threeDLayer||eP instanceof CameraLayer||eP instanceof LightLayer);var eO=eT?"3D":"2D";if(eO!=eL.activeRenderer){return false;}if(cR(eP)){return false;}var eQ=[{key:"position",matchNamePathArray:["ADBE Transform Group","ADBE Position"]},{key:"scale",matchNamePathArray:["ADBE Transform Group","ADBE Scale"]},{key:"opacity",matchNamePathArray:["ADBE Transform Group","ADBE Opacity"]}];if(eT){eQ.push({key:"rotation",matchNamePathArray:["ADBE Transform Group","ADBE Rotate X"],useComponent:0});eQ.push({key:"rotation",matchNamePathArray:["ADBE Transform Group","ADBE Rotate Y"],useComponent:1});eQ.push({key:"rotation",matchNamePathArray:["ADBE Transform Group","ADBE Rotate Z"],useComponent:2});}else{eQ.push({key:"rotation",matchNamePathArray:["ADBE Transform Group","ADBE Rotate Z"]});}for(var eN=0;eN<eQ.length;eN++){var eK=eG(eP,eQ[eN].matchNamePathArray);var eS=eQ[eN].key;var eR=eQ[eN].useComponent;ex(eP,eK,eM,eL["renderers"][eO][eS],eR);}return true;}function eG(eM,eK){var eN=eM;for(var eL=0;eL<eK.length;eL++){eN=eN.property(eK[eL]);if(eN==null){throw new Error("property "+eK[eL]+" does not exist on "+eM.name);}}return eN;}function eF(eK,eP,eN){var eO=0;var eM=eK.selectedProperties.slice();var eL=eP["renderers"]["1D"]["value"];eM.foreach(function(eT){if((eT instanceof PropertyGroup)&&(eT.matchName=="ADBE Slider Control")){var eS=eT.property("ADBE Slider Control-0001");if(!eS.selected){eM.push(eS);}}});function eR(eS){ex(c6(eS),eS,eN,eL);}eM.foreach(function(eS){if((eS instanceof Property)&&(eS.propertyValueType==PropertyValueType.OneD)){eR(eS);eO++;}});if(eO==0){if(confirm("Should I create a new slider?\nYou didn't select any slider or other 1D property to apply the data to.")){var eQ=ev(eK);eR(eQ);}}}function ev(eK){var eL;if(eK.selectedLayers.length==0){eL=eK.layers.addNull();eL.name="BeatEdit Slider";}else{eL=eK.selectedLayers[0];}return R(eL,"BeatEdit",0);}function ex(e4,eO,eZ,e3,eU){if(!e3.enabled){return;}if(eO.dimensionsSeparated){throw new dn("Cannot apply BeatWiggle to layer "+e4.name+"\nPlease disable the 'separate dimensions' option for the "+eO.name+" and try again.");}var eN=e4.containingComp.frameDuration;var eX=e4.containingComp.workAreaStart;var eP=eX+e4.containingComp.workAreaDuration;var eM=cF({times:eZ},new ca(e3),{frameDuration:eN});var eR=Math.ceil(eX/eN);var eK=Math.floor(eP/eN);var eL=[e4.containingComp.width,e4.containingComp.height];var eT=null;if(e3.limiter){eT=dm(e3.limiter);}eR=Math.max(eR,0);eK=Math.min(eK,eM.length-1);var eV=[];var e0,eW;for(e0=eR;e0<=eK;e0++){eW=e0*eN;eV.push(eO.valueAtTime(eW,true));}var e5=[];var eQ=[];for(e0=eR;e0<=eK;e0++){eW=e0*eN;eQ.push(eW);e5.push(eD(eM[e0],eV[e0-eR],eO.matchName,eT,eL,eU));}cO(eO,eX,eP);if(eO.matchName=="ADBE Time Remapping"){if(e4.canSetTimeRemapEnabled&&!e4.timeRemapEnabled){e4.timeRemapEnabled=true;}var eY=0;var e2=e4.source.duration;e5=e5.map(function(e6){return Math.max(Math.min(e6,e2),eY);});}var eS=ey(eQ,e5);try{eO.setValuesAtTimes(eS.times,eS.values);}catch(e1){ew(e1,e4,eO);}}function ew(eM,eK,eO){var eL=/Unable to call.*setValuesAtTimes.*Value (\S+) out of range (\S+) to (\S+)./;var eN=eL.exec(eM.message);if(eN){throw new dn("BeatWiggle values out of supported range "+eN[2]+" to "+eN[3]+"\n for property '"+eO.name+"' of layer '"+eK.name+"'"+"\n\n"+"Tip: You can use the clipping controls of the beat wiggle to ensure it stays within the supported range. Also note that the values of the beat wiggle are added on top of the current value of the property, so you might want to set it to 0 before applying the beat wiggle.");}else{throw eM;}}function eD(eR,eP,eN,eK,eM,eO){var eS;if(eO!==undefined){var eQ=eP;eP=eR.slice();eP[eO]=eQ;}if(eP instanceof Array){var eL=ez(eR,eP.length,0);eS=aS(eL,eP);}else{eS=eR+eP;}if(eK){eS=eK.apply(eS,eM);}eS=eI(eN,eS);if(eO!==undefined){eS=eS[eO];}return eS;}function ez(eL,eK,eN){var eM=eL.slice();while(eM.length<eK){eM.push(eN);}return eM;}function eI(eK,eL){if(eK=="ADBE Opacity"){eL=eC(eL,0,100);}return eL;}function eC(eM,eL,eK){return Math.max(Math.min(eM,eK),eL);}function ey(eN,eM){var eK={times:[eN[0]],values:[eM[0]]};for(var eL=1;eL<eN.length-1;eL++){if(!(eE(eM[eL],eM[eL-1])&&eE(eM[eL],eM[eL+1]))){eK.times.push(eN[eL]);eK.values.push(eM[eL]);}}eK.times.push(eN[eN.length-1]);eK.values.push(eM[eN.length-1]);return eK;}function eE(eM,eL){if(eM instanceof Array){for(var eK=0;eK<eM.length;eK++){if(!eE(eM[eK],eL[eK])){return false;}}return true;}return Math.abs(eM-eL)<=0.001;}return eB;})();function ag(ew){var ev=[];for(var ex=0;ex<ew.length;ex++){var ey=ew.charCodeAt(ex);if(ey<128){ev.push(String.fromCharCode(ey));}else{if((ey>127)&&(ey<2048)){ev.push(String.fromCharCode((ey>>6)|192));ev.push(String.fromCharCode((ey&63)|128));}else{ev.push(String.fromCharCode((ey>>12)|224));ev.push(String.fromCharCode(((ey>>6)&63)|128));ev.push(String.fromCharCode((ey&63)|128));}}}return ev.join("");}function eh(ew){var ev=[];var ez=0;while(ez<ew.length){var eA=ew.charCodeAt(ez);if(eA<128){ev.push(String.fromCharCode(eA));ez++;}else{if((eA>191)&&(eA<224)){var ey=ew.charCodeAt(ez+1);ev.push(String.fromCharCode(((eA&31)<<6)|(ey&63)));ez+=2;}else{var ey=ew.charCodeAt(ez+1);var ex=ew.charCodeAt(ez+2);ev.push(String.fromCharCode(((eA&15)<<12)|((ey&63)<<6)|(ex&63)));ez+=3;}}}return ev.join("");}function bU(eA,eF){eF=eF||{};if(eF.utf8){eA=ag(eA);}var ez="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var eG=[];var ey,ew,ev,eE,eD,eC,eB;var ex=0;while(ex<eA.length){ey=eA.charCodeAt(ex++);ew=eA.charCodeAt(ex++);ev=eA.charCodeAt(ex++);eE=ey>>2;eD=((ey&3)<<4)|(ew>>4);eC=((ew&15)<<2)|(ev>>6);eB=ev&63;if(isNaN(ew)){eC=eB=64;}else{if(isNaN(ev)){eB=64;}}eG.push(ez.charAt(eE)+ez.charAt(eD)+ez.charAt(eC)+ez.charAt(eB));}return eG.join("");}function aH(eB,eG){eG=eG||{};var ez="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var eH=[];var ey,ew,ev;var eF,eE,eD,eC;var ex=0;if(/[^A-Za-z0-9\+\/\=]/.test(eB)){throw"base64decode error: input contains symbol that is not allowed";}while(ex<eB.length){eF=ez.indexOf(eB.charAt(ex++));eE=ez.indexOf(eB.charAt(ex++));eD=ez.indexOf(eB.charAt(ex++));eC=ez.indexOf(eB.charAt(ex++));ey=(eF<<2)|(eE>>4);ew=((eE&15)<<4)|(eD>>2);ev=((eD&3)<<6)|eC;eH.push(String.fromCharCode(ey));if(eD!=64){eH.push(String.fromCharCode(ew));}if(eC!=64){eH.push(String.fromCharCode(ev));}}var eA=eH.join("");if(eG.utf8){eA=eh(eA);}return eA;}function cd(){if(app==null||app.preferences==null||app.preferences.getPrefAsLong==null){return true;}var ev=app.preferences.getPrefAsLong("Main Pref Section","Pref_SCRIPTING_FILE_NETWORK_SECURITY");return(ev==1);}function bv(){var ev=s({en:'Please enable "Allow Scripts to Write Files and Access Network" in your AE Preferences\n('+(cG()?"Edit->Preferences->General).":"After Effects->Preferences->General)."),de:'Bitte aktiviere die Option "Skripten können Dateien schreiben und haben Netzwerkzugang" unter '+(cG()?"Bearbeiten->Voreinstellungen->Allgemein.":"After Effects->Voreinstellungen->Allgemein.")});return ev;}function bb(ew,ev){if(ew.exists){return true;}if(!cd()){ev.add(s({en:"Could not create the following folder:\n",de:"Konnte den folgenden Ordner nicht erzeugen:\n"})+ew.fsName+"\n"+bv());return false;}if(ew.parent!=null){bb(ew.parent,ev);}ew.create();if(ew.error){ev.add(s({en:"Could not create the following folder:",de:"Konnte den folgenden Ordner nicht erzeugen:"})+ew.fsName+"\n"+ew.error+s({en:"\nMake sure that your user has write permissions to that folder and try to create it manually.",de:"\nStelle sicher, dass Dein Benutzer Schreibrechte in diesem Ordner hat und versuche ihn manuell zu erstellen."}));return false;}return true;}function r(ey,ev){if(!ey.exists){return true;}if(!cd()){ev.add(s({en:"Could not delete the following folder:\n",de:"Konnte den folgenden Ordner nicht löschen:\n"})+ey.fsName+"\n"+bv());return false;}var ex=ey.getFiles();for(var ew=0;ew<ex.length;ew++){if(ex[ew] instanceof Folder){r(ex[ew],ev);}else{if(ex[ew] instanceof File){ex[ew].remove();}else{ev.add("Child "+ew+" of folder "+ey.fsName+" is neither File nor Folder object");}}}ey.remove();if(ey.Error){ev.add(s({en:"Could not delete the following folder:",de:"Konnte den folgenden Ordner nicht löschen:"})+ey.fsName+"\n"+ey.error);return false;}return true;}function ea(ew){var ev=new File(cb(ew));while(ev.exists){ev=new File(cb(ew));}return ev;}function cb(ew){var ev=Folder.temp.fsName+"/"+Math.round(Math.random()*(new Date()).getTime()*37915);if(ew!=undefined){ev+="."+ew;}return ev;}function c9(){var ex=Folder.userData;if(app.settings.haveSetting("mamoworld","userDataPath")){var ew=app.settings.getSetting("mamoworld","userDataPath");ex=new Folder(ew);}if(ex==null){var ev=s({en:"Folder.userData is null.\nThis is a bug in the AE scripting interface that only occurs on very few machines. Please report it to http://adobe.com/go/wish.\n\n"+"Fortunately, we have implemented a workaround. Please open a new support ticket at http://aescripts.com/contact/ such that we can explain you what to do.",de:"Folder.userData ist null.\nDas ist ein Bug in der AE Scripting-Schnittstelle der nur auf sehr wenigen Rechnern auftritt. Bitte melde ihn unter http://adobe.com/go/wish.\n\n"+"Glücklicherweise haben wir eine provisorische Lösung für das Problem. Bitte erstelle ein neues Support-Ticket unter http://aescripts.com/contact/, damit wir Dir beschreiben können, wie Du das Problem lösen kannst."});alert(ev);throw new Error("Folder.userData is null");}return ex;}function c7(ew){var ex=new aO("Errors");var ev=new A(ew,ex);return ev.getPath();}function A(ez,ev){this.errorHandler=ev;this.pathA=c9().fsName+"/Aescripts/"+ez;this.pathB=c9().absoluteURI+"/Aescripts/"+ez;var ey=new Folder(this.pathA);var ew=new aO("dummy");if(!bb(ey,ew)||ew.hasError()){var ex=new Folder(this.pathB);bb(ex,this.errorHandler);}}A.prototype.getPath=function(){return this.pathA;};A.prototype.getFile=function(eB,ey,ez){ez=ez||{};var ex=new File(this.pathA+"/"+eB);var eA=new aO("dummy");var ew=bi(ex,ey,eA,ez);if(eA.hasError()){var ev=new File(this.pathB+"/"+eB);ew=bi(ev,ey,this.errorHandler,ez);}return ew;};A.prototype.clear=function(){var ev=new Folder(this.pathA);r(ev,this.errorHandler);return !this.errorHandler.hasError();};function bi(ez,ew,ex,ey){if(ez.exists){return ez;}if(ez.parent!=null){bb(ez.parent,ex);}if(!cd()){ex.add(s({en:"Could not create the following file: ",de:"Konnte die folgende Datei nicht erzeugen: "})+ez.fsName+"\n"+bv());return ez;}var ev=(ey.encoding==="BINARY")?ew:aH(ew);ez.encoding="BINARY";if(!ez.open("w")){ex.add(s({en:"Could not create the following file: ",de:"Konnte folgende Datei nicht erzeugen: "})+ez.fsName+"\n"+ez.error+s({en:"\nPlease check that your user has the necessary permissions to write to this folder.",de:"\nBitte überprüfe, ob Dein Benutzer die nötigen Rechte hat, um in dieses Verzeichnis zu schreiben.\n"}));return ez;}ez.write(ev);ez.close();if(ez.error!=""){ex.add(s({en:"Could not write to the following file: ",de:"Konnte folgende Datei nicht schreiben: "})+ez.fsName+"\n"+ez.error+s({en:"\nPlease check that your user has the necessary permissions to write to this folder.",de:"\nBitte überprüfe, ob Dein Benutzer die nötigen Rechte hat, um in dieses Verzeichnis zu schreiben.\n"}));}else{if(!ez.exists){ex.add(s({en:"Could not create the following file: ",de:"Konnte folgende Datei nicht erzeugen: "})+ez.fsName+"\n"+s({en:"Actually I just created this file successfully, but now it does not exist anymore.",de:"Eigentlich habe ich die Datei gerade erfolgreich erzeugt, aber jetzt existiert sie nicht mehr."}));}}return ez;}function aL(ev){this.message=ev;}aL.prototype=new Error();function av(eA,ew){if(ew==undefined){ew={};}var ev=(ew.timeOut?ew.timeOut:10000);var ez=ea("bat");var ex=ea("lock");ez.open("w");ez.write(eA);ez.write("\necho DONE > "+ex.fsName.quoteForWindowsCommandLineArgument());ez.close();ez.execute();var ey=0;while(!ex.exists){$.sleep(100);ey+=100;writeLn("wait for"+ez.fsName);if(ey>ev){ey=0;if(!confirm("Wait for execution of "+ez.fsName+". Either it takes just longer than usual or an error occurred during its execution. Do you still want to wait?")){throw new aL("timeout while waiting for execution of bat file "+ez.fsName+" (lock file "+ex.fsName+")");}}}ez.remove();ex.remove();}function bs(ew,ev){if(V()){d4(ew,ev);}else{i(ew,ev);}}function cg(ev){if(V()){return a3(ev);}else{return bM(ev);}}function a3(ew){var ex=ea();system.callSystem("pbpaste -Prefer txt >"+ex.fsName);if(!ex.exists){throw new Error("reading from clipboard not possibe - clipboard content should be stored in file "+ex+" but the file does not seem to exist.");}ex.open("r");var ey=ex.read();var ev=ey.replace(/\n$/,"");ex.remove();return ev;}function d4(ew,ev){var ex="echo "+ew.quoteForBashShell()+" | pbcopy";system.callSystem(ex);}function i(ew,ev){var ex=ea("txt");ex.open("w");ex.write(ew);ex.close();var ey='cmd.exe /c "clip < '+(ex.fsName.quoteForWindowsCommandLineArgument())+'"';av(ey);ex.remove();}function bM(ey){var ev;if(ey instanceof Object&&ey.userData!=undefined){ev=ey.userData;}else{ev=new A("mamoworld",new aO("Clipboard UserData Errors"));}var ew=ev.getFile("paste.exe"," ");var ez=ea("txt");var eC=ew.fsName.quoteForWindowsCommandLineArgument()+" > "+ez.fsName.quoteForWindowsCommandLineArgument();var eB='cmd.exe /c "'+eC+'"';av(eB);ez.open("r");var eA=ez.read();var ex=eA.replace(/\n$/,"");ez.close();ez.remove();return ex;}var dw=(function(){function ez(eB){var eA=!eB;H(function(){ex(eA);});}function ex(eA){var eB=app.project.activeItem;if(eB==null||!(eB instanceof CompItem)){ey("No composition is active");}var eC=undefined;if(eA){eC=[eB.workAreaStart,eB.workAreaStart+eB.workAreaDuration];}if(eB.selectedLayers.length>1){ey("Multiple layers are selected");}else{if(eB.selectedLayers.length==0){if(ev(ap(eB),eB.time*-1,eC)==0){ey("Comp has no markers "+(eA?"in the work area ":"")+"to copy");}}else{if(ev(ap(eB.selectedLayers[0]),eB.time*-1,eC)==0){ey("Selected layer has no markers "+(eA?"in the work area ":"")+"to copy");}}}}function ey(eA){throw new dn(eA+"\nSelect a single layer with markers or select no layer to copy the comp markers. Shift-click to copy all (default: only markers in work area).");}function ev(eA,eI,eD){var eF={type:"mamoworldMarkerData",values:[],times:[]};function eE(eJ){if(!eD){return true;}return(eJ>=eD[0]&&eJ<=eD[1]);}for(var eC=1;eC<=eA.numKeys;eC++){var eB=eA.keyTime(eC);if(eE(eB)){var eG=eA.keyValue(eC);var eH=aq(eG);eF.values.push(eH);eF.times.push(eB+eI);}}if(eF.values.length>0){ew(eF);}writeLn("copied "+eF.values.length+" markers");return eF.values.length;}function ew(eB){var eA=JSON.stringify(eB);bs(eA);}return ez;})();var d3=(function(){function ez(eB){var eA=!eB;app.beginUndoGroup("paste markers");H(function(){ex(eA);},function(){app.endUndoGroup();});}function ex(eA){var eB=app.project.activeItem;if(eB==null||!(eB instanceof CompItem)){ey("No composition is active");}var eC=undefined;if(eA){eC=[eB.workAreaStart,eB.workAreaStart+eB.workAreaDuration];}else{eC=[0,eB.duration];}var eE=ev();if(eB.selectedLayers.length==0){ew(ap(eB),eB.time,eE,eC);}else{for(var eD=0;eD<eB.selectedLayers.length;eD++){ew(ap(eB.selectedLayers[eD]),eB.time,eE,eC);}}}function ev(){var eB=cg();try{var eA=JSON.parse(eB);if(eA.type!="mamoworldMarkerData"){throw new Error("is json, but no mamoworld marker data");}return eA;}catch(eC){throw new dn("Please copy some markers first\nNo valid marker data found in the clipboard.");}}function ew(eG,eA,eF,eB){if(eF.values.length==0){throw new dn("The clipboard contains no markers!");}var eD=0;for(var eC=0;eC<eF.values.length;eC++){var eE=eF.times[eC]+eA;if(eB==undefined||(eB[0]<=eE&&eE<=eB[1])){eG.setValueAtTime(eE,dz(eF.values[eC]));eD++;}}if(eD==0){throw new dn("None of the pasted markers are in the work area\nMake the work area larger or shift-click to ignore the work area.");}writeLn("pasted "+eD+" markers");}function ey(eA){throw new dn(eA+"\nSelect some layer(s) to which the marker should be pasted or select no layer to paste as comp markers.");}return ez;})();this.getSelectedAudioFile=be;this.createMarkers=U;this.deleteMarkers=J;this.moveMarkers=cK;this.staggerLayers=c5;this.staggerKeyframes=u;this.repeatKeyframes=ak;this.beatWiggleLayersOrProperties=cN;this.copyMarkers=dw;this.pasteMarkers=d3;}$._extBeatEdit=new BeatEditAPI();