MDL-32843 import YUI 3.5.1
[moodle.git] / lib / yui / 3.5.1 / build / yui-nodejs / yui-nodejs.js
blob5ae83dcee08b192208e0b055dd86bbc94297718f
1 /*
2 YUI 3.5.1 (build 22)
3 Copyright 2012 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
7 /**
8  * The YUI module contains the components required for building the YUI seed
9  * file.  This includes the script loading mechanism, a simple queue, and
10  * the core utilities for the library.
11  * @module yui
12  * @submodule yui-base
13  */
15 if (typeof YUI != 'undefined') {
16     YUI._YUI = YUI;
19 /**
20 The YUI global namespace object.  If YUI is already defined, the
21 existing YUI object will not be overwritten so that defined
22 namespaces are preserved.  It is the constructor for the object
23 the end user interacts with.  As indicated below, each instance
24 has full custom event support, but only if the event system
25 is available.  This is a self-instantiable factory function.  You
26 can invoke it directly like this:
28      YUI().use('*', function(Y) {
29          // ready
30      });
32 But it also works like this:
34      var Y = YUI();
36 Configuring the YUI object:
38     YUI({
39         debug: true,
40         combine: false
41     }).use('node', function(Y) {
42         //Node is ready to use
43     });
45 See the API docs for the <a href="config.html">Config</a> class
46 for the complete list of supported configuration properties accepted
47 by the YUI constuctor.
49 @class YUI
50 @constructor
51 @global
52 @uses EventTarget
53 @param [o]* {Object} 0..n optional configuration objects.  these values
54 are store in Y.config.  See <a href="config.html">Config</a> for the list of supported
55 properties.
57     /*global YUI*/
58     /*global YUI_config*/
59     var YUI = function() {
60         var i = 0,
61             Y = this,
62             args = arguments,
63             l = args.length,
64             instanceOf = function(o, type) {
65                 return (o && o.hasOwnProperty && (o instanceof type));
66             },
67             gconf = (typeof YUI_config !== 'undefined') && YUI_config;
69         if (!(instanceOf(Y, YUI))) {
70             Y = new YUI();
71         } else {
72             // set up the core environment
73             Y._init();
75             /**
76                 YUI.GlobalConfig is a master configuration that might span
77                 multiple contexts in a non-browser environment.  It is applied
78                 first to all instances in all contexts.
79                 @property GlobalConfig
80                 @type {Object}
81                 @global
82                 @static
83                 @example
86                     YUI.GlobalConfig = {
87                         filter: 'debug'
88                     };
90                     YUI().use('node', function(Y) {
91                         //debug files used here
92                     });
94                     YUI({
95                         filter: 'min'
96                     }).use('node', function(Y) {
97                         //min files used here
98                     });
100             */
101             if (YUI.GlobalConfig) {
102                 Y.applyConfig(YUI.GlobalConfig);
103             }
105             /**
106                 YUI_config is a page-level config.  It is applied to all
107                 instances created on the page.  This is applied after
108                 YUI.GlobalConfig, and before the instance level configuration
109                 objects.
110                 @global
111                 @property YUI_config
112                 @type {Object}
113                 @example
116                     //Single global var to include before YUI seed file
117                     YUI_config = {
118                         filter: 'debug'
119                     };
121                     YUI().use('node', function(Y) {
122                         //debug files used here
123                     });
125                     YUI({
126                         filter: 'min'
127                     }).use('node', function(Y) {
128                         //min files used here
129                     });
130             */
131             if (gconf) {
132                 Y.applyConfig(gconf);
133             }
135             // bind the specified additional modules for this instance
136             if (!l) {
137                 Y._setup();
138             }
139         }
141         if (l) {
142             // Each instance can accept one or more configuration objects.
143             // These are applied after YUI.GlobalConfig and YUI_Config,
144             // overriding values set in those config files if there is a '
145             // matching property.
146             for (; i < l; i++) {
147                 Y.applyConfig(args[i]);
148             }
150             Y._setup();
151         }
153         Y.instanceOf = instanceOf;
155         return Y;
156     };
158 (function() {
160     var proto, prop,
161         VERSION = '3.5.1',
162         PERIOD = '.',
163         BASE = 'http://yui.yahooapis.com/',
164         DOC_LABEL = 'yui3-js-enabled',
165         CSS_STAMP_EL = 'yui3-css-stamp',
166         NOOP = function() {},
167         SLICE = Array.prototype.slice,
168         APPLY_TO_AUTH = { 'io.xdrReady': 1,   // the functions applyTo
169                           'io.xdrResponse': 1,   // can call. this should
170                           'SWF.eventHandler': 1 }, // be done at build time
171         hasWin = (typeof window != 'undefined'),
172         win = (hasWin) ? window : null,
173         doc = (hasWin) ? win.document : null,
174         docEl = doc && doc.documentElement,
175         docClass = docEl && docEl.className,
176         instances = {},
177         time = new Date().getTime(),
178         add = function(el, type, fn, capture) {
179             if (el && el.addEventListener) {
180                 el.addEventListener(type, fn, capture);
181             } else if (el && el.attachEvent) {
182                 el.attachEvent('on' + type, fn);
183             }
184         },
185         remove = function(el, type, fn, capture) {
186             if (el && el.removeEventListener) {
187                 // this can throw an uncaught exception in FF
188                 try {
189                     el.removeEventListener(type, fn, capture);
190                 } catch (ex) {}
191             } else if (el && el.detachEvent) {
192                 el.detachEvent('on' + type, fn);
193             }
194         },
195         handleLoad = function() {
196             YUI.Env.windowLoaded = true;
197             YUI.Env.DOMReady = true;
198             if (hasWin) {
199                 remove(window, 'load', handleLoad);
200             }
201         },
202         getLoader = function(Y, o) {
203             var loader = Y.Env._loader;
204             if (loader) {
205                 //loader._config(Y.config);
206                 loader.ignoreRegistered = false;
207                 loader.onEnd = null;
208                 loader.data = null;
209                 loader.required = [];
210                 loader.loadType = null;
211             } else {
212                 loader = new Y.Loader(Y.config);
213                 Y.Env._loader = loader;
214             }
215             YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, [ 'loader-base', 'loader-rollup', 'loader-yui3' ]));
217             return loader;
218         },
220         clobber = function(r, s) {
221             for (var i in s) {
222                 if (s.hasOwnProperty(i)) {
223                     r[i] = s[i];
224                 }
225             }
226         },
228         ALREADY_DONE = { success: true };
230 //  Stamp the documentElement (HTML) with a class of "yui-loaded" to
231 //  enable styles that need to key off of JS being enabled.
232 if (docEl && docClass.indexOf(DOC_LABEL) == -1) {
233     if (docClass) {
234         docClass += ' ';
235     }
236     docClass += DOC_LABEL;
237     docEl.className = docClass;
240 if (VERSION.indexOf('@') > -1) {
241     VERSION = '3.3.0'; // dev time hack for cdn test
244 proto = {
245     /**
246      * Applies a new configuration object to the YUI instance config.
247      * This will merge new group/module definitions, and will also
248      * update the loader cache if necessary.  Updating Y.config directly
249      * will not update the cache.
250      * @method applyConfig
251      * @param {Object} o the configuration object.
252      * @since 3.2.0
253      */
254     applyConfig: function(o) {
256         o = o || NOOP;
258         var attr,
259             name,
260             // detail,
261             config = this.config,
262             mods = config.modules,
263             groups = config.groups,
264             aliases = config.aliases,
265             loader = this.Env._loader;
267         for (name in o) {
268             if (o.hasOwnProperty(name)) {
269                 attr = o[name];
270                 if (mods && name == 'modules') {
271                     clobber(mods, attr);
272                 } else if (aliases && name == 'aliases') {
273                     clobber(aliases, attr);
274                 } else if (groups && name == 'groups') {
275                     clobber(groups, attr);
276                 } else if (name == 'win') {
277                     config[name] = (attr && attr.contentWindow) || attr;
278                     config.doc = config[name] ? config[name].document : null;
279                 } else if (name == '_yuid') {
280                     // preserve the guid
281                 } else {
282                     config[name] = attr;
283                 }
284             }
285         }
287         if (loader) {
288             loader._config(o);
289         }
291     },
292     /**
293     * Old way to apply a config to the instance (calls `applyConfig` under the hood)
294     * @private
295     * @method _config
296     * @param {Object} o The config to apply
297     */
298     _config: function(o) {
299         this.applyConfig(o);
300     },
302     /**
303      * Initialize this YUI instance
304      * @private
305      * @method _init
306      */
307     _init: function() {
308         var filter, el,
309             Y = this,
310             G_ENV = YUI.Env,
311             Env = Y.Env,
312             prop;
314         /**
315          * The version number of the YUI instance.
316          * @property version
317          * @type string
318          */
319         Y.version = VERSION;
321         if (!Env) {
322             Y.Env = {
323                 core: ['get','features','intl-base','yui-log', 'yui-log-nodejs', 'yui-later','loader-base', 'loader-rollup', 'loader-yui3'],
324                 mods: {}, // flat module map
325                 versions: {}, // version module map
326                 base: BASE,
327                 cdn: BASE + VERSION + '/build/',
328                 // bootstrapped: false,
329                 _idx: 0,
330                 _used: {},
331                 _attached: {},
332                 _missed: [],
333                 _yidx: 0,
334                 _uidx: 0,
335                 _guidp: 'y',
336                 _loaded: {},
337                 // serviced: {},
338                 // Regex in English:
339                 // I'll start at the \b(simpleyui).
340                 // 1. Look in the test string for "simpleyui" or "yui" or
341                 //    "yui-base" or "yui-davglass" or "yui-foobar" that comes after a word break.  That is, it
342                 //    can't match "foyui" or "i_heart_simpleyui". This can be anywhere in the string.
343                 // 2. After #1 must come a forward slash followed by the string matched in #1, so
344                 //    "yui-base/yui-base" or "simpleyui/simpleyui" or "yui-pants/yui-pants".
345                 // 3. The second occurence of the #1 token can optionally be followed by "-debug" or "-min",
346                 //    so "yui/yui-min", "yui/yui-debug", "yui-base/yui-base-debug". NOT "yui/yui-tshirt".
347                 // 4. This is followed by ".js", so "yui/yui.js", "simpleyui/simpleyui-min.js"
348                 // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a "?" in the string,
349                 //    then capture the junk between the LAST "&" and the string in 1-4.  So
350                 //    "blah?foo/yui/yui.js" will capture "foo/" and "blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js"
351                 //    will capture "3.3.0/build/"
352                 //
353                 // Regex Exploded:
354                 // (?:\?             Find a ?
355                 //   (?:[^&]*&)      followed by 0..n characters followed by an &
356                 //   *               in fact, find as many sets of characters followed by a & as you can
357                 //   ([^&]*)         capture the stuff after the last & in \1
358                 // )?                but it's ok if all this ?junk&more_junk stuff isn't even there
359                 // \b(simpleyui|     after a word break find either the string "simpleyui" or
360                 //    yui(?:-\w+)?   the string "yui" optionally followed by a -, then more characters
361                 // )                 and store the simpleyui or yui-* string in \2
362                 // \/\2              then comes a / followed by the simpleyui or yui-* string in \2
363                 // (?:-(min|debug))? optionally followed by "-min" or "-debug"
364                 // .js               and ending in ".js"
365                 _BASE_RE: /(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,
366                 parseBasePath: function(src, pattern) {
367                     var match = src.match(pattern),
368                         path, filter;
370                     if (match) {
371                         path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));
373                         // this is to set up the path to the loader.  The file
374                         // filter for loader should match the yui include.
375                         filter = match[3];
377                         // extract correct path for mixed combo urls
378                         // http://yuilibrary.com/projects/yui3/ticket/2528423
379                         if (match[1]) {
380                             path += '?' + match[1];
381                         }
382                         path = {
383                             filter: filter,
384                             path: path
385                         }
386                     }
387                     return path;
388                 },
389                 getBase: G_ENV && G_ENV.getBase ||
390                         function(pattern) {
391                             var nodes = (doc && doc.getElementsByTagName('script')) || [],
392                                 path = Env.cdn, parsed,
393                                 i, len, src;
395                             for (i = 0, len = nodes.length; i < len; ++i) {
396                                 src = nodes[i].src;
397                                 if (src) {
398                                     parsed = Y.Env.parseBasePath(src, pattern);
399                                     if (parsed) {
400                                         filter = parsed.filter;
401                                         path = parsed.path;
402                                         break;
403                                     }
404                                 }
405                             }
407                             // use CDN default
408                             return path;
409                         }
411             };
413             Env = Y.Env;
415             Env._loaded[VERSION] = {};
417             if (G_ENV && Y !== YUI) {
418                 Env._yidx = ++G_ENV._yidx;
419                 Env._guidp = ('yui_' + VERSION + '_' +
420                              Env._yidx + '_' + time).replace(/\./g, '_');
421             } else if (YUI._YUI) {
423                 G_ENV = YUI._YUI.Env;
424                 Env._yidx += G_ENV._yidx;
425                 Env._uidx += G_ENV._uidx;
427                 for (prop in G_ENV) {
428                     if (!(prop in Env)) {
429                         Env[prop] = G_ENV[prop];
430                     }
431                 }
433                 delete YUI._YUI;
434             }
436             Y.id = Y.stamp(Y);
437             instances[Y.id] = Y;
439         }
441         Y.constructor = YUI;
443         // configuration defaults
444         Y.config = Y.config || {
445             bootstrap: true,
446             cacheUse: true,
447             debug: true,
448             doc: doc,
449             fetchCSS: true,
450             throwFail: true,
451             useBrowserConsole: true,
452             useNativeES5: true,
453             win: win
454         };
456         //Register the CSS stamp element
457         if (doc && !doc.getElementById(CSS_STAMP_EL)) {
458             el = doc.createElement('div');
459             el.innerHTML = '<div id="' + CSS_STAMP_EL + '" style="position: absolute !important; visibility: hidden !important"></div>';
460             YUI.Env.cssStampEl = el.firstChild;
461             docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);
462         }
464         Y.config.lang = Y.config.lang || 'en-US';
466         Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);
468         if (!filter || (!('mindebug').indexOf(filter))) {
469             filter = 'min';
470         }
471         filter = (filter) ? '-' + filter : filter;
472         Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';
474     },
476     /**
477      * Finishes the instance setup. Attaches whatever modules were defined
478      * when the yui modules was registered.
479      * @method _setup
480      * @private
481      */
482     _setup: function(o) {
483         var i, Y = this,
484             core = [],
485             mods = YUI.Env.mods,
486             //extras = Y.config.core || ['get','features','intl-base','yui-log', 'yui-log-nodejs', 'yui-later','loader-base', 'loader-rollup', 'loader-yui3'];
487             extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..
489         for (i = 0; i < extras.length; i++) {
490             if (mods[extras[i]]) {
491                 core.push(extras[i]);
492             }
493         }
495         Y._attach(['yui-base']);
496         Y._attach(core);
498         if (Y.Loader) {
499             getLoader(Y);
500         }
502     },
504     /**
505      * Executes a method on a YUI instance with
506      * the specified id if the specified method is whitelisted.
507      * @method applyTo
508      * @param id {String} the YUI instance id.
509      * @param method {String} the name of the method to exectute.
510      * Ex: 'Object.keys'.
511      * @param args {Array} the arguments to apply to the method.
512      * @return {Object} the return value from the applied method or null.
513      */
514     applyTo: function(id, method, args) {
515         if (!(method in APPLY_TO_AUTH)) {
516             this.log(method + ': applyTo not allowed', 'warn', 'yui');
517             return null;
518         }
520         var instance = instances[id], nest, m, i;
521         if (instance) {
522             nest = method.split('.');
523             m = instance;
524             for (i = 0; i < nest.length; i = i + 1) {
525                 m = m[nest[i]];
526                 if (!m) {
527                     this.log('applyTo not found: ' + method, 'warn', 'yui');
528                 }
529             }
530             return m && m.apply(instance, args);
531         }
533         return null;
534     },
537 Registers a module with the YUI global.  The easiest way to create a
538 first-class YUI module is to use the YUI component build tool.
540 http://yuilibrary.com/projects/builder
542 The build system will produce the `YUI.add` wrapper for you module, along
543 with any configuration info required for the module.
544 @method add
545 @param name {String} module name.
546 @param fn {Function} entry point into the module that is used to bind module to the YUI instance.
547 @param {YUI} fn.Y The YUI instance this module is executed in.
548 @param {String} fn.name The name of the module
549 @param version {String} version string.
550 @param details {Object} optional config data:
551 @param details.requires {Array} features that must be present before this module can be attached.
552 @param details.optional {Array} optional features that should be present if loadOptional
553  is defined.  Note: modules are not often loaded this way in YUI 3,
554  but this field is still useful to inform the user that certain
555  features in the component will require additional dependencies.
556 @param details.use {Array} features that are included within this module which need to
557  be attached automatically when this module is attached.  This
558  supports the YUI 3 rollup system -- a module with submodules
559  defined will need to have the submodules listed in the 'use'
560  config.  The YUI component build tool does this for you.
561 @return {YUI} the YUI instance.
562 @example
564     YUI.add('davglass', function(Y, name) {
565         Y.davglass = function() {
566             alert('Dav was here!');
567         };
568     }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });
571     add: function(name, fn, version, details) {
572         details = details || {};
573         var env = YUI.Env,
574             mod = {
575                 name: name,
576                 fn: fn,
577                 version: version,
578                 details: details
579             },
580             loader,
581             i, versions = env.versions;
583         env.mods[name] = mod;
584         versions[version] = versions[version] || {};
585         versions[version][name] = mod;
587         for (i in instances) {
588             if (instances.hasOwnProperty(i)) {
589                 loader = instances[i].Env._loader;
590                 if (loader) {
591                     if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {
592                         loader.addModule(details, name);
593                     }
594                 }
595             }
596         }
598         return this;
599     },
601     /**
602      * Executes the function associated with each required
603      * module, binding the module to the YUI instance.
604      * @param {Array} r The array of modules to attach
605      * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached
606      * @method _attach
607      * @private
608      */
609     _attach: function(r, moot) {
610         var i, name, mod, details, req, use, after,
611             mods = YUI.Env.mods,
612             aliases = YUI.Env.aliases,
613             Y = this, j,
614             loader = Y.Env._loader,
615             done = Y.Env._attached,
616             len = r.length, loader,
617             c = [];
619         //Check for conditional modules (in a second+ instance) and add their requirements
620         //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass
621         for (i = 0; i < len; i++) {
622             name = r[i];
623             mod = mods[name];
624             c.push(name);
625             if (loader && loader.conditions[name]) {
626                 Y.Object.each(loader.conditions[name], function(def) {
627                     var go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));
628                     if (go) {
629                         c.push(def.name);
630                     }
631                 });
632             }
633         }
634         r = c;
635         len = r.length;
637         for (i = 0; i < len; i++) {
638             if (!done[r[i]]) {
639                 name = r[i];
640                 mod = mods[name];
642                 if (aliases && aliases[name]) {
643                     Y._attach(aliases[name]);
644                     continue;
645                 }
646                 if (!mod) {
647                     if (loader && loader.moduleInfo[name]) {
648                         mod = loader.moduleInfo[name];
649                         moot = true;
650                     }
653                     //if (!loader || !loader.moduleInfo[name]) {
654                     //if ((!loader || !loader.moduleInfo[name]) && !moot) {
655                     if (!moot && name) {
656                         if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
657                             Y.Env._missed.push(name);
658                             Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
659                             Y.message('NOT loaded: ' + name, 'warn', 'yui');
660                         }
661                     }
662                 } else {
663                     done[name] = true;
664                     //Don't like this, but in case a mod was asked for once, then we fetch it
665                     //We need to remove it from the missed list ^davglass
666                     for (j = 0; j < Y.Env._missed.length; j++) {
667                         if (Y.Env._missed[j] === name) {
668                             Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');
669                             Y.Env._missed.splice(j, 1);
670                         }
671                     }
672                     details = mod.details;
673                     req = details.requires;
674                     use = details.use;
675                     after = details.after;
677                     if (req) {
678                         for (j = 0; j < req.length; j++) {
679                             if (!done[req[j]]) {
680                                 if (!Y._attach(req)) {
681                                     return false;
682                                 }
683                                 break;
684                             }
685                         }
686                     }
688                     if (after) {
689                         for (j = 0; j < after.length; j++) {
690                             if (!done[after[j]]) {
691                                 if (!Y._attach(after, true)) {
692                                     return false;
693                                 }
694                                 break;
695                             }
696                         }
697                     }
699                     if (mod.fn) {
700                         try {
701                             mod.fn(Y, name);
702                         } catch (e) {
703                             Y.error('Attach error: ' + name, e, name);
704                             return false;
705                         }
706                     }
708                     if (use) {
709                         for (j = 0; j < use.length; j++) {
710                             if (!done[use[j]]) {
711                                 if (!Y._attach(use)) {
712                                     return false;
713                                 }
714                                 break;
715                             }
716                         }
717                     }
721                 }
722             }
723         }
725         return true;
726     },
728     /**
729      * Attaches one or more modules to the YUI instance.  When this
730      * is executed, the requirements are analyzed, and one of
731      * several things can happen:
732      *
733      *  * All requirements are available on the page --  The modules
734      *   are attached to the instance.  If supplied, the use callback
735      *   is executed synchronously.
736      *
737      *  * Modules are missing, the Get utility is not available OR
738      *   the 'bootstrap' config is false -- A warning is issued about
739      *   the missing modules and all available modules are attached.
740      *
741      *  * Modules are missing, the Loader is not available but the Get
742      *   utility is and boostrap is not false -- The loader is bootstrapped
743      *   before doing the following....
744      *
745      *  * Modules are missing and the Loader is available -- The loader
746      *   expands the dependency tree and fetches missing modules.  When
747      *   the loader is finshed the callback supplied to use is executed
748      *   asynchronously.
749      *
750      * @method use
751      * @param modules* {String|Array} 1-n modules to bind (uses arguments array).
752      * @param [callback] {Function} callback function executed when
753      * the instance has the required functionality.  If included, it
754      * must be the last parameter.
755      * @param callback.Y {YUI} The `YUI` instance created for this sandbox
756      * @param callback.data {Object} Object data returned from `Loader`.
757      *
758      * @example
759      *      // loads and attaches dd and its dependencies
760      *      YUI().use('dd', function(Y) {});
761      *
762      *      // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)
763      *      YUI().use(['dd', 'node'], function(Y) {});
764      *
765      *      // attaches all modules that are available on the page
766      *      YUI().use('*', function(Y) {});
767      *
768      *      // intrinsic YUI gallery support (since 3.1.0)
769      *      YUI().use('gallery-yql', function(Y) {});
770      *
771      *      // intrinsic YUI 2in3 support (since 3.1.0)
772      *      YUI().use('yui2-datatable', function(Y) {});
773      *
774      * @return {YUI} the YUI instance.
775      */
776     use: function() {
777         var args = SLICE.call(arguments, 0),
778             callback = args[args.length - 1],
779             Y = this,
780             i = 0,
781             a = [],
782             name,
783             Env = Y.Env,
784             provisioned = true;
786         // The last argument supplied to use can be a load complete callback
787         if (Y.Lang.isFunction(callback)) {
788             args.pop();
789         } else {
790             callback = null;
791         }
792         if (Y.Lang.isArray(args[0])) {
793             args = args[0];
794         }
796         if (Y.config.cacheUse) {
797             while ((name = args[i++])) {
798                 if (!Env._attached[name]) {
799                     provisioned = false;
800                     break;
801                 }
802             }
804             if (provisioned) {
805                 if (args.length) {
806                 }
807                 Y._notify(callback, ALREADY_DONE, args);
808                 return Y;
809             }
810         }
812         if (Y._loading) {
813             Y._useQueue = Y._useQueue || new Y.Queue();
814             Y._useQueue.add([args, callback]);
815         } else {
816             Y._use(args, function(Y, response) {
817                 Y._notify(callback, response, args);
818             });
819         }
821         return Y;
822     },
823     /**
824     * Notify handler from Loader for attachment/load errors
825     * @method _notify
826     * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`
827     * @param response {Object} The response returned from Loader
828     * @param args {Array} The aruments passed from Loader
829     * @private
830     */
831     _notify: function(callback, response, args) {
832         if (!response.success && this.config.loadErrorFn) {
833             this.config.loadErrorFn.call(this, this, callback, response, args);
834         } else if (callback) {
835             try {
836                 callback(this, response);
837             } catch (e) {
838                 this.error('use callback error', e, args);
839             }
840         }
841     },
843     /**
844     * This private method is called from the `use` method queue. To ensure that only one set of loading
845     * logic is performed at a time.
846     * @method _use
847     * @private
848     * @param args* {String} 1-n modules to bind (uses arguments array).
849     * @param *callback {Function} callback function executed when
850     * the instance has the required functionality.  If included, it
851     * must be the last parameter.
852     */
853     _use: function(args, callback) {
855         if (!this.Array) {
856             this._attach(['yui-base']);
857         }
859         var len, loader, handleBoot, handleRLS,
860             Y = this,
861             G_ENV = YUI.Env,
862             mods = G_ENV.mods,
863             Env = Y.Env,
864             used = Env._used,
865             aliases = G_ENV.aliases,
866             queue = G_ENV._loaderQueue,
867             firstArg = args[0],
868             YArray = Y.Array,
869             config = Y.config,
870             boot = config.bootstrap,
871             missing = [],
872             r = [],
873             ret = true,
874             fetchCSS = config.fetchCSS,
875             process = function(names, skip) {
877                 var i = 0, a = [];
879                 if (!names.length) {
880                     return;
881                 }
883                 if (aliases) {
884                     for (i = 0; i < names.length; i++) {
885                         if (aliases[names[i]]) {
886                             a = [].concat(a, aliases[names[i]]);
887                         } else {
888                             a.push(names[i]);
889                         }
890                     }
891                     names = a;
892                 }
894                 YArray.each(names, function(name) {
896                     // add this module to full list of things to attach
897                     if (!skip) {
898                         r.push(name);
899                     }
901                     // only attach a module once
902                     if (used[name]) {
903                         return;
904                     }
906                     var m = mods[name], req, use;
908                     if (m) {
909                         used[name] = true;
910                         req = m.details.requires;
911                         use = m.details.use;
912                     } else {
913                         // CSS files don't register themselves, see if it has
914                         // been loaded
915                         if (!G_ENV._loaded[VERSION][name]) {
916                             missing.push(name);
917                         } else {
918                             used[name] = true; // probably css
919                         }
920                     }
922                     // make sure requirements are attached
923                     if (req && req.length) {
924                         process(req);
925                     }
927                     // make sure we grab the submodule dependencies too
928                     if (use && use.length) {
929                         process(use, 1);
930                     }
931                 });
932             },
934             handleLoader = function(fromLoader) {
935                 var response = fromLoader || {
936                         success: true,
937                         msg: 'not dynamic'
938                     },
939                     redo, origMissing,
940                     ret = true,
941                     data = response.data;
943                 Y._loading = false;
945                 if (data) {
946                     origMissing = missing;
947                     missing = [];
948                     r = [];
949                     process(data);
950                     redo = missing.length;
951                     if (redo) {
952                         if (missing.sort().join() ==
953                                 origMissing.sort().join()) {
954                             redo = false;
955                         }
956                     }
957                 }
959                 if (redo && data) {
960                     Y._loading = true;
961                     Y._use(missing, function() {
962                         if (Y._attach(data)) {
963                             Y._notify(callback, response, data);
964                         }
965                     });
966                 } else {
967                     if (data) {
968                         ret = Y._attach(data);
969                     }
970                     if (ret) {
971                         Y._notify(callback, response, args);
972                     }
973                 }
975                 if (Y._useQueue && Y._useQueue.size() && !Y._loading) {
976                     Y._use.apply(Y, Y._useQueue.next());
977                 }
979             };
982         // YUI().use('*'); // bind everything available
983         if (firstArg === '*') {
984             ret = Y._attach(Y.Object.keys(mods));
985             if (ret) {
986                 handleLoader();
987             }
988             return Y;
989         }
991         if (mods['loader'] && !Y.Loader) {
992             Y._attach(['loader']);
993         }
996         // use loader to expand dependencies and sort the
997         // requirements if it is available.
998         if (boot && Y.Loader && args.length) {
999             loader = getLoader(Y);
1000             loader.require(args);
1001             loader.ignoreRegistered = true;
1002             loader._boot = true;
1003             loader.calculate(null, (fetchCSS) ? null : 'js');
1004             args = loader.sorted;
1005             loader._boot = false;
1006         }
1008         // process each requirement and any additional requirements
1009         // the module metadata specifies
1010         process(args);
1012         len = missing.length;
1014         if (len) {
1015             missing = Y.Object.keys(YArray.hash(missing));
1016             len = missing.length;
1017         }
1020         // dynamic load
1021         if (boot && len && Y.Loader) {
1022             Y._loading = true;
1023             loader = getLoader(Y);
1024             loader.onEnd = handleLoader;
1025             loader.context = Y;
1026             loader.data = args;
1027             loader.ignoreRegistered = false;
1028             loader.require(args);
1029             loader.insert(null, (fetchCSS) ? null : 'js');
1031         } else if (boot && len && Y.Get && !Env.bootstrapped) {
1033             Y._loading = true;
1035             handleBoot = function() {
1036                 Y._loading = false;
1037                 queue.running = false;
1038                 Env.bootstrapped = true;
1039                 G_ENV._bootstrapping = false;
1040                 if (Y._attach(['loader'])) {
1041                     Y._use(args, callback);
1042                 }
1043             };
1045             if (G_ENV._bootstrapping) {
1046                 queue.add(handleBoot);
1047             } else {
1048                 G_ENV._bootstrapping = true;
1049                 Y.Get.script(config.base + config.loaderPath, {
1050                     onEnd: handleBoot
1051                 });
1052             }
1054         } else {
1055             ret = Y._attach(args);
1056             if (ret) {
1057                 handleLoader();
1058             }
1059         }
1061         return Y;
1062     },
1065     /**
1066     Adds a namespace object onto the YUI global if called statically.
1068         // creates YUI.your.namespace.here as nested objects
1069         YUI.namespace("your.namespace.here");
1071     If called as a method on a YUI <em>instance</em>, it creates the
1072     namespace on the instance.
1074          // creates Y.property.package
1075          Y.namespace("property.package");
1077     Dots in the input string cause `namespace` to create nested objects for
1078     each token. If any part of the requested namespace already exists, the
1079     current object will be left in place.  This allows multiple calls to
1080     `namespace` to preserve existing namespaced properties.
1082     If the first token in the namespace string is "YAHOO", the token is
1083     discarded.
1085     Be careful with namespace tokens. Reserved words may work in some browsers
1086     and not others. For instance, the following will fail in some browsers
1087     because the supported version of JavaScript reserves the word "long":
1089          Y.namespace("really.long.nested.namespace");
1091     <em>Note: If you pass multiple arguments to create multiple namespaces, only
1092     the last one created is returned from this function.</em>
1094     @method namespace
1095     @param  {String} namespace* namespaces to create.
1096     @return {Object}  A reference to the last namespace object created.
1097     **/
1098     namespace: function() {
1099         var a = arguments, o, i = 0, j, d, arg;
1101         for (; i < a.length; i++) {
1102             o = this; //Reset base object per argument or it will get reused from the last
1103             arg = a[i];
1104             if (arg.indexOf(PERIOD) > -1) { //Skip this if no "." is present
1105                 d = arg.split(PERIOD);
1106                 for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {
1107                     o[d[j]] = o[d[j]] || {};
1108                     o = o[d[j]];
1109                 }
1110             } else {
1111                 o[arg] = o[arg] || {};
1112                 o = o[arg]; //Reset base object to the new object so it's returned
1113             }
1114         }
1115         return o;
1116     },
1118     // this is replaced if the log module is included
1119     log: NOOP,
1120     message: NOOP,
1121     // this is replaced if the dump module is included
1122     dump: function (o) { return ''+o; },
1124     /**
1125      * Report an error.  The reporting mechanism is controlled by
1126      * the `throwFail` configuration attribute.  If throwFail is
1127      * not specified, the message is written to the Logger, otherwise
1128      * a JS error is thrown. If an `errorFn` is specified in the config
1129      * it must return `true` to keep the error from being thrown.
1130      * @method error
1131      * @param msg {String} the error message.
1132      * @param e {Error|String} Optional JS error that was caught, or an error string.
1133      * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)
1134      * and `throwFail` is specified, this error will be re-thrown.
1135      * @return {YUI} this YUI instance.
1136      */
1137     error: function(msg, e, src) {
1138         //TODO Add check for window.onerror here
1140         var Y = this, ret;
1142         if (Y.config.errorFn) {
1143             ret = Y.config.errorFn.apply(Y, arguments);
1144         }
1146         if (Y.config.throwFail && !ret) {
1147             throw (e || new Error(msg));
1148         } else {
1149             Y.message(msg, 'error', ''+src); // don't scrub this one
1150         }
1152         return Y;
1153     },
1155     /**
1156      * Generate an id that is unique among all YUI instances
1157      * @method guid
1158      * @param pre {String} optional guid prefix.
1159      * @return {String} the guid.
1160      */
1161     guid: function(pre) {
1162         var id = this.Env._guidp + '_' + (++this.Env._uidx);
1163         return (pre) ? (pre + id) : id;
1164     },
1166     /**
1167      * Returns a `guid` associated with an object.  If the object
1168      * does not have one, a new one is created unless `readOnly`
1169      * is specified.
1170      * @method stamp
1171      * @param o {Object} The object to stamp.
1172      * @param readOnly {Boolean} if `true`, a valid guid will only
1173      * be returned if the object has one assigned to it.
1174      * @return {String} The object's guid or null.
1175      */
1176     stamp: function(o, readOnly) {
1177         var uid;
1178         if (!o) {
1179             return o;
1180         }
1182         // IE generates its own unique ID for dom nodes
1183         // The uniqueID property of a document node returns a new ID
1184         if (o.uniqueID && o.nodeType && o.nodeType !== 9) {
1185             uid = o.uniqueID;
1186         } else {
1187             uid = (typeof o === 'string') ? o : o._yuid;
1188         }
1190         if (!uid) {
1191             uid = this.guid();
1192             if (!readOnly) {
1193                 try {
1194                     o._yuid = uid;
1195                 } catch (e) {
1196                     uid = null;
1197                 }
1198             }
1199         }
1200         return uid;
1201     },
1203     /**
1204      * Destroys the YUI instance
1205      * @method destroy
1206      * @since 3.3.0
1207      */
1208     destroy: function() {
1209         var Y = this;
1210         if (Y.Event) {
1211             Y.Event._unload();
1212         }
1213         delete instances[Y.id];
1214         delete Y.Env;
1215         delete Y.config;
1216     }
1218     /**
1219      * instanceof check for objects that works around
1220      * memory leak in IE when the item tested is
1221      * window/document
1222      * @method instanceOf
1223      * @param o {Object} The object to check.
1224      * @param type {Object} The class to check against.
1225      * @since 3.3.0
1226      */
1229     YUI.prototype = proto;
1231     // inheritance utilities are not available yet
1232     for (prop in proto) {
1233         if (proto.hasOwnProperty(prop)) {
1234             YUI[prop] = proto[prop];
1235         }
1236     }
1238     /**
1239 Static method on the Global YUI object to apply a config to all YUI instances.
1240 It's main use case is "mashups" where several third party scripts are trying to write to
1241 a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of
1242 overwriting other scripts configs.
1243 @static
1244 @since 3.5.0
1245 @method applyConfig
1246 @param {Object} o the configuration object.
1247 @example
1249     YUI.applyConfig({
1250         modules: {
1251             davglass: {
1252                 fullpath: './davglass.js'
1253             }
1254         }
1255     });
1257     YUI.applyConfig({
1258         modules: {
1259             foo: {
1260                 fullpath: './foo.js'
1261             }
1262         }
1263     });
1265     YUI().use('davglass', function(Y) {
1266         //Module davglass will be available here..
1267     });
1269     */
1270     YUI.applyConfig = function(o) {
1271         if (!o) {
1272             return;
1273         }
1274         //If there is a GlobalConfig, apply it first to set the defaults
1275         if (YUI.GlobalConfig) {
1276             this.prototype.applyConfig.call(this, YUI.GlobalConfig);
1277         }
1278         //Apply this config to it
1279         this.prototype.applyConfig.call(this, o);
1280         //Reset GlobalConfig to the combined config
1281         YUI.GlobalConfig = this.config;
1282     };
1284     // set up the environment
1285     YUI._init();
1287     if (hasWin) {
1288         // add a window load event at load time so we can capture
1289         // the case where it fires before dynamic loading is
1290         // complete.
1291         add(window, 'load', handleLoad);
1292     } else {
1293         handleLoad();
1294     }
1296     YUI.Env.add = add;
1297     YUI.Env.remove = remove;
1299     /*global exports*/
1300     // Support the CommonJS method for exporting our single global
1301     if (typeof exports == 'object') {
1302         exports.YUI = YUI;
1303     }
1305 }());
1309  * The config object contains all of the configuration options for
1310  * the `YUI` instance.  This object is supplied by the implementer
1311  * when instantiating a `YUI` instance.  Some properties have default
1312  * values if they are not supplied by the implementer.  This should
1313  * not be updated directly because some values are cached.  Use
1314  * `applyConfig()` to update the config object on a YUI instance that
1315  * has already been configured.
1317  * @class config
1318  * @static
1319  */
1322  * Allows the YUI seed file to fetch the loader component and library
1323  * metadata to dynamically load additional dependencies.
1325  * @property bootstrap
1326  * @type boolean
1327  * @default true
1328  */
1331  * Turns on writing Ylog messages to the browser console.
1333  * @property debug
1334  * @type boolean
1335  * @default true
1336  */
1339  * Log to the browser console if debug is on and the browser has a
1340  * supported console.
1342  * @property useBrowserConsole
1343  * @type boolean
1344  * @default true
1345  */
1348  * A hash of log sources that should be logged.  If specified, only
1349  * log messages from these sources will be logged.
1351  * @property logInclude
1352  * @type object
1353  */
1356  * A hash of log sources that should be not be logged.  If specified,
1357  * all sources are logged if not on this list.
1359  * @property logExclude
1360  * @type object
1361  */
1364  * Set to true if the yui seed file was dynamically loaded in
1365  * order to bootstrap components relying on the window load event
1366  * and the `domready` custom event.
1368  * @property injected
1369  * @type boolean
1370  * @default false
1371  */
1374  * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error.
1375  * Otherwise the failure is logged.
1377  * @property throwFail
1378  * @type boolean
1379  * @default true
1380  */
1383  * The window/frame that this instance should operate in.
1385  * @property win
1386  * @type Window
1387  * @default the window hosting YUI
1388  */
1391  * The document associated with the 'win' configuration.
1393  * @property doc
1394  * @type Document
1395  * @default the document hosting YUI
1396  */
1399  * A list of modules that defines the YUI core (overrides the default list).
1401  * @property core
1402  * @type Array
1403  * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]
1404  */
1407  * A list of languages in order of preference. This list is matched against
1408  * the list of available languages in modules that the YUI instance uses to
1409  * determine the best possible localization of language sensitive modules.
1410  * Languages are represented using BCP 47 language tags, such as "en-GB" for
1411  * English as used in the United Kingdom, or "zh-Hans-CN" for simplified
1412  * Chinese as used in China. The list can be provided as a comma-separated
1413  * list or as an array.
1415  * @property lang
1416  * @type string|string[]
1417  */
1420  * The default date format
1421  * @property dateFormat
1422  * @type string
1423  * @deprecated use configuration in `DataType.Date.format()` instead.
1424  */
1427  * The default locale
1428  * @property locale
1429  * @type string
1430  * @deprecated use `config.lang` instead.
1431  */
1434  * The default interval when polling in milliseconds.
1435  * @property pollInterval
1436  * @type int
1437  * @default 20
1438  */
1441  * The number of dynamic nodes to insert by default before
1442  * automatically removing them.  This applies to script nodes
1443  * because removing the node will not make the evaluated script
1444  * unavailable.  Dynamic CSS is not auto purged, because removing
1445  * a linked style sheet will also remove the style definitions.
1446  * @property purgethreshold
1447  * @type int
1448  * @default 20
1449  */
1452  * The default interval when polling in milliseconds.
1453  * @property windowResizeDelay
1454  * @type int
1455  * @default 40
1456  */
1459  * Base directory for dynamic loading
1460  * @property base
1461  * @type string
1462  */
1465  * The secure base dir (not implemented)
1466  * For dynamic loading.
1467  * @property secureBase
1468  * @type string
1469  */
1472  * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`
1473  * For dynamic loading.
1474  * @property comboBase
1475  * @type string
1476  */
1479  * The root path to prepend to module path for the combo service.
1480  * Ex: 3.0.0b1/build/
1481  * For dynamic loading.
1482  * @property root
1483  * @type string
1484  */
1487  * A filter to apply to result urls.  This filter will modify the default
1488  * path for all modules.  The default path for the YUI library is the
1489  * minified version of the files (e.g., event-min.js).  The filter property
1490  * can be a predefined filter or a custom filter.  The valid predefined
1491  * filters are:
1492  * <dl>
1493  *  <dt>DEBUG</dt>
1494  *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
1495  *      This option will automatically include the Logger widget</dd>
1496  *  <dt>RAW</dt>
1497  *  <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
1498  * </dl>
1499  * You can also define a custom filter, which must be an object literal
1500  * containing a search expression and a replace string:
1502  *      myFilter: {
1503  *          'searchExp': "-min\\.js",
1504  *          'replaceStr': "-debug.js"
1505  *      }
1507  * For dynamic loading.
1509  * @property filter
1510  * @type string|object
1511  */
1514  * The `skin` config let's you configure application level skin
1515  * customizations.  It contains the following attributes which
1516  * can be specified to override the defaults:
1518  *      // The default skin, which is automatically applied if not
1519  *      // overriden by a component-specific skin definition.
1520  *      // Change this in to apply a different skin globally
1521  *      defaultSkin: 'sam',
1523  *      // This is combined with the loader base property to get
1524  *      // the default root directory for a skin.
1525  *      base: 'assets/skins/',
1527  *      // Any component-specific overrides can be specified here,
1528  *      // making it possible to load different skins for different
1529  *      // components.  It is possible to load more than one skin
1530  *      // for a given component as well.
1531  *      overrides: {
1532  *          slider: ['capsule', 'round']
1533  *      }
1535  * For dynamic loading.
1537  *  @property skin
1538  */
1541  * Hash of per-component filter specification.  If specified for a given
1542  * component, this overrides the filter config.
1544  * For dynamic loading.
1546  * @property filters
1547  */
1550  * Use the YUI combo service to reduce the number of http connections
1551  * required to load your dependencies.  Turning this off will
1552  * disable combo handling for YUI and all module groups configured
1553  * with a combo service.
1555  * For dynamic loading.
1557  * @property combine
1558  * @type boolean
1559  * @default true if 'base' is not supplied, false if it is.
1560  */
1563  * A list of modules that should never be dynamically loaded
1565  * @property ignore
1566  * @type string[]
1567  */
1570  * A list of modules that should always be loaded when required, even if already
1571  * present on the page.
1573  * @property force
1574  * @type string[]
1575  */
1578  * Node or id for a node that should be used as the insertion point for new
1579  * nodes.  For dynamic loading.
1581  * @property insertBefore
1582  * @type string
1583  */
1586  * Object literal containing attributes to add to dynamically loaded script
1587  * nodes.
1588  * @property jsAttributes
1589  * @type string
1590  */
1593  * Object literal containing attributes to add to dynamically loaded link
1594  * nodes.
1595  * @property cssAttributes
1596  * @type string
1597  */
1600  * Number of milliseconds before a timeout occurs when dynamically
1601  * loading nodes. If not set, there is no timeout.
1602  * @property timeout
1603  * @type int
1604  */
1607  * Callback for the 'CSSComplete' event.  When dynamically loading YUI
1608  * components with CSS, this property fires when the CSS is finished
1609  * loading but script loading is still ongoing.  This provides an
1610  * opportunity to enhance the presentation of a loading page a little
1611  * bit before the entire loading process is done.
1613  * @property onCSS
1614  * @type function
1615  */
1618  * A hash of module definitions to add to the list of YUI components.
1619  * These components can then be dynamically loaded side by side with
1620  * YUI via the `use()` method. This is a hash, the key is the module
1621  * name, and the value is an object literal specifying the metdata
1622  * for the module.  See `Loader.addModule` for the supported module
1623  * metadata fields.  Also see groups, which provides a way to
1624  * configure the base and combo spec for a set of modules.
1626  *      modules: {
1627  *          mymod1: {
1628  *              requires: ['node'],
1629  *              fullpath: '/mymod1/mymod1.js'
1630  *          },
1631  *          mymod2: {
1632  *              requires: ['mymod1'],
1633  *              fullpath: '/mymod2/mymod2.js'
1634  *          },
1635  *          mymod3: '/js/mymod3.js',
1636  *          mycssmod: '/css/mycssmod.css'
1637  *      }
1640  * @property modules
1641  * @type object
1642  */
1645  * Aliases are dynamic groups of modules that can be used as
1646  * shortcuts.
1648  *      YUI({
1649  *          aliases: {
1650  *              davglass: [ 'node', 'yql', 'dd' ],
1651  *              mine: [ 'davglass', 'autocomplete']
1652  *          }
1653  *      }).use('mine', function(Y) {
1654  *          //Node, YQL, DD &amp; AutoComplete available here..
1655  *      });
1657  * @property aliases
1658  * @type object
1659  */
1662  * A hash of module group definitions.  It for each group you
1663  * can specify a list of modules and the base path and
1664  * combo spec to use when dynamically loading the modules.
1666  *      groups: {
1667  *          yui2: {
1668  *              // specify whether or not this group has a combo service
1669  *              combine: true,
1671  *              // The comboSeperator to use with this group's combo handler
1672  *              comboSep: ';',
1674  *              // The maxURLLength for this server
1675  *              maxURLLength: 500,
1677  *              // the base path for non-combo paths
1678  *              base: 'http://yui.yahooapis.com/2.8.0r4/build/',
1680  *              // the path to the combo service
1681  *              comboBase: 'http://yui.yahooapis.com/combo?',
1683  *              // a fragment to prepend to the path attribute when
1684  *              // when building combo urls
1685  *              root: '2.8.0r4/build/',
1687  *              // the module definitions
1688  *              modules:  {
1689  *                  yui2_yde: {
1690  *                      path: "yahoo-dom-event/yahoo-dom-event.js"
1691  *                  },
1692  *                  yui2_anim: {
1693  *                      path: "animation/animation.js",
1694  *                      requires: ['yui2_yde']
1695  *                  }
1696  *              }
1697  *          }
1698  *      }
1700  * @property groups
1701  * @type object
1702  */
1705  * The loader 'path' attribute to the loader itself.  This is combined
1706  * with the 'base' attribute to dynamically load the loader component
1707  * when boostrapping with the get utility alone.
1709  * @property loaderPath
1710  * @type string
1711  * @default loader/loader-min.js
1712  */
1715  * Specifies whether or not YUI().use(...) will attempt to load CSS
1716  * resources at all.  Any truthy value will cause CSS dependencies
1717  * to load when fetching script.  The special value 'force' will
1718  * cause CSS dependencies to be loaded even if no script is needed.
1720  * @property fetchCSS
1721  * @type boolean|string
1722  * @default true
1723  */
1726  * The default gallery version to build gallery module urls
1727  * @property gallery
1728  * @type string
1729  * @since 3.1.0
1730  */
1733  * The default YUI 2 version to build yui2 module urls.  This is for
1734  * intrinsic YUI 2 support via the 2in3 project.  Also see the '2in3'
1735  * config for pulling different revisions of the wrapped YUI 2
1736  * modules.
1737  * @since 3.1.0
1738  * @property yui2
1739  * @type string
1740  * @default 2.9.0
1741  */
1744  * The 2in3 project is a deployment of the various versions of YUI 2
1745  * deployed as first-class YUI 3 modules.  Eventually, the wrapper
1746  * for the modules will change (but the underlying YUI 2 code will
1747  * be the same), and you can select a particular version of
1748  * the wrapper modules via this config.
1749  * @since 3.1.0
1750  * @property 2in3
1751  * @type string
1752  * @default 4
1753  */
1756  * Alternative console log function for use in environments without
1757  * a supported native console.  The function is executed in the
1758  * YUI instance context.
1759  * @since 3.1.0
1760  * @property logFn
1761  * @type Function
1762  */
1765  * A callback to execute when Y.error is called.  It receives the
1766  * error message and an javascript error object if Y.error was
1767  * executed because a javascript error was caught.  The function
1768  * is executed in the YUI instance context. Returning `true` from this
1769  * function will stop the Error from being thrown.
1771  * @since 3.2.0
1772  * @property errorFn
1773  * @type Function
1774  */
1777  * A callback to execute when the loader fails to load one or
1778  * more resource.  This could be because of a script load
1779  * failure.  It can also fail if a javascript module fails
1780  * to register itself, but only when the 'requireRegistration'
1781  * is true.  If this function is defined, the use() callback will
1782  * only be called when the loader succeeds, otherwise it always
1783  * executes unless there was a javascript error when attaching
1784  * a module.
1786  * @since 3.3.0
1787  * @property loadErrorFn
1788  * @type Function
1789  */
1792  * When set to true, the YUI loader will expect that all modules
1793  * it is responsible for loading will be first-class YUI modules
1794  * that register themselves with the YUI global.  If this is
1795  * set to true, loader will fail if the module registration fails
1796  * to happen after the script is loaded.
1798  * @since 3.3.0
1799  * @property requireRegistration
1800  * @type boolean
1801  * @default false
1802  */
1805  * Cache serviced use() requests.
1806  * @since 3.3.0
1807  * @property cacheUse
1808  * @type boolean
1809  * @default true
1810  * @deprecated no longer used
1811  */
1814  * Whether or not YUI should use native ES5 functionality when available for
1815  * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will
1816  * always use its own fallback implementations instead of relying on ES5
1817  * functionality, even when it's available.
1819  * @method useNativeES5
1820  * @type Boolean
1821  * @default true
1822  * @since 3.5.0
1823  */
1824 YUI.add('yui-base', function(Y) {
1827  * YUI stub
1828  * @module yui
1829  * @submodule yui-base
1830  */
1832  * The YUI module contains the components required for building the YUI
1833  * seed file.  This includes the script loading mechanism, a simple queue,
1834  * and the core utilities for the library.
1835  * @module yui
1836  * @submodule yui-base
1837  */
1840  * Provides core language utilites and extensions used throughout YUI.
1842  * @class Lang
1843  * @static
1844  */
1846 var L = Y.Lang || (Y.Lang = {}),
1848 STRING_PROTO = String.prototype,
1849 TOSTRING     = Object.prototype.toString,
1851 TYPES = {
1852     'undefined'        : 'undefined',
1853     'number'           : 'number',
1854     'boolean'          : 'boolean',
1855     'string'           : 'string',
1856     '[object Function]': 'function',
1857     '[object RegExp]'  : 'regexp',
1858     '[object Array]'   : 'array',
1859     '[object Date]'    : 'date',
1860     '[object Error]'   : 'error'
1863 SUBREGEX        = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,
1864 TRIMREGEX       = /^\s+|\s+$/g,
1865 NATIVE_FN_REGEX = /\{\s*\[(?:native code|function)\]\s*\}/i;
1867 // -- Protected Methods --------------------------------------------------------
1870 Returns `true` if the given function appears to be implemented in native code,
1871 `false` otherwise. Will always return `false` -- even in ES5-capable browsers --
1872 if the `useNativeES5` YUI config option is set to `false`.
1874 This isn't guaranteed to be 100% accurate and won't work for anything other than
1875 functions, but it can be useful for determining whether a function like
1876 `Array.prototype.forEach` is native or a JS shim provided by another library.
1878 There's a great article by @kangax discussing certain flaws with this technique:
1879 <http://perfectionkills.com/detecting-built-in-host-methods/>
1881 While his points are valid, it's still possible to benefit from this function
1882 as long as it's used carefully and sparingly, and in such a way that false
1883 negatives have minimal consequences. It's used internally to avoid using
1884 potentially broken non-native ES5 shims that have been added to the page by
1885 other libraries.
1887 @method _isNative
1888 @param {Function} fn Function to test.
1889 @return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.
1890 @static
1891 @protected
1892 @since 3.5.0
1894 L._isNative = function (fn) {
1895     return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));
1898 // -- Public Methods -----------------------------------------------------------
1901  * Determines whether or not the provided item is an array.
1903  * Returns `false` for array-like collections such as the function `arguments`
1904  * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to
1905  * test for an array-like collection.
1907  * @method isArray
1908  * @param o The object to test.
1909  * @return {boolean} true if o is an array.
1910  * @static
1911  */
1912 L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {
1913     return L.type(o) === 'array';
1917  * Determines whether or not the provided item is a boolean.
1918  * @method isBoolean
1919  * @static
1920  * @param o The object to test.
1921  * @return {boolean} true if o is a boolean.
1922  */
1923 L.isBoolean = function(o) {
1924     return typeof o === 'boolean';
1928  * Determines whether or not the supplied item is a date instance.
1929  * @method isDate
1930  * @static
1931  * @param o The object to test.
1932  * @return {boolean} true if o is a date.
1933  */
1934 L.isDate = function(o) {
1935     return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);
1939  * <p>
1940  * Determines whether or not the provided item is a function.
1941  * Note: Internet Explorer thinks certain functions are objects:
1942  * </p>
1944  * <pre>
1945  * var obj = document.createElement("object");
1946  * Y.Lang.isFunction(obj.getAttribute) // reports false in IE
1947  * &nbsp;
1948  * var input = document.createElement("input"); // append to body
1949  * Y.Lang.isFunction(input.focus) // reports false in IE
1950  * </pre>
1952  * <p>
1953  * You will have to implement additional tests if these functions
1954  * matter to you.
1955  * </p>
1957  * @method isFunction
1958  * @static
1959  * @param o The object to test.
1960  * @return {boolean} true if o is a function.
1961  */
1962 L.isFunction = function(o) {
1963     return L.type(o) === 'function';
1967  * Determines whether or not the provided item is null.
1968  * @method isNull
1969  * @static
1970  * @param o The object to test.
1971  * @return {boolean} true if o is null.
1972  */
1973 L.isNull = function(o) {
1974     return o === null;
1978  * Determines whether or not the provided item is a legal number.
1979  * @method isNumber
1980  * @static
1981  * @param o The object to test.
1982  * @return {boolean} true if o is a number.
1983  */
1984 L.isNumber = function(o) {
1985     return typeof o === 'number' && isFinite(o);
1989  * Determines whether or not the provided item is of type object
1990  * or function. Note that arrays are also objects, so
1991  * <code>Y.Lang.isObject([]) === true</code>.
1992  * @method isObject
1993  * @static
1994  * @param o The object to test.
1995  * @param failfn {boolean} fail if the input is a function.
1996  * @return {boolean} true if o is an object.
1997  * @see isPlainObject
1998  */
1999 L.isObject = function(o, failfn) {
2000     var t = typeof o;
2001     return (o && (t === 'object' ||
2002         (!failfn && (t === 'function' || L.isFunction(o))))) || false;
2006  * Determines whether or not the provided item is a string.
2007  * @method isString
2008  * @static
2009  * @param o The object to test.
2010  * @return {boolean} true if o is a string.
2011  */
2012 L.isString = function(o) {
2013     return typeof o === 'string';
2017  * Determines whether or not the provided item is undefined.
2018  * @method isUndefined
2019  * @static
2020  * @param o The object to test.
2021  * @return {boolean} true if o is undefined.
2022  */
2023 L.isUndefined = function(o) {
2024     return typeof o === 'undefined';
2028  * A convenience method for detecting a legitimate non-null value.
2029  * Returns false for null/undefined/NaN, true for other values,
2030  * including 0/false/''
2031  * @method isValue
2032  * @static
2033  * @param o The item to test.
2034  * @return {boolean} true if it is not null/undefined/NaN || false.
2035  */
2036 L.isValue = function(o) {
2037     var t = L.type(o);
2039     switch (t) {
2040         case 'number':
2041             return isFinite(o);
2043         case 'null': // fallthru
2044         case 'undefined':
2045             return false;
2047         default:
2048             return !!t;
2049     }
2053  * Returns the current time in milliseconds.
2055  * @method now
2056  * @return {Number} Current time in milliseconds.
2057  * @static
2058  * @since 3.3.0
2059  */
2060 L.now = Date.now || function () {
2061     return new Date().getTime();
2065  * Lightweight version of <code>Y.substitute</code>. Uses the same template
2066  * structure as <code>Y.substitute</code>, but doesn't support recursion,
2067  * auto-object coersion, or formats.
2068  * @method sub
2069  * @param {string} s String to be modified.
2070  * @param {object} o Object containing replacement values.
2071  * @return {string} the substitute result.
2072  * @static
2073  * @since 3.2.0
2074  */
2075 L.sub = function(s, o) {
2076     return s.replace ? s.replace(SUBREGEX, function (match, key) {
2077         return L.isUndefined(o[key]) ? match : o[key];
2078     }) : s;
2082  * Returns a string without any leading or trailing whitespace.  If
2083  * the input is not a string, the input will be returned untouched.
2084  * @method trim
2085  * @static
2086  * @param s {string} the string to trim.
2087  * @return {string} the trimmed string.
2088  */
2089 L.trim = STRING_PROTO.trim ? function(s) {
2090     return s && s.trim ? s.trim() : s;
2091 } : function (s) {
2092     try {
2093         return s.replace(TRIMREGEX, '');
2094     } catch (e) {
2095         return s;
2096     }
2100  * Returns a string without any leading whitespace.
2101  * @method trimLeft
2102  * @static
2103  * @param s {string} the string to trim.
2104  * @return {string} the trimmed string.
2105  */
2106 L.trimLeft = STRING_PROTO.trimLeft ? function (s) {
2107     return s.trimLeft();
2108 } : function (s) {
2109     return s.replace(/^\s+/, '');
2113  * Returns a string without any trailing whitespace.
2114  * @method trimRight
2115  * @static
2116  * @param s {string} the string to trim.
2117  * @return {string} the trimmed string.
2118  */
2119 L.trimRight = STRING_PROTO.trimRight ? function (s) {
2120     return s.trimRight();
2121 } : function (s) {
2122     return s.replace(/\s+$/, '');
2126 Returns one of the following strings, representing the type of the item passed
2129  * "array"
2130  * "boolean"
2131  * "date"
2132  * "error"
2133  * "function"
2134  * "null"
2135  * "number"
2136  * "object"
2137  * "regexp"
2138  * "string"
2139  * "undefined"
2141 Known issues:
2143  * `typeof HTMLElementCollection` returns function in Safari, but
2144     `Y.Lang.type()` reports "object", which could be a good thing --
2145     but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.
2147 @method type
2148 @param o the item to test.
2149 @return {string} the detected type.
2150 @static
2152 L.type = function(o) {
2153     return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');
2156 @module yui
2157 @submodule yui-base
2160 var Lang   = Y.Lang,
2161     Native = Array.prototype,
2163     hasOwn = Object.prototype.hasOwnProperty;
2166 Provides utility methods for working with arrays. Additional array helpers can
2167 be found in the `collection` and `array-extras` modules.
2169 `Y.Array(thing)` returns a native array created from _thing_. Depending on
2170 _thing_'s type, one of the following will happen:
2172   * Arrays are returned unmodified unless a non-zero _startIndex_ is
2173     specified.
2174   * Array-like collections (see `Array.test()`) are converted to arrays.
2175   * For everything else, a new array is created with _thing_ as the sole
2176     item.
2178 Note: elements that are also collections, such as `<form>` and `<select>`
2179 elements, are not automatically converted to arrays. To force a conversion,
2180 pass `true` as the value of the _force_ parameter.
2182 @class Array
2183 @constructor
2184 @param {Any} thing The thing to arrayify.
2185 @param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like
2186   collection, a subset of items starting at the specified index will be
2187   returned.
2188 @param {Boolean} [force=false] If `true`, _thing_ will be treated as an
2189   array-like collection no matter what.
2190 @return {Array} A native array created from _thing_, according to the rules
2191   described above.
2193 function YArray(thing, startIndex, force) {
2194     var len, result;
2196     startIndex || (startIndex = 0);
2198     if (force || YArray.test(thing)) {
2199         // IE throws when trying to slice HTMLElement collections.
2200         try {
2201             return Native.slice.call(thing, startIndex);
2202         } catch (ex) {
2203             result = [];
2205             for (len = thing.length; startIndex < len; ++startIndex) {
2206                 result.push(thing[startIndex]);
2207             }
2209             return result;
2210         }
2211     }
2213     return [thing];
2216 Y.Array = YArray;
2219 Dedupes an array of strings, returning an array that's guaranteed to contain
2220 only one copy of a given string.
2222 This method differs from `Array.unique()` in that it's optimized for use only
2223 with strings, whereas `unique` may be used with other types (but is slower).
2224 Using `dedupe()` with non-string values may result in unexpected behavior.
2226 @method dedupe
2227 @param {String[]} array Array of strings to dedupe.
2228 @return {Array} Deduped copy of _array_.
2229 @static
2230 @since 3.4.0
2232 YArray.dedupe = function (array) {
2233     var hash    = {},
2234         results = [],
2235         i, item, len;
2237     for (i = 0, len = array.length; i < len; ++i) {
2238         item = array[i];
2240         if (!hasOwn.call(hash, item)) {
2241             hash[item] = 1;
2242             results.push(item);
2243         }
2244     }
2246     return results;
2250 Executes the supplied function on each item in the array. This method wraps
2251 the native ES5 `Array.forEach()` method if available.
2253 @method each
2254 @param {Array} array Array to iterate.
2255 @param {Function} fn Function to execute on each item in the array. The function
2256   will receive the following arguments:
2257     @param {Any} fn.item Current array item.
2258     @param {Number} fn.index Current array index.
2259     @param {Array} fn.array Array being iterated.
2260 @param {Object} [thisObj] `this` object to use when calling _fn_.
2261 @return {YUI} The YUI instance.
2262 @static
2264 YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {
2265     Native.forEach.call(array || [], fn, thisObj || Y);
2266     return Y;
2267 } : function (array, fn, thisObj) {
2268     for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {
2269         if (i in array) {
2270             fn.call(thisObj || Y, array[i], i, array);
2271         }
2272     }
2274     return Y;
2278 Alias for `each()`.
2280 @method forEach
2281 @static
2285 Returns an object using the first array as keys and the second as values. If
2286 the second array is not provided, or if it doesn't contain the same number of
2287 values as the first array, then `true` will be used in place of the missing
2288 values.
2290 @example
2292     Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);
2293     // => {a: 'foo', b: 'bar', c: true}
2295 @method hash
2296 @param {String[]} keys Array of strings to use as keys.
2297 @param {Array} [values] Array to use as values.
2298 @return {Object} Hash using the first array as keys and the second as values.
2299 @static
2301 YArray.hash = function (keys, values) {
2302     var hash = {},
2303         vlen = (values && values.length) || 0,
2304         i, len;
2306     for (i = 0, len = keys.length; i < len; ++i) {
2307         if (i in keys) {
2308             hash[keys[i]] = vlen > i && i in values ? values[i] : true;
2309         }
2310     }
2312     return hash;
2316 Returns the index of the first item in the array that's equal (using a strict
2317 equality check) to the specified _value_, or `-1` if the value isn't found.
2319 This method wraps the native ES5 `Array.indexOf()` method if available.
2321 @method indexOf
2322 @param {Array} array Array to search.
2323 @param {Any} value Value to search for.
2324 @param {Number} [from=0] The index at which to begin the search.
2325 @return {Number} Index of the item strictly equal to _value_, or `-1` if not
2326     found.
2327 @static
2329 YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {
2330     return Native.indexOf.call(array, value, from);
2331 } : function (array, value, from) {
2332     // http://es5.github.com/#x15.4.4.14
2333     var len = array.length;
2335     from = +from || 0;
2336     from = (from > 0 || -1) * Math.floor(Math.abs(from));
2338     if (from < 0) {
2339         from += len;
2341         if (from < 0) {
2342             from = 0;
2343         }
2344     }
2346     for (; from < len; ++from) {
2347         if (from in array && array[from] === value) {
2348             return from;
2349         }
2350     }
2352     return -1;
2356 Numeric sort convenience function.
2358 The native `Array.prototype.sort()` function converts values to strings and
2359 sorts them in lexicographic order, which is unsuitable for sorting numeric
2360 values. Provide `Array.numericSort` as a custom sort function when you want
2361 to sort values in numeric order.
2363 @example
2365     [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);
2366     // => [4, 8, 15, 16, 23, 42]
2368 @method numericSort
2369 @param {Number} a First value to compare.
2370 @param {Number} b Second value to compare.
2371 @return {Number} Difference between _a_ and _b_.
2372 @static
2374 YArray.numericSort = function (a, b) {
2375     return a - b;
2379 Executes the supplied function on each item in the array. Returning a truthy
2380 value from the function will stop the processing of remaining items.
2382 @method some
2383 @param {Array} array Array to iterate over.
2384 @param {Function} fn Function to execute on each item. The function will receive
2385   the following arguments:
2386     @param {Any} fn.value Current array item.
2387     @param {Number} fn.index Current array index.
2388     @param {Array} fn.array Array being iterated over.
2389 @param {Object} [thisObj] `this` object to use when calling _fn_.
2390 @return {Boolean} `true` if the function returns a truthy value on any of the
2391   items in the array; `false` otherwise.
2392 @static
2394 YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {
2395     return Native.some.call(array, fn, thisObj);
2396 } : function (array, fn, thisObj) {
2397     for (var i = 0, len = array.length; i < len; ++i) {
2398         if (i in array && fn.call(thisObj, array[i], i, array)) {
2399             return true;
2400         }
2401     }
2403     return false;
2407 Evaluates _obj_ to determine if it's an array, an array-like collection, or
2408 something else. This is useful when working with the function `arguments`
2409 collection and `HTMLElement` collections.
2411 Note: This implementation doesn't consider elements that are also
2412 collections, such as `<form>` and `<select>`, to be array-like.
2414 @method test
2415 @param {Object} obj Object to test.
2416 @return {Number} A number indicating the results of the test:
2418   * 0: Neither an array nor an array-like collection.
2419   * 1: Real array.
2420   * 2: Array-like collection.
2422 @static
2424 YArray.test = function (obj) {
2425     var result = 0;
2427     if (Lang.isArray(obj)) {
2428         result = 1;
2429     } else if (Lang.isObject(obj)) {
2430         try {
2431             // indexed, but no tagName (element) or alert (window),
2432             // or functions without apply/call (Safari
2433             // HTMLElementCollection bug).
2434             if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {
2435                 result = 2;
2436             }
2437         } catch (ex) {}
2438     }
2440     return result;
2443  * The YUI module contains the components required for building the YUI
2444  * seed file.  This includes the script loading mechanism, a simple queue,
2445  * and the core utilities for the library.
2446  * @module yui
2447  * @submodule yui-base
2448  */
2451  * A simple FIFO queue.  Items are added to the Queue with add(1..n items) and
2452  * removed using next().
2454  * @class Queue
2455  * @constructor
2456  * @param {MIXED} item* 0..n items to seed the queue.
2457  */
2458 function Queue() {
2459     this._init();
2460     this.add.apply(this, arguments);
2463 Queue.prototype = {
2464     /**
2465      * Initialize the queue
2466      *
2467      * @method _init
2468      * @protected
2469      */
2470     _init: function() {
2471         /**
2472          * The collection of enqueued items
2473          *
2474          * @property _q
2475          * @type Array
2476          * @protected
2477          */
2478         this._q = [];
2479     },
2481     /**
2482      * Get the next item in the queue. FIFO support
2483      *
2484      * @method next
2485      * @return {MIXED} the next item in the queue.
2486      */
2487     next: function() {
2488         return this._q.shift();
2489     },
2491     /**
2492      * Get the last in the queue. LIFO support.
2493      *
2494      * @method last
2495      * @return {MIXED} the last item in the queue.
2496      */
2497     last: function() {
2498         return this._q.pop();
2499     },
2501     /**
2502      * Add 0..n items to the end of the queue.
2503      *
2504      * @method add
2505      * @param {MIXED} item* 0..n items.
2506      * @return {object} this queue.
2507      */
2508     add: function() {
2509         this._q.push.apply(this._q, arguments);
2511         return this;
2512     },
2514     /**
2515      * Returns the current number of queued items.
2516      *
2517      * @method size
2518      * @return {Number} The size.
2519      */
2520     size: function() {
2521         return this._q.length;
2522     }
2525 Y.Queue = Queue;
2527 YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();
2530 The YUI module contains the components required for building the YUI seed file.
2531 This includes the script loading mechanism, a simple queue, and the core
2532 utilities for the library.
2534 @module yui
2535 @submodule yui-base
2538 var CACHED_DELIMITER = '__',
2540     hasOwn   = Object.prototype.hasOwnProperty,
2541     isObject = Y.Lang.isObject;
2544 Returns a wrapper for a function which caches the return value of that function,
2545 keyed off of the combined string representation of the argument values provided
2546 when the wrapper is called.
2548 Calling this function again with the same arguments will return the cached value
2549 rather than executing the wrapped function.
2551 Note that since the cache is keyed off of the string representation of arguments
2552 passed to the wrapper function, arguments that aren't strings and don't provide
2553 a meaningful `toString()` method may result in unexpected caching behavior. For
2554 example, the objects `{}` and `{foo: 'bar'}` would both be converted to the
2555 string `[object Object]` when used as a cache key.
2557 @method cached
2558 @param {Function} source The function to memoize.
2559 @param {Object} [cache={}] Object in which to store cached values. You may seed
2560   this object with pre-existing cached values if desired.
2561 @param {any} [refetch] If supplied, this value is compared with the cached value
2562   using a `==` comparison. If the values are equal, the wrapped function is
2563   executed again even though a cached value exists.
2564 @return {Function} Wrapped function.
2565 @for YUI
2567 Y.cached = function (source, cache, refetch) {
2568     cache || (cache = {});
2570     return function (arg) {
2571         var key = arguments.length > 1 ?
2572                 Array.prototype.join.call(arguments, CACHED_DELIMITER) :
2573                 String(arg);
2575         if (!(key in cache) || (refetch && cache[key] == refetch)) {
2576             cache[key] = source.apply(source, arguments);
2577         }
2579         return cache[key];
2580     };
2584 Returns the `location` object from the window/frame in which this YUI instance
2585 operates, or `undefined` when executing in a non-browser environment
2586 (e.g. Node.js).
2588 It is _not_ recommended to hold references to the `window.location` object
2589 outside of the scope of a function in which its properties are being accessed or
2590 its methods are being called. This is because of a nasty bug/issue that exists
2591 in both Safari and MobileSafari browsers:
2592 [WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).
2594 @method getLocation
2595 @return {location} The `location` object from the window/frame in which this YUI
2596     instance operates.
2597 @since 3.5.0
2599 Y.getLocation = function () {
2600     // It is safer to look this up every time because yui-base is attached to a
2601     // YUI instance before a user's config is applied; i.e. `Y.config.win` does
2602     // not point the correct window object when this file is loaded.
2603     var win = Y.config.win;
2605     // It is not safe to hold a reference to the `location` object outside the
2606     // scope in which it is being used. The WebKit engine used in Safari and
2607     // MobileSafari will "disconnect" the `location` object from the `window`
2608     // when a page is restored from back/forward history cache.
2609     return win && win.location;
2613 Returns a new object containing all of the properties of all the supplied
2614 objects. The properties from later objects will overwrite those in earlier
2615 objects.
2617 Passing in a single object will create a shallow copy of it. For a deep copy,
2618 use `clone()`.
2620 @method merge
2621 @param {Object} objects* One or more objects to merge.
2622 @return {Object} A new merged object.
2624 Y.merge = function () {
2625     var args   = arguments,
2626         i      = 0,
2627         len    = args.length,
2628         result = {};
2630     for (; i < len; ++i) {
2631         Y.mix(result, args[i], true);
2632     }
2634     return result;
2638 Mixes _supplier_'s properties into _receiver_.
2640 Properties on _receiver_ or _receiver_'s prototype will not be overwritten or
2641 shadowed unless the _overwrite_ parameter is `true`, and will not be merged
2642 unless the _merge_ parameter is `true`.
2644 In the default mode (0), only properties the supplier owns are copied (prototype
2645 properties are not copied). The following copying modes are available:
2647   * `0`: _Default_. Object to object.
2648   * `1`: Prototype to prototype.
2649   * `2`: Prototype to prototype and object to object.
2650   * `3`: Prototype to object.
2651   * `4`: Object to prototype.
2653 @method mix
2654 @param {Function|Object} receiver The object or function to receive the mixed
2655   properties.
2656 @param {Function|Object} supplier The object or function supplying the
2657   properties to be mixed.
2658 @param {Boolean} [overwrite=false] If `true`, properties that already exist
2659   on the receiver will be overwritten with properties from the supplier.
2660 @param {String[]} [whitelist] An array of property names to copy. If
2661   specified, only the whitelisted properties will be copied, and all others
2662   will be ignored.
2663 @param {Number} [mode=0] Mix mode to use. See above for available modes.
2664 @param {Boolean} [merge=false] If `true`, objects and arrays that already
2665   exist on the receiver will have the corresponding object/array from the
2666   supplier merged into them, rather than being skipped or overwritten. When
2667   both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.
2668 @return {Function|Object|YUI} The receiver, or the YUI instance if the
2669   specified receiver is falsy.
2671 Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {
2672     var alwaysOverwrite, exists, from, i, key, len, to;
2674     // If no supplier is given, we return the receiver. If no receiver is given,
2675     // we return Y. Returning Y doesn't make much sense to me, but it's
2676     // grandfathered in for backcompat reasons.
2677     if (!receiver || !supplier) {
2678         return receiver || Y;
2679     }
2681     if (mode) {
2682         // In mode 2 (prototype to prototype and object to object), we recurse
2683         // once to do the proto to proto mix. The object to object mix will be
2684         // handled later on.
2685         if (mode === 2) {
2686             Y.mix(receiver.prototype, supplier.prototype, overwrite,
2687                     whitelist, 0, merge);
2688         }
2690         // Depending on which mode is specified, we may be copying from or to
2691         // the prototypes of the supplier and receiver.
2692         from = mode === 1 || mode === 3 ? supplier.prototype : supplier;
2693         to   = mode === 1 || mode === 4 ? receiver.prototype : receiver;
2695         // If either the supplier or receiver doesn't actually have a
2696         // prototype property, then we could end up with an undefined `from`
2697         // or `to`. If that happens, we abort and return the receiver.
2698         if (!from || !to) {
2699             return receiver;
2700         }
2701     } else {
2702         from = supplier;
2703         to   = receiver;
2704     }
2706     // If `overwrite` is truthy and `merge` is falsy, then we can skip a
2707     // property existence check on each iteration and save some time.
2708     alwaysOverwrite = overwrite && !merge;
2710     if (whitelist) {
2711         for (i = 0, len = whitelist.length; i < len; ++i) {
2712             key = whitelist[i];
2714             // We call `Object.prototype.hasOwnProperty` instead of calling
2715             // `hasOwnProperty` on the object itself, since the object's
2716             // `hasOwnProperty` method may have been overridden or removed.
2717             // Also, some native objects don't implement a `hasOwnProperty`
2718             // method.
2719             if (!hasOwn.call(from, key)) {
2720                 continue;
2721             }
2723             // The `key in to` check here is (sadly) intentional for backwards
2724             // compatibility reasons. It prevents undesired shadowing of
2725             // prototype members on `to`.
2726             exists = alwaysOverwrite ? false : key in to;
2728             if (merge && exists && isObject(to[key], true)
2729                     && isObject(from[key], true)) {
2730                 // If we're in merge mode, and the key is present on both
2731                 // objects, and the value on both objects is either an object or
2732                 // an array (but not a function), then we recurse to merge the
2733                 // `from` value into the `to` value instead of overwriting it.
2734                 //
2735                 // Note: It's intentional that the whitelist isn't passed to the
2736                 // recursive call here. This is legacy behavior that lots of
2737                 // code still depends on.
2738                 Y.mix(to[key], from[key], overwrite, null, 0, merge);
2739             } else if (overwrite || !exists) {
2740                 // We're not in merge mode, so we'll only copy the `from` value
2741                 // to the `to` value if we're in overwrite mode or if the
2742                 // current key doesn't exist on the `to` object.
2743                 to[key] = from[key];
2744             }
2745         }
2746     } else {
2747         for (key in from) {
2748             // The code duplication here is for runtime performance reasons.
2749             // Combining whitelist and non-whitelist operations into a single
2750             // loop or breaking the shared logic out into a function both result
2751             // in worse performance, and Y.mix is critical enough that the byte
2752             // tradeoff is worth it.
2753             if (!hasOwn.call(from, key)) {
2754                 continue;
2755             }
2757             // The `key in to` check here is (sadly) intentional for backwards
2758             // compatibility reasons. It prevents undesired shadowing of
2759             // prototype members on `to`.
2760             exists = alwaysOverwrite ? false : key in to;
2762             if (merge && exists && isObject(to[key], true)
2763                     && isObject(from[key], true)) {
2764                 Y.mix(to[key], from[key], overwrite, null, 0, merge);
2765             } else if (overwrite || !exists) {
2766                 to[key] = from[key];
2767             }
2768         }
2770         // If this is an IE browser with the JScript enumeration bug, force
2771         // enumeration of the buggy properties by making a recursive call with
2772         // the buggy properties as the whitelist.
2773         if (Y.Object._hasEnumBug) {
2774             Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);
2775         }
2776     }
2778     return receiver;
2781  * The YUI module contains the components required for building the YUI
2782  * seed file.  This includes the script loading mechanism, a simple queue,
2783  * and the core utilities for the library.
2784  * @module yui
2785  * @submodule yui-base
2786  */
2789  * Adds utilities to the YUI instance for working with objects.
2791  * @class Object
2792  */
2794 var Lang   = Y.Lang,
2795     hasOwn = Object.prototype.hasOwnProperty,
2797     UNDEFINED, // <-- Note the comma. We're still declaring vars.
2800  * Returns a new object that uses _obj_ as its prototype. This method wraps the
2801  * native ES5 `Object.create()` method if available, but doesn't currently
2802  * pass through `Object.create()`'s second argument (properties) in order to
2803  * ensure compatibility with older browsers.
2805  * @method ()
2806  * @param {Object} obj Prototype object.
2807  * @return {Object} New object using _obj_ as its prototype.
2808  * @static
2809  */
2810 O = Y.Object = Lang._isNative(Object.create) ? function (obj) {
2811     // We currently wrap the native Object.create instead of simply aliasing it
2812     // to ensure consistency with our fallback shim, which currently doesn't
2813     // support Object.create()'s second argument (properties). Once we have a
2814     // safe fallback for the properties arg, we can stop wrapping
2815     // Object.create().
2816     return Object.create(obj);
2817 } : (function () {
2818     // Reusable constructor function for the Object.create() shim.
2819     function F() {}
2821     // The actual shim.
2822     return function (obj) {
2823         F.prototype = obj;
2824         return new F();
2825     };
2826 }()),
2829  * Property names that IE doesn't enumerate in for..in loops, even when they
2830  * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to
2831  * manually enumerate these properties.
2833  * @property _forceEnum
2834  * @type String[]
2835  * @protected
2836  * @static
2837  */
2838 forceEnum = O._forceEnum = [
2839     'hasOwnProperty',
2840     'isPrototypeOf',
2841     'propertyIsEnumerable',
2842     'toString',
2843     'toLocaleString',
2844     'valueOf'
2848  * `true` if this browser has the JScript enumeration bug that prevents
2849  * enumeration of the properties named in the `_forceEnum` array, `false`
2850  * otherwise.
2852  * See:
2853  *   - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>
2854  *   - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>
2856  * @property _hasEnumBug
2857  * @type Boolean
2858  * @protected
2859  * @static
2860  */
2861 hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),
2864  * `true` if this browser incorrectly considers the `prototype` property of
2865  * functions to be enumerable. Currently known to affect Opera 11.50.
2867  * @property _hasProtoEnumBug
2868  * @type Boolean
2869  * @protected
2870  * @static
2871  */
2872 hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),
2875  * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or
2876  * exists only on _obj_'s prototype. This is essentially a safer version of
2877  * `obj.hasOwnProperty()`.
2879  * @method owns
2880  * @param {Object} obj Object to test.
2881  * @param {String} key Property name to look for.
2882  * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
2883  * @static
2884  */
2885 owns = O.owns = function (obj, key) {
2886     return !!obj && hasOwn.call(obj, key);
2887 }; // <-- End of var declarations.
2890  * Alias for `owns()`.
2892  * @method hasKey
2893  * @param {Object} obj Object to test.
2894  * @param {String} key Property name to look for.
2895  * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
2896  * @static
2897  */
2898 O.hasKey = owns;
2901  * Returns an array containing the object's enumerable keys. Does not include
2902  * prototype keys or non-enumerable keys.
2904  * Note that keys are returned in enumeration order (that is, in the same order
2905  * that they would be enumerated by a `for-in` loop), which may not be the same
2906  * as the order in which they were defined.
2908  * This method is an alias for the native ES5 `Object.keys()` method if
2909  * available.
2911  * @example
2913  *     Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});
2914  *     // => ['a', 'b', 'c']
2916  * @method keys
2917  * @param {Object} obj An object.
2918  * @return {String[]} Array of keys.
2919  * @static
2920  */
2921 O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {
2922     if (!Lang.isObject(obj)) {
2923         throw new TypeError('Object.keys called on a non-object');
2924     }
2926     var keys = [],
2927         i, key, len;
2929     if (hasProtoEnumBug && typeof obj === 'function') {
2930         for (key in obj) {
2931             if (owns(obj, key) && key !== 'prototype') {
2932                 keys.push(key);
2933             }
2934         }
2935     } else {
2936         for (key in obj) {
2937             if (owns(obj, key)) {
2938                 keys.push(key);
2939             }
2940         }
2941     }
2943     if (hasEnumBug) {
2944         for (i = 0, len = forceEnum.length; i < len; ++i) {
2945             key = forceEnum[i];
2947             if (owns(obj, key)) {
2948                 keys.push(key);
2949             }
2950         }
2951     }
2953     return keys;
2957  * Returns an array containing the values of the object's enumerable keys.
2959  * Note that values are returned in enumeration order (that is, in the same
2960  * order that they would be enumerated by a `for-in` loop), which may not be the
2961  * same as the order in which they were defined.
2963  * @example
2965  *     Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});
2966  *     // => ['foo', 'bar', 'baz']
2968  * @method values
2969  * @param {Object} obj An object.
2970  * @return {Array} Array of values.
2971  * @static
2972  */
2973 O.values = function (obj) {
2974     var keys   = O.keys(obj),
2975         i      = 0,
2976         len    = keys.length,
2977         values = [];
2979     for (; i < len; ++i) {
2980         values.push(obj[keys[i]]);
2981     }
2983     return values;
2987  * Returns the number of enumerable keys owned by an object.
2989  * @method size
2990  * @param {Object} obj An object.
2991  * @return {Number} The object's size.
2992  * @static
2993  */
2994 O.size = function (obj) {
2995     try {
2996         return O.keys(obj).length;
2997     } catch (ex) {
2998         return 0; // Legacy behavior for non-objects.
2999     }
3003  * Returns `true` if the object owns an enumerable property with the specified
3004  * value.
3006  * @method hasValue
3007  * @param {Object} obj An object.
3008  * @param {any} value The value to search for.
3009  * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise.
3010  * @static
3011  */
3012 O.hasValue = function (obj, value) {
3013     return Y.Array.indexOf(O.values(obj), value) > -1;
3017  * Executes a function on each enumerable property in _obj_. The function
3018  * receives the value, the key, and the object itself as parameters (in that
3019  * order).
3021  * By default, only properties owned by _obj_ are enumerated. To include
3022  * prototype properties, set the _proto_ parameter to `true`.
3024  * @method each
3025  * @param {Object} obj Object to enumerate.
3026  * @param {Function} fn Function to execute on each enumerable property.
3027  *   @param {mixed} fn.value Value of the current property.
3028  *   @param {String} fn.key Key of the current property.
3029  *   @param {Object} fn.obj Object being enumerated.
3030  * @param {Object} [thisObj] `this` object to use when calling _fn_.
3031  * @param {Boolean} [proto=false] Include prototype properties.
3032  * @return {YUI} the YUI instance.
3033  * @chainable
3034  * @static
3035  */
3036 O.each = function (obj, fn, thisObj, proto) {
3037     var key;
3039     for (key in obj) {
3040         if (proto || owns(obj, key)) {
3041             fn.call(thisObj || Y, obj[key], key, obj);
3042         }
3043     }
3045     return Y;
3049  * Executes a function on each enumerable property in _obj_, but halts if the
3050  * function returns a truthy value. The function receives the value, the key,
3051  * and the object itself as paramters (in that order).
3053  * By default, only properties owned by _obj_ are enumerated. To include
3054  * prototype properties, set the _proto_ parameter to `true`.
3056  * @method some
3057  * @param {Object} obj Object to enumerate.
3058  * @param {Function} fn Function to execute on each enumerable property.
3059  *   @param {mixed} fn.value Value of the current property.
3060  *   @param {String} fn.key Key of the current property.
3061  *   @param {Object} fn.obj Object being enumerated.
3062  * @param {Object} [thisObj] `this` object to use when calling _fn_.
3063  * @param {Boolean} [proto=false] Include prototype properties.
3064  * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,
3065  *   `false` otherwise.
3066  * @static
3067  */
3068 O.some = function (obj, fn, thisObj, proto) {
3069     var key;
3071     for (key in obj) {
3072         if (proto || owns(obj, key)) {
3073             if (fn.call(thisObj || Y, obj[key], key, obj)) {
3074                 return true;
3075             }
3076         }
3077     }
3079     return false;
3083  * Retrieves the sub value at the provided path,
3084  * from the value object provided.
3086  * @method getValue
3087  * @static
3088  * @param o The object from which to extract the property value.
3089  * @param path {Array} A path array, specifying the object traversal path
3090  * from which to obtain the sub value.
3091  * @return {Any} The value stored in the path, undefined if not found,
3092  * undefined if the source is not an object.  Returns the source object
3093  * if an empty path is provided.
3094  */
3095 O.getValue = function(o, path) {
3096     if (!Lang.isObject(o)) {
3097         return UNDEFINED;
3098     }
3100     var i,
3101         p = Y.Array(path),
3102         l = p.length;
3104     for (i = 0; o !== UNDEFINED && i < l; i++) {
3105         o = o[p[i]];
3106     }
3108     return o;
3112  * Sets the sub-attribute value at the provided path on the
3113  * value object.  Returns the modified value object, or
3114  * undefined if the path is invalid.
3116  * @method setValue
3117  * @static
3118  * @param o             The object on which to set the sub value.
3119  * @param path {Array}  A path array, specifying the object traversal path
3120  *                      at which to set the sub value.
3121  * @param val {Any}     The new value for the sub-attribute.
3122  * @return {Object}     The modified object, with the new sub value set, or
3123  *                      undefined, if the path was invalid.
3124  */
3125 O.setValue = function(o, path, val) {
3126     var i,
3127         p = Y.Array(path),
3128         leafIdx = p.length - 1,
3129         ref = o;
3131     if (leafIdx >= 0) {
3132         for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {
3133             ref = ref[p[i]];
3134         }
3136         if (ref !== UNDEFINED) {
3137             ref[p[i]] = val;
3138         } else {
3139             return UNDEFINED;
3140         }
3141     }
3143     return o;
3147  * Returns `true` if the object has no enumerable properties of its own.
3149  * @method isEmpty
3150  * @param {Object} obj An object.
3151  * @return {Boolean} `true` if the object is empty.
3152  * @static
3153  * @since 3.2.0
3154  */
3155 O.isEmpty = function (obj) {
3156     return !O.keys(Object(obj)).length;
3159  * The YUI module contains the components required for building the YUI seed
3160  * file.  This includes the script loading mechanism, a simple queue, and the
3161  * core utilities for the library.
3162  * @module yui
3163  * @submodule yui-base
3164  */
3167  * YUI user agent detection.
3168  * Do not fork for a browser if it can be avoided.  Use feature detection when
3169  * you can.  Use the user agent as a last resort.  For all fields listed
3170  * as @type float, UA stores a version number for the browser engine,
3171  * 0 otherwise.  This value may or may not map to the version number of
3172  * the browser using the engine.  The value is presented as a float so
3173  * that it can easily be used for boolean evaluation as well as for
3174  * looking for a particular range of versions.  Because of this,
3175  * some of the granularity of the version info may be lost.  The fields that
3176  * are @type string default to null.  The API docs list the values that
3177  * these fields can have.
3178  * @class UA
3179  * @static
3180  */
3183 * Static method on `YUI.Env` for parsing a UA string.  Called at instantiation
3184 * to populate `Y.UA`.
3186 * @static
3187 * @method parseUA
3188 * @param {String} [subUA=navigator.userAgent] UA string to parse
3189 * @return {Object} The Y.UA object
3191 YUI.Env.parseUA = function(subUA) {
3193     var numberify = function(s) {
3194             var c = 0;
3195             return parseFloat(s.replace(/\./g, function() {
3196                 return (c++ == 1) ? '' : '.';
3197             }));
3198         },
3200         win = Y.config.win,
3202         nav = win && win.navigator,
3204         o = {
3206         /**
3207          * Internet Explorer version number or 0.  Example: 6
3208          * @property ie
3209          * @type float
3210          * @static
3211          */
3212         ie: 0,
3214         /**
3215          * Opera version number or 0.  Example: 9.2
3216          * @property opera
3217          * @type float
3218          * @static
3219          */
3220         opera: 0,
3222         /**
3223          * Gecko engine revision number.  Will evaluate to 1 if Gecko
3224          * is detected but the revision could not be found. Other browsers
3225          * will be 0.  Example: 1.8
3226          * <pre>
3227          * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
3228          * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8
3229          * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81
3230          * Firefox 3.0   <-- 1.9
3231          * Firefox 3.5   <-- 1.91
3232          * </pre>
3233          * @property gecko
3234          * @type float
3235          * @static
3236          */
3237         gecko: 0,
3239         /**
3240          * AppleWebKit version.  KHTML browsers that are not WebKit browsers
3241          * will evaluate to 1, other browsers 0.  Example: 418.9
3242          * <pre>
3243          * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
3244          *                                   latest available for Mac OSX 10.3.
3245          * Safari 2.0.2:         416     <-- hasOwnProperty introduced
3246          * Safari 2.0.4:         418     <-- preventDefault fixed
3247          * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
3248          *                                   different versions of webkit
3249          * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
3250          *                                   updated, but not updated
3251          *                                   to the latest patch.
3252          * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native
3253          * SVG and many major issues fixed).
3254          * Safari 3.0.4 (523.12) 523.12  <-- First Tiger release - automatic
3255          * update from 2.x via the 10.4.11 OS patch.
3256          * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event.
3257          *                                   yahoo.com user agent hack removed.
3258          * </pre>
3259          * http://en.wikipedia.org/wiki/Safari_version_history
3260          * @property webkit
3261          * @type float
3262          * @static
3263          */
3264         webkit: 0,
3266         /**
3267          * Safari will be detected as webkit, but this property will also
3268          * be populated with the Safari version number
3269          * @property safari
3270          * @type float
3271          * @static
3272          */
3273         safari: 0,
3275         /**
3276          * Chrome will be detected as webkit, but this property will also
3277          * be populated with the Chrome version number
3278          * @property chrome
3279          * @type float
3280          * @static
3281          */
3282         chrome: 0,
3284         /**
3285          * The mobile property will be set to a string containing any relevant
3286          * user agent information when a modern mobile browser is detected.
3287          * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
3288          * devices with the WebKit-based browser, and Opera Mini.
3289          * @property mobile
3290          * @type string
3291          * @default null
3292          * @static
3293          */
3294         mobile: null,
3296         /**
3297          * Adobe AIR version number or 0.  Only populated if webkit is detected.
3298          * Example: 1.0
3299          * @property air
3300          * @type float
3301          */
3302         air: 0,
3303         /**
3304          * Detects Apple iPad's OS version
3305          * @property ipad
3306          * @type float
3307          * @static
3308          */
3309         ipad: 0,
3310         /**
3311          * Detects Apple iPhone's OS version
3312          * @property iphone
3313          * @type float
3314          * @static
3315          */
3316         iphone: 0,
3317         /**
3318          * Detects Apples iPod's OS version
3319          * @property ipod
3320          * @type float
3321          * @static
3322          */
3323         ipod: 0,
3324         /**
3325          * General truthy check for iPad, iPhone or iPod
3326          * @property ios
3327          * @type float
3328          * @default null
3329          * @static
3330          */
3331         ios: null,
3332         /**
3333          * Detects Googles Android OS version
3334          * @property android
3335          * @type float
3336          * @static
3337          */
3338         android: 0,
3339         /**
3340          * Detects Kindle Silk
3341          * @property silk
3342          * @type float
3343          * @static
3344          */
3345         silk: 0,
3346         /**
3347          * Detects Kindle Silk Acceleration
3348          * @property accel
3349          * @type Boolean
3350          * @static
3351          */
3352         accel: false,
3353         /**
3354          * Detects Palms WebOS version
3355          * @property webos
3356          * @type float
3357          * @static
3358          */
3359         webos: 0,
3361         /**
3362          * Google Caja version number or 0.
3363          * @property caja
3364          * @type float
3365          */
3366         caja: nav && nav.cajaVersion,
3368         /**
3369          * Set to true if the page appears to be in SSL
3370          * @property secure
3371          * @type boolean
3372          * @static
3373          */
3374         secure: false,
3376         /**
3377          * The operating system.  Currently only detecting windows or macintosh
3378          * @property os
3379          * @type string
3380          * @default null
3381          * @static
3382          */
3383         os: null,
3385         /**
3386          * The Nodejs Version
3387          * @property nodejs
3388          * @type float
3389          * @default 0
3390          * @static
3391          */
3392         nodejs: 0
3393     },
3395     ua = subUA || nav && nav.userAgent,
3397     loc = win && win.location,
3399     href = loc && loc.href,
3401     m;
3403     /**
3404     * The User Agent string that was parsed
3405     * @property userAgent
3406     * @type String
3407     * @static
3408     */
3409     o.userAgent = ua;
3412     o.secure = href && (href.toLowerCase().indexOf('https') === 0);
3414     if (ua) {
3416         if ((/windows|win32/i).test(ua)) {
3417             o.os = 'windows';
3418         } else if ((/macintosh|mac_powerpc/i).test(ua)) {
3419             o.os = 'macintosh';
3420         } else if ((/android/i).test(ua)) {
3421             o.os = 'android';
3422         } else if ((/symbos/i).test(ua)) {
3423             o.os = 'symbos';
3424         } else if ((/linux/i).test(ua)) {
3425             o.os = 'linux';
3426         } else if ((/rhino/i).test(ua)) {
3427             o.os = 'rhino';
3428         }
3430         // Modern KHTML browsers should qualify as Safari X-Grade
3431         if ((/KHTML/).test(ua)) {
3432             o.webkit = 1;
3433         }
3434         if ((/IEMobile|XBLWP7/).test(ua)) {
3435             o.mobile = 'windows';
3436         }
3437         if ((/Fennec/).test(ua)) {
3438             o.mobile = 'gecko';
3439         }
3440         // Modern WebKit browsers are at least X-Grade
3441         m = ua.match(/AppleWebKit\/([^\s]*)/);
3442         if (m && m[1]) {
3443             o.webkit = numberify(m[1]);
3444             o.safari = o.webkit;
3446             // Mobile browser check
3447             if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {
3448                 o.mobile = 'Apple'; // iPhone or iPod Touch
3450                 m = ua.match(/OS ([^\s]*)/);
3451                 if (m && m[1]) {
3452                     m = numberify(m[1].replace('_', '.'));
3453                 }
3454                 o.ios = m;
3455                 o.os = 'ios';
3456                 o.ipad = o.ipod = o.iphone = 0;
3458                 m = ua.match(/iPad|iPod|iPhone/);
3459                 if (m && m[0]) {
3460                     o[m[0].toLowerCase()] = o.ios;
3461                 }
3462             } else {
3463                 m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);
3464                 if (m) {
3465                     // Nokia N-series, webOS, ex: NokiaN95
3466                     o.mobile = m[0];
3467                 }
3468                 if (/webOS/.test(ua)) {
3469                     o.mobile = 'WebOS';
3470                     m = ua.match(/webOS\/([^\s]*);/);
3471                     if (m && m[1]) {
3472                         o.webos = numberify(m[1]);
3473                     }
3474                 }
3475                 if (/ Android/.test(ua)) {
3476                     if (/Mobile/.test(ua)) {
3477                         o.mobile = 'Android';
3478                     }
3479                     m = ua.match(/Android ([^\s]*);/);
3480                     if (m && m[1]) {
3481                         o.android = numberify(m[1]);
3482                     }
3484                 }
3485                 if (/Silk/.test(ua)) {
3486                     m = ua.match(/Silk\/([^\s]*)\)/);
3487                     if (m && m[1]) {
3488                         o.silk = numberify(m[1]);
3489                     }
3490                     if (!o.android) {
3491                         o.android = 2.34; //Hack for desktop mode in Kindle
3492                         o.os = 'Android';
3493                     }
3494                     if (/Accelerated=true/.test(ua)) {
3495                         o.accel = true;
3496                     }
3497                 }
3498             }
3500             m = ua.match(/(Chrome|CrMo)\/([^\s]*)/);
3501             if (m && m[1] && m[2]) {
3502                 o.chrome = numberify(m[2]); // Chrome
3503                 o.safari = 0; //Reset safari back to 0
3504                 if (m[1] === 'CrMo') {
3505                     o.mobile = 'chrome';
3506                 }
3507             } else {
3508                 m = ua.match(/AdobeAIR\/([^\s]*)/);
3509                 if (m) {
3510                     o.air = m[0]; // Adobe AIR 1.0 or better
3511                 }
3512             }
3513         }
3515         if (!o.webkit) { // not webkit
3516 // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
3517             if (/Opera/.test(ua)) {
3518                 m = ua.match(/Opera[\s\/]([^\s]*)/);
3519                 if (m && m[1]) {
3520                     o.opera = numberify(m[1]);
3521                 }
3522                 m = ua.match(/Version\/([^\s]*)/);
3523                 if (m && m[1]) {
3524                     o.opera = numberify(m[1]); // opera 10+
3525                 }
3527                 if (/Opera Mobi/.test(ua)) {
3528                     o.mobile = 'opera';
3529                     m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/);
3530                     if (m && m[1]) {
3531                         o.opera = numberify(m[1]);
3532                     }
3533                 }
3534                 m = ua.match(/Opera Mini[^;]*/);
3536                 if (m) {
3537                     o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
3538                 }
3539             } else { // not opera or webkit
3540                 m = ua.match(/MSIE\s([^;]*)/);
3541                 if (m && m[1]) {
3542                     o.ie = numberify(m[1]);
3543                 } else { // not opera, webkit, or ie
3544                     m = ua.match(/Gecko\/([^\s]*)/);
3545                     if (m) {
3546                         o.gecko = 1; // Gecko detected, look for revision
3547                         m = ua.match(/rv:([^\s\)]*)/);
3548                         if (m && m[1]) {
3549                             o.gecko = numberify(m[1]);
3550                         }
3551                     }
3552                 }
3553             }
3554         }
3555     }
3557     //It was a parsed UA, do not assign the global value.
3558     if (!subUA) {
3560         if (typeof process == 'object') {
3562             if (process.versions && process.versions.node) {
3563                 //NodeJS
3564                 o.os = process.platform;
3565                 o.nodejs = process.versions.node;
3566             }
3567         }
3569         YUI.Env.UA = o;
3571     }
3573     return o;
3577 Y.UA = YUI.Env.UA || YUI.Env.parseUA();
3580 Performs a simple comparison between two version numbers, accounting for
3581 standard versioning logic such as the fact that "535.8" is a lower version than
3582 "535.24", even though a simple numerical comparison would indicate that it's
3583 greater. Also accounts for cases such as "1.1" vs. "1.1.0", which are
3584 considered equivalent.
3586 Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,
3587 1 if _a_ is higher than _b_.
3589 Versions may be numbers or strings containing numbers and dots. For example,
3590 both `535` and `"535.8.10"` are acceptable. A version string containing
3591 non-numeric characters, like `"535.8.beta"`, may produce unexpected results.
3593 @method compareVersions
3594 @param {Number|String} a First version number to compare.
3595 @param {Number|String} b Second version number to compare.
3596 @return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is
3597     higher than _b_.
3599 Y.UA.compareVersions = function (a, b) {
3600     var aPart, aParts, bPart, bParts, i, len;
3602     if (a === b) {
3603         return 0;
3604     }
3606     aParts = (a + '').split('.');
3607     bParts = (b + '').split('.');
3609     for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {
3610         aPart = parseInt(aParts[i], 10);
3611         bPart = parseInt(bParts[i], 10);
3613         isNaN(aPart) && (aPart = 0);
3614         isNaN(bPart) && (bPart = 0);
3616         if (aPart < bPart) {
3617             return -1;
3618         }
3620         if (aPart > bPart) {
3621             return 1;
3622         }
3623     }
3625     return 0;
3627 YUI.Env.aliases = {
3628     "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],
3629     "app": ["app-base","app-transitions","model","model-list","router","view"],
3630     "attribute": ["attribute-base","attribute-complex"],
3631     "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],
3632     "base": ["base-base","base-pluginhost","base-build"],
3633     "cache": ["cache-base","cache-offline","cache-plugin"],
3634     "collection": ["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],
3635     "controller": ["router"],
3636     "dataschema": ["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],
3637     "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],
3638     "datatable": ["datatable-core","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],
3639     "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],
3640     "datatype": ["datatype-number","datatype-date","datatype-xml"],
3641     "datatype-date": ["datatype-date-parse","datatype-date-format"],
3642     "datatype-number": ["datatype-number-parse","datatype-number-format"],
3643     "datatype-xml": ["datatype-xml-parse","datatype-xml-format"],
3644     "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],
3645     "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"],
3646     "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],
3647     "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],
3648     "event-custom": ["event-custom-base","event-custom-complex"],
3649     "event-gestures": ["event-flick","event-move"],
3650     "handlebars": ["handlebars-compiler"],
3651     "highlight": ["highlight-base","highlight-accentfold"],
3652     "history": ["history-base","history-hash","history-hash-ie","history-html5"],
3653     "io": ["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],
3654     "json": ["json-parse","json-stringify"],
3655     "loader": ["loader-base","loader-rollup","loader-yui3"],
3656     "node": ["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],
3657     "pluginhost": ["pluginhost-base","pluginhost-config"],
3658     "querystring": ["querystring-parse","querystring-stringify"],
3659     "recordset": ["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],
3660     "resize": ["resize-base","resize-proxy","resize-constrain"],
3661     "slider": ["slider-base","slider-value-range","clickable-rail","range-slider"],
3662     "text": ["text-accentfold","text-wordbreak"],
3663     "widget": ["widget-base","widget-htmlparser","widget-skin","widget-uievents"]
3667 }, '3.5.1' );
3668 YUI.add('get', function(Y) {
3670     /**
3671     * NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed.
3672     * @module get-nodejs
3673     * @class GetNodeJS
3674     */
3675         
3676     var path = require('path'),
3677         vm = require('vm'),
3678         fs = require('fs'),
3679         request = require('request');
3682     Y.Get = function() {
3683     };
3685     //Setup the default config base path
3686     Y.config.base = path.join(__dirname, '../');
3688     YUI.require = require;
3689     YUI.process = process;
3690     
3691     /**
3692     * Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`
3693     * @method escapeWinPath
3694     * @protected
3695     * @param {String} p The path to modify
3696     * @return {String} The encoded path
3697     */
3698     var escapeWinPath = function(p) {
3699         return p.replace(/\\/g, '\\\\');
3700     };
3702     /**
3703     * Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
3704     * into the YUI object
3705     * @method _exec
3706     * @private
3707     * @param {String} data The JS to execute
3708     * @param {String} url The path to the file that was parsed
3709     * @param {Callback} cb The callback to execute when this is completed
3710     * @param {Error} cb.err=null Error object
3711     * @param {String} cb.url The URL that was just parsed
3712     */
3714     Y.Get._exec = function(data, url, cb) {
3715         var dirName = escapeWinPath(path.dirname(url));
3716         var fileName = escapeWinPath(url);
3718         if (dirName.match(/^https?:\/\//)) {
3719             dirName = '.';
3720             fileName = 'remoteResource';
3721         }
3723         var mod = "(function(YUI) { var __dirname = '" + dirName + "'; "+
3724             "var __filename = '" + fileName + "'; " +
3725             "var process = YUI.process;" +
3726             "var require = function(file) {" +
3727             " if (file.indexOf('./') === 0) {" +
3728             "   file = __dirname + file.replace('./', '/'); }" +
3729             " return YUI.require(file); }; " +
3730             data + " ;return YUI; })";
3731     
3732         //var mod = "(function(YUI) { " + data + ";return YUI; })";
3733         var script = vm.createScript(mod, url);
3734         var fn = script.runInThisContext(mod);
3735         YUI = fn(YUI);
3736         cb(null, url);
3737     };
3738     
3739     /**
3740     * Fetches the content from a remote URL or a file from disc and passes the content
3741     * off to `_exec` for parsing
3742     * @method _include
3743     * @private
3744     * @param {String} url The URL/File path to fetch the content from
3745     * @param {Callback} cb The callback to fire once the content has been executed via `_exec`
3746     */
3747     Y.Get._include = function(url, cb) {
3748         var self = this;
3750         if (url.match(/^https?:\/\//)) {
3751             var cfg = {
3752                 url: url,
3753                 timeout: self.timeout
3754             };
3755             request(cfg, function (err, response, body) {
3756                 if (err) {
3757                     cb(err, url);
3758                 } else {
3759                     Y.Get._exec(body, url, cb);
3760                 }
3761             });
3762         } else {
3763             if (Y.config.useSync) {
3764                 //Needs to be in useSync
3765                 if (path.existsSync(url)) {
3766                     var mod = fs.readFileSync(url,'utf8');
3767                     Y.Get._exec(mod, url, cb);
3768                 } else {
3769                     cb('Path does not exist: ' + url, url);
3770                 }
3771             } else {
3772                 fs.readFile(url, 'utf8', function(err, mod) {
3773                     if (err) {
3774                         cb(err, url);
3775                     } else {
3776                         Y.Get._exec(mod, url, cb);
3777                     }
3778                 });
3779             }
3780         }
3781         
3782     };
3785     var end = function(cb, msg, result) {
3786         if (Y.Lang.isFunction(cb.onEnd)) {
3787             cb.onEnd.call(Y, msg, result);
3788         }
3789     }, pass = function(cb) {
3790         if (Y.Lang.isFunction(cb.onSuccess)) {
3791             cb.onSuccess.call(Y, cb);
3792         }
3793         end(cb, 'success', 'success');
3794     }, fail = function(cb, er) {
3795         if (Y.Lang.isFunction(cb.onFailure)) {
3796             cb.onFailure.call(Y, er, cb);
3797         }
3798         end(cb, er, 'fail');
3799     };
3802     /**
3803     * Override for Get.script for loading local or remote YUI modules.
3804     * @method js
3805     * @param {Array|String} s The URL's to load into this context
3806     * @param {Object} options Transaction options
3807     */
3808     Y.Get.js = function(s, options) {
3809         var A = Y.Array,
3810             self = this,
3811             urls = A(s), url, i, l = urls.length, c= 0,
3812             check = function() {
3813                 if (c === l) {
3814                     pass(options);
3815                 }
3816             };
3820         for (i=0; i<l; i++) {
3821             url = urls[i];
3822             if (Y.Lang.isObject(url)) {
3823                 url = url.url;
3824             }
3826             url = url.replace(/'/g, '%27');
3827             Y.Get._include(url, function(err, url) {
3828                 if (!Y.config) {
3829                     Y.config = {
3830                         debug: true
3831                     };
3832                 }
3833                 if (options.onProgress) {
3834                     options.onProgress.call(options.context || Y, url);
3835                 }
3836                 if (err) {
3837                     fail(options, err);
3838                 } else {
3839                     c++;
3840                     check();
3841                 }
3842             });
3843         }
3844     };
3845     
3846     /**
3847     * Alias for `Y.Get.js`
3848     * @method script
3849     */
3850     Y.Get.script = Y.Get.js;
3851     
3852     //Place holder for SS Dom access
3853     Y.Get.css = function(s, cb) {
3854         pass(cb);
3855     };
3859 }, '3.5.1' ,{requires:['yui-base']});
3860 YUI.add('features', function(Y) {
3862 var feature_tests = {};
3865 Contains the core of YUI's feature test architecture.
3866 @module features
3870 * Feature detection
3871 * @class Features
3872 * @static
3875 Y.mix(Y.namespace('Features'), {
3876     
3877     /**
3878     * Object hash of all registered feature tests
3879     * @property tests
3880     * @type Object
3881     */
3882     tests: feature_tests,
3883     
3884     /**
3885     * Add a test to the system
3886     * 
3887     *   ```
3888     *   Y.Features.add("load", "1", {});
3889     *   ```
3890     * 
3891     * @method add
3892     * @param {String} cat The category, right now only 'load' is supported
3893     * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3
3894     * @param {Object} o Object containing test properties
3895     * @param {String} o.name The name of the test
3896     * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance
3897     * @param {String} o.trigger The module that triggers this test.
3898     */
3899     add: function(cat, name, o) {
3900         feature_tests[cat] = feature_tests[cat] || {};
3901         feature_tests[cat][name] = o;
3902     },
3903     /**
3904     * Execute all tests of a given category and return the serialized results
3905     *
3906     *   ```
3907     *   caps=1:1;2:1;3:0
3908     *   ```
3909     * @method all
3910     * @param {String} cat The category to execute
3911     * @param {Array} args The arguments to pass to the test function
3912     * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0
3913     */
3914     all: function(cat, args) {
3915         var cat_o = feature_tests[cat],
3916             // results = {};
3917             result = [];
3918         if (cat_o) {
3919             Y.Object.each(cat_o, function(v, k) {
3920                 result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));
3921             });
3922         }
3924         return (result.length) ? result.join(';') : '';
3925     },
3926     /**
3927     * Run a sepecific test and return a Boolean response.
3928     *
3929     *   ```
3930     *   Y.Features.test("load", "1");
3931     *   ```
3932     *
3933     * @method test
3934     * @param {String} cat The category of the test to run
3935     * @param {String} name The name of the test to run
3936     * @param {Array} args The arguments to pass to the test function
3937     * @return {Boolean} True or false if the test passed/failed.
3938     */
3939     test: function(cat, name, args) {
3940         args = args || [];
3941         var result, ua, test,
3942             cat_o = feature_tests[cat],
3943             feature = cat_o && cat_o[name];
3945         if (!feature) {
3946         } else {
3948             result = feature.result;
3950             if (Y.Lang.isUndefined(result)) {
3952                 ua = feature.ua;
3953                 if (ua) {
3954                     result = (Y.UA[ua]);
3955                 }
3957                 test = feature.test;
3958                 if (test && ((!ua) || result)) {
3959                     result = test.apply(Y, args);
3960                 }
3962                 feature.result = result;
3963             }
3964         }
3966         return result;
3967     }
3970 // Y.Features.add("load", "1", {});
3971 // Y.Features.test("load", "1");
3972 // caps=1:1;2:0;3:1;
3974 /* This file is auto-generated by src/loader/scripts/meta_join.py */
3975 var add = Y.Features.add;
3976 // io-nodejs
3977 add('load', '0', {
3978     "name": "io-nodejs", 
3979     "trigger": "io-base", 
3980     "ua": "nodejs"
3982 // graphics-canvas-default
3983 add('load', '1', {
3984     "name": "graphics-canvas-default", 
3985     "test": function(Y) {
3986     var DOCUMENT = Y.config.doc,
3987         useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
3988                 canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
3989         svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
3990     return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
3991 }, 
3992     "trigger": "graphics"
3994 // autocomplete-list-keys
3995 add('load', '2', {
3996     "name": "autocomplete-list-keys", 
3997     "test": function (Y) {
3998     // Only add keyboard support to autocomplete-list if this doesn't appear to
3999     // be an iOS or Android-based mobile device.
4000     //
4001     // There's currently no feasible way to actually detect whether a device has
4002     // a hardware keyboard, so this sniff will have to do. It can easily be
4003     // overridden by manually loading the autocomplete-list-keys module.
4004     //
4005     // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
4006     // doesn't fire the keyboard events used by AutoCompleteList, so there's
4007     // no point loading the -keys module even when a bluetooth keyboard may be
4008     // available.
4009     return !(Y.UA.ios || Y.UA.android);
4010 }, 
4011     "trigger": "autocomplete-list"
4013 // graphics-svg
4014 add('load', '3', {
4015     "name": "graphics-svg", 
4016     "test": function(Y) {
4017     var DOCUMENT = Y.config.doc,
4018         useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
4019                 canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
4020         svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
4021     
4022     return svg && (useSVG || !canvas);
4023 }, 
4024     "trigger": "graphics"
4026 // editor-para-ie
4027 add('load', '4', {
4028     "name": "editor-para-ie", 
4029     "trigger": "editor-para", 
4030     "ua": "ie", 
4031     "when": "instead"
4033 // graphics-vml-default
4034 add('load', '5', {
4035     "name": "graphics-vml-default", 
4036     "test": function(Y) {
4037     var DOCUMENT = Y.config.doc,
4038                 canvas = DOCUMENT && DOCUMENT.createElement("canvas");
4039     return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
4040 }, 
4041     "trigger": "graphics"
4043 // graphics-svg-default
4044 add('load', '6', {
4045     "name": "graphics-svg-default", 
4046     "test": function(Y) {
4047     var DOCUMENT = Y.config.doc,
4048         useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
4049                 canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
4050         svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
4051     
4052     return svg && (useSVG || !canvas);
4053 }, 
4054     "trigger": "graphics"
4056 // history-hash-ie
4057 add('load', '7', {
4058     "name": "history-hash-ie", 
4059     "test": function (Y) {
4060     var docMode = Y.config.doc && Y.config.doc.documentMode;
4062     return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
4063             !docMode || docMode < 8);
4064 }, 
4065     "trigger": "history-hash"
4067 // transition-timer
4068 add('load', '8', {
4069     "name": "transition-timer", 
4070     "test": function (Y) {
4071     var DOCUMENT = Y.config.doc,
4072         node = (DOCUMENT) ? DOCUMENT.documentElement: null,
4073         ret = true;
4075     if (node && node.style) {
4076         ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);
4077     } 
4079     return ret;
4080 }, 
4081     "trigger": "transition"
4083 // dom-style-ie
4084 add('load', '9', {
4085     "name": "dom-style-ie", 
4086     "test": function (Y) {
4088     var testFeature = Y.Features.test,
4089         addFeature = Y.Features.add,
4090         WINDOW = Y.config.win,
4091         DOCUMENT = Y.config.doc,
4092         DOCUMENT_ELEMENT = 'documentElement',
4093         ret = false;
4095     addFeature('style', 'computedStyle', {
4096         test: function() {
4097             return WINDOW && 'getComputedStyle' in WINDOW;
4098         }
4099     });
4101     addFeature('style', 'opacity', {
4102         test: function() {
4103             return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
4104         }
4105     });
4107     ret =  (!testFeature('style', 'opacity') &&
4108             !testFeature('style', 'computedStyle'));
4110     return ret;
4111 }, 
4112     "trigger": "dom-style"
4114 // selector-css2
4115 add('load', '10', {
4116     "name": "selector-css2", 
4117     "test": function (Y) {
4118     var DOCUMENT = Y.config.doc,
4119         ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
4121     return ret;
4122 }, 
4123     "trigger": "selector"
4125 // widget-base-ie
4126 add('load', '11', {
4127     "name": "widget-base-ie", 
4128     "trigger": "widget-base", 
4129     "ua": "ie"
4131 // event-base-ie
4132 add('load', '12', {
4133     "name": "event-base-ie", 
4134     "test": function(Y) {
4135     var imp = Y.config.doc && Y.config.doc.implementation;
4136     return (imp && (!imp.hasFeature('Events', '2.0')));
4137 }, 
4138     "trigger": "node-base"
4140 // dd-gestures
4141 add('load', '13', {
4142     "name": "dd-gestures", 
4143     "test": function(Y) {
4144     return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));
4145 }, 
4146     "trigger": "dd-drag"
4148 // scrollview-base-ie
4149 add('load', '14', {
4150     "name": "scrollview-base-ie", 
4151     "trigger": "scrollview-base", 
4152     "ua": "ie"
4154 // app-transitions-native
4155 add('load', '15', {
4156     "name": "app-transitions-native", 
4157     "test": function (Y) {
4158     var doc  = Y.config.doc,
4159         node = doc ? doc.documentElement : null;
4161     if (node && node.style) {
4162         return ('MozTransition' in node.style || 'WebkitTransition' in node.style);
4163     }
4165     return false;
4166 }, 
4167     "trigger": "app-transitions"
4169 // graphics-canvas
4170 add('load', '16', {
4171     "name": "graphics-canvas", 
4172     "test": function(Y) {
4173     var DOCUMENT = Y.config.doc,
4174         useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
4175                 canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
4176         svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
4177     return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
4178 }, 
4179     "trigger": "graphics"
4181 // graphics-vml
4182 add('load', '17', {
4183     "name": "graphics-vml", 
4184     "test": function(Y) {
4185     var DOCUMENT = Y.config.doc,
4186                 canvas = DOCUMENT && DOCUMENT.createElement("canvas");
4187     return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
4188 }, 
4189     "trigger": "graphics"
4193 }, '3.5.1' ,{requires:['yui-base']});
4194 YUI.add('intl-base', function(Y) {
4197  * The Intl utility provides a central location for managing sets of
4198  * localized resources (strings and formatting patterns).
4200  * @class Intl
4201  * @uses EventTarget
4202  * @static
4203  */
4205 var SPLIT_REGEX = /[, ]/;
4207 Y.mix(Y.namespace('Intl'), {
4209  /**
4210     * Returns the language among those available that
4211     * best matches the preferred language list, using the Lookup
4212     * algorithm of BCP 47.
4213     * If none of the available languages meets the user's preferences,
4214     * then "" is returned.
4215     * Extended language ranges are not supported.
4216     *
4217     * @method lookupBestLang
4218     * @param {String[] | String} preferredLanguages The list of preferred
4219     * languages in descending preference order, represented as BCP 47
4220     * language tags. A string array or a comma-separated list.
4221     * @param {String[]} availableLanguages The list of languages
4222     * that the application supports, represented as BCP 47 language
4223     * tags.
4224     *
4225     * @return {String} The available language that best matches the
4226     * preferred language list, or "".
4227     * @since 3.1.0
4228     */
4229     lookupBestLang: function(preferredLanguages, availableLanguages) {
4231         var i, language, result, index;
4233         // check whether the list of available languages contains language;
4234         // if so return it
4235         function scan(language) {
4236             var i;
4237             for (i = 0; i < availableLanguages.length; i += 1) {
4238                 if (language.toLowerCase() ===
4239                             availableLanguages[i].toLowerCase()) {
4240                     return availableLanguages[i];
4241                 }
4242             }
4243         }
4245         if (Y.Lang.isString(preferredLanguages)) {
4246             preferredLanguages = preferredLanguages.split(SPLIT_REGEX);
4247         }
4249         for (i = 0; i < preferredLanguages.length; i += 1) {
4250             language = preferredLanguages[i];
4251             if (!language || language === '*') {
4252                 continue;
4253             }
4254             // check the fallback sequence for one language
4255             while (language.length > 0) {
4256                 result = scan(language);
4257                 if (result) {
4258                     return result;
4259                 } else {
4260                     index = language.lastIndexOf('-');
4261                     if (index >= 0) {
4262                         language = language.substring(0, index);
4263                         // one-character subtags get cut along with the
4264                         // following subtag
4265                         if (index >= 2 && language.charAt(index - 2) === '-') {
4266                             language = language.substring(0, index - 2);
4267                         }
4268                     } else {
4269                         // nothing available for this language
4270                         break;
4271                     }
4272                 }
4273             }
4274         }
4276         return '';
4277     }
4281 }, '3.5.1' ,{requires:['yui-base']});
4282 YUI.add('yui-log', function(Y) {
4285  * Provides console log capability and exposes a custom event for
4286  * console implementations. This module is a `core` YUI module, <a href="../classes/YUI.html#method_log">it's documentation is located under the YUI class</a>.
4288  * @module yui
4289  * @submodule yui-log
4290  */
4292 var INSTANCE = Y,
4293     LOGEVENT = 'yui:log',
4294     UNDEFINED = 'undefined',
4295     LEVELS = { debug: 1,
4296                info: 1,
4297                warn: 1,
4298                error: 1 };
4301  * If the 'debug' config is true, a 'yui:log' event will be
4302  * dispatched, which the Console widget and anything else
4303  * can consume.  If the 'useBrowserConsole' config is true, it will
4304  * write to the browser console if available.  YUI-specific log
4305  * messages will only be present in the -debug versions of the
4306  * JS files.  The build system is supposed to remove log statements
4307  * from the raw and minified versions of the files.
4309  * @method log
4310  * @for YUI
4311  * @param  {String}  msg  The message to log.
4312  * @param  {String}  cat  The log category for the message.  Default
4313  *                        categories are "info", "warn", "error", time".
4314  *                        Custom categories can be used as well. (opt).
4315  * @param  {String}  src  The source of the the message (opt).
4316  * @param  {boolean} silent If true, the log event won't fire.
4317  * @return {YUI}      YUI instance.
4318  */
4319 INSTANCE.log = function(msg, cat, src, silent) {
4320     var bail, excl, incl, m, f,
4321         Y = INSTANCE,
4322         c = Y.config,
4323         publisher = (Y.fire) ? Y : YUI.Env.globalEvents;
4324     // suppress log message if the config is off or the event stack
4325     // or the event call stack contains a consumer of the yui:log event
4326     if (c.debug) {
4327         // apply source filters
4328         if (src) {
4329             excl = c.logExclude;
4330             incl = c.logInclude;
4331             if (incl && !(src in incl)) {
4332                 bail = 1;
4333             } else if (incl && (src in incl)) {
4334                 bail = !incl[src];
4335             } else if (excl && (src in excl)) {
4336                 bail = excl[src];
4337             }
4338         }
4339         if (!bail) {
4340             if (c.useBrowserConsole) {
4341                 m = (src) ? src + ': ' + msg : msg;
4342                 if (Y.Lang.isFunction(c.logFn)) {
4343                     c.logFn.call(Y, msg, cat, src);
4344                 } else if (typeof console != UNDEFINED && console.log) {
4345                     f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';
4346                     console[f](m);
4347                 } else if (typeof opera != UNDEFINED) {
4348                     opera.postError(m);
4349                 }
4350             }
4352             if (publisher && !silent) {
4354                 if (publisher == Y && (!publisher.getEvent(LOGEVENT))) {
4355                     publisher.publish(LOGEVENT, {
4356                         broadcast: 2
4357                     });
4358                 }
4360                 publisher.fire(LOGEVENT, {
4361                     msg: msg,
4362                     cat: cat,
4363                     src: src
4364                 });
4365             }
4366         }
4367     }
4369     return Y;
4373  * Write a system message.  This message will be preserved in the
4374  * minified and raw versions of the YUI files, unlike log statements.
4375  * @method message
4376  * @for YUI
4377  * @param  {String}  msg  The message to log.
4378  * @param  {String}  cat  The log category for the message.  Default
4379  *                        categories are "info", "warn", "error", time".
4380  *                        Custom categories can be used as well. (opt).
4381  * @param  {String}  src  The source of the the message (opt).
4382  * @param  {boolean} silent If true, the log event won't fire.
4383  * @return {YUI}      YUI instance.
4384  */
4385 INSTANCE.message = function() {
4386     return INSTANCE.log.apply(INSTANCE, arguments);
4390 }, '3.5.1' ,{requires:['yui-base']});
4391 YUI.add('yui-log-nodejs', function(Y) {
4393 var sys = require(process.binding('natives').util ? 'util' : 'sys'),
4394     hasColor = false;
4396 try {
4397     var stdio = require("stdio");
4398     hasColor = stdio.isStderrATTY();
4399 } catch (ex) {
4400     hasColor = true;
4403 Y.config.useColor = hasColor;
4405 Y.consoleColor = function(str, num) {
4406     if (!this.config.useColor) {
4407         return str;
4408     }
4409     if (!num) {
4410         num = '32';
4411     }
4412     return "\033[" + num +"m" + str + "\033[0m"
4416 var logFn = function(str, t, m) {
4417     var id = '';
4418     if (this.id) {
4419         id = '[' + this.id + ']:';
4420     }
4421     t = t || 'info';
4422     m = (m) ? this.consoleColor(' (' +  m.toLowerCase() + '):', 35) : '';
4423     
4424     if (str === null) {
4425         str = 'null';
4426     }
4428     if ((typeof str === 'object') || str instanceof Array) {
4429         try {
4430             //Should we use this?
4431             if (str.tagName || str._yuid || str._query) {
4432                 str = str.toString();
4433             } else {
4434                 str = sys.inspect(str);
4435             }
4436         } catch (e) {
4437             //Fail catcher
4438         }
4439     }
4441     var lvl = '37;40', mLvl = ((str) ? '' : 31);
4442     t = t+''; //Force to a string..
4443     switch (t.toLowerCase()) {
4444         case 'error':
4445             lvl = mLvl = 31;
4446             break;
4447         case 'warn':
4448             lvl = 33;
4449             break;
4450         case 'debug':
4451             lvl = 34;
4452             break;
4453     }
4454     if (typeof str === 'string') {
4455         if (str && str.indexOf("\n") !== -1) {
4456             str = "\n" + str;
4457         }
4458     }
4460     // output log messages to stderr
4461     sys.error(this.consoleColor(t.toLowerCase() + ':', lvl) + m + ' ' + this.consoleColor(str, mLvl));
4464 if (!Y.config.logFn) {
4465     Y.config.logFn = logFn;
4470 }, '3.5.1' ,{requires:['yui-log']});
4471 YUI.add('yui-later', function(Y) {
4474  * Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module, <a href="../classes/YUI.html#method_later">it's documentation is located under the YUI class</a>.
4476  * @module yui
4477  * @submodule yui-later
4478  */
4480 var NO_ARGS = [];
4483  * Executes the supplied function in the context of the supplied
4484  * object 'when' milliseconds later.  Executes the function a
4485  * single time unless periodic is set to true.
4486  * @for YUI
4487  * @method later
4488  * @param when {int} the number of milliseconds to wait until the fn
4489  * is executed.
4490  * @param o the context object.
4491  * @param fn {Function|String} the function to execute or the name of
4492  * the method in the 'o' object to execute.
4493  * @param data [Array] data that is provided to the function.  This
4494  * accepts either a single item or an array.  If an array is provided,
4495  * the function is executed with one parameter for each array item.
4496  * If you need to pass a single array parameter, it needs to be wrapped
4497  * in an array [myarray].
4499  * Note: native methods in IE may not have the call and apply methods.
4500  * In this case, it will work, but you are limited to four arguments.
4502  * @param periodic {boolean} if true, executes continuously at supplied
4503  * interval until canceled.
4504  * @return {object} a timer object. Call the cancel() method on this
4505  * object to stop the timer.
4506  */
4507 Y.later = function(when, o, fn, data, periodic) {
4508     when = when || 0;
4509     data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;
4510     o = o || Y.config.win || Y;
4512     var cancelled = false,
4513         method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,
4514         wrapper = function() {
4515             // IE 8- may execute a setInterval callback one last time
4516             // after clearInterval was called, so in order to preserve
4517             // the cancel() === no more runny-run, we have to jump through
4518             // an extra hoop.
4519             if (!cancelled) {
4520                 if (!method.apply) {
4521                     method(data[0], data[1], data[2], data[3]);
4522                 } else {
4523                     method.apply(o, data || NO_ARGS);
4524                 }
4525             }
4526         },
4527         id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);
4529     return {
4530         id: id,
4531         interval: periodic,
4532         cancel: function() {
4533             cancelled = true;
4534             if (this.interval) {
4535                 clearInterval(id);
4536             } else {
4537                 clearTimeout(id);
4538             }
4539         }
4540     };
4543 Y.Lang.later = Y.later;
4547 }, '3.5.1' ,{requires:['yui-base']});
4548 YUI.add('loader-base', function(Y) {
4551  * The YUI loader core
4552  * @module loader
4553  * @submodule loader-base
4554  */
4556 if (!YUI.Env[Y.version]) {
4558     (function() {
4559         var VERSION = Y.version,
4560             BUILD = '/build/',
4561             ROOT = VERSION + BUILD,
4562             CDN_BASE = Y.Env.base,
4563             GALLERY_VERSION = '${loader.gallery}',
4564             TNT = '2in3',
4565             TNT_VERSION = '${loader.tnt}',
4566             YUI2_VERSION = '${loader.yui2}',
4567             COMBO_BASE = CDN_BASE + 'combo?',
4568             META = { version: VERSION,
4569                               root: ROOT,
4570                               base: Y.Env.base,
4571                               comboBase: COMBO_BASE,
4572                               skin: { defaultSkin: 'sam',
4573                                            base: 'assets/skins/',
4574                                            path: 'skin.css',
4575                                            after: ['cssreset',
4576                                                           'cssfonts',
4577                                                           'cssgrids',
4578                                                           'cssbase',
4579                                                           'cssreset-context',
4580                                                           'cssfonts-context']},
4581                               groups: {},
4582                               patterns: {} },
4583             groups = META.groups,
4584             yui2Update = function(tnt, yui2, config) {
4585                     
4586                 var root = TNT + '.' +
4587                         (tnt || TNT_VERSION) + '/' +
4588                         (yui2 || YUI2_VERSION) + BUILD,
4589                     base = (config && config.base) ? config.base : CDN_BASE,
4590                     combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;
4592                 groups.yui2.base = base + root;
4593                 groups.yui2.root = root;
4594                 groups.yui2.comboBase = combo;
4595             },
4596             galleryUpdate = function(tag, config) {
4597                 var root = (tag || GALLERY_VERSION) + BUILD,
4598                     base = (config && config.base) ? config.base : CDN_BASE,
4599                     combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;
4601                 groups.gallery.base = base + root;
4602                 groups.gallery.root = root;
4603                 groups.gallery.comboBase = combo;
4604             };
4607         groups[VERSION] = {};
4609         groups.gallery = {
4610             ext: false,
4611             combine: true,
4612             comboBase: COMBO_BASE,
4613             update: galleryUpdate,
4614             patterns: { 'gallery-': { },
4615                         'lang/gallery-': {},
4616                         'gallerycss-': { type: 'css' } }
4617         };
4619         groups.yui2 = {
4620             combine: true,
4621             ext: false,
4622             comboBase: COMBO_BASE,
4623             update: yui2Update,
4624             patterns: {
4625                 'yui2-': {
4626                     configFn: function(me) {
4627                         if (/-skin|reset|fonts|grids|base/.test(me.name)) {
4628                             me.type = 'css';
4629                             me.path = me.path.replace(/\.js/, '.css');
4630                             // this makes skins in builds earlier than
4631                             // 2.6.0 work as long as combine is false
4632                             me.path = me.path.replace(/\/yui2-skin/,
4633                                              '/assets/skins/sam/yui2-skin');
4634                         }
4635                     }
4636                 }
4637             }
4638         };
4640         galleryUpdate();
4641         yui2Update();
4643         YUI.Env[VERSION] = META;
4644     }());
4649  * Loader dynamically loads script and css files.  It includes the dependency
4650  * information for the version of the library in use, and will automatically pull in
4651  * dependencies for the modules requested. It can also load the
4652  * files from the Yahoo! CDN, and it can utilize the combo service provided on
4653  * this network to reduce the number of http connections required to download
4654  * YUI files.
4656  * @module loader
4657  * @main loader
4658  * @submodule loader-base
4659  */
4661 var NOT_FOUND = {},
4662     NO_REQUIREMENTS = [],
4663     MAX_URL_LENGTH = 1024,
4664     GLOBAL_ENV = YUI.Env,
4665     GLOBAL_LOADED = GLOBAL_ENV._loaded,
4666     CSS = 'css',
4667     JS = 'js',
4668     INTL = 'intl',
4669     VERSION = Y.version,
4670     ROOT_LANG = '',
4671     YObject = Y.Object,
4672     oeach = YObject.each,
4673     YArray = Y.Array,
4674     _queue = GLOBAL_ENV._loaderQueue,
4675     META = GLOBAL_ENV[VERSION],
4676     SKIN_PREFIX = 'skin-',
4677     L = Y.Lang,
4678     ON_PAGE = GLOBAL_ENV.mods,
4679     modulekey,
4680     cache,
4681     _path = function(dir, file, type, nomin) {
4682                         var path = dir + '/' + file;
4683                         if (!nomin) {
4684                             path += '-min';
4685                         }
4686                         path += '.' + (type || CSS);
4688                         return path;
4689                     };
4692  * The component metadata is stored in Y.Env.meta.
4693  * Part of the loader module.
4694  * @property meta
4695  * @for YUI
4696  */
4697 Y.Env.meta = META;
4700  * Loader dynamically loads script and css files.  It includes the dependency
4701  * info for the version of the library in use, and will automatically pull in
4702  * dependencies for the modules requested. It can load the
4703  * files from the Yahoo! CDN, and it can utilize the combo service provided on
4704  * this network to reduce the number of http connections required to download
4705  * YUI files. You can also specify an external, custom combo service to host
4706  * your modules as well.
4708         var Y = YUI();
4709         var loader = new Y.Loader({
4710             filter: 'debug',
4711             base: '../../',
4712             root: 'build/',
4713             combine: true,
4714             require: ['node', 'dd', 'console']
4715         });
4716         var out = loader.resolve(true);
4718  * @constructor
4719  * @class Loader
4720  * @param {Object} config an optional set of configuration options.
4721  * @param {String} config.base The base dir which to fetch this module from
4722  * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`
4723  * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`
4724  * @param {String|Object} config.filter A filter to apply to result urls. <a href="#property_filter">See filter property</a>
4725  * @param {Object} config.filters Per-component filter specification.  If specified for a given component, this overrides the filter config.
4726  * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies
4727  * @param {Array} config.ignore: A list of modules that should never be dynamically loaded
4728  * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page
4729  * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes
4730  * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes
4731  * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes
4732  * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes.  If not set, there is no timeout
4733  * @param {Object} config.context Execution context for all callbacks
4734  * @param {Function} config.onSuccess Callback for the 'success' event
4735  * @param {Function} config.onFailure Callback for the 'failure' event
4736  * @param {Function} config.onCSS Callback for the 'CSSComplete' event.  When loading YUI components with CSS the CSS is loaded first, then the script.  This provides a moment you can tie into to improve the presentation of the page while the script is loading.
4737  * @param {Function} config.onTimeout Callback for the 'timeout' event
4738  * @param {Function} config.onProgress Callback executed each time a script or css file is loaded
4739  * @param {Object} config.modules A list of module definitions.  See <a href="#method_addModule">Loader.addModule</a> for the supported module metadata
4740  * @param {Object} config.groups A list of group definitions.  Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`.
4741  * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use.  The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers.  These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox.
4742  * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use.  Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward.
4743  */
4744 Y.Loader = function(o) {
4746     var defaults = META.modules,
4747         self = this;
4748     
4749     //Catch no config passed.
4750     o = o || {};
4752     modulekey = META.md5;
4754     /**
4755      * Internal callback to handle multiple internal insert() calls
4756      * so that css is inserted prior to js
4757      * @property _internalCallback
4758      * @private
4759      */
4760     // self._internalCallback = null;
4762     /**
4763      * Callback that will be executed when the loader is finished
4764      * with an insert
4765      * @method onSuccess
4766      * @type function
4767      */
4768     // self.onSuccess = null;
4770     /**
4771      * Callback that will be executed if there is a failure
4772      * @method onFailure
4773      * @type function
4774      */
4775     // self.onFailure = null;
4777     /**
4778      * Callback for the 'CSSComplete' event.  When loading YUI components
4779      * with CSS the CSS is loaded first, then the script.  This provides
4780      * a moment you can tie into to improve the presentation of the page
4781      * while the script is loading.
4782      * @method onCSS
4783      * @type function
4784      */
4785     // self.onCSS = null;
4787     /**
4788      * Callback executed each time a script or css file is loaded
4789      * @method onProgress
4790      * @type function
4791      */
4792     // self.onProgress = null;
4794     /**
4795      * Callback that will be executed if a timeout occurs
4796      * @method onTimeout
4797      * @type function
4798      */
4799     // self.onTimeout = null;
4801     /**
4802      * The execution context for all callbacks
4803      * @property context
4804      * @default {YUI} the YUI instance
4805      */
4806     self.context = Y;
4808     /**
4809      * Data that is passed to all callbacks
4810      * @property data
4811      */
4812     // self.data = null;
4814     /**
4815      * Node reference or id where new nodes should be inserted before
4816      * @property insertBefore
4817      * @type string|HTMLElement
4818      */
4819     // self.insertBefore = null;
4821     /**
4822      * The charset attribute for inserted nodes
4823      * @property charset
4824      * @type string
4825      * @deprecated , use cssAttributes or jsAttributes.
4826      */
4827     // self.charset = null;
4829     /**
4830      * An object literal containing attributes to add to link nodes
4831      * @property cssAttributes
4832      * @type object
4833      */
4834     // self.cssAttributes = null;
4836     /**
4837      * An object literal containing attributes to add to script nodes
4838      * @property jsAttributes
4839      * @type object
4840      */
4841     // self.jsAttributes = null;
4843     /**
4844      * The base directory.
4845      * @property base
4846      * @type string
4847      * @default http://yui.yahooapis.com/[YUI VERSION]/build/
4848      */
4849     self.base = Y.Env.meta.base + Y.Env.meta.root;
4851     /**
4852      * Base path for the combo service
4853      * @property comboBase
4854      * @type string
4855      * @default http://yui.yahooapis.com/combo?
4856      */
4857     self.comboBase = Y.Env.meta.comboBase;
4859     /*
4860      * Base path for language packs.
4861      */
4862     // self.langBase = Y.Env.meta.langBase;
4863     // self.lang = "";
4865     /**
4866      * If configured, the loader will attempt to use the combo
4867      * service for YUI resources and configured external resources.
4868      * @property combine
4869      * @type boolean
4870      * @default true if a base dir isn't in the config
4871      */
4872     self.combine = o.base &&
4873         (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);
4874     
4875     /**
4876     * The default seperator to use between files in a combo URL
4877     * @property comboSep
4878     * @type {String}
4879     * @default Ampersand
4880     */
4881     self.comboSep = '&';
4882     /**
4883      * Max url length for combo urls.  The default is 2048. This is the URL
4884      * limit for the Yahoo! hosted combo servers.  If consuming
4885      * a different combo service that has a different URL limit
4886      * it is possible to override this default by supplying
4887      * the maxURLLength config option.  The config option will
4888      * only take effect if lower than the default.
4889      *
4890      * @property maxURLLength
4891      * @type int
4892      */
4893     self.maxURLLength = MAX_URL_LENGTH;
4895     /**
4896      * Ignore modules registered on the YUI global
4897      * @property ignoreRegistered
4898      * @default false
4899      */
4900     //self.ignoreRegistered = false;
4902     /**
4903      * Root path to prepend to module path for the combo
4904      * service
4905      * @property root
4906      * @type string
4907      * @default [YUI VERSION]/build/
4908      */
4909     self.root = Y.Env.meta.root;
4911     /**
4912      * Timeout value in milliseconds.  If set, self value will be used by
4913      * the get utility.  the timeout event will fire if
4914      * a timeout occurs.
4915      * @property timeout
4916      * @type int
4917      */
4918     self.timeout = 0;
4920     /**
4921      * A list of modules that should not be loaded, even if
4922      * they turn up in the dependency tree
4923      * @property ignore
4924      * @type string[]
4925      */
4926     // self.ignore = null;
4928     /**
4929      * A list of modules that should always be loaded, even
4930      * if they have already been inserted into the page.
4931      * @property force
4932      * @type string[]
4933      */
4934     // self.force = null;
4936     self.forceMap = {};
4938     /**
4939      * Should we allow rollups
4940      * @property allowRollup
4941      * @type boolean
4942      * @default false
4943      */
4944     self.allowRollup = false;
4946     /**
4947      * A filter to apply to result urls.  This filter will modify the default
4948      * path for all modules.  The default path for the YUI library is the
4949      * minified version of the files (e.g., event-min.js).  The filter property
4950      * can be a predefined filter or a custom filter.  The valid predefined
4951      * filters are:
4952      * <dl>
4953      *  <dt>DEBUG</dt>
4954      *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
4955      *      This option will automatically include the Logger widget</dd>
4956      *  <dt>RAW</dt>
4957      *  <dd>Selects the non-minified version of the library (e.g., event.js).
4958      *  </dd>
4959      * </dl>
4960      * You can also define a custom filter, which must be an object literal
4961      * containing a search expression and a replace string:
4962      *
4963      *      myFilter: {
4964      *          'searchExp': "-min\\.js",
4965      *          'replaceStr': "-debug.js"
4966      *      }
4967      *
4968      * @property filter
4969      * @type string| {searchExp: string, replaceStr: string}
4970      */
4971     // self.filter = null;
4973     /**
4974      * per-component filter specification.  If specified for a given
4975      * component, this overrides the filter config.
4976      * @property filters
4977      * @type object
4978      */
4979     self.filters = {};
4981     /**
4982      * The list of requested modules
4983      * @property required
4984      * @type {string: boolean}
4985      */
4986     self.required = {};
4988     /**
4989      * If a module name is predefined when requested, it is checked againsts
4990      * the patterns provided in this property.  If there is a match, the
4991      * module is added with the default configuration.
4992      *
4993      * At the moment only supporting module prefixes, but anticipate
4994      * supporting at least regular expressions.
4995      * @property patterns
4996      * @type Object
4997      */
4998     // self.patterns = Y.merge(Y.Env.meta.patterns);
4999     self.patterns = {};
5001     /**
5002      * The library metadata
5003      * @property moduleInfo
5004      */
5005     // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);
5006     self.moduleInfo = {};
5008     self.groups = Y.merge(Y.Env.meta.groups);
5010     /**
5011      * Provides the information used to skin the skinnable components.
5012      * The following skin definition would result in 'skin1' and 'skin2'
5013      * being loaded for calendar (if calendar was requested), and
5014      * 'sam' for all other skinnable components:
5015      *
5016      *      skin: {
5017      *          // The default skin, which is automatically applied if not
5018      *          // overriden by a component-specific skin definition.
5019      *          // Change this in to apply a different skin globally
5020      *          defaultSkin: 'sam',
5021      *
5022      *          // This is combined with the loader base property to get
5023      *          // the default root directory for a skin. ex:
5024      *          // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
5025      *          base: 'assets/skins/',
5026      *          
5027      *          // Any component-specific overrides can be specified here,
5028      *          // making it possible to load different skins for different
5029      *          // components.  It is possible to load more than one skin
5030      *          // for a given component as well.
5031      *          overrides: {
5032      *              calendar: ['skin1', 'skin2']
5033      *          }
5034      *      }
5035      * @property skin
5036      * @type {Object}
5037      */
5038     self.skin = Y.merge(Y.Env.meta.skin);
5040     /*
5041      * Map of conditional modules
5042      * @since 3.2.0
5043      */
5044     self.conditions = {};
5046     // map of modules with a hash of modules that meet the requirement
5047     // self.provides = {};
5049     self.config = o;
5050     self._internal = true;
5053     cache = GLOBAL_ENV._renderedMods;
5055     if (cache) {
5056         oeach(cache, function modCache(v, k) {
5057             self.moduleInfo[k] = Y.merge(v);
5058         });
5060         cache = GLOBAL_ENV._conditions;
5062         oeach(cache, function condCache(v, k) {
5063             self.conditions[k] = Y.merge(v);
5064         });
5066     } else {
5067         oeach(defaults, self.addModule, self);
5068     }
5071     /**
5072      * Set when beginning to compute the dependency tree.
5073      * Composed of what YUI reports to be loaded combined
5074      * with what has been loaded by any instance on the page
5075      * with the version number specified in the metadata.
5076      * @property loaded
5077      * @type {string: boolean}
5078      */
5079     self.loaded = GLOBAL_LOADED[VERSION];
5082     self._inspectPage();
5084     self._internal = false;
5086     self._config(o);
5088     self.forceMap = (self.force) ? Y.Array.hash(self.force) : {};       
5090     self.testresults = null;
5092     if (Y.config.tests) {
5093         self.testresults = Y.config.tests;
5094     }
5096     /**
5097      * List of rollup files found in the library metadata
5098      * @property rollups
5099      */
5100     // self.rollups = null;
5102     /**
5103      * Whether or not to load optional dependencies for
5104      * the requested modules
5105      * @property loadOptional
5106      * @type boolean
5107      * @default false
5108      */
5109     // self.loadOptional = false;
5111     /**
5112      * All of the derived dependencies in sorted order, which
5113      * will be populated when either calculate() or insert()
5114      * is called
5115      * @property sorted
5116      * @type string[]
5117      */
5118     self.sorted = [];
5120     /*
5121      * A list of modules to attach to the YUI instance when complete.
5122      * If not supplied, the sorted list of dependencies are applied.
5123      * @property attaching
5124      */
5125     // self.attaching = null;
5127     /**
5128      * Flag to indicate the dependency tree needs to be recomputed
5129      * if insert is called again.
5130      * @property dirty
5131      * @type boolean
5132      * @default true
5133      */
5134     self.dirty = true;
5136     /**
5137      * List of modules inserted by the utility
5138      * @property inserted
5139      * @type {string: boolean}
5140      */
5141     self.inserted = {};
5143     /**
5144      * List of skipped modules during insert() because the module
5145      * was not defined
5146      * @property skipped
5147      */
5148     self.skipped = {};
5150     // Y.on('yui:load', self.loadNext, self);
5152     self.tested = {};
5154     /*
5155      * Cached sorted calculate results
5156      * @property results
5157      * @since 3.2.0
5158      */
5159     //self.results = {};
5163 Y.Loader.prototype = {
5164     /**
5165     Regex that matches a CSS URL. Used to guess the file type when it's not
5166     specified.
5168     @property REGEX_CSS
5169     @type RegExp
5170     @final
5171     @protected
5172     @since 3.5.0
5173     **/
5174     REGEX_CSS: /\.css(?:[?;].*)?$/i,
5175     
5176     /**
5177     * Default filters for raw and debug
5178     * @property FILTER_DEFS
5179     * @type Object
5180     * @final
5181     * @protected
5182     */
5183     FILTER_DEFS: {
5184         RAW: {
5185             'searchExp': '-min\\.js',
5186             'replaceStr': '.js'
5187         },
5188         DEBUG: {
5189             'searchExp': '-min\\.js',
5190             'replaceStr': '-debug.js'
5191         }
5192     },
5193     /*
5194     * Check the pages meta-data and cache the result.
5195     * @method _inspectPage
5196     * @private
5197     */
5198     _inspectPage: function() {
5199         
5200         //Inspect the page for CSS only modules and mark them as loaded.
5201         oeach(this.moduleInfo, function(v, k) {
5202             if (v.type && v.type === CSS) {
5203                 if (this.isCSSLoaded(v.name)) {
5204                     this.loaded[k] = true;
5205                 }
5206             }
5207         }, this);
5208         
5209         oeach(ON_PAGE, function(v, k) {
5210            if (v.details) {
5211                var m = this.moduleInfo[k],
5212                    req = v.details.requires,
5213                    mr = m && m.requires;
5214                if (m) {
5215                    if (!m._inspected && req && mr.length != req.length) {
5216                        // console.log('deleting ' + m.name);
5217                        delete m.expanded;
5218                    }
5219                } else {
5220                    m = this.addModule(v.details, k);
5221                }
5222                m._inspected = true;
5223            }
5224        }, this);
5225     },
5226     /*
5227     * returns true if b is not loaded, and is required directly or by means of modules it supersedes.
5228     * @private
5229     * @method _requires
5230     * @param {String} mod1 The first module to compare
5231     * @param {String} mod2 The second module to compare
5232     */
5233    _requires: function(mod1, mod2) {
5235         var i, rm, after_map, s,
5236             info = this.moduleInfo,
5237             m = info[mod1],
5238             other = info[mod2];
5240         if (!m || !other) {
5241             return false;
5242         }
5244         rm = m.expanded_map;
5245         after_map = m.after_map;
5247         // check if this module should be sorted after the other
5248         // do this first to short circut circular deps
5249         if (after_map && (mod2 in after_map)) {
5250             return true;
5251         }
5253         after_map = other.after_map;
5255         // and vis-versa
5256         if (after_map && (mod1 in after_map)) {
5257             return false;
5258         }
5260         // check if this module requires one the other supersedes
5261         s = info[mod2] && info[mod2].supersedes;
5262         if (s) {
5263             for (i = 0; i < s.length; i++) {
5264                 if (this._requires(mod1, s[i])) {
5265                     return true;
5266                 }
5267             }
5268         }
5270         s = info[mod1] && info[mod1].supersedes;
5271         if (s) {
5272             for (i = 0; i < s.length; i++) {
5273                 if (this._requires(mod2, s[i])) {
5274                     return false;
5275                 }
5276             }
5277         }
5279         // check if this module requires the other directly
5280         // if (r && YArray.indexOf(r, mod2) > -1) {
5281         if (rm && (mod2 in rm)) {
5282             return true;
5283         }
5285         // external css files should be sorted below yui css
5286         if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {
5287             return true;
5288         }
5290         return false;
5291     },
5292     /**
5293     * Apply a new config to the Loader instance
5294     * @method _config
5295     * @private
5296     * @param {Object} o The new configuration
5297     */
5298     _config: function(o) {
5299         var i, j, val, f, group, groupName, self = this;
5300         // apply config values
5301         if (o) {
5302             for (i in o) {
5303                 if (o.hasOwnProperty(i)) {
5304                     val = o[i];
5305                     if (i == 'require') {
5306                         self.require(val);
5307                     } else if (i == 'skin') {
5308                         //If the config.skin is a string, format to the expected object
5309                         if (typeof val === 'string') {
5310                             self.skin.defaultSkin = o.skin;
5311                             val = {
5312                                 defaultSkin: val
5313                             };
5314                         }
5316                         Y.mix(self.skin, val, true);
5317                     } else if (i == 'groups') {
5318                         for (j in val) {
5319                             if (val.hasOwnProperty(j)) {
5320                                 groupName = j;
5321                                 group = val[j];
5322                                 self.addGroup(group, groupName);
5323                                 if (group.aliases) {
5324                                     oeach(group.aliases, self.addAlias, self);
5325                                 }
5326                             }
5327                         }
5329                     } else if (i == 'modules') {
5330                         // add a hash of module definitions
5331                         oeach(val, self.addModule, self);
5332                     } else if (i === 'aliases') {
5333                         oeach(val, self.addAlias, self);
5334                     } else if (i == 'gallery') {
5335                         this.groups.gallery.update(val, o);
5336                     } else if (i == 'yui2' || i == '2in3') {
5337                         this.groups.yui2.update(o['2in3'], o.yui2, o);
5338                     } else {
5339                         self[i] = val;
5340                     }
5341                 }
5342             }
5343         }
5345         // fix filter
5346         f = self.filter;
5348         if (L.isString(f)) {
5349             f = f.toUpperCase();
5350             self.filterName = f;
5351             self.filter = self.FILTER_DEFS[f];
5352             if (f == 'DEBUG') {
5353                 self.require('yui-log', 'dump');
5354             }
5355         }
5356         
5358         if (self.lang) {
5359             //Removed this so that when Loader is invoked
5360             //it doesn't request what it doesn't need.
5361             //self.require('intl-base', 'intl');
5362         }
5364     },
5366     /**
5367      * Returns the skin module name for the specified skin name.  If a
5368      * module name is supplied, the returned skin module name is
5369      * specific to the module passed in.
5370      * @method formatSkin
5371      * @param {string} skin the name of the skin.
5372      * @param {string} mod optional: the name of a module to skin.
5373      * @return {string} the full skin module name.
5374      */
5375     formatSkin: function(skin, mod) {
5376         var s = SKIN_PREFIX + skin;
5377         if (mod) {
5378             s = s + '-' + mod;
5379         }
5381         return s;
5382     },
5384     /**
5385      * Adds the skin def to the module info
5386      * @method _addSkin
5387      * @param {string} skin the name of the skin.
5388      * @param {string} mod the name of the module.
5389      * @param {string} parent parent module if this is a skin of a
5390      * submodule or plugin.
5391      * @return {string} the module name for the skin.
5392      * @private
5393      */
5394     _addSkin: function(skin, mod, parent) {
5395         var mdef, pkg, name, nmod,
5396             info = this.moduleInfo,
5397             sinf = this.skin,
5398             ext = info[mod] && info[mod].ext;
5400         // Add a module definition for the module-specific skin css
5401         if (mod) {
5402             name = this.formatSkin(skin, mod);
5403             if (!info[name]) {
5404                 mdef = info[mod];
5405                 pkg = mdef.pkg || mod;
5406                 nmod = {
5407                     name: name,
5408                     group: mdef.group,
5409                     type: 'css',
5410                     after: sinf.after,
5411                     path: (parent || pkg) + '/' + sinf.base + skin +
5412                           '/' + mod + '.css',
5413                     ext: ext
5414                 };
5415                 if (mdef.base) {
5416                     nmod.base = mdef.base;
5417                 }
5418                 if (mdef.configFn) {
5419                     nmod.configFn = mdef.configFn;
5420                 }
5421                 this.addModule(nmod, name);
5423             }
5424         }
5426         return name;
5427     },
5428     /**
5429     * Adds an alias module to the system
5430     * @method addAlias
5431     * @param {Array} use An array of modules that makes up this alias
5432     * @param {String} name The name of the alias
5433     * @example
5434     *       var loader = new Y.Loader({});
5435     *       loader.addAlias([ 'node', 'yql' ], 'davglass');
5436     *       loader.require(['davglass']);
5437     *       var out = loader.resolve(true);
5438     *
5439     *       //out.js will contain Node and YQL modules
5440     */
5441     addAlias: function(use, name) {
5442         YUI.Env.aliases[name] = use;
5443         this.addModule({
5444             name: name,
5445             use: use
5446         });
5447     },
5448     /**
5449      * Add a new module group
5450      * @method addGroup
5451      * @param {Object} config An object containing the group configuration data
5452      * @param {String} config.name required, the group name
5453      * @param {String} config.base The base directory for this module group
5454      * @param {String} config.root The root path to add to each combo resource path
5455      * @param {Boolean} config.combine Should the request be combined
5456      * @param {String} config.comboBase Combo service base path
5457      * @param {Object} config.modules The group of modules
5458      * @param {String} name the group name.
5459      * @example
5460      *      var loader = new Y.Loader({});
5461      *      loader.addGroup({
5462      *          name: 'davglass',
5463      *          combine: true,
5464      *          comboBase: '/combo?',
5465      *          root: '',
5466      *          modules: {
5467      *              //Module List here
5468      *          }
5469      *      }, 'davglass');
5470      */
5471     addGroup: function(o, name) {
5472         var mods = o.modules,
5473             self = this;
5474         name = name || o.name;
5475         o.name = name;
5476         self.groups[name] = o;
5478         if (o.patterns) {
5479             oeach(o.patterns, function(v, k) {
5480                 v.group = name;
5481                 self.patterns[k] = v;
5482             });
5483         }
5485         if (mods) {
5486             oeach(mods, function(v, k) {
5487                 if (typeof v === 'string') {
5488                     v = { name: k, fullpath: v };
5489                 }
5490                 v.group = name;
5491                 self.addModule(v, k);
5492             }, self);
5493         }
5494     },
5496     /**
5497      * Add a new module to the component metadata.
5498      * @method addModule
5499      * @param {Object} config An object containing the module data.
5500      * @param {String} config.name Required, the component name
5501      * @param {String} config.type Required, the component type (js or css)
5502      * @param {String} config.path Required, the path to the script from `base`
5503      * @param {Array} config.requires Array of modules required by this component
5504      * @param {Array} [config.optional] Array of optional modules for this component
5505      * @param {Array} [config.supersedes] Array of the modules this component replaces
5506      * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one
5507      * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array
5508      * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup
5509      * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`
5510      * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in
5511      * @param {Object} [config.submodules] Hash of submodules
5512      * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration.
5513      * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `["en-GB", "zh-Hans-CN"]`
5514      * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met.  This is an object with up to three fields:
5515      * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load
5516      * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded.
5517      * @param {String} [config.condition.when] Specifies the load order of the conditional module
5518      *  with regard to the position of the trigger module.
5519      *  This should be one of three values: `before`, `after`, or `instead`.  The default is `after`.
5520      * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`
5521      * @param {Function} [config.configFn] A function to exectute when configuring this module
5522      * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config.
5523      * @param {String} [name] The module name, required if not in the module data.
5524      * @return {Object} the module definition or null if the object passed in did not provide all required attributes.
5525      */
5526     addModule: function(o, name) {
5527         name = name || o.name;
5529         if (typeof o === 'string') {
5530             o = { name: name, fullpath: o };
5531         }
5532         
5533         //Only merge this data if the temp flag is set
5534         //from an earlier pass from a pattern or else
5535         //an override module (YUI_config) can not be used to
5536         //replace a default module.
5537         if (this.moduleInfo[name] && this.moduleInfo[name].temp) {
5538             //This catches temp modules loaded via a pattern
5539             // The module will be added twice, once from the pattern and
5540             // Once from the actual add call, this ensures that properties
5541             // that were added to the module the first time around (group: gallery)
5542             // are also added the second time around too.
5543             o = Y.merge(this.moduleInfo[name], o);
5544         }
5546         o.name = name;
5548         if (!o || !o.name) {
5549             return null;
5550         }
5552         if (!o.type) {
5553             //Always assume it's javascript unless the CSS pattern is matched.
5554             o.type = JS;
5555             var p = o.path || o.fullpath;
5556             if (p && this.REGEX_CSS.test(p)) {
5557                 o.type = CSS;
5558             }
5559         }
5561         if (!o.path && !o.fullpath) {
5562             o.path = _path(name, name, o.type);
5563         }
5564         o.supersedes = o.supersedes || o.use;
5566         o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;
5568         // Handle submodule logic
5569         var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,
5570             j, langs, packName, supName, flatSup, flatLang, lang, ret,
5571             overrides, skinname, when,
5572             conditions = this.conditions, trigger;
5573             // , existing = this.moduleInfo[name], newr;
5574         
5575         this.moduleInfo[name] = o;
5577         o.requires = o.requires || [];
5579         if (o.skinnable) {
5580             skinname = this._addSkin(this.skin.defaultSkin, name);
5581             o.requires.unshift(skinname);
5582         }
5584         o.requires = this.filterRequires(o.requires) || [];
5586         if (!o.langPack && o.lang) {
5587             langs = YArray(o.lang);
5588             for (j = 0; j < langs.length; j++) {
5589                 lang = langs[j];
5590                 packName = this.getLangPackName(lang, name);
5591                 smod = this.moduleInfo[packName];
5592                 if (!smod) {
5593                     smod = this._addLangPack(lang, o, packName);
5594                 }
5595             }
5596         }
5599         if (subs) {
5600             sup = o.supersedes || [];
5601             l = 0;
5603             for (i in subs) {
5604                 if (subs.hasOwnProperty(i)) {
5605                     s = subs[i];
5607                     s.path = s.path || _path(name, i, o.type);
5608                     s.pkg = name;
5609                     s.group = o.group;
5611                     if (s.supersedes) {
5612                         sup = sup.concat(s.supersedes);
5613                     }
5615                     smod = this.addModule(s, i);
5616                     sup.push(i);
5618                     if (smod.skinnable) {
5619                         o.skinnable = true;
5620                         overrides = this.skin.overrides;
5621                         if (overrides && overrides[i]) {
5622                             for (j = 0; j < overrides[i].length; j++) {
5623                                 skinname = this._addSkin(overrides[i][j],
5624                                          i, name);
5625                                 sup.push(skinname);
5626                             }
5627                         }
5628                         skinname = this._addSkin(this.skin.defaultSkin,
5629                                         i, name);
5630                         sup.push(skinname);
5631                     }
5633                     // looks like we are expected to work out the metadata
5634                     // for the parent module language packs from what is
5635                     // specified in the child modules.
5636                     if (s.lang && s.lang.length) {
5638                         langs = YArray(s.lang);
5639                         for (j = 0; j < langs.length; j++) {
5640                             lang = langs[j];
5641                             packName = this.getLangPackName(lang, name);
5642                             supName = this.getLangPackName(lang, i);
5643                             smod = this.moduleInfo[packName];
5645                             if (!smod) {
5646                                 smod = this._addLangPack(lang, o, packName);
5647                             }
5649                             flatSup = flatSup || YArray.hash(smod.supersedes);
5651                             if (!(supName in flatSup)) {
5652                                 smod.supersedes.push(supName);
5653                             }
5655                             o.lang = o.lang || [];
5657                             flatLang = flatLang || YArray.hash(o.lang);
5659                             if (!(lang in flatLang)) {
5660                                 o.lang.push(lang);
5661                             }
5663 // Add rollup file, need to add to supersedes list too
5665                             // default packages
5666                             packName = this.getLangPackName(ROOT_LANG, name);
5667                             supName = this.getLangPackName(ROOT_LANG, i);
5669                             smod = this.moduleInfo[packName];
5671                             if (!smod) {
5672                                 smod = this._addLangPack(lang, o, packName);
5673                             }
5675                             if (!(supName in flatSup)) {
5676                                 smod.supersedes.push(supName);
5677                             }
5679 // Add rollup file, need to add to supersedes list too
5681                         }
5682                     }
5684                     l++;
5685                 }
5686             }
5687             //o.supersedes = YObject.keys(YArray.hash(sup));
5688             o.supersedes = YArray.dedupe(sup);
5689             if (this.allowRollup) {
5690                 o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
5691             }
5692         }
5694         plugins = o.plugins;
5695         if (plugins) {
5696             for (i in plugins) {
5697                 if (plugins.hasOwnProperty(i)) {
5698                     plug = plugins[i];
5699                     plug.pkg = name;
5700                     plug.path = plug.path || _path(name, i, o.type);
5701                     plug.requires = plug.requires || [];
5702                     plug.group = o.group;
5703                     this.addModule(plug, i);
5704                     if (o.skinnable) {
5705                         this._addSkin(this.skin.defaultSkin, i, name);
5706                     }
5708                 }
5709             }
5710         }
5712         if (o.condition) {
5713             t = o.condition.trigger;
5714             if (YUI.Env.aliases[t]) {
5715                 t = YUI.Env.aliases[t];
5716             }
5717             if (!Y.Lang.isArray(t)) {
5718                 t = [t];
5719             }
5721             for (i = 0; i < t.length; i++) {
5722                 trigger = t[i];
5723                 when = o.condition.when;
5724                 conditions[trigger] = conditions[trigger] || {};
5725                 conditions[trigger][name] = o.condition;
5726                 // the 'when' attribute can be 'before', 'after', or 'instead'
5727                 // the default is after.
5728                 if (when && when != 'after') {
5729                     if (when == 'instead') { // replace the trigger
5730                         o.supersedes = o.supersedes || [];
5731                         o.supersedes.push(trigger);
5732                     } else { // before the trigger
5733                         // the trigger requires the conditional mod,
5734                         // so it should appear before the conditional
5735                         // mod if we do not intersede.
5736                     }
5737                 } else { // after the trigger
5738                     o.after = o.after || [];
5739                     o.after.push(trigger);
5740                 }
5741             }
5742         }
5744         if (o.supersedes) {
5745             o.supersedes = this.filterRequires(o.supersedes);
5746         }
5748         if (o.after) {
5749             o.after = this.filterRequires(o.after);
5750             o.after_map = YArray.hash(o.after);
5751         }
5753         // this.dirty = true;
5755         if (o.configFn) {
5756             ret = o.configFn(o);
5757             if (ret === false) {
5758                 delete this.moduleInfo[name];
5759                 delete GLOBAL_ENV._renderedMods[name];
5760                 o = null;
5761             }
5762         }
5763         //Add to global cache
5764         if (o) {
5765             if (!GLOBAL_ENV._renderedMods) {
5766                 GLOBAL_ENV._renderedMods = {};
5767             }
5768             GLOBAL_ENV._renderedMods[name] = Y.merge(o);
5769             GLOBAL_ENV._conditions = conditions;
5770         }
5772         return o;
5773     },
5775     /**
5776      * Add a requirement for one or more module
5777      * @method require
5778      * @param {string[] | string*} what the modules to load.
5779      */
5780     require: function(what) {
5781         var a = (typeof what === 'string') ? YArray(arguments) : what;
5782         this.dirty = true;
5783         this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));
5785         this._explodeRollups();
5786     },
5787     /**
5788     * Grab all the items that were asked for, check to see if the Loader
5789     * meta-data contains a "use" array. If it doesm remove the asked item and replace it with 
5790     * the content of the "use".
5791     * This will make asking for: "dd"
5792     * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
5793     * @private
5794     * @method _explodeRollups
5795     */
5796     _explodeRollups: function() {
5797         var self = this, m,
5798         r = self.required;
5799         if (!self.allowRollup) {
5800             oeach(r, function(v, name) {
5801                 m = self.getModule(name);
5802                 if (m && m.use) {
5803                     //delete r[name];
5804                     YArray.each(m.use, function(v) {
5805                         m = self.getModule(v);
5806                         if (m && m.use) {
5807                             //delete r[v];
5808                             YArray.each(m.use, function(v) {
5809                                 r[v] = true;
5810                             });
5811                         } else {
5812                             r[v] = true;
5813                         }
5814                     });
5815                 }
5816             });
5817             self.required = r;
5818         }
5820     },
5821     /**
5822     * Explodes the required array to remove aliases and replace them with real modules
5823     * @method filterRequires
5824     * @param {Array} r The original requires array
5825     * @return {Array} The new array of exploded requirements
5826     */
5827     filterRequires: function(r) {
5828         if (r) {
5829             if (!Y.Lang.isArray(r)) {
5830                 r = [r];
5831             }
5832             r = Y.Array(r);
5833             var c = [], i, mod, o, m;
5835             for (i = 0; i < r.length; i++) {
5836                 mod = this.getModule(r[i]);
5837                 if (mod && mod.use) {
5838                     for (o = 0; o < mod.use.length; o++) {
5839                         //Must walk the other modules in case a module is a rollup of rollups (datatype)
5840                         m = this.getModule(mod.use[o]);
5841                         if (m && m.use) {
5842                             c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));
5843                         } else {
5844                             c.push(mod.use[o]);
5845                         }
5846                     }
5847                 } else {
5848                     c.push(r[i]);
5849                 }
5850             }
5851             r = c;
5852         }
5853         return r;
5854     },
5855     /**
5856      * Returns an object containing properties for all modules required
5857      * in order to load the requested module
5858      * @method getRequires
5859      * @param {object}  mod The module definition from moduleInfo.
5860      * @return {array} the expanded requirement list.
5861      */
5862     getRequires: function(mod) {
5864         if (!mod) {
5865             //console.log('returning no reqs for ' + mod.name);
5866             return NO_REQUIREMENTS;
5867         }
5869         if (mod._parsed) {
5870             //console.log('returning requires for ' + mod.name, mod.requires);
5871             return mod.expanded || NO_REQUIREMENTS;
5872         }
5874         //TODO add modue cache here out of scope..
5876         var i, m, j, add, packName, lang, testresults = this.testresults,
5877             name = mod.name, cond,
5878             adddef = ON_PAGE[name] && ON_PAGE[name].details,
5879             d, k, m1,
5880             r, old_mod,
5881             o, skinmod, skindef, skinpar, skinname,
5882             intl = mod.lang || mod.intl,
5883             info = this.moduleInfo,
5884             ftests = Y.Features && Y.Features.tests.load,
5885             hash;
5887         // console.log(name);
5889         // pattern match leaves module stub that needs to be filled out
5890         if (mod.temp && adddef) {
5891             old_mod = mod;
5892             mod = this.addModule(adddef, name);
5893             mod.group = old_mod.group;
5894             mod.pkg = old_mod.pkg;
5895             delete mod.expanded;
5896         }
5898         // console.log('cache: ' + mod.langCache + ' == ' + this.lang);
5900         // if (mod.expanded && (!mod.langCache || mod.langCache == this.lang)) {
5901         if (mod.expanded && (!this.lang || mod.langCache === this.lang)) {
5902             return mod.expanded;
5903         }
5904         
5906         d = [];
5907         hash = {};
5908         r = this.filterRequires(mod.requires);
5909         if (mod.lang) {
5910             //If a module has a lang attribute, auto add the intl requirement.
5911             d.unshift('intl');
5912             r.unshift('intl');
5913             intl = true;
5914         }
5915         o = this.filterRequires(mod.optional);
5918         mod._parsed = true;
5919         mod.langCache = this.lang;
5921         for (i = 0; i < r.length; i++) {
5922             if (!hash[r[i]]) {
5923                 d.push(r[i]);
5924                 hash[r[i]] = true;
5925                 m = this.getModule(r[i]);
5926                 if (m) {
5927                     add = this.getRequires(m);
5928                     intl = intl || (m.expanded_map &&
5929                         (INTL in m.expanded_map));
5930                     for (j = 0; j < add.length; j++) {
5931                         d.push(add[j]);
5932                     }
5933                 }
5934             }
5935         }
5937         // get the requirements from superseded modules, if any
5938         r = this.filterRequires(mod.supersedes);
5939         if (r) {
5940             for (i = 0; i < r.length; i++) {
5941                 if (!hash[r[i]]) {
5942                     // if this module has submodules, the requirements list is
5943                     // expanded to include the submodules.  This is so we can
5944                     // prevent dups when a submodule is already loaded and the
5945                     // parent is requested.
5946                     if (mod.submodules) {
5947                         d.push(r[i]);
5948                     }
5950                     hash[r[i]] = true;
5951                     m = this.getModule(r[i]);
5953                     if (m) {
5954                         add = this.getRequires(m);
5955                         intl = intl || (m.expanded_map &&
5956                             (INTL in m.expanded_map));
5957                         for (j = 0; j < add.length; j++) {
5958                             d.push(add[j]);
5959                         }
5960                     }
5961                 }
5962             }
5963         }
5965         if (o && this.loadOptional) {
5966             for (i = 0; i < o.length; i++) {
5967                 if (!hash[o[i]]) {
5968                     d.push(o[i]);
5969                     hash[o[i]] = true;
5970                     m = info[o[i]];
5971                     if (m) {
5972                         add = this.getRequires(m);
5973                         intl = intl || (m.expanded_map &&
5974                             (INTL in m.expanded_map));
5975                         for (j = 0; j < add.length; j++) {
5976                             d.push(add[j]);
5977                         }
5978                     }
5979                 }
5980             }
5981         }
5983         cond = this.conditions[name];
5985         if (cond) {
5986             //Set the module to not parsed since we have conditionals and this could change the dependency tree.
5987             mod._parsed = false;
5988             if (testresults && ftests) {
5989                 oeach(testresults, function(result, id) {
5990                     var condmod = ftests[id].name;
5991                     if (!hash[condmod] && ftests[id].trigger == name) {
5992                         if (result && ftests[id]) {
5993                             hash[condmod] = true;
5994                             d.push(condmod);
5995                         }
5996                     }
5997                 });
5998             } else {
5999                 oeach(cond, function(def, condmod) {
6000                     if (!hash[condmod]) {
6001                         //first see if they've specfied a ua check
6002                         //then see if they've got a test fn & if it returns true
6003                         //otherwise just having a condition block is enough
6004                         var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
6005                                     (def.test && def.test(Y, r)));
6007                         if (go) {
6008                             hash[condmod] = true;
6009                             d.push(condmod);
6010                             m = this.getModule(condmod);
6011                             if (m) {
6012                                 add = this.getRequires(m);
6013                                 for (j = 0; j < add.length; j++) {
6014                                     d.push(add[j]);
6015                                 }
6017                             }
6018                         }
6019                     }
6020                 }, this);
6021             }
6022         }
6024         // Create skin modules
6025         if (mod.skinnable) {
6026             skindef = this.skin.overrides;
6027             oeach(YUI.Env.aliases, function(o, n) {
6028                 if (Y.Array.indexOf(o, name) > -1) {
6029                     skinpar = n;
6030                 }
6031             });
6032             if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {
6033                 skinname = name;
6034                 if (skindef[skinpar]) {
6035                     skinname = skinpar;
6036                 }
6037                 for (i = 0; i < skindef[skinname].length; i++) {
6038                     skinmod = this._addSkin(skindef[skinname][i], name);
6039                     if (!this.isCSSLoaded(skinmod, this._boot)) {
6040                         d.push(skinmod);
6041                     }
6042                 }
6043             } else {
6044                 skinmod = this._addSkin(this.skin.defaultSkin, name);
6045                 if (!this.isCSSLoaded(skinmod, this._boot)) {
6046                     d.push(skinmod);
6047                 }
6048             }
6049         }
6051         mod._parsed = false;
6053         if (intl) {
6055             if (mod.lang && !mod.langPack && Y.Intl) {
6056                 lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
6057                 packName = this.getLangPackName(lang, name);
6058                 if (packName) {
6059                     d.unshift(packName);
6060                 }
6061             }
6062             d.unshift(INTL);
6063         }
6065         mod.expanded_map = YArray.hash(d);
6067         mod.expanded = YObject.keys(mod.expanded_map);
6069         return mod.expanded;
6070     },
6071     /**
6072     * Check to see if named css module is already loaded on the page
6073     * @method isCSSLoaded
6074     * @param {String} name The name of the css file
6075     * @return Boolean
6076     */
6077     isCSSLoaded: function(name, skip) {
6078         //TODO - Make this call a batching call with name being an array
6079         if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {
6080             return false;
6081         }
6083         var el = YUI.Env.cssStampEl,
6084             ret = false,
6085             style = el.currentStyle; //IE
6087         //Add the classname to the element
6088         el.className = name;
6090         if (!style) {
6091             style = Y.config.doc.defaultView.getComputedStyle(el, null);
6092         }
6094         if (style && style['display'] === 'none') {
6095             ret = true;
6096         }
6099         el.className = ''; //Reset the classname to ''
6100         return ret;
6101     },
6103     /**
6104      * Returns a hash of module names the supplied module satisfies.
6105      * @method getProvides
6106      * @param {string} name The name of the module.
6107      * @return {object} what this module provides.
6108      */
6109     getProvides: function(name) {
6110         var m = this.getModule(name), o, s;
6111             // supmap = this.provides;
6113         if (!m) {
6114             return NOT_FOUND;
6115         }
6117         if (m && !m.provides) {
6118             o = {};
6119             s = m.supersedes;
6121             if (s) {
6122                 YArray.each(s, function(v) {
6123                     Y.mix(o, this.getProvides(v));
6124                 }, this);
6125             }
6127             o[name] = true;
6128             m.provides = o;
6130         }
6132         return m.provides;
6133     },
6135     /**
6136      * Calculates the dependency tree, the result is stored in the sorted
6137      * property.
6138      * @method calculate
6139      * @param {object} o optional options object.
6140      * @param {string} type optional argument to prune modules.
6141      */
6142     calculate: function(o, type) {
6143         if (o || type || this.dirty) {
6145             if (o) {
6146                 this._config(o);
6147             }
6149             if (!this._init) {
6150                 this._setup();
6151             }
6153             this._explode();
6155             if (this.allowRollup) {
6156                 this._rollup();
6157             } else {
6158                 this._explodeRollups();
6159             }
6160             this._reduce();
6161             this._sort();
6162         }
6163     },
6164     /**
6165     * Creates a "psuedo" package for languages provided in the lang array
6166     * @method _addLangPack
6167     * @private
6168     * @param {String} lang The language to create
6169     * @param {Object} m The module definition to create the language pack around
6170     * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
6171     * @return {Object} The module definition
6172     */
6173     _addLangPack: function(lang, m, packName) {
6174         var name = m.name,
6175             packPath, conf,
6176             existing = this.moduleInfo[packName];
6178         if (!existing) {
6180             packPath = _path((m.pkg || name), packName, JS, true);
6182             conf = {
6183                 path: packPath,
6184                 intl: true,
6185                 langPack: true,
6186                 ext: m.ext,
6187                 group: m.group,
6188                 supersedes: []
6189             };
6191             if (m.configFn) {
6192                 conf.configFn = m.configFn;
6193             }
6195             this.addModule(conf, packName);
6197             if (lang) {
6198                 Y.Env.lang = Y.Env.lang || {};
6199                 Y.Env.lang[lang] = Y.Env.lang[lang] || {};
6200                 Y.Env.lang[lang][name] = true;
6201             }
6202         }
6204         return this.moduleInfo[packName];
6205     },
6207     /**
6208      * Investigates the current YUI configuration on the page.  By default,
6209      * modules already detected will not be loaded again unless a force
6210      * option is encountered.  Called by calculate()
6211      * @method _setup
6212      * @private
6213      */
6214     _setup: function() {
6215         var info = this.moduleInfo, name, i, j, m, l,
6216             packName;
6218         for (name in info) {
6219             if (info.hasOwnProperty(name)) {
6220                 m = info[name];
6221                 if (m) {
6223                     // remove dups
6224                     //m.requires = YObject.keys(YArray.hash(m.requires));
6225                     m.requires = YArray.dedupe(m.requires);
6227                     // Create lang pack modules
6228                     if (m.lang && m.lang.length) {
6229                         // Setup root package if the module has lang defined,
6230                         // it needs to provide a root language pack
6231                         packName = this.getLangPackName(ROOT_LANG, name);
6232                         this._addLangPack(null, m, packName);
6233                     }
6235                 }
6236             }
6237         }
6240         //l = Y.merge(this.inserted);
6241         l = {};
6243         // available modules
6244         if (!this.ignoreRegistered) {
6245             Y.mix(l, GLOBAL_ENV.mods);
6246         }
6248         // add the ignore list to the list of loaded packages
6249         if (this.ignore) {
6250             Y.mix(l, YArray.hash(this.ignore));
6251         }
6253         // expand the list to include superseded modules
6254         for (j in l) {
6255             if (l.hasOwnProperty(j)) {
6256                 Y.mix(l, this.getProvides(j));
6257             }
6258         }
6260         // remove modules on the force list from the loaded list
6261         if (this.force) {
6262             for (i = 0; i < this.force.length; i++) {
6263                 if (this.force[i] in l) {
6264                     delete l[this.force[i]];
6265                 }
6266             }
6267         }
6269         Y.mix(this.loaded, l);
6271         this._init = true;
6272     },
6274     /**
6275      * Builds a module name for a language pack
6276      * @method getLangPackName
6277      * @param {string} lang the language code.
6278      * @param {string} mname the module to build it for.
6279      * @return {string} the language pack module name.
6280      */
6281     getLangPackName: function(lang, mname) {
6282         return ('lang/' + mname + ((lang) ? '_' + lang : ''));
6283     },
6284     /**
6285      * Inspects the required modules list looking for additional
6286      * dependencies.  Expands the required list to include all
6287      * required modules.  Called by calculate()
6288      * @method _explode
6289      * @private
6290      */
6291     _explode: function() {
6292         //TODO Move done out of scope
6293         var r = this.required, m, reqs, done = {},
6294             self = this;
6296         // the setup phase is over, all modules have been created
6297         self.dirty = false;
6299         self._explodeRollups();
6300         r = self.required;
6301         
6302         oeach(r, function(v, name) {
6303             if (!done[name]) {
6304                 done[name] = true;
6305                 m = self.getModule(name);
6306                 if (m) {
6307                     var expound = m.expound;
6309                     if (expound) {
6310                         r[expound] = self.getModule(expound);
6311                         reqs = self.getRequires(r[expound]);
6312                         Y.mix(r, YArray.hash(reqs));
6313                     }
6315                     reqs = self.getRequires(m);
6316                     Y.mix(r, YArray.hash(reqs));
6317                 }
6318             }
6319         });
6321     },
6322     /**
6323     * Get's the loader meta data for the requested module
6324     * @method getModule
6325     * @param {String} mname The module name to get
6326     * @return {Object} The module metadata
6327     */
6328     getModule: function(mname) {
6329         //TODO: Remove name check - it's a quick hack to fix pattern WIP
6330         if (!mname) {
6331             return null;
6332         }
6334         var p, found, pname,
6335             m = this.moduleInfo[mname],
6336             patterns = this.patterns;
6338         // check the patterns library to see if we should automatically add
6339         // the module with defaults
6340         if (!m) {
6341             for (pname in patterns) {
6342                 if (patterns.hasOwnProperty(pname)) {
6343                     p = patterns[pname];
6344                     
6345                     //There is no test method, create a default one that tests
6346                     // the pattern against the mod name
6347                     if (!p.test) {
6348                         p.test = function(mname, pname) {
6349                             return (mname.indexOf(pname) > -1);
6350                         };
6351                     }
6353                     if (p.test(mname, pname)) {
6354                         // use the metadata supplied for the pattern
6355                         // as the module definition.
6356                         found = p;
6357                         break;
6358                     }
6359                 }
6360             }
6362             if (found) {
6363                 if (p.action) {
6364                     p.action.call(this, mname, pname);
6365                 } else {
6366                     // ext true or false?
6367                     m = this.addModule(Y.merge(found), mname);
6368                     m.temp = true;
6369                 }
6370             }
6371         }
6373         return m;
6374     },
6376     // impl in rollup submodule
6377     _rollup: function() { },
6379     /**
6380      * Remove superceded modules and loaded modules.  Called by
6381      * calculate() after we have the mega list of all dependencies
6382      * @method _reduce
6383      * @return {object} the reduced dependency hash.
6384      * @private
6385      */
6386     _reduce: function(r) {
6388         r = r || this.required;
6390         var i, j, s, m, type = this.loadType,
6391         ignore = this.ignore ? YArray.hash(this.ignore) : false;
6393         for (i in r) {
6394             if (r.hasOwnProperty(i)) {
6395                 m = this.getModule(i);
6396                 // remove if already loaded
6397                 if (((this.loaded[i] || ON_PAGE[i]) &&
6398                         !this.forceMap[i] && !this.ignoreRegistered) ||
6399                         (type && m && m.type != type)) {
6400                     delete r[i];
6401                 }
6402                 if (ignore && ignore[i]) {
6403                     delete r[i];
6404                 }
6405                 // remove anything this module supersedes
6406                 s = m && m.supersedes;
6407                 if (s) {
6408                     for (j = 0; j < s.length; j++) {
6409                         if (s[j] in r) {
6410                             delete r[s[j]];
6411                         }
6412                     }
6413                 }
6414             }
6415         }
6417         return r;
6418     },
6419     /**
6420     * Handles the queue when a module has been loaded for all cases
6421     * @method _finish
6422     * @private
6423     * @param {String} msg The message from Loader
6424     * @param {Boolean} success A boolean denoting success or failure
6425     */
6426     _finish: function(msg, success) {
6428         _queue.running = false;
6430         var onEnd = this.onEnd;
6431         if (onEnd) {
6432             onEnd.call(this.context, {
6433                 msg: msg,
6434                 data: this.data,
6435                 success: success
6436             });
6437         }
6438         this._continue();
6439     },
6440     /**
6441     * The default Loader onSuccess handler, calls this.onSuccess with a payload
6442     * @method _onSuccess
6443     * @private
6444     */
6445     _onSuccess: function() {
6446         var self = this, skipped = Y.merge(self.skipped), fn,
6447             failed = [], rreg = self.requireRegistration,
6448             success, msg;
6450         oeach(skipped, function(k) {
6451             delete self.inserted[k];
6452         });
6454         self.skipped = {};
6456         oeach(self.inserted, function(v, k) {
6457             var mod = self.getModule(k);
6458             if (mod && rreg && mod.type == JS && !(k in YUI.Env.mods)) {
6459                 failed.push(k);
6460             } else {
6461                 Y.mix(self.loaded, self.getProvides(k));
6462             }
6463         });
6465         fn = self.onSuccess;
6466         msg = (failed.length) ? 'notregistered' : 'success';
6467         success = !(failed.length);
6468         if (fn) {
6469             fn.call(self.context, {
6470                 msg: msg,
6471                 data: self.data,
6472                 success: success,
6473                 failed: failed,
6474                 skipped: skipped
6475             });
6476         }
6477         self._finish(msg, success);
6478     },
6479     /**
6480     * The default Loader onProgress handler, calls this.onProgress with a payload
6481     * @method _onProgress
6482     * @private
6483     */
6484     _onProgress: function(e) {
6485         var self = this;
6486         if (self.onProgress) {
6487             self.onProgress.call(self.context, {
6488                 name: e.url,
6489                 data: e.data
6490             });
6491         }
6492     },
6493     /**
6494     * The default Loader onFailure handler, calls this.onFailure with a payload
6495     * @method _onFailure
6496     * @private
6497     */
6498     _onFailure: function(o) {
6499         var f = this.onFailure, msg = [], i = 0, len = o.errors.length;
6500         
6501         for (i; i < len; i++) {
6502             msg.push(o.errors[i].error);
6503         }
6505         msg = msg.join(',');
6507         
6508         if (f) {
6509             f.call(this.context, {
6510                 msg: msg,
6511                 data: this.data,
6512                 success: false
6513             });
6514         }
6515         
6516         this._finish(msg, false);
6518     },
6520     /**
6521     * The default Loader onTimeout handler, calls this.onTimeout with a payload
6522     * @method _onTimeout
6523     * @private
6524     */
6525     _onTimeout: function() {
6526         var f = this.onTimeout;
6527         if (f) {
6528             f.call(this.context, {
6529                 msg: 'timeout',
6530                 data: this.data,
6531                 success: false
6532             });
6533         }
6534     },
6536     /**
6537      * Sorts the dependency tree.  The last step of calculate()
6538      * @method _sort
6539      * @private
6540      */
6541     _sort: function() {
6543         // create an indexed list
6544         var s = YObject.keys(this.required),
6545             // loaded = this.loaded,
6546             //TODO Move this out of scope
6547             done = {},
6548             p = 0, l, a, b, j, k, moved, doneKey;
6550         // keep going until we make a pass without moving anything
6551         for (;;) {
6553             l = s.length;
6554             moved = false;
6556             // start the loop after items that are already sorted
6557             for (j = p; j < l; j++) {
6559                 // check the next module on the list to see if its
6560                 // dependencies have been met
6561                 a = s[j];
6563                 // check everything below current item and move if we
6564                 // find a requirement for the current item
6565                 for (k = j + 1; k < l; k++) {
6566                     doneKey = a + s[k];
6568                     if (!done[doneKey] && this._requires(a, s[k])) {
6570                         // extract the dependency so we can move it up
6571                         b = s.splice(k, 1);
6573                         // insert the dependency above the item that
6574                         // requires it
6575                         s.splice(j, 0, b[0]);
6577                         // only swap two dependencies once to short circut
6578                         // circular dependencies
6579                         done[doneKey] = true;
6581                         // keep working
6582                         moved = true;
6584                         break;
6585                     }
6586                 }
6588                 // jump out of loop if we moved something
6589                 if (moved) {
6590                     break;
6591                 // this item is sorted, move our pointer and keep going
6592                 } else {
6593                     p++;
6594                 }
6595             }
6597             // when we make it here and moved is false, we are
6598             // finished sorting
6599             if (!moved) {
6600                 break;
6601             }
6603         }
6605         this.sorted = s;
6606     },
6608     /**
6609     * Handles the actual insertion of script/link tags
6610     * @method _insert
6611     * @private
6612     * @param {Object} source The YUI instance the request came from
6613     * @param {Object} o The metadata to include
6614     * @param {String} type JS or CSS
6615     * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta
6616     */
6617     _insert: function(source, o, type, skipcalc) {
6620         // restore the state at the time of the request
6621         if (source) {
6622             this._config(source);
6623         }
6625         // build the dependency list
6626         // don't include type so we can process CSS and script in
6627         // one pass when the type is not specified.
6628         if (!skipcalc) {
6629             this.calculate(o);
6630         }
6632         var modules = this.resolve(),
6633             self = this, comp = 0, actions = 0;
6635         if (type) {
6636             //Filter out the opposite type and reset the array so the checks later work
6637             modules[((type === JS) ? CSS : JS)] = [];
6638         }
6639         if (modules.js.length) {
6640             comp++;
6641         }
6642         if (modules.css.length) {
6643             comp++;
6644         }
6646         //console.log('Resolved Modules: ', modules);
6648         var complete = function(d) {
6649             actions++;
6650             var errs = {}, i = 0, u = '', fn;
6652             if (d && d.errors) {
6653                 for (i = 0; i < d.errors.length; i++) {
6654                     if (d.errors[i].request) {
6655                         u = d.errors[i].request.url;
6656                     } else {
6657                         u = d.errors[i];
6658                     }
6659                     errs[u] = u;
6660                 }
6661             }
6662             
6663             if (d && d.data && d.data.length && (d.type === 'success')) {
6664                 for (i = 0; i < d.data.length; i++) {
6665                     self.inserted[d.data[i].name] = true;
6666                 }
6667             }
6669             if (actions === comp) {
6670                 self._loading = null;
6671                 if (d && d.fn) {
6672                     fn = d.fn;
6673                     delete d.fn;
6674                     fn.call(self, d);
6675                 }
6676             }
6677         };
6679         this._loading = true;
6681         if (!modules.js.length && !modules.css.length) {
6682             actions = -1;
6683             complete({
6684                 fn: self._onSuccess
6685             });
6686             return;
6687         }
6688         
6690         if (modules.css.length) { //Load CSS first
6691             Y.Get.css(modules.css, {
6692                 data: modules.cssMods,
6693                 attributes: self.cssAttributes,
6694                 insertBefore: self.insertBefore,
6695                 charset: self.charset,
6696                 timeout: self.timeout,
6697                 context: self,
6698                 onProgress: function(e) {
6699                     self._onProgress.call(self, e);
6700                 },
6701                 onTimeout: function(d) {
6702                     self._onTimeout.call(self, d);
6703                 },
6704                 onSuccess: function(d) {
6705                     d.type = 'success';
6706                     d.fn = self._onSuccess;
6707                     complete.call(self, d);
6708                 },
6709                 onFailure: function(d) {
6710                     d.type = 'failure';
6711                     d.fn = self._onFailure;
6712                     complete.call(self, d);
6713                 }
6714             });
6715         }
6717         if (modules.js.length) {
6718             Y.Get.js(modules.js, {
6719                 data: modules.jsMods,
6720                 insertBefore: self.insertBefore,
6721                 attributes: self.jsAttributes,
6722                 charset: self.charset,
6723                 timeout: self.timeout,
6724                 autopurge: false,
6725                 context: self,
6726                 async: true,
6727                 onProgress: function(e) {
6728                     self._onProgress.call(self, e);
6729                 },
6730                 onTimeout: function(d) {
6731                     self._onTimeout.call(self, d);
6732                 },
6733                 onSuccess: function(d) {
6734                     d.type = 'success';
6735                     d.fn = self._onSuccess;
6736                     complete.call(self, d);
6737                 },
6738                 onFailure: function(d) {
6739                     d.type = 'failure';
6740                     d.fn = self._onFailure;
6741                     complete.call(self, d);
6742                 }
6743             });
6744         }
6745     },
6746     /**
6747     * Once a loader operation is completely finished, process any additional queued items.
6748     * @method _continue
6749     * @private
6750     */
6751     _continue: function() {
6752         if (!(_queue.running) && _queue.size() > 0) {
6753             _queue.running = true;
6754             _queue.next()();
6755         }
6756     },
6758     /**
6759      * inserts the requested modules and their dependencies.
6760      * <code>type</code> can be "js" or "css".  Both script and
6761      * css are inserted if type is not provided.
6762      * @method insert
6763      * @param {object} o optional options object.
6764      * @param {string} type the type of dependency to insert.
6765      */
6766     insert: function(o, type, skipsort) {
6767         var self = this, copy = Y.merge(this);
6768         delete copy.require;
6769         delete copy.dirty;
6770         _queue.add(function() {
6771             self._insert(copy, o, type, skipsort);
6772         });
6773         this._continue();
6774     },
6776     /**
6777      * Executed every time a module is loaded, and if we are in a load
6778      * cycle, we attempt to load the next script.  Public so that it
6779      * is possible to call this if using a method other than
6780      * Y.register to determine when scripts are fully loaded
6781      * @method loadNext
6782      * @deprecated
6783      * @param {string} mname optional the name of the module that has
6784      * been loaded (which is usually why it is time to load the next
6785      * one).
6786      */
6787     loadNext: function(mname) {
6788         return;
6789     },
6791     /**
6792      * Apply filter defined for this instance to a url/path
6793      * @method _filter
6794      * @param {string} u the string to filter.
6795      * @param {string} name the name of the module, if we are processing
6796      * a single module as opposed to a combined url.
6797      * @return {string} the filtered string.
6798      * @private
6799      */
6800     _filter: function(u, name, group) {
6801         var f = this.filter,
6802             hasFilter = name && (name in this.filters),
6803             modFilter = hasFilter && this.filters[name],
6804                 groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null);
6806             if (groupName && this.groups[groupName] && this.groups[groupName].filter) {         
6807                     modFilter = this.groups[groupName].filter;
6808                     hasFilter = true;           
6809             };
6811         if (u) {
6812             if (hasFilter) {
6813                 f = (L.isString(modFilter)) ?
6814                     this.FILTER_DEFS[modFilter.toUpperCase()] || null :
6815                     modFilter;
6816             }
6817             if (f) {
6818                 u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
6819             }
6820         }
6822         return u;
6823     },
6825     /**
6826      * Generates the full url for a module
6827      * @method _url
6828      * @param {string} path the path fragment.
6829      * @param {String} name The name of the module
6830      * @param {String} [base=self.base] The base url to use
6831      * @return {string} the full url.
6832      * @private
6833      */
6834     _url: function(path, name, base) {
6835         return this._filter((base || this.base || '') + path, name);
6836     },
6837     /**
6838     * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
6839     * @method resolve
6840     * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
6841     * @param {Array} [s=loader.sorted] An override for the loader.sorted array
6842     * @return {Object} Object hash (js and css) of two arrays of file lists
6843     * @example This method can be used as an off-line dep calculator
6844     *
6845     *        var Y = YUI();
6846     *        var loader = new Y.Loader({
6847     *            filter: 'debug',
6848     *            base: '../../',
6849     *            root: 'build/',
6850     *            combine: true,
6851     *            require: ['node', 'dd', 'console']
6852     *        });
6853     *        var out = loader.resolve(true);
6854     *
6855     */
6856     resolve: function(calc, s) {
6858         var len, i, m, url, fn, msg, attr, group, groupName, j, frag,
6859             comboSource, comboSources, mods, comboBase,
6860             base, urls, u = [], tmpBase, baseLen, resCombos = {},
6861             self = this, comboSep, maxURLLength, singles = [],
6862             inserted = (self.ignoreRegistered) ? {} : self.inserted,
6863             resolved = { js: [], jsMods: [], css: [], cssMods: [] },
6864             type = self.loadType || 'js';
6866         if (calc) {
6867             self.calculate();
6868         }
6869         s = s || self.sorted;
6871         var addSingle = function(m) {
6872             
6873             if (m) {
6874                 group = (m.group && self.groups[m.group]) || NOT_FOUND;
6875                 
6876                 //Always assume it's async
6877                 if (group.async === false) {
6878                     m.async = group.async;
6879                 }
6881                 url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
6882                       self._url(m.path, s[i], group.base || m.base);
6883                 
6884                 if (m.attributes || m.async === false) {
6885                     url = {
6886                         url: url,
6887                         async: m.async
6888                     };
6889                     if (m.attributes) {
6890                         url.attributes = m.attributes
6891                     }
6892                 }
6893                 resolved[m.type].push(url);
6894                 resolved[m.type + 'Mods'].push(m);
6895             } else {
6896             }
6897             
6898         };
6900         len = s.length;
6902         // the default combo base
6903         comboBase = self.comboBase;
6905         url = comboBase;
6907         comboSources = {};
6909         for (i = 0; i < len; i++) {
6910             comboSource = comboBase;
6911             m = self.getModule(s[i]);
6912             groupName = m && m.group;
6913             group = self.groups[groupName];
6914             if (groupName && group) {
6916                 if (!group.combine || m.fullpath) {
6917                     //This is not a combo module, skip it and load it singly later.
6918                     //singles.push(s[i]);
6919                     addSingle(m);
6920                     continue;
6921                 }
6922                 m.combine = true;
6923                 if (group.comboBase) {
6924                     comboSource = group.comboBase;
6925                 }
6927                 if ("root" in group && L.isValue(group.root)) {
6928                     m.root = group.root;
6929                 }
6930                 m.comboSep = group.comboSep || self.comboSep;
6931                 m.maxURLLength = group.maxURLLength || self.maxURLLength;
6932             } else {
6933                 if (!self.combine) {
6934                     //This is not a combo module, skip it and load it singly later.
6935                     //singles.push(s[i]);
6936                     addSingle(m);
6937                     continue;
6938                 }
6939             }
6941             comboSources[comboSource] = comboSources[comboSource] || [];
6942             comboSources[comboSource].push(m);
6943         }
6945         for (j in comboSources) {
6946             if (comboSources.hasOwnProperty(j)) {
6947                 resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };
6948                 url = j;
6949                 mods = comboSources[j];
6950                 len = mods.length;
6951                 
6952                 if (len) {
6953                     for (i = 0; i < len; i++) {
6954                         if (inserted[mods[i]]) {
6955                             continue;
6956                         }
6957                         m = mods[i];
6958                         // Do not try to combine non-yui JS unless combo def
6959                         // is found
6960                         if (m && (m.combine || !m.ext)) {
6961                             resCombos[j].comboSep = m.comboSep;
6962                             resCombos[j].group = m.group;
6963                             resCombos[j].maxURLLength = m.maxURLLength;
6964                             frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath);
6965                             frag = self._filter(frag, m.name);
6966                             resCombos[j][m.type].push(frag);
6967                             resCombos[j][m.type + 'Mods'].push(m);
6968                         } else {
6969                             //Add them to the next process..
6970                             if (mods[i]) {
6971                                 //singles.push(mods[i].name);
6972                                 addSingle(mods[i]);
6973                             }
6974                         }
6976                     }
6977                 }
6978             }
6979         }
6982         for (j in resCombos) {
6983             base = j;
6984             comboSep = resCombos[base].comboSep || self.comboSep;
6985             maxURLLength = resCombos[base].maxURLLength || self.maxURLLength;
6986             for (type in resCombos[base]) {
6987                 if (type === JS || type === CSS) {
6988                     urls = resCombos[base][type];
6989                     mods = resCombos[base][type + 'Mods'];
6990                     len = urls.length;
6991                     tmpBase = base + urls.join(comboSep);
6992                     baseLen = tmpBase.length;
6993                     if (maxURLLength <= base.length) {
6994                         maxURLLength = MAX_URL_LENGTH;
6995                     }
6996                     
6997                     if (len) {
6998                         if (baseLen > maxURLLength) {
6999                             u = [];
7000                             for (s = 0; s < len; s++) {
7001                                 u.push(urls[s]);
7002                                 tmpBase = base + u.join(comboSep);
7004                                 if (tmpBase.length > maxURLLength) {
7005                                     m = u.pop();
7006                                     tmpBase = base + u.join(comboSep)
7007                                     resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));
7008                                     u = [];
7009                                     if (m) {
7010                                         u.push(m);
7011                                     }
7012                                 }
7013                             }
7014                             if (u.length) {
7015                                 tmpBase = base + u.join(comboSep);
7016                                 resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));
7017                             }
7018                         } else {
7019                             resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));
7020                         }
7021                     }
7022                     resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods);
7023                 }
7024             }
7025         }
7027         resCombos = null;
7029         return resolved;
7030     },
7031     /**
7032     Shortcut to calculate, resolve and load all modules.
7034         var loader = new Y.Loader({
7035             ignoreRegistered: true,
7036             modules: {
7037                 mod: {
7038                     path: 'mod.js'
7039                 }
7040             },
7041             requires: [ 'mod' ]
7042         });
7043         loader.load(function() {
7044             console.log('All modules have loaded..');
7045         });
7048     @method load
7049     @param {Callback} cb Executed after all load operations are complete
7050     */
7051     load: function(cb) {
7052         if (!cb) {
7053             return;
7054         }
7055         var self = this,
7056             out = self.resolve(true);
7057         
7058         self.data = out;
7060         self.onEnd = function() {
7061             cb.apply(self.context || self, arguments);
7062         };
7064         self.insert();
7065     }
7070 }, '3.5.1' ,{requires:['get', 'features']});
7071 YUI.add('loader-rollup', function(Y) {
7074  * Optional automatic rollup logic for reducing http connections
7075  * when not using a combo service.
7076  * @module loader
7077  * @submodule rollup
7078  */
7081  * Look for rollup packages to determine if all of the modules a
7082  * rollup supersedes are required.  If so, include the rollup to
7083  * help reduce the total number of connections required.  Called
7084  * by calculate().  This is an optional feature, and requires the
7085  * appropriate submodule to function.
7086  * @method _rollup
7087  * @for Loader
7088  * @private
7089  */
7090 Y.Loader.prototype._rollup = function() {
7091     var i, j, m, s, r = this.required, roll,
7092         info = this.moduleInfo, rolled, c, smod;
7094     // find and cache rollup modules
7095     if (this.dirty || !this.rollups) {
7096         this.rollups = {};
7097         for (i in info) {
7098             if (info.hasOwnProperty(i)) {
7099                 m = this.getModule(i);
7100                 // if (m && m.rollup && m.supersedes) {
7101                 if (m && m.rollup) {
7102                     this.rollups[i] = m;
7103                 }
7104             }
7105         }
7106     }
7108     // make as many passes as needed to pick up rollup rollups
7109     for (;;) {
7110         rolled = false;
7112         // go through the rollup candidates
7113         for (i in this.rollups) {
7114             if (this.rollups.hasOwnProperty(i)) {
7115                 // there can be only one, unless forced
7116                 if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {
7117                     m = this.getModule(i);
7118                     s = m.supersedes || [];
7119                     roll = false;
7121                     // @TODO remove continue
7122                     if (!m.rollup) {
7123                         continue;
7124                     }
7126                     c = 0;
7128                     // check the threshold
7129                     for (j = 0; j < s.length; j++) {
7130                         smod = info[s[j]];
7132                         // if the superseded module is loaded, we can't
7133                         // load the rollup unless it has been forced.
7134                         if (this.loaded[s[j]] && !this.forceMap[s[j]]) {
7135                             roll = false;
7136                             break;
7137                         // increment the counter if this module is required.
7138                         // if we are beyond the rollup threshold, we will
7139                         // use the rollup module
7140                         } else if (r[s[j]] && m.type == smod.type) {
7141                             c++;
7142                             roll = (c >= m.rollup);
7143                             if (roll) {
7144                                 break;
7145                             }
7146                         }
7147                     }
7149                     if (roll) {
7150                         // add the rollup
7151                         r[i] = true;
7152                         rolled = true;
7154                         // expand the rollup's dependencies
7155                         this.getRequires(m);
7156                     }
7157                 }
7158             }
7159         }
7161         // if we made it here w/o rolling up something, we are done
7162         if (!rolled) {
7163             break;
7164         }
7165     }
7169 }, '3.5.1' ,{requires:['loader-base']});
7170 YUI.add('loader-yui3', function(Y) {
7172 /* This file is auto-generated by src/loader/scripts/meta_join.py */
7175  * YUI 3 module metadata
7176  * @module loader
7177  * @submodule yui3
7178  */
7179 YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
7180     "align-plugin": {
7181         "requires": [
7182             "node-screen", 
7183             "node-pluginhost"
7184         ]
7185     }, 
7186     "anim": {
7187         "use": [
7188             "anim-base", 
7189             "anim-color", 
7190             "anim-curve", 
7191             "anim-easing", 
7192             "anim-node-plugin", 
7193             "anim-scroll", 
7194             "anim-xy"
7195         ]
7196     }, 
7197     "anim-base": {
7198         "requires": [
7199             "base-base", 
7200             "node-style"
7201         ]
7202     }, 
7203     "anim-color": {
7204         "requires": [
7205             "anim-base"
7206         ]
7207     }, 
7208     "anim-curve": {
7209         "requires": [
7210             "anim-xy"
7211         ]
7212     }, 
7213     "anim-easing": {
7214         "requires": [
7215             "anim-base"
7216         ]
7217     }, 
7218     "anim-node-plugin": {
7219         "requires": [
7220             "node-pluginhost", 
7221             "anim-base"
7222         ]
7223     }, 
7224     "anim-scroll": {
7225         "requires": [
7226             "anim-base"
7227         ]
7228     }, 
7229     "anim-shape-transform": {
7230         "requires": [
7231             "anim-base", 
7232             "anim-easing", 
7233             "matrix"
7234         ]
7235     }, 
7236     "anim-xy": {
7237         "requires": [
7238             "anim-base", 
7239             "node-screen"
7240         ]
7241     }, 
7242     "app": {
7243         "use": [
7244             "app-base", 
7245             "app-transitions", 
7246             "model", 
7247             "model-list", 
7248             "router", 
7249             "view"
7250         ]
7251     }, 
7252     "app-base": {
7253         "requires": [
7254             "classnamemanager", 
7255             "pjax-base", 
7256             "router", 
7257             "view"
7258         ]
7259     }, 
7260     "app-transitions": {
7261         "requires": [
7262             "app-base"
7263         ]
7264     }, 
7265     "app-transitions-css": {
7266         "type": "css"
7267     }, 
7268     "app-transitions-native": {
7269         "condition": {
7270             "name": "app-transitions-native", 
7271             "test": function (Y) {
7272     var doc  = Y.config.doc,
7273         node = doc ? doc.documentElement : null;
7275     if (node && node.style) {
7276         return ('MozTransition' in node.style || 'WebkitTransition' in node.style);
7277     }
7279     return false;
7280 }, 
7281             "trigger": "app-transitions"
7282         }, 
7283         "requires": [
7284             "app-transitions", 
7285             "app-transitions-css", 
7286             "parallel", 
7287             "transition"
7288         ]
7289     }, 
7290     "array-extras": {
7291         "requires": [
7292             "yui-base"
7293         ]
7294     }, 
7295     "array-invoke": {
7296         "requires": [
7297             "yui-base"
7298         ]
7299     }, 
7300     "arraylist": {
7301         "requires": [
7302             "yui-base"
7303         ]
7304     }, 
7305     "arraylist-add": {
7306         "requires": [
7307             "arraylist"
7308         ]
7309     }, 
7310     "arraylist-filter": {
7311         "requires": [
7312             "arraylist"
7313         ]
7314     }, 
7315     "arraysort": {
7316         "requires": [
7317             "yui-base"
7318         ]
7319     }, 
7320     "async-queue": {
7321         "requires": [
7322             "event-custom"
7323         ]
7324     }, 
7325     "attribute": {
7326         "use": [
7327             "attribute-base", 
7328             "attribute-complex"
7329         ]
7330     }, 
7331     "attribute-base": {
7332         "requires": [
7333             "attribute-core", 
7334             "attribute-events", 
7335             "attribute-extras"
7336         ]
7337     }, 
7338     "attribute-complex": {
7339         "requires": [
7340             "attribute-base"
7341         ]
7342     }, 
7343     "attribute-core": {
7344         "requires": [
7345             "yui-base"
7346         ]
7347     }, 
7348     "attribute-events": {
7349         "requires": [
7350             "event-custom"
7351         ]
7352     }, 
7353     "attribute-extras": {
7354         "requires": [
7355             "yui-base"
7356         ]
7357     }, 
7358     "autocomplete": {
7359         "use": [
7360             "autocomplete-base", 
7361             "autocomplete-sources", 
7362             "autocomplete-list", 
7363             "autocomplete-plugin"
7364         ]
7365     }, 
7366     "autocomplete-base": {
7367         "optional": [
7368             "autocomplete-sources"
7369         ], 
7370         "requires": [
7371             "array-extras", 
7372             "base-build", 
7373             "escape", 
7374             "event-valuechange", 
7375             "node-base"
7376         ]
7377     }, 
7378     "autocomplete-filters": {
7379         "requires": [
7380             "array-extras", 
7381             "text-wordbreak"
7382         ]
7383     }, 
7384     "autocomplete-filters-accentfold": {
7385         "requires": [
7386             "array-extras", 
7387             "text-accentfold", 
7388             "text-wordbreak"
7389         ]
7390     }, 
7391     "autocomplete-highlighters": {
7392         "requires": [
7393             "array-extras", 
7394             "highlight-base"
7395         ]
7396     }, 
7397     "autocomplete-highlighters-accentfold": {
7398         "requires": [
7399             "array-extras", 
7400             "highlight-accentfold"
7401         ]
7402     }, 
7403     "autocomplete-list": {
7404         "after": [
7405             "autocomplete-sources"
7406         ], 
7407         "lang": [
7408             "en"
7409         ], 
7410         "requires": [
7411             "autocomplete-base", 
7412             "event-resize", 
7413             "node-screen", 
7414             "selector-css3", 
7415             "shim-plugin", 
7416             "widget", 
7417             "widget-position", 
7418             "widget-position-align"
7419         ], 
7420         "skinnable": true
7421     }, 
7422     "autocomplete-list-keys": {
7423         "condition": {
7424             "name": "autocomplete-list-keys", 
7425             "test": function (Y) {
7426     // Only add keyboard support to autocomplete-list if this doesn't appear to
7427     // be an iOS or Android-based mobile device.
7428     //
7429     // There's currently no feasible way to actually detect whether a device has
7430     // a hardware keyboard, so this sniff will have to do. It can easily be
7431     // overridden by manually loading the autocomplete-list-keys module.
7432     //
7433     // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
7434     // doesn't fire the keyboard events used by AutoCompleteList, so there's
7435     // no point loading the -keys module even when a bluetooth keyboard may be
7436     // available.
7437     return !(Y.UA.ios || Y.UA.android);
7438 }, 
7439             "trigger": "autocomplete-list"
7440         }, 
7441         "requires": [
7442             "autocomplete-list", 
7443             "base-build"
7444         ]
7445     }, 
7446     "autocomplete-plugin": {
7447         "requires": [
7448             "autocomplete-list", 
7449             "node-pluginhost"
7450         ]
7451     }, 
7452     "autocomplete-sources": {
7453         "optional": [
7454             "io-base", 
7455             "json-parse", 
7456             "jsonp", 
7457             "yql"
7458         ], 
7459         "requires": [
7460             "autocomplete-base"
7461         ]
7462     }, 
7463     "base": {
7464         "use": [
7465             "base-base", 
7466             "base-pluginhost", 
7467             "base-build"
7468         ]
7469     }, 
7470     "base-base": {
7471         "after": [
7472             "attribute-complex"
7473         ], 
7474         "requires": [
7475             "base-core", 
7476             "attribute-base"
7477         ]
7478     }, 
7479     "base-build": {
7480         "requires": [
7481             "base-base"
7482         ]
7483     }, 
7484     "base-core": {
7485         "requires": [
7486             "attribute-core"
7487         ]
7488     }, 
7489     "base-pluginhost": {
7490         "requires": [
7491             "base-base", 
7492             "pluginhost"
7493         ]
7494     }, 
7495     "button": {
7496         "requires": [
7497             "button-core", 
7498             "cssbutton", 
7499             "widget"
7500         ]
7501     }, 
7502     "button-core": {
7503         "requires": [
7504             "attribute-core", 
7505             "classnamemanager", 
7506             "node-base"
7507         ]
7508     }, 
7509     "button-group": {
7510         "requires": [
7511             "button-plugin", 
7512             "cssbutton", 
7513             "widget"
7514         ]
7515     }, 
7516     "button-plugin": {
7517         "requires": [
7518             "button-core", 
7519             "cssbutton", 
7520             "node-pluginhost"
7521         ]
7522     }, 
7523     "cache": {
7524         "use": [
7525             "cache-base", 
7526             "cache-offline", 
7527             "cache-plugin"
7528         ]
7529     }, 
7530     "cache-base": {
7531         "requires": [
7532             "base"
7533         ]
7534     }, 
7535     "cache-offline": {
7536         "requires": [
7537             "cache-base", 
7538             "json"
7539         ]
7540     }, 
7541     "cache-plugin": {
7542         "requires": [
7543             "plugin", 
7544             "cache-base"
7545         ]
7546     }, 
7547     "calendar": {
7548         "lang": [
7549             "de", 
7550             "en", 
7551             "fr", 
7552             "ja", 
7553             "nb-NO", 
7554             "pt-BR", 
7555             "ru", 
7556             "zh-HANT-TW"
7557         ], 
7558         "requires": [
7559             "calendar-base", 
7560             "calendarnavigator"
7561         ], 
7562         "skinnable": true
7563     }, 
7564     "calendar-base": {
7565         "lang": [
7566             "de", 
7567             "en", 
7568             "fr", 
7569             "ja", 
7570             "nb-NO", 
7571             "pt-BR", 
7572             "ru", 
7573             "zh-HANT-TW"
7574         ], 
7575         "requires": [
7576             "widget", 
7577             "substitute", 
7578             "datatype-date", 
7579             "datatype-date-math", 
7580             "cssgrids"
7581         ], 
7582         "skinnable": true
7583     }, 
7584     "calendarnavigator": {
7585         "requires": [
7586             "plugin", 
7587             "classnamemanager", 
7588             "datatype-date", 
7589             "node", 
7590             "substitute"
7591         ], 
7592         "skinnable": true
7593     }, 
7594     "charts": {
7595         "requires": [
7596             "charts-base"
7597         ]
7598     }, 
7599     "charts-base": {
7600         "requires": [
7601             "dom", 
7602             "datatype-number", 
7603             "datatype-date", 
7604             "event-custom", 
7605             "event-mouseenter", 
7606             "event-touch", 
7607             "widget", 
7608             "widget-position", 
7609             "widget-stack", 
7610             "graphics"
7611         ]
7612     }, 
7613     "charts-legend": {
7614         "requires": [
7615             "charts-base"
7616         ]
7617     }, 
7618     "classnamemanager": {
7619         "requires": [
7620             "yui-base"
7621         ]
7622     }, 
7623     "clickable-rail": {
7624         "requires": [
7625             "slider-base"
7626         ]
7627     }, 
7628     "collection": {
7629         "use": [
7630             "array-extras", 
7631             "arraylist", 
7632             "arraylist-add", 
7633             "arraylist-filter", 
7634             "array-invoke"
7635         ]
7636     }, 
7637     "console": {
7638         "lang": [
7639             "en", 
7640             "es", 
7641             "ja"
7642         ], 
7643         "requires": [
7644             "yui-log", 
7645             "widget", 
7646             "substitute"
7647         ], 
7648         "skinnable": true
7649     }, 
7650     "console-filters": {
7651         "requires": [
7652             "plugin", 
7653             "console"
7654         ], 
7655         "skinnable": true
7656     }, 
7657     "controller": {
7658         "use": [
7659             "router"
7660         ]
7661     }, 
7662     "cookie": {
7663         "requires": [
7664             "yui-base"
7665         ]
7666     }, 
7667     "createlink-base": {
7668         "requires": [
7669             "editor-base"
7670         ]
7671     }, 
7672     "cssbase": {
7673         "after": [
7674             "cssreset", 
7675             "cssfonts", 
7676             "cssgrids", 
7677             "cssreset-context", 
7678             "cssfonts-context", 
7679             "cssgrids-context"
7680         ], 
7681         "type": "css"
7682     }, 
7683     "cssbase-context": {
7684         "after": [
7685             "cssreset", 
7686             "cssfonts", 
7687             "cssgrids", 
7688             "cssreset-context", 
7689             "cssfonts-context", 
7690             "cssgrids-context"
7691         ], 
7692         "type": "css"
7693     }, 
7694     "cssbutton": {
7695         "type": "css"
7696     }, 
7697     "cssfonts": {
7698         "type": "css"
7699     }, 
7700     "cssfonts-context": {
7701         "type": "css"
7702     }, 
7703     "cssgrids": {
7704         "optional": [
7705             "cssreset", 
7706             "cssfonts"
7707         ], 
7708         "type": "css"
7709     }, 
7710     "cssgrids-base": {
7711         "optional": [
7712             "cssreset", 
7713             "cssfonts"
7714         ], 
7715         "type": "css"
7716     }, 
7717     "cssgrids-units": {
7718         "optional": [
7719             "cssreset", 
7720             "cssfonts"
7721         ], 
7722         "requires": [
7723             "cssgrids-base"
7724         ], 
7725         "type": "css"
7726     }, 
7727     "cssreset": {
7728         "type": "css"
7729     }, 
7730     "cssreset-context": {
7731         "type": "css"
7732     }, 
7733     "dataschema": {
7734         "use": [
7735             "dataschema-base", 
7736             "dataschema-json", 
7737             "dataschema-xml", 
7738             "dataschema-array", 
7739             "dataschema-text"
7740         ]
7741     }, 
7742     "dataschema-array": {
7743         "requires": [
7744             "dataschema-base"
7745         ]
7746     }, 
7747     "dataschema-base": {
7748         "requires": [
7749             "base"
7750         ]
7751     }, 
7752     "dataschema-json": {
7753         "requires": [
7754             "dataschema-base", 
7755             "json"
7756         ]
7757     }, 
7758     "dataschema-text": {
7759         "requires": [
7760             "dataschema-base"
7761         ]
7762     }, 
7763     "dataschema-xml": {
7764         "requires": [
7765             "dataschema-base"
7766         ]
7767     }, 
7768     "datasource": {
7769         "use": [
7770             "datasource-local", 
7771             "datasource-io", 
7772             "datasource-get", 
7773             "datasource-function", 
7774             "datasource-cache", 
7775             "datasource-jsonschema", 
7776             "datasource-xmlschema", 
7777             "datasource-arrayschema", 
7778             "datasource-textschema", 
7779             "datasource-polling"
7780         ]
7781     }, 
7782     "datasource-arrayschema": {
7783         "requires": [
7784             "datasource-local", 
7785             "plugin", 
7786             "dataschema-array"
7787         ]
7788     }, 
7789     "datasource-cache": {
7790         "requires": [
7791             "datasource-local", 
7792             "plugin", 
7793             "cache-base"
7794         ]
7795     }, 
7796     "datasource-function": {
7797         "requires": [
7798             "datasource-local"
7799         ]
7800     }, 
7801     "datasource-get": {
7802         "requires": [
7803             "datasource-local", 
7804             "get"
7805         ]
7806     }, 
7807     "datasource-io": {
7808         "requires": [
7809             "datasource-local", 
7810             "io-base"
7811         ]
7812     }, 
7813     "datasource-jsonschema": {
7814         "requires": [
7815             "datasource-local", 
7816             "plugin", 
7817             "dataschema-json"
7818         ]
7819     }, 
7820     "datasource-local": {
7821         "requires": [
7822             "base"
7823         ]
7824     }, 
7825     "datasource-polling": {
7826         "requires": [
7827             "datasource-local"
7828         ]
7829     }, 
7830     "datasource-textschema": {
7831         "requires": [
7832             "datasource-local", 
7833             "plugin", 
7834             "dataschema-text"
7835         ]
7836     }, 
7837     "datasource-xmlschema": {
7838         "requires": [
7839             "datasource-local", 
7840             "plugin", 
7841             "dataschema-xml"
7842         ]
7843     }, 
7844     "datatable": {
7845         "use": [
7846             "datatable-core", 
7847             "datatable-head", 
7848             "datatable-body", 
7849             "datatable-base", 
7850             "datatable-column-widths", 
7851             "datatable-message", 
7852             "datatable-mutable", 
7853             "datatable-sort", 
7854             "datatable-datasource"
7855         ]
7856     }, 
7857     "datatable-base": {
7858         "requires": [
7859             "datatable-core", 
7860             "datatable-head", 
7861             "datatable-body", 
7862             "base-build", 
7863             "widget"
7864         ], 
7865         "skinnable": true
7866     }, 
7867     "datatable-base-deprecated": {
7868         "requires": [
7869             "recordset-base", 
7870             "widget", 
7871             "substitute", 
7872             "event-mouseenter"
7873         ], 
7874         "skinnable": true
7875     }, 
7876     "datatable-body": {
7877         "requires": [
7878             "datatable-core", 
7879             "view", 
7880             "classnamemanager"
7881         ]
7882     }, 
7883     "datatable-column-widths": {
7884         "requires": [
7885             "datatable-base"
7886         ]
7887     }, 
7888     "datatable-core": {
7889         "requires": [
7890             "escape", 
7891             "model-list", 
7892             "node-event-delegate"
7893         ]
7894     }, 
7895     "datatable-datasource": {
7896         "requires": [
7897             "datatable-base", 
7898             "plugin", 
7899             "datasource-local"
7900         ]
7901     }, 
7902     "datatable-datasource-deprecated": {
7903         "requires": [
7904             "datatable-base-deprecated", 
7905             "plugin", 
7906             "datasource-local"
7907         ]
7908     }, 
7909     "datatable-deprecated": {
7910         "use": [
7911             "datatable-base-deprecated", 
7912             "datatable-datasource-deprecated", 
7913             "datatable-sort-deprecated", 
7914             "datatable-scroll-deprecated"
7915         ]
7916     }, 
7917     "datatable-head": {
7918         "requires": [
7919             "datatable-core", 
7920             "view", 
7921             "classnamemanager"
7922         ]
7923     }, 
7924     "datatable-message": {
7925         "lang": [
7926             "en"
7927         ], 
7928         "requires": [
7929             "datatable-base"
7930         ], 
7931         "skinnable": true
7932     }, 
7933     "datatable-mutable": {
7934         "requires": [
7935             "datatable-base"
7936         ]
7937     }, 
7938     "datatable-scroll": {
7939         "requires": [
7940             "datatable-base", 
7941             "datatable-column-widths", 
7942             "dom-screen"
7943         ], 
7944         "skinnable": true
7945     }, 
7946     "datatable-scroll-deprecated": {
7947         "requires": [
7948             "datatable-base-deprecated", 
7949             "plugin"
7950         ]
7951     }, 
7952     "datatable-sort": {
7953         "lang": [
7954             "en"
7955         ], 
7956         "requires": [
7957             "datatable-base"
7958         ], 
7959         "skinnable": true
7960     }, 
7961     "datatable-sort-deprecated": {
7962         "lang": [
7963             "en"
7964         ], 
7965         "requires": [
7966             "datatable-base-deprecated", 
7967             "plugin", 
7968             "recordset-sort"
7969         ]
7970     }, 
7971     "datatype": {
7972         "use": [
7973             "datatype-number", 
7974             "datatype-date", 
7975             "datatype-xml"
7976         ]
7977     }, 
7978     "datatype-date": {
7979         "supersedes": [
7980             "datatype-date-format"
7981         ], 
7982         "use": [
7983             "datatype-date-parse", 
7984             "datatype-date-format"
7985         ]
7986     }, 
7987     "datatype-date-format": {
7988         "lang": [
7989             "ar", 
7990             "ar-JO", 
7991             "ca", 
7992             "ca-ES", 
7993             "da", 
7994             "da-DK", 
7995             "de", 
7996             "de-AT", 
7997             "de-DE", 
7998             "el", 
7999             "el-GR", 
8000             "en", 
8001             "en-AU", 
8002             "en-CA", 
8003             "en-GB", 
8004             "en-IE", 
8005             "en-IN", 
8006             "en-JO", 
8007             "en-MY", 
8008             "en-NZ", 
8009             "en-PH", 
8010             "en-SG", 
8011             "en-US", 
8012             "es", 
8013             "es-AR", 
8014             "es-BO", 
8015             "es-CL", 
8016             "es-CO", 
8017             "es-EC", 
8018             "es-ES", 
8019             "es-MX", 
8020             "es-PE", 
8021             "es-PY", 
8022             "es-US", 
8023             "es-UY", 
8024             "es-VE", 
8025             "fi", 
8026             "fi-FI", 
8027             "fr", 
8028             "fr-BE", 
8029             "fr-CA", 
8030             "fr-FR", 
8031             "hi", 
8032             "hi-IN", 
8033             "id", 
8034             "id-ID", 
8035             "it", 
8036             "it-IT", 
8037             "ja", 
8038             "ja-JP", 
8039             "ko", 
8040             "ko-KR", 
8041             "ms", 
8042             "ms-MY", 
8043             "nb", 
8044             "nb-NO", 
8045             "nl", 
8046             "nl-BE", 
8047             "nl-NL", 
8048             "pl", 
8049             "pl-PL", 
8050             "pt", 
8051             "pt-BR", 
8052             "ro", 
8053             "ro-RO", 
8054             "ru", 
8055             "ru-RU", 
8056             "sv", 
8057             "sv-SE", 
8058             "th", 
8059             "th-TH", 
8060             "tr", 
8061             "tr-TR", 
8062             "vi", 
8063             "vi-VN", 
8064             "zh-Hans", 
8065             "zh-Hans-CN", 
8066             "zh-Hant", 
8067             "zh-Hant-HK", 
8068             "zh-Hant-TW"
8069         ]
8070     }, 
8071     "datatype-date-math": {
8072         "requires": [
8073             "yui-base"
8074         ]
8075     }, 
8076     "datatype-date-parse": {}, 
8077     "datatype-number": {
8078         "use": [
8079             "datatype-number-parse", 
8080             "datatype-number-format"
8081         ]
8082     }, 
8083     "datatype-number-format": {}, 
8084     "datatype-number-parse": {}, 
8085     "datatype-xml": {
8086         "use": [
8087             "datatype-xml-parse", 
8088             "datatype-xml-format"
8089         ]
8090     }, 
8091     "datatype-xml-format": {}, 
8092     "datatype-xml-parse": {}, 
8093     "dd": {
8094         "use": [
8095             "dd-ddm-base", 
8096             "dd-ddm", 
8097             "dd-ddm-drop", 
8098             "dd-drag", 
8099             "dd-proxy", 
8100             "dd-constrain", 
8101             "dd-drop", 
8102             "dd-scroll", 
8103             "dd-delegate"
8104         ]
8105     }, 
8106     "dd-constrain": {
8107         "requires": [
8108             "dd-drag"
8109         ]
8110     }, 
8111     "dd-ddm": {
8112         "requires": [
8113             "dd-ddm-base", 
8114             "event-resize"
8115         ]
8116     }, 
8117     "dd-ddm-base": {
8118         "requires": [
8119             "node", 
8120             "base", 
8121             "yui-throttle", 
8122             "classnamemanager"
8123         ]
8124     }, 
8125     "dd-ddm-drop": {
8126         "requires": [
8127             "dd-ddm"
8128         ]
8129     }, 
8130     "dd-delegate": {
8131         "requires": [
8132             "dd-drag", 
8133             "dd-drop-plugin", 
8134             "event-mouseenter"
8135         ]
8136     }, 
8137     "dd-drag": {
8138         "requires": [
8139             "dd-ddm-base"
8140         ]
8141     }, 
8142     "dd-drop": {
8143         "requires": [
8144             "dd-drag", 
8145             "dd-ddm-drop"
8146         ]
8147     }, 
8148     "dd-drop-plugin": {
8149         "requires": [
8150             "dd-drop"
8151         ]
8152     }, 
8153     "dd-gestures": {
8154         "condition": {
8155             "name": "dd-gestures", 
8156             "test": function(Y) {
8157     return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));
8158 }, 
8159             "trigger": "dd-drag"
8160         }, 
8161         "requires": [
8162             "dd-drag", 
8163             "event-synthetic", 
8164             "event-gestures"
8165         ]
8166     }, 
8167     "dd-plugin": {
8168         "optional": [
8169             "dd-constrain", 
8170             "dd-proxy"
8171         ], 
8172         "requires": [
8173             "dd-drag"
8174         ]
8175     }, 
8176     "dd-proxy": {
8177         "requires": [
8178             "dd-drag"
8179         ]
8180     }, 
8181     "dd-scroll": {
8182         "requires": [
8183             "dd-drag"
8184         ]
8185     }, 
8186     "dial": {
8187         "lang": [
8188             "en", 
8189             "es"
8190         ], 
8191         "requires": [
8192             "widget", 
8193             "dd-drag", 
8194             "substitute", 
8195             "event-mouseenter", 
8196             "event-move", 
8197             "event-key", 
8198             "transition", 
8199             "intl"
8200         ], 
8201         "skinnable": true
8202     }, 
8203     "dom": {
8204         "use": [
8205             "dom-base", 
8206             "dom-screen", 
8207             "dom-style", 
8208             "selector-native", 
8209             "selector"
8210         ]
8211     }, 
8212     "dom-base": {
8213         "requires": [
8214             "dom-core"
8215         ]
8216     }, 
8217     "dom-core": {
8218         "requires": [
8219             "oop", 
8220             "features"
8221         ]
8222     }, 
8223     "dom-deprecated": {
8224         "requires": [
8225             "dom-base"
8226         ]
8227     }, 
8228     "dom-screen": {
8229         "requires": [
8230             "dom-base", 
8231             "dom-style"
8232         ]
8233     }, 
8234     "dom-style": {
8235         "requires": [
8236             "dom-base"
8237         ]
8238     }, 
8239     "dom-style-ie": {
8240         "condition": {
8241             "name": "dom-style-ie", 
8242             "test": function (Y) {
8244     var testFeature = Y.Features.test,
8245         addFeature = Y.Features.add,
8246         WINDOW = Y.config.win,
8247         DOCUMENT = Y.config.doc,
8248         DOCUMENT_ELEMENT = 'documentElement',
8249         ret = false;
8251     addFeature('style', 'computedStyle', {
8252         test: function() {
8253             return WINDOW && 'getComputedStyle' in WINDOW;
8254         }
8255     });
8257     addFeature('style', 'opacity', {
8258         test: function() {
8259             return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
8260         }
8261     });
8263     ret =  (!testFeature('style', 'opacity') &&
8264             !testFeature('style', 'computedStyle'));
8266     return ret;
8267 }, 
8268             "trigger": "dom-style"
8269         }, 
8270         "requires": [
8271             "dom-style"
8272         ]
8273     }, 
8274     "dump": {
8275         "requires": [
8276             "yui-base"
8277         ]
8278     }, 
8279     "editor": {
8280         "use": [
8281             "frame", 
8282             "editor-selection", 
8283             "exec-command", 
8284             "editor-base", 
8285             "editor-para", 
8286             "editor-br", 
8287             "editor-bidi", 
8288             "editor-tab", 
8289             "createlink-base"
8290         ]
8291     }, 
8292     "editor-base": {
8293         "requires": [
8294             "base", 
8295             "frame", 
8296             "node", 
8297             "exec-command", 
8298             "editor-selection"
8299         ]
8300     }, 
8301     "editor-bidi": {
8302         "requires": [
8303             "editor-base"
8304         ]
8305     }, 
8306     "editor-br": {
8307         "requires": [
8308             "editor-base"
8309         ]
8310     }, 
8311     "editor-lists": {
8312         "requires": [
8313             "editor-base"
8314         ]
8315     }, 
8316     "editor-para": {
8317         "requires": [
8318             "editor-para-base"
8319         ]
8320     }, 
8321     "editor-para-base": {
8322         "requires": [
8323             "editor-base"
8324         ]
8325     }, 
8326     "editor-para-ie": {
8327         "condition": {
8328             "name": "editor-para-ie", 
8329             "trigger": "editor-para", 
8330             "ua": "ie", 
8331             "when": "instead"
8332         }, 
8333         "requires": [
8334             "editor-para-base"
8335         ]
8336     }, 
8337     "editor-selection": {
8338         "requires": [
8339             "node"
8340         ]
8341     }, 
8342     "editor-tab": {
8343         "requires": [
8344             "editor-base"
8345         ]
8346     }, 
8347     "escape": {
8348         "requires": [
8349             "yui-base"
8350         ]
8351     }, 
8352     "event": {
8353         "after": [
8354             "node-base"
8355         ], 
8356         "use": [
8357             "event-base", 
8358             "event-delegate", 
8359             "event-synthetic", 
8360             "event-mousewheel", 
8361             "event-mouseenter", 
8362             "event-key", 
8363             "event-focus", 
8364             "event-resize", 
8365             "event-hover", 
8366             "event-outside", 
8367             "event-touch", 
8368             "event-move", 
8369             "event-flick", 
8370             "event-valuechange"
8371         ]
8372     }, 
8373     "event-base": {
8374         "after": [
8375             "node-base"
8376         ], 
8377         "requires": [
8378             "event-custom-base"
8379         ]
8380     }, 
8381     "event-base-ie": {
8382         "after": [
8383             "event-base"
8384         ], 
8385         "condition": {
8386             "name": "event-base-ie", 
8387             "test": function(Y) {
8388     var imp = Y.config.doc && Y.config.doc.implementation;
8389     return (imp && (!imp.hasFeature('Events', '2.0')));
8390 }, 
8391             "trigger": "node-base"
8392         }, 
8393         "requires": [
8394             "node-base"
8395         ]
8396     }, 
8397     "event-contextmenu": {
8398         "requires": [
8399             "event-synthetic", 
8400             "dom-screen"
8401         ]
8402     }, 
8403     "event-custom": {
8404         "use": [
8405             "event-custom-base", 
8406             "event-custom-complex"
8407         ]
8408     }, 
8409     "event-custom-base": {
8410         "requires": [
8411             "oop"
8412         ]
8413     }, 
8414     "event-custom-complex": {
8415         "requires": [
8416             "event-custom-base"
8417         ]
8418     }, 
8419     "event-delegate": {
8420         "requires": [
8421             "node-base"
8422         ]
8423     }, 
8424     "event-flick": {
8425         "requires": [
8426             "node-base", 
8427             "event-touch", 
8428             "event-synthetic"
8429         ]
8430     }, 
8431     "event-focus": {
8432         "requires": [
8433             "event-synthetic"
8434         ]
8435     }, 
8436     "event-gestures": {
8437         "use": [
8438             "event-flick", 
8439             "event-move"
8440         ]
8441     }, 
8442     "event-hover": {
8443         "requires": [
8444             "event-mouseenter"
8445         ]
8446     }, 
8447     "event-key": {
8448         "requires": [
8449             "event-synthetic"
8450         ]
8451     }, 
8452     "event-mouseenter": {
8453         "requires": [
8454             "event-synthetic"
8455         ]
8456     }, 
8457     "event-mousewheel": {
8458         "requires": [
8459             "node-base"
8460         ]
8461     }, 
8462     "event-move": {
8463         "requires": [
8464             "node-base", 
8465             "event-touch", 
8466             "event-synthetic"
8467         ]
8468     }, 
8469     "event-outside": {
8470         "requires": [
8471             "event-synthetic"
8472         ]
8473     }, 
8474     "event-resize": {
8475         "requires": [
8476             "node-base", 
8477             "event-synthetic"
8478         ]
8479     }, 
8480     "event-simulate": {
8481         "requires": [
8482             "event-base"
8483         ]
8484     }, 
8485     "event-synthetic": {
8486         "requires": [
8487             "node-base", 
8488             "event-custom-complex"
8489         ]
8490     }, 
8491     "event-touch": {
8492         "requires": [
8493             "node-base"
8494         ]
8495     }, 
8496     "event-valuechange": {
8497         "requires": [
8498             "event-focus", 
8499             "event-synthetic"
8500         ]
8501     }, 
8502     "exec-command": {
8503         "requires": [
8504             "frame"
8505         ]
8506     }, 
8507     "features": {
8508         "requires": [
8509             "yui-base"
8510         ]
8511     }, 
8512     "file": {
8513         "requires": [
8514             "file-flash", 
8515             "file-html5"
8516         ]
8517     }, 
8518     "file-flash": {
8519         "requires": [
8520             "base"
8521         ]
8522     }, 
8523     "file-html5": {
8524         "requires": [
8525             "base"
8526         ]
8527     }, 
8528     "frame": {
8529         "requires": [
8530             "base", 
8531             "node", 
8532             "selector-css3", 
8533             "substitute", 
8534             "yui-throttle"
8535         ]
8536     }, 
8537     "get": {
8538         "requires": [
8539             "yui-base"
8540         ]
8541     }, 
8542     "graphics": {
8543         "requires": [
8544             "node", 
8545             "event-custom", 
8546             "pluginhost", 
8547             "matrix"
8548         ]
8549     }, 
8550     "graphics-canvas": {
8551         "condition": {
8552             "name": "graphics-canvas", 
8553             "test": function(Y) {
8554     var DOCUMENT = Y.config.doc,
8555         useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
8556                 canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
8557         svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
8558     return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
8559 }, 
8560             "trigger": "graphics"
8561         }, 
8562         "requires": [
8563             "graphics"
8564         ]
8565     }, 
8566     "graphics-canvas-default": {
8567         "condition": {
8568             "name": "graphics-canvas-default", 
8569             "test": function(Y) {
8570     var DOCUMENT = Y.config.doc,
8571         useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
8572                 canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
8573         svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
8574     return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
8575 }, 
8576             "trigger": "graphics"
8577         }
8578     }, 
8579     "graphics-svg": {
8580         "condition": {
8581             "name": "graphics-svg", 
8582             "test": function(Y) {
8583     var DOCUMENT = Y.config.doc,
8584         useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
8585                 canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
8586         svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
8587     
8588     return svg && (useSVG || !canvas);
8589 }, 
8590             "trigger": "graphics"
8591         }, 
8592         "requires": [
8593             "graphics"
8594         ]
8595     }, 
8596     "graphics-svg-default": {
8597         "condition": {
8598             "name": "graphics-svg-default", 
8599             "test": function(Y) {
8600     var DOCUMENT = Y.config.doc,
8601         useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
8602                 canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
8603         svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
8604     
8605     return svg && (useSVG || !canvas);
8606 }, 
8607             "trigger": "graphics"
8608         }
8609     }, 
8610     "graphics-vml": {
8611         "condition": {
8612             "name": "graphics-vml", 
8613             "test": function(Y) {
8614     var DOCUMENT = Y.config.doc,
8615                 canvas = DOCUMENT && DOCUMENT.createElement("canvas");
8616     return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
8617 }, 
8618             "trigger": "graphics"
8619         }, 
8620         "requires": [
8621             "graphics"
8622         ]
8623     }, 
8624     "graphics-vml-default": {
8625         "condition": {
8626             "name": "graphics-vml-default", 
8627             "test": function(Y) {
8628     var DOCUMENT = Y.config.doc,
8629                 canvas = DOCUMENT && DOCUMENT.createElement("canvas");
8630     return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
8631 }, 
8632             "trigger": "graphics"
8633         }
8634     }, 
8635     "handlebars": {
8636         "use": [
8637             "handlebars-compiler"
8638         ]
8639     }, 
8640     "handlebars-base": {
8641         "requires": [
8642             "escape"
8643         ]
8644     }, 
8645     "handlebars-compiler": {
8646         "requires": [
8647             "handlebars-base"
8648         ]
8649     }, 
8650     "highlight": {
8651         "use": [
8652             "highlight-base", 
8653             "highlight-accentfold"
8654         ]
8655     }, 
8656     "highlight-accentfold": {
8657         "requires": [
8658             "highlight-base", 
8659             "text-accentfold"
8660         ]
8661     }, 
8662     "highlight-base": {
8663         "requires": [
8664             "array-extras", 
8665             "classnamemanager", 
8666             "escape", 
8667             "text-wordbreak"
8668         ]
8669     }, 
8670     "history": {
8671         "use": [
8672             "history-base", 
8673             "history-hash", 
8674             "history-hash-ie", 
8675             "history-html5"
8676         ]
8677     }, 
8678     "history-base": {
8679         "requires": [
8680             "event-custom-complex"
8681         ]
8682     }, 
8683     "history-hash": {
8684         "after": [
8685             "history-html5"
8686         ], 
8687         "requires": [
8688             "event-synthetic", 
8689             "history-base", 
8690             "yui-later"
8691         ]
8692     }, 
8693     "history-hash-ie": {
8694         "condition": {
8695             "name": "history-hash-ie", 
8696             "test": function (Y) {
8697     var docMode = Y.config.doc && Y.config.doc.documentMode;
8699     return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
8700             !docMode || docMode < 8);
8701 }, 
8702             "trigger": "history-hash"
8703         }, 
8704         "requires": [
8705             "history-hash", 
8706             "node-base"
8707         ]
8708     }, 
8709     "history-html5": {
8710         "optional": [
8711             "json"
8712         ], 
8713         "requires": [
8714             "event-base", 
8715             "history-base", 
8716             "node-base"
8717         ]
8718     }, 
8719     "imageloader": {
8720         "requires": [
8721             "base-base", 
8722             "node-style", 
8723             "node-screen"
8724         ]
8725     }, 
8726     "intl": {
8727         "requires": [
8728             "intl-base", 
8729             "event-custom"
8730         ]
8731     }, 
8732     "intl-base": {
8733         "requires": [
8734             "yui-base"
8735         ]
8736     }, 
8737     "io": {
8738         "use": [
8739             "io-base", 
8740             "io-xdr", 
8741             "io-form", 
8742             "io-upload-iframe", 
8743             "io-queue"
8744         ]
8745     }, 
8746     "io-base": {
8747         "requires": [
8748             "event-custom-base", 
8749             "querystring-stringify-simple"
8750         ]
8751     }, 
8752     "io-form": {
8753         "requires": [
8754             "io-base", 
8755             "node-base"
8756         ]
8757     }, 
8758     "io-nodejs": {
8759         "condition": {
8760             "name": "io-nodejs", 
8761             "trigger": "io-base", 
8762             "ua": "nodejs"
8763         }, 
8764         "requires": [
8765             "io-base"
8766         ]
8767     }, 
8768     "io-queue": {
8769         "requires": [
8770             "io-base", 
8771             "queue-promote"
8772         ]
8773     }, 
8774     "io-upload-iframe": {
8775         "requires": [
8776             "io-base", 
8777             "node-base"
8778         ]
8779     }, 
8780     "io-xdr": {
8781         "requires": [
8782             "io-base", 
8783             "datatype-xml-parse"
8784         ]
8785     }, 
8786     "json": {
8787         "use": [
8788             "json-parse", 
8789             "json-stringify"
8790         ]
8791     }, 
8792     "json-parse": {
8793         "requires": [
8794             "yui-base"
8795         ]
8796     }, 
8797     "json-stringify": {
8798         "requires": [
8799             "yui-base"
8800         ]
8801     }, 
8802     "jsonp": {
8803         "requires": [
8804             "get", 
8805             "oop"
8806         ]
8807     }, 
8808     "jsonp-url": {
8809         "requires": [
8810             "jsonp"
8811         ]
8812     }, 
8813     "loader": {
8814         "use": [
8815             "loader-base", 
8816             "loader-rollup", 
8817             "loader-yui3"
8818         ]
8819     }, 
8820     "loader-base": {
8821         "requires": [
8822             "get", 
8823             "features"
8824         ]
8825     }, 
8826     "loader-rollup": {
8827         "requires": [
8828             "loader-base"
8829         ]
8830     }, 
8831     "loader-yui3": {
8832         "requires": [
8833             "loader-base"
8834         ]
8835     }, 
8836     "matrix": {
8837         "requires": [
8838             "yui-base"
8839         ]
8840     }, 
8841     "model": {
8842         "requires": [
8843             "base-build", 
8844             "escape", 
8845             "json-parse"
8846         ]
8847     }, 
8848     "model-list": {
8849         "requires": [
8850             "array-extras", 
8851             "array-invoke", 
8852             "arraylist", 
8853             "base-build", 
8854             "escape", 
8855             "json-parse", 
8856             "model"
8857         ]
8858     }, 
8859     "node": {
8860         "use": [
8861             "node-base", 
8862             "node-event-delegate", 
8863             "node-pluginhost", 
8864             "node-screen", 
8865             "node-style"
8866         ]
8867     }, 
8868     "node-base": {
8869         "requires": [
8870             "event-base", 
8871             "node-core", 
8872             "dom-base"
8873         ]
8874     }, 
8875     "node-core": {
8876         "requires": [
8877             "dom-core", 
8878             "selector"
8879         ]
8880     }, 
8881     "node-deprecated": {
8882         "requires": [
8883             "node-base"
8884         ]
8885     }, 
8886     "node-event-delegate": {
8887         "requires": [
8888             "node-base", 
8889             "event-delegate"
8890         ]
8891     }, 
8892     "node-event-html5": {
8893         "requires": [
8894             "node-base"
8895         ]
8896     }, 
8897     "node-event-simulate": {
8898         "requires": [
8899             "node-base", 
8900             "event-simulate"
8901         ]
8902     }, 
8903     "node-flick": {
8904         "requires": [
8905             "classnamemanager", 
8906             "transition", 
8907             "event-flick", 
8908             "plugin"
8909         ], 
8910         "skinnable": true
8911     }, 
8912     "node-focusmanager": {
8913         "requires": [
8914             "attribute", 
8915             "node", 
8916             "plugin", 
8917             "node-event-simulate", 
8918             "event-key", 
8919             "event-focus"
8920         ]
8921     }, 
8922     "node-load": {
8923         "requires": [
8924             "node-base", 
8925             "io-base"
8926         ]
8927     }, 
8928     "node-menunav": {
8929         "requires": [
8930             "node", 
8931             "classnamemanager", 
8932             "plugin", 
8933             "node-focusmanager"
8934         ], 
8935         "skinnable": true
8936     }, 
8937     "node-pluginhost": {
8938         "requires": [
8939             "node-base", 
8940             "pluginhost"
8941         ]
8942     }, 
8943     "node-screen": {
8944         "requires": [
8945             "dom-screen", 
8946             "node-base"
8947         ]
8948     }, 
8949     "node-style": {
8950         "requires": [
8951             "dom-style", 
8952             "node-base"
8953         ]
8954     }, 
8955     "oop": {
8956         "requires": [
8957             "yui-base"
8958         ]
8959     }, 
8960     "overlay": {
8961         "requires": [
8962             "widget", 
8963             "widget-stdmod", 
8964             "widget-position", 
8965             "widget-position-align", 
8966             "widget-stack", 
8967             "widget-position-constrain"
8968         ], 
8969         "skinnable": true
8970     }, 
8971     "panel": {
8972         "requires": [
8973             "widget", 
8974             "widget-autohide", 
8975             "widget-buttons", 
8976             "widget-modality", 
8977             "widget-position", 
8978             "widget-position-align", 
8979             "widget-position-constrain", 
8980             "widget-stack", 
8981             "widget-stdmod"
8982         ], 
8983         "skinnable": true
8984     }, 
8985     "parallel": {
8986         "requires": [
8987             "yui-base"
8988         ]
8989     }, 
8990     "pjax": {
8991         "requires": [
8992             "pjax-base", 
8993             "io-base"
8994         ]
8995     }, 
8996     "pjax-base": {
8997         "requires": [
8998             "classnamemanager", 
8999             "node-event-delegate", 
9000             "router"
9001         ]
9002     }, 
9003     "pjax-plugin": {
9004         "requires": [
9005             "node-pluginhost", 
9006             "pjax", 
9007             "plugin"
9008         ]
9009     }, 
9010     "plugin": {
9011         "requires": [
9012             "base-base"
9013         ]
9014     }, 
9015     "pluginhost": {
9016         "use": [
9017             "pluginhost-base", 
9018             "pluginhost-config"
9019         ]
9020     }, 
9021     "pluginhost-base": {
9022         "requires": [
9023             "yui-base"
9024         ]
9025     }, 
9026     "pluginhost-config": {
9027         "requires": [
9028             "pluginhost-base"
9029         ]
9030     }, 
9031     "profiler": {
9032         "requires": [
9033             "yui-base"
9034         ]
9035     }, 
9036     "querystring": {
9037         "use": [
9038             "querystring-parse", 
9039             "querystring-stringify"
9040         ]
9041     }, 
9042     "querystring-parse": {
9043         "requires": [
9044             "yui-base", 
9045             "array-extras"
9046         ]
9047     }, 
9048     "querystring-parse-simple": {
9049         "requires": [
9050             "yui-base"
9051         ]
9052     }, 
9053     "querystring-stringify": {
9054         "requires": [
9055             "yui-base"
9056         ]
9057     }, 
9058     "querystring-stringify-simple": {
9059         "requires": [
9060             "yui-base"
9061         ]
9062     }, 
9063     "queue-promote": {
9064         "requires": [
9065             "yui-base"
9066         ]
9067     }, 
9068     "range-slider": {
9069         "requires": [
9070             "slider-base", 
9071             "slider-value-range", 
9072             "clickable-rail"
9073         ]
9074     }, 
9075     "recordset": {
9076         "use": [
9077             "recordset-base", 
9078             "recordset-sort", 
9079             "recordset-filter", 
9080             "recordset-indexer"
9081         ]
9082     }, 
9083     "recordset-base": {
9084         "requires": [
9085             "base", 
9086             "arraylist"
9087         ]
9088     }, 
9089     "recordset-filter": {
9090         "requires": [
9091             "recordset-base", 
9092             "array-extras", 
9093             "plugin"
9094         ]
9095     }, 
9096     "recordset-indexer": {
9097         "requires": [
9098             "recordset-base", 
9099             "plugin"
9100         ]
9101     }, 
9102     "recordset-sort": {
9103         "requires": [
9104             "arraysort", 
9105             "recordset-base", 
9106             "plugin"
9107         ]
9108     }, 
9109     "resize": {
9110         "use": [
9111             "resize-base", 
9112             "resize-proxy", 
9113             "resize-constrain"
9114         ]
9115     }, 
9116     "resize-base": {
9117         "requires": [
9118             "base", 
9119             "widget", 
9120             "substitute", 
9121             "event", 
9122             "oop", 
9123             "dd-drag", 
9124             "dd-delegate", 
9125             "dd-drop"
9126         ], 
9127         "skinnable": true
9128     }, 
9129     "resize-constrain": {
9130         "requires": [
9131             "plugin", 
9132             "resize-base"
9133         ]
9134     }, 
9135     "resize-plugin": {
9136         "optional": [
9137             "resize-constrain"
9138         ], 
9139         "requires": [
9140             "resize-base", 
9141             "plugin"
9142         ]
9143     }, 
9144     "resize-proxy": {
9145         "requires": [
9146             "plugin", 
9147             "resize-base"
9148         ]
9149     }, 
9150     "rls": {
9151         "requires": [
9152             "get", 
9153             "features"
9154         ]
9155     }, 
9156     "router": {
9157         "optional": [
9158             "querystring-parse"
9159         ], 
9160         "requires": [
9161             "array-extras", 
9162             "base-build", 
9163             "history"
9164         ]
9165     }, 
9166     "scrollview": {
9167         "requires": [
9168             "scrollview-base", 
9169             "scrollview-scrollbars"
9170         ]
9171     }, 
9172     "scrollview-base": {
9173         "requires": [
9174             "widget", 
9175             "event-gestures", 
9176             "event-mousewheel", 
9177             "transition"
9178         ], 
9179         "skinnable": true
9180     }, 
9181     "scrollview-base-ie": {
9182         "condition": {
9183             "name": "scrollview-base-ie", 
9184             "trigger": "scrollview-base", 
9185             "ua": "ie"
9186         }, 
9187         "requires": [
9188             "scrollview-base"
9189         ]
9190     }, 
9191     "scrollview-list": {
9192         "requires": [
9193             "plugin", 
9194             "classnamemanager"
9195         ], 
9196         "skinnable": true
9197     }, 
9198     "scrollview-paginator": {
9199         "requires": [
9200             "plugin"
9201         ]
9202     }, 
9203     "scrollview-scrollbars": {
9204         "requires": [
9205             "classnamemanager", 
9206             "transition", 
9207             "plugin"
9208         ], 
9209         "skinnable": true
9210     }, 
9211     "selector": {
9212         "requires": [
9213             "selector-native"
9214         ]
9215     }, 
9216     "selector-css2": {
9217         "condition": {
9218             "name": "selector-css2", 
9219             "test": function (Y) {
9220     var DOCUMENT = Y.config.doc,
9221         ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
9223     return ret;
9224 }, 
9225             "trigger": "selector"
9226         }, 
9227         "requires": [
9228             "selector-native"
9229         ]
9230     }, 
9231     "selector-css3": {
9232         "requires": [
9233             "selector-native", 
9234             "selector-css2"
9235         ]
9236     }, 
9237     "selector-native": {
9238         "requires": [
9239             "dom-base"
9240         ]
9241     }, 
9242     "shim-plugin": {
9243         "requires": [
9244             "node-style", 
9245             "node-pluginhost"
9246         ]
9247     }, 
9248     "slider": {
9249         "use": [
9250             "slider-base", 
9251             "slider-value-range", 
9252             "clickable-rail", 
9253             "range-slider"
9254         ]
9255     }, 
9256     "slider-base": {
9257         "requires": [
9258             "widget", 
9259             "dd-constrain", 
9260             "substitute", 
9261             "event-key"
9262         ], 
9263         "skinnable": true
9264     }, 
9265     "slider-value-range": {
9266         "requires": [
9267             "slider-base"
9268         ]
9269     }, 
9270     "sortable": {
9271         "requires": [
9272             "dd-delegate", 
9273             "dd-drop-plugin", 
9274             "dd-proxy"
9275         ]
9276     }, 
9277     "sortable-scroll": {
9278         "requires": [
9279             "dd-scroll", 
9280             "sortable"
9281         ]
9282     }, 
9283     "stylesheet": {
9284         "requires": [
9285             "yui-base"
9286         ]
9287     }, 
9288     "substitute": {
9289         "optional": [
9290             "dump"
9291         ], 
9292         "requires": [
9293             "yui-base"
9294         ]
9295     }, 
9296     "swf": {
9297         "requires": [
9298             "event-custom", 
9299             "node", 
9300             "swfdetect", 
9301             "escape"
9302         ]
9303     }, 
9304     "swfdetect": {
9305         "requires": [
9306             "yui-base"
9307         ]
9308     }, 
9309     "tabview": {
9310         "requires": [
9311             "widget", 
9312             "widget-parent", 
9313             "widget-child", 
9314             "tabview-base", 
9315             "node-pluginhost", 
9316             "node-focusmanager"
9317         ], 
9318         "skinnable": true
9319     }, 
9320     "tabview-base": {
9321         "requires": [
9322             "node-event-delegate", 
9323             "classnamemanager", 
9324             "skin-sam-tabview"
9325         ]
9326     }, 
9327     "tabview-plugin": {
9328         "requires": [
9329             "tabview-base"
9330         ]
9331     }, 
9332     "test": {
9333         "requires": [
9334             "event-simulate", 
9335             "event-custom", 
9336             "substitute", 
9337             "json-stringify"
9338         ], 
9339         "skinnable": true
9340     }, 
9341     "test-console": {
9342         "requires": [
9343             "console-filters", 
9344             "test"
9345         ], 
9346         "skinnable": true
9347     }, 
9348     "text": {
9349         "use": [
9350             "text-accentfold", 
9351             "text-wordbreak"
9352         ]
9353     }, 
9354     "text-accentfold": {
9355         "requires": [
9356             "array-extras", 
9357             "text-data-accentfold"
9358         ]
9359     }, 
9360     "text-data-accentfold": {
9361         "requires": [
9362             "yui-base"
9363         ]
9364     }, 
9365     "text-data-wordbreak": {
9366         "requires": [
9367             "yui-base"
9368         ]
9369     }, 
9370     "text-wordbreak": {
9371         "requires": [
9372             "array-extras", 
9373             "text-data-wordbreak"
9374         ]
9375     }, 
9376     "transition": {
9377         "requires": [
9378             "node-style"
9379         ]
9380     }, 
9381     "transition-timer": {
9382         "condition": {
9383             "name": "transition-timer", 
9384             "test": function (Y) {
9385     var DOCUMENT = Y.config.doc,
9386         node = (DOCUMENT) ? DOCUMENT.documentElement: null,
9387         ret = true;
9389     if (node && node.style) {
9390         ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);
9391     } 
9393     return ret;
9394 }, 
9395             "trigger": "transition"
9396         }, 
9397         "requires": [
9398             "transition"
9399         ]
9400     }, 
9401     "uploader": {
9402         "requires": [
9403             "uploader-html5", 
9404             "uploader-flash"
9405         ]
9406     }, 
9407     "uploader-deprecated": {
9408         "requires": [
9409             "event-custom", 
9410             "node", 
9411             "base", 
9412             "swf"
9413         ]
9414     }, 
9415     "uploader-flash": {
9416         "requires": [
9417             "swf", 
9418             "widget", 
9419             "substitute", 
9420             "base", 
9421             "cssbutton", 
9422             "node", 
9423             "event-custom", 
9424             "file-flash", 
9425             "uploader-queue"
9426         ]
9427     }, 
9428     "uploader-html5": {
9429         "requires": [
9430             "widget", 
9431             "node-event-simulate", 
9432             "substitute", 
9433             "file-html5", 
9434             "uploader-queue"
9435         ]
9436     }, 
9437     "uploader-queue": {
9438         "requires": [
9439             "base"
9440         ]
9441     }, 
9442     "view": {
9443         "requires": [
9444             "base-build", 
9445             "node-event-delegate"
9446         ]
9447     }, 
9448     "view-node-map": {
9449         "requires": [
9450             "view"
9451         ]
9452     }, 
9453     "widget": {
9454         "use": [
9455             "widget-base", 
9456             "widget-htmlparser", 
9457             "widget-skin", 
9458             "widget-uievents"
9459         ]
9460     }, 
9461     "widget-anim": {
9462         "requires": [
9463             "anim-base", 
9464             "plugin", 
9465             "widget"
9466         ]
9467     }, 
9468     "widget-autohide": {
9469         "requires": [
9470             "base-build", 
9471             "event-key", 
9472             "event-outside", 
9473             "widget"
9474         ]
9475     }, 
9476     "widget-base": {
9477         "requires": [
9478             "attribute", 
9479             "base-base", 
9480             "base-pluginhost", 
9481             "classnamemanager", 
9482             "event-focus", 
9483             "node-base", 
9484             "node-style"
9485         ], 
9486         "skinnable": true
9487     }, 
9488     "widget-base-ie": {
9489         "condition": {
9490             "name": "widget-base-ie", 
9491             "trigger": "widget-base", 
9492             "ua": "ie"
9493         }, 
9494         "requires": [
9495             "widget-base"
9496         ]
9497     }, 
9498     "widget-buttons": {
9499         "requires": [
9500             "button-plugin", 
9501             "cssbutton", 
9502             "widget-stdmod"
9503         ]
9504     }, 
9505     "widget-child": {
9506         "requires": [
9507             "base-build", 
9508             "widget"
9509         ]
9510     }, 
9511     "widget-htmlparser": {
9512         "requires": [
9513             "widget-base"
9514         ]
9515     }, 
9516     "widget-locale": {
9517         "requires": [
9518             "widget-base"
9519         ]
9520     }, 
9521     "widget-modality": {
9522         "requires": [
9523             "base-build", 
9524             "event-outside", 
9525             "widget"
9526         ], 
9527         "skinnable": true
9528     }, 
9529     "widget-parent": {
9530         "requires": [
9531             "arraylist", 
9532             "base-build", 
9533             "widget"
9534         ]
9535     }, 
9536     "widget-position": {
9537         "requires": [
9538             "base-build", 
9539             "node-screen", 
9540             "widget"
9541         ]
9542     }, 
9543     "widget-position-align": {
9544         "requires": [
9545             "widget-position"
9546         ]
9547     }, 
9548     "widget-position-constrain": {
9549         "requires": [
9550             "widget-position"
9551         ]
9552     }, 
9553     "widget-skin": {
9554         "requires": [
9555             "widget-base"
9556         ]
9557     }, 
9558     "widget-stack": {
9559         "requires": [
9560             "base-build", 
9561             "widget"
9562         ], 
9563         "skinnable": true
9564     }, 
9565     "widget-stdmod": {
9566         "requires": [
9567             "base-build", 
9568             "widget"
9569         ]
9570     }, 
9571     "widget-uievents": {
9572         "requires": [
9573             "node-event-delegate", 
9574             "widget-base"
9575         ]
9576     }, 
9577     "yql": {
9578         "requires": [
9579             "jsonp", 
9580             "jsonp-url"
9581         ]
9582     }, 
9583     "yui": {}, 
9584     "yui-base": {}, 
9585     "yui-later": {
9586         "requires": [
9587             "yui-base"
9588         ]
9589     }, 
9590     "yui-log": {
9591         "requires": [
9592             "yui-base"
9593         ]
9594     }, 
9595     "yui-rls": {}, 
9596     "yui-throttle": {
9597         "requires": [
9598             "yui-base"
9599         ]
9600     }
9602 YUI.Env[Y.version].md5 = 'f5a3bc9bda2441a3b15fb52c567fc1f7';
9605 }, '3.5.1' ,{requires:['loader-base']});
9608 YUI.add('yui', function(Y){}, '3.5.1' ,{use:['yui-base','get','features','intl-base','yui-log','yui-log-nodejs','yui-later','loader-base', 'loader-rollup', 'loader-yui3']});