-
Notifications
You must be signed in to change notification settings - Fork 2
/
espresso.compressed.js
1 lines (1 loc) · 20.8 KB
/
espresso.compressed.js
1
(function(espressoConfig,undefined,ctx,isCommonJS,espresso,$,require,_,Backbone){function rekwire(){return use.apply(this,arguments)}function namespace(e,t){if(!e)return e;var n=e instanceof Array?e:e.split("."),r=t||ctx,i;while(i=n.shift())if(!r[i]||!(r=r[i]))r=r[i]={};return r}function flatten(e){function t(e,t){var n;return $.map(t,function(t){n=n||t===e}),n}function n(e){return e!==ctx}function r(e,i,s,o){var u;i=i||{},s=s||[],o=o||[];for(var a in e)u=e[a],s.push(a),typeof u=="object"&&n(u)&&!t(u,o)?o.push(u)&&r(u,i,s,o)&&o.pop():i[s.join(".")]=u,s.pop();return i}return r(e)}function parseConfig(e){function t(e,n){for(var r in e)typeof e[r]=="object"?t(e[r],n):e[r]=typeof e[r]=="string"?substitute(e[r],n):e[r];return e}return t($.extend(!0,{},e),flatten(e))}function constant(e,t,n){return n=n||localConstants,t?(typeof n[e=e.toUpperCase()]=="undefined"&&(n[e]=t),n[e]):n[e]}function which(){for(var e=0;e<arguments.length;++e)if(arguments[e])return arguments[e]}function trim(e){return e.replace(/^\s*|\s*$/g,"")}function lambda(e){return function(){return e}}function capitalize(e,t){return e.replace(t?/^[a-z]/gi:/(?:\s|^)[a-z]/gi,function(e){return e.toUpperCase()})}function camelcase(e){return e.replace(/(?:_|-)(\w)/g,function(e,t){return t.toUpperCase()})}function substitute(e,t){return e.replace(/{(.+?)}/g,function(e,n){return t[n]||""})}function curry(e,t,n){return function(){return e.apply(n||this,t||[])}}function die(e){if(!(arguments.length>1))throw new Error(e);error.apply(null,arguments)}function assign(e,t,n,r){var i=(e=e.split(".")).pop(),s=namespace(e,n);return r?s[i]=s[i.toUpperCase()]=s[capitalize(i)]=t:s[i]=t}function extend(){var e=arguments[0]||{},t=1,n=arguments.length,r=!1,i;typeof e=="boolean"&&(r=e,e=arguments[1]||{},t=2),typeof e!="object"&&!jQuery.isFunction(e)&&(e={}),n==t&&(e=this,--t);for(;t<n;t++)if((i=arguments[t])!=null){for(var s in i){var o=e[s],u=i[s];if(e===u)continue;r&&u&&typeof u=="object"&&!u.nodeType?e[s]=extend(r,o||(u.length!=null?[]:{}),u):u!==undefined&&(e[s]=u)}i.hasOwnProperty("toString")&&(e.toString=i.toString),i.hasOwnProperty("valueOf")&&(e.valueOf=i.valueOf)}return e}function ready(){arguments.length==1?$(arguments[0]):(readyEvents||(readyEvents=new espresso.util.EventManager({autofire:!0}))).listen.apply(readyEvents,arguments)}function objectExists(e,t){if(!e)return e;var n=e instanceof Array?e:e.split("."),r=t||ctx,i;while(i=n.shift()){if(!r[i])return!1;r=r[i]}return!0}function configure(e){return typeof e=="string"?e=flatten(config)[e]:e=e?$.extend(!0,config,e):$.extend(!0,{},config),e.jQueryNoConflict&&$.noConflict(!0),e}function args(e){return Array.prototype.slice.call(e||arguments.callee.caller.arguments)}function use(packages,callback,loader){function done(){queue.pop().apply(null,args)}function toBool(e){return e!=0?e!="false":!!e}function decide(condition,fail,pass){if(typeof condition!="undefined")if(typeof condition=="string")try{if(!eval(condition.replace(constant("R_USE_NO_INVOKE"),"")))return fail}catch(e){}else if(!condition)return fail;return pass}var cfg=$.extend(!0,{},config.loader,loader||{}),queue=[],args=[];packages=$.map([].concat(packages),function(e,t){var n=$.extend(!0,{},cfg),r=!1;return e.replace(constant("R_USE_ATTRS"),function(e,t){var r=t.split("=");n[r[0]]=r[1]||!0}),n=parseConfig(n),r=constant("R_USE_HAS_SLASH").test(e),e=e.replace(constant("R_USE_REMOVE_STAR"),"").replace(constant("R_USE_PATH"),"$1"),queue.push(t==0?callback||$.noop:$.noop),decide(n.condition,done,function(){var s=n.alias||e,o=objectExists(s),u=toBool(n.test)&&config.environment==espresso.util.Config.DefaultEnvironments.TEST,a=[(u?n.testPath:n.vendor?n.vendorPath:n.libPath||n.classPath).replace(constant("R_USE_ADD_SLASH"),"/"),(r&&e||e.replace(constant("R_USE_DOT"),"/")).replace(constant(toBool(n.prefix)?"R_USE_LAST_SLASH":"R_USE_NOTHING"),"/"+(n.prefix||"")+"$1"),u?n.testSuffix:"",toBool(n.version)?n.versionSuffix:"",toBool(n.bundled)?n.bundleSuffix:"",toBool(n.compressed)&&!u?n.compressSuffix:"",n.extension].join("");args[t]=namespace(s),!n.force&&(used[a]||o)&&!args[t].__pending__?done():(args[t].__pending__=!0,$.getScript(a,function(){args[t]=used[a]=namespace(s),args[t].__pending__=undefined,delete args[t].__pending__,pending[s]?pending[s].ready=done:done()}))})});while(packages.length)packages.shift()();return args.length==1?args[0]:args}function report(e,t,n,r,i){log(substitute(constant("LOGGING_TPL"),{type:e,task:r,klass:t,method:n,message:i}))}function error(e,t,n,r){throw new Error(substitute(constant("LOGGING_TPL"),{type:"ERROR",task:n,klass:e,method:t,message:r}))}function log(){Array.prototype.shift.call(arguments)>=config.debug.logging&&(ctx.console&&ctx.console.log||$.noop).apply(ctx.console||null,arguments)}function logger(e){return ctx.console?ie?ctx.console.log:e:$.noop}function copy(e){return function(){return e.apply(this,arguments)}}function createClass(){return typeof arguments[0]!="string"&&Array.prototype.unshift.apply(arguments,[null]),lang.Class.create.apply(lang.Class,arguments)}function assignAll(e){$.each(e,assign)}function instanceOf(e,t){return e.instanceOf&&e.instanceOf(t)}function vector(){var e=[];return espresso.$.each(args(),function(t,n){e[n[0]]=n[1]}),e}var VERSION="1.0.0";isCommonJS&&(ctx=global,require=ctx.require,$=require("jquery"));var config=extend(!0,{isCommonJS:isCommonJS||!1,context:ctx,require:require,jQuery:$,jQueryNoConflict:!1,underscore:_,Backbone:Backbone,environment:"prod",loader:{classPath:"/",libPath:"",testPath:"/test",test:!1,testSuffix:".test.js",vendorPath:"/vendor",vendor:!1,extension:".js",prefix:"",compressSuffix:".compressed",compressed:!1,bundleSuffix:".bundled",bundled:!1,version:"",versionSuffix:"-{version}",alias:"",force:!1},debug:{logging:0}},espressoConfig||{}),constants={},localConstants={},used={},pending={},readyEvents,ie=!isCommonJS&&/MSIE+/i.test(ctx.navigator.userAgent);constant("LOGGING_TPL","[{type}] in {klass}#{method}: {task}: {message} - Espresso"),constant("R_FUNC_NAME",/(?:function\s+((?:\w|\$)+)(?:\n|.)*)|(?:\n|.)*/),constant("R_USE_ATTRS",/@(\w*(?:=[^\s]*)*)/g),constant("R_USE_REMOVE_STAR",/(?:(?:\.|\/)\*)/),constant("R_USE_NO_INVOKE",/(?:\(+[^)]*\))|(?:[^= ]+=+[^;]+)/g),constant("R_USE_ADD_SLASH",/\/$|$/),constant("R_USE_LAST_SLASH",/\/(\w*)$/),constant("R_USE_NOTHING",/^$/),constant("R_USE_PATH",/^([0-9A-Za-z./]*).*/),constant("R_USE_DOT",/\./g),constant("R_USE_HAS_SLASH",/^([^\s]*\/)/),ctx.espresso=espresso=assign("espresso",espresso||{},isCommonJS?module.exports:ctx,!0),!require&&(ctx.require=rekwire),$||error("espresso","[core]","Checking jQuery Dependency","jQuery dependency not found"),log.curry=function(e){return function(){log.apply(null,[e||0].concat(Array.prototype.slice.call(arguments)))}};var lang=espresso.lang={Namespace:{create:namespace},Error:{create:function(e,t,n){var r=(e=e.split(".")).pop();return namespace(e,n)[r]=function(){var e={};return $.each(arguments,function(t,n){e[t]=n}),Error(substitute(t,e))}}},Class:{alias:function(e,t,n,r){var i=(e=e.split(".")).pop();return namespace(e,r)[i]=function(e){return n&&n(e),new t(e)}},create:function(e,t,n,r){function h(){return function(n){if(u.Singleton&&c)return c;if(!!n||this instanceof arguments.callee){var r=t.apply(this,[$,require,_,Backbone])||{},s;i=this,i.__constructors__=[],i.__parents__=[],i.__classID__=i.__classID__||e,typeof f=="string"&&(f=namespace(f.replace(constant("R_USE_PATH"),"$1"))),a&&!n?error("espresso.lang.Class","create","Instantiating class","Cannot instantiate abstract class "+e):f&&extend(!0,f.apply(this,[{__child__:r}])||{},r);if(n!==null&&typeof n=="object"&&n.__child__){for(var l in a)typeof a[l]=="function"&&!n.__child__[l]&&error("espresso.lang.Class","create","Validating implementation of abstract class","Method "+e+"@"+l+" must be implemented.");i.__constructors__.push({konstructor:r[o]||$.noop,name:o}),i.__parents__.push(e),n.__child__["@parent"]=function(e){return r[e]?r[e].apply(r,Array.prototype.shift.apply(arguments)&&arguments):r[(""+arguments.callee.caller).replace(constant("R_FUNC_NAME"),"$1")].apply(r,arguments)}}else{s=function(){var e=i.__constructors__,t=[o];for(var n=0;n<e.length;++n)t.push(e[n].name);return t}(),extend(!0,i,r)["@super"]=function(){return i.__constructors__.pop().konstructor.apply(i,arguments)},(r[o]||$.noop).apply(i,arguments);for(var h=0;h<s.length;++h)delete i[s[h]];i.__parents__.push(e),i.__setParents(i.__parents__).__setClassID(i.__classID__).__clean(o).__cleanAll(),u.Singleton&&(c=i)}return extend(!0,i,r)}return new arguments.callee}}var i,s=e?e.split("."):["[anonymous]"],o=s.pop(),u=n||{},a=u.Abstract,f=u.Extends||lang.Object,l=[].concat(typeof f=="string"?f:[],u.Dependencies||[]),c=null;return l.length&&(pending[e]=extend(!0,pending[e]||{},{dependencies:l}),use(l,function(){pending[e]&&pending[e].ready&&pending[e].ready(),pending[e]=null,delete pending[e]})),e?namespace(s,r)[o]=h():h()}},Interface:{create:function(e,t){return lang.Class.create(e,$.noop,{Abstract:t})}},Package:{use:function(e,t,n){return use(e,typeof t=="function"?t:function(){readyEvents&&readyEvents.fire(t)},n)}}};lang.Class.create("espresso.lang.Object",function(e){var t,n;return{Object:function(){},__setParents:function(e){return n=e||[],this},__setClassID:function(e){return t=e,this},__clean:function(e){return this[e]=undefined,delete this[e],this},__cleanAll:function(){var e=["__parents__","__setParents","__constructors__","__classID__","__setClassID","@super","__cleanAll","__clean"],t;while(t=e.shift())this.__clean(t);return this},getClassID:function(){return t},instanceOf:function(t){return e.inArray(typeof t=="string"?t:t.getClassID(),n)>-1}}}),assignAll({"espresso.constant":function(e,t){return constant(e,t,constants)},"espresso.jQuery":$,"espresso.$":$,"espresso.load":$.getScript,"espresso.log":logger(log),"espresso.debug":logger(log.curry(0)),"espresso.warn":logger(log.curry(1)),"espresso.error":logger(log.curry(2)),"espresso.trace":logger(log.curry(3)),"espresso.report":report,"espresso.args":args,"espresso.curry":curry,"espresso.copy":copy,"espresso.lambda":lambda,"espresso.vector":vector,"espresso.reflect":curry(flatten,[espresso]),"espresso.ready":ready,"espresso.die":die,"espresso.flatten":flatten,"espresso.which":which,"espresso.extend":extend,"espresso.substitute":substitute,"espresso.capitalize":capitalize,"espresso.camelcase":camelcase,"espresso.trim":trim,"espresso.objectExists":objectExists,"espresso.instanceOf":instanceOf,"espresso.config":configure,"espresso.parseConfig":parseConfig,"espresso.require":require,"espresso.use":isCommonJS?require:lang.Package.use,"espresso.version":lambda(VERSION),"espresso.Static":assign,"espresso.Class":createClass,"espresso.Namespace":lang.Namespace.create,"espresso.Package":lang.Namespace.create,"espresso.Error":lang.Error.create,"espresso.Alias":lang.Class.alias,"espresso.Interface":lang.Interface.create,"espresso.plugins":{}})})(this.espressoConfig,this.undefined,this,typeof global!="undefined",this.espresso,this.jQuery||this.$,this.require,this._,this.Backbone),function(e){e.Static("espresso.util.Config.DefaultEnvironments",{PROD:"prod",DEV:"dev",TEST:"test"}),e.Static("espresso.util.Config.LoggingLevels",{DEBUG:0,WARN:1,ERROR:2})}(this.espresso),function(e){e.Interface("espresso.util.TwoDIterator",{left:function(){},right:function(){},up:function(){},down:function(){},upleft:function(){},upright:function(){},downleft:function(){},downright:function(){}}),e.Class("espresso.util.DataModel",function(t){function r(r){t.each(r,function(t,r){n[["get",e.capitalize(e.camelcase(t))].join("")]=function(){return r}})}var n=null;return{DataModel:function(e){return n=this,r(e),this}}}),e.Class("espresso.util.EventManager",function(t){function s(t,r){var i=new e.collections.EventQueue(r);return n.put(t,i),i}var n,r,i={autofire:!1};return{EventManager:function(s){t.extend(i,s),n=new e.collections.HashMap,r=new e.collections.HashMap},listen:function(e,t,o){var u=n.get(e),a;return u?(u.add(t,o),i.autofire&&u.hasFired()&&(a=r.get(e),u.flush(a.args,a.scope))):s(e,t),this},fire:function(e,t,i,o){var u=n.get(e);return u||(u=s(e)),u.flush(t,i,o),r.put(e,{args:t,scope:i}),this}}})}(this.espresso),function(e){function t(){}e.Interface("espresso.collections.List",{add:t,get:t,remove:t,size:t,isEmpty:t}),e.Class("espresso.collections.LinkedList",function(t){var n;return{LinkedList:function(e){n=e||[]},size:function(){return n.length},add:function(t,r){if(r==null)return n.push(t),this.size()-1;if(r<0||r>=_size())throw new e.collections.LinkedList.IndexOutOfBoundsException(r);return n.splice(r,0,t),r},get:function(t){if(t<0||t>=this.size())throw new e.collections.LinkedList.IndexOutOfBoundsException(t);return n[t]},replace:function(t,r){if(r<0||r>=this.size())throw new e.collections.LinkedList.IndexOutOfBoundsException(r);n[r]=t},remove:function(t){if(t<0||t>=this.size())throw new e.collections.LinkedList.IndexOutOfBoundsException(t);n.splice(t,1)},getFirst:function(){if(this.isEmpty())throw new e.collections.LinkedList.NoSuchElementException;return this.get(0)},getLast:function(){if(this.isEmpty())throw new e.collections.LinkedList.NoSuchElementException;return this.get(this.size()-1)},isEmpty:function(){return this.size()==0},clear:function(){var e=this.size();e>0&&n.splice(0,e)},toArray:function(){return n.slice(0)},clone:function(){return new e.collections.LinkedList(this.isEmpty()?null:this.toArray())}}},{Extends:e.collections.List}),e.Error("espresso.collections.LinkedList.IndexOutOfBoundsException","Index {0} out of bounds on espresso.collections.LinkedList object"),e.Error("espresso.collections.LinkedList.NoSuchElementException","No such element exists on espresso.collections.LinkedList object."),e.Class("espresso.collections.SparsedMatrix",function(e){function s(e,t){return[e,t].join(",")}function o(e,t){function n(e,t){return function(){return u(e,t)}}return{up:n(e,t-1),left:n(e-1,t),down:n(e,t+1),right:n(e+1,t),upright:n(e+1,t-1),upleft:n(e-1,t-1),downright:n(e+1,t+1),downleft:n(e-1,t+1),current:n(e,t)}}function u(e,t){return r[s(e,t)]||a(e,t)}function a(e,t,n){var o=s(e,t),u=r[o];return u||++i,r[o]=new h(e,t,n||null)}function f(e,t){n=o(e,t)}function l(){f(0,0)}function c(e){return function(){return t.move.call(t,e)}}function h(e,t,n){this.x=e,this.y=t,this.data=n}var t,n,r,i;return{SparsedMatrix:function(){t=this.clear()},get:function(e,t){return arguments.length==0?n.current().data:u(e,t).data},set:function(e,t,r){var i;return arguments.length<=1?(r=arguments[0],i=n.current(),e=i.x,t=i.y):f(e,t),a(e,t,r),this},clear:function(){return r={},i=0,l(),this},length:function(){return i},position:function(){var e=n.current();return{x:e.x,y:e.y}},move:function(e,t){var r;return arguments.length==1&&(r=n[arguments[0]](),e=r.x,t=r.y),f(e,t),this},toString:function(){var e=[];for(var t in e)e.push("{"+t+"}");return["Length: "+i,"Iterator: "+(i?"{"+n.current().x+","+n.current().y+"}":"null"),"Nodes: "+e.join(", ")].join("\n")},debug:function(e){e&&(e("Length",i),e("Iterator",i?{x:n.current().x,y:n.current().y}:null),e("Nodes",r))},up:c("up"),left:c("left"),down:c("down"),right:c("right"),upright:c("upright"),upleft:c("upleft"),downright:c("downright"),downleft:c("downleft")}},{Extends:e.util.TwoDIterator}),e.Static("espresso.collections.SparsedMatrix.DirectionsEnum",{UP:"up",LEFT:"left",DOWN:"down",RIGHT:"right",UP_LEFT:"upleft",UP_RIGHT:"upright",DOWN_LEFT:"downleft",DOWN_RIGHT:"downright"}),e.Class("espresso.collections.HashMap",function(t){function o(e,t){var n=i.add(e);s.add(t),r[e]=n}function u(e,t){var n=r[e];s.replace(t,n)}var n=this,r={},i,s;return{HashMap:function(){var t=e.collections.LinkedList;return i=new t,s=new t,this},put:function(e,t){return r[e]?u(e,t):o(e,t),t},add:function(e,t){return this.put(e,t)},get:function(e){var t=r[e];return t==null?null:s.get(t)},remove:function(e){if(!r[e])return this;var t=r[e];return delete r[e],i.remove(t),s.remove(t),this},clear:function(){for(var e in r)delete r[e];i.clear(),s.clear()},getKeys:function(){return i.clone()},getValues:function(){return s.clone()},size:function(){return i.size()},isEmpty:function(){return this.size()==0}}},{Extends:e.collections.List}),e.Class("espresso.collections.EventQueue",function(t){function i(t){if(n.length)return n[t]()();throw new e.collections.EventQueue.QueueDepletedException}var n,r=!1;return{EventQueue:function(e){n=[],this.add(e)},add:function(e,t){if(e instanceof Array)for(var r=0;r<e.length;++r)this.add(e[r]);else typeof e=="function"&&n[t?"unshift":"push"](e);return this},flush:function(e,t,i){var s=n,o;i&&(s=[].concat(n));while(o=s.shift())o.apply(t,e instanceof Array?e:[e]);return r=!0,this},step:function(){return i("shift")},pop:function(){return i("pop")},length:function(){return n.length},hasFired:function(){return r}}}),e.Error("espresso.collections.EventQueue.QueueDepletedException","The queue is empty. Nothing to execute.")}(this.espresso),function(e){function i(e){return e||{}}function s(t){e.config(e.extend(!0,(t||{}).espresso,e.config("context").espressoConfig))}var t=e.$;e.Class("espresso.framework.Session",function(e){return{Session:function(){}}}),e.Class("espresso.framework.Process",function(t){var n,r,i,s,o;return{Process:function(e,t,u){o=this,r=t,i=u,s=e,n=s.processes().add(this)},invoke:function(n){var u;return s.getService((r=r.split(".")).shift(),function(a){n=n||{},a=e.Namespace(r.join("."),a)||a,u=a[i].apply(a,[].concat(n.args||[]))||new e.framework.ProcessResult,u.process(o),u.state(e.framework.Process.COMPLETE),(n.callback||t.noop)(u),s.processes().remove(this)}),u},path:function(){return r},command:function(){return i},toString:function(){return""+n},valueOf:function(){return 1*n}}}),e.Static("espresso.framework.Process.READY",0),e.Static("espresso.framework.Process.COMPLETE",1),e.Class("espresso.framework.collections.Processes",function(e){var t,n;return{Processes:function(){t={},n=[]},add:function(e){var r=n.push([e.path(),e.command()]);return t[r]=e,r},remove:function(e){t[e]=undefined,delete t[e]}}}),e.Class("espresso.framework.ProcessResult",function(t){function r(e,t){return n[e]=typeof t!="undefined"?t:n[e]}var n={};return{ProcessResult:function(t,n){n=n||{},this.value(t),this.state(n.state||e.framework.Process.READY),this.session(n.session),this.assert(n.assert),this.process(n.process)},value:function(e){return r("value",e)},state:function(e){return r("state",e||n.value)},process:function(e){return r("process",e)},session:function(t){return e.extend(n,{session:t}),this},assert:function(t,r){return e.extend(n,{assert:[t,r]}),this}}}),e.Class("espresso.framework.Application",function(t){function l(t){var n=e.parseConfig(t||{}),r=n.registry;for(var i in r)s.put(i,r[i]);n.autoload?c(n.autoload):d()}function c(e){function r(n){return t.map(e,n)}n.use(r(function(e){return s.get(e)}),function(){r(function(e){h(e)}),d()})}function h(r,i){return n.use(s.get(r),function(s){(i||t.noop)(s.getInstance().initialize(n,e.parseConfig(f.services[r])))})}function p(){o.length()&&o.flush()}function d(){n.initialize()}var n,r,i,s,o,u,a,f={};return{Application:function(t,f,c,h){var p=e.collections,d=e.framework;return r=t,i=h,s=new p.HashMap,o=new p.EventQueue,a=new d.Session,u=new d.collections.Processes,n=this.setConfig(f),l(c),this},setConfig:function(t){var n=e.extend(!0,(t||{}).espresso,this.getContext().espressoConfig);return e.config(n),e.extend(!0,f,n||{},t),this},getContext:function(){return i},getConfig:function(){return f},getName:function(){return r},loadService:function(e,t){return h(e,t),this},getService:function(e,t){var n=h(e,t);return typeof n=="function"?n.getInstance():null},use:function(t,n,r){return e.use(t,n,r||f.loader)},domready:function(e){return o.add(e),t(p),this},execute:function(t,n,r){return(new e.framework.Process(this,t,n)).invoke(r)},processes:function(){return u},session:function(){return a}}},{Abstract:{initialize:function(e,t){},ready:function(){}}}),e.Class("espresso.framework.Service",function(t){return{Service:t.noop,registerComponent:function(t,n){return this[e.capitalize(t)]=n,this},hasComponent:function(t){return!!this[e.capitalize(t)]}}},{Abstract:{initialize:function(e,t){}}});var n={},r=e.plugins;r.Application={create:function(r,o,u,a){var f=!1,l,c,h,p,d;return u=i(u),l=i(u.Configuration),c=i(u.Services),h=i(l.Default),s(h),a=a||e.config("context"),(o=o(t))[r]=function(){return this["@super"](r,h,c,a)},p=e.copy(o.initialize),o.initialize=function(){return f?this:(f=!0,p.call(this,this.getConfig(),a),this)},d=e.Class(r,function(){return o},{Dependencies:u.Dependencies,Extends:u.Extends||e.framework.Application,Singleton:!0},a),o=new d,e.Static("getInstance",e.lambda(o),a[r]),n[r]=o.domready(t.proxy(o.ready,o))}},r.Service={create:function(n,r,i){var s=!1,o=e.copy((r=r(t)).initialize),u;return r.initialize=function(){return s?this:(s=!0,o.apply(this,arguments),this)},u=e.Class(n,e.lambda(r),{Extends:(i=i||{}).Extends||e.framework.Service,Dependencies:i.Dependencies,Singleton:!0}),e.Static("getInstance",function(){return new this},u),u}},r.ProcessResult=function(t,n){return new e.framework.ProcessResult(t,n)},e.Static("Application",r.Application.create,e),e.Static("Service",r.Service.create,e),e.Static("getApplication",function(e){return n[e]||null},e),e.Static("ProcessResult",r.ProcessResult,e)}(this.espresso)