HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/moodleAW/moodle505/lib/yuilib/3.13.0/tree-sortable/tree-sortable-coverage.js
/*
YUI 3.13.0 (build 508226d)
Copyright 2013 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/

if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/tree-sortable/tree-sortable.js']) {
   __coverage__['build/tree-sortable/tree-sortable.js'] = {"path":"build/tree-sortable/tree-sortable.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":44}}},"2":{"name":"Sortable","line":40,"loc":{"start":{"line":40,"column":0},"end":{"line":40,"column":20}}},"3":{"name":"(anonymous_3)","line":55,"loc":{"start":{"line":55,"column":17},"end":{"line":55,"column":35}}},"4":{"name":"(anonymous_4)","line":94,"loc":{"start":{"line":94,"column":10},"end":{"line":94,"column":29}}},"5":{"name":"(anonymous_5)","line":109,"loc":{"start":{"line":109,"column":20},"end":{"line":109,"column":36}}},"6":{"name":"(anonymous_6)","line":141,"loc":{"start":{"line":141,"column":14},"end":{"line":141,"column":39}}},"7":{"name":"(anonymous_7)","line":156,"loc":{"start":{"line":156,"column":36},"end":{"line":156,"column":58}}},"8":{"name":"(anonymous_8)","line":202,"loc":{"start":{"line":202,"column":14},"end":{"line":202,"column":30}}},"9":{"name":"(anonymous_9)","line":219,"loc":{"start":{"line":219,"column":21},"end":{"line":219,"column":37}}},"10":{"name":"(anonymous_10)","line":235,"loc":{"start":{"line":235,"column":26},"end":{"line":235,"column":50}}},"11":{"name":"(anonymous_11)","line":289,"loc":{"start":{"line":289,"column":24},"end":{"line":289,"column":49}}},"12":{"name":"(anonymous_12)","line":304,"loc":{"start":{"line":304,"column":26},"end":{"line":304,"column":38}}},"13":{"name":"(anonymous_13)","line":325,"loc":{"start":{"line":325,"column":11},"end":{"line":325,"column":48}}},"14":{"name":"NodeSortable","line":346,"loc":{"start":{"line":346,"column":0},"end":{"line":346,"column":24}}},"15":{"name":"(anonymous_15)","line":368,"loc":{"start":{"line":368,"column":10},"end":{"line":368,"column":29}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":377,"column":37}},"2":{"start":{"line":38,"column":0},"end":{"line":38,"column":22}},"3":{"start":{"line":40,"column":0},"end":{"line":40,"column":22}},"4":{"start":{"line":42,"column":0},"end":{"line":329,"column":2}},"5":{"start":{"line":56,"column":8},"end":{"line":56,"column":79}},"6":{"start":{"line":58,"column":8},"end":{"line":66,"column":9}},"7":{"start":{"line":59,"column":12},"end":{"line":61,"column":13}},"8":{"start":{"line":60,"column":16},"end":{"line":60,"column":60}},"9":{"start":{"line":63,"column":12},"end":{"line":65,"column":13}},"10":{"start":{"line":64,"column":16},"end":{"line":64,"column":54}},"11":{"start":{"line":95,"column":8},"end":{"line":95,"column":76}},"12":{"start":{"line":110,"column":8},"end":{"line":110,"column":28}},"13":{"start":{"line":143,"column":8},"end":{"line":145,"column":9}},"14":{"start":{"line":144,"column":12},"end":{"line":144,"column":24}},"15":{"start":{"line":147,"column":8},"end":{"line":147,"column":34}},"16":{"start":{"line":149,"column":8},"end":{"line":161,"column":9}},"17":{"start":{"line":151,"column":12},"end":{"line":151,"column":54}},"18":{"start":{"line":153,"column":12},"end":{"line":153,"column":28}},"19":{"start":{"line":156,"column":12},"end":{"line":158,"column":15}},"20":{"start":{"line":157,"column":16},"end":{"line":157,"column":51}},"21":{"start":{"line":160,"column":12},"end":{"line":160,"column":24}},"22":{"start":{"line":163,"column":8},"end":{"line":164,"column":20}},"23":{"start":{"line":166,"column":8},"end":{"line":172,"column":9}},"24":{"start":{"line":167,"column":12},"end":{"line":167,"column":61}},"25":{"start":{"line":168,"column":15},"end":{"line":172,"column":9}},"26":{"start":{"line":169,"column":12},"end":{"line":169,"column":39}},"27":{"start":{"line":171,"column":12},"end":{"line":171,"column":39}},"28":{"start":{"line":174,"column":8},"end":{"line":174,"column":75}},"29":{"start":{"line":175,"column":8},"end":{"line":175,"column":34}},"30":{"start":{"line":177,"column":8},"end":{"line":183,"column":9}},"31":{"start":{"line":178,"column":12},"end":{"line":182,"column":15}},"32":{"start":{"line":185,"column":8},"end":{"line":185,"column":20}},"33":{"start":{"line":203,"column":8},"end":{"line":203,"column":44}},"34":{"start":{"line":220,"column":8},"end":{"line":220,"column":44}},"35":{"start":{"line":238,"column":8},"end":{"line":242,"column":89}},"36":{"start":{"line":244,"column":8},"end":{"line":246,"column":9}},"37":{"start":{"line":245,"column":12},"end":{"line":245,"column":23}},"38":{"start":{"line":253,"column":8},"end":{"line":255,"column":9}},"39":{"start":{"line":254,"column":12},"end":{"line":254,"column":37}},"40":{"start":{"line":257,"column":8},"end":{"line":258,"column":39}},"41":{"start":{"line":262,"column":8},"end":{"line":262,"column":19}},"42":{"start":{"line":264,"column":8},"end":{"line":272,"column":9}},"43":{"start":{"line":265,"column":12},"end":{"line":265,"column":38}},"44":{"start":{"line":267,"column":12},"end":{"line":271,"column":13}},"45":{"start":{"line":268,"column":16},"end":{"line":268,"column":33}},"46":{"start":{"line":270,"column":16},"end":{"line":270,"column":29}},"47":{"start":{"line":274,"column":8},"end":{"line":274,"column":19}},"48":{"start":{"line":290,"column":8},"end":{"line":292,"column":20}},"49":{"start":{"line":294,"column":8},"end":{"line":302,"column":9}},"50":{"start":{"line":295,"column":12},"end":{"line":295,"column":70}},"51":{"start":{"line":296,"column":15},"end":{"line":302,"column":9}},"52":{"start":{"line":297,"column":12},"end":{"line":297,"column":45}},"53":{"start":{"line":298,"column":12},"end":{"line":298,"column":30}},"54":{"start":{"line":300,"column":12},"end":{"line":300,"column":45}},"55":{"start":{"line":301,"column":12},"end":{"line":301,"column":30}},"56":{"start":{"line":304,"column":8},"end":{"line":306,"column":10}},"57":{"start":{"line":305,"column":12},"end":{"line":305,"column":56}},"58":{"start":{"line":308,"column":8},"end":{"line":308,"column":56}},"59":{"start":{"line":310,"column":8},"end":{"line":310,"column":31}},"60":{"start":{"line":326,"column":8},"end":{"line":327,"column":42}},"61":{"start":{"line":331,"column":0},"end":{"line":331,"column":27}},"62":{"start":{"line":346,"column":0},"end":{"line":346,"column":26}},"63":{"start":{"line":348,"column":0},"end":{"line":372,"column":2}},"64":{"start":{"line":369,"column":8},"end":{"line":369,"column":42}},"65":{"start":{"line":370,"column":8},"end":{"line":370,"column":20}},"66":{"start":{"line":374,"column":0},"end":{"line":374,"column":36}}},"branchMap":{"1":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":8},"end":{"line":58,"column":8}},{"start":{"line":58,"column":8},"end":{"line":58,"column":8}}]},"2":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":12},"end":{"line":59,"column":12}},{"start":{"line":59,"column":12},"end":{"line":59,"column":12}}]},"3":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":12},"end":{"line":63,"column":12}},{"start":{"line":63,"column":12},"end":{"line":63,"column":12}}]},"4":{"line":143,"type":"if","locations":[{"start":{"line":143,"column":8},"end":{"line":143,"column":8}},{"start":{"line":143,"column":8},"end":{"line":143,"column":8}}]},"5":{"line":147,"type":"binary-expr","locations":[{"start":{"line":147,"column":8},"end":{"line":147,"column":15}},{"start":{"line":147,"column":20},"end":{"line":147,"column":32}}]},"6":{"line":149,"type":"if","locations":[{"start":{"line":149,"column":8},"end":{"line":149,"column":8}},{"start":{"line":149,"column":8},"end":{"line":149,"column":8}}]},"7":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":8},"end":{"line":166,"column":8}},{"start":{"line":166,"column":8},"end":{"line":166,"column":8}}]},"8":{"line":168,"type":"if","locations":[{"start":{"line":168,"column":15},"end":{"line":168,"column":15}},{"start":{"line":168,"column":15},"end":{"line":168,"column":15}}]},"9":{"line":177,"type":"if","locations":[{"start":{"line":177,"column":8},"end":{"line":177,"column":8}},{"start":{"line":177,"column":8},"end":{"line":177,"column":8}}]},"10":{"line":203,"type":"cond-expr","locations":[{"start":{"line":203,"column":23},"end":{"line":203,"column":25}},{"start":{"line":203,"column":29},"end":{"line":203,"column":42}}]},"11":{"line":203,"type":"cond-expr","locations":[{"start":{"line":203,"column":37},"end":{"line":203,"column":38}},{"start":{"line":203,"column":41},"end":{"line":203,"column":42}}]},"12":{"line":220,"type":"cond-expr","locations":[{"start":{"line":220,"column":23},"end":{"line":220,"column":25}},{"start":{"line":220,"column":29},"end":{"line":220,"column":42}}]},"13":{"line":220,"type":"cond-expr","locations":[{"start":{"line":220,"column":37},"end":{"line":220,"column":38}},{"start":{"line":220,"column":41},"end":{"line":220,"column":42}}]},"14":{"line":242,"type":"cond-expr","locations":[{"start":{"line":242,"column":51},"end":{"line":242,"column":69}},{"start":{"line":242,"column":72},"end":{"line":242,"column":88}}]},"15":{"line":244,"type":"if","locations":[{"start":{"line":244,"column":8},"end":{"line":244,"column":8}},{"start":{"line":244,"column":8},"end":{"line":244,"column":8}}]},"16":{"line":253,"type":"if","locations":[{"start":{"line":253,"column":8},"end":{"line":253,"column":8}},{"start":{"line":253,"column":8},"end":{"line":253,"column":8}}]},"17":{"line":254,"type":"cond-expr","locations":[{"start":{"line":254,"column":29},"end":{"line":254,"column":30}},{"start":{"line":254,"column":33},"end":{"line":254,"column":36}}]},"18":{"line":257,"type":"cond-expr","locations":[{"start":{"line":257,"column":32},"end":{"line":257,"column":52}},{"start":{"line":257,"column":55},"end":{"line":257,"column":68}}]},"19":{"line":267,"type":"if","locations":[{"start":{"line":267,"column":12},"end":{"line":267,"column":12}},{"start":{"line":267,"column":12},"end":{"line":267,"column":12}}]},"20":{"line":294,"type":"if","locations":[{"start":{"line":294,"column":8},"end":{"line":294,"column":8}},{"start":{"line":294,"column":8},"end":{"line":294,"column":8}}]},"21":{"line":294,"type":"binary-expr","locations":[{"start":{"line":294,"column":12},"end":{"line":294,"column":19}},{"start":{"line":294,"column":23},"end":{"line":294,"column":45}}]},"22":{"line":296,"type":"if","locations":[{"start":{"line":296,"column":15},"end":{"line":296,"column":15}},{"start":{"line":296,"column":15},"end":{"line":296,"column":15}}]},"23":{"line":326,"type":"cond-expr","locations":[{"start":{"line":326,"column":30},"end":{"line":326,"column":47}},{"start":{"line":326,"column":50},"end":{"line":326,"column":60}}]}},"code":["(function () { YUI.add('tree-sortable', function (Y, NAME) {","","/*jshint expr:true, onevar:false */","","/**","Extension for `Tree` that makes nodes sortable.","","@module tree","@submodule tree-sortable","@main tree-sortable","**/","","/**","Extension for `Tree` that makes nodes sortable.","","@class Tree.Sortable","@constructor","@param {Object} [config] Configuration options.","@param {Function} [config.sortComparator] Default comparator function to use","    when sorting a node's children if the node itself doesn't have a custom","    comparator function. If not specified, insertion order will be used by","    default.","@param {Boolean} [config.sortReverse=false] If `true`, node children will be","    sorted in reverse (descending) order by default. Otherwise they'll be sorted","    in ascending order.","@extensionfor Tree","**/","","/**","Fired after a node's children are re-sorted.","","@event sort","@param {Tree.Node} node Node whose children were sorted.","@param {Boolean} reverse `true` if the children were sorted in reverse","    (descending) order, `false` otherwise.","@param {String} src Source of the event.","**/","var EVT_SORT = 'sort';","","function Sortable() {}","","Sortable.prototype = {","    // -- Public Properties ----------------------------------------------------","","    /**","    If `true`, node children will be sorted in reverse (descending) order by","    default. Otherwise they'll be sorted in ascending order.","","    @property {Boolean} sortReverse","    @default false","    **/","    sortReverse: false,","","    // -- Lifecycle ------------------------------------------------------------","    initializer: function (config) {","        this.nodeExtensions = this.nodeExtensions.concat(Y.Tree.Node.Sortable);","","        if (config) {","            if (config.sortComparator) {","                this.sortComparator = config.sortComparator;","            }","","            if ('sortReverse' in config) {","                this.sortReverse = config.sortReverse;","            }","        }","    },","","    // -- Public Methods -------------------------------------------------------","","    /**","    Sorts the children of every node in this tree.","","    A `sort` event will be fired for each node whose children are sorted, which","    can get very noisy. If this is a large tree, you may want to set the","    `silent` option to `true` to suppress these events.","","    @method sort","    @param {Object} [options] Options.","        @param {Boolean} [options.silent] If `true`, no `sort` events will be","            fired.","        @param {Function} [options.sortComparator] Custom comparator function to","            use. If specified, this will become the new comparator function for","            each node, overwriting any previous comparator function that was set","            for the node.","        @param {Boolean} [options.sortReverse] If `true`, children will be","            sorted in reverse (descending) order. Otherwise they'll be sorted in","            ascending order. This will become each node's new sort order,","            overwriting any previous sort order that was set for the node.","        @param {String} [options.src] Source of the sort operation. Will be","            passed along to the `sort` event facade.","    @chainable","    **/","    sort: function (options) {","        return this.sortNode(this.rootNode, Y.merge(options, {deep: true}));","    },","","    /**","    Default comparator function to use when sorting a node's children if the","    node itself doesn't have a custom comparator function.","","    If not specified, insertion order will be used by default.","","    @method sortComparator","    @param {Tree.Node} node Node being sorted.","    @return {Number|String} Value by which the node should be sorted relative to","        its siblings.","    **/","    sortComparator: function (node) {","        return node.index();","    },","","    /**","    Sorts the children of the specified node.","","    By default, only the node's direct children are sorted. To sort all nodes in","    the hierarchy (children, children's children, etc.), set the `deep` option","    to `true`. If this is a very deep hierarchy, you may also want to set","    `silent` to true to avoid generating a flood of `sort` events.","","    @method sortNode","    @param {Tree.Node} node Node whose children should be sorted.","    @param {Object} [options] Options.","        @param {Boolean} [options.deep=false] If `true`, all of this node's","            children (and their children, and so on) will be traversed and","            re-sorted as well.","        @param {Boolean} [options.silent] If `true`, no `sort` event will be","            fired.","        @param {Function} [options.sortComparator] Custom comparator function to","            use. If specified, this will become the node's new comparator","            function, overwriting any previous comparator function that was set","            for the node.","        @param {Boolean} [options.sortReverse] If `true`, children will be","            sorted in reverse (descending) order. Otherwise they'll be sorted in","            ascending order. This will become the node's new sort order,","            overwriting any previous sort order that was set for the node.","        @param {String} [options.src] Source of the sort operation. Will be","            passed along to the `sort` event facade.","    @chainable","    **/","    sortNode: function (node, options) {","        // Nothing to do if the node has no children.","        if (!node.children.length) {","            return this;","        }","","        options || (options = {});","","        if (options.deep) {","            // Unset the `deep` option so we don't cause an infinite loop.","            options = Y.merge(options, {deep: false});","","            var self = this;","","            // Traverse and sort all nodes (including this one).","            this.traverseNode(node, function (nodeToSort) {","                self.sortNode(nodeToSort, options);","            });","","            return this;","        }","","        var comparator = this._getSortComparator(node, options),","            reverse;","","        if ('sortReverse' in options) {","            reverse = node.sortReverse = options.sortReverse;","        } else if ('sortReverse' in node) {","            reverse = node.sortReverse;","        } else {","            reverse = this.sortReverse;","        }","","        node.children.sort(Y.rbind(this._sort, this, comparator, reverse));","        node._isIndexStale = true;","","        if (!options.silent) {","            this.fire(EVT_SORT, {","                node   : node,","                reverse: !!reverse,","                src    : options.src","            });","        }","","        return this;","    },","","    // -- Protected Methods ----------------------------------------------------","","    /**","    Compares value _a_ to value _b_ for sorting purposes.","","    Values are assumed to be the result of calling a sortComparator function.","","    @method _compare","    @param {Mixed} a First value to compare.","    @param {Mixed} b Second value to compare.","    @return {Number} `-1` if _a_ should come before _b_, `0` if they're","        equivalent, `1` if _a_ should come after _b_.","    @protected","    **/","    _compare: function (a, b) {","        return a < b ? -1 : (a > b ? 1 : 0);","    },","","    /**","    Compares value _a_ to value _b_ for sorting purposes, but sorts them in","    reverse (descending) order.","","    Values are assumed to be the result of calling a sortComparator function.","","    @method _compareReverse","    @param {Mixed} a First value to compare.","    @param {Mixed} b Second value to compare.","    @return {Number} `-1` if _a_ should come before _b_, `0` if they're","        equivalent, `1` if _a_ should come after _b_.","    @protected","    **/","    _compareReverse: function (a, b) {","        return b < a ? -1 : (b > a ? 1 : 0);","    },","","    /**","    Overrides `Tree#_getDefaultNodeIndex()` to provide insertion-time sorting","    for nodes inserted without an explicit index.","","    @method _getDefaultNodeIndex","    @param {Tree.Node} parent Parent node.","    @param {Tree.Node} node Node being inserted.","    @param {Object} [options] Options passed to `insertNode()`.","    @return {Number} Index at which _node_ should be inserted into _parent_'s","        `children` array.","    @protected","    **/","    _getDefaultNodeIndex: function (parent, node) {","        /*jshint bitwise:false */","","        var children   = parent.children,","            comparator = this._getSortComparator(parent),","            max        = children.length,","            min        = 0,","            reverse    = 'sortReverse' in parent ? parent.sortReverse : this.sortReverse;","","        if (!max) {","            return max;","        }","","        // Special case: if the sortComparator is the default sortComparator,","        // cheat and just return the first or last index of the children array.","        //","        // This is necessary because the default sortComparator relies on","        // the node's index, which is always -1 for uninserted nodes.","        if (comparator._unboundComparator === Sortable.prototype.sortComparator) {","            return reverse ? 0 : max;","        }","","        var compare = reverse ? this._compareReverse : this._compare,","            needle  = comparator(node);","","        // Perform an iterative binary search to determine the correct position","        // for the node based on the return value of the comparator function.","        var middle;","","        while (min < max) {","            middle = (min + max) >> 1; // Divide by two and discard remainder.","","            if (compare(comparator(children[middle]), needle) < 0) {","                min = middle + 1;","            } else {","                max = middle;","            }","        }","","        return min;","    },","","    /**","    Returns a sort comparator function derived from the given _node_ and","    _options_, and bound to the correct `thisObj` based on where it was found.","","    @method _getSortComparator","    @param {Tree.Node} node Node on which to look for a `sortComparator`","        function.","    @param {Object} [options] Options object on which to look for a","        `sortComparator` function.","    @return {Function} Properly bound sort comparator function.","    @protected","    **/","    _getSortComparator: function (node, options) {","        var boundComparator,","            comparator,","            thisObj;","","        if (options && options.sortComparator) {","            comparator = node.sortComparator = options.sortComparator;","        } else if (node.sortComparator) {","            comparator = node.sortComparator;","            thisObj    = node;","        } else {","            comparator = this.sortComparator;","            thisObj    = this;","        }","","        boundComparator = function () {","            return comparator.apply(thisObj, arguments);","        };","","        boundComparator._unboundComparator = comparator;","","        return boundComparator;","    },","","    /**","    Array sort function used by `sortNode()` to re-sort a node's children.","","    @method _sort","    @param {Tree.Node} a First node to compare.","    @param {Tree.Node} b Second node to compare.","    @param {Function} comparator Comparator function.","    @param {Boolean} [reverse=false] If `true`, this will be a reverse","        (descending) comparison.","    @return {Number} `-1` if _a_ is less than _b_, `0` if equal, `1` if greater.","    @protected","    **/","    _sort: function (a, b, comparator, reverse) {","        return this[reverse ? '_compareReverse' : '_compare'](","            comparator(a), comparator(b));","    }","};","","Y.Tree.Sortable = Sortable;","/**","@module tree","@submodule tree-sortable","**/","","/**","`Tree.Node` extension that adds methods useful for nodes in trees that use the","`Tree.Sortable` extension.","","@class Tree.Node.Sortable","@constructor","@extensionfor Tree.Node","**/","","function NodeSortable() {}","","NodeSortable.prototype = {","    /**","    Sorts this node's children.","","    @method sort","    @param {Object} [options] Options.","        @param {Boolean} [options.silent] If `true`, no `sort` event will be","            fired.","        @param {Function} [options.sortComparator] Custom comparator function to","            use. If specified, this will become the node's new comparator","            function, overwriting any previous comparator function that was set","            for the node.","        @param {Boolean} [options.sortReverse] If `true`, children will be","            sorted in reverse (descending) order. Otherwise they'll be sorted in","            ascending order. This will become the node's new sort order,","            overwriting any previous sort order that was set for the node.","        @param {String} [options.src] Source of the sort operation. Will be","            passed along to the `sort` event facade.","    @chainable","    **/","    sort: function (options) {","        this.tree.sortNode(this, options);","        return this;","    }","};","","Y.Tree.Node.Sortable = NodeSortable;","","","}, '3.13.0', {\"requires\": [\"tree\"]});","","}());"]};
}
var __cov_fY8F3aSOoRZD9yhOq4F7Fw = __coverage__['build/tree-sortable/tree-sortable.js'];
__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['1']++;YUI.add('tree-sortable',function(Y,NAME){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['1']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['2']++;var EVT_SORT='sort';__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['3']++;function Sortable(){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['2']++;}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['4']++;Sortable.prototype={sortReverse:false,initializer:function(config){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['3']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['5']++;this.nodeExtensions=this.nodeExtensions.concat(Y.Tree.Node.Sortable);__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['6']++;if(config){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['1'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['7']++;if(config.sortComparator){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['2'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['8']++;this.sortComparator=config.sortComparator;}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['2'][1]++;}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['9']++;if('sortReverse'in config){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['3'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['10']++;this.sortReverse=config.sortReverse;}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['3'][1]++;}}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['1'][1]++;}},sort:function(options){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['4']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['11']++;return this.sortNode(this.rootNode,Y.merge(options,{deep:true}));},sortComparator:function(node){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['5']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['12']++;return node.index();},sortNode:function(node,options){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['6']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['13']++;if(!node.children.length){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['4'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['14']++;return this;}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['4'][1]++;}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['15']++;(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['5'][0]++,options)||(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['5'][1]++,options={});__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['16']++;if(options.deep){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['6'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['17']++;options=Y.merge(options,{deep:false});__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['18']++;var self=this;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['19']++;this.traverseNode(node,function(nodeToSort){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['7']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['20']++;self.sortNode(nodeToSort,options);});__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['21']++;return this;}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['6'][1]++;}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['22']++;var comparator=this._getSortComparator(node,options),reverse;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['23']++;if('sortReverse'in options){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['7'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['24']++;reverse=node.sortReverse=options.sortReverse;}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['7'][1]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['25']++;if('sortReverse'in node){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['8'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['26']++;reverse=node.sortReverse;}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['8'][1]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['27']++;reverse=this.sortReverse;}}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['28']++;node.children.sort(Y.rbind(this._sort,this,comparator,reverse));__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['29']++;node._isIndexStale=true;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['30']++;if(!options.silent){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['9'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['31']++;this.fire(EVT_SORT,{node:node,reverse:!!reverse,src:options.src});}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['9'][1]++;}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['32']++;return this;},_compare:function(a,b){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['8']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['33']++;return a<b?(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['10'][0]++,-1):(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['10'][1]++,a>b?(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['11'][0]++,1):(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['11'][1]++,0));},_compareReverse:function(a,b){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['9']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['34']++;return b<a?(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['12'][0]++,-1):(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['12'][1]++,b>a?(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['13'][0]++,1):(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['13'][1]++,0));},_getDefaultNodeIndex:function(parent,node){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['10']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['35']++;var children=parent.children,comparator=this._getSortComparator(parent),max=children.length,min=0,reverse='sortReverse'in parent?(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['14'][0]++,parent.sortReverse):(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['14'][1]++,this.sortReverse);__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['36']++;if(!max){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['15'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['37']++;return max;}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['15'][1]++;}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['38']++;if(comparator._unboundComparator===Sortable.prototype.sortComparator){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['16'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['39']++;return reverse?(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['17'][0]++,0):(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['17'][1]++,max);}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['16'][1]++;}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['40']++;var compare=reverse?(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['18'][0]++,this._compareReverse):(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['18'][1]++,this._compare),needle=comparator(node);__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['41']++;var middle;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['42']++;while(min<max){__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['43']++;middle=min+max>>1;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['44']++;if(compare(comparator(children[middle]),needle)<0){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['19'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['45']++;min=middle+1;}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['19'][1]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['46']++;max=middle;}}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['47']++;return min;},_getSortComparator:function(node,options){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['11']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['48']++;var boundComparator,comparator,thisObj;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['49']++;if((__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['21'][0]++,options)&&(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['21'][1]++,options.sortComparator)){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['20'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['50']++;comparator=node.sortComparator=options.sortComparator;}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['20'][1]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['51']++;if(node.sortComparator){__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['22'][0]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['52']++;comparator=node.sortComparator;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['53']++;thisObj=node;}else{__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['22'][1]++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['54']++;comparator=this.sortComparator;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['55']++;thisObj=this;}}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['56']++;boundComparator=function(){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['12']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['57']++;return comparator.apply(thisObj,arguments);};__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['58']++;boundComparator._unboundComparator=comparator;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['59']++;return boundComparator;},_sort:function(a,b,comparator,reverse){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['13']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['60']++;return this[reverse?(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['23'][0]++,'_compareReverse'):(__cov_fY8F3aSOoRZD9yhOq4F7Fw.b['23'][1]++,'_compare')](comparator(a),comparator(b));}};__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['61']++;Y.Tree.Sortable=Sortable;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['62']++;function NodeSortable(){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['14']++;}__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['63']++;NodeSortable.prototype={sort:function(options){__cov_fY8F3aSOoRZD9yhOq4F7Fw.f['15']++;__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['64']++;this.tree.sortNode(this,options);__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['65']++;return this;}};__cov_fY8F3aSOoRZD9yhOq4F7Fw.s['66']++;Y.Tree.Node.Sortable=NodeSortable;},'3.13.0',{'requires':['tree']});