forked from dexteryy/OzJS
-
Notifications
You must be signed in to change notification settings - Fork 2
/
oz.min.js
11 lines (11 loc) · 5.42 KB
/
oz.min.js
1
2
3
4
5
6
7
8
9
10
11
(function(){function p(a,b,c){var d="string"===typeof c;c||(b?"[object Array]"===E.call(b)?c=x(k(s(a))):(c=b,b=null):(c=a,a=""),"string"!==typeof a?(b=a,a=""):(d="string"===typeof c,!d&&!b&&(b=y(c))));var e=(a=a&&k(a))&&g.mods[a];if(g.debug||!e||!e.name||!(d&&2==e.loaded||e.exports)){d&&g.enable_ozma&&(b=null);d=t(this)?this:l;e=g.mods[a]={name:a,url:e&&e.url,host:d,deps:b||[]};""===a&&(z=e);if("string"!==typeof c)e.block=c,e.loaded=2;else{var f=g.aliases;f&&(c=c.replace(/\{(\w+)\}/g,function(a,b){return f[b]||
""}));e.url=c}e.block&&!A(e.block)&&(e.exports=c)}}function m(a,b,c){if("string"===typeof a){if(!b)return(g.mods[k(s(a,q))]||{}).exports;a=[a]}else b||(b=a,a=y(b));var d=t(this)?this:l;c||(c={url:q&&q.url});for(var e,f=0,h=F.call(d,a,c),i=0,r=h.length;i<r;i++)e=h[i],e.is_reset&&(e=g.mods[e.name]),e.url&&2!==e.loaded&&(f++,e.loaded=1,u(e,function(){this.loaded=2;var e=z;e&&(e.name=this.name,e.url=this.url,g.mods[this.name]=e,z=null);0>=--f&&m.call(d,a,b,c)}));f||(c.deps=a,c.host=d,c.block=b,setTimeout(function(){G(a,
c);h.push(c);B(h.reverse())},0))}function B(a){for(var b,c,d,e,f,h,i,r,j=L;b=a.pop();)if(b.is_reset?(i=H(g.mods[b.name]),i.host=b.host,i.newname=b.newname,b=i,v[b.newname]||(v[b.newname]=[]),v[b.newname].push(b),b.exports=void 0):b.name&&(b=g.mods[b.name]||b),b.block&&(b.running||void 0===b.exports)){h=[];i={};r={id:b.name,filename:b.url,exports:i};f=b.deps.slice();f[b.block.hiddenDeps?"unshift":"push"]("require","exports","module");for(var l=0,n=f.length;l<n;l++)switch(c=f[l],c){case "require":h.push(m);
break;case "exports":h.push(i);break;case "module":h.push(r);break;case "host":h.push(b.host);break;case "finish":d=b.name;j[d]?j[d].push(a):j[d]=[a];h.push(function(a){setTimeout(function(){void 0!==a&&(b.exports=a);j[d]&&(w.call(j[d],function(a){this(a)},B),delete j[d],b.running=0)},0)});e=1;break;default:h.push(((v[c]||[]).pop()||g.mods[k(c)]||{}).exports)}if(!b.running){q=b;c=b.block.apply(b.host,h)||null;q=!1;i=r.exports;b.exports=void 0!==c?c:i;for(var p in i){p&&(b.exports=i);break}}if(e){b.running=
1;break}}}function u(a,b){var c=a.url,d=C[c];if(d)1===d?b.call(a):d.push([b,a]);else{var e=a.name,f=M;if(a.deps&&a.deps.length&&1!==f[e]){f[e]=[a.deps.length,b];a.deps.forEach(function(b){var c=g.mods[k(b)];1!==this[b]&&c.url&&2!==c.loaded?(this[b]||(this[b]=[]),this[b].push(a)):f[e][0]--},n);if(0<f[e][0])return;f[e]=1}var d=C[c]=[[b,a]],h=/^\w+:\/\//.test(c)?c:(g.enable_ozma&&g.distUrl||g.baseUrl||"")+(g.enableAutoSuffix?I(c):c);J.call(a.host||this,h,function(){w.call(d,function(a){a[0].call(a[1])});
C[c]=1;n[e]&&1!==n[e]&&(n[e].forEach(function(a){var b=this[a.name];0>=--b[0]&&(this[a.name]=1,u(a,b[1]))},f),n[e]=1)})}}function F(a,b,c){c=c||[];if(!a[0])return c;var d,e=c.history;e||(e=c.history={});if(a[1])d=a,a=!1;else{var f,a=a[0];if(d=N.exec(a))a=d[2],d=d[1];var h=k(a);!g.mods[h]&&!O[h]&&(a=k(s(a,b)),h!==a&&(h=g.mods[b.url+":"+h]=a),g.mods[a]||p(a,x(a)));if(a=b=g.mods[h]){if("new"===d?a={is_reset:!0,deps:a.deps,name:h,newname:d+"!"+h,host:this}:f=a.name,e[f])return c}else return c;e[f]?d=
[]:(d=a.deps||[],f&&(e[f]=!0))}for(f=d.length-1;0<=f;f--)e[d[f]]||F.call(this,[d[f]],b,c);a&&(G(d,a),c.push(a));return c}function y(a){var b=a.hiddenDeps||[];if(!a.hiddenDeps)for(var c=a.toString(),d=null,b=a.hiddenDeps=[];d=P.exec(c);)b.push(d[0].slice(10,-2));return b.slice()}function G(a,b){w.call(a.slice(),function(c,d){var e=this[b.url+":"+k(c)];"string"===typeof e&&(a[d]=e)},g.mods)}function D(a){for(var b in a)if("aliases"===b){g[b]||(g[b]={});for(var c in a[b])g[b][c]=a[b][c];var d=g.mods,
e;for(e in d)d[e].name=k(e),d[d[e].name]=d[e]}else g[b]=a[b]}function I(a){return a.replace(/(.+?)(_src.*)?(\.\w+)$/,function(a,c,d,e){return c+(d&&"_combo"||"_pack")+e})}function x(a){return Q.test(a)?a:a+".js"}function k(a){var b=g.aliases;b&&(a=a.replace(R,function(a,d){return b[d]||d+"/"}));return a}function s(a,b){var c=S.exec(a);c&&b&&(a=(b.url||"").replace(/[^\/]+$/,"")+c[0]);for(var c=a.replace(T,"$1"),d,e,f=c,h=/(\.\.\/)+/g;d=(h.exec(f)||[])[0];)e=d.match(/\.\.\//g).length,c=c.replace(RegExp("([^/\\.]+/){"+
e+"}"+d),"");return c.replace(/\/\//g,"/")}function J(a,b){var c=t(this)?this.document:document,d=c.createElement("script");d.type="text/javascript";d.async="async";b?A(b)&&(b={callback:b}):b={};b.charset&&(d.charset=b.charset);d.src=a;var e=c.getElementsByTagName("head")[0];d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=void 0,!c&&b.callback&&b.callback()};e.insertBefore(d,
e.firstChild)}function A(a){return"[object Function]"===E.call(a)}function t(a){return"setInterval"in a}function H(a){function b(){}b.prototype=a;return new b}var l=this,E=Object.prototype.toString,N=/(.*)!(.+)/,P=/\Wrequire\((['"]).+?\1\)/g,Q=/\.(js|json)$/,S=/^\.+?\/.+/,T=/(^|\/)\.\//g,R=/^([\w\-]+)\//,O={require:1,exports:1,module:1,host:1,finish:1},g={mods:{}},C={},M={},n={},L={},z,q,v={},w=Array.prototype.forEach||function(a,b){for(var c=0,d=this.length;c<d;c++)c in this&&a.call(b,this[c],c,
this)},j={VERSION:"2.5.1",define:p,require:m,config:D,seek:y,fetch:u,realname:k,basename:s,filesuffix:x,namesuffix:I,_getScript:J,_clone:H,_forEach:w,_isFunction:A,_isWindow:t};m.config=D;p.amd={jQuery:!0};if(l.window)l.oz=j,l.define=p,l.require=m;else{exports.oz=j;exports._config=g;for(var K in j)exports[K]=j[K];j=function(a){return function(){return exports[a].apply(this,arguments)}};B=j("exec");u=j("fetch");m=j("require");m.config=D}})();