{"version":3,"sources":["scripts/yepnope-1.5.4.min.js"],"names":["window","doc","undef","isFileReady","readyState","injectJs","src","cb","attrs","timeout","err","internal","done","i","script","createElement","yepnope","setAttribute","executeStack","noop","onreadystatechange","onload","sTimeout","firstScript","parentNode","insertBefore","injectCss","href","link","rel","type","execStack","shift","started","preloadFile","elem","url","splicePoint","dontExec","attrObj","first","preloadElem","stackObject","insBeforeObj","removeChild","scriptCache","hasOwnProperty","firstFlag","t","s","e","a","x","data","width","height","onerror","call","this","splice","isGeckoLTE18","push","load","resource","isString","strCssElem","strJsElem","length","getYepnope","y","handler","docElement","documentElement","setTimeout","getElementsByTagName","toString","isGecko","style","createRange","compareNode","isOpera","opera","isIE","attachEvent","isArray","Array","obj","isObject","Object","isFunction","fn","globalFilters","prefixes","resourceObj","prefix_parts","needs","satisfyPrefixes","mFunc","j","parts","split","gLen","origUrl","pop","pLen","res","getExtension","loadScriptOrStyle","input","callback","chain","index","testResult","autoCallback","loadFromTestObject","testObject","handleGroup","needGroup","moreToCome","args","slice","arguments","cbRef","apply","complete","needGroupSize","count","callbackKey","innerCb","group","always","need","prefix","filter","addEventListener","removeEventListener","document"],"mappings":"CAeA,SAAaA,EAAQC,EAAKC,GA+CxB,QAASC,GAAcC,GAErB,OAAWA,GAA4B,UAAdA,GAAwC,YAAdA,GAA0C,iBAAdA,EAMjF,QAASC,GAAWC,EAAKC,EAAIC,EAAOC,EAA4BC,EAAKC,GACnE,GACIC,GAAMC,EADNC,EAASb,EAAIc,cAAe,SAGhCN,GAAUA,GAAWO,EAAsB,aAE3CF,EAAOR,IAAMA,CAGb,KAAMO,IAAKL,GACPM,EAAOG,aAAcJ,EAAGL,EAAOK,GAGnCN,GAAKI,EAAWO,EAAiBX,GAAMY,EAGvCL,EAAOM,mBAAqBN,EAAOO,OAAS,YAEnCT,GAAQT,EAAaW,EAAOV,cAGjCQ,EAAO,EACPL,IAGAO,EAAOO,OAASP,EAAOM,mBAAqB,OAKhDE,EAAS,WACAV,IACLA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EAPAf,IAAgBG,EAAiB,KACjCc,EAAajB,EAAaG,EAAgB,IAAIA,EAAiB,KAC/De,EAAaf,EAAiB,MAAKA,EAAiB,KACpDN,EAAaM,EAAqB,UAAKhG,EACvCuG,EAAab,EACbe,EAAaT,EAAqB,UAAKhG,CA2E3CiG,GAAaa,IAASC,GAItBA,GAAUd,EAAac,GAvL3B,GAAIrH,GACAsH,EAEArB,EAAQpD,KAAc,QAAU,MAwLpC,IAAKM,EAAU+B,GACbY,EAAmBZ,EAAO,EAAGe,EAAO,OAGjC,IAAK1B,EAASW,GAEjB,IAAKlF,EAAI,EAAGA,EAAIkF,EAAM5B,OAAQtD,IAC5BsH,EAAOpC,EAAOlF,GAGTmD,EAAUmE,GACbxB,EAAmBwB,EAAM,EAAGrB,EAAO,GAG3B1B,EAAS+C,GACjBnH,EAASmH,GAGD5C,EAAU4C,IAClBjB,EAAoBiB,EAAMrB,OAKtBvB,GAAUQ,IAClBmB,EAAoBnB,EAAOe,IAc/B9F,EAAmB,UAAI,SAAWoH,EAAQvB,GACxCjB,EAAUwC,GAAWvB,GAWvB7F,EAAmB,UAAI,SAAWqH,GAChC1C,EAAc9B,KAAMwE,IAItBrH,EAAsB,aAAI,IAKH,MAAlBf,EAAIG,YAAsBH,EAAIqI,mBAEjCrI,EAAIG,WAAa,UAEjBH,EAAIqI,iBAAkB,mBAAoBhE,EAAU,WAElDrE,EAAIsI,oBAAqB,mBAAoBjE,EAAS,GAEtDrE,EAAIG,WAAa,YAChB,IAKLJ,EAAgB,QAAIoE,IAGpBpE,EAAgB,QAAgB,aAAIkB,EACpClB,EAAgB,QAAY,SAAIK,EAChCL,EAAgB,QAAa,UAAI0B,GAE/BgC,KAAM8E","file":"yepnope-1.5.4.min.js","sourcesContent":["// yepnope.js\n// Version - 1.5.4pre\n//\n// by\n// Alex Sexton - @SlexAxton - AlexSexton[at]gmail.com\n// Ralph Holzmann - @ralphholzmann - ralphholzmann[at]gmail.com\n//\n// http://yepnopejs.com/\n// https://github.com/SlexAxton/yepnope.js/\n//\n// Tri-license - WTFPL | MIT | BSD\n//\n// Please minify before use.\n// Also available as Modernizr.load via the Modernizr Project\n//\n( function ( window, doc, undef ) {\n\nvar docElement = doc.documentElement,\n sTimeout = window.setTimeout,\n firstScript = doc.getElementsByTagName( \"script\" )[ 0 ],\n toString = {}.toString,\n execStack = [],\n started = 0,\n noop = function () {},\n // Before you get mad about browser sniffs, please read:\n // https://github.com/Modernizr/Modernizr/wiki/Undetectables\n // If you have a better solution, we are actively looking to solve the problem\n isGecko = ( \"MozAppearance\" in docElement.style ),\n isGeckoLTE18 = isGecko && !! doc.createRange().compareNode,\n insBeforeObj = isGeckoLTE18 ? docElement : firstScript.parentNode,\n // Thanks to @jdalton for showing us this opera detection (by way of @kangax) (and probably @miketaylr too, or whatever...)\n isOpera = window.opera && toString.call( window.opera ) == \"[object Opera]\",\n isIE = !! doc.attachEvent && !isOpera,\n strJsElem = isGecko ? \"object\" : isIE ? \"script\" : \"img\",\n strCssElem = isIE ? \"script\" : strJsElem,\n isArray = Array.isArray || function ( obj ) {\n return toString.call( obj ) == \"[object Array]\";\n },\n isObject = function ( obj ) {\n return Object(obj) === obj;\n },\n isString = function ( s ) {\n return typeof s == \"string\";\n },\n isFunction = function ( fn ) {\n return toString.call( fn ) == \"[object Function]\";\n },\n globalFilters = [],\n scriptCache = {},\n prefixes = {\n // key value pair timeout options\n timeout : function( resourceObj, prefix_parts ) {\n if ( prefix_parts.length ) {\n resourceObj['timeout'] = prefix_parts[ 0 ];\n }\n return resourceObj;\n }\n },\n handler,\n yepnope;\n\n /* Loader helper functions */\n function isFileReady ( readyState ) {\n // Check to see if any of the ways a file can be ready are available as properties on the file's element\n return ( ! readyState || readyState == \"loaded\" || readyState == \"complete\" || readyState == \"uninitialized\" );\n }\n\n\n // Takes a preloaded js obj (changes in different browsers) and injects it into the head\n // in the appropriate order\n function injectJs ( src, cb, attrs, timeout, /* internal use */ err, internal ) {\n var script = doc.createElement( \"script\" ),\n done, i;\n\n timeout = timeout || yepnope['errorTimeout'];\n\n script.src = src;\n\n // Add our extra attributes to the script element\n for ( i in attrs ) {\n script.setAttribute( i, attrs[ i ] );\n }\n\n cb = internal ? executeStack : ( cb || noop );\n\n // Bind to load events\n script.onreadystatechange = script.onload = function () {\n\n if ( ! done && isFileReady( script.readyState ) ) {\n\n // Set done to prevent this function from being called twice.\n done = 1;\n cb();\n\n // Handle memory leak in IE\n script.onload = script.onreadystatechange = null;\n }\n };\n\n // 404 Fallback\n sTimeout(function () {\n if ( ! done ) {\n done = 1;\n // Might as well pass in an error-state if we fire the 404 fallback\n cb(1);\n }\n }, timeout );\n\n // Inject script into to document\n // or immediately callback if we know there\n // was previously a timeout error\n err ? script.onload() : firstScript.parentNode.insertBefore( script, firstScript );\n }\n\n // Takes a preloaded css obj (changes in different browsers) and injects it into the head\n function injectCss ( href, cb, attrs, timeout, /* Internal use */ err, internal ) {\n\n // Create stylesheet link\n var link = doc.createElement( \"link\" ),\n done, i;\n\n timeout = timeout || yepnope['errorTimeout'];\n\n cb = internal ? executeStack : ( cb || noop );\n\n // Add attributes\n link.href = href;\n link.rel = \"stylesheet\";\n link.type = \"text/css\";\n\n // Add our extra attributes to the link element\n for ( i in attrs ) {\n link.setAttribute( i, attrs[ i ] );\n }\n\n if ( ! err ) {\n firstScript.parentNode.insertBefore( link, firstScript );\n sTimeout(cb, 0);\n }\n }\n\n function executeStack ( ) {\n // shift an element off of the stack\n var i = execStack.shift();\n started = 1;\n\n // if a is truthy and the first item in the stack has an src\n if ( i ) {\n // if it's a script, inject it into the head with no type attribute\n if ( i['t'] ) {\n // Inject after a timeout so FF has time to be a jerk about it and\n // not double load (ignore the cache)\n sTimeout( function () {\n (i['t'] == \"c\" ? yepnope['injectCss'] : yepnope['injectJs'])( i['s'], 0, i['a'], i['x'], i['e'], 1 );\n }, 0 );\n }\n // Otherwise, just call the function and potentially run the stack\n else {\n i();\n executeStack();\n }\n }\n else {\n // just reset out of recursive mode\n started = 0;\n }\n }\n\n function preloadFile ( elem, url, type, splicePoint, dontExec, attrObj, timeout ) {\n\n timeout = timeout || yepnope['errorTimeout'];\n\n // Create appropriate element for browser and type\n var preloadElem = doc.createElement( elem ),\n done = 0,\n firstFlag = 0,\n stackObject = {\n \"t\": type, // type\n \"s\": url, // src\n //r: 0, // ready\n \"e\": dontExec,// set to true if we don't want to reinject\n \"a\": attrObj,\n \"x\": timeout\n };\n\n // The first time (common-case)\n if ( scriptCache[ url ] === 1 ) {\n firstFlag = 1;\n scriptCache[ url ] = [];\n }\n\n function onload ( first ) {\n // If the script/css file is loaded\n if ( ! done && isFileReady( preloadElem.readyState ) ) {\n\n // Set done to prevent this function from being called twice.\n stackObject['r'] = done = 1;\n\n ! started && executeStack();\n\n // Handle memory leak in IE\n preloadElem.onload = preloadElem.onreadystatechange = null;\n if ( first ) {\n if ( elem != \"img\" ) {\n sTimeout(function(){ insBeforeObj.removeChild( preloadElem ) }, 50);\n }\n\n for ( var i in scriptCache[ url ] ) {\n if ( scriptCache[ url ].hasOwnProperty( i ) ) {\n scriptCache[ url ][ i ].onload();\n }\n }\n }\n }\n }\n\n\n // Setting url to data for objects or src for img/scripts\n if ( elem == \"object\" ) {\n preloadElem.data = url;\n } else {\n preloadElem.src = url;\n\n // Setting bogus script type to allow the script to be cached\n preloadElem.type = elem;\n }\n\n // Don't let it show up visually\n preloadElem.width = preloadElem.height = \"0\";\n\n // Attach handlers for all browsers\n preloadElem.onerror = preloadElem.onload = preloadElem.onreadystatechange = function(){\n onload.call(this, firstFlag);\n };\n // inject the element into the stack depending on if it's\n // in the middle of other scripts or not\n execStack.splice( splicePoint, 0, stackObject );\n\n // The only place these can't go is in the element, since objects won't load in there\n // so we have two options - insert before the head element (which is hard to assume) - or\n // insertBefore technically takes null/undefined as a second param and it will insert the element into\n // the parent last. We try the head, and it automatically falls back to undefined.\n if ( elem != \"img\" ) {\n // If it's the first time, or we've already loaded it all the way through\n if ( firstFlag || scriptCache[ url ] === 2 ) {\n insBeforeObj.insertBefore( preloadElem, isGeckoLTE18 ? null : firstScript );\n\n // If something fails, and onerror doesn't fire,\n // continue after a timeout.\n sTimeout( onload, timeout );\n }\n else {\n // instead of injecting, just hold on to it\n scriptCache[ url ].push( preloadElem );\n }\n }\n }\n\n function load ( resource, type, dontExec, attrObj, timeout ) {\n // If this method gets hit multiple times, we should flag\n // that the execution of other threads should halt.\n started = 0;\n\n // We'll do 'j' for js and 'c' for css, yay for unreadable minification tactics\n type = type || \"j\";\n if ( isString( resource ) ) {\n // if the resource passed in here is a string, preload the file\n preloadFile( type == \"c\" ? strCssElem : strJsElem, resource, type, this['i']++, dontExec, attrObj, timeout );\n } else {\n // Otherwise it's a callback function and we can splice it into the stack to run\n execStack.splice( this['i']++, 0, resource );\n execStack.length == 1 && executeStack();\n }\n\n // OMG is this jQueries? For chaining...\n return this;\n }\n\n // return the yepnope object with a fresh loader attached\n function getYepnope () {\n var y = yepnope;\n y['loader'] = {\n \"load\": load,\n \"i\" : 0\n };\n return y;\n }\n\n /* End loader helper functions */\n // Yepnope Function\n yepnope = function ( needs ) {\n\n var i,\n need,\n // start the chain as a plain instance\n chain = this['yepnope']['loader'];\n\n function satisfyPrefixes ( url ) {\n // split all prefixes out\n var parts = url.split( \"!\" ),\n gLen = globalFilters.length,\n origUrl = parts.pop(),\n pLen = parts.length,\n res = {\n \"url\" : origUrl,\n // keep this one static for callback variable consistency\n \"origUrl\" : origUrl,\n \"prefixes\" : parts\n },\n mFunc,\n j,\n prefix_parts;\n\n // loop through prefixes\n // if there are none, this automatically gets skipped\n for ( j = 0; j < pLen; j++ ) {\n prefix_parts = parts[ j ].split( '=' );\n mFunc = prefixes[ prefix_parts.shift() ];\n if ( mFunc ) {\n res = mFunc( res, prefix_parts );\n }\n }\n\n // Go through our global filters\n for ( j = 0; j < gLen; j++ ) {\n res = globalFilters[ j ]( res );\n }\n\n // return the final url\n return res;\n }\n\n function getExtension ( url ) {\n return url.split(\".\").pop().split(\"?\").shift();\n }\n\n function loadScriptOrStyle ( input, callback, chain, index, testResult ) {\n // run through our set of prefixes\n var resource = satisfyPrefixes( input ),\n autoCallback = resource['autoCallback'],\n extension = getExtension( resource['url'] );\n\n // if no object is returned or the url is empty/0 just exit the load\n if ( resource['bypass'] ) {\n return;\n }\n\n // Determine callback, if any\n if ( callback ) {\n callback = isFunction( callback ) ?\n callback :\n callback[ input ] ||\n callback[ index ] ||\n callback[ ( input.split( \"/\" ).pop().split( \"?\" )[ 0 ] ) ];\n }\n\n // if someone is overriding all normal functionality\n if ( resource['instead'] ) {\n return resource['instead']( input, callback, chain, index, testResult );\n }\n else {\n // Handle if we've already had this url and it's completed loaded already\n if ( scriptCache[ resource['url'] ] ) {\n // don't let this execute again\n resource['noexec'] = true;\n }\n else {\n scriptCache[ resource['url'] ] = 1;\n }\n\n // Throw this into the queue\n chain.load( resource['url'], ( ( resource['forceCSS'] || ( ! resource['forceJS'] && \"css\" == getExtension( resource['url'] ) ) ) ) ? \"c\" : undef, resource['noexec'], resource['attrs'], resource['timeout'] );\n\n // If we have a callback, we'll start the chain over\n if ( isFunction( callback ) || isFunction( autoCallback ) ) {\n // Call getJS with our current stack of things\n chain['load']( function () {\n // Hijack yepnope and restart index counter\n getYepnope();\n // Call our callbacks with this set of data\n callback && callback( resource['origUrl'], testResult, index );\n autoCallback && autoCallback( resource['origUrl'], testResult, index );\n\n // Override this to just a boolean positive\n scriptCache[ resource['url'] ] = 2;\n } );\n }\n }\n }\n\n function loadFromTestObject ( testObject, chain ) {\n var testResult = !! testObject['test'],\n group = testResult ? testObject['yep'] : testObject['nope'],\n always = testObject['load'] || testObject['both'],\n callback = testObject['callback'] || noop,\n cbRef = callback,\n complete = testObject['complete'] || noop,\n needGroupSize,\n callbackKey;\n\n // Reusable function for dealing with the different input types\n // NOTE:: relies on closures to keep 'chain' up to date, a bit confusing, but\n // much smaller than the functional equivalent in this case.\n function handleGroup ( needGroup, moreToCome ) {\n if ( ! needGroup ) {\n // Call the complete callback when there's nothing to load.\n ! moreToCome && complete();\n }\n // If it's a string\n else if ( isString( needGroup ) ) {\n // if it's a string, it's the last\n if ( !moreToCome ) {\n // Add in the complete callback to go at the end\n callback = function () {\n var args = [].slice.call( arguments );\n cbRef.apply( this, args );\n complete();\n };\n }\n // Just load the script of style\n loadScriptOrStyle( needGroup, callback, chain, 0, testResult );\n }\n // See if we have an object. Doesn't matter if it's an array or a key/val hash\n // Note:: order cannot be guaranteed on an key value object with multiple elements\n // since the for-in does not preserve order. Arrays _should_ go in order though.\n else if ( isObject( needGroup ) ) {\n // I hate this, but idk another way for objects.\n needGroupSize = (function(){\n var count = 0, i\n for (i in needGroup ) {\n if ( needGroup.hasOwnProperty( i ) ) {\n count++;\n }\n }\n return count;\n })();\n\n for ( callbackKey in needGroup ) {\n // Safari 2 does not have hasOwnProperty, but not worth the bytes for a shim\n // patch if needed. Kangax has a nice shim for it. Or just remove the check\n // and promise not to extend the object prototype.\n if ( needGroup.hasOwnProperty( callbackKey ) ) {\n // Find the last added resource, and append to it's callback.\n if ( ! moreToCome && ! ( --needGroupSize ) ) {\n // If this is an object full of callbacks\n if ( ! isFunction( callback ) ) {\n // Add in the complete callback to go at the end\n callback[ callbackKey ] = (function( innerCb ) {\n return function () {\n var args = [].slice.call( arguments );\n innerCb && innerCb.apply( this, args );\n complete();\n };\n })( cbRef[ callbackKey ] );\n }\n // If this is just a single callback\n else {\n callback = function () {\n var args = [].slice.call( arguments );\n cbRef.apply( this, args );\n complete();\n };\n }\n }\n loadScriptOrStyle( needGroup[ callbackKey ], callback, chain, callbackKey, testResult );\n }\n }\n }\n }\n\n // figure out what this group should do\n handleGroup( group, !!always );\n\n // Run our loader on the load/both group too\n // the always stuff always loads second.\n always && handleGroup( always );\n }\n\n // Someone just decides to load a single script or css file as a string\n if ( isString( needs ) ) {\n loadScriptOrStyle( needs, 0, chain, 0 );\n }\n // Normal case is likely an array of different types of loading options\n else if ( isArray( needs ) ) {\n // go through the list of needs\n for( i = 0; i < needs.length; i++ ) {\n need = needs[ i ];\n\n // if it's a string, just load it\n if ( isString( need ) ) {\n loadScriptOrStyle( need, 0, chain, 0 );\n }\n // if it's an array, call our function recursively\n else if ( isArray( need ) ) {\n yepnope( need );\n }\n // if it's an object, use our modernizr logic to win\n else if ( isObject( need ) ) {\n loadFromTestObject( need, chain );\n }\n }\n }\n // Allow a single object to be passed in\n else if ( isObject( needs ) ) {\n loadFromTestObject( needs, chain );\n }\n };\n\n // This publicly exposed function is for allowing\n // you to add functionality based on prefixes on the\n // string files you add. 'css!' is a builtin prefix\n //\n // The arguments are the prefix (not including the !) as a string\n // and\n // A callback function. This function is passed a resource object\n // that can be manipulated and then returned. (like middleware. har.)\n //\n // Examples of this can be seen in the officially supported ie prefix\n yepnope['addPrefix'] = function ( prefix, callback ) {\n prefixes[ prefix ] = callback;\n };\n\n // A filter is a global function that every resource\n // object that passes through yepnope will see. You can\n // of course conditionally choose to modify the resource objects\n // or just pass them along. The filter function takes the resource\n // object and is expected to return one.\n //\n // The best example of a filter is the 'autoprotocol' officially\n // supported filter\n yepnope['addFilter'] = function ( filter ) {\n globalFilters.push( filter );\n };\n\n // Default error timeout to 10sec - modify to alter\n yepnope['errorTimeout'] = 1e4;\n\n // Webreflection readystate hack\n // safe for jQuery 1.4+ ( i.e. don't use yepnope with jQuery 1.3.2 )\n // if the readyState is null and we have a listener\n if ( doc.readyState == null && doc.addEventListener ) {\n // set the ready state to loading\n doc.readyState = \"loading\";\n // call the listener\n doc.addEventListener( \"DOMContentLoaded\", handler = function () {\n // Remove the listener\n doc.removeEventListener( \"DOMContentLoaded\", handler, 0 );\n // Set it to ready\n doc.readyState = \"complete\";\n }, 0 );\n }\n\n // Attach loader &\n // Leak it\n window['yepnope'] = getYepnope();\n\n // Exposing executeStack to better facilitate plugins\n window['yepnope']['executeStack'] = executeStack;\n window['yepnope']['injectJs'] = injectJs;\n window['yepnope']['injectCss'] = injectCss;\n\n})( this, document );\n"]}