Browse files

Updating steal.production.js

  • Loading branch information...
1 parent fda08d6 commit 54b415874310d0e5a09832b2e19d7753d1fe35a7 Ralph Holzmann committed Aug 2, 2012
Showing with 28 additions and 28 deletions.
  1. +28 −28 steal.production.js
View
56 steal.production.js
@@ -1,32 +1,32 @@
(function(g,P){function v(a,b,c){return c?function(){return a.apply(this,b.apply(this,arguments))}:function(){b.apply(this,arguments);return a.apply(this,arguments)}}function u(a,b,c){return c?function(){return b.apply(this,[a.apply(this,arguments)].concat(q(arguments)))}:function(){var c=a.apply(this,arguments);b.apply(this,arguments);return c}}function d(){var a=q(arguments);a.length&&(n.push.apply(n,a),d.after(a));return d}function Q(a,b,c,e){r[b.shift()].require(a,function(){b.length?Q(a,b,c,
-e):c.apply(this,arguments)},e)}var k=g.document,R=k&&k.documentElement,h=function(a,b){var c,e;if("number"==typeof a.length){c=0;for(e=a.length;c<e;c++)b.call(a[c],c,a[c],a)}else for(c in a)b.call(a[c],c,a[c],a);return a},w=function(a){return"string"==typeof a},x=function(a){return"function"==typeof a},F=function(){},$=/\/$/,G=function(){var a=k.createElement("script");a.type="text/javascript";return a},y=function(){var a=k.getElementsByTagName("head")[0];a||(a=k.createElement("head"),R.insertBefore(a,
-R.firstChild));y=function(){return a};return a},l=function(a,b){b&&h(b,function(c){a[c]=b[c]});return a},q=function(a,b){var c=[];h(a,function(a,d){c.push(b?w(b)?d[b]:b.call(d,d):d)});return c},S=k&&function(){var a=G();a.onerror=F;return x(a.onerror)||"onerror"in a}(),z=!1;k&&G();var H=F,B="object"==typeof g.steal?g.steal:{},I=function(a){B.suffix&&(a=-1<(a+"").indexOf("?")?a+"&"+B.suffix:a+"?"+B.suffix);return a},m=function(a){if(!(this instanceof m))return new m;this.doneFuncs=[];this.failFuncs=
-[];this.resultArgs=null;this.status="";a&&a.call(this,this)};m.when=function(){var a=q(arguments);if(2>a.length){var b=a[0];return b&&x(b.isResolved)&&x(b.isRejected)?b:m().resolve(b)}var c=m(),e=0,d=[];h(a,function(b,f){f.done(function(){d[b]=2>arguments.length?arguments[0]:arguments;++e==a.length&&c.resolve.apply(c,d)}).fail(function(){c.reject(arguments)})});return c};var p=function(a,b){return function(c){var e=this.resultArgs=1<arguments.length?arguments[1]:[];return this.exec(c,this[a],e,b)}},
-T=function(a,b){return function(){var c=this;h(arguments,function(e,d,f){d&&(d.constructor===Array?f.callee.apply(c,d):(c.status===b&&d.apply(this,c.resultArgs||[]),c[a].push(d)))});return this}};l(m.prototype,{resolveWith:p("doneFuncs","rs"),rejectWith:p("failFuncs","rj"),done:T("doneFuncs","rs"),fail:T("failFuncs","rj"),always:function(){var a=q(arguments);a.length&&a[0]&&this.done(a[0]).fail(a[0]);return this},then:function(){var a=q(arguments);1<a.length&&a[1]&&this.fail(a[1]);a.length&&a[0]&&
-this.done(a[0]);return this},isResolved:function(){return"rs"===this.status},isRejected:function(){return"rj"===this.status},reject:function(){return this.rejectWith(this,arguments)},resolve:function(){return this.resolveWith(this,arguments)},exec:function(a,b,c,e){if(""!==this.status)return this;this.status=e;h(b,function(b,e){e.apply(a,c)});return this}});var U=function(a,b,c,e){a=q(a,b);return m.when.apply(m,a).then(function(){if(x(c[e]))c[e]();else c[e].resolve()})},f=function(a){if(this.constructor!==
+e):c.apply(this,arguments)},e)}var k=g.document,R=k&&k.documentElement,i=function(a,b){var c,e;if("number"==typeof a.length){c=0;for(e=a.length;c<e;c++)b.call(a[c],c,a[c],a)}else for(c in a)b.call(a[c],c,a[c],a);return a},w=function(a){return"string"==typeof a},x=function(a){return"function"==typeof a},F=function(){},$=/\/$/,G=function(){var a=k.createElement("script");a.type="text/javascript";return a},y=function(){var a=k.getElementsByTagName("head")[0];a||(a=k.createElement("head"),R.insertBefore(a,
+R.firstChild));y=function(){return a};return a},l=function(a,b){b&&i(b,function(c){a[c]=b[c]});return a},q=function(a,b){var c=[];i(a,function(a,d){c.push(b?w(b)?d[b]:b.call(d,d):d)});return c},S=k&&function(){var a=G();a.onerror=F;return x(a.onerror)||"onerror"in a}(),z=!1;k&&G();var H=F,B="object"==typeof g.steal?g.steal:{},I=function(a){B.suffix&&(a=-1<(a+"").indexOf("?")?a+"&"+B.suffix:a+"?"+B.suffix);return a},m=function(a){if(!(this instanceof m))return new m;this.doneFuncs=[];this.failFuncs=
+[];this.resultArgs=null;this.status="";a&&a.call(this,this)};m.when=function(){var a=q(arguments);if(2>a.length){var b=a[0];return b&&x(b.isResolved)&&x(b.isRejected)?b:m().resolve(b)}var c=m(),e=0,d=[];i(a,function(b,f){f.done(function(){d[b]=2>arguments.length?arguments[0]:arguments;++e==a.length&&c.resolve.apply(c,d)}).fail(function(){c.reject(arguments)})});return c};var p=function(a,b){return function(c){var e=this.resultArgs=1<arguments.length?arguments[1]:[];return this.exec(c,this[a],e,b)}},
+T=function(a,b){return function(){var c=this;i(arguments,function(e,d,f){d&&(d.constructor===Array?f.callee.apply(c,d):(c.status===b&&d.apply(this,c.resultArgs||[]),c[a].push(d)))});return this}};l(m.prototype,{resolveWith:p("doneFuncs","rs"),rejectWith:p("failFuncs","rj"),done:T("doneFuncs","rs"),fail:T("failFuncs","rj"),always:function(){var a=q(arguments);a.length&&a[0]&&this.done(a[0]).fail(a[0]);return this},then:function(){var a=q(arguments);1<a.length&&a[1]&&this.fail(a[1]);a.length&&a[0]&&
+this.done(a[0]);return this},isResolved:function(){return"rs"===this.status},isRejected:function(){return"rj"===this.status},reject:function(){return this.rejectWith(this,arguments)},resolve:function(){return this.resolveWith(this,arguments)},exec:function(a,b,c,e){if(""!==this.status)return this;this.status=e;i(b,function(b,e){e.apply(a,c)});return this}});var U=function(a,b,c,e){a=q(a,b);return m.when.apply(m,a).then(function(){if(x(c[e]))c[e]();else c[e].resolve()})},f=function(a){if(this.constructor!==
f)return new f(a);l(this,f.parse(""+a))};l(f,{parse:function(a){var b=a.split("?"),a=b.shift(),b=b.join("").split("#"),a=a.split("://"),b={query:b.shift(),fragment:b.join("#")};a[1]?(b.protocol=a.shift(),a=a[0].split("/"),b.host=a.shift(),b.path="/"+a.join("/")):b.path=a[0];return b}});f.page=f(g.location&&location.href);f.cur=f();l(f.prototype,{dir:function(){var a=this.path.split("/");a.pop();return f(this.domain()+a.join("/"))},filename:function(){return this.path.split("/").pop()},ext:function(){var a=
this.filename();return~a.indexOf(".")?a.split(".").pop():""},domain:function(){return this.protocol?this.protocol+"://"+this.host:""},isCrossDomain:function(a){var a=f(a||g.location.href),b=this.domain(),a=a.domain();return b&&a&&b!=a||"file"===this.protocol||b&&!a},isRelativeToDomain:function(){return!this.path.indexOf("/")},hash:function(){return this.fragment?"#"+this.fragment:""},search:function(){return this.query?"?"+this.query:""},add:function(a){return this.join(a)+""},join:function(a){a=
f(a);if(a.isCrossDomain(this))return a;if(a.isRelativeToDomain())return f(this.domain()+a);var b=this.path?this.path.split("/"):[],c=a.path.split("/"),e=c[0];for(this.path.match(/\/$/)&&b.pop();".."==e&&b.length&&b.pop();)c.shift(),e=c[0];return l(f(this.domain()+b.concat(c).join("/")),{query:a.query})},normalize:function(a){var a=a?a.dir():f.cur.dir(),b=this.path,c=f(b);b.indexOf("//")?b.indexOf("./")?this.isRelative()&&(c=a.join(this.domain()+b)):c=a.join(b.substr(2)):c=f(b.substr(2));c.query=this.query;
-return c},isRelative:function(){return/^[\.|\/]/.test(this.path)},pathTo:function(a){for(var a=f(a),a=a.path.split("/"),b=this.path.split("/"),c=[];a.length&&b.length&&a[0]==b[0];)a.shift(),b.shift();h(b,function(){c.push("../")});return f(c.join("")+a.join("/"))},mapJoin:function(a){return this.join(f(a).insertMapping())},addJS:function(){this.ext()||(this.isRelative()||(this.path+="/"+this.filename()),this.path+=".js");return this}});d._id=Math.floor(1E3*Math.random());var j={types:{},ext:{},env:"development",
-loadProduction:!0,logLevel:0};d.config=function(a){for(var b in a){var c=a[b];d.config[b]?d.config[b](c):"object"==typeof c&&j[b]?l(j[b],c):j[b]=c}h(o,function(a,b){if("fn"!=b.options.type){var c=b.options.buildType;b.setOptions(b.orig);var d=b.options.id;a!==d&&(o[d]=b);b.options.buildType=c}});return j};d.config.startFile=function(a){j.startFile=""+f(a).addJS();j.production||(j.production=f(j.startFile).dir()+"/production.js")};d.config.root=function(a){if(a!==P){var b=f(a),c=f.page,a=c.join(a);
-f.cur=a.pathTo(c);j.root=b}else j.root=b||f("")};d.config.root("");d.id=function(a,b,c){var e=f(a),e=e.addJS().normalize(b?new f(b):null);c||(c="js");h(j.map||{},function(a,c){var d;if("*"===a||0===b.indexOf(a))d=!0;d&&h(c,function(a,b){0==(""+e).indexOf(a)&&(e=f((""+e).replace(a,b)))})});return e};d.idToUri=function(a,b){var c;h(j.paths||{},function(b,d){c=""+a;if($.test(b)&&0==c.indexOf(b)||c===b)a=f(c.replace(b,d))});return b?a:j.root.join(a)};f.prototype.toString=function(){return this.domain()+
-this.path+this.search()+this.hash()};d.File=d.URI=f;var n=[],aa=0;l(d,{each:h,extend:l,Deferred:m,isRhino:g.load&&g.readUrl&&g.readFile,options:{env:"development",loadProduction:!0,needs:{less:"steal/less/less.js",coffee:"steal/coffee/coffee.js"},logLevel:0},makeOptions:function(a,b){if(!a.id)throw{message:"no id",options:a};a.id=d.id(a.id,b);a.ext=a.id.ext();var c=j.ext[a.ext];c&&!j.types[c]&&(a.needs||(a.needs=[]),a.needs.push(c));return a},then:function(){var a=q(arguments);"string"===typeof a[0]&&
-(a[0]={id:a[0]});"object"===typeof a[0]&&(a[0].waits=!0);return d.apply(g,a)},bind:function(a,b){A[a]||(A[a]=[]);var c=d.events[a];c&&c.add&&(b=c.add(b));b&&A[a].push(b);return d},one:function(a,b){return d.bind(a,function(){b.apply(this,arguments);d.unbind(a,arguments.callee)})},events:{},unbind:function(a,b){for(var c=A[a]||[],e=0;e<c.length;)b===c[e]?c.splice(e,1):e++},trigger:function(a,b){h(q(A[a]||[]),function(a,e){e(b)})},has:function(){z=!1;h(arguments,function(a,b){var c=i.make(b);c.loading=
-c.executing=!0})},preexecuted:function(){},executed:function(a){a=i.make(a);a.loading=a.executing=!0;d.preexecuted(a);a.executed();return d},type:function(a,b){var c=a.split(" ");if(!b)return r[c.shift()].require;r[c.shift()]={require:b,convert:c}}});var o={},i=function(a){this.dependencies=[];this.id=++aa;this.orig=a;this.curId=d.cur&&d.cur.options.id;this.setOptions(a);this.loaded=m();this.run=m();this.completed=m()};i.make=function(a){var b=new i(a),c=b.options.id;b.unique&&c&&(!o[c]&&!o[c+".js"]?
-o[c]=b:(b=o[c],w(a)||(h(["id"],function(b,c){delete a[c]}),l(b.options,a))));return b};i.update=function(){for(var a in o)o[o].loaded.isResolved()};l(i.prototype,{setOptions:function(a){if(a)if(x(a)){var b=f.cur,c=this,e=d.cur;this.options={fn:function(){f.cur=b;var d=[],g=!1;e.dependencies.slice(0).reverse();for(var h,j,i=e.dependencies.length;0<=i;i--){h=e.dependencies[i];if(g&&(j=J[h.options.id]||J[h.orig]||h.value,d.unshift(j),h.waits&&e.orig===P))break;h===c&&(g=!0)}if(d=a.apply(e,d))e.value=
-d;return d},id:b,type:"fn"};this.waits=!0;this.unique=!1}else this.options=d.makeOptions(l({},w(a)?{id:a}:a),this.curId),this.waits=this.options.waits||!1,this.unique=!0;else this.options={},this.waits=!1},complete:function(){this.completed.resolve()},executed:function(a){var b,a=a&&a.src||this.options.src;this.options.id&&(f.cur=f(this.options.id));d.cur=this;this.run.resolve();z&&a&&(b=t[a]);b||(b=n.slice(0),n=[]);if(b.length){var c=this,e="production"==j.env,g=[];h(b.reverse(),function(a,b){if(!e||
-!b.ignore){var c=i.make(b);if(K[c.options.id]&&c.options.type!=="fn"){d.has(""+c.options.id);c=i.make(K[""+c.options.id])}g.push(c);h(c.options.needs||[],function(a,b){g.push(i.make(function(){}),i.make(b))})}});var s=[],k=[],l=[],m=!0;h(g.reverse(),function(a,b){c.dependencies.push(b);if(b.waits&&k.length){s=s.concat(k);k=[];m=false}U(s,"completed",b,"execute");b.waitedOn=b.waitedOn?b.waitedOn.concat(s):s.slice(0);k.push(b);m&&l.push(b);b.load()});s=s.concat(k);U(s,"completed",c,"completed");h(l,
-function(a,b){b.execute()})}else this.complete()},load:function(){!this.loading&&!this.loaded.isResolved()&&(this.loading=!0,this.loaded.resolve())},execute:function(){var a=this;a.loaded.isResolved()||a.loaded.resolve();a.executing||(a.executing=!0,d.require(a.options,function(b){a.executed(b)},function(){var b=a.options.abort,c=a.options.error;c&&c.call(a.options);g.clearTimeout&&g.clearTimeout(a.completeTimeout);if(!1===b)a.executed();else throw"steal.js : "+a.options.src+" not completed";}))}});
-var A={},r=j.types;d.config.types=function(a){h(a,d.type)};i.prototype.execute=v(i.prototype.execute,function(){var a=this.options;if(!a.type){var b=f(a.id).ext();!b&&!r[b]&&(b="js");a.type=b}if(!r[a.type]&&"development"==j.env)throw"steal.js - type "+a.type+" has not been loaded.";if(r[a.type]||"production"!=j.env)b=r[a.type].convert,a.buildType=b.length?b[b.length-1]:a.type});d.require=function(a,b,c){a.src=d.idToUri(a.id);var e=r[a.type];e.convert.length?(e=e.convert.slice(0),e.unshift("text",
-a.type)):e=[a.type];Q(a,e,b,c)};var ba=function(a){a.onreadystatechange=a.onload=a.onerror=null;setTimeout(function(){y().removeChild(a)},1)},C,ca=/^loade|c|u/,L=0,da=k&&k.createStyleSheet,V,W;d.config({types:{js:function(a,b,c){var e=G(),d=function(){if(!e.readyState||ca.test(e.readyState))ba(e),b(e)};if(a.text)e.text=a.text;else{e.onload=e.onreadystatechange=d;var f=a.src;S&&c&&"file"!==f.protocol&&(e.onerror=c);e.src=""+f;e.onSuccess=b}C=e;y().insertBefore(e,y().firstChild);a.text&&d()},fn:function(a,
-b){var c;a.skipCallbacks||(c=a.fn());b(c)},text:function(a,b,c){d.request(a,function(c){a.text=c;b(c)},c)},css:function(a,b){if(a.text){var c=k.createElement("style");c.type="text/css";if(c.styleSheet)c.styleSheet.cssText=a.text;else{var e=k.createTextNode(a.text);c.childNodes.length?c.firstChild.nodeValue!==e.nodeValue&&c.replaceChild(e,c.firstChild):c.appendChild(e)}}else{if(da){L++?(c=""+f(f(W.src).dir()).pathTo(a.src),V.addImport(I(c)),30==L&&(L=0)):(V=k.createStyleSheet(I(a.src)),W=a);b();return}a=
-a||{};c=k.createElement("link");c.rel=a.rel||"stylesheet";c.href=I(a.src);c.type="text/css"}y().appendChild(c);b()}}});var ea=function(){return g.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest};d.request=function(a,b,c){var e=new ea,d=a.contentType||"application/x-www-form-urlencoded; charset=utf-8",f=function(){e=g=f=null},g=function(){var a;e&&4===e.readyState&&(a=e.status,500===a||404===a||2===a||0>e.status||!a&&""===e.responseText?c&&c(e.status):b(e.responseText),f())};
-e.open("GET",a.src+"",!1!==a.async);e.setRequestHeader("Content-type",d);e.overrideMimeType&&e.overrideMimeType(d);e.onreadystatechange=g;try{e.send(null)}catch(h){f&&(console.error(h),c&&c(),f())}};var M=[],K={};d.packages=function(a){return arguments.length?("string"==typeof a?M.push.apply(M,arguments):K=a,this):M};f.prototype.insertMapping=function(){var a=""+this,b,c;for(b in d.mappings)if(c=d.mappings[b],c.test.test(a))return a.replace(b,c.path);return f(a)};var N=!1;l(d,{mappings:{},map:function(a,
-b){w(a)?(d.mappings[a]={test:RegExp("^(/?"+a+")([/.]|$)"),path:b},h(o,function(a,b){if("fn"!=b.options.type){var d=b.options.buildType;b.setOptions(b.orig);b.options.buildType=d}})):h(a,d.map);return this},after:function(){if(!N){var a=N=new i,b=function(){d.trigger("start",a);a.completed.then(function(){N=null;d.trigger("end",a)});a.executed()};if(g.setTimeout){var c=n.slice(0);n=[];setTimeout(function(){"string"===typeof n[0]&&(n[0]={id:n[0]});"object"===typeof n[0]&&(n[0].waits=!0);n.unshift.apply(n,
-c);b()},0)}else b()}},_before:v,_after:u});(function(){var a=!1,b,c=!1;i.prototype.executed=v(i.prototype.executed,function(){var c=g.jQuery;c&&"readyWait"in c&&!a&&(b=c,c.readyWait+=1,a=!0)});d.bind("end",function(){a&&!c&&(b.ready(!0),c=!0)})})();l(i.prototype,{load:u(i.prototype.load,function(){var a=this;if(k&&!a.completed&&!a.completeTimeout&&!d.isRhino&&("file"==a.options.src.protocol||!S))a.completeTimeout=setTimeout(function(){throw"steal.js : "+a.options.src+" not completed";},5E3)}),complete:u(i.prototype.complete,
-function(){this.completeTimeout&&clearTimeout(this.completeTimeout)}),executed:v(i.prototype.executed,function(){this.options.has&&this.loadHas()}),loadHas:function(){var a=f.cur;"js"!=this.options.buildType&&h(this.options.has,function(b,c){f.cur=f(a);d.executed(c)})}});i.make=u(i.make,function(a){a.options.has&&(a.run.isResolved()?a.loadHas():d.has.apply(d,a.options.has));return a},!0);var X=m(),O=m(),D=!1;(function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+
-b,c):c()})(g,"load",function(){X.resolve()});d.one("end",function(a){O.resolve(a);D=a;d.trigger("done",D)});d.firstComplete=O;m.when(X,O).then(function(){d.trigger("ready");d.isReady=!0});d.events.done={add:function(a){return D?(a(D),!1):a}};var E,t={},Y=function(){for(var a=k.getElementsByTagName("script"),b=a.length;b--;)if("interactive"===a[b].readyState)return a[b]},Z=function(){return E&&"interactive"===E.readyState||(E=Y())?E:C&&"interactive"==C.readyState?C:null};if(z=k&&!!Y())d.after=u(d.after,
-function(){if(z){var a=Z();a&&a.src&&!/steal\.(production|production\.[a-zA-Z0-9\-\.\_]*)*js/.test(a.src)&&(a=a.src,t[a]||(t[a]=[]),a&&(t[a].push.apply(t[a],n),n=[]))}}),d.preexecuted=v(d.preexecuted,function(a){if(z){var a=a.options.src,b=Z().src;t[a]=t[b];t[b]=null}});var fa=/steal\.(production\.)?js.*/,ga=function(){if(k){var a=k.getElementsByTagName("script"),b;h(a,function(a,d){fa.test(d.src)&&(b=d)});return b}};d.getScriptOptions=function(a){var b={},c,d;if(a=a||ga()){c=a.src.split("?");a=c.shift();
-c=c.join("?");c=c.split(",");-1<a.indexOf("steal.production")&&(b.env="production");if(d=c[0])-1==d.indexOf(".js")&&(d+="/"+d.split("/").pop()+".js"),b.startFile=d;if(c=c[1])b.env=c;c=a.split("/");c.pop();"steal"==c[c.length-1]&&c.pop();b.root=c.join("/")}return b};var H=u(H,function(){var a={};l(a,d.getScriptOptions());l(a,B);var b=g.location&&decodeURIComponent(g.location.search);b&&b.replace(/steal\[([^\]]+)\]=([^&]+)/g,function(b,c,d){a[c]=~d.indexOf(",")?d.split(","):d});d.config(a);h(a.executed||
-[],function(a,b){d.executed(b)});b=[];a.startFiles&&(b.push.apply(b,w(a.startFiles)?[{id:a.startFiles,waits:!0}]:a.startFiles),a.startFiles=b.slice(0));try{!a.browser&&(g.top&&g.top.steal.instrument||g.top&&g.top.opener&&g.top.opener.steal&&g.top.opener.steal.instrument)&&b.push(F,{id:"steal/instrument",waits:!0})}catch(c){}"production"==j.env&&j.loadProduction&&j.production?d({id:j.production,force:!0}):(b.unshift("stealconfig.js"),!1!==a.loadDev&&b.unshift({id:"steal/dev/dev.js",ignore:!0}),a.startFile&&
-b.push({id:a.startFile,waits:!0}));b.length&&d.apply(g,b)}),J={};g.define=function(a,b,c){b&&c&&!b.length&&(J[a]=c())};g.define.amd={jQuery:!0};g.steal=d;define("steal",[],function(){return d});p=new i("steal");p.value=d;p.loaded.resolve();p.run.resolve();p.executing=!0;p.completed.resolve();o[p.options.id]=p;H();g.steal.resources=o;g.Resource=i})(this);
+return c},isRelative:function(){return/^[\.|\/]/.test(this.path)},pathTo:function(a){for(var a=f(a),a=a.path.split("/"),b=this.path.split("/"),c=[];a.length&&b.length&&a[0]==b[0];)a.shift(),b.shift();i(b,function(){c.push("../")});return f(c.join("")+a.join("/"))},mapJoin:function(a){return this.join(f(a).insertMapping())},addJS:function(){this.ext()||(this.isRelative()||(this.path+="/"+this.filename()),this.path+=".js");return this}});d._id=Math.floor(1E3*Math.random());var h={types:{},ext:{},env:"development",
+loadProduction:!0,logLevel:0};d.config=function(a){if(!a)return h;if(1===arguments.length&&"string"===typeof a)return h[a];for(var b in a){var c=a[b];d.config[b]?d.config[b](c):"object"==typeof c&&h[b]?l(h[b],c):h[b]=c}i(o,function(a,b){if("fn"!=b.options.type){var c=b.options.buildType;b.setOptions(b.orig);var d=b.options.id;a!==d&&(o[d]=b);b.options.buildType=c}});return h};d.config.startFile=function(a){h.startFile=""+f(a).addJS();h.production||(h.production=f(h.startFile).dir()+"/production.js")};
+d.config.root=function(a){if(a!==P){var b=f(a),c=f.page,a=c.join(a);f.cur=a.pathTo(c);h.root=b}else h.root=b||f("")};d.config.root("");d.id=function(a,b,c){var e=f(a),e=e.addJS().normalize(b?new f(b):null);c||(c="js");i(h.map||{},function(a,c){var d;"*"===a?d=!0:0===b.indexOf(a)&&(d=!0);d&&i(c,function(a,b){0==(""+e).indexOf(a)&&(e=f((""+e).replace(a,b)))})});return e};d.idToUri=function(a,b){var c;i(h.paths||{},function(b,d){c=""+a;if($.test(b)&&0==c.indexOf(b)||c===b)a=f(c.replace(b,d))});return b?
+a:h.root.join(a)};f.prototype.toString=function(){return this.domain()+this.path+this.search()+this.hash()};d.File=d.URI=f;var n=[],aa=0;l(d,{each:i,extend:l,Deferred:m,isRhino:g.load&&g.readUrl&&g.readFile,options:{env:"development",loadProduction:!0,needs:{less:"steal/less/less.js",coffee:"steal/coffee/coffee.js"},logLevel:0},makeOptions:function(a,b){if(!a.id)throw{message:"no id",options:a};a.id=d.id(a.id,b);a.ext=a.id.ext();var c=h.ext[a.ext];c&&!h.types[c]&&(a.needs||(a.needs=[]),a.needs.push(c));
+return a},then:function(){var a=q(arguments);"string"===typeof a[0]&&(a[0]={id:a[0]});"object"===typeof a[0]&&(a[0].waits=!0);return d.apply(g,a)},bind:function(a,b){A[a]||(A[a]=[]);var c=d.events[a];c&&c.add&&(b=c.add(b));b&&A[a].push(b);return d},one:function(a,b){return d.bind(a,function(){b.apply(this,arguments);d.unbind(a,arguments.callee)})},events:{},unbind:function(a,b){for(var c=A[a]||[],e=0;e<c.length;)b===c[e]?c.splice(e,1):e++},trigger:function(a,b){i(q(A[a]||[]),function(a,e){e(b)})},
+has:function(){z=!1;i(arguments,function(a,b){var c=j.make(b);c.loading=c.executing=!0})},preexecuted:function(){},executed:function(a){a=j.make(a);a.loading=a.executing=!0;d.preexecuted(a);a.executed();return d},type:function(a,b){var c=a.split(" ");if(!b)return r[c.shift()].require;r[c.shift()]={require:b,convert:c}}});var o={},j=function(a){this.dependencies=[];this.id=++aa;this.orig=a;this.curId=d.cur&&d.cur.options.id;this.setOptions(a);this.loaded=m();this.run=m();this.completed=m()};j.make=
+function(a){var b=new j(a),c=b.options.id;b.unique&&c&&(!o[c]&&!o[c+".js"]?o[c]=b:(b=o[c],w(a)||(i(["id"],function(b,c){delete a[c]}),l(b.options,a))));return b};j.update=function(){for(var a in o)o[o].loaded.isResolved()};l(j.prototype,{setOptions:function(a){var b=this.options;if(a)if(x(a)){var c=f.cur,e=this,g=d.cur;this.options={fn:function(){f.cur=c;var b=[],d=!1;g.dependencies.slice(0).reverse();for(var h,i,j=g.dependencies.length;0<=j;j--){h=g.dependencies[j];if(d&&(i=J[h.options.id]||J[h.orig]||
+h.value,b.unshift(i),h.waits&&g.orig===P))break;h===e&&(d=!0)}if(b=a.apply(g,b))g.value=b;return b},id:c,type:"fn"};this.waits=!0;this.unique=!1}else this.options=d.makeOptions(l({},w(a)?{id:a}:a),this.curId),this.waits=this.options.waits||!1,this.unique=!0;else this.options={},this.waits=!1;for(opt in b)this.options[opt]||(this.options[opt]=b[opt])},complete:function(){this.completed.resolve()},executed:function(a){var b,a=a&&a.src||this.options.src;this.options.id&&(f.cur=f(this.options.id));d.cur=
+this;this.run.resolve();z&&a&&(b=t[a]);b||(b=n.slice(0),n=[]);if(b.length){var c=this,e="production"==h.env,g=[];i(b.reverse(),function(a,b){if(!e||!b.ignore){var c=j.make(b);if(K[c.options.id]&&c.options.type!=="fn"){d.has(""+c.options.id);c=j.make(K[""+c.options.id])}g.push(c);i(c.options.needs||[],function(a,b){g.push(j.make(function(){}),j.make(b))})}});var s=[],k=[],l=[],m=!0;i(g.reverse(),function(a,b){c.dependencies.push(b);if(b.waits&&k.length){s=s.concat(k);k=[];m=false}U(s,"completed",b,
+"execute");b.waitedOn=b.waitedOn?b.waitedOn.concat(s):s.slice(0);k.push(b);m&&l.push(b);b.load()});s=s.concat(k);U(s,"completed",c,"completed");i(l,function(a,b){b.execute()})}else this.complete()},load:function(){!this.loading&&!this.loaded.isResolved()&&(this.loading=!0,this.loaded.resolve())},execute:function(){var a=this;a.loaded.isResolved()||a.loaded.resolve();a.executing||(a.executing=!0,d.require(a.options,function(b){a.executed(b)},function(){var b=a.options.abort,c=a.options.error;c&&c.call(a.options);
+g.clearTimeout&&g.clearTimeout(a.completeTimeout);if(!1===b)a.executed();else throw"steal.js : "+a.options.src+" not completed";}))}});var A={},r=h.types;d.config.types=function(a){i(a,d.type)};j.prototype.execute=v(j.prototype.execute,function(){var a=this.options;if(!a.type){var b=f(a.id).ext();!b&&!r[b]&&(b="js");a.type=b}if(!r[a.type]&&"development"==h.env)throw"steal.js - type "+a.type+" has not been loaded.";if(r[a.type]||"production"!=h.env)b=r[a.type].convert,a.buildType=b.length?b[b.length-
+1]:a.type});d.require=function(a,b,c){a.src=d.idToUri(a.id);var e=r[a.type];e.convert.length?(e=e.convert.slice(0),e.unshift("text",a.type)):e=[a.type];Q(a,e,b,c)};var ba=function(a){a.onreadystatechange=a.onload=a.onerror=null;setTimeout(function(){y().removeChild(a)},1)},C,ca=/^loade|c|u/,L=0,da=k&&k.createStyleSheet,V,W;d.config({types:{js:function(a,b,c){var e=G(),d=function(){if(!e.readyState||ca.test(e.readyState))ba(e),b(e)};if(a.text)e.text=a.text;else{e.onload=e.onreadystatechange=d;var f=
+a.src;S&&(c&&"file"!==f.protocol)&&(e.onerror=c);e.src=""+f;e.onSuccess=b}C=e;y().insertBefore(e,y().firstChild);a.text&&d()},fn:function(a,b){var c;a.skipCallbacks||(c=a.fn());b(c)},text:function(a,b,c){d.request(a,function(c){a.text=c;b(c)},c)},css:function(a,b){if(a.text){var c=k.createElement("style");c.type="text/css";if(c.styleSheet)c.styleSheet.cssText=a.text;else{var e=k.createTextNode(a.text);c.childNodes.length?c.firstChild.nodeValue!==e.nodeValue&&c.replaceChild(e,c.firstChild):c.appendChild(e)}}else{if(da){L++?
+(c=""+f(f(W.src).dir()).pathTo(a.src),V.addImport(I(c)),30==L&&(L=0)):(V=k.createStyleSheet(I(a.src)),W=a);b();return}a=a||{};c=k.createElement("link");c.rel=a.rel||"stylesheet";c.href=I(a.src);c.type="text/css"}y().appendChild(c);b()}}});var ea=function(){return g.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest};d.request=function(a,b,c){var e=new ea,d=a.contentType||"application/x-www-form-urlencoded; charset=utf-8",f=function(){e=g=f=null},g=function(){var a;e&&4===e.readyState&&
+(a=e.status,500===a||404===a||2===a||0>e.status||!a&&""===e.responseText?c&&c(e.status):b(e.responseText),f())};e.open("GET",a.src+"",!1!==a.async);e.setRequestHeader("Content-type",d);e.overrideMimeType&&e.overrideMimeType(d);e.onreadystatechange=g;try{e.send(null)}catch(h){f&&(console.error(h),c&&c(),f())}};var M=[],K={};d.packages=function(a){return arguments.length?("string"==typeof a?M.push.apply(M,arguments):K=a,this):M};f.prototype.insertMapping=function(){var a=""+this,b,c;for(b in d.mappings)if(c=
+d.mappings[b],c.test.test(a))return a.replace(b,c.path);return f(a)};var N=!1;l(d,{mappings:{},map:function(a,b){w(a)?(d.mappings[a]={test:RegExp("^(/?"+a+")([/.]|$)"),path:b},i(o,function(a,b){if("fn"!=b.options.type){var d=b.options.buildType;b.setOptions(b.orig);b.options.buildType=d}})):i(a,d.map);return this},after:function(){if(!N){var a=N=new j,b=function(){d.trigger("start",a);a.completed.then(function(){N=null;d.trigger("end",a)});a.executed()};if(g.setTimeout){var c=n.slice(0);n=[];setTimeout(function(){"string"===
+typeof n[0]&&(n[0]={id:n[0]});"object"===typeof n[0]&&(n[0].waits=!0);n.unshift.apply(n,c);b()},0)}else b()}},_before:v,_after:u});(function(){var a=!1,b,c=!1;j.prototype.executed=v(j.prototype.executed,function(){var c=g.jQuery;c&&"readyWait"in c&&!a&&(b=c,c.readyWait+=1,a=!0)});d.bind("end",function(){a&&!c&&(b.ready(!0),c=!0)})})();l(j.prototype,{load:u(j.prototype.load,function(){var a=this;if(k&&!a.completed&&!a.completeTimeout&&!d.isRhino&&("file"==a.options.src.protocol||!S))a.completeTimeout=
+setTimeout(function(){throw"steal.js : "+a.options.src+" not completed";},5E3)}),complete:u(j.prototype.complete,function(){this.completeTimeout&&clearTimeout(this.completeTimeout)}),executed:v(j.prototype.executed,function(){this.options.has&&this.loadHas()}),loadHas:function(){var a=f.cur;"js"!=this.options.buildType&&i(this.options.has,function(b,c){f.cur=f(a);d.executed(c)})}});j.make=u(j.make,function(a){a.options.has&&(a.run.isResolved()?a.loadHas():d.has.apply(d,a.options.has));return a},!0);
+var X=m(),O=m(),D=!1;(function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):c()})(g,"load",function(){X.resolve()});d.one("end",function(a){O.resolve(a);D=a;d.trigger("done",D)});d.firstComplete=O;m.when(X,O).then(function(){d.trigger("ready");d.isReady=!0});d.events.done={add:function(a){return D?(a(D),!1):a}};var E,t={},Y=function(){for(var a=k.getElementsByTagName("script"),b=a.length;b--;)if("interactive"===a[b].readyState)return a[b]},Z=function(){return E&&
+"interactive"===E.readyState||(E=Y())?E:C&&"interactive"==C.readyState?C:null};if(z=k&&!!Y())d.after=u(d.after,function(){if(z){var a=Z();a&&(a.src&&!/steal\.(production|production\.[a-zA-Z0-9\-\.\_]*)*js/.test(a.src))&&(a=a.src,t[a]||(t[a]=[]),a&&(t[a].push.apply(t[a],n),n=[]))}}),d.preexecuted=v(d.preexecuted,function(a){if(z){var a=a.options.src,b=Z().src;t[a]=t[b];t[b]=null}});var fa=/steal\.(production\.)?js.*/,ga=function(){if(k){var a=k.getElementsByTagName("script"),b;i(a,function(a,d){fa.test(d.src)&&
+(b=d)});return b}};d.getScriptOptions=function(a){var b={},c,d;if(a=a||ga()){c=a.src.split("?");a=c.shift();c=c.join("?");c=c.split(",");-1<a.indexOf("steal.production")&&(b.env="production");if(d=c[0])-1==d.indexOf(".js")&&(d+="/"+d.split("/").pop()+".js"),b.startFile=d;if(c=c[1])b.env=c;c=a.split("/");c.pop();"steal"==c[c.length-1]&&c.pop();b.root=c.join("/")}return b};var H=u(H,function(){var a={};l(a,d.getScriptOptions());l(a,B);var b=g.location&&decodeURIComponent(g.location.search);b&&b.replace(/steal\[([^\]]+)\]=([^&]+)/g,
+function(b,c,d){a[c]=~d.indexOf(",")?d.split(","):d});d.config(a);i(a.executed||[],function(a,b){d.executed(b)});b=[];a.startFiles&&(b.push.apply(b,w(a.startFiles)?[{id:a.startFiles,waits:!0}]:a.startFiles),a.startFiles=b.slice(0));try{!a.browser&&(g.top&&g.top.steal.instrument||g.top&&g.top.opener&&g.top.opener.steal&&g.top.opener.steal.instrument)&&b.push(F,{id:"steal/instrument",waits:!0})}catch(c){}"production"==h.env&&h.loadProduction&&h.production?d({id:h.production,force:!0}):(b.unshift("stealconfig.js"),
+!1!==a.loadDev&&b.unshift({id:"steal/dev/dev.js",ignore:!0}),a.startFile&&b.push({id:a.startFile,waits:!0}));b.length&&d.apply(g,b)}),J={};g.define=function(a,b,c){b&&(c&&!b.length)&&(J[a]=c())};g.define.amd={jQuery:!0};g.steal=d;define("steal",[],function(){return d});p=new j("steal");p.value=d;p.loaded.resolve();p.run.resolve();p.executing=!0;p.completed.resolve();o[p.options.id]=p;H();g.steal.resources=o;g.Resource=j})(this);

0 comments on commit 54b4158

Please sign in to comment.