This repository was archived by the owner on Aug 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 604
Expand file tree
/
Copy pathrequire.js
More file actions
executable file
·12 lines (12 loc) · 13.7 KB
/
require.js
File metadata and controls
executable file
·12 lines (12 loc) · 13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
var require=function(e,t,n){function r(e,t){return t?e:c[e]}function i(i){var s=f[i]={},c={id:i,parent:e,filename:r(i,a),web:a};return c[o]=s,t("global","module",o,(n.strict?"'use strict';":"")+r(i)).call(s,e,c,s),l.call(s=c[o],u)||(s[u]=a),s}function s(e){return l.call(f,e)?f[e]:f[e]=i(e)}var o="exports",u="loaded",a=!0,f={},l=f.hasOwnProperty,c={
"ngo": "(function(){var e,t,n,r={}.hasOwnProperty,i=function(e,t){function i(){this.constructor=e}for(var n in t)r.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},s=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},o=[].slice;n=\"undefined\"!=typeof window,t=require(\"events\").EventEmitter,e=function(e){function E(e){var t=this;this.mq=e.mq,this.getSessionToken=e.getSessionToken,this.bongoName=c(),this.channelName=\"private-\"+this.bongoName,this.localStore=new f,this.remoteStore=new f,this.updateInstanceChannel=this.mq.subscribe(\"updateInstances\"),this.readyState=0,this.stack=[],this.on(\"newListener\",function(e,n){if(e===\"ready\"&&t.readyState===1)return process.nextTick(function(){return t.emit(\"ready\"),t.removeAllListeners(\"ready\")})})}var n,u,a,f,l,c,h,p,d,v,m,g,y,b,w;return i(E,e),l=require(\"traverse\"),h=E.createId=require(\"hat\"),n=E.JsPath=require(\"jspath\"),E.dnodeProtocol=require(\"koding-dnode-protocol\"),y=E.dnodeProtocol,f=y.Store,a=y.Scrubber,E.EventEmitter=t,u=E.Model=require(\"./src/model\"),u.prototype.mixin(require(\"./src/eventemitter/broker\")),g=[].slice,d=require(\"./src/util\").extend,b=require(\"sinkrow\"),v=b.race,m=b.sequence,p=b.dash,w=require(\"sinkrow\"),E.daisy=w.daisy,E.dash=w.dash,E.sequence=w.sequence,E.race=w.race,E.future=w.future,c=function(){return\"bongo.\"+h()},E.prototype.cacheable=require(\"./src/cacheable\"),E.prototype.createRemoteApiShims=function(e){var t,n,r,i,s,o;i={};for(n in e)o=e[n],s=o.statik,t=o.instance,r=o.options,i[n]=this.createConstructor(n,s,t,r);return i},E.prototype.wrapStaticMethods=function(){var e;return e=[\"on\",\"off\"],function(t,n,r){var i;return i=this,r.forEach(function(r){return s.call(e,r)>=0&&(r+=\"_\"),t[r]=function(){var e;return e={type:\"static\",constructorName:n,method:r},i.send(e,[].slice.call(arguments))}})}}(),E.prototype.wrapInstanceMethods=function(){var e;return e=[\"on\",\"addListener\",\"off\",\"removeListener\",\"save\"],function(t,n,r){var i;return i=this,r.forEach(function(r){return s.call(e,r)>=0&&(r+=\"_\"),t.prototype[r]=function(){var e,t,s;return t=this.getId(),t==null&&(e=this.data),s={type:\"instance\",constructorName:n,method:r,id:t,data:e},i.send(s,[].slice.call(arguments))}})}}(),E.prototype.createConstructor=function(e,t,n,i){var s,o,a,f;o=Function(\"return function \"+e+\" () {\\n this.init.apply(this, [].slice.call(arguments));\\n this.bongo_.constructorName = '\"+e+\"';\\n}\")(),this.wrapStaticMethods(o,e,t),s=function(){this.constructor=o},s.prototype=u.prototype;for(f in u){if(!r.call(u,f))continue;o[f]=u[f]}o.prototype=new s,o.prototype.updateInstanceChannel=this.updateInstanceChannel,o.__super__=u.prototype;for(a in i){if(!r.call(i,a))continue;o[a]=i[a]}return this.wrapInstanceMethods(o,e,n),o},E.prototype.getInstancesById=function(){},E.prototype.getInstanceMethods=function(){return[\"fetchApi\",\"changeLoggedInState\"]},E.prototype.revive=function(e){var t;return t=this,(new l(e)).map(function(e){var n,r,i,s,o;return(e!=null?e.bongo_:void 0)!=null?(o=e.bongo_,n=o.constructorName,i=o.instanceId,r=t.getInstancesById(i),r!=null?this.update(r,!0):(s=t.api[e.bongo_.constructorName],s==null?this.update(e):this.update(new s(e)))):this.update(e)})},E.prototype.reviveFromSnapshots=function(e,t){var n=this;return t(null,e.map(function(e){if(e.snapshot!=null)return n.revive(JSON.parse(e.snapshot))}))},E.prototype.handleRequest=function(e){var t,n,r,i,u,f=this;return(e!=null?e.method:void 0)===\"defineApi\"?this.defineApi(e.arguments[0]):(n=e.method,i=new a(this.localStore),u=i.unscrub(e,function(e){return f.remoteStore.has(e)||f.remoteStore.add(e,function(){var t;return t=1<=arguments.length?o.call(arguments,0):[],f.send(e,t)}),f.remoteStore.get(e)}),r=this.revive(u),s.call(this.getInstanceMethods(),n)>=0?this[n].apply(this,r):isNaN(+n)?console.log(n):(t=this.localStore.get(n),t!=null?t.apply(null,r):void 0))},E.prototype.connect=function(e){var t=this;return this.channel=this.mq.subscribe(this.channelName),this.channel.once(\"broker:subscription_succeeded\",function(){return t.channel.on(\"server-message\",t.handleRequest.bind(t)),setTimeout(function(){return t.channel.emit(\"client-join\",t.getSessionToken())},1e3),t.stack.forEach(function(e){return e.call(t)}),e(null)})},E.prototype.messageFailed=function(e){return console.log(\"MESSAGE FAILED\",e)},E.prototype.getTimeout=function(e,t){return t==null&&(t=5e3),setTimeout(this.messageFailed.bind(this,e),t)},E.prototype.send=function(e,t){var n,r=this;Array.isArray(t)||(t=[t]);if(!this.channel)throw new Error(\"No channel!\");return n=new a(this.localStore),n.scrub(t,function(){var t,i;return t=n.toDnodeProtocol(),t.method=e,t.sessionToken=r.getSessionToken(),i=JSON.stringify(t),r.channel.emit(\"client-message\",i)})},E.prototype.disconnect=function(e){},E.prototype.defineApi=function(e){return this.api=this.createRemoteApiShims(e),this.readyState=1,this.emit(\"ready\")},E.prototype.changeLoggedInState=function(e){return this.emit(\"loggedInStateChanged\",e)},E.prototype.fetchChannel=function(e,t){var n;return n=this.mq.subscribe(e),n.on(\"broker:subscription_succeeded\",function(){return t(n)})},E.prototype.use=function(e){return this.stack.push(e)},E}(t),!n&&module?module.exports=e:typeof window!=\"undefined\"&&window!==null&&(window.Bongo=e)}).call(this)",
"cheable": "(function(){var e,t,n,r,i;e=require(\"./modelloader\"),t=require(\"sinkrow\").dash,module.exports=function(){switch(arguments.length){case 2:return r.apply(this,arguments);case 3:return i.apply(this,arguments);default:throw new Error(\"Bongo#cacheable expects either 2 or 3 arguments.\")}},n=function(){var t;return t={},function(n,r){var i,s,o;return t[o=n.name]||(t[o]={}),i=(s=t[n.name])[r]||(s[r]=new e(n,r))}}(),i=function(e,t,r){var i,s;\"string\"==typeof e?i=this.api[e]:\"function\"==typeof e&&(i=e),i?(i.cache||(i.cache={}),(s=i.cache[t])?r(null,s):n(i,t).load(function(e,n){return i.cache[t]=n,r(e,n)})):r(new Error(\"Unknown type \"+e))},r=function(e,n){var r,s,o=this;r=[],s=e.map(function(e,t){return function(){var u,a,f,l;return f=e.name,l=e.type,u=e.constructorName,a=e.id,i.call(o,l||f||u,a,function(e,i){return e?n(e):(r[t]=i,s.fin())})}}),t(s,function(){return n(null,r)})}}).call(this)",
"annel": "(function(){var e;module.exports=e=function(){function e(e){var t,n;this.channel=e;for(n in e)t=e[n],\"function\"==typeof t&&(this[n]=t.bind(e));this.on=this.bind,this.emit=this.trigger}return e}()}).call(this)",
"entemitter/broker": "(function(){module.exports=function(){var e,t;return t=function(e){return Array.isArray(e)?e=e.join(\":\"):e},e=Object.defineProperty,{afterInit:function(){var t;return t={},function(){var n,r,i,s,o=this;n=this.constructor.broadcastable,r=(typeof this.getId==\"function\"?this.getId():void 0)||((s=this.bongo_)!=null?s.instanceId:void 0);if(n&&r!=null)return i=\"object-\"+r,e(this,\"channel\",{get:function(){return t[i]||(t[i]=o.mq.subscribe(i))}}),this.updateInstanceChannel.on(i,function(e){if(e.update)return o.update_(e.update)})}}(),destroy:function(){if(this.channel==null)return;return this.mq.unsubscribe(this.channel)},on:function(e,t){var n,r,i,s,o;n=this.constructor,i=this.multiplexer.on(e,function(r){var i;i=r!=null?r[e]:void 0;if(i!=null)return n.wrapArgs([i],function(e){var n;return n=e[0],t(n)});if(e===\"update\")return t()}),r=(typeof this.getId==\"function\"?this.getId():void 0)||((o=this.bongo_)!=null?o.instanceId:void 0);if(r!=null&&i&&e!==\"update\")return s=\"object-\"+r,this.updateInstanceChannel.on(s,i)},off:function(e,t){return this.channel.off(e,t)}}}()}).call(this)",
"entemitter/dnode": "(function(){module.exports={afterInit:function(){var e=this;return typeof this.on==\"function\"?this.on(\"updateInstance\",function(t){return e.updateInstances(t)}):void 0},on:function(e,t){var n;n=this.multiplexer.on(e,t);if(n)return typeof this.on_==\"function\"?this.on_(e,n):void 0},off:function(e,t){var n;n=this.multiplexer.off(e,t);if(n===0)return this.off_(e,this.multiplexer.events[e])}}}).call(this)",
"entemitter/pusher": "(function(){module.exports=function(){var e,t;return t=function(e){return Array.isArray(e)?e=e.join(\":\"):e},e=Object.defineProperty,{afterInit:function(){var t;return t={},function(){var n,r,i,s,o=this;n=this.constructor.broadcastable,r=(typeof this.getId==\"function\"?this.getId():void 0)||((s=this.bongo_)!=null?s.instanceId:void 0);if(n&&r!=null)return i=\"object-\"+r,e(this,\"channel\",{value:t[i]||(t[i]=this.mq.subscribe(i))}),this.channel.bind(\"updateInstance\",function(e){return o.update_(e)})}}(),destroy:function(){return this.mq.unsubscribe(\"object-\"+id)},on:function(e,n){var r,i;r=this.constructor,e=t(e),i=this.multiplexer.on(e,function(){return r.wrapArgs([].slice.call(arguments),function(e){return n.apply(null,e)})});if(i)return this.channel.bind(e,i)},off:function(e,t){}}}()}).call(this)",
"entmultiplexer": "(function(){var e,t;t=[].slice,module.exports=e=function(){function e(e){this.context=e,this.events={}}return e.prototype.on=function(e,n){var r,i,s;s=this,i=s.events[e],i==null&&(r=!0,i=s.events[e]=function(){var e,r,o;o=i.listeners;for(e=0,r=o.length;e<r;e++)n=o[e],n.apply(s.context,t.call(arguments))},i.listeners=[]),i.listeners.push(n);if(r)return i},e.prototype.off=function(e,t){var n,r,i,s,o,u,a;s=this,i=s.events[e];if(!i)return-1;a=i.listeners;for(n=o=0,u=a.length;o<u;n=++o)r=a[n],r===t&&i.listeners.splice(n,1);return i.listeners.length},e}()}).call(this)",
"del": "(function(){var e,t=[].slice;module.exports=e=function(){function o(){}var e,n,r,i,s;return r=require(\"mongoop\"),n=require(\"jspath\"),e=require(\"./eventmultiplexer\"),i=o.createId=require(\"hat\"),s=require(\"./util\").extend,o.prototype.mixin=o.mixin=function(e){var t,n,r;r=[];for(t in e)n=e[t],t!==\"constructor\"&&r.push(this[t]=n);return r},o.on=function(){var e;return e=[],function(t,n){var r,i,s=this;return this.prototype.mq!=null?(r=e[i=this.name]||(e[i]=this.prototype.mq.subscribe(this.name)),r.bind(t,function(){return s.wrapArgs([].slice.call(arguments),function(e){return n.apply(null,e)})})):typeof this.on_==\"function\"?this.on_(t,n):void 0}}(),o.off=function(e,t){if(this.prototype.mq==null)return typeof this.off_==\"function\"?this.off_(e,t):void 0},o.prototype.on=function(){},o.prototype.off=function(){},o.prototype.watch=function(e,t){var n;return(n=this.watchers)[e]||(n[e]=[]),this.watchers[e].push(t)},o.prototype.unwatch=function(e,t){return t?this.watchers.splice(this.watchers.indexOf(t),1):delete this.watchers[e]},o.prototype.init=function(t){var n;return n=this,n.watchers={},n.bongo_||(n.bongo_={}),\"defineProperty\"in Object?Object.defineProperty(this,\"multiplexer\",{enumerable:!1,value:new e}):this.multiplexer=new e,t!=null&&n.set(t),\"instanceId\"in n.bongo_||(n.bongo_.instanceId=i()),typeof this.afterInit==\"function\"?this.afterInit():void 0},o.prototype.set=function(e){var t;return e==null&&(e={}),t=this,delete e.data,s(t,e),t},o.prototype.getFlagValue=function(e){var t;return(t=this.flags_)!=null?t[e]:void 0},o.prototype.watchFlagValue=function(e,t){return this.watch(\"flags_.\"+e,t)},o.prototype.unwatchFlagValue=function(e){return this.unwatch(\"flags_.\"+e)},o.prototype.getAt=function(e){return n.getAt(this,e)},o.prototype.setAt=function(e,t){return n.setAt(this,e,t)},o.prototype.getId=function(){return this._id},o.prototype.equals=function(e){return this.getId&&(e!=null?e.getId:void 0)?this.getId()===e.getId():this===e},o.prototype.save=function(e){var t;return t=this,t.save_(function(n,r){return n?e(n):(s(t,r[0]),bongo.addReferences(t),e(null,r))})},o.prototype.emit=function(){var e,n,r,i,s,o,u,a;e=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],r=((u=this.multiplexer.events[e])!=null?u.listeners:void 0)||[],a=[];for(s=0,o=r.length;s<o;s++)n=r[s],a.push(n.apply(this,i));return a},o.prototype.update_=function(e){var t,n=this;return t=(new r(e)).applyTo(this),Object.keys(t).forEach(function(e){var r;return(r=n.watchers[e])!=null?r.forEach(function(r){return r.call(n,t[e])}):void 0}),this.emit(\"update\")},o.prototype.addListener=o.prototype.on,o.prototype.removeListener=o.prototype.off,o}()}).call(this)",
"delloader": "(function(){var e,t,n={}.hasOwnProperty,r=function(e,t){function i(){this.constructor=e}for(var r in t)n.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e};e=require(\"events\").EventEmitter,module.exports=t=function(e){function n(e,t){this._id=t,this.constructor=e,this.setMaxListeners(0)}var t;return r(n,e),t=function(){var e=this;return this.constructor.one({_id:this._id},function(t,n){return e.emit(\"load\",t,n)})},n.prototype.load=function(e){this.once(\"load\",e);if(!this.isLoading)return this.isLoading=!0,t.call(this)},n}(e)}).call(this)",
"il": "(function(){var e=[].slice;module.exports={extend:function(){var t,n,r,i,s,o,u;n=arguments[0],r=2<=arguments.length?e.call(arguments,1):[];for(o=0,u=r.length;o<u;o++){i=r[o];for(t in i)s=i[t],n[t]=s}return n},asynchronizeOwnMethods:function(t){var n;return n={},Object.keys(t).forEach(function(r){var i;if(\"function\"==typeof (i=t[r]))return n[r]=function(){var t,n,r;return n=2<=arguments.length?e.call(arguments,0,r=arguments.length-1):(r=0,[]),t=arguments[r++],t(i.apply(null,n))}}),n}}}).call(this)"
},h=e.require;return s._=function(t){for(var n in t)l.call(t,n)&&(c[n]=t[n]);return s},s.config=n,s.main=e,h?h._(c):s}(this,Function,{strict:!0,path:"js/"});!function(e,t,n){for(n=0;n<e.length;n++)e[n][t]=="exec"&&Function(e[n].innerHTML)(e[n][t]=="")}(document.getElementsByTagName("script"),"className")