silk-gui
Version:
GUI for developers and Node OS
1 lines • 15.4 kB
JavaScript
(function(e){var t,n;(function(){var e={},r={};t=function(t,n,r){e[t]={deps:n,callback:r}},n=function(t){function h(e){if(e.charAt(0)!==".")return e;var n=e.split("/"),r=t.split("/").slice(0,-1);for(var i=0,s=n.length;i<s;i++){var o=n[i];if(o==="..")r.pop();else{if(o===".")continue;r.push(o)}}return r.join("/")}if(r[t])return r[t];r[t]={};if(!e[t])throw new Error("Could not find module "+t);var i=e[t],s=i.deps,o=i.callback,u=[],a;for(var f=0,l=s.length;f<l;f++)s[f]==="exports"?u.push(a={}):u.push(n(h(s[f])));var c=o.apply(this,u);return r[t]=a||c},n.entries=e})(),t("rsvp/-internal",["./utils","./instrument","./config","exports"],function(e,t,n,r){"use strict";function f(){}function d(e){try{return e.then}catch(t){return p.error=t,p}}function v(e,t,n,r){try{e.call(t,n,r)}catch(i){return i}}function m(e,t,n){a.async(function(e){var r=!1,i=v(n,t,function(n){if(r)return;r=!0,t!==n?b(e,n):E(e,n)},function(t){if(r)return;r=!0,S(e,t)},"Settle: "+(e._label||" unknown promise"));!r&&i&&(r=!0,S(e,i))},e)}function g(e,t){e._onerror=null,t._state===c?E(e,t._result):e._state===h?S(e,t._result):x(t,undefined,function(n){t!==n?b(e,n):E(e,n)},function(t){S(e,t)})}function y(e,t){if(t instanceof e.constructor)g(e,t);else{var n=d(t);n===p?S(e,p.error):n===undefined?E(e,t):s(n)?m(e,t,n):E(e,t)}}function b(e,t){e===t?E(e,t):i(t)?y(e,t):E(e,t)}function w(e){e._onerror&&e._onerror(e._result),T(e)}function E(e,t){if(e._state!==l)return;e._result=t,e._state=c,e._subscribers.length===0?a.instrument&&u("fulfilled",e):a.async(T,e)}function S(e,t){if(e._state!==l)return;e._state=h,e._result=t,a.async(w,e)}function x(e,t,n,r){var i=e._subscribers,s=i.length;e._onerror=null,i[s]=t,i[s+c]=n,i[s+h]=r,s===0&&e._state&&a.async(T,e)}function T(e){var t=e._subscribers,n=e._state;a.instrument&&u(n===c?"fulfilled":"rejected",e);if(t.length===0)return;var r,i,s=e._result;for(var o=0;o<t.length;o+=3)r=t[o],i=t[o+n],r?L(n,r,i,s):i(s);e._subscribers.length=0}function N(){this.error=null}function k(e,t){try{return e(t)}catch(n){return C.error=n,C}}function L(e,t,n,r){var i=s(n),o,u,a,f;if(i){o=k(n,r),o===C?(f=!0,u=o.error,o=null):a=!0;if(t===o){S(t,new TypeError("A promises callback cannot return that same promise."));return}}else o=r,a=!0;t._state===l&&(i&&a?b(t,o):f?S(t,u):e===c?E(t,o):e===h&&S(t,o))}function A(e,t){try{t(function(n){b(e,n)},function(n){S(e,n)})}catch(n){S(e,n)}}var i=e.objectOrFunction,s=e.isFunction,o=e.now,u=t["default"],a=n.config,l=void 0,c=1,h=2,p=new N,C=new N;r.noop=f,r.resolve=b,r.reject=S,r.fulfill=E,r.subscribe=x,r.publish=T,r.publishRejection=w,r.initializePromise=A,r.invokeCallback=L,r.FULFILLED=c,r.REJECTED=h}),t("rsvp/all-settled",["./enumerator","./promise","./utils","exports"],function(e,t,n,r){"use strict";function a(e,t,n){this._superConstructor(e,t,!1,n)}var i=e["default"],s=e.makeSettledResult,o=t["default"],u=n.o_create;a.prototype=u(i.prototype),a.prototype._superConstructor=i,a.prototype._makeResult=s,a.prototype._validationError=function(){return new Error("allSettled must be called with an array")},r["default"]=function(t,n){return(new a(o,t,n)).promise}}),t("rsvp/all",["./promise","exports"],function(e,t){"use strict";var n=e["default"];t["default"]=function(t,r){return n.all(t,r)}}),t("rsvp/asap",["exports"],function(e){"use strict";function s(){return function(){process.nextTick(l)}}function o(){var e=0,t=new r(l),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function u(){var e=new MessageChannel;return e.port1.onmessage=l,function(){e.port2.postMessage(0)}}function a(){return function(){setTimeout(l,1)}}function l(){for(var e=0;e<t;e+=2){var n=f[e],r=f[e+1];n(r),f[e]=undefined,f[e+1]=undefined}t=0}var t=0;e["default"]=function(n,r){f[t]=n,f[t+1]=r,t+=2,t===2&&c()};var n=typeof window!="undefined"?window:{},r=n.MutationObserver||n.WebKitMutationObserver,i=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined",f=new Array(1e3),c;typeof process!="undefined"&&{}.toString.call(process)==="[object process]"?c=s():r?c=o():i?c=u():c=a()}),t("rsvp/config",["./events","exports"],function(e,t){"use strict";function i(e,t){if(e==="onerror"){r.on("error",t);return}if(arguments.length!==2)return r[e];r[e]=t}var n=e["default"],r={instrument:!1};n.mixin(r),t.config=r,t.configure=i}),t("rsvp/defer",["./promise","exports"],function(e,t){"use strict";var n=e["default"];t["default"]=function(t){var r={};return r.promise=new n(function(e,t){r.resolve=e,r.reject=t},t),r}}),t("rsvp/enumerator",["./utils","./-internal","exports"],function(e,t,n){"use strict";function p(e,t,n){return e===f?{state:"fulfilled",value:n}:{state:"rejected",reason:n}}function d(e,t,n,r){this._instanceConstructor=e,this.promise=new e(s,r),this._abortOnReject=n,this._validateInput(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._init(),this.length===0?u(this.promise,this._result):(this.length=this.length||0,this._enumerate(),this._remaining===0&&u(this.promise,this._result))):o(this.promise,this._validationError())}var r=e.isArray,i=e.isMaybeThenable,s=t.noop,o=t.reject,u=t.fulfill,a=t.subscribe,f=t.FULFILLED,l=t.REJECTED,c=t.PENDING,h=!0;n.ABORT_ON_REJECTION=h,n.makeSettledResult=p,d.prototype._validateInput=function(e){return r(e)},d.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},d.prototype._init=function(){this._result=new Array(this.length)},n["default"]=d,d.prototype._enumerate=function(){var e=this.length,t=this.promise,n=this._input;for(var r=0;t._state===c&&r<e;r++)this._eachEntry(n[r],r)},d.prototype._eachEntry=function(e,t){var n=this._instanceConstructor;i(e)?e.constructor===n&&e._state!==c?(e._onerror=null,this._settledAt(e._state,t,e._result)):this._willSettleAt(n.resolve(e),t):(this._remaining--,this._result[t]=this._makeResult(f,t,e))},d.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===c&&(this._remaining--,this._abortOnReject&&e===l?o(r,n):this._result[t]=this._makeResult(e,t,n)),this._remaining===0&&u(r,this._result)},d.prototype._makeResult=function(e,t,n){return n},d.prototype._willSettleAt=function(e,t){var n=this;a(e,undefined,function(e){n._settledAt(f,t,e)},function(e){n._settledAt(l,t,e)})}}),t("rsvp/events",["exports"],function(e){"use strict";function t(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function n(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t}e["default"]={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e._promiseCallbacks=undefined,e},on:function(e,r){var i=n(this),s;s=i[e],s||(s=i[e]=[]),t(s,r)===-1&&s.push(r)},off:function(e,r){var i=n(this),s,o;if(!r){i[e]=[];return}s=i[e],o=t(s,r),o!==-1&&s.splice(o,1)},trigger:function(e,t){var r=n(this),i,s,o,u;if(i=r[e])for(var a=0;a<i.length;a++)o=i[a],o(t)}}}),t("rsvp/filter",["./promise","./utils","exports"],function(e,t,n){"use strict";var r=e["default"],i=t.isFunction,s=t.isMaybeThenable;n["default"]=function(t,n,s){return r.all(t,s).then(function(e){if(!i(n))throw new TypeError("You must pass a function as filter's second argument.");var t=e.length,o=new Array(t);for(var u=0;u<t;u++)o[u]=n(e[u]);return r.all(o,s).then(function(n){var r=new Array(t),i=0;for(var s=0;s<t;s++)n[s]&&(r[i]=e[s],i++);return r.length=i,r})})}}),t("rsvp/hash-settled",["./promise","./enumerator","./promise-hash","./utils","exports"],function(e,t,n,r,i){"use strict";function l(e,t,n){this._superConstructor(e,t,!1,n)}var s=e["default"],o=t.makeSettledResult,u=n["default"],a=t["default"],f=r.o_create;l.prototype=f(u.prototype),l.prototype._superConstructor=a,l.prototype._makeResult=o,l.prototype._validationError=function(){return new Error("hashSettled must be called with an object")},i["default"]=function(t,n){return(new l(s,t,n)).promise}}),t("rsvp/hash",["./promise","./promise-hash","./enumerator","exports"],function(e,t,n,r){"use strict";var i=e["default"],s=t["default"],o=n.ABORT_ON_REJECTION;r["default"]=function(t,n){return(new s(i,t,n)).promise}}),t("rsvp/instrument",["./config","./utils","exports"],function(e,t,n){"use strict";var r=e.config,i=t.now,s=[];n["default"]=function(t,n,o){1===s.push({name:t,payload:{guid:n._guidKey+n._id,eventName:t,detail:n._result,childGuid:o&&n._guidKey+o._id,label:n._label,timeStamp:i(),stack:(new Error(n._label)).stack}})&&setTimeout(function(){var e;for(var t=0;t<s.length;t++)e=s[t],r.trigger(e.name,e.payload);s.length=0},50)}}),t("rsvp/map",["./promise","./utils","exports"],function(e,t,n){"use strict";var r=e["default"],i=t.isArray,s=t.isFunction;n["default"]=function(t,n,i){return r.all(t,i).then(function(e){if(!s(n))throw new TypeError("You must pass a function as map's second argument.");var t=e.length,o=new Array(t);for(var u=0;u<t;u++)o[u]=n(e[u]);return r.all(o,i)})}}),t("rsvp/node",["./promise","./utils","exports"],function(e,t,n){"use strict";var r=e["default"],i=t.isArray;n["default"]=function(t,n){function u(){var e=arguments.length,i=new Array(e);for(var u=0;u<e;u++)i[u]=arguments[u];var a;return!s&&!o&&n?(typeof console=="object"&&console.warn('Deprecation: RSVP.denodeify() doesn\'t allow setting the "this" binding anymore. Use yourFunction.bind(yourThis) instead.'),a=n):a=this,r.all(i).then(function(e){function i(r,i){function u(){var e=arguments.length,t=new Array(e);for(var u=0;u<e;u++)t[u]=arguments[u];var a=t[0],f=t[1];if(a)i(a);else if(s)r(t.slice(1));else if(o){var l={},c=t.slice(1),h,p;for(p=0;p<n.length;p++)h=n[p],l[h]=c[p];r(l)}else r(f)}e.push(u),t.apply(a,e)}return new r(i)})}var s=n===!0,o=i(n);return u.__proto__=t,u}}),t("rsvp/promise-hash",["./enumerator","./-internal","./utils","exports"],function(e,t,n,r){"use strict";function a(e,t,n){this._superConstructor(e,t,!0,n)}var i=e["default"],s=t.PENDING,o=t.FULFILLED,u=n.o_create;r["default"]=a,a.prototype=u(i.prototype),a.prototype._superConstructor=i,a.prototype._init=function(){this._result={}},a.prototype._validateInput=function(e){return e&&typeof e=="object"},a.prototype._validationError=function(){return new Error("Promise.hash must be called with an object")},a.prototype._enumerate=function(){var e=this.promise,t=this._input,n=[];for(var r in t)e._state===s&&t.hasOwnProperty(r)&&n.push({position:r,entry:t[r]});var i=n.length;this._remaining=i;var o;for(var u=0;e._state===s&&u<i;u++)o=n[u],this._eachEntry(o.entry,o.position)}}),t("rsvp/promise",["./config","./events","./instrument","./utils","./-internal","./promise/cast","./promise/all","./promise/race","./promise/resolve","./promise/reject","exports"],function(e,t,n,r,i,s,o,u,a,f,l){"use strict";function _(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function D(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function P(e,t){this._id=M++,this._label=t,this._subscribers=[],c.instrument&&p("created",this),g!==e&&(v(e)||_(),this instanceof P||D(),S(this,e))}var c=e.config,h=t["default"],p=n["default"],d=r.objectOrFunction,v=r.isFunction,m=r.now,g=i.noop,y=i.resolve,b=i.reject,w=i.fulfill,E=i.subscribe,S=i.initializePromise,x=i.invokeCallback,T=i.FULFILLED,N=s["default"],C=o["default"],k=u["default"],L=a["default"],A=f["default"],O="rsvp_"+m()+"-",M=0;l["default"]=P,P.cast=N,P.all=C,P.race=k,P.resolve=L,P.reject=A,P.prototype={constructor:P,_id:undefined,_guidKey:O,_label:undefined,_state:undefined,_result:undefined,_subscribers:undefined,_onerror:function(e){c.trigger("error",e)},then:function(e,t,n){var r=this;r._onerror=null;var i=new this.constructor(g,n),s=r._state,o=r._result;return c.instrument&&p("chained",r,i),s===T&&e?c.async(function(){x(s,i,e,o)}):E(r,i,e,t),i},"catch":function(e,t){return this.then(null,e,t)},"finally":function(e,t){var n=this.constructor;return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){throw t})},t)}}}),t("rsvp/promise/all",["../enumerator","exports"],function(e,t){"use strict";var n=e["default"];t["default"]=function(t,r){return(new n(this,t,!0,r)).promise}}),t("rsvp/promise/cast",["./resolve","exports"],function(e,t){"use strict";var n=e["default"];t["default"]=n}),t("rsvp/promise/race",["../utils","../-internal","exports"],function(e,t,n){"use strict";var r=e.isArray,i=e.isFunction,s=e.isMaybeThenable,o=t.noop,u=t.resolve,a=t.reject,f=t.subscribe,l=t.PENDING;n["default"]=function(t,n){function p(e){u(c,e)}function d(e){a(c,e)}var i=this,s,c=new i(o,n);if(!r(t))return a(c,new TypeError("You must pass an array to race.")),c;var h=t.length;for(var v=0;c._state===l&&v<h;v++)f(i.resolve(t[v]),undefined,p,d);return c}}),t("rsvp/promise/reject",["../-internal","exports"],function(e,t){"use strict";var n=e.noop,r=e.reject;t["default"]=function(t,i){var s=this,o=new s(n,i);return r(o,t),o}}),t("rsvp/promise/resolve",["../-internal","exports"],function(e,t){"use strict";var n=e.noop,r=e.resolve;t["default"]=function(t,i){var s=this;if(t&&typeof t=="object"&&t.constructor===s)return t;var o=new s(n,i);return r(o,t),o}}),t("rsvp/race",["./promise","exports"],function(e,t){"use strict";var n=e["default"];t["default"]=function(t,r){return n.race(t,r)}}),t("rsvp/reject",["./promise","exports"],function(e,t){"use strict";var n=e["default"];t["default"]=function(t,r){return n.reject(t,r)}}),t("rsvp/resolve",["./promise","exports"],function(e,t){"use strict";var n=e["default"];t["default"]=function(t,r){return n.resolve(t,r)}}),t("rsvp/rethrow",["exports"],function(e){"use strict";e["default"]=function(t){throw setTimeout(function(){throw t}),t}}),t("rsvp/utils",["exports"],function(e){"use strict";function t(e){return typeof e=="function"||typeof e=="object"&&e!==null}function n(e){return typeof e=="function"}function r(e){return typeof e=="object"&&e!==null}e.objectOrFunction=t,e.isFunction=n,e.isMaybeThenable=r;var i;Array.isArray?i=Array.isArray:i=function(e){return Object.prototype.toString.call(e)==="[object Array]"};var s=i;e.isArray=s;var o=Date.now||function(){return(new Date).getTime()};e.now=o;var u=Object.create||function(e){var t=function(){};return t.prototype=e,t};e.o_create=u}),t("rsvp",["./rsvp/promise","./rsvp/events","./rsvp/node","./rsvp/all","./rsvp/all-settled","./rsvp/race","./rsvp/hash","./rsvp/hash-settled","./rsvp/rethrow","./rsvp/defer","./rsvp/config","./rsvp/map","./rsvp/resolve","./rsvp/reject","./rsvp/filter","./rsvp/asap","exports"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m){"use strict";function P(e,t){k.async(e,t)}function H(){k.on.apply(k,arguments)}function B(){k.off.apply(k,arguments)}var g=e["default"],y=t["default"],b=n["default"],w=r["default"],E=i["default"],S=s["default"],x=o["default"],T=u["default"],N=a["default"],C=f["default"],k=l.config,L=l.configure,A=c["default"],O=h["default"],M=p["default"],_=d["default"],D=v["default"];k.async=D;if(typeof window!="undefined"&&typeof window.__PROMISE_INSTRUMENTATION__=="object"){var j=window.__PROMISE_INSTRUMENTATION__;L("instrument",!0);for(var F in j)j.hasOwnProperty(F)&&H(F,j[F])}m.Promise=g,m.EventTarget=y,m.all=w,m.allSettled=E,m.race=S,m.hash=x,m.hashSettled=T,m.rethrow=N,m.defer=C,m.denodeify=b,m.configure=L,m.on=H,m.off=B,m.resolve=O,m.reject=M,m.async=P,m.map=A,m.filter=_}),e.RSVP=n("rsvp")})(self);