yjs/y.js.map
2015-06-19 14:54:35 +02:00

1 line
41 KiB
Plaintext

{"version":3,"sources":["y.js","runtime.js","IndexedDB.js","OperationBuffer.js","Operations.js"],"names":["_inherits","subClass","superClass","TypeError","prototype","Object","create","constructor","value","enumerable","writable","configurable","__proto__","_classCallCheck","instance","Constructor","global","wrap","innerFn","outerFn","self","tryLocsList","generator","Generator","_invoke","makeInvokeMethod","Context","tryCatch","fn","obj","arg","type","call","err","GeneratorFunction","GeneratorFunctionPrototype","defineIteratorMethods","forEach","method","this","AwaitArgument","AsyncIterator","invoke","result","Promise","resolve","then","invokeNext","invokeThrow","unwrapped","enqueue","enqueueResult","previousPromise","invokeReturn","process","domain","bind","context","state","GenStateSuspendedStart","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","iterator","undefined","returnMethod","record","info","done","GenStateSuspendedYield","resultName","next","nextLoc","sent","dispatchException","abrupt","ContinueSentinel","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","values","iterable","iteratorMethod","iteratorSymbol","isNaN","length","i","hasOwn","hasOwnProperty","Symbol","inModule","module","runtime","regeneratorRuntime","exports","Gp","displayName","isGeneratorFunction","genFun","ctor","name","mark","awrap","async","iter","toString","keys","object","key","reverse","pop","prev","tempName","tempIndex","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","window","AbstractTransaction","addOperation","op","context$2$0","getState","uid","t0","user","clock","setState","IndexedDB","Transaction","_AbstractTransaction","transaction","sv","objectStore","ob","setOperation","context$3$0","callee$3$0","context$4$0","put","getOperation","get","getStateVector","stateVector","cursorResult","cursor","openCursor","getStateSet","ss","_iterator","_isArray","_i","_ref","Array","isArray","getOperations","startSS","ops","endSV","_iterator2","_isArray2","_i2","_ref2","endState","startPos","endPos","range","IDBKeyRange","bound","t1","DB","namespace","_this","whenReadyListeners","ready","req","indexedDB","open","onerror","onsuccess","event","db","target","f","setTimeout","onupgradeneeded","createObjectStore","keyPath","whenReady","requestTransaction","makeGen","_this2","res","request","IDBRequest","IDBCursor","IDBOpenDBRequest","gen","apply","removeDatabase","deleteDatabase","OperationBuffer","Operation","yay"],"mappings":"AAUA,YAEA,SAASA,WAAUC,EAAUC,GAAc,GAA0B,kBAAfA,IAA4C,OAAfA,EAAuB,KAAM,IAAIC,WAAU,iEAAoED,GAAeD,GAASG,UAAYC,OAAOC,OAAOJ,GAAcA,EAAWE,WAAaG,aAAeC,MAAOP,EAAUQ,YAAY,EAAOC,UAAU,EAAMC,cAAc,KAAeT,IAAYD,EAASW,UAAYV,GAE3Z,QAASW,iBAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIZ,WAAU,sCCJhH,SAAAa,GAyBA,QAAAC,GAAAC,EAAAC,EAAAC,EAAAC,GAEA,GAAAC,GAAAjB,OAAAC,QAAAa,GAAAI,GAAAnB,UAOA,OALAkB,GAAAE,QAAAC,EACAP,EAAAE,GAAA,KACA,GAAAM,GAAAL,QAGAC,EAcA,QAAAK,GAAAC,EAAAC,EAAAC,GACA,IACA,OAAAC,KAAA,SAAAD,IAAAF,EAAAI,KAAAH,EAAAC,IACA,MAAAG,GACA,OAAAF,KAAA,QAAAD,IAAAG,IAiBA,QAAAV,MACA,QAAAW,MACA,QAAAC,MASA,QAAAC,GAAAhC,IACA,OAAA,QAAA,UAAAiC,QAAA,SAAAC,GACAlC,EAAAkC,GAAA,SAAAR,GACA,MAAAS,MAAAf,QAAAc,EAAAR,MA8BA,QAAAU,GAAAV,GACAS,KAAAT,IAAAA,EAGA,QAAAW,GAAAnB,GAGA,QAAAoB,GAAAJ,EAAAR,GACA,GAAAa,GAAArB,EAAAgB,GAAAR,GACAtB,EAAAmC,EAAAnC,KACA,OAAAA,aAAAgC,GACAI,QAAAC,QAAArC,EAAAsB,KAAAgB,KAAAC,EAAAC,GACAJ,QAAAC,QAAArC,GAAAsC,KAAA,SAAAG,GAEA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,MI/gCFiI,GAAA9N,UAKA+N,IAAA,WACA,MAAA5L,MAAA0D,GANAiI","file":"y.js","sourcesContent":[null,"/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n \"use strict\";\n\n var hasOwn = Object.prototype.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var iteratorSymbol =\n typeof Symbol === \"function\" && Symbol.iterator || \"@@iterator\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided, then outerFn.prototype instanceof Generator.\n var generator = Object.create((outerFn || Generator).prototype);\n\n generator._invoke = makeInvokeMethod(\n innerFn, self || null,\n new Context(tryLocsList || [])\n );\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype;\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n genFun.__proto__ = GeneratorFunctionPrototype;\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `value instanceof AwaitArgument` to determine if the yielded value is\n // meant to be awaited. Some may consider the name of this method too\n // cutesy, but they are curmudgeons.\n runtime.awrap = function(arg) {\n return new AwaitArgument(arg);\n };\n\n function AwaitArgument(arg) {\n this.arg = arg;\n }\n\n function AsyncIterator(generator) {\n // This invoke function is written in a style that assumes some\n // calling function (or Promise) will handle exceptions.\n function invoke(method, arg) {\n var result = generator[method](arg);\n var value = result.value;\n return value instanceof AwaitArgument\n ? Promise.resolve(value.arg).then(invokeNext, invokeThrow)\n : Promise.resolve(value).then(function(unwrapped) {\n result.value = unwrapped;\n return result;\n }, invokeThrow);\n }\n\n if (typeof process === \"object\" && process.domain) {\n invoke = process.domain.bind(invoke);\n }\n\n var invokeNext = invoke.bind(generator, \"next\");\n var invokeThrow = invoke.bind(generator, \"throw\");\n var invokeReturn = invoke.bind(generator, \"return\");\n var previousPromise;\n\n function enqueue(method, arg) {\n var enqueueResult =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(function() {\n return invoke(method, arg);\n }) : new Promise(function(resolve) {\n resolve(invoke(method, arg));\n });\n\n // Avoid propagating enqueueResult failures to Promises returned by\n // later invocations of the iterator, and call generator.return() to\n // allow the generator a chance to clean up.\n previousPromise = enqueueResult[\"catch\"](invokeReturn);\n\n return enqueueResult;\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n if (method === \"return\" ||\n (method === \"throw\" && delegate.iterator[method] === undefined)) {\n // A return or throw (when the delegate iterator has no throw\n // method) always terminates the yield* loop.\n context.delegate = null;\n\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n var returnMethod = delegate.iterator[\"return\"];\n if (returnMethod) {\n var record = tryCatch(returnMethod, delegate.iterator, arg);\n if (record.type === \"throw\") {\n // If the return method threw an exception, let that\n // exception prevail over the original return or throw.\n method = \"throw\";\n arg = record.arg;\n continue;\n }\n }\n\n if (method === \"return\") {\n // Continue with the outer return, now that the delegate\n // iterator has been terminated.\n continue;\n }\n }\n\n var record = tryCatch(\n delegate.iterator[method],\n delegate.iterator,\n arg\n );\n\n if (record.type === \"throw\") {\n context.delegate = null;\n\n // Like returning generator.throw(uncaught), but without the\n // overhead of an extra function call.\n method = \"throw\";\n arg = record.arg;\n continue;\n }\n\n // Delegate generator ran and handled its own exceptions so\n // regardless of what the method was, we continue as if it is\n // \"next\" with an undefined arg.\n method = \"next\";\n arg = undefined;\n\n var info = record.arg;\n if (info.done) {\n context[delegate.resultName] = info.value;\n context.next = delegate.nextLoc;\n } else {\n state = GenStateSuspendedYield;\n return info;\n }\n\n context.delegate = null;\n }\n\n if (method === \"next\") {\n if (state === GenStateSuspendedYield) {\n context.sent = arg;\n } else {\n delete context.sent;\n }\n\n } else if (method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw arg;\n }\n\n if (context.dispatchException(arg)) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n method = \"next\";\n arg = undefined;\n }\n\n } else if (method === \"return\") {\n context.abrupt(\"return\", arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n var info = {\n value: record.arg,\n done: context.done\n };\n\n if (record.arg === ContinueSentinel) {\n if (context.delegate && method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n arg = undefined;\n }\n } else {\n return info;\n }\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(arg) call above.\n method = \"throw\";\n arg = record.arg;\n }\n }\n };\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset();\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function() {\n this.prev = 0;\n this.next = 0;\n this.sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.tryEntries.forEach(resetTryEntry);\n\n // Pre-initialize at least 20 temporary variables to enable hidden\n // class optimizations for simple generators.\n for (var tempIndex = 0, tempName;\n hasOwn.call(this, tempName = \"t\" + tempIndex) || tempIndex < 20;\n ++tempIndex) {\n this[tempName] = null;\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n return !!caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.next = finallyEntry.finallyLoc;\n } else {\n this.complete(record);\n }\n\n return ContinueSentinel;\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = record.arg;\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n return ContinueSentinel;\n }\n };\n})(\n // Among the various tricks for obtaining a reference to the global\n // object, this seems to be the most reliable technique that does not\n // use indirect eval (which violates Content Security Policy).\n typeof global === \"object\" ? global :\n typeof window === \"object\" ? window :\n typeof self === \"object\" ? self : this\n);\n","\ntype State = {\n user: string,\n clock: number\n};\n\ntype StateVector = Array<State>;\n\ntype StateSet = Object;\n\ntype IDBTransaction = Function;\ntype IDBObjectStore = Function;\ntype IDBRequest = Function;\ntype IDBCursor = Function;\ntype IDBKeyRange = Function;\n\ntype IDBOpenDBRequest = Function;\n\ndeclare var indexedDB : Object;\n\ndeclare var setTimeout : Function;\n\nclass AbstractTransaction { //eslint-disable-line no-unused-vars\n constructor () {\n }\n *addOperation (op) {\n var state = yield* this.getState(op.uid[0]);\n if (state == null){\n state = {\n user: op.uid[0],\n clock: 0\n };\n }\n if (op.uid[1] === state.clock){\n state.clock++;\n yield* this.setState(state);\n return true;\n } else {\n return false;\n }\n }\n}\n\nvar IndexedDB = (function(){ //eslint-disable-line no-unused-vars\n class Transaction extends AbstractTransaction{\n transaction: IDBTransaction;\n sv: IDBObjectStore;\n ob: IDBObjectStore;\n constructor (transaction) {\n super();\n this.transaction = transaction;\n this.sv = transaction.objectStore(\"StateVector\");\n this.ob = transaction.objectStore(\"OperationBuffer\");\n }\n *setOperation (op) {\n yield* (function*(){})();\n yield this.ob.put(op);\n return op;\n }\n *getOperation (uid) {\n return yield this.ob.get(uid);\n }\n *setState (state : State) : State {\n return yield this.sv.put(state);\n }\n *getState (user : string) : State {\n return (yield this.sv.get(user)) || {\n user: user,\n clock: 0\n };\n }\n *getStateVector () : StateVector {\n var stateVector = [];\n var cursorResult = this.sv.openCursor();\n var cursor;\n while ((cursor = yield cursorResult) != null) {\n stateVector.push(cursor.value);\n cursor.continue();\n }\n return stateVector;\n }\n *getStateSet () : StateSet {\n var sv : StateVector = yield* this.getStateVector();\n var ss : StateSet = {};\n for (var state of sv){\n ss[state.user] = state.clock;\n }\n return ss;\n }\n\n *getOperations (startSS : StateSet) {\n if (startSS == null){\n startSS = {};\n }\n var ops = [];\n\n var endSV : StateVector = yield* this.getStateVector();\n for (var endState of endSV) {\n var user = endState.user;\n var startPos = startSS[user] || 0;\n var endPos = endState.clock;\n var range = IDBKeyRange.bound([user, startPos], [user, endPos]);\n var cursorResult = this.ob.openCursor(range);\n var cursor;\n while ((cursor = yield cursorResult) != null) {\n ops.push(cursor.value);\n cursor.continue();\n }\n }\n return ops;\n }\n }\n class DB {\n namespace: string;\n ready: Promise;\n whenReadyListeners: Array<Function>;\n constructor (namespace : string) {\n this.whenReadyListeners = [];\n this.namespace = namespace;\n this.ready = false;\n\n var req = indexedDB.open(namespace); //eslint-disable-line no-undef\n req.onerror = function(){\n throw new Error(\"Couldn't open the IndexedDB database!\");\n };\n req.onsuccess = (event)=>{\n this.db = event.target.result;\n this.whenReadyListeners.forEach(function(f){\n setTimeout(f, 0);\n });\n this.whenReadyListeners = null;\n this.ready = true;\n };\n req.onupgradeneeded = function(event){\n var db = event.target.result;\n db.createObjectStore(\"OperationBuffer\", {keyPath: \"uid\"});\n db.createObjectStore(\"StateVector\", {keyPath: \"user\"});\n };\n }\n whenReady (f : Function) {\n if (this.ready){\n setTimeout(f, 0);\n } else {\n this.whenReadyListeners.push(f);\n }\n }\n requestTransaction (makeGen : Function) {\n this.whenReady(()=>{\n var transaction = new Transaction(this.db.transaction([\"OperationBuffer\", \"StateVector\"], \"readwrite\"));\n var gen = makeGen.apply(transaction);\n\n function handle(res : any){\n var request : any = res.value;\n if (res.done){\n return;\n } else if (request.constructor === IDBRequest\n || request.constructor === IDBCursor\n || request.constructor === IDBOpenDBRequest) {\n request.onsuccess = function(){\n handle(gen.next(request.result));\n };\n request.onerror = function(err){\n gen.throw(err);\n };\n } else {\n gen.throw(\"You can not yield this type!\");\n }\n }\n handle(gen.next());\n });\n }\n *removeDatabase () {\n return yield indexedDB.deleteDatabase(this.namespace);\n }\n }\n return DB;\n})();\n","/* @flow */\n\nclass OperationBuffer { //eslint-disable-line no-unused-vars\n constructor () {\n\n }\n}\n","/* @flow */\n\nclass Operation { //eslint-disable-line no-unused-vars\n i : number;\n constructor (op) {\n this.i = op.i;\n }\n yay () {\n return this.i;\n }\n}\n"],"sourceRoot":"/source/"}