diff --git a/CHANGELOG.md b/CHANGELOG.md index eef2794..cf1727a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.0](http://github.com/feathersjs-offline/compare/v1.0.7...v1.0.8) (2021-07-30) + +**Note:** Version bump only for package feathersjs-offline + ## [1.0.8](http://github.com/feathersjs-offline/compare/v1.0.7...v1.0.8) (2021-07-17) **Note:** Version bump only for package feathersjs-offline diff --git a/package.json b/package.json index 1a30693..6b6cf5c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "feathersjs-offline", "description": "FeathersJS offline-first realtime universe", - "version": "1.0.8", + "version": "1.1.0", "keywords": [ "feathers", "feathersjs-offline", diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 44a313c..58b3c01 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.0](http://github.com/feathersjs-offline/owndata-ownnet/packages/client/compare/v1.0.7...v1.0.8) (2021-07-30) + +*** Breaking change *** Clients will no longer try to automatically supply a valid `localStorage` as this ruins pre-compiled clients (eg. React). If you still want to use the client eg. for a "slave" server, then you need to include something like: +``` js +let LocalStorage = require('node-localstorage').LocalStorage; +global.localStorage = new LocalStorage('./.scratch'); +``` +before requiring `@feathersjs-offline/client`. ## [1.0.8](http://github.com/feathersjs-offline/owndata-ownnet/packages/client/compare/v1.0.7...v1.0.8) (2021-07-17) Clients automatic inclusion of `node-localstorage` moved into `_setup()` as it otherwise always will be included in compiled clients. diff --git a/packages/client/dist/feathersjs-offline-client.js b/packages/client/dist/feathersjs-offline-client.js index 154341a..626451a 100644 --- a/packages/client/dist/feathersjs-offline-client.js +++ b/packages/client/dist/feathersjs-offline-client.js @@ -2239,7 +2239,7 @@ var OwnClass = /*#__PURE__*/function (_adapter_commons_1$Ad) { key: "setup", value: function setup(app, path) { return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { - var LocalStorage, self, old, localOptions, queueOptions, stripValues, idIx; + var self, old, localOptions, queueOptions, stripValues, idIx; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { @@ -2255,15 +2255,6 @@ var OwnClass = /*#__PURE__*/function (_adapter_commons_1$Ad) { case 3: this._setupPerformed = true; - - if (typeof localStorage === 'undefined') { - debug('Simulating localStorage...'); - LocalStorage = __webpack_require__(/*! node-localstorage */ "./node_modules/node-localstorage/LocalStorage.js").LocalStorage; - __webpack_require__.g.localStorage = new LocalStorage('./.scratch'); - } else { - debug('Utilizing built-in localStorage'); - } - this.options = this.wrapperOptions; self = this; this.thisName = this.options.fixedName !== '' ? this.options.fixedName : "".concat(this.type, "_offline_").concat(nameIx++, "_").concat(path); // Now we are ready to define the path with its underlying service (the remoteService) @@ -2304,10 +2295,10 @@ var OwnClass = /*#__PURE__*/function (_adapter_commons_1$Ad) { this.localQueue = app.service(this.localServiceQueue); // We need to make sure that localService is properly initiated - make a dummy search // (one of the quirks of feathers-localstorage) - _context2.next = 24; + _context2.next = 23; return this.localService.ready(); - case 24: + case 23: // The initialization/setup of the localService adapter screws-up our options object this.options = this.wrapperOptions; // Are we running adapterTests? @@ -2366,7 +2357,7 @@ var OwnClass = /*#__PURE__*/function (_adapter_commons_1$Ad) { debug(' Done.'); return _context2.abrupt("return", true); - case 37: + case 36: case "end": return _context2.stop(); } @@ -4820,493 +4811,6 @@ module.exports = charenc; })(); -/***/ }), - -/***/ "./node_modules/events/events.js": -/*!***************************************!*\ - !*** ./node_modules/events/events.js ***! - \***************************************/ -/***/ ((module) => { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -var R = typeof Reflect === 'object' ? Reflect : null -var ReflectApply = R && typeof R.apply === 'function' - ? R.apply - : function ReflectApply(target, receiver, args) { - return Function.prototype.apply.call(target, receiver, args); - } - -var ReflectOwnKeys -if (R && typeof R.ownKeys === 'function') { - ReflectOwnKeys = R.ownKeys -} else if (Object.getOwnPropertySymbols) { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target) - .concat(Object.getOwnPropertySymbols(target)); - }; -} else { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target); - }; -} - -function ProcessEmitWarning(warning) { - if (console && console.warn) console.warn(warning); -} - -var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { - return value !== value; -} - -function EventEmitter() { - EventEmitter.init.call(this); -} -module.exports = EventEmitter; -module.exports.once = once; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._eventsCount = 0; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -var defaultMaxListeners = 10; - -function checkListener(listener) { - if (typeof listener !== 'function') { - throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); - } -} - -Object.defineProperty(EventEmitter, 'defaultMaxListeners', { - enumerable: true, - get: function() { - return defaultMaxListeners; - }, - set: function(arg) { - if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { - throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); - } - defaultMaxListeners = arg; - } -}); - -EventEmitter.init = function() { - - if (this._events === undefined || - this._events === Object.getPrototypeOf(this)._events) { - this._events = Object.create(null); - this._eventsCount = 0; - } - - this._maxListeners = this._maxListeners || undefined; -}; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { - if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { - throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); - } - this._maxListeners = n; - return this; -}; - -function _getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; -} - -EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return _getMaxListeners(this); -}; - -EventEmitter.prototype.emit = function emit(type) { - var args = []; - for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); - var doError = (type === 'error'); - - var events = this._events; - if (events !== undefined) - doError = (doError && events.error === undefined); - else if (!doError) - return false; - - // If there is no 'error' event listener then throw. - if (doError) { - var er; - if (args.length > 0) - er = args[0]; - if (er instanceof Error) { - // Note: The comments on the `throw` lines are intentional, they show - // up in Node's output if this results in an unhandled exception. - throw er; // Unhandled 'error' event - } - // At least give some kind of context to the user - var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); - err.context = er; - throw err; // Unhandled 'error' event - } - - var handler = events[type]; - - if (handler === undefined) - return false; - - if (typeof handler === 'function') { - ReflectApply(handler, this, args); - } else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - ReflectApply(listeners[i], this, args); - } - - return true; -}; - -function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; - - checkListener(listener); - - events = target._events; - if (events === undefined) { - events = target._events = Object.create(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener !== undefined) { - target.emit('newListener', type, - listener.listener ? listener.listener : listener); - - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; - } - - if (existing === undefined) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = - prepend ? [listener, existing] : [existing, listener]; - // If we've already got an array, just append. - } else if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - - // Check for listener leak - m = _getMaxListeners(target); - if (m > 0 && existing.length > m && !existing.warned) { - existing.warned = true; - // No error code for this since it is a Warning - // eslint-disable-next-line no-restricted-syntax - var w = new Error('Possible EventEmitter memory leak detected. ' + - existing.length + ' ' + String(type) + ' listeners ' + - 'added. Use emitter.setMaxListeners() to ' + - 'increase limit'); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - ProcessEmitWarning(w); - } - } - - return target; -} - -EventEmitter.prototype.addListener = function addListener(type, listener) { - return _addListener(this, type, listener, false); -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.prependListener = - function prependListener(type, listener) { - return _addListener(this, type, listener, true); - }; - -function onceWrapper() { - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - if (arguments.length === 0) - return this.listener.call(this.target); - return this.listener.apply(this.target, arguments); - } -} - -function _onceWrap(target, type, listener) { - var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; - var wrapped = onceWrapper.bind(state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; -} - -EventEmitter.prototype.once = function once(type, listener) { - checkListener(listener); - this.on(type, _onceWrap(this, type, listener)); - return this; -}; - -EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - checkListener(listener); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; - -// Emits a 'removeListener' event if and only if the listener was removed. -EventEmitter.prototype.removeListener = - function removeListener(type, listener) { - var list, events, position, i, originalListener; - - checkListener(listener); - - events = this._events; - if (events === undefined) - return this; - - list = events[type]; - if (list === undefined) - return this; - - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); - } - } else if (typeof list !== 'function') { - position = -1; - - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } - - if (position < 0) - return this; - - if (position === 0) - list.shift(); - else { - spliceOne(list, position); - } - - if (list.length === 1) - events[type] = list[0]; - - if (events.removeListener !== undefined) - this.emit('removeListener', type, originalListener || listener); - } - - return this; - }; - -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - -EventEmitter.prototype.removeAllListeners = - function removeAllListeners(type) { - var listeners, events, i; - - events = this._events; - if (events === undefined) - return this; - - // not listening for removeListener, no need to emit - if (events.removeListener === undefined) { - if (arguments.length === 0) { - this._events = Object.create(null); - this._eventsCount = 0; - } else if (events[type] !== undefined) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else - delete events[type]; - } - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = Object.keys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = Object.create(null); - this._eventsCount = 0; - return this; - } - - listeners = events[type]; - - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners !== undefined) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } - - return this; - }; - -function _listeners(target, type, unwrap) { - var events = target._events; - - if (events === undefined) - return []; - - var evlistener = events[type]; - if (evlistener === undefined) - return []; - - if (typeof evlistener === 'function') - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - - return unwrap ? - unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); -} - -EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); -}; - -EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); -}; - -EventEmitter.listenerCount = function(emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } -}; - -EventEmitter.prototype.listenerCount = listenerCount; -function listenerCount(type) { - var events = this._events; - - if (events !== undefined) { - var evlistener = events[type]; - - if (typeof evlistener === 'function') { - return 1; - } else if (evlistener !== undefined) { - return evlistener.length; - } - } - - return 0; -} - -EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; -}; - -function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) - copy[i] = arr[i]; - return copy; -} - -function spliceOne(list, index) { - for (; index + 1 < list.length; index++) - list[index] = list[index + 1]; - list.pop(); -} - -function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; - } - return ret; -} - -function once(emitter, name) { - return new Promise(function (resolve, reject) { - function eventListener() { - if (errorListener !== undefined) { - emitter.removeListener('error', errorListener); - } - resolve([].slice.call(arguments)); - }; - var errorListener; - - // Adding an error listener is not optional because - // if an error is thrown on an event emitter we cannot - // guarantee that the actual event we are waiting will - // be fired. The result could be a silent way to create - // memory or file descriptor leaks, which is something - // we should avoid. - if (name !== 'error') { - errorListener = function errorListener(err) { - emitter.removeListener(name, eventListener); - reject(err); - }; - - emitter.once('error', errorListener); - } - - emitter.once(name, eventListener); - }); -} - - /***/ }), /***/ "./node_modules/feathers-localstorage/lib/index.js": @@ -6293,1062 +5797,42 @@ function comparable(value) { /***/ }), -/***/ "./node_modules/graceful-fs/clone.js": -/*!*******************************************!*\ - !*** ./node_modules/graceful-fs/clone.js ***! - \*******************************************/ +/***/ "./node_modules/is-buffer/index.js": +/*!*****************************************!*\ + !*** ./node_modules/is-buffer/index.js ***! + \*****************************************/ /***/ ((module) => { -"use strict"; - - -module.exports = clone - -function clone (obj) { - if (obj === null || typeof obj !== 'object') - return obj - - if (obj instanceof Object) - var copy = { __proto__: obj.__proto__ } - else - var copy = Object.create(null) - - Object.getOwnPropertyNames(obj).forEach(function (key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) - }) - - return copy -} - - -/***/ }), - -/***/ "./node_modules/graceful-fs/graceful-fs.js": -/*!*************************************************!*\ - !*** ./node_modules/graceful-fs/graceful-fs.js ***! - \*************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var fs = __webpack_require__(/*! fs */ "?65c5") -var polyfills = __webpack_require__(/*! ./polyfills.js */ "./node_modules/graceful-fs/polyfills.js") -var legacy = __webpack_require__(/*! ./legacy-streams.js */ "./node_modules/graceful-fs/legacy-streams.js") -var clone = __webpack_require__(/*! ./clone.js */ "./node_modules/graceful-fs/clone.js") - -var util = __webpack_require__(/*! util */ "?0bed") - -/* istanbul ignore next - node 0.x polyfill */ -var gracefulQueue -var previousSymbol - -/* istanbul ignore else - node 0.x polyfill */ -if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { - gracefulQueue = Symbol.for('graceful-fs.queue') - // This is used in testing by future versions - previousSymbol = Symbol.for('graceful-fs.previous') -} else { - gracefulQueue = '___graceful-fs.queue' - previousSymbol = '___graceful-fs.previous' -} - -function noop () {} - -function publishQueue(context, queue) { - Object.defineProperty(context, gracefulQueue, { - get: function() { - return queue - } - }) -} - -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs4') -else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') - console.error(m) - } - -// Once time initialization -if (!fs[gracefulQueue]) { - // This queue can be shared by multiple loaded instances - var queue = __webpack_require__.g[gracefulQueue] || [] - publishQueue(fs, queue) - - // Patch fs.close/closeSync to shared queue version, because we need - // to retry() whenever a close happens *anywhere* in the program. - // This is essential when multiple graceful-fs instances are - // in play at the same time. - fs.close = (function (fs$close) { - function close (fd, cb) { - return fs$close.call(fs, fd, function (err) { - // This function uses the graceful-fs shared queue - if (!err) { - retry() - } - - if (typeof cb === 'function') - cb.apply(this, arguments) - }) - } - - Object.defineProperty(close, previousSymbol, { - value: fs$close - }) - return close - })(fs.close) - - fs.closeSync = (function (fs$closeSync) { - function closeSync (fd) { - // This function uses the graceful-fs shared queue - fs$closeSync.apply(fs, arguments) - retry() - } - - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }) - return closeSync - })(fs.closeSync) +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug(fs[gracefulQueue]) - __webpack_require__(/*! assert */ "?b0c0").equal(fs[gracefulQueue].length, 0) - }) - } +// The _isBuffer check is for Safari 5-7 support, because it's missing +// Object.prototype.constructor. Remove this eventually +module.exports = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) } -if (!__webpack_require__.g[gracefulQueue]) { - publishQueue(__webpack_require__.g, fs[gracefulQueue]); +function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } -module.exports = patch(clone(fs)) -if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { - module.exports = patch(fs) - fs.__patched = true; +// For Node v0.10 support. Remove this eventually. +function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } -function patch (fs) { - // Everything that references the open() function needs to be in here - polyfills(fs) - fs.gracefulify = patch - - fs.createReadStream = createReadStream - fs.createWriteStream = createWriteStream - var fs$readFile = fs.readFile - fs.readFile = readFile - function readFile (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$readFile(path, options, cb) - - function go$readFile (path, options, cb) { - return fs$readFile(path, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readFile, [path, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$writeFile = fs.writeFile - fs.writeFile = writeFile - function writeFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$writeFile(path, data, options, cb) - - function go$writeFile (path, data, options, cb) { - return fs$writeFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$writeFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$appendFile = fs.appendFile - if (fs$appendFile) - fs.appendFile = appendFile - function appendFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$appendFile(path, data, options, cb) - - function go$appendFile (path, data, options, cb) { - return fs$appendFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$appendFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - var fs$readdir = fs.readdir - fs.readdir = readdir - function readdir (path, options, cb) { - var args = [path] - if (typeof options !== 'function') { - args.push(options) - } else { - cb = options - } - args.push(go$readdir$cb) +/***/ }), - return go$readdir(args) - - function go$readdir$cb (err, files) { - if (files && files.sort) - files.sort() - - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readdir, [args]]) - - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - } - } - - function go$readdir (args) { - return fs$readdir.apply(fs, args) - } - - if (process.version.substr(0, 4) === 'v0.8') { - var legStreams = legacy(fs) - ReadStream = legStreams.ReadStream - WriteStream = legStreams.WriteStream - } - - var fs$ReadStream = fs.ReadStream - if (fs$ReadStream) { - ReadStream.prototype = Object.create(fs$ReadStream.prototype) - ReadStream.prototype.open = ReadStream$open - } - - var fs$WriteStream = fs.WriteStream - if (fs$WriteStream) { - WriteStream.prototype = Object.create(fs$WriteStream.prototype) - WriteStream.prototype.open = WriteStream$open - } - - Object.defineProperty(fs, 'ReadStream', { - get: function () { - return ReadStream - }, - set: function (val) { - ReadStream = val - }, - enumerable: true, - configurable: true - }) - Object.defineProperty(fs, 'WriteStream', { - get: function () { - return WriteStream - }, - set: function (val) { - WriteStream = val - }, - enumerable: true, - configurable: true - }) - - // legacy names - var FileReadStream = ReadStream - Object.defineProperty(fs, 'FileReadStream', { - get: function () { - return FileReadStream - }, - set: function (val) { - FileReadStream = val - }, - enumerable: true, - configurable: true - }) - var FileWriteStream = WriteStream - Object.defineProperty(fs, 'FileWriteStream', { - get: function () { - return FileWriteStream - }, - set: function (val) { - FileWriteStream = val - }, - enumerable: true, - configurable: true - }) - - function ReadStream (path, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments) - } - - function ReadStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - if (that.autoClose) - that.destroy() - - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - that.read() - } - }) - } - - function WriteStream (path, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments) - } - - function WriteStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - that.destroy() - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - } - }) - } - - function createReadStream (path, options) { - return new fs.ReadStream(path, options) - } - - function createWriteStream (path, options) { - return new fs.WriteStream(path, options) - } - - var fs$open = fs.open - fs.open = open - function open (path, flags, mode, cb) { - if (typeof mode === 'function') - cb = mode, mode = null - - return go$open(path, flags, mode, cb) - - function go$open (path, flags, mode, cb) { - return fs$open(path, flags, mode, function (err, fd) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$open, [path, flags, mode, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - return fs -} - -function enqueue (elem) { - debug('ENQUEUE', elem[0].name, elem[1]) - fs[gracefulQueue].push(elem) -} - -function retry () { - var elem = fs[gracefulQueue].shift() - if (elem) { - debug('RETRY', elem[0].name, elem[1]) - elem[0].apply(null, elem[1]) - } -} - - -/***/ }), - -/***/ "./node_modules/graceful-fs/legacy-streams.js": -/*!****************************************************!*\ - !*** ./node_modules/graceful-fs/legacy-streams.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var Stream = __webpack_require__(/*! stream */ "?cc48").Stream - -module.exports = legacy - -function legacy (fs) { - return { - ReadStream: ReadStream, - WriteStream: WriteStream - } - - function ReadStream (path, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path, options); - - Stream.call(this); - - var self = this; - - this.path = path; - this.fd = null; - this.readable = true; - this.paused = false; - - this.flags = 'r'; - this.mode = 438; /*=0666*/ - this.bufferSize = 64 * 1024; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.encoding) this.setEncoding(this.encoding); - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } - - if (this.start > this.end) { - throw new Error('start must be <= end'); - } - - this.pos = this.start; - } - - if (this.fd !== null) { - process.nextTick(function() { - self._read(); - }); - return; - } - - fs.open(this.path, this.flags, this.mode, function (err, fd) { - if (err) { - self.emit('error', err); - self.readable = false; - return; - } - - self.fd = fd; - self.emit('open', fd); - self._read(); - }) - } - - function WriteStream (path, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path, options); - - Stream.call(this); - - this.path = path; - this.fd = null; - this.writable = true; - - this.flags = 'w'; - this.encoding = 'binary'; - this.mode = 438; /*=0666*/ - this.bytesWritten = 0; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } - - this.pos = this.start; - } - - this.busy = false; - this._queue = []; - - if (this.fd === null) { - this._open = fs.open; - this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); - this.flush(); - } - } -} - - -/***/ }), - -/***/ "./node_modules/graceful-fs/polyfills.js": -/*!***********************************************!*\ - !*** ./node_modules/graceful-fs/polyfills.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var constants = __webpack_require__(/*! constants */ "?4c81") - -var origCwd = process.cwd -var cwd = null - -var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform - -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -try { - process.cwd() -} catch (er) {} - -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -module.exports = patch - -function patch (fs) { - // (re-)implement some things that are known busted or missing. - - // lchmod, broken prior to 0.6.2 - // back-port the fix here. - if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs) - } - - // lutimes implementation, or no-op - if (!fs.lutimes) { - patchLutimes(fs) - } - - // https://github.com/isaacs/node-graceful-fs/issues/4 - // Chown should not fail on einval or eperm if non-root. - // It should not fail on enosys ever, as this just indicates - // that a fs doesn't support the intended operation. - - fs.chown = chownFix(fs.chown) - fs.fchown = chownFix(fs.fchown) - fs.lchown = chownFix(fs.lchown) - - fs.chmod = chmodFix(fs.chmod) - fs.fchmod = chmodFix(fs.fchmod) - fs.lchmod = chmodFix(fs.lchmod) - - fs.chownSync = chownFixSync(fs.chownSync) - fs.fchownSync = chownFixSync(fs.fchownSync) - fs.lchownSync = chownFixSync(fs.lchownSync) - - fs.chmodSync = chmodFixSync(fs.chmodSync) - fs.fchmodSync = chmodFixSync(fs.fchmodSync) - fs.lchmodSync = chmodFixSync(fs.lchmodSync) - - fs.stat = statFix(fs.stat) - fs.fstat = statFix(fs.fstat) - fs.lstat = statFix(fs.lstat) - - fs.statSync = statFixSync(fs.statSync) - fs.fstatSync = statFixSync(fs.fstatSync) - fs.lstatSync = statFixSync(fs.lstatSync) - - // if lchmod/lchown do not exist, then make them no-ops - if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - if (cb) process.nextTick(cb) - } - fs.lchmodSync = function () {} - } - if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - if (cb) process.nextTick(cb) - } - fs.lchownSync = function () {} - } - - // on Windows, A/V software can lock the directory, causing this - // to fail with an EACCES or EPERM if the directory contains newly - // created files. Try again on failure, for up to 60 seconds. - - // Set the timeout this long because some Windows Anti-Virus, such as Parity - // bit9, may lock files for up to a minute, causing npm package install - // failures. Also, take care to yield the scheduler. Windows scheduling gives - // CPU to a busy looping process, which can cause the program causing the lock - // contention to be starved of CPU by node, so the contention doesn't resolve. - if (platform === "win32") { - fs.rename = (function (fs$rename) { return function (from, to, cb) { - var start = Date.now() - var backoff = 0; - fs$rename(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 60000) { - setTimeout(function() { - fs.stat(to, function (stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er) - }) - }, backoff) - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er) - }) - }})(fs.rename) - } - - // if read() returns EAGAIN, then just try it again. - fs.read = (function (fs$read) { - function read (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - - // This ensures `util.promisify` works as it does for native `fs.read`. - read.__proto__ = fs$read - return read - })(fs.read) - - fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return fs$readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } - }})(fs.readSync) - - function patchLchmod (fs) { - fs.lchmod = function (path, mode, callback) { - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - if (callback) callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - if (callback) callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var threw = true - var ret - try { - ret = fs.fchmodSync(fd, mode) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } - } - - function patchLutimes (fs) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - if (er) { - if (cb) cb(er) - return - } - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - if (cb) cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - var ret - var threw = true - try { - ret = fs.futimesSync(fd, at, mt) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } - fs.lutimesSync = function () {} - } - } - - function chmodFix (orig) { - if (!orig) return orig - return function (target, mode, cb) { - return orig.call(fs, target, mode, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } - } - - function chmodFixSync (orig) { - if (!orig) return orig - return function (target, mode) { - try { - return orig.call(fs, target, mode) - } catch (er) { - if (!chownErOk(er)) throw er - } - } - } - - - function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } - } - - function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } - } - - function statFix (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - function callback (er, stats) { - if (stats) { - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - } - if (cb) cb.apply(this, arguments) - } - return options ? orig.call(fs, target, options, callback) - : orig.call(fs, target, callback) - } - } - - function statFixSync (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, options) { - var stats = options ? orig.call(fs, target, options) - : orig.call(fs, target) - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - return stats; - } - } - - // ENOSYS means that the fs doesn't support the op. Just ignore - // that, because it doesn't matter. - // - // if there's no getuid, or if getuid() is something other - // than 0, and the error is EINVAL or EPERM, then just ignore - // it. - // - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // - // When running as root, or if other types of errors are - // encountered, then it's strict. - function chownErOk (er) { - if (!er) - return true - - if (er.code === "ENOSYS") - return true - - var nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true - } - - return false - } -} - - -/***/ }), - -/***/ "./node_modules/imurmurhash/imurmurhash.js": -/*!*************************************************!*\ - !*** ./node_modules/imurmurhash/imurmurhash.js ***! - \*************************************************/ -/***/ ((module) => { - -/** - * @preserve - * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) - * - * @author Jens Taylor - * @see http://github.com/homebrewing/brauhaus-diff - * @author Gary Court - * @see http://github.com/garycourt/murmurhash-js - * @author Austin Appleby - * @see http://sites.google.com/site/murmurhash/ - */ -(function(){ - var cache; - - // Call this function without `new` to use the cached object (good for - // single-threaded environments), or with `new` to create a new object. - // - // @param {string} key A UTF-16 or ASCII string - // @param {number} seed An optional positive integer - // @return {object} A MurmurHash3 object for incremental hashing - function MurmurHash3(key, seed) { - var m = this instanceof MurmurHash3 ? this : cache; - m.reset(seed) - if (typeof key === 'string' && key.length > 0) { - m.hash(key); - } - - if (m !== this) { - return m; - } - }; - - // Incrementally add a string to this hash - // - // @param {string} key A UTF-16 or ASCII string - // @return {object} this - MurmurHash3.prototype.hash = function(key) { - var h1, k1, i, top, len; - - len = key.length; - this.len += len; - - k1 = this.k1; - i = 0; - switch (this.rem) { - case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; - case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; - case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; - case 3: - k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; - k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; - } - - this.rem = (len + this.rem) & 3; // & 3 is same as % 4 - len -= this.rem; - if (len > 0) { - h1 = this.h1; - while (1) { - k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; - k1 = (k1 << 15) | (k1 >>> 17); - k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; - - h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); - h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; - - if (i >= len) { - break; - } - - k1 = ((key.charCodeAt(i++) & 0xffff)) ^ - ((key.charCodeAt(i++) & 0xffff) << 8) ^ - ((key.charCodeAt(i++) & 0xffff) << 16); - top = key.charCodeAt(i++); - k1 ^= ((top & 0xff) << 24) ^ - ((top & 0xff00) >> 8); - } - - k1 = 0; - switch (this.rem) { - case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; - case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; - case 1: k1 ^= (key.charCodeAt(i) & 0xffff); - } - - this.h1 = h1; - } - - this.k1 = k1; - return this; - }; - - // Get the result of this hash - // - // @return {number} The 32-bit hash - MurmurHash3.prototype.result = function() { - var k1, h1; - - k1 = this.k1; - h1 = this.h1; - - if (k1 > 0) { - k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; - k1 = (k1 << 15) | (k1 >>> 17); - k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; - h1 ^= k1; - } - - h1 ^= this.len; - - h1 ^= h1 >>> 16; - h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; - h1 ^= h1 >>> 13; - h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; - h1 ^= h1 >>> 16; - - return h1 >>> 0; - }; - - // Reset the hash object for reuse - // - // @param {number} seed An optional positive integer - MurmurHash3.prototype.reset = function(seed) { - this.h1 = typeof seed === 'number' ? seed : 0; - this.rem = this.k1 = this.len = 0; - return this; - }; - - // A cached object to use. This can be safely used if you're in a single- - // threaded environment, otherwise you need to create new hashes to use. - cache = new MurmurHash3(); - - if (true) { - module.exports = MurmurHash3; - } else {} -}()); - - -/***/ }), - -/***/ "./node_modules/is-buffer/index.js": -/*!*****************************************!*\ - !*** ./node_modules/is-buffer/index.js ***! - \*****************************************/ -/***/ ((module) => { - -/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ - -// The _isBuffer check is for Safari 5-7 support, because it's missing -// Object.prototype.constructor. Remove this eventually -module.exports = function (obj) { - return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) -} - -function isBuffer (obj) { - return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) -} - -// For Node v0.10 support. Remove this eventually. -function isSlowBuffer (obj) { - return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) -} - - -/***/ }), - -/***/ "./node_modules/md5/md5.js": -/*!*********************************!*\ - !*** ./node_modules/md5/md5.js ***! - \*********************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ "./node_modules/md5/md5.js": +/*!*********************************!*\ + !*** ./node_modules/md5/md5.js ***! + \*********************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { (function(){ var crypt = __webpack_require__(/*! crypt */ "./node_modules/crypt/crypt.js"), @@ -7684,368 +6168,6 @@ function plural(ms, msAbs, n, name) { } -/***/ }), - -/***/ "./node_modules/node-localstorage/LocalStorage.js": -/*!********************************************************!*\ - !*** ./node_modules/node-localstorage/LocalStorage.js ***! - \********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -// Generated by CoffeeScript 1.12.7 -(function() { - var JSONStorage, KEY_FOR_EMPTY_STRING, LocalStorage, MetaKey, QUOTA_EXCEEDED_ERR, StorageEvent, _emptyDirectory, _escapeKey, _rm, createMap, events, fs, path, writeSync, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - - path = __webpack_require__(/*! path */ "?0f27"); - - fs = __webpack_require__(/*! fs */ "?65c5"); - - events = __webpack_require__(/*! events */ "./node_modules/events/events.js"); - - writeSync = __webpack_require__(/*! write-file-atomic */ "./node_modules/write-file-atomic/index.js").sync; - - KEY_FOR_EMPTY_STRING = '---.EMPTY_STRING.---'; - - _emptyDirectory = function(target) { - var i, len, p, ref, results; - ref = fs.readdirSync(target); - results = []; - for (i = 0, len = ref.length; i < len; i++) { - p = ref[i]; - results.push(_rm(path.join(target, p))); - } - return results; - }; - - _rm = function(target) { - if (fs.statSync(target).isDirectory()) { - _emptyDirectory(target); - return fs.rmdirSync(target); - } else { - return fs.unlinkSync(target); - } - }; - - _escapeKey = function(key) { - var newKey; - if (key === '') { - newKey = KEY_FOR_EMPTY_STRING; - } else { - newKey = key.toString(); - } - return newKey; - }; - - QUOTA_EXCEEDED_ERR = (function(superClass) { - extend(QUOTA_EXCEEDED_ERR, superClass); - - function QUOTA_EXCEEDED_ERR(message) { - this.message = message != null ? message : 'Unknown error.'; - QUOTA_EXCEEDED_ERR.__super__.constructor.call(this); - if (Error.captureStackTrace != null) { - Error.captureStackTrace(this, this.constructor); - } - this.name = this.constructor.name; - } - - QUOTA_EXCEEDED_ERR.prototype.toString = function() { - return this.name + ": " + this.message; - }; - - return QUOTA_EXCEEDED_ERR; - - })(Error); - - StorageEvent = (function() { - function StorageEvent(key1, oldValue1, newValue1, url, storageArea) { - this.key = key1; - this.oldValue = oldValue1; - this.newValue = newValue1; - this.url = url; - this.storageArea = storageArea != null ? storageArea : 'localStorage'; - } - - return StorageEvent; - - })(); - - MetaKey = (function() { - function MetaKey(key1, index1) { - this.key = key1; - this.index = index1; - if (!(this instanceof MetaKey)) { - return new MetaKey(this.key, this.index); - } - } - - return MetaKey; - - })(); - - createMap = function() { - var Map; - Map = function() {}; - Map.prototype = Object.create(null); - return new Map(); - }; - - LocalStorage = (function(superClass) { - var instanceMap; - - extend(LocalStorage, superClass); - - instanceMap = {}; - - function LocalStorage(_location, quota) { - var handler; - this._location = _location; - this.quota = quota != null ? quota : 5 * 1024 * 1024; - LocalStorage.__super__.constructor.call(this); - if (!(this instanceof LocalStorage)) { - return new LocalStorage(this._location, this.quota); - } - this._location = path.resolve(this._location); - if (instanceMap[this._location] != null) { - return instanceMap[this._location]; - } - this.length = 0; - this._bytesInUse = 0; - this._keys = []; - this._metaKeyMap = createMap(); - this._eventUrl = "pid:" + process.pid; - this._init(); - this._QUOTA_EXCEEDED_ERR = QUOTA_EXCEEDED_ERR; - if (typeof Proxy !== "undefined" && Proxy !== null) { - handler = { - set: (function(_this) { - return function(receiver, key, value) { - if (_this[key] != null) { - return _this[key] = value; - } else { - return _this.setItem(key, value); - } - }; - })(this), - get: (function(_this) { - return function(receiver, key) { - if (_this[key] != null) { - return _this[key]; - } else { - return _this.getItem(key); - } - }; - })(this) - }; - instanceMap[this._location] = new Proxy(this, handler); - return instanceMap[this._location]; - } - instanceMap[this._location] = this; - return instanceMap[this._location]; - } - - LocalStorage.prototype._init = function() { - var _MetaKey, _decodedKey, _keys, e, i, index, k, len, stat; - try { - stat = fs.statSync(this._location); - if ((stat != null) && !stat.isDirectory()) { - throw new Error("A file exists at the location '" + this._location + "' when trying to create/open localStorage"); - } - this._bytesInUse = 0; - this.length = 0; - _keys = fs.readdirSync(this._location); - for (index = i = 0, len = _keys.length; i < len; index = ++i) { - k = _keys[index]; - _decodedKey = decodeURIComponent(k); - this._keys.push(_decodedKey); - _MetaKey = new MetaKey(k, index); - this._metaKeyMap[_decodedKey] = _MetaKey; - stat = this._getStat(k); - if ((stat != null ? stat.size : void 0) != null) { - _MetaKey.size = stat.size; - this._bytesInUse += stat.size; - } - } - this.length = _keys.length; - } catch (error) { - e = error; - if (e.code !== "ENOENT") { - throw e; - } - try { - fs.mkdirSync(this._location, { - recursive: true - }); - } catch (error) { - e = error; - if (e.code !== "EEXIST") { - throw e; - } - } - } - }; - - LocalStorage.prototype.setItem = function(key, value) { - var encodedKey, evnt, existsBeforeSet, filename, hasListeners, metaKey, oldLength, oldValue, valueString, valueStringLength; - hasListeners = events.EventEmitter.listenerCount(this, 'storage'); - oldValue = null; - if (hasListeners) { - oldValue = this.getItem(key); - } - key = _escapeKey(key); - encodedKey = encodeURIComponent(key); - filename = path.join(this._location, encodedKey); - valueString = value.toString(); - valueStringLength = valueString.length; - metaKey = this._metaKeyMap[key]; - existsBeforeSet = !!metaKey; - if (existsBeforeSet) { - oldLength = metaKey.size; - } else { - oldLength = 0; - } - if (this._bytesInUse - oldLength + valueStringLength > this.quota) { - throw new QUOTA_EXCEEDED_ERR(); - } - writeSync(filename, valueString, 'utf8'); - if (!existsBeforeSet) { - metaKey = new MetaKey(encodedKey, (this._keys.push(key)) - 1); - metaKey.size = valueStringLength; - this._metaKeyMap[key] = metaKey; - this.length += 1; - this._bytesInUse += valueStringLength; - } - if (hasListeners) { - evnt = new StorageEvent(key, oldValue, value, this._eventUrl); - return this.emit('storage', evnt); - } - }; - - LocalStorage.prototype.getItem = function(key) { - var filename, metaKey; - key = _escapeKey(key); - metaKey = this._metaKeyMap[key]; - if (!!metaKey) { - filename = path.join(this._location, metaKey.key); - return fs.readFileSync(filename, 'utf8'); - } else { - return null; - } - }; - - LocalStorage.prototype._getStat = function(key) { - var filename; - key = _escapeKey(key); - filename = path.join(this._location, encodeURIComponent(key)); - try { - return fs.statSync(filename); - } catch (error) { - return null; - } - }; - - LocalStorage.prototype.removeItem = function(key) { - var evnt, filename, hasListeners, k, meta, metaKey, oldValue, ref, v; - key = _escapeKey(key); - metaKey = this._metaKeyMap[key]; - if (!!metaKey) { - hasListeners = events.EventEmitter.listenerCount(this, 'storage'); - oldValue = null; - if (hasListeners) { - oldValue = this.getItem(key); - } - delete this._metaKeyMap[key]; - this.length -= 1; - this._bytesInUse -= metaKey.size; - filename = path.join(this._location, metaKey.key); - this._keys.splice(metaKey.index, 1); - ref = this._metaKeyMap; - for (k in ref) { - v = ref[k]; - meta = this._metaKeyMap[k]; - if (meta.index > metaKey.index) { - meta.index -= 1; - } - } - _rm(filename); - if (hasListeners) { - evnt = new StorageEvent(key, oldValue, null, this._eventUrl); - return this.emit('storage', evnt); - } - } - }; - - LocalStorage.prototype.key = function(n) { - var rawKey; - rawKey = this._keys[n]; - if (rawKey === KEY_FOR_EMPTY_STRING) { - return ''; - } else { - return rawKey; - } - }; - - LocalStorage.prototype.clear = function() { - var evnt; - _emptyDirectory(this._location); - this._metaKeyMap = createMap(); - this._keys = []; - this.length = 0; - this._bytesInUse = 0; - if (events.EventEmitter.listenerCount(this, 'storage')) { - evnt = new StorageEvent(null, null, null, this._eventUrl); - return this.emit('storage', evnt); - } - }; - - LocalStorage.prototype._getBytesInUse = function() { - return this._bytesInUse; - }; - - LocalStorage.prototype._deleteLocation = function() { - delete instanceMap[this._location]; - _rm(this._location); - this._metaKeyMap = {}; - this._keys = []; - this.length = 0; - return this._bytesInUse = 0; - }; - - return LocalStorage; - - })(events.EventEmitter); - - JSONStorage = (function(superClass) { - extend(JSONStorage, superClass); - - function JSONStorage() { - return JSONStorage.__super__.constructor.apply(this, arguments); - } - - JSONStorage.prototype.setItem = function(key, value) { - var newValue; - newValue = JSON.stringify(value); - return JSONStorage.__super__.setItem.call(this, key, newValue); - }; - - JSONStorage.prototype.getItem = function(key) { - return JSON.parse(JSONStorage.__super__.getItem.call(this, key)); - }; - - return JSONStorage; - - })(LocalStorage); - - exports.LocalStorage = LocalStorage; - - exports.JSONStorage = JSONStorage; - - exports.QUOTA_EXCEEDED_ERR = QUOTA_EXCEEDED_ERR; - -}).call(this); - - /***/ }), /***/ "./node_modules/shortid/index.js": @@ -9172,139 +7294,6 @@ var createDefaultQueryTester = function (query, options) { //# sourceMappingURL=index.js.map -/***/ }), - -/***/ "./node_modules/slide/lib/async-map.js": -/*!*********************************************!*\ - !*** ./node_modules/slide/lib/async-map.js ***! - \*********************************************/ -/***/ ((module) => { - - -/* -usage: - -// do something to a list of things -asyncMap(myListOfStuff, function (thing, cb) { doSomething(thing.foo, cb) }, cb) -// do more than one thing to each item -asyncMap(list, fooFn, barFn, cb) - -*/ - -module.exports = asyncMap - -function asyncMap () { - var steps = Array.prototype.slice.call(arguments) - , list = steps.shift() || [] - , cb_ = steps.pop() - if (typeof cb_ !== "function") throw new Error( - "No callback provided to asyncMap") - if (!list) return cb_(null, []) - if (!Array.isArray(list)) list = [list] - var n = steps.length - , data = [] // 2d array - , errState = null - , l = list.length - , a = l * n - if (!a) return cb_(null, []) - function cb (er) { - if (er && !errState) errState = er - - var argLen = arguments.length - for (var i = 1; i < argLen; i ++) if (arguments[i] !== undefined) { - data[i - 1] = (data[i - 1] || []).concat(arguments[i]) - } - // see if any new things have been added. - if (list.length > l) { - var newList = list.slice(l) - a += (list.length - l) * n - l = list.length - process.nextTick(function () { - newList.forEach(function (ar) { - steps.forEach(function (fn) { fn(ar, cb) }) - }) - }) - } - - if (--a === 0) cb_.apply(null, [errState].concat(data)) - } - // expect the supplied cb function to be called - // "n" times for each thing in the array. - list.forEach(function (ar) { - steps.forEach(function (fn) { fn(ar, cb) }) - }) -} - - -/***/ }), - -/***/ "./node_modules/slide/lib/bind-actor.js": -/*!**********************************************!*\ - !*** ./node_modules/slide/lib/bind-actor.js ***! - \**********************************************/ -/***/ ((module) => { - -module.exports = bindActor -function bindActor () { - var args = - Array.prototype.slice.call - (arguments) // jswtf. - , obj = null - , fn - if (typeof args[0] === "object") { - obj = args.shift() - fn = args.shift() - if (typeof fn === "string") - fn = obj[ fn ] - } else fn = args.shift() - return function (cb) { - fn.apply(obj, args.concat(cb)) } -} - - -/***/ }), - -/***/ "./node_modules/slide/lib/chain.js": -/*!*****************************************!*\ - !*** ./node_modules/slide/lib/chain.js ***! - \*****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = chain -var bindActor = __webpack_require__(/*! ./bind-actor.js */ "./node_modules/slide/lib/bind-actor.js") -chain.first = {} ; chain.last = {} -function chain (things, cb) { - var res = [] - ;(function LOOP (i, len) { - if (i >= len) return cb(null,res) - if (Array.isArray(things[i])) - things[i] = bindActor.apply(null, - things[i].map(function(i){ - return (i===chain.first) ? res[0] - : (i===chain.last) - ? res[res.length - 1] : i })) - if (!things[i]) return LOOP(i + 1, len) - things[i](function (er, data) { - if (er) return cb(er, res) - if (data !== undefined) res = res.concat(data) - LOOP(i + 1, len) - }) - })(0, things.length) } - - -/***/ }), - -/***/ "./node_modules/slide/lib/slide.js": -/*!*****************************************!*\ - !*** ./node_modules/slide/lib/slide.js ***! - \*****************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -exports.asyncMap = __webpack_require__(/*! ./async-map */ "./node_modules/slide/lib/async-map.js") -exports.bindActor = __webpack_require__(/*! ./bind-actor */ "./node_modules/slide/lib/bind-actor.js") -exports.chain = __webpack_require__(/*! ./chain */ "./node_modules/slide/lib/chain.js") - - /***/ }), /***/ "./node_modules/uuid/dist/esm-browser/index.js": @@ -10163,207 +8152,6 @@ function version(uuid) { /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (version); -/***/ }), - -/***/ "./node_modules/write-file-atomic/index.js": -/*!*************************************************!*\ - !*** ./node_modules/write-file-atomic/index.js ***! - \*************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -var __filename = "/index.js"; - -module.exports = writeFile -module.exports.sync = writeFileSync -module.exports._getTmpname = getTmpname // for testing - -var fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") -var chain = __webpack_require__(/*! slide */ "./node_modules/slide/lib/slide.js").chain -var MurmurHash3 = __webpack_require__(/*! imurmurhash */ "./node_modules/imurmurhash/imurmurhash.js") -var extend = Object.assign || __webpack_require__(/*! util */ "?0bed")._extend - -var invocations = 0 -function getTmpname (filename) { - return filename + '.' + - MurmurHash3(__filename) - .hash(String(process.pid)) - .hash(String(++invocations)) - .result() -} - -function writeFile (filename, data, options, callback) { - if (options instanceof Function) { - callback = options - options = null - } - if (!options) options = {} - fs.realpath(filename, function (_, realname) { - _writeFile(realname || filename, data, options, callback) - }) -} -function _writeFile (filename, data, options, callback) { - var tmpfile = getTmpname(filename) - - if (options.mode && options.chown) { - return thenWriteFile() - } else { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - return fs.stat(filename, function (err, stats) { - if (err || !stats) return thenWriteFile() - - options = extend({}, options) - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - return thenWriteFile() - }) - } - - function thenWriteFile () { - chain([ - [writeFileAsync, tmpfile, data, options.mode, options.encoding || 'utf8'], - options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid], - options.mode && [fs, fs.chmod, tmpfile, options.mode], - [fs, fs.rename, tmpfile, filename] - ], function (err) { - err ? fs.unlink(tmpfile, function () { callback(err) }) - : callback() - }) - } - - // doing this instead of `fs.writeFile` in order to get the ability to - // call `fsync`. - function writeFileAsync (file, data, mode, encoding, cb) { - fs.open(file, 'w', options.mode, function (err, fd) { - if (err) return cb(err) - if (Buffer.isBuffer(data)) { - return fs.write(fd, data, 0, data.length, 0, syncAndClose) - } else if (data != null) { - return fs.write(fd, String(data), 0, String(encoding), syncAndClose) - } else { - return syncAndClose() - } - function syncAndClose (err) { - if (err) return cb(err) - fs.fsync(fd, function (err) { - if (err) return cb(err) - fs.close(fd, cb) - }) - } - }) - } -} - -function writeFileSync (filename, data, options) { - if (!options) options = {} - try { - filename = fs.realpathSync(filename) - } catch (ex) { - // it's ok, it'll happen on a not yet existing file - } - var tmpfile = getTmpname(filename) - - try { - if (!options.mode || !options.chown) { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - try { - var stats = fs.statSync(filename) - options = extend({}, options) - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - } catch (ex) { - // ignore stat errors - } - } - - var fd = fs.openSync(tmpfile, 'w', options.mode) - if (Buffer.isBuffer(data)) { - fs.writeSync(fd, data, 0, data.length, 0) - } else if (data != null) { - fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) - } - fs.fsyncSync(fd) - fs.closeSync(fd) - if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) - if (options.mode) fs.chmodSync(tmpfile, options.mode) - fs.renameSync(tmpfile, filename) - } catch (err) { - try { fs.unlinkSync(tmpfile) } catch (e) {} - throw err - } -} - - -/***/ }), - -/***/ "?b0c0": -/*!************************!*\ - !*** assert (ignored) ***! - \************************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?4c81": -/*!***************************!*\ - !*** constants (ignored) ***! - \***************************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?65c5": -/*!********************!*\ - !*** fs (ignored) ***! - \********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?0f27": -/*!**********************!*\ - !*** path (ignored) ***! - \**********************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?cc48": -/*!************************!*\ - !*** stream (ignored) ***! - \************************/ -/***/ (() => { - -/* (ignored) */ - -/***/ }), - -/***/ "?0bed": -/*!**********************!*\ - !*** util (ignored) ***! - \**********************/ -/***/ (() => { - -/* (ignored) */ - /***/ }) /******/ }); @@ -10404,18 +8192,6 @@ function writeFileSync (filename, data, options) { /******/ }; /******/ })(); /******/ -/******/ /* webpack/runtime/global */ -/******/ (() => { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ })(); -/******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) diff --git a/packages/client/dist/feathersjs-offline-client.js.map b/packages/client/dist/feathersjs-offline-client.js.map index 9ae3cc4..cec6b36 100644 --- a/packages/client/dist/feathersjs-offline-client.js.map +++ b/packages/client/dist/feathersjs-offline-client.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://feathersjsOfflineClient/../src/filter-query.ts","webpack://feathersjsOfflineClient/../src/index.ts","webpack://feathersjsOfflineClient/../src/service.ts","webpack://feathersjsOfflineClient/../src/sort.ts","webpack://feathersjsOfflineClient/../src/hooks.ts","webpack://feathersjsOfflineClient/../src/utils.ts","webpack://feathersjsOfflineClient/./node_modules/@feathersjs/errors/lib/index.js","webpack://feathersjsOfflineClient/./node_modules/debug/src/browser.js","webpack://feathersjsOfflineClient/./node_modules/debug/src/common.js","webpack://feathersjsOfflineClient/../src/common/cryptographic.js","webpack://feathersjsOfflineClient/../src/common/index.js","webpack://feathersjsOfflineClient/../src/common/misc.js","webpack://feathersjsOfflineClient/../src/common/options-proxy.js","webpack://feathersjsOfflineClient/../src/common/to.js","webpack://feathersjsOfflineClient/../src/index.js","webpack://feathersjsOfflineClient/../src/own-common/index.js","webpack://feathersjsOfflineClient/../src/own-common/own-class.js","webpack://feathersjsOfflineClient/../src/owndata/index.js","webpack://feathersjsOfflineClient/../src/ownnet/index.js","webpack://feathersjsOfflineClient/../src/snapshot/index.js","webpack://feathersjsOfflineClient/./node_modules/charenc/charenc.js","webpack://feathersjsOfflineClient/./node_modules/crypt/crypt.js","webpack://feathersjsOfflineClient/./node_modules/events/events.js","webpack://feathersjsOfflineClient/./node_modules/feathers-localstorage/lib/index.js","webpack://feathersjsOfflineClient/./node_modules/feathers-memory/lib/index.js","webpack://feathersjsOfflineClient/./node_modules/feathers-memory/node_modules/sift/src/index.js","webpack://feathersjsOfflineClient/./node_modules/graceful-fs/clone.js","webpack://feathersjsOfflineClient/./node_modules/graceful-fs/graceful-fs.js","webpack://feathersjsOfflineClient/./node_modules/graceful-fs/legacy-streams.js","webpack://feathersjsOfflineClient/./node_modules/graceful-fs/polyfills.js","webpack://feathersjsOfflineClient/./node_modules/imurmurhash/imurmurhash.js","webpack://feathersjsOfflineClient/./node_modules/is-buffer/index.js","webpack://feathersjsOfflineClient/./node_modules/md5/md5.js","webpack://feathersjsOfflineClient/./node_modules/ms/index.js","webpack://feathersjsOfflineClient/./node_modules/node-localstorage/LocalStorage.js","webpack://feathersjsOfflineClient/./node_modules/shortid/index.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/alphabet.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/build.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/generate.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/index.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/is-valid.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/random/random-byte-browser.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/random/random-from-seed.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/util/cluster-worker-id-browser.js","webpack://feathersjsOfflineClient/./node_modules/shortid/node_modules/nanoid/format.browser.js","webpack://feathersjsOfflineClient/./node_modules/sift/es5m/index.js","webpack://feathersjsOfflineClient/./node_modules/slide/lib/async-map.js","webpack://feathersjsOfflineClient/./node_modules/slide/lib/bind-actor.js","webpack://feathersjsOfflineClient/./node_modules/slide/lib/chain.js","webpack://feathersjsOfflineClient/./node_modules/slide/lib/slide.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/index.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/md5.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/nil.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/parse.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/regex.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/rng.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/sha1.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/stringify.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/v1.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/v3.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/v35.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/v4.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/v5.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/validate.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/version.js","webpack://feathersjsOfflineClient/./node_modules/write-file-atomic/index.js","webpack://feathersjsOfflineClient/ignored|assert","webpack://feathersjsOfflineClient/ignored|constants","webpack://feathersjsOfflineClient/ignored|fs","webpack://feathersjsOfflineClient/ignored|path","webpack://feathersjsOfflineClient/ignored|stream","webpack://feathersjsOfflineClient/ignored|util","webpack://feathersjsOfflineClient/webpack/bootstrap","webpack://feathersjsOfflineClient/webpack/runtime/define property getters","webpack://feathersjsOfflineClient/webpack/runtime/global","webpack://feathersjsOfflineClient/webpack/runtime/hasOwnProperty shorthand","webpack://feathersjsOfflineClient/webpack/runtime/make namespace object","webpack://feathersjsOfflineClient/webpack/startup"],"names":["debug","require","FeathersError","msg","name","code","className","data","errors","message","newData","Error","JSON","parse","stringify","type","captureStackTrace","stack","inheritsFrom","Child","Parent","prototype","Object","create","constructor","defineProperty","value","BadRequest","call","NotAuthenticated","PaymentError","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","Timeout","Conflict","Gone","LengthRequired","Unprocessable","TooManyRequests","GeneralError","NotImplemented","BadGateway","Unavailable","convert","error","result","assign","module","exports","formatArgs","save","load","useColors","localstorage","warned","console","warn","window","process","__nwjs","navigator","userAgent","toLowerCase","match","document","documentElement","style","WebkitAppearance","firebug","exception","table","parseInt","RegExp","$1","args","namespace","humanize","diff","c","color","splice","index","lastC","replace","log","namespaces","storage","setItem","removeItem","r","getItem","env","DEBUG","localStorage","formatters","j","v","setup","createDebug","coerce","disable","enable","enabled","destroy","keys","forEach","key","names","skips","selectColor","hash","i","length","charCodeAt","colors","Math","abs","prevTime","enableOverride","self","curr","Number","Date","ms","prev","unshift","format","formatter","val","logFn","apply","extend","enumerable","configurable","get","set","init","delimiter","newDebug","split","len","push","substr","map","toNamespace","join","test","regexp","toString","substring"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,SAAS,KAAT,CAAgB,MAAhB,EAA2B;AACzB,MAAI,OAAO,MAAP,KAAkB,WAAtB,EAAmC;AACjC,WAAO,IAAI,CAAC,GAAL,CAAS,QAAQ,CAAC,MAAD,EAAS,EAAT,CAAjB,CAAP;AACD;;AAED,SAAO,SAAP;AACD,C,CAED;AACA;;;AACA,SAAS,QAAT,CAAmB,KAAnB,EAA+B,QAA/B,EAA4C;AAC1C,MAAI,QAAQ,IAAI,QAAQ,WAAxB,EAAkC;AAChC,QAAM,KAAK,GAAG,OAAO,KAAP,KAAiB,QAAjB,IAA6B,CAAC,KAAK,CAAC,KAAD,CAAnC,GAA6C,KAA7C,GAAqD,QAAQ,WAA3E;AACA,QAAM,KAAK,GAAG,OAAO,QAAQ,CAAC,GAAhB,KAAwB,QAAxB,GAAmC,QAAQ,CAAC,GAA5C,GAAkD,MAAM,CAAC,SAAvE;AAEA,WAAO,IAAI,CAAC,GAAL,CAAS,KAAT,EAAgB,KAAhB,CAAP;AACD;;AAED,SAAO,KAAP;AACD,C,CAED;;;AACA,SAAS,WAAT,CAAsB,IAAtB,EAA+B;AAC7B,MAAI,QAAO,IAAP,MAAgB,QAAhB,IAA4B,KAAK,CAAC,OAAN,CAAc,IAAd,CAAhC,EAAqD;AACnD,WAAO,IAAP;AACD;;AAED,SAAO,MAAM,CAAC,IAAP,CAAY,IAAZ,EAAkB,MAAlB,CAAyB,UAAC,MAAD,EAAS,GAAT,EAAgB;AAC9C,UAAM,CAAC,GAAD,CAAN,GAAc,QAA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AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,cAAc;AACnC;AACA;AACA,KAAK;;AAEL;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA,KAAK;;AAEL;AACA;AACA,wCAAwC,kBAAkB;AAC1D;AACA;AACA,KAAK;;AAEL;AACA;AACA,iCAAiC,uBAAuB;AACxD;AACA;AACA,KAAK;;AAEL;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,iCAAiC,gBAAgB;AACjD;AACA;AACA,KAAK;;AAEL;AACA;AACA,kCAAkC,kBAAkB;AACpD;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;;;;;;AC/FD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA,sCAAsC,QAAQ;AAC9C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA,QAAQ,yBAAyB;AACjC;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;AC3dA,OAAO,UAAU,GAAG,mBAAO,CAAC,oEAAiB;;AAE7C;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL,6BAA6B;AAC7B,6CAA6C,iBAAiB;AAC9D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB;;;;;;;;;;;AC/FtB,eAAe,mBAAO,CAAC,0EAAoB;AAC3C,OAAO,IAAI,GAAG,mBAAO,CAAC,4EAAqB;AAC3C,OAAO,iCAAiC,GAAG,mBAAO,CAAC,4FAA6B;AAChF,aAAa,wGAAuB;;AAEpC;AACA;;AAEA;AACA;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,+BAA+B;AAC/B,WAAW,QAAQ;;AAEnB,sCAAsC;AACtC;AACA;AACA,KAAK;AACL;;AAEA,0BAA0B;AAC1B,WAAW,2BAA2B;AACtC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,6BAA6B;AAC7B;AACA,aAAa,QAAQ;AACrB;;AAEA;AACA;AACA;AACA;;AAEA,yDAAyD,GAAG;AAC5D;;AAEA;AACA,kCAAkC;AAClC;AACA;AACA;;AAEA;AACA,+BAA+B,SAAS,gBAAgB;AACxD;;AAEA;AACA;;AAEA,sCAAsC;AACtC;AACA;AACA;;AAEA,kCAAkC;;AAElC,gCAAgC,SAAS,gBAAgB;;AAEzD;AACA;;AAEA,qCAAqC;AACrC;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,mDAAmD;AACnD;;AAEA;AACA,gCAAgC;AAChC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB;;;;;;;;;;;;;;;;;;AC5ItB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;;AAEA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA,KAAK;AACL,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA,GAAG;;AAEH,qCAAqC,sBAAsB;AAC3D;AACA;AACA;AACA,GAAG;;AAEH,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA,GAAG;AACH,qCAAqC,sBAAsB;AAC3D;AACA;AACA;AACA,GAAG;;AAEH;AACA,WAAW,aAAa;AACxB;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,oCAAoC,KAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oCAAoC,KAAK;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA,+BAA+B,UAAU;AACzC;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,UAAU;AACV;;AAEA;AACA;;AAEA,0BAA0B,wBAAwB;AAClD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,WAAW,IAAI,UAAU;AACpC;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA,0BAA0B,wBAAwB;AAClD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2DAA2D,gBAAgB;AAC3E,0DAA0D,gBAAgB;AAC1E;AACA;;AAEA;AACA,SAAS,0BAA0B;AACnC;AACA;AACA,eAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA,iCAAiC,OAAO;AACxC;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEe;AACf,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEO;AACP;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;;;;;;;;;;;ACrsBY;;AAEZ;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;AClBA,SAAS,mBAAO,CAAC,iBAAI;AACrB,gBAAgB,mBAAO,CAAC,+DAAgB;AACxC,aAAa,mBAAO,CAAC,yEAAqB;AAC1C,YAAY,mBAAO,CAAC,uDAAY;;AAEhC,WAAW,mBAAO,CAAC,mBAAM;;AAEzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,qBAAM;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA,MAAM,gDAAuB;AAC7B,KAAK;AACL;AACA;;AAEA,KAAK,qBAAM;AACX,eAAe,qBAAM;AACrB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACjWA,aAAa,iDAAwB;;AAErC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB;AACpB;;AAEA;;AAEA;AACA;AACA,6CAA6C,gBAAgB;AAC7D;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;;AAEA;;AAEA;AACA;AACA,6CAA6C,gBAAgB;AAC7D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACrHA,gBAAgB,mBAAO,CAAC,wBAAW;;AAEnC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH,yCAAyC;AACzC;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL,8CAA8C;AAC9C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;ACrVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,QAAQ,IAA6B;AACrC;AACA,KAAK,MAAM,EAEN;AACL,CAAC;;;;;;;;;;;ACzID;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACpBA;AACA,cAAc,mBAAO,CAAC,4CAAO;AAC7B,aAAa,4EAAuB;AACpC,iBAAiB,mBAAO,CAAC,oDAAW;AACpC,YAAY,2EAAsB;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,cAAc;;AAEjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;;;;;;;;;;AC/JD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACjKA;AACA;AACA;AACA,sCAAsC,0BAA0B,yDAAyD,EAAE,kBAAkB,0BAA0B,EAAE,mCAAmC,8BAA8B,oCAAoC,cAAc,EAAE;AAC9R,gBAAgB;;AAEhB,SAAS,mBAAO,CAAC,mBAAM;;AAEvB,OAAO,mBAAO,CAAC,iBAAI;;AAEnB,WAAW,mBAAO,CAAC,+CAAQ;;AAE3B,cAAc,8FAAiC;;AAE/C;;AAEA;AACA;AACA;AACA;AACA,iCAAiC,SAAS;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,GAAG;;AAEH,EAAE,oBAAoB;;AAEtB,EAAE,mBAAmB;;AAErB,EAAE,0BAA0B;;AAE5B,CAAC;;;;;;;;;;;;AC/VY;AACb,8FAAuC;;;;;;;;;;;;ACD1B;;AAEb,qBAAqB,mBAAO,CAAC,wFAA2B;;AAExD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtGa;;AAEb,eAAe,mBAAO,CAAC,0DAAY;AACnC,eAAe,mBAAO,CAAC,0DAAY;;AAEnC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC7Ca;;AAEb,eAAe,mBAAO,CAAC,0DAAY;AACnC,aAAa,mBAAO,CAAC,sFAAsB;AAC3C,aAAa,mBAAO,CAAC,mFAAe;;AAEpC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpBa;;AAEb,eAAe,mBAAO,CAAC,0DAAY;AACnC,YAAY,mBAAO,CAAC,oDAAS;AAC7B,cAAc,mBAAO,CAAC,0DAAY;;AAElC;AACA;AACA;AACA;AACA,sBAAsB,mBAAO,CAAC,8FAA0B;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB,mBAAmB;AACnB,qBAAqB;AACrB,yBAAyB;AACzB,sBAAsB;;;;;;;;;;;;AC7DT;AACb,eAAe,mBAAO,CAAC,0DAAY;;AAEnC;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;;;;;;;;;;;;ACda;;AAEb,8EAA8E;;AAE9E;;AAEA;AACA;AACA;AACA,uBAAuB,UAAU;AACjC;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpBa;;AAEb;AACA;;AAEA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACxBa;;AAEb;;;;;;;;;;;ACFA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,+CAA+C,UAAU;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvCA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;;AAEA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,8CAA8C;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,gBAAgB;AACjF,gEAAgE,gBAAgB;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,cAAc;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI,oBAAoB;AACxB;AACA;AACA;AACA;AACA,QAAQ,iBAAiB;AACzB;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,cAAc;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,cAAc;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,4CAA4C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qEAAqE,0DAA0D;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qEAAqE;AACrE;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,oBAAoB;AACrD,+BAA+B;AAC/B;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,EAAE;AACF;AACA,6BAA6B,cAAc;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,cAAc;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oDAAoD,cAAc;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,cAAc;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,wDAAwD,cAAc;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,4FAA4F,0DAA0D,EAAE;AACxJ;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,yDAAyD,oDAAoD;AAC7G,yDAAyD,oDAAoD;AAC7G,0DAA0D,qDAAqD;AAC/G,gEAAgE,2DAA2D;AAC3H,0DAA0D,qDAAqD;AAC/G,yDAAyD,oDAAoD;AAC7G,gDAAgD,sBAAsB,mBAAmB,GAAG,EAAE;AAC9F,iDAAiD,sBAAsB,oBAAoB,GAAG,EAAE;AAChG,gDAAgD,sBAAsB,mBAAmB,GAAG,EAAE;AAC9F,iDAAiD,sBAAsB,oBAAoB,GAAG,EAAE;AAChG;AACA;AACA,6CAA6C,4CAA4C,EAAE;AAC3F;AACA,6DAA6D,wDAAwD;AACrH;AACA;AACA;AACA,0DAA0D,qDAAqD;AAC/G;AACA,6CAA6C,4EAA4E,EAAE;AAC3H;AACA,yDAAyD,oDAAoD;AAC7G;AACA,oDAAoD,wDAAwD;AAC5G,4BAA4B,aAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,wBAAwB,EAAE;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,+BAA+B;AAC/B;AACA;AACA,oCAAoC,qCAAqC;AACzE,KAAK;AACL;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;AACA;;AAEA,iEAAe,wBAAwB,EAAC;AACyP;AACjS;;;;;;;;;;;;AC1nBA;AACA;;AAEA;AACA,8CAA8C,6BAA6B;AAC3E;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,aAAa;AACpD,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,iCAAiC,aAAa;AAC9C,GAAG;AACH;;;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;;;;;ACfA;AACA,gBAAgB,mBAAO,CAAC,+DAAiB;AACzC,gBAAgB,EAAE;AAClB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;;;;;;;;;;ACnBH,kGAAyC;AACzC,qGAA2C;AAC3C,uFAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACFM;AACA;AACA;AACA;AACE;AACQ;AACE;AACE;;;;;;;;;;;;;;;;ACPtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;;AAElD;;AAEA,mBAAmB,gBAAgB;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,aAAa;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iEAAe,GAAG,E;;;;;;;;;;;;;;;ACtNlB,iEAAe,sCAAsC,E;;;;;;;;;;;;;;;;ACAhB;;AAErC;AACA,OAAO,qDAAQ;AACf;AACA;;AAEA;AACA,+BAA+B;;AAE/B;AACA;AACA;AACA,oBAAoB;;AAEpB;AACA,oBAAoB;;AAEpB;AACA,oB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AC7B,SAAS,gDAAG,aAAa,6CAAI;AAC7B,iEAAe,EAAE,E;;;;;;;;;;;;;;;;ACHc;;AAE/B;AACA,qCAAqC,mDAAU;AAC/C;;AAEA,iEAAe,QAAQ,E;;;;;;;;;;;;;;;;ACNc;;AAErC;AACA,OAAO,qDAAQ;AACf;AACA;;AAEA;AACA;;AAEA,iEAAe,OAAO,E;;;;;;;;;;;;ACVV;AACZ;AACA,mBAAmB;AACnB,0BAA0B;;AAE1B,SAAS,mBAAO,CAAC,8DAAa;AAC9B,YAAY,2EAAsB;AAClC,kBAAkB,mBAAO,CAAC,8DAAa;AACvC,8BAA8B,gDAAuB;;AAErD;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,gBAAgB;AAC5D;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,SAAS,yBAAyB;AAClC;AACA;AACA;;;;;;;;;;;AChIA,e;;;;;;;;;;ACAA,e;;;;;;;;;;ACAA,e;;;;;;;;;;ACAA,e;;;;;;;;;;ACAA,e;;;;;;;;;;ACAA,e;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCrBA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,EAAE;WACF;WACA;WACA,CAAC,I;;;;;WCPD,wF;;;;;WCAA;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;UCNA;UACA;UACA;UACA","file":"feathersjs-offline-client.js","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OPERATORS = exports.FILTERS = void 0;\nconst commons_1 = require(\"@feathersjs/commons\");\nconst errors_1 = require(\"@feathersjs/errors\");\nfunction parse(number) {\n if (typeof number !== 'undefined') {\n return Math.abs(parseInt(number, 10));\n }\n return undefined;\n}\n// Returns the pagination limit and will take into account the\n// default and max pagination settings\nfunction getLimit(limit, paginate) {\n if (paginate && paginate.default) {\n const lower = typeof limit === 'number' && !isNaN(limit) ? limit : paginate.default;\n const upper = typeof paginate.max === 'number' ? paginate.max : Number.MAX_VALUE;\n return Math.min(lower, upper);\n }\n return limit;\n}\n// Makes sure that $sort order is always converted to an actual number\nfunction convertSort(sort) {\n if (typeof sort !== 'object' || Array.isArray(sort)) {\n return sort;\n }\n return Object.keys(sort).reduce((result, key) => {\n result[key] = typeof sort[key] === 'object'\n ? sort[key] : parseInt(sort[key], 10);\n return result;\n }, {});\n}\nfunction cleanQuery(query, operators, filters) {\n if (Array.isArray(query)) {\n return query.map(value => cleanQuery(value, operators, filters));\n }\n else if (commons_1._.isObject(query) && query.constructor === {}.constructor) {\n const result = {};\n commons_1._.each(query, (value, key) => {\n if (key[0] === '$') {\n if (filters[key] !== undefined) {\n return;\n }\n if (!operators.includes(key)) {\n throw new errors_1.BadRequest(`Invalid query parameter ${key}`, query);\n }\n }\n result[key] = cleanQuery(value, operators, filters);\n });\n Object.getOwnPropertySymbols(query).forEach(symbol => {\n // @ts-ignore\n result[symbol] = query[symbol];\n });\n return result;\n }\n return query;\n}\nfunction assignFilters(object, query, filters, options) {\n if (Array.isArray(filters)) {\n commons_1._.each(filters, (key) => {\n if (query[key] !== undefined) {\n object[key] = query[key];\n }\n });\n }\n else {\n commons_1._.each(filters, (converter, key) => {\n const converted = converter(query[key], options);\n if (converted !== undefined) {\n object[key] = converted;\n }\n });\n }\n return object;\n}\nexports.FILTERS = {\n $sort: (value) => convertSort(value),\n $limit: (value, options) => getLimit(parse(value), options.paginate),\n $skip: (value) => parse(value),\n $select: (value) => value\n};\nexports.OPERATORS = ['$in', '$nin', '$lt', '$lte', '$gt', '$gte', '$ne', '$or'];\n// Converts Feathers special query parameters and pagination settings\n// and returns them separately a `filters` and the rest of the query\n// as `query`\nfunction filterQuery(query, options = {}) {\n const { filters: additionalFilters = {}, operators: additionalOperators = [] } = options;\n const result = {};\n result.filters = assignFilters({}, query, exports.FILTERS, options);\n result.filters = assignFilters(result.filters, query, additionalFilters, options);\n result.query = cleanQuery(query, exports.OPERATORS.concat(additionalOperators), result.filters);\n return result;\n}\nexports.default = filterQuery;\nif (typeof module !== 'undefined') {\n module.exports = Object.assign(filterQuery, module.exports);\n}\n//# sourceMappingURL=filter-query.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hooks = void 0;\nconst hookUtils = __importStar(require(\"./hooks\"));\n__exportStar(require(\"./utils\"), exports);\nexports.hooks = hookUtils;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AdapterService = void 0;\nconst errors_1 = require(\"@feathersjs/errors\");\nconst filter_query_1 = __importDefault(require(\"./filter-query\"));\nconst callMethod = (self, name, ...args) => {\n if (typeof self[name] !== 'function') {\n return Promise.reject(new errors_1.NotImplemented(`Method ${name} not available`));\n }\n return self[name](...args);\n};\nconst alwaysMulti = {\n find: true,\n get: false,\n update: false\n};\nclass AdapterService {\n constructor(options) {\n this.options = Object.assign({\n id: 'id',\n events: [],\n paginate: {},\n multi: false,\n filters: [],\n whitelist: []\n }, options);\n }\n get id() {\n return this.options.id;\n }\n get events() {\n return this.options.events;\n }\n filterQuery(params = {}, opts = {}) {\n const paginate = typeof params.paginate !== 'undefined'\n ? params.paginate : this.options.paginate;\n const { query = {} } = params;\n const options = Object.assign({\n operators: this.options.whitelist || [],\n filters: this.options.filters,\n paginate\n }, opts);\n const result = filter_query_1.default(query, options);\n return Object.assign(result, { paginate });\n }\n allowsMulti(method) {\n const always = alwaysMulti[method];\n if (typeof always !== 'undefined') {\n return always;\n }\n const option = this.options.multi;\n if (option === true || option === false) {\n return option;\n }\n else {\n return option.includes(method);\n }\n }\n find(params) {\n return callMethod(this, '_find', params);\n }\n get(id, params) {\n return callMethod(this, '_get', id, params);\n }\n create(data, params) {\n if (Array.isArray(data) && !this.allowsMulti('create')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not create multiple entries`));\n }\n return callMethod(this, '_create', data, params);\n }\n update(id, data, params) {\n if (id === null || Array.isArray(data)) {\n return Promise.reject(new errors_1.BadRequest(`You can not replace multiple instances. Did you mean 'patch'?`));\n }\n return callMethod(this, '_update', id, data, params);\n }\n patch(id, data, params) {\n if (id === null && !this.allowsMulti('patch')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not patch multiple entries`));\n }\n return callMethod(this, '_patch', id, data, params);\n }\n remove(id, params) {\n if (id === null && !this.allowsMulti('remove')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not remove multiple entries`));\n }\n return callMethod(this, '_remove', id, params);\n }\n}\nexports.AdapterService = AdapterService;\n//# sourceMappingURL=service.js.map","\"use strict\";\n// Sorting algorithm taken from NeDB (https://github.com/louischatriot/nedb)\n// See https://github.com/louischatriot/nedb/blob/e3f0078499aa1005a59d0c2372e425ab789145c1/lib/model.js#L189\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sorter = exports.compare = exports.compareArrays = exports.compareNSB = void 0;\nfunction compareNSB(a, b) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n}\nexports.compareNSB = compareNSB;\nfunction compareArrays(a, b) {\n let i;\n let comp;\n for (i = 0; i < Math.min(a.length, b.length); i += 1) {\n comp = exports.compare(a[i], b[i]);\n if (comp !== 0) {\n return comp;\n }\n }\n // Common section was identical, longest one wins\n return exports.compareNSB(a.length, b.length);\n}\nexports.compareArrays = compareArrays;\nfunction compare(a, b, compareStrings = exports.compareNSB) {\n const { compareNSB, compare, compareArrays } = exports;\n // undefined\n if (a === undefined) {\n return b === undefined ? 0 : -1;\n }\n if (b === undefined) {\n return a === undefined ? 0 : 1;\n }\n // null\n if (a === null) {\n return b === null ? 0 : -1;\n }\n if (b === null) {\n return a === null ? 0 : 1;\n }\n // Numbers\n if (typeof a === 'number') {\n return typeof b === 'number' ? compareNSB(a, b) : -1;\n }\n if (typeof b === 'number') {\n return typeof a === 'number' ? compareNSB(a, b) : 1;\n }\n // Strings\n if (typeof a === 'string') {\n return typeof b === 'string' ? compareStrings(a, b) : -1;\n }\n if (typeof b === 'string') {\n return typeof a === 'string' ? compareStrings(a, b) : 1;\n }\n // Booleans\n if (typeof a === 'boolean') {\n return typeof b === 'boolean' ? compareNSB(a, b) : -1;\n }\n if (typeof b === 'boolean') {\n return typeof a === 'boolean' ? compareNSB(a, b) : 1;\n }\n // Dates\n if (a instanceof Date) {\n return b instanceof Date ? compareNSB(a.getTime(), b.getTime()) : -1;\n }\n if (b instanceof Date) {\n return a instanceof Date ? compareNSB(a.getTime(), b.getTime()) : 1;\n }\n // Arrays (first element is most significant and so on)\n if (Array.isArray(a)) {\n return Array.isArray(b) ? compareArrays(a, b) : -1;\n }\n if (Array.isArray(b)) {\n return Array.isArray(a) ? compareArrays(a, b) : 1;\n }\n // Objects\n const aKeys = Object.keys(a).sort();\n const bKeys = Object.keys(b).sort();\n let comp = 0;\n for (let i = 0; i < Math.min(aKeys.length, bKeys.length); i += 1) {\n comp = compare(a[aKeys[i]], b[bKeys[i]]);\n if (comp !== 0) {\n return comp;\n }\n }\n return compareNSB(aKeys.length, bKeys.length);\n}\nexports.compare = compare;\n// An in-memory sorting function according to the\n// $sort special query parameter\nfunction sorter($sort) {\n const criteria = Object.keys($sort).map(key => {\n const direction = $sort[key];\n return { key, direction };\n });\n return function (a, b) {\n let compare;\n for (const criterion of criteria) {\n compare = criterion.direction * exports.compare(a[criterion.key], b[criterion.key]);\n if (compare !== 0) {\n return compare;\n }\n }\n return 0;\n };\n}\nexports.sorter = sorter;\n//# sourceMappingURL=sort.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enableHooks = exports.processHooks = exports.getHooks = exports.isHookObject = exports.convertHookData = exports.makeArguments = exports.defaultMakeArguments = exports.createHookObject = exports.ACTIVATE_HOOKS = void 0;\nconst utils_1 = require(\"./utils\");\nconst { each, pick } = utils_1._;\nexports.ACTIVATE_HOOKS = utils_1.createSymbol('__feathersActivateHooks');\nfunction createHookObject(method, data = {}) {\n const hook = {};\n Object.defineProperty(hook, 'toJSON', {\n value() {\n return pick(this, 'type', 'method', 'path', 'params', 'id', 'data', 'result', 'error');\n }\n });\n return Object.assign(hook, data, {\n method,\n // A dynamic getter that returns the path of the service\n get path() {\n const { app, service } = data;\n if (!service || !app || !app.services) {\n return null;\n }\n return Object.keys(app.services)\n .find(path => app.services[path] === service);\n }\n });\n}\nexports.createHookObject = createHookObject;\n// Fallback used by `makeArguments` which usually won't be used\nfunction defaultMakeArguments(hook) {\n const result = [];\n if (typeof hook.id !== 'undefined') {\n result.push(hook.id);\n }\n if (hook.data) {\n result.push(hook.data);\n }\n result.push(hook.params || {});\n return result;\n}\nexports.defaultMakeArguments = defaultMakeArguments;\n// Turns a hook object back into a list of arguments\n// to call a service method with\nfunction makeArguments(hook) {\n switch (hook.method) {\n case 'find':\n return [hook.params];\n case 'get':\n case 'remove':\n return [hook.id, hook.params];\n case 'update':\n case 'patch':\n return [hook.id, hook.data, hook.params];\n case 'create':\n return [hook.data, hook.params];\n }\n return defaultMakeArguments(hook);\n}\nexports.makeArguments = makeArguments;\n// Converts different hook registration formats into the\n// same internal format\nfunction convertHookData(obj) {\n let hook = {};\n if (Array.isArray(obj)) {\n hook = { all: obj };\n }\n else if (typeof obj !== 'object') {\n hook = { all: [obj] };\n }\n else {\n each(obj, function (value, key) {\n hook[key] = !Array.isArray(value) ? [value] : value;\n });\n }\n return hook;\n}\nexports.convertHookData = convertHookData;\n// Duck-checks a given object to be a hook object\n// A valid hook object has `type` and `method`\nfunction isHookObject(hookObject) {\n return typeof hookObject === 'object' &&\n typeof hookObject.method === 'string' &&\n typeof hookObject.type === 'string';\n}\nexports.isHookObject = isHookObject;\n// Returns all service and application hooks combined\n// for a given method and type `appLast` sets if the hooks\n// from `app` should be added last (or first by default)\nfunction getHooks(app, service, type, method, appLast = false) {\n const appHooks = app.__hooks[type][method] || [];\n const serviceHooks = service.__hooks[type][method] || [];\n if (appLast) {\n // Run hooks in the order of service -> app -> finally\n return serviceHooks.concat(appHooks);\n }\n return appHooks.concat(serviceHooks);\n}\nexports.getHooks = getHooks;\nfunction processHooks(hooks, initialHookObject) {\n let hookObject = initialHookObject;\n const updateCurrentHook = (current) => {\n // Either use the returned hook object or the current\n // hook object from the chain if the hook returned undefined\n if (current) {\n if (!isHookObject(current)) {\n throw new Error(`${hookObject.type} hook for '${hookObject.method}' method returned invalid hook object`);\n }\n hookObject = current;\n }\n return hookObject;\n };\n // Go through all hooks and chain them into our promise\n const promise = hooks.reduce((current, fn) => {\n // @ts-ignore\n const hook = fn.bind(this);\n // Use the returned hook object or the old one\n return current.then((currentHook) => hook(currentHook)).then(updateCurrentHook);\n }, Promise.resolve(hookObject));\n return promise.then(() => hookObject).catch(error => {\n // Add the hook information to any errors\n error.hook = hookObject;\n throw error;\n });\n}\nexports.processHooks = processHooks;\n// Add `.hooks` functionality to an object\nfunction enableHooks(obj, methods, types) {\n if (typeof obj.hooks === 'function') {\n return obj;\n }\n const hookData = {};\n types.forEach(type => {\n // Initialize properties where hook functions are stored\n hookData[type] = {};\n });\n // Add non-enumerable `__hooks` property to the object\n Object.defineProperty(obj, '__hooks', {\n configurable: true,\n value: hookData,\n writable: true\n });\n return Object.assign(obj, {\n hooks(allHooks) {\n each(allHooks, (current, type) => {\n // @ts-ignore\n if (!this.__hooks[type]) {\n throw new Error(`'${type}' is not a valid hook type`);\n }\n const hooks = convertHookData(current);\n each(hooks, (_value, method) => {\n if (method !== 'all' && methods.indexOf(method) === -1) {\n throw new Error(`'${method}' is not a valid hook method`);\n }\n });\n methods.forEach(method => {\n // @ts-ignore\n const myHooks = this.__hooks[type][method] || (this.__hooks[type][method] = []);\n if (hooks.all) {\n myHooks.push.apply(myHooks, hooks.all);\n }\n if (hooks[method]) {\n myHooks.push.apply(myHooks, hooks[method]);\n }\n });\n });\n return this;\n }\n });\n}\nexports.enableHooks = enableHooks;\n//# sourceMappingURL=hooks.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createSymbol = exports.makeUrl = exports.isPromise = exports._ = exports.stripSlashes = void 0;\n// Removes all leading and trailing slashes from a path\nfunction stripSlashes(name) {\n return name.replace(/^(\\/+)|(\\/+)$/g, '');\n}\nexports.stripSlashes = stripSlashes;\n// A set of lodash-y utility functions that use ES6\nexports._ = {\n each(obj, callback) {\n if (obj && typeof obj.forEach === 'function') {\n obj.forEach(callback);\n }\n else if (exports._.isObject(obj)) {\n Object.keys(obj).forEach(key => callback(obj[key], key));\n }\n },\n some(value, callback) {\n return Object.keys(value)\n .map(key => [value[key], key])\n .some(([val, key]) => callback(val, key));\n },\n every(value, callback) {\n return Object.keys(value)\n .map(key => [value[key], key])\n .every(([val, key]) => callback(val, key));\n },\n keys(obj) {\n return Object.keys(obj);\n },\n values(obj) {\n return exports._.keys(obj).map(key => obj[key]);\n },\n isMatch(obj, item) {\n return exports._.keys(item).every(key => obj[key] === item[key]);\n },\n isEmpty(obj) {\n return exports._.keys(obj).length === 0;\n },\n isObject(item) {\n return (typeof item === 'object' && !Array.isArray(item) && item !== null);\n },\n isObjectOrArray(value) {\n return typeof value === 'object' && value !== null;\n },\n extend(first, ...rest) {\n return Object.assign(first, ...rest);\n },\n omit(obj, ...keys) {\n const result = exports._.extend({}, obj);\n keys.forEach(key => delete result[key]);\n return result;\n },\n pick(source, ...keys) {\n return keys.reduce((result, key) => {\n if (source[key] !== undefined) {\n result[key] = source[key];\n }\n return result;\n }, {});\n },\n // Recursively merge the source object into the target object\n merge(target, source) {\n if (exports._.isObject(target) && exports._.isObject(source)) {\n Object.keys(source).forEach(key => {\n if (exports._.isObject(source[key])) {\n if (!target[key]) {\n Object.assign(target, { [key]: {} });\n }\n exports._.merge(target[key], source[key]);\n }\n else {\n Object.assign(target, { [key]: source[key] });\n }\n });\n }\n return target;\n }\n};\n// Duck-checks if an object looks like a promise\nfunction isPromise(result) {\n return exports._.isObject(result) &&\n typeof result.then === 'function';\n}\nexports.isPromise = isPromise;\nfunction makeUrl(path, app = {}) {\n const get = typeof app.get === 'function' ? app.get.bind(app) : () => { };\n const env = get('env') || process.env.NODE_ENV;\n const host = get('host') || process.env.HOST_NAME || 'localhost';\n const protocol = (env === 'development' || env === 'test' || (env === undefined)) ? 'http' : 'https';\n const PORT = get('port') || process.env.PORT || 3030;\n const port = (env === 'development' || env === 'test' || (env === undefined)) ? `:${PORT}` : '';\n path = path || '';\n return `${protocol}://${host}${port}/${exports.stripSlashes(path)}`;\n}\nexports.makeUrl = makeUrl;\nfunction createSymbol(name) {\n return typeof Symbol !== 'undefined' ? Symbol(name) : name;\n}\nexports.createSymbol = createSymbol;\n//# sourceMappingURL=utils.js.map","const debug = require('debug')('@feathersjs/errors');\n\nfunction FeathersError (msg, name, code, className, data) {\n msg = msg || 'Error';\n\n let errors;\n let message;\n let newData;\n\n if (msg instanceof Error) {\n message = msg.message || 'Error';\n\n // NOTE (EK): This is typically to handle validation errors\n if (msg.errors) {\n errors = msg.errors;\n }\n } else if (typeof msg === 'object') { // Support plain old objects\n message = msg.message || 'Error';\n data = msg;\n } else { // message is just a string\n message = msg;\n }\n\n if (data) {\n // NOTE(EK): To make sure that we are not messing\n // with immutable data, just make a copy.\n // https://github.com/feathersjs/errors/issues/19\n newData = JSON.parse(JSON.stringify(data));\n\n if (newData.errors) {\n errors = newData.errors;\n delete newData.errors;\n } else if (data.errors) {\n // The errors property from data could be\n // stripped away while cloning resulting newData not to have it\n // For example: when cloning arrays this property\n errors = JSON.parse(JSON.stringify(data.errors));\n }\n }\n\n // NOTE (EK): Babel doesn't support this so\n // we have to pass in the class name manually.\n // this.name = this.constructor.name;\n this.type = 'FeathersError';\n this.name = name;\n this.message = message;\n this.code = code;\n this.className = className;\n this.data = newData;\n this.errors = errors || {};\n\n debug(`${this.name}(${this.code}): ${this.message}`);\n debug(this.errors);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, FeathersError);\n } else {\n this.stack = (new Error()).stack;\n }\n}\n\nfunction inheritsFrom (Child, Parent) {\n Child.prototype = Object.create(Parent.prototype);\n Child.prototype.constructor = Child;\n}\n\ninheritsFrom(FeathersError, Error);\n\n// NOTE (EK): A little hack to get around `message` not\n// being included in the default toJSON call.\nObject.defineProperty(FeathersError.prototype, 'toJSON', {\n value: function () {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n className: this.className,\n data: this.data,\n errors: this.errors\n };\n }\n});\n\n// 400 - Bad Request\nfunction BadRequest (message, data) {\n FeathersError.call(this, message, 'BadRequest', 400, 'bad-request', data);\n}\n\ninheritsFrom(BadRequest, FeathersError);\n\n// 401 - Not Authenticated\nfunction NotAuthenticated (message, data) {\n FeathersError.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);\n}\n\ninheritsFrom(NotAuthenticated, FeathersError);\n\n// 402 - Payment Error\nfunction PaymentError (message, data) {\n FeathersError.call(this, message, 'PaymentError', 402, 'payment-error', data);\n}\n\ninheritsFrom(PaymentError, FeathersError);\n\n// 403 - Forbidden\nfunction Forbidden (message, data) {\n FeathersError.call(this, message, 'Forbidden', 403, 'forbidden', data);\n}\n\ninheritsFrom(Forbidden, FeathersError);\n\n// 404 - Not Found\nfunction NotFound (message, data) {\n FeathersError.call(this, message, 'NotFound', 404, 'not-found', data);\n}\n\ninheritsFrom(NotFound, FeathersError);\n\n// 405 - Method Not Allowed\nfunction MethodNotAllowed (message, data) {\n FeathersError.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);\n}\n\ninheritsFrom(MethodNotAllowed, FeathersError);\n\n// 406 - Not Acceptable\nfunction NotAcceptable (message, data) {\n FeathersError.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);\n}\n\ninheritsFrom(NotAcceptable, FeathersError);\n\n// 408 - Timeout\nfunction Timeout (message, data) {\n FeathersError.call(this, message, 'Timeout', 408, 'timeout', data);\n}\n\ninheritsFrom(Timeout, FeathersError);\n\n// 409 - Conflict\nfunction Conflict (message, data) {\n FeathersError.call(this, message, 'Conflict', 409, 'conflict', data);\n}\n\ninheritsFrom(Conflict, FeathersError);\n\n// 410 - Gone\nfunction Gone (message, data) {\n FeathersError(this, message, 'Gone', 410, 'gone', data);\n}\n\ninheritsFrom(Gone, FeathersError);\n\n// 411 - Length Required\nfunction LengthRequired (message, data) {\n FeathersError.call(this, message, 'LengthRequired', 411, 'length-required', data);\n}\n\ninheritsFrom(LengthRequired, FeathersError);\n\n// 422 Unprocessable\nfunction Unprocessable (message, data) {\n FeathersError.call(this, message, 'Unprocessable', 422, 'unprocessable', data);\n}\n\ninheritsFrom(Unprocessable, FeathersError);\n\n// 429 Too Many Requests\nfunction TooManyRequests (message, data) {\n FeathersError.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);\n}\n\ninheritsFrom(TooManyRequests, FeathersError);\n\n// 500 - General Error\nfunction GeneralError (message, data) {\n FeathersError.call(this, message, 'GeneralError', 500, 'general-error', data);\n}\n\ninheritsFrom(GeneralError, FeathersError);\n\n// 501 - Not Implemented\nfunction NotImplemented (message, data) {\n FeathersError.call(this, message, 'NotImplemented', 501, 'not-implemented', data);\n}\n\ninheritsFrom(NotImplemented, FeathersError);\n\n// 502 - Bad Gateway\nfunction BadGateway (message, data) {\n FeathersError.call(this, message, 'BadGateway', 502, 'bad-gateway', data);\n}\n\ninheritsFrom(BadGateway, FeathersError);\n\n// 503 - Unavailable\nfunction Unavailable (message, data) {\n FeathersError.call(this, message, 'Unavailable', 503, 'unavailable', data);\n}\n\ninheritsFrom(Unavailable, FeathersError);\n\nconst errors = {\n FeathersError,\n BadRequest,\n NotAuthenticated,\n PaymentError,\n Forbidden,\n NotFound,\n MethodNotAllowed,\n NotAcceptable,\n Timeout,\n Conflict,\n Gone,\n LengthRequired,\n Unprocessable,\n TooManyRequests,\n GeneralError,\n NotImplemented,\n BadGateway,\n Unavailable,\n 400: BadRequest,\n 401: NotAuthenticated,\n 402: PaymentError,\n 403: Forbidden,\n 404: NotFound,\n 405: MethodNotAllowed,\n 406: NotAcceptable,\n 408: Timeout,\n 409: Conflict,\n 410: Gone,\n 411: LengthRequired,\n 422: Unprocessable,\n 429: TooManyRequests,\n 500: GeneralError,\n 501: NotImplemented,\n 502: BadGateway,\n 503: Unavailable\n};\n\nfunction convert (error) {\n if (!error) {\n return error;\n }\n\n const FeathersError = errors[error.name];\n const result = FeathersError\n ? new FeathersError(error.message, error.data)\n : new Error(error.message || error);\n\n if (typeof error === 'object') {\n Object.assign(result, error);\n }\n\n return result;\n}\n\nmodule.exports = Object.assign({ convert }, errors);\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","// Simply \"stolen\" from feathers-offline-xxx\nconst md5 = require('md5');\nconst { v4: uuidV4 } = require('uuid');\nconst shortid = require('shortid');\nconst { stripProps } = require('./misc');\n// Integrity of short unique identifiers: https://github.com/dylang/shortid/issues/81#issuecomment-259812835\nfunction genUuid(ifShortUuid) {\n return ifShortUuid ? shortid.generate() : uuidV4();\n}\nfunction hash(value) {\n value = typeof value === 'string' ? value : JSON.stringify(value);\n return md5(value);\n}\nfunction hashOfRecord(record) {\n return hash(stripProps(record, ['id', '_id']));\n}\nmodule.exports = {\n genUuid,\n hash,\n hashOfRecord\n};\n//# sourceMappingURL=cryptographic.js.map","const to = require('./to');\nconst cryptographic = require('./cryptographic');\nconst misc = require('./misc');\nconst OptionsProxy = require('./options-proxy');\nmodule.exports = Object.assign(Object.assign(Object.assign({ to }, cryptographic), misc), { OptionsProxy });\n//# sourceMappingURL=index.js.map","function isObject(value) {\n return typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\nfunction stripProps(obj, blacklist) {\n blacklist = Array.isArray(blacklist) ? blacklist : (blacklist || []);\n const res = {};\n Object.keys(obj).forEach(prop => {\n if (blacklist.indexOf(prop) === -1) {\n const value = obj[prop];\n res[prop] = isObject(value) ? stripProps(value, blacklist) : value;\n }\n });\n return res;\n}\nmodule.exports = {\n isObject,\n stripProps\n};\n//# sourceMappingURL=misc.js.map","let depends = {};\nlet watchingFn = [];\nlet ix = 0;\nmodule.exports = class OptionsProxy {\n constructor(name) {\n if (name === undefined) {\n throw new Error(`OptionsProxy: Sorry, you must supply a name to proxy.`);\n }\n // if (depends[name]) {\n // throw new Error(`OptionsProxy: Sorry, you have already proxied '${name}'.`);\n // }\n this.name = name /*+ ++ix*/;\n depends[this.name] = [];\n watchingFn[this.name] = null;\n }\n /**\n * Package the data to be observed in a proxy that updates according to\n * relevant recipes registered with watcher().\n * @param {object} data The data object to observe\n */\n observe(data) {\n let self = this;\n return new Proxy(data, {\n get(obj, key) {\n if (watchingFn[self.name]) {\n if (!depends[self.name][key])\n depends[self.name][key] = [];\n depends[self.name][key].push(watchingFn[self.name]);\n }\n return obj[key];\n },\n set(obj, key, val) {\n obj[key] = val;\n if (depends[self.name][key])\n depends[self.name][key].forEach(cb => cb());\n return true;\n }\n });\n }\n /**\n * Register a handler for the observer proxy\n * @param {function} target The handler function\n */\n watcher(target) {\n watchingFn[this.name] = target;\n target();\n watchingFn[this.name] = null;\n }\n};\n//# sourceMappingURL=options-proxy.js.map","/**\n * Transforms a promise for \"await\" to return both error and result so you don't\n * have to wrap promises in try catch\n * @example ```\n * let [ error, result ] = await to(promise)\n * ```\n * @author Jon Paul Miles\n */\nconst to = function (promise) {\n return promise.then(result => [null, result]).catch(err => [err, null]);\n};\nmodule.exports = to;\n//# sourceMappingURL=to.js.map","// Main module for client\nconst { to, isObject, stripProps, genUuid, hash, hashOfRecord } = require('./common');\nconst { Owndata, owndataWrapper } = require('./owndata');\nconst { Ownnet, ownnetWrapper } = require('./ownnet');\nmodule.exports = {\n to, isObject, stripProps, genUuid, hash, hashOfRecord,\n Owndata, owndataWrapper,\n Ownnet, ownnetWrapper\n};\n//# sourceMappingURL=index.js.map","const OwnClass = require('./own-class');\nmodule.exports = OwnClass;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst sift_1 = __importDefault(require(\"sift\"));\nconst adapter_commons_1 = require(\"@feathersjs/adapter-commons\");\nconst errors_1 = __importDefault(require(\"@feathersjs/errors\"));\nconst feathers_localstorage_1 = __importDefault(require(\"feathers-localstorage\"));\nconst common_1 = require(\"../common\");\nconst snapshot_1 = __importDefault(require(\"../snapshot\"));\nconst debug = require('debug')('@feathersjs-offline:ownclass:service-base');\nconst defaultOptions = {\n 'id': 'id',\n 'store': null,\n 'storage': null,\n 'useShortUuid': true,\n 'throttle': null,\n 'timedSync': 24 * 60 * 60 * 1000,\n 'adapterTest': false,\n 'matcher': sift_1.default,\n sorter: adapter_commons_1.sorter,\n 'fixedName': ''\n};\nconst BOT = new Date(0);\nconst _adapterTestStrip = ['uuid', 'updatedAt', 'onServerAt', 'deletedAt'];\nlet nameIx = 0;\nconst attrStrip = (...attr) => {\n return (res) => {\n let result;\n if (Array.isArray(res)) {\n result = [];\n res.map((v, i, arr) => {\n let obj = clone(arr[i]);\n attr.forEach(a => delete obj[a]);\n result.push(obj);\n });\n }\n else {\n result = clone(res);\n attr.forEach(a => delete result[a]);\n }\n return result;\n };\n};\nclass OwnClass extends adapter_commons_1.AdapterService {\n constructor(opts) {\n let newOpts = Object.assign({}, defaultOptions, opts);\n debug(`Constructor started, newOpts = ${JSON.stringify(newOpts)}`);\n super(newOpts);\n this.wrapperOptions = Object.assign({}, newOpts, this.options);\n debug(`Constructor ended, options = ${JSON.stringify(this.options)}`);\n this.type = 'own-class';\n debug(' Done.');\n return this;\n }\n _setup(app, path) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`_SetUp('${path}') started`);\n return this.setup(app, path);\n });\n }\n setup(app, path) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`SetUp('${path}') started`);\n if (this._setupPerformed) { // Assure we only run setup once\n return;\n }\n this._setupPerformed = true;\n if (typeof localStorage === 'undefined') {\n debug('Simulating localStorage...');\n let LocalStorage = require('node-localstorage').LocalStorage;\n global.localStorage = new LocalStorage('./.scratch');\n }\n else {\n debug('Utilizing built-in localStorage');\n }\n this.options = this.wrapperOptions;\n let self = this;\n this.thisName = this.options.fixedName !== '' ? this.options.fixedName : `${this.type}_offline_${nameIx++}_${path}`;\n // Now we are ready to define the path with its underlying service (the remoteService)\n let old = app.service(path);\n if (old !== self) {\n this.remoteService = old; // We want to get the default service (redirects to server or points to a local service)\n app.use(path, self); // Install this service instance\n }\n // Get the service name and standard settings\n this.name = path;\n // Construct the two helper services\n this.localServiceName = this.thisName + '_local';\n this.localServiceQueue = this.thisName + '_queue';\n this.storage = this.options.storage ? this.options.storage : localStorage;\n this.localSpecOptions = { name: this.localServiceName, storage: this.storage, store: this.options.store, reuseKeys: this.options.fixedName !== '' };\n let localOptions = Object.assign({}, this.options, this.localSpecOptions);\n let queueOptions = { id: 'id', name: this.localServiceQueue, storage: this.storage, paginate: null, multi: true, reuseKeys: this.options.fixedName !== '' };\n debug(` Setting up services '${this.localServiceName}' and '${this.localServiceQueue}'...`);\n app.use(this.localServiceName, feathers_localstorage_1.default(localOptions));\n app.use(this.localServiceQueue, feathers_localstorage_1.default(queueOptions));\n this.localService = app.service(this.localServiceName);\n this.localQueue = app.service(this.localServiceQueue);\n // We need to make sure that localService is properly initiated - make a dummy search\n // (one of the quirks of feathers-localstorage)\n yield this.localService.ready();\n // The initialization/setup of the localService adapter screws-up our options object\n this.options = this.wrapperOptions;\n // Are we running adapterTests?\n if (this.options.adapterTest) {\n // Make sure the '_adapterTestStrip' attributes are stripped from results\n // However, we need to allow for having uuid as key\n let stripValues = Object.assign([], _adapterTestStrip);\n let idIx = stripValues.findIndex(v => { return v === self.id; });\n if (idIx > -1)\n stripValues.splice(idIx, 1);\n this._strip = attrStrip(...stripValues);\n }\n else {\n this._strip = v => { return v; };\n }\n // Make sure we always select the key (id) in our results\n this._select = (params, ...others) => (res) => { return adapter_commons_1.select(params, ...others, self.id)(res); };\n // Initialize the service wrapper\n this.listening = false;\n this.aIP = 0; // Our semaphore for internal processing\n this.pQActive = false; // Our flag for avoiding more than one processing of queued operations at a time\n // Determine latest registered sync timestamp\n this.syncedAt = new Date(this.storage.getItem(this.thisName + '_syncedAt') || 0).toISOString();\n this.storage.setItem(this.thisName + '_syncedAt', new Date(this.syncedAt).toISOString());\n // This is necessary if we get updates to options (e.g. .options.multi = ['patch'])\n if (!(this.remoteService instanceof adapter_commons_1.AdapterService)) {\n this._listenOptions();\n }\n // Make sure that the wrapped service is setup correctly\n if (typeof this.remoteService.setup === 'function') {\n this.remoteService.setup(app, path);\n }\n // Should we perform a sync every timedSync?\n if (this.options.timedSync && Number.isInteger(this.options.timedSync) && this.options.timedSync > 0) {\n this._timedSyncHandle = setInterval(() => self.sync(), self.options.timedSync);\n }\n debug(' Done.');\n return true;\n });\n }\n _listenOptions() {\n // This is necessary if we get updates to options (e.g. .options.multi = ['patch'])\n let self = this;\n let optProxy = new common_1.OptionsProxy(self.thisName);\n this.options = optProxy.observe(Object.assign({}, self.remoteService.options ? self.remoteService.options : {}, self.options));\n optProxy.watcher(() => {\n // Update all changes to 'this.options' in both localService and remoteService\n self.remoteService.options = Object.assign({}, self.remoteService.options, self.options);\n self.localService.options = Object.assign({}, self.options, self.localSpecOptions);\n });\n }\n getEntries(params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling getEntries(${JSON.stringify(params)}})`);\n let res = [];\n yield this.localService.getEntries(params)\n .then(entries => {\n res = entries;\n });\n return Promise.resolve(res)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n get(id, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling get(${JSON.stringify(id)}, ${JSON.stringify(params)}})`);\n return this._get(id, params);\n });\n }\n _get(id, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _get(${JSON.stringify(id)}, ${JSON.stringify(params)}})`);\n return yield this.localService.get(id, params)\n .then(this._strip)\n .then(this._select(params))\n .catch(err => { throw err; });\n });\n }\n find(params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling find(${JSON.stringify(params)}})`);\n debug(` rows=${JSON.stringify(yield this.getEntries())}`);\n return this._find(params);\n });\n }\n _find(params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _find(${JSON.stringify(params)}})`);\n return this.localService.find(params)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n ;\n create(data, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling create(${JSON.stringify(data)}, ${JSON.stringify(params)})`);\n if (Array.isArray(data) && !this.allowsMulti('create')) {\n return Promise.reject(new errors_1.default.MethodNotAllowed('Creating multiple without option \\'multi\\' set'));\n }\n return this._create(data, params);\n });\n }\n _create(data, params, ts = 0) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _create(${JSON.stringify(data)}, ${JSON.stringify(params)}, ${ts})`);\n let self = this;\n if (Array.isArray(data)) {\n const multi = this.allowsMulti('create');\n if (!multi) {\n return Promise.reject(new errors_1.default.MethodNotAllowed('Creating multiple without option \\'multi\\' set'));\n }\n let timestamp = new Date();\n // In future version we will user Promise.allSettled() instead...\n return Promise.all(data.map(current => self._create(current, params, timestamp)));\n }\n ts = ts || new Date();\n let newData = clone(data);\n // As we do not know if the server is connected we have to make sure the important\n // values are set with reasonable values\n if (!('uuid' in newData)) {\n newData.uuid = common_1.genUuid(this.options.useShortUuid);\n }\n if (!('updatedAt' in newData)) {\n newData.updatedAt = ts;\n }\n // We do not allow the client to set the onServerAt attribute to other than default '0'\n newData.onServerAt = BOT;\n // Is uuid unique?\n let [err, res] = yield common_1.to(this.localService.find({ query: { 'uuid': newData.uuid } }));\n if (res && res.length) {\n throw new errors_1.default.BadRequest(`Optimistic create requires unique uuid. (${this.type}) res=${JSON.stringify(res)}`);\n }\n // We apply optimistic mutation\n let newParams = clone(params);\n this.disallowInternalProcessing('_create');\n let queueId = yield this._addQueuedEvent('create', newData, clone(newData), params);\n // Start actual mutation on remote service\n [err, res] = yield common_1.to(this.localService.create(newData, clone(params)));\n if (res) {\n this.remoteService.create(res, clone(params))\n .then((rres) => __awaiter(this, void 0, void 0, function* () {\n yield common_1.to(self._removeQueuedEvent('_create0', queueId, newData, newData.updatedAt));\n yield self._patchIfNotRemoved(rres[self.id], rres);\n // Ok, we have connection - empty queue if we have any items queued\n self.allowInternalProcessing('_create0');\n yield common_1.to(self._processQueuedEvents());\n }))\n .catch((rerr) => __awaiter(this, void 0, void 0, function* () {\n if (rerr.name !== 'Timeout') {\n // Let's silently ignore missing connection to server -\n // we'll catch-up next time we get a connection\n // In all other cases do the following:\n yield common_1.to(self._removeQueuedEvent('_create1', queueId, rerr.message /*newData*/, newData.updatedAt));\n yield common_1.to(self.localService.remove(res[self.id], params));\n }\n self.allowInternalProcessing('_create1');\n }));\n }\n else {\n yield common_1.to(this._removeQueuedEvent('_create2', queueId, newData, newData.updatedAt));\n this.allowInternalProcessing('_create2');\n throw err;\n }\n return Promise.resolve(res)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n update(id, data, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling update(${id}, ${JSON.stringify(data)}, ${JSON.stringify(params)}})`);\n if (id === null || Array.isArray(data)) {\n return Promise.reject(new errors_1.default.BadRequest(`You can not replace multiple instances. Did you mean 'patch'?`));\n }\n return this._update(id, data, params);\n });\n }\n _update(id, data, params = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _update(${id}, ${JSON.stringify(data)}, ${JSON.stringify(params)}})`);\n let self = this;\n if (id === null || Array.isArray(data)) {\n return Promise.reject(new errors_1.default.BadRequest(`You can not replace multiple instances. Did you mean 'patch'?`));\n }\n let [err, res] = yield common_1.to(this.localService._get(id));\n if (!(res && res !== {})) {\n throw new errors_1.default.NotFound(`Trying to update non-existing ${this.id}=${id}. (${this.type}) err=${JSON.stringify(err.name)}`);\n }\n // We don't want our uuid to change type if it can be coerced\n const beforeRecord = clone(res);\n const beforeUuid = beforeRecord.uuid;\n let newData = clone(data);\n newData.uuid = beforeUuid; // eslint-disable-line\n newData.updatedAt = new Date();\n newData.onServerAt = BOT;\n // Optimistic mutation\n this.disallowInternalProcessing('_update');\n let queueId = yield this._addQueuedEvent('update', newData, id, clone(newData), params);\n // Start actual mutation on remote service\n [err, res] = yield common_1.to(this.localService.update(id, newData, clone(params)));\n if (!err) {\n this.remoteService.update(id, res, clone(params))\n .then((rres) => __awaiter(this, void 0, void 0, function* () {\n yield common_1.to(self._removeQueuedEvent('_update0', queueId, newData, res.updatedAt));\n yield self._patchIfNotRemoved(rres[self.id], rres);\n self.allowInternalProcessing('_update0');\n yield common_1.to(self._processQueuedEvents());\n }))\n .catch((rerr) => __awaiter(this, void 0, void 0, function* () {\n if (rerr.name === 'Timeout') {\n debug(`_update TIMEOUT: ${rerr.name}, ${rerr.message}`);\n // Let's silently ignore missing connection to server\n // We'll catch-up next time we get a connection\n }\n else {\n debug(`_update ERROR: ${rerr.name}, ${rerr.message}`);\n yield common_1.to(self._removeQueuedEvent('_update1', queueId, newData, res.updatedAt));\n yield common_1.to(self.localService.patch(id, beforeRecord));\n }\n self.allowInternalProcessing('_update1');\n }));\n }\n else {\n yield common_1.to(this._removeQueuedEvent('_update2', queueId, newData, newData.updatedAt));\n this.allowInternalProcessing('_update2');\n throw err;\n }\n return Promise.resolve(newData)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n patch(id, data, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling patch(${id}, ${JSON.stringify(data)}, ${JSON.stringify(params)}})`);\n if (id === null && !this.allowsMulti('patch')) {\n return Promise.reject(new errors_1.default.MethodNotAllowed(`Can not patch multiple entries`));\n }\n return this._patch(id, data, params);\n });\n }\n _patch(id, data, params = {}, ts = 0) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _patch(${id}, ${JSON.stringify(data)}, ${JSON.stringify(params)}})`);\n let self = this;\n if (id === null) {\n const multi = this.allowsMulti('patch');\n if (!multi) {\n throw new errors_1.default.MethodNotAllowed('Patching multiple without option \\'multi\\' set');\n }\n return this.find(params).then(page => {\n const res = page.data ? page.data : page;\n if (!Array.isArray(res)) {\n res = [res];\n }\n let timestamp = new Date().toISOString();\n return Promise.all(res.map(current => self._patch(current[this.id], data, params, timestamp)));\n });\n }\n ts = ts || new Date();\n let [err, res] = yield common_1.to(this.localService._get(id));\n if (!(res && res !== {})) {\n throw err;\n }\n // Optimistic mutation\n const beforeRecord = clone(res);\n const newData = Object.assign({}, beforeRecord, data);\n newData.onServerAt = BOT;\n newData.updatedAt = ts;\n this.disallowInternalProcessing('_patch');\n const queueId = yield this._addQueuedEvent('patch', newData, id, clone(newData), params);\n // Start actual mutation on remote service\n [err, res] = yield common_1.to(this.localService.patch(id, newData, clone(params)));\n if (res) {\n this.remoteService.patch(id, res, clone(params))\n .then((rres) => __awaiter(this, void 0, void 0, function* () {\n yield common_1.to(self._removeQueuedEvent('_patch0', queueId, rres, res.updatedAt));\n yield self._patchIfNotRemoved(rres[self.id], rres);\n self.allowInternalProcessing('_patch0');\n yield common_1.to(self._processQueuedEvents());\n }))\n .catch((rerr) => __awaiter(this, void 0, void 0, function* () {\n if (rerr.name === 'Timeout') {\n debug(`_patch TIMEOUT: ${rerr.name}, ${rerr.message}`);\n // Let's silently ignore missing connection to server\n // We'll catch-up next time we get a connection\n }\n else {\n debug(`_patch ERROR: ${rerr.name}, ${rerr.message}`);\n yield common_1.to(self._removeQueuedEvent('_patch1', queueId, newData, res.updatedAt));\n yield common_1.to(self.localService.patch(id, beforeRecord));\n }\n self.allowInternalProcessing('_patch1');\n }));\n }\n else {\n yield common_1.to(this._removeQueuedEvent('_patch2', queueId, newData, newData.updatedAt));\n this.allowInternalProcessing('_patch2');\n throw err;\n }\n return Promise.resolve(newData)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n /**\n * An internal method to patch a localService record if and only if\n * we have not been overtaken by a remove request.\n *\n * @param {any} id\n * @param {any} data\n */\n _patchIfNotRemoved(id, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.localService.patch(id, data)\n .catch(_ => Promise.resolve(true));\n });\n }\n remove(id, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling remove(${id}, ${JSON.stringify(params)}})`);\n if (id === null && !this.allowsMulti('remove')) {\n return Promise.reject(new errors_1.default.MethodNotAllowed(`Can not remove multiple entries`));\n }\n return this._remove(id, params);\n });\n }\n _remove(id, params = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _remove(${id}, ${JSON.stringify(params)}})`);\n let self = this;\n if (id === null) {\n const multi = this.allowsMulti('remove');\n if (!multi) {\n throw new errors_1.default.MethodNotAllowed('Removing multiple without option \\'multi\\' set');\n }\n return this.find(params).then(page => {\n const res = page.data ? page.data : page;\n if (!Array.isArray(res)) {\n res = [res];\n }\n return Promise.all(res.map(current => self._remove(current[this.id], params)));\n });\n }\n let [err, res] = yield common_1.to(this.localService._get(id));\n if (!(res && res !== {})) {\n throw new errors_1.default.BadRequest(`Trying to remove non-existing ${this.id}=${id}. (${this.type}) err=${JSON.stringify(err)}, res=${JSON.stringify(res)}`);\n }\n // Optimistic mutation\n const beforeRecord = clone(res);\n this.disallowInternalProcessing('_remove');\n const queueId = yield this._addQueuedEvent('remove', beforeRecord, id, params);\n // Start actual mutation on remote service\n [err, res] = yield common_1.to(this.localService.remove(id, clone(params)));\n if (!err) {\n this.remoteService.remove(id, clone(params))\n .then((rres) => __awaiter(this, void 0, void 0, function* () {\n yield common_1.to(self._removeQueuedEvent('_remove0', queueId, beforeRecord, null));\n self.allowInternalProcessing('_remove0');\n yield common_1.to(self._processQueuedEvents());\n }))\n .catch((rerr) => __awaiter(this, void 0, void 0, function* () {\n if (rerr.name === 'Timeout') {\n debug(`_remove TIMEOUT: ${rerr.name}, ${rerr.message}`);\n }\n else {\n debug(`_remove ERROR: ${rerr.name}, ${rerr.message}\\nbeforeRecord = ${JSON.stringify(beforeRecord)}`);\n // if (beforeRecord.onServerAt === BOT) {\n // In all likelihood the document/item was never on the server\n // so we choose to silently ignore this situation\n // } else {\n // We have to restore the record to the local DB\n yield common_1.to(self._removeQueuedEvent('_remove1', queueId, beforeRecord, null));\n yield common_1.to(self.localService.create(beforeRecord, null));\n // }\n }\n self.allowInternalProcessing('_remove1');\n }));\n }\n else {\n yield common_1.to(this._removeQueuedEvent('_remove2', queueId, beforeRecord, null));\n this.allowInternalProcessing('_remove2');\n throw err;\n }\n return Promise.resolve(beforeRecord)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n // Allow access to our internal services (for application hooks and the demo). Use with care!\n get remote() {\n return this.remoteService;\n }\n set remote(value) {\n throw new errors_1.default.Forbidden(`You cannot change value of remote!`);\n }\n get local() {\n return this.localService;\n }\n set local(value) {\n throw new errors_1.default.Forbidden(`You cannot change value of local!`);\n }\n get queue() {\n return this.localQueue;\n }\n set queue(value) {\n throw new errors_1.default.Forbidden(`You cannot change value of queue!`);\n }\n /* Queue handling */\n /**\n * Allow queue processing (allowed when semaphore this.aIP === 0)\n */\n allowInternalProcessing(from) {\n debug(`allowInternalProcessing: ${from} ${this.thisName} ${this.aIP - 1}`);\n this.aIP--;\n }\n /**\n * Disallow queue processing (when semaphore this.aIP !== 0)\n */\n disallowInternalProcessing(from) {\n debug(`disallowInternalProcessing: ${from} ${this.thisName} ${this.aIP + 1}`);\n this.aIP++;\n }\n /**\n * Is queue processing allowed?\n */\n internalProcessingAllowed() {\n return this.aIP === 0;\n }\n _addQueuedEvent(eventName, localRecord, arg1, arg2, arg3) {\n return __awaiter(this, void 0, void 0, function* () {\n debug('addQueuedEvent entered');\n let [err, res] = yield common_1.to(this.localQueue.create({ eventName, record: localRecord, arg1, arg2, arg3 }));\n debug(`addQueuedEvent added: ${JSON.stringify(res)}`);\n return Promise.resolve(res.id);\n });\n }\n _removeQueuedEvent(eventName, id, localRecord, updatedAt) {\n return __awaiter(this, void 0, void 0, function* () {\n debug('removeQueuedEvent entered');\n const [err, res] = yield common_1.to(this.localQueue.remove(id));\n return Promise.resolve(res);\n });\n }\n /**\n * This method must be implemented in own-data and own-net classes extending this class\n */\n _processQueuedEvents() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new errors_1.default.NotImplemented(`_processQueuedEvents must be implemented!!!`);\n });\n }\n /* Event listening */\n /* Synchronization */\n /**\n * Synchronize the relevant documents/items from the remote db with the local db.\n *\n * @param {boolean} bAll If true, we try to sync for the beginning of time.\n * @returns {boolean} True if the process was completed, false otherwise.\n */\n sync(bAll = false) {\n return __awaiter(this, void 0, void 0, function* () {\n while (!this.internalProcessingAllowed()) {\n // console.log(`sync: await internalProcessing (aIP=${this.aIP})`);\n yield new Promise(resolve => {\n setTimeout(() => {\n resolve(true);\n }, 200);\n });\n }\n const syncOptions = yield this._getSyncOptions(bAll);\n debug(`${this.type}.sync(${JSON.stringify(syncOptions)}) started...`);\n let self = this;\n let result = true;\n let [err, snap] = yield common_1.to(snapshot_1.default(this.remoteService, syncOptions));\n if (err) { // we silently ignore any errors\n if (err.className === 'timeout') {\n debug(` TIMEOUT: ${JSON.stringify(err)}`);\n }\n else {\n debug(` ERROR: ${JSON.stringify(err)}`);\n }\n // Ok, tell anyone interested about the result\n this.localService.emit('synced', false);\n return false;\n }\n /*\n * For each row returned by snapshot we perform the following:\n * - if it already exists locally\n * - if it is marked as deleted\n * - remove the row\n * - otherwise\n * - patch the row\n * - otherwise\n * - if it is not marked as deleted\n * - create the row\n * Moreover we track the `onServerAt` to determine latest sync timestamp\n */\n debug(` Applying received snapshot data... (${snap.length} items)`);\n let syncTS = new Date(0).toISOString();\n yield Promise.all(snap.map((v) => __awaiter(this, void 0, void 0, function* () {\n let [err, res] = yield common_1.to(self.localService.get(v[self.id]));\n if (res) {\n syncTS = syncTS < v.onServerAt ? v.onServerAt : syncTS;\n if (v.deletedAt) {\n [err, res] = yield common_1.to(self.localService.remove(v[self.id]));\n }\n else {\n [err, res] = yield common_1.to(self.localService.patch(v[self.id], v));\n }\n if (err) {\n result = false;\n }\n }\n else {\n if (!v.deletedAt) {\n syncTS = syncTS < v.onServerAt ? v.onServerAt : syncTS;\n [err, res] = yield common_1.to(self.localService.create(v));\n if (err) {\n result = false;\n }\n }\n }\n })));\n // Save last sync timestamp\n this.storage.setItem(this.thisName + '_syncedAt', new Date(syncTS).toISOString());\n if (result) // Wait until internal Processing is ok\n while (!(yield this._processQueuedEvents())) {\n yield new Promise(resolve => {\n setTimeout(() => {\n resolve(true);\n }, 200);\n });\n }\n ;\n // Ok, tell anyone interested about the result\n this.localService.emit('synced', result);\n return result;\n });\n }\n /**\n * Determine the relevant options necessary for synchronizing this service.\n *\n * @param {boolean} bAll If true, we try to sync for the beginning of time.\n * @returns {object} The relevant options for snapshot().\n */\n _getSyncOptions(bAll) {\n return __awaiter(this, void 0, void 0, function* () {\n let query = Object.assign({}, { offline: { _forceAll: true }, $sort: { onServerAt: 1 } });\n let ts = bAll ? new Date(0).toISOString() : this.syncedAt;\n let syncTS = ts < this.syncedAt ? ts : this.syncedAt;\n if (syncTS !== new Date(ts)) {\n query.offline.onServerAt = new Date(syncTS);\n }\n return query;\n });\n }\n}\n;\nmodule.exports = OwnClass;\n// --- Helper functions\n/**\n * Make a full clone of any given object\n * @param {object} obj\n * @returns {object} The copy object\n */\nfunction clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n//# sourceMappingURL=own-class.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst commons_1 = require(\"@feathersjs/commons\");\nconst errors_1 = __importDefault(require(\"@feathersjs/errors\"));\nconst common_1 = require(\"../common\");\nconst own_common_1 = __importDefault(require(\"../own-common\"));\nconst debug = require('debug')('@feathersjs-offline:owndata:service-wrapper');\nconst BOT = new Date(0).toISOString();\nclass OwndataClass extends own_common_1.default {\n constructor(opts) {\n debug(`Constructor started, opts = ${JSON.stringify(opts)}`);\n super(opts);\n this.type = 'own-data';\n this.__forTestingOnly = super._processQueuedEvents;\n debug(' Done.');\n return this;\n }\n _processQueuedEvents() {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`processQueuedEvents (${this.type}) entered`);\n if (!this.internalProcessingAllowed() || this.pQActive) {\n // console.log(`processingQueuedEvents: internalProcessing (aIP=${this.aIP}), pQActive=${this.pQActive}`);\n return false;\n }\n this.pQActive = true;\n let [err, store] = yield common_1.to(this.localQueue.getEntries({ query: { $sort: { [this.id]: 1 } } }));\n if (!store || store === []) {\n this.pQActive = false;\n return true;\n }\n debug(` processing ${store.length} queued entries...`);\n let self = this;\n let stop = false;\n while (store.length && !stop) {\n let el = store.shift();\n let { eventName, record, arg1, arg2, arg3 = null, id } = el;\n ({ eventName, el, arg1, arg2, arg3, id } = _accEvent(this.id, eventName, record, arg1, arg2, arg3, id));\n debug(` processing: event=${eventName}, arg1=${JSON.stringify(arg1)}, arg2=${JSON.stringify(arg2)}, arg3=${JSON.stringify(arg3)}`);\n yield self.remoteService[eventName](arg1, arg2, arg3)\n .then((res) => __awaiter(this, void 0, void 0, function* () {\n yield common_1.to(self.localQueue.remove(id));\n if (eventName !== 'remove') {\n // Let any updates to the document/item on server reflect on the local DB\n yield common_1.to(self.localService.patch(res[self.id], res));\n }\n }))\n .catch((err) => __awaiter(this, void 0, void 0, function* () {\n debug(`catch: record=${JSON.stringify(record)}, BOT=${JSON.stringify(BOT)}, event=${eventName}, id=${id}`);\n if (record.onServerAt === BOT && eventName === 'remove') {\n // This record has probably never been on server (=remoteService), so we silently ignore the error\n yield common_1.to(self.localQueue.remove(id));\n }\n else {\n // The connection to the server has probably been cut - let's continue at another time\n stop = true;\n }\n }));\n }\n debug(` processing ended, stop=${stop}`);\n this.pQActive = false;\n return !stop;\n });\n }\n}\n;\nfunction init(options) {\n return new OwndataClass(options);\n}\nlet Owndata = init;\n/**\n * A owndataWrapper is a CLIENT adapter wrapping for FeathersJS services extending them to\n * implement the offline own-data principle (**LINK-TO-DOC**).\n *\n * @example ```\n * import feathers from '(at)feathersjs/feathers';\n * import memory from 'feathers-memory';\n * import { owndataWrapper } from '(at)feathersjs-offline/client';\n * const app = feathers();\n * app.use('/testpath', memory({id: 'uuid'}));\n * owndataWrapper(app, '/testpath');\n * app.service('testpath').create({givenName: 'James', familyName: 'Bond'})\n * // ...\n * ```\n *\n * It works in co-existence with it's SERVER counterpart, RealtimeServiceWrapper.\n *\n * @param {object} app The application handle\n * @param {object} path The service path (as used in ```app.use(path, serviceAdapter)```)\n * @param {object} options The options for the serviceAdaptor AND the OwndataWrapper\n *\n */\nfunction owndataWrapper(app, path, options = {}) {\n debug(`owndataWrapper started on path '${path}'`);\n if (!(app && app.version && app.service && app.services)) {\n throw new errors_1.default.Unavailable(`The FeathersJS app must be supplied as first argument`);\n }\n let location = commons_1.stripSlashes(path);\n let old = app.service(location);\n if (typeof old === 'undefined') {\n throw new errors_1.default.Unavailable(`No prior service registered on path '${location}'`);\n }\n let opts = Object.assign({}, old.options, options);\n app.use(location, Owndata(opts));\n let service = app.service(location);\n service.options = opts;\n service._listenOptions();\n return service;\n}\nmodule.exports = { init, Owndata, owndataWrapper };\ninit.Service = OwndataClass;\n// Helper\nfunction _accEvent(idName, eventName, el, arg1, arg2, arg3, id) {\n let elId = el[idName];\n switch (eventName) {\n case 'create':\n return { eventName, el, arg1: el, arg2: arg2, arg3: {}, id };\n case 'update':\n return { eventName, el, arg1, arg2, arg3: arg3, id };\n case 'patch':\n return { eventName, el, arg1: elId, arg2: el, arg3: arg3, id };\n case 'remove':\n return { eventName, el, arg1: elId, arg2: {}, arg3: arg3, id };\n }\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst commons_1 = require(\"@feathersjs/commons\");\nconst errors_1 = __importDefault(require(\"@feathersjs/errors\"));\nconst common_1 = require(\"../common\");\nconst own_common_1 = __importDefault(require(\"../own-common\"));\nconst debug = require('debug')('@feathersjs-offline:ownnet:service-wrapper');\nclass OwnnetClass extends own_common_1.default {\n constructor(options) {\n debug(`Constructor started, opts = ${JSON.stringify(options)}`);\n super(options);\n this.type = 'own-net';\n this.__forTestingOnly = super._processQueuedEvents;\n debug(' Done.');\n }\n _processQueuedEvents() {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`processQueuedEvents (${this.type}) entered (IPallowed=${this.internalProcessingAllowed()}, pQActive=${this.pQActive})`);\n if (!this.internalProcessingAllowed() || this.pQActive) {\n debug(`processingQueuedEvents: leaving internalProcessing (aIP=${this.aIP}), pQActive=${this.pQActive}`);\n return false;\n }\n this.pQActive = true;\n let [err, store] = yield common_1.to(this.localQueue.getEntries({ query: { $sort: { uuid: 1, updatedAt: 1 } } }));\n if (!store || store === [] || store.length === 0) {\n this.pQActive = false;\n return true;\n }\n this.disallowInternalProcessing();\n debug(` processing ${store.length} queued entries...`);\n let self = this;\n let i = 0; // Current event\n let j = 0; // Current first event\n let ids = []; // The ids of the entries in localQueue currently accumulated\n let netOps = [];\n let ev = [];\n let stop = false;\n // For own-net we only send one accumulated record to the server - let's accumulate!\n // Remember, we already have the accumulated record on file in localService, so all we\n // need to do, is to look out for create and remove - the rest we remoteService.patch!\n let eventName;\n let record;\n let arg1;\n let arg2;\n let arg3;\n do {\n while (i < store.length && store[i].record.uuid === store[j].record.uuid) {\n ({ eventName, record, arg1, arg2, arg3 } = store[i]);\n ids.push(store[i].id);\n ev.push(eventName);\n if (eventName === 'remove') {\n netOps.push(_accEvent(this.id, eventName, record, arg1, arg2, arg3, ids));\n ev = [];\n ids = [];\n j = i + 1; // New start at next record\n }\n i++; // get next possible record\n }\n if (ids.length) {\n let res;\n let err;\n if (store[j].eventName !== 'create')\n [err, res] = yield common_1.to(self.localService.get(store[j].record[this.id]));\n else\n res = store[j].record;\n let action = ev.includes('create') ? 'create' : 'update';\n netOps.push(_accEvent(this.id, action, res, arg1, arg2, arg3, ids));\n if (i < store.length) {\n ev = [store[i].eventName];\n ids = [store[i].id];\n }\n j = i++; // New start at i and move to next record\n }\n } while (i < store.length);\n debug(`netOps = ${JSON.stringify(netOps)}`);\n // Now, send all necessary updates to the remote service (server)\n stop = false;\n // In future version we will user Promise.allSettled() instead...\n let result = yield Promise.all(netOps.map((op) => __awaiter(this, void 0, void 0, function* () {\n let { eventName, el, arg1, arg2, arg3, ids } = op;\n let mdebug = ` remoteService['${eventName}'](${JSON.stringify(arg1)}, ${JSON.stringify(arg2)}, ${JSON.stringify(arg3)})`;\n debug(mdebug);\n return yield self.remoteService[eventName](arg1, arg2, arg3)\n .then((res) => __awaiter(this, void 0, void 0, function* () {\n return yield self.localQueue.remove(null, { query: { id: { $in: clone(ids) } } })\n .then((qres) => __awaiter(this, void 0, void 0, function* () {\n if (eventName !== 'remove') {\n return yield self.localService.patch(res[self.id], res)\n .catch(err => {\n debug(mdebug + ` (copy)\\n localService.patch(${JSON.stringify(res[self.id])}, ${JSON.stringify(res)})`);\n return true;\n })\n .then(() => { return false; });\n }\n return false;\n }))\n .catch(err => {\n debug(`err2=${err.name}, ${err.message}`);\n return false;\n });\n }));\n // .catch(err => {\n // if (err.name === 'Timeout' && err.type === 'FeathersError') {\n // // We silently accept - we probably lost connection\n // }\n // else {\n // if (eventName === 'remove' && el.onServerAt === 0) {\n // // This record has probably never been on server (=remoteService), so we silently ignore the error\n // }\n // else {\n // if (err.name !== 'Timeout' /* && eventName !== 'remove' && el.onServerAt !== 0 */) {\n // return false;\n // }\n // }\n // return false;\n // });\n })));\n // stop = result.reduce((pv, cv, ci, arr) => stop || arr[ci]);\n this.allowInternalProcessing();\n this.pQActive = false;\n return true;\n });\n }\n}\nfunction init(options) {\n return new OwnnetClass(options);\n}\nlet Ownnet = init;\n/**\n * A ownnetWrapper is a CLIENT adapter wrapping for FeathersJS services extending them to\n * implement the offline own-net principle (**LINK-TO-DOC**).\n *\n * @example ```\n * import feathers from '(at)feathersjs/feathers';\n * import memory from 'feathers-memory';\n * import { ownnetWrapper } from '(at)feathersjs-offline/client';\n * const app = feathers();\n * app.use('/testpath', memory({id: 'uuid'}));\n * ownnetWrapper(app, '/testpath');\n * app.service('testpath').create({givenName: 'James', familyName: 'Bond'})\n * // ...\n * ```\n *\n * It works in co-existence with it's SERVER counterpart, RealtimeServiceWrapper.\n *\n * @param {object} app The application handle\n * @param {object} path The service path (as used in ```app.use(path, serviceAdapter)```)\n * @param {object} options The options for the serviceAdaptor AND the OwnnetWrapper\n *\n */\nfunction ownnetWrapper(app, path, options = {}) {\n debug(`ownnetWrapper started on path '${path}'`);\n if (!(app && app.version && app.service && app.services))\n throw new errors_1.default.Unavailable(`The FeathersJS app must be supplied as first argument`);\n let location = commons_1.stripSlashes(path);\n let old = app.service(location);\n if (typeof old === 'undefined') {\n throw new errors_1.default.Unavailable(`No prior service registered on path '${location}'`);\n }\n let opts = Object.assign({}, old.options, options);\n app.use(location, Ownnet(opts));\n let service = app.service(location);\n service.options = opts;\n service._listenOptions();\n return service;\n}\nmodule.exports = { init, Ownnet, ownnetWrapper };\ninit.Service = OwnnetClass;\n// Helpers\nfunction clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\nfunction _accEvent(idName, eventName, el, arg1, arg2, arg3, ids) {\n let elId = el[idName];\n switch (eventName) {\n case 'create':\n return { eventName, el, arg1: el, arg2: arg2, arg3: {}, ids };\n case 'update':\n return { eventName, el, arg1, arg2, arg3: arg3, ids };\n case 'patch':\n return { eventName, el, arg1: elId, arg2: el, arg3: arg3, ids };\n case 'remove':\n return { eventName, el, arg1: elId, arg2: {}, arg3: arg3, ids };\n }\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//\n// Most of this code has been copied from 'https://github.com/feathers-plus/feathers-offline-snapshot/blob/master/src/index.js'\n// with permission from @eddyystop\n//\nconst debug_1 = __importDefault(require(\"debug\"));\nconst debug = debug_1.default('@feathersjs-offline:snapshot');\nfunction snapshot(service, baseQuery) {\n debug(`snapshot start: ${JSON.stringify(baseQuery)}`);\n const query = Object.assign({}, { $skip: 0, $limit: 200 }, baseQuery); // use max recs configured\n let fileDatas;\n return service.find({ query })\n .then(result => {\n debug(`snapshot query = ${JSON.stringify(query)}, read ${(result.data || result).length} records\\n\n snapshot read ${JSON.stringify(result.data || result)}`);\n if (!result.data) {\n return result;\n }\n const { total, limit, skip, data } = result;\n fileDatas = data;\n return (skip + data.length < total) ? readRemainingPages(skip + limit) : fileDatas;\n });\n function readRemainingPages(skip) {\n query.$skip = skip;\n return service.find({ query })\n .then(({ total, limit, skip, data }) => {\n debug(`read ${data.length} records`);\n fileDatas = fileDatas.concat(data);\n return (skip + data.length < total) ? readRemainingPages(skip + limit) : fileDatas;\n });\n }\n}\nmodule.exports = snapshot;\n//# sourceMappingURL=index.js.map","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n","(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function eventListener() {\n if (errorListener !== undefined) {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n var errorListener;\n\n // Adding an error listener is not optional because\n // if an error is thrown on an event emitter we cannot\n // guarantee that the actual event we are waiting will\n // be fired. The result could be a silent way to create\n // memory or file descriptor leaks, which is something\n // we should avoid.\n if (name !== 'error') {\n errorListener = function errorListener(err) {\n emitter.removeListener(name, eventListener);\n reject(err);\n };\n\n emitter.once('error', errorListener);\n }\n\n emitter.once(name, eventListener);\n });\n}\n","const { Service } = require('feathers-memory');\n\nconst usedKeys = [];\n\nclass LocalStorage extends Service {\n constructor (options = {}) {\n super(options);\n this._storageKey = options.name || 'feathers';\n this._storage = options.storage || (typeof window !== 'undefined' && window.localStorage);\n this._throttle = options.throttle || 200;\n this._reuseKeys = options.reuseKeys || false;\n this.store = null;\n\n if (!this._storage) {\n throw new Error('The `storage` option needs to be provided');\n }\n\n if (usedKeys.indexOf(this._storageKey) === -1) {\n usedKeys.push(this._storageKey);\n } else {\n if (!this._reuseKeys) { // Allow reuse if options.reuseKeys set to true\n throw new Error(`The storage name '${this._storageKey}' is already in use by another instance.`);\n }\n }\n\n this.ready();\n }\n\n ready () {\n if (!this.store) {\n return Promise.resolve(this._storage.getItem(this._storageKey))\n .then(str => JSON.parse(str || '{}'))\n .then(store => {\n const keys = Object.keys(store);\n const last = store[keys[keys.length - 1]];\n\n // Current id is the id of the last item\n this._uId = (keys.length && typeof last[this.id] !== 'undefined') ? last[this.id] + 1 : this._uId;\n\n return (this.store = store);\n });\n }\n\n return Promise.resolve(this.store);\n }\n\n flush (data) {\n if (!this._timeout) {\n this._timeout = setTimeout(() => {\n this._storage.setItem(this._storageKey, JSON.stringify(this.store));\n delete this._timeout;\n }, this._throttle);\n }\n\n return data;\n }\n\n execute (method, ...args) {\n return this.ready()\n .then(() => super[method](...args));\n }\n\n find (...args) {\n return this.execute('find', ...args);\n }\n\n get (...args) {\n return this.execute('get', ...args);\n }\n\n create (...args) {\n return this.execute('create', ...args)\n .then(data => this.flush(data));\n }\n\n patch (...args) {\n return this.execute('patch', ...args)\n .then(data => this.flush(data));\n }\n\n update (...args) {\n return this.execute('update', ...args)\n .then(data => this.flush(data));\n }\n\n remove (...args) {\n return this.execute('remove', ...args)\n .then(data => this.flush(data));\n }\n}\n\nmodule.exports = function init (options) {\n return new LocalStorage(options);\n};\n\nmodule.exports.Service = Service;\n","const errors = require('@feathersjs/errors');\nconst { _ } = require('@feathersjs/commons');\nconst { sorter, select, AdapterService } = require('@feathersjs/adapter-commons');\nconst sift = require('sift').default;\n\nconst _select = (data, ...args) => {\n const base = select(...args);\n\n return base(JSON.parse(JSON.stringify(data)));\n};\n\nclass Service extends AdapterService {\n constructor (options = {}) {\n super(_.extend({\n id: 'id',\n matcher: sift,\n sorter\n }, options));\n this._uId = options.startId || 0;\n this.store = options.store || {};\n }\n\n async getEntries (params = {}) {\n const { query } = this.filterQuery(params);\n\n return this._find(Object.assign({}, params, {\n paginate: false,\n query\n }));\n }\n\n async _find (params = {}) {\n const { query, filters, paginate } = this.filterQuery(params);\n let values = _.values(this.store).filter(this.options.matcher(query));\n const total = values.length;\n\n if (filters.$sort !== undefined) {\n values.sort(this.options.sorter(filters.$sort));\n }\n\n if (filters.$skip !== undefined) {\n values = values.slice(filters.$skip);\n }\n\n if (filters.$limit !== undefined) {\n values = values.slice(0, filters.$limit);\n }\n\n const result = {\n total,\n limit: filters.$limit,\n skip: filters.$skip || 0,\n data: values.map(value => _select(value, params))\n };\n\n if (!(paginate && paginate.default)) {\n return result.data;\n }\n\n return result;\n }\n\n async _get (id, params = {}) {\n if (id in this.store) {\n const { query } = this.filterQuery(params);\n const value = this.store[id];\n\n if (this.options.matcher(query)(value)) {\n return _select(value, params, this.id);\n }\n }\n\n throw new errors.NotFound(`No record found for id '${id}'`);\n }\n\n // Create without hooks and mixins that can be used internally\n async _create (data, params = {}) {\n if (Array.isArray(data)) {\n return Promise.all(data.map(current => this._create(current, params)));\n }\n\n const id = data[this.id] || this._uId++;\n const current = _.extend({}, data, { [this.id]: id });\n const result = (this.store[id] = current);\n\n return _select(result, params, this.id);\n }\n\n async _update (id, data, params = {}) {\n const oldEntry = await this._get(id);\n // We don't want our id to change type if it can be coerced\n const oldId = oldEntry[this.id];\n\n id = oldId == id ? oldId : id; // eslint-disable-line\n\n this.store[id] = _.extend({}, data, { [this.id]: id });\n\n return this._get(id, params);\n }\n\n async _patch (id, data, params = {}) {\n const patchEntry = entry => {\n const currentId = entry[this.id];\n\n this.store[currentId] = _.extend(this.store[currentId], _.omit(data, this.id));\n\n return _select(this.store[currentId], params, this.id);\n };\n\n if (id === null) {\n const entries = await this.getEntries(params);\n\n return entries.map(patchEntry);\n }\n\n return patchEntry(await this._get(id, params)); // Will throw an error if not found\n }\n\n // Remove without hooks and mixins that can be used internally\n async _remove (id, params = {}) {\n if (id === null) {\n const entries = await this.getEntries(params);\n\n return Promise.all(entries.map(\n current => this._remove(current[this.id], params))\n );\n }\n\n const entry = await this._get(id, params);\n\n delete this.store[id];\n\n return entry;\n }\n}\n\nmodule.exports = options => {\n return new Service(options);\n};\n\nmodule.exports.Service = Service;\n","/*\n *\n * Copryright 2018, Craig Condon\n * Licensed under MIT\n *\n * Filter JavaScript objects with mongodb queries\n */\n\nfunction typeChecker(type) {\n var typeString = \"[object \" + type + \"]\";\n return function(value) {\n return Object.prototype.toString.call(value) === typeString;\n };\n}\n\n/**\n */\n\nvar isArray = typeChecker(\"Array\");\nvar isObject = typeChecker(\"Object\");\nvar isFunction = typeChecker(\"Function\");\n\nfunction get(obj, key) {\n return isFunction(obj.get) ? obj.get(key) : obj[key];\n}\n\n\nconst nestable = (validator) => (validateOptions, value, key, valueOwner, nestedResults) => {\n if (nestedResults) {\n return Boolean(nestedResults.find(([value, key, valueOwner]) => validator(validateOptions, key, valueOwner)));\n }\n\n return validator(validateOptions, value, key, valueOwner);\n};\n\n/**\n */\n\nconst or = nestable((validator) => {\n return function(validateOptions, value, key, valueOwner, nestedResults) {\n if (!isArray(value) || !value.length) {\n return validator(validateOptions, value);\n }\n for (var i = 0, n = value.length; i < n; i++) {\n if (validator(validateOptions, get(value, i))) return true;\n }\n return false;\n };\n});\n\n/**\n */\n\nfunction and(validator) {\n return function(validateOptions, value, key, valueOwner) {\n if (!isArray(value) || !value.length) {\n return validator(validateOptions, value, key, valueOwner);\n }\n for (var i = 0, n = value.length; i < n; i++) {\n if (!validator(validateOptions, get(value, i), value, valueOwner)) return false;\n }\n return true;\n };\n}\n\nfunction validate(validator, value, key, valueOwner, nestedResults) {\n return validator.validate(validator.options, value, key, valueOwner, nestedResults);\n}\n\nvar defaultExpressions = {\n /**\n */\n\n $eq: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $ne: and(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $gt: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $gte: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $lt: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $lte: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $mod: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $in(test, value) {\n return test(value);\n },\n\n /**\n */\n\n $nin: function(test, value) {\n return test(value);\n },\n\n /**\n */\n\n $not: function(test, value, key, valueOwner) {\n return test(value, key, valueOwner);\n },\n\n /**\n */\n\n $type: function(testType, value) {\n return testType(value);\n },\n\n /**\n */\n\n $all: function(allOptions, value, key, valueOwner, nestedResults) {\n return defaultExpressions.$and(allOptions, value, key, valueOwner, nestedResults);\n },\n\n /**\n */\n\n $size: function(sizeMatch, value) {\n return value ? sizeMatch === value.length : false;\n },\n\n /**\n */\n\n $or: function(orOptions, value, key, valueOwner) {\n for (var i = 0, n = orOptions.length; i < n; i++) {\n if (validate(get(orOptions, i), value, key, valueOwner)) {\n return true;\n }\n }\n return false;\n },\n\n /**\n */\n\n $nor: function(validateOptions, value, key, valueOwner) {\n return !defaultExpressions.$or(validateOptions, value, key, valueOwner);\n },\n\n /**\n */\n\n $and: function(validateOptions, value, key, valueOwner, nestedResults) {\n\n if (nestedResults) {\n for (var i = 0, n = validateOptions.length; i < n; i++) {\n if (!validate(get(validateOptions, i), value, key, valueOwner, nestedResults)) {\n return false;\n }\n }\n } else {\n for (var i = 0, n = validateOptions.length; i < n; i++) {\n if (!validate(get(validateOptions, i), value, key, valueOwner, nestedResults)) {\n return false;\n }\n }\n }\n return true;\n },\n\n /**\n */\n\n $regex: or(function(validateOptions, value) {\n return typeof value === \"string\" && validateOptions.test(value);\n }),\n\n /**\n */\n\n $where: function(validateOptions, value, key, valueOwner) {\n return validateOptions.call(value, value, key, valueOwner);\n },\n\n /**\n */\n\n $elemMatch: function(validateOptions, value, key, valueOwner) {\n if (isArray(value)) {\n return !!~search(value, validateOptions);\n }\n return validate(validateOptions, value, key, valueOwner);\n },\n\n /**\n */\n\n $exists: function(validateOptions, value, key, valueOwner) {\n return valueOwner.hasOwnProperty(key) === validateOptions;\n }\n};\n\n/**\n */\n\nvar prepare = {\n /**\n */\n\n $eq: function(query, queryOwner, { comparable, compare }) {\n if (query instanceof RegExp) {\n return or(function(value) {\n return typeof value === \"string\" && query.test(value);\n });\n } else if (query instanceof Function) {\n return or(query);\n } else if (isArray(query) && !query.length) {\n // Special case of a == []\n return or(function(value) {\n return isArray(value) && !value.length;\n });\n } else if (query === null) {\n return or(function(value) {\n //will match both null and undefined\n return value == null;\n });\n }\n return or(function(value) {\n return compare(comparable(value), comparable(query)) === 0;\n });\n },\n\n $gt: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) > 0;\n };\n },\n\n $gte: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) >= 0;\n };\n },\n\n $lt: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) < 0;\n };\n },\n $lte: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) <= 0;\n };\n },\n\n $in: function(query, queryOwner, options) {\n const { comparable } = options;\n return function(value) {\n if (value instanceof Array) {\n for (var i = value.length; i--; ) {\n if (~query.indexOf(comparable(get(value, i)))) {\n return true;\n }\n }\n } else {\n var comparableValue = comparable(value);\n if (comparableValue === value && typeof value === \"object\") {\n for (var i = query.length; i--; ) {\n if (\n String(query[i]) === String(value) &&\n String(value) !== \"[object Object]\"\n ) {\n return true;\n }\n }\n }\n\n /*\n Handles documents that are undefined, whilst also\n having a 'null' element in the parameters to $in.\n */\n if (typeof comparableValue == \"undefined\") {\n for (var i = query.length; i--; ) {\n if (query[i] == null) {\n return true;\n }\n }\n }\n\n /*\n Handles the case of {'field': {$in: [/regexp1/, /regexp2/, ...]}}\n */\n for (var i = query.length; i--; ) {\n var validator = createRootValidator(get(query, i), options);\n var result = validate(validator, comparableValue, i, query);\n if (\n result &&\n String(result) !== \"[object Object]\" &&\n String(comparableValue) !== \"[object Object]\"\n ) {\n return true;\n }\n }\n\n return !!~query.indexOf(comparableValue);\n }\n\n return false;\n };\n },\n\n $nin: function(query, queryOwner, options) {\n const eq = prepare.$in(query, queryOwner, options);\n return function(validateOptions, value, key, valueOwner) {\n return !eq(validateOptions, value, key, valueOwner);\n };\n },\n\n $mod: function(query) {\n return function(value) {\n return value % query[0] == query[1];\n };\n },\n\n /**\n */\n\n $ne: function(query, queryOwner, options) {\n const eq = prepare.$eq(query, queryOwner, options);\n return and(function(validateOptions, value, key, valueOwner) {\n return !eq(validateOptions, value, key, valueOwner);\n });\n },\n\n /**\n */\n\n $and: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $all: function(query, queryOwner, options) {\n return prepare.$and(query, queryOwner, options);\n },\n\n /**\n */\n\n $or: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $nor: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $not: function(query, queryOwner, options) {\n const validateOptions = parse(options)(query);\n return function(value, key, valueOwner) {\n return !validate(validateOptions, value, key, valueOwner);\n };\n },\n\n $type: function(query) {\n return function(value, key, valueOwner) {\n return value != void 0\n ? value instanceof query || value.constructor == query\n : false;\n };\n },\n\n /**\n */\n\n $regex: function(query, queryOwner) {\n return new RegExp(query, queryOwner.$options);\n },\n\n /**\n */\n\n $where: function(query) {\n return typeof query === \"string\"\n ? new Function(\"obj\", \"return \" + query)\n : query;\n },\n\n /**\n */\n\n $elemMatch: function(query, queryOwner, options) {\n return parse(options)(query);\n },\n\n /**\n */\n\n $exists: function(query) {\n return !!query;\n }\n};\n\n/**\n */\n\nfunction search(array, validator) {\n for (var i = 0; i < array.length; i++) {\n var result = get(array, i);\n if (validate(validator, get(array, i))) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n */\n\nfunction createValidator(options, validate) {\n return { options, validate };\n}\n\n/**\n */\n\nfunction validatedNested({ keyPath, child, query }, value) {\n const results = [];\n findValues(value, keyPath, 0, value, results);\n \n if (results.length === 1) {\n const [value, key, valueOwner] = results[0];\n return validate(child, value, key, valueOwner);\n }\n\n // If the query contains $ne, need to test all elements ANDed together\n var inclusive = query && typeof query.$ne !== \"undefined\";\n var allValid = inclusive;\n const allValues = results.map(([value]) => value);\n\n return validate(child, undefined, undefined, undefined, results);\n // for (var i = 0; i < results.length; i++) {\n // const [value, key, valueOwner] = results[i];\n // var isValid = validate(child, value, key, valueOwner);\n // console.log(isValid, value);\n // if (inclusive) {\n // allValid &= isValid;\n // } else {\n // allValid |= isValid;\n // }\n // }\n // return allValid;\n}\n\n/**\n */\n\nfunction findValues(current, keypath, index, object, values) {\n if (index === keypath.length || current == void 0) {\n values.push([current, keypath[index - 1], object]);\n return;\n }\n\n var k = get(keypath, index);\n\n // ensure that if current is an array, that the current key\n // is NOT an array index. This sort of thing needs to work:\n // sift({'foo.0':42}, [{foo: [42]}]);\n if (isArray(current) && isNaN(Number(k))) {\n for (var i = 0, n = current.length; i < n; i++) {\n findValues(get(current, i), keypath, index, current, values);\n }\n } else {\n findValues(get(current, k), keypath, index + 1, current, values);\n }\n}\n\n/**\n */\n\nfunction createNestedValidator(keyPath, child, query) {\n return createValidator({ keyPath, child, query }, validatedNested);\n}\n\n/**\n * flatten the query\n */\n\nfunction isVanillaObject(value) {\n return (\n value &&\n (value.constructor === Object ||\n value.constructor === Array ||\n value.constructor.toString() === \"function Object() { [native code] }\" ||\n value.constructor.toString() === \"function Array() { [native code] }\")\n );\n}\n\nfunction parse(options) {\n const { comparable, expressions } = options;\n var wrapQuery = function(query) {\n if (!query || !isVanillaObject(query)) {\n query = { $eq: query };\n }\n return query;\n };\n\n var parseQuery = function(query) {\n query = comparable(query);\n\n var validators = [];\n\n for (var key in query) {\n var queryValue = query[key];\n\n if (key === \"$options\") {\n continue;\n }\n\n var expression =\n defaultExpressions[key] || (options && expressions && expressions[key]);\n\n if (expression) {\n if (prepare[key]) {\n queryValue = prepare[key](queryValue, query, options);\n }\n validators.push(createValidator(comparable(queryValue), expression));\n } else {\n if (key.charCodeAt(0) === 36) {\n throw new Error(\"Unknown operation \" + key);\n }\n\n var keyParts = key.split(\".\");\n\n validators.push(\n createNestedValidator(keyParts, parseNested(queryValue), queryValue)\n );\n }\n }\n\n return validators.length === 1\n ? validators[0]\n : createValidator(validators, defaultExpressions.$and);\n };\n\n var parseNested = function(query) {\n query = wrapQuery(query);\n if (isExactObject(query)) {\n return createValidator(query, isEqual);\n }\n return parseQuery(query);\n };\n\n var parseRoot = function(query) {\n return parseQuery(wrapQuery(query));\n };\n\n return parseRoot;\n}\n\nfunction isEqual(a, b) {\n if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) {\n return false;\n }\n\n if (isObject(a)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n for (var key in a) {\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n } else if (isArray(a)) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0, n = a.length; i < n; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n } else {\n return a === b;\n }\n}\n\nfunction getAllKeys(value, keys) {\n if (!isObject(value)) {\n return keys;\n }\n for (var key in value) {\n keys.push(key);\n getAllKeys(value[key], keys);\n }\n return keys;\n}\n\nfunction isExactObject(value) {\n const allKeysHash = getAllKeys(value, []).join(\",\");\n return allKeysHash.search(/[$.]/) === -1;\n}\n\n/**\n */\n\nfunction createRootValidator(query, options) {\n var validator = parse(options)(query);\n if (options && options.select) {\n validator = {\n options: validator,\n validate: function(validateOptions, value, key, valueOwner) {\n return validate(\n validateOptions,\n value && options.select(value),\n key,\n valueOwner\n );\n }\n };\n }\n return validator;\n}\n\n/**\n */\n\nexport default function sift(query, options) {\n options = Object.assign({ compare, comparable }, options);\n var validator = createRootValidator(query, options);\n return function(value, key, valueOwner) {\n return validate(validator, value, key, valueOwner);\n };\n}\n\n/**\n */\n\nexport function compare(a, b) {\n if (isEqual(a, b)) return 0;\n if (typeof a === typeof b) {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n }\n}\n\n/**\n */\n\nexport function comparable(value) {\n if (value instanceof Date) {\n return value.getTime();\n } else if (isArray(value)) {\n return value.map(comparable);\n } else if (value && typeof value.toJSON === \"function\") {\n return value.toJSON();\n } else {\n return value;\n }\n}\n","'use strict'\n\nmodule.exports = clone\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: obj.__proto__ }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n retry()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n retry()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n function readdir (path, options, cb) {\n var args = [path]\n if (typeof options !== 'function') {\n args.push(options)\n } else {\n cb = options\n }\n args.push(go$readdir$cb)\n\n return go$readdir(args)\n\n function go$readdir$cb (err, files) {\n if (files && files.sort)\n files.sort()\n\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readdir, [args]])\n\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n }\n }\n\n function go$readdir (args) {\n return fs$readdir.apply(fs, args)\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n}\n\nfunction retry () {\n var elem = fs[gracefulQueue].shift()\n if (elem) {\n debug('RETRY', elem[0].name, elem[1])\n elem[0].apply(null, elem[1])\n }\n}\n","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n","var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\nvar chdir = process.chdir\nprocess.chdir = function(d) {\n cwd = null\n chdir.call(process, d)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (!fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (!fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = (function (fs$rename) { return function (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }})(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n read.__proto__ = fs$read\n return read\n })(fs.read)\n\n fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\")) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n","/**\n * @preserve\n * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)\n *\n * @author Jens Taylor\n * @see http://github.com/homebrewing/brauhaus-diff\n * @author Gary Court\n * @see http://github.com/garycourt/murmurhash-js\n * @author Austin Appleby\n * @see http://sites.google.com/site/murmurhash/\n */\n(function(){\n var cache;\n\n // Call this function without `new` to use the cached object (good for\n // single-threaded environments), or with `new` to create a new object.\n //\n // @param {string} key A UTF-16 or ASCII string\n // @param {number} seed An optional positive integer\n // @return {object} A MurmurHash3 object for incremental hashing\n function MurmurHash3(key, seed) {\n var m = this instanceof MurmurHash3 ? this : cache;\n m.reset(seed)\n if (typeof key === 'string' && key.length > 0) {\n m.hash(key);\n }\n\n if (m !== this) {\n return m;\n }\n };\n\n // Incrementally add a string to this hash\n //\n // @param {string} key A UTF-16 or ASCII string\n // @return {object} this\n MurmurHash3.prototype.hash = function(key) {\n var h1, k1, i, top, len;\n\n len = key.length;\n this.len += len;\n\n k1 = this.k1;\n i = 0;\n switch (this.rem) {\n case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0;\n case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0;\n case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0;\n case 3:\n k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0;\n k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0;\n }\n\n this.rem = (len + this.rem) & 3; // & 3 is same as % 4\n len -= this.rem;\n if (len > 0) {\n h1 = this.h1;\n while (1) {\n k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;\n\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff;\n\n if (i >= len) {\n break;\n }\n\n k1 = ((key.charCodeAt(i++) & 0xffff)) ^\n ((key.charCodeAt(i++) & 0xffff) << 8) ^\n ((key.charCodeAt(i++) & 0xffff) << 16);\n top = key.charCodeAt(i++);\n k1 ^= ((top & 0xff) << 24) ^\n ((top & 0xff00) >> 8);\n }\n\n k1 = 0;\n switch (this.rem) {\n case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16;\n case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8;\n case 1: k1 ^= (key.charCodeAt(i) & 0xffff);\n }\n\n this.h1 = h1;\n }\n\n this.k1 = k1;\n return this;\n };\n\n // Get the result of this hash\n //\n // @return {number} The 32-bit hash\n MurmurHash3.prototype.result = function() {\n var k1, h1;\n \n k1 = this.k1;\n h1 = this.h1;\n\n if (k1 > 0) {\n k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;\n h1 ^= k1;\n }\n\n h1 ^= this.len;\n\n h1 ^= h1 >>> 16;\n h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff;\n h1 ^= h1 >>> 13;\n h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff;\n h1 ^= h1 >>> 16;\n\n return h1 >>> 0;\n };\n\n // Reset the hash object for reuse\n //\n // @param {number} seed An optional positive integer\n MurmurHash3.prototype.reset = function(seed) {\n this.h1 = typeof seed === 'number' ? seed : 0;\n this.rem = this.k1 = this.len = 0;\n return this;\n };\n\n // A cached object to use. This can be safely used if you're in a single-\n // threaded environment, otherwise you need to create new hashes to use.\n cache = new MurmurHash3();\n\n if (typeof(module) != 'undefined') {\n module.exports = MurmurHash3;\n } else {\n this.MurmurHash3 = MurmurHash3;\n }\n}());\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","(function(){\r\n var crypt = require('crypt'),\r\n utf8 = require('charenc').utf8,\r\n isBuffer = require('is-buffer'),\r\n bin = require('charenc').bin,\r\n\r\n // The core\r\n md5 = function (message, options) {\r\n // Convert to byte array\r\n if (message.constructor == String)\r\n if (options && options.encoding === 'binary')\r\n message = bin.stringToBytes(message);\r\n else\r\n message = utf8.stringToBytes(message);\r\n else if (isBuffer(message))\r\n message = Array.prototype.slice.call(message, 0);\r\n else if (!Array.isArray(message) && message.constructor !== Uint8Array)\r\n message = message.toString();\r\n // else, assume byte array already\r\n\r\n var m = crypt.bytesToWords(message),\r\n l = message.length * 8,\r\n a = 1732584193,\r\n b = -271733879,\r\n c = -1732584194,\r\n d = 271733878;\r\n\r\n // Swap endian\r\n for (var i = 0; i < m.length; i++) {\r\n m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |\r\n ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;\r\n }\r\n\r\n // Padding\r\n m[l >>> 5] |= 0x80 << (l % 32);\r\n m[(((l + 64) >>> 9) << 4) + 14] = l;\r\n\r\n // Method shortcuts\r\n var FF = md5._ff,\r\n GG = md5._gg,\r\n HH = md5._hh,\r\n II = md5._ii;\r\n\r\n for (var i = 0; i < m.length; i += 16) {\r\n\r\n var aa = a,\r\n bb = b,\r\n cc = c,\r\n dd = d;\r\n\r\n a = FF(a, b, c, d, m[i+ 0], 7, -680876936);\r\n d = FF(d, a, b, c, m[i+ 1], 12, -389564586);\r\n c = FF(c, d, a, b, m[i+ 2], 17, 606105819);\r\n b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);\r\n a = FF(a, b, c, d, m[i+ 4], 7, -176418897);\r\n d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);\r\n c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);\r\n b = FF(b, c, d, a, m[i+ 7], 22, -45705983);\r\n a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);\r\n d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);\r\n c = FF(c, d, a, b, m[i+10], 17, -42063);\r\n b = FF(b, c, d, a, m[i+11], 22, -1990404162);\r\n a = FF(a, b, c, d, m[i+12], 7, 1804603682);\r\n d = FF(d, a, b, c, m[i+13], 12, -40341101);\r\n c = FF(c, d, a, b, m[i+14], 17, -1502002290);\r\n b = FF(b, c, d, a, m[i+15], 22, 1236535329);\r\n\r\n a = GG(a, b, c, d, m[i+ 1], 5, -165796510);\r\n d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);\r\n c = GG(c, d, a, b, m[i+11], 14, 643717713);\r\n b = GG(b, c, d, a, m[i+ 0], 20, -373897302);\r\n a = GG(a, b, c, d, m[i+ 5], 5, -701558691);\r\n d = GG(d, a, b, c, m[i+10], 9, 38016083);\r\n c = GG(c, d, a, b, m[i+15], 14, -660478335);\r\n b = GG(b, c, d, a, m[i+ 4], 20, -405537848);\r\n a = GG(a, b, c, d, m[i+ 9], 5, 568446438);\r\n d = GG(d, a, b, c, m[i+14], 9, -1019803690);\r\n c = GG(c, d, a, b, m[i+ 3], 14, -187363961);\r\n b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);\r\n a = GG(a, b, c, d, m[i+13], 5, -1444681467);\r\n d = GG(d, a, b, c, m[i+ 2], 9, -51403784);\r\n c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);\r\n b = GG(b, c, d, a, m[i+12], 20, -1926607734);\r\n\r\n a = HH(a, b, c, d, m[i+ 5], 4, -378558);\r\n d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);\r\n c = HH(c, d, a, b, m[i+11], 16, 1839030562);\r\n b = HH(b, c, d, a, m[i+14], 23, -35309556);\r\n a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);\r\n d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);\r\n c = HH(c, d, a, b, m[i+ 7], 16, -155497632);\r\n b = HH(b, c, d, a, m[i+10], 23, -1094730640);\r\n a = HH(a, b, c, d, m[i+13], 4, 681279174);\r\n d = HH(d, a, b, c, m[i+ 0], 11, -358537222);\r\n c = HH(c, d, a, b, m[i+ 3], 16, -722521979);\r\n b = HH(b, c, d, a, m[i+ 6], 23, 76029189);\r\n a = HH(a, b, c, d, m[i+ 9], 4, -640364487);\r\n d = HH(d, a, b, c, m[i+12], 11, -421815835);\r\n c = HH(c, d, a, b, m[i+15], 16, 530742520);\r\n b = HH(b, c, d, a, m[i+ 2], 23, -995338651);\r\n\r\n a = II(a, b, c, d, m[i+ 0], 6, -198630844);\r\n d = II(d, a, b, c, m[i+ 7], 10, 1126891415);\r\n c = II(c, d, a, b, m[i+14], 15, -1416354905);\r\n b = II(b, c, d, a, m[i+ 5], 21, -57434055);\r\n a = II(a, b, c, d, m[i+12], 6, 1700485571);\r\n d = II(d, a, b, c, m[i+ 3], 10, -1894986606);\r\n c = II(c, d, a, b, m[i+10], 15, -1051523);\r\n b = II(b, c, d, a, m[i+ 1], 21, -2054922799);\r\n a = II(a, b, c, d, m[i+ 8], 6, 1873313359);\r\n d = II(d, a, b, c, m[i+15], 10, -30611744);\r\n c = II(c, d, a, b, m[i+ 6], 15, -1560198380);\r\n b = II(b, c, d, a, m[i+13], 21, 1309151649);\r\n a = II(a, b, c, d, m[i+ 4], 6, -145523070);\r\n d = II(d, a, b, c, m[i+11], 10, -1120210379);\r\n c = II(c, d, a, b, m[i+ 2], 15, 718787259);\r\n b = II(b, c, d, a, m[i+ 9], 21, -343485551);\r\n\r\n a = (a + aa) >>> 0;\r\n b = (b + bb) >>> 0;\r\n c = (c + cc) >>> 0;\r\n d = (d + dd) >>> 0;\r\n }\r\n\r\n return crypt.endian([a, b, c, d]);\r\n };\r\n\r\n // Auxiliary functions\r\n md5._ff = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._gg = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._hh = function (a, b, c, d, x, s, t) {\r\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._ii = function (a, b, c, d, x, s, t) {\r\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n\r\n // Package private blocksize\r\n md5._blocksize = 16;\r\n md5._digestsize = 16;\r\n\r\n module.exports = function (message, options) {\r\n if (message === undefined || message === null)\r\n throw new Error('Illegal argument ' + message);\r\n\r\n var digestbytes = crypt.wordsToBytes(md5(message, options));\r\n return options && options.asBytes ? digestbytes :\r\n options && options.asString ? bin.bytesToString(digestbytes) :\r\n crypt.bytesToHex(digestbytes);\r\n };\r\n\r\n})();\r\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","// Generated by CoffeeScript 1.12.7\n(function() {\n var JSONStorage, KEY_FOR_EMPTY_STRING, LocalStorage, MetaKey, QUOTA_EXCEEDED_ERR, StorageEvent, _emptyDirectory, _escapeKey, _rm, createMap, events, fs, path, writeSync,\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n path = require('path');\n\n fs = require('fs');\n\n events = require('events');\n\n writeSync = require('write-file-atomic').sync;\n\n KEY_FOR_EMPTY_STRING = '---.EMPTY_STRING.---';\n\n _emptyDirectory = function(target) {\n var i, len, p, ref, results;\n ref = fs.readdirSync(target);\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n p = ref[i];\n results.push(_rm(path.join(target, p)));\n }\n return results;\n };\n\n _rm = function(target) {\n if (fs.statSync(target).isDirectory()) {\n _emptyDirectory(target);\n return fs.rmdirSync(target);\n } else {\n return fs.unlinkSync(target);\n }\n };\n\n _escapeKey = function(key) {\n var newKey;\n if (key === '') {\n newKey = KEY_FOR_EMPTY_STRING;\n } else {\n newKey = key.toString();\n }\n return newKey;\n };\n\n QUOTA_EXCEEDED_ERR = (function(superClass) {\n extend(QUOTA_EXCEEDED_ERR, superClass);\n\n function QUOTA_EXCEEDED_ERR(message) {\n this.message = message != null ? message : 'Unknown error.';\n QUOTA_EXCEEDED_ERR.__super__.constructor.call(this);\n if (Error.captureStackTrace != null) {\n Error.captureStackTrace(this, this.constructor);\n }\n this.name = this.constructor.name;\n }\n\n QUOTA_EXCEEDED_ERR.prototype.toString = function() {\n return this.name + \": \" + this.message;\n };\n\n return QUOTA_EXCEEDED_ERR;\n\n })(Error);\n\n StorageEvent = (function() {\n function StorageEvent(key1, oldValue1, newValue1, url, storageArea) {\n this.key = key1;\n this.oldValue = oldValue1;\n this.newValue = newValue1;\n this.url = url;\n this.storageArea = storageArea != null ? storageArea : 'localStorage';\n }\n\n return StorageEvent;\n\n })();\n\n MetaKey = (function() {\n function MetaKey(key1, index1) {\n this.key = key1;\n this.index = index1;\n if (!(this instanceof MetaKey)) {\n return new MetaKey(this.key, this.index);\n }\n }\n\n return MetaKey;\n\n })();\n\n createMap = function() {\n var Map;\n Map = function() {};\n Map.prototype = Object.create(null);\n return new Map();\n };\n\n LocalStorage = (function(superClass) {\n var instanceMap;\n\n extend(LocalStorage, superClass);\n\n instanceMap = {};\n\n function LocalStorage(_location, quota) {\n var handler;\n this._location = _location;\n this.quota = quota != null ? quota : 5 * 1024 * 1024;\n LocalStorage.__super__.constructor.call(this);\n if (!(this instanceof LocalStorage)) {\n return new LocalStorage(this._location, this.quota);\n }\n this._location = path.resolve(this._location);\n if (instanceMap[this._location] != null) {\n return instanceMap[this._location];\n }\n this.length = 0;\n this._bytesInUse = 0;\n this._keys = [];\n this._metaKeyMap = createMap();\n this._eventUrl = \"pid:\" + process.pid;\n this._init();\n this._QUOTA_EXCEEDED_ERR = QUOTA_EXCEEDED_ERR;\n if (typeof Proxy !== \"undefined\" && Proxy !== null) {\n handler = {\n set: (function(_this) {\n return function(receiver, key, value) {\n if (_this[key] != null) {\n return _this[key] = value;\n } else {\n return _this.setItem(key, value);\n }\n };\n })(this),\n get: (function(_this) {\n return function(receiver, key) {\n if (_this[key] != null) {\n return _this[key];\n } else {\n return _this.getItem(key);\n }\n };\n })(this)\n };\n instanceMap[this._location] = new Proxy(this, handler);\n return instanceMap[this._location];\n }\n instanceMap[this._location] = this;\n return instanceMap[this._location];\n }\n\n LocalStorage.prototype._init = function() {\n var _MetaKey, _decodedKey, _keys, e, i, index, k, len, stat;\n try {\n stat = fs.statSync(this._location);\n if ((stat != null) && !stat.isDirectory()) {\n throw new Error(\"A file exists at the location '\" + this._location + \"' when trying to create/open localStorage\");\n }\n this._bytesInUse = 0;\n this.length = 0;\n _keys = fs.readdirSync(this._location);\n for (index = i = 0, len = _keys.length; i < len; index = ++i) {\n k = _keys[index];\n _decodedKey = decodeURIComponent(k);\n this._keys.push(_decodedKey);\n _MetaKey = new MetaKey(k, index);\n this._metaKeyMap[_decodedKey] = _MetaKey;\n stat = this._getStat(k);\n if ((stat != null ? stat.size : void 0) != null) {\n _MetaKey.size = stat.size;\n this._bytesInUse += stat.size;\n }\n }\n this.length = _keys.length;\n } catch (error) {\n e = error;\n if (e.code !== \"ENOENT\") {\n throw e;\n }\n try {\n fs.mkdirSync(this._location, {\n recursive: true\n });\n } catch (error) {\n e = error;\n if (e.code !== \"EEXIST\") {\n throw e;\n }\n }\n }\n };\n\n LocalStorage.prototype.setItem = function(key, value) {\n var encodedKey, evnt, existsBeforeSet, filename, hasListeners, metaKey, oldLength, oldValue, valueString, valueStringLength;\n hasListeners = events.EventEmitter.listenerCount(this, 'storage');\n oldValue = null;\n if (hasListeners) {\n oldValue = this.getItem(key);\n }\n key = _escapeKey(key);\n encodedKey = encodeURIComponent(key);\n filename = path.join(this._location, encodedKey);\n valueString = value.toString();\n valueStringLength = valueString.length;\n metaKey = this._metaKeyMap[key];\n existsBeforeSet = !!metaKey;\n if (existsBeforeSet) {\n oldLength = metaKey.size;\n } else {\n oldLength = 0;\n }\n if (this._bytesInUse - oldLength + valueStringLength > this.quota) {\n throw new QUOTA_EXCEEDED_ERR();\n }\n writeSync(filename, valueString, 'utf8');\n if (!existsBeforeSet) {\n metaKey = new MetaKey(encodedKey, (this._keys.push(key)) - 1);\n metaKey.size = valueStringLength;\n this._metaKeyMap[key] = metaKey;\n this.length += 1;\n this._bytesInUse += valueStringLength;\n }\n if (hasListeners) {\n evnt = new StorageEvent(key, oldValue, value, this._eventUrl);\n return this.emit('storage', evnt);\n }\n };\n\n LocalStorage.prototype.getItem = function(key) {\n var filename, metaKey;\n key = _escapeKey(key);\n metaKey = this._metaKeyMap[key];\n if (!!metaKey) {\n filename = path.join(this._location, metaKey.key);\n return fs.readFileSync(filename, 'utf8');\n } else {\n return null;\n }\n };\n\n LocalStorage.prototype._getStat = function(key) {\n var filename;\n key = _escapeKey(key);\n filename = path.join(this._location, encodeURIComponent(key));\n try {\n return fs.statSync(filename);\n } catch (error) {\n return null;\n }\n };\n\n LocalStorage.prototype.removeItem = function(key) {\n var evnt, filename, hasListeners, k, meta, metaKey, oldValue, ref, v;\n key = _escapeKey(key);\n metaKey = this._metaKeyMap[key];\n if (!!metaKey) {\n hasListeners = events.EventEmitter.listenerCount(this, 'storage');\n oldValue = null;\n if (hasListeners) {\n oldValue = this.getItem(key);\n }\n delete this._metaKeyMap[key];\n this.length -= 1;\n this._bytesInUse -= metaKey.size;\n filename = path.join(this._location, metaKey.key);\n this._keys.splice(metaKey.index, 1);\n ref = this._metaKeyMap;\n for (k in ref) {\n v = ref[k];\n meta = this._metaKeyMap[k];\n if (meta.index > metaKey.index) {\n meta.index -= 1;\n }\n }\n _rm(filename);\n if (hasListeners) {\n evnt = new StorageEvent(key, oldValue, null, this._eventUrl);\n return this.emit('storage', evnt);\n }\n }\n };\n\n LocalStorage.prototype.key = function(n) {\n var rawKey;\n rawKey = this._keys[n];\n if (rawKey === KEY_FOR_EMPTY_STRING) {\n return '';\n } else {\n return rawKey;\n }\n };\n\n LocalStorage.prototype.clear = function() {\n var evnt;\n _emptyDirectory(this._location);\n this._metaKeyMap = createMap();\n this._keys = [];\n this.length = 0;\n this._bytesInUse = 0;\n if (events.EventEmitter.listenerCount(this, 'storage')) {\n evnt = new StorageEvent(null, null, null, this._eventUrl);\n return this.emit('storage', evnt);\n }\n };\n\n LocalStorage.prototype._getBytesInUse = function() {\n return this._bytesInUse;\n };\n\n LocalStorage.prototype._deleteLocation = function() {\n delete instanceMap[this._location];\n _rm(this._location);\n this._metaKeyMap = {};\n this._keys = [];\n this.length = 0;\n return this._bytesInUse = 0;\n };\n\n return LocalStorage;\n\n })(events.EventEmitter);\n\n JSONStorage = (function(superClass) {\n extend(JSONStorage, superClass);\n\n function JSONStorage() {\n return JSONStorage.__super__.constructor.apply(this, arguments);\n }\n\n JSONStorage.prototype.setItem = function(key, value) {\n var newValue;\n newValue = JSON.stringify(value);\n return JSONStorage.__super__.setItem.call(this, key, newValue);\n };\n\n JSONStorage.prototype.getItem = function(key) {\n return JSON.parse(JSONStorage.__super__.getItem.call(this, key));\n };\n\n return JSONStorage;\n\n })(LocalStorage);\n\n exports.LocalStorage = LocalStorage;\n\n exports.JSONStorage = JSONStorage;\n\n exports.QUOTA_EXCEEDED_ERR = QUOTA_EXCEEDED_ERR;\n\n}).call(this);\n","'use strict';\nmodule.exports = require('./lib/index');\n","'use strict';\n\nvar randomFromSeed = require('./random/random-from-seed');\n\nvar ORIGINAL = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-';\nvar alphabet;\nvar previousSeed;\n\nvar shuffled;\n\nfunction reset() {\n shuffled = false;\n}\n\nfunction setCharacters(_alphabet_) {\n if (!_alphabet_) {\n if (alphabet !== ORIGINAL) {\n alphabet = ORIGINAL;\n reset();\n }\n return;\n }\n\n if (_alphabet_ === alphabet) {\n return;\n }\n\n if (_alphabet_.length !== ORIGINAL.length) {\n throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. You submitted ' + _alphabet_.length + ' characters: ' + _alphabet_);\n }\n\n var unique = _alphabet_.split('').filter(function(item, ind, arr){\n return ind !== arr.lastIndexOf(item);\n });\n\n if (unique.length) {\n throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. These characters were not unique: ' + unique.join(', '));\n }\n\n alphabet = _alphabet_;\n reset();\n}\n\nfunction characters(_alphabet_) {\n setCharacters(_alphabet_);\n return alphabet;\n}\n\nfunction setSeed(seed) {\n randomFromSeed.seed(seed);\n if (previousSeed !== seed) {\n reset();\n previousSeed = seed;\n }\n}\n\nfunction shuffle() {\n if (!alphabet) {\n setCharacters(ORIGINAL);\n }\n\n var sourceArray = alphabet.split('');\n var targetArray = [];\n var r = randomFromSeed.nextValue();\n var characterIndex;\n\n while (sourceArray.length > 0) {\n r = randomFromSeed.nextValue();\n characterIndex = Math.floor(r * sourceArray.length);\n targetArray.push(sourceArray.splice(characterIndex, 1)[0]);\n }\n return targetArray.join('');\n}\n\nfunction getShuffled() {\n if (shuffled) {\n return shuffled;\n }\n shuffled = shuffle();\n return shuffled;\n}\n\n/**\n * lookup shuffled letter\n * @param index\n * @returns {string}\n */\nfunction lookup(index) {\n var alphabetShuffled = getShuffled();\n return alphabetShuffled[index];\n}\n\nfunction get () {\n return alphabet || ORIGINAL;\n}\n\nmodule.exports = {\n get: get,\n characters: characters,\n seed: setSeed,\n lookup: lookup,\n shuffled: getShuffled\n};\n","'use strict';\n\nvar generate = require('./generate');\nvar alphabet = require('./alphabet');\n\n// Ignore all milliseconds before a certain time to reduce the size of the date entropy without sacrificing uniqueness.\n// This number should be updated every year or so to keep the generated id short.\n// To regenerate `new Date() - 0` and bump the version. Always bump the version!\nvar REDUCE_TIME = 1567752802062;\n\n// don't change unless we change the algos or REDUCE_TIME\n// must be an integer and less than 16\nvar version = 7;\n\n// Counter is used when shortid is called multiple times in one second.\nvar counter;\n\n// Remember the last time shortid was called in case counter is needed.\nvar previousSeconds;\n\n/**\n * Generate unique id\n * Returns string id\n */\nfunction build(clusterWorkerId) {\n var str = '';\n\n var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001);\n\n if (seconds === previousSeconds) {\n counter++;\n } else {\n counter = 0;\n previousSeconds = seconds;\n }\n\n str = str + generate(version);\n str = str + generate(clusterWorkerId);\n if (counter > 0) {\n str = str + generate(counter);\n }\n str = str + generate(seconds);\n return str;\n}\n\nmodule.exports = build;\n","'use strict';\n\nvar alphabet = require('./alphabet');\nvar random = require('./random/random-byte');\nvar format = require('nanoid/format');\n\nfunction generate(number) {\n var loopCounter = 0;\n var done;\n\n var str = '';\n\n while (!done) {\n str = str + format(random, alphabet.get(), 1);\n done = number < (Math.pow(16, loopCounter + 1 ) );\n loopCounter++;\n }\n return str;\n}\n\nmodule.exports = generate;\n","'use strict';\n\nvar alphabet = require('./alphabet');\nvar build = require('./build');\nvar isValid = require('./is-valid');\n\n// if you are using cluster or multiple servers use this to make each instance\n// has a unique value for worker\n// Note: I don't know if this is automatically set when using third\n// party cluster solutions such as pm2.\nvar clusterWorkerId = require('./util/cluster-worker-id') || 0;\n\n/**\n * Set the seed.\n * Highly recommended if you don't want people to try to figure out your id schema.\n * exposed as shortid.seed(int)\n * @param seed Integer value to seed the random alphabet. ALWAYS USE THE SAME SEED or you might get overlaps.\n */\nfunction seed(seedValue) {\n alphabet.seed(seedValue);\n return module.exports;\n}\n\n/**\n * Set the cluster worker or machine id\n * exposed as shortid.worker(int)\n * @param workerId worker must be positive integer. Number less than 16 is recommended.\n * returns shortid module so it can be chained.\n */\nfunction worker(workerId) {\n clusterWorkerId = workerId;\n return module.exports;\n}\n\n/**\n *\n * sets new characters to use in the alphabet\n * returns the shuffled alphabet\n */\nfunction characters(newCharacters) {\n if (newCharacters !== undefined) {\n alphabet.characters(newCharacters);\n }\n\n return alphabet.shuffled();\n}\n\n/**\n * Generate unique id\n * Returns string id\n */\nfunction generate() {\n return build(clusterWorkerId);\n}\n\n// Export all other functions as properties of the generate function\nmodule.exports = generate;\nmodule.exports.generate = generate;\nmodule.exports.seed = seed;\nmodule.exports.worker = worker;\nmodule.exports.characters = characters;\nmodule.exports.isValid = isValid;\n","'use strict';\nvar alphabet = require('./alphabet');\n\nfunction isShortId(id) {\n if (!id || typeof id !== 'string' || id.length < 6 ) {\n return false;\n }\n\n var nonAlphabetic = new RegExp('[^' +\n alphabet.get().replace(/[|\\\\{}()[\\]^$+*?.-]/g, '\\\\$&') +\n ']');\n return !nonAlphabetic.test(id);\n}\n\nmodule.exports = isShortId;\n","'use strict';\n\nvar crypto = typeof window === 'object' && (window.crypto || window.msCrypto); // IE 11 uses window.msCrypto\n\nvar randomByte;\n\nif (!crypto || !crypto.getRandomValues) {\n randomByte = function(size) {\n var bytes = [];\n for (var i = 0; i < size; i++) {\n bytes.push(Math.floor(Math.random() * 256));\n }\n return bytes;\n };\n} else {\n randomByte = function(size) {\n return crypto.getRandomValues(new Uint8Array(size));\n };\n}\n\nmodule.exports = randomByte;\n","'use strict';\n\n// Found this seed-based random generator somewhere\n// Based on The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)\n\nvar seed = 1;\n\n/**\n * return a random number based on a seed\n * @param seed\n * @returns {number}\n */\nfunction getNextValue() {\n seed = (seed * 9301 + 49297) % 233280;\n return seed/(233280.0);\n}\n\nfunction setSeed(_seed_) {\n seed = _seed_;\n}\n\nmodule.exports = {\n nextValue: getNextValue,\n seed: setSeed\n};\n","'use strict';\n\nmodule.exports = 0;\n","// This file replaces `format.js` in bundlers like webpack or Rollup,\n// according to `browser` config in `package.json`.\n\nmodule.exports = function (random, alphabet, size) {\n // We can’t use bytes bigger than the alphabet. To make bytes values closer\n // to the alphabet, we apply bitmask on them. We look for the closest\n // `2 ** x - 1` number, which will be bigger than alphabet size. If we have\n // 30 symbols in the alphabet, we will take 31 (00011111).\n // We do not use faster Math.clz32, because it is not available in browsers.\n var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1\n // Bitmask is not a perfect solution (in our example it will pass 31 bytes,\n // which is bigger than the alphabet). As a result, we will need more bytes,\n // than ID size, because we will refuse bytes bigger than the alphabet.\n\n // Every hardware random generator call is costly,\n // because we need to wait for entropy collection. This is why often it will\n // be faster to ask for few extra bytes in advance, to avoid additional calls.\n\n // Here we calculate how many random bytes should we call in advance.\n // It depends on ID length, mask / alphabet size and magic number 1.6\n // (which was selected according benchmarks).\n\n // -~f => Math.ceil(f) if n is float number\n // -~i => i + 1 if n is integer number\n var step = -~(1.6 * mask * size / alphabet.length)\n var id = ''\n\n while (true) {\n var bytes = random(step)\n // Compact alternative for `for (var i = 0; i < step; i++)`\n var i = step\n while (i--) {\n // If random byte is bigger than alphabet even after bitmask,\n // we refuse it by `|| ''`.\n id += alphabet[bytes[i] & mask] || ''\n // More compact than `id.length + 1 === size`\n if (id.length === +size) return id\n }\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar typeChecker = function (type) {\n var typeString = \"[object \" + type + \"]\";\n return function (value) {\n return getClassName(value) === typeString;\n };\n};\nvar getClassName = function (value) { return Object.prototype.toString.call(value); };\nvar comparable = function (value) {\n if (value instanceof Date) {\n return value.getTime();\n }\n else if (isArray(value)) {\n return value.map(comparable);\n }\n else if (value && typeof value.toJSON === \"function\") {\n return value.toJSON();\n }\n return value;\n};\nvar isArray = typeChecker(\"Array\");\nvar isObject = typeChecker(\"Object\");\nvar isFunction = typeChecker(\"Function\");\nvar isVanillaObject = function (value) {\n return (value &&\n (value.constructor === Object ||\n value.constructor === Array ||\n value.constructor.toString() === \"function Object() { [native code] }\" ||\n value.constructor.toString() === \"function Array() { [native code] }\") &&\n !value.toJSON);\n};\nvar equals = function (a, b) {\n if (a == null && a == b) {\n return true;\n }\n if (a === b) {\n return true;\n }\n if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) {\n return false;\n }\n if (isArray(a)) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0, length_1 = a.length; i < length_1; i++) {\n if (!equals(a[i], b[i]))\n return false;\n }\n return true;\n }\n else if (isObject(a)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (var key in a) {\n if (!equals(a[key], b[key]))\n return false;\n }\n return true;\n }\n return false;\n};\n\n/**\n * Walks through each value given the context - used for nested operations. E.g:\n * { \"person.address\": { $eq: \"blarg\" }}\n */\nvar walkKeyPathValues = function (item, keyPath, next, depth, key, owner) {\n var currentKey = keyPath[depth];\n // if array, then try matching. Might fall through for cases like:\n // { $eq: [1, 2, 3] }, [ 1, 2, 3 ].\n if (isArray(item) && isNaN(Number(currentKey))) {\n for (var i = 0, length_1 = item.length; i < length_1; i++) {\n // if FALSE is returned, then terminate walker. For operations, this simply\n // means that the search critera was met.\n if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) {\n return false;\n }\n }\n }\n if (depth === keyPath.length || item == null) {\n return next(item, key, owner);\n }\n return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item);\n};\nvar BaseOperation = /** @class */ (function () {\n function BaseOperation(params, owneryQuery, options) {\n this.params = params;\n this.owneryQuery = owneryQuery;\n this.options = options;\n this.init();\n }\n BaseOperation.prototype.init = function () { };\n BaseOperation.prototype.reset = function () {\n this.done = false;\n this.keep = false;\n };\n return BaseOperation;\n}());\nvar NamedBaseOperation = /** @class */ (function (_super) {\n __extends(NamedBaseOperation, _super);\n function NamedBaseOperation(params, owneryQuery, options, name) {\n var _this = _super.call(this, params, owneryQuery, options) || this;\n _this.name = name;\n return _this;\n }\n return NamedBaseOperation;\n}(BaseOperation));\nvar GroupOperation = /** @class */ (function (_super) {\n __extends(GroupOperation, _super);\n function GroupOperation(params, owneryQuery, options, children) {\n var _this = _super.call(this, params, owneryQuery, options) || this;\n _this.children = children;\n return _this;\n }\n /**\n */\n GroupOperation.prototype.reset = function () {\n this.keep = false;\n this.done = false;\n for (var i = 0, length_2 = this.children.length; i < length_2; i++) {\n this.children[i].reset();\n }\n };\n /**\n */\n GroupOperation.prototype.childrenNext = function (item, key, owner) {\n var done = true;\n var keep = true;\n for (var i = 0, length_3 = this.children.length; i < length_3; i++) {\n var childOperation = this.children[i];\n childOperation.next(item, key, owner);\n if (!childOperation.keep) {\n keep = false;\n }\n if (childOperation.done) {\n if (!childOperation.keep) {\n break;\n }\n }\n else {\n done = false;\n }\n }\n this.done = done;\n this.keep = keep;\n };\n return GroupOperation;\n}(BaseOperation));\nvar NamedGroupOperation = /** @class */ (function (_super) {\n __extends(NamedGroupOperation, _super);\n function NamedGroupOperation(params, owneryQuery, options, children, name) {\n var _this = _super.call(this, params, owneryQuery, options, children) || this;\n _this.name = name;\n return _this;\n }\n return NamedGroupOperation;\n}(GroupOperation));\nvar QueryOperation = /** @class */ (function (_super) {\n __extends(QueryOperation, _super);\n function QueryOperation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n */\n QueryOperation.prototype.next = function (item, key, parent) {\n this.childrenNext(item, key, parent);\n };\n return QueryOperation;\n}(GroupOperation));\nvar NestedOperation = /** @class */ (function (_super) {\n __extends(NestedOperation, _super);\n function NestedOperation(keyPath, params, owneryQuery, options, children) {\n var _this = _super.call(this, params, owneryQuery, options, children) || this;\n _this.keyPath = keyPath;\n /**\n */\n _this._nextNestedValue = function (value, key, owner) {\n _this.childrenNext(value, key, owner);\n return !_this.done;\n };\n return _this;\n }\n /**\n */\n NestedOperation.prototype.next = function (item, key, parent) {\n walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent);\n };\n return NestedOperation;\n}(GroupOperation));\nvar createTester = function (a, compare) {\n if (a instanceof Function) {\n return a;\n }\n if (a instanceof RegExp) {\n return function (b) {\n var result = typeof b === \"string\" && a.test(b);\n a.lastIndex = 0;\n return result;\n };\n }\n var comparableA = comparable(a);\n return function (b) { return compare(comparableA, comparable(b)); };\n};\nvar EqualsOperation = /** @class */ (function (_super) {\n __extends(EqualsOperation, _super);\n function EqualsOperation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EqualsOperation.prototype.init = function () {\n this._test = createTester(this.params, this.options.compare);\n };\n EqualsOperation.prototype.next = function (item, key, parent) {\n if (!Array.isArray(parent) || parent.hasOwnProperty(key)) {\n if (this._test(item, key, parent)) {\n this.done = true;\n this.keep = true;\n }\n }\n };\n return EqualsOperation;\n}(BaseOperation));\nvar createEqualsOperation = function (params, owneryQuery, options) { return new EqualsOperation(params, owneryQuery, options); };\nvar NopeOperation = /** @class */ (function (_super) {\n __extends(NopeOperation, _super);\n function NopeOperation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NopeOperation.prototype.next = function () {\n this.done = true;\n this.keep = false;\n };\n return NopeOperation;\n}(BaseOperation));\nvar numericalOperationCreator = function (createNumericalOperation) { return function (params, owneryQuery, options, name) {\n if (params == null) {\n return new NopeOperation(params, owneryQuery, options);\n }\n return createNumericalOperation(params, owneryQuery, options, name);\n}; };\nvar numericalOperation = function (createTester) {\n return numericalOperationCreator(function (params, owneryQuery, options) {\n var typeofParams = typeof comparable(params);\n var test = createTester(params);\n return new EqualsOperation(function (b) {\n return typeof comparable(b) === typeofParams && test(b);\n }, owneryQuery, options);\n });\n};\nvar createNamedOperation = function (name, params, parentQuery, options) {\n var operationCreator = options.operations[name];\n if (!operationCreator) {\n throw new Error(\"Unsupported operation: \" + name);\n }\n return operationCreator(params, parentQuery, options, name);\n};\nvar containsOperation = function (query) {\n for (var key in query) {\n if (key.charAt(0) === \"$\")\n return true;\n }\n return false;\n};\nvar createNestedOperation = function (keyPath, nestedQuery, owneryQuery, options) {\n if (containsOperation(nestedQuery)) {\n var _a = createQueryOperations(nestedQuery, options), selfOperations = _a[0], nestedOperations = _a[1];\n if (nestedOperations.length) {\n throw new Error(\"Property queries must contain only operations, or exact objects.\");\n }\n return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations);\n }\n return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [\n new EqualsOperation(nestedQuery, owneryQuery, options)\n ]);\n};\nvar createQueryOperation = function (query, owneryQuery, _a) {\n if (owneryQuery === void 0) { owneryQuery = null; }\n var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations;\n var options = {\n compare: compare || equals,\n operations: Object.assign({}, operations || {})\n };\n var _c = createQueryOperations(query, options), selfOperations = _c[0], nestedOperations = _c[1];\n var ops = [];\n if (selfOperations.length) {\n ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations));\n }\n ops.push.apply(ops, nestedOperations);\n if (ops.length === 1) {\n return ops[0];\n }\n return new QueryOperation(query, owneryQuery, options, ops);\n};\nvar createQueryOperations = function (query, options) {\n var selfOperations = [];\n var nestedOperations = [];\n if (!isVanillaObject(query)) {\n selfOperations.push(new EqualsOperation(query, query, options));\n return [selfOperations, nestedOperations];\n }\n for (var key in query) {\n if (key.charAt(0) === \"$\") {\n var op = createNamedOperation(key, query[key], query, options);\n // probably just a flag for another operation (like $options)\n if (op != null) {\n selfOperations.push(op);\n }\n }\n else {\n nestedOperations.push(createNestedOperation(key.split(\".\"), query[key], query, options));\n }\n }\n return [selfOperations, nestedOperations];\n};\nvar createOperationTester = function (operation) { return function (item, key, owner) {\n operation.reset();\n operation.next(item, key, owner);\n return operation.keep;\n}; };\nvar createQueryTester = function (query, options) {\n if (options === void 0) { options = {}; }\n return createOperationTester(createQueryOperation(query, null, options));\n};\n\nvar $Ne = /** @class */ (function (_super) {\n __extends($Ne, _super);\n function $Ne() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Ne.prototype.init = function () {\n this._test = createTester(this.params, this.options.compare);\n };\n $Ne.prototype.reset = function () {\n _super.prototype.reset.call(this);\n this.keep = true;\n };\n $Ne.prototype.next = function (item) {\n if (this._test(item)) {\n this.done = true;\n this.keep = false;\n }\n };\n return $Ne;\n}(NamedBaseOperation));\n// https://docs.mongodb.com/manual/reference/operator/query/elemMatch/\nvar $ElemMatch = /** @class */ (function (_super) {\n __extends($ElemMatch, _super);\n function $ElemMatch() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $ElemMatch.prototype.init = function () {\n this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options);\n };\n $ElemMatch.prototype.reset = function () {\n _super.prototype.reset.call(this);\n this._queryOperation.reset();\n };\n $ElemMatch.prototype.next = function (item) {\n if (isArray(item)) {\n for (var i = 0, length_1 = item.length; i < length_1; i++) {\n // reset query operation since item being tested needs to pass _all_ query\n // operations for it to be a success\n this._queryOperation.reset();\n // check item\n this._queryOperation.next(item[i], i, item);\n this.keep = this.keep || this._queryOperation.keep;\n }\n this.done = true;\n }\n else {\n this.done = false;\n this.keep = false;\n }\n };\n return $ElemMatch;\n}(NamedBaseOperation));\nvar $Not = /** @class */ (function (_super) {\n __extends($Not, _super);\n function $Not() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Not.prototype.init = function () {\n this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options);\n };\n $Not.prototype.reset = function () {\n this._queryOperation.reset();\n };\n $Not.prototype.next = function (item, key, owner) {\n this._queryOperation.next(item, key, owner);\n this.done = this._queryOperation.done;\n this.keep = !this._queryOperation.keep;\n };\n return $Not;\n}(NamedBaseOperation));\nvar $Size = /** @class */ (function (_super) {\n __extends($Size, _super);\n function $Size() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Size.prototype.init = function () { };\n $Size.prototype.next = function (item) {\n if (isArray(item) && item.length === this.params) {\n this.done = true;\n this.keep = true;\n }\n // if (parent && parent.length === this.params) {\n // this.done = true;\n // this.keep = true;\n // }\n };\n return $Size;\n}(NamedBaseOperation));\nvar $Or = /** @class */ (function (_super) {\n __extends($Or, _super);\n function $Or() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Or.prototype.init = function () {\n var _this = this;\n this._ops = this.params.map(function (op) {\n return createQueryOperation(op, null, _this.options);\n });\n };\n $Or.prototype.reset = function () {\n this.done = false;\n this.keep = false;\n for (var i = 0, length_2 = this._ops.length; i < length_2; i++) {\n this._ops[i].reset();\n }\n };\n $Or.prototype.next = function (item, key, owner) {\n var done = false;\n var success = false;\n for (var i = 0, length_3 = this._ops.length; i < length_3; i++) {\n var op = this._ops[i];\n op.next(item, key, owner);\n if (op.keep) {\n done = true;\n success = op.keep;\n break;\n }\n }\n this.keep = success;\n this.done = done;\n };\n return $Or;\n}(NamedBaseOperation));\nvar $Nor = /** @class */ (function (_super) {\n __extends($Nor, _super);\n function $Nor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Nor.prototype.next = function (item, key, owner) {\n _super.prototype.next.call(this, item, key, owner);\n this.keep = !this.keep;\n };\n return $Nor;\n}($Or));\nvar $In = /** @class */ (function (_super) {\n __extends($In, _super);\n function $In() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $In.prototype.init = function () {\n var _this = this;\n this._testers = this.params.map(function (value) {\n if (containsOperation(value)) {\n throw new Error(\"cannot nest $ under \" + _this.constructor.name.toLowerCase());\n }\n return createTester(value, _this.options.compare);\n });\n };\n $In.prototype.next = function (item, key, owner) {\n var done = false;\n var success = false;\n for (var i = 0, length_4 = this._testers.length; i < length_4; i++) {\n var test = this._testers[i];\n if (test(item)) {\n done = true;\n success = true;\n break;\n }\n }\n this.keep = success;\n this.done = done;\n };\n return $In;\n}(NamedBaseOperation));\nvar $Nin = /** @class */ (function (_super) {\n __extends($Nin, _super);\n function $Nin() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Nin.prototype.next = function (item, key, owner) {\n _super.prototype.next.call(this, item, key, owner);\n this.keep = !this.keep;\n };\n return $Nin;\n}($In));\nvar $Exists = /** @class */ (function (_super) {\n __extends($Exists, _super);\n function $Exists() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Exists.prototype.next = function (item, key, owner) {\n if (owner.hasOwnProperty(key) === this.params) {\n this.done = true;\n this.keep = true;\n }\n };\n return $Exists;\n}(NamedBaseOperation));\nvar $And = /** @class */ (function (_super) {\n __extends($And, _super);\n function $And(params, owneryQuery, options, name) {\n return _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;\n }\n $And.prototype.next = function (item, key, owner) {\n this.childrenNext(item, key, owner);\n };\n return $And;\n}(NamedGroupOperation));\nvar $eq = function (params, owneryQuery, options) {\n return new EqualsOperation(params, owneryQuery, options);\n};\nvar $ne = function (params, owneryQuery, options, name) { return new $Ne(params, owneryQuery, options, name); };\nvar $or = function (params, owneryQuery, options, name) { return new $Or(params, owneryQuery, options, name); };\nvar $nor = function (params, owneryQuery, options, name) { return new $Nor(params, owneryQuery, options, name); };\nvar $elemMatch = function (params, owneryQuery, options, name) { return new $ElemMatch(params, owneryQuery, options, name); };\nvar $nin = function (params, owneryQuery, options, name) { return new $Nin(params, owneryQuery, options, name); };\nvar $in = function (params, owneryQuery, options, name) { return new $In(params, owneryQuery, options, name); };\nvar $lt = numericalOperation(function (params) { return function (b) { return b < params; }; });\nvar $lte = numericalOperation(function (params) { return function (b) { return b <= params; }; });\nvar $gt = numericalOperation(function (params) { return function (b) { return b > params; }; });\nvar $gte = numericalOperation(function (params) { return function (b) { return b >= params; }; });\nvar $mod = function (_a, owneryQuery, options) {\n var mod = _a[0], equalsValue = _a[1];\n return new EqualsOperation(function (b) { return comparable(b) % mod === equalsValue; }, owneryQuery, options);\n};\nvar $exists = function (params, owneryQuery, options, name) { return new $Exists(params, owneryQuery, options, name); };\nvar $regex = function (pattern, owneryQuery, options) {\n return new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options);\n};\nvar $not = function (params, owneryQuery, options, name) { return new $Not(params, owneryQuery, options, name); };\nvar $type = function (clazz, owneryQuery, options) {\n return new EqualsOperation(function (b) { return (b != null ? b instanceof clazz || b.constructor === clazz : false); }, owneryQuery, options);\n};\nvar $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); };\nvar $all = $and;\nvar $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, \"$size\"); };\nvar $options = function () { return null; };\nvar $where = function (params, ownerQuery, options) {\n var test;\n if (isFunction(params)) {\n test = params;\n }\n else if (!process.env.CSP_ENABLED) {\n test = new Function(\"obj\", \"return \" + params);\n }\n else {\n throw new Error(\"In CSP mode, sift does not support strings in \\\"$where\\\" condition\");\n }\n return new EqualsOperation(function (b) { return test.bind(b)(b); }, ownerQuery, options);\n};\n\nvar defaultOperations = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $Size: $Size,\n $eq: $eq,\n $ne: $ne,\n $or: $or,\n $nor: $nor,\n $elemMatch: $elemMatch,\n $nin: $nin,\n $in: $in,\n $lt: $lt,\n $lte: $lte,\n $gt: $gt,\n $gte: $gte,\n $mod: $mod,\n $exists: $exists,\n $regex: $regex,\n $not: $not,\n $type: $type,\n $and: $and,\n $all: $all,\n $size: $size,\n $options: $options,\n $where: $where\n});\n\nvar createDefaultQueryOperation = function (query, ownerQuery, _a) {\n var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations;\n return createQueryOperation(query, ownerQuery, {\n compare: compare,\n operations: Object.assign({}, defaultOperations, operations || {})\n });\n};\nvar createDefaultQueryTester = function (query, options) {\n if (options === void 0) { options = {}; }\n var op = createDefaultQueryOperation(query, null, options);\n return createOperationTester(op);\n};\n\nexport default createDefaultQueryTester;\nexport { $Size, $all, $and, $elemMatch, $eq, $exists, $gt, $gte, $in, $lt, $lte, $mod, $ne, $nin, $nor, $not, $options, $or, $regex, $size, $type, $where, EqualsOperation, createDefaultQueryOperation, createEqualsOperation, createOperationTester, createQueryOperation, createQueryTester };\n//# sourceMappingURL=index.js.map\n","\n/*\nusage:\n\n// do something to a list of things\nasyncMap(myListOfStuff, function (thing, cb) { doSomething(thing.foo, cb) }, cb)\n// do more than one thing to each item\nasyncMap(list, fooFn, barFn, cb)\n\n*/\n\nmodule.exports = asyncMap\n\nfunction asyncMap () {\n var steps = Array.prototype.slice.call(arguments)\n , list = steps.shift() || []\n , cb_ = steps.pop()\n if (typeof cb_ !== \"function\") throw new Error(\n \"No callback provided to asyncMap\")\n if (!list) return cb_(null, [])\n if (!Array.isArray(list)) list = [list]\n var n = steps.length\n , data = [] // 2d array\n , errState = null\n , l = list.length\n , a = l * n\n if (!a) return cb_(null, [])\n function cb (er) {\n if (er && !errState) errState = er\n\n var argLen = arguments.length\n for (var i = 1; i < argLen; i ++) if (arguments[i] !== undefined) {\n data[i - 1] = (data[i - 1] || []).concat(arguments[i])\n }\n // see if any new things have been added.\n if (list.length > l) {\n var newList = list.slice(l)\n a += (list.length - l) * n\n l = list.length\n process.nextTick(function () {\n newList.forEach(function (ar) {\n steps.forEach(function (fn) { fn(ar, cb) })\n })\n })\n }\n\n if (--a === 0) cb_.apply(null, [errState].concat(data))\n }\n // expect the supplied cb function to be called\n // \"n\" times for each thing in the array.\n list.forEach(function (ar) {\n steps.forEach(function (fn) { fn(ar, cb) })\n })\n}\n","module.exports = bindActor\nfunction bindActor () {\n var args = \n Array.prototype.slice.call\n (arguments) // jswtf.\n , obj = null\n , fn\n if (typeof args[0] === \"object\") {\n obj = args.shift()\n fn = args.shift()\n if (typeof fn === \"string\")\n fn = obj[ fn ]\n } else fn = args.shift()\n return function (cb) {\n fn.apply(obj, args.concat(cb)) }\n}\n","module.exports = chain\nvar bindActor = require(\"./bind-actor.js\")\nchain.first = {} ; chain.last = {}\nfunction chain (things, cb) {\n var res = []\n ;(function LOOP (i, len) {\n if (i >= len) return cb(null,res)\n if (Array.isArray(things[i]))\n things[i] = bindActor.apply(null,\n things[i].map(function(i){\n return (i===chain.first) ? res[0]\n : (i===chain.last)\n ? res[res.length - 1] : i }))\n if (!things[i]) return LOOP(i + 1, len)\n things[i](function (er, data) {\n if (er) return cb(er, res)\n if (data !== undefined) res = res.concat(data)\n LOOP(i + 1, len)\n })\n })(0, things.length) }\n","exports.asyncMap = require(\"./async-map\")\nexports.bindActor = require(\"./bind-actor\")\nexports.chain = require(\"./chain\")\n","export { default as v1 } from './v1.js';\nexport { default as v3 } from './v3.js';\nexport { default as v4 } from './v4.js';\nexport { default as v5 } from './v5.js';\nexport { default as NIL } from './nil.js';\nexport { default as version } from './version.js';\nexport { default as validate } from './validate.js';\nexport { default as stringify } from './stringify.js';\nexport { default as parse } from './parse.js';","/*\n * Browser-compatible JavaScript MD5\n *\n * Modification of JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\nfunction md5(bytes) {\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Uint8Array(msg.length);\n\n for (var i = 0; i < msg.length; ++i) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));\n}\n/*\n * Convert an array of little-endian words to an array of bytes\n */\n\n\nfunction md5ToHexEncodedArray(input) {\n var output = [];\n var length32 = input.length * 32;\n var hexTab = '0123456789abcdef';\n\n for (var i = 0; i < length32; i += 8) {\n var x = input[i >> 5] >>> i % 32 & 0xff;\n var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);\n output.push(hex);\n }\n\n return output;\n}\n/**\n * Calculate output length with padding and bit length\n */\n\n\nfunction getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n\n\nfunction wordsToMd5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32;\n x[getOutputLength(len) - 1] = len;\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n\n for (var i = 0; i < x.length; i += 16) {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n\n return [a, b, c, d];\n}\n/*\n * Convert an array bytes to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n\n\nfunction bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\n\n\nfunction safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\n\n\nfunction bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\n\n\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\n\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn(b & c | ~b & d, a, b, x, s, t);\n}\n\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn(b & d | c & ~d, a, b, x, s, t);\n}\n\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\nexport default md5;","export default '00000000-0000-0000-0000-000000000000';","import validate from './validate.js';\n\nfunction parse(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n var v;\n var arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nexport default parse;","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = [];\n\n for (var i = 0; i < msg.length; ++i) {\n bytes.push(msg.charCodeAt(i));\n }\n } else if (!Array.isArray(bytes)) {\n // Convert Array-like to Array\n bytes = Array.prototype.slice.call(bytes);\n }\n\n bytes.push(0x80);\n var l = bytes.length / 4 + 2;\n var N = Math.ceil(l / 16);\n var M = new Array(N);\n\n for (var _i = 0; _i < N; ++_i) {\n var arr = new Uint32Array(16);\n\n for (var j = 0; j < 16; ++j) {\n arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3];\n }\n\n M[_i] = arr;\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (var _i2 = 0; _i2 < N; ++_i2) {\n var W = new Uint32Array(80);\n\n for (var t = 0; t < 16; ++t) {\n W[t] = M[_i2][t];\n }\n\n for (var _t = 16; _t < 80; ++_t) {\n W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1);\n }\n\n var a = H[0];\n var b = H[1];\n var c = H[2];\n var d = H[3];\n var e = H[4];\n\n for (var _t2 = 0; _t2 < 80; ++_t2) {\n var s = Math.floor(_t2 / 20);\n var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\n}\n\nexport default sha1;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\n\nvar _clockseq; // Previous uuid creation time\n\n\nvar _lastMSecs = 0;\nvar _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || new Array(16);\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n var seedBytes = options.random || (options.rng || rng)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || stringify(b);\n}\n\nexport default v1;","import v35 from './v35.js';\nimport md5 from './md5.js';\nvar v3 = v35('v3', 0x30, md5);\nexport default v3;","import stringify from './stringify.js';\nimport parse from './parse.js';\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n var bytes = [];\n\n for (var i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nexport var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexport var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexport default function (name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = parse(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n var bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return stringify(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import v35 from './v35.js';\nimport sha1 from './sha1.js';\nvar v5 = v35('v5', 0x50, sha1);\nexport default v5;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n\nfunction version(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nexport default version;","'use strict'\nmodule.exports = writeFile\nmodule.exports.sync = writeFileSync\nmodule.exports._getTmpname = getTmpname // for testing\n\nvar fs = require('graceful-fs')\nvar chain = require('slide').chain\nvar MurmurHash3 = require('imurmurhash')\nvar extend = Object.assign || require('util')._extend\n\nvar invocations = 0\nfunction getTmpname (filename) {\n return filename + '.' +\n MurmurHash3(__filename)\n .hash(String(process.pid))\n .hash(String(++invocations))\n .result()\n}\n\nfunction writeFile (filename, data, options, callback) {\n if (options instanceof Function) {\n callback = options\n options = null\n }\n if (!options) options = {}\n fs.realpath(filename, function (_, realname) {\n _writeFile(realname || filename, data, options, callback)\n })\n}\nfunction _writeFile (filename, data, options, callback) {\n var tmpfile = getTmpname(filename)\n\n if (options.mode && options.chown) {\n return thenWriteFile()\n } else {\n // Either mode or chown is not explicitly set\n // Default behavior is to copy it from original file\n return fs.stat(filename, function (err, stats) {\n if (err || !stats) return thenWriteFile()\n\n options = extend({}, options)\n if (!options.mode) {\n options.mode = stats.mode\n }\n if (!options.chown && process.getuid) {\n options.chown = { uid: stats.uid, gid: stats.gid }\n }\n return thenWriteFile()\n })\n }\n\n function thenWriteFile () {\n chain([\n [writeFileAsync, tmpfile, data, options.mode, options.encoding || 'utf8'],\n options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid],\n options.mode && [fs, fs.chmod, tmpfile, options.mode],\n [fs, fs.rename, tmpfile, filename]\n ], function (err) {\n err ? fs.unlink(tmpfile, function () { callback(err) })\n : callback()\n })\n }\n\n // doing this instead of `fs.writeFile` in order to get the ability to\n // call `fsync`.\n function writeFileAsync (file, data, mode, encoding, cb) {\n fs.open(file, 'w', options.mode, function (err, fd) {\n if (err) return cb(err)\n if (Buffer.isBuffer(data)) {\n return fs.write(fd, data, 0, data.length, 0, syncAndClose)\n } else if (data != null) {\n return fs.write(fd, String(data), 0, String(encoding), syncAndClose)\n } else {\n return syncAndClose()\n }\n function syncAndClose (err) {\n if (err) return cb(err)\n fs.fsync(fd, function (err) {\n if (err) return cb(err)\n fs.close(fd, cb)\n })\n }\n })\n }\n}\n\nfunction writeFileSync (filename, data, options) {\n if (!options) options = {}\n try {\n filename = fs.realpathSync(filename)\n } catch (ex) {\n // it's ok, it'll happen on a not yet existing file\n }\n var tmpfile = getTmpname(filename)\n\n try {\n if (!options.mode || !options.chown) {\n // Either mode or chown is not explicitly set\n // Default behavior is to copy it from original file\n try {\n var stats = fs.statSync(filename)\n options = extend({}, options)\n if (!options.mode) {\n options.mode = stats.mode\n }\n if (!options.chown && process.getuid) {\n options.chown = { uid: stats.uid, gid: stats.gid }\n }\n } catch (ex) {\n // ignore stat errors\n }\n }\n\n var fd = fs.openSync(tmpfile, 'w', options.mode)\n if (Buffer.isBuffer(data)) {\n fs.writeSync(fd, data, 0, data.length, 0)\n } else if (data != null) {\n fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8'))\n }\n fs.fsyncSync(fd)\n fs.closeSync(fd)\n if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid)\n if (options.mode) fs.chmodSync(tmpfile, options.mode)\n fs.renameSync(tmpfile, filename)\n } catch (err) {\n try { fs.unlinkSync(tmpfile) } catch (e) {}\n throw err\n }\n}\n","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(\"./packages/client/lib/index.js\");\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://feathersjsOfflineClient/../src/filter-query.ts","webpack://feathersjsOfflineClient/../src/index.ts","webpack://feathersjsOfflineClient/../src/service.ts","webpack://feathersjsOfflineClient/../src/sort.ts","webpack://feathersjsOfflineClient/../src/hooks.ts","webpack://feathersjsOfflineClient/../src/utils.ts","webpack://feathersjsOfflineClient/./node_modules/@feathersjs/errors/lib/index.js","webpack://feathersjsOfflineClient/./node_modules/debug/src/browser.js","webpack://feathersjsOfflineClient/./node_modules/debug/src/common.js","webpack://feathersjsOfflineClient/../src/common/cryptographic.js","webpack://feathersjsOfflineClient/../src/common/index.js","webpack://feathersjsOfflineClient/../src/common/misc.js","webpack://feathersjsOfflineClient/../src/common/options-proxy.js","webpack://feathersjsOfflineClient/../src/common/to.js","webpack://feathersjsOfflineClient/../src/index.js","webpack://feathersjsOfflineClient/../src/own-common/index.js","webpack://feathersjsOfflineClient/../src/own-common/own-class.js","webpack://feathersjsOfflineClient/../src/owndata/index.js","webpack://feathersjsOfflineClient/../src/ownnet/index.js","webpack://feathersjsOfflineClient/../src/snapshot/index.js","webpack://feathersjsOfflineClient/./node_modules/charenc/charenc.js","webpack://feathersjsOfflineClient/./node_modules/crypt/crypt.js","webpack://feathersjsOfflineClient/./node_modules/feathers-localstorage/lib/index.js","webpack://feathersjsOfflineClient/./node_modules/feathers-memory/lib/index.js","webpack://feathersjsOfflineClient/./node_modules/feathers-memory/node_modules/sift/src/index.js","webpack://feathersjsOfflineClient/./node_modules/is-buffer/index.js","webpack://feathersjsOfflineClient/./node_modules/md5/md5.js","webpack://feathersjsOfflineClient/./node_modules/ms/index.js","webpack://feathersjsOfflineClient/./node_modules/shortid/index.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/alphabet.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/build.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/generate.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/index.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/is-valid.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/random/random-byte-browser.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/random/random-from-seed.js","webpack://feathersjsOfflineClient/./node_modules/shortid/lib/util/cluster-worker-id-browser.js","webpack://feathersjsOfflineClient/./node_modules/shortid/node_modules/nanoid/format.browser.js","webpack://feathersjsOfflineClient/./node_modules/sift/es5m/index.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/index.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/md5.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/nil.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/parse.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/regex.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/rng.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/sha1.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/stringify.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/v1.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/v3.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/v35.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/v4.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/v5.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/validate.js","webpack://feathersjsOfflineClient/./node_modules/uuid/dist/esm-browser/version.js","webpack://feathersjsOfflineClient/webpack/bootstrap","webpack://feathersjsOfflineClient/webpack/runtime/define property getters","webpack://feathersjsOfflineClient/webpack/runtime/hasOwnProperty shorthand","webpack://feathersjsOfflineClient/webpack/runtime/make namespace object","webpack://feathersjsOfflineClient/webpack/startup"],"names":["debug","require","FeathersError","msg","name","code","className","data","errors","message","newData","Error","JSON","parse","stringify","type","captureStackTrace","stack","inheritsFrom","Child","Parent","prototype","Object","create","constructor","defineProperty","value","BadRequest","call","NotAuthenticated","PaymentError","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","Timeout","Conflict","Gone","LengthRequired","Unprocessable","TooManyRequests","GeneralError","NotImplemented","BadGateway","Unavailable","convert","error","result","assign","module","exports","formatArgs","save","load","useColors","localstorage","warned","console","warn","window","process","__nwjs","navigator","userAgent","toLowerCase","match","document","documentElement","style","WebkitAppearance","firebug","exception","table","parseInt","RegExp","$1","args","namespace","humanize","diff","c","color","splice","index","lastC","replace","log","namespaces","storage","setItem","removeItem","r","getItem","env","DEBUG","localStorage","formatters","j","v","setup","createDebug","coerce","disable","enable","enabled","destroy","keys","forEach","key","names","skips","selectColor","hash","i","length","charCodeAt","colors","Math","abs","prevTime","enableOverride","self","curr","Number","Date","ms","prev","unshift","format","formatter","val","logFn","apply","extend","enumerable","configurable","get","set","init","delimiter","newDebug","split","len","push","substr","map","toNamespace","join","test","regexp","toString","substring"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,SAAS,KAAT,CAAgB,MAAhB,EAA2B;AACzB,MAAI,OAAO,MAAP,KAAkB,WAAtB,EAAmC;AACjC,WAAO,IAAI,CAAC,GAAL,CAAS,QAAQ,CAAC,MAAD,EAAS,EAAT,CAAjB,CAAP;AACD;;AAED,SAAO,SAAP;AACD,C,CAED;AACA;;;AACA,SAAS,QAAT,CAAmB,KAAnB,EAA+B,QAA/B,EAA4C;AAC1C,MAAI,QAAQ,IAAI,QAAQ,WAAxB,EAAkC;AAChC,QAAM,KAAK,GAAG,OAAO,KAAP,KAAiB,QAAjB,IAA6B,CAAC,KAAK,CAAC,KAAD,CAAnC,GAA6C,KAA7C,GAAqD,QAAQ,WAA3E;AACA,QAAM,KAAK,GAAG,OAAO,QAAQ,CAAC,GAAhB,KAAwB,QAAxB,GAAmC,QAAQ,CAAC,GAA5C,GAAkD,MAAM,CAAC,SAAvE;AAEA,WAAO,IAAI,CAAC,GAAL,CAAS,KAAT,EAAgB,KAAhB,CAAP;AACD;;AAED,SAAO,KAAP;AACD,C,CAED;;;AACA,SAAS,WAAT,CAAsB,IAAtB,EAA+B;AAC7B,MAAI,QAAO,IAAP,MAAgB,QAAhB,IAA4B,KAAK,CAAC,OAAN,CAAc,IAAd,CAAhC,EAAqD;AACnD,WAAO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EA;AACA,qBAAqB,cAAc;AACnC;AACA;AACA,KAAK;;AAEL;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA,KAAK;;AAEL;AACA;AACA,wCAAwC,kBAAkB;AAC1D;AACA;AACA,KAAK;;AAEL;AACA;AACA,iCAAiC,uBAAuB;AACxD;AACA;AACA,KAAK;;AAEL;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,iCAAiC,gBAAgB;AACjD;AACA;AACA,KAAK;;AAEL;AACA;AACA,kCAAkC,kBAAkB;AACpD;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;;;;;AC/FD,OAAO,UAAU,GAAG,mBAAO,CAAC,oEAAiB;;AAE7C;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL,6BAA6B;AAC7B,6CAA6C,iBAAiB;AAC9D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB;;;;;;;;;;;AC/FtB,eAAe,mBAAO,CAAC,0EAAoB;AAC3C,OAAO,IAAI,GAAG,mBAAO,CAAC,4EAAqB;AAC3C,OAAO,iCAAiC,GAAG,mBAAO,CAAC,4FAA6B;AAChF,aAAa,wGAAuB;;AAEpC;AACA;;AAEA;AACA;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,+BAA+B;AAC/B,WAAW,QAAQ;;AAEnB,sCAAsC;AACtC;AACA;AACA,KAAK;AACL;;AAEA,0BAA0B;AAC1B,WAAW,2BAA2B;AACtC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,6BAA6B;AAC7B;AACA,aAAa,QAAQ;AACrB;;AAEA;AACA;AACA;AACA;;AAEA,yDAAyD,GAAG;AAC5D;;AAEA;AACA,kCAAkC;AAClC;AACA;AACA;;AAEA;AACA,+BAA+B,SAAS,gBAAgB;AACxD;;AAEA;AACA;;AAEA,sCAAsC;AACtC;AACA;AACA;;AAEA,kCAAkC;;AAElC,gCAAgC,SAAS,gBAAgB;;AAEzD;AACA;;AAEA,qCAAqC;AACrC;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,mDAAmD;AACnD;;AAEA;AACA,gCAAgC;AAChC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB;;;;;;;;;;;;;;;;;;AC5ItB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;;AAEA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA,KAAK;AACL,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA,GAAG;;AAEH,qCAAqC,sBAAsB;AAC3D;AACA;AACA;AACA,GAAG;;AAEH,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA,GAAG;AACH,qCAAqC,sBAAsB;AAC3D;AACA;AACA;AACA,GAAG;;AAEH;AACA,WAAW,aAAa;AACxB;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,oCAAoC,KAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oCAAoC,KAAK;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA,+BAA+B,UAAU;AACzC;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,UAAU;AACV;;AAEA;AACA;;AAEA,0BAA0B,wBAAwB;AAClD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,WAAW,IAAI,UAAU;AACpC;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA,0BAA0B,wBAAwB;AAClD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2DAA2D,gBAAgB;AAC3E,0DAA0D,gBAAgB;AAC1E;AACA;;AAEA;AACA,SAAS,0BAA0B;AACnC;AACA;AACA,eAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA,iCAAiC,OAAO;AACxC;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEe;AACf,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEO;AACP;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;;;;;;;;;;ACrsBA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACpBA;AACA,cAAc,mBAAO,CAAC,4CAAO;AAC7B,aAAa,4EAAuB;AACpC,iBAAiB,mBAAO,CAAC,oDAAW;AACpC,YAAY,2EAAsB;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,cAAc;;AAEjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;;;;;;;;;;AC/JD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACjKa;AACb,8FAAuC;;;;;;;;;;;;ACD1B;;AAEb,qBAAqB,mBAAO,CAAC,wFAA2B;;AAExD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtGa;;AAEb,eAAe,mBAAO,CAAC,0DAAY;AACnC,eAAe,mBAAO,CAAC,0DAAY;;AAEnC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC7Ca;;AAEb,eAAe,mBAAO,CAAC,0DAAY;AACnC,aAAa,mBAAO,CAAC,sFAAsB;AAC3C,aAAa,mBAAO,CAAC,mFAAe;;AAEpC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpBa;;AAEb,eAAe,mBAAO,CAAC,0DAAY;AACnC,YAAY,mBAAO,CAAC,oDAAS;AAC7B,cAAc,mBAAO,CAAC,0DAAY;;AAElC;AACA;AACA;AACA;AACA,sBAAsB,mBAAO,CAAC,8FAA0B;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB,mBAAmB;AACnB,qBAAqB;AACrB,yBAAyB;AACzB,sBAAsB;;;;;;;;;;;;AC7DT;AACb,eAAe,mBAAO,CAAC,0DAAY;;AAEnC;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;;;;;;;;;;;;ACda;;AAEb,8EAA8E;;AAE9E;;AAEA;AACA;AACA;AACA,uBAAuB,UAAU;AACjC;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpBa;;AAEb;AACA;;AAEA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACxBa;;AAEb;;;;;;;;;;;ACFA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,+CAA+C,UAAU;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvCA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;;AAEA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,8CAA8C;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,gBAAgB;AACjF,gEAAgE,gBAAgB;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,cAAc;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI,oBAAoB;AACxB;AACA;AACA;AACA;AACA,QAAQ,iBAAiB;AACzB;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,cAAc;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,cAAc;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,4CAA4C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qEAAqE,0DAA0D;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qEAAqE;AACrE;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,oBAAoB;AACrD,+BAA+B;AAC/B;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,EAAE;AACF;AACA,6BAA6B,cAAc;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,cAAc;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oDAAoD,cAAc;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,cAAc;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,wDAAwD,cAAc;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,4FAA4F,0DAA0D,EAAE;AACxJ;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,yDAAyD,oDAAoD;AAC7G,yDAAyD,oDAAoD;AAC7G,0DAA0D,qDAAqD;AAC/G,gEAAgE,2DAA2D;AAC3H,0DAA0D,qDAAqD;AAC/G,yDAAyD,oDAAoD;AAC7G,gDAAgD,sBAAsB,mBAAmB,GAAG,EAAE;AAC9F,iDAAiD,sBAAsB,oBAAoB,GAAG,EAAE;AAChG,gDAAgD,sBAAsB,mBAAmB,GAAG,EAAE;AAC9F,iDAAiD,sBAAsB,oBAAoB,GAAG,EAAE;AAChG;AACA;AACA,6CAA6C,4CAA4C,EAAE;AAC3F;AACA,6DAA6D,wDAAwD;AACrH;AACA;AACA;AACA,0DAA0D,qDAAqD;AAC/G;AACA,6CAA6C,4EAA4E,EAAE;AAC3H;AACA,yDAAyD,oDAAoD;AAC7G;AACA,oDAAoD,wDAAwD;AAC5G,4BAA4B,aAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,wBAAwB,EAAE;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,+BAA+B;AAC/B;AACA;AACA,oCAAoC,qCAAqC;AACzE,KAAK;AACL;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;AACA;;AAEA,iEAAe,wBAAwB,EAAC;AACyP;AACjS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3nBwC;AACA;AACA;AACA;AACE;AACQ;AACE;AACE;;;;;;;;;;;;;;;;ACPtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;;AAElD;;AAEA,mBAAmB,gBAAgB;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,aAAa;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iEAAe,GAAG,E;;;;;;;;;;;;;;;ACtNlB,iEAAe,sCAAsC,E;;;;;;;;;;;;;;;;ACAhB;;AAErC;AACA,OAAO,qDAAQ;AACf;AACA;;AAEA;AACA,+BAA+B;;AAE/B;AACA;AACA;AACA,oBAAoB;;AAEpB;AACA,oBAAoB;;AAEpB;AACA,oBAAoB;;AAEpB;AACA,oBAAoB;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAe,KAAK,E;;;;;;;;;;;;;;;AClCpB,iEAAe,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,GAAG,yCAAyC,E;;;;;;;;;;;;;;;ACApI;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kDAAkD;;AAElD;;AAEA,mBAAmB,gBAAgB;AACnC;AACA;AACA,GAAG;AACH;AACA;AACA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","file":"feathersjs-offline-client.js","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OPERATORS = exports.FILTERS = void 0;\nconst commons_1 = require(\"@feathersjs/commons\");\nconst errors_1 = require(\"@feathersjs/errors\");\nfunction parse(number) {\n if (typeof number !== 'undefined') {\n return Math.abs(parseInt(number, 10));\n }\n return undefined;\n}\n// Returns the pagination limit and will take into account the\n// default and max pagination settings\nfunction getLimit(limit, paginate) {\n if (paginate && paginate.default) {\n const lower = typeof limit === 'number' && !isNaN(limit) ? limit : paginate.default;\n const upper = typeof paginate.max === 'number' ? paginate.max : Number.MAX_VALUE;\n return Math.min(lower, upper);\n }\n return limit;\n}\n// Makes sure that $sort order is always converted to an actual number\nfunction convertSort(sort) {\n if (typeof sort !== 'object' || Array.isArray(sort)) {\n return sort;\n }\n return Object.keys(sort).reduce((result, key) => {\n result[key] = typeof sort[key] === 'object'\n ? sort[key] : parseInt(sort[key], 10);\n return result;\n }, {});\n}\nfunction cleanQuery(query, operators, filters) {\n if (Array.isArray(query)) {\n return query.map(value => cleanQuery(value, operators, filters));\n }\n else if (commons_1._.isObject(query) && query.constructor === {}.constructor) {\n const result = {};\n commons_1._.each(query, (value, key) => {\n if (key[0] === '$') {\n if (filters[key] !== undefined) {\n return;\n }\n if (!operators.includes(key)) {\n throw new errors_1.BadRequest(`Invalid query parameter ${key}`, query);\n }\n }\n result[key] = cleanQuery(value, operators, filters);\n });\n Object.getOwnPropertySymbols(query).forEach(symbol => {\n // @ts-ignore\n result[symbol] = query[symbol];\n });\n return result;\n }\n return query;\n}\nfunction assignFilters(object, query, filters, options) {\n if (Array.isArray(filters)) {\n commons_1._.each(filters, (key) => {\n if (query[key] !== undefined) {\n object[key] = query[key];\n }\n });\n }\n else {\n commons_1._.each(filters, (converter, key) => {\n const converted = converter(query[key], options);\n if (converted !== undefined) {\n object[key] = converted;\n }\n });\n }\n return object;\n}\nexports.FILTERS = {\n $sort: (value) => convertSort(value),\n $limit: (value, options) => getLimit(parse(value), options.paginate),\n $skip: (value) => parse(value),\n $select: (value) => value\n};\nexports.OPERATORS = ['$in', '$nin', '$lt', '$lte', '$gt', '$gte', '$ne', '$or'];\n// Converts Feathers special query parameters and pagination settings\n// and returns them separately a `filters` and the rest of the query\n// as `query`\nfunction filterQuery(query, options = {}) {\n const { filters: additionalFilters = {}, operators: additionalOperators = [] } = options;\n const result = {};\n result.filters = assignFilters({}, query, exports.FILTERS, options);\n result.filters = assignFilters(result.filters, query, additionalFilters, options);\n result.query = cleanQuery(query, exports.OPERATORS.concat(additionalOperators), result.filters);\n return result;\n}\nexports.default = filterQuery;\nif (typeof module !== 'undefined') {\n module.exports = Object.assign(filterQuery, module.exports);\n}\n//# sourceMappingURL=filter-query.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hooks = void 0;\nconst hookUtils = __importStar(require(\"./hooks\"));\n__exportStar(require(\"./utils\"), exports);\nexports.hooks = hookUtils;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AdapterService = void 0;\nconst errors_1 = require(\"@feathersjs/errors\");\nconst filter_query_1 = __importDefault(require(\"./filter-query\"));\nconst callMethod = (self, name, ...args) => {\n if (typeof self[name] !== 'function') {\n return Promise.reject(new errors_1.NotImplemented(`Method ${name} not available`));\n }\n return self[name](...args);\n};\nconst alwaysMulti = {\n find: true,\n get: false,\n update: false\n};\nclass AdapterService {\n constructor(options) {\n this.options = Object.assign({\n id: 'id',\n events: [],\n paginate: {},\n multi: false,\n filters: [],\n whitelist: []\n }, options);\n }\n get id() {\n return this.options.id;\n }\n get events() {\n return this.options.events;\n }\n filterQuery(params = {}, opts = {}) {\n const paginate = typeof params.paginate !== 'undefined'\n ? params.paginate : this.options.paginate;\n const { query = {} } = params;\n const options = Object.assign({\n operators: this.options.whitelist || [],\n filters: this.options.filters,\n paginate\n }, opts);\n const result = filter_query_1.default(query, options);\n return Object.assign(result, { paginate });\n }\n allowsMulti(method) {\n const always = alwaysMulti[method];\n if (typeof always !== 'undefined') {\n return always;\n }\n const option = this.options.multi;\n if (option === true || option === false) {\n return option;\n }\n else {\n return option.includes(method);\n }\n }\n find(params) {\n return callMethod(this, '_find', params);\n }\n get(id, params) {\n return callMethod(this, '_get', id, params);\n }\n create(data, params) {\n if (Array.isArray(data) && !this.allowsMulti('create')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not create multiple entries`));\n }\n return callMethod(this, '_create', data, params);\n }\n update(id, data, params) {\n if (id === null || Array.isArray(data)) {\n return Promise.reject(new errors_1.BadRequest(`You can not replace multiple instances. Did you mean 'patch'?`));\n }\n return callMethod(this, '_update', id, data, params);\n }\n patch(id, data, params) {\n if (id === null && !this.allowsMulti('patch')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not patch multiple entries`));\n }\n return callMethod(this, '_patch', id, data, params);\n }\n remove(id, params) {\n if (id === null && !this.allowsMulti('remove')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not remove multiple entries`));\n }\n return callMethod(this, '_remove', id, params);\n }\n}\nexports.AdapterService = AdapterService;\n//# sourceMappingURL=service.js.map","\"use strict\";\n// Sorting algorithm taken from NeDB (https://github.com/louischatriot/nedb)\n// See https://github.com/louischatriot/nedb/blob/e3f0078499aa1005a59d0c2372e425ab789145c1/lib/model.js#L189\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sorter = exports.compare = exports.compareArrays = exports.compareNSB = void 0;\nfunction compareNSB(a, b) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n}\nexports.compareNSB = compareNSB;\nfunction compareArrays(a, b) {\n let i;\n let comp;\n for (i = 0; i < Math.min(a.length, b.length); i += 1) {\n comp = exports.compare(a[i], b[i]);\n if (comp !== 0) {\n return comp;\n }\n }\n // Common section was identical, longest one wins\n return exports.compareNSB(a.length, b.length);\n}\nexports.compareArrays = compareArrays;\nfunction compare(a, b, compareStrings = exports.compareNSB) {\n const { compareNSB, compare, compareArrays } = exports;\n // undefined\n if (a === undefined) {\n return b === undefined ? 0 : -1;\n }\n if (b === undefined) {\n return a === undefined ? 0 : 1;\n }\n // null\n if (a === null) {\n return b === null ? 0 : -1;\n }\n if (b === null) {\n return a === null ? 0 : 1;\n }\n // Numbers\n if (typeof a === 'number') {\n return typeof b === 'number' ? compareNSB(a, b) : -1;\n }\n if (typeof b === 'number') {\n return typeof a === 'number' ? compareNSB(a, b) : 1;\n }\n // Strings\n if (typeof a === 'string') {\n return typeof b === 'string' ? compareStrings(a, b) : -1;\n }\n if (typeof b === 'string') {\n return typeof a === 'string' ? compareStrings(a, b) : 1;\n }\n // Booleans\n if (typeof a === 'boolean') {\n return typeof b === 'boolean' ? compareNSB(a, b) : -1;\n }\n if (typeof b === 'boolean') {\n return typeof a === 'boolean' ? compareNSB(a, b) : 1;\n }\n // Dates\n if (a instanceof Date) {\n return b instanceof Date ? compareNSB(a.getTime(), b.getTime()) : -1;\n }\n if (b instanceof Date) {\n return a instanceof Date ? compareNSB(a.getTime(), b.getTime()) : 1;\n }\n // Arrays (first element is most significant and so on)\n if (Array.isArray(a)) {\n return Array.isArray(b) ? compareArrays(a, b) : -1;\n }\n if (Array.isArray(b)) {\n return Array.isArray(a) ? compareArrays(a, b) : 1;\n }\n // Objects\n const aKeys = Object.keys(a).sort();\n const bKeys = Object.keys(b).sort();\n let comp = 0;\n for (let i = 0; i < Math.min(aKeys.length, bKeys.length); i += 1) {\n comp = compare(a[aKeys[i]], b[bKeys[i]]);\n if (comp !== 0) {\n return comp;\n }\n }\n return compareNSB(aKeys.length, bKeys.length);\n}\nexports.compare = compare;\n// An in-memory sorting function according to the\n// $sort special query parameter\nfunction sorter($sort) {\n const criteria = Object.keys($sort).map(key => {\n const direction = $sort[key];\n return { key, direction };\n });\n return function (a, b) {\n let compare;\n for (const criterion of criteria) {\n compare = criterion.direction * exports.compare(a[criterion.key], b[criterion.key]);\n if (compare !== 0) {\n return compare;\n }\n }\n return 0;\n };\n}\nexports.sorter = sorter;\n//# sourceMappingURL=sort.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enableHooks = exports.processHooks = exports.getHooks = exports.isHookObject = exports.convertHookData = exports.makeArguments = exports.defaultMakeArguments = exports.createHookObject = exports.ACTIVATE_HOOKS = void 0;\nconst utils_1 = require(\"./utils\");\nconst { each, pick } = utils_1._;\nexports.ACTIVATE_HOOKS = utils_1.createSymbol('__feathersActivateHooks');\nfunction createHookObject(method, data = {}) {\n const hook = {};\n Object.defineProperty(hook, 'toJSON', {\n value() {\n return pick(this, 'type', 'method', 'path', 'params', 'id', 'data', 'result', 'error');\n }\n });\n return Object.assign(hook, data, {\n method,\n // A dynamic getter that returns the path of the service\n get path() {\n const { app, service } = data;\n if (!service || !app || !app.services) {\n return null;\n }\n return Object.keys(app.services)\n .find(path => app.services[path] === service);\n }\n });\n}\nexports.createHookObject = createHookObject;\n// Fallback used by `makeArguments` which usually won't be used\nfunction defaultMakeArguments(hook) {\n const result = [];\n if (typeof hook.id !== 'undefined') {\n result.push(hook.id);\n }\n if (hook.data) {\n result.push(hook.data);\n }\n result.push(hook.params || {});\n return result;\n}\nexports.defaultMakeArguments = defaultMakeArguments;\n// Turns a hook object back into a list of arguments\n// to call a service method with\nfunction makeArguments(hook) {\n switch (hook.method) {\n case 'find':\n return [hook.params];\n case 'get':\n case 'remove':\n return [hook.id, hook.params];\n case 'update':\n case 'patch':\n return [hook.id, hook.data, hook.params];\n case 'create':\n return [hook.data, hook.params];\n }\n return defaultMakeArguments(hook);\n}\nexports.makeArguments = makeArguments;\n// Converts different hook registration formats into the\n// same internal format\nfunction convertHookData(obj) {\n let hook = {};\n if (Array.isArray(obj)) {\n hook = { all: obj };\n }\n else if (typeof obj !== 'object') {\n hook = { all: [obj] };\n }\n else {\n each(obj, function (value, key) {\n hook[key] = !Array.isArray(value) ? [value] : value;\n });\n }\n return hook;\n}\nexports.convertHookData = convertHookData;\n// Duck-checks a given object to be a hook object\n// A valid hook object has `type` and `method`\nfunction isHookObject(hookObject) {\n return typeof hookObject === 'object' &&\n typeof hookObject.method === 'string' &&\n typeof hookObject.type === 'string';\n}\nexports.isHookObject = isHookObject;\n// Returns all service and application hooks combined\n// for a given method and type `appLast` sets if the hooks\n// from `app` should be added last (or first by default)\nfunction getHooks(app, service, type, method, appLast = false) {\n const appHooks = app.__hooks[type][method] || [];\n const serviceHooks = service.__hooks[type][method] || [];\n if (appLast) {\n // Run hooks in the order of service -> app -> finally\n return serviceHooks.concat(appHooks);\n }\n return appHooks.concat(serviceHooks);\n}\nexports.getHooks = getHooks;\nfunction processHooks(hooks, initialHookObject) {\n let hookObject = initialHookObject;\n const updateCurrentHook = (current) => {\n // Either use the returned hook object or the current\n // hook object from the chain if the hook returned undefined\n if (current) {\n if (!isHookObject(current)) {\n throw new Error(`${hookObject.type} hook for '${hookObject.method}' method returned invalid hook object`);\n }\n hookObject = current;\n }\n return hookObject;\n };\n // Go through all hooks and chain them into our promise\n const promise = hooks.reduce((current, fn) => {\n // @ts-ignore\n const hook = fn.bind(this);\n // Use the returned hook object or the old one\n return current.then((currentHook) => hook(currentHook)).then(updateCurrentHook);\n }, Promise.resolve(hookObject));\n return promise.then(() => hookObject).catch(error => {\n // Add the hook information to any errors\n error.hook = hookObject;\n throw error;\n });\n}\nexports.processHooks = processHooks;\n// Add `.hooks` functionality to an object\nfunction enableHooks(obj, methods, types) {\n if (typeof obj.hooks === 'function') {\n return obj;\n }\n const hookData = {};\n types.forEach(type => {\n // Initialize properties where hook functions are stored\n hookData[type] = {};\n });\n // Add non-enumerable `__hooks` property to the object\n Object.defineProperty(obj, '__hooks', {\n configurable: true,\n value: hookData,\n writable: true\n });\n return Object.assign(obj, {\n hooks(allHooks) {\n each(allHooks, (current, type) => {\n // @ts-ignore\n if (!this.__hooks[type]) {\n throw new Error(`'${type}' is not a valid hook type`);\n }\n const hooks = convertHookData(current);\n each(hooks, (_value, method) => {\n if (method !== 'all' && methods.indexOf(method) === -1) {\n throw new Error(`'${method}' is not a valid hook method`);\n }\n });\n methods.forEach(method => {\n // @ts-ignore\n const myHooks = this.__hooks[type][method] || (this.__hooks[type][method] = []);\n if (hooks.all) {\n myHooks.push.apply(myHooks, hooks.all);\n }\n if (hooks[method]) {\n myHooks.push.apply(myHooks, hooks[method]);\n }\n });\n });\n return this;\n }\n });\n}\nexports.enableHooks = enableHooks;\n//# sourceMappingURL=hooks.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createSymbol = exports.makeUrl = exports.isPromise = exports._ = exports.stripSlashes = void 0;\n// Removes all leading and trailing slashes from a path\nfunction stripSlashes(name) {\n return name.replace(/^(\\/+)|(\\/+)$/g, '');\n}\nexports.stripSlashes = stripSlashes;\n// A set of lodash-y utility functions that use ES6\nexports._ = {\n each(obj, callback) {\n if (obj && typeof obj.forEach === 'function') {\n obj.forEach(callback);\n }\n else if (exports._.isObject(obj)) {\n Object.keys(obj).forEach(key => callback(obj[key], key));\n }\n },\n some(value, callback) {\n return Object.keys(value)\n .map(key => [value[key], key])\n .some(([val, key]) => callback(val, key));\n },\n every(value, callback) {\n return Object.keys(value)\n .map(key => [value[key], key])\n .every(([val, key]) => callback(val, key));\n },\n keys(obj) {\n return Object.keys(obj);\n },\n values(obj) {\n return exports._.keys(obj).map(key => obj[key]);\n },\n isMatch(obj, item) {\n return exports._.keys(item).every(key => obj[key] === item[key]);\n },\n isEmpty(obj) {\n return exports._.keys(obj).length === 0;\n },\n isObject(item) {\n return (typeof item === 'object' && !Array.isArray(item) && item !== null);\n },\n isObjectOrArray(value) {\n return typeof value === 'object' && value !== null;\n },\n extend(first, ...rest) {\n return Object.assign(first, ...rest);\n },\n omit(obj, ...keys) {\n const result = exports._.extend({}, obj);\n keys.forEach(key => delete result[key]);\n return result;\n },\n pick(source, ...keys) {\n return keys.reduce((result, key) => {\n if (source[key] !== undefined) {\n result[key] = source[key];\n }\n return result;\n }, {});\n },\n // Recursively merge the source object into the target object\n merge(target, source) {\n if (exports._.isObject(target) && exports._.isObject(source)) {\n Object.keys(source).forEach(key => {\n if (exports._.isObject(source[key])) {\n if (!target[key]) {\n Object.assign(target, { [key]: {} });\n }\n exports._.merge(target[key], source[key]);\n }\n else {\n Object.assign(target, { [key]: source[key] });\n }\n });\n }\n return target;\n }\n};\n// Duck-checks if an object looks like a promise\nfunction isPromise(result) {\n return exports._.isObject(result) &&\n typeof result.then === 'function';\n}\nexports.isPromise = isPromise;\nfunction makeUrl(path, app = {}) {\n const get = typeof app.get === 'function' ? app.get.bind(app) : () => { };\n const env = get('env') || process.env.NODE_ENV;\n const host = get('host') || process.env.HOST_NAME || 'localhost';\n const protocol = (env === 'development' || env === 'test' || (env === undefined)) ? 'http' : 'https';\n const PORT = get('port') || process.env.PORT || 3030;\n const port = (env === 'development' || env === 'test' || (env === undefined)) ? `:${PORT}` : '';\n path = path || '';\n return `${protocol}://${host}${port}/${exports.stripSlashes(path)}`;\n}\nexports.makeUrl = makeUrl;\nfunction createSymbol(name) {\n return typeof Symbol !== 'undefined' ? Symbol(name) : name;\n}\nexports.createSymbol = createSymbol;\n//# sourceMappingURL=utils.js.map","const debug = require('debug')('@feathersjs/errors');\n\nfunction FeathersError (msg, name, code, className, data) {\n msg = msg || 'Error';\n\n let errors;\n let message;\n let newData;\n\n if (msg instanceof Error) {\n message = msg.message || 'Error';\n\n // NOTE (EK): This is typically to handle validation errors\n if (msg.errors) {\n errors = msg.errors;\n }\n } else if (typeof msg === 'object') { // Support plain old objects\n message = msg.message || 'Error';\n data = msg;\n } else { // message is just a string\n message = msg;\n }\n\n if (data) {\n // NOTE(EK): To make sure that we are not messing\n // with immutable data, just make a copy.\n // https://github.com/feathersjs/errors/issues/19\n newData = JSON.parse(JSON.stringify(data));\n\n if (newData.errors) {\n errors = newData.errors;\n delete newData.errors;\n } else if (data.errors) {\n // The errors property from data could be\n // stripped away while cloning resulting newData not to have it\n // For example: when cloning arrays this property\n errors = JSON.parse(JSON.stringify(data.errors));\n }\n }\n\n // NOTE (EK): Babel doesn't support this so\n // we have to pass in the class name manually.\n // this.name = this.constructor.name;\n this.type = 'FeathersError';\n this.name = name;\n this.message = message;\n this.code = code;\n this.className = className;\n this.data = newData;\n this.errors = errors || {};\n\n debug(`${this.name}(${this.code}): ${this.message}`);\n debug(this.errors);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, FeathersError);\n } else {\n this.stack = (new Error()).stack;\n }\n}\n\nfunction inheritsFrom (Child, Parent) {\n Child.prototype = Object.create(Parent.prototype);\n Child.prototype.constructor = Child;\n}\n\ninheritsFrom(FeathersError, Error);\n\n// NOTE (EK): A little hack to get around `message` not\n// being included in the default toJSON call.\nObject.defineProperty(FeathersError.prototype, 'toJSON', {\n value: function () {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n className: this.className,\n data: this.data,\n errors: this.errors\n };\n }\n});\n\n// 400 - Bad Request\nfunction BadRequest (message, data) {\n FeathersError.call(this, message, 'BadRequest', 400, 'bad-request', data);\n}\n\ninheritsFrom(BadRequest, FeathersError);\n\n// 401 - Not Authenticated\nfunction NotAuthenticated (message, data) {\n FeathersError.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);\n}\n\ninheritsFrom(NotAuthenticated, FeathersError);\n\n// 402 - Payment Error\nfunction PaymentError (message, data) {\n FeathersError.call(this, message, 'PaymentError', 402, 'payment-error', data);\n}\n\ninheritsFrom(PaymentError, FeathersError);\n\n// 403 - Forbidden\nfunction Forbidden (message, data) {\n FeathersError.call(this, message, 'Forbidden', 403, 'forbidden', data);\n}\n\ninheritsFrom(Forbidden, FeathersError);\n\n// 404 - Not Found\nfunction NotFound (message, data) {\n FeathersError.call(this, message, 'NotFound', 404, 'not-found', data);\n}\n\ninheritsFrom(NotFound, FeathersError);\n\n// 405 - Method Not Allowed\nfunction MethodNotAllowed (message, data) {\n FeathersError.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);\n}\n\ninheritsFrom(MethodNotAllowed, FeathersError);\n\n// 406 - Not Acceptable\nfunction NotAcceptable (message, data) {\n FeathersError.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);\n}\n\ninheritsFrom(NotAcceptable, FeathersError);\n\n// 408 - Timeout\nfunction Timeout (message, data) {\n FeathersError.call(this, message, 'Timeout', 408, 'timeout', data);\n}\n\ninheritsFrom(Timeout, FeathersError);\n\n// 409 - Conflict\nfunction Conflict (message, data) {\n FeathersError.call(this, message, 'Conflict', 409, 'conflict', data);\n}\n\ninheritsFrom(Conflict, FeathersError);\n\n// 410 - Gone\nfunction Gone (message, data) {\n FeathersError(this, message, 'Gone', 410, 'gone', data);\n}\n\ninheritsFrom(Gone, FeathersError);\n\n// 411 - Length Required\nfunction LengthRequired (message, data) {\n FeathersError.call(this, message, 'LengthRequired', 411, 'length-required', data);\n}\n\ninheritsFrom(LengthRequired, FeathersError);\n\n// 422 Unprocessable\nfunction Unprocessable (message, data) {\n FeathersError.call(this, message, 'Unprocessable', 422, 'unprocessable', data);\n}\n\ninheritsFrom(Unprocessable, FeathersError);\n\n// 429 Too Many Requests\nfunction TooManyRequests (message, data) {\n FeathersError.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);\n}\n\ninheritsFrom(TooManyRequests, FeathersError);\n\n// 500 - General Error\nfunction GeneralError (message, data) {\n FeathersError.call(this, message, 'GeneralError', 500, 'general-error', data);\n}\n\ninheritsFrom(GeneralError, FeathersError);\n\n// 501 - Not Implemented\nfunction NotImplemented (message, data) {\n FeathersError.call(this, message, 'NotImplemented', 501, 'not-implemented', data);\n}\n\ninheritsFrom(NotImplemented, FeathersError);\n\n// 502 - Bad Gateway\nfunction BadGateway (message, data) {\n FeathersError.call(this, message, 'BadGateway', 502, 'bad-gateway', data);\n}\n\ninheritsFrom(BadGateway, FeathersError);\n\n// 503 - Unavailable\nfunction Unavailable (message, data) {\n FeathersError.call(this, message, 'Unavailable', 503, 'unavailable', data);\n}\n\ninheritsFrom(Unavailable, FeathersError);\n\nconst errors = {\n FeathersError,\n BadRequest,\n NotAuthenticated,\n PaymentError,\n Forbidden,\n NotFound,\n MethodNotAllowed,\n NotAcceptable,\n Timeout,\n Conflict,\n Gone,\n LengthRequired,\n Unprocessable,\n TooManyRequests,\n GeneralError,\n NotImplemented,\n BadGateway,\n Unavailable,\n 400: BadRequest,\n 401: NotAuthenticated,\n 402: PaymentError,\n 403: Forbidden,\n 404: NotFound,\n 405: MethodNotAllowed,\n 406: NotAcceptable,\n 408: Timeout,\n 409: Conflict,\n 410: Gone,\n 411: LengthRequired,\n 422: Unprocessable,\n 429: TooManyRequests,\n 500: GeneralError,\n 501: NotImplemented,\n 502: BadGateway,\n 503: Unavailable\n};\n\nfunction convert (error) {\n if (!error) {\n return error;\n }\n\n const FeathersError = errors[error.name];\n const result = FeathersError\n ? new FeathersError(error.message, error.data)\n : new Error(error.message || error);\n\n if (typeof error === 'object') {\n Object.assign(result, error);\n }\n\n return result;\n}\n\nmodule.exports = Object.assign({ convert }, errors);\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","// Simply \"stolen\" from feathers-offline-xxx\nconst md5 = require('md5');\nconst { v4: uuidV4 } = require('uuid');\nconst shortid = require('shortid');\nconst { stripProps } = require('./misc');\n// Integrity of short unique identifiers: https://github.com/dylang/shortid/issues/81#issuecomment-259812835\nfunction genUuid(ifShortUuid) {\n return ifShortUuid ? shortid.generate() : uuidV4();\n}\nfunction hash(value) {\n value = typeof value === 'string' ? value : JSON.stringify(value);\n return md5(value);\n}\nfunction hashOfRecord(record) {\n return hash(stripProps(record, ['id', '_id']));\n}\nmodule.exports = {\n genUuid,\n hash,\n hashOfRecord\n};\n//# sourceMappingURL=cryptographic.js.map","const to = require('./to');\nconst cryptographic = require('./cryptographic');\nconst misc = require('./misc');\nconst OptionsProxy = require('./options-proxy');\nmodule.exports = Object.assign(Object.assign(Object.assign({ to }, cryptographic), misc), { OptionsProxy });\n//# sourceMappingURL=index.js.map","function isObject(value) {\n return typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\nfunction stripProps(obj, blacklist) {\n blacklist = Array.isArray(blacklist) ? blacklist : (blacklist || []);\n const res = {};\n Object.keys(obj).forEach(prop => {\n if (blacklist.indexOf(prop) === -1) {\n const value = obj[prop];\n res[prop] = isObject(value) ? stripProps(value, blacklist) : value;\n }\n });\n return res;\n}\nmodule.exports = {\n isObject,\n stripProps\n};\n//# sourceMappingURL=misc.js.map","let depends = {};\nlet watchingFn = [];\nlet ix = 0;\nmodule.exports = class OptionsProxy {\n constructor(name) {\n if (name === undefined) {\n throw new Error(`OptionsProxy: Sorry, you must supply a name to proxy.`);\n }\n // if (depends[name]) {\n // throw new Error(`OptionsProxy: Sorry, you have already proxied '${name}'.`);\n // }\n this.name = name /*+ ++ix*/;\n depends[this.name] = [];\n watchingFn[this.name] = null;\n }\n /**\n * Package the data to be observed in a proxy that updates according to\n * relevant recipes registered with watcher().\n * @param {object} data The data object to observe\n */\n observe(data) {\n let self = this;\n return new Proxy(data, {\n get(obj, key) {\n if (watchingFn[self.name]) {\n if (!depends[self.name][key])\n depends[self.name][key] = [];\n depends[self.name][key].push(watchingFn[self.name]);\n }\n return obj[key];\n },\n set(obj, key, val) {\n obj[key] = val;\n if (depends[self.name][key])\n depends[self.name][key].forEach(cb => cb());\n return true;\n }\n });\n }\n /**\n * Register a handler for the observer proxy\n * @param {function} target The handler function\n */\n watcher(target) {\n watchingFn[this.name] = target;\n target();\n watchingFn[this.name] = null;\n }\n};\n//# sourceMappingURL=options-proxy.js.map","/**\n * Transforms a promise for \"await\" to return both error and result so you don't\n * have to wrap promises in try catch\n * @example ```\n * let [ error, result ] = await to(promise)\n * ```\n * @author Jon Paul Miles\n */\nconst to = function (promise) {\n return promise.then(result => [null, result]).catch(err => [err, null]);\n};\nmodule.exports = to;\n//# sourceMappingURL=to.js.map","// Main module for client\nconst { to, isObject, stripProps, genUuid, hash, hashOfRecord } = require('./common');\nconst { Owndata, owndataWrapper } = require('./owndata');\nconst { Ownnet, ownnetWrapper } = require('./ownnet');\nmodule.exports = {\n to, isObject, stripProps, genUuid, hash, hashOfRecord,\n Owndata, owndataWrapper,\n Ownnet, ownnetWrapper\n};\n//# sourceMappingURL=index.js.map","const OwnClass = require('./own-class');\nmodule.exports = OwnClass;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst sift_1 = __importDefault(require(\"sift\"));\nconst adapter_commons_1 = require(\"@feathersjs/adapter-commons\");\nconst errors_1 = __importDefault(require(\"@feathersjs/errors\"));\nconst feathers_localstorage_1 = __importDefault(require(\"feathers-localstorage\"));\nconst common_1 = require(\"../common\");\nconst snapshot_1 = __importDefault(require(\"../snapshot\"));\nconst debug = require('debug')('@feathersjs-offline:ownclass:service-base');\nconst defaultOptions = {\n 'id': 'id',\n 'store': null,\n 'storage': null,\n 'useShortUuid': true,\n 'throttle': null,\n 'timedSync': 24 * 60 * 60 * 1000,\n 'adapterTest': false,\n 'matcher': sift_1.default,\n sorter: adapter_commons_1.sorter,\n 'fixedName': ''\n};\nconst BOT = new Date(0);\nconst _adapterTestStrip = ['uuid', 'updatedAt', 'onServerAt', 'deletedAt'];\nlet nameIx = 0;\nconst attrStrip = (...attr) => {\n return (res) => {\n let result;\n if (Array.isArray(res)) {\n result = [];\n res.map((v, i, arr) => {\n let obj = clone(arr[i]);\n attr.forEach(a => delete obj[a]);\n result.push(obj);\n });\n }\n else {\n result = clone(res);\n attr.forEach(a => delete result[a]);\n }\n return result;\n };\n};\nclass OwnClass extends adapter_commons_1.AdapterService {\n constructor(opts) {\n let newOpts = Object.assign({}, defaultOptions, opts);\n debug(`Constructor started, newOpts = ${JSON.stringify(newOpts)}`);\n super(newOpts);\n this.wrapperOptions = Object.assign({}, newOpts, this.options);\n debug(`Constructor ended, options = ${JSON.stringify(this.options)}`);\n this.type = 'own-class';\n debug(' Done.');\n return this;\n }\n _setup(app, path) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`_SetUp('${path}') started`);\n return this.setup(app, path);\n });\n }\n setup(app, path) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`SetUp('${path}') started`);\n if (this._setupPerformed) { // Assure we only run setup once\n return;\n }\n this._setupPerformed = true;\n this.options = this.wrapperOptions;\n let self = this;\n this.thisName = this.options.fixedName !== '' ? this.options.fixedName : `${this.type}_offline_${nameIx++}_${path}`;\n // Now we are ready to define the path with its underlying service (the remoteService)\n let old = app.service(path);\n if (old !== self) {\n this.remoteService = old; // We want to get the default service (redirects to server or points to a local service)\n app.use(path, self); // Install this service instance\n }\n // Get the service name and standard settings\n this.name = path;\n // Construct the two helper services\n this.localServiceName = this.thisName + '_local';\n this.localServiceQueue = this.thisName + '_queue';\n this.storage = this.options.storage ? this.options.storage : localStorage;\n this.localSpecOptions = { name: this.localServiceName, storage: this.storage, store: this.options.store, reuseKeys: this.options.fixedName !== '' };\n let localOptions = Object.assign({}, this.options, this.localSpecOptions);\n let queueOptions = { id: 'id', name: this.localServiceQueue, storage: this.storage, paginate: null, multi: true, reuseKeys: this.options.fixedName !== '' };\n debug(` Setting up services '${this.localServiceName}' and '${this.localServiceQueue}'...`);\n app.use(this.localServiceName, feathers_localstorage_1.default(localOptions));\n app.use(this.localServiceQueue, feathers_localstorage_1.default(queueOptions));\n this.localService = app.service(this.localServiceName);\n this.localQueue = app.service(this.localServiceQueue);\n // We need to make sure that localService is properly initiated - make a dummy search\n // (one of the quirks of feathers-localstorage)\n yield this.localService.ready();\n // The initialization/setup of the localService adapter screws-up our options object\n this.options = this.wrapperOptions;\n // Are we running adapterTests?\n if (this.options.adapterTest) {\n // Make sure the '_adapterTestStrip' attributes are stripped from results\n // However, we need to allow for having uuid as key\n let stripValues = Object.assign([], _adapterTestStrip);\n let idIx = stripValues.findIndex(v => { return v === self.id; });\n if (idIx > -1)\n stripValues.splice(idIx, 1);\n this._strip = attrStrip(...stripValues);\n }\n else {\n this._strip = v => { return v; };\n }\n // Make sure we always select the key (id) in our results\n this._select = (params, ...others) => (res) => { return adapter_commons_1.select(params, ...others, self.id)(res); };\n // Initialize the service wrapper\n this.listening = false;\n this.aIP = 0; // Our semaphore for internal processing\n this.pQActive = false; // Our flag for avoiding more than one processing of queued operations at a time\n // Determine latest registered sync timestamp\n this.syncedAt = new Date(this.storage.getItem(this.thisName + '_syncedAt') || 0).toISOString();\n this.storage.setItem(this.thisName + '_syncedAt', new Date(this.syncedAt).toISOString());\n // This is necessary if we get updates to options (e.g. .options.multi = ['patch'])\n if (!(this.remoteService instanceof adapter_commons_1.AdapterService)) {\n this._listenOptions();\n }\n // Make sure that the wrapped service is setup correctly\n if (typeof this.remoteService.setup === 'function') {\n this.remoteService.setup(app, path);\n }\n // Should we perform a sync every timedSync?\n if (this.options.timedSync && Number.isInteger(this.options.timedSync) && this.options.timedSync > 0) {\n this._timedSyncHandle = setInterval(() => self.sync(), self.options.timedSync);\n }\n debug(' Done.');\n return true;\n });\n }\n _listenOptions() {\n // This is necessary if we get updates to options (e.g. .options.multi = ['patch'])\n let self = this;\n let optProxy = new common_1.OptionsProxy(self.thisName);\n this.options = optProxy.observe(Object.assign({}, self.remoteService.options ? self.remoteService.options : {}, self.options));\n optProxy.watcher(() => {\n // Update all changes to 'this.options' in both localService and remoteService\n self.remoteService.options = Object.assign({}, self.remoteService.options, self.options);\n self.localService.options = Object.assign({}, self.options, self.localSpecOptions);\n });\n }\n getEntries(params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling getEntries(${JSON.stringify(params)}})`);\n let res = [];\n yield this.localService.getEntries(params)\n .then(entries => {\n res = entries;\n });\n return Promise.resolve(res)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n get(id, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling get(${JSON.stringify(id)}, ${JSON.stringify(params)}})`);\n return this._get(id, params);\n });\n }\n _get(id, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _get(${JSON.stringify(id)}, ${JSON.stringify(params)}})`);\n return yield this.localService.get(id, params)\n .then(this._strip)\n .then(this._select(params))\n .catch(err => { throw err; });\n });\n }\n find(params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling find(${JSON.stringify(params)}})`);\n debug(` rows=${JSON.stringify(yield this.getEntries())}`);\n return this._find(params);\n });\n }\n _find(params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _find(${JSON.stringify(params)}})`);\n return this.localService.find(params)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n ;\n create(data, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling create(${JSON.stringify(data)}, ${JSON.stringify(params)})`);\n if (Array.isArray(data) && !this.allowsMulti('create')) {\n return Promise.reject(new errors_1.default.MethodNotAllowed('Creating multiple without option \\'multi\\' set'));\n }\n return this._create(data, params);\n });\n }\n _create(data, params, ts = 0) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _create(${JSON.stringify(data)}, ${JSON.stringify(params)}, ${ts})`);\n let self = this;\n if (Array.isArray(data)) {\n const multi = this.allowsMulti('create');\n if (!multi) {\n return Promise.reject(new errors_1.default.MethodNotAllowed('Creating multiple without option \\'multi\\' set'));\n }\n let timestamp = new Date();\n // In future version we will user Promise.allSettled() instead...\n return Promise.all(data.map(current => self._create(current, params, timestamp)));\n }\n ts = ts || new Date();\n let newData = clone(data);\n // As we do not know if the server is connected we have to make sure the important\n // values are set with reasonable values\n if (!('uuid' in newData)) {\n newData.uuid = common_1.genUuid(this.options.useShortUuid);\n }\n if (!('updatedAt' in newData)) {\n newData.updatedAt = ts;\n }\n // We do not allow the client to set the onServerAt attribute to other than default '0'\n newData.onServerAt = BOT;\n // Is uuid unique?\n let [err, res] = yield common_1.to(this.localService.find({ query: { 'uuid': newData.uuid } }));\n if (res && res.length) {\n throw new errors_1.default.BadRequest(`Optimistic create requires unique uuid. (${this.type}) res=${JSON.stringify(res)}`);\n }\n // We apply optimistic mutation\n let newParams = clone(params);\n this.disallowInternalProcessing('_create');\n let queueId = yield this._addQueuedEvent('create', newData, clone(newData), params);\n // Start actual mutation on remote service\n [err, res] = yield common_1.to(this.localService.create(newData, clone(params)));\n if (res) {\n this.remoteService.create(res, clone(params))\n .then((rres) => __awaiter(this, void 0, void 0, function* () {\n yield common_1.to(self._removeQueuedEvent('_create0', queueId, newData, newData.updatedAt));\n yield self._patchIfNotRemoved(rres[self.id], rres);\n // Ok, we have connection - empty queue if we have any items queued\n self.allowInternalProcessing('_create0');\n yield common_1.to(self._processQueuedEvents());\n }))\n .catch((rerr) => __awaiter(this, void 0, void 0, function* () {\n if (rerr.name !== 'Timeout') {\n // Let's silently ignore missing connection to server -\n // we'll catch-up next time we get a connection\n // In all other cases do the following:\n yield common_1.to(self._removeQueuedEvent('_create1', queueId, rerr.message /*newData*/, newData.updatedAt));\n yield common_1.to(self.localService.remove(res[self.id], params));\n }\n self.allowInternalProcessing('_create1');\n }));\n }\n else {\n yield common_1.to(this._removeQueuedEvent('_create2', queueId, newData, newData.updatedAt));\n this.allowInternalProcessing('_create2');\n throw err;\n }\n return Promise.resolve(res)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n update(id, data, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling update(${id}, ${JSON.stringify(data)}, ${JSON.stringify(params)}})`);\n if (id === null || Array.isArray(data)) {\n return Promise.reject(new errors_1.default.BadRequest(`You can not replace multiple instances. Did you mean 'patch'?`));\n }\n return this._update(id, data, params);\n });\n }\n _update(id, data, params = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _update(${id}, ${JSON.stringify(data)}, ${JSON.stringify(params)}})`);\n let self = this;\n if (id === null || Array.isArray(data)) {\n return Promise.reject(new errors_1.default.BadRequest(`You can not replace multiple instances. Did you mean 'patch'?`));\n }\n let [err, res] = yield common_1.to(this.localService._get(id));\n if (!(res && res !== {})) {\n throw new errors_1.default.NotFound(`Trying to update non-existing ${this.id}=${id}. (${this.type}) err=${JSON.stringify(err.name)}`);\n }\n // We don't want our uuid to change type if it can be coerced\n const beforeRecord = clone(res);\n const beforeUuid = beforeRecord.uuid;\n let newData = clone(data);\n newData.uuid = beforeUuid; // eslint-disable-line\n newData.updatedAt = new Date();\n newData.onServerAt = BOT;\n // Optimistic mutation\n this.disallowInternalProcessing('_update');\n let queueId = yield this._addQueuedEvent('update', newData, id, clone(newData), params);\n // Start actual mutation on remote service\n [err, res] = yield common_1.to(this.localService.update(id, newData, clone(params)));\n if (!err) {\n this.remoteService.update(id, res, clone(params))\n .then((rres) => __awaiter(this, void 0, void 0, function* () {\n yield common_1.to(self._removeQueuedEvent('_update0', queueId, newData, res.updatedAt));\n yield self._patchIfNotRemoved(rres[self.id], rres);\n self.allowInternalProcessing('_update0');\n yield common_1.to(self._processQueuedEvents());\n }))\n .catch((rerr) => __awaiter(this, void 0, void 0, function* () {\n if (rerr.name === 'Timeout') {\n debug(`_update TIMEOUT: ${rerr.name}, ${rerr.message}`);\n // Let's silently ignore missing connection to server\n // We'll catch-up next time we get a connection\n }\n else {\n debug(`_update ERROR: ${rerr.name}, ${rerr.message}`);\n yield common_1.to(self._removeQueuedEvent('_update1', queueId, newData, res.updatedAt));\n yield common_1.to(self.localService.patch(id, beforeRecord));\n }\n self.allowInternalProcessing('_update1');\n }));\n }\n else {\n yield common_1.to(this._removeQueuedEvent('_update2', queueId, newData, newData.updatedAt));\n this.allowInternalProcessing('_update2');\n throw err;\n }\n return Promise.resolve(newData)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n patch(id, data, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling patch(${id}, ${JSON.stringify(data)}, ${JSON.stringify(params)}})`);\n if (id === null && !this.allowsMulti('patch')) {\n return Promise.reject(new errors_1.default.MethodNotAllowed(`Can not patch multiple entries`));\n }\n return this._patch(id, data, params);\n });\n }\n _patch(id, data, params = {}, ts = 0) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _patch(${id}, ${JSON.stringify(data)}, ${JSON.stringify(params)}})`);\n let self = this;\n if (id === null) {\n const multi = this.allowsMulti('patch');\n if (!multi) {\n throw new errors_1.default.MethodNotAllowed('Patching multiple without option \\'multi\\' set');\n }\n return this.find(params).then(page => {\n const res = page.data ? page.data : page;\n if (!Array.isArray(res)) {\n res = [res];\n }\n let timestamp = new Date().toISOString();\n return Promise.all(res.map(current => self._patch(current[this.id], data, params, timestamp)));\n });\n }\n ts = ts || new Date();\n let [err, res] = yield common_1.to(this.localService._get(id));\n if (!(res && res !== {})) {\n throw err;\n }\n // Optimistic mutation\n const beforeRecord = clone(res);\n const newData = Object.assign({}, beforeRecord, data);\n newData.onServerAt = BOT;\n newData.updatedAt = ts;\n this.disallowInternalProcessing('_patch');\n const queueId = yield this._addQueuedEvent('patch', newData, id, clone(newData), params);\n // Start actual mutation on remote service\n [err, res] = yield common_1.to(this.localService.patch(id, newData, clone(params)));\n if (res) {\n this.remoteService.patch(id, res, clone(params))\n .then((rres) => __awaiter(this, void 0, void 0, function* () {\n yield common_1.to(self._removeQueuedEvent('_patch0', queueId, rres, res.updatedAt));\n yield self._patchIfNotRemoved(rres[self.id], rres);\n self.allowInternalProcessing('_patch0');\n yield common_1.to(self._processQueuedEvents());\n }))\n .catch((rerr) => __awaiter(this, void 0, void 0, function* () {\n if (rerr.name === 'Timeout') {\n debug(`_patch TIMEOUT: ${rerr.name}, ${rerr.message}`);\n // Let's silently ignore missing connection to server\n // We'll catch-up next time we get a connection\n }\n else {\n debug(`_patch ERROR: ${rerr.name}, ${rerr.message}`);\n yield common_1.to(self._removeQueuedEvent('_patch1', queueId, newData, res.updatedAt));\n yield common_1.to(self.localService.patch(id, beforeRecord));\n }\n self.allowInternalProcessing('_patch1');\n }));\n }\n else {\n yield common_1.to(this._removeQueuedEvent('_patch2', queueId, newData, newData.updatedAt));\n this.allowInternalProcessing('_patch2');\n throw err;\n }\n return Promise.resolve(newData)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n /**\n * An internal method to patch a localService record if and only if\n * we have not been overtaken by a remove request.\n *\n * @param {any} id\n * @param {any} data\n */\n _patchIfNotRemoved(id, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.localService.patch(id, data)\n .catch(_ => Promise.resolve(true));\n });\n }\n remove(id, params) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling remove(${id}, ${JSON.stringify(params)}})`);\n if (id === null && !this.allowsMulti('remove')) {\n return Promise.reject(new errors_1.default.MethodNotAllowed(`Can not remove multiple entries`));\n }\n return this._remove(id, params);\n });\n }\n _remove(id, params = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`Calling _remove(${id}, ${JSON.stringify(params)}})`);\n let self = this;\n if (id === null) {\n const multi = this.allowsMulti('remove');\n if (!multi) {\n throw new errors_1.default.MethodNotAllowed('Removing multiple without option \\'multi\\' set');\n }\n return this.find(params).then(page => {\n const res = page.data ? page.data : page;\n if (!Array.isArray(res)) {\n res = [res];\n }\n return Promise.all(res.map(current => self._remove(current[this.id], params)));\n });\n }\n let [err, res] = yield common_1.to(this.localService._get(id));\n if (!(res && res !== {})) {\n throw new errors_1.default.BadRequest(`Trying to remove non-existing ${this.id}=${id}. (${this.type}) err=${JSON.stringify(err)}, res=${JSON.stringify(res)}`);\n }\n // Optimistic mutation\n const beforeRecord = clone(res);\n this.disallowInternalProcessing('_remove');\n const queueId = yield this._addQueuedEvent('remove', beforeRecord, id, params);\n // Start actual mutation on remote service\n [err, res] = yield common_1.to(this.localService.remove(id, clone(params)));\n if (!err) {\n this.remoteService.remove(id, clone(params))\n .then((rres) => __awaiter(this, void 0, void 0, function* () {\n yield common_1.to(self._removeQueuedEvent('_remove0', queueId, beforeRecord, null));\n self.allowInternalProcessing('_remove0');\n yield common_1.to(self._processQueuedEvents());\n }))\n .catch((rerr) => __awaiter(this, void 0, void 0, function* () {\n if (rerr.name === 'Timeout') {\n debug(`_remove TIMEOUT: ${rerr.name}, ${rerr.message}`);\n }\n else {\n debug(`_remove ERROR: ${rerr.name}, ${rerr.message}\\nbeforeRecord = ${JSON.stringify(beforeRecord)}`);\n // if (beforeRecord.onServerAt === BOT) {\n // In all likelihood the document/item was never on the server\n // so we choose to silently ignore this situation\n // } else {\n // We have to restore the record to the local DB\n yield common_1.to(self._removeQueuedEvent('_remove1', queueId, beforeRecord, null));\n yield common_1.to(self.localService.create(beforeRecord, null));\n // }\n }\n self.allowInternalProcessing('_remove1');\n }));\n }\n else {\n yield common_1.to(this._removeQueuedEvent('_remove2', queueId, beforeRecord, null));\n this.allowInternalProcessing('_remove2');\n throw err;\n }\n return Promise.resolve(beforeRecord)\n .then(this._strip)\n .then(this._select(params));\n });\n }\n // Allow access to our internal services (for application hooks and the demo). Use with care!\n get remote() {\n return this.remoteService;\n }\n set remote(value) {\n throw new errors_1.default.Forbidden(`You cannot change value of remote!`);\n }\n get local() {\n return this.localService;\n }\n set local(value) {\n throw new errors_1.default.Forbidden(`You cannot change value of local!`);\n }\n get queue() {\n return this.localQueue;\n }\n set queue(value) {\n throw new errors_1.default.Forbidden(`You cannot change value of queue!`);\n }\n /* Queue handling */\n /**\n * Allow queue processing (allowed when semaphore this.aIP === 0)\n */\n allowInternalProcessing(from) {\n debug(`allowInternalProcessing: ${from} ${this.thisName} ${this.aIP - 1}`);\n this.aIP--;\n }\n /**\n * Disallow queue processing (when semaphore this.aIP !== 0)\n */\n disallowInternalProcessing(from) {\n debug(`disallowInternalProcessing: ${from} ${this.thisName} ${this.aIP + 1}`);\n this.aIP++;\n }\n /**\n * Is queue processing allowed?\n */\n internalProcessingAllowed() {\n return this.aIP === 0;\n }\n _addQueuedEvent(eventName, localRecord, arg1, arg2, arg3) {\n return __awaiter(this, void 0, void 0, function* () {\n debug('addQueuedEvent entered');\n let [err, res] = yield common_1.to(this.localQueue.create({ eventName, record: localRecord, arg1, arg2, arg3 }));\n debug(`addQueuedEvent added: ${JSON.stringify(res)}`);\n return Promise.resolve(res.id);\n });\n }\n _removeQueuedEvent(eventName, id, localRecord, updatedAt) {\n return __awaiter(this, void 0, void 0, function* () {\n debug('removeQueuedEvent entered');\n const [err, res] = yield common_1.to(this.localQueue.remove(id));\n return Promise.resolve(res);\n });\n }\n /**\n * This method must be implemented in own-data and own-net classes extending this class\n */\n _processQueuedEvents() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new errors_1.default.NotImplemented(`_processQueuedEvents must be implemented!!!`);\n });\n }\n /* Event listening */\n /* Synchronization */\n /**\n * Synchronize the relevant documents/items from the remote db with the local db.\n *\n * @param {boolean} bAll If true, we try to sync for the beginning of time.\n * @returns {boolean} True if the process was completed, false otherwise.\n */\n sync(bAll = false) {\n return __awaiter(this, void 0, void 0, function* () {\n while (!this.internalProcessingAllowed()) {\n // console.log(`sync: await internalProcessing (aIP=${this.aIP})`);\n yield new Promise(resolve => {\n setTimeout(() => {\n resolve(true);\n }, 200);\n });\n }\n const syncOptions = yield this._getSyncOptions(bAll);\n debug(`${this.type}.sync(${JSON.stringify(syncOptions)}) started...`);\n let self = this;\n let result = true;\n let [err, snap] = yield common_1.to(snapshot_1.default(this.remoteService, syncOptions));\n if (err) { // we silently ignore any errors\n if (err.className === 'timeout') {\n debug(` TIMEOUT: ${JSON.stringify(err)}`);\n }\n else {\n debug(` ERROR: ${JSON.stringify(err)}`);\n }\n // Ok, tell anyone interested about the result\n this.localService.emit('synced', false);\n return false;\n }\n /*\n * For each row returned by snapshot we perform the following:\n * - if it already exists locally\n * - if it is marked as deleted\n * - remove the row\n * - otherwise\n * - patch the row\n * - otherwise\n * - if it is not marked as deleted\n * - create the row\n * Moreover we track the `onServerAt` to determine latest sync timestamp\n */\n debug(` Applying received snapshot data... (${snap.length} items)`);\n let syncTS = new Date(0).toISOString();\n yield Promise.all(snap.map((v) => __awaiter(this, void 0, void 0, function* () {\n let [err, res] = yield common_1.to(self.localService.get(v[self.id]));\n if (res) {\n syncTS = syncTS < v.onServerAt ? v.onServerAt : syncTS;\n if (v.deletedAt) {\n [err, res] = yield common_1.to(self.localService.remove(v[self.id]));\n }\n else {\n [err, res] = yield common_1.to(self.localService.patch(v[self.id], v));\n }\n if (err) {\n result = false;\n }\n }\n else {\n if (!v.deletedAt) {\n syncTS = syncTS < v.onServerAt ? v.onServerAt : syncTS;\n [err, res] = yield common_1.to(self.localService.create(v));\n if (err) {\n result = false;\n }\n }\n }\n })));\n // Save last sync timestamp\n this.storage.setItem(this.thisName + '_syncedAt', new Date(syncTS).toISOString());\n if (result) // Wait until internal Processing is ok\n while (!(yield this._processQueuedEvents())) {\n yield new Promise(resolve => {\n setTimeout(() => {\n resolve(true);\n }, 200);\n });\n }\n ;\n // Ok, tell anyone interested about the result\n this.localService.emit('synced', result);\n return result;\n });\n }\n /**\n * Determine the relevant options necessary for synchronizing this service.\n *\n * @param {boolean} bAll If true, we try to sync for the beginning of time.\n * @returns {object} The relevant options for snapshot().\n */\n _getSyncOptions(bAll) {\n return __awaiter(this, void 0, void 0, function* () {\n let query = Object.assign({}, { offline: { _forceAll: true }, $sort: { onServerAt: 1 } });\n let ts = bAll ? new Date(0).toISOString() : this.syncedAt;\n let syncTS = ts < this.syncedAt ? ts : this.syncedAt;\n if (syncTS !== new Date(ts)) {\n query.offline.onServerAt = new Date(syncTS);\n }\n return query;\n });\n }\n}\n;\nmodule.exports = OwnClass;\n// --- Helper functions\n/**\n * Make a full clone of any given object\n * @param {object} obj\n * @returns {object} The copy object\n */\nfunction clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n//# sourceMappingURL=own-class.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst commons_1 = require(\"@feathersjs/commons\");\nconst errors_1 = __importDefault(require(\"@feathersjs/errors\"));\nconst common_1 = require(\"../common\");\nconst own_common_1 = __importDefault(require(\"../own-common\"));\nconst debug = require('debug')('@feathersjs-offline:owndata:service-wrapper');\nconst BOT = new Date(0).toISOString();\nclass OwndataClass extends own_common_1.default {\n constructor(opts) {\n debug(`Constructor started, opts = ${JSON.stringify(opts)}`);\n super(opts);\n this.type = 'own-data';\n this.__forTestingOnly = super._processQueuedEvents;\n debug(' Done.');\n return this;\n }\n _processQueuedEvents() {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`processQueuedEvents (${this.type}) entered`);\n if (!this.internalProcessingAllowed() || this.pQActive) {\n // console.log(`processingQueuedEvents: internalProcessing (aIP=${this.aIP}), pQActive=${this.pQActive}`);\n return false;\n }\n this.pQActive = true;\n let [err, store] = yield common_1.to(this.localQueue.getEntries({ query: { $sort: { [this.id]: 1 } } }));\n if (!store || store === []) {\n this.pQActive = false;\n return true;\n }\n debug(` processing ${store.length} queued entries...`);\n let self = this;\n let stop = false;\n while (store.length && !stop) {\n let el = store.shift();\n let { eventName, record, arg1, arg2, arg3 = null, id } = el;\n ({ eventName, el, arg1, arg2, arg3, id } = _accEvent(this.id, eventName, record, arg1, arg2, arg3, id));\n debug(` processing: event=${eventName}, arg1=${JSON.stringify(arg1)}, arg2=${JSON.stringify(arg2)}, arg3=${JSON.stringify(arg3)}`);\n yield self.remoteService[eventName](arg1, arg2, arg3)\n .then((res) => __awaiter(this, void 0, void 0, function* () {\n yield common_1.to(self.localQueue.remove(id));\n if (eventName !== 'remove') {\n // Let any updates to the document/item on server reflect on the local DB\n yield common_1.to(self.localService.patch(res[self.id], res));\n }\n }))\n .catch((err) => __awaiter(this, void 0, void 0, function* () {\n debug(`catch: record=${JSON.stringify(record)}, BOT=${JSON.stringify(BOT)}, event=${eventName}, id=${id}`);\n if (record.onServerAt === BOT && eventName === 'remove') {\n // This record has probably never been on server (=remoteService), so we silently ignore the error\n yield common_1.to(self.localQueue.remove(id));\n }\n else {\n // The connection to the server has probably been cut - let's continue at another time\n stop = true;\n }\n }));\n }\n debug(` processing ended, stop=${stop}`);\n this.pQActive = false;\n return !stop;\n });\n }\n}\n;\nfunction init(options) {\n return new OwndataClass(options);\n}\nlet Owndata = init;\n/**\n * A owndataWrapper is a CLIENT adapter wrapping for FeathersJS services extending them to\n * implement the offline own-data principle (**LINK-TO-DOC**).\n *\n * @example ```\n * import feathers from '(at)feathersjs/feathers';\n * import memory from 'feathers-memory';\n * import { owndataWrapper } from '(at)feathersjs-offline/client';\n * const app = feathers();\n * app.use('/testpath', memory({id: 'uuid'}));\n * owndataWrapper(app, '/testpath');\n * app.service('testpath').create({givenName: 'James', familyName: 'Bond'})\n * // ...\n * ```\n *\n * It works in co-existence with it's SERVER counterpart, RealtimeServiceWrapper.\n *\n * @param {object} app The application handle\n * @param {object} path The service path (as used in ```app.use(path, serviceAdapter)```)\n * @param {object} options The options for the serviceAdaptor AND the OwndataWrapper\n *\n */\nfunction owndataWrapper(app, path, options = {}) {\n debug(`owndataWrapper started on path '${path}'`);\n if (!(app && app.version && app.service && app.services)) {\n throw new errors_1.default.Unavailable(`The FeathersJS app must be supplied as first argument`);\n }\n let location = commons_1.stripSlashes(path);\n let old = app.service(location);\n if (typeof old === 'undefined') {\n throw new errors_1.default.Unavailable(`No prior service registered on path '${location}'`);\n }\n let opts = Object.assign({}, old.options, options);\n app.use(location, Owndata(opts));\n let service = app.service(location);\n service.options = opts;\n service._listenOptions();\n return service;\n}\nmodule.exports = { init, Owndata, owndataWrapper };\ninit.Service = OwndataClass;\n// Helper\nfunction _accEvent(idName, eventName, el, arg1, arg2, arg3, id) {\n let elId = el[idName];\n switch (eventName) {\n case 'create':\n return { eventName, el, arg1: el, arg2: arg2, arg3: {}, id };\n case 'update':\n return { eventName, el, arg1, arg2, arg3: arg3, id };\n case 'patch':\n return { eventName, el, arg1: elId, arg2: el, arg3: arg3, id };\n case 'remove':\n return { eventName, el, arg1: elId, arg2: {}, arg3: arg3, id };\n }\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst commons_1 = require(\"@feathersjs/commons\");\nconst errors_1 = __importDefault(require(\"@feathersjs/errors\"));\nconst common_1 = require(\"../common\");\nconst own_common_1 = __importDefault(require(\"../own-common\"));\nconst debug = require('debug')('@feathersjs-offline:ownnet:service-wrapper');\nclass OwnnetClass extends own_common_1.default {\n constructor(options) {\n debug(`Constructor started, opts = ${JSON.stringify(options)}`);\n super(options);\n this.type = 'own-net';\n this.__forTestingOnly = super._processQueuedEvents;\n debug(' Done.');\n }\n _processQueuedEvents() {\n return __awaiter(this, void 0, void 0, function* () {\n debug(`processQueuedEvents (${this.type}) entered (IPallowed=${this.internalProcessingAllowed()}, pQActive=${this.pQActive})`);\n if (!this.internalProcessingAllowed() || this.pQActive) {\n debug(`processingQueuedEvents: leaving internalProcessing (aIP=${this.aIP}), pQActive=${this.pQActive}`);\n return false;\n }\n this.pQActive = true;\n let [err, store] = yield common_1.to(this.localQueue.getEntries({ query: { $sort: { uuid: 1, updatedAt: 1 } } }));\n if (!store || store === [] || store.length === 0) {\n this.pQActive = false;\n return true;\n }\n this.disallowInternalProcessing();\n debug(` processing ${store.length} queued entries...`);\n let self = this;\n let i = 0; // Current event\n let j = 0; // Current first event\n let ids = []; // The ids of the entries in localQueue currently accumulated\n let netOps = [];\n let ev = [];\n let stop = false;\n // For own-net we only send one accumulated record to the server - let's accumulate!\n // Remember, we already have the accumulated record on file in localService, so all we\n // need to do, is to look out for create and remove - the rest we remoteService.patch!\n let eventName;\n let record;\n let arg1;\n let arg2;\n let arg3;\n do {\n while (i < store.length && store[i].record.uuid === store[j].record.uuid) {\n ({ eventName, record, arg1, arg2, arg3 } = store[i]);\n ids.push(store[i].id);\n ev.push(eventName);\n if (eventName === 'remove') {\n netOps.push(_accEvent(this.id, eventName, record, arg1, arg2, arg3, ids));\n ev = [];\n ids = [];\n j = i + 1; // New start at next record\n }\n i++; // get next possible record\n }\n if (ids.length) {\n let res;\n let err;\n if (store[j].eventName !== 'create')\n [err, res] = yield common_1.to(self.localService.get(store[j].record[this.id]));\n else\n res = store[j].record;\n let action = ev.includes('create') ? 'create' : 'update';\n netOps.push(_accEvent(this.id, action, res, arg1, arg2, arg3, ids));\n if (i < store.length) {\n ev = [store[i].eventName];\n ids = [store[i].id];\n }\n j = i++; // New start at i and move to next record\n }\n } while (i < store.length);\n debug(`netOps = ${JSON.stringify(netOps)}`);\n // Now, send all necessary updates to the remote service (server)\n stop = false;\n // In future version we will user Promise.allSettled() instead...\n let result = yield Promise.all(netOps.map((op) => __awaiter(this, void 0, void 0, function* () {\n let { eventName, el, arg1, arg2, arg3, ids } = op;\n let mdebug = ` remoteService['${eventName}'](${JSON.stringify(arg1)}, ${JSON.stringify(arg2)}, ${JSON.stringify(arg3)})`;\n debug(mdebug);\n return yield self.remoteService[eventName](arg1, arg2, arg3)\n .then((res) => __awaiter(this, void 0, void 0, function* () {\n return yield self.localQueue.remove(null, { query: { id: { $in: clone(ids) } } })\n .then((qres) => __awaiter(this, void 0, void 0, function* () {\n if (eventName !== 'remove') {\n return yield self.localService.patch(res[self.id], res)\n .catch(err => {\n debug(mdebug + ` (copy)\\n localService.patch(${JSON.stringify(res[self.id])}, ${JSON.stringify(res)})`);\n return true;\n })\n .then(() => { return false; });\n }\n return false;\n }))\n .catch(err => {\n debug(`err2=${err.name}, ${err.message}`);\n return false;\n });\n }));\n // .catch(err => {\n // if (err.name === 'Timeout' && err.type === 'FeathersError') {\n // // We silently accept - we probably lost connection\n // }\n // else {\n // if (eventName === 'remove' && el.onServerAt === 0) {\n // // This record has probably never been on server (=remoteService), so we silently ignore the error\n // }\n // else {\n // if (err.name !== 'Timeout' /* && eventName !== 'remove' && el.onServerAt !== 0 */) {\n // return false;\n // }\n // }\n // return false;\n // });\n })));\n // stop = result.reduce((pv, cv, ci, arr) => stop || arr[ci]);\n this.allowInternalProcessing();\n this.pQActive = false;\n return true;\n });\n }\n}\nfunction init(options) {\n return new OwnnetClass(options);\n}\nlet Ownnet = init;\n/**\n * A ownnetWrapper is a CLIENT adapter wrapping for FeathersJS services extending them to\n * implement the offline own-net principle (**LINK-TO-DOC**).\n *\n * @example ```\n * import feathers from '(at)feathersjs/feathers';\n * import memory from 'feathers-memory';\n * import { ownnetWrapper } from '(at)feathersjs-offline/client';\n * const app = feathers();\n * app.use('/testpath', memory({id: 'uuid'}));\n * ownnetWrapper(app, '/testpath');\n * app.service('testpath').create({givenName: 'James', familyName: 'Bond'})\n * // ...\n * ```\n *\n * It works in co-existence with it's SERVER counterpart, RealtimeServiceWrapper.\n *\n * @param {object} app The application handle\n * @param {object} path The service path (as used in ```app.use(path, serviceAdapter)```)\n * @param {object} options The options for the serviceAdaptor AND the OwnnetWrapper\n *\n */\nfunction ownnetWrapper(app, path, options = {}) {\n debug(`ownnetWrapper started on path '${path}'`);\n if (!(app && app.version && app.service && app.services))\n throw new errors_1.default.Unavailable(`The FeathersJS app must be supplied as first argument`);\n let location = commons_1.stripSlashes(path);\n let old = app.service(location);\n if (typeof old === 'undefined') {\n throw new errors_1.default.Unavailable(`No prior service registered on path '${location}'`);\n }\n let opts = Object.assign({}, old.options, options);\n app.use(location, Ownnet(opts));\n let service = app.service(location);\n service.options = opts;\n service._listenOptions();\n return service;\n}\nmodule.exports = { init, Ownnet, ownnetWrapper };\ninit.Service = OwnnetClass;\n// Helpers\nfunction clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\nfunction _accEvent(idName, eventName, el, arg1, arg2, arg3, ids) {\n let elId = el[idName];\n switch (eventName) {\n case 'create':\n return { eventName, el, arg1: el, arg2: arg2, arg3: {}, ids };\n case 'update':\n return { eventName, el, arg1, arg2, arg3: arg3, ids };\n case 'patch':\n return { eventName, el, arg1: elId, arg2: el, arg3: arg3, ids };\n case 'remove':\n return { eventName, el, arg1: elId, arg2: {}, arg3: arg3, ids };\n }\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//\n// Most of this code has been copied from 'https://github.com/feathers-plus/feathers-offline-snapshot/blob/master/src/index.js'\n// with permission from @eddyystop\n//\nconst debug_1 = __importDefault(require(\"debug\"));\nconst debug = debug_1.default('@feathersjs-offline:snapshot');\nfunction snapshot(service, baseQuery) {\n debug(`snapshot start: ${JSON.stringify(baseQuery)}`);\n const query = Object.assign({}, { $skip: 0, $limit: 200 }, baseQuery); // use max recs configured\n let fileDatas;\n return service.find({ query })\n .then(result => {\n debug(`snapshot query = ${JSON.stringify(query)}, read ${(result.data || result).length} records\\n\n snapshot read ${JSON.stringify(result.data || result)}`);\n if (!result.data) {\n return result;\n }\n const { total, limit, skip, data } = result;\n fileDatas = data;\n return (skip + data.length < total) ? readRemainingPages(skip + limit) : fileDatas;\n });\n function readRemainingPages(skip) {\n query.$skip = skip;\n return service.find({ query })\n .then(({ total, limit, skip, data }) => {\n debug(`read ${data.length} records`);\n fileDatas = fileDatas.concat(data);\n return (skip + data.length < total) ? readRemainingPages(skip + limit) : fileDatas;\n });\n }\n}\nmodule.exports = snapshot;\n//# sourceMappingURL=index.js.map","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n","(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n","const { Service } = require('feathers-memory');\n\nconst usedKeys = [];\n\nclass LocalStorage extends Service {\n constructor (options = {}) {\n super(options);\n this._storageKey = options.name || 'feathers';\n this._storage = options.storage || (typeof window !== 'undefined' && window.localStorage);\n this._throttle = options.throttle || 200;\n this._reuseKeys = options.reuseKeys || false;\n this.store = null;\n\n if (!this._storage) {\n throw new Error('The `storage` option needs to be provided');\n }\n\n if (usedKeys.indexOf(this._storageKey) === -1) {\n usedKeys.push(this._storageKey);\n } else {\n if (!this._reuseKeys) { // Allow reuse if options.reuseKeys set to true\n throw new Error(`The storage name '${this._storageKey}' is already in use by another instance.`);\n }\n }\n\n this.ready();\n }\n\n ready () {\n if (!this.store) {\n return Promise.resolve(this._storage.getItem(this._storageKey))\n .then(str => JSON.parse(str || '{}'))\n .then(store => {\n const keys = Object.keys(store);\n const last = store[keys[keys.length - 1]];\n\n // Current id is the id of the last item\n this._uId = (keys.length && typeof last[this.id] !== 'undefined') ? last[this.id] + 1 : this._uId;\n\n return (this.store = store);\n });\n }\n\n return Promise.resolve(this.store);\n }\n\n flush (data) {\n if (!this._timeout) {\n this._timeout = setTimeout(() => {\n this._storage.setItem(this._storageKey, JSON.stringify(this.store));\n delete this._timeout;\n }, this._throttle);\n }\n\n return data;\n }\n\n execute (method, ...args) {\n return this.ready()\n .then(() => super[method](...args));\n }\n\n find (...args) {\n return this.execute('find', ...args);\n }\n\n get (...args) {\n return this.execute('get', ...args);\n }\n\n create (...args) {\n return this.execute('create', ...args)\n .then(data => this.flush(data));\n }\n\n patch (...args) {\n return this.execute('patch', ...args)\n .then(data => this.flush(data));\n }\n\n update (...args) {\n return this.execute('update', ...args)\n .then(data => this.flush(data));\n }\n\n remove (...args) {\n return this.execute('remove', ...args)\n .then(data => this.flush(data));\n }\n}\n\nmodule.exports = function init (options) {\n return new LocalStorage(options);\n};\n\nmodule.exports.Service = Service;\n","const errors = require('@feathersjs/errors');\nconst { _ } = require('@feathersjs/commons');\nconst { sorter, select, AdapterService } = require('@feathersjs/adapter-commons');\nconst sift = require('sift').default;\n\nconst _select = (data, ...args) => {\n const base = select(...args);\n\n return base(JSON.parse(JSON.stringify(data)));\n};\n\nclass Service extends AdapterService {\n constructor (options = {}) {\n super(_.extend({\n id: 'id',\n matcher: sift,\n sorter\n }, options));\n this._uId = options.startId || 0;\n this.store = options.store || {};\n }\n\n async getEntries (params = {}) {\n const { query } = this.filterQuery(params);\n\n return this._find(Object.assign({}, params, {\n paginate: false,\n query\n }));\n }\n\n async _find (params = {}) {\n const { query, filters, paginate } = this.filterQuery(params);\n let values = _.values(this.store).filter(this.options.matcher(query));\n const total = values.length;\n\n if (filters.$sort !== undefined) {\n values.sort(this.options.sorter(filters.$sort));\n }\n\n if (filters.$skip !== undefined) {\n values = values.slice(filters.$skip);\n }\n\n if (filters.$limit !== undefined) {\n values = values.slice(0, filters.$limit);\n }\n\n const result = {\n total,\n limit: filters.$limit,\n skip: filters.$skip || 0,\n data: values.map(value => _select(value, params))\n };\n\n if (!(paginate && paginate.default)) {\n return result.data;\n }\n\n return result;\n }\n\n async _get (id, params = {}) {\n if (id in this.store) {\n const { query } = this.filterQuery(params);\n const value = this.store[id];\n\n if (this.options.matcher(query)(value)) {\n return _select(value, params, this.id);\n }\n }\n\n throw new errors.NotFound(`No record found for id '${id}'`);\n }\n\n // Create without hooks and mixins that can be used internally\n async _create (data, params = {}) {\n if (Array.isArray(data)) {\n return Promise.all(data.map(current => this._create(current, params)));\n }\n\n const id = data[this.id] || this._uId++;\n const current = _.extend({}, data, { [this.id]: id });\n const result = (this.store[id] = current);\n\n return _select(result, params, this.id);\n }\n\n async _update (id, data, params = {}) {\n const oldEntry = await this._get(id);\n // We don't want our id to change type if it can be coerced\n const oldId = oldEntry[this.id];\n\n id = oldId == id ? oldId : id; // eslint-disable-line\n\n this.store[id] = _.extend({}, data, { [this.id]: id });\n\n return this._get(id, params);\n }\n\n async _patch (id, data, params = {}) {\n const patchEntry = entry => {\n const currentId = entry[this.id];\n\n this.store[currentId] = _.extend(this.store[currentId], _.omit(data, this.id));\n\n return _select(this.store[currentId], params, this.id);\n };\n\n if (id === null) {\n const entries = await this.getEntries(params);\n\n return entries.map(patchEntry);\n }\n\n return patchEntry(await this._get(id, params)); // Will throw an error if not found\n }\n\n // Remove without hooks and mixins that can be used internally\n async _remove (id, params = {}) {\n if (id === null) {\n const entries = await this.getEntries(params);\n\n return Promise.all(entries.map(\n current => this._remove(current[this.id], params))\n );\n }\n\n const entry = await this._get(id, params);\n\n delete this.store[id];\n\n return entry;\n }\n}\n\nmodule.exports = options => {\n return new Service(options);\n};\n\nmodule.exports.Service = Service;\n","/*\n *\n * Copryright 2018, Craig Condon\n * Licensed under MIT\n *\n * Filter JavaScript objects with mongodb queries\n */\n\nfunction typeChecker(type) {\n var typeString = \"[object \" + type + \"]\";\n return function(value) {\n return Object.prototype.toString.call(value) === typeString;\n };\n}\n\n/**\n */\n\nvar isArray = typeChecker(\"Array\");\nvar isObject = typeChecker(\"Object\");\nvar isFunction = typeChecker(\"Function\");\n\nfunction get(obj, key) {\n return isFunction(obj.get) ? obj.get(key) : obj[key];\n}\n\n\nconst nestable = (validator) => (validateOptions, value, key, valueOwner, nestedResults) => {\n if (nestedResults) {\n return Boolean(nestedResults.find(([value, key, valueOwner]) => validator(validateOptions, key, valueOwner)));\n }\n\n return validator(validateOptions, value, key, valueOwner);\n};\n\n/**\n */\n\nconst or = nestable((validator) => {\n return function(validateOptions, value, key, valueOwner, nestedResults) {\n if (!isArray(value) || !value.length) {\n return validator(validateOptions, value);\n }\n for (var i = 0, n = value.length; i < n; i++) {\n if (validator(validateOptions, get(value, i))) return true;\n }\n return false;\n };\n});\n\n/**\n */\n\nfunction and(validator) {\n return function(validateOptions, value, key, valueOwner) {\n if (!isArray(value) || !value.length) {\n return validator(validateOptions, value, key, valueOwner);\n }\n for (var i = 0, n = value.length; i < n; i++) {\n if (!validator(validateOptions, get(value, i), value, valueOwner)) return false;\n }\n return true;\n };\n}\n\nfunction validate(validator, value, key, valueOwner, nestedResults) {\n return validator.validate(validator.options, value, key, valueOwner, nestedResults);\n}\n\nvar defaultExpressions = {\n /**\n */\n\n $eq: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $ne: and(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $gt: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $gte: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $lt: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $lte: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $mod: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $in(test, value) {\n return test(value);\n },\n\n /**\n */\n\n $nin: function(test, value) {\n return test(value);\n },\n\n /**\n */\n\n $not: function(test, value, key, valueOwner) {\n return test(value, key, valueOwner);\n },\n\n /**\n */\n\n $type: function(testType, value) {\n return testType(value);\n },\n\n /**\n */\n\n $all: function(allOptions, value, key, valueOwner, nestedResults) {\n return defaultExpressions.$and(allOptions, value, key, valueOwner, nestedResults);\n },\n\n /**\n */\n\n $size: function(sizeMatch, value) {\n return value ? sizeMatch === value.length : false;\n },\n\n /**\n */\n\n $or: function(orOptions, value, key, valueOwner) {\n for (var i = 0, n = orOptions.length; i < n; i++) {\n if (validate(get(orOptions, i), value, key, valueOwner)) {\n return true;\n }\n }\n return false;\n },\n\n /**\n */\n\n $nor: function(validateOptions, value, key, valueOwner) {\n return !defaultExpressions.$or(validateOptions, value, key, valueOwner);\n },\n\n /**\n */\n\n $and: function(validateOptions, value, key, valueOwner, nestedResults) {\n\n if (nestedResults) {\n for (var i = 0, n = validateOptions.length; i < n; i++) {\n if (!validate(get(validateOptions, i), value, key, valueOwner, nestedResults)) {\n return false;\n }\n }\n } else {\n for (var i = 0, n = validateOptions.length; i < n; i++) {\n if (!validate(get(validateOptions, i), value, key, valueOwner, nestedResults)) {\n return false;\n }\n }\n }\n return true;\n },\n\n /**\n */\n\n $regex: or(function(validateOptions, value) {\n return typeof value === \"string\" && validateOptions.test(value);\n }),\n\n /**\n */\n\n $where: function(validateOptions, value, key, valueOwner) {\n return validateOptions.call(value, value, key, valueOwner);\n },\n\n /**\n */\n\n $elemMatch: function(validateOptions, value, key, valueOwner) {\n if (isArray(value)) {\n return !!~search(value, validateOptions);\n }\n return validate(validateOptions, value, key, valueOwner);\n },\n\n /**\n */\n\n $exists: function(validateOptions, value, key, valueOwner) {\n return valueOwner.hasOwnProperty(key) === validateOptions;\n }\n};\n\n/**\n */\n\nvar prepare = {\n /**\n */\n\n $eq: function(query, queryOwner, { comparable, compare }) {\n if (query instanceof RegExp) {\n return or(function(value) {\n return typeof value === \"string\" && query.test(value);\n });\n } else if (query instanceof Function) {\n return or(query);\n } else if (isArray(query) && !query.length) {\n // Special case of a == []\n return or(function(value) {\n return isArray(value) && !value.length;\n });\n } else if (query === null) {\n return or(function(value) {\n //will match both null and undefined\n return value == null;\n });\n }\n return or(function(value) {\n return compare(comparable(value), comparable(query)) === 0;\n });\n },\n\n $gt: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) > 0;\n };\n },\n\n $gte: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) >= 0;\n };\n },\n\n $lt: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) < 0;\n };\n },\n $lte: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) <= 0;\n };\n },\n\n $in: function(query, queryOwner, options) {\n const { comparable } = options;\n return function(value) {\n if (value instanceof Array) {\n for (var i = value.length; i--; ) {\n if (~query.indexOf(comparable(get(value, i)))) {\n return true;\n }\n }\n } else {\n var comparableValue = comparable(value);\n if (comparableValue === value && typeof value === \"object\") {\n for (var i = query.length; i--; ) {\n if (\n String(query[i]) === String(value) &&\n String(value) !== \"[object Object]\"\n ) {\n return true;\n }\n }\n }\n\n /*\n Handles documents that are undefined, whilst also\n having a 'null' element in the parameters to $in.\n */\n if (typeof comparableValue == \"undefined\") {\n for (var i = query.length; i--; ) {\n if (query[i] == null) {\n return true;\n }\n }\n }\n\n /*\n Handles the case of {'field': {$in: [/regexp1/, /regexp2/, ...]}}\n */\n for (var i = query.length; i--; ) {\n var validator = createRootValidator(get(query, i), options);\n var result = validate(validator, comparableValue, i, query);\n if (\n result &&\n String(result) !== \"[object Object]\" &&\n String(comparableValue) !== \"[object Object]\"\n ) {\n return true;\n }\n }\n\n return !!~query.indexOf(comparableValue);\n }\n\n return false;\n };\n },\n\n $nin: function(query, queryOwner, options) {\n const eq = prepare.$in(query, queryOwner, options);\n return function(validateOptions, value, key, valueOwner) {\n return !eq(validateOptions, value, key, valueOwner);\n };\n },\n\n $mod: function(query) {\n return function(value) {\n return value % query[0] == query[1];\n };\n },\n\n /**\n */\n\n $ne: function(query, queryOwner, options) {\n const eq = prepare.$eq(query, queryOwner, options);\n return and(function(validateOptions, value, key, valueOwner) {\n return !eq(validateOptions, value, key, valueOwner);\n });\n },\n\n /**\n */\n\n $and: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $all: function(query, queryOwner, options) {\n return prepare.$and(query, queryOwner, options);\n },\n\n /**\n */\n\n $or: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $nor: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $not: function(query, queryOwner, options) {\n const validateOptions = parse(options)(query);\n return function(value, key, valueOwner) {\n return !validate(validateOptions, value, key, valueOwner);\n };\n },\n\n $type: function(query) {\n return function(value, key, valueOwner) {\n return value != void 0\n ? value instanceof query || value.constructor == query\n : false;\n };\n },\n\n /**\n */\n\n $regex: function(query, queryOwner) {\n return new RegExp(query, queryOwner.$options);\n },\n\n /**\n */\n\n $where: function(query) {\n return typeof query === \"string\"\n ? new Function(\"obj\", \"return \" + query)\n : query;\n },\n\n /**\n */\n\n $elemMatch: function(query, queryOwner, options) {\n return parse(options)(query);\n },\n\n /**\n */\n\n $exists: function(query) {\n return !!query;\n }\n};\n\n/**\n */\n\nfunction search(array, validator) {\n for (var i = 0; i < array.length; i++) {\n var result = get(array, i);\n if (validate(validator, get(array, i))) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n */\n\nfunction createValidator(options, validate) {\n return { options, validate };\n}\n\n/**\n */\n\nfunction validatedNested({ keyPath, child, query }, value) {\n const results = [];\n findValues(value, keyPath, 0, value, results);\n \n if (results.length === 1) {\n const [value, key, valueOwner] = results[0];\n return validate(child, value, key, valueOwner);\n }\n\n // If the query contains $ne, need to test all elements ANDed together\n var inclusive = query && typeof query.$ne !== \"undefined\";\n var allValid = inclusive;\n const allValues = results.map(([value]) => value);\n\n return validate(child, undefined, undefined, undefined, results);\n // for (var i = 0; i < results.length; i++) {\n // const [value, key, valueOwner] = results[i];\n // var isValid = validate(child, value, key, valueOwner);\n // console.log(isValid, value);\n // if (inclusive) {\n // allValid &= isValid;\n // } else {\n // allValid |= isValid;\n // }\n // }\n // return allValid;\n}\n\n/**\n */\n\nfunction findValues(current, keypath, index, object, values) {\n if (index === keypath.length || current == void 0) {\n values.push([current, keypath[index - 1], object]);\n return;\n }\n\n var k = get(keypath, index);\n\n // ensure that if current is an array, that the current key\n // is NOT an array index. This sort of thing needs to work:\n // sift({'foo.0':42}, [{foo: [42]}]);\n if (isArray(current) && isNaN(Number(k))) {\n for (var i = 0, n = current.length; i < n; i++) {\n findValues(get(current, i), keypath, index, current, values);\n }\n } else {\n findValues(get(current, k), keypath, index + 1, current, values);\n }\n}\n\n/**\n */\n\nfunction createNestedValidator(keyPath, child, query) {\n return createValidator({ keyPath, child, query }, validatedNested);\n}\n\n/**\n * flatten the query\n */\n\nfunction isVanillaObject(value) {\n return (\n value &&\n (value.constructor === Object ||\n value.constructor === Array ||\n value.constructor.toString() === \"function Object() { [native code] }\" ||\n value.constructor.toString() === \"function Array() { [native code] }\")\n );\n}\n\nfunction parse(options) {\n const { comparable, expressions } = options;\n var wrapQuery = function(query) {\n if (!query || !isVanillaObject(query)) {\n query = { $eq: query };\n }\n return query;\n };\n\n var parseQuery = function(query) {\n query = comparable(query);\n\n var validators = [];\n\n for (var key in query) {\n var queryValue = query[key];\n\n if (key === \"$options\") {\n continue;\n }\n\n var expression =\n defaultExpressions[key] || (options && expressions && expressions[key]);\n\n if (expression) {\n if (prepare[key]) {\n queryValue = prepare[key](queryValue, query, options);\n }\n validators.push(createValidator(comparable(queryValue), expression));\n } else {\n if (key.charCodeAt(0) === 36) {\n throw new Error(\"Unknown operation \" + key);\n }\n\n var keyParts = key.split(\".\");\n\n validators.push(\n createNestedValidator(keyParts, parseNested(queryValue), queryValue)\n );\n }\n }\n\n return validators.length === 1\n ? validators[0]\n : createValidator(validators, defaultExpressions.$and);\n };\n\n var parseNested = function(query) {\n query = wrapQuery(query);\n if (isExactObject(query)) {\n return createValidator(query, isEqual);\n }\n return parseQuery(query);\n };\n\n var parseRoot = function(query) {\n return parseQuery(wrapQuery(query));\n };\n\n return parseRoot;\n}\n\nfunction isEqual(a, b) {\n if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) {\n return false;\n }\n\n if (isObject(a)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n for (var key in a) {\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n } else if (isArray(a)) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0, n = a.length; i < n; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n } else {\n return a === b;\n }\n}\n\nfunction getAllKeys(value, keys) {\n if (!isObject(value)) {\n return keys;\n }\n for (var key in value) {\n keys.push(key);\n getAllKeys(value[key], keys);\n }\n return keys;\n}\n\nfunction isExactObject(value) {\n const allKeysHash = getAllKeys(value, []).join(\",\");\n return allKeysHash.search(/[$.]/) === -1;\n}\n\n/**\n */\n\nfunction createRootValidator(query, options) {\n var validator = parse(options)(query);\n if (options && options.select) {\n validator = {\n options: validator,\n validate: function(validateOptions, value, key, valueOwner) {\n return validate(\n validateOptions,\n value && options.select(value),\n key,\n valueOwner\n );\n }\n };\n }\n return validator;\n}\n\n/**\n */\n\nexport default function sift(query, options) {\n options = Object.assign({ compare, comparable }, options);\n var validator = createRootValidator(query, options);\n return function(value, key, valueOwner) {\n return validate(validator, value, key, valueOwner);\n };\n}\n\n/**\n */\n\nexport function compare(a, b) {\n if (isEqual(a, b)) return 0;\n if (typeof a === typeof b) {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n }\n}\n\n/**\n */\n\nexport function comparable(value) {\n if (value instanceof Date) {\n return value.getTime();\n } else if (isArray(value)) {\n return value.map(comparable);\n } else if (value && typeof value.toJSON === \"function\") {\n return value.toJSON();\n } else {\n return value;\n }\n}\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","(function(){\r\n var crypt = require('crypt'),\r\n utf8 = require('charenc').utf8,\r\n isBuffer = require('is-buffer'),\r\n bin = require('charenc').bin,\r\n\r\n // The core\r\n md5 = function (message, options) {\r\n // Convert to byte array\r\n if (message.constructor == String)\r\n if (options && options.encoding === 'binary')\r\n message = bin.stringToBytes(message);\r\n else\r\n message = utf8.stringToBytes(message);\r\n else if (isBuffer(message))\r\n message = Array.prototype.slice.call(message, 0);\r\n else if (!Array.isArray(message) && message.constructor !== Uint8Array)\r\n message = message.toString();\r\n // else, assume byte array already\r\n\r\n var m = crypt.bytesToWords(message),\r\n l = message.length * 8,\r\n a = 1732584193,\r\n b = -271733879,\r\n c = -1732584194,\r\n d = 271733878;\r\n\r\n // Swap endian\r\n for (var i = 0; i < m.length; i++) {\r\n m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |\r\n ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;\r\n }\r\n\r\n // Padding\r\n m[l >>> 5] |= 0x80 << (l % 32);\r\n m[(((l + 64) >>> 9) << 4) + 14] = l;\r\n\r\n // Method shortcuts\r\n var FF = md5._ff,\r\n GG = md5._gg,\r\n HH = md5._hh,\r\n II = md5._ii;\r\n\r\n for (var i = 0; i < m.length; i += 16) {\r\n\r\n var aa = a,\r\n bb = b,\r\n cc = c,\r\n dd = d;\r\n\r\n a = FF(a, b, c, d, m[i+ 0], 7, -680876936);\r\n d = FF(d, a, b, c, m[i+ 1], 12, -389564586);\r\n c = FF(c, d, a, b, m[i+ 2], 17, 606105819);\r\n b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);\r\n a = FF(a, b, c, d, m[i+ 4], 7, -176418897);\r\n d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);\r\n c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);\r\n b = FF(b, c, d, a, m[i+ 7], 22, -45705983);\r\n a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);\r\n d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);\r\n c = FF(c, d, a, b, m[i+10], 17, -42063);\r\n b = FF(b, c, d, a, m[i+11], 22, -1990404162);\r\n a = FF(a, b, c, d, m[i+12], 7, 1804603682);\r\n d = FF(d, a, b, c, m[i+13], 12, -40341101);\r\n c = FF(c, d, a, b, m[i+14], 17, -1502002290);\r\n b = FF(b, c, d, a, m[i+15], 22, 1236535329);\r\n\r\n a = GG(a, b, c, d, m[i+ 1], 5, -165796510);\r\n d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);\r\n c = GG(c, d, a, b, m[i+11], 14, 643717713);\r\n b = GG(b, c, d, a, m[i+ 0], 20, -373897302);\r\n a = GG(a, b, c, d, m[i+ 5], 5, -701558691);\r\n d = GG(d, a, b, c, m[i+10], 9, 38016083);\r\n c = GG(c, d, a, b, m[i+15], 14, -660478335);\r\n b = GG(b, c, d, a, m[i+ 4], 20, -405537848);\r\n a = GG(a, b, c, d, m[i+ 9], 5, 568446438);\r\n d = GG(d, a, b, c, m[i+14], 9, -1019803690);\r\n c = GG(c, d, a, b, m[i+ 3], 14, -187363961);\r\n b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);\r\n a = GG(a, b, c, d, m[i+13], 5, -1444681467);\r\n d = GG(d, a, b, c, m[i+ 2], 9, -51403784);\r\n c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);\r\n b = GG(b, c, d, a, m[i+12], 20, -1926607734);\r\n\r\n a = HH(a, b, c, d, m[i+ 5], 4, -378558);\r\n d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);\r\n c = HH(c, d, a, b, m[i+11], 16, 1839030562);\r\n b = HH(b, c, d, a, m[i+14], 23, -35309556);\r\n a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);\r\n d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);\r\n c = HH(c, d, a, b, m[i+ 7], 16, -155497632);\r\n b = HH(b, c, d, a, m[i+10], 23, -1094730640);\r\n a = HH(a, b, c, d, m[i+13], 4, 681279174);\r\n d = HH(d, a, b, c, m[i+ 0], 11, -358537222);\r\n c = HH(c, d, a, b, m[i+ 3], 16, -722521979);\r\n b = HH(b, c, d, a, m[i+ 6], 23, 76029189);\r\n a = HH(a, b, c, d, m[i+ 9], 4, -640364487);\r\n d = HH(d, a, b, c, m[i+12], 11, -421815835);\r\n c = HH(c, d, a, b, m[i+15], 16, 530742520);\r\n b = HH(b, c, d, a, m[i+ 2], 23, -995338651);\r\n\r\n a = II(a, b, c, d, m[i+ 0], 6, -198630844);\r\n d = II(d, a, b, c, m[i+ 7], 10, 1126891415);\r\n c = II(c, d, a, b, m[i+14], 15, -1416354905);\r\n b = II(b, c, d, a, m[i+ 5], 21, -57434055);\r\n a = II(a, b, c, d, m[i+12], 6, 1700485571);\r\n d = II(d, a, b, c, m[i+ 3], 10, -1894986606);\r\n c = II(c, d, a, b, m[i+10], 15, -1051523);\r\n b = II(b, c, d, a, m[i+ 1], 21, -2054922799);\r\n a = II(a, b, c, d, m[i+ 8], 6, 1873313359);\r\n d = II(d, a, b, c, m[i+15], 10, -30611744);\r\n c = II(c, d, a, b, m[i+ 6], 15, -1560198380);\r\n b = II(b, c, d, a, m[i+13], 21, 1309151649);\r\n a = II(a, b, c, d, m[i+ 4], 6, -145523070);\r\n d = II(d, a, b, c, m[i+11], 10, -1120210379);\r\n c = II(c, d, a, b, m[i+ 2], 15, 718787259);\r\n b = II(b, c, d, a, m[i+ 9], 21, -343485551);\r\n\r\n a = (a + aa) >>> 0;\r\n b = (b + bb) >>> 0;\r\n c = (c + cc) >>> 0;\r\n d = (d + dd) >>> 0;\r\n }\r\n\r\n return crypt.endian([a, b, c, d]);\r\n };\r\n\r\n // Auxiliary functions\r\n md5._ff = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._gg = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._hh = function (a, b, c, d, x, s, t) {\r\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._ii = function (a, b, c, d, x, s, t) {\r\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n\r\n // Package private blocksize\r\n md5._blocksize = 16;\r\n md5._digestsize = 16;\r\n\r\n module.exports = function (message, options) {\r\n if (message === undefined || message === null)\r\n throw new Error('Illegal argument ' + message);\r\n\r\n var digestbytes = crypt.wordsToBytes(md5(message, options));\r\n return options && options.asBytes ? digestbytes :\r\n options && options.asString ? bin.bytesToString(digestbytes) :\r\n crypt.bytesToHex(digestbytes);\r\n };\r\n\r\n})();\r\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","'use strict';\nmodule.exports = require('./lib/index');\n","'use strict';\n\nvar randomFromSeed = require('./random/random-from-seed');\n\nvar ORIGINAL = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-';\nvar alphabet;\nvar previousSeed;\n\nvar shuffled;\n\nfunction reset() {\n shuffled = false;\n}\n\nfunction setCharacters(_alphabet_) {\n if (!_alphabet_) {\n if (alphabet !== ORIGINAL) {\n alphabet = ORIGINAL;\n reset();\n }\n return;\n }\n\n if (_alphabet_ === alphabet) {\n return;\n }\n\n if (_alphabet_.length !== ORIGINAL.length) {\n throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. You submitted ' + _alphabet_.length + ' characters: ' + _alphabet_);\n }\n\n var unique = _alphabet_.split('').filter(function(item, ind, arr){\n return ind !== arr.lastIndexOf(item);\n });\n\n if (unique.length) {\n throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. These characters were not unique: ' + unique.join(', '));\n }\n\n alphabet = _alphabet_;\n reset();\n}\n\nfunction characters(_alphabet_) {\n setCharacters(_alphabet_);\n return alphabet;\n}\n\nfunction setSeed(seed) {\n randomFromSeed.seed(seed);\n if (previousSeed !== seed) {\n reset();\n previousSeed = seed;\n }\n}\n\nfunction shuffle() {\n if (!alphabet) {\n setCharacters(ORIGINAL);\n }\n\n var sourceArray = alphabet.split('');\n var targetArray = [];\n var r = randomFromSeed.nextValue();\n var characterIndex;\n\n while (sourceArray.length > 0) {\n r = randomFromSeed.nextValue();\n characterIndex = Math.floor(r * sourceArray.length);\n targetArray.push(sourceArray.splice(characterIndex, 1)[0]);\n }\n return targetArray.join('');\n}\n\nfunction getShuffled() {\n if (shuffled) {\n return shuffled;\n }\n shuffled = shuffle();\n return shuffled;\n}\n\n/**\n * lookup shuffled letter\n * @param index\n * @returns {string}\n */\nfunction lookup(index) {\n var alphabetShuffled = getShuffled();\n return alphabetShuffled[index];\n}\n\nfunction get () {\n return alphabet || ORIGINAL;\n}\n\nmodule.exports = {\n get: get,\n characters: characters,\n seed: setSeed,\n lookup: lookup,\n shuffled: getShuffled\n};\n","'use strict';\n\nvar generate = require('./generate');\nvar alphabet = require('./alphabet');\n\n// Ignore all milliseconds before a certain time to reduce the size of the date entropy without sacrificing uniqueness.\n// This number should be updated every year or so to keep the generated id short.\n// To regenerate `new Date() - 0` and bump the version. Always bump the version!\nvar REDUCE_TIME = 1567752802062;\n\n// don't change unless we change the algos or REDUCE_TIME\n// must be an integer and less than 16\nvar version = 7;\n\n// Counter is used when shortid is called multiple times in one second.\nvar counter;\n\n// Remember the last time shortid was called in case counter is needed.\nvar previousSeconds;\n\n/**\n * Generate unique id\n * Returns string id\n */\nfunction build(clusterWorkerId) {\n var str = '';\n\n var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001);\n\n if (seconds === previousSeconds) {\n counter++;\n } else {\n counter = 0;\n previousSeconds = seconds;\n }\n\n str = str + generate(version);\n str = str + generate(clusterWorkerId);\n if (counter > 0) {\n str = str + generate(counter);\n }\n str = str + generate(seconds);\n return str;\n}\n\nmodule.exports = build;\n","'use strict';\n\nvar alphabet = require('./alphabet');\nvar random = require('./random/random-byte');\nvar format = require('nanoid/format');\n\nfunction generate(number) {\n var loopCounter = 0;\n var done;\n\n var str = '';\n\n while (!done) {\n str = str + format(random, alphabet.get(), 1);\n done = number < (Math.pow(16, loopCounter + 1 ) );\n loopCounter++;\n }\n return str;\n}\n\nmodule.exports = generate;\n","'use strict';\n\nvar alphabet = require('./alphabet');\nvar build = require('./build');\nvar isValid = require('./is-valid');\n\n// if you are using cluster or multiple servers use this to make each instance\n// has a unique value for worker\n// Note: I don't know if this is automatically set when using third\n// party cluster solutions such as pm2.\nvar clusterWorkerId = require('./util/cluster-worker-id') || 0;\n\n/**\n * Set the seed.\n * Highly recommended if you don't want people to try to figure out your id schema.\n * exposed as shortid.seed(int)\n * @param seed Integer value to seed the random alphabet. ALWAYS USE THE SAME SEED or you might get overlaps.\n */\nfunction seed(seedValue) {\n alphabet.seed(seedValue);\n return module.exports;\n}\n\n/**\n * Set the cluster worker or machine id\n * exposed as shortid.worker(int)\n * @param workerId worker must be positive integer. Number less than 16 is recommended.\n * returns shortid module so it can be chained.\n */\nfunction worker(workerId) {\n clusterWorkerId = workerId;\n return module.exports;\n}\n\n/**\n *\n * sets new characters to use in the alphabet\n * returns the shuffled alphabet\n */\nfunction characters(newCharacters) {\n if (newCharacters !== undefined) {\n alphabet.characters(newCharacters);\n }\n\n return alphabet.shuffled();\n}\n\n/**\n * Generate unique id\n * Returns string id\n */\nfunction generate() {\n return build(clusterWorkerId);\n}\n\n// Export all other functions as properties of the generate function\nmodule.exports = generate;\nmodule.exports.generate = generate;\nmodule.exports.seed = seed;\nmodule.exports.worker = worker;\nmodule.exports.characters = characters;\nmodule.exports.isValid = isValid;\n","'use strict';\nvar alphabet = require('./alphabet');\n\nfunction isShortId(id) {\n if (!id || typeof id !== 'string' || id.length < 6 ) {\n return false;\n }\n\n var nonAlphabetic = new RegExp('[^' +\n alphabet.get().replace(/[|\\\\{}()[\\]^$+*?.-]/g, '\\\\$&') +\n ']');\n return !nonAlphabetic.test(id);\n}\n\nmodule.exports = isShortId;\n","'use strict';\n\nvar crypto = typeof window === 'object' && (window.crypto || window.msCrypto); // IE 11 uses window.msCrypto\n\nvar randomByte;\n\nif (!crypto || !crypto.getRandomValues) {\n randomByte = function(size) {\n var bytes = [];\n for (var i = 0; i < size; i++) {\n bytes.push(Math.floor(Math.random() * 256));\n }\n return bytes;\n };\n} else {\n randomByte = function(size) {\n return crypto.getRandomValues(new Uint8Array(size));\n };\n}\n\nmodule.exports = randomByte;\n","'use strict';\n\n// Found this seed-based random generator somewhere\n// Based on The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)\n\nvar seed = 1;\n\n/**\n * return a random number based on a seed\n * @param seed\n * @returns {number}\n */\nfunction getNextValue() {\n seed = (seed * 9301 + 49297) % 233280;\n return seed/(233280.0);\n}\n\nfunction setSeed(_seed_) {\n seed = _seed_;\n}\n\nmodule.exports = {\n nextValue: getNextValue,\n seed: setSeed\n};\n","'use strict';\n\nmodule.exports = 0;\n","// This file replaces `format.js` in bundlers like webpack or Rollup,\n// according to `browser` config in `package.json`.\n\nmodule.exports = function (random, alphabet, size) {\n // We can’t use bytes bigger than the alphabet. To make bytes values closer\n // to the alphabet, we apply bitmask on them. We look for the closest\n // `2 ** x - 1` number, which will be bigger than alphabet size. If we have\n // 30 symbols in the alphabet, we will take 31 (00011111).\n // We do not use faster Math.clz32, because it is not available in browsers.\n var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1\n // Bitmask is not a perfect solution (in our example it will pass 31 bytes,\n // which is bigger than the alphabet). As a result, we will need more bytes,\n // than ID size, because we will refuse bytes bigger than the alphabet.\n\n // Every hardware random generator call is costly,\n // because we need to wait for entropy collection. This is why often it will\n // be faster to ask for few extra bytes in advance, to avoid additional calls.\n\n // Here we calculate how many random bytes should we call in advance.\n // It depends on ID length, mask / alphabet size and magic number 1.6\n // (which was selected according benchmarks).\n\n // -~f => Math.ceil(f) if n is float number\n // -~i => i + 1 if n is integer number\n var step = -~(1.6 * mask * size / alphabet.length)\n var id = ''\n\n while (true) {\n var bytes = random(step)\n // Compact alternative for `for (var i = 0; i < step; i++)`\n var i = step\n while (i--) {\n // If random byte is bigger than alphabet even after bitmask,\n // we refuse it by `|| ''`.\n id += alphabet[bytes[i] & mask] || ''\n // More compact than `id.length + 1 === size`\n if (id.length === +size) return id\n }\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar typeChecker = function (type) {\n var typeString = \"[object \" + type + \"]\";\n return function (value) {\n return getClassName(value) === typeString;\n };\n};\nvar getClassName = function (value) { return Object.prototype.toString.call(value); };\nvar comparable = function (value) {\n if (value instanceof Date) {\n return value.getTime();\n }\n else if (isArray(value)) {\n return value.map(comparable);\n }\n else if (value && typeof value.toJSON === \"function\") {\n return value.toJSON();\n }\n return value;\n};\nvar isArray = typeChecker(\"Array\");\nvar isObject = typeChecker(\"Object\");\nvar isFunction = typeChecker(\"Function\");\nvar isVanillaObject = function (value) {\n return (value &&\n (value.constructor === Object ||\n value.constructor === Array ||\n value.constructor.toString() === \"function Object() { [native code] }\" ||\n value.constructor.toString() === \"function Array() { [native code] }\") &&\n !value.toJSON);\n};\nvar equals = function (a, b) {\n if (a == null && a == b) {\n return true;\n }\n if (a === b) {\n return true;\n }\n if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) {\n return false;\n }\n if (isArray(a)) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0, length_1 = a.length; i < length_1; i++) {\n if (!equals(a[i], b[i]))\n return false;\n }\n return true;\n }\n else if (isObject(a)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (var key in a) {\n if (!equals(a[key], b[key]))\n return false;\n }\n return true;\n }\n return false;\n};\n\n/**\n * Walks through each value given the context - used for nested operations. E.g:\n * { \"person.address\": { $eq: \"blarg\" }}\n */\nvar walkKeyPathValues = function (item, keyPath, next, depth, key, owner) {\n var currentKey = keyPath[depth];\n // if array, then try matching. Might fall through for cases like:\n // { $eq: [1, 2, 3] }, [ 1, 2, 3 ].\n if (isArray(item) && isNaN(Number(currentKey))) {\n for (var i = 0, length_1 = item.length; i < length_1; i++) {\n // if FALSE is returned, then terminate walker. For operations, this simply\n // means that the search critera was met.\n if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) {\n return false;\n }\n }\n }\n if (depth === keyPath.length || item == null) {\n return next(item, key, owner);\n }\n return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item);\n};\nvar BaseOperation = /** @class */ (function () {\n function BaseOperation(params, owneryQuery, options) {\n this.params = params;\n this.owneryQuery = owneryQuery;\n this.options = options;\n this.init();\n }\n BaseOperation.prototype.init = function () { };\n BaseOperation.prototype.reset = function () {\n this.done = false;\n this.keep = false;\n };\n return BaseOperation;\n}());\nvar NamedBaseOperation = /** @class */ (function (_super) {\n __extends(NamedBaseOperation, _super);\n function NamedBaseOperation(params, owneryQuery, options, name) {\n var _this = _super.call(this, params, owneryQuery, options) || this;\n _this.name = name;\n return _this;\n }\n return NamedBaseOperation;\n}(BaseOperation));\nvar GroupOperation = /** @class */ (function (_super) {\n __extends(GroupOperation, _super);\n function GroupOperation(params, owneryQuery, options, children) {\n var _this = _super.call(this, params, owneryQuery, options) || this;\n _this.children = children;\n return _this;\n }\n /**\n */\n GroupOperation.prototype.reset = function () {\n this.keep = false;\n this.done = false;\n for (var i = 0, length_2 = this.children.length; i < length_2; i++) {\n this.children[i].reset();\n }\n };\n /**\n */\n GroupOperation.prototype.childrenNext = function (item, key, owner) {\n var done = true;\n var keep = true;\n for (var i = 0, length_3 = this.children.length; i < length_3; i++) {\n var childOperation = this.children[i];\n childOperation.next(item, key, owner);\n if (!childOperation.keep) {\n keep = false;\n }\n if (childOperation.done) {\n if (!childOperation.keep) {\n break;\n }\n }\n else {\n done = false;\n }\n }\n this.done = done;\n this.keep = keep;\n };\n return GroupOperation;\n}(BaseOperation));\nvar NamedGroupOperation = /** @class */ (function (_super) {\n __extends(NamedGroupOperation, _super);\n function NamedGroupOperation(params, owneryQuery, options, children, name) {\n var _this = _super.call(this, params, owneryQuery, options, children) || this;\n _this.name = name;\n return _this;\n }\n return NamedGroupOperation;\n}(GroupOperation));\nvar QueryOperation = /** @class */ (function (_super) {\n __extends(QueryOperation, _super);\n function QueryOperation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n */\n QueryOperation.prototype.next = function (item, key, parent) {\n this.childrenNext(item, key, parent);\n };\n return QueryOperation;\n}(GroupOperation));\nvar NestedOperation = /** @class */ (function (_super) {\n __extends(NestedOperation, _super);\n function NestedOperation(keyPath, params, owneryQuery, options, children) {\n var _this = _super.call(this, params, owneryQuery, options, children) || this;\n _this.keyPath = keyPath;\n /**\n */\n _this._nextNestedValue = function (value, key, owner) {\n _this.childrenNext(value, key, owner);\n return !_this.done;\n };\n return _this;\n }\n /**\n */\n NestedOperation.prototype.next = function (item, key, parent) {\n walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent);\n };\n return NestedOperation;\n}(GroupOperation));\nvar createTester = function (a, compare) {\n if (a instanceof Function) {\n return a;\n }\n if (a instanceof RegExp) {\n return function (b) {\n var result = typeof b === \"string\" && a.test(b);\n a.lastIndex = 0;\n return result;\n };\n }\n var comparableA = comparable(a);\n return function (b) { return compare(comparableA, comparable(b)); };\n};\nvar EqualsOperation = /** @class */ (function (_super) {\n __extends(EqualsOperation, _super);\n function EqualsOperation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EqualsOperation.prototype.init = function () {\n this._test = createTester(this.params, this.options.compare);\n };\n EqualsOperation.prototype.next = function (item, key, parent) {\n if (!Array.isArray(parent) || parent.hasOwnProperty(key)) {\n if (this._test(item, key, parent)) {\n this.done = true;\n this.keep = true;\n }\n }\n };\n return EqualsOperation;\n}(BaseOperation));\nvar createEqualsOperation = function (params, owneryQuery, options) { return new EqualsOperation(params, owneryQuery, options); };\nvar NopeOperation = /** @class */ (function (_super) {\n __extends(NopeOperation, _super);\n function NopeOperation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NopeOperation.prototype.next = function () {\n this.done = true;\n this.keep = false;\n };\n return NopeOperation;\n}(BaseOperation));\nvar numericalOperationCreator = function (createNumericalOperation) { return function (params, owneryQuery, options, name) {\n if (params == null) {\n return new NopeOperation(params, owneryQuery, options);\n }\n return createNumericalOperation(params, owneryQuery, options, name);\n}; };\nvar numericalOperation = function (createTester) {\n return numericalOperationCreator(function (params, owneryQuery, options) {\n var typeofParams = typeof comparable(params);\n var test = createTester(params);\n return new EqualsOperation(function (b) {\n return typeof comparable(b) === typeofParams && test(b);\n }, owneryQuery, options);\n });\n};\nvar createNamedOperation = function (name, params, parentQuery, options) {\n var operationCreator = options.operations[name];\n if (!operationCreator) {\n throw new Error(\"Unsupported operation: \" + name);\n }\n return operationCreator(params, parentQuery, options, name);\n};\nvar containsOperation = function (query) {\n for (var key in query) {\n if (key.charAt(0) === \"$\")\n return true;\n }\n return false;\n};\nvar createNestedOperation = function (keyPath, nestedQuery, owneryQuery, options) {\n if (containsOperation(nestedQuery)) {\n var _a = createQueryOperations(nestedQuery, options), selfOperations = _a[0], nestedOperations = _a[1];\n if (nestedOperations.length) {\n throw new Error(\"Property queries must contain only operations, or exact objects.\");\n }\n return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations);\n }\n return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [\n new EqualsOperation(nestedQuery, owneryQuery, options)\n ]);\n};\nvar createQueryOperation = function (query, owneryQuery, _a) {\n if (owneryQuery === void 0) { owneryQuery = null; }\n var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations;\n var options = {\n compare: compare || equals,\n operations: Object.assign({}, operations || {})\n };\n var _c = createQueryOperations(query, options), selfOperations = _c[0], nestedOperations = _c[1];\n var ops = [];\n if (selfOperations.length) {\n ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations));\n }\n ops.push.apply(ops, nestedOperations);\n if (ops.length === 1) {\n return ops[0];\n }\n return new QueryOperation(query, owneryQuery, options, ops);\n};\nvar createQueryOperations = function (query, options) {\n var selfOperations = [];\n var nestedOperations = [];\n if (!isVanillaObject(query)) {\n selfOperations.push(new EqualsOperation(query, query, options));\n return [selfOperations, nestedOperations];\n }\n for (var key in query) {\n if (key.charAt(0) === \"$\") {\n var op = createNamedOperation(key, query[key], query, options);\n // probably just a flag for another operation (like $options)\n if (op != null) {\n selfOperations.push(op);\n }\n }\n else {\n nestedOperations.push(createNestedOperation(key.split(\".\"), query[key], query, options));\n }\n }\n return [selfOperations, nestedOperations];\n};\nvar createOperationTester = function (operation) { return function (item, key, owner) {\n operation.reset();\n operation.next(item, key, owner);\n return operation.keep;\n}; };\nvar createQueryTester = function (query, options) {\n if (options === void 0) { options = {}; }\n return createOperationTester(createQueryOperation(query, null, options));\n};\n\nvar $Ne = /** @class */ (function (_super) {\n __extends($Ne, _super);\n function $Ne() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Ne.prototype.init = function () {\n this._test = createTester(this.params, this.options.compare);\n };\n $Ne.prototype.reset = function () {\n _super.prototype.reset.call(this);\n this.keep = true;\n };\n $Ne.prototype.next = function (item) {\n if (this._test(item)) {\n this.done = true;\n this.keep = false;\n }\n };\n return $Ne;\n}(NamedBaseOperation));\n// https://docs.mongodb.com/manual/reference/operator/query/elemMatch/\nvar $ElemMatch = /** @class */ (function (_super) {\n __extends($ElemMatch, _super);\n function $ElemMatch() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $ElemMatch.prototype.init = function () {\n this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options);\n };\n $ElemMatch.prototype.reset = function () {\n _super.prototype.reset.call(this);\n this._queryOperation.reset();\n };\n $ElemMatch.prototype.next = function (item) {\n if (isArray(item)) {\n for (var i = 0, length_1 = item.length; i < length_1; i++) {\n // reset query operation since item being tested needs to pass _all_ query\n // operations for it to be a success\n this._queryOperation.reset();\n // check item\n this._queryOperation.next(item[i], i, item);\n this.keep = this.keep || this._queryOperation.keep;\n }\n this.done = true;\n }\n else {\n this.done = false;\n this.keep = false;\n }\n };\n return $ElemMatch;\n}(NamedBaseOperation));\nvar $Not = /** @class */ (function (_super) {\n __extends($Not, _super);\n function $Not() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Not.prototype.init = function () {\n this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options);\n };\n $Not.prototype.reset = function () {\n this._queryOperation.reset();\n };\n $Not.prototype.next = function (item, key, owner) {\n this._queryOperation.next(item, key, owner);\n this.done = this._queryOperation.done;\n this.keep = !this._queryOperation.keep;\n };\n return $Not;\n}(NamedBaseOperation));\nvar $Size = /** @class */ (function (_super) {\n __extends($Size, _super);\n function $Size() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Size.prototype.init = function () { };\n $Size.prototype.next = function (item) {\n if (isArray(item) && item.length === this.params) {\n this.done = true;\n this.keep = true;\n }\n // if (parent && parent.length === this.params) {\n // this.done = true;\n // this.keep = true;\n // }\n };\n return $Size;\n}(NamedBaseOperation));\nvar $Or = /** @class */ (function (_super) {\n __extends($Or, _super);\n function $Or() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Or.prototype.init = function () {\n var _this = this;\n this._ops = this.params.map(function (op) {\n return createQueryOperation(op, null, _this.options);\n });\n };\n $Or.prototype.reset = function () {\n this.done = false;\n this.keep = false;\n for (var i = 0, length_2 = this._ops.length; i < length_2; i++) {\n this._ops[i].reset();\n }\n };\n $Or.prototype.next = function (item, key, owner) {\n var done = false;\n var success = false;\n for (var i = 0, length_3 = this._ops.length; i < length_3; i++) {\n var op = this._ops[i];\n op.next(item, key, owner);\n if (op.keep) {\n done = true;\n success = op.keep;\n break;\n }\n }\n this.keep = success;\n this.done = done;\n };\n return $Or;\n}(NamedBaseOperation));\nvar $Nor = /** @class */ (function (_super) {\n __extends($Nor, _super);\n function $Nor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Nor.prototype.next = function (item, key, owner) {\n _super.prototype.next.call(this, item, key, owner);\n this.keep = !this.keep;\n };\n return $Nor;\n}($Or));\nvar $In = /** @class */ (function (_super) {\n __extends($In, _super);\n function $In() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $In.prototype.init = function () {\n var _this = this;\n this._testers = this.params.map(function (value) {\n if (containsOperation(value)) {\n throw new Error(\"cannot nest $ under \" + _this.constructor.name.toLowerCase());\n }\n return createTester(value, _this.options.compare);\n });\n };\n $In.prototype.next = function (item, key, owner) {\n var done = false;\n var success = false;\n for (var i = 0, length_4 = this._testers.length; i < length_4; i++) {\n var test = this._testers[i];\n if (test(item)) {\n done = true;\n success = true;\n break;\n }\n }\n this.keep = success;\n this.done = done;\n };\n return $In;\n}(NamedBaseOperation));\nvar $Nin = /** @class */ (function (_super) {\n __extends($Nin, _super);\n function $Nin() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Nin.prototype.next = function (item, key, owner) {\n _super.prototype.next.call(this, item, key, owner);\n this.keep = !this.keep;\n };\n return $Nin;\n}($In));\nvar $Exists = /** @class */ (function (_super) {\n __extends($Exists, _super);\n function $Exists() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n $Exists.prototype.next = function (item, key, owner) {\n if (owner.hasOwnProperty(key) === this.params) {\n this.done = true;\n this.keep = true;\n }\n };\n return $Exists;\n}(NamedBaseOperation));\nvar $And = /** @class */ (function (_super) {\n __extends($And, _super);\n function $And(params, owneryQuery, options, name) {\n return _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;\n }\n $And.prototype.next = function (item, key, owner) {\n this.childrenNext(item, key, owner);\n };\n return $And;\n}(NamedGroupOperation));\nvar $eq = function (params, owneryQuery, options) {\n return new EqualsOperation(params, owneryQuery, options);\n};\nvar $ne = function (params, owneryQuery, options, name) { return new $Ne(params, owneryQuery, options, name); };\nvar $or = function (params, owneryQuery, options, name) { return new $Or(params, owneryQuery, options, name); };\nvar $nor = function (params, owneryQuery, options, name) { return new $Nor(params, owneryQuery, options, name); };\nvar $elemMatch = function (params, owneryQuery, options, name) { return new $ElemMatch(params, owneryQuery, options, name); };\nvar $nin = function (params, owneryQuery, options, name) { return new $Nin(params, owneryQuery, options, name); };\nvar $in = function (params, owneryQuery, options, name) { return new $In(params, owneryQuery, options, name); };\nvar $lt = numericalOperation(function (params) { return function (b) { return b < params; }; });\nvar $lte = numericalOperation(function (params) { return function (b) { return b <= params; }; });\nvar $gt = numericalOperation(function (params) { return function (b) { return b > params; }; });\nvar $gte = numericalOperation(function (params) { return function (b) { return b >= params; }; });\nvar $mod = function (_a, owneryQuery, options) {\n var mod = _a[0], equalsValue = _a[1];\n return new EqualsOperation(function (b) { return comparable(b) % mod === equalsValue; }, owneryQuery, options);\n};\nvar $exists = function (params, owneryQuery, options, name) { return new $Exists(params, owneryQuery, options, name); };\nvar $regex = function (pattern, owneryQuery, options) {\n return new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options);\n};\nvar $not = function (params, owneryQuery, options, name) { return new $Not(params, owneryQuery, options, name); };\nvar $type = function (clazz, owneryQuery, options) {\n return new EqualsOperation(function (b) { return (b != null ? b instanceof clazz || b.constructor === clazz : false); }, owneryQuery, options);\n};\nvar $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); };\nvar $all = $and;\nvar $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, \"$size\"); };\nvar $options = function () { return null; };\nvar $where = function (params, ownerQuery, options) {\n var test;\n if (isFunction(params)) {\n test = params;\n }\n else if (!process.env.CSP_ENABLED) {\n test = new Function(\"obj\", \"return \" + params);\n }\n else {\n throw new Error(\"In CSP mode, sift does not support strings in \\\"$where\\\" condition\");\n }\n return new EqualsOperation(function (b) { return test.bind(b)(b); }, ownerQuery, options);\n};\n\nvar defaultOperations = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $Size: $Size,\n $eq: $eq,\n $ne: $ne,\n $or: $or,\n $nor: $nor,\n $elemMatch: $elemMatch,\n $nin: $nin,\n $in: $in,\n $lt: $lt,\n $lte: $lte,\n $gt: $gt,\n $gte: $gte,\n $mod: $mod,\n $exists: $exists,\n $regex: $regex,\n $not: $not,\n $type: $type,\n $and: $and,\n $all: $all,\n $size: $size,\n $options: $options,\n $where: $where\n});\n\nvar createDefaultQueryOperation = function (query, ownerQuery, _a) {\n var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations;\n return createQueryOperation(query, ownerQuery, {\n compare: compare,\n operations: Object.assign({}, defaultOperations, operations || {})\n });\n};\nvar createDefaultQueryTester = function (query, options) {\n if (options === void 0) { options = {}; }\n var op = createDefaultQueryOperation(query, null, options);\n return createOperationTester(op);\n};\n\nexport default createDefaultQueryTester;\nexport { $Size, $all, $and, $elemMatch, $eq, $exists, $gt, $gte, $in, $lt, $lte, $mod, $ne, $nin, $nor, $not, $options, $or, $regex, $size, $type, $where, EqualsOperation, createDefaultQueryOperation, createEqualsOperation, createOperationTester, createQueryOperation, createQueryTester };\n//# sourceMappingURL=index.js.map\n","export { default as v1 } from './v1.js';\nexport { default as v3 } from './v3.js';\nexport { default as v4 } from './v4.js';\nexport { default as v5 } from './v5.js';\nexport { default as NIL } from './nil.js';\nexport { default as version } from './version.js';\nexport { default as validate } from './validate.js';\nexport { default as stringify } from './stringify.js';\nexport { default as parse } from './parse.js';","/*\n * Browser-compatible JavaScript MD5\n *\n * Modification of JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\nfunction md5(bytes) {\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Uint8Array(msg.length);\n\n for (var i = 0; i < msg.length; ++i) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));\n}\n/*\n * Convert an array of little-endian words to an array of bytes\n */\n\n\nfunction md5ToHexEncodedArray(input) {\n var output = [];\n var length32 = input.length * 32;\n var hexTab = '0123456789abcdef';\n\n for (var i = 0; i < length32; i += 8) {\n var x = input[i >> 5] >>> i % 32 & 0xff;\n var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);\n output.push(hex);\n }\n\n return output;\n}\n/**\n * Calculate output length with padding and bit length\n */\n\n\nfunction getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n\n\nfunction wordsToMd5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32;\n x[getOutputLength(len) - 1] = len;\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n\n for (var i = 0; i < x.length; i += 16) {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n\n return [a, b, c, d];\n}\n/*\n * Convert an array bytes to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n\n\nfunction bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\n\n\nfunction safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\n\n\nfunction bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\n\n\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\n\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn(b & c | ~b & d, a, b, x, s, t);\n}\n\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn(b & d | c & ~d, a, b, x, s, t);\n}\n\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\nexport default md5;","export default '00000000-0000-0000-0000-000000000000';","import validate from './validate.js';\n\nfunction parse(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n var v;\n var arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nexport default parse;","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = [];\n\n for (var i = 0; i < msg.length; ++i) {\n bytes.push(msg.charCodeAt(i));\n }\n } else if (!Array.isArray(bytes)) {\n // Convert Array-like to Array\n bytes = Array.prototype.slice.call(bytes);\n }\n\n bytes.push(0x80);\n var l = bytes.length / 4 + 2;\n var N = Math.ceil(l / 16);\n var M = new Array(N);\n\n for (var _i = 0; _i < N; ++_i) {\n var arr = new Uint32Array(16);\n\n for (var j = 0; j < 16; ++j) {\n arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3];\n }\n\n M[_i] = arr;\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (var _i2 = 0; _i2 < N; ++_i2) {\n var W = new Uint32Array(80);\n\n for (var t = 0; t < 16; ++t) {\n W[t] = M[_i2][t];\n }\n\n for (var _t = 16; _t < 80; ++_t) {\n W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1);\n }\n\n var a = H[0];\n var b = H[1];\n var c = H[2];\n var d = H[3];\n var e = H[4];\n\n for (var _t2 = 0; _t2 < 80; ++_t2) {\n var s = Math.floor(_t2 / 20);\n var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\n}\n\nexport default sha1;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\n\nvar _clockseq; // Previous uuid creation time\n\n\nvar _lastMSecs = 0;\nvar _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || new Array(16);\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n var seedBytes = options.random || (options.rng || rng)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || stringify(b);\n}\n\nexport default v1;","import v35 from './v35.js';\nimport md5 from './md5.js';\nvar v3 = v35('v3', 0x30, md5);\nexport default v3;","import stringify from './stringify.js';\nimport parse from './parse.js';\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n var bytes = [];\n\n for (var i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nexport var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexport var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexport default function (name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = parse(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n var bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return stringify(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import v35 from './v35.js';\nimport sha1 from './sha1.js';\nvar v5 = v35('v5', 0x50, sha1);\nexport default v5;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n\nfunction version(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nexport default version;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(\"./packages/client/lib/index.js\");\n"],"sourceRoot":""} \ No newline at end of file diff --git a/packages/client/dist/feathersjs-offline-client.min.js b/packages/client/dist/feathersjs-offline-client.min.js index 01c5ecd..eabe503 100644 --- a/packages/client/dist/feathersjs-offline-client.min.js +++ b/packages/client/dist/feathersjs-offline-client.min.js @@ -1,2 +1,2 @@ /*! For license information please see feathersjs-offline-client.min.js.LICENSE.txt */ -var feathersjsOfflineClient;feathersjsOfflineClient=(()=>{var t={5871:(t,e,n)=>{"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.OPERATORS=e.FILTERS=void 0;var o=n(2410),i=n(2743);function a(t){if(void 0!==t)return Math.abs(parseInt(t,10))}function s(t,e,n){if(Array.isArray(t))return t.map((function(t){return s(t,e,n)}));if(o._.isObject(t)&&t.constructor==={}.constructor){var r={};return o._.each(t,(function(o,a){if("$"===a[0]){if(void 0!==n[a])return;if(!e.includes(a))throw new i.BadRequest("Invalid query parameter ".concat(a),t)}r[a]=s(o,e,n)})),Object.getOwnPropertySymbols(t).forEach((function(e){r[e]=t[e]})),r}return t}function u(t,e,n,r){return Array.isArray(n)?o._.each(n,(function(n){void 0!==e[n]&&(t[n]=e[n])})):o._.each(n,(function(n,o){var i=n(e[o],r);void 0!==i&&(t[o]=i)})),t}function c(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.filters,o=void 0===r?{}:r,i=n.operators,a=void 0===i?[]:i,c={};return c.filters=u({},t,e.FILTERS,n),c.filters=u(c.filters,t,o,n),c.query=s(t,e.OPERATORS.concat(a),c.filters),c}e.FILTERS={$sort:function(t){return"object"!==r(e=t)||Array.isArray(e)?e:Object.keys(e).reduce((function(t,n){return t[n]="object"===r(e[n])?e[n]:parseInt(e[n],10),t}),{});var e},$limit:function(t,e){return function(t,e){if(e&&e.default){var n="number"!=typeof t||isNaN(t)?e.default:t,r="number"==typeof e.max?e.max:Number.MAX_VALUE;return Math.min(n,r)}return t}(a(t),e.paginate)},$skip:function(t){return a(t)},$select:function(t){return t}},e.OPERATORS=["$in","$nin","$lt","$lte","$gt","$gte","$ne","$or"],e.default=c,t.exports=Object.assign(c,t.exports)},3597:function(t,e,n){"use strict";function r(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?n-1:0),i=1;i2?n-2:0),o=2;o0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0!==t.paginate?t.paginate:this.options.paginate,r=t.query,o=void 0===r?{}:r,i=Object.assign({operators:this.options.whitelist||[],filters:this.options.filters,paginate:n},e),s=a.default(o,i);return Object.assign(s,{paginate:n})}},{key:"allowsMulti",value:function(t){var e=u[t];if(void 0!==e)return e;var n=this.options.multi;return!0===n||!1===n?n:n.includes(t)}},{key:"find",value:function(t){return s(this,"_find",t)}},{key:"get",value:function(t,e){return s(this,"_get",t,e)}},{key:"create",value:function(t,e){return Array.isArray(t)&&!this.allowsMulti("create")?Promise.reject(new i.MethodNotAllowed("Can not create multiple entries")):s(this,"_create",t,e)}},{key:"update",value:function(t,e,n){return null===t||Array.isArray(e)?Promise.reject(new i.BadRequest("You can not replace multiple instances. Did you mean 'patch'?")):s(this,"_update",t,e,n)}},{key:"patch",value:function(t,e,n){return null!==t||this.allowsMulti("patch")?s(this,"_patch",t,e,n):Promise.reject(new i.MethodNotAllowed("Can not patch multiple entries"))}},{key:"remove",value:function(t,e){return null!==t||this.allowsMulti("remove")?s(this,"_remove",t,e):Promise.reject(new i.MethodNotAllowed("Can not remove multiple entries"))}},{key:"id",get:function(){return this.options.id}},{key:"events",get:function(){return this.options.events}}])&&r(e.prototype,n),t}();e.AdapterService=c},3385:(t,e)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne?1:0},e.compareArrays=function(t,n){var r,o;for(r=0;r2&&void 0!==arguments[2]?arguments[2]:e.compareNSB,o=e,i=o.compareNSB,a=o.compare,s=o.compareArrays;if(void 0===t)return void 0===n?0:-1;if(void 0===n)return void 0===t?0:1;if(null===t)return null===n?0:-1;if(null===n)return null===t?0:1;if("number"==typeof t)return"number"==typeof n?i(t,n):-1;if("number"==typeof n)return"number"==typeof t?i(t,n):1;if("string"==typeof t)return"string"==typeof n?r(t,n):-1;if("string"==typeof n)return"string"==typeof t?r(t,n):1;if("boolean"==typeof t)return"boolean"==typeof n?i(t,n):-1;if("boolean"==typeof n)return"boolean"==typeof t?i(t,n):1;if(t instanceof Date)return n instanceof Date?i(t.getTime(),n.getTime()):-1;if(n instanceof Date)return t instanceof Date?i(t.getTime(),n.getTime()):1;if(Array.isArray(t))return Array.isArray(n)?s(t,n):-1;if(Array.isArray(n))return Array.isArray(t)?s(t,n):1;for(var u=Object.keys(t).sort(),c=Object.keys(n).sort(),f=0,l=0;l=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}(r);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(0!=(i=u.direction*e.compare(t[u.key],o[u.key])))return i}}catch(t){s.e(t)}finally{s.f()}return 0}}},1782:(t,e,n)=>{"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.enableHooks=e.processHooks=e.getHooks=e.isHookObject=e.convertHookData=e.makeArguments=e.defaultMakeArguments=e.createHookObject=e.ACTIVATE_HOOKS=void 0;var o=n(621),i=o._,a=i.each,s=i.pick;function u(t){var e=[];return void 0!==t.id&&e.push(t.id),t.data&&e.push(t.data),e.push(t.params||{}),e}function c(t){var e={};return Array.isArray(t)?e={all:t}:"object"!==r(t)?e={all:[t]}:a(t,(function(t,n){e[n]=Array.isArray(t)?t:[t]})),e}function f(t){return"object"===r(t)&&"string"==typeof t.method&&"string"==typeof t.type}e.ACTIVATE_HOOKS=o.createSymbol("__feathersActivateHooks"),e.createHookObject=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};return Object.defineProperty(n,"toJSON",{value:function(){return s(this,"type","method","path","params","id","data","result","error")}}),Object.assign(n,e,{method:t,get path(){var t=e.app,n=e.service;return n&&t&&t.services?Object.keys(t.services).find((function(e){return t.services[e]===n})):null}})},e.defaultMakeArguments=u,e.makeArguments=function(t){switch(t.method){case"find":return[t.params];case"get":case"remove":return[t.id,t.params];case"update":case"patch":return[t.id,t.data,t.params];case"create":return[t.data,t.params]}return u(t)},e.convertHookData=c,e.isHookObject=f,e.getHooks=function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=t.__hooks[n][r]||[],a=e.__hooks[n][r]||[];return o?a.concat(i):i.concat(a)},e.processHooks=function(t,e){var n=this,r=e,o=function(t){if(t){if(!f(t))throw new Error("".concat(r.type," hook for '").concat(r.method,"' method returned invalid hook object"));r=t}return r};return t.reduce((function(t,e){var r=e.bind(n);return t.then((function(t){return r(t)})).then(o)}),Promise.resolve(r)).then((function(){return r})).catch((function(t){throw t.hook=r,t}))},e.enableHooks=function(t,e,n){if("function"==typeof t.hooks)return t;var r={};return n.forEach((function(t){r[t]={}})),Object.defineProperty(t,"__hooks",{configurable:!0,value:r,writable:!0}),Object.assign(t,{hooks:function(t){var n=this;return a(t,(function(t,r){if(!n.__hooks[r])throw new Error("'".concat(r,"' is not a valid hook type"));var o=c(t);a(o,(function(t,n){if("all"!==n&&-1===e.indexOf(n))throw new Error("'".concat(n,"' is not a valid hook method"))})),e.forEach((function(t){var e=n.__hooks[r][t]||(n.__hooks[r][t]=[]);o.all&&e.push.apply(e,o.all),o[t]&&e.push.apply(e,o[t])}))})),this}})}},2410:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.hooks=void 0;var s=i(n(1782));a(n(621),e),e.hooks=s},621:(t,e)=>{"use strict";function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?e-1:0),r=1;r1?r-1:0),i=1;i1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{},r="function"==typeof n.get?n.get.bind(n):function(){},o=r("env")||"production",i=r("host")||process.env.HOST_NAME||"localhost",a="development"===o||"test"===o||void 0===o?"http":"https",s=r("port")||process.env.PORT||3030,u="development"===o||"test"===o||void 0===o?":".concat(s):"";return t=t||"","".concat(a,"://").concat(i).concat(u,"/").concat(e.stripSlashes(t))},e.createSymbol=function(t){return"undefined"!=typeof Symbol?Symbol(t):t}},2743:(t,e,n)=>{function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=n(8801)("@feathersjs/errors");function i(t,e,n,a,s){var u,c,f;(t=t||"Error")instanceof Error?(c=t.message||"Error",t.errors&&(u=t.errors)):"object"===r(t)?(c=t.message||"Error",s=t):c=t,s&&((f=JSON.parse(JSON.stringify(s))).errors?(u=f.errors,delete f.errors):s.errors&&(u=JSON.parse(JSON.stringify(s.errors)))),this.type="FeathersError",this.name=e,this.message=c,this.code=n,this.className=a,this.data=f,this.errors=u||{},o("".concat(this.name,"(").concat(this.code,"): ").concat(this.message)),o(this.errors),Error.captureStackTrace?Error.captureStackTrace(this,i):this.stack=(new Error).stack}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}function s(t,e){i.call(this,t,"BadRequest",400,"bad-request",e)}function u(t,e){i.call(this,t,"NotAuthenticated",401,"not-authenticated",e)}function c(t,e){i.call(this,t,"PaymentError",402,"payment-error",e)}function f(t,e){i.call(this,t,"Forbidden",403,"forbidden",e)}function l(t,e){i.call(this,t,"NotFound",404,"not-found",e)}function h(t,e){i.call(this,t,"MethodNotAllowed",405,"method-not-allowed",e)}function p(t,e){i.call(this,t,"NotAcceptable",406,"not-acceptable",e)}function d(t,e){i.call(this,t,"Timeout",408,"timeout",e)}function y(t,e){i.call(this,t,"Conflict",409,"conflict",e)}function v(t,e){i(this,t,"Gone",410,"gone")}function m(t,e){i.call(this,t,"LengthRequired",411,"length-required",e)}function g(t,e){i.call(this,t,"Unprocessable",422,"unprocessable",e)}function b(t,e){i.call(this,t,"TooManyRequests",429,"too-many-requests",e)}function w(t,e){i.call(this,t,"GeneralError",500,"general-error",e)}function _(t,e){i.call(this,t,"NotImplemented",501,"not-implemented",e)}function S(t,e){i.call(this,t,"BadGateway",502,"bad-gateway",e)}function O(t,e){i.call(this,t,"Unavailable",503,"unavailable",e)}a(i,Error),Object.defineProperty(i.prototype,"toJSON",{value:function(){return{name:this.name,message:this.message,code:this.code,className:this.className,data:this.data,errors:this.errors}}}),a(s,i),a(u,i),a(c,i),a(f,i),a(l,i),a(h,i),a(p,i),a(d,i),a(y,i),a(v,i),a(m,i),a(g,i),a(b,i),a(w,i),a(_,i),a(S,i),a(O,i);var x={FeathersError:i,BadRequest:s,NotAuthenticated:u,PaymentError:c,Forbidden:f,NotFound:l,MethodNotAllowed:h,NotAcceptable:p,Timeout:d,Conflict:y,Gone:v,LengthRequired:m,Unprocessable:g,TooManyRequests:b,GeneralError:w,NotImplemented:_,BadGateway:S,Unavailable:O,400:s,401:u,402:c,403:f,404:l,405:h,406:p,408:d,409:y,410:v,411:m,422:g,429:b,500:w,501:_,502:S,503:O};t.exports=Object.assign({convert:function(t){if(!t)return t;var e=x[t.name],n=e?new e(t.message,t.data):new Error(t.message||t);return"object"===r(t)&&Object.assign(n,t),n}},x)},8801:(t,e,n)=>{var r;e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),this.useColors){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(r++,"%c"===t&&(o=r))})),e.splice(o,0,n)}},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){var t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(r=!1,function(){r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||function(){},t.exports=n(5331)(e),t.exports.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},5331:(t,e,n)=>{function r(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n{var r=n(2568),o=n(1614).v4,i=n(4670),a=n(6106).stripProps;function s(t){return t="string"==typeof t?t:JSON.stringify(t),r(t)}t.exports={genUuid:function(t){return t?i.generate():o()},hash:s,hashOfRecord:function(t){return s(a(t,["id","_id"]))}}},1707:(t,e,n)=>{var r=n(2273),o=n(2668),i=n(6106),a=n(8662);t.exports=Object.assign(Object.assign(Object.assign({to:r},o),i),{OptionsProxy:a})},6106:t=>{function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t){return"object"===e(t)&&!Array.isArray(t)&&null!==t}t.exports={isObject:n,stripProps:function t(e,r){r=Array.isArray(r)?r:r||[];var o={};return Object.keys(e).forEach((function(i){if(-1===r.indexOf(i)){var a=e[i];o[i]=n(a)?t(a,r):a}})),o}}},8662:t=>{function e(t,e){for(var n=0;n{t.exports=function(t){return t.then((function(t){return[null,t]})).catch((function(t){return[t,null]}))}},4613:(t,e,n)=>{var r=n(1707),o=r.to,i=r.isObject,a=r.stripProps,s=r.genUuid,u=r.hash,c=r.hashOfRecord,f=n(3683),l=f.Owndata,h=f.owndataWrapper,p=n(3153),d=p.Ownnet,y=p.ownnetWrapper;t.exports={to:o,isObject:i,stripProps:a,genUuid:s,hash:u,hashOfRecord:c,Owndata:l,owndataWrapper:h,Ownnet:d,ownnetWrapper:y}},6976:(t,e,n)=>{var r=n(2387);t.exports=r},2387:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){throw new TypeError('"'+t+'" is read-only')}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1&&l.splice(h,1),this._strip=A.apply(void 0,function(t){if(Array.isArray(t))return s(t)}(p=l)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(p)||a(p)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())):this._strip=function(t){return t},this._select=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&(this._timedSyncHandle=setInterval((function(){return i.sync()}),i.options.timedSync)),_(" Done."),r.abrupt("return",!0);case 37:case"end":return r.stop()}var p}),r,this)})))}},{key:"_listenOptions",value:function(){var t=this,e=new b.OptionsProxy(t.thisName);this.options=e.observe(Object.assign({},t.remoteService.options?t.remoteService.options:{},t.options)),e.watcher((function(){t.remoteService.options=Object.assign({},t.remoteService.options,t.options),t.localService.options=Object.assign({},t.options,t.localSpecOptions)}))}},{key:"getEntries",value:function(t){return p(this,void 0,void 0,regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _("Calling getEntries(".concat(JSON.stringify(t),"})")),n=[],e.next=4,this.localService.getEntries(t).then((function(t){n=t}));case 4:return e.abrupt("return",Promise.resolve(n).then(this._strip).then(this._select(t)));case 5:case"end":return e.stop()}}),e,this)})))}},{key:"get",value:function(t,e){return p(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return _("Calling get(".concat(JSON.stringify(t),", ").concat(JSON.stringify(e),"})")),n.abrupt("return",this._get(t,e));case 2:case"end":return n.stop()}}),n,this)})))}},{key:"_get",value:function(t,e){return p(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return _("Calling _get(".concat(JSON.stringify(t),", ").concat(JSON.stringify(e),"})")),n.next=3,this.localService.get(t,e).then(this._strip).then(this._select(e)).catch((function(t){throw t}));case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),n,this)})))}},{key:"find",value:function(t){return p(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _("Calling find(".concat(JSON.stringify(t),"})")),e.t0=_,e.t1=" rows=",e.t2=JSON,e.next=6,this.getEntries();case 6:return e.t3=e.sent,e.t4=e.t2.stringify.call(e.t2,e.t3),e.t5=e.t1.concat.call(e.t1,e.t4),(0,e.t0)(e.t5),e.abrupt("return",this._find(t));case 11:case"end":return e.stop()}}),e,this)})))}},{key:"_find",value:function(t){return p(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _("Calling _find(".concat(JSON.stringify(t),"})")),e.abrupt("return",this.localService.find(t).then(this._strip).then(this._select(t)));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"create",value:function(t,e){return p(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(_("Calling create(".concat(JSON.stringify(t),", ").concat(JSON.stringify(e),")")),!Array.isArray(t)||this.allowsMulti("create")){n.next=3;break}return n.abrupt("return",Promise.reject(new m.default.MethodNotAllowed("Creating multiple without option 'multi' set")));case 3:return n.abrupt("return",this._create(t,e));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"_create",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return p(this,void 0,void 0,regeneratorRuntime.mark((function r(){var o,a,s,u,c,f,l,h,d,y,v=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(_("Calling _create(".concat(JSON.stringify(t),", ").concat(JSON.stringify(e),", ").concat(n,")")),o=this,!Array.isArray(t)){r.next=8;break}if(this.allowsMulti("create")){r.next=6;break}return r.abrupt("return",Promise.reject(new m.default.MethodNotAllowed("Creating multiple without option 'multi' set")));case 6:return a=new Date,r.abrupt("return",Promise.all(t.map((function(t){return o._create(t,e,a)}))));case 8:return n=n||new Date,"uuid"in(s=E(t))||(s.uuid=b.genUuid(this.options.useShortUuid)),"updatedAt"in s||(s.updatedAt=n),s.onServerAt=O,r.next=15,b.to(this.localService.find({query:{uuid:s.uuid}}));case 15:if(u=r.sent,c=i(u,2),f=c[0],!(l=c[1])||!l.length){r.next=21;break}throw new m.default.BadRequest("Optimistic create requires unique uuid. (".concat(this.type,") res=").concat(JSON.stringify(l)));case 21:return E(e),this.disallowInternalProcessing("_create"),r.next=25,this._addQueuedEvent("create",s,E(s),e);case 25:return h=r.sent,r.next=28,b.to(this.localService.create(s,E(e)));case 28:if(d=r.sent,y=i(d,2),f=y[0],!(l=y[1])){r.next=36;break}this.remoteService.create(l,E(e)).then((function(t){return p(v,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.to(o._removeQueuedEvent("_create0",h,s,s.updatedAt));case 2:return e.next=4,o._patchIfNotRemoved(t[o.id],t);case 4:return o.allowInternalProcessing("_create0"),e.next=7,b.to(o._processQueuedEvents());case 7:case"end":return e.stop()}}),e)})))})).catch((function(t){return p(v,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("Timeout"===t.name){n.next=5;break}return n.next=3,b.to(o._removeQueuedEvent("_create1",h,t.message,s.updatedAt));case 3:return n.next=5,b.to(o.localService.remove(l[o.id],e));case 5:o.allowInternalProcessing("_create1");case 6:case"end":return n.stop()}}),n)})))})),r.next=40;break;case 36:return r.next=38,b.to(this._removeQueuedEvent("_create2",h,s,s.updatedAt));case 38:throw this.allowInternalProcessing("_create2"),f;case 40:return r.abrupt("return",Promise.resolve(l).then(this._strip).then(this._select(e)));case 41:case"end":return r.stop()}}),r,this)})))}},{key:"update",value:function(t,e,n){return p(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(_("Calling update(".concat(t,", ").concat(JSON.stringify(e),", ").concat(JSON.stringify(n),"})")),null!==t&&!Array.isArray(e)){r.next=3;break}return r.abrupt("return",Promise.reject(new m.default.BadRequest("You can not replace multiple instances. Did you mean 'patch'?")));case 3:return r.abrupt("return",this._update(t,e,n));case 4:case"end":return r.stop()}}),r,this)})))}},{key:"_update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p(this,void 0,void 0,regeneratorRuntime.mark((function r(){var o,a,s,u,c,f,l,h,d,y,v,g=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(_("Calling _update(".concat(t,", ").concat(JSON.stringify(e),", ").concat(JSON.stringify(n),"})")),o=this,null!==t&&!Array.isArray(e)){r.next=4;break}return r.abrupt("return",Promise.reject(new m.default.BadRequest("You can not replace multiple instances. Did you mean 'patch'?")));case 4:return r.next=6,b.to(this.localService._get(t));case 6:if(a=r.sent,s=i(a,2),u=s[0],(c=s[1])&&c!=={}){r.next=12;break}throw new m.default.NotFound("Trying to update non-existing ".concat(this.id,"=").concat(t,". (").concat(this.type,") err=").concat(JSON.stringify(u.name)));case 12:return f=E(c),l=f.uuid,(h=E(e)).uuid=l,h.updatedAt=new Date,h.onServerAt=O,this.disallowInternalProcessing("_update"),r.next=21,this._addQueuedEvent("update",h,t,E(h),n);case 21:return d=r.sent,r.next=24,b.to(this.localService.update(t,h,E(n)));case 24:if(y=r.sent,v=i(y,2),u=v[0],c=v[1],u){r.next=32;break}this.remoteService.update(t,c,E(n)).then((function(t){return p(g,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.to(o._removeQueuedEvent("_update0",d,h,c.updatedAt));case 2:return e.next=4,o._patchIfNotRemoved(t[o.id],t);case 4:return o.allowInternalProcessing("_update0"),e.next=7,b.to(o._processQueuedEvents());case 7:case"end":return e.stop()}}),e)})))})).catch((function(e){return p(g,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("Timeout"!==e.name){n.next=4;break}_("_update TIMEOUT: ".concat(e.name,", ").concat(e.message)),n.next=9;break;case 4:return _("_update ERROR: ".concat(e.name,", ").concat(e.message)),n.next=7,b.to(o._removeQueuedEvent("_update1",d,h,c.updatedAt));case 7:return n.next=9,b.to(o.localService.patch(t,f));case 9:o.allowInternalProcessing("_update1");case 10:case"end":return n.stop()}}),n)})))})),r.next=36;break;case 32:return r.next=34,b.to(this._removeQueuedEvent("_update2",d,h,h.updatedAt));case 34:throw this.allowInternalProcessing("_update2"),u;case 36:return r.abrupt("return",Promise.resolve(h).then(this._strip).then(this._select(n)));case 37:case"end":return r.stop()}}),r,this)})))}},{key:"patch",value:function(t,e,n){return p(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(_("Calling patch(".concat(t,", ").concat(JSON.stringify(e),", ").concat(JSON.stringify(n),"})")),null!==t||this.allowsMulti("patch")){r.next=3;break}return r.abrupt("return",Promise.reject(new m.default.MethodNotAllowed("Can not patch multiple entries")));case 3:return r.abrupt("return",this._patch(t,e,n));case 4:case"end":return r.stop()}}),r,this)})))}},{key:"_patch",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return p(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,c,f,l,h,d,y,v,g,w=this;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(_("Calling _patch(".concat(t,", ").concat(JSON.stringify(e),", ").concat(JSON.stringify(n),"})")),s=this,null!==t){a.next=7;break}if(this.allowsMulti("patch")){a.next=6;break}throw new m.default.MethodNotAllowed("Patching multiple without option 'multi' set");case 6:return a.abrupt("return",this.find(n).then((function(t){var r=t.data?t.data:t;Array.isArray(r)||(o("res"),r=[r]);var i=(new Date).toISOString();return Promise.all(r.map((function(t){return s._patch(t[w.id],e,n,i)})))})));case 7:return r=r||new Date,a.next=10,b.to(this.localService._get(t));case 10:if(u=a.sent,c=i(u,2),f=c[0],(l=c[1])&&l!=={}){a.next=16;break}throw f;case 16:return h=E(l),(d=Object.assign({},h,e)).onServerAt=O,d.updatedAt=r,this.disallowInternalProcessing("_patch"),a.next=23,this._addQueuedEvent("patch",d,t,E(d),n);case 23:return y=a.sent,a.next=26,b.to(this.localService.patch(t,d,E(n)));case 26:if(v=a.sent,g=i(v,2),f=g[0],!(l=g[1])){a.next=34;break}this.remoteService.patch(t,l,E(n)).then((function(t){return p(w,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.to(s._removeQueuedEvent("_patch0",y,t,l.updatedAt));case 2:return e.next=4,s._patchIfNotRemoved(t[s.id],t);case 4:return s.allowInternalProcessing("_patch0"),e.next=7,b.to(s._processQueuedEvents());case 7:case"end":return e.stop()}}),e)})))})).catch((function(e){return p(w,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("Timeout"!==e.name){n.next=4;break}_("_patch TIMEOUT: ".concat(e.name,", ").concat(e.message)),n.next=9;break;case 4:return _("_patch ERROR: ".concat(e.name,", ").concat(e.message)),n.next=7,b.to(s._removeQueuedEvent("_patch1",y,d,l.updatedAt));case 7:return n.next=9,b.to(s.localService.patch(t,h));case 9:s.allowInternalProcessing("_patch1");case 10:case"end":return n.stop()}}),n)})))})),a.next=38;break;case 34:return a.next=36,b.to(this._removeQueuedEvent("_patch2",y,d,d.updatedAt));case 36:throw this.allowInternalProcessing("_patch2"),f;case 38:return a.abrupt("return",Promise.resolve(d).then(this._strip).then(this._select(n)));case 39:case"end":return a.stop()}}),a,this)})))}},{key:"_patchIfNotRemoved",value:function(t,e){return p(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.localService.patch(t,e).catch((function(t){return Promise.resolve(!0)})));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"remove",value:function(t,e){return p(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(_("Calling remove(".concat(t,", ").concat(JSON.stringify(e),"})")),null!==t||this.allowsMulti("remove")){n.next=3;break}return n.abrupt("return",Promise.reject(new m.default.MethodNotAllowed("Can not remove multiple entries")));case 3:return n.abrupt("return",this._remove(t,e));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"_remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return p(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,a,s,u,c,f,l,h,d,y=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(_("Calling _remove(".concat(t,", ").concat(JSON.stringify(e),"})")),r=this,null!==t){n.next=7;break}if(this.allowsMulti("remove")){n.next=6;break}throw new m.default.MethodNotAllowed("Removing multiple without option 'multi' set");case 6:return n.abrupt("return",this.find(e).then((function(t){var n=t.data?t.data:t;return Array.isArray(n)||(o("res"),n=[n]),Promise.all(n.map((function(t){return r._remove(t[y.id],e)})))})));case 7:return n.next=9,b.to(this.localService._get(t));case 9:if(a=n.sent,s=i(a,2),u=s[0],(c=s[1])&&c!=={}){n.next=15;break}throw new m.default.BadRequest("Trying to remove non-existing ".concat(this.id,"=").concat(t,". (").concat(this.type,") err=").concat(JSON.stringify(u),", res=").concat(JSON.stringify(c)));case 15:return f=E(c),this.disallowInternalProcessing("_remove"),n.next=19,this._addQueuedEvent("remove",f,t,e);case 19:return l=n.sent,n.next=22,b.to(this.localService.remove(t,E(e)));case 22:if(h=n.sent,d=i(h,2),u=d[0],c=d[1],u){n.next=30;break}this.remoteService.remove(t,E(e)).then((function(t){return p(y,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.to(r._removeQueuedEvent("_remove0",l,f,null));case 2:return r.allowInternalProcessing("_remove0"),t.next=5,b.to(r._processQueuedEvents());case 5:case"end":return t.stop()}}),t)})))})).catch((function(t){return p(y,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Timeout"!==t.name){e.next=4;break}_("_remove TIMEOUT: ".concat(t.name,", ").concat(t.message)),e.next=9;break;case 4:return _("_remove ERROR: ".concat(t.name,", ").concat(t.message,"\nbeforeRecord = ").concat(JSON.stringify(f))),e.next=7,b.to(r._removeQueuedEvent("_remove1",l,f,null));case 7:return e.next=9,b.to(r.localService.create(f,null));case 9:r.allowInternalProcessing("_remove1");case 10:case"end":return e.stop()}}),e)})))})),n.next=34;break;case 30:return n.next=32,b.to(this._removeQueuedEvent("_remove2",l,f,null));case 32:throw this.allowInternalProcessing("_remove2"),u;case 34:return n.abrupt("return",Promise.resolve(f).then(this._strip).then(this._select(e)));case 35:case"end":return n.stop()}}),n,this)})))}},{key:"allowInternalProcessing",value:function(t){_("allowInternalProcessing: ".concat(t," ").concat(this.thisName," ").concat(this.aIP-1)),this.aIP--}},{key:"disallowInternalProcessing",value:function(t){_("disallowInternalProcessing: ".concat(t," ").concat(this.thisName," ").concat(this.aIP+1)),this.aIP++}},{key:"internalProcessingAllowed",value:function(){return 0===this.aIP}},{key:"_addQueuedEvent",value:function(t,e,n,r,o){return p(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,c;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return _("addQueuedEvent entered"),a.next=3,b.to(this.localQueue.create({eventName:t,record:e,arg1:n,arg2:r,arg3:o}));case 3:return s=a.sent,(u=i(s,2))[0],c=u[1],_("addQueuedEvent added: ".concat(JSON.stringify(c))),a.abrupt("return",Promise.resolve(c.id));case 9:case"end":return a.stop()}}),a,this)})))}},{key:"_removeQueuedEvent",value:function(t,e,n,r){return p(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _("removeQueuedEvent entered"),t.next=3,b.to(this.localQueue.remove(e));case 3:return n=t.sent,(r=i(n,2))[0],o=r[1],t.abrupt("return",Promise.resolve(o));case 8:case"end":return t.stop()}}),t,this)})))}},{key:"_processQueuedEvents",value:function(){return p(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new m.default.NotImplemented("_processQueuedEvents must be implemented!!!");case 1:case"end":return t.stop()}}),t)})))}},{key:"sync",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p(this,void 0,void 0,regeneratorRuntime.mark((function e(){var n,r,o,a,s,u,c,f,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.internalProcessingAllowed()){e.next=5;break}return e.next=3,new Promise((function(t){setTimeout((function(){t(!0)}),200)}));case 3:e.next=0;break;case 5:return e.next=7,this._getSyncOptions(t);case 7:return n=e.sent,_("".concat(this.type,".sync(").concat(JSON.stringify(n),") started...")),r=this,o=!0,e.next=13,b.to(w.default(this.remoteService,n));case 13:if(a=e.sent,s=i(a,2),u=s[0],c=s[1],!u){e.next=21;break}return"timeout"===u.className?_(" TIMEOUT: ".concat(JSON.stringify(u))):_(" ERROR: ".concat(JSON.stringify(u))),this.localService.emit("synced",!1),e.abrupt("return",!1);case 21:return _(" Applying received snapshot data... (".concat(c.length," items)")),f=new Date(0).toISOString(),e.next=25,Promise.all(c.map((function(t){return p(l,void 0,void 0,regeneratorRuntime.mark((function e(){var n,a,s,u,c,l,h,p,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.to(r.localService.get(t[r.id]));case 2:if(n=e.sent,a=i(n,2),s=a[0],!a[1]){e.next=26;break}if(f=ft.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:{};if(m("owndataWrapper started on path '".concat(e,"'")),!(t&&t.version&&t.service&&t.services))throw new d.default.Unavailable("The FeathersJS app must be supplied as first argument");var r=p.stripSlashes(e),o=t.service(r);if(void 0===o)throw new d.default.Unavailable("No prior service registered on path '".concat(r,"'"));var i=Object.assign({},o.options,n);t.use(r,_(i));var a=t.service(r);return a.options=i,a._listenOptions(),a}},w.Service=b},3153:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:{};if(g("ownnetWrapper started on path '".concat(e,"'")),!(t&&t.version&&t.service&&t.services))throw new y.default.Unavailable("The FeathersJS app must be supplied as first argument");var r=d.stripSlashes(e),o=t.service(r);if(void 0===o)throw new y.default.Unavailable("No prior service registered on path '".concat(r,"'"));var i=Object.assign({},o.options,n);t.use(r,_(i));var a=t.service(r);return a.options=i,a._listenOptions(),a}},w.Service=b},2564:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(8801)).default("@feathersjs-offline:snapshot");t.exports=function(t,e){o("snapshot start: ".concat(JSON.stringify(e)));var n,r=Object.assign({},{$skip:0,$limit:200},e);return t.find({query:r}).then((function(t){if(o("snapshot query = ".concat(JSON.stringify(r),", read ").concat((t.data||t).length," records\n\n snapshot read ").concat(JSON.stringify(t.data||t))),!t.data)return t;var e=t.total,a=t.limit,s=t.skip,u=t.data;return n=u,s+u.length{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],n=0;n{var e,n;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,r=0;n>>5]|=t[n]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r>>6-2*o);return n}},t.exports=n},7187:t=>{"use strict";var e,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function i(){i.init.call(this)}t.exports=i,t.exports.once=function(t,e){return new Promise((function(n,r){function o(){void 0!==i&&t.removeListener("error",i),n([].slice.call(arguments))}var i;"error"!==e&&(i=function(n){t.removeListener(e,o),r(n)},t.once("error",i)),t.once(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function c(t,e,n,r){var o,i,a,c;if(s(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),a=i[e]),void 0===a)a=i[e]=n,++t._eventsCount;else if("function"==typeof a?a=i[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=u(t))>0&&a.length>o&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=a.length,c=f,console&&console.warn&&console.warn(c)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function h(t,e,n){var r=t._events;if(void 0===r)return[];var o=r[e];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)r(u,this,e);else{var c=u.length,f=d(u,c);for(n=0;n=0;i--)if(n[i]===e||n[i].listener===e){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},i.prototype.listeners=function(t){return h(this,t,!0)},i.prototype.rawListeners=function(t){return h(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},7203:(t,e,n)=>{const{Service:r}=n(8691),o=[];class i extends r{constructor(t={}){if(super(t),this._storageKey=t.name||"feathers",this._storage=t.storage||"undefined"!=typeof window&&window.localStorage,this._throttle=t.throttle||200,this._reuseKeys=t.reuseKeys||!1,this.store=null,!this._storage)throw new Error("The `storage` option needs to be provided");if(-1===o.indexOf(this._storageKey))o.push(this._storageKey);else if(!this._reuseKeys)throw new Error(`The storage name '${this._storageKey}' is already in use by another instance.`);this.ready()}ready(){return this.store?Promise.resolve(this.store):Promise.resolve(this._storage.getItem(this._storageKey)).then((t=>JSON.parse(t||"{}"))).then((t=>{const e=Object.keys(t),n=t[e[e.length-1]];return this._uId=e.length&&void 0!==n[this.id]?n[this.id]+1:this._uId,this.store=t}))}flush(t){return this._timeout||(this._timeout=setTimeout((()=>{this._storage.setItem(this._storageKey,JSON.stringify(this.store)),delete this._timeout}),this._throttle)),t}execute(t,...e){return this.ready().then((()=>super[t](...e)))}find(...t){return this.execute("find",...t)}get(...t){return this.execute("get",...t)}create(...t){return this.execute("create",...t).then((t=>this.flush(t)))}patch(...t){return this.execute("patch",...t).then((t=>this.flush(t)))}update(...t){return this.execute("update",...t).then((t=>this.flush(t)))}remove(...t){return this.execute("remove",...t).then((t=>this.flush(t)))}}t.exports=function(t){return new i(t)},t.exports.Service=r},8691:(t,e,n)=>{const r=n(2743),{_:o}=n(2410),{sorter:i,select:a,AdapterService:s}=n(3597),u=n(41).ZP,c=(t,...e)=>a(...e)(JSON.parse(JSON.stringify(t)));class f extends s{constructor(t={}){super(o.extend({id:"id",matcher:u,sorter:i},t)),this._uId=t.startId||0,this.store=t.store||{}}async getEntries(t={}){const{query:e}=this.filterQuery(t);return this._find(Object.assign({},t,{paginate:!1,query:e}))}async _find(t={}){const{query:e,filters:n,paginate:r}=this.filterQuery(t);let i=o.values(this.store).filter(this.options.matcher(e));const a=i.length;void 0!==n.$sort&&i.sort(this.options.sorter(n.$sort)),void 0!==n.$skip&&(i=i.slice(n.$skip)),void 0!==n.$limit&&(i=i.slice(0,n.$limit));const s={total:a,limit:n.$limit,skip:n.$skip||0,data:i.map((e=>c(e,t)))};return r&&r.default?s:s.data}async _get(t,e={}){if(t in this.store){const{query:n}=this.filterQuery(e),r=this.store[t];if(this.options.matcher(n)(r))return c(r,e,this.id)}throw new r.NotFound(`No record found for id '${t}'`)}async _create(t,e={}){if(Array.isArray(t))return Promise.all(t.map((t=>this._create(t,e))));const n=t[this.id]||this._uId++,r=o.extend({},t,{[this.id]:n}),i=this.store[n]=r;return c(i,e,this.id)}async _update(t,e,n={}){const r=(await this._get(t))[this.id];return t=r==t?r:t,this.store[t]=o.extend({},e,{[this.id]:t}),this._get(t,n)}async _patch(t,e,n={}){const r=t=>{const r=t[this.id];return this.store[r]=o.extend(this.store[r],o.omit(e,this.id)),c(this.store[r],n,this.id)};return null===t?(await this.getEntries(n)).map(r):r(await this._get(t,n))}async _remove(t,e={}){if(null===t){const t=await this.getEntries(e);return Promise.all(t.map((t=>this._remove(t[this.id],e))))}const n=await this._get(t,e);return delete this.store[t],n}}t.exports=t=>new f(t),t.exports.Service=f},41:(t,e,n)=>{"use strict";function r(t){var e="[object "+t+"]";return function(t){return Object.prototype.toString.call(t)===e}}n.d(e,{ZP:()=>S});var o=r("Array"),i=r("Object"),a=r("Function");function s(t,e){return a(t.get)?t.get(e):t[e]}const u=(c=t=>function(e,n,r,i,a){if(!o(n)||!n.length)return t(e,n);for(var u=0,c=n.length;uo?Boolean(o.find((([e,n,r])=>c(t)))):c(t));var c;function f(t){return function(e,n,r,i){if(!o(n)||!n.length)return t(e,n,r,i);for(var a=0,u=n.length;at(e),$nin:function(t,e){return t(e)},$not:function(t,e,n,r){return t(e,n,r)},$type:function(t,e){return t(e)},$all:function(t,e,n,r,o){return h.$and(t,e,n,r,o)},$size:function(t,e){return!!e&&t===e.length},$or:function(t,e,n,r){for(var o=0,i=t.length;o0}},$gte:function(t,e,{comparable:n,compare:r}){return function(e){return r(n(e),n(t))>=0}},$lt:function(t,e,{comparable:n,compare:r}){return function(e){return r(n(e),n(t))<0}},$lte:function(t,e,{comparable:n,compare:r}){return function(e){return r(n(e),n(t))<=0}},$in:function(t,e,n){const{comparable:r}=n;return function(e){if(!(e instanceof Array)){var o=r(e);if(o===e&&"object"==typeof e)for(a=t.length;a--;)if(String(t[a])===String(e)&&"[object Object]"!==String(e))return!0;if(void 0===o)for(a=t.length;a--;)if(null==t[a])return!0;for(a=t.length;a--;){var i=l(_(s(t,a),n),o,a,t);if(i&&"[object Object]"!==String(i)&&"[object Object]"!==String(o))return!0}return!!~t.indexOf(o)}for(var a=e.length;a--;)if(~t.indexOf(r(s(e,a))))return!0;return!1}},$nin:function(t,e,n){const r=p.$in(t,e,n);return function(t,e,n,o){return!r(t,e,n,o)}},$mod:function(t){return function(e){return e%t[0]==t[1]}},$ne:function(t,e,n){const r=p.$eq(t,e,n);return f((function(t,e,n,o){return!r(t,e,n,o)}))},$and:function(t,e,n){return t.map(g(n))},$all:function(t,e,n){return p.$and(t,e,n)},$or:function(t,e,n){return t.map(g(n))},$nor:function(t,e,n){return t.map(g(n))},$not:function(t,e,n){const r=g(n)(t);return function(t,e,n){return!l(r,t,e,n)}},$type:function(t){return function(e,n,r){return null!=e&&(e instanceof t||e.constructor==t)}},$regex:function(t,e){return new RegExp(t,e.$options)},$where:function(t){return"string"==typeof t?new Function("obj","return "+t):t},$elemMatch:function(t,e,n){return g(n)(t)},$exists:function(t){return!!t}};function d(t,e){return{options:t,validate:e}}function y({keyPath:t,child:e,query:n},r){const o=[];if(v(r,t,0,r,o),1===o.length){const[t,n,r]=o[0];return l(e,t,n,r)}return n&&n.$ne,o.map((([t])=>t)),l(e,void 0,void 0,void 0,o)}function v(t,e,n,r,i){if(n!==e.length&&null!=t){var a=s(e,n);if(o(t)&&isNaN(Number(a)))for(var u=0,c=t.length;ue)return 1;if(t{"use strict";t.exports=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var e={__proto__:t.__proto__};else e=Object.create(null);return Object.getOwnPropertyNames(t).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}},77:(t,e,n)=>{var r,o,i=n(2993),a=n(2161),s=n(8520),u=n(6458),c=n(1758);function f(t,e){Object.defineProperty(t,r,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(r=Symbol.for("graceful-fs.queue"),o=Symbol.for("graceful-fs.previous")):(r="___graceful-fs.queue",o="___graceful-fs.previous");var l=function(){};if(c.debuglog?l=c.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(l=function(){var t=c.format.apply(c,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: "),console.error(t)}),!i[r]){var h=n.g[r]||[];f(i,h),i.close=function(t){function e(e,n){return t.call(i,e,(function(t){t||y(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(e,o,{value:t}),e}(i.close),i.closeSync=function(t){function e(e){t.apply(i,arguments),y()}return Object.defineProperty(e,o,{value:t}),e}(i.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){l(i[r]),n(7680).equal(i[r].length,0)}))}function p(t){a(t),t.gracefulify=p,t.createReadStream=function(e,n){return new t.ReadStream(e,n)},t.createWriteStream=function(e,n){return new t.WriteStream(e,n)};var e=t.readFile;t.readFile=function(t,n,r){return"function"==typeof n&&(r=n,n=null),function t(n,r,o){return e(n,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?("function"==typeof o&&o.apply(this,arguments),y()):d([t,[n,r,o]])}))}(t,n,r)};var n=t.writeFile;t.writeFile=function(t,e,r,o){return"function"==typeof r&&(o=r,r=null),function t(e,r,o,i){return n(e,r,o,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?("function"==typeof i&&i.apply(this,arguments),y()):d([t,[e,r,o,i]])}))}(t,e,r,o)};var r=t.appendFile;r&&(t.appendFile=function(t,e,n,o){return"function"==typeof n&&(o=n,n=null),function t(e,n,o,i){return r(e,n,o,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?("function"==typeof i&&i.apply(this,arguments),y()):d([t,[e,n,o,i]])}))}(t,e,n,o)});var o=t.readdir;function i(e){return o.apply(t,e)}if(t.readdir=function(t,e,n){var r=[t];return"function"!=typeof e?r.push(e):n=e,r.push((function(t,e){e&&e.sort&&e.sort(),!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?("function"==typeof n&&n.apply(this,arguments),y()):d([i,[r]])})),i(r)},"v0.8"===process.version.substr(0,4)){var u=s(t);v=u.ReadStream,m=u.WriteStream}var c=t.ReadStream;c&&(v.prototype=Object.create(c.prototype),v.prototype.open=function(){var t=this;b(t.path,t.flags,t.mode,(function(e,n){e?(t.autoClose&&t.destroy(),t.emit("error",e)):(t.fd=n,t.emit("open",n),t.read())}))});var f=t.WriteStream;f&&(m.prototype=Object.create(f.prototype),m.prototype.open=function(){var t=this;b(t.path,t.flags,t.mode,(function(e,n){e?(t.destroy(),t.emit("error",e)):(t.fd=n,t.emit("open",n))}))}),Object.defineProperty(t,"ReadStream",{get:function(){return v},set:function(t){v=t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return m},set:function(t){m=t},enumerable:!0,configurable:!0});var l=v;Object.defineProperty(t,"FileReadStream",{get:function(){return l},set:function(t){l=t},enumerable:!0,configurable:!0});var h=m;function v(t,e){return this instanceof v?(c.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function m(t,e){return this instanceof m?(f.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}Object.defineProperty(t,"FileWriteStream",{get:function(){return h},set:function(t){h=t},enumerable:!0,configurable:!0});var g=t.open;function b(t,e,n,r){return"function"==typeof n&&(r=n,n=null),function t(e,n,r,o){return g(e,n,r,(function(i,a){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?("function"==typeof o&&o.apply(this,arguments),y()):d([t,[e,n,r,o]])}))}(t,e,n,r)}return t.open=b,t}function d(t){l("ENQUEUE",t[0].name,t[1]),i[r].push(t)}function y(){var t=i[r].shift();t&&(l("RETRY",t[0].name,t[1]),t[0].apply(null,t[1]))}n.g[r]||f(n.g,i[r]),t.exports=p(u(i)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!i.__patched&&(t.exports=p(i),i.__patched=!0)},8520:(t,e,n)=>{var r=n(791).Stream;t.exports=function(t){return{ReadStream:function e(n,o){if(!(this instanceof e))return new e(n,o);r.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,o=o||{};for(var a=Object.keys(o),s=0,u=a.length;sthis.end)throw new Error("start must be <= end");this.pos=this.start}null===this.fd?t.open(this.path,this.flags,this.mode,(function(t,e){if(t)return i.emit("error",t),void(i.readable=!1);i.fd=e,i.emit("open",e),i._read()})):process.nextTick((function(){i._read()}))},WriteStream:function e(n,o){if(!(this instanceof e))return new e(n,o);r.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var i=Object.keys(o),a=0,s=i.length;a= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}},2161:(t,e,n)=>{var r=n(8510),o=process.cwd,i=null,a=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||(i=o.call(process)),i};try{process.cwd()}catch(t){}var s=process.chdir;process.chdir=function(t){i=null,s.call(process,t)},t.exports=function(t){var e,n;function o(e){return e?function(n,r,o){return e.call(t,n,r,(function(t){l(t)&&(t=null),o&&o.apply(this,arguments)}))}:e}function i(e){return e?function(n,r){try{return e.call(t,n,r)}catch(t){if(!l(t))throw t}}:e}function s(e){return e?function(n,r,o,i){return e.call(t,n,r,o,(function(t){l(t)&&(t=null),i&&i.apply(this,arguments)}))}:e}function u(e){return e?function(n,r,o){try{return e.call(t,n,r,o)}catch(t){if(!l(t))throw t}}:e}function c(e){return e?function(n,r,o){function i(t,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),o&&o.apply(this,arguments)}return"function"==typeof r&&(o=r,r=null),r?e.call(t,n,r,i):e.call(t,n,i)}:e}function f(e){return e?function(n,r){var o=r?e.call(t,n,r):e.call(t,n);return o.uid<0&&(o.uid+=4294967296),o.gid<0&&(o.gid+=4294967296),o}:e}function l(t){return!t||"ENOSYS"===t.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==t.code&&"EPERM"!==t.code)}r.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(e,n,o){t.open(e,r.O_WRONLY|r.O_SYMLINK,n,(function(e,r){e?o&&o(e):t.fchmod(r,n,(function(e){t.close(r,(function(t){o&&o(e||t)}))}))}))},t.lchmodSync=function(e,n){var o,i=t.openSync(e,r.O_WRONLY|r.O_SYMLINK,n),a=!0;try{o=t.fchmodSync(i,n),a=!1}finally{if(a)try{t.closeSync(i)}catch(t){}else t.closeSync(i)}return o}}(t),t.lutimes||function(t){r.hasOwnProperty("O_SYMLINK")?(t.lutimes=function(e,n,o,i){t.open(e,r.O_SYMLINK,(function(e,r){e?i&&i(e):t.futimes(r,n,o,(function(e){t.close(r,(function(t){i&&i(e||t)}))}))}))},t.lutimesSync=function(e,n,o){var i,a=t.openSync(e,r.O_SYMLINK),s=!0;try{i=t.futimesSync(a,n,o),s=!1}finally{if(s)try{t.closeSync(a)}catch(t){}else t.closeSync(a)}return i}):(t.lutimes=function(t,e,n,r){r&&process.nextTick(r)},t.lutimesSync=function(){})}(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=o(t.chmod),t.fchmod=o(t.fchmod),t.lchmod=o(t.lchmod),t.chownSync=u(t.chownSync),t.fchownSync=u(t.fchownSync),t.lchownSync=u(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=c(t.stat),t.fstat=c(t.fstat),t.lstat=c(t.lstat),t.statSync=f(t.statSync),t.fstatSync=f(t.fstatSync),t.lstatSync=f(t.lstatSync),t.lchmod||(t.lchmod=function(t,e,n){n&&process.nextTick(n)},t.lchmodSync=function(){}),t.lchown||(t.lchown=function(t,e,n,r){r&&process.nextTick(r)},t.lchownSync=function(){}),"win32"===a&&(t.rename=(e=t.rename,function(n,r,o){var i=Date.now(),a=0;e(n,r,(function s(u){if(u&&("EACCES"===u.code||"EPERM"===u.code)&&Date.now()-i<6e4)return setTimeout((function(){t.stat(r,(function(t,i){t&&"ENOENT"===t.code?e(n,r,s):o(u)}))}),a),void(a<100&&(a+=10));o&&o(u)}))})),t.read=function(e){function n(n,r,o,i,a,s){var u;if(s&&"function"==typeof s){var c=0;u=function(f,l,h){if(f&&"EAGAIN"===f.code&&c<10)return c++,e.call(t,n,r,o,i,a,u);s.apply(this,arguments)}}return e.call(t,n,r,o,i,a,u)}return n.__proto__=e,n}(t.read),t.readSync=(n=t.readSync,function(e,r,o,i,a){for(var s=0;;)try{return n.call(t,e,r,o,i,a)}catch(t){if("EAGAIN"===t.code&&s<10){s++;continue}throw t}})}},4269:t=>{!function(){var e;function n(t,r){var o=this instanceof n?this:e;if(o.reset(r),"string"==typeof t&&t.length>0&&o.hash(t),o!==this)return o}n.prototype.hash=function(t){var e,n,r,o,i;switch(i=t.length,this.len+=i,n=this.k1,r=0,this.rem){case 0:n^=i>r?65535&t.charCodeAt(r++):0;case 1:n^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:n^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:n^=i>r?(255&t.charCodeAt(r))<<24:0,n^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=i+this.rem&3,(i-=this.rem)>0){for(e=this.h1;e=5*(e=(e^=n=13715*(n=(n=11601*n+3432906752*(65535&n)&4294967295)<<15|n>>>17)+461832192*(65535&n)&4294967295)<<13|e>>>19)+3864292196&4294967295,!(r>=i);)n=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,n^=(255&(o=t.charCodeAt(r++)))<<24^(65280&o)>>8;switch(n=0,this.rem){case 3:n^=(65535&t.charCodeAt(r+2))<<16;case 2:n^=(65535&t.charCodeAt(r+1))<<8;case 1:n^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=n,this},n.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(e^=t=13715*(t=(t=11601*t+3432906752*(65535&t)&4294967295)<<15|t>>>17)+461832192*(65535&t)&4294967295),e^=this.len,e=51819*(e^=e>>>16)+2246770688*(65535&e)&4294967295,e=44597*(e^=e>>>13)+3266445312*(65535&e)&4294967295,(e^=e>>>16)>>>0},n.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new n,t.exports=n}()},8738:t=>{function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},2568:(t,e,n)=>{var r,o,i,a,s;r=n(1012),o=n(487).utf8,i=n(8738),a=n(487).bin,(s=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?a.stringToBytes(t):o.stringToBytes(t):i(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var n=r.bytesToWords(t),u=8*t.length,c=1732584193,f=-271733879,l=-1732584194,h=271733878,p=0;p>>24)|4278255360&(n[p]<<24|n[p]>>>8);n[u>>>5]|=128<>>9<<4)]=u;var d=s._ff,y=s._gg,v=s._hh,m=s._ii;for(p=0;p>>0,f=f+b>>>0,l=l+w>>>0,h=h+_>>>0}return r.endian([c,f,l,h])})._ff=function(t,e,n,r,o,i,a){var s=t+(e&n|~e&r)+(o>>>0)+a;return(s<>>32-i)+e},s._gg=function(t,e,n,r,o,i,a){var s=t+(e&r|n&~r)+(o>>>0)+a;return(s<>>32-i)+e},s._hh=function(t,e,n,r,o,i,a){var s=t+(e^n^r)+(o>>>0)+a;return(s<>>32-i)+e},s._ii=function(t,e,n,r,o,i,a){var s=t+(n^(e|~r))+(o>>>0)+a;return(s<>>32-i)+e},s._blocksize=16,s._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var n=r.wordsToBytes(s(t,e));return e&&e.asBytes?n:e&&e.asString?a.bytesToString(n):r.bytesToHex(n)}},7824:t=>{var e=1e3,n=60*e,r=60*n,o=24*r;function i(t,e,n,r){var o=e>=1.5*n;return Math.round(t/n)+" "+r+(o?"s":"")}t.exports=function(t,a){a=a||{};var s,u,c=typeof t;if("string"===c&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(i){var a=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(t);if("number"===c&&isFinite(t))return a.long?(s=t,(u=Math.abs(s))>=o?i(s,u,o,"day"):u>=r?i(s,u,r,"hour"):u>=n?i(s,u,n,"minute"):u>=e?i(s,u,e,"second"):s+" ms"):function(t){var i=Math.abs(t);return i>=o?Math.round(t/o)+"d":i>=r?Math.round(t/r)+"h":i>=n?Math.round(t/n)+"m":i>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},9968:function(t,e,n){(function(){var t,r,o,i,a,s,u,c,f,l,h,p,d,y,v=function(t,e){for(var n in e)m.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},m={}.hasOwnProperty;d=n(1386),p=n(2993),h=n(7187),y=n(902).sync,r="---.EMPTY_STRING.---",u=function(t){var e,n,r,o,i;for(i=[],e=0,n=(o=p.readdirSync(t)).length;ethis.quota)throw new a;if(y(u,m,"utf8"),o||((l=new i(n,this._keys.push(t)-1)).size=g,this._metaKeyMap[t]=l,this.length+=1,this._bytesInUse+=g),f)return r=new s(t,v,e,this._eventUrl),this.emit("storage",r)},n.prototype.getItem=function(t){var e,n;return t=c(t),(n=this._metaKeyMap[t])?(e=d.join(this._location,n.key),p.readFileSync(e,"utf8")):null},n.prototype._getStat=function(t){var e;t=c(t),e=d.join(this._location,encodeURIComponent(t));try{return p.statSync(e)}catch(t){return null}},n.prototype.removeItem=function(t){var e,n,r,o,i,a,u,l;if(t=c(t),a=this._metaKeyMap[t]){for(o in u=null,(r=h.EventEmitter.listenerCount(this,"storage"))&&(u=this.getItem(t)),delete this._metaKeyMap[t],this.length-=1,this._bytesInUse-=a.size,n=d.join(this._location,a.key),this._keys.splice(a.index,1),l=this._metaKeyMap)l[o],(i=this._metaKeyMap[o]).index>a.index&&(i.index-=1);if(f(n),r)return e=new s(t,u,null,this._eventUrl),this.emit("storage",e)}},n.prototype.key=function(t){var e;return(e=this._keys[t])===r?"":e},n.prototype.clear=function(){var t;if(u(this._location),this._metaKeyMap=l(),this._keys=[],this.length=0,this._bytesInUse=0,h.EventEmitter.listenerCount(this,"storage"))return t=new s(null,null,null,this._eventUrl),this.emit("storage",t)},n.prototype._getBytesInUse=function(){return this._bytesInUse},n.prototype._deleteLocation=function(){return delete e[this._location],f(this._location),this._metaKeyMap={},this._keys=[],this.length=0,this._bytesInUse=0},n}(h.EventEmitter)),e.LocalStorage=o,e.JSONStorage=t,e.QUOTA_EXCEEDED_ERR=a}).call(this)},4670:(t,e,n)=>{"use strict";t.exports=n(5607)},9829:(t,e,n)=>{"use strict";var r,o,i,a=n(8946),s="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";function u(){i=!1}function c(t){if(t){if(t!==r){if(t.length!==s.length)throw new Error("Custom alphabet for shortid must be "+s.length+" unique characters. You submitted "+t.length+" characters: "+t);var e=t.split("").filter((function(t,e,n){return e!==n.lastIndexOf(t)}));if(e.length)throw new Error("Custom alphabet for shortid must be "+s.length+" unique characters. These characters were not unique: "+e.join(", "));r=t,u()}}else r!==s&&(r=s,u())}function f(){return i||(i=function(){r||c(s);for(var t,e=r.split(""),n=[],o=a.nextValue();e.length>0;)o=a.nextValue(),t=Math.floor(o*e.length),n.push(e.splice(t,1)[0]);return n.join("")}())}t.exports={get:function(){return r||s},characters:function(t){return c(t),r},seed:function(t){a.seed(t),o!==t&&(u(),o=t)},lookup:function(t){return f()[t]},shuffled:f}},480:(t,e,n)=>{"use strict";var r,o,i=n(8416);n(9829),t.exports=function(t){var e="",n=Math.floor(.001*(Date.now()-1567752802062));return n===o?r++:(r=0,o=n),e+=i(7),e+=i(t),r>0&&(e+=i(r)),e+i(n)}},8416:(t,e,n)=>{"use strict";var r=n(9829),o=n(3766),i=n(296);t.exports=function(t){for(var e,n=0,a="";!e;)a+=i(o,r.get(),1),e=t{"use strict";var r=n(9829),o=n(480),i=n(1082),a=n(5636)||0;function s(){return o(a)}t.exports=s,t.exports.generate=s,t.exports.seed=function(e){return r.seed(e),t.exports},t.exports.worker=function(e){return a=e,t.exports},t.exports.characters=function(t){return void 0!==t&&r.characters(t),r.shuffled()},t.exports.isValid=i},1082:(t,e,n)=>{"use strict";var r=n(9829);t.exports=function(t){return!(!t||"string"!=typeof t||t.length<6||new RegExp("[^"+r.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]").test(t))}},3766:t=>{"use strict";var e,n="object"==typeof window&&(window.crypto||window.msCrypto);e=n&&n.getRandomValues?function(t){return n.getRandomValues(new Uint8Array(t))}:function(t){for(var e=[],n=0;n{"use strict";var e=1;t.exports={nextValue:function(){return(e=(9301*e+49297)%233280)/233280},seed:function(t){e=t}}},5636:t=>{"use strict";t.exports=0},296:t=>{t.exports=function(t,e,n){for(var r=(2<{"use strict";n.r(e),n.d(e,{default:()=>ft,$Size:()=>$,$all:()=>ot,$and:()=>rt,$elemMatch:()=>K,$eq:()=>Q,$exists:()=>X,$gt:()=>Y,$gte:()=>G,$in:()=>W,$lt:()=>H,$lte:()=>V,$mod:()=>Z,$ne:()=>q,$nin:()=>z,$nor:()=>B,$not:()=>et,$options:()=>at,$or:()=>D,$regex:()=>tt,$size:()=>it,$type:()=>nt,$where:()=>st,EqualsOperation:()=>w,createDefaultQueryOperation:()=>ct,createEqualsOperation:()=>_,createOperationTester:()=>C,createQueryOperation:()=>j,createQueryTester:()=>N});var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(t){var e="[object "+t+"]";return function(t){return a(t)===e}},a=function(t){return Object.prototype.toString.call(t)},s=function(t){return t instanceof Date?t.getTime():u(t)?t.map(s):t&&"function"==typeof t.toJSON?t.toJSON():t},u=i("Array"),c=i("Object"),f=i("Function"),l=function(t,e){if(null==t&&t==e)return!0;if(t===e)return!0;if(Object.prototype.toString.call(t)!==Object.prototype.toString.call(e))return!1;if(u(t)){if(t.length!==e.length)return!1;for(var n=0,r=t.length;nt}})),G=O((function(t){return function(e){return e>=t}})),Z=function(t,e,n){var r=t[0],o=t[1];return new w((function(t){return s(t)%r===o}),e,n)},X=function(t,e,n,r){return new U(t,e,n,r)},tt=function(t,e,n){return new w(new RegExp(t,e.$options),e,n)},et=function(t,e,n,r){return new I(t,e,n,r)},nt=function(t,e,n){return new w((function(e){return null!=e&&(e instanceof t||e.constructor===t)}),e,n)},rt=function(t,e,n,r){return new J(t,e,n,r)},ot=rt,it=function(t,e,n){return new $(t,e,n,"$size")},at=function(){return null},st=function(t,e,n){var r;if(f(t))r=t;else{if(process.env.CSP_ENABLED)throw new Error('In CSP mode, sift does not support strings in "$where" condition');r=new Function("obj","return "+t)}return new w((function(t){return r.bind(t)(t)}),e,n)},ut=Object.freeze({__proto__:null,$Size:$,$eq:Q,$ne:q,$or:D,$nor:B,$elemMatch:K,$nin:z,$in:W,$lt:H,$lte:V,$gt:Y,$gte:G,$mod:Z,$exists:X,$regex:tt,$not:et,$type:nt,$and:rt,$all:ot,$size:it,$options:at,$where:st}),ct=function(t,e,n){var r=void 0===n?{}:n,o=r.compare,i=r.operations;return j(t,e,{compare:o,operations:Object.assign({},ut,i||{})})};const ft=function(t,e){void 0===e&&(e={});var n=ct(t,null,e);return C(n)}},7167:t=>{t.exports=function(){var t=Array.prototype.slice.call(arguments),e=t.shift()||[],n=t.pop();if("function"!=typeof n)throw new Error("No callback provided to asyncMap");if(!e)return n(null,[]);Array.isArray(e)||(e=[e]);var r=t.length,o=[],i=null,a=e.length,s=a*r;if(!s)return n(null,[]);function u(c){c&&!i&&(i=c);for(var f=arguments.length,l=1;la){var h=e.slice(a);s+=(e.length-a)*r,a=e.length,process.nextTick((function(){h.forEach((function(e){t.forEach((function(t){t(e,u)}))}))}))}0==--s&&n.apply(null,[i].concat(o))}e.forEach((function(e){t.forEach((function(t){t(e,u)}))}))}},6271:t=>{t.exports=function(){var t,e=Array.prototype.slice.call(arguments),n=null;return"object"==typeof e[0]?(n=e.shift(),"string"==typeof(t=e.shift())&&(t=n[t])):t=e.shift(),function(r){t.apply(n,e.concat(r))}}},5666:(t,e,n)=>{t.exports=o;var r=n(6271);function o(t,e){var n=[];!function i(a,s){return a>=s?e(null,n):(Array.isArray(t[a])&&(t[a]=r.apply(null,t[a].map((function(t){return t===o.first?n[0]:t===o.last?n[n.length-1]:t})))),t[a]?void t[a]((function(t,r){if(t)return e(t,n);void 0!==r&&(n=n.concat(r)),i(a+1,s)})):i(a+1,s))}(0,t.length)}o.first={},o.last={}},4518:(t,e,n)=>{n(7167),n(6271),e.chain=n(5666)},1614:(t,e,n)=>{"use strict";var r;n.r(e),n.d(e,{NIL:()=>N,parse:()=>v,stringify:()=>f,v1:()=>y,v3:()=>k,v4:()=>A,v5:()=>C,validate:()=>s,version:()=>R});var o=new Uint8Array(16);function i(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}const a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,s=function(t){return"string"==typeof t&&a.test(t)};for(var u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));const f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n};var l,h,p=0,d=0;const y=function(t,e,n){var r=e&&n||0,o=e||new Array(16),a=(t=t||{}).node||l,s=void 0!==t.clockseq?t.clockseq:h;if(null==a||null==s){var u=t.random||(t.rng||i)();null==a&&(a=l=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==s&&(s=h=16383&(u[6]<<8|u[7]))}var c=void 0!==t.msecs?t.msecs:Date.now(),y=void 0!==t.nsecs?t.nsecs:d+1,v=c-p+(y-d)/1e4;if(v<0&&void 0===t.clockseq&&(s=s+1&16383),(v<0||c>p)&&void 0===t.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=c,d=y,h=s;var m=(1e4*(268435455&(c+=122192928e5))+y)%4294967296;o[r++]=m>>>24&255,o[r++]=m>>>16&255,o[r++]=m>>>8&255,o[r++]=255&m;var g=c/4294967296*1e4&268435455;o[r++]=g>>>8&255,o[r++]=255&g,o[r++]=g>>>24&15|16,o[r++]=g>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(var b=0;b<6;++b)o[r+b]=a[b];return e||f(o)},v=function(t){if(!s(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n};function m(t,e,n){function r(t,r,o,i){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n>>9<<4)+1}function b(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function w(t,e,n,r,o,i){return b((a=b(b(e,t),b(r,i)))<<(s=o)|a>>>32-s,n);var a,s}function _(t,e,n,r,o,i,a){return w(e&n|~e&r,t,e,o,i,a)}function S(t,e,n,r,o,i,a){return w(e&r|n&~r,t,e,o,i,a)}function O(t,e,n,r,o,i,a){return w(e^n^r,t,e,o,i,a)}function x(t,e,n,r,o,i,a){return w(n^(e|~r),t,e,o,i,a)}const k=m("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n>5]>>>o%32&255,a=parseInt(r.charAt(i>>>4&15)+r.charAt(15&i),16);e.push(a)}return e}(function(t,e){t[e>>5]|=128<>5]|=(255&t[r/8])<>>32-e}const C=m("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var r=unescape(encodeURIComponent(t));t=[];for(var o=0;o>>0;b=g,g=m,m=E(v,30)>>>0,v=y,y=S}n[0]=n[0]+y>>>0,n[1]=n[1]+v>>>0,n[2]=n[2]+m>>>0,n[3]=n[3]+g>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),N="00000000-0000-0000-0000-000000000000",R=function(t){if(!s(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}},902:(t,e,n)=>{"use strict";t.exports=function(t,e,n,i){n instanceof Function&&(i=n,n=null),n||(n={}),r.realpath(t,(function(s,c){!function(t,e,n,i){var s=u(t);return n.mode&&n.chown?c():r.stat(t,(function(t,e){return t||!e||((n=a({},n)).mode||(n.mode=e.mode),!n.chown&&process.getuid&&(n.chown={uid:e.uid,gid:e.gid})),c()}));function c(){o([[f,s,e,n.mode,n.encoding||"utf8"],n.chown&&[r,r.chown,s,n.chown.uid,n.chown.gid],n.mode&&[r,r.chmod,s,n.mode],[r,r.rename,s,t]],(function(t){t?r.unlink(s,(function(){i(t)})):i()}))}function f(t,e,o,i,a){r.open(t,"w",n.mode,(function(t,n){return t?a(t):Buffer.isBuffer(e)?r.write(n,e,0,e.length,0,o):null!=e?r.write(n,String(e),0,String(i),o):o();function o(t){if(t)return a(t);r.fsync(n,(function(t){if(t)return a(t);r.close(n,a)}))}}))}}(c||t,e,n,i)}))},t.exports.sync=function(t,e,n){n||(n={});try{t=r.realpathSync(t)}catch(t){}var o=u(t);try{if(!n.mode||!n.chown)try{var i=r.statSync(t);(n=a({},n)).mode||(n.mode=i.mode),!n.chown&&process.getuid&&(n.chown={uid:i.uid,gid:i.gid})}catch(t){}var s=r.openSync(o,"w",n.mode);Buffer.isBuffer(e)?r.writeSync(s,e,0,e.length,0):null!=e&&r.writeSync(s,String(e),0,String(n.encoding||"utf8")),r.fsyncSync(s),r.closeSync(s),n.chown&&r.chownSync(o,n.chown.uid,n.chown.gid),n.mode&&r.chmodSync(o,n.mode),r.renameSync(o,t)}catch(t){try{r.unlinkSync(o)}catch(t){}throw t}},t.exports._getTmpname=u;var r=n(77),o=n(4518).chain,i=n(4269),a=Object.assign||n(1758)._extend,s=0;function u(t){return t+"."+i("/index.js").hash(String(process.pid)).hash(String(++s)).result()}},7680:()=>{},8510:()=>{},2993:()=>{},1386:()=>{},791:()=>{},1758:()=>{}},e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}return n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(4613)})(); \ No newline at end of file +var feathersjsOfflineClient;feathersjsOfflineClient=(()=>{var e={871:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.OPERATORS=t.FILTERS=void 0;var o=r(410),i=r(743);function a(e){if(void 0!==e)return Math.abs(parseInt(e,10))}function u(e,t,r){if(Array.isArray(e))return e.map((function(e){return u(e,t,r)}));if(o._.isObject(e)&&e.constructor==={}.constructor){var n={};return o._.each(e,(function(o,a){if("$"===a[0]){if(void 0!==r[a])return;if(!t.includes(a))throw new i.BadRequest("Invalid query parameter ".concat(a),e)}n[a]=u(o,t,r)})),Object.getOwnPropertySymbols(e).forEach((function(t){n[t]=e[t]})),n}return e}function s(e,t,r,n){return Array.isArray(r)?o._.each(r,(function(r){void 0!==t[r]&&(e[r]=t[r])})):o._.each(r,(function(r,o){var i=r(t[o],n);void 0!==i&&(e[o]=i)})),e}function c(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.filters,o=void 0===n?{}:n,i=r.operators,a=void 0===i?[]:i,c={};return c.filters=s({},e,t.FILTERS,r),c.filters=s(c.filters,e,o,r),c.query=u(e,t.OPERATORS.concat(a),c.filters),c}t.FILTERS={$sort:function(e){return"object"!==n(t=e)||Array.isArray(t)?t:Object.keys(t).reduce((function(e,r){return e[r]="object"===n(t[r])?t[r]:parseInt(t[r],10),e}),{});var t},$limit:function(e,t){return function(e,t){if(t&&t.default){var r="number"!=typeof e||isNaN(e)?t.default:e,n="number"==typeof t.max?t.max:Number.MAX_VALUE;return Math.min(r,n)}return e}(a(e),t.paginate)},$skip:function(e){return a(e)},$select:function(e){return e}},t.OPERATORS=["$in","$nin","$lt","$lte","$gt","$gte","$ne","$or"],t.default=c,e.exports=Object.assign(c,e.exports)},597:function(e,t,r){"use strict";function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?r-1:0),i=1;i2?r-2:0),o=2;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0!==e.paginate?e.paginate:this.options.paginate,n=e.query,o=void 0===n?{}:n,i=Object.assign({operators:this.options.whitelist||[],filters:this.options.filters,paginate:r},t),u=a.default(o,i);return Object.assign(u,{paginate:r})}},{key:"allowsMulti",value:function(e){var t=s[e];if(void 0!==t)return t;var r=this.options.multi;return!0===r||!1===r?r:r.includes(e)}},{key:"find",value:function(e){return u(this,"_find",e)}},{key:"get",value:function(e,t){return u(this,"_get",e,t)}},{key:"create",value:function(e,t){return Array.isArray(e)&&!this.allowsMulti("create")?Promise.reject(new i.MethodNotAllowed("Can not create multiple entries")):u(this,"_create",e,t)}},{key:"update",value:function(e,t,r){return null===e||Array.isArray(t)?Promise.reject(new i.BadRequest("You can not replace multiple instances. Did you mean 'patch'?")):u(this,"_update",e,t,r)}},{key:"patch",value:function(e,t,r){return null!==e||this.allowsMulti("patch")?u(this,"_patch",e,t,r):Promise.reject(new i.MethodNotAllowed("Can not patch multiple entries"))}},{key:"remove",value:function(e,t){return null!==e||this.allowsMulti("remove")?u(this,"_remove",e,t):Promise.reject(new i.MethodNotAllowed("Can not remove multiple entries"))}},{key:"id",get:function(){return this.options.id}},{key:"events",get:function(){return this.options.events}}])&&n(t.prototype,r),e}();t.AdapterService=c},385:(e,t)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rt?1:0},t.compareArrays=function(e,r){var n,o;for(n=0;n2&&void 0!==arguments[2]?arguments[2]:t.compareNSB,o=t,i=o.compareNSB,a=o.compare,u=o.compareArrays;if(void 0===e)return void 0===r?0:-1;if(void 0===r)return void 0===e?0:1;if(null===e)return null===r?0:-1;if(null===r)return null===e?0:1;if("number"==typeof e)return"number"==typeof r?i(e,r):-1;if("number"==typeof r)return"number"==typeof e?i(e,r):1;if("string"==typeof e)return"string"==typeof r?n(e,r):-1;if("string"==typeof r)return"string"==typeof e?n(e,r):1;if("boolean"==typeof e)return"boolean"==typeof r?i(e,r):-1;if("boolean"==typeof r)return"boolean"==typeof e?i(e,r):1;if(e instanceof Date)return r instanceof Date?i(e.getTime(),r.getTime()):-1;if(r instanceof Date)return e instanceof Date?i(e.getTime(),r.getTime()):1;if(Array.isArray(e))return Array.isArray(r)?u(e,r):-1;if(Array.isArray(r))return Array.isArray(e)?u(e,r):1;for(var s=Object.keys(e).sort(),c=Object.keys(r).sort(),f=0,l=0;l=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw a}}}}(n);try{for(u.s();!(a=u.n()).done;){var s=a.value;if(0!=(i=s.direction*t.compare(e[s.key],o[s.key])))return i}}catch(e){u.e(e)}finally{u.f()}return 0}}},782:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.enableHooks=t.processHooks=t.getHooks=t.isHookObject=t.convertHookData=t.makeArguments=t.defaultMakeArguments=t.createHookObject=t.ACTIVATE_HOOKS=void 0;var o=r(621),i=o._,a=i.each,u=i.pick;function s(e){var t=[];return void 0!==e.id&&t.push(e.id),e.data&&t.push(e.data),t.push(e.params||{}),t}function c(e){var t={};return Array.isArray(e)?t={all:e}:"object"!==n(e)?t={all:[e]}:a(e,(function(e,r){t[r]=Array.isArray(e)?e:[e]})),t}function f(e){return"object"===n(e)&&"string"==typeof e.method&&"string"==typeof e.type}t.ACTIVATE_HOOKS=o.createSymbol("__feathersActivateHooks"),t.createHookObject=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};return Object.defineProperty(r,"toJSON",{value:function(){return u(this,"type","method","path","params","id","data","result","error")}}),Object.assign(r,t,{method:e,get path(){var e=t.app,r=t.service;return r&&e&&e.services?Object.keys(e.services).find((function(t){return e.services[t]===r})):null}})},t.defaultMakeArguments=s,t.makeArguments=function(e){switch(e.method){case"find":return[e.params];case"get":case"remove":return[e.id,e.params];case"update":case"patch":return[e.id,e.data,e.params];case"create":return[e.data,e.params]}return s(e)},t.convertHookData=c,t.isHookObject=f,t.getHooks=function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=e.__hooks[r][n]||[],a=t.__hooks[r][n]||[];return o?a.concat(i):i.concat(a)},t.processHooks=function(e,t){var r=this,n=t,o=function(e){if(e){if(!f(e))throw new Error("".concat(n.type," hook for '").concat(n.method,"' method returned invalid hook object"));n=e}return n};return e.reduce((function(e,t){var n=t.bind(r);return e.then((function(e){return n(e)})).then(o)}),Promise.resolve(n)).then((function(){return n})).catch((function(e){throw e.hook=n,e}))},t.enableHooks=function(e,t,r){if("function"==typeof e.hooks)return e;var n={};return r.forEach((function(e){n[e]={}})),Object.defineProperty(e,"__hooks",{configurable:!0,value:n,writable:!0}),Object.assign(e,{hooks:function(e){var r=this;return a(e,(function(e,n){if(!r.__hooks[n])throw new Error("'".concat(n,"' is not a valid hook type"));var o=c(e);a(o,(function(e,r){if("all"!==r&&-1===t.indexOf(r))throw new Error("'".concat(r,"' is not a valid hook method"))})),t.forEach((function(e){var t=r.__hooks[n][e]||(r.__hooks[n][e]=[]);o.all&&t.push.apply(t,o.all),o[e]&&t.push.apply(t,o[e])}))})),this}})}},410:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.hooks=void 0;var u=i(r(782));a(r(621),t),t.hooks=u},621:(e,t)=>{"use strict";function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?t-1:0),n=1;n1?n-1:0),i=1;i1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:{},n="function"==typeof r.get?r.get.bind(r):function(){},o=n("env")||"production",i=n("host")||process.env.HOST_NAME||"localhost",a="development"===o||"test"===o||void 0===o?"http":"https",u=n("port")||process.env.PORT||3030,s="development"===o||"test"===o||void 0===o?":".concat(u):"";return e=e||"","".concat(a,"://").concat(i).concat(s,"/").concat(t.stripSlashes(e))},t.createSymbol=function(e){return"undefined"!=typeof Symbol?Symbol(e):e}},743:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(801)("@feathersjs/errors");function i(e,t,r,a,u){var s,c,f;(e=e||"Error")instanceof Error?(c=e.message||"Error",e.errors&&(s=e.errors)):"object"===n(e)?(c=e.message||"Error",u=e):c=e,u&&((f=JSON.parse(JSON.stringify(u))).errors?(s=f.errors,delete f.errors):u.errors&&(s=JSON.parse(JSON.stringify(u.errors)))),this.type="FeathersError",this.name=t,this.message=c,this.code=r,this.className=a,this.data=f,this.errors=s||{},o("".concat(this.name,"(").concat(this.code,"): ").concat(this.message)),o(this.errors),Error.captureStackTrace?Error.captureStackTrace(this,i):this.stack=(new Error).stack}function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e}function u(e,t){i.call(this,e,"BadRequest",400,"bad-request",t)}function s(e,t){i.call(this,e,"NotAuthenticated",401,"not-authenticated",t)}function c(e,t){i.call(this,e,"PaymentError",402,"payment-error",t)}function f(e,t){i.call(this,e,"Forbidden",403,"forbidden",t)}function l(e,t){i.call(this,e,"NotFound",404,"not-found",t)}function p(e,t){i.call(this,e,"MethodNotAllowed",405,"method-not-allowed",t)}function h(e,t){i.call(this,e,"NotAcceptable",406,"not-acceptable",t)}function d(e,t){i.call(this,e,"Timeout",408,"timeout",t)}function v(e,t){i.call(this,e,"Conflict",409,"conflict",t)}function y(e,t){i(this,e,"Gone",410,"gone")}function m(e,t){i.call(this,e,"LengthRequired",411,"length-required",t)}function g(e,t){i.call(this,e,"Unprocessable",422,"unprocessable",t)}function b(e,t){i.call(this,e,"TooManyRequests",429,"too-many-requests",t)}function w(e,t){i.call(this,e,"GeneralError",500,"general-error",t)}function S(e,t){i.call(this,e,"NotImplemented",501,"not-implemented",t)}function _(e,t){i.call(this,e,"BadGateway",502,"bad-gateway",t)}function O(e,t){i.call(this,e,"Unavailable",503,"unavailable",t)}a(i,Error),Object.defineProperty(i.prototype,"toJSON",{value:function(){return{name:this.name,message:this.message,code:this.code,className:this.className,data:this.data,errors:this.errors}}}),a(u,i),a(s,i),a(c,i),a(f,i),a(l,i),a(p,i),a(h,i),a(d,i),a(v,i),a(y,i),a(m,i),a(g,i),a(b,i),a(w,i),a(S,i),a(_,i),a(O,i);var x={FeathersError:i,BadRequest:u,NotAuthenticated:s,PaymentError:c,Forbidden:f,NotFound:l,MethodNotAllowed:p,NotAcceptable:h,Timeout:d,Conflict:v,Gone:y,LengthRequired:m,Unprocessable:g,TooManyRequests:b,GeneralError:w,NotImplemented:S,BadGateway:_,Unavailable:O,400:u,401:s,402:c,403:f,404:l,405:p,406:h,408:d,409:v,410:y,411:m,422:g,429:b,500:w,501:S,502:_,503:O};e.exports=Object.assign({convert:function(e){if(!e)return e;var t=x[e.name],r=t?new t(e.message,e.data):new Error(e.message||e);return"object"===n(e)&&Object.assign(r,e),r}},x)},801:(e,t,r)=>{var n;t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),this.useColors){var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))})),t.splice(o,0,r)}},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(n=!1,function(){n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=r(331)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},331:(e,t,r)=>{function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{var n=r(568),o=r(614).v4,i=r(670),a=r(106).stripProps;function u(e){return e="string"==typeof e?e:JSON.stringify(e),n(e)}e.exports={genUuid:function(e){return e?i.generate():o()},hash:u,hashOfRecord:function(e){return u(a(e,["id","_id"]))}}},707:(e,t,r)=>{var n=r(273),o=r(668),i=r(106),a=r(662);e.exports=Object.assign(Object.assign(Object.assign({to:n},o),i),{OptionsProxy:a})},106:e=>{function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return"object"===t(e)&&!Array.isArray(e)&&null!==e}e.exports={isObject:r,stripProps:function e(t,n){n=Array.isArray(n)?n:n||[];var o={};return Object.keys(t).forEach((function(i){if(-1===n.indexOf(i)){var a=t[i];o[i]=r(a)?e(a,n):a}})),o}}},662:e=>{function t(e,t){for(var r=0;r{e.exports=function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e,null]}))}},613:(e,t,r)=>{var n=r(707),o=n.to,i=n.isObject,a=n.stripProps,u=n.genUuid,s=n.hash,c=n.hashOfRecord,f=r(683),l=f.Owndata,p=f.owndataWrapper,h=r(153),d=h.Ownnet,v=h.ownnetWrapper;e.exports={to:o,isObject:i,stripProps:a,genUuid:u,hash:s,hashOfRecord:c,Owndata:l,owndataWrapper:p,Ownnet:d,ownnetWrapper:v}},976:(e,t,r)=>{var n=r(387);e.exports=n},387:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){throw new TypeError('"'+e+'" is read-only')}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r-1&&c.splice(f,1),this._strip=A.apply(void 0,function(e){if(Array.isArray(e))return u(e)}(l=c)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(l)||a(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())):this._strip=function(e){return e},this._select=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o0&&(this._timedSyncHandle=setInterval((function(){return n.sync()}),n.options.timedSync)),S(" Done."),r.abrupt("return",!0);case 36:case"end":return r.stop()}var l}),r,this)})))}},{key:"_listenOptions",value:function(){var e=this,t=new b.OptionsProxy(e.thisName);this.options=t.observe(Object.assign({},e.remoteService.options?e.remoteService.options:{},e.options)),t.watcher((function(){e.remoteService.options=Object.assign({},e.remoteService.options,e.options),e.localService.options=Object.assign({},e.options,e.localSpecOptions)}))}},{key:"getEntries",value:function(e){return h(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return S("Calling getEntries(".concat(JSON.stringify(e),"})")),r=[],t.next=4,this.localService.getEntries(e).then((function(e){r=e}));case 4:return t.abrupt("return",Promise.resolve(r).then(this._strip).then(this._select(e)));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"get",value:function(e,t){return h(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return S("Calling get(".concat(JSON.stringify(e),", ").concat(JSON.stringify(t),"})")),r.abrupt("return",this._get(e,t));case 2:case"end":return r.stop()}}),r,this)})))}},{key:"_get",value:function(e,t){return h(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return S("Calling _get(".concat(JSON.stringify(e),", ").concat(JSON.stringify(t),"})")),r.next=3,this.localService.get(e,t).then(this._strip).then(this._select(t)).catch((function(e){throw e}));case 3:return r.abrupt("return",r.sent);case 4:case"end":return r.stop()}}),r,this)})))}},{key:"find",value:function(e){return h(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return S("Calling find(".concat(JSON.stringify(e),"})")),t.t0=S,t.t1=" rows=",t.t2=JSON,t.next=6,this.getEntries();case 6:return t.t3=t.sent,t.t4=t.t2.stringify.call(t.t2,t.t3),t.t5=t.t1.concat.call(t.t1,t.t4),(0,t.t0)(t.t5),t.abrupt("return",this._find(e));case 11:case"end":return t.stop()}}),t,this)})))}},{key:"_find",value:function(e){return h(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return S("Calling _find(".concat(JSON.stringify(e),"})")),t.abrupt("return",this.localService.find(e).then(this._strip).then(this._select(e)));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"create",value:function(e,t){return h(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(S("Calling create(".concat(JSON.stringify(e),", ").concat(JSON.stringify(t),")")),!Array.isArray(e)||this.allowsMulti("create")){r.next=3;break}return r.abrupt("return",Promise.reject(new m.default.MethodNotAllowed("Creating multiple without option 'multi' set")));case 3:return r.abrupt("return",this._create(e,t));case 4:case"end":return r.stop()}}),r,this)})))}},{key:"_create",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return h(this,void 0,void 0,regeneratorRuntime.mark((function n(){var o,a,u,s,c,f,l,p,d,v,y=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(S("Calling _create(".concat(JSON.stringify(e),", ").concat(JSON.stringify(t),", ").concat(r,")")),o=this,!Array.isArray(e)){n.next=8;break}if(this.allowsMulti("create")){n.next=6;break}return n.abrupt("return",Promise.reject(new m.default.MethodNotAllowed("Creating multiple without option 'multi' set")));case 6:return a=new Date,n.abrupt("return",Promise.all(e.map((function(e){return o._create(e,t,a)}))));case 8:return r=r||new Date,"uuid"in(u=C(e))||(u.uuid=b.genUuid(this.options.useShortUuid)),"updatedAt"in u||(u.updatedAt=r),u.onServerAt=O,n.next=15,b.to(this.localService.find({query:{uuid:u.uuid}}));case 15:if(s=n.sent,c=i(s,2),f=c[0],!(l=c[1])||!l.length){n.next=21;break}throw new m.default.BadRequest("Optimistic create requires unique uuid. (".concat(this.type,") res=").concat(JSON.stringify(l)));case 21:return C(t),this.disallowInternalProcessing("_create"),n.next=25,this._addQueuedEvent("create",u,C(u),t);case 25:return p=n.sent,n.next=28,b.to(this.localService.create(u,C(t)));case 28:if(d=n.sent,v=i(d,2),f=v[0],!(l=v[1])){n.next=36;break}this.remoteService.create(l,C(t)).then((function(e){return h(y,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.to(o._removeQueuedEvent("_create0",p,u,u.updatedAt));case 2:return t.next=4,o._patchIfNotRemoved(e[o.id],e);case 4:return o.allowInternalProcessing("_create0"),t.next=7,b.to(o._processQueuedEvents());case 7:case"end":return t.stop()}}),t)})))})).catch((function(e){return h(y,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("Timeout"===e.name){r.next=5;break}return r.next=3,b.to(o._removeQueuedEvent("_create1",p,e.message,u.updatedAt));case 3:return r.next=5,b.to(o.localService.remove(l[o.id],t));case 5:o.allowInternalProcessing("_create1");case 6:case"end":return r.stop()}}),r)})))})),n.next=40;break;case 36:return n.next=38,b.to(this._removeQueuedEvent("_create2",p,u,u.updatedAt));case 38:throw this.allowInternalProcessing("_create2"),f;case 40:return n.abrupt("return",Promise.resolve(l).then(this._strip).then(this._select(t)));case 41:case"end":return n.stop()}}),n,this)})))}},{key:"update",value:function(e,t,r){return h(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(S("Calling update(".concat(e,", ").concat(JSON.stringify(t),", ").concat(JSON.stringify(r),"})")),null!==e&&!Array.isArray(t)){n.next=3;break}return n.abrupt("return",Promise.reject(new m.default.BadRequest("You can not replace multiple instances. Did you mean 'patch'?")));case 3:return n.abrupt("return",this._update(e,t,r));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"_update",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,void 0,void 0,regeneratorRuntime.mark((function n(){var o,a,u,s,c,f,l,p,d,v,y,g=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(S("Calling _update(".concat(e,", ").concat(JSON.stringify(t),", ").concat(JSON.stringify(r),"})")),o=this,null!==e&&!Array.isArray(t)){n.next=4;break}return n.abrupt("return",Promise.reject(new m.default.BadRequest("You can not replace multiple instances. Did you mean 'patch'?")));case 4:return n.next=6,b.to(this.localService._get(e));case 6:if(a=n.sent,u=i(a,2),s=u[0],(c=u[1])&&c!=={}){n.next=12;break}throw new m.default.NotFound("Trying to update non-existing ".concat(this.id,"=").concat(e,". (").concat(this.type,") err=").concat(JSON.stringify(s.name)));case 12:return f=C(c),l=f.uuid,(p=C(t)).uuid=l,p.updatedAt=new Date,p.onServerAt=O,this.disallowInternalProcessing("_update"),n.next=21,this._addQueuedEvent("update",p,e,C(p),r);case 21:return d=n.sent,n.next=24,b.to(this.localService.update(e,p,C(r)));case 24:if(v=n.sent,y=i(v,2),s=y[0],c=y[1],s){n.next=32;break}this.remoteService.update(e,c,C(r)).then((function(e){return h(g,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.to(o._removeQueuedEvent("_update0",d,p,c.updatedAt));case 2:return t.next=4,o._patchIfNotRemoved(e[o.id],e);case 4:return o.allowInternalProcessing("_update0"),t.next=7,b.to(o._processQueuedEvents());case 7:case"end":return t.stop()}}),t)})))})).catch((function(t){return h(g,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("Timeout"!==t.name){r.next=4;break}S("_update TIMEOUT: ".concat(t.name,", ").concat(t.message)),r.next=9;break;case 4:return S("_update ERROR: ".concat(t.name,", ").concat(t.message)),r.next=7,b.to(o._removeQueuedEvent("_update1",d,p,c.updatedAt));case 7:return r.next=9,b.to(o.localService.patch(e,f));case 9:o.allowInternalProcessing("_update1");case 10:case"end":return r.stop()}}),r)})))})),n.next=36;break;case 32:return n.next=34,b.to(this._removeQueuedEvent("_update2",d,p,p.updatedAt));case 34:throw this.allowInternalProcessing("_update2"),s;case 36:return n.abrupt("return",Promise.resolve(p).then(this._strip).then(this._select(r)));case 37:case"end":return n.stop()}}),n,this)})))}},{key:"patch",value:function(e,t,r){return h(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(S("Calling patch(".concat(e,", ").concat(JSON.stringify(t),", ").concat(JSON.stringify(r),"})")),null!==e||this.allowsMulti("patch")){n.next=3;break}return n.abrupt("return",Promise.reject(new m.default.MethodNotAllowed("Can not patch multiple entries")));case 3:return n.abrupt("return",this._patch(e,t,r));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"_patch",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return h(this,void 0,void 0,regeneratorRuntime.mark((function a(){var u,s,c,f,l,p,d,v,y,g,w=this;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(S("Calling _patch(".concat(e,", ").concat(JSON.stringify(t),", ").concat(JSON.stringify(r),"})")),u=this,null!==e){a.next=7;break}if(this.allowsMulti("patch")){a.next=6;break}throw new m.default.MethodNotAllowed("Patching multiple without option 'multi' set");case 6:return a.abrupt("return",this.find(r).then((function(e){var n=e.data?e.data:e;Array.isArray(n)||(o("res"),n=[n]);var i=(new Date).toISOString();return Promise.all(n.map((function(e){return u._patch(e[w.id],t,r,i)})))})));case 7:return n=n||new Date,a.next=10,b.to(this.localService._get(e));case 10:if(s=a.sent,c=i(s,2),f=c[0],(l=c[1])&&l!=={}){a.next=16;break}throw f;case 16:return p=C(l),(d=Object.assign({},p,t)).onServerAt=O,d.updatedAt=n,this.disallowInternalProcessing("_patch"),a.next=23,this._addQueuedEvent("patch",d,e,C(d),r);case 23:return v=a.sent,a.next=26,b.to(this.localService.patch(e,d,C(r)));case 26:if(y=a.sent,g=i(y,2),f=g[0],!(l=g[1])){a.next=34;break}this.remoteService.patch(e,l,C(r)).then((function(e){return h(w,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.to(u._removeQueuedEvent("_patch0",v,e,l.updatedAt));case 2:return t.next=4,u._patchIfNotRemoved(e[u.id],e);case 4:return u.allowInternalProcessing("_patch0"),t.next=7,b.to(u._processQueuedEvents());case 7:case"end":return t.stop()}}),t)})))})).catch((function(t){return h(w,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("Timeout"!==t.name){r.next=4;break}S("_patch TIMEOUT: ".concat(t.name,", ").concat(t.message)),r.next=9;break;case 4:return S("_patch ERROR: ".concat(t.name,", ").concat(t.message)),r.next=7,b.to(u._removeQueuedEvent("_patch1",v,d,l.updatedAt));case 7:return r.next=9,b.to(u.localService.patch(e,p));case 9:u.allowInternalProcessing("_patch1");case 10:case"end":return r.stop()}}),r)})))})),a.next=38;break;case 34:return a.next=36,b.to(this._removeQueuedEvent("_patch2",v,d,d.updatedAt));case 36:throw this.allowInternalProcessing("_patch2"),f;case 38:return a.abrupt("return",Promise.resolve(d).then(this._strip).then(this._select(r)));case 39:case"end":return a.stop()}}),a,this)})))}},{key:"_patchIfNotRemoved",value:function(e,t){return h(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.localService.patch(e,t).catch((function(e){return Promise.resolve(!0)})));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"remove",value:function(e,t){return h(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(S("Calling remove(".concat(e,", ").concat(JSON.stringify(t),"})")),null!==e||this.allowsMulti("remove")){r.next=3;break}return r.abrupt("return",Promise.reject(new m.default.MethodNotAllowed("Can not remove multiple entries")));case 3:return r.abrupt("return",this._remove(e,t));case 4:case"end":return r.stop()}}),r,this)})))}},{key:"_remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,a,u,s,c,f,l,p,d,v=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(S("Calling _remove(".concat(e,", ").concat(JSON.stringify(t),"})")),n=this,null!==e){r.next=7;break}if(this.allowsMulti("remove")){r.next=6;break}throw new m.default.MethodNotAllowed("Removing multiple without option 'multi' set");case 6:return r.abrupt("return",this.find(t).then((function(e){var r=e.data?e.data:e;return Array.isArray(r)||(o("res"),r=[r]),Promise.all(r.map((function(e){return n._remove(e[v.id],t)})))})));case 7:return r.next=9,b.to(this.localService._get(e));case 9:if(a=r.sent,u=i(a,2),s=u[0],(c=u[1])&&c!=={}){r.next=15;break}throw new m.default.BadRequest("Trying to remove non-existing ".concat(this.id,"=").concat(e,". (").concat(this.type,") err=").concat(JSON.stringify(s),", res=").concat(JSON.stringify(c)));case 15:return f=C(c),this.disallowInternalProcessing("_remove"),r.next=19,this._addQueuedEvent("remove",f,e,t);case 19:return l=r.sent,r.next=22,b.to(this.localService.remove(e,C(t)));case 22:if(p=r.sent,d=i(p,2),s=d[0],c=d[1],s){r.next=30;break}this.remoteService.remove(e,C(t)).then((function(e){return h(v,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.to(n._removeQueuedEvent("_remove0",l,f,null));case 2:return n.allowInternalProcessing("_remove0"),e.next=5,b.to(n._processQueuedEvents());case 5:case"end":return e.stop()}}),e)})))})).catch((function(e){return h(v,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("Timeout"!==e.name){t.next=4;break}S("_remove TIMEOUT: ".concat(e.name,", ").concat(e.message)),t.next=9;break;case 4:return S("_remove ERROR: ".concat(e.name,", ").concat(e.message,"\nbeforeRecord = ").concat(JSON.stringify(f))),t.next=7,b.to(n._removeQueuedEvent("_remove1",l,f,null));case 7:return t.next=9,b.to(n.localService.create(f,null));case 9:n.allowInternalProcessing("_remove1");case 10:case"end":return t.stop()}}),t)})))})),r.next=34;break;case 30:return r.next=32,b.to(this._removeQueuedEvent("_remove2",l,f,null));case 32:throw this.allowInternalProcessing("_remove2"),s;case 34:return r.abrupt("return",Promise.resolve(f).then(this._strip).then(this._select(t)));case 35:case"end":return r.stop()}}),r,this)})))}},{key:"allowInternalProcessing",value:function(e){S("allowInternalProcessing: ".concat(e," ").concat(this.thisName," ").concat(this.aIP-1)),this.aIP--}},{key:"disallowInternalProcessing",value:function(e){S("disallowInternalProcessing: ".concat(e," ").concat(this.thisName," ").concat(this.aIP+1)),this.aIP++}},{key:"internalProcessingAllowed",value:function(){return 0===this.aIP}},{key:"_addQueuedEvent",value:function(e,t,r,n,o){return h(this,void 0,void 0,regeneratorRuntime.mark((function a(){var u,s,c;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return S("addQueuedEvent entered"),a.next=3,b.to(this.localQueue.create({eventName:e,record:t,arg1:r,arg2:n,arg3:o}));case 3:return u=a.sent,(s=i(u,2))[0],c=s[1],S("addQueuedEvent added: ".concat(JSON.stringify(c))),a.abrupt("return",Promise.resolve(c.id));case 9:case"end":return a.stop()}}),a,this)})))}},{key:"_removeQueuedEvent",value:function(e,t,r,n){return h(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S("removeQueuedEvent entered"),e.next=3,b.to(this.localQueue.remove(t));case 3:return r=e.sent,(n=i(r,2))[0],o=n[1],e.abrupt("return",Promise.resolve(o));case 8:case"end":return e.stop()}}),e,this)})))}},{key:"_processQueuedEvents",value:function(){return h(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new m.default.NotImplemented("_processQueuedEvents must be implemented!!!");case 1:case"end":return e.stop()}}),e)})))}},{key:"sync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return h(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,o,a,u,s,c,f,l=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.internalProcessingAllowed()){t.next=5;break}return t.next=3,new Promise((function(e){setTimeout((function(){e(!0)}),200)}));case 3:t.next=0;break;case 5:return t.next=7,this._getSyncOptions(e);case 7:return r=t.sent,S("".concat(this.type,".sync(").concat(JSON.stringify(r),") started...")),n=this,o=!0,t.next=13,b.to(w.default(this.remoteService,r));case 13:if(a=t.sent,u=i(a,2),s=u[0],c=u[1],!s){t.next=21;break}return"timeout"===s.className?S(" TIMEOUT: ".concat(JSON.stringify(s))):S(" ERROR: ".concat(JSON.stringify(s))),this.localService.emit("synced",!1),t.abrupt("return",!1);case 21:return S(" Applying received snapshot data... (".concat(c.length," items)")),f=new Date(0).toISOString(),t.next=25,Promise.all(c.map((function(e){return h(l,void 0,void 0,regeneratorRuntime.mark((function t(){var r,a,u,s,c,l,p,h,d;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.to(n.localService.get(e[n.id]));case 2:if(r=t.sent,a=i(r,2),u=a[0],!a[1]){t.next=26;break}if(f=fe.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:{};if(m("owndataWrapper started on path '".concat(t,"'")),!(e&&e.version&&e.service&&e.services))throw new d.default.Unavailable("The FeathersJS app must be supplied as first argument");var n=h.stripSlashes(t),o=e.service(n);if(void 0===o)throw new d.default.Unavailable("No prior service registered on path '".concat(n,"'"));var i=Object.assign({},o.options,r);e.use(n,S(i));var a=e.service(n);return a.options=i,a._listenOptions(),a}},w.Service=b},153:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:{};if(g("ownnetWrapper started on path '".concat(t,"'")),!(e&&e.version&&e.service&&e.services))throw new v.default.Unavailable("The FeathersJS app must be supplied as first argument");var n=d.stripSlashes(t),o=e.service(n);if(void 0===o)throw new v.default.Unavailable("No prior service registered on path '".concat(n,"'"));var i=Object.assign({},o.options,r);e.use(n,S(i));var a=e.service(n);return a.options=i,a._listenOptions(),a}},w.Service=b},564:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(801)).default("@feathersjs-offline:snapshot");e.exports=function(e,t){o("snapshot start: ".concat(JSON.stringify(t)));var r,n=Object.assign({},{$skip:0,$limit:200},t);return e.find({query:n}).then((function(e){if(o("snapshot query = ".concat(JSON.stringify(n),", read ").concat((e.data||e).length," records\n\n snapshot read ").concat(JSON.stringify(e.data||e))),!e.data)return e;var t=e.total,a=e.limit,u=e.skip,s=e.data;return r=s,u+s.length{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r{var t,r;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,o=0;n>>6-2*o);return r}},e.exports=r},203:(e,t,r)=>{const{Service:n}=r(691),o=[];class i extends n{constructor(e={}){if(super(e),this._storageKey=e.name||"feathers",this._storage=e.storage||"undefined"!=typeof window&&window.localStorage,this._throttle=e.throttle||200,this._reuseKeys=e.reuseKeys||!1,this.store=null,!this._storage)throw new Error("The `storage` option needs to be provided");if(-1===o.indexOf(this._storageKey))o.push(this._storageKey);else if(!this._reuseKeys)throw new Error(`The storage name '${this._storageKey}' is already in use by another instance.`);this.ready()}ready(){return this.store?Promise.resolve(this.store):Promise.resolve(this._storage.getItem(this._storageKey)).then((e=>JSON.parse(e||"{}"))).then((e=>{const t=Object.keys(e),r=e[t[t.length-1]];return this._uId=t.length&&void 0!==r[this.id]?r[this.id]+1:this._uId,this.store=e}))}flush(e){return this._timeout||(this._timeout=setTimeout((()=>{this._storage.setItem(this._storageKey,JSON.stringify(this.store)),delete this._timeout}),this._throttle)),e}execute(e,...t){return this.ready().then((()=>super[e](...t)))}find(...e){return this.execute("find",...e)}get(...e){return this.execute("get",...e)}create(...e){return this.execute("create",...e).then((e=>this.flush(e)))}patch(...e){return this.execute("patch",...e).then((e=>this.flush(e)))}update(...e){return this.execute("update",...e).then((e=>this.flush(e)))}remove(...e){return this.execute("remove",...e).then((e=>this.flush(e)))}}e.exports=function(e){return new i(e)},e.exports.Service=n},691:(e,t,r)=>{const n=r(743),{_:o}=r(410),{sorter:i,select:a,AdapterService:u}=r(597),s=r(41).ZP,c=(e,...t)=>a(...t)(JSON.parse(JSON.stringify(e)));class f extends u{constructor(e={}){super(o.extend({id:"id",matcher:s,sorter:i},e)),this._uId=e.startId||0,this.store=e.store||{}}async getEntries(e={}){const{query:t}=this.filterQuery(e);return this._find(Object.assign({},e,{paginate:!1,query:t}))}async _find(e={}){const{query:t,filters:r,paginate:n}=this.filterQuery(e);let i=o.values(this.store).filter(this.options.matcher(t));const a=i.length;void 0!==r.$sort&&i.sort(this.options.sorter(r.$sort)),void 0!==r.$skip&&(i=i.slice(r.$skip)),void 0!==r.$limit&&(i=i.slice(0,r.$limit));const u={total:a,limit:r.$limit,skip:r.$skip||0,data:i.map((t=>c(t,e)))};return n&&n.default?u:u.data}async _get(e,t={}){if(e in this.store){const{query:r}=this.filterQuery(t),n=this.store[e];if(this.options.matcher(r)(n))return c(n,t,this.id)}throw new n.NotFound(`No record found for id '${e}'`)}async _create(e,t={}){if(Array.isArray(e))return Promise.all(e.map((e=>this._create(e,t))));const r=e[this.id]||this._uId++,n=o.extend({},e,{[this.id]:r}),i=this.store[r]=n;return c(i,t,this.id)}async _update(e,t,r={}){const n=(await this._get(e))[this.id];return e=n==e?n:e,this.store[e]=o.extend({},t,{[this.id]:e}),this._get(e,r)}async _patch(e,t,r={}){const n=e=>{const n=e[this.id];return this.store[n]=o.extend(this.store[n],o.omit(t,this.id)),c(this.store[n],r,this.id)};return null===e?(await this.getEntries(r)).map(n):n(await this._get(e,r))}async _remove(e,t={}){if(null===e){const e=await this.getEntries(t);return Promise.all(e.map((e=>this._remove(e[this.id],t))))}const r=await this._get(e,t);return delete this.store[e],r}}e.exports=e=>new f(e),e.exports.Service=f},41:(e,t,r)=>{"use strict";function n(e){var t="[object "+e+"]";return function(e){return Object.prototype.toString.call(e)===t}}r.d(t,{ZP:()=>_});var o=n("Array"),i=n("Object"),a=n("Function");function u(e,t){return a(e.get)?e.get(t):e[t]}const s=(c=e=>function(t,r,n,i,a){if(!o(r)||!r.length)return e(t,r);for(var s=0,c=r.length;so?Boolean(o.find((([t,r,n])=>c(e)))):c(e));var c;function f(e){return function(t,r,n,i){if(!o(r)||!r.length)return e(t,r,n,i);for(var a=0,s=r.length;ae(t),$nin:function(e,t){return e(t)},$not:function(e,t,r,n){return e(t,r,n)},$type:function(e,t){return e(t)},$all:function(e,t,r,n,o){return p.$and(e,t,r,n,o)},$size:function(e,t){return!!t&&e===t.length},$or:function(e,t,r,n){for(var o=0,i=e.length;o0}},$gte:function(e,t,{comparable:r,compare:n}){return function(t){return n(r(t),r(e))>=0}},$lt:function(e,t,{comparable:r,compare:n}){return function(t){return n(r(t),r(e))<0}},$lte:function(e,t,{comparable:r,compare:n}){return function(t){return n(r(t),r(e))<=0}},$in:function(e,t,r){const{comparable:n}=r;return function(t){if(!(t instanceof Array)){var o=n(t);if(o===t&&"object"==typeof t)for(a=e.length;a--;)if(String(e[a])===String(t)&&"[object Object]"!==String(t))return!0;if(void 0===o)for(a=e.length;a--;)if(null==e[a])return!0;for(a=e.length;a--;){var i=l(S(u(e,a),r),o,a,e);if(i&&"[object Object]"!==String(i)&&"[object Object]"!==String(o))return!0}return!!~e.indexOf(o)}for(var a=t.length;a--;)if(~e.indexOf(n(u(t,a))))return!0;return!1}},$nin:function(e,t,r){const n=h.$in(e,t,r);return function(e,t,r,o){return!n(e,t,r,o)}},$mod:function(e){return function(t){return t%e[0]==e[1]}},$ne:function(e,t,r){const n=h.$eq(e,t,r);return f((function(e,t,r,o){return!n(e,t,r,o)}))},$and:function(e,t,r){return e.map(g(r))},$all:function(e,t,r){return h.$and(e,t,r)},$or:function(e,t,r){return e.map(g(r))},$nor:function(e,t,r){return e.map(g(r))},$not:function(e,t,r){const n=g(r)(e);return function(e,t,r){return!l(n,e,t,r)}},$type:function(e){return function(t,r,n){return null!=t&&(t instanceof e||t.constructor==e)}},$regex:function(e,t){return new RegExp(e,t.$options)},$where:function(e){return"string"==typeof e?new Function("obj","return "+e):e},$elemMatch:function(e,t,r){return g(r)(e)},$exists:function(e){return!!e}};function d(e,t){return{options:e,validate:t}}function v({keyPath:e,child:t,query:r},n){const o=[];if(y(n,e,0,n,o),1===o.length){const[e,r,n]=o[0];return l(t,e,r,n)}return r&&r.$ne,o.map((([e])=>e)),l(t,void 0,void 0,void 0,o)}function y(e,t,r,n,i){if(r!==t.length&&null!=e){var a=u(t,r);if(o(e)&&isNaN(Number(a)))for(var s=0,c=e.length;st)return 1;if(e{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},568:(e,t,r)=>{var n,o,i,a,u;n=r(12),o=r(487).utf8,i=r(738),a=r(487).bin,(u=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?a.stringToBytes(e):o.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var r=n.bytesToWords(e),s=8*e.length,c=1732584193,f=-271733879,l=-1732584194,p=271733878,h=0;h>>24)|4278255360&(r[h]<<24|r[h]>>>8);r[s>>>5]|=128<>>9<<4)]=s;var d=u._ff,v=u._gg,y=u._hh,m=u._ii;for(h=0;h>>0,f=f+b>>>0,l=l+w>>>0,p=p+S>>>0}return n.endian([c,f,l,p])})._ff=function(e,t,r,n,o,i,a){var u=e+(t&r|~t&n)+(o>>>0)+a;return(u<>>32-i)+t},u._gg=function(e,t,r,n,o,i,a){var u=e+(t&n|r&~n)+(o>>>0)+a;return(u<>>32-i)+t},u._hh=function(e,t,r,n,o,i,a){var u=e+(t^r^n)+(o>>>0)+a;return(u<>>32-i)+t},u._ii=function(e,t,r,n,o,i,a){var u=e+(r^(t|~n))+(o>>>0)+a;return(u<>>32-i)+t},u._blocksize=16,u._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=n.wordsToBytes(u(e,t));return t&&t.asBytes?r:t&&t.asString?a.bytesToString(r):n.bytesToHex(r)}},824:e=>{var t=1e3,r=60*t,n=60*r,o=24*n;function i(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,a){a=a||{};var u,s,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var a=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===c&&isFinite(e))return a.long?(u=e,(s=Math.abs(u))>=o?i(u,s,o,"day"):s>=n?i(u,s,n,"hour"):s>=r?i(u,s,r,"minute"):s>=t?i(u,s,t,"second"):u+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=n?Math.round(e/n)+"h":i>=r?Math.round(e/r)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},670:(e,t,r)=>{"use strict";e.exports=r(607)},829:(e,t,r)=>{"use strict";var n,o,i,a=r(946),u="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";function s(){i=!1}function c(e){if(e){if(e!==n){if(e.length!==u.length)throw new Error("Custom alphabet for shortid must be "+u.length+" unique characters. You submitted "+e.length+" characters: "+e);var t=e.split("").filter((function(e,t,r){return t!==r.lastIndexOf(e)}));if(t.length)throw new Error("Custom alphabet for shortid must be "+u.length+" unique characters. These characters were not unique: "+t.join(", "));n=e,s()}}else n!==u&&(n=u,s())}function f(){return i||(i=function(){n||c(u);for(var e,t=n.split(""),r=[],o=a.nextValue();t.length>0;)o=a.nextValue(),e=Math.floor(o*t.length),r.push(t.splice(e,1)[0]);return r.join("")}())}e.exports={get:function(){return n||u},characters:function(e){return c(e),n},seed:function(e){a.seed(e),o!==e&&(s(),o=e)},lookup:function(e){return f()[e]},shuffled:f}},480:(e,t,r)=>{"use strict";var n,o,i=r(416);r(829),e.exports=function(e){var t="",r=Math.floor(.001*(Date.now()-1567752802062));return r===o?n++:(n=0,o=r),t+=i(7),t+=i(e),n>0&&(t+=i(n)),t+i(r)}},416:(e,t,r)=>{"use strict";var n=r(829),o=r(766),i=r(296);e.exports=function(e){for(var t,r=0,a="";!t;)a+=i(o,n.get(),1),t=e{"use strict";var n=r(829),o=r(480),i=r(82),a=r(636)||0;function u(){return o(a)}e.exports=u,e.exports.generate=u,e.exports.seed=function(t){return n.seed(t),e.exports},e.exports.worker=function(t){return a=t,e.exports},e.exports.characters=function(e){return void 0!==e&&n.characters(e),n.shuffled()},e.exports.isValid=i},82:(e,t,r)=>{"use strict";var n=r(829);e.exports=function(e){return!(!e||"string"!=typeof e||e.length<6||new RegExp("[^"+n.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]").test(e))}},766:e=>{"use strict";var t,r="object"==typeof window&&(window.crypto||window.msCrypto);t=r&&r.getRandomValues?function(e){return r.getRandomValues(new Uint8Array(e))}:function(e){for(var t=[],r=0;r{"use strict";var t=1;e.exports={nextValue:function(){return(t=(9301*t+49297)%233280)/233280},seed:function(e){t=e}}},636:e=>{"use strict";e.exports=0},296:e=>{e.exports=function(e,t,r){for(var n=(2<{"use strict";r.r(t),r.d(t,{default:()=>fe,$Size:()=>I,$all:()=>oe,$and:()=>ne,$elemMatch:()=>H,$eq:()=>U,$exists:()=>X,$gt:()=>Y,$gte:()=>G,$in:()=>z,$lt:()=>K,$lte:()=>W,$mod:()=>Z,$ne:()=>D,$nin:()=>V,$nor:()=>L,$not:()=>te,$options:()=>ae,$or:()=>B,$regex:()=>ee,$size:()=>ie,$type:()=>re,$where:()=>ue,EqualsOperation:()=>w,createDefaultQueryOperation:()=>ce,createEqualsOperation:()=>S,createOperationTester:()=>R,createQueryOperation:()=>j,createQueryTester:()=>N});var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function o(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(e){var t="[object "+e+"]";return function(e){return a(e)===t}},a=function(e){return Object.prototype.toString.call(e)},u=function(e){return e instanceof Date?e.getTime():s(e)?e.map(u):e&&"function"==typeof e.toJSON?e.toJSON():e},s=i("Array"),c=i("Object"),f=i("Function"),l=function(e,t){if(null==e&&e==t)return!0;if(e===t)return!0;if(Object.prototype.toString.call(e)!==Object.prototype.toString.call(t))return!1;if(s(e)){if(e.length!==t.length)return!1;for(var r=0,n=e.length;re}})),G=O((function(e){return function(t){return t>=e}})),Z=function(e,t,r){var n=e[0],o=e[1];return new w((function(e){return u(e)%n===o}),t,r)},X=function(e,t,r,n){return new Q(e,t,r,n)},ee=function(e,t,r){return new w(new RegExp(e,t.$options),t,r)},te=function(e,t,r,n){return new $(e,t,r,n)},re=function(e,t,r){return new w((function(t){return null!=t&&(t instanceof e||t.constructor===e)}),t,r)},ne=function(e,t,r,n){return new q(e,t,r,n)},oe=ne,ie=function(e,t,r){return new I(e,t,r,"$size")},ae=function(){return null},ue=function(e,t,r){var n;if(f(e))n=e;else{if(process.env.CSP_ENABLED)throw new Error('In CSP mode, sift does not support strings in "$where" condition');n=new Function("obj","return "+e)}return new w((function(e){return n.bind(e)(e)}),t,r)},se=Object.freeze({__proto__:null,$Size:I,$eq:U,$ne:D,$or:B,$nor:L,$elemMatch:H,$nin:V,$in:z,$lt:K,$lte:W,$gt:Y,$gte:G,$mod:Z,$exists:X,$regex:ee,$not:te,$type:re,$and:ne,$all:oe,$size:ie,$options:ae,$where:ue}),ce=function(e,t,r){var n=void 0===r?{}:r,o=n.compare,i=n.operations;return j(e,t,{compare:o,operations:Object.assign({},se,i||{})})};const fe=function(e,t){void 0===t&&(t={});var r=ce(e,null,t);return R(r)}},614:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{NIL:()=>N,parse:()=>y,stringify:()=>f,v1:()=>v,v3:()=>k,v4:()=>A,v5:()=>R,validate:()=>u,version:()=>P});var o=new Uint8Array(16);function i(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(o)}const a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,u=function(e){return"string"==typeof e&&a.test(e)};for(var s=[],c=0;c<256;++c)s.push((c+256).toString(16).substr(1));const f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase();if(!u(r))throw TypeError("Stringified UUID is invalid");return r};var l,p,h=0,d=0;const v=function(e,t,r){var n=t&&r||0,o=t||new Array(16),a=(e=e||{}).node||l,u=void 0!==e.clockseq?e.clockseq:p;if(null==a||null==u){var s=e.random||(e.rng||i)();null==a&&(a=l=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==u&&(u=p=16383&(s[6]<<8|s[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),v=void 0!==e.nsecs?e.nsecs:d+1,y=c-h+(v-d)/1e4;if(y<0&&void 0===e.clockseq&&(u=u+1&16383),(y<0||c>h)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=c,d=v,p=u;var m=(1e4*(268435455&(c+=122192928e5))+v)%4294967296;o[n++]=m>>>24&255,o[n++]=m>>>16&255,o[n++]=m>>>8&255,o[n++]=255&m;var g=c/4294967296*1e4&268435455;o[n++]=g>>>8&255,o[n++]=255&g,o[n++]=g>>>24&15|16,o[n++]=g>>>16&255,o[n++]=u>>>8|128,o[n++]=255&u;for(var b=0;b<6;++b)o[n+b]=a[b];return t||f(o)},y=function(e){if(!u(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function m(e,t,r){function n(e,n,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r>>9<<4)+1}function b(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function w(e,t,r,n,o,i){return b((a=b(b(t,e),b(n,i)))<<(u=o)|a>>>32-u,r);var a,u}function S(e,t,r,n,o,i,a){return w(t&r|~t&n,e,t,o,i,a)}function _(e,t,r,n,o,i,a){return w(t&n|r&~n,e,t,o,i,a)}function O(e,t,r,n,o,i,a){return w(t^r^n,e,t,o,i,a)}function x(e,t,r,n,o,i,a){return w(r^(t|~n),e,t,o,i,a)}const k=m("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r>5]>>>o%32&255,a=parseInt(n.charAt(i>>>4&15)+n.charAt(15&i),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[n/8])<>>32-t}const R=m("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var o=0;o>>0;b=g,g=m,m=C(y,30)>>>0,y=v,v=_}r[0]=r[0]+v>>>0,r[1]=r[1]+y>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+g>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),N="00000000-0000-0000-0000-000000000000",P=function(e){if(!u(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}}},t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(613)})(); \ No newline at end of file diff --git a/packages/client/dist/feathersjs-offline-client.min.js.LICENSE.txt b/packages/client/dist/feathersjs-offline-client.min.js.LICENSE.txt index d122ea6..bcceeb1 100644 --- a/packages/client/dist/feathersjs-offline-client.min.js.LICENSE.txt +++ b/packages/client/dist/feathersjs-offline-client.min.js.LICENSE.txt @@ -19,15 +19,3 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ - -/** - * @preserve - * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) - * - * @author Jens Taylor - * @see http://github.com/homebrewing/brauhaus-diff - * @author Gary Court - * @see http://github.com/garycourt/murmurhash-js - * @author Austin Appleby - * @see http://sites.google.com/site/murmurhash/ - */ diff --git a/packages/client/package.json b/packages/client/package.json index 667ff25..1475b73 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@feathersjs-offline/client", - "version": "1.0.8", + "version": "1.1.0", "description": "Client part of implementation of the own-data / own-net principles for supporting offline-first functionality for Feathers (mobile) applications.", "keywords": [ "feathers", diff --git a/packages/client/src/own-common/own-class.js b/packages/client/src/own-common/own-class.js index 67805cc..c7f641b 100644 --- a/packages/client/src/own-common/own-class.js +++ b/packages/client/src/own-common/own-class.js @@ -9,7 +9,6 @@ import snapshot from '../snapshot'; const debug = require('debug')('@feathersjs-offline:ownclass:service-base'); - const defaultOptions = { 'id': 'id', 'store': null, @@ -76,15 +75,6 @@ class OwnClass extends AdapterService { } this._setupPerformed = true; - if (typeof localStorage === 'undefined') { - debug('Simulating localStorage...'); - let LocalStorage = require('node-localstorage').LocalStorage; - global.localStorage = new LocalStorage('./.scratch'); - } - else { - debug('Utilizing built-in localStorage'); - } - this.options = this.wrapperOptions; let self = this; diff --git a/packages/client/test/own-common.test.js b/packages/client/test/own-common.test.js index 665d4e2..768ec8c 100644 --- a/packages/client/test/own-common.test.js +++ b/packages/client/test/own-common.test.js @@ -10,6 +10,9 @@ const eventsTests = require('./own-common/helpers/events-test'); const localStorageTests = require('./own-common/helpers/local-storage-test'); const restTests = require('./own-common/helpers/rest-test'); const socketioTests = require('./own-common/helpers/socket-io-test'); +let LocalStorage = require('node-localstorage').LocalStorage; +global.localStorage = new LocalStorage('./.scratch'); + const OwnClass = require('../src/own-common'); let package = 'ownclass'; diff --git a/packages/client/test/own-common/helpers/rest-test.js b/packages/client/test/own-common/helpers/rest-test.js index 0624e00..7303317 100644 --- a/packages/client/test/own-common/helpers/rest-test.js +++ b/packages/client/test/own-common/helpers/rest-test.js @@ -20,11 +20,11 @@ module.exports = (desc, _app, _errors, wrapperFn, serviceName, verbose, port = 7 .configure(rest(rest.formatter)) .use(express.json()) .use(serviceName, { - async get(id) { + async get (id) { return { id, get: 'ok' }; }, - async create(data) { + async create (data) { let myData = JSON.parse(JSON.stringify(data)); myData.create = 'ok'; return myData; @@ -36,7 +36,6 @@ module.exports = (desc, _app, _errors, wrapperFn, serviceName, verbose, port = 7 afterEach(done => server.close(done)); - it('can call service', async () => { wrapperFn(app, serviceName, {}); let result = null; diff --git a/packages/client/test/own-common/helpers/socket-io-test.js b/packages/client/test/own-common/helpers/socket-io-test.js index 61ef518..b075ba2 100644 --- a/packages/client/test/own-common/helpers/socket-io-test.js +++ b/packages/client/test/own-common/helpers/socket-io-test.js @@ -7,7 +7,6 @@ const socketioClient = require('@feathersjs/socketio-client'); const { Service } = require('feathers-memory'); const delay = require('./delay'); - module.exports = (desc, _app, _errors, wrapperFn, serviceName, verbose, port = 7886, isBaseClass = false) => { describe(desc, () => { const url = `http://localhost:${port}`; @@ -16,17 +15,16 @@ module.exports = (desc, _app, _errors, wrapperFn, serviceName, verbose, port = 7 let cApp = null; let server = null; - beforeEach(done => { app = feathers(); app.configure(socketio()); app.use(serviceName, { - async get(id) { + async get (id) { return Promise.resolve({ id, get: 'ok' }); }, - async create(data) { + async create (data) { let myData = JSON.parse(JSON.stringify(data)); myData.create = 'ok'; return Promise.resolve(myData); diff --git a/packages/client/test/own-common/helpers/wrapper-basic-test.js b/packages/client/test/own-common/helpers/wrapper-basic-test.js index 8015a4e..33ae1b4 100644 --- a/packages/client/test/own-common/helpers/wrapper-basic-test.js +++ b/packages/client/test/own-common/helpers/wrapper-basic-test.js @@ -104,7 +104,6 @@ module.exports = (test, _app, _errors, wrapper, serviceName, verbose) => { expect(flag).to.equal('OK', `Unexpectedly failed to ignore multiple setup() err=${err.name}, ${err.message}`); }); - it('should setup wrapped service', async () => { app = feathers(); @@ -113,7 +112,7 @@ module.exports = (test, _app, _errors, wrapper, serviceName, verbose) => { let passedPath; app.use(serviceName, { - setup(app, path) { + setup (app, path) { setupCalled = true; passedApp = app; passedPath = path @@ -136,11 +135,11 @@ module.exports = (test, _app, _errors, wrapper, serviceName, verbose) => { let setupCalled = false; app.use(serviceName, { - setup(app, path) { + setup (app, path) { setupCalled = true; }, find (params) { - return [ { data: {id: 1, text: "You won!"} } ] + return [ { data: {id: 1, text: 'You won!'} } ] } }); app.service(serviceName).hooks({ diff --git a/packages/server/CHANGELOG.md b/packages/server/CHANGELOG.md index ac8ea53..0e5ffa6 100644 --- a/packages/server/CHANGELOG.md +++ b/packages/server/CHANGELOG.md @@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.0](http://github.com/feathersjs-offline/owndata-ownnet/packages/server/compare/v1.0.7...v1.0.8) (2021-07-30) - +**Note:** Version bump only for package @feathersjs-offline/server ## [1.0.8](http://github.com/feathersjs-offline/owndata-ownnet/packages/server/compare/v1.0.7...v1.0.8) (2021-07-17) diff --git a/packages/server/package.json b/packages/server/package.json index 809b531..fe48833 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@feathersjs-offline/server", - "version": "1.0.8", + "version": "1.1.0", "description": "Server part of implementation of the own-data / own-net principles for supporting offline-first functionality for Feathers (mobile) applications.", "keywords": [ "Feathersjs", diff --git a/packages/server/test/rest.test.js b/packages/server/test/rest.test.js index adbd8d5..3250293 100644 --- a/packages/server/test/rest.test.js +++ b/packages/server/test/rest.test.js @@ -13,10 +13,9 @@ const { rest } = express; let desc = 'RealtimeWrapper REST support'; let wrapperFn = realtimeWrapper; -let serviceName = "code"; +let serviceName = 'code'; let port = 7886; - describe(desc, () => { let server; let app; @@ -26,11 +25,11 @@ describe(desc, () => { .configure(rest(rest.formatter)) .use(express.json()) .use(serviceName, { - async get(id) { + async get (id) { return Promise.resolve({ id, get: 'ok' }); }, - async create(data) { + async create (data) { let myData = JSON.parse(JSON.stringify(data)); myData.create = 'ok'; return Promise.resolve(myData); @@ -42,7 +41,6 @@ describe(desc, () => { afterEach(done => server.close(done)); - it('can call service', async () => { wrapperFn(app, serviceName, {}); let result = null; diff --git a/packages/server/test/server.test.js b/packages/server/test/server.test.js index 740c734..388120b 100644 --- a/packages/server/test/server.test.js +++ b/packages/server/test/server.test.js @@ -103,7 +103,7 @@ describe('RealtimeServerWrapper', () => { let passedPath; app.use(path, { - setup(app, path) { + setup (app, path) { setupCalled = true; passedApp = app; passedPath = path @@ -126,11 +126,11 @@ describe('RealtimeServerWrapper', () => { let setupCalled = false; app.use(path, { - setup(app, path) { + setup (app, path) { setupCalled = true; }, - find(params) { - return [{ data: { id: 1, text: "You won!" } }] + find (params) { + return [{ data: { id: 1, text: 'You won!' } }] } }); app.service(path).hooks({ @@ -155,7 +155,6 @@ describe('RealtimeServerWrapper', () => { }); }); - describe('real-life tests', () => { // Let's perform all the usual adapter tests to verify full functionality app = feathers(); @@ -673,7 +672,7 @@ describe('RealtimeServerWrapper', () => { // Helpers -function delay(ms = 0) { +function delay (ms = 0) { return data => new Promise(resolve => { setTimeout(() => { resolve(data); diff --git a/packages/server/test/socket-io.test.js b/packages/server/test/socket-io.test.js index 3850208..c27c846 100644 --- a/packages/server/test/socket-io.test.js +++ b/packages/server/test/socket-io.test.js @@ -6,8 +6,6 @@ const socketio = require('@feathersjs/socketio'); const socketioClient = require('@feathersjs/socketio-client'); const { realtimeWrapper } = require('../src'); - - let desc = 'RealtimeWrapper socket.io support'; let wrapperFn = realtimeWrapper; let serviceName = 'codes'; @@ -20,17 +18,16 @@ describe(desc, () => { let cApp = null; let server = null; - beforeEach(done => { app = feathers(); app.configure(socketio()); app.use(serviceName, { - async get(id) { + async get (id) { return Promise.resolve({ id, get: 'ok' }); }, - async create(data) { + async create (data) { let myData = JSON.parse(JSON.stringify(data)); myData.create = 'ok'; return Promise.resolve(myData);